@hanzo/studio 0.1.11 → 0.1.12

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.
@@ -1,40 +1,61 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { SizableText, XStack, YStack } from '@hanzo/gui';
3
- import { Box, Clapperboard, Cpu, Download, Film, Layers, Library, Music, Play, Plus, RefreshCw, Sparkles, ThumbsDown, ThumbsUp, Upload, Video, Wand2, } from '@hanzogui/lucide-icons-2';
2
+ import { SizableText, styled, XStack, YStack } from '@hanzo/gui';
3
+ import { ArrowRight, ArrowUpRight, Box, ChevronDown, Clapperboard, Cpu, Download, Film, Folder, Layers, Library, Music, Play, Plus, RefreshCw, Sparkles, ThumbsDown, ThumbsUp, Upload, Video, Wand2, Workflow, } from '@hanzogui/lucide-icons-2';
4
+ import { DropdownMenu } from '@hanzo/ui';
4
5
  import { useEffect, useRef, useState } from 'react';
5
- export function parseStudioSection(path) {
6
- const clean = (path ?? '').replace(/^\/+|\/+$/g, '').split('/')[0] ?? '';
7
- if (clean === 'create' || clean === 'refine' || clean === 'home')
8
- return 'create';
9
- if (clean === 'documents' || clean === 'docs' || clean === 'frames' || clean === 'office')
10
- return 'documents';
11
- if (clean === 'video' || clean === 'cinema')
12
- return 'video';
13
- if (clean === 'music' || clean === 'audio' || clean === 'voice')
14
- return 'music';
15
- if (clean === 'model3d' || clean === '3d' || clean === 'mesh')
16
- return 'model3d';
17
- if (clean === 'library' || clean === 'stacks' || clean === 'assets')
18
- return 'library';
19
- if (clean === 'queue' || clean === 'activity' || clean === 'gpus')
20
- return 'queue';
21
- return 'create';
22
- }
6
+ import { download } from '../download.js';
7
+ import { reducedMotion, RING } from '../ui.js';
8
+ import { parseStudioSection } from './sections.js';
9
+ import { useWire } from '../live.js';
10
+ import { render } from '../gpu.js';
11
+ import { runs } from './flow-run.js';
12
+ import { ask, documents, gpus } from '../wire.js';
13
+ const StudioInput = styled(SizableText, {
14
+ name: 'DirectorFieldInput',
15
+ render: 'input',
16
+ size: '$2',
17
+ width: '100%',
18
+ minW: 0,
19
+ minH: 44,
20
+ $md: { minH: 34, height: 34 },
21
+ px: '$2.5',
22
+ rounded: '$3',
23
+ borderWidth: 1,
24
+ borderColor: 'var(--border-strong)',
25
+ bg: 'var(--background)',
26
+ color: '$ink',
27
+ focusVisibleStyle: RING,
28
+ });
29
+ const StudioTextarea = styled(SizableText, {
30
+ name: 'DirectorFieldTextarea',
31
+ render: 'textarea',
32
+ size: '$2',
33
+ width: '100%',
34
+ minW: 0,
35
+ p: '$2.5',
36
+ rounded: '$3',
37
+ borderWidth: 1,
38
+ borderColor: 'var(--border-strong)',
39
+ bg: 'var(--background)',
40
+ color: '$ink',
41
+ focusVisibleStyle: RING,
42
+ });
43
+ export { parseStudioSection };
23
44
  export function directorNav(host, go) {
24
45
  const active = parseStudioSection(host.path);
25
46
  const to = (p) => () => go(p);
26
47
  return [
27
48
  {
28
49
  id: 'make',
29
- label: 'Studio Production',
50
+ label: 'Studio production',
30
51
  links: [
31
- { id: 'create', label: 'Create & Refine', icon: _jsx(Wand2, { size: 16 }), onPress: to(''), active: active === 'create' },
32
- { id: 'library', label: 'Assets, Stacks & QC', icon: _jsx(Library, { size: 16 }), onPress: to('library'), active: active === 'library' },
33
- { id: 'documents', label: 'Documents & Frames', icon: _jsx(Layers, { size: 16 }), onPress: to('documents'), active: active === 'documents' },
34
- { id: 'video', label: 'Video & Cinema Rig', icon: _jsx(Clapperboard, { size: 16 }), onPress: to('video'), active: active === 'video' },
35
- { id: 'music', label: 'Music, Voice & Stems', icon: _jsx(Music, { size: 16 }), onPress: to('music'), active: active === 'music' },
36
- { id: 'model3d', label: '3D Mesh & World', icon: _jsx(Box, { size: 16 }), onPress: to('model3d'), active: active === 'model3d' },
37
- { id: 'queue', label: 'GPU Fleet & Queue', icon: _jsx(Cpu, { size: 16 }), onPress: to('queue'), active: active === 'queue' },
52
+ { id: 'create', label: 'Create & refine', icon: _jsx(Wand2, { size: 16 }), onPress: to(''), active: active === 'create' },
53
+ { id: 'library', label: 'Assets, stacks & QC', icon: _jsx(Library, { size: 16 }), onPress: to('library'), active: active === 'library' },
54
+ { id: 'documents', label: 'Documents & frames', icon: _jsx(Layers, { size: 16 }), onPress: to('documents'), active: active === 'documents' },
55
+ { id: 'video', label: 'Video & cinema rig', icon: _jsx(Clapperboard, { size: 16 }), onPress: to('video'), active: active === 'video' },
56
+ { id: 'music', label: 'Music, voice & stems', icon: _jsx(Music, { size: 16 }), onPress: to('music'), active: active === 'music' },
57
+ { id: 'model3d', label: '3D mesh & world', icon: _jsx(Box, { size: 16 }), onPress: to('model3d'), active: active === 'model3d' },
58
+ { id: 'queue', label: 'GPU fleet & queue', icon: _jsx(Cpu, { size: 16 }), onPress: to('queue'), active: active === 'queue' },
38
59
  ],
39
60
  },
40
61
  ];
@@ -42,56 +63,38 @@ export function directorNav(host, go) {
42
63
  export const TRANSFORMATION_LANES = [
43
64
  {
44
65
  id: 'cad_ghost',
45
- label: 'CAD → Ghost Mannequin',
46
- badge: 'denoise 0.92',
47
- denoise: 0.92,
48
- model: 'z_image_turbo_bf16.safetensors',
49
- description: 'High transformation distance (0.92): converts flat technical garment CAD sketches into photoreal 3D hollow ghost mannequin product shots.',
66
+ label: 'CAD → Ghost mannequin',
67
+ description: 'Words for a ghost mannequin product shot: invisible mannequin, crisp drape, neutral backdrop.',
50
68
  promptSuffix: 'invisible ghost mannequin studio photography, crisp garment drape, natural interior collar shadow, 85mm studio strobe, pure neutral backdrop',
51
69
  },
52
70
  {
53
71
  id: 'cad_mockup',
54
- label: 'CAD → Model Lookbook',
55
- badge: 'denoise 0.92',
56
- denoise: 0.92,
57
- model: 'z_image_turbo_bf16.safetensors',
58
- description: 'High transformation distance (0.92): dresses an editorial fashion model in the uploaded technical flat CAD while locking seam geometry.',
72
+ label: 'CAD → Model lookbook',
73
+ description: 'Words for an editorial lookbook shot on a model, in natural daylight.',
59
74
  promptSuffix: 'editorial fashion lookbook photography on model, natural fabric tension, 50mm Cooke prime, soft daylight studio',
60
75
  },
61
76
  {
62
77
  id: 'product',
63
- label: 'Product Look (Identity Lock)',
64
- badge: 'denoise 0.25',
65
- denoise: 0.25,
66
- model: 'Qwen-Image-Edit-2511',
67
- description: 'Low denoise (0.25): preserves exact SKU silhouette, hardware, stitching, and label typography while upgrading studio lighting and surface micro-texture.',
78
+ label: 'Product look (identity lock)',
79
+ description: 'Words for a clean hero product shot that keeps the product shape and labels.',
68
80
  promptSuffix: 'commercial hero product photography, preserve exact product geometry and labels, Phase One IQ4 150MP macro detail',
69
81
  },
70
82
  {
71
83
  id: 'lifestyle',
72
- label: 'Lifestyle Scene Placement',
73
- badge: 'denoise 0.25',
74
- denoise: 0.25,
75
- model: 'Qwen-Image-Edit-2511',
76
- description: 'Low denoise (0.25) on subject + scene synthesis: places your locked product or garment into an architectural or outdoor campaign location.',
84
+ label: 'Lifestyle scene placement',
85
+ description: 'Words that place the product in an architectural or outdoor campaign setting.',
77
86
  promptSuffix: 'architectural concrete and warm cedar interior, natural afternoon sunbeams, contact shadows grounded on surface',
78
87
  },
79
88
  {
80
89
  id: 'outfit',
81
- label: 'Outfit & Material Swap',
82
- badge: 'denoise 0.45',
83
- denoise: 0.45,
84
- model: 'Qwen-Image-Edit-2511',
85
- description: 'Medium denoise (0.45): swaps fabric, colorway, or trim material across 2–5 reference images while preserving pose and camera framing.',
90
+ label: 'Outfit & material swap',
91
+ description: 'Words for swapping a fabric, colour or trim while keeping the subject.',
86
92
  promptSuffix: 'instruction-guided material and colorway swap, keep subject identity, pose, and key lighting identical',
87
93
  },
88
94
  {
89
95
  id: 'inpaint_fix',
90
- label: 'Region Fix / Mask Inpaint',
91
- badge: 'denoise 0.30',
92
- denoise: 0.30,
93
- model: 'Qwen-Image-Edit-2511',
94
- description: 'Targeted surgical pass (0.30): repairs hands, collar drape, hardware, or typography inside a masked region (/v1/library/fix).',
96
+ label: 'Region fix / mask inpaint',
97
+ description: 'Words for a careful regional repair: hands, collar, hardware or type.',
95
98
  promptSuffix: 'surgical regional inpaint refinement, seamless edge blending, match surrounding grain and specular highlights',
96
99
  },
97
100
  ];
@@ -316,6 +319,7 @@ const INITIAL_LIBRARY = [
316
319
  { id: 'lib-4', path: 'edit/kael_trench_lookbook.png', title: 'Kael Vance — Wardrobe Lock v3', modality: 'image', stack: 'Character Continuity Vault', status: 'draft', vote: 0, critique: '', workflow: 'qwen-edit-inpaint', createdAt: '26m ago' },
317
320
  ];
318
321
  export function DirectorStudio({ host }) {
322
+ const wire = useWire(host);
319
323
  const [section, setSection] = useState(() => parseStudioSection(host.path));
320
324
  useEffect(() => {
321
325
  setSection(parseStudioSection(host.path));
@@ -323,7 +327,7 @@ export function DirectorStudio({ host }) {
323
327
  const switchSection = (next) => {
324
328
  setSection(next);
325
329
  if (host.go) {
326
- host.go(next === 'video' ? '' : next);
330
+ host.go(next === 'create' ? '' : next);
327
331
  }
328
332
  };
329
333
  // GPU Fleet & Live Queue state
@@ -336,20 +340,12 @@ export function DirectorStudio({ host }) {
336
340
  // Poll /v1/gpu-status when available
337
341
  useEffect(() => {
338
342
  let alive = true;
339
- const apiBase = host.api || 'https://api.hanzo.ai';
340
- const token = host.token();
341
- const headers = {};
342
- if (token)
343
- headers.Authorization = `Bearer ${token}`;
344
- if (host.org)
345
- headers['X-Org-Id'] = host.org;
346
- fetch(`${apiBase}/v1/gpu-status`, { headers })
347
- .then((r) => (r.ok ? r.json() : null))
343
+ gpus(wire)
348
344
  .then((j) => {
349
- if (!alive || !j?.nodes?.length)
345
+ if (!alive || !j.nodes?.length)
350
346
  return;
351
347
  setGpuNodes(j.nodes.map((n) => ({
352
- name: n.name || 'gpu-worker',
348
+ name: n.name || n.identity || 'gpu-worker',
353
349
  online: n.online !== false,
354
350
  depth: n.depth ?? 0,
355
351
  vram: 'Cloud GPU',
@@ -360,7 +356,7 @@ export function DirectorStudio({ host }) {
360
356
  return () => {
361
357
  alive = false;
362
358
  };
363
- }, [host]);
359
+ }, [wire]);
364
360
  // ── 1. VIDEO & CINEMA STATE ──────────────────────────────────────────────────
365
361
  const [shots, setShots] = useState(INITIAL_SHOTS);
366
362
  const [activeShotId, setActiveShotId] = useState(INITIAL_SHOTS[0].id);
@@ -422,67 +418,83 @@ export function DirectorStudio({ host }) {
422
418
  const [selectedDocTemplateId, setSelectedDocTemplateId] = useState(OFFICE_DOCUMENT_TEMPLATES[0].id);
423
419
  const selectedDocTemplate = OFFICE_DOCUMENT_TEMPLATES.find((d) => d.id === selectedDocTemplateId) ?? OFFICE_DOCUMENT_TEMPLATES[0];
424
420
  const [docBrief, setDocBrief] = useState(OFFICE_DOCUMENT_TEMPLATES[0].defaultBrief);
421
+ const [showAllLanes, setShowAllLanes] = useState(false);
422
+ const [showAllDocs, setShowAllDocs] = useState(false);
423
+ const [showAllCameras, setShowAllCameras] = useState(false);
424
+ const [showAllLenses, setShowAllLenses] = useState(false);
425
+ const [creatingAsset, setCreatingAsset] = useState(false);
426
+ const [generatingDoc, setGeneratingDoc] = useState(false);
427
+ // The pictures made here are object addresses; they and any render in flight end with the page.
428
+ const madeUrls = useRef([]);
429
+ // A render gets its own controller when it starts, so a StrictMode remount cannot leave a spent one behind.
430
+ const rendering = useRef(runs());
431
+ useEffect(() => {
432
+ const urls = madeUrls.current;
433
+ return () => {
434
+ rendering.current.stop();
435
+ urls.forEach((u) => URL.revokeObjectURL(u));
436
+ };
437
+ }, []);
425
438
  const runCreateAndRefine = async () => {
439
+ if (creatingAsset)
440
+ return;
441
+ setCreatingAsset(true);
426
442
  triggerCinemaAudio();
427
443
  const newId = `lib-${Date.now().toString(36)}`;
428
- const compiled = `${createPrompt} — [${selectedLane.label}, denoise=${selectedLane.denoise}, brand=${selectedBrand.name}: ${selectedBrand.directives}]`;
429
- setStatusNote(`Queued ${selectedLane.label} (${selectedLane.model}, denoise ${selectedLane.denoise}) with ${selectedBrand.name} brand kit → /v1/images/generations`);
430
- const apiBase = host.api || 'https://api.hanzo.ai';
431
- const token = host.token();
432
- const headers = { 'Content-Type': 'application/json' };
433
- if (token)
434
- headers.Authorization = `Bearer ${token}`;
435
- if (host.org)
436
- headers['X-Org-Id'] = host.org;
437
- await fetch(`${apiBase}/v1/images/generations`, {
438
- method: 'POST',
439
- headers,
440
- body: JSON.stringify({
441
- model: selectedLane.model,
442
- prompt: `${compiled}. ${selectedLane.promptSuffix}`,
443
- denoise: selectedLane.denoise,
444
- lane: selectedLane.id,
445
- brand_system: selectedBrand.id,
446
- references: referenceFiles,
447
- }),
448
- }).catch(() => null);
449
- setLibraryItems((prev) => [
450
- {
451
- id: newId,
452
- title: `${selectedLane.label} — ${createPrompt.slice(0, 42)}`,
453
- modality: 'image',
454
- stack: `${selectedBrand.name} · ${selectedLane.badge}`,
455
- workflow: `${selectedLane.id}_denoise_${selectedLane.denoise}.json`,
456
- path: `output/image/${newId}.png`,
457
- vote: 0,
458
- critique: `Conditioned on ${referenceFiles.join(', ')} (${selectedLane.badge})`,
459
- status: 'draft',
460
- createdAt: 'Just now',
461
- },
462
- ...prev,
463
- ]);
444
+ const compiled = `${createPrompt} — [${selectedLane.label}, brand=${selectedBrand.name}: ${selectedBrand.directives}]`;
445
+ setStatusNote(`Sending ${selectedLane.label} to your GPU from words only: the lane and brand kit are written into the prompt, and no reference picture is sent.`);
446
+ const ctl = rendering.current.start();
447
+ try {
448
+ const [first] = await render(wire, 'image', { prompt: `${compiled}. ${selectedLane.promptSuffix}`, width: 1024, height: 1024 }, (line) => setStatusNote(`${selectedLane.label}: ${line}`), ctl.signal);
449
+ if (!first)
450
+ throw new Error('The render finished with no image.');
451
+ const resolvedPath = URL.createObjectURL(first.blob);
452
+ madeUrls.current.push(resolvedPath);
453
+ setLibraryItems((prev) => [
454
+ {
455
+ id: newId,
456
+ title: `${selectedLane.label} — ${createPrompt.slice(0, 42)}`,
457
+ modality: 'image',
458
+ stack: selectedBrand.name,
459
+ workflow: 'zen-image (image lane)',
460
+ path: resolvedPath,
461
+ vote: 0,
462
+ critique: '',
463
+ status: 'draft',
464
+ createdAt: 'Just now',
465
+ },
466
+ ...prev,
467
+ ]);
468
+ setStatusNote(`Generated ${selectedLane.label} (${selectedBrand.name}) on your GPU`);
469
+ }
470
+ catch (e) {
471
+ setStatusNote(`Could not generate ${selectedLane.label}: ${e instanceof Error ? e.message : String(e)}`);
472
+ }
473
+ finally {
474
+ setCreatingAsset(false);
475
+ }
464
476
  };
465
477
  const generateOfficeDocument = async (tpl) => {
478
+ if (generatingDoc)
479
+ return;
480
+ setGeneratingDoc(true);
466
481
  triggerCinemaAudio();
467
- setStatusNote(`Generating ${tpl.title} (${tpl.format}) with ${selectedBrand.name} design system → ${tpl.endpoint}`);
468
- const apiBase = host.api || 'https://api.hanzo.ai';
469
- const token = host.token();
470
- const headers = { 'Content-Type': 'application/json' };
471
- if (token)
472
- headers.Authorization = `Bearer ${token}`;
473
- if (host.org)
474
- headers['X-Org-Id'] = host.org;
475
- await fetch(`${apiBase}${tpl.endpoint}`, {
476
- method: 'POST',
477
- headers,
478
- body: JSON.stringify({
479
- template_id: tpl.id,
480
- category: tpl.category,
481
- format: tpl.format,
482
- brand_system: selectedBrand.id,
483
- brief: docBrief,
484
- }),
485
- }).catch(() => null);
482
+ setStatusNote(`Generating ${tpl.title} (${tpl.format}) with ${selectedBrand.name} design system → ${tpl.endpoint}…`);
483
+ try {
484
+ const fields = { category: tpl.category, format: tpl.format, brand_system: selectedBrand.id };
485
+ const body = tpl.endpoint === '/v1/documents/generate'
486
+ ? await documents.generate(wire, { templateId: tpl.id, description: docBrief, fields })
487
+ : await ask(wire, 'engine', tpl.endpoint, { body: { template_id: tpl.id, ...fields, brief: docBrief } });
488
+ setStatusNote(body?.id
489
+ ? `Created ${tpl.title} (${tpl.format}) · ${body.id}`
490
+ : `${tpl.endpoint} answered with no document id for ${tpl.title}; nothing was created.`);
491
+ }
492
+ catch (e) {
493
+ setStatusNote(`Could not generate ${tpl.title}: ${e instanceof Error ? e.message : String(e)}`);
494
+ }
495
+ finally {
496
+ setGeneratingDoc(false);
497
+ }
486
498
  };
487
499
  // Real-time 60fps Anamorphic Cinema Canvas Preview
488
500
  useEffect(() => {
@@ -622,7 +634,7 @@ export function DirectorStudio({ host }) {
622
634
  ctx.stroke();
623
635
  ctx.restore();
624
636
  const barH = activeLens.aspect === '2.39:1' ? Math.round(h * 0.12) : Math.round(h * 0.04);
625
- ctx.fillStyle = '#000000';
637
+ ctx.fillStyle = '#050508';
626
638
  ctx.fillRect(0, 0, w, barH);
627
639
  ctx.fillRect(0, h - barH, w, barH);
628
640
  ctx.strokeStyle = 'rgba(255,255,255,0.08)';
@@ -638,7 +650,7 @@ export function DirectorStudio({ host }) {
638
650
  ctx.lineTo(w, barH + ((h - 2 * barH) * 2) / 3);
639
651
  ctx.stroke();
640
652
  ctx.fillStyle = 'rgba(255,255,255,0.78)';
641
- ctx.font = '600 11px ui-monospace, SFMono-Regular, Menlo, monospace';
653
+ ctx.font = '600 12px ui-monospace, SFMono-Regular, Menlo, monospace';
642
654
  ctx.fillText(`SHOT ${String(activeShot.number).padStart(2, '0')} · ${activeCamera.code} · ${activeLens.label.split(' ')[0]} · ${activeShot.aperture}`, 18, 22);
643
655
  ctx.fillStyle = '#3ddc84';
644
656
  ctx.fillText(`● ACTOR LOCK: ${activeCharacter.name.toUpperCase()} (#${activeCharacter.seed})`, w - 310, 22);
@@ -654,7 +666,8 @@ export function DirectorStudio({ host }) {
654
666
  const tw = ctx.measureText(sub).width;
655
667
  ctx.fillText(sub, Math.max(18, (w - tw) / 2), h - barH - 18);
656
668
  }
657
- raf = requestAnimationFrame(render);
669
+ if (!reducedMotion())
670
+ raf = requestAnimationFrame(render);
658
671
  };
659
672
  raf = requestAnimationFrame(render);
660
673
  return () => cancelAnimationFrame(raf);
@@ -713,7 +726,8 @@ export function DirectorStudio({ host }) {
713
726
  ctx.moveTo(playheadX, 0);
714
727
  ctx.lineTo(playheadX, h);
715
728
  ctx.stroke();
716
- raf = requestAnimationFrame(draw);
729
+ if (!reducedMotion())
730
+ raf = requestAnimationFrame(draw);
717
731
  };
718
732
  raf = requestAnimationFrame(draw);
719
733
  return () => cancelAnimationFrame(raf);
@@ -884,11 +898,12 @@ export function DirectorStudio({ host }) {
884
898
  ctx.stroke();
885
899
  }
886
900
  ctx.fillStyle = 'rgba(255,255,255,0.78)';
887
- ctx.font = '600 11px ui-monospace, SFMono-Regular, Menlo, monospace';
901
+ ctx.font = '600 12px ui-monospace, SFMono-Regular, Menlo, monospace';
888
902
  ctx.fillText(`HUNYUAN3D-2.1 · ${activeMesh.name.toUpperCase()} · SHADER: ${meshShader.toUpperCase()}`, 16, 24);
889
903
  ctx.fillStyle = '#3ddc84';
890
904
  ctx.fillText(`VERTICES: ${activeMesh.vertices.toLocaleString()} · FACES: ${activeMesh.faces.toLocaleString()} · OCTREE: ${meshOctree}`, 16, h - 14);
891
- raf = requestAnimationFrame(draw3D);
905
+ if (!reducedMotion())
906
+ raf = requestAnimationFrame(draw3D);
892
907
  };
893
908
  raf = requestAnimationFrame(draw3D);
894
909
  return () => cancelAnimationFrame(raf);
@@ -932,36 +947,29 @@ export function DirectorStudio({ host }) {
932
947
  ].join(' ');
933
948
  setStatusNote(`Dispatching Shot ${shot.number} (${activeCamera.code}) to Hanzo Studio Wan 2.2 / Koma lane…`);
934
949
  try {
935
- const token = host.token();
936
- const headers = { 'Content-Type': 'application/json' };
937
- if (token)
938
- headers.Authorization = `Bearer ${token}`;
939
- if (host.org)
940
- headers['X-Org-Id'] = host.org;
941
- if (targetGpu !== 'any')
942
- headers['X-Target-GPU'] = targetGpu;
943
- const apiBase = host.api || 'https://api.hanzo.ai';
944
- const res = await fetch(`${apiBase}/v1/videos`, {
945
- method: 'POST',
946
- headers,
947
- body: JSON.stringify({
950
+ const body = await ask(wire, 'api', '/v1/videos', {
951
+ body: {
948
952
  model: 'koma-cinema-v2',
949
953
  prompt: compiledPrompt,
950
954
  duration: shot.durationSec,
951
955
  aspect_ratio: activeLens.aspect === '2.39:1' ? '21:9' : '16:9',
952
- }),
953
- }).catch(() => null);
954
- if (res && res.ok) {
955
- const body = (await res.json().catch(() => ({})));
956
- const videoUrl = body.url || body.data?.[0]?.url;
956
+ },
957
+ head: targetGpu !== 'any' ? { 'X-Target-GPU': targetGpu } : undefined,
958
+ });
959
+ const videoUrl = body?.url || body?.data?.[0]?.url;
960
+ if (videoUrl) {
957
961
  updateShot({ status: 'done', videoUrl });
958
962
  setStatusNote(`Shot ${shot.number} rendered on Cloud GPU · Locked to ${activeCharacter.name}`);
959
963
  }
960
964
  else {
961
- updateShot({ status: 'done' });
962
- setStatusNote(`Shot ${shot.number} synthesized in real-time Cinema Engine (${activeCamera.name} · ${activeLens.label})`);
965
+ updateShot({ status: 'ready' });
966
+ setStatusNote(`Shot ${shot.number} did not render (/v1/videos answered with no video). The preview above is a sketch, not a render.`);
963
967
  }
964
968
  }
969
+ catch (e) {
970
+ updateShot({ status: 'ready' });
971
+ setStatusNote(`Shot ${shot.number} did not render (${e instanceof Error ? e.message : String(e)}). The preview above is a sketch, not a render.`);
972
+ }
965
973
  finally {
966
974
  setRenderingId(null);
967
975
  }
@@ -980,10 +988,7 @@ export function DirectorStudio({ host }) {
980
988
  })),
981
989
  };
982
990
  const blob = new Blob([JSON.stringify(payload, null, 2)], { type: 'application/json' });
983
- const a = document.createElement('a');
984
- a.href = URL.createObjectURL(blob);
985
- a.download = 'hanzo-studio-sequence.otio.json';
986
- a.click();
991
+ download('hanzo-studio-sequence.otio.json', blob);
987
992
  };
988
993
  const exportMeshObj = () => {
989
994
  const lines = [
@@ -1004,10 +1009,7 @@ export function DirectorStudio({ host }) {
1004
1009
  'f 7 8 2 1',
1005
1010
  ];
1006
1011
  const blob = new Blob([lines.join('\n')], { type: 'text/plain' });
1007
- const a = document.createElement('a');
1008
- a.href = URL.createObjectURL(blob);
1009
- a.download = `${activeMesh.id}.obj`;
1010
- a.click();
1012
+ download(`${activeMesh.id}.obj`, blob);
1011
1013
  setStatusNote(`Exported 3D Mesh "${activeMesh.name}" (.obj / .glb ready)`);
1012
1014
  };
1013
1015
  const addShot = () => {
@@ -1059,205 +1061,136 @@ export function DirectorStudio({ host }) {
1059
1061
  input.click();
1060
1062
  };
1061
1063
  const SECTION_TABS = [
1062
- { id: 'create', label: 'Create & Refine', badge: 'CAD · Lookbook · 0.25–0.92' },
1063
- { id: 'library', label: 'Assets, Stacks & QC', badge: 'Flywheel · Fix' },
1064
- { id: 'documents', label: 'Documents & Frames', badge: 'PDF · XLSX · PPTX' },
1065
- { id: 'video', label: 'Video & Cinema Rig', badge: 'Wan 2.2 · Koma' },
1066
- { id: 'music', label: 'Music, Voice & Stems', badge: 'ACE-Step · Koe' },
1067
- { id: 'model3d', label: '3D Mesh & World', badge: 'Hunyuan3D .glb' },
1068
- { id: 'queue', label: 'GPU Fleet & Queue', badge: `${gpuNodes.filter((g) => g.online).length} GPUs` },
1064
+ { id: 'create', label: 'Create' },
1065
+ { id: 'library', label: 'Assets & QC' },
1066
+ { id: 'documents', label: 'Documents' },
1067
+ { id: 'video', label: 'Video' },
1068
+ { id: 'music', label: 'Music' },
1069
+ { id: 'model3d', label: '3D mesh' },
1070
+ { id: 'queue', label: 'GPUs' },
1069
1071
  ];
1070
- return (_jsxs(YStack, { flex: 1, minH: 0, bg: "$background", p: "$3", gap: "$3", overflow: "scroll", "data-slot": "director-studio", children: [_jsxs(YStack, { gap: "$2.5", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "var(--pane-fill, var(--sheet-1))", children: [_jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2", children: [_jsxs(XStack, { items: "center", gap: "$2.5", flexWrap: "wrap", children: [_jsx(Clapperboard, { size: 16 }), _jsx(SizableText, { size: "$3", fontWeight: "600", children: "Hanzo Studio \u2014 Content Creation, Refinement & Production Suite" }), _jsx(SizableText, { size: "$1", color: "$soft", children: statusNote })] }), _jsxs(XStack, { items: "center", gap: "$2", flexWrap: "wrap", children: [_jsxs(XStack, { render: "button", onPress: uploadReference, items: "center", gap: "$1.5", px: "$3", height: 30, rounded: 999, borderWidth: 1, borderColor: "$borderColor", cursor: "pointer", hoverStyle: { bg: '$hover' }, children: [_jsx(Upload, { size: 13 }), _jsx(SizableText, { size: "$1", children: "Attach Reference / CAD / .GLB" })] }), _jsxs(XStack, { render: "button", onPress: exportSequenceJson, items: "center", gap: "$1.5", px: "$3", height: 30, rounded: 999, borderWidth: 1, borderColor: "$borderColor", cursor: "pointer", hoverStyle: { bg: '$hover' }, children: [_jsx(Download, { size: 13 }), _jsx(SizableText, { size: "$1", children: "Export EDL / OTIO" })] }), _jsxs(XStack, { render: "button", onPress: () => host.open('/flow'), items: "center", gap: "$1.5", px: "$3", height: 30, rounded: 999, borderWidth: 1, borderColor: "$ink", bg: "$ink", cursor: "pointer", children: [_jsx(Layers, { size: 13 }), _jsx(SizableText, { size: "$1", color: "$background", fontWeight: "600", children: "\u2B21 Open in Hanzo Flow (/flow)" })] })] })] }), _jsx(XStack, { gap: "$2", flexWrap: "wrap", pt: "$1", children: SECTION_TABS.map((t) => {
1072
+ const visibleLanes = showAllLanes
1073
+ ? TRANSFORMATION_LANES
1074
+ : TRANSFORMATION_LANES.slice(0, 4).some((l) => l.id === selectedLane.id)
1075
+ ? TRANSFORMATION_LANES.slice(0, 4)
1076
+ : [...TRANSFORMATION_LANES.slice(0, 3), selectedLane];
1077
+ const filteredDocs = OFFICE_DOCUMENT_TEMPLATES.filter((t) => docCategoryFilter === 'All' || t.category === docCategoryFilter);
1078
+ const visibleDocs = showAllDocs || filteredDocs.length <= 4 ? filteredDocs : filteredDocs.slice(0, 4);
1079
+ const visibleCameras = showAllCameras
1080
+ ? CAMERA_MOVES
1081
+ : CAMERA_MOVES.slice(0, 4).some((c) => c.id === activeShot.cameraId)
1082
+ ? CAMERA_MOVES.slice(0, 4)
1083
+ : [...CAMERA_MOVES.slice(0, 3), activeCamera];
1084
+ const visibleLenses = showAllLenses
1085
+ ? LENSES
1086
+ : LENSES.slice(0, 4).some((l) => l.id === activeShot.lensId)
1087
+ ? LENSES.slice(0, 4)
1088
+ : [...LENSES.slice(0, 3), activeLens];
1089
+ return (_jsxs(YStack, { flex: 1, minH: 0, minW: 0, width: "100%", bg: "var(--background)", p: "$3", $md: { p: '$4' }, gap: "$3", overflowY: "auto", overflowX: "hidden", "data-slot": "director-studio", children: [_jsxs(YStack, { gap: "$2.5", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", minW: 0, children: [_jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2.5", minW: 0, children: [_jsxs(YStack, { gap: 2, flex: 1, minW: 200, children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Clapperboard, { size: 16, color: "$ink" }), _jsx(SizableText, { render: "h1", size: "$4", fontWeight: "600", color: "$ink", letterSpacing: -0.25, numberOfLines: 1, children: "Hanzo Studio \u2014 Production suite" })] }), _jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 2, children: statusNote })] }), _jsxs(XStack, { items: "center", gap: "$1.5", flexWrap: "wrap", shrink: 0, maxW: "100%", children: [_jsx(DropdownMenu, { minWidth: 228, trigger: _jsxs(XStack, { render: _jsx("button", { type: "button" }), "aria-label": "Studio file and sequence actions", items: "center", gap: "$1.5", px: "$3", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 32, height: 32 }, rounded: 999, borderWidth: 1, borderColor: "var(--border-strong)", bg: "transparent", cursor: "pointer", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, shrink: 0, children: [_jsx(Upload, { size: 13, color: "$ink" }), _jsx(SizableText, { size: "$1", fontWeight: "500", color: "$ink", children: "Files & export" }), _jsx(ChevronDown, { size: 12, color: "$soft" })] }), items: [
1090
+ {
1091
+ key: 'attach',
1092
+ label: 'Attach reference',
1093
+ description: 'Lock CAD, photo, or GLB into workspace',
1094
+ icon: _jsx(Upload, { size: 13, color: "$soft" }),
1095
+ onSelect: uploadReference,
1096
+ },
1097
+ {
1098
+ key: 'edl',
1099
+ label: 'Export EDL / OTIO',
1100
+ description: 'Download multi-shot cinema sequence JSON',
1101
+ icon: _jsx(Download, { size: 13, color: "$soft" }),
1102
+ onSelect: exportSequenceJson,
1103
+ },
1104
+ ] }), _jsxs(XStack, { render: _jsx("button", { type: "button" }), "aria-label": "Open in Hanzo Flow", onClick: () => host.open('/flow'), items: "center", gap: "$1.5", px: "$3", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 32, height: 32 }, rounded: 999, borderWidth: 1, borderColor: "var(--border-strong)", bg: "transparent", cursor: "pointer", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, shrink: 0, children: [_jsx(Workflow, { size: 13, color: "$ink" }), _jsx(SizableText, { size: "$1", color: "$ink", fontWeight: "500", children: "Open in Hanzo Flow" }), _jsx(ArrowUpRight, { size: 12, color: "$soft" })] })] })] }), _jsx(XStack, { role: "tablist", "aria-label": "Studio sections", gap: "$1.5", pt: "$1", pb: "$0.5", overflowX: "auto", flexWrap: "nowrap", width: "100%", display: "flex", $md: { display: 'none' }, style: { scrollbarWidth: 'none' }, children: SECTION_TABS.map((t) => {
1071
1105
  const on = section === t.id;
1072
- return (_jsxs(XStack, { render: "button", onPress: () => switchSection(t.id), px: "$3", height: 34, items: "center", gap: "$2", rounded: 999, borderWidth: 1, borderColor: on ? '$ink' : '$borderColor', bg: on ? '$ink' : 'transparent', cursor: "pointer", children: [_jsx(SizableText, { size: "$2", fontWeight: on ? '600' : '500', color: on ? '$background' : '$ink', children: t.label }), _jsx(SizableText, { size: "$1", color: on ? '$background' : '$soft', style: { opacity: on ? 0.8 : 1 }, children: t.badge })] }, t.id));
1073
- }) })] }), section === 'create' ? (_jsx(YStack, { gap: "$3", children: _jsxs(XStack, { gap: "$3", flexWrap: "wrap", children: [_jsxs(YStack, { flex: 2, minW: 380, gap: "$3", p: "$3.5", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "var(--pane-fill, var(--sheet-1))", children: [_jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2", children: [_jsxs(YStack, { gap: 2, children: [_jsx(SizableText, { size: "$4", fontWeight: "700", children: "What should we create or refine?" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Transformation-distance denoise lanes: preserve exact SKU identity (0.25) or synthesize photoreal garments from flat CADs (0.92)." })] }), _jsxs(XStack, { render: "button", onPress: () => void runCreateAndRefine(), px: "$4", height: 36, rounded: 999, bg: "$ink", items: "center", gap: "$2", cursor: "pointer", children: [_jsx(Sparkles, { size: 14 }), _jsx(SizableText, { size: "$2", color: "$background", fontWeight: "600", children: `Generate (${selectedLane.badge})` })] })] }), _jsx("textarea", { "aria-label": "What should we create or refine", value: createPrompt, onChange: (e) => setCreatePrompt(e.currentTarget.value), rows: 3, style: {
1074
- width: '100%',
1075
- borderRadius: 12,
1076
- padding: '12px 14px',
1077
- background: 'rgba(255,255,255,0.04)',
1078
- border: '1px solid rgba(255,255,255,0.14)',
1079
- color: 'inherit',
1080
- font: 'inherit',
1081
- resize: 'vertical',
1082
- } }), _jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2", children: [_jsxs(XStack, { items: "center", gap: "$1.5", flexWrap: "wrap", children: [_jsxs(SizableText, { size: "$1", color: "$soft", children: ["References (", referenceFiles.length, "):"] }), referenceFiles.map((refName) => (_jsx(XStack, { px: "$2.5", height: 26, items: "center", gap: "$1.5", rounded: 999, borderWidth: 1, borderColor: "$borderColor", bg: "rgba(255,255,255,0.03)", children: _jsx(SizableText, { size: "$1", style: { fontFamily: 'ui-monospace, monospace' }, children: refName }) }, refName))), _jsxs(XStack, { render: "button", onPress: uploadReference, px: "$2.5", height: 26, items: "center", gap: 4, rounded: 999, borderWidth: 1, borderColor: "$borderColor", cursor: "pointer", children: [_jsx(Plus, { size: 12 }), _jsx(SizableText, { size: "$1", children: "Add CAD / Photo / Swatch" })] })] }), _jsx(SizableText, { size: "$1", color: "$soft", style: { fontFamily: 'ui-monospace, monospace' }, children: `Engine: ${selectedLane.model} · denoise=${selectedLane.denoise}` })] }), _jsxs(YStack, { gap: "$2", pt: "$1", children: [_jsx(SizableText, { size: "$2", fontWeight: "600", children: "1. Transformation Lane & Denoise Distance" }), _jsx(XStack, { gap: "$2", flexWrap: "wrap", role: "list", "aria-label": "Starters", children: TRANSFORMATION_LANES.map((lane) => {
1083
- const active = lane.id === selectedLane.id;
1084
- return (_jsxs(YStack, { render: "button", onPress: () => setSelectedLaneId(lane.id), width: "calc(33.333% - 6px)", minW: 210, grow: 1, p: "$2.5", rounded: "$3", borderWidth: active ? 2 : 1, borderColor: active ? '$ink' : '$borderColor', bg: active ? '$hover' : 'rgba(255,255,255,0.02)', gap: 4, cursor: "pointer", style: { textAlign: 'left' }, children: [_jsxs(XStack, { justify: "space-between", items: "center", gap: "$1", children: [_jsx(SizableText, { size: "$2", fontWeight: "600", numberOfLines: 1, children: lane.label }), _jsx(SizableText, { size: "$1", color: active ? '$green10' : '$soft', style: { fontFamily: 'ui-monospace, monospace' }, children: lane.badge })] }), _jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 2, children: lane.description })] }, lane.id));
1085
- }) })] })] }), _jsxs(YStack, { width: 330, grow: 1, maxW: 380, gap: "$3", p: "$3.5", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "var(--pane-fill, var(--sheet-1))", children: [_jsxs(YStack, { gap: 2, children: [_jsx(SizableText, { size: "$2", fontWeight: "600", children: "2. Design System & Brand Kit" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Locks palette, typography, and studio lighting directives across images, video, and office docs." })] }), _jsx(YStack, { gap: "$2", children: BRAND_DESIGN_SYSTEMS.map((brand) => {
1086
- const active = brand.id === selectedBrand.id;
1087
- return (_jsxs(YStack, { render: "button", onPress: () => setSelectedBrandId(brand.id), p: "$2.5", rounded: "$3", borderWidth: active ? 2 : 1, borderColor: active ? '$ink' : '$borderColor', bg: active ? '$hover' : 'rgba(255,255,255,0.02)', gap: 4, cursor: "pointer", style: { textAlign: 'left' }, children: [_jsxs(XStack, { justify: "space-between", items: "center", children: [_jsx(SizableText, { size: "$2", fontWeight: "600", children: brand.name }), _jsx(XStack, { gap: 4, children: brand.palette.map((hex) => (_jsx("span", { style: {
1088
- width: 12,
1089
- height: 12,
1090
- borderRadius: 99,
1091
- background: hex,
1092
- border: '1px solid rgba(255,255,255,0.22)',
1093
- display: 'inline-block',
1094
- } }, hex))) })] }), _jsx(SizableText, { size: "$1", color: "$soft", children: brand.tagline }), _jsx(SizableText, { size: "$1", color: "$soft", style: { fontFamily: 'ui-monospace, monospace' }, children: brand.fonts })] }, brand.id));
1095
- }) }), _jsxs(XStack, { render: "button", onPress: () => switchSection('library'), height: 34, rounded: 999, borderWidth: 1, borderColor: "$borderColor", items: "center", justify: "center", gap: "$1.5", cursor: "pointer", children: [_jsx(Library, { size: 13 }), _jsx(SizableText, { size: "$1", fontWeight: "600", children: "Open Assets, Stacks & Critique Flywheel \u2192" })] })] })] }) })) : null, section === 'documents' ? (_jsxs(XStack, { gap: "$3", flex: 1, minH: 460, flexWrap: "wrap", children: [_jsxs(YStack, { flex: 2, minW: 380, gap: "$3", p: "$3.5", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "var(--pane-fill, var(--sheet-1))", children: [_jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2", children: [_jsxs(YStack, { children: [_jsx(SizableText, { size: "$3", fontWeight: "600", children: "Brand-Conditioned Documents, Line Sheets, Pitch Decks & Frames" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Generate production PDF/DOCX tech packs, XLSX wholesale matrices, PPTX lookbooks, and 60fps HTML/MP4 Frames (/v1/documents/generate)." })] }), _jsx(XStack, { gap: "$1.5", flexWrap: "wrap", children: ['All', 'Documents', 'Spreadsheets', 'Presentations', 'Frames'].map((cat) => (_jsx(XStack, { render: "button", onPress: () => setDocCategoryFilter(cat), px: "$2.5", height: 28, items: "center", rounded: 999, borderWidth: 1, borderColor: docCategoryFilter === cat ? '$ink' : '$borderColor', bg: docCategoryFilter === cat ? '$ink' : 'transparent', cursor: "pointer", children: _jsx(SizableText, { size: "$1", color: docCategoryFilter === cat ? '$background' : '$ink', children: cat }) }, cat))) })] }), _jsx(XStack, { gap: "$2.5", flexWrap: "wrap", role: "list", "aria-label": "Starters", children: OFFICE_DOCUMENT_TEMPLATES.filter((t) => docCategoryFilter === 'All' || t.category === docCategoryFilter).map((tpl) => {
1106
+ return (_jsx(XStack, { render: _jsx("button", { type: "button" }), role: "tab", "aria-selected": on, onClick: () => switchSection(t.id), px: "$3", minH: 44, "$max-sm": { minH: 44 }, items: "center", rounded: 999, borderWidth: 1, borderColor: on ? '$ink' : 'var(--border-strong)', bg: on ? 'var(--surface-card-emphasis)' : 'transparent', cursor: "pointer", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, shrink: 0, children: _jsx(SizableText, { size: "$1", fontWeight: on ? '600' : '500', color: on ? '$ink' : '$soft', children: t.label }) }, t.id));
1107
+ }) })] }), section === 'create' ? (_jsxs(YStack, { gap: "$3", width: "100%", minW: 0, $lg: { flexDirection: 'row', items: 'flex-start' }, children: [_jsxs(YStack, { width: "100%", minW: 0, $lg: { flex: 1 }, gap: "$3", p: "$3.5", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2.5", minW: 0, children: [_jsxs(YStack, { gap: 2, flex: 1, minW: 200, children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "What should we create or refine?" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "A lane only shapes the prompt. It sends words, no reference picture and no denoise setting." })] }), _jsxs(XStack, { render: _jsx("button", { type: "button" }), disabled: creatingAsset, onClick: () => void runCreateAndRefine(), px: "$4", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 34, height: 34 }, rounded: 999, bg: "$ink", items: "center", gap: "$1.5", opacity: creatingAsset ? 0.65 : 1, cursor: creatingAsset ? 'default' : 'pointer', hoverStyle: creatingAsset ? undefined : { opacity: 0.9 }, focusVisibleStyle: RING, shrink: 0, children: [_jsx(Sparkles, { size: 14, color: "$background" }), _jsx(SizableText, { size: "$2", color: "$background", fontWeight: "600", children: creatingAsset ? 'Generating…' : 'Generate' })] })] }), _jsx(StudioTextarea, { "aria-label": "What should we create or refine", p: "$3", rounded: "$3", style: { resize: 'none' }, ...{ value: createPrompt, rows: 3 }, onChange: (e) => setCreatePrompt(e.currentTarget.value) }), _jsx(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2", minW: 0, children: _jsxs(XStack, { items: "center", gap: "$1.5", flexWrap: "wrap", minW: 0, children: [_jsx(SizableText, { size: "$1", color: "$soft", children: `References (${referenceFiles.length}):` }), referenceFiles.map((refName) => (_jsx(XStack, { px: "$2.5", height: 26, items: "center", gap: "$1.5", rounded: 999, borderWidth: 1, borderColor: "var(--border)", bg: "var(--background)", children: _jsx(SizableText, { size: "$1", fontFamily: "$mono", color: "$ink", numberOfLines: 1, children: refName }) }, refName))), _jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: uploadReference, px: "$2.5", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 26, height: 26 }, items: "center", gap: "$1", rounded: 999, borderWidth: 1, borderColor: "var(--border-strong)", bg: "transparent", cursor: "pointer", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, shrink: 0, children: [_jsx(Plus, { size: 12, color: "$ink" }), _jsx(SizableText, { size: "$1", color: "$ink", children: "Add CAD / photo / swatch" })] })] }) }), _jsxs(YStack, { gap: "$2", pt: "$1", minW: 0, children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: "$2", children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "1. Lane (shapes the prompt)" }), _jsx(XStack, { render: _jsx("button", { type: "button" }), onClick: () => setShowAllLanes((v) => !v), px: "$2.5", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 28, height: 28 }, items: "center", rounded: 999, borderWidth: 1, borderColor: "var(--border-strong)", bg: "transparent", cursor: "pointer", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, children: _jsx(SizableText, { size: "$1", color: "$soft", children: showAllLanes ? 'Show fewer' : `All ${TRANSFORMATION_LANES.length} lanes` }) })] }), _jsx(XStack, { gap: "$2.5", flexWrap: "wrap", role: "list", "aria-label": "Transformation lanes", width: "100%", minW: 0, children: visibleLanes.map((lane) => {
1108
+ const active = lane.id === selectedLane.id;
1109
+ return (_jsx(YStack, { role: "listitem", width: "100%", $lg: { width: 'calc(50% - 5px)' }, minW: 0, children: _jsxs(YStack, { render: _jsx("button", { type: "button" }), onClick: () => setSelectedLaneId(lane.id), width: "100%", minW: 0, minH: 44, "$max-sm": { minH: 44 }, p: "$3", rounded: "$3", "aria-pressed": active, borderWidth: active ? 1.5 : 1, borderColor: active ? 'var(--foreground)' : 'var(--border-strong)', bg: active ? 'var(--surface-card)' : 'var(--background)', boxShadow: active ? 'var(--shadow-sheet-2)' : undefined, hoverStyle: { bg: active ? 'var(--surface-card)' : '$hover', borderColor: active ? 'var(--foreground)' : 'var(--border-strong)' }, focusVisibleStyle: RING, gap: "$1.5", items: "flex-start", cursor: "pointer", children: [_jsx(SizableText, { size: "$2", fontWeight: "600", color: "$ink", text: "left", children: lane.label }), _jsx(SizableText, { size: "$1", color: "$soft", text: "left", numberOfLines: 2, children: lane.description })] }) }, lane.id));
1110
+ }) })] })] }), _jsxs(YStack, { width: "100%", minW: 0, $lg: { width: 272, shrink: 0 }, $xl: { width: 280 }, gap: "$3", p: "$3.5", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsxs(YStack, { gap: 2, children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "2. Design system & brand kit" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Locks palette, typography, and studio lighting directives across images, video, and office docs." })] }), _jsx(YStack, { gap: "$2", minW: 0, children: BRAND_DESIGN_SYSTEMS.map((brand) => {
1111
+ const active = brand.id === selectedBrand.id;
1112
+ return (_jsxs(YStack, { render: _jsx("button", { type: "button" }), onClick: () => setSelectedBrandId(brand.id), width: "100%", minW: 0, minH: 44, "$max-sm": { minH: 44 }, p: "$2.5", rounded: "$3", "aria-pressed": active, borderWidth: active ? 1.5 : 1, borderColor: active ? 'var(--foreground)' : 'var(--border-strong)', bg: active ? 'var(--surface-card)' : 'var(--background)', boxShadow: active ? 'var(--shadow-sheet-2)' : undefined, hoverStyle: { bg: active ? 'var(--surface-card)' : '$hover', borderColor: active ? 'var(--foreground)' : 'var(--border-strong)' }, focusVisibleStyle: RING, gap: "$1", items: "flex-start", cursor: "pointer", children: [_jsxs(XStack, { justify: "space-between", items: "center", width: "100%", gap: "$2", children: [_jsx(SizableText, { size: "$2", fontWeight: "600", color: "$ink", text: "left", children: brand.name }), _jsx(XStack, { gap: "$1", shrink: 0, children: brand.palette.map((hex) => (_jsx(XStack, { width: 11, height: 11, rounded: 99, borderWidth: 1, borderColor: "var(--border-strong)", style: { backgroundColor: hex, border: '1px solid var(--border-strong)', boxShadow: 'inset 0 0 0 1px color-mix(in srgb, var(--foreground) 20%, transparent)' } }, hex))) })] }), _jsx(SizableText, { size: "$1", color: "$soft", text: "left", children: brand.tagline }), _jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", text: "left", children: brand.fonts })] }, brand.id));
1113
+ }) }), _jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: () => switchSection('library'), minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 34, height: 34 }, px: "$3", rounded: 999, borderWidth: 1, borderColor: "var(--border-strong)", bg: "transparent", items: "center", justify: "center", gap: "$1.5", cursor: "pointer", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, children: [_jsx(Library, { size: 13, color: "$ink" }), _jsx(SizableText, { size: "$1", fontWeight: "500", color: "$ink", children: "Open assets, stacks & QC" }), _jsx(ArrowRight, { size: 12, color: "$soft" })] })] })] })) : null, section === 'documents' ? (_jsxs(YStack, { gap: "$3", flex: 1, width: "100%", minW: 0, $lg: { flexDirection: 'row', items: 'flex-start' }, children: [_jsxs(YStack, { width: "100%", minW: 0, $lg: { flex: 1 }, gap: "$3", p: "$3.5", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2", children: [_jsxs(YStack, { gap: 2, flex: 1, minW: 200, children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "Brand-conditioned documents, line sheets, pitch decks & frames" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Generate production PDF/DOCX tech packs, XLSX wholesale matrices, PPTX lookbooks, and 60fps HTML/MP4 frames (/v1/documents/generate)." })] }), _jsx(XStack, { gap: "$1.5", flexWrap: "wrap", children: ['All', 'Documents', 'Spreadsheets', 'Presentations', 'Frames'].map((cat) => {
1114
+ const on = docCategoryFilter === cat;
1115
+ return (_jsx(XStack, { render: _jsx("button", { type: "button" }), "aria-pressed": on, onClick: () => setDocCategoryFilter(cat), px: "$2.5", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 28, height: 28 }, items: "center", rounded: 999, borderWidth: 1, borderColor: on ? '$ink' : 'var(--border-strong)', bg: on ? 'var(--surface-card-emphasis)' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", children: _jsx(SizableText, { size: "$1", fontWeight: on ? '600' : '500', color: on ? '$ink' : '$soft', children: cat }) }, cat));
1116
+ }) })] }), _jsx(XStack, { gap: "$2.5", flexWrap: "wrap", role: "list", "aria-label": "Document templates", width: "100%", minW: 0, children: visibleDocs.map((tpl) => {
1096
1117
  const active = tpl.id === selectedDocTemplate.id;
1097
- return (_jsxs(YStack, { render: "button", onPress: () => {
1098
- setSelectedDocTemplateId(tpl.id);
1099
- setDocBrief(tpl.defaultBrief);
1100
- }, width: "calc(50% - 6px)", minW: 250, grow: 1, p: "$3", rounded: "$3", borderWidth: active ? 2 : 1, borderColor: active ? '$ink' : '$borderColor', bg: active ? '$hover' : 'rgba(255,255,255,0.02)', gap: "$1.5", cursor: "pointer", style: { textAlign: 'left' }, children: [_jsxs(XStack, { justify: "space-between", items: "center", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: tpl.category.toUpperCase() }), _jsx(SizableText, { size: "$1", color: "$green10", style: { fontFamily: 'ui-monospace, monospace' }, children: tpl.format })] }), _jsx(SizableText, { size: "$2", fontWeight: "600", children: tpl.title }), _jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 2, children: tpl.description })] }, tpl.id));
1101
- }) })] }), _jsxs(YStack, { width: 340, grow: 1, maxW: 390, gap: "$3", p: "$3.5", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "var(--pane-fill, var(--sheet-1))", children: [_jsx(SizableText, { size: "$2", fontWeight: "600", children: selectedDocTemplate.title }), _jsx(SizableText, { size: "$1", color: "$soft", children: `Format: ${selectedDocTemplate.format} · Design System: ${selectedBrand.name} · Endpoint: ${selectedDocTemplate.endpoint}` }), _jsxs(YStack, { gap: "$1", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Document / Deck / Frame Brief" }), _jsx("textarea", { "aria-label": "Document brief", value: docBrief, onChange: (e) => setDocBrief(e.currentTarget.value), rows: 4, style: {
1102
- width: '100%',
1103
- borderRadius: 10,
1104
- padding: '10px 12px',
1105
- background: 'rgba(255,255,255,0.04)',
1106
- border: '1px solid rgba(255,255,255,0.14)',
1107
- color: 'inherit',
1108
- font: 'inherit',
1109
- } })] }), _jsxs(XStack, { render: "button", onPress: () => void generateOfficeDocument(selectedDocTemplate), height: 36, rounded: 999, bg: "$ink", items: "center", justify: "center", gap: "$2", cursor: "pointer", children: [_jsx(Sparkles, { size: 14 }), _jsx(SizableText, { size: "$2", color: "$background", fontWeight: "600", children: `Generate ${selectedDocTemplate.format}` })] })] })] })) : null, section === 'video' ? (_jsxs(_Fragment, { children: [_jsxs(XStack, { gap: "$3", flex: 1, minH: 440, flexWrap: "wrap", children: [_jsxs(YStack, { width: 310, grow: 1, maxW: 360, gap: "$3", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "var(--pane-fill, var(--sheet-1))", children: [_jsx(SizableText, { size: "$2", fontWeight: "600", children: "1. Cinema Camera Motion Rig" }), _jsx(XStack, { flexWrap: "wrap", gap: 6, role: "list", "aria-label": "Starters", children: CAMERA_MOVES.map((cam) => {
1118
+ return (_jsx(YStack, { role: "listitem", width: "100%", $md: { width: 'calc(50% - 5px)' }, minW: 0, children: _jsxs(YStack, { render: _jsx("button", { type: "button" }), onClick: () => {
1119
+ setSelectedDocTemplateId(tpl.id);
1120
+ setDocBrief(tpl.defaultBrief);
1121
+ }, width: "100%", minW: 0, minH: 44, "$max-sm": { minH: 44 }, p: "$3", rounded: "$3", "aria-pressed": active, borderWidth: active ? 1.5 : 1, borderColor: active ? 'var(--foreground)' : 'var(--border-strong)', bg: active ? 'var(--surface-card)' : 'var(--background)', boxShadow: active ? 'var(--shadow-sheet-2)' : undefined, hoverStyle: { bg: active ? 'var(--surface-card)' : '$hover', borderColor: active ? 'var(--foreground)' : 'var(--border-strong)' }, focusVisibleStyle: RING, gap: "$1.5", items: "flex-start", cursor: "pointer", children: [_jsxs(XStack, { justify: "space-between", items: "center", width: "100%", gap: "$2", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: tpl.category }), _jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", children: tpl.format })] }), _jsx(SizableText, { size: "$2", fontWeight: "600", color: "$ink", text: "left", children: tpl.title }), _jsx(SizableText, { size: "$1", color: "$soft", text: "left", numberOfLines: 2, children: tpl.description })] }) }, tpl.id));
1122
+ }) }), filteredDocs.length > 4 ? (_jsx(XStack, { justify: "center", children: _jsx(XStack, { render: _jsx("button", { type: "button" }), onClick: () => setShowAllDocs((v) => !v), px: "$3", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 28, height: 28 }, items: "center", rounded: 999, borderWidth: 1, borderColor: "var(--border-strong)", bg: "transparent", cursor: "pointer", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, children: _jsx(SizableText, { size: "$1", color: "$soft", children: showAllDocs ? 'Show fewer templates' : `Show all ${filteredDocs.length} templates` }) }) })) : null] }), _jsxs(YStack, { width: "100%", minW: 0, $lg: { width: 276, shrink: 0 }, $xl: { width: 280 }, gap: "$3", p: "$3.5", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: selectedDocTemplate.title }), _jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", children: `${selectedDocTemplate.format} · ${selectedBrand.name} · ${selectedDocTemplate.endpoint}` }), _jsxs(YStack, { gap: "$1.5", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Document, deck, or frame brief" }), _jsx(StudioTextarea, { "aria-label": "Document brief", style: { resize: 'none' }, ...{ value: docBrief, rows: 4 }, onChange: (e) => setDocBrief(e.currentTarget.value) })] }), _jsxs(XStack, { render: _jsx("button", { type: "button" }), disabled: generatingDoc, onClick: () => void generateOfficeDocument(selectedDocTemplate), minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 34, height: 34 }, rounded: 999, bg: "$ink", items: "center", justify: "center", gap: "$1.5", opacity: generatingDoc ? 0.65 : 1, cursor: generatingDoc ? 'default' : 'pointer', hoverStyle: generatingDoc ? undefined : { opacity: 0.9 }, focusVisibleStyle: RING, children: [_jsx(Sparkles, { size: 14, color: "$background" }), _jsx(SizableText, { size: "$2", color: "$background", fontWeight: "600", children: generatingDoc ? 'Generating…' : `Generate ${selectedDocTemplate.format}` })] })] })] })) : null, section === 'video' ? (_jsxs(_Fragment, { children: [_jsxs(YStack, { gap: "$3", flex: 1, width: "100%", minW: 0, $xl: { flexDirection: 'row', items: 'flex-start' }, children: [_jsxs(YStack, { width: "100%", minW: 0, $xl: { width: 276, shrink: 0 }, $xxl: { width: 288 }, gap: "$3", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: "$2", children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "1. Cinema camera motion rig" }), _jsx(XStack, { render: _jsx("button", { type: "button" }), onClick: () => setShowAllCameras((v) => !v), px: "$2", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 26, height: 26 }, items: "center", rounded: 999, borderWidth: 1, borderColor: "var(--border-strong)", bg: "transparent", cursor: "pointer", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, children: _jsx(SizableText, { size: "$1", color: "$soft", children: showAllCameras ? 'Fewer' : `All ${CAMERA_MOVES.length}` }) })] }), _jsx(XStack, { flexWrap: "wrap", gap: "$1.5", role: "list", "aria-label": "Camera motion rigs", width: "100%", children: visibleCameras.map((cam) => {
1110
1123
  const active = cam.id === activeShot.cameraId;
1111
- return (_jsxs(YStack, { render: "button", onPress: () => updateShot({ cameraId: cam.id }), width: "calc(50% - 3px)", p: "$2", rounded: "$3", borderWidth: 1, borderColor: active ? '$ink' : '$borderColor', bg: active ? '$hover' : 'transparent', cursor: "pointer", gap: 2, style: { textAlign: 'left' }, children: [_jsxs(XStack, { justify: "space-between", items: "center", children: [_jsx(SizableText, { size: "$1", fontWeight: "600", numberOfLines: 1, children: cam.name }), _jsx(SizableText, { size: "$1", color: "$soft", children: cam.code })] }), _jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 2, children: cam.description })] }, cam.id));
1112
- }) }), _jsx(SizableText, { size: "$2", fontWeight: "600", pt: "$1", children: "2. Cinema Lens & Anamorphic Gate" }), _jsx(YStack, { gap: 6, children: LENSES.map((lens) => {
1124
+ return (_jsx(YStack, { role: "listitem", width: "100%", $xs: { width: 'calc(50% - 3px)' }, minW: 0, children: _jsxs(YStack, { render: _jsx("button", { type: "button" }), onClick: () => updateShot({ cameraId: cam.id }), width: "100%", minW: 0, minH: 44, "$max-sm": { minH: 44 }, p: "$2", rounded: "$3", "aria-pressed": active, borderWidth: active ? 1.5 : 1, borderColor: active ? 'var(--foreground)' : 'var(--border-strong)', bg: active ? 'var(--surface-card)' : 'var(--background)', boxShadow: active ? 'var(--shadow-sheet-2)' : undefined, hoverStyle: { bg: active ? 'var(--surface-card)' : '$hover', borderColor: active ? 'var(--foreground)' : 'var(--border-strong)' }, focusVisibleStyle: RING, cursor: "pointer", gap: 2, items: "flex-start", children: [_jsx(SizableText, { size: "$2", fontWeight: "600", color: "$ink", text: "left", numberOfLines: 1, children: cam.name }), _jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", text: "left", children: cam.code }), _jsx(SizableText, { size: "$1", color: "$soft", text: "left", numberOfLines: 2, children: cam.description })] }) }, cam.id));
1125
+ }) }), _jsxs(XStack, { items: "center", justify: "space-between", gap: "$2", pt: "$1", children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "2. Cinema lens & gate" }), _jsx(XStack, { render: _jsx("button", { type: "button" }), onClick: () => setShowAllLenses((v) => !v), px: "$2", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 26, height: 26 }, items: "center", rounded: 999, borderWidth: 1, borderColor: "var(--border-strong)", bg: "transparent", cursor: "pointer", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, children: _jsx(SizableText, { size: "$1", color: "$soft", children: showAllLenses ? 'Fewer' : `All ${LENSES.length}` }) })] }), _jsx(YStack, { gap: "$1.5", children: visibleLenses.map((lens) => {
1113
1126
  const on = lens.id === activeShot.lensId;
1114
- return (_jsxs(XStack, { render: "button", onPress: () => updateShot({ lensId: lens.id }), px: "$2.5", py: "$1.5", rounded: "$3", borderWidth: 1, borderColor: on ? '$ink' : '$borderColor', bg: on ? '$hover' : 'transparent', justify: "space-between", items: "center", cursor: "pointer", children: [_jsx(SizableText, { size: "$1", fontWeight: on ? '600' : '400', children: lens.label }), _jsx(SizableText, { size: "$1", color: "$soft", children: lens.aspect })] }, lens.id));
1115
- }) }), _jsx(SizableText, { size: "$2", fontWeight: "600", pt: "$1", children: "3. T-Stop Aperture & Lighting Rig" }), _jsx(XStack, { gap: 6, flexWrap: "wrap", children: APERTURES.map((ap) => (_jsx(XStack, { render: "button", onPress: () => updateShot({ aperture: ap }), px: "$2.5", height: 26, items: "center", rounded: 999, borderWidth: 1, borderColor: activeShot.aperture === ap ? '$ink' : '$borderColor', bg: activeShot.aperture === ap ? '$ink' : 'transparent', cursor: "pointer", children: _jsx(SizableText, { size: "$1", color: activeShot.aperture === ap ? '$background' : '$ink', children: ap }) }, ap))) }), _jsx(YStack, { gap: 6, children: LIGHTING_RIGS.map((rig) => {
1127
+ return (_jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: () => updateShot({ lensId: lens.id }), px: "$2.5", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 32 }, py: "$1.5", rounded: "$3", "aria-pressed": on, borderWidth: on ? 1.5 : 1, borderColor: on ? 'var(--foreground)' : 'var(--border-strong)', bg: on ? 'var(--surface-card)' : 'var(--background)', boxShadow: on ? 'var(--shadow-sheet-2)' : undefined, hoverStyle: { bg: on ? 'var(--surface-card)' : '$hover', borderColor: on ? 'var(--foreground)' : 'var(--border-strong)' }, focusVisibleStyle: RING, justify: "space-between", items: "center", gap: "$2", cursor: "pointer", children: [_jsx(SizableText, { size: "$2", fontWeight: on ? '600' : '500', color: "$ink", numberOfLines: 1, children: lens.label }), _jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", shrink: 0, children: lens.aspect })] }, lens.id));
1128
+ }) }), _jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", pt: "$1", children: "3. T-stop aperture & lighting rig" }), _jsx(XStack, { gap: "$1.5", flexWrap: "wrap", children: APERTURES.map((ap) => {
1129
+ const on = activeShot.aperture === ap;
1130
+ return (_jsx(XStack, { render: _jsx("button", { type: "button" }), "aria-pressed": on, onClick: () => updateShot({ aperture: ap }), px: "$2.5", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 26, height: 26 }, items: "center", rounded: 999, borderWidth: 1, borderColor: on ? '$ink' : 'var(--border-strong)', bg: on ? 'var(--surface-card-emphasis)' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", children: _jsx(SizableText, { size: "$1", fontFamily: "$mono", fontWeight: on ? '600' : '500', color: on ? '$ink' : '$soft', children: ap }) }, ap));
1131
+ }) }), _jsx(YStack, { gap: "$1.5", children: LIGHTING_RIGS.map((rig) => {
1116
1132
  const on = rig.id === activeShot.lightingId;
1117
- return (_jsxs(XStack, { render: "button", onPress: () => updateShot({ lightingId: rig.id }), px: "$2.5", py: "$1.5", rounded: "$3", borderWidth: 1, borderColor: on ? '$ink' : '$borderColor', bg: on ? '$hover' : 'transparent', items: "center", gap: "$2", cursor: "pointer", children: [_jsx(XStack, { gap: 3, children: rig.colors.map((hex) => (_jsx("span", { style: { width: 10, height: 10, borderRadius: 99, background: hex, display: 'inline-block' } }, hex))) }), _jsx(SizableText, { size: "$1", numberOfLines: 1, children: rig.label })] }, rig.id));
1118
- }) })] }), _jsxs(YStack, { flex: 2, minW: 360, gap: "$3", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "var(--pane-fill, var(--sheet-1))", children: [_jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2", children: [_jsxs(YStack, { children: [_jsx(SizableText, { size: "$3", fontWeight: "600", children: `Shot ${activeShot.number}: ${activeShot.title}` }), _jsx(SizableText, { size: "$1", color: "$soft", children: `${activeCamera.name} · ${activeLens.label} · ${activeShot.aperture} · Cast: ${activeCharacter.name}` })] }), _jsxs(XStack, { gap: "$2", items: "center", flexWrap: "wrap", children: [_jsxs(XStack, { render: "button", onPress: () => setSequenceMode((m) => !m), items: "center", gap: "$1.5", px: "$3", height: 32, rounded: 999, borderWidth: 1, borderColor: "$borderColor", bg: sequenceMode ? '$ink' : 'transparent', cursor: "pointer", children: [_jsx(Film, { size: 13 }), _jsx(SizableText, { size: "$1", color: sequenceMode ? '$background' : '$ink', children: sequenceMode ? 'Chain Shots: ON' : 'Chain All Shots' })] }), _jsxs(XStack, { render: "button", onPress: () => setPlaying((p) => !p), px: "$3", height: 32, items: "center", gap: "$1.5", rounded: 999, borderWidth: 1, borderColor: "$borderColor", cursor: "pointer", children: [_jsx(Play, { size: 13 }), _jsx(SizableText, { size: "$1", children: playing ? 'Pause Monitor' : 'Play Monitor' })] }), _jsxs(XStack, { render: "button", onPress: () => void renderShotOnCloud(activeShot), px: "$3.5", height: 32, items: "center", gap: "$1.5", rounded: 999, bg: "$ink", cursor: "pointer", children: [_jsx(Sparkles, { size: 13 }), _jsx(SizableText, { size: "$1", color: "$background", fontWeight: "600", children: renderingId === activeShot.id ? 'Rendering Shot…' : 'Render Shot (Wan 2.2 / Koma)' })] })] })] }), _jsx(YStack, { rounded: "$4", overflow: "hidden", borderWidth: 1, borderColor: "$borderColor", bg: "#000", items: "center", justify: "center", children: _jsx("canvas", { ref: canvasRef, width: 860, height: 420, style: { width: '100%', height: 'auto', display: 'block' } }) }), _jsxs(YStack, { gap: "$2", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Scene Action & Blocking Prompt" }), _jsx("textarea", { "aria-label": "Scene action and blocking prompt", value: activeShot.prompt, onChange: (e) => updateShot({ prompt: e.currentTarget.value }), rows: 2, style: {
1119
- width: '100%',
1120
- borderRadius: 10,
1121
- padding: '10px 12px',
1122
- background: 'rgba(255,255,255,0.04)',
1123
- border: '1px solid rgba(255,255,255,0.12)',
1124
- color: 'inherit',
1125
- font: 'inherit',
1126
- resize: 'vertical',
1127
- } }), _jsxs(XStack, { gap: "$2", flexWrap: "wrap", children: [_jsxs(YStack, { flex: 1, minW: 220, gap: "$1", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Lip-Sync Dialogue Line (Koe Performance)" }), _jsx("input", { "aria-label": "Lip-sync dialogue line", value: activeShot.dialogue, onChange: (e) => updateShot({ dialogue: e.currentTarget.value }), placeholder: "Spoken line for lip-sync & voice stem\u2026", style: {
1128
- width: '100%',
1129
- height: 34,
1130
- borderRadius: 8,
1131
- padding: '0 10px',
1132
- background: 'rgba(255,255,255,0.04)',
1133
- border: '1px solid rgba(255,255,255,0.12)',
1134
- color: 'inherit',
1135
- font: 'inherit',
1136
- } })] }), _jsxs(YStack, { width: 130, gap: "$1", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Shot Duration (s)" }), _jsx("input", { "aria-label": "Shot duration in seconds", type: "number", min: 1, max: 15, step: 0.5, value: activeShot.durationSec, onChange: (e) => updateShot({ durationSec: Math.max(1, Number(e.currentTarget.value) || 4) }), style: {
1137
- width: '100%',
1138
- height: 34,
1139
- borderRadius: 8,
1140
- padding: '0 10px',
1141
- background: 'rgba(255,255,255,0.04)',
1142
- border: '1px solid rgba(255,255,255,0.12)',
1143
- color: 'inherit',
1144
- font: 'inherit',
1145
- } })] })] })] })] }), _jsxs(YStack, { width: 290, grow: 1, maxW: 340, gap: "$3", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "var(--pane-fill, var(--sheet-1))", children: [_jsx(SizableText, { size: "$2", fontWeight: "600", children: "4. Character & World Continuity Lock" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Lock face geometry, wardrobe, and voice identity across every shot in the sequence." }), _jsx(YStack, { gap: "$2", children: characters.map((char) => {
1133
+ return (_jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: () => updateShot({ lightingId: rig.id }), px: "$2.5", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 32 }, py: "$1.5", rounded: "$3", "aria-pressed": on, borderWidth: on ? 1.5 : 1, borderColor: on ? 'var(--foreground)' : 'var(--border-strong)', bg: on ? 'var(--surface-card)' : 'var(--background)', boxShadow: on ? 'var(--shadow-sheet-2)' : undefined, hoverStyle: { bg: on ? 'var(--surface-card)' : '$hover', borderColor: on ? 'var(--foreground)' : 'var(--border-strong)' }, focusVisibleStyle: RING, items: "center", gap: "$2", cursor: "pointer", children: [_jsx(XStack, { gap: 3, shrink: 0, children: rig.colors.map((hex) => (_jsx(XStack, { width: 10, height: 10, rounded: 99, style: { backgroundColor: hex, border: '1px solid var(--border-strong)', boxShadow: 'inset 0 0 0 1px color-mix(in srgb, var(--foreground) 20%, transparent)' }, borderWidth: 1, borderColor: "var(--border-strong)" }, hex))) }), _jsx(SizableText, { size: "$2", fontWeight: on ? '600' : '500', color: "$ink", numberOfLines: 1, children: rig.label })] }, rig.id));
1134
+ }) })] }), _jsxs(YStack, { width: "100%", minW: 0, $xl: { flex: 1 }, gap: "$3", p: "$3.5", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsxs(YStack, { gap: "$2", minW: 0, children: [_jsxs(YStack, { gap: 2, minW: 0, children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: `Shot ${activeShot.number}: ${activeShot.title}` }), _jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", children: `${activeCamera.name} · ${activeLens.label} · ${activeShot.aperture} · Cast: ${activeCharacter.name}` })] }), _jsxs(XStack, { gap: "$1.5", items: "center", flexWrap: "wrap", width: "100%", children: [_jsxs(XStack, { render: _jsx("button", { type: "button" }), "aria-pressed": sequenceMode, onClick: () => setSequenceMode((m) => !m), items: "center", gap: "$1.5", px: "$3", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 32, height: 32 }, rounded: 999, borderWidth: 1, borderColor: sequenceMode ? '$ink' : 'var(--border-strong)', bg: sequenceMode ? 'var(--surface-card-emphasis)' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", shrink: 0, children: [_jsx(Film, { size: 13, color: "$ink" }), _jsx(SizableText, { size: "$1", fontWeight: sequenceMode ? '600' : '500', color: "$ink", children: sequenceMode ? 'Chain shots: on' : 'Chain all shots' })] }), _jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: () => setPlaying((p) => !p), px: "$3", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 32, height: 32 }, items: "center", gap: "$1.5", rounded: 999, borderWidth: 1, borderColor: "var(--border-strong)", bg: "transparent", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", shrink: 0, children: [_jsx(Play, { size: 13, color: "$ink" }), _jsx(SizableText, { size: "$1", color: "$ink", children: playing ? 'Pause monitor' : 'Play monitor' })] }), _jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: () => void renderShotOnCloud(activeShot), px: "$4", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 32, height: 32 }, items: "center", gap: "$1.5", rounded: 999, bg: "$ink", hoverStyle: { opacity: 0.9 }, focusVisibleStyle: RING, cursor: "pointer", shrink: 0, children: [_jsx(Sparkles, { size: 13, color: "$background" }), _jsx(SizableText, { size: "$2", color: "$background", fontWeight: "600", children: renderingId === activeShot.id ? 'Rendering shot…' : 'Render shot (Wan 2.2)' })] })] })] }), _jsx(YStack, { rounded: "$4", overflow: "hidden", borderWidth: 1, borderColor: "var(--border-strong)", bg: "var(--surface-card)", items: "center", justify: "center", children: _jsx("canvas", { ref: canvasRef, width: 860, height: 420, style: { width: '100%', height: 'auto', display: 'block' } }) }), _jsxs(YStack, { gap: "$2", minW: 0, children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Scene action & blocking prompt" }), _jsx(StudioTextarea, { "aria-label": "Scene action and blocking prompt", style: { resize: 'none' }, ...{ value: activeShot.prompt, rows: 2 }, onChange: (e) => updateShot({ prompt: e.currentTarget.value }) }), _jsxs(XStack, { gap: "$2", flexWrap: "wrap", minW: 0, children: [_jsxs(YStack, { flex: 1, minW: 180, gap: "$1", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Lip-sync dialogue line (Koe performance)" }), _jsx(StudioInput, { "aria-label": "Lip-sync dialogue line", ...{ value: activeShot.dialogue, placeholder: 'Spoken line for lip-sync & voice stem…' }, onChange: (e) => updateShot({ dialogue: e.currentTarget.value }) })] }), _jsxs(YStack, { width: 130, gap: "$1", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Shot duration (s)" }), _jsx(StudioInput, { "aria-label": "Shot duration in seconds", ...{ type: 'number', min: 1, max: 15, step: 0.5, value: String(activeShot.durationSec) }, onChange: (e) => updateShot({ durationSec: Math.max(1, Number(e.currentTarget.value) || 4) }) })] })] })] })] }), _jsxs(YStack, { width: "100%", minW: 0, $xl: { width: 268, shrink: 0 }, $xxl: { width: 280 }, gap: "$3", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "4. Character & world continuity lock" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Lock face geometry, wardrobe, and voice identity across every shot in the sequence." }), _jsx(YStack, { gap: "$2", children: characters.map((char) => {
1146
1135
  const locked = char.id === activeShot.characterId;
1147
- return (_jsxs(YStack, { render: "button", onPress: () => updateShot({ characterId: char.id }), p: "$2.5", rounded: "$3", borderWidth: 1, borderColor: locked ? '$ink' : '$borderColor', bg: locked ? '$hover' : 'transparent', gap: 4, cursor: "pointer", style: { textAlign: 'left' }, children: [_jsxs(XStack, { justify: "space-between", items: "center", children: [_jsx(SizableText, { size: "$2", fontWeight: "600", children: char.name }), _jsx(SizableText, { size: "$1", color: locked ? '$green10' : '$soft', children: locked ? `● LOCKED #${char.seed}` : `#${char.seed}` })] }), _jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 2, children: char.wardrobe }), _jsx(SizableText, { size: "$1", color: "$soft", children: char.voice })] }, char.id));
1148
- }) }), _jsxs(YStack, { gap: "$2", pt: "$2", borderTopWidth: 1, borderColor: "$borderColor", children: [_jsx(SizableText, { size: "$1", fontWeight: "600", children: "Lock New Character / Actor ID" }), _jsx("input", { "aria-label": "New character name", placeholder: "Character name (e.g. Mira Solis)", value: newCharName, onChange: (e) => setNewCharName(e.currentTarget.value), style: {
1149
- width: '100%',
1150
- height: 32,
1151
- borderRadius: 8,
1152
- padding: '0 10px',
1153
- background: 'rgba(255,255,255,0.04)',
1154
- border: '1px solid rgba(255,255,255,0.12)',
1155
- color: 'inherit',
1156
- font: 'inherit',
1157
- } }), _jsx("input", { "aria-label": "New character wardrobe and look", placeholder: "Wardrobe, face & look traits\u2026", value: newCharWardrobe, onChange: (e) => setNewCharWardrobe(e.currentTarget.value), style: {
1158
- width: '100%',
1159
- height: 32,
1160
- borderRadius: 8,
1161
- padding: '0 10px',
1162
- background: 'rgba(255,255,255,0.04)',
1163
- border: '1px solid rgba(255,255,255,0.12)',
1164
- color: 'inherit',
1165
- font: 'inherit',
1166
- } }), _jsxs(XStack, { render: "button", onPress: addCharacter, items: "center", justify: "center", gap: "$1.5", height: 32, rounded: "$3", borderWidth: 1, borderColor: "$borderColor", cursor: "pointer", hoverStyle: { bg: '$hover' }, children: [_jsx(Plus, { size: 13 }), _jsx(SizableText, { size: "$1", fontWeight: "600", children: "Add & Lock Character ID" })] })] })] })] }), _jsxs(YStack, { gap: "$2.5", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "var(--pane-fill, var(--sheet-1))", children: [_jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2", children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Video, { size: 15 }), _jsx(SizableText, { size: "$2", fontWeight: "600", children: "Multi-Shot Storyboard & NLE Timeline (Frame-Chained ConcatVideo)" }), _jsx(SizableText, { size: "$1", color: "$soft", children: `${shots.length} shots · ${shots.reduce((acc, s) => acc + s.durationSec, 0).toFixed(1)}s master cut` })] }), _jsxs(XStack, { render: "button", onPress: addShot, items: "center", gap: "$1.5", px: "$3", height: 28, rounded: 999, borderWidth: 1, borderColor: "$borderColor", cursor: "pointer", hoverStyle: { bg: '$hover' }, children: [_jsx(Plus, { size: 13 }), _jsx(SizableText, { size: "$1", fontWeight: "600", children: "Append Shot to Timeline" })] })] }), _jsx(XStack, { gap: "$2.5", overflowX: "auto", pb: "$1", children: shots.map((s) => {
1136
+ return (_jsxs(YStack, { render: _jsx("button", { type: "button" }), onClick: () => updateShot({ characterId: char.id }), width: "100%", minW: 0, minH: 44, "$max-sm": { minH: 44 }, p: "$2.5", rounded: "$3", "aria-pressed": locked, borderWidth: locked ? 1.5 : 1, borderColor: locked ? 'var(--foreground)' : 'var(--border-strong)', bg: locked ? 'var(--surface-card)' : 'var(--background)', boxShadow: locked ? 'var(--shadow-sheet-2)' : undefined, hoverStyle: { bg: locked ? 'var(--surface-card)' : '$hover', borderColor: locked ? 'var(--foreground)' : 'var(--border-strong)' }, focusVisibleStyle: RING, gap: "$1", items: "flex-start", cursor: "pointer", children: [_jsxs(XStack, { justify: "space-between", items: "center", width: "100%", gap: "$2", children: [_jsx(SizableText, { size: "$2", fontWeight: "600", color: "$ink", text: "left", children: char.name }), _jsxs(XStack, { items: "center", gap: "$1", shrink: 0, children: [locked ? _jsx(XStack, { width: 6, height: 6, rounded: 99, bg: "var(--state-success)" }) : null, _jsx(SizableText, { size: "$1", fontFamily: "$mono", color: locked ? 'var(--state-success)' : '$soft', children: locked ? `Locked #${char.seed}` : `#${char.seed}` })] })] }), _jsx(SizableText, { size: "$1", color: "$soft", text: "left", numberOfLines: 2, children: char.wardrobe }), _jsx(SizableText, { size: "$1", color: "$soft", text: "left", children: char.voice })] }, char.id));
1137
+ }) }), _jsxs(YStack, { gap: "$2", pt: "$2", borderTopWidth: 1, borderColor: "var(--border)", children: [_jsx(SizableText, { size: "$2", fontWeight: "600", color: "$ink", children: "Lock new character / actor ID" }), _jsx(StudioInput, { "aria-label": "New character name", ...{ placeholder: 'Character name (e.g. Mira Solis)', value: newCharName }, onChange: (e) => setNewCharName(e.currentTarget.value) }), _jsx(StudioInput, { "aria-label": "New character wardrobe and look", ...{ placeholder: 'Wardrobe, face & look traits…', value: newCharWardrobe }, onChange: (e) => setNewCharWardrobe(e.currentTarget.value) }), _jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: addCharacter, items: "center", justify: "center", gap: "$1.5", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 32, height: 32 }, rounded: "$3", borderWidth: 1, borderColor: "var(--border-strong)", bg: "transparent", cursor: "pointer", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, children: [_jsx(Plus, { size: 13, color: "$ink" }), _jsx(SizableText, { size: "$1", fontWeight: "600", color: "$ink", children: "Add & lock character ID" })] })] })] })] }), _jsxs(YStack, { gap: "$2.5", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", minW: 0, children: [_jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2", children: [_jsxs(XStack, { items: "center", gap: "$2", flexWrap: "wrap", children: [_jsx(Video, { size: 15, color: "$ink" }), _jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "Multi-shot storyboard & NLE timeline" }), _jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", children: `${shots.length} shots · ${shots.reduce((acc, s) => acc + s.durationSec, 0).toFixed(1)}s master cut` })] }), _jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: addShot, items: "center", gap: "$1.5", px: "$3", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 28, height: 28 }, rounded: 999, borderWidth: 1, borderColor: "var(--border-strong)", bg: "transparent", cursor: "pointer", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, children: [_jsx(Plus, { size: 13, color: "$ink" }), _jsx(SizableText, { size: "$1", fontWeight: "600", color: "$ink", children: "Append shot to timeline" })] })] }), _jsx(XStack, { gap: "$2.5", overflowX: "auto", pb: "$1", width: "100%", children: shots.map((s) => {
1167
1138
  const cam = CAMERA_MOVES.find((c) => c.id === s.cameraId) ?? CAMERA_MOVES[0];
1168
1139
  const char = characters.find((c) => c.id === s.characterId) ?? characters[0];
1169
1140
  const selected = s.id === activeShot.id;
1170
- return (_jsxs(YStack, { render: "button", onPress: () => setActiveShotId(s.id), width: 250, shrink: 0, p: "$2.5", rounded: "$3", borderWidth: selected ? 2 : 1, borderColor: selected ? '$ink' : '$borderColor', bg: selected ? '$hover' : 'transparent', gap: 4, cursor: "pointer", style: { textAlign: 'left' }, children: [_jsxs(XStack, { justify: "space-between", items: "center", children: [_jsx(SizableText, { size: "$1", fontWeight: "600", children: `SHOT ${String(s.number).padStart(2, '0')} · ${cam.code}` }), _jsx(SizableText, { size: "$1", color: s.status === 'done' ? '$green10' : '$soft', children: `${s.durationSec.toFixed(1)}s · ${s.status.toUpperCase()}` })] }), _jsx(SizableText, { size: "$2", fontWeight: "600", numberOfLines: 1, children: s.title }), _jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 2, children: s.prompt }), _jsxs(XStack, { items: "center", justify: "space-between", pt: 4, children: [_jsx(SizableText, { size: "$1", color: "$soft", children: char.name }), _jsxs(XStack, { items: "center", gap: 4, children: [_jsx(Music, { size: 11 }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Oto + Uta Stems" })] })] })] }, s.id));
1171
- }) })] })] })) : null, section === 'music' ? (_jsxs(XStack, { gap: "$3", flex: 1, minH: 480, flexWrap: "wrap", children: [_jsxs(YStack, { width: 330, grow: 1, maxW: 380, gap: "$3", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "var(--pane-fill, var(--sheet-1))", children: [_jsx(SizableText, { size: "$2", fontWeight: "600", children: "ACE-Step 3.5B Song & Stem Synthesis" }), _jsxs(YStack, { gap: "$1.5", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Musical Style, Instruments & Production Tags" }), _jsx("textarea", { "aria-label": "Music style and production prompt", value: musicPrompt, onChange: (e) => setMusicPrompt(e.currentTarget.value), rows: 3, style: {
1172
- width: '100%',
1173
- borderRadius: 8,
1174
- padding: '8px 10px',
1175
- background: 'rgba(255,255,255,0.04)',
1176
- border: '1px solid rgba(255,255,255,0.12)',
1177
- color: 'inherit',
1178
- font: 'inherit',
1179
- } })] }), _jsxs(XStack, { gap: "$2", children: [_jsxs(YStack, { flex: 1, gap: "$1", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Tempo (BPM)" }), _jsx("input", { "aria-label": "Music BPM", type: "number", min: 60, max: 200, value: musicBpm, onChange: (e) => setMusicBpm(Number(e.currentTarget.value) || 120), style: {
1180
- width: '100%',
1181
- height: 32,
1182
- borderRadius: 8,
1183
- padding: '0 10px',
1184
- background: 'rgba(255,255,255,0.04)',
1185
- border: '1px solid rgba(255,255,255,0.12)',
1186
- color: 'inherit',
1187
- font: 'inherit',
1188
- } })] }), _jsxs(YStack, { flex: 1, gap: "$1", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Key Signature" }), _jsx("input", { "aria-label": "Key signature", value: musicKey, onChange: (e) => setMusicKey(e.currentTarget.value), style: {
1189
- width: '100%',
1190
- height: 32,
1191
- borderRadius: 8,
1192
- padding: '0 10px',
1193
- background: 'rgba(255,255,255,0.04)',
1194
- border: '1px solid rgba(255,255,255,0.12)',
1195
- color: 'inherit',
1196
- font: 'inherit',
1197
- } })] })] }), _jsxs(YStack, { gap: "$1.5", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Lyrics & Song Structure ([Verse], [Chorus], [Bridge])" }), _jsx("textarea", { "aria-label": "Song lyrics and structure", value: musicLyrics, onChange: (e) => setMusicLyrics(e.currentTarget.value), rows: 4, style: {
1198
- width: '100%',
1199
- borderRadius: 8,
1200
- padding: '8px 10px',
1201
- background: 'rgba(255,255,255,0.04)',
1202
- border: '1px solid rgba(255,255,255,0.12)',
1203
- color: 'inherit',
1204
- font: 'inherit',
1205
- } })] }), _jsxs(XStack, { render: "button", onPress: () => {
1141
+ return (_jsxs(YStack, { render: _jsx("button", { type: "button" }), onClick: () => setActiveShotId(s.id), width: 248, shrink: 0, p: "$2.5", rounded: "$3", "aria-pressed": selected, borderWidth: selected ? 1.5 : 1, borderColor: selected ? 'var(--foreground)' : 'var(--border-strong)', bg: selected ? 'var(--surface-card)' : 'var(--background)', boxShadow: selected ? 'var(--shadow-sheet-2)' : undefined, hoverStyle: { bg: selected ? 'var(--surface-card)' : '$hover', borderColor: selected ? 'var(--foreground)' : 'var(--border-strong)' }, focusVisibleStyle: RING, gap: "$1", items: "flex-start", cursor: "pointer", children: [_jsxs(XStack, { justify: "space-between", items: "center", width: "100%", gap: "$2", children: [_jsx(SizableText, { size: "$1", fontWeight: "600", fontFamily: "$mono", color: "$ink", children: `Shot ${String(s.number).padStart(2, '0')} · ${cam.code}` }), _jsx(SizableText, { size: "$1", fontFamily: "$mono", color: s.status === 'done' ? 'var(--state-success)' : '$soft', children: `${s.durationSec.toFixed(1)}s · ${s.status}` })] }), _jsx(SizableText, { size: "$2", fontWeight: "600", color: "$ink", text: "left", numberOfLines: 1, children: s.title }), _jsx(SizableText, { size: "$1", color: "$soft", text: "left", numberOfLines: 2, children: s.prompt }), _jsxs(XStack, { items: "center", justify: "space-between", pt: "$1", width: "100%", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: char.name }), _jsxs(XStack, { items: "center", gap: "$1", children: [_jsx(Music, { size: 11, color: "$soft" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Oto + Uta stems" })] })] })] }, s.id));
1142
+ }) })] })] })) : null, section === 'music' ? (_jsxs(YStack, { gap: "$3", flex: 1, width: "100%", minW: 0, $xl: { flexDirection: 'row', items: 'flex-start' }, children: [_jsxs(YStack, { width: "100%", minW: 0, $xl: { width: 276, shrink: 0 }, $xxl: { width: 288 }, gap: "$3", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "ACE-Step 3.5B song & stem synthesis" }), _jsxs(YStack, { gap: "$1.5", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Musical style, instruments & production tags" }), _jsx(StudioTextarea, { "aria-label": "Music style and production prompt", style: { resize: 'none' }, ...{ value: musicPrompt, rows: 3 }, onChange: (e) => setMusicPrompt(e.currentTarget.value) })] }), _jsxs(XStack, { gap: "$2", children: [_jsxs(YStack, { flex: 1, minW: 0, gap: "$1", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Tempo (BPM)" }), _jsx(StudioInput, { "aria-label": "Music BPM", ...{ type: 'number', min: 60, max: 200, value: String(musicBpm) }, onChange: (e) => setMusicBpm(Number(e.currentTarget.value) || 120) })] }), _jsxs(YStack, { flex: 1, minW: 0, gap: "$1", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Key signature" }), _jsx(StudioInput, { "aria-label": "Key signature", ...{ value: musicKey }, onChange: (e) => setMusicKey(e.currentTarget.value) })] })] }), _jsxs(YStack, { gap: "$1.5", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Lyrics & song structure" }), _jsx(StudioTextarea, { "aria-label": "Song lyrics and structure", style: { resize: 'none' }, ...{ value: musicLyrics, rows: 4 }, onChange: (e) => setMusicLyrics(e.currentTarget.value) })] }), _jsxs(XStack, { render: "button", onPress: () => {
1206
1143
  setDawPlaying(true);
1207
1144
  setStatusNote(`Synthesizing ACE-Step 3.5B Master (${musicBpm} BPM · ${musicKey})…`);
1208
- }, height: 36, rounded: 999, bg: "$ink", items: "center", justify: "center", gap: "$1.5", cursor: "pointer", children: [_jsx(Sparkles, { size: 14 }), _jsx(SizableText, { size: "$2", color: "$background", fontWeight: "600", children: "Generate Song & Stems (ACE-Step)" })] })] }), _jsxs(YStack, { flex: 2, minW: 380, gap: "$3", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "var(--pane-fill, var(--sheet-1))", children: [_jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2", children: [_jsxs(YStack, { children: [_jsx(SizableText, { size: "$3", fontWeight: "600", children: "Multi-Stem DAW & Waveform Sequencer" }), _jsx(SizableText, { size: "$1", color: "$soft", children: `${musicBpm} BPM · ${musicKey} · 48kHz 24-bit Stems` })] }), _jsx(XStack, { gap: "$2", children: _jsxs(XStack, { render: "button", onPress: () => setDawPlaying((p) => !p), px: "$3.5", height: 32, rounded: 999, bg: dawPlaying ? '$ink' : 'transparent', borderWidth: 1, borderColor: "$borderColor", items: "center", gap: "$1.5", cursor: "pointer", children: [_jsx(Play, { size: 13 }), _jsx(SizableText, { size: "$1", color: dawPlaying ? '$background' : '$ink', fontWeight: "600", children: dawPlaying ? 'Stop Synth Engine' : 'Play Live Stems' })] }) })] }), _jsx(YStack, { rounded: "$4", overflow: "hidden", borderWidth: 1, borderColor: "$borderColor", bg: "#07080d", children: _jsx("canvas", { ref: audioWaveCanvasRef, width: 780, height: 220, style: { width: '100%', height: 'auto', display: 'block' } }) }), _jsx(YStack, { gap: "$2", role: "list", "aria-label": "Starters", children: stems.map((stem) => (_jsxs(XStack, { items: "center", justify: "space-between", gap: "$3", p: "$2.5", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", bg: "rgba(255,255,255,0.02)", children: [_jsxs(XStack, { items: "center", gap: "$2", width: 190, children: [_jsx("span", { style: { width: 10, height: 10, borderRadius: 99, background: stem.color, display: 'inline-block' } }), _jsxs(YStack, { children: [_jsx(SizableText, { size: "$1", fontWeight: "600", children: stem.name }), _jsx(SizableText, { size: "$1", color: "$soft", children: stem.role })] })] }), _jsx("input", { "aria-label": `${stem.name} volume`, type: "range", min: 0, max: 100, value: stem.volume, onChange: (e) => {
1145
+ }, height: 36, rounded: 999, bg: "$ink", items: "center", justify: "center", gap: "$1.5", cursor: "pointer", children: [_jsx(Sparkles, { size: 14 }), _jsx(SizableText, { size: "$2", color: "$background", fontWeight: "600", children: "Generate Song & Stems (ACE-Step)" })] })] }), _jsxs(YStack, { width: "100%", minW: 0, $xl: { flex: 1 }, gap: "$3", p: "$3.5", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2", children: [_jsxs(YStack, { gap: 2, minW: 0, children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "Multi-stem DAW & waveform sequencer" }), _jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", children: `${musicBpm} BPM · ${musicKey} · 48kHz 24-bit stems` })] }), _jsx(XStack, { gap: "$2", children: _jsxs(XStack, { render: _jsx("button", { type: "button" }), "aria-pressed": dawPlaying, onClick: () => setDawPlaying((p) => !p), px: "$3.5", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 32, height: 32 }, rounded: 999, bg: dawPlaying ? 'var(--surface-card-emphasis)' : 'transparent', borderWidth: 1, borderColor: dawPlaying ? '$ink' : 'var(--border-strong)', hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, items: "center", gap: "$1.5", cursor: "pointer", children: [_jsx(Play, { size: 13, color: "$ink" }), _jsx(SizableText, { size: "$1", color: "$ink", fontWeight: "600", children: dawPlaying ? 'Stop synth engine' : 'Play live stems' })] }) })] }), _jsx(YStack, { rounded: "$4", overflow: "hidden", borderWidth: 1, borderColor: "var(--border-strong)", bg: "var(--surface-card)", children: _jsx("canvas", { ref: audioWaveCanvasRef, width: 780, height: 220, style: { width: '100%', height: 'auto', display: 'block' } }) }), _jsx(YStack, { gap: "$2", role: "list", "aria-label": "Audio stems", minW: 0, children: stems.map((stem) => (_jsxs(XStack, { role: "listitem", items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2.5", p: "$2.5", rounded: "$3", borderWidth: 1, borderColor: "var(--border-strong)", bg: "var(--background)", minW: 0, children: [_jsxs(XStack, { items: "center", gap: "$2", width: 180, minW: 0, children: [_jsx(XStack, { width: 9, height: 9, rounded: 99, shrink: 0, borderWidth: 1, borderColor: "var(--border-strong)", style: { backgroundColor: stem.color, border: '1px solid var(--border-strong)' } }), _jsxs(YStack, { minW: 0, children: [_jsx(SizableText, { size: "$2", fontWeight: "600", color: "$ink", numberOfLines: 1, children: stem.name }), _jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, children: stem.role })] })] }), _jsx("input", { "aria-label": `${stem.name} volume`, type: "range", min: 0, max: 100, value: stem.volume, onChange: (e) => {
1209
1146
  const v = Number(e.currentTarget.value);
1210
1147
  setStems((prev) => prev.map((s) => (s.id === stem.id ? { ...s, volume: v } : s)));
1211
- }, style: { flex: 1 } }), _jsxs(XStack, { gap: "$1.5", children: [_jsx(XStack, { render: "button", onPress: () => setStems((prev) => prev.map((s) => (s.id === stem.id ? { ...s, muted: !s.muted } : s))), px: "$2.5", height: 26, items: "center", rounded: "$2", borderWidth: 1, borderColor: stem.muted ? '$ink' : '$borderColor', bg: stem.muted ? '$ink' : 'transparent', cursor: "pointer", children: _jsx(SizableText, { size: "$1", color: stem.muted ? '$background' : '$ink', children: "M" }) }), _jsx(XStack, { render: "button", onPress: () => setStems((prev) => prev.map((s) => (s.id === stem.id ? { ...s, solo: !s.solo } : s))), px: "$2.5", height: 26, items: "center", rounded: "$2", borderWidth: 1, borderColor: stem.solo ? '$ink' : '$borderColor', bg: stem.solo ? '$ink' : 'transparent', cursor: "pointer", children: _jsx(SizableText, { size: "$1", color: stem.solo ? '$background' : '$ink', children: "S" }) })] })] }, stem.id))) })] }), _jsxs(YStack, { width: 290, grow: 1, maxW: 340, gap: "$3", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "var(--pane-fill, var(--sheet-1))", children: [_jsx(SizableText, { size: "$2", fontWeight: "600", children: "Koe Voice & Dialogue Studio" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Zero-shot voice cloning & emotional speech synthesis (/v1/audio/speech)." }), _jsx(YStack, { gap: "$1.5", children: ['koe-baritone', 'koe-alto', 'koe-narrator', 'oto-cyber'].map((vp) => (_jsxs(XStack, { render: "button", onPress: () => setVoicePreset(vp), px: "$2.5", py: "$1.5", rounded: "$3", borderWidth: 1, borderColor: voicePreset === vp ? '$ink' : '$borderColor', bg: voicePreset === vp ? '$hover' : 'transparent', justify: "space-between", cursor: "pointer", children: [_jsx(SizableText, { size: "$1", fontWeight: "600", children: vp }), _jsx(SizableText, { size: "$1", color: "$soft", children: "24kHz Neural" })] }, vp))) }), _jsx("textarea", { "aria-label": "Voice narration script", value: voiceLine, onChange: (e) => setVoiceLine(e.currentTarget.value), rows: 4, style: {
1212
- width: '100%',
1213
- borderRadius: 8,
1214
- padding: '8px 10px',
1215
- background: 'rgba(255,255,255,0.04)',
1216
- border: '1px solid rgba(255,255,255,0.12)',
1217
- color: 'inherit',
1218
- font: 'inherit',
1219
- } }), _jsxs(XStack, { render: "button", onPress: () => {
1148
+ }, style: { flex: 1, minWidth: 100 } }), _jsxs(XStack, { gap: "$1.5", shrink: 0, children: [_jsx(XStack, { render: _jsx("button", { type: "button" }), "aria-label": `Mute ${stem.name}`, "aria-pressed": stem.muted, onClick: () => setStems((prev) => prev.map((s) => (s.id === stem.id ? { ...s, muted: !s.muted } : s))), px: "$2.5", minW: 44, minH: 44, "$max-sm": { minW: 44, minH: 44 }, $md: { minW: 30, minH: 26, height: 26 }, items: "center", justify: "center", rounded: "$2", borderWidth: 1, borderColor: stem.muted ? '$ink' : 'var(--border-strong)', bg: stem.muted ? 'var(--surface-card-emphasis)' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", children: _jsx(SizableText, { size: "$1", fontWeight: stem.muted ? '600' : '500', color: stem.muted ? '$ink' : '$soft', children: "M" }) }), _jsx(XStack, { render: _jsx("button", { type: "button" }), "aria-label": `Solo ${stem.name}`, "aria-pressed": stem.solo, onClick: () => setStems((prev) => prev.map((s) => (s.id === stem.id ? { ...s, solo: !s.solo } : s))), px: "$2.5", minW: 44, minH: 44, "$max-sm": { minW: 44, minH: 44 }, $md: { minW: 30, minH: 26, height: 26 }, items: "center", justify: "center", rounded: "$2", borderWidth: 1, borderColor: stem.solo ? '$ink' : 'var(--border-strong)', bg: stem.solo ? 'var(--surface-card-emphasis)' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", children: _jsx(SizableText, { size: "$1", fontWeight: stem.solo ? '600' : '500', color: stem.solo ? '$ink' : '$soft', children: "S" }) })] })] }, stem.id))) })] }), _jsxs(YStack, { width: "100%", minW: 0, $xl: { width: 268, shrink: 0 }, $xxl: { width: 280 }, gap: "$3", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "Koe voice & dialogue studio" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Zero-shot voice cloning & emotional speech synthesis (/v1/audio/speech)." }), _jsx(YStack, { gap: "$1.5", children: ['koe-baritone', 'koe-alto', 'koe-narrator', 'oto-cyber'].map((vp) => (_jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: () => setVoicePreset(vp), px: "$2.5", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 32 }, py: "$1.5", rounded: "$3", "aria-pressed": voicePreset === vp, borderWidth: voicePreset === vp ? 1.5 : 1, borderColor: voicePreset === vp ? 'var(--foreground)' : 'var(--border-strong)', bg: voicePreset === vp ? 'var(--surface-card)' : 'var(--background)', boxShadow: voicePreset === vp ? 'var(--shadow-sheet-2)' : undefined, hoverStyle: { bg: voicePreset === vp ? 'var(--surface-card)' : '$hover', borderColor: voicePreset === vp ? 'var(--foreground)' : 'var(--border-strong)' }, focusVisibleStyle: RING, justify: "space-between", items: "center", cursor: "pointer", children: [_jsx(SizableText, { size: "$2", fontWeight: "600", fontFamily: "$mono", color: "$ink", children: vp }), _jsx(SizableText, { size: "$1", color: "$soft", children: "24kHz neural" })] }, vp))) }), _jsx(StudioTextarea, { "aria-label": "Voice narration script", ...{ value: voiceLine, rows: 4 }, onChange: (e) => setVoiceLine(e.currentTarget.value) }), _jsxs(XStack, { render: "button", onPress: () => {
1220
1149
  triggerCinemaAudio();
1221
1150
  setStatusNote(`Synthesized Koe voice stem (${voicePreset}) → added to Vocal Stem`);
1222
- }, height: 34, rounded: 999, borderWidth: 1, borderColor: "$borderColor", items: "center", justify: "center", gap: "$1.5", cursor: "pointer", hoverStyle: { bg: '$hover' }, children: [_jsx(Wand2, { size: 13 }), _jsx(SizableText, { size: "$1", fontWeight: "600", children: "Synthesize Voice Stem" })] })] })] })) : null, section === 'model3d' ? (_jsxs(XStack, { gap: "$3", flex: 1, minH: 480, flexWrap: "wrap", children: [_jsxs(YStack, { width: 310, grow: 1, maxW: 360, gap: "$3", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "var(--pane-fill, var(--sheet-1))", children: [_jsx(SizableText, { size: "$2", fontWeight: "600", children: "Hunyuan3D-2.1 Mesh Generator" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Convert a reference photo or prompt into a watertight textured .glb mesh on GB10 / H100 GPUs." }), _jsx(YStack, { gap: "$2", role: "list", "aria-label": "Starters", children: MESH_PRESETS.map((m) => {
1151
+ }, height: 34, rounded: 999, borderWidth: 1, borderColor: "$borderColor", items: "center", justify: "center", gap: "$1.5", cursor: "pointer", hoverStyle: { bg: '$hover' }, children: [_jsx(Wand2, { size: 13 }), _jsx(SizableText, { size: "$1", fontWeight: "600", children: "Synthesize Voice Stem" })] })] })] })) : null, section === 'model3d' ? (_jsxs(YStack, { gap: "$3", flex: 1, width: "100%", minW: 0, $lg: { flexDirection: 'row', items: 'flex-start' }, children: [_jsxs(YStack, { width: "100%", minW: 0, $lg: { width: 276, shrink: 0 }, $xl: { width: 288 }, gap: "$3", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "Hunyuan3D-2.1 mesh generator" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Convert a reference photo or prompt into a watertight textured .glb mesh on GB10 / H100 GPUs." }), _jsx(YStack, { gap: "$2", role: "list", "aria-label": "3D mesh presets", children: MESH_PRESETS.map((m) => {
1223
1152
  const on = m.id === activeMesh.id;
1224
- return (_jsxs(YStack, { render: "button", onPress: () => {
1225
- setActiveMeshId(m.id);
1226
- setMeshPrompt(m.prompt);
1227
- setMeshOctree(m.octree);
1228
- }, p: "$2.5", rounded: "$3", borderWidth: 1, borderColor: on ? '$ink' : '$borderColor', bg: on ? '$hover' : 'transparent', gap: 3, cursor: "pointer", style: { textAlign: 'left' }, children: [_jsxs(XStack, { justify: "space-between", items: "center", children: [_jsx(SizableText, { size: "$2", fontWeight: "600", children: m.name }), _jsx(SizableText, { size: "$1", color: "$soft", children: `${(m.faces / 1000).toFixed(0)}k tris` })] }), _jsx(SizableText, { size: "$1", color: "$soft", children: m.category })] }, m.id));
1229
- }) }), _jsxs(YStack, { gap: "$1.5", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Octree Marching-Cubes Resolution" }), _jsx(XStack, { gap: "$2", children: [256, 384, 512].map((res) => (_jsx(XStack, { render: "button", onPress: () => setMeshOctree(res), px: "$3", height: 28, items: "center", rounded: 999, borderWidth: 1, borderColor: meshOctree === res ? '$ink' : '$borderColor', bg: meshOctree === res ? '$ink' : 'transparent', cursor: "pointer", children: _jsx(SizableText, { size: "$1", color: meshOctree === res ? '$background' : '$ink', children: `${res}³` }) }, res))) })] }), _jsx("textarea", { "aria-label": "3D mesh conditioning prompt", value: meshPrompt, onChange: (e) => setMeshPrompt(e.currentTarget.value), rows: 3, style: {
1230
- width: '100%',
1231
- borderRadius: 8,
1232
- padding: '8px 10px',
1233
- background: 'rgba(255,255,255,0.04)',
1234
- border: '1px solid rgba(255,255,255,0.12)',
1235
- color: 'inherit',
1236
- font: 'inherit',
1237
- } }), _jsxs(XStack, { render: "button", onPress: () => {
1153
+ return (_jsx(YStack, { role: "listitem", width: "100%", minW: 0, children: _jsxs(YStack, { render: _jsx("button", { type: "button" }), onClick: () => {
1154
+ setActiveMeshId(m.id);
1155
+ setMeshPrompt(m.prompt);
1156
+ setMeshOctree(m.octree);
1157
+ }, width: "100%", minW: 0, minH: 44, "$max-sm": { minH: 44 }, p: "$2.5", rounded: "$3", "aria-pressed": on, borderWidth: on ? 1.5 : 1, borderColor: on ? 'var(--foreground)' : 'var(--border-strong)', bg: on ? 'var(--surface-card)' : 'var(--background)', boxShadow: on ? 'var(--shadow-sheet-2)' : undefined, hoverStyle: { bg: on ? 'var(--surface-card)' : '$hover', borderColor: on ? 'var(--foreground)' : 'var(--border-strong)' }, focusVisibleStyle: RING, gap: "$1", items: "flex-start", cursor: "pointer", children: [_jsxs(XStack, { justify: "space-between", items: "center", width: "100%", gap: "$2", children: [_jsx(SizableText, { size: "$2", fontWeight: "600", color: "$ink", text: "left", flex: 1, minW: 0, children: m.name }), _jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", shrink: 0, children: `${(m.faces / 1000).toFixed(0)}k tris` })] }), _jsx(SizableText, { size: "$1", color: "$soft", text: "left", children: m.category })] }) }, m.id));
1158
+ }) }), _jsxs(YStack, { gap: "$1.5", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Octree marching-cubes resolution" }), _jsx(XStack, { gap: "$2", children: [256, 384, 512].map((res) => {
1159
+ const on = meshOctree === res;
1160
+ return (_jsx(XStack, { render: _jsx("button", { type: "button" }), "aria-pressed": on, onClick: () => setMeshOctree(res), px: "$3", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 28, height: 28 }, items: "center", rounded: 999, borderWidth: 1, borderColor: on ? '$ink' : 'var(--border-strong)', bg: on ? 'var(--surface-card-emphasis)' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", children: _jsx(SizableText, { size: "$1", fontFamily: "$mono", fontWeight: on ? '600' : '500', color: on ? '$ink' : '$soft', children: `${res}³` }) }, res));
1161
+ }) })] }), _jsx(StudioTextarea, { "aria-label": "3D mesh conditioning prompt", style: { resize: 'none' }, ...{ value: meshPrompt, rows: 3 }, onChange: (e) => setMeshPrompt(e.currentTarget.value) }), _jsxs(XStack, { render: "button", onPress: () => {
1238
1162
  triggerCinemaAudio();
1239
1163
  setStatusNote(`Dispatched Hunyuan3D-2.1 mesh job (${meshOctree}³ octree) → /v1/library/model3d`);
1240
- }, height: 36, rounded: 999, bg: "$ink", items: "center", justify: "center", gap: "$1.5", cursor: "pointer", children: [_jsx(Box, { size: 14 }), _jsx(SizableText, { size: "$2", color: "$background", fontWeight: "600", children: "Generate 3D Mesh (.GLB)" })] })] }), _jsxs(YStack, { flex: 2, minW: 380, gap: "$3", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "var(--pane-fill, var(--sheet-1))", children: [_jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2", children: [_jsxs(YStack, { children: [_jsx(SizableText, { size: "$3", fontWeight: "600", children: activeMesh.name }), _jsx(SizableText, { size: "$1", color: "$soft", children: `${activeMesh.vertices.toLocaleString()} vertices · ${activeMesh.faces.toLocaleString()} triangles · Watertight PBR GLB` })] }), _jsxs(XStack, { gap: "$1.5", flexWrap: "wrap", children: [['pbr', 'wireframe', 'normal', 'clay'].map((sh) => (_jsx(XStack, { render: "button", onPress: () => setMeshShader(sh), px: "$2.5", height: 28, items: "center", rounded: 999, borderWidth: 1, borderColor: meshShader === sh ? '$ink' : '$borderColor', bg: meshShader === sh ? '$ink' : 'transparent', cursor: "pointer", children: _jsx(SizableText, { size: "$1", color: meshShader === sh ? '$background' : '$ink', children: sh.toUpperCase() }) }, sh))), _jsx(XStack, { render: "button", onPress: () => setMeshAutoRotate((r) => !r), px: "$2.5", height: 28, items: "center", rounded: 999, borderWidth: 1, borderColor: "$borderColor", cursor: "pointer", children: _jsx(SizableText, { size: "$1", children: meshAutoRotate ? 'Turntable: ON' : 'Turntable: OFF' }) }), _jsxs(XStack, { render: "button", onPress: exportMeshObj, px: "$3", height: 28, items: "center", gap: "$1", rounded: 999, bg: "$ink", cursor: "pointer", children: [_jsx(Download, { size: 12 }), _jsx(SizableText, { size: "$1", color: "$background", fontWeight: "600", children: "Export .OBJ / .GLB" })] })] })] }), _jsx(YStack, { rounded: "$4", overflow: "hidden", borderWidth: 1, borderColor: "$borderColor", bg: "#090a10", children: _jsx("canvas", { ref: meshCanvasRef, width: 820, height: 420, style: { width: '100%', height: 'auto', display: 'block' } }) }), _jsxs(XStack, { items: "center", gap: "$3", children: [_jsxs(SizableText, { size: "$1", color: "$soft", children: ["Key Light Azimuth (", meshLightAngle, "\u00B0)"] }), _jsx("input", { "aria-label": "Key light azimuth angle", type: "range", min: 0, max: 360, value: meshLightAngle, onChange: (e) => setMeshLightAngle(Number(e.currentTarget.value)), style: { flex: 1 } })] })] })] })) : null, section === 'library' ? (_jsxs(XStack, { gap: "$3", flex: 1, minH: 480, flexWrap: "wrap", children: [_jsxs(YStack, { flex: 2, minW: 380, gap: "$3", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "var(--pane-fill, var(--sheet-1))", children: [_jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2", children: [_jsxs(YStack, { children: [_jsx(SizableText, { size: "$3", fontWeight: "600", children: "Org Asset Library, Stacks & Quality Gate Flywheel" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Every asset embeds its ComfyUI workflow graph & seed. \uD83D\uDC4D/\uD83D\uDC4E ratings and critiques condition future renders." })] }), _jsx(XStack, { gap: "$1.5", flexWrap: "wrap", children: ['all', 'video', 'model3d', 'music', 'image'].map((f) => (_jsx(XStack, { render: "button", onPress: () => setLibraryFilter(f), px: "$2.5", height: 28, items: "center", rounded: 999, borderWidth: 1, borderColor: libraryFilter === f ? '$ink' : '$borderColor', bg: libraryFilter === f ? '$ink' : 'transparent', cursor: "pointer", children: _jsx(SizableText, { size: "$1", color: libraryFilter === f ? '$background' : '$ink', children: f.toUpperCase() }) }, f))) })] }), _jsx(XStack, { gap: "$3", flexWrap: "wrap", role: "list", "aria-label": "Starters", children: libraryItems
1164
+ }, height: 36, rounded: 999, bg: "$ink", items: "center", justify: "center", gap: "$1.5", cursor: "pointer", children: [_jsx(Box, { size: 14 }), _jsx(SizableText, { size: "$2", color: "$background", fontWeight: "600", children: "Generate 3D Mesh (.GLB)" })] })] }), _jsxs(YStack, { width: "100%", minW: 0, $lg: { flex: 1 }, gap: "$3", p: "$3.5", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsxs(YStack, { gap: "$2", minW: 0, children: [_jsxs(YStack, { gap: 2, minW: 0, children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: activeMesh.name }), _jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", children: `${activeMesh.vertices.toLocaleString()} vertices · ${activeMesh.faces.toLocaleString()} triangles · Watertight PBR GLB` })] }), _jsxs(XStack, { gap: "$1.5", flexWrap: "wrap", items: "center", children: [[
1165
+ { id: 'pbr', label: 'PBR' },
1166
+ { id: 'wireframe', label: 'Wireframe' },
1167
+ { id: 'normal', label: 'Normal' },
1168
+ { id: 'clay', label: 'Clay' },
1169
+ ].map((sh) => {
1170
+ const on = meshShader === sh.id;
1171
+ return (_jsx(XStack, { render: _jsx("button", { type: "button" }), "aria-pressed": on, onClick: () => setMeshShader(sh.id), px: "$2.5", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 28, height: 28 }, items: "center", rounded: 999, borderWidth: 1, borderColor: on ? '$ink' : 'var(--border-strong)', bg: on ? 'var(--surface-card-emphasis)' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", children: _jsx(SizableText, { size: "$1", fontWeight: on ? '600' : '500', color: on ? '$ink' : '$soft', children: sh.label }) }, sh.id));
1172
+ }), _jsx(XStack, { render: _jsx("button", { type: "button" }), onClick: () => setMeshAutoRotate((r) => !r), px: "$2.5", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 28, height: 28 }, items: "center", rounded: 999, borderWidth: 1, borderColor: "var(--border-strong)", bg: "transparent", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", children: _jsx(SizableText, { size: "$1", color: "$ink", children: meshAutoRotate ? 'Turntable: on' : 'Turntable: off' }) }), _jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: exportMeshObj, px: "$3", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 28, height: 28 }, items: "center", gap: "$1.5", rounded: 999, borderWidth: 1, borderColor: "var(--border-strong)", bg: "transparent", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", children: [_jsx(Download, { size: 12, color: "$ink" }), _jsx(SizableText, { size: "$1", color: "$ink", fontWeight: "600", children: "Export .OBJ / .GLB" })] })] })] }), _jsx(YStack, { rounded: "$4", overflow: "hidden", borderWidth: 1, borderColor: "var(--border-strong)", bg: "var(--surface-card)", children: _jsx("canvas", { ref: meshCanvasRef, width: 820, height: 420, style: { width: '100%', height: 'auto', display: 'block' } }) }), _jsxs(XStack, { items: "center", gap: "$3", flexWrap: "wrap", children: [_jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", children: `Key light azimuth (${meshLightAngle}°)` }), _jsx("input", { "aria-label": "Key light azimuth angle", type: "range", min: 0, max: 360, value: meshLightAngle, onChange: (e) => setMeshLightAngle(Number(e.currentTarget.value)), style: { flex: 1, minWidth: 140 } })] })] })] })) : null, section === 'library' ? (_jsxs(YStack, { gap: "$3", flex: 1, width: "100%", minW: 0, $lg: { flexDirection: 'row', items: 'flex-start' }, children: [_jsxs(YStack, { width: "100%", minW: 0, $lg: { flex: 1 }, gap: "$3", p: "$3.5", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2", children: [_jsxs(YStack, { gap: 2, flex: 1, minW: 200, children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "Org asset library, stacks & quality gate flywheel" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Every asset embeds its ComfyUI workflow graph and seed. Ratings and critiques condition future renders." })] }), _jsx(XStack, { gap: "$1.5", flexWrap: "wrap", children: [
1173
+ { id: 'all', label: 'All' },
1174
+ { id: 'video', label: 'Video' },
1175
+ { id: 'model3d', label: '3D' },
1176
+ { id: 'music', label: 'Music' },
1177
+ { id: 'image', label: 'Image' },
1178
+ ].map((f) => {
1179
+ const on = libraryFilter === f.id;
1180
+ return (_jsx(XStack, { render: _jsx("button", { type: "button" }), "aria-pressed": on, onClick: () => setLibraryFilter(f.id), px: "$2.5", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 28, height: 28 }, items: "center", rounded: 999, borderWidth: 1, borderColor: on ? '$ink' : 'var(--border-strong)', bg: on ? 'var(--surface-card-emphasis)' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", children: _jsx(SizableText, { size: "$1", fontWeight: on ? '600' : '500', color: on ? '$ink' : '$soft', children: f.label }) }, f.id));
1181
+ }) })] }), _jsx(XStack, { gap: "$2.5", flexWrap: "wrap", role: "list", "aria-label": "Library assets", width: "100%", minW: 0, children: libraryItems
1241
1182
  .filter((it) => libraryFilter === 'all' || it.modality === libraryFilter)
1242
- .map((it) => (_jsxs(YStack, { width: 270, grow: 1, maxW: 340, p: "$3", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", bg: "rgba(255,255,255,0.02)", gap: "$2", children: [_jsxs(XStack, { justify: "space-between", items: "center", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: `🗂 ${it.stack}` }), _jsx(SizableText, { size: "$1", color: it.status === 'published' ? '$green10' : '$soft', children: it.status.toUpperCase() })] }), _jsx(SizableText, { size: "$2", fontWeight: "600", children: it.title }), _jsx(SizableText, { size: "$1", color: "$soft", style: { fontFamily: 'ui-monospace, monospace' }, children: `${it.path} · graph: ${it.workflow}` }), it.critique ? (_jsx(SizableText, { size: "$1", color: "$soft", children: `Conditioning note: “${it.critique}”` })) : null, _jsxs(XStack, { justify: "space-between", items: "center", pt: "$1", children: [_jsxs(XStack, { gap: "$1.5", children: [_jsxs(XStack, { render: "button", onPress: () => setLibraryItems((prev) => prev.map((x) => (x.id === it.id ? { ...x, vote: x.vote === 1 ? 0 : 1 } : x))), px: "$2", height: 26, items: "center", gap: 4, rounded: "$2", borderWidth: 1, borderColor: it.vote === 1 ? '$green10' : '$borderColor', cursor: "pointer", children: [_jsx(ThumbsUp, { size: 12 }), _jsx(SizableText, { size: "$1", children: "Good" })] }), _jsxs(XStack, { render: "button", onPress: () => setLibraryItems((prev) => prev.map((x) => (x.id === it.id ? { ...x, vote: x.vote === -1 ? 0 : -1 } : x))), px: "$2", height: 26, items: "center", gap: 4, rounded: "$2", borderWidth: 1, borderColor: it.vote === -1 ? '$red10' : '$borderColor', cursor: "pointer", children: [_jsx(ThumbsDown, { size: 12 }), _jsx(SizableText, { size: "$1", children: "Fix" })] })] }), _jsx(XStack, { render: "button", onPress: () => {
1183
+ .map((it) => (_jsxs(YStack, { role: "listitem", width: "100%", $sm: { width: 'calc(50% - 5px)' }, minW: 0, p: "$3", rounded: "$3", borderWidth: 1, borderColor: "var(--border-strong)", bg: "var(--background)", gap: "$2", children: [_jsxs(XStack, { justify: "space-between", items: "center", gap: "$2", children: [_jsxs(XStack, { items: "center", gap: "$1.5", flex: 1, minW: 0, children: [_jsx(Folder, { size: 12, color: "$soft" }), _jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, children: it.stack })] }), _jsx(SizableText, { size: "$1", fontFamily: "$mono", color: it.status === 'published' || it.status === 'approved' ? 'var(--state-success)' : '$soft', shrink: 0, children: it.status === 'published' ? 'Published' : it.status === 'approved' ? 'Approved' : 'Draft' })] }), _jsx(SizableText, { size: "$2", fontWeight: "600", color: "$ink", children: it.title }), it.modality === 'image' && /^(blob:|data:image\/|https?:)/.test(it.path) ? (_jsx("img", { src: it.path, alt: it.title, style: { width: '100%', borderRadius: 8, display: 'block' } })) : null, _jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", numberOfLines: 2, children: `${/^(blob|data):/.test(it.path) ? 'Generated image' : it.path} · graph: ${it.workflow}` }), it.critique ? (_jsx(SizableText, { size: "$1", color: "$soft", children: `Conditioning note: “${it.critique}”` })) : null, _jsxs(XStack, { justify: "space-between", items: "center", flexWrap: "wrap", gap: "$1.5", pt: "$1", children: [_jsxs(XStack, { gap: "$1.5", children: [_jsxs(XStack, { render: _jsx("button", { type: "button" }), "aria-pressed": it.vote === 1, onClick: () => setLibraryItems((prev) => prev.map((x) => (x.id === it.id ? { ...x, vote: x.vote === 1 ? 0 : 1 } : x))), px: "$2", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 26, height: 26 }, items: "center", gap: "$1", rounded: "$2", borderWidth: 1, borderColor: it.vote === 1 ? 'var(--state-success)' : 'var(--border-strong)', bg: it.vote === 1 ? 'var(--state-success-bg)' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", children: [_jsx(ThumbsUp, { size: 12, color: it.vote === 1 ? 'var(--state-success)' : '$ink' }), _jsx(SizableText, { size: "$1", color: it.vote === 1 ? 'var(--state-success)' : '$ink', children: "Good" })] }), _jsxs(XStack, { render: _jsx("button", { type: "button" }), "aria-pressed": it.vote === -1, onClick: () => setLibraryItems((prev) => prev.map((x) => (x.id === it.id ? { ...x, vote: x.vote === -1 ? 0 : -1 } : x))), px: "$2", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 26, height: 26 }, items: "center", gap: "$1", rounded: "$2", borderWidth: 1, borderColor: it.vote === -1 ? 'var(--state-error)' : 'var(--border-strong)', bg: it.vote === -1 ? 'var(--state-error-bg)' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", children: [_jsx(ThumbsDown, { size: 12, color: it.vote === -1 ? 'var(--state-error)' : '$ink' }), _jsx(SizableText, { size: "$1", color: it.vote === -1 ? 'var(--state-error)' : '$ink', children: "Fix" })] })] }), _jsx(XStack, { render: "button", onPress: () => {
1243
1184
  setLibraryItems((prev) => prev.map((x) => (x.id === it.id ? { ...x, status: 'published' } : x)));
1244
1185
  setStatusNote(`Published "${it.title}" to Gallery & cms.hanzo.ai`);
1245
- }, px: "$2.5", height: 26, items: "center", rounded: "$2", borderWidth: 1, borderColor: "$borderColor", cursor: "pointer", children: _jsx(SizableText, { size: "$1", children: "\u2601 Publish CMS" }) })] })] }, it.id))) })] }), _jsxs(YStack, { width: 320, grow: 1, maxW: 360, gap: "$3", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "var(--pane-fill, var(--sheet-1))", children: [_jsx(SizableText, { size: "$2", fontWeight: "600", children: "Qwen-Image-Edit 2511 Mask Inpaint" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Paint a mask region or attach 2\u20135 references to edit only the selected area while preserving subject identity & lighting (/v1/library/fix)." }), _jsxs(YStack, { gap: "$1", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Edit Instruction" }), _jsx("textarea", { "aria-label": "Inpaint edit instruction", value: inpaintInstruction, onChange: (e) => setInpaintInstruction(e.currentTarget.value), rows: 3, style: {
1246
- width: '100%',
1247
- borderRadius: 8,
1248
- padding: '8px 10px',
1249
- background: 'rgba(255,255,255,0.04)',
1250
- border: '1px solid rgba(255,255,255,0.12)',
1251
- color: 'inherit',
1252
- font: 'inherit',
1253
- } })] }), _jsxs(YStack, { gap: "$1", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: `Denoise / Edit Strength: ${inpaintStrength}%` }), _jsx("input", { "aria-label": "Edit strength percentage", type: "range", min: 10, max: 95, step: 5, value: inpaintStrength, onChange: (e) => setInpaintStrength(Number(e.currentTarget.value)) })] }), _jsx("canvas", { ref: inpaintCanvasRef, width: 280, height: 4, style: { display: 'none' } }), _jsxs(XStack, { render: "button", onPress: () => {
1186
+ }, px: "$2.5", height: 26, items: "center", rounded: "$2", borderWidth: 1, borderColor: "$borderColor", cursor: "pointer", children: _jsx(SizableText, { size: "$1", children: "\u2601 Publish CMS" }) })] })] }, it.id))) })] }), _jsxs(YStack, { width: "100%", minW: 0, $lg: { width: 272, shrink: 0 }, $xl: { width: 280 }, gap: "$3", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "Qwen-Image-Edit 2511 mask inpaint" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Paint a mask region or attach 2\u20135 references to edit only the selected area while preserving subject identity and lighting (/v1/library/fix)." }), _jsxs(YStack, { gap: "$1", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Edit instruction" }), _jsx(StudioTextarea, { "aria-label": "Inpaint edit instruction", style: { resize: 'none' }, ...{ value: inpaintInstruction, rows: 3 }, onChange: (e) => setInpaintInstruction(e.currentTarget.value) })] }), _jsxs(YStack, { gap: "$1", children: [_jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", children: `Denoise / edit strength: ${inpaintStrength}%` }), _jsx("input", { "aria-label": "Edit strength percentage", type: "range", min: 10, max: 95, step: 5, value: inpaintStrength, onChange: (e) => setInpaintStrength(Number(e.currentTarget.value)) })] }), _jsx("canvas", { ref: inpaintCanvasRef, width: 280, height: 4, style: { display: 'none' } }), _jsxs(XStack, { render: "button", onPress: () => {
1254
1187
  triggerCinemaAudio();
1255
1188
  setStatusNote(`Queued Qwen-Image-Edit 2511 pass (${inpaintStrength}% denoise) → /v1/library/fix`);
1256
- }, height: 34, rounded: 999, bg: "$ink", items: "center", justify: "center", gap: "$1.5", cursor: "pointer", children: [_jsx(Wand2, { size: 13 }), _jsx(SizableText, { size: "$1", color: "$background", fontWeight: "600", children: "Run Region Edit (/v1/library/fix)" })] })] })] })) : null, section === 'queue' ? (_jsxs(YStack, { gap: "$3", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "var(--pane-fill, var(--sheet-1))", children: [_jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2", children: [_jsxs(YStack, { children: [_jsx(SizableText, { size: "$3", fontWeight: "600", children: "GPU Federation Fleet & Durable Render Queue (tasks.hanzo.ai)" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Select a target GPU node (X-Target-GPU) or route jobs across the shared gpu-jobs cluster." })] }), _jsxs(XStack, { render: "button", onPress: () => setStatusNote('Refreshed /v1/gpu-status & /v1/queue/status'), px: "$3", height: 30, items: "center", gap: "$1.5", rounded: 999, borderWidth: 1, borderColor: "$borderColor", cursor: "pointer", children: [_jsx(RefreshCw, { size: 12 }), _jsx(SizableText, { size: "$1", children: "Refresh Fleet" })] })] }), _jsx(XStack, { gap: "$3", flexWrap: "wrap", role: "list", "aria-label": "Starters", children: gpuNodes.map((n) => {
1189
+ }, height: 34, rounded: 999, bg: "$ink", items: "center", justify: "center", gap: "$1.5", cursor: "pointer", children: [_jsx(Wand2, { size: 13 }), _jsx(SizableText, { size: "$1", color: "$background", fontWeight: "600", children: "Run Region Edit (/v1/library/fix)" })] })] })] })) : null, section === 'queue' ? (_jsxs(YStack, { gap: "$3", p: "$3.5", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", minW: 0, children: [_jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2", children: [_jsxs(YStack, { gap: 2, flex: 1, minW: 200, children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "GPU federation fleet & durable render queue (tasks.hanzo.ai)" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Select a target GPU node (X-Target-GPU) or route jobs across the shared gpu-jobs cluster." })] }), _jsxs(XStack, { render: "button", onPress: () => setStatusNote('Refreshed /v1/gpu-status & /v1/queue/status'), px: "$3", height: 30, items: "center", gap: "$1.5", rounded: 999, borderWidth: 1, borderColor: "$borderColor", cursor: "pointer", children: [_jsx(RefreshCw, { size: 12 }), _jsx(SizableText, { size: "$1", children: "Refresh Fleet" })] })] }), _jsx(XStack, { gap: "$2.5", flexWrap: "wrap", role: "list", "aria-label": "GPU nodes", width: "100%", minW: 0, children: gpuNodes.map((n) => {
1257
1190
  const selected = targetGpu === n.name;
1258
- return (_jsxs(YStack, { render: "button", onPress: () => {
1259
- setTargetGpu(selected ? 'any' : n.name);
1260
- setStatusNote(selected ? 'Routing renders to any available GPU' : `Pinned next render to GPU node: ${n.name}`);
1261
- }, width: 300, grow: 1, p: "$3", rounded: "$3", borderWidth: selected ? 2 : 1, borderColor: selected ? '$ink' : '$borderColor', bg: selected ? '$hover' : 'rgba(255,255,255,0.02)', gap: "$1.5", cursor: "pointer", style: { textAlign: 'left' }, children: [_jsxs(XStack, { justify: "space-between", items: "center", children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Cpu, { size: 15 }), _jsx(SizableText, { size: "$2", fontWeight: "600", children: n.name })] }), _jsx(SizableText, { size: "$1", color: n.online ? '$green10' : '$red10', children: n.online ? `● ONLINE · ${n.depth} in queue` : '○ OFFLINE' })] }), _jsx(SizableText, { size: "$1", color: "$soft", children: `Memory: ${n.vram}` }), _jsx(SizableText, { size: "$1", color: "$soft", style: { fontFamily: 'ui-monospace, monospace' }, children: `Lanes: ${n.lanes.join(' · ')}` })] }, n.name));
1191
+ return (_jsx(YStack, { role: "listitem", width: "100%", $sm: { width: 'calc(50% - 5px)' }, minW: 0, children: _jsxs(YStack, { render: _jsx("button", { type: "button" }), onClick: () => {
1192
+ setTargetGpu(selected ? 'any' : n.name);
1193
+ setStatusNote(selected ? 'Routing renders to any available GPU' : `Pinned next render to GPU node: ${n.name}`);
1194
+ }, width: "100%", minW: 0, minH: 44, "$max-sm": { minH: 44 }, p: "$3", rounded: "$3", "aria-pressed": selected, borderWidth: selected ? 1.5 : 1, borderColor: selected ? 'var(--foreground)' : 'var(--border-strong)', bg: selected ? 'var(--surface-card)' : 'var(--background)', boxShadow: selected ? 'var(--shadow-sheet-2)' : undefined, hoverStyle: { bg: selected ? 'var(--surface-card)' : '$hover', borderColor: selected ? 'var(--foreground)' : 'var(--border-strong)' }, focusVisibleStyle: RING, gap: "$1.5", items: "flex-start", cursor: "pointer", children: [_jsxs(XStack, { justify: "space-between", items: "center", width: "100%", gap: "$2", children: [_jsxs(XStack, { items: "center", gap: "$2", minW: 0, children: [_jsx(Cpu, { size: 15, color: "$ink" }), _jsx(SizableText, { size: "$2", fontWeight: "600", color: "$ink", fontFamily: "$mono", numberOfLines: 1, children: n.name })] }), _jsxs(XStack, { items: "center", gap: "$1.5", shrink: 0, children: [_jsx(XStack, { width: 7, height: 7, rounded: 99, bg: n.online ? 'var(--state-success)' : 'var(--state-error)' }), _jsx(SizableText, { size: "$1", fontFamily: "$mono", color: n.online ? 'var(--state-success)' : 'var(--state-error)', children: n.online ? `Online · ${n.depth} queued` : 'Offline' })] })] }), _jsx(SizableText, { size: "$1", color: "$soft", children: `Memory: ${n.vram}` }), _jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", text: "left", children: `Lanes: ${n.lanes.join(' · ')}` })] }) }, n.name));
1262
1195
  }) })] })) : null] }));
1263
1196
  }