@runtypelabs/persona 4.23.1 → 4.24.0

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 (158) hide show
  1. package/dist/animations/glyph-cycle.d.cts +1 -1
  2. package/dist/animations/glyph-cycle.d.ts +1 -1
  3. package/dist/animations/{types-9Vxm-PPz.d.cts → types-Db61aI9J.d.cts} +25 -2
  4. package/dist/animations/{types-9Vxm-PPz.d.ts → types-Db61aI9J.d.ts} +25 -2
  5. package/dist/animations/wipe.d.cts +1 -1
  6. package/dist/animations/wipe.d.ts +1 -1
  7. package/dist/animations-extra.d.cts +25 -2
  8. package/dist/animations-extra.d.ts +25 -2
  9. package/dist/approval-ui-3NMYNXBD.js +1 -0
  10. package/dist/approval-ui.cjs +2 -2
  11. package/dist/approval-ui.d.cts +261 -40
  12. package/dist/approval-ui.d.ts +261 -40
  13. package/dist/approval-ui.js +2 -2
  14. package/dist/{artifacts-ui-F4N6VMKF.js → artifacts-ui-IGB5YKLO.js} +4 -4
  15. package/dist/artifacts-ui.d.cts +256 -28
  16. package/dist/artifacts-ui.d.ts +256 -28
  17. package/dist/{chunk-NIKYKSNZ.js → chunk-7CO4T5KB.js} +1 -1
  18. package/dist/codegen.cjs +11 -11
  19. package/dist/codegen.js +13 -13
  20. package/dist/context-mentions.d.cts +256 -28
  21. package/dist/context-mentions.d.ts +256 -28
  22. package/dist/event-stream-view.d.cts +256 -28
  23. package/dist/event-stream-view.d.ts +256 -28
  24. package/dist/forms-ui.d.cts +291 -30
  25. package/dist/forms-ui.d.ts +291 -30
  26. package/dist/history-view.d.cts +25 -2
  27. package/dist/history-view.d.ts +25 -2
  28. package/dist/index.cjs +70 -69
  29. package/dist/index.cjs.map +1 -1
  30. package/dist/index.d.cts +337 -51
  31. package/dist/index.d.ts +337 -51
  32. package/dist/index.global.js +57 -54
  33. package/dist/index.global.js.map +1 -1
  34. package/dist/index.js +70 -69
  35. package/dist/index.js.map +1 -1
  36. package/dist/install.global.js +1 -1
  37. package/dist/install.global.js.map +1 -1
  38. package/dist/launcher.global.js +2 -2
  39. package/dist/launcher.global.js.map +1 -1
  40. package/dist/session-reconnect.d.cts +256 -28
  41. package/dist/session-reconnect.d.ts +256 -28
  42. package/dist/smart-dom-reader.d.cts +256 -28
  43. package/dist/smart-dom-reader.d.ts +256 -28
  44. package/dist/theme-editor-preview.cjs +74 -73
  45. package/dist/theme-editor-preview.d.cts +263 -28
  46. package/dist/theme-editor-preview.d.ts +263 -28
  47. package/dist/theme-editor-preview.js +51 -50
  48. package/dist/theme-editor.cjs +10 -10
  49. package/dist/theme-editor.d.cts +276 -30
  50. package/dist/theme-editor.d.ts +276 -30
  51. package/dist/theme-editor.js +10 -10
  52. package/dist/theme-reference.cjs +1 -1
  53. package/dist/theme-reference.d.cts +1522 -11
  54. package/dist/theme-reference.d.ts +1522 -11
  55. package/dist/theme-reference.js +1 -1
  56. package/dist/widget.css +1 -1
  57. package/package.json +3 -2
  58. package/src/__fixtures__/defaults-parity.v4.json +776 -0
  59. package/src/approval-ui-entry.ts +0 -1
  60. package/src/approval-ui-loader.ts +5 -4
  61. package/src/approval-ui.ts +0 -1
  62. package/src/client-identity-proof.test.ts +193 -0
  63. package/src/client-session-warm.test.ts +216 -0
  64. package/src/client-visitor-history.test.ts +6 -0
  65. package/src/client.tool-pair-replay.test.ts +325 -0
  66. package/src/client.ts +154 -61
  67. package/src/codegen.test.ts +24 -0
  68. package/src/components/activity-row.test.ts +100 -0
  69. package/src/components/activity-row.ts +136 -0
  70. package/src/components/approval-actions.test.ts +8 -5
  71. package/src/components/approval-actions.ts +19 -6
  72. package/src/components/approval-bubble.test.ts +56 -9
  73. package/src/components/approval-bubble.ts +36 -41
  74. package/src/components/composer-builder.ts +5 -2
  75. package/src/components/composer-parts.ts +10 -2
  76. package/src/components/header-builder.test.ts +32 -0
  77. package/src/components/header-builder.ts +7 -4
  78. package/src/components/header-layouts.test.ts +12 -0
  79. package/src/components/header-layouts.ts +3 -2
  80. package/src/components/launcher.ts +11 -2
  81. package/src/components/message-bubble.test.ts +22 -0
  82. package/src/components/message-bubble.ts +7 -3
  83. package/src/components/panel.test.ts +52 -1
  84. package/src/components/panel.ts +47 -8
  85. package/src/components/pill-composer-builder.test.ts +2 -0
  86. package/src/components/pill-composer-builder.ts +0 -1
  87. package/src/components/reasoning-bubble.ts +29 -17
  88. package/src/components/suggestions.test.ts +1 -0
  89. package/src/components/suggestions.ts +0 -16
  90. package/src/components/tool-bubble.ts +131 -114
  91. package/src/components/tool-details.test.ts +87 -0
  92. package/src/components/tool-details.ts +102 -0
  93. package/src/components/welcome.test.ts +8 -0
  94. package/src/components/welcome.ts +4 -2
  95. package/src/defaults-parity.test.ts +158 -0
  96. package/src/defaults.test.ts +69 -0
  97. package/src/defaults.ts +128 -49
  98. package/src/generated/runtype-openapi-contract.ts +28 -13
  99. package/src/index-core.ts +2 -0
  100. package/src/install.test.ts +24 -0
  101. package/src/install.ts +3 -1
  102. package/src/launcher-global.ts +2 -1
  103. package/src/launcher-variants.test.ts +52 -0
  104. package/src/runtime/init-update-reset.test.ts +21 -0
  105. package/src/session.ts +61 -9
  106. package/src/styles/widget-styles.test.ts +19 -0
  107. package/src/styles/widget.css +295 -23
  108. package/src/theme-editor/index.ts +2 -0
  109. package/src/theme-editor/preview-utils.test.ts +8 -0
  110. package/src/theme-editor/preview-utils.ts +7 -3
  111. package/src/theme-editor/sections.test.ts +31 -0
  112. package/src/theme-editor/sections.ts +55 -1
  113. package/src/theme-editor/state-preferences.test.ts +49 -0
  114. package/src/theme-editor/state.ts +73 -15
  115. package/src/theme-reference.test.ts +20 -0
  116. package/src/theme-reference.ts +11 -5
  117. package/src/tool-call-display-defaults.test.ts +33 -1
  118. package/src/types/theme.ts +80 -3
  119. package/src/types.ts +179 -23
  120. package/src/ui.activity-row.test.ts +91 -0
  121. package/src/ui.approval-plugin.test.ts +63 -0
  122. package/src/ui.composer-compact.test.ts +24 -2
  123. package/src/ui.composer-placement.test.ts +23 -0
  124. package/src/ui.detached-panel.test.ts +33 -6
  125. package/src/ui.docked.test.ts +19 -0
  126. package/src/ui.header-update-stability.test.ts +25 -0
  127. package/src/ui.identity-proof.test.ts +58 -0
  128. package/src/ui.launcher-teaser.test.ts +25 -0
  129. package/src/ui.message-width.test.ts +17 -2
  130. package/src/ui.reasoning-display.test.ts +92 -0
  131. package/src/ui.rebuild-composer.test.ts +20 -3
  132. package/src/ui.scroll.test.ts +32 -0
  133. package/src/ui.session-init.test.ts +312 -0
  134. package/src/ui.status-indicator.test.ts +82 -0
  135. package/src/ui.suggest-replies.test.ts +11 -0
  136. package/src/ui.ts +363 -74
  137. package/src/ui.v5-defaults.test.ts +144 -0
  138. package/src/ui.welcome.test.ts +92 -3
  139. package/src/utils/__snapshots__/tokens-parity.test.ts.snap +811 -140
  140. package/src/utils/code-generators.ts +14 -0
  141. package/src/utils/composer-compact.test.ts +0 -2
  142. package/src/utils/composer-compact.ts +2 -4
  143. package/src/utils/composer-placement.ts +2 -3
  144. package/src/utils/config-merge.test.ts +81 -5
  145. package/src/utils/config-merge.ts +13 -3
  146. package/src/utils/defaults-provenance.ts +67 -0
  147. package/src/utils/dock.ts +7 -1
  148. package/src/utils/launcher-variant.ts +16 -0
  149. package/src/utils/panel-config.ts +97 -0
  150. package/src/utils/status-indicator.ts +39 -0
  151. package/src/utils/theme.test.ts +182 -0
  152. package/src/utils/theme.ts +131 -18
  153. package/src/utils/tokens.test.ts +122 -1
  154. package/src/utils/tokens.ts +177 -17
  155. package/src/utils/tool-pair-replay.ts +100 -0
  156. package/src/welcome.test.ts +23 -0
  157. package/src/welcome.ts +16 -9
  158. package/dist/approval-ui-K7R5Q5OC.js +0 -1
@@ -1,4 +1,4 @@
1
- var _="min(440px, calc(100vw - 24px))",oe="440px",Oe="How can I help...",io={enabled:!0,mountMode:"floating",dock:{side:"right",width:"420px"},title:"Chat Assistant",subtitle:"Here to help you get answers fast",agentIconText:"\u{1F4AC}",agentIconName:"bot",headerIconName:"bot",position:"bottom-right",width:_,heightOffset:0,autoExpand:!1,callToActionIconHidden:!1,agentIconSize:"40px",headerIconSize:"40px",closeButtonPaddingX:"0px",closeButtonPaddingY:"0px",callToActionIconName:"arrow-up-right",callToActionIconText:"",callToActionIconSize:"32px",callToActionIconPadding:"5px",callToActionIconColor:void 0,callToActionIconBackgroundColor:void 0,closeButtonBackgroundColor:"transparent",clearChat:{backgroundColor:"transparent",borderColor:"transparent",enabled:!0,placement:"inline",iconName:"refresh-cw",showTooltip:!0,tooltipText:"Clear chat",paddingX:"0px",paddingY:"0px"},headerIconHidden:!1,border:void 0,shadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)"},M={apiUrl:"https://api.runtype.com/api/chat/dispatch",clientToken:void 0,agentId:void 0,target:void 0,theme:void 0,darkTheme:void 0,colorScheme:"light",tooltip:{delayMs:200,skipDelayMs:300},launcher:io,copy:{inputPlaceholder:Oe,sendButtonLabel:"Send"},sendButton:{borderWidth:"0px",paddingX:"12px",paddingY:"10px",borderColor:void 0,useIcon:!0,iconText:"\u2191",showTooltip:!0,tooltipText:"Send message",iconName:"send"},statusIndicator:{visible:!0,idleText:"Online",connectingText:"Connecting\u2026",connectedText:"Streaming\u2026",errorText:"Offline"},voiceRecognition:{enabled:!0,pauseDuration:2e3,iconName:"mic",borderWidth:"0px",iconColor:void 0,backgroundColor:"transparent",borderColor:"transparent",recordingIconColor:void 0,recordingBackgroundColor:void 0,recordingBorderColor:"transparent",showTooltip:!0,tooltipText:"Start voice recognition"},features:{showReasoning:!0,showToolCalls:!0,scrollToBottom:{enabled:!0,iconName:"arrow-down",label:""},scrollBehavior:{mode:"anchor-top",anchorTopOffset:16,showActivityWhilePinned:!0},toolCallDisplay:{collapsedMode:"tool-call",activePreview:!1,grouped:!1,groupedMode:"stack",previewMaxLines:3,expandable:!0,loadingAnimation:"none"},reasoningDisplay:{activePreview:!1,previewMaxLines:3,expandable:!0,loadingAnimation:"none"},streamAnimation:{type:"none",placeholder:"none",speed:120,duration:1800},askUserQuestion:{enabled:!0,slideInMs:180,freeTextLabel:"Other\u2026",freeTextPlaceholder:"Type your answer\u2026",submitLabel:"Send"},history:{enabled:!1,presentation:"panel",showScopeStatus:!0,showDelete:!0,showDeleteAll:!0}},suggestionChips:["Show me what you can help with","Walk me through getting started","Answer a question about this page"],suggestionChipsConfig:{fontFamily:"sans-serif",fontWeight:"500",paddingX:"12px",paddingY:"6px"},layout:{header:{layout:"default",showIcon:!0,showTitle:!0,showSubtitle:!0,showCloseButton:!0,showClearChat:!0},messages:{layout:"bubble",avatar:{show:!1,position:"left"},timestamp:{show:!1,position:"below"},groupConsecutive:!1},slots:{}},markdown:{options:{gfm:!0,breaks:!0},disableDefaultStyles:!1},messageActions:{enabled:!0,showCopy:!0,showUpvote:!1,showDownvote:!1,visibility:"hover",align:"right",layout:"pill-inside"},debug:!1};var Le="16px",_e="transparent",lo=(()=>{let e={};for(let t of[0,1,2,3,4,5,6,8,10,12,16,20,24,32,40,48,56,64])e[t]=t===0?"0px":`${t/4}rem`;return e})(),co={colors:{primary:{50:"#ffffff",100:"#f5f5f5",200:"#d4d4d4",300:"#a3a3a3",400:"#737373",500:"#171717",600:"#0f0f0f",700:"#0a0a0a",800:"#050505",900:"#030303",950:"#000000"},secondary:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},accent:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},success:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},warning:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},error:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},info:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"}},spacing:lo,typography:{fontFamily:{sans:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',serif:'Georgia, Cambria, "Times New Roman", Times, serif',mono:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},fontSize:{xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem"},fontWeight:{normal:"400",medium:"500",semibold:"600",bold:"700"},lineHeight:{tight:"1.25",normal:"1.5",relaxed:"1.625"}},shadows:{none:"none",sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)"},borders:{none:"none",sm:"1px solid",md:"2px solid",lg:"4px solid"},radius:{none:"0px",sm:"0.125rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem",full:"9999px"}},po={colors:{primary:"palette.colors.primary.500",secondary:"palette.colors.secondary.500",accent:"palette.colors.primary.600",surface:"palette.colors.gray.50",background:"palette.colors.gray.50",container:"palette.colors.gray.50",text:"palette.colors.gray.900",textMuted:"palette.colors.gray.500",textInverse:"palette.colors.gray.50",border:"palette.colors.gray.200",divider:"palette.colors.gray.200",interactive:{default:"palette.colors.primary.600",hover:"palette.colors.primary.700",focus:"palette.colors.primary.600",active:"palette.colors.primary.600",disabled:"palette.colors.gray.300"},feedback:{success:"palette.colors.success.500",warning:"palette.colors.warning.500",error:"palette.colors.error.500",info:"palette.colors.info.500"}},spacing:{xs:"palette.spacing.1",sm:"palette.spacing.2",md:"palette.spacing.4",lg:"palette.spacing.6",xl:"palette.spacing.8","2xl":"palette.spacing.10"},typography:{fontFamily:"palette.typography.fontFamily.sans",fontSize:"palette.typography.fontSize.base",fontWeight:"palette.typography.fontWeight.normal",lineHeight:"palette.typography.lineHeight.normal"}},uo={button:{primary:{background:"palette.colors.primary.500",foreground:"palette.colors.primary.50",borderRadius:"palette.radius.lg",padding:"semantic.spacing.md"},secondary:{background:"semantic.colors.surface",foreground:"semantic.colors.secondary",borderRadius:"palette.radius.lg",padding:"semantic.spacing.md"},ghost:{background:"transparent",foreground:"semantic.colors.text",borderRadius:"palette.radius.md",padding:"semantic.spacing.sm",hoverBackground:"rgba(0, 0, 0, 0.05)"}},input:{background:"semantic.colors.surface",placeholder:"semantic.colors.textMuted",borderRadius:"palette.radius.lg",padding:"semantic.spacing.md",focus:{border:"palette.colors.gray.400",ring:"palette.colors.gray.400"}},launcher:{background:"semantic.colors.surface",foreground:"semantic.colors.primary",border:"semantic.colors.border",size:"60px",iconSize:"28px",borderRadius:"palette.radius.full",shadow:"palette.shadows.lg"},panel:{width:_,maxWidth:oe,height:"600px",maxHeight:"calc(100vh - 80px)",borderRadius:"palette.radius.xl",shadow:"palette.shadows.xl",inset:Le,canvasBackground:_e},header:{background:"palette.colors.primary.500",foreground:"palette.colors.primary.50",borderRadius:"palette.radius.xl palette.radius.xl 0 0",padding:"semantic.spacing.md",iconBackground:"palette.colors.primary.600",iconForeground:"palette.colors.primary.50"},message:{user:{background:"palette.colors.primary.500",text:"palette.colors.primary.50",borderRadius:"palette.radius.lg",shadow:"palette.shadows.sm"},assistant:{background:"semantic.colors.container",text:"semantic.colors.text",borderRadius:"palette.radius.lg",border:"semantic.colors.border",shadow:"palette.shadows.sm"},border:"semantic.colors.border"},introCard:{background:"transparent",borderRadius:"palette.radius.2xl",padding:"semantic.spacing.lg",shadow:"palette.shadows.none"},suggestion:{chip:{background:"semantic.colors.surface",foreground:"semantic.colors.text",border:"semantic.colors.border",borderRadius:"palette.radius.full",padding:"0.5rem 0.875rem",gap:"0.5rem",itemGap:"8px",minHeight:"36px",fontSize:"0.8125rem",lineHeight:"1.25",iconSize:"16px",hoverBackground:"palette.colors.gray.100",hoverBorder:"palette.colors.gray.300",pressedBackground:"palette.colors.gray.200",focusRing:"semantic.colors.interactive.focus",disabledOpacity:"0.5"},card:{background:"semantic.colors.surface",foreground:"semantic.colors.text",border:"semantic.colors.border",borderRadius:"palette.radius.xl",padding:"1rem",shadow:"palette.shadows.sm",gap:"0.625rem",itemGap:"8px",minHeight:"72px",fontSize:"0.875rem",lineHeight:"1.35",iconSize:"18px",hoverBackground:"palette.colors.gray.100",hoverBorder:"palette.colors.gray.300",pressedBackground:"palette.colors.gray.200",focusRing:"semantic.colors.interactive.focus",disabledOpacity:"0.5"},list:{background:"transparent",foreground:"semantic.colors.text",border:"semantic.colors.border",borderRadius:"palette.radius.md",padding:"0.75rem",gap:"0.625rem",itemGap:"8px",minHeight:"44px",fontSize:"0.875rem",lineHeight:"1.35",iconSize:"17px",hoverBackground:"palette.colors.gray.100",hoverBorder:"palette.colors.gray.300",pressedBackground:"palette.colors.gray.200",focusRing:"semantic.colors.interactive.focus",disabledOpacity:"0.5"}},toolBubble:{shadow:"palette.shadows.sm"},reasoningBubble:{shadow:"palette.shadows.sm"},composer:{shadow:"palette.shadows.none"},scrollbar:{thumb:"semantic.colors.border",track:"transparent"},markdown:{inlineCode:{background:"palette.colors.gray.50",foreground:"palette.colors.gray.900"},link:{foreground:"palette.colors.primary.600"},prose:{fontFamily:"inherit"},codeBlock:{background:"semantic.colors.container",borderColor:"semantic.colors.border",textColor:"inherit",borderRadius:"palette.radius.md"},table:{headerBackground:"semantic.colors.container",borderColor:"semantic.colors.border"},hr:{color:"semantic.colors.divider"},blockquote:{borderColor:"palette.colors.gray.900",background:"transparent",textColor:"palette.colors.gray.500"}},collapsibleWidget:{container:"palette.colors.gray.50",surface:"semantic.colors.surface",border:"semantic.colors.border"},voice:{recording:{indicator:"palette.colors.error.500",background:"palette.colors.error.50",border:"palette.colors.error.200"},processing:{icon:"palette.colors.primary.500",background:"palette.colors.primary.50"},speaking:{icon:"palette.colors.success.500"}},approval:{requested:{background:"semantic.colors.surface",border:"semantic.colors.border",text:"palette.colors.gray.900",shadow:"0 1px 2px 0 rgba(11, 11, 11, 0.06), 0 2px 8px 0 rgba(11, 11, 11, 0.04)"},approve:{background:"semantic.colors.primary",foreground:"semantic.colors.textInverse",borderRadius:"palette.radius.md",padding:"semantic.spacing.sm"},deny:{background:"semantic.colors.container",foreground:"semantic.colors.text",borderRadius:"palette.radius.md",padding:"semantic.spacing.sm"}},attachment:{image:{background:"palette.colors.gray.100",border:"palette.colors.gray.200"}},eventStream:{badge:{flow:{background:"palette.colors.success.100",foreground:"palette.colors.success.700"},step:{background:"palette.colors.primary.100",foreground:"palette.colors.primary.700"},reasoning:{background:"palette.colors.warning.100",foreground:"palette.colors.warning.700"},tool:{background:"palette.colors.purple.100",foreground:"palette.colors.purple.800"},agent:{background:"palette.colors.teal.100",foreground:"palette.colors.teal.800"},error:{background:"palette.colors.error.100",foreground:"palette.colors.error.700"},default:{background:"palette.colors.gray.100",foreground:"palette.colors.gray.600"}}},scrollToBottom:{background:"components.button.primary.background",foreground:"components.button.primary.foreground",border:"semantic.colors.primary",size:"40px",borderRadius:"palette.radius.full",shadow:"palette.shadows.sm",padding:"0.5rem 0.875rem",gap:"0.5rem",fontSize:"0.875rem",iconSize:"14px"},artifact:{pane:{background:"semantic.colors.container",toolbarBackground:"semantic.colors.container"}}};function go(e){let t=[],o=[];return e.palette||t.push({path:"palette",message:"Theme must include a palette",severity:"error"}),e.semantic||o.push({path:"semantic",message:"No semantic tokens defined - defaults will be used",severity:"warning"}),e.components||o.push({path:"components",message:"No component tokens defined - defaults will be used",severity:"warning"}),{valid:t.length===0,errors:t,warnings:o}}function st(e,t){let o={...e};for(let[a,r]of Object.entries(t)){let n=o[a];n&&typeof n=="object"&&!Array.isArray(n)&&r&&typeof r=="object"&&!Array.isArray(r)?o[a]=st(n,r):o[a]=r}return o}function mo(e,t){return t?st(e,t):e}function S(e,t={}){let o={palette:co,semantic:po,components:uo},a={palette:{...o.palette,...e?.palette,colors:{...o.palette.colors,...e?.palette?.colors},spacing:{...o.palette.spacing,...e?.palette?.spacing},typography:{...o.palette.typography,...e?.palette?.typography},shadows:{...o.palette.shadows,...e?.palette?.shadows},borders:{...o.palette.borders,...e?.palette?.borders},radius:{...o.palette.radius,...e?.palette?.radius}},semantic:{...o.semantic,...e?.semantic,colors:{...o.semantic.colors,...e?.semantic?.colors,interactive:{...o.semantic.colors.interactive,...e?.semantic?.colors?.interactive},feedback:{...o.semantic.colors.feedback,...e?.semantic?.colors?.feedback}},spacing:{...o.semantic.spacing,...e?.semantic?.spacing},typography:{...o.semantic.typography,...e?.semantic?.typography}},components:mo(o.components,e?.components)};if(t.validate!==!1){let r=go(a);if(!r.valid)throw new Error(`Theme validation failed: ${r.errors.map(n=>n.message).join(", ")}`)}if(t.plugins)for(let r of t.plugins)a=r.transform(a);return a}function Me(e,t){let o=t.split("."),a=e;for(let r of o){if(a==null)return;a=a[r]}return a}function D(e,t,o){let a=t.split(".");if(a.length===1)return{...e,[a[0]]:o};let[r,...n]=a,s=e;return{...s,[r]:D(s?.[r]??{},n.join("."),o)}}function ae(e,t){let o=t.split(".");if(o.length===1){let c={...e};return delete c[o[0]],c}let[a,...r]=o,n=e,s=ae(n?.[a]??{},r.join(".")),l={...n};return typeof s=="object"&&s!==null&&!Array.isArray(s)&&Object.keys(s).length===0?delete l[a]:l[a]=s,l}var Fe=class{constructor(t,o,a){this.listeners=[];this.history=[];this.historyIndex=-1;this.suppressHistory=!1;let r=a?.mergeDefaults??!0;this.config=r?{...M,...o}:o??M,this.theme=S(t,{validate:!1}),this.syncThemeIntoConfig(),this.pushHistorySnapshot(this.exportSnapshot(),!0)}get(t){return t.startsWith("theme.")?Me(this.theme,t.replace("theme.","")):t.startsWith("darkTheme.")?Me(this.config.darkTheme??{},t.replace("darkTheme.","")):Me(this.config,t)}getTheme(){return this.theme}getConfig(){return this.config}set(t,o){if(t.startsWith("theme.")){let a=t.replace("theme.","");this.theme=D(this.theme,a,o),this.syncThemeIntoConfig()}else if(t.startsWith("darkTheme.")){let a=t.replace("darkTheme.",""),r=this.config.darkTheme??S();this.config={...this.config,darkTheme:D(r,a,o)}}else this.config=D(this.config,t,o);this.recordHistory(),this.notifyListeners()}unset(t){if(t.startsWith("theme.")){let o=t.replace("theme.","");this.theme=ae(this.theme,o),this.syncThemeIntoConfig()}else if(t.startsWith("darkTheme.")){let o=t.replace("darkTheme.","");this.config={...this.config,darkTheme:ae(this.config.darkTheme??{},o)}}else this.config=ae(this.config,t);this.recordHistory(),this.notifyListeners()}setBatch(t){let o=!1,a=!1,r=!1;for(let[n,s]of Object.entries(t))if(n.startsWith("theme.")){let l=n.replace("theme.","");this.theme=D(this.theme,l,s),o=!0}else if(n.startsWith("darkTheme.")){let l=n.replace("darkTheme.",""),c=this.config.darkTheme??S();this.config={...this.config,darkTheme:D(c,l,s)},a=!0}else this.config=D(this.config,n,s),r=!0;o&&this.syncThemeIntoConfig(),(o||a||r)&&(this.recordHistory(),this.notifyListeners())}setTheme(t){this.theme=t,this.syncThemeIntoConfig(),this.recordHistory(),this.notifyListeners()}setFullConfig(t,o){this.config={...t},o&&(this.theme=o),this.syncThemeIntoConfig(),this.recordHistory(),this.notifyListeners()}importSnapshot(t){if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Snapshot must be a JSON object");let o=t;if("config"in o||"theme"in o||o.version===2){let r=o.config??this.config,n=S(o.theme??this.theme,{validate:!1});this.setFullConfig(r,n);return}let a=S(o,{validate:!1});this.setTheme(a)}resetToDefaults(){this.config={...M},this.theme=S(),this.syncThemeIntoConfig(),this.history=[],this.historyIndex=-1,this.pushHistorySnapshot(this.exportSnapshot()),this.notifyListeners()}canUndo(){return this.historyIndex>0}canRedo(){return this.historyIndex>=0&&this.historyIndex<this.history.length-1}getHistoryLength(){return this.history.length}getHistoryIndex(){return this.historyIndex}undo(){this.canUndo()&&(this.historyIndex-=1,this.restoreSnapshot(this.history[this.historyIndex]))}redo(){this.canRedo()&&(this.historyIndex+=1,this.restoreSnapshot(this.history[this.historyIndex]))}exportSnapshot(){return{version:2,config:{...this.config,theme:void 0},theme:this.theme}}onChange(t){return this.listeners.push(t),()=>{let o=this.listeners.indexOf(t);o>=0&&this.listeners.splice(o,1)}}syncThemeIntoConfig(){this.config={...this.config,theme:this.theme}}notifyListeners(){for(let t of this.listeners)t(this.config,this.theme)}recordHistory(){this.pushHistorySnapshot(this.exportSnapshot())}pushHistorySnapshot(t,o=!1){if(this.suppressHistory)return;let a=JSON.stringify(t),r=this.historyIndex>=0&&this.history[this.historyIndex]?JSON.stringify(this.history[this.historyIndex]):null;if(o&&this.historyIndex>=0){this.history[this.historyIndex]=t;return}a!==r&&(this.history=this.history.slice(0,this.historyIndex+1),this.history.push(t),this.historyIndex=this.history.length-1)}restoreSnapshot(t){this.suppressHistory=!0,this.config=t.config,this.theme=S(t.theme,{validate:!1}),this.syncThemeIntoConfig(),this.suppressHistory=!1,this.notifyListeners()}};function We(e){let t=e.trim();if(t==="9999px")return{value:100,unit:"px"};let o=t.match(/^([\d.]+)(px|rem)$/);if(!o){let a=parseFloat(t);return{value:isNaN(a)?0:a,unit:"px"}}return{value:parseFloat(o[1]),unit:o[2]}}function Ne(e,t){return t==="rem"?`${e}rem`:`${e}px`}function fo(e,t){return t==="rem"?e*16:e}function ho(e,t){return t==="rem"?e/16:e}function Y(e){if(!e)return"#000000";let t=e.trim().toLowerCase();return t==="transparent"?"transparent":t.startsWith("rgba")||t.startsWith("rgb")?t:t.startsWith("#")?t.length===4?`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`:t:`#${t}`}function He(e){return/^#[0-9A-Fa-f]{6}$/.test(e)}function $e(e){let t=e.trim().toLowerCase().match(/^rgba?\(([^)]+)\)$/);if(!t)return null;let o=t[1].split(",").map(c=>c.trim());if(o.length<3)return null;let a=c=>{let m=c.endsWith("%"),b=parseFloat(m?c.slice(0,-1):c);return Number.isFinite(b)?Math.max(0,Math.min(255,Math.round(m?b/100*255:b))):NaN},r=a(o[0]),n=a(o[1]),s=a(o[2]);if(!Number.isFinite(r)||!Number.isFinite(n)||!Number.isFinite(s))return null;let l=c=>c.toString(16).padStart(2,"0");return`#${l(r)}${l(n)}${l(s)}`}function re(e,t){let o=n=>{let s=Y(n),l=s.startsWith("rgb")?$e(s)??"#000000":s,c=[1,3,5].map(m=>{let b=parseInt(l.slice(m,m+2),16)/255;return b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4)});return .2126*c[0]+.7152*c[1]+.0722*c[2]},a=o(e),r=o(t);return(Math.max(a,r)+.05)/(Math.min(a,r)+.05)}function it(e){let t=Y(e),o=t.startsWith("rgb")?$e(t)??"#000000":t,a=parseInt(o.slice(1,3),16)/255,r=parseInt(o.slice(3,5),16)/255,n=parseInt(o.slice(5,7),16)/255,s=Math.max(a,r,n),l=Math.min(a,r,n),c=(s+l)/2;if(s===l)return{h:0,s:0,l:c};let m=s-l,b=c>.5?m/(2-s-l):m/(s+l),v;switch(s){case a:v=((r-n)/m+(r<n?6:0))/6;break;case r:v=((n-a)/m+2)/6;break;default:v=((a-r)/m+4)/6;break}return{h:v*360,s:b,l:c}}function lt(e,t,o){let a=(e%360+360)%360,r=(1-Math.abs(2*o-1))*t,n=r*(1-Math.abs(a/60%2-1)),s=o-r/2,l,c,m;a<60?[l,c,m]=[r,n,0]:a<120?[l,c,m]=[n,r,0]:a<180?[l,c,m]=[0,r,n]:a<240?[l,c,m]=[0,n,r]:a<300?[l,c,m]=[n,0,r]:[l,c,m]=[r,0,n];let b=v=>{let T=Math.round((v+s)*255).toString(16);return T.length===1?"0"+T:T};return`#${b(l)}${b(c)}${b(m)}`}function ze(e){let{h:t,s:o,l:a}=it(e),r={50:.97,100:.94,200:.87,300:.77,400:.64,500:a,600:Math.max(.05,a-.1),700:Math.max(.05,a-.2),800:Math.max(.05,a-.28),900:Math.max(.05,a-.35),950:Math.max(.03,a-.42)},n={50:Math.min(1,o*.85),100:Math.min(1,o*.9),200:Math.min(1,o*.95),300:o,400:o,500:o,600:Math.min(1,o*1.05),700:Math.min(1,o*1.05),800:Math.min(1,o*1),900:Math.min(1,o*.95),950:Math.min(1,o*.9)},s={};for(let[l,c]of Object.entries(r)){let m=n[l];s[l]=lt(t,m,c)}return s}var F=["50","100","200","300","400","500","600","700","800","900","950"],Ue=["primary","secondary","accent","gray","success","warning","error","info"];function bo(e,t){return`palette.colors.${e}.${t}`}function ct(e,t,o=0){if(o>5)return"#cbd5e1";let a=e(t);return typeof a!="string"?"#cbd5e1":a.startsWith("#")||a.startsWith("rgb")||a==="transparent"?a:a.startsWith("palette.")||a.startsWith("semantic.")||a.startsWith("components.")?ct(e,`theme.${a}`,o+1):"#cbd5e1"}function yo(e){if(!e.startsWith("palette.")&&!e.startsWith("semantic."))return e;let t=e.split(".");if(t[0]==="palette"&&t[1]==="colors"){let o=t[2],a=t[3];return`${o.charAt(0).toUpperCase()+o.slice(1)} ${a}`}return t[0]==="semantic"?t.slice(1).map(o=>o.charAt(0).toUpperCase()+o.slice(1)).join(" "):t[t.length-1]}var C=[{id:"solid",label:"Solid"},{id:"soft",label:"Soft"}],ne=["primary","secondary","accent","gray"],ko={primary:"Primary",secondary:"Secondary",accent:"Accent",gray:"Neutral"},se={roleId:"role-surfaces",helper:"Page and panel backgrounds",previewZone:"container",intensities:C,targets:[{path:"semantic.colors.background",kind:"background"},{path:"semantic.colors.surface",kind:"background"},{path:"semantic.colors.container",kind:"background"}]},ie={roleId:"role-header",helper:"Widget header bar",previewZone:"header",intensities:C,targets:[{path:"components.header.background",kind:"background"},{path:"components.header.foreground",kind:"foreground"},{path:"components.header.border",kind:"border"},{path:"components.header.iconBackground",kind:"accent"},{path:"components.header.iconForeground",kind:"foreground"},{path:"components.header.titleForeground",kind:"accent"},{path:"components.header.subtitleForeground",kind:"foreground"},{path:"components.header.actionIconForeground",kind:"foreground"}]},le={roleId:"role-user-messages",helper:"User chat bubbles",previewZone:"user-message",intensities:C,targets:[{path:"components.message.user.background",kind:"background"},{path:"components.message.user.text",kind:"foreground"}]},ce={roleId:"role-assistant-messages",helper:"Assistant chat bubbles",previewZone:"assistant-message",intensities:C,targets:[{path:"components.message.assistant.background",kind:"background"},{path:"components.message.assistant.text",kind:"foreground"}]},de={roleId:"role-primary-actions",helper:"Send button and primary buttons",intensities:C,targets:[{path:"components.button.primary.background",kind:"background"},{path:"components.button.primary.foreground",kind:"foreground"},{path:"semantic.colors.interactive.default",kind:"accent"},{path:"semantic.colors.interactive.hover",kind:"accent"}]},pe={roleId:"role-scroll-to-bottom",helper:"Scroll-to-bottom affordances in transcript and event stream",intensities:C,targets:[{path:"components.scrollToBottom.background",kind:"background"},{path:"components.scrollToBottom.foreground",kind:"foreground"},{path:"components.scrollToBottom.border",kind:"border"}]},ue={roleId:"role-input",helper:"Message input field",previewZone:"composer",intensities:C,targets:[{path:"components.input.background",kind:"background"},{path:"components.input.placeholder",kind:"foreground"},{path:"components.input.focus.border",kind:"accent"},{path:"components.input.focus.ring",kind:"accent"}]},ge={roleId:"role-links-focus",helper:"Links, focus rings, and interactive highlights",intensities:C,targets:[{path:"semantic.colors.accent",kind:"accent"},{path:"semantic.colors.interactive.focus",kind:"accent"},{path:"semantic.colors.interactive.active",kind:"accent"},{path:"components.markdown.link.foreground",kind:"accent"}]},me={roleId:"role-borders",helper:"Borders, dividers, and separators",intensities:C,targets:[{path:"semantic.colors.border",kind:"border"},{path:"semantic.colors.divider",kind:"border"}]},V=[se,ie,le,ce,de,pe,ue,ge,me];function fe(e,t,o){let a={},r=e==="neutral"?"gray":e;for(let n of o.targets){let s=wo(r,t,n,o.roleId);a[`theme.${n.path}`]=s,a[`darkTheme.${n.path}`]=s}if(o.roleId==="role-primary-actions"){let n=t==="solid"?`palette.colors.${r}.700`:`palette.colors.${r}.200`;a["theme.semantic.colors.interactive.hover"]=n,a["darkTheme.semantic.colors.interactive.hover"]=n}return a}function wo(e,t,o,a){let r=t==="solid";if(a==="role-header")return vo(e,r,o);if(a==="role-input")return So(e,r,o);switch(o.kind){case"background":return r?`palette.colors.${e}.500`:`palette.colors.${e}.${e==="gray"?"50":"100"}`;case"foreground":return r?`palette.colors.${e==="gray"?"gray":e}.50`:`palette.colors.${e==="gray"?"gray":e}.900`;case"border":return r?`palette.colors.${e}.600`:`palette.colors.${e}.200`;case"accent":return r?`palette.colors.${e}.600`:`palette.colors.${e}.400`}}function vo(e,t,o){let a=o.path;return a.endsWith(".background")?t?`palette.colors.${e}.500`:`palette.colors.${e}.${e==="gray"?"50":"100"}`:a.endsWith(".border")?t?`palette.colors.${e}.600`:`palette.colors.${e}.200`:a.endsWith(".iconBackground")?t?`palette.colors.${e}.${e==="gray"?"700":"600"}`:`palette.colors.${e}.500`:a.endsWith(".iconForeground")?t?`palette.colors.${e}.50`:`palette.colors.${e}.50`:a.endsWith(".foreground")||a.endsWith(".titleForeground")?t?`palette.colors.${e}.50`:`palette.colors.${e}.${e==="gray"?"900":"700"}`:a.endsWith(".subtitleForeground")?t?`palette.colors.${e}.200`:`palette.colors.${e}.500`:a.endsWith(".actionIconForeground")?t?`palette.colors.${e}.200`:`palette.colors.${e}.500`:`palette.colors.${e}.500`}function So(e,t,o){let a=o.path;return a.endsWith(".background")?t?`palette.colors.${e}.${e==="gray"?"100":"50"}`:`palette.colors.${e}.50`:a.endsWith(".placeholder")?`palette.colors.${e}.400`:a.endsWith(".border")||a.endsWith(".ring")?t?`palette.colors.${e}.500`:`palette.colors.${e}.400`:`palette.colors.${e}.500`}var xo=/^palette\.colors\.(\w+)\.(\d+)$/;function je(e,t){let o=t.targets.find(l=>l.kind==="background")??t.targets[0];if(!o)return null;let r=String(e(o.path)??"").match(xo);if(!r)return null;let n=r[1],s=ne.includes(n)?n:null;if(!s)return null;for(let l of["solid","soft"]){let c=fe(s,l,t);if(t.targets.every(b=>String(e(b.path)??"")===c[`theme.${b.path}`]))return{family:s,intensity:l}}return null}var k=e=>String(e??"").trim()||void 0,dt=e=>typeof e=="number"?`${e}px`:String(e??"").trim(),gt=e=>String(e??"").trim(),To={id:"theme-mode",title:"Runtime Theme",description:"Controls how the shipped widget picks light or dark mode.",collapsed:!1,fields:[{id:"theme-mode",label:"Runtime Theme",description:"Always Light, Always Dark, or follow the visitor system preference",type:"select",path:"colorScheme",defaultValue:"auto",options:[{value:"light",label:"Light"},{value:"dark",label:"Dark"},{value:"auto",label:"Follow System"}]}]},Co={id:"brand-colors",title:"Brand Colors",description:"Pick your brand colors. A full shade scale is generated automatically for both light and dark themes.",collapsed:!1,fields:[{id:"brand-primary",label:"Primary",description:"Main brand color for buttons, links, and accents",type:"color",path:"theme.palette.colors.primary.500",defaultValue:"#171717"},{id:"brand-secondary",label:"Secondary",description:"Supporting brand color",type:"color",path:"theme.palette.colors.secondary.500",defaultValue:"#7c3aed"},{id:"brand-accent",label:"Accent",description:"Highlight and decorative color",type:"color",path:"theme.palette.colors.accent.500",defaultValue:"#06b6d4"}]},Ro={id:"chat-colors",title:"Chat Colors",description:"Customize the main colors of the chat interface.",collapsed:!0,fields:[{id:"chat-header-bg",label:"Header Background",type:"token-ref",path:"theme.components.header.background",defaultValue:"semantic.colors.surface",tokenRef:{tokenType:"color"}},{id:"chat-header-fg",label:"Header Foreground",description:"Anchors the header text. The title takes it, the subtitle and button icons take a 72% mix of it over the background",type:"token-ref",path:"theme.components.header.foreground",defaultValue:"",tokenRef:{tokenType:"color"}},{id:"chat-header-icon-bg",label:"Header Icon Background",type:"token-ref",path:"theme.components.header.iconBackground",defaultValue:"semantic.colors.primary",tokenRef:{tokenType:"color"}},{id:"chat-header-icon-fg",label:"Header Icon Color",type:"token-ref",path:"theme.components.header.iconForeground",defaultValue:"semantic.colors.textInverse",tokenRef:{tokenType:"color"}},{id:"chat-header-title-fg",label:"Header Title Color",description:"Blank follows the header foreground",type:"token-ref",path:"theme.components.header.titleForeground",defaultValue:"",tokenRef:{tokenType:"color"}},{id:"chat-header-subtitle-fg",label:"Header Subtitle Color",description:"Blank follows the 72% foreground mix",type:"token-ref",path:"theme.components.header.subtitleForeground",defaultValue:"",tokenRef:{tokenType:"color"}},{id:"chat-header-action-icons-fg",label:"Header Button Icons",description:"Blank follows the 72% foreground mix",type:"token-ref",path:"theme.components.header.actionIconForeground",defaultValue:"",tokenRef:{tokenType:"color"}},{id:"chat-msg-user-bg",label:"User Message Background",type:"token-ref",path:"theme.components.message.user.background",defaultValue:"semantic.colors.primary",tokenRef:{tokenType:"color"}},{id:"chat-msg-user-text",label:"User Message Text",type:"token-ref",path:"theme.components.message.user.text",defaultValue:"semantic.colors.textInverse",tokenRef:{tokenType:"color"}},{id:"chat-msg-assistant-bg",label:"Assistant Message Background",type:"token-ref",path:"theme.components.message.assistant.background",defaultValue:"semantic.colors.container",tokenRef:{tokenType:"color"}},{id:"chat-msg-assistant-text",label:"Assistant Message Text",type:"token-ref",path:"theme.components.message.assistant.text",defaultValue:"semantic.colors.text",tokenRef:{tokenType:"color"}}]},Ao={id:"typography",title:"Typography",collapsed:!0,fields:[{id:"typo-font-family",label:"Font Family",type:"select",path:"theme.semantic.typography.fontFamily",defaultValue:"palette.typography.fontFamily.sans",options:[{value:"palette.typography.fontFamily.sans",label:"Sans Serif"},{value:"palette.typography.fontFamily.serif",label:"Serif"},{value:"palette.typography.fontFamily.mono",label:"Monospace"}]},{id:"typo-font-size",label:"Base Font Size",type:"select",path:"theme.semantic.typography.fontSize",defaultValue:"palette.typography.fontSize.base",options:[{value:"palette.typography.fontSize.xs",label:"Extra Small (0.75rem)"},{value:"palette.typography.fontSize.sm",label:"Small (0.875rem)"},{value:"palette.typography.fontSize.base",label:"Base (1rem)"},{value:"palette.typography.fontSize.lg",label:"Large (1.125rem)"},{value:"palette.typography.fontSize.xl",label:"Extra Large (1.25rem)"}]},{id:"typo-font-weight",label:"Font Weight",type:"select",path:"theme.semantic.typography.fontWeight",defaultValue:"palette.typography.fontWeight.normal",options:[{value:"palette.typography.fontWeight.normal",label:"Normal (400)"},{value:"palette.typography.fontWeight.medium",label:"Medium (500)"},{value:"palette.typography.fontWeight.semibold",label:"Semibold (600)"},{value:"palette.typography.fontWeight.bold",label:"Bold (700)"}]},{id:"typo-line-height",label:"Line Height",type:"select",path:"theme.semantic.typography.lineHeight",defaultValue:"palette.typography.lineHeight.normal",options:[{value:"palette.typography.lineHeight.tight",label:"Tight (1.25)"},{value:"palette.typography.lineHeight.normal",label:"Normal (1.5)"},{value:"palette.typography.lineHeight.relaxed",label:"Relaxed (1.625)"}]}]},Eo={id:"launcher-style",title:"Launcher",description:"Control launcher appearance.",collapsed:!0,fields:[{id:"style-launcher-size",label:"Launcher Size",type:"slider",path:"theme.components.launcher.size",defaultValue:"60px",slider:{min:32,max:80,step:2}},{id:"style-launcher-shape",label:"Launcher Shape",type:"select",path:"theme.components.launcher.borderRadius",defaultValue:"palette.radius.full",options:[{value:"palette.radius.md",label:"Rounded Square"},{value:"palette.radius.lg",label:"Rounded"},{value:"palette.radius.xl",label:"Very Rounded"},{value:"palette.radius.full",label:"Circle"}]},{id:"style-launcher-shadow",label:"Launcher Shadow",type:"select",path:"theme.components.launcher.shadow",defaultValue:"palette.shadows.lg",options:[{value:"palette.shadows.none",label:"None"},{value:"palette.shadows.sm",label:"Small"},{value:"palette.shadows.md",label:"Medium"},{value:"palette.shadows.lg",label:"Large"},{value:"palette.shadows.xl",label:"Extra Large"}]}]},Po={id:"shape",title:"Shape",description:"Control the corner roundness across the widget.",collapsed:!0,fields:[{id:"radius-sm",label:"Small",type:"slider",path:"theme.palette.radius.sm",defaultValue:"0.125rem",slider:{min:0,max:16,step:1}},{id:"radius-md",label:"Medium",type:"slider",path:"theme.palette.radius.md",defaultValue:"0.375rem",slider:{min:0,max:24,step:1}},{id:"radius-lg",label:"Large",type:"slider",path:"theme.palette.radius.lg",defaultValue:"0.5rem",slider:{min:0,max:32,step:1}},{id:"radius-xl",label:"Extra Large",type:"slider",path:"theme.palette.radius.xl",defaultValue:"0.75rem",slider:{min:0,max:48,step:1}},{id:"radius-full",label:"Full",type:"slider",path:"theme.palette.radius.full",defaultValue:"9999px",slider:{min:0,max:100,step:1,isRadiusFull:!0}}],presets:[{id:"radius-default",label:"Default",values:{"theme.palette.radius.sm":"0.125rem","theme.palette.radius.md":"0.375rem","theme.palette.radius.lg":"0.5rem","theme.palette.radius.xl":"0.75rem","theme.palette.radius.full":"9999px"}},{id:"radius-sharp",label:"Sharp",values:{"theme.palette.radius.sm":"1px","theme.palette.radius.md":"2px","theme.palette.radius.lg":"3px","theme.palette.radius.xl":"4px","theme.palette.radius.full":"4px"}},{id:"radius-rounded",label:"Rounded",values:{"theme.palette.radius.sm":"0.5rem","theme.palette.radius.md":"0.75rem","theme.palette.radius.lg":"1rem","theme.palette.radius.xl":"1.5rem","theme.palette.radius.full":"9999px"}}]},Io={id:"shadows",title:"Shadows",collapsed:!0,fields:[{id:"shadow-sm",label:"Small",type:"text",path:"theme.palette.shadows.sm",defaultValue:"0 1px 2px 0 rgb(0 0 0 / 0.05)"},{id:"shadow-md",label:"Medium",type:"text",path:"theme.palette.shadows.md",defaultValue:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"},{id:"shadow-lg",label:"Large",type:"text",path:"theme.palette.shadows.lg",defaultValue:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)"},{id:"shadow-xl",label:"Extra Large",type:"text",path:"theme.palette.shadows.xl",defaultValue:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)"}]},Do={id:"widget-style",title:"Widget Surface",description:"Adjust the main panel and message bubble treatment.",collapsed:!0,fields:[{id:"style-panel-radius",label:"Panel Corner Radius",type:"select",path:"theme.components.panel.borderRadius",defaultValue:"palette.radius.xl",options:[{value:"palette.radius.none",label:"None"},{value:"palette.radius.sm",label:"Small"},{value:"palette.radius.md",label:"Medium"},{value:"palette.radius.lg",label:"Large"},{value:"palette.radius.xl",label:"Extra Large"}]},{id:"style-panel-shadow",label:"Panel Shadow",type:"select",path:"theme.components.panel.shadow",defaultValue:"palette.shadows.xl",options:[{value:"palette.shadows.none",label:"None"},{value:"palette.shadows.sm",label:"Small"},{value:"palette.shadows.md",label:"Medium"},{value:"palette.shadows.lg",label:"Large"},{value:"palette.shadows.xl",label:"Extra Large"}]},{id:"style-panel-canvas-bg",label:"Detached Canvas Background",description:"Fills the region behind a detached panel; defaults to transparent",type:"token-ref",path:"theme.components.panel.canvasBackground",defaultValue:_e,tokenRef:{tokenType:"color"}},{id:"style-msg-user-radius",label:"User Message Radius",type:"select",path:"theme.components.message.user.borderRadius",defaultValue:"palette.radius.lg",options:[{value:"palette.radius.none",label:"None"},{value:"palette.radius.sm",label:"Small"},{value:"palette.radius.md",label:"Medium"},{value:"palette.radius.lg",label:"Large"},{value:"palette.radius.xl",label:"Extra Large"}]},{id:"style-msg-assistant-radius",label:"Assistant Message Radius",type:"select",path:"theme.components.message.assistant.borderRadius",defaultValue:"palette.radius.lg",options:[{value:"palette.radius.none",label:"None"},{value:"palette.radius.sm",label:"Small"},{value:"palette.radius.md",label:"Medium"},{value:"palette.radius.lg",label:"Large"},{value:"palette.radius.xl",label:"Extra Large"}]}]},N=[Co,Ro,Eo,Ao,To,Po,Io,Do];function mt(){return{id:"brand-palette",title:"Brand Palette",description:"Define your color palette. Edit the base color (500) to auto-generate the full scale.",collapsed:!1,fields:Ue.map(t=>({id:`palette-${t}`,label:`${t.charAt(0).toUpperCase()+t.slice(1)}`,description:`${t} color palette (edit shade 500, auto-generate scale)`,type:"color-scale",path:`theme.palette.colors.${t}`,colorScale:{colorFamily:t}}))}}var ft={id:"semantic-colors",title:"Semantic Colors",description:"Map intents to palette colors.",collapsed:!0,fields:[{id:"sem-primary",label:"Primary",description:"Main brand/action color",type:"token-ref",path:"theme.semantic.colors.primary",defaultValue:"palette.colors.primary.500",tokenRef:{tokenType:"color"}},{id:"sem-secondary",label:"Secondary",description:"Secondary actions",type:"token-ref",path:"theme.semantic.colors.secondary",defaultValue:"palette.colors.gray.500",tokenRef:{tokenType:"color"}},{id:"sem-accent",label:"Accent",description:"Accent/highlight color",type:"token-ref",path:"theme.semantic.colors.accent",defaultValue:"palette.colors.primary.600",tokenRef:{tokenType:"color"}},{id:"sem-surface",label:"Surface",description:"Primary surface background",type:"token-ref",path:"theme.semantic.colors.surface",defaultValue:"palette.colors.gray.50",tokenRef:{tokenType:"color"}},{id:"sem-background",label:"Background",description:"Page/widget background",type:"token-ref",path:"theme.semantic.colors.background",defaultValue:"palette.colors.gray.50",tokenRef:{tokenType:"color"}},{id:"sem-container",label:"Container",description:"Container/card background",type:"token-ref",path:"theme.semantic.colors.container",defaultValue:"palette.colors.gray.100",tokenRef:{tokenType:"color"}},{id:"sem-text",label:"Text",description:"Primary text color",type:"token-ref",path:"theme.semantic.colors.text",defaultValue:"palette.colors.gray.900",tokenRef:{tokenType:"color"}},{id:"sem-text-muted",label:"Text Muted",description:"Secondary/muted text",type:"token-ref",path:"theme.semantic.colors.textMuted",defaultValue:"palette.colors.gray.500",tokenRef:{tokenType:"color"}},{id:"sem-text-inverse",label:"Text Inverse",description:"Text on dark backgrounds",type:"token-ref",path:"theme.semantic.colors.textInverse",defaultValue:"palette.colors.gray.50",tokenRef:{tokenType:"color"}},{id:"sem-border",label:"Border",description:"Default border color",type:"token-ref",path:"theme.semantic.colors.border",defaultValue:"palette.colors.gray.200",tokenRef:{tokenType:"color"}},{id:"sem-divider",label:"Divider",description:"Divider/separator color",type:"token-ref",path:"theme.semantic.colors.divider",defaultValue:"palette.colors.gray.200",tokenRef:{tokenType:"color"}},{id:"sem-interactive-default",label:"Interactive Default",type:"token-ref",path:"theme.semantic.colors.interactive.default",defaultValue:"palette.colors.primary.500",tokenRef:{tokenType:"color"}},{id:"sem-interactive-hover",label:"Interactive Hover",type:"token-ref",path:"theme.semantic.colors.interactive.hover",defaultValue:"palette.colors.primary.600",tokenRef:{tokenType:"color"}},{id:"sem-interactive-focus",label:"Interactive Focus",type:"token-ref",path:"theme.semantic.colors.interactive.focus",defaultValue:"palette.colors.primary.700",tokenRef:{tokenType:"color"}},{id:"sem-interactive-active",label:"Interactive Active",type:"token-ref",path:"theme.semantic.colors.interactive.active",defaultValue:"palette.colors.primary.800",tokenRef:{tokenType:"color"}},{id:"sem-interactive-disabled",label:"Interactive Disabled",type:"token-ref",path:"theme.semantic.colors.interactive.disabled",defaultValue:"palette.colors.gray.300",tokenRef:{tokenType:"color"}},{id:"sem-feedback-success",label:"Success",type:"token-ref",path:"theme.semantic.colors.feedback.success",defaultValue:"palette.colors.success.500",tokenRef:{tokenType:"color"}},{id:"sem-feedback-warning",label:"Warning",type:"token-ref",path:"theme.semantic.colors.feedback.warning",defaultValue:"palette.colors.warning.500",tokenRef:{tokenType:"color"}},{id:"sem-feedback-error",label:"Error",type:"token-ref",path:"theme.semantic.colors.feedback.error",defaultValue:"palette.colors.error.500",tokenRef:{tokenType:"color"}},{id:"sem-feedback-info",label:"Info",type:"token-ref",path:"theme.semantic.colors.feedback.info",defaultValue:"palette.colors.primary.500",tokenRef:{tokenType:"color"}}]},Vo=mt(),Bo=ft,Oo=[mt(),ft],Lo={id:"comp-panel",title:"Panel",collapsed:!1,fields:[{id:"panel-width",label:"Width",type:"text",path:"theme.components.panel.width",defaultValue:_},{id:"panel-max-width",label:"Max Width",type:"text",path:"theme.components.panel.maxWidth",defaultValue:oe},{id:"panel-height",label:"Height",type:"text",path:"theme.components.panel.height",defaultValue:"600px"},{id:"panel-max-height",label:"Max Height",type:"text",path:"theme.components.panel.maxHeight",defaultValue:"calc(100vh - 80px)"},{id:"panel-border-radius",label:"Border Radius",type:"select",path:"theme.components.panel.borderRadius",defaultValue:"palette.radius.xl",options:[{value:"palette.radius.none",label:"None"},{value:"palette.radius.sm",label:"Small"},{value:"palette.radius.md",label:"Medium"},{value:"palette.radius.lg",label:"Large"},{value:"palette.radius.xl",label:"Extra Large"}]},{id:"panel-shadow",label:"Shadow",type:"select",path:"theme.components.panel.shadow",defaultValue:"palette.shadows.xl",options:[{value:"palette.shadows.none",label:"None"},{value:"palette.shadows.sm",label:"Small"},{value:"palette.shadows.md",label:"Medium"},{value:"palette.shadows.lg",label:"Large"},{value:"palette.shadows.xl",label:"Extra Large"}]},{id:"panel-inset",label:"Detached Inset",description:"Gap around the card when launcher.detachedPanel is on",type:"text",path:"theme.components.panel.inset",defaultValue:Le}]},_o={id:"comp-launcher",title:"Launcher",collapsed:!0,fields:[{id:"launcher-size",label:"Size",type:"slider",path:"theme.components.launcher.size",defaultValue:"60px",slider:{min:32,max:80,step:2}},{id:"launcher-icon-size",label:"Icon Size",type:"slider",path:"theme.components.launcher.iconSize",defaultValue:"28px",slider:{min:16,max:48,step:2}},{id:"launcher-icon-stroke-width",label:"Icon Stroke Width",description:"Unitless line weight for the agent glyph and the call-to-action arrow",type:"slider",path:"theme.components.launcher.iconStrokeWidth",defaultValue:"1.5",slider:{min:1,max:2.5,step:.25,unit:"none"},parseValue:gt},{id:"launcher-border-radius",label:"Border Radius",type:"select",path:"theme.components.launcher.borderRadius",defaultValue:"palette.radius.full",options:[{value:"palette.radius.md",label:"Medium"},{value:"palette.radius.lg",label:"Large"},{value:"palette.radius.xl",label:"Extra Large"},{value:"palette.radius.full",label:"Full (Circle)"}]},{id:"launcher-shadow",label:"Shadow",type:"select",path:"theme.components.launcher.shadow",defaultValue:"palette.shadows.lg",options:[{value:"palette.shadows.none",label:"None"},{value:"palette.shadows.sm",label:"Small"},{value:"palette.shadows.md",label:"Medium"},{value:"palette.shadows.lg",label:"Large"},{value:"palette.shadows.xl",label:"Extra Large"}]}]},Mo={id:"comp-header-controls",title:"Header Controls",description:"One box, glyph, and stroke shared by every header icon button: close, clear chat, trailing actions, and Messages, plus the strip height.",collapsed:!0,fields:[{id:"header-min-height",label:"Header Min Height",description:"CSS length, e.g. 65px. Blank stays at the natural height",type:"text",path:"theme.components.header.minHeight",defaultValue:"",parseValue:k},{id:"header-control-size",label:"Control Size",description:"The button box. Coarse pointers still floor the hit area at 40px",type:"slider",path:"theme.components.header.controlSize",defaultValue:"32px",slider:{min:24,max:64,step:2},parseValue:dt},{id:"header-control-icon-size",label:"Icon Size",description:"The glyph inside the button",type:"slider",path:"theme.components.header.controlIconSize",defaultValue:"20px",slider:{min:12,max:40,step:1},parseValue:dt},{id:"header-control-stroke-width",label:"Icon Stroke Width",description:"Unitless line weight. The close X renders at 0.7 of it so its sparser glyph matches",type:"slider",path:"theme.components.header.controlStrokeWidth",defaultValue:"1.5",slider:{min:1,max:2.5,step:.25,unit:"none"},parseValue:gt}]},Fo={id:"comp-history-rail-header",title:"Messages Rail Header",description:"The Messages rail top strip. Match its height to the header so both read as one band.",collapsed:!0,fields:[{id:"rail-header-min-height",label:"Min Height",description:"CSS length. Blank follows the header min height",type:"text",path:"theme.components.history.railHeader.minHeight",defaultValue:"",parseValue:k},{id:"rail-header-border",label:"Bottom Border",description:"Full border-bottom shorthand, e.g. 1px solid #333",type:"text",path:"theme.components.history.railHeader.border",defaultValue:"",parseValue:k}]},Wo={id:"comp-history-rail-header-colors",title:"Messages Rail Header Colors",collapsed:!0,fields:[{id:"rail-header-bg",label:"Background",type:"token-ref",path:"theme.components.history.railHeader.background",defaultValue:"semantic.colors.container",tokenRef:{tokenType:"color"}}]},No={id:"comp-history-overlay",title:"Messages Floating Rail",description:"The Messages rail floating over the conversation, when a collapsed rail opens on hover.",collapsed:!0,fields:[{id:"history-overlay-margin",label:"Margin",description:"Gap from the trigger, the docked edge and the bottom",type:"text",path:"theme.components.history.overlay.margin",defaultValue:"",parseValue:k},{id:"history-overlay-radius",label:"Corner Radius",description:"CSS length on all four corners. Blank keeps 16px",type:"text",path:"theme.components.history.overlay.borderRadius",defaultValue:"",parseValue:k},{id:"history-overlay-shadow",label:"Shadow",description:"Full box-shadow shorthand. Blank keeps the built-in elevation",type:"text",path:"theme.components.history.overlay.shadow",defaultValue:"",parseValue:k}]},Ho={id:"comp-history-overlay-colors",title:"Messages Floating Rail Colors",collapsed:!0,fields:[{id:"history-overlay-bg",label:"Background",type:"token-ref",path:"theme.components.history.overlay.background",defaultValue:"semantic.colors.container",tokenRef:{tokenType:"color"}}]},$o={id:"comp-history-motion",title:"Messages Motion",description:"Enter and exit animation of the Messages body. The bar is persistent chrome and never animates; reduced-motion preferences always win.",collapsed:!0,fields:[{id:"history-motion-enter-ms",label:"Enter Duration",description:"Milliseconds, e.g. 180. 0 disables the entrance. Blank keeps 180",type:"text",path:"theme.components.history.motion.enterDurationMs",defaultValue:"",parseValue:k},{id:"history-motion-enter-easing",label:"Enter Easing",description:"CSS easing, e.g. ease-out or cubic-bezier(0, 0, 0.2, 1)",type:"text",path:"theme.components.history.motion.enterEasing",defaultValue:"",parseValue:k},{id:"history-motion-exit-ms",label:"Exit Duration",description:"Milliseconds, e.g. 160. 0 disables the exit. Blank keeps 160",type:"text",path:"theme.components.history.motion.exitDurationMs",defaultValue:"",parseValue:k},{id:"history-motion-exit-easing",label:"Exit Easing",description:"CSS easing, e.g. ease-in or cubic-bezier(0.4, 0, 1, 1)",type:"text",path:"theme.components.history.motion.exitEasing",defaultValue:"",parseValue:k}]},zo={id:"comp-tooltip",title:"Tooltip",description:"The hover and focus tooltip on icon controls, including its shortcut hint chip.",collapsed:!0,fields:[{id:"tooltip-radius",label:"Corner Radius",type:"select",path:"theme.components.tooltip.borderRadius",defaultValue:"palette.radius.sm",options:[{value:"palette.radius.none",label:"None"},{value:"palette.radius.sm",label:"Small"},{value:"palette.radius.md",label:"Medium"},{value:"palette.radius.lg",label:"Large"},{value:"palette.radius.xl",label:"Extra Large"}]},{id:"tooltip-font-size",label:"Font Size",description:"CSS length. Blank stays at 12px",type:"text",path:"theme.components.tooltip.fontSize",defaultValue:"",parseValue:k},{id:"tooltip-arrow",label:"Show Arrow",description:"The caret pointing at the control",type:"toggle",path:"theme.components.tooltip.arrow",defaultValue:!0}]},Uo={id:"comp-tooltip-colors",title:"Tooltip Colors",collapsed:!0,fields:[{id:"tooltip-bg",label:"Background",type:"token-ref",path:"theme.components.tooltip.background",defaultValue:"palette.colors.gray.900",tokenRef:{tokenType:"color"}},{id:"tooltip-fg",label:"Label",type:"token-ref",path:"theme.components.tooltip.foreground",defaultValue:"palette.colors.primary.50",tokenRef:{tokenType:"color"}},{id:"tooltip-hint-fg",label:"Shortcut Hint",type:"token-ref",path:"theme.components.tooltip.hintForeground",defaultValue:"palette.colors.gray.400",tokenRef:{tokenType:"color"}}]},jo={id:"comp-message-shape",title:"Message Shape",collapsed:!0,fields:[{id:"msg-user-radius",label:"User Bubble Radius",type:"select",path:"theme.components.message.user.borderRadius",defaultValue:"palette.radius.lg",options:[{value:"palette.radius.none",label:"None"},{value:"palette.radius.sm",label:"Small"},{value:"palette.radius.md",label:"Medium"},{value:"palette.radius.lg",label:"Large"},{value:"palette.radius.xl",label:"Extra Large"}]},{id:"msg-assistant-radius",label:"Assistant Bubble Radius",type:"select",path:"theme.components.message.assistant.borderRadius",defaultValue:"palette.radius.lg",options:[{value:"palette.radius.none",label:"None"},{value:"palette.radius.sm",label:"Small"},{value:"palette.radius.md",label:"Medium"},{value:"palette.radius.lg",label:"Large"},{value:"palette.radius.xl",label:"Extra Large"}]}]},Go={id:"comp-input-shape",title:"Input Shape",collapsed:!0,fields:[{id:"input-radius",label:"Border Radius",type:"select",path:"theme.components.input.borderRadius",defaultValue:"palette.radius.lg",options:[{value:"palette.radius.none",label:"None"},{value:"palette.radius.sm",label:"Small"},{value:"palette.radius.md",label:"Medium"},{value:"palette.radius.lg",label:"Large"},{value:"palette.radius.xl",label:"Extra Large"}]}]},qo={id:"comp-composer-spacing",title:"Composer Spacing",collapsed:!0,fields:[{id:"composer-padding",label:"Padding",type:"text",path:"theme.components.composer.padding",defaultValue:"0.75rem 1rem"},{id:"composer-gap",label:"Row Gap",description:"Space between the textarea row and the actions row",type:"text",path:"theme.components.composer.gap",defaultValue:"0.5rem"},{id:"composer-font-size",label:"Font Size",type:"text",path:"theme.components.composer.fontSize",defaultValue:"0.875rem"},{id:"composer-line-height",label:"Line Height",type:"text",path:"theme.components.composer.lineHeight",defaultValue:"1.25rem"},{id:"composer-control-size",label:"Control Size",description:"Edge of every icon control in the action row",type:"slider",path:"theme.components.composer.controlSize",defaultValue:"40px",slider:{min:24,max:64,step:2}},{id:"composer-control-icon-size",label:"Control Icon Size",description:"Glyph inside those controls",type:"slider",path:"theme.components.composer.controlIconSize",defaultValue:"24px",slider:{min:12,max:40,step:1}}]},Yo={id:"comp-button-shape",title:"Button Shape",collapsed:!0,fields:[{id:"btn-primary-radius",label:"Primary Radius",type:"select",path:"theme.components.button.primary.borderRadius",defaultValue:"palette.radius.lg",options:[{value:"palette.radius.sm",label:"Small"},{value:"palette.radius.md",label:"Medium"},{value:"palette.radius.lg",label:"Large"},{value:"palette.radius.full",label:"Full"}]}]},Ko={id:"comp-header-colors",title:"Header Colors",collapsed:!0,fields:[{id:"header-bg",label:"Background",type:"token-ref",path:"theme.components.header.background",defaultValue:"semantic.colors.surface",tokenRef:{tokenType:"color"}},{id:"header-fg",label:"Foreground",description:"Anchors the header text. Background and foreground together derive every color left blank below",type:"token-ref",path:"theme.components.header.foreground",defaultValue:"",tokenRef:{tokenType:"color"}},{id:"header-icon-bg",label:"Icon background",type:"token-ref",path:"theme.components.header.iconBackground",defaultValue:"semantic.colors.primary",tokenRef:{tokenType:"color"}},{id:"header-icon-fg",label:"Icon color",type:"token-ref",path:"theme.components.header.iconForeground",defaultValue:"semantic.colors.textInverse",tokenRef:{tokenType:"color"}},{id:"header-title-fg",label:"Title color",description:"Blank follows the header foreground",type:"token-ref",path:"theme.components.header.titleForeground",defaultValue:"",tokenRef:{tokenType:"color"}},{id:"header-subtitle-fg",label:"Subtitle color",description:"Blank follows a 72% mix of the foreground over the background",type:"token-ref",path:"theme.components.header.subtitleForeground",defaultValue:"",tokenRef:{tokenType:"color"}},{id:"header-action-icons-fg",label:"Clear / close icons",description:"Blank follows the same 72% foreground mix as the subtitle",type:"token-ref",path:"theme.components.header.actionIconForeground",defaultValue:"",tokenRef:{tokenType:"color"}},{id:"header-border",label:"Border",description:"Blank follows a 14% mix of the foreground over the background",type:"token-ref",path:"theme.components.header.border",defaultValue:"",tokenRef:{tokenType:"color"}}]},Xo={id:"comp-message-colors",title:"Message Colors",collapsed:!0,fields:[{id:"msg-user-bg",label:"User Bubble Background",type:"token-ref",path:"theme.components.message.user.background",defaultValue:"semantic.colors.primary",tokenRef:{tokenType:"color"}},{id:"msg-user-text",label:"User Bubble Text",type:"token-ref",path:"theme.components.message.user.text",defaultValue:"semantic.colors.textInverse",tokenRef:{tokenType:"color"}},{id:"msg-assistant-bg",label:"Assistant Bubble Background",type:"token-ref",path:"theme.components.message.assistant.background",defaultValue:"semantic.colors.container",tokenRef:{tokenType:"color"}},{id:"msg-assistant-text",label:"Assistant Bubble Text",type:"token-ref",path:"theme.components.message.assistant.text",defaultValue:"semantic.colors.text",tokenRef:{tokenType:"color"}}]},Zo={id:"comp-input-colors",title:"Input Colors",collapsed:!0,fields:[{id:"input-bg",label:"Background",type:"token-ref",path:"theme.components.input.background",defaultValue:"semantic.colors.surface",tokenRef:{tokenType:"color"}},{id:"input-placeholder",label:"Placeholder Color",type:"token-ref",path:"theme.components.input.placeholder",defaultValue:"semantic.colors.textMuted",tokenRef:{tokenType:"color"}},{id:"input-focus-border",label:"Focus Border",type:"token-ref",path:"theme.components.input.focus.border",defaultValue:"semantic.colors.interactive.focus",tokenRef:{tokenType:"color"}},{id:"input-focus-ring",label:"Focus Ring",type:"token-ref",path:"theme.components.input.focus.ring",defaultValue:"semantic.colors.interactive.focus",tokenRef:{tokenType:"color"}}]},Jo={id:"comp-button-colors",title:"Button Colors",collapsed:!0,fields:[{id:"btn-primary-bg",label:"Primary Background",type:"token-ref",path:"theme.components.button.primary.background",defaultValue:"semantic.colors.primary",tokenRef:{tokenType:"color"}},{id:"btn-primary-fg",label:"Primary Foreground",type:"token-ref",path:"theme.components.button.primary.foreground",defaultValue:"semantic.colors.textInverse",tokenRef:{tokenType:"color"}},{id:"btn-secondary-bg",label:"Secondary Background",type:"token-ref",path:"theme.components.button.secondary.background",defaultValue:"semantic.colors.surface",tokenRef:{tokenType:"color"}},{id:"btn-secondary-fg",label:"Secondary Foreground",type:"token-ref",path:"theme.components.button.secondary.foreground",defaultValue:"semantic.colors.text",tokenRef:{tokenType:"color"}},{id:"btn-ghost-bg",label:"Ghost Background",type:"color",path:"theme.components.button.ghost.background",defaultValue:"transparent"},{id:"btn-ghost-fg",label:"Ghost Foreground",type:"token-ref",path:"theme.components.button.ghost.foreground",defaultValue:"semantic.colors.text",tokenRef:{tokenType:"color"}}]},Qo={id:"scroll-to-bottom-style",title:"Scroll To Bottom",description:"Style the floating jump-to-latest affordance.",collapsed:!0,fields:[{id:"scroll-bottom-bg",label:"Background",type:"token-ref",path:"theme.components.scrollToBottom.background",defaultValue:"components.button.primary.background",tokenRef:{tokenType:"color"}},{id:"scroll-bottom-fg",label:"Foreground",type:"token-ref",path:"theme.components.scrollToBottom.foreground",defaultValue:"components.button.primary.foreground",tokenRef:{tokenType:"color"}},{id:"scroll-bottom-border",label:"Border",type:"token-ref",path:"theme.components.scrollToBottom.border",defaultValue:"semantic.colors.primary",tokenRef:{tokenType:"color"}},{id:"scroll-bottom-size",label:"Size",type:"text",path:"theme.components.scrollToBottom.size",defaultValue:"40px"},{id:"scroll-bottom-radius",label:"Border Radius",type:"select",path:"theme.components.scrollToBottom.borderRadius",defaultValue:"palette.radius.full",options:[{value:"palette.radius.md",label:"Medium"},{value:"palette.radius.lg",label:"Large"},{value:"palette.radius.xl",label:"Extra Large"},{value:"palette.radius.full",label:"Full"}]},{id:"scroll-bottom-shadow",label:"Shadow",type:"select",path:"theme.components.scrollToBottom.shadow",defaultValue:"palette.shadows.sm",options:[{value:"palette.shadows.none",label:"None"},{value:"palette.shadows.sm",label:"Small"},{value:"palette.shadows.md",label:"Medium"},{value:"palette.shadows.lg",label:"Large"},{value:"palette.shadows.xl",label:"Extra Large"}]},{id:"scroll-bottom-padding",label:"Padding",type:"text",path:"theme.components.scrollToBottom.padding",defaultValue:"0.5rem 0.875rem"},{id:"scroll-bottom-gap",label:"Gap",type:"text",path:"theme.components.scrollToBottom.gap",defaultValue:"0.5rem"},{id:"scroll-bottom-font-size",label:"Font Size",type:"text",path:"theme.components.scrollToBottom.fontSize",defaultValue:"0.875rem"},{id:"scroll-bottom-icon-size",label:"Icon Size",type:"text",path:"theme.components.scrollToBottom.iconSize",defaultValue:"14px"}]},ea={id:"comp-suggestions",title:"Suggestions",description:"Style starter cards, follow-up chips, and list rows.",collapsed:!0,fields:[{id:"suggestion-chip-bg",label:"Chip Background",type:"token-ref",path:"theme.components.suggestion.chip.background",defaultValue:"semantic.colors.surface",tokenRef:{tokenType:"color"}},{id:"suggestion-chip-fg",label:"Chip Text",type:"token-ref",path:"theme.components.suggestion.chip.foreground",defaultValue:"semantic.colors.text",tokenRef:{tokenType:"color"}},{id:"suggestion-chip-border",label:"Chip Border",type:"token-ref",path:"theme.components.suggestion.chip.border",defaultValue:"semantic.colors.border",tokenRef:{tokenType:"color"}},{id:"suggestion-chip-hover",label:"Chip Hover",type:"token-ref",path:"theme.components.suggestion.chip.hoverBackground",defaultValue:"palette.colors.gray.100",tokenRef:{tokenType:"color"}},{id:"suggestion-chip-focus",label:"Chip Focus Ring",type:"token-ref",path:"theme.components.suggestion.chip.focusRing",defaultValue:"semantic.colors.interactive.focus",tokenRef:{tokenType:"color"}},{id:"suggestion-card-bg",label:"Card Background",type:"token-ref",path:"theme.components.suggestion.card.background",defaultValue:"semantic.colors.surface",tokenRef:{tokenType:"color"}},{id:"suggestion-card-fg",label:"Card Text",type:"token-ref",path:"theme.components.suggestion.card.foreground",defaultValue:"semantic.colors.text",tokenRef:{tokenType:"color"}},{id:"suggestion-card-border",label:"Card Border",type:"token-ref",path:"theme.components.suggestion.card.border",defaultValue:"semantic.colors.border",tokenRef:{tokenType:"color"}},{id:"suggestion-card-hover",label:"Card Hover",type:"token-ref",path:"theme.components.suggestion.card.hoverBackground",defaultValue:"palette.colors.gray.100",tokenRef:{tokenType:"color"}},{id:"suggestion-card-shadow",label:"Card Shadow",type:"select",path:"theme.components.suggestion.card.shadow",defaultValue:"palette.shadows.sm",options:[{value:"palette.shadows.none",label:"None"},{value:"palette.shadows.sm",label:"Small"},{value:"palette.shadows.md",label:"Medium"},{value:"palette.shadows.lg",label:"Large"}]},{id:"suggestion-list-bg",label:"List Background",type:"color",path:"theme.components.suggestion.list.background",defaultValue:"transparent"},{id:"suggestion-list-border",label:"List Border",type:"token-ref",path:"theme.components.suggestion.list.border",defaultValue:"semantic.colors.border",tokenRef:{tokenType:"color"}},{id:"suggestion-chip-item-gap",label:"Chip Spacing",description:"Space between chips",type:"text",path:"theme.components.suggestion.chip.itemGap",defaultValue:"8px"},{id:"suggestion-card-item-gap",label:"Card Spacing",description:"Space between cards",type:"text",path:"theme.components.suggestion.card.itemGap",defaultValue:"8px"},{id:"suggestion-list-item-gap",label:"List Spacing",description:"Space between list rows",type:"text",path:"theme.components.suggestion.list.itemGap",defaultValue:"8px"}]},W=[{value:"palette.shadows.none",label:"None"},{value:"palette.shadows.sm",label:"Small"},{value:"palette.shadows.md",label:"Medium"},{value:"palette.shadows.lg",label:"Large"},{value:"palette.shadows.xl",label:"Extra Large"}],ht="0 5px 15px rgba(15, 23, 42, 0.08)",pt=[{value:ht,label:"Default"},...W],ta={id:"comp-shadows",title:"Component Shadows",description:"Box-shadow for chat bubbles and surfaces.",collapsed:!0,fields:[{id:"shadow-msg-user",label:"User Message",type:"select",path:"theme.components.message.user.shadow",defaultValue:"palette.shadows.sm",options:W},{id:"shadow-msg-assistant",label:"Assistant Message",type:"select",path:"theme.components.message.assistant.shadow",defaultValue:"palette.shadows.sm",options:W},{id:"shadow-tool-bubble",label:"Tool Call Bubble",type:"select",path:"theme.components.toolBubble.shadow",defaultValue:"palette.shadows.sm",options:W},{id:"shadow-reasoning-bubble",label:"Reasoning Bubble",type:"select",path:"theme.components.reasoningBubble.shadow",defaultValue:"palette.shadows.sm",options:W},{id:"shadow-approval",label:"Approval Bubble",type:"select",path:"theme.components.approval.requested.shadow",defaultValue:ht,options:pt},{id:"shadow-intro-card",label:"Intro Card",type:"select",path:"theme.components.introCard.shadow",defaultValue:"palette.shadows.none",options:pt},{id:"shadow-composer",label:"Composer",type:"select",path:"theme.components.composer.shadow",defaultValue:"palette.shadows.none",options:W}]},ut=[{value:"",label:"Default"},{value:"400",label:"Normal (400)"},{value:"500",label:"Medium (500)"},{value:"600",label:"Semibold (600)"},{value:"700",label:"Bold (700)"}],oa={id:"comp-text-styles",title:"Header & Welcome Text",description:"Typography for the header title and the welcome greeting. Leave blank to keep the built-in defaults.",collapsed:!0,fields:[{id:"header-title-font-family",label:"Header Title Font",description:"CSS font-family, e.g. Georgia, serif",type:"text",path:"theme.components.header.title.fontFamily",defaultValue:"",parseValue:k},{id:"header-title-font-size",label:"Header Title Size",description:"CSS length, e.g. 1.125rem",type:"text",path:"theme.components.header.title.fontSize",defaultValue:"",parseValue:k},{id:"header-title-font-weight",label:"Header Title Weight",type:"select",path:"theme.components.header.title.fontWeight",defaultValue:"",options:ut,parseValue:k},{id:"welcome-title-font-family",label:"Welcome Title Font",description:"CSS font-family, e.g. Georgia, serif",type:"text",path:"theme.components.introCard.title.fontFamily",defaultValue:"",parseValue:k},{id:"welcome-title-font-size",label:"Welcome Title Size",description:"CSS length, e.g. 1.5rem",type:"text",path:"theme.components.introCard.title.fontSize",defaultValue:"",parseValue:k},{id:"welcome-title-font-weight",label:"Welcome Title Weight",type:"select",path:"theme.components.introCard.title.fontWeight",defaultValue:"",options:ut,parseValue:k}]},bt=[Lo,_o,Mo,Fo,No,$o,zo,jo,Go,qo,Yo,oa,ta],yt=[Ko,Wo,Ho,Uo,Xo,Zo,Jo,Qo,ea],kt=[...bt,...yt],qe=1024*1024,aa=["Show me what you can help with","Walk me through getting started","Answer a question about this page"],K={images:["image/png","image/jpeg","image/gif","image/webp","image/svg+xml","image/bmp"],"images-pdf":["image/png","image/jpeg","image/gif","image/webp","image/svg+xml","image/bmp","application/pdf"],"images-text-pdf":["image/png","image/jpeg","image/gif","image/webp","image/svg+xml","image/bmp","application/pdf","text/plain","text/markdown","text/csv","application/json"],all:["image/png","image/jpeg","image/gif","image/webp","image/svg+xml","image/bmp","application/pdf","text/plain","text/markdown","text/csv","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/json"]};function ra(e){return Number(e)*qe}function na(e){let t=Number(e);return Number.isFinite(t)?t>1024?String(Math.round(t/qe)):String(t):"10"}function sa(e){return K[String(e)]??K.images}function ia(e){let t=Array.isArray(e)?e:K.images,o=[...new Set(t)].sort();for(let[a,r]of Object.entries(K)){let n=[...r].sort();if(o.length===n.length&&o.every((s,l)=>s===n[l]))return a}return o.some(a=>a.startsWith("application/vnd")||a==="application/msword")?"all":o.some(a=>a==="text/plain"||a==="text/markdown"||a==="text/csv")?"images-text-pdf":o.includes("application/pdf")?"images-pdf":"images"}var la={id:"copy",title:"Content & Copy",collapsed:!1,fields:[{id:"copy-show-welcome-card",label:"Show Welcome Card",type:"toggle",path:"copy.showWelcomeCard",defaultValue:!0},{id:"copy-welcome-title",label:"Welcome Title",type:"text",path:"copy.welcomeTitle",defaultValue:"Hello \u{1F44B}"},{id:"copy-welcome-subtitle",label:"Welcome Subtitle",type:"text",path:"copy.welcomeSubtitle",defaultValue:"I can answer questions and help you get things done here."},{id:"copy-placeholder",label:"Input Placeholder",type:"text",path:"copy.inputPlaceholder",defaultValue:Oe},{id:"copy-send-label",label:"Send Button Label",type:"text",path:"copy.sendButtonLabel",defaultValue:"Send"}]},ca={id:"suggestions",title:"Suggestions",description:"Configure starter prompts and agent follow-ups.",collapsed:!0,fields:[{id:"suggestions-list",label:"Starter Prompts",description:"Add, edit, and remove starter prompts directly.",type:"chip-list",path:"suggestionChips",defaultValue:aa},{id:"suggestions-starter-variant",label:"Starter Style",type:"select",path:"suggestions.starters.variant",defaultValue:"card",options:[{value:"card",label:"Cards"},{value:"chip",label:"Chips"},{value:"list",label:"List"}]},{id:"suggestions-starter-placement",label:"Starter Placement",type:"select",path:"suggestions.starters.placement",defaultValue:"auto",options:[{value:"auto",label:"Automatic"},{value:"welcome",label:"Welcome Surface"},{value:"composer",label:"Above Composer"}]},{id:"suggestions-starter-behavior",label:"Starter Click",type:"select",path:"suggestions.starters.behavior",defaultValue:"send",options:[{value:"send",label:"Send Immediately"},{value:"fill",label:"Fill Composer"}]},{id:"suggestions-starter-overflow",label:"Starter Overflow",type:"select",path:"suggestions.starters.overflow",defaultValue:"wrap",options:[{value:"wrap",label:"Wrap Rows"},{value:"scroll",label:"Horizontal Scroll"}]},{id:"suggestions-followup-variant",label:"Follow-up Style",type:"select",path:"suggestions.followUps.variant",defaultValue:"chip",options:[{value:"chip",label:"Chips"},{value:"card",label:"Cards"},{value:"list",label:"List"}]},{id:"suggestions-followup-placement",label:"Follow-up Placement",type:"select",path:"suggestions.followUps.placement",defaultValue:"auto",options:[{value:"auto",label:"Automatic"},{value:"after-message",label:"After Messages"},{value:"composer",label:"Above Composer"}]},{id:"suggestions-followup-behavior",label:"Follow-up Click",type:"select",path:"suggestions.followUps.behavior",defaultValue:"send",options:[{value:"send",label:"Send Immediately"},{value:"fill",label:"Fill Composer"}]},{id:"suggestions-followup-overflow",label:"Follow-up Overflow",type:"select",path:"suggestions.followUps.overflow",defaultValue:"scroll",options:[{value:"scroll",label:"Horizontal Scroll"},{value:"wrap",label:"Wrap Rows"}]}]},da={id:"general-layout",title:"Layout Basics",collapsed:!0,fields:[{id:"layout-show-header",label:"Show Header",type:"toggle",path:"layout.showHeader",defaultValue:!0},{id:"layout-show-footer",label:"Show Footer",type:"toggle",path:"layout.showFooter",defaultValue:!0},{id:"layout-content-max-width",label:"Content Max Width",description:"Max width for messages + composer",type:"text",path:"layout.contentMaxWidth",defaultValue:""}]},pa={id:"header-layout",title:"Header",collapsed:!0,fields:[{id:"layout-header",label:"Header Layout",type:"select",path:"layout.header.layout",defaultValue:"default",options:[{value:"default",label:"Default"},{value:"minimal",label:"Minimal"}]},{id:"layout-show-icon",label:"Show Header Icon",type:"toggle",path:"layout.header.showIcon",defaultValue:!0},{id:"layout-show-title",label:"Show Header Title",type:"toggle",path:"layout.header.showTitle",defaultValue:!0},{id:"layout-show-subtitle",label:"Show Header Subtitle",type:"toggle",path:"layout.header.showSubtitle",defaultValue:!0},{id:"layout-show-close",label:"Show Close Button",type:"toggle",path:"layout.header.showCloseButton",defaultValue:!0},{id:"layout-show-clear",label:"Show Clear Chat",type:"toggle",path:"layout.header.showClearChat",defaultValue:!0}]},ua={id:"messages-layout",title:"Messages",collapsed:!0,fields:[{id:"layout-messages",label:"Message Style",description:"Minimal uses a user bubble with an open assistant response",type:"select",path:"layout.messages.layout",defaultValue:"bubble",options:[{value:"bubble",label:"Bubble \u2014 bubbles for both"},{value:"minimal",label:"Minimal \u2014 user bubble, open assistant"},{value:"flat",label:"Flat \u2014 open messages for both"}]},{id:"layout-message-user-width",label:"User Width",description:"Content hugs the message; Full fills the transcript track",type:"select",path:"layout.messages.user.width",defaultValue:"content",options:[{value:"content",label:"Content"},{value:"full",label:"Full"}]},{id:"layout-message-user-max-width",label:"User Max Width",description:"Optional CSS width such as 80%, 42rem, or 72ch; blank uses the width mode default",type:"text",path:"layout.messages.user.maxWidth",defaultValue:"",parseValue:k},{id:"layout-message-assistant-width",label:"Assistant Width",description:"Content hugs the message; Full fills the transcript track",type:"select",path:"layout.messages.assistant.width",defaultValue:"content",options:[{value:"content",label:"Content"},{value:"full",label:"Full"}]},{id:"layout-message-assistant-max-width",label:"Assistant Max Width",description:"Optional CSS width such as 80%, 42rem, or 72ch; blank uses the width mode default",type:"text",path:"layout.messages.assistant.maxWidth",defaultValue:"",parseValue:k},{id:"layout-group",label:"Group Consecutive",type:"toggle",path:"layout.messages.groupConsecutive",defaultValue:!1},{id:"layout-avatar-show",label:"Show Avatars",type:"toggle",path:"layout.messages.avatar.show",defaultValue:!1},{id:"layout-avatar-pos",label:"Avatar Position",type:"select",path:"layout.messages.avatar.position",defaultValue:"left",options:[{value:"left",label:"Left"},{value:"right",label:"Right"}]},{id:"layout-avatar-user",label:"User Avatar URL",type:"text",path:"layout.messages.avatar.userAvatar",defaultValue:""},{id:"layout-avatar-assistant",label:"Assistant Avatar URL",type:"text",path:"layout.messages.avatar.assistantAvatar",defaultValue:""},{id:"layout-timestamp-show",label:"Show Timestamps",type:"toggle",path:"layout.messages.timestamp.show",defaultValue:!1},{id:"layout-timestamp-pos",label:"Timestamp Position",type:"select",path:"layout.messages.timestamp.position",defaultValue:"inline",options:[{value:"inline",label:"Inline"},{value:"below",label:"Below"}]}]},ga={id:"message-actions",title:"Message Actions",collapsed:!0,fields:[{id:"msg-actions-enabled",label:"Enabled",type:"toggle",path:"messageActions.enabled",defaultValue:!0},{id:"msg-actions-copy",label:"Show Copy",type:"toggle",path:"messageActions.showCopy",defaultValue:!0},{id:"msg-actions-upvote",label:"Show Upvote",type:"toggle",path:"messageActions.showUpvote",defaultValue:!0},{id:"msg-actions-downvote",label:"Show Downvote",type:"toggle",path:"messageActions.showDownvote",defaultValue:!0},{id:"msg-actions-read-aloud",label:"Show Read Aloud",type:"toggle",path:"messageActions.showReadAloud",defaultValue:!1},{id:"msg-actions-visibility",label:"Visibility",type:"select",path:"messageActions.visibility",defaultValue:"hover",options:[{value:"hover",label:"On Hover"},{value:"always",label:"Always Visible"}]},{id:"msg-actions-align",label:"Alignment",type:"select",path:"messageActions.align",defaultValue:"right",options:[{value:"left",label:"Left"},{value:"right",label:"Right"}]},{id:"msg-actions-layout",label:"Layout",type:"select",path:"messageActions.layout",defaultValue:"pill-inside",options:[{value:"pill-inside",label:"Pill"},{value:"row-inside",label:"Row"}]}]},ma={id:"launcher-basics",title:"Launcher",collapsed:!0,fields:[{id:"launch-enabled",label:"Enabled",type:"toggle",path:"launcher.enabled",defaultValue:!0},{id:"launch-mount-mode",label:"Mount Mode",type:"select",path:"launcher.mountMode",defaultValue:"floating",options:[{value:"floating",label:"Floating"},{value:"docked",label:"Docked"}]},{id:"launch-position",label:"Position",type:"select",path:"launcher.position",defaultValue:"bottom-right",options:[{value:"bottom-right",label:"Bottom Right"},{value:"bottom-left",label:"Bottom Left"},{value:"top-right",label:"Top Right"},{value:"top-left",label:"Top Left"}]},{id:"launch-width",label:"Width",type:"text",path:"launcher.width",defaultValue:_},{id:"launch-auto-expand",label:"Auto Expand",type:"toggle",path:"launcher.autoExpand",defaultValue:!1},{id:"launch-title",label:"Title",type:"text",path:"launcher.title",defaultValue:"Chat Assistant"},{id:"launch-subtitle",label:"Subtitle",type:"text",path:"launcher.subtitle",defaultValue:"Here to help you get answers fast"}]},fa={id:"launcher-advanced",title:"Launcher Advanced",collapsed:!0,fields:[{id:"launch-dock-side",label:"Dock Side",type:"select",path:"launcher.dock.side",defaultValue:"right",options:[{value:"right",label:"Right"},{value:"left",label:"Left"}]},{id:"launch-dock-width",label:"Dock Width",type:"text",path:"launcher.dock.width",defaultValue:"420px"},{id:"launch-dock-animate",label:"Dock Animate",type:"toggle",path:"launcher.dock.animate",defaultValue:!0},{id:"launch-dock-reveal",label:"Dock Reveal",type:"select",path:"launcher.dock.reveal",defaultValue:"resize",options:[{value:"resize",label:"Resize"},{value:"overlay",label:"Overlay"},{value:"push",label:"Push"},{value:"emerge",label:"Emerge"}]},{id:"launch-text-hidden",label:"Hide Text",type:"toggle",path:"launcher.textHidden",defaultValue:!1},{id:"launch-icon-text",label:"Agent Icon Text",type:"text",path:"launcher.agentIconText",defaultValue:"\u{1F4AC}"},{id:"launch-icon-name",label:"Agent Icon Name (Lucide)",type:"text",path:"launcher.agentIconName",defaultValue:"bot"},{id:"launch-icon-hidden",label:"Hide Agent Icon",type:"toggle",path:"launcher.agentIconHidden",defaultValue:!1},{id:"launch-icon-size",label:"Agent Icon Size",type:"slider",path:"launcher.agentIconSize",defaultValue:"40px",slider:{min:16,max:72,step:2}},{id:"launch-icon-url",label:"Icon Image URL",description:"Custom image URL (overrides emoji/lucide)",type:"text",path:"launcher.iconUrl",defaultValue:""},{id:"launch-header-icon-name",label:"Header Icon Name (Lucide)",type:"text",path:"launcher.headerIconName",defaultValue:"bot"},{id:"launch-header-icon-size",label:"Header Icon Size",type:"slider",path:"launcher.headerIconSize",defaultValue:"48px",slider:{min:24,max:80,step:2}},{id:"launch-header-icon-hidden",label:"Hide Header Icon",type:"toggle",path:"launcher.headerIconHidden",defaultValue:!1},{id:"launch-full-height",label:"Full Height",type:"toggle",path:"launcher.fullHeight",defaultValue:!1},{id:"launch-sidebar",label:"Sidebar Mode",type:"toggle",path:"launcher.sidebarMode",defaultValue:!1},{id:"launch-sidebar-width",label:"Sidebar Width",type:"text",path:"launcher.sidebarWidth",defaultValue:"420px"},{id:"launch-mobile-fullscreen",label:"Mobile Fullscreen",description:"Fullscreen on mobile devices",type:"toggle",path:"launcher.mobileFullscreen",defaultValue:!0},{id:"launch-mobile-breakpoint",label:"Mobile Breakpoint (px)",type:"text",path:"launcher.mobileBreakpoint",defaultValue:640,formatValue:e=>String(e??640),parseValue:e=>Number(e)},{id:"launch-height-offset",label:"Height Offset (px)",type:"text",path:"launcher.heightOffset",defaultValue:0,formatValue:e=>String(e??0),parseValue:e=>Number(e)},{id:"launch-collapsed-max-width",label:"Collapsed Max Width",description:"Max width of launcher pill when closed",type:"text",path:"launcher.collapsedMaxWidth",defaultValue:""},{id:"launch-cta-text",label:"CTA Icon Text",type:"text",path:"launcher.callToActionIconText",defaultValue:"\u2197"},{id:"launch-cta-name",label:"CTA Icon Name",type:"text",path:"launcher.callToActionIconName",defaultValue:""},{id:"launch-cta-hidden",label:"Hide CTA Icon",type:"toggle",path:"launcher.callToActionIconHidden",defaultValue:!1},{id:"launch-cta-size",label:"CTA Icon Size",type:"slider",path:"launcher.callToActionIconSize",defaultValue:"32px",slider:{min:16,max:64,step:2}},{id:"launch-cta-padding",label:"CTA Icon Padding",type:"slider",path:"launcher.callToActionIconPadding",defaultValue:"5px",slider:{min:0,max:24,step:1}},{id:"launch-cta-bg",label:"CTA Icon Background",type:"color",path:"launcher.callToActionIconBackgroundColor",defaultValue:""}]},ha={id:"send-button",title:"Send Button",collapsed:!0,fields:[{id:"send-use-icon",label:"Use Icon",type:"toggle",path:"sendButton.useIcon",defaultValue:!1},{id:"send-icon-text",label:"Icon Text",type:"text",path:"sendButton.iconText",defaultValue:"\u2191"},{id:"send-icon-name",label:"Icon Name (Lucide)",type:"text",path:"sendButton.iconName",defaultValue:""},{id:"send-size",label:"Size",type:"slider",path:"sendButton.size",defaultValue:"40px",slider:{min:24,max:64,step:2}},{id:"send-border-width",label:"Border Width",type:"slider",path:"sendButton.borderWidth",defaultValue:"0px",slider:{min:0,max:10,step:1}},{id:"send-padding-x",label:"Padding X",type:"slider",path:"sendButton.paddingX",defaultValue:"10px",slider:{min:0,max:32,step:1}},{id:"send-padding-y",label:"Padding Y",type:"slider",path:"sendButton.paddingY",defaultValue:"6px",slider:{min:0,max:32,step:1}},{id:"send-show-tooltip",label:"Show Tooltip",type:"toggle",path:"sendButton.showTooltip",defaultValue:!1},{id:"send-tooltip-text",label:"Tooltip Text",type:"text",path:"sendButton.tooltipText",defaultValue:"Send message"}]},ba={id:"close-button",title:"Close Button",collapsed:!0,fields:[{id:"close-size",label:"Size",type:"slider",path:"launcher.closeButtonSize",defaultValue:"32px",slider:{min:16,max:64,step:1}},{id:"close-placement",label:"Placement",type:"select",path:"launcher.closeButtonPlacement",defaultValue:"inline",options:[{value:"inline",label:"Inline"},{value:"top-right",label:"Top Right"}]},{id:"close-border-width",label:"Border Width",type:"slider",path:"launcher.closeButtonBorderWidth",defaultValue:"0px",slider:{min:0,max:8,step:1}},{id:"close-border-radius",label:"Border Radius",type:"slider",path:"launcher.closeButtonBorderRadius",defaultValue:"50%",slider:{min:0,max:100,step:1,isRadiusFull:!0}},{id:"close-icon-name",label:"Icon Name",type:"text",path:"launcher.closeButtonIconName",defaultValue:"x"},{id:"close-icon-text",label:"Icon Text",type:"text",path:"launcher.closeButtonIconText",defaultValue:"\xD7"},{id:"close-show-tooltip",label:"Show Tooltip",type:"toggle",path:"launcher.closeButtonShowTooltip",defaultValue:!0},{id:"close-tooltip-text",label:"Tooltip Text",type:"text",path:"launcher.closeButtonTooltipText",defaultValue:"Close chat"}]},ya={id:"clear-chat",title:"Clear Chat Button",collapsed:!0,fields:[{id:"clear-enabled",label:"Enabled",type:"toggle",path:"launcher.clearChat.enabled",defaultValue:!0},{id:"clear-placement",label:"Placement",type:"select",path:"launcher.clearChat.placement",defaultValue:"inline",options:[{value:"inline",label:"Inline"},{value:"top-right",label:"Top Right"}]},{id:"clear-icon-name",label:"Icon Name",type:"text",path:"launcher.clearChat.iconName",defaultValue:"refresh-cw"},{id:"clear-size",label:"Size",type:"slider",path:"launcher.clearChat.size",defaultValue:"32px",slider:{min:16,max:64,step:1}},{id:"clear-show-tooltip",label:"Show Tooltip",type:"toggle",path:"launcher.clearChat.showTooltip",defaultValue:!0},{id:"clear-tooltip-text",label:"Tooltip Text",type:"text",path:"launcher.clearChat.tooltipText",defaultValue:"Clear chat"}]},ka={id:"status-indicator",title:"Status Indicator",collapsed:!0,fields:[{id:"status-visible",label:"Visible",type:"toggle",path:"statusIndicator.visible",defaultValue:!0},{id:"status-align",label:"Alignment",type:"select",path:"statusIndicator.align",defaultValue:"right",options:[{value:"left",label:"Left"},{value:"center",label:"Center"},{value:"right",label:"Right"}]},{id:"status-idle-text",label:"Idle Text",type:"text",path:"statusIndicator.idleText",defaultValue:"Online"},{id:"status-connecting-text",label:"Connecting Text",type:"text",path:"statusIndicator.connectingText",defaultValue:"Connecting\u2026"},{id:"status-connected-text",label:"Connected Text",type:"text",path:"statusIndicator.connectedText",defaultValue:"Streaming\u2026"},{id:"status-error-text",label:"Error Text",type:"text",path:"statusIndicator.errorText",defaultValue:"Offline"}]},wa={id:"features",title:"Features",collapsed:!0,fields:[{id:"feat-voice",label:"Voice Recognition",description:"Enable voice input",type:"toggle",path:"voiceRecognition.enabled",defaultValue:!1},{id:"feat-auto-focus",label:"Auto Focus Input",description:"Focus input after panel opens",type:"toggle",path:"autoFocusInput",defaultValue:!1},{id:"feat-scroll-bottom-enabled",label:"Scroll To Bottom",description:"Show a jump-to-latest affordance when the user scrolls away from new content",type:"toggle",path:"features.scrollToBottom.enabled",defaultValue:!0},{id:"feat-scroll-bottom-icon",label:"Scroll To Bottom Icon",type:"text",path:"features.scrollToBottom.iconName",defaultValue:"arrow-down"},{id:"feat-scroll-bottom-label",label:"Scroll To Bottom Label",description:"Leave empty for icon-only mode",type:"text",path:"features.scrollToBottom.label",defaultValue:""}]},va={id:"stream-animation",title:"Stream Animation",description:"Control how assistant text appears while streaming.",collapsed:!0,fields:[{id:"stream-anim-type",label:"Animation",description:"Reveal effect applied to each assistant reply as it streams.",type:"select",path:"features.streamAnimation.type",defaultValue:"none",options:[{value:"none",label:"None"},{value:"typewriter",label:"Typewriter"},{value:"word-fade",label:"Word fade"},{value:"letter-rise",label:"Letter rise"},{value:"glyph-cycle",label:"Glyph cycle"},{value:"wipe",label:"Wipe"},{value:"pop-bubble",label:"Pop bubble"}]},{id:"stream-anim-placeholder",label:"Pre-first-token Placeholder",description:"What to show before the first token arrives.",type:"select",path:"features.streamAnimation.placeholder",defaultValue:"none",options:[{value:"none",label:"Typing indicator (default)"},{value:"skeleton",label:"Skeleton shimmer"}]},{id:"stream-anim-buffer",label:"Content Buffering",description:"Trim in-progress units so only complete words/lines reveal.",type:"select",path:"features.streamAnimation.buffer",defaultValue:"none",options:[{value:"none",label:"None: stream every character"},{value:"word",label:"Word: hold until whitespace"},{value:"line",label:"Line: hold until newline"}]},{id:"stream-anim-speed",label:"Per-unit Duration (ms)",description:"Animation length for each character or word.",type:"select",path:"features.streamAnimation.speed",defaultValue:120,options:[{value:"40",label:"40ms: snappy"},{value:"80",label:"80ms"},{value:"120",label:"120ms (default)"},{value:"200",label:"200ms"},{value:"320",label:"320ms"},{value:"480",label:"480ms: slow"}],formatValue:e=>String(e??120),parseValue:e=>Number(e)},{id:"stream-anim-duration",label:"Container Duration (ms)",description:"Length of container-level effects (pop-bubble, custom plugins).",type:"select",path:"features.streamAnimation.duration",defaultValue:1800,options:[{value:"600",label:"600ms"},{value:"1200",label:"1200ms"},{value:"1800",label:"1800ms (default)"},{value:"2400",label:"2400ms"},{value:"3600",label:"3600ms: slow"}],formatValue:e=>String(e??1800),parseValue:e=>Number(e)}]},Sa={id:"attachments-config",title:"Attachments",collapsed:!0,fields:[{id:"attach-enabled",label:"Enabled",type:"toggle",path:"attachments.enabled",defaultValue:!1},{id:"attach-max-files",label:"Max Files",type:"select",path:"attachments.maxFiles",defaultValue:4,options:[{value:"1",label:"1"},{value:"2",label:"2"},{value:"4",label:"4"},{value:"6",label:"6"},{value:"8",label:"8"},{value:"10",label:"10"}],formatValue:e=>String(e??4),parseValue:e=>Number(e)},{id:"attach-max-size",label:"Max File Size (MB)",type:"select",path:"attachments.maxFileSize",defaultValue:10*qe,options:[{value:"1",label:"1 MB"},{value:"5",label:"5 MB"},{value:"10",label:"10 MB"},{value:"25",label:"25 MB"},{value:"50",label:"50 MB"}],formatValue:na,parseValue:ra},{id:"attach-types",label:"Allowed File Types",type:"select",path:"attachments.allowedTypes",defaultValue:K.images,options:[{value:"images",label:"Images only"},{value:"images-pdf",label:"Images + PDF"},{value:"images-text-pdf",label:"Images + text + PDF"},{value:"all",label:"All supported types"}],formatValue:ia,parseValue:sa}]},xa={id:"artifacts-config",title:"Artifacts",collapsed:!0,fields:[{id:"art-enabled",label:"Enabled",description:"Show artifact sidebar for documents and components",type:"toggle",path:"features.artifacts.enabled",defaultValue:!1},{id:"art-appearance",label:"Pane Appearance",type:"select",path:"features.artifacts.layout.paneAppearance",defaultValue:"panel",options:[{value:"panel",label:"Panel (bordered)"},{value:"seamless",label:"Seamless"}]}]},Ta={id:"artifacts-customization",title:"Artifact Customization",collapsed:!0,fields:[{id:"art-toolbar",label:"Toolbar Preset",type:"select",path:"features.artifacts.layout.toolbarPreset",defaultValue:"default",options:[{value:"default",label:"Default"},{value:"document",label:"Document"}]},{id:"art-toolbar-title",label:"Toolbar Title",type:"text",path:"features.artifacts.layout.toolbarTitle",defaultValue:"Artifacts"},{id:"art-close-label",label:"Close Button Label",type:"text",path:"features.artifacts.layout.closeButtonLabel",defaultValue:"Close"},{id:"art-pane-width",label:"Pane Width",description:"CSS width (e.g. 40%, 28rem)",type:"text",path:"features.artifacts.layout.paneWidth",defaultValue:"40%"},{id:"art-pane-max-width",label:"Pane Max Width",type:"text",path:"features.artifacts.layout.paneMaxWidth",defaultValue:"28rem"},{id:"art-split-gap",label:"Split Gap",type:"text",path:"features.artifacts.layout.splitGap",defaultValue:"0"},{id:"art-pane-bg",label:"Pane Background",type:"color",path:"features.artifacts.layout.paneBackground",defaultValue:""},{id:"art-resizable",label:"Resizable",description:"Allow dragging the pane divider",type:"toggle",path:"features.artifacts.layout.resizable",defaultValue:!1},{id:"art-expand-panel",label:"Expand Panel When Open",description:"Widen the launcher panel to fit artifacts",type:"toggle",path:"features.artifacts.layout.expandLauncherPanelWhenOpen",defaultValue:!0}]},Ca={id:"api-integration",title:"API & Integration",description:"Runtime and integration options.",collapsed:!0,fields:[{id:"dev-api-url",label:"API URL",type:"text",path:"apiUrl",defaultValue:""},{id:"dev-flow",label:"Flow ID",type:"text",path:"flowId",defaultValue:""},{id:"dev-parser",label:"Stream Parser",type:"select",path:"parserType",defaultValue:"plain",options:[{value:"plain",label:"Plain Text"},{value:"json",label:"JSON"},{value:"regex-json",label:"Regex JSON"},{value:"xml",label:"XML"}]}]},Ra=[{value:"collapsed",label:"Collapsed card"},{value:"panel",label:"Side panel"},{value:"inline",label:"In conversation"}],Ge={type:"select",defaultValue:"panel",options:Ra,unsettable:!0,unsetLabel:"Use default",requiresCapability:"artifacts"},wt={id:"artifact-display-preferences",title:"Artifact display",description:"Choose where recognizable artifact groups appear.",requiresCapability:"artifacts",fields:[{...Ge,id:"artifact-display-files",label:"Generated files",description:"Default for HTML, CSV, documents, and code files.",path:"features.artifacts.display.files"},{...Ge,id:"artifact-display-components",label:"Registered UI components",description:"Charts, forms, cards, and custom UI rendered by the host.",path:"features.artifacts.display.byKind.component"},{...Ge,id:"artifact-display-default",label:"Other artifacts",description:"Plain documents and anything without a narrower rule.",path:"features.artifacts.display.default"},{id:"artifact-file-preview",label:"Render supported file previews",type:"toggle",path:"features.artifacts.filePreview.enabled",defaultValue:!0,unsettable:!0,unsetLabel:"Use default",requiresCapability:"artifacts"}]},Aa={id:"stream-display-preferences",title:"Tool calls and reasoning",description:"Control how agent activity appears in the conversation.",fields:[{id:"pref-show-tools",label:"Show tool calls",type:"toggle",path:"features.showToolCalls",defaultValue:!0,unsettable:!0,requiresCapability:"tools"},{id:"pref-tool-collapsed-mode",label:"Tool call summary",type:"select",path:"features.toolCallDisplay.collapsedMode",defaultValue:"tool-call",options:[{value:"tool-call",label:"Tool call"},{value:"tool-name",label:"Tool name"},{value:"tool-preview",label:"Tool preview"}],unsettable:!0,requiresCapability:"tools"},{id:"pref-tool-expandable",label:"Tool calls expandable",type:"toggle",path:"features.toolCallDisplay.expandable",defaultValue:!0,unsettable:!0,requiresCapability:"tools"},{id:"pref-tool-grouped",label:"Group sequential tool calls",type:"toggle",path:"features.toolCallDisplay.grouped",defaultValue:!1,unsettable:!0,requiresCapability:"tools"},{id:"pref-tool-grouped-mode",label:"Grouped tool detail",type:"select",path:"features.toolCallDisplay.groupedMode",defaultValue:"stack",options:[{value:"stack",label:"Show steps"},{value:"summary",label:"Summary only"}],unsettable:!0,requiresCapability:"tools"},{id:"pref-tool-loading-animation",label:"Tool loading animation",type:"select",path:"features.toolCallDisplay.loadingAnimation",defaultValue:"none",options:[{value:"none",label:"None"},{value:"pulse",label:"Pulse"},{value:"shimmer",label:"Shimmer"},{value:"shimmer-color",label:"Color shimmer"},{value:"rainbow",label:"Rainbow"}],unsettable:!0,requiresCapability:"tools"},{id:"pref-show-reasoning",label:"Show reasoning",type:"toggle",path:"features.showReasoning",defaultValue:!0,unsettable:!0,requiresCapability:"reasoning"},{id:"pref-reasoning-expandable",label:"Reasoning expandable",type:"toggle",path:"features.reasoningDisplay.expandable",defaultValue:!0,unsettable:!0,requiresCapability:"reasoning"},{id:"pref-reasoning-active-preview",label:"Reasoning preview while active",type:"toggle",path:"features.reasoningDisplay.activePreview",defaultValue:!1,unsettable:!0,requiresCapability:"reasoning"}]},vt={label:"Stream and artifacts",sections:[Aa,wt]},Ea={id:"debug-inspection",title:"Debug & Inspection",collapsed:!0,fields:[{id:"dev-tool-active-preview",label:"Tool Preview While Active",description:"Show a lightweight preview in collapsed active tool rows",type:"toggle",path:"features.toolCallDisplay.activePreview",defaultValue:!1},{id:"dev-tool-preview-lines",label:"Tool Preview Lines",type:"select",path:"features.toolCallDisplay.previewMaxLines",defaultValue:3,options:[{value:"1",label:"1"},{value:"2",label:"2"},{value:"3",label:"3"},{value:"4",label:"4"},{value:"5",label:"5"}],formatValue:e=>String(e??3),parseValue:e=>Number(e)},{id:"dev-tool-active-min-height",label:"Tool Active Min Height",description:"CSS min-height for collapsed active tool rows (e.g. 5rem)",type:"text",path:"features.toolCallDisplay.activeMinHeight",defaultValue:""},{id:"dev-reasoning-preview-lines",label:"Reasoning Preview Lines",type:"select",path:"features.reasoningDisplay.previewMaxLines",defaultValue:3,options:[{value:"1",label:"1"},{value:"2",label:"2"},{value:"3",label:"3"},{value:"4",label:"4"},{value:"5",label:"5"}],formatValue:e=>String(e??3),parseValue:e=>Number(e)},{id:"dev-reasoning-active-min-height",label:"Reasoning Active Min Height",description:"CSS min-height for collapsed active reasoning rows (e.g. 5rem)",type:"text",path:"features.reasoningDisplay.activeMinHeight",defaultValue:""},{id:"dev-debug",label:"Debug Mode",description:"Show debug information",type:"toggle",path:"debug",defaultValue:!1}]},Pa={id:"markdown",title:"Markdown Options",collapsed:!0,fields:[{id:"md-gfm",label:"GitHub Flavored Markdown",type:"toggle",path:"markdown.options.gfm",defaultValue:!0},{id:"md-breaks",label:"Line Breaks",type:"toggle",path:"markdown.options.breaks",defaultValue:!0},{id:"md-header-ids",label:"Header IDs",type:"toggle",path:"markdown.options.headerIds",defaultValue:!1},{id:"md-pedantic",label:"Pedantic Mode",type:"toggle",path:"markdown.options.pedantic",defaultValue:!1},{id:"md-silent",label:"Silent",type:"toggle",path:"markdown.options.silent",defaultValue:!1},{id:"md-disable-styles",label:"Disable Default Styles",type:"toggle",path:"markdown.disableDefaultStyles",defaultValue:!1}]},he=[{label:"Content",sections:[la,ca]},{label:"Layout",sections:[da,pa,ua,ga]},{label:"Widget",sections:[ma,fa,ha,ba,ya,ka]},{label:"Features",sections:[wa,va,Sa,xa,Ta]},vt,{label:"Developer",collapsedByDefault:!0,sections:[Ca,Ea,Pa]}],St=he.flatMap(e=>e.sections),xt={id:"theme-mode-v2",title:"Theme",description:"Choose how the interface adapts across light and dark mode.",collapsed:!1,fields:[{id:"color-mode",label:"Color Mode",type:"select",path:"colorScheme",defaultValue:"auto",options:[{value:"auto",label:"Auto"},{value:"light",label:"Light"},{value:"dark",label:"Dark"}]}]},Tt={id:"brand-palette-v2",title:"Brand Palette",description:"Set your brand, accent, and neutral colors. These are used to generate the interface theme.",collapsed:!1,fields:[{id:"bp-primary",label:"Primary",description:"Main brand color",type:"color",path:"theme.palette.colors.primary.500",defaultValue:"#171717"},{id:"bp-secondary",label:"Secondary",description:"Supporting brand color",type:"color",path:"theme.palette.colors.secondary.500",defaultValue:"#8b5cf6"},{id:"bp-accent",label:"Accent",description:"Highlight and decorative color",type:"color",path:"theme.palette.colors.accent.500",defaultValue:"#06b6d4"},{id:"bp-neutral",label:"Neutral",description:"Backgrounds, text, and borders",type:"color",path:"theme.palette.colors.gray.500",defaultValue:"#6b7280"}]},Ct={id:"status-palette",title:"Status Palette",description:"Colors for system feedback states.",collapsed:!0,fields:[{id:"sp-success",label:"Success",type:"color",path:"theme.palette.colors.success.500",defaultValue:"#22c55e"},{id:"sp-warning",label:"Warning",type:"color",path:"theme.palette.colors.warning.500",defaultValue:"#eab308"},{id:"sp-error",label:"Error",type:"color",path:"theme.palette.colors.error.500",defaultValue:"#ef4444"},{id:"sp-notice",label:"Notice",description:"Info and notice states",type:"color",path:"theme.semantic.colors.feedback.info",defaultValue:"palette.colors.primary.500"}]},Rt={id:"interface-roles",title:"Interface Roles",description:"Control where brand and neutral colors appear across the interface.",collapsed:!1,fields:[{id:"role-surfaces",label:"Background Surfaces",type:"role-assignment",path:"theme.semantic.colors.background",roleAssignment:se},{id:"role-header",label:"Header",type:"role-assignment",path:"theme.components.header.background",roleAssignment:ie},{id:"role-user-messages",label:"User Messages",type:"role-assignment",path:"theme.components.message.user.background",roleAssignment:le},{id:"role-assistant-messages",label:"Assistant Messages",type:"role-assignment",path:"theme.components.message.assistant.background",roleAssignment:ce},{id:"role-primary-actions",label:"Primary Actions",type:"role-assignment",path:"theme.components.button.primary.background",roleAssignment:de},{id:"role-scroll-to-bottom",label:"Scroll To Bottom",type:"role-assignment",path:"theme.components.scrollToBottom.background",roleAssignment:pe},{id:"role-input",label:"Input Field",type:"role-assignment",path:"theme.components.input.background",roleAssignment:ue},{id:"role-links-focus",label:"Links & Focus",type:"role-assignment",path:"theme.semantic.colors.accent",roleAssignment:ge},{id:"role-borders",label:"Borders & Dividers",type:"role-assignment",path:"theme.semantic.colors.border",roleAssignment:me}]},At={id:"status-colors",title:"Status Colors",description:"Used for system states like success, warning, notice, and error.",collapsed:!0,fields:[{id:"sc-notice",label:"Notice",type:"token-ref",path:"theme.semantic.colors.feedback.info",defaultValue:"palette.colors.primary.500",tokenRef:{tokenType:"color"}},{id:"sc-success",label:"Success",type:"token-ref",path:"theme.semantic.colors.feedback.success",defaultValue:"palette.colors.success.500",tokenRef:{tokenType:"color"}},{id:"sc-warning",label:"Warning",type:"token-ref",path:"theme.semantic.colors.feedback.warning",defaultValue:"palette.colors.warning.500",tokenRef:{tokenType:"color"}},{id:"sc-error",label:"Error",type:"token-ref",path:"theme.semantic.colors.feedback.error",defaultValue:"palette.colors.error.500",tokenRef:{tokenType:"color"}}]},Et={id:"advanced-tokens",title:"Advanced Tokens",description:"Override individual semantic and component values when you need precise control.",collapsed:!0,fields:[]},Ia=[xt,Tt,Ct,Rt,At,Et],Ye=[{id:"style",label:"Style",sections:N},{id:"design-system",label:"Design System",sections:kt},{id:"configure",label:"Configure",sections:St}];function Pt(e,t){return e.startsWith("theme.")?e.replace(/^theme\./,`${t}.`):e}function Da(e,t,o){return{...e,id:`${o}-${e.id}`,path:Pt(e.path,t)}}function Va(e,t){let o=e.find(a=>a.id===t);if(!o)throw new Error(`Section "${t}" not found in definitions`);return o}function Ba(e,t,o,a=e.collapsed){let r=o==="light"?"Light":"Dark",n=o==="light"?"Applies when the widget is in light mode.":"Applies when the widget is in dark mode.";return{...e,id:`${o}-${e.id}`,title:`${r} ${e.title}`,description:e.description?`${n} ${e.description}`:n,collapsed:a,fields:e.fields.map(s=>Da(s,t,o)),presets:e.presets?.map(s=>({...s,id:`${o}-${s.id}`,values:Object.fromEntries(Object.entries(s.values).map(([l,c])=>[Pt(l,t),c]))}))}}var Ke={id:"default-light",name:"Default Light",description:"Clean monochrome light theme",theme:{components:{artifact:{pane:{background:"semantic.colors.container",toolbarBackground:"semantic.colors.container"}}}},preview:{primary:"#171717",surface:"#ffffff",accent:"#0f0f0f"},tags:["light"]},Xe={id:"default-dark",name:"Default Dark",description:"Monochrome dark theme",theme:{palette:{colors:{primary:{50:"#ffffff",100:"#f5f5f5",200:"#d4d4d4",300:"#a3a3a3",400:"#737373",500:"#171717",600:"#0f0f0f",700:"#0a0a0a",800:"#050505",900:"#030303",950:"#000000"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},secondary:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},accent:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},success:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},warning:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},error:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"}}},semantic:{colors:{primary:"palette.colors.primary.400",secondary:"palette.colors.gray.400",accent:"palette.colors.primary.500",surface:"palette.colors.gray.800",background:"palette.colors.gray.900",container:"palette.colors.gray.800",text:"palette.colors.gray.100",textMuted:"palette.colors.gray.400",textInverse:"palette.colors.gray.900",border:"palette.colors.gray.700",divider:"palette.colors.gray.700",interactive:{default:"palette.colors.primary.400",hover:"palette.colors.primary.300",focus:"palette.colors.primary.500",active:"palette.colors.primary.600",disabled:"palette.colors.gray.600"},feedback:{success:"palette.colors.success.400",warning:"palette.colors.warning.400",error:"palette.colors.error.400",info:"palette.colors.primary.400"}}},components:{markdown:{link:{foreground:"palette.colors.primary.300"}}}},preview:{primary:"#171717",surface:"#1f2937",accent:"#0f0f0f"},tags:["dark"]},It=[{id:"persona-default",name:"Persona Default",description:"Adaptive Persona theme with light and dark modes",theme:Ke.theme,darkTheme:Xe.theme,preview:Ke.preview,darkPreview:Xe.preview,tags:["light","dark","adaptive"]},Ke,Xe,{id:"high-contrast",name:"High Contrast",description:"Maximum contrast for accessibility",theme:{semantic:{colors:{primary:"palette.colors.primary.700",secondary:"palette.colors.gray.700",accent:"palette.colors.primary.800",surface:"palette.colors.gray.50",background:"palette.colors.gray.50",container:"palette.colors.gray.200",text:"palette.colors.gray.950",textMuted:"palette.colors.gray.700",textInverse:"palette.colors.gray.50",border:"palette.colors.gray.400",divider:"palette.colors.gray.400",interactive:{default:"palette.colors.primary.700",hover:"palette.colors.primary.800",focus:"palette.colors.primary.900",active:"palette.colors.primary.950",disabled:"palette.colors.gray.400"},feedback:{success:"palette.colors.success.700",warning:"palette.colors.warning.700",error:"palette.colors.error.700",info:"palette.colors.primary.700"}}}},preview:{primary:"#0a0a0a",surface:"#f9fafb",accent:"#050505"},tags:["light","high-contrast","accessibility"]}],X=[...It];function Ze(e){return X.find(t=>t.id===e)}var Oa={desktop:{w:1280,h:800},mobile:{w:390,h:844}},La=.15,_a=1.5,be="persona-preview-shell-theme",Dt={load:()=>null,save:()=>{},clear:()=>{}},Vt=["How do I get started?","Pricing & plans","Talk to support"];function Bt(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Ot(e){return e==="dark"?{pageBg:"linear-gradient(180deg, #0f172a 0%, #020617 100%)",chromeBg:"#111827",chromeBorder:"#1f2937",dot:"#475569",skeleton:"#334155",cardBg:"#1e293b",cardBorder:"rgba(148, 163, 184, 0.16)"}:{pageBg:"linear-gradient(180deg, #ffffff 0%, #f8fafc 100%)",chromeBg:"#ffffff",chromeBorder:"#e5e7eb",dot:"#cbd5e1",skeleton:"#e2e8f0",cardBg:"#e2e8f0",cardBorder:"rgba(148, 163, 184, 0.18)"}}function Je(e){let t=Ot(e);return`* { box-sizing: border-box; }
1
+ var Fe={background:"semantic.colors.primary",foreground:"semantic.colors.textInverse",border:"transparent",size:"48px",iconSize:"24px",borderRadius:"palette.radius.full",shadow:"0 8px 24px rgba(0,0,0,.16)",offset:"20px"};var gt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function F(e,t){if(!e)return t;if(!t)return e;let o={...e};for(let[a,r]of Object.entries(t)){let n=o[a];gt(n)&&gt(r)?o[a]=F(n,r):o[a]=r}return o}var N="min(440px, calc(100vw - 24px))",mt="440px",xo="40px",Ne="How can I help...",wo={collapsedMode:"tool-call",activePreview:!1,grouped:!1,groupedMode:"stack",previewMaxLines:3,expandable:!0,loadingAnimation:"none"},So={activePreview:!1,previewMaxLines:3,expandable:!0,loadingAnimation:"none"},To={enabled:!0,mountMode:"floating",dock:{side:"right",width:"420px"},title:"Chat Assistant",subtitle:"Here to help you get answers fast",agentIconText:"\u{1F4AC}",agentIconName:"bot",headerIconName:"bot",position:"bottom-right",width:N,heightOffset:0,autoExpand:!1,callToActionIconHidden:!1,agentIconSize:"40px",headerIconSize:xo,closeButtonPaddingX:"0px",closeButtonPaddingY:"0px",callToActionIconName:"arrow-up-right",callToActionIconText:"",callToActionIconSize:"32px",callToActionIconPadding:"5px",callToActionIconColor:void 0,callToActionIconBackgroundColor:void 0,closeButtonBackgroundColor:"transparent",clearChat:{backgroundColor:"transparent",borderColor:"transparent",enabled:!0,placement:"inline",iconName:"refresh-cw",showTooltip:!0,tooltipText:"Clear chat",paddingX:"0px",paddingY:"0px"},headerIconHidden:!1,border:void 0,shadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)"},Co={apiUrl:"https://api.runtype.com/api/chat/dispatch",clientToken:void 0,agentId:void 0,target:void 0,theme:void 0,darkTheme:void 0,colorScheme:"light",tooltip:{delayMs:200,skipDelayMs:300},launcher:To,copy:{inputPlaceholder:Ne,sendButtonLabel:"Send"},sendButton:{borderWidth:"0px",paddingX:"12px",paddingY:"10px",borderColor:void 0,useIcon:!0,iconText:"\u2191",showTooltip:!0,tooltipText:"Send message",iconName:"send"},statusIndicator:{visible:!0,idleText:"Online",connectingText:"Connecting\u2026",connectedText:"Streaming\u2026",errorText:"Offline"},voiceRecognition:{enabled:!0,pauseDuration:2e3,iconName:"mic",borderWidth:"0px",iconColor:void 0,backgroundColor:"transparent",borderColor:"transparent",recordingIconColor:void 0,recordingBackgroundColor:void 0,recordingBorderColor:"transparent",showTooltip:!0,tooltipText:"Start voice recognition"},features:{showReasoning:!0,showToolCalls:!0,scrollToBottom:{enabled:!0,iconName:"arrow-down",label:""},scrollBehavior:{mode:"anchor-top",anchorTopOffset:16,showActivityWhilePinned:!0},toolCallDisplay:wo,reasoningDisplay:So,streamAnimation:{type:"none",placeholder:"none",speed:120,duration:1800},askUserQuestion:{enabled:!0,slideInMs:180,freeTextLabel:"Other\u2026",freeTextPlaceholder:"Type your answer\u2026",submitLabel:"Send"},history:{enabled:!1,presentation:"panel",showScopeStatus:!0,showDelete:!0,showDeleteAll:!0}},suggestionChips:["Show me what you can help with","Walk me through getting started","Answer a question about this page"],suggestionChipsConfig:{fontFamily:"sans-serif",fontWeight:"500",paddingX:"12px",paddingY:"6px"},layout:{header:{layout:"default",showIcon:!0,showTitle:!0,showSubtitle:!0,showCloseButton:!0,showClearChat:!0},messages:{layout:"bubble",avatar:{show:!1,position:"left"},timestamp:{show:!1,position:"below"},groupConsecutive:!1},slots:{}},markdown:{options:{gfm:!0,breaks:!0},disableDefaultStyles:!1},messageActions:{enabled:!0,showCopy:!0,showUpvote:!1,showDownvote:!1,visibility:"hover",align:"right",layout:"pill-inside"},debug:!1},Ao={},Ro={variant:"circle",width:"min(400px, calc(100vw - 24px))",headerIconSize:"20px"},Eo={launcher:Ro,features:{toolCallDisplay:{variant:"row",iconVisibility:"active",autoExpand:!1,grouped:!0,groupedMode:"collapsible",loadingAnimation:"shimmer"},reasoningDisplay:{variant:"row",iconVisibility:"active",autoExpand:!1,loadingAnimation:"shimmer"}},composer:{layout:"single-row",placement:"overlay"},sendButton:{iconName:"arrow-up"},statusIndicator:{mode:"transient"},layout:{contentMaxWidth:"768px",topFade:!0,header:{showSubtitle:!1},messages:{assistant:{width:"full"}}}};function E(e){return e?.future?.v5Defaults===!0?"v5":"v4"}function P(e){let t=E(e)==="v5"?Eo:Ao;return F(Co,t)}var ln=P();var He="16px",$e="transparent",Po=(()=>{let e={};for(let t of[0,1,2,3,4,5,6,8,10,12,16,20,24,32,40,48,56,64])e[t]=t===0?"0px":`${t/4}rem`;return e})(),X={colors:{primary:{50:"#ffffff",100:"#f5f5f5",200:"#d4d4d4",300:"#a3a3a3",400:"#737373",500:"#171717",600:"#0f0f0f",700:"#0a0a0a",800:"#050505",900:"#030303",950:"#000000"},secondary:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},accent:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},success:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},warning:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},error:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},info:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"}},spacing:Po,typography:{fontFamily:{sans:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',serif:'Georgia, Cambria, "Times New Roman", Times, serif',mono:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},fontSize:{xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem"},fontWeight:{normal:"400",medium:"500",semibold:"600",bold:"700"},lineHeight:{tight:"1.25",normal:"1.5",relaxed:"1.625"}},shadows:{none:"none",sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)"},borders:{none:"none",sm:"1px solid",md:"2px solid",lg:"4px solid"},radius:{none:"0px",sm:"0.125rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem",full:"9999px"}},ie={colors:{primary:"palette.colors.primary.500",secondary:"palette.colors.secondary.500",accent:"palette.colors.primary.600",surface:"palette.colors.gray.50",background:"palette.colors.gray.50",container:"palette.colors.gray.50",text:"palette.colors.gray.900",textMuted:"palette.colors.gray.500",textInverse:"palette.colors.gray.50",border:"palette.colors.gray.200",divider:"palette.colors.gray.200",interactive:{default:"palette.colors.primary.600",hover:"palette.colors.primary.700",focus:"palette.colors.primary.600",active:"palette.colors.primary.600",disabled:"palette.colors.gray.300"},feedback:{success:"palette.colors.success.500",warning:"palette.colors.warning.500",error:"palette.colors.error.500",info:"palette.colors.info.500"}},spacing:{xs:"palette.spacing.1",sm:"palette.spacing.2",md:"palette.spacing.4",lg:"palette.spacing.6",xl:"palette.spacing.8","2xl":"palette.spacing.10"},typography:{fontFamily:"palette.typography.fontFamily.sans",fontSize:"palette.typography.fontSize.base",fontWeight:"palette.typography.fontWeight.normal",lineHeight:"palette.typography.lineHeight.normal"}},T={button:{primary:{background:"palette.colors.primary.500",foreground:"palette.colors.primary.50",borderRadius:"palette.radius.lg",padding:"semantic.spacing.md"},secondary:{background:"semantic.colors.surface",foreground:"semantic.colors.secondary",borderRadius:"palette.radius.lg",padding:"semantic.spacing.md"},ghost:{background:"transparent",foreground:"semantic.colors.text",borderRadius:"palette.radius.md",padding:"semantic.spacing.sm",hoverBackground:"rgba(0, 0, 0, 0.05)"}},input:{background:"semantic.colors.surface",placeholder:"semantic.colors.textMuted",borderRadius:"palette.radius.lg",padding:"semantic.spacing.md",focus:{border:"palette.colors.gray.400",ring:"palette.colors.gray.400"}},launcher:{background:"semantic.colors.surface",foreground:"semantic.colors.primary",border:"semantic.colors.border",size:"60px",iconSize:"28px",borderRadius:"palette.radius.full",shadow:"palette.shadows.lg"},panel:{width:N,maxWidth:"none",height:"min(640px, max(200px, calc(100vh - 64px)))",maxHeight:"none",borderRadius:"palette.radius.xl",shadow:"palette.shadows.xl",inset:He,canvasBackground:$e,modes:{floating:{border:"1px solid var(--persona-border)",shadow:"palette.shadows.xl",borderRadius:"palette.radius.xl"},inline:{border:"1px solid var(--persona-border)",shadow:"none",borderRadius:"palette.radius.xl"},docked:{border:"none",shadow:"none",borderRadius:"palette.radius.xl"},sidebar:{border:"none",borderRadius:"0"},mobile:{border:"none",shadow:"none",borderRadius:"0"}}},header:{background:"palette.colors.primary.500",foreground:"palette.colors.primary.50",borderRadius:"palette.radius.xl palette.radius.xl 0 0",padding:"20px 24px",minimalPadding:"16px 24px",iconBackground:"palette.colors.primary.600",iconForeground:"palette.colors.primary.50"},message:{gap:"12px",user:{background:"palette.colors.primary.500",text:"palette.colors.primary.50",borderRadius:"palette.radius.lg",shadow:"palette.shadows.sm"},assistant:{background:"semantic.colors.container",text:"semantic.colors.text",borderRadius:"palette.radius.lg",border:"semantic.colors.border",shadow:"palette.shadows.sm"},border:"semantic.colors.border"},introCard:{background:"transparent",borderRadius:"palette.radius.2xl",padding:"semantic.spacing.lg",shadow:"palette.shadows.none"},suggestion:{chip:{background:"semantic.colors.surface",foreground:"semantic.colors.text",border:"semantic.colors.border",borderRadius:"palette.radius.full",padding:"0.5rem 0.875rem",gap:"0.5rem",itemGap:"8px",minHeight:"36px",fontSize:"0.8125rem",lineHeight:"1.25",iconSize:"16px",hoverBackground:"palette.colors.gray.100",hoverBorder:"palette.colors.gray.300",pressedBackground:"palette.colors.gray.200",focusRing:"semantic.colors.interactive.focus",disabledOpacity:"0.5"},card:{background:"semantic.colors.surface",foreground:"semantic.colors.text",border:"semantic.colors.border",borderRadius:"palette.radius.xl",padding:"1rem",shadow:"palette.shadows.sm",gap:"0.625rem",itemGap:"8px",minHeight:"72px",fontSize:"0.875rem",lineHeight:"1.35",iconSize:"18px",hoverBackground:"palette.colors.gray.100",hoverBorder:"palette.colors.gray.300",pressedBackground:"palette.colors.gray.200",focusRing:"semantic.colors.interactive.focus",disabledOpacity:"0.5"},list:{background:"transparent",foreground:"semantic.colors.text",border:"semantic.colors.border",borderRadius:"palette.radius.md",padding:"0.75rem",gap:"0.625rem",itemGap:"8px",minHeight:"44px",fontSize:"0.875rem",lineHeight:"1.35",iconSize:"17px",hoverBackground:"palette.colors.gray.100",hoverBorder:"palette.colors.gray.300",pressedBackground:"palette.colors.gray.200",focusRing:"semantic.colors.interactive.focus",disabledOpacity:"0.5"}},toolBubble:{shadow:"palette.shadows.sm"},reasoningBubble:{shadow:"palette.shadows.sm"},composer:{shadow:"palette.shadows.none"},scrollbar:{thumb:"semantic.colors.border",track:"transparent"},markdown:{inlineCode:{background:"palette.colors.gray.50",foreground:"palette.colors.gray.900"},link:{foreground:"palette.colors.primary.600"},prose:{fontFamily:"inherit"},codeBlock:{background:"semantic.colors.container",borderColor:"semantic.colors.border",textColor:"inherit",borderRadius:"palette.radius.md"},table:{headerBackground:"semantic.colors.container",borderColor:"semantic.colors.border"},hr:{color:"semantic.colors.divider"},blockquote:{borderColor:"palette.colors.gray.900",background:"transparent",textColor:"palette.colors.gray.500"}},collapsibleWidget:{container:"palette.colors.gray.50",surface:"semantic.colors.surface",border:"semantic.colors.border"},voice:{recording:{indicator:"palette.colors.error.500",background:"palette.colors.error.50",border:"palette.colors.error.200"},processing:{icon:"palette.colors.primary.500",background:"palette.colors.primary.50"},speaking:{icon:"palette.colors.success.500"}},approval:{requested:{background:"semantic.colors.surface",border:"semantic.colors.border",text:"palette.colors.gray.900",shadow:"0 1px 2px 0 rgba(11, 11, 11, 0.06), 0 2px 8px 0 rgba(11, 11, 11, 0.04)"},approve:{background:"semantic.colors.primary",foreground:"semantic.colors.textInverse",borderRadius:"palette.radius.md",padding:"semantic.spacing.sm"},deny:{background:"semantic.colors.container",foreground:"semantic.colors.text",borderRadius:"palette.radius.md",padding:"semantic.spacing.sm"}},attachment:{image:{background:"palette.colors.gray.100",border:"palette.colors.gray.200"}},eventStream:{badge:{flow:{background:"palette.colors.success.100",foreground:"palette.colors.success.700"},step:{background:"palette.colors.primary.100",foreground:"palette.colors.primary.700"},reasoning:{background:"palette.colors.warning.100",foreground:"palette.colors.warning.700"},tool:{background:"palette.colors.purple.100",foreground:"palette.colors.purple.800"},agent:{background:"palette.colors.teal.100",foreground:"palette.colors.teal.800"},error:{background:"palette.colors.error.100",foreground:"palette.colors.error.700"},default:{background:"palette.colors.gray.100",foreground:"palette.colors.gray.600"}}},scrollToBottom:{background:"components.button.primary.background",foreground:"components.button.primary.foreground",border:"semantic.colors.primary",size:"40px",borderRadius:"palette.radius.full",shadow:"palette.shadows.sm",padding:"0.5rem 0.875rem",gap:"0.5rem",fontSize:"0.875rem",iconSize:"14px"},artifact:{pane:{background:"semantic.colors.container",toolbarBackground:"semantic.colors.container"}}},Do=X.colors.gray,Vo={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},Io={...X,colors:{...X.colors,gray:Do}},_o={...X,colors:{...X.colors,gray:Vo},radius:{none:"0px",sm:"4px",md:"8px",lg:"12px",xl:"16px","2xl":"24px",full:"9999px"}};var Bo=ie,Lo={...ie,colors:{...ie.colors,surface:"#ffffff",background:"#ffffff",container:"semantic.colors.surface",textInverse:"#ffffff"},typography:{...ie.typography,fontSize:"14px",lineHeight:"1.5"}};var ft=T,Oo={...T,launcher:Fe,activity:{rowHeight:"32px",labelSize:"13px",iconSize:"16px",indent:"0px",groupIndent:"0px",groupGap:"0px",groupPadding:"0px",transcriptGap:"0px",responseGap:"12px",bodyPadding:"4px 0",bodySize:"13px",bodyLineHeight:"1.5",bodyFontWeight:"400",sectionGap:"8px",bodySurface:"transparent"},toolBubble:{shadow:"none"},reasoningBubble:{shadow:"none"},input:{...T.input,borderRadius:"palette.radius.full"},introCard:{...T.introCard,title:{fontSize:"22px",fontWeight:"500"}},suggestion:{chip:{...T.suggestion.chip,fontWeight:"400"},card:{...T.suggestion.card,fontWeight:"400"},list:{...T.suggestion.list,fontWeight:"400"}},panel:{...T.panel,width:"min(400px, calc(100vw - 24px))",height:"min(704px, calc(100dvh - 104px))",borderRadius:"palette.radius.xl"},header:{...T.header,background:"semantic.colors.container",foreground:"semantic.colors.text",padding:"8px 8px 8px 16px",minimalPadding:"8px 8px 8px 16px",minHeight:"48px",borderBottom:"none",iconBackground:"transparent",iconForeground:"semantic.colors.text",iconScale:"1",controlSize:"28px",controlIconSize:"18px",controlStrokeWidth:"1.5",actionIconForeground:"semantic.colors.textMuted",controlBorderRadius:"8px",controlHoverBackground:"color-mix(in srgb, var(--persona-text) 8%, transparent)",controlHoverForeground:"semantic.colors.text",controlFocusOutline:"2px solid color-mix(in srgb, var(--persona-text) 50%, transparent)",title:{fontSize:"14px",fontWeight:"500",lineHeight:"1.5"}},message:{...T.message,gap:"20px",fullscreenGap:"28px",topFadeHeight:"18px",user:{...T.message.user,background:"palette.colors.gray.100",text:"semantic.colors.text",borderRadius:"palette.radius.xl",shadow:"none",padding:"8px 14px",fontSize:"14px",lineHeight:"1.5"},assistant:{...T.message.assistant,background:"transparent",border:"transparent",borderWidth:"0px",borderRadius:"0px",shadow:"none",padding:"0px",fontSize:"14px",lineHeight:"1.55"}},composer:{...T.composer,padding:"8px",fontSize:"15px",lineHeight:"1.5",controlSize:"32px",controlIconSize:"20px",sendIconSize:"18px",sendButtonRadius:"9999px",footerBorder:"none",overlayBand:"linear-gradient(to bottom, transparent, var(--persona-container) 24px)",focusBorderColor:"color-mix(in srgb, var(--persona-text) 28%, var(--persona-border))",focusRing:"1px solid color-mix(in srgb, var(--persona-text) 12%, transparent)"}};var Mo=e=>E({future:e}),ze=e=>Mo(e)==="v5"?{palette:_o,semantic:Lo,components:Oo}:{palette:Io,semantic:Bo,components:ft};function Wo(e){let t=[],o=[];return e.palette||t.push({path:"palette",message:"Theme must include a palette",severity:"error"}),e.semantic||o.push({path:"semantic",message:"No semantic tokens defined - defaults will be used",severity:"warning"}),e.components||o.push({path:"components",message:"No component tokens defined - defaults will be used",severity:"warning"}),{valid:t.length===0,errors:t,warnings:o}}function ht(e,t){let o={...e};for(let[a,r]of Object.entries(t)){let n=o[a];n&&typeof n=="object"&&!Array.isArray(n)&&r&&typeof r=="object"&&!Array.isArray(r)?o[a]=ht(n,r):o[a]=r}return o}function Fo(e,t){return t?ht(e,t):e}function w(e,t={}){let o=ze(t.future),a={palette:o.palette,semantic:o.semantic,components:o.components},r={palette:{...a.palette,...e?.palette,colors:{...a.palette.colors,...e?.palette?.colors},spacing:{...a.palette.spacing,...e?.palette?.spacing},typography:{...a.palette.typography,...e?.palette?.typography},shadows:{...a.palette.shadows,...e?.palette?.shadows},borders:{...a.palette.borders,...e?.palette?.borders},radius:{...a.palette.radius,...e?.palette?.radius}},semantic:{...a.semantic,...e?.semantic,colors:{...a.semantic.colors,...e?.semantic?.colors,interactive:{...a.semantic.colors.interactive,...e?.semantic?.colors?.interactive},feedback:{...a.semantic.colors.feedback,...e?.semantic?.colors?.feedback}},spacing:{...a.semantic.spacing,...e?.semantic?.spacing},typography:{...a.semantic.typography,...e?.semantic?.typography}},components:Fo(a.components,e?.components)},n=e?.components?.activity;for(let g of["toolBubble","reasoningBubble"])for(let f of["rowHeight","labelSize","iconSize","indent","bodySurface"])n?.[f]!==void 0&&(r.components[g][f]=n[f]);let s=e?.components?.collapsibleWidget?.surface;s!==void 0&&n?.bodySurface===void 0&&(r.components.activity={...r.components.activity,bodySurface:s});let i=e?.components?.header;i?.padding!==void 0&&i.minimalPadding===void 0&&(r.components.header.minimalPadding=r.components.header.padding);let l=e?.components?.message;if(l?.gap!==void 0&&l.fullscreenGap===void 0&&(r.components.message.fullscreenGap=r.components.message.gap),t.validate!==!1){let g=Wo(r);if(!g.valid)throw new Error(`Theme validation failed: ${g.errors.map(f=>f.message).join(", ")}`)}if(t.plugins)for(let g of t.plugins)r=g.transform(r);return r}var No={colors:{primary:{50:"#ffffff",100:"#f5f5f5",200:"#d4d4d4",300:"#a3a3a3",400:"#737373",500:"#171717",600:"#0f0f0f",700:"#0a0a0a",800:"#050505",900:"#030303",950:"#000000"},secondary:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},accent:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},success:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},warning:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},error:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"}}},le={components:{button:{ghost:{hoverBackground:"rgba(255, 255, 255, 0.08)"}},markdown:{link:{foreground:"palette.colors.primary.300"}},eventStream:{badge:{flow:{background:"palette.colors.success.900",foreground:"palette.colors.success.300"},step:{background:"palette.colors.primary.800",foreground:"palette.colors.primary.200"},reasoning:{background:"palette.colors.warning.900",foreground:"palette.colors.warning.300"},tool:{background:"palette.colors.purple.900",foreground:"palette.colors.purple.300"},agent:{background:"palette.colors.teal.900",foreground:"palette.colors.teal.300"},error:{background:"palette.colors.error.900",foreground:"palette.colors.error.300"},default:{background:"palette.colors.gray.800",foreground:"palette.colors.gray.300"}}},history:{dangerForeground:"#f87171",confirm:{dangerBackground:"palette.colors.error.600",scrim:"rgba(0, 0, 0, 0.6)"}}}},bt=No,vn={...bt,colors:{...bt.colors,primary:{50:"#0f0f10",100:"#27272a",200:"#3f3f46",300:"#52525b",400:"#71717a",500:"#f4f4f5",600:"#e4e4e7",700:"#d4d4d8",800:"#a1a1aa",900:"#fafafa",950:"#ffffff"},gray:{50:"#1a1a1b",100:"#27272a",200:"#2a2a2d",300:"#52525b",400:"#71717a",500:"#a1a1aa",600:"#b4b4bd",700:"#d4d4d8",800:"#e4e4e7",900:"#f4f4f5",950:"#fafafa"}}};var xn={semantic:{colors:{primary:"palette.colors.primary.500",accent:"palette.colors.primary.600",background:"#0f0f10",surface:"palette.colors.gray.50",container:"#1c1c20",text:"palette.colors.gray.900",textMuted:"palette.colors.gray.500",textInverse:"#0f0f10",border:"palette.colors.gray.200",divider:"palette.colors.gray.200",interactive:{default:"palette.colors.primary.600",hover:"palette.colors.primary.700",focus:"palette.colors.primary.600",active:"palette.colors.primary.600"}}},components:{...le.components,button:{...le.components?.button,primary:{background:"semantic.colors.primary",foreground:"palette.colors.primary.50"}},markdown:{inlineCode:{background:"palette.colors.gray.100",foreground:"semantic.colors.text"},link:{foreground:"semantic.colors.accent"},codeBlock:{background:"semantic.colors.container",borderColor:"semantic.colors.border",textColor:"semantic.colors.text"},table:{headerBackground:"palette.colors.gray.100",borderColor:"semantic.colors.border"},blockquote:{background:"semantic.colors.container",borderColor:"palette.colors.gray.300",textColor:"semantic.colors.textMuted"}},eventStream:{...le.components?.eventStream,badge:{...le.components?.eventStream?.badge,step:{background:"palette.colors.gray.100",foreground:"palette.colors.gray.700"},default:{background:"palette.colors.gray.100",foreground:"palette.colors.gray.700"}}}}};function Ue(e,t){let o=t.split("."),a=e;for(let r of o){if(a==null)return;a=a[r]}return a}function B(e,t,o){let a=t.split(".");if(a.length===1)return{...e,[a[0]]:o};let[r,...n]=a,s=e;return{...s,[r]:B(s?.[r]??{},n.join("."),o)}}function J(e,t){let o=t.split(".");if(o.length===1){let l={...e};return delete l[o[0]],l}let[a,...r]=o,n=e,s=J(n?.[a]??{},r.join(".")),i={...n};return typeof s=="object"&&s!==null&&!Array.isArray(s)&&Object.keys(s).length===0?delete i[a]:i[a]=s,i}var je=class{constructor(t,o,a){this.listeners=[];this.history=[];this.historyIndex=-1;this.suppressHistory=!1;this.authoredConfig={};this.authoredTheme={};this.mergeDefaults=!0;this.snapshotIntent=new WeakMap;let r=a?.mergeDefaults??!0;this.mergeDefaults=r,this.authoredConfig={...o},this.authoredTheme=t??{};let n=P(o);this.config=r?{...n,...o}:o??n,this.theme=w(t,{validate:!1,future:this.config.future}),this.syncThemeIntoConfig(),this.pushHistorySnapshot(this.exportSnapshot(),!0)}get(t){return t.startsWith("theme.")?Ue(this.theme,t.replace("theme.","")):t.startsWith("darkTheme.")?Ue(this.config.darkTheme??{},t.replace("darkTheme.","")):Ue(this.config,t)}getTheme(){return this.theme}getConfig(){return this.config}set(t,o){let a=E(this.config);if(this.recordIntent(t,o),t.startsWith("theme.")){let r=t.replace("theme.","");this.theme=B(this.theme,r,o),this.syncThemeIntoConfig()}else if(t.startsWith("darkTheme.")){let r=t.replace("darkTheme.",""),n=this.config.darkTheme??w(void 0,{future:this.config.future});this.config={...this.config,darkTheme:B(n,r,o)}}else this.config=B(this.config,t,o);this.rebaseDefaults(a),this.recordHistory(),this.notifyListeners()}unset(t){let o=E(this.config);if(this.recordIntent(t,void 0,!0),t.startsWith("theme.")){let a=t.replace("theme.","");this.theme=J(this.theme,a),this.syncThemeIntoConfig()}else if(t.startsWith("darkTheme.")){let a=t.replace("darkTheme.","");this.config={...this.config,darkTheme:J(this.config.darkTheme??{},a)}}else this.config=J(this.config,t);this.rebaseDefaults(o),this.recordHistory(),this.notifyListeners()}setBatch(t){let o=E(this.config),a=!1,r=!1,n=!1;for(let[s,i]of Object.entries(t))if(this.recordIntent(s,i),s.startsWith("theme.")){let l=s.replace("theme.","");this.theme=B(this.theme,l,i),a=!0}else if(s.startsWith("darkTheme.")){let l=s.replace("darkTheme.",""),g=this.config.darkTheme??w(void 0,{future:this.config.future});this.config={...this.config,darkTheme:B(g,l,i)},r=!0}else this.config=B(this.config,s,i),n=!0;a&&this.syncThemeIntoConfig(),this.rebaseDefaults(o),(a||r||n)&&(this.recordHistory(),this.notifyListeners())}setTheme(t){this.authoredTheme=t,this.theme=t,this.syncThemeIntoConfig(),this.recordHistory(),this.notifyListeners()}setFullConfig(t,o){this.authoredConfig={...t},o&&(this.authoredTheme=o),this.config={...t},o&&(this.theme=o),this.syncThemeIntoConfig(),this.recordHistory(),this.notifyListeners()}importSnapshot(t){if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Snapshot must be a JSON object");let o=t;if("config"in o||"theme"in o||o.version===2){let r=o.config??this.config,n=w(o.theme??this.theme,{validate:!1,future:r.future});this.setFullConfig(r,n);return}let a=w(o,{validate:!1,future:this.config.future});this.setTheme(a)}resetToDefaults(){let t=this.config.future;this.authoredConfig=t?{future:t}:{},this.authoredTheme={},this.config={...P({future:t}),...t?{future:t}:{}},this.theme=w(void 0,{future:this.config.future}),this.syncThemeIntoConfig(),this.history=[],this.historyIndex=-1,this.pushHistorySnapshot(this.exportSnapshot()),this.notifyListeners()}canUndo(){return this.historyIndex>0}canRedo(){return this.historyIndex>=0&&this.historyIndex<this.history.length-1}getHistoryLength(){return this.history.length}getHistoryIndex(){return this.historyIndex}undo(){this.canUndo()&&(this.historyIndex-=1,this.restoreSnapshot(this.history[this.historyIndex]))}redo(){this.canRedo()&&(this.historyIndex+=1,this.restoreSnapshot(this.history[this.historyIndex]))}exportSnapshot(){return{version:2,config:{...this.config,theme:void 0},theme:this.theme}}onChange(t){return this.listeners.push(t),()=>{let o=this.listeners.indexOf(t);o>=0&&this.listeners.splice(o,1)}}recordIntent(t,o,a=!1){let r=(n,s)=>a||o===void 0?J(n,s):B(n,s,o);t.startsWith("theme.")?this.authoredTheme=r(this.authoredTheme,t.slice(6)):t==="theme"?this.authoredTheme=o??{}:this.authoredConfig=r(this.authoredConfig,t)}rebaseDefaults(t){t!==E(this.config)&&(this.config=this.mergeDefaults?F(P(this.authoredConfig),this.authoredConfig):{...this.authoredConfig},this.theme=w(this.authoredTheme,{validate:!1,future:this.config.future}),this.syncThemeIntoConfig())}syncThemeIntoConfig(){this.config={...this.config,theme:this.theme}}notifyListeners(){for(let t of this.listeners)t(this.config,this.theme)}recordHistory(){this.pushHistorySnapshot(this.exportSnapshot())}pushHistorySnapshot(t,o=!1){if(this.suppressHistory)return;this.snapshotIntent.set(t,{config:this.authoredConfig,theme:this.authoredTheme});let a=JSON.stringify(t),r=this.historyIndex>=0&&this.history[this.historyIndex]?JSON.stringify(this.history[this.historyIndex]):null;if(o&&this.historyIndex>=0){this.history[this.historyIndex]=t;return}let n=this.historyIndex>=0?this.snapshotIntent.get(this.history[this.historyIndex]):void 0;a===r&&JSON.stringify(this.snapshotIntent.get(t))===JSON.stringify(n)||(this.history=this.history.slice(0,this.historyIndex+1),this.history.push(t),this.historyIndex=this.history.length-1)}restoreSnapshot(t){this.suppressHistory=!0;let o=this.snapshotIntent.get(t);this.authoredConfig=o?.config??t.config,this.authoredTheme=o?.theme??t.theme,this.config=t.config,this.theme=w(t.theme,{validate:!1,future:this.config.future}),this.syncThemeIntoConfig(),this.suppressHistory=!1,this.notifyListeners()}};function Ge(e){let t=e.trim();if(t==="9999px")return{value:100,unit:"px"};let o=t.match(/^([\d.]+)(px|rem)$/);if(!o){let a=parseFloat(t);return{value:isNaN(a)?0:a,unit:"px"}}return{value:parseFloat(o[1]),unit:o[2]}}function qe(e,t){return t==="rem"?`${e}rem`:`${e}px`}function Ho(e,t){return t==="rem"?e*16:e}function $o(e,t){return t==="rem"?e/16:e}function Q(e){if(!e)return"#000000";let t=e.trim().toLowerCase();return t==="transparent"?"transparent":t.startsWith("rgba")||t.startsWith("rgb")?t:t.startsWith("#")?t.length===4?`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`:t:`#${t}`}function Ke(e){return/^#[0-9A-Fa-f]{6}$/.test(e)}function Ye(e){let t=e.trim().toLowerCase().match(/^rgba?\(([^)]+)\)$/);if(!t)return null;let o=t[1].split(",").map(l=>l.trim());if(o.length<3)return null;let a=l=>{let g=l.endsWith("%"),f=parseFloat(g?l.slice(0,-1):l);return Number.isFinite(f)?Math.max(0,Math.min(255,Math.round(g?f/100*255:f))):NaN},r=a(o[0]),n=a(o[1]),s=a(o[2]);if(!Number.isFinite(r)||!Number.isFinite(n)||!Number.isFinite(s))return null;let i=l=>l.toString(16).padStart(2,"0");return`#${i(r)}${i(n)}${i(s)}`}function ce(e,t){let o=n=>{let s=Q(n),i=s.startsWith("rgb")?Ye(s)??"#000000":s,l=[1,3,5].map(g=>{let f=parseInt(i.slice(g,g+2),16)/255;return f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4)});return .2126*l[0]+.7152*l[1]+.0722*l[2]},a=o(e),r=o(t);return(Math.max(a,r)+.05)/(Math.min(a,r)+.05)}function yt(e){let t=Q(e),o=t.startsWith("rgb")?Ye(t)??"#000000":t,a=parseInt(o.slice(1,3),16)/255,r=parseInt(o.slice(3,5),16)/255,n=parseInt(o.slice(5,7),16)/255,s=Math.max(a,r,n),i=Math.min(a,r,n),l=(s+i)/2;if(s===i)return{h:0,s:0,l};let g=s-i,f=l>.5?g/(2-s-i):g/(s+i),x;switch(s){case a:x=((r-n)/g+(r<n?6:0))/6;break;case r:x=((n-a)/g+2)/6;break;default:x=((a-r)/g+4)/6;break}return{h:x*360,s:f,l}}function kt(e,t,o){let a=(e%360+360)%360,r=(1-Math.abs(2*o-1))*t,n=r*(1-Math.abs(a/60%2-1)),s=o-r/2,i,l,g;a<60?[i,l,g]=[r,n,0]:a<120?[i,l,g]=[n,r,0]:a<180?[i,l,g]=[0,r,n]:a<240?[i,l,g]=[0,n,r]:a<300?[i,l,g]=[n,0,r]:[i,l,g]=[r,0,n];let f=x=>{let C=Math.round((x+s)*255).toString(16);return C.length===1?"0"+C:C};return`#${f(i)}${f(l)}${f(g)}`}function Ze(e){let{h:t,s:o,l:a}=yt(e),r={50:.97,100:.94,200:.87,300:.77,400:.64,500:a,600:Math.max(.05,a-.1),700:Math.max(.05,a-.2),800:Math.max(.05,a-.28),900:Math.max(.05,a-.35),950:Math.max(.03,a-.42)},n={50:Math.min(1,o*.85),100:Math.min(1,o*.9),200:Math.min(1,o*.95),300:o,400:o,500:o,600:Math.min(1,o*1.05),700:Math.min(1,o*1.05),800:Math.min(1,o*1),900:Math.min(1,o*.95),950:Math.min(1,o*.9)},s={};for(let[i,l]of Object.entries(r)){let g=n[i];s[i]=kt(t,g,l)}return s}var H=["50","100","200","300","400","500","600","700","800","900","950"],Xe=["primary","secondary","accent","gray","success","warning","error","info"];function zo(e,t){return`palette.colors.${e}.${t}`}function vt(e,t,o=0){if(o>5)return"#cbd5e1";let a=e(t);return typeof a!="string"?"#cbd5e1":a.startsWith("#")||a.startsWith("rgb")||a==="transparent"?a:a.startsWith("palette.")||a.startsWith("semantic.")||a.startsWith("components.")?vt(e,`theme.${a}`,o+1):"#cbd5e1"}function Uo(e){if(!e.startsWith("palette.")&&!e.startsWith("semantic."))return e;let t=e.split(".");if(t[0]==="palette"&&t[1]==="colors"){let o=t[2],a=t[3];return`${o.charAt(0).toUpperCase()+o.slice(1)} ${a}`}return t[0]==="semantic"?t.slice(1).map(o=>o.charAt(0).toUpperCase()+o.slice(1)).join(" "):t[t.length-1]}var A=[{id:"solid",label:"Solid"},{id:"soft",label:"Soft"}],de=["primary","secondary","accent","gray"],jo={primary:"Primary",secondary:"Secondary",accent:"Accent",gray:"Neutral"},pe={roleId:"role-surfaces",helper:"Page and panel backgrounds",previewZone:"container",intensities:A,targets:[{path:"semantic.colors.background",kind:"background"},{path:"semantic.colors.surface",kind:"background"},{path:"semantic.colors.container",kind:"background"}]},ue={roleId:"role-header",helper:"Widget header bar",previewZone:"header",intensities:A,targets:[{path:"components.header.background",kind:"background"},{path:"components.header.foreground",kind:"foreground"},{path:"components.header.border",kind:"border"},{path:"components.header.iconBackground",kind:"accent"},{path:"components.header.iconForeground",kind:"foreground"},{path:"components.header.titleForeground",kind:"accent"},{path:"components.header.subtitleForeground",kind:"foreground"},{path:"components.header.actionIconForeground",kind:"foreground"}]},ge={roleId:"role-user-messages",helper:"User chat bubbles",previewZone:"user-message",intensities:A,targets:[{path:"components.message.user.background",kind:"background"},{path:"components.message.user.text",kind:"foreground"}]},me={roleId:"role-assistant-messages",helper:"Assistant chat bubbles",previewZone:"assistant-message",intensities:A,targets:[{path:"components.message.assistant.background",kind:"background"},{path:"components.message.assistant.text",kind:"foreground"}]},fe={roleId:"role-primary-actions",helper:"Send button and primary buttons",intensities:A,targets:[{path:"components.button.primary.background",kind:"background"},{path:"components.button.primary.foreground",kind:"foreground"},{path:"semantic.colors.interactive.default",kind:"accent"},{path:"semantic.colors.interactive.hover",kind:"accent"}]},he={roleId:"role-scroll-to-bottom",helper:"Scroll-to-bottom affordances in transcript and event stream",intensities:A,targets:[{path:"components.scrollToBottom.background",kind:"background"},{path:"components.scrollToBottom.foreground",kind:"foreground"},{path:"components.scrollToBottom.border",kind:"border"}]},be={roleId:"role-input",helper:"Message input field",previewZone:"composer",intensities:A,targets:[{path:"components.input.background",kind:"background"},{path:"components.input.placeholder",kind:"foreground"},{path:"components.input.focus.border",kind:"accent"},{path:"components.input.focus.ring",kind:"accent"}]},ye={roleId:"role-links-focus",helper:"Links, focus rings, and interactive highlights",intensities:A,targets:[{path:"semantic.colors.accent",kind:"accent"},{path:"semantic.colors.interactive.focus",kind:"accent"},{path:"semantic.colors.interactive.active",kind:"accent"},{path:"components.markdown.link.foreground",kind:"accent"}]},ke={roleId:"role-borders",helper:"Borders, dividers, and separators",intensities:A,targets:[{path:"semantic.colors.border",kind:"border"},{path:"semantic.colors.divider",kind:"border"}]},L=[pe,ue,ge,me,fe,he,be,ye,ke];function ve(e,t,o){let a={},r=e==="neutral"?"gray":e;for(let n of o.targets){let s=Go(r,t,n,o.roleId);a[`theme.${n.path}`]=s,a[`darkTheme.${n.path}`]=s}if(o.roleId==="role-primary-actions"){let n=t==="solid"?`palette.colors.${r}.700`:`palette.colors.${r}.200`;a["theme.semantic.colors.interactive.hover"]=n,a["darkTheme.semantic.colors.interactive.hover"]=n}return a}function Go(e,t,o,a){let r=t==="solid";if(a==="role-header")return qo(e,r,o);if(a==="role-input")return Ko(e,r,o);switch(o.kind){case"background":return r?`palette.colors.${e}.500`:`palette.colors.${e}.${e==="gray"?"50":"100"}`;case"foreground":return r?`palette.colors.${e==="gray"?"gray":e}.50`:`palette.colors.${e==="gray"?"gray":e}.900`;case"border":return r?`palette.colors.${e}.600`:`palette.colors.${e}.200`;case"accent":return r?`palette.colors.${e}.600`:`palette.colors.${e}.400`}}function qo(e,t,o){let a=o.path;return a.endsWith(".background")?t?`palette.colors.${e}.500`:`palette.colors.${e}.${e==="gray"?"50":"100"}`:a.endsWith(".border")?t?`palette.colors.${e}.600`:`palette.colors.${e}.200`:a.endsWith(".iconBackground")?t?`palette.colors.${e}.${e==="gray"?"700":"600"}`:`palette.colors.${e}.500`:a.endsWith(".iconForeground")?t?`palette.colors.${e}.50`:`palette.colors.${e}.50`:a.endsWith(".foreground")||a.endsWith(".titleForeground")?t?`palette.colors.${e}.50`:`palette.colors.${e}.${e==="gray"?"900":"700"}`:a.endsWith(".subtitleForeground")?t?`palette.colors.${e}.200`:`palette.colors.${e}.500`:a.endsWith(".actionIconForeground")?t?`palette.colors.${e}.200`:`palette.colors.${e}.500`:`palette.colors.${e}.500`}function Ko(e,t,o){let a=o.path;return a.endsWith(".background")?t?`palette.colors.${e}.${e==="gray"?"100":"50"}`:`palette.colors.${e}.50`:a.endsWith(".placeholder")?`palette.colors.${e}.400`:a.endsWith(".border")||a.endsWith(".ring")?t?`palette.colors.${e}.500`:`palette.colors.${e}.400`:`palette.colors.${e}.500`}var Yo=/^palette\.colors\.(\w+)\.(\d+)$/;function Je(e,t){let o=t.targets.find(i=>i.kind==="background")??t.targets[0];if(!o)return null;let r=String(e(o.path)??"").match(Yo);if(!r)return null;let n=r[1],s=de.includes(n)?n:null;if(!s)return null;for(let i of["solid","soft"]){let l=ve(s,i,t);if(t.targets.every(f=>String(e(f.path)??"")===l[`theme.${f.path}`]))return{family:s,intensity:i}}return null}var k=e=>String(e??"").trim()||void 0,xt=e=>typeof e=="number"?`${e}px`:String(e??"").trim(),Ct=e=>String(e??"").trim(),Zo={id:"theme-mode",title:"Runtime Theme",description:"Controls how the shipped widget picks light or dark mode.",collapsed:!1,fields:[{id:"theme-mode",label:"Runtime Theme",description:"Always Light, Always Dark, or follow the visitor system preference",type:"select",path:"colorScheme",defaultValue:"auto",options:[{value:"light",label:"Light"},{value:"dark",label:"Dark"},{value:"auto",label:"Follow System"}]}]},Xo={id:"brand-colors",title:"Brand Colors",description:"Pick your brand colors. A full shade scale is generated automatically for both light and dark themes.",collapsed:!1,fields:[{id:"brand-primary",label:"Primary",description:"Main brand color for buttons, links, and accents",type:"color",path:"theme.palette.colors.primary.500",defaultValue:"#171717"},{id:"brand-secondary",label:"Secondary",description:"Supporting brand color",type:"color",path:"theme.palette.colors.secondary.500",defaultValue:"#7c3aed"},{id:"brand-accent",label:"Accent",description:"Highlight and decorative color",type:"color",path:"theme.palette.colors.accent.500",defaultValue:"#06b6d4"}]},Jo={id:"chat-colors",title:"Chat Colors",description:"Customize the main colors of the chat interface.",collapsed:!0,fields:[{id:"chat-header-bg",label:"Header Background",type:"token-ref",path:"theme.components.header.background",defaultValue:"semantic.colors.surface",tokenRef:{tokenType:"color"}},{id:"chat-header-fg",label:"Header Foreground",description:"Anchors the header text. The title takes it, the subtitle and button icons take a 72% mix of it over the background",type:"token-ref",path:"theme.components.header.foreground",defaultValue:"",tokenRef:{tokenType:"color"}},{id:"chat-header-icon-bg",label:"Header Icon Background",type:"token-ref",path:"theme.components.header.iconBackground",defaultValue:"semantic.colors.primary",tokenRef:{tokenType:"color"}},{id:"chat-header-icon-fg",label:"Header Icon Color",type:"token-ref",path:"theme.components.header.iconForeground",defaultValue:"semantic.colors.textInverse",tokenRef:{tokenType:"color"}},{id:"chat-header-title-fg",label:"Header Title Color",description:"Blank follows the header foreground",type:"token-ref",path:"theme.components.header.titleForeground",defaultValue:"",tokenRef:{tokenType:"color"}},{id:"chat-header-subtitle-fg",label:"Header Subtitle Color",description:"Blank follows the 72% foreground mix",type:"token-ref",path:"theme.components.header.subtitleForeground",defaultValue:"",tokenRef:{tokenType:"color"}},{id:"chat-header-action-icons-fg",label:"Header Button Icons",description:"Blank follows the 72% foreground mix",type:"token-ref",path:"theme.components.header.actionIconForeground",defaultValue:"",tokenRef:{tokenType:"color"}},{id:"chat-msg-user-bg",label:"User Message Background",type:"token-ref",path:"theme.components.message.user.background",defaultValue:"semantic.colors.primary",tokenRef:{tokenType:"color"}},{id:"chat-msg-user-text",label:"User Message Text",type:"token-ref",path:"theme.components.message.user.text",defaultValue:"semantic.colors.textInverse",tokenRef:{tokenType:"color"}},{id:"chat-msg-assistant-bg",label:"Assistant Message Background",type:"token-ref",path:"theme.components.message.assistant.background",defaultValue:"semantic.colors.container",tokenRef:{tokenType:"color"}},{id:"chat-msg-assistant-text",label:"Assistant Message Text",type:"token-ref",path:"theme.components.message.assistant.text",defaultValue:"semantic.colors.text",tokenRef:{tokenType:"color"}}]},Qo={id:"typography",title:"Typography",collapsed:!0,fields:[{id:"typo-font-family",label:"Font Family",type:"select",path:"theme.semantic.typography.fontFamily",defaultValue:"palette.typography.fontFamily.sans",options:[{value:"palette.typography.fontFamily.sans",label:"Sans Serif"},{value:"palette.typography.fontFamily.serif",label:"Serif"},{value:"palette.typography.fontFamily.mono",label:"Monospace"}]},{id:"typo-font-size",label:"Base Font Size",type:"select",path:"theme.semantic.typography.fontSize",defaultValue:"palette.typography.fontSize.base",options:[{value:"palette.typography.fontSize.xs",label:"Extra Small (0.75rem)"},{value:"palette.typography.fontSize.sm",label:"Small (0.875rem)"},{value:"palette.typography.fontSize.base",label:"Base (1rem)"},{value:"palette.typography.fontSize.lg",label:"Large (1.125rem)"},{value:"palette.typography.fontSize.xl",label:"Extra Large (1.25rem)"}]},{id:"typo-font-weight",label:"Font Weight",type:"select",path:"theme.semantic.typography.fontWeight",defaultValue:"palette.typography.fontWeight.normal",options:[{value:"palette.typography.fontWeight.normal",label:"Normal (400)"},{value:"palette.typography.fontWeight.medium",label:"Medium (500)"},{value:"palette.typography.fontWeight.semibold",label:"Semibold (600)"},{value:"palette.typography.fontWeight.bold",label:"Bold (700)"}]},{id:"typo-line-height",label:"Line Height",type:"select",path:"theme.semantic.typography.lineHeight",defaultValue:"palette.typography.lineHeight.normal",options:[{value:"palette.typography.lineHeight.tight",label:"Tight (1.25)"},{value:"palette.typography.lineHeight.normal",label:"Normal (1.5)"},{value:"palette.typography.lineHeight.relaxed",label:"Relaxed (1.625)"}]}]},ea={id:"launcher-style",title:"Launcher",description:"Control launcher appearance.",collapsed:!0,fields:[{id:"style-launcher-size",label:"Launcher Size",type:"slider",path:"theme.components.launcher.size",defaultValue:"60px",slider:{min:32,max:80,step:2}},{id:"style-launcher-shape",label:"Launcher Shape",type:"select",path:"theme.components.launcher.borderRadius",defaultValue:"palette.radius.full",options:[{value:"palette.radius.md",label:"Rounded Square"},{value:"palette.radius.lg",label:"Rounded"},{value:"palette.radius.xl",label:"Very Rounded"},{value:"palette.radius.full",label:"Circle"}]},{id:"style-launcher-shadow",label:"Launcher Shadow",type:"select",path:"theme.components.launcher.shadow",defaultValue:"palette.shadows.lg",options:[{value:"palette.shadows.none",label:"None"},{value:"palette.shadows.sm",label:"Small"},{value:"palette.shadows.md",label:"Medium"},{value:"palette.shadows.lg",label:"Large"},{value:"palette.shadows.xl",label:"Extra Large"}]}]},ta={id:"shape",title:"Shape",description:"Control the corner roundness across the widget.",collapsed:!0,fields:[{id:"radius-sm",label:"Small",type:"slider",path:"theme.palette.radius.sm",defaultValue:"0.125rem",slider:{min:0,max:16,step:1}},{id:"radius-md",label:"Medium",type:"slider",path:"theme.palette.radius.md",defaultValue:"0.375rem",slider:{min:0,max:24,step:1}},{id:"radius-lg",label:"Large",type:"slider",path:"theme.palette.radius.lg",defaultValue:"0.5rem",slider:{min:0,max:32,step:1}},{id:"radius-xl",label:"Extra Large",type:"slider",path:"theme.palette.radius.xl",defaultValue:"0.75rem",slider:{min:0,max:48,step:1}},{id:"radius-full",label:"Full",type:"slider",path:"theme.palette.radius.full",defaultValue:"9999px",slider:{min:0,max:100,step:1,isRadiusFull:!0}}],presets:[{id:"radius-default",label:"Default",values:{"theme.palette.radius.sm":"0.125rem","theme.palette.radius.md":"0.375rem","theme.palette.radius.lg":"0.5rem","theme.palette.radius.xl":"0.75rem","theme.palette.radius.full":"9999px"}},{id:"radius-sharp",label:"Sharp",values:{"theme.palette.radius.sm":"1px","theme.palette.radius.md":"2px","theme.palette.radius.lg":"3px","theme.palette.radius.xl":"4px","theme.palette.radius.full":"4px"}},{id:"radius-rounded",label:"Rounded",values:{"theme.palette.radius.sm":"0.5rem","theme.palette.radius.md":"0.75rem","theme.palette.radius.lg":"1rem","theme.palette.radius.xl":"1.5rem","theme.palette.radius.full":"9999px"}}]},oa={id:"shadows",title:"Shadows",collapsed:!0,fields:[{id:"shadow-sm",label:"Small",type:"text",path:"theme.palette.shadows.sm",defaultValue:"0 1px 2px 0 rgb(0 0 0 / 0.05)"},{id:"shadow-md",label:"Medium",type:"text",path:"theme.palette.shadows.md",defaultValue:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"},{id:"shadow-lg",label:"Large",type:"text",path:"theme.palette.shadows.lg",defaultValue:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)"},{id:"shadow-xl",label:"Extra Large",type:"text",path:"theme.palette.shadows.xl",defaultValue:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)"}]},aa={id:"widget-style",title:"Widget Surface",description:"Adjust the main panel and message bubble treatment.",collapsed:!0,fields:[{id:"style-panel-radius",label:"Panel Corner Radius",type:"select",path:"theme.components.panel.borderRadius",defaultValue:"palette.radius.xl",options:[{value:"palette.radius.none",label:"None"},{value:"palette.radius.sm",label:"Small"},{value:"palette.radius.md",label:"Medium"},{value:"palette.radius.lg",label:"Large"},{value:"palette.radius.xl",label:"Extra Large"}]},{id:"style-panel-shadow",label:"Panel Shadow",type:"select",path:"theme.components.panel.shadow",defaultValue:"palette.shadows.xl",options:[{value:"palette.shadows.none",label:"None"},{value:"palette.shadows.sm",label:"Small"},{value:"palette.shadows.md",label:"Medium"},{value:"palette.shadows.lg",label:"Large"},{value:"palette.shadows.xl",label:"Extra Large"}]},{id:"style-panel-canvas-bg",label:"Detached Canvas Background",description:"Fills the region behind a detached panel; defaults to transparent",type:"token-ref",path:"theme.components.panel.canvasBackground",defaultValue:$e,tokenRef:{tokenType:"color"}},{id:"style-msg-user-radius",label:"User Message Radius",type:"select",path:"theme.components.message.user.borderRadius",defaultValue:"palette.radius.lg",options:[{value:"palette.radius.none",label:"None"},{value:"palette.radius.sm",label:"Small"},{value:"palette.radius.md",label:"Medium"},{value:"palette.radius.lg",label:"Large"},{value:"palette.radius.xl",label:"Extra Large"}]},{id:"style-msg-assistant-radius",label:"Assistant Message Radius",type:"select",path:"theme.components.message.assistant.borderRadius",defaultValue:"palette.radius.lg",options:[{value:"palette.radius.none",label:"None"},{value:"palette.radius.sm",label:"Small"},{value:"palette.radius.md",label:"Medium"},{value:"palette.radius.lg",label:"Large"},{value:"palette.radius.xl",label:"Extra Large"}]}]},z=[Xo,Jo,ea,Qo,Zo,ta,oa,aa];function At(){return{id:"brand-palette",title:"Brand Palette",description:"Define your color palette. Edit the base color (500) to auto-generate the full scale.",collapsed:!1,fields:Xe.map(t=>({id:`palette-${t}`,label:`${t.charAt(0).toUpperCase()+t.slice(1)}`,description:`${t} color palette (edit shade 500, auto-generate scale)`,type:"color-scale",path:`theme.palette.colors.${t}`,colorScale:{colorFamily:t}}))}}var Rt={id:"semantic-colors",title:"Semantic Colors",description:"Map intents to palette colors.",collapsed:!0,fields:[{id:"sem-primary",label:"Primary",description:"Main brand/action color",type:"token-ref",path:"theme.semantic.colors.primary",defaultValue:"palette.colors.primary.500",tokenRef:{tokenType:"color"}},{id:"sem-secondary",label:"Secondary",description:"Secondary actions",type:"token-ref",path:"theme.semantic.colors.secondary",defaultValue:"palette.colors.gray.500",tokenRef:{tokenType:"color"}},{id:"sem-accent",label:"Accent",description:"Accent/highlight color",type:"token-ref",path:"theme.semantic.colors.accent",defaultValue:"palette.colors.primary.600",tokenRef:{tokenType:"color"}},{id:"sem-surface",label:"Surface",description:"Primary surface background",type:"token-ref",path:"theme.semantic.colors.surface",defaultValue:"palette.colors.gray.50",tokenRef:{tokenType:"color"}},{id:"sem-background",label:"Background",description:"Page/widget background",type:"token-ref",path:"theme.semantic.colors.background",defaultValue:"palette.colors.gray.50",tokenRef:{tokenType:"color"}},{id:"sem-container",label:"Container",description:"Container/card background",type:"token-ref",path:"theme.semantic.colors.container",defaultValue:"palette.colors.gray.100",tokenRef:{tokenType:"color"}},{id:"sem-text",label:"Text",description:"Primary text color",type:"token-ref",path:"theme.semantic.colors.text",defaultValue:"palette.colors.gray.900",tokenRef:{tokenType:"color"}},{id:"sem-text-muted",label:"Text Muted",description:"Secondary/muted text",type:"token-ref",path:"theme.semantic.colors.textMuted",defaultValue:"palette.colors.gray.500",tokenRef:{tokenType:"color"}},{id:"sem-text-inverse",label:"Text Inverse",description:"Text on dark backgrounds",type:"token-ref",path:"theme.semantic.colors.textInverse",defaultValue:"palette.colors.gray.50",tokenRef:{tokenType:"color"}},{id:"sem-border",label:"Border",description:"Default border color",type:"token-ref",path:"theme.semantic.colors.border",defaultValue:"palette.colors.gray.200",tokenRef:{tokenType:"color"}},{id:"sem-divider",label:"Divider",description:"Divider/separator color",type:"token-ref",path:"theme.semantic.colors.divider",defaultValue:"palette.colors.gray.200",tokenRef:{tokenType:"color"}},{id:"sem-interactive-default",label:"Interactive Default",type:"token-ref",path:"theme.semantic.colors.interactive.default",defaultValue:"palette.colors.primary.500",tokenRef:{tokenType:"color"}},{id:"sem-interactive-hover",label:"Interactive Hover",type:"token-ref",path:"theme.semantic.colors.interactive.hover",defaultValue:"palette.colors.primary.600",tokenRef:{tokenType:"color"}},{id:"sem-interactive-focus",label:"Interactive Focus",type:"token-ref",path:"theme.semantic.colors.interactive.focus",defaultValue:"palette.colors.primary.700",tokenRef:{tokenType:"color"}},{id:"sem-interactive-active",label:"Interactive Active",type:"token-ref",path:"theme.semantic.colors.interactive.active",defaultValue:"palette.colors.primary.800",tokenRef:{tokenType:"color"}},{id:"sem-interactive-disabled",label:"Interactive Disabled",type:"token-ref",path:"theme.semantic.colors.interactive.disabled",defaultValue:"palette.colors.gray.300",tokenRef:{tokenType:"color"}},{id:"sem-feedback-success",label:"Success",type:"token-ref",path:"theme.semantic.colors.feedback.success",defaultValue:"palette.colors.success.500",tokenRef:{tokenType:"color"}},{id:"sem-feedback-warning",label:"Warning",type:"token-ref",path:"theme.semantic.colors.feedback.warning",defaultValue:"palette.colors.warning.500",tokenRef:{tokenType:"color"}},{id:"sem-feedback-error",label:"Error",type:"token-ref",path:"theme.semantic.colors.feedback.error",defaultValue:"palette.colors.error.500",tokenRef:{tokenType:"color"}},{id:"sem-feedback-info",label:"Info",type:"token-ref",path:"theme.semantic.colors.feedback.info",defaultValue:"palette.colors.primary.500",tokenRef:{tokenType:"color"}}]},ra=At(),na=Rt,sa=[At(),Rt],ia={id:"comp-panel",title:"Panel",collapsed:!1,fields:[{id:"panel-width",label:"Width",type:"text",path:"theme.components.panel.width",defaultValue:N},{id:"panel-max-width",label:"Max Width",type:"text",path:"theme.components.panel.maxWidth",defaultValue:mt},{id:"panel-height",label:"Height",type:"text",path:"theme.components.panel.height",defaultValue:"600px"},{id:"panel-max-height",label:"Max Height",type:"text",path:"theme.components.panel.maxHeight",defaultValue:"calc(100vh - 80px)"},{id:"panel-border-radius",label:"Border Radius",type:"select",path:"theme.components.panel.borderRadius",defaultValue:"palette.radius.xl",options:[{value:"palette.radius.none",label:"None"},{value:"palette.radius.sm",label:"Small"},{value:"palette.radius.md",label:"Medium"},{value:"palette.radius.lg",label:"Large"},{value:"palette.radius.xl",label:"Extra Large"}]},{id:"panel-shadow",label:"Shadow",type:"select",path:"theme.components.panel.shadow",defaultValue:"palette.shadows.xl",options:[{value:"palette.shadows.none",label:"None"},{value:"palette.shadows.sm",label:"Small"},{value:"palette.shadows.md",label:"Medium"},{value:"palette.shadows.lg",label:"Large"},{value:"palette.shadows.xl",label:"Extra Large"}]},{id:"panel-inset",label:"Detached Inset",description:"Gap around the card when launcher.detachedPanel is on",type:"text",path:"theme.components.panel.inset",defaultValue:He}]},la={id:"comp-launcher",title:"Launcher",collapsed:!0,fields:[{id:"launcher-size",label:"Size",type:"slider",path:"theme.components.launcher.size",defaultValue:"60px",slider:{min:32,max:80,step:2}},{id:"launcher-icon-size",label:"Icon Size",type:"slider",path:"theme.components.launcher.iconSize",defaultValue:"28px",slider:{min:16,max:48,step:2}},{id:"launcher-icon-stroke-width",label:"Icon Stroke Width",description:"Unitless line weight for the agent glyph and the call-to-action arrow",type:"slider",path:"theme.components.launcher.iconStrokeWidth",defaultValue:"1.5",slider:{min:1,max:2.5,step:.25,unit:"none"},parseValue:Ct},{id:"launcher-border-radius",label:"Border Radius",type:"select",path:"theme.components.launcher.borderRadius",defaultValue:"palette.radius.full",options:[{value:"palette.radius.md",label:"Medium"},{value:"palette.radius.lg",label:"Large"},{value:"palette.radius.xl",label:"Extra Large"},{value:"palette.radius.full",label:"Full (Circle)"}]},{id:"launcher-shadow",label:"Shadow",type:"select",path:"theme.components.launcher.shadow",defaultValue:"palette.shadows.lg",options:[{value:"palette.shadows.none",label:"None"},{value:"palette.shadows.sm",label:"Small"},{value:"palette.shadows.md",label:"Medium"},{value:"palette.shadows.lg",label:"Large"},{value:"palette.shadows.xl",label:"Extra Large"}]}]},ca={id:"comp-header-controls",title:"Header Controls",description:"One box, glyph, and stroke shared by every header icon button: close, clear chat, trailing actions, and Messages, plus the strip height.",collapsed:!0,fields:[{id:"header-min-height",label:"Header Min Height",description:"CSS length, e.g. 65px. Blank stays at the natural height",type:"text",path:"theme.components.header.minHeight",defaultValue:"",parseValue:k},{id:"header-control-size",label:"Control Size",description:"The button box. Coarse pointers still floor the hit area at 40px",type:"slider",path:"theme.components.header.controlSize",defaultValue:"32px",slider:{min:24,max:64,step:2},parseValue:xt},{id:"header-control-icon-size",label:"Icon Size",description:"The glyph inside the button",type:"slider",path:"theme.components.header.controlIconSize",defaultValue:"20px",slider:{min:12,max:40,step:1},parseValue:xt},{id:"header-control-stroke-width",label:"Icon Stroke Width",description:"Unitless line weight. The close X renders at 0.7 of it so its sparser glyph matches",type:"slider",path:"theme.components.header.controlStrokeWidth",defaultValue:"1.5",slider:{min:1,max:2.5,step:.25,unit:"none"},parseValue:Ct}]},da={id:"comp-history-rail-header",title:"Messages Rail Header",description:"The Messages rail top strip. Match its height to the header so both read as one band.",collapsed:!0,fields:[{id:"rail-header-min-height",label:"Min Height",description:"CSS length. Blank follows the header min height",type:"text",path:"theme.components.history.railHeader.minHeight",defaultValue:"",parseValue:k},{id:"rail-header-border",label:"Bottom Border",description:"Full border-bottom shorthand, e.g. 1px solid #333",type:"text",path:"theme.components.history.railHeader.border",defaultValue:"",parseValue:k}]},pa={id:"comp-history-rail-header-colors",title:"Messages Rail Header Colors",collapsed:!0,fields:[{id:"rail-header-bg",label:"Background",type:"token-ref",path:"theme.components.history.railHeader.background",defaultValue:"semantic.colors.container",tokenRef:{tokenType:"color"}}]},ua={id:"comp-history-overlay",title:"Messages Floating Rail",description:"The Messages rail floating over the conversation, when a collapsed rail opens on hover.",collapsed:!0,fields:[{id:"history-overlay-margin",label:"Margin",description:"Gap from the trigger, the docked edge and the bottom",type:"text",path:"theme.components.history.overlay.margin",defaultValue:"",parseValue:k},{id:"history-overlay-radius",label:"Corner Radius",description:"CSS length on all four corners. Blank keeps 16px",type:"text",path:"theme.components.history.overlay.borderRadius",defaultValue:"",parseValue:k},{id:"history-overlay-shadow",label:"Shadow",description:"Full box-shadow shorthand. Blank keeps the built-in elevation",type:"text",path:"theme.components.history.overlay.shadow",defaultValue:"",parseValue:k}]},ga={id:"comp-history-overlay-colors",title:"Messages Floating Rail Colors",collapsed:!0,fields:[{id:"history-overlay-bg",label:"Background",type:"token-ref",path:"theme.components.history.overlay.background",defaultValue:"semantic.colors.container",tokenRef:{tokenType:"color"}}]},ma={id:"comp-history-motion",title:"Messages Motion",description:"Enter and exit animation of the Messages body. The bar is persistent chrome and never animates; reduced-motion preferences always win.",collapsed:!0,fields:[{id:"history-motion-enter-ms",label:"Enter Duration",description:"Milliseconds, e.g. 180. 0 disables the entrance. Blank keeps 180",type:"text",path:"theme.components.history.motion.enterDurationMs",defaultValue:"",parseValue:k},{id:"history-motion-enter-easing",label:"Enter Easing",description:"CSS easing, e.g. ease-out or cubic-bezier(0, 0, 0.2, 1)",type:"text",path:"theme.components.history.motion.enterEasing",defaultValue:"",parseValue:k},{id:"history-motion-exit-ms",label:"Exit Duration",description:"Milliseconds, e.g. 160. 0 disables the exit. Blank keeps 160",type:"text",path:"theme.components.history.motion.exitDurationMs",defaultValue:"",parseValue:k},{id:"history-motion-exit-easing",label:"Exit Easing",description:"CSS easing, e.g. ease-in or cubic-bezier(0.4, 0, 1, 1)",type:"text",path:"theme.components.history.motion.exitEasing",defaultValue:"",parseValue:k}]},fa={id:"comp-tooltip",title:"Tooltip",description:"The hover and focus tooltip on icon controls, including its shortcut hint chip.",collapsed:!0,fields:[{id:"tooltip-radius",label:"Corner Radius",type:"select",path:"theme.components.tooltip.borderRadius",defaultValue:"palette.radius.sm",options:[{value:"palette.radius.none",label:"None"},{value:"palette.radius.sm",label:"Small"},{value:"palette.radius.md",label:"Medium"},{value:"palette.radius.lg",label:"Large"},{value:"palette.radius.xl",label:"Extra Large"}]},{id:"tooltip-font-size",label:"Font Size",description:"CSS length. Blank stays at 12px",type:"text",path:"theme.components.tooltip.fontSize",defaultValue:"",parseValue:k},{id:"tooltip-arrow",label:"Show Arrow",description:"The caret pointing at the control",type:"toggle",path:"theme.components.tooltip.arrow",defaultValue:!0}]},ha={id:"comp-tooltip-colors",title:"Tooltip Colors",collapsed:!0,fields:[{id:"tooltip-bg",label:"Background",type:"token-ref",path:"theme.components.tooltip.background",defaultValue:"palette.colors.gray.900",tokenRef:{tokenType:"color"}},{id:"tooltip-fg",label:"Label",type:"token-ref",path:"theme.components.tooltip.foreground",defaultValue:"palette.colors.primary.50",tokenRef:{tokenType:"color"}},{id:"tooltip-hint-fg",label:"Shortcut Hint",type:"token-ref",path:"theme.components.tooltip.hintForeground",defaultValue:"palette.colors.gray.400",tokenRef:{tokenType:"color"}}]},ba={id:"comp-message-shape",title:"Message Shape",collapsed:!0,fields:[{id:"msg-user-radius",label:"User Bubble Radius",type:"select",path:"theme.components.message.user.borderRadius",defaultValue:"palette.radius.lg",options:[{value:"palette.radius.none",label:"None"},{value:"palette.radius.sm",label:"Small"},{value:"palette.radius.md",label:"Medium"},{value:"palette.radius.lg",label:"Large"},{value:"palette.radius.xl",label:"Extra Large"}]},{id:"msg-assistant-radius",label:"Assistant Bubble Radius",type:"select",path:"theme.components.message.assistant.borderRadius",defaultValue:"palette.radius.lg",options:[{value:"palette.radius.none",label:"None"},{value:"palette.radius.sm",label:"Small"},{value:"palette.radius.md",label:"Medium"},{value:"palette.radius.lg",label:"Large"},{value:"palette.radius.xl",label:"Extra Large"}]}]},ya={id:"comp-input-shape",title:"Input Shape",collapsed:!0,fields:[{id:"input-radius",label:"Border Radius",type:"select",path:"theme.components.input.borderRadius",defaultValue:"palette.radius.lg",options:[{value:"palette.radius.none",label:"None"},{value:"palette.radius.sm",label:"Small"},{value:"palette.radius.md",label:"Medium"},{value:"palette.radius.lg",label:"Large"},{value:"palette.radius.xl",label:"Extra Large"}]}]},ka={id:"comp-composer-spacing",title:"Composer Spacing",collapsed:!0,fields:[{id:"composer-padding",label:"Padding",type:"text",path:"theme.components.composer.padding",defaultValue:"0.75rem 1rem"},{id:"composer-gap",label:"Row Gap",description:"Space between the textarea row and the actions row",type:"text",path:"theme.components.composer.gap",defaultValue:"0.5rem"},{id:"composer-font-size",label:"Font Size",type:"text",path:"theme.components.composer.fontSize",defaultValue:"0.875rem"},{id:"composer-line-height",label:"Line Height",type:"text",path:"theme.components.composer.lineHeight",defaultValue:"1.25rem"},{id:"composer-control-size",label:"Control Size",description:"Edge of every icon control in the action row",type:"slider",path:"theme.components.composer.controlSize",defaultValue:"40px",slider:{min:24,max:64,step:2}},{id:"composer-control-icon-size",label:"Control Icon Size",description:"Glyph inside those controls",type:"slider",path:"theme.components.composer.controlIconSize",defaultValue:"24px",slider:{min:12,max:40,step:1}}]},va={id:"comp-button-shape",title:"Button Shape",collapsed:!0,fields:[{id:"btn-primary-radius",label:"Primary Radius",type:"select",path:"theme.components.button.primary.borderRadius",defaultValue:"palette.radius.lg",options:[{value:"palette.radius.sm",label:"Small"},{value:"palette.radius.md",label:"Medium"},{value:"palette.radius.lg",label:"Large"},{value:"palette.radius.full",label:"Full"}]}]},xa={id:"comp-header-colors",title:"Header Colors",collapsed:!0,fields:[{id:"header-bg",label:"Background",type:"token-ref",path:"theme.components.header.background",defaultValue:"semantic.colors.surface",tokenRef:{tokenType:"color"}},{id:"header-fg",label:"Foreground",description:"Anchors the header text. Background and foreground together derive every color left blank below",type:"token-ref",path:"theme.components.header.foreground",defaultValue:"",tokenRef:{tokenType:"color"}},{id:"header-icon-bg",label:"Icon background",type:"token-ref",path:"theme.components.header.iconBackground",defaultValue:"semantic.colors.primary",tokenRef:{tokenType:"color"}},{id:"header-icon-fg",label:"Icon color",type:"token-ref",path:"theme.components.header.iconForeground",defaultValue:"semantic.colors.textInverse",tokenRef:{tokenType:"color"}},{id:"header-title-fg",label:"Title color",description:"Blank follows the header foreground",type:"token-ref",path:"theme.components.header.titleForeground",defaultValue:"",tokenRef:{tokenType:"color"}},{id:"header-subtitle-fg",label:"Subtitle color",description:"Blank follows a 72% mix of the foreground over the background",type:"token-ref",path:"theme.components.header.subtitleForeground",defaultValue:"",tokenRef:{tokenType:"color"}},{id:"header-action-icons-fg",label:"Clear / close icons",description:"Blank follows the same 72% foreground mix as the subtitle",type:"token-ref",path:"theme.components.header.actionIconForeground",defaultValue:"",tokenRef:{tokenType:"color"}},{id:"header-border",label:"Border",description:"Blank follows a 14% mix of the foreground over the background",type:"token-ref",path:"theme.components.header.border",defaultValue:"",tokenRef:{tokenType:"color"}}]},wa={id:"comp-message-colors",title:"Message Colors",collapsed:!0,fields:[{id:"msg-user-bg",label:"User Bubble Background",type:"token-ref",path:"theme.components.message.user.background",defaultValue:"semantic.colors.primary",tokenRef:{tokenType:"color"}},{id:"msg-user-text",label:"User Bubble Text",type:"token-ref",path:"theme.components.message.user.text",defaultValue:"semantic.colors.textInverse",tokenRef:{tokenType:"color"}},{id:"msg-assistant-bg",label:"Assistant Bubble Background",type:"token-ref",path:"theme.components.message.assistant.background",defaultValue:"semantic.colors.container",tokenRef:{tokenType:"color"}},{id:"msg-assistant-text",label:"Assistant Bubble Text",type:"token-ref",path:"theme.components.message.assistant.text",defaultValue:"semantic.colors.text",tokenRef:{tokenType:"color"}}]},Sa={id:"comp-input-colors",title:"Input Colors",collapsed:!0,fields:[{id:"input-bg",label:"Background",type:"token-ref",path:"theme.components.input.background",defaultValue:"semantic.colors.surface",tokenRef:{tokenType:"color"}},{id:"input-placeholder",label:"Placeholder Color",type:"token-ref",path:"theme.components.input.placeholder",defaultValue:"semantic.colors.textMuted",tokenRef:{tokenType:"color"}},{id:"input-focus-border",label:"Focus Border",type:"token-ref",path:"theme.components.input.focus.border",defaultValue:"semantic.colors.interactive.focus",tokenRef:{tokenType:"color"}},{id:"input-focus-ring",label:"Focus Ring",type:"token-ref",path:"theme.components.input.focus.ring",defaultValue:"semantic.colors.interactive.focus",tokenRef:{tokenType:"color"}}]},Ta={id:"comp-button-colors",title:"Button Colors",collapsed:!0,fields:[{id:"btn-primary-bg",label:"Primary Background",type:"token-ref",path:"theme.components.button.primary.background",defaultValue:"semantic.colors.primary",tokenRef:{tokenType:"color"}},{id:"btn-primary-fg",label:"Primary Foreground",type:"token-ref",path:"theme.components.button.primary.foreground",defaultValue:"semantic.colors.textInverse",tokenRef:{tokenType:"color"}},{id:"btn-secondary-bg",label:"Secondary Background",type:"token-ref",path:"theme.components.button.secondary.background",defaultValue:"semantic.colors.surface",tokenRef:{tokenType:"color"}},{id:"btn-secondary-fg",label:"Secondary Foreground",type:"token-ref",path:"theme.components.button.secondary.foreground",defaultValue:"semantic.colors.text",tokenRef:{tokenType:"color"}},{id:"btn-ghost-bg",label:"Ghost Background",type:"color",path:"theme.components.button.ghost.background",defaultValue:"transparent"},{id:"btn-ghost-fg",label:"Ghost Foreground",type:"token-ref",path:"theme.components.button.ghost.foreground",defaultValue:"semantic.colors.text",tokenRef:{tokenType:"color"}}]},Ca={id:"scroll-to-bottom-style",title:"Scroll To Bottom",description:"Style the floating jump-to-latest affordance.",collapsed:!0,fields:[{id:"scroll-bottom-bg",label:"Background",type:"token-ref",path:"theme.components.scrollToBottom.background",defaultValue:"components.button.primary.background",tokenRef:{tokenType:"color"}},{id:"scroll-bottom-fg",label:"Foreground",type:"token-ref",path:"theme.components.scrollToBottom.foreground",defaultValue:"components.button.primary.foreground",tokenRef:{tokenType:"color"}},{id:"scroll-bottom-border",label:"Border",type:"token-ref",path:"theme.components.scrollToBottom.border",defaultValue:"semantic.colors.primary",tokenRef:{tokenType:"color"}},{id:"scroll-bottom-size",label:"Size",type:"text",path:"theme.components.scrollToBottom.size",defaultValue:"40px"},{id:"scroll-bottom-radius",label:"Border Radius",type:"select",path:"theme.components.scrollToBottom.borderRadius",defaultValue:"palette.radius.full",options:[{value:"palette.radius.md",label:"Medium"},{value:"palette.radius.lg",label:"Large"},{value:"palette.radius.xl",label:"Extra Large"},{value:"palette.radius.full",label:"Full"}]},{id:"scroll-bottom-shadow",label:"Shadow",type:"select",path:"theme.components.scrollToBottom.shadow",defaultValue:"palette.shadows.sm",options:[{value:"palette.shadows.none",label:"None"},{value:"palette.shadows.sm",label:"Small"},{value:"palette.shadows.md",label:"Medium"},{value:"palette.shadows.lg",label:"Large"},{value:"palette.shadows.xl",label:"Extra Large"}]},{id:"scroll-bottom-padding",label:"Padding",type:"text",path:"theme.components.scrollToBottom.padding",defaultValue:"0.5rem 0.875rem"},{id:"scroll-bottom-gap",label:"Gap",type:"text",path:"theme.components.scrollToBottom.gap",defaultValue:"0.5rem"},{id:"scroll-bottom-font-size",label:"Font Size",type:"text",path:"theme.components.scrollToBottom.fontSize",defaultValue:"0.875rem"},{id:"scroll-bottom-icon-size",label:"Icon Size",type:"text",path:"theme.components.scrollToBottom.iconSize",defaultValue:"14px"}]},Aa={id:"comp-suggestions",title:"Suggestions",description:"Style starter cards, follow-up chips, and list rows.",collapsed:!0,fields:[{id:"suggestion-chip-bg",label:"Chip Background",type:"token-ref",path:"theme.components.suggestion.chip.background",defaultValue:"semantic.colors.surface",tokenRef:{tokenType:"color"}},{id:"suggestion-chip-fg",label:"Chip Text",type:"token-ref",path:"theme.components.suggestion.chip.foreground",defaultValue:"semantic.colors.text",tokenRef:{tokenType:"color"}},{id:"suggestion-chip-border",label:"Chip Border",type:"token-ref",path:"theme.components.suggestion.chip.border",defaultValue:"semantic.colors.border",tokenRef:{tokenType:"color"}},{id:"suggestion-chip-hover",label:"Chip Hover",type:"token-ref",path:"theme.components.suggestion.chip.hoverBackground",defaultValue:"palette.colors.gray.100",tokenRef:{tokenType:"color"}},{id:"suggestion-chip-focus",label:"Chip Focus Ring",type:"token-ref",path:"theme.components.suggestion.chip.focusRing",defaultValue:"semantic.colors.interactive.focus",tokenRef:{tokenType:"color"}},{id:"suggestion-card-bg",label:"Card Background",type:"token-ref",path:"theme.components.suggestion.card.background",defaultValue:"semantic.colors.surface",tokenRef:{tokenType:"color"}},{id:"suggestion-card-fg",label:"Card Text",type:"token-ref",path:"theme.components.suggestion.card.foreground",defaultValue:"semantic.colors.text",tokenRef:{tokenType:"color"}},{id:"suggestion-card-border",label:"Card Border",type:"token-ref",path:"theme.components.suggestion.card.border",defaultValue:"semantic.colors.border",tokenRef:{tokenType:"color"}},{id:"suggestion-card-hover",label:"Card Hover",type:"token-ref",path:"theme.components.suggestion.card.hoverBackground",defaultValue:"palette.colors.gray.100",tokenRef:{tokenType:"color"}},{id:"suggestion-card-shadow",label:"Card Shadow",type:"select",path:"theme.components.suggestion.card.shadow",defaultValue:"palette.shadows.sm",options:[{value:"palette.shadows.none",label:"None"},{value:"palette.shadows.sm",label:"Small"},{value:"palette.shadows.md",label:"Medium"},{value:"palette.shadows.lg",label:"Large"}]},{id:"suggestion-list-bg",label:"List Background",type:"color",path:"theme.components.suggestion.list.background",defaultValue:"transparent"},{id:"suggestion-list-border",label:"List Border",type:"token-ref",path:"theme.components.suggestion.list.border",defaultValue:"semantic.colors.border",tokenRef:{tokenType:"color"}},{id:"suggestion-chip-item-gap",label:"Chip Spacing",description:"Space between chips",type:"text",path:"theme.components.suggestion.chip.itemGap",defaultValue:"8px"},{id:"suggestion-card-item-gap",label:"Card Spacing",description:"Space between cards",type:"text",path:"theme.components.suggestion.card.itemGap",defaultValue:"8px"},{id:"suggestion-list-item-gap",label:"List Spacing",description:"Space between list rows",type:"text",path:"theme.components.suggestion.list.itemGap",defaultValue:"8px"}]},$=[{value:"palette.shadows.none",label:"None"},{value:"palette.shadows.sm",label:"Small"},{value:"palette.shadows.md",label:"Medium"},{value:"palette.shadows.lg",label:"Large"},{value:"palette.shadows.xl",label:"Extra Large"}],Et="0 5px 15px rgba(15, 23, 42, 0.08)",wt=[{value:Et,label:"Default"},...$],Ra={id:"comp-shadows",title:"Component Shadows",description:"Box-shadow for chat bubbles and surfaces.",collapsed:!0,fields:[{id:"shadow-msg-user",label:"User Message",type:"select",path:"theme.components.message.user.shadow",defaultValue:"palette.shadows.sm",options:$},{id:"shadow-msg-assistant",label:"Assistant Message",type:"select",path:"theme.components.message.assistant.shadow",defaultValue:"palette.shadows.sm",options:$},{id:"shadow-tool-bubble",label:"Tool Call Bubble",type:"select",path:"theme.components.toolBubble.shadow",defaultValue:"palette.shadows.sm",options:$},{id:"shadow-reasoning-bubble",label:"Reasoning Bubble",type:"select",path:"theme.components.reasoningBubble.shadow",defaultValue:"palette.shadows.sm",options:$},{id:"shadow-approval",label:"Approval Bubble",type:"select",path:"theme.components.approval.requested.shadow",defaultValue:Et,options:wt},{id:"shadow-intro-card",label:"Intro Card",type:"select",path:"theme.components.introCard.shadow",defaultValue:"palette.shadows.none",options:wt},{id:"shadow-composer",label:"Composer",type:"select",path:"theme.components.composer.shadow",defaultValue:"palette.shadows.none",options:$}]},St=[{value:"",label:"Default"},{value:"400",label:"Normal (400)"},{value:"500",label:"Medium (500)"},{value:"600",label:"Semibold (600)"},{value:"700",label:"Bold (700)"}],Ea={id:"comp-text-styles",title:"Header & Welcome Text",description:"Typography for the header title and the welcome greeting. Leave blank to keep the built-in defaults.",collapsed:!0,fields:[{id:"header-title-font-family",label:"Header Title Font",description:"CSS font-family, e.g. Georgia, serif",type:"text",path:"theme.components.header.title.fontFamily",defaultValue:"",parseValue:k},{id:"header-title-font-size",label:"Header Title Size",description:"CSS length, e.g. 1.125rem",type:"text",path:"theme.components.header.title.fontSize",defaultValue:"",parseValue:k},{id:"header-title-font-weight",label:"Header Title Weight",type:"select",path:"theme.components.header.title.fontWeight",defaultValue:"",options:St,parseValue:k},{id:"welcome-title-font-family",label:"Welcome Title Font",description:"CSS font-family, e.g. Georgia, serif",type:"text",path:"theme.components.introCard.title.fontFamily",defaultValue:"",parseValue:k},{id:"welcome-title-font-size",label:"Welcome Title Size",description:"CSS length, e.g. 1.5rem",type:"text",path:"theme.components.introCard.title.fontSize",defaultValue:"",parseValue:k},{id:"welcome-title-font-weight",label:"Welcome Title Weight",type:"select",path:"theme.components.introCard.title.fontWeight",defaultValue:"",options:St,parseValue:k}]},Pt=[ia,la,ca,da,ua,ma,fa,ba,ya,ka,va,Ea,Ra],Dt=[xa,pa,ga,ha,wa,Sa,Ta,Ca,Aa],Vt=[...Pt,...Dt],et=1024*1024,Pa=["Show me what you can help with","Walk me through getting started","Answer a question about this page"],ee={images:["image/png","image/jpeg","image/gif","image/webp","image/svg+xml","image/bmp"],"images-pdf":["image/png","image/jpeg","image/gif","image/webp","image/svg+xml","image/bmp","application/pdf"],"images-text-pdf":["image/png","image/jpeg","image/gif","image/webp","image/svg+xml","image/bmp","application/pdf","text/plain","text/markdown","text/csv","application/json"],all:["image/png","image/jpeg","image/gif","image/webp","image/svg+xml","image/bmp","application/pdf","text/plain","text/markdown","text/csv","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/json"]};function Da(e){return Number(e)*et}function Va(e){let t=Number(e);return Number.isFinite(t)?t>1024?String(Math.round(t/et)):String(t):"10"}function Ia(e){return ee[String(e)]??ee.images}function _a(e){let t=Array.isArray(e)?e:ee.images,o=[...new Set(t)].sort();for(let[a,r]of Object.entries(ee)){let n=[...r].sort();if(o.length===n.length&&o.every((s,i)=>s===n[i]))return a}return o.some(a=>a.startsWith("application/vnd")||a==="application/msword")?"all":o.some(a=>a==="text/plain"||a==="text/markdown"||a==="text/csv")?"images-text-pdf":o.includes("application/pdf")?"images-pdf":"images"}var Ba={id:"copy",title:"Content & Copy",collapsed:!1,fields:[{id:"copy-show-welcome-card",label:"Show Welcome Card",type:"toggle",path:"copy.showWelcomeCard",defaultValue:!0},{id:"copy-welcome-title",label:"Welcome Title",type:"text",path:"copy.welcomeTitle",defaultValue:"Hello \u{1F44B}"},{id:"copy-welcome-subtitle",label:"Welcome Subtitle",type:"text",path:"copy.welcomeSubtitle",defaultValue:"I can answer questions and help you get things done here."},{id:"copy-placeholder",label:"Input Placeholder",type:"text",path:"copy.inputPlaceholder",defaultValue:Ne},{id:"copy-send-label",label:"Send Button Label",type:"text",path:"copy.sendButtonLabel",defaultValue:"Send"}]},La={id:"suggestions",title:"Suggestions",description:"Configure starter prompts and agent follow-ups.",collapsed:!0,fields:[{id:"suggestions-list",label:"Starter Prompts",description:"Add, edit, and remove starter prompts directly.",type:"chip-list",path:"suggestionChips",defaultValue:Pa},{id:"suggestions-starter-variant",label:"Starter Style",type:"select",path:"suggestions.starters.variant",defaultValue:"card",options:[{value:"card",label:"Cards"},{value:"chip",label:"Chips"},{value:"list",label:"List"}]},{id:"suggestions-starter-placement",label:"Starter Placement",type:"select",path:"suggestions.starters.placement",defaultValue:"auto",options:[{value:"auto",label:"Automatic"},{value:"welcome",label:"Welcome Surface"},{value:"composer",label:"Above Composer"}]},{id:"suggestions-starter-behavior",label:"Starter Click",type:"select",path:"suggestions.starters.behavior",defaultValue:"send",options:[{value:"send",label:"Send Immediately"},{value:"fill",label:"Fill Composer"}]},{id:"suggestions-starter-overflow",label:"Starter Overflow",type:"select",path:"suggestions.starters.overflow",defaultValue:"wrap",options:[{value:"wrap",label:"Wrap Rows"},{value:"scroll",label:"Horizontal Scroll"}]},{id:"suggestions-followup-variant",label:"Follow-up Style",type:"select",path:"suggestions.followUps.variant",defaultValue:"chip",options:[{value:"chip",label:"Chips"},{value:"card",label:"Cards"},{value:"list",label:"List"}]},{id:"suggestions-followup-placement",label:"Follow-up Placement",type:"select",path:"suggestions.followUps.placement",defaultValue:"auto",options:[{value:"auto",label:"Automatic"},{value:"after-message",label:"After Messages"},{value:"composer",label:"Above Composer"}]},{id:"suggestions-followup-behavior",label:"Follow-up Click",type:"select",path:"suggestions.followUps.behavior",defaultValue:"send",options:[{value:"send",label:"Send Immediately"},{value:"fill",label:"Fill Composer"}]},{id:"suggestions-followup-overflow",label:"Follow-up Overflow",type:"select",path:"suggestions.followUps.overflow",defaultValue:"scroll",options:[{value:"scroll",label:"Horizontal Scroll"},{value:"wrap",label:"Wrap Rows"}]}]},Oa={id:"general-layout",title:"Layout Basics",collapsed:!0,fields:[{id:"layout-show-header",label:"Show Header",type:"toggle",path:"layout.showHeader",defaultValue:!0},{id:"layout-show-footer",label:"Show Footer",type:"toggle",path:"layout.showFooter",defaultValue:!0},{id:"layout-content-max-width",label:"Content Max Width",description:"Max width for messages + composer",type:"text",path:"layout.contentMaxWidth",defaultValue:""}]},Ma={id:"header-layout",title:"Header",collapsed:!0,fields:[{id:"layout-header",label:"Header Layout",type:"select",path:"layout.header.layout",defaultValue:"default",options:[{value:"default",label:"Default"},{value:"minimal",label:"Minimal"}]},{id:"layout-show-icon",label:"Show Header Icon",type:"toggle",path:"layout.header.showIcon",defaultValue:!0},{id:"layout-show-title",label:"Show Header Title",type:"toggle",path:"layout.header.showTitle",defaultValue:!0},{id:"layout-show-subtitle",label:"Show Header Subtitle",type:"toggle",path:"layout.header.showSubtitle",defaultValue:!0},{id:"layout-show-close",label:"Show Close Button",type:"toggle",path:"layout.header.showCloseButton",defaultValue:!0},{id:"layout-show-clear",label:"Show Clear Chat",type:"toggle",path:"layout.header.showClearChat",defaultValue:!0}]},Wa={id:"messages-layout",title:"Messages",collapsed:!0,fields:[{id:"layout-messages",label:"Message Style",description:"Minimal uses a user bubble with an open assistant response",type:"select",path:"layout.messages.layout",defaultValue:"bubble",options:[{value:"bubble",label:"Bubble \u2014 bubbles for both"},{value:"minimal",label:"Minimal \u2014 user bubble, open assistant"},{value:"flat",label:"Flat \u2014 open messages for both"}]},{id:"layout-message-user-width",label:"User Width",description:"Content hugs the message; Full fills the transcript track",type:"select",path:"layout.messages.user.width",defaultValue:"content",options:[{value:"content",label:"Content"},{value:"full",label:"Full"}]},{id:"layout-message-user-max-width",label:"User Max Width",description:"Optional CSS width such as 80%, 42rem, or 72ch; blank uses the width mode default",type:"text",path:"layout.messages.user.maxWidth",defaultValue:"",parseValue:k},{id:"layout-message-assistant-width",label:"Assistant Width",description:"Content hugs the message; Full fills the transcript track",type:"select",path:"layout.messages.assistant.width",defaultValue:"content",options:[{value:"content",label:"Content"},{value:"full",label:"Full"}]},{id:"layout-message-assistant-max-width",label:"Assistant Max Width",description:"Optional CSS width such as 80%, 42rem, or 72ch; blank uses the width mode default",type:"text",path:"layout.messages.assistant.maxWidth",defaultValue:"",parseValue:k},{id:"layout-group",label:"Group Consecutive",type:"toggle",path:"layout.messages.groupConsecutive",defaultValue:!1},{id:"layout-avatar-show",label:"Show Avatars",type:"toggle",path:"layout.messages.avatar.show",defaultValue:!1},{id:"layout-avatar-pos",label:"Avatar Position",type:"select",path:"layout.messages.avatar.position",defaultValue:"left",options:[{value:"left",label:"Left"},{value:"right",label:"Right"}]},{id:"layout-avatar-user",label:"User Avatar URL",type:"text",path:"layout.messages.avatar.userAvatar",defaultValue:""},{id:"layout-avatar-assistant",label:"Assistant Avatar URL",type:"text",path:"layout.messages.avatar.assistantAvatar",defaultValue:""},{id:"layout-timestamp-show",label:"Show Timestamps",type:"toggle",path:"layout.messages.timestamp.show",defaultValue:!1},{id:"layout-timestamp-pos",label:"Timestamp Position",type:"select",path:"layout.messages.timestamp.position",defaultValue:"inline",options:[{value:"inline",label:"Inline"},{value:"below",label:"Below"}]}]},Fa={id:"message-actions",title:"Message Actions",collapsed:!0,fields:[{id:"msg-actions-enabled",label:"Enabled",type:"toggle",path:"messageActions.enabled",defaultValue:!0},{id:"msg-actions-copy",label:"Show Copy",type:"toggle",path:"messageActions.showCopy",defaultValue:!0},{id:"msg-actions-upvote",label:"Show Upvote",type:"toggle",path:"messageActions.showUpvote",defaultValue:!0},{id:"msg-actions-downvote",label:"Show Downvote",type:"toggle",path:"messageActions.showDownvote",defaultValue:!0},{id:"msg-actions-read-aloud",label:"Show Read Aloud",type:"toggle",path:"messageActions.showReadAloud",defaultValue:!1},{id:"msg-actions-visibility",label:"Visibility",type:"select",path:"messageActions.visibility",defaultValue:"hover",options:[{value:"hover",label:"On Hover"},{value:"always",label:"Always Visible"}]},{id:"msg-actions-align",label:"Alignment",type:"select",path:"messageActions.align",defaultValue:"right",options:[{value:"left",label:"Left"},{value:"right",label:"Right"}]},{id:"msg-actions-layout",label:"Layout",type:"select",path:"messageActions.layout",defaultValue:"pill-inside",options:[{value:"pill-inside",label:"Pill"},{value:"row-inside",label:"Row"}]}]},Na={id:"launcher-basics",title:"Launcher",collapsed:!0,fields:[{id:"launch-enabled",label:"Enabled",type:"toggle",path:"launcher.enabled",defaultValue:!0},{id:"launch-mount-mode",label:"Mount Mode",type:"select",path:"launcher.mountMode",defaultValue:"floating",options:[{value:"floating",label:"Floating"},{value:"docked",label:"Docked"}]},{id:"launch-position",label:"Position",type:"select",path:"launcher.position",defaultValue:"bottom-right",options:[{value:"bottom-right",label:"Bottom Right"},{value:"bottom-left",label:"Bottom Left"},{value:"top-right",label:"Top Right"},{value:"top-left",label:"Top Left"}]},{id:"launch-width",label:"Width",type:"text",path:"launcher.width",defaultValue:N},{id:"launch-auto-expand",label:"Auto Expand",type:"toggle",path:"launcher.autoExpand",defaultValue:!1},{id:"launch-title",label:"Title",type:"text",path:"launcher.title",defaultValue:"Chat Assistant"},{id:"launch-subtitle",label:"Subtitle",type:"text",path:"launcher.subtitle",defaultValue:"Here to help you get answers fast"}]},Ha={id:"launcher-advanced",title:"Launcher Advanced",collapsed:!0,fields:[{id:"launch-dock-side",label:"Dock Side",type:"select",path:"launcher.dock.side",defaultValue:"right",options:[{value:"right",label:"Right"},{value:"left",label:"Left"}]},{id:"launch-dock-width",label:"Dock Width",type:"text",path:"launcher.dock.width",defaultValue:"420px"},{id:"launch-dock-animate",label:"Dock Animate",type:"toggle",path:"launcher.dock.animate",defaultValue:!0},{id:"launch-dock-reveal",label:"Dock Reveal",type:"select",path:"launcher.dock.reveal",defaultValue:"resize",options:[{value:"resize",label:"Resize"},{value:"overlay",label:"Overlay"},{value:"push",label:"Push"},{value:"emerge",label:"Emerge"}]},{id:"launch-text-hidden",label:"Hide Text",type:"toggle",path:"launcher.textHidden",defaultValue:!1},{id:"launch-icon-text",label:"Agent Icon Text",type:"text",path:"launcher.agentIconText",defaultValue:"\u{1F4AC}"},{id:"launch-icon-name",label:"Agent Icon Name (Lucide)",type:"text",path:"launcher.agentIconName",defaultValue:"bot"},{id:"launch-icon-hidden",label:"Hide Agent Icon",type:"toggle",path:"launcher.agentIconHidden",defaultValue:!1},{id:"launch-icon-size",label:"Agent Icon Size",type:"slider",path:"launcher.agentIconSize",defaultValue:"40px",slider:{min:16,max:72,step:2}},{id:"launch-icon-url",label:"Icon Image URL",description:"Custom image URL (overrides emoji/lucide)",type:"text",path:"launcher.iconUrl",defaultValue:""},{id:"launch-header-icon-name",label:"Header Icon Name (Lucide)",type:"text",path:"launcher.headerIconName",defaultValue:"bot"},{id:"launch-header-icon-size",label:"Header Icon Size",type:"slider",path:"launcher.headerIconSize",defaultValue:"48px",slider:{min:24,max:80,step:2}},{id:"launch-header-icon-hidden",label:"Hide Header Icon",type:"toggle",path:"launcher.headerIconHidden",defaultValue:!1},{id:"launch-full-height",label:"Full Height",type:"toggle",path:"launcher.fullHeight",defaultValue:!1},{id:"launch-sidebar",label:"Sidebar Mode",type:"toggle",path:"launcher.sidebarMode",defaultValue:!1},{id:"launch-sidebar-width",label:"Sidebar Width",type:"text",path:"launcher.sidebarWidth",defaultValue:"420px"},{id:"launch-mobile-fullscreen",label:"Mobile Fullscreen",description:"Fullscreen on mobile devices",type:"toggle",path:"launcher.mobileFullscreen",defaultValue:!0},{id:"launch-mobile-breakpoint",label:"Mobile Breakpoint (px)",type:"text",path:"launcher.mobileBreakpoint",defaultValue:640,formatValue:e=>String(e??640),parseValue:e=>Number(e)},{id:"launch-height-offset",label:"Height Offset (px)",type:"text",path:"launcher.heightOffset",defaultValue:0,formatValue:e=>String(e??0),parseValue:e=>Number(e)},{id:"launch-collapsed-max-width",label:"Collapsed Max Width",description:"Max width of launcher pill when closed",type:"text",path:"launcher.collapsedMaxWidth",defaultValue:""},{id:"launch-cta-text",label:"CTA Icon Text",type:"text",path:"launcher.callToActionIconText",defaultValue:"\u2197"},{id:"launch-cta-name",label:"CTA Icon Name",type:"text",path:"launcher.callToActionIconName",defaultValue:""},{id:"launch-cta-hidden",label:"Hide CTA Icon",type:"toggle",path:"launcher.callToActionIconHidden",defaultValue:!1},{id:"launch-cta-size",label:"CTA Icon Size",type:"slider",path:"launcher.callToActionIconSize",defaultValue:"32px",slider:{min:16,max:64,step:2}},{id:"launch-cta-padding",label:"CTA Icon Padding",type:"slider",path:"launcher.callToActionIconPadding",defaultValue:"5px",slider:{min:0,max:24,step:1}},{id:"launch-cta-bg",label:"CTA Icon Background",type:"color",path:"launcher.callToActionIconBackgroundColor",defaultValue:""}]},$a={id:"send-button",title:"Send Button",collapsed:!0,fields:[{id:"send-use-icon",label:"Use Icon",type:"toggle",path:"sendButton.useIcon",defaultValue:!1},{id:"send-icon-text",label:"Icon Text",type:"text",path:"sendButton.iconText",defaultValue:"\u2191"},{id:"send-icon-name",label:"Icon Name (Lucide)",type:"text",path:"sendButton.iconName",defaultValue:""},{id:"send-size",label:"Size",type:"slider",path:"sendButton.size",defaultValue:"40px",slider:{min:24,max:64,step:2}},{id:"send-border-width",label:"Border Width",type:"slider",path:"sendButton.borderWidth",defaultValue:"0px",slider:{min:0,max:10,step:1}},{id:"send-padding-x",label:"Padding X",type:"slider",path:"sendButton.paddingX",defaultValue:"10px",slider:{min:0,max:32,step:1}},{id:"send-padding-y",label:"Padding Y",type:"slider",path:"sendButton.paddingY",defaultValue:"6px",slider:{min:0,max:32,step:1}},{id:"send-show-tooltip",label:"Show Tooltip",type:"toggle",path:"sendButton.showTooltip",defaultValue:!1},{id:"send-tooltip-text",label:"Tooltip Text",type:"text",path:"sendButton.tooltipText",defaultValue:"Send message"}]},za={id:"close-button",title:"Close Button",collapsed:!0,fields:[{id:"close-size",label:"Size",type:"slider",path:"launcher.closeButtonSize",defaultValue:"32px",slider:{min:16,max:64,step:1}},{id:"close-placement",label:"Placement",type:"select",path:"launcher.closeButtonPlacement",defaultValue:"inline",options:[{value:"inline",label:"Inline"},{value:"top-right",label:"Top Right"}]},{id:"close-border-width",label:"Border Width",type:"slider",path:"launcher.closeButtonBorderWidth",defaultValue:"0px",slider:{min:0,max:8,step:1}},{id:"close-border-radius",label:"Border Radius",type:"slider",path:"launcher.closeButtonBorderRadius",defaultValue:"50%",slider:{min:0,max:100,step:1,isRadiusFull:!0}},{id:"close-icon-name",label:"Icon Name",type:"text",path:"launcher.closeButtonIconName",defaultValue:"x"},{id:"close-icon-text",label:"Icon Text",type:"text",path:"launcher.closeButtonIconText",defaultValue:"\xD7"},{id:"close-show-tooltip",label:"Show Tooltip",type:"toggle",path:"launcher.closeButtonShowTooltip",defaultValue:!0},{id:"close-tooltip-text",label:"Tooltip Text",type:"text",path:"launcher.closeButtonTooltipText",defaultValue:"Close chat"}]},Ua={id:"clear-chat",title:"Clear Chat Button",collapsed:!0,fields:[{id:"clear-enabled",label:"Enabled",type:"toggle",path:"launcher.clearChat.enabled",defaultValue:!0},{id:"clear-placement",label:"Placement",type:"select",path:"launcher.clearChat.placement",defaultValue:"inline",options:[{value:"inline",label:"Inline"},{value:"top-right",label:"Top Right"}]},{id:"clear-icon-name",label:"Icon Name",type:"text",path:"launcher.clearChat.iconName",defaultValue:"refresh-cw"},{id:"clear-size",label:"Size",type:"slider",path:"launcher.clearChat.size",defaultValue:"32px",slider:{min:16,max:64,step:1}},{id:"clear-show-tooltip",label:"Show Tooltip",type:"toggle",path:"launcher.clearChat.showTooltip",defaultValue:!0},{id:"clear-tooltip-text",label:"Tooltip Text",type:"text",path:"launcher.clearChat.tooltipText",defaultValue:"Clear chat"}]},ja={id:"status-indicator",title:"Status Indicator",collapsed:!0,fields:[{id:"status-visible",label:"Visible",type:"toggle",path:"statusIndicator.visible",defaultValue:!0},{id:"status-align",label:"Alignment",type:"select",path:"statusIndicator.align",defaultValue:"right",options:[{value:"left",label:"Left"},{value:"center",label:"Center"},{value:"right",label:"Right"}]},{id:"status-idle-text",label:"Idle Text",type:"text",path:"statusIndicator.idleText",defaultValue:"Online"},{id:"status-connecting-text",label:"Connecting Text",type:"text",path:"statusIndicator.connectingText",defaultValue:"Connecting\u2026"},{id:"status-connected-text",label:"Connected Text",type:"text",path:"statusIndicator.connectedText",defaultValue:"Streaming\u2026"},{id:"status-error-text",label:"Error Text",type:"text",path:"statusIndicator.errorText",defaultValue:"Offline"}]},Ga={id:"features",title:"Features",collapsed:!0,fields:[{id:"feat-voice",label:"Voice Recognition",description:"Enable voice input",type:"toggle",path:"voiceRecognition.enabled",defaultValue:!1},{id:"feat-auto-focus",label:"Auto Focus Input",description:"Focus input after panel opens",type:"toggle",path:"autoFocusInput",defaultValue:!1},{id:"feat-scroll-bottom-enabled",label:"Scroll To Bottom",description:"Show a jump-to-latest affordance when the user scrolls away from new content",type:"toggle",path:"features.scrollToBottom.enabled",defaultValue:!0},{id:"feat-scroll-bottom-icon",label:"Scroll To Bottom Icon",type:"text",path:"features.scrollToBottom.iconName",defaultValue:"arrow-down"},{id:"feat-scroll-bottom-label",label:"Scroll To Bottom Label",description:"Leave empty for icon-only mode",type:"text",path:"features.scrollToBottom.label",defaultValue:""}]},qa={id:"stream-animation",title:"Stream Animation",description:"Control how assistant text appears while streaming.",collapsed:!0,fields:[{id:"stream-anim-type",label:"Animation",description:"Reveal effect applied to each assistant reply as it streams.",type:"select",path:"features.streamAnimation.type",defaultValue:"none",options:[{value:"none",label:"None"},{value:"typewriter",label:"Typewriter"},{value:"word-fade",label:"Word fade"},{value:"letter-rise",label:"Letter rise"},{value:"glyph-cycle",label:"Glyph cycle"},{value:"wipe",label:"Wipe"},{value:"pop-bubble",label:"Pop bubble"}]},{id:"stream-anim-placeholder",label:"Pre-first-token Placeholder",description:"What to show before the first token arrives.",type:"select",path:"features.streamAnimation.placeholder",defaultValue:"none",options:[{value:"none",label:"Typing indicator (default)"},{value:"skeleton",label:"Skeleton shimmer"}]},{id:"stream-anim-buffer",label:"Content Buffering",description:"Trim in-progress units so only complete words/lines reveal.",type:"select",path:"features.streamAnimation.buffer",defaultValue:"none",options:[{value:"none",label:"None: stream every character"},{value:"word",label:"Word: hold until whitespace"},{value:"line",label:"Line: hold until newline"}]},{id:"stream-anim-speed",label:"Per-unit Duration (ms)",description:"Animation length for each character or word.",type:"select",path:"features.streamAnimation.speed",defaultValue:120,options:[{value:"40",label:"40ms: snappy"},{value:"80",label:"80ms"},{value:"120",label:"120ms (default)"},{value:"200",label:"200ms"},{value:"320",label:"320ms"},{value:"480",label:"480ms: slow"}],formatValue:e=>String(e??120),parseValue:e=>Number(e)},{id:"stream-anim-duration",label:"Container Duration (ms)",description:"Length of container-level effects (pop-bubble, custom plugins).",type:"select",path:"features.streamAnimation.duration",defaultValue:1800,options:[{value:"600",label:"600ms"},{value:"1200",label:"1200ms"},{value:"1800",label:"1800ms (default)"},{value:"2400",label:"2400ms"},{value:"3600",label:"3600ms: slow"}],formatValue:e=>String(e??1800),parseValue:e=>Number(e)}]},Ka={id:"attachments-config",title:"Attachments",collapsed:!0,fields:[{id:"attach-enabled",label:"Enabled",type:"toggle",path:"attachments.enabled",defaultValue:!1},{id:"attach-max-files",label:"Max Files",type:"select",path:"attachments.maxFiles",defaultValue:4,options:[{value:"1",label:"1"},{value:"2",label:"2"},{value:"4",label:"4"},{value:"6",label:"6"},{value:"8",label:"8"},{value:"10",label:"10"}],formatValue:e=>String(e??4),parseValue:e=>Number(e)},{id:"attach-max-size",label:"Max File Size (MB)",type:"select",path:"attachments.maxFileSize",defaultValue:10*et,options:[{value:"1",label:"1 MB"},{value:"5",label:"5 MB"},{value:"10",label:"10 MB"},{value:"25",label:"25 MB"},{value:"50",label:"50 MB"}],formatValue:Va,parseValue:Da},{id:"attach-types",label:"Allowed File Types",type:"select",path:"attachments.allowedTypes",defaultValue:ee.images,options:[{value:"images",label:"Images only"},{value:"images-pdf",label:"Images + PDF"},{value:"images-text-pdf",label:"Images + text + PDF"},{value:"all",label:"All supported types"}],formatValue:_a,parseValue:Ia}]},Ya={id:"artifacts-config",title:"Artifacts",collapsed:!0,fields:[{id:"art-enabled",label:"Enabled",description:"Show artifact sidebar for documents and components",type:"toggle",path:"features.artifacts.enabled",defaultValue:!1},{id:"art-appearance",label:"Pane Appearance",type:"select",path:"features.artifacts.layout.paneAppearance",defaultValue:"panel",options:[{value:"panel",label:"Panel (bordered)"},{value:"seamless",label:"Seamless"}]}]},Za={id:"artifacts-customization",title:"Artifact Customization",collapsed:!0,fields:[{id:"art-toolbar",label:"Toolbar Preset",type:"select",path:"features.artifacts.layout.toolbarPreset",defaultValue:"default",options:[{value:"default",label:"Default"},{value:"document",label:"Document"}]},{id:"art-toolbar-title",label:"Toolbar Title",type:"text",path:"features.artifacts.layout.toolbarTitle",defaultValue:"Artifacts"},{id:"art-close-label",label:"Close Button Label",type:"text",path:"features.artifacts.layout.closeButtonLabel",defaultValue:"Close"},{id:"art-pane-width",label:"Pane Width",description:"CSS width (e.g. 40%, 28rem)",type:"text",path:"features.artifacts.layout.paneWidth",defaultValue:"40%"},{id:"art-pane-max-width",label:"Pane Max Width",type:"text",path:"features.artifacts.layout.paneMaxWidth",defaultValue:"28rem"},{id:"art-split-gap",label:"Split Gap",type:"text",path:"features.artifacts.layout.splitGap",defaultValue:"0"},{id:"art-pane-bg",label:"Pane Background",type:"color",path:"features.artifacts.layout.paneBackground",defaultValue:""},{id:"art-resizable",label:"Resizable",description:"Allow dragging the pane divider",type:"toggle",path:"features.artifacts.layout.resizable",defaultValue:!1},{id:"art-expand-panel",label:"Expand Panel When Open",description:"Widen the launcher panel to fit artifacts",type:"toggle",path:"features.artifacts.layout.expandLauncherPanelWhenOpen",defaultValue:!0}]},Xa={id:"api-integration",title:"API & Integration",description:"Runtime and integration options.",collapsed:!0,fields:[{id:"dev-api-url",label:"API URL",type:"text",path:"apiUrl",defaultValue:""},{id:"dev-flow",label:"Flow ID",type:"text",path:"flowId",defaultValue:""},{id:"dev-parser",label:"Stream Parser",type:"select",path:"parserType",defaultValue:"plain",options:[{value:"plain",label:"Plain Text"},{value:"json",label:"JSON"},{value:"regex-json",label:"Regex JSON"},{value:"xml",label:"XML"}]}]},Ja=[{value:"collapsed",label:"Collapsed card"},{value:"panel",label:"Side panel"},{value:"inline",label:"In conversation"}],Qe={type:"select",defaultValue:"panel",options:Ja,unsettable:!0,unsetLabel:"Use default",requiresCapability:"artifacts"},It={id:"artifact-display-preferences",title:"Artifact display",description:"Choose where recognizable artifact groups appear.",requiresCapability:"artifacts",fields:[{...Qe,id:"artifact-display-files",label:"Generated files",description:"Default for HTML, CSV, documents, and code files.",path:"features.artifacts.display.files"},{...Qe,id:"artifact-display-components",label:"Registered UI components",description:"Charts, forms, cards, and custom UI rendered by the host.",path:"features.artifacts.display.byKind.component"},{...Qe,id:"artifact-display-default",label:"Other artifacts",description:"Plain documents and anything without a narrower rule.",path:"features.artifacts.display.default"},{id:"artifact-file-preview",label:"Render supported file previews",type:"toggle",path:"features.artifacts.filePreview.enabled",defaultValue:!0,unsettable:!0,unsetLabel:"Use default",requiresCapability:"artifacts"}]},Qa={id:"stream-display-preferences",title:"Tool calls and reasoning",description:"Control how agent activity appears in the conversation.",fields:[{id:"pref-show-tools",label:"Show tool calls",type:"toggle",path:"features.showToolCalls",defaultValue:!0,unsettable:!0,requiresCapability:"tools"},{id:"pref-tool-collapsed-mode",label:"Tool call summary",type:"select",path:"features.toolCallDisplay.collapsedMode",defaultValue:"tool-call",options:[{value:"tool-call",label:"Tool call"},{value:"tool-name",label:"Tool name"},{value:"tool-preview",label:"Tool preview"}],unsettable:!0,requiresCapability:"tools"},{id:"pref-tool-expandable",label:"Tool calls expandable",type:"toggle",path:"features.toolCallDisplay.expandable",defaultValue:!0,unsettable:!0,requiresCapability:"tools"},{id:"pref-tool-grouped",label:"Group sequential tool calls",type:"toggle",path:"features.toolCallDisplay.grouped",defaultValue:!1,unsettable:!0,requiresCapability:"tools"},{id:"pref-tool-grouped-mode",label:"Grouped tool detail",type:"select",path:"features.toolCallDisplay.groupedMode",defaultValue:"stack",options:[{value:"stack",label:"Show steps"},{value:"summary",label:"Summary only"}],unsettable:!0,requiresCapability:"tools"},{id:"pref-tool-loading-animation",label:"Tool loading animation",type:"select",path:"features.toolCallDisplay.loadingAnimation",defaultValue:"none",options:[{value:"none",label:"None"},{value:"pulse",label:"Pulse"},{value:"shimmer",label:"Shimmer"},{value:"shimmer-color",label:"Color shimmer"},{value:"rainbow",label:"Rainbow"}],unsettable:!0,requiresCapability:"tools"},{id:"pref-show-reasoning",label:"Show reasoning",type:"toggle",path:"features.showReasoning",defaultValue:!0,unsettable:!0,requiresCapability:"reasoning"},{id:"pref-reasoning-expandable",label:"Reasoning expandable",type:"toggle",path:"features.reasoningDisplay.expandable",defaultValue:!0,unsettable:!0,requiresCapability:"reasoning"},{id:"pref-reasoning-active-preview",label:"Reasoning preview while active",type:"toggle",path:"features.reasoningDisplay.activePreview",defaultValue:!1,unsettable:!0,requiresCapability:"reasoning"}]},_t={label:"Stream and artifacts",sections:[Qa,It]},er={id:"debug-inspection",title:"Debug & Inspection",collapsed:!0,fields:[{id:"dev-tool-active-preview",label:"Tool Preview While Active",description:"Show a lightweight preview in collapsed active tool rows",type:"toggle",path:"features.toolCallDisplay.activePreview",defaultValue:!1},{id:"dev-tool-preview-lines",label:"Tool Preview Lines",type:"select",path:"features.toolCallDisplay.previewMaxLines",defaultValue:3,options:[{value:"1",label:"1"},{value:"2",label:"2"},{value:"3",label:"3"},{value:"4",label:"4"},{value:"5",label:"5"}],formatValue:e=>String(e??3),parseValue:e=>Number(e)},{id:"dev-tool-active-min-height",label:"Tool Active Min Height",description:"CSS min-height for collapsed active tool rows (e.g. 5rem)",type:"text",path:"features.toolCallDisplay.activeMinHeight",defaultValue:""},{id:"dev-reasoning-preview-lines",label:"Reasoning Preview Lines",type:"select",path:"features.reasoningDisplay.previewMaxLines",defaultValue:3,options:[{value:"1",label:"1"},{value:"2",label:"2"},{value:"3",label:"3"},{value:"4",label:"4"},{value:"5",label:"5"}],formatValue:e=>String(e??3),parseValue:e=>Number(e)},{id:"dev-reasoning-active-min-height",label:"Reasoning Active Min Height",description:"CSS min-height for collapsed active reasoning rows (e.g. 5rem)",type:"text",path:"features.reasoningDisplay.activeMinHeight",defaultValue:""},{id:"dev-debug",label:"Debug Mode",description:"Show debug information",type:"toggle",path:"debug",defaultValue:!1}]},tr={id:"markdown",title:"Markdown Options",collapsed:!0,fields:[{id:"md-gfm",label:"GitHub Flavored Markdown",type:"toggle",path:"markdown.options.gfm",defaultValue:!0},{id:"md-breaks",label:"Line Breaks",type:"toggle",path:"markdown.options.breaks",defaultValue:!0},{id:"md-header-ids",label:"Header IDs",type:"toggle",path:"markdown.options.headerIds",defaultValue:!1},{id:"md-pedantic",label:"Pedantic Mode",type:"toggle",path:"markdown.options.pedantic",defaultValue:!1},{id:"md-silent",label:"Silent",type:"toggle",path:"markdown.options.silent",defaultValue:!1},{id:"md-disable-styles",label:"Disable Default Styles",type:"toggle",path:"markdown.disableDefaultStyles",defaultValue:!1}]},xe=[{label:"Content",sections:[Ba,La]},{label:"Layout",sections:[Oa,Ma,Wa,Fa]},{label:"Widget",sections:[Na,Ha,$a,za,Ua,ja]},{label:"Features",sections:[Ga,qa,Ka,Ya,Za]},_t,{label:"Developer",collapsedByDefault:!0,sections:[Xa,er,tr]}],Bt=xe.flatMap(e=>e.sections),Lt={id:"theme-mode-v2",title:"Theme",description:"Choose how the interface adapts across light and dark mode.",collapsed:!1,fields:[{id:"color-mode",label:"Color Mode",type:"select",path:"colorScheme",defaultValue:"auto",options:[{value:"auto",label:"Auto"},{value:"light",label:"Light"},{value:"dark",label:"Dark"}]}]},Ot={id:"brand-palette-v2",title:"Brand Palette",description:"Set your brand, accent, and neutral colors. These are used to generate the interface theme.",collapsed:!1,fields:[{id:"bp-primary",label:"Primary",description:"Main brand color",type:"color",path:"theme.palette.colors.primary.500",defaultValue:"#171717"},{id:"bp-secondary",label:"Secondary",description:"Supporting brand color",type:"color",path:"theme.palette.colors.secondary.500",defaultValue:"#8b5cf6"},{id:"bp-accent",label:"Accent",description:"Highlight and decorative color",type:"color",path:"theme.palette.colors.accent.500",defaultValue:"#06b6d4"},{id:"bp-neutral",label:"Neutral",description:"Backgrounds, text, and borders",type:"color",path:"theme.palette.colors.gray.500",defaultValue:"#6b7280"}]},Mt={id:"status-palette",title:"Status Palette",description:"Colors for system feedback states.",collapsed:!0,fields:[{id:"sp-success",label:"Success",type:"color",path:"theme.palette.colors.success.500",defaultValue:"#22c55e"},{id:"sp-warning",label:"Warning",type:"color",path:"theme.palette.colors.warning.500",defaultValue:"#eab308"},{id:"sp-error",label:"Error",type:"color",path:"theme.palette.colors.error.500",defaultValue:"#ef4444"},{id:"sp-notice",label:"Notice",description:"Info and notice states",type:"color",path:"theme.semantic.colors.feedback.info",defaultValue:"palette.colors.primary.500"}]},Wt={id:"interface-roles",title:"Interface Roles",description:"Control where brand and neutral colors appear across the interface.",collapsed:!1,fields:[{id:"role-surfaces",label:"Background Surfaces",type:"role-assignment",path:"theme.semantic.colors.background",roleAssignment:pe},{id:"role-header",label:"Header",type:"role-assignment",path:"theme.components.header.background",roleAssignment:ue},{id:"role-user-messages",label:"User Messages",type:"role-assignment",path:"theme.components.message.user.background",roleAssignment:ge},{id:"role-assistant-messages",label:"Assistant Messages",type:"role-assignment",path:"theme.components.message.assistant.background",roleAssignment:me},{id:"role-primary-actions",label:"Primary Actions",type:"role-assignment",path:"theme.components.button.primary.background",roleAssignment:fe},{id:"role-scroll-to-bottom",label:"Scroll To Bottom",type:"role-assignment",path:"theme.components.scrollToBottom.background",roleAssignment:he},{id:"role-input",label:"Input Field",type:"role-assignment",path:"theme.components.input.background",roleAssignment:be},{id:"role-links-focus",label:"Links & Focus",type:"role-assignment",path:"theme.semantic.colors.accent",roleAssignment:ye},{id:"role-borders",label:"Borders & Dividers",type:"role-assignment",path:"theme.semantic.colors.border",roleAssignment:ke}]},Ft={id:"status-colors",title:"Status Colors",description:"Used for system states like success, warning, notice, and error.",collapsed:!0,fields:[{id:"sc-notice",label:"Notice",type:"token-ref",path:"theme.semantic.colors.feedback.info",defaultValue:"palette.colors.primary.500",tokenRef:{tokenType:"color"}},{id:"sc-success",label:"Success",type:"token-ref",path:"theme.semantic.colors.feedback.success",defaultValue:"palette.colors.success.500",tokenRef:{tokenType:"color"}},{id:"sc-warning",label:"Warning",type:"token-ref",path:"theme.semantic.colors.feedback.warning",defaultValue:"palette.colors.warning.500",tokenRef:{tokenType:"color"}},{id:"sc-error",label:"Error",type:"token-ref",path:"theme.semantic.colors.feedback.error",defaultValue:"palette.colors.error.500",tokenRef:{tokenType:"color"}}]},Nt={id:"advanced-tokens",title:"Advanced Tokens",description:"Override individual semantic and component values when you need precise control.",collapsed:!0,fields:[]},or=[Lt,Ot,Mt,Wt,Ft,Nt],ar=[{id:"style",label:"Style",sections:z},{id:"design-system",label:"Design System",sections:Vt},{id:"configure",label:"Configure",sections:Bt}],Tt=(e,t)=>t.split(".").reduce((o,a)=>o&&typeof o=="object"?o[a]:void 0,e);function Ht(e,t){let o=P({future:t}),a=ze(t),r=e.path,n=r.startsWith("theme.")?r.slice(6):r.startsWith("darkTheme.")?r.slice(10):void 0,s=n?Tt(a,n):Tt(o,r);return s===void 0?e.defaultValue:s}function $t(e){return ar.map(t=>({...t,sections:t.sections.map(o=>({...o,fields:o.fields.map(a=>({...a,defaultValue:Ht(a,e)}))}))}))}var tt=$t();function zt(e,t){return e.startsWith("theme.")?e.replace(/^theme\./,`${t}.`):e}function rr(e,t,o){return{...e,id:`${o}-${e.id}`,path:zt(e.path,t)}}function nr(e,t){let o=e.find(a=>a.id===t);if(!o)throw new Error(`Section "${t}" not found in definitions`);return o}function sr(e,t,o,a=e.collapsed){let r=o==="light"?"Light":"Dark",n=o==="light"?"Applies when the widget is in light mode.":"Applies when the widget is in dark mode.";return{...e,id:`${o}-${e.id}`,title:`${r} ${e.title}`,description:e.description?`${n} ${e.description}`:n,collapsed:a,fields:e.fields.map(s=>rr(s,t,o)),presets:e.presets?.map(s=>({...s,id:`${o}-${s.id}`,values:Object.fromEntries(Object.entries(s.values).map(([i,l])=>[zt(i,t),l]))}))}}var ot={id:"default-light",name:"Default Light",description:"Clean monochrome light theme",theme:{components:{artifact:{pane:{background:"semantic.colors.container",toolbarBackground:"semantic.colors.container"}}}},preview:{primary:"#171717",surface:"#ffffff",accent:"#0f0f0f"},tags:["light"]},at={id:"default-dark",name:"Default Dark",description:"Monochrome dark theme",theme:{palette:{colors:{primary:{50:"#ffffff",100:"#f5f5f5",200:"#d4d4d4",300:"#a3a3a3",400:"#737373",500:"#171717",600:"#0f0f0f",700:"#0a0a0a",800:"#050505",900:"#030303",950:"#000000"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},secondary:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},accent:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},success:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},warning:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},error:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"}}},semantic:{colors:{primary:"palette.colors.primary.400",secondary:"palette.colors.gray.400",accent:"palette.colors.primary.500",surface:"palette.colors.gray.800",background:"palette.colors.gray.900",container:"palette.colors.gray.800",text:"palette.colors.gray.100",textMuted:"palette.colors.gray.400",textInverse:"palette.colors.gray.900",border:"palette.colors.gray.700",divider:"palette.colors.gray.700",interactive:{default:"palette.colors.primary.400",hover:"palette.colors.primary.300",focus:"palette.colors.primary.500",active:"palette.colors.primary.600",disabled:"palette.colors.gray.600"},feedback:{success:"palette.colors.success.400",warning:"palette.colors.warning.400",error:"palette.colors.error.400",info:"palette.colors.primary.400"}}},components:{markdown:{link:{foreground:"palette.colors.primary.300"}}}},preview:{primary:"#171717",surface:"#1f2937",accent:"#0f0f0f"},tags:["dark"]},Ut=[{id:"persona-default",name:"Persona Default",description:"Adaptive Persona theme with light and dark modes",theme:ot.theme,darkTheme:at.theme,preview:ot.preview,darkPreview:at.preview,tags:["light","dark","adaptive"]},ot,at,{id:"high-contrast",name:"High Contrast",description:"Maximum contrast for accessibility",theme:{semantic:{colors:{primary:"palette.colors.primary.700",secondary:"palette.colors.gray.700",accent:"palette.colors.primary.800",surface:"palette.colors.gray.50",background:"palette.colors.gray.50",container:"palette.colors.gray.200",text:"palette.colors.gray.950",textMuted:"palette.colors.gray.700",textInverse:"palette.colors.gray.50",border:"palette.colors.gray.400",divider:"palette.colors.gray.400",interactive:{default:"palette.colors.primary.700",hover:"palette.colors.primary.800",focus:"palette.colors.primary.900",active:"palette.colors.primary.950",disabled:"palette.colors.gray.400"},feedback:{success:"palette.colors.success.700",warning:"palette.colors.warning.700",error:"palette.colors.error.700",info:"palette.colors.primary.700"}}}},preview:{primary:"#0a0a0a",surface:"#f9fafb",accent:"#050505"},tags:["light","high-contrast","accessibility"]}],te=[...Ut];function rt(e){return te.find(t=>t.id===e)}var ir={desktop:{w:1280,h:800},mobile:{w:390,h:844}},lr=.15,cr=1.5,we="persona-preview-shell-theme",jt={load:()=>null,save:()=>{},clear:()=>{}},Gt=["How do I get started?","Pricing & plans","Talk to support"];function qt(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Kt(e){return e==="dark"?{pageBg:"linear-gradient(180deg, #0f172a 0%, #020617 100%)",chromeBg:"#111827",chromeBorder:"#1f2937",dot:"#475569",skeleton:"#334155",cardBg:"#1e293b",cardBorder:"rgba(148, 163, 184, 0.16)"}:{pageBg:"linear-gradient(180deg, #ffffff 0%, #f8fafc 100%)",chromeBg:"#ffffff",chromeBorder:"#e5e7eb",dot:"#cbd5e1",skeleton:"#e2e8f0",cardBg:"#e2e8f0",cardBorder:"rgba(148, 163, 184, 0.18)"}}function nt(e){let t=Kt(e);return`* { box-sizing: border-box; }
2
2
  html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
3
3
  html { color-scheme: ${e}; }
4
4
  body { font-family: system-ui, sans-serif; background: ${t.pageBg}; }
@@ -22,7 +22,7 @@ var _="min(440px, calc(100vw - 24px))",oe="440px",Oe="How can I help...",io={ena
22
22
  .preview-workspace-content-shell { position: relative; z-index: 1; flex: 1 1 auto; min-height: 100%; padding: 24px; }
23
23
  .preview-workspace-row { display: flex; gap: 16px; margin-top: 20px; }
24
24
  .preview-workspace-card { flex: 1; min-width: 0; height: 168px; border-radius: 18px; background: ${t.cardBg}; box-shadow: inset 0 0 0 1px ${t.cardBorder}; }
25
- .preview-workspace-card.short { height: 96px; }`}function Ma(e,t){let o=e.contentDocument;if(!o?.documentElement)return;let a=o.getElementById(be);a||(a=o.createElement("style"),a.id=be,o.head.appendChild(a)),a.textContent=Je(t)}var Lt=`
25
+ .preview-workspace-card.short { height: 96px; }`}function dr(e,t){let o=e.contentDocument;if(!o?.documentElement)return;let a=o.getElementById(we);a||(a=o.createElement("style"),a.id=we,o.head.appendChild(a)),a.textContent=nt(t)}var Yt=`
26
26
  <div class="preview-iframe-mock" aria-hidden="true">
27
27
  <div class="preview-iframe-chrome">
28
28
  <span class="preview-iframe-dot"></span>
@@ -41,7 +41,7 @@ var _="min(440px, calc(100vw - 24px))",oe="440px",Oe="How can I help...",io={ena
41
41
  <div class="preview-iframe-line body"></div>
42
42
  <div class="preview-iframe-line body"></div>
43
43
  </div>
44
- </div>`,_t=`
44
+ </div>`,Zt=`
45
45
  <div class="preview-workspace-content-shell" aria-hidden="true">
46
46
  <div class="preview-iframe-line hero"></div>
47
47
  <div class="preview-iframe-line body"></div>
@@ -54,8 +54,8 @@ var _="min(440px, calc(100vw - 24px))",oe="440px",Oe="How can I help...",io={ena
54
54
  <div class="preview-workspace-card short"></div>
55
55
  <div class="preview-workspace-card short"></div>
56
56
  </div>
57
- </div>`;function Fa(e,t,o,a){let r=`
58
- ${Lt}
57
+ </div>`;function pr(e,t,o,a){let r=`
58
+ ${Yt}
59
59
  <div style="position:fixed;inset:0;z-index:9999;"><div id="${e}" data-mount-id="${e}"></div></div>`,n=`
60
60
  <div class="preview-workspace-shell">
61
61
  <div class="preview-workspace-topbar">
@@ -67,7 +67,7 @@ var _="min(440px, calc(100vw - 24px))",oe="440px",Oe="How can I help...",io={ena
67
67
  </div>
68
68
  <div class="preview-workspace-body">
69
69
  <div id="preview-content-${e}" class="preview-workspace-content" data-mount-id="${e}">
70
- ${_t}
70
+ ${Zt}
71
71
  </div>
72
72
  </div>
73
73
  </div>`;return`<!DOCTYPE html>
@@ -75,13 +75,13 @@ var _="min(440px, calc(100vw - 24px))",oe="440px",Oe="How can I help...",io={ena
75
75
  <head>
76
76
  <meta charset="UTF-8">
77
77
  <meta name="viewport" content="width=device-width, initial-scale=1">
78
- <link rel="stylesheet" href="${Bt(a)}">
79
- <style id="${be}">${Je(t)}</style>
78
+ <link rel="stylesheet" href="${qt(a)}">
79
+ <style id="${we}">${nt(t)}</style>
80
80
  </head>
81
81
  <body>
82
82
  ${o?n:r}
83
83
  </body>
84
- </html>`}var Wa={"user-message":"User message","assistant-message":"Assistant message","assistant-code-block":"Assistant: code block","assistant-markdown-table":"Assistant: markdown table","assistant-image":"Assistant: image","reasoning-streaming":"Reasoning (streaming)","reasoning-complete":"Reasoning (complete)","tool-running":"Tool call (running)","tool-complete":"Tool call (complete)","approval-request":"Approval request"};function Na(e){return Wa[e]}function Qe(e,t=0){let o=new Date(Date.now()-Math.max(0,60-t)*1e3).toISOString(),a=`${e}-${t}`;switch(e){case"user-message":return{id:`preview-seq-user-${a}`,role:"user",content:"Can you continue with the next step?",createdAt:o};case"assistant-message":return{id:`preview-seq-assistant-${a}`,role:"assistant",content:"Absolutely. I can keep going and explain what happens next.",createdAt:o};case"assistant-code-block":return{id:`preview-seq-assistant-code-${a}`,role:"assistant",content:["Here's how you'd wire up a streaming animation:","","```ts","import { createAgentExperience } from '@runtypelabs/persona';","","createAgentExperience(el, {"," features: {",' streamAnimation: { type: "letter-rise", speed: 120 },'," },","});","```","","Swap the `type` value to try the other presets."].join(`
84
+ </html>`}var ur={"user-message":"User message","assistant-message":"Assistant message","assistant-code-block":"Assistant: code block","assistant-markdown-table":"Assistant: markdown table","assistant-image":"Assistant: image","reasoning-streaming":"Reasoning (streaming)","reasoning-complete":"Reasoning (complete)","tool-running":"Tool call (running)","tool-complete":"Tool call (complete)","approval-request":"Approval request"};function gr(e){return ur[e]}function st(e,t=0){let o=new Date(Date.now()-Math.max(0,60-t)*1e3).toISOString(),a=`${e}-${t}`;switch(e){case"user-message":return{id:`preview-seq-user-${a}`,role:"user",content:"Can you continue with the next step?",createdAt:o};case"assistant-message":return{id:`preview-seq-assistant-${a}`,role:"assistant",content:"Absolutely. I can keep going and explain what happens next.",createdAt:o};case"assistant-code-block":return{id:`preview-seq-assistant-code-${a}`,role:"assistant",content:["Here's how you'd wire up a streaming animation:","","```ts","import { createAgentExperience } from '@runtypelabs/persona';","","createAgentExperience(el, {"," features: {",' streamAnimation: { type: "letter-rise", speed: 120 },'," },","});","```","","Swap the `type` value to try the other presets."].join(`
85
85
  `),createdAt:o};case"assistant-markdown-table":return{id:`preview-seq-assistant-table-${a}`,role:"assistant",content:["Here are the built-in streaming animations at a glance:","","| Preset | Wrap unit | Best for |","| ------------ | --------- | --------------------------- |","| Typewriter | Character | Classic terminal feel |","| Letter rise | Character | Soft, staggered entrance |","| Word fade | Word | Longer-form assistant replies |","| Pop bubble | Bubble | Short, punchy affirmations |"].join(`
86
86
  `),createdAt:o};case"assistant-image":return{id:`preview-seq-assistant-image-${a}`,role:"assistant",content:["Here's the reference diagram you asked for: let me know if you'd like a different view:","","![Stream animation reference](https://placehold.co/320x200/png?text=Stream+Animation)","","The gradient shows how per-unit delays stagger across the reply."].join(`
87
- `),createdAt:o};case"reasoning-streaming":return{id:`preview-seq-reasoning-stream-${a}`,role:"assistant",content:"",createdAt:o,streaming:!0,variant:"reasoning",reasoning:{id:`preview-reasoning-stream-${a}`,status:"streaming",chunks:["Thinking through the next step in the workflow..."]}};case"reasoning-complete":return{id:`preview-seq-reasoning-complete-${a}`,role:"assistant",content:"",createdAt:o,streaming:!1,variant:"reasoning",reasoning:{id:`preview-reasoning-complete-${a}`,status:"complete",chunks:["Reviewed the requirements and finalized the reasoning output."],durationMs:1200}};case"approval-request":{let r=`preview-approval-${a}`;return{id:`approval-${r}`,role:"assistant",content:"",createdAt:o,streaming:!1,variant:"approval",approval:{id:r,status:"pending",agentId:"preview-agent",executionId:`preview-exec-${a}`,toolName:"add_to_cart",description:"Add the selected item to the shopping cart. Approve to let the assistant continue.",parameters:{items:[{productEntityId:129,quantity:1}]}}}}case"tool-complete":return{id:`preview-seq-tool-complete-${a}`,role:"assistant",content:"",createdAt:o,streaming:!1,variant:"tool",toolCall:{id:`preview-tool-complete-${a}`,name:"Create build instructions",status:"complete",chunks:["Prepared the build instructions and validated the inputs."],result:{ok:!0},duration:420}};default:return{id:`preview-seq-tool-running-${a}`,role:"assistant",content:"",createdAt:o,streaming:!0,variant:"tool",toolCall:{id:`preview-tool-running-${a}`,name:"Get platform documentation",status:"running",chunks:["Fetching the relevant platform documentation..."]}}}}function Ha(e,t){return[...e,Qe(t,e.length)]}function Mt(e){return e==="assistant-message"||e==="assistant-code-block"||e==="assistant-markdown-table"||e==="assistant-image"}function $a(e,t,o){let a=Qe(e,t);if(!Mt(e)||typeof a.content!="string")return[{message:a,delayMs:0,done:!0}];let r=Math.max(1,o?.chunkSize??24),n=Math.max(0,o?.delayMs??42),s=a.content,l=[];l.push({message:{...a,content:"",streaming:!0},delayMs:0,done:!1});for(let c=r;c<s.length;c+=r)l.push({message:{...a,content:s.slice(0,c),streaming:!0},delayMs:n,done:!1});return l.push({message:{...a,content:s,streaming:!1},delayMs:n,done:!0}),l}var za=()=>[{id:"preview-adv-1",role:"user",content:"Can you create the product and gather the docs?",createdAt:new Date(Date.now()-18e4).toISOString()},{id:"preview-adv-2",role:"assistant",content:"",createdAt:new Date(Date.now()-15e4).toISOString(),streaming:!0,variant:"reasoning",reasoning:{id:"preview-reasoning",status:"streaming",chunks:["Now let me get the Persona embed documentation and builtin tools catalog."]}},{id:"preview-adv-3",role:"assistant",content:"",createdAt:new Date(Date.now()-12e4).toISOString(),streaming:!0,variant:"tool",toolCall:{id:"preview-tool-1",name:"Load tools",status:"running",chunks:["Loaded tools, used Runtype integration"]}},{id:"preview-adv-4",role:"assistant",content:"",createdAt:new Date(Date.now()-9e4).toISOString(),streaming:!0,variant:"tool",toolCall:{id:"preview-tool-2",name:"Get platform documentation",status:"running",chunks:["Get platform documentation"]}},{id:"preview-adv-5",role:"assistant",content:"I loaded the tools and fetched the docs. Next I can assemble the product details.",createdAt:new Date(Date.now()-3e4).toISOString()}],Ua=e=>!!(e?.features?.toolCallDisplay?.activePreview||e?.features?.toolCallDisplay?.grouped||e?.features?.toolCallDisplay?.collapsedMode&&e.features.toolCallDisplay.collapsedMode!=="tool-call"||e?.features?.reasoningDisplay?.activePreview);function Ft(e,t,o=[]){if(e==="follow-ups"){let a=Date.now();return[{id:"preview-follow-up-user",role:"user",content:"What can Persona help me build?",createdAt:new Date(a-12e4).toISOString()},{id:"preview-follow-up-assistant",role:"assistant",content:"Persona gives you a themeable streaming chat interface with flexible integrations and interaction patterns. Where would you like to go next?",createdAt:new Date(a-6e4).toISOString()},{id:"preview-follow-up-suggestions",role:"assistant",content:"",createdAt:new Date(a-59e3).toISOString(),streaming:!1,variant:"tool",toolCall:{id:"preview-follow-up-suggestions",name:"suggest_replies",status:"complete",args:{suggestions:[{id:"preview-implementation",label:"Show me an implementation",prompt:"Show me a practical implementation",description:"See a complete integration example",icon:"code-2",emphasis:"primary"},{id:"preview-theming",label:"Explore theming",prompt:"Tell me how theming works",description:"Customize colors, type, and component styles",icon:"palette"},{id:"preview-security",label:"Review security",prompt:"Explain the security model",description:"Learn about isolation and safe rendering",icon:"shield-check"},{id:"preview-support",label:"Talk to support",prompt:"Help me contact support",description:"Get help choosing the right approach",icon:"messages-square"}]},chunks:[]}},...o]}return e==="home"?[]:e==="minimized"?[{id:"preview-min-1",role:"assistant",content:"We are here whenever you are ready.",createdAt:new Date().toISOString()}]:e==="artifact"?[{id:"preview-art-1",role:"user",content:"Can you draft a quick overview of the project?",createdAt:new Date(Date.now()-12e4).toISOString()},{id:"preview-art-2",role:"assistant",content:"Here\u2019s a project overview document for you.",createdAt:new Date(Date.now()-6e4).toISOString()}]:e==="conversation"&&Ua(t)?[...za(),...o]:[{id:"preview-conv-1",role:"assistant",content:"Hello! How can I help you today?",createdAt:new Date(Date.now()-18e4).toISOString()},{id:"preview-conv-2",role:"user",content:"I want to customize the theme editor preview.",createdAt:new Date(Date.now()-12e4).toISOString()},{id:"preview-conv-3",role:"assistant",content:"Absolutely. Check out the [getting started guide](https://example.com) to see what\u2019s possible, then adjust colors and tokens to match your brand.",createdAt:new Date(Date.now()-6e4).toISOString()},...o]}function et(e,t,o=[]){let a={...e.launcher,enabled:!0,autoExpand:t!=="minimized"},r={...e,launcher:a,suggestionChips:t==="home"?e.suggestionChips?.length?e.suggestionChips:Vt:e.suggestionChips,initialMessages:Ft(t,e,o),storageAdapter:Dt};return t==="artifact"&&(r.features={...r.features,artifacts:{...r.features?.artifacts,enabled:!0}}),t==="messages"&&(r.features={...r.features,history:{presentation:"panel",...r.features?.history,enabled:!0}}),r}function Wt(e,t){let o=e.theme?S(e.theme,{validate:!1}):S();return{...M,...e.config,theme:o,darkTheme:e.darkTheme,colorScheme:t??e.config?.colorScheme??"light"}}function ja(e,t){let o=e.scene??"conversation";return et(Wt(e,t),o,e.appendedMessages??[])}function Ga(e,t,o){let a=e.scene??"conversation";return et(Wt(e,o),a,t)}function ye(e){return e==="card"?"collapsed":e}function Nt(e){return e.split(";",1)[0].trim().toLowerCase()}var qa=new Set(["__proto__","prototype","constructor"]),Ya=new Set(["collapsed","card","panel","inline"]),Ht=new Set(["markdown","component"]),Ka=/^[a-z0-9][a-z0-9!#$&^_.+-]*\/(\*|[a-z0-9!#$&^_.+-]+)$/,B=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),we=e=>!qa.has(e),tt=e=>typeof e=="string"&&Ya.has(e),$=e=>Object.keys(e).length>0;function R(e,t,o,a){e.push({path:t,code:o,message:a})}var Xa="Ignored because this key is not part of the persisted preference schema.",ke="Ignored an unsupported value.",Za="Expected collapsed, panel, or inline.",Ja='Expected a MIME type such as "text/html" or a wildcard such as "image/*".',$t={kind:"mode",message:ke},H={kind:"string",message:"Expected a CSS length string."},A={kind:"boolean"},Qa={paneWidth:H,paneMaxWidth:H,paneMinWidth:H,expandedPanelWidth:H,resizableMinWidth:H,resizableMaxWidth:H,expandLauncherPanelWhenOpen:A,resizable:A},er={kind:"object",message:"Expected a preference object.",children:{showToolCalls:A,showReasoning:A,toolCallDisplay:{kind:"object",children:{collapsedMode:{kind:"enum",values:new Set(["tool-call","tool-name","tool-preview"]),message:ke},groupedMode:{kind:"enum",values:new Set(["stack","summary"]),message:ke},loadingAnimation:{kind:"enum",values:new Set(["none","pulse","shimmer","shimmer-color","rainbow"]),message:ke},expandable:A,grouped:A}},reasoningDisplay:{kind:"object",children:{expandable:A,activePreview:A}},artifacts:{kind:"object",children:{display:{kind:"object",bareMode:!0,message:"Expected an artifact display rules object.",children:{default:$t,files:{kind:"object",bareMode:!0,message:"Expected collapsed, panel, inline, or a file display rules object.",children:{default:$t,byMediaType:{kind:"modeMap",keys:"mediaType"}}},byType:{kind:"modeMap",keys:Ht,alias:"byKind",deprecated:"Use byKind. The legacy selector was normalized automatically."},byKind:{kind:"modeMap",keys:Ht}}},filePreview:{kind:"object",children:{enabled:A}},layout:{kind:"object",children:Qa}}}}};function zt(e,t,o,a){if(e!==void 0)switch(t.kind){case"boolean":return typeof e=="boolean"?e:R(a,o,"invalid_type","Expected a boolean.");case"string":return typeof e=="string"?e:R(a,o,"invalid_type",t.message);case"enum":return typeof e=="string"&&t.values.has(e)?e:R(a,o,"invalid_value",t.message);case"mode":return tt(e)?ye(e):R(a,o,"invalid_value",t.message);case"modeMap":{if(!B(e))return R(a,o,"invalid_type","Expected an object.");let r=t.keys==="mediaType"?void 0:t.keys,n={};for(let[s,l]of Object.entries(e)){let c=r?s:Nt(s);we(s)&&(r?r.has(s):Ka.test(c))?tt(l)?n[c]=ye(l):R(a,`${o}.${s}`,"invalid_value",Za):R(a,`${o}.${s}`,r?"unknown_key":"invalid_value",r?"Ignored an unsupported selector.":Ja)}return $(n)?n:void 0}case"object":{if(t.bareMode&&tt(e))return ye(e);if(!B(e))return R(a,o,"invalid_type",t.message??"Expected an object.");let r=Object.keys(t.children),n=l=>o?`${o}.${l}`:l;for(let l of Object.keys(e))(!we(l)||!r.includes(l))&&R(a,n(l),"unknown_key",Xa);let s={};for(let l of r){let c=t.children[l],m=zt(e[l],c,n(l),a);if(c.deprecated&&e[l]!==void 0&&R(a,n(l),"deprecated_key",c.deprecated),m===void 0)continue;let b=c.alias??l,v=s[b];s[b]=B(v)&&B(m)?{...v,...m}:m}return $(s)?s:void 0}}}function tr(e){let t=[];return{preferences:(e===null?void 0:zt(e,er,"",t))??{},issues:t}}function z(e){if(Array.isArray(e))return e.map(z);if(!B(e))return e;let t={};for(let[o,a]of Object.entries(e))we(o)&&a!==void 0&&(t[o]=z(a));return t}function Ut(e,t){let o=z(e);for(let[a,r]of Object.entries(t)){if(!we(a)||r===void 0)continue;let n=o[a];o[a]=B(n)&&B(r)?Ut(n,r):z(r)}return o}function or(e){let t={},o;for(let r of e){let n=tr(r).preferences;o=jt(o,n.artifacts?.display),t=Ut(t,n)}let a=t;return a.artifacts&&(o!==void 0?a.artifacts.display=o:delete a.artifacts.display),a}function ar(e,t){if(t===void 0)return e===void 0?void 0:z(e);if(typeof t=="string")return t;let o=typeof e=="string"?{default:e}:e??{},a=t.default??o.default,r={...o.byMediaType,...t.byMediaType},n={...a?{default:a}:{},...$(r)?{byMediaType:r}:{}};return $(n)?n:void 0}function jt(e,t){if(t===void 0)return e===void 0?void 0:z(e);if(typeof t=="string")return t;let o=typeof e=="string"?{default:e}:e??{},a=t.default??o.default,r={...o.byType,...o.byKind,...t.byType,...t.byKind},n=ar(o.files,t.files),s={...a?{default:a}:{},...$(r)?{byKind:r}:{},...n!==void 0?{files:n}:{}};return $(s)?s:void 0}function Gt(e={},t){let o=or(t),a={...e};if(o.showToolCalls!==void 0&&(a.showToolCalls=o.showToolCalls),o.showReasoning!==void 0&&(a.showReasoning=o.showReasoning),o.toolCallDisplay&&(a.toolCallDisplay={...e.toolCallDisplay,...o.toolCallDisplay}),o.reasoningDisplay&&(a.reasoningDisplay={...e.reasoningDisplay,...o.reasoningDisplay}),o.artifacts){let r=e.artifacts??{},n={...r};if(o.artifacts.display!==void 0){let s=jt(r.display,o.artifacts.display);s!==void 0&&(n.display=s)}o.artifacts.filePreview&&(n.filePreview={...r.filePreview,enabled:o.artifacts.filePreview.enabled}),o.artifacts.layout&&(n.layout={...r.layout,...o.artifacts.layout}),a.artifacts=n}return a}function E(e){return{content:[{type:"text",text:JSON.stringify(e)}],structuredContent:e}}var Se={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",lime:"#00ff00",blue:"#0000ff",yellow:"#ffff00",cyan:"#00ffff",aqua:"#00ffff",magenta:"#ff00ff",fuchsia:"#ff00ff",silver:"#c0c0c0",gray:"#808080",grey:"#808080",maroon:"#800000",olive:"#808000",purple:"#800080",teal:"#008080",navy:"#000080",orange:"#ffa500",pink:"#ffc0cb",hotpink:"#ff69b4",gold:"#ffd700",indigo:"#4b0082",violet:"#ee82ee",brown:"#a52a2a",beige:"#f5f5dc",ivory:"#fffff0",khaki:"#f0e68c",coral:"#ff7f50",salmon:"#fa8072",tomato:"#ff6347",crimson:"#dc143c",turquoise:"#40e0d0",lavender:"#e6e6fa",plum:"#dda0dd",orchid:"#da70d6",tan:"#d2b48c",chocolate:"#d2691e",sienna:"#a0522d",slategray:"#708090",slategrey:"#708090",steelblue:"#4682b4",royalblue:"#4169e1",dodgerblue:"#1e90ff",skyblue:"#87ceeb",lightblue:"#add8e6",midnightblue:"#191970",forestgreen:"#228b22",seagreen:"#2e8b57",limegreen:"#32cd32",olivedrab:"#6b8e23",darkgreen:"#006400",emerald:"#50c878",mint:"#3eb489",goldenrod:"#daa520",firebrick:"#b22222",darkred:"#8b0000",indianred:"#cd5c5c",deeppink:"#ff1493",mediumpurple:"#9370db",rebeccapurple:"#663399",darkviolet:"#9400d3",slateblue:"#6a5acd",cornflowerblue:"#6495ed",teal2:"#008080",charcoal:"#36454f",graphite:"#3b3b3b",transparent:"transparent"},rr=/^rgba?\(\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*(,\s*(0|1|0?\.\d+|\d{1,3}%)\s*)?\)$/;function nr(e){return rr.test(e)}function U(e){if(typeof e!="string"||e.trim()==="")throw new Error('Color must be a non-empty string (e.g. "#2563eb" or "blue").');let t=e.trim().toLowerCase(),o=Se[t];if(o)return o;let a=Y(t);if(He(a)||a==="transparent"||nr(a))return a;throw new Error(`"${e}" is not a recognized color. Pass a hex value like "#ef4444" or a CSS color name (e.g. ${Object.keys(Se).slice(0,6).join(", ")}).`)}var xe=ne.map(e=>e==="gray"?"neutral":e),sr={...Object.fromEntries(xe.map(e=>[e,e])),gray:"neutral",grey:"neutral"};function Te(e,t=!0){let o=String(e??"").trim().toLowerCase(),a=sr[o];if(!a||!t&&a==="neutral"){let r=t?"primary, secondary, accent, neutral":"primary, secondary, accent";throw new Error(`Unknown color family "${e}". Valid families: ${r}.`)}return a}function Ce(e){let t=String(e??"solid").trim().toLowerCase();if(t==="solid"||t==="soft")return t;throw new Error(`Unknown intensity "${e}". Valid intensities: solid, soft.`)}function Re(e){let t=String(e??"").trim().toLowerCase();if(t==="light"||t==="dark"||t==="auto")return t;if(t==="system")return"auto";throw new Error(`Unknown color scheme "${e}". Valid: light, dark, auto.`)}var ir={sharp:"sharp",square:"sharp",none:"sharp",default:"default",normal:"default",rounded:"rounded",round:"rounded",soft:"rounded",pill:"pill",circle:"pill",full:"pill"};function Ae(e){let t=String(e??"").trim().toLowerCase(),o=ir[t];if(!o)throw new Error(`Unknown roundness "${e}". Valid: sharp, default, rounded, pill.`);return o}function Ee(e){if(typeof e=="number"&&Number.isFinite(e))return`${e}px`;if(typeof e=="string"&&e.trim()!==""){let t=e.trim();if(t==="9999px"||/^(100%|9999px)$/.test(t))return"9999px";let o=We(t);return Ne(o.value,o.unit)}throw new Error('Radius must be a number (px) or a CSS length string like "0.5rem".')}function Pe(e){for(let t of N){let o=t.fields.find(a=>a.id===e);if(o?.options){let a={};for(let r of o.options){let n=r.value.split(".").pop();n&&(a[n]=r.value)}return a}}return{}}var qt=Pe("typo-font-family"),Z=Pe("typo-font-size"),J=Pe("typo-font-weight"),ve=Pe("typo-line-height"),Yt={...qt,monospace:qt.mono},Kt={...Z,small:Z.sm,md:Z.base,medium:Z.base,large:Z.lg},Xt={...J,400:J.normal,500:J.medium,600:J.semibold,700:J.bold},Zt={...ve,"1.25":ve.tight,"1.5":ve.normal,"1.625":ve.relaxed};function Jt(e,t,o){let a=String(e??"").trim().toLowerCase(),r=t[a];if(!r){let n=[...new Set(Object.values(t).map(s=>s.split(".").pop()))].join(", ");throw new Error(`Unknown ${o} "${e}". Valid: ${n}.`)}return r}var Qt="theme.palette.radius.";function lr(){let e={pill:{sm:"9999px",md:"9999px",lg:"9999px",xl:"9999px",full:"9999px"}};for(let t of N)for(let o of t.presets??[]){let a=o.id.match(/^radius-(\w+)$/);if(!a)continue;let r={};for(let[n,s]of Object.entries(o.values))n.startsWith(Qt)&&typeof s=="string"&&(r[n.slice(Qt.length)]=s);e[a[1]]=r}return e}var ee=lr(),eo=["sm","md","lg","xl","full"];function De(e,t,o="theme",a=0){if(a>6)return null;let r=e.get(`${o}.${t}`);return typeof r!="string"||r===""?o==="darkTheme"?De(e,t,"theme",a):null:r.startsWith("#")||r.startsWith("rgb")||r==="transparent"?r:r.startsWith("palette.")||r.startsWith("semantic.")||r.startsWith("components.")?De(e,r,o,a+1):null}function Ie(e,t){let o=e.get(t);if(typeof o!="string")return"unknown";let a=o.split(".");return a[a.length-1]||String(o)}function j(e){return e.replace(/^role-/,"")}function cr(e){for(let[t,o]of Object.entries(ee))if(eo.every(a=>e[a]===o[a]))return t;return"custom"}function O(e){let t={};for(let a of eo)t[a]=String(e.get(`theme.palette.radius.${a}`)??"");let o={};for(let a of V)o[j(a.roleId)]=je(r=>e.get(`theme.${r}`),a);return{brand:{primary:ot(e.get("theme.palette.colors.primary.500")),secondary:ot(e.get("theme.palette.colors.secondary.500")),accent:ot(e.get("theme.palette.colors.accent.500"))},roles:o,typography:{fontFamily:Ie(e,"theme.semantic.typography.fontFamily"),fontSize:Ie(e,"theme.semantic.typography.fontSize"),fontWeight:Ie(e,"theme.semantic.typography.fontWeight"),lineHeight:Ie(e,"theme.semantic.typography.lineHeight")},roundness:{style:cr(t),radius:t},colorScheme:String(e.get("colorScheme")??"light"),history:{index:e.getHistoryIndex(),canUndo:e.canUndo(),canRedo:e.canRedo()}}}function ot(e){return typeof e=="string"&&e!==""?e:null}var Q=[{key:"user-message",label:"User message text",fg:"components.message.user.text",bg:"components.message.user.background"},{key:"assistant-message",label:"Assistant message text",fg:"components.message.assistant.text",bg:"components.message.assistant.background"},{key:"header",label:"Header title",fg:"components.header.titleForeground",fgFallbacks:["components.header.foreground"],bg:"components.header.background"},{key:"primary-button",label:"Primary button label",fg:"components.button.primary.foreground",bg:"components.button.primary.background"},{key:"input",label:"Input placeholder",fg:"components.input.placeholder",bg:"components.input.background"},{key:"link",label:"Link text",fg:"components.markdown.link.foreground",bg:"semantic.colors.background"},{key:"scroll",label:"Scroll-to-bottom icon",fg:"components.scrollToBottom.foreground",bg:"components.scrollToBottom.background"},{key:"body",label:"Body text on background",fg:"semantic.colors.text",bg:"semantic.colors.background"},{key:"surface",label:"Body text on surface",fg:"semantic.colors.text",bg:"semantic.colors.surface"}];function dr(e,t,o){for(let a of[t.fg,...t.fgFallbacks??[]]){let r=De(e,a,o);if(r)return r}return null}function to(e){let t=new Set(e.targets.map(o=>o.path));return Q.filter(o=>t.has(o.fg)||t.has(o.bg)).map(o=>o.key)}var pr={AA:4.5,AAA:7};function ur(e){return Math.round(e*100)/100}function gr(e,t,o,a,r){let n=e.get(`${r}.${t}`);if(typeof n!="string")return null;let s=n.match(/^palette\.colors\.(\w+)\.(\d+)$/);if(!s)return null;let l=s[1],c=F.indexOf(s[2]),m=null,b=1/0;return F.forEach((v,T)=>{let P=e.get(`${r}.palette.colors.${l}.${v}`);if(!(typeof P!="string"||!(P.startsWith("#")||P.startsWith("rgb")))&&re(P,o)>=a){let L=c>=0?Math.abs(T-c):T;L<b&&(b=L,m=`palette.colors.${l}.${v}`)}}),m}function te(e,t="AA",o="both",a){let r=pr[t],n=o==="both"?["light","dark"]:[o],s=a?Q.filter(c=>a.includes(c.key)):Q,l=[];for(let c of n){let m=c==="light"?"theme":"darkTheme";for(let b of s){let v=dr(e,b,m),T=De(e,b.bg,m);if(!v||!T)continue;let P=ur(re(v,T)),L=P>=r,Ve={pair:b.key,label:b.label,variant:c,fg:v,bg:T,ratio:P,threshold:r,passes:L};if(!L){let Be=gr(e,b.fg,T,r,m);Be&&(Ve.suggestion=Be)}l.push(Ve)}}return{level:t,checks:l,failures:l.filter(c=>!c.passes)}}function G(e,t,o="light",a="AA"){return t.length===0?[]:te(e,a,o,t).failures.map(n=>({code:"contrast",pair:n.pair,variant:n.variant,ratio:n.ratio,threshold:n.threshold,message:`${n.label} (${n.variant}) has a contrast ratio of ${n.ratio}:1, below the ${a} threshold of ${n.threshold}:1${n.suggestion?`. Try ${n.suggestion} for the foreground.`:"."}`}))}var w={};for(let e of V){let t=j(e.roleId);w[t]=e,w[e.roleId]=e}Object.assign(w,{surface:w.surfaces,background:w.surfaces,backgrounds:w.surfaces,user:w["user-messages"],"user-message":w["user-messages"],assistant:w["assistant-messages"],"assistant-message":w["assistant-messages"],actions:w["primary-actions"],buttons:w["primary-actions"],composer:w.input,links:w["links-focus"],focus:w["links-focus"],border:w.borders,dividers:w.borders,scroll:w["scroll-to-bottom"]});function mr(e){let t=String(e??"").trim().toLowerCase(),o=w[t];if(!o){let a=V.map(r=>j(r.roleId)).join(", ");throw new Error(`Unknown role "${e}". Valid roles: ${a}.`)}return o}function oo(){let e=new Map,t=o=>{for(let a of o)for(let r of a.fields)e.has(r.id)||e.set(r.id,r)};for(let o of Ye)t(o.sections);for(let o of he)t(o.sections);return e}var fr={voice:"voiceRecognition.enabled",artifacts:"features.artifacts.enabled",attachments:"attachments.enabled",toolCalls:"features.showToolCalls",reasoning:"features.showReasoning",feedback:"messageActions.enabled"},hr={avatars:"layout.messages.avatar.show",timestamps:"layout.messages.timestamp.show",showHeader:"layout.showHeader",messageStyle:"layout.messages.layout"},at=["bottom-right","bottom-left","top-right","top-left"],rt=["bubble","flat","minimal"],br={title:"copy.welcomeTitle",subtitle:"copy.welcomeSubtitle",placeholder:"copy.inputPlaceholder",sendLabel:"copy.sendButtonLabel"};function ao(e,t){let o=t?.editTarget??"both",a=null,r=f=>f&&typeof f=="object"?f:{},n=(f,p,d=o)=>{let i={};return(d==="light"||d==="both")&&(i[`theme.${f}`]=p),(d==="dark"||d==="both")&&(i[`darkTheme.${f}`]=p),i},s=f=>{if(o==="both")return f;let p={};for(let[d,i]of Object.entries(f))(o==="light"&&d.startsWith("theme.")||o==="dark"&&d.startsWith("darkTheme."))&&(p[d]=i);return p},l=()=>o==="dark"?"dark":"light",c=(f,p=[])=>E({ok:!0,summary:O(e),warnings:p,applied:f});return[{name:"get_theme_overview",title:"Get current theme & what is editable",description:"Read theme summary, presets, and editable levers. Call before editing.",annotations:{readOnlyHint:!0},inputSchema:{type:"object",properties:{verbosity:{type:"string",enum:["summary","full"],description:"'full' includes the field-id index."}},additionalProperties:!1},execute(f){let{verbosity:p}=r(f),d={summary:O(e),availableRoles:V.map(i=>({role:j(i.roleId),helper:i.helper})),availableFamilies:xe,presets:X.map(i=>({id:i.id,name:i.name,description:i.description,tags:i.tags??[]})),tools:[{tool:"set_brand_colors",hint:"Recolor primary/secondary/accent and generate shade scales."},{tool:"assign_color_role",hint:"Recolor a widget region with family + intensity."},{tool:"set_typography",hint:"Set font family, size, weight, line height."},{tool:"set_roundness",hint:"Set corner roundness or granular radii."},{tool:"set_color_scheme",hint:"Set light/dark/auto and edit target."},{tool:"apply_preset",hint:"Apply a built-in preset."},{tool:"configure_widget",hint:"Toggle launcher position, features, and layout."},{tool:"set_copy_and_suggestions",hint:"Set welcome copy, placeholder, and suggestion chips."},{tool:"set_theme_fields",hint:"Set any field by id or dot-path."},{tool:"check_contrast",hint:"Audit WCAG contrast."},{tool:"manage_session",hint:"Undo, redo, reset, or export the theme."}]};return p==="full"&&(a??(a=oo()),d.fieldIndex=Array.from(a.values()).map(i=>({id:i.id,path:i.path,type:i.type,label:i.label,options:i.options?.map(u=>u.value)}))),E(d)}},{name:"set_brand_colors",title:"Set brand colors",description:"Set primary, secondary, and/or accent colors. Generates shade scales and accepts hex, rgb/rgba, or CSS names.",inputSchema:{type:"object",properties:{primary:{type:"string",description:"Hex, rgb/rgba, or CSS name."},secondary:{type:"string",description:"Hex, rgb/rgba, or CSS name."},accent:{type:"string",description:"Hex, rgb/rgba, or CSS name."}},additionalProperties:!1},execute(f){let p=r(f),d=["primary","secondary","accent"],i={},u={};for(let g of d){if(p[g]===void 0)continue;let y=U(p[g]);u[g]=y;let x=ze(y);for(let I of F){let q=x[I];q!==void 0&&Object.assign(i,n(`palette.colors.${g}.${I}`,q))}}if(Object.keys(u).length===0)throw new Error("Provide at least one of: primary, secondary, accent.");e.setBatch(i);let h=G(e,["primary-button","user-message"],l());return c(u,h)}},{name:"assign_color_role",title:"Assign a color family to an interface role",description:"Recolor a widget region by role, palette family, and intensity.",inputSchema:{type:"object",properties:{role:{type:"string",description:"Role, e.g. header or user-messages."},family:{type:"string",enum:xe},intensity:{type:"string",enum:["solid","soft"],description:"Default: solid."}},required:["role","family"],additionalProperties:!1},execute(f){let p=r(f),d=mr(p.role),i=Te(p.family,!0),u=Ce(p.intensity),h=s(fe(i,u,d)),g=Object.keys(h).length;e.setBatch(h);let y=G(e,to(d),l());return c({role:j(d.roleId),family:i,intensity:u,tokensWritten:g},y)}},{name:"set_typography",title:"Set typography",description:"Set font family, size, weight, and line height.",inputSchema:{type:"object",properties:{fontFamily:{type:"string"},fontSize:{type:"string"},fontWeight:{type:["string","number"]},lineHeight:{type:["string","number"]}},additionalProperties:!1},execute(f){let p=r(f),d={},i={},u=(h,g)=>{if(p[h]===void 0)return;let y=Jt(p[h],g,h);i[h]=y.split(".").pop()??y,Object.assign(d,n(`semantic.typography.${h}`,y))};if(u("fontFamily",Yt),u("fontSize",Kt),u("fontWeight",Xt),u("lineHeight",Zt),Object.keys(i).length===0)throw new Error("Provide at least one of: fontFamily, fontSize, fontWeight, lineHeight.");return e.setBatch(d),c(i)}},{name:"set_roundness",title:"Set corner roundness",description:"Set roundness by style or granular radius values.",inputSchema:{type:"object",properties:{style:{type:"string",enum:["sharp","default","rounded","pill"]},radius:{type:"object",description:"Granular px or CSS length overrides.",properties:{sm:{type:["string","number"]},md:{type:["string","number"]},lg:{type:["string","number"]},xl:{type:["string","number"]},full:{type:["string","number"]}},additionalProperties:!1}},additionalProperties:!1},execute(f){let p=r(f),d={},i={};if(p.style!==void 0){let u=Ae(p.style);i.style=u;for(let[h,g]of Object.entries(ee[u]))Object.assign(d,n(`palette.radius.${h}`,g))}if(p.radius!==void 0){let u=r(p.radius),h={};for(let g of["sm","md","lg","xl","full"]){if(u[g]===void 0)continue;let y=Ee(u[g]);h[g]=y,Object.assign(d,n(`palette.radius.${g}`,y))}i.radius=h}if(Object.keys(d).length===0)throw new Error("Provide `style` (sharp|default|rounded|pill) or a `radius` object.");return e.setBatch(d),c(i)}},{name:"set_color_scheme",title:"Set color scheme",description:"Set light/dark/auto color scheme and optional edit target.",inputSchema:{type:"object",properties:{scheme:{type:"string",enum:["light","dark","auto"]},editTarget:{type:"string",enum:["light","dark","both"]}},additionalProperties:!1},execute(f){let p=r(f),d={};if(p.scheme!==void 0){let i=Re(p.scheme);e.set("colorScheme",i),d.scheme=i}if(p.editTarget!==void 0){let i=String(p.editTarget).trim().toLowerCase();if(i!=="light"&&i!=="dark"&&i!=="both")throw new Error(`Unknown editTarget "${p.editTarget}". Valid: light, dark, both.`);o=i,d.editTarget=i}if(Object.keys(d).length===0)throw new Error("Provide `scheme` and/or `editTarget`.");return E({ok:!0,summary:O(e),warnings:[],applied:d,editTarget:o})}},{name:"apply_preset",title:"Apply a built-in theme preset",description:"Apply a complete built-in preset, replacing theme tokens. Call get_theme_overview to list preset ids.",inputSchema:{type:"object",properties:{presetId:{type:"string"}},required:["presetId"],additionalProperties:!1},execute(f){let{presetId:p}=r(f),d=Ze(String(p??""));if(!d){let g=X.map(y=>y.id).join(", ");throw new Error(`Unknown preset "${p}". Valid presets: ${g}.`)}let i=S(d.theme,{validate:!1}),u={...e.getConfig()};d.darkTheme&&(u.darkTheme=S(d.darkTheme,{validate:!1}),u.colorScheme="auto"),d.toolCall&&(u.toolCall=d.toolCall),d.behavior&&(u.features=Gt(u.features,[d.behavior])),e.setFullConfig(u,i);let h=G(e,["body","assistant-message"],"light");return c({appliedPreset:{id:d.id,name:d.name}},h)}},{name:"configure_widget",title:"Configure launcher, features, and layout",description:"Toggle launcher position, feature flags, and message layout.",inputSchema:{type:"object",properties:{launcherPosition:{type:"string",enum:at},features:{type:"object",properties:{voice:{type:"boolean"},artifacts:{type:"boolean"},attachments:{type:"boolean"},toolCalls:{type:"boolean"},reasoning:{type:"boolean"},feedback:{type:"boolean"}},additionalProperties:!1},layout:{type:"object",properties:{avatars:{type:"boolean"},timestamps:{type:"boolean"},showHeader:{type:"boolean"},messageStyle:{type:"string",enum:rt}},additionalProperties:!1}},additionalProperties:!1},execute(f){let p=r(f),d={},i={};if(p.launcherPosition!==void 0){let g=String(p.launcherPosition);if(!at.includes(g))throw new Error(`Unknown launcherPosition "${g}". Valid: ${at.join(", ")}.`);d["launcher.position"]=g,i.launcherPosition=g}let u=r(p.features);for(let[g,y]of Object.entries(fr))u[g]!==void 0&&(d[y]=!!u[g],i.features??(i.features={}),i.features[g]=!!u[g]);let h=r(p.layout);for(let[g,y]of Object.entries(hr))if(h[g]!==void 0)if(g==="messageStyle"){let x=String(h[g]);if(!rt.includes(x))throw new Error(`Unknown messageStyle "${x}". Valid: ${rt.join(", ")}.`);d[y]=x,i.layout??(i.layout={}),i.layout[g]=x}else d[y]=!!h[g],i.layout??(i.layout={}),i.layout[g]=!!h[g];if(Object.keys(d).length===0)throw new Error("Provide launcherPosition, features, and/or layout.");return e.setBatch(d),c(i)}},{name:"set_copy_and_suggestions",title:"Set welcome copy and suggestion chips",description:"Set welcome copy, input placeholder, send label, and suggestion chips.",inputSchema:{type:"object",properties:{title:{type:"string"},subtitle:{type:"string"},placeholder:{type:"string"},sendLabel:{type:"string"},suggestions:{type:"array",items:{type:"string"}}},additionalProperties:!1},execute(f){let p=r(f),d={},i={};for(let[u,h]of Object.entries(br))p[u]!==void 0&&(d[h]=String(p[u]),i[u]=String(p[u]));if(p.suggestions!==void 0){if(!Array.isArray(p.suggestions))throw new Error("`suggestions` must be an array of strings.");let u=p.suggestions.filter(h=>typeof h=="string");d.suggestionChips=u,i.suggestions=u}if(Object.keys(d).length===0)throw new Error("Provide at least one of: title, subtitle, placeholder, sendLabel, suggestions.");return e.setBatch(d),c(i)}},{name:"set_theme_fields",title:"Set theme fields by id or path (advanced)",description:"Advanced escape hatch: set fields by id or raw dot-path. Values are validated when metadata exists.",inputSchema:{type:"object",properties:{updates:{type:"array",items:{type:"object",properties:{field:{type:"string",description:"Field id or path."},value:{type:["string","number","boolean"]}},required:["field","value"],additionalProperties:!1}}},required:["updates"],additionalProperties:!1},execute(f){let{updates:p}=r(f);if(!Array.isArray(p)||p.length===0)throw new Error("`updates` must be a non-empty array of { field, value }.");a??(a=oo());let d={},i=[];for(let h of p){let g=r(h),y=String(g.field??"");try{let x=a.get(y),I=x?x.path:y;if(!x&&!/^(theme|darkTheme)\.|\./.test(I))throw new Error(`Unknown field "${y}". Pass a known field id or a dot-path (e.g. theme.palette.radius.md).`);let q=yr(x,g.value);if(x&&I.startsWith("theme.")){let nt=n(I.slice(6),q);Object.assign(d,nt),i.push({field:y,resolvedPath:Object.keys(nt),ok:!0})}else d[I]=q,i.push({field:y,resolvedPath:I,ok:!0})}catch(x){i.push({field:y,ok:!1,error:x.message})}}let u=i.filter(h=>h.ok);return Object.keys(d).length>0&&e.setBatch(d),E({ok:u.length>0,summary:O(e),warnings:[],applied:{updates:i}})}},{name:"check_contrast",title:"Check accessibility contrast",description:"Run WCAG checks over key text/background pairs.",annotations:{readOnlyHint:!0},inputSchema:{type:"object",properties:{level:{type:"string",enum:["AA","AAA"],description:"Default: AA."},variant:{type:"string",enum:["light","dark","both"],description:"Default: both."}},additionalProperties:!1},execute(f){let p=r(f),d=p.level==="AAA"?"AAA":"AA",i=p.variant==="light"||p.variant==="dark"?p.variant:"both",u=te(e,d,i);return E({level:u.level,passing:u.checks.length-u.failures.length,total:u.checks.length,checks:u.checks,failures:u.failures})}},{name:"manage_session",title:"Undo, redo, reset, or export the theme",description:"Undo, redo, reset defaults, or export the theme snapshot.",inputSchema:{type:"object",properties:{action:{type:"string",enum:["undo","redo","reset","export"]}},required:["action"],additionalProperties:!1},execute(f){let{action:p}=r(f);switch(p){case"undo":return e.undo(),c({action:"undo"});case"redo":return e.redo(),c({action:"redo"});case"reset":return e.resetToDefaults(),c({action:"reset"});case"export":return E({ok:!0,snapshot:e.exportSnapshot()});default:throw new Error(`Unknown action "${p}". Valid: undo, redo, reset, export.`)}}}]}function yr(e,t){if(!e)return t;switch(e.type){case"color":return e.parseValue?e.parseValue(U(t)):U(t);case"toggle":return typeof t=="boolean"?t:t==="true"||t===1;case"slider":{let o=Number(t);if(!Number.isFinite(o))throw new Error(`"${e.id}" expects a number.`);if(e.slider){let{min:a,max:r}=e.slider;if(o<a||o>r)throw new Error(`"${e.id}" must be between ${a} and ${r}.`)}return e.parseValue?e.parseValue(o):o}case"select":{let o=String(t);if(e.options&&!e.options.some(a=>a.value===o))throw new Error(`"${e.id}" must be one of: ${e.options.map(a=>a.value).join(", ")}.`);return e.parseValue?e.parseValue(o):o}default:return e.parseValue?e.parseValue(t):t}}export{Et as ADVANCED_TOKENS_SECTION,V as ALL_ROLES,Ye as ALL_TABS,wt as ARTIFACT_DISPLAY_PREFERENCE_SECTION,Tt as BRAND_PALETTE_SECTION,It as BUILT_IN_PRESETS,Oo as COLORS_SECTIONS,Ue as COLOR_FAMILIES,kt as COMPONENTS_SECTIONS,yt as COMPONENT_COLOR_SECTIONS,bt as COMPONENT_SHAPE_SECTIONS,St as CONFIGURE_SECTIONS,he as CONFIGURE_SUB_GROUPS,Q as CONTRAST_PAIRS,Se as CSS_NAMED_COLORS,Oa as DEVICE_DIMENSIONS,Vt as HOME_SUGGESTION_CHIPS,Rt as INTERFACE_ROLES_SECTION,Lt as MOCK_BROWSER_CONTENT,_t as MOCK_WORKSPACE_CONTENT,Vo as PALETTE_SECTION,Dt as PREVIEW_STORAGE_ADAPTER,ee as RADIUS_PRESETS,ce as ROLE_ASSISTANT_MESSAGES,me as ROLE_BORDERS,ne as ROLE_FAMILIES,ko as ROLE_FAMILY_LABELS,ie as ROLE_HEADER,ue as ROLE_INPUT,C as ROLE_INTENSITIES,ge as ROLE_LINKS_FOCUS,de as ROLE_PRIMARY_ACTIONS,pe as ROLE_SCROLL_TO_BOTTOM,se as ROLE_SURFACES,le as ROLE_USER_MESSAGES,Bo as SEMANTIC_COLORS_SECTION,F as SHADE_KEYS,be as SHELL_STYLE_ID,At as STATUS_COLORS_SECTION,Ct as STATUS_PALETTE_SECTION,vt as STREAM_AND_ARTIFACTS_SUB_GROUP,N as STYLE_SECTIONS,Ia as STYLE_SECTIONS_V2,X as THEME_EDITOR_PRESETS,xt as THEME_SECTION,Fe as ThemeEditorState,_a as ZOOM_MAX,La as ZOOM_MIN,Ha as appendPreviewTranscriptEntry,et as applySceneConfig,Ma as applyShellTheme,ja as buildPreviewConfig,Ga as buildPreviewConfigWithMessages,Je as buildShellCss,Fa as buildSrcdoc,O as buildSummary,$a as buildTranscriptStreamFrames,U as coerceColor,Te as coerceFamily,Ce as coerceIntensity,Ee as coerceRadius,Ae as coerceRoundnessStyle,Re as coerceScheme,ho as convertFromPx,fo as convertToPx,Ft as createPreviewMessages,Qe as createPreviewTranscriptEntry,ao as createThemeEditorTools,je as detectRoleAssignment,Bt as escapeHtml,Va as findSection,Ne as formatCssValue,ze as generateColorScale,Na as getPreviewTranscriptPresetLabel,Ot as getShellPalette,Ze as getThemeEditorPreset,it as hexToHsl,lt as hslToHex,He as isValidHex,Y as normalizeColorValue,bo as paletteColorPath,We as parseCssValue,Mt as presetStreamsText,G as quickContrastWarnings,fe as resolveRoleAssignment,ct as resolveThemeColorPath,$e as rgbToHex,te as runContrastChecks,Ba as scopeSection,yo as tokenRefDisplayName,E as toolResult,re as wcagContrastRatio};
87
+ `),createdAt:o};case"reasoning-streaming":return{id:`preview-seq-reasoning-stream-${a}`,role:"assistant",content:"",createdAt:o,streaming:!0,variant:"reasoning",reasoning:{id:`preview-reasoning-stream-${a}`,status:"streaming",chunks:["Thinking through the next step in the workflow..."]}};case"reasoning-complete":return{id:`preview-seq-reasoning-complete-${a}`,role:"assistant",content:"",createdAt:o,streaming:!1,variant:"reasoning",reasoning:{id:`preview-reasoning-complete-${a}`,status:"complete",chunks:["Reviewed the requirements and finalized the reasoning output."],durationMs:1200}};case"approval-request":{let r=`preview-approval-${a}`;return{id:`approval-${r}`,role:"assistant",content:"",createdAt:o,streaming:!1,variant:"approval",approval:{id:r,status:"pending",agentId:"preview-agent",executionId:`preview-exec-${a}`,toolName:"add_to_cart",description:"Add the selected item to the shopping cart. Approve to let the assistant continue.",parameters:{items:[{productEntityId:129,quantity:1}]}}}}case"tool-complete":return{id:`preview-seq-tool-complete-${a}`,role:"assistant",content:"",createdAt:o,streaming:!1,variant:"tool",toolCall:{id:`preview-tool-complete-${a}`,name:"Create build instructions",status:"complete",chunks:["Prepared the build instructions and validated the inputs."],result:{ok:!0},duration:420}};default:return{id:`preview-seq-tool-running-${a}`,role:"assistant",content:"",createdAt:o,streaming:!0,variant:"tool",toolCall:{id:`preview-tool-running-${a}`,name:"Get platform documentation",status:"running",chunks:["Fetching the relevant platform documentation..."]}}}}function mr(e,t){return[...e,st(t,e.length)]}function Xt(e){return e==="assistant-message"||e==="assistant-code-block"||e==="assistant-markdown-table"||e==="assistant-image"}function fr(e,t,o){let a=st(e,t);if(!Xt(e)||typeof a.content!="string")return[{message:a,delayMs:0,done:!0}];let r=Math.max(1,o?.chunkSize??24),n=Math.max(0,o?.delayMs??42),s=a.content,i=[];i.push({message:{...a,content:"",streaming:!0},delayMs:0,done:!1});for(let l=r;l<s.length;l+=r)i.push({message:{...a,content:s.slice(0,l),streaming:!0},delayMs:n,done:!1});return i.push({message:{...a,content:s,streaming:!1},delayMs:n,done:!0}),i}var hr=()=>[{id:"preview-adv-1",role:"user",content:"Can you create the product and gather the docs?",createdAt:new Date(Date.now()-18e4).toISOString()},{id:"preview-adv-2",role:"assistant",content:"",createdAt:new Date(Date.now()-15e4).toISOString(),streaming:!0,variant:"reasoning",reasoning:{id:"preview-reasoning",status:"streaming",chunks:["Now let me get the Persona embed documentation and builtin tools catalog."]}},{id:"preview-adv-3",role:"assistant",content:"",createdAt:new Date(Date.now()-12e4).toISOString(),streaming:!0,variant:"tool",toolCall:{id:"preview-tool-1",name:"Load tools",status:"running",chunks:["Loaded tools, used Runtype integration"]}},{id:"preview-adv-4",role:"assistant",content:"",createdAt:new Date(Date.now()-9e4).toISOString(),streaming:!0,variant:"tool",toolCall:{id:"preview-tool-2",name:"Get platform documentation",status:"running",chunks:["Get platform documentation"]}},{id:"preview-adv-5",role:"assistant",content:"I loaded the tools and fetched the docs. Next I can assemble the product details.",createdAt:new Date(Date.now()-3e4).toISOString()}],br=e=>!!(e?.features?.toolCallDisplay?.activePreview||e?.features?.toolCallDisplay?.grouped||e?.features?.toolCallDisplay?.collapsedMode&&e.features.toolCallDisplay.collapsedMode!=="tool-call"||e?.features?.reasoningDisplay?.activePreview);function Jt(e,t,o=[]){if(e==="follow-ups"){let a=Date.now();return[{id:"preview-follow-up-user",role:"user",content:"What can Persona help me build?",createdAt:new Date(a-12e4).toISOString()},{id:"preview-follow-up-assistant",role:"assistant",content:"Persona gives you a themeable streaming chat interface with flexible integrations and interaction patterns. Where would you like to go next?",createdAt:new Date(a-6e4).toISOString()},{id:"preview-follow-up-suggestions",role:"assistant",content:"",createdAt:new Date(a-59e3).toISOString(),streaming:!1,variant:"tool",toolCall:{id:"preview-follow-up-suggestions",name:"suggest_replies",status:"complete",args:{suggestions:[{id:"preview-implementation",label:"Show me an implementation",prompt:"Show me a practical implementation",description:"See a complete integration example",icon:"code-2",emphasis:"primary"},{id:"preview-theming",label:"Explore theming",prompt:"Tell me how theming works",description:"Customize colors, type, and component styles",icon:"palette"},{id:"preview-security",label:"Review security",prompt:"Explain the security model",description:"Learn about isolation and safe rendering",icon:"shield-check"},{id:"preview-support",label:"Talk to support",prompt:"Help me contact support",description:"Get help choosing the right approach",icon:"messages-square"}]},chunks:[]}},...o]}return e==="home"?[]:e==="minimized"?[{id:"preview-min-1",role:"assistant",content:"We are here whenever you are ready.",createdAt:new Date().toISOString()}]:e==="artifact"?[{id:"preview-art-1",role:"user",content:"Can you draft a quick overview of the project?",createdAt:new Date(Date.now()-12e4).toISOString()},{id:"preview-art-2",role:"assistant",content:"Here\u2019s a project overview document for you.",createdAt:new Date(Date.now()-6e4).toISOString()}]:e==="conversation"&&br(t)?[...hr(),...o]:[{id:"preview-conv-1",role:"assistant",content:"Hello! How can I help you today?",createdAt:new Date(Date.now()-18e4).toISOString()},{id:"preview-conv-2",role:"user",content:"I want to customize the theme editor preview.",createdAt:new Date(Date.now()-12e4).toISOString()},{id:"preview-conv-3",role:"assistant",content:"Absolutely. Check out the [getting started guide](https://example.com) to see what\u2019s possible, then adjust colors and tokens to match your brand.",createdAt:new Date(Date.now()-6e4).toISOString()},...o]}function it(e,t,o=[]){let a={...e.launcher,enabled:!0,autoExpand:t!=="minimized"},r={...e,launcher:a,suggestionChips:t==="home"?e.suggestionChips?.length?e.suggestionChips:Gt:e.suggestionChips,initialMessages:Jt(t,e,o),storageAdapter:jt};return t==="artifact"&&(r.features={...r.features,artifacts:{...r.features?.artifacts,enabled:!0}}),t==="messages"&&(r.features={...r.features,history:{presentation:"panel",...r.features?.history,enabled:!0}}),r}function Qt(e,t){let o=P(e.config),a=e.config?.future,r=e.theme?w(e.theme,{validate:!1,future:a}):w(void 0,{future:a});return{...o,...e.config,theme:r,darkTheme:e.darkTheme,colorScheme:t??e.config?.colorScheme??"light"}}function yr(e,t){let o=e.scene??"conversation";return it(Qt(e,t),o,e.appendedMessages??[])}function kr(e,t,o){let a=e.scene??"conversation";return it(Qt(e,o),a,t)}function Se(e){return e==="card"?"collapsed":e}function eo(e){return e.split(";",1)[0].trim().toLowerCase()}var vr=new Set(["__proto__","prototype","constructor"]),xr=new Set(["collapsed","card","panel","inline"]),to=new Set(["markdown","component"]),wr=/^[a-z0-9][a-z0-9!#$&^_.+-]*\/(\*|[a-z0-9!#$&^_.+-]+)$/,O=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Ce=e=>!vr.has(e),lt=e=>typeof e=="string"&&xr.has(e),j=e=>Object.keys(e).length>0;function R(e,t,o,a){e.push({path:t,code:o,message:a})}var Sr="Ignored because this key is not part of the persisted preference schema.",Te="Ignored an unsupported value.",Tr="Expected collapsed, panel, or inline.",Cr='Expected a MIME type such as "text/html" or a wildcard such as "image/*".',oo={kind:"mode",message:Te},U={kind:"string",message:"Expected a CSS length string."},D={kind:"boolean"},Ar={paneWidth:U,paneMaxWidth:U,paneMinWidth:U,expandedPanelWidth:U,resizableMinWidth:U,resizableMaxWidth:U,expandLauncherPanelWhenOpen:D,resizable:D},Rr={kind:"object",message:"Expected a preference object.",children:{showToolCalls:D,showReasoning:D,toolCallDisplay:{kind:"object",children:{collapsedMode:{kind:"enum",values:new Set(["tool-call","tool-name","tool-preview"]),message:Te},groupedMode:{kind:"enum",values:new Set(["stack","summary"]),message:Te},loadingAnimation:{kind:"enum",values:new Set(["none","pulse","shimmer","shimmer-color","rainbow"]),message:Te},expandable:D,grouped:D}},reasoningDisplay:{kind:"object",children:{expandable:D,activePreview:D}},artifacts:{kind:"object",children:{display:{kind:"object",bareMode:!0,message:"Expected an artifact display rules object.",children:{default:oo,files:{kind:"object",bareMode:!0,message:"Expected collapsed, panel, inline, or a file display rules object.",children:{default:oo,byMediaType:{kind:"modeMap",keys:"mediaType"}}},byType:{kind:"modeMap",keys:to,alias:"byKind",deprecated:"Use byKind. The legacy selector was normalized automatically."},byKind:{kind:"modeMap",keys:to}}},filePreview:{kind:"object",children:{enabled:D}},layout:{kind:"object",children:Ar}}}}};function ao(e,t,o,a){if(e!==void 0)switch(t.kind){case"boolean":return typeof e=="boolean"?e:R(a,o,"invalid_type","Expected a boolean.");case"string":return typeof e=="string"?e:R(a,o,"invalid_type",t.message);case"enum":return typeof e=="string"&&t.values.has(e)?e:R(a,o,"invalid_value",t.message);case"mode":return lt(e)?Se(e):R(a,o,"invalid_value",t.message);case"modeMap":{if(!O(e))return R(a,o,"invalid_type","Expected an object.");let r=t.keys==="mediaType"?void 0:t.keys,n={};for(let[s,i]of Object.entries(e)){let l=r?s:eo(s);Ce(s)&&(r?r.has(s):wr.test(l))?lt(i)?n[l]=Se(i):R(a,`${o}.${s}`,"invalid_value",Tr):R(a,`${o}.${s}`,r?"unknown_key":"invalid_value",r?"Ignored an unsupported selector.":Cr)}return j(n)?n:void 0}case"object":{if(t.bareMode&&lt(e))return Se(e);if(!O(e))return R(a,o,"invalid_type",t.message??"Expected an object.");let r=Object.keys(t.children),n=i=>o?`${o}.${i}`:i;for(let i of Object.keys(e))(!Ce(i)||!r.includes(i))&&R(a,n(i),"unknown_key",Sr);let s={};for(let i of r){let l=t.children[i],g=ao(e[i],l,n(i),a);if(l.deprecated&&e[i]!==void 0&&R(a,n(i),"deprecated_key",l.deprecated),g===void 0)continue;let f=l.alias??i,x=s[f];s[f]=O(x)&&O(g)?{...x,...g}:g}return j(s)?s:void 0}}}function Er(e){let t=[];return{preferences:(e===null?void 0:ao(e,Rr,"",t))??{},issues:t}}function G(e){if(Array.isArray(e))return e.map(G);if(!O(e))return e;let t={};for(let[o,a]of Object.entries(e))Ce(o)&&a!==void 0&&(t[o]=G(a));return t}function ro(e,t){let o=G(e);for(let[a,r]of Object.entries(t)){if(!Ce(a)||r===void 0)continue;let n=o[a];o[a]=O(n)&&O(r)?ro(n,r):G(r)}return o}function Pr(e){let t={},o;for(let r of e){let n=Er(r).preferences;o=no(o,n.artifacts?.display),t=ro(t,n)}let a=t;return a.artifacts&&(o!==void 0?a.artifacts.display=o:delete a.artifacts.display),a}function Dr(e,t){if(t===void 0)return e===void 0?void 0:G(e);if(typeof t=="string")return t;let o=typeof e=="string"?{default:e}:e??{},a=t.default??o.default,r={...o.byMediaType,...t.byMediaType},n={...a?{default:a}:{},...j(r)?{byMediaType:r}:{}};return j(n)?n:void 0}function no(e,t){if(t===void 0)return e===void 0?void 0:G(e);if(typeof t=="string")return t;let o=typeof e=="string"?{default:e}:e??{},a=t.default??o.default,r={...o.byType,...o.byKind,...t.byType,...t.byKind},n=Dr(o.files,t.files),s={...a?{default:a}:{},...j(r)?{byKind:r}:{},...n!==void 0?{files:n}:{}};return j(s)?s:void 0}function so(e={},t){let o=Pr(t),a={...e};if(o.showToolCalls!==void 0&&(a.showToolCalls=o.showToolCalls),o.showReasoning!==void 0&&(a.showReasoning=o.showReasoning),o.toolCallDisplay&&(a.toolCallDisplay={...e.toolCallDisplay,...o.toolCallDisplay}),o.reasoningDisplay&&(a.reasoningDisplay={...e.reasoningDisplay,...o.reasoningDisplay}),o.artifacts){let r=e.artifacts??{},n={...r};if(o.artifacts.display!==void 0){let s=no(r.display,o.artifacts.display);s!==void 0&&(n.display=s)}o.artifacts.filePreview&&(n.filePreview={...r.filePreview,enabled:o.artifacts.filePreview.enabled}),o.artifacts.layout&&(n.layout={...r.layout,...o.artifacts.layout}),a.artifacts=n}return a}function V(e){return{content:[{type:"text",text:JSON.stringify(e)}],structuredContent:e}}var Re={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",lime:"#00ff00",blue:"#0000ff",yellow:"#ffff00",cyan:"#00ffff",aqua:"#00ffff",magenta:"#ff00ff",fuchsia:"#ff00ff",silver:"#c0c0c0",gray:"#808080",grey:"#808080",maroon:"#800000",olive:"#808000",purple:"#800080",teal:"#008080",navy:"#000080",orange:"#ffa500",pink:"#ffc0cb",hotpink:"#ff69b4",gold:"#ffd700",indigo:"#4b0082",violet:"#ee82ee",brown:"#a52a2a",beige:"#f5f5dc",ivory:"#fffff0",khaki:"#f0e68c",coral:"#ff7f50",salmon:"#fa8072",tomato:"#ff6347",crimson:"#dc143c",turquoise:"#40e0d0",lavender:"#e6e6fa",plum:"#dda0dd",orchid:"#da70d6",tan:"#d2b48c",chocolate:"#d2691e",sienna:"#a0522d",slategray:"#708090",slategrey:"#708090",steelblue:"#4682b4",royalblue:"#4169e1",dodgerblue:"#1e90ff",skyblue:"#87ceeb",lightblue:"#add8e6",midnightblue:"#191970",forestgreen:"#228b22",seagreen:"#2e8b57",limegreen:"#32cd32",olivedrab:"#6b8e23",darkgreen:"#006400",emerald:"#50c878",mint:"#3eb489",goldenrod:"#daa520",firebrick:"#b22222",darkred:"#8b0000",indianred:"#cd5c5c",deeppink:"#ff1493",mediumpurple:"#9370db",rebeccapurple:"#663399",darkviolet:"#9400d3",slateblue:"#6a5acd",cornflowerblue:"#6495ed",teal2:"#008080",charcoal:"#36454f",graphite:"#3b3b3b",transparent:"transparent"},Vr=/^rgba?\(\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*(,\s*(0|1|0?\.\d+|\d{1,3}%)\s*)?\)$/;function Ir(e){return Vr.test(e)}function q(e){if(typeof e!="string"||e.trim()==="")throw new Error('Color must be a non-empty string (e.g. "#2563eb" or "blue").');let t=e.trim().toLowerCase(),o=Re[t];if(o)return o;let a=Q(t);if(Ke(a)||a==="transparent"||Ir(a))return a;throw new Error(`"${e}" is not a recognized color. Pass a hex value like "#ef4444" or a CSS color name (e.g. ${Object.keys(Re).slice(0,6).join(", ")}).`)}var Ee=de.map(e=>e==="gray"?"neutral":e),_r={...Object.fromEntries(Ee.map(e=>[e,e])),gray:"neutral",grey:"neutral"};function Pe(e,t=!0){let o=String(e??"").trim().toLowerCase(),a=_r[o];if(!a||!t&&a==="neutral"){let r=t?"primary, secondary, accent, neutral":"primary, secondary, accent";throw new Error(`Unknown color family "${e}". Valid families: ${r}.`)}return a}function De(e){let t=String(e??"solid").trim().toLowerCase();if(t==="solid"||t==="soft")return t;throw new Error(`Unknown intensity "${e}". Valid intensities: solid, soft.`)}function Ve(e){let t=String(e??"").trim().toLowerCase();if(t==="light"||t==="dark"||t==="auto")return t;if(t==="system")return"auto";throw new Error(`Unknown color scheme "${e}". Valid: light, dark, auto.`)}var Br={sharp:"sharp",square:"sharp",none:"sharp",default:"default",normal:"default",rounded:"rounded",round:"rounded",soft:"rounded",pill:"pill",circle:"pill",full:"pill"};function Ie(e){let t=String(e??"").trim().toLowerCase(),o=Br[t];if(!o)throw new Error(`Unknown roundness "${e}". Valid: sharp, default, rounded, pill.`);return o}function _e(e){if(typeof e=="number"&&Number.isFinite(e))return`${e}px`;if(typeof e=="string"&&e.trim()!==""){let t=e.trim();if(t==="9999px"||/^(100%|9999px)$/.test(t))return"9999px";let o=Ge(t);return qe(o.value,o.unit)}throw new Error('Radius must be a number (px) or a CSS length string like "0.5rem".')}function Be(e){for(let t of z){let o=t.fields.find(a=>a.id===e);if(o?.options){let a={};for(let r of o.options){let n=r.value.split(".").pop();n&&(a[n]=r.value)}return a}}return{}}var io=Be("typo-font-family"),oe=Be("typo-font-size"),ae=Be("typo-font-weight"),Ae=Be("typo-line-height"),lo={...io,monospace:io.mono},co={...oe,small:oe.sm,md:oe.base,medium:oe.base,large:oe.lg},po={...ae,400:ae.normal,500:ae.medium,600:ae.semibold,700:ae.bold},uo={...Ae,"1.25":Ae.tight,"1.5":Ae.normal,"1.625":Ae.relaxed};function go(e,t,o){let a=String(e??"").trim().toLowerCase(),r=t[a];if(!r){let n=[...new Set(Object.values(t).map(s=>s.split(".").pop()))].join(", ");throw new Error(`Unknown ${o} "${e}". Valid: ${n}.`)}return r}var mo="theme.palette.radius.";function Lr(){let e={pill:{sm:"9999px",md:"9999px",lg:"9999px",xl:"9999px",full:"9999px"}};for(let t of z)for(let o of t.presets??[]){let a=o.id.match(/^radius-(\w+)$/);if(!a)continue;let r={};for(let[n,s]of Object.entries(o.values))n.startsWith(mo)&&typeof s=="string"&&(r[n.slice(mo.length)]=s);e[a[1]]=r}return e}var ne=Lr(),fo=["sm","md","lg","xl","full"];function Oe(e,t,o="theme",a=0){if(a>6)return null;let r=e.get(`${o}.${t}`);return typeof r!="string"||r===""?o==="darkTheme"?Oe(e,t,"theme",a):null:r.startsWith("#")||r.startsWith("rgb")||r==="transparent"?r:r.startsWith("palette.")||r.startsWith("semantic.")||r.startsWith("components.")?Oe(e,r,o,a+1):null}function Le(e,t){let o=e.get(t);if(typeof o!="string")return"unknown";let a=o.split(".");return a[a.length-1]||String(o)}function K(e){return e.replace(/^role-/,"")}function Or(e){for(let[t,o]of Object.entries(ne))if(fo.every(a=>e[a]===o[a]))return t;return"custom"}function M(e){let t={};for(let a of fo)t[a]=String(e.get(`theme.palette.radius.${a}`)??"");let o={};for(let a of L)o[K(a.roleId)]=Je(r=>e.get(`theme.${r}`),a);return{brand:{primary:ct(e.get("theme.palette.colors.primary.500")),secondary:ct(e.get("theme.palette.colors.secondary.500")),accent:ct(e.get("theme.palette.colors.accent.500"))},roles:o,typography:{fontFamily:Le(e,"theme.semantic.typography.fontFamily"),fontSize:Le(e,"theme.semantic.typography.fontSize"),fontWeight:Le(e,"theme.semantic.typography.fontWeight"),lineHeight:Le(e,"theme.semantic.typography.lineHeight")},roundness:{style:Or(t),radius:t},colorScheme:String(e.get("colorScheme")??"light"),history:{index:e.getHistoryIndex(),canUndo:e.canUndo(),canRedo:e.canRedo()}}}function ct(e){return typeof e=="string"&&e!==""?e:null}var re=[{key:"user-message",label:"User message text",fg:"components.message.user.text",bg:"components.message.user.background"},{key:"assistant-message",label:"Assistant message text",fg:"components.message.assistant.text",bg:"components.message.assistant.background"},{key:"header",label:"Header title",fg:"components.header.titleForeground",fgFallbacks:["components.header.foreground"],bg:"components.header.background"},{key:"primary-button",label:"Primary button label",fg:"components.button.primary.foreground",bg:"components.button.primary.background"},{key:"input",label:"Input placeholder",fg:"components.input.placeholder",bg:"components.input.background"},{key:"link",label:"Link text",fg:"components.markdown.link.foreground",bg:"semantic.colors.background"},{key:"scroll",label:"Scroll-to-bottom icon",fg:"components.scrollToBottom.foreground",bg:"components.scrollToBottom.background"},{key:"body",label:"Body text on background",fg:"semantic.colors.text",bg:"semantic.colors.background"},{key:"surface",label:"Body text on surface",fg:"semantic.colors.text",bg:"semantic.colors.surface"}];function Mr(e,t,o){for(let a of[t.fg,...t.fgFallbacks??[]]){let r=Oe(e,a,o);if(r)return r}return null}function ho(e){let t=new Set(e.targets.map(o=>o.path));return re.filter(o=>t.has(o.fg)||t.has(o.bg)).map(o=>o.key)}var Wr={AA:4.5,AAA:7};function Fr(e){return Math.round(e*100)/100}function Nr(e,t,o,a,r){let n=e.get(`${r}.${t}`);if(typeof n!="string")return null;let s=n.match(/^palette\.colors\.(\w+)\.(\d+)$/);if(!s)return null;let i=s[1],l=H.indexOf(s[2]),g=null,f=1/0;return H.forEach((x,C)=>{let I=e.get(`${r}.palette.colors.${i}.${x}`);if(!(typeof I!="string"||!(I.startsWith("#")||I.startsWith("rgb")))&&ce(I,o)>=a){let W=l>=0?Math.abs(C-l):C;W<f&&(f=W,g=`palette.colors.${i}.${x}`)}}),g}function se(e,t="AA",o="both",a){let r=Wr[t],n=o==="both"?["light","dark"]:[o],s=a?re.filter(l=>a.includes(l.key)):re,i=[];for(let l of n){let g=l==="light"?"theme":"darkTheme";for(let f of s){let x=Mr(e,f,g),C=Oe(e,f.bg,g);if(!x||!C)continue;let I=Fr(ce(x,C)),W=I>=r,Me={pair:f.key,label:f.label,variant:l,fg:x,bg:C,ratio:I,threshold:r,passes:W};if(!W){let We=Nr(e,f.fg,C,r,g);We&&(Me.suggestion=We)}i.push(Me)}}return{level:t,checks:i,failures:i.filter(l=>!l.passes)}}function Y(e,t,o="light",a="AA"){return t.length===0?[]:se(e,a,o,t).failures.map(n=>({code:"contrast",pair:n.pair,variant:n.variant,ratio:n.ratio,threshold:n.threshold,message:`${n.label} (${n.variant}) has a contrast ratio of ${n.ratio}:1, below the ${a} threshold of ${n.threshold}:1${n.suggestion?`. Try ${n.suggestion} for the foreground.`:"."}`}))}var v={};for(let e of L){let t=K(e.roleId);v[t]=e,v[e.roleId]=e}Object.assign(v,{surface:v.surfaces,background:v.surfaces,backgrounds:v.surfaces,user:v["user-messages"],"user-message":v["user-messages"],assistant:v["assistant-messages"],"assistant-message":v["assistant-messages"],actions:v["primary-actions"],buttons:v["primary-actions"],composer:v.input,links:v["links-focus"],focus:v["links-focus"],border:v.borders,dividers:v.borders,scroll:v["scroll-to-bottom"]});function Hr(e){let t=String(e??"").trim().toLowerCase(),o=v[t];if(!o){let a=L.map(r=>K(r.roleId)).join(", ");throw new Error(`Unknown role "${e}". Valid roles: ${a}.`)}return o}function bo(){let e=new Map,t=o=>{for(let a of o)for(let r of a.fields)e.has(r.id)||e.set(r.id,r)};for(let o of tt)t(o.sections);for(let o of xe)t(o.sections);return e}var $r={voice:"voiceRecognition.enabled",artifacts:"features.artifacts.enabled",attachments:"attachments.enabled",toolCalls:"features.showToolCalls",reasoning:"features.showReasoning",feedback:"messageActions.enabled"},zr={avatars:"layout.messages.avatar.show",timestamps:"layout.messages.timestamp.show",showHeader:"layout.showHeader",messageStyle:"layout.messages.layout"},dt=["bottom-right","bottom-left","top-right","top-left"],pt=["bubble","flat","minimal"],Ur={title:"copy.welcomeTitle",subtitle:"copy.welcomeSubtitle",placeholder:"copy.inputPlaceholder",sendLabel:"copy.sendButtonLabel"};function yo(e,t){let o=t?.editTarget??"both",a=null,r=h=>h&&typeof h=="object"?h:{},n=(h,p,d=o)=>{let c={};return(d==="light"||d==="both")&&(c[`theme.${h}`]=p),(d==="dark"||d==="both")&&(c[`darkTheme.${h}`]=p),c},s=h=>{if(o==="both")return h;let p={};for(let[d,c]of Object.entries(h))(o==="light"&&d.startsWith("theme.")||o==="dark"&&d.startsWith("darkTheme."))&&(p[d]=c);return p},i=()=>o==="dark"?"dark":"light",l=(h,p=[])=>V({ok:!0,summary:M(e),warnings:p,applied:h});return[{name:"get_theme_overview",title:"Get current theme & what is editable",description:"Read theme summary, presets, and editable levers. Call before editing.",annotations:{readOnlyHint:!0},inputSchema:{type:"object",properties:{verbosity:{type:"string",enum:["summary","full"],description:"'full' includes the field-id index."}},additionalProperties:!1},execute(h){let{verbosity:p}=r(h),d={summary:M(e),availableRoles:L.map(c=>({role:K(c.roleId),helper:c.helper})),availableFamilies:Ee,presets:te.map(c=>({id:c.id,name:c.name,description:c.description,tags:c.tags??[]})),tools:[{tool:"set_brand_colors",hint:"Recolor primary/secondary/accent and generate shade scales."},{tool:"assign_color_role",hint:"Recolor a widget region with family + intensity."},{tool:"set_typography",hint:"Set font family, size, weight, line height."},{tool:"set_roundness",hint:"Set corner roundness or granular radii."},{tool:"set_color_scheme",hint:"Set light/dark/auto and edit target."},{tool:"apply_preset",hint:"Apply a built-in preset."},{tool:"configure_widget",hint:"Toggle launcher position, features, and layout."},{tool:"set_copy_and_suggestions",hint:"Set welcome copy, placeholder, and suggestion chips."},{tool:"set_theme_fields",hint:"Set any field by id or dot-path."},{tool:"check_contrast",hint:"Audit WCAG contrast."},{tool:"manage_session",hint:"Undo, redo, reset, or export the theme."}]};return p==="full"&&(a??(a=bo()),d.fieldIndex=Array.from(a.values()).map(c=>({id:c.id,path:c.path,type:c.type,label:c.label,options:c.options?.map(u=>u.value)}))),V(d)}},{name:"set_brand_colors",title:"Set brand colors",description:"Set primary, secondary, and/or accent colors. Generates shade scales and accepts hex, rgb/rgba, or CSS names.",inputSchema:{type:"object",properties:{primary:{type:"string",description:"Hex, rgb/rgba, or CSS name."},secondary:{type:"string",description:"Hex, rgb/rgba, or CSS name."},accent:{type:"string",description:"Hex, rgb/rgba, or CSS name."}},additionalProperties:!1},execute(h){let p=r(h),d=["primary","secondary","accent"],c={},u={};for(let m of d){if(p[m]===void 0)continue;let y=q(p[m]);u[m]=y;let S=Ze(y);for(let _ of H){let Z=S[_];Z!==void 0&&Object.assign(c,n(`palette.colors.${m}.${_}`,Z))}}if(Object.keys(u).length===0)throw new Error("Provide at least one of: primary, secondary, accent.");e.setBatch(c);let b=Y(e,["primary-button","user-message"],i());return l(u,b)}},{name:"assign_color_role",title:"Assign a color family to an interface role",description:"Recolor a widget region by role, palette family, and intensity.",inputSchema:{type:"object",properties:{role:{type:"string",description:"Role, e.g. header or user-messages."},family:{type:"string",enum:Ee},intensity:{type:"string",enum:["solid","soft"],description:"Default: solid."}},required:["role","family"],additionalProperties:!1},execute(h){let p=r(h),d=Hr(p.role),c=Pe(p.family,!0),u=De(p.intensity),b=s(ve(c,u,d)),m=Object.keys(b).length;e.setBatch(b);let y=Y(e,ho(d),i());return l({role:K(d.roleId),family:c,intensity:u,tokensWritten:m},y)}},{name:"set_typography",title:"Set typography",description:"Set font family, size, weight, and line height.",inputSchema:{type:"object",properties:{fontFamily:{type:"string"},fontSize:{type:"string"},fontWeight:{type:["string","number"]},lineHeight:{type:["string","number"]}},additionalProperties:!1},execute(h){let p=r(h),d={},c={},u=(b,m)=>{if(p[b]===void 0)return;let y=go(p[b],m,b);c[b]=y.split(".").pop()??y,Object.assign(d,n(`semantic.typography.${b}`,y))};if(u("fontFamily",lo),u("fontSize",co),u("fontWeight",po),u("lineHeight",uo),Object.keys(c).length===0)throw new Error("Provide at least one of: fontFamily, fontSize, fontWeight, lineHeight.");return e.setBatch(d),l(c)}},{name:"set_roundness",title:"Set corner roundness",description:"Set roundness by style or granular radius values.",inputSchema:{type:"object",properties:{style:{type:"string",enum:["sharp","default","rounded","pill"]},radius:{type:"object",description:"Granular px or CSS length overrides.",properties:{sm:{type:["string","number"]},md:{type:["string","number"]},lg:{type:["string","number"]},xl:{type:["string","number"]},full:{type:["string","number"]}},additionalProperties:!1}},additionalProperties:!1},execute(h){let p=r(h),d={},c={};if(p.style!==void 0){let u=Ie(p.style);c.style=u;for(let[b,m]of Object.entries(ne[u]))Object.assign(d,n(`palette.radius.${b}`,m))}if(p.radius!==void 0){let u=r(p.radius),b={};for(let m of["sm","md","lg","xl","full"]){if(u[m]===void 0)continue;let y=_e(u[m]);b[m]=y,Object.assign(d,n(`palette.radius.${m}`,y))}c.radius=b}if(Object.keys(d).length===0)throw new Error("Provide `style` (sharp|default|rounded|pill) or a `radius` object.");return e.setBatch(d),l(c)}},{name:"set_color_scheme",title:"Set color scheme",description:"Set light/dark/auto color scheme and optional edit target.",inputSchema:{type:"object",properties:{scheme:{type:"string",enum:["light","dark","auto"]},editTarget:{type:"string",enum:["light","dark","both"]}},additionalProperties:!1},execute(h){let p=r(h),d={};if(p.scheme!==void 0){let c=Ve(p.scheme);e.set("colorScheme",c),d.scheme=c}if(p.editTarget!==void 0){let c=String(p.editTarget).trim().toLowerCase();if(c!=="light"&&c!=="dark"&&c!=="both")throw new Error(`Unknown editTarget "${p.editTarget}". Valid: light, dark, both.`);o=c,d.editTarget=c}if(Object.keys(d).length===0)throw new Error("Provide `scheme` and/or `editTarget`.");return V({ok:!0,summary:M(e),warnings:[],applied:d,editTarget:o})}},{name:"apply_preset",title:"Apply a built-in theme preset",description:"Apply a complete built-in preset, replacing theme tokens. Call get_theme_overview to list preset ids.",inputSchema:{type:"object",properties:{presetId:{type:"string"}},required:["presetId"],additionalProperties:!1},execute(h){let{presetId:p}=r(h),d=rt(String(p??""));if(!d){let m=te.map(y=>y.id).join(", ");throw new Error(`Unknown preset "${p}". Valid presets: ${m}.`)}let c=w(d.theme,{validate:!1}),u={...e.getConfig()};d.darkTheme&&(u.darkTheme=w(d.darkTheme,{validate:!1}),u.colorScheme="auto"),d.toolCall&&(u.toolCall=d.toolCall),d.behavior&&(u.features=so(u.features,[d.behavior])),e.setFullConfig(u,c);let b=Y(e,["body","assistant-message"],"light");return l({appliedPreset:{id:d.id,name:d.name}},b)}},{name:"configure_widget",title:"Configure launcher, features, and layout",description:"Toggle launcher position, feature flags, and message layout.",inputSchema:{type:"object",properties:{launcherPosition:{type:"string",enum:dt},features:{type:"object",properties:{voice:{type:"boolean"},artifacts:{type:"boolean"},attachments:{type:"boolean"},toolCalls:{type:"boolean"},reasoning:{type:"boolean"},feedback:{type:"boolean"}},additionalProperties:!1},layout:{type:"object",properties:{avatars:{type:"boolean"},timestamps:{type:"boolean"},showHeader:{type:"boolean"},messageStyle:{type:"string",enum:pt}},additionalProperties:!1}},additionalProperties:!1},execute(h){let p=r(h),d={},c={};if(p.launcherPosition!==void 0){let m=String(p.launcherPosition);if(!dt.includes(m))throw new Error(`Unknown launcherPosition "${m}". Valid: ${dt.join(", ")}.`);d["launcher.position"]=m,c.launcherPosition=m}let u=r(p.features);for(let[m,y]of Object.entries($r))u[m]!==void 0&&(d[y]=!!u[m],c.features??(c.features={}),c.features[m]=!!u[m]);let b=r(p.layout);for(let[m,y]of Object.entries(zr))if(b[m]!==void 0)if(m==="messageStyle"){let S=String(b[m]);if(!pt.includes(S))throw new Error(`Unknown messageStyle "${S}". Valid: ${pt.join(", ")}.`);d[y]=S,c.layout??(c.layout={}),c.layout[m]=S}else d[y]=!!b[m],c.layout??(c.layout={}),c.layout[m]=!!b[m];if(Object.keys(d).length===0)throw new Error("Provide launcherPosition, features, and/or layout.");return e.setBatch(d),l(c)}},{name:"set_copy_and_suggestions",title:"Set welcome copy and suggestion chips",description:"Set welcome copy, input placeholder, send label, and suggestion chips.",inputSchema:{type:"object",properties:{title:{type:"string"},subtitle:{type:"string"},placeholder:{type:"string"},sendLabel:{type:"string"},suggestions:{type:"array",items:{type:"string"}}},additionalProperties:!1},execute(h){let p=r(h),d={},c={};for(let[u,b]of Object.entries(Ur))p[u]!==void 0&&(d[b]=String(p[u]),c[u]=String(p[u]));if(p.suggestions!==void 0){if(!Array.isArray(p.suggestions))throw new Error("`suggestions` must be an array of strings.");let u=p.suggestions.filter(b=>typeof b=="string");d.suggestionChips=u,c.suggestions=u}if(Object.keys(d).length===0)throw new Error("Provide at least one of: title, subtitle, placeholder, sendLabel, suggestions.");return e.setBatch(d),l(c)}},{name:"set_theme_fields",title:"Set theme fields by id or path (advanced)",description:"Advanced escape hatch: set fields by id or raw dot-path. Values are validated when metadata exists.",inputSchema:{type:"object",properties:{updates:{type:"array",items:{type:"object",properties:{field:{type:"string",description:"Field id or path."},value:{type:["string","number","boolean"]}},required:["field","value"],additionalProperties:!1}}},required:["updates"],additionalProperties:!1},execute(h){let{updates:p}=r(h);if(!Array.isArray(p)||p.length===0)throw new Error("`updates` must be a non-empty array of { field, value }.");a??(a=bo());let d={},c=[];for(let b of p){let m=r(b),y=String(m.field??"");try{let S=a.get(y),_=S?S.path:y;if(!S&&!/^(theme|darkTheme)\.|\./.test(_))throw new Error(`Unknown field "${y}". Pass a known field id or a dot-path (e.g. theme.palette.radius.md).`);let Z=jr(S,m.value);if(S&&_.startsWith("theme.")){let ut=n(_.slice(6),Z);Object.assign(d,ut),c.push({field:y,resolvedPath:Object.keys(ut),ok:!0})}else d[_]=Z,c.push({field:y,resolvedPath:_,ok:!0})}catch(S){c.push({field:y,ok:!1,error:S.message})}}let u=c.filter(b=>b.ok);return Object.keys(d).length>0&&e.setBatch(d),V({ok:u.length>0,summary:M(e),warnings:[],applied:{updates:c}})}},{name:"check_contrast",title:"Check accessibility contrast",description:"Run WCAG checks over key text/background pairs.",annotations:{readOnlyHint:!0},inputSchema:{type:"object",properties:{level:{type:"string",enum:["AA","AAA"],description:"Default: AA."},variant:{type:"string",enum:["light","dark","both"],description:"Default: both."}},additionalProperties:!1},execute(h){let p=r(h),d=p.level==="AAA"?"AAA":"AA",c=p.variant==="light"||p.variant==="dark"?p.variant:"both",u=se(e,d,c);return V({level:u.level,passing:u.checks.length-u.failures.length,total:u.checks.length,checks:u.checks,failures:u.failures})}},{name:"manage_session",title:"Undo, redo, reset, or export the theme",description:"Undo, redo, reset defaults, or export the theme snapshot.",inputSchema:{type:"object",properties:{action:{type:"string",enum:["undo","redo","reset","export"]}},required:["action"],additionalProperties:!1},execute(h){let{action:p}=r(h);switch(p){case"undo":return e.undo(),l({action:"undo"});case"redo":return e.redo(),l({action:"redo"});case"reset":return e.resetToDefaults(),l({action:"reset"});case"export":return V({ok:!0,snapshot:e.exportSnapshot()});default:throw new Error(`Unknown action "${p}". Valid: undo, redo, reset, export.`)}}}]}function jr(e,t){if(!e)return t;switch(e.type){case"color":return e.parseValue?e.parseValue(q(t)):q(t);case"toggle":return typeof t=="boolean"?t:t==="true"||t===1;case"slider":{let o=Number(t);if(!Number.isFinite(o))throw new Error(`"${e.id}" expects a number.`);if(e.slider){let{min:a,max:r}=e.slider;if(o<a||o>r)throw new Error(`"${e.id}" must be between ${a} and ${r}.`)}return e.parseValue?e.parseValue(o):o}case"select":{let o=String(t);if(e.options&&!e.options.some(a=>a.value===o))throw new Error(`"${e.id}" must be one of: ${e.options.map(a=>a.value).join(", ")}.`);return e.parseValue?e.parseValue(o):o}default:return e.parseValue?e.parseValue(t):t}}export{Nt as ADVANCED_TOKENS_SECTION,L as ALL_ROLES,tt as ALL_TABS,It as ARTIFACT_DISPLAY_PREFERENCE_SECTION,Ot as BRAND_PALETTE_SECTION,Ut as BUILT_IN_PRESETS,sa as COLORS_SECTIONS,Xe as COLOR_FAMILIES,Vt as COMPONENTS_SECTIONS,Dt as COMPONENT_COLOR_SECTIONS,Pt as COMPONENT_SHAPE_SECTIONS,Bt as CONFIGURE_SECTIONS,xe as CONFIGURE_SUB_GROUPS,re as CONTRAST_PAIRS,Re as CSS_NAMED_COLORS,ir as DEVICE_DIMENSIONS,Gt as HOME_SUGGESTION_CHIPS,Wt as INTERFACE_ROLES_SECTION,Yt as MOCK_BROWSER_CONTENT,Zt as MOCK_WORKSPACE_CONTENT,ra as PALETTE_SECTION,jt as PREVIEW_STORAGE_ADAPTER,ne as RADIUS_PRESETS,me as ROLE_ASSISTANT_MESSAGES,ke as ROLE_BORDERS,de as ROLE_FAMILIES,jo as ROLE_FAMILY_LABELS,ue as ROLE_HEADER,be as ROLE_INPUT,A as ROLE_INTENSITIES,ye as ROLE_LINKS_FOCUS,fe as ROLE_PRIMARY_ACTIONS,he as ROLE_SCROLL_TO_BOTTOM,pe as ROLE_SURFACES,ge as ROLE_USER_MESSAGES,na as SEMANTIC_COLORS_SECTION,H as SHADE_KEYS,we as SHELL_STYLE_ID,Ft as STATUS_COLORS_SECTION,Mt as STATUS_PALETTE_SECTION,_t as STREAM_AND_ARTIFACTS_SUB_GROUP,z as STYLE_SECTIONS,or as STYLE_SECTIONS_V2,te as THEME_EDITOR_PRESETS,Lt as THEME_SECTION,je as ThemeEditorState,cr as ZOOM_MAX,lr as ZOOM_MIN,mr as appendPreviewTranscriptEntry,it as applySceneConfig,dr as applyShellTheme,yr as buildPreviewConfig,kr as buildPreviewConfigWithMessages,nt as buildShellCss,pr as buildSrcdoc,M as buildSummary,fr as buildTranscriptStreamFrames,q as coerceColor,Pe as coerceFamily,De as coerceIntensity,_e as coerceRadius,Ie as coerceRoundnessStyle,Ve as coerceScheme,$o as convertFromPx,Ho as convertToPx,Jt as createPreviewMessages,st as createPreviewTranscriptEntry,yo as createThemeEditorTools,Je as detectRoleAssignment,qt as escapeHtml,nr as findSection,qe as formatCssValue,Ze as generateColorScale,gr as getPreviewTranscriptPresetLabel,Kt as getShellPalette,rt as getThemeEditorPreset,$t as getThemeEditorTabs,yt as hexToHsl,kt as hslToHex,Ke as isValidHex,Q as normalizeColorValue,zo as paletteColorPath,Ge as parseCssValue,Xt as presetStreamsText,Y as quickContrastWarnings,Ht as resolveEditorFieldDefault,ve as resolveRoleAssignment,vt as resolveThemeColorPath,Ye as rgbToHex,se as runContrastChecks,sr as scopeSection,Uo as tokenRefDisplayName,V as toolResult,ce as wcagContrastRatio};