@helpai/elements 0.44.3 → 0.46.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.
package/web-component.mjs CHANGED
@@ -87,6 +87,9 @@ var STRINGS_EN = {
87
87
  thinking: "Thinking\u2026",
88
88
  thoughts: "Thoughts",
89
89
  usedTool: "Used tool",
90
+ toolDetails: "Details",
91
+ toolResult: "Result",
92
+ sources: "Sources",
90
93
  // ── Messenger modules ──────────────────────────────────────────
91
94
  tabHome: "Home",
92
95
  tabConversations: "Conversations",
@@ -200,6 +203,9 @@ var STRINGS_FR = {
200
203
  thinking: "R\xE9flexion\u2026",
201
204
  thoughts: "R\xE9flexions",
202
205
  usedTool: "Outil utilis\xE9",
206
+ toolDetails: "D\xE9tails",
207
+ toolResult: "R\xE9sultat",
208
+ sources: "Sources",
203
209
  // ── Messenger modules ──────────────────────────────────────────
204
210
  tabHome: "Accueil",
205
211
  tabConversations: "Conversations",
@@ -596,6 +602,7 @@ function resolveOptions(rawOpts) {
596
602
  responseMode: behavior.responseMode ?? "streaming",
597
603
  showReasoning: behavior.showReasoning ?? false,
598
604
  showToolCalls: behavior.showToolCalls ?? false,
605
+ showSources: behavior.showSources ?? false,
599
606
  features: {
600
607
  files: opts.features?.files ?? DEFAULT_FEATURES.files,
601
608
  voice: opts.features?.voice ?? DEFAULT_FEATURES.voice,
@@ -922,7 +929,8 @@ var BEHAVIOR_ATTRS = [
922
929
  ["response-mode", "responseMode", (v) => v],
923
930
  ["start-minimized", "startMinimized", boolAttr],
924
931
  ["show-reasoning", "showReasoning", boolAttr],
925
- ["show-tool-calls", "showToolCalls", boolAttr]
932
+ ["show-tool-calls", "showToolCalls", boolAttr],
933
+ ["show-sources", "showSources", boolAttr]
926
934
  ];
927
935
  var I18N_ATTRS = [["locale", "locale"]];
928
936
  var ACTION_NAMES = new Set(ACTION_NAME_LITERALS);
@@ -1230,7 +1238,7 @@ var tokens_default = ':host{--__P__-accent-user: __BRAND_ACCENT__;--__P__-accent
1230
1238
  var reset_default = '*,*:before,*:after{box-sizing:border-box;margin:0;padding:0;border:0}button{font:inherit;color:inherit;background:none;cursor:pointer;-webkit-appearance:none;appearance:none;line-height:1}button:focus-visible,[tabindex]:focus-visible,textarea:focus-visible,input:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}textarea,input{font:inherit;color:inherit;background:none;border:0;outline:0;resize:none}a{color:var(--__P__-accent);text-decoration:underline;text-underline-offset:2px}img,svg{display:block;max-width:100%}ul,ol{list-style:none}.__P__-app{display:block;width:100%;height:100%;font-family:var(--__P__-font);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-feature-settings:"cv11","ss01","ss03"}.__P__-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}\n';
1231
1239
 
1232
1240
  // src/styles/panel.css
1233
- var panel_default = '.__P__-anchor{color-scheme:var(--__P__-color-scheme, light);right:16px;bottom:16px}.__P__-surface{display:contents}.__P__-surface[hidden]{display:none}:host([data-position="bottom-left"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{right:auto;left:16px}:host([data-position="top-right"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{bottom:auto;top:16px}.__P__-anchor{position:fixed;display:flex;flex-direction:column;align-items:flex-end;gap:var(--__P__-space-3);pointer-events:none}.__P__-anchor{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=sm]{--__P__-fab-size: 44px}.__P__-anchor[data-launcher-size=md]{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=lg]{--__P__-fab-size: 68px}.__P__-anchor>*{pointer-events:auto}.__P__-fab[data-size=sm]{--__P__-fab-size: 44px;font-size:var(--__P__-text-sm)}.__P__-fab[data-size=md]{--__P__-fab-size: 56px;font-size:calc(14px * var(--__P__-text-scale))}.__P__-fab[data-size=lg]{--__P__-fab-size: 68px;font-size:var(--__P__-text-base)}.__P__-fab{display:inline-flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);color:var(--__P__-accent-text);background:var(--__P__-accent);box-shadow:var(--__P__-shadow-fab);font-weight:600;line-height:1;transform-origin:bottom right;animation:__P__-fab-in var(--__P__-dur-base) var(--__P__-ease) both;transition:transform var(--__P__-dur-base) var(--__P__-ease),opacity var(--__P__-dur-base) var(--__P__-ease),box-shadow var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab:hover{transform:translateY(-2px)}.__P__-fab:active{transform:translateY(0)}.__P__-fab:focus-visible{outline:2px solid var(--__P__-on-accent);outline-offset:3px}.__P__-fab svg{width:24px;height:24px;flex-shrink:0}@keyframes __P__-fab-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:none}}.__P__-fab[data-leaving]{position:absolute;right:0;bottom:0;animation:__P__-fab-out var(--__P__-dur-quick) var(--__P__-ease) forwards;pointer-events:none}:host([data-position^="top-"]) .__P__-fab[data-leaving]{bottom:auto;top:0}:host([data-position$="-left"]) .__P__-fab[data-leaving]{right:auto;left:0}@keyframes __P__-fab-out{0%{opacity:1;transform:none}to{opacity:0;transform:scale(.85)}}.__P__-fab[data-variant=circle]{width:var(--__P__-fab-size);height:var(--__P__-fab-size);border-radius:999px}.__P__-fab[data-variant=circle] .__P__-fab-label{display:none}.__P__-fab[data-variant=pill]{height:var(--__P__-fab-size);padding:0 18px 0 16px;border-radius:999px}.__P__-fab[data-variant=bar]{height:var(--__P__-fab-size);padding:0 22px;border-radius:var(--__P__-radius)}.__P__-fab[data-variant=minimal]{height:var(--__P__-fab-size);padding:0 var(--__P__-space-4);border-radius:999px;background:transparent;color:var(--__P__-accent);box-shadow:none;border:1px solid currentColor}.__P__-fab[data-variant=minimal]:hover{background:color-mix(in srgb,var(--__P__-accent) 12%,transparent)}.__P__-callout{--__P__-callout-fab-h: var(--__P__-fab-size, 56px);--__P__-callout-gap: clamp(12px, calc(var(--__P__-callout-fab-h) * .25), 22px);--__P__-callout-nudge-direction: -1;position:absolute;display:inline-flex;align-items:center;gap:var(--__P__-space-2);padding:10px 14px;background:var(--__P__-fg);color:var(--__P__-bg);border-radius:999px;font-size:var(--__P__-text-sm);font-weight:600;line-height:1.2;box-shadow:0 10px 30px -8px #00000059;pointer-events:auto;animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease);z-index:1;max-width:240px;white-space:nowrap}.__P__-callout[data-position=left]{right:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%)}.__P__-callout[data-position=right]{left:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%);--__P__-callout-nudge-direction: 1}.__P__-callout[data-position=top]{bottom:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-position=bottom]{top:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}:host([data-position$="-left"]) .__P__-callout[data-position=top],:host([data-position$="-left"]) .__P__-callout[data-position=bottom]{right:auto;left:0}.__P__-callout[data-shape=bubble]{border-radius:var(--__P__-radius-md);white-space:normal;width:max-content;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-shape=callout]{padding:12px 18px;font-size:calc(14px * var(--__P__-text-scale));background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-callout:after{content:"";position:absolute;width:12px;height:12px;background:inherit;border-radius:2px;transform:rotate(45deg)}.__P__-callout[data-position=left]:after{right:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=right]:after{left:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=top]:after{bottom:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-position=bottom]:after{top:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}:host([data-position$="-left"]) .__P__-callout[data-position=top]:after,:host([data-position$="-left"]) .__P__-callout[data-position=bottom]:after{right:auto;left:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-animated]{animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease),__P__-callout-nudge 1.6s var(--__P__-ease-in-out) var(--__P__-dur-slow) infinite}@keyframes __P__-callout-in{0%{opacity:0}to{opacity:1}}@keyframes __P__-callout-nudge{0%,to{margin-left:0;margin-right:0}50%{margin-left:calc(6px * var(--__P__-callout-nudge-direction));margin-right:calc(-6px * var(--__P__-callout-nudge-direction))}}@media(prefers-reduced-motion:reduce){.__P__-callout[data-animated]{animation:__P__-callout-in 1ms var(--__P__-ease)}.__P__-icon-btn[data-recording=true],.__P__-typing span{animation:none}}.__P__-callout-close{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:999px;color:inherit;opacity:.7;cursor:pointer}.__P__-callout-close:hover{opacity:1;background:color-mix(in srgb,currentColor 15%,transparent)}.__P__-callout-close:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-callout-close svg{width:12px;height:12px}.__P__-panel{width:var(--__P__-panel-w);height:var(--__P__-panel-h);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);background:var(--__P__-bg);color:var(--__P__-fg);border-radius:var(--__P__-radius-lg);box-shadow:var(--__P__-shadow-panel);display:flex;flex-direction:column;overflow:hidden;transform-origin:bottom right;animation:__P__-panel-in var(--__P__-dur-slow) var(--__P__-ease);border:1px solid var(--__P__-border)}@media(prefers-reduced-motion:no-preference){.__P__-panel{transition:width var(--__P__-dur-base) var(--__P__-ease),height var(--__P__-dur-base) var(--__P__-ease),max-width var(--__P__-dur-base) var(--__P__-ease),max-height var(--__P__-dur-base) var(--__P__-ease)}.__P__-panel[data-resizing]{transition:none}}:host([data-mode="open"]) .__P__-panel{width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));min-width:var(--__P__-resize-min-w, auto);min-height:var(--__P__-resize-min-h, auto);max-width:var(--__P__-resize-max-w, calc(100vw - 32px) );max-height:var(--__P__-resize-max-h, calc(100dvh - 32px) )}@keyframes __P__-panel-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}:host([data-mode="expanded"]) .__P__-panel{width:var(--__P__-expanded-w, 640px);height:var(--__P__-expanded-h, 820px);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px)}:host([data-mode="fullscreen"]){z-index:var(--__P__-z-panel)!important}:host([data-mode="fullscreen"]) .__P__-anchor{inset:0;padding:0;justify-content:flex-end;align-items:flex-end}:host([data-mode="fullscreen"][data-position*="top"]) .__P__-anchor{justify-content:flex-start}:host([data-mode="fullscreen"][data-position*="left"]) .__P__-anchor{align-items:flex-start}:host([data-mode="fullscreen"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}:host([data-mode="fullscreen"]) .__P__-fab{display:none}@media(max-width:640px){:host([data-mode="open"]) .__P__-anchor,:host([data-mode="expanded"]) .__P__-anchor{inset:0;align-items:stretch;padding:0}:host([data-mode="open"]) .__P__-panel,:host([data-mode="expanded"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}}:host([data-mode="inline"]) .__P__-anchor,:host([data-mode="standalone"]) .__P__-anchor{position:static;inset:auto;padding:0;align-items:stretch;width:100%;height:100%;min-height:0}:host([data-mode="inline"]) .__P__-panel,:host([data-mode="standalone"]) .__P__-panel{width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;animation:none}:host([data-mode="inline"]) .__P__-fab,:host([data-mode="standalone"]) .__P__-fab{display:none}:host([data-mode="inline"]){min-height:320px}:host([data-mode="inline"]) .__P__-panel{border-radius:var(--__P__-radius)}:host([data-mode="standalone"]) .__P__-panel{border-radius:0;border:0;box-shadow:none}:host([data-mode="modal"]){position:fixed!important;inset:0!important;z-index:var(--__P__-z-panel)!important;display:block!important;width:100vw;height:100dvh;background:var(--__P__-modal-backdrop, var(--__P__-backdrop));animation:__P__-backdrop-in var(--__P__-dur-base) var(--__P__-ease) both;--__P__-panel-w: min(960px, 92vw);--__P__-panel-h: min(720px, 88dvh)}:host([data-mode="modal"]) .__P__-anchor{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:var(--__P__-space-6);pointer-events:none}:host([data-mode="modal"]) .__P__-panel{pointer-events:auto;width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));max-width:calc(100vw - 48px);max-height:calc(100dvh - 48px);min-width:0;min-height:0;border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-panel);animation:__P__-modal-in var(--__P__-dur-base) var(--__P__-ease);translate:var(--__P__-modal-dx, 0px) var(--__P__-modal-dy, 0px)}:host([data-mode="modal"]) .__P__-header,:host([data-mode="modal"]) .__P__-back-header,:host([data-mode="modal"]) .__P__-home-hero{cursor:grab;touch-action:none}:host([data-mode="modal"]) .__P__-panel[data-dragging]{cursor:grabbing;user-select:none}:host([data-mode="modal"]) .__P__-panel[data-dragging] *{cursor:grabbing}:host([data-mode="modal"]) .__P__-fab{display:none}@keyframes __P__-backdrop-in{0%{background:#0000}to{background:var(--__P__-modal-backdrop, var(--__P__-backdrop))}}@keyframes __P__-modal-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}:host([data-mode="drawer"]){--__P__-panel-w: min(440px, calc(100vw - 32px) );--__P__-panel-h: 100dvh}:host([data-mode="drawer"]) .__P__-anchor{position:fixed;--__P__-inset-x: var(--__P__-panel-inset, 12px);--__P__-inset-y: var(--__P__-panel-inset, 3dvh);top:var(--__P__-inset-y);bottom:auto;right:var(--__P__-inset-x);left:auto;width:min(var(--__P__-widget-w, var(--__P__-panel-w)),calc(100vw - var(--__P__-inset-x) * 2));height:min(var(--__P__-widget-h, var(--__P__-panel-h)),calc(100dvh - var(--__P__-inset-y) * 2));padding:0;display:block;pointer-events:auto}:host([data-mode="drawer"][data-position$="-left"]) .__P__-anchor{right:auto;left:var(--__P__-inset-x)}:host([data-mode="drawer"][data-position^="bottom-"]) .__P__-anchor{top:auto;bottom:var(--__P__-inset-y)}:host([data-mode="drawer"]) .__P__-panel{width:100%;height:100%;max-width:none;max-height:none;min-width:0;min-height:0;border-radius:var(--__P__-radius, 12px);border:1px solid var(--__P__-border);box-shadow:-8px 16px 32px -12px #00000038;animation:__P__-drawer-in var(--__P__-dur-base) var(--__P__-ease)}:host([data-mode="drawer"][data-position$="-left"]) .__P__-panel{box-shadow:8px 16px 32px -12px #00000038;animation:__P__-drawer-in-left var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab[data-edge-tab]{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-2);position:fixed;top:50%;height:140px;width:auto;min-width:0;padding:10px 8px;writing-mode:vertical-rl;text-orientation:mixed;transform:translateY(-50%);transform-origin:center;animation:__P__-edge-tab-in var(--__P__-dur-base) var(--__P__-ease) both}.__P__-fab[data-edge-tab] svg{writing-mode:horizontal-tb}.__P__-fab[data-edge-tab]:hover{transform:translateY(-50%) scale(1.03)}.__P__-fab[data-edge-tab]:active{transform:translateY(-50%) scale(.97)}:host([data-position$="-right"]) .__P__-fab[data-edge-tab]{right:0;left:auto;border-radius:12px 0 0 12px;box-shadow:-6px 0 18px -8px #0000004d}:host([data-position$="-left"]) .__P__-fab[data-edge-tab]{left:0;right:auto;border-radius:0 12px 12px 0;box-shadow:6px 0 18px -8px #0000004d}.__P__-fab[data-edge-tab][data-leaving]{position:fixed;top:50%;bottom:auto;animation:__P__-edge-tab-out var(--__P__-dur-quick) var(--__P__-ease) forwards}@keyframes __P__-edge-tab-in{0%{opacity:0;transform:translateY(-50%) scale(.9)}to{opacity:1;transform:translateY(-50%) scale(1)}}@keyframes __P__-edge-tab-out{0%{opacity:1;transform:translateY(-50%) scale(1)}to{opacity:0;transform:translateY(-50%) scale(.85)}}@keyframes __P__-drawer-in{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes __P__-drawer-in-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@media(prefers-reduced-motion:reduce){:host([data-mode="drawer"]) .__P__-panel,.__P__-fab[data-edge-tab]{animation:none}}.__P__-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);background:var(--__P__-bg)}.__P__-header h1{font-size:calc(14px * var(--__P__-text-scale));font-weight:600;flex:1;letter-spacing:-.01em}.__P__-header-actions{margin-inline-start:auto;display:flex;align-items:center;gap:var(--__P__-space-1);flex-shrink:0}.__P__-agent{flex:1;display:inline-flex;align-items:center;gap:10px;min-width:0}.__P__-agent-avatar{position:relative;width:32px;height:32px;border-radius:999px;background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:var(--__P__-text-xs);overflow:hidden;flex-shrink:0}.__P__-agent-avatar img{width:100%;height:100%;object-fit:cover}.__P__-agent-avatar:after{content:"";position:absolute;right:-1px;bottom:-1px;width:10px;height:10px;border-radius:999px;border:2px solid var(--__P__-bg);background:var(--__P__-neutral)}.__P__-agent-avatar[data-status=online]:after{background:var(--__P__-success)}.__P__-agent-avatar[data-status=away]:after{background:var(--__P__-warning)}.__P__-agent-avatar[data-status=offline]:after{background:var(--__P__-neutral)}.__P__-agent-meta{display:flex;flex-direction:column;line-height:1.15;min-width:0}.__P__-agent-meta strong{font-size:calc(14px * var(--__P__-text-scale));font-weight:600;letter-spacing:-.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-agent-meta span{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-suggestions{display:flex;flex-wrap:nowrap;gap:var(--__P__-space-2);padding:6px 14px 10px;overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;scroll-snap-type:x proximity;scrollbar-width:none;-ms-overflow-style:none;min-width:0}.__P__-suggestions::-webkit-scrollbar{display:none}.__P__-suggestions:before,.__P__-suggestions:after{content:"";flex:1 1 0;min-width:0}.__P__-suggestion{flex:0 0 auto;scroll-snap-align:center;padding:7px 14px;border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg);font-size:var(--__P__-text-sm);font-weight:500;white-space:nowrap;transition:background var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-suggestion:hover{border-color:var(--__P__-accent);color:var(--__P__-accent);transform:translateY(-1px)}.__P__-suggestion:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px;border-color:var(--__P__-accent)}.__P__-suggestion:active{transform:translateY(0)}.__P__-icon-btn{width:32px;height:32px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);transition:background var(--__P__-dur-quick) var(--__P__-ease),color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-icon-btn:hover{background:var(--__P__-bg-elevated);color:var(--__P__-fg)}.__P__-icon-btn:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-icon-btn:active{background:var(--__P__-border)}.__P__-icon-btn:disabled{opacity:.45;cursor:not-allowed}.__P__-icon-btn:before{content:"";position:absolute;inset:-6px}.__P__-icon-btn{position:relative}.__P__-icon-btn svg{width:18px;height:18px}.__P__-icon-btn[data-recording=true]{color:var(--__P__-accent);background:color-mix(in srgb,var(--__P__-accent) 12%,transparent);animation:__P__-pulse 1.2s var(--__P__-ease) infinite}@keyframes __P__-pulse{0%,to{box-shadow:0 0 color-mix(in srgb,var(--__P__-accent) 40%,transparent)}50%{box-shadow:0 0 0 6px color-mix(in srgb,var(--__P__-accent) 0%,transparent)}}.__P__-list,.__P__-history,.__P__-module-scroll,.__P__-home-scroll,.__P__-help-list,.__P__-tool-args,.__P__-sidebar-conversations{scrollbar-width:thin;scrollbar-color:var(--__P__-border-strong) transparent;overscroll-behavior:contain;scrollbar-gutter:stable}.__P__-list::-webkit-scrollbar,.__P__-history::-webkit-scrollbar,.__P__-module-scroll::-webkit-scrollbar,.__P__-home-scroll::-webkit-scrollbar,.__P__-help-list::-webkit-scrollbar,.__P__-tool-args::-webkit-scrollbar,.__P__-sidebar-conversations::-webkit-scrollbar{width:8px}.__P__-list::-webkit-scrollbar-thumb,.__P__-history::-webkit-scrollbar-thumb,.__P__-module-scroll::-webkit-scrollbar-thumb,.__P__-home-scroll::-webkit-scrollbar-thumb,.__P__-help-list::-webkit-scrollbar-thumb,.__P__-tool-args::-webkit-scrollbar-thumb,.__P__-sidebar-conversations::-webkit-scrollbar-thumb{background:var(--__P__-border-strong);border-radius:8px}.__P__-list-wrap{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}.__P__-jump{position:absolute;inset-inline-end:14px;bottom:14px;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:999px;border:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);color:var(--__P__-fg);box-shadow:var(--__P__-shadow-panel);cursor:pointer;opacity:.85;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease);animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-jump:hover{opacity:1}.__P__-jump:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;opacity:1}.__P__-jump:active{transform:translateY(1px)}.__P__-jump svg{width:18px;height:18px}.__P__-list{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-4);padding-bottom:var(--__P__-space-8);display:flex;flex-direction:column;gap:14px}.__P__-date-divider{position:sticky;top:var(--__P__-space-2);z-index:2;display:flex;justify-content:center;align-items:flex-start;height:0;margin:0;pointer-events:none}.__P__-date-pill{padding:3px 10px;border-radius:999px;font-size:calc(11px * var(--__P__-text-scale));font-weight:600;color:var(--__P__-fg-muted);background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);box-shadow:var(--__P__-shadow-card);opacity:0;pointer-events:none;transition:opacity var(--__P__-dur-base) var(--__P__-ease)}.__P__-list[data-scrolling=true] .__P__-date-pill{opacity:1;pointer-events:auto}@media(prefers-reduced-motion:reduce){.__P__-date-pill{transition:none}}.__P__-bubble-row{display:flex}.__P__-bubble-row[data-role=user]{justify-content:flex-end}.__P__-bubble-row[data-role=assistant]{justify-content:flex-start}.__P__-bubble{max-width:100%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);line-height:1.6;font-size:calc(14px * var(--__P__-text-scale));word-wrap:break-word;overflow-wrap:anywhere;box-shadow:0 1px 2px #0000000a,0 1px 8px -4px #0000000f;animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-bubble ::selection{background:color-mix(in srgb,var(--__P__-accent) 30%,transparent)}.__P__-bubble-row[data-role=user] .__P__-bubble ::selection{background:#fff6;color:var(--__P__-bubble-user-text)}@keyframes __P__-bubble-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-bubble-row[data-role=user] .__P__-bubble{background:var(--__P__-bubble-user);color:var(--__P__-bubble-user-text);border-end-end-radius:5px}.__P__-bubble-row[data-role=assistant] .__P__-bubble{background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border-end-start-radius:5px}.__P__-bubble-col{display:flex;flex-direction:column;max-width:85%;min-width:0}.__P__-bubble-row[data-role=user] .__P__-bubble-col{align-items:flex-end}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col{align-items:flex-start}.__P__-bubble-time{margin-top:3px;padding:0 4px;font-size:calc(11px * var(--__P__-text-scale));line-height:1;color:var(--__P__-fg-muted);user-select:none}.__P__-md>*:first-child{margin-top:0}.__P__-md>*:last-child{margin-bottom:0}.__P__-md p{margin:10px 0}.__P__-md h1,.__P__-md h2,.__P__-md h3,.__P__-md h4,.__P__-md h5,.__P__-md h6{margin:18px 0 8px;line-height:1.3;letter-spacing:-.01em;font-weight:700}.__P__-md h1{font-size:1.4em}.__P__-md h2{font-size:1.22em}.__P__-md h3{font-size:1.08em}.__P__-md h4,.__P__-md h5,.__P__-md h6{font-size:1em}.__P__-md>h1:first-child,.__P__-md>h2:first-child,.__P__-md>h3:first-child,.__P__-md>h4:first-child,.__P__-md>h5:first-child,.__P__-md>h6:first-child{margin-top:0}.__P__-md ul,.__P__-md ol{padding-inline-start:1.5em;margin:10px 0}.__P__-md ul{list-style:disc}.__P__-md ol{list-style:decimal}.__P__-md li{margin:6px 0;padding-inline-start:2px}.__P__-md li::marker{color:var(--__P__-fg-muted)}.__P__-md li>p{margin:6px 0}.__P__-md li>ul,.__P__-md li>ol{margin:6px 0}.__P__-md strong,.__P__-md b{font-weight:650;letter-spacing:-.005em}.__P__-md em,.__P__-md i{font-style:italic}.__P__-md code{font-family:var(--__P__-font-mono);font-size:.86em;padding:1px 6px;border-radius:5px;background:color-mix(in srgb,var(--__P__-accent) 10%,transparent);color:var(--__P__-fg);border:1px solid color-mix(in srgb,var(--__P__-accent) 16%,transparent)}.__P__-md pre{font-family:var(--__P__-font-mono);font-size:calc(12.5px * var(--__P__-text-scale));padding:12px 14px;border-radius:var(--__P__-radius-sm);background:#7f7f7f1f;overflow-x:auto;margin:var(--__P__-space-3) 0;line-height:1.5}.__P__-md pre code{padding:0;background:none}.__P__-md a{color:inherit;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}.__P__-md a:hover{text-decoration-thickness:2px}.__P__-md blockquote{margin:14px 0;padding:6px 14px;border-inline-start:3px solid color-mix(in srgb,var(--__P__-accent) 50%,transparent);background:color-mix(in srgb,var(--__P__-accent) 5%,transparent);border-start-end-radius:var(--__P__-radius-sm);border-end-end-radius:var(--__P__-radius-sm);color:var(--__P__-fg-muted)}.__P__-md blockquote>:first-child{margin-top:0}.__P__-md blockquote>:last-child{margin-bottom:0}.__P__-md hr{border:0;height:1px;background:color-mix(in srgb,currentColor 18%,transparent);margin:var(--__P__-space-4) 0}.__P__-md table{border-collapse:collapse;margin:var(--__P__-space-3) 0;font-size:.95em;display:block;overflow-x:auto;max-width:100%;font-variant-numeric:tabular-nums}.__P__-md th,.__P__-md td{padding:6px 10px;border-bottom:1px solid color-mix(in srgb,currentColor 12%,transparent);text-align:start}.__P__-md th{font-weight:700;background:color-mix(in srgb,currentColor 6%,transparent)}.__P__-md h1+ul,.__P__-md h1+ol,.__P__-md h2+ul,.__P__-md h2+ol,.__P__-md h3+ul,.__P__-md h3+ol,.__P__-md h4+ul,.__P__-md h4+ol{margin-top:var(--__P__-space-1)}.__P__-loading{display:inline-flex;align-items:center;gap:var(--__P__-space-2);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-loading-spinner{width:14px;height:14px;border-radius:999px;border:2px solid currentColor;border-top-color:transparent;animation:__P__-spin .8s linear infinite}@keyframes __P__-spin{to{transform:rotate(1turn)}}.__P__-typing{display:inline-flex;gap:var(--__P__-space-1);padding:var(--__P__-space-1) 0}.__P__-typing span{width:5px;height:5px;border-radius:999px;background:currentColor;opacity:.4;animation:__P__-blink 1.2s var(--__P__-ease) infinite}.__P__-typing span:nth-child(2){animation-delay:.2s}.__P__-typing span:nth-child(3){animation-delay:.4s}@keyframes __P__-blink{0%,80%,to{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-2px)}}.__P__-reasoning{margin:var(--__P__-space-1) 0 var(--__P__-space-2);padding-inline-start:var(--__P__-space-3);border-inline-start:2px solid var(--__P__-border-strong)}.__P__-reasoning-summary{display:inline-flex;align-items:center;gap:var(--__P__-space-1);cursor:pointer;list-style:none;user-select:none;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-reasoning-summary:hover{color:var(--__P__-fg)}.__P__-reasoning-summary:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__P__-reasoning-summary::-webkit-details-marker{display:none}.__P__-reasoning-summary:before{content:"";width:5px;height:5px;border-inline-end:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg);opacity:.7;transition:transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-reasoning[open] .__P__-reasoning-summary:before{transform:rotate(45deg)}.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:__P__-reasoning-pulse 1.4s var(--__P__-ease) infinite}@keyframes __P__-reasoning-pulse{0%,to{opacity:.5}50%{opacity:1}}@media(prefers-reduced-motion:reduce){.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:none}}.__P__-reasoning-body{margin-top:var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-reasoning-body>:first-child{margin-top:0}.__P__-reasoning-body>:last-child{margin-bottom:0}.__P__-tool-chip{display:inline-flex;align-items:center;gap:6px;padding:var(--__P__-space-1) var(--__P__-space-2);margin-top:6px;border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs)}.__P__-composer{border-top:1px solid var(--__P__-border);padding:10px 12px;background:var(--__P__-bg);display:flex;flex-direction:column;gap:var(--__P__-space-2)}.__P__-composer-row{display:flex;align-items:flex-end;gap:6px}.__P__-textarea{flex:1;height:40px;max-height:160px;padding:10px 12px;border-radius:var(--__P__-radius);background:var(--__P__-bg-elevated);border:1px solid transparent;font-size:calc(14px * var(--__P__-text-scale));line-height:1.4;transition:height var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),box-shadow var(--__P__-dur-quick) var(--__P__-ease)}.__P__-textarea:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:1px;border-color:var(--__P__-focus)}@media(pointer:coarse){.__P__-textarea,.__P__-home-search-input{font-size:max(16px,calc(16px * var(--__P__-text-scale)))}.__P__-textarea{height:44px}}.__P__-send{width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease),background var(--__P__-dur-quick) var(--__P__-ease)}.__P__-send[data-shape=circle]{border-radius:999px}.__P__-send[data-shape=square]{border-radius:var(--__P__-radius-sm)}.__P__-send[data-shape=pill]{width:auto;padding:0 18px;border-radius:999px}.__P__-send[data-variant=filled]{background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-send[data-variant=outline]{background:transparent;color:var(--__P__-accent);border-color:var(--__P__-accent)}.__P__-send[data-variant=outline]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 10%,transparent)}.__P__-send[data-variant=ghost]{background:transparent;color:var(--__P__-accent)}.__P__-send[data-variant=ghost]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 8%,transparent)}.__P__-send:disabled{opacity:.4;cursor:not-allowed}.__P__-send:not(:disabled):hover{transform:translateY(-1px)}.__P__-send:not(:disabled):active{transform:translateY(0)}.__P__-send:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-send svg{width:18px;height:18px}.__P__-composer-actions{display:flex;gap:var(--__P__-space-1);flex-wrap:wrap}.__P__-attachments{display:flex;flex-wrap:wrap;gap:6px}.__P__-attachment-chip{display:inline-flex;align-items:center;gap:6px;padding:var(--__P__-space-1) var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-1);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);font-size:var(--__P__-text-xs);max-width:200px}.__P__-attachment-thumb{width:24px;height:24px;border-radius:999px;object-fit:cover;background:var(--__P__-border)}.__P__-attachment-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-attachment-remove{width:18px;height:18px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted)}.__P__-attachment-remove:hover{background:var(--__P__-border);color:var(--__P__-fg)}.__P__-dropzone{position:absolute;inset:8px;border:2px dashed var(--__P__-accent);border-radius:var(--__P__-radius);background:color-mix(in srgb,var(--__P__-accent) 8%,transparent);display:flex;align-items:center;justify-content:center;font-weight:600;color:var(--__P__-accent);pointer-events:none;z-index:10;animation:__P__-fade-in var(--__P__-dur-quick) var(--__P__-ease)}@keyframes __P__-fade-in{0%{opacity:0}to{opacity:1}}.__P__-error{margin-top:var(--__P__-space-1);padding:8px 10px;border-radius:var(--__P__-radius-sm);background:var(--__P__-danger-bg);color:var(--__P__-danger-text);font-size:var(--__P__-text-sm);display:flex;align-items:center;gap:var(--__P__-space-2)}.__P__-error button{color:inherit;text-decoration:underline;font-size:var(--__P__-text-sm)}.__P__-history{flex:1;overflow-y:auto;padding:var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-3)}.__P__-history-footer{flex:none;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);border-top:1px solid var(--__P__-border);background:var(--__P__-surface)}.__P__-history-new{width:100%;display:flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);padding:var(--__P__-space-2) var(--__P__-space-3);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-on-accent);cursor:pointer;font-size:var(--__P__-text-sm);font-weight:600;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-history-new svg{width:16px;height:16px}.__P__-history-new:hover{filter:brightness(1.08)}.__P__-history-new:active{transform:translateY(1px)}.__P__-history-new:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-history-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:40px 16px;color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale));text-align:center}.__P__-history-group{display:flex;flex-direction:column;padding:0 var(--__P__-space-3)}.__P__-history-heading{font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);padding:14px 4px 8px;text-transform:uppercase;letter-spacing:.04em}.__P__-history-card{display:flex;flex-direction:column;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-lg, 14px);overflow:hidden}.__P__-history-item{all:unset;display:flex;align-items:center;gap:var(--__P__-space-3);padding:12px var(--__P__-space-3);cursor:pointer;transition:background var(--__P__-dur-base) var(--__P__-ease)}.__P__-history-item+.__P__-history-item{border-top:1px solid var(--__P__-border)}.__P__-history-item:hover{background:var(--__P__-bg-elevated)}.__P__-history-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-history-avatar{flex:none;display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:color-mix(in oklab,var(--__P__-accent) 12%,transparent);color:var(--__P__-accent)}.__P__-history-avatar svg{width:18px;height:18px}.__P__-history-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.__P__-history-row{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-2)}.__P__-history-title{flex:1;min-width:0;font-size:calc(14px * var(--__P__-text-scale));font-weight:500;color:var(--__P__-fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-time{flex:none;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-history-preview{flex:1;min-width:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-dot{flex:none;width:8px;height:8px;border-radius:50%;background:var(--__P__-accent)}.__P__-history-item[data-unread=true] .__P__-history-title{font-weight:600}.__P__-history-item[data-closed=true] .__P__-history-title{color:var(--__P__-fg-muted)}.__P__-history-item-skeleton{cursor:default;pointer-events:none}.__P__-skeleton{display:block;border-radius:4px;background:linear-gradient(90deg,color-mix(in oklab,var(--__P__-fg) 9%,transparent) 30%,color-mix(in oklab,var(--__P__-fg) 17%,transparent),color-mix(in oklab,var(--__P__-fg) 9%,transparent) 70%);background-size:200% 100%;animation:__P__-skeleton-shimmer 1.8s ease-in-out infinite}.__P__-history-avatar.__P__-skeleton{border-radius:50%}.__P__-skeleton-heading{width:52px;height:8px}.__P__-skeleton-title{width:55%;height:12px}.__P__-skeleton-time{width:34px;height:10px}.__P__-skeleton-preview{width:80%;height:10px}@keyframes __P__-skeleton-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.__P__-skeleton{animation:none}}.__P__-list-loading{margin:auto;padding:var(--__P__-space-6) var(--__P__-space-4);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);text-align:center}.__P__-readonly-banner{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px 12px;margin:0 var(--__P__-space-3) var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);text-align:center;font-size:var(--__P__-text-sm)}.__P__-readonly-label{line-height:1.4}.__P__-readonly-cta{appearance:none;border:0;cursor:pointer;padding:var(--__P__-space-2) var(--__P__-space-4);border-radius:999px;background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-readonly-cta:hover,.__P__-readonly-cta:focus-visible{filter:brightness(1.1)}.__P__-readonly-cta:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}.__P__-composer-footer{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:10px 16px;margin:0 var(--__P__-space-3);border-top:1px solid var(--__P__-border);text-align:center;font-size:calc(11px * var(--__P__-text-scale));line-height:1.4;color:var(--__P__-fg-muted)}.__P__-disclaimer{max-width:320px;margin:0 auto;opacity:.9;letter-spacing:.01em}.__P__-poweredby{display:inline-flex;align-items:center;justify-content:center;gap:6px;color:inherit;text-decoration:none;opacity:.7;transition:opacity var(--__P__-dur-base) var(--__P__-ease);font-size:calc(11px * var(--__P__-text-scale));letter-spacing:.02em}.__P__-poweredby:hover{opacity:1}.__P__-poweredby-logo{height:12px;width:auto;display:inline-block;vertical-align:middle}.__P__-poweredby-bar{flex:none;display:flex;align-items:center;justify-content:center;padding:6px 16px;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated)}.__P__-menu-wrap{position:relative;display:inline-flex}.__P__-menu{position:absolute;top:100%;inset-inline-end:0;margin-top:6px;min-width:200px;padding:6px;background:var(--__P__-bg);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);box-shadow:var(--__P__-shadow-panel);z-index:10;display:flex;flex-direction:column;gap:2px;animation:__P__-menu-in var(--__P__-dur-base) var(--__P__-ease)}@media(prefers-reduced-motion:reduce){.__P__-menu{animation:none}}@keyframes __P__-menu-in{0%{opacity:0;transform:translateY(-4px) scale(.98);transform-origin:top right}to{opacity:1;transform:none}}.__P__-menu-item{all:unset;display:flex;align-items:center;gap:10px;padding:8px 10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);border-radius:var(--__P__-radius-sm);cursor:pointer;user-select:none}.__P__-menu-item:hover{background:var(--__P__-bg-elevated)}.__P__-menu-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-menu-item[disabled]{opacity:.45;cursor:not-allowed}.__P__-menu-icon{display:inline-flex;width:16px;height:16px;color:var(--__P__-fg-muted)}.__P__-menu-icon svg{width:16px;height:16px}.__P__-menu-label{flex:1}.__P__-menu-check{display:inline-flex;color:var(--__P__-accent)}.__P__-menu-check svg{width:14px;height:14px}.__P__-menu-item-segmented{cursor:default}.__P__-menu-item-segmented:hover{background:transparent}.__P__-segmented{display:inline-flex;gap:2px;padding:2px;background:var(--__P__-bg-elevated);border-radius:var(--__P__-radius-sm)}.__P__-segment{all:unset;min-width:26px;padding:3px 8px;font-size:var(--__P__-text-xs);font-weight:600;letter-spacing:.02em;text-align:center;color:var(--__P__-fg-muted);border-radius:calc(var(--__P__-radius-sm) - 2px);cursor:pointer;transition:color .12s ease,background .12s ease}.__P__-segment:hover{color:var(--__P__-fg)}.__P__-segment[data-on=true]{background:var(--__P__-bg);color:var(--__P__-accent);box-shadow:var(--__P__-shadow-card)}.__P__-segment:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-resize-grip{position:absolute;width:18px;height:18px;display:flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);opacity:.45;transition:opacity var(--__P__-dur-base) var(--__P__-ease);z-index:2;touch-action:none;user-select:none}.__P__-resize-grip:hover,.__P__-resize-grip:focus-visible{opacity:1}.__P__-resize-grip svg{width:10px;height:10px}.__P__-resize-grip--bottom-left{bottom:2px;left:2px;cursor:nesw-resize;transform:scaleX(-1)}.__P__-resize-grip--bottom-right{bottom:2px;right:2px;cursor:nwse-resize}.__P__-resize-grip--top-left{top:2px;left:2px;cursor:nwse-resize;transform:rotate(180deg)}.__P__-resize-grip--top-right{top:2px;right:2px;cursor:nesw-resize;transform:scaleY(-1)}:host(:not([data-mode="open"])) .__P__-resize-grip{display:none}.__P__-messenger{display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-body,.__P__-messenger-pane{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-pane[hidden]{display:none}@keyframes __P__-view-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-module{display:flex;flex-direction:column;height:100%;min-height:0}@media(prefers-reduced-motion:no-preference){.__P__-module,.__P__-history{animation:__P__-view-in .18s var(--__P__-ease-out)}}.__P__-module-scroll{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-3);display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-home{container-type:inline-size;background:radial-gradient(125% 65% at 88% 0%,color-mix(in srgb,#fff 16%,transparent),transparent 55%),linear-gradient(180deg,var(--__P__-accent) 0%,var(--__P__-accent) 22%,color-mix(in srgb,var(--__P__-accent) 28%,var(--__P__-surface)) 44%,var(--__P__-surface) 70%);border-radius:var(--__P__-radius-lg) var(--__P__-radius-lg) 0 0}.__P__-home-scroll{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;background:transparent}.__P__-home-cards{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:4px 14px 16px}.__P__-module-pad{padding:var(--__P__-space-3) var(--__P__-space-3) 0}.__P__-module-empty{display:flex;flex-direction:column;align-items:center;gap:var(--__P__-space-3);padding:var(--__P__-space-8) var(--__P__-space-4);text-align:center;color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-module-retry{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border-strong);border-radius:var(--__P__-radius-sm);color:var(--__P__-fg);font-weight:600;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-module-retry:hover{background:var(--__P__-hover);border-color:var(--__P__-accent)}.__P__-module-retry:active{background:var(--__P__-border)}.__P__-module-retry:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-help-list{flex:1;min-height:0;overflow-y:auto;padding-bottom:var(--__P__-space-3)}.__P__-help-group{display:flex;flex-direction:column}.__P__-help-section-title{position:sticky;top:0;z-index:1;margin:0;padding:var(--__P__-space-3) var(--__P__-space-5) var(--__P__-space-2);font-size:var(--__P__-text-xs);font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--__P__-fg-muted);background:var(--__P__-bg)}.__P__-help-card{margin:0 var(--__P__-space-3) var(--__P__-space-3);background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden}.__P__-help-card .__P__-list-row{border-bottom:0;border-radius:0}.__P__-help-card .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-module-cta{padding:var(--__P__-space-3);border-top:1px solid var(--__P__-border)}.__P__-tabbar{display:flex;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);flex-shrink:0}.__P__-tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-1);min-height:48px;padding:var(--__P__-space-2) var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600;transition:color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-tab:hover{color:var(--__P__-fg)}.__P__-tab[aria-selected=true]{color:var(--__P__-accent)}.__P__-tab:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-tab:active{background:var(--__P__-hover)}.__P__-tab-icon{position:relative;display:inline-flex}.__P__-tab-icon svg{width:22px;height:22px}.__P__-tab-badge{position:absolute;top:-4px;left:calc(50% + 6px);min-width:16px;height:16px;padding:0 4px;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:var(--__P__-accent);color:var(--__P__-on-accent);font-size:calc(10px * var(--__P__-text-scale));font-weight:600;line-height:1}.__P__-home-hero{flex-shrink:0;padding:var(--__P__-space-5) var(--__P__-space-5) var(--__P__-space-3);color:var(--__P__-on-accent);--__P__-focus: var(--__P__-on-accent)}.__P__-home-hero-top{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);min-height:32px}.__P__-home-brand{font-size:clamp(calc(12px * var(--__P__-text-scale)),calc(3.2cqi * var(--__P__-text-scale)),calc(14px * var(--__P__-text-scale)));font-weight:600;letter-spacing:.01em;color:color-mix(in srgb,#fff 82%,transparent);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.__P__-home-brand-spacer{flex:1}.__P__-home-hero-actions{display:flex;align-items:center;gap:var(--__P__-space-2);flex-shrink:0}.__P__-home-hero-actions .__P__-icon-btn{color:#fff}.__P__-home-hero-actions .__P__-icon-btn:hover{background:color-mix(in srgb,#fff 18%,transparent);color:#fff}.__P__-home-hero-actions .__P__-icon-btn:active{background:color-mix(in srgb,#fff 26%,transparent)}.__P__-home-greeting{margin:28px 0 0;font-family:var(--__P__-font-display);font-size:clamp(calc(19px * var(--__P__-text-scale)),calc(5.5cqi * var(--__P__-text-scale)),var(--__P__-text-2xl));font-weight:800;line-height:1.18;letter-spacing:-.01em;overflow-wrap:anywhere}.__P__-home-lead{margin:10px 0 0;font-family:var(--__P__-font-display);font-size:clamp(calc(15px * var(--__P__-text-scale)),calc(4.2cqi * var(--__P__-text-scale)),var(--__P__-text-xl));font-weight:600;line-height:1.25;letter-spacing:-.005em;color:color-mix(in srgb,var(--__P__-on-accent) 78%,transparent);overflow-wrap:anywhere}.__P__-home-avatars{display:flex}.__P__-home-avatar{width:30px;height:30px;border-radius:999px;overflow:hidden;margin-inline-start:-10px;border:2px solid color-mix(in srgb,#fff 92%,transparent);box-shadow:0 1px 3px #0000002e;background:var(--__P__-surface);display:inline-flex;align-items:center;justify-content:center;font-size:var(--__P__-text-xs);font-weight:700;color:var(--__P__-fg)}.__P__-home-avatar:first-child{margin-inline-start:0}.__P__-home-avatar img{width:100%;height:100%;object-fit:cover}.__P__-home-content{background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-card);overflow:hidden}.__P__-home-content-title{padding:var(--__P__-space-4) var(--__P__-space-4) var(--__P__-space-3);font-size:var(--__P__-text-sm);font-weight:700}.__P__-home-content-list{display:flex;flex-direction:column;padding:0 var(--__P__-space-2) var(--__P__-space-2)}.__P__-home-content-list .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-home-card{display:block;width:100%;text-align:start;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);padding:var(--__P__-space-4);box-shadow:var(--__P__-shadow-card)}.__P__-home-card[data-interactive=true]{cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-home-card[data-interactive=true]:hover{background:var(--__P__-bg-elevated)}.__P__-home-card[data-interactive=true]:active{transform:translateY(1px)}.__P__-home-card[data-interactive=true]:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-recent-row{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-recent-avatar{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;flex-shrink:0;border-radius:999px;background:color-mix(in oklch,var(--__P__-accent) 14%,transparent);color:var(--__P__-accent)}.__P__-home-recent-avatar svg{width:20px;height:20px}.__P__-home-recent-body{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}.__P__-home-recent-title{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-recent-preview{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-home-recent-at{color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);flex-shrink:0}.__P__-home-recent-dot{width:8px;height:8px;border-radius:999px;background:var(--__P__-accent);flex-shrink:0}.__P__-home-recent-row[data-unread=true] .__P__-home-recent-title{font-weight:700}.__P__-home-status{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-status-icon svg{width:22px;height:22px;color:var(--__P__-success)}.__P__-home-status[data-level=degraded] .__P__-home-status-icon svg{color:var(--__P__-warning)}.__P__-home-status[data-level=down] .__P__-home-status-icon svg{color:var(--__P__-danger)}.__P__-home-status-text{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-search{display:flex;align-items:center;gap:var(--__P__-space-2);width:100%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);border:1px solid var(--__P__-border);background:var(--__P__-surface);text-align:start}.__P__-home-search[data-input=true]{background:var(--__P__-bg-elevated)}.__P__-home-search:hover{border-color:var(--__P__-border-strong)}.__P__-home-search:focus-visible,.__P__-home-search:focus-within{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-search-text{flex:1;color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-search-input{flex:1;border:0;background:transparent;font-size:calc(14px * var(--__P__-text-scale));color:var(--__P__-fg);outline:none}.__P__-home-search-icon svg{width:18px;height:18px;color:var(--__P__-accent)}.__P__-list-row{display:flex;align-items:center;gap:var(--__P__-space-3);width:100%;min-height:44px;text-align:start;padding:var(--__P__-space-3) var(--__P__-space-2);border-radius:var(--__P__-radius-sm)}.__P__-list-row:hover{background:var(--__P__-hover)}.__P__-list-row:active{background:var(--__P__-border)}.__P__-list-row:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-list-row-body{display:flex;flex-direction:column;min-width:0;flex:1}.__P__-list-row-title{font-weight:600;font-size:var(--__P__-text-md);line-height:1.35}.__P__-list-row-sub{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);margin-top:var(--__P__-space-1);line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-list-row-chevron svg{width:18px;height:18px;color:var(--__P__-accent);flex-shrink:0}.__P__-back-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);flex-shrink:0}.__P__-back-title{flex:1;text-align:center;font-size:var(--__P__-text-md);font-weight:700;margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-back-spacer{width:32px;height:1px}.__P__-content{display:flex;flex-direction:column;gap:14px;width:100%;max-width:68ch;margin:0 auto}.__P__-content-hero{width:100%;border-radius:var(--__P__-radius)}.__P__-content-subtitle{color:var(--__P__-fg-muted);margin:0}.__P__-content-frame{flex:1;min-height:0;width:100%;border:0;background:#fff}.__P__-news-list{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-news-card{display:block;width:100%;text-align:start;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden;background:var(--__P__-surface)}.__P__-news-card{transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-news-card:hover{background:var(--__P__-bg-elevated)}.__P__-news-card:active{transform:translateY(1px)}.__P__-news-card:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-news-hero{width:100%;display:block}.__P__-news-body{display:flex;flex-direction:column;gap:6px;padding:14px 16px}.__P__-news-title{font-weight:700;font-size:var(--__P__-text-md)}.__P__-news-summary{color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale));display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-modules-empty{display:flex;align-items:center;justify-content:center;position:relative}.__P__-modules-empty-close{position:absolute;top:12px;inset-inline-end:12px}.__P__-modules-empty-text{color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-form{display:flex;flex-direction:column;gap:var(--__P__-space-4)}.__P__-field{display:flex;flex-direction:column;gap:6px}.__P__-field-label{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-field-req{color:var(--__P__-danger)}.__P__-field-input{width:100%;min-width:0;max-width:100%;box-sizing:border-box;padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);color:var(--__P__-fg);font:inherit;font-size:var(--__P__-text-sm);resize:vertical;transition:border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-field-input:focus-visible{outline:none;border-color:var(--__P__-accent)}.__P__-field[data-invalid=true] .__P__-field-input{border-color:var(--__P__-danger)}.__P__-field-input[type=date],.__P__-field-input[type=time]{appearance:none;-webkit-appearance:none}@media(pointer:coarse){.__P__-field-input{font-size:max(16px,calc(16px * var(--__P__-text-scale)))}}.__P__-field-hint{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-field-error{font-size:var(--__P__-text-xs);color:var(--__P__-danger)}.__P__-field-choices{display:flex;flex-direction:column;gap:10px;padding-top:2px}.__P__-choice{display:flex;align-items:flex-start;gap:10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);cursor:pointer}.__P__-choice input{margin-top:2px;accent-color:var(--__P__-accent)}.__P__-form-actions{display:flex;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:var(--__P__-space-2)}.__P__-form-submit,.__P__-tool-approve{padding:var(--__P__-space-2) var(--__P__-space-4);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);cursor:pointer;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-submit:hover:not(:disabled),.__P__-tool-approve:hover:not(:disabled){filter:brightness(1.06)}.__P__-form-submit:disabled{opacity:.6;cursor:default}.__P__-form-skip,.__P__-tool-reject{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:transparent;color:var(--__P__-fg-muted);font:inherit;font-size:var(--__P__-text-sm);cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-skip:hover:not(:disabled),.__P__-tool-reject:hover:not(:disabled){background:var(--__P__-bg-elevated)}.__P__-form-gate{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated)}.__P__-form-gate-title{margin:0;font-size:var(--__P__-text-base);font-weight:700;color:var(--__P__-fg)}.__P__-form-gate-desc{margin:0 0 var(--__P__-space-1);font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted)}.__P__-form-done{display:flex;align-items:center;justify-content:center;gap:6px;padding:6px 12px;border:1px dashed var(--__P__-border);border-radius:999px;align-self:center;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted)}.__P__-form-done svg{width:14px;height:14px;color:var(--__P__-success, #22c55e)}.__P__-form-done[data-outcome=skipped] svg{color:var(--__P__-fg-muted)}.__P__-form-done-fill{border:0;background:none;padding:0 2px;cursor:pointer;font:inherit;font-weight:600;color:var(--__P__-accent)}.__P__-form-done-fill:hover{text-decoration:underline}details.__P__-form-done{display:block;padding:0;border-radius:var(--__P__-radius-md)}details[open].__P__-form-done{width:min(100%,420px);background:var(--__P__-surface)}.__P__-form-done-summary{display:flex;align-items:center;justify-content:center;gap:6px;padding:8px 12px;cursor:pointer;list-style:none}.__P__-form-done-summary::-webkit-details-marker{display:none}.__P__-form-done-summary>svg:last-child{color:var(--__P__-fg-muted);transition:transform .15s var(--__P__-ease)}details[open]>.__P__-form-done-summary>svg:last-child{transform:rotate(90deg)}.__P__-form-answers{margin:0;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);display:grid;gap:var(--__P__-space-3);text-align:start}.__P__-form-answer{display:grid;gap:6px}.__P__-form-answer dt{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-form-answer dd{margin:0;padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);font-size:var(--__P__-text-sm);font-weight:400;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-tool-ask-input,.__P__-tool-approval{display:flex;flex-direction:column;gap:var(--__P__-space-2);margin-top:6px;padding:var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated)}.__P__-tool-head{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.__P__-tool-badge{padding:2px 8px;border-radius:999px;background:var(--__P__-warning, #f59e0b);color:#1a1206;font-size:var(--__P__-text-xs);font-weight:600}.__P__-tool-title{font-size:var(--__P__-text-sm);color:var(--__P__-fg)}.__P__-tool-question{margin:0;font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-tool-desc{margin:0;font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted)}.__P__-tool-args{margin:0;padding:var(--__P__-space-2);max-height:160px;overflow:auto;border-radius:var(--__P__-radius-sm);background:var(--__P__-bg);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);white-space:pre-wrap;word-break:break-word}.__P__-tool-stale-note{margin:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-tool-decided{flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px}.__P__-tool-decided-label{padding:2px 8px;border-radius:999px;background:var(--__P__-bg);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-tool-decided-label[data-approved=true]{color:var(--__P__-success, #16a34a);border-color:var(--__P__-success, #16a34a)}.__P__-tool-decided-label[data-approved=false]{color:var(--__P__-danger);border-color:var(--__P__-danger)}.__P__-tool-decided-value{font-size:var(--__P__-text-sm);color:var(--__P__-fg)}:host([dir="rtl"]) .__P__-icon-dir{transform:scaleX(-1)}:host([dir="rtl"]) .__P__-field-input[type=date],:host([dir="rtl"]) .__P__-field-input[type=time]{position:relative;text-align:right;padding-left:34px}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-datetime-edit,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-datetime-edit{text-align:right}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-calendar-picker-indicator,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-calendar-picker-indicator{position:absolute;left:var(--__P__-space-3);margin:0}\n';
1241
+ var panel_default = '.__P__-anchor{color-scheme:var(--__P__-color-scheme, light);right:16px;bottom:16px}.__P__-surface{display:contents}.__P__-surface[hidden]{display:none}:host([data-position="bottom-left"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{right:auto;left:16px}:host([data-position="top-right"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{bottom:auto;top:16px}.__P__-anchor{position:fixed;display:flex;flex-direction:column;align-items:flex-end;gap:var(--__P__-space-3);pointer-events:none}.__P__-anchor{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=sm]{--__P__-fab-size: 44px}.__P__-anchor[data-launcher-size=md]{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=lg]{--__P__-fab-size: 68px}.__P__-anchor>*{pointer-events:auto}.__P__-fab[data-size=sm]{--__P__-fab-size: 44px;font-size:var(--__P__-text-sm)}.__P__-fab[data-size=md]{--__P__-fab-size: 56px;font-size:calc(14px * var(--__P__-text-scale))}.__P__-fab[data-size=lg]{--__P__-fab-size: 68px;font-size:var(--__P__-text-base)}.__P__-fab{display:inline-flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);color:var(--__P__-accent-text);background:var(--__P__-accent);box-shadow:var(--__P__-shadow-fab);font-weight:600;line-height:1;transform-origin:bottom right;animation:__P__-fab-in var(--__P__-dur-base) var(--__P__-ease) both;transition:transform var(--__P__-dur-base) var(--__P__-ease),opacity var(--__P__-dur-base) var(--__P__-ease),box-shadow var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab:hover{transform:translateY(-2px)}.__P__-fab:active{transform:translateY(0)}.__P__-fab:focus-visible{outline:2px solid var(--__P__-on-accent);outline-offset:3px}.__P__-fab svg{width:24px;height:24px;flex-shrink:0}@keyframes __P__-fab-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:none}}.__P__-fab[data-leaving]{position:absolute;right:0;bottom:0;animation:__P__-fab-out var(--__P__-dur-quick) var(--__P__-ease) forwards;pointer-events:none}:host([data-position^="top-"]) .__P__-fab[data-leaving]{bottom:auto;top:0}:host([data-position$="-left"]) .__P__-fab[data-leaving]{right:auto;left:0}@keyframes __P__-fab-out{0%{opacity:1;transform:none}to{opacity:0;transform:scale(.85)}}.__P__-fab[data-variant=circle]{width:var(--__P__-fab-size);height:var(--__P__-fab-size);border-radius:999px}.__P__-fab[data-variant=circle] .__P__-fab-label{display:none}.__P__-fab[data-variant=pill]{height:var(--__P__-fab-size);padding:0 18px 0 16px;border-radius:999px}.__P__-fab[data-variant=bar]{height:var(--__P__-fab-size);padding:0 22px;border-radius:var(--__P__-radius)}.__P__-fab[data-variant=minimal]{height:var(--__P__-fab-size);padding:0 var(--__P__-space-4);border-radius:999px;background:transparent;color:var(--__P__-accent);box-shadow:none;border:1px solid currentColor}.__P__-fab[data-variant=minimal]:hover{background:color-mix(in srgb,var(--__P__-accent) 12%,transparent)}.__P__-callout{--__P__-callout-fab-h: var(--__P__-fab-size, 56px);--__P__-callout-gap: clamp(12px, calc(var(--__P__-callout-fab-h) * .25), 22px);--__P__-callout-nudge-direction: -1;position:absolute;display:inline-flex;align-items:center;gap:var(--__P__-space-2);padding:10px 14px;background:var(--__P__-fg);color:var(--__P__-bg);border-radius:999px;font-size:var(--__P__-text-sm);font-weight:600;line-height:1.2;box-shadow:0 10px 30px -8px #00000059;pointer-events:auto;animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease);z-index:1;max-width:240px;white-space:nowrap}.__P__-callout[data-position=left]{right:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%)}.__P__-callout[data-position=right]{left:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%);--__P__-callout-nudge-direction: 1}.__P__-callout[data-position=top]{bottom:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-position=bottom]{top:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}:host([data-position$="-left"]) .__P__-callout[data-position=top],:host([data-position$="-left"]) .__P__-callout[data-position=bottom]{right:auto;left:0}.__P__-callout[data-shape=bubble]{border-radius:var(--__P__-radius-md);white-space:normal;width:max-content;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-shape=callout]{padding:12px 18px;font-size:calc(14px * var(--__P__-text-scale));background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-callout:after{content:"";position:absolute;width:12px;height:12px;background:inherit;border-radius:2px;transform:rotate(45deg)}.__P__-callout[data-position=left]:after{right:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=right]:after{left:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=top]:after{bottom:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-position=bottom]:after{top:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}:host([data-position$="-left"]) .__P__-callout[data-position=top]:after,:host([data-position$="-left"]) .__P__-callout[data-position=bottom]:after{right:auto;left:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-animated]{animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease),__P__-callout-nudge 1.6s var(--__P__-ease-in-out) var(--__P__-dur-slow) infinite}@keyframes __P__-callout-in{0%{opacity:0}to{opacity:1}}@keyframes __P__-callout-nudge{0%,to{margin-left:0;margin-right:0}50%{margin-left:calc(6px * var(--__P__-callout-nudge-direction));margin-right:calc(-6px * var(--__P__-callout-nudge-direction))}}@media(prefers-reduced-motion:reduce){.__P__-callout[data-animated]{animation:__P__-callout-in 1ms var(--__P__-ease)}.__P__-icon-btn[data-recording=true],.__P__-typing span{animation:none}}.__P__-callout-close{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:999px;color:inherit;opacity:.7;cursor:pointer}.__P__-callout-close:hover{opacity:1;background:color-mix(in srgb,currentColor 15%,transparent)}.__P__-callout-close:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-callout-close svg{width:12px;height:12px}.__P__-panel{width:var(--__P__-panel-w);height:var(--__P__-panel-h);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);background:var(--__P__-bg);color:var(--__P__-fg);border-radius:var(--__P__-radius-lg);box-shadow:var(--__P__-shadow-panel);display:flex;flex-direction:column;overflow:hidden;transform-origin:bottom right;animation:__P__-panel-in var(--__P__-dur-slow) var(--__P__-ease);border:1px solid var(--__P__-border)}@media(prefers-reduced-motion:no-preference){.__P__-panel{transition:width var(--__P__-dur-base) var(--__P__-ease),height var(--__P__-dur-base) var(--__P__-ease),max-width var(--__P__-dur-base) var(--__P__-ease),max-height var(--__P__-dur-base) var(--__P__-ease)}.__P__-panel[data-resizing]{transition:none}}:host([data-mode="open"]) .__P__-panel{width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));min-width:var(--__P__-resize-min-w, auto);min-height:var(--__P__-resize-min-h, auto);max-width:var(--__P__-resize-max-w, calc(100vw - 32px) );max-height:var(--__P__-resize-max-h, calc(100dvh - 32px) )}@keyframes __P__-panel-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}:host([data-mode="expanded"]) .__P__-panel{width:var(--__P__-expanded-w, 640px);height:var(--__P__-expanded-h, 820px);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px)}:host([data-mode="fullscreen"]){z-index:var(--__P__-z-panel)!important}:host([data-mode="fullscreen"]) .__P__-anchor{inset:0;padding:0;justify-content:flex-end;align-items:flex-end}:host([data-mode="fullscreen"][data-position*="top"]) .__P__-anchor{justify-content:flex-start}:host([data-mode="fullscreen"][data-position*="left"]) .__P__-anchor{align-items:flex-start}:host([data-mode="fullscreen"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}:host([data-mode="fullscreen"]) .__P__-fab{display:none}@media(max-width:640px){:host([data-mode="open"]) .__P__-anchor,:host([data-mode="expanded"]) .__P__-anchor{inset:0;align-items:stretch;padding:0}:host([data-mode="open"]) .__P__-panel,:host([data-mode="expanded"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}}:host([data-mode="inline"]) .__P__-anchor,:host([data-mode="standalone"]) .__P__-anchor{position:static;inset:auto;padding:0;align-items:stretch;width:100%;height:100%;min-height:0}:host([data-mode="inline"]) .__P__-panel,:host([data-mode="standalone"]) .__P__-panel{width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;animation:none}:host([data-mode="inline"]) .__P__-fab,:host([data-mode="standalone"]) .__P__-fab{display:none}:host([data-mode="inline"]){min-height:320px}:host([data-mode="inline"]) .__P__-panel{border-radius:var(--__P__-radius)}:host([data-mode="standalone"]) .__P__-panel{border-radius:0;border:0;box-shadow:none}:host([data-mode="modal"]){position:fixed!important;inset:0!important;z-index:var(--__P__-z-panel)!important;display:block!important;width:100vw;height:100dvh;background:var(--__P__-modal-backdrop, var(--__P__-backdrop));animation:__P__-backdrop-in var(--__P__-dur-base) var(--__P__-ease) both;--__P__-panel-w: min(960px, 92vw);--__P__-panel-h: min(720px, 88dvh)}:host([data-mode="modal"]) .__P__-anchor{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:var(--__P__-space-6);pointer-events:none}:host([data-mode="modal"]) .__P__-panel{pointer-events:auto;width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));max-width:calc(100vw - 48px);max-height:calc(100dvh - 48px);min-width:0;min-height:0;border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-panel);animation:__P__-modal-in var(--__P__-dur-base) var(--__P__-ease);translate:var(--__P__-modal-dx, 0px) var(--__P__-modal-dy, 0px)}:host([data-mode="modal"]) .__P__-header,:host([data-mode="modal"]) .__P__-back-header,:host([data-mode="modal"]) .__P__-home-hero{cursor:grab;touch-action:none}:host([data-mode="modal"]) .__P__-panel[data-dragging]{cursor:grabbing;user-select:none}:host([data-mode="modal"]) .__P__-panel[data-dragging] *{cursor:grabbing}:host([data-mode="modal"]) .__P__-fab{display:none}@keyframes __P__-backdrop-in{0%{background:#0000}to{background:var(--__P__-modal-backdrop, var(--__P__-backdrop))}}@keyframes __P__-modal-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}:host([data-mode="drawer"]){--__P__-panel-w: min(440px, calc(100vw - 32px) );--__P__-panel-h: 100dvh}:host([data-mode="drawer"]) .__P__-anchor{position:fixed;--__P__-inset-x: var(--__P__-panel-inset, 12px);--__P__-inset-y: var(--__P__-panel-inset, 3dvh);top:var(--__P__-inset-y);bottom:auto;right:var(--__P__-inset-x);left:auto;width:min(var(--__P__-widget-w, var(--__P__-panel-w)),calc(100vw - var(--__P__-inset-x) * 2));height:min(var(--__P__-widget-h, var(--__P__-panel-h)),calc(100dvh - var(--__P__-inset-y) * 2));padding:0;display:block;pointer-events:auto}:host([data-mode="drawer"][data-position$="-left"]) .__P__-anchor{right:auto;left:var(--__P__-inset-x)}:host([data-mode="drawer"][data-position^="bottom-"]) .__P__-anchor{top:auto;bottom:var(--__P__-inset-y)}:host([data-mode="drawer"]) .__P__-panel{width:100%;height:100%;max-width:none;max-height:none;min-width:0;min-height:0;border-radius:var(--__P__-radius, 12px);border:1px solid var(--__P__-border);box-shadow:-8px 16px 32px -12px #00000038;animation:__P__-drawer-in var(--__P__-dur-base) var(--__P__-ease)}:host([data-mode="drawer"][data-position$="-left"]) .__P__-panel{box-shadow:8px 16px 32px -12px #00000038;animation:__P__-drawer-in-left var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab[data-edge-tab]{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-2);position:fixed;top:50%;height:140px;width:auto;min-width:0;padding:10px 8px;writing-mode:vertical-rl;text-orientation:mixed;transform:translateY(-50%);transform-origin:center;animation:__P__-edge-tab-in var(--__P__-dur-base) var(--__P__-ease) both}.__P__-fab[data-edge-tab] svg{writing-mode:horizontal-tb}.__P__-fab[data-edge-tab]:hover{transform:translateY(-50%) scale(1.03)}.__P__-fab[data-edge-tab]:active{transform:translateY(-50%) scale(.97)}:host([data-position$="-right"]) .__P__-fab[data-edge-tab]{right:0;left:auto;border-radius:12px 0 0 12px;box-shadow:-6px 0 18px -8px #0000004d}:host([data-position$="-left"]) .__P__-fab[data-edge-tab]{left:0;right:auto;border-radius:0 12px 12px 0;box-shadow:6px 0 18px -8px #0000004d}.__P__-fab[data-edge-tab][data-leaving]{position:fixed;top:50%;bottom:auto;animation:__P__-edge-tab-out var(--__P__-dur-quick) var(--__P__-ease) forwards}@keyframes __P__-edge-tab-in{0%{opacity:0;transform:translateY(-50%) scale(.9)}to{opacity:1;transform:translateY(-50%) scale(1)}}@keyframes __P__-edge-tab-out{0%{opacity:1;transform:translateY(-50%) scale(1)}to{opacity:0;transform:translateY(-50%) scale(.85)}}@keyframes __P__-drawer-in{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes __P__-drawer-in-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@media(prefers-reduced-motion:reduce){:host([data-mode="drawer"]) .__P__-panel,.__P__-fab[data-edge-tab]{animation:none}}.__P__-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);background:var(--__P__-bg)}.__P__-header h1{font-size:calc(14px * var(--__P__-text-scale));font-weight:600;flex:1;letter-spacing:-.01em}.__P__-header-actions{margin-inline-start:auto;display:flex;align-items:center;gap:var(--__P__-space-1);flex-shrink:0}.__P__-agent{flex:1;display:inline-flex;align-items:center;gap:10px;min-width:0}.__P__-agent-avatar{position:relative;width:32px;height:32px;border-radius:999px;background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:var(--__P__-text-xs);overflow:hidden;flex-shrink:0}.__P__-agent-avatar img{width:100%;height:100%;object-fit:cover}.__P__-agent-avatar:after{content:"";position:absolute;right:-1px;bottom:-1px;width:10px;height:10px;border-radius:999px;border:2px solid var(--__P__-bg);background:var(--__P__-neutral)}.__P__-agent-avatar[data-status=online]:after{background:var(--__P__-success)}.__P__-agent-avatar[data-status=away]:after{background:var(--__P__-warning)}.__P__-agent-avatar[data-status=offline]:after{background:var(--__P__-neutral)}.__P__-agent-meta{display:flex;flex-direction:column;line-height:1.15;min-width:0}.__P__-agent-meta strong{font-size:calc(14px * var(--__P__-text-scale));font-weight:600;letter-spacing:-.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-agent-meta span{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-suggestions{display:flex;flex-wrap:nowrap;gap:var(--__P__-space-2);padding:6px 14px 10px;overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;scroll-snap-type:x proximity;scrollbar-width:none;-ms-overflow-style:none;min-width:0}.__P__-suggestions::-webkit-scrollbar{display:none}.__P__-suggestions:before,.__P__-suggestions:after{content:"";flex:1 1 0;min-width:0}.__P__-suggestion{flex:0 0 auto;scroll-snap-align:center;padding:7px 14px;border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg);font-size:var(--__P__-text-sm);font-weight:500;white-space:nowrap;transition:background var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-suggestion:hover{border-color:var(--__P__-accent);color:var(--__P__-accent);transform:translateY(-1px)}.__P__-suggestion:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px;border-color:var(--__P__-accent)}.__P__-suggestion:active{transform:translateY(0)}.__P__-icon-btn{width:32px;height:32px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);transition:background var(--__P__-dur-quick) var(--__P__-ease),color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-icon-btn:hover{background:var(--__P__-bg-elevated);color:var(--__P__-fg)}.__P__-icon-btn:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-icon-btn:active{background:var(--__P__-border)}.__P__-icon-btn:disabled{opacity:.45;cursor:not-allowed}.__P__-icon-btn:before{content:"";position:absolute;inset:-6px}.__P__-icon-btn{position:relative}.__P__-icon-btn svg{width:18px;height:18px}.__P__-icon-btn[data-recording=true]{color:var(--__P__-accent);background:color-mix(in srgb,var(--__P__-accent) 12%,transparent);animation:__P__-pulse 1.2s var(--__P__-ease) infinite}@keyframes __P__-pulse{0%,to{box-shadow:0 0 color-mix(in srgb,var(--__P__-accent) 40%,transparent)}50%{box-shadow:0 0 0 6px color-mix(in srgb,var(--__P__-accent) 0%,transparent)}}.__P__-list,.__P__-history,.__P__-module-scroll,.__P__-home-scroll,.__P__-help-list,.__P__-tool-args,.__P__-sidebar-conversations{scrollbar-width:thin;scrollbar-color:var(--__P__-border-strong) transparent;overscroll-behavior:contain;scrollbar-gutter:stable}.__P__-list::-webkit-scrollbar,.__P__-history::-webkit-scrollbar,.__P__-module-scroll::-webkit-scrollbar,.__P__-home-scroll::-webkit-scrollbar,.__P__-help-list::-webkit-scrollbar,.__P__-tool-args::-webkit-scrollbar,.__P__-sidebar-conversations::-webkit-scrollbar{width:8px}.__P__-list::-webkit-scrollbar-thumb,.__P__-history::-webkit-scrollbar-thumb,.__P__-module-scroll::-webkit-scrollbar-thumb,.__P__-home-scroll::-webkit-scrollbar-thumb,.__P__-help-list::-webkit-scrollbar-thumb,.__P__-tool-args::-webkit-scrollbar-thumb,.__P__-sidebar-conversations::-webkit-scrollbar-thumb{background:var(--__P__-border-strong);border-radius:8px}.__P__-list-wrap{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}.__P__-jump{position:absolute;inset-inline-end:14px;bottom:14px;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:999px;border:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);color:var(--__P__-fg);box-shadow:var(--__P__-shadow-panel);cursor:pointer;opacity:.85;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease);animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-jump:hover{opacity:1}.__P__-jump:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;opacity:1}.__P__-jump:active{transform:translateY(1px)}.__P__-jump svg{width:18px;height:18px}.__P__-list{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-4);padding-bottom:var(--__P__-space-8);display:flex;flex-direction:column;gap:14px}.__P__-date-divider{position:sticky;top:var(--__P__-space-2);z-index:2;display:flex;justify-content:center;align-items:flex-start;height:0;margin:0;pointer-events:none}.__P__-date-pill{padding:3px 10px;border-radius:999px;font-size:calc(11px * var(--__P__-text-scale));font-weight:600;color:var(--__P__-fg-muted);background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);box-shadow:var(--__P__-shadow-card);opacity:0;pointer-events:none;transition:opacity var(--__P__-dur-base) var(--__P__-ease)}.__P__-list[data-scrolling=true] .__P__-date-pill{opacity:1;pointer-events:auto}@media(prefers-reduced-motion:reduce){.__P__-date-pill{transition:none}}.__P__-bubble-row{display:flex}.__P__-bubble-row[data-role=user]{justify-content:flex-end}.__P__-bubble-row[data-role=assistant]{justify-content:flex-start}.__P__-bubble{max-width:100%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);line-height:1.6;font-size:calc(14px * var(--__P__-text-scale));word-wrap:break-word;overflow-wrap:anywhere;box-shadow:0 1px 2px #0000000a,0 1px 8px -4px #0000000f;animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-bubble ::selection{background:color-mix(in srgb,var(--__P__-accent) 30%,transparent)}.__P__-bubble-row[data-role=user] .__P__-bubble ::selection{background:#fff6;color:var(--__P__-bubble-user-text)}@keyframes __P__-bubble-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-bubble-row[data-role=user] .__P__-bubble{background:var(--__P__-bubble-user);color:var(--__P__-bubble-user-text);border-end-end-radius:5px}.__P__-bubble-row[data-role=assistant] .__P__-bubble{background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border-end-start-radius:5px}.__P__-bubble-col{display:flex;flex-direction:column;max-width:85%;min-width:0}.__P__-bubble-row[data-role=user] .__P__-bubble-col{align-items:flex-end}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col{align-items:flex-start}.__P__-bubble-time{margin-top:3px;padding:0 4px;font-size:calc(11px * var(--__P__-text-scale));line-height:1;color:var(--__P__-fg-muted);user-select:none}.__P__-md>*:first-child{margin-top:0}.__P__-md>*:last-child{margin-bottom:0}.__P__-md p{margin:10px 0}.__P__-md h1,.__P__-md h2,.__P__-md h3,.__P__-md h4,.__P__-md h5,.__P__-md h6{margin:18px 0 8px;line-height:1.3;letter-spacing:-.01em;font-weight:700}.__P__-md h1{font-size:1.4em}.__P__-md h2{font-size:1.22em}.__P__-md h3{font-size:1.08em}.__P__-md h4,.__P__-md h5,.__P__-md h6{font-size:1em}.__P__-md>h1:first-child,.__P__-md>h2:first-child,.__P__-md>h3:first-child,.__P__-md>h4:first-child,.__P__-md>h5:first-child,.__P__-md>h6:first-child{margin-top:0}.__P__-md ul,.__P__-md ol{padding-inline-start:1.5em;margin:10px 0}.__P__-md ul{list-style:disc}.__P__-md ol{list-style:decimal}.__P__-md li{margin:6px 0;padding-inline-start:2px}.__P__-md li::marker{color:var(--__P__-fg-muted)}.__P__-md li>p{margin:6px 0}.__P__-md li>ul,.__P__-md li>ol{margin:6px 0}.__P__-md strong,.__P__-md b{font-weight:650;letter-spacing:-.005em}.__P__-md em,.__P__-md i{font-style:italic}.__P__-md code{font-family:var(--__P__-font-mono);font-size:.86em;padding:1px 6px;border-radius:5px;background:color-mix(in srgb,var(--__P__-accent) 10%,transparent);color:var(--__P__-fg);border:1px solid color-mix(in srgb,var(--__P__-accent) 16%,transparent)}.__P__-md pre{font-family:var(--__P__-font-mono);font-size:calc(12.5px * var(--__P__-text-scale));padding:12px 14px;border-radius:var(--__P__-radius-sm);background:#7f7f7f1f;overflow-x:auto;margin:var(--__P__-space-3) 0;line-height:1.5}.__P__-md pre code{padding:0;background:none}.__P__-md a{color:inherit;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}.__P__-md a:hover{text-decoration-thickness:2px}.__P__-md blockquote{margin:14px 0;padding:6px 14px;border-inline-start:3px solid color-mix(in srgb,var(--__P__-accent) 50%,transparent);background:color-mix(in srgb,var(--__P__-accent) 5%,transparent);border-start-end-radius:var(--__P__-radius-sm);border-end-end-radius:var(--__P__-radius-sm);color:var(--__P__-fg-muted)}.__P__-md blockquote>:first-child{margin-top:0}.__P__-md blockquote>:last-child{margin-bottom:0}.__P__-md hr{border:0;height:1px;background:color-mix(in srgb,currentColor 18%,transparent);margin:var(--__P__-space-4) 0}.__P__-md table{border-collapse:collapse;margin:var(--__P__-space-3) 0;font-size:.95em;display:block;overflow-x:auto;max-width:100%;font-variant-numeric:tabular-nums}.__P__-md th,.__P__-md td{padding:6px 10px;border-bottom:1px solid color-mix(in srgb,currentColor 12%,transparent);text-align:start}.__P__-md th{font-weight:700;background:color-mix(in srgb,currentColor 6%,transparent)}.__P__-md h1+ul,.__P__-md h1+ol,.__P__-md h2+ul,.__P__-md h2+ol,.__P__-md h3+ul,.__P__-md h3+ol,.__P__-md h4+ul,.__P__-md h4+ol{margin-top:var(--__P__-space-1)}.__P__-loading{display:inline-flex;align-items:center;gap:var(--__P__-space-2);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-loading-spinner{width:14px;height:14px;border-radius:999px;border:2px solid currentColor;border-top-color:transparent;animation:__P__-spin .8s linear infinite}@keyframes __P__-spin{to{transform:rotate(1turn)}}.__P__-typing{display:inline-flex;gap:var(--__P__-space-1);padding:var(--__P__-space-1) 0}.__P__-typing span{width:5px;height:5px;border-radius:999px;background:currentColor;opacity:.4;animation:__P__-blink 1.2s var(--__P__-ease) infinite}.__P__-typing span:nth-child(2){animation-delay:.2s}.__P__-typing span:nth-child(3){animation-delay:.4s}@keyframes __P__-blink{0%,80%,to{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-2px)}}.__P__-reasoning{margin:var(--__P__-space-1) 0 var(--__P__-space-2);padding-inline-start:var(--__P__-space-3);border-inline-start:2px solid var(--__P__-border-strong)}.__P__-reasoning-summary{display:inline-flex;align-items:center;gap:var(--__P__-space-1);cursor:pointer;list-style:none;user-select:none;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-reasoning-summary:hover{color:var(--__P__-fg)}.__P__-reasoning-summary:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__P__-reasoning-summary::-webkit-details-marker{display:none}.__P__-reasoning-summary:before{content:"";width:5px;height:5px;border-inline-end:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg);opacity:.7;transition:transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-reasoning[open] .__P__-reasoning-summary:before{transform:rotate(45deg)}.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:__P__-reasoning-pulse 1.4s var(--__P__-ease) infinite}@keyframes __P__-reasoning-pulse{0%,to{opacity:.5}50%{opacity:1}}@media(prefers-reduced-motion:reduce){.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:none}}.__P__-reasoning-body{margin-top:var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-reasoning-body>:first-child{margin-top:0}.__P__-reasoning-body>:last-child{margin-bottom:0}.__P__-tool-call{margin-top:6px;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-sm);background:var(--__P__-bg-elevated);font-size:var(--__P__-text-xs)}.__P__-tool-call-summary{display:flex;align-items:center;gap:6px;padding:var(--__P__-space-1) var(--__P__-space-2);cursor:pointer;list-style:none;color:var(--__P__-fg-muted)}.__P__-tool-call-summary::-webkit-details-marker{display:none}.__P__-tool-call-section{padding:0 var(--__P__-space-2) var(--__P__-space-2)}.__P__-tool-call-label{display:block;margin-bottom:4px;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);text-transform:uppercase;letter-spacing:.04em}.__P__-tool-call-section[data-error=true] .__P__-tool-args{color:var(--__P__-danger, #c0392b)}.__P__-source{display:inline-flex;align-items:center;gap:6px;max-width:100%;margin-top:6px;margin-inline-end:6px;padding:var(--__P__-space-1) var(--__P__-space-2);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);text-decoration:none}a.__P__-source:hover{color:var(--__P__-fg);border-color:var(--__P__-accent)}.__P__-source-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-composer{border-top:1px solid var(--__P__-border);padding:10px 12px;background:var(--__P__-bg);display:flex;flex-direction:column;gap:var(--__P__-space-2)}.__P__-composer-row{display:flex;align-items:flex-end;gap:6px}.__P__-textarea{flex:1;height:40px;max-height:160px;padding:10px 12px;border-radius:var(--__P__-radius);background:var(--__P__-bg-elevated);border:1px solid transparent;font-size:calc(14px * var(--__P__-text-scale));line-height:1.4;transition:height var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),box-shadow var(--__P__-dur-quick) var(--__P__-ease)}.__P__-textarea:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:1px;border-color:var(--__P__-focus)}@media(pointer:coarse){.__P__-textarea,.__P__-home-search-input{font-size:max(16px,calc(16px * var(--__P__-text-scale)))}.__P__-textarea{height:44px}}.__P__-send{width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease),background var(--__P__-dur-quick) var(--__P__-ease)}.__P__-send[data-shape=circle]{border-radius:999px}.__P__-send[data-shape=square]{border-radius:var(--__P__-radius-sm)}.__P__-send[data-shape=pill]{width:auto;padding:0 18px;border-radius:999px}.__P__-send[data-variant=filled]{background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-send[data-variant=outline]{background:transparent;color:var(--__P__-accent);border-color:var(--__P__-accent)}.__P__-send[data-variant=outline]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 10%,transparent)}.__P__-send[data-variant=ghost]{background:transparent;color:var(--__P__-accent)}.__P__-send[data-variant=ghost]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 8%,transparent)}.__P__-send:disabled{opacity:.4;cursor:not-allowed}.__P__-send:not(:disabled):hover{transform:translateY(-1px)}.__P__-send:not(:disabled):active{transform:translateY(0)}.__P__-send:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-send svg{width:18px;height:18px}.__P__-composer-actions{display:flex;gap:var(--__P__-space-1);flex-wrap:wrap}.__P__-attachments{display:flex;flex-wrap:wrap;gap:6px}.__P__-attachment-chip{display:inline-flex;align-items:center;gap:6px;padding:var(--__P__-space-1) var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-1);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);font-size:var(--__P__-text-xs);max-width:200px}.__P__-attachment-thumb{width:24px;height:24px;border-radius:999px;object-fit:cover;background:var(--__P__-border)}.__P__-attachment-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-attachment-remove{width:18px;height:18px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted)}.__P__-attachment-remove:hover{background:var(--__P__-border);color:var(--__P__-fg)}.__P__-dropzone{position:absolute;inset:8px;border:2px dashed var(--__P__-accent);border-radius:var(--__P__-radius);background:color-mix(in srgb,var(--__P__-accent) 8%,transparent);display:flex;align-items:center;justify-content:center;font-weight:600;color:var(--__P__-accent);pointer-events:none;z-index:10;animation:__P__-fade-in var(--__P__-dur-quick) var(--__P__-ease)}@keyframes __P__-fade-in{0%{opacity:0}to{opacity:1}}.__P__-error{margin-top:var(--__P__-space-1);padding:8px 10px;border-radius:var(--__P__-radius-sm);background:var(--__P__-danger-bg);color:var(--__P__-danger-text);font-size:var(--__P__-text-sm);display:flex;align-items:center;gap:var(--__P__-space-2)}.__P__-error button{color:inherit;text-decoration:underline;font-size:var(--__P__-text-sm)}.__P__-history{flex:1;overflow-y:auto;padding:var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-3)}.__P__-history-footer{flex:none;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);border-top:1px solid var(--__P__-border);background:var(--__P__-surface)}.__P__-history-new{width:100%;display:flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);padding:var(--__P__-space-2) var(--__P__-space-3);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-on-accent);cursor:pointer;font-size:var(--__P__-text-sm);font-weight:600;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-history-new svg{width:16px;height:16px}.__P__-history-new:hover{filter:brightness(1.08)}.__P__-history-new:active{transform:translateY(1px)}.__P__-history-new:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-history-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:40px 16px;color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale));text-align:center}.__P__-history-group{display:flex;flex-direction:column;padding:0 var(--__P__-space-3)}.__P__-history-heading{font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);padding:14px 4px 8px;text-transform:uppercase;letter-spacing:.04em}.__P__-history-card{display:flex;flex-direction:column;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-lg, 14px);overflow:hidden}.__P__-history-item{all:unset;display:flex;align-items:center;gap:var(--__P__-space-3);padding:12px var(--__P__-space-3);cursor:pointer;transition:background var(--__P__-dur-base) var(--__P__-ease)}.__P__-history-item+.__P__-history-item{border-top:1px solid var(--__P__-border)}.__P__-history-item:hover{background:var(--__P__-bg-elevated)}.__P__-history-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-history-avatar{flex:none;display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:color-mix(in oklab,var(--__P__-accent) 12%,transparent);color:var(--__P__-accent)}.__P__-history-avatar svg{width:18px;height:18px}.__P__-history-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.__P__-history-row{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-2)}.__P__-history-title{flex:1;min-width:0;font-size:calc(14px * var(--__P__-text-scale));font-weight:500;color:var(--__P__-fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-time{flex:none;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-history-preview{flex:1;min-width:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-dot{flex:none;width:8px;height:8px;border-radius:50%;background:var(--__P__-accent)}.__P__-history-item[data-unread=true] .__P__-history-title{font-weight:600}.__P__-history-item[data-closed=true] .__P__-history-title{color:var(--__P__-fg-muted)}.__P__-history-item-skeleton{cursor:default;pointer-events:none}.__P__-skeleton{display:block;border-radius:4px;background:linear-gradient(90deg,color-mix(in oklab,var(--__P__-fg) 9%,transparent) 30%,color-mix(in oklab,var(--__P__-fg) 17%,transparent),color-mix(in oklab,var(--__P__-fg) 9%,transparent) 70%);background-size:200% 100%;animation:__P__-skeleton-shimmer 1.8s ease-in-out infinite}.__P__-history-avatar.__P__-skeleton{border-radius:50%}.__P__-skeleton-heading{width:52px;height:8px}.__P__-skeleton-title{width:55%;height:12px}.__P__-skeleton-time{width:34px;height:10px}.__P__-skeleton-preview{width:80%;height:10px}@keyframes __P__-skeleton-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.__P__-skeleton{animation:none}}.__P__-list-loading{margin:auto;padding:var(--__P__-space-6) var(--__P__-space-4);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);text-align:center}.__P__-readonly-banner{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px 12px;margin:0 var(--__P__-space-3) var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);text-align:center;font-size:var(--__P__-text-sm)}.__P__-readonly-label{line-height:1.4}.__P__-readonly-cta{appearance:none;border:0;cursor:pointer;padding:var(--__P__-space-2) var(--__P__-space-4);border-radius:999px;background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-readonly-cta:hover,.__P__-readonly-cta:focus-visible{filter:brightness(1.1)}.__P__-readonly-cta:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}.__P__-composer-footer{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:10px 16px;margin:0 var(--__P__-space-3);border-top:1px solid var(--__P__-border);text-align:center;font-size:calc(11px * var(--__P__-text-scale));line-height:1.4;color:var(--__P__-fg-muted)}.__P__-disclaimer{max-width:320px;margin:0 auto;opacity:.9;letter-spacing:.01em}.__P__-poweredby{display:inline-flex;align-items:center;justify-content:center;gap:6px;color:inherit;text-decoration:none;opacity:.7;transition:opacity var(--__P__-dur-base) var(--__P__-ease);font-size:calc(11px * var(--__P__-text-scale));letter-spacing:.02em}.__P__-poweredby:hover{opacity:1}.__P__-poweredby-logo{height:12px;width:auto;display:inline-block;vertical-align:middle}.__P__-poweredby-bar{flex:none;display:flex;align-items:center;justify-content:center;padding:6px 16px;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated)}.__P__-menu-wrap{position:relative;display:inline-flex}.__P__-menu{position:absolute;top:100%;inset-inline-end:0;margin-top:6px;min-width:200px;padding:6px;background:var(--__P__-bg);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);box-shadow:var(--__P__-shadow-panel);z-index:10;display:flex;flex-direction:column;gap:2px;animation:__P__-menu-in var(--__P__-dur-base) var(--__P__-ease)}@media(prefers-reduced-motion:reduce){.__P__-menu{animation:none}}@keyframes __P__-menu-in{0%{opacity:0;transform:translateY(-4px) scale(.98);transform-origin:top right}to{opacity:1;transform:none}}.__P__-menu-item{all:unset;display:flex;align-items:center;gap:10px;padding:8px 10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);border-radius:var(--__P__-radius-sm);cursor:pointer;user-select:none}.__P__-menu-item:hover{background:var(--__P__-bg-elevated)}.__P__-menu-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-menu-item[disabled]{opacity:.45;cursor:not-allowed}.__P__-menu-icon{display:inline-flex;width:16px;height:16px;color:var(--__P__-fg-muted)}.__P__-menu-icon svg{width:16px;height:16px}.__P__-menu-label{flex:1}.__P__-menu-check{display:inline-flex;color:var(--__P__-accent)}.__P__-menu-check svg{width:14px;height:14px}.__P__-menu-item-segmented{cursor:default}.__P__-menu-item-segmented:hover{background:transparent}.__P__-segmented{display:inline-flex;gap:2px;padding:2px;background:var(--__P__-bg-elevated);border-radius:var(--__P__-radius-sm)}.__P__-segment{all:unset;min-width:26px;padding:3px 8px;font-size:var(--__P__-text-xs);font-weight:600;letter-spacing:.02em;text-align:center;color:var(--__P__-fg-muted);border-radius:calc(var(--__P__-radius-sm) - 2px);cursor:pointer;transition:color .12s ease,background .12s ease}.__P__-segment:hover{color:var(--__P__-fg)}.__P__-segment[data-on=true]{background:var(--__P__-bg);color:var(--__P__-accent);box-shadow:var(--__P__-shadow-card)}.__P__-segment:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-resize-grip{position:absolute;width:18px;height:18px;display:flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);opacity:.45;transition:opacity var(--__P__-dur-base) var(--__P__-ease);z-index:2;touch-action:none;user-select:none}.__P__-resize-grip:hover,.__P__-resize-grip:focus-visible{opacity:1}.__P__-resize-grip svg{width:10px;height:10px}.__P__-resize-grip--bottom-left{bottom:2px;left:2px;cursor:nesw-resize;transform:scaleX(-1)}.__P__-resize-grip--bottom-right{bottom:2px;right:2px;cursor:nwse-resize}.__P__-resize-grip--top-left{top:2px;left:2px;cursor:nwse-resize;transform:rotate(180deg)}.__P__-resize-grip--top-right{top:2px;right:2px;cursor:nesw-resize;transform:scaleY(-1)}:host(:not([data-mode="open"])) .__P__-resize-grip{display:none}.__P__-messenger{display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-body,.__P__-messenger-pane{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-pane[hidden]{display:none}@keyframes __P__-view-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-module{display:flex;flex-direction:column;height:100%;min-height:0}@media(prefers-reduced-motion:no-preference){.__P__-module,.__P__-history{animation:__P__-view-in .18s var(--__P__-ease-out)}}.__P__-module-scroll{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-3);display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-home{container-type:inline-size;background:radial-gradient(125% 65% at 88% 0%,color-mix(in srgb,#fff 16%,transparent),transparent 55%),linear-gradient(180deg,var(--__P__-accent) 0%,var(--__P__-accent) 22%,color-mix(in srgb,var(--__P__-accent) 28%,var(--__P__-surface)) 44%,var(--__P__-surface) 70%);border-radius:var(--__P__-radius-lg) var(--__P__-radius-lg) 0 0}.__P__-home-scroll{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;background:transparent}.__P__-home-cards{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:4px 14px 16px}.__P__-module-pad{padding:var(--__P__-space-3) var(--__P__-space-3) 0}.__P__-module-empty{display:flex;flex-direction:column;align-items:center;gap:var(--__P__-space-3);padding:var(--__P__-space-8) var(--__P__-space-4);text-align:center;color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-module-retry{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border-strong);border-radius:var(--__P__-radius-sm);color:var(--__P__-fg);font-weight:600;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-module-retry:hover{background:var(--__P__-hover);border-color:var(--__P__-accent)}.__P__-module-retry:active{background:var(--__P__-border)}.__P__-module-retry:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-help-list{flex:1;min-height:0;overflow-y:auto;padding-bottom:var(--__P__-space-3)}.__P__-help-group{display:flex;flex-direction:column}.__P__-help-section-title{position:sticky;top:0;z-index:1;margin:0;padding:var(--__P__-space-3) var(--__P__-space-5) var(--__P__-space-2);font-size:var(--__P__-text-xs);font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--__P__-fg-muted);background:var(--__P__-bg)}.__P__-help-card{margin:0 var(--__P__-space-3) var(--__P__-space-3);background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden}.__P__-help-card .__P__-list-row{border-bottom:0;border-radius:0}.__P__-help-card .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-module-cta{padding:var(--__P__-space-3);border-top:1px solid var(--__P__-border)}.__P__-tabbar{display:flex;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);flex-shrink:0}.__P__-tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-1);min-height:48px;padding:var(--__P__-space-2) var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600;transition:color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-tab:hover{color:var(--__P__-fg)}.__P__-tab[aria-selected=true]{color:var(--__P__-accent)}.__P__-tab:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-tab:active{background:var(--__P__-hover)}.__P__-tab-icon{position:relative;display:inline-flex}.__P__-tab-icon svg{width:22px;height:22px}.__P__-tab-badge{position:absolute;top:-4px;left:calc(50% + 6px);min-width:16px;height:16px;padding:0 4px;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:var(--__P__-accent);color:var(--__P__-on-accent);font-size:calc(10px * var(--__P__-text-scale));font-weight:600;line-height:1}.__P__-home-hero{flex-shrink:0;padding:var(--__P__-space-5) var(--__P__-space-5) var(--__P__-space-3);color:var(--__P__-on-accent);--__P__-focus: var(--__P__-on-accent)}.__P__-home-hero-top{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);min-height:32px}.__P__-home-brand{font-size:clamp(calc(12px * var(--__P__-text-scale)),calc(3.2cqi * var(--__P__-text-scale)),calc(14px * var(--__P__-text-scale)));font-weight:600;letter-spacing:.01em;color:color-mix(in srgb,#fff 82%,transparent);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.__P__-home-brand-spacer{flex:1}.__P__-home-hero-actions{display:flex;align-items:center;gap:var(--__P__-space-2);flex-shrink:0}.__P__-home-hero-actions .__P__-icon-btn{color:#fff}.__P__-home-hero-actions .__P__-icon-btn:hover{background:color-mix(in srgb,#fff 18%,transparent);color:#fff}.__P__-home-hero-actions .__P__-icon-btn:active{background:color-mix(in srgb,#fff 26%,transparent)}.__P__-home-greeting{margin:28px 0 0;font-family:var(--__P__-font-display);font-size:clamp(calc(19px * var(--__P__-text-scale)),calc(5.5cqi * var(--__P__-text-scale)),var(--__P__-text-2xl));font-weight:800;line-height:1.18;letter-spacing:-.01em;overflow-wrap:anywhere}.__P__-home-lead{margin:10px 0 0;font-family:var(--__P__-font-display);font-size:clamp(calc(15px * var(--__P__-text-scale)),calc(4.2cqi * var(--__P__-text-scale)),var(--__P__-text-xl));font-weight:600;line-height:1.25;letter-spacing:-.005em;color:color-mix(in srgb,var(--__P__-on-accent) 78%,transparent);overflow-wrap:anywhere}.__P__-home-avatars{display:flex}.__P__-home-avatar{width:30px;height:30px;border-radius:999px;overflow:hidden;margin-inline-start:-10px;border:2px solid color-mix(in srgb,#fff 92%,transparent);box-shadow:0 1px 3px #0000002e;background:var(--__P__-surface);display:inline-flex;align-items:center;justify-content:center;font-size:var(--__P__-text-xs);font-weight:700;color:var(--__P__-fg)}.__P__-home-avatar:first-child{margin-inline-start:0}.__P__-home-avatar img{width:100%;height:100%;object-fit:cover}.__P__-home-content{background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-card);overflow:hidden}.__P__-home-content-title{padding:var(--__P__-space-4) var(--__P__-space-4) var(--__P__-space-3);font-size:var(--__P__-text-sm);font-weight:700}.__P__-home-content-list{display:flex;flex-direction:column;padding:0 var(--__P__-space-2) var(--__P__-space-2)}.__P__-home-content-list .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-home-card{display:block;width:100%;text-align:start;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);padding:var(--__P__-space-4);box-shadow:var(--__P__-shadow-card)}.__P__-home-card[data-interactive=true]{cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-home-card[data-interactive=true]:hover{background:var(--__P__-bg-elevated)}.__P__-home-card[data-interactive=true]:active{transform:translateY(1px)}.__P__-home-card[data-interactive=true]:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-recent-row{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-recent-avatar{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;flex-shrink:0;border-radius:999px;background:color-mix(in oklch,var(--__P__-accent) 14%,transparent);color:var(--__P__-accent)}.__P__-home-recent-avatar svg{width:20px;height:20px}.__P__-home-recent-body{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}.__P__-home-recent-title{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-recent-preview{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-home-recent-at{color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);flex-shrink:0}.__P__-home-recent-dot{width:8px;height:8px;border-radius:999px;background:var(--__P__-accent);flex-shrink:0}.__P__-home-recent-row[data-unread=true] .__P__-home-recent-title{font-weight:700}.__P__-home-status{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-status-icon svg{width:22px;height:22px;color:var(--__P__-success)}.__P__-home-status[data-level=degraded] .__P__-home-status-icon svg{color:var(--__P__-warning)}.__P__-home-status[data-level=down] .__P__-home-status-icon svg{color:var(--__P__-danger)}.__P__-home-status-text{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-search{display:flex;align-items:center;gap:var(--__P__-space-2);width:100%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);border:1px solid var(--__P__-border);background:var(--__P__-surface);text-align:start}.__P__-home-search[data-input=true]{background:var(--__P__-bg-elevated)}.__P__-home-search:hover{border-color:var(--__P__-border-strong)}.__P__-home-search:focus-visible,.__P__-home-search:focus-within{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-search-text{flex:1;color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-search-input{flex:1;border:0;background:transparent;font-size:calc(14px * var(--__P__-text-scale));color:var(--__P__-fg);outline:none}.__P__-home-search-icon svg{width:18px;height:18px;color:var(--__P__-accent)}.__P__-list-row{display:flex;align-items:center;gap:var(--__P__-space-3);width:100%;min-height:44px;text-align:start;padding:var(--__P__-space-3) var(--__P__-space-2);border-radius:var(--__P__-radius-sm)}.__P__-list-row:hover{background:var(--__P__-hover)}.__P__-list-row:active{background:var(--__P__-border)}.__P__-list-row:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-list-row-body{display:flex;flex-direction:column;min-width:0;flex:1}.__P__-list-row-title{font-weight:600;font-size:var(--__P__-text-md);line-height:1.35}.__P__-list-row-sub{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);margin-top:var(--__P__-space-1);line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-list-row-chevron svg{width:18px;height:18px;color:var(--__P__-accent);flex-shrink:0}.__P__-back-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);flex-shrink:0}.__P__-back-title{flex:1;text-align:center;font-size:var(--__P__-text-md);font-weight:700;margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-back-spacer{width:32px;height:1px}.__P__-content{display:flex;flex-direction:column;gap:14px;width:100%;max-width:68ch;margin:0 auto}.__P__-content-hero{width:100%;border-radius:var(--__P__-radius)}.__P__-content-subtitle{color:var(--__P__-fg-muted);margin:0}.__P__-content-frame{flex:1;min-height:0;width:100%;border:0;background:#fff}.__P__-news-list{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-news-card{display:block;width:100%;text-align:start;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden;background:var(--__P__-surface)}.__P__-news-card{transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-news-card:hover{background:var(--__P__-bg-elevated)}.__P__-news-card:active{transform:translateY(1px)}.__P__-news-card:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-news-hero{width:100%;display:block}.__P__-news-body{display:flex;flex-direction:column;gap:6px;padding:14px 16px}.__P__-news-title{font-weight:700;font-size:var(--__P__-text-md)}.__P__-news-summary{color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale));display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-modules-empty{display:flex;align-items:center;justify-content:center;position:relative}.__P__-modules-empty-close{position:absolute;top:12px;inset-inline-end:12px}.__P__-modules-empty-text{color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-form{display:flex;flex-direction:column;gap:var(--__P__-space-4)}.__P__-field{display:flex;flex-direction:column;gap:6px}.__P__-field-label{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-field-req{color:var(--__P__-danger)}.__P__-field-input{width:100%;min-width:0;max-width:100%;box-sizing:border-box;padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);color:var(--__P__-fg);font:inherit;font-size:var(--__P__-text-sm);resize:vertical;transition:border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-field-input:focus-visible{outline:none;border-color:var(--__P__-accent)}.__P__-field[data-invalid=true] .__P__-field-input{border-color:var(--__P__-danger)}.__P__-field-input[type=date],.__P__-field-input[type=time]{appearance:none;-webkit-appearance:none}@media(pointer:coarse){.__P__-field-input{font-size:max(16px,calc(16px * var(--__P__-text-scale)))}}.__P__-field-hint{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-field-error{font-size:var(--__P__-text-xs);color:var(--__P__-danger)}.__P__-field-choices{display:flex;flex-direction:column;gap:10px;padding-top:2px}.__P__-choice{display:flex;align-items:flex-start;gap:10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);cursor:pointer}.__P__-choice input{margin-top:2px;accent-color:var(--__P__-accent)}.__P__-form-actions{display:flex;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:var(--__P__-space-2)}.__P__-form-submit,.__P__-tool-approve{padding:var(--__P__-space-2) var(--__P__-space-4);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);cursor:pointer;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-submit:hover:not(:disabled),.__P__-tool-approve:hover:not(:disabled){filter:brightness(1.06)}.__P__-form-submit:disabled{opacity:.6;cursor:default}.__P__-form-skip,.__P__-tool-reject{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:transparent;color:var(--__P__-fg-muted);font:inherit;font-size:var(--__P__-text-sm);cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-skip:hover:not(:disabled),.__P__-tool-reject:hover:not(:disabled){background:var(--__P__-bg-elevated)}.__P__-form-gate{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated)}.__P__-form-gate-title{margin:0;font-size:var(--__P__-text-base);font-weight:700;color:var(--__P__-fg)}.__P__-form-gate-desc{margin:0 0 var(--__P__-space-1);font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted)}.__P__-form-done{display:flex;align-items:center;justify-content:center;gap:6px;padding:6px 12px;border:1px dashed var(--__P__-border);border-radius:999px;align-self:center;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted)}.__P__-form-done svg{width:14px;height:14px;color:var(--__P__-success, #22c55e)}.__P__-form-done[data-outcome=skipped] svg{color:var(--__P__-fg-muted)}.__P__-form-done-fill{border:0;background:none;padding:0 2px;cursor:pointer;font:inherit;font-weight:600;color:var(--__P__-accent)}.__P__-form-done-fill:hover{text-decoration:underline}details.__P__-form-done{display:block;padding:0;border-radius:var(--__P__-radius-md)}details[open].__P__-form-done{width:min(100%,420px);background:var(--__P__-surface)}.__P__-form-done-summary{display:flex;align-items:center;justify-content:center;gap:6px;padding:8px 12px;cursor:pointer;list-style:none}.__P__-form-done-summary::-webkit-details-marker{display:none}.__P__-form-done-summary>svg:last-child{color:var(--__P__-fg-muted);transition:transform .15s var(--__P__-ease)}details[open]>.__P__-form-done-summary>svg:last-child{transform:rotate(90deg)}.__P__-form-answers{margin:0;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);display:grid;gap:var(--__P__-space-3);text-align:start}.__P__-form-answer{display:grid;gap:6px}.__P__-form-answer dt{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-form-answer dd{margin:0;padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);font-size:var(--__P__-text-sm);font-weight:400;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-tool-ask-input,.__P__-tool-approval{display:flex;flex-direction:column;gap:var(--__P__-space-2);margin-top:6px;padding:var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated)}.__P__-tool-head{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.__P__-tool-badge{padding:2px 8px;border-radius:999px;background:var(--__P__-warning, #f59e0b);color:#1a1206;font-size:var(--__P__-text-xs);font-weight:600}.__P__-tool-title{font-size:var(--__P__-text-sm);color:var(--__P__-fg)}.__P__-tool-question{margin:0;font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-tool-desc{margin:0;font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted)}.__P__-tool-args{margin:0;padding:var(--__P__-space-2);max-height:160px;overflow:auto;border-radius:var(--__P__-radius-sm);background:var(--__P__-bg);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);white-space:pre-wrap;word-break:break-word}.__P__-tool-stale-note{margin:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-tool-decided{flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px}.__P__-tool-decided-label{padding:2px 8px;border-radius:999px;background:var(--__P__-bg);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-tool-decided-label[data-approved=true]{color:var(--__P__-success, #16a34a);border-color:var(--__P__-success, #16a34a)}.__P__-tool-decided-label[data-approved=false]{color:var(--__P__-danger);border-color:var(--__P__-danger)}.__P__-tool-decided-value{font-size:var(--__P__-text-sm);color:var(--__P__-fg)}:host([dir="rtl"]) .__P__-icon-dir{transform:scaleX(-1)}:host([dir="rtl"]) .__P__-field-input[type=date],:host([dir="rtl"]) .__P__-field-input[type=time]{position:relative;text-align:right;padding-left:34px}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-datetime-edit,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-datetime-edit{text-align:right}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-calendar-picker-indicator,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-calendar-picker-indicator{position:absolute;left:var(--__P__-space-3);margin:0}\n';
1234
1242
 
1235
1243
  // src/styles/standalone.css
1236
1244
  var standalone_default = ".__P__-standalone-page{margin:0;height:100vh;background:var(--__P__-bg, #fff);display:grid;place-items:stretch}\n";
@@ -1318,22 +1326,22 @@ function attachAdoptedSheet(shadow, doc) {
1318
1326
  }
1319
1327
  }
1320
1328
  function applyThemeOverrides(host, overrides) {
1321
- const p33 = BRAND.cssPrefix;
1322
- if (overrides.accent) host.style.setProperty(`--${p33}-accent-user`, overrides.accent);
1323
- if (overrides.accentText) host.style.setProperty(`--${p33}-accent-text-user`, overrides.accentText);
1324
- if (overrides.radius) host.style.setProperty(`--${p33}-radius`, overrides.radius);
1325
- if (overrides.fontFamily) host.style.setProperty(`--${p33}-font`, overrides.fontFamily);
1329
+ const p35 = BRAND.cssPrefix;
1330
+ if (overrides.accent) host.style.setProperty(`--${p35}-accent-user`, overrides.accent);
1331
+ if (overrides.accentText) host.style.setProperty(`--${p35}-accent-text-user`, overrides.accentText);
1332
+ if (overrides.radius) host.style.setProperty(`--${p35}-radius`, overrides.radius);
1333
+ if (overrides.fontFamily) host.style.setProperty(`--${p35}-font`, overrides.fontFamily);
1326
1334
  }
1327
1335
  function applyThemeMode(host, mode) {
1328
1336
  host.dataset.theme = mode;
1329
1337
  }
1330
1338
  function applySize(host, size) {
1331
- const p33 = BRAND.cssPrefix;
1332
- if (size.width !== void 0) host.style.setProperty(`--${p33}-panel-w`, size.width);
1333
- if (size.height !== void 0) host.style.setProperty(`--${p33}-panel-h`, size.height);
1334
- if (size.expanded?.width !== void 0) host.style.setProperty(`--${p33}-expanded-w`, size.expanded.width);
1335
- if (size.expanded?.height !== void 0) host.style.setProperty(`--${p33}-expanded-h`, size.expanded.height);
1336
- if (size.inset !== void 0) host.style.setProperty(`--${p33}-panel-inset`, size.inset);
1339
+ const p35 = BRAND.cssPrefix;
1340
+ if (size.width !== void 0) host.style.setProperty(`--${p35}-panel-w`, size.width);
1341
+ if (size.height !== void 0) host.style.setProperty(`--${p35}-panel-h`, size.height);
1342
+ if (size.expanded?.width !== void 0) host.style.setProperty(`--${p35}-expanded-w`, size.expanded.width);
1343
+ if (size.expanded?.height !== void 0) host.style.setProperty(`--${p35}-expanded-h`, size.expanded.height);
1344
+ if (size.inset !== void 0) host.style.setProperty(`--${p35}-panel-inset`, size.inset);
1337
1345
  }
1338
1346
  function applyPosition(host, pos) {
1339
1347
  host.dataset.position = pos;
@@ -1353,7 +1361,7 @@ import { h, render as renderPreact } from "preact";
1353
1361
 
1354
1362
  // src/ui/app.tsx
1355
1363
  import { useCallback as useCallback6, useEffect as useEffect16, useMemo as useMemo3, useRef as useRef9, useState as useState13 } from "preact/hooks";
1356
- import { batch, useComputed as useComputed7, useSignal as useSignal2 } from "@preact/signals";
1364
+ import { batch, useComputed as useComputed8, useSignal as useSignal2 } from "@preact/signals";
1357
1365
 
1358
1366
  // src/core/handshake-shape.ts
1359
1367
  function isPlainObject2(raw) {
@@ -1437,7 +1445,7 @@ function createAuth(opts) {
1437
1445
  }
1438
1446
 
1439
1447
  // src/core/version.ts
1440
- var ELEMENTS_VERSION = true ? "0.44.3" : "0.0.0-dev";
1448
+ var ELEMENTS_VERSION = true ? "0.46.0" : "0.0.0-dev";
1441
1449
  var ELEMENTS_VERSION_PARAM = "_ev";
1442
1450
 
1443
1451
  // src/stream/types.ts
@@ -1522,11 +1530,11 @@ function toBase64Url(json) {
1522
1530
  var nonEmpty = (ctx) => ctx && Object.keys(ctx).length > 0 ? ctx : void 0;
1523
1531
  function encodeContext(user, page) {
1524
1532
  const u = nonEmpty(user);
1525
- const p33 = nonEmpty(page);
1526
- if (!u && !p33) return void 0;
1533
+ const p35 = nonEmpty(page);
1534
+ if (!u && !p35) return void 0;
1527
1535
  const envelope = {};
1528
1536
  if (u) envelope.user = u;
1529
- if (p33) envelope.page = p33;
1537
+ if (p35) envelope.page = p35;
1530
1538
  return toBase64Url(JSON.stringify(envelope));
1531
1539
  }
1532
1540
 
@@ -1536,6 +1544,13 @@ function parseWireDate(value) {
1536
1544
  const ms = Date.parse(value);
1537
1545
  return Number.isFinite(ms) ? ms : void 0;
1538
1546
  }
1547
+ function toolPartType(toolName) {
1548
+ const bare = toolName.startsWith("tool:") ? toolName.slice(5) : toolName;
1549
+ return `tool-${bare}`;
1550
+ }
1551
+ function toolNameFromType(type) {
1552
+ return type.startsWith("tool-") ? type.slice(5) : type;
1553
+ }
1539
1554
  var DEFAULT_PATHS = {
1540
1555
  /** Conversation bootstrap. `POST` → deployment config + per-visitor state. */
1541
1556
  handshake: "/pai/handshake",
@@ -1608,17 +1623,15 @@ function buildSendMessageRequest(params) {
1608
1623
  conversationId: params.conversationId,
1609
1624
  trigger: params.trigger ?? "submit-message"
1610
1625
  };
1626
+ if (params.messageId) body.messageId = params.messageId;
1611
1627
  if (params.visitorId) body.visitorId = params.visitorId;
1612
1628
  if (params.userPrefs) body.userPrefs = params.userPrefs;
1613
- const data = {};
1614
1629
  const tools = params.tools?.map(normalizeToolRef).filter((t) => t !== null);
1615
- if (tools?.length) data.tools = tools;
1616
- if (params.responseMode) data.responseMode = params.responseMode;
1617
- if (Object.keys(data).length > 0) body.data = data;
1630
+ if (tools?.length) body.data = { tools };
1618
1631
  return body;
1619
1632
  }
1620
- function isResolvedToolPart(p33) {
1621
- return p33.state === "output" || p33.state === "error" || p33.approval?.approved !== void 0;
1633
+ function isResolvedToolPart(p35) {
1634
+ return p35.state === "output-available" || p35.state === "output-error" || p35.state === "output-denied" || p35.approval?.approved !== void 0;
1622
1635
  }
1623
1636
  function normalizeToolRef(ref) {
1624
1637
  if (typeof ref === "string") return ref ? { code: ref } : null;
@@ -1626,24 +1639,23 @@ function normalizeToolRef(ref) {
1626
1639
  }
1627
1640
  function messageToWireParts(m) {
1628
1641
  const out = [];
1629
- for (const p33 of m.parts) {
1630
- if (p33.kind === "text" && p33.text) {
1631
- out.push({ text: p33.text, type: "text" });
1642
+ for (const p35 of m.parts) {
1643
+ if (p35.kind === "text" && p35.text) {
1644
+ out.push({ text: p35.text, type: "text" });
1632
1645
  }
1633
- if (p33.kind === "file" && p33.url) {
1634
- out.push({ mediaType: p33.mediaType, type: "file", url: p33.url });
1646
+ if (p35.kind === "file" && p35.url) {
1647
+ out.push({ mediaType: p35.mediaType, type: "file", url: p35.url });
1635
1648
  }
1636
- if (p33.kind === "tool" && isResolvedToolPart(p33)) {
1649
+ if (p35.kind === "tool" && isResolvedToolPart(p35)) {
1637
1650
  const part = {
1638
- type: "tool",
1639
- toolCallId: p33.toolCallId,
1640
- toolName: p33.toolName,
1641
- state: p33.state
1651
+ type: toolPartType(p35.toolName),
1652
+ toolCallId: p35.toolCallId,
1653
+ state: p35.state
1642
1654
  };
1643
- if (p33.input !== void 0) part.input = p33.input;
1644
- if (p33.output !== void 0) part.output = p33.output;
1645
- if (p33.error !== void 0) part.errorText = p33.error;
1646
- if (p33.approval && p33.approval.approved !== void 0) part.approval = p33.approval;
1655
+ if (p35.input !== void 0) part.input = p35.input;
1656
+ if (p35.output !== void 0) part.output = p35.output;
1657
+ if (p35.error !== void 0) part.errorText = p35.error;
1658
+ if (p35.approval && p35.approval.approved !== void 0) part.approval = p35.approval;
1647
1659
  out.push(part);
1648
1660
  }
1649
1661
  }
@@ -2026,9 +2038,9 @@ var AgentTransport = class {
2026
2038
  log5.debug("message \u2192", {
2027
2039
  conversationId: body.conversationId,
2028
2040
  visitorId: body.visitorId,
2041
+ messageId: body.messageId,
2029
2042
  messageCount: body.messages.length,
2030
2043
  trigger: body.trigger,
2031
- responseMode: body.data?.responseMode,
2032
2044
  tools: body.data?.tools?.map((t) => t.code)
2033
2045
  });
2034
2046
  const ctrl = new AbortController();
@@ -2340,11 +2352,23 @@ function fromWireMessage(w) {
2340
2352
  if (part.type === "file") {
2341
2353
  return { kind: "file", url: part.url, mediaType: part.mediaType };
2342
2354
  }
2343
- if (part.type === "tool") {
2355
+ if (part.type === "source-url") {
2356
+ return { kind: "source", sourceId: part.sourceId, url: part.url, title: part.title };
2357
+ }
2358
+ if (part.type === "source-document") {
2359
+ return {
2360
+ kind: "source",
2361
+ sourceId: part.sourceId,
2362
+ title: part.title,
2363
+ filename: part.filename,
2364
+ mediaType: part.mediaType
2365
+ };
2366
+ }
2367
+ if (part.type.startsWith("tool-")) {
2344
2368
  return {
2345
2369
  kind: "tool",
2346
2370
  toolCallId: part.toolCallId,
2347
- toolName: part.toolName,
2371
+ toolName: toolNameFromType(part.type),
2348
2372
  inputPartialSig: signal(""),
2349
2373
  inputSig: signal(part.input),
2350
2374
  outputSig: signal(part.output),
@@ -2354,7 +2378,7 @@ function fromWireMessage(w) {
2354
2378
  };
2355
2379
  }
2356
2380
  return null;
2357
- }).filter((p33) => p33 !== null);
2381
+ }).filter((p35) => p35 !== null);
2358
2382
  return {
2359
2383
  id: w.id,
2360
2384
  role: w.role,
@@ -2384,61 +2408,47 @@ function assistantText(m) {
2384
2408
  }
2385
2409
  return out;
2386
2410
  }
2387
- function partToReactive(p33) {
2388
- if (p33.kind === "text" || p33.kind === "reasoning") {
2389
- return { kind: p33.kind, id: p33.id, textSig: signal(p33.text), doneSig: signal(p33.done) };
2411
+ function partToReactive(p35) {
2412
+ if (p35.kind === "text" || p35.kind === "reasoning") {
2413
+ return { kind: p35.kind, id: p35.id, textSig: signal(p35.text), doneSig: signal(p35.done) };
2390
2414
  }
2391
- if (p33.kind === "tool") {
2415
+ if (p35.kind === "tool") {
2392
2416
  return {
2393
2417
  kind: "tool",
2394
- toolCallId: p33.toolCallId,
2395
- toolName: p33.toolName,
2396
- inputPartialSig: signal(p33.inputPartial),
2397
- inputSig: signal(p33.input),
2398
- outputSig: signal(p33.output),
2399
- errorSig: signal(p33.error),
2400
- stateSig: signal(p33.state),
2401
- approvalSig: signal(p33.approval)
2418
+ toolCallId: p35.toolCallId,
2419
+ toolName: p35.toolName,
2420
+ inputPartialSig: signal(p35.inputPartial),
2421
+ inputSig: signal(p35.input),
2422
+ outputSig: signal(p35.output),
2423
+ errorSig: signal(p35.error),
2424
+ stateSig: signal(p35.state),
2425
+ approvalSig: signal(p35.approval)
2402
2426
  };
2403
2427
  }
2404
- return p33;
2428
+ return p35;
2405
2429
  }
2406
- function partFromReactive(p33) {
2407
- if (p33.kind === "text" || p33.kind === "reasoning") {
2408
- return { kind: p33.kind, id: p33.id, text: p33.textSig.value, done: p33.doneSig.value };
2430
+ function partFromReactive(p35) {
2431
+ if (p35.kind === "text" || p35.kind === "reasoning") {
2432
+ return { kind: p35.kind, id: p35.id, text: p35.textSig.value, done: p35.doneSig.value };
2409
2433
  }
2410
- if (p33.kind === "tool") {
2434
+ if (p35.kind === "tool") {
2411
2435
  return {
2412
2436
  kind: "tool",
2413
- toolCallId: p33.toolCallId,
2414
- toolName: p33.toolName,
2415
- inputPartial: p33.inputPartialSig.value,
2416
- input: p33.inputSig.value,
2417
- output: p33.outputSig.value,
2418
- error: p33.errorSig.value,
2419
- state: p33.stateSig.value,
2420
- approval: p33.approvalSig.value
2437
+ toolCallId: p35.toolCallId,
2438
+ toolName: p35.toolName,
2439
+ inputPartial: p35.inputPartialSig.value,
2440
+ input: p35.inputSig.value,
2441
+ output: p35.outputSig.value,
2442
+ error: p35.errorSig.value,
2443
+ state: p35.stateSig.value,
2444
+ approval: p35.approvalSig.value
2421
2445
  };
2422
2446
  }
2423
- return p33;
2447
+ return p35;
2424
2448
  }
2425
2449
 
2426
2450
  // src/stream/reducer.ts
2427
2451
  import { signal as signal2 } from "@preact/signals";
2428
-
2429
- // src/stream/constants.ts
2430
- function isAskUserInputTool(toolName) {
2431
- if (!toolName) return false;
2432
- const name = toolName.startsWith("tool:") ? toolName.slice(5) : toolName;
2433
- return name === "ask-user-input" || name === "ask_user_input" || name === "request-user-input" || name === "request_user_input";
2434
- }
2435
- var TRIGGER = {
2436
- submitMessage: "submit-message",
2437
- toolResult: "tool-result",
2438
- toolApproval: "tool-approval"
2439
- };
2440
-
2441
- // src/stream/reducer.ts
2442
2452
  var log6 = logger.scope("reducer");
2443
2453
  var StreamReducer = class {
2444
2454
  constructor(messagesSig) {
@@ -2476,8 +2486,8 @@ var StreamReducer = class {
2476
2486
  ensureTextPart(m, "text", chunk.id);
2477
2487
  return;
2478
2488
  case "text-delta": {
2479
- const p33 = ensureTextPart(m, "text", chunk.id);
2480
- p33.textSig.value += chunk.delta;
2489
+ const p35 = ensureTextPart(m, "text", chunk.id);
2490
+ p35.textSig.value += chunk.delta;
2481
2491
  return;
2482
2492
  }
2483
2493
  case "text-end":
@@ -2487,8 +2497,8 @@ var StreamReducer = class {
2487
2497
  ensureTextPart(m, "reasoning", chunk.id).doneSig.value = false;
2488
2498
  return;
2489
2499
  case "reasoning-delta": {
2490
- const p33 = ensureTextPart(m, "reasoning", chunk.id);
2491
- p33.textSig.value += chunk.delta;
2500
+ const p35 = ensureTextPart(m, "reasoning", chunk.id);
2501
+ p35.textSig.value += chunk.delta;
2492
2502
  return;
2493
2503
  }
2494
2504
  case "reasoning-end":
@@ -2499,18 +2509,25 @@ var StreamReducer = class {
2499
2509
  case "tool-input-available":
2500
2510
  case "tool-output-available":
2501
2511
  case "tool-output-error":
2512
+ case "tool-output-denied":
2502
2513
  case "tool-approval-request":
2503
2514
  applyTool(m, chunk);
2504
2515
  return;
2505
2516
  case "file":
2506
2517
  appendPart(m, { kind: "file", url: chunk.url, mediaType: chunk.mediaType });
2507
2518
  return;
2508
- case "source-url": {
2509
- const parts = m.partsSig.value;
2510
- if (parts.some((p33) => p33.kind === "source" && p33.sourceId === chunk.sourceId)) return;
2511
- appendPart(m, { kind: "source", sourceId: chunk.sourceId, url: chunk.url, title: chunk.title });
2519
+ case "source-url":
2520
+ appendSource(m, { kind: "source", sourceId: chunk.sourceId, url: chunk.url, title: chunk.title });
2521
+ return;
2522
+ case "source-document":
2523
+ appendSource(m, {
2524
+ kind: "source",
2525
+ sourceId: chunk.sourceId,
2526
+ title: chunk.title,
2527
+ filename: chunk.filename,
2528
+ mediaType: chunk.mediaType
2529
+ });
2512
2530
  return;
2513
- }
2514
2531
  case "data-notification":
2515
2532
  return;
2516
2533
  default: {
@@ -2531,14 +2548,14 @@ var StreamReducer = class {
2531
2548
  }
2532
2549
  };
2533
2550
  function ensureTextPart(m, kind, id) {
2534
- const existing = m.partsSig.value.find((p33) => p33.kind === kind && p33.id === id);
2551
+ const existing = m.partsSig.value.find((p35) => p35.kind === kind && p35.id === id);
2535
2552
  if (existing) return existing;
2536
2553
  const part = { kind, id, textSig: signal2(""), doneSig: signal2(false) };
2537
2554
  appendPart(m, part);
2538
2555
  return part;
2539
2556
  }
2540
2557
  function ensureToolPart(m, toolCallId, toolName) {
2541
- const existing = m.partsSig.value.find((p33) => p33.kind === "tool" && p33.toolCallId === toolCallId);
2558
+ const existing = m.partsSig.value.find((p35) => p35.kind === "tool" && p35.toolCallId === toolCallId);
2542
2559
  if (existing) return existing;
2543
2560
  const part = {
2544
2561
  kind: "tool",
@@ -2548,7 +2565,7 @@ function ensureToolPart(m, toolCallId, toolName) {
2548
2565
  inputSig: signal2(void 0),
2549
2566
  outputSig: signal2(void 0),
2550
2567
  errorSig: signal2(void 0),
2551
- stateSig: signal2("input"),
2568
+ stateSig: signal2("input-streaming"),
2552
2569
  approvalSig: signal2(void 0)
2553
2570
  };
2554
2571
  appendPart(m, part);
@@ -2557,38 +2574,47 @@ function ensureToolPart(m, toolCallId, toolName) {
2557
2574
  function appendPart(m, part) {
2558
2575
  m.partsSig.value = [...m.partsSig.value, part];
2559
2576
  }
2577
+ function appendSource(m, source) {
2578
+ if (m.partsSig.value.some((p35) => p35.kind === "source" && p35.sourceId === source.sourceId)) return;
2579
+ appendPart(m, source);
2580
+ }
2560
2581
  function applyTool(m, chunk) {
2561
2582
  switch (chunk.type) {
2562
2583
  case "tool-input-start":
2563
2584
  ensureToolPart(m, chunk.toolCallId, chunk.toolName);
2564
2585
  return;
2565
2586
  case "tool-input-delta": {
2566
- const p33 = ensureToolPart(m, chunk.toolCallId);
2567
- p33.inputPartialSig.value += chunk.delta;
2587
+ const p35 = ensureToolPart(m, chunk.toolCallId);
2588
+ p35.inputPartialSig.value += chunk.inputTextDelta;
2568
2589
  return;
2569
2590
  }
2570
2591
  case "tool-input-available": {
2571
- const p33 = ensureToolPart(m, chunk.toolCallId, chunk.toolName);
2572
- p33.inputSig.value = chunk.input;
2573
- p33.stateSig.value = isAskUserInputTool(p33.toolName) ? "awaiting-input" : "awaiting";
2592
+ const p35 = ensureToolPart(m, chunk.toolCallId, chunk.toolName);
2593
+ p35.inputSig.value = chunk.input;
2594
+ p35.stateSig.value = "input-available";
2574
2595
  return;
2575
2596
  }
2576
2597
  case "tool-approval-request": {
2577
- const p33 = ensureToolPart(m, chunk.toolCallId, chunk.toolName);
2578
- p33.approvalSig.value = { id: chunk.approvalId };
2579
- p33.stateSig.value = "awaiting-approval";
2598
+ const p35 = ensureToolPart(m, chunk.toolCallId, chunk.toolName);
2599
+ p35.approvalSig.value = { id: chunk.approvalId };
2600
+ p35.stateSig.value = "approval-requested";
2580
2601
  return;
2581
2602
  }
2582
2603
  case "tool-output-available": {
2583
- const p33 = ensureToolPart(m, chunk.toolCallId);
2584
- p33.outputSig.value = chunk.output;
2585
- p33.stateSig.value = "output";
2604
+ const p35 = ensureToolPart(m, chunk.toolCallId);
2605
+ p35.outputSig.value = chunk.output;
2606
+ p35.stateSig.value = "output-available";
2586
2607
  return;
2587
2608
  }
2588
2609
  case "tool-output-error": {
2589
- const p33 = ensureToolPart(m, chunk.toolCallId);
2590
- p33.errorSig.value = chunk.errorText;
2591
- p33.stateSig.value = "error";
2610
+ const p35 = ensureToolPart(m, chunk.toolCallId);
2611
+ p35.errorSig.value = chunk.errorText;
2612
+ p35.stateSig.value = "output-error";
2613
+ return;
2614
+ }
2615
+ case "tool-output-denied": {
2616
+ const p35 = ensureToolPart(m, chunk.toolCallId);
2617
+ p35.stateSig.value = "output-denied";
2592
2618
  return;
2593
2619
  }
2594
2620
  default:
@@ -3170,7 +3196,11 @@ var TID = {
3170
3196
  /** Tool-approval reject button. */
3171
3197
  toolReject: `${p2}-tool-reject`,
3172
3198
  /** Recorded tool decision summary (after approve/reject/submit). */
3173
- toolDecision: `${p2}-tool-decision`
3199
+ toolDecision: `${p2}-tool-decision`,
3200
+ /** Automatic (non-interactive) tool-call disclosure — shown only when `showToolCalls`. */
3201
+ toolCall: `${p2}-tool-call`,
3202
+ /** A citation source (web link or document reference) — shown only when `showSources`. */
3203
+ source: `${p2}-source`
3174
3204
  };
3175
3205
  function tid(base, suffix) {
3176
3206
  return `${base}-${suffix}`;
@@ -3281,24 +3311,24 @@ import { useCallback as useCallback2, useEffect as useEffect9, useRef as useRef6
3281
3311
  import { useEffect as useEffect2, useRef } from "preact/hooks";
3282
3312
  import { jsx as jsx3 } from "preact/jsx-runtime";
3283
3313
  function ResizeGrip({ panelEl, resize, position, initialSize, onSizeChange, strings }) {
3284
- const p33 = BRAND.cssPrefix;
3314
+ const p35 = BRAND.cssPrefix;
3285
3315
  const dragRef = useRef(null);
3286
3316
  useEffect2(() => {
3287
3317
  if (!panelEl) return;
3288
3318
  const style = panelEl.style;
3289
- if (resize.minWidth) style.setProperty(`--${p33}-resize-min-w`, resize.minWidth);
3290
- if (resize.maxWidth) style.setProperty(`--${p33}-resize-max-w`, resize.maxWidth);
3291
- if (resize.minHeight) style.setProperty(`--${p33}-resize-min-h`, resize.minHeight);
3292
- if (resize.maxHeight) style.setProperty(`--${p33}-resize-max-h`, resize.maxHeight);
3319
+ if (resize.minWidth) style.setProperty(`--${p35}-resize-min-w`, resize.minWidth);
3320
+ if (resize.maxWidth) style.setProperty(`--${p35}-resize-max-w`, resize.maxWidth);
3321
+ if (resize.minHeight) style.setProperty(`--${p35}-resize-min-h`, resize.minHeight);
3322
+ if (resize.maxHeight) style.setProperty(`--${p35}-resize-max-h`, resize.maxHeight);
3293
3323
  if (initialSize) {
3294
- style.setProperty(`--${p33}-widget-w`, `${initialSize.width}px`);
3295
- style.setProperty(`--${p33}-widget-h`, `${initialSize.height}px`);
3324
+ style.setProperty(`--${p35}-widget-w`, `${initialSize.width}px`);
3325
+ style.setProperty(`--${p35}-widget-h`, `${initialSize.height}px`);
3296
3326
  }
3297
- }, [panelEl, resize.minWidth, resize.maxWidth, resize.minHeight, resize.maxHeight, p33, initialSize]);
3327
+ }, [panelEl, resize.minWidth, resize.maxWidth, resize.minHeight, resize.maxHeight, p35, initialSize]);
3298
3328
  if (!panelEl) return null;
3299
3329
  const isTop = position.startsWith("top-");
3300
3330
  const isRight = position.endsWith("-right");
3301
- const cornerClass = `${p33}-resize-grip ${p33}-resize-grip--${isTop ? "bottom" : "top"}-${isRight ? "left" : "right"}`;
3331
+ const cornerClass = `${p35}-resize-grip ${p35}-resize-grip--${isTop ? "bottom" : "top"}-${isRight ? "left" : "right"}`;
3302
3332
  const onPointerDown = (e) => {
3303
3333
  if (!panelEl) return;
3304
3334
  const target = e.currentTarget;
@@ -3323,8 +3353,8 @@ function ResizeGrip({ panelEl, resize, position, initialSize, onSizeChange, stri
3323
3353
  if (!d || e.pointerId !== d.pointerId || !panelEl) return;
3324
3354
  const dx = (e.clientX - d.startX) * d.dirX;
3325
3355
  const dy = (e.clientY - d.startY) * d.dirY;
3326
- panelEl.style.setProperty(`--${p33}-widget-w`, `${d.startW + dx}px`);
3327
- panelEl.style.setProperty(`--${p33}-widget-h`, `${d.startH + dy}px`);
3356
+ panelEl.style.setProperty(`--${p35}-widget-w`, `${d.startW + dx}px`);
3357
+ panelEl.style.setProperty(`--${p35}-widget-h`, `${d.startH + dy}px`);
3328
3358
  };
3329
3359
  const onPointerUp = (e) => {
3330
3360
  const d = dragRef.current;
@@ -4061,7 +4091,7 @@ function usePopoverMenu({ itemCount, initialFocusIndex }) {
4061
4091
  // src/ui/overflow-menu.tsx
4062
4092
  import { jsx as jsx8, jsxs as jsxs6 } from "preact/jsx-runtime";
4063
4093
  function OverflowMenu({ items, triggerLabel }) {
4064
- const p33 = BRAND.cssPrefix;
4094
+ const p35 = BRAND.cssPrefix;
4065
4095
  const menu = usePopoverMenu({ itemCount: items.length });
4066
4096
  const handleSelect = (item) => {
4067
4097
  if (item.disabled) return;
@@ -4084,13 +4114,13 @@ function OverflowMenu({ items, triggerLabel }) {
4084
4114
  e.stopPropagation();
4085
4115
  pickSegment(item, segs[next].value);
4086
4116
  };
4087
- return /* @__PURE__ */ jsxs6("div", { class: `${p33}-menu-wrap`, children: [
4117
+ return /* @__PURE__ */ jsxs6("div", { class: `${p35}-menu-wrap`, children: [
4088
4118
  /* @__PURE__ */ jsx8(
4089
4119
  "button",
4090
4120
  {
4091
4121
  ref: menu.triggerRef,
4092
4122
  type: "button",
4093
- class: `${p33}-icon-btn`,
4123
+ class: `${p35}-icon-btn`,
4094
4124
  "aria-label": triggerLabel,
4095
4125
  "aria-haspopup": "menu",
4096
4126
  "aria-expanded": menu.open,
@@ -4104,7 +4134,7 @@ function OverflowMenu({ items, triggerLabel }) {
4104
4134
  "div",
4105
4135
  {
4106
4136
  ref: menu.menuRef,
4107
- class: `${p33}-menu`,
4137
+ class: `${p35}-menu`,
4108
4138
  role: "menu",
4109
4139
  "aria-label": triggerLabel,
4110
4140
  onKeyDown: menu.onMenuKey,
@@ -4114,14 +4144,14 @@ function OverflowMenu({ items, triggerLabel }) {
4114
4144
  "div",
4115
4145
  {
4116
4146
  role: "menuitem",
4117
- class: `${p33}-menu-item ${p33}-menu-item-segmented`,
4147
+ class: `${p35}-menu-item ${p35}-menu-item-segmented`,
4118
4148
  "aria-label": item.label,
4119
4149
  tabIndex: -1,
4120
4150
  onKeyDown: (e) => onSegmentRowKey(e, item),
4121
4151
  children: [
4122
- item.icon ? /* @__PURE__ */ jsx8("span", { class: `${p33}-menu-icon`, children: item.icon }) : null,
4123
- /* @__PURE__ */ jsx8("span", { class: `${p33}-menu-label`, children: item.label }),
4124
- /* @__PURE__ */ jsx8("span", { class: `${p33}-segmented`, role: "group", "aria-label": item.label, children: item.segments.map((seg) => {
4152
+ item.icon ? /* @__PURE__ */ jsx8("span", { class: `${p35}-menu-icon`, children: item.icon }) : null,
4153
+ /* @__PURE__ */ jsx8("span", { class: `${p35}-menu-label`, children: item.label }),
4154
+ /* @__PURE__ */ jsx8("span", { class: `${p35}-segmented`, role: "group", "aria-label": item.label, children: item.segments.map((seg) => {
4125
4155
  const active = seg.value === item.value;
4126
4156
  return /* @__PURE__ */ jsx8(
4127
4157
  "button",
@@ -4129,7 +4159,7 @@ function OverflowMenu({ items, triggerLabel }) {
4129
4159
  type: "button",
4130
4160
  role: "menuitemradio",
4131
4161
  "aria-checked": active,
4132
- class: `${p33}-segment`,
4162
+ class: `${p35}-segment`,
4133
4163
  "data-on": active ? "true" : void 0,
4134
4164
  lang: seg.lang,
4135
4165
  title: seg.value,
@@ -4149,14 +4179,14 @@ function OverflowMenu({ items, triggerLabel }) {
4149
4179
  {
4150
4180
  type: "button",
4151
4181
  role: "menuitem",
4152
- class: `${p33}-menu-item`,
4182
+ class: `${p35}-menu-item`,
4153
4183
  "aria-pressed": item.type === "switch" ? item.on : void 0,
4154
4184
  disabled: item.disabled,
4155
4185
  onClick: () => handleSelect(item),
4156
4186
  children: [
4157
- item.icon ? /* @__PURE__ */ jsx8("span", { class: `${p33}-menu-icon`, children: item.icon }) : null,
4158
- /* @__PURE__ */ jsx8("span", { class: `${p33}-menu-label`, children: item.label }),
4159
- item.type === "switch" && item.on ? /* @__PURE__ */ jsx8("span", { class: `${p33}-menu-check`, "aria-hidden": "true", children: /* @__PURE__ */ jsx8(CheckIcon, {}) }) : null
4187
+ item.icon ? /* @__PURE__ */ jsx8("span", { class: `${p35}-menu-icon`, children: item.icon }) : null,
4188
+ /* @__PURE__ */ jsx8("span", { class: `${p35}-menu-label`, children: item.label }),
4189
+ item.type === "switch" && item.on ? /* @__PURE__ */ jsx8("span", { class: `${p35}-menu-check`, "aria-hidden": "true", children: /* @__PURE__ */ jsx8(CheckIcon, {}) }) : null
4160
4190
  ]
4161
4191
  },
4162
4192
  item.id
@@ -4308,7 +4338,7 @@ function HeaderActions({ panelProps, variant }) {
4308
4338
 
4309
4339
  // src/ui/message-list.tsx
4310
4340
  import { useEffect as useEffect7, useLayoutEffect as useLayoutEffect2, useRef as useRef5, useState as useState6 } from "preact/hooks";
4311
- import { useComputed as useComputed5 } from "@preact/signals";
4341
+ import { useComputed as useComputed6 } from "@preact/signals";
4312
4342
 
4313
4343
  // src/ui/form/dynamic-form.tsx
4314
4344
  import { useState as useState5 } from "preact/hooks";
@@ -4696,7 +4726,14 @@ function FormDoneMarker({
4696
4726
  }
4697
4727
 
4698
4728
  // src/ui/message-bubble.tsx
4699
- import { useComputed as useComputed4 } from "@preact/signals";
4729
+ import { useComputed as useComputed5 } from "@preact/signals";
4730
+
4731
+ // src/stream/constants.ts
4732
+ function isAskUserInputTool(toolName) {
4733
+ if (!toolName) return false;
4734
+ const name = toolName.startsWith("tool:") ? toolName.slice(5) : toolName;
4735
+ return name === "ask-user-input" || name === "ask_user_input" || name === "request-user-input" || name === "request_user_input";
4736
+ }
4700
4737
 
4701
4738
  // src/ui/markdown.tsx
4702
4739
  import { useLayoutEffect, useMemo, useRef as useRef4 } from "preact/hooks";
@@ -4769,10 +4806,27 @@ function hardenLink(a) {
4769
4806
  a.rel = [...tokens].join(" ");
4770
4807
  }
4771
4808
 
4809
+ // src/ui/source-view.tsx
4810
+ import { jsx as jsx13, jsxs as jsxs10 } from "preact/jsx-runtime";
4811
+ var p12 = BRAND.cssPrefix;
4812
+ function SourceView({ part, strings }) {
4813
+ const label = part.title || part.filename || part.url || strings.sources;
4814
+ if (part.url) {
4815
+ return /* @__PURE__ */ jsxs10("a", { class: `${p12}-source`, href: part.url, target: "_blank", rel: "noreferrer noopener", "data-testid": TID.source, children: [
4816
+ /* @__PURE__ */ jsx13("span", { class: `${p12}-source-icon`, "aria-hidden": "true", children: "\u{1F517}" }),
4817
+ /* @__PURE__ */ jsx13("span", { class: `${p12}-source-label`, children: label })
4818
+ ] });
4819
+ }
4820
+ return /* @__PURE__ */ jsxs10("span", { class: `${p12}-source`, "data-testid": TID.source, children: [
4821
+ /* @__PURE__ */ jsx13("span", { class: `${p12}-source-icon`, "aria-hidden": "true", children: "\u{1F4C4}" }),
4822
+ /* @__PURE__ */ jsx13("span", { class: `${p12}-source-label`, children: label })
4823
+ ] });
4824
+ }
4825
+
4772
4826
  // src/ui/tool-approval.tsx
4773
4827
  import { useComputed as useComputed2, useSignal } from "@preact/signals";
4774
- import { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs10 } from "preact/jsx-runtime";
4775
- var p12 = BRAND.cssPrefix;
4828
+ import { Fragment as Fragment2, jsx as jsx14, jsxs as jsxs11 } from "preact/jsx-runtime";
4829
+ var p13 = BRAND.cssPrefix;
4776
4830
  function displayToolName(toolName) {
4777
4831
  return (toolName.startsWith("tool:") ? toolName.slice(5) : toolName).replace(/[-_]+/g, " ");
4778
4832
  }
@@ -4783,24 +4837,24 @@ function ToolApproval({ part, strings, active, onDecision }) {
4783
4837
  const decided = approval.value?.approved !== void 0;
4784
4838
  if (decided) {
4785
4839
  const ap = approval.value;
4786
- return /* @__PURE__ */ jsxs10("div", { class: `${p12}-tool-approval ${p12}-tool-decided`, "data-testid": TID.toolDecision, children: [
4787
- /* @__PURE__ */ jsx13("span", { class: `${p12}-tool-decided-label`, "data-approved": ap?.approved ? "true" : "false", children: ap?.approved ? strings.approved : strings.rejected }),
4788
- /* @__PURE__ */ jsx13("strong", { class: `${p12}-tool-title`, children: displayToolName(part.toolName) }),
4789
- ap?.reason ? /* @__PURE__ */ jsx13("span", { class: `${p12}-tool-decided-value`, children: ap.reason }) : null
4840
+ return /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-approval ${p13}-tool-decided`, "data-testid": TID.toolDecision, children: [
4841
+ /* @__PURE__ */ jsx14("span", { class: `${p13}-tool-decided-label`, "data-approved": ap?.approved ? "true" : "false", children: ap?.approved ? strings.approved : strings.rejected }),
4842
+ /* @__PURE__ */ jsx14("strong", { class: `${p13}-tool-title`, children: displayToolName(part.toolName) }),
4843
+ ap?.reason ? /* @__PURE__ */ jsx14("span", { class: `${p13}-tool-decided-value`, children: ap.reason }) : null
4790
4844
  ] });
4791
4845
  }
4792
4846
  const args = summarizeInput(input.value);
4793
- return /* @__PURE__ */ jsxs10("div", { class: `${p12}-tool-approval`, "data-testid": TID.toolApproval, children: [
4794
- /* @__PURE__ */ jsxs10("div", { class: `${p12}-tool-head`, children: [
4795
- /* @__PURE__ */ jsx13("span", { class: `${p12}-tool-badge`, children: strings.approvalRequired }),
4796
- /* @__PURE__ */ jsx13("strong", { class: `${p12}-tool-title`, children: displayToolName(part.toolName) })
4847
+ return /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-approval`, "data-testid": TID.toolApproval, children: [
4848
+ /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-head`, children: [
4849
+ /* @__PURE__ */ jsx14("span", { class: `${p13}-tool-badge`, children: strings.approvalRequired }),
4850
+ /* @__PURE__ */ jsx14("strong", { class: `${p13}-tool-title`, children: displayToolName(part.toolName) })
4797
4851
  ] }),
4798
- args ? /* @__PURE__ */ jsx13("pre", { class: `${p12}-tool-args`, children: args }) : null,
4799
- active ? /* @__PURE__ */ jsxs10(Fragment2, { children: [
4800
- /* @__PURE__ */ jsx13(
4852
+ args ? /* @__PURE__ */ jsx14("pre", { class: `${p13}-tool-args`, children: args }) : null,
4853
+ active ? /* @__PURE__ */ jsxs11(Fragment2, { children: [
4854
+ /* @__PURE__ */ jsx14(
4801
4855
  "input",
4802
4856
  {
4803
- class: `${p12}-field-input`,
4857
+ class: `${p13}-field-input`,
4804
4858
  value: reason.value,
4805
4859
  placeholder: strings.approvalReason,
4806
4860
  onInput: (e) => {
@@ -4808,29 +4862,29 @@ function ToolApproval({ part, strings, active, onDecision }) {
4808
4862
  }
4809
4863
  }
4810
4864
  ),
4811
- /* @__PURE__ */ jsxs10("div", { class: `${p12}-form-actions`, children: [
4812
- /* @__PURE__ */ jsx13(
4865
+ /* @__PURE__ */ jsxs11("div", { class: `${p13}-form-actions`, children: [
4866
+ /* @__PURE__ */ jsx14(
4813
4867
  "button",
4814
4868
  {
4815
4869
  type: "button",
4816
- class: `${p12}-tool-reject`,
4870
+ class: `${p13}-tool-reject`,
4817
4871
  onClick: () => onDecision(part.toolCallId, false, reason.value.trim() || void 0),
4818
4872
  "data-testid": TID.toolReject,
4819
4873
  children: strings.reject
4820
4874
  }
4821
4875
  ),
4822
- /* @__PURE__ */ jsx13(
4876
+ /* @__PURE__ */ jsx14(
4823
4877
  "button",
4824
4878
  {
4825
4879
  type: "button",
4826
- class: `${p12}-tool-approve`,
4880
+ class: `${p13}-tool-approve`,
4827
4881
  onClick: () => onDecision(part.toolCallId, true, reason.value.trim() || void 0),
4828
4882
  "data-testid": TID.toolApprove,
4829
4883
  children: strings.approve
4830
4884
  }
4831
4885
  )
4832
4886
  ] })
4833
- ] }) : /* @__PURE__ */ jsx13("p", { class: `${p12}-tool-stale-note`, children: strings.stepNoLongerActive })
4887
+ ] }) : /* @__PURE__ */ jsx14("p", { class: `${p13}-tool-stale-note`, children: strings.stepNoLongerActive })
4834
4888
  ] });
4835
4889
  }
4836
4890
  function summarizeInput(input) {
@@ -4901,13 +4955,13 @@ function num(v) {
4901
4955
  }
4902
4956
 
4903
4957
  // src/ui/tool-ask-input.tsx
4904
- import { jsx as jsx14, jsxs as jsxs11 } from "preact/jsx-runtime";
4905
- var p13 = BRAND.cssPrefix;
4958
+ import { jsx as jsx15, jsxs as jsxs12 } from "preact/jsx-runtime";
4959
+ var p14 = BRAND.cssPrefix;
4906
4960
  function ToolAskInput({ part, strings, active, onSubmit, onDecision }) {
4907
4961
  const state = useComputed3(() => part.stateSig.value);
4908
4962
  const approval = useComputed3(() => part.approvalSig.value);
4909
4963
  const request = useComputed3(() => parseAskUserInput(part.inputSig.value));
4910
- const decided = state.value === "output" || state.value === "error" || approval.value?.approved !== void 0;
4964
+ const decided = state.value === "output-available" || state.value === "output-error" || state.value === "output-denied" || state.value === "approval-responded" || approval.value?.approved !== void 0;
4911
4965
  const viaApproval = approval.value !== void 0;
4912
4966
  const resolve = (answer, accepted) => {
4913
4967
  if (viaApproval) onDecision(part.toolCallId, accepted, answer);
@@ -4915,42 +4969,42 @@ function ToolAskInput({ part, strings, active, onSubmit, onDecision }) {
4915
4969
  else onSubmit(part.toolCallId, accepted ? { answer } : {});
4916
4970
  };
4917
4971
  if (decided) {
4918
- return /* @__PURE__ */ jsx14(DecidedSummary, { part, strings });
4972
+ return /* @__PURE__ */ jsx15(DecidedSummary, { part, strings });
4919
4973
  }
4920
4974
  if (!active) {
4921
- return /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-ask-input ${p13}-tool-stale`, "data-testid": TID.toolAskInput, children: [
4922
- /* @__PURE__ */ jsx14(Header, { strings, title: request.value.title ?? request.value.question }),
4923
- /* @__PURE__ */ jsx14("p", { class: `${p13}-tool-stale-note`, children: strings.stepNoLongerActive })
4975
+ return /* @__PURE__ */ jsxs12("div", { class: `${p14}-tool-ask-input ${p14}-tool-stale`, "data-testid": TID.toolAskInput, children: [
4976
+ /* @__PURE__ */ jsx15(Header, { strings, title: request.value.title ?? request.value.question }),
4977
+ /* @__PURE__ */ jsx15("p", { class: `${p14}-tool-stale-note`, children: strings.stepNoLongerActive })
4924
4978
  ] });
4925
4979
  }
4926
4980
  const req = request.value;
4927
4981
  const isConfirmation = req.responseType === "confirmation";
4928
- return /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-ask-input`, "data-testid": TID.toolAskInput, children: [
4929
- /* @__PURE__ */ jsx14(Header, { strings, title: req.title }),
4930
- req.description ? /* @__PURE__ */ jsx14("p", { class: `${p13}-tool-desc`, children: req.description }) : null,
4931
- isConfirmation ? /* @__PURE__ */ jsx14("p", { class: `${p13}-tool-question`, children: req.question }) : null,
4932
- isConfirmation ? /* @__PURE__ */ jsxs11("div", { class: `${p13}-form-actions`, children: [
4933
- /* @__PURE__ */ jsx14(
4982
+ return /* @__PURE__ */ jsxs12("div", { class: `${p14}-tool-ask-input`, "data-testid": TID.toolAskInput, children: [
4983
+ /* @__PURE__ */ jsx15(Header, { strings, title: req.title }),
4984
+ req.description ? /* @__PURE__ */ jsx15("p", { class: `${p14}-tool-desc`, children: req.description }) : null,
4985
+ isConfirmation ? /* @__PURE__ */ jsx15("p", { class: `${p14}-tool-question`, children: req.question }) : null,
4986
+ isConfirmation ? /* @__PURE__ */ jsxs12("div", { class: `${p14}-form-actions`, children: [
4987
+ /* @__PURE__ */ jsx15(
4934
4988
  "button",
4935
4989
  {
4936
4990
  type: "button",
4937
- class: `${p13}-form-skip`,
4991
+ class: `${p14}-form-skip`,
4938
4992
  onClick: () => resolve(void 0, false),
4939
4993
  "data-testid": TID.toolInputSkip,
4940
4994
  children: strings.reject
4941
4995
  }
4942
4996
  ),
4943
- /* @__PURE__ */ jsx14(
4997
+ /* @__PURE__ */ jsx15(
4944
4998
  "button",
4945
4999
  {
4946
5000
  type: "button",
4947
- class: `${p13}-form-submit`,
5001
+ class: `${p14}-form-submit`,
4948
5002
  onClick: () => resolve(void 0, true),
4949
5003
  "data-testid": TID.toolInputSubmit,
4950
5004
  children: strings.approve
4951
5005
  }
4952
5006
  )
4953
- ] }) : /* @__PURE__ */ jsx14(
5007
+ ] }) : /* @__PURE__ */ jsx15(
4954
5008
  DynamicForm,
4955
5009
  {
4956
5010
  fields: askInputToFields(req),
@@ -4966,9 +5020,9 @@ function ToolAskInput({ part, strings, active, onSubmit, onDecision }) {
4966
5020
  ] });
4967
5021
  }
4968
5022
  function Header({ strings, title }) {
4969
- return /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-head`, children: [
4970
- /* @__PURE__ */ jsx14("span", { class: `${p13}-tool-badge`, children: strings.inputRequired }),
4971
- title ? /* @__PURE__ */ jsx14("strong", { class: `${p13}-tool-title`, children: title }) : null
5023
+ return /* @__PURE__ */ jsxs12("div", { class: `${p14}-tool-head`, children: [
5024
+ /* @__PURE__ */ jsx15("span", { class: `${p14}-tool-badge`, children: strings.inputRequired }),
5025
+ title ? /* @__PURE__ */ jsx15("strong", { class: `${p14}-tool-title`, children: title }) : null
4972
5026
  ] });
4973
5027
  }
4974
5028
  function DecidedSummary({ part, strings }) {
@@ -4976,9 +5030,9 @@ function DecidedSummary({ part, strings }) {
4976
5030
  const approval = useComputed3(() => part.approvalSig.value);
4977
5031
  const answer = approval.value?.approved !== void 0 ? approval.value.reason ?? "" : summarizeOutput(output.value);
4978
5032
  const skipped = approval.value?.approved === false;
4979
- return /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-ask-input ${p13}-tool-decided`, "data-testid": TID.toolDecision, children: [
4980
- /* @__PURE__ */ jsx14("span", { class: `${p13}-tool-decided-label`, children: skipped ? strings.inputSkip : strings.inputSubmitted }),
4981
- /* @__PURE__ */ jsx14("span", { class: `${p13}-tool-decided-value`, children: skipped ? "" : answer || strings.inputSubmitted })
5033
+ return /* @__PURE__ */ jsxs12("div", { class: `${p14}-tool-ask-input ${p14}-tool-decided`, "data-testid": TID.toolDecision, children: [
5034
+ /* @__PURE__ */ jsx15("span", { class: `${p14}-tool-decided-label`, children: skipped ? strings.inputSkip : strings.inputSubmitted }),
5035
+ /* @__PURE__ */ jsx15("span", { class: `${p14}-tool-decided-value`, children: skipped ? "" : answer || strings.inputSubmitted })
4982
5036
  ] });
4983
5037
  }
4984
5038
  function summarizeOutput(output) {
@@ -4992,37 +5046,70 @@ function summarizeOutput(output) {
4992
5046
  return String(output);
4993
5047
  }
4994
5048
 
4995
- // src/ui/tool-chip.tsx
4996
- import { jsx as jsx15, jsxs as jsxs12 } from "preact/jsx-runtime";
4997
- function ToolChip({ part, strings }) {
4998
- const p33 = BRAND.cssPrefix;
4999
- return /* @__PURE__ */ jsxs12("span", { class: `${p33}-tool-chip`, role: "status", children: [
5000
- /* @__PURE__ */ jsxs12("span", { children: [
5001
- strings.usedTool,
5002
- ":"
5049
+ // src/ui/tool-call.tsx
5050
+ import { useComputed as useComputed4 } from "@preact/signals";
5051
+ import { jsx as jsx16, jsxs as jsxs13 } from "preact/jsx-runtime";
5052
+ var p15 = BRAND.cssPrefix;
5053
+ function displayToolName2(toolName) {
5054
+ return (toolName.startsWith("tool:") ? toolName.slice(5) : toolName).replace(/[-_]+/g, " ").trim();
5055
+ }
5056
+ function ToolCall({ part, strings }) {
5057
+ const details = useComputed4(() => pretty(part.inputSig.value));
5058
+ const result = useComputed4(() => part.errorSig.value ?? pretty(unwrapResult(part.outputSig.value)));
5059
+ const isError = useComputed4(() => !!part.errorSig.value);
5060
+ if (!details.value && !result.value) return null;
5061
+ return /* @__PURE__ */ jsxs13("details", { class: `${p15}-tool-call`, "data-testid": TID.toolCall, children: [
5062
+ /* @__PURE__ */ jsxs13("summary", { class: `${p15}-tool-call-summary`, children: [
5063
+ /* @__PURE__ */ jsx16("span", { class: `${p15}-tool-badge`, children: strings.usedTool }),
5064
+ /* @__PURE__ */ jsx16("strong", { class: `${p15}-tool-title`, children: displayToolName2(part.toolName) })
5003
5065
  ] }),
5004
- /* @__PURE__ */ jsx15("strong", { children: part.toolName })
5066
+ details.value ? /* @__PURE__ */ jsxs13("div", { class: `${p15}-tool-call-section`, children: [
5067
+ /* @__PURE__ */ jsx16("span", { class: `${p15}-tool-call-label`, children: strings.toolDetails }),
5068
+ /* @__PURE__ */ jsx16("pre", { class: `${p15}-tool-args`, children: details.value })
5069
+ ] }) : null,
5070
+ result.value ? /* @__PURE__ */ jsxs13("div", { class: `${p15}-tool-call-section`, "data-error": isError.value ? "true" : void 0, children: [
5071
+ /* @__PURE__ */ jsx16("span", { class: `${p15}-tool-call-label`, children: strings.toolResult }),
5072
+ /* @__PURE__ */ jsx16("pre", { class: `${p15}-tool-args`, children: result.value })
5073
+ ] }) : null
5005
5074
  ] });
5006
5075
  }
5076
+ function unwrapResult(output) {
5077
+ if (output && typeof output === "object") {
5078
+ const rec = output;
5079
+ if (rec.storage === "tool-result-ref" && "summary" in rec) return rec.summary;
5080
+ }
5081
+ return output;
5082
+ }
5083
+ function pretty(value) {
5084
+ if (value == null) return "";
5085
+ try {
5086
+ const json = typeof value === "string" ? value : JSON.stringify(value, null, 2);
5087
+ if (!json || json === "{}" || json === "[]" || json === '""') return "";
5088
+ return json.length > 600 ? `${json.slice(0, 600)}\u2026` : json;
5089
+ } catch {
5090
+ return "";
5091
+ }
5092
+ }
5007
5093
 
5008
5094
  // src/ui/message-bubble.tsx
5009
- import { jsx as jsx16, jsxs as jsxs13 } from "preact/jsx-runtime";
5010
- var p14 = BRAND.cssPrefix;
5095
+ import { jsx as jsx17, jsxs as jsxs14 } from "preact/jsx-runtime";
5096
+ var p16 = BRAND.cssPrefix;
5011
5097
  function MessageBubble({
5012
5098
  message,
5013
5099
  strings,
5014
5100
  responseMode,
5015
5101
  showReasoning,
5016
5102
  showToolCalls,
5103
+ showSources,
5017
5104
  interactive = false,
5018
5105
  tool
5019
5106
  }) {
5020
- const parts = useComputed4(() => message.partsSig.value);
5107
+ const parts = useComputed5(() => message.partsSig.value);
5021
5108
  const partList = parts.value;
5022
- const hasAnswerText = useComputed4(
5109
+ const hasAnswerText = useComputed5(
5023
5110
  () => message.partsSig.value.some((part) => part.kind === "text" && part.textSig.value.length > 0)
5024
5111
  );
5025
- const reasoningVisible = useComputed4(
5112
+ const reasoningVisible = useComputed5(
5026
5113
  () => showReasoning && message.partsSig.value.some((part) => part.kind === "reasoning")
5027
5114
  );
5028
5115
  const streaming = message.role === "assistant" && message.status === "streaming";
@@ -5030,9 +5117,9 @@ function MessageBubble({
5030
5117
  const working = streaming && !hasAnswerText.value;
5031
5118
  const showStreamDots = streaming && !bufferedHold && !(reasoningVisible.value && working);
5032
5119
  const stamp = formatStamp(message.createdAt);
5033
- return /* @__PURE__ */ jsx16("div", { class: `${p14}-bubble-row`, "data-role": message.role, "data-testid": tid(TID.messageBubble, message.id), children: /* @__PURE__ */ jsxs13("div", { class: `${p14}-bubble-col`, children: [
5034
- /* @__PURE__ */ jsxs13("div", { class: `${p14}-bubble`, children: [
5035
- bufferedHold ? /* @__PURE__ */ jsx16(LoadingSpinner, { label: strings.loading }) : partList.map((part) => /* @__PURE__ */ jsx16(
5120
+ return /* @__PURE__ */ jsx17("div", { class: `${p16}-bubble-row`, "data-role": message.role, "data-testid": tid(TID.messageBubble, message.id), children: /* @__PURE__ */ jsxs14("div", { class: `${p16}-bubble-col`, children: [
5121
+ /* @__PURE__ */ jsxs14("div", { class: `${p16}-bubble`, children: [
5122
+ bufferedHold ? /* @__PURE__ */ jsx17(LoadingSpinner, { label: strings.loading }) : partList.map((part) => /* @__PURE__ */ jsx17(
5036
5123
  PartView,
5037
5124
  {
5038
5125
  part,
@@ -5040,15 +5127,16 @@ function MessageBubble({
5040
5127
  strings,
5041
5128
  showReasoning,
5042
5129
  showToolCalls,
5130
+ showSources,
5043
5131
  interactive,
5044
5132
  tool
5045
5133
  },
5046
5134
  partKey(part)
5047
5135
  )),
5048
- showStreamDots && /* @__PURE__ */ jsx16(TypingDots, {}),
5049
- message.status === "error" && message.errorText ? /* @__PURE__ */ jsx16("div", { class: `${p14}-error`, role: "alert", children: /* @__PURE__ */ jsx16("span", { children: message.errorText }) }) : null
5136
+ showStreamDots && /* @__PURE__ */ jsx17(TypingDots, {}),
5137
+ message.status === "error" && message.errorText ? /* @__PURE__ */ jsx17("div", { class: `${p16}-error`, role: "alert", children: /* @__PURE__ */ jsx17("span", { children: message.errorText }) }) : null
5050
5138
  ] }),
5051
- stamp ? /* @__PURE__ */ jsx16("time", { class: `${p14}-bubble-time`, dateTime: stamp.iso, title: stamp.full, children: stamp.short }) : null
5139
+ stamp ? /* @__PURE__ */ jsx17("time", { class: `${p16}-bubble-time`, dateTime: stamp.iso, title: stamp.full, children: stamp.short }) : null
5052
5140
  ] }) });
5053
5141
  }
5054
5142
  function formatStamp(createdAt) {
@@ -5070,16 +5158,17 @@ function PartView({
5070
5158
  strings,
5071
5159
  showReasoning,
5072
5160
  showToolCalls,
5161
+ showSources,
5073
5162
  interactive,
5074
5163
  tool
5075
5164
  }) {
5076
5165
  switch (part.kind) {
5077
5166
  case "text":
5078
- return /* @__PURE__ */ jsx16(MarkdownView, { textSig: part.textSig, doneSig: part.doneSig });
5167
+ return /* @__PURE__ */ jsx17(MarkdownView, { textSig: part.textSig, doneSig: part.doneSig });
5079
5168
  case "reasoning":
5080
- return showReasoning ? /* @__PURE__ */ jsx16(ReasoningView, { part, active, strings }) : null;
5169
+ return showReasoning ? /* @__PURE__ */ jsx17(ReasoningView, { part, active, strings }) : null;
5081
5170
  case "tool":
5082
- return /* @__PURE__ */ jsx16(
5171
+ return /* @__PURE__ */ jsx17(
5083
5172
  ToolPartView,
5084
5173
  {
5085
5174
  part,
@@ -5091,11 +5180,11 @@ function PartView({
5091
5180
  );
5092
5181
  case "file":
5093
5182
  if (part.mediaType.startsWith("image/")) {
5094
- return /* @__PURE__ */ jsx16("img", { src: part.url, alt: "", loading: "lazy" });
5183
+ return /* @__PURE__ */ jsx17("img", { src: part.url, alt: "", loading: "lazy" });
5095
5184
  }
5096
- return /* @__PURE__ */ jsx16("a", { href: part.url, target: "_blank", rel: "noreferrer noopener", children: part.url });
5185
+ return /* @__PURE__ */ jsx17("a", { href: part.url, target: "_blank", rel: "noreferrer noopener", children: part.url });
5097
5186
  case "source":
5098
- return null;
5187
+ return showSources ? /* @__PURE__ */ jsx17(SourceView, { part, strings }) : null;
5099
5188
  }
5100
5189
  }
5101
5190
  function ToolPartView({
@@ -5105,11 +5194,10 @@ function ToolPartView({
5105
5194
  interactive,
5106
5195
  tool
5107
5196
  }) {
5108
- const state = useComputed4(() => part.stateSig.value);
5109
- const hasApproval = useComputed4(() => part.approvalSig.value !== void 0);
5197
+ const hasApproval = useComputed5(() => part.approvalSig.value !== void 0);
5110
5198
  if (tool?.humanInLoop) {
5111
- if (isAskUserInputTool(part.toolName) || state.value === "awaiting-input") {
5112
- return /* @__PURE__ */ jsx16(
5199
+ if (isAskUserInputTool(part.toolName)) {
5200
+ return /* @__PURE__ */ jsx17(
5113
5201
  ToolAskInput,
5114
5202
  {
5115
5203
  part,
@@ -5120,20 +5208,20 @@ function ToolPartView({
5120
5208
  }
5121
5209
  );
5122
5210
  }
5123
- if (hasApproval.value || state.value === "awaiting-approval") {
5124
- return /* @__PURE__ */ jsx16(ToolApproval, { part, strings, active: interactive, onDecision: tool.onDecision });
5211
+ if (hasApproval.value) {
5212
+ return /* @__PURE__ */ jsx17(ToolApproval, { part, strings, active: interactive, onDecision: tool.onDecision });
5125
5213
  }
5126
5214
  }
5127
- return showToolCalls ? /* @__PURE__ */ jsx16(ToolChip, { part, strings }) : null;
5215
+ return showToolCalls ? /* @__PURE__ */ jsx17(ToolCall, { part, strings }) : null;
5128
5216
  }
5129
5217
  function ReasoningView({
5130
5218
  part,
5131
5219
  active,
5132
5220
  strings
5133
5221
  }) {
5134
- return /* @__PURE__ */ jsxs13("details", { class: `${p14}-reasoning`, open: active, "data-active": active ? "true" : void 0, children: [
5135
- /* @__PURE__ */ jsx16("summary", { class: `${p14}-reasoning-summary`, children: /* @__PURE__ */ jsx16("span", { class: `${p14}-reasoning-label`, children: active ? strings.thinking : strings.thoughts }) }),
5136
- /* @__PURE__ */ jsx16("div", { class: `${p14}-reasoning-body`, children: /* @__PURE__ */ jsx16(MarkdownView, { textSig: part.textSig, doneSig: part.doneSig }) })
5222
+ return /* @__PURE__ */ jsxs14("details", { class: `${p16}-reasoning`, open: active, "data-active": active ? "true" : void 0, children: [
5223
+ /* @__PURE__ */ jsx17("summary", { class: `${p16}-reasoning-summary`, children: /* @__PURE__ */ jsx17("span", { class: `${p16}-reasoning-label`, children: active ? strings.thinking : strings.thoughts }) }),
5224
+ /* @__PURE__ */ jsx17("div", { class: `${p16}-reasoning-body`, children: /* @__PURE__ */ jsx17(MarkdownView, { textSig: part.textSig, doneSig: part.doneSig }) })
5137
5225
  ] });
5138
5226
  }
5139
5227
  function partKey(part) {
@@ -5150,22 +5238,22 @@ function partKey(part) {
5150
5238
  }
5151
5239
  }
5152
5240
  function TypingDots() {
5153
- return /* @__PURE__ */ jsxs13("span", { class: `${p14}-typing`, "aria-hidden": "true", children: [
5154
- /* @__PURE__ */ jsx16("span", {}),
5155
- /* @__PURE__ */ jsx16("span", {}),
5156
- /* @__PURE__ */ jsx16("span", {})
5241
+ return /* @__PURE__ */ jsxs14("span", { class: `${p16}-typing`, "aria-hidden": "true", children: [
5242
+ /* @__PURE__ */ jsx17("span", {}),
5243
+ /* @__PURE__ */ jsx17("span", {}),
5244
+ /* @__PURE__ */ jsx17("span", {})
5157
5245
  ] });
5158
5246
  }
5159
5247
  function LoadingSpinner({ label }) {
5160
- return /* @__PURE__ */ jsxs13("span", { class: `${p14}-loading`, role: "status", children: [
5161
- /* @__PURE__ */ jsx16("span", { class: `${p14}-loading-spinner`, "aria-hidden": "true" }),
5162
- /* @__PURE__ */ jsx16("span", { class: `${p14}-loading-label`, children: label })
5248
+ return /* @__PURE__ */ jsxs14("span", { class: `${p16}-loading`, role: "status", children: [
5249
+ /* @__PURE__ */ jsx17("span", { class: `${p16}-loading-spinner`, "aria-hidden": "true" }),
5250
+ /* @__PURE__ */ jsx17("span", { class: `${p16}-loading-label`, children: label })
5163
5251
  ] });
5164
5252
  }
5165
5253
 
5166
5254
  // src/ui/message-list.tsx
5167
- import { jsx as jsx17, jsxs as jsxs14 } from "preact/jsx-runtime";
5168
- var p15 = BRAND.cssPrefix;
5255
+ import { jsx as jsx18, jsxs as jsxs15 } from "preact/jsx-runtime";
5256
+ var p17 = BRAND.cssPrefix;
5169
5257
  var STICK_THRESHOLD = 120;
5170
5258
  var INTERACTION_GRACE_MS = 350;
5171
5259
  var DIVIDER_IDLE_MS = 1200;
@@ -5175,6 +5263,7 @@ function MessageList({
5175
5263
  responseMode,
5176
5264
  showReasoning,
5177
5265
  showToolCalls,
5266
+ showSources,
5178
5267
  loading,
5179
5268
  idle,
5180
5269
  tool,
@@ -5183,7 +5272,7 @@ function MessageList({
5183
5272
  onFillForm
5184
5273
  }) {
5185
5274
  const ref = useRef5(null);
5186
- const messages = useComputed5(() => messagesSig.value);
5275
+ const messages = useComputed6(() => messagesSig.value);
5187
5276
  const [showJump, setShowJump] = useState6(false);
5188
5277
  const [scrolling, setScrolling] = useState6(false);
5189
5278
  const hasHydratedRef = useRef5(false);
@@ -5335,7 +5424,7 @@ function MessageList({
5335
5424
  const pendingMarkers = [...formMarkers ?? []].toSorted(
5336
5425
  (a, b) => (a.createdAt ?? Infinity) - (b.createdAt ?? Infinity)
5337
5426
  );
5338
- const markerRow = (marker) => /* @__PURE__ */ jsx17(
5427
+ const markerRow = (marker) => /* @__PURE__ */ jsx18(
5339
5428
  FormDoneMarker,
5340
5429
  {
5341
5430
  marker,
@@ -5356,12 +5445,12 @@ function MessageList({
5356
5445
  const day = dayKey(m.createdAt);
5357
5446
  if (day && day !== prevDay) {
5358
5447
  rows.push(
5359
- /* @__PURE__ */ jsx17("div", { class: `${p15}-date-divider`, children: /* @__PURE__ */ jsx17("span", { class: `${p15}-date-pill`, title: fullDate(m.createdAt), children: dayLabel(m.createdAt, strings) }) }, `day:${day}`)
5448
+ /* @__PURE__ */ jsx18("div", { class: `${p17}-date-divider`, children: /* @__PURE__ */ jsx18("span", { class: `${p17}-date-pill`, title: fullDate(m.createdAt), children: dayLabel(m.createdAt, strings) }) }, `day:${day}`)
5360
5449
  );
5361
5450
  prevDay = day;
5362
5451
  }
5363
5452
  rows.push(
5364
- /* @__PURE__ */ jsx17(
5453
+ /* @__PURE__ */ jsx18(
5365
5454
  MessageBubble,
5366
5455
  {
5367
5456
  message: m,
@@ -5369,6 +5458,7 @@ function MessageList({
5369
5458
  responseMode,
5370
5459
  showReasoning,
5371
5460
  showToolCalls,
5461
+ showSources,
5372
5462
  interactive: Boolean(idle) && m.id === lastId,
5373
5463
  tool
5374
5464
  },
@@ -5379,33 +5469,33 @@ function MessageList({
5379
5469
  for (const marker of pendingMarkers) {
5380
5470
  rows.push(markerRow(marker));
5381
5471
  }
5382
- return /* @__PURE__ */ jsxs14("div", { class: `${p15}-list-wrap`, children: [
5383
- /* @__PURE__ */ jsxs14(
5472
+ return /* @__PURE__ */ jsxs15("div", { class: `${p17}-list-wrap`, children: [
5473
+ /* @__PURE__ */ jsxs15(
5384
5474
  "div",
5385
5475
  {
5386
5476
  ref,
5387
- class: `${p15}-list`,
5477
+ class: `${p17}-list`,
5388
5478
  role: "log",
5389
5479
  "aria-live": "polite",
5390
5480
  "aria-relevant": "additions text",
5391
5481
  "data-scrolling": scrolling ? "true" : void 0,
5392
5482
  children: [
5393
- loading && messages.value.length === 0 ? /* @__PURE__ */ jsx17("div", { class: `${p15}-list-loading`, role: "status", children: strings.conversationLoading }) : null,
5483
+ loading && messages.value.length === 0 ? /* @__PURE__ */ jsx18("div", { class: `${p17}-list-loading`, role: "status", children: strings.conversationLoading }) : null,
5394
5484
  rows,
5395
- form ? /* @__PURE__ */ jsx17(FormGate, { form: form.form, strings, onSubmit: form.onSubmit, onSkip: form.onSkip }) : null
5485
+ form ? /* @__PURE__ */ jsx18(FormGate, { form: form.form, strings, onSubmit: form.onSubmit, onSkip: form.onSkip }) : null
5396
5486
  ]
5397
5487
  }
5398
5488
  ),
5399
- showJump ? /* @__PURE__ */ jsx17(
5489
+ showJump ? /* @__PURE__ */ jsx18(
5400
5490
  "button",
5401
5491
  {
5402
5492
  type: "button",
5403
- class: `${p15}-jump`,
5493
+ class: `${p17}-jump`,
5404
5494
  onClick: jumpToBottom,
5405
5495
  "aria-label": strings.scrollToBottom,
5406
5496
  title: strings.scrollToBottom,
5407
5497
  "data-testid": TID.scrollToBottom,
5408
- children: /* @__PURE__ */ jsx17(ChevronDownIcon, {})
5498
+ children: /* @__PURE__ */ jsx18(ChevronDownIcon, {})
5409
5499
  }
5410
5500
  ) : null
5411
5501
  ] });
@@ -5464,7 +5554,7 @@ function startOfDay(ms) {
5464
5554
  }
5465
5555
 
5466
5556
  // src/ui/conversation-list.tsx
5467
- import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs15 } from "preact/jsx-runtime";
5557
+ import { Fragment as Fragment3, jsx as jsx19, jsxs as jsxs16 } from "preact/jsx-runtime";
5468
5558
  var log11 = logger.scope("history");
5469
5559
  var DEFAULT_SKELETON_ROWS = 3;
5470
5560
  var MAX_SKELETON_ROWS = 6;
@@ -5491,7 +5581,7 @@ function ConversationList({
5491
5581
  onSelect,
5492
5582
  onNewConversation
5493
5583
  }) {
5494
- const p33 = BRAND.cssPrefix;
5584
+ const p35 = BRAND.cssPrefix;
5495
5585
  const seed = transport.peekConversations({ visitorId });
5496
5586
  const [state, setState] = useState7(seed ? "loaded" : "loading");
5497
5587
  const [conversations, setChats] = useState7(seed?.conversations ?? []);
@@ -5512,32 +5602,32 @@ function ConversationList({
5512
5602
  cancelled = true;
5513
5603
  };
5514
5604
  }, [transport, visitorId, persistence]);
5515
- const newChatButton = onNewConversation ? /* @__PURE__ */ jsx18("div", { class: `${p33}-history-footer`, children: /* @__PURE__ */ jsxs15(
5605
+ const newChatButton = onNewConversation ? /* @__PURE__ */ jsx19("div", { class: `${p35}-history-footer`, children: /* @__PURE__ */ jsxs16(
5516
5606
  "button",
5517
5607
  {
5518
5608
  type: "button",
5519
- class: `${p33}-history-new`,
5609
+ class: `${p35}-history-new`,
5520
5610
  onClick: onNewConversation,
5521
5611
  "data-testid": TID.sidebarNewConversation,
5522
5612
  children: [
5523
- /* @__PURE__ */ jsx18(PlusIcon, {}),
5613
+ /* @__PURE__ */ jsx19(PlusIcon, {}),
5524
5614
  strings.newConversation
5525
5615
  ]
5526
5616
  }
5527
5617
  ) }) : null;
5528
5618
  if (state === "loading") {
5529
5619
  const rows = Math.min(persistence.loadHistoryCount() ?? DEFAULT_SKELETON_ROWS, MAX_SKELETON_ROWS);
5530
- return /* @__PURE__ */ jsxs15(Fragment3, { children: [
5531
- /* @__PURE__ */ jsx18("div", { class: `${p33}-history`, "aria-busy": "true", "aria-label": strings.historyLoading, children: /* @__PURE__ */ jsxs15("div", { class: `${p33}-history-group`, "aria-hidden": "true", children: [
5532
- /* @__PURE__ */ jsx18("div", { class: `${p33}-history-heading`, children: /* @__PURE__ */ jsx18("span", { class: `${p33}-skeleton ${p33}-skeleton-heading` }) }),
5533
- /* @__PURE__ */ jsx18("div", { class: `${p33}-history-card`, children: Array.from({ length: Math.max(1, rows) }, (_, i) => /* @__PURE__ */ jsxs15("div", { class: `${p33}-history-item ${p33}-history-item-skeleton`, children: [
5534
- /* @__PURE__ */ jsx18("span", { class: `${p33}-history-avatar ${p33}-skeleton` }),
5535
- /* @__PURE__ */ jsxs15("span", { class: `${p33}-history-body`, children: [
5536
- /* @__PURE__ */ jsxs15("span", { class: `${p33}-history-row`, children: [
5537
- /* @__PURE__ */ jsx18("span", { class: `${p33}-history-title`, children: /* @__PURE__ */ jsx18("span", { class: `${p33}-skeleton ${p33}-skeleton-title` }) }),
5538
- /* @__PURE__ */ jsx18("span", { class: `${p33}-history-time`, children: /* @__PURE__ */ jsx18("span", { class: `${p33}-skeleton ${p33}-skeleton-time` }) })
5620
+ return /* @__PURE__ */ jsxs16(Fragment3, { children: [
5621
+ /* @__PURE__ */ jsx19("div", { class: `${p35}-history`, "aria-busy": "true", "aria-label": strings.historyLoading, children: /* @__PURE__ */ jsxs16("div", { class: `${p35}-history-group`, "aria-hidden": "true", children: [
5622
+ /* @__PURE__ */ jsx19("div", { class: `${p35}-history-heading`, children: /* @__PURE__ */ jsx19("span", { class: `${p35}-skeleton ${p35}-skeleton-heading` }) }),
5623
+ /* @__PURE__ */ jsx19("div", { class: `${p35}-history-card`, children: Array.from({ length: Math.max(1, rows) }, (_, i) => /* @__PURE__ */ jsxs16("div", { class: `${p35}-history-item ${p35}-history-item-skeleton`, children: [
5624
+ /* @__PURE__ */ jsx19("span", { class: `${p35}-history-avatar ${p35}-skeleton` }),
5625
+ /* @__PURE__ */ jsxs16("span", { class: `${p35}-history-body`, children: [
5626
+ /* @__PURE__ */ jsxs16("span", { class: `${p35}-history-row`, children: [
5627
+ /* @__PURE__ */ jsx19("span", { class: `${p35}-history-title`, children: /* @__PURE__ */ jsx19("span", { class: `${p35}-skeleton ${p35}-skeleton-title` }) }),
5628
+ /* @__PURE__ */ jsx19("span", { class: `${p35}-history-time`, children: /* @__PURE__ */ jsx19("span", { class: `${p35}-skeleton ${p35}-skeleton-time` }) })
5539
5629
  ] }),
5540
- /* @__PURE__ */ jsx18("span", { class: `${p33}-history-row`, children: /* @__PURE__ */ jsx18("span", { class: `${p33}-history-preview`, children: /* @__PURE__ */ jsx18("span", { class: `${p33}-skeleton ${p33}-skeleton-preview` }) }) })
5630
+ /* @__PURE__ */ jsx19("span", { class: `${p35}-history-row`, children: /* @__PURE__ */ jsx19("span", { class: `${p35}-history-preview`, children: /* @__PURE__ */ jsx19("span", { class: `${p35}-skeleton ${p35}-skeleton-preview` }) }) })
5541
5631
  ] })
5542
5632
  ] }, i)) })
5543
5633
  ] }) }),
@@ -5545,36 +5635,36 @@ function ConversationList({
5545
5635
  ] });
5546
5636
  }
5547
5637
  if (state === "error" || conversations.length === 0) {
5548
- return /* @__PURE__ */ jsxs15(Fragment3, { children: [
5549
- /* @__PURE__ */ jsx18("div", { class: `${p33}-history-empty`, children: strings.historyEmpty }),
5638
+ return /* @__PURE__ */ jsxs16(Fragment3, { children: [
5639
+ /* @__PURE__ */ jsx19("div", { class: `${p35}-history-empty`, children: strings.historyEmpty }),
5550
5640
  newChatButton
5551
5641
  ] });
5552
5642
  }
5553
5643
  const now = Date.now();
5554
5644
  const groups = groupByBucket(now, conversations);
5555
- return /* @__PURE__ */ jsxs15(Fragment3, { children: [
5556
- /* @__PURE__ */ jsx18("div", { class: `${p33}-history`, role: "list", children: groups.map((group) => /* @__PURE__ */ jsxs15("div", { class: `${p33}-history-group`, children: [
5557
- /* @__PURE__ */ jsx18("div", { class: `${p33}-history-heading`, children: strings[BUCKET_TO_STRING[group.bucket]] }),
5558
- /* @__PURE__ */ jsx18("div", { class: `${p33}-history-card`, children: group.conversations.map((chat) => /* @__PURE__ */ jsxs15(
5645
+ return /* @__PURE__ */ jsxs16(Fragment3, { children: [
5646
+ /* @__PURE__ */ jsx19("div", { class: `${p35}-history`, role: "list", children: groups.map((group) => /* @__PURE__ */ jsxs16("div", { class: `${p35}-history-group`, children: [
5647
+ /* @__PURE__ */ jsx19("div", { class: `${p35}-history-heading`, children: strings[BUCKET_TO_STRING[group.bucket]] }),
5648
+ /* @__PURE__ */ jsx19("div", { class: `${p35}-history-card`, children: group.conversations.map((chat) => /* @__PURE__ */ jsxs16(
5559
5649
  "button",
5560
5650
  {
5561
5651
  type: "button",
5562
5652
  role: "listitem",
5563
- class: `${p33}-history-item`,
5653
+ class: `${p35}-history-item`,
5564
5654
  onClick: () => onSelect(chat),
5565
5655
  "data-closed": chat.canContinue ? void 0 : "true",
5566
5656
  "data-unread": (chat.unreadCount ?? 0) > 0 ? "true" : void 0,
5567
5657
  "data-testid": tid(TID.historyItem, chat.conversationId),
5568
5658
  children: [
5569
- /* @__PURE__ */ jsx18("span", { class: `${p33}-history-avatar`, "aria-hidden": "true", children: /* @__PURE__ */ jsx18(MessageIcon, {}) }),
5570
- /* @__PURE__ */ jsxs15("span", { class: `${p33}-history-body`, children: [
5571
- /* @__PURE__ */ jsxs15("span", { class: `${p33}-history-row`, children: [
5572
- /* @__PURE__ */ jsx18("span", { class: `${p33}-history-title`, children: chat.title }),
5573
- /* @__PURE__ */ jsx18("span", { class: `${p33}-history-time`, children: rowTime(chat.lastMessageAt, now, locale) })
5659
+ /* @__PURE__ */ jsx19("span", { class: `${p35}-history-avatar`, "aria-hidden": "true", children: /* @__PURE__ */ jsx19(MessageIcon, {}) }),
5660
+ /* @__PURE__ */ jsxs16("span", { class: `${p35}-history-body`, children: [
5661
+ /* @__PURE__ */ jsxs16("span", { class: `${p35}-history-row`, children: [
5662
+ /* @__PURE__ */ jsx19("span", { class: `${p35}-history-title`, children: chat.title }),
5663
+ /* @__PURE__ */ jsx19("span", { class: `${p35}-history-time`, children: rowTime(chat.lastMessageAt, now, locale) })
5574
5664
  ] }),
5575
- /* @__PURE__ */ jsxs15("span", { class: `${p33}-history-row`, children: [
5576
- /* @__PURE__ */ jsx18("span", { class: `${p33}-history-preview`, children: chat.preview ?? (chat.canContinue ? strings.historyContinue : strings.conversationClosed) }),
5577
- (chat.unreadCount ?? 0) > 0 ? /* @__PURE__ */ jsx18("span", { class: `${p33}-history-dot` }) : null
5665
+ /* @__PURE__ */ jsxs16("span", { class: `${p35}-history-row`, children: [
5666
+ /* @__PURE__ */ jsx19("span", { class: `${p35}-history-preview`, children: chat.preview ?? (chat.canContinue ? strings.historyContinue : strings.conversationClosed) }),
5667
+ (chat.unreadCount ?? 0) > 0 ? /* @__PURE__ */ jsx19("span", { class: `${p35}-history-dot` }) : null
5578
5668
  ] })
5579
5669
  ] })
5580
5670
  ]
@@ -5587,15 +5677,15 @@ function ConversationList({
5587
5677
  }
5588
5678
 
5589
5679
  // src/ui/suggestions.tsx
5590
- import { jsx as jsx19 } from "preact/jsx-runtime";
5591
- var p16 = BRAND.cssPrefix;
5680
+ import { jsx as jsx20 } from "preact/jsx-runtime";
5681
+ var p18 = BRAND.cssPrefix;
5592
5682
  function Suggestions({ suggestions, onPick }) {
5593
5683
  if (suggestions.length === 0) return null;
5594
- return /* @__PURE__ */ jsx19("div", { class: `${p16}-suggestions`, role: "group", "aria-label": "Suggested replies", children: suggestions.map((s, i) => /* @__PURE__ */ jsx19(
5684
+ return /* @__PURE__ */ jsx20("div", { class: `${p18}-suggestions`, role: "group", "aria-label": "Suggested replies", children: suggestions.map((s, i) => /* @__PURE__ */ jsx20(
5595
5685
  "button",
5596
5686
  {
5597
5687
  type: "button",
5598
- class: `${p16}-suggestion`,
5688
+ class: `${p18}-suggestion`,
5599
5689
  onClick: () => onPick(s),
5600
5690
  "data-testid": tid(TID.suggestion, i),
5601
5691
  children: s.label
@@ -5605,8 +5695,8 @@ function Suggestions({ suggestions, onPick }) {
5605
5695
  }
5606
5696
 
5607
5697
  // src/ui/panel.tsx
5608
- import { Fragment as Fragment4, jsx as jsx20, jsxs as jsxs16 } from "preact/jsx-runtime";
5609
- var p17 = BRAND.cssPrefix;
5698
+ import { Fragment as Fragment4, jsx as jsx21, jsxs as jsxs17 } from "preact/jsx-runtime";
5699
+ var p19 = BRAND.cssPrefix;
5610
5700
  function Panel(props2) {
5611
5701
  const { options, onClose } = props2;
5612
5702
  const s = options.strings;
@@ -5630,18 +5720,18 @@ function Panel(props2) {
5630
5720
  }, []);
5631
5721
  const { visible: dragOver } = useFileDrop({ containerRef, onDrop: onDropItems });
5632
5722
  useDragMove(containerRef.current, options.mode === "modal");
5633
- return /* @__PURE__ */ jsxs16(
5723
+ return /* @__PURE__ */ jsxs17(
5634
5724
  "div",
5635
5725
  {
5636
5726
  ref: containerRef,
5637
- class: `${p17}-panel`,
5727
+ class: `${p19}-panel`,
5638
5728
  role: "dialog",
5639
5729
  "aria-modal": "false",
5640
5730
  "aria-label": s.panelTitle,
5641
5731
  style: { position: "relative" },
5642
5732
  "data-testid": TID.panel,
5643
5733
  children: [
5644
- /* @__PURE__ */ jsx20(
5734
+ /* @__PURE__ */ jsx21(
5645
5735
  PanelContent,
5646
5736
  {
5647
5737
  ...props2,
@@ -5650,7 +5740,7 @@ function Panel(props2) {
5650
5740
  composerAttachApiRef
5651
5741
  }
5652
5742
  ),
5653
- /* @__PURE__ */ jsx20(PoweredByBar, { poweredBy: props2.options.poweredBy })
5743
+ /* @__PURE__ */ jsx21(PoweredByBar, { poweredBy: props2.options.poweredBy })
5654
5744
  ]
5655
5745
  }
5656
5746
  );
@@ -5697,9 +5787,9 @@ function PanelContent(props2) {
5697
5787
  if (activeForm) {
5698
5788
  composerArea = null;
5699
5789
  } else if (canSend) {
5700
- composerArea = /* @__PURE__ */ jsxs16(Fragment4, { children: [
5701
- /* @__PURE__ */ jsx20(Suggestions, { suggestions, onPick: onSuggestion }),
5702
- /* @__PURE__ */ jsx20(
5790
+ composerArea = /* @__PURE__ */ jsxs17(Fragment4, { children: [
5791
+ /* @__PURE__ */ jsx21(Suggestions, { suggestions, onPick: onSuggestion }),
5792
+ /* @__PURE__ */ jsx21(
5703
5793
  Composer,
5704
5794
  {
5705
5795
  options,
@@ -5714,10 +5804,10 @@ function PanelContent(props2) {
5714
5804
  )
5715
5805
  ] });
5716
5806
  } else {
5717
- composerArea = /* @__PURE__ */ jsx20(ReadOnlyBanner, { label: s.conversationClosed, ctaLabel: s.startNewConversation, onNewConversation: onClear });
5807
+ composerArea = /* @__PURE__ */ jsx21(ReadOnlyBanner, { label: s.conversationClosed, ctaLabel: s.startNewConversation, onNewConversation: onClear });
5718
5808
  }
5719
- return /* @__PURE__ */ jsxs16(Fragment4, { children: [
5720
- view === "history" ? /* @__PURE__ */ jsx20(
5809
+ return /* @__PURE__ */ jsxs17(Fragment4, { children: [
5810
+ view === "history" ? /* @__PURE__ */ jsx21(
5721
5811
  HistoryHeader,
5722
5812
  {
5723
5813
  strings: s,
@@ -5725,22 +5815,22 @@ function PanelContent(props2) {
5725
5815
  onClose,
5726
5816
  showClose: canShowClose(options.mode, panelSize, options.actions)
5727
5817
  }
5728
- ) : /* @__PURE__ */ jsxs16("header", { class: `${p17}-header`, "data-testid": TID.panelHeader, children: [
5729
- onBack ? /* @__PURE__ */ jsx20(
5818
+ ) : /* @__PURE__ */ jsxs17("header", { class: `${p19}-header`, "data-testid": TID.panelHeader, children: [
5819
+ onBack ? /* @__PURE__ */ jsx21(
5730
5820
  "button",
5731
5821
  {
5732
5822
  type: "button",
5733
- class: `${p17}-icon-btn`,
5823
+ class: `${p19}-icon-btn`,
5734
5824
  onClick: onBack,
5735
5825
  "aria-label": s.moduleBack,
5736
5826
  title: s.moduleBack,
5737
- children: /* @__PURE__ */ jsx20(BackIcon, {})
5827
+ children: /* @__PURE__ */ jsx21(BackIcon, {})
5738
5828
  }
5739
5829
  ) : null,
5740
- agent ? /* @__PURE__ */ jsx20(AgentBadge, { agent, strings: s }) : /* @__PURE__ */ jsx20("h1", { children: s.panelTitle }),
5741
- /* @__PURE__ */ jsx20(HeaderActions, { panelProps: props2, variant: "chat" })
5830
+ agent ? /* @__PURE__ */ jsx21(AgentBadge, { agent, strings: s }) : /* @__PURE__ */ jsx21("h1", { children: s.panelTitle }),
5831
+ /* @__PURE__ */ jsx21(HeaderActions, { panelProps: props2, variant: "chat" })
5742
5832
  ] }),
5743
- view === "history" ? /* @__PURE__ */ jsx20(
5833
+ view === "history" ? /* @__PURE__ */ jsx21(
5744
5834
  ConversationList,
5745
5835
  {
5746
5836
  transport,
@@ -5751,9 +5841,9 @@ function PanelContent(props2) {
5751
5841
  onSelect: (conversation) => onSelectHistoryConversation(conversation.conversationId),
5752
5842
  onNewConversation
5753
5843
  }
5754
- ) : /* @__PURE__ */ jsxs16(Fragment4, { children: [
5755
- /* @__PURE__ */ jsx20(DropZone, { visible: dragOver, strings: s }),
5756
- /* @__PURE__ */ jsx20(
5844
+ ) : /* @__PURE__ */ jsxs17(Fragment4, { children: [
5845
+ /* @__PURE__ */ jsx21(DropZone, { visible: dragOver, strings: s }),
5846
+ /* @__PURE__ */ jsx21(
5757
5847
  MessageList,
5758
5848
  {
5759
5849
  messagesSig,
@@ -5761,6 +5851,7 @@ function PanelContent(props2) {
5761
5851
  responseMode: options.responseMode,
5762
5852
  showReasoning: options.showReasoning,
5763
5853
  showToolCalls: options.showToolCalls,
5854
+ showSources: options.showSources,
5764
5855
  loading: loadingMessages,
5765
5856
  idle: !isStreaming,
5766
5857
  tool,
@@ -5770,9 +5861,9 @@ function PanelContent(props2) {
5770
5861
  }
5771
5862
  ),
5772
5863
  composerArea,
5773
- /* @__PURE__ */ jsx20(ComposerFooter, { disclaimer: options.composerDisclaimer })
5864
+ /* @__PURE__ */ jsx21(ComposerFooter, { disclaimer: options.composerDisclaimer })
5774
5865
  ] }),
5775
- options.size.resize?.enabled ? /* @__PURE__ */ jsx20(
5866
+ options.size.resize?.enabled ? /* @__PURE__ */ jsx21(
5776
5867
  ResizeGrip,
5777
5868
  {
5778
5869
  panelEl: containerEl,
@@ -5791,28 +5882,28 @@ function HistoryHeader({
5791
5882
  onClose,
5792
5883
  showClose
5793
5884
  }) {
5794
- return /* @__PURE__ */ jsxs16("header", { class: `${p17}-header`, children: [
5795
- /* @__PURE__ */ jsx20(
5885
+ return /* @__PURE__ */ jsxs17("header", { class: `${p19}-header`, children: [
5886
+ /* @__PURE__ */ jsx21(
5796
5887
  "button",
5797
5888
  {
5798
5889
  type: "button",
5799
- class: `${p17}-icon-btn`,
5890
+ class: `${p19}-icon-btn`,
5800
5891
  onClick: onBack,
5801
5892
  "aria-label": strings.historyBack,
5802
5893
  title: strings.historyBack,
5803
- children: /* @__PURE__ */ jsx20(BackIcon, {})
5894
+ children: /* @__PURE__ */ jsx21(BackIcon, {})
5804
5895
  }
5805
5896
  ),
5806
- /* @__PURE__ */ jsx20("h1", { children: strings.historyTitle }),
5807
- showClose ? /* @__PURE__ */ jsx20(
5897
+ /* @__PURE__ */ jsx21("h1", { children: strings.historyTitle }),
5898
+ showClose ? /* @__PURE__ */ jsx21(
5808
5899
  "button",
5809
5900
  {
5810
5901
  type: "button",
5811
- class: `${p17}-icon-btn`,
5902
+ class: `${p19}-icon-btn`,
5812
5903
  onClick: onClose,
5813
5904
  "aria-label": strings.close,
5814
5905
  title: strings.close,
5815
- children: /* @__PURE__ */ jsx20(CloseIcon, {})
5906
+ children: /* @__PURE__ */ jsx21(CloseIcon, {})
5816
5907
  }
5817
5908
  ) : null
5818
5909
  ] });
@@ -5822,28 +5913,28 @@ function ReadOnlyBanner({
5822
5913
  ctaLabel,
5823
5914
  onNewConversation
5824
5915
  }) {
5825
- return /* @__PURE__ */ jsxs16("div", { class: `${p17}-readonly-banner`, role: "note", children: [
5826
- /* @__PURE__ */ jsx20("span", { class: `${p17}-readonly-label`, children: label }),
5827
- /* @__PURE__ */ jsx20("button", { type: "button", class: `${p17}-readonly-cta`, onClick: onNewConversation, children: ctaLabel })
5916
+ return /* @__PURE__ */ jsxs17("div", { class: `${p19}-readonly-banner`, role: "note", children: [
5917
+ /* @__PURE__ */ jsx21("span", { class: `${p19}-readonly-label`, children: label }),
5918
+ /* @__PURE__ */ jsx21("button", { type: "button", class: `${p19}-readonly-cta`, onClick: onNewConversation, children: ctaLabel })
5828
5919
  ] });
5829
5920
  }
5830
5921
  function ComposerFooter({ disclaimer }) {
5831
5922
  if (!disclaimer) return null;
5832
- return /* @__PURE__ */ jsx20("div", { class: `${p17}-composer-footer`, children: /* @__PURE__ */ jsx20("div", { class: `${p17}-disclaimer`, children: disclaimer }) });
5923
+ return /* @__PURE__ */ jsx21("div", { class: `${p19}-composer-footer`, children: /* @__PURE__ */ jsx21("div", { class: `${p19}-disclaimer`, children: disclaimer }) });
5833
5924
  }
5834
5925
  function PoweredByBar({ poweredBy }) {
5835
5926
  if (!poweredBy) return null;
5836
- return /* @__PURE__ */ jsx20("div", { class: `${p17}-poweredby-bar`, children: /* @__PURE__ */ jsx20(PoweredBy, { logoUrl: poweredBy.logoUrl, text: poweredBy.text, href: poweredBy.href }) });
5927
+ return /* @__PURE__ */ jsx21("div", { class: `${p19}-poweredby-bar`, children: /* @__PURE__ */ jsx21(PoweredBy, { logoUrl: poweredBy.logoUrl, text: poweredBy.text, href: poweredBy.href }) });
5837
5928
  }
5838
5929
  function PoweredBy({ logoUrl, text, href }) {
5839
- const inner = /* @__PURE__ */ jsxs16(Fragment4, { children: [
5840
- logoUrl ? /* @__PURE__ */ jsx20("img", { class: `${p17}-poweredby-logo`, src: logoUrl, alt: "", loading: "lazy" }) : null,
5841
- text ? /* @__PURE__ */ jsx20("span", { children: text }) : null
5930
+ const inner = /* @__PURE__ */ jsxs17(Fragment4, { children: [
5931
+ logoUrl ? /* @__PURE__ */ jsx21("img", { class: `${p19}-poweredby-logo`, src: logoUrl, alt: "", loading: "lazy" }) : null,
5932
+ text ? /* @__PURE__ */ jsx21("span", { children: text }) : null
5842
5933
  ] });
5843
5934
  if (href) {
5844
- return /* @__PURE__ */ jsx20("a", { class: `${p17}-poweredby`, href, target: "_blank", rel: "noopener noreferrer", children: inner });
5935
+ return /* @__PURE__ */ jsx21("a", { class: `${p19}-poweredby`, href, target: "_blank", rel: "noopener noreferrer", children: inner });
5845
5936
  }
5846
- return /* @__PURE__ */ jsx20("span", { class: `${p17}-poweredby`, children: inner });
5937
+ return /* @__PURE__ */ jsx21("span", { class: `${p19}-poweredby`, children: inner });
5847
5938
  }
5848
5939
 
5849
5940
  // src/ui/form/form-controller.ts
@@ -5926,34 +6017,34 @@ function whenPasses(form, d) {
5926
6017
  }
5927
6018
 
5928
6019
  // src/ui/sidebar.tsx
5929
- import { Fragment as Fragment5, jsx as jsx21, jsxs as jsxs17 } from "preact/jsx-runtime";
6020
+ import { Fragment as Fragment5, jsx as jsx22, jsxs as jsxs18 } from "preact/jsx-runtime";
5930
6021
  function Sidebar(props2) {
5931
- const p33 = BRAND.cssPrefix;
6022
+ const p35 = BRAND.cssPrefix;
5932
6023
  const { site, blocks, strings, collapsed } = props2;
5933
6024
  const navigation = blocks?.navigation ?? [];
5934
6025
  const linkCards = blocks?.linkCards ?? [];
5935
6026
  const toggleLabel = collapsed ? strings.expandSidebar : strings.collapseSidebar;
5936
- return /* @__PURE__ */ jsxs17("aside", { class: `${p33}-sidebar`, "data-collapsed": collapsed ? "true" : "false", "data-testid": TID.sidebar, children: [
5937
- /* @__PURE__ */ jsxs17("div", { class: `${p33}-sidebar-header`, children: [
5938
- /* @__PURE__ */ jsx21(SidebarBrand, { site }),
5939
- /* @__PURE__ */ jsx21(
6027
+ return /* @__PURE__ */ jsxs18("aside", { class: `${p35}-sidebar`, "data-collapsed": collapsed ? "true" : "false", "data-testid": TID.sidebar, children: [
6028
+ /* @__PURE__ */ jsxs18("div", { class: `${p35}-sidebar-header`, children: [
6029
+ /* @__PURE__ */ jsx22(SidebarBrand, { site }),
6030
+ /* @__PURE__ */ jsx22(
5940
6031
  "button",
5941
6032
  {
5942
6033
  type: "button",
5943
- class: `${p33}-sidebar-toggle`,
6034
+ class: `${p35}-sidebar-toggle`,
5944
6035
  "aria-label": toggleLabel,
5945
6036
  "aria-expanded": collapsed ? "false" : "true",
5946
6037
  title: toggleLabel,
5947
6038
  onClick: props2.onToggleCollapsed,
5948
6039
  "data-testid": TID.sidebarToggle,
5949
- children: /* @__PURE__ */ jsx21(SidebarToggleIcon, { collapsed })
6040
+ children: /* @__PURE__ */ jsx22(SidebarToggleIcon, { collapsed })
5950
6041
  }
5951
6042
  )
5952
6043
  ] }),
5953
- collapsed ? null : /* @__PURE__ */ jsxs17(Fragment5, { children: [
5954
- navigation.length > 0 ? /* @__PURE__ */ jsx21("nav", { class: `${p33}-sidebar-section`, "data-section": "navigation", children: /* @__PURE__ */ jsx21(SidebarNav, { items: navigation }) }) : null,
5955
- linkCards.length > 0 ? /* @__PURE__ */ jsx21("div", { class: `${p33}-sidebar-section`, "data-section": "link-cards", children: /* @__PURE__ */ jsx21(SidebarCards, { items: linkCards }) }) : null,
5956
- props2.showConversations ? /* @__PURE__ */ jsx21("div", { class: `${p33}-sidebar-conversations`, children: /* @__PURE__ */ jsx21(
6044
+ collapsed ? null : /* @__PURE__ */ jsxs18(Fragment5, { children: [
6045
+ navigation.length > 0 ? /* @__PURE__ */ jsx22("nav", { class: `${p35}-sidebar-section`, "data-section": "navigation", children: /* @__PURE__ */ jsx22(SidebarNav, { items: navigation }) }) : null,
6046
+ linkCards.length > 0 ? /* @__PURE__ */ jsx22("div", { class: `${p35}-sidebar-section`, "data-section": "link-cards", children: /* @__PURE__ */ jsx22(SidebarCards, { items: linkCards }) }) : null,
6047
+ props2.showConversations ? /* @__PURE__ */ jsx22("div", { class: `${p35}-sidebar-conversations`, children: /* @__PURE__ */ jsx22(
5957
6048
  ConversationList,
5958
6049
  {
5959
6050
  transport: props2.transport,
@@ -5969,18 +6060,18 @@ function Sidebar(props2) {
5969
6060
  ] });
5970
6061
  }
5971
6062
  function SidebarBrand({ site }) {
5972
- const p33 = BRAND.cssPrefix;
6063
+ const p35 = BRAND.cssPrefix;
5973
6064
  if (site?.logo?.url) {
5974
6065
  const alt = site.logo.alt ?? site.title ?? "Logo";
5975
- return /* @__PURE__ */ jsxs17("picture", { children: [
5976
- site.logoDark?.url ? /* @__PURE__ */ jsx21("source", { srcset: site.logoDark.url, media: "(prefers-color-scheme: dark)" }) : null,
5977
- /* @__PURE__ */ jsx21("img", { class: `${p33}-sidebar-logo`, src: site.logo.url, alt })
6066
+ return /* @__PURE__ */ jsxs18("picture", { children: [
6067
+ site.logoDark?.url ? /* @__PURE__ */ jsx22("source", { srcset: site.logoDark.url, media: "(prefers-color-scheme: dark)" }) : null,
6068
+ /* @__PURE__ */ jsx22("img", { class: `${p35}-sidebar-logo`, src: site.logo.url, alt })
5978
6069
  ] });
5979
6070
  }
5980
- return /* @__PURE__ */ jsx21("div", { class: `${p33}-sidebar-title`, children: site?.title ?? BRAND.name });
6071
+ return /* @__PURE__ */ jsx22("div", { class: `${p35}-sidebar-title`, children: site?.title ?? BRAND.name });
5981
6072
  }
5982
6073
  function SidebarToggleIcon({ collapsed }) {
5983
- return /* @__PURE__ */ jsx21(
6074
+ return /* @__PURE__ */ jsx22(
5984
6075
  "svg",
5985
6076
  {
5986
6077
  width: "16",
@@ -5990,38 +6081,38 @@ function SidebarToggleIcon({ collapsed }) {
5990
6081
  stroke: "currentColor",
5991
6082
  "stroke-width": "2",
5992
6083
  "aria-hidden": "true",
5993
- children: collapsed ? /* @__PURE__ */ jsx21("polyline", { points: "9 6 15 12 9 18" }) : /* @__PURE__ */ jsx21("polyline", { points: "15 6 9 12 15 18" })
6084
+ children: collapsed ? /* @__PURE__ */ jsx22("polyline", { points: "9 6 15 12 9 18" }) : /* @__PURE__ */ jsx22("polyline", { points: "15 6 9 12 15 18" })
5994
6085
  }
5995
6086
  );
5996
6087
  }
5997
6088
  function SidebarNav({ items }) {
5998
- const p33 = BRAND.cssPrefix;
5999
- return /* @__PURE__ */ jsx21("ul", { class: `${p33}-sidebar-nav`, children: items.map((item) => /* @__PURE__ */ jsx21("li", { children: /* @__PURE__ */ jsxs17(
6089
+ const p35 = BRAND.cssPrefix;
6090
+ return /* @__PURE__ */ jsx22("ul", { class: `${p35}-sidebar-nav`, children: items.map((item) => /* @__PURE__ */ jsx22("li", { children: /* @__PURE__ */ jsxs18(
6000
6091
  "a",
6001
6092
  {
6002
- class: `${p33}-sidebar-nav-item`,
6093
+ class: `${p35}-sidebar-nav-item`,
6003
6094
  href: item.href,
6004
6095
  target: item.href ? "_blank" : void 0,
6005
6096
  rel: item.href ? "noreferrer" : void 0,
6006
6097
  children: [
6007
- item.icon ? /* @__PURE__ */ jsx21("span", { class: `${p33}-sidebar-nav-icon`, "data-icon": item.icon }) : null,
6008
- /* @__PURE__ */ jsx21("span", { class: `${p33}-sidebar-nav-label`, children: item.label })
6098
+ item.icon ? /* @__PURE__ */ jsx22("span", { class: `${p35}-sidebar-nav-icon`, "data-icon": item.icon }) : null,
6099
+ /* @__PURE__ */ jsx22("span", { class: `${p35}-sidebar-nav-label`, children: item.label })
6009
6100
  ]
6010
6101
  }
6011
6102
  ) }, item.id ?? item.label)) });
6012
6103
  }
6013
6104
  function SidebarCards({ items }) {
6014
- const p33 = BRAND.cssPrefix;
6015
- return /* @__PURE__ */ jsx21("div", { class: `${p33}-sidebar-cards`, children: items.map((item) => /* @__PURE__ */ jsxs17(
6105
+ const p35 = BRAND.cssPrefix;
6106
+ return /* @__PURE__ */ jsx22("div", { class: `${p35}-sidebar-cards`, children: items.map((item) => /* @__PURE__ */ jsxs18(
6016
6107
  "a",
6017
6108
  {
6018
- class: `${p33}-sidebar-card`,
6109
+ class: `${p35}-sidebar-card`,
6019
6110
  href: item.href,
6020
6111
  target: item.href ? "_blank" : void 0,
6021
6112
  rel: item.href ? "noreferrer" : void 0,
6022
6113
  children: [
6023
- /* @__PURE__ */ jsx21("div", { class: `${p33}-sidebar-card-label`, children: item.label }),
6024
- item.description ? /* @__PURE__ */ jsx21("div", { class: `${p33}-sidebar-card-desc`, children: item.description }) : null
6114
+ /* @__PURE__ */ jsx22("div", { class: `${p35}-sidebar-card-label`, children: item.label }),
6115
+ item.description ? /* @__PURE__ */ jsx22("div", { class: `${p35}-sidebar-card-desc`, children: item.description }) : null
6025
6116
  ]
6026
6117
  },
6027
6118
  item.id ?? item.label
@@ -6029,11 +6120,11 @@ function SidebarCards({ items }) {
6029
6120
  }
6030
6121
 
6031
6122
  // src/ui/page-shell.tsx
6032
- import { jsx as jsx22, jsxs as jsxs18 } from "preact/jsx-runtime";
6033
- var p18 = BRAND.cssPrefix;
6123
+ import { jsx as jsx23, jsxs as jsxs19 } from "preact/jsx-runtime";
6124
+ var p20 = BRAND.cssPrefix;
6034
6125
  function PageShell(props2) {
6035
- return /* @__PURE__ */ jsxs18("main", { class: `${p18}-page-shell`, "data-sidebar-collapsed": props2.sidebarCollapsed ? "true" : "false", children: [
6036
- /* @__PURE__ */ jsx22(
6126
+ return /* @__PURE__ */ jsxs19("main", { class: `${p20}-page-shell`, "data-sidebar-collapsed": props2.sidebarCollapsed ? "true" : "false", children: [
6127
+ /* @__PURE__ */ jsx23(
6037
6128
  Sidebar,
6038
6129
  {
6039
6130
  site: props2.site,
@@ -6050,7 +6141,7 @@ function PageShell(props2) {
6050
6141
  onToggleCollapsed: props2.onToggleSidebarCollapsed
6051
6142
  }
6052
6143
  ),
6053
- /* @__PURE__ */ jsx22("section", { class: `${p18}-page-chat`, "aria-label": "Chat", children: props2.children })
6144
+ /* @__PURE__ */ jsx23("section", { class: `${p20}-page-chat`, "aria-label": "Chat", children: props2.children })
6054
6145
  ] });
6055
6146
  }
6056
6147
 
@@ -6088,7 +6179,7 @@ var atTabRoot = (s) => activeStack(s).length === 0;
6088
6179
 
6089
6180
  // src/ui/messenger-home.tsx
6090
6181
  import { useCallback as useCallback4, useEffect as useEffect14, useRef as useRef8 } from "preact/hooks";
6091
- import { useComputed as useComputed6 } from "@preact/signals";
6182
+ import { useComputed as useComputed7 } from "@preact/signals";
6092
6183
 
6093
6184
  // src/ui/modules/chat.tsx
6094
6185
  var chatLayout = {
@@ -6100,80 +6191,80 @@ var chatLayout = {
6100
6191
  import { useEffect as useEffect10, useMemo as useMemo2, useState as useState8 } from "preact/hooks";
6101
6192
 
6102
6193
  // src/ui/back-header.tsx
6103
- import { jsx as jsx23, jsxs as jsxs19 } from "preact/jsx-runtime";
6104
- var p19 = BRAND.cssPrefix;
6194
+ import { jsx as jsx24, jsxs as jsxs20 } from "preact/jsx-runtime";
6195
+ var p21 = BRAND.cssPrefix;
6105
6196
  function TitleBar({ title, actions }) {
6106
- return /* @__PURE__ */ jsxs19("header", { class: `${p19}-back-header`, "data-variant": "title", children: [
6107
- /* @__PURE__ */ jsx23("span", { class: `${p19}-back-spacer`, "aria-hidden": "true" }),
6108
- /* @__PURE__ */ jsx23("h1", { class: `${p19}-back-title`, children: title }),
6109
- actions ?? /* @__PURE__ */ jsx23("span", { class: `${p19}-back-spacer`, "aria-hidden": "true" })
6197
+ return /* @__PURE__ */ jsxs20("header", { class: `${p21}-back-header`, "data-variant": "title", children: [
6198
+ /* @__PURE__ */ jsx24("span", { class: `${p21}-back-spacer`, "aria-hidden": "true" }),
6199
+ /* @__PURE__ */ jsx24("h1", { class: `${p21}-back-title`, children: title }),
6200
+ actions ?? /* @__PURE__ */ jsx24("span", { class: `${p21}-back-spacer`, "aria-hidden": "true" })
6110
6201
  ] });
6111
6202
  }
6112
6203
  function BackHeader({ title, backLabel, onBack, actions, testid }) {
6113
- return /* @__PURE__ */ jsxs19("header", { class: `${p19}-back-header`, "data-testid": testid, children: [
6114
- /* @__PURE__ */ jsx23("button", { type: "button", class: `${p19}-icon-btn`, onClick: onBack, "aria-label": backLabel, title: backLabel, children: /* @__PURE__ */ jsx23(BackIcon, {}) }),
6115
- /* @__PURE__ */ jsx23("h1", { class: `${p19}-back-title`, children: title }),
6116
- actions ?? /* @__PURE__ */ jsx23("span", { class: `${p19}-back-spacer`, "aria-hidden": "true" })
6204
+ return /* @__PURE__ */ jsxs20("header", { class: `${p21}-back-header`, "data-testid": testid, children: [
6205
+ /* @__PURE__ */ jsx24("button", { type: "button", class: `${p21}-icon-btn`, onClick: onBack, "aria-label": backLabel, title: backLabel, children: /* @__PURE__ */ jsx24(BackIcon, {}) }),
6206
+ /* @__PURE__ */ jsx24("h1", { class: `${p21}-back-title`, children: title }),
6207
+ actions ?? /* @__PURE__ */ jsx24("span", { class: `${p21}-back-spacer`, "aria-hidden": "true" })
6117
6208
  ] });
6118
6209
  }
6119
6210
 
6120
6211
  // src/ui/home-search.tsx
6121
- import { jsx as jsx24, jsxs as jsxs20 } from "preact/jsx-runtime";
6122
- var p20 = BRAND.cssPrefix;
6212
+ import { jsx as jsx25, jsxs as jsxs21 } from "preact/jsx-runtime";
6213
+ var p22 = BRAND.cssPrefix;
6123
6214
  function HomeSearchButton({ placeholder, onActivate }) {
6124
- return /* @__PURE__ */ jsxs20("button", { type: "button", class: `${p20}-home-search`, onClick: onActivate, "data-testid": TID.homeSearch, children: [
6125
- /* @__PURE__ */ jsx24("span", { class: `${p20}-home-search-text`, children: placeholder }),
6126
- /* @__PURE__ */ jsx24("span", { class: `${p20}-home-search-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx24(SearchIcon, {}) })
6215
+ return /* @__PURE__ */ jsxs21("button", { type: "button", class: `${p22}-home-search`, onClick: onActivate, "data-testid": TID.homeSearch, children: [
6216
+ /* @__PURE__ */ jsx25("span", { class: `${p22}-home-search-text`, children: placeholder }),
6217
+ /* @__PURE__ */ jsx25("span", { class: `${p22}-home-search-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx25(SearchIcon, {}) })
6127
6218
  ] });
6128
6219
  }
6129
6220
  function HelpSearchInput({ placeholder, value, onInput }) {
6130
- return /* @__PURE__ */ jsxs20("div", { class: `${p20}-home-search`, "data-input": "true", children: [
6131
- /* @__PURE__ */ jsx24(
6221
+ return /* @__PURE__ */ jsxs21("div", { class: `${p22}-home-search`, "data-input": "true", children: [
6222
+ /* @__PURE__ */ jsx25(
6132
6223
  "input",
6133
6224
  {
6134
6225
  type: "search",
6135
- class: `${p20}-home-search-input`,
6226
+ class: `${p22}-home-search-input`,
6136
6227
  placeholder,
6137
6228
  value,
6138
6229
  onInput: (e) => onInput(e.currentTarget.value),
6139
6230
  "data-testid": TID.helpSearch
6140
6231
  }
6141
6232
  ),
6142
- /* @__PURE__ */ jsx24("span", { class: `${p20}-home-search-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx24(SearchIcon, {}) })
6233
+ /* @__PURE__ */ jsx25("span", { class: `${p22}-home-search-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx25(SearchIcon, {}) })
6143
6234
  ] });
6144
6235
  }
6145
6236
 
6146
6237
  // src/ui/list-row.tsx
6147
- import { jsx as jsx25, jsxs as jsxs21 } from "preact/jsx-runtime";
6148
- var p21 = BRAND.cssPrefix;
6238
+ import { jsx as jsx26, jsxs as jsxs22 } from "preact/jsx-runtime";
6239
+ var p23 = BRAND.cssPrefix;
6149
6240
  function ListRow({ title, subtitle, onClick, testid }) {
6150
- return /* @__PURE__ */ jsxs21("button", { type: "button", class: `${p21}-list-row`, onClick, "data-testid": testid, children: [
6151
- /* @__PURE__ */ jsxs21("span", { class: `${p21}-list-row-body`, children: [
6152
- /* @__PURE__ */ jsx25("span", { class: `${p21}-list-row-title`, children: title }),
6153
- subtitle ? /* @__PURE__ */ jsx25("span", { class: `${p21}-list-row-sub`, children: subtitle }) : null
6241
+ return /* @__PURE__ */ jsxs22("button", { type: "button", class: `${p23}-list-row`, onClick, "data-testid": testid, children: [
6242
+ /* @__PURE__ */ jsxs22("span", { class: `${p23}-list-row-body`, children: [
6243
+ /* @__PURE__ */ jsx26("span", { class: `${p23}-list-row-title`, children: title }),
6244
+ subtitle ? /* @__PURE__ */ jsx26("span", { class: `${p23}-list-row-sub`, children: subtitle }) : null
6154
6245
  ] }),
6155
- /* @__PURE__ */ jsx25("span", { class: `${p21}-list-row-chevron`, "aria-hidden": "true", children: /* @__PURE__ */ jsx25(ChevronRightIcon, {}) })
6246
+ /* @__PURE__ */ jsx26("span", { class: `${p23}-list-row-chevron`, "aria-hidden": "true", children: /* @__PURE__ */ jsx26(ChevronRightIcon, {}) })
6156
6247
  ] });
6157
6248
  }
6158
6249
 
6159
6250
  // src/ui/module-state.tsx
6160
- import { jsx as jsx26, jsxs as jsxs22 } from "preact/jsx-runtime";
6161
- var p22 = BRAND.cssPrefix;
6251
+ import { jsx as jsx27, jsxs as jsxs23 } from "preact/jsx-runtime";
6252
+ var p24 = BRAND.cssPrefix;
6162
6253
  function ModuleState({
6163
6254
  tone = "info",
6164
6255
  message,
6165
6256
  onRetry,
6166
6257
  strings
6167
6258
  }) {
6168
- return /* @__PURE__ */ jsxs22("div", { class: `${p22}-module-empty`, role: tone === "error" ? "alert" : "status", "aria-live": "polite", children: [
6169
- /* @__PURE__ */ jsx26("span", { children: message }),
6170
- onRetry ? /* @__PURE__ */ jsx26("button", { type: "button", class: `${p22}-module-retry`, onClick: onRetry, children: strings.errorRetry }) : null
6259
+ return /* @__PURE__ */ jsxs23("div", { class: `${p24}-module-empty`, role: tone === "error" ? "alert" : "status", "aria-live": "polite", children: [
6260
+ /* @__PURE__ */ jsx27("span", { children: message }),
6261
+ onRetry ? /* @__PURE__ */ jsx27("button", { type: "button", class: `${p24}-module-retry`, onClick: onRetry, children: strings.errorRetry }) : null
6171
6262
  ] });
6172
6263
  }
6173
6264
 
6174
6265
  // src/ui/modules/help.tsx
6175
- import { jsx as jsx27, jsxs as jsxs23 } from "preact/jsx-runtime";
6176
- var p23 = BRAND.cssPrefix;
6266
+ import { jsx as jsx28, jsxs as jsxs24 } from "preact/jsx-runtime";
6267
+ var p25 = BRAND.cssPrefix;
6177
6268
  var log12 = logger.scope("help");
6178
6269
  var openArticle = (nav, a) => a.url ? nav.push({ kind: "iframe", url: a.url, title: a.title }) : nav.push({ kind: "content", id: a.id, title: a.title });
6179
6270
  function groupByCategory(items) {
@@ -6202,7 +6293,7 @@ function fuzzySearch(items, query) {
6202
6293
  return items.map((item) => ({ item, score: Math.max(fuzzyScore(q, item.title) * 2, fuzzyScore(q, item.description ?? "")) })).filter((r) => r.score > 0).toSorted((a, b) => b.score - a.score).map((r) => r.item);
6203
6294
  }
6204
6295
  function ArticleRow({ article, nav }) {
6205
- return /* @__PURE__ */ jsx27(
6296
+ return /* @__PURE__ */ jsx28(
6206
6297
  ListRow,
6207
6298
  {
6208
6299
  title: article.title,
@@ -6247,46 +6338,46 @@ function HelpRoot({ transport, strings, config, nav, bus, panelProps }) {
6247
6338
  }, [query, results, bus]);
6248
6339
  function renderBody() {
6249
6340
  if (query.trim().length > 0) {
6250
- if (results.length === 0) return /* @__PURE__ */ jsx27(ModuleState, { message: strings.helpSearchEmpty, strings });
6251
- return /* @__PURE__ */ jsx27("div", { class: `${p23}-help-card`, children: results.map((a) => /* @__PURE__ */ jsx27(ArticleRow, { article: a, nav }, a.id)) });
6341
+ if (results.length === 0) return /* @__PURE__ */ jsx28(ModuleState, { message: strings.helpSearchEmpty, strings });
6342
+ return /* @__PURE__ */ jsx28("div", { class: `${p25}-help-card`, children: results.map((a) => /* @__PURE__ */ jsx28(ArticleRow, { article: a, nav }, a.id)) });
6252
6343
  }
6253
- if (state === "loading") return /* @__PURE__ */ jsx27(ModuleState, { message: strings.helpLoading, strings });
6344
+ if (state === "loading") return /* @__PURE__ */ jsx28(ModuleState, { message: strings.helpLoading, strings });
6254
6345
  if (state === "error") {
6255
- return /* @__PURE__ */ jsx27(ModuleState, { tone: "error", message: errorMsg, onRetry: () => setReloadKey((k) => k + 1), strings });
6346
+ return /* @__PURE__ */ jsx28(ModuleState, { tone: "error", message: errorMsg, onRetry: () => setReloadKey((k) => k + 1), strings });
6256
6347
  }
6257
- if (items.length === 0) return /* @__PURE__ */ jsx27(ModuleState, { message: strings.helpEmpty, strings });
6258
- return groupByCategory(items).map(([category, rows]) => /* @__PURE__ */ jsxs23("section", { class: `${p23}-help-group`, children: [
6259
- category ? /* @__PURE__ */ jsx27("h2", { class: `${p23}-help-section-title`, children: category }) : null,
6260
- /* @__PURE__ */ jsx27("div", { class: `${p23}-help-card`, children: rows.map((a) => /* @__PURE__ */ jsx27(ArticleRow, { article: a, nav }, a.id)) })
6348
+ if (items.length === 0) return /* @__PURE__ */ jsx28(ModuleState, { message: strings.helpEmpty, strings });
6349
+ return groupByCategory(items).map(([category, rows]) => /* @__PURE__ */ jsxs24("section", { class: `${p25}-help-group`, children: [
6350
+ category ? /* @__PURE__ */ jsx28("h2", { class: `${p25}-help-section-title`, children: category }) : null,
6351
+ /* @__PURE__ */ jsx28("div", { class: `${p25}-help-card`, children: rows.map((a) => /* @__PURE__ */ jsx28(ArticleRow, { article: a, nav }, a.id)) })
6261
6352
  ] }, category));
6262
6353
  }
6263
- return /* @__PURE__ */ jsxs23("div", { class: `${p23}-module`, children: [
6264
- /* @__PURE__ */ jsx27(TitleBar, { title: strings.helpTitle, actions: /* @__PURE__ */ jsx27(HeaderActions, { panelProps, variant: "plain" }) }),
6265
- /* @__PURE__ */ jsx27("div", { class: `${p23}-module-pad`, children: /* @__PURE__ */ jsx27(HelpSearchInput, { placeholder: strings.helpSearchPlaceholder, value: query, onInput: setQuery }) }),
6266
- /* @__PURE__ */ jsx27("div", { class: `${p23}-help-list`, children: renderBody() })
6354
+ return /* @__PURE__ */ jsxs24("div", { class: `${p25}-module`, children: [
6355
+ /* @__PURE__ */ jsx28(TitleBar, { title: strings.helpTitle, actions: /* @__PURE__ */ jsx28(HeaderActions, { panelProps, variant: "plain" }) }),
6356
+ /* @__PURE__ */ jsx28("div", { class: `${p25}-module-pad`, children: /* @__PURE__ */ jsx28(HelpSearchInput, { placeholder: strings.helpSearchPlaceholder, value: query, onInput: setQuery }) }),
6357
+ /* @__PURE__ */ jsx28("div", { class: `${p25}-help-list`, children: renderBody() })
6267
6358
  ] });
6268
6359
  }
6269
6360
  var helpLayout = {
6270
6361
  Icon: HelpIcon,
6271
- Root: (props2) => /* @__PURE__ */ jsx27(HelpRoot, { ...props2 })
6362
+ Root: (props2) => /* @__PURE__ */ jsx28(HelpRoot, { ...props2 })
6272
6363
  };
6273
6364
 
6274
6365
  // src/ui/modules/home.tsx
6275
6366
  import { useEffect as useEffect11, useState as useState9 } from "preact/hooks";
6276
6367
 
6277
6368
  // src/ui/home-card.tsx
6278
- import { jsx as jsx28 } from "preact/jsx-runtime";
6279
- var p24 = BRAND.cssPrefix;
6369
+ import { jsx as jsx29 } from "preact/jsx-runtime";
6370
+ var p26 = BRAND.cssPrefix;
6280
6371
  function HomeCard({ onClick, children, testid }) {
6281
6372
  if (onClick) {
6282
- return /* @__PURE__ */ jsx28("button", { type: "button", class: `${p24}-home-card`, "data-interactive": "true", onClick, "data-testid": testid, children });
6373
+ return /* @__PURE__ */ jsx29("button", { type: "button", class: `${p26}-home-card`, "data-interactive": "true", onClick, "data-testid": testid, children });
6283
6374
  }
6284
- return /* @__PURE__ */ jsx28("div", { class: `${p24}-home-card`, "data-testid": testid, children });
6375
+ return /* @__PURE__ */ jsx29("div", { class: `${p26}-home-card`, "data-testid": testid, children });
6285
6376
  }
6286
6377
 
6287
6378
  // src/ui/modules/home.tsx
6288
- import { Fragment as Fragment6, jsx as jsx29, jsxs as jsxs24 } from "preact/jsx-runtime";
6289
- var p25 = BRAND.cssPrefix;
6379
+ import { Fragment as Fragment6, jsx as jsx30, jsxs as jsxs25 } from "preact/jsx-runtime";
6380
+ var p27 = BRAND.cssPrefix;
6290
6381
  var log13 = logger.scope("home");
6291
6382
  function resolveGreeting(props2) {
6292
6383
  const name = props2.options.userContext?.name;
@@ -6329,49 +6420,49 @@ function HomeRoot(props2) {
6329
6420
  const status = config.status;
6330
6421
  const statusText = status?.text ? localizeText(strings, status.text) : strings.homeStatus;
6331
6422
  const contentTitle = config.contentBlockTitle ? localizeText(strings, config.contentBlockTitle) : strings.homeContentTitle;
6332
- return /* @__PURE__ */ jsx29("div", { class: `${p25}-module ${p25}-home`, "data-testid": TID.homeView, children: /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-scroll`, children: [
6333
- /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-hero`, children: [
6334
- /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-hero-top`, children: [
6335
- config.brandName ? /* @__PURE__ */ jsx29("span", { class: `${p25}-home-brand`, "data-testid": TID.homeBrand, children: config.brandName }) : /* @__PURE__ */ jsx29("span", { class: `${p25}-home-brand-spacer`, "aria-hidden": "true" }),
6336
- /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-hero-actions`, children: [
6337
- avatars.length > 0 ? /* @__PURE__ */ jsx29("div", { class: `${p25}-home-avatars`, children: avatars.map((a) => /* @__PURE__ */ jsx29("span", { class: `${p25}-home-avatar`, title: a.role ? `${a.name} \xB7 ${a.role}` : a.name, children: a.avatar ? /* @__PURE__ */ jsx29("img", { src: a.avatar, alt: "", loading: "lazy" }) : /* @__PURE__ */ jsx29("span", { children: initials(a.name) }) }, a.name)) }) : null,
6338
- /* @__PURE__ */ jsx29(HeaderActions, { panelProps, variant: "plain" })
6423
+ return /* @__PURE__ */ jsx30("div", { class: `${p27}-module ${p27}-home`, "data-testid": TID.homeView, children: /* @__PURE__ */ jsxs25("div", { class: `${p27}-home-scroll`, children: [
6424
+ /* @__PURE__ */ jsxs25("div", { class: `${p27}-home-hero`, children: [
6425
+ /* @__PURE__ */ jsxs25("div", { class: `${p27}-home-hero-top`, children: [
6426
+ config.brandName ? /* @__PURE__ */ jsx30("span", { class: `${p27}-home-brand`, "data-testid": TID.homeBrand, children: config.brandName }) : /* @__PURE__ */ jsx30("span", { class: `${p27}-home-brand-spacer`, "aria-hidden": "true" }),
6427
+ /* @__PURE__ */ jsxs25("div", { class: `${p27}-home-hero-actions`, children: [
6428
+ avatars.length > 0 ? /* @__PURE__ */ jsx30("div", { class: `${p27}-home-avatars`, children: avatars.map((a) => /* @__PURE__ */ jsx30("span", { class: `${p27}-home-avatar`, title: a.role ? `${a.name} \xB7 ${a.role}` : a.name, children: a.avatar ? /* @__PURE__ */ jsx30("img", { src: a.avatar, alt: "", loading: "lazy" }) : /* @__PURE__ */ jsx30("span", { children: initials(a.name) }) }, a.name)) }) : null,
6429
+ /* @__PURE__ */ jsx30(HeaderActions, { panelProps, variant: "plain" })
6339
6430
  ] })
6340
6431
  ] }),
6341
- config.showGreeting !== false ? /* @__PURE__ */ jsxs24(Fragment6, { children: [
6342
- /* @__PURE__ */ jsx29("h1", { class: `${p25}-home-greeting`, "data-testid": TID.homeGreeting, children: greeting.title }),
6343
- greeting.subtitle ? /* @__PURE__ */ jsx29("p", { class: `${p25}-home-lead`, children: greeting.subtitle }) : null
6432
+ config.showGreeting !== false ? /* @__PURE__ */ jsxs25(Fragment6, { children: [
6433
+ /* @__PURE__ */ jsx30("h1", { class: `${p27}-home-greeting`, "data-testid": TID.homeGreeting, children: greeting.title }),
6434
+ greeting.subtitle ? /* @__PURE__ */ jsx30("p", { class: `${p27}-home-lead`, children: greeting.subtitle }) : null
6344
6435
  ] }) : null
6345
6436
  ] }),
6346
- /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-cards`, children: [
6347
- config.showSearchBar !== false ? /* @__PURE__ */ jsx29(
6437
+ /* @__PURE__ */ jsxs25("div", { class: `${p27}-home-cards`, children: [
6438
+ config.showSearchBar !== false ? /* @__PURE__ */ jsx30(
6348
6439
  HomeSearchButton,
6349
6440
  {
6350
6441
  placeholder: strings.homeSearchPlaceholder,
6351
6442
  onActivate: () => nav.switchToLayout("help")
6352
6443
  }
6353
6444
  ) : null,
6354
- recent ? /* @__PURE__ */ jsx29(HomeCard, { onClick: () => nav.selectConversation(recent.conversationId), testid: TID.homeRecent, children: /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-recent-row`, "data-unread": (recent.unreadCount ?? 0) > 0 ? "true" : void 0, children: [
6355
- /* @__PURE__ */ jsx29("span", { class: `${p25}-home-recent-avatar`, "aria-hidden": "true", children: /* @__PURE__ */ jsx29(BubblesIcon, {}) }),
6356
- /* @__PURE__ */ jsxs24("span", { class: `${p25}-home-recent-body`, children: [
6357
- /* @__PURE__ */ jsx29("span", { class: `${p25}-home-recent-title`, children: recent.title }),
6358
- recent.preview ? /* @__PURE__ */ jsx29("span", { class: `${p25}-home-recent-preview`, children: recent.preview }) : null
6445
+ recent ? /* @__PURE__ */ jsx30(HomeCard, { onClick: () => nav.selectConversation(recent.conversationId), testid: TID.homeRecent, children: /* @__PURE__ */ jsxs25("div", { class: `${p27}-home-recent-row`, "data-unread": (recent.unreadCount ?? 0) > 0 ? "true" : void 0, children: [
6446
+ /* @__PURE__ */ jsx30("span", { class: `${p27}-home-recent-avatar`, "aria-hidden": "true", children: /* @__PURE__ */ jsx30(BubblesIcon, {}) }),
6447
+ /* @__PURE__ */ jsxs25("span", { class: `${p27}-home-recent-body`, children: [
6448
+ /* @__PURE__ */ jsx30("span", { class: `${p27}-home-recent-title`, children: recent.title }),
6449
+ recent.preview ? /* @__PURE__ */ jsx30("span", { class: `${p27}-home-recent-preview`, children: recent.preview }) : null
6359
6450
  ] }),
6360
- (recent.unreadCount ?? 0) > 0 ? /* @__PURE__ */ jsx29("span", { class: `${p25}-home-recent-dot`, "aria-label": "Unread" }) : null
6451
+ (recent.unreadCount ?? 0) > 0 ? /* @__PURE__ */ jsx30("span", { class: `${p27}-home-recent-dot`, "aria-label": "Unread" }) : null
6361
6452
  ] }) }) : null,
6362
- status ? /* @__PURE__ */ jsx29(
6453
+ status ? /* @__PURE__ */ jsx30(
6363
6454
  HomeCard,
6364
6455
  {
6365
6456
  onClick: status.url ? () => nav.push({ kind: "iframe", url: status.url, title: statusText }) : void 0,
6366
- children: /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-status`, "data-level": status.level ?? "operational", children: [
6367
- /* @__PURE__ */ jsx29("span", { class: `${p25}-home-status-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx29(StatusOkIcon, {}) }),
6368
- /* @__PURE__ */ jsx29("span", { class: `${p25}-home-status-text`, children: statusText })
6457
+ children: /* @__PURE__ */ jsxs25("div", { class: `${p27}-home-status`, "data-level": status.level ?? "operational", children: [
6458
+ /* @__PURE__ */ jsx30("span", { class: `${p27}-home-status-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx30(StatusOkIcon, {}) }),
6459
+ /* @__PURE__ */ jsx30("span", { class: `${p27}-home-status-text`, children: statusText })
6369
6460
  ] })
6370
6461
  }
6371
6462
  ) : null,
6372
- content.length > 0 ? /* @__PURE__ */ jsxs24("section", { class: `${p25}-home-content`, children: [
6373
- /* @__PURE__ */ jsx29("div", { class: `${p25}-home-content-title`, children: contentTitle }),
6374
- /* @__PURE__ */ jsx29("div", { class: `${p25}-home-content-list`, children: content.map((item) => /* @__PURE__ */ jsx29(
6463
+ content.length > 0 ? /* @__PURE__ */ jsxs25("section", { class: `${p27}-home-content`, children: [
6464
+ /* @__PURE__ */ jsx30("div", { class: `${p27}-home-content-title`, children: contentTitle }),
6465
+ /* @__PURE__ */ jsx30("div", { class: `${p27}-home-content-list`, children: content.map((item) => /* @__PURE__ */ jsx30(
6375
6466
  ListRow,
6376
6467
  {
6377
6468
  title: item.title,
@@ -6387,13 +6478,13 @@ function HomeRoot(props2) {
6387
6478
  }
6388
6479
  var homeLayout = {
6389
6480
  Icon: HomeIcon,
6390
- Root: (props2) => /* @__PURE__ */ jsx29(HomeRoot, { ...props2 })
6481
+ Root: (props2) => /* @__PURE__ */ jsx30(HomeRoot, { ...props2 })
6391
6482
  };
6392
6483
 
6393
6484
  // src/ui/modules/news.tsx
6394
6485
  import { useEffect as useEffect12, useState as useState10 } from "preact/hooks";
6395
- import { jsx as jsx30, jsxs as jsxs25 } from "preact/jsx-runtime";
6396
- var p26 = BRAND.cssPrefix;
6486
+ import { jsx as jsx31, jsxs as jsxs26 } from "preact/jsx-runtime";
6487
+ var p28 = BRAND.cssPrefix;
6397
6488
  var log14 = logger.scope("news");
6398
6489
  function NewsRoot({ transport, strings, config, nav, bus, panelProps }) {
6399
6490
  const tags = config.contentTags;
@@ -6421,37 +6512,37 @@ function NewsRoot({ transport, strings, config, nav, bus, panelProps }) {
6421
6512
  };
6422
6513
  }, [transport, tags, reloadKey, bus]);
6423
6514
  function renderBody() {
6424
- if (state === "loading") return /* @__PURE__ */ jsx30(ModuleState, { message: strings.newsLoading, strings });
6515
+ if (state === "loading") return /* @__PURE__ */ jsx31(ModuleState, { message: strings.newsLoading, strings });
6425
6516
  if (state === "error") {
6426
- return /* @__PURE__ */ jsx30(ModuleState, { tone: "error", message: errorMsg, onRetry: () => setReloadKey((k) => k + 1), strings });
6517
+ return /* @__PURE__ */ jsx31(ModuleState, { tone: "error", message: errorMsg, onRetry: () => setReloadKey((k) => k + 1), strings });
6427
6518
  }
6428
- if (items.length === 0) return /* @__PURE__ */ jsx30(ModuleState, { message: strings.newsEmpty, strings });
6429
- return /* @__PURE__ */ jsx30("div", { class: `${p26}-news-list`, children: items.map((item) => /* @__PURE__ */ jsxs25(
6519
+ if (items.length === 0) return /* @__PURE__ */ jsx31(ModuleState, { message: strings.newsEmpty, strings });
6520
+ return /* @__PURE__ */ jsx31("div", { class: `${p28}-news-list`, children: items.map((item) => /* @__PURE__ */ jsxs26(
6430
6521
  "button",
6431
6522
  {
6432
6523
  type: "button",
6433
- class: `${p26}-news-card`,
6524
+ class: `${p28}-news-card`,
6434
6525
  onClick: () => nav.push({ kind: "content", id: item.id, title: item.title }),
6435
6526
  "data-testid": tid(TID.newsItem, item.id),
6436
6527
  children: [
6437
- item.image ? /* @__PURE__ */ jsx30("img", { class: `${p26}-news-hero`, src: item.image, alt: "", loading: "lazy" }) : null,
6438
- /* @__PURE__ */ jsxs25("span", { class: `${p26}-news-body`, children: [
6439
- /* @__PURE__ */ jsx30("span", { class: `${p26}-news-title`, children: item.title }),
6440
- item.description ? /* @__PURE__ */ jsx30("span", { class: `${p26}-news-summary`, children: item.description }) : null
6528
+ item.image ? /* @__PURE__ */ jsx31("img", { class: `${p28}-news-hero`, src: item.image, alt: "", loading: "lazy" }) : null,
6529
+ /* @__PURE__ */ jsxs26("span", { class: `${p28}-news-body`, children: [
6530
+ /* @__PURE__ */ jsx31("span", { class: `${p28}-news-title`, children: item.title }),
6531
+ item.description ? /* @__PURE__ */ jsx31("span", { class: `${p28}-news-summary`, children: item.description }) : null
6441
6532
  ] })
6442
6533
  ]
6443
6534
  },
6444
6535
  item.id
6445
6536
  )) });
6446
6537
  }
6447
- return /* @__PURE__ */ jsxs25("div", { class: `${p26}-module`, children: [
6448
- /* @__PURE__ */ jsx30(TitleBar, { title: strings.newsTitle, actions: /* @__PURE__ */ jsx30(HeaderActions, { panelProps, variant: "plain" }) }),
6449
- /* @__PURE__ */ jsx30("div", { class: `${p26}-module-scroll`, children: renderBody() })
6538
+ return /* @__PURE__ */ jsxs26("div", { class: `${p28}-module`, children: [
6539
+ /* @__PURE__ */ jsx31(TitleBar, { title: strings.newsTitle, actions: /* @__PURE__ */ jsx31(HeaderActions, { panelProps, variant: "plain" }) }),
6540
+ /* @__PURE__ */ jsx31("div", { class: `${p28}-module-scroll`, children: renderBody() })
6450
6541
  ] });
6451
6542
  }
6452
6543
  var newsLayout = {
6453
6544
  Icon: NewsIcon,
6454
- Root: (props2) => /* @__PURE__ */ jsx30(NewsRoot, { ...props2 })
6545
+ Root: (props2) => /* @__PURE__ */ jsx31(NewsRoot, { ...props2 })
6455
6546
  };
6456
6547
 
6457
6548
  // src/ui/modules/registry.ts
@@ -6463,28 +6554,28 @@ var LAYOUTS = {
6463
6554
  };
6464
6555
 
6465
6556
  // src/ui/home-tab-bar.tsx
6466
- import { jsx as jsx31, jsxs as jsxs26 } from "preact/jsx-runtime";
6467
- var p27 = BRAND.cssPrefix;
6557
+ import { jsx as jsx32, jsxs as jsxs27 } from "preact/jsx-runtime";
6558
+ var p29 = BRAND.cssPrefix;
6468
6559
  function HomeTabBar({ modules, activeTab, strings, unreadCount, onSelect }) {
6469
- return /* @__PURE__ */ jsx31("nav", { class: `${p27}-tabbar`, role: "tablist", "aria-label": strings.panelTitle, children: modules.map((m) => {
6560
+ return /* @__PURE__ */ jsx32("nav", { class: `${p29}-tabbar`, role: "tablist", "aria-label": strings.panelTitle, children: modules.map((m) => {
6470
6561
  const Icon = LAYOUTS[m.layout].Icon;
6471
6562
  const selected = m.id === activeTab;
6472
6563
  const badge = m.layout === "chat" && unreadCount > 0 ? unreadCount > 9 ? "9+" : String(unreadCount) : null;
6473
- return /* @__PURE__ */ jsxs26(
6564
+ return /* @__PURE__ */ jsxs27(
6474
6565
  "button",
6475
6566
  {
6476
6567
  type: "button",
6477
6568
  role: "tab",
6478
6569
  "aria-selected": selected,
6479
- class: `${p27}-tab`,
6570
+ class: `${p29}-tab`,
6480
6571
  onClick: () => onSelect(m.id),
6481
6572
  "data-testid": tid(TID.tab, m.id),
6482
6573
  children: [
6483
- /* @__PURE__ */ jsxs26("span", { class: `${p27}-tab-icon`, "aria-hidden": "true", children: [
6484
- /* @__PURE__ */ jsx31(Icon, {}),
6485
- badge ? /* @__PURE__ */ jsx31("span", { class: `${p27}-tab-badge`, "data-testid": TID.tabBadge, children: badge }) : null
6574
+ /* @__PURE__ */ jsxs27("span", { class: `${p29}-tab-icon`, "aria-hidden": "true", children: [
6575
+ /* @__PURE__ */ jsx32(Icon, {}),
6576
+ badge ? /* @__PURE__ */ jsx32("span", { class: `${p29}-tab-badge`, "data-testid": TID.tabBadge, children: badge }) : null
6486
6577
  ] }),
6487
- /* @__PURE__ */ jsx31("span", { class: `${p27}-tab-label`, children: localizeText(strings, m.label) })
6578
+ /* @__PURE__ */ jsx32("span", { class: `${p29}-tab-label`, children: localizeText(strings, m.label) })
6488
6579
  ]
6489
6580
  },
6490
6581
  m.id
@@ -6493,12 +6584,12 @@ function HomeTabBar({ modules, activeTab, strings, unreadCount, onSelect }) {
6493
6584
  }
6494
6585
 
6495
6586
  // src/ui/iframe-view.tsx
6496
- import { jsx as jsx32, jsxs as jsxs27 } from "preact/jsx-runtime";
6497
- var p28 = BRAND.cssPrefix;
6587
+ import { jsx as jsx33, jsxs as jsxs28 } from "preact/jsx-runtime";
6588
+ var p30 = BRAND.cssPrefix;
6498
6589
  var SANDBOX = "allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";
6499
6590
  function IframeView({ url, title, strings, onBack, actions }) {
6500
- return /* @__PURE__ */ jsxs27("div", { class: `${p28}-module`, children: [
6501
- /* @__PURE__ */ jsx32(
6591
+ return /* @__PURE__ */ jsxs28("div", { class: `${p30}-module`, children: [
6592
+ /* @__PURE__ */ jsx33(
6502
6593
  BackHeader,
6503
6594
  {
6504
6595
  title: title || strings.moduleBack,
@@ -6507,10 +6598,10 @@ function IframeView({ url, title, strings, onBack, actions }) {
6507
6598
  actions
6508
6599
  }
6509
6600
  ),
6510
- /* @__PURE__ */ jsx32(
6601
+ /* @__PURE__ */ jsx33(
6511
6602
  "iframe",
6512
6603
  {
6513
- class: `${p28}-content-frame`,
6604
+ class: `${p30}-content-frame`,
6514
6605
  src: url,
6515
6606
  title: title || "content",
6516
6607
  sandbox: SANDBOX,
@@ -6524,8 +6615,8 @@ function IframeView({ url, title, strings, onBack, actions }) {
6524
6615
 
6525
6616
  // src/ui/content-view.tsx
6526
6617
  import { useCallback as useCallback3, useEffect as useEffect13, useState as useState11 } from "preact/hooks";
6527
- import { jsx as jsx33, jsxs as jsxs28 } from "preact/jsx-runtime";
6528
- var p29 = BRAND.cssPrefix;
6618
+ import { jsx as jsx34, jsxs as jsxs29 } from "preact/jsx-runtime";
6619
+ var p31 = BRAND.cssPrefix;
6529
6620
  var log15 = logger.scope("content");
6530
6621
  var READ_DWELL_MS = 5e3;
6531
6622
  function ContentView({ id, title, transport, strings, bus, onBack, actions }) {
@@ -6569,16 +6660,16 @@ function ContentView({ id, title, transport, strings, bus, onBack, actions }) {
6569
6660
  [bus, id]
6570
6661
  );
6571
6662
  function renderBody() {
6572
- if (failed) return /* @__PURE__ */ jsx33(ModuleState, { tone: "error", message: strings.errorGeneric, onRetry: retry, strings });
6573
- if (item === null) return /* @__PURE__ */ jsx33(ModuleState, { message: strings.contentLoading, strings });
6574
- return /* @__PURE__ */ jsxs28("article", { class: `${p29}-content`, "data-testid": TID.contentView, onClick: onArticleClick, children: [
6575
- item.image ? /* @__PURE__ */ jsx33("img", { class: `${p29}-content-hero`, src: item.image, alt: "", loading: "lazy" }) : null,
6576
- item.description ? /* @__PURE__ */ jsx33("p", { class: `${p29}-content-subtitle`, children: item.description }) : null,
6577
- /* @__PURE__ */ jsx33(StaticMarkdown, { text: item.content ?? "" })
6663
+ if (failed) return /* @__PURE__ */ jsx34(ModuleState, { tone: "error", message: strings.errorGeneric, onRetry: retry, strings });
6664
+ if (item === null) return /* @__PURE__ */ jsx34(ModuleState, { message: strings.contentLoading, strings });
6665
+ return /* @__PURE__ */ jsxs29("article", { class: `${p31}-content`, "data-testid": TID.contentView, onClick: onArticleClick, children: [
6666
+ item.image ? /* @__PURE__ */ jsx34("img", { class: `${p31}-content-hero`, src: item.image, alt: "", loading: "lazy" }) : null,
6667
+ item.description ? /* @__PURE__ */ jsx34("p", { class: `${p31}-content-subtitle`, children: item.description }) : null,
6668
+ /* @__PURE__ */ jsx34(StaticMarkdown, { text: item.content ?? "" })
6578
6669
  ] });
6579
6670
  }
6580
- return /* @__PURE__ */ jsxs28("div", { class: `${p29}-module`, children: [
6581
- /* @__PURE__ */ jsx33(
6671
+ return /* @__PURE__ */ jsxs29("div", { class: `${p31}-module`, children: [
6672
+ /* @__PURE__ */ jsx34(
6582
6673
  BackHeader,
6583
6674
  {
6584
6675
  title: item?.title || title || strings.moduleBack,
@@ -6588,13 +6679,13 @@ function ContentView({ id, title, transport, strings, bus, onBack, actions }) {
6588
6679
  testid: TID.backHeader
6589
6680
  }
6590
6681
  ),
6591
- /* @__PURE__ */ jsx33("div", { class: `${p29}-module-scroll`, "data-testid": TID.contentScroll, children: renderBody() })
6682
+ /* @__PURE__ */ jsx34("div", { class: `${p31}-module-scroll`, "data-testid": TID.contentScroll, children: renderBody() })
6592
6683
  ] });
6593
6684
  }
6594
6685
 
6595
6686
  // src/ui/messenger-home.tsx
6596
- import { jsx as jsx34, jsxs as jsxs29 } from "preact/jsx-runtime";
6597
- var p30 = BRAND.cssPrefix;
6687
+ import { jsx as jsx35, jsxs as jsxs30 } from "preact/jsx-runtime";
6688
+ var p32 = BRAND.cssPrefix;
6598
6689
  function MessengerHome({
6599
6690
  panelProps,
6600
6691
  enabledModules,
@@ -6628,7 +6719,7 @@ function MessengerHome({
6628
6719
  }, []);
6629
6720
  const { visible: dragOver } = useFileDrop({ containerRef, onDrop: onDropItems });
6630
6721
  useDragMove(containerRef.current, options.mode === "modal");
6631
- const navState = useComputed6(() => nav.sig.value).value;
6722
+ const navState = useComputed7(() => nav.sig.value).value;
6632
6723
  const top = topScreen(navState);
6633
6724
  const activeModule = options.modules.byId[navState.activeTab];
6634
6725
  const isReader = top?.kind === "iframe" || top?.kind === "content";
@@ -6665,12 +6756,12 @@ function MessengerHome({
6665
6756
  bus,
6666
6757
  panelProps
6667
6758
  });
6668
- const plainActions = /* @__PURE__ */ jsx34(HeaderActions, { panelProps, variant: "plain" });
6759
+ const plainActions = /* @__PURE__ */ jsx35(HeaderActions, { panelProps, variant: "plain" });
6669
6760
  if (activeModule) visitedRef.current.add(activeModule.id);
6670
6761
  const visitedTabs = enabledModules.filter((m) => visitedRef.current.has(m.id));
6671
6762
  const tabRoot = (module) => {
6672
6763
  if (module.layout === "chat") {
6673
- return /* @__PURE__ */ jsx34(
6764
+ return /* @__PURE__ */ jsx35(
6674
6765
  PanelContent,
6675
6766
  {
6676
6767
  ...panelProps,
@@ -6681,14 +6772,14 @@ function MessengerHome({
6681
6772
  );
6682
6773
  }
6683
6774
  const Root = LAYOUTS[module.layout].Root;
6684
- return Root ? /* @__PURE__ */ jsx34(Root, { ...screenProps(module) }) : null;
6775
+ return Root ? /* @__PURE__ */ jsx35(Root, { ...screenProps(module) }) : null;
6685
6776
  };
6686
6777
  const renderReader = () => {
6687
6778
  if (top?.kind === "iframe") {
6688
- return /* @__PURE__ */ jsx34(IframeView, { url: top.url, title: top.title, strings, onBack: nav.pop, actions: plainActions });
6779
+ return /* @__PURE__ */ jsx35(IframeView, { url: top.url, title: top.title, strings, onBack: nav.pop, actions: plainActions });
6689
6780
  }
6690
6781
  if (top?.kind === "content") {
6691
- return /* @__PURE__ */ jsx34(
6782
+ return /* @__PURE__ */ jsx35(
6692
6783
  ContentView,
6693
6784
  {
6694
6785
  id: top.id,
@@ -6703,22 +6794,22 @@ function MessengerHome({
6703
6794
  }
6704
6795
  return null;
6705
6796
  };
6706
- return /* @__PURE__ */ jsxs29(
6797
+ return /* @__PURE__ */ jsxs30(
6707
6798
  "div",
6708
6799
  {
6709
6800
  ref: containerRef,
6710
- class: `${p30}-panel ${p30}-messenger`,
6801
+ class: `${p32}-panel ${p32}-messenger`,
6711
6802
  role: "dialog",
6712
6803
  "aria-modal": "false",
6713
6804
  "aria-label": strings.panelTitle,
6714
6805
  style: { position: "relative" },
6715
6806
  "data-testid": TID.messengerHome,
6716
6807
  children: [
6717
- /* @__PURE__ */ jsxs29("div", { class: `${p30}-messenger-body`, children: [
6718
- visitedTabs.map((m) => /* @__PURE__ */ jsx34("div", { class: `${p30}-messenger-pane`, hidden: isReader || m.id !== activeModule?.id, children: tabRoot(m) }, m.id)),
6808
+ /* @__PURE__ */ jsxs30("div", { class: `${p32}-messenger-body`, children: [
6809
+ visitedTabs.map((m) => /* @__PURE__ */ jsx35("div", { class: `${p32}-messenger-pane`, hidden: isReader || m.id !== activeModule?.id, children: tabRoot(m) }, m.id)),
6719
6810
  renderReader()
6720
6811
  ] }),
6721
- showTabBar ? /* @__PURE__ */ jsx34(
6812
+ showTabBar ? /* @__PURE__ */ jsx35(
6722
6813
  HomeTabBar,
6723
6814
  {
6724
6815
  modules: enabledModules,
@@ -6728,8 +6819,8 @@ function MessengerHome({
6728
6819
  onSelect: nav.switchTab
6729
6820
  }
6730
6821
  ) : null,
6731
- /* @__PURE__ */ jsx34(PoweredByBar, { poweredBy: options.poweredBy }),
6732
- options.size.resize?.enabled && !(activeModule?.layout === "chat" && !top) ? /* @__PURE__ */ jsx34(
6822
+ /* @__PURE__ */ jsx35(PoweredByBar, { poweredBy: options.poweredBy }),
6823
+ options.size.resize?.enabled && !(activeModule?.layout === "chat" && !top) ? /* @__PURE__ */ jsx35(
6733
6824
  ResizeGrip,
6734
6825
  {
6735
6826
  panelEl: containerRef.current,
@@ -6746,29 +6837,29 @@ function MessengerHome({
6746
6837
  }
6747
6838
 
6748
6839
  // src/ui/modules-empty.tsx
6749
- import { jsx as jsx35, jsxs as jsxs30 } from "preact/jsx-runtime";
6750
- var p31 = BRAND.cssPrefix;
6840
+ import { jsx as jsx36, jsxs as jsxs31 } from "preact/jsx-runtime";
6841
+ var p33 = BRAND.cssPrefix;
6751
6842
  function ModulesEmpty({ strings, onClose }) {
6752
- return /* @__PURE__ */ jsxs30(
6843
+ return /* @__PURE__ */ jsxs31(
6753
6844
  "div",
6754
6845
  {
6755
- class: `${p31}-panel ${p31}-modules-empty`,
6846
+ class: `${p33}-panel ${p33}-modules-empty`,
6756
6847
  role: "dialog",
6757
6848
  "aria-label": strings.panelTitle,
6758
6849
  "data-testid": TID.modulesEmpty,
6759
6850
  children: [
6760
- onClose ? /* @__PURE__ */ jsx35(
6851
+ onClose ? /* @__PURE__ */ jsx36(
6761
6852
  "button",
6762
6853
  {
6763
6854
  type: "button",
6764
- class: `${p31}-icon-btn ${p31}-modules-empty-close`,
6855
+ class: `${p33}-icon-btn ${p33}-modules-empty-close`,
6765
6856
  onClick: onClose,
6766
6857
  "aria-label": strings.close,
6767
6858
  title: strings.close,
6768
- children: /* @__PURE__ */ jsx35(CloseIcon, {})
6859
+ children: /* @__PURE__ */ jsx36(CloseIcon, {})
6769
6860
  }
6770
6861
  ) : null,
6771
- /* @__PURE__ */ jsx35("p", { class: `${p31}-modules-empty-text`, children: strings.modulesEmpty })
6862
+ /* @__PURE__ */ jsx36("p", { class: `${p33}-modules-empty-text`, children: strings.modulesEmpty })
6772
6863
  ]
6773
6864
  }
6774
6865
  );
@@ -6791,12 +6882,19 @@ function useLauncherCallout({ callout, persistence }) {
6791
6882
  }
6792
6883
 
6793
6884
  // src/ui/app.tsx
6794
- import { jsx as jsx36, jsxs as jsxs31 } from "preact/jsx-runtime";
6885
+ import { jsx as jsx37, jsxs as jsxs32 } from "preact/jsx-runtime";
6795
6886
  var log16 = logger.scope("app");
6796
- var p32 = BRAND.cssPrefix;
6887
+ var p34 = BRAND.cssPrefix;
6797
6888
  function makeLocalizedWelcome(w, strings) {
6798
6889
  return makeInstantWelcomeMessage({ ...w, text: localizeText(strings, w.text) });
6799
6890
  }
6891
+ function allToolPartsSettled(msg) {
6892
+ const tools = msg.partsSig.value.filter((p35) => p35.kind === "tool");
6893
+ return tools.length > 0 && tools.every((p35) => {
6894
+ const s = p35.stateSig.value;
6895
+ return s === "output-available" || s === "output-error" || s === "output-denied" || s === "approval-responded";
6896
+ });
6897
+ }
6800
6898
  function App({ options, hostElement, bus }) {
6801
6899
  const [persistence] = useState13(
6802
6900
  () => createPersistence(options.widgetId, options.storage, options.aiAgentDeploymentId)
@@ -7263,19 +7361,20 @@ function App({ options, hostElement, bus }) {
7263
7361
  return () => document.removeEventListener("keydown", onKey);
7264
7362
  }, [isOpen, options.mode]);
7265
7363
  const streamAssistant = useCallback6(
7266
- async (assistantMsg, trigger) => {
7364
+ async (assistantMsg, { continueExisting }) => {
7267
7365
  const activeConversationId = conversationIdSig.value ?? uuid7();
7268
7366
  if (!conversationIdSig.value) {
7269
7367
  conversationIdSig.value = activeConversationId;
7270
7368
  persistence.saveConversationId(activeConversationId);
7271
7369
  }
7370
+ const thread = continueExisting ? messagesSig.value : messagesSig.value.slice(0, -1);
7272
7371
  const body = buildSendMessageRequest({
7273
- messages: messagesSig.value.slice(0, -1).map(fromReactive),
7372
+ messages: thread.map(fromReactive),
7274
7373
  conversationId: activeConversationId,
7374
+ // The assistant message being generated / resumed.
7375
+ messageId: assistantMsg.id,
7275
7376
  // textModel + imageModel are backend-only — selected per deployment.
7276
7377
  tools: options.features.tools,
7277
- responseMode: options.responseMode,
7278
- trigger,
7279
7378
  // Identity + preferences ride on every message — server may need
7280
7379
  // them to route, persist, or reconcile in-flight.
7281
7380
  visitorId,
@@ -7309,23 +7408,23 @@ function App({ options, hostElement, bus }) {
7309
7408
  },
7310
7409
  [transport, reducer, messagesSig, conversationIdSig, options, bus, feedback, persistence, visitorId]
7311
7410
  );
7312
- const resolveTool = useCallback6(
7313
- (toolCallId, trigger, mutate) => {
7411
+ const decideTool = useCallback6(
7412
+ (toolCallId, mutate) => {
7314
7413
  if (streaming) return;
7315
7414
  const last = messagesSig.value.at(-1);
7316
7415
  const part = last?.partsSig.value.find(
7317
7416
  (pt) => pt.kind === "tool" && pt.toolCallId === toolCallId
7318
7417
  );
7319
- if (!part) {
7320
- log16.warn("resolveTool: tool part not found", { toolCallId });
7418
+ if (!last || !part) {
7419
+ log16.warn("decideTool: tool part not found", { toolCallId });
7321
7420
  return;
7322
7421
  }
7323
7422
  mutate(part);
7324
- if (last) last.partsSig.value = [...last.partsSig.value];
7325
- const assistantMsg = makeAssistantMessage();
7326
- messagesSig.value = [...messagesSig.value, assistantMsg];
7327
- reducer.attach(assistantMsg);
7328
- void streamAssistant(assistantMsg, trigger);
7423
+ last.partsSig.value = [...last.partsSig.value];
7424
+ if (!allToolPartsSettled(last)) return;
7425
+ last.status = "streaming";
7426
+ reducer.attach(last);
7427
+ void streamAssistant(last, { continueExisting: true });
7329
7428
  },
7330
7429
  [streaming, messagesSig, reducer, streamAssistant]
7331
7430
  );
@@ -7333,24 +7432,24 @@ function App({ options, hostElement, bus }) {
7333
7432
  (toolCallId, output) => {
7334
7433
  log16.info("toolResult", { toolCallId });
7335
7434
  bus.emit("toolResult", { toolCallId });
7336
- resolveTool(toolCallId, TRIGGER.toolResult, (part) => {
7435
+ decideTool(toolCallId, (part) => {
7337
7436
  part.outputSig.value = output;
7338
- part.stateSig.value = "output";
7437
+ part.stateSig.value = "output-available";
7339
7438
  });
7340
7439
  },
7341
- [bus, resolveTool]
7440
+ [bus, decideTool]
7342
7441
  );
7343
7442
  const handleToolDecision = useCallback6(
7344
7443
  (toolCallId, approved, reason) => {
7345
7444
  log16.info("toolDecision", { toolCallId, approved });
7346
7445
  bus.emit("toolDecision", { toolCallId, approved });
7347
- resolveTool(toolCallId, TRIGGER.toolApproval, (part) => {
7446
+ decideTool(toolCallId, (part) => {
7348
7447
  const id = part.approvalSig.value?.id ?? toolCallId;
7349
7448
  part.approvalSig.value = { id, approved, reason };
7350
- part.stateSig.value = "output";
7449
+ part.stateSig.value = "approval-responded";
7351
7450
  });
7352
7451
  },
7353
- [bus, resolveTool]
7452
+ [bus, decideTool]
7354
7453
  );
7355
7454
  const toolInteraction = useMemo3(
7356
7455
  () => ({ humanInLoop: options.features.humanInLoop, onResult: handleToolResult, onDecision: handleToolDecision }),
@@ -7388,12 +7487,12 @@ function App({ options, hostElement, bus }) {
7388
7487
  void transport.submitForm({ formId: form.id, conversationId: activeConversationId, trigger, values, skipped });
7389
7488
  }
7390
7489
  });
7391
- const activeForm = useComputed7(() => forms.activeForm.value);
7490
+ const activeForm = useComputed8(() => forms.activeForm.value);
7392
7491
  useEffect16(() => {
7393
7492
  forms.refresh();
7394
7493
  }, [effectiveForms, forms]);
7395
7494
  const pageArea = options.pageContext?.area ? String(options.pageContext.area) : void 0;
7396
- const msgCount = useComputed7(() => messagesSig.value.length);
7495
+ const msgCount = useComputed8(() => messagesSig.value.length);
7397
7496
  useEffect16(() => {
7398
7497
  if (conversationReady && formsReady) forms.fire("pre-chat");
7399
7498
  }, [conversationReady, formsReady, forms]);
@@ -7430,7 +7529,7 @@ function App({ options, hostElement, bus }) {
7430
7529
  messagesSig.value = [...messagesSig.value, userMsg, assistantMsg];
7431
7530
  reducer.attach(assistantMsg);
7432
7531
  emitMessage(bus, options, "user", text);
7433
- await streamAssistant(assistantMsg, TRIGGER.submitMessage);
7532
+ await streamAssistant(assistantMsg, { continueExisting: false });
7434
7533
  forms.fire("after-messages");
7435
7534
  },
7436
7535
  [streaming, transport, bus, options, suggestions.length, messagesSig, reducer, streamAssistant, forms]
@@ -7708,12 +7807,12 @@ function App({ options, hostElement, bus }) {
7708
7807
  const renderSurface = (size) => {
7709
7808
  const closeable = isActionVisible("close", effectiveOptions.mode, size);
7710
7809
  if (enabledModules.length === 0) {
7711
- return /* @__PURE__ */ jsx36(ModulesEmpty, { strings: effectiveOptions.strings, onClose: closeable ? handleClose : void 0 });
7810
+ return /* @__PURE__ */ jsx37(ModulesEmpty, { strings: effectiveOptions.strings, onClose: closeable ? handleClose : void 0 });
7712
7811
  }
7713
7812
  if (enabledModules.length === 1 && enabledModules[0]?.layout === "chat") {
7714
- return /* @__PURE__ */ jsx36(Panel, { ...panelProps, panelSize: size });
7813
+ return /* @__PURE__ */ jsx37(Panel, { ...panelProps, panelSize: size });
7715
7814
  }
7716
- return /* @__PURE__ */ jsx36(
7815
+ return /* @__PURE__ */ jsx37(
7717
7816
  MessengerHome,
7718
7817
  {
7719
7818
  panelProps: { ...panelProps, panelSize: size, onClose: closeable ? handleClose : void 0 },
@@ -7732,7 +7831,7 @@ function App({ options, hostElement, bus }) {
7732
7831
  void handleSelectHistoryConversation(chat.conversationId);
7733
7832
  };
7734
7833
  const conversationsEnabled = enabledModules.some((m) => m.layout === "chat");
7735
- return /* @__PURE__ */ jsx36("div", { class: `${p32}-anchor`, children: /* @__PURE__ */ jsx36(
7834
+ return /* @__PURE__ */ jsx37("div", { class: `${p34}-anchor`, children: /* @__PURE__ */ jsx37(
7736
7835
  PageShell,
7737
7836
  {
7738
7837
  site: parsedSite,
@@ -7753,15 +7852,15 @@ function App({ options, hostElement, bus }) {
7753
7852
  }
7754
7853
  if (isInlineLike) {
7755
7854
  const inlineSize = options.mode === "standalone" ? "fullscreen" : panelSize;
7756
- return /* @__PURE__ */ jsx36("div", { class: `${p32}-anchor`, children: renderSurface(inlineSize) });
7855
+ return /* @__PURE__ */ jsx37("div", { class: `${p34}-anchor`, children: renderSurface(inlineSize) });
7757
7856
  }
7758
7857
  const drawerEdgeTab = options.mode === "drawer";
7759
7858
  const triggerOwnedByPage = options.mode === "modal";
7760
7859
  const launcherVisible = !triggerOwnedByPage && !options.launcher.hidden && (!isOpen || launcherLeaving);
7761
7860
  const calloutToRender = launcherVisible && !launcherLeaving && !calloutDismissed && !drawerEdgeTab ? effectiveOptions.launcher.callout : null;
7762
- return /* @__PURE__ */ jsxs31("div", { class: `${p32}-anchor`, "data-launcher-size": effectiveOptions.launcher.size, children: [
7763
- isOpen || activated ? /* @__PURE__ */ jsx36("div", { class: `${p32}-surface`, hidden: !isOpen, children: renderSurface(panelSize) }) : null,
7764
- launcherVisible ? /* @__PURE__ */ jsx36(
7861
+ return /* @__PURE__ */ jsxs32("div", { class: `${p34}-anchor`, "data-launcher-size": effectiveOptions.launcher.size, children: [
7862
+ isOpen || activated ? /* @__PURE__ */ jsx37("div", { class: `${p34}-surface`, hidden: !isOpen, children: renderSurface(panelSize) }) : null,
7863
+ launcherVisible ? /* @__PURE__ */ jsx37(
7765
7864
  Launcher,
7766
7865
  {
7767
7866
  onToggle: handleOpen,
@@ -7771,7 +7870,7 @@ function App({ options, hostElement, bus }) {
7771
7870
  edgeTab: drawerEdgeTab
7772
7871
  }
7773
7872
  ) : null,
7774
- calloutToRender ? /* @__PURE__ */ jsx36(
7873
+ calloutToRender ? /* @__PURE__ */ jsx37(
7775
7874
  LauncherCallout,
7776
7875
  {
7777
7876
  callout: calloutToRender,
@@ -7836,34 +7935,34 @@ var TRACKED = {
7836
7935
  expand: (on) => ({ on }),
7837
7936
  fullscreen: (on) => ({ on }),
7838
7937
  // Conversation funnel. `send` is the key conversion; text never rides.
7839
- send: (p33) => ({ attachments: p33.attachmentCount }),
7840
- message: (p33) => ({ role: p33.role }),
7938
+ send: (p35) => ({ attachments: p35.attachmentCount }),
7939
+ message: (p35) => ({ role: p35.role }),
7841
7940
  stop: () => void 0,
7842
7941
  clear: () => void 0,
7843
7942
  suggestion: () => void 0,
7844
- toggleHistory: (p33) => ({ view: p33.view }),
7943
+ toggleHistory: (p35) => ({ view: p35.view }),
7845
7944
  handshake: () => void 0,
7846
7945
  // Forms + human-in-the-loop — ids and outcomes, never values.
7847
- formSubmit: (p33) => ({ formId: p33.formId, skipped: p33.skipped }),
7946
+ formSubmit: (p35) => ({ formId: p35.formId, skipped: p35.skipped }),
7848
7947
  toolResult: () => void 0,
7849
- toolDecision: (p33) => ({ approved: p33.approved }),
7948
+ toolDecision: (p35) => ({ approved: p35.approved }),
7850
7949
  // Content — ids, tags + counts only; titles/bodies never ride.
7851
- contentView: (p33) => ({ section: p33.section, tags: p33.tags, count: p33.count }),
7852
- contentOpen: (p33) => ({ contentId: p33.contentId, tags: p33.tags }),
7853
- contentSearch: (p33) => ({ qlen: p33.queryLength, hits: p33.hitCount }),
7854
- contentRead: (p33) => ({ contentId: p33.contentId }),
7855
- contentLinkClick: (p33) => ({ contentId: p33.contentId }),
7950
+ contentView: (p35) => ({ section: p35.section, tags: p35.tags, count: p35.count }),
7951
+ contentOpen: (p35) => ({ contentId: p35.contentId, tags: p35.tags }),
7952
+ contentSearch: (p35) => ({ qlen: p35.queryLength, hits: p35.hitCount }),
7953
+ contentRead: (p35) => ({ contentId: p35.contentId }),
7954
+ contentLinkClick: (p35) => ({ contentId: p35.contentId }),
7856
7955
  // Composer / attachments / voice.
7857
- attach: (p33) => ({ count: p33.count, bytes: p33.totalBytes }),
7956
+ attach: (p35) => ({ count: p35.count, bytes: p35.totalBytes }),
7858
7957
  voiceStart: () => void 0,
7859
- voiceStop: (p33) => ({ ms: p33.durationMs }),
7958
+ voiceStop: (p35) => ({ ms: p35.durationMs }),
7860
7959
  voiceCancel: () => void 0,
7861
7960
  // Preferences — how visitors tune the surface.
7862
7961
  localeChange: (locale) => ({ locale }),
7863
7962
  themeChange: (theme) => ({ theme }),
7864
7963
  textSizeChange: (size) => ({ size }),
7865
- soundToggle: (p33) => ({ muted: p33.muted }),
7866
- sidebarToggle: (p33) => ({ collapsed: p33.collapsed }),
7964
+ soundToggle: (p35) => ({ muted: p35.muted }),
7965
+ sidebarToggle: (p35) => ({ collapsed: p35.collapsed }),
7867
7966
  calloutDismiss: () => void 0,
7868
7967
  // Health signal only — the error object itself never leaves the page.
7869
7968
  error: () => void 0