GitHub Action
commited on
Commit
Β·
d11eae0
1
Parent(s):
bf0ae65
Sync from GitHub: 0f118253b7e3858a0777286a177d318c844e1526
Browse files- .gitattributes +6 -0
- frontend/src/routes/+layout.svelte +16 -15
- frontend/src/routes/+page.svelte +376 -960
- frontend/src/routes/code-recorder/+page.svelte +489 -0
- frontend/src/routes/voice-cloning/+page.svelte +442 -0
- hfstudio/static/_app/immutable/assets/0.DrKserg1.css +1 -0
- hfstudio/static/_app/immutable/assets/2.DvaEwt8V.css +1 -0
- hfstudio/static/_app/immutable/assets/3.BNkL3CE9.css +1 -0
- hfstudio/static/_app/immutable/chunks/BCO3d5zc.js +1 -0
- hfstudio/static/_app/immutable/chunks/B_t0LZOt.js +1 -0
- hfstudio/static/_app/immutable/chunks/BjzGjDWb.js +1 -0
- hfstudio/static/_app/immutable/chunks/CDuamvIE.js +1 -0
- hfstudio/static/_app/immutable/chunks/D7IARYO-.js +1 -0
- hfstudio/static/_app/immutable/chunks/DeMXkdTg.js +1 -0
- hfstudio/static/_app/immutable/chunks/DrRA3Ukb.js +6 -0
- hfstudio/static/_app/immutable/chunks/e2OxhbUw.js +3 -0
- hfstudio/static/_app/immutable/entry/app.Bclt6vmz.js +2 -0
- hfstudio/static/_app/immutable/entry/start.DiWn1IXe.js +1 -0
- hfstudio/static/_app/immutable/nodes/0._QAFxNaI.js +5 -0
- hfstudio/static/_app/immutable/nodes/1.fA8k99qD.js +1 -0
- hfstudio/static/_app/immutable/nodes/2.1Swd6w1L.js +16 -0
- hfstudio/static/_app/immutable/nodes/3.BFTLVg3t.js +35 -0
- hfstudio/static/_app/immutable/nodes/4.Do7OE_Wr.js +9 -0
- hfstudio/static/_app/version.json +1 -1
- hfstudio/static/index.html +7 -7
.gitattributes
CHANGED
|
@@ -7,3 +7,9 @@
|
|
| 7 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 8 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 9 |
*.pdf filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 8 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 9 |
*.pdf filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
hfstudio/static/assets/hf-logo.png filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
hfstudio/static/assets/hf-studio-logo.png filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
frontend/static/assets/hf-logo.png filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
frontend/static/assets/hf-studio-logo.png filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
hfstudio/static/samples/harvard.wav filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
frontend/static/samples/harvard.wav filter=lfs diff=lfs merge=lfs -text
|
frontend/src/routes/+layout.svelte
CHANGED
|
@@ -1,9 +1,8 @@
|
|
| 1 |
<script>
|
| 2 |
import '../app.css';
|
| 3 |
-
import { Home, Settings,
|
| 4 |
import { onMount } from 'svelte';
|
| 5 |
-
|
| 6 |
-
let currentPage = 'tts';
|
| 7 |
let sidebarOpen = true;
|
| 8 |
|
| 9 |
// Initialize from server-side injected data with safe fallback
|
|
@@ -285,11 +284,11 @@
|
|
| 285 |
<div class="flex h-screen bg-white">
|
| 286 |
<!-- Sidebar -->
|
| 287 |
<aside
|
| 288 |
-
class="w-56 border-r border-gray-200 bg-white flex-shrink-0 flex flex-col h-full {sidebarOpen
|
| 289 |
? ''
|
| 290 |
: 'hidden'}"
|
| 291 |
>
|
| 292 |
-
<div class="
|
| 293 |
<div class="flex items-center gap-3">
|
| 294 |
<img src="/assets/hf-studio-logo.png" alt="HF Logo" class="w-8 h-8" />
|
| 295 |
<h1 class="text-xl font-semibold">
|
|
@@ -301,23 +300,25 @@
|
|
| 301 |
<nav class="p-2 text-sm flex-1">
|
| 302 |
<div class="mt-2 mb-1 px-2 text-xs font-medium text-gray-500 uppercase">Tasks</div>
|
| 303 |
|
| 304 |
-
<
|
|
|
|
| 305 |
class="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left
|
| 306 |
-
{
|
| 307 |
-
on:click={() => (currentPage = 'tts')}
|
| 308 |
>
|
| 309 |
<span>ποΈ</span>
|
| 310 |
<span>Text to Speech</span>
|
| 311 |
-
</
|
| 312 |
|
| 313 |
-
<
|
| 314 |
-
|
| 315 |
-
|
|
|
|
| 316 |
>
|
| 317 |
-
<
|
| 318 |
<span>Voice Cloning</span>
|
| 319 |
-
</
|
| 320 |
|
|
|
|
| 321 |
<button
|
| 322 |
class="w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"
|
| 323 |
disabled
|
|
@@ -352,7 +353,7 @@
|
|
| 352 |
</nav>
|
| 353 |
|
| 354 |
<!-- Sign in with Hugging Face at bottom -->
|
| 355 |
-
<div class="
|
| 356 |
{#if !isLoggedIn && showLoginPrompt}
|
| 357 |
<!-- Login prompt message -->
|
| 358 |
<div
|
|
|
|
| 1 |
<script>
|
| 2 |
import '../app.css';
|
| 3 |
+
import { Home, Settings, Github, Menu, Mic, Layout, Code } from 'lucide-svelte';
|
| 4 |
import { onMount } from 'svelte';
|
| 5 |
+
import { page } from '$app/stores';
|
|
|
|
| 6 |
let sidebarOpen = true;
|
| 7 |
|
| 8 |
// Initialize from server-side injected data with safe fallback
|
|
|
|
| 284 |
<div class="flex h-screen bg-white">
|
| 285 |
<!-- Sidebar -->
|
| 286 |
<aside
|
| 287 |
+
class="w-56 border-r border-gray-200 bg-white flex-shrink-0 flex flex-col h-full relative {sidebarOpen
|
| 288 |
? ''
|
| 289 |
: 'hidden'}"
|
| 290 |
>
|
| 291 |
+
<div class="px-4 py-4 border-b border-gray-200 min-h-[73px] flex items-center">
|
| 292 |
<div class="flex items-center gap-3">
|
| 293 |
<img src="/assets/hf-studio-logo.png" alt="HF Logo" class="w-8 h-8" />
|
| 294 |
<h1 class="text-xl font-semibold">
|
|
|
|
| 300 |
<nav class="p-2 text-sm flex-1">
|
| 301 |
<div class="mt-2 mb-1 px-2 text-xs font-medium text-gray-500 uppercase">Tasks</div>
|
| 302 |
|
| 303 |
+
<a
|
| 304 |
+
href="/"
|
| 305 |
class="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left
|
| 306 |
+
{$page.url.pathname === '/' ? 'bg-gray-100' : ''}"
|
|
|
|
| 307 |
>
|
| 308 |
<span>ποΈ</span>
|
| 309 |
<span>Text to Speech</span>
|
| 310 |
+
</a>
|
| 311 |
|
| 312 |
+
<a
|
| 313 |
+
href="/voice-cloning"
|
| 314 |
+
class="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left
|
| 315 |
+
{$page.url.pathname === '/voice-cloning' ? 'bg-gray-100' : ''}"
|
| 316 |
>
|
| 317 |
+
<Mic size={16} />
|
| 318 |
<span>Voice Cloning</span>
|
| 319 |
+
</a>
|
| 320 |
|
| 321 |
+
<div class="mt-3 mb-1 px-2 text-xs font-medium text-gray-500 uppercase">Coming Soon</div>
|
| 322 |
<button
|
| 323 |
class="w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"
|
| 324 |
disabled
|
|
|
|
| 353 |
</nav>
|
| 354 |
|
| 355 |
<!-- Sign in with Hugging Face at bottom -->
|
| 356 |
+
<div class="absolute bottom-4 left-0 right-0 px-2">
|
| 357 |
{#if !isLoggedIn && showLoginPrompt}
|
| 358 |
<!-- Login prompt message -->
|
| 359 |
<div
|
frontend/src/routes/+page.svelte
CHANGED
|
@@ -6,40 +6,24 @@
|
|
| 6 |
AlertCircle,
|
| 7 |
ChevronDown,
|
| 8 |
Copy,
|
| 9 |
-
RefreshCw,
|
| 10 |
Share,
|
| 11 |
MoreHorizontal,
|
| 12 |
Shuffle,
|
| 13 |
-
Settings,
|
| 14 |
-
Sliders,
|
| 15 |
Pause,
|
| 16 |
-
SkipBack,
|
| 17 |
-
SkipForward,
|
| 18 |
-
Layout,
|
| 19 |
-
Code,
|
| 20 |
X,
|
| 21 |
-
|
|
|
|
| 22 |
} from 'lucide-svelte';
|
| 23 |
import { onMount } from 'svelte';
|
| 24 |
-
import Prism from 'prismjs';
|
| 25 |
-
import 'prismjs/components/prism-python';
|
| 26 |
-
import 'prismjs/components/prism-bash';
|
| 27 |
|
| 28 |
-
let text = `In a hole in the ground there lived a hobbit. Not a nasty, dirty, wet hole, filled with the ends of worms and an oozy smell, nor yet a dry, bare, sandy hole with nothing in it to sit down on or to eat: it was a hobbit-hole, and that means comfort.`;
|
| 29 |
let selectedVoice = 'Andrew';
|
| 30 |
let selectedModel = 'Chatterbox';
|
| 31 |
-
let mode = 'api';
|
| 32 |
-
let viewMode = 'ui';
|
| 33 |
let modelDropdownOpen = false;
|
| 34 |
let isGenerating = false;
|
| 35 |
-
let codeHistory = [];
|
| 36 |
-
let setupCode = generateSetupCode(); // Always show setup code
|
| 37 |
-
let importCode = null;
|
| 38 |
let audioUrl = null;
|
| 39 |
-
let copyNotification = null;
|
| 40 |
let exaggeration = 0.25;
|
| 41 |
let temperature = 0.7;
|
| 42 |
-
let showSettings = true;
|
| 43 |
let isPlaying = false;
|
| 44 |
let currentTime = 0;
|
| 45 |
let duration = 0;
|
|
@@ -50,6 +34,7 @@
|
|
| 50 |
let showErrorModal = false;
|
| 51 |
let errorMessage = '';
|
| 52 |
let errorDetails = '';
|
|
|
|
| 53 |
|
| 54 |
const famousBookOpeners = [
|
| 55 |
'It was the best of times, it was the worst of times. It was the age of wisdom, it was the age of foolishness.',
|
|
@@ -101,7 +86,6 @@
|
|
| 101 |
async function generateSpeech() {
|
| 102 |
if (!text.trim()) return;
|
| 103 |
|
| 104 |
-
// Check if user is authenticated via session
|
| 105 |
const response = await fetch('/api/auth/user', { credentials: 'include' });
|
| 106 |
if (!response.ok) {
|
| 107 |
window.dispatchEvent(new CustomEvent('show-login-prompt'));
|
|
@@ -111,32 +95,7 @@
|
|
| 111 |
isGenerating = true;
|
| 112 |
audioUrl = null;
|
| 113 |
currentTime = 0;
|
| 114 |
-
|
| 115 |
-
if (!importCode) {
|
| 116 |
-
importCode = generateImportCode();
|
| 117 |
-
try {
|
| 118 |
-
await fetch('/api/history/save', {
|
| 119 |
-
method: 'POST',
|
| 120 |
-
headers: {
|
| 121 |
-
'Content-Type': 'application/json',
|
| 122 |
-
},
|
| 123 |
-
credentials: 'include',
|
| 124 |
-
body: JSON.stringify({
|
| 125 |
-
code: importCode,
|
| 126 |
-
result_type: null,
|
| 127 |
-
result_data: null,
|
| 128 |
-
entry_type: 'import',
|
| 129 |
-
}),
|
| 130 |
-
});
|
| 131 |
-
} catch (error) {
|
| 132 |
-
console.error('Error saving import code to database:', error);
|
| 133 |
-
}
|
| 134 |
-
}
|
| 135 |
-
|
| 136 |
-
const ttsCode = generateTTSCode();
|
| 137 |
-
|
| 138 |
isPlaying = false;
|
| 139 |
-
|
| 140 |
audioTitle = text.length > 30 ? text.substring(0, 30) + '...' : text;
|
| 141 |
|
| 142 |
try {
|
|
@@ -144,7 +103,7 @@
|
|
| 144 |
text: text,
|
| 145 |
voice_id: selectedVoice.toLowerCase(),
|
| 146 |
model_id: selectedModel.toLowerCase(),
|
| 147 |
-
mode:
|
| 148 |
parameters: {
|
| 149 |
exaggeration: exaggeration,
|
| 150 |
temperature: temperature,
|
|
@@ -156,7 +115,7 @@
|
|
| 156 |
headers: {
|
| 157 |
'Content-Type': 'application/json',
|
| 158 |
},
|
| 159 |
-
credentials: 'include',
|
| 160 |
body: JSON.stringify(requestBody),
|
| 161 |
});
|
| 162 |
|
|
@@ -170,24 +129,16 @@
|
|
| 170 |
if (result.success && result.audio_url) {
|
| 171 |
audioUrl = result.audio_url;
|
| 172 |
|
| 173 |
-
//
|
| 174 |
-
|
| 175 |
-
type: 'audio',
|
| 176 |
-
url: result.audio_url,
|
| 177 |
-
title: audioTitle,
|
| 178 |
-
duration: result.duration,
|
| 179 |
-
});
|
| 180 |
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
}
|
| 189 |
-
}, 100); // Small delay to ensure audio element is ready
|
| 190 |
-
}
|
| 191 |
} else {
|
| 192 |
const errorMessage = result.error || 'Unknown error occurred';
|
| 193 |
showError('Generation Failed', errorMessage);
|
|
@@ -204,8 +155,6 @@
|
|
| 204 |
}
|
| 205 |
}
|
| 206 |
|
| 207 |
-
// Removed getAccessToken - using session-based auth now
|
| 208 |
-
|
| 209 |
function togglePlayPause() {
|
| 210 |
if (audioElement) {
|
| 211 |
if (isPlaying) {
|
|
@@ -298,36 +247,58 @@
|
|
| 298 |
}
|
| 299 |
}
|
| 300 |
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 308 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 309 |
try {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 310 |
await fetch('/api/history/save', {
|
| 311 |
method: 'POST',
|
| 312 |
-
headers: {
|
| 313 |
-
'Content-Type': 'application/json',
|
| 314 |
-
},
|
| 315 |
credentials: 'include',
|
| 316 |
body: JSON.stringify({
|
| 317 |
-
code:
|
| 318 |
-
result_type:
|
| 319 |
-
result_data:
|
| 320 |
-
|
| 321 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 322 |
});
|
|
|
|
|
|
|
|
|
|
| 323 |
} catch (error) {
|
| 324 |
-
console.error('Error saving
|
| 325 |
}
|
| 326 |
-
|
| 327 |
-
return entry;
|
| 328 |
}
|
| 329 |
|
| 330 |
-
async function
|
| 331 |
try {
|
| 332 |
const response = await fetch('/api/history/load', {
|
| 333 |
method: 'GET',
|
|
@@ -336,955 +307,400 @@
|
|
| 336 |
|
| 337 |
if (response.ok) {
|
| 338 |
const data = await response.json();
|
| 339 |
-
|
| 340 |
-
const setupEntries = data.entries.filter((e) => e.entry_type === 'setup');
|
| 341 |
-
const importEntries = data.entries.filter((e) => e.entry_type === 'import');
|
| 342 |
const generationEntries = data.entries.filter((e) => e.entry_type === 'generation');
|
| 343 |
-
|
| 344 |
-
setupCode = generateSetupCode();
|
| 345 |
-
importCode = importEntries.length > 0 ? importEntries[importEntries.length - 1].code : null;
|
| 346 |
-
|
| 347 |
-
codeHistory = generationEntries.map((entry) => ({
|
| 348 |
-
id: entry.id,
|
| 349 |
-
code: entry.code,
|
| 350 |
-
result: entry.result_data,
|
| 351 |
-
}));
|
| 352 |
}
|
| 353 |
} catch (error) {
|
| 354 |
-
console.error('Error loading history
|
| 355 |
-
|
| 356 |
-
setupCode = generateSetupCode();
|
| 357 |
-
importCode = null;
|
| 358 |
-
}
|
| 359 |
-
}
|
| 360 |
-
|
| 361 |
-
async function resetHistory() {
|
| 362 |
-
try {
|
| 363 |
-
await fetch('/api/history/clear', {
|
| 364 |
-
method: 'DELETE',
|
| 365 |
-
credentials: 'include',
|
| 366 |
-
});
|
| 367 |
-
|
| 368 |
-
codeHistory = [];
|
| 369 |
-
setupCode = generateSetupCode();
|
| 370 |
-
importCode = null;
|
| 371 |
-
} catch (error) {
|
| 372 |
-
console.error('Error clearing history:', error);
|
| 373 |
-
codeHistory = [];
|
| 374 |
-
setupCode = generateSetupCode();
|
| 375 |
-
importCode = null;
|
| 376 |
-
}
|
| 377 |
-
}
|
| 378 |
-
|
| 379 |
-
function generateSetupCode() {
|
| 380 |
-
if (mode === 'local') {
|
| 381 |
-
return `pip install huggingface-hub hfstudio uv
|
| 382 |
-
hfstudio start ${selectedModel.toLowerCase()} --port 7861`;
|
| 383 |
-
} else {
|
| 384 |
-
return `pip install huggingface-hub`;
|
| 385 |
-
}
|
| 386 |
-
}
|
| 387 |
-
|
| 388 |
-
function generateClientInitCode() {
|
| 389 |
-
if (mode === 'local') {
|
| 390 |
-
const port = 7861;
|
| 391 |
-
return `client = InferenceClient(base_url="http://localhost:${port}/api/v1")`;
|
| 392 |
-
} else {
|
| 393 |
-
const endpointModel =
|
| 394 |
-
selectedModel.toLowerCase() === 'chatterbox'
|
| 395 |
-
? 'ResembleAI/chatterbox'
|
| 396 |
-
: selectedModel.toLowerCase();
|
| 397 |
-
return `client = InferenceClient(
|
| 398 |
-
api_key="YOUR_HF_TOKEN", # Get your token from https://huggingface.co/settings/tokens
|
| 399 |
-
model="${endpointModel}",
|
| 400 |
-
)`;
|
| 401 |
-
}
|
| 402 |
-
}
|
| 403 |
-
|
| 404 |
-
function generateImportCode() {
|
| 405 |
-
const clientCode = generateClientInitCode();
|
| 406 |
-
|
| 407 |
-
if (mode === 'local') {
|
| 408 |
-
return `from huggingface_hub import InferenceClient
|
| 409 |
-
|
| 410 |
-
${clientCode}`;
|
| 411 |
-
} else {
|
| 412 |
-
return `from huggingface_hub import InferenceClient
|
| 413 |
-
|
| 414 |
-
${clientCode}`;
|
| 415 |
-
}
|
| 416 |
-
}
|
| 417 |
-
|
| 418 |
-
function generateTTSCode() {
|
| 419 |
-
const selectedVoiceData = voices.find((v) => v.name === selectedVoice);
|
| 420 |
-
const voiceUrl = selectedVoiceData?.preview_url || selectedVoiceData?.sample;
|
| 421 |
-
|
| 422 |
-
if (mode === 'local') {
|
| 423 |
-
return `text = """${text}"""
|
| 424 |
-
|
| 425 |
-
audio = client.text_to_speech(
|
| 426 |
-
text,
|
| 427 |
-
extra_body={
|
| 428 |
-
"audio_url": "${voiceUrl}",
|
| 429 |
-
"exaggeration": ${exaggeration},
|
| 430 |
-
"temperature": ${temperature}
|
| 431 |
-
}
|
| 432 |
-
)`;
|
| 433 |
-
} else {
|
| 434 |
-
return `text = """${text}"""
|
| 435 |
-
|
| 436 |
-
audio = client.text_to_speech(
|
| 437 |
-
text,
|
| 438 |
-
extra_body={
|
| 439 |
-
"audio_url": "${voiceUrl}",
|
| 440 |
-
"exaggeration": ${exaggeration},
|
| 441 |
-
"temperature": ${temperature}
|
| 442 |
-
}
|
| 443 |
-
)`;
|
| 444 |
-
}
|
| 445 |
-
}
|
| 446 |
-
|
| 447 |
-
function generateSaveCode() {
|
| 448 |
-
return `output_filename = "output_speech.wav"
|
| 449 |
-
|
| 450 |
-
with open(output_filename, "wb") as f:
|
| 451 |
-
f.write(audio_bytes)
|
| 452 |
-
|
| 453 |
-
print(f"οΏ½οΏ½οΏ½ Audio saved to {output_filename}")`;
|
| 454 |
-
}
|
| 455 |
-
|
| 456 |
-
function copyToClipboard(text, message = 'Copied to clipboard!') {
|
| 457 |
-
navigator.clipboard.writeText(text).then(() => {
|
| 458 |
-
copyNotification = message;
|
| 459 |
-
setTimeout(() => {
|
| 460 |
-
copyNotification = null;
|
| 461 |
-
}, 2000);
|
| 462 |
-
});
|
| 463 |
-
}
|
| 464 |
-
|
| 465 |
-
function showError(message, details = '') {
|
| 466 |
-
errorMessage = message;
|
| 467 |
-
errorDetails = details;
|
| 468 |
-
showErrorModal = true;
|
| 469 |
-
}
|
| 470 |
-
|
| 471 |
-
function closeErrorModal() {
|
| 472 |
-
showErrorModal = false;
|
| 473 |
-
errorMessage = '';
|
| 474 |
-
errorDetails = '';
|
| 475 |
-
}
|
| 476 |
-
|
| 477 |
-
function copyErrorMessage() {
|
| 478 |
-
const fullError = errorDetails ? `${errorMessage}\n\nDetails:\n${errorDetails}` : errorMessage;
|
| 479 |
-
copyToClipboard(fullError, 'Error message copied!');
|
| 480 |
-
}
|
| 481 |
-
|
| 482 |
-
function copyAllCode() {
|
| 483 |
-
const parts = [];
|
| 484 |
-
|
| 485 |
-
if (setupCode) {
|
| 486 |
-
const isTerminalCommand =
|
| 487 |
-
setupCode.includes('pip install') || setupCode.includes('hfstudio start');
|
| 488 |
-
const language = isTerminalCommand ? 'bash' : '';
|
| 489 |
-
parts.push(`## Setup (Run in Terminal)\n\n\`\`\`${language}\n${setupCode}\n\`\`\``);
|
| 490 |
}
|
| 491 |
-
|
| 492 |
-
if (importCode) {
|
| 493 |
-
parts.push(`## Imports (Python)\n\n\`\`\`python\n${importCode}\n\`\`\``);
|
| 494 |
-
}
|
| 495 |
-
|
| 496 |
-
codeHistory.forEach((entry, i) => {
|
| 497 |
-
parts.push(`## Cell ${i + 1}\n\n\`\`\`python\n${entry.code}\n\`\`\``);
|
| 498 |
-
});
|
| 499 |
-
|
| 500 |
-
const markdownContent = parts.join('\n\n');
|
| 501 |
-
copyToClipboard(markdownContent, 'All code copied as Markdown!');
|
| 502 |
}
|
| 503 |
|
| 504 |
onMount(async () => {
|
| 505 |
-
await
|
| 506 |
});
|
| 507 |
-
|
| 508 |
-
$: if (mode) {
|
| 509 |
-
setupCode = generateSetupCode();
|
| 510 |
-
if (importCode) {
|
| 511 |
-
importCode = generateImportCode();
|
| 512 |
-
}
|
| 513 |
-
}
|
| 514 |
-
|
| 515 |
-
function toggleHistoryAudio(entry) {
|
| 516 |
-
if (!entry.audioElement) {
|
| 517 |
-
entry.audioElement = new Audio(entry.result.url);
|
| 518 |
-
entry.audioElement.addEventListener('ended', () => {
|
| 519 |
-
entry.isPlaying = false;
|
| 520 |
-
codeHistory = [...codeHistory];
|
| 521 |
-
});
|
| 522 |
-
}
|
| 523 |
-
|
| 524 |
-
if (entry.isPlaying) {
|
| 525 |
-
entry.audioElement.pause();
|
| 526 |
-
entry.isPlaying = false;
|
| 527 |
-
} else {
|
| 528 |
-
codeHistory.forEach((e) => {
|
| 529 |
-
if (e !== entry && e.isPlaying && e.audioElement) {
|
| 530 |
-
e.audioElement.pause();
|
| 531 |
-
e.isPlaying = false;
|
| 532 |
-
}
|
| 533 |
-
});
|
| 534 |
-
entry.audioElement.play();
|
| 535 |
-
entry.isPlaying = true;
|
| 536 |
-
}
|
| 537 |
-
codeHistory = [...codeHistory];
|
| 538 |
-
}
|
| 539 |
-
|
| 540 |
-
function downloadHistoryAudio(url, title) {
|
| 541 |
-
const link = document.createElement('a');
|
| 542 |
-
link.href = url;
|
| 543 |
-
link.download = `${title || 'audio'}.wav`;
|
| 544 |
-
document.body.appendChild(link);
|
| 545 |
-
link.click();
|
| 546 |
-
document.body.removeChild(link);
|
| 547 |
-
}
|
| 548 |
-
|
| 549 |
-
function formatDuration(seconds) {
|
| 550 |
-
if (!seconds) return '0:00';
|
| 551 |
-
const mins = Math.floor(seconds / 60);
|
| 552 |
-
const secs = Math.floor(seconds % 60);
|
| 553 |
-
return `${mins}:${secs.toString().padStart(2, '0')}`;
|
| 554 |
-
}
|
| 555 |
-
|
| 556 |
-
function refreshText() {
|
| 557 |
-
currentBookIndex = (currentBookIndex + 1) % famousBookOpeners.length;
|
| 558 |
-
text = famousBookOpeners[currentBookIndex];
|
| 559 |
-
}
|
| 560 |
</script>
|
| 561 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 562 |
<div class="flex flex-col h-full" on:click={handleClickOutside}>
|
| 563 |
-
<!--
|
| 564 |
-
<
|
| 565 |
-
<
|
| 566 |
-
|
| 567 |
-
|
| 568 |
-
|
| 569 |
-
|
| 570 |
-
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
|
| 574 |
-
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
|
| 578 |
-
</button>
|
| 579 |
-
<button
|
| 580 |
-
class="flex items-center gap-1.5 px-3 py-1 text-sm font-medium rounded transition-colors relative {viewMode ===
|
| 581 |
-
'code'
|
| 582 |
-
? 'bg-white shadow-sm'
|
| 583 |
-
: 'text-gray-600'}"
|
| 584 |
-
on:click={() => (viewMode = 'code')}
|
| 585 |
-
>
|
| 586 |
-
<Code size={14} />
|
| 587 |
-
Code Recorder
|
| 588 |
-
{#if codeHistory.length > 0}
|
| 589 |
-
<span
|
| 590 |
-
class="ml-1 px-1.5 py-0.5 text-xs bg-gray-500 text-white rounded-full min-w-[18px] h-[18px] flex items-center justify-center"
|
| 591 |
-
>
|
| 592 |
-
{codeHistory.length}
|
| 593 |
-
</span>
|
| 594 |
-
{/if}
|
| 595 |
-
</button>
|
| 596 |
-
</div>
|
| 597 |
-
</div>
|
| 598 |
-
</div>
|
| 599 |
-
</header>
|
| 600 |
|
| 601 |
<!-- Main content area -->
|
| 602 |
-
|
| 603 |
-
|
| 604 |
-
|
| 605 |
-
|
| 606 |
-
|
| 607 |
-
<div class="flex-
|
|
|
|
|
|
|
|
|
|
| 608 |
<button
|
| 609 |
on:click={refreshText}
|
| 610 |
-
class="
|
| 611 |
title="Refresh with famous book opening"
|
| 612 |
>
|
| 613 |
<Shuffle size={16} />
|
| 614 |
</button>
|
| 615 |
-
<textarea
|
| 616 |
-
bind:value={text}
|
| 617 |
-
maxlength="1000"
|
| 618 |
-
class="w-full h-full p-6 bg-white resize-none border-0 focus:outline-none text-gray-900 text-base leading-relaxed"
|
| 619 |
-
placeholder="In a hole in the ground there lived a hobbit."
|
| 620 |
-
/>
|
| 621 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 622 |
|
| 623 |
-
|
| 624 |
-
|
| 625 |
-
|
| 626 |
-
|
| 627 |
-
|
| 628 |
-
|
| 629 |
-
|
| 630 |
-
|
| 631 |
-
|
| 632 |
-
|
| 633 |
-
|
| 634 |
-
|
| 635 |
-
|
| 636 |
-
|
| 637 |
-
|
| 638 |
-
|
| 639 |
-
<Play size={20} />
|
| 640 |
-
Generate speech
|
| 641 |
-
{/if}
|
| 642 |
-
</button>
|
| 643 |
-
</div>
|
| 644 |
|
| 645 |
-
|
| 646 |
-
|
| 647 |
-
|
| 648 |
-
|
| 649 |
-
|
| 650 |
-
|
| 651 |
-
|
| 652 |
-
|
| 653 |
-
|
| 654 |
-
</div>
|
| 655 |
-
<!-- Mini action buttons -->
|
| 656 |
-
<div class="flex items-center gap-2">
|
| 657 |
-
<button
|
| 658 |
-
on:click={shareAudio}
|
| 659 |
-
class="flex items-center gap-1.5 px-3 py-1.5 text-sm border border-gray-200 rounded-md hover:bg-gray-50 transition-colors"
|
| 660 |
-
>
|
| 661 |
-
<Share size={14} class="text-gray-600" />
|
| 662 |
-
<span class="text-gray-700">Share</span>
|
| 663 |
-
</button>
|
| 664 |
-
<button
|
| 665 |
-
on:click={downloadAudio}
|
| 666 |
-
class="flex items-center gap-1.5 px-3 py-1.5 text-sm border border-gray-200 rounded-md hover:bg-gray-50 transition-colors"
|
| 667 |
-
>
|
| 668 |
-
<span class="text-gray-700">Download</span>
|
| 669 |
-
<Download size={14} class="text-gray-600" />
|
| 670 |
-
</button>
|
| 671 |
-
</div>
|
| 672 |
</div>
|
| 673 |
-
|
| 674 |
-
|
| 675 |
-
<div class="flex items-center gap-3 mb-4">
|
| 676 |
-
<!-- Play/Pause button -->
|
| 677 |
<button
|
| 678 |
-
on:click={
|
| 679 |
-
class="
|
| 680 |
>
|
| 681 |
-
{
|
| 682 |
-
|
| 683 |
-
{:else}
|
| 684 |
-
<Play size={14} class="text-white ml-0.5" />
|
| 685 |
-
{/if}
|
| 686 |
</button>
|
| 687 |
-
|
| 688 |
-
<!-- Progress bar -->
|
| 689 |
-
<div class="flex-1 flex items-center gap-2">
|
| 690 |
-
<span class="text-xs text-gray-500 font-mono">{formatTime(currentTime)}</span>
|
| 691 |
-
<div class="flex-1 h-1 bg-gray-200 rounded-full cursor-pointer">
|
| 692 |
-
<div
|
| 693 |
-
class="h-full bg-gradient-to-r from-amber-400 to-orange-500 rounded-full transition-all"
|
| 694 |
-
style="width: {(currentTime / duration) * 100}%"
|
| 695 |
-
></div>
|
| 696 |
-
</div>
|
| 697 |
-
<span class="text-xs text-gray-500 font-mono">{formatTime(duration)}</span>
|
| 698 |
-
</div>
|
| 699 |
-
</div>
|
| 700 |
-
|
| 701 |
-
<!-- Full audio player controls -->
|
| 702 |
-
<div class="flex items-center gap-4 mb-4">
|
| 703 |
-
<!-- Skip back button -->
|
| 704 |
-
<button class="p-2 hover:bg-gray-100 rounded-full" title="Skip back">
|
| 705 |
-
<SkipBack size={20} class="text-gray-600" />
|
| 706 |
-
</button>
|
| 707 |
-
|
| 708 |
-
<!-- Play/Pause button -->
|
| 709 |
<button
|
| 710 |
-
on:click={
|
| 711 |
-
class="
|
| 712 |
>
|
| 713 |
-
|
| 714 |
-
|
| 715 |
-
{:else}
|
| 716 |
-
<Play size={20} class="text-white ml-0.5" />
|
| 717 |
-
{/if}
|
| 718 |
-
</button>
|
| 719 |
-
|
| 720 |
-
<!-- Skip forward button -->
|
| 721 |
-
<button class="p-2 hover:bg-gray-100 rounded-full" title="Skip forward">
|
| 722 |
-
<SkipForward size={20} class="text-gray-600" />
|
| 723 |
</button>
|
|
|
|
|
|
|
| 724 |
|
| 725 |
-
|
| 726 |
-
|
| 727 |
-
|
| 728 |
-
|
| 729 |
-
|
| 730 |
-
|
| 731 |
-
|
| 732 |
-
|
| 733 |
-
|
| 734 |
-
|
| 735 |
-
|
|
|
|
|
|
|
| 736 |
|
| 737 |
-
|
| 738 |
-
|
| 739 |
-
|
| 740 |
-
|
| 741 |
-
|
| 742 |
-
|
| 743 |
-
|
| 744 |
-
|
| 745 |
-
</button>
|
| 746 |
-
<button
|
| 747 |
-
on:click={downloadAudio}
|
| 748 |
-
class="p-2 hover:bg-gray-100 rounded-md"
|
| 749 |
-
title="Download"
|
| 750 |
-
>
|
| 751 |
-
<Download size={16} class="text-gray-600" />
|
| 752 |
-
</button>
|
| 753 |
-
<button class="p-2 hover:bg-gray-100 rounded-md" title="More options">
|
| 754 |
-
<MoreHorizontal size={16} class="text-gray-600" />
|
| 755 |
-
</button>
|
| 756 |
</div>
|
|
|
|
| 757 |
</div>
|
| 758 |
-
|
| 759 |
-
<!-- Hidden audio element -->
|
| 760 |
-
{#if audioUrl}
|
| 761 |
-
<audio
|
| 762 |
-
bind:this={audioElement}
|
| 763 |
-
src={audioUrl}
|
| 764 |
-
on:loadedmetadata={handleAudioLoad}
|
| 765 |
-
on:timeupdate={handleTimeUpdate}
|
| 766 |
-
on:play={handlePlay}
|
| 767 |
-
on:pause={handlePause}
|
| 768 |
-
style="display: none;"
|
| 769 |
-
/>
|
| 770 |
-
{/if}
|
| 771 |
</div>
|
| 772 |
-
{/if}
|
| 773 |
-
</div>
|
| 774 |
-
|
| 775 |
-
<!-- Right panel -->
|
| 776 |
-
<div class="w-80 border-l border-gray-200 bg-white p-3 overflow-y-auto">
|
| 777 |
-
<!-- Model selector -->
|
| 778 |
-
<div class="mb-4 relative model-dropdown">
|
| 779 |
-
<h3 class="text-sm font-medium text-gray-900 mb-2">Model</h3>
|
| 780 |
-
<button
|
| 781 |
-
on:click={() => (modelDropdownOpen = !modelDropdownOpen)}
|
| 782 |
-
class="w-full p-2.5 border border-gray-200 rounded-lg bg-white text-xs focus:outline-none focus:ring-2 focus:ring-amber-400 focus:border-transparent appearance-none bg-no-repeat bg-right pr-10 shadow-sm text-left flex items-center justify-between"
|
| 783 |
-
>
|
| 784 |
-
<span>
|
| 785 |
-
{#each models as model}
|
| 786 |
-
{#if model.name === selectedModel}
|
| 787 |
-
{model.name}{#if model.badge} <span class="text-xs text-gray-500"
|
| 788 |
-
>({model.badge})</span
|
| 789 |
-
>{/if}
|
| 790 |
-
{/if}
|
| 791 |
-
{/each}
|
| 792 |
-
</span>
|
| 793 |
-
<ChevronDown size={14} class="text-gray-500" />
|
| 794 |
-
</button>
|
| 795 |
|
| 796 |
-
|
| 797 |
-
|
| 798 |
-
|
| 799 |
-
|
| 800 |
-
{
|
| 801 |
-
|
| 802 |
-
|
| 803 |
-
|
| 804 |
-
|
| 805 |
-
|
| 806 |
-
|
| 807 |
-
if (!model.disabled) {
|
| 808 |
-
selectedModel = model.name;
|
| 809 |
-
modelDropdownOpen = false;
|
| 810 |
-
}
|
| 811 |
-
}}
|
| 812 |
-
>
|
| 813 |
-
{model.name}{#if model.badge} <span class="text-xs text-gray-500"
|
| 814 |
-
>({model.badge})</span
|
| 815 |
-
>{/if}
|
| 816 |
-
</button>
|
| 817 |
-
{/each}
|
| 818 |
-
</div>
|
| 819 |
{/if}
|
| 820 |
-
|
| 821 |
-
<!-- Pricing info -->
|
| 822 |
-
<div class="mt-1.5 text-xs text-gray-500">
|
| 823 |
-
Estimated $0.025 per 1000 characters β’ <a
|
| 824 |
-
href="https://huggingface.co/settings/billing"
|
| 825 |
-
target="_blank"
|
| 826 |
-
class="text-amber-600 hover:text-amber-700 underline">Billing ‴</a
|
| 827 |
-
>
|
| 828 |
-
</div>
|
| 829 |
</div>
|
|
|
|
|
|
|
| 830 |
|
| 831 |
-
|
| 832 |
-
|
| 833 |
-
|
| 834 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 835 |
|
| 836 |
-
|
| 837 |
-
|
|
|
|
|
|
|
|
|
|
| 838 |
<button
|
| 839 |
-
class="w-full
|
| 840 |
-
|
| 841 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 842 |
>
|
| 843 |
-
|
| 844 |
-
|
| 845 |
-
|
| 846 |
-
>
|
| 847 |
-
{voice.name[0]}
|
| 848 |
-
</div>
|
| 849 |
-
<div class="flex-1 min-w-0">
|
| 850 |
-
<div class="text-xs font-medium text-gray-900">{voice.name}</div>
|
| 851 |
-
<div class="text-xs text-gray-500 leading-relaxed">
|
| 852 |
-
{voice.description}
|
| 853 |
-
</div>
|
| 854 |
-
</div>
|
| 855 |
-
</div>
|
| 856 |
-
<button
|
| 857 |
-
on:click={(e) => playSampleVoice(voice, e)}
|
| 858 |
-
class="p-1.5 rounded-full hover:bg-gray-200 transition-colors flex-shrink-0 ml-2 w-7 h-7 flex items-center justify-center"
|
| 859 |
-
title="Play sample"
|
| 860 |
-
>
|
| 861 |
-
{#if playingSampleVoice === voice.name}
|
| 862 |
-
<Pause size={14} class="text-gray-600" />
|
| 863 |
-
{:else}
|
| 864 |
-
<Play size={14} class="text-gray-600" />
|
| 865 |
-
{/if}
|
| 866 |
-
</button>
|
| 867 |
</button>
|
| 868 |
{/each}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 869 |
|
| 870 |
-
|
|
|
|
| 871 |
<button
|
| 872 |
-
class="w-full flex items-center justify-between p-1.5 rounded-lg
|
| 873 |
-
|
|
|
|
| 874 |
>
|
| 875 |
<div class="flex items-center gap-2.5 flex-1 min-w-0">
|
| 876 |
<div
|
| 877 |
-
class="w-8 h-8 bg-
|
| 878 |
>
|
| 879 |
-
|
| 880 |
</div>
|
| 881 |
<div class="flex-1 min-w-0">
|
| 882 |
-
<div class="text-xs font-medium text-gray-
|
| 883 |
-
<div class="text-xs text-gray-
|
|
|
|
|
|
|
| 884 |
</div>
|
| 885 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 886 |
</button>
|
| 887 |
-
|
| 888 |
</div>
|
|
|
|
| 889 |
|
| 890 |
-
|
| 891 |
-
|
| 892 |
-
|
| 893 |
-
|
| 894 |
-
|
| 895 |
-
|
| 896 |
-
|
| 897 |
-
|
| 898 |
-
</div>
|
| 899 |
-
<input
|
| 900 |
-
id="exaggeration-slider"
|
| 901 |
-
type="range"
|
| 902 |
-
bind:value={exaggeration}
|
| 903 |
-
min="0"
|
| 904 |
-
max="1"
|
| 905 |
-
step="0.01"
|
| 906 |
-
class="w-full h-1.5 bg-gray-200 rounded-lg appearance-none cursor-pointer slider-hf"
|
| 907 |
-
/>
|
| 908 |
-
<div class="flex justify-between text-xs text-gray-400 mt-0.5">
|
| 909 |
-
<span>None</span>
|
| 910 |
-
<span>Exaggerated</span>
|
| 911 |
-
</div>
|
| 912 |
</div>
|
| 913 |
-
|
| 914 |
-
|
| 915 |
-
|
| 916 |
-
|
| 917 |
-
|
| 918 |
-
|
| 919 |
-
|
| 920 |
-
|
| 921 |
-
|
| 922 |
-
|
| 923 |
-
|
| 924 |
-
|
| 925 |
-
bind:value={temperature}
|
| 926 |
-
min="0"
|
| 927 |
-
max="1"
|
| 928 |
-
step="0.01"
|
| 929 |
-
class="w-full h-1.5 bg-gray-200 rounded-lg appearance-none cursor-pointer slider-hf"
|
| 930 |
-
/>
|
| 931 |
-
<div class="flex justify-between text-xs text-gray-400 mt-0.5">
|
| 932 |
-
<span>More stable</span>
|
| 933 |
-
<span>More variable</span>
|
| 934 |
-
</div>
|
| 935 |
</div>
|
| 936 |
</div>
|
| 937 |
|
| 938 |
-
<!--
|
| 939 |
-
<div
|
| 940 |
-
<
|
| 941 |
-
|
| 942 |
-
|
| 943 |
-
class="p-2 text-gray-400 hover:text-gray-600 transition-colors"
|
| 944 |
-
title="View on GitHub"
|
| 945 |
-
>
|
| 946 |
-
<svg
|
| 947 |
-
xmlns="http://www.w3.org/2000/svg"
|
| 948 |
-
width="20"
|
| 949 |
-
height="20"
|
| 950 |
-
viewBox="0 0 24 24"
|
| 951 |
-
fill="currentColor"
|
| 952 |
>
|
| 953 |
-
|
| 954 |
-
d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"
|
| 955 |
-
/>
|
| 956 |
-
</svg>
|
| 957 |
-
</a>
|
| 958 |
-
</div>
|
| 959 |
-
</div>
|
| 960 |
-
</div>
|
| 961 |
-
{:else}
|
| 962 |
-
<!-- Code view -->
|
| 963 |
-
<div class="flex-1 bg-gray-50 overflow-y-auto">
|
| 964 |
-
<div class="max-w-4xl mx-auto p-8">
|
| 965 |
-
<!-- Header -->
|
| 966 |
-
<div class="mb-6">
|
| 967 |
-
<div>
|
| 968 |
-
<h2 class="text-2xl font-semibold text-gray-900">Code Recorder</h2>
|
| 969 |
-
<p class="text-sm text-gray-600 mt-1">
|
| 970 |
-
{#if mode === 'local'}
|
| 971 |
-
Python code to reproduce your actions using a local HFStudio server
|
| 972 |
-
{:else}
|
| 973 |
-
Python code to reproduce your actions via the API
|
| 974 |
-
{/if}
|
| 975 |
-
</p>
|
| 976 |
</div>
|
| 977 |
-
|
| 978 |
-
|
| 979 |
-
|
| 980 |
-
|
| 981 |
-
|
| 982 |
-
|
| 983 |
-
|
| 984 |
-
|
| 985 |
-
|
| 986 |
-
|
| 987 |
-
|
| 988 |
-
|
| 989 |
-
</button>
|
| 990 |
-
<button
|
| 991 |
-
class="px-3 py-1 text-sm font-medium rounded transition-colors {mode === 'local'
|
| 992 |
-
? 'bg-white shadow-sm'
|
| 993 |
-
: 'text-gray-600'}"
|
| 994 |
-
on:click={() => (mode = 'local')}
|
| 995 |
-
>
|
| 996 |
-
Local
|
| 997 |
-
</button>
|
| 998 |
-
</div>
|
| 999 |
-
|
| 1000 |
-
{#if codeHistory.length > 0 || setupCode || importCode}
|
| 1001 |
-
<div class="flex items-center gap-2">
|
| 1002 |
-
<button
|
| 1003 |
-
on:click={resetHistory}
|
| 1004 |
-
class="flex items-center bg-red-50 hover:bg-red-100 rounded-md px-3 py-1.5 transition-colors"
|
| 1005 |
-
title="Clear history"
|
| 1006 |
-
>
|
| 1007 |
-
<RotateCcw size={16} class="text-red-600" />
|
| 1008 |
-
<span class="ml-2 text-sm font-medium text-red-600">Reset history</span>
|
| 1009 |
-
</button>
|
| 1010 |
-
<button
|
| 1011 |
-
on:click={copyAllCode}
|
| 1012 |
-
class="flex items-center bg-gray-100 hover:bg-gray-200 rounded-md px-3 py-1.5 transition-colors"
|
| 1013 |
-
>
|
| 1014 |
-
<Copy size={16} class="text-gray-600" />
|
| 1015 |
-
<span class="ml-2 text-sm font-medium text-gray-600">Copy all as Markdown</span>
|
| 1016 |
-
</button>
|
| 1017 |
-
</div>
|
| 1018 |
-
{/if}
|
| 1019 |
</div>
|
| 1020 |
</div>
|
| 1021 |
-
|
| 1022 |
-
<!-- Code sections -->
|
| 1023 |
-
<div class="space-y-6">
|
| 1024 |
-
<!-- Setup Section - Always shown -->
|
| 1025 |
-
{#if setupCode}
|
| 1026 |
-
<div class="bg-white rounded-lg border border-gray-200 overflow-hidden">
|
| 1027 |
-
<div
|
| 1028 |
-
class="flex items-center justify-between px-4 py-2 bg-amber-50 border-b border-amber-200"
|
| 1029 |
-
>
|
| 1030 |
-
<div class="flex items-center gap-2">
|
| 1031 |
-
<span class="text-sm font-medium text-amber-900">Setup (Run in Terminal)</span>
|
| 1032 |
-
<span class="text-xs bg-amber-100 text-amber-700 px-2 py-0.5 rounded"
|
| 1033 |
-
>Run once</span
|
| 1034 |
-
>
|
| 1035 |
-
</div>
|
| 1036 |
-
<button
|
| 1037 |
-
on:click={() => copyToClipboard(setupCode)}
|
| 1038 |
-
class="p-1.5 hover:bg-amber-100 rounded transition-colors"
|
| 1039 |
-
title="Copy setup code"
|
| 1040 |
-
>
|
| 1041 |
-
<Copy size={14} class="text-amber-600" />
|
| 1042 |
-
</button>
|
| 1043 |
-
</div>
|
| 1044 |
-
<div class="relative">
|
| 1045 |
-
{#if setupCode === 'pip install huggingface-hub'}
|
| 1046 |
-
<pre class="p-4 overflow-x-auto bg-gray-50"><code
|
| 1047 |
-
class="language-bash text-sm text-black">{setupCode}</code
|
| 1048 |
-
></pre>
|
| 1049 |
-
{:else}
|
| 1050 |
-
<pre class="p-4 overflow-x-auto bg-gray-50"><code class="language-bash text-sm"
|
| 1051 |
-
>{@html Prism.highlight(setupCode, Prism.languages.bash, 'bash')}</code
|
| 1052 |
-
></pre>
|
| 1053 |
-
{/if}
|
| 1054 |
-
</div>
|
| 1055 |
-
</div>
|
| 1056 |
-
{/if}
|
| 1057 |
-
|
| 1058 |
-
<!-- Import Section -->
|
| 1059 |
-
{#if importCode}
|
| 1060 |
-
<div class="bg-white rounded-lg border border-gray-200 overflow-hidden">
|
| 1061 |
-
<div
|
| 1062 |
-
class="flex items-center justify-between px-4 py-2 bg-blue-50 border-b border-blue-200"
|
| 1063 |
-
>
|
| 1064 |
-
<div class="flex items-center gap-2">
|
| 1065 |
-
<span class="text-sm font-medium text-blue-900">Imports (Python)</span>
|
| 1066 |
-
<span class="text-xs bg-blue-100 text-blue-700 px-2 py-0.5 rounded">Run once</span
|
| 1067 |
-
>
|
| 1068 |
-
</div>
|
| 1069 |
-
<button
|
| 1070 |
-
on:click={() => copyToClipboard(importCode)}
|
| 1071 |
-
class="p-1.5 hover:bg-blue-100 rounded transition-colors"
|
| 1072 |
-
title="Copy import code"
|
| 1073 |
-
>
|
| 1074 |
-
<Copy size={14} class="text-blue-600" />
|
| 1075 |
-
</button>
|
| 1076 |
-
</div>
|
| 1077 |
-
<div class="relative">
|
| 1078 |
-
<pre class="p-4 overflow-x-auto bg-gray-50"><code class="language-python text-sm"
|
| 1079 |
-
>{@html Prism.highlight(importCode, Prism.languages.python, 'python')}</code
|
| 1080 |
-
></pre>
|
| 1081 |
-
</div>
|
| 1082 |
-
</div>
|
| 1083 |
-
{/if}
|
| 1084 |
-
|
| 1085 |
-
<!-- Show "start using UI" message when no import code or history -->
|
| 1086 |
-
{#if !importCode && codeHistory.length === 0}
|
| 1087 |
-
<div class="bg-white rounded-lg border border-gray-200 p-8 text-center">
|
| 1088 |
-
<p class="text-gray-500">Start using the UI to see generated code here</p>
|
| 1089 |
-
</div>
|
| 1090 |
-
{/if}
|
| 1091 |
-
|
| 1092 |
-
<!-- History entries -->
|
| 1093 |
-
{#each codeHistory as entry, i (entry.id)}
|
| 1094 |
-
<div class="bg-white rounded-lg border border-gray-200 overflow-hidden shadow-sm">
|
| 1095 |
-
<!-- Code cell -->
|
| 1096 |
-
<div class="border-b border-gray-200">
|
| 1097 |
-
<div
|
| 1098 |
-
class="flex items-center justify-between px-4 py-2 bg-gray-50 border-b border-gray-100"
|
| 1099 |
-
>
|
| 1100 |
-
<span class="text-sm font-medium text-gray-700">Cell {i + 1}</span>
|
| 1101 |
-
<button
|
| 1102 |
-
on:click={() => copyToClipboard(entry.code)}
|
| 1103 |
-
class="p-1.5 hover:bg-gray-200 rounded transition-colors"
|
| 1104 |
-
title="Copy code"
|
| 1105 |
-
>
|
| 1106 |
-
<Copy size={14} class="text-gray-600" />
|
| 1107 |
-
</button>
|
| 1108 |
-
</div>
|
| 1109 |
-
<div class="relative">
|
| 1110 |
-
<pre class="p-4 overflow-x-auto bg-gray-50"><code class="language-python text-sm"
|
| 1111 |
-
>{@html Prism.highlight(entry.code, Prism.languages.python, 'python')}</code
|
| 1112 |
-
></pre>
|
| 1113 |
-
</div>
|
| 1114 |
-
</div>
|
| 1115 |
-
|
| 1116 |
-
<!-- Result (audio player) -->
|
| 1117 |
-
{#if entry.result && entry.result.type === 'audio'}
|
| 1118 |
-
<div class="bg-gradient-to-b from-gray-50 to-white p-4">
|
| 1119 |
-
<div class="bg-white rounded-lg border border-gray-200 p-4 shadow-sm">
|
| 1120 |
-
<div class="flex items-center justify-between">
|
| 1121 |
-
<div class="flex items-center gap-3 flex-1">
|
| 1122 |
-
<button
|
| 1123 |
-
on:click={() => toggleHistoryAudio(entry)}
|
| 1124 |
-
class="w-10 h-10 bg-gradient-to-r from-amber-500 to-orange-500 rounded-full flex items-center justify-center text-white hover:from-amber-600 hover:to-orange-600 transition-colors shadow-md"
|
| 1125 |
-
>
|
| 1126 |
-
{#if entry.isPlaying}
|
| 1127 |
-
<Pause size={18} />
|
| 1128 |
-
{:else}
|
| 1129 |
-
<Play size={18} class="ml-0.5" />
|
| 1130 |
-
{/if}
|
| 1131 |
-
</button>
|
| 1132 |
-
<div class="flex-1">
|
| 1133 |
-
<div class="text-sm font-medium text-gray-900 truncate">
|
| 1134 |
-
{entry.result.title || 'Generated Audio'}
|
| 1135 |
-
</div>
|
| 1136 |
-
<div class="text-xs text-gray-500">
|
| 1137 |
-
Duration: {formatDuration(entry.result.duration || 0)}
|
| 1138 |
-
</div>
|
| 1139 |
-
</div>
|
| 1140 |
-
</div>
|
| 1141 |
-
<div class="flex items-center gap-1">
|
| 1142 |
-
<button
|
| 1143 |
-
on:click={() =>
|
| 1144 |
-
downloadHistoryAudio(entry.result.url, entry.result.title)}
|
| 1145 |
-
class="p-2 hover:bg-gray-100 rounded-lg transition-colors"
|
| 1146 |
-
title="Download"
|
| 1147 |
-
>
|
| 1148 |
-
<Download size={16} class="text-gray-600" />
|
| 1149 |
-
</button>
|
| 1150 |
-
<button
|
| 1151 |
-
class="p-2 hover:bg-gray-100 rounded-lg transition-colors"
|
| 1152 |
-
title="Share"
|
| 1153 |
-
>
|
| 1154 |
-
<Share size={16} class="text-gray-600" />
|
| 1155 |
-
</button>
|
| 1156 |
-
</div>
|
| 1157 |
-
</div>
|
| 1158 |
-
<audio
|
| 1159 |
-
bind:this={entry.audioElement}
|
| 1160 |
-
src={entry.result.url}
|
| 1161 |
-
on:ended={() => (entry.isPlaying = false)}
|
| 1162 |
-
class="hidden"
|
| 1163 |
-
/>
|
| 1164 |
-
</div>
|
| 1165 |
-
</div>
|
| 1166 |
-
{/if}
|
| 1167 |
-
</div>
|
| 1168 |
-
{/each}
|
| 1169 |
-
</div>
|
| 1170 |
</div>
|
| 1171 |
-
</div>
|
| 1172 |
-
{/if}
|
| 1173 |
|
| 1174 |
-
|
| 1175 |
-
|
| 1176 |
-
|
| 1177 |
-
|
| 1178 |
-
|
| 1179 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1180 |
</div>
|
| 1181 |
-
|
|
|
|
| 1182 |
|
| 1183 |
-
|
| 1184 |
-
|
| 1185 |
-
|
| 1186 |
-
|
| 1187 |
-
|
| 1188 |
-
|
| 1189 |
-
|
| 1190 |
-
|
| 1191 |
-
|
| 1192 |
-
|
| 1193 |
-
|
| 1194 |
-
>
|
| 1195 |
-
<AlertCircle size={20} class="text-red-600" />
|
| 1196 |
-
</div>
|
| 1197 |
-
<div class="min-w-0">
|
| 1198 |
-
<h3 class="text-lg font-semibold text-gray-900 truncate">{errorMessage}</h3>
|
| 1199 |
-
<p class="text-sm text-gray-600">An error occurred while processing your request</p>
|
| 1200 |
-
</div>
|
| 1201 |
-
</div>
|
| 1202 |
-
<button
|
| 1203 |
-
on:click={closeErrorModal}
|
| 1204 |
-
class="p-2 hover:bg-red-100 rounded-full transition-colors flex-shrink-0"
|
| 1205 |
-
title="Close"
|
| 1206 |
>
|
| 1207 |
-
<
|
| 1208 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1209 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1210 |
|
| 1211 |
-
|
| 1212 |
-
|
| 1213 |
-
|
| 1214 |
-
|
| 1215 |
-
|
| 1216 |
-
|
| 1217 |
-
|
| 1218 |
-
|
| 1219 |
-
|
| 1220 |
-
|
| 1221 |
-
|
| 1222 |
-
|
| 1223 |
-
|
| 1224 |
|
| 1225 |
-
|
| 1226 |
-
|
| 1227 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1228 |
>
|
| 1229 |
-
|
| 1230 |
-
|
| 1231 |
-
class="flex items-center gap-2 px-4 py-2 text-gray-700 hover:bg-gray-200 rounded-lg transition-colors"
|
| 1232 |
-
>
|
| 1233 |
-
<Copy size={16} />
|
| 1234 |
-
Copy Error
|
| 1235 |
-
</button>
|
| 1236 |
-
<button
|
| 1237 |
-
on:click={closeErrorModal}
|
| 1238 |
-
class="px-6 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors"
|
| 1239 |
-
>
|
| 1240 |
-
Close
|
| 1241 |
-
</button>
|
| 1242 |
-
</div>
|
| 1243 |
</div>
|
| 1244 |
</div>
|
| 1245 |
-
|
| 1246 |
-
|
| 1247 |
|
| 1248 |
<style>
|
| 1249 |
-
|
| 1250 |
-
|
| 1251 |
-
|
| 1252 |
-
|
| 1253 |
-
|
| 1254 |
-
|
| 1255 |
-
|
| 1256 |
-
|
| 1257 |
-
|
| 1258 |
-
|
| 1259 |
-
|
| 1260 |
-
|
| 1261 |
-
|
| 1262 |
-
|
| 1263 |
-
|
| 1264 |
-
|
| 1265 |
-
|
| 1266 |
-
left: -100%;
|
| 1267 |
-
}
|
| 1268 |
-
20% {
|
| 1269 |
-
left: -100%;
|
| 1270 |
-
}
|
| 1271 |
-
80% {
|
| 1272 |
-
left: 100%;
|
| 1273 |
-
}
|
| 1274 |
-
100% {
|
| 1275 |
-
left: 100%;
|
| 1276 |
-
}
|
| 1277 |
-
}
|
| 1278 |
-
|
| 1279 |
-
@keyframes pulse {
|
| 1280 |
-
0% {
|
| 1281 |
-
box-shadow: 0 0 0 0 rgba(251, 191, 36, 0);
|
| 1282 |
-
}
|
| 1283 |
-
50% {
|
| 1284 |
-
box-shadow: 0 0 0 6px rgba(251, 191, 36, 0.4);
|
| 1285 |
-
}
|
| 1286 |
-
100% {
|
| 1287 |
-
box-shadow: 0 0 0 0 rgba(251, 191, 36, 0);
|
| 1288 |
-
}
|
| 1289 |
-
}
|
| 1290 |
-
</style>
|
|
|
|
| 6 |
AlertCircle,
|
| 7 |
ChevronDown,
|
| 8 |
Copy,
|
|
|
|
| 9 |
Share,
|
| 10 |
MoreHorizontal,
|
| 11 |
Shuffle,
|
|
|
|
|
|
|
| 12 |
Pause,
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
X,
|
| 14 |
+
Code,
|
| 15 |
+
Layout,
|
| 16 |
} from 'lucide-svelte';
|
| 17 |
import { onMount } from 'svelte';
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
+
let text = `In a hole in the ground, there lived a hobbit. Not a nasty, dirty, wet hole, filled with the ends of worms and an oozy smell, nor yet a dry, bare, sandy hole with nothing in it to sit down on or to eat: it was a hobbit-hole, and that means comfort.`;
|
| 20 |
let selectedVoice = 'Andrew';
|
| 21 |
let selectedModel = 'Chatterbox';
|
|
|
|
|
|
|
| 22 |
let modelDropdownOpen = false;
|
| 23 |
let isGenerating = false;
|
|
|
|
|
|
|
|
|
|
| 24 |
let audioUrl = null;
|
|
|
|
| 25 |
let exaggeration = 0.25;
|
| 26 |
let temperature = 0.7;
|
|
|
|
| 27 |
let isPlaying = false;
|
| 28 |
let currentTime = 0;
|
| 29 |
let duration = 0;
|
|
|
|
| 34 |
let showErrorModal = false;
|
| 35 |
let errorMessage = '';
|
| 36 |
let errorDetails = '';
|
| 37 |
+
let historyCount = 0;
|
| 38 |
|
| 39 |
const famousBookOpeners = [
|
| 40 |
'It was the best of times, it was the worst of times. It was the age of wisdom, it was the age of foolishness.',
|
|
|
|
| 86 |
async function generateSpeech() {
|
| 87 |
if (!text.trim()) return;
|
| 88 |
|
|
|
|
| 89 |
const response = await fetch('/api/auth/user', { credentials: 'include' });
|
| 90 |
if (!response.ok) {
|
| 91 |
window.dispatchEvent(new CustomEvent('show-login-prompt'));
|
|
|
|
| 95 |
isGenerating = true;
|
| 96 |
audioUrl = null;
|
| 97 |
currentTime = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
isPlaying = false;
|
|
|
|
| 99 |
audioTitle = text.length > 30 ? text.substring(0, 30) + '...' : text;
|
| 100 |
|
| 101 |
try {
|
|
|
|
| 103 |
text: text,
|
| 104 |
voice_id: selectedVoice.toLowerCase(),
|
| 105 |
model_id: selectedModel.toLowerCase(),
|
| 106 |
+
mode: 'api',
|
| 107 |
parameters: {
|
| 108 |
exaggeration: exaggeration,
|
| 109 |
temperature: temperature,
|
|
|
|
| 115 |
headers: {
|
| 116 |
'Content-Type': 'application/json',
|
| 117 |
},
|
| 118 |
+
credentials: 'include',
|
| 119 |
body: JSON.stringify(requestBody),
|
| 120 |
});
|
| 121 |
|
|
|
|
| 129 |
if (result.success && result.audio_url) {
|
| 130 |
audioUrl = result.audio_url;
|
| 131 |
|
| 132 |
+
// Save to code recorder history
|
| 133 |
+
await saveToHistory(requestBody, result);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
|
| 135 |
+
setTimeout(() => {
|
| 136 |
+
if (audioElement) {
|
| 137 |
+
audioElement.play().catch(() => {
|
| 138 |
+
// Ignore autoplay failures
|
| 139 |
+
});
|
| 140 |
+
}
|
| 141 |
+
}, 100);
|
|
|
|
|
|
|
|
|
|
| 142 |
} else {
|
| 143 |
const errorMessage = result.error || 'Unknown error occurred';
|
| 144 |
showError('Generation Failed', errorMessage);
|
|
|
|
| 155 |
}
|
| 156 |
}
|
| 157 |
|
|
|
|
|
|
|
| 158 |
function togglePlayPause() {
|
| 159 |
if (audioElement) {
|
| 160 |
if (isPlaying) {
|
|
|
|
| 247 |
}
|
| 248 |
}
|
| 249 |
|
| 250 |
+
function showError(message, details = '') {
|
| 251 |
+
errorMessage = message;
|
| 252 |
+
errorDetails = details;
|
| 253 |
+
showErrorModal = true;
|
| 254 |
+
}
|
| 255 |
+
|
| 256 |
+
function closeErrorModal() {
|
| 257 |
+
showErrorModal = false;
|
| 258 |
+
errorMessage = '';
|
| 259 |
+
errorDetails = '';
|
| 260 |
+
}
|
| 261 |
|
| 262 |
+
function refreshText() {
|
| 263 |
+
currentBookIndex = (currentBookIndex + 1) % famousBookOpeners.length;
|
| 264 |
+
text = famousBookOpeners[currentBookIndex];
|
| 265 |
+
}
|
| 266 |
+
|
| 267 |
+
async function saveToHistory(requestBody, result) {
|
| 268 |
try {
|
| 269 |
+
const pythonCode = `# Generate speech
|
| 270 |
+
client.text_to_speech(
|
| 271 |
+
text="${requestBody.text.replace(/"/g, '\\"')}",
|
| 272 |
+
voice_id="${requestBody.voice_id}",
|
| 273 |
+
model_id="${requestBody.model_id}",
|
| 274 |
+
exaggeration=${requestBody.parameters.exaggeration},
|
| 275 |
+
temperature=${requestBody.parameters.temperature}
|
| 276 |
+
)`;
|
| 277 |
+
|
| 278 |
await fetch('/api/history/save', {
|
| 279 |
method: 'POST',
|
| 280 |
+
headers: { 'Content-Type': 'application/json' },
|
|
|
|
|
|
|
| 281 |
credentials: 'include',
|
| 282 |
body: JSON.stringify({
|
| 283 |
+
code: pythonCode,
|
| 284 |
+
result_type: 'audio',
|
| 285 |
+
result_data: {
|
| 286 |
+
url: result.audio_url,
|
| 287 |
+
title: audioTitle,
|
| 288 |
+
type: 'audio'
|
| 289 |
+
},
|
| 290 |
+
entry_type: 'generation'
|
| 291 |
+
})
|
| 292 |
});
|
| 293 |
+
|
| 294 |
+
// Update history count
|
| 295 |
+
await loadHistoryCount();
|
| 296 |
} catch (error) {
|
| 297 |
+
console.error('Error saving to history:', error);
|
| 298 |
}
|
|
|
|
|
|
|
| 299 |
}
|
| 300 |
|
| 301 |
+
async function loadHistoryCount() {
|
| 302 |
try {
|
| 303 |
const response = await fetch('/api/history/load', {
|
| 304 |
method: 'GET',
|
|
|
|
| 307 |
|
| 308 |
if (response.ok) {
|
| 309 |
const data = await response.json();
|
|
|
|
|
|
|
|
|
|
| 310 |
const generationEntries = data.entries.filter((e) => e.entry_type === 'generation');
|
| 311 |
+
historyCount = generationEntries.length;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 312 |
}
|
| 313 |
} catch (error) {
|
| 314 |
+
console.error('Error loading history count:', error);
|
| 315 |
+
historyCount = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 316 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 317 |
}
|
| 318 |
|
| 319 |
onMount(async () => {
|
| 320 |
+
await loadHistoryCount();
|
| 321 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 322 |
</script>
|
| 323 |
|
| 324 |
+
<svelte:head>
|
| 325 |
+
<title>Text to Speech - HFStudio</title>
|
| 326 |
+
</svelte:head>
|
| 327 |
+
|
| 328 |
<div class="flex flex-col h-full" on:click={handleClickOutside}>
|
| 329 |
+
<!-- Top navbar -->
|
| 330 |
+
<div class="flex items-center justify-end px-4 py-4 border-b border-gray-200 min-h-[73px]">
|
| 331 |
+
<a
|
| 332 |
+
href="/code-recorder"
|
| 333 |
+
class="px-3 py-1.5 text-sm font-medium rounded transition-colors text-gray-600 hover:bg-gray-50 flex items-center gap-1 bg-gray-100"
|
| 334 |
+
>
|
| 335 |
+
<Code size={14} />
|
| 336 |
+
Code Recorder
|
| 337 |
+
{#if historyCount > 0}
|
| 338 |
+
<span class="ml-1 px-1.5 py-0.5 bg-gray-500 text-white text-xs rounded-full min-w-[18px] text-center">
|
| 339 |
+
{historyCount}
|
| 340 |
+
</span>
|
| 341 |
+
{/if}
|
| 342 |
+
</a>
|
| 343 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 344 |
|
| 345 |
<!-- Main content area -->
|
| 346 |
+
<div class="flex-1 flex">
|
| 347 |
+
<!-- Main content area -->
|
| 348 |
+
<div class="flex-1 flex flex-col p-6 relative">
|
| 349 |
+
<!-- Text input area -->
|
| 350 |
+
<div class="flex-1 relative">
|
| 351 |
+
<div class="absolute -top-2 right-0 flex items-center gap-2 z-10">
|
| 352 |
+
<span class="text-sm text-gray-400">
|
| 353 |
+
{text.length.toLocaleString()} / 1,000 characters
|
| 354 |
+
</span>
|
| 355 |
<button
|
| 356 |
on:click={refreshText}
|
| 357 |
+
class="p-1 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-lg transition-colors"
|
| 358 |
title="Refresh with famous book opening"
|
| 359 |
>
|
| 360 |
<Shuffle size={16} />
|
| 361 |
</button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 362 |
</div>
|
| 363 |
+
<textarea
|
| 364 |
+
bind:value={text}
|
| 365 |
+
maxlength="1000"
|
| 366 |
+
class="w-full h-full p-6 bg-white resize-none border-0 focus:outline-none text-gray-900 text-base leading-relaxed"
|
| 367 |
+
placeholder="Type the text you'd like to convert to spoken audio here..."
|
| 368 |
+
autofocus
|
| 369 |
+
on:keydown={handleKeyDown}
|
| 370 |
+
/>
|
| 371 |
+
</div>
|
| 372 |
|
| 373 |
+
<!-- Generate button at bottom -->
|
| 374 |
+
<div class="absolute bottom-4 left-0 right-0 px-2">
|
| 375 |
+
<button
|
| 376 |
+
on:click={generateSpeech}
|
| 377 |
+
disabled={isGenerating || !text.trim()}
|
| 378 |
+
class="w-full px-6 py-3 bg-gradient-to-r from-amber-400 to-orange-500 text-white rounded-lg font-medium hover:from-amber-500 hover:to-orange-600 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2 shadow-sm"
|
| 379 |
+
>
|
| 380 |
+
{#if isGenerating}
|
| 381 |
+
<Loader2 size={20} class="animate-spin" />
|
| 382 |
+
Generating...
|
| 383 |
+
{:else}
|
| 384 |
+
<Play size={20} />
|
| 385 |
+
Generate speech
|
| 386 |
+
{/if}
|
| 387 |
+
</button>
|
| 388 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 389 |
|
| 390 |
+
<!-- Generated audio section -->
|
| 391 |
+
{#if audioUrl}
|
| 392 |
+
<div class="p-4 border border-gray-200 rounded-lg bg-white mb-6">
|
| 393 |
+
<!-- Audio title and voice info -->
|
| 394 |
+
<div class="flex items-center gap-3 mb-4">
|
| 395 |
+
<div class="w-2 h-2 bg-green-500 rounded-full"></div>
|
| 396 |
+
<div class="flex-1">
|
| 397 |
+
<h3 class="font-medium text-gray-900 text-sm">{audioTitle}</h3>
|
| 398 |
+
<p class="text-xs text-gray-500">{selectedVoice} β’ Created 1 second ago</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 399 |
</div>
|
| 400 |
+
<!-- Mini action buttons -->
|
| 401 |
+
<div class="flex items-center gap-2">
|
|
|
|
|
|
|
| 402 |
<button
|
| 403 |
+
on:click={shareAudio}
|
| 404 |
+
class="flex items-center gap-1.5 px-3 py-1.5 text-sm border border-gray-200 rounded-md hover:bg-gray-50 transition-colors"
|
| 405 |
>
|
| 406 |
+
<Share size={14} class="text-gray-600" />
|
| 407 |
+
<span class="text-gray-700">Share</span>
|
|
|
|
|
|
|
|
|
|
| 408 |
</button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 409 |
<button
|
| 410 |
+
on:click={downloadAudio}
|
| 411 |
+
class="flex items-center gap-1.5 px-3 py-1.5 text-sm border border-gray-200 rounded-md hover:bg-gray-50 transition-colors"
|
| 412 |
>
|
| 413 |
+
<span class="text-gray-700">Download</span>
|
| 414 |
+
<Download size={14} class="text-gray-600" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 415 |
</button>
|
| 416 |
+
</div>
|
| 417 |
+
</div>
|
| 418 |
|
| 419 |
+
<!-- Mini audio controls -->
|
| 420 |
+
<div class="flex items-center gap-3 mb-4">
|
| 421 |
+
<!-- Play/Pause button -->
|
| 422 |
+
<button
|
| 423 |
+
on:click={togglePlayPause}
|
| 424 |
+
class="w-8 h-8 bg-black rounded-full flex items-center justify-center hover:bg-gray-800 transition-colors"
|
| 425 |
+
>
|
| 426 |
+
{#if isPlaying}
|
| 427 |
+
<div class="pause-filled text-white"></div>
|
| 428 |
+
{:else}
|
| 429 |
+
<Play size={14} class="text-white ml-0.5" />
|
| 430 |
+
{/if}
|
| 431 |
+
</button>
|
| 432 |
|
| 433 |
+
<!-- Progress bar -->
|
| 434 |
+
<div class="flex-1 flex items-center gap-2">
|
| 435 |
+
<span class="text-xs text-gray-500 font-mono">{formatTime(currentTime)}</span>
|
| 436 |
+
<div class="flex-1 h-1 bg-gray-200 rounded-full cursor-pointer">
|
| 437 |
+
<div
|
| 438 |
+
class="h-full bg-gradient-to-r from-amber-400 to-orange-500 rounded-full transition-all"
|
| 439 |
+
style="width: {(currentTime / duration) * 100}%"
|
| 440 |
+
></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 441 |
</div>
|
| 442 |
+
<span class="text-xs text-gray-500 font-mono">{formatTime(duration)}</span>
|
| 443 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 444 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 445 |
|
| 446 |
+
<!-- Hidden audio element -->
|
| 447 |
+
{#if audioUrl}
|
| 448 |
+
<audio
|
| 449 |
+
bind:this={audioElement}
|
| 450 |
+
src={audioUrl}
|
| 451 |
+
on:loadedmetadata={handleAudioLoad}
|
| 452 |
+
on:timeupdate={handleTimeUpdate}
|
| 453 |
+
on:play={handlePlay}
|
| 454 |
+
on:pause={handlePause}
|
| 455 |
+
style="display: none;"
|
| 456 |
+
/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 457 |
{/if}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 458 |
</div>
|
| 459 |
+
{/if}
|
| 460 |
+
</div>
|
| 461 |
|
| 462 |
+
<!-- Right panel -->
|
| 463 |
+
<div class="w-80 border-l border-gray-200 bg-white p-3 overflow-y-auto">
|
| 464 |
+
<!-- Model selector -->
|
| 465 |
+
<div class="mb-4 relative model-dropdown">
|
| 466 |
+
<h3 class="text-sm font-medium text-gray-900 mb-2">Model</h3>
|
| 467 |
+
<button
|
| 468 |
+
on:click={() => (modelDropdownOpen = !modelDropdownOpen)}
|
| 469 |
+
class="w-full p-2.5 border border-gray-200 rounded-lg bg-white text-xs focus:outline-none focus:ring-2 focus:ring-amber-400 focus:border-transparent appearance-none bg-no-repeat bg-right pr-10 shadow-sm text-left flex items-center justify-between"
|
| 470 |
+
>
|
| 471 |
+
<span>
|
| 472 |
+
{#each models as model}
|
| 473 |
+
{#if model.name === selectedModel}
|
| 474 |
+
{model.name}{#if model.badge} <span class="text-xs text-gray-500"
|
| 475 |
+
>({model.badge})</span
|
| 476 |
+
>{/if}
|
| 477 |
+
{/if}
|
| 478 |
+
{/each}
|
| 479 |
+
</span>
|
| 480 |
+
<ChevronDown size={14} class="text-gray-500" />
|
| 481 |
+
</button>
|
| 482 |
|
| 483 |
+
{#if modelDropdownOpen}
|
| 484 |
+
<div
|
| 485 |
+
class="absolute top-full left-0 right-0 mt-1 bg-white border border-gray-200 rounded-lg shadow-lg z-10"
|
| 486 |
+
>
|
| 487 |
+
{#each models as model}
|
| 488 |
<button
|
| 489 |
+
class="w-full px-3 py-1.5 text-left transition-colors text-xs {model.disabled
|
| 490 |
+
? 'opacity-50 cursor-not-allowed'
|
| 491 |
+
: 'hover:bg-gray-50'} {model.name === selectedModel ? 'bg-gray-100' : ''}"
|
| 492 |
+
disabled={model.disabled}
|
| 493 |
+
on:click={() => {
|
| 494 |
+
if (!model.disabled) {
|
| 495 |
+
selectedModel = model.name;
|
| 496 |
+
modelDropdownOpen = false;
|
| 497 |
+
}
|
| 498 |
+
}}
|
| 499 |
>
|
| 500 |
+
{model.name}{#if model.badge} <span class="text-xs text-gray-500"
|
| 501 |
+
>({model.badge})</span
|
| 502 |
+
>{/if}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 503 |
</button>
|
| 504 |
{/each}
|
| 505 |
+
</div>
|
| 506 |
+
{/if}
|
| 507 |
+
|
| 508 |
+
<!-- Pricing info -->
|
| 509 |
+
<div class="mt-1.5 text-xs text-gray-500">
|
| 510 |
+
Estimated $0.025 per 1000 characters β’ <a
|
| 511 |
+
href="https://huggingface.co/settings/billing"
|
| 512 |
+
target="_blank"
|
| 513 |
+
class="text-amber-600 hover:text-amber-700 underline">Billing ‴</a
|
| 514 |
+
>
|
| 515 |
+
</div>
|
| 516 |
+
</div>
|
| 517 |
+
|
| 518 |
+
<div class="mb-4">
|
| 519 |
+
<div class="mb-2">
|
| 520 |
+
<h3 class="text-sm font-medium text-gray-900">Voice</h3>
|
| 521 |
+
</div>
|
| 522 |
|
| 523 |
+
<div class="space-y-1.5">
|
| 524 |
+
{#each voices as voice}
|
| 525 |
<button
|
| 526 |
+
class="w-full flex items-center justify-between p-1.5 rounded-lg hover:bg-gray-50 transition-colors text-left group border border-transparent
|
| 527 |
+
{voice.name === selectedVoice ? 'bg-gray-100 border-gray-200' : ''}"
|
| 528 |
+
on:click={() => (selectedVoice = voice.name)}
|
| 529 |
>
|
| 530 |
<div class="flex items-center gap-2.5 flex-1 min-w-0">
|
| 531 |
<div
|
| 532 |
+
class="w-8 h-8 bg-gradient-to-br from-amber-400 to-orange-500 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0"
|
| 533 |
>
|
| 534 |
+
{voice.name[0]}
|
| 535 |
</div>
|
| 536 |
<div class="flex-1 min-w-0">
|
| 537 |
+
<div class="text-xs font-medium text-gray-900">{voice.name}</div>
|
| 538 |
+
<div class="text-xs text-gray-500 leading-relaxed">
|
| 539 |
+
{voice.description}
|
| 540 |
+
</div>
|
| 541 |
</div>
|
| 542 |
</div>
|
| 543 |
+
<button
|
| 544 |
+
on:click={(e) => playSampleVoice(voice, e)}
|
| 545 |
+
class="p-1.5 rounded-full hover:bg-gray-200 transition-colors flex-shrink-0 ml-2 w-7 h-7 flex items-center justify-center"
|
| 546 |
+
title="Play sample"
|
| 547 |
+
>
|
| 548 |
+
{#if playingSampleVoice === voice.name}
|
| 549 |
+
<Pause size={14} class="text-gray-600" />
|
| 550 |
+
{:else}
|
| 551 |
+
<Play size={14} class="text-gray-600" />
|
| 552 |
+
{/if}
|
| 553 |
+
</button>
|
| 554 |
</button>
|
| 555 |
+
{/each}
|
| 556 |
</div>
|
| 557 |
+
</div>
|
| 558 |
|
| 559 |
+
<div class="space-y-3 pt-3 border-t border-gray-200">
|
| 560 |
+
<!-- Exaggeration control -->
|
| 561 |
+
<div>
|
| 562 |
+
<div class="flex justify-between mb-0.5">
|
| 563 |
+
<label for="exaggeration-slider" class="text-xs font-medium text-gray-700"
|
| 564 |
+
>Exaggeration</label
|
| 565 |
+
>
|
| 566 |
+
<span class="text-xs text-gray-500">{exaggeration.toFixed(2)}</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 567 |
</div>
|
| 568 |
+
<input
|
| 569 |
+
id="exaggeration-slider"
|
| 570 |
+
type="range"
|
| 571 |
+
bind:value={exaggeration}
|
| 572 |
+
min="0"
|
| 573 |
+
max="1"
|
| 574 |
+
step="0.01"
|
| 575 |
+
class="w-full h-1.5 bg-gray-200 rounded-lg appearance-none cursor-pointer slider-hf"
|
| 576 |
+
/>
|
| 577 |
+
<div class="flex justify-between text-xs text-gray-400 mt-0.5">
|
| 578 |
+
<span>None</span>
|
| 579 |
+
<span>Exaggerated</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 580 |
</div>
|
| 581 |
</div>
|
| 582 |
|
| 583 |
+
<!-- Stability control -->
|
| 584 |
+
<div>
|
| 585 |
+
<div class="flex justify-between mb-0.5">
|
| 586 |
+
<label for="temperature-slider" class="text-xs font-medium text-gray-700"
|
| 587 |
+
>Stability</label
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 588 |
>
|
| 589 |
+
<span class="text-xs text-gray-500">{temperature.toFixed(2)}</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 590 |
</div>
|
| 591 |
+
<input
|
| 592 |
+
id="temperature-slider"
|
| 593 |
+
type="range"
|
| 594 |
+
bind:value={temperature}
|
| 595 |
+
min="0"
|
| 596 |
+
max="1"
|
| 597 |
+
step="0.01"
|
| 598 |
+
class="w-full h-1.5 bg-gray-200 rounded-lg appearance-none cursor-pointer slider-hf"
|
| 599 |
+
/>
|
| 600 |
+
<div class="flex justify-between text-xs text-gray-400 mt-0.5">
|
| 601 |
+
<span>More stable</span>
|
| 602 |
+
<span>More variable</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 603 |
</div>
|
| 604 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 605 |
</div>
|
|
|
|
|
|
|
| 606 |
|
| 607 |
+
<!-- GitHub link at bottom -->
|
| 608 |
+
<div class="mt-auto pt-3 flex justify-end">
|
| 609 |
+
<a
|
| 610 |
+
href="https://github.com/gradio-app/hfstudio"
|
| 611 |
+
target="_blank"
|
| 612 |
+
class="p-2 text-gray-400 hover:text-gray-600 transition-colors"
|
| 613 |
+
title="View on GitHub"
|
| 614 |
+
>
|
| 615 |
+
<svg
|
| 616 |
+
xmlns="http://www.w3.org/2000/svg"
|
| 617 |
+
width="20"
|
| 618 |
+
height="20"
|
| 619 |
+
viewBox="0 0 24 24"
|
| 620 |
+
fill="currentColor"
|
| 621 |
+
>
|
| 622 |
+
<path
|
| 623 |
+
d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"
|
| 624 |
+
/>
|
| 625 |
+
</svg>
|
| 626 |
+
</a>
|
| 627 |
+
</div>
|
| 628 |
</div>
|
| 629 |
+
</div>
|
| 630 |
+
</div>
|
| 631 |
|
| 632 |
+
<!-- Error Modal -->
|
| 633 |
+
{#if showErrorModal}
|
| 634 |
+
<div class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4">
|
| 635 |
+
<div class="bg-white rounded-xl shadow-2xl max-w-2xl w-full max-h-[80vh] flex flex-col">
|
| 636 |
+
<!-- Header -->
|
| 637 |
+
<div
|
| 638 |
+
class="flex items-center justify-between p-6 border-b border-gray-200 bg-red-50 flex-shrink-0"
|
| 639 |
+
>
|
| 640 |
+
<div class="flex items-center gap-3 min-w-0">
|
| 641 |
+
<div
|
| 642 |
+
class="w-10 h-10 bg-red-100 rounded-full flex items-center justify-center flex-shrink-0"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 643 |
>
|
| 644 |
+
<AlertCircle size={20} class="text-red-600" />
|
| 645 |
+
</div>
|
| 646 |
+
<div class="min-w-0">
|
| 647 |
+
<h3 class="text-lg font-semibold text-gray-900 truncate">{errorMessage}</h3>
|
| 648 |
+
<p class="text-sm text-gray-600">An error occurred while processing your request</p>
|
| 649 |
+
</div>
|
| 650 |
</div>
|
| 651 |
+
<button
|
| 652 |
+
on:click={closeErrorModal}
|
| 653 |
+
class="p-2 hover:bg-red-100 rounded-full transition-colors flex-shrink-0"
|
| 654 |
+
title="Close"
|
| 655 |
+
>
|
| 656 |
+
<X size={20} class="text-gray-500" />
|
| 657 |
+
</button>
|
| 658 |
+
</div>
|
| 659 |
|
| 660 |
+
<!-- Content -->
|
| 661 |
+
<div class="p-6 overflow-y-auto flex-1 min-h-0">
|
| 662 |
+
{#if errorDetails}
|
| 663 |
+
<div class="bg-gray-50 rounded-lg p-4 border">
|
| 664 |
+
<h4 class="text-sm font-medium text-gray-900 mb-2">Error Details:</h4>
|
| 665 |
+
<pre
|
| 666 |
+
class="text-xs text-gray-700 whitespace-pre-wrap font-mono leading-relaxed break-words">{#if errorDetails.includes('exceeded your monthly included credits')}{@html errorDetails.replace(
|
| 667 |
+
'Subscribe to PRO',
|
| 668 |
+
'<a href="https://huggingface.co/settings/billing" target="_blank" class="text-amber-600 hover:text-amber-700 underline font-medium">Subscribe to PRO</a>'
|
| 669 |
+
)}{:else}{errorDetails}{/if}</pre>
|
| 670 |
+
</div>
|
| 671 |
+
{/if}
|
| 672 |
+
</div>
|
| 673 |
|
| 674 |
+
<!-- Footer -->
|
| 675 |
+
<div
|
| 676 |
+
class="flex items-center justify-end gap-3 p-6 border-t border-gray-200 bg-gray-50 flex-shrink-0"
|
| 677 |
+
>
|
| 678 |
+
<button
|
| 679 |
+
on:click={closeErrorModal}
|
| 680 |
+
class="px-6 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors"
|
| 681 |
>
|
| 682 |
+
Close
|
| 683 |
+
</button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 684 |
</div>
|
| 685 |
</div>
|
| 686 |
+
</div>
|
| 687 |
+
{/if}
|
| 688 |
|
| 689 |
<style>
|
| 690 |
+
.pause-filled::after {
|
| 691 |
+
content: '';
|
| 692 |
+
width: 3px;
|
| 693 |
+
height: 12px;
|
| 694 |
+
background: currentColor;
|
| 695 |
+
display: inline-block;
|
| 696 |
+
margin-right: 2px;
|
| 697 |
+
}
|
| 698 |
+
.pause-filled::before {
|
| 699 |
+
content: '';
|
| 700 |
+
width: 3px;
|
| 701 |
+
height: 12px;
|
| 702 |
+
background: currentColor;
|
| 703 |
+
display: inline-block;
|
| 704 |
+
margin-right: 2px;
|
| 705 |
+
}
|
| 706 |
+
</style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
frontend/src/routes/code-recorder/+page.svelte
ADDED
|
@@ -0,0 +1,489 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<script>
|
| 2 |
+
import {
|
| 3 |
+
Copy,
|
| 4 |
+
RotateCcw,
|
| 5 |
+
Play,
|
| 6 |
+
Download,
|
| 7 |
+
Share,
|
| 8 |
+
Pause,
|
| 9 |
+
Layout,
|
| 10 |
+
Code,
|
| 11 |
+
} from 'lucide-svelte';
|
| 12 |
+
import { onMount } from 'svelte';
|
| 13 |
+
import Prism from 'prismjs';
|
| 14 |
+
import 'prismjs/components/prism-python';
|
| 15 |
+
import 'prismjs/components/prism-bash';
|
| 16 |
+
|
| 17 |
+
let selectedModel = 'Chatterbox';
|
| 18 |
+
let mode = 'api';
|
| 19 |
+
let codeHistory = [];
|
| 20 |
+
let setupCode = generateSetupCode();
|
| 21 |
+
let importCode = null;
|
| 22 |
+
let copyNotification = null;
|
| 23 |
+
let historyCount = 0;
|
| 24 |
+
|
| 25 |
+
const models = [
|
| 26 |
+
{ id: 'chatterbox', name: 'Chatterbox', badge: 'recommended' },
|
| 27 |
+
{ id: 'kokoro', name: 'Kokoro', badge: 'coming soon', disabled: true },
|
| 28 |
+
];
|
| 29 |
+
|
| 30 |
+
const voices = [
|
| 31 |
+
{
|
| 32 |
+
id: 'andrew',
|
| 33 |
+
name: 'Andrew',
|
| 34 |
+
description: 'Older British man who speaks clearly and kindly',
|
| 35 |
+
sample: '/voices/andrew.mp3',
|
| 36 |
+
preview_url: 'https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/andrew.mp3',
|
| 37 |
+
},
|
| 38 |
+
{
|
| 39 |
+
id: 'lily',
|
| 40 |
+
name: 'Jasmine',
|
| 41 |
+
description: 'Warm, conversational tone of a woman in her 30s',
|
| 42 |
+
sample: '/voices/lily.mp3',
|
| 43 |
+
preview_url: 'https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/lily.mp3',
|
| 44 |
+
},
|
| 45 |
+
{
|
| 46 |
+
id: 'pirate',
|
| 47 |
+
name: 'Pirate',
|
| 48 |
+
description: 'Young male pirate-y voice that speaks gruffly and with excitement',
|
| 49 |
+
sample: '/voices/pirate.mp3',
|
| 50 |
+
preview_url: 'https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/pirate.mp3',
|
| 51 |
+
},
|
| 52 |
+
{
|
| 53 |
+
id: 'fairy',
|
| 54 |
+
name: 'Fairy',
|
| 55 |
+
description: 'High and airy female voice that bursts with excitement',
|
| 56 |
+
sample: '/voices/fairy.mp3',
|
| 57 |
+
preview_url: 'https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/fairy.mp3',
|
| 58 |
+
},
|
| 59 |
+
];
|
| 60 |
+
|
| 61 |
+
async function loadHistoryFromDatabase() {
|
| 62 |
+
try {
|
| 63 |
+
const response = await fetch('/api/history/load', {
|
| 64 |
+
method: 'GET',
|
| 65 |
+
credentials: 'include',
|
| 66 |
+
});
|
| 67 |
+
|
| 68 |
+
if (response.ok) {
|
| 69 |
+
const data = await response.json();
|
| 70 |
+
|
| 71 |
+
const setupEntries = data.entries.filter((e) => e.entry_type === 'setup');
|
| 72 |
+
const importEntries = data.entries.filter((e) => e.entry_type === 'import');
|
| 73 |
+
const generationEntries = data.entries.filter((e) => e.entry_type === 'generation');
|
| 74 |
+
|
| 75 |
+
setupCode = generateSetupCode();
|
| 76 |
+
importCode = importEntries.length > 0 ? importEntries[importEntries.length - 1].code : null;
|
| 77 |
+
|
| 78 |
+
codeHistory = generationEntries.map((entry) => ({
|
| 79 |
+
id: entry.id,
|
| 80 |
+
code: entry.code,
|
| 81 |
+
result: entry.result_data,
|
| 82 |
+
}));
|
| 83 |
+
|
| 84 |
+
historyCount = generationEntries.length;
|
| 85 |
+
}
|
| 86 |
+
} catch (error) {
|
| 87 |
+
console.error('Error loading history from database:', error);
|
| 88 |
+
codeHistory = [];
|
| 89 |
+
setupCode = generateSetupCode();
|
| 90 |
+
importCode = null;
|
| 91 |
+
}
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
async function resetHistory() {
|
| 95 |
+
try {
|
| 96 |
+
await fetch('/api/history/clear', {
|
| 97 |
+
method: 'DELETE',
|
| 98 |
+
credentials: 'include',
|
| 99 |
+
});
|
| 100 |
+
|
| 101 |
+
codeHistory = [];
|
| 102 |
+
setupCode = generateSetupCode();
|
| 103 |
+
importCode = null;
|
| 104 |
+
} catch (error) {
|
| 105 |
+
console.error('Error clearing history:', error);
|
| 106 |
+
codeHistory = [];
|
| 107 |
+
setupCode = generateSetupCode();
|
| 108 |
+
importCode = null;
|
| 109 |
+
}
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
function generateSetupCode() {
|
| 113 |
+
if (mode === 'local') {
|
| 114 |
+
return `pip install huggingface-hub hfstudio uv
|
| 115 |
+
hfstudio start ${selectedModel.toLowerCase()} --port 7861`;
|
| 116 |
+
} else {
|
| 117 |
+
return `pip install huggingface-hub`;
|
| 118 |
+
}
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
function generateClientInitCode() {
|
| 122 |
+
if (mode === 'local') {
|
| 123 |
+
const port = 7861;
|
| 124 |
+
return `client = InferenceClient(base_url="http://localhost:${port}/api/v1")`;
|
| 125 |
+
} else {
|
| 126 |
+
const endpointModel =
|
| 127 |
+
selectedModel.toLowerCase() === 'chatterbox'
|
| 128 |
+
? 'ResembleAI/chatterbox'
|
| 129 |
+
: selectedModel.toLowerCase();
|
| 130 |
+
return `client = InferenceClient(
|
| 131 |
+
api_key="YOUR_HF_TOKEN", # Get your token from https://huggingface.co/settings/tokens
|
| 132 |
+
model="${endpointModel}",
|
| 133 |
+
)`;
|
| 134 |
+
}
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
function generateImportCode() {
|
| 138 |
+
const clientCode = generateClientInitCode();
|
| 139 |
+
|
| 140 |
+
if (mode === 'local') {
|
| 141 |
+
return `from huggingface_hub import InferenceClient
|
| 142 |
+
|
| 143 |
+
${clientCode}`;
|
| 144 |
+
} else {
|
| 145 |
+
return `from huggingface_hub import InferenceClient
|
| 146 |
+
|
| 147 |
+
${clientCode}`;
|
| 148 |
+
}
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
function copyToClipboard(text, message = 'Copied to clipboard!') {
|
| 152 |
+
navigator.clipboard.writeText(text).then(() => {
|
| 153 |
+
copyNotification = message;
|
| 154 |
+
setTimeout(() => {
|
| 155 |
+
copyNotification = null;
|
| 156 |
+
}, 2000);
|
| 157 |
+
});
|
| 158 |
+
}
|
| 159 |
+
|
| 160 |
+
function copyAllCode() {
|
| 161 |
+
const parts = [];
|
| 162 |
+
|
| 163 |
+
if (setupCode) {
|
| 164 |
+
const isTerminalCommand =
|
| 165 |
+
setupCode.includes('pip install') || setupCode.includes('hfstudio start');
|
| 166 |
+
const language = isTerminalCommand ? 'bash' : '';
|
| 167 |
+
parts.push(`## Setup (Run in Terminal)\n\n\`\`\`${language}\n${setupCode}\n\`\`\``);
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
+
if (importCode) {
|
| 171 |
+
parts.push(`## Imports (Python)\n\n\`\`\`python\n${importCode}\n\`\`\``);
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
codeHistory.forEach((entry, i) => {
|
| 175 |
+
parts.push(`## Cell ${i + 1}\n\n\`\`\`python\n${entry.code}\n\`\`\``);
|
| 176 |
+
});
|
| 177 |
+
|
| 178 |
+
const markdownContent = parts.join('\n\n');
|
| 179 |
+
copyToClipboard(markdownContent, 'All code copied as Markdown!');
|
| 180 |
+
}
|
| 181 |
+
|
| 182 |
+
function toggleHistoryAudio(entry) {
|
| 183 |
+
if (!entry.audioElement) {
|
| 184 |
+
entry.audioElement = new Audio(entry.result.url);
|
| 185 |
+
entry.audioElement.addEventListener('ended', () => {
|
| 186 |
+
entry.isPlaying = false;
|
| 187 |
+
codeHistory = [...codeHistory];
|
| 188 |
+
});
|
| 189 |
+
}
|
| 190 |
+
|
| 191 |
+
if (entry.isPlaying) {
|
| 192 |
+
entry.audioElement.pause();
|
| 193 |
+
entry.isPlaying = false;
|
| 194 |
+
} else {
|
| 195 |
+
codeHistory.forEach((e) => {
|
| 196 |
+
if (e !== entry && e.isPlaying && e.audioElement) {
|
| 197 |
+
e.audioElement.pause();
|
| 198 |
+
e.isPlaying = false;
|
| 199 |
+
}
|
| 200 |
+
});
|
| 201 |
+
entry.audioElement.play();
|
| 202 |
+
entry.isPlaying = true;
|
| 203 |
+
}
|
| 204 |
+
codeHistory = [...codeHistory];
|
| 205 |
+
}
|
| 206 |
+
|
| 207 |
+
function downloadHistoryAudio(url, title) {
|
| 208 |
+
const link = document.createElement('a');
|
| 209 |
+
link.href = url;
|
| 210 |
+
link.download = `${title || 'audio'}.wav`;
|
| 211 |
+
document.body.appendChild(link);
|
| 212 |
+
link.click();
|
| 213 |
+
document.body.removeChild(link);
|
| 214 |
+
}
|
| 215 |
+
|
| 216 |
+
function formatDuration(seconds) {
|
| 217 |
+
if (!seconds) return '0:00';
|
| 218 |
+
const mins = Math.floor(seconds / 60);
|
| 219 |
+
const secs = Math.floor(seconds % 60);
|
| 220 |
+
return `${mins}:${secs.toString().padStart(2, '0')}`;
|
| 221 |
+
}
|
| 222 |
+
|
| 223 |
+
$: if (mode) {
|
| 224 |
+
setupCode = generateSetupCode();
|
| 225 |
+
if (importCode) {
|
| 226 |
+
importCode = generateImportCode();
|
| 227 |
+
}
|
| 228 |
+
}
|
| 229 |
+
|
| 230 |
+
onMount(async () => {
|
| 231 |
+
await loadHistoryFromDatabase();
|
| 232 |
+
});
|
| 233 |
+
</script>
|
| 234 |
+
|
| 235 |
+
<svelte:head>
|
| 236 |
+
<title>Code Recorder - HFStudio</title>
|
| 237 |
+
</svelte:head>
|
| 238 |
+
|
| 239 |
+
<div class="flex-1 bg-gray-50 overflow-y-auto">
|
| 240 |
+
<!-- Top navbar -->
|
| 241 |
+
<div class="flex items-center justify-end px-4 py-4 border-b border-gray-200 bg-white min-h-[73px]">
|
| 242 |
+
<a
|
| 243 |
+
href="/"
|
| 244 |
+
class="px-3 py-1.5 text-sm font-medium rounded transition-colors text-gray-600 hover:bg-gray-50 flex items-center gap-1 bg-gray-100"
|
| 245 |
+
>
|
| 246 |
+
<Layout size={14} />
|
| 247 |
+
UI
|
| 248 |
+
{#if historyCount > 0}
|
| 249 |
+
<span class="ml-1 px-1.5 py-0.5 bg-gray-500 text-white text-xs rounded-full min-w-[18px] text-center">
|
| 250 |
+
{historyCount}
|
| 251 |
+
</span>
|
| 252 |
+
{/if}
|
| 253 |
+
</a>
|
| 254 |
+
</div>
|
| 255 |
+
|
| 256 |
+
<div class="max-w-4xl mx-auto p-8">
|
| 257 |
+
<!-- Header -->
|
| 258 |
+
<div class="mb-6">
|
| 259 |
+
<div>
|
| 260 |
+
<h2 class="text-2xl font-semibold text-gray-900">Code Recorder</h2>
|
| 261 |
+
<p class="text-sm text-gray-600 mt-1">
|
| 262 |
+
{#if mode === 'local'}
|
| 263 |
+
Python code to reproduce your actions using a local HFStudio server
|
| 264 |
+
{:else}
|
| 265 |
+
Python code to reproduce your actions via the API
|
| 266 |
+
{/if}
|
| 267 |
+
</p>
|
| 268 |
+
</div>
|
| 269 |
+
|
| 270 |
+
<!-- Toggle and Copy All button row -->
|
| 271 |
+
<div class="flex items-center justify-between mt-4">
|
| 272 |
+
<!-- API/Local Mode Toggle -->
|
| 273 |
+
<div class="flex items-center bg-gray-100 rounded-md p-0.5">
|
| 274 |
+
<button
|
| 275 |
+
class="px-3 py-1 text-sm font-medium rounded transition-colors {mode === 'api'
|
| 276 |
+
? 'bg-white shadow-sm'
|
| 277 |
+
: 'text-gray-600'}"
|
| 278 |
+
on:click={() => (mode = 'api')}
|
| 279 |
+
>
|
| 280 |
+
API
|
| 281 |
+
</button>
|
| 282 |
+
<button
|
| 283 |
+
class="px-3 py-1 text-sm font-medium rounded transition-colors {mode === 'local'
|
| 284 |
+
? 'bg-white shadow-sm'
|
| 285 |
+
: 'text-gray-600'}"
|
| 286 |
+
on:click={() => (mode = 'local')}
|
| 287 |
+
>
|
| 288 |
+
Local
|
| 289 |
+
</button>
|
| 290 |
+
</div>
|
| 291 |
+
|
| 292 |
+
{#if codeHistory.length > 0 || setupCode || importCode}
|
| 293 |
+
<div class="flex items-center gap-2">
|
| 294 |
+
<button
|
| 295 |
+
on:click={resetHistory}
|
| 296 |
+
class="flex items-center bg-red-50 hover:bg-red-100 rounded-md px-3 py-1.5 transition-colors"
|
| 297 |
+
title="Clear history"
|
| 298 |
+
>
|
| 299 |
+
<RotateCcw size={16} class="text-red-600" />
|
| 300 |
+
<span class="ml-2 text-sm font-medium text-red-600">Reset history</span>
|
| 301 |
+
</button>
|
| 302 |
+
<button
|
| 303 |
+
on:click={copyAllCode}
|
| 304 |
+
class="flex items-center bg-gray-100 hover:bg-gray-200 rounded-md px-3 py-1.5 transition-colors"
|
| 305 |
+
>
|
| 306 |
+
<Copy size={16} class="text-gray-600" />
|
| 307 |
+
<span class="ml-2 text-sm font-medium text-gray-600">Copy all as Markdown</span>
|
| 308 |
+
</button>
|
| 309 |
+
</div>
|
| 310 |
+
{/if}
|
| 311 |
+
</div>
|
| 312 |
+
</div>
|
| 313 |
+
|
| 314 |
+
<!-- Code sections -->
|
| 315 |
+
<div class="space-y-6">
|
| 316 |
+
<!-- Setup Section - Always shown -->
|
| 317 |
+
{#if setupCode}
|
| 318 |
+
<div class="bg-white rounded-lg border border-gray-200 overflow-hidden">
|
| 319 |
+
<div
|
| 320 |
+
class="flex items-center justify-between px-4 py-2 bg-amber-50 border-b border-amber-200"
|
| 321 |
+
>
|
| 322 |
+
<div class="flex items-center gap-2">
|
| 323 |
+
<span class="text-sm font-medium text-amber-900">Setup (Run in Terminal)</span>
|
| 324 |
+
<span class="text-xs bg-amber-100 text-amber-700 px-2 py-0.5 rounded"
|
| 325 |
+
>Run once</span
|
| 326 |
+
>
|
| 327 |
+
</div>
|
| 328 |
+
<button
|
| 329 |
+
on:click={() => copyToClipboard(setupCode)}
|
| 330 |
+
class="p-1.5 hover:bg-amber-100 rounded transition-colors"
|
| 331 |
+
title="Copy setup code"
|
| 332 |
+
>
|
| 333 |
+
<Copy size={14} class="text-amber-600" />
|
| 334 |
+
</button>
|
| 335 |
+
</div>
|
| 336 |
+
<div class="relative">
|
| 337 |
+
{#if setupCode === 'pip install huggingface-hub'}
|
| 338 |
+
<pre class="p-4 overflow-x-auto bg-gray-50"><code
|
| 339 |
+
class="language-bash text-sm text-black">{setupCode}</code
|
| 340 |
+
></pre>
|
| 341 |
+
{:else}
|
| 342 |
+
<pre class="p-4 overflow-x-auto bg-gray-50"><code class="language-bash text-sm"
|
| 343 |
+
>{@html Prism.highlight(setupCode, Prism.languages.bash, 'bash')}</code
|
| 344 |
+
></pre>
|
| 345 |
+
{/if}
|
| 346 |
+
</div>
|
| 347 |
+
</div>
|
| 348 |
+
{/if}
|
| 349 |
+
|
| 350 |
+
<!-- Import Section -->
|
| 351 |
+
{#if importCode}
|
| 352 |
+
<div class="bg-white rounded-lg border border-gray-200 overflow-hidden">
|
| 353 |
+
<div
|
| 354 |
+
class="flex items-center justify-between px-4 py-2 bg-blue-50 border-b border-blue-200"
|
| 355 |
+
>
|
| 356 |
+
<div class="flex items-center gap-2">
|
| 357 |
+
<span class="text-sm font-medium text-blue-900">Imports (Python)</span>
|
| 358 |
+
<span class="text-xs bg-blue-100 text-blue-700 px-2 py-0.5 rounded">Run once</span
|
| 359 |
+
>
|
| 360 |
+
</div>
|
| 361 |
+
<button
|
| 362 |
+
on:click={() => copyToClipboard(importCode)}
|
| 363 |
+
class="p-1.5 hover:bg-blue-100 rounded transition-colors"
|
| 364 |
+
title="Copy import code"
|
| 365 |
+
>
|
| 366 |
+
<Copy size={14} class="text-blue-600" />
|
| 367 |
+
</button>
|
| 368 |
+
</div>
|
| 369 |
+
<div class="relative">
|
| 370 |
+
<pre class="p-4 overflow-x-auto bg-gray-50"><code class="language-python text-sm"
|
| 371 |
+
>{@html Prism.highlight(importCode, Prism.languages.python, 'python')}</code
|
| 372 |
+
></pre>
|
| 373 |
+
</div>
|
| 374 |
+
</div>
|
| 375 |
+
{/if}
|
| 376 |
+
|
| 377 |
+
<!-- Show "start using UI" message when no import code or history -->
|
| 378 |
+
{#if !importCode && codeHistory.length === 0}
|
| 379 |
+
<div class="bg-white rounded-lg border border-gray-200 p-8 text-center">
|
| 380 |
+
<p class="text-gray-500">Start using the UI to see generated code here</p>
|
| 381 |
+
</div>
|
| 382 |
+
{/if}
|
| 383 |
+
|
| 384 |
+
<!-- History entries -->
|
| 385 |
+
{#each codeHistory as entry, i (entry.id)}
|
| 386 |
+
<div class="bg-white rounded-lg border border-gray-200 overflow-hidden shadow-sm">
|
| 387 |
+
<!-- Code cell -->
|
| 388 |
+
<div class="border-b border-gray-200">
|
| 389 |
+
<div
|
| 390 |
+
class="flex items-center justify-between px-4 py-2 bg-gray-50 border-b border-gray-100"
|
| 391 |
+
>
|
| 392 |
+
<span class="text-sm font-medium text-gray-700">Cell {i + 1}</span>
|
| 393 |
+
<button
|
| 394 |
+
on:click={() => copyToClipboard(entry.code)}
|
| 395 |
+
class="p-1.5 hover:bg-gray-200 rounded transition-colors"
|
| 396 |
+
title="Copy code"
|
| 397 |
+
>
|
| 398 |
+
<Copy size={14} class="text-gray-600" />
|
| 399 |
+
</button>
|
| 400 |
+
</div>
|
| 401 |
+
<div class="relative">
|
| 402 |
+
<pre class="p-4 overflow-x-auto bg-gray-50"><code class="language-python text-sm"
|
| 403 |
+
>{@html Prism.highlight(entry.code, Prism.languages.python, 'python')}</code
|
| 404 |
+
></pre>
|
| 405 |
+
</div>
|
| 406 |
+
</div>
|
| 407 |
+
|
| 408 |
+
<!-- Result (audio player) -->
|
| 409 |
+
{#if entry.result && entry.result.type === 'audio'}
|
| 410 |
+
<div class="bg-gradient-to-b from-gray-50 to-white p-4">
|
| 411 |
+
<div class="bg-white rounded-lg border border-gray-200 p-4 shadow-sm">
|
| 412 |
+
<div class="flex items-center justify-between">
|
| 413 |
+
<div class="flex items-center gap-3 flex-1">
|
| 414 |
+
<button
|
| 415 |
+
on:click={() => toggleHistoryAudio(entry)}
|
| 416 |
+
class="w-10 h-10 bg-gradient-to-r from-amber-500 to-orange-500 rounded-full flex items-center justify-center text-white hover:from-amber-600 hover:to-orange-600 transition-colors shadow-md"
|
| 417 |
+
>
|
| 418 |
+
{#if entry.isPlaying}
|
| 419 |
+
<Pause size={18} />
|
| 420 |
+
{:else}
|
| 421 |
+
<Play size={18} class="ml-0.5" />
|
| 422 |
+
{/if}
|
| 423 |
+
</button>
|
| 424 |
+
<div class="flex-1">
|
| 425 |
+
<div class="text-sm font-medium text-gray-900 truncate">
|
| 426 |
+
{entry.result.title || 'Generated Audio'}
|
| 427 |
+
</div>
|
| 428 |
+
<div class="text-xs text-gray-500">
|
| 429 |
+
Duration: {formatDuration(entry.result.duration || 0)}
|
| 430 |
+
</div>
|
| 431 |
+
</div>
|
| 432 |
+
</div>
|
| 433 |
+
<div class="flex items-center gap-1">
|
| 434 |
+
<button
|
| 435 |
+
on:click={() =>
|
| 436 |
+
downloadHistoryAudio(entry.result.url, entry.result.title)}
|
| 437 |
+
class="p-2 hover:bg-gray-100 rounded-lg transition-colors"
|
| 438 |
+
title="Download"
|
| 439 |
+
>
|
| 440 |
+
<Download size={16} class="text-gray-600" />
|
| 441 |
+
</button>
|
| 442 |
+
<button
|
| 443 |
+
class="p-2 hover:bg-gray-100 rounded-lg transition-colors"
|
| 444 |
+
title="Share"
|
| 445 |
+
>
|
| 446 |
+
<Share size={16} class="text-gray-600" />
|
| 447 |
+
</button>
|
| 448 |
+
</div>
|
| 449 |
+
</div>
|
| 450 |
+
<audio
|
| 451 |
+
bind:this={entry.audioElement}
|
| 452 |
+
src={entry.result.url}
|
| 453 |
+
on:ended={() => (entry.isPlaying = false)}
|
| 454 |
+
class="hidden"
|
| 455 |
+
/>
|
| 456 |
+
</div>
|
| 457 |
+
</div>
|
| 458 |
+
{/if}
|
| 459 |
+
</div>
|
| 460 |
+
{/each}
|
| 461 |
+
</div>
|
| 462 |
+
</div>
|
| 463 |
+
</div>
|
| 464 |
+
|
| 465 |
+
<!-- Copy notification toast -->
|
| 466 |
+
{#if copyNotification}
|
| 467 |
+
<div
|
| 468 |
+
class="fixed bottom-4 right-4 px-4 py-2 bg-gray-900 text-white rounded-lg shadow-lg z-50 animate-fade-in"
|
| 469 |
+
>
|
| 470 |
+
{copyNotification}
|
| 471 |
+
</div>
|
| 472 |
+
{/if}
|
| 473 |
+
|
| 474 |
+
<style>
|
| 475 |
+
@keyframes fade-in {
|
| 476 |
+
from {
|
| 477 |
+
opacity: 0;
|
| 478 |
+
transform: translateY(10px);
|
| 479 |
+
}
|
| 480 |
+
to {
|
| 481 |
+
opacity: 1;
|
| 482 |
+
transform: translateY(0);
|
| 483 |
+
}
|
| 484 |
+
}
|
| 485 |
+
|
| 486 |
+
.animate-fade-in {
|
| 487 |
+
animation: fade-in 0.3s ease-out;
|
| 488 |
+
}
|
| 489 |
+
</style>
|
frontend/src/routes/voice-cloning/+page.svelte
ADDED
|
@@ -0,0 +1,442 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<script>
|
| 2 |
+
import {
|
| 3 |
+
Play,
|
| 4 |
+
Loader2,
|
| 5 |
+
AlertCircle,
|
| 6 |
+
Copy,
|
| 7 |
+
Share,
|
| 8 |
+
MoreHorizontal,
|
| 9 |
+
Settings,
|
| 10 |
+
Pause,
|
| 11 |
+
Layout,
|
| 12 |
+
Code,
|
| 13 |
+
X,
|
| 14 |
+
RotateCcw,
|
| 15 |
+
Mic,
|
| 16 |
+
Square,
|
| 17 |
+
} from 'lucide-svelte';
|
| 18 |
+
import { onMount } from 'svelte';
|
| 19 |
+
|
| 20 |
+
// Voice cloning state
|
| 21 |
+
let isRecording = false;
|
| 22 |
+
let sessionRecordings = [];
|
| 23 |
+
let selectedRecording = null;
|
| 24 |
+
let cloneName = '';
|
| 25 |
+
let recordingWaveform = [];
|
| 26 |
+
let mediaRecorder = null;
|
| 27 |
+
let audioChunks = [];
|
| 28 |
+
let showErrorModal = false;
|
| 29 |
+
let errorMessage = '';
|
| 30 |
+
let errorDetails = '';
|
| 31 |
+
let historyCount = 0;
|
| 32 |
+
let recordingProgress = 0;
|
| 33 |
+
let recordingTimer = null;
|
| 34 |
+
let audioAmplitude = 0;
|
| 35 |
+
let audioContext = null;
|
| 36 |
+
let analyser = null;
|
| 37 |
+
let playingRecording = null;
|
| 38 |
+
let currentAudio = null;
|
| 39 |
+
|
| 40 |
+
// Validation helper functions
|
| 41 |
+
function isRecordingLongEnough(recording) {
|
| 42 |
+
return recording && recording.duration >= 15;
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
function hasConsent(recording) {
|
| 46 |
+
// Since we can't analyze actual audio content, we'll assume consent is included
|
| 47 |
+
// based on the script requirement. In a real implementation, this would use
|
| 48 |
+
// speech-to-text to verify the "I consent" phrase is present.
|
| 49 |
+
return recording !== null;
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
function showError(message, details = '') {
|
| 53 |
+
errorMessage = message;
|
| 54 |
+
errorDetails = details;
|
| 55 |
+
showErrorModal = true;
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
function closeErrorModal() {
|
| 59 |
+
showErrorModal = false;
|
| 60 |
+
errorMessage = '';
|
| 61 |
+
errorDetails = '';
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
// Voice cloning functions
|
| 65 |
+
async function startRecording() {
|
| 66 |
+
try {
|
| 67 |
+
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
|
| 68 |
+
mediaRecorder = new MediaRecorder(stream);
|
| 69 |
+
audioChunks = [];
|
| 70 |
+
recordingWaveform = [];
|
| 71 |
+
recordingProgress = 0;
|
| 72 |
+
audioAmplitude = 0;
|
| 73 |
+
|
| 74 |
+
// Set up audio context for amplitude detection
|
| 75 |
+
audioContext = new (window.AudioContext || window.webkitAudioContext)();
|
| 76 |
+
analyser = audioContext.createAnalyser();
|
| 77 |
+
const source = audioContext.createMediaStreamSource(stream);
|
| 78 |
+
source.connect(analyser);
|
| 79 |
+
|
| 80 |
+
analyser.fftSize = 256;
|
| 81 |
+
const bufferLength = analyser.frequencyBinCount;
|
| 82 |
+
const dataArray = new Uint8Array(bufferLength);
|
| 83 |
+
|
| 84 |
+
mediaRecorder.ondataavailable = (event) => {
|
| 85 |
+
audioChunks.push(event.data);
|
| 86 |
+
};
|
| 87 |
+
|
| 88 |
+
mediaRecorder.onstop = () => {
|
| 89 |
+
const audioBlob = new Blob(audioChunks, { type: 'audio/wav' });
|
| 90 |
+
const audioUrl = URL.createObjectURL(audioBlob);
|
| 91 |
+
const recording = {
|
| 92 |
+
id: Date.now(),
|
| 93 |
+
url: audioUrl,
|
| 94 |
+
blob: audioBlob,
|
| 95 |
+
timestamp: new Date(),
|
| 96 |
+
duration: recordingProgress / 100 * 15
|
| 97 |
+
};
|
| 98 |
+
sessionRecordings = [...sessionRecordings, recording];
|
| 99 |
+
stream.getTracks().forEach(track => track.stop());
|
| 100 |
+
if (audioContext) {
|
| 101 |
+
audioContext.close();
|
| 102 |
+
audioContext = null;
|
| 103 |
+
}
|
| 104 |
+
recordingProgress = 0;
|
| 105 |
+
audioAmplitude = 0;
|
| 106 |
+
};
|
| 107 |
+
|
| 108 |
+
mediaRecorder.start();
|
| 109 |
+
isRecording = true;
|
| 110 |
+
|
| 111 |
+
// Function to update amplitude
|
| 112 |
+
function updateAmplitude() {
|
| 113 |
+
if (!isRecording || !analyser) return;
|
| 114 |
+
|
| 115 |
+
analyser.getByteFrequencyData(dataArray);
|
| 116 |
+
let sum = 0;
|
| 117 |
+
for (let i = 0; i < bufferLength; i++) {
|
| 118 |
+
sum += dataArray[i];
|
| 119 |
+
}
|
| 120 |
+
audioAmplitude = (sum / bufferLength) / 255; // Normalize to 0-1
|
| 121 |
+
|
| 122 |
+
requestAnimationFrame(updateAmplitude);
|
| 123 |
+
}
|
| 124 |
+
updateAmplitude();
|
| 125 |
+
|
| 126 |
+
// Start timer for 15-second progress
|
| 127 |
+
recordingTimer = setInterval(() => {
|
| 128 |
+
if (!isRecording) {
|
| 129 |
+
clearInterval(recordingTimer);
|
| 130 |
+
return;
|
| 131 |
+
}
|
| 132 |
+
recordingProgress += (100 / 15) / 10; // 100% over 15 seconds, updated every 100ms
|
| 133 |
+
if (recordingProgress >= 100) {
|
| 134 |
+
recordingProgress = 100;
|
| 135 |
+
// Auto-stop after 15 seconds if desired
|
| 136 |
+
// stopRecording();
|
| 137 |
+
}
|
| 138 |
+
}, 100);
|
| 139 |
+
|
| 140 |
+
} catch (error) {
|
| 141 |
+
console.error('Error accessing microphone:', error);
|
| 142 |
+
showError('Microphone Error', 'Could not access microphone. Please check permissions.');
|
| 143 |
+
}
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
function stopRecording() {
|
| 147 |
+
if (mediaRecorder && mediaRecorder.state === 'recording') {
|
| 148 |
+
mediaRecorder.stop();
|
| 149 |
+
isRecording = false;
|
| 150 |
+
recordingWaveform = [];
|
| 151 |
+
if (recordingTimer) {
|
| 152 |
+
clearInterval(recordingTimer);
|
| 153 |
+
recordingTimer = null;
|
| 154 |
+
}
|
| 155 |
+
}
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
function toggleRecording() {
|
| 159 |
+
if (isRecording) {
|
| 160 |
+
stopRecording();
|
| 161 |
+
} else {
|
| 162 |
+
startRecording();
|
| 163 |
+
}
|
| 164 |
+
}
|
| 165 |
+
|
| 166 |
+
function selectRecording(recording) {
|
| 167 |
+
selectedRecording = recording;
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
+
function togglePlayRecording(recording) {
|
| 171 |
+
// If this recording is currently playing, pause it
|
| 172 |
+
if (playingRecording?.id === recording.id && currentAudio && !currentAudio.paused) {
|
| 173 |
+
currentAudio.pause();
|
| 174 |
+
playingRecording = null;
|
| 175 |
+
return;
|
| 176 |
+
}
|
| 177 |
+
|
| 178 |
+
// Stop any currently playing audio
|
| 179 |
+
if (currentAudio) {
|
| 180 |
+
currentAudio.pause();
|
| 181 |
+
currentAudio = null;
|
| 182 |
+
}
|
| 183 |
+
|
| 184 |
+
// Start playing the new recording
|
| 185 |
+
currentAudio = new Audio(recording.url);
|
| 186 |
+
playingRecording = recording;
|
| 187 |
+
|
| 188 |
+
currentAudio.addEventListener('ended', () => {
|
| 189 |
+
playingRecording = null;
|
| 190 |
+
currentAudio = null;
|
| 191 |
+
});
|
| 192 |
+
|
| 193 |
+
currentAudio.addEventListener('pause', () => {
|
| 194 |
+
if (currentAudio && currentAudio.ended) {
|
| 195 |
+
playingRecording = null;
|
| 196 |
+
currentAudio = null;
|
| 197 |
+
}
|
| 198 |
+
});
|
| 199 |
+
|
| 200 |
+
currentAudio.play();
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
function cloneVoice() {
|
| 204 |
+
if (!selectedRecording || !cloneName.trim()) {
|
| 205 |
+
showError('Clone Error', 'Please select a recording and enter a name.');
|
| 206 |
+
return;
|
| 207 |
+
}
|
| 208 |
+
showError('Clone Voice', 'Voice cloning functionality will be implemented soon.');
|
| 209 |
+
}
|
| 210 |
+
|
| 211 |
+
async function loadHistoryCount() {
|
| 212 |
+
try {
|
| 213 |
+
const response = await fetch('/api/history/load', {
|
| 214 |
+
method: 'GET',
|
| 215 |
+
credentials: 'include',
|
| 216 |
+
});
|
| 217 |
+
|
| 218 |
+
if (response.ok) {
|
| 219 |
+
const data = await response.json();
|
| 220 |
+
const generationEntries = data.entries.filter((e) => e.entry_type === 'generation');
|
| 221 |
+
historyCount = generationEntries.length;
|
| 222 |
+
}
|
| 223 |
+
} catch (error) {
|
| 224 |
+
console.error('Error loading history count:', error);
|
| 225 |
+
historyCount = 0;
|
| 226 |
+
}
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
onMount(async () => {
|
| 230 |
+
await loadHistoryCount();
|
| 231 |
+
});
|
| 232 |
+
</script>
|
| 233 |
+
|
| 234 |
+
<svelte:head>
|
| 235 |
+
<title>Voice Cloning - HFStudio</title>
|
| 236 |
+
</svelte:head>
|
| 237 |
+
|
| 238 |
+
<div class="flex flex-col h-full">
|
| 239 |
+
<!-- Top navbar -->
|
| 240 |
+
<div class="flex items-center justify-end px-4 py-4 border-b border-gray-200 min-h-[73px]">
|
| 241 |
+
<a
|
| 242 |
+
href="/code-recorder"
|
| 243 |
+
class="px-3 py-1.5 text-sm font-medium rounded transition-colors text-gray-600 hover:bg-gray-50 flex items-center gap-1 bg-gray-100"
|
| 244 |
+
>
|
| 245 |
+
<Code size={14} />
|
| 246 |
+
Code Recorder
|
| 247 |
+
{#if historyCount > 0}
|
| 248 |
+
<span class="ml-1 px-1.5 py-0.5 bg-gray-500 text-white text-xs rounded-full min-w-[18px] text-center">
|
| 249 |
+
{historyCount}
|
| 250 |
+
</span>
|
| 251 |
+
{/if}
|
| 252 |
+
</a>
|
| 253 |
+
</div>
|
| 254 |
+
|
| 255 |
+
<div class="flex-1 flex">
|
| 256 |
+
<!-- Main content area -->
|
| 257 |
+
<div class="flex-1 flex flex-col p-6">
|
| 258 |
+
<!-- Script reading area -->
|
| 259 |
+
<div class="flex-1 pb-24 relative flex flex-col">
|
| 260 |
+
<div class="mb-6">
|
| 261 |
+
<p><em>Record your voice for at least 15 seconds to create a voice clone. To prevent unauthorized voice cloning, you must start by clearly saying "I consent to cloning my voice" β the rest of the text is arbitrary.</em></p>
|
| 262 |
+
</div>
|
| 263 |
+
|
| 264 |
+
<!-- Script text -->
|
| 265 |
+
<div class="flex-1 p-8 mb-6">
|
| 266 |
+
<div class="text-gray-900 leading-relaxed font-serif text-lg relative p-4">
|
| 267 |
+
<div class="absolute top-0 left-0 w-8 h-8 border-l-2 border-t-2 border-amber-400 rounded-tl-lg"></div>
|
| 268 |
+
<div class="absolute bottom-0 right-0 w-8 h-8 border-r-2 border-b-2 border-amber-400 rounded-br-lg"></div>
|
| 269 |
+
<p class="mb-4"><span class="bg-yellow-50">I consent to cloning my voice.</span> There's a quiet kind of magic in the early hours of the morning, when the world is still half-asleep and the air feels crisp with possibility. The hum of the refrigerator becomes a rhythm, the ticking of the clock a heartbeat, and for a brief moment, everything feels perfectly in sync.</p>
|
| 270 |
+
</div>
|
| 271 |
+
</div>
|
| 272 |
+
|
| 273 |
+
<!-- Record button -->
|
| 274 |
+
<div class="flex justify-center items-center flex-1 relative">
|
| 275 |
+
<!-- Concentric circles for amplitude visualization -->
|
| 276 |
+
{#if isRecording}
|
| 277 |
+
<div class="absolute inset-0 flex items-center justify-center">
|
| 278 |
+
<div
|
| 279 |
+
class="absolute rounded-full border-2 border-orange-300 transition-all duration-75"
|
| 280 |
+
style="width: {120 + audioAmplitude * 120}px; height: {120 + audioAmplitude * 120}px; opacity: {0.4 + audioAmplitude * 0.6}"
|
| 281 |
+
></div>
|
| 282 |
+
<div
|
| 283 |
+
class="absolute rounded-full border-2 border-orange-200 transition-all duration-100"
|
| 284 |
+
style="width: {150 + audioAmplitude * 150}px; height: {150 + audioAmplitude * 150}px; opacity: {0.3 + audioAmplitude * 0.5}"
|
| 285 |
+
></div>
|
| 286 |
+
<div
|
| 287 |
+
class="absolute rounded-full border-1 border-orange-100 transition-all duration-125"
|
| 288 |
+
style="width: {180 + audioAmplitude * 180}px; height: {180 + audioAmplitude * 180}px; opacity: {0.2 + audioAmplitude * 0.4}"
|
| 289 |
+
></div>
|
| 290 |
+
</div>
|
| 291 |
+
{/if}
|
| 292 |
+
|
| 293 |
+
<button
|
| 294 |
+
on:click={toggleRecording}
|
| 295 |
+
class="w-24 h-24 rounded-full flex items-center justify-center transition-all duration-200 shadow-lg relative overflow-hidden z-20 {isRecording ? 'border-4 border-orange-500 bg-transparent' : 'bg-orange-500 hover:bg-orange-600'}"
|
| 296 |
+
>
|
| 297 |
+
{#if isRecording}
|
| 298 |
+
<!-- Filling effect -->
|
| 299 |
+
<div
|
| 300 |
+
class="absolute bottom-0 left-0 right-0 bg-orange-500 transition-all duration-100 ease-linear rounded-full"
|
| 301 |
+
style="height: {recordingProgress}%"
|
| 302 |
+
></div>
|
| 303 |
+
<Square size={36} class="{recordingProgress >= 100 ? 'text-white' : 'text-orange-700'} relative z-10" />
|
| 304 |
+
{:else}
|
| 305 |
+
<Mic size={36} class="text-white" />
|
| 306 |
+
{/if}
|
| 307 |
+
</button>
|
| 308 |
+
</div>
|
| 309 |
+
</div>
|
| 310 |
+
</div>
|
| 311 |
+
|
| 312 |
+
<!-- Right panel for voice cloning -->
|
| 313 |
+
<div class="w-80 border-l border-gray-200 bg-white p-3 overflow-y-auto">
|
| 314 |
+
<div class="mb-4">
|
| 315 |
+
|
| 316 |
+
{#if sessionRecordings.length === 0}
|
| 317 |
+
<div class="text-center py-8 text-gray-500">
|
| 318 |
+
<Mic size={32} class="mx-auto mb-2 opacity-30" />
|
| 319 |
+
<p class="text-sm">No recordings yet</p>
|
| 320 |
+
<p class="text-xs text-gray-400">Start recording to see them here</p>
|
| 321 |
+
</div>
|
| 322 |
+
{:else}
|
| 323 |
+
<div class="space-y-2">
|
| 324 |
+
{#each sessionRecordings as recording, i}
|
| 325 |
+
<div class="border rounded-lg p-3 {selectedRecording?.id === recording.id ? 'border-amber-300 bg-amber-50' : 'border-gray-200 hover:border-gray-300'} transition-colors">
|
| 326 |
+
<div class="flex items-center justify-between mb-2">
|
| 327 |
+
<span class="text-sm font-medium text-gray-900">Recording {i + 1}</span>
|
| 328 |
+
<button
|
| 329 |
+
on:click={() => togglePlayRecording(recording)}
|
| 330 |
+
class="p-1 hover:bg-gray-100 rounded transition-colors"
|
| 331 |
+
>
|
| 332 |
+
{#if playingRecording?.id === recording.id && currentAudio && !currentAudio.paused}
|
| 333 |
+
<Pause size={14} class="text-gray-600" />
|
| 334 |
+
{:else}
|
| 335 |
+
<Play size={14} class="text-gray-600" />
|
| 336 |
+
{/if}
|
| 337 |
+
</button>
|
| 338 |
+
</div>
|
| 339 |
+
<div class="text-xs text-gray-500 mb-2">
|
| 340 |
+
{recording.timestamp.toLocaleTimeString()}
|
| 341 |
+
</div>
|
| 342 |
+
<button
|
| 343 |
+
on:click={() => selectRecording(recording)}
|
| 344 |
+
class="w-full text-xs px-2 py-1 rounded {selectedRecording?.id === recording.id ? 'bg-amber-200 text-amber-800' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'} transition-colors"
|
| 345 |
+
>
|
| 346 |
+
{selectedRecording?.id === recording.id ? 'Selected' : 'Select for cloning'}
|
| 347 |
+
</button>
|
| 348 |
+
</div>
|
| 349 |
+
{/each}
|
| 350 |
+
</div>
|
| 351 |
+
{/if}
|
| 352 |
+
</div>
|
| 353 |
+
|
| 354 |
+
<!-- Clone section -->
|
| 355 |
+
<div class="mt-6 pt-4 border-t border-gray-200">
|
| 356 |
+
<div class="mb-3">
|
| 357 |
+
<label for="clone-name" class="block text-sm font-medium text-gray-700 mb-1">
|
| 358 |
+
Give name to recording
|
| 359 |
+
</label>
|
| 360 |
+
<input
|
| 361 |
+
id="clone-name"
|
| 362 |
+
type="text"
|
| 363 |
+
bind:value={cloneName}
|
| 364 |
+
placeholder="e.g., My Voice"
|
| 365 |
+
class="w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-amber-400 focus:border-transparent"
|
| 366 |
+
/>
|
| 367 |
+
</div>
|
| 368 |
+
<button
|
| 369 |
+
on:click={cloneVoice}
|
| 370 |
+
disabled={!selectedRecording || !cloneName.trim()}
|
| 371 |
+
class="w-full px-4 py-2 bg-gradient-to-r from-amber-400 to-orange-500 text-white rounded-lg font-medium hover:from-amber-500 hover:to-orange-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors"
|
| 372 |
+
>
|
| 373 |
+
Clone
|
| 374 |
+
</button>
|
| 375 |
+
|
| 376 |
+
<!-- Validation status -->
|
| 377 |
+
{#if selectedRecording}
|
| 378 |
+
<div class="mt-3 text-sm text-green-600 flex items-center gap-4">
|
| 379 |
+
<span class="flex items-center gap-1">
|
| 380 |
+
{#if isRecordingLongEnough(selectedRecording)}
|
| 381 |
+
β
|
| 382 |
+
{:else}
|
| 383 |
+
β
|
| 384 |
+
{/if}
|
| 385 |
+
at least 15 seconds
|
| 386 |
+
</span>
|
| 387 |
+
<span class="flex items-center gap-1">
|
| 388 |
+
{#if hasConsent(selectedRecording)}
|
| 389 |
+
β
|
| 390 |
+
{:else}
|
| 391 |
+
β
|
| 392 |
+
{/if}
|
| 393 |
+
includes consent
|
| 394 |
+
</span>
|
| 395 |
+
</div>
|
| 396 |
+
{/if}
|
| 397 |
+
</div>
|
| 398 |
+
</div>
|
| 399 |
+
</div>
|
| 400 |
+
</div>
|
| 401 |
+
|
| 402 |
+
<!-- Error Modal -->
|
| 403 |
+
{#if showErrorModal}
|
| 404 |
+
<div class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4">
|
| 405 |
+
<div class="bg-white rounded-xl shadow-2xl max-w-2xl w-full max-h-[80vh] flex flex-col">
|
| 406 |
+
<div class="flex items-center justify-between p-6 border-b border-gray-200 bg-red-50 flex-shrink-0">
|
| 407 |
+
<div class="flex items-center gap-3 min-w-0">
|
| 408 |
+
<div class="w-10 h-10 bg-red-100 rounded-full flex items-center justify-center flex-shrink-0">
|
| 409 |
+
<AlertCircle size={20} class="text-red-600" />
|
| 410 |
+
</div>
|
| 411 |
+
<div class="min-w-0">
|
| 412 |
+
<h3 class="text-lg font-semibold text-gray-900 truncate">{errorMessage}</h3>
|
| 413 |
+
<p class="text-sm text-gray-600">An error occurred while processing your request</p>
|
| 414 |
+
</div>
|
| 415 |
+
</div>
|
| 416 |
+
<button
|
| 417 |
+
on:click={closeErrorModal}
|
| 418 |
+
class="p-2 hover:bg-red-100 rounded-full transition-colors flex-shrink-0"
|
| 419 |
+
title="Close"
|
| 420 |
+
>
|
| 421 |
+
<X size={20} class="text-gray-500" />
|
| 422 |
+
</button>
|
| 423 |
+
</div>
|
| 424 |
+
<div class="p-6 overflow-y-auto flex-1 min-h-0">
|
| 425 |
+
{#if errorDetails}
|
| 426 |
+
<div class="bg-gray-50 rounded-lg p-4 border">
|
| 427 |
+
<h4 class="text-sm font-medium text-gray-900 mb-2">Error Details:</h4>
|
| 428 |
+
<pre class="text-xs text-gray-700 whitespace-pre-wrap font-mono leading-relaxed break-words">{errorDetails}</pre>
|
| 429 |
+
</div>
|
| 430 |
+
{/if}
|
| 431 |
+
</div>
|
| 432 |
+
<div class="flex items-center justify-end gap-3 p-6 border-t border-gray-200 bg-gray-50 flex-shrink-0">
|
| 433 |
+
<button
|
| 434 |
+
on:click={closeErrorModal}
|
| 435 |
+
class="px-6 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors"
|
| 436 |
+
>
|
| 437 |
+
Close
|
| 438 |
+
</button>
|
| 439 |
+
</div>
|
| 440 |
+
</div>
|
| 441 |
+
</div>
|
| 442 |
+
{/if}
|
hfstudio/static/_app/immutable/assets/0.DrKserg1.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.-left-full{left:-100%}.-top-2{top:-.5rem}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.left-0{left:0}.right-0{right:0}.right-2{right:.5rem}.right-4{right:1rem}.top-0{top:0}.top-2{top:.5rem}.top-full{top:100%}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.ml-0\.5{margin-left:.125rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.block{display:block}.flex{display:flex}.contents{display:contents}.hidden{display:none}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-2{height:.5rem}.h-24{height:6rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-full{height:100%}.h-screen{height:100vh}.max-h-\[80vh\]{max-height:80vh}.min-h-0{min-height:0px}.min-h-\[73px\]{min-height:73px}.w-10{width:2.5rem}.w-2{width:.5rem}.w-24{width:6rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-80{width:20rem}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[18px\]{min-width:18px}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-md{max-width:28rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.rounded-br-lg{border-bottom-right-radius:.5rem}.rounded-tl-lg{border-top-left-radius:.5rem}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-4{border-width:4px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-r{border-right-width:1px}.border-r-2{border-right-width:2px}.border-t{border-top-width:1px}.border-t-2{border-top-width:2px}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-amber-300{--tw-border-opacity: 1;border-color:rgb(252 211 77 / var(--tw-border-opacity, 1))}.border-amber-400{--tw-border-opacity: 1;border-color:rgb(251 191 36 / var(--tw-border-opacity, 1))}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-orange-100{--tw-border-opacity: 1;border-color:rgb(255 237 213 / var(--tw-border-opacity, 1))}.border-orange-200{--tw-border-opacity: 1;border-color:rgb(254 215 170 / var(--tw-border-opacity, 1))}.border-orange-300{--tw-border-opacity: 1;border-color:rgb(253 186 116 / var(--tw-border-opacity, 1))}.border-orange-500{--tw-border-opacity: 1;border-color:rgb(249 115 22 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-amber-200{--tw-bg-opacity: 1;background-color:rgb(253 230 138 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-opacity-50{--tw-bg-opacity: .5}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-amber-400{--tw-gradient-from: #fbbf24 var(--tw-gradient-from-position);--tw-gradient-to: rgb(251 191 36 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-amber-50{--tw-gradient-from: #fffbeb var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 251 235 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-amber-500{--tw-gradient-from: #f59e0b var(--tw-gradient-from-position);--tw-gradient-to: rgb(245 158 11 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-50{--tw-gradient-from: #f9fafb var(--tw-gradient-from-position);--tw-gradient-to: rgb(249 250 251 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-500{--tw-gradient-from: #a855f7 var(--tw-gradient-from-position);--tw-gradient-to: rgb(168 85 247 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-green-500{--tw-gradient-to: rgb(34 197 94 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #22c55e var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-orange-400\/40{--tw-gradient-to: rgb(251 146 60 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(251 146 60 / .4) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-pink-500{--tw-gradient-to: rgb(236 72 153 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #ec4899 var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-blue-500{--tw-gradient-to: #3b82f6 var(--tw-gradient-to-position)}.to-orange-50{--tw-gradient-to: #fff7ed var(--tw-gradient-to-position)}.to-orange-500{--tw-gradient-to: #f97316 var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.to-white{--tw-gradient-to: #fff var(--tw-gradient-to-position)}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.bg-right{background-position:right}.bg-no-repeat{background-repeat:no-repeat}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-24{padding-bottom:6rem}.pr-10{padding-right:2.5rem}.pr-4{padding-right:1rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-serif{font-family:ui-serif,Georgia,Cambria,Times New Roman,Times,serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-relaxed{line-height:1.625}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-800{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.text-amber-900{--tw-text-opacity: 1;color:rgb(120 53 15 / var(--tw-text-opacity, 1))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-orange-700{--tw-text-opacity: 1;color:rgb(194 65 12 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-transparent{color:transparent}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.opacity-30{opacity:.3}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}.duration-200{transition-duration:.2s}.duration-75{transition-duration:75ms}.ease-linear{transition-timing-function:linear}code[class*=language-],pre[class*=language-]{color:#393a34;font-family:Consolas,Bitstream Vera Sans Mono,Courier New,Courier,monospace;direction:ltr;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;font-size:.875rem;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;hyphens:none}pre[class*=language-]{padding:1rem;margin:0;overflow:auto;background:#f8f9fa}.token.comment,.token.prolog,.token.doctype,.token.cdata{color:green;font-style:italic}.token.punctuation{color:#393a34}.token.property,.token.tag,.token.boolean,.token.number,.token.constant,.token.symbol,.token.deleted{color:#e91e63}.token.selector,.token.attr-name,.token.string,.token.char,.token.builtin,.token.inserted{color:#067d17}.token.operator,.token.entity,.token.url,.language-css .token.string,.style .token.string{color:#795da3}.token.atrule,.token.attr-value,.token.keyword{color:#00f}.token.function,.token.class-name{color:#795da3}.token.regex,.token.important,.token.variable{color:#e90}.language-bash .token.function{color:#067d17}.slider-hf::-webkit-slider-thumb{height:1rem;width:1rem;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:9999px;background:linear-gradient(45deg,#ffd21e,#ff9d00);box-shadow:0 1px 3px #0000001a}.slider-hf::-moz-range-thumb{height:1rem;width:1rem;cursor:pointer;border-radius:9999px;border-width:0px;background:linear-gradient(45deg,#ffd21e,#ff9d00);box-shadow:0 1px 3px #0000001a}.pause-filled{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px}.pause-filled:before,.pause-filled:after{content:"";width:2px;height:10px;background-color:currentColor;border-radius:1px}.pause-filled:before{margin-right:2px}.pause-filled:after{margin-left:2px}.hover\:border-gray-300:hover{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.hover\:bg-amber-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-800:hover{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.hover\:bg-orange-600:hover{--tw-bg-opacity: 1;background-color:rgb(234 88 12 / var(--tw-bg-opacity, 1))}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:from-amber-500:hover{--tw-gradient-from: #f59e0b var(--tw-gradient-from-position);--tw-gradient-to: rgb(245 158 11 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:from-amber-600:hover{--tw-gradient-from: #d97706 var(--tw-gradient-from-position);--tw-gradient-to: rgb(217 119 6 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:to-orange-600:hover{--tw-gradient-to: #ea580c var(--tw-gradient-to-position)}.hover\:text-amber-700:hover{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.hover\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.hover\:text-gray-800:hover{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.focus\:border-transparent:focus{border-color:transparent}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-amber-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(251 191 36 / var(--tw-ring-opacity, 1))}.focus\:ring-orange-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(249 115 22 / var(--tw-ring-opacity, 1))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@keyframes svelte-1s3xy1i-sweep{0%{transform:translate(-100%)}to{transform:translate(300%)}}.animate-sweep.svelte-1s3xy1i{animation:svelte-1s3xy1i-sweep 1.6s linear forwards}
|
hfstudio/static/_app/immutable/assets/2.DvaEwt8V.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
.pause-filled.svelte-1e73h5m:after{content:"";width:3px;height:12px;background:currentColor;display:inline-block;margin-right:2px}.pause-filled.svelte-1e73h5m:before{content:"";width:3px;height:12px;background:currentColor;display:inline-block;margin-right:2px}
|
hfstudio/static/_app/immutable/assets/3.BNkL3CE9.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
@keyframes svelte-1vrx3m3-fade-in{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.animate-fade-in.svelte-1vrx3m3{animation:svelte-1vrx3m3-fade-in .3s ease-out}
|
hfstudio/static/_app/immutable/chunks/BCO3d5zc.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{S as _,i as m,s as $,m as c,o as d,p as i,q as u,r as g,u as p,v as h,w as f,x as N,y as A,z as C,A as b}from"./BjzGjDWb.js";import{I as q,g as v,a as I}from"./DrRA3Ukb.js";import"./IHki7fMi.js";function S(a){let e;const s=a[2].default,o=N(s,a,a[3],null);return{c(){o&&o.c()},l(n){o&&o.l(n)},m(n,t){o&&o.m(n,t),e=!0},p(n,t){o&&o.p&&(!e||t&8)&&A(o,s,n,n[3],e?b(s,n[3],t,null):C(n[3]),null)},i(n){e||(u(o,n),e=!0)},o(n){i(o,n),e=!1},d(n){o&&o.d(n)}}}function j(a){let e,s;const o=[{name:"alert-circle"},a[1],{iconNode:a[0]}];let n={$$slots:{default:[S]},$$scope:{ctx:a}};for(let t=0;t<o.length;t+=1)n=c(n,o[t]);return e=new q({props:n}),{c(){h(e.$$.fragment)},l(t){p(e.$$.fragment,t)},m(t,l){g(e,t,l),s=!0},p(t,[l]){const r=l&3?v(o,[o[0],l&2&&I(t[1]),l&1&&{iconNode:t[0]}]):{};l&8&&(r.$$scope={dirty:l,ctx:t}),e.$set(r)},i(t){s||(u(e.$$.fragment,t),s=!0)},o(t){i(e.$$.fragment,t),s=!1},d(t){d(e,t)}}}function z(a,e,s){let{$$slots:o={},$$scope:n}=e;const t=[["circle",{cx:"12",cy:"12",r:"10"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16"}]];return a.$$set=l=>{s(1,e=c(c({},e),f(l))),"$$scope"in l&&s(3,n=l.$$scope)},e=f(e),[t,e,o,n]}class J extends _{constructor(e){super(),m(this,e,z,j,$,{})}}function M(a){let e;const s=a[2].default,o=N(s,a,a[3],null);return{c(){o&&o.c()},l(n){o&&o.l(n)},m(n,t){o&&o.m(n,t),e=!0},p(n,t){o&&o.p&&(!e||t&8)&&A(o,s,n,n[3],e?b(s,n[3],t,null):C(n[3]),null)},i(n){e||(u(o,n),e=!0)},o(n){i(o,n),e=!1},d(n){o&&o.d(n)}}}function X(a){let e,s;const o=[{name:"code"},a[1],{iconNode:a[0]}];let n={$$slots:{default:[M]},$$scope:{ctx:a}};for(let t=0;t<o.length;t+=1)n=c(n,o[t]);return e=new q({props:n}),{c(){h(e.$$.fragment)},l(t){p(e.$$.fragment,t)},m(t,l){g(e,t,l),s=!0},p(t,[l]){const r=l&3?v(o,[o[0],l&2&&I(t[1]),l&1&&{iconNode:t[0]}]):{};l&8&&(r.$$scope={dirty:l,ctx:t}),e.$set(r)},i(t){s||(u(e.$$.fragment,t),s=!0)},o(t){i(e.$$.fragment,t),s=!1},d(t){d(e,t)}}}function k(a,e,s){let{$$slots:o={},$$scope:n}=e;const t=[["polyline",{points:"16 18 22 12 16 6"}],["polyline",{points:"8 6 2 12 8 18"}]];return a.$$set=l=>{s(1,e=c(c({},e),f(l))),"$$scope"in l&&s(3,n=l.$$scope)},e=f(e),[t,e,o,n]}class K extends _{constructor(e){super(),m(this,e,k,X,$,{})}}function B(a){let e;const s=a[2].default,o=N(s,a,a[3],null);return{c(){o&&o.c()},l(n){o&&o.l(n)},m(n,t){o&&o.m(n,t),e=!0},p(n,t){o&&o.p&&(!e||t&8)&&A(o,s,n,n[3],e?b(s,n[3],t,null):C(n[3]),null)},i(n){e||(u(o,n),e=!0)},o(n){i(o,n),e=!1},d(n){o&&o.d(n)}}}function D(a){let e,s;const o=[{name:"x"},a[1],{iconNode:a[0]}];let n={$$slots:{default:[B]},$$scope:{ctx:a}};for(let t=0;t<o.length;t+=1)n=c(n,o[t]);return e=new q({props:n}),{c(){h(e.$$.fragment)},l(t){p(e.$$.fragment,t)},m(t,l){g(e,t,l),s=!0},p(t,[l]){const r=l&3?v(o,[o[0],l&2&&I(t[1]),l&1&&{iconNode:t[0]}]):{};l&8&&(r.$$scope={dirty:l,ctx:t}),e.$set(r)},i(t){s||(u(e.$$.fragment,t),s=!0)},o(t){i(e.$$.fragment,t),s=!1},d(t){d(e,t)}}}function E(a,e,s){let{$$slots:o={},$$scope:n}=e;const t=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];return a.$$set=l=>{s(1,e=c(c({},e),f(l))),"$$scope"in l&&s(3,n=l.$$scope)},e=f(e),[t,e,o,n]}class L extends _{constructor(e){super(),m(this,e,E,D,$,{})}}export{J as A,K as C,L as X};
|
hfstudio/static/_app/immutable/chunks/B_t0LZOt.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{S as f,i as m,s as p,m as r,o as d,p as u,q as _,r as g,u as $,v as h,w as i,x as v,y as M,z as N,A as b}from"./BjzGjDWb.js";import{I as q,g as I,a as S}from"./DrRA3Ukb.js";import"./IHki7fMi.js";function j(l){let e;const a=l[2].default,s=v(a,l,l[3],null);return{c(){s&&s.c()},l(n){s&&s.l(n)},m(n,t){s&&s.m(n,t),e=!0},p(n,t){s&&s.p&&(!e||t&8)&&M(s,a,n,n[3],e?b(a,n[3],t,null):N(n[3]),null)},i(n){e||(_(s,n),e=!0)},o(n){u(s,n),e=!1},d(n){s&&s.d(n)}}}function z(l){let e,a;const s=[{name:"mic"},l[1],{iconNode:l[0]}];let n={$$slots:{default:[j]},$$scope:{ctx:l}};for(let t=0;t<s.length;t+=1)n=r(n,s[t]);return e=new q({props:n}),{c(){h(e.$$.fragment)},l(t){$(e.$$.fragment,t)},m(t,o){g(e,t,o),a=!0},p(t,[o]){const c=o&3?I(s,[s[0],o&2&&S(t[1]),o&1&&{iconNode:t[0]}]):{};o&8&&(c.$$scope={dirty:o,ctx:t}),e.$set(c)},i(t){a||(_(e.$$.fragment,t),a=!0)},o(t){u(e.$$.fragment,t),a=!1},d(t){d(e,t)}}}function A(l,e,a){let{$$slots:s={},$$scope:n}=e;const t=[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22"}]];return l.$$set=o=>{a(1,e=r(r({},e),i(o))),"$$scope"in o&&a(3,n=o.$$scope)},e=i(e),[t,e,s,n]}class k extends f{constructor(e){super(),m(this,e,A,z,p,{})}}export{k as M};
|
hfstudio/static/_app/immutable/chunks/BjzGjDWb.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
var Q=Object.defineProperty;var V=(t,n,e)=>n in t?Q(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var d=(t,n,e)=>V(t,typeof n!="symbol"?n+"":n,e);function w(){}function X(t,n){for(const e in n)t[e]=n[e];return t}function O(t){return t()}function k(){return Object.create(null)}function $(t){t.forEach(O)}function q(t){return typeof t=="function"}function xt(t,n){return t!=t?n==n:t!==n||t&&typeof t=="object"||typeof t=="function"}let E;function $t(t,n){return t===n?!0:(E||(E=document.createElement("a")),E.href=n,t===E.href)}function Y(t){return Object.keys(t).length===0}function Z(t,...n){if(t==null){for(const i of n)i(void 0);return w}const e=t.subscribe(...n);return e.unsubscribe?()=>e.unsubscribe():e}function bt(t,n,e){t.$$.on_destroy.push(Z(n,e))}function Et(t,n,e,i){if(t){const r=G(t,n,e,i);return t[0](r)}}function G(t,n,e,i){return t[1]&&i?X(e.ctx.slice(),t[1](i(n))):e.ctx}function vt(t,n,e,i){if(t[2]&&i){const r=t[2](i(e));if(n.dirty===void 0)return r;if(typeof r=="object"){const o=[],s=Math.max(n.dirty.length,r.length);for(let u=0;u<s;u+=1)o[u]=n.dirty[u]|r[u];return o}return n.dirty|r}return n.dirty}function wt(t,n,e,i,r,o){if(r){const s=G(n,e,i,o);t.p(s,r)}}function Tt(t){if(t.ctx.length>32){const n=[],e=t.ctx.length/32;for(let i=0;i<e;i++)n[i]=-1;return n}return-1}function Nt(t){const n={};for(const e in t)e[0]!=="$"&&(n[e]=t[e]);return n}function At(t,n){const e={};n=new Set(n);for(const i in t)!n.has(i)&&i[0]!=="$"&&(e[i]=t[i]);return e}let N=!1;function tt(){N=!0}function nt(){N=!1}function et(t,n,e,i){for(;t<n;){const r=t+(n-t>>1);e(r)<=i?t=r+1:n=r}return t}function it(t){if(t.hydrate_init)return;t.hydrate_init=!0;let n=t.childNodes;if(t.nodeName==="HEAD"){const c=[];for(let l=0;l<n.length;l++){const f=n[l];f.claim_order!==void 0&&c.push(f)}n=c}const e=new Int32Array(n.length+1),i=new Int32Array(n.length);e[0]=-1;let r=0;for(let c=0;c<n.length;c++){const l=n[c].claim_order,f=(r>0&&n[e[r]].claim_order<=l?r+1:et(1,r,b=>n[e[b]].claim_order,l))-1;i[c]=e[f]+1;const a=f+1;e[a]=c,r=Math.max(a,r)}const o=[],s=[];let u=n.length-1;for(let c=e[r]+1;c!=0;c=i[c-1]){for(o.push(n[c-1]);u>=c;u--)s.push(n[u]);u--}for(;u>=0;u--)s.push(n[u]);o.reverse(),s.sort((c,l)=>c.claim_order-l.claim_order);for(let c=0,l=0;c<s.length;c++){for(;l<o.length&&s[c].claim_order>=o[l].claim_order;)l++;const f=l<o.length?o[l]:null;t.insertBefore(s[c],f)}}function rt(t,n){if(N){for(it(t),(t.actual_end_child===void 0||t.actual_end_child!==null&&t.actual_end_child.parentNode!==t)&&(t.actual_end_child=t.firstChild);t.actual_end_child!==null&&t.actual_end_child.claim_order===void 0;)t.actual_end_child=t.actual_end_child.nextSibling;n!==t.actual_end_child?(n.claim_order!==void 0||n.parentNode!==t)&&t.insertBefore(n,t.actual_end_child):t.actual_end_child=n.nextSibling}else(n.parentNode!==t||n.nextSibling!==null)&&t.appendChild(n)}function st(t,n,e){t.insertBefore(n,e||null)}function ct(t,n,e){N&&!e?rt(t,n):(n.parentNode!==t||n.nextSibling!=e)&&t.insertBefore(n,e||null)}function T(t){t.parentNode&&t.parentNode.removeChild(t)}function Ct(t,n){for(let e=0;e<t.length;e+=1)t[e]&&t[e].d(n)}function R(t){return document.createElement(t)}function U(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function M(t){return document.createTextNode(t)}function St(){return M(" ")}function Ht(){return M("")}function Mt(t,n,e,i){return t.addEventListener(n,e,i),()=>t.removeEventListener(n,e,i)}function ot(t,n,e){e==null?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function Lt(t,n){for(const e in n)ot(t,e,n[e])}function jt(t){return t.dataset.svelteH}function kt(t){return t===""?null:+t}function lt(t){return Array.from(t.childNodes)}function z(t){t.claim_info===void 0&&(t.claim_info={last_index:0,total_claimed:0})}function F(t,n,e,i,r=!1){z(t);const o=(()=>{for(let s=t.claim_info.last_index;s<t.length;s++){const u=t[s];if(n(u)){const c=e(u);return c===void 0?t.splice(s,1):t[s]=c,r||(t.claim_info.last_index=s),u}}for(let s=t.claim_info.last_index-1;s>=0;s--){const u=t[s];if(n(u)){const c=e(u);return c===void 0?t.splice(s,1):t[s]=c,r?c===void 0&&t.claim_info.last_index--:t.claim_info.last_index=s,u}}return i()})();return o.claim_order=t.claim_info.total_claimed,t.claim_info.total_claimed+=1,o}function I(t,n,e,i){return F(t,r=>r.nodeName===n,r=>{const o=[];for(let s=0;s<r.attributes.length;s++){const u=r.attributes[s];e[u.name]||o.push(u.name)}o.forEach(s=>r.removeAttribute(s))},()=>i(n))}function Dt(t,n,e){return I(t,n,e,R)}function Pt(t,n,e){return I(t,n,e,U)}function ut(t,n){return F(t,e=>e.nodeType===3,e=>{const i=""+n;if(e.data.startsWith(i)){if(e.data.length!==i.length)return e.splitText(i.length)}else e.data=i},()=>M(n),!0)}function Bt(t){return ut(t," ")}function D(t,n,e){for(let i=e;i<t.length;i+=1){const r=t[i];if(r.nodeType===8&&r.textContent.trim()===n)return i}return-1}function Ot(t,n){const e=D(t,"HTML_TAG_START",0),i=D(t,"HTML_TAG_END",e+1);if(e===-1||i===-1)return new A(n);z(t);const r=t.splice(e,i-e+1);T(r[0]),T(r[r.length-1]);const o=r.slice(1,r.length-1);if(o.length===0)return new A(n);for(const s of o)s.claim_order=t.claim_info.total_claimed,t.claim_info.total_claimed+=1;return new A(n,o)}function qt(t,n){n=""+n,t.data!==n&&(t.data=n)}function Gt(t,n){t.value=n??""}function Rt(t,n,e,i){e==null?t.style.removeProperty(n):t.style.setProperty(n,e,"")}function at(t,n,{bubbles:e=!1,cancelable:i=!1}={}){return new CustomEvent(t,{detail:n,bubbles:e,cancelable:i})}function Ut(t,n){const e=[];let i=0;for(const r of n.childNodes)if(r.nodeType===8){const o=r.textContent.trim();o===`HEAD_${t}_END`?(i-=1,e.push(r)):o===`HEAD_${t}_START`&&(i+=1,e.push(r))}else i>0&&e.push(r);return e}class ft{constructor(n=!1){d(this,"is_svg",!1);d(this,"e");d(this,"n");d(this,"t");d(this,"a");this.is_svg=n,this.e=this.n=null}c(n){this.h(n)}m(n,e,i=null){this.e||(this.is_svg?this.e=U(e.nodeName):this.e=R(e.nodeType===11?"TEMPLATE":e.nodeName),this.t=e.tagName!=="TEMPLATE"?e:e.content,this.c(n)),this.i(i)}h(n){this.e.innerHTML=n,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(n){for(let e=0;e<this.n.length;e+=1)st(this.t,this.n[e],n)}p(n){this.d(),this.h(n),this.i(this.a)}d(){this.n.forEach(T)}}class A extends ft{constructor(e=!1,i){super(e);d(this,"l");this.e=this.n=null,this.l=i}c(e){this.l?this.n=this.l:super.c(e)}i(e){for(let i=0;i<this.n.length;i+=1)ct(this.t,this.n[i],e)}}function zt(t,n){return new t(n)}let x;function y(t){x=t}function _(){if(!x)throw new Error("Function called outside component initialization");return x}function Ft(t){_().$$.before_update.push(t)}function It(t){_().$$.on_mount.push(t)}function Wt(t){_().$$.after_update.push(t)}function Jt(t){_().$$.on_destroy.push(t)}function Kt(){const t=_();return(n,e,{cancelable:i=!1}={})=>{const r=t.$$.callbacks[n];if(r){const o=at(n,e,{cancelable:i});return r.slice().forEach(s=>{s.call(t,o)}),!o.defaultPrevented}return!0}}function Qt(t,n){return _().$$.context.set(t,n),n}function Vt(t){return _().$$.context.get(t)}function Xt(){return _().$$.context}function Yt(t){return _().$$.context.has(t)}const p=[],P=[];let g=[];const B=[],W=Promise.resolve();let S=!1;function J(){S||(S=!0,W.then(K))}function Zt(){return J(),W}function H(t){g.push(t)}const C=new Set;let m=0;function K(){if(m!==0)return;const t=x;do{try{for(;m<p.length;){const n=p[m];m++,y(n),dt(n.$$)}}catch(n){throw p.length=0,m=0,n}for(y(null),p.length=0,m=0;P.length;)P.pop()();for(let n=0;n<g.length;n+=1){const e=g[n];C.has(e)||(C.add(e),e())}g.length=0}while(p.length);for(;B.length;)B.pop()();S=!1,C.clear(),y(t)}function dt(t){if(t.fragment!==null){t.update(),$(t.before_update);const n=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,n),t.after_update.forEach(H)}}function _t(t){const n=[],e=[];g.forEach(i=>t.indexOf(i)===-1?n.push(i):e.push(i)),e.forEach(i=>i()),g=n}const v=new Set;let h;function tn(){h={r:0,c:[],p:h}}function nn(){h.r||$(h.c),h=h.p}function ht(t,n){t&&t.i&&(v.delete(t),t.i(n))}function en(t,n,e,i){if(t&&t.o){if(v.has(t))return;v.add(t),h.c.push(()=>{v.delete(t),i&&(e&&t.d(1),i())}),t.o(n)}else i&&i()}function rn(t){t&&t.c()}function sn(t,n){t&&t.l(n)}function mt(t,n,e){const{fragment:i,after_update:r}=t.$$;i&&i.m(n,e),H(()=>{const o=t.$$.on_mount.map(O).filter(q);t.$$.on_destroy?t.$$.on_destroy.push(...o):$(o),t.$$.on_mount=[]}),r.forEach(H)}function pt(t,n){const e=t.$$;e.fragment!==null&&(_t(e.after_update),$(e.on_destroy),e.fragment&&e.fragment.d(n),e.on_destroy=e.fragment=null,e.ctx=[])}function gt(t,n){t.$$.dirty[0]===-1&&(p.push(t),J(),t.$$.dirty.fill(0)),t.$$.dirty[n/31|0]|=1<<n%31}function cn(t,n,e,i,r,o,s=null,u=[-1]){const c=x;y(t);const l=t.$$={fragment:null,ctx:[],props:o,update:w,not_equal:r,bound:k(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(c?c.$$.context:[])),callbacks:k(),dirty:u,skip_bound:!1,root:n.target||c.$$.root};s&&s(l.root);let f=!1;if(l.ctx=e?e(t,n.props||{},(a,b,...L)=>{const j=L.length?L[0]:b;return l.ctx&&r(l.ctx[a],l.ctx[a]=j)&&(!l.skip_bound&&l.bound[a]&&l.bound[a](j),f&>(t,a)),b}):[],l.update(),f=!0,$(l.before_update),l.fragment=i?i(l.ctx):!1,n.target){if(n.hydrate){tt();const a=lt(n.target);l.fragment&&l.fragment.l(a),a.forEach(T)}else l.fragment&&l.fragment.c();n.intro&&ht(t.$$.fragment),mt(t,n.target,n.anchor),nt(),K()}y(c)}class on{constructor(){d(this,"$$");d(this,"$$set")}$destroy(){pt(this,1),this.$destroy=w}$on(n,e){if(!q(e))return w;const i=this.$$.callbacks[n]||(this.$$.callbacks[n]=[]);return i.push(e),()=>{const r=i.indexOf(e);r!==-1&&i.splice(r,1)}}$set(n){this.$$set&&!Y(n)&&(this.$$.skip_bound=!0,this.$$set(n),this.$$.skip_bound=!1)}}export{Kt as $,vt as A,$ as B,nn as C,ot as D,Gt as E,Mt as F,Ut as G,jt as H,Ht as I,It as J,Rt as K,Ct as L,tn as M,$t as N,Wt as O,Zt as P,zt as Q,P as R,on as S,Lt as T,Pt as U,U as V,At as W,kt as X,Ot as Y,A as Z,Ft as _,qt as a,Xt as a0,Vt as a1,Yt as a2,Jt as a3,Qt as a4,ct as b,rt as c,T as d,Dt as e,lt as f,ut as g,Bt as h,cn as i,R as j,St as k,bt as l,X as m,w as n,pt as o,en as p,ht as q,mt as r,xt as s,M as t,sn as u,rn as v,Nt as w,Et as x,wt as y,Tt as z};
|
hfstudio/static/_app/immutable/chunks/CDuamvIE.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{S as _,i as m,s as g,m as c,o as d,p as u,q as f,r as p,u as $,v as h,w as i,x as N,y as P,z as b,A as q}from"./BjzGjDWb.js";import{I as v,g as I,a as S}from"./DrRA3Ukb.js";import"./IHki7fMi.js";function j(l){let e;const o=l[2].default,s=N(o,l,l[3],null);return{c(){s&&s.c()},l(n){s&&s.l(n)},m(n,t){s&&s.m(n,t),e=!0},p(n,t){s&&s.p&&(!e||t&8)&&P(s,o,n,n[3],e?q(o,n[3],t,null):b(n[3]),null)},i(n){e||(f(s,n),e=!0)},o(n){u(s,n),e=!1},d(n){s&&s.d(n)}}}function w(l){let e,o;const s=[{name:"pause"},l[1],{iconNode:l[0]}];let n={$$slots:{default:[j]},$$scope:{ctx:l}};for(let t=0;t<s.length;t+=1)n=c(n,s[t]);return e=new v({props:n}),{c(){h(e.$$.fragment)},l(t){$(e.$$.fragment,t)},m(t,a){p(e,t,a),o=!0},p(t,[a]){const r=a&3?I(s,[s[0],a&2&&S(t[1]),a&1&&{iconNode:t[0]}]):{};a&8&&(r.$$scope={dirty:a,ctx:t}),e.$set(r)},i(t){o||(f(e.$$.fragment,t),o=!0)},o(t){u(e.$$.fragment,t),o=!1},d(t){d(e,t)}}}function z(l,e,o){let{$$slots:s={},$$scope:n}=e;const t=[["rect",{width:"4",height:"16",x:"6",y:"4"}],["rect",{width:"4",height:"16",x:"14",y:"4"}]];return l.$$set=a=>{o(1,e=c(c({},e),i(a))),"$$scope"in a&&o(3,n=a.$$scope)},e=i(e),[t,e,s,n]}class F extends _{constructor(e){super(),m(this,e,z,w,g,{})}}function A(l){let e;const o=l[2].default,s=N(o,l,l[3],null);return{c(){s&&s.c()},l(n){s&&s.l(n)},m(n,t){s&&s.m(n,t),e=!0},p(n,t){s&&s.p&&(!e||t&8)&&P(s,o,n,n[3],e?q(o,n[3],t,null):b(n[3]),null)},i(n){e||(f(s,n),e=!0)},o(n){u(s,n),e=!1},d(n){s&&s.d(n)}}}function C(l){let e,o;const s=[{name:"play"},l[1],{iconNode:l[0]}];let n={$$slots:{default:[A]},$$scope:{ctx:l}};for(let t=0;t<s.length;t+=1)n=c(n,s[t]);return e=new v({props:n}),{c(){h(e.$$.fragment)},l(t){$(e.$$.fragment,t)},m(t,a){p(e,t,a),o=!0},p(t,[a]){const r=a&3?I(s,[s[0],a&2&&S(t[1]),a&1&&{iconNode:t[0]}]):{};a&8&&(r.$$scope={dirty:a,ctx:t}),e.$set(r)},i(t){o||(f(e.$$.fragment,t),o=!0)},o(t){u(e.$$.fragment,t),o=!1},d(t){d(e,t)}}}function k(l,e,o){let{$$slots:s={},$$scope:n}=e;const t=[["polygon",{points:"5 3 19 12 5 21 5 3"}]];return l.$$set=a=>{o(1,e=c(c({},e),i(a))),"$$scope"in a&&o(3,n=a.$$scope)},e=i(e),[t,e,s,n]}class G extends _{constructor(e){super(),m(this,e,k,C,g,{})}}export{F as P,G as a};
|
hfstudio/static/_app/immutable/chunks/D7IARYO-.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{s as e}from"./e2OxhbUw.js";const r=()=>{const s=e;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},b={subscribe(s){return r().page.subscribe(s)}};export{b as p};
|
hfstudio/static/_app/immutable/chunks/DeMXkdTg.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{S as _,i as m,s as d,m as i,o as p,p as c,q as u,r as g,u as $,v as h,w as r,x as b,y as v,z as N,A as w}from"./BjzGjDWb.js";import{I as S,g as q,a as D}from"./DrRA3Ukb.js";import"./IHki7fMi.js";const k=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function I(a){let e;const s=a[2].default,o=b(s,a,a[3],null);return{c(){o&&o.c()},l(t){o&&o.l(t)},m(t,n){o&&o.m(t,n),e=!0},p(t,n){o&&o.p&&(!e||n&8)&&v(o,s,t,t[3],e?w(s,t[3],n,null):N(t[3]),null)},i(t){e||(u(o,t),e=!0)},o(t){c(o,t),e=!1},d(t){o&&o.d(t)}}}function M(a){let e,s;const o=[{name:"download"},a[1],{iconNode:a[0]}];let t={$$slots:{default:[I]},$$scope:{ctx:a}};for(let n=0;n<o.length;n+=1)t=i(t,o[n]);return e=new S({props:t}),{c(){h(e.$$.fragment)},l(n){$(e.$$.fragment,n)},m(n,l){g(e,n,l),s=!0},p(n,[l]){const f=l&3?q(o,[o[0],l&2&&D(n[1]),l&1&&{iconNode:n[0]}]):{};l&8&&(f.$$scope={dirty:l,ctx:n}),e.$set(f)},i(n){s||(u(e.$$.fragment,n),s=!0)},o(n){c(e.$$.fragment,n),s=!1},d(n){p(e,n)}}}function T(a,e,s){let{$$slots:o={},$$scope:t}=e;const n=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["polyline",{points:"7 10 12 15 17 10"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3"}]];return a.$$set=l=>{s(1,e=i(i({},e),r(l))),"$$scope"in l&&s(3,t=l.$$scope)},e=r(e),[n,e,o,t]}class B extends _{constructor(e){super(),m(this,e,T,M,d,{})}}function j(a){let e;const s=a[2].default,o=b(s,a,a[3],null);return{c(){o&&o.c()},l(t){o&&o.l(t)},m(t,n){o&&o.m(t,n),e=!0},p(t,n){o&&o.p&&(!e||n&8)&&v(o,s,t,t[3],e?w(s,t[3],n,null):N(t[3]),null)},i(t){e||(u(o,t),e=!0)},o(t){c(o,t),e=!1},d(t){o&&o.d(t)}}}function y(a){let e,s;const o=[{name:"share"},a[1],{iconNode:a[0]}];let t={$$slots:{default:[j]},$$scope:{ctx:a}};for(let n=0;n<o.length;n+=1)t=i(t,o[n]);return e=new S({props:t}),{c(){h(e.$$.fragment)},l(n){$(e.$$.fragment,n)},m(n,l){g(e,n,l),s=!0},p(n,[l]){const f=l&3?q(o,[o[0],l&2&&D(n[1]),l&1&&{iconNode:n[0]}]):{};l&8&&(f.$$scope={dirty:l,ctx:n}),e.$set(f)},i(n){s||(u(e.$$.fragment,n),s=!0)},o(n){c(e.$$.fragment,n),s=!1},d(n){p(e,n)}}}function z(a,e,s){let{$$slots:o={},$$scope:t}=e;const n=[["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}],["polyline",{points:"16 6 12 2 8 6"}],["line",{x1:"12",x2:"12",y1:"2",y2:"15"}]];return a.$$set=l=>{s(1,e=i(i({},e),r(l))),"$$scope"in l&&s(3,t=l.$$scope)},e=r(e),[n,e,o,t]}class E extends _{constructor(e){super(),m(this,e,z,y,d,{})}}export{B as D,E as S,k as g};
|
hfstudio/static/_app/immutable/chunks/DrRA3Ukb.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{B as Q,q as D,p as F,S as R,i as X,s as G,x as Y,m as W,d as b,L as Z,y as p,z as x,A as $,T as y,b as I,c as ee,U as H,f as J,I as S,V as K,W as E,w as L}from"./BjzGjDWb.js";import"./IHki7fMi.js";function P(s){return(s==null?void 0:s.length)!==void 0?s:Array.from(s)}function ie(s,t){F(s,1,1,()=>{t.delete(s.key)})}function oe(s,t,o,i,n,a,h,u,c,d,_,k){let e=s.length,l=a.length,f=e;const v={};for(;f--;)v[s[f].key]=f;const w=[],z=new Map,j=new Map,M=[];for(f=l;f--;){const r=k(n,a,f),m=o(r);let g=h.get(m);g?M.push(()=>g.p(r,t)):(g=d(m,r),g.c()),z.set(m,w[f]=g),m in v&&j.set(m,Math.abs(f-v[m]))}const q=new Set,B=new Set;function A(r){D(r,1),r.m(u,_),h.set(r.key,r),_=r.first,l--}for(;e&&l;){const r=w[l-1],m=s[e-1],g=r.key,N=m.key;r===m?(_=r.first,e--,l--):z.has(N)?!h.has(g)||q.has(g)?A(r):B.has(N)?e--:j.get(g)>j.get(N)?(B.add(g),A(r)):(q.add(N),e--):(c(m,h),e--)}for(;e--;){const r=s[e];z.has(r.key)||c(r,h)}for(;l;)A(w[l-1]);return Q(M),w}function O(s,t){const o={},i={},n={$$scope:1};let a=s.length;for(;a--;){const h=s[a],u=t[a];if(u){for(const c in h)c in u||(i[c]=1);for(const c in u)n[c]||(o[c]=u[c],n[c]=1);s[a]=u}else for(const c in h)n[c]=1}for(const h in i)h in o||(o[h]=void 0);return o}function ae(s){return typeof s=="object"&&s!==null?s:{}}/**
|
| 2 |
+
* @license lucide-svelte v0.303.0 - ISC
|
| 3 |
+
|
| 4 |
+
This source code is licensed under the ISC license.
|
| 5 |
+
See the LICENSE file in the root directory of this source tree.
|
| 6 |
+
*/const T={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};function U(s,t,o){const i=s.slice();return i[10]=t[o][0],i[11]=t[o][1],i}function C(s){let t,o=[s[11]],i={};for(let n=0;n<o.length;n+=1)i=W(i,o[n]);return{c(){t=K(s[10]),this.h()},l(n){t=H(n,s[10],{}),J(t).forEach(b),this.h()},h(){y(t,i)},m(n,a){I(n,t,a)},p(n,a){y(t,i=O(o,[a&32&&n[11]]))},d(n){n&&b(t)}}}function V(s){let t=s[10],o,i=s[10]&&C(s);return{c(){i&&i.c(),o=S()},l(n){i&&i.l(n),o=S()},m(n,a){i&&i.m(n,a),I(n,o,a)},p(n,a){n[10]?t?G(t,n[10])?(i.d(1),i=C(n),t=n[10],i.c(),i.m(o.parentNode,o)):i.p(n,a):(i=C(n),t=n[10],i.c(),i.m(o.parentNode,o)):t&&(i.d(1),i=null,t=n[10])},d(n){n&&b(o),i&&i.d(n)}}}function te(s){let t,o,i,n,a,h=P(s[5]),u=[];for(let e=0;e<h.length;e+=1)u[e]=V(U(s,h,e));const c=s[9].default,d=Y(c,s,s[8],null);let _=[T,s[6],{width:s[2]},{height:s[2]},{stroke:s[1]},{"stroke-width":i=s[4]?Number(s[3])*24/Number(s[2]):s[3]},{class:n=`lucide-icon lucide lucide-${s[0]} ${s[7].class??""}`}],k={};for(let e=0;e<_.length;e+=1)k=W(k,_[e]);return{c(){t=K("svg");for(let e=0;e<u.length;e+=1)u[e].c();o=S(),d&&d.c(),this.h()},l(e){t=H(e,"svg",{width:!0,height:!0,stroke:!0,"stroke-width":!0,class:!0});var l=J(t);for(let f=0;f<u.length;f+=1)u[f].l(l);o=S(),d&&d.l(l),l.forEach(b),this.h()},h(){y(t,k)},m(e,l){I(e,t,l);for(let f=0;f<u.length;f+=1)u[f]&&u[f].m(t,null);ee(t,o),d&&d.m(t,null),a=!0},p(e,[l]){if(l&32){h=P(e[5]);let f;for(f=0;f<h.length;f+=1){const v=U(e,h,f);u[f]?u[f].p(v,l):(u[f]=V(v),u[f].c(),u[f].m(t,o))}for(;f<u.length;f+=1)u[f].d(1);u.length=h.length}d&&d.p&&(!a||l&256)&&p(d,c,e,e[8],a?$(c,e[8],l,null):x(e[8]),null),y(t,k=O(_,[T,l&64&&e[6],(!a||l&4)&&{width:e[2]},(!a||l&4)&&{height:e[2]},(!a||l&2)&&{stroke:e[1]},(!a||l&28&&i!==(i=e[4]?Number(e[3])*24/Number(e[2]):e[3]))&&{"stroke-width":i},(!a||l&129&&n!==(n=`lucide-icon lucide lucide-${e[0]} ${e[7].class??""}`))&&{class:n}]))},i(e){a||(D(d,e),a=!0)},o(e){F(d,e),a=!1},d(e){e&&b(t),Z(u,e),d&&d.d(e)}}}function se(s,t,o){const i=["name","color","size","strokeWidth","absoluteStrokeWidth","iconNode"];let n=E(t,i),{$$slots:a={},$$scope:h}=t,{name:u}=t,{color:c="currentColor"}=t,{size:d=24}=t,{strokeWidth:_=2}=t,{absoluteStrokeWidth:k=!1}=t,{iconNode:e}=t;return s.$$set=l=>{o(7,t=W(W({},t),L(l))),o(6,n=E(t,i)),"name"in l&&o(0,u=l.name),"color"in l&&o(1,c=l.color),"size"in l&&o(2,d=l.size),"strokeWidth"in l&&o(3,_=l.strokeWidth),"absoluteStrokeWidth"in l&&o(4,k=l.absoluteStrokeWidth),"iconNode"in l&&o(5,e=l.iconNode),"$$scope"in l&&o(8,h=l.$$scope)},t=L(t),[u,c,d,_,k,e,n,t,h,a]}class fe extends R{constructor(t){super(),X(this,t,se,te,G,{name:0,color:1,size:2,strokeWidth:3,absoluteStrokeWidth:4,iconNode:5})}}export{fe as I,ae as a,P as e,O as g,ie as o,oe as u};
|
hfstudio/static/_app/immutable/chunks/e2OxhbUw.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
var St=Object.defineProperty;var kt=(e,t,n)=>t in e?St(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var R=(e,t,n)=>kt(e,typeof t!="symbol"?t+"":t,n);import{S as Et,O as At,_ as Rt,$ as Tt,a0 as It,a1 as Ut,a2 as Lt,a3 as $t,J as ve,a4 as xt,P as be,n as ge,s as Ct}from"./BjzGjDWb.js";class Ze extends Et{constructor(n){if(!n||!n.target&&!n.$$inline)throw new Error("'target' is a required option");super();R(this,"$$prop_def");R(this,"$$events_def");R(this,"$$slot_def")}$destroy(){super.$destroy(),this.$destroy=()=>{console.warn("Component was already destroyed")}}$capture_state(){}$inject_state(){}}class Pt extends Ze{}const Ot=Object.freeze(Object.defineProperty({__proto__:null,SvelteComponent:Ze,SvelteComponentTyped:Pt,afterUpdate:At,beforeUpdate:Rt,createEventDispatcher:Tt,getAllContexts:It,getContext:Ut,hasContext:Lt,onDestroy:$t,onMount:ve,setContext:xt,tick:be},Symbol.toStringTag,{value:"Module"}));class ie{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Re{constructor(t,n){this.status=t,this.location=n}}class Te extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function jt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function Nt(e){return e.split("%25").map(decodeURI).join("%25")}function Dt(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function me({href:e}){return e.split("#")[0]}function Bt(e,t,n,r=!1){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(i,o){if(o==="get"||o==="getAll"||o==="has")return l=>(n(l),i[o](l));t();const c=Reflect.get(i,o);return typeof c=="function"?c.bind(i):c}}),enumerable:!0,configurable:!0});const s=["href","pathname","search","toString","toJSON"];r&&s.push("hash");for(const i of s)Object.defineProperty(a,i,{get(){return t(),e[i]},enumerable:!0,configurable:!0});return a}function Ft(...e){let t=5381;for(const n of e)if(typeof n=="string"){let r=n.length;for(;r;)t=t*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)t=t*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;const Mt=new TextDecoder;function Vt(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const qt=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:(t==null?void 0:t.method)||"GET")!=="GET"&&Y.delete(Ie(e)),qt(e,t));const Y=new Map;function Gt(e,t){const n=Ie(e,t),r=document.querySelector(n);if(r!=null&&r.textContent){r.remove();let{body:a,...s}=JSON.parse(r.textContent);const i=r.getAttribute("data-ttl");return i&&Y.set(n,{body:a,init:s,ttl:1e3*Number(i)}),r.getAttribute("data-b64")!==null&&(a=Vt(a)),Promise.resolve(new Response(a,s))}return window.fetch(e,t)}function Yt(e,t,n){if(Y.size>0){const r=Ie(e,n),a=Y.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(n==null?void 0:n.cache))return new Response(a.body,a.init);Y.delete(r)}}return window.fetch(t,n)}function Ie(e,t){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t!=null&&t.headers||t!=null&&t.body){const a=[];t.headers&&a.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&a.push(t.body),r+=`[data-hash="${Ft(...a)}"]`}return r}const Ht=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Kt(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${Wt(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const s=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(s)return t.push({name:s[1],matcher:s[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const i=r.split(/\[(.+?)\](?!\])/);return"/"+i.map((c,l)=>{if(l%2){if(c.startsWith("x+"))return _e(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return _e(String.fromCharCode(...c.slice(2).split("-").map(u=>parseInt(u,16))));const d=Ht.exec(c),[,h,y,f,p]=d;return t.push({name:f,matcher:p,optional:!!h,rest:!!y,chained:y?l===1&&i[0]==="":!1}),y?"([^]*?)":h?"([^/]*)?":"([^/]+?)"}return _e(c)}).join("")}).join("")}/?$`),params:t}}function zt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function Wt(e){return e.slice(1).split("/").filter(zt)}function Jt(e,t,n){const r={},a=e.slice(1),s=a.filter(o=>o!==void 0);let i=0;for(let o=0;o<t.length;o+=1){const c=t[o];let l=a[o-i];if(c.chained&&c.rest&&i&&(l=a.slice(o-i,o+1).filter(d=>d).join("/"),i=0),l===void 0){c.rest&&(r[c.name]="");continue}if(!c.matcher||n[c.matcher](l)){r[c.name]=l;const d=t[o+1],h=a[o+1];d&&!d.rest&&d.optional&&h&&c.chained&&(i=0),!d&&!h&&Object.keys(r).length===s.length&&(i=0);continue}if(c.optional&&c.chained){i++;continue}return}if(!i)return r}function _e(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Xt({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([o,[c,l,d]])=>{const{pattern:h,params:y}=Kt(o),f={id:o,exec:p=>{const u=h.exec(p);if(u)return Jt(u,y,r)},errors:[1,...d||[]].map(p=>e[p]),layouts:[0,...l||[]].map(i),leaf:s(c)};return f.errors.length=f.layouts.length=Math.max(f.errors.length,f.layouts.length),f});function s(o){const c=o<0;return c&&(o=~o),[c,e[o]]}function i(o){return o===void 0?o:[a.has(o),e[o]]}}function Qe(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function Fe(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const D=[];function Ue(e,t=ge){let n;const r=new Set;function a(o){if(Ct(e,o)&&(e=o,n)){const c=!D.length;for(const l of r)l[1](),D.push(l,e);if(c){for(let l=0;l<D.length;l+=2)D[l][0](D[l+1]);D.length=0}}}function s(o){a(o(e))}function i(o,c=ge){const l=[o,c];return r.add(l),r.size===1&&(n=t(a,s)||ge),o(e),()=>{r.delete(l),r.size===0&&n&&(n(),n=null)}}return{set:a,update:s,subscribe:i}}var Je;const $=((Je=globalThis.__sveltekit_j7e979)==null?void 0:Je.base)??"";var Xe;const Zt=((Xe=globalThis.__sveltekit_j7e979)==null?void 0:Xe.assets)??$??"",Qt="1761244884160",et="sveltekit:snapshot",tt="sveltekit:scroll",nt="sveltekit:states",en="sveltekit:pageurl",F="sveltekit:history",z="sveltekit:navigation",O={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},ce=location.origin;function at(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function le(){return{x:pageXOffset,y:pageYOffset}}function B(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const Me={...O,"":O.hover};function rt(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function ot(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=rt(e)}}function Se(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const o=location.hash.split("#")[1]||"/";r.hash=`#${o}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,s=!r||!!a||fe(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),i=(r==null?void 0:r.origin)===ce&&e.hasAttribute("download");return{url:r,external:s,target:a,download:i}}function Q(e){let t=null,n=null,r=null,a=null,s=null,i=null,o=e;for(;o&&o!==document.documentElement;)r===null&&(r=B(o,"preload-code")),a===null&&(a=B(o,"preload-data")),t===null&&(t=B(o,"keepfocus")),n===null&&(n=B(o,"noscroll")),s===null&&(s=B(o,"reload")),i===null&&(i=B(o,"replacestate")),o=rt(o);function c(l){switch(l){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Me[r??"off"],preload_data:Me[a??"off"],keepfocus:c(t),noscroll:c(n),reload:c(s),replace_state:c(i)}}function Ve(e){const t=Ue(e);let n=!0;function r(){n=!0,t.update(i=>i)}function a(i){n=!1,t.set(i)}function s(i){let o;return t.subscribe(c=>{(o===void 0||n&&c!==o)&&i(o=c)})}return{notify:r,set:a,subscribe:s}}const st={v:()=>{}};function tn(){const{set:e,subscribe:t}=Ue(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Zt}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const i=(await a.json()).version!==Qt;return i&&(e(!0),st.v(),clearTimeout(n)),i}catch{return!1}}return{subscribe:t,check:r}}function fe(e,t,n){return e.origin!==ce||!e.pathname.startsWith(t)?!0:n?!(e.pathname===t+"/"||e.pathname===t+"/index.html"||e.protocol==="file:"&&e.pathname.replace(/\/[^/]+\.html?$/,"")===t):!1}function qn(e){}function nn(e){const t=rn(e),n=new ArrayBuffer(t.length),r=new DataView(n);for(let a=0;a<n.byteLength;a++)r.setUint8(a,t.charCodeAt(a));return n}const an="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function rn(e){e.length%4===0&&(e=e.replace(/==?$/,""));let t="",n=0,r=0;for(let a=0;a<e.length;a++)n<<=6,n|=an.indexOf(e[a]),r+=6,r===24&&(t+=String.fromCharCode((n&16711680)>>16),t+=String.fromCharCode((n&65280)>>8),t+=String.fromCharCode(n&255),n=r=0);return r===12?(n>>=4,t+=String.fromCharCode(n)):r===18&&(n>>=2,t+=String.fromCharCode((n&65280)>>8),t+=String.fromCharCode(n&255)),t}const on=-1,sn=-2,cn=-3,ln=-4,fn=-5,un=-6;function dn(e,t){if(typeof e=="number")return a(e,!0);if(!Array.isArray(e)||e.length===0)throw new Error("Invalid input");const n=e,r=Array(n.length);function a(s,i=!1){if(s===on)return;if(s===cn)return NaN;if(s===ln)return 1/0;if(s===fn)return-1/0;if(s===un)return-0;if(i||typeof s!="number")throw new Error("Invalid input");if(s in r)return r[s];const o=n[s];if(!o||typeof o!="object")r[s]=o;else if(Array.isArray(o))if(typeof o[0]=="string"){const c=o[0],l=t==null?void 0:t[c];if(l)return r[s]=l(a(o[1]));switch(c){case"Date":r[s]=new Date(o[1]);break;case"Set":const d=new Set;r[s]=d;for(let f=1;f<o.length;f+=1)d.add(a(o[f]));break;case"Map":const h=new Map;r[s]=h;for(let f=1;f<o.length;f+=2)h.set(a(o[f]),a(o[f+1]));break;case"RegExp":r[s]=new RegExp(o[1],o[2]);break;case"Object":r[s]=Object(o[1]);break;case"BigInt":r[s]=BigInt(o[1]);break;case"null":const y=Object.create(null);r[s]=y;for(let f=1;f<o.length;f+=2)y[o[f]]=a(o[f+1]);break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":{const f=globalThis[c],p=new f(a(o[1]));r[s]=o[2]!==void 0?p.subarray(o[2],o[3]):p;break}case"ArrayBuffer":{const f=o[1],p=nn(f);r[s]=p;break}case"Temporal.Duration":case"Temporal.Instant":case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.PlainMonthDay":case"Temporal.PlainYearMonth":case"Temporal.ZonedDateTime":{const f=c.slice(9);r[s]=Temporal[f].from(o[1]);break}case"URL":{const f=new URL(o[1]);r[s]=f;break}case"URLSearchParams":{const f=new URLSearchParams(o[1]);r[s]=f;break}default:throw new Error(`Unknown type ${c}`)}}else{const c=new Array(o.length);r[s]=c;for(let l=0;l<o.length;l+=1){const d=o[l];d!==sn&&(c[l]=a(d))}}else{const c={};r[s]=c;for(const l in o){if(l==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");const d=o[l];c[l]=a(d)}}return r[s]}return a(0)}const it=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...it];const hn=new Set([...it]);[...hn];function pn(e){return e.filter(t=>t!=null)}const gn="x-sveltekit-invalidated",mn="x-sveltekit-trailing-slash";function ee(e){return e instanceof ie||e instanceof Te?e.status:500}function _n(e){return e instanceof Te?e.text:"Internal Error"}let T,W,we;const wn=ve.toString().includes("$$")||/function \w+\(\) \{\}/.test(ve.toString());wn?(T={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},W={current:null},we={current:!1}):(T=new class{constructor(){R(this,"data",$state.raw({}));R(this,"form",$state.raw(null));R(this,"error",$state.raw(null));R(this,"params",$state.raw({}));R(this,"route",$state.raw({id:null}));R(this,"state",$state.raw({}));R(this,"status",$state.raw(-1));R(this,"url",$state.raw(new URL("https://example.com")))}},W=new class{constructor(){R(this,"current",$state.raw(null))}},we=new class{constructor(){R(this,"current",$state.raw(!1))}},st.v=()=>we.current=!0);function yn(e){Object.assign(T,e)}const vn="/__data.json",bn=".html__data.json";function Sn(e){return e.endsWith(".html")?e.replace(/\.html$/,bn):e.replace(/\/$/,"")+vn}const qe={spanContext(){return kn},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},kn={traceId:"",spanId:"",traceFlags:0},{tick:En}=Ot,An=new Set(["icon","shortcut icon","apple-touch-icon"]),N=Qe(tt)??{},J=Qe(et)??{},C={url:Ve({}),page:Ve({}),navigating:Ue(null),updated:tn()};function Le(e){N[e]=le()}function Rn(e,t){let n=e+1;for(;N[n];)delete N[n],n+=1;for(n=t+1;J[n];)delete J[n],n+=1}function q(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function ct(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration($||"/");e&&await e.update()}}function Ge(){}let $e,ke,te,x,Ee,k;const ne=[],ae=[];let U=null;const Z=new Map,lt=new Set,Tn=new Set,H=new Set;let b={branch:[],error:null,url:null},xe=!1,re=!1,Ye=!0,X=!1,G=!1,ft=!1,Ce=!1,ut,A,L,j;const K=new Set,He=new Map;async function Kn(e,t,n){var s,i,o,c,l;(s=globalThis.__sveltekit_j7e979)!=null&&s.data&&globalThis.__sveltekit_j7e979.data,document.URL!==location.href&&(location.href=location.href),k=e,await((o=(i=e.hooks).init)==null?void 0:o.call(i)),$e=Xt(e),x=document.documentElement,Ee=t,ke=e.nodes[0],te=e.nodes[1],ke(),te(),A=(c=history.state)==null?void 0:c[F],L=(l=history.state)==null?void 0:l[z],A||(A=L=Date.now(),history.replaceState({...history.state,[F]:A,[z]:L},""));const r=N[A];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await Dn(Ee,n)):(await M({type:"enter",url:at(k.hash?Fn(new URL(location.href)):location.href),replace_state:!0}),a()),Nn()}function In(){ne.length=0,Ce=!1}function dt(e){ae.some(t=>t==null?void 0:t.snapshot)&&(J[e]=ae.map(t=>{var n;return(n=t==null?void 0:t.snapshot)==null?void 0:n.capture()}))}function ht(e){var t;(t=J[e])==null||t.forEach((n,r)=>{var a,s;(s=(a=ae[r])==null?void 0:a.snapshot)==null||s.restore(n)})}function Ke(){Le(A),Fe(tt,N),dt(L),Fe(et,J)}async function Un(e,t,n,r){let a;t.invalidateAll&&(U=null),await M({type:"goto",url:at(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(Ce=!0,a=[...He.keys()]),t.invalidate&&t.invalidate.forEach(jn)}}),t.invalidateAll&&be().then(be).then(()=>{He.forEach(({resource:s},i)=>{var o;a!=null&&a.includes(i)&&((o=s.refresh)==null||o.call(s))})})}async function Ln(e){if(e.id!==(U==null?void 0:U.id)){const t={};K.add(t),U={id:e.id,token:t,promise:mt({...e,preload:t}).then(n=>(K.delete(t),n.type==="loaded"&&n.state.error&&(U=null),n))}}return U.promise}async function ye(e){var n;const t=(n=await de(e,!1))==null?void 0:n.route;t&&await Promise.all([...t.layouts,t.leaf].map(r=>r==null?void 0:r[1]()))}function pt(e,t,n){var a;b=e.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(T,e.props.page),ut=new k.root({target:t,props:{...e.props,stores:C,components:ae},hydrate:n,sync:!1}),ht(L),n){const s={from:null,to:{params:b.params,route:{id:((a=b.route)==null?void 0:a.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};H.forEach(i=>i(s))}re=!0}function oe({url:e,params:t,branch:n,status:r,error:a,route:s,form:i}){let o="never";if($&&(e.pathname===$||e.pathname===$+"/"))o="always";else for(const f of n)(f==null?void 0:f.slash)!==void 0&&(o=f.slash);e.pathname=jt(e.pathname,o),e.search=e.search;const c={type:"loaded",state:{url:e,params:t,branch:n,error:a,route:s},props:{constructors:pn(n).map(f=>f.node.component),page:Ne(T)}};i!==void 0&&(c.props.form=i);let l={},d=!T,h=0;for(let f=0;f<Math.max(n.length,b.branch.length);f+=1){const p=n[f],u=b.branch[f];(p==null?void 0:p.data)!==(u==null?void 0:u.data)&&(d=!0),p&&(l={...l,...p.data},d&&(c.props[`data_${h}`]=l),h+=1)}return(!b.url||e.href!==b.url.href||b.error!==a||i!==void 0&&i!==T.form||d)&&(c.props.page={error:a,params:t,route:{id:(s==null?void 0:s.id)??null},state:{},status:r,url:new URL(e),form:i??null,data:d?l:T.data}),c}async function Pe({loader:e,parent:t,url:n,params:r,route:a,server_data_node:s}){var d,h,y;let i=null,o=!0;const c={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},l=await e();if((d=l.universal)!=null&&d.load){let f=function(...u){for(const g of u){const{href:_}=new URL(g,n);c.dependencies.add(_)}};const p={tracing:{enabled:!1,root:qe,current:qe},route:new Proxy(a,{get:(u,g)=>(o&&(c.route=!0),u[g])}),params:new Proxy(r,{get:(u,g)=>(o&&c.params.add(g),u[g])}),data:(s==null?void 0:s.data)??null,url:Bt(n,()=>{o&&(c.url=!0)},u=>{o&&c.search_params.add(u)},k.hash),async fetch(u,g){u instanceof Request&&(g={body:u.method==="GET"||u.method==="HEAD"?void 0:await u.blob(),cache:u.cache,credentials:u.credentials,headers:[...u.headers].length>0?u==null?void 0:u.headers:void 0,integrity:u.integrity,keepalive:u.keepalive,method:u.method,mode:u.mode,redirect:u.redirect,referrer:u.referrer,referrerPolicy:u.referrerPolicy,signal:u.signal,...g});const{resolved:_,promise:I}=gt(u,g,n);return o&&f(_.href),I},setHeaders:()=>{},depends:f,parent(){return o&&(c.parent=!0),t()},untrack(u){o=!1;try{return u()}finally{o=!0}}};i=await l.universal.load.call(null,p)??null}return{node:l,loader:e,server:s,universal:(h=l.universal)!=null&&h.load?{type:"data",data:i,uses:c}:null,data:i??(s==null?void 0:s.data)??null,slash:((y=l.universal)==null?void 0:y.trailingSlash)??(s==null?void 0:s.slash)}}function gt(e,t,n){let r=e instanceof Request?e.url:e;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const s=re?Yt(r,a.href,t):Gt(r,t);return{resolved:a,promise:s}}function ze(e,t,n,r,a,s){if(Ce)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const i of a.search_params)if(r.has(i))return!0;for(const i of a.params)if(s[i]!==b.params[i])return!0;for(const i of a.dependencies)if(ne.some(o=>o(new URL(i))))return!0;return!1}function Oe(e,t){return(e==null?void 0:e.type)==="data"?e:(e==null?void 0:e.type)==="skip"?t??null:null}function $n(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),s=t.searchParams.getAll(r);a.every(i=>s.includes(i))&&s.every(i=>a.includes(i))&&n.delete(r)}return n}function We({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:Ne(T),constructors:[]}}}async function mt({id:e,invalidating:t,url:n,params:r,route:a,preload:s}){if((U==null?void 0:U.id)===e)return K.delete(U.token),U.promise;const{errors:i,layouts:o,leaf:c}=a,l=[...o,c];i.forEach(w=>w==null?void 0:w().catch(()=>{})),l.forEach(w=>w==null?void 0:w[1]().catch(()=>{}));let d=null;const h=b.url?e!==se(b.url):!1,y=b.route?a.id!==b.route.id:!1,f=$n(b.url,n);let p=!1;const u=l.map((w,m)=>{var P;const v=b.branch[m],S=!!(w!=null&&w[0])&&((v==null?void 0:v.loader)!==w[1]||ze(p,y,h,f,(P=v.server)==null?void 0:P.uses,r));return S&&(p=!0),S});if(u.some(Boolean)){try{d=await yt(n,u)}catch(w){const m=await V(w,{url:n,params:r,route:{id:e}});return K.has(s)?We({error:m,url:n,params:r,route:a}):ue({status:ee(w),error:m,url:n,route:a})}if(d.type==="redirect")return d}const g=d==null?void 0:d.nodes;let _=!1;const I=l.map(async(w,m)=>{var he;if(!w)return;const v=b.branch[m],S=g==null?void 0:g[m];if((!S||S.type==="skip")&&w[1]===(v==null?void 0:v.loader)&&!ze(_,y,h,f,(he=v.universal)==null?void 0:he.uses,r))return v;if(_=!0,(S==null?void 0:S.type)==="error")throw S;return Pe({loader:w[1],url:n,params:r,route:a,parent:async()=>{var Be;const De={};for(let pe=0;pe<m;pe+=1)Object.assign(De,(Be=await I[pe])==null?void 0:Be.data);return De},server_data_node:Oe(S===void 0&&w[0]?{type:"skip"}:S??null,w[0]?v==null?void 0:v.server:void 0)})});for(const w of I)w.catch(()=>{});const E=[];for(let w=0;w<l.length;w+=1)if(l[w])try{E.push(await I[w])}catch(m){if(m instanceof Re)return{type:"redirect",location:m.location};if(K.has(s))return We({error:await V(m,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let v=ee(m),S;if(g!=null&&g.includes(m))v=m.status??v,S=m.error;else if(m instanceof ie)S=m.body;else{if(await C.updated.check())return await ct(),await q(n);S=await V(m,{params:r,url:n,route:{id:a.id}})}const P=await xn(w,E,i);return P?oe({url:n,params:r,branch:E.slice(0,P.idx).concat(P.node),status:v,error:S,route:a}):await wt(n,{id:a.id},S,v)}else E.push(void 0);return oe({url:n,params:r,branch:E,status:200,error:null,route:a,form:t?void 0:null})}async function xn(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)r-=1;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function ue({status:e,error:t,url:n,route:r}){const a={};let s=null;if(k.server_loads[0]===0)try{const o=await yt(n,[!0]);if(o.type!=="data"||o.nodes[0]&&o.nodes[0].type!=="data")throw 0;s=o.nodes[0]??null}catch{(n.origin!==ce||n.pathname!==location.pathname||xe)&&await q(n)}try{const o=await Pe({loader:ke,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:Oe(s)}),c={node:await te(),loader:te,universal:null,server:null,data:null};return oe({url:n,params:a,branch:[o,c],status:e,error:t,route:null})}catch(o){if(o instanceof Re)return Un(new URL(o.location,location.href),{},0);throw o}}async function Cn(e){const t=e.href;if(Z.has(t))return Z.get(t);let n;try{const r=(async()=>{let a=await k.hooks.reroute({url:new URL(e),fetch:async(s,i)=>gt(s,i,e).promise})??e;if(typeof a=="string"){const s=new URL(e);k.hash?s.hash=a:s.pathname=a,a=s}return a})();Z.set(t,r),n=await r}catch{Z.delete(t);return}return n}async function de(e,t){if(e&&!fe(e,$,k.hash)){const n=await Cn(e);if(!n)return;const r=Pn(n);for(const a of $e){const s=a.exec(r);if(s)return{id:se(e),invalidating:t,route:a,params:Dt(s),url:e}}}}function Pn(e){return Nt(k.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice($.length))||"/"}function se(e){return(k.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function _t({url:e,type:t,intent:n,delta:r,event:a}){let s=!1;const i=je(b,n,e,t);r!==void 0&&(i.navigation.delta=r),a!==void 0&&(i.navigation.event=a);const o={...i.navigation,cancel:()=>{s=!0,i.reject(new Error("navigation cancelled"))}};return X||lt.forEach(c=>c(o)),s?null:i}async function M({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:s,state:i={},redirect_count:o=0,nav_token:c={},accept:l=Ge,block:d=Ge,event:h}){const y=j;j=c;const f=await de(t,!1),p=e==="enter"?je(b,f,t,e):_t({url:t,type:e,delta:n==null?void 0:n.delta,intent:f,event:h});if(!p){d(),j===c&&(j=y);return}const u=A,g=L;l(),X=!0,re&&p.navigation.type!=="enter"&&C.navigating.set(W.current=p.navigation);let _=f&&await mt(f);if(!_){if(fe(t,$,k.hash))return await q(t,s);_=await wt(t,{id:null},await V(new Te(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,s)}if(t=(f==null?void 0:f.url)||t,j!==c)return p.reject(new Error("navigation aborted")),!1;if(_.type==="redirect"){if(o<20){await M({type:e,url:new URL(_.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:s,state:i,redirect_count:o+1,nav_token:c}),p.fulfil(void 0);return}_=await ue({status:500,error:await V(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else _.props.page.status>=400&&await C.updated.check()&&(await ct(),await q(t,s));if(In(),Le(u),dt(g),_.props.page.url.pathname!==t.pathname&&(t.pathname=_.props.page.url.pathname),i=n?n.state:i,!n){const m=s?0:1,v={[F]:A+=m,[z]:L+=m,[nt]:i};(s?history.replaceState:history.pushState).call(history,v,"",t),s||Rn(A,L)}if(U=null,_.props.page.state=i,re){const m=(await Promise.all(Array.from(Tn,v=>v(p.navigation)))).filter(v=>typeof v=="function");if(m.length>0){let v=function(){m.forEach(S=>{H.delete(S)})};m.push(v),m.forEach(S=>{H.add(S)})}b=_.state,_.props.page&&(_.props.page.url=t),ut.$set(_.props),yn(_.props.page),ft=!0}else pt(_,Ee,!1);const{activeElement:I}=document;await En();let E=n?n.scroll:a?le():null;if(Ye){const m=t.hash&&document.getElementById(bt(t));if(E)scrollTo(E.x,E.y);else if(m){m.scrollIntoView();const{top:v,left:S}=m.getBoundingClientRect();E={x:pageXOffset+S,y:pageYOffset+v}}else scrollTo(0,0)}const w=document.activeElement!==I&&document.activeElement!==document.body;!r&&!w&&Bn(t,E),Ye=!0,_.props.page&&Object.assign(T,_.props.page),X=!1,e==="popstate"&&ht(L),p.fulfil(void 0),H.forEach(m=>m(p.navigation)),C.navigating.set(W.current=null)}async function wt(e,t,n,r,a){return e.origin===ce&&e.pathname===location.pathname&&!xe?await ue({status:r,error:n,url:e,route:t}):await q(e,a)}function On(){let e,t,n;x.addEventListener("mousemove",o=>{const c=o.target;clearTimeout(e),e=setTimeout(()=>{s(c,O.hover)},20)});function r(o){o.defaultPrevented||s(o.composedPath()[0],O.tap)}x.addEventListener("mousedown",r),x.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(o=>{for(const c of o)c.isIntersecting&&(ye(new URL(c.target.href)),a.unobserve(c.target))},{threshold:0});async function s(o,c){const l=ot(o,x),d=l===t&&c>=n;if(!l||d)return;const{url:h,external:y,download:f}=Se(l,$,k.hash);if(y||f)return;const p=Q(l),u=h&&se(b.url)===se(h);if(!(p.reload||u))if(c<=p.preload_data){t=l,n=O.tap;const g=await de(h,!1);if(!g)return;Ln(g)}else c<=p.preload_code&&(t=l,n=c,ye(h))}function i(){a.disconnect();for(const o of x.querySelectorAll("a")){const{url:c,external:l,download:d}=Se(o,$,k.hash);if(l||d)continue;const h=Q(o);h.reload||(h.preload_code===O.viewport&&a.observe(o),h.preload_code===O.eager&&ye(c))}}H.add(i),i()}function V(e,t){if(e instanceof ie)return e.body;const n=ee(e),r=_n(e);return k.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function jn(e){if(typeof e=="function")ne.push(e);else{const{href:t}=new URL(e,location.href);ne.push(n=>n.href===t)}}function Nn(){var t;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let r=!1;if(Ke(),!X){const a=je(b,void 0,null,"leave"),s={...a.navigation,cancel:()=>{r=!0,a.reject(new Error("navigation cancelled"))}};lt.forEach(i=>i(s))}r?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ke()}),(t=navigator.connection)!=null&&t.saveData||On(),x.addEventListener("click",async n=>{if(n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const r=ot(n.composedPath()[0],x);if(!r)return;const{url:a,external:s,target:i,download:o}=Se(r,$,k.hash);if(!a)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const c=Q(r);if(!(r instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||o)return;const[d,h]=(k.hash?a.hash.replace(/^#/,""):a.href).split("#"),y=d===me(location);if(s||c.reload&&(!y||!h)){_t({url:a,type:"link",event:n})?X=!0:n.preventDefault();return}if(h!==void 0&&y){const[,f]=b.url.href.split("#");if(f===h){if(n.preventDefault(),h===""||h==="top"&&r.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const p=r.ownerDocument.getElementById(decodeURIComponent(h));p&&(p.scrollIntoView(),p.focus())}return}if(G=!0,Le(A),e(a),!c.replace_state)return;G=!1}n.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await M({type:"link",url:a,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??a.href===location.href,event:n})}),x.addEventListener("submit",n=>{if(n.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(n.target),a=n.submitter;if(((a==null?void 0:a.formTarget)||r.target)==="_blank"||((a==null?void 0:a.formMethod)||r.method)!=="get")return;const o=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||r.action);if(fe(o,$,!1))return;const c=n.target,l=Q(c);if(l.reload)return;n.preventDefault(),n.stopPropagation();const d=new FormData(c,a);o.search=new URLSearchParams(d).toString(),M({type:"form",url:o,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??o.href===location.href,event:n})}),addEventListener("popstate",async n=>{var r;if(!Ae){if((r=n.state)!=null&&r[F]){const a=n.state[F];if(j={},a===A)return;const s=N[a],i=n.state[nt]??{},o=new URL(n.state[en]??location.href),c=n.state[z],l=b.url?me(location)===me(b.url):!1;if(c===L&&(ft||l)){i!==T.state&&(T.state=i),e(o),N[A]=le(),s&&scrollTo(s.x,s.y),A=a;return}const h=a-A;await M({type:"popstate",url:o,popped:{state:i,scroll:s,delta:h},accept:()=>{A=a,L=c},block:()=>{history.go(-h)},nav_token:j,event:n})}else if(!G){const a=new URL(location.href);e(a),k.hash&&location.reload()}}}),addEventListener("hashchange",()=>{G&&(G=!1,history.replaceState({...history.state,[F]:++A,[z]:L},"",location.href))});for(const n of document.querySelectorAll("link"))An.has(n.rel)&&(n.href=n.href);addEventListener("pageshow",n=>{n.persisted&&C.navigating.set(W.current=null)});function e(n){b.url=T.url=n,C.page.set(Ne(T)),C.page.notify()}}async function Dn(e,{status:t=200,error:n,node_ids:r,params:a,route:s,server_route:i,data:o,form:c}){xe=!0;const l=new URL(location.href);let d;({params:a={},route:s={id:null}}=await de(l,!1)||{}),d=$e.find(({id:f})=>f===s.id);let h,y=!0;try{const f=r.map(async(u,g)=>{const _=o[g];return _!=null&&_.uses&&(_.uses=vt(_.uses)),Pe({loader:k.nodes[u],url:l,params:a,route:s,parent:async()=>{const I={};for(let E=0;E<g;E+=1)Object.assign(I,(await f[E]).data);return I},server_data_node:Oe(_)})}),p=await Promise.all(f);if(d){const u=d.layouts;for(let g=0;g<u.length;g++)u[g]||p.splice(g,0,void 0)}h=oe({url:l,params:a,branch:p,status:t,error:n,form:c,route:d??null})}catch(f){if(f instanceof Re){await q(new URL(f.location,location.href));return}h=await ue({status:ee(f),error:await V(f,{url:l,params:a,route:s}),url:l,route:s}),e.textContent="",y=!1}h.props.page&&(h.props.page.state={}),pt(h,e,y)}async function yt(e,t){var s;const n=new URL(e);n.pathname=Sn(e.pathname),e.pathname.endsWith("/")&&n.searchParams.append(mn,"1"),n.searchParams.append(gn,t.map(i=>i?"1":"0").join(""));const r=window.fetch,a=await r(n.href,{});if(!a.ok){let i;throw(s=a.headers.get("content-type"))!=null&&s.includes("application/json")?i=await a.json():a.status===404?i="Not Found":a.status===500&&(i="Internal Error"),new ie(a.status,i)}return new Promise(async i=>{var h;const o=new Map,c=a.body.getReader();function l(y){return dn(y,{...k.decoders,Promise:f=>new Promise((p,u)=>{o.set(f,{fulfil:p,reject:u})})})}let d="";for(;;){const{done:y,value:f}=await c.read();if(y&&!d)break;for(d+=!f&&d?`
|
| 2 |
+
`:Mt.decode(f,{stream:!0});;){const p=d.indexOf(`
|
| 3 |
+
`);if(p===-1)break;const u=JSON.parse(d.slice(0,p));if(d=d.slice(p+1),u.type==="redirect")return i(u);if(u.type==="data")(h=u.nodes)==null||h.forEach(g=>{(g==null?void 0:g.type)==="data"&&(g.uses=vt(g.uses),g.data=l(g.data))}),i(u);else if(u.type==="chunk"){const{id:g,data:_,error:I}=u,E=o.get(g);o.delete(g),I?E.reject(l(I)):E.fulfil(l(_))}}}})}function vt(e){return{dependencies:new Set((e==null?void 0:e.dependencies)??[]),params:new Set((e==null?void 0:e.params)??[]),parent:!!(e!=null&&e.parent),route:!!(e!=null&&e.route),url:!!(e!=null&&e.url),search_params:new Set((e==null?void 0:e.search_params)??[])}}let Ae=!1;function Bn(e,t=null){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=bt(e);if(r&&document.getElementById(r)){const{x:s,y:i}=t??le();setTimeout(()=>{const o=history.state;Ae=!0,location.replace(`#${r}`),k.hash&&location.replace(e.hash),history.replaceState(o,"",e.hash),scrollTo(s,i),Ae=!1})}else{const s=document.body,i=s.getAttribute("tabindex");s.tabIndex=-1,s.focus({preventScroll:!0,focusVisible:!1}),i!==null?s.setAttribute("tabindex",i):s.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const s=[];for(let i=0;i<a.rangeCount;i+=1)s.push(a.getRangeAt(i));setTimeout(()=>{if(a.rangeCount===s.length){for(let i=0;i<a.rangeCount;i+=1){const o=s[i],c=a.getRangeAt(i);if(o.commonAncestorContainer!==c.commonAncestorContainer||o.startContainer!==c.startContainer||o.endContainer!==c.endContainer||o.startOffset!==c.startOffset||o.endOffset!==c.endOffset)return}a.removeAllRanges()}})}}}function je(e,t,n,r){var c,l;let a,s;const i=new Promise((d,h)=>{a=d,s=h});return i.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:((c=e.route)==null?void 0:c.id)??null},url:e.url},to:n&&{params:(t==null?void 0:t.params)??null,route:{id:((l=t==null?void 0:t.route)==null?void 0:l.id)??null},url:n},willUnload:!t,type:r,complete:i},fulfil:a,reject:s}}function Ne(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function Fn(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function bt(e){let t;if(k.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{Kn as a,qn as l,C as s};
|
hfstudio/static/_app/immutable/entry/app.Bclt6vmz.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0._QAFxNaI.js","../chunks/BjzGjDWb.js","../chunks/IHki7fMi.js","../chunks/D7IARYO-.js","../chunks/e2OxhbUw.js","../chunks/B_t0LZOt.js","../chunks/DrRA3Ukb.js","../assets/0.DrKserg1.css","../nodes/1.fA8k99qD.js","../nodes/2.1Swd6w1L.js","../chunks/DeMXkdTg.js","../chunks/BCO3d5zc.js","../chunks/CDuamvIE.js","../assets/2.DvaEwt8V.css","../nodes/3.BFTLVg3t.js","../assets/3.BNkL3CE9.css","../nodes/4.Do7OE_Wr.js"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{S as q,i as N,s as B,d,p as h,q as g,M as S,C as A,b as v,h as U,I as w,k as J,O as K,J as Q,P as W,Q as P,o as R,v as y,r as L,u as T,D,K as p,e as z,f as F,j as G,R as I,a as H,g as X,t as Y}from"../chunks/BjzGjDWb.js";import"../chunks/IHki7fMi.js";const Z="modulepreload",M=function(o,e){return new URL(o,e).href},V={},O=function(e,n,i){let r=Promise.resolve();if(n&&n.length>0){const t=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));r=Promise.allSettled(n.map(f=>{if(f=M(f,i),f in V)return;V[f]=!0;const l=f.endsWith(".css"),_=l?'[rel="stylesheet"]':"";if(!!i)for(let k=t.length-1;k>=0;k--){const E=t[k];if(E.href===f&&(!l||E.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${_}`))return;const m=document.createElement("link");if(m.rel=l?"stylesheet":Z,l||(m.as="script"),m.crossOrigin="",m.href=f,a&&m.setAttribute("nonce",a),document.head.appendChild(m),l)return new Promise((k,E)=>{m.addEventListener("load",k),m.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${f}`)))})}))}function u(t){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=t,window.dispatchEvent(s),!s.defaultPrevented)throw t}return r.then(t=>{for(const s of t||[])s.status==="rejected"&&u(s.reason);return e().catch(u)})},ae={};function $(o){let e,n,i;var r=o[2][0];function u(t,s){return{props:{data:t[4],form:t[3],params:t[1].params}}}return r&&(e=P(r,u(o)),o[12](e)),{c(){e&&y(e.$$.fragment),n=w()},l(t){e&&T(e.$$.fragment,t),n=w()},m(t,s){e&&L(e,t,s),v(t,n,s),i=!0},p(t,s){if(s&4&&r!==(r=t[2][0])){if(e){S();const a=e;h(a.$$.fragment,1,0,()=>{R(a,1)}),A()}r?(e=P(r,u(t)),t[12](e),y(e.$$.fragment),g(e.$$.fragment,1),L(e,n.parentNode,n)):e=null}else if(r){const a={};s&16&&(a.data=t[4]),s&8&&(a.form=t[3]),s&2&&(a.params=t[1].params),e.$set(a)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&h(e.$$.fragment,t),i=!1},d(t){t&&d(n),o[12](null),e&&R(e,t)}}}function x(o){let e,n,i;var r=o[2][0];function u(t,s){return{props:{data:t[4],params:t[1].params,$$slots:{default:[ee]},$$scope:{ctx:t}}}}return r&&(e=P(r,u(o)),o[11](e)),{c(){e&&y(e.$$.fragment),n=w()},l(t){e&&T(e.$$.fragment,t),n=w()},m(t,s){e&&L(e,t,s),v(t,n,s),i=!0},p(t,s){if(s&4&&r!==(r=t[2][0])){if(e){S();const a=e;h(a.$$.fragment,1,0,()=>{R(a,1)}),A()}r?(e=P(r,u(t)),t[11](e),y(e.$$.fragment),g(e.$$.fragment,1),L(e,n.parentNode,n)):e=null}else if(r){const a={};s&16&&(a.data=t[4]),s&2&&(a.params=t[1].params),s&8239&&(a.$$scope={dirty:s,ctx:t}),e.$set(a)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&h(e.$$.fragment,t),i=!1},d(t){t&&d(n),o[11](null),e&&R(e,t)}}}function ee(o){let e,n,i;var r=o[2][1];function u(t,s){return{props:{data:t[5],form:t[3],params:t[1].params}}}return r&&(e=P(r,u(o)),o[10](e)),{c(){e&&y(e.$$.fragment),n=w()},l(t){e&&T(e.$$.fragment,t),n=w()},m(t,s){e&&L(e,t,s),v(t,n,s),i=!0},p(t,s){if(s&4&&r!==(r=t[2][1])){if(e){S();const a=e;h(a.$$.fragment,1,0,()=>{R(a,1)}),A()}r?(e=P(r,u(t)),t[10](e),y(e.$$.fragment),g(e.$$.fragment,1),L(e,n.parentNode,n)):e=null}else if(r){const a={};s&32&&(a.data=t[5]),s&8&&(a.form=t[3]),s&2&&(a.params=t[1].params),e.$set(a)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&h(e.$$.fragment,t),i=!1},d(t){t&&d(n),o[10](null),e&&R(e,t)}}}function C(o){let e,n=o[7]&&j(o);return{c(){e=G("div"),n&&n.c(),this.h()},l(i){e=z(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var r=F(e);n&&n.l(r),r.forEach(d),this.h()},h(){D(e,"id","svelte-announcer"),D(e,"aria-live","assertive"),D(e,"aria-atomic","true"),p(e,"position","absolute"),p(e,"left","0"),p(e,"top","0"),p(e,"clip","rect(0 0 0 0)"),p(e,"clip-path","inset(50%)"),p(e,"overflow","hidden"),p(e,"white-space","nowrap"),p(e,"width","1px"),p(e,"height","1px")},m(i,r){v(i,e,r),n&&n.m(e,null)},p(i,r){i[7]?n?n.p(i,r):(n=j(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&d(e),n&&n.d()}}}function j(o){let e;return{c(){e=Y(o[8])},l(n){e=X(n,o[8])},m(n,i){v(n,e,i)},p(n,i){i&256&&H(e,n[8])},d(n){n&&d(e)}}}function te(o){let e,n,i,r,u;const t=[x,$],s=[];function a(l,_){return l[2][1]?0:1}e=a(o),n=s[e]=t[e](o);let f=o[6]&&C(o);return{c(){n.c(),i=J(),f&&f.c(),r=w()},l(l){n.l(l),i=U(l),f&&f.l(l),r=w()},m(l,_){s[e].m(l,_),v(l,i,_),f&&f.m(l,_),v(l,r,_),u=!0},p(l,[_]){let b=e;e=a(l),e===b?s[e].p(l,_):(S(),h(s[b],1,1,()=>{s[b]=null}),A(),n=s[e],n?n.p(l,_):(n=s[e]=t[e](l),n.c()),g(n,1),n.m(i.parentNode,i)),l[6]?f?f.p(l,_):(f=C(l),f.c(),f.m(r.parentNode,r)):f&&(f.d(1),f=null)},i(l){u||(g(n),u=!0)},o(l){h(n),u=!1},d(l){l&&(d(i),d(r)),s[e].d(l),f&&f.d(l)}}}function ne(o,e,n){let{stores:i}=e,{page:r}=e,{constructors:u}=e,{components:t=[]}=e,{form:s}=e,{data_0:a=null}=e,{data_1:f=null}=e;K(i.page.notify);let l=!1,_=!1,b=null;Q(()=>{const c=i.page.subscribe(()=>{l&&(n(7,_=!0),W().then(()=>{n(8,b=document.title||"untitled page")}))});return n(6,l=!0),c});function m(c){I[c?"unshift":"push"](()=>{t[1]=c,n(0,t)})}function k(c){I[c?"unshift":"push"](()=>{t[0]=c,n(0,t)})}function E(c){I[c?"unshift":"push"](()=>{t[0]=c,n(0,t)})}return o.$$set=c=>{"stores"in c&&n(9,i=c.stores),"page"in c&&n(1,r=c.page),"constructors"in c&&n(2,u=c.constructors),"components"in c&&n(0,t=c.components),"form"in c&&n(3,s=c.form),"data_0"in c&&n(4,a=c.data_0),"data_1"in c&&n(5,f=c.data_1)},o.$$.update=()=>{o.$$.dirty&514&&i.page.set(r)},[t,r,u,s,a,f,l,_,b,i,m,k,E]}class le extends q{constructor(e){super(),N(this,e,ne,te,B,{stores:9,page:1,constructors:2,components:0,form:3,data_0:4,data_1:5})}}const fe=[()=>O(()=>import("../nodes/0._QAFxNaI.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url),()=>O(()=>import("../nodes/1.fA8k99qD.js"),__vite__mapDeps([8,1,2,3,4]),import.meta.url),()=>O(()=>import("../nodes/2.1Swd6w1L.js"),__vite__mapDeps([9,1,10,6,2,11,12,13]),import.meta.url),()=>O(()=>import("../nodes/3.BFTLVg3t.js"),__vite__mapDeps([14,1,10,6,2,12,15]),import.meta.url),()=>O(()=>import("../nodes/4.Do7OE_Wr.js"),__vite__mapDeps([16,1,6,2,11,5,12]),import.meta.url)],ce=[],ue={"/":[2],"/code-recorder":[3],"/voice-cloning":[4]},se={handleError:({error:o})=>{console.error(o)},reroute:()=>{},transport:{}},ie=Object.fromEntries(Object.entries(se.transport).map(([o,e])=>[o,e.decode])),_e=!1,me=(o,e)=>ie[o](e);export{me as decode,ie as decoders,ue as dictionary,_e as hash,se as hooks,ae as matchers,fe as nodes,le as root,ce as server_loads};
|
hfstudio/static/_app/immutable/entry/start.DiWn1IXe.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{l as o,a as r}from"../chunks/e2OxhbUw.js";export{o as load_css,r as start};
|
hfstudio/static/_app/immutable/nodes/0._QAFxNaI.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{S as je,i as Be,s as Ve,x as Oe,d as m,o as Fe,p as Le,q as Ie,D as l,y as ze,z as Ue,A as Re,b as X,c as n,r as qe,F as re,e as o,f as P,H as L,h as g,u as Ge,j as r,k as _,v as Je,l as Ye,J as We,n as Ae,B as Ke,E as Ee,a as De,g as xe,t as ye,N as Qe}from"../chunks/BjzGjDWb.js";import"../chunks/IHki7fMi.js";import{p as Xe}from"../chunks/D7IARYO-.js";import{M as Ze}from"../chunks/B_t0LZOt.js";function He(i){let t,e,a='<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg>',c,h,s='Hugging Face <span class="bg-gradient-to-r from-purple-500 via-pink-500 via-green-500 to-blue-500 bg-clip-text text-transparent font-bold">PRO</span>',u,T,V=`Sign in to with your Hugging Face <a href="https://huggingface.co/pro" target="_blank" class="text-amber-600 hover:text-amber-700 underline font-medium">PRO account</a> to get started with $2 of free API credits per month. You can add a billing method for
|
| 2 |
+
additional pay-as-you-go usage ‡`,f,y;return{c(){t=r("div"),e=r("button"),e.innerHTML=a,c=_(),h=r("p"),h.innerHTML=s,u=_(),T=r("p"),T.innerHTML=V,this.h()},l(O){t=o(O,"DIV",{class:!0});var I=P(t);e=o(I,"BUTTON",{class:!0,"aria-label":!0,"data-svelte-h":!0}),L(e)!=="svelte-1ywh7al"&&(e.innerHTML=a),c=g(I),h=o(I,"P",{class:!0,"data-svelte-h":!0}),L(h)!=="svelte-1k9uu9c"&&(h.innerHTML=s),u=g(I),T=o(I,"P",{class:!0,"data-svelte-h":!0}),L(T)!=="svelte-s4eiw5"&&(T.innerHTML=V),I.forEach(m),this.h()},h(){l(e,"class","absolute top-2 right-2 text-gray-400 hover:text-gray-600 transition-colors"),l(e,"aria-label","Dismiss"),l(h,"class","text-sm font-medium text-gray-700 mb-1 pr-4"),l(T,"class","text-sm text-gray-600 pr-4"),l(t,"class","mb-3 px-3 py-2 bg-gradient-to-r from-amber-50 to-orange-50 rounded-lg border border-amber-200 relative")},m(O,I){X(O,t,I),n(t,e),n(t,c),n(t,h),n(t,u),n(t,T),f||(y=re(e,"click",i[14]),f=!0)},p:Ae,d(O){O&&m(t),f=!1,y()}}}function Me(i){let t;return{c(){t=r("div"),this.h()},l(e){t=o(e,"DIV",{class:!0}),P(t).forEach(m),this.h()},h(){l(t,"class","absolute inset-0 -left-full animate-sweep bg-gradient-to-r from-transparent via-orange-400/40 to-transparent svelte-1s3xy1i")},m(e,a){X(e,t,a)},d(e){e&&m(t)}}}function $e(i){let t,e,a,c,h="Sign In";return{c(){t=r("img"),a=_(),c=r("span"),c.textContent=h,this.h()},l(s){t=o(s,"IMG",{src:!0,alt:!0,class:!0}),a=g(s),c=o(s,"SPAN",{class:!0,"data-svelte-h":!0}),L(c)!=="svelte-b2ltkx"&&(c.textContent=h),this.h()},h(){Qe(t.src,e="/assets/hf-logo.png")||l(t,"src",e),l(t,"alt","HF Logo"),l(t,"class","w-5 h-5 relative z-10"),l(c,"class","relative z-10")},m(s,u){X(s,t,u),X(s,a,u),X(s,c,u)},p:Ae,d(s){s&&(m(t),m(a),m(c))}}}function et(i){let t,e,a;return{c(){t=r("span"),e=ye("π Logout, "),a=ye(i[1]),this.h()},l(c){t=o(c,"SPAN",{class:!0});var h=P(t);e=xe(h,"π Logout, "),a=xe(h,i[1]),h.forEach(m),this.h()},h(){l(t,"class","relative z-10")},m(c,h){X(c,t,h),n(t,e),n(t,a)},p(c,h){h&2&&De(a,c[1])},d(c){c&&m(t)}}}function Se(i){let t,e,a,c="Sign In with HuggingFace Token",h,s,u,T="<strong>Manual Token Entry:</strong> Please enter your HuggingFace token.",V,f,y=`1. Go to <a href="https://huggingface.co/settings/tokens" target="_blank" class="underline text-blue-600">HuggingFace Settings</a><br/>
|
| 3 |
+
2. Create a new token with "Inference API" permissions<br/>
|
| 4 |
+
3. Copy and paste it below`,O,I,w,F,Z="HuggingFace Token",W,b,z,K,E,R,$="Cancel",p,v,U="Sign In",H,M,x=i[5]&&Pe(),k=i[4]&&Ne(i);return{c(){t=r("div"),e=r("div"),a=r("h2"),a.textContent=c,h=_(),s=r("div"),u=r("p"),u.innerHTML=T,V=_(),f=r("p"),f.innerHTML=y,O=_(),x&&x.c(),I=_(),w=r("div"),F=r("label"),F.textContent=Z,W=_(),b=r("input"),z=_(),k&&k.c(),K=_(),E=r("div"),R=r("button"),R.textContent=$,p=_(),v=r("button"),v.textContent=U,this.h()},l(C){t=o(C,"DIV",{class:!0});var Q=P(t);e=o(Q,"DIV",{class:!0});var G=P(e);a=o(G,"H2",{class:!0,"data-svelte-h":!0}),L(a)!=="svelte-1t0ehet"&&(a.textContent=c),h=g(G),s=o(G,"DIV",{class:!0});var j=P(s);u=o(j,"P",{class:!0,"data-svelte-h":!0}),L(u)!=="svelte-344vn4"&&(u.innerHTML=T),V=g(j),f=o(j,"P",{class:!0,"data-svelte-h":!0}),L(f)!=="svelte-orsfwv"&&(f.innerHTML=y),O=g(j),x&&x.l(j),j.forEach(m),I=g(G),w=o(G,"DIV",{class:!0});var ee=P(w);F=o(ee,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),L(F)!=="svelte-vtbmxo"&&(F.textContent=Z),W=g(ee),b=o(ee,"INPUT",{id:!0,type:!0,placeholder:!0,class:!0}),z=g(ee),k&&k.l(ee),ee.forEach(m),K=g(G),E=o(G,"DIV",{class:!0});var se=P(E);R=o(se,"BUTTON",{class:!0,"data-svelte-h":!0}),L(R)!=="svelte-csk0rj"&&(R.textContent=$),p=g(se),v=o(se,"BUTTON",{class:!0,"data-svelte-h":!0}),L(v)!=="svelte-1nxas5u"&&(v.textContent=U),se.forEach(m),G.forEach(m),Q.forEach(m),this.h()},h(){l(a,"class","text-xl font-semibold mb-4"),l(u,"class","text-blue-800 mb-2"),l(f,"class","text-blue-700"),l(s,"class","mb-4 p-3 bg-blue-50 rounded-md text-sm"),l(F,"for","token"),l(F,"class","block text-sm font-medium text-gray-700 mb-2"),l(b,"id","token"),l(b,"type","password"),l(b,"placeholder","hf_..."),l(b,"class","w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-orange-500 focus:border-transparent"),l(w,"class","mb-4"),l(R,"class","px-4 py-2 text-gray-600 hover:text-gray-800 transition-colors"),l(v,"class","px-4 py-2 bg-orange-500 text-white rounded-md hover:bg-orange-600 transition-colors"),l(E,"class","flex justify-end gap-3"),l(e,"class","bg-white rounded-lg p-6 max-w-md w-full mx-4 shadow-xl"),l(t,"class","fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50")},m(C,Q){X(C,t,Q),n(t,e),n(e,a),n(e,h),n(e,s),n(s,u),n(s,V),n(s,f),n(s,O),x&&x.m(s,null),n(e,I),n(e,w),n(w,F),n(w,W),n(w,b),Ee(b,i[3]),n(w,z),k&&k.m(w,null),n(e,K),n(e,E),n(E,R),n(E,p),n(E,v),H||(M=[re(b,"input",i[15]),re(b,"keydown",i[16]),re(R,"click",i[10]),re(v,"click",i[11])],H=!0)},p(C,Q){C[5]?x||(x=Pe(),x.c(),x.m(s,null)):x&&(x.d(1),x=null),Q&8&&b.value!==C[3]&&Ee(b,C[3]),C[4]?k?k.p(C,Q):(k=Ne(C),k.c(),k.m(w,null)):k&&(k.d(1),k=null)},d(C){C&&m(t),x&&x.d(),k&&k.d(),H=!1,Ke(M)}}}function Pe(i){let t,e=`<strong>Tip:</strong> You can also run <code>huggingface-cli login</code> in your terminal
|
| 5 |
+
to automatically use your local token.`;return{c(){t=r("p"),t.innerHTML=e,this.h()},l(a){t=o(a,"P",{class:!0,"data-svelte-h":!0}),L(t)!=="svelte-xrut8w"&&(t.innerHTML=e),this.h()},h(){l(t,"class","text-blue-600 mt-2")},m(a,c){X(a,t,c)},d(a){a&&m(t)}}}function Ne(i){let t,e;return{c(){t=r("p"),e=ye(i[4]),this.h()},l(a){t=o(a,"P",{class:!0});var c=P(t);e=xe(c,i[4]),c.forEach(m),this.h()},h(){l(t,"class","text-red-600 text-sm mt-1")},m(a,c){X(a,t,c),n(t,e)},p(a,c){c&16&&De(e,a[4])},d(a){a&&m(t)}}}function tt(i){let t,e,a,c='<div class="flex items-center gap-3"><img src="/assets/hf-studio-logo.png" alt="HF Logo" class="w-8 h-8"/> <h1 class="text-xl font-semibold">HFStudio<sup class="text-xs text-gray-500 ml-1">BETA</sup></h1></div>',h,s,u,T="Tasks",V,f,y,O="ποΈ",I,w,F="Text to Speech",Z,W,b,z,K,E,R="Voice Cloning",$,p,v,U="Coming Soon",H,M,x="<span>π§</span> <span>Speech to Text</span>",k,C,Q="<span>πΌ</span> <span>Sound Effects</span>",G,j,ee="<span>πΈ</span> <span>Music Generation</span>",se,ne,we="<span>π</span> <span>Audio Enhancement</span>",me,te,ie,J,ce,ge,ae,_e,le,be,ke;z=new Ze({props:{size:16}});let N=!i[0]&&i[6]&&He(i),B=i[7]&&Me();function Te(d,S){return d[0]?et:$e}let ue=Te(i),Y=ue(i);const ve=i[13].default,q=Oe(ve,i,i[12],null);let A=i[2]&&Se(i);return{c(){t=r("div"),e=r("aside"),a=r("div"),a.innerHTML=c,h=_(),s=r("nav"),u=r("div"),u.textContent=T,V=_(),f=r("a"),y=r("span"),y.textContent=O,I=_(),w=r("span"),w.textContent=F,W=_(),b=r("a"),Je(z.$$.fragment),K=_(),E=r("span"),E.textContent=R,p=_(),v=r("div"),v.textContent=U,H=_(),M=r("button"),M.innerHTML=x,k=_(),C=r("button"),C.innerHTML=Q,G=_(),j=r("button"),j.innerHTML=ee,se=_(),ne=r("button"),ne.innerHTML=we,me=_(),te=r("div"),N&&N.c(),ie=_(),J=r("button"),B&&B.c(),ce=_(),Y.c(),ge=_(),ae=r("main"),q&&q.c(),_e=_(),A&&A.c(),this.h()},l(d){t=o(d,"DIV",{class:!0});var S=P(t);e=o(S,"ASIDE",{class:!0});var oe=P(e);a=o(oe,"DIV",{class:!0,"data-svelte-h":!0}),L(a)!=="svelte-xzbt87"&&(a.innerHTML=c),h=g(oe),s=o(oe,"NAV",{class:!0});var D=P(s);u=o(D,"DIV",{class:!0,"data-svelte-h":!0}),L(u)!=="svelte-pii1fa"&&(u.textContent=T),V=g(D),f=o(D,"A",{href:!0,class:!0});var fe=P(f);y=o(fe,"SPAN",{"data-svelte-h":!0}),L(y)!=="svelte-1yx42xi"&&(y.textContent=O),I=g(fe),w=o(fe,"SPAN",{"data-svelte-h":!0}),L(w)!=="svelte-2j89jk"&&(w.textContent=F),fe.forEach(m),W=g(D),b=o(D,"A",{href:!0,class:!0});var de=P(b);Ge(z.$$.fragment,de),K=g(de),E=o(de,"SPAN",{"data-svelte-h":!0}),L(E)!=="svelte-10pmll2"&&(E.textContent=R),de.forEach(m),p=g(D),v=o(D,"DIV",{class:!0,"data-svelte-h":!0}),L(v)!=="svelte-9nifs9"&&(v.textContent=U),H=g(D),M=o(D,"BUTTON",{class:!0,"data-svelte-h":!0}),L(M)!=="svelte-wf0x5d"&&(M.innerHTML=x),k=g(D),C=o(D,"BUTTON",{class:!0,"data-svelte-h":!0}),L(C)!=="svelte-x7bha3"&&(C.innerHTML=Q),G=g(D),j=o(D,"BUTTON",{class:!0,"data-svelte-h":!0}),L(j)!=="svelte-1tyblmt"&&(j.innerHTML=ee),se=g(D),ne=o(D,"BUTTON",{class:!0,"data-svelte-h":!0}),L(ne)!=="svelte-1emrjb3"&&(ne.innerHTML=we),D.forEach(m),me=g(oe),te=o(oe,"DIV",{class:!0});var pe=P(te);N&&N.l(pe),ie=g(pe),J=o(pe,"BUTTON",{class:!0});var he=P(J);B&&B.l(he),ce=g(he),Y.l(he),he.forEach(m),pe.forEach(m),oe.forEach(m),ge=g(S),ae=o(S,"MAIN",{class:!0});var Ce=P(ae);q&&q.l(Ce),Ce.forEach(m),_e=g(S),A&&A.l(S),S.forEach(m),this.h()},h(){l(a,"class","px-4 py-4 border-b border-gray-200 min-h-[73px] flex items-center"),l(u,"class","mt-2 mb-1 px-2 text-xs font-medium text-gray-500 uppercase"),l(f,"href","/"),l(f,"class",Z="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left "+(i[8].url.pathname==="/"?"bg-gray-100":"")),l(b,"href","/voice-cloning"),l(b,"class",$="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left "+(i[8].url.pathname==="/voice-cloning"?"bg-gray-100":"")),l(v,"class","mt-3 mb-1 px-2 text-xs font-medium text-gray-500 uppercase"),l(M,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),M.disabled=!0,l(C,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),C.disabled=!0,l(j,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),j.disabled=!0,l(ne,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),ne.disabled=!0,l(s,"class","p-2 text-sm flex-1"),J.disabled=!1,l(J,"class","w-full px-6 py-3 bg-black text-white rounded-lg font-medium hover:bg-gray-800 transition-colors shadow-sm flex items-center justify-center gap-2 text-sm disabled:opacity-50 disabled:cursor-not-allowed relative overflow-hidden"),l(te,"class","absolute bottom-4 left-0 right-0 px-2"),l(e,"class","w-56 border-r border-gray-200 bg-white flex-shrink-0 flex flex-col h-full relative "),l(ae,"class","flex-1 overflow-auto"),l(t,"class","flex h-screen bg-white")},m(d,S){X(d,t,S),n(t,e),n(e,a),n(e,h),n(e,s),n(s,u),n(s,V),n(s,f),n(f,y),n(f,I),n(f,w),n(s,W),n(s,b),qe(z,b,null),n(b,K),n(b,E),n(s,p),n(s,v),n(s,H),n(s,M),n(s,k),n(s,C),n(s,G),n(s,j),n(s,se),n(s,ne),n(e,me),n(e,te),N&&N.m(te,null),n(te,ie),n(te,J),B&&B.m(J,null),n(J,ce),Y.m(J,null),n(t,ge),n(t,ae),q&&q.m(ae,null),n(t,_e),A&&A.m(t,null),le=!0,be||(ke=re(J,"click",i[9]),be=!0)},p(d,[S]){(!le||S&256&&Z!==(Z="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left "+(d[8].url.pathname==="/"?"bg-gray-100":"")))&&l(f,"class",Z),(!le||S&256&&$!==($="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left "+(d[8].url.pathname==="/voice-cloning"?"bg-gray-100":"")))&&l(b,"class",$),!d[0]&&d[6]?N?N.p(d,S):(N=He(d),N.c(),N.m(te,ie)):N&&(N.d(1),N=null),d[7]?B||(B=Me(),B.c(),B.m(J,ce)):B&&(B.d(1),B=null),ue===(ue=Te(d))&&Y?Y.p(d,S):(Y.d(1),Y=ue(d),Y&&(Y.c(),Y.m(J,null))),q&&q.p&&(!le||S&4096)&&ze(q,ve,d,d[12],le?Re(ve,d[12],S,null):Ue(d[12]),null),d[2]?A?A.p(d,S):(A=Se(d),A.c(),A.m(t,null)):A&&(A.d(1),A=null)},i(d){le||(Ie(z.$$.fragment,d),Ie(q,d),le=!0)},o(d){Le(z.$$.fragment,d),Le(q,d),le=!1},d(d){d&&m(t),Fe(z),N&&N.d(),B&&B.d(),Y.d(),q&&q.d(d),A&&A.d(),be=!1,ke()}}}function st(i,t,e){let a;Ye(i,Xe,p=>e(8,a=p));let{$$slots:c={},$$scope:h}=t,s=typeof window<"u"&&window.__INITIAL_USER__?window.__INITIAL_USER__:{authenticated:!1},u=(s==null?void 0:s.authenticated)||!1,T=s!=null&&s.authenticated&&(s!=null&&s.user_info)?(s.user_info.name||s.user_info.fullname||s.user_info.login||s.user_info.username||"User").split(" ")[0]:"",V=!1,f="",y="",O=!1,I=!1,w=!1,F=!1;We(()=>(window.addEventListener("show-login-prompt",()=>{u||(e(6,I=!0),e(7,w=!0),setTimeout(()=>{e(7,w=!1)},1600))}),Z().then(()=>{s!=null&&s.authenticated||W()}),document.addEventListener("visibilitychange",()=>{document.hidden||W()}),()=>{}));async function Z(){try{F=(await(await fetch("/api/status")).json()).is_spaces||!1}catch(p){console.error("Error checking Spaces status:",p),F=!1}}async function W(){if(!(s!=null&&s.authenticated&&u))try{const p=await fetch("/api/auth/user",{credentials:"include"});if(p.ok){const v=await p.json();if(v.authenticated){e(0,u=!0);const U=v.user_info,H=U.name||U.fullname||U.login||U.username||"User";e(1,T=H.split(" ")[0])}else e(0,u=!1),e(1,T="")}else e(0,u=!1),e(1,T="")}catch{e(0,u=!1),e(1,T="")}}async function b(){if(u){try{await fetch("/api/auth/logout",{method:"POST",credentials:"include"})}catch(p){console.error("Logout error:",p)}sessionStorage.removeItem("oauth_state"),e(0,u=!1),e(1,T="")}else try{const v=await(await fetch("/api/auth/oauth-config")).json(),U=v.scopes||"inference-api";let H=window.location.origin+"/auth/callback";window.location.hostname==="localhost"&&window.location.port==="11111"&&(H="http://localhost:7860/auth/callback");const M=`https://huggingface.co/oauth/authorize?client_id=${v.client_id}&redirect_uri=${encodeURIComponent(H)}&scope=${encodeURIComponent(U)}&response_type=code&state=${Date.now()}`;window.location.href=M}catch{e(2,V=!0),e(3,f=""),e(4,y="")}}function z(){e(2,V=!1),e(3,f=""),e(4,y="")}async function K(){if(!f.trim()){e(4,y="Please enter a token");return}if(!f.startsWith("hf_")){e(4,y='Token should start with "hf_"');return}try{const p=await fetch("https://huggingface.co/api/whoami-v2",{headers:{Authorization:`Bearer ${f.trim()}`}});if(p.ok){const v=await p.json(),U=f.trim();try{const H=await fetch("/api/auth/manual-token",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:U})});if(H.ok){const M=await H.json();e(0,u=!0);const x=M.user_info,k=x.name||x.fullname||x.login||x.username||"User";e(1,T=k.split(" ")[0]),z()}else{const M=await H.json();e(4,y=M.detail||"Token validation failed")}}catch{e(4,y="Failed to validate token. Please try again.")}}else e(4,y=`Invalid token (${p.status}). Please check your token and try again.`)}catch{e(4,y="Error validating token. Please try again.")}}const E=()=>e(6,I=!1);function R(){f=this.value,e(3,f)}const $=p=>p.key==="Enter"&&K();return i.$$set=p=>{"$$scope"in p&&e(12,h=p.$$scope)},[u,T,V,f,y,O,I,w,a,b,z,K,h,c,E,R,$]}class rt extends je{constructor(t){super(),Be(this,t,st,tt,Ve,{})}}export{rt as component};
|
hfstudio/static/_app/immutable/nodes/1.fA8k99qD.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{S as x,i as S,s as j,n as u,d as c,a as h,b as _,c as d,e as v,f as g,g as b,h as k,j as E,t as $,k as q,l as y}from"../chunks/BjzGjDWb.js";import"../chunks/IHki7fMi.js";import{p as C}from"../chunks/D7IARYO-.js";function H(p){var f;let a,s=p[0].status+"",r,n,o,i=((f=p[0].error)==null?void 0:f.message)+"",m;return{c(){a=E("h1"),r=$(s),n=q(),o=E("p"),m=$(i)},l(e){a=v(e,"H1",{});var t=g(a);r=b(t,s),t.forEach(c),n=k(e),o=v(e,"P",{});var l=g(o);m=b(l,i),l.forEach(c)},m(e,t){_(e,a,t),d(a,r),_(e,n,t),_(e,o,t),d(o,m)},p(e,[t]){var l;t&1&&s!==(s=e[0].status+"")&&h(r,s),t&1&&i!==(i=((l=e[0].error)==null?void 0:l.message)+"")&&h(m,i)},i:u,o:u,d(e){e&&(c(a),c(n),c(o))}}}function P(p,a,s){let r;return y(p,C,n=>s(0,r=n)),[r]}class B extends x{constructor(a){super(),S(this,a,P,H,j,{})}}export{B as component};
|
hfstudio/static/_app/immutable/nodes/2.1Swd6w1L.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{S as It,i as Dt,s as Tt,m as Me,o as ge,p as L,q as j,r as _e,u as ve,v as be,w as ft,x as Ht,y as Ot,z as Lt,A as zt,d as c,L as Mt,B as ht,a as Ve,E as nt,C as ot,b as X,c as n,F as Q,D as i,G as wl,h as k,e as f,f as m,g as G,H as Ee,I as Re,k as x,j as u,t as R,J as kl,M as it,K as jt,R as xl,X as sl,n as $t,N as al,Y as El,Z as $l}from"../chunks/BjzGjDWb.js";import{g as Il,S as Dl,D as Tl}from"../chunks/DeMXkdTg.js";import{I as Ut,g as Bt,a as Gt,e as ct}from"../chunks/DrRA3Ukb.js";import"../chunks/IHki7fMi.js";import{C as Cl,A as Vl,X as Nl}from"../chunks/BCO3d5zc.js";import{a as Rt,P as Pl}from"../chunks/CDuamvIE.js";function Sl(s){let e;const t=s[2].default,l=Ht(t,s,s[3],null);return{c(){l&&l.c()},l(r){l&&l.l(r)},m(r,a){l&&l.m(r,a),e=!0},p(r,a){l&&l.p&&(!e||a&8)&&Ot(l,t,r,r[3],e?zt(t,r[3],a,null):Lt(r[3]),null)},i(r){e||(j(l,r),e=!0)},o(r){L(l,r),e=!1},d(r){l&&l.d(r)}}}function Al(s){let e,t;const l=[{name:"chevron-down"},s[1],{iconNode:s[0]}];let r={$$slots:{default:[Sl]},$$scope:{ctx:s}};for(let a=0;a<l.length;a+=1)r=Me(r,l[a]);return e=new Ut({props:r}),{c(){be(e.$$.fragment)},l(a){ve(e.$$.fragment,a)},m(a,o){_e(e,a,o),t=!0},p(a,[o]){const g=o&3?Bt(l,[l[0],o&2&&Gt(a[1]),o&1&&{iconNode:a[0]}]):{};o&8&&(g.$$scope={dirty:o,ctx:a}),e.$set(g)},i(a){t||(j(e.$$.fragment,a),t=!0)},o(a){L(e.$$.fragment,a),t=!1},d(a){ge(e,a)}}}function Ml(s,e,t){let{$$slots:l={},$$scope:r}=e;const a=[["path",{d:"m6 9 6 6 6-6"}]];return s.$$set=o=>{t(1,e=Me(Me({},e),ft(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ft(e),[a,e,l,r]}class jl extends It{constructor(e){super(),Dt(this,e,Ml,Al,Tt,{})}}function Hl(s){let e;const t=s[2].default,l=Ht(t,s,s[3],null);return{c(){l&&l.c()},l(r){l&&l.l(r)},m(r,a){l&&l.m(r,a),e=!0},p(r,a){l&&l.p&&(!e||a&8)&&Ot(l,t,r,r[3],e?zt(t,r[3],a,null):Lt(r[3]),null)},i(r){e||(j(l,r),e=!0)},o(r){L(l,r),e=!1},d(r){l&&l.d(r)}}}function Ol(s){let e,t;const l=[{name:"loader-2"},s[1],{iconNode:s[0]}];let r={$$slots:{default:[Hl]},$$scope:{ctx:s}};for(let a=0;a<l.length;a+=1)r=Me(r,l[a]);return e=new Ut({props:r}),{c(){be(e.$$.fragment)},l(a){ve(e.$$.fragment,a)},m(a,o){_e(e,a,o),t=!0},p(a,[o]){const g=o&3?Bt(l,[l[0],o&2&&Gt(a[1]),o&1&&{iconNode:a[0]}]):{};o&8&&(g.$$scope={dirty:o,ctx:a}),e.$set(g)},i(a){t||(j(e.$$.fragment,a),t=!0)},o(a){L(e.$$.fragment,a),t=!1},d(a){ge(e,a)}}}function Ll(s,e,t){let{$$slots:l={},$$scope:r}=e;const a=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56"}]];return s.$$set=o=>{t(1,e=Me(Me({},e),ft(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ft(e),[a,e,l,r]}class zl extends It{constructor(e){super(),Dt(this,e,Ll,Ol,Tt,{})}}function Ul(s){let e;const t=s[2].default,l=Ht(t,s,s[3],null);return{c(){l&&l.c()},l(r){l&&l.l(r)},m(r,a){l&&l.m(r,a),e=!0},p(r,a){l&&l.p&&(!e||a&8)&&Ot(l,t,r,r[3],e?zt(t,r[3],a,null):Lt(r[3]),null)},i(r){e||(j(l,r),e=!0)},o(r){L(l,r),e=!1},d(r){l&&l.d(r)}}}function Bl(s){let e,t;const l=[{name:"shuffle"},s[1],{iconNode:s[0]}];let r={$$slots:{default:[Ul]},$$scope:{ctx:s}};for(let a=0;a<l.length;a+=1)r=Me(r,l[a]);return e=new Ut({props:r}),{c(){be(e.$$.fragment)},l(a){ve(e.$$.fragment,a)},m(a,o){_e(e,a,o),t=!0},p(a,[o]){const g=o&3?Bt(l,[l[0],o&2&&Gt(a[1]),o&1&&{iconNode:a[0]}]):{};o&8&&(g.$$scope={dirty:o,ctx:a}),e.$set(g)},i(a){t||(j(e.$$.fragment,a),t=!0)},o(a){L(e.$$.fragment,a),t=!1},d(a){ge(e,a)}}}function Gl(s,e,t){let{$$slots:l={},$$scope:r}=e;const a=[["path",{d:"M2 18h1.4c1.3 0 2.5-.6 3.3-1.7l6.1-8.6c.7-1.1 2-1.7 3.3-1.7H22"}],["path",{d:"m18 2 4 4-4 4"}],["path",{d:"M2 6h1.9c1.5 0 2.9.9 3.6 2.2"}],["path",{d:"M22 18h-5.9c-1.3 0-2.6-.7-3.3-1.8l-.5-.8"}],["path",{d:"m18 14 4 4-4 4"}]];return s.$$set=o=>{t(1,e=Me(Me({},e),ft(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ft(e),[a,e,l,r]}class Rl extends It{constructor(e){super(),Dt(this,e,Gl,Bl,Tt,{})}}const{document:nl}=Il;function ol(s,e,t){const l=s.slice();return l[46]=e[t],l}function il(s,e,t){const l=s.slice();return l[49]=e[t],l}function cl(s,e,t){const l=s.slice();return l[49]=e[t],l}function fl(s){let e,t;return{c(){e=u("span"),t=R(s[17]),this.h()},l(l){e=f(l,"SPAN",{class:!0});var r=m(e);t=G(r,s[17]),r.forEach(c),this.h()},h(){i(e,"class","ml-1 px-1.5 py-0.5 bg-gray-500 text-white text-xs rounded-full min-w-[18px] text-center")},m(l,r){X(l,e,r),n(e,t)},p(l,r){r[0]&131072&&Ve(t,l[17])},d(l){l&&c(e)}}}function Fl(s){let e,t,l;return e=new Rt({props:{size:20}}),{c(){be(e.$$.fragment),t=R(`
|
| 2 |
+
Generate speech`)},l(r){ve(e.$$.fragment,r),t=G(r,`
|
| 3 |
+
Generate speech`)},m(r,a){_e(e,r,a),X(r,t,a),l=!0},i(r){l||(j(e.$$.fragment,r),l=!0)},o(r){L(e.$$.fragment,r),l=!1},d(r){r&&c(t),ge(e,r)}}}function Jl(s){let e,t,l;return e=new zl({props:{size:20,class:"animate-spin"}}),{c(){be(e.$$.fragment),t=R(`
|
| 4 |
+
Generating...`)},l(r){ve(e.$$.fragment,r),t=G(r,`
|
| 5 |
+
Generating...`)},m(r,a){_e(e,r,a),X(r,t,a),l=!0},i(r){l||(j(e.$$.fragment,r),l=!0)},o(r){L(e.$$.fragment,r),l=!1},d(r){r&&c(t),ge(e,r)}}}function ul(s){let e,t,l,r,a,o,g,h,_,w,v,S,Y,K,D,T,E,N="Share",se,$,O,ae="Download",F,z,U,C,A,J,b,V,P,fe,W=Et(s[9])+"",Z,oe,ne,ee,Ne,we,he=Et(s[10])+"",Pe,Se,te,ke,Fe;D=new Dl({props:{size:14,class:"text-gray-600"}}),z=new Tl({props:{size:14,class:"text-gray-600"}});const je=[ql,Kl],ue=[];function He(y,I){return y[8]?0:1}J=He(s),b=ue[J]=je[J](s);let p=s[5]&&dl(s);return{c(){e=u("div"),t=u("div"),l=u("div"),r=x(),a=u("div"),o=u("h3"),g=R(s[11]),h=x(),_=u("p"),w=R(s[1]),v=R(" ⒠Created 1 second ago"),S=x(),Y=u("div"),K=u("button"),be(D.$$.fragment),T=x(),E=u("span"),E.textContent=N,se=x(),$=u("button"),O=u("span"),O.textContent=ae,F=x(),be(z.$$.fragment),U=x(),C=u("div"),A=u("button"),b.c(),V=x(),P=u("div"),fe=u("span"),Z=R(W),oe=x(),ne=u("div"),ee=u("div"),Ne=x(),we=u("span"),Pe=R(he),Se=x(),p&&p.c(),this.h()},l(y){e=f(y,"DIV",{class:!0});var I=m(e);t=f(I,"DIV",{class:!0});var B=m(t);l=f(B,"DIV",{class:!0}),m(l).forEach(c),r=k(B),a=f(B,"DIV",{class:!0});var Ie=m(a);o=f(Ie,"H3",{class:!0});var We=m(o);g=G(We,s[11]),We.forEach(c),h=k(Ie),_=f(Ie,"P",{class:!0});var De=m(_);w=G(De,s[1]),v=G(De," ⒠Created 1 second ago"),De.forEach(c),Ie.forEach(c),S=k(B),Y=f(B,"DIV",{class:!0});var Te=m(Y);K=f(Te,"BUTTON",{class:!0});var Ae=m(K);ve(D.$$.fragment,Ae),T=k(Ae),E=f(Ae,"SPAN",{class:!0,"data-svelte-h":!0}),Ee(E)!=="svelte-hbn8gl"&&(E.textContent=N),Ae.forEach(c),se=k(Te),$=f(Te,"BUTTON",{class:!0});var Oe=m($);O=f(Oe,"SPAN",{class:!0,"data-svelte-h":!0}),Ee(O)!=="svelte-h01aeg"&&(O.textContent=ae),F=k(Oe),ve(z.$$.fragment,Oe),Oe.forEach(c),Te.forEach(c),B.forEach(c),U=k(I),C=f(I,"DIV",{class:!0});var ie=m(C);A=f(ie,"BUTTON",{class:!0});var Ze=m(A);b.l(Ze),Ze.forEach(c),V=k(ie),P=f(ie,"DIV",{class:!0});var ye=m(P);fe=f(ye,"SPAN",{class:!0});var ut=m(fe);Z=G(ut,W),ut.forEach(c),oe=k(ye),ne=f(ye,"DIV",{class:!0});var Qe=m(ne);ee=f(Qe,"DIV",{class:!0,style:!0}),m(ee).forEach(c),Qe.forEach(c),Ne=k(ye),we=f(ye,"SPAN",{class:!0});var $e=m(we);Pe=G($e,he),$e.forEach(c),ye.forEach(c),ie.forEach(c),Se=k(I),p&&p.l(I),I.forEach(c),this.h()},h(){i(l,"class","w-2 h-2 bg-green-500 rounded-full"),i(o,"class","font-medium text-gray-900 text-sm"),i(_,"class","text-xs text-gray-500"),i(a,"class","flex-1"),i(E,"class","text-gray-700"),i(K,"class","flex items-center gap-1.5 px-3 py-1.5 text-sm border border-gray-200 rounded-md hover:bg-gray-50 transition-colors"),i(O,"class","text-gray-700"),i($,"class","flex items-center gap-1.5 px-3 py-1.5 text-sm border border-gray-200 rounded-md hover:bg-gray-50 transition-colors"),i(Y,"class","flex items-center gap-2"),i(t,"class","flex items-center gap-3 mb-4"),i(A,"class","w-8 h-8 bg-black rounded-full flex items-center justify-center hover:bg-gray-800 transition-colors"),i(fe,"class","text-xs text-gray-500 font-mono"),i(ee,"class","h-full bg-gradient-to-r from-amber-400 to-orange-500 rounded-full transition-all"),jt(ee,"width",s[9]/s[10]*100+"%"),i(ne,"class","flex-1 h-1 bg-gray-200 rounded-full cursor-pointer"),i(we,"class","text-xs text-gray-500 font-mono"),i(P,"class","flex-1 flex items-center gap-2"),i(C,"class","flex items-center gap-3 mb-4"),i(e,"class","p-4 border border-gray-200 rounded-lg bg-white mb-6")},m(y,I){X(y,e,I),n(e,t),n(t,l),n(t,r),n(t,a),n(a,o),n(o,g),n(a,h),n(a,_),n(_,w),n(_,v),n(t,S),n(t,Y),n(Y,K),_e(D,K,null),n(K,T),n(K,E),n(Y,se),n(Y,$),n($,O),n($,F),_e(z,$,null),n(e,U),n(e,C),n(C,A),ue[J].m(A,null),n(C,V),n(C,P),n(P,fe),n(fe,Z),n(P,oe),n(P,ne),n(ne,ee),n(P,Ne),n(P,we),n(we,Pe),n(e,Se),p&&p.m(e,null),te=!0,ke||(Fe=[Q(K,"click",lr),Q($,"click",s[26]),Q(A,"click",s[21])],ke=!0)},p(y,I){(!te||I[0]&2048)&&Ve(g,y[11]),(!te||I[0]&2)&&Ve(w,y[1]);let B=J;J=He(y),J!==B&&(it(),L(ue[B],1,1,()=>{ue[B]=null}),ot(),b=ue[J],b||(b=ue[J]=je[J](y),b.c()),j(b,1),b.m(A,null)),(!te||I[0]&512)&&W!==(W=Et(y[9])+"")&&Ve(Z,W),(!te||I[0]&1536)&&jt(ee,"width",y[9]/y[10]*100+"%"),(!te||I[0]&1024)&&he!==(he=Et(y[10])+"")&&Ve(Pe,he),y[5]?p?p.p(y,I):(p=dl(y),p.c(),p.m(e,null)):p&&(p.d(1),p=null)},i(y){te||(j(D.$$.fragment,y),j(z.$$.fragment,y),j(b),te=!0)},o(y){L(D.$$.fragment,y),L(z.$$.fragment,y),L(b),te=!1},d(y){y&&c(e),ge(D),ge(z),ue[J].d(),p&&p.d(),ke=!1,ht(Fe)}}}function Kl(s){let e,t;return e=new Rt({props:{size:14,class:"text-white ml-0.5"}}),{c(){be(e.$$.fragment)},l(l){ve(e.$$.fragment,l)},m(l,r){_e(e,l,r),t=!0},i(l){t||(j(e.$$.fragment,l),t=!0)},o(l){L(e.$$.fragment,l),t=!1},d(l){ge(e,l)}}}function ql(s){let e;return{c(){e=u("div"),this.h()},l(t){e=f(t,"DIV",{class:!0}),m(e).forEach(c),this.h()},h(){i(e,"class","pause-filled text-white svelte-1e73h5m")},m(t,l){X(t,e,l)},i:$t,o:$t,d(t){t&&c(e)}}}function dl(s){let e,t,l,r;return{c(){e=u("audio"),this.h()},l(a){e=f(a,"AUDIO",{src:!0,style:!0}),m(e).forEach(c),this.h()},h(){al(e.src,t=s[5])||i(e,"src",t),jt(e,"display","none")},m(a,o){X(a,e,o),s[33](e),l||(r=[Q(e,"loadedmetadata",s[22]),Q(e,"timeupdate",s[23]),Q(e,"play",s[24]),Q(e,"pause",s[25])],l=!0)},p(a,o){o[0]&32&&!al(e.src,t=a[5])&&i(e,"src",t)},d(a){a&&c(e),s[33](null),l=!1,ht(r)}}}function hl(s){let e=s[49].name+"",t,l,r=s[49].badge&&Xl(s);return{c(){t=R(e),r&&r.c(),l=Re()},l(a){t=G(a,e),r&&r.l(a),l=Re()},m(a,o){X(a,t,o),r&&r.m(a,o),X(a,l,o)},p(a,o){a[49].badge&&r.p(a,o)},d(a){a&&(c(t),c(l)),r&&r.d(a)}}}function Xl(s){let e,t,l,r=s[49].badge+"",a,o;return{c(){e=R(" "),t=u("span"),l=R("("),a=R(r),o=R(")"),this.h()},l(g){e=G(g," "),t=f(g,"SPAN",{class:!0});var h=m(t);l=G(h,"("),a=G(h,r),o=G(h,")"),h.forEach(c),this.h()},h(){i(t,"class","text-xs text-gray-500")},m(g,h){X(g,e,h),X(g,t,h),n(t,l),n(t,a),n(t,o)},p:$t,d(g){g&&(c(e),c(t))}}}function ml(s){let e,t=s[49].name===s[2]&&hl(s);return{c(){t&&t.c(),e=Re()},l(l){t&&t.l(l),e=Re()},m(l,r){t&&t.m(l,r),X(l,e,r)},p(l,r){l[49].name===l[2]?t?t.p(l,r):(t=hl(l),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(l){l&&c(e),t&&t.d(l)}}}function pl(s){let e,t=ct(s[18]),l=[];for(let r=0;r<t.length;r+=1)l[r]=gl(il(s,t,r));return{c(){e=u("div");for(let r=0;r<l.length;r+=1)l[r].c();this.h()},l(r){e=f(r,"DIV",{class:!0});var a=m(e);for(let o=0;o<l.length;o+=1)l[o].l(a);a.forEach(c),this.h()},h(){i(e,"class","absolute top-full left-0 right-0 mt-1 bg-white border border-gray-200 rounded-lg shadow-lg z-10")},m(r,a){X(r,e,a);for(let o=0;o<l.length;o+=1)l[o]&&l[o].m(e,null)},p(r,a){if(a[0]&262156){t=ct(r[18]);let o;for(o=0;o<t.length;o+=1){const g=il(r,t,o);l[o]?l[o].p(g,a):(l[o]=gl(g),l[o].c(),l[o].m(e,null))}for(;o<l.length;o+=1)l[o].d(1);l.length=t.length}},d(r){r&&c(e),Mt(l,r)}}}function Yl(s){let e,t,l,r=s[49].badge+"",a,o;return{c(){e=R(" "),t=u("span"),l=R("("),a=R(r),o=R(")"),this.h()},l(g){e=G(g," "),t=f(g,"SPAN",{class:!0});var h=m(t);l=G(h,"("),a=G(h,r),o=G(h,")"),h.forEach(c),this.h()},h(){i(t,"class","text-xs text-gray-500")},m(g,h){X(g,e,h),X(g,t,h),n(t,l),n(t,a),n(t,o)},p:$t,d(g){g&&(c(e),c(t))}}}function gl(s){let e,t=s[49].name+"",l,r,a,o,g,h=s[49].badge&&Yl(s);function _(){return s[35](s[49])}return{c(){e=u("button"),l=R(t),h&&h.c(),r=x(),this.h()},l(w){e=f(w,"BUTTON",{class:!0});var v=m(e);l=G(v,t),h&&h.l(v),r=k(v),v.forEach(c),this.h()},h(){i(e,"class",a="w-full px-3 py-1.5 text-left transition-colors text-xs "+(s[49].disabled?"opacity-50 cursor-not-allowed":"hover:bg-gray-50")+" "+(s[49].name===s[2]?"bg-gray-100":"")),e.disabled=s[49].disabled},m(w,v){X(w,e,v),n(e,l),h&&h.m(e,null),n(e,r),o||(g=Q(e,"click",_),o=!0)},p(w,v){s=w,s[49].badge&&h.p(s,v),v[0]&4&&a!==(a="w-full px-3 py-1.5 text-left transition-colors text-xs "+(s[49].disabled?"opacity-50 cursor-not-allowed":"hover:bg-gray-50")+" "+(s[49].name===s[2]?"bg-gray-100":""))&&i(e,"class",a)},d(w){w&&c(e),h&&h.d(),o=!1,g()}}}function Wl(s){let e,t;return e=new Rt({props:{size:14,class:"text-gray-600"}}),{c(){be(e.$$.fragment)},l(l){ve(e.$$.fragment,l)},m(l,r){_e(e,l,r),t=!0},i(l){t||(j(e.$$.fragment,l),t=!0)},o(l){L(e.$$.fragment,l),t=!1},d(l){ge(e,l)}}}function Zl(s){let e,t;return e=new Pl({props:{size:14,class:"text-gray-600"}}),{c(){be(e.$$.fragment)},l(l){ve(e.$$.fragment,l)},m(l,r){_e(e,l,r),t=!0},i(l){t||(j(e.$$.fragment,l),t=!0)},o(l){L(e.$$.fragment,l),t=!1},d(l){ge(e,l)}}}function _l(s){let e,t,l,r=s[46].name[0]+"",a,o,g,h,_=s[46].name+"",w,v,S,Y=s[46].description+"",K,D,T,E,N,se,$,O,ae,F;const z=[Zl,Wl],U=[];function C(b,V){return b[13]===b[46].name?0:1}E=C(s),N=U[E]=z[E](s);function A(...b){return s[36](s[46],...b)}function J(){return s[37](s[46])}return{c(){e=u("button"),t=u("div"),l=u("div"),a=R(r),o=x(),g=u("div"),h=u("div"),w=R(_),v=x(),S=u("div"),K=R(Y),D=x(),T=u("button"),N.c(),se=x(),this.h()},l(b){e=f(b,"BUTTON",{class:!0});var V=m(e);t=f(V,"DIV",{class:!0});var P=m(t);l=f(P,"DIV",{class:!0});var fe=m(l);a=G(fe,r),fe.forEach(c),o=k(P),g=f(P,"DIV",{class:!0});var W=m(g);h=f(W,"DIV",{class:!0});var Z=m(h);w=G(Z,_),Z.forEach(c),v=k(W),S=f(W,"DIV",{class:!0});var oe=m(S);K=G(oe,Y),oe.forEach(c),W.forEach(c),P.forEach(c),D=k(V),T=f(V,"BUTTON",{class:!0,title:!0});var ne=m(T);N.l(ne),ne.forEach(c),se=k(V),V.forEach(c),this.h()},h(){i(l,"class","w-8 h-8 bg-gradient-to-br from-amber-400 to-orange-500 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0"),i(h,"class","text-xs font-medium text-gray-900"),i(S,"class","text-xs text-gray-500 leading-relaxed"),i(g,"class","flex-1 min-w-0"),i(t,"class","flex items-center gap-2.5 flex-1 min-w-0"),i(T,"class","p-1.5 rounded-full hover:bg-gray-200 transition-colors flex-shrink-0 ml-2 w-7 h-7 flex items-center justify-center"),i(T,"title","Play sample"),i(e,"class",$="w-full flex items-center justify-between p-1.5 rounded-lg hover:bg-gray-50 transition-colors text-left group border border-transparent "+(s[46].name===s[1]?"bg-gray-100 border-gray-200":""))},m(b,V){X(b,e,V),n(e,t),n(t,l),n(l,a),n(t,o),n(t,g),n(g,h),n(h,w),n(g,v),n(g,S),n(S,K),n(e,D),n(e,T),U[E].m(T,null),n(e,se),O=!0,ae||(F=[Q(T,"click",A),Q(e,"click",J)],ae=!0)},p(b,V){s=b;let P=E;E=C(s),E!==P&&(it(),L(U[P],1,1,()=>{U[P]=null}),ot(),N=U[E],N||(N=U[E]=z[E](s),N.c()),j(N,1),N.m(T,null)),(!O||V[0]&2&&$!==($="w-full flex items-center justify-between p-1.5 rounded-lg hover:bg-gray-50 transition-colors text-left group border border-transparent "+(s[46].name===s[1]?"bg-gray-100 border-gray-200":"")))&&i(e,"class",$)},i(b){O||(j(N),O=!0)},o(b){L(N),O=!1},d(b){b&&c(e),U[E].d(),ae=!1,ht(F)}}}function vl(s){let e,t,l,r,a,o,g,h,_,w,v,S,Y="An error occurred while processing your request",K,D,T,E,N,se,$,O,ae="Close",F,z,U;o=new Vl({props:{size:20,class:"text-red-600"}}),T=new Nl({props:{size:20,class:"text-gray-500"}});let C=s[16]&&bl(s);return{c(){e=u("div"),t=u("div"),l=u("div"),r=u("div"),a=u("div"),be(o.$$.fragment),g=x(),h=u("div"),_=u("h3"),w=R(s[15]),v=x(),S=u("p"),S.textContent=Y,K=x(),D=u("button"),be(T.$$.fragment),E=x(),N=u("div"),C&&C.c(),se=x(),$=u("div"),O=u("button"),O.textContent=ae,this.h()},l(A){e=f(A,"DIV",{class:!0});var J=m(e);t=f(J,"DIV",{class:!0});var b=m(t);l=f(b,"DIV",{class:!0});var V=m(l);r=f(V,"DIV",{class:!0});var P=m(r);a=f(P,"DIV",{class:!0});var fe=m(a);ve(o.$$.fragment,fe),fe.forEach(c),g=k(P),h=f(P,"DIV",{class:!0});var W=m(h);_=f(W,"H3",{class:!0});var Z=m(_);w=G(Z,s[15]),Z.forEach(c),v=k(W),S=f(W,"P",{class:!0,"data-svelte-h":!0}),Ee(S)!=="svelte-1l3zl3"&&(S.textContent=Y),W.forEach(c),P.forEach(c),K=k(V),D=f(V,"BUTTON",{class:!0,title:!0});var oe=m(D);ve(T.$$.fragment,oe),oe.forEach(c),V.forEach(c),E=k(b),N=f(b,"DIV",{class:!0});var ne=m(N);C&&C.l(ne),ne.forEach(c),se=k(b),$=f(b,"DIV",{class:!0});var ee=m($);O=f(ee,"BUTTON",{class:!0,"data-svelte-h":!0}),Ee(O)!=="svelte-4sxk6g"&&(O.textContent=ae),ee.forEach(c),b.forEach(c),J.forEach(c),this.h()},h(){i(a,"class","w-10 h-10 bg-red-100 rounded-full flex items-center justify-center flex-shrink-0"),i(_,"class","text-lg font-semibold text-gray-900 truncate"),i(S,"class","text-sm text-gray-600"),i(h,"class","min-w-0"),i(r,"class","flex items-center gap-3 min-w-0"),i(D,"class","p-2 hover:bg-red-100 rounded-full transition-colors flex-shrink-0"),i(D,"title","Close"),i(l,"class","flex items-center justify-between p-6 border-b border-gray-200 bg-red-50 flex-shrink-0"),i(N,"class","p-6 overflow-y-auto flex-1 min-h-0"),i(O,"class","px-6 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors"),i($,"class","flex items-center justify-end gap-3 p-6 border-t border-gray-200 bg-gray-50 flex-shrink-0"),i(t,"class","bg-white rounded-xl shadow-2xl max-w-2xl w-full max-h-[80vh] flex flex-col"),i(e,"class","fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4")},m(A,J){X(A,e,J),n(e,t),n(t,l),n(l,r),n(r,a),_e(o,a,null),n(r,g),n(r,h),n(h,_),n(_,w),n(h,v),n(h,S),n(l,K),n(l,D),_e(T,D,null),n(t,E),n(t,N),C&&C.m(N,null),n(t,se),n(t,$),n($,O),F=!0,z||(U=[Q(D,"click",s[30]),Q(O,"click",s[30])],z=!0)},p(A,J){(!F||J[0]&32768)&&Ve(w,A[15]),A[16]?C?C.p(A,J):(C=bl(A),C.c(),C.m(N,null)):C&&(C.d(1),C=null)},i(A){F||(j(o.$$.fragment,A),j(T.$$.fragment,A),F=!0)},o(A){L(o.$$.fragment,A),L(T.$$.fragment,A),F=!1},d(A){A&&c(e),ge(o),ge(T),C&&C.d(),z=!1,ht(U)}}}function bl(s){let e,t,l="Error Details:",r,a,o;function g(w,v){return v[0]&65536&&(o=null),o==null&&(o=!!w[16].includes("exceeded your monthly included credits")),o?er:Ql}let h=g(s,[-1,-1]),_=h(s);return{c(){e=u("div"),t=u("h4"),t.textContent=l,r=x(),a=u("pre"),_.c(),this.h()},l(w){e=f(w,"DIV",{class:!0});var v=m(e);t=f(v,"H4",{class:!0,"data-svelte-h":!0}),Ee(t)!=="svelte-3lmggt"&&(t.textContent=l),r=k(v),a=f(v,"PRE",{class:!0});var S=m(a);_.l(S),S.forEach(c),v.forEach(c),this.h()},h(){i(t,"class","text-sm font-medium text-gray-900 mb-2"),i(a,"class","text-xs text-gray-700 whitespace-pre-wrap font-mono leading-relaxed break-words"),i(e,"class","bg-gray-50 rounded-lg p-4 border")},m(w,v){X(w,e,v),n(e,t),n(e,r),n(e,a),_.m(a,null)},p(w,v){h===(h=g(w,v))&&_?_.p(w,v):(_.d(1),_=h(w),_&&(_.c(),_.m(a,null)))},d(w){w&&c(e),_.d()}}}function Ql(s){let e;return{c(){e=R(s[16])},l(t){e=G(t,s[16])},m(t,l){X(t,e,l)},p(t,l){l[0]&65536&&Ve(e,t[16])},d(t){t&&c(e)}}}function er(s){let e,t=s[16].replace("Subscribe to PRO",'<a href="https://huggingface.co/settings/billing" target="_blank" class="text-amber-600 hover:text-amber-700 underline font-medium">Subscribe to PRO</a>')+"",l;return{c(){e=new $l(!1),l=Re(),this.h()},l(r){e=El(r,!1),l=Re(),this.h()},h(){e.a=l},m(r,a){e.m(t,r,a),X(r,l,a)},p(r,a){a[0]&65536&&t!==(t=r[16].replace("Subscribe to PRO",'<a href="https://huggingface.co/settings/billing" target="_blank" class="text-amber-600 hover:text-amber-700 underline font-medium">Subscribe to PRO</a>')+"")&&e.p(t)},d(r){r&&(c(l),e.d())}}}function tr(s){let e,t,l,r,a,o,g,h,_,w,v,S,Y=s[0].length.toLocaleString()+"",K,D,T,E,N,se,$,O,ae,F,z,U,C,A,J,b,V,P,fe="Model",W,Z,oe,ne,ee,Ne,we,he,Pe='Estimated $0.025 per 1000 characters ⒠<a href="https://huggingface.co/settings/billing" target="_blank" class="text-amber-600 hover:text-amber-700 underline">Billing ‴</a>',Se,te,ke,Fe='<h3 class="text-sm font-medium text-gray-900">Voice</h3>',je,ue,He,p,y,I,B,Ie="Exaggeration",We,De,Te=s[6].toFixed(2)+"",Ae,Oe,ie,Ze,ye,ut="<span>None</span> <span>Exaggerated</span>",Qe,$e,Le,ze,Ft="Stability",Ct,et,dt=s[7].toFixed(2)+"",mt,Vt,xe,Nt,Je,Jt="<span>More stable</span> <span>More variable</span>",Pt,Ke,Kt='<a href="https://github.com/gradio-app/hfstudio" target="_blank" class="p-2 text-gray-400 hover:text-gray-600 transition-colors" title="View on GitHub"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"></path></svg></a>',pt,tt,Ue,St,qt;a=new Cl({props:{size:14}});let me=s[17]>0&&fl(s);N=new Rl({props:{size:16}});const Xt=[Jl,Fl],qe=[];function Yt(d,M){return d[4]?0:1}z=Yt(s),U=qe[z]=Xt[z](s);let le=s[5]&&ul(s),lt=ct(s[18]),de=[];for(let d=0;d<lt.length;d+=1)de[d]=ml(cl(s,lt,d));ee=new jl({props:{size:14,class:"text-gray-500"}});let pe=s[3]&&pl(s),Xe=ct(s[19]),q=[];for(let d=0;d<Xe.length;d+=1)q[d]=_l(ol(s,Xe,d));const yl=d=>L(q[d],1,1,()=>{q[d]=null});let re=s[14]&&vl(s);return{c(){e=x(),t=u("div"),l=u("div"),r=u("a"),be(a.$$.fragment),o=R(`
|
| 6 |
+
Code Recorder
|
| 7 |
+
`),me&&me.c(),g=x(),h=u("div"),_=u("div"),w=u("div"),v=u("div"),S=u("span"),K=R(Y),D=R(" / 1,000 characters"),T=x(),E=u("button"),be(N.$$.fragment),se=x(),$=u("textarea"),O=x(),ae=u("div"),F=u("button"),U.c(),A=x(),le&&le.c(),J=x(),b=u("div"),V=u("div"),P=u("h3"),P.textContent=fe,W=x(),Z=u("button"),oe=u("span");for(let d=0;d<de.length;d+=1)de[d].c();ne=x(),be(ee.$$.fragment),Ne=x(),pe&&pe.c(),we=x(),he=u("div"),he.innerHTML=Pe,Se=x(),te=u("div"),ke=u("div"),ke.innerHTML=Fe,je=x(),ue=u("div");for(let d=0;d<q.length;d+=1)q[d].c();He=x(),p=u("div"),y=u("div"),I=u("div"),B=u("label"),B.textContent=Ie,We=x(),De=u("span"),Ae=R(Te),Oe=x(),ie=u("input"),Ze=x(),ye=u("div"),ye.innerHTML=ut,Qe=x(),$e=u("div"),Le=u("div"),ze=u("label"),ze.textContent=Ft,Ct=x(),et=u("span"),mt=R(dt),Vt=x(),xe=u("input"),Nt=x(),Je=u("div"),Je.innerHTML=Jt,Pt=x(),Ke=u("div"),Ke.innerHTML=Kt,pt=x(),re&&re.c(),tt=Re(),this.h()},l(d){wl("svelte-y100ki",nl.head).forEach(c),e=k(d),t=f(d,"DIV",{class:!0});var ce=m(t);l=f(ce,"DIV",{class:!0});var H=m(l);r=f(H,"A",{href:!0,class:!0});var Ce=m(r);ve(a.$$.fragment,Ce),o=G(Ce,`
|
| 8 |
+
Code Recorder
|
| 9 |
+
`),me&&me.l(Ce),Ce.forEach(c),H.forEach(c),g=k(ce),h=f(ce,"DIV",{class:!0});var gt=m(h);_=f(gt,"DIV",{class:!0});var rt=m(_);w=f(rt,"DIV",{class:!0});var _t=m(w);v=f(_t,"DIV",{class:!0});var vt=m(v);S=f(vt,"SPAN",{class:!0});var At=m(S);K=G(At,Y),D=G(At," / 1,000 characters"),At.forEach(c),T=k(vt),E=f(vt,"BUTTON",{class:!0,title:!0});var Wt=m(E);ve(N.$$.fragment,Wt),Wt.forEach(c),vt.forEach(c),se=k(_t),$=f(_t,"TEXTAREA",{maxlength:!0,class:!0,placeholder:!0}),m($).forEach(c),_t.forEach(c),O=k(rt),ae=f(rt,"DIV",{class:!0});var Zt=m(ae);F=f(Zt,"BUTTON",{class:!0});var Qt=m(F);U.l(Qt),Qt.forEach(c),Zt.forEach(c),A=k(rt),le&&le.l(rt),rt.forEach(c),J=k(gt),b=f(gt,"DIV",{class:!0});var Be=m(b);V=f(Be,"DIV",{class:!0});var Ge=m(V);P=f(Ge,"H3",{class:!0,"data-svelte-h":!0}),Ee(P)!=="svelte-x9l5tw"&&(P.textContent=fe),W=k(Ge),Z=f(Ge,"BUTTON",{class:!0});var bt=m(Z);oe=f(bt,"SPAN",{});var el=m(oe);for(let Ye=0;Ye<de.length;Ye+=1)de[Ye].l(el);el.forEach(c),ne=k(bt),ve(ee.$$.fragment,bt),bt.forEach(c),Ne=k(Ge),pe&&pe.l(Ge),we=k(Ge),he=f(Ge,"DIV",{class:!0,"data-svelte-h":!0}),Ee(he)!=="svelte-1utaxqi"&&(he.innerHTML=Pe),Ge.forEach(c),Se=k(Be),te=f(Be,"DIV",{class:!0});var yt=m(te);ke=f(yt,"DIV",{class:!0,"data-svelte-h":!0}),Ee(ke)!=="svelte-1johetf"&&(ke.innerHTML=Fe),je=k(yt),ue=f(yt,"DIV",{class:!0});var tl=m(ue);for(let Ye=0;Ye<q.length;Ye+=1)q[Ye].l(tl);tl.forEach(c),yt.forEach(c),He=k(Be),p=f(Be,"DIV",{class:!0});var wt=m(p);y=f(wt,"DIV",{});var st=m(y);I=f(st,"DIV",{class:!0});var kt=m(I);B=f(kt,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),Ee(B)!=="svelte-b36oqo"&&(B.textContent=Ie),We=k(kt),De=f(kt,"SPAN",{class:!0});var ll=m(De);Ae=G(ll,Te),ll.forEach(c),kt.forEach(c),Oe=k(st),ie=f(st,"INPUT",{id:!0,type:!0,min:!0,max:!0,step:!0,class:!0}),Ze=k(st),ye=f(st,"DIV",{class:!0,"data-svelte-h":!0}),Ee(ye)!=="svelte-u3nxea"&&(ye.innerHTML=ut),st.forEach(c),Qe=k(wt),$e=f(wt,"DIV",{});var at=m($e);Le=f(at,"DIV",{class:!0});var xt=m(Le);ze=f(xt,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),Ee(ze)!=="svelte-186ztw5"&&(ze.textContent=Ft),Ct=k(xt),et=f(xt,"SPAN",{class:!0});var rl=m(et);mt=G(rl,dt),rl.forEach(c),xt.forEach(c),Vt=k(at),xe=f(at,"INPUT",{id:!0,type:!0,min:!0,max:!0,step:!0,class:!0}),Nt=k(at),Je=f(at,"DIV",{class:!0,"data-svelte-h":!0}),Ee(Je)!=="svelte-hva6g2"&&(Je.innerHTML=Jt),at.forEach(c),wt.forEach(c),Pt=k(Be),Ke=f(Be,"DIV",{class:!0,"data-svelte-h":!0}),Ee(Ke)!=="svelte-238d6k"&&(Ke.innerHTML=Kt),Be.forEach(c),gt.forEach(c),ce.forEach(c),pt=k(d),re&&re.l(d),tt=Re(),this.h()},h(){nl.title="Text to Speech - HFStudio",i(r,"href","/code-recorder"),i(r,"class","px-3 py-1.5 text-sm font-medium rounded transition-colors text-gray-600 hover:bg-gray-50 flex items-center gap-1 bg-gray-100"),i(l,"class","flex items-center justify-end px-4 py-4 border-b border-gray-200 min-h-[73px]"),i(S,"class","text-sm text-gray-400"),i(E,"class","p-1 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-lg transition-colors"),i(E,"title","Refresh with famous book opening"),i(v,"class","absolute -top-2 right-0 flex items-center gap-2 z-10"),i($,"maxlength","1000"),i($,"class","w-full h-full p-6 bg-white resize-none border-0 focus:outline-none text-gray-900 text-base leading-relaxed"),i($,"placeholder","Type the text you'd like to convert to spoken audio here..."),$.autofocus=!0,i(w,"class","flex-1 relative"),F.disabled=C=s[4]||!s[0].trim(),i(F,"class","w-full px-6 py-3 bg-gradient-to-r from-amber-400 to-orange-500 text-white rounded-lg font-medium hover:from-amber-500 hover:to-orange-600 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2 shadow-sm"),i(ae,"class","absolute bottom-4 left-0 right-0 px-2"),i(_,"class","flex-1 flex flex-col p-6 relative"),i(P,"class","text-sm font-medium text-gray-900 mb-2"),i(Z,"class","w-full p-2.5 border border-gray-200 rounded-lg bg-white text-xs focus:outline-none focus:ring-2 focus:ring-amber-400 focus:border-transparent appearance-none bg-no-repeat bg-right pr-10 shadow-sm text-left flex items-center justify-between"),i(he,"class","mt-1.5 text-xs text-gray-500"),i(V,"class","mb-4 relative model-dropdown"),i(ke,"class","mb-2"),i(ue,"class","space-y-1.5"),i(te,"class","mb-4"),i(B,"for","exaggeration-slider"),i(B,"class","text-xs font-medium text-gray-700"),i(De,"class","text-xs text-gray-500"),i(I,"class","flex justify-between mb-0.5"),i(ie,"id","exaggeration-slider"),i(ie,"type","range"),i(ie,"min","0"),i(ie,"max","1"),i(ie,"step","0.01"),i(ie,"class","w-full h-1.5 bg-gray-200 rounded-lg appearance-none cursor-pointer slider-hf"),i(ye,"class","flex justify-between text-xs text-gray-400 mt-0.5"),i(ze,"for","temperature-slider"),i(ze,"class","text-xs font-medium text-gray-700"),i(et,"class","text-xs text-gray-500"),i(Le,"class","flex justify-between mb-0.5"),i(xe,"id","temperature-slider"),i(xe,"type","range"),i(xe,"min","0"),i(xe,"max","1"),i(xe,"step","0.01"),i(xe,"class","w-full h-1.5 bg-gray-200 rounded-lg appearance-none cursor-pointer slider-hf"),i(Je,"class","flex justify-between text-xs text-gray-400 mt-0.5"),i(p,"class","space-y-3 pt-3 border-t border-gray-200"),i(Ke,"class","mt-auto pt-3 flex justify-end"),i(b,"class","w-80 border-l border-gray-200 bg-white p-3 overflow-y-auto"),i(h,"class","flex-1 flex"),i(t,"class","flex flex-col h-full")},m(d,M){X(d,e,M),X(d,t,M),n(t,l),n(l,r),_e(a,r,null),n(r,o),me&&me.m(r,null),n(t,g),n(t,h),n(h,_),n(_,w),n(w,v),n(v,S),n(S,K),n(S,D),n(v,T),n(v,E),_e(N,E,null),n(w,se),n(w,$),nt($,s[0]),n(_,O),n(_,ae),n(ae,F),qe[z].m(F,null),n(_,A),le&&le.m(_,null),n(h,J),n(h,b),n(b,V),n(V,P),n(V,W),n(V,Z),n(Z,oe);for(let ce=0;ce<de.length;ce+=1)de[ce]&&de[ce].m(oe,null);n(Z,ne),_e(ee,Z,null),n(V,Ne),pe&&pe.m(V,null),n(V,we),n(V,he),n(b,Se),n(b,te),n(te,ke),n(te,je),n(te,ue);for(let ce=0;ce<q.length;ce+=1)q[ce]&&q[ce].m(ue,null);n(b,He),n(b,p),n(p,y),n(y,I),n(I,B),n(I,We),n(I,De),n(De,Ae),n(y,Oe),n(y,ie),nt(ie,s[6]),n(y,Ze),n(y,ye),n(p,Qe),n(p,$e),n($e,Le),n(Le,ze),n(Le,Ct),n(Le,et),n(et,mt),n($e,Vt),n($e,xe),nt(xe,s[7]),n($e,Nt),n($e,Je),n(b,Pt),n(b,Ke),X(d,pt,M),re&&re.m(d,M),X(d,tt,M),Ue=!0,$.focus(),St||(qt=[Q(E,"click",s[31]),Q($,"input",s[32]),Q($,"keydown",s[28]),Q(F,"click",s[20]),Q(Z,"click",s[34]),Q(ie,"change",s[38]),Q(ie,"input",s[38]),Q(xe,"change",s[39]),Q(xe,"input",s[39]),Q(t,"click",s[29])],St=!0)},p(d,M){d[17]>0?me?me.p(d,M):(me=fl(d),me.c(),me.m(r,null)):me&&(me.d(1),me=null),(!Ue||M[0]&1)&&Y!==(Y=d[0].length.toLocaleString()+"")&&Ve(K,Y),M[0]&1&&nt($,d[0]);let ce=z;if(z=Yt(d),z!==ce&&(it(),L(qe[ce],1,1,()=>{qe[ce]=null}),ot(),U=qe[z],U||(U=qe[z]=Xt[z](d),U.c()),j(U,1),U.m(F,null)),(!Ue||M[0]&17&&C!==(C=d[4]||!d[0].trim()))&&(F.disabled=C),d[5]?le?(le.p(d,M),M[0]&32&&j(le,1)):(le=ul(d),le.c(),j(le,1),le.m(_,null)):le&&(it(),L(le,1,1,()=>{le=null}),ot()),M[0]&262148){lt=ct(d[18]);let H;for(H=0;H<lt.length;H+=1){const Ce=cl(d,lt,H);de[H]?de[H].p(Ce,M):(de[H]=ml(Ce),de[H].c(),de[H].m(oe,null))}for(;H<de.length;H+=1)de[H].d(1);de.length=lt.length}if(d[3]?pe?pe.p(d,M):(pe=pl(d),pe.c(),pe.m(V,we)):pe&&(pe.d(1),pe=null),M[0]&134750210){Xe=ct(d[19]);let H;for(H=0;H<Xe.length;H+=1){const Ce=ol(d,Xe,H);q[H]?(q[H].p(Ce,M),j(q[H],1)):(q[H]=_l(Ce),q[H].c(),j(q[H],1),q[H].m(ue,null))}for(it(),H=Xe.length;H<q.length;H+=1)yl(H);ot()}(!Ue||M[0]&64)&&Te!==(Te=d[6].toFixed(2)+"")&&Ve(Ae,Te),M[0]&64&&nt(ie,d[6]),(!Ue||M[0]&128)&&dt!==(dt=d[7].toFixed(2)+"")&&Ve(mt,dt),M[0]&128&&nt(xe,d[7]),d[14]?re?(re.p(d,M),M[0]&16384&&j(re,1)):(re=vl(d),re.c(),j(re,1),re.m(tt.parentNode,tt)):re&&(it(),L(re,1,1,()=>{re=null}),ot())},i(d){if(!Ue){j(a.$$.fragment,d),j(N.$$.fragment,d),j(U),j(le),j(ee.$$.fragment,d);for(let M=0;M<Xe.length;M+=1)j(q[M]);j(re),Ue=!0}},o(d){L(a.$$.fragment,d),L(N.$$.fragment,d),L(U),L(le),L(ee.$$.fragment,d),q=q.filter(Boolean);for(let M=0;M<q.length;M+=1)L(q[M]);L(re),Ue=!1},d(d){d&&(c(e),c(t),c(pt),c(tt)),ge(a),me&&me.d(),ge(N),qe[z].d(),le&&le.d(),Mt(de,d),ge(ee),pe&&pe.d(),Mt(q,d),re&&re.d(d),St=!1,ht(qt)}}}function Et(s){const e=Math.floor(s/60),t=Math.floor(s%60);return`${e}:${t.toString().padStart(2,"0")}`}function lr(){}function rr(s,e,t){let l="In a hole in the ground, there lived a hobbit. Not a nasty, dirty, wet hole, filled with the ends of worms and an oozy smell, nor yet a dry, bare, sandy hole with nothing in it to sit down on or to eat: it was a hobbit-hole, and that means comfort.",r="Andrew",a="Chatterbox",o=!1,g=!1,h=null,_=.25,w=.7,v=!1,S=0,Y=0,K="",D=null,T=null,E=null,N=!1,se="",$="",O=0;const ae=["It was the best of times, it was the worst of times. It was the age of wisdom, it was the age of foolishness.","It is a truth universally acknowledged, that a single man in possession of a good fortune, must be in want of a wife.","All happy families are alike; each unhappy family is unhappy in its own way."];let F=0;const z=[{id:"chatterbox",name:"Chatterbox",badge:"recommended"},{id:"kokoro",name:"Kokoro",badge:"coming soon",disabled:!0}],U=[{id:"andrew",name:"Andrew",description:"Older British man who speaks clearly and kindly",sample:"/voices/andrew.mp3",preview_url:"https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/andrew.mp3"},{id:"lily",name:"Jasmine",description:"Warm, conversational tone of a woman in her 30s",sample:"/voices/lily.mp3",preview_url:"https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/lily.mp3"},{id:"pirate",name:"Pirate",description:"Young male pirate-y voice that speaks gruffly and with excitement",sample:"/voices/pirate.mp3",preview_url:"https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/pirate.mp3"},{id:"fairy",name:"Fairy",description:"High and airy female voice that bursts with excitement",sample:"/voices/fairy.mp3",preview_url:"https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/fairy.mp3"}];async function C(){if(!l.trim())return;if(!(await fetch("/api/auth/user",{credentials:"include"})).ok){window.dispatchEvent(new CustomEvent("show-login-prompt"));return}t(4,g=!0),t(5,h=null),t(9,S=0),t(8,v=!1),t(11,K=l.length>30?l.substring(0,30)+"...":l);try{const y={text:l,voice_id:r.toLowerCase(),model_id:a.toLowerCase(),mode:"api",parameters:{exaggeration:_,temperature:w}},I=await fetch("/api/tts/generate",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(y)});if(!I.ok){const Ie=await I.text();throw new Error(`HTTP error! status: ${I.status}, body: ${Ie}`)}const B=await I.json();if(B.success&&B.audio_url)t(5,h=B.audio_url),await we(y,B),setTimeout(()=>{D&&D.play().catch(()=>{})},100);else{const Ie=B.error||"Unknown error occurred";ne("Generation Failed",Ie),t(5,h=null)}}catch{ne("Network Error","Failed to connect to the server. Please check your connection and try again."),t(5,h=null)}finally{t(4,g=!1)}}function A(){D&&(v?D.pause():D.play())}function J(){D&&t(10,Y=D.duration)}function b(){D&&t(9,S=D.currentTime)}function V(){t(8,v=!0)}function P(){t(8,v=!1)}function fe(){if(h){const p=document.createElement("a");p.href=h,p.download="speech.wav",p.click()}}function W(p,y){if(y.stopPropagation(),E===p.name)T&&(T.pause(),T.currentTime=0),t(13,E=null);else{T&&T.pause(),t(13,E=p.name);const I=p.sample||"/samples/harvard.wav";T?T.src=I:(T=new Audio(I),T.addEventListener("ended",()=>{t(13,E=null)})),T.play().catch(B=>{t(13,E=null)})}}function Z(p){p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),C())}function oe(p){p.target.closest(".model-dropdown")||t(3,o=!1)}function ne(p,y=""){t(15,se=p),t(16,$=y),t(14,N=!0)}function ee(){t(14,N=!1),t(15,se=""),t(16,$="")}function Ne(){F=(F+1)%ae.length,t(0,l=ae[F])}async function we(p,y){try{const I=`# Generate speech
|
| 10 |
+
client.text_to_speech(
|
| 11 |
+
text="${p.text.replace(/"/g,'\\"')}",
|
| 12 |
+
voice_id="${p.voice_id}",
|
| 13 |
+
model_id="${p.model_id}",
|
| 14 |
+
exaggeration=${p.parameters.exaggeration},
|
| 15 |
+
temperature=${p.parameters.temperature}
|
| 16 |
+
)`;await fetch("/api/history/save",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({code:I,result_type:"audio",result_data:{url:y.audio_url,title:K,type:"audio"},entry_type:"generation"})}),await he()}catch(I){console.error("Error saving to history:",I)}}async function he(){try{const p=await fetch("/api/history/load",{method:"GET",credentials:"include"});if(p.ok){const I=(await p.json()).entries.filter(B=>B.entry_type==="generation");t(17,O=I.length)}}catch(p){console.error("Error loading history count:",p),t(17,O=0)}}kl(async()=>{await he()});function Pe(){l=this.value,t(0,l)}function Se(p){xl[p?"unshift":"push"](()=>{D=p,t(12,D)})}const te=()=>t(3,o=!o),ke=p=>{p.disabled||(t(2,a=p.name),t(3,o=!1))},Fe=(p,y)=>W(p,y),je=p=>t(1,r=p.name);function ue(){_=sl(this.value),t(6,_)}function He(){w=sl(this.value),t(7,w)}return[l,r,a,o,g,h,_,w,v,S,Y,K,D,E,N,se,$,O,z,U,C,A,J,b,V,P,fe,W,Z,oe,ee,Ne,Pe,Se,te,ke,Fe,je,ue,He]}class fr extends It{constructor(e){super(),Dt(this,e,rr,tr,Tt,{},null,[-1,-1])}}export{fr as component};
|
hfstudio/static/_app/immutable/nodes/3.BFTLVg3t.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{S as Ce,i as De,s as Pe,m as me,o as se,p as X,q as B,r as le,u as ie,v as oe,w as Ee,x as Le,y as Me,z as He,A as Ge,d as y,B as Ue,D as E,C as _e,b as Q,c as p,F as pe,G as ft,h as j,e as S,f as F,g as ae,H as we,I as We,k as q,j as A,t as re,J as gt,a as ke,n as pt,Y as ze,Z as Be,M as ye,R as ht,N as Ke}from"../chunks/BjzGjDWb.js";import{g as mt,D as bt,S as vt}from"../chunks/DeMXkdTg.js";import{I as Ve,g as je,a as qe,e as Je,u as _t,o as yt}from"../chunks/DrRA3Ukb.js";import"../chunks/IHki7fMi.js";import{P as Et,a as wt}from"../chunks/CDuamvIE.js";function kt(i){let t;const e=i[2].default,n=Le(e,i,i[3],null);return{c(){n&&n.c()},l(a){n&&n.l(a)},m(a,r){n&&n.m(a,r),t=!0},p(a,r){n&&n.p&&(!t||r&8)&&Me(n,e,a,a[3],t?Ge(e,a[3],r,null):He(a[3]),null)},i(a){t||(B(n,a),t=!0)},o(a){X(n,a),t=!1},d(a){n&&n.d(a)}}}function St(i){let t,e;const n=[{name:"copy"},i[1],{iconNode:i[0]}];let a={$$slots:{default:[kt]},$$scope:{ctx:i}};for(let r=0;r<n.length;r+=1)a=me(a,n[r]);return t=new Ve({props:a}),{c(){oe(t.$$.fragment)},l(r){ie(t.$$.fragment,r)},m(r,u){le(t,r,u),e=!0},p(r,[u]){const o=u&3?je(n,[n[0],u&2&&qe(r[1]),u&1&&{iconNode:r[0]}]):{};u&8&&(o.$$scope={dirty:u,ctx:r}),t.$set(o)},i(r){e||(B(t.$$.fragment,r),e=!0)},o(r){X(t.$$.fragment,r),e=!1},d(r){se(t,r)}}}function At(i,t,e){let{$$slots:n={},$$scope:a}=t;const r=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]];return i.$$set=u=>{e(1,t=me(me({},t),Ee(u))),"$$scope"in u&&e(3,a=u.$$scope)},t=Ee(t),[r,t,n,a]}class Oe extends Ce{constructor(t){super(),De(this,t,At,St,Pe,{})}}function $t(i){let t;const e=i[2].default,n=Le(e,i,i[3],null);return{c(){n&&n.c()},l(a){n&&n.l(a)},m(a,r){n&&n.m(a,r),t=!0},p(a,r){n&&n.p&&(!t||r&8)&&Me(n,e,a,a[3],t?Ge(e,a[3],r,null):He(a[3]),null)},i(a){t||(B(n,a),t=!0)},o(a){X(n,a),t=!1},d(a){n&&n.d(a)}}}function xt(i){let t,e;const n=[{name:"panels-top-left"},i[1],{iconNode:i[0]}];let a={$$slots:{default:[$t]},$$scope:{ctx:i}};for(let r=0;r<n.length;r+=1)a=me(a,n[r]);return t=new Ve({props:a}),{c(){oe(t.$$.fragment)},l(r){ie(t.$$.fragment,r)},m(r,u){le(t,r,u),e=!0},p(r,[u]){const o=u&3?je(n,[n[0],u&2&&qe(r[1]),u&1&&{iconNode:r[0]}]):{};u&8&&(o.$$scope={dirty:u,ctx:r}),t.$set(o)},i(r){e||(B(t.$$.fragment,r),e=!0)},o(r){X(t.$$.fragment,r),e=!1},d(r){se(t,r)}}}function It(i,t,e){let{$$slots:n={},$$scope:a}=t;const r=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M3 9h18"}],["path",{d:"M9 21V9"}]];return i.$$set=u=>{e(1,t=me(me({},t),Ee(u))),"$$scope"in u&&e(3,a=u.$$scope)},t=Ee(t),[r,t,n,a]}class Tt extends Ce{constructor(t){super(),De(this,t,It,xt,Pe,{})}}function Ft(i){let t;const e=i[2].default,n=Le(e,i,i[3],null);return{c(){n&&n.c()},l(a){n&&n.l(a)},m(a,r){n&&n.m(a,r),t=!0},p(a,r){n&&n.p&&(!t||r&8)&&Me(n,e,a,a[3],t?Ge(e,a[3],r,null):He(a[3]),null)},i(a){t||(B(n,a),t=!0)},o(a){X(n,a),t=!1},d(a){n&&n.d(a)}}}function Ct(i){let t,e;const n=[{name:"rotate-ccw"},i[1],{iconNode:i[0]}];let a={$$slots:{default:[Ft]},$$scope:{ctx:i}};for(let r=0;r<n.length;r+=1)a=me(a,n[r]);return t=new Ve({props:a}),{c(){oe(t.$$.fragment)},l(r){ie(t.$$.fragment,r)},m(r,u){le(t,r,u),e=!0},p(r,[u]){const o=u&3?je(n,[n[0],u&2&&qe(r[1]),u&1&&{iconNode:r[0]}]):{};u&8&&(o.$$scope={dirty:u,ctx:r}),t.$set(o)},i(r){e||(B(t.$$.fragment,r),e=!0)},o(r){X(t.$$.fragment,r),e=!1},d(r){se(t,r)}}}function Dt(i,t,e){let{$$slots:n={},$$scope:a}=t;const r=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}],["path",{d:"M3 3v5h5"}]];return i.$$set=u=>{e(1,t=me(me({},t),Ee(u))),"$$scope"in u&&e(3,a=u.$$scope)},t=Ee(t),[r,t,n,a]}class Pt extends Ce{constructor(t){super(),De(this,t,Dt,Ct,Pe,{})}}var Qe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ot(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var dt={exports:{}};(function(i){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
| 2 |
+
* Prism: Lightweight, robust, elegant syntax highlighting
|
| 3 |
+
*
|
| 4 |
+
* @license MIT <https://opensource.org/licenses/MIT>
|
| 5 |
+
* @author Lea Verou <https://lea.verou.me>
|
| 6 |
+
* @namespace
|
| 7 |
+
* @public
|
| 8 |
+
*/var e=function(n){var a=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,r=0,u={},o={manual:n.Prism&&n.Prism.manual,disableWorkerMessageHandler:n.Prism&&n.Prism.disableWorkerMessageHandler,util:{encode:function s(l){return l instanceof x?new x(l.type,s(l.content),l.alias):Array.isArray(l)?l.map(s):l.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(s){return Object.prototype.toString.call(s).slice(8,-1)},objId:function(s){return s.__id||Object.defineProperty(s,"__id",{value:++r}),s.__id},clone:function s(l,c){c=c||{};var d,f;switch(o.util.type(l)){case"Object":if(f=o.util.objId(l),c[f])return c[f];d={},c[f]=d;for(var b in l)l.hasOwnProperty(b)&&(d[b]=s(l[b],c));return d;case"Array":return f=o.util.objId(l),c[f]?c[f]:(d=[],c[f]=d,l.forEach(function(v,m){d[m]=s(v,c)}),d);default:return l}},getLanguage:function(s){for(;s;){var l=a.exec(s.className);if(l)return l[1].toLowerCase();s=s.parentElement}return"none"},setLanguage:function(s,l){s.className=s.className.replace(RegExp(a,"gi"),""),s.classList.add("language-"+l)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(d){var s=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(d.stack)||[])[1];if(s){var l=document.getElementsByTagName("script");for(var c in l)if(l[c].src==s)return l[c]}return null}},isActive:function(s,l,c){for(var d="no-"+l;s;){var f=s.classList;if(f.contains(l))return!0;if(f.contains(d))return!1;s=s.parentElement}return!!c}},languages:{plain:u,plaintext:u,text:u,txt:u,extend:function(s,l){var c=o.util.clone(o.languages[s]);for(var d in l)c[d]=l[d];return c},insertBefore:function(s,l,c,d){d=d||o.languages;var f=d[s],b={};for(var v in f)if(f.hasOwnProperty(v)){if(v==l)for(var m in c)c.hasOwnProperty(m)&&(b[m]=c[m]);c.hasOwnProperty(v)||(b[v]=f[v])}var g=d[s];return d[s]=b,o.languages.DFS(o.languages,function(k,H){H===g&&k!=s&&(this[k]=b)}),b},DFS:function s(l,c,d,f){f=f||{};var b=o.util.objId;for(var v in l)if(l.hasOwnProperty(v)){c.call(l,v,l[v],d||v);var m=l[v],g=o.util.type(m);g==="Object"&&!f[b(m)]?(f[b(m)]=!0,s(m,c,null,f)):g==="Array"&&!f[b(m)]&&(f[b(m)]=!0,s(m,c,v,f))}}},plugins:{},highlightAll:function(s,l){o.highlightAllUnder(document,s,l)},highlightAllUnder:function(s,l,c){var d={callback:c,container:s,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};o.hooks.run("before-highlightall",d),d.elements=Array.prototype.slice.apply(d.container.querySelectorAll(d.selector)),o.hooks.run("before-all-elements-highlight",d);for(var f=0,b;b=d.elements[f++];)o.highlightElement(b,l===!0,d.callback)},highlightElement:function(s,l,c){var d=o.util.getLanguage(s),f=o.languages[d];o.util.setLanguage(s,d);var b=s.parentElement;b&&b.nodeName.toLowerCase()==="pre"&&o.util.setLanguage(b,d);var v=s.textContent,m={element:s,language:d,grammar:f,code:v};function g(H){m.highlightedCode=H,o.hooks.run("before-insert",m),m.element.innerHTML=m.highlightedCode,o.hooks.run("after-highlight",m),o.hooks.run("complete",m),c&&c.call(m.element)}if(o.hooks.run("before-sanity-check",m),b=m.element.parentElement,b&&b.nodeName.toLowerCase()==="pre"&&!b.hasAttribute("tabindex")&&b.setAttribute("tabindex","0"),!m.code){o.hooks.run("complete",m),c&&c.call(m.element);return}if(o.hooks.run("before-highlight",m),!m.grammar){g(o.util.encode(m.code));return}if(l&&n.Worker){var k=new Worker(o.filename);k.onmessage=function(H){g(H.data)},k.postMessage(JSON.stringify({language:m.language,code:m.code,immediateClose:!0}))}else g(o.highlight(m.code,m.grammar,m.language))},highlight:function(s,l,c){var d={code:s,grammar:l,language:c};if(o.hooks.run("before-tokenize",d),!d.grammar)throw new Error('The language "'+d.language+'" has no grammar.');return d.tokens=o.tokenize(d.code,d.grammar),o.hooks.run("after-tokenize",d),x.stringify(o.util.encode(d.tokens),d.language)},tokenize:function(s,l){var c=l.rest;if(c){for(var d in c)l[d]=c[d];delete l.rest}var f=new I;return M(f,f.head,s),D(s,f,l,f.head,0),C(f)},hooks:{all:{},add:function(s,l){var c=o.hooks.all;c[s]=c[s]||[],c[s].push(l)},run:function(s,l){var c=o.hooks.all[s];if(!(!c||!c.length))for(var d=0,f;f=c[d++];)f(l)}},Token:x};n.Prism=o;function x(s,l,c,d){this.type=s,this.content=l,this.alias=c,this.length=(d||"").length|0}x.stringify=function s(l,c){if(typeof l=="string")return l;if(Array.isArray(l)){var d="";return l.forEach(function(g){d+=s(g,c)}),d}var f={type:l.type,content:s(l.content,c),tag:"span",classes:["token",l.type],attributes:{},language:c},b=l.alias;b&&(Array.isArray(b)?Array.prototype.push.apply(f.classes,b):f.classes.push(b)),o.hooks.run("wrap",f);var v="";for(var m in f.attributes)v+=" "+m+'="'+(f.attributes[m]||"").replace(/"/g,""")+'"';return"<"+f.tag+' class="'+f.classes.join(" ")+'"'+v+">"+f.content+"</"+f.tag+">"};function T(s,l,c,d){s.lastIndex=l;var f=s.exec(c);if(f&&d&&f[1]){var b=f[1].length;f.index+=b,f[0]=f[0].slice(b)}return f}function D(s,l,c,d,f,b){for(var v in c)if(!(!c.hasOwnProperty(v)||!c[v])){var m=c[v];m=Array.isArray(m)?m:[m];for(var g=0;g<m.length;++g){if(b&&b.cause==v+","+g)return;var k=m[g],H=k.inside,Y=!!k.lookbehind,W=!!k.greedy,R=k.alias;if(W&&!k.pattern.global){var ge=k.pattern.toString().match(/[imsuy]*$/)[0];k.pattern=RegExp(k.pattern.source,ge+"g")}for(var ne=k.pattern||k,G=d.next,J=f;G!==l.tail&&!(b&&J>=b.reach);J+=G.value.length,G=G.next){var ue=G.value;if(l.length>s.length)return;if(!(ue instanceof x)){var he=1,U;if(W){if(U=T(ne,J,s,Y),!U||U.index>=s.length)break;var O=U.index,ve=U.index+U[0].length,ee=J;for(ee+=G.value.length;O>=ee;)G=G.next,ee+=G.value.length;if(ee-=G.value.length,J=ee,G.value instanceof x)continue;for(var z=G;z!==l.tail&&(ee<ve||typeof z.value=="string");z=z.next)he++,ee+=z.value.length;he--,ue=s.slice(J,ee),U.index-=J}else if(U=T(ne,0,ue,Y),!U)continue;var O=U.index,N=U[0],V=ue.slice(0,O),Z=ue.slice(O+N.length),ce=J+ue.length;b&&ce>b.reach&&(b.reach=ce);var de=G.prev;V&&(de=M(l,de,V),J+=V.length),L(l,de,he);var K=new x(v,H?o.tokenize(N,H):N,R,N);if(G=M(l,de,K),Z&&M(l,G,Z),he>1){var w={cause:v+","+g,reach:ce};D(s,l,c,G.prev,J,w),b&&w.reach>b.reach&&(b.reach=w.reach)}}}}}}function I(){var s={value:null,prev:null,next:null},l={value:null,prev:s,next:null};s.next=l,this.head=s,this.tail=l,this.length=0}function M(s,l,c){var d=l.next,f={value:c,prev:l,next:d};return l.next=f,d.prev=f,s.length++,f}function L(s,l,c){for(var d=l.next,f=0;f<c&&d!==s.tail;f++)d=d.next;l.next=d,d.prev=l,s.length-=f}function C(s){for(var l=[],c=s.head.next;c!==s.tail;)l.push(c.value),c=c.next;return l}if(!n.document)return n.addEventListener&&(o.disableWorkerMessageHandler||n.addEventListener("message",function(s){var l=JSON.parse(s.data),c=l.language,d=l.code,f=l.immediateClose;n.postMessage(o.highlight(d,o.languages[c],c)),f&&n.close()},!1)),o;var $=o.util.currentScript();$&&(o.filename=$.src,$.hasAttribute("data-manual")&&(o.manual=!0));function h(){o.manual||o.highlightAll()}if(!o.manual){var _=document.readyState;_==="loading"||_==="interactive"&&$&&$.defer?document.addEventListener("DOMContentLoaded",h):window.requestAnimationFrame?window.requestAnimationFrame(h):window.setTimeout(h,16)}return o}(t);i.exports&&(i.exports=e),typeof Qe<"u"&&(Qe.Prism=e),e.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(a,r){var u={};u["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:e.languages[r]},u.cdata=/^<!\[CDATA\[|\]\]>$/i;var o={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:u}};o["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var x={};x[a]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return a}),"i"),lookbehind:!0,greedy:!0,inside:o},e.languages.insertBefore("markup","cdata",x)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(n,a){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[a,"language-"+a],inside:e.languages[a]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml,function(n){var a=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+a.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+a.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+a.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+a.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:a,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var r=n.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))}(e),e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},e.languages.javascript=e.languages.extend("clike",{"class-name":[e.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript,function(){if(typeof e>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var n="Loadingβ¦",a=function($,h){return"β Error "+$+" while fetching file: "+h},r="β Error: File does not exist or is empty",u={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},o="data-src-status",x="loading",T="loaded",D="failed",I="pre[data-src]:not(["+o+'="'+T+'"]):not(['+o+'="'+x+'"])';function M($,h,_){var s=new XMLHttpRequest;s.open("GET",$,!0),s.onreadystatechange=function(){s.readyState==4&&(s.status<400&&s.responseText?h(s.responseText):s.status>=400?_(a(s.status,s.statusText)):_(r))},s.send(null)}function L($){var h=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec($||"");if(h){var _=Number(h[1]),s=h[2],l=h[3];return s?l?[_,Number(l)]:[_,void 0]:[_,_]}}e.hooks.add("before-highlightall",function($){$.selector+=", "+I}),e.hooks.add("before-sanity-check",function($){var h=$.element;if(h.matches(I)){$.code="",h.setAttribute(o,x);var _=h.appendChild(document.createElement("CODE"));_.textContent=n;var s=h.getAttribute("data-src"),l=$.language;if(l==="none"){var c=(/\.(\w+)$/.exec(s)||[,"none"])[1];l=u[c]||c}e.util.setLanguage(_,l),e.util.setLanguage(h,l);var d=e.plugins.autoloader;d&&d.loadLanguages(l),M(s,function(f){h.setAttribute(o,T);var b=L(h.getAttribute("data-range"));if(b){var v=f.split(/\r\n?|\n/g),m=b[0],g=b[1]==null?v.length:b[1];m<0&&(m+=v.length),m=Math.max(0,Math.min(m-1,v.length)),g<0&&(g+=v.length),g=Math.max(0,Math.min(g,v.length)),f=v.slice(m,g).join(`
|
| 9 |
+
`),h.hasAttribute("data-start")||h.setAttribute("data-start",String(m+1))}_.textContent=f,e.highlightElement(_)},function(f){h.setAttribute(o,D),_.textContent=f})}}),e.plugins.fileHighlight={highlight:function(h){for(var _=(h||document).querySelectorAll(I),s=0,l;l=_[s++];)e.highlightElement(l)}};var C=!1;e.fileHighlight=function(){C||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),C=!0),e.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(dt);var Rt=dt.exports;const fe=Ot(Rt);Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/};Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python;Prism.languages.py=Prism.languages.python;(function(i){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",e={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},n={bash:e,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};i.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:n},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:e}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:n},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:n.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:n.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},e.inside=i.languages.bash;for(var a=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],r=n.variable[1].inside,u=0;u<a.length;u++)r[a[u]]=i.languages.bash[a[u]];i.languages.sh=i.languages.bash,i.languages.shell=i.languages.bash})(Prism);const{document:et}=mt;function tt(i,t,e){const n=i.slice();return n[25]=t[e],n[26]=t,n[27]=e,n}function nt(i){let t,e;return{c(){t=A("span"),e=re(i[5]),this.h()},l(n){t=S(n,"SPAN",{class:!0});var a=F(t);e=ae(a,i[5]),a.forEach(y),this.h()},h(){E(t,"class","ml-1 px-1.5 py-0.5 bg-gray-500 text-white text-xs rounded-full min-w-[18px] text-center")},m(n,a){Q(n,t,a),p(t,e)},p(n,a){a&32&&ke(e,n[5])},d(n){n&&y(t)}}}function Nt(i){let t;return{c(){t=re("Python code to reproduce your actions via the API")},l(e){t=ae(e,"Python code to reproduce your actions via the API")},m(e,n){Q(e,t,n)},d(e){e&&y(t)}}}function Lt(i){let t;return{c(){t=re("Python code to reproduce your actions using a local HFStudio server")},l(e){t=ae(e,"Python code to reproduce your actions using a local HFStudio server")},m(e,n){Q(e,t,n)},d(e){e&&y(t)}}}function at(i){let t,e,n,a,r,u="Reset history",o,x,T,D,I,M="Copy all as Markdown",L,C,$;return n=new Pt({props:{size:16,class:"text-red-600"}}),T=new Oe({props:{size:16,class:"text-gray-600"}}),{c(){t=A("div"),e=A("button"),oe(n.$$.fragment),a=q(),r=A("span"),r.textContent=u,o=q(),x=A("button"),oe(T.$$.fragment),D=q(),I=A("span"),I.textContent=M,this.h()},l(h){t=S(h,"DIV",{class:!0});var _=F(t);e=S(_,"BUTTON",{class:!0,title:!0});var s=F(e);ie(n.$$.fragment,s),a=j(s),r=S(s,"SPAN",{class:!0,"data-svelte-h":!0}),we(r)!=="svelte-1x639i7"&&(r.textContent=u),s.forEach(y),o=j(_),x=S(_,"BUTTON",{class:!0});var l=F(x);ie(T.$$.fragment,l),D=j(l),I=S(l,"SPAN",{class:!0,"data-svelte-h":!0}),we(I)!=="svelte-kfbkuj"&&(I.textContent=M),l.forEach(y),_.forEach(y),this.h()},h(){E(r,"class","ml-2 text-sm font-medium text-red-600"),E(e,"class","flex items-center bg-red-50 hover:bg-red-100 rounded-md px-3 py-1.5 transition-colors"),E(e,"title","Clear history"),E(I,"class","ml-2 text-sm font-medium text-gray-600"),E(x,"class","flex items-center bg-gray-100 hover:bg-gray-200 rounded-md px-3 py-1.5 transition-colors"),E(t,"class","flex items-center gap-2")},m(h,_){Q(h,t,_),p(t,e),le(n,e,null),p(e,a),p(e,r),p(t,o),p(t,x),le(T,x,null),p(x,D),p(x,I),L=!0,C||($=[pe(e,"click",i[6]),pe(x,"click",i[8])],C=!0)},p:pt,i(h){L||(B(n.$$.fragment,h),B(T.$$.fragment,h),L=!0)},o(h){X(n.$$.fragment,h),X(T.$$.fragment,h),L=!1},d(h){h&&y(t),se(n),se(T),C=!1,Ue($)}}}function rt(i){let t,e,n,a='<span class="text-sm font-medium text-amber-900">Setup (Run in Terminal)</span> <span class="text-xs bg-amber-100 text-amber-700 px-2 py-0.5 rounded">Run once</span>',r,u,o,x,T,D,I,M;o=new Oe({props:{size:14,class:"text-amber-600"}});function L(h,_){return h[3]==="pip install huggingface-hub"?Ht:Mt}let C=L(i),$=C(i);return{c(){t=A("div"),e=A("div"),n=A("div"),n.innerHTML=a,r=q(),u=A("button"),oe(o.$$.fragment),x=q(),T=A("div"),$.c(),this.h()},l(h){t=S(h,"DIV",{class:!0});var _=F(t);e=S(_,"DIV",{class:!0});var s=F(e);n=S(s,"DIV",{class:!0,"data-svelte-h":!0}),we(n)!=="svelte-1uyzmln"&&(n.innerHTML=a),r=j(s),u=S(s,"BUTTON",{class:!0,title:!0});var l=F(u);ie(o.$$.fragment,l),l.forEach(y),s.forEach(y),x=j(_),T=S(_,"DIV",{class:!0});var c=F(T);$.l(c),c.forEach(y),_.forEach(y),this.h()},h(){E(n,"class","flex items-center gap-2"),E(u,"class","p-1.5 hover:bg-amber-100 rounded transition-colors"),E(u,"title","Copy setup code"),E(e,"class","flex items-center justify-between px-4 py-2 bg-amber-50 border-b border-amber-200"),E(T,"class","relative"),E(t,"class","bg-white rounded-lg border border-gray-200 overflow-hidden")},m(h,_){Q(h,t,_),p(t,e),p(e,n),p(e,r),p(e,u),le(o,u,null),p(t,x),p(t,T),$.m(T,null),D=!0,I||(M=pe(u,"click",i[12]),I=!0)},p(h,_){C===(C=L(h))&&$?$.p(h,_):($.d(1),$=C(h),$&&($.c(),$.m(T,null)))},i(h){D||(B(o.$$.fragment,h),D=!0)},o(h){X(o.$$.fragment,h),D=!1},d(h){h&&y(t),se(o),$.d(),I=!1,M()}}}function Mt(i){let t,e,n,a=fe.highlight(i[3],fe.languages.bash,"bash")+"";return{c(){t=A("pre"),e=A("code"),n=new Be(!1),this.h()},l(r){t=S(r,"PRE",{class:!0});var u=F(t);e=S(u,"CODE",{class:!0});var o=F(e);n=ze(o,!1),o.forEach(y),u.forEach(y),this.h()},h(){n.a=null,E(e,"class","language-bash text-sm"),E(t,"class","p-4 overflow-x-auto bg-gray-50")},m(r,u){Q(r,t,u),p(t,e),n.m(a,e)},p(r,u){u&8&&a!==(a=fe.highlight(r[3],fe.languages.bash,"bash")+"")&&n.p(a)},d(r){r&&y(t)}}}function Ht(i){let t,e,n;return{c(){t=A("pre"),e=A("code"),n=re(i[3]),this.h()},l(a){t=S(a,"PRE",{class:!0});var r=F(t);e=S(r,"CODE",{class:!0});var u=F(e);n=ae(u,i[3]),u.forEach(y),r.forEach(y),this.h()},h(){E(e,"class","language-bash text-sm text-black"),E(t,"class","p-4 overflow-x-auto bg-gray-50")},m(a,r){Q(a,t,r),p(t,e),p(e,n)},p(a,r){r&8&&ke(n,a[3])},d(a){a&&y(t)}}}function st(i){let t,e,n,a='<span class="text-sm font-medium text-blue-900">Imports (Python)</span> <span class="text-xs bg-blue-100 text-blue-700 px-2 py-0.5 rounded">Run once</span>',r,u,o,x,T,D,I,M,L=fe.highlight(i[1],fe.languages.python,"python")+"",C,$,h;return o=new Oe({props:{size:14,class:"text-blue-600"}}),{c(){t=A("div"),e=A("div"),n=A("div"),n.innerHTML=a,r=q(),u=A("button"),oe(o.$$.fragment),x=q(),T=A("div"),D=A("pre"),I=A("code"),M=new Be(!1),this.h()},l(_){t=S(_,"DIV",{class:!0});var s=F(t);e=S(s,"DIV",{class:!0});var l=F(e);n=S(l,"DIV",{class:!0,"data-svelte-h":!0}),we(n)!=="svelte-xrdajj"&&(n.innerHTML=a),r=j(l),u=S(l,"BUTTON",{class:!0,title:!0});var c=F(u);ie(o.$$.fragment,c),c.forEach(y),l.forEach(y),x=j(s),T=S(s,"DIV",{class:!0});var d=F(T);D=S(d,"PRE",{class:!0});var f=F(D);I=S(f,"CODE",{class:!0});var b=F(I);M=ze(b,!1),b.forEach(y),f.forEach(y),d.forEach(y),s.forEach(y),this.h()},h(){E(n,"class","flex items-center gap-2"),E(u,"class","p-1.5 hover:bg-blue-100 rounded transition-colors"),E(u,"title","Copy import code"),E(e,"class","flex items-center justify-between px-4 py-2 bg-blue-50 border-b border-blue-200"),M.a=null,E(I,"class","language-python text-sm"),E(D,"class","p-4 overflow-x-auto bg-gray-50"),E(T,"class","relative"),E(t,"class","bg-white rounded-lg border border-gray-200 overflow-hidden")},m(_,s){Q(_,t,s),p(t,e),p(e,n),p(e,r),p(e,u),le(o,u,null),p(t,x),p(t,T),p(T,D),p(D,I),M.m(L,I),C=!0,$||(h=pe(u,"click",i[13]),$=!0)},p(_,s){(!C||s&2)&&L!==(L=fe.highlight(_[1],fe.languages.python,"python")+"")&&M.p(L)},i(_){C||(B(o.$$.fragment,_),C=!0)},o(_){X(o.$$.fragment,_),C=!1},d(_){_&&y(t),se(o),$=!1,h()}}}function lt(i){let t,e='<p class="text-gray-500">Start using the UI to see generated code here</p>';return{c(){t=A("div"),t.innerHTML=e,this.h()},l(n){t=S(n,"DIV",{class:!0,"data-svelte-h":!0}),we(t)!=="svelte-1v3062w"&&(t.innerHTML=e),this.h()},h(){E(t,"class","bg-white rounded-lg border border-gray-200 p-8 text-center")},m(n,a){Q(n,t,a)},d(n){n&&y(t)}}}function it(i){let t,e,n,a,r,u,o,x,T,D,I=(i[25].result.title||"Generated Audio")+"",M,L,C,$,h=ct(i[25].result.duration||0)+"",_,s,l,c,d,f,b,v,m,g,k,H=i[26],Y=i[27],W,R,ge;const ne=[Ut,Gt],G=[];function J(z,O){return z[25].isPlaying?0:1}u=J(i),o=G[u]=ne[u](i);function ue(){return i[15](i[25])}d=new bt({props:{size:16,class:"text-gray-600"}});function he(){return i[16](i[25])}v=new vt({props:{size:16,class:"text-gray-600"}});const U=()=>i[17](g,H,Y),ve=()=>i[17](null,H,Y);function ee(){return i[18](i[25],i[26],i[27])}return{c(){t=A("div"),e=A("div"),n=A("div"),a=A("div"),r=A("button"),o.c(),x=q(),T=A("div"),D=A("div"),M=re(I),L=q(),C=A("div"),$=re("Duration: "),_=re(h),s=q(),l=A("div"),c=A("button"),oe(d.$$.fragment),f=q(),b=A("button"),oe(v.$$.fragment),m=q(),g=A("audio"),this.h()},l(z){t=S(z,"DIV",{class:!0});var O=F(t);e=S(O,"DIV",{class:!0});var N=F(e);n=S(N,"DIV",{class:!0});var V=F(n);a=S(V,"DIV",{class:!0});var Z=F(a);r=S(Z,"BUTTON",{class:!0});var ce=F(r);o.l(ce),ce.forEach(y),x=j(Z),T=S(Z,"DIV",{class:!0});var de=F(T);D=S(de,"DIV",{class:!0});var K=F(D);M=ae(K,I),K.forEach(y),L=j(de),C=S(de,"DIV",{class:!0});var w=F(C);$=ae(w,"Duration: "),_=ae(w,h),w.forEach(y),de.forEach(y),Z.forEach(y),s=j(V),l=S(V,"DIV",{class:!0});var P=F(l);c=S(P,"BUTTON",{class:!0,title:!0});var te=F(c);ie(d.$$.fragment,te),te.forEach(y),f=j(P),b=S(P,"BUTTON",{class:!0,title:!0});var Se=F(b);ie(v.$$.fragment,Se),Se.forEach(y),P.forEach(y),V.forEach(y),m=j(N),g=S(N,"AUDIO",{src:!0,class:!0}),F(g).forEach(y),N.forEach(y),O.forEach(y),this.h()},h(){E(r,"class","w-10 h-10 bg-gradient-to-r from-amber-500 to-orange-500 rounded-full flex items-center justify-center text-white hover:from-amber-600 hover:to-orange-600 transition-colors shadow-md"),E(D,"class","text-sm font-medium text-gray-900 truncate"),E(C,"class","text-xs text-gray-500"),E(T,"class","flex-1"),E(a,"class","flex items-center gap-3 flex-1"),E(c,"class","p-2 hover:bg-gray-100 rounded-lg transition-colors"),E(c,"title","Download"),E(b,"class","p-2 hover:bg-gray-100 rounded-lg transition-colors"),E(b,"title","Share"),E(l,"class","flex items-center gap-1"),E(n,"class","flex items-center justify-between"),Ke(g.src,k=i[25].result.url)||E(g,"src",k),E(g,"class","hidden"),E(e,"class","bg-white rounded-lg border border-gray-200 p-4 shadow-sm"),E(t,"class","bg-gradient-to-b from-gray-50 to-white p-4")},m(z,O){Q(z,t,O),p(t,e),p(e,n),p(n,a),p(a,r),G[u].m(r,null),p(a,x),p(a,T),p(T,D),p(D,M),p(T,L),p(T,C),p(C,$),p(C,_),p(n,s),p(n,l),p(l,c),le(d,c,null),p(l,f),p(l,b),le(v,b,null),p(e,m),p(e,g),U(),W=!0,R||(ge=[pe(r,"click",ue),pe(c,"click",he),pe(g,"ended",ee)],R=!0)},p(z,O){i=z;let N=u;u=J(i),u!==N&&(ye(),X(G[N],1,1,()=>{G[N]=null}),_e(),o=G[u],o||(o=G[u]=ne[u](i),o.c()),B(o,1),o.m(r,null)),(!W||O&4)&&I!==(I=(i[25].result.title||"Generated Audio")+"")&&ke(M,I),(!W||O&4)&&h!==(h=ct(i[25].result.duration||0)+"")&&ke(_,h),(!W||O&4&&!Ke(g.src,k=i[25].result.url))&&E(g,"src",k),(H!==i[26]||Y!==i[27])&&(ve(),H=i[26],Y=i[27],U())},i(z){W||(B(o),B(d.$$.fragment,z),B(v.$$.fragment,z),W=!0)},o(z){X(o),X(d.$$.fragment,z),X(v.$$.fragment,z),W=!1},d(z){z&&y(t),G[u].d(),se(d),se(v),ve(),R=!1,Ue(ge)}}}function Gt(i){let t,e;return t=new wt({props:{size:18,class:"ml-0.5"}}),{c(){oe(t.$$.fragment)},l(n){ie(t.$$.fragment,n)},m(n,a){le(t,n,a),e=!0},i(n){e||(B(t.$$.fragment,n),e=!0)},o(n){X(t.$$.fragment,n),e=!1},d(n){se(t,n)}}}function Ut(i){let t,e;return t=new Et({props:{size:18}}),{c(){oe(t.$$.fragment)},l(n){ie(t.$$.fragment,n)},m(n,a){le(t,n,a),e=!0},i(n){e||(B(t.$$.fragment,n),e=!0)},o(n){X(t.$$.fragment,n),e=!1},d(n){se(t,n)}}}function ot(i,t){let e,n,a,r,u,o=t[27]+1+"",x,T,D,I,M,L,C,$,h,_=fe.highlight(t[25].code,fe.languages.python,"python")+"",s,l,c,d,f;I=new Oe({props:{size:14,class:"text-gray-600"}});function b(){return t[14](t[25])}let v=t[25].result&&t[25].result.type==="audio"&&it(t);return{key:i,first:null,c(){e=A("div"),n=A("div"),a=A("div"),r=A("span"),u=re("Cell "),x=re(o),T=q(),D=A("button"),oe(I.$$.fragment),M=q(),L=A("div"),C=A("pre"),$=A("code"),h=new Be(!1),s=q(),v&&v.c(),l=q(),this.h()},l(m){e=S(m,"DIV",{class:!0});var g=F(e);n=S(g,"DIV",{class:!0});var k=F(n);a=S(k,"DIV",{class:!0});var H=F(a);r=S(H,"SPAN",{class:!0});var Y=F(r);u=ae(Y,"Cell "),x=ae(Y,o),Y.forEach(y),T=j(H),D=S(H,"BUTTON",{class:!0,title:!0});var W=F(D);ie(I.$$.fragment,W),W.forEach(y),H.forEach(y),M=j(k),L=S(k,"DIV",{class:!0});var R=F(L);C=S(R,"PRE",{class:!0});var ge=F(C);$=S(ge,"CODE",{class:!0});var ne=F($);h=ze(ne,!1),ne.forEach(y),ge.forEach(y),R.forEach(y),k.forEach(y),s=j(g),v&&v.l(g),l=j(g),g.forEach(y),this.h()},h(){E(r,"class","text-sm font-medium text-gray-700"),E(D,"class","p-1.5 hover:bg-gray-200 rounded transition-colors"),E(D,"title","Copy code"),E(a,"class","flex items-center justify-between px-4 py-2 bg-gray-50 border-b border-gray-100"),h.a=null,E($,"class","language-python text-sm"),E(C,"class","p-4 overflow-x-auto bg-gray-50"),E(L,"class","relative"),E(n,"class","border-b border-gray-200"),E(e,"class","bg-white rounded-lg border border-gray-200 overflow-hidden shadow-sm"),this.first=e},m(m,g){Q(m,e,g),p(e,n),p(n,a),p(a,r),p(r,u),p(r,x),p(a,T),p(a,D),le(I,D,null),p(n,M),p(n,L),p(L,C),p(C,$),h.m(_,$),p(e,s),v&&v.m(e,null),p(e,l),c=!0,d||(f=pe(D,"click",b),d=!0)},p(m,g){t=m,(!c||g&4)&&o!==(o=t[27]+1+"")&&ke(x,o),(!c||g&4)&&_!==(_=fe.highlight(t[25].code,fe.languages.python,"python")+"")&&h.p(_),t[25].result&&t[25].result.type==="audio"?v?(v.p(t,g),g&4&&B(v,1)):(v=it(t),v.c(),B(v,1),v.m(e,l)):v&&(ye(),X(v,1,1,()=>{v=null}),_e())},i(m){c||(B(I.$$.fragment,m),B(v),c=!0)},o(m){X(I.$$.fragment,m),X(v),c=!1},d(m){m&&y(e),se(I),v&&v.d(),d=!1,f()}}}function ut(i){let t,e;return{c(){t=A("div"),e=re(i[4]),this.h()},l(n){t=S(n,"DIV",{class:!0});var a=F(t);e=ae(a,i[4]),a.forEach(y),this.h()},h(){E(t,"class","fixed bottom-4 right-4 px-4 py-2 bg-gray-900 text-white rounded-lg shadow-lg z-50 animate-fade-in svelte-1vrx3m3")},m(n,a){Q(n,t,a),p(t,e)},p(n,a){a&16&&ke(e,n[4])},d(n){n&&y(t)}}}function zt(i){let t,e,n,a,r,u,o,x,T,D,I,M="Code Recorder",L,C,$,h,_,s,l,c,d,f,b,v,m,g,k,H,Y,W,R=[],ge=new Map,ne,G,J,ue,he;r=new Tt({props:{size:14}});let U=i[5]>0&&nt(i);function ve(w,P){return w[0]==="local"?Lt:Nt}let ee=ve(i),z=ee(i),O=(i[2].length>0||i[3]||i[1])&&at(i),N=i[3]&&rt(i),V=i[1]&&st(i),Z=!i[1]&&i[2].length===0&<(),ce=Je(i[2]);const de=w=>w[25].id;for(let w=0;w<ce.length;w+=1){let P=tt(i,ce,w),te=de(P);ge.set(te,R[w]=ot(te,P))}let K=i[4]&&ut(i);return{c(){t=q(),e=A("div"),n=A("div"),a=A("a"),oe(r.$$.fragment),u=re(`
|
| 10 |
+
UI
|
| 11 |
+
`),U&&U.c(),o=q(),x=A("div"),T=A("div"),D=A("div"),I=A("h2"),I.textContent=M,L=q(),C=A("p"),z.c(),$=q(),h=A("div"),_=A("div"),s=A("button"),l=re("API"),d=q(),f=A("button"),b=re("Local"),m=q(),O&&O.c(),g=q(),k=A("div"),N&&N.c(),H=q(),V&&V.c(),Y=q(),Z&&Z.c(),W=q();for(let w=0;w<R.length;w+=1)R[w].c();ne=q(),K&&K.c(),G=We(),this.h()},l(w){ft("svelte-1s75m5n",et.head).forEach(y),t=j(w),e=S(w,"DIV",{class:!0});var te=F(e);n=S(te,"DIV",{class:!0});var Se=F(n);a=S(Se,"A",{href:!0,class:!0});var Ae=F(a);ie(r.$$.fragment,Ae),u=ae(Ae,`
|
| 12 |
+
UI
|
| 13 |
+
`),U&&U.l(Ae),Ae.forEach(y),Se.forEach(y),o=j(te),x=S(te,"DIV",{class:!0});var $e=F(x);T=S($e,"DIV",{class:!0});var xe=F(T);D=S(xe,"DIV",{});var Ie=F(D);I=S(Ie,"H2",{class:!0,"data-svelte-h":!0}),we(I)!=="svelte-8fx49i"&&(I.textContent=M),L=j(Ie),C=S(Ie,"P",{class:!0});var Xe=F(C);z.l(Xe),Xe.forEach(y),Ie.forEach(y),$=j(xe),h=S(xe,"DIV",{class:!0});var Te=F(h);_=S(Te,"DIV",{class:!0});var Fe=F(_);s=S(Fe,"BUTTON",{class:!0});var Ye=F(s);l=ae(Ye,"API"),Ye.forEach(y),d=j(Fe),f=S(Fe,"BUTTON",{class:!0});var Ze=F(f);b=ae(Ze,"Local"),Ze.forEach(y),Fe.forEach(y),m=j(Te),O&&O.l(Te),Te.forEach(y),xe.forEach(y),g=j($e),k=S($e,"DIV",{class:!0});var be=F(k);N&&N.l(be),H=j(be),V&&V.l(be),Y=j(be),Z&&Z.l(be),W=j(be);for(let Re=0;Re<R.length;Re+=1)R[Re].l(be);be.forEach(y),$e.forEach(y),te.forEach(y),ne=j(w),K&&K.l(w),G=We(),this.h()},h(){et.title="Code Recorder - HFStudio",E(a,"href","/"),E(a,"class","px-3 py-1.5 text-sm font-medium rounded transition-colors text-gray-600 hover:bg-gray-50 flex items-center gap-1 bg-gray-100"),E(n,"class","flex items-center justify-end px-4 py-4 border-b border-gray-200 bg-white min-h-[73px]"),E(I,"class","text-2xl font-semibold text-gray-900"),E(C,"class","text-sm text-gray-600 mt-1"),E(s,"class",c="px-3 py-1 text-sm font-medium rounded transition-colors "+(i[0]==="api"?"bg-white shadow-sm":"text-gray-600")),E(f,"class",v="px-3 py-1 text-sm font-medium rounded transition-colors "+(i[0]==="local"?"bg-white shadow-sm":"text-gray-600")),E(_,"class","flex items-center bg-gray-100 rounded-md p-0.5"),E(h,"class","flex items-center justify-between mt-4"),E(T,"class","mb-6"),E(k,"class","space-y-6"),E(x,"class","max-w-4xl mx-auto p-8"),E(e,"class","flex-1 bg-gray-50 overflow-y-auto")},m(w,P){Q(w,t,P),Q(w,e,P),p(e,n),p(n,a),le(r,a,null),p(a,u),U&&U.m(a,null),p(e,o),p(e,x),p(x,T),p(T,D),p(D,I),p(D,L),p(D,C),z.m(C,null),p(T,$),p(T,h),p(h,_),p(_,s),p(s,l),p(_,d),p(_,f),p(f,b),p(h,m),O&&O.m(h,null),p(x,g),p(x,k),N&&N.m(k,null),p(k,H),V&&V.m(k,null),p(k,Y),Z&&Z.m(k,null),p(k,W);for(let te=0;te<R.length;te+=1)R[te]&&R[te].m(k,null);Q(w,ne,P),K&&K.m(w,P),Q(w,G,P),J=!0,ue||(he=[pe(s,"click",i[10]),pe(f,"click",i[11])],ue=!0)},p(w,[P]){w[5]>0?U?U.p(w,P):(U=nt(w),U.c(),U.m(a,null)):U&&(U.d(1),U=null),ee!==(ee=ve(w))&&(z.d(1),z=ee(w),z&&(z.c(),z.m(C,null))),(!J||P&1&&c!==(c="px-3 py-1 text-sm font-medium rounded transition-colors "+(w[0]==="api"?"bg-white shadow-sm":"text-gray-600")))&&E(s,"class",c),(!J||P&1&&v!==(v="px-3 py-1 text-sm font-medium rounded transition-colors "+(w[0]==="local"?"bg-white shadow-sm":"text-gray-600")))&&E(f,"class",v),w[2].length>0||w[3]||w[1]?O?(O.p(w,P),P&14&&B(O,1)):(O=at(w),O.c(),B(O,1),O.m(h,null)):O&&(ye(),X(O,1,1,()=>{O=null}),_e()),w[3]?N?(N.p(w,P),P&8&&B(N,1)):(N=rt(w),N.c(),B(N,1),N.m(k,H)):N&&(ye(),X(N,1,1,()=>{N=null}),_e()),w[1]?V?(V.p(w,P),P&2&&B(V,1)):(V=st(w),V.c(),B(V,1),V.m(k,Y)):V&&(ye(),X(V,1,1,()=>{V=null}),_e()),!w[1]&&w[2].length===0?Z||(Z=lt(),Z.c(),Z.m(k,W)):Z&&(Z.d(1),Z=null),P&644&&(ce=Je(w[2]),ye(),R=_t(R,P,de,1,w,ce,ge,k,yt,ot,null,tt),_e()),w[4]?K?K.p(w,P):(K=ut(w),K.c(),K.m(G.parentNode,G)):K&&(K.d(1),K=null)},i(w){if(!J){B(r.$$.fragment,w),B(O),B(N),B(V);for(let P=0;P<ce.length;P+=1)B(R[P]);J=!0}},o(w){X(r.$$.fragment,w),X(O),X(N),X(V);for(let P=0;P<R.length;P+=1)X(R[P]);J=!1},d(w){w&&(y(t),y(e),y(ne),y(G)),se(r),U&&U.d(),z.d(),O&&O.d(),N&&N.d(),V&&V.d(),Z&&Z.d();for(let P=0;P<R.length;P+=1)R[P].d();K&&K.d(w),ue=!1,Ue(he)}}}let Ne="Chatterbox";function Bt(i,t){const e=document.createElement("a");e.href=i,e.download=`${t||"audio"}.wav`,document.body.appendChild(e),e.click(),document.body.removeChild(e)}function ct(i){if(!i)return"0:00";const t=Math.floor(i/60),e=Math.floor(i%60);return`${t}:${e.toString().padStart(2,"0")}`}function Vt(i,t,e){let n="api",a=[],r=I(),u=null,o=null,x=0;async function T(){try{const g=await fetch("/api/history/load",{method:"GET",credentials:"include"});if(g.ok){const k=await g.json(),H=k.entries.filter(R=>R.entry_type==="setup"),Y=k.entries.filter(R=>R.entry_type==="import"),W=k.entries.filter(R=>R.entry_type==="generation");e(3,r=I()),e(1,u=Y.length>0?Y[Y.length-1].code:null),e(2,a=W.map(R=>({id:R.id,code:R.code,result:R.result_data}))),e(5,x=W.length)}}catch(g){console.error("Error loading history from database:",g),e(2,a=[]),e(3,r=I()),e(1,u=null)}}async function D(){try{await fetch("/api/history/clear",{method:"DELETE",credentials:"include"}),e(2,a=[]),e(3,r=I()),e(1,u=null)}catch(g){console.error("Error clearing history:",g),e(2,a=[]),e(3,r=I()),e(1,u=null)}}function I(){return n==="local"?`pip install huggingface-hub hfstudio uv
|
| 14 |
+
hfstudio start ${Ne.toLowerCase()} --port 7861`:"pip install huggingface-hub"}function M(){return n==="local"?'client = InferenceClient(base_url="http://localhost:7861/api/v1")':`client = InferenceClient(
|
| 15 |
+
api_key="YOUR_HF_TOKEN", # Get your token from https://huggingface.co/settings/tokens
|
| 16 |
+
model="${Ne.toLowerCase()==="chatterbox"?"ResembleAI/chatterbox":Ne.toLowerCase()}",
|
| 17 |
+
)`}function L(){const g=M();return n==="local"?`from huggingface_hub import InferenceClient
|
| 18 |
+
|
| 19 |
+
${g}`:`from huggingface_hub import InferenceClient
|
| 20 |
+
|
| 21 |
+
${g}`}function C(g,k="Copied to clipboard!"){navigator.clipboard.writeText(g).then(()=>{e(4,o=k),setTimeout(()=>{e(4,o=null)},2e3)})}function $(){const g=[];if(r){const Y=r.includes("pip install")||r.includes("hfstudio start")?"bash":"";g.push(`## Setup (Run in Terminal)
|
| 22 |
+
|
| 23 |
+
\`\`\`${Y}
|
| 24 |
+
${r}
|
| 25 |
+
\`\`\``)}u&&g.push(`## Imports (Python)
|
| 26 |
+
|
| 27 |
+
\`\`\`python
|
| 28 |
+
${u}
|
| 29 |
+
\`\`\``),a.forEach((H,Y)=>{g.push(`## Cell ${Y+1}
|
| 30 |
+
|
| 31 |
+
\`\`\`python
|
| 32 |
+
${H.code}
|
| 33 |
+
\`\`\``)});const k=g.join(`
|
| 34 |
+
|
| 35 |
+
`);C(k,"All code copied as Markdown!")}function h(g){g.audioElement||(g.audioElement=new Audio(g.result.url),g.audioElement.addEventListener("ended",()=>{g.isPlaying=!1,e(2,a=[...a])})),g.isPlaying?(g.audioElement.pause(),g.isPlaying=!1):(a.forEach(k=>{k!==g&&k.isPlaying&&k.audioElement&&(k.audioElement.pause(),k.isPlaying=!1)}),g.audioElement.play(),g.isPlaying=!0),e(2,a=[...a])}gt(async()=>{await T()});const _=()=>e(0,n="api"),s=()=>e(0,n="local"),l=()=>C(r),c=()=>C(u),d=g=>C(g.code),f=g=>h(g),b=g=>Bt(g.result.url,g.result.title);function v(g,k,H){ht[g?"unshift":"push"](()=>{k[H].audioElement=g,e(2,a)})}const m=(g,k,H)=>e(2,k[H].isPlaying=!1,a);return i.$$.update=()=>{i.$$.dirty&3&&n&&(e(3,r=I()),u&&e(1,u=L()))},[n,u,a,r,o,x,D,C,$,h,_,s,l,c,d,f,b,v,m]}class Wt extends Ce{constructor(t){super(),De(this,t,Vt,zt,Pe,{})}}export{Wt as component};
|
hfstudio/static/_app/immutable/nodes/4.Do7OE_Wr.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{S as Ye,i as Ze,s as et,m as Te,o as oe,p as H,q as L,r as ae,u as ie,v as ce,w as Be,x as lt,y as st,z as nt,A as ot,d as u,B as Ae,C as we,D as f,E as Ue,b as J,c as i,F as _e,G as at,h as A,e as d,f as b,g as te,H as me,I as He,k as z,j as h,t as re,J as it,a as Ee,K as U,n as tt,L as ct,M as ke}from"../chunks/BjzGjDWb.js";import{I as ut,g as ft,a as dt,e as Oe}from"../chunks/DrRA3Ukb.js";import"../chunks/IHki7fMi.js";import{C as ht,A as mt,X as _t}from"../chunks/BCO3d5zc.js";import{M as rt}from"../chunks/B_t0LZOt.js";import{P as gt,a as pt}from"../chunks/CDuamvIE.js";function bt(s){let e;const t=s[2].default,r=lt(t,s,s[3],null);return{c(){r&&r.c()},l(l){r&&r.l(l)},m(l,a){r&&r.m(l,a),e=!0},p(l,a){r&&r.p&&(!e||a&8)&&st(r,t,l,l[3],e?ot(t,l[3],a,null):nt(l[3]),null)},i(l){e||(L(r,l),e=!0)},o(l){H(r,l),e=!1},d(l){r&&r.d(l)}}}function vt(s){let e,t;const r=[{name:"square"},s[1],{iconNode:s[0]}];let l={$$slots:{default:[bt]},$$scope:{ctx:s}};for(let a=0;a<r.length;a+=1)l=Te(l,r[a]);return e=new ut({props:l}),{c(){ce(e.$$.fragment)},l(a){ie(e.$$.fragment,a)},m(a,o){ae(e,a,o),t=!0},p(a,[o]){const c=o&3?ft(r,[r[0],o&2&&dt(a[1]),o&1&&{iconNode:a[0]}]):{};o&8&&(c.$$scope={dirty:o,ctx:a}),e.$set(c)},i(a){t||(L(e.$$.fragment,a),t=!0)},o(a){H(e.$$.fragment,a),t=!1},d(a){oe(e,a)}}}function yt(s,e,t){let{$$slots:r={},$$scope:l}=e;const a=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}]];return s.$$set=o=>{t(1,e=Te(Te({},e),Be(o))),"$$scope"in o&&t(3,l=o.$$scope)},e=Be(e),[a,e,r,l]}class wt extends Ye{constructor(e){super(),Ze(this,e,yt,vt,et,{})}}function Fe(s,e,t){const r=s.slice();return r[30]=e[t],r[32]=t,r}function Ge(s){let e,t;return{c(){e=h("span"),t=re(s[7]),this.h()},l(r){e=d(r,"SPAN",{class:!0});var l=b(e);t=te(l,s[7]),l.forEach(u),this.h()},h(){f(e,"class","ml-1 px-1.5 py-0.5 bg-gray-500 text-white text-xs rounded-full min-w-[18px] text-center")},m(r,l){J(r,e,l),i(e,t)},p(r,l){l[0]&128&&Ee(t,r[7])},d(r){r&&u(e)}}}function Je(s){let e,t,r,l,a,o;return{c(){e=h("div"),t=h("div"),r=z(),l=h("div"),a=z(),o=h("div"),this.h()},l(c){e=d(c,"DIV",{class:!0});var n=b(e);t=d(n,"DIV",{class:!0,style:!0}),b(t).forEach(u),r=A(n),l=d(n,"DIV",{class:!0,style:!0}),b(l).forEach(u),a=A(n),o=d(n,"DIV",{class:!0,style:!0}),b(o).forEach(u),n.forEach(u),this.h()},h(){f(t,"class","absolute rounded-full border-2 border-orange-300 transition-all duration-75"),U(t,"width",120+s[9]*120+"px"),U(t,"height",120+s[9]*120+"px"),U(t,"opacity",.4+s[9]*.6),f(l,"class","absolute rounded-full border-2 border-orange-200 transition-all duration-100"),U(l,"width",150+s[9]*150+"px"),U(l,"height",150+s[9]*150+"px"),U(l,"opacity",.3+s[9]*.5),f(o,"class","absolute rounded-full border-1 border-orange-100 transition-all duration-125"),U(o,"width",180+s[9]*180+"px"),U(o,"height",180+s[9]*180+"px"),U(o,"opacity",.2+s[9]*.4),f(e,"class","absolute inset-0 flex items-center justify-center")},m(c,n){J(c,e,n),i(e,t),i(e,r),i(e,l),i(e,a),i(e,o)},p(c,n){n[0]&512&&U(t,"width",120+c[9]*120+"px"),n[0]&512&&U(t,"height",120+c[9]*120+"px"),n[0]&512&&U(t,"opacity",.4+c[9]*.6),n[0]&512&&U(l,"width",150+c[9]*150+"px"),n[0]&512&&U(l,"height",150+c[9]*150+"px"),n[0]&512&&U(l,"opacity",.3+c[9]*.5),n[0]&512&&U(o,"width",180+c[9]*180+"px"),n[0]&512&&U(o,"height",180+c[9]*180+"px"),n[0]&512&&U(o,"opacity",.2+c[9]*.4)},d(c){c&&u(e)}}}function kt(s){let e,t;return e=new rt({props:{size:36,class:"text-white"}}),{c(){ce(e.$$.fragment)},l(r){ie(e.$$.fragment,r)},m(r,l){ae(e,r,l),t=!0},p:tt,i(r){t||(L(e.$$.fragment,r),t=!0)},o(r){H(e.$$.fragment,r),t=!1},d(r){oe(e,r)}}}function Et(s){let e,t,r,l;return r=new wt({props:{size:36,class:(s[8]>=100?"text-white":"text-orange-700")+" relative z-10"}}),{c(){e=h("div"),t=z(),ce(r.$$.fragment),this.h()},l(a){e=d(a,"DIV",{class:!0,style:!0}),b(e).forEach(u),t=A(a),ie(r.$$.fragment,a),this.h()},h(){f(e,"class","absolute bottom-0 left-0 right-0 bg-orange-500 transition-all duration-100 ease-linear rounded-full"),U(e,"height",s[8]+"%")},m(a,o){J(a,e,o),J(a,t,o),ae(r,a,o),l=!0},p(a,o){(!l||o[0]&256)&&U(e,"height",a[8]+"%");const c={};o[0]&256&&(c.class=(a[8]>=100?"text-white":"text-orange-700")+" relative z-10"),r.$set(c)},i(a){l||(L(r.$$.fragment,a),l=!0)},o(a){H(r.$$.fragment,a),l=!1},d(a){a&&(u(e),u(t)),oe(r,a)}}}function xt(s){let e,t,r=Oe(s[1]),l=[];for(let o=0;o<r.length;o+=1)l[o]=Ke(Fe(s,r,o));const a=o=>H(l[o],1,1,()=>{l[o]=null});return{c(){e=h("div");for(let o=0;o<l.length;o+=1)l[o].c();this.h()},l(o){e=d(o,"DIV",{class:!0});var c=b(e);for(let n=0;n<l.length;n+=1)l[n].l(c);c.forEach(u),this.h()},h(){f(e,"class","space-y-2")},m(o,c){J(o,e,c);for(let n=0;n<l.length;n+=1)l[n]&&l[n].m(e,null);t=!0},p(o,c){if(c[0]&52230){r=Oe(o[1]);let n;for(n=0;n<r.length;n+=1){const g=Fe(o,r,n);l[n]?(l[n].p(g,c),L(l[n],1)):(l[n]=Ke(g),l[n].c(),L(l[n],1),l[n].m(e,null))}for(ke(),n=r.length;n<l.length;n+=1)a(n);we()}},i(o){if(!t){for(let c=0;c<r.length;c+=1)L(l[c]);t=!0}},o(o){l=l.filter(Boolean);for(let c=0;c<l.length;c+=1)H(l[c]);t=!1},d(o){o&&u(e),ct(l,o)}}}function Ct(s){let e,t,r,l,a="No recordings yet",o,c,n="Start recording to see them here",g;return t=new rt({props:{size:32,class:"mx-auto mb-2 opacity-30"}}),{c(){e=h("div"),ce(t.$$.fragment),r=z(),l=h("p"),l.textContent=a,o=z(),c=h("p"),c.textContent=n,this.h()},l(_){e=d(_,"DIV",{class:!0});var k=b(e);ie(t.$$.fragment,k),r=A(k),l=d(k,"P",{class:!0,"data-svelte-h":!0}),me(l)!=="svelte-1dt1izg"&&(l.textContent=a),o=A(k),c=d(k,"P",{class:!0,"data-svelte-h":!0}),me(c)!=="svelte-klvvgt"&&(c.textContent=n),k.forEach(u),this.h()},h(){f(l,"class","text-sm"),f(c,"class","text-xs text-gray-400"),f(e,"class","text-center py-8 text-gray-500")},m(_,k){J(_,e,k),ae(t,e,null),i(e,r),i(e,l),i(e,o),i(e,c),g=!0},p:tt,i(_){g||(L(t.$$.fragment,_),g=!0)},o(_){H(t.$$.fragment,_),g=!1},d(_){_&&u(e),oe(t)}}}function It(s){let e,t;return e=new pt({props:{size:14,class:"text-gray-600"}}),{c(){ce(e.$$.fragment)},l(r){ie(e.$$.fragment,r)},m(r,l){ae(e,r,l),t=!0},i(r){t||(L(e.$$.fragment,r),t=!0)},o(r){H(e.$$.fragment,r),t=!1},d(r){oe(e,r)}}}function Dt(s){let e,t;return e=new gt({props:{size:14,class:"text-gray-600"}}),{c(){ce(e.$$.fragment)},l(r){ie(e.$$.fragment,r)},m(r,l){ae(e,r,l),t=!0},i(r){t||(L(e.$$.fragment,r),t=!0)},o(r){H(e.$$.fragment,r),t=!1},d(r){oe(e,r)}}}function Ke(s){var F;let e,t,r,l,a=s[32]+1+"",o,c,n,g,_,k,N,j=s[30].timestamp.toLocaleTimeString()+"",C,E,y,D=((F=s[2])==null?void 0:F.id)===s[30].id?"Selected":"Select for cloning",$,T,w,V,O,Y,K;const Z=[Dt,It],v=[];function x(I,R){var p;return((p=I[10])==null?void 0:p.id)===I[30].id&&I[11]&&!I[11].paused?0:1}g=x(s),_=v[g]=Z[g](s);function ee(){return s[17](s[30])}function M(){return s[18](s[30])}return{c(){e=h("div"),t=h("div"),r=h("span"),l=re("Recording "),o=re(a),c=z(),n=h("button"),_.c(),k=z(),N=h("div"),C=re(j),E=z(),y=h("button"),$=re(D),w=z(),this.h()},l(I){e=d(I,"DIV",{class:!0});var R=b(e);t=d(R,"DIV",{class:!0});var p=b(t);r=d(p,"SPAN",{class:!0});var S=b(r);l=te(S,"Recording "),o=te(S,a),S.forEach(u),c=A(p),n=d(p,"BUTTON",{class:!0});var G=b(n);_.l(G),G.forEach(u),p.forEach(u),k=A(R),N=d(R,"DIV",{class:!0});var P=b(N);C=te(P,j),P.forEach(u),E=A(R),y=d(R,"BUTTON",{class:!0});var le=b(y);$=te(le,D),le.forEach(u),w=A(R),R.forEach(u),this.h()},h(){var I,R;f(r,"class","text-sm font-medium text-gray-900"),f(n,"class","p-1 hover:bg-gray-100 rounded transition-colors"),f(t,"class","flex items-center justify-between mb-2"),f(N,"class","text-xs text-gray-500 mb-2"),f(y,"class",T="w-full text-xs px-2 py-1 rounded "+(((I=s[2])==null?void 0:I.id)===s[30].id?"bg-amber-200 text-amber-800":"bg-gray-100 text-gray-700 hover:bg-gray-200")+" transition-colors"),f(e,"class",V="border rounded-lg p-3 "+(((R=s[2])==null?void 0:R.id)===s[30].id?"border-amber-300 bg-amber-50":"border-gray-200 hover:border-gray-300")+" transition-colors")},m(I,R){J(I,e,R),i(e,t),i(t,r),i(r,l),i(r,o),i(t,c),i(t,n),v[g].m(n,null),i(e,k),i(e,N),i(N,C),i(e,E),i(e,y),i(y,$),i(e,w),O=!0,Y||(K=[_e(n,"click",ee),_e(y,"click",M)],Y=!0)},p(I,R){var S,G,P;s=I;let p=g;g=x(s),g!==p&&(ke(),H(v[p],1,1,()=>{v[p]=null}),we(),_=v[g],_||(_=v[g]=Z[g](s),_.c()),L(_,1),_.m(n,null)),(!O||R[0]&2)&&j!==(j=s[30].timestamp.toLocaleTimeString()+"")&&Ee(C,j),(!O||R[0]&6)&&D!==(D=((S=s[2])==null?void 0:S.id)===s[30].id?"Selected":"Select for cloning")&&Ee($,D),(!O||R[0]&6&&T!==(T="w-full text-xs px-2 py-1 rounded "+(((G=s[2])==null?void 0:G.id)===s[30].id?"bg-amber-200 text-amber-800":"bg-gray-100 text-gray-700 hover:bg-gray-200")+" transition-colors"))&&f(y,"class",T),(!O||R[0]&6&&V!==(V="border rounded-lg p-3 "+(((P=s[2])==null?void 0:P.id)===s[30].id?"border-amber-300 bg-amber-50":"border-gray-200 hover:border-gray-300")+" transition-colors"))&&f(e,"class",V)},i(I){O||(L(_),O=!0)},o(I){H(_),O=!1},d(I){I&&u(e),v[g].d(),Y=!1,Ae(K)}}}function We(s){let e,t,r,l,a,o,c,n;function g(E,y){return y[0]&4&&(r=null),r==null&&(r=!!Rt(E[2])),r?$t:Vt}let _=g(s,[-1,-1]),k=_(s);function N(E,y){return y[0]&4&&(c=null),c==null&&(c=!!St(E[2])),c?At:Tt}let j=N(s,[-1,-1]),C=j(s);return{c(){e=h("div"),t=h("span"),k.c(),l=re(`
|
| 2 |
+
at least 15 seconds`),a=z(),o=h("span"),C.c(),n=re(`
|
| 3 |
+
includes consent`),this.h()},l(E){e=d(E,"DIV",{class:!0});var y=b(e);t=d(y,"SPAN",{class:!0});var D=b(t);k.l(D),l=te(D,`
|
| 4 |
+
at least 15 seconds`),D.forEach(u),a=A(y),o=d(y,"SPAN",{class:!0});var $=b(o);C.l($),n=te($,`
|
| 5 |
+
includes consent`),$.forEach(u),y.forEach(u),this.h()},h(){f(t,"class","flex items-center gap-1"),f(o,"class","flex items-center gap-1"),f(e,"class","mt-3 text-sm text-green-600 flex items-center gap-4")},m(E,y){J(E,e,y),i(e,t),k.m(t,null),i(t,l),i(e,a),i(e,o),C.m(o,null),i(o,n)},p(E,y){_!==(_=g(E,y))&&(k.d(1),k=_(E),k&&(k.c(),k.m(t,l))),j!==(j=N(E,y))&&(C.d(1),C=j(E),C&&(C.c(),C.m(o,n)))},d(E){E&&u(e),k.d(),C.d()}}}function Vt(s){let e;return{c(){e=re("β")},l(t){e=te(t,"β")},m(t,r){J(t,e,r)},d(t){t&&u(e)}}}function $t(s){let e;return{c(){e=re("β")},l(t){e=te(t,"β")},m(t,r){J(t,e,r)},d(t){t&&u(e)}}}function Tt(s){let e;return{c(){e=re("β")},l(t){e=te(t,"β")},m(t,r){J(t,e,r)},d(t){t&&u(e)}}}function At(s){let e;return{c(){e=re("β")},l(t){e=te(t,"β")},m(t,r){J(t,e,r)},d(t){t&&u(e)}}}function Xe(s){let e,t,r,l,a,o,c,n,g,_,k,N,j="An error occurred while processing your request",C,E,y,D,$,T,w,V,O="Close",Y,K,Z;o=new mt({props:{size:20,class:"text-red-600"}}),y=new _t({props:{size:20,class:"text-gray-500"}});let v=s[6]&&Qe(s);return{c(){e=h("div"),t=h("div"),r=h("div"),l=h("div"),a=h("div"),ce(o.$$.fragment),c=z(),n=h("div"),g=h("h3"),_=re(s[5]),k=z(),N=h("p"),N.textContent=j,C=z(),E=h("button"),ce(y.$$.fragment),D=z(),$=h("div"),v&&v.c(),T=z(),w=h("div"),V=h("button"),V.textContent=O,this.h()},l(x){e=d(x,"DIV",{class:!0});var ee=b(e);t=d(ee,"DIV",{class:!0});var M=b(t);r=d(M,"DIV",{class:!0});var F=b(r);l=d(F,"DIV",{class:!0});var I=b(l);a=d(I,"DIV",{class:!0});var R=b(a);ie(o.$$.fragment,R),R.forEach(u),c=A(I),n=d(I,"DIV",{class:!0});var p=b(n);g=d(p,"H3",{class:!0});var S=b(g);_=te(S,s[5]),S.forEach(u),k=A(p),N=d(p,"P",{class:!0,"data-svelte-h":!0}),me(N)!=="svelte-1l3zl3"&&(N.textContent=j),p.forEach(u),I.forEach(u),C=A(F),E=d(F,"BUTTON",{class:!0,title:!0});var G=b(E);ie(y.$$.fragment,G),G.forEach(u),F.forEach(u),D=A(M),$=d(M,"DIV",{class:!0});var P=b($);v&&v.l(P),P.forEach(u),T=A(M),w=d(M,"DIV",{class:!0});var le=b(w);V=d(le,"BUTTON",{class:!0,"data-svelte-h":!0}),me(V)!=="svelte-4sxk6g"&&(V.textContent=O),le.forEach(u),M.forEach(u),ee.forEach(u),this.h()},h(){f(a,"class","w-10 h-10 bg-red-100 rounded-full flex items-center justify-center flex-shrink-0"),f(g,"class","text-lg font-semibold text-gray-900 truncate"),f(N,"class","text-sm text-gray-600"),f(n,"class","min-w-0"),f(l,"class","flex items-center gap-3 min-w-0"),f(E,"class","p-2 hover:bg-red-100 rounded-full transition-colors flex-shrink-0"),f(E,"title","Close"),f(r,"class","flex items-center justify-between p-6 border-b border-gray-200 bg-red-50 flex-shrink-0"),f($,"class","p-6 overflow-y-auto flex-1 min-h-0"),f(V,"class","px-6 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors"),f(w,"class","flex items-center justify-end gap-3 p-6 border-t border-gray-200 bg-gray-50 flex-shrink-0"),f(t,"class","bg-white rounded-xl shadow-2xl max-w-2xl w-full max-h-[80vh] flex flex-col"),f(e,"class","fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4")},m(x,ee){J(x,e,ee),i(e,t),i(t,r),i(r,l),i(l,a),ae(o,a,null),i(l,c),i(l,n),i(n,g),i(g,_),i(n,k),i(n,N),i(r,C),i(r,E),ae(y,E,null),i(t,D),i(t,$),v&&v.m($,null),i(t,T),i(t,w),i(w,V),Y=!0,K||(Z=[_e(E,"click",s[12]),_e(V,"click",s[12])],K=!0)},p(x,ee){(!Y||ee[0]&32)&&Ee(_,x[5]),x[6]?v?v.p(x,ee):(v=Qe(x),v.c(),v.m($,null)):v&&(v.d(1),v=null)},i(x){Y||(L(o.$$.fragment,x),L(y.$$.fragment,x),Y=!0)},o(x){H(o.$$.fragment,x),H(y.$$.fragment,x),Y=!1},d(x){x&&u(e),oe(o),oe(y),v&&v.d(),K=!1,Ae(Z)}}}function Qe(s){let e,t,r="Error Details:",l,a,o;return{c(){e=h("div"),t=h("h4"),t.textContent=r,l=z(),a=h("pre"),o=re(s[6]),this.h()},l(c){e=d(c,"DIV",{class:!0});var n=b(e);t=d(n,"H4",{class:!0,"data-svelte-h":!0}),me(t)!=="svelte-3lmggt"&&(t.textContent=r),l=A(n),a=d(n,"PRE",{class:!0});var g=b(a);o=te(g,s[6]),g.forEach(u),n.forEach(u),this.h()},h(){f(t,"class","text-sm font-medium text-gray-900 mb-2"),f(a,"class","text-xs text-gray-700 whitespace-pre-wrap font-mono leading-relaxed break-words"),f(e,"class","bg-gray-50 rounded-lg p-4 border")},m(c,n){J(c,e,n),i(e,t),i(e,l),i(e,a),i(a,o)},p(c,n){n[0]&64&&Ee(o,c[6])},d(c){c&&u(e)}}}function zt(s){let e,t,r,l,a,o,c,n,g,_,k,N="<p><em>Record your voice for at least 15 seconds to create a voice clone. To prevent unauthorized voice cloning, you must start by clearly saying "I consent to cloning my voice" β the rest of the text is arbitrary.</em></p>",j,C,E='<div class="text-gray-900 leading-relaxed font-serif text-lg relative p-4"><div class="absolute top-0 left-0 w-8 h-8 border-l-2 border-t-2 border-amber-400 rounded-tl-lg"></div> <div class="absolute bottom-0 right-0 w-8 h-8 border-r-2 border-b-2 border-amber-400 rounded-br-lg"></div> <p class="mb-4"><span class="bg-yellow-50">I consent to cloning my voice.</span> There's a quiet kind of magic in the early hours of the morning, when the world is still half-asleep and the air feels crisp with possibility. The hum of the refrigerator becomes a rhythm, the ticking of the clock a heartbeat, and for a brief moment, everything feels perfectly in sync.</p></div>',y,D,$,T,w,V,O,Y,K,Z,v,x,ee,M,F,I,R="Give name to recording",p,S,G,P,le,se,ne,ge,ue,pe,$e,ze;a=new ht({props:{size:14}});let W=s[7]>0&&Ge(s),X=s[0]&&Je(s);const Re=[Et,kt],fe=[];function Se(m,q){return m[0]?0:1}w=Se(s),V=fe[w]=Re[w](s);const Ne=[Ct,xt],de=[];function Pe(m,q){return m[1].length===0?0:1}v=Pe(s),x=de[v]=Ne[v](s);let Q=s[2]&&We(s),B=s[4]&&Xe(s);return{c(){e=z(),t=h("div"),r=h("div"),l=h("a"),ce(a.$$.fragment),o=re(`
|
| 6 |
+
Code Recorder
|
| 7 |
+
`),W&&W.c(),c=z(),n=h("div"),g=h("div"),_=h("div"),k=h("div"),k.innerHTML=N,j=z(),C=h("div"),C.innerHTML=E,y=z(),D=h("div"),X&&X.c(),$=z(),T=h("button"),V.c(),Y=z(),K=h("div"),Z=h("div"),x.c(),ee=z(),M=h("div"),F=h("div"),I=h("label"),I.textContent=R,p=z(),S=h("input"),G=z(),P=h("button"),le=re("Clone"),ne=z(),Q&&Q.c(),ge=z(),B&&B.c(),ue=He(),this.h()},l(m){at("svelte-ymar42",document.head).forEach(u),e=A(m),t=d(m,"DIV",{class:!0});var he=b(t);r=d(he,"DIV",{class:!0});var be=b(r);l=d(be,"A",{href:!0,class:!0});var xe=b(l);ie(a.$$.fragment,xe),o=te(xe,`
|
| 8 |
+
Code Recorder
|
| 9 |
+
`),W&&W.l(xe),xe.forEach(u),be.forEach(u),c=A(he),n=d(he,"DIV",{class:!0});var Ce=b(n);g=d(Ce,"DIV",{class:!0});var Me=b(g);_=d(Me,"DIV",{class:!0});var ve=b(_);k=d(ve,"DIV",{class:!0,"data-svelte-h":!0}),me(k)!=="svelte-gyxetr"&&(k.innerHTML=N),j=A(ve),C=d(ve,"DIV",{class:!0,"data-svelte-h":!0}),me(C)!=="svelte-gyyopp"&&(C.innerHTML=E),y=A(ve),D=d(ve,"DIV",{class:!0});var Ie=b(D);X&&X.l(Ie),$=A(Ie),T=d(Ie,"BUTTON",{class:!0});var Le=b(T);V.l(Le),Le.forEach(u),Ie.forEach(u),ve.forEach(u),Me.forEach(u),Y=A(Ce),K=d(Ce,"DIV",{class:!0});var De=b(K);Z=d(De,"DIV",{class:!0});var je=b(Z);x.l(je),je.forEach(u),ee=A(De),M=d(De,"DIV",{class:!0});var ye=b(M);F=d(ye,"DIV",{class:!0});var Ve=b(F);I=d(Ve,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),me(I)!=="svelte-1vgc2vi"&&(I.textContent=R),p=A(Ve),S=d(Ve,"INPUT",{id:!0,type:!0,placeholder:!0,class:!0}),Ve.forEach(u),G=A(ye),P=d(ye,"BUTTON",{class:!0});var qe=b(P);le=te(qe,"Clone"),qe.forEach(u),ne=A(ye),Q&&Q.l(ye),ye.forEach(u),De.forEach(u),Ce.forEach(u),he.forEach(u),ge=A(m),B&&B.l(m),ue=He(),this.h()},h(){document.title="Voice Cloning - HFStudio",f(l,"href","/code-recorder"),f(l,"class","px-3 py-1.5 text-sm font-medium rounded transition-colors text-gray-600 hover:bg-gray-50 flex items-center gap-1 bg-gray-100"),f(r,"class","flex items-center justify-end px-4 py-4 border-b border-gray-200 min-h-[73px]"),f(k,"class","mb-6"),f(C,"class","flex-1 p-8 mb-6"),f(T,"class",O="w-24 h-24 rounded-full flex items-center justify-center transition-all duration-200 shadow-lg relative overflow-hidden z-20 "+(s[0]?"border-4 border-orange-500 bg-transparent":"bg-orange-500 hover:bg-orange-600")),f(D,"class","flex justify-center items-center flex-1 relative"),f(_,"class","flex-1 pb-24 relative flex flex-col"),f(g,"class","flex-1 flex flex-col p-6"),f(Z,"class","mb-4"),f(I,"for","clone-name"),f(I,"class","block text-sm font-medium text-gray-700 mb-1"),f(S,"id","clone-name"),f(S,"type","text"),f(S,"placeholder","e.g., My Voice"),f(S,"class","w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-amber-400 focus:border-transparent"),f(F,"class","mb-3"),P.disabled=se=!s[2]||!s[3].trim(),f(P,"class","w-full px-4 py-2 bg-gradient-to-r from-amber-400 to-orange-500 text-white rounded-lg font-medium hover:from-amber-500 hover:to-orange-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors"),f(M,"class","mt-6 pt-4 border-t border-gray-200"),f(K,"class","w-80 border-l border-gray-200 bg-white p-3 overflow-y-auto"),f(n,"class","flex-1 flex"),f(t,"class","flex flex-col h-full")},m(m,q){J(m,e,q),J(m,t,q),i(t,r),i(r,l),ae(a,l,null),i(l,o),W&&W.m(l,null),i(t,c),i(t,n),i(n,g),i(g,_),i(_,k),i(_,j),i(_,C),i(_,y),i(_,D),X&&X.m(D,null),i(D,$),i(D,T),fe[w].m(T,null),i(n,Y),i(n,K),i(K,Z),de[v].m(Z,null),i(K,ee),i(K,M),i(M,F),i(F,I),i(F,p),i(F,S),Ue(S,s[3]),i(M,G),i(M,P),i(P,le),i(M,ne),Q&&Q.m(M,null),J(m,ge,q),B&&B.m(m,q),J(m,ue,q),pe=!0,$e||(ze=[_e(T,"click",s[13]),_e(S,"input",s[19]),_e(P,"click",s[16])],$e=!0)},p(m,q){m[7]>0?W?W.p(m,q):(W=Ge(m),W.c(),W.m(l,null)):W&&(W.d(1),W=null),m[0]?X?X.p(m,q):(X=Je(m),X.c(),X.m(D,$)):X&&(X.d(1),X=null);let he=w;w=Se(m),w===he?fe[w].p(m,q):(ke(),H(fe[he],1,1,()=>{fe[he]=null}),we(),V=fe[w],V?V.p(m,q):(V=fe[w]=Re[w](m),V.c()),L(V,1),V.m(T,null)),(!pe||q[0]&1&&O!==(O="w-24 h-24 rounded-full flex items-center justify-center transition-all duration-200 shadow-lg relative overflow-hidden z-20 "+(m[0]?"border-4 border-orange-500 bg-transparent":"bg-orange-500 hover:bg-orange-600")))&&f(T,"class",O);let be=v;v=Pe(m),v===be?de[v].p(m,q):(ke(),H(de[be],1,1,()=>{de[be]=null}),we(),x=de[v],x?x.p(m,q):(x=de[v]=Ne[v](m),x.c()),L(x,1),x.m(Z,null)),q[0]&8&&S.value!==m[3]&&Ue(S,m[3]),(!pe||q[0]&12&&se!==(se=!m[2]||!m[3].trim()))&&(P.disabled=se),m[2]?Q?Q.p(m,q):(Q=We(m),Q.c(),Q.m(M,null)):Q&&(Q.d(1),Q=null),m[4]?B?(B.p(m,q),q[0]&16&&L(B,1)):(B=Xe(m),B.c(),L(B,1),B.m(ue.parentNode,ue)):B&&(ke(),H(B,1,1,()=>{B=null}),we())},i(m){pe||(L(a.$$.fragment,m),L(V),L(x),L(B),pe=!0)},o(m){H(a.$$.fragment,m),H(V),H(x),H(B),pe=!1},d(m){m&&(u(e),u(t),u(ge),u(ue)),oe(a),W&&W.d(),X&&X.d(),fe[w].d(),de[v].d(),Q&&Q.d(),B&&B.d(m),$e=!1,Ae(ze)}}}function Rt(s){return s&&s.duration>=15}function St(s){return s!==null}function Nt(s,e,t){let r=!1,l=[],a=null,o="",c=[],n=null,g=[],_=!1,k="",N="",j=0,C=0,E=null,y=0,D=null,$=null,T=null,w=null;function V(p,S=""){t(5,k=p),t(6,N=S),t(4,_=!0)}function O(){t(4,_=!1),t(5,k=""),t(6,N="")}async function Y(){try{let le=function(){if(!r||!$)return;$.getByteFrequencyData(P);let se=0;for(let ne=0;ne<G;ne++)se+=P[ne];t(9,y=se/G/255),requestAnimationFrame(le)};const p=await navigator.mediaDevices.getUserMedia({audio:!0});n=new MediaRecorder(p),g=[],c=[],t(8,C=0),t(9,y=0),D=new(window.AudioContext||window.webkitAudioContext),$=D.createAnalyser(),D.createMediaStreamSource(p).connect($),$.fftSize=256;const G=$.frequencyBinCount,P=new Uint8Array(G);n.ondataavailable=se=>{g.push(se.data)},n.onstop=()=>{const se=new Blob(g,{type:"audio/wav"}),ne=URL.createObjectURL(se),ge={id:Date.now(),url:ne,blob:se,timestamp:new Date,duration:C/100*15};t(1,l=[...l,ge]),p.getTracks().forEach(ue=>ue.stop()),D&&(D.close(),D=null),t(8,C=0),t(9,y=0)},n.start(),t(0,r=!0),le(),E=setInterval(()=>{if(!r){clearInterval(E);return}t(8,C+=100/15/10),C>=100&&t(8,C=100)},100)}catch(p){console.error("Error accessing microphone:",p),V("Microphone Error","Could not access microphone. Please check permissions.")}}function K(){n&&n.state==="recording"&&(n.stop(),t(0,r=!1),c=[],E&&(clearInterval(E),E=null))}function Z(){r?K():Y()}function v(p){t(2,a=p)}function x(p){if((T==null?void 0:T.id)===p.id&&w&&!w.paused){w.pause(),t(10,T=null);return}w&&(w.pause(),t(11,w=null)),t(11,w=new Audio(p.url)),t(10,T=p),w.addEventListener("ended",()=>{t(10,T=null),t(11,w=null)}),w.addEventListener("pause",()=>{w&&w.ended&&(t(10,T=null),t(11,w=null))}),w.play()}function ee(){if(!a||!o.trim()){V("Clone Error","Please select a recording and enter a name.");return}V("Clone Voice","Voice cloning functionality will be implemented soon.")}async function M(){try{const p=await fetch("/api/history/load",{method:"GET",credentials:"include"});if(p.ok){const G=(await p.json()).entries.filter(P=>P.entry_type==="generation");t(7,j=G.length)}}catch(p){console.error("Error loading history count:",p),t(7,j=0)}}it(async()=>{await M()});const F=p=>x(p),I=p=>v(p);function R(){o=this.value,t(3,o)}return[r,l,a,o,_,k,N,j,C,y,T,w,O,Z,v,x,ee,F,I,R]}class Ut extends Ye{constructor(e){super(),Ze(this,e,Nt,zt,et,{},null,[-1,-1])}}export{Ut as component};
|
hfstudio/static/_app/version.json
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":"
|
|
|
|
| 1 |
+
{"version":"1761244884160"}
|
hfstudio/static/index.html
CHANGED
|
@@ -6,25 +6,25 @@
|
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
| 7 |
<title>HFStudio - Text to Speech</title>
|
| 8 |
|
| 9 |
-
<link rel="modulepreload" href="/_app/immutable/entry/start.
|
| 10 |
-
<link rel="modulepreload" href="/_app/immutable/chunks/
|
| 11 |
-
<link rel="modulepreload" href="/_app/immutable/chunks/
|
| 12 |
-
<link rel="modulepreload" href="/_app/immutable/entry/app.
|
| 13 |
<link rel="modulepreload" href="/_app/immutable/chunks/IHki7fMi.js">
|
| 14 |
</head>
|
| 15 |
<body data-sveltekit-preload-data="hover">
|
| 16 |
<div style="display: contents">
|
| 17 |
<script>
|
| 18 |
{
|
| 19 |
-
|
| 20 |
base: ""
|
| 21 |
};
|
| 22 |
|
| 23 |
const element = document.currentScript.parentElement;
|
| 24 |
|
| 25 |
Promise.all([
|
| 26 |
-
import("/_app/immutable/entry/start.
|
| 27 |
-
import("/_app/immutable/entry/app.
|
| 28 |
]).then(([kit, app]) => {
|
| 29 |
kit.start(app, element);
|
| 30 |
});
|
|
|
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
| 7 |
<title>HFStudio - Text to Speech</title>
|
| 8 |
|
| 9 |
+
<link rel="modulepreload" href="/_app/immutable/entry/start.DiWn1IXe.js">
|
| 10 |
+
<link rel="modulepreload" href="/_app/immutable/chunks/e2OxhbUw.js">
|
| 11 |
+
<link rel="modulepreload" href="/_app/immutable/chunks/BjzGjDWb.js">
|
| 12 |
+
<link rel="modulepreload" href="/_app/immutable/entry/app.Bclt6vmz.js">
|
| 13 |
<link rel="modulepreload" href="/_app/immutable/chunks/IHki7fMi.js">
|
| 14 |
</head>
|
| 15 |
<body data-sveltekit-preload-data="hover">
|
| 16 |
<div style="display: contents">
|
| 17 |
<script>
|
| 18 |
{
|
| 19 |
+
__sveltekit_j7e979 = {
|
| 20 |
base: ""
|
| 21 |
};
|
| 22 |
|
| 23 |
const element = document.currentScript.parentElement;
|
| 24 |
|
| 25 |
Promise.all([
|
| 26 |
+
import("/_app/immutable/entry/start.DiWn1IXe.js"),
|
| 27 |
+
import("/_app/immutable/entry/app.Bclt6vmz.js")
|
| 28 |
]).then(([kit, app]) => {
|
| 29 |
kit.start(app, element);
|
| 30 |
});
|