GitHub Action commited on
Commit
0393294
Β·
1 Parent(s): 2f6cbf2

Sync from GitHub: d5df11ad9619ec2c606695b150bd463472a48fb5

Browse files
.gitattributes CHANGED
@@ -7,3 +7,9 @@
7
  *.mp4 filter=lfs diff=lfs merge=lfs -text
8
  *.webm filter=lfs diff=lfs merge=lfs -text
9
  *.pdf filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
7
  *.mp4 filter=lfs diff=lfs merge=lfs -text
8
  *.webm filter=lfs diff=lfs merge=lfs -text
9
  *.pdf filter=lfs diff=lfs merge=lfs -text
10
+ hfstudio/static/assets/hf-logo.png filter=lfs diff=lfs merge=lfs -text
11
+ hfstudio/static/assets/hf-studio-logo.png filter=lfs diff=lfs merge=lfs -text
12
+ frontend/static/assets/hf-logo.png filter=lfs diff=lfs merge=lfs -text
13
+ frontend/static/assets/hf-studio-logo.png filter=lfs diff=lfs merge=lfs -text
14
+ hfstudio/static/samples/harvard.wav filter=lfs diff=lfs merge=lfs -text
15
+ frontend/static/samples/harvard.wav filter=lfs diff=lfs merge=lfs -text
frontend/package-lock.json CHANGED
@@ -9,7 +9,8 @@
9
  "version": "0.1.2",
10
  "dependencies": {
11
  "@sveltejs/adapter-static": "^3.0.10",
12
- "lucide-svelte": "^0.303.0"
 
13
  },
14
  "devDependencies": {
15
  "@sveltejs/adapter-auto": "^3.0.0",
@@ -2111,6 +2112,15 @@
2111
  "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
2112
  }
2113
  },
 
 
 
 
 
 
 
 
 
2114
  "node_modules/queue-microtask": {
2115
  "version": "1.2.3",
2116
  "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
 
9
  "version": "0.1.2",
10
  "dependencies": {
11
  "@sveltejs/adapter-static": "^3.0.10",
12
+ "lucide-svelte": "^0.303.0",
13
+ "prismjs": "^1.30.0"
14
  },
15
  "devDependencies": {
16
  "@sveltejs/adapter-auto": "^3.0.0",
 
2112
  "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
2113
  }
2114
  },
2115
+ "node_modules/prismjs": {
2116
+ "version": "1.30.0",
2117
+ "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.30.0.tgz",
2118
+ "integrity": "sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw==",
2119
+ "license": "MIT",
2120
+ "engines": {
2121
+ "node": ">=6"
2122
+ }
2123
+ },
2124
  "node_modules/queue-microtask": {
2125
  "version": "1.2.3",
2126
  "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
frontend/package.json CHANGED
@@ -20,6 +20,7 @@
20
  "type": "module",
21
  "dependencies": {
22
  "@sveltejs/adapter-static": "^3.0.10",
23
- "lucide-svelte": "^0.303.0"
 
24
  }
25
  }
 
20
  "type": "module",
21
  "dependencies": {
22
  "@sveltejs/adapter-static": "^3.0.10",
23
+ "lucide-svelte": "^0.303.0",
24
+ "prismjs": "^1.30.0"
25
  }
26
  }
frontend/src/app.css CHANGED
@@ -1,6 +1,91 @@
1
  @tailwind base;
2
  @tailwind components;
3
  @tailwind utilities;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  .slider-hf::-webkit-slider-thumb {
5
  @apply appearance-none w-4 h-4 rounded-full cursor-pointer;
6
  background: linear-gradient(45deg, #FFD21E, #FF9D00);
 
1
  @tailwind base;
2
  @tailwind components;
3
  @tailwind utilities;
4
+
5
+ /* Prism.js Theme - Light with good contrast */
6
+ code[class*="language-"],
7
+ pre[class*="language-"] {
8
+ color: #393A34;
9
+ font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace;
10
+ direction: ltr;
11
+ text-align: left;
12
+ white-space: pre;
13
+ word-spacing: normal;
14
+ word-break: normal;
15
+ font-size: 0.875rem;
16
+ line-height: 1.5;
17
+ tab-size: 4;
18
+ hyphens: none;
19
+ }
20
+
21
+ pre[class*="language-"] {
22
+ padding: 1rem;
23
+ margin: 0;
24
+ overflow: auto;
25
+ background: #f8f9fa;
26
+ }
27
+
28
+ /* Tokens */
29
+ .token.comment,
30
+ .token.prolog,
31
+ .token.doctype,
32
+ .token.cdata {
33
+ color: #008000;
34
+ font-style: italic;
35
+ }
36
+
37
+ .token.punctuation {
38
+ color: #393A34;
39
+ }
40
+
41
+ .token.property,
42
+ .token.tag,
43
+ .token.boolean,
44
+ .token.number,
45
+ .token.constant,
46
+ .token.symbol,
47
+ .token.deleted {
48
+ color: #e91e63;
49
+ }
50
+
51
+ .token.selector,
52
+ .token.attr-name,
53
+ .token.string,
54
+ .token.char,
55
+ .token.builtin,
56
+ .token.inserted {
57
+ color: #067d17;
58
+ }
59
+
60
+ .token.operator,
61
+ .token.entity,
62
+ .token.url,
63
+ .language-css .token.string,
64
+ .style .token.string {
65
+ color: #795da3;
66
+ }
67
+
68
+ .token.atrule,
69
+ .token.attr-value,
70
+ .token.keyword {
71
+ color: #0000ff;
72
+ }
73
+
74
+ .token.function,
75
+ .token.class-name {
76
+ color: #795da3;
77
+ }
78
+
79
+ .token.regex,
80
+ .token.important,
81
+ .token.variable {
82
+ color: #e90;
83
+ }
84
+
85
+ /* Bash specific */
86
+ .language-bash .token.function {
87
+ color: #067d17;
88
+ }
89
  .slider-hf::-webkit-slider-thumb {
90
  @apply appearance-none w-4 h-4 rounded-full cursor-pointer;
91
  background: linear-gradient(45deg, #FFD21E, #FF9D00);
frontend/src/routes/+layout.svelte CHANGED
@@ -5,13 +5,37 @@
5
 
6
  let currentPage = 'tts';
7
  let sidebarOpen = true;
 
 
 
 
 
 
8
  let isLoggedIn = false;
9
  let username = '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  let showTokenInput = false;
11
  let tokenInput = '';
12
  let tokenError = '';
13
  let isLocalEnvironment = false;
14
- let isCheckingAuth = true;
15
  let showSignInPopover = false;
16
 
17
  onMount(() => {
@@ -22,8 +46,14 @@
22
  }, 4000);
23
  });
24
 
25
- checkLocalTokenAvailability();
26
- checkLoginStatus();
 
 
 
 
 
 
27
 
28
  document.addEventListener('visibilitychange', () => {
29
  if (!document.hidden) {
@@ -42,6 +72,13 @@
42
  });
43
 
44
  async function checkLocalTokenAvailability() {
 
 
 
 
 
 
 
45
  try {
46
  const response = await fetch('/api/auth/local-token');
47
  const data = await response.json();
@@ -69,15 +106,37 @@
69
 
70
  function checkLoginStatus() {
71
  const token = localStorage.getItem('hf_access_token');
72
- if (token && !isLoggedIn) {
73
- fetchUserInfo(token);
74
- } else if (!token) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  isLoggedIn = false;
76
  username = '';
 
 
77
  }
78
  }
79
 
80
  async function fetchUserInfo(token) {
 
 
81
  try {
82
  const response = await fetch('https://huggingface.co/api/whoami-v2', {
83
  headers: {
@@ -90,21 +149,48 @@
90
  isLoggedIn = true;
91
  const fullName = userData.name || userData.fullname || userData.login || userData.username || 'User';
92
  username = fullName.split(' ')[0];
 
 
 
 
 
93
  } else {
 
94
  localStorage.removeItem('hf_access_token');
 
 
95
  isLoggedIn = false;
96
  username = '';
97
  }
98
  } catch (error) {
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  localStorage.removeItem('hf_access_token');
 
 
100
  isLoggedIn = false;
101
  username = '';
 
 
102
  }
103
  }
104
 
105
  async function handleAuthAction() {
106
  if (isLoggedIn) {
107
  localStorage.removeItem('hf_access_token');
 
 
108
  sessionStorage.removeItem('oauth_state');
109
  isLoggedIn = false;
110
  username = '';
@@ -155,10 +241,17 @@
155
 
156
  if (response.ok) {
157
  const userData = await response.json();
158
- localStorage.setItem('hf_access_token', tokenInput.trim());
 
159
  isLoggedIn = true;
160
  const fullName = userData.name || userData.fullname || userData.login || userData.username || 'User';
161
  username = fullName.split(' ')[0];
 
 
 
 
 
 
162
  closeTokenInput();
163
  } else {
164
  tokenError = `Invalid token (${response.status}). Please check your token and try again.`;
@@ -246,7 +339,7 @@
246
  {#if isCheckingAuth}
247
  <span>Checking... ({isLoggedIn ? 'logged in' : 'not logged in'})</span>
248
  {:else if isLoggedIn}
249
- <span>Sign Out, {username}</span>
250
  {:else}
251
  <span>Sign In</span>
252
  {/if}
 
5
 
6
  let currentPage = 'tts';
7
  let sidebarOpen = true;
8
+
9
+ // Initialize from cache immediately to avoid "Checking..." flash
10
+ const initToken = typeof window !== 'undefined' ? localStorage.getItem('hf_access_token') : null;
11
+ const initCachedToken = typeof window !== 'undefined' ? localStorage.getItem('hf_cached_token') : null;
12
+ const initCachedUserInfo = typeof window !== 'undefined' ? localStorage.getItem('hf_user_info') : null;
13
+
14
  let isLoggedIn = false;
15
  let username = '';
16
+ let isCheckingAuth = false; // Start as false by default
17
+
18
+ // Check if we have valid cached data
19
+ let hasCachedData = false;
20
+ if (initToken && initToken === initCachedToken && initCachedUserInfo) {
21
+ try {
22
+ const userInfo = JSON.parse(initCachedUserInfo);
23
+ isLoggedIn = true;
24
+ username = userInfo.username;
25
+ hasCachedData = true;
26
+ } catch (e) {
27
+ // Invalid cache, will need to check
28
+ isCheckingAuth = true;
29
+ }
30
+ } else if (initToken) {
31
+ // We have a token but no valid cache, need to check
32
+ isCheckingAuth = true;
33
+ }
34
+
35
  let showTokenInput = false;
36
  let tokenInput = '';
37
  let tokenError = '';
38
  let isLocalEnvironment = false;
 
39
  let showSignInPopover = false;
40
 
41
  onMount(() => {
 
46
  }, 4000);
47
  });
48
 
49
+ // Only check if we don't already have valid cached info or need to verify
50
+ if (!hasCachedData && initToken) {
51
+ checkLocalTokenAvailability();
52
+ checkLoginStatus();
53
+ } else if (!initToken) {
54
+ // No token at all, check for local availability
55
+ checkLocalTokenAvailability();
56
+ }
57
 
58
  document.addEventListener('visibilitychange', () => {
59
  if (!document.hidden) {
 
72
  });
73
 
74
  async function checkLocalTokenAvailability() {
75
+ // Skip if we already have valid cached info
76
+ if (isLoggedIn && hasCachedData) {
77
+ return;
78
+ }
79
+
80
+ isCheckingAuth = true;
81
+
82
  try {
83
  const response = await fetch('/api/auth/local-token');
84
  const data = await response.json();
 
106
 
107
  function checkLoginStatus() {
108
  const token = localStorage.getItem('hf_access_token');
109
+ const cachedUserInfo = localStorage.getItem('hf_user_info');
110
+ const cachedToken = localStorage.getItem('hf_cached_token');
111
+
112
+ if (token) {
113
+ // If token hasn't changed and we have cached info, use it
114
+ if (token === cachedToken && cachedUserInfo) {
115
+ try {
116
+ const userInfo = JSON.parse(cachedUserInfo);
117
+ isLoggedIn = true;
118
+ username = userInfo.username;
119
+ return;
120
+ } catch (e) {
121
+ // Invalid cache, will re-fetch
122
+ }
123
+ }
124
+ // Token is new or changed, fetch user info
125
+ if (!isLoggedIn || token !== cachedToken) {
126
+ fetchUserInfo(token);
127
+ }
128
+ } else {
129
+ // No token, clear everything
130
  isLoggedIn = false;
131
  username = '';
132
+ localStorage.removeItem('hf_user_info');
133
+ localStorage.removeItem('hf_cached_token');
134
  }
135
  }
136
 
137
  async function fetchUserInfo(token) {
138
+ isCheckingAuth = true;
139
+
140
  try {
141
  const response = await fetch('https://huggingface.co/api/whoami-v2', {
142
  headers: {
 
149
  isLoggedIn = true;
150
  const fullName = userData.name || userData.fullname || userData.login || userData.username || 'User';
151
  username = fullName.split(' ')[0];
152
+
153
+ // Cache the user info and token
154
+ const userInfo = { username, fullName };
155
+ localStorage.setItem('hf_user_info', JSON.stringify(userInfo));
156
+ localStorage.setItem('hf_cached_token', token);
157
  } else {
158
+ // Clear everything on auth failure
159
  localStorage.removeItem('hf_access_token');
160
+ localStorage.removeItem('hf_user_info');
161
+ localStorage.removeItem('hf_cached_token');
162
  isLoggedIn = false;
163
  username = '';
164
  }
165
  } catch (error) {
166
+ // On network error, if we have cached info, use it
167
+ const cachedUserInfo = localStorage.getItem('hf_user_info');
168
+ if (cachedUserInfo) {
169
+ try {
170
+ const userInfo = JSON.parse(cachedUserInfo);
171
+ isLoggedIn = true;
172
+ username = userInfo.username;
173
+ return;
174
+ } catch (e) {
175
+ // Invalid cache
176
+ }
177
+ }
178
+ // Otherwise clear everything
179
  localStorage.removeItem('hf_access_token');
180
+ localStorage.removeItem('hf_user_info');
181
+ localStorage.removeItem('hf_cached_token');
182
  isLoggedIn = false;
183
  username = '';
184
+ } finally {
185
+ isCheckingAuth = false;
186
  }
187
  }
188
 
189
  async function handleAuthAction() {
190
  if (isLoggedIn) {
191
  localStorage.removeItem('hf_access_token');
192
+ localStorage.removeItem('hf_user_info');
193
+ localStorage.removeItem('hf_cached_token');
194
  sessionStorage.removeItem('oauth_state');
195
  isLoggedIn = false;
196
  username = '';
 
241
 
242
  if (response.ok) {
243
  const userData = await response.json();
244
+ const token = tokenInput.trim();
245
+ localStorage.setItem('hf_access_token', token);
246
  isLoggedIn = true;
247
  const fullName = userData.name || userData.fullname || userData.login || userData.username || 'User';
248
  username = fullName.split(' ')[0];
249
+
250
+ // Cache the user info and token
251
+ const userInfo = { username, fullName };
252
+ localStorage.setItem('hf_user_info', JSON.stringify(userInfo));
253
+ localStorage.setItem('hf_cached_token', token);
254
+
255
  closeTokenInput();
256
  } else {
257
  tokenError = `Invalid token (${response.status}). Please check your token and try again.`;
 
339
  {#if isCheckingAuth}
340
  <span>Checking... ({isLoggedIn ? 'logged in' : 'not logged in'})</span>
341
  {:else if isLoggedIn}
342
+ <span>Sign out ({username})</span>
343
  {:else}
344
  <span>Sign In</span>
345
  {/if}
frontend/src/routes/+page.svelte CHANGED
@@ -1,5 +1,9 @@
1
  <script>
2
- import { Play, Download, Loader2, AlertCircle, ChevronDown, Copy, RefreshCw, Share, MoreHorizontal, Settings, Sliders, Pause, SkipBack, SkipForward, Layout, Code, X } from 'lucide-svelte';
 
 
 
 
3
 
4
  let text = `In a hole in the ground there lived a hobbit.`;
5
  let selectedVoice = 'Lily';
@@ -8,7 +12,9 @@
8
  let viewMode = 'ui';
9
  let modelDropdownOpen = false;
10
  let isGenerating = false;
11
- let codeCells = [];
 
 
12
  let audioUrl = null;
13
  let copyNotification = null;
14
  let codeButtonFlash = false;
@@ -25,6 +31,7 @@
25
  let showErrorModal = false;
26
  let errorMessage = '';
27
  let errorDetails = '';
 
28
 
29
  const models = [
30
  { id: 'chatterbox', name: 'Chatterbox', badge: 'recommended' },
@@ -51,10 +58,15 @@
51
  audioUrl = null;
52
  currentTime = 0;
53
 
54
- if (codeCells.length === 0) {
55
- addCodeCell('Setup and Import', generateSetupCode());
 
56
  }
57
- addCodeCell('Generate Speech', generateTTSCode());
 
 
 
 
58
 
59
  if (viewMode === 'ui') {
60
  codeButtonFlash = true;
@@ -98,7 +110,14 @@
98
 
99
  if (result.success && result.audio_url) {
100
  audioUrl = result.audio_url;
101
- addCodeCell('Save Audio Output', generateSaveCode());
 
 
 
 
 
 
 
102
 
103
  if (viewMode === 'ui') {
104
  codeButtonFlash = true;
@@ -269,29 +288,70 @@
269
  }
270
  }
271
 
272
- function addCodeCell(title, code, output = null) {
273
- const cell = {
274
  id: Date.now() + Math.random(),
275
- title,
276
  code,
277
- output,
278
- timestamp: new Date().toLocaleTimeString()
 
 
 
 
 
 
 
 
 
 
 
 
 
279
  };
280
- codeCells = [...codeCells, cell];
281
- return cell;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
282
  }
283
 
284
  function generateSetupCode() {
285
  if (mode === 'local') {
286
- return `# Install required packages
287
- # pip install hfstudio huggingface-hub
288
-
289
- # Start the model server locally
290
- # Run this command in your terminal:
291
- # hfstudio start chatterbox --port 7861
292
-
293
- # Then use the following Python code:
294
- from huggingface_hub import InferenceClient
 
 
295
 
296
  # Initialize the client for local server
297
  client = InferenceClient(base_url="http://localhost:7861/v1/")`;
@@ -310,82 +370,37 @@ client = InferenceClient(
310
  }
311
 
312
  function generateTTSCode() {
 
 
 
 
 
 
 
313
  if (mode === 'local') {
314
- return `# Text to convert to speech
315
  text = """${text}"""
316
 
317
- # Voice and model settings
318
- voice = "${selectedVoice.toLowerCase()}"
319
- exaggeration = ${exaggeration}
320
- temperature = ${temperature}
321
-
322
- # Voice reference URLs (update these to your local paths if needed)
323
- voice_urls = {
324
- "lily": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/lily.mp3",
325
- "andrew": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/andrew.mp3",
326
- "fairy": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/fairy.mp3",
327
- "pirate": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/pirate.mp3"
328
- }
329
-
330
- # Build extra_body with parameters
331
- extra_body = {
332
- "exaggeration": exaggeration,
333
- "temperature": temperature
334
- }
335
-
336
- # Add audio_url for voice reference
337
- if voice in voice_urls:
338
- extra_body["audio_url"] = voice_urls[voice]
339
-
340
- # Generate speech using InferenceClient
341
- print("Generating speech...")
342
- try:
343
- audio_bytes = client.text_to_speech(
344
- text,
345
- extra_body=extra_body if extra_body else None,
346
- )
347
- print(f"βœ“ Generated {len(audio_bytes)} bytes of audio")
348
- except Exception as e:
349
- print(f"Error: {e}")`;
350
  } else {
351
- return `# Text to convert to speech
352
  text = """${text}"""
353
 
354
- # Voice and model settings
355
- model = "ResembleAI/chatterbox"
356
- voice = "${selectedVoice.toLowerCase()}"
357
- exaggeration = ${exaggeration}
358
- temperature = ${temperature}
359
-
360
- # Voice reference URLs
361
- voice_urls = {
362
- "lily": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/lily.mp3",
363
- "andrew": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/andrew.mp3",
364
- "fairy": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/fairy.mp3",
365
- "pirate": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/pirate.mp3"
366
- }
367
-
368
- # Build extra_body with parameters
369
- extra_body = {
370
- "exaggeration": exaggeration,
371
- "temperature": temperature
372
- }
373
-
374
- # Add audio_url for voice reference
375
- if voice in voice_urls:
376
- extra_body["audio_url"] = voice_urls[voice]
377
-
378
- # Generate speech using InferenceClient
379
- print("Generating speech...")
380
- try:
381
- audio_bytes = client.text_to_speech(
382
- text,
383
- model=model,
384
- extra_body=extra_body if extra_body else None,
385
- )
386
- print(f"βœ“ Generated {len(audio_bytes)} bytes of audio")
387
- except Exception as e:
388
- print(f"Error: {e}")`;
389
  }
390
  }
391
 
@@ -430,39 +445,102 @@ print(f"βœ“ Audio saved to {output_filename}")
430
  }
431
 
432
  function copyAllCode() {
433
- const allCode = codeCells.map(cell => `# ${cell.title}\n${cell.code}`).join('\n\n');
 
 
 
 
 
 
434
  copyToClipboard(allCode, 'All code copied!');
435
  }
436
 
437
- $: if (codeCells.length === 0 && viewMode === 'code') {
438
- addCodeCell('Setup and Import', generateSetupCode());
439
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
440
 
441
- let previousText = text;
442
- $: if (text !== previousText && codeCells.length > 0) {
443
- previousText = text;
 
 
 
 
 
 
 
 
 
 
 
 
 
444
  }
445
 
446
- $: if (viewMode === 'ui') {
447
- codeCells = [];
 
 
448
  }
449
 
450
- // Update existing code cells when mode changes
451
- let previousMode = mode;
452
- $: if (mode !== previousMode && codeCells.length > 0) {
453
- previousMode = mode;
454
- // Update setup code cell if it exists
455
- const setupCellIndex = codeCells.findIndex(cell => cell.title === 'Setup and Import');
456
- if (setupCellIndex !== -1) {
457
- codeCells[setupCellIndex].code = generateSetupCode();
 
458
  }
459
- // Update TTS code cell if it exists
460
- const ttsCellIndex = codeCells.findIndex(cell => cell.title === 'Generate Speech');
461
- if (ttsCellIndex !== -1) {
462
- codeCells[ttsCellIndex].code = generateTTSCode();
 
 
 
 
 
 
 
 
 
 
463
  }
464
- // Force reactivity update
465
- codeCells = [...codeCells];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
466
  }
467
 
468
  </script>
@@ -843,53 +921,146 @@ print(f"βœ“ Audio saved to {output_filename}")
843
  </button>
844
  </div>
845
 
846
- {#if codeCells.length > 0}
847
- <button
848
- on:click={copyAllCode}
849
- class="flex items-center bg-gray-100 rounded-md p-0.5"
850
- >
851
- <span class="px-3 py-1 text-sm font-medium text-gray-600 flex items-center gap-2">
852
- <Copy size={16} />
853
- Copy All
854
- </span>
855
- </button>
 
 
 
 
 
 
 
 
856
  {/if}
857
  </div>
858
  </div>
859
 
860
- <!-- Code cells -->
861
- {#if codeCells.length === 0}
862
  <div class="bg-white rounded-lg border border-gray-200 p-8 text-center">
863
  <p class="text-gray-500">Start using the UI to see generated code here</p>
 
 
 
864
  </div>
865
  {:else}
866
- <div class="space-y-4">
867
- {#each codeCells as cell (cell.id)}
 
868
  <div class="bg-white rounded-lg border border-gray-200 overflow-hidden">
869
- <!-- Cell header -->
870
- <div class="flex items-center justify-between px-4 py-2 bg-gray-50 border-b border-gray-200">
871
- <div class="flex items-center gap-3">
872
- <span class="text-sm font-medium text-gray-700">{cell.title}</span>
873
- <span class="text-xs text-gray-500">{cell.timestamp}</span>
874
  </div>
875
  <button
876
- on:click={() => copyToClipboard(cell.code)}
877
- class="p-1.5 hover:bg-gray-200 rounded transition-colors"
878
- title="Copy code"
879
  >
880
- <Copy size={14} class="text-gray-600" />
881
  </button>
882
  </div>
883
-
884
- <!-- Code content -->
885
  <div class="relative">
886
- <pre class="p-4 overflow-x-auto bg-gray-50 text-gray-900"><code class="language-python text-sm font-mono">{cell.code}</code></pre>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
887
  </div>
888
 
889
- <!-- Output (if any) -->
890
- {#if cell.output}
891
- <div class="px-4 py-2 bg-gray-900 text-green-400 font-mono text-xs border-t border-gray-200">
892
- {cell.output}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
893
  </div>
894
  {/if}
895
  </div>
 
1
  <script>
2
+ import { Play, Download, Loader2, AlertCircle, ChevronDown, Copy, RefreshCw, Share, MoreHorizontal, Settings, Sliders, Pause, SkipBack, SkipForward, Layout, Code, X, RotateCcw } from 'lucide-svelte';
3
+ import { onMount } from 'svelte';
4
+ import Prism from 'prismjs';
5
+ import 'prismjs/components/prism-python';
6
+ import 'prismjs/components/prism-bash';
7
 
8
  let text = `In a hole in the ground there lived a hobbit.`;
9
  let selectedVoice = 'Lily';
 
12
  let viewMode = 'ui';
13
  let modelDropdownOpen = false;
14
  let isGenerating = false;
15
+ let codeHistory = [];
16
+ let setupCode = null;
17
+ let importCode = null;
18
  let audioUrl = null;
19
  let copyNotification = null;
20
  let codeButtonFlash = false;
 
31
  let showErrorModal = false;
32
  let errorMessage = '';
33
  let errorDetails = '';
34
+ let currentUsername = null;
35
 
36
  const models = [
37
  { id: 'chatterbox', name: 'Chatterbox', badge: 'recommended' },
 
58
  audioUrl = null;
59
  currentTime = 0;
60
 
61
+ // Generate setup codes if not already present
62
+ if (!setupCode) {
63
+ setupCode = generateSetupCode();
64
  }
65
+ if (!importCode) {
66
+ importCode = generateImportCode();
67
+ }
68
+
69
+ const ttsCode = generateTTSCode();
70
 
71
  if (viewMode === 'ui') {
72
  codeButtonFlash = true;
 
110
 
111
  if (result.success && result.audio_url) {
112
  audioUrl = result.audio_url;
113
+
114
+ // Add to history with result
115
+ addCodeToHistory(ttsCode, {
116
+ type: 'audio',
117
+ url: result.audio_url,
118
+ title: audioTitle,
119
+ duration: result.duration
120
+ });
121
 
122
  if (viewMode === 'ui') {
123
  codeButtonFlash = true;
 
288
  }
289
  }
290
 
291
+ function addCodeToHistory(code, result = null) {
292
+ const entry = {
293
  id: Date.now() + Math.random(),
 
294
  code,
295
+ result
296
+ };
297
+ codeHistory = [...codeHistory, entry];
298
+ saveHistoryToStorage();
299
+ return entry;
300
+ }
301
+
302
+ function saveHistoryToStorage() {
303
+ if (!currentUsername) return;
304
+ const storageKey = `hfstudio_history_${currentUsername}`;
305
+ const historyData = {
306
+ username: currentUsername,
307
+ setupCode,
308
+ importCode,
309
+ history: codeHistory
310
  };
311
+ localStorage.setItem(storageKey, JSON.stringify(historyData));
312
+ }
313
+
314
+ function loadHistoryFromStorage() {
315
+ if (!currentUsername) return;
316
+ const storageKey = `hfstudio_history_${currentUsername}`;
317
+ const stored = localStorage.getItem(storageKey);
318
+ if (stored) {
319
+ try {
320
+ const data = JSON.parse(stored);
321
+ if (data.username === currentUsername) {
322
+ setupCode = data.setupCode || null;
323
+ importCode = data.importCode || null;
324
+ codeHistory = data.history || [];
325
+ }
326
+ } catch (e) {
327
+ console.error('Error loading history:', e);
328
+ }
329
+ }
330
+ }
331
+
332
+ function resetHistory() {
333
+ codeHistory = [];
334
+ setupCode = null;
335
+ importCode = null;
336
+ if (currentUsername) {
337
+ const storageKey = `hfstudio_history_${currentUsername}`;
338
+ localStorage.removeItem(storageKey);
339
+ }
340
  }
341
 
342
  function generateSetupCode() {
343
  if (mode === 'local') {
344
+ return `# Run this command in your terminal:
345
+ hfstudio start ${selectedModel.toLowerCase()} --port 7861`;
346
+ } else {
347
+ return `# Install required packages (run in terminal):
348
+ pip install huggingface-hub`;
349
+ }
350
+ }
351
+
352
+ function generateImportCode() {
353
+ if (mode === 'local') {
354
+ return `from huggingface_hub import InferenceClient
355
 
356
  # Initialize the client for local server
357
  client = InferenceClient(base_url="http://localhost:7861/v1/")`;
 
370
  }
371
 
372
  function generateTTSCode() {
373
+ const voiceUrls = {
374
+ lily: "https://huggingface.co/spaces/Abradi/hfstudio/resolve/main/voices/lily.mp3",
375
+ andrew: "https://huggingface.co/spaces/Abradi/hfstudio/resolve/main/voices/andrew.mp3",
376
+ fairy: "https://huggingface.co/spaces/Abradi/hfstudio/resolve/main/voices/fairy.mp3",
377
+ pirate: "https://huggingface.co/spaces/Abradi/hfstudio/resolve/main/voices/pirate.mp3"
378
+ };
379
+
380
  if (mode === 'local') {
381
+ return `# Generate speech
382
  text = """${text}"""
383
 
384
+ audio = client.text_to_speech(
385
+ text,
386
+ extra_body={
387
+ "audio_url": "${voiceUrls[selectedVoice.toLowerCase()]}",
388
+ "exaggeration": ${exaggeration},
389
+ "temperature": ${temperature}
390
+ }
391
+ )`;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
392
  } else {
393
+ return `# Generate speech
394
  text = """${text}"""
395
 
396
+ audio = client.text_to_speech(
397
+ text,
398
+ extra_body={
399
+ "audio_url": "${voiceUrls[selectedVoice.toLowerCase()]}",
400
+ "exaggeration": ${exaggeration},
401
+ "temperature": ${temperature}
402
+ }
403
+ )`;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
404
  }
405
  }
406
 
 
445
  }
446
 
447
  function copyAllCode() {
448
+ const parts = [];
449
+ if (setupCode) parts.push(`# Setup\n${setupCode}`);
450
+ if (importCode) parts.push(`# Imports\n${importCode}`);
451
+ codeHistory.forEach((entry, i) => {
452
+ parts.push(`# Cell ${i + 1}\n${entry.code}`);
453
+ });
454
+ const allCode = parts.join('\n\n');
455
  copyToClipboard(allCode, 'All code copied!');
456
  }
457
 
458
+ onMount(() => {
459
+ // Get username from parent layout or localStorage
460
+ const checkUsername = () => {
461
+ const token = localStorage.getItem('hf_access_token');
462
+ if (token) {
463
+ // Try to get username from parent component or make a quick API call
464
+ fetchUserInfo(token);
465
+ }
466
+ };
467
+
468
+ checkUsername();
469
+
470
+ // Listen for auth changes
471
+ window.addEventListener('storage', (e) => {
472
+ if (e.key === 'hf_access_token') {
473
+ checkUsername();
474
+ }
475
+ });
476
+ });
477
 
478
+ async function fetchUserInfo(token) {
479
+ try {
480
+ const response = await fetch('https://huggingface.co/api/whoami-v2', {
481
+ headers: {
482
+ 'Authorization': `Bearer ${token}`
483
+ }
484
+ });
485
+
486
+ if (response.ok) {
487
+ const userData = await response.json();
488
+ currentUsername = userData.name || userData.fullname || userData.login || userData.username || 'User';
489
+ loadHistoryFromStorage();
490
+ }
491
+ } catch (error) {
492
+ console.error('Error fetching user info:', error);
493
+ }
494
  }
495
 
496
+ // Update setup/import codes when mode changes
497
+ $: if (mode) {
498
+ setupCode = generateSetupCode();
499
+ importCode = generateImportCode();
500
  }
501
 
502
+
503
+ function toggleHistoryAudio(entry) {
504
+ if (!entry.audioElement) {
505
+ // Create audio element if it doesn't exist
506
+ entry.audioElement = new Audio(entry.result.url);
507
+ entry.audioElement.addEventListener('ended', () => {
508
+ entry.isPlaying = false;
509
+ codeHistory = [...codeHistory]; // Trigger reactivity
510
+ });
511
  }
512
+
513
+ if (entry.isPlaying) {
514
+ entry.audioElement.pause();
515
+ entry.isPlaying = false;
516
+ } else {
517
+ // Pause any other playing audio
518
+ codeHistory.forEach(e => {
519
+ if (e !== entry && e.isPlaying && e.audioElement) {
520
+ e.audioElement.pause();
521
+ e.isPlaying = false;
522
+ }
523
+ });
524
+ entry.audioElement.play();
525
+ entry.isPlaying = true;
526
  }
527
+ codeHistory = [...codeHistory]; // Trigger reactivity
528
+ }
529
+
530
+ function downloadHistoryAudio(url, title) {
531
+ const link = document.createElement('a');
532
+ link.href = url;
533
+ link.download = `${title || 'audio'}.wav`;
534
+ document.body.appendChild(link);
535
+ link.click();
536
+ document.body.removeChild(link);
537
+ }
538
+
539
+ function formatDuration(seconds) {
540
+ if (!seconds) return '0:00';
541
+ const mins = Math.floor(seconds / 60);
542
+ const secs = Math.floor(seconds % 60);
543
+ return `${mins}:${secs.toString().padStart(2, '0')}`;
544
  }
545
 
546
  </script>
 
921
  </button>
922
  </div>
923
 
924
+ {#if codeHistory.length > 0 || setupCode || importCode}
925
+ <div class="flex items-center gap-2">
926
+ <button
927
+ on:click={resetHistory}
928
+ class="flex items-center bg-red-50 hover:bg-red-100 rounded-md px-3 py-1.5 transition-colors"
929
+ title="Clear history"
930
+ >
931
+ <RotateCcw size={16} class="text-red-600" />
932
+ <span class="ml-2 text-sm font-medium text-red-600">Reset</span>
933
+ </button>
934
+ <button
935
+ on:click={copyAllCode}
936
+ class="flex items-center bg-gray-100 hover:bg-gray-200 rounded-md px-3 py-1.5 transition-colors"
937
+ >
938
+ <Copy size={16} class="text-gray-600" />
939
+ <span class="ml-2 text-sm font-medium text-gray-600">Copy All</span>
940
+ </button>
941
+ </div>
942
  {/if}
943
  </div>
944
  </div>
945
 
946
+ <!-- Code sections -->
947
+ {#if !setupCode && !importCode && codeHistory.length === 0}
948
  <div class="bg-white rounded-lg border border-gray-200 p-8 text-center">
949
  <p class="text-gray-500">Start using the UI to see generated code here</p>
950
+ {#if currentUsername}
951
+ <p class="text-xs text-gray-400 mt-2">Logged in as: {currentUsername}</p>
952
+ {/if}
953
  </div>
954
  {:else}
955
+ <div class="space-y-6">
956
+ <!-- Setup Section -->
957
+ {#if setupCode}
958
  <div class="bg-white rounded-lg border border-gray-200 overflow-hidden">
959
+ <div class="flex items-center justify-between px-4 py-2 bg-amber-50 border-b border-amber-200">
960
+ <div class="flex items-center gap-2">
961
+ <span class="text-sm font-medium text-amber-900">Setup (Terminal)</span>
962
+ <span class="text-xs bg-amber-100 text-amber-700 px-2 py-0.5 rounded">Run once</span>
 
963
  </div>
964
  <button
965
+ on:click={() => copyToClipboard(setupCode)}
966
+ class="p-1.5 hover:bg-amber-100 rounded transition-colors"
967
+ title="Copy setup code"
968
  >
969
+ <Copy size={14} class="text-amber-600" />
970
  </button>
971
  </div>
 
 
972
  <div class="relative">
973
+ <pre class="p-4 overflow-x-auto bg-gray-50"><code class="language-bash text-sm">{@html Prism.highlight(setupCode, Prism.languages.bash, 'bash')}</code></pre>
974
+ </div>
975
+ </div>
976
+ {/if}
977
+
978
+ <!-- Import Section -->
979
+ {#if importCode}
980
+ <div class="bg-white rounded-lg border border-gray-200 overflow-hidden">
981
+ <div class="flex items-center justify-between px-4 py-2 bg-blue-50 border-b border-blue-200">
982
+ <div class="flex items-center gap-2">
983
+ <span class="text-sm font-medium text-blue-900">Imports (Python)</span>
984
+ <span class="text-xs bg-blue-100 text-blue-700 px-2 py-0.5 rounded">Run once</span>
985
+ </div>
986
+ <button
987
+ on:click={() => copyToClipboard(importCode)}
988
+ class="p-1.5 hover:bg-blue-100 rounded transition-colors"
989
+ title="Copy import code"
990
+ >
991
+ <Copy size={14} class="text-blue-600" />
992
+ </button>
993
+ </div>
994
+ <div class="relative">
995
+ <pre class="p-4 overflow-x-auto bg-gray-50"><code class="language-python text-sm">{@html Prism.highlight(importCode, Prism.languages.python, 'python')}</code></pre>
996
+ </div>
997
+ </div>
998
+ {/if}
999
+
1000
+ <!-- History entries -->
1001
+ {#each codeHistory as entry, i (entry.id)}
1002
+ <div class="bg-white rounded-lg border border-gray-200 overflow-hidden shadow-sm">
1003
+ <!-- Code cell -->
1004
+ <div class="border-b border-gray-200">
1005
+ <div class="flex items-center justify-between px-4 py-2 bg-gray-50 border-b border-gray-100">
1006
+ <span class="text-sm font-medium text-gray-700">Cell {i + 1}</span>
1007
+ <button
1008
+ on:click={() => copyToClipboard(entry.code)}
1009
+ class="p-1.5 hover:bg-gray-200 rounded transition-colors"
1010
+ title="Copy code"
1011
+ >
1012
+ <Copy size={14} class="text-gray-600" />
1013
+ </button>
1014
+ </div>
1015
+ <div class="relative">
1016
+ <pre class="p-4 overflow-x-auto bg-gray-50"><code class="language-python text-sm">{@html Prism.highlight(entry.code, Prism.languages.python, 'python')}</code></pre>
1017
+ </div>
1018
  </div>
1019
 
1020
+ <!-- Result (audio player) -->
1021
+ {#if entry.result && entry.result.type === 'audio'}
1022
+ <div class="bg-gradient-to-b from-gray-50 to-white p-4">
1023
+ <div class="bg-white rounded-lg border border-gray-200 p-4 shadow-sm">
1024
+ <div class="flex items-center justify-between">
1025
+ <div class="flex items-center gap-3 flex-1">
1026
+ <button
1027
+ on:click={() => toggleHistoryAudio(entry)}
1028
+ class="w-10 h-10 bg-gradient-to-r from-amber-500 to-orange-500 rounded-full flex items-center justify-center text-white hover:from-amber-600 hover:to-orange-600 transition-colors shadow-md"
1029
+ >
1030
+ {#if entry.isPlaying}
1031
+ <Pause size={18} />
1032
+ {:else}
1033
+ <Play size={18} class="ml-0.5" />
1034
+ {/if}
1035
+ </button>
1036
+ <div class="flex-1">
1037
+ <div class="text-sm font-medium text-gray-900 truncate">{entry.result.title || 'Generated Audio'}</div>
1038
+ <div class="text-xs text-gray-500">Duration: {formatDuration(entry.result.duration || 0)}</div>
1039
+ </div>
1040
+ </div>
1041
+ <div class="flex items-center gap-1">
1042
+ <button
1043
+ on:click={() => downloadHistoryAudio(entry.result.url, entry.result.title)}
1044
+ class="p-2 hover:bg-gray-100 rounded-lg transition-colors"
1045
+ title="Download"
1046
+ >
1047
+ <Download size={16} class="text-gray-600" />
1048
+ </button>
1049
+ <button
1050
+ class="p-2 hover:bg-gray-100 rounded-lg transition-colors"
1051
+ title="Share"
1052
+ >
1053
+ <Share size={16} class="text-gray-600" />
1054
+ </button>
1055
+ </div>
1056
+ </div>
1057
+ <audio
1058
+ bind:this={entry.audioElement}
1059
+ src={entry.result.url}
1060
+ on:ended={() => entry.isPlaying = false}
1061
+ class="hidden"
1062
+ />
1063
+ </div>
1064
  </div>
1065
  {/if}
1066
  </div>
hfstudio/server.py CHANGED
@@ -11,6 +11,23 @@ import json
11
  from pathlib import Path
12
  from huggingface_hub import InferenceClient, get_token, whoami
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  app = FastAPI(title="HFStudio API", version="0.1.0")
15
 
16
  static_dir = Path(__file__).parent / "static"
@@ -94,23 +111,6 @@ app.add_middleware(
94
  allow_headers=["*"],
95
  )
96
 
97
- class TTSRequest(BaseModel):
98
- model_config = {"protected_namespaces": ()}
99
-
100
- text: str
101
- voice_id: str = "default"
102
- model_id: str = "coqui-tts"
103
- parameters: Dict[str, Any] = {}
104
- mode: str = "api"
105
- access_token: Optional[str] = None
106
-
107
- class TTSResponse(BaseModel):
108
- audio_url: Optional[str] = None
109
- duration: Optional[float] = None
110
- format: str = "wav"
111
- error: Optional[str] = None
112
- success: bool = True
113
-
114
  class Voice(BaseModel):
115
  id: str
116
  name: str
 
11
  from pathlib import Path
12
  from huggingface_hub import InferenceClient, get_token, whoami
13
 
14
+ class TTSRequest(BaseModel):
15
+ model_config = {"protected_namespaces": ()}
16
+
17
+ text: str
18
+ voice_id: str = "default"
19
+ model_id: str = "coqui-tts"
20
+ parameters: Dict[str, Any] = {}
21
+ mode: str = "api"
22
+ access_token: Optional[str] = None
23
+
24
+ class TTSResponse(BaseModel):
25
+ audio_url: Optional[str] = None
26
+ duration: Optional[float] = None
27
+ format: str = "wav"
28
+ error: Optional[str] = None
29
+ success: bool = True
30
+
31
  app = FastAPI(title="HFStudio API", version="0.1.0")
32
 
33
  static_dir = Path(__file__).parent / "static"
 
111
  allow_headers=["*"],
112
  )
113
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
114
  class Voice(BaseModel):
115
  id: str
116
  name: str
hfstudio/static/_app/immutable/assets/0.DBGxRMBA.css ADDED
@@ -0,0 +1 @@
 
 
1
+ *,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.bottom-full{bottom:100%}.left-0{left:0}.left-1\/2{left:50%}.left-56{left:14rem}.right-0{right:0}.right-4{right:1rem}.right-80{right:20rem}.top-full{top:100%}.z-10{z-index:10}.z-50{z-index:50}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.ml-0\.5{margin-left:.125rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.block{display:block}.flex{display:flex}.contents{display:contents}.hidden{display:none}.h-0{height:0px}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-2{height:.5rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-full{height:100%}.h-screen{height:100vh}.max-h-\[80vh\]{max-height:80vh}.min-h-0{min-height:0px}.w-0{width:0px}.w-10{width:2.5rem}.w-12{width:3rem}.w-2{width:.5rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-8{width:2rem}.w-80{width:20rem}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-md{max-width:28rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-150{--tw-scale-x: 1.5;--tw-scale-y: 1.5;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-0{border-width:0px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-r-4{border-right-width:4px}.border-t{border-top-width:1px}.border-t-4{border-top-width:4px}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-l-transparent{border-left-color:transparent}.border-r-transparent{border-right-color:transparent}.border-t-blue-600{--tw-border-opacity: 1;border-top-color:rgb(37 99 235 / var(--tw-border-opacity, 1))}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-opacity-50{--tw-bg-opacity: .5}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-amber-400{--tw-gradient-from: #fbbf24 var(--tw-gradient-from-position);--tw-gradient-to: rgb(251 191 36 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-amber-500{--tw-gradient-from: #f59e0b var(--tw-gradient-from-position);--tw-gradient-to: rgb(245 158 11 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-50{--tw-gradient-from: #f9fafb var(--tw-gradient-from-position);--tw-gradient-to: rgb(249 250 251 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-orange-500{--tw-gradient-to: #f97316 var(--tw-gradient-to-position)}.to-white{--tw-gradient-to: #fff var(--tw-gradient-to-position)}.bg-right{background-position:right}.bg-no-repeat{background-repeat:no-repeat}.p-0\.5{padding:.125rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-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-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-relaxed{line-height:1.625}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-900{--tw-text-opacity: 1;color:rgb(120 53 15 / var(--tw-text-opacity, 1))}.text-blue-100{--tw-text-opacity: 1;color:rgb(219 234 254 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-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-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-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}code[class*=language-],pre[class*=language-]{color:#393a34;font-family:Consolas,Bitstream Vera Sans Mono,Courier New,Courier,monospace;direction:ltr;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;font-size:.875rem;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;hyphens:none}pre[class*=language-]{padding:1rem;margin:0;overflow:auto;background:#f8f9fa}.token.comment,.token.prolog,.token.doctype,.token.cdata{color:green;font-style:italic}.token.punctuation{color:#393a34}.token.property,.token.tag,.token.boolean,.token.number,.token.constant,.token.symbol,.token.deleted{color:#e91e63}.token.selector,.token.attr-name,.token.string,.token.char,.token.builtin,.token.inserted{color:#067d17}.token.operator,.token.entity,.token.url,.language-css .token.string,.style .token.string{color:#795da3}.token.atrule,.token.attr-value,.token.keyword{color:#00f}.token.function,.token.class-name{color:#795da3}.token.regex,.token.important,.token.variable{color:#e90}.language-bash .token.function{color:#067d17}.slider-hf::-webkit-slider-thumb{height:1rem;width:1rem;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:9999px;background:linear-gradient(45deg,#ffd21e,#ff9d00);box-shadow:0 1px 3px #0000001a}.slider-hf::-moz-range-thumb{height:1rem;width:1rem;cursor:pointer;border-radius:9999px;border-width:0px;background:linear-gradient(45deg,#ffd21e,#ff9d00);box-shadow:0 1px 3px #0000001a}.pause-filled{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px}.pause-filled:before,.pause-filled:after{content:"";width:2px;height:10px;background-color:currentColor;border-radius:1px}.pause-filled:before{margin-right:2px}.pause-filled:after{margin-left:2px}.hover\:bg-amber-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-800:hover{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.hover\:bg-orange-600:hover{--tw-bg-opacity: 1;background-color:rgb(234 88 12 / var(--tw-bg-opacity, 1))}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:from-amber-500:hover{--tw-gradient-from: #f59e0b var(--tw-gradient-from-position);--tw-gradient-to: rgb(245 158 11 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:from-amber-600:hover{--tw-gradient-from: #d97706 var(--tw-gradient-from-position);--tw-gradient-to: rgb(217 119 6 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:to-orange-600:hover{--tw-gradient-to: #ea580c var(--tw-gradient-to-position)}.hover\:text-amber-700:hover{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.hover\:text-gray-800:hover{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.focus\:border-transparent:focus{border-color:transparent}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-amber-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(251 191 36 / var(--tw-ring-opacity, 1))}.focus\:ring-orange-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(249 115 22 / var(--tw-ring-opacity, 1))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}
hfstudio/static/_app/immutable/chunks/58WuCvUx.js ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ var St=Object.defineProperty;var kt=(e,t,n)=>t in e?St(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var R=(e,t,n)=>kt(e,typeof t!="symbol"?t+"":t,n);import{S as Et,F as At,Z as Rt,_ as Tt,$ as It,a0 as Ut,a1 as Lt,a2 as $t,v as ve,a3 as xt,G as be,A as ge,s as Ct}from"./BF3xBGh8.js";class Ze extends Et{constructor(n){if(!n||!n.target&&!n.$$inline)throw new Error("'target' is a required option");super();R(this,"$$prop_def");R(this,"$$events_def");R(this,"$$slot_def")}$destroy(){super.$destroy(),this.$destroy=()=>{console.warn("Component was already destroyed")}}$capture_state(){}$inject_state(){}}class Pt extends Ze{}const Ot=Object.freeze(Object.defineProperty({__proto__:null,SvelteComponent:Ze,SvelteComponentTyped:Pt,afterUpdate:At,beforeUpdate:Rt,createEventDispatcher:Tt,getAllContexts:It,getContext:Ut,hasContext:Lt,onDestroy:$t,onMount:ve,setContext:xt,tick:be},Symbol.toStringTag,{value:"Module"}));class ie{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Re{constructor(t,n){this.status=t,this.location=n}}class Te extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function Nt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function jt(e){return e.split("%25").map(decodeURI).join("%25")}function Dt(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function me({href:e}){return e.split("#")[0]}function Ft(e,t,n,r=!1){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(i,o){if(o==="get"||o==="getAll"||o==="has")return l=>(n(l),i[o](l));t();const c=Reflect.get(i,o);return typeof c=="function"?c.bind(i):c}}),enumerable:!0,configurable:!0});const s=["href","pathname","search","toString","toJSON"];r&&s.push("hash");for(const i of s)Object.defineProperty(a,i,{get(){return t(),e[i]},enumerable:!0,configurable:!0});return a}function Bt(...e){let t=5381;for(const n of e)if(typeof n=="string"){let r=n.length;for(;r;)t=t*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)t=t*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;const Mt=new TextDecoder;function Vt(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const qt=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:(t==null?void 0:t.method)||"GET")!=="GET"&&Y.delete(Ie(e)),qt(e,t));const Y=new Map;function Gt(e,t){const n=Ie(e,t),r=document.querySelector(n);if(r!=null&&r.textContent){r.remove();let{body:a,...s}=JSON.parse(r.textContent);const i=r.getAttribute("data-ttl");return i&&Y.set(n,{body:a,init:s,ttl:1e3*Number(i)}),r.getAttribute("data-b64")!==null&&(a=Vt(a)),Promise.resolve(new Response(a,s))}return window.fetch(e,t)}function Yt(e,t,n){if(Y.size>0){const r=Ie(e,n),a=Y.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(n==null?void 0:n.cache))return new Response(a.body,a.init);Y.delete(r)}}return window.fetch(t,n)}function Ie(e,t){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t!=null&&t.headers||t!=null&&t.body){const a=[];t.headers&&a.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&a.push(t.body),r+=`[data-hash="${Bt(...a)}"]`}return r}const Ht=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Kt(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${Wt(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const s=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(s)return t.push({name:s[1],matcher:s[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const i=r.split(/\[(.+?)\](?!\])/);return"/"+i.map((c,l)=>{if(l%2){if(c.startsWith("x+"))return _e(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return _e(String.fromCharCode(...c.slice(2).split("-").map(u=>parseInt(u,16))));const d=Ht.exec(c),[,h,y,f,p]=d;return t.push({name:f,matcher:p,optional:!!h,rest:!!y,chained:y?l===1&&i[0]==="":!1}),y?"([^]*?)":h?"([^/]*)?":"([^/]+?)"}return _e(c)}).join("")}).join("")}/?$`),params:t}}function zt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function Wt(e){return e.slice(1).split("/").filter(zt)}function Jt(e,t,n){const r={},a=e.slice(1),s=a.filter(o=>o!==void 0);let i=0;for(let o=0;o<t.length;o+=1){const c=t[o];let l=a[o-i];if(c.chained&&c.rest&&i&&(l=a.slice(o-i,o+1).filter(d=>d).join("/"),i=0),l===void 0){c.rest&&(r[c.name]="");continue}if(!c.matcher||n[c.matcher](l)){r[c.name]=l;const d=t[o+1],h=a[o+1];d&&!d.rest&&d.optional&&h&&c.chained&&(i=0),!d&&!h&&Object.keys(r).length===s.length&&(i=0);continue}if(c.optional&&c.chained){i++;continue}return}if(!i)return r}function _e(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Xt({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([o,[c,l,d]])=>{const{pattern:h,params:y}=Kt(o),f={id:o,exec:p=>{const u=h.exec(p);if(u)return Jt(u,y,r)},errors:[1,...d||[]].map(p=>e[p]),layouts:[0,...l||[]].map(i),leaf:s(c)};return f.errors.length=f.layouts.length=Math.max(f.errors.length,f.layouts.length),f});function s(o){const c=o<0;return c&&(o=~o),[c,e[o]]}function i(o){return o===void 0?o:[a.has(o),e[o]]}}function Qe(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function Be(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const D=[];function Ue(e,t=ge){let n;const r=new Set;function a(o){if(Ct(e,o)&&(e=o,n)){const c=!D.length;for(const l of r)l[1](),D.push(l,e);if(c){for(let l=0;l<D.length;l+=2)D[l][0](D[l+1]);D.length=0}}}function s(o){a(o(e))}function i(o,c=ge){const l=[o,c];return r.add(l),r.size===1&&(n=t(a,s)||ge),o(e),()=>{r.delete(l),r.size===0&&n&&(n(),n=null)}}return{set:a,update:s,subscribe:i}}var Je;const $=((Je=globalThis.__sveltekit_7hn0aa)==null?void 0:Je.base)??"";var Xe;const Zt=((Xe=globalThis.__sveltekit_7hn0aa)==null?void 0:Xe.assets)??$??"",Qt="1761004481087",et="sveltekit:snapshot",tt="sveltekit:scroll",nt="sveltekit:states",en="sveltekit:pageurl",B="sveltekit:history",z="sveltekit:navigation",O={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},ce=location.origin;function at(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function le(){return{x:pageXOffset,y:pageYOffset}}function F(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const Me={...O,"":O.hover};function rt(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function ot(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=rt(e)}}function Se(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const o=location.hash.split("#")[1]||"/";r.hash=`#${o}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,s=!r||!!a||fe(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),i=(r==null?void 0:r.origin)===ce&&e.hasAttribute("download");return{url:r,external:s,target:a,download:i}}function Q(e){let t=null,n=null,r=null,a=null,s=null,i=null,o=e;for(;o&&o!==document.documentElement;)r===null&&(r=F(o,"preload-code")),a===null&&(a=F(o,"preload-data")),t===null&&(t=F(o,"keepfocus")),n===null&&(n=F(o,"noscroll")),s===null&&(s=F(o,"reload")),i===null&&(i=F(o,"replacestate")),o=rt(o);function c(l){switch(l){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Me[r??"off"],preload_data:Me[a??"off"],keepfocus:c(t),noscroll:c(n),reload:c(s),replace_state:c(i)}}function Ve(e){const t=Ue(e);let n=!0;function r(){n=!0,t.update(i=>i)}function a(i){n=!1,t.set(i)}function s(i){let o;return t.subscribe(c=>{(o===void 0||n&&c!==o)&&i(o=c)})}return{notify:r,set:a,subscribe:s}}const st={v:()=>{}};function tn(){const{set:e,subscribe:t}=Ue(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Zt}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const i=(await a.json()).version!==Qt;return i&&(e(!0),st.v(),clearTimeout(n)),i}catch{return!1}}return{subscribe:t,check:r}}function fe(e,t,n){return e.origin!==ce||!e.pathname.startsWith(t)?!0:n?!(e.pathname===t+"/"||e.pathname===t+"/index.html"||e.protocol==="file:"&&e.pathname.replace(/\/[^/]+\.html?$/,"")===t):!1}function qn(e){}function nn(e){const t=rn(e),n=new ArrayBuffer(t.length),r=new DataView(n);for(let a=0;a<n.byteLength;a++)r.setUint8(a,t.charCodeAt(a));return n}const an="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function rn(e){e.length%4===0&&(e=e.replace(/==?$/,""));let t="",n=0,r=0;for(let a=0;a<e.length;a++)n<<=6,n|=an.indexOf(e[a]),r+=6,r===24&&(t+=String.fromCharCode((n&16711680)>>16),t+=String.fromCharCode((n&65280)>>8),t+=String.fromCharCode(n&255),n=r=0);return r===12?(n>>=4,t+=String.fromCharCode(n)):r===18&&(n>>=2,t+=String.fromCharCode((n&65280)>>8),t+=String.fromCharCode(n&255)),t}const on=-1,sn=-2,cn=-3,ln=-4,fn=-5,un=-6;function dn(e,t){if(typeof e=="number")return a(e,!0);if(!Array.isArray(e)||e.length===0)throw new Error("Invalid input");const n=e,r=Array(n.length);function a(s,i=!1){if(s===on)return;if(s===cn)return NaN;if(s===ln)return 1/0;if(s===fn)return-1/0;if(s===un)return-0;if(i||typeof s!="number")throw new Error("Invalid input");if(s in r)return r[s];const o=n[s];if(!o||typeof o!="object")r[s]=o;else if(Array.isArray(o))if(typeof o[0]=="string"){const c=o[0],l=t==null?void 0:t[c];if(l)return r[s]=l(a(o[1]));switch(c){case"Date":r[s]=new Date(o[1]);break;case"Set":const d=new Set;r[s]=d;for(let f=1;f<o.length;f+=1)d.add(a(o[f]));break;case"Map":const h=new Map;r[s]=h;for(let f=1;f<o.length;f+=2)h.set(a(o[f]),a(o[f+1]));break;case"RegExp":r[s]=new RegExp(o[1],o[2]);break;case"Object":r[s]=Object(o[1]);break;case"BigInt":r[s]=BigInt(o[1]);break;case"null":const y=Object.create(null);r[s]=y;for(let f=1;f<o.length;f+=2)y[o[f]]=a(o[f+1]);break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":{const f=globalThis[c],p=new f(a(o[1]));r[s]=o[2]!==void 0?p.subarray(o[2],o[3]):p;break}case"ArrayBuffer":{const f=o[1],p=nn(f);r[s]=p;break}case"Temporal.Duration":case"Temporal.Instant":case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.PlainMonthDay":case"Temporal.PlainYearMonth":case"Temporal.ZonedDateTime":{const f=c.slice(9);r[s]=Temporal[f].from(o[1]);break}case"URL":{const f=new URL(o[1]);r[s]=f;break}case"URLSearchParams":{const f=new URLSearchParams(o[1]);r[s]=f;break}default:throw new Error(`Unknown type ${c}`)}}else{const c=new Array(o.length);r[s]=c;for(let l=0;l<o.length;l+=1){const d=o[l];d!==sn&&(c[l]=a(d))}}else{const c={};r[s]=c;for(const l in o){if(l==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");const d=o[l];c[l]=a(d)}}return r[s]}return a(0)}const it=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...it];const hn=new Set([...it]);[...hn];function pn(e){return e.filter(t=>t!=null)}const gn="x-sveltekit-invalidated",mn="x-sveltekit-trailing-slash";function ee(e){return e instanceof ie||e instanceof Te?e.status:500}function _n(e){return e instanceof Te?e.text:"Internal Error"}let T,W,we;const wn=ve.toString().includes("$$")||/function \w+\(\) \{\}/.test(ve.toString());wn?(T={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},W={current:null},we={current:!1}):(T=new class{constructor(){R(this,"data",$state.raw({}));R(this,"form",$state.raw(null));R(this,"error",$state.raw(null));R(this,"params",$state.raw({}));R(this,"route",$state.raw({id:null}));R(this,"state",$state.raw({}));R(this,"status",$state.raw(-1));R(this,"url",$state.raw(new URL("https://example.com")))}},W=new class{constructor(){R(this,"current",$state.raw(null))}},we=new class{constructor(){R(this,"current",$state.raw(!1))}},st.v=()=>we.current=!0);function yn(e){Object.assign(T,e)}const vn="/__data.json",bn=".html__data.json";function Sn(e){return e.endsWith(".html")?e.replace(/\.html$/,bn):e.replace(/\/$/,"")+vn}const qe={spanContext(){return kn},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},kn={traceId:"",spanId:"",traceFlags:0},{tick:En}=Ot,An=new Set(["icon","shortcut icon","apple-touch-icon"]),j=Qe(tt)??{},J=Qe(et)??{},C={url:Ve({}),page:Ve({}),navigating:Ue(null),updated:tn()};function Le(e){j[e]=le()}function Rn(e,t){let n=e+1;for(;j[n];)delete j[n],n+=1;for(n=t+1;J[n];)delete J[n],n+=1}function q(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function ct(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration($||"/");e&&await e.update()}}function Ge(){}let $e,ke,te,x,Ee,k;const ne=[],ae=[];let U=null;const Z=new Map,lt=new Set,Tn=new Set,H=new Set;let b={branch:[],error:null,url:null},xe=!1,re=!1,Ye=!0,X=!1,G=!1,ft=!1,Ce=!1,ut,A,L,N;const K=new Set,He=new Map;async function Kn(e,t,n){var s,i,o,c,l;(s=globalThis.__sveltekit_7hn0aa)!=null&&s.data&&globalThis.__sveltekit_7hn0aa.data,document.URL!==location.href&&(location.href=location.href),k=e,await((o=(i=e.hooks).init)==null?void 0:o.call(i)),$e=Xt(e),x=document.documentElement,Ee=t,ke=e.nodes[0],te=e.nodes[1],ke(),te(),A=(c=history.state)==null?void 0:c[B],L=(l=history.state)==null?void 0:l[z],A||(A=L=Date.now(),history.replaceState({...history.state,[B]:A,[z]:L},""));const r=j[A];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await Dn(Ee,n)):(await M({type:"enter",url:at(k.hash?Bn(new URL(location.href)):location.href),replace_state:!0}),a()),jn()}function In(){ne.length=0,Ce=!1}function dt(e){ae.some(t=>t==null?void 0:t.snapshot)&&(J[e]=ae.map(t=>{var n;return(n=t==null?void 0:t.snapshot)==null?void 0:n.capture()}))}function ht(e){var t;(t=J[e])==null||t.forEach((n,r)=>{var a,s;(s=(a=ae[r])==null?void 0:a.snapshot)==null||s.restore(n)})}function Ke(){Le(A),Be(tt,j),dt(L),Be(et,J)}async function Un(e,t,n,r){let a;t.invalidateAll&&(U=null),await M({type:"goto",url:at(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(Ce=!0,a=[...He.keys()]),t.invalidate&&t.invalidate.forEach(Nn)}}),t.invalidateAll&&be().then(be).then(()=>{He.forEach(({resource:s},i)=>{var o;a!=null&&a.includes(i)&&((o=s.refresh)==null||o.call(s))})})}async function Ln(e){if(e.id!==(U==null?void 0:U.id)){const t={};K.add(t),U={id:e.id,token:t,promise:mt({...e,preload:t}).then(n=>(K.delete(t),n.type==="loaded"&&n.state.error&&(U=null),n))}}return U.promise}async function ye(e){var n;const t=(n=await de(e,!1))==null?void 0:n.route;t&&await Promise.all([...t.layouts,t.leaf].map(r=>r==null?void 0:r[1]()))}function pt(e,t,n){var a;b=e.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(T,e.props.page),ut=new k.root({target:t,props:{...e.props,stores:C,components:ae},hydrate:n,sync:!1}),ht(L),n){const s={from:null,to:{params:b.params,route:{id:((a=b.route)==null?void 0:a.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};H.forEach(i=>i(s))}re=!0}function oe({url:e,params:t,branch:n,status:r,error:a,route:s,form:i}){let o="never";if($&&(e.pathname===$||e.pathname===$+"/"))o="always";else for(const f of n)(f==null?void 0:f.slash)!==void 0&&(o=f.slash);e.pathname=Nt(e.pathname,o),e.search=e.search;const c={type:"loaded",state:{url:e,params:t,branch:n,error:a,route:s},props:{constructors:pn(n).map(f=>f.node.component),page:je(T)}};i!==void 0&&(c.props.form=i);let l={},d=!T,h=0;for(let f=0;f<Math.max(n.length,b.branch.length);f+=1){const p=n[f],u=b.branch[f];(p==null?void 0:p.data)!==(u==null?void 0:u.data)&&(d=!0),p&&(l={...l,...p.data},d&&(c.props[`data_${h}`]=l),h+=1)}return(!b.url||e.href!==b.url.href||b.error!==a||i!==void 0&&i!==T.form||d)&&(c.props.page={error:a,params:t,route:{id:(s==null?void 0:s.id)??null},state:{},status:r,url:new URL(e),form:i??null,data:d?l:T.data}),c}async function Pe({loader:e,parent:t,url:n,params:r,route:a,server_data_node:s}){var d,h,y;let i=null,o=!0;const c={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},l=await e();if((d=l.universal)!=null&&d.load){let f=function(...u){for(const g of u){const{href:_}=new URL(g,n);c.dependencies.add(_)}};const p={tracing:{enabled:!1,root:qe,current:qe},route:new Proxy(a,{get:(u,g)=>(o&&(c.route=!0),u[g])}),params:new Proxy(r,{get:(u,g)=>(o&&c.params.add(g),u[g])}),data:(s==null?void 0:s.data)??null,url:Ft(n,()=>{o&&(c.url=!0)},u=>{o&&c.search_params.add(u)},k.hash),async fetch(u,g){u instanceof Request&&(g={body:u.method==="GET"||u.method==="HEAD"?void 0:await u.blob(),cache:u.cache,credentials:u.credentials,headers:[...u.headers].length>0?u==null?void 0:u.headers:void 0,integrity:u.integrity,keepalive:u.keepalive,method:u.method,mode:u.mode,redirect:u.redirect,referrer:u.referrer,referrerPolicy:u.referrerPolicy,signal:u.signal,...g});const{resolved:_,promise:I}=gt(u,g,n);return o&&f(_.href),I},setHeaders:()=>{},depends:f,parent(){return o&&(c.parent=!0),t()},untrack(u){o=!1;try{return u()}finally{o=!0}}};i=await l.universal.load.call(null,p)??null}return{node:l,loader:e,server:s,universal:(h=l.universal)!=null&&h.load?{type:"data",data:i,uses:c}:null,data:i??(s==null?void 0:s.data)??null,slash:((y=l.universal)==null?void 0:y.trailingSlash)??(s==null?void 0:s.slash)}}function gt(e,t,n){let r=e instanceof Request?e.url:e;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const s=re?Yt(r,a.href,t):Gt(r,t);return{resolved:a,promise:s}}function ze(e,t,n,r,a,s){if(Ce)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const i of a.search_params)if(r.has(i))return!0;for(const i of a.params)if(s[i]!==b.params[i])return!0;for(const i of a.dependencies)if(ne.some(o=>o(new URL(i))))return!0;return!1}function Oe(e,t){return(e==null?void 0:e.type)==="data"?e:(e==null?void 0:e.type)==="skip"?t??null:null}function $n(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),s=t.searchParams.getAll(r);a.every(i=>s.includes(i))&&s.every(i=>a.includes(i))&&n.delete(r)}return n}function We({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:je(T),constructors:[]}}}async function mt({id:e,invalidating:t,url:n,params:r,route:a,preload:s}){if((U==null?void 0:U.id)===e)return K.delete(U.token),U.promise;const{errors:i,layouts:o,leaf:c}=a,l=[...o,c];i.forEach(w=>w==null?void 0:w().catch(()=>{})),l.forEach(w=>w==null?void 0:w[1]().catch(()=>{}));let d=null;const h=b.url?e!==se(b.url):!1,y=b.route?a.id!==b.route.id:!1,f=$n(b.url,n);let p=!1;const u=l.map((w,m)=>{var P;const v=b.branch[m],S=!!(w!=null&&w[0])&&((v==null?void 0:v.loader)!==w[1]||ze(p,y,h,f,(P=v.server)==null?void 0:P.uses,r));return S&&(p=!0),S});if(u.some(Boolean)){try{d=await yt(n,u)}catch(w){const m=await V(w,{url:n,params:r,route:{id:e}});return K.has(s)?We({error:m,url:n,params:r,route:a}):ue({status:ee(w),error:m,url:n,route:a})}if(d.type==="redirect")return d}const g=d==null?void 0:d.nodes;let _=!1;const I=l.map(async(w,m)=>{var he;if(!w)return;const v=b.branch[m],S=g==null?void 0:g[m];if((!S||S.type==="skip")&&w[1]===(v==null?void 0:v.loader)&&!ze(_,y,h,f,(he=v.universal)==null?void 0:he.uses,r))return v;if(_=!0,(S==null?void 0:S.type)==="error")throw S;return Pe({loader:w[1],url:n,params:r,route:a,parent:async()=>{var Fe;const De={};for(let pe=0;pe<m;pe+=1)Object.assign(De,(Fe=await I[pe])==null?void 0:Fe.data);return De},server_data_node:Oe(S===void 0&&w[0]?{type:"skip"}:S??null,w[0]?v==null?void 0:v.server:void 0)})});for(const w of I)w.catch(()=>{});const E=[];for(let w=0;w<l.length;w+=1)if(l[w])try{E.push(await I[w])}catch(m){if(m instanceof Re)return{type:"redirect",location:m.location};if(K.has(s))return We({error:await V(m,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let v=ee(m),S;if(g!=null&&g.includes(m))v=m.status??v,S=m.error;else if(m instanceof ie)S=m.body;else{if(await C.updated.check())return await ct(),await q(n);S=await V(m,{params:r,url:n,route:{id:a.id}})}const P=await xn(w,E,i);return P?oe({url:n,params:r,branch:E.slice(0,P.idx).concat(P.node),status:v,error:S,route:a}):await wt(n,{id:a.id},S,v)}else E.push(void 0);return oe({url:n,params:r,branch:E,status:200,error:null,route:a,form:t?void 0:null})}async function xn(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)r-=1;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function ue({status:e,error:t,url:n,route:r}){const a={};let s=null;if(k.server_loads[0]===0)try{const o=await yt(n,[!0]);if(o.type!=="data"||o.nodes[0]&&o.nodes[0].type!=="data")throw 0;s=o.nodes[0]??null}catch{(n.origin!==ce||n.pathname!==location.pathname||xe)&&await q(n)}try{const o=await Pe({loader:ke,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:Oe(s)}),c={node:await te(),loader:te,universal:null,server:null,data:null};return oe({url:n,params:a,branch:[o,c],status:e,error:t,route:null})}catch(o){if(o instanceof Re)return Un(new URL(o.location,location.href),{},0);throw o}}async function Cn(e){const t=e.href;if(Z.has(t))return Z.get(t);let n;try{const r=(async()=>{let a=await k.hooks.reroute({url:new URL(e),fetch:async(s,i)=>gt(s,i,e).promise})??e;if(typeof a=="string"){const s=new URL(e);k.hash?s.hash=a:s.pathname=a,a=s}return a})();Z.set(t,r),n=await r}catch{Z.delete(t);return}return n}async function de(e,t){if(e&&!fe(e,$,k.hash)){const n=await Cn(e);if(!n)return;const r=Pn(n);for(const a of $e){const s=a.exec(r);if(s)return{id:se(e),invalidating:t,route:a,params:Dt(s),url:e}}}}function Pn(e){return jt(k.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice($.length))||"/"}function se(e){return(k.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function _t({url:e,type:t,intent:n,delta:r,event:a}){let s=!1;const i=Ne(b,n,e,t);r!==void 0&&(i.navigation.delta=r),a!==void 0&&(i.navigation.event=a);const o={...i.navigation,cancel:()=>{s=!0,i.reject(new Error("navigation cancelled"))}};return X||lt.forEach(c=>c(o)),s?null:i}async function M({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:s,state:i={},redirect_count:o=0,nav_token:c={},accept:l=Ge,block:d=Ge,event:h}){const y=N;N=c;const f=await de(t,!1),p=e==="enter"?Ne(b,f,t,e):_t({url:t,type:e,delta:n==null?void 0:n.delta,intent:f,event:h});if(!p){d(),N===c&&(N=y);return}const u=A,g=L;l(),X=!0,re&&p.navigation.type!=="enter"&&C.navigating.set(W.current=p.navigation);let _=f&&await mt(f);if(!_){if(fe(t,$,k.hash))return await q(t,s);_=await wt(t,{id:null},await V(new Te(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,s)}if(t=(f==null?void 0:f.url)||t,N!==c)return p.reject(new Error("navigation aborted")),!1;if(_.type==="redirect"){if(o<20){await M({type:e,url:new URL(_.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:s,state:i,redirect_count:o+1,nav_token:c}),p.fulfil(void 0);return}_=await ue({status:500,error:await V(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else _.props.page.status>=400&&await C.updated.check()&&(await ct(),await q(t,s));if(In(),Le(u),dt(g),_.props.page.url.pathname!==t.pathname&&(t.pathname=_.props.page.url.pathname),i=n?n.state:i,!n){const m=s?0:1,v={[B]:A+=m,[z]:L+=m,[nt]:i};(s?history.replaceState:history.pushState).call(history,v,"",t),s||Rn(A,L)}if(U=null,_.props.page.state=i,re){const m=(await Promise.all(Array.from(Tn,v=>v(p.navigation)))).filter(v=>typeof v=="function");if(m.length>0){let v=function(){m.forEach(S=>{H.delete(S)})};m.push(v),m.forEach(S=>{H.add(S)})}b=_.state,_.props.page&&(_.props.page.url=t),ut.$set(_.props),yn(_.props.page),ft=!0}else pt(_,Ee,!1);const{activeElement:I}=document;await En();let E=n?n.scroll:a?le():null;if(Ye){const m=t.hash&&document.getElementById(bt(t));if(E)scrollTo(E.x,E.y);else if(m){m.scrollIntoView();const{top:v,left:S}=m.getBoundingClientRect();E={x:pageXOffset+S,y:pageYOffset+v}}else scrollTo(0,0)}const w=document.activeElement!==I&&document.activeElement!==document.body;!r&&!w&&Fn(t,E),Ye=!0,_.props.page&&Object.assign(T,_.props.page),X=!1,e==="popstate"&&ht(L),p.fulfil(void 0),H.forEach(m=>m(p.navigation)),C.navigating.set(W.current=null)}async function wt(e,t,n,r,a){return e.origin===ce&&e.pathname===location.pathname&&!xe?await ue({status:r,error:n,url:e,route:t}):await q(e,a)}function On(){let e,t,n;x.addEventListener("mousemove",o=>{const c=o.target;clearTimeout(e),e=setTimeout(()=>{s(c,O.hover)},20)});function r(o){o.defaultPrevented||s(o.composedPath()[0],O.tap)}x.addEventListener("mousedown",r),x.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(o=>{for(const c of o)c.isIntersecting&&(ye(new URL(c.target.href)),a.unobserve(c.target))},{threshold:0});async function s(o,c){const l=ot(o,x),d=l===t&&c>=n;if(!l||d)return;const{url:h,external:y,download:f}=Se(l,$,k.hash);if(y||f)return;const p=Q(l),u=h&&se(b.url)===se(h);if(!(p.reload||u))if(c<=p.preload_data){t=l,n=O.tap;const g=await de(h,!1);if(!g)return;Ln(g)}else c<=p.preload_code&&(t=l,n=c,ye(h))}function i(){a.disconnect();for(const o of x.querySelectorAll("a")){const{url:c,external:l,download:d}=Se(o,$,k.hash);if(l||d)continue;const h=Q(o);h.reload||(h.preload_code===O.viewport&&a.observe(o),h.preload_code===O.eager&&ye(c))}}H.add(i),i()}function V(e,t){if(e instanceof ie)return e.body;const n=ee(e),r=_n(e);return k.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function Nn(e){if(typeof e=="function")ne.push(e);else{const{href:t}=new URL(e,location.href);ne.push(n=>n.href===t)}}function jn(){var t;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let r=!1;if(Ke(),!X){const a=Ne(b,void 0,null,"leave"),s={...a.navigation,cancel:()=>{r=!0,a.reject(new Error("navigation cancelled"))}};lt.forEach(i=>i(s))}r?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ke()}),(t=navigator.connection)!=null&&t.saveData||On(),x.addEventListener("click",async n=>{if(n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const r=ot(n.composedPath()[0],x);if(!r)return;const{url:a,external:s,target:i,download:o}=Se(r,$,k.hash);if(!a)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const c=Q(r);if(!(r instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||o)return;const[d,h]=(k.hash?a.hash.replace(/^#/,""):a.href).split("#"),y=d===me(location);if(s||c.reload&&(!y||!h)){_t({url:a,type:"link",event:n})?X=!0:n.preventDefault();return}if(h!==void 0&&y){const[,f]=b.url.href.split("#");if(f===h){if(n.preventDefault(),h===""||h==="top"&&r.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const p=r.ownerDocument.getElementById(decodeURIComponent(h));p&&(p.scrollIntoView(),p.focus())}return}if(G=!0,Le(A),e(a),!c.replace_state)return;G=!1}n.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await M({type:"link",url:a,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??a.href===location.href,event:n})}),x.addEventListener("submit",n=>{if(n.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(n.target),a=n.submitter;if(((a==null?void 0:a.formTarget)||r.target)==="_blank"||((a==null?void 0:a.formMethod)||r.method)!=="get")return;const o=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||r.action);if(fe(o,$,!1))return;const c=n.target,l=Q(c);if(l.reload)return;n.preventDefault(),n.stopPropagation();const d=new FormData(c,a);o.search=new URLSearchParams(d).toString(),M({type:"form",url:o,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??o.href===location.href,event:n})}),addEventListener("popstate",async n=>{var r;if(!Ae){if((r=n.state)!=null&&r[B]){const a=n.state[B];if(N={},a===A)return;const s=j[a],i=n.state[nt]??{},o=new URL(n.state[en]??location.href),c=n.state[z],l=b.url?me(location)===me(b.url):!1;if(c===L&&(ft||l)){i!==T.state&&(T.state=i),e(o),j[A]=le(),s&&scrollTo(s.x,s.y),A=a;return}const h=a-A;await M({type:"popstate",url:o,popped:{state:i,scroll:s,delta:h},accept:()=>{A=a,L=c},block:()=>{history.go(-h)},nav_token:N,event:n})}else if(!G){const a=new URL(location.href);e(a),k.hash&&location.reload()}}}),addEventListener("hashchange",()=>{G&&(G=!1,history.replaceState({...history.state,[B]:++A,[z]:L},"",location.href))});for(const n of document.querySelectorAll("link"))An.has(n.rel)&&(n.href=n.href);addEventListener("pageshow",n=>{n.persisted&&C.navigating.set(W.current=null)});function e(n){b.url=T.url=n,C.page.set(je(T)),C.page.notify()}}async function Dn(e,{status:t=200,error:n,node_ids:r,params:a,route:s,server_route:i,data:o,form:c}){xe=!0;const l=new URL(location.href);let d;({params:a={},route:s={id:null}}=await de(l,!1)||{}),d=$e.find(({id:f})=>f===s.id);let h,y=!0;try{const f=r.map(async(u,g)=>{const _=o[g];return _!=null&&_.uses&&(_.uses=vt(_.uses)),Pe({loader:k.nodes[u],url:l,params:a,route:s,parent:async()=>{const I={};for(let E=0;E<g;E+=1)Object.assign(I,(await f[E]).data);return I},server_data_node:Oe(_)})}),p=await Promise.all(f);if(d){const u=d.layouts;for(let g=0;g<u.length;g++)u[g]||p.splice(g,0,void 0)}h=oe({url:l,params:a,branch:p,status:t,error:n,form:c,route:d??null})}catch(f){if(f instanceof Re){await q(new URL(f.location,location.href));return}h=await ue({status:ee(f),error:await V(f,{url:l,params:a,route:s}),url:l,route:s}),e.textContent="",y=!1}h.props.page&&(h.props.page.state={}),pt(h,e,y)}async function yt(e,t){var s;const n=new URL(e);n.pathname=Sn(e.pathname),e.pathname.endsWith("/")&&n.searchParams.append(mn,"1"),n.searchParams.append(gn,t.map(i=>i?"1":"0").join(""));const r=window.fetch,a=await r(n.href,{});if(!a.ok){let i;throw(s=a.headers.get("content-type"))!=null&&s.includes("application/json")?i=await a.json():a.status===404?i="Not Found":a.status===500&&(i="Internal Error"),new ie(a.status,i)}return new Promise(async i=>{var h;const o=new Map,c=a.body.getReader();function l(y){return dn(y,{...k.decoders,Promise:f=>new Promise((p,u)=>{o.set(f,{fulfil:p,reject:u})})})}let d="";for(;;){const{done:y,value:f}=await c.read();if(y&&!d)break;for(d+=!f&&d?`
2
+ `:Mt.decode(f,{stream:!0});;){const p=d.indexOf(`
3
+ `);if(p===-1)break;const u=JSON.parse(d.slice(0,p));if(d=d.slice(p+1),u.type==="redirect")return i(u);if(u.type==="data")(h=u.nodes)==null||h.forEach(g=>{(g==null?void 0:g.type)==="data"&&(g.uses=vt(g.uses),g.data=l(g.data))}),i(u);else if(u.type==="chunk"){const{id:g,data:_,error:I}=u,E=o.get(g);o.delete(g),I?E.reject(l(I)):E.fulfil(l(_))}}}})}function vt(e){return{dependencies:new Set((e==null?void 0:e.dependencies)??[]),params:new Set((e==null?void 0:e.params)??[]),parent:!!(e!=null&&e.parent),route:!!(e!=null&&e.route),url:!!(e!=null&&e.url),search_params:new Set((e==null?void 0:e.search_params)??[])}}let Ae=!1;function Fn(e,t=null){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=bt(e);if(r&&document.getElementById(r)){const{x:s,y:i}=t??le();setTimeout(()=>{const o=history.state;Ae=!0,location.replace(`#${r}`),k.hash&&location.replace(e.hash),history.replaceState(o,"",e.hash),scrollTo(s,i),Ae=!1})}else{const s=document.body,i=s.getAttribute("tabindex");s.tabIndex=-1,s.focus({preventScroll:!0,focusVisible:!1}),i!==null?s.setAttribute("tabindex",i):s.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const s=[];for(let i=0;i<a.rangeCount;i+=1)s.push(a.getRangeAt(i));setTimeout(()=>{if(a.rangeCount===s.length){for(let i=0;i<a.rangeCount;i+=1){const o=s[i],c=a.getRangeAt(i);if(o.commonAncestorContainer!==c.commonAncestorContainer||o.startContainer!==c.startContainer||o.endContainer!==c.endContainer||o.startOffset!==c.startOffset||o.endOffset!==c.endOffset)return}a.removeAllRanges()}})}}}function Ne(e,t,n,r){var c,l;let a,s;const i=new Promise((d,h)=>{a=d,s=h});return i.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:((c=e.route)==null?void 0:c.id)??null},url:e.url},to:n&&{params:(t==null?void 0:t.params)??null,route:{id:((l=t==null?void 0:t.route)==null?void 0:l.id)??null},url:n},willUnload:!t,type:r,complete:i},fulfil:a,reject:s}}function je(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function Bn(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function bt(e){let t;if(k.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{Kn as a,qn as l,C as s};
hfstudio/static/_app/immutable/chunks/BF3xBGh8.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 l=[],s=Math.max(n.dirty.length,r.length);for(let u=0;u<s;u+=1)l[u]=n.dirty[u]|r[u];return l}return n.dirty|r}return n.dirty}function wt(t,n,e,i,r,l){if(r){const s=G(n,e,i,l);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 o=0;o<n.length;o++){const f=n[o];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 o=n[c].claim_order,f=(r>0&&n[e[r]].claim_order<=o?r+1:et(1,r,b=>n[e[b]].claim_order,o))-1;i[c]=e[f]+1;const a=f+1;e[a]=c,r=Math.max(a,r)}const l=[],s=[];let u=n.length-1;for(let c=e[r]+1;c!=0;c=i[c-1]){for(l.push(n[c-1]);u>=c;u--)s.push(n[u]);u--}for(;u>=0;u--)s.push(n[u]);l.reverse(),s.sort((c,o)=>c.claim_order-o.claim_order);for(let c=0,o=0;c<s.length;c++){for(;o<l.length&&s[c].claim_order>=l[o].claim_order;)o++;const f=o<l.length?l[o]: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 I(t){return document.createElement(t)}function U(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function H(t){return document.createTextNode(t)}function Mt(){return H(" ")}function St(){return H("")}function Ht(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 l=(()=>{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 l.claim_order=t.claim_info.total_claimed,t.claim_info.total_claimed+=1,l}function R(t,n,e,i){return F(t,r=>r.nodeName===n,r=>{const l=[];for(let s=0;s<r.attributes.length;s++){const u=r.attributes[s];e[u.name]||l.push(u.name)}l.forEach(s=>r.removeAttribute(s))},()=>i(n))}function Pt(t,n,e){return R(t,n,e,I)}function Bt(t,n,e){return R(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},()=>H(n),!0)}function Dt(t){return ut(t," ")}function P(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=P(t,"HTML_TAG_START",0),i=P(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 l=r.slice(1,r.length-1);if(l.length===0)return new A(n);for(const s of l)s.claim_order=t.claim_info.total_claimed,t.claim_info.total_claimed+=1;return new A(n,l)}function qt(t,n){n=""+n,t.data!==n&&(t.data=n)}function Gt(t,n){t.value=n??""}function It(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})}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=I(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 Ut(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 zt(t){_().$$.before_update.push(t)}function Ft(t){_().$$.on_mount.push(t)}function Rt(t){_().$$.after_update.push(t)}function Wt(t){_().$$.on_destroy.push(t)}function Jt(){const t=_();return(n,e,{cancelable:i=!1}={})=>{const r=t.$$.callbacks[n];if(r){const l=at(n,e,{cancelable:i});return r.slice().forEach(s=>{s.call(t,l)}),!l.defaultPrevented}return!0}}function Kt(t,n){return _().$$.context.set(t,n),n}function Qt(t){return _().$$.context.get(t)}function Vt(){return _().$$.context}function Xt(t){return _().$$.context.has(t)}const p=[],B=[];let g=[];const D=[],W=Promise.resolve();let M=!1;function J(){M||(M=!0,W.then(K))}function Yt(){return J(),W}function S(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;B.length;)B.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(;D.length;)D.pop()();M=!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(S)}}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 Zt(){h={r:0,c:[],p:h}}function tn(){h.r||$(h.c),h=h.p}function ht(t,n){t&&t.i&&(v.delete(t),t.i(n))}function nn(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 en(t){t&&t.c()}function rn(t,n){t&&t.l(n)}function mt(t,n,e){const{fragment:i,after_update:r}=t.$$;i&&i.m(n,e),S(()=>{const l=t.$$.on_mount.map(O).filter(q);t.$$.on_destroy?t.$$.on_destroy.push(...l):$(l),t.$$.on_mount=[]}),r.forEach(S)}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 sn(t,n,e,i,r,l,s=null,u=[-1]){const c=x;y(t);const o=t.$$={fragment:null,ctx:[],props:l,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(o.root);let f=!1;if(o.ctx=e?e(t,n.props||{},(a,b,...L)=>{const j=L.length?L[0]:b;return o.ctx&&r(o.ctx[a],o.ctx[a]=j)&&(!o.skip_bound&&o.bound[a]&&o.bound[a](j),f&&gt(t,a)),b}):[],o.update(),f=!0,$(o.before_update),o.fragment=i?i(o.ctx):!1,n.target){if(n.hydrate){tt();const a=lt(n.target);o.fragment&&o.fragment.l(a),a.forEach(T)}else o.fragment&&o.fragment.c();n.intro&&ht(t.$$.fragment),mt(t,n.target,n.anchor),nt(),K()}y(c)}class cn{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{Vt as $,w as A,bt as B,Zt as C,tn as D,St as E,Rt as F,Yt as G,Ut as H,pt as I,en as J,mt as K,rn as L,It as M,B as N,X as O,Ct as P,Lt as Q,Bt as R,cn as S,U as T,At as U,Nt as V,kt as W,Ot as X,A as Y,zt as Z,Jt as _,ht as a,Qt as a0,Xt as a1,Wt as a2,Kt as a3,ot as b,Et as c,T as d,vt as e,ct as f,Tt as g,rt as h,sn as i,$t as j,Pt as k,Ht as l,lt as m,jt as n,Dt as o,I as p,Mt as q,$ as r,xt as s,nn as t,wt as u,Ft as v,Gt as w,qt as x,ut as y,H as z};
hfstudio/static/_app/immutable/entry/app.pFM9bQvm.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.U6IiQMTM.js","../chunks/BF3xBGh8.js","../chunks/IHki7fMi.js","../assets/0.DBGxRMBA.css","../nodes/1.CKAL1QFH.js","../chunks/58WuCvUx.js","../nodes/2.BRSGXII6.js","../assets/2.NHOETQX0.css"])))=>i.map(i=>d[i]);
2
+ import{S as V,i as j,s as B,d,t as h,a as g,C as S,D as O,f as v,o as U,E as w,q as z,F,v as G,G as H,H as y,I as P,J as R,K as L,L as I,b as A,M as p,k as J,m as K,p as W,N as C,x as Q,y as X,z as Y}from"../chunks/BF3xBGh8.js";import"../chunks/IHki7fMi.js";const Z="modulepreload",M=function(o,e){return new URL(o,e).href},N={},D=function(e,n,i){let r=Promise.resolve();if(n&&n.length>0){const t=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));r=Promise.allSettled(n.map(f=>{if(f=M(f,i),f in N)return;N[f]=!0;const l=f.endsWith(".css"),_=l?'[rel="stylesheet"]':"";if(!!i)for(let k=t.length-1;k>=0;k--){const E=t[k];if(E.href===f&&(!l||E.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${_}`))return;const m=document.createElement("link");if(m.rel=l?"stylesheet":Z,l||(m.as="script"),m.crossOrigin="",m.href=f,a&&m.setAttribute("nonce",a),document.head.appendChild(m),l)return new Promise((k,E)=>{m.addEventListener("load",k),m.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${f}`)))})}))}function u(t){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=t,window.dispatchEvent(s),!s.defaultPrevented)throw t}return r.then(t=>{for(const s of t||[])s.status==="rejected"&&u(s.reason);return e().catch(u)})},ae={};function $(o){let e,n,i;var r=o[2][0];function u(t,s){return{props:{data:t[4],form:t[3],params:t[1].params}}}return r&&(e=y(r,u(o)),o[12](e)),{c(){e&&R(e.$$.fragment),n=w()},l(t){e&&I(e.$$.fragment,t),n=w()},m(t,s){e&&L(e,t,s),v(t,n,s),i=!0},p(t,s){if(s&4&&r!==(r=t[2][0])){if(e){S();const a=e;h(a.$$.fragment,1,0,()=>{P(a,1)}),O()}r?(e=y(r,u(t)),t[12](e),R(e.$$.fragment),g(e.$$.fragment,1),L(e,n.parentNode,n)):e=null}else if(r){const a={};s&16&&(a.data=t[4]),s&8&&(a.form=t[3]),s&2&&(a.params=t[1].params),e.$set(a)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&h(e.$$.fragment,t),i=!1},d(t){t&&d(n),o[12](null),e&&P(e,t)}}}function x(o){let e,n,i;var r=o[2][0];function u(t,s){return{props:{data:t[4],params:t[1].params,$$slots:{default:[ee]},$$scope:{ctx:t}}}}return r&&(e=y(r,u(o)),o[11](e)),{c(){e&&R(e.$$.fragment),n=w()},l(t){e&&I(e.$$.fragment,t),n=w()},m(t,s){e&&L(e,t,s),v(t,n,s),i=!0},p(t,s){if(s&4&&r!==(r=t[2][0])){if(e){S();const a=e;h(a.$$.fragment,1,0,()=>{P(a,1)}),O()}r?(e=y(r,u(t)),t[11](e),R(e.$$.fragment),g(e.$$.fragment,1),L(e,n.parentNode,n)):e=null}else if(r){const a={};s&16&&(a.data=t[4]),s&2&&(a.params=t[1].params),s&8239&&(a.$$scope={dirty:s,ctx:t}),e.$set(a)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&h(e.$$.fragment,t),i=!1},d(t){t&&d(n),o[11](null),e&&P(e,t)}}}function ee(o){let e,n,i;var r=o[2][1];function u(t,s){return{props:{data:t[5],form:t[3],params:t[1].params}}}return r&&(e=y(r,u(o)),o[10](e)),{c(){e&&R(e.$$.fragment),n=w()},l(t){e&&I(e.$$.fragment,t),n=w()},m(t,s){e&&L(e,t,s),v(t,n,s),i=!0},p(t,s){if(s&4&&r!==(r=t[2][1])){if(e){S();const a=e;h(a.$$.fragment,1,0,()=>{P(a,1)}),O()}r?(e=y(r,u(t)),t[10](e),R(e.$$.fragment),g(e.$$.fragment,1),L(e,n.parentNode,n)):e=null}else if(r){const a={};s&32&&(a.data=t[5]),s&8&&(a.form=t[3]),s&2&&(a.params=t[1].params),e.$set(a)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&h(e.$$.fragment,t),i=!1},d(t){t&&d(n),o[10](null),e&&P(e,t)}}}function q(o){let e,n=o[7]&&T(o);return{c(){e=W("div"),n&&n.c(),this.h()},l(i){e=J(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var r=K(e);n&&n.l(r),r.forEach(d),this.h()},h(){A(e,"id","svelte-announcer"),A(e,"aria-live","assertive"),A(e,"aria-atomic","true"),p(e,"position","absolute"),p(e,"left","0"),p(e,"top","0"),p(e,"clip","rect(0 0 0 0)"),p(e,"clip-path","inset(50%)"),p(e,"overflow","hidden"),p(e,"white-space","nowrap"),p(e,"width","1px"),p(e,"height","1px")},m(i,r){v(i,e,r),n&&n.m(e,null)},p(i,r){i[7]?n?n.p(i,r):(n=T(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&d(e),n&&n.d()}}}function T(o){let e;return{c(){e=Y(o[8])},l(n){e=X(n,o[8])},m(n,i){v(n,e,i)},p(n,i){i&256&&Q(e,n[8])},d(n){n&&d(e)}}}function te(o){let e,n,i,r,u;const t=[x,$],s=[];function a(l,_){return l[2][1]?0:1}e=a(o),n=s[e]=t[e](o);let f=o[6]&&q(o);return{c(){n.c(),i=z(),f&&f.c(),r=w()},l(l){n.l(l),i=U(l),f&&f.l(l),r=w()},m(l,_){s[e].m(l,_),v(l,i,_),f&&f.m(l,_),v(l,r,_),u=!0},p(l,[_]){let b=e;e=a(l),e===b?s[e].p(l,_):(S(),h(s[b],1,1,()=>{s[b]=null}),O(),n=s[e],n?n.p(l,_):(n=s[e]=t[e](l),n.c()),g(n,1),n.m(i.parentNode,i)),l[6]?f?f.p(l,_):(f=q(l),f.c(),f.m(r.parentNode,r)):f&&(f.d(1),f=null)},i(l){u||(g(n),u=!0)},o(l){h(n),u=!1},d(l){l&&(d(i),d(r)),s[e].d(l),f&&f.d(l)}}}function ne(o,e,n){let{stores:i}=e,{page:r}=e,{constructors:u}=e,{components:t=[]}=e,{form:s}=e,{data_0:a=null}=e,{data_1:f=null}=e;F(i.page.notify);let l=!1,_=!1,b=null;G(()=>{const c=i.page.subscribe(()=>{l&&(n(7,_=!0),H().then(()=>{n(8,b=document.title||"untitled page")}))});return n(6,l=!0),c});function m(c){C[c?"unshift":"push"](()=>{t[1]=c,n(0,t)})}function k(c){C[c?"unshift":"push"](()=>{t[0]=c,n(0,t)})}function E(c){C[c?"unshift":"push"](()=>{t[0]=c,n(0,t)})}return o.$$set=c=>{"stores"in c&&n(9,i=c.stores),"page"in c&&n(1,r=c.page),"constructors"in c&&n(2,u=c.constructors),"components"in c&&n(0,t=c.components),"form"in c&&n(3,s=c.form),"data_0"in c&&n(4,a=c.data_0),"data_1"in c&&n(5,f=c.data_1)},o.$$.update=()=>{o.$$.dirty&514&&i.page.set(r)},[t,r,u,s,a,f,l,_,b,i,m,k,E]}class le extends V{constructor(e){super(),j(this,e,ne,te,B,{stores:9,page:1,constructors:2,components:0,form:3,data_0:4,data_1:5})}}const fe=[()=>D(()=>import("../nodes/0.U6IiQMTM.js"),__vite__mapDeps([0,1,2,3]),import.meta.url),()=>D(()=>import("../nodes/1.CKAL1QFH.js"),__vite__mapDeps([4,1,2,5]),import.meta.url),()=>D(()=>import("../nodes/2.BRSGXII6.js"),__vite__mapDeps([6,1,2,7]),import.meta.url)],ce=[],ue={"/":[2]},se={handleError:({error:o})=>{console.error(o)},reroute:()=>{},transport:{}},ie=Object.fromEntries(Object.entries(se.transport).map(([o,e])=>[o,e.decode])),_e=!1,me=(o,e)=>ie[o](e);export{me as decode,ie as decoders,ue as dictionary,_e as hash,se as hooks,ae as matchers,fe as nodes,le as root,ce as server_loads};
hfstudio/static/_app/immutable/entry/start.CSDWo18g.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{l as o,a as r}from"../chunks/58WuCvUx.js";export{o as load_css,r as start};
hfstudio/static/_app/immutable/nodes/0.U6IiQMTM.js ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import{S as Se,i as Ce,s as Le,c as He,d as x,r as Te,t as Ee,a as Me,b as r,u as Ne,g as Ue,e as Ae,f as $,h as s,l as le,j as Pe,k as u,m as A,n as H,o as w,p as f,q as y,v as De,w as xe,x as me,y as te,z as se,A as Be}from"../chunks/BF3xBGh8.js";import"../chunks/IHki7fMi.js";function Oe(c){let t,e="Sign In";return{c(){t=f("span"),t.textContent=e},l(n){t=u(n,"SPAN",{"data-svelte-h":!0}),H(t)!=="svelte-6n3gky"&&(t.textContent=e)},m(n,h){$(n,t,h)},p:Be,d(n){n&&x(t)}}}function je(c){let t,e,n,h;return{c(){t=f("span"),e=se("Sign out ("),n=se(c[2]),h=se(")")},l(k){t=u(k,"SPAN",{});var o=A(t);e=te(o,"Sign out ("),n=te(o,c[2]),h=te(o,")"),o.forEach(x)},m(k,o){$(k,t,o),s(t,e),s(t,n),s(t,h)},p(k,o){o&4&&me(n,k[2])},d(k){k&&x(t)}}}function Ve(c){let t,e,n=c[1]?"logged in":"not logged in",h,k;return{c(){t=f("span"),e=se("Checking... ("),h=se(n),k=se(")")},l(o){t=u(o,"SPAN",{});var m=A(t);e=te(m,"Checking... ("),h=te(m,n),k=te(m,")"),m.forEach(x)},m(o,m){$(o,t,m),s(t,e),s(t,h),s(t,k)},p(o,m){m&2&&n!==(n=o[1]?"logged in":"not logged in")&&me(h,n)},d(o){o&&x(t)}}}function ke(c){let t,e='<div class="bg-blue-600 text-white text-sm rounded-lg p-3 shadow-lg relative"><div class="flex items-start gap-2"><svg class="w-4 h-4 mt-0.5 flex-shrink-0" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd"></path></svg> <div><p class="font-medium">Sign in required</p> <p class="text-blue-100 text-xs mt-1">You need to sign in to use HuggingFace Inference Providers for text-to-speech generation.</p></div></div> <div class="absolute top-full left-1/2 transform -translate-x-1/2"><div class="w-0 h-0 border-l-4 border-r-4 border-t-4 border-l-transparent border-r-transparent border-t-blue-600"></div></div></div>';return{c(){t=f("div"),t.innerHTML=e,this.h()},l(n){t=u(n,"DIV",{class:!0,"data-svelte-h":!0}),H(t)!=="svelte-drpr74"&&(t.innerHTML=e),this.h()},h(){r(t,"class","absolute bottom-full left-0 right-0 mb-2 z-50")},m(n,h){$(n,t,h)},d(n){n&&x(t)}}}function we(c){let t,e,n,h="Sign In with HuggingFace Token",k,o,m,Q="<strong>Manual Token Entry:</strong> Please enter your HuggingFace token.",v,d,E=`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 &quot;Inference API&quot; permissions<br/>
3
+ 3. Copy and paste it below`,Y,z,p,I,F="HuggingFace Token",J,b,q,W,T,P,K="Cancel",D,j,X="Sign In",l,_,i=c[7]&&ye(),a=c[6]&&Ie(c);return{c(){t=f("div"),e=f("div"),n=f("h2"),n.textContent=h,k=y(),o=f("div"),m=f("p"),m.innerHTML=Q,v=y(),d=f("p"),d.innerHTML=E,Y=y(),i&&i.c(),z=y(),p=f("div"),I=f("label"),I.textContent=F,J=y(),b=f("input"),q=y(),a&&a.c(),W=y(),T=f("div"),P=f("button"),P.textContent=K,D=y(),j=f("button"),j.textContent=X,this.h()},l(S){t=u(S,"DIV",{class:!0});var G=A(t);e=u(G,"DIV",{class:!0});var L=A(e);n=u(L,"H2",{class:!0,"data-svelte-h":!0}),H(n)!=="svelte-1t0ehet"&&(n.textContent=h),k=w(L),o=u(L,"DIV",{class:!0});var C=A(o);m=u(C,"P",{class:!0,"data-svelte-h":!0}),H(m)!=="svelte-344vn4"&&(m.innerHTML=Q),v=w(C),d=u(C,"P",{class:!0,"data-svelte-h":!0}),H(d)!=="svelte-1ffvpx3"&&(d.innerHTML=E),Y=w(C),i&&i.l(C),C.forEach(x),z=w(L),p=u(L,"DIV",{class:!0});var B=A(p);I=u(B,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),H(I)!=="svelte-vtbmxo"&&(I.textContent=F),J=w(B),b=u(B,"INPUT",{id:!0,type:!0,placeholder:!0,class:!0}),q=w(B),a&&a.l(B),B.forEach(x),W=w(L),T=u(L,"DIV",{class:!0});var ee=A(T);P=u(ee,"BUTTON",{class:!0,"data-svelte-h":!0}),H(P)!=="svelte-csk0rj"&&(P.textContent=K),D=w(ee),j=u(ee,"BUTTON",{class:!0,"data-svelte-h":!0}),H(j)!=="svelte-1nxas5u"&&(j.textContent=X),ee.forEach(x),L.forEach(x),G.forEach(x),this.h()},h(){r(n,"class","text-xl font-semibold mb-4"),r(m,"class","text-blue-800 mb-2"),r(d,"class","text-blue-700"),r(o,"class","mb-4 p-3 bg-blue-50 rounded-md text-sm"),r(I,"for","token"),r(I,"class","block text-sm font-medium text-gray-700 mb-2"),r(b,"id","token"),r(b,"type","password"),r(b,"placeholder","hf_..."),r(b,"class","w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-orange-500 focus:border-transparent"),r(p,"class","mb-4"),r(P,"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(T,"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(S,G){$(S,t,G),s(t,e),s(e,n),s(e,k),s(e,o),s(o,m),s(o,v),s(o,d),s(o,Y),i&&i.m(o,null),s(e,z),s(e,p),s(p,I),s(p,J),s(p,b),xe(b,c[5]),s(p,q),a&&a.m(p,null),s(e,W),s(e,T),s(T,P),s(T,D),s(T,j),l||(_=[le(b,"input",c[15]),le(b,"keydown",c[16]),le(P,"click",c[10]),le(j,"click",c[11])],l=!0)},p(S,G){S[7]?i||(i=ye(),i.c(),i.m(o,null)):i&&(i.d(1),i=null),G&32&&b.value!==S[5]&&xe(b,S[5]),S[6]?a?a.p(S,G):(a=Ie(S),a.c(),a.m(p,null)):a&&(a.d(1),a=null)},d(S){S&&x(t),i&&i.d(),a&&a.d(),l=!1,Te(_)}}}function ye(c){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=f("p"),t.innerHTML=e,this.h()},l(n){t=u(n,"P",{class:!0,"data-svelte-h":!0}),H(t)!=="svelte-1gg2uwy"&&(t.innerHTML=e),this.h()},h(){r(t,"class","text-blue-600 mt-2")},m(n,h){$(n,t,h)},d(n){n&&x(t)}}}function Ie(c){let t,e;return{c(){t=f("p"),e=se(c[6]),this.h()},l(n){t=u(n,"P",{class:!0});var h=A(t);e=te(h,c[6]),h.forEach(x),this.h()},h(){r(t,"class","text-red-600 text-sm mt-1")},m(n,h){$(n,t,h),s(t,e)},p(n,h){h&64&&me(e,n[6])},d(n){n&&x(t)}}}function ze(c){let t,e,n,h='<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>',k,o,m,Q="Tasks",v,d,E,Y="πŸŽ™οΈ",z,p,I="Text to Speech",F,J,b,q="<span>🎡</span> <span>Voice Cloning</span>",W,T,P="<span>🎧</span> <span>Speech to Text</span>",K,D,j="<span>🎼</span> <span>Sound Effects</span>",X,l,_="<span>🎸</span> <span>Music Generation</span>",i,a,S="<span>πŸ”Š</span> <span>Audio Enhancement</span>",G,L,C,B,ee,ue,fe,de,ne,he,Z,pe,_e;function be(g,N){return g[3]?Ve:g[1]?je:Oe}let ae=be(c),R=ae(c),U=c[8]&&!c[1]&&ke();const ge=c[13].default,V=He(ge,c,c[12],null);let M=c[4]&&we(c);return{c(){t=f("div"),e=f("aside"),n=f("div"),n.innerHTML=h,k=y(),o=f("nav"),m=f("div"),m.textContent=Q,v=y(),d=f("button"),E=f("span"),E.textContent=Y,z=y(),p=f("span"),p.textContent=I,J=y(),b=f("button"),b.innerHTML=q,W=y(),T=f("button"),T.innerHTML=P,K=y(),D=f("button"),D.innerHTML=j,X=y(),l=f("button"),l.innerHTML=_,i=y(),a=f("button"),a.innerHTML=S,G=y(),L=f("div"),C=f("button"),B=f("img"),ue=y(),R.c(),fe=y(),U&&U.c(),de=y(),ne=f("main"),V&&V.c(),he=y(),M&&M.c(),this.h()},l(g){t=u(g,"DIV",{class:!0});var N=A(t);e=u(N,"ASIDE",{class:!0});var oe=A(e);n=u(oe,"DIV",{class:!0,"data-svelte-h":!0}),H(n)!=="svelte-1vahj38"&&(n.innerHTML=h),k=w(oe),o=u(oe,"NAV",{class:!0});var O=A(o);m=u(O,"DIV",{class:!0,"data-svelte-h":!0}),H(m)!=="svelte-1x5465q"&&(m.textContent=Q),v=w(O),d=u(O,"BUTTON",{class:!0});var re=A(d);E=u(re,"SPAN",{"data-svelte-h":!0}),H(E)!=="svelte-1yx42xi"&&(E.textContent=Y),z=w(re),p=u(re,"SPAN",{"data-svelte-h":!0}),H(p)!=="svelte-2j89jk"&&(p.textContent=I),re.forEach(x),J=w(O),b=u(O,"BUTTON",{class:!0,"data-svelte-h":!0}),H(b)!=="svelte-10dl8nf"&&(b.innerHTML=q),W=w(O),T=u(O,"BUTTON",{class:!0,"data-svelte-h":!0}),H(T)!=="svelte-wf0x5d"&&(T.innerHTML=P),K=w(O),D=u(O,"BUTTON",{class:!0,"data-svelte-h":!0}),H(D)!=="svelte-x7bha3"&&(D.innerHTML=j),X=w(O),l=u(O,"BUTTON",{class:!0,"data-svelte-h":!0}),H(l)!=="svelte-1tyblmt"&&(l.innerHTML=_),i=w(O),a=u(O,"BUTTON",{class:!0,"data-svelte-h":!0}),H(a)!=="svelte-1emrjb3"&&(a.innerHTML=S),O.forEach(x),G=w(oe),L=u(oe,"DIV",{class:!0});var ce=A(L);C=u(ce,"BUTTON",{class:!0});var ie=A(C);B=u(ie,"IMG",{src:!0,alt:!0,class:!0}),ue=w(ie),R.l(ie),ie.forEach(x),fe=w(ce),U&&U.l(ce),ce.forEach(x),oe.forEach(x),de=w(N),ne=u(N,"MAIN",{class:!0});var ve=A(ne);V&&V.l(ve),ve.forEach(x),he=w(N),M&&M.l(N),N.forEach(x),this.h()},h(){r(n,"class","p-4 border-b border-gray-200"),r(m,"class","mt-2 mb-1 px-2 text-xs font-medium text-gray-500 uppercase"),r(d,"class",F="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left "+(c[0]==="tts"?"bg-gray-100":"")),r(b,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),b.disabled=!0,r(T,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),T.disabled=!0,r(D,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),D.disabled=!0,r(l,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),l.disabled=!0,r(a,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),a.disabled=!0,r(o,"class","p-2 text-sm flex-1"),Pe(B.src,ee="/assets/hf-logo.png")||r(B,"src",ee),r(B,"alt","HF Logo"),r(B,"class","w-5 h-5"),C.disabled=c[3],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(L,"class","p-2 relative"),r(e,"class","w-56 border-r border-gray-200 bg-white flex-shrink-0 flex flex-col h-full "),r(ne,"class","flex-1 overflow-auto"),r(t,"class","flex h-screen bg-white")},m(g,N){$(g,t,N),s(t,e),s(e,n),s(e,k),s(e,o),s(o,m),s(o,v),s(o,d),s(d,E),s(d,z),s(d,p),s(o,J),s(o,b),s(o,W),s(o,T),s(o,K),s(o,D),s(o,X),s(o,l),s(o,i),s(o,a),s(e,G),s(e,L),s(L,C),s(C,B),s(C,ue),R.m(C,null),s(L,fe),U&&U.m(L,null),s(t,de),s(t,ne),V&&V.m(ne,null),s(t,he),M&&M.m(t,null),Z=!0,pe||(_e=[le(d,"click",c[14]),le(C,"click",c[9])],pe=!0)},p(g,[N]){(!Z||N&1&&F!==(F="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left "+(g[0]==="tts"?"bg-gray-100":"")))&&r(d,"class",F),ae===(ae=be(g))&&R?R.p(g,N):(R.d(1),R=ae(g),R&&(R.c(),R.m(C,null))),(!Z||N&8)&&(C.disabled=g[3]),g[8]&&!g[1]?U||(U=ke(),U.c(),U.m(L,null)):U&&(U.d(1),U=null),V&&V.p&&(!Z||N&4096)&&Ne(V,ge,g,g[12],Z?Ae(ge,g[12],N,null):Ue(g[12]),null),g[4]?M?M.p(g,N):(M=we(g),M.c(),M.m(t,null)):M&&(M.d(1),M=null)},i(g){Z||(Me(V,g),Z=!0)},o(g){Ee(V,g),Z=!1},d(g){g&&x(t),R.d(),U&&U.d(),V&&V.d(g),M&&M.d(),pe=!1,Te(_e)}}}function Fe(c,t,e){let{$$slots:n={},$$scope:h}=t,k="tts";const o=typeof window<"u"?localStorage.getItem("hf_access_token"):null,m=typeof window<"u"?localStorage.getItem("hf_cached_token"):null,Q=typeof window<"u"?localStorage.getItem("hf_user_info"):null;let v=!1,d="",E=!1,Y=!1;if(o&&o===m&&Q)try{const l=JSON.parse(Q);v=!0,d=l.username,Y=!0}catch{E=!0}else o&&(E=!0);let z=!1,p="",I="",F=!1,J=!1;De(()=>{window.addEventListener("show-signin-popover",()=>{e(8,J=!0),setTimeout(()=>{e(8,J=!1)},4e3)}),!Y&&o?(b(),q()):o||b(),document.addEventListener("visibilitychange",()=>{document.hidden||q()}),window.addEventListener("storage",q);const l=setInterval(q,1e3);return()=>{window.removeEventListener("storage",q),clearInterval(l)}});async function b(){if(!(v&&Y)){e(3,E=!0);try{const _=await(await fetch("/api/auth/local-token")).json();_.available?(e(7,F=!0),localStorage.setItem("hf_access_token",_.token),_.user_info&&_.user_info.name!=="Local User"?(e(1,v=!0),e(2,d=_.user_info.name.split(" ")[0])):(e(1,v=!0),e(2,d="Local User"))):e(7,F=!1)}catch{e(7,F=!1)}finally{e(3,E=!1)}}}function q(){const l=localStorage.getItem("hf_access_token"),_=localStorage.getItem("hf_user_info"),i=localStorage.getItem("hf_cached_token");if(l){if(l===i&&_)try{const a=JSON.parse(_);e(1,v=!0),e(2,d=a.username);return}catch{}(!v||l!==i)&&W(l)}else e(1,v=!1),e(2,d=""),localStorage.removeItem("hf_user_info"),localStorage.removeItem("hf_cached_token")}async function W(l){e(3,E=!0);try{const _=await fetch("https://huggingface.co/api/whoami-v2",{headers:{Authorization:`Bearer ${l}`}});if(_.ok){const i=await _.json();e(1,v=!0);const a=i.name||i.fullname||i.login||i.username||"User";e(2,d=a.split(" ")[0]);const S={username:d,fullName:a};localStorage.setItem("hf_user_info",JSON.stringify(S)),localStorage.setItem("hf_cached_token",l)}else localStorage.removeItem("hf_access_token"),localStorage.removeItem("hf_user_info"),localStorage.removeItem("hf_cached_token"),e(1,v=!1),e(2,d="")}catch{const i=localStorage.getItem("hf_user_info");if(i)try{const a=JSON.parse(i);e(1,v=!0),e(2,d=a.username);return}catch{}localStorage.removeItem("hf_access_token"),localStorage.removeItem("hf_user_info"),localStorage.removeItem("hf_cached_token"),e(1,v=!1),e(2,d="")}finally{e(3,E=!1)}}async function T(){if(v)localStorage.removeItem("hf_access_token"),localStorage.removeItem("hf_user_info"),localStorage.removeItem("hf_cached_token"),sessionStorage.removeItem("oauth_state"),e(1,v=!1),e(2,d="");else if(window.location.hostname.includes("hf.space")||window.location.hostname.includes("huggingface.co"))try{const _=await(await fetch("/api/auth/oauth-config")).json(),i=_.scopes||"read-repos write-repos manage-repos inference-api",a=`https://huggingface.co/oauth/authorize?client_id=${_.client_id}&redirect_uri=${encodeURIComponent(window.location.origin+"/auth/callback")}&scope=${encodeURIComponent(i)}&response_type=code&state=${Date.now()}`;window.location.href=a}catch{e(4,z=!0),e(5,p=""),e(6,I="")}else e(4,z=!0),e(5,p=""),e(6,I="")}function P(){e(4,z=!1),e(5,p=""),e(6,I="")}async function K(){if(!p.trim()){e(6,I="Please enter a token");return}if(!p.startsWith("hf_")){e(6,I='Token should start with "hf_"');return}try{const l=await fetch("https://huggingface.co/api/whoami-v2",{headers:{Authorization:`Bearer ${p.trim()}`}});if(l.ok){const _=await l.json(),i=p.trim();localStorage.setItem("hf_access_token",i),e(1,v=!0);const a=_.name||_.fullname||_.login||_.username||"User";e(2,d=a.split(" ")[0]);const S={username:d,fullName:a};localStorage.setItem("hf_user_info",JSON.stringify(S)),localStorage.setItem("hf_cached_token",i),P()}else e(6,I=`Invalid token (${l.status}). Please check your token and try again.`)}catch{e(6,I="Error validating token. Please try again.")}}const D=()=>e(0,k="tts");function j(){p=this.value,e(5,p)}const X=l=>l.key==="Enter"&&K();return c.$$set=l=>{"$$scope"in l&&e(12,h=l.$$scope)},[k,v,d,E,z,p,I,F,J,T,P,K,h,n,D,j,X]}class Ge extends Se{constructor(t){super(),Ce(this,t,Fe,ze,Le,{})}}export{Ge as component};
hfstudio/static/_app/immutable/nodes/1.CKAL1QFH.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{S as x,i as S,s as q,A as _,d as u,x as d,f as m,h as f,k as g,m as h,y as v,o as y,p as $,z as E,q as k,B as z}from"../chunks/BF3xBGh8.js";import"../chunks/IHki7fMi.js";import{s as A}from"../chunks/58WuCvUx.js";const B=()=>{const s=A;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},C={subscribe(s){return B().page.subscribe(s)}};function H(s){var b;let t,r=s[0].status+"",o,n,i,p=((b=s[0].error)==null?void 0:b.message)+"",l;return{c(){t=$("h1"),o=E(r),n=k(),i=$("p"),l=E(p)},l(e){t=g(e,"H1",{});var a=h(t);o=v(a,r),a.forEach(u),n=y(e),i=g(e,"P",{});var c=h(i);l=v(c,p),c.forEach(u)},m(e,a){m(e,t,a),f(t,o),m(e,n,a),m(e,i,a),f(i,l)},p(e,[a]){var c;a&1&&r!==(r=e[0].status+"")&&d(o,r),a&1&&p!==(p=((c=e[0].error)==null?void 0:c.message)+"")&&d(l,p)},i:_,o:_,d(e){e&&(u(t),u(n),u(i))}}}function P(s,t,r){let o;return z(s,C,n=>r(0,o=n)),[o]}let F=class extends x{constructor(t){super(),S(this,t,P,H,q,{})}};export{F as component};
hfstudio/static/_app/immutable/nodes/2.BRSGXII6.js ADDED
The diff for this file is too large to render. See raw diff
 
hfstudio/static/_app/version.json CHANGED
@@ -1 +1 @@
1
- {"version":"1761002803294"}
 
1
+ {"version":"1761004481087"}
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.jSrgKXDc.js">
10
- <link rel="modulepreload" href="/_app/immutable/chunks/Ybk50QWZ.js">
11
- <link rel="modulepreload" href="/_app/immutable/chunks/Bqgpa-5T.js">
12
- <link rel="modulepreload" href="/_app/immutable/entry/app.Dgwf8cL2.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_37vzbm = {
20
  base: ""
21
  };
22
 
23
  const element = document.currentScript.parentElement;
24
 
25
  Promise.all([
26
- import("/_app/immutable/entry/start.jSrgKXDc.js"),
27
- import("/_app/immutable/entry/app.Dgwf8cL2.js")
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.CSDWo18g.js">
10
+ <link rel="modulepreload" href="/_app/immutable/chunks/58WuCvUx.js">
11
+ <link rel="modulepreload" href="/_app/immutable/chunks/BF3xBGh8.js">
12
+ <link rel="modulepreload" href="/_app/immutable/entry/app.pFM9bQvm.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_7hn0aa = {
20
  base: ""
21
  };
22
 
23
  const element = document.currentScript.parentElement;
24
 
25
  Promise.all([
26
+ import("/_app/immutable/entry/start.CSDWo18g.js"),
27
+ import("/_app/immutable/entry/app.pFM9bQvm.js")
28
  ]).then(([kit, app]) => {
29
  kit.start(app, element);
30
  });