@logicplanes/kaeso-ui 0.7.3 → 0.7.5-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,793 @@
1
+ "use client";
2
+ import { n as e } from "./use-layout-width-DAuAGj4G.js";
3
+ import { t } from "./cn-CF99d-bD.js";
4
+ import { createElement as n, forwardRef as r, useId as i, useLayoutEffect as a, useMemo as o, useRef as s, useState as c } from "react";
5
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
6
+ import { art as d, font as f } from "@logicplanes/kaeso-tokens";
7
+ // src/components/release-art/drawing.ts
8
+ var p = [
9
+ "bauhaus",
10
+ "albers",
11
+ "stripes",
12
+ "waves",
13
+ "truchet",
14
+ "arcs",
15
+ "phyllotaxis",
16
+ "spiro"
17
+ ], m = [...p, "glow"], h = {
18
+ banner: {
19
+ w: 640,
20
+ h: 360
21
+ },
22
+ wide: {
23
+ w: 840,
24
+ h: 360
25
+ }
26
+ }, g = 40, _ = {
27
+ rx: g * 7.5,
28
+ ry: g * 7.5
29
+ };
30
+ function v(e) {
31
+ let t = 2166136261;
32
+ for (let n = 0; n < e.length; n++) t ^= e.charCodeAt(n), t = Math.imul(t, 16777619);
33
+ return t >>> 0;
34
+ }
35
+ function y(e) {
36
+ let t = e >>> 0;
37
+ return () => {
38
+ t = t + 1831565813 >>> 0;
39
+ let e = t;
40
+ return e = Math.imul(e ^ e >>> 15, e | 1), e ^= e + Math.imul(e ^ e >>> 7, e | 61), ((e ^ e >>> 14) >>> 0) / 4294967296;
41
+ };
42
+ }
43
+ function b(e) {
44
+ if (typeof e != "object" || !e) return !1;
45
+ let t = e;
46
+ return t.version === 1 && typeof t.seed == "number" && Number.isInteger(t.seed) && t.seed >= 0 && t.seed <= 4294967295 && typeof t.style == "string" && m.includes(t.style) && typeof t.palette == "number" && Number.isInteger(t.palette) && t.palette >= 0 && t.palette < d.palettes.length;
47
+ }
48
+ function x(e = Math.random) {
49
+ let t = (t) => Math.min(t - 1, Math.floor(e() * t));
50
+ return {
51
+ version: 1,
52
+ seed: Math.min(4294967295, Math.floor(e() * 4294967296)),
53
+ style: m[t(m.length)] ?? "glow",
54
+ palette: t(d.palettes.length)
55
+ };
56
+ }
57
+ function S(e, t = Math.random) {
58
+ let n = d.palettes.map((e, t) => t).filter((t) => !e.slice(-4).some((e) => e.palette === t)), r = new Set(e.map((e) => e.seed)), i = (e) => e[Math.min(e.length - 1, Math.floor(t() * e.length))], a = Math.min(4294967295, Math.floor(t() * 4294967296));
59
+ for (; r.has(a);) a = a + 1 >>> 0;
60
+ return {
61
+ version: 1,
62
+ seed: a,
63
+ style: "glow",
64
+ palette: i(n) ?? 0
65
+ };
66
+ }
67
+ function C(e) {
68
+ let t = v(e);
69
+ return {
70
+ version: 1,
71
+ seed: t,
72
+ style: "glow",
73
+ palette: (t >>> 8) % d.palettes.length
74
+ };
75
+ }
76
+ var w = (e) => Math.round(e * 100) / 100, T = (e, t, n) => n ? {
77
+ tag: e,
78
+ attrs: t,
79
+ children: n
80
+ } : {
81
+ tag: e,
82
+ attrs: t
83
+ }, E = (e, t, n) => (t / _.rx) ** 2 + ((e.h - n) / _.ry) ** 2 < 1, D = (e, t) => {
84
+ let n = (e.h - t) / _.ry;
85
+ return n >= 1 ? 0 : _.rx * Math.sqrt(1 - n * n);
86
+ }, O = (e, t) => T("g", { mask: `url(#${e.id("clear")})` }, t);
87
+ function k(e, t, n, r, i, a) {
88
+ let o = [], s = e.int(0, 7), c = `rotate(${e.int(0, 3) * 90} ${w(t + r / 2)} ${w(n + r / 2)})`;
89
+ e.chance(.55) && o.push(T("rect", {
90
+ x: t,
91
+ y: n,
92
+ width: r,
93
+ height: r,
94
+ fill: i
95
+ }));
96
+ let l = o.length ? a : i;
97
+ switch (s) {
98
+ case 0:
99
+ o.push(T("path", {
100
+ d: `M${t} ${n}L${t + r} ${n}A${r} ${r} 0 0 1 ${t} ${n + r}Z`,
101
+ fill: l,
102
+ transform: c
103
+ }));
104
+ break;
105
+ case 1:
106
+ o.push(T("path", {
107
+ d: `M${t} ${n + r}A${r / 2} ${r / 2} 0 0 1 ${t + r} ${n + r}Z`,
108
+ fill: l,
109
+ transform: c
110
+ }));
111
+ break;
112
+ case 2:
113
+ o.push(T("circle", {
114
+ cx: t + r / 2,
115
+ cy: n + r / 2,
116
+ r: r / 2,
117
+ fill: l
118
+ }));
119
+ break;
120
+ case 3:
121
+ o.push(T("path", {
122
+ d: `M${t} ${n}L${t + r} ${n + r}L${t} ${n + r}Z`,
123
+ fill: l,
124
+ transform: c
125
+ }));
126
+ break;
127
+ case 4:
128
+ o.push(T("circle", {
129
+ cx: t + r / 2,
130
+ cy: n + r / 2,
131
+ r: r / 4,
132
+ fill: l
133
+ }));
134
+ break;
135
+ case 5:
136
+ for (let e = 0; e < 3; e++) o.push(T("rect", {
137
+ x: t + e * r / 3,
138
+ y: n,
139
+ width: r / 6,
140
+ height: r,
141
+ fill: l,
142
+ transform: c
143
+ }));
144
+ break;
145
+ case 6:
146
+ o.push(T("path", {
147
+ d: `M${t} ${n}L${t + r} ${n}L${t + r / 2} ${n + r / 2}Z`,
148
+ fill: l,
149
+ transform: c
150
+ })), o.push(T("path", {
151
+ d: `M${t} ${n + r}L${t + r} ${n + r}L${t + r / 2} ${n + r / 2}Z`,
152
+ fill: l,
153
+ transform: c
154
+ }));
155
+ break;
156
+ default: o.push(T("path", {
157
+ d: `M${t} ${n}A${r} ${r} 0 0 1 ${t + r} ${n + r}L${t} ${n + r}Z`,
158
+ fill: l,
159
+ transform: c
160
+ }));
161
+ }
162
+ return o;
163
+ }
164
+ function A(e) {
165
+ let t = /* @__PURE__ */ new Set(), n = (e, t) => `${e},${t}`, r = (t, n) => E(e, t * g, (n + 1) * g), i = [], a = e.int(2, 4);
166
+ for (let o = 0; o < a; o++) {
167
+ let a = e.int(2, 3);
168
+ for (let o = 0; o < 20; o++) {
169
+ let o = e.int(0, e.cols - a), s = e.int(0, e.rows - a), c = !0;
170
+ for (let e = 0; e < a && c; e++) for (let i = 0; i < a && c; i++) c = !t.has(n(o + e, s + i)) && !r(o + e, s + i);
171
+ if (!c) continue;
172
+ for (let e = 0; e < a; e++) for (let r = 0; r < a; r++) t.add(n(o + e, s + r));
173
+ let l = e.int(0, 3);
174
+ i.push(...k(e, o * g, s * g, a * g, e.color(l), e.color(l + e.int(1, 3))));
175
+ break;
176
+ }
177
+ }
178
+ let o = e.between(.55, .85);
179
+ for (let a = 0; a < e.cols; a++) for (let s = 0; s < e.rows; s++) {
180
+ if (t.has(n(a, s)) || r(a, s) || !e.chance(o)) continue;
181
+ let c = e.int(0, 3);
182
+ i.push(...k(e, a * g, s * g, g, e.color(c), e.color(c + e.int(1, 3))));
183
+ }
184
+ return i;
185
+ }
186
+ function j(e) {
187
+ let t = (e.h - 240) / 2, n = _.rx - g / 2, r = e.w - t - 240, i = n + Math.round(e.next() * Math.max(0, r - n) / (g / 2)) * (g / 2), a = e.int(3, 4), o = [
188
+ 0,
189
+ 1,
190
+ 2,
191
+ 3
192
+ ];
193
+ for (let t = o.length - 1; t > 0; t--) {
194
+ let n = Math.floor(e.next() * (t + 1));
195
+ [o[t], o[n]] = [o[n] ?? n, o[t] ?? t];
196
+ }
197
+ return Array.from({ length: a }, (n, r) => T("rect", {
198
+ x: i + 24 * r,
199
+ y: t + 36 * r,
200
+ width: 240 - 48 * r,
201
+ height: 240 - 48 * r,
202
+ fill: e.color(o[r] ?? r)
203
+ }));
204
+ }
205
+ function M(e, t, n, r) {
206
+ let i = Math.hypot(e.w, e.h), a = [], o = -i, s = 0;
207
+ for (; o < i;) {
208
+ let t = n[s % n.length] ?? g;
209
+ a.push(T("rect", {
210
+ x: w(o),
211
+ y: w(-i),
212
+ width: t,
213
+ height: w(i * 2),
214
+ fill: e.color(s + r)
215
+ })), o += t, s += 1;
216
+ }
217
+ return T("g", { transform: `translate(${e.w / 2} ${e.h / 2}) rotate(${t})` }, a);
218
+ }
219
+ function N(e) {
220
+ let t = [
221
+ 0,
222
+ 90,
223
+ 45,
224
+ -45,
225
+ 30,
226
+ -60
227
+ ][e.int(0, 5)] ?? 0, n = Array.from({ length: e.int(5, 9) }, () => g / 2 * e.int(1, 5)), r = e.id("disc"), i = g * e.int(2, 3) + g / 2, a = g * e.int(Math.ceil((_.rx + i) / g), e.cols - 2), o = g * e.int(3, e.rows - 3);
228
+ return [
229
+ T("defs", {}, [T("clipPath", { id: r }, [T("circle", {
230
+ cx: a,
231
+ cy: o,
232
+ r: i
233
+ })])]),
234
+ O(e, [M(e, t, n, 0)]),
235
+ T("g", { clipPath: `url(#${r})` }, [T("rect", {
236
+ width: e.w,
237
+ height: e.h,
238
+ fill: e.ground
239
+ }), M(e, t + 90, n, 1)])
240
+ ];
241
+ }
242
+ function P(e) {
243
+ let t = [], n = e.int(14, 18), r = g * 2.5, i = (e.h - g - r) / (n - 1), a = e.w * e.between(.58, .74), o = e.w * e.between(.09, .14), s = e.chance(.6) ? e.int(2, n - 3) : -1;
244
+ for (let c = 0; c < n; c++) {
245
+ let n = r + c * i, l = Array.from({ length: e.int(3, 5) }, () => ({
246
+ x: a + e.between(-1.2, 1.2) * o,
247
+ h: e.between(.3, 1),
248
+ s: e.between(9, 22)
249
+ })), u = [e.between(0, 6.28), e.between(0, 6.28)], d = Math.max(g, Math.ceil((D(e, n) + g / 2) / 4) * 4), f = [];
250
+ for (let t = d; t <= e.w - g; t += 4) {
251
+ let e = Math.exp(-((t - a) ** 2) / (2 * o * o)), n = 0;
252
+ for (let e of l) n += e.h * Math.exp(-((t - e.x) ** 2) / (2 * e.s * e.s));
253
+ let r = Math.sin(t * .21 + (u[0] ?? 0)) * .6 + Math.sin(t * .53 + (u[1] ?? 0)) * .4;
254
+ f.push([t, n * e + r * .04 * (.15 + e)]);
255
+ }
256
+ let p = Math.max(...f.map(([, e]) => e), .001), m = Math.min(i * e.between(2.4, 4.4), n - g), h = `M${f.map(([e, t]) => `${e} ${w(n - t / p * m)}`).join("L")}`;
257
+ t.push(T("path", {
258
+ d: `${h}L${e.w - g} ${w(n + i)}L${d} ${w(n + i)}Z`,
259
+ fill: e.ground
260
+ })), t.push(T("path", {
261
+ d: h,
262
+ fill: "none",
263
+ stroke: c === s ? e.color(1) : e.color(0),
264
+ strokeWidth: 2,
265
+ strokeLinejoin: "round",
266
+ strokeLinecap: "round"
267
+ }));
268
+ }
269
+ return t;
270
+ }
271
+ function ee(e) {
272
+ let t = w(80 * e.between(.2, .3)), n = e.chance(.5), r = [], i = Math.ceil(e.w / 80), a = Math.ceil(e.h / 80);
273
+ for (let t = 0; t < i; t++) for (let n = 0; n < a; n++) {
274
+ let i = t * 80, a = e.h - (n + 1) * 80;
275
+ if (E(e, i, a + 80)) continue;
276
+ let o = e.chance(.5) ? `M${i + 40} ${a}A40 40 0 0 1 ${i} ${a + 40}M${i + 80} ${a + 40}A40 40 0 0 0 ${i + 40} ${a + 80}` : `M${i + 40} ${a}A40 40 0 0 0 ${i + 80} ${a + 40}M${i} ${a + 40}A40 40 0 0 1 ${i + 40} ${a + 80}`;
277
+ r.push(T("path", { d: o }));
278
+ }
279
+ let o = [T("g", {
280
+ fill: "none",
281
+ stroke: e.color(0),
282
+ strokeWidth: t
283
+ }, r)];
284
+ return n && o.push(T("g", {
285
+ fill: "none",
286
+ stroke: e.color(1),
287
+ strokeWidth: w(t * .34)
288
+ }, r)), o;
289
+ }
290
+ function F(e, t, n) {
291
+ let r = Infinity;
292
+ for (let i = 0; i <= 90; i++) {
293
+ let a = i / 90 * (Math.PI / 2);
294
+ r = Math.min(r, Math.hypot(t - _.rx * Math.cos(a), n - (e.h - _.ry * Math.sin(a))));
295
+ }
296
+ return E(e, t, n) ? 0 : r;
297
+ }
298
+ function te(e) {
299
+ let t = [], n = e.int(2, 3), r = [
300
+ [g * e.int(4, e.cols - 2), 0],
301
+ [g * e.int(11, e.cols - 1), e.h],
302
+ [e.w, g * e.int(2, e.rows - 2)],
303
+ [e.w, 0],
304
+ [e.w, e.h],
305
+ [0, 0]
306
+ ];
307
+ for (let t = r.length - 1; t > 0; t--) {
308
+ let n = Math.floor(e.next() * (t + 1));
309
+ [r[t], r[n]] = [r[n] ?? [e.w, 0], r[t] ?? [e.w, 0]];
310
+ }
311
+ let i = 0;
312
+ for (let [a, o] of r) {
313
+ if (i === n) break;
314
+ let r = g / 2 * e.int(1, 2), s = Math.floor((F(e, a, o) - g / 2) / r), c = Math.min(s, e.int(4, 10));
315
+ if (c < 3) continue;
316
+ let l = e.int(0, 3), u = e.chance(.4);
317
+ for (let n = c; n >= 1; n--) t.push(T("circle", {
318
+ cx: a,
319
+ cy: o,
320
+ r: n * r,
321
+ fill: n === 1 && u ? e.ground : e.color(n + l)
322
+ }));
323
+ i += 1;
324
+ }
325
+ return t;
326
+ }
327
+ var I = 2.399963229728653;
328
+ function ne(e) {
329
+ let t = [], n = e.w - e.h / 2 - g * e.int(0, 2), r = e.h / 2 + g * e.int(-1, 1), i = e.between(11, 14), a = [
330
+ 8,
331
+ 13,
332
+ 21
333
+ ][e.int(0, 2)] ?? 13, o = e.chance(.35), s = Math.hypot(e.w, e.h);
334
+ for (let c = 1;; c++) {
335
+ let l = i * Math.sqrt(c);
336
+ if (l > s) break;
337
+ let u = n + l * Math.cos(c * I), d = r + l * Math.sin(c * I), f = i * (.3 + .12 * Math.min(1, l / (e.h / 2)));
338
+ if (u < -f || u > e.w + f || d < -f || d > e.h + f || E(e, u, d) || F(e, u, d) < f + g / 4) continue;
339
+ let p = o ? Math.floor(l / (g * 1.5)) % 4 : Math.floor(c % a / a * 4);
340
+ t.push(T("circle", {
341
+ cx: w(u),
342
+ cy: w(d),
343
+ r: w(f),
344
+ fill: e.color(p)
345
+ }));
346
+ }
347
+ return t;
348
+ }
349
+ function L(e, t) {
350
+ return t ? L(t, e % t) : e;
351
+ }
352
+ function re(e) {
353
+ let t = [], n = e.w - e.h / 2, r = e.h / 2, i = e.h / 2 - g, a = e.int(7, 13), o = e.int(2, a - 2);
354
+ for (; L(a, o) !== 1;) o = e.int(2, a - 2);
355
+ let s = e.chance(.5) ? 2 : 1;
356
+ for (let c = 0; c < s; c++) {
357
+ let s = o * e.between(.75, 1.05), l = (a - o) / o, u = a - o + s, d = o / L(a, o), f = d * 360, p = [], m = i * (c === 0 ? 1 : e.between(.4, .55)) / u;
358
+ for (let e = 0; e <= f; e++) {
359
+ let t = e / f * d * Math.PI * 2, i = (a - o) * Math.cos(t) + s * Math.cos(l * t), c = (a - o) * Math.sin(t) - s * Math.sin(l * t);
360
+ p.push(`${w(n + i * m)} ${w(r + c * m)}`);
361
+ }
362
+ let h = `M${p.join("L")}Z`;
363
+ t.push(T("path", {
364
+ d: h,
365
+ fill: e.color(c),
366
+ fillRule: "evenodd"
367
+ }));
368
+ }
369
+ return t;
370
+ }
371
+ var R = {
372
+ bauhaus: A,
373
+ albers: j,
374
+ stripes: N,
375
+ waves: P,
376
+ truchet: ee,
377
+ arcs: te,
378
+ phyllotaxis: ne,
379
+ spiro: re
380
+ }, z = (e) => d.palettes[e.palette % d.palettes.length] ?? d.palettes[0];
381
+ function B(e) {
382
+ return e.style === "glow" || !Object.hasOwn(R, e.style) ? {
383
+ color: "#ffffff",
384
+ eyebrow: {
385
+ x: g,
386
+ bottom: 96
387
+ },
388
+ title: {
389
+ x: 38,
390
+ bottom: g
391
+ }
392
+ } : {
393
+ color: d.grounds[z(e).ground].text,
394
+ eyebrow: {
395
+ x: g,
396
+ bottom: 96
397
+ },
398
+ title: {
399
+ x: 38,
400
+ bottom: g
401
+ }
402
+ };
403
+ }
404
+ var V = (e) => e <= .0031308 ? 12.92 * e : 1.055 * e ** (1 / 2.4) - .055, H = (e) => Math.min(1, Math.max(0, e));
405
+ function ie([e, t, n]) {
406
+ let r = t * Math.cos(n * Math.PI / 180), i = t * Math.sin(n * Math.PI / 180), a = (e + .3963377774 * r + .2158037573 * i) ** 3, o = (e - .1055613458 * r - .0638541728 * i) ** 3, s = (e - .0894841775 * r - 1.291485548 * i) ** 3;
407
+ return [
408
+ H(4.0767416621 * a - 3.3077115913 * o + .2309699292 * s),
409
+ H(-1.2684380046 * a + 2.6097574011 * o - .3413193965 * s),
410
+ H(-.0041960863 * a - .7034186147 * o + 1.707614701 * s)
411
+ ];
412
+ }
413
+ var U = (e) => `#${e.map((e) => Math.round(H(V(e)) * 255).toString(16).padStart(2, "0")).join("")}`, ae = (e) => .2126 * e[0] + .7152 * e[1] + .0722 * e[2];
414
+ function W(e) {
415
+ let t = (d.glows[e % d.glows.length] ?? d.glows[0]).stops.map(([e, t, n]) => [
416
+ e,
417
+ t * Math.cos(n * Math.PI / 180),
418
+ t * Math.sin(n * Math.PI / 180)
419
+ ]);
420
+ return (e) => {
421
+ let n = H(e) * (t.length - 1), r = Math.min(Math.floor(n), t.length - 2), i = n - r, [a, o, s] = t[r] ?? t[0], [c, l, u] = t[r + 1] ?? t[0], d = a + (c - a) * i, f = o + (l - o) * i, p = s + (u - s) * i;
422
+ return ie([
423
+ d,
424
+ Math.hypot(f, p),
425
+ Math.atan2(p, f) * 180 / Math.PI
426
+ ]);
427
+ };
428
+ }
429
+ var G = [
430
+ .0018,
431
+ .0018,
432
+ .0018
433
+ ], K = {
434
+ size: 34,
435
+ spacing: -.51,
436
+ weight: 500
437
+ }, oe = 2.3, q = 40;
438
+ function J(e, t, n) {
439
+ let r = Math.exp(-((n / t.r) ** 2)), i = e(.15 + .85 * r), a = r ** 1.8 * .8 * t.strength;
440
+ return [
441
+ i[0] * a,
442
+ i[1] * a,
443
+ i[2] * a
444
+ ];
445
+ }
446
+ function se(e, t = "banner") {
447
+ let { w: n, h: r } = h[t], i = W(e.palette), a = y(e.seed);
448
+ for (let e = 0;; e++) {
449
+ let t = a() < .5, o = {
450
+ x: n * (.15 + a() * .7),
451
+ y: r * (t ? -.18 - a() * .15 : 1.18 + a() * .15),
452
+ r: r * (.42 + a() * .2),
453
+ strength: 1
454
+ }, s = {
455
+ x: n * a(),
456
+ y: r * (a() < .5 ? -.3 : 1.3),
457
+ r: r * (.3 + a() * .2),
458
+ strength: .3
459
+ }, c = (e, t) => {
460
+ let n = J(i, o, Math.hypot(e - o.x, t - o.y)), r = J(i, s, Math.hypot(e - s.x, t - s.y));
461
+ return ae([
462
+ G[0] + n[0] + r[0],
463
+ G[1] + n[1] + r[1],
464
+ G[2] + n[2] + r[2]
465
+ ]);
466
+ }, l = 0;
467
+ for (let e = n * .25; e <= n * .75; e += n / 40) for (let t = r * .38; t <= r * .62; t += r / 40) l = Math.max(l, c(e, t));
468
+ let u = 0;
469
+ for (let e = 0; e <= n; e += n / 32) for (let t of [0, r]) u = Math.max(u, c(e, t));
470
+ let d = 1.05 / (l + .05);
471
+ if (d >= 7 && u >= .3 || e >= 63) return {
472
+ blooms: [o, s],
473
+ contrast: d,
474
+ brightest: u
475
+ };
476
+ }
477
+ }
478
+ function ce(e, t, n, r) {
479
+ let i = n.r * oe, a = [];
480
+ for (let e = 0; e <= q; e++) {
481
+ let o = (e / q) ** 1.35, s = J(t, n, o * i);
482
+ if (r) a.push(T("stop", {
483
+ offset: w(o * 1e4) / 1e4,
484
+ stopColor: U([
485
+ r[0] + s[0],
486
+ r[1] + s[1],
487
+ r[2] + s[2]
488
+ ])
489
+ }));
490
+ else {
491
+ let e = Math.max(s[0], s[1], s[2], 1e-6), t = H(V(e + G[0]) - V(G[0])), n = [
492
+ s[0] / e,
493
+ s[1] / e,
494
+ s[2] / e
495
+ ];
496
+ a.push(T("stop", {
497
+ offset: w(o * 1e4) / 1e4,
498
+ stopColor: U(n),
499
+ stopOpacity: Math.round(t * 1e3) / 1e3
500
+ }));
501
+ }
502
+ }
503
+ return T("radialGradient", {
504
+ id: e,
505
+ gradientUnits: "userSpaceOnUse",
506
+ cx: w(n.x),
507
+ cy: w(n.y),
508
+ r: w(i)
509
+ }, a);
510
+ }
511
+ function Y(e, t) {
512
+ return [e, t].filter((e) => e && e.trim()).join(" ");
513
+ }
514
+ function X(e, t, n) {
515
+ let r = [...e].reduce((e, t) => e + (/[.,:;'!|il1]/.test(t) ? .3 : /\s/.test(t) ? .28 : /[mwMW]/.test(t) ? .85 : .6), 0), i = Math.min(K.size, t * .8 / Math.max(r, 1));
516
+ return {
517
+ x: t / 2,
518
+ y: n / 2 + i * .364,
519
+ size: w(i),
520
+ spacing: w(K.spacing / K.size * i),
521
+ weight: K.weight
522
+ };
523
+ }
524
+ function le(e, t, n, r) {
525
+ let { w: i, h: a } = h[t], o = W(e.palette), [s, c] = se(e, t).blooms, l = (e) => `${n}-${e}`, u = [T("rect", {
526
+ width: i,
527
+ height: a,
528
+ fill: `url(#${l("bloom")})`
529
+ }), T("rect", {
530
+ width: i,
531
+ height: a,
532
+ fill: `url(#${l("second")})`
533
+ })], d = r ? X(r, i, a) : null;
534
+ return T("svg", {
535
+ xmlns: "http://www.w3.org/2000/svg",
536
+ viewBox: `0 0 ${i} ${a}`
537
+ }, [
538
+ T("defs", {}, [
539
+ ce(l("bloom"), o, s, G),
540
+ ce(l("second"), o, c, null),
541
+ T("filter", {
542
+ id: l("grain"),
543
+ filterUnits: "userSpaceOnUse",
544
+ x: 0,
545
+ y: 0,
546
+ width: i,
547
+ height: a,
548
+ colorInterpolationFilters: "sRGB"
549
+ }, [
550
+ T("feTurbulence", {
551
+ type: "fractalNoise",
552
+ baseFrequency: 1.2,
553
+ numOctaves: 3,
554
+ seed: e.seed % 9973,
555
+ stitchTiles: "stitch",
556
+ result: "noise"
557
+ }),
558
+ T("feColorMatrix", {
559
+ in: "noise",
560
+ type: "matrix",
561
+ values: "1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1",
562
+ result: "grey"
563
+ }),
564
+ T("feComposite", {
565
+ in: "SourceGraphic",
566
+ in2: "grey",
567
+ operator: "arithmetic",
568
+ k1: 0,
569
+ k2: 1,
570
+ k3: .045,
571
+ k4: -.0225
572
+ })
573
+ ])
574
+ ]),
575
+ T("g", { filter: `url(#${l("grain")})` }, u),
576
+ ...d ? [{
577
+ tag: "text",
578
+ attrs: {
579
+ x: w(d.x),
580
+ y: w(d.y),
581
+ fill: "#ffffff",
582
+ fontSize: d.size,
583
+ fontWeight: d.weight,
584
+ letterSpacing: d.spacing,
585
+ fontFamily: f.sans,
586
+ textAnchor: "middle"
587
+ },
588
+ text: r
589
+ }] : []
590
+ ]);
591
+ }
592
+ function Z(e, t = {}) {
593
+ let { w: n, h: r } = h[t.shape ?? "banner"];
594
+ if (e.style === "glow" || !Object.hasOwn(R, e.style)) return le(e, t.shape ?? "banner", t.idPrefix ?? "art", Y(t.eyebrow, t.title));
595
+ let i = y(e.seed), a = (e, t) => e + i() * (t - e), o = (e, t) => Math.min(t, e + Math.floor(i() * (t - e + 1))), s = z(e), c = B(e), l = d.grounds[s.ground], u = [...s.colors];
596
+ for (let e = u.length - 1; e > 0; e--) {
597
+ let t = Math.floor(i() * (e + 1));
598
+ [u[e], u[t]] = [u[t] ?? l.text, u[e] ?? l.text];
599
+ }
600
+ let p = t.idPrefix ?? "art", m = {
601
+ w: n,
602
+ h: r,
603
+ cols: n / g,
604
+ rows: r / g,
605
+ next: i,
606
+ between: a,
607
+ int: o,
608
+ chance: (e) => i() < e,
609
+ ground: l.fill,
610
+ color: (e) => u[(e % u.length + u.length) % u.length] ?? l.text,
611
+ id: (e) => `${p}-${e}`
612
+ }, v = m.id("clear"), b = R[e.style](m), x = [];
613
+ return t.eyebrow && x.push({
614
+ tag: "text",
615
+ attrs: {
616
+ x: c.eyebrow.x,
617
+ y: r - c.eyebrow.bottom,
618
+ fill: c.color,
619
+ fillOpacity: .7,
620
+ fontSize: 16,
621
+ fontWeight: 500,
622
+ letterSpacing: .1,
623
+ fontFamily: f.sans
624
+ },
625
+ text: t.eyebrow
626
+ }), t.title && x.push({
627
+ tag: "text",
628
+ attrs: {
629
+ x: c.title.x,
630
+ y: r - c.title.bottom,
631
+ fill: c.color,
632
+ fontSize: 52,
633
+ fontWeight: 600,
634
+ letterSpacing: -1.5,
635
+ fontFamily: f.sans
636
+ },
637
+ text: t.title
638
+ }), T("svg", {
639
+ xmlns: "http://www.w3.org/2000/svg",
640
+ viewBox: `0 0 ${n} ${r}`
641
+ }, [
642
+ T("defs", {}, [T("mask", {
643
+ id: v,
644
+ maskUnits: "userSpaceOnUse",
645
+ x: 0,
646
+ y: 0,
647
+ width: n,
648
+ height: r
649
+ }, [T("rect", {
650
+ width: n,
651
+ height: r,
652
+ fill: "white"
653
+ }), T("ellipse", {
654
+ cx: 0,
655
+ cy: r,
656
+ rx: _.rx,
657
+ ry: _.ry,
658
+ fill: "black"
659
+ })])]),
660
+ T("rect", {
661
+ width: n,
662
+ height: r,
663
+ fill: l.fill
664
+ }),
665
+ ...b,
666
+ ...x
667
+ ]);
668
+ }
669
+ var ue = /* @__PURE__ */ new Set([
670
+ "viewBox",
671
+ "maskUnits",
672
+ "gradientUnits",
673
+ "filterUnits",
674
+ "baseFrequency",
675
+ "numOctaves",
676
+ "stitchTiles",
677
+ "in2"
678
+ ]), de = (e) => ue.has(e) ? e : e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), Q = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
679
+ function $(e) {
680
+ let t = Object.entries(e.attrs).map(([e, t]) => ` ${de(e)}="${Q(String(t))}"`).join(""), n = e.text === void 0 ? (e.children ?? []).map($).join("") : Q(e.text);
681
+ return n ? `<${e.tag}${t}>${n}</${e.tag}>` : `<${e.tag}${t}/>`;
682
+ }
683
+ // src/components/release-art/release-art.tsx
684
+ var fe = { shape: {
685
+ banner: { classes: "aspect-video" },
686
+ wide: { classes: "aspect-21/9" }
687
+ } }, pe = { shape: "banner" };
688
+ function me(e, t) {
689
+ return n(e.tag, {
690
+ ...e.attrs,
691
+ key: t
692
+ }, e.text ?? e.children?.map(me));
693
+ }
694
+ var he = [
695
+ "text-display",
696
+ "text-title-lg",
697
+ "text-title",
698
+ "text-title-sm"
699
+ ], ge = "text-title-sm";
700
+ function _e(e, t, n) {
701
+ let r = t === null ? null : t >= 512 ? 0 : t >= 320 ? 1 : t >= 208 ? 2 : 3, [i, o] = c(null), s = `${r}|${n}`, l = r === null ? null : i?.key === s ? i.at : r;
702
+ return a(() => {
703
+ let t = e.current;
704
+ !t || l === null || l >= he.length - 1 || t.scrollWidth > t.clientWidth + 1 && o({
705
+ key: s,
706
+ at: l + 1
707
+ });
708
+ }, [
709
+ l,
710
+ s,
711
+ e
712
+ ]), l === null ? null : he[l];
713
+ }
714
+ var ve = /* @__PURE__ */ r(function({ seed: n, label: r, art: a, src: d, title: f, eyebrow: m, shape: g = "banner", flush: _, className: v }, y) {
715
+ let { w: b, h: x } = h[g], [S, w] = c(null), T = `art${i().replace(/[^a-zA-Z0-9]/g, "")}`, E = a ?? C(n), D = !p.includes(E.style), [O, k] = D ? [m, f].map((e) => typeof e == "string" || typeof e == "number" ? String(e) : void 0) : [], A = o(() => Z(E, {
716
+ shape: g,
717
+ idPrefix: T,
718
+ eyebrow: O,
719
+ title: k
720
+ }), [
721
+ E,
722
+ g,
723
+ T,
724
+ O,
725
+ k
726
+ ]), j = B(E), M = s(null), N = s(null), P = _e(N, e(M), typeof f == "string" ? f : "");
727
+ return /* @__PURE__ */ u("span", {
728
+ ref: M,
729
+ className: t("@container relative block w-full", _ ? "h-full" : "rounded-well", v),
730
+ children: [
731
+ /* @__PURE__ */ l("svg", {
732
+ ref: y,
733
+ viewBox: `0 0 ${b} ${x}`,
734
+ role: "img",
735
+ "aria-label": r,
736
+ preserveAspectRatio: "xMidYMid slice",
737
+ className: t("block w-full overflow-hidden", _ ? "h-full" : t("rounded-well", fe.shape[g].classes)),
738
+ children: d && S !== d ? /* @__PURE__ */ l("image", {
739
+ href: d,
740
+ width: b,
741
+ height: x,
742
+ preserveAspectRatio: "xMidYMid slice",
743
+ onError: () => w(d)
744
+ }) : A.children?.map(me)
745
+ }),
746
+ !D && (m || f) && /* @__PURE__ */ u("span", {
747
+ "aria-hidden": !0,
748
+ className: "pointer-events-none absolute flex flex-col items-start gap-4 text-balance",
749
+ style: {
750
+ left: `${j.eyebrow.x / b * 100}cqw`,
751
+ bottom: `${j.title.bottom / b * 100}cqw`,
752
+ maxWidth: `${236 / b * 100}cqw`,
753
+ hyphens: "auto",
754
+ color: j.color
755
+ },
756
+ children: [m && /* @__PURE__ */ l("span", {
757
+ className: "text-caption font-medium opacity-70 @cell-lg:text-body-lg",
758
+ children: m
759
+ }), f && /* @__PURE__ */ l("span", {
760
+ ref: N,
761
+ className: t("max-w-full font-semibold", P ?? "text-title-sm @cell-sm:text-title @cell-md:text-title-lg @cell-lg:text-display", P && P !== ge && "whitespace-nowrap"),
762
+ children: f
763
+ })]
764
+ }),
765
+ !_ && /* @__PURE__ */ l("span", {
766
+ "aria-hidden": !0,
767
+ className: "pointer-events-none absolute inset-0 image-outline"
768
+ })
769
+ ]
770
+ });
771
+ });
772
+ process.env.NODE_ENV !== "production" && (ve.displayName = "ReleaseArt");
773
+ function ye({ seed: e, label: t, art: n, title: r, eyebrow: i, shape: a = "banner" }) {
774
+ let { w: o, h: s } = h[a], c = Z(n ?? C(e), {
775
+ shape: a,
776
+ title: r,
777
+ eyebrow: i,
778
+ idPrefix: "art"
779
+ });
780
+ return $({
781
+ ...c,
782
+ attrs: {
783
+ ...c.attrs,
784
+ width: o * 2,
785
+ height: s * 2,
786
+ role: "img",
787
+ ariaLabel: t
788
+ }
789
+ });
790
+ }
791
+ export { p as a, S as c, Y as d, X as f, ye as i, x as l, fe as n, m as o, ve as r, b as s, pe as t, C as u };
792
+
793
+ //# sourceMappingURL=release-art-CZgWIES9.js.map