@44-audio/components 0.1.0-dev.2 → 0.1.0-dev.21

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/player.es.js CHANGED
@@ -1,215 +1,2530 @@
1
- import { h as Q, t as ne, d as le, c as W, p as X, a as Y, b as M, s as d, f as m, A as de, e as h, g as b, i as k, j as i, k as Z, l as R, m as P, n as f, u as ce, r as y, o as I, q as z, v as S, w as V, x as N, y as ue, z as ve, B as ge } from "./AudioPlayer-bUgQMAfs.mjs";
2
- function fe(a, t, s, r) {
3
- var n = a.__style;
4
- if (Q || n !== t) {
5
- var c = ne(t);
6
- (!Q || c !== a.getAttribute("style")) && (c == null ? a.removeAttribute("style") : a.style.cssText = c), a.__style = t;
7
- }
8
- return r;
9
- }
10
- function me(a, t) {
11
- d(t, !f(t));
12
- }
13
- var pe = m('&bull; <button class="link svelte-8utcjm"> </button>', 1), _e = (a, t) => d(t, !0), he = m(' <button class="link svelte-8utcjm">Show more</button>', 1), be = (a, t) => d(t, !1), ye = m(' <button class="link svelte-8utcjm">Show less</button>', 1), ke = m('<div class="details svelte-8utcjm"><div class="title svelte-8utcjm">Transcription <!></div> <div class="transcription"><!></div></div>'), xe = m('<div class="container svelte-8utcjm" role="group" aria-label="44 audio player"><div class="display svelte-8utcjm"><!></div> <!></div>');
14
- const je = {
15
- hash: "svelte-8utcjm",
16
- code: "button.svelte-8utcjm {font:inherit;margin:0;padding:0;box-sizing:border-box;border:none;background:none;cursor:pointer;}.link.svelte-8utcjm {background:none;border:none;color:var(--44-color-2);cursor:pointer;padding:0;font:inherit;}.link.svelte-8utcjm:hover {color:var(--44-color-3);text-decoration:underline;}.container.svelte-8utcjm {padding:16px;}.display.svelte-8utcjm {display:flex;align-items:center;gap:12px;}.details.svelte-8utcjm .title:where(.svelte-8utcjm) {font-weight:bold;margin-top:16px;margin-bottom:8px;}"
1
+ import { b as Ke, E as ot, a as Xe, d as wt, n as xt, h as qe, c as Ze, e as at, i as kt, f as _t, s as zt, g as nt, j as Fe, k as it, U as Pt, p as lt, l as ue, m as ge, o as d, u as de, q as e, r as S, t as Lt, v as se, w as te, x as k, y as ye, z as m, A as et, B as q, C as v, D as J, F as X, G as Pe, H as M, I as W, J as he, K as we, L as K, M as D, N as tt, O as Ee, P as Se, Q as me, R as We, S as pe, T as He, V as ie, W as Et, X as Le, Y as It, Z as st, _ as Be, $ as ut, a0 as Ne, a1 as Ce, a2 as Re, a3 as Z } from "./index-DCaqXYMO.js";
2
+ function Ae(g, t, ...u) {
3
+ var a = g, n = xt, o;
4
+ Ke(() => {
5
+ n !== (n = t()) && (o && (wt(o), o = null), o = Xe(() => (
6
+ /** @type {SnippetFn} */
7
+ n(a, ...u)
8
+ )));
9
+ }, ot), qe && (a = Ze);
10
+ }
11
+ function Ct(g, t, u) {
12
+ qe && at();
13
+ var a = g, n = Pt, o, l, s = null, y = kt() ? _t : zt;
14
+ function h() {
15
+ o && lt(o), s !== null && (s.lastChild.remove(), a.before(s), s = null), o = l;
16
+ }
17
+ Ke(() => {
18
+ if (y(n, n = t())) {
19
+ var c = a, x = it();
20
+ x && (s = document.createDocumentFragment(), s.append(c = nt())), l = Xe(() => u(c)), x ? Fe.add_callback(h) : h();
21
+ }
22
+ }), qe && (a = Ze);
23
+ }
24
+ function Rt(g, t, u) {
25
+ qe && at();
26
+ var a = g, n, o, l = null, s = null;
27
+ function y() {
28
+ o && (lt(o), o = null), l && (l.lastChild.remove(), a.before(l), l = null), o = s, s = null;
29
+ }
30
+ Ke(() => {
31
+ if (n !== (n = t())) {
32
+ var h = it();
33
+ if (n) {
34
+ var c = a;
35
+ h && (l = document.createDocumentFragment(), l.append(c = nt()), o && Fe.skipped_effects.add(o)), s = Xe(() => u(c, n));
36
+ }
37
+ h ? Fe.add_callback(y) : y();
38
+ }
39
+ }, ot), qe && (a = Ze);
40
+ }
41
+ const Oe = {
42
+ delay: 0
17
43
  };
18
- function $(a, t) {
19
- X(t, !0), Y(a, je);
20
- let s = M(t, "recordingId", 7), r = M(t, "recording", 7), n = M(t, "audioRef", 7), c = R(!1), p = R(!1), E = R(0), _ = R("idle");
21
- n().addEventListener("play", () => {
22
- d(_, "playing");
23
- }), n().addEventListener("pause", () => {
24
- d(_, "paused");
25
- }), n().addEventListener("ended", () => {
26
- d(_, "idle"), d(E, 0);
27
- }), n().addEventListener("timeupdate", () => {
28
- d(E, n().currentTime * 1e3);
44
+ typeof window < "u" && (window.__44_dev = Oe);
45
+ function Tt(g) {
46
+ return new Promise((t) => setTimeout(t, g));
47
+ }
48
+ async function Mt(g, t, u) {
49
+ const a = `https://${t}/v1/recordings/${u}/player`;
50
+ Oe.delay > 0 && await Tt(Oe.delay);
51
+ const n = await fetch(a, { signal: g });
52
+ if (!n.ok)
53
+ throw n.status === 404 ? new Error(`Recording not found: ${u}`) : new Error(`Failed to fetch recording (${n.status})`);
54
+ const o = await n.json();
55
+ if (o.status !== "ready")
56
+ throw new Error(`Recording not ready: ${u}`);
57
+ return o;
58
+ }
59
+ var Ht = X("<audio hidden></audio>");
60
+ function jt(g, t) {
61
+ ge(t, !0);
62
+ const u = t.$$host;
63
+ let a = d(t, "recordingId", 7), n = d(t, "apiHost", 7, "api.44.audio"), o = d(t, "preload", 7, "none"), l = S(null), s = S(null), y = S(0), h = S(0), c = S("idle"), x = null, f = null;
64
+ const i = q(() => ({
65
+ waveform: e(l)?.waveform ?? [],
66
+ transcription: e(l)?.transcription ?? null,
67
+ translation: e(l)?.translation ?? null,
68
+ words: e(l)?.words ?? null
69
+ }));
70
+ function _() {
71
+ u.duration = e(h), u.currentTime = e(y), u.state = e(c), u.metadata = e(i), u.setAttribute("data-state", e(c));
72
+ }
73
+ function p(b) {
74
+ _(), u.dispatchEvent(new CustomEvent(b, { bubbles: !0, composed: !0 }));
75
+ }
76
+ function w() {
77
+ if (!e(s)) {
78
+ f = null;
79
+ return;
80
+ }
81
+ m(y, Math.floor(e(s).currentTime * 1e3), !0), p("timeupdate"), f = requestAnimationFrame(w);
82
+ }
83
+ async function C() {
84
+ if (e(c) === "idle") {
85
+ if (!a()) {
86
+ console.warn("fortyfour-recording: recording-id attribute is required");
87
+ return;
88
+ }
89
+ x = new AbortController(), m(c, "loading"), p("loading");
90
+ try {
91
+ const b = await Mt(x.signal, n(), a());
92
+ m(l, b, !0), m(h, b.duration, !0), m(c, "ready"), p("loadedmetadata");
93
+ } catch (b) {
94
+ if (b.name === "AbortError")
95
+ return;
96
+ console.warn(`fortyfour-recording: ${b.message}`), m(c, "error"), p("error");
97
+ }
98
+ }
99
+ }
100
+ async function U() {
101
+ if (!e(s)) {
102
+ console.warn("fortyfour-recording: play() called but audio element not ready");
103
+ return;
104
+ }
105
+ try {
106
+ await e(s).play(), m(c, "playing"), p("play"), f || w();
107
+ } catch (b) {
108
+ console.warn(`fortyfour-recording: ${b.message}`), m(c, "error"), p("error");
109
+ }
110
+ }
111
+ function G() {
112
+ if (!e(s)) {
113
+ console.warn("fortyfour-recording: pause() called but audio element not ready");
114
+ return;
115
+ }
116
+ e(s).pause(), m(c, "paused"), cancelAnimationFrame(f), f = null, p("pause");
117
+ }
118
+ async function F() {
119
+ if (e(c) === "error") {
120
+ console.warn("fortyfour-recording: togglePlay() called while in error state");
121
+ return;
122
+ }
123
+ e(c) !== "loading" && (e(c) === "playing" ? G() : e(c) === "idle" ? (await C(), await et(), e(c) === "ready" && await U()) : await U());
124
+ }
125
+ function re(b) {
126
+ if (!e(s)) {
127
+ console.warn("fortyfour-recording: seek() called but audio element not ready");
128
+ return;
129
+ }
130
+ if (typeof b != "number" || Number.isNaN(b)) {
131
+ console.warn("fortyfour-recording: seek() called with invalid time:", b);
132
+ return;
133
+ }
134
+ if (b < 0 || b > e(h)) {
135
+ console.warn("fortyfour-recording: seek() time out of range:", b, "duration:", e(h));
136
+ return;
137
+ }
138
+ e(s).currentTime = b / 1e3, m(y, Math.floor(b), !0), p("timeupdate");
139
+ }
140
+ async function V() {
141
+ cancelAnimationFrame(f), f = null, m(y, e(h), !0), p("timeupdate"), await et(), m(y, 0), e(s).currentTime = 0, p("timeupdate"), m(c, "ready"), p("ended");
142
+ }
143
+ function H(b) {
144
+ console.warn("fortyfour-recording: audio error", b.target.error), m(c, "error"), p("error");
145
+ }
146
+ function be() {
147
+ x?.abort(), cancelAnimationFrame(f), f = null, e(s)?.pause(), m(l, null), m(y, 0), m(h, 0), m(c, "idle"), I = a(), p("timeupdate");
148
+ }
149
+ let I = a();
150
+ de(() => {
151
+ a() !== I && be(), e(c) === "idle" && (o() === "auto" || o() === "metadata") && C();
152
+ }), u.togglePlay = F, u.pause = G, u.seek = re, _(), Lt(() => {
153
+ x?.abort(), e(s)?.pause(), cancelAnimationFrame(f);
29
154
  });
30
- var F = {
155
+ var j = {
31
156
  get recordingId() {
157
+ return a();
158
+ },
159
+ set recordingId(b) {
160
+ a(b), v();
161
+ },
162
+ get apiHost() {
163
+ return n();
164
+ },
165
+ set apiHost(b = "api.44.audio") {
166
+ n(b), v();
167
+ },
168
+ get preload() {
169
+ return o();
170
+ },
171
+ set preload(b = "none") {
172
+ o(b), v();
173
+ }
174
+ }, B = se(), ee = te(B);
175
+ return Ct(ee, a, (b) => {
176
+ var L = se(), Q = te(L);
177
+ {
178
+ var ve = (E) => {
179
+ var R = Ht();
180
+ Pe(R, (r) => m(s, r), () => e(s)), M(() => {
181
+ W(R, "src", e(l).audioUrl), W(R, "preload", o() === "auto" ? "auto" : "none");
182
+ }), he("ended", R, V), he("error", R, H), k(E, R);
183
+ };
184
+ J(Q, (E) => {
185
+ e(l)?.audioUrl && E(ve);
186
+ });
187
+ }
188
+ k(b, L);
189
+ }), k(g, B), ye(j);
190
+ }
191
+ customElements.define("fortyfour-recording", ue(
192
+ jt,
193
+ {
194
+ apiHost: { attribute: "api-host", reflect: !0 },
195
+ recordingId: { attribute: "recording-id", reflect: !0 },
196
+ preload: { reflect: !0 }
197
+ },
198
+ [],
199
+ [],
200
+ !1
201
+ ));
202
+ function Ie(g) {
203
+ if (isNaN(g) || g < 0)
204
+ return "-:--";
205
+ const t = Math.floor(g / 3600), u = Math.floor(g % 3600 / 60), a = g % 60;
206
+ return t > 0 ? `${t}:${u.toString().padStart(2, "0")}:${a.toString().padStart(2, "0")}` : `${u}:${a.toString().padStart(2, "0")}`;
207
+ }
208
+ function rt(g) {
209
+ if (isNaN(g) || g < 0)
210
+ return "--";
211
+ const t = Math.floor(g / 1e3), u = Math.floor(t / 60), a = t % 60;
212
+ return u > 0 ? `${u}m ${a}s` : `${a}s`;
213
+ }
214
+ function Me(g) {
215
+ if (isNaN(g) || g < 0)
216
+ return "0 seconds";
217
+ const t = Math.floor(g / 1e3), u = Math.floor(t / 60), a = t % 60;
218
+ return u > 0 && a > 0 ? `${u} ${u === 1 ? "minute" : "minutes"} ${a} ${a === 1 ? "second" : "seconds"}` : u > 0 ? `${u} ${u === 1 ? "minute" : "minutes"}` : `${a} ${a === 1 ? "second" : "seconds"}`;
219
+ }
220
+ function Ye(g, t = 200) {
221
+ let u = S(!1);
222
+ return de(() => {
223
+ if (g()) {
224
+ const a = setTimeout(() => m(u, !0), t);
225
+ return () => clearTimeout(a);
226
+ } else
227
+ m(u, !1);
228
+ }), () => e(u);
229
+ }
230
+ function Te(g, t, u) {
231
+ de(() => {
232
+ u() ? g.setAttribute(t, "") : g.removeAttribute(t);
233
+ });
234
+ }
235
+ var St = X("<span><!></span>");
236
+ const qt = {
237
+ hash: "svelte-hrw77x",
238
+ code: `:host {--fortyfour-duration-font-family: system-ui, sans-serif;--fortyfour-duration-font-size: 14px;--fortyfour-duration-color: #1f2937;display:flex;align-items:center;justify-content:center;font-family:var(--fortyfour-duration-font-family);font-size:var(--fortyfour-duration-font-size);font-variant-numeric:tabular-nums;color:var(--fortyfour-duration-color);min-height:1lh;white-space:nowrap;}
239
+
240
+ @media (prefers-color-scheme: dark) {:host {--fortyfour-duration-color: #f3f4f6;}
241
+ }`
242
+ };
243
+ function At(g, t) {
244
+ ge(t, !0), we(g, qt);
245
+ const u = t.$$host;
246
+ let a = d(t, "for", 7, ""), n = d(t, "format", 7, "elapsed/total"), o = S(0), l = S(0);
247
+ function s(_, p, w) {
248
+ const C = Math.floor(_ / 1e3), U = Math.floor(p / 1e3), G = Math.max(0, U - C);
249
+ switch (w) {
250
+ case "-remaining":
251
+ return "-" + Ie(G);
252
+ case "remaining":
253
+ return Ie(G);
254
+ case "elapsed":
255
+ return Ie(C);
256
+ case "elapsed-text":
257
+ return rt(_);
258
+ case "total":
259
+ return Ie(U);
260
+ case "elapsed/total":
261
+ return Ie(C) + " / " + Ie(U);
262
+ case "remaining-text":
263
+ return rt(Math.max(0, p - _));
264
+ case "%":
265
+ return Math.min(100, Math.ceil(_ / p * 100)) + "%";
266
+ default:
267
+ return console.warn(`fortyfour-duration: invalid format "${w}"`), null;
268
+ }
269
+ }
270
+ function y(_) {
271
+ switch (_) {
272
+ case "-remaining":
273
+ return "-0:00";
274
+ case "remaining":
275
+ case "elapsed":
276
+ case "total":
277
+ return "0:00";
278
+ case "elapsed/total":
279
+ return "0:00 / 0:00";
280
+ case "%":
281
+ return "0%";
282
+ default:
283
+ return "0";
284
+ }
285
+ }
286
+ Te(u, "data-placeholder", () => e(l) === 0), de(() => {
287
+ if (!a()) {
288
+ console.warn("fortyfour-duration: for attribute is required");
289
+ return;
290
+ }
291
+ const p = u.getRootNode().getElementById(a());
292
+ if (!p) {
293
+ console.warn(`fortyfour-duration: element with id "${a()}" not found`);
294
+ return;
295
+ }
296
+ m(l, p.duration || 0, !0), m(o, p.currentTime || 0, !0);
297
+ function w() {
298
+ m(o, p.currentTime, !0), m(l, p.duration, !0);
299
+ }
300
+ return p.addEventListener("loadedmetadata", w), p.addEventListener("timeupdate", w), () => {
301
+ p.removeEventListener("loadedmetadata", w), p.removeEventListener("timeupdate", w);
302
+ };
303
+ });
304
+ var h = {
305
+ get for() {
306
+ return a();
307
+ },
308
+ set for(_ = "") {
309
+ a(_), v();
310
+ },
311
+ get format() {
312
+ return n();
313
+ },
314
+ set format(_ = "elapsed/total") {
315
+ n(_), v();
316
+ }
317
+ }, c = St(), x = K(c);
318
+ {
319
+ var f = (_) => {
320
+ var p = tt();
321
+ M((w) => Ee(p, w), [
322
+ () => s(e(o), e(l), n())
323
+ ]), k(_, p);
324
+ }, i = (_) => {
325
+ var p = se(), w = te(p);
326
+ Se(w, t, "placeholder", {}, (C) => {
327
+ var U = tt();
328
+ M((G) => Ee(U, G), [() => y(n())]), k(C, U);
329
+ }), k(_, p);
330
+ };
331
+ J(x, (_) => {
332
+ e(l) !== 0 ? _(f) : _(i, !1);
333
+ });
334
+ }
335
+ return D(c), k(g, c), ye(h);
336
+ }
337
+ customElements.define("fortyfour-duration", ue(
338
+ At,
339
+ {
340
+ for: { attribute: "for", reflect: !0 },
341
+ format: { attribute: "format", reflect: !0 }
342
+ },
343
+ ["placeholder"],
344
+ [],
345
+ !0
346
+ ));
347
+ var Bt = X('<div part="ring" class="ring-progress svelte-qaqt0h"><div class="ring-inner svelte-qaqt0h"></div></div>');
348
+ const Nt = {
349
+ hash: "svelte-qaqt0h",
350
+ code: `.ring-progress.svelte-qaqt0h {position:absolute;inset:0;z-index:0;border-radius:inherit;pointer-events:none;background:conic-gradient(
351
+ from 0deg,
352
+ var(--fortyfour-play-button-ring-fill-color) var(--progress-deg),
353
+ var(--fortyfour-play-button-ring-track-color) var(--progress-deg)
354
+ );}.ring-inner.svelte-qaqt0h {position:absolute;inset:var(--fortyfour-play-button-ring-width);border-radius:inherit;background:var(--fortyfour-play-button-background-color);}`
355
+ };
356
+ function Ve(g, t) {
357
+ ge(t, !0), we(g, Nt);
358
+ let u = d(t, "progress", 7, 0);
359
+ const a = q(() => u() * 360);
360
+ var n = {
361
+ get progress() {
362
+ return u();
363
+ },
364
+ set progress(l = 0) {
365
+ u(l), v();
366
+ }
367
+ }, o = Bt();
368
+ return M(() => me(o, `--progress-deg: ${e(a) ?? ""}deg`)), k(g, o), ye(n);
369
+ }
370
+ ue(Ve, { progress: {} }, [], [], !0);
371
+ var Wt = X('<div part="ripple" class="ripple ripple-small svelte-lgp3pt"></div>'), Dt = X('<div part="ripple" class="ripple ripple-medium svelte-lgp3pt"></div>'), Ut = X('<div part="ripple" class="ripple ripple-large svelte-lgp3pt"></div>'), Ft = X("<!> <!> <!>", 1);
372
+ const Ot = {
373
+ hash: "svelte-lgp3pt",
374
+ code: `.ripple.svelte-lgp3pt {position:absolute;inset:0;border-radius:inherit;border:2px solid var(--fortyfour-play-button-background-color);pointer-events:none;
375
+ animation: ripple 1.5s ease-out infinite;}.ripple-small.svelte-lgp3pt {
376
+ animation-name: svelte-lgp3pt-ripple-small;}.ripple-medium.svelte-lgp3pt {
377
+ animation-name: svelte-lgp3pt-ripple-medium;}.ripple-large.svelte-lgp3pt {
378
+ animation-name: svelte-lgp3pt-ripple-large;}
379
+
380
+ @keyframes svelte-lgp3pt-ripple-small {
381
+ 0% {
382
+ transform: scale(1);
383
+ opacity: 0.4;
384
+ }
385
+ 100% {
386
+ transform: scale(calc(1 + 0.15 * var(--intensity, 1)));
387
+ opacity: 0;
388
+ }
389
+ }
390
+
391
+ @keyframes svelte-lgp3pt-ripple-medium {
392
+ 0% {
393
+ transform: scale(1);
394
+ opacity: 0.5;
395
+ }
396
+ 100% {
397
+ transform: scale(calc(1 + 0.3 * var(--intensity, 1)));
398
+ opacity: 0;
399
+ }
400
+ }
401
+
402
+ @keyframes svelte-lgp3pt-ripple-large {
403
+ 0% {
404
+ transform: scale(1);
405
+ opacity: 0.6;
406
+ }
407
+ 100% {
408
+ transform: scale(calc(1 + 0.5 * var(--intensity, 1)));
409
+ opacity: 0;
410
+ }
411
+ }
412
+
413
+ @media (prefers-reduced-motion: reduce) {.ripple.svelte-lgp3pt {
414
+ animation: none;}
415
+ }`
416
+ };
417
+ function Je(g, t) {
418
+ ge(t, !0), we(g, Ot);
419
+ let u = d(t, "isPlaying", 7, !1), a = d(t, "amplitude", 7, 0), n = d(t, "intensity", 7, 1), o = S(We({ small: !1, medium: !1, large: !1 }));
420
+ function l(w) {
421
+ return w < 33 ? "small" : w < 66 ? "medium" : "large";
422
+ }
423
+ de(() => {
424
+ if (!u()) {
425
+ m(o, { small: !1, medium: !1, large: !1 }, !0);
426
+ return;
427
+ }
428
+ const w = l(a());
429
+ e(o)[w] || (e(o)[w] = !0);
430
+ });
431
+ function s(w) {
432
+ e(o)[w] = !1;
433
+ }
434
+ var y = {
435
+ get isPlaying() {
436
+ return u();
437
+ },
438
+ set isPlaying(w = !1) {
439
+ u(w), v();
440
+ },
441
+ get amplitude() {
442
+ return a();
443
+ },
444
+ set amplitude(w = 0) {
445
+ a(w), v();
446
+ },
447
+ get intensity() {
448
+ return n();
449
+ },
450
+ set intensity(w = 1) {
451
+ n(w), v();
452
+ }
453
+ }, h = Ft(), c = te(h);
454
+ {
455
+ var x = (w) => {
456
+ var C = Wt();
457
+ M(() => me(C, `--intensity: ${n() ?? ""};`)), he("animationend", C, () => s("small")), k(w, C);
458
+ };
459
+ J(c, (w) => {
460
+ e(o).small && w(x);
461
+ });
462
+ }
463
+ var f = pe(c, 2);
464
+ {
465
+ var i = (w) => {
466
+ var C = Dt();
467
+ M(() => me(C, `--intensity: ${n() ?? ""};`)), he("animationend", C, () => s("medium")), k(w, C);
468
+ };
469
+ J(f, (w) => {
470
+ e(o).medium && w(i);
471
+ });
472
+ }
473
+ var _ = pe(f, 2);
474
+ {
475
+ var p = (w) => {
476
+ var C = Ut();
477
+ M(() => me(C, `--intensity: ${n() ?? ""};`)), he("animationend", C, () => s("large")), k(w, C);
478
+ };
479
+ J(_, (w) => {
480
+ e(o).large && w(p);
481
+ });
482
+ }
483
+ return k(g, h), ye(y);
484
+ }
485
+ ue(Je, { isPlaying: {}, amplitude: {}, intensity: {} }, [], [], !0);
486
+ var Gt = (g, t) => {
487
+ g.currentTarget.focus({ preventScroll: !0 }), t()?.(g);
488
+ }, Kt = X('<div class="shape-wrapper svelte-103okfy"><!> <button part="button"><!> <span part="icon" class="icon svelte-103okfy"><!></span></button></div>');
489
+ const Xt = {
490
+ hash: "svelte-103okfy",
491
+ code: `.shape-wrapper.svelte-103okfy {position:relative;width:var(--fortyfour-play-button-size, 48px);height:var(--fortyfour-play-button-size, 48px);font-size:var(--fortyfour-play-button-size, 48px);}.play-button.svelte-103okfy {position:relative;width:100%;height:100%;border:var(--fortyfour-play-button-border-width) solid
492
+ var(--fortyfour-play-button-border-color);cursor:pointer;display:flex;align-items:center;justify-content:center;background:var(--fortyfour-play-button-background-color);color:var(--fortyfour-play-button-icon-color);}.play-button.svelte-103okfy:focus-visible {outline:var(--fortyfour-play-button-focus-width) solid var(--fortyfour-play-button-focus-color);outline-offset:var(--fortyfour-play-button-focus-offset);}.play-button.svelte-103okfy:disabled {opacity:0.5;cursor:not-allowed;}.play-button.has-ring-progress.svelte-103okfy {border:none;}.icon.svelte-103okfy {position:relative;z-index:1;width:1em;height:1em;display:flex;align-items:center;justify-content:center;}.icon.svelte-103okfy svg {width:100%;height:100%;fill:currentColor;}`
493
+ };
494
+ function De(g, t) {
495
+ ge(t, !0), we(g, Xt);
496
+ let u = d(t, "onclick", 7), a = d(t, "disabled", 7, !1), n = d(t, "loading", 7, !1), o = d(t, "visualization", 7, "none"), l = d(t, "progressPercent", 7, 0), s = d(t, "isPlaying", 7, !1), y = d(t, "amplitude", 7, 0), h = d(t, "rippleIntensity", 7, 1), c = d(t, "ariaLabel", 7, "Play"), x = d(t, "borderRadius", 7, "50%"), f = d(t, "children", 7);
497
+ var i = {
498
+ get onclick() {
499
+ return u();
500
+ },
501
+ set onclick(H) {
502
+ u(H), v();
503
+ },
504
+ get disabled() {
505
+ return a();
506
+ },
507
+ set disabled(H = !1) {
508
+ a(H), v();
509
+ },
510
+ get loading() {
511
+ return n();
512
+ },
513
+ set loading(H = !1) {
514
+ n(H), v();
515
+ },
516
+ get visualization() {
517
+ return o();
518
+ },
519
+ set visualization(H = "none") {
520
+ o(H), v();
521
+ },
522
+ get progressPercent() {
523
+ return l();
524
+ },
525
+ set progressPercent(H = 0) {
526
+ l(H), v();
527
+ },
528
+ get isPlaying() {
529
+ return s();
530
+ },
531
+ set isPlaying(H = !1) {
532
+ s(H), v();
533
+ },
534
+ get amplitude() {
535
+ return y();
536
+ },
537
+ set amplitude(H = 0) {
538
+ y(H), v();
539
+ },
540
+ get rippleIntensity() {
541
+ return h();
542
+ },
543
+ set rippleIntensity(H = 1) {
544
+ h(H), v();
545
+ },
546
+ get ariaLabel() {
547
+ return c();
548
+ },
549
+ set ariaLabel(H = "Play") {
550
+ c(H), v();
551
+ },
552
+ get borderRadius() {
553
+ return x();
554
+ },
555
+ set borderRadius(H = "50%") {
556
+ x(H), v();
557
+ },
558
+ get children() {
559
+ return f();
560
+ },
561
+ set children(H) {
562
+ f(H), v();
563
+ }
564
+ }, _ = Kt(), p = K(_);
565
+ {
566
+ var w = (H) => {
567
+ Je(H, {
568
+ get isPlaying() {
569
+ return s();
570
+ },
571
+ get amplitude() {
572
+ return y();
573
+ },
574
+ get intensity() {
575
+ return h();
576
+ }
577
+ });
578
+ };
579
+ J(p, (H) => {
580
+ o() === "ripple" && H(w);
581
+ });
582
+ }
583
+ var C = pe(p, 2);
584
+ let U;
585
+ C.__click = [Gt, u];
586
+ var G = K(C);
587
+ {
588
+ var F = (H) => {
589
+ Ve(H, {
590
+ get progress() {
591
+ return l();
592
+ }
593
+ });
594
+ };
595
+ J(G, (H) => {
596
+ o() === "ring" && H(F);
597
+ });
598
+ }
599
+ var re = pe(G, 2), V = K(re);
600
+ return Ae(V, f), D(re), D(C), D(_), M(
601
+ (H) => {
602
+ me(_, `border-radius: ${x() ?? ""}`), U = ie(C, 1, "play-button svelte-103okfy", null, U, H), C.disabled = a(), W(C, "aria-label", c()), W(C, "aria-busy", n()), me(C, `border-radius: ${x() ?? ""}`);
603
+ },
604
+ [() => ({ "has-ring-progress": o() === "ring" })]
605
+ ), k(g, _), ye(i);
606
+ }
607
+ He(["click"]);
608
+ ue(
609
+ De,
610
+ {
611
+ onclick: {},
612
+ disabled: {},
613
+ loading: {},
614
+ visualization: {},
615
+ progressPercent: {},
616
+ isPlaying: {},
617
+ amplitude: {},
618
+ rippleIntensity: {},
619
+ ariaLabel: {},
620
+ borderRadius: {},
621
+ children: {}
622
+ },
623
+ [],
624
+ [],
625
+ !0
626
+ );
627
+ function Ge(g, t) {
628
+ ge(t, !0);
629
+ let u = d(t, "onclick", 7), a = d(t, "disabled", 7, !1), n = d(t, "loading", 7, !1), o = d(t, "visualization", 7, "none"), l = d(t, "progressPercent", 7, 0), s = d(t, "isPlaying", 7, !1), y = d(t, "amplitude", 7, 0), h = d(t, "rippleIntensity", 7, 1), c = d(t, "ariaLabel", 7, "Play"), x = d(t, "children", 7);
630
+ var f = {
631
+ get onclick() {
632
+ return u();
633
+ },
634
+ set onclick(i) {
635
+ u(i), v();
636
+ },
637
+ get disabled() {
638
+ return a();
639
+ },
640
+ set disabled(i = !1) {
641
+ a(i), v();
642
+ },
643
+ get loading() {
644
+ return n();
645
+ },
646
+ set loading(i = !1) {
647
+ n(i), v();
648
+ },
649
+ get visualization() {
650
+ return o();
651
+ },
652
+ set visualization(i = "none") {
653
+ o(i), v();
654
+ },
655
+ get progressPercent() {
656
+ return l();
657
+ },
658
+ set progressPercent(i = 0) {
659
+ l(i), v();
660
+ },
661
+ get isPlaying() {
662
+ return s();
663
+ },
664
+ set isPlaying(i = !1) {
665
+ s(i), v();
666
+ },
667
+ get amplitude() {
668
+ return y();
669
+ },
670
+ set amplitude(i = 0) {
671
+ y(i), v();
672
+ },
673
+ get rippleIntensity() {
674
+ return h();
675
+ },
676
+ set rippleIntensity(i = 1) {
677
+ h(i), v();
678
+ },
679
+ get ariaLabel() {
680
+ return c();
681
+ },
682
+ set ariaLabel(i = "Play") {
683
+ c(i), v();
684
+ },
685
+ get children() {
686
+ return x();
687
+ },
688
+ set children(i) {
689
+ x(i), v();
690
+ }
691
+ };
692
+ return De(g, {
693
+ get onclick() {
694
+ return u();
695
+ },
696
+ get disabled() {
697
+ return a();
698
+ },
699
+ get loading() {
700
+ return n();
701
+ },
702
+ get visualization() {
703
+ return o();
704
+ },
705
+ get progressPercent() {
706
+ return l();
707
+ },
708
+ get isPlaying() {
709
+ return s();
710
+ },
711
+ get amplitude() {
712
+ return y();
713
+ },
714
+ get rippleIntensity() {
715
+ return h();
716
+ },
717
+ get ariaLabel() {
718
+ return c();
719
+ },
720
+ borderRadius: "50%",
721
+ children: (i, _) => {
722
+ var p = se(), w = te(p);
723
+ Ae(w, x), k(i, p);
724
+ },
725
+ $$slots: { default: !0 }
726
+ }), ye(f);
727
+ }
728
+ ue(
729
+ Ge,
730
+ {
731
+ onclick: {},
732
+ disabled: {},
733
+ loading: {},
734
+ visualization: {},
735
+ progressPercent: {},
736
+ isPlaying: {},
737
+ amplitude: {},
738
+ rippleIntensity: {},
739
+ ariaLabel: {},
740
+ children: {}
741
+ },
742
+ [],
743
+ [],
744
+ !0
745
+ );
746
+ function ft(g, t) {
747
+ ge(t, !0);
748
+ let u = d(t, "onclick", 7), a = d(t, "disabled", 7, !1), n = d(t, "loading", 7, !1), o = d(t, "visualization", 7, "none"), l = d(t, "progressPercent", 7, 0), s = d(t, "isPlaying", 7, !1), y = d(t, "amplitude", 7, 0), h = d(t, "rippleIntensity", 7, 1), c = d(t, "ariaLabel", 7, "Play"), x = d(t, "children", 7);
749
+ var f = {
750
+ get onclick() {
751
+ return u();
752
+ },
753
+ set onclick(i) {
754
+ u(i), v();
755
+ },
756
+ get disabled() {
757
+ return a();
758
+ },
759
+ set disabled(i = !1) {
760
+ a(i), v();
761
+ },
762
+ get loading() {
763
+ return n();
764
+ },
765
+ set loading(i = !1) {
766
+ n(i), v();
767
+ },
768
+ get visualization() {
769
+ return o();
770
+ },
771
+ set visualization(i = "none") {
772
+ o(i), v();
773
+ },
774
+ get progressPercent() {
775
+ return l();
776
+ },
777
+ set progressPercent(i = 0) {
778
+ l(i), v();
779
+ },
780
+ get isPlaying() {
781
+ return s();
782
+ },
783
+ set isPlaying(i = !1) {
784
+ s(i), v();
785
+ },
786
+ get amplitude() {
787
+ return y();
788
+ },
789
+ set amplitude(i = 0) {
790
+ y(i), v();
791
+ },
792
+ get rippleIntensity() {
793
+ return h();
794
+ },
795
+ set rippleIntensity(i = 1) {
796
+ h(i), v();
797
+ },
798
+ get ariaLabel() {
799
+ return c();
800
+ },
801
+ set ariaLabel(i = "Play") {
802
+ c(i), v();
803
+ },
804
+ get children() {
805
+ return x();
806
+ },
807
+ set children(i) {
808
+ x(i), v();
809
+ }
810
+ };
811
+ return De(g, {
812
+ get onclick() {
813
+ return u();
814
+ },
815
+ get disabled() {
816
+ return a();
817
+ },
818
+ get loading() {
819
+ return n();
820
+ },
821
+ get visualization() {
822
+ return o();
823
+ },
824
+ get progressPercent() {
825
+ return l();
826
+ },
827
+ get isPlaying() {
828
+ return s();
829
+ },
830
+ get amplitude() {
831
+ return y();
832
+ },
833
+ get rippleIntensity() {
834
+ return h();
835
+ },
836
+ get ariaLabel() {
837
+ return c();
838
+ },
839
+ borderRadius: "0",
840
+ children: (i, _) => {
841
+ var p = se(), w = te(p);
842
+ Ae(w, x), k(i, p);
843
+ },
844
+ $$slots: { default: !0 }
845
+ }), ye(f);
846
+ }
847
+ ue(
848
+ ft,
849
+ {
850
+ onclick: {},
851
+ disabled: {},
852
+ loading: {},
853
+ visualization: {},
854
+ progressPercent: {},
855
+ isPlaying: {},
856
+ amplitude: {},
857
+ rippleIntensity: {},
858
+ ariaLabel: {},
859
+ children: {}
860
+ },
861
+ [],
862
+ [],
863
+ !0
864
+ );
865
+ function ct(g, t) {
866
+ ge(t, !0);
867
+ let u = d(t, "onclick", 7), a = d(t, "disabled", 7, !1), n = d(t, "loading", 7, !1), o = d(t, "visualization", 7, "none"), l = d(t, "progressPercent", 7, 0), s = d(t, "isPlaying", 7, !1), y = d(t, "amplitude", 7, 0), h = d(t, "rippleIntensity", 7, 1), c = d(t, "ariaLabel", 7, "Play"), x = d(t, "children", 7);
868
+ var f = {
869
+ get onclick() {
870
+ return u();
871
+ },
872
+ set onclick(i) {
873
+ u(i), v();
874
+ },
875
+ get disabled() {
876
+ return a();
877
+ },
878
+ set disabled(i = !1) {
879
+ a(i), v();
880
+ },
881
+ get loading() {
882
+ return n();
883
+ },
884
+ set loading(i = !1) {
885
+ n(i), v();
886
+ },
887
+ get visualization() {
888
+ return o();
889
+ },
890
+ set visualization(i = "none") {
891
+ o(i), v();
892
+ },
893
+ get progressPercent() {
894
+ return l();
895
+ },
896
+ set progressPercent(i = 0) {
897
+ l(i), v();
898
+ },
899
+ get isPlaying() {
900
+ return s();
901
+ },
902
+ set isPlaying(i = !1) {
903
+ s(i), v();
904
+ },
905
+ get amplitude() {
906
+ return y();
907
+ },
908
+ set amplitude(i = 0) {
909
+ y(i), v();
910
+ },
911
+ get rippleIntensity() {
912
+ return h();
913
+ },
914
+ set rippleIntensity(i = 1) {
915
+ h(i), v();
916
+ },
917
+ get ariaLabel() {
918
+ return c();
919
+ },
920
+ set ariaLabel(i = "Play") {
921
+ c(i), v();
922
+ },
923
+ get children() {
924
+ return x();
925
+ },
926
+ set children(i) {
927
+ x(i), v();
928
+ }
929
+ };
930
+ return De(g, {
931
+ get onclick() {
932
+ return u();
933
+ },
934
+ get disabled() {
935
+ return a();
936
+ },
937
+ get loading() {
938
+ return n();
939
+ },
940
+ get visualization() {
941
+ return o();
942
+ },
943
+ get progressPercent() {
944
+ return l();
945
+ },
946
+ get isPlaying() {
947
+ return s();
948
+ },
949
+ get amplitude() {
950
+ return y();
951
+ },
952
+ get rippleIntensity() {
953
+ return h();
954
+ },
955
+ get ariaLabel() {
956
+ return c();
957
+ },
958
+ borderRadius: "var(--fortyfour-play-button-border-radius)",
959
+ children: (i, _) => {
960
+ var p = se(), w = te(p);
961
+ Ae(w, x), k(i, p);
962
+ },
963
+ $$slots: { default: !0 }
964
+ }), ye(f);
965
+ }
966
+ ue(
967
+ ct,
968
+ {
969
+ onclick: {},
970
+ disabled: {},
971
+ loading: {},
972
+ visualization: {},
973
+ progressPercent: {},
974
+ isPlaying: {},
975
+ amplitude: {},
976
+ rippleIntensity: {},
977
+ ariaLabel: {},
978
+ children: {}
979
+ },
980
+ [],
981
+ [],
982
+ !0
983
+ );
984
+ var Zt = X('<div class="shape-wrapper svelte-19ptej3"><!> <button part="button" class="play-button svelte-19ptej3"><div aria-hidden="true"><!></div> <span part="icon" class="icon svelte-19ptej3"><!></span></button></div>');
985
+ const Yt = {
986
+ hash: "svelte-19ptej3",
987
+ code: `.shape-wrapper.svelte-19ptej3 {position:relative;width:var(--fortyfour-play-button-size, 48px);height:var(--fortyfour-play-button-size, 48px);font-size:var(--fortyfour-play-button-size, 48px);}.play-button.svelte-19ptej3 {position:relative;width:100%;height:100%;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;background:transparent;color:var(--fortyfour-play-button-icon-color);padding:0;}.play-button.svelte-19ptej3:focus-visible {outline:var(--fortyfour-play-button-focus-width) solid var(--fortyfour-play-button-focus-color);outline-offset:var(--fortyfour-play-button-focus-offset);}.play-button.svelte-19ptej3:disabled {opacity:0.5;cursor:not-allowed;}.blob-background.svelte-19ptej3 {position:absolute;inset:0;background:var(--fortyfour-play-button-background-color);border:var(--fortyfour-play-button-border-width) solid
988
+ var(--fortyfour-play-button-border-color);overflow:hidden;}.blob-background.has-ring.svelte-19ptej3 {border:none;}.icon.svelte-19ptej3 {position:relative;z-index:1;width:1em;height:1em;display:flex;align-items:center;justify-content:center;}.icon.svelte-19ptej3 svg {width:100%;height:100%;fill:currentColor;}`
989
+ };
990
+ function dt(g, t) {
991
+ ge(t, !0), we(g, Yt);
992
+ let u = d(t, "onclick", 7), a = d(t, "disabled", 7, !1), n = d(t, "loading", 7, !1), o = d(t, "visualization", 7, "none"), l = d(t, "progressPercent", 7, 0), s = d(t, "isPlaying", 7, !1), y = d(t, "amplitude", 7, 0), h = d(t, "rippleIntensity", 7, 1), c = d(t, "ariaLabel", 7, "Play"), x = d(t, "animate", 7, !1), f = d(t, "speed", 7, 20), i = d(t, "children", 7);
993
+ function _(r, T) {
994
+ return Math.floor(r + Math.random() * (T - r));
995
+ }
996
+ function p() {
997
+ const T = (A) => 100 - A;
998
+ let P = [];
999
+ for (let A = 0; A < 4; A++) {
1000
+ let N = _(25, T(25));
1001
+ P.push(N), P.push(T(N));
1002
+ }
1003
+ return `${P[0]}% ${P[1]}% ${P[2]}% ${P[3]}% / ${P[4]}% ${P[6]}% ${P[7]}% ${P[5]}%`;
1004
+ }
1005
+ const w = p(), C = [
1006
+ { borderRadius: w, offset: 0 },
1007
+ { borderRadius: p(), offset: 0.15 },
1008
+ { borderRadius: p(), offset: 0.3 },
1009
+ { borderRadius: p(), offset: 0.45 },
1010
+ { borderRadius: p(), offset: 0.6 },
1011
+ { borderRadius: p(), offset: 0.75 },
1012
+ { borderRadius: p(), offset: 0.9 },
1013
+ { borderRadius: w, offset: 1 }
1014
+ ], U = w;
1015
+ let G = S(null), F = null;
1016
+ const re = typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
1017
+ de(() => (e(G) && x() && !re && (F = e(G).animate(C, {
1018
+ duration: f() * 1e3,
1019
+ iterations: 1 / 0,
1020
+ easing: "ease"
1021
+ })), () => {
1022
+ F && (F.cancel(), F = null);
1023
+ }));
1024
+ var V = {
1025
+ get onclick() {
1026
+ return u();
1027
+ },
1028
+ set onclick(r) {
1029
+ u(r), v();
1030
+ },
1031
+ get disabled() {
1032
+ return a();
1033
+ },
1034
+ set disabled(r = !1) {
1035
+ a(r), v();
1036
+ },
1037
+ get loading() {
1038
+ return n();
1039
+ },
1040
+ set loading(r = !1) {
1041
+ n(r), v();
1042
+ },
1043
+ get visualization() {
1044
+ return o();
1045
+ },
1046
+ set visualization(r = "none") {
1047
+ o(r), v();
1048
+ },
1049
+ get progressPercent() {
1050
+ return l();
1051
+ },
1052
+ set progressPercent(r = 0) {
1053
+ l(r), v();
1054
+ },
1055
+ get isPlaying() {
1056
+ return s();
1057
+ },
1058
+ set isPlaying(r = !1) {
1059
+ s(r), v();
1060
+ },
1061
+ get amplitude() {
1062
+ return y();
1063
+ },
1064
+ set amplitude(r = 0) {
1065
+ y(r), v();
1066
+ },
1067
+ get rippleIntensity() {
1068
+ return h();
1069
+ },
1070
+ set rippleIntensity(r = 1) {
1071
+ h(r), v();
1072
+ },
1073
+ get ariaLabel() {
1074
+ return c();
1075
+ },
1076
+ set ariaLabel(r = "Play") {
1077
+ c(r), v();
1078
+ },
1079
+ get animate() {
1080
+ return x();
1081
+ },
1082
+ set animate(r = !1) {
1083
+ x(r), v();
1084
+ },
1085
+ get speed() {
1086
+ return f();
1087
+ },
1088
+ set speed(r = 20) {
1089
+ f(r), v();
1090
+ },
1091
+ get children() {
1092
+ return i();
1093
+ },
1094
+ set children(r) {
1095
+ i(r), v();
1096
+ }
1097
+ }, H = Zt();
1098
+ let be;
1099
+ var I = K(H);
1100
+ {
1101
+ var j = (r) => {
1102
+ Je(r, {
1103
+ get isPlaying() {
1104
+ return s();
1105
+ },
1106
+ get amplitude() {
1107
+ return y();
1108
+ },
1109
+ get intensity() {
1110
+ return h();
1111
+ }
1112
+ });
1113
+ };
1114
+ J(I, (r) => {
1115
+ o() === "ripple" && r(j);
1116
+ });
1117
+ }
1118
+ var B = pe(I, 2);
1119
+ B.__click = function(...r) {
1120
+ u()?.apply(this, r);
1121
+ };
1122
+ var ee = K(B);
1123
+ let b, L;
1124
+ var Q = K(ee);
1125
+ {
1126
+ var ve = (r) => {
1127
+ Ve(r, {
1128
+ get progress() {
1129
+ return l();
1130
+ }
1131
+ });
1132
+ };
1133
+ J(Q, (r) => {
1134
+ o() === "ring" && r(ve);
1135
+ });
1136
+ }
1137
+ D(ee), Pe(ee, (r) => m(G, r), () => e(G));
1138
+ var E = pe(ee, 2), R = K(E);
1139
+ return Ae(R, i), D(E), D(B), D(H), M(
1140
+ (r, T, P) => {
1141
+ be = me(H, "", be, r), B.disabled = a(), W(B, "aria-label", c()), W(B, "aria-busy", n()), b = ie(ee, 1, "blob-background svelte-19ptej3", null, b, T), L = me(ee, "", L, P);
1142
+ },
1143
+ [
1144
+ () => ({ "border-radius": U }),
1145
+ () => ({ "has-ring": o() === "ring" }),
1146
+ () => ({ "border-radius": U })
1147
+ ]
1148
+ ), k(g, H), ye(V);
1149
+ }
1150
+ He(["click"]);
1151
+ ue(
1152
+ dt,
1153
+ {
1154
+ onclick: {},
1155
+ disabled: {},
1156
+ loading: {},
1157
+ visualization: {},
1158
+ progressPercent: {},
1159
+ isPlaying: {},
1160
+ amplitude: {},
1161
+ rippleIntensity: {},
1162
+ ariaLabel: {},
1163
+ animate: {},
1164
+ speed: {},
1165
+ children: {}
1166
+ },
1167
+ [],
1168
+ [],
1169
+ !0
1170
+ );
1171
+ Et();
1172
+ var Vt = Le('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" aria-hidden="true"><path d="M187.2 100.9C174.8 94.1 159.8 94.4 147.6 101.6C135.4 108.8 128 121.9 128 136L128 504C128 518.1 135.5 531.2 147.6 538.4C159.7 545.6 174.8 545.9 187.2 539.1L523.2 355.1C536 348.1 544 334.6 544 320C544 305.4 536 291.9 523.2 284.9L187.2 100.9z" fill="currentColor"></path></svg>');
1173
+ function vt(g) {
1174
+ var t = Vt();
1175
+ k(g, t);
1176
+ }
1177
+ ue(vt, {}, [], [], !0);
1178
+ var Jt = Le('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" aria-hidden="true"><path d="M176 96C149.5 96 128 117.5 128 144L128 496C128 522.5 149.5 544 176 544L240 544C266.5 544 288 522.5 288 496L288 144C288 117.5 266.5 96 240 96L176 96zM400 96C373.5 96 352 117.5 352 144L352 496C352 522.5 373.5 544 400 544L464 544C490.5 544 512 522.5 512 496L512 144C512 117.5 490.5 96 464 96L400 96z" fill="currentColor"></path></svg>');
1179
+ function pt(g) {
1180
+ var t = Jt();
1181
+ k(g, t);
1182
+ }
1183
+ ue(pt, {}, [], [], !0);
1184
+ var Qt = Le(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" aria-hidden="true"><style>circle {
1185
+ animation: fade 1s ease-in-out infinite;
1186
+ }
1187
+ circle:nth-child(2) {
1188
+ animation-delay: 0.2s;
1189
+ }
1190
+ circle:nth-child(3) {
1191
+ animation-delay: 0.4s;
1192
+ }
1193
+ @keyframes fade {
1194
+ 0%,
1195
+ 100% {
1196
+ opacity: 0.2;
1197
+ }
1198
+ 50% {
1199
+ opacity: 1;
1200
+ }
1201
+ }
1202
+ @media (prefers-reduced-motion: reduce) {
1203
+ circle {
1204
+ animation: none;
1205
+ opacity: 0.6;
1206
+ }
1207
+ }</style><circle cx="160" cy="320" r="56"></circle><circle cx="320" cy="320" r="56"></circle><circle cx="480" cy="320" r="56"></circle></svg>`);
1208
+ function gt(g) {
1209
+ var t = Qt();
1210
+ k(g, t);
1211
+ }
1212
+ ue(gt, {}, [], [], !0);
1213
+ var $t = Le('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" aria-hidden="true"><path d="M320 64C178.6 64 64 178.6 64 320C64 461.4 178.6 576 320 576C461.4 576 576 461.4 576 320C576 178.6 461.4 64 320 64zM288 192C288 174.3 302.3 160 320 160C337.7 160 352 174.3 352 192L352 352C352 369.7 337.7 384 320 384C302.3 384 288 369.7 288 352L288 192zM320 480C302.3 480 288 465.7 288 448C288 430.3 302.3 416 320 416C337.7 416 352 430.3 352 448C352 465.7 337.7 480 320 480z"></path></svg>');
1214
+ function yt(g) {
1215
+ var t = $t();
1216
+ k(g, t);
1217
+ }
1218
+ ue(yt, {}, [], [], !0);
1219
+ var er = X('<div class="wrapper svelte-1a44wbi"><!></div>');
1220
+ const tr = {
1221
+ hash: "svelte-1a44wbi",
1222
+ code: `.wrapper.svelte-1a44wbi {display:contents;}:host {--fortyfour-play-button-size: 48px;--fortyfour-play-button-background-color: #3b82f6;--fortyfour-play-button-icon-color: #ffffff;--fortyfour-play-button-border-width: 2px;--fortyfour-play-button-border-color: #ffffff;--fortyfour-play-button-border-radius: 12px;--fortyfour-play-button-ring-width: var(--fortyfour-play-button-border-width);--fortyfour-play-button-ring-fill-color: #ffffff;--fortyfour-play-button-ring-track-color: transparent;--fortyfour-play-button-hover-scale: 1.04;--fortyfour-play-button-hover-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);--fortyfour-play-button-focus-color: var(--fortyfour-play-button-background-color);--fortyfour-play-button-focus-width: 2px;--fortyfour-play-button-focus-offset: 2px;display:inline-block;font-size:var(--fortyfour-play-button-size);}:host([hover="scale"]) {transition:transform 0.15s ease-out;}:host([hover="scale"]:hover:not([disabled])) {transform:scale(var(--fortyfour-play-button-hover-scale));}:host([hover="glow"]) {transition:filter 0.15s ease-out;}:host([hover="glow"]:hover:not([disabled])) {filter:drop-shadow(var(--fortyfour-play-button-hover-shadow));}:host([hover="lift"]) {transition:transform 0.15s ease-out,
1223
+ filter 0.15s ease-out;}:host([hover="lift"]:hover:not([disabled])) {transform:scale(var(--fortyfour-play-button-hover-scale));filter:drop-shadow(var(--fortyfour-play-button-hover-shadow));}
1224
+
1225
+ @media (prefers-reduced-motion: reduce) {:host([hover="scale"]),
1226
+ :host([hover="glow"]),
1227
+ :host([hover="lift"]) {transition:none;}
1228
+ }`
1229
+ };
1230
+ function rr(g, t) {
1231
+ ge(t, !0), we(g, tr);
1232
+ const u = (b) => {
1233
+ var L = se(), Q = te(L);
1234
+ {
1235
+ var ve = (R) => {
1236
+ var r = se(), T = te(r);
1237
+ Se(T, t, "icon-error", {}, (P) => {
1238
+ yt(P);
1239
+ }), k(R, r);
1240
+ }, E = (R) => {
1241
+ var r = se(), T = te(r);
1242
+ {
1243
+ var P = (N) => {
1244
+ var Y = se(), z = te(Y);
1245
+ Se(z, t, "icon-loading", {}, (O) => {
1246
+ gt(O);
1247
+ }), k(N, Y);
1248
+ }, A = (N) => {
1249
+ var Y = se(), z = te(Y);
1250
+ {
1251
+ var O = (ae) => {
1252
+ var ce = se(), le = te(ce);
1253
+ Se(le, t, "icon-playing", {}, ($) => {
1254
+ pt($);
1255
+ }), k(ae, ce);
1256
+ }, oe = (ae) => {
1257
+ var ce = se(), le = te(ce);
1258
+ Se(le, t, "icon-paused", {}, ($) => {
1259
+ vt($);
1260
+ }), k(ae, ce);
1261
+ };
1262
+ J(
1263
+ z,
1264
+ (ae) => {
1265
+ e(U) ? ae(O) : ae(oe, !1);
1266
+ },
1267
+ !0
1268
+ );
1269
+ }
1270
+ k(N, Y);
1271
+ };
1272
+ J(
1273
+ T,
1274
+ (N) => {
1275
+ V() ? N(P) : N(A, !1);
1276
+ },
1277
+ !0
1278
+ );
1279
+ }
1280
+ k(R, r);
1281
+ };
1282
+ J(Q, (R) => {
1283
+ e(F) ? R(ve) : R(E, !1);
1284
+ });
1285
+ }
1286
+ k(b, L);
1287
+ }, a = t.$$host;
1288
+ let n = d(t, "for", 7, ""), o = d(t, "shape", 7, "circle"), l = d(t, "visualization", 7, "none"), s = d(t, "hover", 7, "none"), y = d(t, "rippleIntensity", 7, 1), h = d(t, "blobAnimate", 7, !1), c = d(t, "blobSpeed", 7, 20);
1289
+ const x = {
1290
+ circle: Ge,
1291
+ square: ft,
1292
+ "rounded-square": ct,
1293
+ blob: dt
1294
+ };
1295
+ let f = S(null), i = S("idle"), _ = S(0), p = S(0), w = S(We([]));
1296
+ const C = q(() => x[o()] ?? Ge), U = q(() => e(i) === "playing"), G = q(() => e(i) === "loading"), F = q(() => e(i) === "error"), re = q(() => e(p) > 0 ? e(_) / e(p) : 0), V = Ye(() => e(G), 200), H = q(() => {
1297
+ if (!e(w).length || e(p) === 0)
1298
+ return 0;
1299
+ const b = Math.floor(e(_) / e(p) * e(w).length), L = 3, Q = Math.max(0, b - Math.floor(L / 2)), ve = Math.min(e(w).length, Q + L), E = e(w).slice(Q, ve), R = E.reduce((r, T) => r + T * T, 0);
1300
+ return Math.sqrt(R / E.length);
1301
+ }), be = q(() => ({
1302
+ onclick: I,
1303
+ disabled: !n() || e(F),
1304
+ loading: e(G),
1305
+ visualization: l(),
1306
+ progressPercent: e(re),
1307
+ isPlaying: e(U),
1308
+ amplitude: e(H),
1309
+ rippleIntensity: y(),
1310
+ ariaLabel: e(U) ? "Pause" : "Play",
1311
+ ...o() === "blob" ? { animate: h(), speed: c() } : {}
1312
+ }));
1313
+ de(() => {
1314
+ if (!n()) {
1315
+ console.warn("fortyfour-play-button: 'for' attribute is required");
1316
+ return;
1317
+ }
1318
+ const b = a.getRootNode();
1319
+ if (m(f, b.getElementById(n()), !0), !e(f)) {
1320
+ console.warn(`fortyfour-play-button: element with id "${n()}" not found`);
1321
+ return;
1322
+ }
1323
+ function L() {
1324
+ m(i, e(f).state, !0), m(_, e(f).currentTime, !0), m(p, e(f).duration, !0), m(w, e(f).metadata?.waveform ?? [], !0);
1325
+ }
1326
+ return L(), e(f).addEventListener("loading", L), e(f).addEventListener("loadedmetadata", L), e(f).addEventListener("play", L), e(f).addEventListener("pause", L), e(f).addEventListener("ended", L), e(f).addEventListener("error", L), e(f).addEventListener("timeupdate", L), () => {
1327
+ e(f).removeEventListener("loading", L), e(f).removeEventListener("loadedmetadata", L), e(f).removeEventListener("play", L), e(f).removeEventListener("pause", L), e(f).removeEventListener("ended", L), e(f).removeEventListener("error", L), e(f).removeEventListener("timeupdate", L);
1328
+ };
1329
+ });
1330
+ function I() {
1331
+ e(f)?.togglePlay();
1332
+ }
1333
+ Te(a, "data-playing", () => e(U)), Te(a, "data-loading", V), Te(a, "data-error", () => e(F));
1334
+ var j = {
1335
+ get for() {
1336
+ return n();
1337
+ },
1338
+ set for(b = "") {
1339
+ n(b), v();
1340
+ },
1341
+ get shape() {
1342
+ return o();
1343
+ },
1344
+ set shape(b = "circle") {
1345
+ o(b), v();
1346
+ },
1347
+ get visualization() {
1348
+ return l();
1349
+ },
1350
+ set visualization(b = "none") {
1351
+ l(b), v();
1352
+ },
1353
+ get hover() {
32
1354
  return s();
33
1355
  },
34
- set recordingId(e) {
35
- s(e), P();
1356
+ set hover(b = "none") {
1357
+ s(b), v();
36
1358
  },
37
- get recording() {
38
- return r();
1359
+ get rippleIntensity() {
1360
+ return y();
1361
+ },
1362
+ set rippleIntensity(b = 1) {
1363
+ y(b), v();
1364
+ },
1365
+ get blobAnimate() {
1366
+ return h();
1367
+ },
1368
+ set blobAnimate(b = !1) {
1369
+ h(b), v();
1370
+ },
1371
+ get blobSpeed() {
1372
+ return c();
1373
+ },
1374
+ set blobSpeed(b = 20) {
1375
+ c(b), v();
1376
+ }
1377
+ }, B = er(), ee = K(B);
1378
+ return Rt(ee, () => e(C), (b, L) => {
1379
+ L(b, It(() => e(be), {
1380
+ children: (Q, ve) => {
1381
+ u(Q);
1382
+ },
1383
+ $$slots: { default: !0 }
1384
+ }));
1385
+ }), D(B), k(g, B), ye(j);
1386
+ }
1387
+ customElements.define("fortyfour-play-button", ue(
1388
+ rr,
1389
+ {
1390
+ for: { attribute: "for", reflect: !0 },
1391
+ shape: { attribute: "shape", reflect: !0 },
1392
+ visualization: { attribute: "visualization", reflect: !0 },
1393
+ hover: { attribute: "hover", reflect: !0 },
1394
+ rippleIntensity: { attribute: "ripple-intensity", reflect: !0 },
1395
+ blobAnimate: { attribute: "blob-animate", reflect: !0, type: "Boolean" },
1396
+ blobSpeed: { attribute: "blob-speed", reflect: !0 }
1397
+ },
1398
+ ["icon-error", "icon-loading", "icon-playing", "icon-paused"],
1399
+ [],
1400
+ !0
1401
+ ));
1402
+ function bt(g, t) {
1403
+ if (!g.length || t <= 0)
1404
+ return [];
1405
+ const u = g.length / t, a = [];
1406
+ for (let n = 0; n < t; n++) {
1407
+ const o = Math.floor(n * u), l = Math.floor((n + 1) * u), s = g.slice(o, Math.max(o + 1, l)), y = s.reduce((c, x) => c + x * x, 0), h = Math.sqrt(y / s.length);
1408
+ a.push(h);
1409
+ }
1410
+ return a;
1411
+ }
1412
+ function Qe(g, t, u) {
1413
+ return function(n) {
1414
+ const o = g(), l = t(), s = u();
1415
+ if (!o || !s || l <= 0)
1416
+ return;
1417
+ const y = n.clientX - s.left, c = Math.max(0, Math.min(1, y / s.width)) * l;
1418
+ o.seek(c);
1419
+ };
1420
+ }
1421
+ function $e(g, t, u) {
1422
+ return function(n) {
1423
+ const o = g(), l = t(), s = u();
1424
+ if (!o || l <= 0)
1425
+ return;
1426
+ const y = l * 0.05;
1427
+ n.key === "ArrowRight" ? o.seek(Math.min(l, s + y)) : n.key === "ArrowLeft" && o.seek(Math.max(0, s - y));
1428
+ };
1429
+ }
1430
+ var or = Le("<rect></rect>"), ar = X('<div class="waveform svelte-kt0w9q" role="slider" tabindex="0" aria-valuemin="0" aria-label="Audio playback position"><svg width="100%" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" class="svelte-kt0w9q"><!></svg></div>');
1431
+ const nr = {
1432
+ hash: "svelte-kt0w9q",
1433
+ code: ":host {display:flex;flex:1;--waveform-progress-color: #3b82f6;--waveform-track-color: #e5e7eb;--waveform-focus-color: #3b82f6;--waveform-focus-width: 2px;--waveform-focus-offset: 2px;--waveform-focus-radius: 4px;}.waveform.svelte-kt0w9q {flex:1;height:100%;display:flex;align-items:center;cursor:pointer;border-radius:var(--waveform-focus-radius);}.waveform.svelte-kt0w9q:focus-visible {outline:var(--waveform-focus-width) solid var(--waveform-focus-color);outline-offset:var(--waveform-focus-offset);}svg.svelte-kt0w9q {display:block;}.bar.svelte-kt0w9q {transition:fill 0.15s;}.progress.svelte-kt0w9q {fill:var(--waveform-progress-color);}.track.svelte-kt0w9q {fill:var(--waveform-track-color);}"
1434
+ };
1435
+ function ir(g, t) {
1436
+ ge(t, !0), we(g, nr);
1437
+ const u = t.$$host;
1438
+ let a = d(t, "for", 7, ""), n = d(t, "barWidth", 7, 3), o = d(t, "barGap", 7, 1), l = d(t, "barRadius", 7, 1), s = d(t, "minBarHeight", 7, 3), y = d(t, "height", 7, 56), h = S(We([])), c = S(0), x = S(0), f = S(null), i = S(0), _ = S(!1), p = S(null);
1439
+ u.style.height = `${y()}px`, st(() => {
1440
+ const b = new ResizeObserver((L) => {
1441
+ for (let Q of L)
1442
+ m(i, Q.contentRect.width || 0, !0), m(_, !0);
1443
+ });
1444
+ return e(p) && b.observe(e(p)), () => {
1445
+ b.disconnect();
1446
+ };
1447
+ }), de(() => {
1448
+ if (!a()) {
1449
+ console.warn("fortyfour-bar-waveform: 'for' attribute is required");
1450
+ return;
1451
+ }
1452
+ const b = u.getRootNode();
1453
+ if (m(f, b.getElementById(a()), !0), !e(f)) {
1454
+ console.warn(`fortyfour-bar-waveform: element with id "${a()}" not found`);
1455
+ return;
1456
+ }
1457
+ e(f).metadata?.waveform && m(h, e(f).metadata.waveform, !0), e(f).duration && m(x, e(f).duration, !0), e(f).currentTime && m(c, e(f).currentTime, !0);
1458
+ function L() {
1459
+ m(h, e(f).metadata?.waveform || [], !0), m(x, e(f).duration, !0);
1460
+ }
1461
+ function Q() {
1462
+ m(c, e(f).currentTime, !0);
1463
+ }
1464
+ return e(f).addEventListener("loadedmetadata", L), e(f).addEventListener("timeupdate", Q), () => {
1465
+ e(f).removeEventListener("loadedmetadata", L), e(f).removeEventListener("timeupdate", Q);
1466
+ };
1467
+ });
1468
+ const w = q(() => Math.max(1, Math.floor(e(i) / (n() + o())))), C = q(() => e(h).length > 0), U = q(() => e(C) ? bt(e(h), e(w)) : Array(e(w)).fill(0)), G = q(() => e(x) > 0 ? e(c) / e(x) : 0), F = q(() => `${Me(e(c))} of ${Me(e(x))}`), re = q(() => e(U).map((b) => {
1469
+ const L = Math.max(s(), Math.round(b / 100 * (y() - s()) + s()));
1470
+ return L % 2 === 0 ? L + 1 : L;
1471
+ }));
1472
+ de(() => {
1473
+ e(C) ? u.removeAttribute("data-placeholder") : u.setAttribute("data-placeholder", "");
1474
+ });
1475
+ const V = Qe(() => e(f), () => e(x), () => u.getBoundingClientRect()), H = $e(() => e(f), () => e(x), () => e(c));
1476
+ var be = {
1477
+ get for() {
1478
+ return a();
39
1479
  },
40
- set recording(e) {
41
- r(e), P();
1480
+ set for(b = "") {
1481
+ a(b), v();
42
1482
  },
43
- get audioRef() {
1483
+ get barWidth() {
44
1484
  return n();
45
1485
  },
46
- set audioRef(e) {
47
- n(e), P();
1486
+ set barWidth(b = 3) {
1487
+ n(b), v();
1488
+ },
1489
+ get barGap() {
1490
+ return o();
1491
+ },
1492
+ set barGap(b = 1) {
1493
+ o(b), v();
1494
+ },
1495
+ get barRadius() {
1496
+ return l();
1497
+ },
1498
+ set barRadius(b = 1) {
1499
+ l(b), v();
1500
+ },
1501
+ get minBarHeight() {
1502
+ return s();
1503
+ },
1504
+ set minBarHeight(b = 3) {
1505
+ s(b), v();
1506
+ },
1507
+ get height() {
1508
+ return y();
1509
+ },
1510
+ set height(b = 56) {
1511
+ y(b), v();
48
1512
  }
49
- }, v = xe(), x = b(v), O = b(x);
1513
+ }, I = ar();
1514
+ I.__click = V, I.__keydown = H;
1515
+ var j = K(I), B = K(j);
50
1516
  {
51
- let e = ce(() => `https://44hz.zuuu.us/recordings/${s()}/audio.mp3`);
52
- de(O, {
53
- get audioURL() {
54
- return f(e);
55
- },
56
- get waveform() {
57
- return r().waveform;
58
- }
1517
+ var ee = (b) => {
1518
+ var L = se(), Q = te(L);
1519
+ Be(Q, 17, () => e(re), Ne, (ve, E, R) => {
1520
+ const r = q(() => (R + 1) / e(re).length), T = q(() => e(r) <= e(G));
1521
+ var P = or();
1522
+ M(
1523
+ (A) => {
1524
+ ie(P, 0, ut(["bar", e(T) ? "progress" : "track"]), "svelte-kt0w9q"), W(P, "x", R * (n() + o())), W(P, "y", y() / 4 - e(E) / 2), W(P, "width", A), W(P, "height", e(E)), W(P, "rx", l());
1525
+ },
1526
+ [() => Math.max(1, n() - 1)]
1527
+ ), k(ve, P);
1528
+ }), k(b, L);
1529
+ };
1530
+ J(B, (b) => {
1531
+ e(_) && b(ee);
1532
+ });
1533
+ }
1534
+ return D(j), D(I), Pe(I, (b) => m(p, b), () => e(p)), M(() => {
1535
+ W(I, "aria-valuemax", e(x)), W(I, "aria-valuenow", e(c)), W(I, "aria-valuetext", e(F)), W(j, "height", y()), W(j, "viewBox", `0 0 ${e(i)} ${y() / 2}`);
1536
+ }), k(g, I), ye(be);
1537
+ }
1538
+ He(["click", "keydown"]);
1539
+ customElements.define("fortyfour-bar-waveform", ue(
1540
+ ir,
1541
+ {
1542
+ for: { attribute: "for", reflect: !0 },
1543
+ barWidth: { attribute: "bar-width", reflect: !0, type: "Number" },
1544
+ barGap: { attribute: "bar-gap", reflect: !0, type: "Number" },
1545
+ barRadius: { attribute: "bar-radius", reflect: !0, type: "Number" },
1546
+ minBarHeight: { attribute: "min-bar-height", reflect: !0, type: "Number" },
1547
+ height: { attribute: "height", reflect: !0, type: "Number" }
1548
+ },
1549
+ [],
1550
+ [],
1551
+ !0
1552
+ ));
1553
+ var lr = Le("<path></path>"), sr = Le("<path></path><!>", 1), ur = Le('<line class="line track svelte-r3200f" stroke-linecap="round"></line>'), fr = X('<div class="waveform svelte-r3200f" role="slider" tabindex="0" aria-valuemin="0" aria-label="Audio playback position"><svg width="100%" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" preserveAspectRatio="none" class="svelte-r3200f"><!></svg></div>');
1554
+ const cr = {
1555
+ hash: "svelte-r3200f",
1556
+ code: `:host {--fortyfour-line-waveform-track-color: #d1d5db;--fortyfour-line-waveform-progress-color: #3b82f6;--fortyfour-line-waveform-focus-color: #3b82f6;--fortyfour-line-waveform-focus-width: 2px;--fortyfour-line-waveform-focus-offset: 2px;--fortyfour-line-waveform-focus-radius: 4px;display:flex;flex:1;}
1557
+
1558
+ @media (prefers-color-scheme: dark) {:host {--fortyfour-line-waveform-track-color: #374151;--fortyfour-line-waveform-progress-color: #60a5fa;--fortyfour-line-waveform-focus-color: #60a5fa;}
1559
+ }.waveform.svelte-r3200f {flex:1;height:100%;display:flex;align-items:center;cursor:pointer;border-radius:var(--fortyfour-line-waveform-focus-radius);}.waveform.svelte-r3200f:focus-visible {outline:var(--fortyfour-line-waveform-focus-width) solid
1560
+ var(--fortyfour-line-waveform-focus-color);outline-offset:var(--fortyfour-line-waveform-focus-offset);}svg.svelte-r3200f {display:block;}.line.svelte-r3200f {fill:none;stroke-linecap:round;stroke-linejoin:round;}.line.sharp.svelte-r3200f {stroke-linecap:square;stroke-linejoin:miter;}.track.svelte-r3200f {stroke:var(--fortyfour-line-waveform-track-color);}.progress.svelte-r3200f {stroke:var(--fortyfour-line-waveform-progress-color);}`
1561
+ };
1562
+ function dr(g, t) {
1563
+ ge(t, !0), we(g, cr);
1564
+ const u = t.$$host;
1565
+ let a = d(t, "for", 7, ""), n = d(t, "lineWidth", 7, 2), o = d(t, "height", 7, 56), l = d(t, "sharp", 7, !1), s = S(We([])), y = S(0), h = S(0), c = S(null), x = S(0), f = S(!1), i = S(null);
1566
+ u.style.height = `${o()}px`, st(() => {
1567
+ const r = new ResizeObserver((T) => {
1568
+ for (let P of T)
1569
+ m(x, P.contentRect.width || 0, !0), m(f, !0);
1570
+ });
1571
+ return e(i) && r.observe(e(i)), () => {
1572
+ r.disconnect();
1573
+ };
1574
+ }), de(() => {
1575
+ if (!a()) {
1576
+ console.warn("fortyfour-line-waveform: 'for' attribute is required");
1577
+ return;
1578
+ }
1579
+ const r = u.getRootNode();
1580
+ if (m(c, r.getElementById(a()), !0), !e(c)) {
1581
+ console.warn(`fortyfour-line-waveform: element with id "${a()}" not found`);
1582
+ return;
1583
+ }
1584
+ e(c).metadata?.waveform && m(s, e(c).metadata.waveform, !0), e(c).duration && m(h, e(c).duration, !0), e(c).currentTime && m(y, e(c).currentTime, !0);
1585
+ function T() {
1586
+ m(s, e(c).metadata?.waveform || [], !0), m(h, e(c).duration, !0);
1587
+ }
1588
+ function P() {
1589
+ m(y, e(c).currentTime, !0);
1590
+ }
1591
+ return e(c).addEventListener("loadedmetadata", T), e(c).addEventListener("timeupdate", P), () => {
1592
+ e(c).removeEventListener("loadedmetadata", T), e(c).removeEventListener("timeupdate", P);
1593
+ };
1594
+ });
1595
+ const _ = 0.15, p = q(() => Math.max(2, Math.floor(e(x) * _))), w = q(() => e(s).length > 0), C = q(() => e(w) ? bt(e(s), e(p)) : []), U = q(() => e(h) > 0 ? e(y) / e(h) : 0), G = q(() => `${Me(e(y))} of ${Me(e(h))}`), F = q(() => o() / 2), re = q(() => o() / 2 * 0.8), V = q(() => {
1596
+ if (!e(C).length || e(x) === 0)
1597
+ return [];
1598
+ const r = n() / 2, T = e(x) - r * 2;
1599
+ return e(C).map((P, A) => {
1600
+ const N = r + A / (e(C).length - 1) * T, Y = Math.max(0.05, P / 100), z = A % 2 === 0 ? -1 : 1, O = e(F) + z * Y * e(re);
1601
+ return { x: N, y: O };
59
1602
  });
1603
+ });
1604
+ function H(r, T) {
1605
+ if (r.length === 0)
1606
+ return "";
1607
+ let P = `M ${r[0].x} ${r[0].y}`;
1608
+ for (let A = 1; A < r.length; A++) {
1609
+ const N = r[A - 1], Y = r[A];
1610
+ if (T) {
1611
+ const z = N.x + (Y.x - N.x) / 3, O = N.y, oe = N.x + (Y.x - N.x) * 2 / 3, ae = Y.y;
1612
+ P += ` C ${z} ${O}, ${oe} ${ae}, ${Y.x} ${Y.y}`;
1613
+ } else
1614
+ P += ` L ${Y.x} ${Y.y}`;
1615
+ }
1616
+ return P;
60
1617
  }
61
- y(x);
62
- var U = h(x, 2);
1618
+ const be = q(() => H(e(V), !l())), I = q(() => {
1619
+ if (e(U) <= 0 || e(x) === 0)
1620
+ return 0;
1621
+ const r = n() / 2, T = e(x) - r * 2;
1622
+ return r + e(U) * T;
1623
+ }), j = q(() => {
1624
+ if (e(V).length === 0 || e(I) <= 0)
1625
+ return "";
1626
+ const r = [];
1627
+ let T = null;
1628
+ for (let A = 0; A < e(V).length; A++)
1629
+ if (e(V)[A].x <= e(I))
1630
+ r.push(e(V)[A]);
1631
+ else {
1632
+ T = e(V)[A];
1633
+ break;
1634
+ }
1635
+ if (r.length === 0)
1636
+ return "";
1637
+ const P = r[r.length - 1];
1638
+ if (T && P.x < e(I)) {
1639
+ const A = (e(I) - P.x) / (T.x - P.x), N = P.y + A * (T.y - P.y);
1640
+ r.push({ x: e(I), y: N });
1641
+ }
1642
+ return H(r, !l());
1643
+ });
1644
+ de(() => {
1645
+ e(w) ? u.removeAttribute("data-placeholder") : u.setAttribute("data-placeholder", "");
1646
+ });
1647
+ const B = Qe(() => e(c), () => e(h), () => e(i).getBoundingClientRect()), ee = $e(() => e(c), () => e(h), () => e(y));
1648
+ var b = {
1649
+ get for() {
1650
+ return a();
1651
+ },
1652
+ set for(r = "") {
1653
+ a(r), v();
1654
+ },
1655
+ get lineWidth() {
1656
+ return n();
1657
+ },
1658
+ set lineWidth(r = 2) {
1659
+ n(r), v();
1660
+ },
1661
+ get height() {
1662
+ return o();
1663
+ },
1664
+ set height(r = 56) {
1665
+ o(r), v();
1666
+ },
1667
+ get sharp() {
1668
+ return l();
1669
+ },
1670
+ set sharp(r = !1) {
1671
+ l(r), v();
1672
+ }
1673
+ }, L = fr();
1674
+ L.__click = B, L.__keydown = ee;
1675
+ var Q = K(L), ve = K(Q);
63
1676
  {
64
- var B = (e) => {
65
- var o = ke(), L = b(o), D = h(b(L));
1677
+ var E = (r) => {
1678
+ var T = sr(), P = te(T);
1679
+ let A;
1680
+ var N = pe(P);
66
1681
  {
67
- var G = (l) => {
68
- var g = pe(), T = h(I(g));
69
- T.__click = [me, c];
70
- var J = b(T, !0);
71
- y(T), z(() => S(J, f(c) ? "Original" : "Translation")), i(l, g);
1682
+ var Y = (z) => {
1683
+ var O = lr();
1684
+ let oe;
1685
+ M(
1686
+ (ae) => {
1687
+ oe = ie(O, 0, "line progress svelte-r3200f", null, oe, ae), W(O, "d", e(j)), W(O, "stroke-width", n());
1688
+ },
1689
+ [() => ({ sharp: l() })]
1690
+ ), k(z, O);
72
1691
  };
73
- k(D, (l) => {
74
- r().translation && l(G);
1692
+ J(N, (z) => {
1693
+ e(j) && z(Y);
75
1694
  });
76
1695
  }
77
- y(L);
78
- var u = h(L, 2), H = b(u);
1696
+ M(
1697
+ (z) => {
1698
+ A = ie(P, 0, "line track svelte-r3200f", null, A, z), W(P, "d", e(be)), W(P, "stroke-width", n());
1699
+ },
1700
+ [() => ({ sharp: l() })]
1701
+ ), k(r, T);
1702
+ }, R = (r) => {
1703
+ var T = se(), P = te(T);
1704
+ {
1705
+ var A = (N) => {
1706
+ var Y = ur();
1707
+ M(() => {
1708
+ W(Y, "x1", n() / 2), W(Y, "y1", o() / 2), W(Y, "x2", e(x) - n() / 2), W(Y, "y2", o() / 2), W(Y, "stroke-width", n());
1709
+ }), k(N, Y);
1710
+ };
1711
+ J(
1712
+ P,
1713
+ (N) => {
1714
+ e(f) && N(A);
1715
+ },
1716
+ !0
1717
+ );
1718
+ }
1719
+ k(r, T);
1720
+ };
1721
+ J(ve, (r) => {
1722
+ e(f) && e(be) ? r(E) : r(R, !1);
1723
+ });
1724
+ }
1725
+ return D(Q), D(L), Pe(L, (r) => m(i, r), () => e(i)), M(() => {
1726
+ W(L, "aria-valuemax", e(h)), W(L, "aria-valuenow", e(y)), W(L, "aria-valuetext", e(G)), W(Q, "height", o()), W(Q, "viewBox", `0 0 ${e(x)} ${o()}`);
1727
+ }), k(g, L), ye(b);
1728
+ }
1729
+ He(["click", "keydown"]);
1730
+ customElements.define("fortyfour-line-waveform", ue(
1731
+ dr,
1732
+ {
1733
+ for: { attribute: "for", reflect: !0 },
1734
+ lineWidth: { attribute: "line-width", reflect: !0, type: "Number" },
1735
+ height: { attribute: "height", reflect: !0, type: "Number" },
1736
+ sharp: { attribute: "sharp", reflect: !0, type: "Boolean" }
1737
+ },
1738
+ [],
1739
+ [],
1740
+ !0
1741
+ ));
1742
+ var vr = X('<div class="container svelte-16bcl3p" role="slider" tabindex="0" aria-valuemin="0" aria-label="Audio playback position"><div class="track svelte-16bcl3p"><div class="progress svelte-16bcl3p"></div></div></div>');
1743
+ const pr = {
1744
+ hash: "svelte-16bcl3p",
1745
+ code: `:host {--fortyfour-progress-bar-track-color: #e5e7eb;--fortyfour-progress-bar-progress-color: #3b82f6;--fortyfour-progress-bar-focus-color: #3b82f6;--fortyfour-progress-bar-focus-width: 2px;--fortyfour-progress-bar-focus-offset: 2px;display:flex;flex:1;}
1746
+
1747
+ @media (prefers-color-scheme: dark) {:host {--fortyfour-progress-bar-track-color: #374151;--fortyfour-progress-bar-progress-color: #60a5fa;--fortyfour-progress-bar-focus-color: #60a5fa;}
1748
+ }.container.svelte-16bcl3p {flex:1;display:flex;align-items:center;cursor:pointer;border-radius:4px;}.container.svelte-16bcl3p:focus-visible {outline:var(--fortyfour-progress-bar-focus-width) solid
1749
+ var(--fortyfour-progress-bar-focus-color);outline-offset:var(--fortyfour-progress-bar-focus-offset);}.track.svelte-16bcl3p {width:100%;background:var(--fortyfour-progress-bar-track-color);overflow:hidden;}.progress.svelte-16bcl3p {height:100%;background:var(--fortyfour-progress-bar-progress-color);transition:width 0.1s linear;}`
1750
+ };
1751
+ function gr(g, t) {
1752
+ ge(t, !0), we(g, pr);
1753
+ const u = t.$$host;
1754
+ let a = d(t, "for", 7, ""), n = d(t, "barHeight", 7, 4), o = d(t, "barRadius", 7, 2), l = S(0), s = S(0), y = S(null), h = S(null);
1755
+ de(() => {
1756
+ if (!a()) {
1757
+ console.warn("fortyfour-progress-bar: 'for' attribute is required");
1758
+ return;
1759
+ }
1760
+ const F = u.getRootNode();
1761
+ if (m(y, F.getElementById(a()), !0), !e(y)) {
1762
+ console.warn(`fortyfour-progress-bar: element with id "${a()}" not found`);
1763
+ return;
1764
+ }
1765
+ e(y).duration && m(s, e(y).duration, !0), e(y).currentTime && m(l, e(y).currentTime, !0);
1766
+ function re() {
1767
+ m(s, e(y).duration, !0);
1768
+ }
1769
+ function V() {
1770
+ m(l, e(y).currentTime, !0);
1771
+ }
1772
+ return e(y).addEventListener("loadedmetadata", re), e(y).addEventListener("timeupdate", V), () => {
1773
+ e(y).removeEventListener("loadedmetadata", re), e(y).removeEventListener("timeupdate", V);
1774
+ };
1775
+ });
1776
+ const c = q(() => e(s) > 0 ? e(l) / e(s) * 100 : 0), x = q(() => `${Me(e(l))} of ${Me(e(s))}`), f = Qe(() => e(y), () => e(s), () => e(h)?.getBoundingClientRect()), i = $e(() => e(y), () => e(s), () => e(l));
1777
+ var _ = {
1778
+ get for() {
1779
+ return a();
1780
+ },
1781
+ set for(F = "") {
1782
+ a(F), v();
1783
+ },
1784
+ get barHeight() {
1785
+ return n();
1786
+ },
1787
+ set barHeight(F = 4) {
1788
+ n(F), v();
1789
+ },
1790
+ get barRadius() {
1791
+ return o();
1792
+ },
1793
+ set barRadius(F = 2) {
1794
+ o(F), v();
1795
+ }
1796
+ }, p = vr();
1797
+ p.__click = f, p.__keydown = i;
1798
+ var w = K(p);
1799
+ let C;
1800
+ var U = K(w);
1801
+ let G;
1802
+ return D(w), Pe(w, (F) => m(h, F), () => e(h)), D(p), M(
1803
+ (F, re) => {
1804
+ W(p, "aria-valuemax", e(s)), W(p, "aria-valuenow", e(l)), W(p, "aria-valuetext", e(x)), C = me(w, "", C, F), G = me(U, "", G, re);
1805
+ },
1806
+ [
1807
+ () => ({
1808
+ height: `${n() ?? ""}px`,
1809
+ "border-radius": `${o() ?? ""}px`
1810
+ }),
1811
+ () => ({
1812
+ width: `${e(c) ?? ""}%`,
1813
+ "border-radius": `${o() ?? ""}px`
1814
+ })
1815
+ ]
1816
+ ), k(g, p), ye(_);
1817
+ }
1818
+ He(["click", "keydown"]);
1819
+ customElements.define("fortyfour-progress-bar", ue(
1820
+ gr,
1821
+ {
1822
+ for: { attribute: "for", reflect: !0 },
1823
+ barHeight: { attribute: "bar-height", reflect: !0, type: "Number" },
1824
+ barRadius: { attribute: "bar-radius", reflect: !0, type: "Number" }
1825
+ },
1826
+ [],
1827
+ [],
1828
+ !0
1829
+ ));
1830
+ var yr = X("<span> </span>"), br = X('<div class="content svelte-1lixazt"><div class="text caption-text svelte-1lixazt"></div></div>'), hr = X("<span> </span>"), mr = X('<div class="text caption-text subtitle svelte-1lixazt"></div>'), wr = X('<div class="content subtitle-content svelte-1lixazt"><!></div>'), xr = X("<span> </span>"), kr = X('<div class="content svelte-1lixazt"><div class="text caption-text svelte-1lixazt"></div></div>'), _r = X('<div class="content svelte-1lixazt"><div class="text svelte-1lixazt"> </div></div>'), zr = X('<div class="placeholder-lines svelte-1lixazt"><span class="placeholder-line svelte-1lixazt"></span> <span class="placeholder-line short svelte-1lixazt"></span></div>'), Pr = X("<div><div><!></div></div>");
1831
+ const Lr = {
1832
+ hash: "svelte-1lixazt",
1833
+ code: `:host {--fortyfour-transcription-font-family: system-ui, sans-serif;--fortyfour-transcription-font-size: 14px;--fortyfour-transcription-color: #64748b;--fortyfour-transcription-active-color: #1e293b;--fortyfour-transcription-active-bg: #fef08a;--fortyfour-transcription-past-color: #1e293b;--fortyfour-transcription-placeholder-color: #e5e7eb;--fortyfour-transcription-fade-color: white;--fortyfour-transcription-scrollbar-thumb: #d1d5db;--fortyfour-transcription-scrollbar-thumb-hover: #9ca3af;--fortyfour-transcription-focus-color: #3b82f6;display:flex;font-family:var(--fortyfour-transcription-font-family);font-size:var(--fortyfour-transcription-font-size);}
1834
+
1835
+ @media (prefers-color-scheme: dark) {:host {--fortyfour-transcription-color: #94a3b8;--fortyfour-transcription-active-color: #fef08a;--fortyfour-transcription-active-bg: #422006;--fortyfour-transcription-past-color: #e2e8f0;--fortyfour-transcription-placeholder-color: #374151;--fortyfour-transcription-scrollbar-thumb: #4b5563;--fortyfour-transcription-scrollbar-thumb-hover: #6b7280;--fortyfour-transcription-focus-color: #60a5fa;}
1836
+ }.wrapper.svelte-1lixazt {position:relative;width:100%;}.wrapper.scrollable.svelte-1lixazt::before,
1837
+ .wrapper.scrollable.svelte-1lixazt::after {content:"";position:absolute;left:0;right:0;height:24px;pointer-events:none;opacity:0;transition:opacity 0.15s ease;}.wrapper.scrollable.svelte-1lixazt::before {top:0;background:linear-gradient(to top, transparent, var(--fortyfour-transcription-fade-color));z-index:1;}.wrapper.scrollable.svelte-1lixazt::after {bottom:0;background:linear-gradient(to bottom, transparent, var(--fortyfour-transcription-fade-color));}.wrapper.can-scroll-up.svelte-1lixazt::before {opacity:1;}.wrapper.can-scroll-down.svelte-1lixazt::after {opacity:1;}.container.svelte-1lixazt {width:100%;}.container.scrollable.svelte-1lixazt {overflow-y:auto;scroll-behavior:smooth;padding-bottom:24px;scrollbar-width:thin;scrollbar-color:var(--fortyfour-transcription-scrollbar-thumb) transparent;}.container.scrollable.svelte-1lixazt::-webkit-scrollbar {width:6px;}.container.scrollable.svelte-1lixazt::-webkit-scrollbar-track {background:transparent;}.container.scrollable.svelte-1lixazt::-webkit-scrollbar-thumb {background-color:var(--fortyfour-transcription-scrollbar-thumb);border-radius:3px;}.container.scrollable.svelte-1lixazt::-webkit-scrollbar-thumb:hover {background-color:var(--fortyfour-transcription-scrollbar-thumb-hover);}.container.scrollable.svelte-1lixazt:focus-visible {outline:2px solid var(--fortyfour-transcription-focus-color);outline-offset:2px;}.content.svelte-1lixazt {width:100%;}.text.svelte-1lixazt {white-space:pre-wrap;word-wrap:break-word;}.caption-text.svelte-1lixazt {white-space:normal;color:var(--fortyfour-transcription-color);}.word.svelte-1lixazt {transition:color 0.15s ease,
1838
+ background-color 0.15s ease;border-radius:2px;padding:0 1px;margin:0 -1px;}.word.active[data-type="word"].svelte-1lixazt {color:var(--fortyfour-transcription-active-color);background-color:var(--fortyfour-transcription-active-bg);}.word.past[data-type="word"].svelte-1lixazt {color:var(--fortyfour-transcription-past-color);}.subtitle-content.svelte-1lixazt {min-height:2em;display:flex;align-items:center;justify-content:center;}.subtitle.svelte-1lixazt {text-align:center;}.placeholder-lines.svelte-1lixazt {display:flex;flex-direction:column;gap:0.5em;}.placeholder-line.svelte-1lixazt {display:block;height:1em;background-color:var(--fortyfour-transcription-placeholder-color);border-radius:4px;}.placeholder-line.short.svelte-1lixazt {width:60%;}`
1839
+ };
1840
+ function Er(g, t) {
1841
+ ge(t, !0), we(g, Lr);
1842
+ const u = t.$$host;
1843
+ let a = d(t, "for", 7, ""), n = d(t, "mode", 7, "static"), o = d(t, "maxHeight", 7, 0), l = S(null);
1844
+ const s = q(() => o() > 0);
1845
+ let y = S(!1), h = S(!1);
1846
+ function c() {
1847
+ if (!e(l) || !e(s)) {
1848
+ m(y, !1), m(h, !1);
1849
+ return;
1850
+ }
1851
+ const { scrollTop: E, scrollHeight: R, clientHeight: r } = e(l);
1852
+ m(y, E > 1), m(h, E + r < R - 1);
1853
+ }
1854
+ let x = S(null), f = S(null), i = S("none"), _ = S(0);
1855
+ const p = Ye(() => e(x) === null, 200), w = q(() => e(x) !== null ? !1 : e(i) === "none" ? !0 : p()), C = q(() => e(f) !== null && e(f).length > 0), U = q(() => !e(C) || n() === "static" ? -1 : e(f).findIndex((E) => e(_) >= E.start && e(_) <= E.end));
1856
+ function G(E) {
1857
+ const R = [];
1858
+ let r = { words: [], start: 0, end: 0 };
1859
+ for (const T of E) {
1860
+ r.words.length === 0 && (r.start = T.start), r.words.push(T), r.end = T.end;
1861
+ const P = T.text.trim();
1862
+ (P.endsWith(".") || P.endsWith("?") || P.endsWith("!")) && (R.push(r), r = { words: [], start: 0, end: 0 });
1863
+ }
1864
+ return r.words.length > 0 && R.push(r), R;
1865
+ }
1866
+ const F = q(() => e(C) ? G(e(f)) : []), re = q(() => n() !== "subtitle" || e(F).length === 0 ? null : e(F).find((E) => e(_) >= E.start && e(_) <= E.end) ?? null);
1867
+ function V(E) {
1868
+ return e(_) >= E.start && e(_) <= E.end;
1869
+ }
1870
+ function H(E) {
1871
+ return e(_) > E.end;
1872
+ }
1873
+ de(() => {
1874
+ if (!a()) {
1875
+ console.warn("fortyfour-transcription: 'for' attribute is required");
1876
+ return;
1877
+ }
1878
+ const R = u.getRootNode().getElementById(a());
1879
+ if (!R) {
1880
+ console.warn(`fortyfour-transcription: element with id "${a()}" not found`);
1881
+ return;
1882
+ }
1883
+ m(i, R.getAttribute("preload") || "none", !0);
1884
+ const r = R.metadata;
1885
+ r && (m(x, r.transcription ?? null, !0), m(f, r.words ?? null, !0)), R.currentTime && m(_, R.currentTime, !0);
1886
+ function T() {
1887
+ const A = R.metadata;
1888
+ m(x, A?.transcription ?? null, !0), m(f, A?.words ?? null, !0);
1889
+ }
1890
+ function P() {
1891
+ m(_, R.currentTime, !0);
1892
+ }
1893
+ return R.addEventListener("loadedmetadata", T), R.addEventListener("timeupdate", P), () => {
1894
+ R.removeEventListener("loadedmetadata", T), R.removeEventListener("timeupdate", P);
1895
+ };
1896
+ }), Te(u, "data-placeholder", () => e(w)), de(() => {
1897
+ if (!e(l) || !e(s))
1898
+ return;
1899
+ c(), e(l).addEventListener("scroll", c);
1900
+ const E = new ResizeObserver(c);
1901
+ return E.observe(e(l)), () => {
1902
+ e(l).removeEventListener("scroll", c), E.disconnect();
1903
+ };
1904
+ }), de(() => {
1905
+ if (!e(s) || n() !== "karaoke")
1906
+ return;
1907
+ if (e(_) < 0.1) {
1908
+ e(l)?.scrollTo({ top: 0, behavior: "smooth" });
1909
+ return;
1910
+ }
1911
+ if (e(U) < 0)
1912
+ return;
1913
+ const E = e(l)?.querySelector(".word.active");
1914
+ if (E) {
1915
+ const R = e(l).getBoundingClientRect(), r = E.getBoundingClientRect(), T = e(l).scrollTop + (r.top - R.top) - R.height / 2 + r.height / 2;
1916
+ e(l).scrollTo({ top: T, behavior: "smooth" });
1917
+ }
1918
+ });
1919
+ var be = {
1920
+ get for() {
1921
+ return a();
1922
+ },
1923
+ set for(E = "") {
1924
+ a(E), v();
1925
+ },
1926
+ get mode() {
1927
+ return n();
1928
+ },
1929
+ set mode(E = "static") {
1930
+ n(E), v();
1931
+ },
1932
+ get maxHeight() {
1933
+ return o();
1934
+ },
1935
+ set maxHeight(E = 0) {
1936
+ o(E), v();
1937
+ }
1938
+ }, I = Pr();
1939
+ let j;
1940
+ var B = K(I);
1941
+ let ee, b;
1942
+ var L = K(B);
1943
+ {
1944
+ var Q = (E) => {
1945
+ var R = br(), r = K(R);
1946
+ Be(r, 21, () => e(f), Ne, (T, P, A) => {
1947
+ var N = yr();
1948
+ let Y;
1949
+ var z = K(N, !0);
1950
+ D(N), M(
1951
+ (O) => {
1952
+ Y = ie(N, 1, "word svelte-1lixazt", null, Y, O), W(N, "data-type", e(P).type), Ee(z, e(P).text);
1953
+ },
1954
+ [
1955
+ () => ({
1956
+ active: A === e(U),
1957
+ past: A < e(U)
1958
+ })
1959
+ ]
1960
+ ), k(T, N);
1961
+ }), D(r), D(R), Ce(1, R, () => Re, () => ({ duration: 400 })), k(E, R);
1962
+ }, ve = (E) => {
1963
+ var R = se(), r = te(R);
79
1964
  {
80
- var ee = (l) => {
81
- var g = V();
82
- z(() => S(g, r().translation)), i(l, g);
83
- }, te = (l) => {
84
- var g = N(), T = I(g);
1965
+ var T = (A) => {
1966
+ var N = wr(), Y = K(N);
1967
+ {
1968
+ var z = (O) => {
1969
+ var oe = mr();
1970
+ Be(oe, 21, () => e(re).words, Ne, (ae, ce) => {
1971
+ var le = hr();
1972
+ let $;
1973
+ var xe = K(le, !0);
1974
+ D(le), M(
1975
+ (ne) => {
1976
+ $ = ie(le, 1, "word svelte-1lixazt", null, $, ne), W(le, "data-type", e(ce).type), Ee(xe, e(ce).text);
1977
+ },
1978
+ [
1979
+ () => ({
1980
+ active: V(e(ce)),
1981
+ past: H(e(ce))
1982
+ })
1983
+ ]
1984
+ ), k(ae, le);
1985
+ }), D(oe), Ce(1, oe, () => Re, () => ({ duration: 200 })), k(O, oe);
1986
+ };
1987
+ J(Y, (O) => {
1988
+ e(re) && O(z);
1989
+ });
1990
+ }
1991
+ D(N), k(A, N);
1992
+ }, P = (A) => {
1993
+ var N = se(), Y = te(N);
85
1994
  {
86
- var J = (j) => {
87
- var q = N(), ae = I(q);
1995
+ var z = (oe) => {
1996
+ var ae = kr(), ce = K(ae);
1997
+ Be(ce, 21, () => e(f), Ne, (le, $, xe) => {
1998
+ var ne = se(), fe = te(ne);
1999
+ {
2000
+ var ke = (_e) => {
2001
+ var ze = xr();
2002
+ let je;
2003
+ var Ue = K(ze, !0);
2004
+ D(ze), M(
2005
+ (mt) => {
2006
+ je = ie(ze, 1, "word svelte-1lixazt", null, je, mt), W(ze, "data-type", e($).type), Ee(Ue, e($).text);
2007
+ },
2008
+ [() => ({ active: xe === e(U) })]
2009
+ ), Ce(1, ze, () => Re, () => ({ duration: 150 })), k(_e, ze);
2010
+ };
2011
+ J(fe, (_e) => {
2012
+ e(_) >= e($).start && _e(ke);
2013
+ });
2014
+ }
2015
+ k(le, ne);
2016
+ }), D(ce), D(ae), Ce(1, ae, () => Re, () => ({ duration: 400 })), k(oe, ae);
2017
+ }, O = (oe) => {
2018
+ var ae = se(), ce = te(ae);
88
2019
  {
89
- var oe = (w) => {
90
- var A = he(), C = I(A), K = h(C);
91
- K.__click = [_e, p], z((se) => S(C, `${se ?? ""}... `), [() => r().transcription.slice(0, 200)]), i(w, A);
92
- }, ie = (w) => {
93
- var A = ye(), C = I(A), K = h(C);
94
- K.__click = [be, p], z(() => S(C, `${r().transcription ?? ""} `)), i(w, A);
2020
+ var le = (xe) => {
2021
+ var ne = _r(), fe = K(ne), ke = K(fe, !0);
2022
+ D(fe), D(ne), M(() => Ee(ke, e(x))), Ce(1, ne, () => Re, () => ({ duration: 400 })), k(xe, ne);
2023
+ }, $ = (xe) => {
2024
+ var ne = se(), fe = te(ne);
2025
+ {
2026
+ var ke = (_e) => {
2027
+ var ze = zr();
2028
+ let je;
2029
+ M((Ue) => je = me(ze, "", je, Ue), [
2030
+ () => ({ height: e(s) ? `${o()}px` : void 0 })
2031
+ ]), k(_e, ze);
2032
+ };
2033
+ J(
2034
+ fe,
2035
+ (_e) => {
2036
+ e(w) && _e(ke);
2037
+ },
2038
+ !0
2039
+ );
2040
+ }
2041
+ k(xe, ne);
95
2042
  };
96
- k(ae, (w) => {
97
- f(p) ? w(ie, !1) : w(oe);
98
- });
2043
+ J(
2044
+ ce,
2045
+ (xe) => {
2046
+ e(x) ? xe(le) : xe($, !1);
2047
+ },
2048
+ !0
2049
+ );
99
2050
  }
100
- i(j, q);
101
- }, re = (j) => {
102
- var q = V();
103
- z(() => S(q, r().transcription)), i(j, q);
2051
+ k(oe, ae);
104
2052
  };
105
- k(
106
- T,
107
- (j) => {
108
- r().transcription.length > 200 ? j(J) : j(re, !1);
2053
+ J(
2054
+ Y,
2055
+ (oe) => {
2056
+ n() === "progressive" && e(C) ? oe(z) : oe(O, !1);
109
2057
  },
110
2058
  !0
111
2059
  );
112
2060
  }
113
- i(l, g);
2061
+ k(A, N);
114
2062
  };
115
- k(H, (l) => {
116
- f(c) ? l(ee) : l(te, !1);
117
- });
2063
+ J(
2064
+ r,
2065
+ (A) => {
2066
+ n() === "subtitle" && e(C) ? A(T) : A(P, !1);
2067
+ },
2068
+ !0
2069
+ );
118
2070
  }
119
- y(u), y(o), i(e, o);
2071
+ k(E, R);
120
2072
  };
121
- k(U, (e) => {
122
- r().transcription && e(B);
2073
+ J(L, (E) => {
2074
+ n() === "karaoke" && e(C) ? E(Q) : E(ve, !1);
123
2075
  });
124
2076
  }
125
- return y(v), i(a, v), Z(F);
2077
+ return D(B), Pe(B, (E) => m(l, E), () => e(l)), D(I), M(
2078
+ (E, R, r) => {
2079
+ j = ie(I, 1, "wrapper svelte-1lixazt", null, j, E), ee = ie(B, 1, "container svelte-1lixazt", null, ee, R), b = me(B, "", b, r);
2080
+ },
2081
+ [
2082
+ () => ({
2083
+ scrollable: e(s),
2084
+ "can-scroll-up": e(y),
2085
+ "can-scroll-down": e(h)
2086
+ }),
2087
+ () => ({ scrollable: e(s) }),
2088
+ () => ({
2089
+ "max-height": e(s) ? `${o()}px` : void 0
2090
+ })
2091
+ ]
2092
+ ), k(g, I), ye(be);
126
2093
  }
127
- le(["click"]);
128
- W($, { recordingId: {}, recording: {}, audioRef: {} }, [], [], !0);
129
- var we = m("<p>Loading...</p>"), Ie = m("<p>Error loading recording.</p>"), ze = m('<div class="container svelte-1kcle3q" role="group" aria-label="44 audio player"><!> <audio></audio></div>');
130
- const Re = {
131
- hash: "svelte-1kcle3q",
132
- code: ":host {display:inline-block;font-size:inherit;font-family:system-ui;line-height:1.35;color:var(--44-color-1);}.container.svelte-1kcle3q {width:100%;border-radius:16px;background:var(--44-color-0);color:var(--44-color-1);}"
2094
+ customElements.define("fortyfour-transcription", ue(
2095
+ Er,
2096
+ {
2097
+ for: { attribute: "for", reflect: !0 },
2098
+ mode: { attribute: "mode", reflect: !0 },
2099
+ maxHeight: { attribute: "max-height", reflect: !0, type: "Number" }
2100
+ },
2101
+ [],
2102
+ [],
2103
+ !0
2104
+ ));
2105
+ var Ir = X('<div class="content svelte-z1j7sg"><div class="text svelte-z1j7sg"> </div></div>'), Cr = X('<div class="placeholder-lines svelte-z1j7sg"><span class="placeholder-line svelte-z1j7sg"></span> <span class="placeholder-line short svelte-z1j7sg"></span></div>'), Rr = X("<div><div><!></div></div>");
2106
+ const Tr = {
2107
+ hash: "svelte-z1j7sg",
2108
+ code: `:host {--fortyfour-translation-font-family: system-ui, sans-serif;--fortyfour-translation-font-size: 14px;--fortyfour-translation-placeholder-color: #e5e7eb;--fortyfour-translation-fade-color: white;--fortyfour-translation-scrollbar-thumb: #d1d5db;--fortyfour-translation-scrollbar-thumb-hover: #9ca3af;--fortyfour-translation-focus-color: #3b82f6;display:flex;font-family:var(--fortyfour-translation-font-family);font-size:var(--fortyfour-translation-font-size);}
2109
+
2110
+ @media (prefers-color-scheme: dark) {:host {--fortyfour-translation-placeholder-color: #374151;--fortyfour-translation-scrollbar-thumb: #4b5563;--fortyfour-translation-scrollbar-thumb-hover: #6b7280;--fortyfour-translation-focus-color: #60a5fa;}
2111
+ }.wrapper.svelte-z1j7sg {position:relative;width:100%;}.wrapper.scrollable.svelte-z1j7sg::before,
2112
+ .wrapper.scrollable.svelte-z1j7sg::after {content:"";position:absolute;left:0;right:0;height:24px;pointer-events:none;opacity:0;transition:opacity 0.15s ease;}.wrapper.scrollable.svelte-z1j7sg::before {top:0;background:linear-gradient(to top, transparent, var(--fortyfour-translation-fade-color));z-index:1;}.wrapper.scrollable.svelte-z1j7sg::after {bottom:0;background:linear-gradient(to bottom, transparent, var(--fortyfour-translation-fade-color));}.wrapper.can-scroll-up.svelte-z1j7sg::before {opacity:1;}.wrapper.can-scroll-down.svelte-z1j7sg::after {opacity:1;}.container.svelte-z1j7sg {width:100%;}.container.scrollable.svelte-z1j7sg {overflow-y:auto;scroll-behavior:smooth;padding-bottom:24px;scrollbar-width:thin;scrollbar-color:var(--fortyfour-translation-scrollbar-thumb) transparent;}.container.scrollable.svelte-z1j7sg::-webkit-scrollbar {width:6px;}.container.scrollable.svelte-z1j7sg::-webkit-scrollbar-track {background:transparent;}.container.scrollable.svelte-z1j7sg::-webkit-scrollbar-thumb {background-color:var(--fortyfour-translation-scrollbar-thumb);border-radius:3px;}.container.scrollable.svelte-z1j7sg::-webkit-scrollbar-thumb:hover {background-color:var(--fortyfour-translation-scrollbar-thumb-hover);}.container.scrollable.svelte-z1j7sg:focus-visible {outline:2px solid var(--fortyfour-translation-focus-color);outline-offset:2px;}.content.svelte-z1j7sg {width:100%;}.text.svelte-z1j7sg {white-space:pre-wrap;word-wrap:break-word;}.placeholder-lines.svelte-z1j7sg {display:flex;flex-direction:column;gap:0.5em;}.placeholder-line.svelte-z1j7sg {display:block;height:1em;background-color:var(--fortyfour-translation-placeholder-color);border-radius:4px;}.placeholder-line.short.svelte-z1j7sg {width:60%;}`
133
2113
  };
134
- function Ee(a, t) {
135
- X(t, !0), Y(a, Re);
136
- let s = M(t, "recordingId", 7), r = M(t, "theme", 7);
137
- const c = r().split(",").map((e) => e.trim()).map((e, o) => `--44-color-${o}: ${e};`).join(" ");
138
- let p, E = R(!0), _ = R(null);
139
- ue(async () => {
140
- try {
141
- const e = await fetch(`https://44hz.zuuu.us/recordings/${s()}/player`);
142
- if (!e.ok)
143
- throw new Error("Failed to fetch data");
144
- const o = await e.json();
145
- o.status === "ready" && d(_, o, !0);
146
- } catch (e) {
147
- console.error(e);
148
- } finally {
149
- d(E, !1);
2114
+ function Mr(g, t) {
2115
+ ge(t, !0), we(g, Tr);
2116
+ const u = t.$$host;
2117
+ let a = d(t, "for", 7, ""), n = d(t, "maxHeight", 7, 0), o = S(null);
2118
+ const l = q(() => n() > 0);
2119
+ let s = S(!1), y = S(!1);
2120
+ function h() {
2121
+ if (!e(o) || !e(l)) {
2122
+ m(s, !1), m(y, !1);
2123
+ return;
150
2124
  }
2125
+ const { scrollTop: I, scrollHeight: j, clientHeight: B } = e(o);
2126
+ m(s, I > 1), m(y, I + B < j - 1);
2127
+ }
2128
+ let c = S(null), x = S("none");
2129
+ function f(I) {
2130
+ if (!I)
2131
+ return I;
2132
+ const j = document.createElement("textarea");
2133
+ return j.innerHTML = I, j.value;
2134
+ }
2135
+ const i = q(() => f(e(c))), _ = Ye(() => e(c) === null, 200), p = q(() => e(c) !== null ? !1 : e(x) === "none" ? !0 : _());
2136
+ de(() => {
2137
+ if (!a()) {
2138
+ console.warn("fortyfour-translation: 'for' attribute is required");
2139
+ return;
2140
+ }
2141
+ const j = u.getRootNode().getElementById(a());
2142
+ if (!j) {
2143
+ console.warn(`fortyfour-translation: element with id "${a()}" not found`);
2144
+ return;
2145
+ }
2146
+ m(x, j.getAttribute("preload") || "none", !0);
2147
+ const B = j.metadata;
2148
+ B && m(c, B.translation ?? null, !0);
2149
+ function ee() {
2150
+ const b = j.metadata;
2151
+ m(c, b?.translation ?? null, !0);
2152
+ }
2153
+ return j.addEventListener("loadedmetadata", ee), () => {
2154
+ j.removeEventListener("loadedmetadata", ee);
2155
+ };
2156
+ }), Te(u, "data-placeholder", () => e(p)), de(() => {
2157
+ if (!e(o) || !e(l))
2158
+ return;
2159
+ h(), e(o).addEventListener("scroll", h);
2160
+ const I = new ResizeObserver(h);
2161
+ return I.observe(e(o)), () => {
2162
+ e(o).removeEventListener("scroll", h), I.disconnect();
2163
+ };
151
2164
  });
152
- var F = {
2165
+ var w = {
2166
+ get for() {
2167
+ return a();
2168
+ },
2169
+ set for(I = "") {
2170
+ a(I), v();
2171
+ },
2172
+ get maxHeight() {
2173
+ return n();
2174
+ },
2175
+ set maxHeight(I = 0) {
2176
+ n(I), v();
2177
+ }
2178
+ }, C = Rr();
2179
+ let U;
2180
+ var G = K(C);
2181
+ let F, re;
2182
+ var V = K(G);
2183
+ {
2184
+ var H = (I) => {
2185
+ var j = Ir(), B = K(j), ee = K(B, !0);
2186
+ D(B), D(j), M(() => Ee(ee, e(i))), Ce(1, j, () => Re, () => ({ duration: 400 })), k(I, j);
2187
+ }, be = (I) => {
2188
+ var j = se(), B = te(j);
2189
+ {
2190
+ var ee = (b) => {
2191
+ var L = Cr();
2192
+ let Q;
2193
+ M((ve) => Q = me(L, "", Q, ve), [
2194
+ () => ({ height: e(l) ? `${n()}px` : void 0 })
2195
+ ]), k(b, L);
2196
+ };
2197
+ J(
2198
+ B,
2199
+ (b) => {
2200
+ e(p) && b(ee);
2201
+ },
2202
+ !0
2203
+ );
2204
+ }
2205
+ k(I, j);
2206
+ };
2207
+ J(V, (I) => {
2208
+ e(i) ? I(H) : I(be, !1);
2209
+ });
2210
+ }
2211
+ return D(G), Pe(G, (I) => m(o, I), () => e(o)), D(C), M(
2212
+ (I, j, B) => {
2213
+ U = ie(C, 1, "wrapper svelte-z1j7sg", null, U, I), F = ie(G, 1, "container svelte-z1j7sg", null, F, j), re = me(G, "", re, B);
2214
+ },
2215
+ [
2216
+ () => ({
2217
+ scrollable: e(l),
2218
+ "can-scroll-up": e(s),
2219
+ "can-scroll-down": e(y)
2220
+ }),
2221
+ () => ({ scrollable: e(l) }),
2222
+ () => ({
2223
+ "max-height": e(l) ? `${n()}px` : void 0
2224
+ })
2225
+ ]
2226
+ ), k(g, C), ye(w);
2227
+ }
2228
+ customElements.define("fortyfour-translation", ue(
2229
+ Mr,
2230
+ {
2231
+ for: { attribute: "for", reflect: !0 },
2232
+ maxHeight: { attribute: "max-height", reflect: !0, type: "Number" }
2233
+ },
2234
+ [],
2235
+ [],
2236
+ !0
2237
+ ));
2238
+ var Hr = Le('<svg viewBox="0 0 359 254" aria-label="44" fill="currentColor"><path d="M92,300 C92.2666667,290.933333 92.8,280.533333 93.6,268.8 C93.8666667,262.666667 94,258.4 94,256 L6,256 L6,161.2 C7.33333333,159.333333 9.2,156.533333 11.6,152.8 C27.0666667,129.866667 39.3333333,110.733333 48.4,95.4 C57.4666667,80.0666667 65.2,63.8666667 71.6,46.8 L186,46.8 C128.4,122.533333 85.8666667,187.066667 58.4,240.4 L94,240.4 C94,240.133333 94,239.6 94,238.8 C93.4666667,228.666667 92.8,219.6 92,211.6 L185.2,72.4 C181.733333,91.0666667 180,127.333333 180,181.2 C180,235.066667 181.733333,274.666667 185.2,300 L92,300 Z" transform="translate(-6, -46)"></path><path d="M271,300 C271.266667,290.933333 271.8,280.533333 272.6,268.8 C272.866667,262.666667 273,258.4 273,256 L185,256 L185,161.2 C186.333333,159.333333 188.2,156.533333 190.6,152.8 C206.066667,129.866667 218.333333,110.733333 227.4,95.4 C236.466667,80.0666667 244.2,63.8666667 250.6,46.8 L365,46.8 C307.4,122.533333 264.866667,187.066667 237.4,240.4 L273,240.4 C273,240.133333 273,239.6 273,238.8 C272.466667,228.666667 271.8,219.6 271,211.6 L364.2,72.4 C360.733333,91.0666667 359,127.333333 359,181.2 C359,235.066667 360.733333,274.666667 364.2,300 L271,300 Z" transform="translate(-6, -46)"></path></svg>');
2239
+ function ht(g, t) {
2240
+ ge(t, !0);
2241
+ let u = d(t, "class", 7, ""), a = d(t, "height", 7, "1em"), n = d(t, "width", 7, "auto");
2242
+ var o = {
2243
+ get class() {
2244
+ return u();
2245
+ },
2246
+ set class(s = "") {
2247
+ u(s), v();
2248
+ },
2249
+ get height() {
2250
+ return a();
2251
+ },
2252
+ set height(s = "1em") {
2253
+ a(s), v();
2254
+ },
2255
+ get width() {
2256
+ return n();
2257
+ },
2258
+ set width(s = "auto") {
2259
+ n(s), v();
2260
+ }
2261
+ }, l = Hr();
2262
+ return M(() => {
2263
+ ie(l, 0, ut(u())), W(l, "height", a()), W(l, "width", n());
2264
+ }), k(g, l), ye(o);
2265
+ }
2266
+ ue(ht, { class: {}, height: {}, width: {} }, [], [], !0);
2267
+ var jr = X("<fortyfour-progress-bar></fortyfour-progress-bar>", 2), Sr = X("<fortyfour-line-waveform></fortyfour-line-waveform>", 2), qr = X("<fortyfour-bar-waveform></fortyfour-bar-waveform>", 2), Ar = (g, t) => m(t, !e(t)), Br = X('<span class="label-separator svelte-14nd1et">•</span> <button class="translation-toggle svelte-14nd1et"> </button>', 1), Nr = X("<fortyfour-translation></fortyfour-translation>", 2), Wr = X("<fortyfour-transcription></fortyfour-transcription>", 2), Dr = X('<div class="transcription-box svelte-14nd1et"><div class="transcription-header svelte-14nd1et"><span class="transcription-label svelte-14nd1et">TRANSCRIPT</span> <!></div> <!></div>'), Ur = X('<a class="branding svelte-14nd1et" href="https://44.audio" target="_blank" rel="noopener noreferrer"><span class="branding-text svelte-14nd1et">powered by</span> <!></a>'), Fr = X('<fortyfour-recording></fortyfour-recording> <div><div class="player svelte-14nd1et"><fortyfour-play-button></fortyfour-play-button> <!> <div class="duration svelte-14nd1et"><fortyfour-duration><span slot="placeholder">0:00</span></fortyfour-duration> <span class="separator svelte-14nd1et">/</span> <fortyfour-duration><span slot="placeholder">0:00</span></fortyfour-duration></div></div> <!></div> <!>', 3);
2268
+ const Or = {
2269
+ hash: "svelte-14nd1et",
2270
+ code: `:host {--fortyfour-player-font-family: system-ui, sans-serif;--fortyfour-player-font-size: 14px;--fortyfour-player-accent: #c4956a;--fortyfour-player-background: #faf8f5;--fortyfour-player-surface: #f0ede8;--fortyfour-player-text: #2c2620;--fortyfour-player-muted: #8c8279;--fortyfour-player-border: #d9d4cc;display:block;font-family:var(--fortyfour-player-font-family);font-size:var(--fortyfour-player-font-size);}.container.svelte-14nd1et {border:1px solid var(--fortyfour-player-border);border-radius:12px;background:var(--fortyfour-player-background);overflow:hidden;}.container.square.svelte-14nd1et {border-radius:0;}.container.compact.svelte-14nd1et .player:where(.svelte-14nd1et) {height:44px;padding:0.5rem 0.75rem;gap:0.75rem;}.container.compact.svelte-14nd1et .transcription-box:where(.svelte-14nd1et) {padding:0.5rem 0.75rem;}.container.compact.svelte-14nd1et fortyfour-play-button:where(.svelte-14nd1et) {--fortyfour-play-button-size: 40px;}.container.comfortable.svelte-14nd1et .player:where(.svelte-14nd1et) {height:68px;padding:1rem 1.25rem;gap:1.25rem;}.container.comfortable.svelte-14nd1et .transcription-box:where(.svelte-14nd1et) {padding:1rem 1.25rem;}.container.comfortable.svelte-14nd1et fortyfour-play-button:where(.svelte-14nd1et) {--fortyfour-play-button-size: 56px;}.player.svelte-14nd1et {display:flex;align-items:center;gap:1rem;height:56px;padding:0.75rem 1rem;}fortyfour-play-button.svelte-14nd1et {--fortyfour-play-button-size: 48px;--fortyfour-play-button-background-color: var(--fortyfour-player-accent);--fortyfour-play-button-icon-color: var(--fortyfour-player-background);--fortyfour-play-button-border-width: 0;--fortyfour-play-button-focus-color: var(--fortyfour-player-accent);flex-shrink:0;}fortyfour-bar-waveform.svelte-14nd1et,
2271
+ fortyfour-line-waveform.svelte-14nd1et,
2272
+ fortyfour-progress-bar.svelte-14nd1et {height:100%;flex:1;}fortyfour-bar-waveform.svelte-14nd1et {--waveform-progress-color: var(--fortyfour-player-accent);--waveform-track-color: var(--fortyfour-player-border);--waveform-focus-color: var(--fortyfour-player-accent);}fortyfour-line-waveform.svelte-14nd1et {--fortyfour-line-waveform-progress-color: var(--fortyfour-player-accent);--fortyfour-line-waveform-track-color: var(--fortyfour-player-border);--fortyfour-line-waveform-focus-color: var(--fortyfour-player-accent);}fortyfour-progress-bar.svelte-14nd1et {--fortyfour-progress-bar-progress-color: var(--fortyfour-player-accent);--fortyfour-progress-bar-track-color: var(--fortyfour-player-border);--fortyfour-progress-bar-focus-color: var(--fortyfour-player-accent);}.duration.svelte-14nd1et {display:flex;align-items:center;gap:0.25rem;flex-shrink:0;}.elapsed.svelte-14nd1et {--fortyfour-duration-font-family: var(--fortyfour-player-font-family);--fortyfour-duration-font-size: 1em;--fortyfour-duration-color: var(--fortyfour-player-text);font-weight:500;}.separator.svelte-14nd1et {font-size:1em;color:var(--fortyfour-player-muted);}.total.svelte-14nd1et {--fortyfour-duration-font-family: var(--fortyfour-player-font-family);--fortyfour-duration-font-size: 1em;--fortyfour-duration-color: var(--fortyfour-player-muted);}.transcription-box.svelte-14nd1et {background:var(--fortyfour-player-surface);padding:0.75rem 1rem;border-top:1px solid var(--fortyfour-player-border);}.transcription-header.svelte-14nd1et {display:flex;align-items:center;gap:0.5em;margin-bottom:0.5rem;}.transcription-label.svelte-14nd1et {font-size:0.7em;font-weight:600;letter-spacing:0.05em;color:var(--fortyfour-player-muted);}.label-separator.svelte-14nd1et {font-size:0.7em;color:var(--fortyfour-player-muted);}.translation-toggle.svelte-14nd1et {font-size:0.7em;font-weight:600;letter-spacing:0.05em;color:var(--fortyfour-player-accent);background:none;border:none;padding:0;cursor:pointer;}.translation-toggle.svelte-14nd1et:hover {text-decoration:underline;}.translation-toggle.svelte-14nd1et:focus-visible {outline:2px solid var(--fortyfour-player-accent);outline-offset:2px;border-radius:2px;}fortyfour-transcription.svelte-14nd1et,
2273
+ fortyfour-translation.svelte-14nd1et {display:block;line-height:1.5;color:var(--fortyfour-player-text);--fortyfour-transcription-font-family: var(--fortyfour-player-font-family);--fortyfour-transcription-font-size: 1em;--fortyfour-translation-font-family: var(--fortyfour-player-font-family);--fortyfour-translation-font-size: 1em;--fortyfour-transcription-color: var(--fortyfour-player-muted);--fortyfour-transcription-active-color: var(--fortyfour-player-background);--fortyfour-transcription-active-bg: var(--fortyfour-player-accent);--fortyfour-transcription-past-color: var(--fortyfour-player-text);--fortyfour-transcription-fade-color: var(--fortyfour-player-surface);--fortyfour-transcription-placeholder-color: var(--fortyfour-player-border);--fortyfour-transcription-scrollbar-thumb: var(--fortyfour-player-border);--fortyfour-transcription-scrollbar-thumb-hover: var(--fortyfour-player-muted);--fortyfour-transcription-focus-color: var(--fortyfour-player-accent);--fortyfour-translation-fade-color: var(--fortyfour-player-surface);--fortyfour-translation-placeholder-color: var(--fortyfour-player-border);--fortyfour-translation-scrollbar-thumb: var(--fortyfour-player-border);--fortyfour-translation-scrollbar-thumb-hover: var(--fortyfour-player-muted);--fortyfour-translation-focus-color: var(--fortyfour-player-accent);}.branding.svelte-14nd1et {display:flex;align-items:center;gap:0.3em;width:fit-content;margin-left:auto;margin-top:0.5rem;margin-right:1rem;text-decoration:none;color:var(--fortyfour-player-muted);border-radius:4px;white-space:nowrap;}.branding.svelte-14nd1et:focus-visible {outline:2px solid var(--fortyfour-player-accent);outline-offset:2px;}.branding-text.svelte-14nd1et {font-size:0.7em;font-weight:400;letter-spacing:0.01em;}`
2274
+ };
2275
+ function Gr(g, t) {
2276
+ ge(t, !0), we(g, Or);
2277
+ const u = t.$$host;
2278
+ let a = d(t, "recordingId", 7), n = d(t, "apiHost", 7, "api.44.audio"), o = d(t, "shape", 7, "rounded"), l = d(t, "preload", 7, "none"), s = d(t, "spacing", 7, "default"), y = d(t, "progress", 7, "bar-waveform"), h = d(t, "hideTranscript", 7, !1), c = d(t, "hideTranslation", 7, !1), x = d(t, "hideBranding", 7, !1);
2279
+ const f = `fortyfour-player-${crypto.randomUUID().slice(0, 8)}`;
2280
+ let i = S(null), _ = S(!1), p = S(!1);
2281
+ const w = q(() => o() === "square"), C = q(() => e(w) ? "square" : "circle"), U = q(() => e(w) ? "0" : "2"), G = q(() => y() || "bar-waveform"), F = q(() => s() === "compact" ? 28 : s() === "comfortable" ? 48 : 40), re = q(() => s() === "compact" ? 4 : s() === "comfortable" ? 8 : 6);
2282
+ function V() {
2283
+ const z = e(i)?.state ?? "idle";
2284
+ u.setAttribute("data-state", z);
2285
+ }
2286
+ function H() {
2287
+ const z = e(i)?.metadata?.translation;
2288
+ m(_, z != null && z !== "", !0);
2289
+ }
2290
+ de(() => {
2291
+ e(i) && (V(), H());
2292
+ }), u.pause = () => e(i)?.pause(), u.togglePlay = () => e(i)?.togglePlay(), u.seek = (z) => e(i)?.seek(z);
2293
+ var be = {
153
2294
  get recordingId() {
2295
+ return a();
2296
+ },
2297
+ set recordingId(z) {
2298
+ a(z), v();
2299
+ },
2300
+ get apiHost() {
2301
+ return n();
2302
+ },
2303
+ set apiHost(z = "api.44.audio") {
2304
+ n(z), v();
2305
+ },
2306
+ get shape() {
2307
+ return o();
2308
+ },
2309
+ set shape(z = "rounded") {
2310
+ o(z), v();
2311
+ },
2312
+ get preload() {
2313
+ return l();
2314
+ },
2315
+ set preload(z = "none") {
2316
+ l(z), v();
2317
+ },
2318
+ get spacing() {
154
2319
  return s();
155
2320
  },
156
- set recordingId(e) {
157
- s(e), P();
2321
+ set spacing(z = "default") {
2322
+ s(z), v();
2323
+ },
2324
+ get progress() {
2325
+ return y();
2326
+ },
2327
+ set progress(z = "bar-waveform") {
2328
+ y(z), v();
2329
+ },
2330
+ get hideTranscript() {
2331
+ return h();
2332
+ },
2333
+ set hideTranscript(z = !1) {
2334
+ h(z), v();
2335
+ },
2336
+ get hideTranslation() {
2337
+ return c();
2338
+ },
2339
+ set hideTranslation(z = !1) {
2340
+ c(z), v();
158
2341
  },
159
- get theme() {
160
- return r();
2342
+ get hideBranding() {
2343
+ return x();
161
2344
  },
162
- set theme(e) {
163
- r(e), P();
2345
+ set hideBranding(z = !1) {
2346
+ x(z), v();
164
2347
  }
165
- }, v = ze(), x = b(v);
2348
+ }, I = Fr(), j = te(I);
2349
+ M(() => Z(j, "id", f)), M(() => Z(j, "api-host", n())), M(() => Z(j, "recording-id", a())), M(() => Z(j, "preload", l())), Pe(j, (z) => m(i, z), () => e(i));
2350
+ var B = pe(j, 2);
2351
+ let ee;
2352
+ var b = K(B), L = K(b);
2353
+ M(() => Z(L, "for", f)), M(() => Z(L, "shape", e(C))), ie(L, 1, "svelte-14nd1et");
2354
+ var Q = pe(L, 2);
166
2355
  {
167
- var O = (e) => {
168
- var o = we();
169
- i(e, o);
170
- }, U = (e) => {
171
- var o = N(), L = I(o);
2356
+ var ve = (z) => {
2357
+ var O = jr();
2358
+ M(() => Z(O, "for", f)), M(() => Z(O, "bar-height", e(re))), M(() => Z(O, "bar-radius", e(U))), ie(O, 1, "svelte-14nd1et"), k(z, O);
2359
+ }, E = (z) => {
2360
+ var O = se(), oe = te(O);
172
2361
  {
173
- var D = (u) => {
174
- $(u, {
175
- get recordingId() {
176
- return s();
177
- },
178
- get recording() {
179
- return f(_);
180
- },
181
- get audioRef() {
182
- return p;
183
- }
184
- });
185
- }, G = (u) => {
186
- var H = Ie();
187
- i(u, H);
2362
+ var ae = (le) => {
2363
+ var $ = Sr();
2364
+ M(() => Z($, "for", f)), Z($, "line-width", "2"), M(() => Z($, "height", e(F))), M(() => Z($, "sharp", e(w))), ie($, 1, "svelte-14nd1et"), k(le, $);
2365
+ }, ce = (le) => {
2366
+ var $ = qr();
2367
+ M(() => Z($, "for", f)), Z($, "bar-width", "4"), Z($, "bar-gap", "2"), M(() => Z($, "bar-radius", e(U))), M(() => Z($, "height", e(F))), ie($, 1, "svelte-14nd1et"), k(le, $);
188
2368
  };
189
- k(
190
- L,
191
- (u) => {
192
- f(_) ? u(D) : u(G, !1);
2369
+ J(
2370
+ oe,
2371
+ (le) => {
2372
+ e(G) === "line-waveform" ? le(ae) : le(ce, !1);
193
2373
  },
194
2374
  !0
195
2375
  );
196
2376
  }
197
- i(e, o);
2377
+ k(z, O);
2378
+ };
2379
+ J(Q, (z) => {
2380
+ e(G) === "progress-bar" ? z(ve) : z(E, !1);
2381
+ });
2382
+ }
2383
+ var R = pe(Q, 2), r = K(R);
2384
+ ie(r, 1, "elapsed svelte-14nd1et"), M(() => Z(r, "for", f)), Z(r, "format", "elapsed");
2385
+ var T = pe(r, 4);
2386
+ ie(T, 1, "total svelte-14nd1et"), M(() => Z(T, "for", f)), Z(T, "format", "total"), D(R), D(b);
2387
+ var P = pe(b, 2);
2388
+ {
2389
+ var A = (z) => {
2390
+ var O = Dr(), oe = K(O), ae = pe(K(oe), 2);
2391
+ {
2392
+ var ce = (ne) => {
2393
+ var fe = Br(), ke = pe(te(fe), 2);
2394
+ ke.__click = [Ar, p];
2395
+ var _e = K(ke, !0);
2396
+ D(ke), M(() => {
2397
+ W(ke, "aria-pressed", e(p)), Ee(_e, e(p) ? "ORIGINAL" : "TRANSLATION");
2398
+ }), k(ne, fe);
2399
+ };
2400
+ J(ae, (ne) => {
2401
+ e(_) && !c() && ne(ce);
2402
+ });
2403
+ }
2404
+ D(oe);
2405
+ var le = pe(oe, 2);
2406
+ {
2407
+ var $ = (ne) => {
2408
+ var fe = Nr();
2409
+ M(() => Z(fe, "for", f)), Z(fe, "max-height", "96"), ie(fe, 1, "svelte-14nd1et"), k(ne, fe);
2410
+ }, xe = (ne) => {
2411
+ var fe = Wr();
2412
+ M(() => Z(fe, "for", f)), Z(fe, "mode", "karaoke"), Z(fe, "max-height", "96"), ie(fe, 1, "svelte-14nd1et"), k(ne, fe);
2413
+ };
2414
+ J(le, (ne) => {
2415
+ e(p) && !c() ? ne($) : ne(xe, !1);
2416
+ });
2417
+ }
2418
+ D(O), k(z, O);
2419
+ };
2420
+ J(P, (z) => {
2421
+ h() || z(A);
2422
+ });
2423
+ }
2424
+ D(B);
2425
+ var N = pe(B, 2);
2426
+ {
2427
+ var Y = (z) => {
2428
+ var O = Ur(), oe = pe(K(O), 2);
2429
+ ht(oe, { class: "branding-logo", height: "0.65em" }), D(O), k(z, O);
198
2430
  };
199
- k(x, (e) => {
200
- f(E) ? e(O) : e(U, !1);
2431
+ J(N, (z) => {
2432
+ x() || z(Y);
201
2433
  });
202
2434
  }
203
- var B = h(x, 2);
204
- return ve(B, (e) => p = e, () => p), y(v), z(() => {
205
- fe(v, c), ge(B, "src", `https://44hz.zuuu.us/recordings/${s() ?? ""}/audio.mp3`);
206
- }), i(a, v), Z(F);
2435
+ return M((z) => ee = ie(B, 1, "container svelte-14nd1et", null, ee, z), [
2436
+ () => ({
2437
+ square: e(w),
2438
+ compact: s() === "compact",
2439
+ comfortable: s() === "comfortable"
2440
+ })
2441
+ ]), he("loadedmetadata", j, () => {
2442
+ V(), H();
2443
+ }), he("play", j, V), he("pause", j, V), he("error", j, V), he("ended", j, V), k(g, I), ye(be);
2444
+ }
2445
+ He(["click"]);
2446
+ customElements.define("fortyfour-player", ue(
2447
+ Gr,
2448
+ {
2449
+ apiHost: { attribute: "api-host", reflect: !0 },
2450
+ recordingId: { attribute: "recording-id", reflect: !0 },
2451
+ shape: { attribute: "shape", reflect: !0 },
2452
+ preload: { attribute: "preload", reflect: !0 },
2453
+ spacing: { attribute: "spacing", reflect: !0 },
2454
+ progress: { attribute: "progress", reflect: !0 },
2455
+ hideTranscript: { attribute: "hide-transcript", reflect: !0, type: "Boolean" },
2456
+ hideTranslation: {
2457
+ attribute: "hide-translation",
2458
+ reflect: !0,
2459
+ type: "Boolean"
2460
+ },
2461
+ hideBranding: { attribute: "hide-branding", reflect: !0, type: "Boolean" }
2462
+ },
2463
+ [],
2464
+ [],
2465
+ !0
2466
+ ));
2467
+ var Kr = X("<fortyfour-recording></fortyfour-recording> <fortyfour-play-button></fortyfour-play-button>", 3);
2468
+ const Xr = {
2469
+ hash: "svelte-1i43bu9",
2470
+ code: `:host {--fortyfour-mini-player-accent: #c4956a;--fortyfour-mini-player-background: #faf8f5;display:inline-block;}
2471
+
2472
+ @media (prefers-color-scheme: dark) {:host {--fortyfour-mini-player-accent: #d4a574;--fortyfour-mini-player-background: #1c1917;}
2473
+ }fortyfour-play-button.svelte-1i43bu9 {--fortyfour-play-button-size: 48px;--fortyfour-play-button-background-color: var(--fortyfour-mini-player-background);--fortyfour-play-button-icon-color: var(--fortyfour-mini-player-accent);--fortyfour-play-button-border-width: 0;--fortyfour-play-button-ring-width: 3px;--fortyfour-play-button-ring-fill-color: var(--fortyfour-mini-player-accent);--fortyfour-play-button-ring-track-color: var(--fortyfour-mini-player-background);--fortyfour-play-button-focus-color: var(--fortyfour-mini-player-accent);}fortyfour-play-button.small.svelte-1i43bu9 {--fortyfour-play-button-size: 32px;--fortyfour-play-button-ring-width: 2px;}fortyfour-play-button.large.svelte-1i43bu9 {--fortyfour-play-button-size: 64px;--fortyfour-play-button-ring-width: 4px;}`
2474
+ };
2475
+ function Zr(g, t) {
2476
+ ge(t, !0), we(g, Xr);
2477
+ const u = t.$$host;
2478
+ let a = d(t, "recordingId", 7), n = d(t, "apiHost", 7, "api.44.audio"), o = d(t, "size", 7, "medium"), l = d(t, "preload", 7, "none");
2479
+ const s = `fortyfour-mini-player-${crypto.randomUUID().slice(0, 8)}`;
2480
+ let y = S(null);
2481
+ function h() {
2482
+ const p = e(y)?.state ?? "idle";
2483
+ u.setAttribute("data-state", p);
2484
+ }
2485
+ de(() => {
2486
+ e(y) && h();
2487
+ });
2488
+ var c = {
2489
+ get recordingId() {
2490
+ return a();
2491
+ },
2492
+ set recordingId(p) {
2493
+ a(p), v();
2494
+ },
2495
+ get apiHost() {
2496
+ return n();
2497
+ },
2498
+ set apiHost(p = "api.44.audio") {
2499
+ n(p), v();
2500
+ },
2501
+ get size() {
2502
+ return o();
2503
+ },
2504
+ set size(p = "medium") {
2505
+ o(p), v();
2506
+ },
2507
+ get preload() {
2508
+ return l();
2509
+ },
2510
+ set preload(p = "none") {
2511
+ l(p), v();
2512
+ }
2513
+ }, x = Kr(), f = te(x);
2514
+ M(() => Z(f, "id", s)), M(() => Z(f, "api-host", n())), M(() => Z(f, "recording-id", a())), M(() => Z(f, "preload", l())), Pe(f, (p) => m(y, p), () => e(y));
2515
+ var i = pe(f, 2);
2516
+ let _;
2517
+ return M(() => Z(i, "for", s)), Z(i, "shape", "circle"), Z(i, "visualization", "ring"), M((p) => _ = ie(i, 1, "button svelte-1i43bu9", null, _, p), [
2518
+ () => ({ small: o() === "small", large: o() === "large" })
2519
+ ]), he("loadedmetadata", f, h), he("play", f, h), he("pause", f, h), he("error", f, h), he("ended", f, h), k(g, x), ye(c);
207
2520
  }
208
- customElements.define("fortyfour-audio-player", W(
209
- Ee,
2521
+ customElements.define("fortyfour-mini-player", ue(
2522
+ Zr,
210
2523
  {
211
- recordingId: { attribute: "recording-id" },
212
- theme: { attribute: "theme" }
2524
+ apiHost: { attribute: "api-host", reflect: !0 },
2525
+ recordingId: { attribute: "recording-id", reflect: !0 },
2526
+ size: { attribute: "size", reflect: !0 },
2527
+ preload: { attribute: "preload", reflect: !0 }
213
2528
  },
214
2529
  [],
215
2530
  [],