@opengeni/react 0.44.3 → 0.44.5

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.
Files changed (50) hide show
  1. package/README.md +42 -0
  2. package/dist/chunk-22KP6LR5.js +31 -0
  3. package/dist/{chunk-TK7G6XLT.js.map → chunk-22KP6LR5.js.map} +1 -1
  4. package/dist/{chunk-SXIQK54Z.js → chunk-6EDV6YFE.js} +8 -8
  5. package/dist/{chunk-SXIQK54Z.js.map → chunk-6EDV6YFE.js.map} +1 -1
  6. package/dist/{chunk-U6K24XQD.js → chunk-EHSYZ4KP.js} +37 -16
  7. package/dist/chunk-EHSYZ4KP.js.map +1 -0
  8. package/dist/chunk-JB5725BI.js +48 -0
  9. package/dist/chunk-JB5725BI.js.map +1 -0
  10. package/dist/{chunk-QQRM3DO3.js → chunk-L3EWO3UK.js} +6 -6
  11. package/dist/{chunk-QQRM3DO3.js.map → chunk-L3EWO3UK.js.map} +1 -1
  12. package/dist/{chunk-YNYIAYXQ.js → chunk-LYRJUU5V.js} +23 -23
  13. package/dist/chunk-LYRJUU5V.js.map +1 -0
  14. package/dist/{chunk-ATSTR5P3.js → chunk-U3CSCMWA.js} +5 -49
  15. package/dist/chunk-U3CSCMWA.js.map +1 -0
  16. package/dist/{chunk-YDNWMKXO.js → chunk-VCBFUSUZ.js} +4 -4
  17. package/dist/chunk-VCBFUSUZ.js.map +1 -0
  18. package/dist/components/model-policy-picker.d.ts +10 -1
  19. package/dist/composer.js +5 -4
  20. package/dist/index.js +11 -9
  21. package/dist/index.js.map +1 -1
  22. package/dist/machines.js +2 -2
  23. package/dist/{queue-surface-implementation-THPAKGMD.js → queue-surface-implementation-J4XJFKRW.js} +41 -26
  24. package/dist/queue-surface-implementation-J4XJFKRW.js.map +1 -0
  25. package/dist/realtime/dropdown-menu.d.ts +4 -4
  26. package/dist/realtime.js +58 -20
  27. package/dist/realtime.js.map +1 -1
  28. package/dist/session-ui.js +5 -4
  29. package/package.json +1 -1
  30. package/src/components/composer.tsx +3 -3
  31. package/src/components/enrollment-device-flow.tsx +2 -2
  32. package/src/components/message-timeline.tsx +15 -15
  33. package/src/components/model-policy-picker.tsx +47 -14
  34. package/src/components/queue-surface-implementation.tsx +28 -18
  35. package/src/components/queue-surface-state.tsx +3 -3
  36. package/src/components/queue-surface.tsx +2 -2
  37. package/src/components/session-status.tsx +1 -1
  38. package/src/lib/cn.ts +14 -1
  39. package/src/lib/use-portal-token-style.ts +1 -1
  40. package/src/provider.tsx +4 -4
  41. package/src/realtime/dropdown-menu.tsx +51 -8
  42. package/src/realtime/realtime-control.tsx +2 -2
  43. package/styles/index.css +91 -11
  44. package/styles/tokens.css +61 -0
  45. package/dist/chunk-ATSTR5P3.js.map +0 -1
  46. package/dist/chunk-TK7G6XLT.js +0 -18
  47. package/dist/chunk-U6K24XQD.js.map +0 -1
  48. package/dist/chunk-YDNWMKXO.js.map +0 -1
  49. package/dist/chunk-YNYIAYXQ.js.map +0 -1
  50. package/dist/queue-surface-implementation-THPAKGMD.js.map +0 -1
package/styles/index.css CHANGED
@@ -25,17 +25,26 @@
25
25
  --font-sans: var(--og-font-sans);
26
26
  --font-mono: var(--og-font-mono);
27
27
 
28
- /* Type ramp a real 4-step scale (no half-pixel hand-tuning). Every
29
- timeline string maps to one of these via `text-og-{xs,sm,base,md}`;
30
- mono reuses the same steps. */
31
- --text-og-xs: 11px;
32
- --text-og-xs--line-height: 1.45;
33
- --text-og-sm: 12px;
34
- --text-og-sm--line-height: 1.5;
35
- --text-og-base: 13px;
36
- --text-og-base--line-height: 1.55;
37
- --text-og-md: 15px;
38
- --text-og-md--line-height: 1.6;
28
+ /* Type ramp. Runtime values live in tokens.css so an embedder can tune the
29
+ complete SDK subtree without rebuilding Tailwind. The control/menu tokens
30
+ preserve Tailwind's historic xs/sm metrics without leaking through or
31
+ mutating the host application's own `text-xs` / `text-sm` utilities. */
32
+ --text-og-xs: var(--og-font-size-xs);
33
+ --text-og-xs--line-height: var(--og-line-height-xs);
34
+ --text-og-sm: var(--og-font-size-sm);
35
+ --text-og-sm--line-height: var(--og-line-height-sm);
36
+ --text-og-base: var(--og-font-size-base);
37
+ --text-og-base--line-height: var(--og-line-height-base);
38
+ --text-og-md: var(--og-font-size-md);
39
+ --text-og-md--line-height: var(--og-line-height-md);
40
+ --text-og-control: var(--og-font-size-control);
41
+ --text-og-control--line-height: var(--og-line-height-control);
42
+ --text-og-menu: var(--og-font-size-menu);
43
+ --text-og-menu--line-height: var(--og-line-height-menu);
44
+ --text-og-composer: var(--og-font-size-composer);
45
+ --text-og-composer--line-height: var(--og-line-height-composer);
46
+ --text-og-composer-wide: var(--og-font-size-composer-wide);
47
+ --text-og-composer-wide--line-height: var(--og-line-height-composer-wide);
39
48
  --text-2xs: 0.6875rem;
40
49
  --text-2xs--line-height: 1rem;
41
50
 
@@ -151,6 +160,52 @@
151
160
  var(--og-ease-stream) both;
152
161
  }
153
162
 
163
+ /* Typography utilities also publish their effective metrics as private
164
+ component variables. A host reset such as `.app button { font: inherit }`
165
+ otherwise beats a one-class Tailwind utility on specificity and silently
166
+ inflates embedded controls. The scoped guard below reads these variables at
167
+ higher specificity, while responsive variants can still replace them and
168
+ public --og-* tokens remain the only customization surface. */
169
+ @utility text-og-xs {
170
+ --og-component-font-size: var(--og-font-size-xs);
171
+ --og-component-line-height: var(--og-line-height-xs);
172
+ }
173
+
174
+ @utility text-og-sm {
175
+ --og-component-font-size: var(--og-font-size-sm);
176
+ --og-component-line-height: var(--og-line-height-sm);
177
+ }
178
+
179
+ @utility text-og-base {
180
+ --og-component-font-size: var(--og-font-size-base);
181
+ --og-component-line-height: var(--og-line-height-base);
182
+ }
183
+
184
+ @utility text-og-md {
185
+ --og-component-font-size: var(--og-font-size-md);
186
+ --og-component-line-height: var(--og-line-height-md);
187
+ }
188
+
189
+ @utility text-og-control {
190
+ --og-component-font-size: var(--og-font-size-control);
191
+ --og-component-line-height: var(--og-line-height-control);
192
+ }
193
+
194
+ @utility text-og-menu {
195
+ --og-component-font-size: var(--og-font-size-menu);
196
+ --og-component-line-height: var(--og-line-height-menu);
197
+ }
198
+
199
+ @utility text-og-composer {
200
+ --og-component-font-size: var(--og-font-size-composer);
201
+ --og-component-line-height: var(--og-line-height-composer);
202
+ }
203
+
204
+ @utility text-og-composer-wide {
205
+ --og-component-font-size: var(--og-font-size-composer-wide);
206
+ --og-component-line-height: var(--og-line-height-composer-wide);
207
+ }
208
+
154
209
  /* Radix Collapsible disclosure: height auto-animates via the content var. Used
155
210
  by the timeline tool rows so an expand glides open instead of snapping.
156
211
 
@@ -360,6 +415,31 @@
360
415
  color: var(--og-color-fg);
361
416
  }
362
417
 
418
+ :is(.og-root.og-root, .og-root .og-root)
419
+ :where(
420
+ .text-og-xs,
421
+ .text-og-sm,
422
+ .text-og-base,
423
+ .text-og-md,
424
+ .text-og-control,
425
+ .text-og-menu,
426
+ .text-og-composer,
427
+ .text-og-composer-wide
428
+ ),
429
+ :is(
430
+ .og-root.text-og-xs,
431
+ .og-root.text-og-sm,
432
+ .og-root.text-og-base,
433
+ .og-root.text-og-md,
434
+ .og-root.text-og-control,
435
+ .og-root.text-og-menu,
436
+ .og-root.text-og-composer,
437
+ .og-root.text-og-composer-wide
438
+ ) {
439
+ font-size: var(--og-component-font-size);
440
+ line-height: var(--tw-leading, var(--og-component-line-height));
441
+ }
442
+
363
443
  .og-root :where(*) {
364
444
  scrollbar-width: thin;
365
445
  scrollbar-color: var(--og-color-border-strong) transparent;
package/styles/tokens.css CHANGED
@@ -17,9 +17,40 @@
17
17
  --og-font-sans: "Inter Variable", "Inter", "Noto Sans JP Variable", "Noto Sans Arabic Variable", ui-sans-serif, system-ui, sans-serif;
18
18
  --og-font-mono: "JetBrains Mono Variable", "JetBrains Mono", "Noto Sans JP Variable", "Noto Sans Arabic Variable", ui-monospace, SFMono-Regular, Menlo, monospace;
19
19
  --og-font-features: "cv11", "ss01", "ss03";
20
+ /* Runtime type tokens. Defaults are the exact values used by apps/web, so
21
+ adopting the public token surface is render-compatible with the product.
22
+ Hosts can override these on any SDK ancestor; portalled surfaces copy the
23
+ effective --og-* values from their trigger. */
24
+ --og-font-size-xs: 11px;
25
+ --og-line-height-xs: 1.45;
26
+ --og-font-size-sm: 12px;
27
+ --og-line-height-sm: 1.5;
28
+ --og-font-size-base: 13px;
29
+ --og-line-height-base: 1.55;
30
+ --og-font-size-md: 15px;
31
+ --og-line-height-md: 1.6;
32
+ --og-font-size-control: 12px;
33
+ --og-line-height-control: 16px;
34
+ --og-font-size-menu: 14px;
35
+ --og-line-height-menu: 20px;
36
+ --og-font-size-composer: 16px;
37
+ --og-line-height-composer: 24px;
38
+ --og-font-size-composer-wide: 15px;
39
+ --og-line-height-composer-wide: 24px;
20
40
  --og-code-font-size: 12px;
21
41
  --og-code-line-height: 18px;
22
42
 
43
+ /* Model-policy picker density. These defaults preserve today's apps/web
44
+ geometry. They are tokens (rather than host-only class overrides) so an
45
+ embedded composer and its portalled menu can be tuned as one surface. */
46
+ --og-model-picker-trigger-height: 2rem;
47
+ --og-model-picker-trigger-height-mobile: 1.75rem;
48
+ --og-model-picker-menu-width: 18rem;
49
+ --og-model-picker-menu-padding: 0.375rem;
50
+ --og-model-picker-row-padding-x: 0.625rem;
51
+ --og-model-picker-row-padding-y: 0.5rem;
52
+ --og-model-picker-effort-height: 2rem;
53
+
23
54
  /* Radius ----------------------------------------------------------------- */
24
55
  --og-radius-xs: 4px;
25
56
  --og-radius-sm: 6px;
@@ -119,6 +150,36 @@
119
150
  color-scheme: dark;
120
151
  }
121
152
 
153
+ /* One supported dense preset for embedded product panels. It changes only
154
+ typography and model-picker density; colors, radii, and brand tokens remain
155
+ independently customizable. Apply either form to an SDK ancestor. */
156
+ [data-og-density="compact"],
157
+ .og-density-compact {
158
+ --og-font-size-xs: 10px;
159
+ --og-line-height-xs: 1.5;
160
+ --og-font-size-sm: 11px;
161
+ --og-line-height-sm: 1.5;
162
+ --og-font-size-base: 12px;
163
+ --og-line-height-base: 1.55;
164
+ --og-font-size-md: 13px;
165
+ --og-line-height-md: 1.6;
166
+ --og-font-size-control: 11px;
167
+ --og-line-height-control: 16px;
168
+ --og-font-size-menu: 12px;
169
+ --og-line-height-menu: 18px;
170
+ --og-font-size-composer: 13px;
171
+ --og-line-height-composer: 20px;
172
+ --og-font-size-composer-wide: 13px;
173
+ --og-line-height-composer-wide: 20px;
174
+ --og-model-picker-trigger-height: 1.75rem;
175
+ --og-model-picker-trigger-height-mobile: 1.75rem;
176
+ --og-model-picker-menu-width: 15rem;
177
+ --og-model-picker-menu-padding: 0.25rem;
178
+ --og-model-picker-row-padding-x: 0.5rem;
179
+ --og-model-picker-row-padding-y: 0.375rem;
180
+ --og-model-picker-effort-height: 1.75rem;
181
+ }
182
+
122
183
  /* Light theme — explicit opt-in, themable per subtree ----------------------- */
123
184
  [data-og-theme="light"],
124
185
  .og-light {
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/tooltip.tsx","../src/lib/use-portal-token-style.ts"],"sourcesContent":["/**\n * Token-styled Radix tooltip — SDK counterpart to apps/web `components/ui/tooltip`.\n * Portals copy `--og-*` tokens so embeds keep the host theme outside `.og-root`.\n *\n * Background/foreground are applied as inline styles (not only Tailwind\n * utilities): `.og-root` sets `color: var(--og-color-fg)` after utilities in the\n * consumer CSS cascade, which would otherwise paint light-on-light inverted\n * tips and look like a blank white bubble.\n */\nimport { Tooltip as TooltipPrimitive } from \"radix-ui\";\nimport {\n createContext,\n useContext,\n useRef,\n type ComponentProps,\n type CSSProperties,\n type RefObject,\n} from \"react\";\n\nimport { cn } from \"../lib/cn\";\nimport { usePortalTokenStyle } from \"../lib/use-portal-token-style\";\n\nconst TooltipSourceContext = createContext<RefObject<HTMLElement | null> | null>(null);\n\nfunction TooltipProvider({\n delayDuration = 300,\n ...props\n}: ComponentProps<typeof TooltipPrimitive.Provider>) {\n return <TooltipPrimitive.Provider delayDuration={delayDuration} {...props} />;\n}\n\nfunction Tooltip({ children, ...props }: ComponentProps<typeof TooltipPrimitive.Root>) {\n const sourceRef = useRef<HTMLElement | null>(null);\n return (\n <TooltipSourceContext.Provider value={sourceRef}>\n <TooltipPrimitive.Root data-slot=\"tooltip\" {...props}>\n {children}\n </TooltipPrimitive.Root>\n </TooltipSourceContext.Provider>\n );\n}\n\nfunction TooltipTrigger({\n asChild = true,\n ...props\n}: ComponentProps<typeof TooltipPrimitive.Trigger>) {\n const sourceRef = useContext(TooltipSourceContext);\n return (\n <TooltipPrimitive.Trigger\n data-slot=\"tooltip-trigger\"\n asChild={asChild}\n ref={(node) => {\n if (sourceRef) sourceRef.current = node;\n }}\n {...props}\n />\n );\n}\n\nconst tooltipSurfaceStyle: CSSProperties = {\n backgroundColor: \"var(--og-color-fg)\",\n color: \"var(--og-color-bg)\",\n};\n\nfunction TooltipContent({\n className,\n sideOffset = 6,\n children,\n style,\n ...props\n}: ComponentProps<typeof TooltipPrimitive.Content>) {\n const sourceRef = useContext(TooltipSourceContext);\n const fallbackRef = useRef<HTMLElement | null>(null);\n const portalStyle = usePortalTokenStyle(sourceRef ?? fallbackRef);\n\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(\n \"og-root z-50 w-fit max-w-xs origin-[var(--radix-tooltip-content-transform-origin)]\",\n \"rounded-og-md px-2.5 py-1.5 text-og-xs leading-4 text-balance shadow-og-md\",\n \"animate-og-enter data-[state=closed]:opacity-0 data-[state=closed]:transition-opacity\",\n className,\n )}\n style={{ ...portalStyle, ...tooltipSurfaceStyle, ...style }}\n {...props}\n >\n {children}\n <TooltipPrimitive.Arrow\n className=\"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]\"\n style={{\n backgroundColor: \"var(--og-color-fg)\",\n fill: \"var(--og-color-fg)\",\n }}\n />\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n}\n\nexport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };\n","import { type CSSProperties, type RefObject, useEffect, useState } from \"react\";\n\nexport type PortalTokenStyle = CSSProperties & Record<`--${string}`, string>;\n\n/**\n * Copy the effective SDK tokens across a portal boundary. A locally themed or\n * rebranded embed cannot rely on CSS inheritance once a portal mounts under\n * `<body>`. Ancestor theme/class/style mutations and OS color-scheme changes\n * keep the copied values live.\n */\nexport function usePortalTokenStyle(sourceRef: RefObject<HTMLElement | null>): PortalTokenStyle {\n const [style, setStyle] = useState<PortalTokenStyle>({});\n useEffect(() => {\n const source = sourceRef.current;\n if (!source || typeof MutationObserver === \"undefined\") return;\n let signature = \"\";\n const sync = () => {\n const computed = getComputedStyle(source);\n const next: PortalTokenStyle = { colorScheme: computed.colorScheme };\n for (let index = 0; index < computed.length; index += 1) {\n const property = computed.item(index);\n if (!property.startsWith(\"--og-\")) continue;\n next[property as `--${string}`] = computed.getPropertyValue(property);\n }\n const nextSignature = JSON.stringify(next);\n if (nextSignature !== signature) {\n signature = nextSignature;\n setStyle(next);\n }\n };\n const observers: MutationObserver[] = [];\n let ancestor: HTMLElement | null = source;\n while (ancestor) {\n const observer = new MutationObserver(sync);\n observer.observe(ancestor, {\n attributes: true,\n attributeFilter: [\"class\", \"data-og-theme\", \"style\"],\n });\n observers.push(observer);\n ancestor = ancestor.parentElement;\n }\n const colorScheme = window.matchMedia?.(\"(prefers-color-scheme: dark)\");\n colorScheme?.addEventListener?.(\"change\", sync);\n sync();\n return () => {\n for (const observer of observers) observer.disconnect();\n colorScheme?.removeEventListener?.(\"change\", sync);\n };\n }, [sourceRef]);\n return style;\n}\n"],"mappings":";;;;;AASA,SAAS,WAAW,wBAAwB;AAC5C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAIK;;;ACjBP,SAA6C,WAAW,gBAAgB;AAUjE,SAAS,oBAAoB,WAA4D;AAC9F,QAAM,CAAC,OAAO,QAAQ,IAAI,SAA2B,CAAC,CAAC;AACvD,YAAU,MAAM;AACd,UAAM,SAAS,UAAU;AACzB,Q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OAA2B,IAAI;AACjD,SACE,oBAAC,qBAAqB,UAArB,EAA8B,OAAO,WACpC,8BAAC,iBAAiB,MAAjB,EAAsB,aAAU,WAAW,GAAG,OAC5C,UACH,GACF;AAEJ;AAEA,SAAS,eAAe;AAAA,EACtB,UAAU;AAAA,EACV,GAAG;AACL,GAAoD;AAClD,QAAM,YAAY,WAAW,oBAAoB;AACjD,SACE;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACC,aAAU;AAAA,MACV;AAAA,MACA,KAAK,CAAC,SAAS;AACb,YAAI,UAAW,WAAU,UAAU;AAAA,MACrC;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,IAAM,sBAAqC;AAAA,EACzC,iBAAiB;AAAA,EACjB,OAAO;AACT;AAEA,SAAS,eAAe;AAAA,EACtB;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAoD;AAClD,QAAM,YAAY,WAAW,oBAAoB;AACjD,QAAM,cAAc,OAA2B,IAAI;AACnD,QAAM,cAAc,oBAAoB,aAAa,WAAW;AAEhE,SACE,oBAAC,iBAAiB,QAAjB,EACC;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACC,aAAU;AAAA,MACV;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,OAAO,EAAE,GAAG,aAAa,GAAG,qBAAqB,GAAG,MAAM;AAAA,MACzD,GAAG;AAAA,MAEH;AAAA;AAAA,QACD;AAAA,UAAC,iBAAiB;AAAA,UAAjB;AAAA,YACC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,iBAAiB;AAAA,cACjB,MAAM;AAAA,YACR;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;","names":[]}
@@ -1,18 +0,0 @@
1
- // src/lib/cn.ts
2
- import { clsx } from "clsx";
3
- import { extendTailwindMerge } from "tailwind-merge";
4
- var twMerge = extendTailwindMerge({
5
- extend: {
6
- classGroups: {
7
- "font-size": [{ text: ["og-xs", "og-sm", "og-base", "og-md"] }]
8
- }
9
- }
10
- });
11
- function cn(...inputs) {
12
- return twMerge(clsx(inputs));
13
- }
14
-
15
- export {
16
- cn
17
- };
18
- //# sourceMappingURL=chunk-TK7G6XLT.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/model-policy-picker.tsx"],"sourcesContent":["import type { ClientModel, LatencyMode, ReasoningEffort } from \"@opengeni/sdk\";\nimport {\n CheckIcon,\n ChevronDownIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n KeyRoundIcon,\n ZapIcon,\n} from \"lucide-react\";\nimport { motion, useReducedMotion } from \"motion/react\";\nimport { DropdownMenu } from \"radix-ui\";\nimport { useEffect, useMemo, useState, type ReactNode, type SVGProps } from \"react\";\nimport { cn } from \"../lib/cn\";\nimport {\n coerceReasoningEffortForModel,\n effortOptionsForModel,\n findPickerRow,\n groupPickerRowsByBillingClass,\n labelReasoningEffort,\n projectClientModelRows,\n runnableLatencyModesForModel,\n type PickerBillingClass,\n type PickerModelRow,\n} from \"../model-policy\";\n\ntype ClientPickerModelRow = PickerModelRow<ClientModel>;\n\ntype NavLevel = \"providers\" | \"models\" | \"thinking\";\n\ntype PickerNavState = {\n level: NavLevel;\n rail: PickerBillingClass | null;\n modelId: string | null;\n};\n\ntype NavUpdater = PickerNavState | ((previous: PickerNavState) => PickerNavState);\n\nexport type ModelPolicyPickerMessages = {\n label: string;\n loading: string;\n noModels: string;\n thinking: string;\n fast: string;\n fastRateHint: string;\n codexOnly: string;\n billingHints: Record<PickerBillingClass, string>;\n};\n\nexport const defaultModelPolicyPickerMessages: ModelPolicyPickerMessages = {\n label: \"Model and effort\",\n loading: \"Loading model catalog…\",\n noModels: \"No models available.\",\n thinking: \"Thinking\",\n fast: \"Fast\",\n fastRateHint: \"2× rate\",\n codexOnly: \"Codex-only session\",\n billingHints: {\n opengeni_credits: \"Will use credits\",\n codex_subscription: \"ChatGPT / Codex plan\",\n byok: \"Billed to your AI Gateway\",\n },\n};\n\nexport type ModelPolicyPickerProps = {\n /** Lightweight deployment models. Catalog rows take precedence when supplied. */\n models?: ClientModel[] | undefined;\n /** Catalog-backed rows with availability and billing-class truth. */\n rows?: PickerModelRow[] | undefined;\n model: string;\n effort: ReasoningEffort;\n latencyMode: LatencyMode;\n disabled?: boolean | undefined;\n loading?: boolean | undefined;\n error?: string | null | undefined;\n /** Non-Codex models stay visible but cannot be selected. */\n codexOnly?: boolean | undefined;\n /** Resets drill-down navigation when the session scope changes. */\n sessionKey?: string | undefined;\n /** Prefer bottom on new-chat surfaces and top for bottom-docked composers. */\n menuSide?: \"top\" | \"bottom\" | undefined;\n className?: string | undefined;\n messages?: Partial<ModelPolicyPickerMessages> | undefined;\n onModelChange: (modelId: string) => void;\n onEffortChange: (effort: ReasoningEffort) => void;\n onLatencyModeChange: (latencyMode: LatencyMode) => void;\n};\n\nconst SLIDE_EASE = [0.22, 1, 0.36, 1] as const;\n\nfunction OpenGeniMark(props: SVGProps<SVGSVGElement>) {\n return (\n <svg\n viewBox=\"0 0 140 133\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n {...props}\n >\n <g transform=\"translate(-17.5,-20.999893188476562) scale(1.75)\">\n <g transform=\"translate(0,-952.36218)\">\n <path d=\"m 60.7828,964.36215 27.1809,0.8834 -27.1809,25.9958 z m -1.9745,1.4513 0,26.7845 -25.2681,0 c 8.6166,-8.7334 16.8796,-17.8103 25.2681,-26.7845 z m 27.7053,3.628 3.4864,1.1989 -12.5877,7.4768 z m -68.1835,2.9656 5.5226,0 12.8654,14.0705 -5.9854,6.1204 -12.4026,0 c 9e-4,-6.7347 0,-13.4597 0,-20.1909 z m -1.9746,1.2304 0,5.8364 -6.3555,0 z m 3.363,20.9796 38.627,0 -10.7675,29.43465 z m 39.0898,4.54286 0,41.20229 -12.5878,-6.8775 c 4.1972,-11.443 8.3886,-22.879 12.5878,-34.32479 z\" />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction ChatGptMark(props: SVGProps<SVGSVGElement>) {\n return (\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\" {...props}>\n <path d=\"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3653-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8414 3.3698-2.02 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.783-2.7622a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z\" />\n </svg>\n );\n}\n\nexport function BillingClassMark(props: {\n billingClass: PickerBillingClass;\n className?: string | undefined;\n \"aria-label\"?: string | undefined;\n}) {\n const labels: Record<PickerBillingClass, string> = {\n opengeni_credits: \"OpenGeni\",\n codex_subscription: \"Codex\",\n byok: \"Bring your own key\",\n };\n const label = props[\"aria-label\"] ?? labels[props.billingClass];\n const accessibility =\n label.length === 0\n ? { \"aria-hidden\": true as const }\n : { role: \"img\" as const, \"aria-label\": label };\n const shell = cn(\n \"inline-flex size-3.5 shrink-0 items-center justify-center overflow-hidden text-og-fg-subtle\",\n props.className,\n );\n const mark = \"size-3.5\";\n return (\n <span\n className={shell}\n data-testid={`billing-class-icon-${props.billingClass}`}\n {...accessibility}\n >\n {props.billingClass === \"opengeni_credits\" ? (\n <OpenGeniMark className={mark} />\n ) : props.billingClass === \"codex_subscription\" ? (\n <ChatGptMark className={mark} />\n ) : (\n <KeyRoundIcon className={mark} aria-hidden />\n )}\n </span>\n );\n}\n\nfunction isCodexModel(model: ClientModel): boolean {\n return model.id.startsWith(\"codex/\") || model.source === \"codex\";\n}\n\nfunction applyCodexOnly(\n rows: ClientPickerModelRow[],\n codexOnly: boolean,\n unavailableReason: string,\n): ClientPickerModelRow[] {\n if (!codexOnly) return rows;\n return rows.map((row) =>\n isCodexModel(row.catalog)\n ? row\n : {\n ...row,\n selectable: false,\n unavailableReason: row.unavailableReason ?? unavailableReason,\n },\n );\n}\n\nfunction effectiveRows(props: ModelPolicyPickerProps): ClientPickerModelRow[] {\n const rows = props.rows !== undefined ? props.rows : projectClientModelRows(props.models ?? []);\n const messages = { ...defaultModelPolicyPickerMessages, ...props.messages };\n return applyCodexOnly(rows, props.codexOnly === true, messages.codexOnly);\n}\n\nfunction defaultNavState(rows: ClientPickerModelRow[], modelId: string): PickerNavState {\n const selected = findPickerRow(rows, modelId);\n if (!selected) {\n const rails = new Set(rows.map((row) => row.billingClass));\n const onlyRail = rails.size === 1 ? rows[0]?.billingClass : null;\n return onlyRail\n ? { level: \"models\", rail: onlyRail, modelId: null }\n : { level: \"providers\", rail: null, modelId: null };\n }\n return { level: \"thinking\", rail: selected.billingClass, modelId: selected.id };\n}\n\nfunction usePickerNavState(\n sessionKey: string | undefined,\n rows: ClientPickerModelRow[],\n model: string,\n): [PickerNavState, (next: NavUpdater) => void] {\n const [state, setState] = useState<PickerNavState>(() => defaultNavState(rows, model));\n useEffect(() => {\n setState(defaultNavState(rows, model));\n // The menu deliberately preserves its drill-down while the same session is mounted.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [sessionKey]);\n return [state, setState];\n}\n\nexport function PickerNavRow(props: {\n label: string;\n hint?: string | undefined;\n icon?: ReactNode;\n trailing?: ReactNode;\n showChevron?: boolean | undefined;\n disabled?: boolean | undefined;\n title?: string | undefined;\n active?: boolean | undefined;\n testId?: string | undefined;\n onClick: () => void;\n}) {\n return (\n <button\n type=\"button\"\n disabled={props.disabled}\n title={props.title}\n onClick={props.onClick}\n data-testid={props.testId}\n className={cn(\n \"flex w-full cursor-pointer items-center gap-2 rounded-og-sm px-2.5 py-2 text-left text-og-fg outline-none transition-colors hover:bg-og-surface-2 focus-visible:ring-2 focus-visible:ring-og-accent/40\",\n props.disabled && \"cursor-not-allowed opacity-50\",\n )}\n >\n {props.icon}\n <span className=\"min-w-0 flex-1\">\n <span className={cn(\"block truncate text-sm\", props.active && \"font-medium\")}>\n {props.label}\n </span>\n {props.hint ? (\n <span className=\"mt-0.5 block truncate text-xs text-og-fg-subtle\">{props.hint}</span>\n ) : null}\n </span>\n {props.trailing ? <span className=\"ml-auto shrink-0\">{props.trailing}</span> : null}\n {props.showChevron === false ? null : (\n <ChevronRightIcon className=\"size-3.5 shrink-0 text-og-fg-subtle\" />\n )}\n </button>\n );\n}\n\nexport function PickerBackHeader(props: {\n label: string;\n icon?: ReactNode;\n onBack: () => void;\n trailing?: ReactNode;\n}) {\n return (\n <div className=\"mb-1 flex items-center gap-0.5 border-b border-og-border/70 px-0.5 pb-1.5\">\n <button\n type=\"button\"\n onClick={props.onBack}\n data-testid=\"model-picker-back\"\n className=\"flex min-w-0 flex-1 cursor-pointer items-center gap-1.5 rounded-og-sm px-1.5 py-1.5 text-left text-og-fg outline-none transition-colors hover:bg-og-surface-2 focus-visible:ring-2 focus-visible:ring-og-accent/40\"\n >\n <ChevronLeftIcon className=\"size-3.5 shrink-0 text-og-fg-subtle\" />\n {props.icon}\n <span className=\"min-w-0 flex-1 truncate text-sm font-medium\">{props.label}</span>\n </button>\n {props.trailing ? <div className=\"relative z-10 shrink-0\">{props.trailing}</div> : null}\n </div>\n );\n}\n\nexport function PickerAnimatedPage(props: {\n pageKey: string;\n direction: 1 | -1;\n children: ReactNode;\n}) {\n const reduceMotion = useReducedMotion();\n return (\n <motion.div\n key={props.pageKey}\n initial={reduceMotion ? false : { x: props.direction * 14, opacity: 0 }}\n animate={{ x: 0, opacity: 1 }}\n transition={{ duration: reduceMotion ? 0 : 0.18, ease: SLIDE_EASE }}\n className=\"w-full\"\n >\n {props.children}\n </motion.div>\n );\n}\n\nexport function ModelPolicyPickerMenu(\n props: ModelPolicyPickerProps & {\n nav?: PickerNavState | undefined;\n onNavChange?: ((next: NavUpdater) => void) | undefined;\n },\n) {\n const messages = useMemo(\n () => ({ ...defaultModelPolicyPickerMessages, ...props.messages }),\n [props.messages],\n );\n const rows = effectiveRows(props);\n const groups = useMemo(() => groupPickerRowsByBillingClass(rows), [rows]);\n const [localNav, setLocalNav] = usePickerNavState(\n props.nav === undefined ? props.sessionKey : undefined,\n rows,\n props.model,\n );\n const nav = props.nav ?? localNav;\n const setNav = props.onNavChange ?? setLocalNav;\n const [direction, setDirection] = useState<1 | -1>(1);\n\n const effectiveNav =\n nav.level === \"providers\" && groups.length === 1\n ? { level: \"models\" as const, rail: groups[0]!.billingClass, modelId: null }\n : nav;\n const activeGroup =\n effectiveNav.rail === null\n ? undefined\n : groups.find((group) => group.billingClass === effectiveNav.rail);\n const focusModel =\n effectiveNav.modelId === null ? undefined : findPickerRow(rows, effectiveNav.modelId);\n const selectedRow = findPickerRow(rows, props.model);\n const { latencyMode, loading, onLatencyModeChange } = props;\n\n useEffect(() => {\n if (loading || !selectedRow?.selectable) return;\n const supportsCurrentMode = runnableLatencyModesForModel(selectedRow.catalog).includes(\n latencyMode,\n );\n if (!supportsCurrentMode && latencyMode !== \"standard\") {\n onLatencyModeChange(\"standard\");\n }\n }, [latencyMode, loading, onLatencyModeChange, selectedRow]);\n\n const go = (next: PickerNavState, nextDirection: 1 | -1) => {\n setDirection(nextDirection);\n setNav(next);\n };\n\n const selectEffort = (row: ClientPickerModelRow, effort: ReasoningEffort) => {\n if (!row.selectable) return;\n if (row.id !== props.model) props.onModelChange(row.id);\n props.onEffortChange(coerceReasoningEffortForModel(row.catalog, effort));\n };\n\n const pageKey =\n effectiveNav.level === \"providers\"\n ? \"providers\"\n : effectiveNav.level === \"models\"\n ? `models:${effectiveNav.rail ?? \"\"}`\n : `thinking:${effectiveNav.modelId ?? \"\"}`;\n\n let body: ReactNode;\n if (props.loading) {\n body = <p className=\"px-2 py-3 text-xs text-og-fg-subtle\">{messages.loading}</p>;\n } else if (groups.length === 0) {\n body = <p className=\"px-2 py-3 text-xs text-og-fg-subtle\">{messages.noModels}</p>;\n } else if (effectiveNav.level === \"providers\") {\n body = (\n <div className=\"flex flex-col gap-0.5\" data-testid=\"model-picker-providers\">\n {groups.map((group) => (\n <PickerNavRow\n key={group.billingClass}\n label={group.label}\n hint={messages.billingHints[group.billingClass]}\n icon={<BillingClassMark billingClass={group.billingClass} />}\n active={selectedRow?.billingClass === group.billingClass}\n testId={`model-picker-rail-${group.billingClass}`}\n onClick={() => go({ level: \"models\", rail: group.billingClass, modelId: null }, 1)}\n />\n ))}\n </div>\n );\n } else if (effectiveNav.level === \"models\" && activeGroup) {\n body = (\n <div data-testid=\"model-picker-models\">\n {groups.length > 1 ? (\n <PickerBackHeader\n label={activeGroup.label}\n icon={<BillingClassMark billingClass={activeGroup.billingClass} />}\n onBack={() => go({ level: \"providers\", rail: null, modelId: null }, -1)}\n />\n ) : null}\n <div className=\"flex flex-col gap-0.5\">\n {activeGroup.rows.map((row) => (\n <PickerNavRow\n key={`${row.billingClass}:${row.id}`}\n label={row.label}\n hint={row.unavailableReason ?? undefined}\n disabled={!row.selectable}\n title={row.unavailableReason ?? undefined}\n active={row.id === props.model}\n testId={`model-picker-choice-${row.id}`}\n onClick={() => {\n if (row.selectable) {\n go({ level: \"thinking\", rail: row.billingClass, modelId: row.id }, 1);\n }\n }}\n />\n ))}\n </div>\n </div>\n );\n } else if (effectiveNav.level === \"thinking\" && focusModel) {\n const activeModel = focusModel.id === props.model;\n const supportsFast = runnableLatencyModesForModel(focusModel.catalog).includes(\"fast\");\n body = (\n <div data-testid=\"model-picker-reasoning\">\n <PickerBackHeader\n label={focusModel.label}\n icon={<BillingClassMark billingClass={focusModel.billingClass} />}\n onBack={() => go({ level: \"models\", rail: focusModel.billingClass, modelId: null }, -1)}\n trailing={\n supportsFast ? (\n <button\n type=\"button\"\n disabled={!focusModel.selectable}\n aria-pressed={activeModel && props.latencyMode === \"fast\"}\n aria-label={\n activeModel && props.latencyMode === \"fast\"\n ? `Disable ${messages.fast}`\n : `Enable ${messages.fast}`\n }\n title={`${messages.fast} · ${messages.fastRateHint}`}\n data-testid=\"model-picker-fast\"\n onClick={() => {\n if (!activeModel) {\n props.onModelChange(focusModel.id);\n props.onEffortChange(\n coerceReasoningEffortForModel(focusModel.catalog, props.effort),\n );\n }\n props.onLatencyModeChange(\n activeModel && props.latencyMode === \"fast\" ? \"standard\" : \"fast\",\n );\n }}\n className={cn(\n \"flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-og-sm text-og-fg-subtle outline-none transition-colors hover:bg-og-surface-2 focus-visible:ring-2 focus-visible:ring-og-accent/40 disabled:cursor-not-allowed disabled:opacity-50\",\n activeModel && props.latencyMode === \"fast\" && \"text-og-fg\",\n )}\n >\n <ZapIcon\n className={cn(\n \"size-3.5\",\n activeModel && props.latencyMode === \"fast\" && \"fill-current\",\n )}\n />\n </button>\n ) : null\n }\n />\n <p className=\"px-2.5 pt-1 pb-1 text-xs font-medium tracking-wide text-og-fg-subtle uppercase\">\n {messages.thinking}\n </p>\n {focusModel.catalog.capabilities?.inputModalities.includes(\"image\") === false ? (\n <p className=\"px-2.5 pb-1.5 text-xs leading-relaxed text-og-fg-subtle\">\n Unsupported attachments stay in the session but are hidden from this model.\n </p>\n ) : null}\n <div className=\"flex flex-col gap-0.5\">\n {effortOptionsForModel(focusModel.catalog).map((effort) => {\n const selected = activeModel && effort === props.effort;\n return (\n <button\n key={effort}\n type=\"button\"\n disabled={!focusModel.selectable}\n onClick={() => selectEffort(focusModel, effort)}\n className={cn(\n \"flex h-8 w-full cursor-pointer items-center rounded-og-sm px-2.5 text-left text-sm text-og-fg outline-none transition-colors hover:bg-og-surface-2 focus-visible:ring-2 focus-visible:ring-og-accent/40 disabled:cursor-not-allowed disabled:opacity-50\",\n selected && \"bg-og-surface-2\",\n )}\n >\n <span className=\"min-w-0 flex-1 truncate\">{labelReasoningEffort(effort)}</span>\n {selected ? (\n <CheckIcon\n className=\"ml-auto size-3.5 shrink-0\"\n data-testid=\"model-picker-effort-check\"\n />\n ) : null}\n </button>\n );\n })}\n </div>\n </div>\n );\n } else {\n body = (\n <div className=\"flex flex-col gap-0.5\" data-testid=\"model-picker-providers\">\n {groups.map((group) => (\n <PickerNavRow\n key={group.billingClass}\n label={group.label}\n hint={messages.billingHints[group.billingClass]}\n icon={<BillingClassMark billingClass={group.billingClass} />}\n testId={`model-picker-rail-${group.billingClass}`}\n onClick={() => go({ level: \"models\", rail: group.billingClass, modelId: null }, 1)}\n />\n ))}\n </div>\n );\n }\n\n return (\n <div data-testid=\"model-picker-menu\" className=\"relative overflow-hidden\">\n {props.error ? (\n <p className=\"px-2 py-1 text-xs text-og-status-failed\" role=\"alert\">\n {props.error}\n </p>\n ) : null}\n <PickerAnimatedPage pageKey={pageKey} direction={direction}>\n {body}\n </PickerAnimatedPage>\n </div>\n );\n}\n\nexport function ModelPolicyPicker(props: ModelPolicyPickerProps) {\n const [open, setOpen] = useState(false);\n const messages = useMemo(\n () => ({ ...defaultModelPolicyPickerMessages, ...props.messages }),\n [props.messages],\n );\n const rows = effectiveRows(props);\n const [nav, setNav] = usePickerNavState(props.sessionKey, rows, props.model);\n const selected = findPickerRow(rows, props.model);\n\n if (props.loading) {\n return (\n <span\n className={cn(\n \"inline-flex h-8 w-40 shrink-0 animate-pulse rounded-full bg-og-surface-2\",\n props.className,\n )}\n aria-label={messages.loading}\n data-testid=\"model-picker-loading\"\n />\n );\n }\n return (\n <DropdownMenu.Root open={open} onOpenChange={setOpen}>\n <DropdownMenu.Trigger asChild>\n <button\n type=\"button\"\n disabled={props.disabled}\n aria-label={messages.label}\n className={cn(\n \"inline-flex h-8 min-w-0 max-w-64 items-center gap-1 rounded-full border border-transparent px-2.5 text-xs text-og-fg-muted outline-none transition-colors hover:border-og-border hover:bg-og-surface-2 hover:text-og-fg focus-visible:ring-2 focus-visible:ring-og-accent/40 disabled:cursor-not-allowed disabled:opacity-50 max-sm:h-7 max-sm:max-w-[7.5rem] max-sm:px-2\",\n props.className,\n )}\n >\n <BillingClassMark\n billingClass={\n selected?.billingClass ??\n (props.model.startsWith(\"codex/\") ? \"codex_subscription\" : \"opengeni_credits\")\n }\n className=\"text-og-fg\"\n />\n <span className=\"min-w-0 truncate font-medium text-og-fg max-sm:hidden\">\n {selected?.label ?? props.model}\n </span>\n <span className=\"min-w-0 truncate font-medium text-og-fg sm:hidden\">\n {selected?.shortLabel ?? selected?.label ?? props.model}\n </span>\n <span className=\"max-sm:hidden\">{labelReasoningEffort(props.effort)}</span>\n {props.latencyMode === \"fast\" ? (\n <ZapIcon\n className=\"size-3.5 shrink-0 fill-current stroke-current text-og-fg\"\n aria-label={messages.fast}\n data-testid=\"model-picker-fast-icon\"\n />\n ) : null}\n <ChevronDownIcon className=\"size-3 shrink-0\" />\n </button>\n </DropdownMenu.Trigger>\n <DropdownMenu.Portal>\n <DropdownMenu.Content\n align=\"start\"\n side={props.menuSide ?? \"bottom\"}\n sideOffset={8}\n collisionPadding={12}\n onCloseAutoFocus={(event) => event.preventDefault()}\n className=\"z-50 flex max-h-[min(20rem,var(--radix-dropdown-menu-content-available-height))] w-72 max-w-[calc(100vw-16px)] flex-col overflow-hidden rounded-og-lg border border-og-border bg-og-surface-1 p-1.5 text-og-fg shadow-og-lg\"\n >\n <div className=\"min-h-0 flex-1 overflow-y-auto overscroll-contain\">\n <ModelPolicyPickerMenu {...props} nav={nav} onNavChange={setNav} />\n </div>\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu.Root>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,QAAQ,wBAAwB;AACzC,SAAS,oBAAoB;AAC7B,SAAS,WAAW,SAAS,gBAA+C;AA2FlE,cAkIJ,YAlII;AAtDH,IAAM,mCAA8D;AAAA,EACzE,OAAO;AAAA,EACP,SAAS;AAAA,EACT,UAAU;AAAA,EACV,UAAU;AAAA,EACV,MAAM;AAAA,EACN,cAAc;AAAA,EACd,WAAW;AAAA,EACX,cAAc;AAAA,IACZ,kBAAkB;AAAA,IAClB,oBAAoB;AAAA,IACpB,MAAM;AAAA,EACR;AACF;AA0BA,IAAM,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC;AAEpC,SAAS,aAAa,OAAgC;AACpD,SACE;AAAA,IAAC;AAAA;AAA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AAAA,cAE7D,WAAU;AAAA;AAAA,UACZ;AAAA,UACA,oBAAC,UAAK,WAAU,yDACb,oBAAU,SAAS,MAAM,OAC5B;AAAA,UACA,oBAAC,UAAK,WAAU,qDACb,oBAAU,cAAc,UAAU,SAAS,MAAM,OACpD;AAAA,UACA,oBAAC,UAAK,WAAU,iBAAiB,+BAAqB,MAAM,MAAM,GAAE;AAAA,UACnE,MAAM,gBAAgB,SACrB;AAAA,YAAC;AAAA;AAAA,cACC,WAAU;AAAA,cACV,cAAY,SAAS;AAAA,cACrB,eAAY;AAAA;AAAA,UACd,IACE;AAAA,UACJ,oBAAC,mBAAgB,WAAU,mBAAkB;AAAA;AAAA;AAAA,IAC/C,GACF;AAAA,IACA,oBAAC,aAAa,QAAb,EACC;AAAA,MAAC,aAAa;AAAA,MAAb;AAAA,QACC,OAAM;AAAA,QACN,MAAM,MAAM,YAAY;AAAA,QACxB,YAAY;AAAA,QACZ,kBAAkB;AAAA,QAClB,kBAAkB,CAAC,UAAU,MAAM,eAAe;AAAA,QAClD,WAAU;AAAA,QAEV,8BAAC,SAAI,WAAU,qDACb,8BAAC,yBAAuB,GAAG,OAAO,KAAU,aAAa,QAAQ,GACnE;AAAA;AAAA,IACF,GACF;AAAA,KACF;AAEJ;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/queue-draft-policy.ts","../src/components/queue-surface-state.tsx"],"sourcesContent":["import type { ComposerState } from \"../hooks/use-composer\";\n\n/**\n * Decide whether checking out a queued prompt would replace current composer\n * content. `hasDraftContent` reads the synchronous draft refs, so this stays\n * correct even when a controlled input update has not rendered yet.\n */\nexport function requestQueueDraftEdit(\n composer: Pick<ComposerState, \"hasDraftContent\">,\n confirmReplacement: () => void,\n editImmediately: () => void,\n): void {\n if (composer.hasDraftContent()) {\n confirmReplacement();\n } else {\n editImmediately();\n }\n}\n","import { Loader2Icon, RotateCwIcon } from \"lucide-react\";\n\nimport type { UseTurnQueueResult } from \"../hooks/use-turn-queue\";\n\ntype QueueStateProps = {\n queue: UseTurnQueueResult;\n};\n\nexport function EmptyQueueStateSurface({ queue }: QueueStateProps) {\n const hasError = Boolean(queue.error || queue.mutationError);\n return (\n <div\n className=\"mx-auto mb-2 w-full max-w-3xl shrink-0 px-4 sm:px-6\"\n data-testid=\"queue-surface\"\n >\n <div className=\"overflow-hidden rounded-lg border border-border bg-surface/80 shadow-sm\">\n {queue.stoppingPreviousAttempt ? (\n <QueueStoppingStatus queue={queue} dividerAfter={hasError} />\n ) : null}\n {hasError ? <QueueErrorAlert queue={queue} /> : null}\n </div>\n </div>\n );\n}\n\nexport function QueueStoppingStatus({\n queue,\n dividerAfter = false,\n}: QueueStateProps & { dividerAfter?: boolean }) {\n return (\n <div\n role=\"status\"\n aria-live=\"polite\"\n className={`flex min-h-11 items-center gap-2.5 bg-status-waiting/[0.07] px-3 py-2 text-xs text-fg ${\n dividerAfter ? \"border-b border-status-waiting/20\" : \"\"\n }`}\n data-testid=\"stopping-previous-attempt\"\n >\n <Loader2Icon\n aria-hidden=\"true\"\n className=\"size-3.5 shrink-0 animate-spin text-status-waiting motion-reduce:animate-none\"\n />\n <span className=\"min-w-0\">\n <span className=\"font-medium\">\n {queue.effectiveControl?.state === \"paused\"\n ? \"Stopping current attempt…\"\n : \"Stopping previous attempt…\"}\n </span>{\" \"}\n <span className=\"text-fg-muted\">\n {queue.effectiveControl?.state === \"paused\"\n ? \"Queued work stays saved until you resume.\"\n : \"Queued work is saved and starts automatically.\"}\n </span>\n </span>\n </div>\n );\n}\n\nexport function QueueErrorAlert({\n queue,\n dividerBefore = false,\n}: QueueStateProps & { dividerBefore?: boolean }) {\n return (\n <div className={`${dividerBefore ? \"border-t border-border\" : \"\"} p-2`}>\n <div\n role=\"alert\"\n className=\"flex min-w-0 max-w-full flex-wrap items-start gap-2 rounded-md bg-status-failed/10 px-2 py-1.5 text-xs text-status-failed\"\n >\n <span\n role=\"region\"\n aria-label=\"Queue error details\"\n tabIndex={0}\n className=\"max-h-[min(5rem,20dvh)] min-w-0 max-w-full flex-[1_1_5rem] overflow-auto overscroll-contain whitespace-pre-wrap rounded-sm outline-none [overflow-wrap:anywhere] [unicode-bidi:plaintext] focus-visible:ring-2 focus-visible:ring-ring/40\"\n data-testid=\"queue-error-message\"\n dir=\"auto\"\n >\n {(queue.mutationError ?? queue.error)?.message}\n </span>\n <button\n type=\"button\"\n onClick={() => {\n queue.clearMutationError();\n void queue.refresh();\n }}\n aria-label=\"Dismiss queue error and retry\"\n title=\"Retry loading the queue\"\n className=\"ms-auto inline-flex size-7 shrink-0 items-center justify-center self-start rounded-md outline-none transition-colors hover:bg-surface-3 focus-visible:ring-2 focus-visible:ring-ring/40 motion-reduce:transition-none pointer-coarse:size-[44px]\"\n >\n <RotateCwIcon className=\"size-3.5\" />\n </button>\n </div>\n </div>\n );\n}\n"],"mappings":";AAOO,SAAS,sBACd,UACA,oBACA,iBACM;AACN,MAAI,SAAS,gBAAgB,GAAG;AAC9B,uBAAmB;AAAA,EACrB,OAAO;AACL,oBAAgB;AAAA,EAClB;AACF;;;ACjBA,SAAS,aAAa,oBAAoB;AAepC,SAEI,KAFJ;AAPC,SAAS,uBAAuB,EAAE,MAAM,GAAoB;AACjE,QAAM,WAAW,QAAQ,MAAM,SAAS,MAAM,aAAa;AAC3D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,eAAY;AAAA,MAEZ,+BAAC,SAAI,WAAU,2EACZ;AAAA,cAAM,0BACL,oBAAC,uBAAoB,OAAc,cAAc,UAAU,IACzD;AAAA,QACH,WAAW,oBAAC,mBAAgB,OAAc,IAAK;AAAA,SAClD;AAAA;AAAA,EACF;AAEJ;AAEO,SAAS,oBAAoB;AAAA,EAClC;AAAA,EACA,eAAe;AACjB,GAAiD;AAC/C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,aAAU;AAAA,MACV,WAAW,yFACT,eAAe,sCAAsC,EACvD;AAAA,MACA,eAAY;AAAA,MA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