GitHub Action
commited on
Commit
Β·
5e29ba1
1
Parent(s):
3bbfeed
Sync from GitHub: a8b8885c9db4cd1da0018227168be3ec7bec4648
Browse files- .gitattributes +6 -0
- frontend/src/routes/+page.svelte +116 -27
- hfstudio/cli.py +39 -14
- hfstudio/server.py +136 -75
- hfstudio/static/_app/immutable/assets/0.A7Re8yJ6.css +1 -0
- hfstudio/static/_app/immutable/chunks/XKv6HzUC.js +3 -0
- hfstudio/static/_app/immutable/entry/app.DbBalDX7.js +2 -0
- hfstudio/static/_app/immutable/entry/start.BWDS6DNN.js +1 -0
- hfstudio/static/_app/immutable/nodes/0.Cprb3ZX_.js +3 -0
- hfstudio/static/_app/immutable/nodes/1.ChkqOOWS.js +1 -0
- hfstudio/static/_app/immutable/nodes/2.Eqbep-qD.js +130 -0
- models/chatterbox/local.py +134 -0
- models/chatterbox/spec.json +62 -0
- run_dev.sh +2 -2
.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/+page.svelte
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<script>
|
| 2 |
import { Play, Download, Loader2, AlertCircle, ChevronDown, Copy, RefreshCw, Share, MoreHorizontal, Settings, Sliders, Pause, SkipBack, SkipForward, Layout, Code, X } from 'lucide-svelte';
|
| 3 |
|
| 4 |
-
let text = `In a hole in the ground there lived a hobbit
|
| 5 |
let selectedVoice = 'Lily';
|
| 6 |
let selectedModel = 'Chatterbox';
|
| 7 |
let mode = 'api';
|
|
@@ -28,7 +28,7 @@
|
|
| 28 |
|
| 29 |
const models = [
|
| 30 |
{ id: 'chatterbox', name: 'Chatterbox', badge: 'recommended' },
|
| 31 |
-
{ id: 'kokoro', name: 'Kokoro', badge: '
|
| 32 |
];
|
| 33 |
|
| 34 |
const voices = [
|
|
@@ -189,7 +189,6 @@
|
|
| 189 |
function handleAudioLoad() {
|
| 190 |
if (audioElement) {
|
| 191 |
duration = audioElement.duration;
|
| 192 |
-
audioElement.play();
|
| 193 |
}
|
| 194 |
}
|
| 195 |
|
|
@@ -283,22 +282,73 @@
|
|
| 283 |
}
|
| 284 |
|
| 285 |
function generateSetupCode() {
|
| 286 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 287 |
# pip install huggingface-hub
|
| 288 |
|
| 289 |
from huggingface_hub import InferenceClient
|
| 290 |
-
import base64
|
| 291 |
-
import io
|
| 292 |
|
| 293 |
-
# Initialize the client
|
| 294 |
client = InferenceClient(
|
| 295 |
provider="fal-ai",
|
| 296 |
api_key="YOUR_HF_TOKEN", # Get your token from https://huggingface.co/settings/tokens
|
| 297 |
)`;
|
|
|
|
| 298 |
}
|
| 299 |
|
| 300 |
function generateTTSCode() {
|
| 301 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 302 |
text = """${text}"""
|
| 303 |
|
| 304 |
# Voice and model settings
|
|
@@ -307,17 +357,36 @@ voice = "${selectedVoice.toLowerCase()}"
|
|
| 307 |
exaggeration = ${exaggeration}
|
| 308 |
temperature = ${temperature}
|
| 309 |
|
| 310 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 311 |
print("Generating speech...")
|
| 312 |
try:
|
| 313 |
audio_bytes = client.text_to_speech(
|
| 314 |
text,
|
| 315 |
model=model,
|
| 316 |
-
|
| 317 |
)
|
| 318 |
print(f"β Generated {len(audio_bytes)} bytes of audio")
|
| 319 |
except Exception as e:
|
| 320 |
print(f"Error: {e}")`;
|
|
|
|
| 321 |
}
|
| 322 |
|
| 323 |
function generateSaveCode() {
|
|
@@ -378,6 +447,24 @@ print(f"β Audio saved to {output_filename}")
|
|
| 378 |
codeCells = [];
|
| 379 |
}
|
| 380 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 381 |
</script>
|
| 382 |
|
| 383 |
<div class="flex flex-col h-full" on:click={handleClickOutside}>
|
|
@@ -414,25 +501,13 @@ print(f"β Audio saved to {output_filename}")
|
|
| 414 |
<div class="flex-1 flex">
|
| 415 |
<!-- Main content area -->
|
| 416 |
<div class="flex-1 flex flex-col p-6">
|
| 417 |
-
{#if mode === 'local'}
|
| 418 |
-
<div class="mb-4 p-3 bg-blue-50 border border-blue-200 rounded-lg flex items-start gap-2">
|
| 419 |
-
<AlertCircle size={18} class="text-blue-600 mt-0.5 flex-shrink-0" />
|
| 420 |
-
<div class="text-sm">
|
| 421 |
-
<p class="font-medium text-blue-900">To run locally:</p>
|
| 422 |
-
<code class="text-xs bg-blue-100 px-1.5 py-0.5 rounded">pip install hfstudio</code>
|
| 423 |
-
<span class="text-blue-700"> and run </span>
|
| 424 |
-
<code class="text-xs bg-blue-100 px-1.5 py-0.5 rounded">hfstudio</code>
|
| 425 |
-
<span class="text-blue-700"> from your terminal</span>
|
| 426 |
-
</div>
|
| 427 |
-
</div>
|
| 428 |
-
{/if}
|
| 429 |
|
| 430 |
<!-- Text input area -->
|
| 431 |
<div class="flex-1 pb-24">
|
| 432 |
<textarea
|
| 433 |
bind:value={text}
|
| 434 |
class="w-full h-full p-6 bg-white resize-none border-0 focus:outline-none text-gray-900 text-base leading-relaxed"
|
| 435 |
-
placeholder="
|
| 436 |
/>
|
| 437 |
|
| 438 |
</div>
|
|
@@ -610,10 +685,13 @@ print(f"β Audio saved to {output_filename}")
|
|
| 610 |
<div class="absolute top-full left-0 right-0 mt-1 bg-white border border-gray-200 rounded-lg shadow-lg z-10">
|
| 611 |
{#each models as model}
|
| 612 |
<button
|
| 613 |
-
class="w-full px-3 py-2 text-left
|
|
|
|
| 614 |
on:click={() => {
|
| 615 |
-
|
| 616 |
-
|
|
|
|
|
|
|
| 617 |
}}
|
| 618 |
>
|
| 619 |
{model.name}{#if model.badge} <span class="text-xs text-gray-500">({model.badge})</span>{/if}
|
|
@@ -621,6 +699,11 @@ print(f"β Audio saved to {output_filename}")
|
|
| 621 |
{/each}
|
| 622 |
</div>
|
| 623 |
{/if}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 624 |
</div>
|
| 625 |
|
| 626 |
<div class="mb-6">
|
|
@@ -733,7 +816,13 @@ print(f"β Audio saved to {output_filename}")
|
|
| 733 |
<div class="mb-6">
|
| 734 |
<div>
|
| 735 |
<h2 class="text-2xl font-semibold text-gray-900">Integration Code</h2>
|
| 736 |
-
<p class="text-sm text-gray-600 mt-1">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 737 |
</div>
|
| 738 |
|
| 739 |
<!-- Toggle and Copy All button row -->
|
|
|
|
| 1 |
<script>
|
| 2 |
import { Play, Download, Loader2, AlertCircle, ChevronDown, Copy, RefreshCw, Share, MoreHorizontal, Settings, Sliders, Pause, SkipBack, SkipForward, Layout, Code, X } from 'lucide-svelte';
|
| 3 |
|
| 4 |
+
let text = `In a hole in the ground there lived a hobbit.`;
|
| 5 |
let selectedVoice = 'Lily';
|
| 6 |
let selectedModel = 'Chatterbox';
|
| 7 |
let mode = 'api';
|
|
|
|
| 28 |
|
| 29 |
const models = [
|
| 30 |
{ id: 'chatterbox', name: 'Chatterbox', badge: 'recommended' },
|
| 31 |
+
{ id: 'kokoro', name: 'Kokoro', badge: 'coming soon', disabled: true },
|
| 32 |
];
|
| 33 |
|
| 34 |
const voices = [
|
|
|
|
| 189 |
function handleAudioLoad() {
|
| 190 |
if (audioElement) {
|
| 191 |
duration = audioElement.duration;
|
|
|
|
| 192 |
}
|
| 193 |
}
|
| 194 |
|
|
|
|
| 282 |
}
|
| 283 |
|
| 284 |
function generateSetupCode() {
|
| 285 |
+
if (mode === 'local') {
|
| 286 |
+
return `# Install required packages
|
| 287 |
+
# pip install hfstudio huggingface-hub
|
| 288 |
+
|
| 289 |
+
# Start the model server locally
|
| 290 |
+
# Run this command in your terminal:
|
| 291 |
+
# hfstudio start chatterbox --port 7861
|
| 292 |
+
|
| 293 |
+
# Then use the following Python code:
|
| 294 |
+
from huggingface_hub import InferenceClient
|
| 295 |
+
|
| 296 |
+
# Initialize the client for local server
|
| 297 |
+
client = InferenceClient(base_url="http://localhost:7861/v1/")`;
|
| 298 |
+
} else {
|
| 299 |
+
return `# Install required packages
|
| 300 |
# pip install huggingface-hub
|
| 301 |
|
| 302 |
from huggingface_hub import InferenceClient
|
|
|
|
|
|
|
| 303 |
|
| 304 |
+
# Initialize the client for HuggingFace API
|
| 305 |
client = InferenceClient(
|
| 306 |
provider="fal-ai",
|
| 307 |
api_key="YOUR_HF_TOKEN", # Get your token from https://huggingface.co/settings/tokens
|
| 308 |
)`;
|
| 309 |
+
}
|
| 310 |
}
|
| 311 |
|
| 312 |
function generateTTSCode() {
|
| 313 |
+
if (mode === 'local') {
|
| 314 |
+
return `# Text to convert to speech
|
| 315 |
+
text = """${text}"""
|
| 316 |
+
|
| 317 |
+
# Voice and model settings
|
| 318 |
+
voice = "${selectedVoice.toLowerCase()}"
|
| 319 |
+
exaggeration = ${exaggeration}
|
| 320 |
+
temperature = ${temperature}
|
| 321 |
+
|
| 322 |
+
# Voice reference URLs (update these to your local paths if needed)
|
| 323 |
+
voice_urls = {
|
| 324 |
+
"lily": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/lily.mp3",
|
| 325 |
+
"andrew": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/andrew.mp3",
|
| 326 |
+
"fairy": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/fairy.mp3",
|
| 327 |
+
"pirate": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/pirate.mp3"
|
| 328 |
+
}
|
| 329 |
+
|
| 330 |
+
# Build extra_body with parameters
|
| 331 |
+
extra_body = {
|
| 332 |
+
"exaggeration": exaggeration,
|
| 333 |
+
"temperature": temperature
|
| 334 |
+
}
|
| 335 |
+
|
| 336 |
+
# Add audio_url for voice reference
|
| 337 |
+
if voice in voice_urls:
|
| 338 |
+
extra_body["audio_url"] = voice_urls[voice]
|
| 339 |
+
|
| 340 |
+
# Generate speech using InferenceClient
|
| 341 |
+
print("Generating speech...")
|
| 342 |
+
try:
|
| 343 |
+
audio_bytes = client.text_to_speech(
|
| 344 |
+
text,
|
| 345 |
+
extra_body=extra_body if extra_body else None,
|
| 346 |
+
)
|
| 347 |
+
print(f"β Generated {len(audio_bytes)} bytes of audio")
|
| 348 |
+
except Exception as e:
|
| 349 |
+
print(f"Error: {e}")`;
|
| 350 |
+
} else {
|
| 351 |
+
return `# Text to convert to speech
|
| 352 |
text = """${text}"""
|
| 353 |
|
| 354 |
# Voice and model settings
|
|
|
|
| 357 |
exaggeration = ${exaggeration}
|
| 358 |
temperature = ${temperature}
|
| 359 |
|
| 360 |
+
# Voice reference URLs
|
| 361 |
+
voice_urls = {
|
| 362 |
+
"lily": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/lily.mp3",
|
| 363 |
+
"andrew": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/andrew.mp3",
|
| 364 |
+
"fairy": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/fairy.mp3",
|
| 365 |
+
"pirate": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/pirate.mp3"
|
| 366 |
+
}
|
| 367 |
+
|
| 368 |
+
# Build extra_body with parameters
|
| 369 |
+
extra_body = {
|
| 370 |
+
"exaggeration": exaggeration,
|
| 371 |
+
"temperature": temperature
|
| 372 |
+
}
|
| 373 |
+
|
| 374 |
+
# Add audio_url for voice reference
|
| 375 |
+
if voice in voice_urls:
|
| 376 |
+
extra_body["audio_url"] = voice_urls[voice]
|
| 377 |
+
|
| 378 |
+
# Generate speech using InferenceClient
|
| 379 |
print("Generating speech...")
|
| 380 |
try:
|
| 381 |
audio_bytes = client.text_to_speech(
|
| 382 |
text,
|
| 383 |
model=model,
|
| 384 |
+
extra_body=extra_body if extra_body else None,
|
| 385 |
)
|
| 386 |
print(f"β Generated {len(audio_bytes)} bytes of audio")
|
| 387 |
except Exception as e:
|
| 388 |
print(f"Error: {e}")`;
|
| 389 |
+
}
|
| 390 |
}
|
| 391 |
|
| 392 |
function generateSaveCode() {
|
|
|
|
| 447 |
codeCells = [];
|
| 448 |
}
|
| 449 |
|
| 450 |
+
// Update existing code cells when mode changes
|
| 451 |
+
let previousMode = mode;
|
| 452 |
+
$: if (mode !== previousMode && codeCells.length > 0) {
|
| 453 |
+
previousMode = mode;
|
| 454 |
+
// Update setup code cell if it exists
|
| 455 |
+
const setupCellIndex = codeCells.findIndex(cell => cell.title === 'Setup and Import');
|
| 456 |
+
if (setupCellIndex !== -1) {
|
| 457 |
+
codeCells[setupCellIndex].code = generateSetupCode();
|
| 458 |
+
}
|
| 459 |
+
// Update TTS code cell if it exists
|
| 460 |
+
const ttsCellIndex = codeCells.findIndex(cell => cell.title === 'Generate Speech');
|
| 461 |
+
if (ttsCellIndex !== -1) {
|
| 462 |
+
codeCells[ttsCellIndex].code = generateTTSCode();
|
| 463 |
+
}
|
| 464 |
+
// Force reactivity update
|
| 465 |
+
codeCells = [...codeCells];
|
| 466 |
+
}
|
| 467 |
+
|
| 468 |
</script>
|
| 469 |
|
| 470 |
<div class="flex flex-col h-full" on:click={handleClickOutside}>
|
|
|
|
| 501 |
<div class="flex-1 flex">
|
| 502 |
<!-- Main content area -->
|
| 503 |
<div class="flex-1 flex flex-col p-6">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 504 |
|
| 505 |
<!-- Text input area -->
|
| 506 |
<div class="flex-1 pb-24">
|
| 507 |
<textarea
|
| 508 |
bind:value={text}
|
| 509 |
class="w-full h-full p-6 bg-white resize-none border-0 focus:outline-none text-gray-900 text-base leading-relaxed"
|
| 510 |
+
placeholder="In a hole in the ground there lived a hobbit."
|
| 511 |
/>
|
| 512 |
|
| 513 |
</div>
|
|
|
|
| 685 |
<div class="absolute top-full left-0 right-0 mt-1 bg-white border border-gray-200 rounded-lg shadow-lg z-10">
|
| 686 |
{#each models as model}
|
| 687 |
<button
|
| 688 |
+
class="w-full px-3 py-2 text-left transition-colors text-sm {model.disabled ? 'opacity-50 cursor-not-allowed' : 'hover:bg-gray-50'} {model.name === selectedModel ? 'bg-gray-100' : ''}"
|
| 689 |
+
disabled={model.disabled}
|
| 690 |
on:click={() => {
|
| 691 |
+
if (!model.disabled) {
|
| 692 |
+
selectedModel = model.name;
|
| 693 |
+
modelDropdownOpen = false;
|
| 694 |
+
}
|
| 695 |
}}
|
| 696 |
>
|
| 697 |
{model.name}{#if model.badge} <span class="text-xs text-gray-500">({model.badge})</span>{/if}
|
|
|
|
| 699 |
{/each}
|
| 700 |
</div>
|
| 701 |
{/if}
|
| 702 |
+
|
| 703 |
+
<!-- Pricing info -->
|
| 704 |
+
<div class="mt-2 text-xs text-gray-500">
|
| 705 |
+
$0.025 per 1000 characters (<a href="https://huggingface.co/settings/billing" target="_blank" class="text-amber-600 hover:text-amber-700 underline">Hugging Face billing</a>)
|
| 706 |
+
</div>
|
| 707 |
</div>
|
| 708 |
|
| 709 |
<div class="mb-6">
|
|
|
|
| 816 |
<div class="mb-6">
|
| 817 |
<div>
|
| 818 |
<h2 class="text-2xl font-semibold text-gray-900">Integration Code</h2>
|
| 819 |
+
<p class="text-sm text-gray-600 mt-1">
|
| 820 |
+
{#if mode === 'local'}
|
| 821 |
+
Python code to reproduce your actions using a local HFStudio server
|
| 822 |
+
{:else}
|
| 823 |
+
Python code to reproduce your actions via the API
|
| 824 |
+
{/if}
|
| 825 |
+
</p>
|
| 826 |
</div>
|
| 827 |
|
| 828 |
<!-- Toggle and Copy All button row -->
|
hfstudio/cli.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import os
|
| 2 |
import subprocess
|
| 3 |
import sys
|
|
@@ -12,20 +13,6 @@ from rich.table import Table
|
|
| 12 |
console = Console()
|
| 13 |
app = typer.Typer(help="HFStudio - Local and API-based Text-to-Speech Studio")
|
| 14 |
|
| 15 |
-
# Model registry - maps model names to their script files
|
| 16 |
-
MODEL_REGISTRY = {
|
| 17 |
-
"resambleai/chatterbox": {
|
| 18 |
-
"script": "models/chatterbox.py",
|
| 19 |
-
"description": "High-quality conversational TTS",
|
| 20 |
-
"status": "Available"
|
| 21 |
-
},
|
| 22 |
-
"kokoro": {
|
| 23 |
-
"script": None, # Not implemented yet
|
| 24 |
-
"description": "Fast but lower quality TTS",
|
| 25 |
-
"status": "Coming Soon"
|
| 26 |
-
}
|
| 27 |
-
}
|
| 28 |
-
|
| 29 |
def get_project_root() -> Path:
|
| 30 |
"""Find the project root directory containing models/"""
|
| 31 |
current_dir = Path(__file__).parent
|
|
@@ -59,6 +46,44 @@ def get_sample_audio_path() -> str:
|
|
| 59 |
|
| 60 |
raise FileNotFoundError("Could not find sample audio file (harvard.wav)")
|
| 61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
def run_model_script(model_name: str, port: int, host: str):
|
| 63 |
"""Run a model's UV script"""
|
| 64 |
if model_name not in MODEL_REGISTRY:
|
|
|
|
| 1 |
+
import json
|
| 2 |
import os
|
| 3 |
import subprocess
|
| 4 |
import sys
|
|
|
|
| 13 |
console = Console()
|
| 14 |
app = typer.Typer(help="HFStudio - Local and API-based Text-to-Speech Studio")
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
def get_project_root() -> Path:
|
| 17 |
"""Find the project root directory containing models/"""
|
| 18 |
current_dir = Path(__file__).parent
|
|
|
|
| 46 |
|
| 47 |
raise FileNotFoundError("Could not find sample audio file (harvard.wav)")
|
| 48 |
|
| 49 |
+
def load_model_specs():
|
| 50 |
+
"""Load model specifications from models/ directory"""
|
| 51 |
+
project_root = get_project_root()
|
| 52 |
+
models_dir = project_root / "models"
|
| 53 |
+
|
| 54 |
+
model_registry = {}
|
| 55 |
+
|
| 56 |
+
# Scan for model directories with spec.json files
|
| 57 |
+
for model_dir in models_dir.iterdir():
|
| 58 |
+
if model_dir.is_dir():
|
| 59 |
+
spec_file = model_dir / "spec.json"
|
| 60 |
+
local_script = model_dir / "local.py"
|
| 61 |
+
|
| 62 |
+
if spec_file.exists():
|
| 63 |
+
try:
|
| 64 |
+
with open(spec_file, 'r') as f:
|
| 65 |
+
spec = json.load(f)
|
| 66 |
+
|
| 67 |
+
model_name = model_dir.name
|
| 68 |
+
model_registry[model_name] = {
|
| 69 |
+
"script": str(local_script) if local_script.exists() else None,
|
| 70 |
+
"spec": spec,
|
| 71 |
+
"description": spec.get("description", ""),
|
| 72 |
+
"status": "Available" if local_script.exists() else "Spec Only"
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
# Also register by full model_id if different
|
| 76 |
+
if spec.get("model_id") and spec["model_id"] != model_name:
|
| 77 |
+
model_registry[spec["model_id"]] = model_registry[model_name]
|
| 78 |
+
|
| 79 |
+
except json.JSONDecodeError:
|
| 80 |
+
console.print(f"[yellow]Warning: Invalid JSON in {spec_file}[/yellow]")
|
| 81 |
+
|
| 82 |
+
return model_registry
|
| 83 |
+
|
| 84 |
+
# Load models dynamically
|
| 85 |
+
MODEL_REGISTRY = load_model_specs()
|
| 86 |
+
|
| 87 |
def run_model_script(model_name: str, port: int, host: str):
|
| 88 |
"""Run a model's UV script"""
|
| 89 |
if model_name not in MODEL_REGISTRY:
|
hfstudio/server.py
CHANGED
|
@@ -7,12 +7,79 @@ from typing import Optional, Dict, Any
|
|
| 7 |
import base64
|
| 8 |
import httpx
|
| 9 |
import os
|
|
|
|
| 10 |
from pathlib import Path
|
| 11 |
from huggingface_hub import InferenceClient, get_token, whoami
|
| 12 |
|
| 13 |
app = FastAPI(title="HFStudio API", version="0.1.0")
|
| 14 |
|
| 15 |
static_dir = Path(__file__).parent / "static"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
if static_dir.exists():
|
| 17 |
app.mount("/static", StaticFiles(directory=str(static_dir)), name="static")
|
| 18 |
app.mount("/_app", StaticFiles(directory=str(static_dir / "_app")), name="app")
|
|
@@ -134,97 +201,91 @@ async def get_local_token():
|
|
| 134 |
|
| 135 |
@app.get("/api/voices")
|
| 136 |
async def get_voices():
|
| 137 |
-
voices = [
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 143 |
return {"voices": voices}
|
| 144 |
|
| 145 |
@app.get("/api/models")
|
| 146 |
async def get_models():
|
| 147 |
-
models = [
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 152 |
return {"models": models}
|
| 153 |
|
| 154 |
@app.post("/api/tts/generate")
|
| 155 |
async def generate_tts(request: TTSRequest):
|
| 156 |
try:
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
provider="fal-ai",
|
| 161 |
-
api_key=request.access_token,
|
| 162 |
-
)
|
| 163 |
-
|
| 164 |
-
# Build extra_body with the parameters
|
| 165 |
-
extra_body = {}
|
| 166 |
-
if request.parameters:
|
| 167 |
-
if "exaggeration" in request.parameters:
|
| 168 |
-
extra_body["exaggeration"] = request.parameters["exaggeration"]
|
| 169 |
-
if "temperature" in request.parameters:
|
| 170 |
-
extra_body["temperature"] = request.parameters["temperature"]
|
| 171 |
-
|
| 172 |
-
# Add audio_url for voice reference
|
| 173 |
-
voice_urls = {
|
| 174 |
-
"lily": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/lily.mp3",
|
| 175 |
-
"andrew": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/andrew.mp3",
|
| 176 |
-
"fairy": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/fairy.mp3",
|
| 177 |
-
"pirate": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/pirate.mp3"
|
| 178 |
-
}
|
| 179 |
-
|
| 180 |
-
if request.voice_id.lower() in voice_urls:
|
| 181 |
-
extra_body["audio_url"] = voice_urls[request.voice_id.lower()]
|
| 182 |
-
|
| 183 |
-
audio_bytes = client.text_to_speech(
|
| 184 |
-
request.text,
|
| 185 |
-
model="ResembleAI/chatterbox",
|
| 186 |
-
extra_body=extra_body if extra_body else None,
|
| 187 |
-
)
|
| 188 |
-
|
| 189 |
-
audio_base64 = base64.b64encode(audio_bytes).decode('utf-8')
|
| 190 |
-
audio_url = f"data:audio/wav;base64,{audio_base64}"
|
| 191 |
-
|
| 192 |
-
duration = len(request.text) * 0.05
|
| 193 |
-
|
| 194 |
-
return TTSResponse(
|
| 195 |
-
audio_url=audio_url,
|
| 196 |
-
duration=duration,
|
| 197 |
-
format="wav"
|
| 198 |
-
)
|
| 199 |
-
except Exception as api_error:
|
| 200 |
-
error_str = str(api_error)
|
| 201 |
-
|
| 202 |
-
if "403 Forbidden" in error_str and "permissions" in error_str:
|
| 203 |
-
return TTSResponse(
|
| 204 |
-
success=False,
|
| 205 |
-
error="Your HuggingFace token doesn't have permission to use Inference Providers. Please create a new token with 'Inference API' permissions at https://huggingface.co/settings/tokens"
|
| 206 |
-
)
|
| 207 |
-
elif "authentication" in error_str.lower():
|
| 208 |
-
return TTSResponse(
|
| 209 |
-
success=False,
|
| 210 |
-
error="Authentication failed. Please check your HuggingFace token or log in again."
|
| 211 |
-
)
|
| 212 |
-
else:
|
| 213 |
-
return TTSResponse(
|
| 214 |
-
success=False,
|
| 215 |
-
error=f"Chatterbox API error: {error_str}"
|
| 216 |
-
)
|
| 217 |
-
|
| 218 |
-
if request.mode == "api":
|
| 219 |
return TTSResponse(
|
| 220 |
success=False,
|
| 221 |
-
error="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 222 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 223 |
else:
|
| 224 |
return TTSResponse(
|
| 225 |
success=False,
|
| 226 |
-
error="
|
| 227 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 228 |
except Exception as e:
|
| 229 |
raise HTTPException(status_code=500, detail=str(e))
|
| 230 |
|
|
|
|
| 7 |
import base64
|
| 8 |
import httpx
|
| 9 |
import os
|
| 10 |
+
import json
|
| 11 |
from pathlib import Path
|
| 12 |
from huggingface_hub import InferenceClient, get_token, whoami
|
| 13 |
|
| 14 |
app = FastAPI(title="HFStudio API", version="0.1.0")
|
| 15 |
|
| 16 |
static_dir = Path(__file__).parent / "static"
|
| 17 |
+
models_dir = Path(__file__).parent.parent / "models"
|
| 18 |
+
|
| 19 |
+
def load_model_spec(model_id: str) -> Optional[Dict[str, Any]]:
|
| 20 |
+
"""Load model specification from JSON file."""
|
| 21 |
+
spec_path = models_dir / model_id / "spec.json"
|
| 22 |
+
if spec_path.exists():
|
| 23 |
+
try:
|
| 24 |
+
with open(spec_path, 'r') as f:
|
| 25 |
+
return json.load(f)
|
| 26 |
+
except (json.JSONDecodeError, IOError):
|
| 27 |
+
return None
|
| 28 |
+
return None
|
| 29 |
+
|
| 30 |
+
def generate_tts_with_client(client: InferenceClient, request: TTSRequest, model_spec: Dict[str, Any]) -> TTSResponse:
|
| 31 |
+
"""Generate TTS using InferenceClient with model specifications."""
|
| 32 |
+
try:
|
| 33 |
+
# Build extra_body with parameters from spec
|
| 34 |
+
extra_body = {}
|
| 35 |
+
|
| 36 |
+
if request.parameters and "api" in model_spec:
|
| 37 |
+
api_params = model_spec["api"].get("parameters", {})
|
| 38 |
+
for param_name, param_value in request.parameters.items():
|
| 39 |
+
if param_name in api_params:
|
| 40 |
+
extra_body[param_name] = param_value
|
| 41 |
+
|
| 42 |
+
# Add voice URL from spec
|
| 43 |
+
voice_urls = model_spec.get("api", {}).get("voice_urls", {})
|
| 44 |
+
if request.voice_id.lower() in voice_urls:
|
| 45 |
+
extra_body["audio_url"] = voice_urls[request.voice_id.lower()]
|
| 46 |
+
|
| 47 |
+
# Generate audio
|
| 48 |
+
audio_bytes = client.text_to_speech(
|
| 49 |
+
request.text,
|
| 50 |
+
extra_body=extra_body if extra_body else None,
|
| 51 |
+
)
|
| 52 |
+
|
| 53 |
+
# Convert to base64 data URL
|
| 54 |
+
audio_base64 = base64.b64encode(audio_bytes).decode('utf-8')
|
| 55 |
+
audio_url = f"data:audio/wav;base64,{audio_base64}"
|
| 56 |
+
|
| 57 |
+
# Estimate duration (simple heuristic)
|
| 58 |
+
duration = len(request.text) * 0.05
|
| 59 |
+
|
| 60 |
+
return TTSResponse(
|
| 61 |
+
audio_url=audio_url,
|
| 62 |
+
duration=duration,
|
| 63 |
+
format="wav"
|
| 64 |
+
)
|
| 65 |
+
except Exception as e:
|
| 66 |
+
error_str = str(e)
|
| 67 |
+
|
| 68 |
+
if "403 Forbidden" in error_str and "permissions" in error_str:
|
| 69 |
+
return TTSResponse(
|
| 70 |
+
success=False,
|
| 71 |
+
error="Your HuggingFace token doesn't have permission to use Inference Providers. Please create a new token with 'Inference API' permissions at https://huggingface.co/settings/tokens"
|
| 72 |
+
)
|
| 73 |
+
elif "authentication" in error_str.lower():
|
| 74 |
+
return TTSResponse(
|
| 75 |
+
success=False,
|
| 76 |
+
error="Authentication failed. Please check your HuggingFace token or log in again."
|
| 77 |
+
)
|
| 78 |
+
else:
|
| 79 |
+
return TTSResponse(
|
| 80 |
+
success=False,
|
| 81 |
+
error=f"TTS generation error: {error_str}"
|
| 82 |
+
)
|
| 83 |
if static_dir.exists():
|
| 84 |
app.mount("/static", StaticFiles(directory=str(static_dir)), name="static")
|
| 85 |
app.mount("/_app", StaticFiles(directory=str(static_dir / "_app")), name="app")
|
|
|
|
| 201 |
|
| 202 |
@app.get("/api/voices")
|
| 203 |
async def get_voices():
|
| 204 |
+
voices = []
|
| 205 |
+
|
| 206 |
+
# Load voices from all model specifications
|
| 207 |
+
for model_dir in models_dir.iterdir():
|
| 208 |
+
if model_dir.is_dir():
|
| 209 |
+
model_spec = load_model_spec(model_dir.name)
|
| 210 |
+
if model_spec and "voices" in model_spec:
|
| 211 |
+
for voice_spec in model_spec["voices"]:
|
| 212 |
+
voice = Voice(
|
| 213 |
+
id=voice_spec["id"],
|
| 214 |
+
name=voice_spec["name"],
|
| 215 |
+
preview_url=model_spec.get("api", {}).get("voice_urls", {}).get(voice_spec["id"]),
|
| 216 |
+
supported_models=[model_dir.name]
|
| 217 |
+
)
|
| 218 |
+
voices.append(voice)
|
| 219 |
+
|
| 220 |
return {"voices": voices}
|
| 221 |
|
| 222 |
@app.get("/api/models")
|
| 223 |
async def get_models():
|
| 224 |
+
models = []
|
| 225 |
+
|
| 226 |
+
# Load models from specifications
|
| 227 |
+
for model_dir in models_dir.iterdir():
|
| 228 |
+
if model_dir.is_dir():
|
| 229 |
+
model_spec = load_model_spec(model_dir.name)
|
| 230 |
+
if model_spec:
|
| 231 |
+
model_type = "api" if "api" in model_spec else "local"
|
| 232 |
+
status = "available" if model_type == "api" else "downloadable"
|
| 233 |
+
|
| 234 |
+
model = Model(
|
| 235 |
+
id=model_dir.name,
|
| 236 |
+
name=model_spec.get("name", model_dir.name),
|
| 237 |
+
type=model_type,
|
| 238 |
+
status=status
|
| 239 |
+
)
|
| 240 |
+
models.append(model)
|
| 241 |
+
|
| 242 |
return {"models": models}
|
| 243 |
|
| 244 |
@app.post("/api/tts/generate")
|
| 245 |
async def generate_tts(request: TTSRequest):
|
| 246 |
try:
|
| 247 |
+
# Load model specification
|
| 248 |
+
model_spec = load_model_spec(request.model_id)
|
| 249 |
+
if not model_spec:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 250 |
return TTSResponse(
|
| 251 |
success=False,
|
| 252 |
+
error=f"Model specification not found for {request.model_id}"
|
| 253 |
+
)
|
| 254 |
+
|
| 255 |
+
# Create client based on mode
|
| 256 |
+
if request.mode == "api":
|
| 257 |
+
if not request.access_token:
|
| 258 |
+
return TTSResponse(
|
| 259 |
+
success=False,
|
| 260 |
+
error="Please log in to HuggingFace to use the API."
|
| 261 |
+
)
|
| 262 |
+
|
| 263 |
+
# Get model endpoint from spec
|
| 264 |
+
endpoint_model = model_spec.get("api", {}).get("endpoint_model", request.model_id)
|
| 265 |
+
client = InferenceClient(
|
| 266 |
+
api_key=request.access_token,
|
| 267 |
+
model=endpoint_model,
|
| 268 |
)
|
| 269 |
+
elif request.mode == "local":
|
| 270 |
+
# Get local port from spec or use default
|
| 271 |
+
local_config = model_spec.get("local", {})
|
| 272 |
+
port = local_config.get("default_port", 7861)
|
| 273 |
+
client = InferenceClient(base_url=f"http://localhost:{port}/v1/")
|
| 274 |
else:
|
| 275 |
return TTSResponse(
|
| 276 |
success=False,
|
| 277 |
+
error="Invalid mode. Use 'api' or 'local'."
|
| 278 |
)
|
| 279 |
+
|
| 280 |
+
# Generate TTS using the unified helper function
|
| 281 |
+
result = generate_tts_with_client(client, request, model_spec)
|
| 282 |
+
|
| 283 |
+
# Add specific error handling for local mode
|
| 284 |
+
if not result.success and request.mode == "local":
|
| 285 |
+
result.error = f"Local server error: {result.error}. Make sure to run 'hfstudio start {request.model_id}' first."
|
| 286 |
+
|
| 287 |
+
return result
|
| 288 |
+
|
| 289 |
except Exception as e:
|
| 290 |
raise HTTPException(status_code=500, detail=str(e))
|
| 291 |
|
hfstudio/static/_app/immutable/assets/0.A7Re8yJ6.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}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.bottom-full{bottom:100%}.left-0{left:0}.left-1\/2{left:50%}.left-56{left:14rem}.right-0{right:0}.right-4{right:1rem}.right-80{right:20rem}.top-full{top:100%}.z-10{z-index:10}.z-50{z-index:50}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.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-2{margin-top:.5rem}.mt-4{margin-top:1rem}.block{display:block}.flex{display:flex}.contents{display:contents}.hidden{display:none}.h-0{height:0px}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-2{height:.5rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-full{height:100%}.h-screen{height:100vh}.max-h-\[80vh\]{max-height:80vh}.min-h-0{min-height:0px}.w-0{width:0px}.w-10{width:2.5rem}.w-12{width:3rem}.w-2{width:.5rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-8{width:2rem}.w-80{width:20rem}.w-full{width:100%}.min-w-0{min-width:0px}.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}.-translate-x-1\/2{--tw-translate-x: -50%;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))}.scale-150{--tw-scale-x: 1.5;--tw-scale-y: 1.5;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))}.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-start{align-items:flex-start}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.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-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * 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}.border{border-width:1px}.border-0{border-width:0px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-r-4{border-right-width:4px}.border-t{border-top-width:1px}.border-t-4{border-top-width:4px}.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-transparent{border-color:transparent}.border-l-transparent{border-left-color:transparent}.border-r-transparent{border-right-color:transparent}.border-t-blue-600{--tw-border-opacity: 1;border-top-color:rgb(37 99 235 / var(--tw-border-opacity, 1))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / 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-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / 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-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-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-opacity-50{--tw-bg-opacity: .5}.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)}.to-orange-500{--tw-gradient-to: #f97316 var(--tw-gradient-to-position)}.bg-right{background-position:right}.bg-no-repeat{background-repeat:no-repeat}.p-0\.5{padding:.125rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.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-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}.pb-24{padding-bottom:6rem}.pr-10{padding-right:2.5rem}.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}.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-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-blue-100{--tw-text-opacity: 1;color:rgb(219 234 254 / 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-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-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.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-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)}.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}.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\: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\: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-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}
|
hfstudio/static/_app/immutable/chunks/XKv6HzUC.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,F as At,X as Rt,Y as Tt,Z as It,_ as Ut,$ as Lt,a0 as $t,v as ve,a1 as xt,G as be,A as ge,s as Ct}from"./Bqgpa-5T.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 Nt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function jt(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 Ft(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 Bt(...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="${Bt(...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 Be(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_17pe377)==null?void 0:Je.base)??"";var Xe;const Zt=((Xe=globalThis.__sveltekit_17pe377)==null?void 0:Xe.assets)??$??"",Qt="1761000780787",et="sveltekit:snapshot",tt="sveltekit:scroll",nt="sveltekit:states",en="sveltekit:pageurl",B="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 F(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=F(o,"preload-code")),a===null&&(a=F(o,"preload-data")),t===null&&(t=F(o,"keepfocus")),n===null&&(n=F(o,"noscroll")),s===null&&(s=F(o,"reload")),i===null&&(i=F(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"]),j=Qe(tt)??{},J=Qe(et)??{},C={url:Ve({}),page:Ve({}),navigating:Ue(null),updated:tn()};function Le(e){j[e]=le()}function Rn(e,t){let n=e+1;for(;j[n];)delete j[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,N;const K=new Set,He=new Map;async function Kn(e,t,n){var s,i,o,c,l;(s=globalThis.__sveltekit_17pe377)!=null&&s.data&&globalThis.__sveltekit_17pe377.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[B],L=(l=history.state)==null?void 0:l[z],A||(A=L=Date.now(),history.replaceState({...history.state,[B]:A,[z]:L},""));const r=j[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?Bn(new URL(location.href)):location.href),replace_state:!0}),a()),jn()}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),Be(tt,j),dt(L),Be(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(Nn)}}),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=Nt(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:je(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:Ft(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:je(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 Fe;const De={};for(let pe=0;pe<m;pe+=1)Object.assign(De,(Fe=await I[pe])==null?void 0:Fe.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 jt(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=Ne(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=N;N=c;const f=await de(t,!1),p=e==="enter"?Ne(b,f,t,e):_t({url:t,type:e,delta:n==null?void 0:n.delta,intent:f,event:h});if(!p){d(),N===c&&(N=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,N!==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={[B]: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&&Fn(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 Nn(e){if(typeof e=="function")ne.push(e);else{const{href:t}=new URL(e,location.href);ne.push(n=>n.href===t)}}function jn(){var t;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let r=!1;if(Ke(),!X){const a=Ne(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[B]){const a=n.state[B];if(N={},a===A)return;const s=j[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),j[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:N,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,[B]:++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(je(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 Fn(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 Ne(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 je(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 Bn(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.DbBalDX7.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.Cprb3ZX_.js","../chunks/Bqgpa-5T.js","../chunks/IHki7fMi.js","../assets/0.A7Re8yJ6.css","../nodes/1.ChkqOOWS.js","../chunks/XKv6HzUC.js","../nodes/2.Eqbep-qD.js","../assets/2.NHOETQX0.css"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{S as V,i as j,s as B,d,t as h,a as g,C as S,D as O,f as v,o as U,E as w,q as z,F,v as G,G as H,H as y,I as P,J as R,K as L,L as I,b as A,M as p,k as J,m as K,p as W,N as C,x as Q,y as X,z as Y}from"../chunks/Bqgpa-5T.js";import"../chunks/IHki7fMi.js";const Z="modulepreload",M=function(o,e){return new URL(o,e).href},N={},D=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 N)return;N[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=y(r,u(o)),o[12](e)),{c(){e&&R(e.$$.fragment),n=w()},l(t){e&&I(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,()=>{P(a,1)}),O()}r?(e=y(r,u(t)),t[12](e),R(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&&P(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=y(r,u(o)),o[11](e)),{c(){e&&R(e.$$.fragment),n=w()},l(t){e&&I(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,()=>{P(a,1)}),O()}r?(e=y(r,u(t)),t[11](e),R(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&&P(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=y(r,u(o)),o[10](e)),{c(){e&&R(e.$$.fragment),n=w()},l(t){e&&I(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,()=>{P(a,1)}),O()}r?(e=y(r,u(t)),t[10](e),R(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&&P(e,t)}}}function q(o){let e,n=o[7]&&T(o);return{c(){e=W("div"),n&&n.c(),this.h()},l(i){e=J(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var r=K(e);n&&n.l(r),r.forEach(d),this.h()},h(){A(e,"id","svelte-announcer"),A(e,"aria-live","assertive"),A(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=T(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&d(e),n&&n.d()}}}function T(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&&Q(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]&&q(o);return{c(){n.c(),i=z(),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}),O(),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=q(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;F(i.page.notify);let l=!1,_=!1,b=null;G(()=>{const c=i.page.subscribe(()=>{l&&(n(7,_=!0),H().then(()=>{n(8,b=document.title||"untitled page")}))});return n(6,l=!0),c});function m(c){C[c?"unshift":"push"](()=>{t[1]=c,n(0,t)})}function k(c){C[c?"unshift":"push"](()=>{t[0]=c,n(0,t)})}function E(c){C[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 V{constructor(e){super(),j(this,e,ne,te,B,{stores:9,page:1,constructors:2,components:0,form:3,data_0:4,data_1:5})}}const fe=[()=>D(()=>import("../nodes/0.Cprb3ZX_.js"),__vite__mapDeps([0,1,2,3]),import.meta.url),()=>D(()=>import("../nodes/1.ChkqOOWS.js"),__vite__mapDeps([4,1,2,5]),import.meta.url),()=>D(()=>import("../nodes/2.Eqbep-qD.js"),__vite__mapDeps([6,1,2,7]),import.meta.url)],ce=[],ue={"/":[2]},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.BWDS6DNN.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{l as o,a as r}from"../chunks/XKv6HzUC.js";export{o as load_css,r as start};
|
hfstudio/static/_app/immutable/nodes/0.Cprb3ZX_.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{S as Ie,i as Le,s as He,c as Ee,d as _,r as Ce,t as Se,a as Me,b as o,u as Ae,g as Ne,e as Pe,f as Z,h as n,l as se,j as Ue,k as r,m as P,n as H,o as v,p as i,q as x,v as Be,w as xe,x as me,y as ne,z as le,A as De}from"../chunks/Bqgpa-5T.js";import"../chunks/IHki7fMi.js";function je(a){let t,e="Sign In";return{c(){t=i("span"),t.textContent=e},l(s){t=r(s,"SPAN",{"data-svelte-h":!0}),H(t)!=="svelte-6n3gky"&&(t.textContent=e)},m(s,c){Z(s,t,c)},p:De,d(s){s&&_(t)}}}function Ve(a){let t,e,s;return{c(){t=i("span"),e=le("Sign Out, "),s=le(a[2])},l(c){t=r(c,"SPAN",{});var b=P(t);e=ne(b,"Sign Out, "),s=ne(b,a[2]),b.forEach(_)},m(c,b){Z(c,t,b),n(t,e),n(t,s)},p(c,b){b&4&&me(s,c[2])},d(c){c&&_(t)}}}function Oe(a){let t,e,s=a[1]?"logged in":"not logged in",c,b;return{c(){t=i("span"),e=le("Checking... ("),c=le(s),b=le(")")},l(l){t=r(l,"SPAN",{});var u=P(t);e=ne(u,"Checking... ("),c=ne(u,s),b=ne(u,")"),u.forEach(_)},m(l,u){Z(l,t,u),n(t,e),n(t,c),n(t,b)},p(l,u){u&2&&s!==(s=l[1]?"logged in":"not logged in")&&me(c,s)},d(l){l&&_(t)}}}function we(a){let t,e='<div class="bg-blue-600 text-white text-sm rounded-lg p-3 shadow-lg relative"><div class="flex items-start gap-2"><svg class="w-4 h-4 mt-0.5 flex-shrink-0" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd"></path></svg> <div><p class="font-medium">Sign in required</p> <p class="text-blue-100 text-xs mt-1">You need to sign in to use HuggingFace Inference Providers for text-to-speech generation.</p></div></div> <div class="absolute top-full left-1/2 transform -translate-x-1/2"><div class="w-0 h-0 border-l-4 border-r-4 border-t-4 border-l-transparent border-r-transparent border-t-blue-600"></div></div></div>';return{c(){t=i("div"),t.innerHTML=e,this.h()},l(s){t=r(s,"DIV",{class:!0,"data-svelte-h":!0}),H(t)!=="svelte-drpr74"&&(t.innerHTML=e),this.h()},h(){o(t,"class","absolute bottom-full left-0 right-0 mb-2 z-50")},m(s,c){Z(s,t,c)},d(s){s&&_(t)}}}function ke(a){let t,e,s,c="Sign In with HuggingFace Token",b,l,u,G="<strong>Manual Token Entry:</strong> Please enter your HuggingFace token.",I,h,U=`1. Go to <a href="https://huggingface.co/settings/tokens" target="_blank" class="underline text-blue-600">HuggingFace Settings</a><br/>
|
| 2 |
+
2. Create a new token with "Inference API" permissions<br/>
|
| 3 |
+
3. Copy and paste it below`,Y,z,w,E,W="HuggingFace Token",J,m,K,Q,y,j,d="Cancel",f,k,R="Sign In",O,oe,T=a[6]&&ye(),g=a[5]&&Te(a);return{c(){t=i("div"),e=i("div"),s=i("h2"),s.textContent=c,b=x(),l=i("div"),u=i("p"),u.innerHTML=G,I=x(),h=i("p"),h.innerHTML=U,Y=x(),T&&T.c(),z=x(),w=i("div"),E=i("label"),E.textContent=W,J=x(),m=i("input"),K=x(),g&&g.c(),Q=x(),y=i("div"),j=i("button"),j.textContent=d,f=x(),k=i("button"),k.textContent=R,this.h()},l(A){t=r(A,"DIV",{class:!0});var F=P(t);e=r(F,"DIV",{class:!0});var L=P(e);s=r(L,"H2",{class:!0,"data-svelte-h":!0}),H(s)!=="svelte-1t0ehet"&&(s.textContent=c),b=v(L),l=r(L,"DIV",{class:!0});var C=P(l);u=r(C,"P",{class:!0,"data-svelte-h":!0}),H(u)!=="svelte-344vn4"&&(u.innerHTML=G),I=v(C),h=r(C,"P",{class:!0,"data-svelte-h":!0}),H(h)!=="svelte-1ffvpx3"&&(h.innerHTML=U),Y=v(C),T&&T.l(C),C.forEach(_),z=v(L),w=r(L,"DIV",{class:!0});var B=P(w);E=r(B,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),H(E)!=="svelte-vtbmxo"&&(E.textContent=W),J=v(B),m=r(B,"INPUT",{id:!0,type:!0,placeholder:!0,class:!0}),K=v(B),g&&g.l(B),B.forEach(_),Q=v(L),y=r(L,"DIV",{class:!0});var $=P(y);j=r($,"BUTTON",{class:!0,"data-svelte-h":!0}),H(j)!=="svelte-csk0rj"&&(j.textContent=d),f=v($),k=r($,"BUTTON",{class:!0,"data-svelte-h":!0}),H(k)!=="svelte-1nxas5u"&&(k.textContent=R),$.forEach(_),L.forEach(_),F.forEach(_),this.h()},h(){o(s,"class","text-xl font-semibold mb-4"),o(u,"class","text-blue-800 mb-2"),o(h,"class","text-blue-700"),o(l,"class","mb-4 p-3 bg-blue-50 rounded-md text-sm"),o(E,"for","token"),o(E,"class","block text-sm font-medium text-gray-700 mb-2"),o(m,"id","token"),o(m,"type","password"),o(m,"placeholder","hf_..."),o(m,"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"),o(w,"class","mb-4"),o(j,"class","px-4 py-2 text-gray-600 hover:text-gray-800 transition-colors"),o(k,"class","px-4 py-2 bg-orange-500 text-white rounded-md hover:bg-orange-600 transition-colors"),o(y,"class","flex justify-end gap-3"),o(e,"class","bg-white rounded-lg p-6 max-w-md w-full mx-4 shadow-xl"),o(t,"class","fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50")},m(A,F){Z(A,t,F),n(t,e),n(e,s),n(e,b),n(e,l),n(l,u),n(l,I),n(l,h),n(l,Y),T&&T.m(l,null),n(e,z),n(e,w),n(w,E),n(w,J),n(w,m),xe(m,a[4]),n(w,K),g&&g.m(w,null),n(e,Q),n(e,y),n(y,j),n(y,f),n(y,k),O||(oe=[se(m,"input",a[15]),se(m,"keydown",a[16]),se(j,"click",a[10]),se(k,"click",a[11])],O=!0)},p(A,F){A[6]?T||(T=ye(),T.c(),T.m(l,null)):T&&(T.d(1),T=null),F&16&&m.value!==A[4]&&xe(m,A[4]),A[5]?g?g.p(A,F):(g=Te(A),g.c(),g.m(w,null)):g&&(g.d(1),g=null)},d(A){A&&_(t),T&&T.d(),g&&g.d(),O=!1,Ce(oe)}}}function ye(a){let t,e="<strong>Tip:</strong> You can also run <code>huggingface-cli login</code> in your terminal to automatically use your local token.";return{c(){t=i("p"),t.innerHTML=e,this.h()},l(s){t=r(s,"P",{class:!0,"data-svelte-h":!0}),H(t)!=="svelte-1gg2uwy"&&(t.innerHTML=e),this.h()},h(){o(t,"class","text-blue-600 mt-2")},m(s,c){Z(s,t,c)},d(s){s&&_(t)}}}function Te(a){let t,e;return{c(){t=i("p"),e=le(a[5]),this.h()},l(s){t=r(s,"P",{class:!0});var c=P(t);e=ne(c,a[5]),c.forEach(_),this.h()},h(){o(t,"class","text-red-600 text-sm mt-1")},m(s,c){Z(s,t,c),n(t,e)},p(s,c){c&32&&me(e,s[5])},d(s){s&&_(t)}}}function ze(a){let t,e,s,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>',b,l,u,G="Tasks",I,h,U,Y="ποΈ",z,w,E="Text to Speech",W,J,m,K="<span>π΅</span> <span>Voice Cloning</span>",Q,y,j="<span>π§</span> <span>Speech to Text</span>",d,f,k="<span>πΌ</span> <span>Sound Effects</span>",R,O,oe="<span>πΈ</span> <span>Music Generation</span>",T,g,A="<span>π</span> <span>Audio Enhancement</span>",F,L,C,B,$,ue,fe,de,ee,pe,X,he,_e;function be(p,M){return p[7]?Oe:p[1]?Ve:je}let ae=be(a),q=ae(a),N=a[8]&&!a[1]&&we();const ge=a[13].default,V=Ee(ge,a,a[12],null);let S=a[3]&&ke(a);return{c(){t=i("div"),e=i("aside"),s=i("div"),s.innerHTML=c,b=x(),l=i("nav"),u=i("div"),u.textContent=G,I=x(),h=i("button"),U=i("span"),U.textContent=Y,z=x(),w=i("span"),w.textContent=E,J=x(),m=i("button"),m.innerHTML=K,Q=x(),y=i("button"),y.innerHTML=j,d=x(),f=i("button"),f.innerHTML=k,R=x(),O=i("button"),O.innerHTML=oe,T=x(),g=i("button"),g.innerHTML=A,F=x(),L=i("div"),C=i("button"),B=i("img"),ue=x(),q.c(),fe=x(),N&&N.c(),de=x(),ee=i("main"),V&&V.c(),pe=x(),S&&S.c(),this.h()},l(p){t=r(p,"DIV",{class:!0});var M=P(t);e=r(M,"ASIDE",{class:!0});var te=P(e);s=r(te,"DIV",{class:!0,"data-svelte-h":!0}),H(s)!=="svelte-1vahj38"&&(s.innerHTML=c),b=v(te),l=r(te,"NAV",{class:!0});var D=P(l);u=r(D,"DIV",{class:!0,"data-svelte-h":!0}),H(u)!=="svelte-1x5465q"&&(u.textContent=G),I=v(D),h=r(D,"BUTTON",{class:!0});var re=P(h);U=r(re,"SPAN",{"data-svelte-h":!0}),H(U)!=="svelte-1yx42xi"&&(U.textContent=Y),z=v(re),w=r(re,"SPAN",{"data-svelte-h":!0}),H(w)!=="svelte-2j89jk"&&(w.textContent=E),re.forEach(_),J=v(D),m=r(D,"BUTTON",{class:!0,"data-svelte-h":!0}),H(m)!=="svelte-10dl8nf"&&(m.innerHTML=K),Q=v(D),y=r(D,"BUTTON",{class:!0,"data-svelte-h":!0}),H(y)!=="svelte-wf0x5d"&&(y.innerHTML=j),d=v(D),f=r(D,"BUTTON",{class:!0,"data-svelte-h":!0}),H(f)!=="svelte-x7bha3"&&(f.innerHTML=k),R=v(D),O=r(D,"BUTTON",{class:!0,"data-svelte-h":!0}),H(O)!=="svelte-1tyblmt"&&(O.innerHTML=oe),T=v(D),g=r(D,"BUTTON",{class:!0,"data-svelte-h":!0}),H(g)!=="svelte-1emrjb3"&&(g.innerHTML=A),D.forEach(_),F=v(te),L=r(te,"DIV",{class:!0});var ie=P(L);C=r(ie,"BUTTON",{class:!0});var ce=P(C);B=r(ce,"IMG",{src:!0,alt:!0,class:!0}),ue=v(ce),q.l(ce),ce.forEach(_),fe=v(ie),N&&N.l(ie),ie.forEach(_),te.forEach(_),de=v(M),ee=r(M,"MAIN",{class:!0});var ve=P(ee);V&&V.l(ve),ve.forEach(_),pe=v(M),S&&S.l(M),M.forEach(_),this.h()},h(){o(s,"class","p-4 border-b border-gray-200"),o(u,"class","mt-2 mb-1 px-2 text-xs font-medium text-gray-500 uppercase"),o(h,"class",W="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left "+(a[0]==="tts"?"bg-gray-100":"")),o(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,o(y,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),y.disabled=!0,o(f,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),f.disabled=!0,o(O,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),O.disabled=!0,o(g,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),g.disabled=!0,o(l,"class","p-2 text-sm flex-1"),Ue(B.src,$="/assets/hf-logo.png")||o(B,"src",$),o(B,"alt","HF Logo"),o(B,"class","w-5 h-5"),C.disabled=a[7],o(C,"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"),o(L,"class","p-2 relative"),o(e,"class","w-56 border-r border-gray-200 bg-white flex-shrink-0 flex flex-col h-full "),o(ee,"class","flex-1 overflow-auto"),o(t,"class","flex h-screen bg-white")},m(p,M){Z(p,t,M),n(t,e),n(e,s),n(e,b),n(e,l),n(l,u),n(l,I),n(l,h),n(h,U),n(h,z),n(h,w),n(l,J),n(l,m),n(l,Q),n(l,y),n(l,d),n(l,f),n(l,R),n(l,O),n(l,T),n(l,g),n(e,F),n(e,L),n(L,C),n(C,B),n(C,ue),q.m(C,null),n(L,fe),N&&N.m(L,null),n(t,de),n(t,ee),V&&V.m(ee,null),n(t,pe),S&&S.m(t,null),X=!0,he||(_e=[se(h,"click",a[14]),se(C,"click",a[9])],he=!0)},p(p,[M]){(!X||M&1&&W!==(W="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left "+(p[0]==="tts"?"bg-gray-100":"")))&&o(h,"class",W),ae===(ae=be(p))&&q?q.p(p,M):(q.d(1),q=ae(p),q&&(q.c(),q.m(C,null))),(!X||M&128)&&(C.disabled=p[7]),p[8]&&!p[1]?N||(N=we(),N.c(),N.m(L,null)):N&&(N.d(1),N=null),V&&V.p&&(!X||M&4096)&&Ae(V,ge,p,p[12],X?Pe(ge,p[12],M,null):Ne(p[12]),null),p[3]?S?S.p(p,M):(S=ke(p),S.c(),S.m(t,null)):S&&(S.d(1),S=null)},i(p){X||(Me(V,p),X=!0)},o(p){Se(V,p),X=!1},d(p){p&&_(t),q.d(),N&&N.d(),V&&V.d(p),S&&S.d(),he=!1,Ce(_e)}}}function Fe(a,t,e){let{$$slots:s={},$$scope:c}=t,b="tts",l=!1,u="",G=!1,I="",h="",U=!1,Y=!0,z=!1;Be(()=>{window.addEventListener("show-signin-popover",()=>{e(8,z=!0),setTimeout(()=>{e(8,z=!1)},4e3)}),w(),E(),document.addEventListener("visibilitychange",()=>{document.hidden||E()}),window.addEventListener("storage",E);const d=setInterval(E,1e3);return()=>{window.removeEventListener("storage",E),clearInterval(d)}});async function w(){try{const f=await(await fetch("/api/auth/local-token")).json();f.available?(e(6,U=!0),localStorage.setItem("hf_access_token",f.token),f.user_info&&f.user_info.name!=="Local User"?(e(1,l=!0),e(2,u=f.user_info.name.split(" ")[0])):(e(1,l=!0),e(2,u="Local User"))):e(6,U=!1)}catch{e(6,U=!1)}finally{e(7,Y=!1)}}function E(){const d=localStorage.getItem("hf_access_token");d&&!l?W(d):d||(e(1,l=!1),e(2,u=""))}async function W(d){try{const f=await fetch("https://huggingface.co/api/whoami-v2",{headers:{Authorization:`Bearer ${d}`}});if(f.ok){const k=await f.json();e(1,l=!0);const R=k.name||k.fullname||k.login||k.username||"User";e(2,u=R.split(" ")[0])}else localStorage.removeItem("hf_access_token"),e(1,l=!1),e(2,u="")}catch{localStorage.removeItem("hf_access_token"),e(1,l=!1),e(2,u="")}}async function J(){if(l)localStorage.removeItem("hf_access_token"),sessionStorage.removeItem("oauth_state"),e(1,l=!1),e(2,u="");else if(window.location.hostname.includes("hf.space")||window.location.hostname.includes("huggingface.co"))try{const f=await(await fetch("/api/auth/oauth-config")).json(),k=f.scopes||"read-repos write-repos manage-repos inference-api",R=`https://huggingface.co/oauth/authorize?client_id=${f.client_id}&redirect_uri=${encodeURIComponent(window.location.origin+"/auth/callback")}&scope=${encodeURIComponent(k)}&response_type=code&state=${Date.now()}`;window.location.href=R}catch{e(3,G=!0),e(4,I=""),e(5,h="")}else e(3,G=!0),e(4,I=""),e(5,h="")}function m(){e(3,G=!1),e(4,I=""),e(5,h="")}async function K(){if(!I.trim()){e(5,h="Please enter a token");return}if(!I.startsWith("hf_")){e(5,h='Token should start with "hf_"');return}try{const d=await fetch("https://huggingface.co/api/whoami-v2",{headers:{Authorization:`Bearer ${I.trim()}`}});if(d.ok){const f=await d.json();localStorage.setItem("hf_access_token",I.trim()),e(1,l=!0);const k=f.name||f.fullname||f.login||f.username||"User";e(2,u=k.split(" ")[0]),m()}else e(5,h=`Invalid token (${d.status}). Please check your token and try again.`)}catch{e(5,h="Error validating token. Please try again.")}}const Q=()=>e(0,b="tts");function y(){I=this.value,e(4,I)}const j=d=>d.key==="Enter"&&K();return a.$$set=d=>{"$$scope"in d&&e(12,c=d.$$scope)},[b,l,u,G,I,h,U,Y,z,J,m,K,c,s,Q,y,j]}class Re extends Ie{constructor(t){super(),Le(this,t,Fe,ze,He,{})}}export{Re as component};
|
hfstudio/static/_app/immutable/nodes/1.ChkqOOWS.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{S as x,i as S,s as q,A as _,d as u,x as d,f as m,h as f,k as g,m as h,y as v,o as y,p as $,z as E,q as k,B as z}from"../chunks/Bqgpa-5T.js";import"../chunks/IHki7fMi.js";import{s as A}from"../chunks/XKv6HzUC.js";const B=()=>{const s=A;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},C={subscribe(s){return B().page.subscribe(s)}};function H(s){var b;let t,r=s[0].status+"",o,n,i,p=((b=s[0].error)==null?void 0:b.message)+"",l;return{c(){t=$("h1"),o=E(r),n=k(),i=$("p"),l=E(p)},l(e){t=g(e,"H1",{});var a=h(t);o=v(a,r),a.forEach(u),n=y(e),i=g(e,"P",{});var c=h(i);l=v(c,p),c.forEach(u)},m(e,a){m(e,t,a),f(t,o),m(e,n,a),m(e,i,a),f(i,l)},p(e,[a]){var c;a&1&&r!==(r=e[0].status+"")&&d(o,r),a&1&&p!==(p=((c=e[0].error)==null?void 0:c.message)+"")&&d(l,p)},i:_,o:_,d(e){e&&(u(t),u(n),u(i))}}}function P(s,t,r){let o;return z(s,C,n=>r(0,o=n)),[o]}let F=class extends x{constructor(t){super(),S(this,t,P,H,q,{})}};export{F as component};
|
hfstudio/static/_app/immutable/nodes/2.Eqbep-qD.js
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{r as Tt,a as k,t as $,S as Me,i as Ue,s as Pe,c as Ge,O as R,d as u,P as jt,u as Fe,g as Re,e as We,Q as Lt,f as se,h as a,R as Nl,m,E as Nt,T as Tl,U as Qt,V as ce,I as Q,K as Z,L as ee,J as te,b as c,D as ct,l as ie,k as d,y as K,o as x,p as h,z as J,q as S,w as zt,x as ze,C as ut,n as He,N as Cl,W as Zt,M as Ot,A as vt,j as el}from"../chunks/Bqgpa-5T.js";import"../chunks/IHki7fMi.js";function pt(r){return(r==null?void 0:r.length)!==void 0?r:Array.from(r)}function Dl(r,e){$(r,1,1,()=>{e.delete(r.key)})}function Vl(r,e,s,t,l,n,o,i,f,b,y,w){let g=r.length,p=n.length,v=g;const M={};for(;v--;)M[r[v].key]=v;const T=[],A=new Map,L=new Map,q=[];for(v=p;v--;){const I=w(l,n,v),j=s(I);let z=o.get(j);z?q.push(()=>z.p(I,e)):(z=b(j,I),z.c()),A.set(j,T[v]=z),j in M&&L.set(j,Math.abs(v-M[j]))}const N=new Set,D=new Set;function H(I){k(I,1),I.m(i,y),o.set(I.key,I),y=I.first,p--}for(;g&&p;){const I=T[p-1],j=r[g-1],z=I.key,le=j.key;I===j?(y=I.first,g--,p--):A.has(le)?!o.has(z)||N.has(z)?H(I):D.has(le)?g--:L.get(z)>L.get(le)?(D.add(z),H(I)):(N.add(le),g--):(f(j,o),g--)}for(;g--;){const I=r[g];A.has(I.key)||f(I,o)}for(;p;)H(T[p-1]);return Tt(q),T}function Oe(r,e){const s={},t={},l={$$scope:1};let n=r.length;for(;n--;){const o=r[n],i=e[n];if(i){for(const f in o)f in i||(t[f]=1);for(const f in i)l[f]||(s[f]=i[f],l[f]=1);r[n]=i}else for(const f in o)l[f]=1}for(const o in t)o in s||(s[o]=void 0);return s}function Ye(r){return typeof r=="object"&&r!==null?r:{}}/**
|
| 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 tl={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 ll(r,e,s){const t=r.slice();return t[10]=e[s][0],t[11]=e[s][1],t}function Ft(r){let e,s=[r[11]],t={};for(let l=0;l<s.length;l+=1)t=R(t,s[l]);return{c(){e=Tl(r[10]),this.h()},l(l){e=Nl(l,r[10],{}),m(e).forEach(u),this.h()},h(){Lt(e,t)},m(l,n){se(l,e,n)},p(l,n){Lt(e,t=Oe(s,[n&32&&l[11]]))},d(l){l&&u(e)}}}function nl(r){let e=r[10],s,t=r[10]&&Ft(r);return{c(){t&&t.c(),s=Nt()},l(l){t&&t.l(l),s=Nt()},m(l,n){t&&t.m(l,n),se(l,s,n)},p(l,n){l[10]?e?Pe(e,l[10])?(t.d(1),t=Ft(l),e=l[10],t.c(),t.m(s.parentNode,s)):t.p(l,n):(t=Ft(l),e=l[10],t.c(),t.m(s.parentNode,s)):e&&(t.d(1),t=null,e=l[10])},d(l){l&&u(s),t&&t.d(l)}}}function xl(r){let e,s,t,l,n,o=pt(r[5]),i=[];for(let g=0;g<o.length;g+=1)i[g]=nl(ll(r,o,g));const f=r[9].default,b=Ge(f,r,r[8],null);let y=[tl,r[6],{width:r[2]},{height:r[2]},{stroke:r[1]},{"stroke-width":t=r[4]?Number(r[3])*24/Number(r[2]):r[3]},{class:l=`lucide-icon lucide lucide-${r[0]} ${r[7].class??""}`}],w={};for(let g=0;g<y.length;g+=1)w=R(w,y[g]);return{c(){e=Tl("svg");for(let g=0;g<i.length;g+=1)i[g].c();s=Nt(),b&&b.c(),this.h()},l(g){e=Nl(g,"svg",{width:!0,height:!0,stroke:!0,"stroke-width":!0,class:!0});var p=m(e);for(let v=0;v<i.length;v+=1)i[v].l(p);s=Nt(),b&&b.l(p),p.forEach(u),this.h()},h(){Lt(e,w)},m(g,p){se(g,e,p);for(let v=0;v<i.length;v+=1)i[v]&&i[v].m(e,null);a(e,s),b&&b.m(e,null),n=!0},p(g,[p]){if(p&32){o=pt(g[5]);let v;for(v=0;v<o.length;v+=1){const M=ll(g,o,v);i[v]?i[v].p(M,p):(i[v]=nl(M),i[v].c(),i[v].m(e,s))}for(;v<i.length;v+=1)i[v].d(1);i.length=o.length}b&&b.p&&(!n||p&256)&&Fe(b,f,g,g[8],n?We(f,g[8],p,null):Re(g[8]),null),Lt(e,w=Oe(y,[tl,p&64&&g[6],(!n||p&4)&&{width:g[2]},(!n||p&4)&&{height:g[2]},(!n||p&2)&&{stroke:g[1]},(!n||p&28&&t!==(t=g[4]?Number(g[3])*24/Number(g[2]):g[3]))&&{"stroke-width":t},(!n||p&129&&l!==(l=`lucide-icon lucide lucide-${g[0]} ${g[7].class??""}`))&&{class:l}]))},i(g){n||(k(b,g),n=!0)},o(g){$(b,g),n=!1},d(g){g&&u(e),jt(i,g),b&&b.d(g)}}}function Sl(r,e,s){const t=["name","color","size","strokeWidth","absoluteStrokeWidth","iconNode"];let l=Qt(e,t),{$$slots:n={},$$scope:o}=e,{name:i}=e,{color:f="currentColor"}=e,{size:b=24}=e,{strokeWidth:y=2}=e,{absoluteStrokeWidth:w=!1}=e,{iconNode:g}=e;return r.$$set=p=>{s(7,e=R(R({},e),ce(p))),s(6,l=Qt(e,t)),"name"in p&&s(0,i=p.name),"color"in p&&s(1,f=p.color),"size"in p&&s(2,b=p.size),"strokeWidth"in p&&s(3,y=p.strokeWidth),"absoluteStrokeWidth"in p&&s(4,w=p.absoluteStrokeWidth),"iconNode"in p&&s(5,g=p.iconNode),"$$scope"in p&&s(8,o=p.$$scope)},e=ce(e),[i,f,b,y,w,g,l,e,o,n]}class Qe extends Me{constructor(e){super(),Ue(this,e,Sl,xl,Pe,{name:0,color:1,size:2,strokeWidth:3,absoluteStrokeWidth:4,iconNode:5})}}function Pl(r){let e;const s=r[2].default,t=Ge(s,r,r[3],null);return{c(){t&&t.c()},l(l){t&&t.l(l)},m(l,n){t&&t.m(l,n),e=!0},p(l,n){t&&t.p&&(!e||n&8)&&Fe(t,s,l,l[3],e?We(s,l[3],n,null):Re(l[3]),null)},i(l){e||(k(t,l),e=!0)},o(l){$(t,l),e=!1},d(l){t&&t.d(l)}}}function Al(r){let e,s;const t=[{name:"alert-circle"},r[1],{iconNode:r[0]}];let l={$$slots:{default:[Pl]},$$scope:{ctx:r}};for(let n=0;n<t.length;n+=1)l=R(l,t[n]);return e=new Qe({props:l}),{c(){te(e.$$.fragment)},l(n){ee(e.$$.fragment,n)},m(n,o){Z(e,n,o),s=!0},p(n,[o]){const i=o&3?Oe(t,[t[0],o&2&&Ye(n[1]),o&1&&{iconNode:n[0]}]):{};o&8&&(i.$$scope={dirty:o,ctx:n}),e.$set(i)},i(n){s||(k(e.$$.fragment,n),s=!0)},o(n){$(e.$$.fragment,n),s=!1},d(n){Q(e,n)}}}function zl(r,e,s){let{$$slots:t={},$$scope:l}=e;const n=[["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 r.$$set=o=>{s(1,e=R(R({},e),ce(o))),"$$scope"in o&&s(3,l=o.$$scope)},e=ce(e),[n,e,t,l]}class Ml extends Me{constructor(e){super(),Ue(this,e,zl,Al,Pe,{})}}function Ul(r){let e;const s=r[2].default,t=Ge(s,r,r[3],null);return{c(){t&&t.c()},l(l){t&&t.l(l)},m(l,n){t&&t.m(l,n),e=!0},p(l,n){t&&t.p&&(!e||n&8)&&Fe(t,s,l,l[3],e?We(s,l[3],n,null):Re(l[3]),null)},i(l){e||(k(t,l),e=!0)},o(l){$(t,l),e=!1},d(l){t&&t.d(l)}}}function Ol(r){let e,s;const t=[{name:"chevron-down"},r[1],{iconNode:r[0]}];let l={$$slots:{default:[Ul]},$$scope:{ctx:r}};for(let n=0;n<t.length;n+=1)l=R(l,t[n]);return e=new Qe({props:l}),{c(){te(e.$$.fragment)},l(n){ee(e.$$.fragment,n)},m(n,o){Z(e,n,o),s=!0},p(n,[o]){const i=o&3?Oe(t,[t[0],o&2&&Ye(n[1]),o&1&&{iconNode:n[0]}]):{};o&8&&(i.$$scope={dirty:o,ctx:n}),e.$set(i)},i(n){s||(k(e.$$.fragment,n),s=!0)},o(n){$(e.$$.fragment,n),s=!1},d(n){Q(e,n)}}}function Bl(r,e,s){let{$$slots:t={},$$scope:l}=e;const n=[["path",{d:"m6 9 6 6 6-6"}]];return r.$$set=o=>{s(1,e=R(R({},e),ce(o))),"$$scope"in o&&s(3,l=o.$$scope)},e=ce(e),[n,e,t,l]}class jl extends Me{constructor(e){super(),Ue(this,e,Bl,Ol,Pe,{})}}function Ll(r){let e;const s=r[2].default,t=Ge(s,r,r[3],null);return{c(){t&&t.c()},l(l){t&&t.l(l)},m(l,n){t&&t.m(l,n),e=!0},p(l,n){t&&t.p&&(!e||n&8)&&Fe(t,s,l,l[3],e?We(s,l[3],n,null):Re(l[3]),null)},i(l){e||(k(t,l),e=!0)},o(l){$(t,l),e=!1},d(l){t&&t.d(l)}}}function Hl(r){let e,s;const t=[{name:"code"},r[1],{iconNode:r[0]}];let l={$$slots:{default:[Ll]},$$scope:{ctx:r}};for(let n=0;n<t.length;n+=1)l=R(l,t[n]);return e=new Qe({props:l}),{c(){te(e.$$.fragment)},l(n){ee(e.$$.fragment,n)},m(n,o){Z(e,n,o),s=!0},p(n,[o]){const i=o&3?Oe(t,[t[0],o&2&&Ye(n[1]),o&1&&{iconNode:n[0]}]):{};o&8&&(i.$$scope={dirty:o,ctx:n}),e.$set(i)},i(n){s||(k(e.$$.fragment,n),s=!0)},o(n){$(e.$$.fragment,n),s=!1},d(n){Q(e,n)}}}function Gl(r,e,s){let{$$slots:t={},$$scope:l}=e;const n=[["polyline",{points:"16 18 22 12 16 6"}],["polyline",{points:"8 6 2 12 8 18"}]];return r.$$set=o=>{s(1,e=R(R({},e),ce(o))),"$$scope"in o&&s(3,l=o.$$scope)},e=ce(e),[n,e,t,l]}class Fl extends Me{constructor(e){super(),Ue(this,e,Gl,Hl,Pe,{})}}function Rl(r){let e;const s=r[2].default,t=Ge(s,r,r[3],null);return{c(){t&&t.c()},l(l){t&&t.l(l)},m(l,n){t&&t.m(l,n),e=!0},p(l,n){t&&t.p&&(!e||n&8)&&Fe(t,s,l,l[3],e?We(s,l[3],n,null):Re(l[3]),null)},i(l){e||(k(t,l),e=!0)},o(l){$(t,l),e=!1},d(l){t&&t.d(l)}}}function Wl(r){let e,s;const t=[{name:"copy"},r[1],{iconNode:r[0]}];let l={$$slots:{default:[Rl]},$$scope:{ctx:r}};for(let n=0;n<t.length;n+=1)l=R(l,t[n]);return e=new Qe({props:l}),{c(){te(e.$$.fragment)},l(n){ee(e.$$.fragment,n)},m(n,o){Z(e,n,o),s=!0},p(n,[o]){const i=o&3?Oe(t,[t[0],o&2&&Ye(n[1]),o&1&&{iconNode:n[0]}]):{};o&8&&(i.$$scope={dirty:o,ctx:n}),e.$set(i)},i(n){s||(k(e.$$.fragment,n),s=!0)},o(n){$(e.$$.fragment,n),s=!1},d(n){Q(e,n)}}}function ql(r,e,s){let{$$slots:t={},$$scope:l}=e;const n=[["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 r.$$set=o=>{s(1,e=R(R({},e),ce(o))),"$$scope"in o&&s(3,l=o.$$scope)},e=ce(e),[n,e,t,l]}class Rt extends Me{constructor(e){super(),Ue(this,e,ql,Wl,Pe,{})}}function Kl(r){let e;const s=r[2].default,t=Ge(s,r,r[3],null);return{c(){t&&t.c()},l(l){t&&t.l(l)},m(l,n){t&&t.m(l,n),e=!0},p(l,n){t&&t.p&&(!e||n&8)&&Fe(t,s,l,l[3],e?We(s,l[3],n,null):Re(l[3]),null)},i(l){e||(k(t,l),e=!0)},o(l){$(t,l),e=!1},d(l){t&&t.d(l)}}}function Jl(r){let e,s;const t=[{name:"download"},r[1],{iconNode:r[0]}];let l={$$slots:{default:[Kl]},$$scope:{ctx:r}};for(let n=0;n<t.length;n+=1)l=R(l,t[n]);return e=new Qe({props:l}),{c(){te(e.$$.fragment)},l(n){ee(e.$$.fragment,n)},m(n,o){Z(e,n,o),s=!0},p(n,[o]){const i=o&3?Oe(t,[t[0],o&2&&Ye(n[1]),o&1&&{iconNode:n[0]}]):{};o&8&&(i.$$scope={dirty:o,ctx:n}),e.$set(i)},i(n){s||(k(e.$$.fragment,n),s=!0)},o(n){$(e.$$.fragment,n),s=!1},d(n){Q(e,n)}}}function Xl(r,e,s){let{$$slots:t={},$$scope:l}=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 r.$$set=o=>{s(1,e=R(R({},e),ce(o))),"$$scope"in o&&s(3,l=o.$$scope)},e=ce(e),[n,e,t,l]}class sl extends Me{constructor(e){super(),Ue(this,e,Xl,Jl,Pe,{})}}function Yl(r){let e;const s=r[2].default,t=Ge(s,r,r[3],null);return{c(){t&&t.c()},l(l){t&&t.l(l)},m(l,n){t&&t.m(l,n),e=!0},p(l,n){t&&t.p&&(!e||n&8)&&Fe(t,s,l,l[3],e?We(s,l[3],n,null):Re(l[3]),null)},i(l){e||(k(t,l),e=!0)},o(l){$(t,l),e=!1},d(l){t&&t.d(l)}}}function Ql(r){let e,s;const t=[{name:"loader-2"},r[1],{iconNode:r[0]}];let l={$$slots:{default:[Yl]},$$scope:{ctx:r}};for(let n=0;n<t.length;n+=1)l=R(l,t[n]);return e=new Qe({props:l}),{c(){te(e.$$.fragment)},l(n){ee(e.$$.fragment,n)},m(n,o){Z(e,n,o),s=!0},p(n,[o]){const i=o&3?Oe(t,[t[0],o&2&&Ye(n[1]),o&1&&{iconNode:n[0]}]):{};o&8&&(i.$$scope={dirty:o,ctx:n}),e.$set(i)},i(n){s||(k(e.$$.fragment,n),s=!0)},o(n){$(e.$$.fragment,n),s=!1},d(n){Q(e,n)}}}function Zl(r,e,s){let{$$slots:t={},$$scope:l}=e;const n=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56"}]];return r.$$set=o=>{s(1,e=R(R({},e),ce(o))),"$$scope"in o&&s(3,l=o.$$scope)},e=ce(e),[n,e,t,l]}class en extends Me{constructor(e){super(),Ue(this,e,Zl,Ql,Pe,{})}}function tn(r){let e;const s=r[2].default,t=Ge(s,r,r[3],null);return{c(){t&&t.c()},l(l){t&&t.l(l)},m(l,n){t&&t.m(l,n),e=!0},p(l,n){t&&t.p&&(!e||n&8)&&Fe(t,s,l,l[3],e?We(s,l[3],n,null):Re(l[3]),null)},i(l){e||(k(t,l),e=!0)},o(l){$(t,l),e=!1},d(l){t&&t.d(l)}}}function ln(r){let e,s;const t=[{name:"more-horizontal"},r[1],{iconNode:r[0]}];let l={$$slots:{default:[tn]},$$scope:{ctx:r}};for(let n=0;n<t.length;n+=1)l=R(l,t[n]);return e=new Qe({props:l}),{c(){te(e.$$.fragment)},l(n){ee(e.$$.fragment,n)},m(n,o){Z(e,n,o),s=!0},p(n,[o]){const i=o&3?Oe(t,[t[0],o&2&&Ye(n[1]),o&1&&{iconNode:n[0]}]):{};o&8&&(i.$$scope={dirty:o,ctx:n}),e.$set(i)},i(n){s||(k(e.$$.fragment,n),s=!0)},o(n){$(e.$$.fragment,n),s=!1},d(n){Q(e,n)}}}function nn(r,e,s){let{$$slots:t={},$$scope:l}=e;const n=[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"19",cy:"12",r:"1"}],["circle",{cx:"5",cy:"12",r:"1"}]];return r.$$set=o=>{s(1,e=R(R({},e),ce(o))),"$$scope"in o&&s(3,l=o.$$scope)},e=ce(e),[n,e,t,l]}class sn extends Me{constructor(e){super(),Ue(this,e,nn,ln,Pe,{})}}function rn(r){let e;const s=r[2].default,t=Ge(s,r,r[3],null);return{c(){t&&t.c()},l(l){t&&t.l(l)},m(l,n){t&&t.m(l,n),e=!0},p(l,n){t&&t.p&&(!e||n&8)&&Fe(t,s,l,l[3],e?We(s,l[3],n,null):Re(l[3]),null)},i(l){e||(k(t,l),e=!0)},o(l){$(t,l),e=!1},d(l){t&&t.d(l)}}}function on(r){let e,s;const t=[{name:"panels-top-left"},r[1],{iconNode:r[0]}];let l={$$slots:{default:[rn]},$$scope:{ctx:r}};for(let n=0;n<t.length;n+=1)l=R(l,t[n]);return e=new Qe({props:l}),{c(){te(e.$$.fragment)},l(n){ee(e.$$.fragment,n)},m(n,o){Z(e,n,o),s=!0},p(n,[o]){const i=o&3?Oe(t,[t[0],o&2&&Ye(n[1]),o&1&&{iconNode:n[0]}]):{};o&8&&(i.$$scope={dirty:o,ctx:n}),e.$set(i)},i(n){s||(k(e.$$.fragment,n),s=!0)},o(n){$(e.$$.fragment,n),s=!1},d(n){Q(e,n)}}}function an(r,e,s){let{$$slots:t={},$$scope:l}=e;const n=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M3 9h18"}],["path",{d:"M9 21V9"}]];return r.$$set=o=>{s(1,e=R(R({},e),ce(o))),"$$scope"in o&&s(3,l=o.$$scope)},e=ce(e),[n,e,t,l]}class cn extends Me{constructor(e){super(),Ue(this,e,an,on,Pe,{})}}function un(r){let e;const s=r[2].default,t=Ge(s,r,r[3],null);return{c(){t&&t.c()},l(l){t&&t.l(l)},m(l,n){t&&t.m(l,n),e=!0},p(l,n){t&&t.p&&(!e||n&8)&&Fe(t,s,l,l[3],e?We(s,l[3],n,null):Re(l[3]),null)},i(l){e||(k(t,l),e=!0)},o(l){$(t,l),e=!1},d(l){t&&t.d(l)}}}function fn(r){let e,s;const t=[{name:"pause"},r[1],{iconNode:r[0]}];let l={$$slots:{default:[un]},$$scope:{ctx:r}};for(let n=0;n<t.length;n+=1)l=R(l,t[n]);return e=new Qe({props:l}),{c(){te(e.$$.fragment)},l(n){ee(e.$$.fragment,n)},m(n,o){Z(e,n,o),s=!0},p(n,[o]){const i=o&3?Oe(t,[t[0],o&2&&Ye(n[1]),o&1&&{iconNode:n[0]}]):{};o&8&&(i.$$scope={dirty:o,ctx:n}),e.$set(i)},i(n){s||(k(e.$$.fragment,n),s=!0)},o(n){$(e.$$.fragment,n),s=!1},d(n){Q(e,n)}}}function dn(r,e,s){let{$$slots:t={},$$scope:l}=e;const n=[["rect",{width:"4",height:"16",x:"6",y:"4"}],["rect",{width:"4",height:"16",x:"14",y:"4"}]];return r.$$set=o=>{s(1,e=R(R({},e),ce(o))),"$$scope"in o&&s(3,l=o.$$scope)},e=ce(e),[n,e,t,l]}class hn extends Me{constructor(e){super(),Ue(this,e,dn,fn,Pe,{})}}function mn(r){let e;const s=r[2].default,t=Ge(s,r,r[3],null);return{c(){t&&t.c()},l(l){t&&t.l(l)},m(l,n){t&&t.m(l,n),e=!0},p(l,n){t&&t.p&&(!e||n&8)&&Fe(t,s,l,l[3],e?We(s,l[3],n,null):Re(l[3]),null)},i(l){e||(k(t,l),e=!0)},o(l){$(t,l),e=!1},d(l){t&&t.d(l)}}}function gn(r){let e,s;const t=[{name:"play"},r[1],{iconNode:r[0]}];let l={$$slots:{default:[mn]},$$scope:{ctx:r}};for(let n=0;n<t.length;n+=1)l=R(l,t[n]);return e=new Qe({props:l}),{c(){te(e.$$.fragment)},l(n){ee(e.$$.fragment,n)},m(n,o){Z(e,n,o),s=!0},p(n,[o]){const i=o&3?Oe(t,[t[0],o&2&&Ye(n[1]),o&1&&{iconNode:n[0]}]):{};o&8&&(i.$$scope={dirty:o,ctx:n}),e.$set(i)},i(n){s||(k(e.$$.fragment,n),s=!0)},o(n){$(e.$$.fragment,n),s=!1},d(n){Q(e,n)}}}function _n(r,e,s){let{$$slots:t={},$$scope:l}=e;const n=[["polygon",{points:"5 3 19 12 5 21 5 3"}]];return r.$$set=o=>{s(1,e=R(R({},e),ce(o))),"$$scope"in o&&s(3,l=o.$$scope)},e=ce(e),[n,e,t,l]}class Ht extends Me{constructor(e){super(),Ue(this,e,_n,gn,Pe,{})}}function pn(r){let e;const s=r[2].default,t=Ge(s,r,r[3],null);return{c(){t&&t.c()},l(l){t&&t.l(l)},m(l,n){t&&t.m(l,n),e=!0},p(l,n){t&&t.p&&(!e||n&8)&&Fe(t,s,l,l[3],e?We(s,l[3],n,null):Re(l[3]),null)},i(l){e||(k(t,l),e=!0)},o(l){$(t,l),e=!1},d(l){t&&t.d(l)}}}function vn(r){let e,s;const t=[{name:"share"},r[1],{iconNode:r[0]}];let l={$$slots:{default:[pn]},$$scope:{ctx:r}};for(let n=0;n<t.length;n+=1)l=R(l,t[n]);return e=new Qe({props:l}),{c(){te(e.$$.fragment)},l(n){ee(e.$$.fragment,n)},m(n,o){Z(e,n,o),s=!0},p(n,[o]){const i=o&3?Oe(t,[t[0],o&2&&Ye(n[1]),o&1&&{iconNode:n[0]}]):{};o&8&&(i.$$scope={dirty:o,ctx:n}),e.$set(i)},i(n){s||(k(e.$$.fragment,n),s=!0)},o(n){$(e.$$.fragment,n),s=!1},d(n){Q(e,n)}}}function bn(r,e,s){let{$$slots:t={},$$scope:l}=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 r.$$set=o=>{s(1,e=R(R({},e),ce(o))),"$$scope"in o&&s(3,l=o.$$scope)},e=ce(e),[n,e,t,l]}class rl extends Me{constructor(e){super(),Ue(this,e,bn,vn,Pe,{})}}function yn(r){let e;const s=r[2].default,t=Ge(s,r,r[3],null);return{c(){t&&t.c()},l(l){t&&t.l(l)},m(l,n){t&&t.m(l,n),e=!0},p(l,n){t&&t.p&&(!e||n&8)&&Fe(t,s,l,l[3],e?We(s,l[3],n,null):Re(l[3]),null)},i(l){e||(k(t,l),e=!0)},o(l){$(t,l),e=!1},d(l){t&&t.d(l)}}}function kn(r){let e,s;const t=[{name:"skip-back"},r[1],{iconNode:r[0]}];let l={$$slots:{default:[yn]},$$scope:{ctx:r}};for(let n=0;n<t.length;n+=1)l=R(l,t[n]);return e=new Qe({props:l}),{c(){te(e.$$.fragment)},l(n){ee(e.$$.fragment,n)},m(n,o){Z(e,n,o),s=!0},p(n,[o]){const i=o&3?Oe(t,[t[0],o&2&&Ye(n[1]),o&1&&{iconNode:n[0]}]):{};o&8&&(i.$$scope={dirty:o,ctx:n}),e.$set(i)},i(n){s||(k(e.$$.fragment,n),s=!0)},o(n){$(e.$$.fragment,n),s=!1},d(n){Q(e,n)}}}function $n(r,e,s){let{$$slots:t={},$$scope:l}=e;const n=[["polygon",{points:"19 20 9 12 19 4 19 20"}],["line",{x1:"5",x2:"5",y1:"19",y2:"5"}]];return r.$$set=o=>{s(1,e=R(R({},e),ce(o))),"$$scope"in o&&s(3,l=o.$$scope)},e=ce(e),[n,e,t,l]}class wn extends Me{constructor(e){super(),Ue(this,e,$n,kn,Pe,{})}}function En(r){let e;const s=r[2].default,t=Ge(s,r,r[3],null);return{c(){t&&t.c()},l(l){t&&t.l(l)},m(l,n){t&&t.m(l,n),e=!0},p(l,n){t&&t.p&&(!e||n&8)&&Fe(t,s,l,l[3],e?We(s,l[3],n,null):Re(l[3]),null)},i(l){e||(k(t,l),e=!0)},o(l){$(t,l),e=!1},d(l){t&&t.d(l)}}}function In(r){let e,s;const t=[{name:"skip-forward"},r[1],{iconNode:r[0]}];let l={$$slots:{default:[En]},$$scope:{ctx:r}};for(let n=0;n<t.length;n+=1)l=R(l,t[n]);return e=new Qe({props:l}),{c(){te(e.$$.fragment)},l(n){ee(e.$$.fragment,n)},m(n,o){Z(e,n,o),s=!0},p(n,[o]){const i=o&3?Oe(t,[t[0],o&2&&Ye(n[1]),o&1&&{iconNode:n[0]}]):{};o&8&&(i.$$scope={dirty:o,ctx:n}),e.$set(i)},i(n){s||(k(e.$$.fragment,n),s=!0)},o(n){$(e.$$.fragment,n),s=!1},d(n){Q(e,n)}}}function Nn(r,e,s){let{$$slots:t={},$$scope:l}=e;const n=[["polygon",{points:"5 4 15 12 5 20 5 4"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19"}]];return r.$$set=o=>{s(1,e=R(R({},e),ce(o))),"$$scope"in o&&s(3,l=o.$$scope)},e=ce(e),[n,e,t,l]}class Tn extends Me{constructor(e){super(),Ue(this,e,Nn,In,Pe,{})}}function Cn(r){let e;const s=r[2].default,t=Ge(s,r,r[3],null);return{c(){t&&t.c()},l(l){t&&t.l(l)},m(l,n){t&&t.m(l,n),e=!0},p(l,n){t&&t.p&&(!e||n&8)&&Fe(t,s,l,l[3],e?We(s,l[3],n,null):Re(l[3]),null)},i(l){e||(k(t,l),e=!0)},o(l){$(t,l),e=!1},d(l){t&&t.d(l)}}}function Dn(r){let e,s;const t=[{name:"x"},r[1],{iconNode:r[0]}];let l={$$slots:{default:[Cn]},$$scope:{ctx:r}};for(let n=0;n<t.length;n+=1)l=R(l,t[n]);return e=new Qe({props:l}),{c(){te(e.$$.fragment)},l(n){ee(e.$$.fragment,n)},m(n,o){Z(e,n,o),s=!0},p(n,[o]){const i=o&3?Oe(t,[t[0],o&2&&Ye(n[1]),o&1&&{iconNode:n[0]}]):{};o&8&&(i.$$scope={dirty:o,ctx:n}),e.$set(i)},i(n){s||(k(e.$$.fragment,n),s=!0)},o(n){$(e.$$.fragment,n),s=!1},d(n){Q(e,n)}}}function Vn(r,e,s){let{$$slots:t={},$$scope:l}=e;const n=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];return r.$$set=o=>{s(1,e=R(R({},e),ce(o))),"$$scope"in o&&s(3,l=o.$$scope)},e=ce(e),[n,e,t,l]}class xn extends Me{constructor(e){super(),Ue(this,e,Vn,Dn,Pe,{})}}function ol(r,e,s){const t=r.slice();return t[66]=e[s],t}function al(r,e,s){const t=r.slice();return t[58]=e[s],t}function il(r,e,s){const t=r.slice();return t[61]=e[s],t}function cl(r,e,s){const t=r.slice();return t[61]=e[s],t}function ul(r){let e;return{c(){e=h("span"),this.h()},l(s){e=d(s,"SPAN",{class:!0}),m(e).forEach(u),this.h()},h(){c(e,"class","flash-sweep svelte-zv1zz2")},m(s,t){se(s,e,t)},d(s){s&&u(e)}}}function Sn(r){let e,s,t,l,n,o="Integration Code",i,f,b,y,w,g,p,v,M,T,A,L,q,N,D,H,I,j,z;function le(U,W){return U[1]==="local"?zn:An}let V=le(r),C=V(r),_=r[3].length>0&&fl(r);const E=[Un,Mn],P=[];function re(U,W){return U[3].length===0?0:1}return D=re(r),H=P[D]=E[D](r),{c(){e=h("div"),s=h("div"),t=h("div"),l=h("div"),n=h("h2"),n.textContent=o,i=S(),f=h("p"),C.c(),b=S(),y=h("div"),w=h("div"),g=h("button"),p=J("API"),M=S(),T=h("button"),A=J("Local"),q=S(),_&&_.c(),N=S(),H.c(),this.h()},l(U){e=d(U,"DIV",{class:!0});var W=m(e);s=d(W,"DIV",{class:!0});var ne=m(s);t=d(ne,"DIV",{class:!0});var ae=m(t);l=d(ae,"DIV",{});var Y=m(l);n=d(Y,"H2",{class:!0,"data-svelte-h":!0}),He(n)!=="svelte-k26g76"&&(n.textContent=o),i=x(Y),f=d(Y,"P",{class:!0});var Ve=m(f);C.l(Ve),Ve.forEach(u),Y.forEach(u),b=x(ae),y=d(ae,"DIV",{class:!0});var ue=m(y);w=d(ue,"DIV",{class:!0});var be=m(w);g=d(be,"BUTTON",{class:!0});var Ne=m(g);p=K(Ne,"API"),Ne.forEach(u),M=x(be),T=d(be,"BUTTON",{class:!0});var ye=m(T);A=K(ye,"Local"),ye.forEach(u),be.forEach(u),q=x(ue),_&&_.l(ue),ue.forEach(u),ae.forEach(u),N=x(ne),H.l(ne),ne.forEach(u),W.forEach(u),this.h()},h(){c(n,"class","text-2xl font-semibold text-gray-900"),c(f,"class","text-sm text-gray-600 mt-1"),c(g,"class",v="px-3 py-1 text-sm font-medium rounded transition-colors "+(r[1]==="api"?"bg-white shadow-sm":"text-gray-600")),c(T,"class",L="px-3 py-1 text-sm font-medium rounded transition-colors "+(r[1]==="local"?"bg-white shadow-sm":"text-gray-600")),c(w,"class","flex items-center bg-gray-100 rounded-md p-0.5"),c(y,"class","flex items-center justify-between mt-4"),c(t,"class","mb-6"),c(s,"class","max-w-4xl mx-auto p-8"),c(e,"class","flex-1 bg-gray-50 overflow-y-auto")},m(U,W){se(U,e,W),a(e,s),a(s,t),a(t,l),a(l,n),a(l,i),a(l,f),C.m(f,null),a(t,b),a(t,y),a(y,w),a(w,g),a(g,p),a(w,M),a(w,T),a(T,A),a(y,q),_&&_.m(y,null),a(s,N),P[D].m(s,null),I=!0,j||(z=[ie(g,"click",r[49]),ie(T,"click",r[50])],j=!0)},p(U,W){V!==(V=le(U))&&(C.d(1),C=V(U),C&&(C.c(),C.m(f,null))),(!I||W[0]&2&&v!==(v="px-3 py-1 text-sm font-medium rounded transition-colors "+(U[1]==="api"?"bg-white shadow-sm":"text-gray-600")))&&c(g,"class",v),(!I||W[0]&2&&L!==(L="px-3 py-1 text-sm font-medium rounded transition-colors "+(U[1]==="local"?"bg-white shadow-sm":"text-gray-600")))&&c(T,"class",L),U[3].length>0?_?(_.p(U,W),W[0]&8&&k(_,1)):(_=fl(U),_.c(),k(_,1),_.m(y,null)):_&&(ut(),$(_,1,1,()=>{_=null}),ct());let ne=D;D=re(U),D===ne?P[D].p(U,W):(ut(),$(P[ne],1,1,()=>{P[ne]=null}),ct(),H=P[D],H?H.p(U,W):(H=P[D]=E[D](U),H.c()),k(H,1),H.m(s,null))},i(U){I||(k(_),k(H),I=!0)},o(U){$(_),$(H),I=!1},d(U){U&&u(e),C.d(),_&&_.d(),P[D].d(),j=!1,Tt(z)}}}function Pn(r){let e,s,t,l,n,o,i,f,b=r[0].length+"",y,w,g,p,v,M,T,A,L,q,N,D,H="Model",I,j,z,le,V,C,_,E,P='$0.025 per 1000 characters (<a href="https://huggingface.co/settings/billing" target="_blank" class="text-amber-600 hover:text-amber-700 underline">Hugging Face billing</a>)',re,U,W,ne='<h3 class="font-medium text-gray-900">Voice</h3>',ae,Y,Ve,ue,be='<div class="flex items-center gap-3 flex-1 min-w-0"><div class="w-10 h-10 bg-gray-400 rounded-full flex items-center justify-center text-white text-sm font-medium flex-shrink-0">+</div> <div class="flex-1 min-w-0"><div class="text-sm font-medium text-gray-600 mb-1">Clone your voice</div> <div class="text-xs text-gray-400">(coming soon)</div></div></div>',Ne,ye,fe,xe,$e,ft="Exaggeration",qe,we,Te=r[11].toFixed(2)+"",dt,Ze,pe,bt,Ee,rt="<span>None</span> <span>Exaggerated</span>",ot,Ae,Ke,Se,F="Stability",de,me,Ie=r[12].toFixed(2)+"",Je,at,ge,tt,Be,xt="<span>More stable</span> <span>More variable</span>",lt,nt,ht;const St=[Bn,On],je=[];function mt(O,X){return O[7]?0:1}v=mt(r),M=je[v]=St[v](r);let _e=r[8]&&ml(r),Ce=pt(r[22]),ke=[];for(let O=0;O<Ce.length;O+=1)ke[O]=pl(cl(r,Ce,O));V=new jl({props:{size:16,class:"text-gray-500"}});let De=r[6]&&vl(r),gt=pt(r[23]),oe=[];for(let O=0;O<gt.length;O+=1)oe[O]=yl(al(r,gt,O));const Bt=O=>$(oe[O],1,1,()=>{oe[O]=null});return{c(){e=h("div"),s=h("div"),t=h("div"),l=h("textarea"),n=S(),o=h("div"),i=h("div"),f=h("span"),y=J(b),w=J(" / 5,000 characters"),g=S(),p=h("button"),M.c(),A=S(),_e&&_e.c(),L=S(),q=h("div"),N=h("div"),D=h("h3"),D.textContent=H,I=S(),j=h("button"),z=h("span");for(let O=0;O<ke.length;O+=1)ke[O].c();le=S(),te(V.$$.fragment),C=S(),De&&De.c(),_=S(),E=h("div"),E.innerHTML=P,re=S(),U=h("div"),W=h("div"),W.innerHTML=ne,ae=S(),Y=h("div");for(let O=0;O<oe.length;O+=1)oe[O].c();Ve=S(),ue=h("button"),ue.innerHTML=be,Ne=S(),ye=h("div"),fe=h("div"),xe=h("div"),$e=h("label"),$e.textContent=ft,qe=S(),we=h("span"),dt=J(Te),Ze=S(),pe=h("input"),bt=S(),Ee=h("div"),Ee.innerHTML=rt,ot=S(),Ae=h("div"),Ke=h("div"),Se=h("label"),Se.textContent=F,de=S(),me=h("span"),Je=J(Ie),at=S(),ge=h("input"),tt=S(),Be=h("div"),Be.innerHTML=xt,this.h()},l(O){e=d(O,"DIV",{class:!0});var X=m(e);s=d(X,"DIV",{class:!0});var ve=m(s);t=d(ve,"DIV",{class:!0});var G=m(t);l=d(G,"TEXTAREA",{class:!0,placeholder:!0}),m(l).forEach(u),G.forEach(u),n=x(ve),o=d(ve,"DIV",{class:!0});var B=m(o);i=d(B,"DIV",{class:!0});var he=m(i);f=d(he,"SPAN",{class:!0});var Xe=m(f);y=K(Xe,b),w=K(Xe," / 5,000 characters"),Xe.forEach(u),he.forEach(u),g=x(B),p=d(B,"BUTTON",{class:!0});var it=m(p);M.l(it),it.forEach(u),B.forEach(u),A=x(ve),_e&&_e.l(ve),ve.forEach(u),L=x(X),q=d(X,"DIV",{class:!0});var yt=m(q);N=d(yt,"DIV",{class:!0});var st=m(N);D=d(st,"H3",{class:!0,"data-svelte-h":!0}),He(D)!=="svelte-b3hs3r"&&(D.textContent=H),I=x(st),j=d(st,"BUTTON",{class:!0});var kt=m(j);z=d(kt,"SPAN",{});var Ct=m(z);for(let _t=0;_t<ke.length;_t+=1)ke[_t].l(Ct);Ct.forEach(u),le=x(kt),ee(V.$$.fragment,kt),kt.forEach(u),C=x(st),De&&De.l(st),_=x(st),E=d(st,"DIV",{class:!0,"data-svelte-h":!0}),He(E)!=="svelte-1lgtwqr"&&(E.innerHTML=P),st.forEach(u),re=x(yt),U=d(yt,"DIV",{class:!0});var $t=m(U);W=d($t,"DIV",{class:!0,"data-svelte-h":!0}),He(W)!=="svelte-182x1ki"&&(W.innerHTML=ne),ae=x($t),Y=d($t,"DIV",{class:!0});var wt=m(Y);for(let _t=0;_t<oe.length;_t+=1)oe[_t].l(wt);Ve=x(wt),ue=d(wt,"BUTTON",{class:!0,"data-svelte-h":!0}),He(ue)!=="svelte-15dhhm1"&&(ue.innerHTML=be),wt.forEach(u),$t.forEach(u),Ne=x(yt),ye=d(yt,"DIV",{class:!0});var Dt=m(ye);fe=d(Dt,"DIV",{});var et=m(fe);xe=d(et,"DIV",{class:!0});var Vt=m(xe);$e=d(Vt,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),He($e)!=="svelte-1b3mj7t"&&($e.textContent=ft),qe=x(Vt),we=d(Vt,"SPAN",{class:!0});var Mt=m(we);dt=K(Mt,Te),Mt.forEach(u),Vt.forEach(u),Ze=x(et),pe=d(et,"INPUT",{id:!0,type:!0,min:!0,max:!0,step:!0,class:!0}),bt=x(et),Ee=d(et,"DIV",{class:!0,"data-svelte-h":!0}),He(Ee)!=="svelte-1nv1j90"&&(Ee.innerHTML=rt),et.forEach(u),ot=x(Dt),Ae=d(Dt,"DIV",{});var Et=m(Ae);Ke=d(Et,"DIV",{class:!0});var Le=m(Ke);Se=d(Le,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),He(Se)!=="svelte-ttm2j4"&&(Se.textContent=F),de=x(Le),me=d(Le,"SPAN",{class:!0});var Ut=m(me);Je=K(Ut,Ie),Ut.forEach(u),Le.forEach(u),at=x(Et),ge=d(Et,"INPUT",{id:!0,type:!0,min:!0,max:!0,step:!0,class:!0}),tt=x(Et),Be=d(Et,"DIV",{class:!0,"data-svelte-h":!0}),He(Be)!=="svelte-1ipakpw"&&(Be.innerHTML=xt),Et.forEach(u),Dt.forEach(u),yt.forEach(u),X.forEach(u),this.h()},h(){c(l,"class","w-full h-full p-6 bg-white resize-none border-0 focus:outline-none text-gray-900 text-base leading-relaxed"),c(l,"placeholder","In a hole in the ground there lived a hobbit."),c(t,"class","flex-1 pb-24"),c(f,"class","text-sm text-gray-500"),c(i,"class","flex items-center justify-between mb-3"),p.disabled=T=r[7]||!r[0].trim(),c(p,"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"),c(o,"class","fixed bottom-0 left-56 right-80 p-4 bg-white border-t border-gray-200"),c(s,"class","flex-1 flex flex-col p-6"),c(D,"class","font-medium text-gray-900 mb-3"),c(j,"class","w-full p-3 border border-gray-200 rounded-lg bg-white text-sm 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"),c(E,"class","mt-2 text-xs text-gray-500"),c(N,"class","mb-6 relative model-dropdown"),c(W,"class","mb-3"),c(ue,"class","w-full flex items-center justify-between p-2 rounded-lg opacity-50 cursor-not-allowed text-left border border-transparent"),ue.disabled=!0,c(Y,"class","space-y-2"),c(U,"class","mb-6"),c($e,"for","exaggeration-slider"),c($e,"class","text-sm font-medium text-gray-700"),c(we,"class","text-sm text-gray-500"),c(xe,"class","flex justify-between mb-1"),c(pe,"id","exaggeration-slider"),c(pe,"type","range"),c(pe,"min","0"),c(pe,"max","1"),c(pe,"step","0.01"),c(pe,"class","w-full h-1.5 bg-gray-200 rounded-lg appearance-none cursor-pointer slider-hf"),c(Ee,"class","flex justify-between text-xs text-gray-400 mt-1"),c(Se,"for","temperature-slider"),c(Se,"class","text-sm font-medium text-gray-700"),c(me,"class","text-sm text-gray-500"),c(Ke,"class","flex justify-between mb-1"),c(ge,"id","temperature-slider"),c(ge,"type","range"),c(ge,"min","0"),c(ge,"max","1"),c(ge,"step","0.01"),c(ge,"class","w-full h-1.5 bg-gray-200 rounded-lg appearance-none cursor-pointer slider-hf"),c(Be,"class","flex justify-between text-xs text-gray-400 mt-1"),c(ye,"class","space-y-4 pt-4 border-t border-gray-200"),c(q,"class","w-80 border-l border-gray-200 bg-white p-4 overflow-y-auto"),c(e,"class","flex-1 flex")},m(O,X){se(O,e,X),a(e,s),a(s,t),a(t,l),zt(l,r[0]),a(s,n),a(s,o),a(o,i),a(i,f),a(f,y),a(f,w),a(o,g),a(o,p),je[v].m(p,null),a(s,A),_e&&_e.m(s,null),a(e,L),a(e,q),a(q,N),a(N,D),a(N,I),a(N,j),a(j,z);for(let ve=0;ve<ke.length;ve+=1)ke[ve]&&ke[ve].m(z,null);a(j,le),Z(V,j,null),a(N,C),De&&De.m(N,null),a(N,_),a(N,E),a(q,re),a(q,U),a(U,W),a(U,ae),a(U,Y);for(let ve=0;ve<oe.length;ve+=1)oe[ve]&&oe[ve].m(Y,null);a(Y,Ve),a(Y,ue),a(q,Ne),a(q,ye),a(ye,fe),a(fe,xe),a(xe,$e),a(xe,qe),a(xe,we),a(we,dt),a(fe,Ze),a(fe,pe),zt(pe,r[11]),a(fe,bt),a(fe,Ee),a(ye,ot),a(ye,Ae),a(Ae,Ke),a(Ke,Se),a(Ke,de),a(Ke,me),a(me,Je),a(Ae,at),a(Ae,ge),zt(ge,r[12]),a(Ae,tt),a(Ae,Be),lt=!0,nt||(ht=[ie(l,"input",r[41]),ie(p,"click",r[24]),ie(j,"click",r[43]),ie(pe,"change",r[47]),ie(pe,"input",r[47]),ie(ge,"change",r[48]),ie(ge,"input",r[48])],nt=!0)},p(O,X){X[0]&1&&zt(l,O[0]),(!lt||X[0]&1)&&b!==(b=O[0].length+"")&&ze(y,b);let ve=v;if(v=mt(O),v!==ve&&(ut(),$(je[ve],1,1,()=>{je[ve]=null}),ct(),M=je[v],M||(M=je[v]=St[v](O),M.c()),k(M,1),M.m(p,null)),(!lt||X[0]&129&&T!==(T=O[7]||!O[0].trim()))&&(p.disabled=T),O[8]?_e?(_e.p(O,X),X[0]&256&&k(_e,1)):(_e=ml(O),_e.c(),k(_e,1),_e.m(s,null)):_e&&(ut(),$(_e,1,1,()=>{_e=null}),ct()),X[0]&4194336){Ce=pt(O[22]);let G;for(G=0;G<Ce.length;G+=1){const B=cl(O,Ce,G);ke[G]?ke[G].p(B,X):(ke[G]=pl(B),ke[G].c(),ke[G].m(z,null))}for(;G<ke.length;G+=1)ke[G].d(1);ke.length=Ce.length}if(O[6]?De?De.p(O,X):(De=vl(O),De.c(),De.m(N,_)):De&&(De.d(1),De=null),X[0]&8650768|X[1]&1){gt=pt(O[23]);let G;for(G=0;G<gt.length;G+=1){const B=al(O,gt,G);oe[G]?(oe[G].p(B,X),k(oe[G],1)):(oe[G]=yl(B),oe[G].c(),k(oe[G],1),oe[G].m(Y,Ve))}for(ut(),G=gt.length;G<oe.length;G+=1)Bt(G);ct()}(!lt||X[0]&2048)&&Te!==(Te=O[11].toFixed(2)+"")&&ze(dt,Te),X[0]&2048&&zt(pe,O[11]),(!lt||X[0]&4096)&&Ie!==(Ie=O[12].toFixed(2)+"")&&ze(Je,Ie),X[0]&4096&&zt(ge,O[12])},i(O){if(!lt){k(M),k(_e),k(V.$$.fragment,O);for(let X=0;X<gt.length;X+=1)k(oe[X]);lt=!0}},o(O){$(M),$(_e),$(V.$$.fragment,O),oe=oe.filter(Boolean);for(let X=0;X<oe.length;X+=1)$(oe[X]);lt=!1},d(O){O&&u(e),je[v].d(),_e&&_e.d(),jt(ke,O),Q(V),De&&De.d(),jt(oe,O),nt=!1,Tt(ht)}}}function An(r){let e;return{c(){e=J("Python code to reproduce your actions via the API")},l(s){e=K(s,"Python code to reproduce your actions via the API")},m(s,t){se(s,e,t)},d(s){s&&u(e)}}}function zn(r){let e;return{c(){e=J("Python code to reproduce your actions using a local HFStudio server")},l(s){e=K(s,"Python code to reproduce your actions using a local HFStudio server")},m(s,t){se(s,e,t)},d(s){s&&u(e)}}}function fl(r){let e,s,t,l,n,o,i;return t=new Rt({props:{size:16}}),{c(){e=h("button"),s=h("span"),te(t.$$.fragment),l=J(`
|
| 7 |
+
Copy All`),this.h()},l(f){e=d(f,"BUTTON",{class:!0});var b=m(e);s=d(b,"SPAN",{class:!0});var y=m(s);ee(t.$$.fragment,y),l=K(y,`
|
| 8 |
+
Copy All`),y.forEach(u),b.forEach(u),this.h()},h(){c(s,"class","px-3 py-1 text-sm font-medium text-gray-600 flex items-center gap-2"),c(e,"class","flex items-center bg-gray-100 rounded-md p-0.5")},m(f,b){se(f,e,b),a(e,s),Z(t,s,null),a(s,l),n=!0,o||(i=ie(e,"click",r[36]),o=!0)},p:vt,i(f){n||(k(t.$$.fragment,f),n=!0)},o(f){$(t.$$.fragment,f),n=!1},d(f){f&&u(e),Q(t),o=!1,i()}}}function Mn(r){let e,s=[],t=new Map,l,n=pt(r[3]);const o=i=>i[66].id;for(let i=0;i<n.length;i+=1){let f=ol(r,n,i),b=o(f);t.set(b,s[i]=hl(b,f))}return{c(){e=h("div");for(let i=0;i<s.length;i+=1)s[i].c();this.h()},l(i){e=d(i,"DIV",{class:!0});var f=m(e);for(let b=0;b<s.length;b+=1)s[b].l(f);f.forEach(u),this.h()},h(){c(e,"class","space-y-4")},m(i,f){se(i,e,f);for(let b=0;b<s.length;b+=1)s[b]&&s[b].m(e,null);l=!0},p(i,f){f[0]&8|f[1]&4&&(n=pt(i[3]),ut(),s=Vl(s,f,o,1,i,n,t,e,Dl,hl,null,ol),ct())},i(i){if(!l){for(let f=0;f<n.length;f+=1)k(s[f]);l=!0}},o(i){for(let f=0;f<s.length;f+=1)$(s[f]);l=!1},d(i){i&&u(e);for(let f=0;f<s.length;f+=1)s[f].d()}}}function Un(r){let e,s='<p class="text-gray-500">Start using the UI to see generated code here</p>';return{c(){e=h("div"),e.innerHTML=s,this.h()},l(t){e=d(t,"DIV",{class:!0,"data-svelte-h":!0}),He(e)!=="svelte-1dkp70o"&&(e.innerHTML=s),this.h()},h(){c(e,"class","bg-white rounded-lg border border-gray-200 p-8 text-center")},m(t,l){se(t,e,l)},p:vt,i:vt,o:vt,d(t){t&&u(e)}}}function dl(r){let e,s=r[66].output+"",t;return{c(){e=h("div"),t=J(s),this.h()},l(l){e=d(l,"DIV",{class:!0});var n=m(e);t=K(n,s),n.forEach(u),this.h()},h(){c(e,"class","px-4 py-2 bg-gray-900 text-green-400 font-mono text-xs border-t border-gray-200")},m(l,n){se(l,e,n),a(e,t)},p(l,n){n[0]&8&&s!==(s=l[66].output+"")&&ze(t,s)},d(l){l&&u(e)}}}function hl(r,e){let s,t,l,n,o=e[66].title+"",i,f,b,y=e[66].timestamp+"",w,g,p,v,M,T,A,L,q=e[66].code+"",N,D,H,I,j,z;v=new Rt({props:{size:14,class:"text-gray-600"}});function le(){return e[51](e[66])}let V=e[66].output&&dl(e);return{key:r,first:null,c(){s=h("div"),t=h("div"),l=h("div"),n=h("span"),i=J(o),f=S(),b=h("span"),w=J(y),g=S(),p=h("button"),te(v.$$.fragment),M=S(),T=h("div"),A=h("pre"),L=h("code"),N=J(q),D=S(),V&&V.c(),H=S(),this.h()},l(C){s=d(C,"DIV",{class:!0});var _=m(s);t=d(_,"DIV",{class:!0});var E=m(t);l=d(E,"DIV",{class:!0});var P=m(l);n=d(P,"SPAN",{class:!0});var re=m(n);i=K(re,o),re.forEach(u),f=x(P),b=d(P,"SPAN",{class:!0});var U=m(b);w=K(U,y),U.forEach(u),P.forEach(u),g=x(E),p=d(E,"BUTTON",{class:!0,title:!0});var W=m(p);ee(v.$$.fragment,W),W.forEach(u),E.forEach(u),M=x(_),T=d(_,"DIV",{class:!0});var ne=m(T);A=d(ne,"PRE",{class:!0});var ae=m(A);L=d(ae,"CODE",{class:!0});var Y=m(L);N=K(Y,q),Y.forEach(u),ae.forEach(u),ne.forEach(u),D=x(_),V&&V.l(_),H=x(_),_.forEach(u),this.h()},h(){c(n,"class","text-sm font-medium text-gray-700"),c(b,"class","text-xs text-gray-500"),c(l,"class","flex items-center gap-3"),c(p,"class","p-1.5 hover:bg-gray-200 rounded transition-colors"),c(p,"title","Copy code"),c(t,"class","flex items-center justify-between px-4 py-2 bg-gray-50 border-b border-gray-200"),c(L,"class","language-python text-sm font-mono"),c(A,"class","p-4 overflow-x-auto bg-gray-50 text-gray-900"),c(T,"class","relative"),c(s,"class","bg-white rounded-lg border border-gray-200 overflow-hidden"),this.first=s},m(C,_){se(C,s,_),a(s,t),a(t,l),a(l,n),a(n,i),a(l,f),a(l,b),a(b,w),a(t,g),a(t,p),Z(v,p,null),a(s,M),a(s,T),a(T,A),a(A,L),a(L,N),a(s,D),V&&V.m(s,null),a(s,H),I=!0,j||(z=ie(p,"click",le),j=!0)},p(C,_){e=C,(!I||_[0]&8)&&o!==(o=e[66].title+"")&&ze(i,o),(!I||_[0]&8)&&y!==(y=e[66].timestamp+"")&&ze(w,y),(!I||_[0]&8)&&q!==(q=e[66].code+"")&&ze(N,q),e[66].output?V?V.p(e,_):(V=dl(e),V.c(),V.m(s,H)):V&&(V.d(1),V=null)},i(C){I||(k(v.$$.fragment,C),I=!0)},o(C){$(v.$$.fragment,C),I=!1},d(C){C&&u(s),Q(v),V&&V.d(),j=!1,z()}}}function On(r){let e,s,t;return e=new Ht({props:{size:20}}),{c(){te(e.$$.fragment),s=J(`
|
| 9 |
+
Generate speech`)},l(l){ee(e.$$.fragment,l),s=K(l,`
|
| 10 |
+
Generate speech`)},m(l,n){Z(e,l,n),se(l,s,n),t=!0},i(l){t||(k(e.$$.fragment,l),t=!0)},o(l){$(e.$$.fragment,l),t=!1},d(l){l&&u(s),Q(e,l)}}}function Bn(r){let e,s,t;return e=new en({props:{size:20,class:"animate-spin"}}),{c(){te(e.$$.fragment),s=J(`
|
| 11 |
+
Generating...`)},l(l){ee(e.$$.fragment,l),s=K(l,`
|
| 12 |
+
Generating...`)},m(l,n){Z(e,l,n),se(l,s,n),t=!0},i(l){t||(k(e.$$.fragment,l),t=!0)},o(l){$(e.$$.fragment,l),t=!1},d(l){l&&u(s),Q(e,l)}}}function ml(r){let e,s,t,l,n,o,i,f,b,y,w,g,p,v,M,T,A,L="Share",q,N,D,H="Download",I,j,z,le,V,C,_,E,P,re,U=It(r[14])+"",W,ne,ae,Y,Ve,ue,be=It(r[15])+"",Ne,ye,fe,xe,$e,ft,qe,we,Te,dt,Ze,pe,bt,Ee,rt,ot=It(r[14])+"",Ae,Ke,Se,F,de,me,Ie=It(r[15])+"",Je,at,ge,tt,Be,xt,lt,nt,ht,St,je,mt,_e,Ce,ke,De;M=new rl({props:{size:14,class:"text-gray-600"}}),j=new sl({props:{size:14,class:"text-gray-600"}});const gt=[Ln,jn],oe=[];function Bt(B,he){return B[13]?0:1}C=Bt(r),_=oe[C]=gt[C](r),$e=new wn({props:{size:20,class:"text-gray-600"}});const O=[Gn,Hn],X=[];function ve(B,he){return B[13]?0:1}we=ve(r),Te=X[we]=O[we](r),pe=new Tn({props:{size:20,class:"text-gray-600"}}),Be=new rl({props:{size:14}}),ht=new sl({props:{size:16,class:"text-gray-600"}}),mt=new sn({props:{size:16,class:"text-gray-600"}});let G=r[8]&&gl(r);return{c(){e=h("div"),s=h("div"),t=h("div"),l=S(),n=h("div"),o=h("h3"),i=J(r[16]),f=S(),b=h("p"),y=J(r[4]),w=J(" β’ Created 1 second ago"),g=S(),p=h("div"),v=h("button"),te(M.$$.fragment),T=S(),A=h("span"),A.textContent=L,q=S(),N=h("button"),D=h("span"),D.textContent=H,I=S(),te(j.$$.fragment),z=S(),le=h("div"),V=h("button"),_.c(),E=S(),P=h("div"),re=h("span"),W=J(U),ne=S(),ae=h("div"),Y=h("div"),Ve=S(),ue=h("span"),Ne=J(be),ye=S(),fe=h("div"),xe=h("button"),te($e.$$.fragment),ft=S(),qe=h("button"),Te.c(),dt=S(),Ze=h("button"),te(pe.$$.fragment),bt=S(),Ee=h("div"),rt=h("span"),Ae=J(ot),Ke=S(),Se=h("div"),F=h("div"),de=S(),me=h("span"),Je=J(Ie),at=S(),ge=h("div"),tt=h("button"),te(Be.$$.fragment),xt=J(`
|
| 13 |
+
Share`),lt=S(),nt=h("button"),te(ht.$$.fragment),St=S(),je=h("button"),te(mt.$$.fragment),_e=S(),G&&G.c(),this.h()},l(B){e=d(B,"DIV",{class:!0});var he=m(e);s=d(he,"DIV",{class:!0});var Xe=m(s);t=d(Xe,"DIV",{class:!0}),m(t).forEach(u),l=x(Xe),n=d(Xe,"DIV",{class:!0});var it=m(n);o=d(it,"H3",{class:!0});var yt=m(o);i=K(yt,r[16]),yt.forEach(u),f=x(it),b=d(it,"P",{class:!0});var st=m(b);y=K(st,r[4]),w=K(st," β’ Created 1 second ago"),st.forEach(u),it.forEach(u),g=x(Xe),p=d(Xe,"DIV",{class:!0});var kt=m(p);v=d(kt,"BUTTON",{class:!0});var Ct=m(v);ee(M.$$.fragment,Ct),T=x(Ct),A=d(Ct,"SPAN",{class:!0,"data-svelte-h":!0}),He(A)!=="svelte-hbn8gl"&&(A.textContent=L),Ct.forEach(u),q=x(kt),N=d(kt,"BUTTON",{class:!0});var $t=m(N);D=d($t,"SPAN",{class:!0,"data-svelte-h":!0}),He(D)!=="svelte-h01aeg"&&(D.textContent=H),I=x($t),ee(j.$$.fragment,$t),$t.forEach(u),kt.forEach(u),Xe.forEach(u),z=x(he),le=d(he,"DIV",{class:!0});var wt=m(le);V=d(wt,"BUTTON",{class:!0});var Dt=m(V);_.l(Dt),Dt.forEach(u),E=x(wt),P=d(wt,"DIV",{class:!0});var et=m(P);re=d(et,"SPAN",{class:!0});var Vt=m(re);W=K(Vt,U),Vt.forEach(u),ne=x(et),ae=d(et,"DIV",{class:!0});var Mt=m(ae);Y=d(Mt,"DIV",{class:!0,style:!0}),m(Y).forEach(u),Mt.forEach(u),Ve=x(et),ue=d(et,"SPAN",{class:!0});var Et=m(ue);Ne=K(Et,be),Et.forEach(u),et.forEach(u),wt.forEach(u),ye=x(he),fe=d(he,"DIV",{class:!0});var Le=m(fe);xe=d(Le,"BUTTON",{class:!0,title:!0});var Ut=m(xe);ee($e.$$.fragment,Ut),Ut.forEach(u),ft=x(Le),qe=d(Le,"BUTTON",{class:!0});var _t=m(qe);Te.l(_t),_t.forEach(u),dt=x(Le),Ze=d(Le,"BUTTON",{class:!0,title:!0});var Wt=m(Ze);ee(pe.$$.fragment,Wt),Wt.forEach(u),bt=x(Le),Ee=d(Le,"DIV",{class:!0});var Pt=m(Ee);rt=d(Pt,"SPAN",{class:!0});var qt=m(rt);Ae=K(qt,ot),qt.forEach(u),Ke=x(Pt),Se=d(Pt,"DIV",{class:!0});var Kt=m(Se);F=d(Kt,"DIV",{class:!0,style:!0}),m(F).forEach(u),Kt.forEach(u),de=x(Pt),me=d(Pt,"SPAN",{class:!0});var Jt=m(me);Je=K(Jt,Ie),Jt.forEach(u),Pt.forEach(u),at=x(Le),ge=d(Le,"DIV",{class:!0});var At=m(ge);tt=d(At,"BUTTON",{class:!0});var Gt=m(tt);ee(Be.$$.fragment,Gt),xt=K(Gt,`
|
| 14 |
+
Share`),Gt.forEach(u),lt=x(At),nt=d(At,"BUTTON",{class:!0,title:!0});var Xt=m(nt);ee(ht.$$.fragment,Xt),Xt.forEach(u),St=x(At),je=d(At,"BUTTON",{class:!0,title:!0});var Yt=m(je);ee(mt.$$.fragment,Yt),Yt.forEach(u),At.forEach(u),Le.forEach(u),_e=x(he),G&&G.l(he),he.forEach(u),this.h()},h(){c(t,"class","w-2 h-2 bg-green-500 rounded-full"),c(o,"class","font-medium text-gray-900 text-sm"),c(b,"class","text-xs text-gray-500"),c(n,"class","flex-1"),c(A,"class","text-gray-700"),c(v,"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"),c(D,"class","text-gray-700"),c(N,"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"),c(p,"class","flex items-center gap-2"),c(s,"class","flex items-center gap-3 mb-4"),c(V,"class","w-8 h-8 bg-black rounded-full flex items-center justify-center hover:bg-gray-800 transition-colors"),c(re,"class","text-xs text-gray-500 font-mono"),c(Y,"class","h-full bg-gradient-to-r from-amber-400 to-orange-500 rounded-full transition-all"),Ot(Y,"width",r[14]/r[15]*100+"%"),c(ae,"class","flex-1 h-1 bg-gray-200 rounded-full cursor-pointer"),c(ue,"class","text-xs text-gray-500 font-mono"),c(P,"class","flex-1 flex items-center gap-2"),c(le,"class","flex items-center gap-3 mb-4"),c(xe,"class","p-2 hover:bg-gray-100 rounded-full"),c(xe,"title","Skip back"),c(qe,"class","w-12 h-12 bg-black rounded-full flex items-center justify-center hover:bg-gray-800 transition-colors"),c(Ze,"class","p-2 hover:bg-gray-100 rounded-full"),c(Ze,"title","Skip forward"),c(rt,"class","text-xs text-gray-500 font-mono"),c(F,"class","h-full bg-gradient-to-r from-amber-400 to-orange-500 rounded-full transition-all"),Ot(F,"width",r[14]/r[15]*100+"%"),c(Se,"class","flex-1 h-1 bg-gray-200 rounded-full"),c(me,"class","text-xs text-gray-500 font-mono"),c(Ee,"class","flex-1 flex items-center gap-3"),c(tt,"class","flex items-center gap-2 px-3 py-1.5 text-sm border border-gray-200 rounded-md hover:bg-gray-50"),c(nt,"class","p-2 hover:bg-gray-100 rounded-md"),c(nt,"title","Download"),c(je,"class","p-2 hover:bg-gray-100 rounded-md"),c(je,"title","More options"),c(ge,"class","flex items-center gap-2"),c(fe,"class","flex items-center gap-4 mb-4"),c(e,"class","p-4 border border-gray-200 rounded-lg bg-white")},m(B,he){se(B,e,he),a(e,s),a(s,t),a(s,l),a(s,n),a(n,o),a(o,i),a(n,f),a(n,b),a(b,y),a(b,w),a(s,g),a(s,p),a(p,v),Z(M,v,null),a(v,T),a(v,A),a(p,q),a(p,N),a(N,D),a(N,I),Z(j,N,null),a(e,z),a(e,le),a(le,V),oe[C].m(V,null),a(le,E),a(le,P),a(P,re),a(re,W),a(P,ne),a(P,ae),a(ae,Y),a(P,Ve),a(P,ue),a(ue,Ne),a(e,ye),a(e,fe),a(fe,xe),Z($e,xe,null),a(fe,ft),a(fe,qe),X[we].m(qe,null),a(fe,dt),a(fe,Ze),Z(pe,Ze,null),a(fe,bt),a(fe,Ee),a(Ee,rt),a(rt,Ae),a(Ee,Ke),a(Ee,Se),a(Se,F),a(Ee,de),a(Ee,me),a(me,Je),a(fe,at),a(fe,ge),a(ge,tt),Z(Be,tt,null),a(tt,xt),a(ge,lt),a(ge,nt),Z(ht,nt,null),a(ge,St),a(ge,je),Z(mt,je,null),a(e,_e),G&&G.m(e,null),Ce=!0,ke||(De=[ie(v,"click",Il),ie(N,"click",r[30]),ie(V,"click",r[25]),ie(qe,"click",r[25]),ie(tt,"click",Il),ie(nt,"click",r[30])],ke=!0)},p(B,he){(!Ce||he[0]&65536)&&ze(i,B[16]),(!Ce||he[0]&16)&&ze(y,B[4]);let Xe=C;C=Bt(B),C!==Xe&&(ut(),$(oe[Xe],1,1,()=>{oe[Xe]=null}),ct(),_=oe[C],_||(_=oe[C]=gt[C](B),_.c()),k(_,1),_.m(V,null)),(!Ce||he[0]&16384)&&U!==(U=It(B[14])+"")&&ze(W,U),(!Ce||he[0]&49152)&&Ot(Y,"width",B[14]/B[15]*100+"%"),(!Ce||he[0]&32768)&&be!==(be=It(B[15])+"")&&ze(Ne,be);let it=we;we=ve(B),we!==it&&(ut(),$(X[it],1,1,()=>{X[it]=null}),ct(),Te=X[we],Te||(Te=X[we]=O[we](B),Te.c()),k(Te,1),Te.m(qe,null)),(!Ce||he[0]&16384)&&ot!==(ot=It(B[14])+"")&&ze(Ae,ot),(!Ce||he[0]&49152)&&Ot(F,"width",B[14]/B[15]*100+"%"),(!Ce||he[0]&32768)&&Ie!==(Ie=It(B[15])+"")&&ze(Je,Ie),B[8]?G?G.p(B,he):(G=gl(B),G.c(),G.m(e,null)):G&&(G.d(1),G=null)},i(B){Ce||(k(M.$$.fragment,B),k(j.$$.fragment,B),k(_),k($e.$$.fragment,B),k(Te),k(pe.$$.fragment,B),k(Be.$$.fragment,B),k(ht.$$.fragment,B),k(mt.$$.fragment,B),Ce=!0)},o(B){$(M.$$.fragment,B),$(j.$$.fragment,B),$(_),$($e.$$.fragment,B),$(Te),$(pe.$$.fragment,B),$(Be.$$.fragment,B),$(ht.$$.fragment,B),$(mt.$$.fragment,B),Ce=!1},d(B){B&&u(e),Q(M),Q(j),oe[C].d(),Q($e),X[we].d(),Q(pe),Q(Be),Q(ht),Q(mt),G&&G.d(),ke=!1,Tt(De)}}}function jn(r){let e,s;return e=new Ht({props:{size:14,class:"text-white ml-0.5"}}),{c(){te(e.$$.fragment)},l(t){ee(e.$$.fragment,t)},m(t,l){Z(e,t,l),s=!0},i(t){s||(k(e.$$.fragment,t),s=!0)},o(t){$(e.$$.fragment,t),s=!1},d(t){Q(e,t)}}}function Ln(r){let e;return{c(){e=h("div"),this.h()},l(s){e=d(s,"DIV",{class:!0}),m(e).forEach(u),this.h()},h(){c(e,"class","pause-filled text-white")},m(s,t){se(s,e,t)},i:vt,o:vt,d(s){s&&u(e)}}}function Hn(r){let e,s;return e=new Ht({props:{size:20,class:"text-white ml-0.5"}}),{c(){te(e.$$.fragment)},l(t){ee(e.$$.fragment,t)},m(t,l){Z(e,t,l),s=!0},i(t){s||(k(e.$$.fragment,t),s=!0)},o(t){$(e.$$.fragment,t),s=!1},d(t){Q(e,t)}}}function Gn(r){let e;return{c(){e=h("div"),this.h()},l(s){e=d(s,"DIV",{class:!0}),m(e).forEach(u),this.h()},h(){c(e,"class","pause-filled text-white scale-150")},m(s,t){se(s,e,t)},i:vt,o:vt,d(s){s&&u(e)}}}function gl(r){let e,s,t,l;return{c(){e=h("audio"),this.h()},l(n){e=d(n,"AUDIO",{src:!0,style:!0}),m(e).forEach(u),this.h()},h(){el(e.src,s=r[8])||c(e,"src",s),Ot(e,"display","none")},m(n,o){se(n,e,o),r[42](e),t||(l=[ie(e,"loadedmetadata",r[26]),ie(e,"timeupdate",r[27]),ie(e,"play",r[28]),ie(e,"pause",r[29])],t=!0)},p(n,o){o[0]&256&&!el(e.src,s=n[8])&&c(e,"src",s)},d(n){n&&u(e),r[42](null),t=!1,Tt(l)}}}function _l(r){let e=r[61].name+"",s,t,l=r[61].badge&&Fn(r);return{c(){s=J(e),l&&l.c(),t=Nt()},l(n){s=K(n,e),l&&l.l(n),t=Nt()},m(n,o){se(n,s,o),l&&l.m(n,o),se(n,t,o)},p(n,o){n[61].badge&&l.p(n,o)},d(n){n&&(u(s),u(t)),l&&l.d(n)}}}function Fn(r){let e,s,t,l=r[61].badge+"",n,o;return{c(){e=J("Β "),s=h("span"),t=J("("),n=J(l),o=J(")"),this.h()},l(i){e=K(i,"Β "),s=d(i,"SPAN",{class:!0});var f=m(s);t=K(f,"("),n=K(f,l),o=K(f,")"),f.forEach(u),this.h()},h(){c(s,"class","text-xs text-gray-500")},m(i,f){se(i,e,f),se(i,s,f),a(s,t),a(s,n),a(s,o)},p:vt,d(i){i&&(u(e),u(s))}}}function pl(r){let e,s=r[61].name===r[5]&&_l(r);return{c(){s&&s.c(),e=Nt()},l(t){s&&s.l(t),e=Nt()},m(t,l){s&&s.m(t,l),se(t,e,l)},p(t,l){t[61].name===t[5]?s?s.p(t,l):(s=_l(t),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null)},d(t){t&&u(e),s&&s.d(t)}}}function vl(r){let e,s=pt(r[22]),t=[];for(let l=0;l<s.length;l+=1)t[l]=bl(il(r,s,l));return{c(){e=h("div");for(let l=0;l<t.length;l+=1)t[l].c();this.h()},l(l){e=d(l,"DIV",{class:!0});var n=m(e);for(let o=0;o<t.length;o+=1)t[o].l(n);n.forEach(u),this.h()},h(){c(e,"class","absolute top-full left-0 right-0 mt-1 bg-white border border-gray-200 rounded-lg shadow-lg z-10")},m(l,n){se(l,e,n);for(let o=0;o<t.length;o+=1)t[o]&&t[o].m(e,null)},p(l,n){if(n[0]&4194400){s=pt(l[22]);let o;for(o=0;o<s.length;o+=1){const i=il(l,s,o);t[o]?t[o].p(i,n):(t[o]=bl(i),t[o].c(),t[o].m(e,null))}for(;o<t.length;o+=1)t[o].d(1);t.length=s.length}},d(l){l&&u(e),jt(t,l)}}}function Rn(r){let e,s,t,l=r[61].badge+"",n,o;return{c(){e=J("Β "),s=h("span"),t=J("("),n=J(l),o=J(")"),this.h()},l(i){e=K(i,"Β "),s=d(i,"SPAN",{class:!0});var f=m(s);t=K(f,"("),n=K(f,l),o=K(f,")"),f.forEach(u),this.h()},h(){c(s,"class","text-xs text-gray-500")},m(i,f){se(i,e,f),se(i,s,f),a(s,t),a(s,n),a(s,o)},p:vt,d(i){i&&(u(e),u(s))}}}function bl(r){let e,s=r[61].name+"",t,l,n,o,i,f=r[61].badge&&Rn(r);function b(){return r[44](r[61])}return{c(){e=h("button"),t=J(s),f&&f.c(),l=S(),this.h()},l(y){e=d(y,"BUTTON",{class:!0});var w=m(e);t=K(w,s),f&&f.l(w),l=x(w),w.forEach(u),this.h()},h(){c(e,"class",n="w-full px-3 py-2 text-left transition-colors text-sm "+(r[61].disabled?"opacity-50 cursor-not-allowed":"hover:bg-gray-50")+" "+(r[61].name===r[5]?"bg-gray-100":"")),e.disabled=r[61].disabled},m(y,w){se(y,e,w),a(e,t),f&&f.m(e,null),a(e,l),o||(i=ie(e,"click",b),o=!0)},p(y,w){r=y,r[61].badge&&f.p(r,w),w[0]&32&&n!==(n="w-full px-3 py-2 text-left transition-colors text-sm "+(r[61].disabled?"opacity-50 cursor-not-allowed":"hover:bg-gray-50")+" "+(r[61].name===r[5]?"bg-gray-100":""))&&c(e,"class",n)},d(y){y&&u(e),f&&f.d(),o=!1,i()}}}function Wn(r){let e,s;return e=new Ht({props:{size:16,class:"text-gray-600"}}),{c(){te(e.$$.fragment)},l(t){ee(e.$$.fragment,t)},m(t,l){Z(e,t,l),s=!0},i(t){s||(k(e.$$.fragment,t),s=!0)},o(t){$(e.$$.fragment,t),s=!1},d(t){Q(e,t)}}}function qn(r){let e,s;return e=new hn({props:{size:16,class:"text-gray-600"}}),{c(){te(e.$$.fragment)},l(t){ee(e.$$.fragment,t)},m(t,l){Z(e,t,l),s=!0},i(t){s||(k(e.$$.fragment,t),s=!0)},o(t){$(e.$$.fragment,t),s=!1},d(t){Q(e,t)}}}function yl(r){let e,s,t,l=r[58].name[0]+"",n,o,i,f,b=r[58].name+"",y,w,g,p=r[58].description+"",v,M,T,A,L,q,N,D,H,I;const j=[qn,Wn],z=[];function le(_,E){return _[18]===_[58].name?0:1}A=le(r),L=z[A]=j[A](r);function V(..._){return r[45](r[58],..._)}function C(){return r[46](r[58])}return{c(){e=h("button"),s=h("div"),t=h("div"),n=J(l),o=S(),i=h("div"),f=h("div"),y=J(b),w=S(),g=h("div"),v=J(p),M=S(),T=h("button"),L.c(),q=S(),this.h()},l(_){e=d(_,"BUTTON",{class:!0});var E=m(e);s=d(E,"DIV",{class:!0});var P=m(s);t=d(P,"DIV",{class:!0});var re=m(t);n=K(re,l),re.forEach(u),o=x(P),i=d(P,"DIV",{class:!0});var U=m(i);f=d(U,"DIV",{class:!0});var W=m(f);y=K(W,b),W.forEach(u),w=x(U),g=d(U,"DIV",{class:!0});var ne=m(g);v=K(ne,p),ne.forEach(u),U.forEach(u),P.forEach(u),M=x(E),T=d(E,"BUTTON",{class:!0,title:!0});var ae=m(T);L.l(ae),ae.forEach(u),q=x(E),E.forEach(u),this.h()},h(){c(t,"class","w-10 h-10 bg-gradient-to-br from-amber-400 to-orange-500 rounded-full flex items-center justify-center text-white text-sm font-semibold flex-shrink-0"),c(f,"class","text-sm font-medium text-gray-900 mb-1"),c(g,"class","text-xs text-gray-500 leading-relaxed"),c(i,"class","flex-1 min-w-0"),c(s,"class","flex items-center gap-3 flex-1 min-w-0"),c(T,"class","p-2 rounded-full hover:bg-gray-200 transition-colors flex-shrink-0 ml-2"),c(T,"title","Play sample"),c(e,"class",N="w-full flex items-center justify-between p-2 rounded-lg hover:bg-gray-50 transition-colors text-left group border border-transparent "+(r[58].name===r[4]?"bg-gray-100 border-gray-200":""))},m(_,E){se(_,e,E),a(e,s),a(s,t),a(t,n),a(s,o),a(s,i),a(i,f),a(f,y),a(i,w),a(i,g),a(g,v),a(e,M),a(e,T),z[A].m(T,null),a(e,q),D=!0,H||(I=[ie(T,"click",V),ie(e,"click",C)],H=!0)},p(_,E){r=_;let P=A;A=le(r),A!==P&&(ut(),$(z[P],1,1,()=>{z[P]=null}),ct(),L=z[A],L||(L=z[A]=j[A](r),L.c()),k(L,1),L.m(T,null)),(!D||E[0]&16&&N!==(N="w-full flex items-center justify-between p-2 rounded-lg hover:bg-gray-50 transition-colors text-left group border border-transparent "+(r[58].name===r[4]?"bg-gray-100 border-gray-200":"")))&&c(e,"class",N)},i(_){D||(k(L),D=!0)},o(_){$(L),D=!1},d(_){_&&u(e),z[A].d(),H=!1,Tt(I)}}}function kl(r){let e,s;return{c(){e=h("div"),s=J(r[9]),this.h()},l(t){e=d(t,"DIV",{class:!0});var l=m(e);s=K(l,r[9]),l.forEach(u),this.h()},h(){c(e,"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-zv1zz2")},m(t,l){se(t,e,l),a(e,s)},p(t,l){l[0]&512&&ze(s,t[9])},d(t){t&&u(e)}}}function $l(r){let e,s,t,l,n,o,i,f,b,y,w,g,p="An error occurred while processing your request",v,M,T,A,L,q,N,D,H,I,j,z,le="Close",V,C,_;o=new Ml({props:{size:20,class:"text-red-600"}}),T=new xn({props:{size:20,class:"text-gray-500"}});let E=r[21]&&wl(r);return H=new Rt({props:{size:16}}),{c(){e=h("div"),s=h("div"),t=h("div"),l=h("div"),n=h("div"),te(o.$$.fragment),i=S(),f=h("div"),b=h("h3"),y=J(r[20]),w=S(),g=h("p"),g.textContent=p,v=S(),M=h("button"),te(T.$$.fragment),A=S(),L=h("div"),E&&E.c(),q=S(),N=h("div"),D=h("button"),te(H.$$.fragment),I=J(`
|
| 15 |
+
Copy Error`),j=S(),z=h("button"),z.textContent=le,this.h()},l(P){e=d(P,"DIV",{class:!0});var re=m(e);s=d(re,"DIV",{class:!0});var U=m(s);t=d(U,"DIV",{class:!0});var W=m(t);l=d(W,"DIV",{class:!0});var ne=m(l);n=d(ne,"DIV",{class:!0});var ae=m(n);ee(o.$$.fragment,ae),ae.forEach(u),i=x(ne),f=d(ne,"DIV",{class:!0});var Y=m(f);b=d(Y,"H3",{class:!0});var Ve=m(b);y=K(Ve,r[20]),Ve.forEach(u),w=x(Y),g=d(Y,"P",{class:!0,"data-svelte-h":!0}),He(g)!=="svelte-1l3zl3"&&(g.textContent=p),Y.forEach(u),ne.forEach(u),v=x(W),M=d(W,"BUTTON",{class:!0,title:!0});var ue=m(M);ee(T.$$.fragment,ue),ue.forEach(u),W.forEach(u),A=x(U),L=d(U,"DIV",{class:!0});var be=m(L);E&&E.l(be),be.forEach(u),q=x(U),N=d(U,"DIV",{class:!0});var Ne=m(N);D=d(Ne,"BUTTON",{class:!0});var ye=m(D);ee(H.$$.fragment,ye),I=K(ye,`
|
| 16 |
+
Copy Error`),ye.forEach(u),j=x(Ne),z=d(Ne,"BUTTON",{class:!0,"data-svelte-h":!0}),He(z)!=="svelte-4sxk6g"&&(z.textContent=le),Ne.forEach(u),U.forEach(u),re.forEach(u),this.h()},h(){c(n,"class","w-10 h-10 bg-red-100 rounded-full flex items-center justify-center flex-shrink-0"),c(b,"class","text-lg font-semibold text-gray-900 truncate"),c(g,"class","text-sm text-gray-600"),c(f,"class","min-w-0"),c(l,"class","flex items-center gap-3 min-w-0"),c(M,"class","p-2 hover:bg-red-100 rounded-full transition-colors flex-shrink-0"),c(M,"title","Close"),c(t,"class","flex items-center justify-between p-6 border-b border-gray-200 bg-red-50 flex-shrink-0"),c(L,"class","p-6 overflow-y-auto flex-1 min-h-0"),c(D,"class","flex items-center gap-2 px-4 py-2 text-gray-700 hover:bg-gray-200 rounded-lg transition-colors"),c(z,"class","px-6 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors"),c(N,"class","flex items-center justify-end gap-3 p-6 border-t border-gray-200 bg-gray-50 flex-shrink-0"),c(s,"class","bg-white rounded-xl shadow-2xl max-w-2xl w-full max-h-[80vh] flex flex-col"),c(e,"class","fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4")},m(P,re){se(P,e,re),a(e,s),a(s,t),a(t,l),a(l,n),Z(o,n,null),a(l,i),a(l,f),a(f,b),a(b,y),a(f,w),a(f,g),a(t,v),a(t,M),Z(T,M,null),a(s,A),a(s,L),E&&E.m(L,null),a(s,q),a(s,N),a(N,D),Z(H,D,null),a(D,I),a(N,j),a(N,z),V=!0,C||(_=[ie(M,"click",r[34]),ie(D,"click",r[35]),ie(z,"click",r[34])],C=!0)},p(P,re){(!V||re[0]&1048576)&&ze(y,P[20]),P[21]?E?E.p(P,re):(E=wl(P),E.c(),E.m(L,null)):E&&(E.d(1),E=null)},i(P){V||(k(o.$$.fragment,P),k(T.$$.fragment,P),k(H.$$.fragment,P),V=!0)},o(P){$(o.$$.fragment,P),$(T.$$.fragment,P),$(H.$$.fragment,P),V=!1},d(P){P&&u(e),Q(o),Q(T),E&&E.d(),Q(H),C=!1,Tt(_)}}}function wl(r){let e,s,t="Error Details:",l,n,o;return{c(){e=h("div"),s=h("h4"),s.textContent=t,l=S(),n=h("pre"),o=J(r[21]),this.h()},l(i){e=d(i,"DIV",{class:!0});var f=m(e);s=d(f,"H4",{class:!0,"data-svelte-h":!0}),He(s)!=="svelte-3lmggt"&&(s.textContent=t),l=x(f),n=d(f,"PRE",{class:!0});var b=m(n);o=K(b,r[21]),b.forEach(u),f.forEach(u),this.h()},h(){c(s,"class","text-sm font-medium text-gray-900 mb-2"),c(n,"class","text-xs text-gray-700 whitespace-pre-wrap font-mono leading-relaxed break-words"),c(e,"class","bg-gray-50 rounded-lg p-4 border")},m(i,f){se(i,e,f),a(e,s),a(e,l),a(e,n),a(n,o)},p(i,f){f[0]&2097152&&ze(o,i[21])},d(i){i&&u(e)}}}function Kn(r){let e,s,t,l,n,o,i,f,b,y,w,g,p,v,M,T,A,L,q,N,D,H;i=new cn({props:{size:14}}),g=new Fl({props:{size:14}});let I=r[10]&&ul();const j=[Pn,Sn],z=[];function le(_,E){return _[2]==="ui"?0:1}T=le(r),A=z[T]=j[T](r);let V=r[9]&&kl(r),C=r[19]&&$l(r);return{c(){e=h("div"),s=h("header"),t=h("div"),l=h("div"),n=h("div"),o=h("button"),te(i.$$.fragment),f=J(`
|
| 17 |
+
UI`),y=S(),w=h("button"),te(g.$$.fragment),p=J(`
|
| 18 |
+
Code Recorder
|
| 19 |
+
`),I&&I.c(),M=S(),A.c(),L=S(),V&&V.c(),q=S(),C&&C.c(),this.h()},l(_){e=d(_,"DIV",{class:!0});var E=m(e);s=d(E,"HEADER",{class:!0});var P=m(s);t=d(P,"DIV",{class:!0});var re=m(t);l=d(re,"DIV",{class:!0});var U=m(l);n=d(U,"DIV",{class:!0});var W=m(n);o=d(W,"BUTTON",{class:!0});var ne=m(o);ee(i.$$.fragment,ne),f=K(ne,`
|
| 20 |
+
UI`),ne.forEach(u),y=x(W),w=d(W,"BUTTON",{class:!0});var ae=m(w);ee(g.$$.fragment,ae),p=K(ae,`
|
| 21 |
+
Code Recorder
|
| 22 |
+
`),I&&I.l(ae),ae.forEach(u),W.forEach(u),U.forEach(u),re.forEach(u),P.forEach(u),M=x(E),A.l(E),L=x(E),V&&V.l(E),q=x(E),C&&C.l(E),E.forEach(u),this.h()},h(){c(o,"class",b="flex items-center gap-1.5 px-3 py-1 text-sm font-medium rounded transition-colors "+(r[2]==="ui"?"bg-white shadow-sm":"text-gray-600")),c(w,"class",v="flex items-center gap-1.5 px-3 py-1 text-sm font-medium rounded transition-colors relative overflow-hidden "+(r[2]==="code"?"bg-white shadow-sm":"text-gray-600")+" "+(r[10]?"code-flash":"")+" svelte-zv1zz2"),c(n,"class","flex items-center bg-gray-100 rounded-md p-0.5"),c(l,"class","flex items-center gap-2"),c(t,"class","flex items-center justify-end px-4 py-2"),c(s,"class","border-b border-gray-200 bg-white"),c(e,"class","flex flex-col h-full")},m(_,E){se(_,e,E),a(e,s),a(s,t),a(t,l),a(l,n),a(n,o),Z(i,o,null),a(o,f),a(n,y),a(n,w),Z(g,w,null),a(w,p),I&&I.m(w,null),a(e,M),z[T].m(e,null),a(e,L),V&&V.m(e,null),a(e,q),C&&C.m(e,null),N=!0,D||(H=[ie(o,"click",r[39]),ie(w,"click",r[40]),ie(e,"click",r[32])],D=!0)},p(_,E){(!N||E[0]&4&&b!==(b="flex items-center gap-1.5 px-3 py-1 text-sm font-medium rounded transition-colors "+(_[2]==="ui"?"bg-white shadow-sm":"text-gray-600")))&&c(o,"class",b),_[10]?I||(I=ul(),I.c(),I.m(w,null)):I&&(I.d(1),I=null),(!N||E[0]&1028&&v!==(v="flex items-center gap-1.5 px-3 py-1 text-sm font-medium rounded transition-colors relative overflow-hidden "+(_[2]==="code"?"bg-white shadow-sm":"text-gray-600")+" "+(_[10]?"code-flash":"")+" svelte-zv1zz2"))&&c(w,"class",v);let P=T;T=le(_),T===P?z[T].p(_,E):(ut(),$(z[P],1,1,()=>{z[P]=null}),ct(),A=z[T],A?A.p(_,E):(A=z[T]=j[T](_),A.c()),k(A,1),A.m(e,L)),_[9]?V?V.p(_,E):(V=kl(_),V.c(),V.m(e,q)):V&&(V.d(1),V=null),_[19]?C?(C.p(_,E),E[0]&524288&&k(C,1)):(C=$l(_),C.c(),k(C,1),C.m(e,null)):C&&(ut(),$(C,1,1,()=>{C=null}),ct())},i(_){N||(k(i.$$.fragment,_),k(g.$$.fragment,_),k(A),k(C),N=!0)},o(_){$(i.$$.fragment,_),$(g.$$.fragment,_),$(A),$(C),N=!1},d(_){_&&u(e),Q(i),Q(g),I&&I.d(),z[T].d(),V&&V.d(),C&&C.d(),D=!1,Tt(H)}}}function El(){if(typeof window<"u"&&window.gradio&&window.gradio.auth_token)return window.gradio.auth_token;const r=document.querySelector('meta[name="hf-oauth-token"]');if(r){const t=r.getAttribute("content");if(t)return t}const e=["hf_access_token","hf_token","huggingface_token","oauth_token","access_token"];for(const t of e){const l=localStorage.getItem(t);if(l)return l}for(const t of e){const l=sessionStorage.getItem(t);if(l)return l}const s=document.cookie.split(";");for(const t of s){const[l,n]=t.trim().split("=");if(l&&(l.includes("token")||l.includes("hf")||l.includes("oauth")))return decodeURIComponent(n)}try{const t=document.querySelector("script[data-hf-token]");if(t){const l=t.getAttribute("data-hf-token");if(l)return l}}catch{}return null}function It(r){const e=Math.floor(r/60),s=Math.floor(r%60);return`${e}:${s.toString().padStart(2,"0")}`}function Il(){}function Jn(){return`# Save the audio to a file
|
| 23 |
+
output_filename = "output_speech.wav"
|
| 24 |
+
|
| 25 |
+
with open(output_filename, "wb") as f:
|
| 26 |
+
f.write(audio_bytes)
|
| 27 |
+
|
| 28 |
+
print(f"β Audio saved to {output_filename}")
|
| 29 |
+
|
| 30 |
+
# Optional: Play the audio (requires additional packages)
|
| 31 |
+
# from playsound import playsound
|
| 32 |
+
# playsound(output_filename)`}function Xn(r,e,s){let t="In a hole in the ground there lived a hobbit.",l="Lily",n="Chatterbox",o="api",i="ui",f=!1,b=!1,y=[],w=null,g=null,p=!1,v=.25,M=.7,T=!1,A=0,L=0,q="",N=null,D=null,H=null,I=!1,j="",z="";const le=[{id:"chatterbox",name:"Chatterbox",badge:"recommended"},{id:"kokoro",name:"Kokoro",badge:"coming soon",disabled:!0}],V=[{id:"lily",name:"Lily",description:"Warm, conversational voice from a female in her 30s",sample:"/voices/lily.mp3"},{id:"andrew",name:"Andrew",description:"Older British man who speaks clearly and kindly",sample:"/voices/andrew.mp3"},{id:"fairy",name:"Fairy",description:"High and airy female voice that bursts with excitement",sample:"/voices/fairy.mp3"},{id:"pirate",name:"Pirate",description:"Young pirate that speaks gruffly and passionately",sample:"/voices/pirate.mp3"}];async function C(){if(!t.trim())return;if(!El()){window.dispatchEvent(new CustomEvent("show-signin-popover"));return}s(7,b=!0),s(8,w=null),s(14,A=0),y.length===0&&Y("Setup and Import",Ve()),Y("Generate Speech",ue()),i==="ui"&&(s(10,p=!0),setTimeout(()=>{s(10,p=!1)},2500)),s(13,T=!1),s(16,q=t.length>30?t.substring(0,30)+"...":t);try{const de=El(),me={text:t,voice_id:l.toLowerCase(),model_id:n.toLowerCase(),mode:o,access_token:de,parameters:{exaggeration:v,temperature:M}},Ie=await fetch("/api/tts/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(me)});if(!Ie.ok){const at=await Ie.text();throw new Error(`HTTP error! status: ${Ie.status}, body: ${at}`)}const Je=await Ie.json();if(Je.success&&Je.audio_url)s(8,w=Je.audio_url),Y("Save Audio Output",Jn()),i==="ui"&&(s(10,p=!0),setTimeout(()=>{s(10,p=!1)},2500));else{const at=Je.error||"Unknown error occurred";Ne("Generation Failed",at),s(8,w=null)}}catch{Ne("Network Error","Failed to connect to the server. Please check your connection and try again."),s(8,w=null)}finally{s(7,b=!1)}}function _(){N&&(T?N.pause():N.play())}function E(){N&&s(15,L=N.duration)}function P(){N&&s(14,A=N.currentTime)}function re(){s(13,T=!0)}function U(){s(13,T=!1)}function W(){if(w){const F=document.createElement("a");F.href=w,F.download="speech.wav",F.click()}}function ne(F,de){if(de.stopPropagation(),H===F.name)D&&(D.pause(),D.currentTime=0),s(18,H=null);else{D&&D.pause(),s(18,H=F.name);const me=F.sample||"/samples/harvard.wav";D?D.src=me:(D=new Audio(me),D.addEventListener("ended",()=>{s(18,H=null)})),D.play().catch(Ie=>{s(18,H=null)})}}function ae(F){F.target.closest(".model-dropdown")||s(6,f=!1)}function Y(F,de,me=null){const Ie={id:Date.now()+Math.random(),title:F,code:de,output:me,timestamp:new Date().toLocaleTimeString()};return s(3,y=[...y,Ie]),Ie}function Ve(){return o==="local"?`# Install required packages
|
| 33 |
+
# pip install hfstudio huggingface-hub
|
| 34 |
+
|
| 35 |
+
# Start the model server locally
|
| 36 |
+
# Run this command in your terminal:
|
| 37 |
+
# hfstudio start chatterbox --port 7861
|
| 38 |
+
|
| 39 |
+
# Then use the following Python code:
|
| 40 |
+
from huggingface_hub import InferenceClient
|
| 41 |
+
|
| 42 |
+
# Initialize the client for local server
|
| 43 |
+
client = InferenceClient(base_url="http://localhost:7861/v1/")`:`# Install required packages
|
| 44 |
+
# pip install huggingface-hub
|
| 45 |
+
|
| 46 |
+
from huggingface_hub import InferenceClient
|
| 47 |
+
|
| 48 |
+
# Initialize the client for HuggingFace API
|
| 49 |
+
client = InferenceClient(
|
| 50 |
+
provider="fal-ai",
|
| 51 |
+
api_key="YOUR_HF_TOKEN", # Get your token from https://huggingface.co/settings/tokens
|
| 52 |
+
)`}function ue(){return o==="local"?`# Text to convert to speech
|
| 53 |
+
text = """${t}"""
|
| 54 |
+
|
| 55 |
+
# Voice and model settings
|
| 56 |
+
voice = "${l.toLowerCase()}"
|
| 57 |
+
exaggeration = ${v}
|
| 58 |
+
temperature = ${M}
|
| 59 |
+
|
| 60 |
+
# Voice reference URLs (update these to your local paths if needed)
|
| 61 |
+
voice_urls = {
|
| 62 |
+
"lily": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/lily.mp3",
|
| 63 |
+
"andrew": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/andrew.mp3",
|
| 64 |
+
"fairy": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/fairy.mp3",
|
| 65 |
+
"pirate": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/pirate.mp3"
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
# Build extra_body with parameters
|
| 69 |
+
extra_body = {
|
| 70 |
+
"exaggeration": exaggeration,
|
| 71 |
+
"temperature": temperature
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
# Add audio_url for voice reference
|
| 75 |
+
if voice in voice_urls:
|
| 76 |
+
extra_body["audio_url"] = voice_urls[voice]
|
| 77 |
+
|
| 78 |
+
# Generate speech using InferenceClient
|
| 79 |
+
print("Generating speech...")
|
| 80 |
+
try:
|
| 81 |
+
audio_bytes = client.text_to_speech(
|
| 82 |
+
text,
|
| 83 |
+
extra_body=extra_body if extra_body else None,
|
| 84 |
+
)
|
| 85 |
+
print(f"β Generated {len(audio_bytes)} bytes of audio")
|
| 86 |
+
except Exception as e:
|
| 87 |
+
print(f"Error: {e}")`:`# Text to convert to speech
|
| 88 |
+
text = """${t}"""
|
| 89 |
+
|
| 90 |
+
# Voice and model settings
|
| 91 |
+
model = "ResembleAI/chatterbox"
|
| 92 |
+
voice = "${l.toLowerCase()}"
|
| 93 |
+
exaggeration = ${v}
|
| 94 |
+
temperature = ${M}
|
| 95 |
+
|
| 96 |
+
# Voice reference URLs
|
| 97 |
+
voice_urls = {
|
| 98 |
+
"lily": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/lily.mp3",
|
| 99 |
+
"andrew": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/andrew.mp3",
|
| 100 |
+
"fairy": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/fairy.mp3",
|
| 101 |
+
"pirate": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/pirate.mp3"
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
# Build extra_body with parameters
|
| 105 |
+
extra_body = {
|
| 106 |
+
"exaggeration": exaggeration,
|
| 107 |
+
"temperature": temperature
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
# Add audio_url for voice reference
|
| 111 |
+
if voice in voice_urls:
|
| 112 |
+
extra_body["audio_url"] = voice_urls[voice]
|
| 113 |
+
|
| 114 |
+
# Generate speech using InferenceClient
|
| 115 |
+
print("Generating speech...")
|
| 116 |
+
try:
|
| 117 |
+
audio_bytes = client.text_to_speech(
|
| 118 |
+
text,
|
| 119 |
+
model=model,
|
| 120 |
+
extra_body=extra_body if extra_body else None,
|
| 121 |
+
)
|
| 122 |
+
print(f"β Generated {len(audio_bytes)} bytes of audio")
|
| 123 |
+
except Exception as e:
|
| 124 |
+
print(f"Error: {e}")`}function be(F,de="Copied to clipboard!"){navigator.clipboard.writeText(F).then(()=>{s(9,g=de),setTimeout(()=>{s(9,g=null)},2e3)})}function Ne(F,de=""){s(20,j=F),s(21,z=de),s(19,I=!0)}function ye(){s(19,I=!1),s(20,j=""),s(21,z="")}function fe(){const F=z?`${j}
|
| 125 |
+
|
| 126 |
+
Details:
|
| 127 |
+
${z}`:j;be(F,"Error message copied!")}function xe(){const F=y.map(de=>`# ${de.title}
|
| 128 |
+
${de.code}`).join(`
|
| 129 |
+
|
| 130 |
+
`);be(F,"All code copied!")}let $e=t,ft=o;const qe=()=>s(2,i="ui"),we=()=>s(2,i="code");function Te(){t=this.value,s(0,t)}function dt(F){Cl[F?"unshift":"push"](()=>{N=F,s(17,N)})}const Ze=()=>s(6,f=!f),pe=F=>{F.disabled||(s(5,n=F.name),s(6,f=!1))},bt=(F,de)=>ne(F,de),Ee=F=>s(4,l=F.name);function rt(){v=Zt(this.value),s(11,v)}function ot(){M=Zt(this.value),s(12,M)}const Ae=()=>s(1,o="api"),Ke=()=>s(1,o="local"),Se=F=>be(F.code);return r.$$.update=()=>{if(r.$$.dirty[0]&4&&i==="ui"&&s(3,y=[]),r.$$.dirty[0]&10|r.$$.dirty[1]&128&&o!==ft&&y.length>0){s(38,ft=o);const F=y.findIndex(me=>me.title==="Setup and Import");F!==-1&&s(3,y[F].code=Ve(),y);const de=y.findIndex(me=>me.title==="Generate Speech");de!==-1&&s(3,y[de].code=ue(),y),s(3,y=[...y])}r.$$.dirty[0]&12&&y.length===0&&i==="code"&&Y("Setup and Import",Ve()),r.$$.dirty[0]&9|r.$$.dirty[1]&64&&t!==$e&&y.length>0&&s(37,$e=t)},[t,o,i,y,l,n,f,b,w,g,p,v,M,T,A,L,q,N,H,I,j,z,le,V,C,_,E,P,re,U,W,ne,ae,be,ye,fe,xe,$e,ft,qe,we,Te,dt,Ze,pe,bt,Ee,rt,ot,Ae,Ke,Se]}class Zn extends Me{constructor(e){super(),Ue(this,e,Xn,Kn,Pe,{},null,[-1,-1,-1])}}export{Zn as component};
|
models/chatterbox/local.py
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
# /// script
|
| 3 |
+
# requires-python = ">=3.8"
|
| 4 |
+
# dependencies = [
|
| 5 |
+
# "fastapi>=0.100.0",
|
| 6 |
+
# "uvicorn[standard]>=0.20.0",
|
| 7 |
+
# "pydantic>=2.0.0",
|
| 8 |
+
# "httpx>=0.25.0",
|
| 9 |
+
# "typer>=0.9.0",
|
| 10 |
+
# ]
|
| 11 |
+
# ///
|
| 12 |
+
|
| 13 |
+
"""
|
| 14 |
+
Chatterbox TTS Model Server - Mock Implementation
|
| 15 |
+
Compatible with HuggingFace InferenceClient text_to_speech API
|
| 16 |
+
"""
|
| 17 |
+
|
| 18 |
+
import argparse
|
| 19 |
+
import os
|
| 20 |
+
from pathlib import Path
|
| 21 |
+
from typing import Optional, Dict, Any
|
| 22 |
+
|
| 23 |
+
import uvicorn
|
| 24 |
+
from fastapi import FastAPI, HTTPException
|
| 25 |
+
from fastapi.responses import FileResponse
|
| 26 |
+
from fastapi.middleware.cors import CORSMiddleware
|
| 27 |
+
from pydantic import BaseModel
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
class TTSRequest(BaseModel):
|
| 31 |
+
inputs: str # text to synthesize
|
| 32 |
+
parameters: Optional[Dict[str, Any]] = None
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
class InferenceClientTTSRequest(BaseModel):
|
| 36 |
+
inputs: str # text to synthesize
|
| 37 |
+
extra_body: Optional[Dict[str, Any]] = None
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
app = FastAPI(title="Chatterbox TTS Server", version="1.0.0")
|
| 41 |
+
|
| 42 |
+
# Add CORS middleware
|
| 43 |
+
app.add_middleware(
|
| 44 |
+
CORSMiddleware,
|
| 45 |
+
allow_origins=["*"],
|
| 46 |
+
allow_credentials=True,
|
| 47 |
+
allow_methods=["*"],
|
| 48 |
+
allow_headers=["*"],
|
| 49 |
+
)
|
| 50 |
+
|
| 51 |
+
# Path to sample audio file
|
| 52 |
+
SAMPLE_AUDIO_PATH = None
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
@app.get("/")
|
| 56 |
+
async def health_check():
|
| 57 |
+
return {"status": "ok", "model": "ResembleAI/chatterbox"}
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
@app.post("/")
|
| 61 |
+
async def text_to_speech(request: TTSRequest):
|
| 62 |
+
"""
|
| 63 |
+
Text-to-speech endpoint compatible with HuggingFace InferenceClient
|
| 64 |
+
Always returns the same sample audio file for testing
|
| 65 |
+
"""
|
| 66 |
+
if not SAMPLE_AUDIO_PATH or not os.path.exists(SAMPLE_AUDIO_PATH):
|
| 67 |
+
raise HTTPException(
|
| 68 |
+
status_code=500,
|
| 69 |
+
detail="Sample audio file not found. Please provide --sample-audio path."
|
| 70 |
+
)
|
| 71 |
+
|
| 72 |
+
print(f"TTS Request - Text: '{request.inputs[:50]}...' Parameters: {request.parameters}")
|
| 73 |
+
|
| 74 |
+
# Return the sample audio file
|
| 75 |
+
return FileResponse(
|
| 76 |
+
SAMPLE_AUDIO_PATH,
|
| 77 |
+
media_type="audio/wav",
|
| 78 |
+
filename="generated_audio.wav"
|
| 79 |
+
)
|
| 80 |
+
|
| 81 |
+
|
| 82 |
+
@app.post("/v1/text-to-speech")
|
| 83 |
+
async def inference_client_text_to_speech(request: InferenceClientTTSRequest):
|
| 84 |
+
"""
|
| 85 |
+
InferenceClient-compatible endpoint at /v1/text-to-speech
|
| 86 |
+
Always returns the same sample audio file for testing
|
| 87 |
+
"""
|
| 88 |
+
if not SAMPLE_AUDIO_PATH or not os.path.exists(SAMPLE_AUDIO_PATH):
|
| 89 |
+
raise HTTPException(
|
| 90 |
+
status_code=500,
|
| 91 |
+
detail="Sample audio file not found. Please provide --sample-audio path."
|
| 92 |
+
)
|
| 93 |
+
|
| 94 |
+
print(f"InferenceClient TTS Request - Text: '{request.inputs[:50]}...' Extra body: {request.extra_body}")
|
| 95 |
+
|
| 96 |
+
# Return the sample audio file
|
| 97 |
+
return FileResponse(
|
| 98 |
+
SAMPLE_AUDIO_PATH,
|
| 99 |
+
media_type="audio/wav",
|
| 100 |
+
filename="generated_audio.wav"
|
| 101 |
+
)
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
def main():
|
| 105 |
+
global SAMPLE_AUDIO_PATH
|
| 106 |
+
|
| 107 |
+
parser = argparse.ArgumentParser(description="Start Chatterbox TTS Server")
|
| 108 |
+
parser.add_argument("--port", "-p", type=int, default=7860, help="Port to run server on")
|
| 109 |
+
parser.add_argument("--host", default="0.0.0.0", help="Host to bind to")
|
| 110 |
+
parser.add_argument("--sample-audio", required=True, help="Path to sample audio file to return")
|
| 111 |
+
|
| 112 |
+
args = parser.parse_args()
|
| 113 |
+
|
| 114 |
+
# Validate sample audio file exists
|
| 115 |
+
if not os.path.exists(args.sample_audio):
|
| 116 |
+
print(f"Error: Sample audio file not found: {args.sample_audio}")
|
| 117 |
+
exit(1)
|
| 118 |
+
|
| 119 |
+
SAMPLE_AUDIO_PATH = args.sample_audio
|
| 120 |
+
|
| 121 |
+
print(f"ποΈ Starting Chatterbox TTS Server on {args.host}:{args.port}")
|
| 122 |
+
print(f"π Using sample audio: {args.sample_audio}")
|
| 123 |
+
print(f"π API endpoint: http://localhost:{args.port}/")
|
| 124 |
+
|
| 125 |
+
uvicorn.run(
|
| 126 |
+
app,
|
| 127 |
+
host=args.host,
|
| 128 |
+
port=args.port,
|
| 129 |
+
log_level="info"
|
| 130 |
+
)
|
| 131 |
+
|
| 132 |
+
|
| 133 |
+
if __name__ == "__main__":
|
| 134 |
+
main()
|
models/chatterbox/spec.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "Chatterbox",
|
| 3 |
+
"model_id": "ResembleAI/chatterbox",
|
| 4 |
+
"description": "High-quality conversational TTS",
|
| 5 |
+
"provider": "fal-ai",
|
| 6 |
+
"api": {
|
| 7 |
+
"endpoint_model": "ResembleAI/chatterbox",
|
| 8 |
+
"parameters": {
|
| 9 |
+
"exaggeration": {
|
| 10 |
+
"type": "float",
|
| 11 |
+
"min": 0.0,
|
| 12 |
+
"max": 1.0,
|
| 13 |
+
"default": 0.25,
|
| 14 |
+
"description": "Voice exaggeration level"
|
| 15 |
+
},
|
| 16 |
+
"temperature": {
|
| 17 |
+
"type": "float",
|
| 18 |
+
"min": 0.0,
|
| 19 |
+
"max": 1.0,
|
| 20 |
+
"default": 0.7,
|
| 21 |
+
"description": "Voice stability/variability"
|
| 22 |
+
}
|
| 23 |
+
},
|
| 24 |
+
"voice_urls": {
|
| 25 |
+
"lily": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/lily.mp3",
|
| 26 |
+
"andrew": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/andrew.mp3",
|
| 27 |
+
"fairy": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/fairy.mp3",
|
| 28 |
+
"pirate": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/pirate.mp3"
|
| 29 |
+
}
|
| 30 |
+
},
|
| 31 |
+
"local": {
|
| 32 |
+
"script": "models/chatterbox/local.py",
|
| 33 |
+
"default_port": 7861,
|
| 34 |
+
"endpoints": {
|
| 35 |
+
"health": "/",
|
| 36 |
+
"tts": "/",
|
| 37 |
+
"inference_client_tts": "/v1/text-to-speech"
|
| 38 |
+
}
|
| 39 |
+
},
|
| 40 |
+
"voices": [
|
| 41 |
+
{
|
| 42 |
+
"id": "lily",
|
| 43 |
+
"name": "Lily",
|
| 44 |
+
"description": "Warm, conversational voice from a female in her 30s"
|
| 45 |
+
},
|
| 46 |
+
{
|
| 47 |
+
"id": "andrew",
|
| 48 |
+
"name": "Andrew",
|
| 49 |
+
"description": "Older British man who speaks clearly and kindly"
|
| 50 |
+
},
|
| 51 |
+
{
|
| 52 |
+
"id": "fairy",
|
| 53 |
+
"name": "Fairy",
|
| 54 |
+
"description": "High and airy female voice that bursts with excitement"
|
| 55 |
+
},
|
| 56 |
+
{
|
| 57 |
+
"id": "pirate",
|
| 58 |
+
"name": "Pirate",
|
| 59 |
+
"description": "Young pirate that speaks gruffly and passionately"
|
| 60 |
+
}
|
| 61 |
+
]
|
| 62 |
+
}
|
run_dev.sh
CHANGED
|
@@ -14,7 +14,7 @@ if command -v tmux &> /dev/null; then
|
|
| 14 |
tmux split-window -h
|
| 15 |
|
| 16 |
# Run backend in left pane
|
| 17 |
-
tmux send-keys -t hfstudio:0.0 'python -m hfstudio.cli --dev' C-m
|
| 18 |
|
| 19 |
# Run frontend in right pane
|
| 20 |
tmux send-keys -t hfstudio:0.1 'cd frontend && npm install && npm run dev' C-m
|
|
@@ -26,7 +26,7 @@ else
|
|
| 26 |
echo "Running without tmux (install tmux for better experience)"
|
| 27 |
echo ""
|
| 28 |
echo "Starting Backend..."
|
| 29 |
-
python -m hfstudio.cli --dev &
|
| 30 |
BACKEND_PID=$!
|
| 31 |
|
| 32 |
echo "Starting Frontend..."
|
|
|
|
| 14 |
tmux split-window -h
|
| 15 |
|
| 16 |
# Run backend in left pane
|
| 17 |
+
tmux send-keys -t hfstudio:0.0 'python -m hfstudio.cli dev-server --dev' C-m
|
| 18 |
|
| 19 |
# Run frontend in right pane
|
| 20 |
tmux send-keys -t hfstudio:0.1 'cd frontend && npm install && npm run dev' C-m
|
|
|
|
| 26 |
echo "Running without tmux (install tmux for better experience)"
|
| 27 |
echo ""
|
| 28 |
echo "Starting Backend..."
|
| 29 |
+
python -m hfstudio.cli dev-server --dev &
|
| 30 |
BACKEND_PID=$!
|
| 31 |
|
| 32 |
echo "Starting Frontend..."
|