image-sprout 1.0.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +111 -3
- package/dist/app/assets/index-Cs3-aG7c.css +1 -0
- package/dist/app/assets/index-CxqTB59Z.js +3 -0
- package/dist/app/index.html +2 -2
- package/dist/cli/index.js +112 -49
- package/package.json +5 -1
- package/dist/app/assets/index-C7ombVWN.css +0 -1
- package/dist/app/assets/index-Yj_7qKUG.js +0 -3
package/README.md
CHANGED
|
@@ -67,6 +67,30 @@ npm install
|
|
|
67
67
|
|
|
68
68
|
From the repo checkout, you can run the app with the local scripts or run the built CLI directly.
|
|
69
69
|
|
|
70
|
+
### Install As An Agent Skill
|
|
71
|
+
|
|
72
|
+
If you're using an AI agent runtime, install the skill instead of the CLI:
|
|
73
|
+
|
|
74
|
+
**ClawHub (OpenClaw):**
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
npx clawhub@latest install image-sprout
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Or if the ClawHub CLI is already installed:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
clawhub install image-sprout
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**tmc-marketplace (Claude Code / Codex):**
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
claude plugin add tmchow/tmc-marketplace/plugins/image-sprout
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**Manual:** point your agent at the [skill file](https://raw.githubusercontent.com/tmchow/image-sprout/main/skills/agents/SKILL.md) directly. This won't auto-update when new versions are released.
|
|
93
|
+
|
|
70
94
|
## How To Run It
|
|
71
95
|
|
|
72
96
|
You can use either mode.
|
|
@@ -81,6 +105,18 @@ image-sprout web
|
|
|
81
105
|
|
|
82
106
|
This starts the interactive local app backed by the same on-disk store the CLI uses.
|
|
83
107
|
|
|
108
|
+
Pass `--open` to automatically open the app in your default browser:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
image-sprout web --open
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Pass `--port` to use a custom port (default is 4310):
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
image-sprout web --port 8080
|
|
118
|
+
```
|
|
119
|
+
|
|
84
120
|
### CLI
|
|
85
121
|
|
|
86
122
|
Run CLI commands directly:
|
|
@@ -145,6 +181,22 @@ image-sprout model set-default google/gemini-3.1-flash-image-preview
|
|
|
145
181
|
image-sprout model restore-defaults
|
|
146
182
|
```
|
|
147
183
|
|
|
184
|
+
### Analysis Model
|
|
185
|
+
|
|
186
|
+
Guide derivation uses a separate analysis model. The default is `google/gemini-3.1-flash-image-preview`.
|
|
187
|
+
|
|
188
|
+
To use a different model for derivation:
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
image-sprout config set analysisModel <openrouter-model-id>
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
You can also override it per-command:
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
image-sprout project derive my-blog --target both --analysis-model google/gemini-2.5-flash
|
|
198
|
+
```
|
|
199
|
+
|
|
148
200
|
## Recommended Project Setup
|
|
149
201
|
|
|
150
202
|
The general workflow is:
|
|
@@ -208,6 +260,8 @@ Recommended mapping:
|
|
|
208
260
|
- subject-only project: derive subject
|
|
209
261
|
- style-and-subject project: derive both
|
|
210
262
|
|
|
263
|
+
When deriving both guides from different reference sets, both analyses run in parallel.
|
|
264
|
+
|
|
211
265
|
Review the derived text before saving it.
|
|
212
266
|
|
|
213
267
|
### 5. Save The Project Profile
|
|
@@ -221,7 +275,7 @@ Project Settings does not auto-save guide edits. Save after:
|
|
|
221
275
|
|
|
222
276
|
Once the project is configured, generate from the main canvas.
|
|
223
277
|
|
|
224
|
-
The main prompt is the per-run request.
|
|
278
|
+
The main prompt is the per-run request. The image count can be 1, 2, 4, or 6.
|
|
225
279
|
|
|
226
280
|
Examples:
|
|
227
281
|
- `a flower in a forest`
|
|
@@ -299,6 +353,12 @@ image-sprout project status my-blog
|
|
|
299
353
|
image-sprout project generate my-blog --prompt "a flower in a forest"
|
|
300
354
|
```
|
|
301
355
|
|
|
356
|
+
Generate a single image:
|
|
357
|
+
|
|
358
|
+
```bash
|
|
359
|
+
image-sprout project generate my-blog --prompt "a flower in a forest" --count 1
|
|
360
|
+
```
|
|
361
|
+
|
|
302
362
|
### 6. Inspect Sessions And Runs
|
|
303
363
|
|
|
304
364
|
```bash
|
|
@@ -307,6 +367,34 @@ image-sprout run list --project my-blog
|
|
|
307
367
|
image-sprout run latest --project my-blog --json
|
|
308
368
|
```
|
|
309
369
|
|
|
370
|
+
### 7. Delete Sessions
|
|
371
|
+
|
|
372
|
+
```bash
|
|
373
|
+
image-sprout session delete --project my-blog <session-id>
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
Deleting a session removes the session and all of its runs and generated images.
|
|
377
|
+
|
|
378
|
+
## CLI Aliases
|
|
379
|
+
|
|
380
|
+
For convenience, `generate` and `analyze` are available as top-level aliases:
|
|
381
|
+
|
|
382
|
+
```bash
|
|
383
|
+
image-sprout generate --project my-blog --prompt "a flower in a forest"
|
|
384
|
+
image-sprout analyze --project my-blog --target both
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
These are shorthand for `project generate` and `project derive`, respectively.
|
|
388
|
+
|
|
389
|
+
## Agent Skills
|
|
390
|
+
|
|
391
|
+
Image Sprout ships skill files so AI agents can use the full workflow — project setup, reference management, guide derivation, generation, and result inspection — without additional documentation. See [Install As An Agent Skill](#install-as-an-agent-skill) for setup.
|
|
392
|
+
|
|
393
|
+
| Runtime | Path | Distribution |
|
|
394
|
+
|---------|------|--------------|
|
|
395
|
+
| OpenClaw / ClawHub | `skills/openclaw/SKILL.md` | Published to ClawHub directly |
|
|
396
|
+
| Claude Code + Codex | `skills/agents/SKILL.md` | Via tmc-marketplace plugin |
|
|
397
|
+
|
|
310
398
|
## CLI For Agents
|
|
311
399
|
|
|
312
400
|
The CLI is the better mode for AI agents because it:
|
|
@@ -329,7 +417,29 @@ image-sprout run latest --project my-blog --json
|
|
|
329
417
|
image-sprout help
|
|
330
418
|
image-sprout project --help
|
|
331
419
|
image-sprout ref --help
|
|
420
|
+
image-sprout session --help
|
|
332
421
|
image-sprout model --help
|
|
422
|
+
image-sprout config --help
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
## Configuration
|
|
426
|
+
|
|
427
|
+
The following config keys are available:
|
|
428
|
+
|
|
429
|
+
| Key | Description | Default |
|
|
430
|
+
|-----|-------------|---------|
|
|
431
|
+
| `apiKey` | OpenRouter API key | (empty) |
|
|
432
|
+
| `model` | Default generation model | `google/gemini-3.1-flash-image-preview` |
|
|
433
|
+
| `sizePreset` | Default image aspect ratio (`16:9`, `1:1`, `9:16`) | `16:9` |
|
|
434
|
+
| `imageCount` | Default number of images per run (`1`, `2`, `4`, `6`) | `4` |
|
|
435
|
+
| `analysisModel` | Model used for guide derivation | `google/gemini-3.1-flash-image-preview` |
|
|
436
|
+
|
|
437
|
+
```bash
|
|
438
|
+
image-sprout config show
|
|
439
|
+
image-sprout config set <key> <value>
|
|
440
|
+
image-sprout config get <key>
|
|
441
|
+
image-sprout config unset <key>
|
|
442
|
+
image-sprout config path
|
|
333
443
|
```
|
|
334
444
|
|
|
335
445
|
## Development
|
|
@@ -340,8 +450,6 @@ For local repo development:
|
|
|
340
450
|
npm install
|
|
341
451
|
```
|
|
342
452
|
|
|
343
|
-
|
|
344
|
-
|
|
345
453
|
```bash
|
|
346
454
|
npm run dev # Vite dev server
|
|
347
455
|
npm run build # Build the web app
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:"Inter", ui-sans-serif, system-ui, sans-serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-green-300:oklch(87.1% .15 154.449);--color-emerald-700:oklch(50.8% .118 165.612);--color-sky-50:oklch(97.7% .013 236.62);--color-sky-400:oklch(74.6% .16 232.661);--color-indigo-50:oklch(96.2% .018 272.314);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-200:oklch(87% .065 274.039);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-700:oklch(45.7% .24 277.023);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-slate-800:oklch(27.9% .041 260.031);--color-slate-900:oklch(20.8% .042 265.755);--color-slate-950:oklch(12.9% .042 264.695);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-md:28rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-accent-50:#eef2ff;--color-accent-500:#6366f1;--color-accent-600:#4f46e5;--color-accent-700:#4338ca}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}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;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-1\.5{top:calc(var(--spacing) * 1.5)}.top-2{top:calc(var(--spacing) * 2)}.top-3{top:calc(var(--spacing) * 3)}.right-0{right:calc(var(--spacing) * 0)}.right-1\.5{right:calc(var(--spacing) * 1.5)}.right-2{right:calc(var(--spacing) * 2)}.right-3{right:calc(var(--spacing) * 3)}.bottom-0{bottom:calc(var(--spacing) * 0)}.left-0{left:calc(var(--spacing) * 0)}.left-2{left:calc(var(--spacing) * 2)}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.z-\[60\]{z-index:60}.z-\[70\]{z-index:70}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-4{margin-inline:calc(var(--spacing) * 4)}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mr-auto{margin-right:auto}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.aspect-square{aspect-ratio:1}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-10{height:calc(var(--spacing) * 10)}.h-\[44px\]{height:44px}.h-auto{height:auto}.h-full{height:100%}.h-screen{height:100vh}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-\[80vh\]{max-height:80vh}.max-h-\[85vh\]{max-height:85vh}.max-h-\[88vh\]{max-height:88vh}.max-h-\[90vh\]{max-height:90vh}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-10{min-height:calc(var(--spacing) * 10)}.min-h-28{min-height:calc(var(--spacing) * 28)}.min-h-44{min-height:calc(var(--spacing) * 44)}.min-h-screen{min-height:100vh}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-10{width:calc(var(--spacing) * 10)}.w-32{width:calc(var(--spacing) * 32)}.w-44{width:calc(var(--spacing) * 44)}.w-auto{width:auto}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-64{max-width:calc(var(--spacing) * 64)}.max-w-full{max-width:100%}.max-w-md{max-width:var(--container-md)}.min-w-0{min-width:calc(var(--spacing) * 0)}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.rotate-180{rotate:180deg}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.resize-y{resize:vertical}.appearance-none{appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\[4px\]{border-radius:4px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-b-xl{border-bottom-right-radius:var(--radius-xl);border-bottom-left-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-r-2{border-right-style:var(--tw-border-style);border-right-width:2px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-accent-500{border-color:var(--color-accent-500)}.border-amber-200{border-color:var(--color-amber-200)}.border-amber-400{border-color:var(--color-amber-400)}.border-indigo-200{border-color:var(--color-indigo-200)}.border-indigo-500{border-color:var(--color-indigo-500)}.border-red-200{border-color:var(--color-red-200)}.border-sky-400{border-color:var(--color-sky-400)}.border-slate-100{border-color:var(--color-slate-100)}.border-slate-200{border-color:var(--color-slate-200)}.border-slate-300{border-color:var(--color-slate-300)}.border-t-indigo-600{border-top-color:var(--color-indigo-600)}.bg-accent-50{background-color:var(--color-accent-50)}.bg-accent-600{background-color:var(--color-accent-600)}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-50\/70{background-color:#fffbebb3}@supports (color:color-mix(in lab,red,red)){.bg-amber-50\/70{background-color:color-mix(in oklab,var(--color-amber-50) 70%,transparent)}}.bg-amber-600{background-color:var(--color-amber-600)}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-black\/45{background-color:#00000073}@supports (color:color-mix(in lab,red,red)){.bg-black\/45{background-color:color-mix(in oklab,var(--color-black) 45%,transparent)}}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black) 50%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-black\/70{background-color:#000000b3}@supports (color:color-mix(in lab,red,red)){.bg-black\/70{background-color:color-mix(in oklab,var(--color-black) 70%,transparent)}}.bg-indigo-50{background-color:var(--color-indigo-50)}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-indigo-600{background-color:var(--color-indigo-600)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-100{background-color:var(--color-red-100)}.bg-sky-50\/80{background-color:#f0f9ffcc}@supports (color:color-mix(in lab,red,red)){.bg-sky-50\/80{background-color:color-mix(in oklab,var(--color-sky-50) 80%,transparent)}}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-100{background-color:var(--color-slate-100)}.bg-slate-200{background-color:var(--color-slate-200)}.bg-slate-900{background-color:var(--color-slate-900)}.bg-slate-950{background-color:var(--color-slate-950)}.bg-slate-950\/75{background-color:#020618bf}@supports (color:color-mix(in lab,red,red)){.bg-slate-950\/75{background-color:color-mix(in oklab,var(--color-slate-950) 75%,transparent)}}.bg-white{background-color:var(--color-white)}.bg-white\/20{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.bg-white\/20{background-color:color-mix(in oklab,var(--color-white) 20%,transparent)}}.bg-white\/80{background-color:#fffc}@supports (color:color-mix(in lab,red,red)){.bg-white\/80{background-color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.bg-white\/90{background-color:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.bg-white\/90{background-color:color-mix(in oklab,var(--color-white) 90%,transparent)}}.bg-white\/96{background-color:#fffffff5}@supports (color:color-mix(in lab,red,red)){.bg-white\/96{background-color:color-mix(in oklab,var(--color-white) 96%,transparent)}}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-\[linear-gradient\(180deg\,\#fffdf7_0\%\,\#ffffff_18\%\,\#f8fafc_100\%\)\]{background-image:linear-gradient(#fffdf7,#fff 18%,#f8fafc)}.bg-\[url\(\'data\:image\/svg\+xml\;charset\=utf-8\,\%3Csvg\%20xmlns\%3D\%22http\%3A\%2F\%2Fwww\.w3\.org\%2F2000\%2Fsvg\%22\%20width\%3D\%2212\%22\%20height\%3D\%2212\%22\%20viewBox\%3D\%220\%200\%2024\%2024\%22\%20fill\%3D\%22none\%22\%20stroke\%3D\%22\%2364748b\%22\%20stroke-width\%3D\%222\%22\%3E\%3Cpath\%20d\%3D\%22M6\%209l6\%206\%206-6\%22\%2F\%3E\%3C\%2Fsvg\%3E\'\)\]{background-image:url(data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%2364748b%22%20stroke-width%3D%222%22%3E%3Cpath%20d%3D%22M6%209l6%206%206-6%22%2F%3E%3C%2Fsvg%3E)}.from-slate-200{--tw-gradient-from:var(--color-slate-200);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.via-slate-100{--tw-gradient-via:var(--color-slate-100);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-slate-200{--tw-gradient-to:var(--color-slate-200);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.bg-\[length\:12px\]{background-size:12px}.bg-\[right_8px_center\]{background-position:right 8px center}.bg-no-repeat{background-repeat:no-repeat}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:calc(var(--spacing) * 1)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pr-6{padding-right:calc(var(--spacing) * 6)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[0\.14em\]{--tw-tracking:.14em;letter-spacing:.14em}.tracking-\[0\.16em\]{--tw-tracking:.16em;letter-spacing:.16em}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-pre-wrap{white-space:pre-wrap}.text-accent-600{color:var(--color-accent-600)}.text-amber-600{color:var(--color-amber-600)}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-emerald-700{color:var(--color-emerald-700)}.text-green-300{color:var(--color-green-300)}.text-indigo-600{color:var(--color-indigo-600)}.text-indigo-700{color:var(--color-indigo-700)}.text-red-300{color:var(--color-red-300)}.text-red-600{color:var(--color-red-600)}.text-slate-300{color:var(--color-slate-300)}.text-slate-400{color:var(--color-slate-400)}.text-slate-500{color:var(--color-slate-500)}.text-slate-600{color:var(--color-slate-600)}.text-slate-700{color:var(--color-slate-700)}.text-slate-800{color:var(--color-slate-800)}.text-slate-900{color:var(--color-slate-900)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.underline{text-decoration-line:underline}.decoration-amber-300{-webkit-text-decoration-color:var(--color-amber-300);text-decoration-color:var(--color-amber-300)}.underline-offset-2{text-underline-offset:2px}.placeholder-slate-400::placeholder{color:var(--color-slate-400)}.opacity-0{opacity:0}.opacity-45{opacity:.45}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring,.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-indigo-600{--tw-ring-color:var(--color-indigo-600)}.ring-slate-200{--tw-ring-color:var(--color-slate-200)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.select-none{-webkit-user-select:none;user-select:none}.group-focus-within\:opacity-100:is(:where(.group):focus-within *){opacity:1}@media(hover:hover){.group-hover\:text-slate-700:is(:where(.group):hover *){color:var(--color-slate-700)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\:text-slate-400::placeholder{color:var(--color-slate-400)}@media(hover:hover){.hover\:border-amber-400:hover{border-color:var(--color-amber-400)}.hover\:bg-accent-700:hover{background-color:var(--color-accent-700)}.hover\:bg-amber-700:hover{background-color:var(--color-amber-700)}.hover\:bg-black\/70:hover{background-color:#000000b3}@supports (color:color-mix(in lab,red,red)){.hover\:bg-black\/70:hover{background-color:color-mix(in oklab,var(--color-black) 70%,transparent)}}.hover\:bg-indigo-50:hover{background-color:var(--color-indigo-50)}.hover\:bg-indigo-700:hover{background-color:var(--color-indigo-700)}.hover\:bg-red-50:hover{background-color:var(--color-red-50)}.hover\:bg-red-100:hover{background-color:var(--color-red-100)}.hover\:bg-slate-50:hover{background-color:var(--color-slate-50)}.hover\:bg-slate-100:hover{background-color:var(--color-slate-100)}.hover\:bg-slate-300:hover{background-color:var(--color-slate-300)}.hover\:bg-slate-800:hover{background-color:var(--color-slate-800)}.hover\:bg-white:hover{background-color:var(--color-white)}.hover\:bg-white\/40:hover{background-color:#fff6}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/40:hover{background-color:color-mix(in oklab,var(--color-white) 40%,transparent)}}.hover\:text-accent-600:hover{color:var(--color-accent-600)}.hover\:text-accent-700:hover{color:var(--color-accent-700)}.hover\:text-amber-600:hover{color:var(--color-amber-600)}.hover\:text-amber-900:hover{color:var(--color-amber-900)}.hover\:text-red-500:hover{color:var(--color-red-500)}.hover\:text-red-600:hover{color:var(--color-red-600)}.hover\:text-red-700:hover{color:var(--color-red-700)}.hover\:text-slate-600:hover{color:var(--color-slate-600)}.hover\:text-slate-700:hover{color:var(--color-slate-700)}.hover\:text-slate-800:hover{color:var(--color-slate-800)}}.focus\:border-amber-500:focus{border-color:var(--color-amber-500)}.focus\:border-indigo-500:focus{border-color:var(--color-indigo-500)}.focus\:border-transparent:focus{border-color:#0000}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-accent-500:focus{--tw-ring-color:var(--color-accent-500)}.focus\:ring-amber-500:focus{--tw-ring-color:var(--color-amber-500)}.focus\:ring-indigo-500:focus{--tw-ring-color:var(--color-indigo-500)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(min-width:48rem){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-\[1\.8fr_1fr_auto\]{grid-template-columns:1.8fr 1fr auto}}@media(min-width:64rem){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(min-width:80rem){.xl\:col-span-2{grid-column:span 2/span 2}.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}}body{font-family:var(--font-sans);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0}#app{width:100%;min-height:100vh}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const s of a)if(s.type==="childList")for(const u of s.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&n(u)}).observe(document,{childList:!0,subtree:!0});function r(a){const s={};return a.integrity&&(s.integrity=a.integrity),a.referrerPolicy&&(s.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?s.credentials="include":a.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(a){if(a.ep)return;a.ep=!0;const s=r(a);fetch(a.href,s)}})();const Xr=!1;var hn=Array.isArray,Rs=Array.prototype.indexOf,Vt=Array.prototype.includes,Dr=Array.from,Ps=Object.defineProperty,Ht=Object.getOwnPropertyDescriptor,sa=Object.getOwnPropertyDescriptors,Cs=Object.prototype,Is=Array.prototype,gn=Object.getPrototypeOf,zn=Object.isExtensible;const Ms=()=>{};function Ts(e){return e()}function Zr(e){for(var t=0;t<e.length;t++)e[t]()}function ia(){var e,t,r=new Promise((n,a)=>{e=n,t=a});return{promise:r,resolve:e,reject:t}}const be=2,Qt=4,At=8,bn=1<<24,kt=16,Ye=32,Lt=64,Qr=128,Ue=512,he=1024,ge=2048,We=4096,we=8192,rt=16384,er=32768,Jt=65536,Bn=1<<17,Ds=1<<18,tr=1<<19,oa=1<<20,et=1<<25,Ot=65536,en=1<<21,mn=1<<22,mt=1<<23,lt=Symbol("$state"),As=Symbol("legacy props"),Os=Symbol(""),Pt=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Ns=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");function la(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Fs(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Ls(e,t,r){throw new Error("https://svelte.dev/e/each_key_duplicate")}function Us(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function zs(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Bs(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Gs(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function qs(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function Ks(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Hs(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Vs(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Js(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const Ws=1,Ys=2,ua=4,$s=8,Xs=16,Zs=1,Qs=2,ei=4,ti=8,ri=16,ni=1,ai=2,ve=Symbol(),ca="http://www.w3.org/1999/xhtml";function si(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function ii(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function da(e){return e===this.v}function oi(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function fa(e){return!oi(e,this.v)}let rr=!1,li=!1;function ui(){rr=!0}let le=null;function Wt(e){le=e}function xe(e,t=!1,r){le={p:le,i:!1,c:null,e:null,s:e,x:null,l:rr&&!t?{s:null,u:null,$:[]}:null}}function ye(e){var t=le,r=t.e;if(r!==null){t.e=null;for(var n of r)Ia(n)}return t.i=!0,le=t.p,{}}function gr(){return!rr||le!==null&&le.l===null}let Ct=[];function va(){var e=Ct;Ct=[],Zr(e)}function ut(e){if(Ct.length===0&&!dr){var t=Ct;queueMicrotask(()=>{t===Ct&&va()})}Ct.push(e)}function ci(){for(;Ct.length>0;)va()}function pa(e){var t=re;if(t===null)return ee.f|=mt,e;if((t.f&er)===0&&(t.f&Qt)===0)throw e;bt(e,t)}function bt(e,t){for(;t!==null;){if((t.f&Qr)!==0){if((t.f&er)===0)throw e;try{t.b.error(e);return}catch(r){e=r}}t=t.parent}throw e}const di=-7169;function ce(e,t){e.f=e.f&di|t}function _n(e){(e.f&Ue)!==0||e.deps===null?ce(e,he):ce(e,We)}function ha(e){if(e!==null)for(const t of e)(t.f&be)===0||(t.f&Ot)===0||(t.f^=Ot,ha(t.deps))}function ga(e,t,r){(e.f&ge)!==0?t.add(e):(e.f&We)!==0&&r.add(e),ha(e.deps),ce(e,he)}const jr=new Set;let ae=null,tn=null,He=null,Re=[],Ar=null,dr=!1,Yt=null,fi=1;class _t{id=fi++;current=new Map;previous=new Map;#e=new Set;#o=new Set;#t=0;#i=0;#r=null;#s=new Set;#n=new Set;#a=new Map;is_fork=!1;#l=!1;#c(){return this.is_fork||this.#i>0}skip_effect(t){this.#a.has(t)||this.#a.set(t,{d:[],m:[]})}unskip_effect(t){var r=this.#a.get(t);if(r){this.#a.delete(t);for(var n of r.d)ce(n,ge),tt(n);for(n of r.m)ce(n,We),tt(n)}}process(t){Re=[],this.apply();var r=Yt=[],n=[];for(const a of t)this.#u(a,r,n);if(Yt=null,this.#c()){this.#d(n),this.#d(r);for(const[a,s]of this.#a)xa(a,s)}else{tn=this,ae=null;for(const a of this.#e)a(this);this.#e.clear(),this.#t===0&&this.#f(),Gn(n),Gn(r),this.#s.clear(),this.#n.clear(),tn=null,this.#r?.resolve()}He=null}#u(t,r,n){t.f^=he;for(var a=t.first;a!==null;){var s=a.f,u=(s&(Ye|Lt))!==0,d=u&&(s&he)!==0,o=(s&we)!==0,f=d||this.#a.has(a);if(!f&&a.fn!==null){u?o||(a.f^=he):(s&Qt)!==0?r.push(a):(s&(At|bn))!==0&&o?n.push(a):_r(a)&&(Zt(a),(s&kt)!==0&&(this.#n.add(a),o&&ce(a,ge)));var v=a.first;if(v!==null){a=v;continue}}for(;a!==null;){var x=a.next;if(x!==null){a=x;break}a=a.parent}}}#d(t){for(var r=0;r<t.length;r+=1)ga(t[r],this.#s,this.#n)}capture(t,r){r!==ve&&!this.previous.has(t)&&this.previous.set(t,r),(t.f&mt)===0&&(this.current.set(t,t.v),He?.set(t,t.v))}activate(){ae=this,this.apply()}deactivate(){ae===this&&(ae=null,He=null)}flush(){if(Re.length>0)ae=this,ba();else if(this.#t===0&&!this.is_fork){for(const t of this.#e)t(this);this.#e.clear(),this.#f(),this.#r?.resolve()}this.deactivate()}discard(){for(const t of this.#o)t(this);this.#o.clear()}#f(){if(jr.size>1){this.previous.clear();var t=ae,r=He,n=!0;for(const s of jr){if(s===this){n=!1;continue}const u=[];for(const[o,f]of this.current){if(s.current.has(o))if(n&&f!==s.current.get(o))s.current.set(o,f);else continue;u.push(o)}if(u.length===0)continue;const d=[...s.current.keys()].filter(o=>!this.current.has(o));if(d.length>0){var a=Re;Re=[];const o=new Set,f=new Map;for(const v of u)ma(v,d,o,f);if(Re.length>0){ae=s,s.apply();for(const v of Re)s.#u(v,[],[]);s.deactivate()}Re=a}}ae=t,He=r}this.#a.clear(),jr.delete(this)}increment(t){this.#t+=1,t&&(this.#i+=1)}decrement(t){this.#t-=1,t&&(this.#i-=1),!this.#l&&(this.#l=!0,ut(()=>{this.#l=!1,this.#c()?Re.length>0&&this.flush():this.revive()}))}revive(){for(const t of this.#s)this.#n.delete(t),ce(t,ge),tt(t);for(const t of this.#n)ce(t,We),tt(t);this.flush()}oncommit(t){this.#e.add(t)}ondiscard(t){this.#o.add(t)}settled(){return(this.#r??=ia()).promise}static ensure(){if(ae===null){const t=ae=new _t;jr.add(ae),dr||ut(()=>{ae===t&&t.flush()})}return ae}apply(){}}function vi(e){var t=dr;dr=!0;try{for(var r;;){if(ci(),Re.length===0&&(ae?.flush(),Re.length===0))return Ar=null,r;ba()}}finally{dr=t}}function ba(){var e=null;try{for(var t=0;Re.length>0;){var r=_t.ensure();if(t++>1e3){var n,a;pi()}r.process(Re),xt.clear()}}finally{Re=[],Ar=null,Yt=null}}function pi(){try{Gs()}catch(e){bt(e,Ar)}}let ot=null;function Gn(e){var t=e.length;if(t!==0){for(var r=0;r<t;){var n=e[r++];if((n.f&(rt|we))===0&&_r(n)&&(ot=new Set,Zt(n),n.deps===null&&n.first===null&&n.nodes===null&&n.teardown===null&&n.ac===null&&Ta(n),ot?.size>0)){xt.clear();for(const a of ot){if((a.f&(rt|we))!==0)continue;const s=[a];let u=a.parent;for(;u!==null;)ot.has(u)&&(ot.delete(u),s.push(u)),u=u.parent;for(let d=s.length-1;d>=0;d--){const o=s[d];(o.f&(rt|we))===0&&Zt(o)}}ot.clear()}}ot=null}}function ma(e,t,r,n){if(!r.has(e)&&(r.add(e),e.reactions!==null))for(const a of e.reactions){const s=a.f;(s&be)!==0?ma(a,t,r,n):(s&(mn|kt))!==0&&(s&ge)===0&&_a(a,t,n)&&(ce(a,ge),tt(a))}}function _a(e,t,r){const n=r.get(e);if(n!==void 0)return n;if(e.deps!==null)for(const a of e.deps){if(Vt.call(t,a))return!0;if((a.f&be)!==0&&_a(a,t,r))return r.set(a,!0),!0}return r.set(e,!1),!1}function tt(e){var t=Ar=e,r=t.b;if(r?.is_pending&&(e.f&(Qt|At|bn))!==0&&(e.f&er)===0){r.defer_effect(e);return}for(;t.parent!==null;){t=t.parent;var n=t.f;if(Yt!==null&&t===re&&(e.f&At)===0)return;if((n&(Lt|Ye))!==0){if((n&he)===0)return;t.f^=he}}Re.push(t)}function xa(e,t){if(!((e.f&Ye)!==0&&(e.f&he)!==0)){(e.f&ge)!==0?t.d.push(e):(e.f&We)!==0&&t.m.push(e),ce(e,he);for(var r=e.first;r!==null;)xa(r,t),r=r.next}}function hi(e){let t=0,r=Nt(0),n;return()=>{yn()&&(i(r),kn(()=>(t===0&&(n=Ut(()=>e(()=>fr(r)))),t+=1,()=>{ut(()=>{t-=1,t===0&&(n?.(),n=void 0,fr(r))})})))}}var gi=Jt|tr;function bi(e,t,r,n){new mi(e,t,r,n)}class mi{parent;is_pending=!1;transform_error;#e;#o=null;#t;#i;#r;#s=null;#n=null;#a=null;#l=null;#c=0;#u=0;#d=!1;#f=new Set;#p=new Set;#v=null;#_=hi(()=>(this.#v=Nt(this.#c),()=>{this.#v=null}));constructor(t,r,n,a){this.#e=t,this.#t=r,this.#i=s=>{var u=re;u.b=this,u.f|=Qr,n(s)},this.parent=re.b,this.transform_error=a??this.parent?.transform_error??(s=>s),this.#r=Sn(()=>{this.#b()},gi)}#x(){try{this.#s=Le(()=>this.#i(this.#e))}catch(t){this.error(t)}}#y(t){const r=this.#t.failed;r&&(this.#a=Le(()=>{r(this.#e,()=>t,()=>()=>{})}))}#w(){const t=this.#t.pending;t&&(this.is_pending=!0,this.#n=Le(()=>t(this.#e)),ut(()=>{var r=this.#l=document.createDocumentFragment(),n=yt();r.append(n),this.#s=this.#g(()=>(_t.ensure(),Le(()=>this.#i(n)))),this.#u===0&&(this.#e.before(r),this.#l=null,Tt(this.#n,()=>{this.#n=null}),this.#h())}))}#b(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#c=0,this.#s=Le(()=>{this.#i(this.#e)}),this.#u>0){var t=this.#l=document.createDocumentFragment();Rn(this.#s,t);const r=this.#t.pending;this.#n=Le(()=>r(this.#e))}else this.#h()}catch(r){this.error(r)}}#h(){this.is_pending=!1;for(const t of this.#f)ce(t,ge),tt(t);for(const t of this.#p)ce(t,We),tt(t);this.#f.clear(),this.#p.clear()}defer_effect(t){ga(t,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#t.pending}#g(t){var r=re,n=ee,a=le;nt(this.#r),Be(this.#r),Wt(this.#r.ctx);try{return t()}catch(s){return pa(s),null}finally{nt(r),Be(n),Wt(a)}}#m(t){if(!this.has_pending_snippet()){this.parent&&this.parent.#m(t);return}this.#u+=t,this.#u===0&&(this.#h(),this.#n&&Tt(this.#n,()=>{this.#n=null}),this.#l&&(this.#e.before(this.#l),this.#l=null))}update_pending_count(t){this.#m(t),this.#c+=t,!(!this.#v||this.#d)&&(this.#d=!0,ut(()=>{this.#d=!1,this.#v&&$t(this.#v,this.#c)}))}get_effect_pending(){return this.#_(),i(this.#v)}error(t){var r=this.#t.onerror;let n=this.#t.failed;if(!r&&!n)throw t;this.#s&&(Ce(this.#s),this.#s=null),this.#n&&(Ce(this.#n),this.#n=null),this.#a&&(Ce(this.#a),this.#a=null);var a=!1,s=!1;const u=()=>{if(a){ii();return}a=!0,s&&Js(),this.#a!==null&&Tt(this.#a,()=>{this.#a=null}),this.#g(()=>{_t.ensure(),this.#b()})},d=o=>{try{s=!0,r?.(o,u),s=!1}catch(f){bt(f,this.#r&&this.#r.parent)}n&&(this.#a=this.#g(()=>{_t.ensure();try{return Le(()=>{var f=re;f.b=this,f.f|=Qr,n(this.#e,()=>o,()=>u)})}catch(f){return bt(f,this.#r.parent),null}}))};ut(()=>{var o;try{o=this.transform_error(t)}catch(f){bt(f,this.#r&&this.#r.parent);return}o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(d,f=>bt(f,this.#r&&this.#r.parent)):d(o)})}}function _i(e,t,r,n){const a=gr()?br:Or;var s=e.filter(x=>!x.settled);if(r.length===0&&s.length===0){n(t.map(a));return}var u=re,d=xi(),o=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(x=>x.promise)):null;function f(x){d();try{n(x)}catch(g){(u.f&rt)===0&&bt(g,u)}rn()}if(r.length===0){o.then(()=>f(t.map(a)));return}function v(){d(),Promise.all(r.map(x=>wi(x))).then(x=>f([...t.map(a),...x])).catch(x=>bt(x,u))}o?o.then(v):v()}function xi(){var e=re,t=ee,r=le,n=ae;return function(s=!0){nt(e),Be(t),Wt(r),s&&n?.activate()}}function rn(e=!0){nt(null),Be(null),Wt(null),e&&ae?.deactivate()}function yi(){var e=re.b,t=ae,r=e.is_rendered();return e.update_pending_count(1),t.increment(r),()=>{e.update_pending_count(-1),t.decrement(r)}}function br(e){var t=be|ge,r=ee!==null&&(ee.f&be)!==0?ee:null;return re!==null&&(re.f|=tr),{ctx:le,deps:null,effects:null,equals:da,f:t,fn:e,reactions:null,rv:0,v:ve,wv:0,parent:r??re,ac:null}}function wi(e,t,r){re===null&&Fs();var a=void 0,s=Nt(ve),u=!ee,d=new Map;return Li(()=>{var o=ia();a=o.promise;try{Promise.resolve(e()).then(o.resolve,o.reject).finally(rn)}catch(g){o.reject(g),rn()}var f=ae;if(u){var v=yi();d.get(f)?.reject(Pt),d.delete(f),d.set(f,o)}const x=(g,R=void 0)=>{if(f.activate(),R)R!==Pt&&(s.f|=mt,$t(s,R));else{(s.f&mt)!==0&&(s.f^=mt),$t(s,g);for(const[b,y]of d){if(d.delete(b),b===f)break;y.reject(Pt)}}v&&v()};o.promise.then(x,g=>x(null,g||"unknown"))}),wn(()=>{for(const o of d.values())o.reject(Pt)}),new Promise(o=>{function f(v){function x(){v===a?o(s):f(a)}v.then(x,x)}f(a)})}function te(e){const t=br(e);return Oa(t),t}function Or(e){const t=br(e);return t.equals=fa,t}function ki(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)Ce(t[r])}}function Si(e){for(var t=e.parent;t!==null;){if((t.f&be)===0)return(t.f&rt)===0?t:null;t=t.parent}return null}function xn(e){var t,r=re;nt(Si(e));try{e.f&=~Ot,ki(e),t=Ua(e)}finally{nt(r)}return t}function ya(e){var t=xn(e);if(!e.equals(t)&&(e.wv=Fa(),(!ae?.is_fork||e.deps===null)&&(e.v=t,e.deps===null))){ce(e,he);return}wt||(He!==null?(yn()||ae?.is_fork)&&He.set(e,t):_n(e))}function ji(e){if(e.effects!==null)for(const t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(Pt),t.teardown=Ms,t.ac=null,vr(t,0),jn(t))}function wa(e){if(e.effects!==null)for(const t of e.effects)t.teardown&&Zt(t)}let nn=new Set;const xt=new Map;let ka=!1;function Nt(e,t){var r={f:0,v:e,reactions:null,equals:da,rv:0,wv:0};return r}function N(e,t){const r=Nt(e);return Oa(r),r}function Ei(e,t=!1,r=!0){const n=Nt(e);return t||(n.equals=fa),rr&&r&&le!==null&&le.l!==null&&(le.l.s??=[]).push(n),n}function l(e,t,r=!1){ee!==null&&(!Ve||(ee.f&Bn)!==0)&&gr()&&(ee.f&(be|kt|mn|Bn))!==0&&(ze===null||!Vt.call(ze,e))&&Vs();let n=r?Ae(t):t;return $t(e,n)}function $t(e,t){if(!e.equals(t)){var r=e.v;wt?xt.set(e,t):xt.set(e,r),e.v=t;var n=_t.ensure();if(n.capture(e,r),(e.f&be)!==0){const a=e;(e.f&ge)!==0&&xn(a),_n(a)}e.wv=Fa(),Sa(e,ge),gr()&&re!==null&&(re.f&he)!==0&&(re.f&(Ye|Lt))===0&&(Fe===null?Bi([e]):Fe.push(e)),!n.is_fork&&nn.size>0&&!ka&&Ri()}return t}function Ri(){ka=!1;for(const e of nn)(e.f&he)!==0&&ce(e,We),_r(e)&&Zt(e);nn.clear()}function fr(e){l(e,e.v+1)}function Sa(e,t){var r=e.reactions;if(r!==null)for(var n=gr(),a=r.length,s=0;s<a;s++){var u=r[s],d=u.f;if(!(!n&&u===re)){var o=(d&ge)===0;if(o&&ce(u,t),(d&be)!==0){var f=u;He?.delete(f),(d&Ot)===0&&(d&Ue&&(u.f|=Ot),Sa(f,We))}else o&&((d&kt)!==0&&ot!==null&&ot.add(u),tt(u))}}}function Ae(e){if(typeof e!="object"||e===null||lt in e)return e;const t=gn(e);if(t!==Cs&&t!==Is)return e;var r=new Map,n=hn(e),a=N(0),s=Dt,u=d=>{if(Dt===s)return d();var o=ee,f=Dt;Be(null),Jn(s);var v=d();return Be(o),Jn(f),v};return n&&r.set("length",N(e.length)),new Proxy(e,{defineProperty(d,o,f){(!("value"in f)||f.configurable===!1||f.enumerable===!1||f.writable===!1)&&Ks();var v=r.get(o);return v===void 0?u(()=>{var x=N(f.value);return r.set(o,x),x}):l(v,f.value,!0),!0},deleteProperty(d,o){var f=r.get(o);if(f===void 0){if(o in d){const v=u(()=>N(ve));r.set(o,v),fr(a)}}else l(f,ve),fr(a);return!0},get(d,o,f){if(o===lt)return e;var v=r.get(o),x=o in d;if(v===void 0&&(!x||Ht(d,o)?.writable)&&(v=u(()=>{var R=Ae(x?d[o]:ve),b=N(R);return b}),r.set(o,v)),v!==void 0){var g=i(v);return g===ve?void 0:g}return Reflect.get(d,o,f)},getOwnPropertyDescriptor(d,o){var f=Reflect.getOwnPropertyDescriptor(d,o);if(f&&"value"in f){var v=r.get(o);v&&(f.value=i(v))}else if(f===void 0){var x=r.get(o),g=x?.v;if(x!==void 0&&g!==ve)return{enumerable:!0,configurable:!0,value:g,writable:!0}}return f},has(d,o){if(o===lt)return!0;var f=r.get(o),v=f!==void 0&&f.v!==ve||Reflect.has(d,o);if(f!==void 0||re!==null&&(!v||Ht(d,o)?.writable)){f===void 0&&(f=u(()=>{var g=v?Ae(d[o]):ve,R=N(g);return R}),r.set(o,f));var x=i(f);if(x===ve)return!1}return v},set(d,o,f,v){var x=r.get(o),g=o in d;if(n&&o==="length")for(var R=f;R<x.v;R+=1){var b=r.get(R+"");b!==void 0?l(b,ve):R in d&&(b=u(()=>N(ve)),r.set(R+"",b))}if(x===void 0)(!g||Ht(d,o)?.writable)&&(x=u(()=>N(void 0)),l(x,Ae(f)),r.set(o,x));else{g=x.v!==ve;var y=u(()=>Ae(f));l(x,y)}var m=Reflect.getOwnPropertyDescriptor(d,o);if(m?.set&&m.set.call(v,f),!g){if(n&&typeof o=="string"){var w=r.get("length"),L=Number(o);Number.isInteger(L)&&L>=w.v&&l(w,L+1)}fr(a)}return!0},ownKeys(d){i(a);var o=Reflect.ownKeys(d).filter(x=>{var g=r.get(x);return g===void 0||g.v!==ve});for(var[f,v]of r)v.v!==ve&&!(f in d)&&o.push(f);return o},setPrototypeOf(){Hs()}})}function qn(e){try{if(e!==null&&typeof e=="object"&< in e)return e[lt]}catch{}return e}function Pi(e,t){return Object.is(qn(e),qn(t))}var Kn,ja,Ea,Ra;function Ci(){if(Kn===void 0){Kn=window,ja=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;Ea=Ht(t,"firstChild").get,Ra=Ht(t,"nextSibling").get,zn(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),zn(r)&&(r.__t=void 0)}}function yt(e=""){return document.createTextNode(e)}function Xt(e){return Ea.call(e)}function mr(e){return Ra.call(e)}function c(e,t){return Xt(e)}function _e(e,t=!1){{var r=Xt(e);return r instanceof Comment&&r.data===""?mr(r):r}}function p(e,t=1,r=!1){let n=e;for(;t--;)n=mr(n);return n}function Ii(e){e.textContent=""}function Pa(){return!1}function Mi(e,t,r){return document.createElementNS(ca,e,void 0)}let Hn=!1;function Ti(){Hn||(Hn=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function Nr(e){var t=ee,r=re;Be(null),nt(null);try{return e()}finally{Be(t),nt(r)}}function Di(e,t,r,n=r){e.addEventListener(t,()=>Nr(r));const a=e.__on_r;a?e.__on_r=()=>{a(),n(!0)}:e.__on_r=()=>n(!0),Ti()}function Ca(e){re===null&&(ee===null&&Bs(),zs()),wt&&Us()}function Ai(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function st(e,t){var r=re;r!==null&&(r.f&we)!==0&&(e|=we);var n={ctx:le,deps:null,nodes:null,f:e|ge|Ue,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null},a=n;if((e&Qt)!==0)Yt!==null?Yt.push(n):tt(n);else if(t!==null){try{Zt(n)}catch(u){throw Ce(n),u}a.deps===null&&a.teardown===null&&a.nodes===null&&a.first===a.last&&(a.f&tr)===0&&(a=a.first,(e&kt)!==0&&(e&Jt)!==0&&a!==null&&(a.f|=Jt))}if(a!==null&&(a.parent=r,r!==null&&Ai(a,r),ee!==null&&(ee.f&be)!==0&&(e&Lt)===0)){var s=ee;(s.effects??=[]).push(a)}return n}function yn(){return ee!==null&&!Ve}function wn(e){const t=st(At,null);return ce(t,he),t.teardown=e,t}function ct(e){Ca();var t=re.f,r=!ee&&(t&Ye)!==0&&(t&er)===0;if(r){var n=le;(n.e??=[]).push(e)}else return Ia(e)}function Ia(e){return st(Qt|oa,e)}function Oi(e){return Ca(),st(At|oa,e)}function Ni(e){_t.ensure();const t=st(Lt|tr,e);return(r={})=>new Promise(n=>{r.outro?Tt(t,()=>{Ce(t),n(void 0)}):(Ce(t),n(void 0))})}function Fi(e){return st(Qt,e)}function Li(e){return st(mn|tr,e)}function kn(e,t=0){return st(At|t,e)}function q(e,t=[],r=[],n=[]){_i(n,t,r,a=>{st(At,()=>e(...a.map(i)))})}function Sn(e,t=0){var r=st(kt|t,e);return r}function Le(e){return st(Ye|tr,e)}function Ma(e){var t=e.teardown;if(t!==null){const r=wt,n=ee;Vn(!0),Be(null);try{t.call(null)}finally{Vn(r),Be(n)}}}function jn(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){const a=r.ac;a!==null&&Nr(()=>{a.abort(Pt)});var n=r.next;(r.f&Lt)!==0?r.parent=null:Ce(r,t),r=n}}function Ui(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&Ye)===0&&Ce(t),t=r}}function Ce(e,t=!0){var r=!1;(t||(e.f&Ds)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(zi(e.nodes.start,e.nodes.end),r=!0),jn(e,t&&!r),vr(e,0),ce(e,rt);var n=e.nodes&&e.nodes.t;if(n!==null)for(const s of n)s.stop();Ma(e);var a=e.parent;a!==null&&a.first!==null&&Ta(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function zi(e,t){for(;e!==null;){var r=e===t?null:mr(e);e.remove(),e=r}}function Ta(e){var t=e.parent,r=e.prev,n=e.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),t!==null&&(t.first===e&&(t.first=n),t.last===e&&(t.last=r))}function Tt(e,t,r=!0){var n=[];Da(e,n,!0);var a=()=>{r&&Ce(e),t&&t()},s=n.length;if(s>0){var u=()=>--s||a();for(var d of n)d.out(u)}else a()}function Da(e,t,r){if((e.f&we)===0){e.f^=we;var n=e.nodes&&e.nodes.t;if(n!==null)for(const d of n)(d.is_global||r)&&t.push(d);for(var a=e.first;a!==null;){var s=a.next,u=(a.f&Jt)!==0||(a.f&Ye)!==0&&(e.f&kt)!==0;Da(a,t,u?r:!1),a=s}}}function En(e){Aa(e,!0)}function Aa(e,t){if((e.f&we)!==0){e.f^=we;for(var r=e.first;r!==null;){var n=r.next,a=(r.f&Jt)!==0||(r.f&Ye)!==0;Aa(r,a?t:!1),r=n}var s=e.nodes&&e.nodes.t;if(s!==null)for(const u of s)(u.is_global||t)&&u.in()}}function Rn(e,t){if(e.nodes)for(var r=e.nodes.start,n=e.nodes.end;r!==null;){var a=r===n?null:mr(r);t.append(r),r=a}}let Cr=!1,wt=!1;function Vn(e){wt=e}let ee=null,Ve=!1;function Be(e){ee=e}let re=null;function nt(e){re=e}let ze=null;function Oa(e){ee!==null&&(ze===null?ze=[e]:ze.push(e))}let Pe=null,De=0,Fe=null;function Bi(e){Fe=e}let Na=1,It=0,Dt=It;function Jn(e){Dt=e}function Fa(){return++Na}function _r(e){var t=e.f;if((t&ge)!==0)return!0;if(t&be&&(e.f&=~Ot),(t&We)!==0){for(var r=e.deps,n=r.length,a=0;a<n;a++){var s=r[a];if(_r(s)&&ya(s),s.wv>e.wv)return!0}(t&Ue)!==0&&He===null&&ce(e,he)}return!1}function La(e,t,r=!0){var n=e.reactions;if(n!==null&&!(ze!==null&&Vt.call(ze,e)))for(var a=0;a<n.length;a++){var s=n[a];(s.f&be)!==0?La(s,t,!1):t===s&&(r?ce(s,ge):(s.f&he)!==0&&ce(s,We),tt(s))}}function Ua(e){var t=Pe,r=De,n=Fe,a=ee,s=ze,u=le,d=Ve,o=Dt,f=e.f;Pe=null,De=0,Fe=null,ee=(f&(Ye|Lt))===0?e:null,ze=null,Wt(e.ctx),Ve=!1,Dt=++It,e.ac!==null&&(Nr(()=>{e.ac.abort(Pt)}),e.ac=null);try{e.f|=en;var v=e.fn,x=v();e.f|=er;var g=e.deps,R=ae?.is_fork;if(Pe!==null){var b;if(R||vr(e,De),g!==null&&De>0)for(g.length=De+Pe.length,b=0;b<Pe.length;b++)g[De+b]=Pe[b];else e.deps=g=Pe;if(yn()&&(e.f&Ue)!==0)for(b=De;b<g.length;b++)(g[b].reactions??=[]).push(e)}else!R&&g!==null&&De<g.length&&(vr(e,De),g.length=De);if(gr()&&Fe!==null&&!Ve&&g!==null&&(e.f&(be|We|ge))===0)for(b=0;b<Fe.length;b++)La(Fe[b],e);if(a!==null&&a!==e){if(It++,a.deps!==null)for(let y=0;y<r;y+=1)a.deps[y].rv=It;if(t!==null)for(const y of t)y.rv=It;Fe!==null&&(n===null?n=Fe:n.push(...Fe))}return(e.f&mt)!==0&&(e.f^=mt),x}catch(y){return pa(y)}finally{e.f^=en,Pe=t,De=r,Fe=n,ee=a,ze=s,Wt(u),Ve=d,Dt=o}}function Gi(e,t){let r=t.reactions;if(r!==null){var n=Rs.call(r,e);if(n!==-1){var a=r.length-1;a===0?r=t.reactions=null:(r[n]=r[a],r.pop())}}if(r===null&&(t.f&be)!==0&&(Pe===null||!Vt.call(Pe,t))){var s=t;(s.f&Ue)!==0&&(s.f^=Ue,s.f&=~Ot),_n(s),ji(s),vr(s,0)}}function vr(e,t){var r=e.deps;if(r!==null)for(var n=t;n<r.length;n++)Gi(e,r[n])}function Zt(e){var t=e.f;if((t&rt)===0){ce(e,he);var r=re,n=Cr;re=e,Cr=!0;try{(t&(kt|bn))!==0?Ui(e):jn(e),Ma(e);var a=Ua(e);e.teardown=typeof a=="function"?a:null,e.wv=Na;var s;Xr&&li&&(e.f&ge)!==0&&e.deps}finally{Cr=n,re=r}}}async function qi(){await Promise.resolve(),vi()}function i(e){var t=e.f,r=(t&be)!==0;if(ee!==null&&!Ve){var n=re!==null&&(re.f&rt)!==0;if(!n&&(ze===null||!Vt.call(ze,e))){var a=ee.deps;if((ee.f&en)!==0)e.rv<It&&(e.rv=It,Pe===null&&a!==null&&a[De]===e?De++:Pe===null?Pe=[e]:Pe.push(e));else{(ee.deps??=[]).push(e);var s=e.reactions;s===null?e.reactions=[ee]:Vt.call(s,ee)||s.push(ee)}}}if(wt&&xt.has(e))return xt.get(e);if(r){var u=e;if(wt){var d=u.v;return((u.f&he)===0&&u.reactions!==null||Ba(u))&&(d=xn(u)),xt.set(u,d),d}var o=(u.f&Ue)===0&&!Ve&&ee!==null&&(Cr||(ee.f&Ue)!==0),f=(u.f&er)===0;_r(u)&&(o&&(u.f|=Ue),ya(u)),o&&!f&&(wa(u),za(u))}if(He?.has(e))return He.get(e);if((e.f&mt)!==0)throw e.v;return e.v}function za(e){if(e.f|=Ue,e.deps!==null)for(const t of e.deps)(t.reactions??=[]).push(e),(t.f&be)!==0&&(t.f&Ue)===0&&(wa(t),za(t))}function Ba(e){if(e.v===ve)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(xt.has(t)||(t.f&be)!==0&&Ba(t))return!0;return!1}function Ut(e){var t=Ve;try{return Ve=!0,e()}finally{Ve=t}}function Ki(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(lt in e)an(e);else if(!Array.isArray(e))for(let t in e){const r=e[t];typeof r=="object"&&r&< in r&&an(r)}}}function an(e,t=new Set){if(typeof e=="object"&&e!==null&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let n in e)try{an(e[n],t)}catch{}const r=gn(e);if(r!==Object.prototype&&r!==Array.prototype&&r!==Map.prototype&&r!==Set.prototype&&r!==Date.prototype){const n=sa(r);for(let a in n){const s=n[a].get;if(s)try{s.call(e)}catch{}}}}}const Hi=["touchstart","touchmove"];function Vi(e){return Hi.includes(e)}const ur=Symbol("events"),Ga=new Set,sn=new Set;function Ji(e,t,r,n={}){function a(s){if(n.capture||on.call(t,s),!s.cancelBubble)return Nr(()=>r?.call(this,s))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?ut(()=>{t.addEventListener(e,a,n)}):t.addEventListener(e,a,n),a}function Rt(e,t,r,n,a){var s={capture:n,passive:a},u=Ji(e,t,r,s);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&wn(()=>{t.removeEventListener(e,u,s)})}function I(e,t,r){(t[ur]??={})[e]=r}function Ie(e){for(var t=0;t<e.length;t++)Ga.add(e[t]);for(var r of sn)r(e)}let Wn=null;function on(e){var t=this,r=t.ownerDocument,n=e.type,a=e.composedPath?.()||[],s=a[0]||e.target;Wn=e;var u=0,d=Wn===e&&e[ur];if(d){var o=a.indexOf(d);if(o!==-1&&(t===document||t===window)){e[ur]=t;return}var f=a.indexOf(t);if(f===-1)return;o<=f&&(u=o)}if(s=a[u]||e.target,s!==t){Ps(e,"currentTarget",{configurable:!0,get(){return s||r}});var v=ee,x=re;Be(null),nt(null);try{for(var g,R=[];s!==null;){var b=s.assignedSlot||s.parentNode||s.host||null;try{var y=s[ur]?.[n];y!=null&&(!s.disabled||e.target===s)&&y.call(s,e)}catch(m){g?R.push(m):g=m}if(e.cancelBubble||b===t||b===null)break;s=b}if(g){for(let m of R)queueMicrotask(()=>{throw m});throw g}}finally{e[ur]=t,delete e.currentTarget,Be(v),nt(x)}}}const Wi=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function Yi(e){return Wi?.createHTML(e)??e}function qa(e){var t=Mi("template");return t.innerHTML=Yi(e.replaceAll("<!>","<!---->")),t.content}function Ir(e,t){var r=re;r.nodes===null&&(r.nodes={start:e,end:t,a:null,t:null})}function j(e,t){var r=(t&ni)!==0,n=(t&ai)!==0,a,s=!e.startsWith("<!>");return()=>{a===void 0&&(a=qa(s?e:"<!>"+e),r||(a=Xt(a)));var u=n||ja?document.importNode(a,!0):a.cloneNode(!0);if(r){var d=Xt(u),o=u.lastChild;Ir(d,o)}else Ir(u,u);return u}}function $i(e,t,r="svg"){var n=!e.startsWith("<!>"),a=`<${r}>${n?e:"<!>"+e}</${r}>`,s;return()=>{if(!s){var u=qa(a),d=Xt(u);s=Xt(d)}var o=s.cloneNode(!0);return Ir(o,o),o}}function Xi(e,t){return $i(e,t,"svg")}function xr(){var e=document.createDocumentFragment(),t=document.createComment(""),r=yt();return e.append(t,r),Ir(t,r),e}function k(e,t){e!==null&&e.before(t)}function K(e,t){var r=t==null?"":typeof t=="object"?`${t}`:t;r!==(e.__t??=e.nodeValue)&&(e.__t=r,e.nodeValue=`${r}`)}function Zi(e,t){return Qi(e,t)}const Er=new Map;function Qi(e,{target:t,anchor:r,props:n={},events:a,context:s,intro:u=!0,transformError:d}){Ci();var o=void 0,f=Ni(()=>{var v=r??t.appendChild(yt());bi(v,{pending:()=>{}},R=>{xe({});var b=le;s&&(b.c=s),a&&(n.$$events=a),o=e(R,n)||{},ye()},d);var x=new Set,g=R=>{for(var b=0;b<R.length;b++){var y=R[b];if(!x.has(y)){x.add(y);var m=Vi(y);for(const M of[t,document]){var w=Er.get(M);w===void 0&&(w=new Map,Er.set(M,w));var L=w.get(y);L===void 0?(M.addEventListener(y,on,{passive:m}),w.set(y,1)):w.set(y,L+1)}}}};return g(Dr(Ga)),sn.add(g),()=>{for(var R of x)for(const m of[t,document]){var b=Er.get(m),y=b.get(R);--y==0?(m.removeEventListener(R,on),b.delete(R),b.size===0&&Er.delete(m)):b.set(R,y)}sn.delete(g),v!==r&&v.parentNode?.removeChild(v)}});return eo.set(o,f),o}let eo=new WeakMap;class to{anchor;#e=new Map;#o=new Map;#t=new Map;#i=new Set;#r=!0;constructor(t,r=!0){this.anchor=t,this.#r=r}#s=t=>{if(this.#e.has(t)){var r=this.#e.get(t),n=this.#o.get(r);if(n)En(n),this.#i.delete(r);else{var a=this.#t.get(r);a&&(a.effect.f&we)===0&&(this.#o.set(r,a.effect),this.#t.delete(r),a.fragment.lastChild.remove(),this.anchor.before(a.fragment),n=a.effect)}for(const[s,u]of this.#e){if(this.#e.delete(s),s===t)break;const d=this.#t.get(u);d&&(Ce(d.effect),this.#t.delete(u))}for(const[s,u]of this.#o){if(s===r||this.#i.has(s)||(u.f&we)!==0)continue;const d=()=>{if(Array.from(this.#e.values()).includes(s)){var f=document.createDocumentFragment();Rn(u,f),f.append(yt()),this.#t.set(s,{effect:u,fragment:f})}else Ce(u);this.#i.delete(s),this.#o.delete(s)};this.#r||!n?(this.#i.add(s),Tt(u,d,!1)):d()}}};#n=t=>{this.#e.delete(t);const r=Array.from(this.#e.values());for(const[n,a]of this.#t)r.includes(n)||(Ce(a.effect),this.#t.delete(n))};ensure(t,r){var n=ae,a=Pa();if(r&&!this.#o.has(t)&&!this.#t.has(t))if(a){var s=document.createDocumentFragment(),u=yt();s.append(u),this.#t.set(t,{effect:Le(()=>r(u)),fragment:s})}else this.#o.set(t,Le(()=>r(this.anchor)));if(this.#e.set(n,t),a){for(const[d,o]of this.#o)d===t?n.unskip_effect(o):n.skip_effect(o);for(const[d,o]of this.#t)d===t?n.unskip_effect(o.effect):n.skip_effect(o.effect);n.oncommit(this.#s),n.ondiscard(this.#n)}else this.#s(n)}}function z(e,t,r=!1){var n=new to(e),a=r?Jt:0;function s(u,d){n.ensure(u,d)}Sn(()=>{var u=!1;t((d,o=0)=>{u=!0,s(o,d)}),u||s(-1,null)},a)}function Jr(e,t){return t}function ro(e,t,r){for(var n=[],a=t.length,s,u=t.length,d=0;d<a;d++){let x=t[d];Tt(x,()=>{if(s){if(s.pending.delete(x),s.done.add(x),s.pending.size===0){var g=e.outrogroups;ln(e,Dr(s.done)),g.delete(s),g.size===0&&(e.outrogroups=null)}}else u-=1},!1)}if(u===0){var o=n.length===0&&r!==null;if(o){var f=r,v=f.parentNode;Ii(v),v.append(f),e.items.clear()}ln(e,t,!o)}else s={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(s)}function ln(e,t,r=!0){var n;if(e.pending.size>0){n=new Set;for(const u of e.pending.values())for(const d of u)n.add(e.items.get(d).e)}for(var a=0;a<t.length;a++){var s=t[a];if(n?.has(s)){s.f|=et;const u=document.createDocumentFragment();Rn(s,u)}else Ce(t[a],r)}}var Yn;function Je(e,t,r,n,a,s=null){var u=e,d=new Map,o=(t&ua)!==0;if(o){var f=e;u=f.appendChild(yt())}var v=null,x=Or(()=>{var M=r();return hn(M)?M:M==null?[]:Dr(M)}),g,R=new Map,b=!0;function y(M){(L.effect.f&rt)===0&&(L.pending.delete(M),L.fallback=v,no(L,g,u,t,n),v!==null&&(g.length===0?(v.f&et)===0?En(v):(v.f^=et,cr(v,null,u)):Tt(v,()=>{v=null})))}function m(M){L.pending.delete(M)}var w=Sn(()=>{g=i(x);for(var M=g.length,A=new Set,O=ae,_=Pa(),h=0;h<M;h+=1){var E=g[h],B=n(E,h),G=b?null:d.get(B);G?(G.v&&$t(G.v,E),G.i&&$t(G.i,h),_&&O.unskip_effect(G.e)):(G=ao(d,b?u:Yn??=yt(),E,B,h,a,t,r),b||(G.e.f|=et),d.set(B,G)),A.add(B)}if(M===0&&s&&!v&&(b?v=Le(()=>s(u)):(v=Le(()=>s(Yn??=yt())),v.f|=et)),M>A.size&&Ls(),!b)if(R.set(O,A),_){for(const[J,$]of d)A.has(J)||O.skip_effect($.e);O.oncommit(y),O.ondiscard(m)}else y(O);i(x)}),L={effect:w,items:d,pending:R,outrogroups:null,fallback:v};b=!1}function lr(e){for(;e!==null&&(e.f&Ye)===0;)e=e.next;return e}function no(e,t,r,n,a){var s=(n&$s)!==0,u=t.length,d=e.items,o=lr(e.effect.first),f,v=null,x,g=[],R=[],b,y,m,w;if(s)for(w=0;w<u;w+=1)b=t[w],y=a(b,w),m=d.get(y).e,(m.f&et)===0&&(m.nodes?.a?.measure(),(x??=new Set).add(m));for(w=0;w<u;w+=1){if(b=t[w],y=a(b,w),m=d.get(y).e,e.outrogroups!==null)for(const G of e.outrogroups)G.pending.delete(m),G.done.delete(m);if((m.f&et)!==0)if(m.f^=et,m===o)cr(m,null,r);else{var L=v?v.next:o;m===e.effect.last&&(e.effect.last=m.prev),m.prev&&(m.prev.next=m.next),m.next&&(m.next.prev=m.prev),gt(e,v,m),gt(e,m,L),cr(m,L,r),v=m,g=[],R=[],o=lr(v.next);continue}if((m.f&we)!==0&&(En(m),s&&(m.nodes?.a?.unfix(),(x??=new Set).delete(m))),m!==o){if(f!==void 0&&f.has(m)){if(g.length<R.length){var M=R[0],A;v=M.prev;var O=g[0],_=g[g.length-1];for(A=0;A<g.length;A+=1)cr(g[A],M,r);for(A=0;A<R.length;A+=1)f.delete(R[A]);gt(e,O.prev,_.next),gt(e,v,O),gt(e,_,M),o=M,v=_,w-=1,g=[],R=[]}else f.delete(m),cr(m,o,r),gt(e,m.prev,m.next),gt(e,m,v===null?e.effect.first:v.next),gt(e,v,m),v=m;continue}for(g=[],R=[];o!==null&&o!==m;)(f??=new Set).add(o),R.push(o),o=lr(o.next);if(o===null)continue}(m.f&et)===0&&g.push(m),v=m,o=lr(m.next)}if(e.outrogroups!==null){for(const G of e.outrogroups)G.pending.size===0&&(ln(e,Dr(G.done)),e.outrogroups?.delete(G));e.outrogroups.size===0&&(e.outrogroups=null)}if(o!==null||f!==void 0){var h=[];if(f!==void 0)for(m of f)(m.f&we)===0&&h.push(m);for(;o!==null;)(o.f&we)===0&&o!==e.fallback&&h.push(o),o=lr(o.next);var E=h.length;if(E>0){var B=(n&ua)!==0&&u===0?r:null;if(s){for(w=0;w<E;w+=1)h[w].nodes?.a?.measure();for(w=0;w<E;w+=1)h[w].nodes?.a?.fix()}ro(e,h,B)}}s&&ut(()=>{if(x!==void 0)for(m of x)m.nodes?.a?.apply()})}function ao(e,t,r,n,a,s,u,d){var o=(u&Ws)!==0?(u&Xs)===0?Ei(r,!1,!1):Nt(r):null,f=(u&Ys)!==0?Nt(a):null;return{v:o,i:f,e:Le(()=>(s(t,o??r,f??a,d),()=>{e.delete(n)}))}}function cr(e,t,r){if(e.nodes)for(var n=e.nodes.start,a=e.nodes.end,s=t&&(t.f&et)===0?t.nodes.start:r;n!==null;){var u=mr(n);if(s.before(n),n===a)return;n=u}}function gt(e,t,r){t===null?e.effect.first=r:t.next=r,r===null?e.effect.last=t:r.prev=t}function Ka(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=Ka(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function so(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=Ka(e))&&(n&&(n+=" "),n+=t);return n}function io(e){return typeof e=="object"?so(e):e??""}function oo(e,t,r){var n=e==null?"":""+e;return n===""?null:n}function lo(e,t){return e==null?null:String(e)}function pe(e,t,r,n,a,s){var u=e.__className;if(u!==r||u===void 0){var d=oo(r);d==null?e.removeAttribute("class"):t?e.className=d:e.setAttribute("class",d),e.__className=r}return s}function Pn(e,t,r,n){var a=e.__style;if(a!==t){var s=lo(t);s==null?e.removeAttribute("style"):e.style.cssText=s,e.__style=t}return n}function Ha(e,t,r=!1){if(e.multiple){if(t==null)return;if(!hn(t))return si();for(var n of e.options)n.selected=t.includes($n(n));return}for(n of e.options){var a=$n(n);if(Pi(a,t)){n.selected=!0;return}}(!r||t!==void 0)&&(e.selectedIndex=-1)}function uo(e){var t=new MutationObserver(()=>{Ha(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),wn(()=>{t.disconnect()})}function $n(e){return"__value"in e?e.__value:e.value}const co=Symbol("is custom element"),fo=Symbol("is html"),vo=Ns?"progress":"PROGRESS";function dt(e,t){var r=Cn(e);r.value===(r.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!==vo)||(e.value=t??"")}function Va(e,t){var r=Cn(e);r.checked!==(r.checked=t??void 0)&&(e.checked=t)}function V(e,t,r,n){var a=Cn(e);a[t]!==(a[t]=r)&&(t==="loading"&&(e[Os]=r),r==null?e.removeAttribute(t):typeof r!="string"&&po(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function Cn(e){return e.__attributes??={[co]:e.nodeName.includes("-"),[fo]:e.namespaceURI===ca}}var Xn=new Map;function po(e){var t=e.getAttribute("is")||e.nodeName,r=Xn.get(t);if(r)return r;Xn.set(t,r=[]);for(var n,a=e,s=Element.prototype;s!==a;){n=sa(a);for(var u in n)n[u].set&&r.push(u);a=gn(a)}return r}function un(e,t,r=t){var n=new WeakSet;Di(e,"input",async a=>{var s=a?e.defaultValue:e.value;if(s=Wr(e)?Yr(s):s,r(s),ae!==null&&n.add(ae),await qi(),s!==(s=t())){var u=e.selectionStart,d=e.selectionEnd,o=e.value.length;if(e.value=s??"",d!==null){var f=e.value.length;u===d&&d===o&&f>o?(e.selectionStart=f,e.selectionEnd=f):(e.selectionStart=u,e.selectionEnd=Math.min(d,f))}}}),Ut(t)==null&&e.value&&(r(Wr(e)?Yr(e.value):e.value),ae!==null&&n.add(ae)),kn(()=>{var a=t();if(e===document.activeElement){var s=tn??ae;if(n.has(s))return}Wr(e)&&a===Yr(e.value)||e.type==="date"&&!a&&!e.value||a!==e.value&&(e.value=a??"")})}function Wr(e){var t=e.type;return t==="number"||t==="range"}function Yr(e){return e===""?null:+e}function Zn(e,t){return e===t||e?.[lt]===t}function ho(e={},t,r,n){return Fi(()=>{var a,s;return kn(()=>{a=s,s=[],Ut(()=>{e!==r(...s)&&(t(e,...s),a&&Zn(r(...a),e)&&t(null,...a))})}),()=>{ut(()=>{s&&Zn(r(...s),e)&&t(null,...s)})}}),e}function Ja(e=!1){const t=le,r=t.l.u;if(!r)return;let n=()=>Ki(t.s);if(e){let a=0,s={};const u=br(()=>{let d=!1;const o=t.s;for(const f in o)o[f]!==s[f]&&(s[f]=o[f],d=!0);return d&&a++,a});n=()=>i(u)}r.b.length&&Oi(()=>{Qn(t,n),Zr(r.b)}),ct(()=>{const a=Ut(()=>r.m.map(Ts));return()=>{for(const s of a)typeof s=="function"&&s()}}),r.a.length&&ct(()=>{Qn(t,n),Zr(r.a)})}function Qn(e,t){if(e.l.s)for(const r of e.l.s)i(r);t()}let Rr=!1;function go(e){var t=Rr;try{return Rr=!1,[e(),Rr]}finally{Rr=t}}function pr(e,t,r,n){var a=!rr||(r&Qs)!==0,s=(r&ti)!==0,u=(r&ri)!==0,d=n,o=!0,f=()=>(o&&(o=!1,d=u?Ut(n):n),d),v;if(s){var x=lt in e||As in e;v=Ht(e,t)?.set??(x&&t in e?M=>e[t]=M:void 0)}var g,R=!1;s?[g,R]=go(()=>e[t]):g=e[t],g===void 0&&n!==void 0&&(g=f(),v&&(a&&qs(),v(g)));var b;if(a?b=()=>{var M=e[t];return M===void 0?f():(o=!0,M)}:b=()=>{var M=e[t];return M!==void 0&&(d=void 0),M===void 0?d:M},a&&(r&ei)===0)return b;if(v){var y=e.$$legacy;return(function(M,A){return arguments.length>0?((!a||!A||y||R)&&v(A?b():M),M):b()})}var m=!1,w=((r&Zs)!==0?br:Or)(()=>(m=!1,b()));s&&i(w);var L=re;return(function(M,A){if(arguments.length>0){const O=A?i(w):a&&s?Ae(M):M;return l(w,O),m=!0,d!==void 0&&(d=O),M}return wt&&m||(L.f&rt)!==0?w.v:i(w)})}function Wa(e){le===null&&la(),rr&&le.l!==null?mo(le).m.push(e):ct(()=>{const t=Ut(e);if(typeof t=="function")return t})}function bo(e){le===null&&la(),Wa(()=>()=>Ut(e))}function mo(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}const _o="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(_o);const Ya=[{id:"google/gemini-3.1-flash-image-preview",label:"Nano Banana 2",requestFormat:"image-config"},{id:"google/gemini-3-pro-image-preview",label:"Nano Banana Pro",requestFormat:"image-config"},{id:"openai/gpt-5-image",label:"GPT-5 Image",requestFormat:"openai-size"}],$a=Ya[0].id,xo=[1,2,4,6];async function ue(e,t){const r=typeof window<"u"?new URL(e,window.location.origin).toString():e,n=await fetch(r,{headers:{"Content-Type":"application/json",...t?.headers??{}},...t}),a=n.headers.get("content-type")??"";if(!n.ok){let s={};try{s=await n.json()}catch{}throw new Error(s.error?.message??`Request failed: ${n.status}`)}if(!a.includes("application/json")){const u=(await n.text()).trimStart();throw u.startsWith("<!doctype")||u.startsWith("<html")?new Error("Expected JSON from /api but received HTML. Start the app through `npm run web`, or use a dev server with the local bridge middleware enabled."):new Error(`Expected JSON response but received ${a||"unknown content type"}`)}return n.json()}function yo(e){return new Promise((t,r)=>{const n=new FileReader;n.onload=()=>t(String(n.result)),n.onerror=()=>r(new Error(`Failed to read file: ${e.name}`)),n.readAsDataURL(e)})}async function wo(){return ue("/api/bootstrap")}async function ko(e){return ue("/api/config",{method:"PATCH",body:JSON.stringify(e)})}async function So(){return ue("/api/models")}async function jo(e){return ue("/api/models",{method:"POST",body:JSON.stringify(e)})}async function Eo(e,t){return ue(`/api/models/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)})}async function Ro(e){return ue(`/api/models/${encodeURIComponent(e)}`,{method:"DELETE"})}async function Po(e){return ue(`/api/models/${encodeURIComponent(e)}/set-default`,{method:"POST"})}async function Co(){return ue("/api/models/restore-defaults",{method:"POST"})}async function Io(e){return ue("/api/projects",{method:"POST",body:JSON.stringify({name:e})})}async function Mo(){return ue("/api/projects")}async function To(e){return ue(`/api/projects/${encodeURIComponent(e)}`)}async function Do(e){return ue(`/api/projects/${encodeURIComponent(e)}/use`,{method:"POST"})}async function Ao(e,t){return ue(`/api/projects/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)})}async function Oo(e,t,r="both"){const n=await Promise.all(t.map(async({file:a,width:s,height:u})=>({filename:a.name,mimeType:a.type,width:s,height:u,dataUrl:await yo(a)})));return ue(`/api/projects/${encodeURIComponent(e)}/refs`,{method:"POST",body:JSON.stringify({body:{files:n,role:r}})})}async function No(e,t){await ue(`/api/projects/${encodeURIComponent(e)}/refs/${encodeURIComponent(t)}`,{method:"DELETE"})}async function Xa(e,t,r){return ue(`/api/projects/${encodeURIComponent(e)}/refs/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify({role:r})})}async function Fo(e){return ue(`/api/projects/${encodeURIComponent(e)}/status`)}async function Lo(e,t="both",r){return ue(`/api/projects/${encodeURIComponent(e)}/derive`,{method:"POST",body:JSON.stringify({target:t,persist:r?.persist})})}async function Uo(e){return ue(`/api/projects/${encodeURIComponent(e.projectId)}/generate`,{method:"POST",body:JSON.stringify({prompt:e.prompt,feedback:e.feedback,sessionId:e.sessionId??void 0,selectedImageDataUrls:e.selectedImageDataUrls??[],model:e.model,sizePreset:e.sizePreset,imageCount:e.imageCount})})}async function Za(e){return ue(`/api/projects/${encodeURIComponent(e)}/sessions`)}async function zo(e,t){return ue(`/api/projects/${encodeURIComponent(e)}/sessions/${encodeURIComponent(t)}`)}async function Bo(e,t){await ue(`/api/projects/${encodeURIComponent(e)}/sessions/${encodeURIComponent(t)}`,{method:"DELETE"})}let yr=N(!1),Fr=N("16:9"),Lr=N(4),at=N(Ae($a)),cn=N(Ae(Ya.map(e=>({id:e.id,label:e.label,source:"builtin"})))),dn=N(Ae($a)),fn=N(!1),vn=N(!1),hr=N(null);async function Go(){l(vn,!0);try{const e=await wo();l(yr,e.config.apiKeyConfigured,!0),l(Fr,e.config.sizePreset,!0),l(Lr,e.config.imageCount,!0),l(at,e.config.model,!0),wr(e.modelRegistry),l(hr,null),l(fn,!0)}catch(e){l(hr,e instanceof Error?e.message:"Failed to load settings",!0),l(fn,!0)}finally{l(vn,!1)}}function qo(e){l(yr,e.apiKeyConfigured,!0),l(Fr,e.sizePreset,!0),l(Lr,e.imageCount,!0),l(at,e.model,!0)}function wr(e){l(cn,e.models,!0),l(dn,e.defaultModelId,!0),i(cn).some(t=>t.id===i(at))||l(at,i(dn),!0)}async function zt(e){try{const t=await ko(e);qo(t),l(hr,null)}catch(t){throw l(hr,t instanceof Error?t.message:"Failed to save settings",!0),t}}function Qa(e){return l(yr,e.trim().length>0),zt({apiKey:e})}function Ko(){return l(yr,!1),zt({apiKey:""})}function Ho(e){return l(Fr,e,!0),zt({sizePreset:e})}function Vo(e){return l(Lr,e,!0),zt({imageCount:e})}function Jo(e){return l(at,e,!0),zt({model:e})}async function es(){wr(await So())}async function Wo(e){await jo(e),await es()}async function Yo(e,t){await Eo(e,t),await es()}async function $o(e){const t=await Ro(e);wr(t),i(at)===e&&l(at,t.defaultModelId,!0)}async function Xo(e){const t=await Po(e);wr(t),l(at,t.defaultModelId,!0),await zt({model:t.defaultModelId})}async function Zo(){const e=await Co();wr(e),l(at,e.defaultModelId,!0),await zt({model:e.defaultModelId})}const ne={get apiKeyConfigured(){return i(yr)},get sizePreset(){return i(Fr)},get imageCount(){return i(Lr)},get model(){return i(at)},get availableModels(){return i(cn)},get defaultModelId(){return i(dn)},get ready(){return i(fn)},get loading(){return i(vn)},get loadError(){return i(hr)}};let Ft=N(Ae([])),fe=N(null),ke=N(Ae([])),Mr=N(null);function Qo(){if(i(fe)!==null)return i(Ft).find(e=>e.id===i(fe))}const ea=new Proxy([],{get(e,t){return Reflect.get(i(Ft),t)},has(e,t){return Reflect.has(i(Ft),t)}}),ft={get value(){return i(fe)}},Ur=Qo,Kt=new Proxy([],{get(e,t){return Reflect.get(i(ke),t)},has(e,t){return Reflect.has(i(ke),t)}}),Mt={get value(){return i(Mr)}};let ts=null;function el(e){ts=e}function rs(e){l(Ft,e.projects,!0),l(fe,e.currentProjectId,!0),l(ke,e.activeProject?.refs??[],!0)}async function St(e){if(!e){l(Mr,null);return}l(Mr,await Fo(e),!0)}async function tl(){const e=await Mo();if(l(Ft,e.projects,!0),l(fe,e.currentProjectId,!0),l(ke,[],!0),l(Mr,null),e.currentProjectId){const t=await To(e.currentProjectId);l(ke,t.refs,!0),await St(e.currentProjectId)}}async function rl(e){const t=await Io(e);return rs(t),await St(t.currentProjectId),t.project}async function nl(e){ts?.();const t=await Do(e);rs(t),await St(t.currentProjectId)}async function al(e,t){const r=await Ao(e,t);return l(Ft,i(Ft).map(n=>n.id===e?r:n),!0),i(fe)===e&&(l(ke,r.refs,!0),await St(e)),r}async function sl(e,t="both",r){return await Lo(e,t,r)}async function il(e,t,r,n="both"){if(i(fe)===null)throw new Error("No active project");const[a]=await Oo(i(fe),[{file:e,width:t,height:r}],n);return l(ke,[...i(ke),a],!0),await St(i(fe)),a}async function ol(e){if(i(fe)===null)throw new Error("No active project");await No(i(fe),e),l(ke,i(ke).filter(t=>t.id!==e),!0),await St(i(fe))}async function ll(e,t){if(i(fe)===null)throw new Error("No active project");const r=await Xa(i(fe),e,t);return l(ke,i(ke).map(n=>n.id===e?r:n),!0),await St(i(fe)),r}async function ul(){if(i(fe)===null)throw new Error("No active project");const e=i(ke).filter(n=>n.role!=="both");if(e.length===0)return;const t=await Promise.all(e.map(n=>Xa(i(fe),n.id,"both"))),r=new Map(t.map(n=>[n.id,n]));l(ke,i(ke).map(n=>r.get(n.id)??n),!0),await St(i(fe))}var cl=j('<p class="mt-1 text-xs text-red-600"> </p>'),dl=j(`<div data-testid="api-key-setup" class="flex items-center justify-center min-h-screen bg-slate-50"><div class="w-full max-w-md mx-4 bg-white rounded-xl shadow-lg p-8"><div class="text-center mb-6"><h1 class="text-2xl font-bold text-slate-900 mb-2">Image Sprout</h1> <p class="text-sm text-slate-600">To get started, you'll need an OpenRouter API key. This key is used to
|
|
2
|
+
generate images via the OpenRouter API and is stored locally on your
|
|
3
|
+
machine for this installation.</p></div> <div class="space-y-4"><div><label for="api-key-input" class="block text-sm font-medium text-slate-700 mb-1">API Key</label> <input id="api-key-input" type="password" placeholder="sk-or-..." class="w-full px-3 py-2 border border-slate-300 rounded-lg text-sm text-slate-900 placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-accent-500 focus:border-transparent"/> <!></div> <button class="w-full px-4 py-2.5 bg-accent-600 text-white text-sm font-semibold rounded-lg hover:bg-accent-700 transition-colors cursor-pointer">Save</button></div> <p class="mt-4 text-center text-xs text-slate-500">Don't have a key? <a href="https://openrouter.ai/keys" target="_blank" rel="noopener noreferrer" class="text-accent-600 hover:text-accent-700 underline">Get one at OpenRouter</a></p></div></div>`);function fl(e,t){xe(t,!0);let r=N(""),n=N("");function a(y){l(r,y.target.value,!0)}function s(){const y=i(r).trim();if(!y){l(n,"Please enter an API key");return}l(n,""),Qa(y)}function u(y){y.key==="Enter"&&s()}var d=dl(),o=c(d),f=p(c(o),2),v=c(f),x=p(c(v),2),g=p(x,2);{var R=y=>{var m=cl(),w=c(m);q(()=>K(w,i(n))),k(y,m)};z(g,y=>{i(n)&&y(R)})}var b=p(v,2);q(()=>dt(x,i(r))),I("input",x,a),I("keydown",x,u),I("click",b,s),k(e,d),ye()}Ie(["input","keydown","click"]);var vl=j('<p data-testid="project-selector-error" class="px-4 py-1 text-xs text-red-600"> </p>'),pl=j('<div class="px-4 py-3"><p class="text-sm font-medium text-slate-700 mb-2">Create your first project</p> <input data-testid="new-project-input" type="text" placeholder="Project name..." class="w-full px-3 py-1.5 text-sm border border-slate-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"/></div>'),hl=Xi('<svg class="ml-auto w-4 h-4 text-indigo-600 flex-shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7"></path></svg>'),gl=j('<button><span class="truncate"> </span> <!></button>'),bl=j('<div class="px-3 py-2"><input data-testid="new-project-input" type="text" placeholder="Project name..." class="w-full px-2 py-1.5 text-sm border border-slate-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"/></div>'),ml=j('<button data-testid="new-project-button" class="flex items-center w-full px-3 py-2 text-left text-sm text-indigo-600 hover:bg-indigo-50 transition-colors cursor-pointer"><svg class="w-4 h-4 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4v16m8-8H4"></path></svg> New Project</button>'),_l=j('<div data-testid="project-dropdown-list" class="absolute left-0 right-0 z-10 mt-1 bg-white border border-slate-200 rounded-md shadow-lg max-h-64 overflow-y-auto"><!> <div class="border-t border-slate-100"><!></div></div>'),xl=j('<button data-testid="project-selector-trigger" class="flex items-center justify-between w-full mt-2 px-2.5 py-1.5 text-left text-sm text-slate-700 bg-slate-50 border border-slate-200 rounded-md hover:bg-slate-100 transition-colors cursor-pointer"><span class="truncate"> </span> <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M19 9l-7 7-7-7"></path></svg></button> <!>',1),yl=j('<div class="relative" data-testid="project-selector"><!> <!></div>');function wl(e,t){xe(t,!0);let r=N(!1),n=N(!1),a=N(""),s=N(!1),u=N(null);const d=te(()=>ea.length>0),o=te(Ur);async function f(){const A=i(a).trim();if(!(!A||i(s))){l(s,!0),l(u,null);try{await rl(A),l(a,""),l(n,!1),l(r,!1)}catch(O){l(u,O instanceof Error?O.message:"Failed to create project",!0),console.error("Failed to create project:",O)}finally{l(s,!1)}}}function v(A){A.key==="Enter"?f():A.key==="Escape"&&(l(a,""),l(n,!1))}async function x(A){l(r,!1),l(u,null);try{await nl(A)}catch(O){l(u,O instanceof Error?O.message:"Failed to switch project",!0),console.error("Failed to switch project:",O)}}function g(){l(r,!i(r)),i(r)||l(n,!1)}function R(){l(n,!0)}var b=yl(),y=c(b);{var m=A=>{var O=vl(),_=c(O);q(()=>K(_,i(u))),k(A,O)};z(y,A=>{i(u)&&A(m)})}var w=p(y,2);{var L=A=>{var O=pl(),_=p(c(O),2);I("keydown",_,v),un(_,()=>i(a),h=>l(a,h)),k(A,O)},M=A=>{var O=xl(),_=_e(O),h=c(_),E=c(h),B=p(h,2),G=p(_,2);{var J=$=>{var Z=_l(),F=c(Z);Je(F,17,()=>ea,H=>H.id,(H,X)=>{var se=gl(),Se=c(se),Oe=c(Se),$e=p(Se,2);{var Xe=Me=>{var Ze=hl();k(Me,Ze)};z($e,Me=>{ft.value===i(X).id&&Me(Xe)})}q(()=>{V(se,"data-testid",`project-option-${i(X).id??""}`),pe(se,1,`flex items-center w-full px-3 py-2 text-left text-sm transition-colors cursor-pointer ${ft.value===i(X).id?"bg-indigo-50 text-indigo-700 font-medium":"text-slate-700 hover:bg-slate-50"}`),K(Oe,i(X).name)}),I("click",se,()=>x(i(X).id)),k(H,se)});var P=p(F,2),U=c(P);{var T=H=>{var X=bl(),se=c(X);I("keydown",se,v),un(se,()=>i(a),Se=>l(a,Se)),k(H,X)},W=H=>{var X=ml();I("click",X,R),k(H,X)};z(U,H=>{i(n)?H(T):H(W,-1)})}k($,Z)};z(G,$=>{i(r)&&$(J)})}q(()=>{K(E,i(o)?.name??"Select project"),pe(B,0,`w-3.5 h-3.5 text-slate-400 transition-transform duration-200 ${i(r)?"rotate-180":""}`)}),I("click",_,g),k(A,O)};z(w,A=>{!i(d)&&!i(o)?A(L):A(M,-1)})}k(e,b),ye()}Ie(["keydown","click"]);let Tr=N(Ae([]));const ta=new Proxy([],{get(e,t){return Reflect.get(i(Tr),t)},has(e,t){return Reflect.has(i(Tr),t)}});async function ra(e){l(Tr,await Za(e),!0)}async function ns(e){l(Tr,await Za(e),!0)}function kl(){return{status:"idle",results:[],prompt:"",feedback:"",error:null,activeSessionId:null,activeRunIndex:0,sessionRuns:[],draftActive:!1}}let C=Ae(kl());function as(){return C.results.filter(e=>e.status==="success"&&e.selected)}function Sl(){C.status="generating",C.error=null}function jl(e){e<0||e>=C.results.length||(C.results[e].selected=!C.results[e].selected)}function na(){for(const e of C.results)e.selected=!1}function $r(e){C.feedback=e}function zr(){C.status="idle",C.results=[],C.prompt="",C.feedback="",C.error=null,C.activeSessionId=null,C.activeRunIndex=0,C.sessionRuns=[],C.draftActive=!1}function El(){zr(),C.draftActive=!0}el(zr);function In(e){C.results=e.images.map(t=>t.status==="error"?{status:"error",error:t.error??"Unknown error",selected:!1}:{status:"success",imageDataUrl:t.imageDataUrl,selected:!1}),C.prompt=e.prompt,C.feedback=e.feedback??""}async function Rl(e){const t=ft.value;if(!t)return;const{session:r,runs:n}=await zo(t,e);if(C.draftActive=!1,C.activeSessionId=e,C.sessionRuns=n,C.prompt=r.prompt,n.length>0){const a=n.length-1;C.activeRunIndex=a,In(n[a]),C.status="complete"}}function Pl(e){e<0||e>=C.sessionRuns.length||(C.activeRunIndex=e,In(C.sessionRuns[e]))}async function Cl(e){const t=ft.value;t&&(await Bo(t,e),C.activeSessionId===e&&zr(),await ns(t))}async function pn(e){Sl();try{const t=Ur(),r=ft.value;if(!r||!t)throw new Error("No active project");const n=await Uo({projectId:r,prompt:e.prompt,feedback:C.feedback||null,sessionId:C.activeSessionId,selectedImageDataUrls:as().filter(a=>a.status==="success").map(a=>a.imageDataUrl),model:ne.model,sizePreset:ne.sizePreset,imageCount:ne.imageCount});C.draftActive=!1,C.activeSessionId=n.sessionId,C.sessionRuns=n.runs,C.activeRunIndex=n.runs.length-1,In(n.run),C.status="complete",await ns(r)}catch(t){C.status="error",C.error=t instanceof Error?t.message:"Generation failed"}}var Il=j('<p class="text-sm text-slate-500">Generate from the main canvas to create the first session for this project.</p>'),Ml=j('<p class="text-sm text-slate-500 mb-3">Set up references and guides before generating the first session for this project.</p> <button data-testid="empty-state-settings-link" class="text-sm font-medium text-accent-600 hover:text-accent-700 transition-colors cursor-pointer">Open Project Settings</button>',1),Tl=j('<div data-testid="session-history-empty" class="px-4 py-6"><div class="bg-slate-50 rounded-lg p-4 text-center"><!></div></div>'),Dl=j('<div data-testid="session-draft" class="flex items-center w-full px-4 py-2.5 text-left bg-accent-50 border-r-2 border-accent-500"><div class="flex-1 min-w-0"><p class="text-sm text-slate-500 italic">New session</p> <p class="text-xs text-slate-400">Enter a prompt to begin</p></div></div>'),Al=j('<div class="ml-2 flex items-center gap-1"><button class="px-1.5 py-0.5 text-xs font-medium text-red-600 bg-red-50 rounded hover:bg-red-100 transition-colors cursor-pointer">Delete?</button> <button class="p-0.5 text-slate-400 hover:text-slate-600 transition-colors cursor-pointer" aria-label="Cancel delete"><svg class="w-3 h-3" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"></path></svg></button></div>'),Ol=j('<button class="ml-2 p-1 text-slate-300 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer" aria-label="Delete session"><svg class="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"></path></svg></button>'),Nl=j('<div role="button" tabindex="0"><div class="flex-1 min-w-0"><p class="text-sm text-slate-700 truncate"> </p> <p class="text-xs text-slate-400"> </p></div> <!></div>'),Fl=j('<div data-testid="session-history-list" class="py-1"><!> <!></div>'),Ll=j('<div class="flex items-center justify-between px-4 py-2 border-b border-slate-100"><h2 class="text-xs font-semibold uppercase tracking-[0.14em] text-slate-400">Sessions</h2> <button data-testid="new-session-button" class="rounded-md border border-slate-200 bg-white px-2.5 py-1 text-xs font-medium text-slate-600 hover:bg-slate-50 hover:text-slate-800 transition-colors cursor-pointer">New Session</button></div> <!>',1);function Ul(e,t){xe(t,!0),ct(()=>{const w=ft.value;w&&ra(w)});function r(w){const L=new Date(w),A=new Date().getTime()-L.getTime(),O=Math.floor(A/1e3),_=Math.floor(O/60),h=Math.floor(_/60),E=Math.floor(h/24);return O<60?"just now":_<60?`${_}m ago`:h<24?`${h}h ago`:E<7?`${E}d ago`:L.toLocaleDateString()}async function n(w){await Rl(w)}let a=N(null),s=null;function u(w,L){w.stopPropagation(),s&&clearTimeout(s),l(a,L,!0),s=setTimeout(()=>{l(a,null)},3e3)}async function d(w,L){w.stopPropagation(),s&&clearTimeout(s),l(a,null),await Cl(L);const M=ft.value;M&&await ra(M)}function o(w){w.stopPropagation(),s&&clearTimeout(s),l(a,null)}function f(){El()}const v=te(()=>Mt.value?.readiness.generate??!1);var x=Ll(),g=_e(x),R=p(c(g),2),b=p(g,2);{var y=w=>{var L=Tl(),M=c(L),A=c(M);{var O=h=>{var E=Il();k(h,E)},_=h=>{var E=Ml(),B=p(_e(E),2);I("click",B,()=>t.onOpenSettings?.()),k(h,E)};z(A,h=>{i(v)?h(O):h(_,-1)})}k(w,L)},m=w=>{var L=Fl(),M=c(L);{var A=_=>{var h=Dl();k(_,h)};z(M,_=>{C.draftActive&&_(A)})}var O=p(M,2);Je(O,17,()=>ta,_=>_.id,(_,h)=>{var E=Nl(),B=c(E),G=c(B),J=c(G),$=p(G,2),Z=c($),F=p(B,2);{var P=T=>{var W=Al(),H=c(W),X=p(H,2);q(()=>{V(W,"data-testid",`confirm-delete-${i(h).id??""}`),V(H,"data-testid",`confirm-delete-yes-${i(h).id??""}`),V(X,"data-testid",`confirm-delete-no-${i(h).id??""}`)}),I("click",H,se=>d(se,i(h).id)),I("click",X,se=>o(se)),k(T,W)},U=T=>{var W=Ol();q(()=>V(W,"data-testid",`delete-session-${i(h).id??""}`)),I("click",W,H=>u(H,i(h).id)),k(T,W)};z(F,T=>{i(a)===i(h).id?T(P):T(U,-1)})}q(T=>{V(E,"data-testid",`session-item-${i(h).id??""}`),pe(E,1,`flex items-center w-full px-4 py-2.5 text-left hover:bg-slate-50 transition-colors cursor-pointer group ${C.activeSessionId===i(h).id?"bg-accent-50 border-r-2 border-accent-500":""}`),K(J,i(h).prompt),K(Z,T)},[()=>r(i(h).updatedAt)]),I("click",E,()=>n(i(h).id)),I("keydown",E,T=>T.key==="Enter"&&n(i(h).id)),k(_,E)}),k(w,L)};z(b,w=>{ta.length===0&&!C.draftActive?w(y):w(m,-1)})}I("click",R,f),k(e,x),ye()}Ie(["click","keydown"]);var zl=j('<button data-testid="sidebar-settings-button" class="flex items-center gap-2 px-4 py-2.5 text-sm text-slate-600 hover:bg-slate-50 transition-colors cursor-pointer border-b border-slate-100"><svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path><path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path></svg> <span>Project Settings</span></button>'),Bl=j('<input type="password" placeholder="Enter new API key" class="w-full px-2 py-1.5 border border-slate-300 rounded text-xs text-slate-900 placeholder-slate-400 focus:outline-none focus:ring-1 focus:ring-accent-500 mb-2"/> <div class="flex gap-2"><button data-testid="sidebar-api-key-save" class="px-2 py-1 bg-accent-600 text-white rounded text-xs hover:bg-accent-700 transition-colors cursor-pointer">Save</button> <button class="px-2 py-1 text-slate-500 hover:text-slate-700 text-xs cursor-pointer">Cancel</button></div>',1),Gl=j('<p class="text-slate-600 mb-2">Key: <span class="font-medium"> </span></p> <div class="flex gap-2"><button data-testid="sidebar-api-key-change" class="px-2 py-1 text-accent-600 hover:text-accent-700 text-xs cursor-pointer">Change</button> <button data-testid="sidebar-api-key-remove" class="px-2 py-1 text-red-600 hover:text-red-700 text-xs cursor-pointer">Remove</button></div>',1),ql=j('<div data-testid="sidebar-api-key-editor" class="mt-2 p-2 bg-slate-50 rounded-lg text-xs"><!></div>'),Kl=j('<aside data-testid="sidebar" class="flex flex-col h-full overflow-y-auto bg-white border-r border-slate-200"><div class="px-4 py-3 border-b border-slate-200"><h1 class="text-lg font-bold text-slate-900">Image Sprout</h1> <!></div> <!> <div class="flex-1 overflow-y-auto"><!></div> <div class="border-t border-slate-200 px-4 py-2"><button data-testid="sidebar-api-key-button" class="text-xs text-slate-500 hover:text-accent-600 transition-colors cursor-pointer">API Key</button> <!></div></aside>');function Hl(e,t){xe(t,!0);const r=te(()=>Ur()!==void 0);let n=N(!1),a=N(!1),s=N("");function u(){l(n,!i(n)),l(a,!1),l(s,"")}function d(){l(a,!0),l(s,"")}function o(){const _=i(s).trim();_&&(Qa(_),l(a,!1),l(s,""))}function f(){Ko(),l(n,!1),l(a,!1)}var v=Kl(),x=c(v),g=p(c(x),2);wl(g,{});var R=p(x,2);{var b=_=>{var h=zl();I("click",h,()=>t.onOpenSettings?.()),k(_,h)};z(R,_=>{i(r)&&_(b)})}var y=p(R,2),m=c(y);{var w=_=>{Ul(_,{onOpenSettings:()=>t.onOpenSettings?.()})};z(m,_=>{i(r)&&_(w)})}var L=p(y,2),M=c(L),A=p(M,2);{var O=_=>{var h=ql(),E=c(h);{var B=J=>{var $=Bl(),Z=_e($),F=p(Z,2),P=c(F),U=p(P,2);un(Z,()=>i(s),T=>l(s,T)),I("click",P,o),I("click",U,()=>{l(a,!1),l(s,"")}),k(J,$)},G=J=>{var $=Gl(),Z=_e($),F=p(c(Z)),P=c(F),U=p(Z,2),T=c(U),W=p(T,2);q(()=>K(P,ne.apiKeyConfigured?"Configured":"Not set")),I("click",T,d),I("click",W,f),k(J,$)};z(E,J=>{i(a)?J(B):J(G,-1)})}k(_,h)};z(A,_=>{i(n)&&_(O)})}I("click",M,u),k(e,v),ye()}Ie(["click"]);ui();var Vl=j('<div class="bg-slate-100"><img class="block h-auto w-full select-none pointer-events-none"/></div>'),Jl=j('<div class="absolute inset-0 flex items-center justify-center bg-slate-100 p-4"><p class="text-sm text-red-600 text-center"> </p></div>'),Wl=j('<div class="absolute top-2 right-2 bg-indigo-600 text-white rounded-full w-6 h-6 flex items-center justify-center"><svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="3"><path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7"></path></svg></div>'),Yl=j('<span class="text-xs text-green-300 font-medium">Copied!</span>'),$l=j('<span class="text-xs text-red-300 font-medium"> </span>'),Xl=j('<div class="absolute bottom-0 left-0 right-0 z-10 flex items-center justify-center gap-2 bg-black/60 p-1.5 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100"><button type="button" class="inline-flex cursor-pointer rounded bg-white/20 p-1 text-white transition-colors hover:bg-white/40" title="View larger"><svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"></path></svg></button> <button type="button" class="inline-flex cursor-pointer rounded bg-white/20 p-1 text-white transition-colors hover:bg-white/40" title="Download PNG"><svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2M7 10l5 5m0 0l5-5m-5 5V3"></path></svg></button> <button type="button" class="inline-flex cursor-pointer rounded bg-white/20 p-1 text-white transition-colors hover:bg-white/40" title="Copy to clipboard"><svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"></path></svg></button> <!> <!></div>'),Zl=j('<div role="button" tabindex="0"><!> <span class="absolute top-2 left-2 bg-black/50 text-white text-xs rounded-full w-5 h-5 flex items-center justify-center"> </span> <!> <!></div>');function aa(e,t){xe(t,!0);let r=pr(t,"sizePreset",3,"16:9"),n=N(!1),a=N("");function s(){jl(t.index)}function u(_){_.target===_.currentTarget&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),s())}function d(_){if(_.stopPropagation(),t.result.status!=="success")return;const h=document.createElement("a");h.href=t.result.imageDataUrl,h.download=`image-sprout-${t.index+1}.png`,document.body.appendChild(h),h.click(),document.body.removeChild(h)}function o(_){const[h,E]=_.split(","),B=h.match(/:(.*?);/),G=B?B[1]:"image/png",J=atob(E),$=new Uint8Array(J.length);for(let Z=0;Z<J.length;Z++)$[Z]=J.charCodeAt(Z);return new Blob([$],{type:G})}async function f(_){if(_.stopPropagation(),t.result.status==="success")try{const h=o(t.result.imageDataUrl);await navigator.clipboard.write([new ClipboardItem({[h.type]:h})]),l(n,!0),l(a,""),setTimeout(()=>{l(n,!1)},2e3)}catch{l(a,"Copy not supported in this browser"),l(n,!1)}}function v(_){_.stopPropagation(),t.result.status==="success"&&t.onPreview?.(t.index)}function x(_){return _==="1:1"?"1 / 1":_==="9:16"?"9 / 16":"16 / 9"}var g=Zl(),R=c(g);{var b=_=>{var h=Vl(),E=c(h);q(()=>{V(E,"src",t.result.imageDataUrl),V(E,"alt",`Generated image ${t.index+1}`)}),k(_,h)},y=_=>{var h=Jl(),E=c(h),B=c(E);q(()=>K(B,t.result.error)),k(_,h)};z(R,_=>{t.result.status==="success"?_(b):_(y,-1)})}var m=p(R,2),w=c(m),L=p(m,2);{var M=_=>{var h=Wl();q(()=>V(h,"data-testid",`checkmark-${t.index??""}`)),k(_,h)};z(L,_=>{t.result.selected&&_(M)})}var A=p(L,2);{var O=_=>{var h=Xl(),E=c(h),B=p(E,2),G=p(B,2),J=p(G,2);{var $=P=>{var U=Yl();q(()=>V(U,"data-testid",`copy-feedback-${t.index??""}`)),k(P,U)};z(J,P=>{i(n)&&P($)})}var Z=p(J,2);{var F=P=>{var U=$l(),T=c(U);q(()=>{V(U,"data-testid",`copy-error-${t.index??""}`),K(T,i(a))}),k(P,U)};z(Z,P=>{i(a)&&P(F)})}q(()=>{V(h,"data-testid",`export-toolbar-${t.index??""}`),V(E,"data-testid",`preview-btn-${t.index??""}`),V(E,"aria-label",`View generated image ${t.index+1} larger`),V(B,"data-testid",`download-btn-${t.index??""}`),V(B,"aria-label",`Download generated image ${t.index+1} as PNG`),V(G,"data-testid",`copy-btn-${t.index??""}`),V(G,"aria-label",`Copy generated image ${t.index+1} to clipboard`)}),I("click",E,v),I("click",B,d),I("click",G,f),k(_,h)};z(A,_=>{t.result.status==="success"&&_(O)})}q(_=>{V(g,"data-testid",`image-card-${t.index??""}`),pe(g,1,`group relative block w-full self-start overflow-hidden rounded-lg transition-all ${t.result.selected?"ring-2 ring-indigo-600":"ring-1 ring-slate-200"} cursor-pointer`),Pn(g,_),V(g,"aria-pressed",t.result.selected),V(g,"aria-label",`Select generated image ${t.index+1}`),V(m,"data-testid",`image-index-${t.index??""}`),K(w,t.index+1)},[()=>t.result.status==="success"?"":`aspect-ratio: ${x(r())};`]),I("click",g,s),I("keydown",g,u),k(e,g),ye()}Ie(["click","keydown"]);var Ql=j('<div class="flex-1 flex items-center justify-center"><div class="text-center"><p class="text-slate-500 text-sm">Generate images to see results here</p> <svg class="mx-auto mt-2 w-5 h-5 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M19 14l-7 7m0 0l-7-7m7 7V3"></path></svg></div></div>'),eu=j('<div class="relative overflow-hidden rounded-2xl border border-slate-200 bg-slate-200"><div class="absolute inset-0 animate-pulse bg-gradient-to-br from-slate-200 via-slate-100 to-slate-200"></div></div>'),tu=j('<div class="flex-1 flex items-center justify-center px-6"><div class="w-full max-w-5xl"><div class="mb-4 rounded-2xl border border-indigo-200 bg-indigo-50 px-4 py-3 text-center"><p class="text-sm font-semibold text-indigo-700">Generating images</p> <p class="mt-1 text-sm text-indigo-600">This can take a few seconds depending on the model and image count.</p></div> <div data-testid="results-grid"></div></div></div>'),ru=j('<div class="relative w-full"><div data-testid="results-grid"></div> <div class="pointer-events-none absolute inset-0 flex items-start justify-center p-6"><div class="rounded-2xl border border-indigo-200 bg-white/96 px-4 py-3 text-center shadow-lg backdrop-blur-sm"><div class="mx-auto mb-2 h-5 w-5 animate-spin rounded-full border-2 border-indigo-200 border-t-indigo-600"></div> <p class="text-sm font-semibold text-slate-800">Generating next run</p> <p class="mt-1 text-sm text-slate-600"> </p></div></div></div>'),nu=j('<div class="flex-1 flex items-center justify-center"><div class="text-center space-y-3"><div class="mx-auto w-10 h-10 rounded-full bg-red-100 flex items-center justify-center"><svg class="w-5 h-5 text-red-600" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"></path></svg></div> <p class="text-sm text-red-600"> </p> <button data-testid="retry-button" class="px-4 py-2 text-sm font-medium text-white bg-indigo-600 rounded-lg hover:bg-indigo-700 transition-colors cursor-pointer">Try Again</button> <p class="text-xs text-slate-400 mt-1">Returns to the generation form</p></div></div>'),au=j('<div data-testid="results-grid"></div>'),su=j('<div data-testid="image-preview-backdrop" class="fixed inset-0 z-40 flex items-center justify-center bg-slate-950/75 p-6" role="dialog" aria-modal="true" aria-label="Image preview" tabindex="-1"><div class="relative w-full max-w-7xl"><button type="button" data-testid="image-preview-close" class="absolute right-3 top-3 z-10 rounded-full bg-black/50 p-2 text-white hover:bg-black/70 cursor-pointer" aria-label="Close preview"><svg class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"></path></svg></button> <img data-testid="image-preview" class="mx-auto max-h-[85vh] w-auto max-w-full rounded-2xl bg-slate-950 object-contain shadow-2xl"/></div></div>'),iu=j("<!> <!>",1);function ou(e,t){xe(t,!0);let r=N(null);function n(){return C.sessionRuns[C.activeRunIndex]?.sizePreset??ne.sizePreset}function a(h,E){return h>=6?E==="1:1"?"grid-cols-2 xl:grid-cols-3":"grid-cols-1 md:grid-cols-2 xl:grid-cols-3":"grid-cols-1 lg:grid-cols-2"}function s(h,E){return h>=6?E==="1:1"||E==="9:16"?"max-w-4xl":"max-w-7xl":h>=4?E==="1:1"?"max-w-4xl":"max-w-6xl":E==="1:1"?"max-w-4xl":"max-w-5xl"}function u(h){return h==="1:1"?"1 / 1":h==="9:16"?"9 / 16":"16 / 9"}function d(h){l(r,h,!0)}function o(){l(r,null)}let f=te(()=>i(r)===null?null:C.results[i(r)]??null),v=te(()=>C.results.length>0),x=te(()=>C.sessionRuns[C.activeRunIndex]??null),g=te(()=>C.status==="generating"?i(x)?`Generating a new variation from ${i(x).sizePreset} · ${i(x).imageCount} images...`:"Generating images...":null);function R(h){h.target===h.currentTarget&&o()}var b=iu(),y=_e(b);{var m=h=>{var E=Ql();k(h,E)},w=h=>{var E=tu(),B=c(E),G=p(c(B),2);Je(G,21,()=>Array(ne.imageCount),Jr,(J,$,Z)=>{var F=eu();V(F,"data-testid",`skeleton-${Z}`),q(P=>Pn(F,P),[()=>`aspect-ratio: ${u(ne.sizePreset)};`]),k(J,F)}),q(J=>pe(G,1,J),[()=>`grid self-start items-start ${a(ne.imageCount,ne.sizePreset)} gap-4 p-4 w-full ${s(ne.imageCount,ne.sizePreset)} mx-auto`]),k(h,E)},L=h=>{var E=ru(),B=c(E);Je(B,21,()=>C.results,Jr,(F,P,U)=>{{let T=te(n);aa(F,{get result(){return i(P)},index:U,onPreview:d,get sizePreset(){return i(T)}})}});var G=p(B,2),J=c(G),$=p(c(J),4),Z=c($);q(F=>{pe(B,1,F),K(Z,i(g))},[()=>`grid self-start items-start ${a(C.results.length,n())} gap-4 p-4 w-full ${s(C.results.length,n())} mx-auto opacity-45 transition-opacity`]),k(h,E)},M=h=>{var E=nu(),B=c(E),G=p(c(B),2),J=c(G),$=p(G,2);q(()=>K(J,C.error)),I("click",$,function(...Z){zr?.apply(this,Z)}),k(h,E)},A=h=>{var E=au();Je(E,21,()=>C.results,Jr,(B,G,J)=>{{let $=te(n);aa(B,{get result(){return i(G)},index:J,onPreview:d,get sizePreset(){return i($)}})}}),q(B=>pe(E,1,B),[()=>`grid self-start items-start ${a(C.results.length,n())} gap-4 p-4 w-full ${s(C.results.length,n())} mx-auto`]),k(h,E)};z(y,h=>{C.status==="idle"&&C.results.length===0?h(m):C.status==="generating"&&!i(v)?h(w,1):C.status==="generating"&&i(v)?h(L,2):C.status==="error"?h(M,3):C.status==="complete"&&C.results.length>0&&h(A,4)})}var O=p(y,2);{var _=h=>{var E=su(),B=c(E),G=c(B),J=p(G,2);q(()=>{V(J,"src",i(f).imageDataUrl),V(J,"alt",`Generated image ${i(r)+1} preview`)}),I("click",E,R),I("keydown",E,$=>$.key==="Escape"&&o()),I("click",G,o),k(h,E)};z(O,h=>{i(f)?.status==="success"&&i(r)!==null&&h(_)})}k(e,b),ye()}Ie(["click","keydown"]);var lu=j('<img class="block h-full w-full object-contain"/>'),uu=j('<div class="w-full h-full flex items-center justify-center text-slate-400 text-xs">?</div>'),cu=j('<button class="flex-shrink-0 flex flex-col items-center gap-1 cursor-pointer group"><div><div class="flex h-full w-full items-center justify-center overflow-hidden rounded-[4px] bg-slate-100"><!></div></div> <span class="text-[10px] text-slate-500 group-hover:text-slate-700"> </span></button>'),du=j('<div data-testid="run-strip" class="border-t border-slate-200 bg-white px-4 py-2"><div class="flex gap-2 overflow-x-auto"></div></div>');function fu(e,t){xe(t,!1);function r(d){return d.images.find(f=>f.status==="success")?.imageDataUrl??null}function n(d){return d==="1:1"?"1 / 1":d==="9:16"?"9 / 16":"16 / 9"}Ja();var a=xr(),s=_e(a);{var u=d=>{var o=du(),f=c(o);Je(f,7,()=>C.sessionRuns,v=>v.id,(v,x,g)=>{const R=Or(()=>r(i(x)));var b=cu(),y=c(b),m=c(y),w=c(m);{var L=_=>{var h=lu();q(()=>{V(h,"src",i(R)),V(h,"alt",`Run ${i(g)+1}`)}),k(_,h)},M=_=>{var h=uu();k(_,h)};z(w,_=>{i(R)?_(L):_(M,-1)})}var A=p(y,2),O=c(A);q(_=>{V(b,"data-testid",`run-thumbnail-${i(g)??""}`),V(y,"data-testid",`run-thumbnail-frame-${i(g)??""}`),pe(y,1,`h-8 shrink-0 rounded border-2 ${C.activeRunIndex===i(g)?"border-indigo-500":"border-slate-200"}`),Pn(y,_),K(O,`Run ${i(g)+1}`)},[()=>`aspect-ratio: ${n(i(x).sizePreset)};`]),I("click",b,()=>Pl(i(g))),k(v,b)}),k(d,o)};z(s,d=>{C.sessionRuns?.length>1&&d(u)})}k(e,a),ye()}Ie(["click"]);var vu=j('<p class="mt-1 text-xs text-slate-500"> </p>'),pu=j('<span data-testid="selected-count" class="shrink-0 text-sm text-slate-500"> </span>'),hu=j('<button type="button" data-testid="iterate-button" class="px-4 py-1.5 text-sm font-medium text-white bg-indigo-600 rounded-lg hover:bg-indigo-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed">Iterate</button>'),gu=j(`<div data-testid="action-bar" class="border-t border-slate-200 bg-white px-4 py-2"><div class="mb-2 rounded-lg border border-slate-200 bg-slate-50 px-3 py-2"><div class="flex items-start justify-between gap-3"><div class="min-w-0 flex-1"><p class="text-[11px] font-semibold uppercase tracking-[0.14em] text-slate-400">Prompt Used</p> <p class="mt-1 text-sm text-slate-700 whitespace-pre-wrap break-words"> </p> <!> <p class="mt-2 text-xs text-slate-500"> </p></div> <!></div></div> <div class="flex items-center gap-3"><input type="text" data-testid="feedback-input" class="flex-1 px-3 py-1.5 text-sm border border-slate-300 rounded-lg focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500" placeholder="Describe changes you'd like..."/> <div class="flex items-center gap-2"><!> <button type="button" data-testid="run-again-button" class="px-4 py-1.5 text-sm font-medium text-slate-700 bg-slate-200 rounded-lg hover:bg-slate-300 transition-colors disabled:opacity-50 disabled:cursor-not-allowed">Run Again</button></div></div></div>`);function bu(e,t){xe(t,!0);let r=N(""),n=te(as),a=te(()=>C.results.length>0),s=te(()=>C.status==="generating"),u=te(()=>i(n).length>0||i(r).length>0),d=te(()=>C.sessionRuns[C.activeRunIndex]??null),o=te(()=>i(n).length>0?`Using ${i(n).length} selected image${i(n).length===1?"":"s"} as visual references for the next iteration.`:i(r).length>0?"No images selected. This iteration will use the project references with your feedback.":"Tip: click one or more images above to carry them forward visually, then describe the changes you want."),f=te(()=>i(d)?`${i(d).sizePreset} · ${i(d).imageCount} image${i(d).imageCount===1?"":"s"} · ${i(d).model}`:null);function v(m){const w=m.target;l(r,w.value,!0),$r(w.value)}async function x(){na(),$r(""),l(r,"");try{await pn({prompt:C.prompt})}catch(m){console.error("handleRegenerate: unexpected error",m)}}async function g(){try{await pn({prompt:C.prompt})}catch(m){console.error("handleIterate: unexpected error",m)}l(r,""),$r(""),na()}var R=xr(),b=_e(R);{var y=m=>{var w=gu(),L=c(w),M=c(L),A=c(M),O=p(c(A),2),_=c(O),h=p(O,2);{var E=H=>{var X=vu(),se=c(X);q(()=>K(se,`Run used: ${i(f)??""}`)),k(H,X)};z(h,H=>{i(f)&&H(E)})}var B=p(h,2),G=c(B),J=p(A,2);{var $=H=>{var X=pu(),se=c(X);q(()=>K(se,`${i(n).length??""} selected`)),k(H,X)};z(J,H=>{i(n).length>0&&H($)})}var Z=p(L,2),F=c(Z),P=p(F,2),U=c(P);{var T=H=>{var X=hu();q(()=>X.disabled=i(s)),I("click",X,g),k(H,X)};z(U,H=>{i(u)&&H(T)})}var W=p(U,2);q(()=>{K(_,C.prompt),K(G,i(o)),dt(F,i(r)),W.disabled=i(s)}),I("input",F,v),I("click",W,x),k(m,w)};z(b,m=>{i(a)&&m(y)})}k(e,R),ye()}Ie(["input","click"]);var mu=j('<div data-testid="canvas" class="flex-1 flex flex-col bg-slate-50 overflow-auto"><div class="flex-1 flex justify-center p-6 overflow-auto"><!></div> <!> <!></div>');function _u(e){var t=mu(),r=c(t),n=c(r);ou(n,{});var a=p(r,2);fu(a,{});var s=p(a,2);bu(s,{}),k(e,t)}var xu=j("<button> </button>"),yu=j('<div class="flex gap-2" data-testid="size-presets"></div>');function wu(e,t){xe(t,!1);const r=[{label:"Blog Header",value:"16:9"},{label:"Square",value:"1:1"},{label:"Story",value:"9:16"}];Ja();var n=yu();Je(n,5,()=>r,a=>a.value,(a,s)=>{var u=xu(),d=c(u);q(()=>{V(u,"data-testid",`size-preset-${i(s).value??""}`),pe(u,1,`px-3 py-1 rounded-full text-xs font-medium transition-colors cursor-pointer ${ne.sizePreset===i(s).value?"bg-indigo-600 text-white":"bg-slate-200 text-slate-700 hover:bg-slate-300"}`),K(d,i(s).label)}),I("click",u,()=>Ho(i(s).value)),k(a,u)}),k(e,n),ye()}Ie(["click"]);var ku=j('<textarea data-testid="prompt-textarea" class="w-full rounded-lg border border-slate-200 bg-slate-50 px-3 py-2 text-sm text-slate-900 placeholder:text-slate-400 focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500 focus:outline-none resize-none" rows="2" placeholder="Describe what you want to generate..."></textarea>'),Su=j("<button> </button>"),ju=j("<option> </option>"),Eu=j('<button type="button" data-testid="model-settings-button" class="flex h-7 w-7 items-center justify-center rounded-full border border-slate-200 bg-white text-slate-500 hover:bg-slate-50 hover:text-slate-700 cursor-pointer" aria-label="Manage models"><svg class="h-3.5 w-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path><path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path></svg></button>'),Ru=j('<button type="button" class="text-xs font-medium text-amber-800 underline decoration-amber-300 underline-offset-2 hover:text-amber-900 cursor-pointer">Open Project Settings</button>'),Pu=j('<p class="text-right text-xs text-amber-700"> </p> <!>',1),Cu=j('<div class="flex max-w-64 flex-col items-end gap-1.5"><button data-testid="generate-button"> </button> <!></div>'),Iu=j(`<div data-testid="generation-form" class="space-y-3"><!> <div class="flex items-start justify-between gap-4"><div class="flex items-center gap-6"><div class="flex flex-col gap-1"><span class="text-xs text-slate-500">Size</span> <!></div> <div class="flex flex-col gap-1"><span class="text-xs text-slate-500">Images</span> <div class="flex items-center gap-1.5"></div></div> <div class="flex flex-col gap-1"><span class="text-xs text-slate-500">Model</span> <div class="flex items-center gap-1.5"><select data-testid="model-select" class="text-xs text-slate-700 bg-slate-200 rounded-full px-3 py-1 font-medium cursor-pointer hover:bg-slate-300 transition-colors focus:outline-none focus:ring-1 focus:ring-indigo-500 appearance-none pr-6 bg-no-repeat bg-[length:12px] bg-[right_8px_center] bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%2364748b%22%20stroke-width%3D%222%22%3E%3Cpath%20d%3D%22M6%209l6%206%206-6%22%2F%3E%3C%2Fsvg%3E')]"></select> <!></div></div></div> <!></div></div>`);function Mu(e,t){xe(t,!0);let r=pr(t,"prompt",15,""),n=pr(t,"variant",3,"full");const a=xo;function s(F){const P=F.target;r(P.value)}function u(){i(f)||t.onGenerate?.()}function d(F){const P=F.target;Jo(P.value)}function o(F){if(!F||F.readiness.generate)return null;if(F.mode==="none")return"Add shared, style, or subject references in Project Settings to get this project ready.";const P=[];return(F.mode==="style"||F.mode==="both")&&!F.guides.stylePresent&&P.push("visual style"),(F.mode==="subject"||F.mode==="both")&&!F.guides.subjectPresent&&P.push("subject guide"),P.length===2?"Generate a visual style and subject guide from your references in Project Settings before generating.":P[0]==="visual style"?"Generate a visual style from your references in Project Settings before generating.":P[0]==="subject guide"?"Generate a subject guide from your references in Project Settings before generating.":"Finish setting up this project in Project Settings before generating."}let f=te(()=>!r().trim()||!ne.apiKeyConfigured||!Mt.value?.readiness.generate||C.status==="generating"),v=te(()=>o(Mt.value)),x=te(()=>n()==="full"),g=te(()=>n()==="full");var R=Iu(),b=c(R);{var y=F=>{var P=ku();q(()=>dt(P,r())),I("input",P,s),k(F,P)};z(b,F=>{i(x)&&F(y)})}var m=p(b,2),w=c(m),L=c(w),M=p(c(L),2);wu(M,{});var A=p(L,2),O=p(c(A),2);Je(O,20,()=>a,F=>F,(F,P)=>{var U=Su(),T=c(U);q(()=>{V(U,"data-testid",`image-count-${P??""}`),pe(U,1,`w-7 h-7 rounded-full text-xs font-medium transition-colors cursor-pointer ${ne.imageCount===P?"bg-indigo-600 text-white":"bg-slate-200 text-slate-700 hover:bg-slate-300"}`),K(T,P)}),I("click",U,()=>Vo(P)),k(F,U)});var _=p(A,2),h=p(c(_),2),E=c(h);Je(E,21,()=>ne.availableModels,F=>F.id,(F,P)=>{var U=ju(),T=c(U),W={};q(()=>{K(T,i(P).label),W!==(W=i(P).id)&&(U.value=(U.__value=i(P).id)??"")}),k(F,U)});var B;uo(E);var G=p(E,2);{var J=F=>{var P=Eu();I("click",P,()=>t.onOpenModelSettings?.()),k(F,P)};z(G,F=>{t.onOpenModelSettings&&F(J)})}var $=p(w,2);{var Z=F=>{var P=Cu(),U=c(P),T=c(U),W=p(U,2);{var H=X=>{var se=Pu(),Se=_e(se),Oe=c(Se),$e=p(Se,2);{var Xe=Me=>{var Ze=Ru();I("click",Ze,()=>t.onOpenSettings?.()),k(Me,Ze)};z($e,Me=>{t.onOpenSettings&&Me(Xe)})}q(()=>K(Oe,i(v))),k(X,se)};z(W,X=>{i(v)&&X(H)})}q(()=>{pe(U,1,`px-4 py-1.5 rounded-lg text-sm font-medium transition-colors ${i(f)?"bg-slate-200 text-slate-400 cursor-not-allowed":"bg-indigo-600 text-white hover:bg-indigo-700 cursor-pointer"}`),U.disabled=i(f),K(T,C.status==="generating"?"Generating...":"Generate")}),I("click",U,u),k(F,P)};z($,F=>{i(g)&&F(Z)})}q(()=>{B!==(B=ne.model)&&(E.value=(E.__value=ne.model)??"",Ha(E,ne.model))}),I("change",E,d),k(e,R),ye()}Ie(["input","click","change"]);var Tu=j('<span class="truncate text-slate-500"> </span>'),Du=j('<div data-testid="drawer-content" class="px-4 pb-4"><!></div>'),Au=j('<div data-testid="drawer"><button data-testid="drawer-collapsed-bar" class="flex items-center w-full px-4 h-[44px] text-left text-sm text-slate-600 hover:bg-slate-50 transition-colors cursor-pointer gap-2"><svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M5 15l7-7 7 7"></path></svg> <!> <span class="ml-auto flex items-center gap-2 text-xs text-slate-400"><span> </span> <span class="text-slate-300">|</span> <span> </span></span></button> <!></div>');function Ou(e,t){xe(t,!0);let r=N(!0),n=N(""),a=!1,s=te(()=>C.activeSessionId!==null||C.sessionRuns.length>0);ct(()=>{i(s)&&!a&&l(r,!1),!i(s)&&a&&(l(n,C.prompt,!0),l(r,!0)),a=i(s)});function u(){l(r,!i(r))}async function d(){try{await pn({prompt:i(n).trim()})}catch(O){console.error("handleGenerate: unexpected error",O)}}let o=te(()=>i(s)?"Next iteration settings":i(n).trim()||"Describe what you want to generate...");var f=Au(),v=c(f),x=c(v),g=p(x,2);{var R=O=>{var _=Tu(),h=c(_);q(()=>K(h,i(o))),k(O,_)};z(g,O=>{i(r)||O(R)})}var b=p(g,2),y=c(b),m=c(y),w=p(y,4),L=c(w),M=p(v,2);{var A=O=>{var _=Du(),h=c(_);{let E=te(()=>i(s)?"settings":"full");Mu(h,{get variant(){return i(E)},onGenerate:d,get onOpenSettings(){return t.onOpenSettings},get onOpenModelSettings(){return t.onOpenModelSettings},get prompt(){return i(n)},set prompt(B){l(n,B,!0)}})}k(O,_)};z(M,O=>{i(r)&&O(A)})}q(()=>{pe(f,1,`border-t border-slate-200 bg-white transition-all duration-200 ease-in-out ${i(r)?"expanded":""}`),pe(x,0,`w-4 h-4 text-slate-400 transition-transform duration-200 ${i(r)?"rotate-180":""}`),K(m,ne.sizePreset),K(L,`${ne.imageCount??""} images`)}),I("click",v,u),k(e,f),ye()}Ie(["click"]);var Nu=j('<p class="mt-4 text-sm text-red-600"> </p>'),Fu=j('<span class="rounded-full bg-indigo-100 px-2 py-0.5 text-[11px] font-semibold text-indigo-700">Default</span>'),Lu=j('<button class="rounded-lg border border-slate-300 px-3 py-1.5 text-xs font-medium text-slate-700 hover:bg-slate-50 cursor-pointer">Set Default</button>'),Uu=j('<button class="rounded-lg border border-red-200 px-3 py-1.5 text-xs font-medium text-red-600 hover:bg-red-50 cursor-pointer">Remove</button>'),zu=j('<div class="rounded-2xl border border-slate-200 bg-white px-4 py-4"><div class="flex flex-wrap items-start justify-between gap-3"><div class="min-w-0 flex-1"><div class="flex flex-wrap items-center gap-2"><p class="truncate text-sm font-semibold text-slate-900"> </p> <!> <span class="rounded-full bg-slate-100 px-2 py-0.5 text-[11px] font-medium text-slate-600"> </span></div> <p class="mt-1 break-all font-mono text-xs text-slate-500"> </p></div> <div class="flex items-center gap-2"><!> <!></div></div> <div class="mt-3"><input type="text" class="rounded-lg border border-slate-300 px-3 py-2 text-sm text-slate-900"/> <p class="mt-2 text-xs text-slate-500">Image Sprout validates this model against OpenRouter and handles compatibility automatically.</p></div></div>'),Bu=j('<div class="fixed inset-0 z-[70] flex items-center justify-center bg-black/45 px-4" role="dialog" aria-modal="true" aria-label="Manage models" tabindex="-1"><div class="w-full max-w-3xl overflow-hidden rounded-2xl bg-white shadow-2xl"><div class="flex items-center justify-between border-b border-slate-200 px-6 py-4"><div><h2 class="text-lg font-semibold text-slate-900">Manage Models</h2> <p class="mt-1 text-sm text-slate-500">These models are shared between the CLI and web app. Restore defaults anytime.</p></div> <button class="rounded-md p-1 text-slate-400 hover:text-slate-700 cursor-pointer" aria-label="Close"><svg class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"></path></svg></button></div> <div class="max-h-[80vh] overflow-y-auto px-6 py-5"><div class="rounded-2xl border border-slate-200 bg-slate-50 px-4 py-4"><h3 class="text-sm font-semibold text-slate-900">Add Model</h3> <div class="mt-3 grid gap-3 md:grid-cols-[1.8fr_1fr_auto]"><input type="text" class="rounded-lg border border-slate-300 px-3 py-2 text-sm text-slate-900" placeholder="OpenRouter model id, e.g. provider/model-name"/> <input type="text" class="rounded-lg border border-slate-300 px-3 py-2 text-sm text-slate-900" placeholder="Friendly label (optional)"/> <button class="rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer">Add</button></div> <p class="mt-2 text-xs text-slate-500">If the label is omitted, Image Sprout will use the OpenRouter model name when it can fetch it. Only OpenRouter models that accept image input and return image output can be added.</p></div> <!> <div class="mt-6 space-y-3"></div></div> <div class="flex items-center justify-between border-t border-slate-200 px-6 py-4"><button class="rounded-lg border border-slate-300 px-4 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50 cursor-pointer">Restore Defaults</button> <button class="rounded-lg bg-slate-900 px-4 py-2 text-sm font-medium text-white hover:bg-slate-800 cursor-pointer">Done</button></div></div></div>');function Gu(e,t){xe(t,!0);let r=N(""),n=N(""),a=N(!1),s=N(null);async function u(){const b=i(r).trim();if(!(!b||i(a))){l(a,!0),l(s,null);try{await Wo({id:b,label:i(n).trim()||void 0}),l(r,""),l(n,"")}catch(y){l(s,y instanceof Error?y.message:"Failed to add model",!0)}finally{l(a,!1)}}}async function d(b){l(a,!0),l(s,null);try{await Xo(b)}catch(y){l(s,y instanceof Error?y.message:"Failed to set default model",!0)}finally{l(a,!1)}}async function o(b){l(a,!0),l(s,null);try{await $o(b)}catch(y){l(s,y instanceof Error?y.message:"Failed to remove model",!0)}finally{l(a,!1)}}async function f(){l(a,!0),l(s,null);try{await Zo()}catch(b){l(s,b instanceof Error?b.message:"Failed to restore defaults",!0)}finally{l(a,!1)}}async function v(b,y){const m=y.target.value;try{await Yo(b,{label:m})}catch(w){l(s,w instanceof Error?w.message:"Failed to update label",!0)}}var x=xr(),g=_e(x);{var R=b=>{var y=Bu(),m=c(y),w=c(m),L=p(c(w),2),M=p(w,2),A=c(M),O=p(c(A),2),_=c(O),h=p(_,2),E=p(h,2),B=p(A,2);{var G=P=>{var U=Nu(),T=c(U);q(()=>K(T,i(s))),k(P,U)};z(B,P=>{i(s)&&P(G)})}var J=p(B,2);Je(J,21,()=>ne.availableModels,P=>P.id,(P,U)=>{var T=zu(),W=c(T),H=c(W),X=c(H),se=c(X),Se=c(se),Oe=p(se,2);{var $e=de=>{var Ee=Fu();k(de,Ee)};z(Oe,de=>{ne.defaultModelId===i(U).id&&de($e)})}var Xe=p(Oe,2),Me=c(Xe),Ze=p(X,2),nr=c(Ze),ar=p(H,2),je=c(ar);{var Bt=de=>{var Ee=Lu();I("click",Ee,()=>d(i(U).id)),k(de,Ee)};z(je,de=>{ne.defaultModelId!==i(U).id&&de(Bt)})}var sr=p(je,2);{var jt=de=>{var Ee=Uu();I("click",Ee,()=>o(i(U).id)),k(de,Ee)};z(sr,de=>{i(U).source==="user"&&de(jt)})}var ir=p(W,2),Et=c(ir);q(()=>{K(Se,i(U).label),K(Me,i(U).source),K(nr,i(U).id),dt(Et,i(U).label)}),Rt("blur",Et,de=>v(i(U).id,de)),k(P,T)});var $=p(M,2),Z=c($),F=p(Z,2);q(P=>{dt(_,i(r)),dt(h,i(n)),E.disabled=P},[()=>i(a)||!i(r).trim()]),I("click",y,P=>P.target===P.currentTarget&&t.onClose()),I("keydown",y,P=>P.key==="Escape"&&t.onClose()),I("click",L,function(...P){t.onClose?.apply(this,P)}),I("input",_,P=>l(r,P.target.value,!0)),I("input",h,P=>l(n,P.target.value,!0)),I("click",E,u),I("click",Z,f),I("click",F,function(...P){t.onClose?.apply(this,P)}),k(b,y)};z(g,b=>{t.open&&b(R)})}k(e,x),ye()}Ie(["click","keydown","input"]);var qu=j('<label class="flex shrink-0 items-start gap-2 pt-0.5"><input type="checkbox" class="mt-0.5 h-4 w-4 rounded border-slate-300 text-amber-600 focus:ring-amber-500"/> <span class="text-sm text-slate-700"> </span></label>'),Ku=j('<p class="mb-2 text-xs text-red-600"> </p>'),Hu=j('<div class="rounded-xl border border-dashed border-slate-200 bg-slate-50 px-4 py-5"><p class="text-sm text-slate-500"> </p></div>'),Vu=j('<div class="mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-slate-200 bg-white text-slate-400" title="Drag to another section"><svg class="h-4 w-4" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4"><path stroke-linecap="round" d="M5 3h.01M5 6.5h.01M5 10h.01M5 13h.01M11 3h.01M11 6.5h.01M11 10h.01M11 13h.01"></path></svg></div>'),Ju=j('<article><div class="relative"><button class="block aspect-square w-full overflow-hidden rounded-lg bg-slate-100 cursor-pointer"><img class="h-full w-full object-cover"/></button> <button class="absolute right-1.5 top-1.5 flex h-7 w-7 items-center justify-center rounded-full bg-white/90 text-slate-500 shadow-sm hover:bg-white hover:text-red-600 cursor-pointer"><svg class="h-3.5 w-3.5" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8"><path stroke-linecap="round" d="M4 4l8 8M12 4l-8 8"></path></svg></button></div> <div class="mt-2 flex items-start justify-between gap-2"><div class="min-w-0"><p class="truncate text-[11px] font-medium text-slate-700"> </p> <p class="mt-1 text-[11px] text-slate-500"> </p></div> <!></div></article>'),Wu=j('<div class="fixed inset-0 z-[60] flex items-center justify-center bg-black/70 px-4" role="presentation"><div class="max-h-[90vh] max-w-4xl overflow-hidden rounded-xl bg-white shadow-2xl"><div class="flex items-center justify-between border-b border-slate-200 px-4 py-3"><div class="min-w-0"><h4 class="truncate text-sm font-medium text-slate-900"> </h4> <p class="text-xs text-slate-500"> </p></div> <div class="flex items-center gap-2"><button class="rounded-md px-2 py-1 text-xs text-slate-600 hover:bg-slate-100 cursor-pointer">Download</button> <button class="rounded-md px-2 py-1 text-xs text-slate-600 hover:bg-slate-100 cursor-pointer">Close</button></div></div> <img class="max-h-[80vh] w-full object-contain bg-slate-100"/></div></div>'),Yu=j('<section class="rounded-xl border border-slate-200 bg-white"><div class="border-b border-slate-100 px-4 py-3"><div class="flex flex-wrap items-start justify-between gap-4"><div class="min-w-0"><h4 class="text-sm font-semibold text-slate-900"> </h4> <p class="mt-1 text-xs text-slate-500"> </p></div> <!></div></div> <div role="region"><!> <!> <div class="mt-3 flex gap-3 overflow-x-auto pb-1"><!> <button><span>+</span></button></div> <input type="file" multiple="" class="hidden"/></div></section> <!>',1);function Pr(e,t){xe(t,!0);let r=pr(t,"allowRoleMove",3,!1),n=pr(t,"compact",3,!1);const a=["image/png","image/jpeg","image/webp"],s=1024;let u=N(!1),d=N(!1),o=N(void 0),f=N(null),v=N(null);const x="application/x-image-sprout-ref",g=te(()=>n()?"w-32":"w-44"),R=te(()=>n()?"text-2xl":"text-3xl"),b=new Map,y=te(()=>Kt.filter(S=>S.role===t.role));function m(S){let D=b.get(S.id);if(!D){if(!S.blob)return"";D=URL.createObjectURL(S.blob),b.set(S.id,D)}return D}function w(S){return S.dataUrl??m(S)}function L(){for(const[,S]of b)URL.revokeObjectURL(S);b.clear()}ct(()=>{const S=new Set(Kt.map(D=>D.id));for(const[D,Y]of b)S.has(D)||(URL.revokeObjectURL(Y),b.delete(D))}),bo(L);async function M(S){if(!a.includes(S.type))return;let D=null;try{D=await createImageBitmap(S);let{width:Y,height:ie}=D,me=S;if(Y>s||ie>s){const Te=s/Math.max(Y,ie),Ge=Math.round(Y*Te),Qe=Math.round(ie*Te);if(typeof OffscreenCanvas<"u"){const it=new OffscreenCanvas(Ge,Qe);it.getContext("2d").drawImage(D,0,0,Ge,Qe);const pt=await it.convertToBlob({type:S.type});me=new File([pt],S.name,{type:S.type}),Y=Ge,ie=Qe}}await il(me,Y,ie,t.role)}finally{D&&typeof D.close=="function"&&D.close()}}async function A(S){const D=Array.from(S);l(f,null);for(const Y of D)try{await M(Y)}catch(ie){const me=ie instanceof Error?ie.message:"Failed to process image";l(f,`Failed to upload ${Y.name}: ${me}`)}}function O(S){const D=S.target;D.files&&D.files.length>0&&(A(D.files),D.value="")}function _(){i(o)?.click()}function h(S){const D=S.dataTransfer?.types;return Array.isArray(D)?D.includes(x):!!D?.includes?.(x)}function E(S){const D=S.dataTransfer?.types;return Array.isArray(D)?D.includes("Files"):!!D?.includes?.("Files")}function B(S){if(S.preventDefault(),r()&&h(S)){l(d,!0);return}E(S)&&l(u,!0)}function G(S){if(r()&&h(S)){S.preventDefault(),l(d,!0),S.dataTransfer&&(S.dataTransfer.dropEffect="move");return}E(S)&&(S.preventDefault(),l(u,!0))}function J(S){S.preventDefault(),S.currentTarget===S.target&&(l(u,!1),l(d,!1))}async function $(S){if(S.preventDefault(),l(u,!1),l(d,!1),r()&&h(S)){const Y=S.dataTransfer?.getData(x);if(!Y)return;try{const ie=JSON.parse(Y);if(!ie.id||ie.role===t.role)return;await ll(ie.id,t.role)}catch(ie){l(f,ie instanceof Error?ie.message:"Failed to move reference",!0)}return}const D=S.dataTransfer?.files;D&&D.length>0&&await A(D)}async function Z(S){try{await ol(S)}catch(D){l(f,D instanceof Error?D.message:"Failed to delete image",!0)}}function F(S){l(v,S,!0)}function P(){l(v,null)}function U(S){const D=w(S),Y=document.createElement("a");Y.href=D,Y.download=S.filename,Y.click()}function T(S,D){!r()||!S.dataTransfer||(S.dataTransfer.effectAllowed="move",S.dataTransfer.setData(x,JSON.stringify({id:D.id,role:D.role})))}function W(){l(d,!1)}var H=Yu(),X=_e(H),se=c(X),Se=c(se),Oe=c(Se),$e=c(Oe),Xe=c($e),Me=p($e,2),Ze=c(Me),nr=p(Oe,2);{var ar=S=>{var D=qu(),Y=c(D),ie=p(Y,2),me=c(ie);q(()=>{Va(Y,t.headerAction.checked),Y.disabled=t.headerAction.disabled,K(me,t.headerAction.label)}),I("change",Y,Te=>{t.headerAction.onChange(Te)}),k(S,D)};z(nr,S=>{t.headerAction&&S(ar)})}var je=p(se,2),Bt=c(je);{var sr=S=>{var D=Ku(),Y=c(D);q(()=>{V(D,"data-testid",`upload-error-${t.role}`),K(Y,i(f))}),k(S,D)};z(Bt,S=>{i(f)&&S(sr)})}var jt=p(Bt,2);{var ir=S=>{var D=Hu(),Y=c(D),ie=c(Y);q(()=>K(ie,t.emptyLabel)),k(S,D)};z(jt,S=>{i(y).length===0&&S(ir)})}var Et=p(jt,2),de=c(Et);Je(de,17,()=>i(y),S=>S.id,(S,D)=>{var Y=Ju(),ie=c(Y),me=c(ie),Te=c(me),Ge=p(me,2),Qe=p(ie,2),it=c(Qe),vt=c(it),pt=c(vt),ht=p(vt,2),Gt=c(ht),qe=p(it,2);{var Kr=Ke=>{var kr=Vu();q(()=>V(kr,"aria-label",`Drag ${i(D).filename??""} to another reference section`)),k(Ke,kr)};z(qe,Ke=>{r()&&Ke(Kr)})}q(Ke=>{V(Y,"data-testid",`reference-card-${t.role}-${i(D).id}`),pe(Y,1,`group ${i(g)} shrink-0 rounded-xl border border-slate-200 bg-slate-50 p-2`),V(Y,"draggable",r()),V(me,"aria-label",`View ${i(D).filename??""}`),V(Te,"src",Ke),V(Te,"alt",i(D).filename),V(Ge,"aria-label",`Delete ${i(D).filename??""}`),V(vt,"title",i(D).filename),K(pt,i(D).filename),K(Gt,i(D).role==="both"?"Shared reference":i(D).role==="style"?"Style only":"Subject only")},[()=>w(i(D))]),Rt("dragstart",Y,Ke=>T(Ke,i(D))),Rt("dragend",Y,W),I("click",me,()=>F(i(D))),I("click",Ge,()=>Z(i(D).id)),k(S,Y)});var Ee=p(de,2),Br=c(Ee),or=p(Et,2);ho(or,S=>l(o,S),()=>i(o));var Gr=p(X,2);{var qr=S=>{var D=Wu(),Y=c(D),ie=c(Y),me=c(ie),Te=c(me),Ge=c(Te),Qe=p(Te,2),it=c(Qe),vt=p(me,2),pt=c(vt),ht=p(pt,2),Gt=p(ie,2);q(qe=>{K(Ge,i(v).filename),K(it,`Role: ${i(v).role??""}`),V(Gt,"src",qe),V(Gt,"alt",i(v).filename)},[()=>w(i(v))]),I("click",D,qe=>{qe.target===qe.currentTarget&&P()}),I("click",pt,()=>i(v)&&U(i(v))),I("click",ht,P),k(S,D)};z(Gr,S=>{i(v)&&S(qr)})}q(S=>{K(Xe,t.title),K(Ze,t.description),V(je,"data-testid",`reference-images-dropzone-${t.role}`),pe(je,1,`px-4 py-4 transition-colors ${i(u)?"rounded-b-xl border-2 border-dashed border-amber-400 bg-amber-50":""} ${i(d)?"rounded-b-xl border-2 border-dashed border-sky-400 bg-sky-50/80":""}`),V(je,"aria-label",t.title),V(Ee,"data-testid",`upload-tile-${t.role}`),pe(Ee,1,`flex aspect-square ${i(g)} shrink-0 items-center justify-center rounded-xl border-2 border-dashed border-slate-300 bg-white text-slate-400 hover:border-amber-400 hover:text-amber-600 transition-colors cursor-pointer`),pe(Br,1,io(i(R))),V(or,"accept",S)},[()=>a.join(",")]),Rt("dragenter",je,B),Rt("dragover",je,G),Rt("dragleave",je,J),Rt("drop",je,S=>{$(S)}),I("click",Ee,_),I("change",or,O),k(e,H),ye()}Ie(["change","click"]);var $u=j('<div class="flex items-center justify-between gap-4 rounded-2xl border border-slate-200 bg-slate-50 px-5 py-4"><p class="text-xs text-slate-600">Need a reference to influence both guides?</p> <button type="button" class="rounded-lg border border-slate-300 bg-white px-3 py-1.5 text-xs font-medium text-slate-700 hover:bg-slate-50 cursor-pointer">Show Shared References</button></div>'),Xu=j('<div class="flex items-start justify-between gap-4 rounded-2xl border border-slate-200 bg-slate-50 px-5 py-4"><div class="max-w-2xl"><h3 class="text-sm font-semibold text-slate-900">Split Reference Sets</h3> <p class="mt-1 text-xs text-slate-500">Keep style and subject references separate when the same images should not drive both guides.</p></div> <label class="flex shrink-0 items-start gap-2 pt-0.5"><input type="checkbox" class="mt-0.5 h-4 w-4 rounded border-slate-300 text-amber-600 focus:ring-amber-500"/> <span class="text-sm text-slate-700">Enabled</span></label></div> <div class="grid gap-4 xl:grid-cols-2"><!> <!></div> <!>',1),Zu=j('<p data-testid="derive-error" class="mt-3 text-xs text-red-600"> </p>'),Qu=j('<p class="mt-3 text-xs text-emerald-700"> </p>'),ec=j('<div class="xl:col-span-2"><span class="inline-flex items-center rounded-full border border-amber-200 bg-amber-50 px-3 py-1 text-xs font-medium text-amber-800">Unsaved project profile changes</span></div>'),tc=j('<div class="border-t border-slate-100 px-5 py-4"><textarea data-testid="instructions-textarea" class="min-h-28 w-full resize-y rounded-xl border border-slate-200 bg-slate-50 px-3 py-3 text-sm text-slate-700 focus:border-amber-500 focus:outline-none focus:ring-1 focus:ring-amber-500" placeholder="Add instructions that should apply to every generation..."></textarea></div>'),rc=j('<p class="mr-auto text-xs text-slate-500">Derived guides stay local until you save them.</p>'),nc=j('<button data-testid="settings-cancel-btn" class="rounded-lg border border-slate-300 bg-white px-4 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50 transition-colors cursor-pointer">Cancel</button> <button data-testid="settings-save-btn" class="rounded-lg bg-amber-600 px-4 py-2 text-sm font-medium text-white hover:bg-amber-700 transition-colors cursor-pointer">Save Edits</button>',1),ac=j('<button data-testid="settings-close-btn" class="rounded-lg border border-slate-300 bg-white px-4 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50 transition-colors cursor-pointer">Close</button>'),sc=j('<div data-testid="settings-modal-backdrop" class="fixed inset-0 z-50 flex items-center justify-center bg-black/40" role="dialog" aria-modal="true" aria-label="Project Settings" tabindex="-1"><div data-testid="settings-modal-panel" class="mx-4 flex max-h-[88vh] w-full max-w-6xl flex-col overflow-hidden rounded-2xl bg-[linear-gradient(180deg,#fffdf7_0%,#ffffff_18%,#f8fafc_100%)] shadow-xl"><div class="flex items-center justify-between border-b border-slate-200 px-6 py-4"><div><h2 class="text-lg font-semibold text-slate-900">Project Profile</h2> <p class="text-sm text-slate-500">Define shared, style-only, and subject-only references, then derive the guides the generator depends on.</p></div> <button data-testid="settings-modal-close" class="p-1 text-slate-400 hover:text-slate-600 transition-colors cursor-pointer" aria-label="Close"><svg class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"></path></svg></button></div> <div class="flex-1 overflow-y-auto px-6 py-5"><div class="rounded-2xl border border-amber-200 bg-amber-50/70 p-4"><div class="flex flex-wrap items-center gap-4"><div><p class="text-xs font-semibold uppercase tracking-[0.16em] text-amber-700">Project Status</p> <p class="mt-1 text-sm text-slate-700">Mode: <span class="font-medium"> </span></p></div> <div class="grid flex-1 gap-2 text-xs text-slate-700 sm:grid-cols-4"><div class="rounded-xl bg-white/80 px-3 py-2">Shared refs: <span class="font-medium"> </span></div> <div class="rounded-xl bg-white/80 px-3 py-2">Style ready: <span class="font-medium"> </span></div> <div class="rounded-xl bg-white/80 px-3 py-2">Subject ready: <span class="font-medium"> </span></div> <div class="rounded-xl bg-white/80 px-3 py-2">API key: <span class="font-medium"> </span></div></div></div></div> <div class="mt-6 space-y-4"><!> <!></div> <div class="mt-6 rounded-2xl border border-slate-200 bg-white px-5 py-4"><div class="flex flex-wrap items-center justify-between gap-3"><div><h3 class="text-sm font-semibold text-slate-900">Derive Guides</h3> <p class="mt-1 text-xs text-slate-500"> </p></div> <div class="flex flex-wrap gap-2"><button data-testid="derive-both-btn" class="rounded-lg bg-amber-600 px-3 py-2 text-xs font-semibold text-white hover:bg-amber-700 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer"> </button> <button class="rounded-lg border border-slate-300 bg-white px-3 py-2 text-xs font-semibold text-slate-700 hover:bg-slate-50 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer"> </button> <button class="rounded-lg border border-slate-300 bg-white px-3 py-2 text-xs font-semibold text-slate-700 hover:bg-slate-50 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer"> </button></div></div> <!></div> <div class="mt-6 grid gap-4 xl:grid-cols-2"><!> <div class="rounded-2xl border border-slate-200 bg-white"><div class="border-b border-slate-100 px-5 py-4"><h3 class="text-sm font-semibold text-slate-900">Visual Style</h3> <p class="mt-1 min-h-10 text-xs text-slate-500">Describe the rendering style, palette, composition tendencies, and overall art direction.</p></div> <div class="px-5 py-4"><textarea data-testid="style-description-textarea" class="min-h-44 w-full resize-y rounded-xl border border-slate-200 bg-slate-50 px-3 py-3 text-sm text-slate-700 focus:border-amber-500 focus:outline-none focus:ring-1 focus:ring-amber-500" placeholder="Describe the visual style for this project..."></textarea></div></div> <div class="rounded-2xl border border-slate-200 bg-white"><div class="border-b border-slate-100 px-5 py-4"><h3 class="text-sm font-semibold text-slate-900">Subject Guide</h3> <p class="mt-1 min-h-10 text-xs text-slate-500">Describe the recurring character, product, or subject identity this project should preserve.</p></div> <div class="px-5 py-4"><textarea data-testid="core-instruction-textarea" class="min-h-44 w-full resize-y rounded-xl border border-slate-200 bg-slate-50 px-3 py-3 text-sm text-slate-700 focus:border-amber-500 focus:outline-none focus:ring-1 focus:ring-amber-500" placeholder="Describe the recurring subject identity for this project..."></textarea></div></div> <div class="rounded-2xl border border-slate-200 bg-white xl:col-span-2"><button type="button" class="flex w-full items-start justify-between gap-4 px-5 py-4 text-left cursor-pointer"><div><h3 class="text-sm font-semibold text-slate-900">Instructions</h3> <p class="mt-1 text-xs text-slate-500">Advanced project-level instructions that apply to every generation, such as watermark, framing, or branding requirements. Use Visual Style and Subject Guide first when those are enough.</p></div> <span class="rounded-full border border-slate-200 bg-slate-50 px-3 py-1 text-xs font-medium text-slate-600"> </span></button> <!></div></div></div> <div class="flex items-center justify-end gap-3 border-t border-slate-200 px-6 py-4"><!> <!></div></div></div>');function ic(e,t){xe(t,!0);let r=N(""),n=N(""),a=N(""),s=N(""),u=N(""),d=N(""),o=N(null),f=N(null),v=N(null),x=N(!1),g=N(!1),R=N(!1),b=N(!1),y=te(()=>Kt.filter(T=>T.role!=="both").length),m=te(()=>Kt.filter(T=>T.role==="both").length),w=te(()=>i(y)>0),L=!1;ct(()=>{if(t.open&&!L){const T=Ur();l(r,T?.subjectGuide??"",!0),l(n,T?.visualStyle??"",!0),l(a,T?.instructions??"",!0),l(s,i(r),!0),l(u,i(n),!0),l(d,i(a),!0),l(f,null),l(v,null),l(o,null),l(x,Kt.some(W=>W.role!=="both"),!0),l(g,!1),l(R,Kt.some(W=>W.role==="both"),!0),l(b,(T?.instructions??"").trim().length>0),L=!0}t.open||(L=!1)}),ct(()=>{t.open&&i(w)&&l(x,!0)}),ct(()=>{i(m)>0&&l(R,!0)});let M=te(()=>i(r)!==i(s)||i(n)!==i(u)||i(a)!==i(d));async function A(T){const W=ft.value;if(!(!W||i(o))){l(o,T,!0),l(f,null),l(v,null);try{const H=await sl(W,T,{persist:!1});(T==="both"||T==="style")&&l(n,H.visualStyle??"",!0),(T==="both"||T==="subject")&&l(r,H.subjectGuide??"",!0),l(v,T==="both"?"Style and subject guides were derived. Review them, then save to apply.":T==="style"?"Visual style was derived. Save to apply it.":"Subject guide was derived. Save to apply it.",!0)}catch(H){l(f,H instanceof Error?H.message:"Derivation failed",!0)}finally{l(o,null)}}}async function O(){const T=ft.value;if(T)try{await al(T,{subjectGuide:i(r),visualStyle:i(n),instructions:i(a)}),l(s,i(r),!0),l(u,i(n),!0),l(d,i(a),!0),l(v,null),t.onClose()}catch(W){l(f,W instanceof Error?W.message:"Failed to save settings",!0)}}function _(){l(r,i(s),!0),l(n,i(u),!0),l(a,i(d),!0),l(f,null),l(v,null),t.onClose()}function h(T){T.target===T.currentTarget&&_()}function E(T){T.key==="Escape"&&_()}function B(T){l(r,T.target.value,!0),l(v,null)}function G(T){l(n,T.target.value,!0),l(v,null)}function J(T){l(a,T.target.value,!0),l(v,null)}function $(){return i(x)?"Derive visual style from style references and subject guide from subject references.":"Derive both guides from the project references."}async function Z(T){if(T.target.checked){l(x,!0);return}l(g,!0),l(f,null);try{await ul(),l(x,!1)}catch(H){l(f,H instanceof Error?H.message:"Failed to merge references",!0),l(x,!0)}finally{l(g,!1)}}var F=xr(),P=_e(F);{var U=T=>{var W=sc(),H=c(W),X=c(H),se=p(c(X),2),Se=p(X,2),Oe=c(Se),$e=c(Oe),Xe=c($e),Me=p(c(Xe),2),Ze=p(c(Me)),nr=c(Ze),ar=p(Xe,2),je=c(ar),Bt=p(c(je)),sr=c(Bt),jt=p(je,2),ir=p(c(jt)),Et=c(ir),de=p(jt,2),Ee=p(c(de)),Br=c(Ee),or=p(de,2),Gr=p(c(or)),qr=c(Gr),S=p(Oe,2),D=c(S);{var Y=Q=>{var oe=Xu(),Ne=_e(oe),Hr=p(c(Ne),2),Vr=c(Hr),Fn=p(Ne,2),Ln=c(Fn);Pr(Ln,{title:"Visual Style References",description:"Moodboards, palettes, rendering examples, and composition cues.",role:"style",emptyLabel:"Upload style-only references when the project's look should be separated from its subject.",allowRoleMove:!0,compact:!0});var ws=p(Ln,2);Pr(ws,{title:"Subject References",description:"Character sheets, product shots, or recurring subject references.",role:"subject",emptyLabel:"Upload subject-only references when the project's subject should be separated from its look.",allowRoleMove:!0,compact:!0});var ks=p(Fn,2);{var Ss=qt=>{Pr(qt,{title:"Shared References (Optional)",description:"Keep only the references that should influence both guides. Drag cards here or out to style/subject when needed.",role:"both",emptyLabel:"Drop shared references here only when an image should influence both style and subject.",allowRoleMove:!0,compact:!0})},js=qt=>{var Un=$u(),Es=p(c(Un),2);I("click",Es,()=>l(R,!0)),k(qt,Un)};z(ks,qt=>{i(m)>0||i(R)?qt(Ss):qt(js,-1)})}q(()=>{Va(Vr,i(x)),Vr.disabled=i(g)}),I("change",Vr,Z),k(Q,oe)};z(D,Q=>{i(x)&&Q(Y)})}var ie=p(D,2);{var me=Q=>{{let oe=te(()=>({label:"Split style and subject references",checked:i(x),disabled:i(g),onChange:Z}));Pr(Q,{title:"Project References",description:"Used for both the visual style and subject guide. This is the default reference set for the project.",role:"both",emptyLabel:"Upload the core references for this project. These will drive both the visual style and the subject guide.",allowRoleMove:!1,get headerAction(){return i(oe)}})}};z(ie,Q=>{i(x)||Q(me)})}var Te=p(S,2),Ge=c(Te),Qe=c(Ge),it=p(c(Qe),2),vt=c(it),pt=p(Qe,2),ht=c(pt),Gt=c(ht),qe=p(ht,2),Kr=c(qe),Ke=p(qe,2),kr=c(Ke),ss=p(Ge,2);{var is=Q=>{var oe=Zu(),Ne=c(oe);q(()=>K(Ne,i(f))),k(Q,oe)},os=Q=>{var oe=Qu(),Ne=c(oe);q(()=>K(Ne,i(v))),k(Q,oe)};z(ss,Q=>{i(f)?Q(is):i(v)&&Q(os,1)})}var ls=p(Te,2),Mn=c(ls);{var us=Q=>{var oe=ec();k(Q,oe)};z(Mn,Q=>{i(M)&&Q(us)})}var Tn=p(Mn,2),cs=p(c(Tn),2),Dn=c(cs),An=p(Tn,2),ds=p(c(An),2),On=c(ds),fs=p(An,2),Sr=c(fs),vs=p(c(Sr),2),ps=c(vs),hs=p(Sr,2);{var gs=Q=>{var oe=tc(),Ne=c(oe);q(()=>dt(Ne,i(a))),I("input",Ne,J),k(Q,oe)};z(hs,Q=>{i(b)&&Q(gs)})}var bs=p(Se,2),Nn=c(bs);{var ms=Q=>{var oe=rc();k(Q,oe)};z(Nn,Q=>{!i(M)&&i(v)&&Q(ms)})}var _s=p(Nn,2);{var xs=Q=>{var oe=nc(),Ne=_e(oe),Hr=p(Ne,2);I("click",Ne,_),I("click",Hr,O),k(Q,oe)},ys=Q=>{var oe=ac();I("click",oe,_),k(Q,oe)};z(_s,Q=>{i(M)?Q(xs):Q(ys,-1)})}q(Q=>{K(nr,Mt.value?.mode??"none"),K(sr,Mt.value?.refs.both??0),K(Et,Mt.value?.readiness.style?"yes":"no"),K(Br,Mt.value?.readiness.subject?"yes":"no"),K(qr,ne.apiKeyConfigured?"configured":"missing"),K(vt,Q),ht.disabled=i(o)!==null,K(Gt,i(o)==="both"?"Deriving style + subject...":"Derive Style + Subject"),qe.disabled=i(o)!==null,K(Kr,i(o)==="style"?"Deriving style...":"Derive Style"),Ke.disabled=i(o)!==null,K(kr,i(o)==="subject"?"Deriving subject...":"Derive Subject"),dt(Dn,i(n)),dt(On,i(r)),V(Sr,"aria-expanded",i(b)),K(ps,i(b)?"Hide":"Show")},[$]),I("click",W,h),I("keydown",W,E),I("click",se,_),I("click",ht,()=>A("both")),I("click",qe,()=>A("style")),I("click",Ke,()=>A("subject")),I("input",Dn,G),I("input",On,B),I("click",Sr,()=>l(b,!i(b))),k(T,W)};z(P,T=>{t.open&&T(U)})}k(e,F),ye()}Ie(["click","keydown","change","input"]);var oc=j('<div class="flex min-h-screen items-center justify-center bg-slate-50 text-sm text-slate-500">Loading Image Sprout...</div>'),lc=j('<div class="flex min-h-screen items-center justify-center bg-slate-50 px-6"><div class="rounded-xl bg-white p-6 text-sm text-red-600 shadow-lg"> </div></div>'),uc=j('<div data-testid="layout" class="grid h-screen" style="grid-template-columns: 300px 1fr"><!> <div data-testid="canvas-column" class="flex flex-col min-h-0 overflow-hidden"><!> <!></div></div> <!> <!>',1);function cc(e,t){xe(t,!0);let r=N(!1),n=N(!1),a=N(null);function s(){l(r,!0)}function u(){l(r,!1)}function d(){l(n,!0)}function o(){l(n,!1)}Wa(async()=>{try{await Go(),await tl(),l(a,null)}catch(y){l(a,y instanceof Error?y.message:"Failed to load app",!0)}});var f=xr(),v=_e(f);{var x=y=>{var m=oc();k(y,m)},g=y=>{var m=lc(),w=c(m),L=c(w);q(()=>K(L,i(a)??ne.loadError)),k(y,m)},R=y=>{fl(y,{})},b=y=>{var m=uc(),w=_e(m),L=c(w);Hl(L,{onOpenSettings:s});var M=p(L,2),A=c(M);_u(A);var O=p(A,2);Ou(O,{onOpenSettings:s,onOpenModelSettings:d});var _=p(w,2);ic(_,{get open(){return i(r)},onClose:u});var h=p(_,2);Gu(h,{get open(){return i(n)},onClose:o}),k(y,m)};z(v,y=>{!ne.ready||ne.loading?y(x):i(a)||ne.loadError?y(g,1):ne.apiKeyConfigured?y(b,-1):y(R,2)})}k(e,f),ye()}Zi(cc,{target:document.getElementById("app")});
|
package/dist/app/index.html
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
12
12
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet" />
|
|
13
13
|
<title>Image Sprout</title>
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
15
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-CxqTB59Z.js"></script>
|
|
15
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Cs3-aG7c.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
|
18
18
|
<div id="app"></div>
|