@frequencyads/components 0.1.1 → 0.1.3

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.
Files changed (93) hide show
  1. package/dist/AnimatedCounter/AnimatedCounter.d.ts +19 -0
  2. package/dist/AnimatedCounter/AnimatedCounter.d.ts.map +1 -0
  3. package/dist/AnimatedCounter/index.d.ts +2 -0
  4. package/dist/AnimatedCounter/index.d.ts.map +1 -0
  5. package/dist/AnimatedWaveform/AnimatedWaveform.d.ts +10 -0
  6. package/dist/AnimatedWaveform/AnimatedWaveform.d.ts.map +1 -0
  7. package/dist/AnimatedWaveform/index.d.ts +2 -0
  8. package/dist/AnimatedWaveform/index.d.ts.map +1 -0
  9. package/dist/AudioPlayer/AudioPlayer.d.ts +26 -0
  10. package/dist/AudioPlayer/AudioPlayer.d.ts.map +1 -0
  11. package/dist/AudioPlayer/index.d.ts +2 -0
  12. package/dist/AudioPlayer/index.d.ts.map +1 -0
  13. package/dist/AudioWaveform/AudioWaveform.d.ts +27 -0
  14. package/dist/AudioWaveform/AudioWaveform.d.ts.map +1 -0
  15. package/dist/AudioWaveform/index.d.ts +2 -0
  16. package/dist/AudioWaveform/index.d.ts.map +1 -0
  17. package/dist/CodeBlock/CodeBlock.d.ts +10 -0
  18. package/dist/CodeBlock/CodeBlock.d.ts.map +1 -0
  19. package/dist/CodeBlock/index.d.ts +2 -0
  20. package/dist/CodeBlock/index.d.ts.map +1 -0
  21. package/dist/ColorPalette/ColorPalette.d.ts +10 -0
  22. package/dist/ColorPalette/ColorPalette.d.ts.map +1 -0
  23. package/dist/ColorPalette/index.d.ts +2 -0
  24. package/dist/ColorPalette/index.d.ts.map +1 -0
  25. package/dist/ColorSwatch/ColorSwatch.d.ts +10 -0
  26. package/dist/ColorSwatch/ColorSwatch.d.ts.map +1 -0
  27. package/dist/ColorSwatch/index.d.ts +2 -0
  28. package/dist/ColorSwatch/index.d.ts.map +1 -0
  29. package/dist/Copyable/Copyable.d.ts +7 -0
  30. package/dist/Copyable/Copyable.d.ts.map +1 -0
  31. package/dist/Copyable/index.d.ts +2 -0
  32. package/dist/Copyable/index.d.ts.map +1 -0
  33. package/dist/DosDonts/DosDonts.d.ts +10 -0
  34. package/dist/DosDonts/DosDonts.d.ts.map +1 -0
  35. package/dist/DosDonts/index.d.ts +2 -0
  36. package/dist/DosDonts/index.d.ts.map +1 -0
  37. package/dist/ExpandableCard/ExpandableCard.d.ts +30 -0
  38. package/dist/ExpandableCard/ExpandableCard.d.ts.map +1 -0
  39. package/dist/ExpandableCard/index.d.ts +2 -0
  40. package/dist/ExpandableCard/index.d.ts.map +1 -0
  41. package/dist/FadeInSection/FadeInSection.d.ts +10 -0
  42. package/dist/FadeInSection/FadeInSection.d.ts.map +1 -0
  43. package/dist/FadeInSection/index.d.ts +2 -0
  44. package/dist/FadeInSection/index.d.ts.map +1 -0
  45. package/dist/FrequencyWave/FrequencyWave.d.ts +15 -0
  46. package/dist/FrequencyWave/FrequencyWave.d.ts.map +1 -0
  47. package/dist/FrequencyWave/index.d.ts +2 -0
  48. package/dist/FrequencyWave/index.d.ts.map +1 -0
  49. package/dist/GradientSwatch/GradientSwatch.d.ts +10 -0
  50. package/dist/GradientSwatch/GradientSwatch.d.ts.map +1 -0
  51. package/dist/GradientSwatch/index.d.ts +2 -0
  52. package/dist/GradientSwatch/index.d.ts.map +1 -0
  53. package/dist/Hero/Hero.d.ts +34 -0
  54. package/dist/Hero/Hero.d.ts.map +1 -0
  55. package/dist/Hero/index.d.ts +2 -0
  56. package/dist/Hero/index.d.ts.map +1 -0
  57. package/dist/HintBadge/HintBadge.d.ts +8 -0
  58. package/dist/HintBadge/HintBadge.d.ts.map +1 -0
  59. package/dist/HintBadge/index.d.ts +2 -0
  60. package/dist/HintBadge/index.d.ts.map +1 -0
  61. package/dist/MiniAudioPlayer/MiniAudioPlayer.d.ts +18 -0
  62. package/dist/MiniAudioPlayer/MiniAudioPlayer.d.ts.map +1 -0
  63. package/dist/MiniAudioPlayer/index.d.ts +2 -0
  64. package/dist/MiniAudioPlayer/index.d.ts.map +1 -0
  65. package/dist/PrincipleCard/PrincipleCard.d.ts +14 -0
  66. package/dist/PrincipleCard/PrincipleCard.d.ts.map +1 -0
  67. package/dist/PrincipleCard/index.d.ts +2 -0
  68. package/dist/PrincipleCard/index.d.ts.map +1 -0
  69. package/dist/SpeedDial/SpeedDial.d.ts +33 -0
  70. package/dist/SpeedDial/SpeedDial.d.ts.map +1 -0
  71. package/dist/SpeedDial/index.d.ts +2 -0
  72. package/dist/SpeedDial/index.d.ts.map +1 -0
  73. package/dist/SplitSection/SplitSection.d.ts +35 -0
  74. package/dist/SplitSection/SplitSection.d.ts.map +1 -0
  75. package/dist/SplitSection/index.d.ts +2 -0
  76. package/dist/SplitSection/index.d.ts.map +1 -0
  77. package/dist/TestimonialCard/TestimonialCard.d.ts +17 -0
  78. package/dist/TestimonialCard/TestimonialCard.d.ts.map +1 -0
  79. package/dist/TestimonialCard/index.d.ts +2 -0
  80. package/dist/TestimonialCard/index.d.ts.map +1 -0
  81. package/dist/VideoBackground/VideoBackground.d.ts +8 -0
  82. package/dist/VideoBackground/VideoBackground.d.ts.map +1 -0
  83. package/dist/VideoBackground/index.d.ts +2 -0
  84. package/dist/VideoBackground/index.d.ts.map +1 -0
  85. package/dist/components.css +1 -0
  86. package/dist/index.d.ts +25 -339
  87. package/dist/index.d.ts.map +1 -0
  88. package/dist/index.js +1 -1562
  89. package/dist/index.mjs +915 -1215
  90. package/llms.txt +9 -0
  91. package/package.json +10 -6
  92. package/dist/index.css +0 -543
  93. package/dist/index.d.mts +0 -341
package/dist/index.js CHANGED
@@ -1,1563 +1,2 @@
1
1
  'use client';
2
- "use strict";
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __defProps = Object.defineProperties;
6
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
8
- var __getOwnPropNames = Object.getOwnPropertyNames;
9
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
10
- var __getProtoOf = Object.getPrototypeOf;
11
- var __hasOwnProp = Object.prototype.hasOwnProperty;
12
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
13
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
14
- var __spreadValues = (a, b) => {
15
- for (var prop in b || (b = {}))
16
- if (__hasOwnProp.call(b, prop))
17
- __defNormalProp(a, prop, b[prop]);
18
- if (__getOwnPropSymbols)
19
- for (var prop of __getOwnPropSymbols(b)) {
20
- if (__propIsEnum.call(b, prop))
21
- __defNormalProp(a, prop, b[prop]);
22
- }
23
- return a;
24
- };
25
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
26
- var __objRest = (source, exclude) => {
27
- var target = {};
28
- for (var prop in source)
29
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
30
- target[prop] = source[prop];
31
- if (source != null && __getOwnPropSymbols)
32
- for (var prop of __getOwnPropSymbols(source)) {
33
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
34
- target[prop] = source[prop];
35
- }
36
- return target;
37
- };
38
- var __export = (target, all) => {
39
- for (var name in all)
40
- __defProp(target, name, { get: all[name], enumerable: true });
41
- };
42
- var __copyProps = (to, from, except, desc) => {
43
- if (from && typeof from === "object" || typeof from === "function") {
44
- for (let key of __getOwnPropNames(from))
45
- if (!__hasOwnProp.call(to, key) && key !== except)
46
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
47
- }
48
- return to;
49
- };
50
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
51
- // If the importer is in node compatibility mode or this is not an ESM
52
- // file that has been converted to a CommonJS file using a Babel-
53
- // compatible transform (i.e. "__esModule" has not been set), then set
54
- // "default" to the CommonJS "module.exports" for node compatibility.
55
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
56
- mod
57
- ));
58
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
59
-
60
- // src/index.ts
61
- var index_exports = {};
62
- __export(index_exports, {
63
- AnimatedCounter: () => AnimatedCounter,
64
- AnimatedWaveform: () => AnimatedWaveform,
65
- AudioPlayer: () => AudioPlayer,
66
- AudioWaveform: () => AudioWaveform,
67
- CodeBlock: () => CodeBlock,
68
- ColorPalette: () => ColorPalette,
69
- ColorSwatch: () => ColorSwatch,
70
- Copyable: () => Copyable,
71
- DosDonts: () => DosDonts,
72
- ExpandableCard: () => ExpandableCard,
73
- FadeInSection: () => FadeInSection,
74
- FrequencyWave: () => FrequencyWave,
75
- GradientSwatch: () => GradientSwatch,
76
- Hero: () => Hero,
77
- HintBadge: () => HintBadge,
78
- MiniAudioPlayer: () => MiniAudioPlayer,
79
- PrincipleCard: () => PrincipleCard,
80
- SpeedDial: () => SpeedDial,
81
- SplitSection: () => SplitSection,
82
- VideoBackground: () => VideoBackground
83
- });
84
- module.exports = __toCommonJS(index_exports);
85
-
86
- // src/AnimatedCounter/AnimatedCounter.tsx
87
- var import_react = require("react");
88
- var import_core = require("@mantine/core");
89
- var import_jsx_runtime = require("react/jsx-runtime");
90
- function AnimatedCounter(_a) {
91
- var _b = _a, {
92
- value,
93
- suffix = "",
94
- prefix = "",
95
- duration = 2e3,
96
- threshold = 0.5,
97
- abbreviate = true,
98
- decimals
99
- } = _b, textProps = __objRest(_b, [
100
- "value",
101
- "suffix",
102
- "prefix",
103
- "duration",
104
- "threshold",
105
- "abbreviate",
106
- "decimals"
107
- ]);
108
- const [count, setCount] = (0, import_react.useState)(0);
109
- const [hasTriggered, setHasTriggered] = (0, import_react.useState)(false);
110
- const ref = (0, import_react.useRef)(null);
111
- (0, import_react.useEffect)(() => {
112
- const el = ref.current;
113
- if (!el) return;
114
- const observer = new IntersectionObserver(
115
- ([entry]) => {
116
- if (entry.isIntersecting && !hasTriggered) {
117
- setHasTriggered(true);
118
- }
119
- },
120
- { threshold }
121
- );
122
- observer.observe(el);
123
- return () => observer.disconnect();
124
- }, [hasTriggered, threshold]);
125
- (0, import_react.useEffect)(() => {
126
- if (!hasTriggered) return;
127
- let startTime;
128
- let raf;
129
- const animate = (timestamp) => {
130
- if (!startTime) startTime = timestamp;
131
- const progress = Math.min((timestamp - startTime) / duration, 1);
132
- const eased = 1 - Math.pow(1 - progress, 3);
133
- setCount(eased * value);
134
- if (progress < 1) {
135
- raf = requestAnimationFrame(animate);
136
- }
137
- };
138
- raf = requestAnimationFrame(animate);
139
- return () => cancelAnimationFrame(raf);
140
- }, [hasTriggered, value, duration]);
141
- const formatValue = () => {
142
- if (abbreviate && value >= 1e3) {
143
- const kValue = count / 1e3;
144
- return kValue % 1 === 0 ? `${Math.round(kValue)}K` : `${kValue.toFixed(1)}K`;
145
- }
146
- if (decimals !== void 0) {
147
- return count.toFixed(decimals);
148
- }
149
- if (value !== Math.floor(value)) {
150
- return count.toFixed(1);
151
- }
152
- return Math.round(count).toString();
153
- };
154
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
155
- import_core.Text,
156
- __spreadProps(__spreadValues({
157
- component: "span",
158
- ref,
159
- style: { fontVariantNumeric: "tabular-nums" }
160
- }, textProps), {
161
- children: [
162
- prefix,
163
- formatValue(),
164
- suffix
165
- ]
166
- })
167
- );
168
- }
169
-
170
- // src/AnimatedWaveform/AnimatedWaveform.tsx
171
- var import_react2 = require("react");
172
- var import_framer_motion = require("framer-motion");
173
-
174
- // src/AnimatedWaveform/AnimatedWaveform.module.css
175
- var AnimatedWaveform_default = {};
176
-
177
- // src/AnimatedWaveform/AnimatedWaveform.tsx
178
- var import_jsx_runtime2 = require("react/jsx-runtime");
179
- var BAR_COUNT = 140;
180
- var BAR_WIDTH = 3;
181
- var BAR_GAP = 10;
182
- var VIEW_HEIGHT = 150;
183
- var MIDLINE = VIEW_HEIGHT / 2;
184
- function AnimatedWaveform({
185
- barCount = BAR_COUNT,
186
- duration = 3,
187
- repeatDelay = 3
188
- }) {
189
- const [mounted, setMounted] = (0, import_react2.useState)(false);
190
- (0, import_react2.useEffect)(() => {
191
- setMounted(true);
192
- }, []);
193
- if (!mounted) return null;
194
- const viewWidth = barCount * BAR_GAP;
195
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: AnimatedWaveform_default.root, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
196
- "svg",
197
- {
198
- className: AnimatedWaveform_default.svg,
199
- viewBox: `0 0 ${viewWidth} ${VIEW_HEIGHT}`,
200
- preserveAspectRatio: "none",
201
- children: [
202
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("linearGradient", { id: "waveformBarGradient", x1: "0%", y1: "0%", x2: "100%", y2: "0%", children: [
203
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("stop", { offset: "0%", stopColor: "white", stopOpacity: "0" }),
204
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("stop", { offset: "15%", stopColor: "white", stopOpacity: "0.15" }),
205
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("stop", { offset: "50%", stopColor: "white", stopOpacity: "0.25" }),
206
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("stop", { offset: "85%", stopColor: "white", stopOpacity: "0.15" }),
207
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("stop", { offset: "100%", stopColor: "white", stopOpacity: "0" })
208
- ] }) }),
209
- [...Array(barCount)].map((_, i) => {
210
- const x = i * BAR_GAP;
211
- const baseHeight = 18 + Math.sin(i * 0.4) * 6 + Math.cos(i * 0.7) * 4;
212
- const staggerDelay = Math.min(i, barCount - 1 - i) * 0.04;
213
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("g", { children: [
214
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
215
- import_framer_motion.motion.rect,
216
- {
217
- x,
218
- width: BAR_WIDTH,
219
- rx: "1.5",
220
- fill: "url(#waveformBarGradient)",
221
- initial: { height: baseHeight / 2, y: MIDLINE - baseHeight / 4 },
222
- animate: {
223
- height: [baseHeight / 2, baseHeight * 2, baseHeight / 2, baseHeight * 1.2, baseHeight / 2],
224
- y: [
225
- MIDLINE - baseHeight / 4,
226
- MIDLINE - baseHeight,
227
- MIDLINE - baseHeight / 4,
228
- MIDLINE - baseHeight * 0.6,
229
- MIDLINE - baseHeight / 4
230
- ]
231
- },
232
- transition: {
233
- duration,
234
- repeat: Infinity,
235
- ease: "easeInOut",
236
- delay: staggerDelay,
237
- repeatDelay
238
- }
239
- }
240
- ),
241
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
242
- import_framer_motion.motion.rect,
243
- {
244
- x,
245
- y: MIDLINE,
246
- width: BAR_WIDTH,
247
- rx: "1.5",
248
- fill: "url(#waveformBarGradient)",
249
- initial: { height: baseHeight / 2 },
250
- animate: {
251
- height: [baseHeight / 2, baseHeight * 2, baseHeight / 2, baseHeight * 1.2, baseHeight / 2]
252
- },
253
- transition: {
254
- duration,
255
- repeat: Infinity,
256
- ease: "easeInOut",
257
- delay: staggerDelay,
258
- repeatDelay
259
- }
260
- }
261
- )
262
- ] }, i);
263
- })
264
- ]
265
- }
266
- ) });
267
- }
268
-
269
- // src/AudioPlayer/AudioPlayer.tsx
270
- var import_react4 = require("react");
271
- var import_core3 = require("@mantine/core");
272
- var import_icons_react = require("@tabler/icons-react");
273
-
274
- // src/AudioWaveform/AudioWaveform.tsx
275
- var import_react3 = require("react");
276
- var import_core2 = require("@mantine/core");
277
-
278
- // src/AudioWaveform/AudioWaveform.module.css
279
- var AudioWaveform_default = {};
280
-
281
- // src/AudioWaveform/AudioWaveform.tsx
282
- var import_jsx_runtime3 = require("react/jsx-runtime");
283
- function generateWaveformData(barCount = 100) {
284
- const data = [];
285
- for (let i = 0; i < barCount; i++) {
286
- const progress = i / (barCount - 1);
287
- const baseHeight = 20 + Math.sin(i * 0.1) * 15;
288
- const noise = (Math.random() - 0.5) * 20;
289
- const envelope = Math.sin(progress * Math.PI) * 30;
290
- const midBoost = progress > 0.2 && progress < 0.8 ? Math.random() * 10 : 0;
291
- const endTaper = progress < 0.05 || progress > 0.95 ? Math.min(progress / 0.05, (1 - progress) / 0.05) : 1;
292
- data.push(Math.max(5, Math.min(90, (baseHeight + noise + envelope + midBoost) * endTaper)));
293
- }
294
- return data;
295
- }
296
- var AudioWaveform = (0, import_react3.forwardRef)(
297
- ({
298
- audioRef,
299
- currentTime = 0,
300
- onSeek,
301
- loading = false,
302
- waveColor = "#CCCCCC",
303
- progressColor = "#169bde",
304
- height = 60,
305
- barWidth = 2,
306
- barGap = 1
307
- }, ref) => {
308
- const containerRef = (0, import_react3.useRef)(null);
309
- const [waveformData] = (0, import_react3.useState)(() => generateWaveformData());
310
- const [duration, setDuration] = (0, import_react3.useState)(0);
311
- const [progress, setProgress] = (0, import_react3.useState)(0);
312
- (0, import_react3.useImperativeHandle)(ref, () => ({
313
- seekTo: (time) => {
314
- if (duration > 0) {
315
- setProgress(Math.max(0, Math.min(100, time / duration * 100)));
316
- }
317
- },
318
- getCurrentTime: () => progress / 100 * duration,
319
- getDuration: () => duration
320
- }));
321
- (0, import_react3.useEffect)(() => {
322
- const audio = audioRef.current;
323
- if (!audio) return;
324
- const handleMeta = () => {
325
- if (audio.duration && !isNaN(audio.duration)) setDuration(audio.duration);
326
- };
327
- const handleTime = () => {
328
- if (audio.duration > 0) setProgress(audio.currentTime / audio.duration * 100);
329
- };
330
- if (audio.duration && !isNaN(audio.duration)) setDuration(audio.duration);
331
- audio.addEventListener("loadedmetadata", handleMeta);
332
- audio.addEventListener("timeupdate", handleTime);
333
- return () => {
334
- audio.removeEventListener("loadedmetadata", handleMeta);
335
- audio.removeEventListener("timeupdate", handleTime);
336
- };
337
- }, [audioRef]);
338
- (0, import_react3.useEffect)(() => {
339
- if (duration > 0 && typeof currentTime === "number") {
340
- setProgress(currentTime / duration * 100);
341
- }
342
- }, [currentTime, duration]);
343
- const handleClick = (0, import_react3.useCallback)(
344
- (e) => {
345
- if (!containerRef.current || !onSeek || duration === 0) return;
346
- const rect = containerRef.current.getBoundingClientRect();
347
- const seekTime = (e.clientX - rect.left) / rect.width * duration;
348
- onSeek(seekTime);
349
- },
350
- [onSeek, duration]
351
- );
352
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
353
- import_core2.Box,
354
- {
355
- ref: containerRef,
356
- className: AudioWaveform_default.root,
357
- style: { height },
358
- onClick: handleClick,
359
- children: [
360
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
361
- "div",
362
- {
363
- className: AudioWaveform_default.progressOverlay,
364
- style: { width: `${progress}%`, backgroundColor: `${progressColor}15` }
365
- }
366
- ),
367
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: AudioWaveform_default.bars, style: { gap: barGap }, children: waveformData.map((barHeight, i) => {
368
- const isActive = i / waveformData.length * 100 <= progress;
369
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
370
- "div",
371
- {
372
- className: AudioWaveform_default.bar,
373
- style: {
374
- width: barWidth,
375
- height: `${barHeight}%`,
376
- backgroundColor: isActive ? progressColor : waveColor
377
- }
378
- },
379
- i
380
- );
381
- }) }),
382
- loading && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: AudioWaveform_default.loading, children: "Loading waveform..." })
383
- ]
384
- }
385
- );
386
- }
387
- );
388
- AudioWaveform.displayName = "AudioWaveform";
389
-
390
- // src/AudioPlayer/AudioPlayer.module.css
391
- var AudioPlayer_default = {};
392
-
393
- // src/AudioPlayer/AudioPlayer.tsx
394
- var import_jsx_runtime4 = require("react/jsx-runtime");
395
- function formatTime(seconds) {
396
- const m = Math.floor(seconds / 60);
397
- const s = Math.floor(seconds % 60);
398
- return `${m.toString().padStart(2, "0")}:${s.toString().padStart(2, "0")}`;
399
- }
400
- function AudioPlayer({
401
- src,
402
- filename = "audio",
403
- playButtonColor,
404
- playButtonSize = 32,
405
- waveColor = "#D0D0D0",
406
- progressColor = "#a8a8a8",
407
- waveHeight = 64,
408
- barWidth = 3,
409
- barGap = 2,
410
- showVolume = true,
411
- showDownload = true
412
- }) {
413
- const audioRef = (0, import_react4.useRef)(null);
414
- const [isPlaying, setIsPlaying] = (0, import_react4.useState)(false);
415
- const [currentTime, setCurrentTime] = (0, import_react4.useState)(0);
416
- const [currentTimeFormatted, setCurrentTimeFormatted] = (0, import_react4.useState)("00:00");
417
- const [totalDuration, setTotalDuration] = (0, import_react4.useState)("00:00");
418
- const [volume, setVolume] = (0, import_react4.useState)(50);
419
- const [prevVolume, setPrevVolume] = (0, import_react4.useState)(50);
420
- const [isMuted, setIsMuted] = (0, import_react4.useState)(false);
421
- (0, import_react4.useEffect)(() => {
422
- const audio = audioRef.current;
423
- if (!audio) return;
424
- audio.volume = volume / 100;
425
- const handleTimeUpdate = () => {
426
- setCurrentTime(audio.currentTime);
427
- setCurrentTimeFormatted(formatTime(audio.currentTime));
428
- };
429
- const handleMeta = () => setTotalDuration(formatTime(audio.duration));
430
- const handleEnded = () => {
431
- setTimeout(() => {
432
- setCurrentTime(0);
433
- setCurrentTimeFormatted("00:00");
434
- setIsPlaying(false);
435
- }, 500);
436
- };
437
- const handlePlay = () => setIsPlaying(true);
438
- const handlePause = () => setIsPlaying(false);
439
- audio.addEventListener("timeupdate", handleTimeUpdate);
440
- audio.addEventListener("loadedmetadata", handleMeta);
441
- audio.addEventListener("ended", handleEnded);
442
- audio.addEventListener("play", handlePlay);
443
- audio.addEventListener("pause", handlePause);
444
- return () => {
445
- audio.removeEventListener("timeupdate", handleTimeUpdate);
446
- audio.removeEventListener("loadedmetadata", handleMeta);
447
- audio.removeEventListener("ended", handleEnded);
448
- audio.removeEventListener("play", handlePlay);
449
- audio.removeEventListener("pause", handlePause);
450
- };
451
- }, [src]);
452
- const togglePlay = (0, import_react4.useCallback)(() => {
453
- const audio = audioRef.current;
454
- if (!audio) return;
455
- if (isPlaying) {
456
- audio.pause();
457
- } else {
458
- audio.play().catch(() => {
459
- });
460
- }
461
- }, [isPlaying]);
462
- const handleSeek = (0, import_react4.useCallback)((time) => {
463
- const audio = audioRef.current;
464
- if (audio && !isNaN(time) && isFinite(time)) {
465
- audio.currentTime = time;
466
- setCurrentTime(time);
467
- setCurrentTimeFormatted(formatTime(time));
468
- }
469
- }, []);
470
- const handleVolumeChange = (0, import_react4.useCallback)(
471
- (value) => {
472
- const audio = audioRef.current;
473
- if (!audio) return;
474
- audio.volume = value / 100;
475
- setVolume(value);
476
- if (value > 0) {
477
- setPrevVolume(value);
478
- setIsMuted(false);
479
- } else {
480
- setIsMuted(true);
481
- }
482
- },
483
- []
484
- );
485
- const toggleMute = (0, import_react4.useCallback)(() => {
486
- const audio = audioRef.current;
487
- if (!audio) return;
488
- if (isMuted) {
489
- const restore = prevVolume || 50;
490
- audio.volume = restore / 100;
491
- setVolume(restore);
492
- setIsMuted(false);
493
- } else {
494
- setPrevVolume(volume);
495
- audio.volume = 0;
496
- setVolume(0);
497
- setIsMuted(true);
498
- }
499
- }, [isMuted, volume, prevVolume]);
500
- const handleDownload = (0, import_react4.useCallback)(() => {
501
- fetch(src).then((r) => r.blob()).then((blob) => {
502
- const url = URL.createObjectURL(blob);
503
- const a = document.createElement("a");
504
- a.href = url;
505
- a.download = filename;
506
- document.body.appendChild(a);
507
- a.click();
508
- document.body.removeChild(a);
509
- URL.revokeObjectURL(url);
510
- }).catch(() => window.open(src, "_blank"));
511
- }, [src, filename]);
512
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_core3.Group, { gap: "sm", wrap: "nowrap", className: AudioPlayer_default.root, children: [
513
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("audio", { ref: audioRef, src, preload: "metadata" }),
514
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
515
- import_core3.ActionIcon,
516
- {
517
- variant: "filled",
518
- radius: "xl",
519
- size: playButtonSize,
520
- color: playButtonColor,
521
- onClick: togglePlay,
522
- "aria-label": isPlaying ? "Pause" : "Play",
523
- className: AudioPlayer_default.playButton,
524
- children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_icons_react.IconPlayerPauseFilled, { size: playButtonSize * 0.5 }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_icons_react.IconPlayerPlayFilled, { size: playButtonSize * 0.5 })
525
- }
526
- ),
527
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_core3.Text, { size: "xs", ff: "monospace", c: "dimmed", className: AudioPlayer_default.time, children: currentTimeFormatted }),
528
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_core3.Box, { style: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
529
- AudioWaveform,
530
- {
531
- audioRef,
532
- currentTime,
533
- onSeek: handleSeek,
534
- waveColor,
535
- progressColor,
536
- height: waveHeight,
537
- barWidth,
538
- barGap
539
- }
540
- ) }),
541
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_core3.Text, { size: "xs", ff: "monospace", c: "dimmed", className: AudioPlayer_default.time, children: totalDuration }),
542
- showVolume && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_core3.Group, { gap: 4, wrap: "nowrap", className: AudioPlayer_default.volumeGroup, children: [
543
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
544
- import_core3.ActionIcon,
545
- {
546
- variant: "subtle",
547
- size: "sm",
548
- onClick: toggleMute,
549
- "aria-label": isMuted ? "Unmute" : "Mute",
550
- children: isMuted ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_icons_react.IconVolumeOff, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_icons_react.IconVolume, { size: 16 })
551
- }
552
- ),
553
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
554
- import_core3.Slider,
555
- {
556
- value: volume,
557
- onChange: handleVolumeChange,
558
- size: "xs",
559
- w: 80,
560
- "aria-label": "Volume"
561
- }
562
- )
563
- ] }),
564
- showDownload && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_core3.ActionIcon, { variant: "subtle", size: "sm", onClick: handleDownload, "aria-label": "Download", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_icons_react.IconDownload, { size: 16 }) })
565
- ] });
566
- }
567
-
568
- // src/CodeBlock/CodeBlock.tsx
569
- var import_react5 = require("react");
570
- var import_core4 = require("@mantine/core");
571
-
572
- // src/CodeBlock/CodeBlock.module.css
573
- var CodeBlock_default = {};
574
-
575
- // src/CodeBlock/CodeBlock.tsx
576
- var import_jsx_runtime5 = require("react/jsx-runtime");
577
- function CodeBlock({ code, filename, height = 384 }) {
578
- const [copied, setCopied] = (0, import_react5.useState)(false);
579
- const handleCopy = (0, import_react5.useCallback)(async () => {
580
- try {
581
- await navigator.clipboard.writeText(code);
582
- setCopied(true);
583
- setTimeout(() => setCopied(false), 2e3);
584
- } catch (e) {
585
- }
586
- }, [code]);
587
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_core4.Box, { className: CodeBlock_default.root, children: [
588
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_core4.Group, { justify: "space-between", mb: "xs", children: [
589
- filename && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_core4.Text, { size: "sm", fw: 500, c: "dimmed", children: filename }),
590
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
591
- import_core4.Button,
592
- {
593
- size: "xs",
594
- radius: "md",
595
- color: copied ? "green" : "blue",
596
- onClick: handleCopy,
597
- children: copied ? "Copied!" : "Copy"
598
- }
599
- )
600
- ] }),
601
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
602
- "textarea",
603
- {
604
- readOnly: true,
605
- value: code,
606
- className: CodeBlock_default.textarea,
607
- style: { height }
608
- }
609
- )
610
- ] });
611
- }
612
-
613
- // src/ColorPalette/ColorPalette.tsx
614
- var import_core6 = require("@mantine/core");
615
-
616
- // src/Copyable/Copyable.tsx
617
- var import_react6 = require("react");
618
- var import_core5 = require("@mantine/core");
619
-
620
- // src/Copyable/Copyable.module.css
621
- var Copyable_default = {};
622
-
623
- // src/Copyable/Copyable.tsx
624
- var import_jsx_runtime6 = require("react/jsx-runtime");
625
- function Copyable({ value, children }) {
626
- const [toast, setToast] = (0, import_react6.useState)(null);
627
- const handleCopy = (0, import_react6.useCallback)(() => {
628
- navigator.clipboard.writeText(value).then(() => {
629
- setToast(`Copied ${value}`);
630
- setTimeout(() => setToast(null), 1800);
631
- });
632
- }, [value]);
633
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
634
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
635
- "span",
636
- {
637
- onClick: handleCopy,
638
- className: Copyable_default.root,
639
- title: `Click to copy ${value}`,
640
- children
641
- }
642
- ),
643
- toast && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core5.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
644
- import_core5.Notification,
645
- {
646
- withCloseButton: false,
647
- className: Copyable_default.toast,
648
- color: "blue",
649
- children: toast
650
- }
651
- ) })
652
- ] });
653
- }
654
-
655
- // src/ColorPalette/ColorPalette.module.css
656
- var ColorPalette_default = {};
657
-
658
- // src/ColorPalette/ColorPalette.tsx
659
- var import_jsx_runtime7 = require("react/jsx-runtime");
660
- function ColorPalette({ name, shades, mainIndex = 5 }) {
661
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: ColorPalette_default.root, children: [
662
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_core6.Title, { order: 4, size: "lg", tt: "capitalize", mb: "xs", children: name }),
663
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_core6.SimpleGrid, { cols: 10, spacing: 4, children: shades.map((hex, i) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Copyable, { value: hex, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: ColorPalette_default.shade, children: [
664
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
665
- "div",
666
- {
667
- className: `${ColorPalette_default.color} ${i === mainIndex ? ColorPalette_default.main : ""}`,
668
- style: { backgroundColor: hex }
669
- }
670
- ),
671
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_core6.Text, { size: "xs", c: "dimmed", ta: "center", mt: 4, children: i }),
672
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_core6.Text, { size: "xs", c: "dimmed", ta: "center", ff: "monospace", children: hex })
673
- ] }) }, i)) })
674
- ] });
675
- }
676
-
677
- // src/ColorSwatch/ColorSwatch.tsx
678
- var import_core7 = require("@mantine/core");
679
-
680
- // src/ColorSwatch/ColorSwatch.module.css
681
- var ColorSwatch_default = {};
682
-
683
- // src/ColorSwatch/ColorSwatch.tsx
684
- var import_jsx_runtime8 = require("react/jsx-runtime");
685
- function ColorSwatch({ name, hex, label }) {
686
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Copyable, { value: hex, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_core7.Paper, { className: ColorSwatch_default.root, shadow: "lg", radius: "md", withBorder: false, children: [
687
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: ColorSwatch_default.preview, style: { backgroundColor: hex } }),
688
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: ColorSwatch_default.info, children: [
689
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core7.Text, { fw: 600, size: "sm", children: name }),
690
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core7.Text, { size: "xs", c: "dimmed", ff: "monospace", children: hex }),
691
- label && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core7.Text, { size: "xs", c: "dimmed", children: label })
692
- ] })
693
- ] }) });
694
- }
695
-
696
- // src/DosDonts/DosDonts.tsx
697
- var import_core8 = require("@mantine/core");
698
- var import_icons_react2 = require("@tabler/icons-react");
699
-
700
- // src/DosDonts/DosDonts.module.css
701
- var DosDonts_default = {};
702
-
703
- // src/DosDonts/DosDonts.tsx
704
- var import_jsx_runtime9 = require("react/jsx-runtime");
705
- function DosDonts({ items }) {
706
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: DosDonts_default.root, children: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core8.SimpleGrid, { cols: { base: 1, sm: 2 }, spacing: "md", children: [
707
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core8.Paper, { className: DosDonts_default.dont, p: "md", radius: "md", children: [
708
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core8.Group, { gap: 6, mb: 6, children: [
709
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_icons_react2.IconX, { size: 16, className: DosDonts_default.dontIcon }),
710
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Text, { size: "sm", fw: 600, className: DosDonts_default.dontLabel, children: "Don't" })
711
- ] }),
712
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Text, { size: "sm", children: item.dont })
713
- ] }),
714
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core8.Paper, { className: DosDonts_default.do, p: "md", radius: "md", children: [
715
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core8.Group, { gap: 6, mb: 6, children: [
716
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_icons_react2.IconCheck, { size: 16, className: DosDonts_default.doIcon }),
717
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Text, { size: "sm", fw: 600, className: DosDonts_default.doLabel, children: "Do" })
718
- ] }),
719
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Text, { size: "sm", children: item.do })
720
- ] })
721
- ] }, i)) });
722
- }
723
-
724
- // src/ExpandableCard/ExpandableCard.tsx
725
- var import_react7 = require("react");
726
- var import_core9 = require("@mantine/core");
727
- var import_framer_motion2 = require("framer-motion");
728
-
729
- // src/ExpandableCard/ExpandableCard.module.css
730
- var ExpandableCard_default = {};
731
-
732
- // src/ExpandableCard/ExpandableCard.tsx
733
- var import_jsx_runtime10 = require("react/jsx-runtime");
734
- function ExpandableCard({
735
- title,
736
- description,
737
- expandedContent,
738
- icon: Icon,
739
- color = "blue",
740
- iconSize = "lg",
741
- collapsedHeight = 120,
742
- threshold = 0.5,
743
- delay = 300,
744
- expanded: controlledExpanded,
745
- onExpandedChange
746
- }) {
747
- const ref = (0, import_react7.useRef)(null);
748
- const [internalExpanded, setInternalExpanded] = (0, import_react7.useState)(false);
749
- const isControlled = controlledExpanded !== void 0;
750
- const isExpanded = isControlled ? controlledExpanded : internalExpanded;
751
- (0, import_react7.useEffect)(() => {
752
- if (isControlled) return;
753
- const el = ref.current;
754
- if (!el) return;
755
- const observer = new IntersectionObserver(
756
- ([entry]) => {
757
- if (entry.isIntersecting) {
758
- setTimeout(() => {
759
- setInternalExpanded(true);
760
- onExpandedChange == null ? void 0 : onExpandedChange(true);
761
- }, delay);
762
- }
763
- },
764
- { threshold }
765
- );
766
- observer.observe(el);
767
- return () => observer.disconnect();
768
- }, [isControlled, threshold, delay, onExpandedChange]);
769
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
770
- import_core9.Paper,
771
- __spreadProps(__spreadValues({
772
- ref,
773
- radius: 4,
774
- className: ExpandableCard_default.root,
775
- component: import_framer_motion2.motion.div
776
- }, {
777
- animate: { height: isExpanded ? "auto" : collapsedHeight },
778
- transition: { duration: 0.5, ease: "easeOut" }
779
- }), {
780
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: ExpandableCard_default.inner, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_core9.Group, { align: "flex-start", justify: "space-between", gap: "lg", wrap: "nowrap", children: [
781
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_core9.Stack, { gap: "xs", style: { flex: 1 }, children: [
782
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core9.Text, { fw: 700, size: "xl", lh: 1.3, children: title }),
783
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core9.Text, { size: "md", c: "dimmed", children: description }),
784
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
785
- import_framer_motion2.motion.div,
786
- {
787
- initial: { opacity: 0, height: 0 },
788
- animate: {
789
- opacity: isExpanded ? 1 : 0,
790
- height: isExpanded ? "auto" : 0
791
- },
792
- transition: { duration: 0.4, delay: 0.2 },
793
- style: { overflow: "hidden" },
794
- children: typeof expandedContent === "string" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core9.Text, { size: "sm", c: "dimmed", mt: "sm", children: expandedContent }) : expandedContent
795
- }
796
- )
797
- ] }),
798
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
799
- import_framer_motion2.motion.div,
800
- {
801
- animate: { scale: isExpanded ? 1.1 : 1 },
802
- transition: { duration: 0.3 },
803
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core9.ThemeIcon, { size: iconSize, radius: 4, color, variant: "filled", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Icon, { size: 20, stroke: 1.5 }) })
804
- }
805
- )
806
- ] }) })
807
- })
808
- );
809
- }
810
-
811
- // src/FadeInSection/FadeInSection.tsx
812
- var import_react8 = require("react");
813
- var import_core10 = require("@mantine/core");
814
-
815
- // src/FadeInSection/FadeInSection.module.css
816
- var FadeInSection_default = {};
817
-
818
- // src/FadeInSection/FadeInSection.tsx
819
- var import_jsx_runtime11 = require("react/jsx-runtime");
820
- function FadeInSection(_a) {
821
- var _b = _a, {
822
- children,
823
- delay = 0,
824
- threshold = 0.1,
825
- className
826
- } = _b, props = __objRest(_b, [
827
- "children",
828
- "delay",
829
- "threshold",
830
- "className"
831
- ]);
832
- const ref = (0, import_react8.useRef)(null);
833
- const [isVisible, setIsVisible] = (0, import_react8.useState)(false);
834
- (0, import_react8.useEffect)(() => {
835
- const el = ref.current;
836
- if (!el) return;
837
- const observer = new IntersectionObserver(
838
- ([entry]) => {
839
- if (entry.isIntersecting) {
840
- if (delay > 0) {
841
- setTimeout(() => setIsVisible(true), delay);
842
- } else {
843
- setIsVisible(true);
844
- }
845
- }
846
- },
847
- { threshold }
848
- );
849
- observer.observe(el);
850
- return () => observer.disconnect();
851
- }, [delay, threshold]);
852
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
853
- import_core10.Box,
854
- __spreadProps(__spreadValues({
855
- ref,
856
- className: `${FadeInSection_default.root} ${isVisible ? FadeInSection_default.visible : ""} ${className != null ? className : ""}`
857
- }, props), {
858
- children
859
- })
860
- );
861
- }
862
-
863
- // src/FrequencyWave/FrequencyWave.tsx
864
- var import_react9 = require("react");
865
- var import_core11 = require("@mantine/core");
866
- var import_jsx_runtime12 = require("react/jsx-runtime");
867
- function FrequencyWave({ isActive = false, height = 60 }) {
868
- const canvasRef = (0, import_react9.useRef)(null);
869
- const animationRef = (0, import_react9.useRef)(void 0);
870
- const [isPulsing, setIsPulsing] = (0, import_react9.useState)(false);
871
- const lastPulseRef = (0, import_react9.useRef)(null);
872
- const randomSpikeRef = (0, import_react9.useRef)(null);
873
- const { colorScheme } = (0, import_core11.useMantineColorScheme)();
874
- const isDark = colorScheme === "dark";
875
- const colors = {
876
- start: isDark ? "#7950F2" : "#9775FA",
877
- mid: isDark ? "#BE4BDB" : "#DA77F2",
878
- end: isDark ? "#15AABF" : "#22B8CF"
879
- };
880
- const drawWave = (0, import_react9.useCallback)(
881
- (ctx, width, canvasHeight, time) => {
882
- var _a;
883
- ctx.clearRect(0, 0, width, canvasHeight);
884
- const isAnimating = isActive || isPulsing;
885
- const waveY = canvasHeight * 0.65;
886
- const baseAmplitude = isActive ? 5 : isPulsing ? 7 : 1.5;
887
- if (isAnimating) {
888
- if (randomSpikeRef.current === null) {
889
- randomSpikeRef.current = Math.random();
890
- }
891
- if (Math.floor(time / 500) !== Math.floor((time - 16) / 500)) {
892
- randomSpikeRef.current = Math.random();
893
- }
894
- }
895
- const gradient = ctx.createLinearGradient(0, 0, width, 0);
896
- gradient.addColorStop(0, colors.start);
897
- gradient.addColorStop(0.5, colors.mid);
898
- gradient.addColorStop(1, colors.end);
899
- ctx.strokeStyle = gradient;
900
- ctx.lineWidth = isAnimating ? 2.5 : 1.5;
901
- ctx.lineCap = "round";
902
- ctx.lineJoin = "round";
903
- if (isAnimating) {
904
- ctx.shadowColor = colors.mid;
905
- ctx.shadowBlur = isPulsing ? 12 : 8;
906
- } else {
907
- ctx.shadowBlur = 0;
908
- }
909
- ctx.beginPath();
910
- const segments = 300;
911
- const segmentWidth = width / segments;
912
- const speed = isActive ? 0.02 : isPulsing ? 0.025 : 3e-3;
913
- for (let i = 0; i <= segments; i++) {
914
- const x = i * segmentWidth;
915
- const normalizedX = x / width;
916
- let y = waveY;
917
- if (isAnimating) {
918
- const wave1 = Math.sin(normalizedX * Math.PI * 6 + time * speed) * baseAmplitude;
919
- const wave2 = Math.sin(normalizedX * Math.PI * 12 + time * speed * 1.3) * (baseAmplitude * 0.4);
920
- const wave3 = Math.sin(normalizedX * Math.PI * 18 + time * speed * 0.8) * (baseAmplitude * 0.2);
921
- const spikePosition = (_a = randomSpikeRef.current) != null ? _a : 0.5;
922
- const distToSpike = Math.abs(normalizedX - spikePosition);
923
- const spikeAmplitude = distToSpike < 0.15 ? (1 - distToSpike / 0.15) * baseAmplitude * 1 : 0;
924
- const spikeWave = Math.sin(normalizedX * Math.PI * 20 + time * speed * 2) * spikeAmplitude;
925
- let aggressiveWave = 0;
926
- if (isPulsing) {
927
- aggressiveWave = Math.sin(normalizedX * Math.PI * 30 + time * 0.03) * baseAmplitude * 0.4;
928
- aggressiveWave += Math.sin(normalizedX * Math.PI * 8 + time * 0.015) * baseAmplitude * 0.5;
929
- }
930
- const combinedWave = wave1 + wave2 + wave3 + spikeWave + aggressiveWave;
931
- const envelope = Math.sin(normalizedX * Math.PI);
932
- y = waveY + combinedWave * envelope;
933
- } else {
934
- y += Math.sin(normalizedX * Math.PI * 2 + time * speed) * baseAmplitude;
935
- }
936
- if (i === 0) {
937
- ctx.moveTo(x, y);
938
- } else {
939
- ctx.lineTo(x, y);
940
- }
941
- }
942
- ctx.stroke();
943
- if (isActive) {
944
- const barCount = 80;
945
- const barWidth = 2;
946
- const barGap = width / barCount;
947
- const maxBarHeight = 16;
948
- ctx.shadowBlur = 3;
949
- for (let i = 0; i < barCount; i++) {
950
- const x = i * barGap + barGap / 2;
951
- const normalizedX = x / width;
952
- const baseBarHeight = Math.sin(normalizedX * Math.PI * 8 + time * 0.025) * 0.5 + Math.sin(normalizedX * Math.PI * 14 + time * 0.018) * 0.3 + Math.sin(normalizedX * Math.PI * 4 + time * 0.03) * 0.2;
953
- const envelope = Math.sin(normalizedX * Math.PI);
954
- const barHeight = Math.abs(baseBarHeight) * maxBarHeight * envelope;
955
- const barGradient = ctx.createLinearGradient(
956
- x,
957
- waveY - barHeight / 2,
958
- x,
959
- waveY + barHeight / 2
960
- );
961
- barGradient.addColorStop(0, colors.start + "90");
962
- barGradient.addColorStop(0.5, colors.mid + "70");
963
- barGradient.addColorStop(1, colors.end + "50");
964
- ctx.fillStyle = barGradient;
965
- ctx.fillRect(x - barWidth / 2, waveY - barHeight / 2, barWidth, barHeight);
966
- }
967
- }
968
- if (isPulsing) {
969
- const particleCount = 15;
970
- for (let i = 0; i < particleCount; i++) {
971
- const px = (Math.sin(time * 1e-3 + i * 1.5) * 0.5 + 0.5) * width;
972
- const py = waveY + Math.sin(time * 2e-3 + i) * 8;
973
- const radius = 1.5 + Math.sin(time * 3e-3 + i * 2) * 0.5;
974
- ctx.beginPath();
975
- ctx.arc(px, py, radius, 0, Math.PI * 2);
976
- ctx.fillStyle = i % 2 === 0 ? colors.start + "80" : colors.end + "80";
977
- ctx.fill();
978
- }
979
- }
980
- },
981
- [isActive, isPulsing, colors.start, colors.mid, colors.end]
982
- );
983
- (0, import_react9.useEffect)(() => {
984
- const canvas = canvasRef.current;
985
- if (!canvas) return;
986
- const ctx = canvas.getContext("2d");
987
- if (!ctx) return;
988
- const updateSize = () => {
989
- const dpr = window.devicePixelRatio || 1;
990
- const rect = canvas.getBoundingClientRect();
991
- canvas.width = rect.width * dpr;
992
- canvas.height = rect.height * dpr;
993
- ctx.scale(dpr, dpr);
994
- };
995
- updateSize();
996
- window.addEventListener("resize", updateSize);
997
- const startTime = performance.now();
998
- const animate = (currentTime) => {
999
- const elapsed = currentTime - startTime;
1000
- const rect = canvas.getBoundingClientRect();
1001
- drawWave(ctx, rect.width, rect.height, elapsed);
1002
- animationRef.current = requestAnimationFrame(animate);
1003
- };
1004
- animationRef.current = requestAnimationFrame(animate);
1005
- return () => {
1006
- window.removeEventListener("resize", updateSize);
1007
- if (animationRef.current) {
1008
- cancelAnimationFrame(animationRef.current);
1009
- }
1010
- };
1011
- }, [drawWave]);
1012
- (0, import_react9.useEffect)(() => {
1013
- if (isActive) {
1014
- queueMicrotask(() => setIsPulsing(false));
1015
- lastPulseRef.current = Date.now();
1016
- return;
1017
- }
1018
- const checkForPulse = () => {
1019
- const now = Date.now();
1020
- if (lastPulseRef.current === null) {
1021
- lastPulseRef.current = now;
1022
- }
1023
- const timeSinceLastPulse = now - lastPulseRef.current;
1024
- const pulseInterval = 12e4 + Math.random() * 6e4;
1025
- if (timeSinceLastPulse >= pulseInterval && !isPulsing) {
1026
- setIsPulsing(true);
1027
- lastPulseRef.current = now;
1028
- setTimeout(() => setIsPulsing(false), 4e3);
1029
- }
1030
- };
1031
- const intervalId = setInterval(checkForPulse, 5e3);
1032
- return () => clearInterval(intervalId);
1033
- }, [isActive, isPulsing]);
1034
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1035
- import_core11.Box,
1036
- {
1037
- style: {
1038
- position: "relative",
1039
- width: "100%",
1040
- height,
1041
- overflow: "hidden",
1042
- pointerEvents: "none",
1043
- opacity: isDark ? 1 : 0.8
1044
- },
1045
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1046
- "canvas",
1047
- {
1048
- ref: canvasRef,
1049
- style: {
1050
- width: "100%",
1051
- height: "100%",
1052
- display: "block"
1053
- }
1054
- }
1055
- )
1056
- }
1057
- );
1058
- }
1059
-
1060
- // src/GradientSwatch/GradientSwatch.tsx
1061
- var import_core12 = require("@mantine/core");
1062
-
1063
- // src/GradientSwatch/GradientSwatch.module.css
1064
- var GradientSwatch_default = {};
1065
-
1066
- // src/GradientSwatch/GradientSwatch.tsx
1067
- var import_jsx_runtime13 = require("react/jsx-runtime");
1068
- function GradientSwatch({ name, colors, description }) {
1069
- const css = `linear-gradient(135deg, ${colors[0]} 0%, ${colors[1]} 100%)`;
1070
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Copyable, { value: css, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_core12.Paper, { className: GradientSwatch_default.root, shadow: "lg", radius: "md", children: [
1071
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: GradientSwatch_default.preview, style: { background: css } }),
1072
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: GradientSwatch_default.info, children: [
1073
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core12.Text, { fw: 600, size: "sm", children: name }),
1074
- description && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core12.Text, { size: "xs", c: "dimmed", children: description }),
1075
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_core12.Text, { size: "xs", c: "dimmed", ff: "monospace", children: [
1076
- colors[0],
1077
- " \u2192 ",
1078
- colors[1]
1079
- ] })
1080
- ] })
1081
- ] }) });
1082
- }
1083
-
1084
- // src/Hero/Hero.tsx
1085
- var import_core13 = require("@mantine/core");
1086
- var import_frequency_mark_white = __toESM(require("@frequencyads/brand/assets/frequency-mark-white.svg"));
1087
- var import_colors = require("@frequencyads/brand/colors");
1088
-
1089
- // src/VideoBackground/VideoBackground.module.css
1090
- var VideoBackground_default = {};
1091
-
1092
- // src/VideoBackground/VideoBackground.tsx
1093
- var import_jsx_runtime14 = require("react/jsx-runtime");
1094
- function VideoBackground({ src, opacity = 0.3 }) {
1095
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1096
- "video",
1097
- {
1098
- autoPlay: true,
1099
- muted: true,
1100
- loop: true,
1101
- playsInline: true,
1102
- className: VideoBackground_default.root,
1103
- style: { opacity },
1104
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("source", { src, type: "video/mp4" })
1105
- }
1106
- );
1107
- }
1108
-
1109
- // src/Hero/Hero.module.css
1110
- var Hero_default = {};
1111
-
1112
- // src/Hero/Hero.tsx
1113
- var import_jsx_runtime15 = require("react/jsx-runtime");
1114
- function Hero({
1115
- variant = "logo",
1116
- heading,
1117
- tagline,
1118
- logoSrc = import_frequency_mark_white.default,
1119
- gradient: gradientName = "frequencyAlive",
1120
- shimmer = true,
1121
- primaryAction,
1122
- secondaryAction,
1123
- backgroundVideoSrc,
1124
- showWaveform
1125
- }) {
1126
- const resolvedHeading = heading != null ? heading : variant === "text" ? "Frequency" : void 0;
1127
- const hasActions = primaryAction || secondaryAction;
1128
- const waveformVisible = showWaveform != null ? showWaveform : true;
1129
- const grad = import_colors.gradients[gradientName];
1130
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_core13.Box, { className: Hero_default.root, children: [
1131
- backgroundVideoSrc && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(VideoBackground, { src: backgroundVideoSrc }),
1132
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_core13.Stack, { className: Hero_default.content, align: "center", gap: "lg", children: [
1133
- variant === "logo" && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: Hero_default.logoWrapper, children: [
1134
- waveformVisible && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(AnimatedWaveform, {}),
1135
- waveformVisible && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: Hero_default.vignette }),
1136
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1137
- import_core13.Image,
1138
- {
1139
- src: logoSrc,
1140
- alt: resolvedHeading != null ? resolvedHeading : "Frequency",
1141
- className: Hero_default.logo,
1142
- fit: "contain"
1143
- }
1144
- ),
1145
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: Hero_default.glow })
1146
- ] }),
1147
- variant === "text" && resolvedHeading && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: Hero_default.textWrapper, children: [
1148
- waveformVisible && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(AnimatedWaveform, {}),
1149
- waveformVisible && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: Hero_default.vignette }),
1150
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1151
- import_core13.Title,
1152
- {
1153
- order: 1,
1154
- className: `${Hero_default.heading} ${shimmer ? Hero_default.shimmer : ""}`,
1155
- style: {
1156
- backgroundImage: `linear-gradient(135deg, ${grad.from}, ${grad.to}, ${grad.from})`,
1157
- backgroundSize: shimmer ? "200% 100%" : void 0
1158
- },
1159
- children: resolvedHeading
1160
- }
1161
- )
1162
- ] }),
1163
- tagline && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core13.Text, { className: Hero_default.tagline, children: tagline }),
1164
- hasActions && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_core13.Group, { gap: "md", justify: "center", wrap: "wrap", children: [
1165
- primaryAction && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1166
- import_core13.Button,
1167
- {
1168
- component: "a",
1169
- href: primaryAction.href,
1170
- size: "lg",
1171
- radius: 4,
1172
- className: Hero_default.primaryButton,
1173
- children: primaryAction.label
1174
- }
1175
- ),
1176
- secondaryAction && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1177
- import_core13.Button,
1178
- {
1179
- component: "a",
1180
- href: secondaryAction.href,
1181
- size: "lg",
1182
- radius: 4,
1183
- variant: "outline",
1184
- className: Hero_default.secondaryButton,
1185
- children: secondaryAction.label
1186
- }
1187
- )
1188
- ] })
1189
- ] })
1190
- ] });
1191
- }
1192
-
1193
- // src/HintBadge/HintBadge.tsx
1194
- var import_core14 = require("@mantine/core");
1195
- var import_jsx_runtime16 = require("react/jsx-runtime");
1196
- function HintBadge({ variant, children }) {
1197
- const isDo = variant === "do";
1198
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
1199
- import_core14.Badge,
1200
- {
1201
- variant: "light",
1202
- color: isDo ? "green" : "red",
1203
- size: "lg",
1204
- radius: "sm",
1205
- styles: {
1206
- root: { textTransform: "none", fontWeight: 400 },
1207
- label: { whiteSpace: "normal", lineHeight: 1.4 }
1208
- },
1209
- children: [
1210
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("strong", { children: [
1211
- isDo ? "Do" : "Don't",
1212
- ":"
1213
- ] }),
1214
- " ",
1215
- children
1216
- ]
1217
- }
1218
- );
1219
- }
1220
-
1221
- // src/MiniAudioPlayer/MiniAudioPlayer.tsx
1222
- var import_react10 = require("react");
1223
- var import_core15 = require("@mantine/core");
1224
- var import_icons_react3 = require("@tabler/icons-react");
1225
-
1226
- // src/MiniAudioPlayer/MiniAudioPlayer.module.css
1227
- var MiniAudioPlayer_default = {};
1228
-
1229
- // src/MiniAudioPlayer/MiniAudioPlayer.tsx
1230
- var import_jsx_runtime17 = require("react/jsx-runtime");
1231
- var SIZE_CONFIG = {
1232
- mini: { height: 24, buttonSize: 20, iconSize: 14, waveHeight: 16, barWidth: 1, barGap: 0 },
1233
- small: { height: 32, buttonSize: 28, iconSize: 16, waveHeight: 20, barWidth: 1, barGap: 0 },
1234
- compact: { height: 40, buttonSize: 32, iconSize: 18, waveHeight: 24, barWidth: 2, barGap: 1 }
1235
- };
1236
- var MiniAudioPlayer = (0, import_react10.forwardRef)(
1237
- ({
1238
- audioUrl,
1239
- size = "mini",
1240
- waveColor = "#CCCCCC",
1241
- progressColor = "#169bde",
1242
- onPlay,
1243
- onPause,
1244
- className,
1245
- style
1246
- }, ref) => {
1247
- const audioRef = (0, import_react10.useRef)(null);
1248
- const [isPlaying, setIsPlaying] = (0, import_react10.useState)(false);
1249
- const [currentTime, setCurrentTime] = (0, import_react10.useState)(0);
1250
- const config = SIZE_CONFIG[size];
1251
- (0, import_react10.useEffect)(() => {
1252
- const audio = audioRef.current;
1253
- if (!audio) return;
1254
- const handleTimeUpdate = () => setCurrentTime(audio.currentTime);
1255
- const handleEnded = () => {
1256
- setIsPlaying(false);
1257
- setCurrentTime(0);
1258
- };
1259
- const handlePause = () => setIsPlaying(false);
1260
- const handlePlay = () => setIsPlaying(true);
1261
- audio.addEventListener("timeupdate", handleTimeUpdate);
1262
- audio.addEventListener("ended", handleEnded);
1263
- audio.addEventListener("pause", handlePause);
1264
- audio.addEventListener("play", handlePlay);
1265
- return () => {
1266
- audio.removeEventListener("timeupdate", handleTimeUpdate);
1267
- audio.removeEventListener("ended", handleEnded);
1268
- audio.removeEventListener("pause", handlePause);
1269
- audio.removeEventListener("play", handlePlay);
1270
- };
1271
- }, [audioUrl]);
1272
- const handlePlayPause = (0, import_react10.useCallback)(() => {
1273
- const audio = audioRef.current;
1274
- if (!audio) return;
1275
- if (isPlaying) {
1276
- audio.pause();
1277
- onPause == null ? void 0 : onPause();
1278
- } else {
1279
- audio.play().catch(() => {
1280
- });
1281
- onPlay == null ? void 0 : onPlay();
1282
- }
1283
- }, [isPlaying, onPlay, onPause]);
1284
- const handleSeek = (0, import_react10.useCallback)((time) => {
1285
- const audio = audioRef.current;
1286
- if (audio && !isNaN(time) && isFinite(time)) {
1287
- audio.currentTime = time;
1288
- setCurrentTime(time);
1289
- }
1290
- }, []);
1291
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1292
- import_core15.Group,
1293
- {
1294
- ref,
1295
- gap: size === "mini" ? 6 : size === "small" ? 8 : 10,
1296
- wrap: "nowrap",
1297
- className: `${MiniAudioPlayer_default.root} ${className != null ? className : ""}`,
1298
- style: __spreadValues({ height: config.height }, style),
1299
- children: [
1300
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("audio", { ref: audioRef, src: audioUrl, preload: "metadata" }),
1301
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1302
- import_core15.ActionIcon,
1303
- {
1304
- variant: "filled",
1305
- color: "blue",
1306
- radius: "xl",
1307
- size: config.buttonSize,
1308
- onClick: handlePlayPause,
1309
- "aria-label": isPlaying ? "Pause" : "Play",
1310
- className: MiniAudioPlayer_default.playButton,
1311
- children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_icons_react3.IconPlayerPauseFilled, { size: config.iconSize }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_icons_react3.IconPlayerPlayFilled, { size: config.iconSize })
1312
- }
1313
- ),
1314
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core15.Box, { style: { flex: 1, minWidth: 80 }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1315
- AudioWaveform,
1316
- {
1317
- audioRef,
1318
- currentTime,
1319
- onSeek: handleSeek,
1320
- waveColor,
1321
- progressColor,
1322
- height: config.waveHeight,
1323
- barWidth: config.barWidth,
1324
- barGap: config.barGap
1325
- }
1326
- ) })
1327
- ]
1328
- }
1329
- );
1330
- }
1331
- );
1332
- MiniAudioPlayer.displayName = "MiniAudioPlayer";
1333
-
1334
- // src/PrincipleCard/PrincipleCard.tsx
1335
- var import_core16 = require("@mantine/core");
1336
-
1337
- // src/PrincipleCard/PrincipleCard.module.css
1338
- var PrincipleCard_default = {};
1339
-
1340
- // src/PrincipleCard/PrincipleCard.tsx
1341
- var import_jsx_runtime18 = require("react/jsx-runtime");
1342
- function PrincipleCard({
1343
- accentColor,
1344
- title,
1345
- description,
1346
- doHint,
1347
- dontHint
1348
- }) {
1349
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1350
- import_core16.Paper,
1351
- {
1352
- className: PrincipleCard_default.root,
1353
- p: "lg",
1354
- radius: "md",
1355
- style: { borderLeftColor: accentColor },
1356
- children: [
1357
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_core16.Title, { order: 3, size: "h4", mb: "xs", children: title }),
1358
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_core16.Text, { c: "dimmed", children: description }),
1359
- (doHint || dontHint) && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_core16.Group, { gap: "sm", mt: "md", wrap: "wrap", children: [
1360
- doHint && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(HintBadge, { variant: "do", children: doHint }),
1361
- dontHint && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(HintBadge, { variant: "dont", children: dontHint })
1362
- ] })
1363
- ]
1364
- }
1365
- );
1366
- }
1367
-
1368
- // src/SpeedDial/SpeedDial.tsx
1369
- var import_react11 = require("react");
1370
- var import_core17 = require("@mantine/core");
1371
- var import_icons_react4 = require("@tabler/icons-react");
1372
-
1373
- // src/SpeedDial/SpeedDial.module.css
1374
- var SpeedDial_default = {};
1375
-
1376
- // src/SpeedDial/SpeedDial.tsx
1377
- var import_jsx_runtime19 = require("react/jsx-runtime");
1378
- function SpeedDial({
1379
- actions,
1380
- icon,
1381
- openIcon,
1382
- direction = "up",
1383
- color = "blue",
1384
- size = 56,
1385
- defaultOpen = false,
1386
- open: controlledOpen,
1387
- onOpenChange,
1388
- style,
1389
- className
1390
- }) {
1391
- var _a;
1392
- const [uncontrolledOpen, setUncontrolledOpen] = (0, import_react11.useState)(defaultOpen);
1393
- const isOpen = controlledOpen != null ? controlledOpen : uncontrolledOpen;
1394
- const toggle = (0, import_react11.useCallback)(() => {
1395
- const next = !isOpen;
1396
- setUncontrolledOpen(next);
1397
- onOpenChange == null ? void 0 : onOpenChange(next);
1398
- }, [isOpen, onOpenChange]);
1399
- const close = (0, import_react11.useCallback)(() => {
1400
- setUncontrolledOpen(false);
1401
- onOpenChange == null ? void 0 : onOpenChange(false);
1402
- }, [onOpenChange]);
1403
- const isVertical = direction === "up" || direction === "down";
1404
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
1405
- import_core17.Box,
1406
- {
1407
- className: `${SpeedDial_default.root} ${className != null ? className : ""}`,
1408
- style,
1409
- "data-direction": direction,
1410
- children: [
1411
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: SpeedDial_default.actions, "data-direction": direction, children: actions.map((action, i) => {
1412
- const index = direction === "up" || direction === "left" ? actions.length - 1 - i : i;
1413
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1414
- import_core17.Transition,
1415
- {
1416
- mounted: isOpen,
1417
- transition: isVertical ? "slide-up" : "slide-right",
1418
- duration: 200,
1419
- timingFunction: "ease",
1420
- enterDelay: index * 40,
1421
- children: (transitionStyles) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_core17.Tooltip, { label: action.label, position: isVertical ? "left" : "top", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1422
- import_core17.ActionIcon,
1423
- {
1424
- variant: "filled",
1425
- color: "gray",
1426
- radius: "xl",
1427
- size: size * 0.7,
1428
- style: transitionStyles,
1429
- className: SpeedDial_default.actionButton,
1430
- onClick: () => {
1431
- action.onClick();
1432
- close();
1433
- },
1434
- "aria-label": action.label,
1435
- children: action.icon
1436
- }
1437
- ) })
1438
- },
1439
- action.label
1440
- );
1441
- }) }),
1442
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1443
- import_core17.ActionIcon,
1444
- {
1445
- variant: "filled",
1446
- color,
1447
- radius: "xl",
1448
- size,
1449
- onClick: toggle,
1450
- className: SpeedDial_default.fab,
1451
- "data-open": isOpen || void 0,
1452
- "aria-label": isOpen ? "Close actions" : "Open actions",
1453
- children: isOpen ? (_a = openIcon != null ? openIcon : icon) != null ? _a : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_icons_react4.IconPlus, { size: size * 0.45 }) : icon != null ? icon : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_icons_react4.IconPlus, { size: size * 0.45 })
1454
- }
1455
- )
1456
- ]
1457
- }
1458
- );
1459
- }
1460
-
1461
- // src/SplitSection/SplitSection.tsx
1462
- var import_core18 = require("@mantine/core");
1463
-
1464
- // src/SplitSection/SplitSection.module.css
1465
- var SplitSection_default = {};
1466
-
1467
- // src/SplitSection/SplitSection.tsx
1468
- var import_jsx_runtime20 = require("react/jsx-runtime");
1469
- function SplitSection({
1470
- badge,
1471
- badgeColor = "violet",
1472
- subtitle,
1473
- title,
1474
- titleColor = "blue",
1475
- preTitle,
1476
- description,
1477
- actions,
1478
- heading,
1479
- children,
1480
- stickyHeading = false,
1481
- py,
1482
- reversed = false,
1483
- id,
1484
- className
1485
- }) {
1486
- const headingContent = heading != null ? heading : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_core18.Stack, { gap: "sm", children: [
1487
- badge && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_core18.Box, { children: [
1488
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1489
- import_core18.Badge,
1490
- {
1491
- color: badgeColor,
1492
- variant: "filled",
1493
- size: "sm",
1494
- radius: 4,
1495
- tt: "uppercase",
1496
- fw: 700,
1497
- children: badge
1498
- }
1499
- ),
1500
- subtitle && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_core18.Text, { size: "sm", c: "dimmed", mt: "xs", tt: "uppercase", style: { letterSpacing: "0.05em" }, children: subtitle })
1501
- ] }),
1502
- !badge && subtitle && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_core18.Text, { size: "sm", c: "dimmed", tt: "uppercase", style: { letterSpacing: "0.05em" }, children: subtitle }),
1503
- (preTitle || title) && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_core18.Title, { order: 2, className: SplitSection_default.title, children: [
1504
- preTitle && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: SplitSection_default.preTitle, children: preTitle }),
1505
- preTitle && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("br", {}),
1506
- title && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1507
- import_core18.Text,
1508
- {
1509
- component: "span",
1510
- inherit: true,
1511
- className: SplitSection_default.titleHighlight,
1512
- c: titleColor,
1513
- children: title
1514
- }
1515
- )
1516
- ] }),
1517
- description && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_core18.Text, { size: "lg", c: "dimmed", lh: 1.7, className: SplitSection_default.description, children: description }),
1518
- actions && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_core18.Box, { mt: "md", children: actions })
1519
- ] });
1520
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1521
- import_core18.Box,
1522
- {
1523
- component: "section",
1524
- py: py != null ? py : "calc(var(--mantine-spacing-xl) * 3)",
1525
- pos: "relative",
1526
- id,
1527
- className,
1528
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_core18.Box, { className: SplitSection_default.container, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_core18.Box, { className: `${SplitSection_default.layout} ${reversed ? SplitSection_default.reversed : ""}`, children: [
1529
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1530
- import_core18.Box,
1531
- {
1532
- className: `${SplitSection_default.headingSide} ${stickyHeading ? SplitSection_default.sticky : ""}`,
1533
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_core18.Box, { className: stickyHeading ? SplitSection_default.stickyInner : void 0, children: headingContent })
1534
- }
1535
- ),
1536
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_core18.Box, { className: SplitSection_default.contentSide, children })
1537
- ] }) })
1538
- }
1539
- );
1540
- }
1541
- // Annotate the CommonJS export names for ESM import in node:
1542
- 0 && (module.exports = {
1543
- AnimatedCounter,
1544
- AnimatedWaveform,
1545
- AudioPlayer,
1546
- AudioWaveform,
1547
- CodeBlock,
1548
- ColorPalette,
1549
- ColorSwatch,
1550
- Copyable,
1551
- DosDonts,
1552
- ExpandableCard,
1553
- FadeInSection,
1554
- FrequencyWave,
1555
- GradientSwatch,
1556
- Hero,
1557
- HintBadge,
1558
- MiniAudioPlayer,
1559
- PrincipleCard,
1560
- SpeedDial,
1561
- SplitSection,
1562
- VideoBackground
1563
- });
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("react"),t=require("@mantine/core"),k=require("framer-motion"),z=require("@tabler/icons-react"),fe=require("@frequencyads/brand/assets/frequency-mark-white.svg"),_e=require("@frequencyads/brand/colors");function ve({value:s,suffix:n="",prefix:i="",duration:a=2e3,threshold:l=.5,abbreviate:p=!0,decimals:g,...j}){const[_,d]=c.useState(0),[h,y]=c.useState(!1),r=c.useRef(null);c.useEffect(()=>{const m=r.current;if(!m)return;const u=new IntersectionObserver(([b])=>{b.isIntersecting&&!h&&y(!0)},{threshold:l});return u.observe(m),()=>u.disconnect()},[h,l]),c.useEffect(()=>{if(!h)return;let m,u;const b=o=>{m||(m=o);const f=Math.min((o-m)/a,1),w=1-Math.pow(1-f,3);d(w*s),f<1&&(u=requestAnimationFrame(b))};return u=requestAnimationFrame(b),()=>cancelAnimationFrame(u)},[h,s,a]);const v=()=>{if(p&&s>=1e3){const m=_/1e3;return m%1===0?`${Math.round(m)}K`:`${m.toFixed(1)}K`}return g!==void 0?_.toFixed(g):s!==Math.floor(s)?_.toFixed(1):Math.round(_).toString()};return e.jsxs(t.Text,{component:"span",ref:r,style:{fontVariantNumeric:"tabular-nums"},...j,children:[i,v(),n]})}const je="_root_1bq7s_1",ge="_svg_1bq7s_12",oe={root:je,svg:ge},ye=140,ne=3,ae=10,he=150,F=he/2;function te({barCount:s=ye,duration:n=3,repeatDelay:i=3}){const[a,l]=c.useState(!1);if(c.useEffect(()=>{l(!0)},[]),!a)return null;const p=s*ae;return e.jsx("div",{className:oe.root,children:e.jsxs("svg",{className:oe.svg,viewBox:`0 0 ${p} ${he}`,preserveAspectRatio:"none",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"waveformBarGradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[e.jsx("stop",{offset:"0%",stopColor:"white",stopOpacity:"0"}),e.jsx("stop",{offset:"15%",stopColor:"white",stopOpacity:"0.15"}),e.jsx("stop",{offset:"50%",stopColor:"white",stopOpacity:"0.25"}),e.jsx("stop",{offset:"85%",stopColor:"white",stopOpacity:"0.15"}),e.jsx("stop",{offset:"100%",stopColor:"white",stopOpacity:"0"})]})}),[...Array(s)].map((g,j)=>{const _=j*ae,d=18+Math.sin(j*.4)*6+Math.cos(j*.7)*4,h=Math.min(j,s-1-j)*.04;return e.jsxs("g",{children:[e.jsx(k.motion.rect,{x:_,width:ne,rx:"1.5",fill:"url(#waveformBarGradient)",initial:{height:d/2,y:F-d/4},animate:{height:[d/2,d*2,d/2,d*1.2,d/2],y:[F-d/4,F-d,F-d/4,F-d*.6,F-d/4]},transition:{duration:n,repeat:1/0,ease:"easeInOut",delay:h,repeatDelay:i}}),e.jsx(k.motion.rect,{x:_,y:F,width:ne,rx:"1.5",fill:"url(#waveformBarGradient)",initial:{height:d/2},animate:{height:[d/2,d*2,d/2,d*1.2,d/2]},transition:{duration:n,repeat:1/0,ease:"easeInOut",delay:h,repeatDelay:i}})]},j)})]})})}const be="_root_1pkxe_1",we="_progressOverlay_1pkxe_9",Ie="_bars_1pkxe_19",Ne="_bar_1pkxe_19",Se="_loading_1pkxe_34",H={root:be,progressOverlay:we,bars:Ie,bar:Ne,loading:Se};function Ce(s=100){const n=[];for(let i=0;i<s;i++){const a=i/(s-1),l=20+Math.sin(i*.1)*15,p=(Math.random()-.5)*20,g=Math.sin(a*Math.PI)*30,j=a>.2&&a<.8?Math.random()*10:0,_=a<.05||a>.95?Math.min(a/.05,(1-a)/.05):1;n.push(Math.max(5,Math.min(90,(l+p+g+j)*_)))}return n}const K=c.forwardRef(({audioRef:s,currentTime:n=0,onSeek:i,loading:a=!1,waveColor:l="#CCCCCC",progressColor:p="#169bde",height:g=60,barWidth:j=2,barGap:_=1},d)=>{const h=c.useRef(null),[y]=c.useState(()=>Ce()),[r,v]=c.useState(0),[m,u]=c.useState(0);c.useImperativeHandle(d,()=>({seekTo:o=>{r>0&&u(Math.max(0,Math.min(100,o/r*100)))},getCurrentTime:()=>m/100*r,getDuration:()=>r})),c.useEffect(()=>{const o=s.current;if(!o)return;const f=()=>{o.duration&&!isNaN(o.duration)&&v(o.duration)},w=()=>{o.duration>0&&u(o.currentTime/o.duration*100)};return o.duration&&!isNaN(o.duration)&&v(o.duration),o.addEventListener("loadedmetadata",f),o.addEventListener("timeupdate",w),()=>{o.removeEventListener("loadedmetadata",f),o.removeEventListener("timeupdate",w)}},[s]),c.useEffect(()=>{r>0&&typeof n=="number"&&u(n/r*100)},[n,r]);const b=c.useCallback(o=>{if(!h.current||!i||r===0)return;const f=h.current.getBoundingClientRect(),w=(o.clientX-f.left)/f.width*r;i(w)},[i,r]);return e.jsxs(t.Box,{ref:h,className:H.root,style:{height:g},onClick:b,children:[e.jsx("div",{className:H.progressOverlay,style:{width:`${m}%`,backgroundColor:`${p}15`}}),e.jsx("div",{className:H.bars,style:{gap:_},children:y.map((o,f)=>{const w=f/y.length*100<=m;return e.jsx("div",{className:H.bar,style:{width:j,height:`${o}%`,backgroundColor:w?p:l}},f)})}),a&&e.jsx("div",{className:H.loading,children:"Loading waveform..."})]})});K.displayName="AudioWaveform";const Te="_root_n9zxy_1",ke="_playButton_n9zxy_8",Me="_time_n9zxy_22",ze="_volumeGroup_n9zxy_28",O={root:Te,playButton:ke,time:Me,volumeGroup:ze};function Q(s){const n=Math.floor(s/60),i=Math.floor(s%60);return`${n.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`}function Be({src:s,filename:n="audio",playButtonColor:i,playButtonSize:a=32,waveColor:l="#D0D0D0",progressColor:p="#a8a8a8",waveHeight:g=64,barWidth:j=3,barGap:_=2,showVolume:d=!0,showDownload:h=!0}){const y=c.useRef(null),[r,v]=c.useState(!1),[m,u]=c.useState(0),[b,o]=c.useState("00:00"),[f,w]=c.useState("00:00"),[M,E]=c.useState(50),[W,P]=c.useState(50),[C,N]=c.useState(!1);c.useEffect(()=>{const x=y.current;if(!x)return;x.volume=M/100;const I=()=>{u(x.currentTime),o(Q(x.currentTime))},T=()=>w(Q(x.duration)),A=()=>{setTimeout(()=>{u(0),o("00:00"),v(!1)},500)},V=()=>v(!0),U=()=>v(!1);return x.addEventListener("timeupdate",I),x.addEventListener("loadedmetadata",T),x.addEventListener("ended",A),x.addEventListener("play",V),x.addEventListener("pause",U),()=>{x.removeEventListener("timeupdate",I),x.removeEventListener("loadedmetadata",T),x.removeEventListener("ended",A),x.removeEventListener("play",V),x.removeEventListener("pause",U)}},[s]);const $=c.useCallback(()=>{const x=y.current;x&&(r?x.pause():x.play().catch(()=>{}))},[r]),L=c.useCallback(x=>{const I=y.current;I&&!isNaN(x)&&isFinite(x)&&(I.currentTime=x,u(x),o(Q(x)))},[]),G=c.useCallback(x=>{const I=y.current;I&&(I.volume=x/100,E(x),x>0?(P(x),N(!1)):N(!0))},[]),R=c.useCallback(()=>{const x=y.current;if(x)if(C){const I=W||50;x.volume=I/100,E(I),N(!1)}else P(M),x.volume=0,E(0),N(!0)},[C,M,W]),q=c.useCallback(()=>{fetch(s).then(x=>x.blob()).then(x=>{const I=URL.createObjectURL(x),T=document.createElement("a");T.href=I,T.download=n,document.body.appendChild(T),T.click(),document.body.removeChild(T),URL.revokeObjectURL(I)}).catch(()=>window.open(s,"_blank"))},[s,n]);return e.jsxs(t.Group,{gap:"sm",wrap:"nowrap",className:O.root,children:[e.jsx("audio",{ref:y,src:s,preload:"metadata"}),e.jsx(t.ActionIcon,{variant:"filled",radius:"xl",size:a,color:i,onClick:$,"aria-label":r?"Pause":"Play",className:O.playButton,children:r?e.jsx(z.IconPlayerPauseFilled,{size:a*.5}):e.jsx(z.IconPlayerPlayFilled,{size:a*.5})}),e.jsx(t.Text,{size:"xs",ff:"monospace",c:"dimmed",className:O.time,children:b}),e.jsx(t.Box,{style:{flex:1,minWidth:0},children:e.jsx(K,{audioRef:y,currentTime:m,onSeek:L,waveColor:l,progressColor:p,height:g,barWidth:j,barGap:_})}),e.jsx(t.Text,{size:"xs",ff:"monospace",c:"dimmed",className:O.time,children:f}),d&&e.jsxs(t.Group,{gap:4,wrap:"nowrap",className:O.volumeGroup,children:[e.jsx(t.ActionIcon,{variant:"subtle",size:"sm",onClick:R,"aria-label":C?"Unmute":"Mute",children:C?e.jsx(z.IconVolumeOff,{size:16}):e.jsx(z.IconVolume,{size:16})}),e.jsx(t.Slider,{value:M,onChange:G,size:"xs",w:80,"aria-label":"Volume"})]}),h&&e.jsx(t.ActionIcon,{variant:"subtle",size:"sm",onClick:q,"aria-label":"Download",children:e.jsx(z.IconDownload,{size:16})})]})}const $e="_root_ujac8_1",Pe="_textarea_ujac8_5",ie={root:$e,textarea:Pe};function Le({code:s,filename:n,height:i=384}){const[a,l]=c.useState(!1),p=c.useCallback(async()=>{try{await navigator.clipboard.writeText(s),l(!0),setTimeout(()=>l(!1),2e3)}catch{}},[s]);return e.jsxs(t.Box,{className:ie.root,children:[e.jsxs(t.Group,{justify:"space-between",mb:"xs",children:[n&&e.jsx(t.Text,{size:"sm",fw:500,c:"dimmed",children:n}),e.jsx(t.Button,{size:"xs",radius:"md",color:a?"green":"blue",onClick:p,children:a?"Copied!":"Copy"})]}),e.jsx("textarea",{readOnly:!0,value:s,className:ie.textarea,style:{height:i}})]})}const Ee="_root_ix1b2_1",We="_toast_ix1b2_5",re={root:Ee,toast:We};function J({value:s,children:n}){const[i,a]=c.useState(null),l=c.useCallback(()=>{navigator.clipboard.writeText(s).then(()=>{a(`Copied ${s}`),setTimeout(()=>a(null),1800)})},[s]);return e.jsxs(e.Fragment,{children:[e.jsx("span",{onClick:l,className:re.root,title:`Click to copy ${s}`,children:n}),i&&e.jsx(t.Portal,{children:e.jsx(t.Notification,{withCloseButton:!1,className:re.toast,color:"blue",children:i})})]})}const Ge="_root_3ht5s_1",Re="_shade_3ht5s_5",Fe="_color_3ht5s_10",De="_main_3ht5s_20",X={root:Ge,shade:Re,color:Fe,main:De};function Ae({name:s,shades:n,mainIndex:i=5}){return e.jsxs("div",{className:X.root,children:[e.jsx(t.Title,{order:4,size:"lg",tt:"capitalize",mb:"xs",children:s}),e.jsx(t.SimpleGrid,{cols:10,spacing:4,children:n.map((a,l)=>e.jsx(J,{value:a,children:e.jsxs("div",{className:X.shade,children:[e.jsx("div",{className:`${X.color} ${l===i?X.main:""}`,style:{backgroundColor:a}}),e.jsx(t.Text,{size:"xs",c:"dimmed",ta:"center",mt:4,children:l}),e.jsx(t.Text,{size:"xs",c:"dimmed",ta:"center",ff:"monospace",children:a})]})},l))})]})}const qe="_root_1vxkx_1",He="_preview_1vxkx_11",Oe="_info_1vxkx_15",Z={root:qe,preview:He,info:Oe};function Ve({name:s,hex:n,label:i}){return e.jsx(J,{value:n,children:e.jsxs(t.Paper,{className:Z.root,shadow:"lg",radius:"md",withBorder:!1,children:[e.jsx("div",{className:Z.preview,style:{backgroundColor:n}}),e.jsxs("div",{className:Z.info,children:[e.jsx(t.Text,{fw:600,size:"sm",children:s}),e.jsx(t.Text,{size:"xs",c:"dimmed",ff:"monospace",children:n}),i&&e.jsx(t.Text,{size:"xs",c:"dimmed",children:i})]})]})})}const Ue="_root_dzed6_1",Xe="_dont_dzed6_7",Ye="_dontIcon_dzed6_12",Ke="_dontLabel_dzed6_13",Je="_doIcon_dzed6_22",Qe="_doLabel_dzed6_23",D={root:Ue,dont:Xe,dontIcon:Ye,dontLabel:Ke,do:"_do_dzed6_7",doIcon:Je,doLabel:Qe};function Ze({items:s}){return e.jsx("div",{className:D.root,children:s.map((n,i)=>e.jsxs(t.SimpleGrid,{cols:{base:1,sm:2},spacing:"md",children:[e.jsxs(t.Paper,{className:D.dont,p:"md",radius:"md",children:[e.jsxs(t.Group,{gap:6,mb:6,children:[e.jsx(z.IconX,{size:16,className:D.dontIcon}),e.jsx(t.Text,{size:"sm",fw:600,className:D.dontLabel,children:"Don't"})]}),e.jsx(t.Text,{size:"sm",children:n.dont})]}),e.jsxs(t.Paper,{className:D.do,p:"md",radius:"md",children:[e.jsxs(t.Group,{gap:6,mb:6,children:[e.jsx(z.IconCheck,{size:16,className:D.doIcon}),e.jsx(t.Text,{size:"sm",fw:600,className:D.doLabel,children:"Do"})]}),e.jsx(t.Text,{size:"sm",children:n.do})]})]},i))})}const et="_root_xi08i_1",tt="_inner_xi08i_6",ce={root:et,inner:tt};function st({title:s,description:n,expandedContent:i,icon:a,color:l="blue",iconSize:p="lg",collapsedHeight:g=120,threshold:j=.5,delay:_=300,expanded:d,onExpandedChange:h}){const y=c.useRef(null),[r,v]=c.useState(!1),m=d!==void 0,u=m?d:r;return c.useEffect(()=>{if(m)return;const b=y.current;if(!b)return;const o=new IntersectionObserver(([f])=>{f.isIntersecting&&setTimeout(()=>{v(!0),h==null||h(!0)},_)},{threshold:j});return o.observe(b),()=>o.disconnect()},[m,j,_,h]),e.jsx(t.Paper,{ref:y,radius:4,className:ce.root,component:k.motion.div,animate:{height:u?"auto":g},transition:{duration:.5,ease:"easeOut"},children:e.jsx("div",{className:ce.inner,children:e.jsxs(t.Group,{align:"flex-start",justify:"space-between",gap:"lg",wrap:"nowrap",children:[e.jsxs(t.Stack,{gap:"xs",style:{flex:1},children:[e.jsx(t.Text,{fw:700,size:"xl",lh:1.3,children:s}),e.jsx(t.Text,{size:"md",c:"dimmed",children:n}),e.jsx(k.motion.div,{initial:{opacity:0,height:0},animate:{opacity:u?1:0,height:u?"auto":0},transition:{duration:.4,delay:.2},style:{overflow:"hidden"},children:typeof i=="string"?e.jsx(t.Text,{size:"sm",c:"dimmed",mt:"sm",children:i}):i})]}),e.jsx(k.motion.div,{animate:{scale:u?1.1:1},transition:{duration:.3},children:e.jsx(t.ThemeIcon,{size:p,radius:4,color:l,variant:"filled",children:e.jsx(a,{size:20,stroke:1.5})})})]})})})}const ot="_root_ho0ln_1",nt="_visible_ho0ln_7",le={root:ot,visible:nt};function at({children:s,delay:n=0,threshold:i=.1,className:a,...l}){const p=c.useRef(null),[g,j]=c.useState(!1);return c.useEffect(()=>{const _=p.current;if(!_)return;const d=new IntersectionObserver(([h])=>{h.isIntersecting&&(n>0?setTimeout(()=>j(!0),n):j(!0))},{threshold:i});return d.observe(_),()=>d.disconnect()},[n,i]),e.jsx(t.Box,{ref:p,className:`${le.root} ${g?le.visible:""} ${a??""}`,...l,children:s})}function it({isActive:s=!1,height:n=60}){const i=c.useRef(null),a=c.useRef(void 0),[l,p]=c.useState(!1),g=c.useRef(null),j=c.useRef(null),{colorScheme:_}=t.useMantineColorScheme(),d=_==="dark",h={start:d?"#7950F2":"#9775FA",mid:d?"#BE4BDB":"#DA77F2",end:d?"#15AABF":"#22B8CF"},y=c.useCallback((r,v,m,u)=>{r.clearRect(0,0,v,m);const b=s||l,o=m*.65,f=s?5:l?7:1.5;b&&(j.current===null&&(j.current=Math.random()),Math.floor(u/500)!==Math.floor((u-16)/500)&&(j.current=Math.random()));const w=r.createLinearGradient(0,0,v,0);w.addColorStop(0,h.start),w.addColorStop(.5,h.mid),w.addColorStop(1,h.end),r.strokeStyle=w,r.lineWidth=b?2.5:1.5,r.lineCap="round",r.lineJoin="round",b?(r.shadowColor=h.mid,r.shadowBlur=l?12:8):r.shadowBlur=0,r.beginPath();const M=300,E=v/M,W=s?.02:l?.025:.003;for(let P=0;P<=M;P++){const C=P*E,N=C/v;let $=o;if(b){const L=Math.sin(N*Math.PI*6+u*W)*f,G=Math.sin(N*Math.PI*12+u*W*1.3)*(f*.4),R=Math.sin(N*Math.PI*18+u*W*.8)*(f*.2),q=j.current??.5,x=Math.abs(N-q),I=x<.15?(1-x/.15)*f*1:0,T=Math.sin(N*Math.PI*20+u*W*2)*I;let A=0;l&&(A=Math.sin(N*Math.PI*30+u*.03)*f*.4,A+=Math.sin(N*Math.PI*8+u*.015)*f*.5);const V=L+G+R+T+A,U=Math.sin(N*Math.PI);$=o+V*U}else $+=Math.sin(N*Math.PI*2+u*W)*f;P===0?r.moveTo(C,$):r.lineTo(C,$)}if(r.stroke(),s){const N=v/80,$=16;r.shadowBlur=3;for(let L=0;L<80;L++){const G=L*N+N/2,R=G/v,q=Math.sin(R*Math.PI*8+u*.025)*.5+Math.sin(R*Math.PI*14+u*.018)*.3+Math.sin(R*Math.PI*4+u*.03)*.2,x=Math.sin(R*Math.PI),I=Math.abs(q)*$*x,T=r.createLinearGradient(G,o-I/2,G,o+I/2);T.addColorStop(0,h.start+"90"),T.addColorStop(.5,h.mid+"70"),T.addColorStop(1,h.end+"50"),r.fillStyle=T,r.fillRect(G-2/2,o-I/2,2,I)}}if(l)for(let C=0;C<15;C++){const N=(Math.sin(u*.001+C*1.5)*.5+.5)*v,$=o+Math.sin(u*.002+C)*8,L=1.5+Math.sin(u*.003+C*2)*.5;r.beginPath(),r.arc(N,$,L,0,Math.PI*2),r.fillStyle=C%2===0?h.start+"80":h.end+"80",r.fill()}},[s,l,h.start,h.mid,h.end]);return c.useEffect(()=>{const r=i.current;if(!r)return;const v=r.getContext("2d");if(!v)return;const m=()=>{const o=window.devicePixelRatio||1,f=r.getBoundingClientRect();r.width=f.width*o,r.height=f.height*o,v.scale(o,o)};m(),window.addEventListener("resize",m);const u=performance.now(),b=o=>{const f=o-u,w=r.getBoundingClientRect();y(v,w.width,w.height,f),a.current=requestAnimationFrame(b)};return a.current=requestAnimationFrame(b),()=>{window.removeEventListener("resize",m),a.current&&cancelAnimationFrame(a.current)}},[y]),c.useEffect(()=>{if(s){queueMicrotask(()=>p(!1)),g.current=Date.now();return}const v=setInterval(()=>{const m=Date.now();g.current===null&&(g.current=m);const u=m-g.current,b=12e4+Math.random()*6e4;u>=b&&!l&&(p(!0),g.current=m,setTimeout(()=>p(!1),4e3))},5e3);return()=>clearInterval(v)},[s,l]),e.jsx(t.Box,{style:{position:"relative",width:"100%",height:n,overflow:"hidden",pointerEvents:"none",opacity:d?1:.8},children:e.jsx("canvas",{ref:i,style:{width:"100%",height:"100%",display:"block"}})})}const rt="_root_9li00_1",ct="_preview_9li00_11",lt="_info_9li00_15",ee={root:rt,preview:ct,info:lt};function dt({name:s,colors:n,description:i}){const a=`linear-gradient(135deg, ${n[0]} 0%, ${n[1]} 100%)`;return e.jsx(J,{value:a,children:e.jsxs(t.Paper,{className:ee.root,shadow:"lg",radius:"md",children:[e.jsx("div",{className:ee.preview,style:{background:a}}),e.jsxs("div",{className:ee.info,children:[e.jsx(t.Text,{fw:600,size:"sm",children:s}),i&&e.jsx(t.Text,{size:"xs",c:"dimmed",children:i}),e.jsxs(t.Text,{size:"xs",c:"dimmed",ff:"monospace",children:[n[0]," → ",n[1]]})]})]})})}const ut="_root_1vlvy_1",mt="_video_1vlvy_9",de={root:ut,video:mt};function xe({src:s,opacity:n=.3}){return e.jsx("div",{className:de.root,style:{opacity:n},children:e.jsx("video",{autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:de.video,children:e.jsx("source",{src:s,type:"video/mp4"})})})}const ht="_root_1suaa_1",xt="_content_1suaa_8",pt="_label_1suaa_21",ft="_vignette_1suaa_37",_t="_logoWrapper_1suaa_50",vt="_logo_1suaa_50",jt="_glow_1suaa_73",gt="_textWrapper_1suaa_85",yt="_heading_1suaa_91",bt="_shimmer_1suaa_125",wt="_tagline_1suaa_129",It="_primaryButton_1suaa_143",Nt="_secondaryButton_1suaa_148",St="_scrollIndicator_1suaa_160",Ct="_scrollLabel_1suaa_171",Tt="_scrollLine_1suaa_179",S={root:ht,content:xt,label:pt,vignette:ft,logoWrapper:_t,logo:vt,glow:jt,textWrapper:gt,heading:yt,shimmer:bt,tagline:wt,primaryButton:It,secondaryButton:Nt,scrollIndicator:St,scrollLabel:Ct,scrollLine:Tt};function kt({variant:s="logo",heading:n,label:i,tagline:a,logoSrc:l=fe,gradient:p="frequencyAlive",shimmer:g=!0,primaryAction:j,secondaryAction:_,backgroundVideoSrc:d,showWaveform:h,showScrollIndicator:y=!1}){const[r,v]=c.useState(!1),m=n??(s==="text"?"Your Message":void 0),u=i||(s==="logo"?"Welcome":void 0),b=j||_,o=h??!0,f=_e.gradients[p];return c.useEffect(()=>{v(!0)},[]),e.jsxs(t.Box,{component:"section",className:S.root,children:[d&&e.jsx(xe,{src:d}),e.jsxs("div",{className:S.content,children:[r&&e.jsxs(e.Fragment,{children:[u&&e.jsx(k.motion.p,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.8,delay:.2},className:S.label,children:u}),s==="logo"&&e.jsxs(k.motion.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{duration:1.2,delay:.3,ease:"easeOut"},className:S.logoWrapper,children:[o&&e.jsx(te,{}),o&&e.jsx("div",{className:S.vignette}),e.jsx(k.motion.img,{src:l,alt:m??"Frequency",className:S.logo,animate:{rotate:[0,.5,-.5,0]},transition:{duration:8,repeat:1/0,ease:"easeInOut"}}),e.jsx("div",{className:S.glow})]}),s==="text"&&m&&e.jsxs(k.motion.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{duration:1.2,delay:.3,ease:"easeOut"},className:S.textWrapper,children:[o&&e.jsx(te,{}),o&&e.jsx("div",{className:S.vignette}),e.jsx(t.Title,{order:1,className:`${S.heading} ${g?S.shimmer:""}`,style:{backgroundImage:`linear-gradient(135deg, ${f.from}, ${f.to}, ${f.from})`,backgroundSize:g?"200% 100%":void 0},children:m})]}),a&&e.jsx(k.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.8,delay:.7},children:e.jsx(t.Text,{className:S.tagline,children:a})}),b&&e.jsx(k.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.8,delay:.9},children:e.jsxs(t.Group,{gap:"md",justify:"center",wrap:"wrap",children:[j&&e.jsx(t.Button,{component:"a",href:j.href,size:"lg",radius:4,className:S.primaryButton,children:j.label}),_&&e.jsx(t.Button,{component:"a",href:_.href,size:"lg",radius:4,variant:"outline",className:S.secondaryButton,children:_.label})]})})]}),r&&y&&e.jsxs(k.motion.div,{className:S.scrollIndicator,initial:{opacity:0},animate:{opacity:1},transition:{duration:1,delay:1.4},children:[e.jsx("span",{className:S.scrollLabel,children:"Scroll"}),e.jsx(k.motion.div,{className:S.scrollLine,animate:{scaleY:[1,1.5,1]},transition:{duration:1.5,repeat:1/0}})]})]})]})}function se({variant:s,children:n}){const i=s==="do";return e.jsxs(t.Badge,{variant:"light",color:i?"green":"red",size:"lg",radius:"sm",styles:{root:{textTransform:"none",fontWeight:400},label:{whiteSpace:"normal",lineHeight:1.4}},children:[e.jsxs("strong",{children:[i?"Do":"Don't",":"]})," ",n]})}const Mt="_root_13w21_1",zt="_playButton_13w21_11",ue={root:Mt,playButton:zt},Bt={mini:{height:24,buttonSize:20,iconSize:14,waveHeight:16,barWidth:1,barGap:0},small:{height:32,buttonSize:28,iconSize:16,waveHeight:20,barWidth:1,barGap:0},compact:{height:40,buttonSize:32,iconSize:18,waveHeight:24,barWidth:2,barGap:1}},pe=c.forwardRef(({audioUrl:s,size:n="mini",waveColor:i="#CCCCCC",progressColor:a="#169bde",onPlay:l,onPause:p,className:g,style:j},_)=>{const d=c.useRef(null),[h,y]=c.useState(!1),[r,v]=c.useState(0),m=Bt[n];c.useEffect(()=>{const o=d.current;if(!o)return;const f=()=>v(o.currentTime),w=()=>{y(!1),v(0)},M=()=>y(!1),E=()=>y(!0);return o.addEventListener("timeupdate",f),o.addEventListener("ended",w),o.addEventListener("pause",M),o.addEventListener("play",E),()=>{o.removeEventListener("timeupdate",f),o.removeEventListener("ended",w),o.removeEventListener("pause",M),o.removeEventListener("play",E)}},[s]);const u=c.useCallback(()=>{const o=d.current;o&&(h?(o.pause(),p==null||p()):(o.play().catch(()=>{}),l==null||l()))},[h,l,p]),b=c.useCallback(o=>{const f=d.current;f&&!isNaN(o)&&isFinite(o)&&(f.currentTime=o,v(o))},[]);return e.jsxs(t.Group,{ref:_,gap:n==="mini"?6:n==="small"?8:10,wrap:"nowrap",className:`${ue.root} ${g??""}`,style:{height:m.height,...j},children:[e.jsx("audio",{ref:d,src:s,preload:"metadata"}),e.jsx(t.ActionIcon,{variant:"filled",color:"blue",radius:"xl",size:m.buttonSize,onClick:u,"aria-label":h?"Pause":"Play",className:ue.playButton,children:h?e.jsx(z.IconPlayerPauseFilled,{size:m.iconSize}):e.jsx(z.IconPlayerPlayFilled,{size:m.iconSize})}),e.jsx(t.Box,{style:{flex:1,minWidth:80},children:e.jsx(K,{audioRef:d,currentTime:r,onSeek:b,waveColor:i,progressColor:a,height:m.waveHeight,barWidth:m.barWidth,barGap:m.barGap})})]})});pe.displayName="MiniAudioPlayer";const $t="_root_1bah1_1",Pt={root:$t};function Lt({accentColor:s,title:n,description:i,doHint:a,dontHint:l}){return e.jsxs(t.Paper,{className:Pt.root,p:"lg",radius:"md",style:{borderLeftColor:s},children:[e.jsx(t.Title,{order:3,size:"h4",mb:"xs",children:n}),e.jsx(t.Text,{c:"dimmed",children:i}),(a||l)&&e.jsxs(t.Group,{gap:"sm",mt:"md",wrap:"wrap",children:[a&&e.jsx(se,{variant:"do",children:a}),l&&e.jsx(se,{variant:"dont",children:l})]})]})}const Et="_root_ydu7j_1",Wt="_actions_ydu7j_22",Gt="_fab_ydu7j_43",Rt="_actionButton_ydu7j_61",Y={root:Et,actions:Wt,fab:Gt,actionButton:Rt};function Ft({actions:s,icon:n,openIcon:i,direction:a="up",color:l="blue",size:p=56,defaultOpen:g=!1,open:j,onOpenChange:_,style:d,className:h}){const[y,r]=c.useState(g),v=j??y,m=c.useCallback(()=>{const o=!v;r(o),_==null||_(o)},[v,_]),u=c.useCallback(()=>{r(!1),_==null||_(!1)},[_]),b=a==="up"||a==="down";return e.jsxs(t.Box,{className:`${Y.root} ${h??""}`,style:d,"data-direction":a,children:[e.jsx("div",{className:Y.actions,"data-direction":a,children:s.map((o,f)=>{const w=a==="up"||a==="left"?s.length-1-f:f;return e.jsx(t.Transition,{mounted:v,transition:b?"slide-up":"slide-right",duration:200,timingFunction:"ease",enterDelay:w*40,children:M=>e.jsx(t.Tooltip,{label:o.label,position:b?"left":"top",children:e.jsx(t.ActionIcon,{variant:"filled",color:"gray",radius:"xl",size:p*.7,style:M,className:Y.actionButton,onClick:()=>{o.onClick(),u()},"aria-label":o.label,children:o.icon})})},o.label)})}),e.jsx(t.ActionIcon,{variant:"filled",color:l,radius:"xl",size:p,onClick:m,className:Y.fab,"data-open":v||void 0,"aria-label":v?"Close actions":"Open actions",children:v?i??n??e.jsx(z.IconPlus,{size:p*.45}):n??e.jsx(z.IconPlus,{size:p*.45})})]})}const Dt="_container_9xj91_1",At="_layout_9xj91_16",qt="_reversed_9xj91_29",Ht="_headingSide_9xj91_39",Ot="_sticky_9xj91_49",Vt="_stickyInner_9xj91_54",Ut="_contentSide_9xj91_65",Xt="_title_9xj91_76",Yt="_preTitle_9xj91_82",Kt="_titleHighlight_9xj91_88",Jt="_description_9xj91_95",B={container:Dt,layout:At,reversed:qt,headingSide:Ht,sticky:Ot,stickyInner:Vt,contentSide:Ut,title:Xt,preTitle:Yt,titleHighlight:Kt,description:Jt};function Qt({badge:s,badgeColor:n="violet",subtitle:i,title:a,titleColor:l="blue",preTitle:p,description:g,actions:j,heading:_,children:d,stickyHeading:h=!1,py:y,reversed:r=!1,id:v,className:m}){const u=_??e.jsxs(t.Stack,{gap:"sm",children:[s&&e.jsxs(t.Box,{children:[e.jsx(t.Badge,{color:n,variant:"filled",size:"sm",radius:4,tt:"uppercase",fw:700,children:s}),i&&e.jsx(t.Text,{size:"sm",c:"dimmed",mt:"xs",tt:"uppercase",style:{letterSpacing:"0.05em"},children:i})]}),!s&&i&&e.jsx(t.Text,{size:"sm",c:"dimmed",tt:"uppercase",style:{letterSpacing:"0.05em"},children:i}),(p||a)&&e.jsxs(t.Title,{order:2,className:B.title,children:[p&&e.jsx("span",{className:B.preTitle,children:p}),p&&e.jsx("br",{}),a&&e.jsx(t.Text,{component:"span",inherit:!0,className:B.titleHighlight,c:l,children:a})]}),g&&e.jsx(t.Text,{size:"lg",c:"dimmed",lh:1.7,className:B.description,children:g}),j&&e.jsx(t.Box,{mt:"md",children:j})]});return e.jsx(t.Box,{component:"section",py:y??"calc(var(--mantine-spacing-xl) * 3)",pos:"relative",id:v,className:m,children:e.jsx(t.Box,{className:B.container,children:e.jsxs(t.Box,{className:`${B.layout} ${r?B.reversed:""}`,children:[e.jsx(t.Box,{className:`${B.headingSide} ${h?B.sticky:""}`,children:e.jsx(t.Box,{className:h?B.stickyInner:void 0,children:u})}),e.jsx(t.Box,{className:B.contentSide,children:d})]})})})}const Zt="_root_ioshc_1",es="_quoteIcon_ioshc_6",me={root:Zt,quoteIcon:es};function ts(s){return s.split(" ").map(n=>n[0]).join("").toUpperCase().slice(0,2)}function ss({quote:s,name:n,role:i,company:a,avatarSrc:l,accentColor:p="blue"}){const g=`var(--mantine-color-${p}-filled)`;return e.jsxs(t.Paper,{className:me.root,p:"lg",radius:"md",style:{borderLeftColor:g},children:[e.jsx(z.IconQuote,{size:32,className:me.quoteIcon,color:g}),e.jsx(t.Text,{fs:"italic",mt:"xs",mb:"md",children:s}),e.jsxs(t.Group,{gap:"sm",children:[e.jsx(t.Avatar,{src:l,alt:n,color:p,radius:"xl",size:"md",children:ts(n)}),e.jsxs(t.Stack,{gap:0,children:[e.jsx(t.Text,{fw:600,size:"sm",children:n}),(i||a)&&e.jsx(t.Text,{size:"xs",c:"dimmed",children:[i,a].filter(Boolean).join(", ")})]})]})]})}exports.AnimatedCounter=ve;exports.AnimatedWaveform=te;exports.AudioPlayer=Be;exports.AudioWaveform=K;exports.CodeBlock=Le;exports.ColorPalette=Ae;exports.ColorSwatch=Ve;exports.Copyable=J;exports.DosDonts=Ze;exports.ExpandableCard=st;exports.FadeInSection=at;exports.FrequencyWave=it;exports.GradientSwatch=dt;exports.Hero=kt;exports.HintBadge=se;exports.MiniAudioPlayer=pe;exports.PrincipleCard=Lt;exports.SpeedDial=Ft;exports.SplitSection=Qt;exports.TestimonialCard=ss;exports.VideoBackground=xe;