GitHub Action
commited on
Commit
·
a45e6a8
1
Parent(s):
f41997a
Sync from GitHub: 63b56d5684377bbd646558687fbe715511ffc27d
Browse files- .gitattributes +6 -0
- README.md +3 -2
- README_SPACE.md +3 -2
- frontend/src/routes/+layout.svelte +13 -2
- frontend/src/routes/+page.svelte +266 -13
- hfstudio/server.py +13 -5
- hfstudio/static/_app/immutable/assets/0.Z2FEQDaf.css +1 -0
- hfstudio/static/_app/immutable/assets/2.CRAr3Z-Y.css +1 -0
- hfstudio/static/_app/immutable/chunks/B0cuSUdZ.js +1 -0
- hfstudio/static/_app/immutable/chunks/B1LPgyXz.js +1 -0
- hfstudio/static/_app/immutable/chunks/Bdt-LMmF.js +3 -0
- hfstudio/static/_app/immutable/entry/app.By6Ln18A.js +2 -0
- hfstudio/static/_app/immutable/entry/start.C61NpXpG.js +1 -0
- hfstudio/static/_app/immutable/nodes/0.Cai-H-zF.js +3 -0
- hfstudio/static/_app/immutable/nodes/1.CUXC-_wj.js +1 -0
- hfstudio/static/_app/immutable/nodes/2.ColiJK7M.js +65 -0
- hfstudio/static/_app/immutable/nodes/3.pthhtWhZ.js +1 -0
- hfstudio/static/_app/version.json +1 -1
- hfstudio/static/index.html +7 -7
.gitattributes
CHANGED
|
@@ -7,3 +7,9 @@
|
|
| 7 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 8 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 9 |
*.pdf filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 8 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 9 |
*.pdf filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
hfstudio/static/assets/hf-studio-logo.png filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
hfstudio/static/assets/hf-logo.png filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
frontend/static/assets/hf-studio-logo.png filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
frontend/static/assets/hf-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
|
README.md
CHANGED
|
@@ -7,6 +7,7 @@ sdk: gradio
|
|
| 7 |
sdk_version: 5.49.1
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
# HFStudio 🎙️
|
|
@@ -20,14 +21,14 @@ A local and API-based Text-to-Speech studio for creating high-quality speech fro
|
|
| 20 |
- ⚡ **Real-time Generation**: Fast speech synthesis
|
| 21 |
- 🔧 **Parameter Control**: Fine-tune speed, stability, and similarity
|
| 22 |
- 🎵 **Audio Preview**: Built-in audio player with controls
|
| 23 |
-
- 🔐 **HuggingFace Integration**:
|
| 24 |
|
| 25 |
## Quick Start
|
| 26 |
|
| 27 |
This Space runs HFStudio automatically. Simply:
|
| 28 |
|
| 29 |
1. **Open the Space** - The web interface will load automatically
|
| 30 |
-
2. **Sign In** (
|
| 31 |
3. **Enter Text** - Type or paste the text you want to convert to speech
|
| 32 |
4. **Choose Voice** - Select from available voice models
|
| 33 |
5. **Adjust Settings** - Tune speed, stability, and other parameters
|
|
|
|
| 7 |
sdk_version: 5.49.1
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
+
hf_oauth: true
|
| 11 |
---
|
| 12 |
|
| 13 |
# HFStudio 🎙️
|
|
|
|
| 21 |
- ⚡ **Real-time Generation**: Fast speech synthesis
|
| 22 |
- 🔧 **Parameter Control**: Fine-tune speed, stability, and similarity
|
| 23 |
- 🎵 **Audio Preview**: Built-in audio player with controls
|
| 24 |
+
- 🔐 **HuggingFace Integration**: Automatic sign-in with your HF account (OAuth enabled)
|
| 25 |
|
| 26 |
## Quick Start
|
| 27 |
|
| 28 |
This Space runs HFStudio automatically. Simply:
|
| 29 |
|
| 30 |
1. **Open the Space** - The web interface will load automatically
|
| 31 |
+
2. **Sign In** (automatic) - You'll be automatically signed in with your HuggingFace account
|
| 32 |
3. **Enter Text** - Type or paste the text you want to convert to speech
|
| 33 |
4. **Choose Voice** - Select from available voice models
|
| 34 |
5. **Adjust Settings** - Tune speed, stability, and other parameters
|
README_SPACE.md
CHANGED
|
@@ -7,6 +7,7 @@ sdk: gradio
|
|
| 7 |
sdk_version: 5.49.1
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
# HFStudio 🎙️
|
|
@@ -20,14 +21,14 @@ A local and API-based Text-to-Speech studio for creating high-quality speech fro
|
|
| 20 |
- ⚡ **Real-time Generation**: Fast speech synthesis
|
| 21 |
- 🔧 **Parameter Control**: Fine-tune speed, stability, and similarity
|
| 22 |
- 🎵 **Audio Preview**: Built-in audio player with controls
|
| 23 |
-
- 🔐 **HuggingFace Integration**:
|
| 24 |
|
| 25 |
## Quick Start
|
| 26 |
|
| 27 |
This Space runs HFStudio automatically. Simply:
|
| 28 |
|
| 29 |
1. **Open the Space** - The web interface will load automatically
|
| 30 |
-
2. **Sign In** (
|
| 31 |
3. **Enter Text** - Type or paste the text you want to convert to speech
|
| 32 |
4. **Choose Voice** - Select from available voice models
|
| 33 |
5. **Adjust Settings** - Tune speed, stability, and other parameters
|
|
|
|
| 7 |
sdk_version: 5.49.1
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
+
hf_oauth: true
|
| 11 |
---
|
| 12 |
|
| 13 |
# HFStudio 🎙️
|
|
|
|
| 21 |
- ⚡ **Real-time Generation**: Fast speech synthesis
|
| 22 |
- 🔧 **Parameter Control**: Fine-tune speed, stability, and similarity
|
| 23 |
- 🎵 **Audio Preview**: Built-in audio player with controls
|
| 24 |
+
- 🔐 **HuggingFace Integration**: Automatic sign-in with your HF account (OAuth enabled)
|
| 25 |
|
| 26 |
## Quick Start
|
| 27 |
|
| 28 |
This Space runs HFStudio automatically. Simply:
|
| 29 |
|
| 30 |
1. **Open the Space** - The web interface will load automatically
|
| 31 |
+
2. **Sign In** (automatic) - You'll be automatically signed in with your HuggingFace account
|
| 32 |
3. **Enter Text** - Type or paste the text you want to convert to speech
|
| 33 |
4. **Choose Voice** - Select from available voice models
|
| 34 |
5. **Adjust Settings** - Tune speed, stability, and other parameters
|
frontend/src/routes/+layout.svelte
CHANGED
|
@@ -134,8 +134,19 @@
|
|
| 134 |
} else {
|
| 135 |
// If we're on Spaces, redirect to OAuth
|
| 136 |
if (window.location.hostname.includes('hf.space') || window.location.hostname.includes('huggingface.co')) {
|
| 137 |
-
|
| 138 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
} else {
|
| 140 |
// Local development fallback: show token input
|
| 141 |
showTokenInput = true;
|
|
|
|
| 134 |
} else {
|
| 135 |
// If we're on Spaces, redirect to OAuth
|
| 136 |
if (window.location.hostname.includes('hf.space') || window.location.hostname.includes('huggingface.co')) {
|
| 137 |
+
// On Spaces, we need to get the OAuth client ID from the backend
|
| 138 |
+
try {
|
| 139 |
+
const response = await fetch('/api/auth/oauth-config');
|
| 140 |
+
const config = await response.json();
|
| 141 |
+
const oauthUrl = `https://huggingface.co/oauth/authorize?client_id=${config.client_id}&redirect_uri=${encodeURIComponent(window.location.origin + '/auth/callback')}&scope=openid profile&response_type=code&state=${Date.now()}`;
|
| 142 |
+
window.location.href = oauthUrl;
|
| 143 |
+
} catch (error) {
|
| 144 |
+
console.error('Failed to get OAuth config:', error);
|
| 145 |
+
// Fallback to manual token input
|
| 146 |
+
showTokenInput = true;
|
| 147 |
+
tokenInput = '';
|
| 148 |
+
tokenError = '';
|
| 149 |
+
}
|
| 150 |
} else {
|
| 151 |
// Local development fallback: show token input
|
| 152 |
showTokenInput = true;
|
frontend/src/routes/+page.svelte
CHANGED
|
@@ -1,14 +1,32 @@
|
|
| 1 |
<script>
|
| 2 |
import { Play, Download, Loader2, AlertCircle, ChevronDown, Copy, RefreshCw, Share, MoreHorizontal, Settings, Sliders, Pause, SkipBack, SkipForward, Layout, Code } from 'lucide-svelte';
|
| 3 |
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
let selectedVoice = 'Novia';
|
| 6 |
let selectedModel = 'Chatterbox';
|
| 7 |
let mode = 'api'; // 'api' or 'local'
|
| 8 |
let viewMode = 'ui'; // 'ui' or 'code'
|
| 9 |
let modelDropdownOpen = false;
|
| 10 |
let isGenerating = false;
|
|
|
|
| 11 |
let audioUrl = null;
|
|
|
|
|
|
|
| 12 |
let speed = 1.0;
|
| 13 |
let stability = 0.5;
|
| 14 |
let similarity = 0.75;
|
|
@@ -38,6 +56,20 @@
|
|
| 38 |
isGenerating = true;
|
| 39 |
audioUrl = null;
|
| 40 |
currentTime = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
isPlaying = false;
|
| 42 |
|
| 43 |
// Create title from first part of text
|
|
@@ -85,6 +117,16 @@
|
|
| 85 |
|
| 86 |
if (result.success && result.audio_url) {
|
| 87 |
audioUrl = result.audio_url;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
} else {
|
| 89 |
// Show error message to user
|
| 90 |
const errorMessage = result.error || 'Unknown error occurred';
|
|
@@ -250,6 +292,108 @@
|
|
| 250 |
modelDropdownOpen = false;
|
| 251 |
}
|
| 252 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 253 |
|
| 254 |
</script>
|
| 255 |
|
|
@@ -286,11 +430,14 @@
|
|
| 286 |
UI
|
| 287 |
</button>
|
| 288 |
<button
|
| 289 |
-
class="flex items-center gap-1.5 px-3 py-1 text-sm font-medium rounded transition-colors {viewMode === 'code' ? 'bg-white shadow-sm' : 'text-gray-600'}"
|
| 290 |
on:click={() => viewMode = 'code'}
|
| 291 |
>
|
| 292 |
<Code size={14} />
|
| 293 |
Code
|
|
|
|
|
|
|
|
|
|
| 294 |
</button>
|
| 295 |
</div>
|
| 296 |
</div>
|
|
@@ -628,18 +775,124 @@
|
|
| 628 |
</div>
|
| 629 |
{:else}
|
| 630 |
<!-- Code view -->
|
| 631 |
-
<div class="flex-1
|
| 632 |
-
<div class="max-w-
|
| 633 |
-
|
| 634 |
-
|
| 635 |
-
<
|
| 636 |
-
|
| 637 |
-
|
| 638 |
-
|
| 639 |
-
|
| 640 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 641 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 642 |
</div>
|
| 643 |
</div>
|
| 644 |
{/if}
|
| 645 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
<script>
|
| 2 |
import { Play, Download, Loader2, AlertCircle, ChevronDown, Copy, RefreshCw, Share, MoreHorizontal, Settings, Sliders, Pause, SkipBack, SkipForward, Layout, Code } from 'lucide-svelte';
|
| 3 |
|
| 4 |
+
// Simple Python syntax highlighting
|
| 5 |
+
function highlightPython(code) {
|
| 6 |
+
return code
|
| 7 |
+
// Keywords
|
| 8 |
+
.replace(/\b(import|from|def|class|if|else|elif|try|except|finally|with|as|return|for|while|in|is|not|and|or|None|True|False|print|open)\b/g, '<span class="text-blue-600 font-medium">$1</span>')
|
| 9 |
+
// Strings
|
| 10 |
+
.replace(/("""[\s\S]*?"""|'''[\s\S]*?'''|"[^"]*"|'[^']*')/g, '<span class="text-green-600">$1</span>')
|
| 11 |
+
// Comments
|
| 12 |
+
.replace(/(#[^\n]*)/g, '<span class="text-gray-500 italic">$1</span>')
|
| 13 |
+
// Numbers
|
| 14 |
+
.replace(/\b(\d+\.?\d*)\b/g, '<span class="text-purple-600">$1</span>')
|
| 15 |
+
// Functions
|
| 16 |
+
.replace(/(\w+)(\()/g, '<span class="text-amber-600">$1</span>$2');
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
let text = `In a hole in the ground there lived a hobbit. Not a nasty, dirty, wet hole, filled with the ends of worms and an oozy smell, nor yet a dry, bare, sandy hole with nothing in it to sit down on or to eat: it was a hobbit-hole, and that means comfort.`;
|
| 20 |
let selectedVoice = 'Novia';
|
| 21 |
let selectedModel = 'Chatterbox';
|
| 22 |
let mode = 'api'; // 'api' or 'local'
|
| 23 |
let viewMode = 'ui'; // 'ui' or 'code'
|
| 24 |
let modelDropdownOpen = false;
|
| 25 |
let isGenerating = false;
|
| 26 |
+
let codeCells = []; // Store code cells for the Code view
|
| 27 |
let audioUrl = null;
|
| 28 |
+
let copyNotification = null; // For copy notifications
|
| 29 |
+
let codeButtonFlash = false; // For animating the code button
|
| 30 |
let speed = 1.0;
|
| 31 |
let stability = 0.5;
|
| 32 |
let similarity = 0.75;
|
|
|
|
| 56 |
isGenerating = true;
|
| 57 |
audioUrl = null;
|
| 58 |
currentTime = 0;
|
| 59 |
+
|
| 60 |
+
// Add code cell for this generation
|
| 61 |
+
if (codeCells.length === 0) {
|
| 62 |
+
addCodeCell('Setup and Import', generateSetupCode());
|
| 63 |
+
}
|
| 64 |
+
addCodeCell('Generate Speech', generateTTSCode());
|
| 65 |
+
|
| 66 |
+
// Flash the code button to draw attention
|
| 67 |
+
if (viewMode === 'ui') {
|
| 68 |
+
codeButtonFlash = true;
|
| 69 |
+
setTimeout(() => {
|
| 70 |
+
codeButtonFlash = false;
|
| 71 |
+
}, 1000);
|
| 72 |
+
}
|
| 73 |
isPlaying = false;
|
| 74 |
|
| 75 |
// Create title from first part of text
|
|
|
|
| 117 |
|
| 118 |
if (result.success && result.audio_url) {
|
| 119 |
audioUrl = result.audio_url;
|
| 120 |
+
// Add code cell for saving the audio
|
| 121 |
+
addCodeCell('Save Audio Output', generateSaveCode());
|
| 122 |
+
|
| 123 |
+
// Flash the code button again for the save code
|
| 124 |
+
if (viewMode === 'ui') {
|
| 125 |
+
codeButtonFlash = true;
|
| 126 |
+
setTimeout(() => {
|
| 127 |
+
codeButtonFlash = false;
|
| 128 |
+
}, 1000);
|
| 129 |
+
}
|
| 130 |
} else {
|
| 131 |
// Show error message to user
|
| 132 |
const errorMessage = result.error || 'Unknown error occurred';
|
|
|
|
| 292 |
modelDropdownOpen = false;
|
| 293 |
}
|
| 294 |
}
|
| 295 |
+
|
| 296 |
+
function addCodeCell(title, code, output = null) {
|
| 297 |
+
const cell = {
|
| 298 |
+
id: Date.now() + Math.random(),
|
| 299 |
+
title,
|
| 300 |
+
code,
|
| 301 |
+
output,
|
| 302 |
+
timestamp: new Date().toLocaleTimeString()
|
| 303 |
+
};
|
| 304 |
+
codeCells = [...codeCells, cell];
|
| 305 |
+
return cell;
|
| 306 |
+
}
|
| 307 |
+
|
| 308 |
+
function generateSetupCode() {
|
| 309 |
+
const token = getHuggingFaceToken();
|
| 310 |
+
const tokenDisplay = token ? 'YOUR_HF_TOKEN' : 'YOUR_HF_TOKEN';
|
| 311 |
+
|
| 312 |
+
return `# Install required packages
|
| 313 |
+
# pip install huggingface-hub
|
| 314 |
+
|
| 315 |
+
from huggingface_hub import InferenceClient
|
| 316 |
+
import base64
|
| 317 |
+
import io
|
| 318 |
+
|
| 319 |
+
# Initialize the client
|
| 320 |
+
client = InferenceClient(
|
| 321 |
+
provider="fal-ai",
|
| 322 |
+
api_key="${tokenDisplay}", # Get your token from https://huggingface.co/settings/tokens
|
| 323 |
+
)`;
|
| 324 |
+
}
|
| 325 |
+
|
| 326 |
+
function generateTTSCode() {
|
| 327 |
+
const truncatedText = text.length > 100 ? text.substring(0, 100) + '...' : text;
|
| 328 |
+
|
| 329 |
+
return `# Text to convert to speech
|
| 330 |
+
text = """${text}"""
|
| 331 |
+
|
| 332 |
+
# Voice and model settings
|
| 333 |
+
model = "ResembleAI/chatterbox"
|
| 334 |
+
voice = "${selectedVoice.toLowerCase()}"
|
| 335 |
+
speed = ${speed}
|
| 336 |
+
stability = ${stability}
|
| 337 |
+
similarity = ${similarity}
|
| 338 |
+
style_exaggeration = ${styleExaggeration}
|
| 339 |
+
|
| 340 |
+
# Generate speech
|
| 341 |
+
print("Generating speech...")
|
| 342 |
+
try:
|
| 343 |
+
audio_bytes = client.text_to_speech(
|
| 344 |
+
text,
|
| 345 |
+
model=model,
|
| 346 |
+
# Note: Voice and other parameters may vary by model
|
| 347 |
+
)
|
| 348 |
+
print(f"✓ Generated {len(audio_bytes)} bytes of audio")
|
| 349 |
+
except Exception as e:
|
| 350 |
+
print(f"Error: {e}")`;
|
| 351 |
+
}
|
| 352 |
+
|
| 353 |
+
function generateSaveCode() {
|
| 354 |
+
return `# Save the audio to a file
|
| 355 |
+
output_filename = "output_speech.wav"
|
| 356 |
+
|
| 357 |
+
with open(output_filename, "wb") as f:
|
| 358 |
+
f.write(audio_bytes)
|
| 359 |
+
|
| 360 |
+
print(f"✓ Audio saved to {output_filename}")
|
| 361 |
+
|
| 362 |
+
# Optional: Play the audio (requires additional packages)
|
| 363 |
+
# from playsound import playsound
|
| 364 |
+
# playsound(output_filename)`;
|
| 365 |
+
}
|
| 366 |
+
|
| 367 |
+
function copyToClipboard(text, message = 'Copied to clipboard!') {
|
| 368 |
+
navigator.clipboard.writeText(text).then(() => {
|
| 369 |
+
copyNotification = message;
|
| 370 |
+
setTimeout(() => {
|
| 371 |
+
copyNotification = null;
|
| 372 |
+
}, 2000);
|
| 373 |
+
});
|
| 374 |
+
}
|
| 375 |
+
|
| 376 |
+
function copyAllCode() {
|
| 377 |
+
const allCode = codeCells.map(cell => `# ${cell.title}\n${cell.code}`).join('\n\n');
|
| 378 |
+
copyToClipboard(allCode, 'All code copied!');
|
| 379 |
+
}
|
| 380 |
+
|
| 381 |
+
// Initialize with setup code
|
| 382 |
+
$: if (codeCells.length === 0 && viewMode === 'code') {
|
| 383 |
+
addCodeCell('Setup and Import', generateSetupCode());
|
| 384 |
+
}
|
| 385 |
+
|
| 386 |
+
// Track when user changes text
|
| 387 |
+
let previousText = text;
|
| 388 |
+
$: if (text !== previousText && codeCells.length > 0) {
|
| 389 |
+
previousText = text;
|
| 390 |
+
// Don't add a cell for every keystroke, user will click generate
|
| 391 |
+
}
|
| 392 |
+
|
| 393 |
+
// Clear code cells when switching back to UI
|
| 394 |
+
$: if (viewMode === 'ui') {
|
| 395 |
+
codeCells = [];
|
| 396 |
+
}
|
| 397 |
|
| 398 |
</script>
|
| 399 |
|
|
|
|
| 430 |
UI
|
| 431 |
</button>
|
| 432 |
<button
|
| 433 |
+
class="flex items-center gap-1.5 px-3 py-1 text-sm font-medium rounded transition-colors relative overflow-hidden {viewMode === 'code' ? 'bg-white shadow-sm' : 'text-gray-600'} {codeButtonFlash ? 'code-flash' : ''}"
|
| 434 |
on:click={() => viewMode = 'code'}
|
| 435 |
>
|
| 436 |
<Code size={14} />
|
| 437 |
Code
|
| 438 |
+
{#if codeButtonFlash}
|
| 439 |
+
<span class="flash-sweep"></span>
|
| 440 |
+
{/if}
|
| 441 |
</button>
|
| 442 |
</div>
|
| 443 |
</div>
|
|
|
|
| 775 |
</div>
|
| 776 |
{:else}
|
| 777 |
<!-- Code view -->
|
| 778 |
+
<div class="flex-1 bg-gray-50 overflow-y-auto">
|
| 779 |
+
<div class="max-w-4xl mx-auto p-8">
|
| 780 |
+
<!-- Header with copy all button -->
|
| 781 |
+
<div class="flex items-center justify-between mb-6">
|
| 782 |
+
<div>
|
| 783 |
+
<h2 class="text-2xl font-semibold text-gray-900">Integration Code</h2>
|
| 784 |
+
<p class="text-sm text-gray-600 mt-1">Python code to reproduce your actions via the API</p>
|
| 785 |
+
</div>
|
| 786 |
+
{#if codeCells.length > 0}
|
| 787 |
+
<button
|
| 788 |
+
on:click={copyAllCode}
|
| 789 |
+
class="flex items-center gap-2 px-4 py-2 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors"
|
| 790 |
+
>
|
| 791 |
+
<Copy size={16} />
|
| 792 |
+
Copy All
|
| 793 |
+
</button>
|
| 794 |
+
{/if}
|
| 795 |
+
</div>
|
| 796 |
+
|
| 797 |
+
<!-- Code cells -->
|
| 798 |
+
{#if codeCells.length === 0}
|
| 799 |
+
<div class="bg-white rounded-lg border border-gray-200 p-8 text-center">
|
| 800 |
+
<p class="text-gray-500">Start using the UI to see generated code here</p>
|
| 801 |
</div>
|
| 802 |
+
{:else}
|
| 803 |
+
<div class="space-y-4">
|
| 804 |
+
{#each codeCells as cell (cell.id)}
|
| 805 |
+
<div class="bg-white rounded-lg border border-gray-200 overflow-hidden">
|
| 806 |
+
<!-- Cell header -->
|
| 807 |
+
<div class="flex items-center justify-between px-4 py-2 bg-gray-50 border-b border-gray-200">
|
| 808 |
+
<div class="flex items-center gap-3">
|
| 809 |
+
<span class="text-sm font-medium text-gray-700">{cell.title}</span>
|
| 810 |
+
<span class="text-xs text-gray-500">{cell.timestamp}</span>
|
| 811 |
+
</div>
|
| 812 |
+
<button
|
| 813 |
+
on:click={() => copyToClipboard(cell.code)}
|
| 814 |
+
class="p-1.5 hover:bg-gray-200 rounded transition-colors"
|
| 815 |
+
title="Copy code"
|
| 816 |
+
>
|
| 817 |
+
<Copy size={14} class="text-gray-600" />
|
| 818 |
+
</button>
|
| 819 |
+
</div>
|
| 820 |
+
|
| 821 |
+
<!-- Code content -->
|
| 822 |
+
<div class="relative">
|
| 823 |
+
<pre class="p-4 overflow-x-auto bg-gray-50"><code class="language-python text-sm">{@html highlightPython(cell.code)}</code></pre>
|
| 824 |
+
</div>
|
| 825 |
+
|
| 826 |
+
<!-- Output (if any) -->
|
| 827 |
+
{#if cell.output}
|
| 828 |
+
<div class="px-4 py-2 bg-gray-900 text-green-400 font-mono text-xs border-t border-gray-200">
|
| 829 |
+
{cell.output}
|
| 830 |
+
</div>
|
| 831 |
+
{/if}
|
| 832 |
+
</div>
|
| 833 |
+
{/each}
|
| 834 |
+
</div>
|
| 835 |
+
{/if}
|
| 836 |
</div>
|
| 837 |
</div>
|
| 838 |
{/if}
|
| 839 |
+
|
| 840 |
+
<!-- Copy notification toast -->
|
| 841 |
+
{#if copyNotification}
|
| 842 |
+
<div class="fixed bottom-4 right-4 px-4 py-2 bg-gray-900 text-white rounded-lg shadow-lg z-50 animate-fade-in">
|
| 843 |
+
{copyNotification}
|
| 844 |
+
</div>
|
| 845 |
+
{/if}
|
| 846 |
+
</div>
|
| 847 |
+
|
| 848 |
+
<style>
|
| 849 |
+
@keyframes fade-in {
|
| 850 |
+
from { opacity: 0; transform: translateY(10px); }
|
| 851 |
+
to { opacity: 1; transform: translateY(0); }
|
| 852 |
+
}
|
| 853 |
+
|
| 854 |
+
.animate-fade-in {
|
| 855 |
+
animation: fade-in 0.3s ease-out;
|
| 856 |
+
}
|
| 857 |
+
|
| 858 |
+
@keyframes sweep {
|
| 859 |
+
0% {
|
| 860 |
+
left: -100%;
|
| 861 |
+
}
|
| 862 |
+
100% {
|
| 863 |
+
left: 100%;
|
| 864 |
+
}
|
| 865 |
+
}
|
| 866 |
+
|
| 867 |
+
.flash-sweep {
|
| 868 |
+
position: absolute;
|
| 869 |
+
top: 0;
|
| 870 |
+
left: -100%;
|
| 871 |
+
width: 100%;
|
| 872 |
+
height: 100%;
|
| 873 |
+
background: linear-gradient(90deg,
|
| 874 |
+
transparent 0%,
|
| 875 |
+
rgba(251, 191, 36, 0.4) 25%,
|
| 876 |
+
rgba(249, 115, 22, 0.6) 50%,
|
| 877 |
+
rgba(251, 191, 36, 0.4) 75%,
|
| 878 |
+
transparent 100%);
|
| 879 |
+
animation: sweep 0.8s ease-out;
|
| 880 |
+
pointer-events: none;
|
| 881 |
+
}
|
| 882 |
+
|
| 883 |
+
.code-flash {
|
| 884 |
+
animation: pulse 0.3s ease-out;
|
| 885 |
+
}
|
| 886 |
+
|
| 887 |
+
@keyframes pulse {
|
| 888 |
+
0% {
|
| 889 |
+
box-shadow: 0 0 0 0 rgba(251, 191, 36, 0);
|
| 890 |
+
}
|
| 891 |
+
50% {
|
| 892 |
+
box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.3);
|
| 893 |
+
}
|
| 894 |
+
100% {
|
| 895 |
+
box-shadow: 0 0 0 0 rgba(251, 191, 36, 0);
|
| 896 |
+
}
|
| 897 |
+
}
|
| 898 |
+
</style>
|
hfstudio/server.py
CHANGED
|
@@ -94,6 +94,14 @@ async def get_status():
|
|
| 94 |
"api_configured": True
|
| 95 |
}
|
| 96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
@app.get("/api/auth/local-token")
|
| 98 |
async def get_local_token():
|
| 99 |
"""Get local HF token if available (for local development)"""
|
|
@@ -267,9 +275,9 @@ async def exchange_oauth_token(request: OAuthTokenRequest, http_request: Request
|
|
| 267 |
# HuggingFace OAuth token endpoint
|
| 268 |
token_url = "https://huggingface.co/oauth/token"
|
| 269 |
|
| 270 |
-
# OAuth app credentials
|
| 271 |
-
client_id = "cdf32a17-e40f-4a84-b683-f66aa1105793"
|
| 272 |
-
client_secret = "f590cb2d-6eac-4cef-a0cb-d0116825295c"
|
| 273 |
|
| 274 |
# Determine redirect URI based on environment
|
| 275 |
if os.getenv("SPACE_HOST"):
|
|
@@ -342,8 +350,8 @@ async def oauth_callback(code: str = None, state: str = None, request: Request =
|
|
| 342 |
# Exchange code for token using the same logic as the API endpoint
|
| 343 |
token_url = "https://huggingface.co/oauth/token"
|
| 344 |
|
| 345 |
-
client_id = "cdf32a17-e40f-4a84-b683-f66aa1105793"
|
| 346 |
-
client_secret = "f590cb2d-6eac-4cef-a0cb-d0116825295c"
|
| 347 |
|
| 348 |
# Determine redirect URI based on environment
|
| 349 |
if os.getenv("SPACE_HOST"):
|
|
|
|
| 94 |
"api_configured": True
|
| 95 |
}
|
| 96 |
|
| 97 |
+
@app.get("/api/auth/oauth-config")
|
| 98 |
+
async def get_oauth_config():
|
| 99 |
+
"""Get OAuth configuration for the frontend"""
|
| 100 |
+
return {
|
| 101 |
+
"client_id": os.getenv("OAUTH_CLIENT_ID", "cdf32a17-e40f-4a84-b683-f66aa1105793"),
|
| 102 |
+
"is_spaces": bool(os.getenv("SPACE_HOST"))
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
@app.get("/api/auth/local-token")
|
| 106 |
async def get_local_token():
|
| 107 |
"""Get local HF token if available (for local development)"""
|
|
|
|
| 275 |
# HuggingFace OAuth token endpoint
|
| 276 |
token_url = "https://huggingface.co/oauth/token"
|
| 277 |
|
| 278 |
+
# OAuth app credentials - use environment variables on Spaces, fallback to hardcoded for local dev
|
| 279 |
+
client_id = os.getenv("OAUTH_CLIENT_ID", "cdf32a17-e40f-4a84-b683-f66aa1105793")
|
| 280 |
+
client_secret = os.getenv("OAUTH_CLIENT_SECRET", "f590cb2d-6eac-4cef-a0cb-d0116825295c")
|
| 281 |
|
| 282 |
# Determine redirect URI based on environment
|
| 283 |
if os.getenv("SPACE_HOST"):
|
|
|
|
| 350 |
# Exchange code for token using the same logic as the API endpoint
|
| 351 |
token_url = "https://huggingface.co/oauth/token"
|
| 352 |
|
| 353 |
+
client_id = os.getenv("OAUTH_CLIENT_ID", "cdf32a17-e40f-4a84-b683-f66aa1105793")
|
| 354 |
+
client_secret = os.getenv("OAUTH_CLIENT_SECRET", "f590cb2d-6eac-4cef-a0cb-d0116825295c")
|
| 355 |
|
| 356 |
# Determine redirect URI based on environment
|
| 357 |
if os.getenv("SPACE_HOST"):
|
hfstudio/static/_app/immutable/assets/0.Z2FEQDaf.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}:root{--background: 0 0% 100%;--foreground: 240 10% 3.9%;--card: 0 0% 100%;--card-foreground: 240 10% 3.9%;--popover: 0 0% 100%;--popover-foreground: 240 10% 3.9%;--primary: 240 5.9% 10%;--primary-foreground: 0 0% 98%;--secondary: 240 4.8% 95.9%;--secondary-foreground: 240 5.9% 10%;--muted: 240 4.8% 95.9%;--muted-foreground: 240 3.8% 46.1%;--accent: 240 4.8% 95.9%;--accent-foreground: 240 5.9% 10%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 0 0% 98%;--border: 240 5.9% 90%;--input: 240 5.9% 90%;--ring: 240 5.9% 10%;--radius: .5rem}.visible{visibility:visible}.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}.left-0{left:0}.left-2{left:.5rem}.left-56{left:14rem}.right-0{right:0}.right-2{right:.5rem}.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}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.block{display:block}.flex{display:flex}.contents{display:contents}.hidden{display:none}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-12{height:3rem}.h-2{height:.5rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-full{height:100%}.h-screen{height:100vh}.min-h-screen{min-height:100vh}.w-12{width:3rem}.w-2{width:.5rem}.w-5{width:1.25rem}.w-52{width:13rem}.w-56{width:14rem}.w-8{width:2rem}.w-80{width:20rem}.w-full{width:100%}.max-w-4xl{max-width:56rem}.max-w-md{max-width:28rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.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-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * 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}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-amber-400{--tw-border-opacity: 1;border-color:rgb(251 191 36 / var(--tw-border-opacity, 1))}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-gray-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-t-transparent{border-top-color:transparent}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-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-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-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.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-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}.italic{font-style:italic}.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-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-purple-600{--tw-text-opacity: 1;color:rgb(147 51 234 / 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-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.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}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}.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\: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-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/assets/2.CRAr3Z-Y.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
@keyframes svelte-1p3ull4-fade-in{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.animate-fade-in.svelte-1p3ull4{animation:svelte-1p3ull4-fade-in .3s ease-out}@keyframes svelte-1p3ull4-sweep{0%{left:-100%}to{left:100%}}.flash-sweep.svelte-1p3ull4{position:absolute;top:0;left:-100%;width:100%;height:100%;background:linear-gradient(90deg,transparent 0%,rgba(251,191,36,.4) 25%,rgba(249,115,22,.6) 50%,rgba(251,191,36,.4) 75%,transparent 100%);animation:svelte-1p3ull4-sweep .8s ease-out;pointer-events:none}.code-flash.svelte-1p3ull4{animation:svelte-1p3ull4-pulse .3s ease-out}@keyframes svelte-1p3ull4-pulse{0%{box-shadow:0 0 #fbbf2400}50%{box-shadow:0 0 0 4px #fbbf244d}to{box-shadow:0 0 #fbbf2400}}
|
hfstudio/static/_app/immutable/chunks/B0cuSUdZ.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{s as e}from"./Bdt-LMmF.js";const r=()=>{const s=e;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},b={subscribe(s){return r().page.subscribe(s)}};export{b as p};
|
hfstudio/static/_app/immutable/chunks/B1LPgyXz.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
var Q=Object.defineProperty;var V=(t,n,e)=>n in t?Q(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var d=(t,n,e)=>V(t,typeof n!="symbol"?n+"":n,e);function w(){}function X(t,n){for(const e in n)t[e]=n[e];return t}function O(t){return t()}function k(){return Object.create(null)}function $(t){t.forEach(O)}function q(t){return typeof t=="function"}function xt(t,n){return t!=t?n==n:t!==n||t&&typeof t=="object"||typeof t=="function"}let E;function $t(t,n){return t===n?!0:(E||(E=document.createElement("a")),E.href=n,t===E.href)}function Y(t){return Object.keys(t).length===0}function Z(t,...n){if(t==null){for(const i of n)i(void 0);return w}const e=t.subscribe(...n);return e.unsubscribe?()=>e.unsubscribe():e}function bt(t,n,e){t.$$.on_destroy.push(Z(n,e))}function Et(t,n,e,i){if(t){const r=G(t,n,e,i);return t[0](r)}}function G(t,n,e,i){return t[1]&&i?X(e.ctx.slice(),t[1](i(n))):e.ctx}function vt(t,n,e,i){if(t[2]&&i){const r=t[2](i(e));if(n.dirty===void 0)return r;if(typeof r=="object"){const o=[],s=Math.max(n.dirty.length,r.length);for(let u=0;u<s;u+=1)o[u]=n.dirty[u]|r[u];return o}return n.dirty|r}return n.dirty}function wt(t,n,e,i,r,o){if(r){const s=G(n,e,i,o);t.p(s,r)}}function Tt(t){if(t.ctx.length>32){const n=[],e=t.ctx.length/32;for(let i=0;i<e;i++)n[i]=-1;return n}return-1}function Nt(t){const n={};for(const e in t)e[0]!=="$"&&(n[e]=t[e]);return n}function At(t,n){const e={};n=new Set(n);for(const i in t)!n.has(i)&&i[0]!=="$"&&(e[i]=t[i]);return e}let N=!1;function tt(){N=!0}function nt(){N=!1}function et(t,n,e,i){for(;t<n;){const r=t+(n-t>>1);e(r)<=i?t=r+1:n=r}return t}function it(t){if(t.hydrate_init)return;t.hydrate_init=!0;let n=t.childNodes;if(t.nodeName==="HEAD"){const c=[];for(let l=0;l<n.length;l++){const f=n[l];f.claim_order!==void 0&&c.push(f)}n=c}const e=new Int32Array(n.length+1),i=new Int32Array(n.length);e[0]=-1;let r=0;for(let c=0;c<n.length;c++){const l=n[c].claim_order,f=(r>0&&n[e[r]].claim_order<=l?r+1:et(1,r,b=>n[e[b]].claim_order,l))-1;i[c]=e[f]+1;const a=f+1;e[a]=c,r=Math.max(a,r)}const o=[],s=[];let u=n.length-1;for(let c=e[r]+1;c!=0;c=i[c-1]){for(o.push(n[c-1]);u>=c;u--)s.push(n[u]);u--}for(;u>=0;u--)s.push(n[u]);o.reverse(),s.sort((c,l)=>c.claim_order-l.claim_order);for(let c=0,l=0;c<s.length;c++){for(;l<o.length&&s[c].claim_order>=o[l].claim_order;)l++;const f=l<o.length?o[l]:null;t.insertBefore(s[c],f)}}function rt(t,n){if(N){for(it(t),(t.actual_end_child===void 0||t.actual_end_child!==null&&t.actual_end_child.parentNode!==t)&&(t.actual_end_child=t.firstChild);t.actual_end_child!==null&&t.actual_end_child.claim_order===void 0;)t.actual_end_child=t.actual_end_child.nextSibling;n!==t.actual_end_child?(n.claim_order!==void 0||n.parentNode!==t)&&t.insertBefore(n,t.actual_end_child):t.actual_end_child=n.nextSibling}else(n.parentNode!==t||n.nextSibling!==null)&&t.appendChild(n)}function st(t,n,e){t.insertBefore(n,e||null)}function ct(t,n,e){N&&!e?rt(t,n):(n.parentNode!==t||n.nextSibling!=e)&&t.insertBefore(n,e||null)}function T(t){t.parentNode&&t.parentNode.removeChild(t)}function Ct(t,n){for(let e=0;e<t.length;e+=1)t[e]&&t[e].d(n)}function R(t){return document.createElement(t)}function U(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function M(t){return document.createTextNode(t)}function St(){return M(" ")}function Ht(){return M("")}function Mt(t,n,e,i){return t.addEventListener(n,e,i),()=>t.removeEventListener(n,e,i)}function ot(t,n,e){e==null?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function Lt(t,n){for(const e in n)ot(t,e,n[e])}function jt(t){return t.dataset.svelteH}function kt(t){return t===""?null:+t}function lt(t){return Array.from(t.childNodes)}function z(t){t.claim_info===void 0&&(t.claim_info={last_index:0,total_claimed:0})}function F(t,n,e,i,r=!1){z(t);const o=(()=>{for(let s=t.claim_info.last_index;s<t.length;s++){const u=t[s];if(n(u)){const c=e(u);return c===void 0?t.splice(s,1):t[s]=c,r||(t.claim_info.last_index=s),u}}for(let s=t.claim_info.last_index-1;s>=0;s--){const u=t[s];if(n(u)){const c=e(u);return c===void 0?t.splice(s,1):t[s]=c,r?c===void 0&&t.claim_info.last_index--:t.claim_info.last_index=s,u}}return i()})();return o.claim_order=t.claim_info.total_claimed,t.claim_info.total_claimed+=1,o}function I(t,n,e,i){return F(t,r=>r.nodeName===n,r=>{const o=[];for(let s=0;s<r.attributes.length;s++){const u=r.attributes[s];e[u.name]||o.push(u.name)}o.forEach(s=>r.removeAttribute(s))},()=>i(n))}function Dt(t,n,e){return I(t,n,e,R)}function Pt(t,n,e){return I(t,n,e,U)}function ut(t,n){return F(t,e=>e.nodeType===3,e=>{const i=""+n;if(e.data.startsWith(i)){if(e.data.length!==i.length)return e.splitText(i.length)}else e.data=i},()=>M(n),!0)}function Bt(t){return ut(t," ")}function D(t,n,e){for(let i=e;i<t.length;i+=1){const r=t[i];if(r.nodeType===8&&r.textContent.trim()===n)return i}return-1}function Ot(t,n){const e=D(t,"HTML_TAG_START",0),i=D(t,"HTML_TAG_END",e+1);if(e===-1||i===-1)return new A(n);z(t);const r=t.splice(e,i-e+1);T(r[0]),T(r[r.length-1]);const o=r.slice(1,r.length-1);if(o.length===0)return new A(n);for(const s of o)s.claim_order=t.claim_info.total_claimed,t.claim_info.total_claimed+=1;return new A(n,o)}function qt(t,n){n=""+n,t.data!==n&&(t.data=n)}function Gt(t,n){t.value=n??""}function Rt(t,n,e,i){e==null?t.style.removeProperty(n):t.style.setProperty(n,e,"")}function at(t,n,{bubbles:e=!1,cancelable:i=!1}={}){return new CustomEvent(t,{detail:n,bubbles:e,cancelable:i})}function Ut(t,n){const e=[];let i=0;for(const r of n.childNodes)if(r.nodeType===8){const o=r.textContent.trim();o===`HEAD_${t}_END`?(i-=1,e.push(r)):o===`HEAD_${t}_START`&&(i+=1,e.push(r))}else i>0&&e.push(r);return e}class ft{constructor(n=!1){d(this,"is_svg",!1);d(this,"e");d(this,"n");d(this,"t");d(this,"a");this.is_svg=n,this.e=this.n=null}c(n){this.h(n)}m(n,e,i=null){this.e||(this.is_svg?this.e=U(e.nodeName):this.e=R(e.nodeType===11?"TEMPLATE":e.nodeName),this.t=e.tagName!=="TEMPLATE"?e:e.content,this.c(n)),this.i(i)}h(n){this.e.innerHTML=n,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(n){for(let e=0;e<this.n.length;e+=1)st(this.t,this.n[e],n)}p(n){this.d(),this.h(n),this.i(this.a)}d(){this.n.forEach(T)}}class A extends ft{constructor(e=!1,i){super(e);d(this,"l");this.e=this.n=null,this.l=i}c(e){this.l?this.n=this.l:super.c(e)}i(e){for(let i=0;i<this.n.length;i+=1)ct(this.t,this.n[i],e)}}function zt(t,n){return new t(n)}let x;function y(t){x=t}function _(){if(!x)throw new Error("Function called outside component initialization");return x}function Ft(t){_().$$.before_update.push(t)}function It(t){_().$$.on_mount.push(t)}function Wt(t){_().$$.after_update.push(t)}function Jt(t){_().$$.on_destroy.push(t)}function Kt(){const t=_();return(n,e,{cancelable:i=!1}={})=>{const r=t.$$.callbacks[n];if(r){const o=at(n,e,{cancelable:i});return r.slice().forEach(s=>{s.call(t,o)}),!o.defaultPrevented}return!0}}function Qt(t,n){return _().$$.context.set(t,n),n}function Vt(t){return _().$$.context.get(t)}function Xt(){return _().$$.context}function Yt(t){return _().$$.context.has(t)}const p=[],P=[];let g=[];const B=[],W=Promise.resolve();let S=!1;function J(){S||(S=!0,W.then(K))}function Zt(){return J(),W}function H(t){g.push(t)}const C=new Set;let m=0;function K(){if(m!==0)return;const t=x;do{try{for(;m<p.length;){const n=p[m];m++,y(n),dt(n.$$)}}catch(n){throw p.length=0,m=0,n}for(y(null),p.length=0,m=0;P.length;)P.pop()();for(let n=0;n<g.length;n+=1){const e=g[n];C.has(e)||(C.add(e),e())}g.length=0}while(p.length);for(;B.length;)B.pop()();S=!1,C.clear(),y(t)}function dt(t){if(t.fragment!==null){t.update(),$(t.before_update);const n=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,n),t.after_update.forEach(H)}}function _t(t){const n=[],e=[];g.forEach(i=>t.indexOf(i)===-1?n.push(i):e.push(i)),e.forEach(i=>i()),g=n}const v=new Set;let h;function tn(){h={r:0,c:[],p:h}}function nn(){h.r||$(h.c),h=h.p}function ht(t,n){t&&t.i&&(v.delete(t),t.i(n))}function en(t,n,e,i){if(t&&t.o){if(v.has(t))return;v.add(t),h.c.push(()=>{v.delete(t),i&&(e&&t.d(1),i())}),t.o(n)}else i&&i()}function rn(t){t&&t.c()}function sn(t,n){t&&t.l(n)}function mt(t,n,e){const{fragment:i,after_update:r}=t.$$;i&&i.m(n,e),H(()=>{const o=t.$$.on_mount.map(O).filter(q);t.$$.on_destroy?t.$$.on_destroy.push(...o):$(o),t.$$.on_mount=[]}),r.forEach(H)}function pt(t,n){const e=t.$$;e.fragment!==null&&(_t(e.after_update),$(e.on_destroy),e.fragment&&e.fragment.d(n),e.on_destroy=e.fragment=null,e.ctx=[])}function gt(t,n){t.$$.dirty[0]===-1&&(p.push(t),J(),t.$$.dirty.fill(0)),t.$$.dirty[n/31|0]|=1<<n%31}function cn(t,n,e,i,r,o,s=null,u=[-1]){const c=x;y(t);const l=t.$$={fragment:null,ctx:[],props:o,update:w,not_equal:r,bound:k(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(c?c.$$.context:[])),callbacks:k(),dirty:u,skip_bound:!1,root:n.target||c.$$.root};s&&s(l.root);let f=!1;if(l.ctx=e?e(t,n.props||{},(a,b,...L)=>{const j=L.length?L[0]:b;return l.ctx&&r(l.ctx[a],l.ctx[a]=j)&&(!l.skip_bound&&l.bound[a]&&l.bound[a](j),f&>(t,a)),b}):[],l.update(),f=!0,$(l.before_update),l.fragment=i?i(l.ctx):!1,n.target){if(n.hydrate){tt();const a=lt(n.target);l.fragment&&l.fragment.l(a),a.forEach(T)}else l.fragment&&l.fragment.c();n.intro&&ht(t.$$.fragment),mt(t,n.target,n.anchor),nt(),K()}y(c)}class on{constructor(){d(this,"$$");d(this,"$$set")}$destroy(){pt(this,1),this.$destroy=w}$on(n,e){if(!q(e))return w;const i=this.$$.callbacks[n]||(this.$$.callbacks[n]=[]);return i.push(e),()=>{const r=i.indexOf(e);r!==-1&&i.splice(r,1)}}$set(n){this.$$set&&!Y(n)&&(this.$$.skip_bound=!0,this.$$set(n),this.$$.skip_bound=!1)}}export{Kt as $,Tt as A,vt as B,Gt as C,tn as D,nn as E,Ht as F,Wt as G,Zt as H,zt as I,pt as J,rn as K,mt as L,sn as M,Rt as N,P as O,X as P,Ct as Q,Lt as R,on as S,Pt as T,U,At as V,Nt as W,kt as X,Ot as Y,A as Z,Ft as _,qt as a,Xt as a0,Vt as a1,Yt as a2,Jt as a3,Qt as a4,ct as b,rt as c,T as d,Dt as e,lt as f,ut as g,Bt as h,cn as i,R as j,St as k,bt as l,$t as m,w as n,ot as o,Ut as p,jt as q,It as r,xt as s,M as t,Mt as u,Et as v,$ as w,en as x,ht as y,wt as z};
|
hfstudio/static/_app/immutable/chunks/Bdt-LMmF.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
var kt=Object.defineProperty;var Et=(e,t,n)=>t in e?kt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var R=(e,t,n)=>Et(e,typeof t!="symbol"?t+"":t,n);import{S as At,G as Rt,_ as Tt,$ as Ut,a0 as It,a1 as Lt,a2 as $t,a3 as xt,r as ve,a4 as Ct,H as be,n as ge,s as Pt}from"./B1LPgyXz.js";class Qe extends At{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 Ot extends Qe{}const Nt=Object.freeze(Object.defineProperty({__proto__:null,SvelteComponent:Qe,SvelteComponentTyped:Ot,afterUpdate:Rt,beforeUpdate:Tt,createEventDispatcher:Ut,getAllContexts:It,getContext:Lt,hasContext:$t,onDestroy:xt,onMount:ve,setContext:Ct,tick:be},Symbol.toStringTag,{value:"Module"}));class ce{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Re{constructor(t,n){this.status=t,this.location=n}}class Te extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function jt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function Dt(e){return e.split("%25").map(decodeURI).join("%25")}function Bt(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 Mt(...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 Vt=new TextDecoder;function qt(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 Gt=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:(t==null?void 0:t.method)||"GET")!=="GET"&&H.delete(Ue(e)),Gt(e,t));const H=new Map;function Ht(e,t){const n=Ue(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&&H.set(n,{body:a,init:s,ttl:1e3*Number(i)}),r.getAttribute("data-b64")!==null&&(a=qt(a)),Promise.resolve(new Response(a,s))}return window.fetch(e,t)}function Yt(e,t,n){if(H.size>0){const r=Ue(e,n),a=H.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);H.delete(r)}}return window.fetch(t,n)}function Ue(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="${Mt(...a)}"]`}return r}const Kt=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function zt(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${Jt(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=Kt.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 Wt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function Jt(e){return e.slice(1).split("/").filter(Wt)}function Xt(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 Zt({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}=zt(o),f={id:o,exec:p=>{const u=h.exec(p);if(u)return Xt(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 et(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function Me(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const D=[];function Ie(e,t=ge){let n;const r=new Set;function a(o){if(Pt(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 Xe;const $=((Xe=globalThis.__sveltekit_r15ieo)==null?void 0:Xe.base)??"";var Ze;const Qt=((Ze=globalThis.__sveltekit_r15ieo)==null?void 0:Ze.assets)??$??"",en="1760678446039",tt="sveltekit:snapshot",nt="sveltekit:scroll",at="sveltekit:states",tn="sveltekit:pageurl",F="sveltekit:history",z="sveltekit:navigation",O={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},Z=location.origin;function Le(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function le(){return{x:pageXOffset,y:pageYOffset}}function B(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const Ve={...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)===Z&&e.hasAttribute("download");return{url:r,external:s,target:a,download:i}}function ee(e){let t=null,n=null,r=null,a=null,s=null,i=null,o=e;for(;o&&o!==document.documentElement;)r===null&&(r=B(o,"preload-code")),a===null&&(a=B(o,"preload-data")),t===null&&(t=B(o,"keepfocus")),n===null&&(n=B(o,"noscroll")),s===null&&(s=B(o,"reload")),i===null&&(i=B(o,"replacestate")),o=rt(o);function c(l){switch(l){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Ve[r??"off"],preload_data:Ve[a??"off"],keepfocus:c(t),noscroll:c(n),reload:c(s),replace_state:c(i)}}function qe(e){const t=Ie(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 nn(){const{set:e,subscribe:t}=Ie(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Qt}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const i=(await a.json()).version!==en;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!==Z||!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 an(e){const t=on(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 rn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function on(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|=rn.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 sn=-1,cn=-2,ln=-3,fn=-4,un=-5,dn=-6;function hn(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===sn)return;if(s===ln)return NaN;if(s===fn)return 1/0;if(s===un)return-1/0;if(s===dn)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=an(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!==cn&&(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 pn=new Set([...it]);[...pn];function gn(e){return e.filter(t=>t!=null)}const mn="x-sveltekit-invalidated",_n="x-sveltekit-trailing-slash";function te(e){return e instanceof ce||e instanceof Te?e.status:500}function wn(e){return e instanceof Te?e.text:"Internal Error"}let T,W,we;const yn=ve.toString().includes("$$")||/function \w+\(\) \{\}/.test(ve.toString());yn?(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 vn(e){Object.assign(T,e)}const bn="/__data.json",Sn=".html__data.json";function kn(e){return e.endsWith(".html")?e.replace(/\.html$/,Sn):e.replace(/\/$/,"")+bn}const Ge={spanContext(){return En},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}},En={traceId:"",spanId:"",traceFlags:0},{tick:An}=Nt,Rn=new Set(["icon","shortcut icon","apple-touch-icon"]),j=et(nt)??{},J=et(tt)??{},C={url:qe({}),page:qe({}),navigating:Ie(null),updated:nn()};function $e(e){j[e]=le()}function Tn(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 He(){}let xe,ke,ne,x,Ee,k;const ae=[],re=[];let I=null;const Q=new Map,lt=new Set,Un=new Set,Y=new Set;let b={branch:[],error:null,url:null},Ce=!1,oe=!1,Ye=!0,X=!1,G=!1,ft=!1,Pe=!1,ut,A,L,N;const K=new Set,Ke=new Map;async function Kn(e,t,n){var s,i,o,c,l;(s=globalThis.__sveltekit_r15ieo)!=null&&s.data&&globalThis.__sveltekit_r15ieo.data,document.URL!==location.href&&(location.href=location.href),k=e,await((o=(i=e.hooks).init)==null?void 0:o.call(i)),xe=Zt(e),x=document.documentElement,Ee=t,ke=e.nodes[0],ne=e.nodes[1],ke(),ne(),A=(c=history.state)==null?void 0:c[F],L=(l=history.state)==null?void 0:l[z],A||(A=L=Date.now(),history.replaceState({...history.state,[F]:A,[z]:L},""));const r=j[A];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await Dn(Ee,n)):(await M({type:"enter",url:Le(k.hash?Fn(new URL(location.href)):location.href),replace_state:!0}),a()),jn()}function In(){ae.length=0,Pe=!1}function dt(e){re.some(t=>t==null?void 0:t.snapshot)&&(J[e]=re.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=re[r])==null?void 0:a.snapshot)==null||s.restore(n)})}function ze(){$e(A),Me(nt,j),dt(L),Me(tt,J)}async function pt(e,t,n,r){let a;t.invalidateAll&&(I=null),await M({type:"goto",url:Le(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(Pe=!0,a=[...Ke.keys()]),t.invalidate&&t.invalidate.forEach(Nn)}}),t.invalidateAll&&be().then(be).then(()=>{Ke.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!==(I==null?void 0:I.id)){const t={};K.add(t),I={id:e.id,token:t,promise:_t({...e,preload:t}).then(n=>(K.delete(t),n.type==="loaded"&&n.state.error&&(I=null),n))}}return I.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 gt(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:re},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()};Y.forEach(i=>i(s))}oe=!0}function se({url:e,params:t,branch:n,status:r,error:a,route:s,form:i}){let o="never";if($&&(e.pathname===$||e.pathname===$+"/"))o="always";else for(const f of n)(f==null?void 0:f.slash)!==void 0&&(o=f.slash);e.pathname=jt(e.pathname,o),e.search=e.search;const c={type:"loaded",state:{url:e,params:t,branch:n,error:a,route:s},props:{constructors:gn(n).map(f=>f.node.component),page:De(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 Oe({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:Ge,current:Ge},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:U}=mt(u,g,n);return o&&f(_.href),U},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 mt(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=oe?Yt(r,a.href,t):Ht(r,t);return{resolved:a,promise:s}}function We(e,t,n,r,a,s){if(Pe)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(ae.some(o=>o(new URL(i))))return!0;return!1}function Ne(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 Je({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:De(T),constructors:[]}}}async function _t({id:e,invalidating:t,url:n,params:r,route:a,preload:s}){if((I==null?void 0:I.id)===e)return K.delete(I.token),I.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!==ie(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]||We(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 vt(n,u)}catch(w){const m=await V(w,{url:n,params:r,route:{id:e}});return K.has(s)?Je({error:m,url:n,params:r,route:a}):ue({status:te(w),error:m,url:n,route:a})}if(d.type==="redirect")return d}const g=d==null?void 0:d.nodes;let _=!1;const U=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)&&!We(_,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 Oe({loader:w[1],url:n,params:r,route:a,parent:async()=>{var Fe;const Be={};for(let pe=0;pe<m;pe+=1)Object.assign(Be,(Fe=await U[pe])==null?void 0:Fe.data);return Be},server_data_node:Ne(S===void 0&&w[0]?{type:"skip"}:S??null,w[0]?v==null?void 0:v.server:void 0)})});for(const w of U)w.catch(()=>{});const E=[];for(let w=0;w<l.length;w+=1)if(l[w])try{E.push(await U[w])}catch(m){if(m instanceof Re)return{type:"redirect",location:m.location};if(K.has(s))return Je({error:await V(m,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let v=te(m),S;if(g!=null&&g.includes(m))v=m.status??v,S=m.error;else if(m instanceof ce)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?se({url:n,params:r,branch:E.slice(0,P.idx).concat(P.node),status:v,error:S,route:a}):await yt(n,{id:a.id},S,v)}else E.push(void 0);return se({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 vt(n,[!0]);if(o.type!=="data"||o.nodes[0]&&o.nodes[0].type!=="data")throw 0;s=o.nodes[0]??null}catch{(n.origin!==Z||n.pathname!==location.pathname||Ce)&&await q(n)}try{const o=await Oe({loader:ke,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:Ne(s)}),c={node:await ne(),loader:ne,universal:null,server:null,data:null};return se({url:n,params:a,branch:[o,c],status:e,error:t,route:null})}catch(o){if(o instanceof Re)return pt(new URL(o.location,location.href),{},0);throw o}}async function Cn(e){const t=e.href;if(Q.has(t))return Q.get(t);let n;try{const r=(async()=>{let a=await k.hooks.reroute({url:new URL(e),fetch:async(s,i)=>mt(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})();Q.set(t,r),n=await r}catch{Q.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 xe){const s=a.exec(r);if(s)return{id:ie(e),invalidating:t,route:a,params:Bt(s),url:e}}}}function Pn(e){return Dt(k.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice($.length))||"/"}function ie(e){return(k.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function wt({url:e,type:t,intent:n,delta:r,event:a}){let s=!1;const i=je(b,n,e,t);r!==void 0&&(i.navigation.delta=r),a!==void 0&&(i.navigation.event=a);const o={...i.navigation,cancel:()=>{s=!0,i.reject(new Error("navigation cancelled"))}};return X||lt.forEach(c=>c(o)),s?null:i}async function M({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:s,state:i={},redirect_count:o=0,nav_token:c={},accept:l=He,block:d=He,event:h}){const y=N;N=c;const f=await de(t,!1),p=e==="enter"?je(b,f,t,e):wt({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,oe&&p.navigation.type!=="enter"&&C.navigating.set(W.current=p.navigation);let _=f&&await _t(f);if(!_){if(fe(t,$,k.hash))return await q(t,s);_=await yt(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(),$e(u),dt(g),_.props.page.url.pathname!==t.pathname&&(t.pathname=_.props.page.url.pathname),i=n?n.state:i,!n){const m=s?0:1,v={[F]:A+=m,[z]:L+=m,[at]:i};(s?history.replaceState:history.pushState).call(history,v,"",t),s||Tn(A,L)}if(I=null,_.props.page.state=i,oe){const m=(await Promise.all(Array.from(Un,v=>v(p.navigation)))).filter(v=>typeof v=="function");if(m.length>0){let v=function(){m.forEach(S=>{Y.delete(S)})};m.push(v),m.forEach(S=>{Y.add(S)})}b=_.state,_.props.page&&(_.props.page.url=t),ut.$set(_.props),vn(_.props.page),ft=!0}else gt(_,Ee,!1);const{activeElement:U}=document;await An();let E=n?n.scroll:a?le():null;if(Ye){const m=t.hash&&document.getElementById(St(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!==U&&document.activeElement!==document.body;!r&&!w&&Bn(t,E),Ye=!0,_.props.page&&Object.assign(T,_.props.page),X=!1,e==="popstate"&&ht(L),p.fulfil(void 0),Y.forEach(m=>m(p.navigation)),C.navigating.set(W.current=null)}async function yt(e,t,n,r,a){return e.origin===Z&&e.pathname===location.pathname&&!Ce?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=ee(l),u=h&&ie(b.url)===ie(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=ee(o);h.reload||(h.preload_code===O.viewport&&a.observe(o),h.preload_code===O.eager&&ye(c))}}Y.add(i),i()}function V(e,t){if(e instanceof ce)return e.body;const n=te(e),r=wn(e);return k.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function zn(e,t={}){return e=new URL(Le(e)),e.origin!==Z?Promise.reject(new Error("goto: invalid URL")):pt(e,t,0)}function Nn(e){if(typeof e=="function")ae.push(e);else{const{href:t}=new URL(e,location.href);ae.push(n=>n.href===t)}}function jn(){var t;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let r=!1;if(ze(),!X){const a=je(b,void 0,null,"leave"),s={...a.navigation,cancel:()=>{r=!0,a.reject(new Error("navigation cancelled"))}};lt.forEach(i=>i(s))}r?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&ze()}),(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=ee(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)){wt({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,$e(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=ee(c);if(l.reload)return;n.preventDefault(),n.stopPropagation();const d=new FormData(c,a);o.search=new URLSearchParams(d).toString(),M({type:"form",url:o,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??o.href===location.href,event:n})}),addEventListener("popstate",async n=>{var r;if(!Ae){if((r=n.state)!=null&&r[F]){const a=n.state[F];if(N={},a===A)return;const s=j[a],i=n.state[at]??{},o=new URL(n.state[tn]??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,[F]:++A,[z]:L},"",location.href))});for(const n of document.querySelectorAll("link"))Rn.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(De(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}){Ce=!0;const l=new URL(location.href);let d;({params:a={},route:s={id:null}}=await de(l,!1)||{}),d=xe.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=bt(_.uses)),Oe({loader:k.nodes[u],url:l,params:a,route:s,parent:async()=>{const U={};for(let E=0;E<g;E+=1)Object.assign(U,(await f[E]).data);return U},server_data_node:Ne(_)})}),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=se({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:te(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={}),gt(h,e,y)}async function vt(e,t){var s;const n=new URL(e);n.pathname=kn(e.pathname),e.pathname.endsWith("/")&&n.searchParams.append(_n,"1"),n.searchParams.append(mn,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 ce(a.status,i)}return new Promise(async i=>{var h;const o=new Map,c=a.body.getReader();function l(y){return hn(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 |
+
`:Vt.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=bt(g.uses),g.data=l(g.data))}),i(u);else if(u.type==="chunk"){const{id:g,data:_,error:U}=u,E=o.get(g);o.delete(g),U?E.reject(l(U)):E.fulfil(l(_))}}}})}function bt(e){return{dependencies:new Set((e==null?void 0:e.dependencies)??[]),params:new Set((e==null?void 0:e.params)??[]),parent:!!(e!=null&&e.parent),route:!!(e!=null&&e.route),url:!!(e!=null&&e.url),search_params:new Set((e==null?void 0:e.search_params)??[])}}let Ae=!1;function Bn(e,t=null){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=St(e);if(r&&document.getElementById(r)){const{x:s,y:i}=t??le();setTimeout(()=>{const o=history.state;Ae=!0,location.replace(`#${r}`),k.hash&&location.replace(e.hash),history.replaceState(o,"",e.hash),scrollTo(s,i),Ae=!1})}else{const s=document.body,i=s.getAttribute("tabindex");s.tabIndex=-1,s.focus({preventScroll:!0,focusVisible:!1}),i!==null?s.setAttribute("tabindex",i):s.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const s=[];for(let i=0;i<a.rangeCount;i+=1)s.push(a.getRangeAt(i));setTimeout(()=>{if(a.rangeCount===s.length){for(let i=0;i<a.rangeCount;i+=1){const o=s[i],c=a.getRangeAt(i);if(o.commonAncestorContainer!==c.commonAncestorContainer||o.startContainer!==c.startContainer||o.endContainer!==c.endContainer||o.startOffset!==c.startOffset||o.endOffset!==c.endOffset)return}a.removeAllRanges()}})}}}function je(e,t,n,r){var c,l;let a,s;const i=new Promise((d,h)=>{a=d,s=h});return i.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:((c=e.route)==null?void 0:c.id)??null},url:e.url},to:n&&{params:(t==null?void 0:t.params)??null,route:{id:((l=t==null?void 0:t.route)==null?void 0:l.id)??null},url:n},willUnload:!t,type:r,complete:i},fulfil:a,reject:s}}function De(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function Fn(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function St(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,zn as g,qn as l,C as s};
|
hfstudio/static/_app/immutable/entry/app.By6Ln18A.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.Cai-H-zF.js","../chunks/B1LPgyXz.js","../chunks/IHki7fMi.js","../assets/0.Z2FEQDaf.css","../nodes/1.CUXC-_wj.js","../chunks/B0cuSUdZ.js","../chunks/Bdt-LMmF.js","../nodes/2.ColiJK7M.js","../assets/2.CRAr3Z-Y.css","../nodes/3.pthhtWhZ.js"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{S as C,i as q,s as B,d,x as h,y as g,D as S,E as A,b as E,h as U,F as w,k as F,G,r as H,H as J,I as y,J as P,K as R,L,M as N,o as D,N as p,e as K,f as W,j as z,O as I,a as Q,g as X,t as Y}from"../chunks/B1LPgyXz.js";import"../chunks/IHki7fMi.js";const Z="modulepreload",M=function(o,e){return new URL(o,e).href},T={},O=function(e,n,i){let r=Promise.resolve();if(n&&n.length>0){const t=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));r=Promise.allSettled(n.map(f=>{if(f=M(f,i),f in T)return;T[f]=!0;const l=f.endsWith(".css"),_=l?'[rel="stylesheet"]':"";if(!!i)for(let k=t.length-1;k>=0;k--){const v=t[k];if(v.href===f&&(!l||v.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,v)=>{m.addEventListener("load",k),m.addEventListener("error",()=>v(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&&N(e.$$.fragment,t),n=w()},m(t,s){e&&L(e,t,s),E(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)}),A()}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&&N(e.$$.fragment,t),n=w()},m(t,s){e&&L(e,t,s),E(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)}),A()}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&&N(e.$$.fragment,t),n=w()},m(t,s){e&&L(e,t,s),E(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)}),A()}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 V(o){let e,n=o[7]&&j(o);return{c(){e=z("div"),n&&n.c(),this.h()},l(i){e=K(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var r=W(e);n&&n.l(r),r.forEach(d),this.h()},h(){D(e,"id","svelte-announcer"),D(e,"aria-live","assertive"),D(e,"aria-atomic","true"),p(e,"position","absolute"),p(e,"left","0"),p(e,"top","0"),p(e,"clip","rect(0 0 0 0)"),p(e,"clip-path","inset(50%)"),p(e,"overflow","hidden"),p(e,"white-space","nowrap"),p(e,"width","1px"),p(e,"height","1px")},m(i,r){E(i,e,r),n&&n.m(e,null)},p(i,r){i[7]?n?n.p(i,r):(n=j(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&d(e),n&&n.d()}}}function j(o){let e;return{c(){e=Y(o[8])},l(n){e=X(n,o[8])},m(n,i){E(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]&&V(o);return{c(){n.c(),i=F(),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,_),E(l,i,_),f&&f.m(l,_),E(l,r,_),u=!0},p(l,[_]){let b=e;e=a(l),e===b?s[e].p(l,_):(S(),h(s[b],1,1,()=>{s[b]=null}),A(),n=s[e],n?n.p(l,_):(n=s[e]=t[e](l),n.c()),g(n,1),n.m(i.parentNode,i)),l[6]?f?f.p(l,_):(f=V(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;G(i.page.notify);let l=!1,_=!1,b=null;H(()=>{const c=i.page.subscribe(()=>{l&&(n(7,_=!0),J().then(()=>{n(8,b=document.title||"untitled page")}))});return n(6,l=!0),c});function m(c){I[c?"unshift":"push"](()=>{t[1]=c,n(0,t)})}function k(c){I[c?"unshift":"push"](()=>{t[0]=c,n(0,t)})}function v(c){I[c?"unshift":"push"](()=>{t[0]=c,n(0,t)})}return o.$$set=c=>{"stores"in c&&n(9,i=c.stores),"page"in c&&n(1,r=c.page),"constructors"in c&&n(2,u=c.constructors),"components"in c&&n(0,t=c.components),"form"in c&&n(3,s=c.form),"data_0"in c&&n(4,a=c.data_0),"data_1"in c&&n(5,f=c.data_1)},o.$$.update=()=>{o.$$.dirty&514&&i.page.set(r)},[t,r,u,s,a,f,l,_,b,i,m,k,v]}class le extends C{constructor(e){super(),q(this,e,ne,te,B,{stores:9,page:1,constructors:2,components:0,form:3,data_0:4,data_1:5})}}const fe=[()=>O(()=>import("../nodes/0.Cai-H-zF.js"),__vite__mapDeps([0,1,2,3]),import.meta.url),()=>O(()=>import("../nodes/1.CUXC-_wj.js"),__vite__mapDeps([4,1,2,5,6]),import.meta.url),()=>O(()=>import("../nodes/2.ColiJK7M.js"),__vite__mapDeps([7,1,2,8]),import.meta.url),()=>O(()=>import("../nodes/3.pthhtWhZ.js"),__vite__mapDeps([9,1,2,6,5]),import.meta.url)],ce=[],ue={"/":[2],"/auth/callback":[3]},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.C61NpXpG.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{l as o,a as r}from"../chunks/Bdt-LMmF.js";export{o as load_css,r as start};
|
hfstudio/static/_app/immutable/nodes/0.Cai-H-zF.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{S as we,i as Te,s as Ce,v as Le,d as v,w as ye,x as Ie,y as Ee,o as r,z as Se,A as He,B as Me,b as X,c as s,u as te,m as Ae,e as i,f as A,q as I,h as x,j as c,k as y,r as Ne,C as be,a as ge,g as se,t as ne,n as Ue}from"../chunks/B1LPgyXz.js";import"../chunks/IHki7fMi.js";function Pe(u){let t,e="Sign In";return{c(){t=c("span"),t.textContent=e},l(o){t=i(o,"SPAN",{"data-svelte-h":!0}),I(t)!=="svelte-6n3gky"&&(t.textContent=e)},m(o,f){X(o,t,f)},p:Ue,d(o){o&&v(t)}}}function Be(u){let t,e,o;return{c(){t=c("span"),e=ne("Sign Out, "),o=ne(u[2])},l(f){t=i(f,"SPAN",{});var b=A(t);e=se(b,"Sign Out, "),o=se(b,u[2]),b.forEach(v)},m(f,b){X(f,t,b),s(t,e),s(t,o)},p(f,b){b&4&&ge(o,f[2])},d(f){f&&v(t)}}}function je(u){let t,e,o=u[1]?"logged in":"not logged in",f,b;return{c(){t=c("span"),e=ne("Checking... ("),f=ne(o),b=ne(")")},l(n){t=i(n,"SPAN",{});var a=A(t);e=se(a,"Checking... ("),f=se(a,o),b=se(a,")"),a.forEach(v)},m(n,a){X(n,t,a),s(t,e),s(t,f),s(t,b)},p(n,a){a&2&&o!==(o=n[1]?"logged in":"not logged in")&&ge(f,o)},d(n){n&&v(t)}}}function ve(u){let t,e,o,f="Sign In with HuggingFace Token",b,n,a,q="<strong>Manual Token Entry:</strong> Please enter your HuggingFace token.",L,d,N=`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`,G,R,m,B,W="HuggingFace Token",z,_,J,Y,w,l,g="Cancel",k,j,Z="Sign In",O,oe,T=u[6]&&ke(),p=u[5]&&xe(u);return{c(){t=c("div"),e=c("div"),o=c("h2"),o.textContent=f,b=y(),n=c("div"),a=c("p"),a.innerHTML=q,L=y(),d=c("p"),d.innerHTML=N,G=y(),T&&T.c(),R=y(),m=c("div"),B=c("label"),B.textContent=W,z=y(),_=c("input"),J=y(),p&&p.c(),Y=y(),w=c("div"),l=c("button"),l.textContent=g,k=y(),j=c("button"),j.textContent=Z,this.h()},l(H){t=i(H,"DIV",{class:!0});var V=A(t);e=i(V,"DIV",{class:!0});var M=A(e);o=i(M,"H2",{class:!0,"data-svelte-h":!0}),I(o)!=="svelte-1t0ehet"&&(o.textContent=f),b=x(M),n=i(M,"DIV",{class:!0});var C=A(n);a=i(C,"P",{class:!0,"data-svelte-h":!0}),I(a)!=="svelte-344vn4"&&(a.innerHTML=q),L=x(C),d=i(C,"P",{class:!0,"data-svelte-h":!0}),I(d)!=="svelte-1ffvpx3"&&(d.innerHTML=N),G=x(C),T&&T.l(C),C.forEach(v),R=x(M),m=i(M,"DIV",{class:!0});var U=A(m);B=i(U,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),I(B)!=="svelte-vtbmxo"&&(B.textContent=W),z=x(U),_=i(U,"INPUT",{id:!0,type:!0,placeholder:!0,class:!0}),J=x(U),p&&p.l(U),U.forEach(v),Y=x(M),w=i(M,"DIV",{class:!0});var Q=A(w);l=i(Q,"BUTTON",{class:!0,"data-svelte-h":!0}),I(l)!=="svelte-csk0rj"&&(l.textContent=g),k=x(Q),j=i(Q,"BUTTON",{class:!0,"data-svelte-h":!0}),I(j)!=="svelte-1nxas5u"&&(j.textContent=Z),Q.forEach(v),M.forEach(v),V.forEach(v),this.h()},h(){r(o,"class","text-xl font-semibold mb-4"),r(a,"class","text-blue-800 mb-2"),r(d,"class","text-blue-700"),r(n,"class","mb-4 p-3 bg-blue-50 rounded-md text-sm"),r(B,"for","token"),r(B,"class","block text-sm font-medium text-gray-700 mb-2"),r(_,"id","token"),r(_,"type","password"),r(_,"placeholder","hf_..."),r(_,"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"),r(m,"class","mb-4"),r(l,"class","px-4 py-2 text-gray-600 hover:text-gray-800 transition-colors"),r(j,"class","px-4 py-2 bg-orange-500 text-white rounded-md hover:bg-orange-600 transition-colors"),r(w,"class","flex justify-end gap-3"),r(e,"class","bg-white rounded-lg p-6 max-w-md w-full mx-4 shadow-xl"),r(t,"class","fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50")},m(H,V){X(H,t,V),s(t,e),s(e,o),s(e,b),s(e,n),s(n,a),s(n,L),s(n,d),s(n,G),T&&T.m(n,null),s(e,R),s(e,m),s(m,B),s(m,z),s(m,_),be(_,u[4]),s(m,J),p&&p.m(m,null),s(e,Y),s(e,w),s(w,l),s(w,k),s(w,j),O||(oe=[te(_,"input",u[14]),te(_,"keydown",u[15]),te(l,"click",u[9]),te(j,"click",u[10])],O=!0)},p(H,V){H[6]?T||(T=ke(),T.c(),T.m(n,null)):T&&(T.d(1),T=null),V&16&&_.value!==H[4]&&be(_,H[4]),H[5]?p?p.p(H,V):(p=xe(H),p.c(),p.m(m,null)):p&&(p.d(1),p=null)},d(H){H&&v(t),T&&T.d(),p&&p.d(),O=!1,ye(oe)}}}function ke(u){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=c("p"),t.innerHTML=e,this.h()},l(o){t=i(o,"P",{class:!0,"data-svelte-h":!0}),I(t)!=="svelte-1gg2uwy"&&(t.innerHTML=e),this.h()},h(){r(t,"class","text-blue-600 mt-2")},m(o,f){X(o,t,f)},d(o){o&&v(t)}}}function xe(u){let t,e;return{c(){t=c("p"),e=ne(u[5]),this.h()},l(o){t=i(o,"P",{class:!0});var f=A(t);e=se(f,u[5]),f.forEach(v),this.h()},h(){r(t,"class","text-red-600 text-sm mt-1")},m(o,f){X(o,t,f),s(t,e)},p(o,f){f&32&&ge(e,o[5])},d(o){o&&v(t)}}}function De(u){let t,e,o,f='<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,n,a,q="Tasks",L,d,N,G="🎙️",R,m,B="Text to Speech",W,z,_,J="<span>🎵</span> <span>Voice Cloning</span>",Y,w,l="<span>🎧</span> <span>Speech to Text</span>",g,k,j="<span>🎼</span> <span>Sound Effects</span>",Z,O,oe="<span>🎸</span> <span>Music Generation</span>",T,p,H="<span>🔊</span> <span>Audio Enhancement</span>",V,M,C,U,Q,ie,ce,$,ue,K,fe,he;function pe(h,S){return h[7]?je:h[1]?Be:Pe}let le=pe(u),F=le(u);const de=u[12].default,D=Le(de,u,u[11],null);let E=u[3]&&ve(u);return{c(){t=c("div"),e=c("aside"),o=c("div"),o.innerHTML=f,b=y(),n=c("nav"),a=c("div"),a.textContent=q,L=y(),d=c("button"),N=c("span"),N.textContent=G,R=y(),m=c("span"),m.textContent=B,z=y(),_=c("button"),_.innerHTML=J,Y=y(),w=c("button"),w.innerHTML=l,g=y(),k=c("button"),k.innerHTML=j,Z=y(),O=c("button"),O.innerHTML=oe,T=y(),p=c("button"),p.innerHTML=H,V=y(),M=c("div"),C=c("button"),U=c("img"),ie=y(),F.c(),ce=y(),$=c("main"),D&&D.c(),ue=y(),E&&E.c(),this.h()},l(h){t=i(h,"DIV",{class:!0});var S=A(t);e=i(S,"ASIDE",{class:!0});var ee=A(e);o=i(ee,"DIV",{class:!0,"data-svelte-h":!0}),I(o)!=="svelte-1vahj38"&&(o.innerHTML=f),b=x(ee),n=i(ee,"NAV",{class:!0});var P=A(n);a=i(P,"DIV",{class:!0,"data-svelte-h":!0}),I(a)!=="svelte-1x5465q"&&(a.textContent=q),L=x(P),d=i(P,"BUTTON",{class:!0});var ae=A(d);N=i(ae,"SPAN",{"data-svelte-h":!0}),I(N)!=="svelte-1yx42xi"&&(N.textContent=G),R=x(ae),m=i(ae,"SPAN",{"data-svelte-h":!0}),I(m)!=="svelte-2j89jk"&&(m.textContent=B),ae.forEach(v),z=x(P),_=i(P,"BUTTON",{class:!0,"data-svelte-h":!0}),I(_)!=="svelte-10dl8nf"&&(_.innerHTML=J),Y=x(P),w=i(P,"BUTTON",{class:!0,"data-svelte-h":!0}),I(w)!=="svelte-wf0x5d"&&(w.innerHTML=l),g=x(P),k=i(P,"BUTTON",{class:!0,"data-svelte-h":!0}),I(k)!=="svelte-x7bha3"&&(k.innerHTML=j),Z=x(P),O=i(P,"BUTTON",{class:!0,"data-svelte-h":!0}),I(O)!=="svelte-1tyblmt"&&(O.innerHTML=oe),T=x(P),p=i(P,"BUTTON",{class:!0,"data-svelte-h":!0}),I(p)!=="svelte-1emrjb3"&&(p.innerHTML=H),P.forEach(v),V=x(ee),M=i(ee,"DIV",{class:!0});var me=A(M);C=i(me,"BUTTON",{class:!0});var re=A(C);U=i(re,"IMG",{src:!0,alt:!0,class:!0}),ie=x(re),F.l(re),re.forEach(v),me.forEach(v),ee.forEach(v),ce=x(S),$=i(S,"MAIN",{class:!0});var _e=A($);D&&D.l(_e),_e.forEach(v),ue=x(S),E&&E.l(S),S.forEach(v),this.h()},h(){r(o,"class","p-4 border-b border-gray-200"),r(a,"class","mt-2 mb-1 px-2 text-xs font-medium text-gray-500 uppercase"),r(d,"class",W="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left "+(u[0]==="tts"?"bg-gray-100":"")),r(_,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),_.disabled=!0,r(w,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),w.disabled=!0,r(k,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),k.disabled=!0,r(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,r(p,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),p.disabled=!0,r(n,"class","p-2 text-sm"),Ae(U.src,Q="/assets/hf-logo.png")||r(U,"src",Q),r(U,"alt","HF Logo"),r(U,"class","w-5 h-5"),C.disabled=u[7],r(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"),r(M,"class","absolute bottom-4 left-2 right-2 w-52"),r(e,"class","w-56 border-r border-gray-200 bg-white flex-shrink-0 "),r($,"class","flex-1 overflow-auto"),r(t,"class","flex h-screen bg-white")},m(h,S){X(h,t,S),s(t,e),s(e,o),s(e,b),s(e,n),s(n,a),s(n,L),s(n,d),s(d,N),s(d,R),s(d,m),s(n,z),s(n,_),s(n,Y),s(n,w),s(n,g),s(n,k),s(n,Z),s(n,O),s(n,T),s(n,p),s(e,V),s(e,M),s(M,C),s(C,U),s(C,ie),F.m(C,null),s(t,ce),s(t,$),D&&D.m($,null),s(t,ue),E&&E.m(t,null),K=!0,fe||(he=[te(d,"click",u[13]),te(C,"click",u[8])],fe=!0)},p(h,[S]){(!K||S&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 "+(h[0]==="tts"?"bg-gray-100":"")))&&r(d,"class",W),le===(le=pe(h))&&F?F.p(h,S):(F.d(1),F=le(h),F&&(F.c(),F.m(C,null))),(!K||S&128)&&(C.disabled=h[7]),D&&D.p&&(!K||S&2048)&&Se(D,de,h,h[11],K?Me(de,h[11],S,null):He(h[11]),null),h[3]?E?E.p(h,S):(E=ve(h),E.c(),E.m(t,null)):E&&(E.d(1),E=null)},i(h){K||(Ee(D,h),K=!0)},o(h){Ie(D,h),K=!1},d(h){h&&v(t),F.d(),D&&D.d(h),E&&E.d(),fe=!1,ye(he)}}}function Oe(u,t,e){let{$$slots:o={},$$scope:f}=t,b="tts",n=!1,a="",q=!1,L="",d="",N=!1,G=!0;Ne(()=>{console.log("onMount called - starting auth check"),R(),m(),document.addEventListener("visibilitychange",()=>{document.hidden||m()}),window.addEventListener("storage",m);const l=setInterval(m,1e3);return()=>{window.removeEventListener("storage",m),clearInterval(l)}});async function R(){try{console.log("Checking local token availability...");const g=await(await fetch("/api/auth/local-token")).json();console.log("Local token response:",g),g.available?(e(6,N=!0),localStorage.setItem("hf_access_token",g.token),console.log("Set local token in localStorage"),g.user_info&&g.user_info.name!=="Local User"?(e(1,n=!0),e(2,a=g.user_info.name.split(" ")[0]),console.log("Logged in with user info:",a)):(e(1,n=!0),e(2,a="Local User"),console.log("Logged in with local token (validation skipped due to rate limiting)"),console.log("isLoggedIn set to:",n,"username set to:",a))):(e(6,N=!1),console.log("No local token available"))}catch(l){console.log("Could not check local token availability:",l),e(6,N=!1)}finally{e(7,G=!1),console.log("Finished checking auth, isLoggedIn:",n)}}function m(){const l=localStorage.getItem("hf_access_token");l&&!n?B(l):l||(e(1,n=!1),e(2,a=""))}async function B(l){try{console.log("Fetching user info for token:",l.substring(0,10)+"...");const g=await fetch("https://huggingface.co/api/whoami-v2",{headers:{Authorization:`Bearer ${l}`}});if(g.ok){const k=await g.json();e(1,n=!0);const j=k.name||k.fullname||k.login||k.username||"User";e(2,a=j.split(" ")[0]),console.log("Successfully fetched user info:",a)}else localStorage.removeItem("hf_access_token"),e(1,n=!1),e(2,a=""),console.log("Token validation failed:",g.status)}catch(g){localStorage.removeItem("hf_access_token"),e(1,n=!1),e(2,a=""),console.log("Error fetching user info:",g)}}async function W(){if(n)localStorage.removeItem("hf_access_token"),sessionStorage.removeItem("oauth_state"),e(1,n=!1),e(2,a="");else if(window.location.hostname.includes("hf.space")||window.location.hostname.includes("huggingface.co"))try{const k=`https://huggingface.co/oauth/authorize?client_id=${(await(await fetch("/api/auth/oauth-config")).json()).client_id}&redirect_uri=${encodeURIComponent(window.location.origin+"/auth/callback")}&scope=openid profile&response_type=code&state=${Date.now()}`;window.location.href=k}catch(l){console.error("Failed to get OAuth config:",l),e(3,q=!0),e(4,L=""),e(5,d="")}else e(3,q=!0),e(4,L=""),e(5,d="")}function z(){e(3,q=!1),e(4,L=""),e(5,d="")}async function _(){if(!L.trim()){e(5,d="Please enter a token");return}if(!L.startsWith("hf_")){e(5,d='Token should start with "hf_"');return}try{const l=await fetch("https://huggingface.co/api/whoami-v2",{headers:{Authorization:`Bearer ${L.trim()}`}});if(l.ok){const g=await l.json();localStorage.setItem("hf_access_token",L.trim()),e(1,n=!0);const k=g.name||g.fullname||g.login||g.username||"User";e(2,a=k.split(" ")[0]),z()}else{const g=await l.text();console.log("Token validation error:",l.status,g),e(5,d=`Invalid token (${l.status}). Please check your token and try again.`)}}catch(l){console.error("Token validation error:",l),e(5,d="Error validating token. Please try again.")}}const J=()=>e(0,b="tts");function Y(){L=this.value,e(4,L)}const w=l=>l.key==="Enter"&&_();return u.$$set=l=>{"$$scope"in l&&e(11,f=l.$$scope)},[b,n,a,q,L,d,N,G,W,z,_,f,o,J,Y,w]}class qe extends we{constructor(t){super(),Te(this,t,Oe,De,Ce,{})}}export{qe as component};
|
hfstudio/static/_app/immutable/nodes/1.CUXC-_wj.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{S as x,i as S,s as j,n as u,d as c,a as h,b as _,c as d,e as v,f as g,g as b,h as k,j as E,t as $,k as q,l as y}from"../chunks/B1LPgyXz.js";import"../chunks/IHki7fMi.js";import{p as C}from"../chunks/B0cuSUdZ.js";function H(p){var f;let a,s=p[0].status+"",r,n,o,i=((f=p[0].error)==null?void 0:f.message)+"",m;return{c(){a=E("h1"),r=$(s),n=q(),o=E("p"),m=$(i)},l(e){a=v(e,"H1",{});var t=g(a);r=b(t,s),t.forEach(c),n=k(e),o=v(e,"P",{});var l=g(o);m=b(l,i),l.forEach(c)},m(e,t){_(e,a,t),d(a,r),_(e,n,t),_(e,o,t),d(o,m)},p(e,[t]){var l;t&1&&s!==(s=e[0].status+"")&&h(r,s),t&1&&i!==(i=((l=e[0].error)==null?void 0:l.message)+"")&&h(m,i)},i:u,o:u,d(e){e&&(c(a),c(n),c(o))}}}function P(p,a,s){let r;return y(p,C,n=>s(0,r=n)),[r]}class B extends x{constructor(a){super(),S(this,a,P,H,j,{})}}export{B as component};
|
hfstudio/static/_app/immutable/nodes/2.ColiJK7M.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{w as Yt,y,x as T,S as Fe,i as We,s as He,v as Xe,P as L,d as u,Q as rl,z as Qe,A as Ze,B as et,R as al,b as Q,c as a,T as Hl,f as m,F as xt,U as Fl,V as gl,W as ie,J as ee,L as te,M as le,K as ne,o as c,E as St,u as X,e as d,g as M,h as w,j as h,t as z,k as E,D as Vt,C as kt,a as Be,q as Je,O as Gl,X as ol,N as Kt,n as $t,m as _l,Y as ql,Z as Rl}from"../chunks/B1LPgyXz.js";import"../chunks/IHki7fMi.js";function yt(o){return(o==null?void 0:o.length)!==void 0?o:Array.from(o)}function Kl(o,e){T(o,1,1,()=>{e.delete(o.key)})}function Yl(o,e,s,t,l,n,r,i,f,p,$,v){let _=o.length,g=n.length,b=_;const k={};for(;b--;)k[o[b].key]=b;const I=[],S=new Map,q=new Map,R=[];for(b=g;b--;){const U=v(l,n,b),F=s(U);let K=r.get(F);K?R.push(()=>K.p(U,e)):(K=p(F,U),K.c()),S.set(F,I[b]=K),F in k&&q.set(F,Math.abs(b-k[F]))}const A=new Set,C=new Set;function x(U){y(U,1),U.m(i,$),r.set(U.key,U),$=U.first,g--}for(;_&&g;){const U=I[g-1],F=o[_-1],K=U.key,H=F.key;U===F?($=U.first,_--,g--):S.has(H)?!r.has(K)||A.has(K)?x(U):C.has(H)?_--:q.get(K)>q.get(H)?(C.add(K),x(U)):(A.add(H),_--):(f(F,r),_--)}for(;_--;){const U=o[_];S.has(U.key)||f(U,r)}for(;g;)x(I[g-1]);return Yt(R),I}function Ge(o,e){const s={},t={},l={$$scope:1};let n=o.length;for(;n--;){const r=o[n],i=e[n];if(i){for(const f in r)f in i||(t[f]=1);for(const f in i)l[f]||(s[f]=i[f],l[f]=1);o[n]=i}else for(const f in r)l[f]=1}for(const r in t)r in s||(s[r]=void 0);return s}function rt(o){return typeof o=="object"&&o!==null?o:{}}/**
|
| 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 pl={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 bl(o,e,s){const t=o.slice();return t[10]=e[s][0],t[11]=e[s][1],t}function fl(o){let e,s=[o[11]],t={};for(let l=0;l<s.length;l+=1)t=L(t,s[l]);return{c(){e=Fl(o[10]),this.h()},l(l){e=Hl(l,o[10],{}),m(e).forEach(u),this.h()},h(){al(e,t)},m(l,n){Q(l,e,n)},p(l,n){al(e,t=Ge(s,[n&32&&l[11]]))},d(l){l&&u(e)}}}function vl(o){let e=o[10],s,t=o[10]&&fl(o);return{c(){t&&t.c(),s=xt()},l(l){t&&t.l(l),s=xt()},m(l,n){t&&t.m(l,n),Q(l,s,n)},p(l,n){l[10]?e?He(e,l[10])?(t.d(1),t=fl(l),e=l[10],t.c(),t.m(s.parentNode,s)):t.p(l,n):(t=fl(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 Jl(o){let e,s,t,l,n,r=yt(o[5]),i=[];for(let _=0;_<r.length;_+=1)i[_]=vl(bl(o,r,_));const f=o[9].default,p=Xe(f,o,o[8],null);let $=[pl,o[6],{width:o[2]},{height:o[2]},{stroke:o[1]},{"stroke-width":t=o[4]?Number(o[3])*24/Number(o[2]):o[3]},{class:l=`lucide-icon lucide lucide-${o[0]} ${o[7].class??""}`}],v={};for(let _=0;_<$.length;_+=1)v=L(v,$[_]);return{c(){e=Fl("svg");for(let _=0;_<i.length;_+=1)i[_].c();s=xt(),p&&p.c(),this.h()},l(_){e=Hl(_,"svg",{width:!0,height:!0,stroke:!0,"stroke-width":!0,class:!0});var g=m(e);for(let b=0;b<i.length;b+=1)i[b].l(g);s=xt(),p&&p.l(g),g.forEach(u),this.h()},h(){al(e,v)},m(_,g){Q(_,e,g);for(let b=0;b<i.length;b+=1)i[b]&&i[b].m(e,null);a(e,s),p&&p.m(e,null),n=!0},p(_,[g]){if(g&32){r=yt(_[5]);let b;for(b=0;b<r.length;b+=1){const k=bl(_,r,b);i[b]?i[b].p(k,g):(i[b]=vl(k),i[b].c(),i[b].m(e,s))}for(;b<i.length;b+=1)i[b].d(1);i.length=r.length}p&&p.p&&(!n||g&256)&&Qe(p,f,_,_[8],n?et(f,_[8],g,null):Ze(_[8]),null),al(e,v=Ge($,[pl,g&64&&_[6],(!n||g&4)&&{width:_[2]},(!n||g&4)&&{height:_[2]},(!n||g&2)&&{stroke:_[1]},(!n||g&28&&t!==(t=_[4]?Number(_[3])*24/Number(_[2]):_[3]))&&{"stroke-width":t},(!n||g&129&&l!==(l=`lucide-icon lucide lucide-${_[0]} ${_[7].class??""}`))&&{class:l}]))},i(_){n||(y(p,_),n=!0)},o(_){T(p,_),n=!1},d(_){_&&u(e),rl(i,_),p&&p.d(_)}}}function Xl(o,e,s){const t=["name","color","size","strokeWidth","absoluteStrokeWidth","iconNode"];let l=gl(e,t),{$$slots:n={},$$scope:r}=e,{name:i}=e,{color:f="currentColor"}=e,{size:p=24}=e,{strokeWidth:$=2}=e,{absoluteStrokeWidth:v=!1}=e,{iconNode:_}=e;return o.$$set=g=>{s(7,e=L(L({},e),ie(g))),s(6,l=gl(e,t)),"name"in g&&s(0,i=g.name),"color"in g&&s(1,f=g.color),"size"in g&&s(2,p=g.size),"strokeWidth"in g&&s(3,$=g.strokeWidth),"absoluteStrokeWidth"in g&&s(4,v=g.absoluteStrokeWidth),"iconNode"in g&&s(5,_=g.iconNode),"$$scope"in g&&s(8,r=g.$$scope)},e=ie(e),[i,f,p,$,v,_,l,e,r,n]}class at extends Fe{constructor(e){super(),We(this,e,Xl,Jl,He,{name:0,color:1,size:2,strokeWidth:3,absoluteStrokeWidth:4,iconNode:5})}}function Ql(o){let e;const s=o[2].default,t=Xe(s,o,o[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)&&Qe(t,s,l,l[3],e?et(s,l[3],n,null):Ze(l[3]),null)},i(l){e||(y(t,l),e=!0)},o(l){T(t,l),e=!1},d(l){t&&t.d(l)}}}function Zl(o){let e,s;const t=[{name:"alert-circle"},o[1],{iconNode:o[0]}];let l={$$slots:{default:[Ql]},$$scope:{ctx:o}};for(let n=0;n<t.length;n+=1)l=L(l,t[n]);return e=new at({props:l}),{c(){ne(e.$$.fragment)},l(n){le(e.$$.fragment,n)},m(n,r){te(e,n,r),s=!0},p(n,[r]){const i=r&3?Ge(t,[t[0],r&2&&rt(n[1]),r&1&&{iconNode:n[0]}]):{};r&8&&(i.$$scope={dirty:r,ctx:n}),e.$set(i)},i(n){s||(y(e.$$.fragment,n),s=!0)},o(n){T(e.$$.fragment,n),s=!1},d(n){ee(e,n)}}}function en(o,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 o.$$set=r=>{s(1,e=L(L({},e),ie(r))),"$$scope"in r&&s(3,l=r.$$scope)},e=ie(e),[n,e,t,l]}class tn extends Fe{constructor(e){super(),We(this,e,en,Zl,He,{})}}function ln(o){let e;const s=o[2].default,t=Xe(s,o,o[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)&&Qe(t,s,l,l[3],e?et(s,l[3],n,null):Ze(l[3]),null)},i(l){e||(y(t,l),e=!0)},o(l){T(t,l),e=!1},d(l){t&&t.d(l)}}}function nn(o){let e,s;const t=[{name:"chevron-down"},o[1],{iconNode:o[0]}];let l={$$slots:{default:[ln]},$$scope:{ctx:o}};for(let n=0;n<t.length;n+=1)l=L(l,t[n]);return e=new at({props:l}),{c(){ne(e.$$.fragment)},l(n){le(e.$$.fragment,n)},m(n,r){te(e,n,r),s=!0},p(n,[r]){const i=r&3?Ge(t,[t[0],r&2&&rt(n[1]),r&1&&{iconNode:n[0]}]):{};r&8&&(i.$$scope={dirty:r,ctx:n}),e.$set(i)},i(n){s||(y(e.$$.fragment,n),s=!0)},o(n){T(e.$$.fragment,n),s=!1},d(n){ee(e,n)}}}function sn(o,e,s){let{$$slots:t={},$$scope:l}=e;const n=[["path",{d:"m6 9 6 6 6-6"}]];return o.$$set=r=>{s(1,e=L(L({},e),ie(r))),"$$scope"in r&&s(3,l=r.$$scope)},e=ie(e),[n,e,t,l]}class on extends Fe{constructor(e){super(),We(this,e,sn,nn,He,{})}}function rn(o){let e;const s=o[2].default,t=Xe(s,o,o[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)&&Qe(t,s,l,l[3],e?et(s,l[3],n,null):Ze(l[3]),null)},i(l){e||(y(t,l),e=!0)},o(l){T(t,l),e=!1},d(l){t&&t.d(l)}}}function an(o){let e,s;const t=[{name:"code"},o[1],{iconNode:o[0]}];let l={$$slots:{default:[rn]},$$scope:{ctx:o}};for(let n=0;n<t.length;n+=1)l=L(l,t[n]);return e=new at({props:l}),{c(){ne(e.$$.fragment)},l(n){le(e.$$.fragment,n)},m(n,r){te(e,n,r),s=!0},p(n,[r]){const i=r&3?Ge(t,[t[0],r&2&&rt(n[1]),r&1&&{iconNode:n[0]}]):{};r&8&&(i.$$scope={dirty:r,ctx:n}),e.$set(i)},i(n){s||(y(e.$$.fragment,n),s=!0)},o(n){T(e.$$.fragment,n),s=!1},d(n){ee(e,n)}}}function cn(o,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 o.$$set=r=>{s(1,e=L(L({},e),ie(r))),"$$scope"in r&&s(3,l=r.$$scope)},e=ie(e),[n,e,t,l]}class un extends Fe{constructor(e){super(),We(this,e,cn,an,He,{})}}function fn(o){let e;const s=o[2].default,t=Xe(s,o,o[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)&&Qe(t,s,l,l[3],e?et(s,l[3],n,null):Ze(l[3]),null)},i(l){e||(y(t,l),e=!0)},o(l){T(t,l),e=!1},d(l){t&&t.d(l)}}}function dn(o){let e,s;const t=[{name:"copy"},o[1],{iconNode:o[0]}];let l={$$slots:{default:[fn]},$$scope:{ctx:o}};for(let n=0;n<t.length;n+=1)l=L(l,t[n]);return e=new at({props:l}),{c(){ne(e.$$.fragment)},l(n){le(e.$$.fragment,n)},m(n,r){te(e,n,r),s=!0},p(n,[r]){const i=r&3?Ge(t,[t[0],r&2&&rt(n[1]),r&1&&{iconNode:n[0]}]):{};r&8&&(i.$$scope={dirty:r,ctx:n}),e.$set(i)},i(n){s||(y(e.$$.fragment,n),s=!0)},o(n){T(e.$$.fragment,n),s=!1},d(n){ee(e,n)}}}function hn(o,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 o.$$set=r=>{s(1,e=L(L({},e),ie(r))),"$$scope"in r&&s(3,l=r.$$scope)},e=ie(e),[n,e,t,l]}class Wl extends Fe{constructor(e){super(),We(this,e,hn,dn,He,{})}}function mn(o){let e;const s=o[2].default,t=Xe(s,o,o[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)&&Qe(t,s,l,l[3],e?et(s,l[3],n,null):Ze(l[3]),null)},i(l){e||(y(t,l),e=!0)},o(l){T(t,l),e=!1},d(l){t&&t.d(l)}}}function gn(o){let e,s;const t=[{name:"download"},o[1],{iconNode:o[0]}];let l={$$slots:{default:[mn]},$$scope:{ctx:o}};for(let n=0;n<t.length;n+=1)l=L(l,t[n]);return e=new at({props:l}),{c(){ne(e.$$.fragment)},l(n){le(e.$$.fragment,n)},m(n,r){te(e,n,r),s=!0},p(n,[r]){const i=r&3?Ge(t,[t[0],r&2&&rt(n[1]),r&1&&{iconNode:n[0]}]):{};r&8&&(i.$$scope={dirty:r,ctx:n}),e.$set(i)},i(n){s||(y(e.$$.fragment,n),s=!0)},o(n){T(e.$$.fragment,n),s=!1},d(n){ee(e,n)}}}function _n(o,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 o.$$set=r=>{s(1,e=L(L({},e),ie(r))),"$$scope"in r&&s(3,l=r.$$scope)},e=ie(e),[n,e,t,l]}class kl extends Fe{constructor(e){super(),We(this,e,_n,gn,He,{})}}function pn(o){let e;const s=o[2].default,t=Xe(s,o,o[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)&&Qe(t,s,l,l[3],e?et(s,l[3],n,null):Ze(l[3]),null)},i(l){e||(y(t,l),e=!0)},o(l){T(t,l),e=!1},d(l){t&&t.d(l)}}}function bn(o){let e,s;const t=[{name:"loader-2"},o[1],{iconNode:o[0]}];let l={$$slots:{default:[pn]},$$scope:{ctx:o}};for(let n=0;n<t.length;n+=1)l=L(l,t[n]);return e=new at({props:l}),{c(){ne(e.$$.fragment)},l(n){le(e.$$.fragment,n)},m(n,r){te(e,n,r),s=!0},p(n,[r]){const i=r&3?Ge(t,[t[0],r&2&&rt(n[1]),r&1&&{iconNode:n[0]}]):{};r&8&&(i.$$scope={dirty:r,ctx:n}),e.$set(i)},i(n){s||(y(e.$$.fragment,n),s=!0)},o(n){T(e.$$.fragment,n),s=!1},d(n){ee(e,n)}}}function vn(o,e,s){let{$$slots:t={},$$scope:l}=e;const n=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56"}]];return o.$$set=r=>{s(1,e=L(L({},e),ie(r))),"$$scope"in r&&s(3,l=r.$$scope)},e=ie(e),[n,e,t,l]}class kn extends Fe{constructor(e){super(),We(this,e,vn,bn,He,{})}}function yn(o){let e;const s=o[2].default,t=Xe(s,o,o[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)&&Qe(t,s,l,l[3],e?et(s,l[3],n,null):Ze(l[3]),null)},i(l){e||(y(t,l),e=!0)},o(l){T(t,l),e=!1},d(l){t&&t.d(l)}}}function $n(o){let e,s;const t=[{name:"more-horizontal"},o[1],{iconNode:o[0]}];let l={$$slots:{default:[yn]},$$scope:{ctx:o}};for(let n=0;n<t.length;n+=1)l=L(l,t[n]);return e=new at({props:l}),{c(){ne(e.$$.fragment)},l(n){le(e.$$.fragment,n)},m(n,r){te(e,n,r),s=!0},p(n,[r]){const i=r&3?Ge(t,[t[0],r&2&&rt(n[1]),r&1&&{iconNode:n[0]}]):{};r&8&&(i.$$scope={dirty:r,ctx:n}),e.$set(i)},i(n){s||(y(e.$$.fragment,n),s=!0)},o(n){T(e.$$.fragment,n),s=!1},d(n){ee(e,n)}}}function wn(o,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 o.$$set=r=>{s(1,e=L(L({},e),ie(r))),"$$scope"in r&&s(3,l=r.$$scope)},e=ie(e),[n,e,t,l]}class En extends Fe{constructor(e){super(),We(this,e,wn,$n,He,{})}}function Nn(o){let e;const s=o[2].default,t=Xe(s,o,o[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)&&Qe(t,s,l,l[3],e?et(s,l[3],n,null):Ze(l[3]),null)},i(l){e||(y(t,l),e=!0)},o(l){T(t,l),e=!1},d(l){t&&t.d(l)}}}function Tn(o){let e,s;const t=[{name:"panels-top-left"},o[1],{iconNode:o[0]}];let l={$$slots:{default:[Nn]},$$scope:{ctx:o}};for(let n=0;n<t.length;n+=1)l=L(l,t[n]);return e=new at({props:l}),{c(){ne(e.$$.fragment)},l(n){le(e.$$.fragment,n)},m(n,r){te(e,n,r),s=!0},p(n,[r]){const i=r&3?Ge(t,[t[0],r&2&&rt(n[1]),r&1&&{iconNode:n[0]}]):{};r&8&&(i.$$scope={dirty:r,ctx:n}),e.$set(i)},i(n){s||(y(e.$$.fragment,n),s=!0)},o(n){T(e.$$.fragment,n),s=!1},d(n){ee(e,n)}}}function In(o,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 o.$$set=r=>{s(1,e=L(L({},e),ie(r))),"$$scope"in r&&s(3,l=r.$$scope)},e=ie(e),[n,e,t,l]}class Dn extends Fe{constructor(e){super(),We(this,e,In,Tn,He,{})}}function Sn(o){let e;const s=o[2].default,t=Xe(s,o,o[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)&&Qe(t,s,l,l[3],e?et(s,l[3],n,null):Ze(l[3]),null)},i(l){e||(y(t,l),e=!0)},o(l){T(t,l),e=!1},d(l){t&&t.d(l)}}}function Vn(o){let e,s;const t=[{name:"play"},o[1],{iconNode:o[0]}];let l={$$slots:{default:[Sn]},$$scope:{ctx:o}};for(let n=0;n<t.length;n+=1)l=L(l,t[n]);return e=new at({props:l}),{c(){ne(e.$$.fragment)},l(n){le(e.$$.fragment,n)},m(n,r){te(e,n,r),s=!0},p(n,[r]){const i=r&3?Ge(t,[t[0],r&2&&rt(n[1]),r&1&&{iconNode:n[0]}]):{};r&8&&(i.$$scope={dirty:r,ctx:n}),e.$set(i)},i(n){s||(y(e.$$.fragment,n),s=!0)},o(n){T(e.$$.fragment,n),s=!1},d(n){ee(e,n)}}}function Cn(o,e,s){let{$$slots:t={},$$scope:l}=e;const n=[["polygon",{points:"5 3 19 12 5 21 5 3"}]];return o.$$set=r=>{s(1,e=L(L({},e),ie(r))),"$$scope"in r&&s(3,l=r.$$scope)},e=ie(e),[n,e,t,l]}class dl extends Fe{constructor(e){super(),We(this,e,Cn,Vn,He,{})}}function An(o){let e;const s=o[2].default,t=Xe(s,o,o[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)&&Qe(t,s,l,l[3],e?et(s,l[3],n,null):Ze(l[3]),null)},i(l){e||(y(t,l),e=!0)},o(l){T(t,l),e=!1},d(l){t&&t.d(l)}}}function Pn(o){let e,s;const t=[{name:"share"},o[1],{iconNode:o[0]}];let l={$$slots:{default:[An]},$$scope:{ctx:o}};for(let n=0;n<t.length;n+=1)l=L(l,t[n]);return e=new at({props:l}),{c(){ne(e.$$.fragment)},l(n){le(e.$$.fragment,n)},m(n,r){te(e,n,r),s=!0},p(n,[r]){const i=r&3?Ge(t,[t[0],r&2&&rt(n[1]),r&1&&{iconNode:n[0]}]):{};r&8&&(i.$$scope={dirty:r,ctx:n}),e.$set(i)},i(n){s||(y(e.$$.fragment,n),s=!0)},o(n){T(e.$$.fragment,n),s=!1},d(n){ee(e,n)}}}function xn(o,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 o.$$set=r=>{s(1,e=L(L({},e),ie(r))),"$$scope"in r&&s(3,l=r.$$scope)},e=ie(e),[n,e,t,l]}class yl extends Fe{constructor(e){super(),We(this,e,xn,Pn,He,{})}}function Un(o){let e;const s=o[2].default,t=Xe(s,o,o[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)&&Qe(t,s,l,l[3],e?et(s,l[3],n,null):Ze(l[3]),null)},i(l){e||(y(t,l),e=!0)},o(l){T(t,l),e=!1},d(l){t&&t.d(l)}}}function On(o){let e,s;const t=[{name:"skip-back"},o[1],{iconNode:o[0]}];let l={$$slots:{default:[Un]},$$scope:{ctx:o}};for(let n=0;n<t.length;n+=1)l=L(l,t[n]);return e=new at({props:l}),{c(){ne(e.$$.fragment)},l(n){le(e.$$.fragment,n)},m(n,r){te(e,n,r),s=!0},p(n,[r]){const i=r&3?Ge(t,[t[0],r&2&&rt(n[1]),r&1&&{iconNode:n[0]}]):{};r&8&&(i.$$scope={dirty:r,ctx:n}),e.$set(i)},i(n){s||(y(e.$$.fragment,n),s=!0)},o(n){T(e.$$.fragment,n),s=!1},d(n){ee(e,n)}}}function Mn(o,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 o.$$set=r=>{s(1,e=L(L({},e),ie(r))),"$$scope"in r&&s(3,l=r.$$scope)},e=ie(e),[n,e,t,l]}class zn extends Fe{constructor(e){super(),We(this,e,Mn,On,He,{})}}function Ln(o){let e;const s=o[2].default,t=Xe(s,o,o[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)&&Qe(t,s,l,l[3],e?et(s,l[3],n,null):Ze(l[3]),null)},i(l){e||(y(t,l),e=!0)},o(l){T(t,l),e=!1},d(l){t&&t.d(l)}}}function jn(o){let e,s;const t=[{name:"skip-forward"},o[1],{iconNode:o[0]}];let l={$$slots:{default:[Ln]},$$scope:{ctx:o}};for(let n=0;n<t.length;n+=1)l=L(l,t[n]);return e=new at({props:l}),{c(){ne(e.$$.fragment)},l(n){le(e.$$.fragment,n)},m(n,r){te(e,n,r),s=!0},p(n,[r]){const i=r&3?Ge(t,[t[0],r&2&&rt(n[1]),r&1&&{iconNode:n[0]}]):{};r&8&&(i.$$scope={dirty:r,ctx:n}),e.$set(i)},i(n){s||(y(e.$$.fragment,n),s=!0)},o(n){T(e.$$.fragment,n),s=!1},d(n){ee(e,n)}}}function Bn(o,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 o.$$set=r=>{s(1,e=L(L({},e),ie(r))),"$$scope"in r&&s(3,l=r.$$scope)},e=ie(e),[n,e,t,l]}class Hn extends Fe{constructor(e){super(),We(this,e,Bn,jn,He,{})}}function $l(o,e,s){const t=o.slice();return t[58]=e[s],t}function wl(o,e,s){const t=o.slice();return t[50]=e[s],t}function El(o,e,s){const t=o.slice();return t[53]=e[s],t}function Nl(o,e,s){const t=o.slice();return t[53]=e[s],t}function Tl(o){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-1p3ull4")},m(s,t){Q(s,e,t)},d(s){s&&u(e)}}}function Fn(o){let e,s,t,l,n='<h2 class="text-2xl font-semibold text-gray-900">Integration Code</h2> <p class="text-sm text-gray-600 mt-1">Python code to reproduce your actions via the API</p>',r,i,f,p,$,v=o[2].length>0&&Il(o);const _=[qn,Gn],g=[];function b(k,I){return k[2].length===0?0:1}return f=b(o),p=g[f]=_[f](o),{c(){e=h("div"),s=h("div"),t=h("div"),l=h("div"),l.innerHTML=n,r=E(),v&&v.c(),i=E(),p.c(),this.h()},l(k){e=d(k,"DIV",{class:!0});var I=m(e);s=d(I,"DIV",{class:!0});var S=m(s);t=d(S,"DIV",{class:!0});var q=m(t);l=d(q,"DIV",{"data-svelte-h":!0}),Je(l)!=="svelte-jwt4ug"&&(l.innerHTML=n),r=w(q),v&&v.l(q),q.forEach(u),i=w(S),p.l(S),S.forEach(u),I.forEach(u),this.h()},h(){c(t,"class","flex items-center justify-between mb-6"),c(s,"class","max-w-4xl mx-auto p-8"),c(e,"class","flex-1 bg-gray-50 overflow-y-auto")},m(k,I){Q(k,e,I),a(e,s),a(s,t),a(t,l),a(t,r),v&&v.m(t,null),a(s,i),g[f].m(s,null),$=!0},p(k,I){k[2].length>0?v?(v.p(k,I),I[0]&4&&y(v,1)):(v=Il(k),v.c(),y(v,1),v.m(t,null)):v&&(Vt(),T(v,1,1,()=>{v=null}),St());let S=f;f=b(k),f===S?g[f].p(k,I):(Vt(),T(g[S],1,1,()=>{g[S]=null}),St(),p=g[f],p?p.p(k,I):(p=g[f]=_[f](k),p.c()),y(p,1),p.m(s,null))},i(k){$||(y(v),y(p),$=!0)},o(k){T(v),T(p),$=!1},d(k){k&&u(e),v&&v.d(),g[f].d()}}}function Wn(o){let e,s,t,l,n,r,i,f,p,$=o[0].length+"",v,_,g,b,k,I,S,q,R,A,C,x,U="Model",F,K,H,P,j,O,Ce,Z,W,Ee='<h3 class="font-medium text-gray-900">Voice</h3>',pe,de,Y,D,re='<div class="flex items-center gap-2"><div class="w-8 h-8 bg-gray-400 rounded-full flex items-center justify-center text-white text-xs font-medium">+</div> <span class="text-sm font-medium text-gray-600">Clone your voice</span></div> <div class="text-xs text-gray-400">(coming soon)</div>',Ne,ce,Te,Ie,oe,Le="Speed",Ue,Ae,$e=o[11].toFixed(1)+"",he,xe,wt,be,B,ke,ye="<span>0.5x</span> <span>2.0x</span>",De,Pe,qe,it,Et="Stability",ct,ut,tt=(o[12]*100).toFixed(0)+"",_t,Ct,Ut,me,lt,je,nt,ft,dt="Similarity",ht,mt,Re=(o[13]*100).toFixed(0)+"",st,Ot,Oe,Me,Bt,pt,ze,bt,qt="Style",gt,Nt,ve=o[14]===0?"None":"Exaggerated",V,ae,ge,Se,Ht,Ft,fe=o[5]==="local"&&Vl();const Mt=[Kn,Rn],ot=[];function zt(N,J){return N[7]?0:1}k=zt(o),I=ot[k]=Mt[k](o);let _e=o[8]&&Cl(o),Ke=yt(o[20]),we=[];for(let N=0;N<Ke.length;N+=1)we[N]=xl(Nl(o,Ke,N));j=new on({props:{size:16,class:"text-gray-500"}});let Ve=o[6]&&Ul(o),Tt=yt(o[21]),se=[];for(let N=0;N<Tt.length;N+=1)se[N]=Ml(wl(o,Tt,N));return{c(){e=h("div"),s=h("div"),fe&&fe.c(),t=E(),l=h("div"),n=h("textarea"),r=E(),i=h("div"),f=h("div"),p=h("span"),v=z($),_=z(" / 5,000 characters"),g=E(),b=h("button"),I.c(),q=E(),_e&&_e.c(),R=E(),A=h("div"),C=h("div"),x=h("h3"),x.textContent=U,F=E(),K=h("button"),H=h("span");for(let N=0;N<we.length;N+=1)we[N].c();P=E(),ne(j.$$.fragment),O=E(),Ve&&Ve.c(),Ce=E(),Z=h("div"),W=h("div"),W.innerHTML=Ee,pe=E(),de=h("div");for(let N=0;N<se.length;N+=1)se[N].c();Y=E(),D=h("button"),D.innerHTML=re,Ne=E(),ce=h("div"),Te=h("div"),Ie=h("div"),oe=h("label"),oe.textContent=Le,Ue=E(),Ae=h("span"),he=z($e),xe=z("x"),wt=E(),be=h("input"),B=E(),ke=h("div"),ke.innerHTML=ye,De=E(),Pe=h("div"),qe=h("div"),it=h("label"),it.textContent=Et,ct=E(),ut=h("span"),_t=z(tt),Ct=z("%"),Ut=E(),me=h("input"),lt=E(),je=h("div"),nt=h("div"),ft=h("label"),ft.textContent=dt,ht=E(),mt=h("span"),st=z(Re),Ot=z("%"),Oe=E(),Me=h("input"),Bt=E(),pt=h("div"),ze=h("div"),bt=h("label"),bt.textContent=qt,gt=E(),Nt=h("span"),V=z(ve),ae=E(),ge=h("input"),this.h()},l(N){e=d(N,"DIV",{class:!0});var J=m(e);s=d(J,"DIV",{class:!0});var ue=m(s);fe&&fe.l(ue),t=w(ue),l=d(ue,"DIV",{class:!0});var G=m(l);n=d(G,"TEXTAREA",{class:!0,placeholder:!0}),m(n).forEach(u),G.forEach(u),r=w(ue),i=d(ue,"DIV",{class:!0});var Ye=m(i);f=d(Ye,"DIV",{class:!0});var Rt=m(f);p=d(Rt,"SPAN",{class:!0});var Wt=m(p);v=M(Wt,$),_=M(Wt," / 5,000 characters"),Wt.forEach(u),Rt.forEach(u),g=w(Ye),b=d(Ye,"BUTTON",{class:!0});var It=m(b);I.l(It),It.forEach(u),Ye.forEach(u),q=w(ue),_e&&_e.l(ue),ue.forEach(u),R=w(J),A=d(J,"DIV",{class:!0});var vt=m(A);C=d(vt,"DIV",{class:!0});var Dt=m(C);x=d(Dt,"H3",{class:!0,"data-svelte-h":!0}),Je(x)!=="svelte-b3hs3r"&&(x.textContent=U),F=w(Dt),K=d(Dt,"BUTTON",{class:!0});var Lt=m(K);H=d(Lt,"SPAN",{});var hl=m(H);for(let jt=0;jt<we.length;jt+=1)we[jt].l(hl);hl.forEach(u),P=w(Lt),le(j.$$.fragment,Lt),Lt.forEach(u),O=w(Dt),Ve&&Ve.l(Dt),Dt.forEach(u),Ce=w(vt),Z=d(vt,"DIV",{class:!0});var Jt=m(Z);W=d(Jt,"DIV",{class:!0,"data-svelte-h":!0}),Je(W)!=="svelte-182x1ki"&&(W.innerHTML=Ee),pe=w(Jt),de=d(Jt,"DIV",{class:!0});var Xt=m(de);for(let jt=0;jt<se.length;jt+=1)se[jt].l(Xt);Y=w(Xt),D=d(Xt,"BUTTON",{class:!0,"data-svelte-h":!0}),Je(D)!=="svelte-20x663"&&(D.innerHTML=re),Xt.forEach(u),Jt.forEach(u),Ne=w(vt),ce=d(vt,"DIV",{class:!0});var At=m(ce);Te=d(At,"DIV",{});var Gt=m(Te);Ie=d(Gt,"DIV",{class:!0});var Qt=m(Ie);oe=d(Qt,"LABEL",{class:!0,"data-svelte-h":!0}),Je(oe)!=="svelte-9vcpiu"&&(oe.textContent=Le),Ue=w(Qt),Ae=d(Qt,"SPAN",{class:!0});var il=m(Ae);he=M(il,$e),xe=M(il,"x"),il.forEach(u),Qt.forEach(u),wt=w(Gt),be=d(Gt,"INPUT",{type:!0,min:!0,max:!0,step:!0,class:!0}),B=w(Gt),ke=d(Gt,"DIV",{class:!0,"data-svelte-h":!0}),Je(ke)!=="svelte-4ydm1m"&&(ke.innerHTML=ye),Gt.forEach(u),De=w(At),Pe=d(At,"DIV",{});var Zt=m(Pe);qe=d(Zt,"DIV",{class:!0});var el=m(qe);it=d(el,"LABEL",{class:!0,"data-svelte-h":!0}),Je(it)!=="svelte-1lgjete"&&(it.textContent=Et),ct=w(el),ut=d(el,"SPAN",{class:!0});var cl=m(ut);_t=M(cl,tt),Ct=M(cl,"%"),cl.forEach(u),el.forEach(u),Ut=w(Zt),me=d(Zt,"INPUT",{type:!0,min:!0,max:!0,step:!0,class:!0}),Zt.forEach(u),lt=w(At),je=d(At,"DIV",{});var tl=m(je);nt=d(tl,"DIV",{class:!0});var ll=m(nt);ft=d(ll,"LABEL",{class:!0,"data-svelte-h":!0}),Je(ft)!=="svelte-1ha0vec"&&(ft.textContent=dt),ht=w(ll),mt=d(ll,"SPAN",{class:!0});var ul=m(mt);st=M(ul,Re),Ot=M(ul,"%"),ul.forEach(u),ll.forEach(u),Oe=w(tl),Me=d(tl,"INPUT",{type:!0,min:!0,max:!0,step:!0,class:!0}),tl.forEach(u),Bt=w(At),pt=d(At,"DIV",{});var nl=m(pt);ze=d(nl,"DIV",{class:!0});var sl=m(ze);bt=d(sl,"LABEL",{class:!0,"data-svelte-h":!0}),Je(bt)!=="svelte-1ata0tk"&&(bt.textContent=qt),gt=w(sl),Nt=d(sl,"SPAN",{class:!0});var ml=m(Nt);V=M(ml,ve),ml.forEach(u),sl.forEach(u),ae=w(nl),ge=d(nl,"INPUT",{type:!0,min:!0,max:!0,step:!0,class:!0}),nl.forEach(u),At.forEach(u),vt.forEach(u),J.forEach(u),this.h()},h(){c(n,"class","w-full h-full p-6 bg-white resize-none border-0 focus:outline-none text-gray-900 text-base leading-relaxed"),c(n,"placeholder","Welcome to our text to speech demo. This technology can transform any written content into natural sounding audio."),c(l,"class","flex-1 pb-24"),c(p,"class","text-sm text-gray-500"),c(f,"class","flex items-center justify-between mb-3"),b.disabled=S=o[7]||!o[0].trim(),c(b,"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(i,"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(x,"class","font-medium text-gray-900 mb-3"),c(K,"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(C,"class","mb-6 relative model-dropdown"),c(W,"class","mb-3"),c(D,"class","w-full flex items-center justify-between p-2 rounded-md opacity-50 cursor-not-allowed text-left"),D.disabled=!0,c(de,"class","space-y-1"),c(Z,"class","mb-6"),c(oe,"class","text-sm font-medium text-gray-700"),c(Ae,"class","text-sm text-gray-500"),c(Ie,"class","flex justify-between mb-1"),c(be,"type","range"),c(be,"min","0.5"),c(be,"max","2"),c(be,"step","0.1"),c(be,"class","w-full h-1.5 bg-gray-200 rounded-lg appearance-none cursor-pointer slider-hf"),c(ke,"class","flex justify-between text-xs text-gray-400 mt-1"),c(it,"class","text-sm font-medium text-gray-700"),c(ut,"class","text-sm text-gray-500"),c(qe,"class","flex justify-between mb-1"),c(me,"type","range"),c(me,"min","0"),c(me,"max","1"),c(me,"step","0.01"),c(me,"class","w-full h-1.5 bg-gray-200 rounded-lg appearance-none cursor-pointer slider-hf"),c(ft,"class","text-sm font-medium text-gray-700"),c(mt,"class","text-sm text-gray-500"),c(nt,"class","flex justify-between mb-1"),c(Me,"type","range"),c(Me,"min","0"),c(Me,"max","1"),c(Me,"step","0.01"),c(Me,"class","w-full h-1.5 bg-gray-200 rounded-lg appearance-none cursor-pointer slider-hf"),c(bt,"class","text-sm font-medium text-gray-700"),c(Nt,"class","text-sm text-gray-500"),c(ze,"class","flex justify-between mb-1"),c(ge,"type","range"),c(ge,"min","0"),c(ge,"max","1"),c(ge,"step","1"),c(ge,"class","w-full h-1.5 bg-gray-200 rounded-lg appearance-none cursor-pointer slider-hf"),c(ce,"class","space-y-4 pt-4 border-t border-gray-200"),c(A,"class","w-80 border-l border-gray-200 bg-white p-4 overflow-y-auto"),c(e,"class","flex-1 flex")},m(N,J){Q(N,e,J),a(e,s),fe&&fe.m(s,null),a(s,t),a(s,l),a(l,n),kt(n,o[0]),a(s,r),a(s,i),a(i,f),a(f,p),a(p,v),a(p,_),a(i,g),a(i,b),ot[k].m(b,null),a(s,q),_e&&_e.m(s,null),a(e,R),a(e,A),a(A,C),a(C,x),a(C,F),a(C,K),a(K,H);for(let ue=0;ue<we.length;ue+=1)we[ue]&&we[ue].m(H,null);a(K,P),te(j,K,null),a(C,O),Ve&&Ve.m(C,null),a(A,Ce),a(A,Z),a(Z,W),a(Z,pe),a(Z,de);for(let ue=0;ue<se.length;ue+=1)se[ue]&&se[ue].m(de,null);a(de,Y),a(de,D),a(A,Ne),a(A,ce),a(ce,Te),a(Te,Ie),a(Ie,oe),a(Ie,Ue),a(Ie,Ae),a(Ae,he),a(Ae,xe),a(Te,wt),a(Te,be),kt(be,o[11]),a(Te,B),a(Te,ke),a(ce,De),a(ce,Pe),a(Pe,qe),a(qe,it),a(qe,ct),a(qe,ut),a(ut,_t),a(ut,Ct),a(Pe,Ut),a(Pe,me),kt(me,o[12]),a(ce,lt),a(ce,je),a(je,nt),a(nt,ft),a(nt,ht),a(nt,mt),a(mt,st),a(mt,Ot),a(je,Oe),a(je,Me),kt(Me,o[13]),a(ce,Bt),a(ce,pt),a(pt,ze),a(ze,bt),a(ze,gt),a(ze,Nt),a(Nt,V),a(pt,ae),a(pt,ge),kt(ge,o[14]),Se=!0,Ht||(Ft=[X(n,"input",o[37]),X(b,"click",o[22]),X(K,"click",o[39]),X(be,"change",o[42]),X(be,"input",o[42]),X(me,"change",o[43]),X(me,"input",o[43]),X(Me,"change",o[44]),X(Me,"input",o[44]),X(ge,"change",o[45]),X(ge,"input",o[45])],Ht=!0)},p(N,J){N[5]==="local"?fe?J[0]&32&&y(fe,1):(fe=Vl(),fe.c(),y(fe,1),fe.m(s,t)):fe&&(Vt(),T(fe,1,1,()=>{fe=null}),St()),J[0]&1&&kt(n,N[0]),(!Se||J[0]&1)&&$!==($=N[0].length+"")&&Be(v,$);let ue=k;if(k=zt(N),k!==ue&&(Vt(),T(ot[ue],1,1,()=>{ot[ue]=null}),St(),I=ot[k],I||(I=ot[k]=Mt[k](N),I.c()),y(I,1),I.m(b,null)),(!Se||J[0]&129&&S!==(S=N[7]||!N[0].trim()))&&(b.disabled=S),N[8]?_e?(_e.p(N,J),J[0]&256&&y(_e,1)):(_e=Cl(N),_e.c(),y(_e,1),_e.m(s,null)):_e&&(Vt(),T(_e,1,1,()=>{_e=null}),St()),J[0]&1048592){Ke=yt(N[20]);let G;for(G=0;G<Ke.length;G+=1){const Ye=Nl(N,Ke,G);we[G]?we[G].p(Ye,J):(we[G]=xl(Ye),we[G].c(),we[G].m(H,null))}for(;G<we.length;G+=1)we[G].d(1);we.length=Ke.length}if(N[6]?Ve?Ve.p(N,J):(Ve=Ul(N),Ve.c(),Ve.m(C,null)):Ve&&(Ve.d(1),Ve=null),J[0]&2097160){Tt=yt(N[21]);let G;for(G=0;G<Tt.length;G+=1){const Ye=wl(N,Tt,G);se[G]?se[G].p(Ye,J):(se[G]=Ml(Ye),se[G].c(),se[G].m(de,Y))}for(;G<se.length;G+=1)se[G].d(1);se.length=Tt.length}(!Se||J[0]&2048)&&$e!==($e=N[11].toFixed(1)+"")&&Be(he,$e),J[0]&2048&&kt(be,N[11]),(!Se||J[0]&4096)&&tt!==(tt=(N[12]*100).toFixed(0)+"")&&Be(_t,tt),J[0]&4096&&kt(me,N[12]),(!Se||J[0]&8192)&&Re!==(Re=(N[13]*100).toFixed(0)+"")&&Be(st,Re),J[0]&8192&&kt(Me,N[13]),(!Se||J[0]&16384)&&ve!==(ve=N[14]===0?"None":"Exaggerated")&&Be(V,ve),J[0]&16384&&kt(ge,N[14])},i(N){Se||(y(fe),y(I),y(_e),y(j.$$.fragment,N),Se=!0)},o(N){T(fe),T(I),T(_e),T(j.$$.fragment,N),Se=!1},d(N){N&&u(e),fe&&fe.d(),ot[k].d(),_e&&_e.d(),rl(we,N),ee(j),Ve&&Ve.d(),rl(se,N),Ht=!1,Yt(Ft)}}}function Il(o){let e,s,t,l,n,r;return s=new Wl({props:{size:16}}),{c(){e=h("button"),ne(s.$$.fragment),t=z(`
|
| 7 |
+
Copy All`),this.h()},l(i){e=d(i,"BUTTON",{class:!0});var f=m(e);le(s.$$.fragment,f),t=M(f,`
|
| 8 |
+
Copy All`),f.forEach(u),this.h()},h(){c(e,"class","flex items-center gap-2 px-4 py-2 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors")},m(i,f){Q(i,e,f),te(s,e,null),a(e,t),l=!0,n||(r=X(e,"click",o[31]),n=!0)},p:$t,i(i){l||(y(s.$$.fragment,i),l=!0)},o(i){T(s.$$.fragment,i),l=!1},d(i){i&&u(e),ee(s),n=!1,r()}}}function Gn(o){let e,s=[],t=new Map,l,n=yt(o[2]);const r=i=>i[58].id;for(let i=0;i<n.length;i+=1){let f=$l(o,n,i),p=r(f);t.set(p,s[i]=Sl(p,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 p=0;p<s.length;p+=1)s[p].l(f);f.forEach(u),this.h()},h(){c(e,"class","space-y-4")},m(i,f){Q(i,e,f);for(let p=0;p<s.length;p+=1)s[p]&&s[p].m(e,null);l=!0},p(i,f){f[0]&1073741828&&(n=yt(i[2]),Vt(),s=Yl(s,f,r,1,i,n,t,e,Kl,Sl,null,$l),St())},i(i){if(!l){for(let f=0;f<n.length;f+=1)y(s[f]);l=!0}},o(i){for(let f=0;f<s.length;f+=1)T(s[f]);l=!1},d(i){i&&u(e);for(let f=0;f<s.length;f+=1)s[f].d()}}}function qn(o){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}),Je(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){Q(t,e,l)},p:$t,i:$t,o:$t,d(t){t&&u(e)}}}function Dl(o){let e,s=o[58].output+"",t;return{c(){e=h("div"),t=z(s),this.h()},l(l){e=d(l,"DIV",{class:!0});var n=m(e);t=M(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){Q(l,e,n),a(e,t)},p(l,n){n[0]&4&&s!==(s=l[58].output+"")&&Be(t,s)},d(l){l&&u(e)}}}function Sl(o,e){let s,t,l,n,r=e[58].title+"",i,f,p,$=e[58].timestamp+"",v,_,g,b,k,I,S,q,R,A=Ll(e[58].code)+"",C,x,U,F,K;b=new Wl({props:{size:14,class:"text-gray-600"}});function H(){return e[46](e[58])}let P=e[58].output&&Dl(e);return{key:o,first:null,c(){s=h("div"),t=h("div"),l=h("div"),n=h("span"),i=z(r),f=E(),p=h("span"),v=z($),_=E(),g=h("button"),ne(b.$$.fragment),k=E(),I=h("div"),S=h("pre"),q=h("code"),R=new Rl(!1),C=E(),P&&P.c(),x=E(),this.h()},l(j){s=d(j,"DIV",{class:!0});var O=m(s);t=d(O,"DIV",{class:!0});var Ce=m(t);l=d(Ce,"DIV",{class:!0});var Z=m(l);n=d(Z,"SPAN",{class:!0});var W=m(n);i=M(W,r),W.forEach(u),f=w(Z),p=d(Z,"SPAN",{class:!0});var Ee=m(p);v=M(Ee,$),Ee.forEach(u),Z.forEach(u),_=w(Ce),g=d(Ce,"BUTTON",{class:!0,title:!0});var pe=m(g);le(b.$$.fragment,pe),pe.forEach(u),Ce.forEach(u),k=w(O),I=d(O,"DIV",{class:!0});var de=m(I);S=d(de,"PRE",{class:!0});var Y=m(S);q=d(Y,"CODE",{class:!0});var D=m(q);R=ql(D,!1),D.forEach(u),Y.forEach(u),de.forEach(u),C=w(O),P&&P.l(O),x=w(O),O.forEach(u),this.h()},h(){c(n,"class","text-sm font-medium text-gray-700"),c(p,"class","text-xs text-gray-500"),c(l,"class","flex items-center gap-3"),c(g,"class","p-1.5 hover:bg-gray-200 rounded transition-colors"),c(g,"title","Copy code"),c(t,"class","flex items-center justify-between px-4 py-2 bg-gray-50 border-b border-gray-200"),R.a=null,c(q,"class","language-python text-sm"),c(S,"class","p-4 overflow-x-auto bg-gray-50"),c(I,"class","relative"),c(s,"class","bg-white rounded-lg border border-gray-200 overflow-hidden"),this.first=s},m(j,O){Q(j,s,O),a(s,t),a(t,l),a(l,n),a(n,i),a(l,f),a(l,p),a(p,v),a(t,_),a(t,g),te(b,g,null),a(s,k),a(s,I),a(I,S),a(S,q),R.m(A,q),a(s,C),P&&P.m(s,null),a(s,x),U=!0,F||(K=X(g,"click",H),F=!0)},p(j,O){e=j,(!U||O[0]&4)&&r!==(r=e[58].title+"")&&Be(i,r),(!U||O[0]&4)&&$!==($=e[58].timestamp+"")&&Be(v,$),(!U||O[0]&4)&&A!==(A=Ll(e[58].code)+"")&&R.p(A),e[58].output?P?P.p(e,O):(P=Dl(e),P.c(),P.m(s,x)):P&&(P.d(1),P=null)},i(j){U||(y(b.$$.fragment,j),U=!0)},o(j){T(b.$$.fragment,j),U=!1},d(j){j&&u(s),ee(b),P&&P.d(),F=!1,K()}}}function Vl(o){let e,s,t,l,n='<p class="font-medium text-blue-900">To run locally:</p> <code class="text-xs bg-blue-100 px-1.5 py-0.5 rounded">pip install hfstudio</code> <span class="text-blue-700">and run</span> <code class="text-xs bg-blue-100 px-1.5 py-0.5 rounded">hfstudio</code> <span class="text-blue-700">from your terminal</span>',r;return s=new tn({props:{size:18,class:"text-blue-600 mt-0.5 flex-shrink-0"}}),{c(){e=h("div"),ne(s.$$.fragment),t=E(),l=h("div"),l.innerHTML=n,this.h()},l(i){e=d(i,"DIV",{class:!0});var f=m(e);le(s.$$.fragment,f),t=w(f),l=d(f,"DIV",{class:!0,"data-svelte-h":!0}),Je(l)!=="svelte-p3cqs1"&&(l.innerHTML=n),f.forEach(u),this.h()},h(){c(l,"class","text-sm"),c(e,"class","mb-4 p-3 bg-blue-50 border border-blue-200 rounded-lg flex items-start gap-2")},m(i,f){Q(i,e,f),te(s,e,null),a(e,t),a(e,l),r=!0},i(i){r||(y(s.$$.fragment,i),r=!0)},o(i){T(s.$$.fragment,i),r=!1},d(i){i&&u(e),ee(s)}}}function Rn(o){let e,s,t;return e=new dl({props:{size:20}}),{c(){ne(e.$$.fragment),s=z(`
|
| 9 |
+
Generate speech`)},l(l){le(e.$$.fragment,l),s=M(l,`
|
| 10 |
+
Generate speech`)},m(l,n){te(e,l,n),Q(l,s,n),t=!0},i(l){t||(y(e.$$.fragment,l),t=!0)},o(l){T(e.$$.fragment,l),t=!1},d(l){l&&u(s),ee(e,l)}}}function Kn(o){let e,s,t;return e=new kn({props:{size:20,class:"animate-spin"}}),{c(){ne(e.$$.fragment),s=z(`
|
| 11 |
+
Generating...`)},l(l){le(e.$$.fragment,l),s=M(l,`
|
| 12 |
+
Generating...`)},m(l,n){te(e,l,n),Q(l,s,n),t=!0},i(l){t||(y(e.$$.fragment,l),t=!0)},o(l){T(e.$$.fragment,l),t=!1},d(l){l&&u(s),ee(e,l)}}}function Cl(o){let e,s,t,l,n,r,i,f,p,$,v,_,g,b,k,I,S,q="Share",R,A,C,x="Download",U,F,K,H,P,j,O,Ce,Z,W,Ee=Pt(o[16])+"",pe,de,Y,D,re,Ne,ce=Pt(o[17])+"",Te,Ie,oe,Le,Ue,Ae,$e,he,xe,wt,be,B,ke,ye,De,Pe=Pt(o[16])+"",qe,it,Et,ct,ut,tt,_t=Pt(o[17])+"",Ct,Ut,me,lt,je,nt,ft,dt,ht,mt,Re,st,Ot,Oe,Me,Bt;k=new yl({props:{size:14,class:"text-gray-600"}}),F=new kl({props:{size:14,class:"text-gray-600"}});const pt=[Jn,Yn],ze=[];function bt(V,ae){return V[15]?0:1}j=bt(o),O=ze[j]=pt[j](o),Ue=new zn({props:{size:20,class:"text-gray-600"}});const qt=[Qn,Xn],gt=[];function Nt(V,ae){return V[15]?0:1}he=Nt(o),xe=gt[he]=qt[he](o),B=new Hn({props:{size:20,class:"text-gray-600"}}),je=new yl({props:{size:14}}),ht=new kl({props:{size:16,class:"text-gray-600"}}),st=new En({props:{size:16,class:"text-gray-600"}});let ve=o[8]&&Al(o);return{c(){e=h("div"),s=h("div"),t=h("div"),l=E(),n=h("div"),r=h("h3"),i=z(o[18]),f=E(),p=h("p"),$=z(o[3]),v=z(" • Created 1 second ago"),_=E(),g=h("div"),b=h("button"),ne(k.$$.fragment),I=E(),S=h("span"),S.textContent=q,R=E(),A=h("button"),C=h("span"),C.textContent=x,U=E(),ne(F.$$.fragment),K=E(),H=h("div"),P=h("button"),O.c(),Ce=E(),Z=h("div"),W=h("span"),pe=z(Ee),de=E(),Y=h("div"),D=h("div"),re=E(),Ne=h("span"),Te=z(ce),Ie=E(),oe=h("div"),Le=h("button"),ne(Ue.$$.fragment),Ae=E(),$e=h("button"),xe.c(),wt=E(),be=h("button"),ne(B.$$.fragment),ke=E(),ye=h("div"),De=h("span"),qe=z(Pe),it=E(),Et=h("div"),ct=h("div"),ut=E(),tt=h("span"),Ct=z(_t),Ut=E(),me=h("div"),lt=h("button"),ne(je.$$.fragment),nt=z(`
|
| 13 |
+
Share`),ft=E(),dt=h("button"),ne(ht.$$.fragment),mt=E(),Re=h("button"),ne(st.$$.fragment),Ot=E(),ve&&ve.c(),this.h()},l(V){e=d(V,"DIV",{class:!0});var ae=m(e);s=d(ae,"DIV",{class:!0});var ge=m(s);t=d(ge,"DIV",{class:!0}),m(t).forEach(u),l=w(ge),n=d(ge,"DIV",{class:!0});var Se=m(n);r=d(Se,"H3",{class:!0});var Ht=m(r);i=M(Ht,o[18]),Ht.forEach(u),f=w(Se),p=d(Se,"P",{class:!0});var Ft=m(p);$=M(Ft,o[3]),v=M(Ft," • Created 1 second ago"),Ft.forEach(u),Se.forEach(u),_=w(ge),g=d(ge,"DIV",{class:!0});var fe=m(g);b=d(fe,"BUTTON",{class:!0});var Mt=m(b);le(k.$$.fragment,Mt),I=w(Mt),S=d(Mt,"SPAN",{class:!0,"data-svelte-h":!0}),Je(S)!=="svelte-hbn8gl"&&(S.textContent=q),Mt.forEach(u),R=w(fe),A=d(fe,"BUTTON",{class:!0});var ot=m(A);C=d(ot,"SPAN",{class:!0,"data-svelte-h":!0}),Je(C)!=="svelte-h01aeg"&&(C.textContent=x),U=w(ot),le(F.$$.fragment,ot),ot.forEach(u),fe.forEach(u),ge.forEach(u),K=w(ae),H=d(ae,"DIV",{class:!0});var zt=m(H);P=d(zt,"BUTTON",{class:!0});var _e=m(P);O.l(_e),_e.forEach(u),Ce=w(zt),Z=d(zt,"DIV",{class:!0});var Ke=m(Z);W=d(Ke,"SPAN",{class:!0});var we=m(W);pe=M(we,Ee),we.forEach(u),de=w(Ke),Y=d(Ke,"DIV",{class:!0});var Ve=m(Y);D=d(Ve,"DIV",{class:!0,style:!0}),m(D).forEach(u),Ve.forEach(u),re=w(Ke),Ne=d(Ke,"SPAN",{class:!0});var Tt=m(Ne);Te=M(Tt,ce),Tt.forEach(u),Ke.forEach(u),zt.forEach(u),Ie=w(ae),oe=d(ae,"DIV",{class:!0});var se=m(oe);Le=d(se,"BUTTON",{class:!0,title:!0});var N=m(Le);le(Ue.$$.fragment,N),N.forEach(u),Ae=w(se),$e=d(se,"BUTTON",{class:!0});var J=m($e);xe.l(J),J.forEach(u),wt=w(se),be=d(se,"BUTTON",{class:!0,title:!0});var ue=m(be);le(B.$$.fragment,ue),ue.forEach(u),ke=w(se),ye=d(se,"DIV",{class:!0});var G=m(ye);De=d(G,"SPAN",{class:!0});var Ye=m(De);qe=M(Ye,Pe),Ye.forEach(u),it=w(G),Et=d(G,"DIV",{class:!0});var Rt=m(Et);ct=d(Rt,"DIV",{class:!0,style:!0}),m(ct).forEach(u),Rt.forEach(u),ut=w(G),tt=d(G,"SPAN",{class:!0});var Wt=m(tt);Ct=M(Wt,_t),Wt.forEach(u),G.forEach(u),Ut=w(se),me=d(se,"DIV",{class:!0});var It=m(me);lt=d(It,"BUTTON",{class:!0});var vt=m(lt);le(je.$$.fragment,vt),nt=M(vt,`
|
| 14 |
+
Share`),vt.forEach(u),ft=w(It),dt=d(It,"BUTTON",{class:!0,title:!0});var Dt=m(dt);le(ht.$$.fragment,Dt),Dt.forEach(u),mt=w(It),Re=d(It,"BUTTON",{class:!0,title:!0});var Lt=m(Re);le(st.$$.fragment,Lt),Lt.forEach(u),It.forEach(u),se.forEach(u),Ot=w(ae),ve&&ve.l(ae),ae.forEach(u),this.h()},h(){c(t,"class","w-2 h-2 bg-green-500 rounded-full"),c(r,"class","font-medium text-gray-900 text-sm"),c(p,"class","text-xs text-gray-500"),c(n,"class","flex-1"),c(S,"class","text-gray-700"),c(b,"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(C,"class","text-gray-700"),c(A,"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(g,"class","flex items-center gap-2"),c(s,"class","flex items-center gap-3 mb-4"),c(P,"class","w-8 h-8 bg-black rounded-full flex items-center justify-center hover:bg-gray-800 transition-colors"),c(W,"class","text-xs text-gray-500 font-mono"),c(D,"class","h-full bg-gradient-to-r from-amber-400 to-orange-500 rounded-full transition-all"),Kt(D,"width",o[16]/o[17]*100+"%"),c(Y,"class","flex-1 h-1 bg-gray-200 rounded-full cursor-pointer"),c(Ne,"class","text-xs text-gray-500 font-mono"),c(Z,"class","flex-1 flex items-center gap-2"),c(H,"class","flex items-center gap-3 mb-4"),c(Le,"class","p-2 hover:bg-gray-100 rounded-full"),c(Le,"title","Skip back"),c($e,"class","w-12 h-12 bg-black rounded-full flex items-center justify-center hover:bg-gray-800 transition-colors"),c(be,"class","p-2 hover:bg-gray-100 rounded-full"),c(be,"title","Skip forward"),c(De,"class","text-xs text-gray-500 font-mono"),c(ct,"class","h-full bg-gradient-to-r from-amber-400 to-orange-500 rounded-full transition-all"),Kt(ct,"width",o[16]/o[17]*100+"%"),c(Et,"class","flex-1 h-1 bg-gray-200 rounded-full"),c(tt,"class","text-xs text-gray-500 font-mono"),c(ye,"class","flex-1 flex items-center gap-3"),c(lt,"class","flex items-center gap-2 px-3 py-1.5 text-sm border border-gray-200 rounded-md hover:bg-gray-50"),c(dt,"class","p-2 hover:bg-gray-100 rounded-md"),c(dt,"title","Download"),c(Re,"class","p-2 hover:bg-gray-100 rounded-md"),c(Re,"title","More options"),c(me,"class","flex items-center gap-2"),c(oe,"class","flex items-center gap-4 mb-4"),c(e,"class","p-4 border border-gray-200 rounded-lg bg-white")},m(V,ae){Q(V,e,ae),a(e,s),a(s,t),a(s,l),a(s,n),a(n,r),a(r,i),a(n,f),a(n,p),a(p,$),a(p,v),a(s,_),a(s,g),a(g,b),te(k,b,null),a(b,I),a(b,S),a(g,R),a(g,A),a(A,C),a(A,U),te(F,A,null),a(e,K),a(e,H),a(H,P),ze[j].m(P,null),a(H,Ce),a(H,Z),a(Z,W),a(W,pe),a(Z,de),a(Z,Y),a(Y,D),a(Z,re),a(Z,Ne),a(Ne,Te),a(e,Ie),a(e,oe),a(oe,Le),te(Ue,Le,null),a(oe,Ae),a(oe,$e),gt[he].m($e,null),a(oe,wt),a(oe,be),te(B,be,null),a(oe,ke),a(oe,ye),a(ye,De),a(De,qe),a(ye,it),a(ye,Et),a(Et,ct),a(ye,ut),a(ye,tt),a(tt,Ct),a(oe,Ut),a(oe,me),a(me,lt),te(je,lt,null),a(lt,nt),a(me,ft),a(me,dt),te(ht,dt,null),a(me,mt),a(me,Re),te(st,Re,null),a(e,Ot),ve&&ve.m(e,null),Oe=!0,Me||(Bt=[X(b,"click",jl),X(A,"click",o[28]),X(P,"click",o[23]),X($e,"click",o[23]),X(lt,"click",jl),X(dt,"click",o[28])],Me=!0)},p(V,ae){(!Oe||ae[0]&262144)&&Be(i,V[18]),(!Oe||ae[0]&8)&&Be($,V[3]);let ge=j;j=bt(V),j!==ge&&(Vt(),T(ze[ge],1,1,()=>{ze[ge]=null}),St(),O=ze[j],O||(O=ze[j]=pt[j](V),O.c()),y(O,1),O.m(P,null)),(!Oe||ae[0]&65536)&&Ee!==(Ee=Pt(V[16])+"")&&Be(pe,Ee),(!Oe||ae[0]&196608)&&Kt(D,"width",V[16]/V[17]*100+"%"),(!Oe||ae[0]&131072)&&ce!==(ce=Pt(V[17])+"")&&Be(Te,ce);let Se=he;he=Nt(V),he!==Se&&(Vt(),T(gt[Se],1,1,()=>{gt[Se]=null}),St(),xe=gt[he],xe||(xe=gt[he]=qt[he](V),xe.c()),y(xe,1),xe.m($e,null)),(!Oe||ae[0]&65536)&&Pe!==(Pe=Pt(V[16])+"")&&Be(qe,Pe),(!Oe||ae[0]&196608)&&Kt(ct,"width",V[16]/V[17]*100+"%"),(!Oe||ae[0]&131072)&&_t!==(_t=Pt(V[17])+"")&&Be(Ct,_t),V[8]?ve?ve.p(V,ae):(ve=Al(V),ve.c(),ve.m(e,null)):ve&&(ve.d(1),ve=null)},i(V){Oe||(y(k.$$.fragment,V),y(F.$$.fragment,V),y(O),y(Ue.$$.fragment,V),y(xe),y(B.$$.fragment,V),y(je.$$.fragment,V),y(ht.$$.fragment,V),y(st.$$.fragment,V),Oe=!0)},o(V){T(k.$$.fragment,V),T(F.$$.fragment,V),T(O),T(Ue.$$.fragment,V),T(xe),T(B.$$.fragment,V),T(je.$$.fragment,V),T(ht.$$.fragment,V),T(st.$$.fragment,V),Oe=!1},d(V){V&&u(e),ee(k),ee(F),ze[j].d(),ee(Ue),gt[he].d(),ee(B),ee(je),ee(ht),ee(st),ve&&ve.d(),Me=!1,Yt(Bt)}}}function Yn(o){let e,s;return e=new dl({props:{size:14,class:"text-white ml-0.5"}}),{c(){ne(e.$$.fragment)},l(t){le(e.$$.fragment,t)},m(t,l){te(e,t,l),s=!0},i(t){s||(y(e.$$.fragment,t),s=!0)},o(t){T(e.$$.fragment,t),s=!1},d(t){ee(e,t)}}}function Jn(o){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){Q(s,e,t)},i:$t,o:$t,d(s){s&&u(e)}}}function Xn(o){let e,s;return e=new dl({props:{size:20,class:"text-white ml-0.5"}}),{c(){ne(e.$$.fragment)},l(t){le(e.$$.fragment,t)},m(t,l){te(e,t,l),s=!0},i(t){s||(y(e.$$.fragment,t),s=!0)},o(t){T(e.$$.fragment,t),s=!1},d(t){ee(e,t)}}}function Qn(o){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){Q(s,e,t)},i:$t,o:$t,d(s){s&&u(e)}}}function Al(o){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(){_l(e.src,s=o[8])||c(e,"src",s),Kt(e,"display","none")},m(n,r){Q(n,e,r),o[38](e),t||(l=[X(e,"loadedmetadata",o[24]),X(e,"timeupdate",o[25]),X(e,"play",o[26]),X(e,"pause",o[27])],t=!0)},p(n,r){r[0]&256&&!_l(e.src,s=n[8])&&c(e,"src",s)},d(n){n&&u(e),o[38](null),t=!1,Yt(l)}}}function Pl(o){let e=o[53].name+"",s,t,l=o[53].badge&&Zn(o);return{c(){s=z(e),l&&l.c(),t=xt()},l(n){s=M(n,e),l&&l.l(n),t=xt()},m(n,r){Q(n,s,r),l&&l.m(n,r),Q(n,t,r)},p(n,r){n[53].badge&&l.p(n,r)},d(n){n&&(u(s),u(t)),l&&l.d(n)}}}function Zn(o){let e,s,t,l=o[53].badge+"",n,r;return{c(){e=z(" "),s=h("span"),t=z("("),n=z(l),r=z(")"),this.h()},l(i){e=M(i," "),s=d(i,"SPAN",{class:!0});var f=m(s);t=M(f,"("),n=M(f,l),r=M(f,")"),f.forEach(u),this.h()},h(){c(s,"class","text-xs text-gray-500")},m(i,f){Q(i,e,f),Q(i,s,f),a(s,t),a(s,n),a(s,r)},p:$t,d(i){i&&(u(e),u(s))}}}function xl(o){let e,s=o[53].name===o[4]&&Pl(o);return{c(){s&&s.c(),e=xt()},l(t){s&&s.l(t),e=xt()},m(t,l){s&&s.m(t,l),Q(t,e,l)},p(t,l){t[53].name===t[4]?s?s.p(t,l):(s=Pl(t),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null)},d(t){t&&u(e),s&&s.d(t)}}}function Ul(o){let e,s=yt(o[20]),t=[];for(let l=0;l<s.length;l+=1)t[l]=Ol(El(o,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 r=0;r<t.length;r+=1)t[r].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){Q(l,e,n);for(let r=0;r<t.length;r+=1)t[r]&&t[r].m(e,null)},p(l,n){if(n[0]&1048656){s=yt(l[20]);let r;for(r=0;r<s.length;r+=1){const i=El(l,s,r);t[r]?t[r].p(i,n):(t[r]=Ol(i),t[r].c(),t[r].m(e,null))}for(;r<t.length;r+=1)t[r].d(1);t.length=s.length}},d(l){l&&u(e),rl(t,l)}}}function es(o){let e,s,t,l=o[53].badge+"",n,r;return{c(){e=z(" "),s=h("span"),t=z("("),n=z(l),r=z(")"),this.h()},l(i){e=M(i," "),s=d(i,"SPAN",{class:!0});var f=m(s);t=M(f,"("),n=M(f,l),r=M(f,")"),f.forEach(u),this.h()},h(){c(s,"class","text-xs text-gray-500")},m(i,f){Q(i,e,f),Q(i,s,f),a(s,t),a(s,n),a(s,r)},p:$t,d(i){i&&(u(e),u(s))}}}function Ol(o){let e,s=o[53].name+"",t,l,n,r,i,f=o[53].badge&&es(o);function p(){return o[40](o[53])}return{c(){e=h("button"),t=z(s),f&&f.c(),l=E(),this.h()},l($){e=d($,"BUTTON",{class:!0});var v=m(e);t=M(v,s),f&&f.l(v),l=w(v),v.forEach(u),this.h()},h(){c(e,"class",n="w-full px-3 py-2 text-left hover:bg-gray-50 transition-colors text-sm "+(o[53].name===o[4]?"bg-gray-100":""))},m($,v){Q($,e,v),a(e,t),f&&f.m(e,null),a(e,l),r||(i=X(e,"click",p),r=!0)},p($,v){o=$,o[53].badge&&f.p(o,v),v[0]&16&&n!==(n="w-full px-3 py-2 text-left hover:bg-gray-50 transition-colors text-sm "+(o[53].name===o[4]?"bg-gray-100":""))&&c(e,"class",n)},d($){$&&u(e),f&&f.d(),r=!1,i()}}}function Ml(o){let e,s,t,l=o[50].name[0]+"",n,r,i,f=o[50].name+"",p,$,v,_=o[50].description+"",g,b,k,I,S;function q(){return o[41](o[50])}return{c(){e=h("button"),s=h("div"),t=h("div"),n=z(l),r=E(),i=h("span"),p=z(f),$=E(),v=h("div"),g=z(_),b=E(),this.h()},l(R){e=d(R,"BUTTON",{class:!0});var A=m(e);s=d(A,"DIV",{class:!0});var C=m(s);t=d(C,"DIV",{class:!0});var x=m(t);n=M(x,l),x.forEach(u),r=w(C),i=d(C,"SPAN",{class:!0});var U=m(i);p=M(U,f),U.forEach(u),C.forEach(u),$=w(A),v=d(A,"DIV",{class:!0});var F=m(v);g=M(F,_),F.forEach(u),b=w(A),A.forEach(u),this.h()},h(){c(t,"class","w-8 h-8 bg-gradient-to-br from-amber-400 to-orange-500 rounded-full flex items-center justify-center text-white text-xs font-medium"),c(i,"class","text-sm font-medium"),c(s,"class","flex items-center gap-2"),c(v,"class","text-xs text-gray-500"),c(e,"class",k="w-full flex items-center justify-between p-2 rounded-md hover:bg-gray-50 transition-colors text-left "+(o[50].name===o[3]?"bg-gray-100":""))},m(R,A){Q(R,e,A),a(e,s),a(s,t),a(t,n),a(s,r),a(s,i),a(i,p),a(e,$),a(e,v),a(v,g),a(e,b),I||(S=X(e,"click",q),I=!0)},p(R,A){o=R,A[0]&8&&k!==(k="w-full flex items-center justify-between p-2 rounded-md hover:bg-gray-50 transition-colors text-left "+(o[50].name===o[3]?"bg-gray-100":""))&&c(e,"class",k)},d(R){R&&u(e),I=!1,S()}}}function zl(o){let e,s;return{c(){e=h("div"),s=z(o[9]),this.h()},l(t){e=d(t,"DIV",{class:!0});var l=m(e);s=M(l,o[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-1p3ull4")},m(t,l){Q(t,e,l),a(e,s)},p(t,l){l[0]&512&&Be(s,t[9])},d(t){t&&u(e)}}}function ts(o){let e,s,t,l,n,r,i,f,p,$,v,_,g,b,k,I,S,q,R,A,C,x,U,F,K,H,P,j,O,Ce,Z;S=new Dn({props:{size:14}}),x=new un({props:{size:14}});let W=o[10]&&Tl();const Ee=[Wn,Fn],pe=[];function de(D,re){return D[1]==="ui"?0:1}H=de(o),P=pe[H]=Ee[H](o);let Y=o[9]&&zl(o);return{c(){e=h("div"),s=h("header"),t=h("div"),l=h("div"),n=h("div"),r=h("button"),i=z("API"),p=E(),$=h("button"),v=z("Local"),g=E(),b=h("div"),k=h("div"),I=h("button"),ne(S.$$.fragment),q=z(`
|
| 15 |
+
UI`),A=E(),C=h("button"),ne(x.$$.fragment),U=z(`
|
| 16 |
+
Code
|
| 17 |
+
`),W&&W.c(),K=E(),P.c(),j=E(),Y&&Y.c(),this.h()},l(D){e=d(D,"DIV",{class:!0});var re=m(e);s=d(re,"HEADER",{class:!0});var Ne=m(s);t=d(Ne,"DIV",{class:!0});var ce=m(t);l=d(ce,"DIV",{class:!0});var Te=m(l);n=d(Te,"DIV",{class:!0});var Ie=m(n);r=d(Ie,"BUTTON",{class:!0});var oe=m(r);i=M(oe,"API"),oe.forEach(u),p=w(Ie),$=d(Ie,"BUTTON",{class:!0});var Le=m($);v=M(Le,"Local"),Le.forEach(u),Ie.forEach(u),Te.forEach(u),g=w(ce),b=d(ce,"DIV",{class:!0});var Ue=m(b);k=d(Ue,"DIV",{class:!0});var Ae=m(k);I=d(Ae,"BUTTON",{class:!0});var $e=m(I);le(S.$$.fragment,$e),q=M($e,`
|
| 18 |
+
UI`),$e.forEach(u),A=w(Ae),C=d(Ae,"BUTTON",{class:!0});var he=m(C);le(x.$$.fragment,he),U=M(he,`
|
| 19 |
+
Code
|
| 20 |
+
`),W&&W.l(he),he.forEach(u),Ae.forEach(u),Ue.forEach(u),ce.forEach(u),Ne.forEach(u),K=w(re),P.l(re),j=w(re),Y&&Y.l(re),re.forEach(u),this.h()},h(){c(r,"class",f="px-3 py-1 text-sm font-medium rounded transition-colors "+(o[5]==="api"?"bg-white shadow-sm":"text-gray-600")),c($,"class",_="px-3 py-1 text-sm font-medium rounded transition-colors "+(o[5]==="local"?"bg-white shadow-sm":"text-gray-600")),c(n,"class","flex items-center bg-gray-100 rounded-md p-0.5"),c(l,"class","flex items-center gap-3"),c(I,"class",R="flex items-center gap-1.5 px-3 py-1 text-sm font-medium rounded transition-colors "+(o[1]==="ui"?"bg-white shadow-sm":"text-gray-600")),c(C,"class",F="flex items-center gap-1.5 px-3 py-1 text-sm font-medium rounded transition-colors relative overflow-hidden "+(o[1]==="code"?"bg-white shadow-sm":"text-gray-600")+" "+(o[10]?"code-flash":"")+" svelte-1p3ull4"),c(k,"class","flex items-center bg-gray-100 rounded-md p-0.5"),c(b,"class","flex items-center gap-2"),c(t,"class","flex items-center justify-between px-4 py-2"),c(s,"class","border-b border-gray-200 bg-white"),c(e,"class","flex flex-col h-full")},m(D,re){Q(D,e,re),a(e,s),a(s,t),a(t,l),a(l,n),a(n,r),a(r,i),a(n,p),a(n,$),a($,v),a(t,g),a(t,b),a(b,k),a(k,I),te(S,I,null),a(I,q),a(k,A),a(k,C),te(x,C,null),a(C,U),W&&W.m(C,null),a(e,K),pe[H].m(e,null),a(e,j),Y&&Y.m(e,null),O=!0,Ce||(Z=[X(r,"click",o[33]),X($,"click",o[34]),X(I,"click",o[35]),X(C,"click",o[36]),X(e,"click",o[29])],Ce=!0)},p(D,re){(!O||re[0]&32&&f!==(f="px-3 py-1 text-sm font-medium rounded transition-colors "+(D[5]==="api"?"bg-white shadow-sm":"text-gray-600")))&&c(r,"class",f),(!O||re[0]&32&&_!==(_="px-3 py-1 text-sm font-medium rounded transition-colors "+(D[5]==="local"?"bg-white shadow-sm":"text-gray-600")))&&c($,"class",_),(!O||re[0]&2&&R!==(R="flex items-center gap-1.5 px-3 py-1 text-sm font-medium rounded transition-colors "+(D[1]==="ui"?"bg-white shadow-sm":"text-gray-600")))&&c(I,"class",R),D[10]?W||(W=Tl(),W.c(),W.m(C,null)):W&&(W.d(1),W=null),(!O||re[0]&1026&&F!==(F="flex items-center gap-1.5 px-3 py-1 text-sm font-medium rounded transition-colors relative overflow-hidden "+(D[1]==="code"?"bg-white shadow-sm":"text-gray-600")+" "+(D[10]?"code-flash":"")+" svelte-1p3ull4"))&&c(C,"class",F);let Ne=H;H=de(D),H===Ne?pe[H].p(D,re):(Vt(),T(pe[Ne],1,1,()=>{pe[Ne]=null}),St(),P=pe[H],P?P.p(D,re):(P=pe[H]=Ee[H](D),P.c()),y(P,1),P.m(e,j)),D[9]?Y?Y.p(D,re):(Y=zl(D),Y.c(),Y.m(e,null)):Y&&(Y.d(1),Y=null)},i(D){O||(y(S.$$.fragment,D),y(x.$$.fragment,D),y(P),O=!0)},o(D){T(S.$$.fragment,D),T(x.$$.fragment,D),T(P),O=!1},d(D){D&&u(e),ee(S),ee(x),W&&W.d(),pe[H].d(),Y&&Y.d(),Ce=!1,Yt(Z)}}}function Ll(o){return o.replace(/\b(import|from|def|class|if|else|elif|try|except|finally|with|as|return|for|while|in|is|not|and|or|None|True|False|print|open)\b/g,'<span class="text-blue-600 font-medium">$1</span>').replace(/("""[\s\S]*?"""|'''[\s\S]*?'''|"[^"]*"|'[^']*')/g,'<span class="text-green-600">$1</span>').replace(/(#[^\n]*)/g,'<span class="text-gray-500 italic">$1</span>').replace(/\b(\d+\.?\d*)\b/g,'<span class="text-purple-600">$1</span>').replace(/(\w+)(\()/g,'<span class="text-amber-600">$1</span>$2')}function ls(){if(console.log("Getting access token..."),typeof window<"u"&&window.gradio&&window.gradio.auth_token)return console.log("Found Gradio auth token:",window.gradio.auth_token.substring(0,10)+"..."),window.gradio.auth_token;const o=document.querySelector('meta[name="hf-oauth-token"]');if(o){const t=o.getAttribute("content");if(t)return console.log("Found token in meta tag:",t.substring(0,10)+"..."),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 console.log(`Found token in localStorage['${t}']:`,l.substring(0,10)+"..."),l}for(const t of e){const l=sessionStorage.getItem(t);if(l)return console.log(`Found token in sessionStorage['${t}']:`,l.substring(0,10)+"..."),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 console.log(`Found potential token in cookie '${l}':`,n?n.substring(0,10)+"...":"empty"),decodeURIComponent(n)}try{const t=document.querySelector("script[data-hf-token]");if(t){const l=t.getAttribute("data-hf-token");if(l)return console.log("Found token in script data attribute:",l.substring(0,10)+"..."),l}}catch{}return console.log("No OAuth token found in any storage location"),console.log("Available localStorage keys:",Object.keys(localStorage)),console.log("Available sessionStorage keys:",Object.keys(sessionStorage)),console.log("Available cookies:",document.cookie),console.log("Available global objects:",{window:typeof window,gradio:typeof(window==null?void 0:window.gradio),hf:typeof(window==null?void 0:window.hf),huggingface:typeof(window==null?void 0:window.huggingface)}),console.log("URL search params:",new URLSearchParams(window.location.search).toString()),console.log("All meta tags:",Array.from(document.getElementsByTagName("meta")).map(t=>{var l;return{name:t.name,content:((l=t.content)==null?void 0:l.substring(0,20))+"..."}})),null}function Pt(o){const e=Math.floor(o/60),s=Math.floor(o%60);return`${e}:${s.toString().padStart(2,"0")}`}function jl(){console.log("Share audio")}function Bl(){const o=getHuggingFaceToken();return`# Install required packages
|
| 21 |
+
# pip install huggingface-hub
|
| 22 |
+
|
| 23 |
+
from huggingface_hub import InferenceClient
|
| 24 |
+
import base64
|
| 25 |
+
import io
|
| 26 |
+
|
| 27 |
+
# Initialize the client
|
| 28 |
+
client = InferenceClient(
|
| 29 |
+
provider="fal-ai",
|
| 30 |
+
api_key="YOUR_HF_TOKEN", # Get your token from https://huggingface.co/settings/tokens
|
| 31 |
+
)`}function ns(){return`# Save the audio to a file
|
| 32 |
+
output_filename = "output_speech.wav"
|
| 33 |
+
|
| 34 |
+
with open(output_filename, "wb") as f:
|
| 35 |
+
f.write(audio_bytes)
|
| 36 |
+
|
| 37 |
+
print(f"✓ Audio saved to {output_filename}")
|
| 38 |
+
|
| 39 |
+
# Optional: Play the audio (requires additional packages)
|
| 40 |
+
# from playsound import playsound
|
| 41 |
+
# playsound(output_filename)`}function ss(o,e,s){let t="In a hole in the ground there lived a hobbit. Not a nasty, dirty, wet hole, filled with the ends of worms and an oozy smell, nor yet a dry, bare, sandy hole with nothing in it to sit down on or to eat: it was a hobbit-hole, and that means comfort.",l="Novia",n="Chatterbox",r="api",i="ui",f=!1,p=!1,$=[],v=null,_=null,g=!1,b=1,k=.5,I=.75,S=0,q=!1,R=0,A=0,C="",x=null;const U=[{id:"chatterbox",name:"Chatterbox",badge:"recommended"},{id:"kokoro",name:"Kokoro",badge:"faster but lower quality"}],F=[{id:"novia",name:"Novia",description:"Warm, conversational voice"},{id:"sarah",name:"Sarah",description:"Clear, professional tone"},{id:"alex",name:"Alex",description:"Friendly, approachable voice"},{id:"emma",name:"Emma",description:"Calm, soothing delivery"}];async function K(){if(t.trim()){s(7,p=!0),s(8,v=null),s(16,R=0),$.length===0&&Ee("Setup and Import",Bl()),Ee("Generate Speech",pe()),i==="ui"&&(s(10,g=!0),setTimeout(()=>{s(10,g=!1)},1e3)),s(15,q=!1),s(18,C=t.length>30?t.substring(0,30)+"...":t);try{const B=ls();console.log("Access token for API call:",B?"Found ("+B.substring(0,10)+"...)":"None");const ke={text:t,voice_id:l.toLowerCase(),model_id:n.toLowerCase(),mode:r,access_token:B,parameters:{speed:b,stability:k,similarity:I,style_exaggeration:S}};console.log("Sending request to /api/tts/generate:",ke);const ye=await fetch("/api/tts/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ke)});if(console.log("API response status:",ye.status),!ye.ok){const Pe=await ye.text();throw console.error("API error response:",Pe),new Error(`HTTP error! status: ${ye.status}, body: ${Pe}`)}const De=await ye.json();if(console.log("API response result:",De),De.success&&De.audio_url)s(8,v=De.audio_url),Ee("Save Audio Output",ns()),i==="ui"&&(s(10,g=!0),setTimeout(()=>{s(10,g=!1)},1e3));else{const Pe=De.error||"Unknown error occurred";alert(`❌ ${Pe}`),s(8,v=null)}}catch(B){console.error("Error generating speech:",B),alert("❌ Network error: Failed to connect to the server"),s(8,v=null)}finally{s(7,p=!1)}}}function H(){x&&(q?x.pause():x.play())}function P(){x&&(s(17,A=x.duration),x.play())}function j(){x&&s(16,R=x.currentTime)}function O(){s(15,q=!0)}function Ce(){s(15,q=!1)}function Z(){if(v){const B=document.createElement("a");B.href=v,B.download="speech.wav",B.click()}}function W(B){B.target.closest(".model-dropdown")||s(6,f=!1)}function Ee(B,ke,ye=null){const De={id:Date.now()+Math.random(),title:B,code:ke,output:ye,timestamp:new Date().toLocaleTimeString()};return s(2,$=[...$,De]),De}function pe(){return t.length>100&&t.substring(0,100)+"",`# Text to convert to speech
|
| 42 |
+
text = """${t}"""
|
| 43 |
+
|
| 44 |
+
# Voice and model settings
|
| 45 |
+
model = "ResembleAI/chatterbox"
|
| 46 |
+
voice = "${l.toLowerCase()}"
|
| 47 |
+
speed = ${b}
|
| 48 |
+
stability = ${k}
|
| 49 |
+
similarity = ${I}
|
| 50 |
+
style_exaggeration = ${S}
|
| 51 |
+
|
| 52 |
+
# Generate speech
|
| 53 |
+
print("Generating speech...")
|
| 54 |
+
try:
|
| 55 |
+
audio_bytes = client.text_to_speech(
|
| 56 |
+
text,
|
| 57 |
+
model=model,
|
| 58 |
+
# Note: Voice and other parameters may vary by model
|
| 59 |
+
)
|
| 60 |
+
print(f"✓ Generated {len(audio_bytes)} bytes of audio")
|
| 61 |
+
except Exception as e:
|
| 62 |
+
print(f"Error: {e}")`}function de(B,ke="Copied to clipboard!"){navigator.clipboard.writeText(B).then(()=>{s(9,_=ke),setTimeout(()=>{s(9,_=null)},2e3)})}function Y(){const B=$.map(ke=>`# ${ke.title}
|
| 63 |
+
${ke.code}`).join(`
|
| 64 |
+
|
| 65 |
+
`);de(B,"All code copied!")}let D=t;const re=()=>s(5,r="api"),Ne=()=>s(5,r="local"),ce=()=>s(1,i="ui"),Te=()=>s(1,i="code");function Ie(){t=this.value,s(0,t)}function oe(B){Gl[B?"unshift":"push"](()=>{x=B,s(19,x)})}const Le=()=>s(6,f=!f),Ue=B=>{s(4,n=B.name),s(6,f=!1)},Ae=B=>s(3,l=B.name);function $e(){b=ol(this.value),s(11,b)}function he(){k=ol(this.value),s(12,k)}function xe(){I=ol(this.value),s(13,I)}function wt(){S=ol(this.value),s(14,S)}const be=B=>de(B.code);return o.$$.update=()=>{o.$$.dirty[0]&2&&i==="ui"&&s(2,$=[]),o.$$.dirty[0]&6&&$.length===0&&i==="code"&&Ee("Setup and Import",Bl()),o.$$.dirty[0]&5|o.$$.dirty[1]&2&&t!==D&&$.length>0&&s(32,D=t)},[t,i,$,l,n,r,f,p,v,_,g,b,k,I,S,q,R,A,C,x,U,F,K,H,P,j,O,Ce,Z,W,de,Y,D,re,Ne,ce,Te,Ie,oe,Le,Ue,Ae,$e,he,xe,wt,be]}class as extends Fe{constructor(e){super(),We(this,e,ss,ts,He,{},null,[-1,-1])}}export{as as component};
|
hfstudio/static/_app/immutable/nodes/3.pthhtWhZ.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{S as V,i as j,s as q,n as A,d,b as y,c as h,m as N,o as f,p as O,h as E,e as p,f as b,q as H,k as P,j as _,l as z,r as M,a as S,u as R,g as I,t as C}from"../chunks/B1LPgyXz.js";import"../chunks/IHki7fMi.js";import{g as F}from"../chunks/Bdt-LMmF.js";import{p as B}from"../chunks/B0cuSUdZ.js";function G(m){let s,t,l,e,r;return{c(){s=_("div"),t=_("div"),l=P(),e=_("p"),r=C(m[0]),this.h()},l(u){s=p(u,"DIV",{class:!0});var o=b(s);t=p(o,"DIV",{class:!0}),b(t).forEach(d),l=E(o),e=p(o,"P",{});var n=b(e);r=I(n,m[0]),n.forEach(d),o.forEach(d),this.h()},h(){f(t,"class","animate-spin w-8 h-8 border-2 border-amber-400 border-t-transparent rounded-full mx-auto mb-2"),f(s,"class","text-gray-600 mb-4")},m(u,o){y(u,s,o),h(s,t),h(s,l),h(s,e),h(e,r)},p(u,o){o&1&&S(r,u[0])},d(u){u&&d(s)}}}function J(m){let s,t,l,e,r,u,o,n,k="Return to HFStudio",g,x;return{c(){s=_("div"),t=_("p"),l=C(m[0]),e=P(),r=_("p"),u=C(m[1]),o=P(),n=_("button"),n.textContent=k,this.h()},l(c){s=p(c,"DIV",{class:!0});var a=b(s);t=p(a,"P",{class:!0});var i=b(t);l=I(i,m[0]),i.forEach(d),e=E(a),r=p(a,"P",{class:!0});var v=b(r);u=I(v,m[1]),v.forEach(d),a.forEach(d),o=E(c),n=p(c,"BUTTON",{class:!0,"data-svelte-h":!0}),H(n)!=="svelte-lo2i5l"&&(n.textContent=k),this.h()},h(){f(t,"class","font-medium"),f(r,"class","text-sm mt-1"),f(s,"class","text-red-600 mb-4"),f(n,"class","px-4 py-2 bg-gradient-to-r from-amber-400 to-orange-500 text-white rounded-lg hover:from-amber-500 hover:to-orange-600 transition-colors")},m(c,a){y(c,s,a),h(s,t),h(t,l),h(s,e),h(s,r),h(r,u),y(c,o,a),y(c,n,a),g||(x=R(n,"click",m[2]),g=!0)},p(c,a){a&1&&S(l,c[0]),a&2&&S(u,c[1])},d(c){c&&(d(s),d(o),d(n)),g=!1,x()}}}function L(m){let s,t,l,e,r,u,o,n,k="HFStudio Authentication",g;function x(i,v){return i[1]?J:G}let c=x(m),a=c(m);return{c(){s=P(),t=_("div"),l=_("div"),e=_("div"),r=_("img"),o=P(),n=_("h1"),n.textContent=k,g=P(),a.c(),this.h()},l(i){O("svelte-17lku3q",document.head).forEach(d),s=E(i),t=p(i,"DIV",{class:!0});var D=b(t);l=p(D,"DIV",{class:!0});var T=b(l);e=p(T,"DIV",{class:!0});var w=b(e);r=p(w,"IMG",{src:!0,alt:!0,class:!0}),o=E(w),n=p(w,"H1",{class:!0,"data-svelte-h":!0}),H(n)!=="svelte-l7zisw"&&(n.textContent=k),g=E(w),a.l(w),w.forEach(d),T.forEach(d),D.forEach(d),this.h()},h(){document.title="Authenticating with Hugging Face - HFStudio",N(r.src,u="/assets/hf-logo.png")||f(r,"src",u),f(r,"alt","HF Logo"),f(r,"class","w-12 h-12 mx-auto mb-4"),f(n,"class","text-xl font-semibold mb-2"),f(e,"class","text-center"),f(l,"class","max-w-md w-full bg-white rounded-lg shadow-md p-6"),f(t,"class","min-h-screen flex items-center justify-center bg-gray-50")},m(i,v){y(i,s,v),y(i,t,v),h(t,l),h(l,e),h(e,r),h(e,o),h(e,n),h(e,g),a.m(e,null)},p(i,[v]){c===(c=x(i))&&a?a.p(i,v):(a.d(1),a=c(i),a&&(a.c(),a.m(e,null)))},i:A,o:A,d(i){i&&(d(s),d(t)),a.d()}}}function U(m,s,t){let l;z(m,B,o=>t(3,l=o));let e="Processing...",r=null;return M(async()=>{try{const o=l.url.searchParams.get("code"),n=l.url.searchParams.get("state"),k=l.url.searchParams.get("error"),g=l.url.searchParams.get("error_description");if(k){t(1,r=g||k),t(0,e="Authentication failed");return}if(!o){t(1,r="No authorization code received"),t(0,e="Authentication failed");return}const x=sessionStorage.getItem("oauth_state");if(x&&n!==x){t(1,r="Invalid state parameter"),t(0,e="Authentication failed");return}const c=await fetch("/api/auth/token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:o})});if(!c.ok){const i=await c.text();throw console.error("Token exchange failed:",i),new Error(`Failed to exchange code for token: ${i}`)}const a=await c.json();localStorage.setItem("hf_access_token",a.access_token),t(0,e="Successfully authenticated!"),setTimeout(()=>{F("/")},2e3)}catch(o){t(1,r=o.message),t(0,e="Authentication failed")}}),[e,r,()=>F("/")]}class Y extends V{constructor(s){super(),j(this,s,U,L,q,{})}}export{Y as component};
|
hfstudio/static/_app/version.json
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":"
|
|
|
|
| 1 |
+
{"version":"1760678446039"}
|
hfstudio/static/index.html
CHANGED
|
@@ -6,25 +6,25 @@
|
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
| 7 |
<title>HFStudio - Text to Speech</title>
|
| 8 |
|
| 9 |
-
<link rel="modulepreload" href="/_app/immutable/entry/start.
|
| 10 |
-
<link rel="modulepreload" href="/_app/immutable/chunks/
|
| 11 |
-
<link rel="modulepreload" href="/_app/immutable/chunks/
|
| 12 |
-
<link rel="modulepreload" href="/_app/immutable/entry/app.
|
| 13 |
<link rel="modulepreload" href="/_app/immutable/chunks/IHki7fMi.js">
|
| 14 |
</head>
|
| 15 |
<body data-sveltekit-preload-data="hover">
|
| 16 |
<div style="display: contents">
|
| 17 |
<script>
|
| 18 |
{
|
| 19 |
-
|
| 20 |
base: ""
|
| 21 |
};
|
| 22 |
|
| 23 |
const element = document.currentScript.parentElement;
|
| 24 |
|
| 25 |
Promise.all([
|
| 26 |
-
import("/_app/immutable/entry/start.
|
| 27 |
-
import("/_app/immutable/entry/app.
|
| 28 |
]).then(([kit, app]) => {
|
| 29 |
kit.start(app, element);
|
| 30 |
});
|
|
|
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
| 7 |
<title>HFStudio - Text to Speech</title>
|
| 8 |
|
| 9 |
+
<link rel="modulepreload" href="/_app/immutable/entry/start.C61NpXpG.js">
|
| 10 |
+
<link rel="modulepreload" href="/_app/immutable/chunks/Bdt-LMmF.js">
|
| 11 |
+
<link rel="modulepreload" href="/_app/immutable/chunks/B1LPgyXz.js">
|
| 12 |
+
<link rel="modulepreload" href="/_app/immutable/entry/app.By6Ln18A.js">
|
| 13 |
<link rel="modulepreload" href="/_app/immutable/chunks/IHki7fMi.js">
|
| 14 |
</head>
|
| 15 |
<body data-sveltekit-preload-data="hover">
|
| 16 |
<div style="display: contents">
|
| 17 |
<script>
|
| 18 |
{
|
| 19 |
+
__sveltekit_r15ieo = {
|
| 20 |
base: ""
|
| 21 |
};
|
| 22 |
|
| 23 |
const element = document.currentScript.parentElement;
|
| 24 |
|
| 25 |
Promise.all([
|
| 26 |
+
import("/_app/immutable/entry/start.C61NpXpG.js"),
|
| 27 |
+
import("/_app/immutable/entry/app.By6Ln18A.js")
|
| 28 |
]).then(([kit, app]) => {
|
| 29 |
kit.start(app, element);
|
| 30 |
});
|