@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/index.mjs CHANGED
@@ -30,7 +30,7 @@ var BRAND = {
30
30
  };
31
31
 
32
32
  // src/core/version.ts
33
- var ELEMENTS_VERSION = true ? "0.44.3" : "0.0.0-dev";
33
+ var ELEMENTS_VERSION = true ? "0.46.0" : "0.0.0-dev";
34
34
  var ELEMENTS_VERSION_PARAM = "_ev";
35
35
 
36
36
  // src/i18n/strings.ts
@@ -91,6 +91,9 @@ var STRINGS_EN = {
91
91
  thinking: "Thinking\u2026",
92
92
  thoughts: "Thoughts",
93
93
  usedTool: "Used tool",
94
+ toolDetails: "Details",
95
+ toolResult: "Result",
96
+ sources: "Sources",
94
97
  // ── Messenger modules ──────────────────────────────────────────
95
98
  tabHome: "Home",
96
99
  tabConversations: "Conversations",
@@ -204,6 +207,9 @@ var STRINGS_FR = {
204
207
  thinking: "R\xE9flexion\u2026",
205
208
  thoughts: "R\xE9flexions",
206
209
  usedTool: "Outil utilis\xE9",
210
+ toolDetails: "D\xE9tails",
211
+ toolResult: "R\xE9sultat",
212
+ sources: "Sources",
207
213
  // ── Messenger modules ──────────────────────────────────────────
208
214
  tabHome: "Accueil",
209
215
  tabConversations: "Conversations",
@@ -615,6 +621,7 @@ function resolveOptions(rawOpts) {
615
621
  responseMode: behavior.responseMode ?? "streaming",
616
622
  showReasoning: behavior.showReasoning ?? false,
617
623
  showToolCalls: behavior.showToolCalls ?? false,
624
+ showSources: behavior.showSources ?? false,
618
625
  features: {
619
626
  files: opts.features?.files ?? DEFAULT_FEATURES.files,
620
627
  voice: opts.features?.voice ?? DEFAULT_FEATURES.voice,
@@ -941,7 +948,8 @@ var BEHAVIOR_ATTRS = [
941
948
  ["response-mode", "responseMode", (v) => v],
942
949
  ["start-minimized", "startMinimized", boolAttr],
943
950
  ["show-reasoning", "showReasoning", boolAttr],
944
- ["show-tool-calls", "showToolCalls", boolAttr]
951
+ ["show-tool-calls", "showToolCalls", boolAttr],
952
+ ["show-sources", "showSources", boolAttr]
945
953
  ];
946
954
  var I18N_ATTRS = [["locale", "locale"]];
947
955
  var ACTION_NAMES = new Set(ACTION_NAME_LITERALS);
@@ -1196,7 +1204,7 @@ var tokens_default = ':host{--__P__-accent-user: __BRAND_ACCENT__;--__P__-accent
1196
1204
  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';
1197
1205
 
1198
1206
  // src/styles/panel.css
1199
- 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';
1207
+ 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';
1200
1208
 
1201
1209
  // src/styles/standalone.css
1202
1210
  var standalone_default = ".__P__-standalone-page{margin:0;height:100vh;background:var(--__P__-bg, #fff);display:grid;place-items:stretch}\n";
@@ -1284,22 +1292,22 @@ function attachAdoptedSheet(shadow, doc) {
1284
1292
  }
1285
1293
  }
1286
1294
  function applyThemeOverrides(host, overrides) {
1287
- const p33 = BRAND.cssPrefix;
1288
- if (overrides.accent) host.style.setProperty(`--${p33}-accent-user`, overrides.accent);
1289
- if (overrides.accentText) host.style.setProperty(`--${p33}-accent-text-user`, overrides.accentText);
1290
- if (overrides.radius) host.style.setProperty(`--${p33}-radius`, overrides.radius);
1291
- if (overrides.fontFamily) host.style.setProperty(`--${p33}-font`, overrides.fontFamily);
1295
+ const p35 = BRAND.cssPrefix;
1296
+ if (overrides.accent) host.style.setProperty(`--${p35}-accent-user`, overrides.accent);
1297
+ if (overrides.accentText) host.style.setProperty(`--${p35}-accent-text-user`, overrides.accentText);
1298
+ if (overrides.radius) host.style.setProperty(`--${p35}-radius`, overrides.radius);
1299
+ if (overrides.fontFamily) host.style.setProperty(`--${p35}-font`, overrides.fontFamily);
1292
1300
  }
1293
1301
  function applyThemeMode(host, mode) {
1294
1302
  host.dataset.theme = mode;
1295
1303
  }
1296
1304
  function applySize(host, size) {
1297
- const p33 = BRAND.cssPrefix;
1298
- if (size.width !== void 0) host.style.setProperty(`--${p33}-panel-w`, size.width);
1299
- if (size.height !== void 0) host.style.setProperty(`--${p33}-panel-h`, size.height);
1300
- if (size.expanded?.width !== void 0) host.style.setProperty(`--${p33}-expanded-w`, size.expanded.width);
1301
- if (size.expanded?.height !== void 0) host.style.setProperty(`--${p33}-expanded-h`, size.expanded.height);
1302
- if (size.inset !== void 0) host.style.setProperty(`--${p33}-panel-inset`, size.inset);
1305
+ const p35 = BRAND.cssPrefix;
1306
+ if (size.width !== void 0) host.style.setProperty(`--${p35}-panel-w`, size.width);
1307
+ if (size.height !== void 0) host.style.setProperty(`--${p35}-panel-h`, size.height);
1308
+ if (size.expanded?.width !== void 0) host.style.setProperty(`--${p35}-expanded-w`, size.expanded.width);
1309
+ if (size.expanded?.height !== void 0) host.style.setProperty(`--${p35}-expanded-h`, size.expanded.height);
1310
+ if (size.inset !== void 0) host.style.setProperty(`--${p35}-panel-inset`, size.inset);
1303
1311
  }
1304
1312
  function applyPosition(host, pos) {
1305
1313
  host.dataset.position = pos;
@@ -1415,7 +1423,7 @@ import { h, render as renderPreact } from "preact";
1415
1423
 
1416
1424
  // src/ui/app.tsx
1417
1425
  import { useCallback as useCallback6, useEffect as useEffect16, useMemo as useMemo3, useRef as useRef9, useState as useState13 } from "preact/hooks";
1418
- import { batch, useComputed as useComputed7, useSignal as useSignal2 } from "@preact/signals";
1426
+ import { batch, useComputed as useComputed8, useSignal as useSignal2 } from "@preact/signals";
1419
1427
 
1420
1428
  // src/core/handshake-shape.ts
1421
1429
  function isPlainObject2(raw) {
@@ -1563,11 +1571,11 @@ function toBase64Url(json) {
1563
1571
  var nonEmpty = (ctx) => ctx && Object.keys(ctx).length > 0 ? ctx : void 0;
1564
1572
  function encodeContext(user, page) {
1565
1573
  const u = nonEmpty(user);
1566
- const p33 = nonEmpty(page);
1567
- if (!u && !p33) return void 0;
1574
+ const p35 = nonEmpty(page);
1575
+ if (!u && !p35) return void 0;
1568
1576
  const envelope = {};
1569
1577
  if (u) envelope.user = u;
1570
- if (p33) envelope.page = p33;
1578
+ if (p35) envelope.page = p35;
1571
1579
  return toBase64Url(JSON.stringify(envelope));
1572
1580
  }
1573
1581
 
@@ -1577,6 +1585,13 @@ function parseWireDate(value) {
1577
1585
  const ms = Date.parse(value);
1578
1586
  return Number.isFinite(ms) ? ms : void 0;
1579
1587
  }
1588
+ function toolPartType(toolName) {
1589
+ const bare = toolName.startsWith("tool:") ? toolName.slice(5) : toolName;
1590
+ return `tool-${bare}`;
1591
+ }
1592
+ function toolNameFromType(type) {
1593
+ return type.startsWith("tool-") ? type.slice(5) : type;
1594
+ }
1580
1595
  var DEFAULT_PATHS = {
1581
1596
  /** Conversation bootstrap. `POST` → deployment config + per-visitor state. */
1582
1597
  handshake: "/pai/handshake",
@@ -1649,17 +1664,15 @@ function buildSendMessageRequest(params) {
1649
1664
  conversationId: params.conversationId,
1650
1665
  trigger: params.trigger ?? "submit-message"
1651
1666
  };
1667
+ if (params.messageId) body.messageId = params.messageId;
1652
1668
  if (params.visitorId) body.visitorId = params.visitorId;
1653
1669
  if (params.userPrefs) body.userPrefs = params.userPrefs;
1654
- const data = {};
1655
1670
  const tools = params.tools?.map(normalizeToolRef).filter((t) => t !== null);
1656
- if (tools?.length) data.tools = tools;
1657
- if (params.responseMode) data.responseMode = params.responseMode;
1658
- if (Object.keys(data).length > 0) body.data = data;
1671
+ if (tools?.length) body.data = { tools };
1659
1672
  return body;
1660
1673
  }
1661
- function isResolvedToolPart(p33) {
1662
- return p33.state === "output" || p33.state === "error" || p33.approval?.approved !== void 0;
1674
+ function isResolvedToolPart(p35) {
1675
+ return p35.state === "output-available" || p35.state === "output-error" || p35.state === "output-denied" || p35.approval?.approved !== void 0;
1663
1676
  }
1664
1677
  function normalizeToolRef(ref) {
1665
1678
  if (typeof ref === "string") return ref ? { code: ref } : null;
@@ -1667,24 +1680,23 @@ function normalizeToolRef(ref) {
1667
1680
  }
1668
1681
  function messageToWireParts(m) {
1669
1682
  const out = [];
1670
- for (const p33 of m.parts) {
1671
- if (p33.kind === "text" && p33.text) {
1672
- out.push({ text: p33.text, type: "text" });
1683
+ for (const p35 of m.parts) {
1684
+ if (p35.kind === "text" && p35.text) {
1685
+ out.push({ text: p35.text, type: "text" });
1673
1686
  }
1674
- if (p33.kind === "file" && p33.url) {
1675
- out.push({ mediaType: p33.mediaType, type: "file", url: p33.url });
1687
+ if (p35.kind === "file" && p35.url) {
1688
+ out.push({ mediaType: p35.mediaType, type: "file", url: p35.url });
1676
1689
  }
1677
- if (p33.kind === "tool" && isResolvedToolPart(p33)) {
1690
+ if (p35.kind === "tool" && isResolvedToolPart(p35)) {
1678
1691
  const part = {
1679
- type: "tool",
1680
- toolCallId: p33.toolCallId,
1681
- toolName: p33.toolName,
1682
- state: p33.state
1692
+ type: toolPartType(p35.toolName),
1693
+ toolCallId: p35.toolCallId,
1694
+ state: p35.state
1683
1695
  };
1684
- if (p33.input !== void 0) part.input = p33.input;
1685
- if (p33.output !== void 0) part.output = p33.output;
1686
- if (p33.error !== void 0) part.errorText = p33.error;
1687
- if (p33.approval && p33.approval.approved !== void 0) part.approval = p33.approval;
1696
+ if (p35.input !== void 0) part.input = p35.input;
1697
+ if (p35.output !== void 0) part.output = p35.output;
1698
+ if (p35.error !== void 0) part.errorText = p35.error;
1699
+ if (p35.approval && p35.approval.approved !== void 0) part.approval = p35.approval;
1688
1700
  out.push(part);
1689
1701
  }
1690
1702
  }
@@ -2067,9 +2079,9 @@ var AgentTransport = class {
2067
2079
  log6.debug("message \u2192", {
2068
2080
  conversationId: body.conversationId,
2069
2081
  visitorId: body.visitorId,
2082
+ messageId: body.messageId,
2070
2083
  messageCount: body.messages.length,
2071
2084
  trigger: body.trigger,
2072
- responseMode: body.data?.responseMode,
2073
2085
  tools: body.data?.tools?.map((t) => t.code)
2074
2086
  });
2075
2087
  const ctrl = new AbortController();
@@ -2381,11 +2393,23 @@ function fromWireMessage(w) {
2381
2393
  if (part.type === "file") {
2382
2394
  return { kind: "file", url: part.url, mediaType: part.mediaType };
2383
2395
  }
2384
- if (part.type === "tool") {
2396
+ if (part.type === "source-url") {
2397
+ return { kind: "source", sourceId: part.sourceId, url: part.url, title: part.title };
2398
+ }
2399
+ if (part.type === "source-document") {
2400
+ return {
2401
+ kind: "source",
2402
+ sourceId: part.sourceId,
2403
+ title: part.title,
2404
+ filename: part.filename,
2405
+ mediaType: part.mediaType
2406
+ };
2407
+ }
2408
+ if (part.type.startsWith("tool-")) {
2385
2409
  return {
2386
2410
  kind: "tool",
2387
2411
  toolCallId: part.toolCallId,
2388
- toolName: part.toolName,
2412
+ toolName: toolNameFromType(part.type),
2389
2413
  inputPartialSig: signal(""),
2390
2414
  inputSig: signal(part.input),
2391
2415
  outputSig: signal(part.output),
@@ -2395,7 +2419,7 @@ function fromWireMessage(w) {
2395
2419
  };
2396
2420
  }
2397
2421
  return null;
2398
- }).filter((p33) => p33 !== null);
2422
+ }).filter((p35) => p35 !== null);
2399
2423
  return {
2400
2424
  id: w.id,
2401
2425
  role: w.role,
@@ -2425,61 +2449,47 @@ function assistantText(m) {
2425
2449
  }
2426
2450
  return out;
2427
2451
  }
2428
- function partToReactive(p33) {
2429
- if (p33.kind === "text" || p33.kind === "reasoning") {
2430
- return { kind: p33.kind, id: p33.id, textSig: signal(p33.text), doneSig: signal(p33.done) };
2452
+ function partToReactive(p35) {
2453
+ if (p35.kind === "text" || p35.kind === "reasoning") {
2454
+ return { kind: p35.kind, id: p35.id, textSig: signal(p35.text), doneSig: signal(p35.done) };
2431
2455
  }
2432
- if (p33.kind === "tool") {
2456
+ if (p35.kind === "tool") {
2433
2457
  return {
2434
2458
  kind: "tool",
2435
- toolCallId: p33.toolCallId,
2436
- toolName: p33.toolName,
2437
- inputPartialSig: signal(p33.inputPartial),
2438
- inputSig: signal(p33.input),
2439
- outputSig: signal(p33.output),
2440
- errorSig: signal(p33.error),
2441
- stateSig: signal(p33.state),
2442
- approvalSig: signal(p33.approval)
2459
+ toolCallId: p35.toolCallId,
2460
+ toolName: p35.toolName,
2461
+ inputPartialSig: signal(p35.inputPartial),
2462
+ inputSig: signal(p35.input),
2463
+ outputSig: signal(p35.output),
2464
+ errorSig: signal(p35.error),
2465
+ stateSig: signal(p35.state),
2466
+ approvalSig: signal(p35.approval)
2443
2467
  };
2444
2468
  }
2445
- return p33;
2469
+ return p35;
2446
2470
  }
2447
- function partFromReactive(p33) {
2448
- if (p33.kind === "text" || p33.kind === "reasoning") {
2449
- return { kind: p33.kind, id: p33.id, text: p33.textSig.value, done: p33.doneSig.value };
2471
+ function partFromReactive(p35) {
2472
+ if (p35.kind === "text" || p35.kind === "reasoning") {
2473
+ return { kind: p35.kind, id: p35.id, text: p35.textSig.value, done: p35.doneSig.value };
2450
2474
  }
2451
- if (p33.kind === "tool") {
2475
+ if (p35.kind === "tool") {
2452
2476
  return {
2453
2477
  kind: "tool",
2454
- toolCallId: p33.toolCallId,
2455
- toolName: p33.toolName,
2456
- inputPartial: p33.inputPartialSig.value,
2457
- input: p33.inputSig.value,
2458
- output: p33.outputSig.value,
2459
- error: p33.errorSig.value,
2460
- state: p33.stateSig.value,
2461
- approval: p33.approvalSig.value
2478
+ toolCallId: p35.toolCallId,
2479
+ toolName: p35.toolName,
2480
+ inputPartial: p35.inputPartialSig.value,
2481
+ input: p35.inputSig.value,
2482
+ output: p35.outputSig.value,
2483
+ error: p35.errorSig.value,
2484
+ state: p35.stateSig.value,
2485
+ approval: p35.approvalSig.value
2462
2486
  };
2463
2487
  }
2464
- return p33;
2488
+ return p35;
2465
2489
  }
2466
2490
 
2467
2491
  // src/stream/reducer.ts
2468
2492
  import { signal as signal2 } from "@preact/signals";
2469
-
2470
- // src/stream/constants.ts
2471
- function isAskUserInputTool(toolName) {
2472
- if (!toolName) return false;
2473
- const name = toolName.startsWith("tool:") ? toolName.slice(5) : toolName;
2474
- return name === "ask-user-input" || name === "ask_user_input" || name === "request-user-input" || name === "request_user_input";
2475
- }
2476
- var TRIGGER = {
2477
- submitMessage: "submit-message",
2478
- toolResult: "tool-result",
2479
- toolApproval: "tool-approval"
2480
- };
2481
-
2482
- // src/stream/reducer.ts
2483
2493
  var log7 = logger.scope("reducer");
2484
2494
  var StreamReducer = class {
2485
2495
  constructor(messagesSig) {
@@ -2517,8 +2527,8 @@ var StreamReducer = class {
2517
2527
  ensureTextPart(m, "text", chunk.id);
2518
2528
  return;
2519
2529
  case "text-delta": {
2520
- const p33 = ensureTextPart(m, "text", chunk.id);
2521
- p33.textSig.value += chunk.delta;
2530
+ const p35 = ensureTextPart(m, "text", chunk.id);
2531
+ p35.textSig.value += chunk.delta;
2522
2532
  return;
2523
2533
  }
2524
2534
  case "text-end":
@@ -2528,8 +2538,8 @@ var StreamReducer = class {
2528
2538
  ensureTextPart(m, "reasoning", chunk.id).doneSig.value = false;
2529
2539
  return;
2530
2540
  case "reasoning-delta": {
2531
- const p33 = ensureTextPart(m, "reasoning", chunk.id);
2532
- p33.textSig.value += chunk.delta;
2541
+ const p35 = ensureTextPart(m, "reasoning", chunk.id);
2542
+ p35.textSig.value += chunk.delta;
2533
2543
  return;
2534
2544
  }
2535
2545
  case "reasoning-end":
@@ -2540,18 +2550,25 @@ var StreamReducer = class {
2540
2550
  case "tool-input-available":
2541
2551
  case "tool-output-available":
2542
2552
  case "tool-output-error":
2553
+ case "tool-output-denied":
2543
2554
  case "tool-approval-request":
2544
2555
  applyTool(m, chunk);
2545
2556
  return;
2546
2557
  case "file":
2547
2558
  appendPart(m, { kind: "file", url: chunk.url, mediaType: chunk.mediaType });
2548
2559
  return;
2549
- case "source-url": {
2550
- const parts = m.partsSig.value;
2551
- if (parts.some((p33) => p33.kind === "source" && p33.sourceId === chunk.sourceId)) return;
2552
- appendPart(m, { kind: "source", sourceId: chunk.sourceId, url: chunk.url, title: chunk.title });
2560
+ case "source-url":
2561
+ appendSource(m, { kind: "source", sourceId: chunk.sourceId, url: chunk.url, title: chunk.title });
2562
+ return;
2563
+ case "source-document":
2564
+ appendSource(m, {
2565
+ kind: "source",
2566
+ sourceId: chunk.sourceId,
2567
+ title: chunk.title,
2568
+ filename: chunk.filename,
2569
+ mediaType: chunk.mediaType
2570
+ });
2553
2571
  return;
2554
- }
2555
2572
  case "data-notification":
2556
2573
  return;
2557
2574
  default: {
@@ -2572,14 +2589,14 @@ var StreamReducer = class {
2572
2589
  }
2573
2590
  };
2574
2591
  function ensureTextPart(m, kind, id) {
2575
- const existing = m.partsSig.value.find((p33) => p33.kind === kind && p33.id === id);
2592
+ const existing = m.partsSig.value.find((p35) => p35.kind === kind && p35.id === id);
2576
2593
  if (existing) return existing;
2577
2594
  const part = { kind, id, textSig: signal2(""), doneSig: signal2(false) };
2578
2595
  appendPart(m, part);
2579
2596
  return part;
2580
2597
  }
2581
2598
  function ensureToolPart(m, toolCallId, toolName) {
2582
- const existing = m.partsSig.value.find((p33) => p33.kind === "tool" && p33.toolCallId === toolCallId);
2599
+ const existing = m.partsSig.value.find((p35) => p35.kind === "tool" && p35.toolCallId === toolCallId);
2583
2600
  if (existing) return existing;
2584
2601
  const part = {
2585
2602
  kind: "tool",
@@ -2589,7 +2606,7 @@ function ensureToolPart(m, toolCallId, toolName) {
2589
2606
  inputSig: signal2(void 0),
2590
2607
  outputSig: signal2(void 0),
2591
2608
  errorSig: signal2(void 0),
2592
- stateSig: signal2("input"),
2609
+ stateSig: signal2("input-streaming"),
2593
2610
  approvalSig: signal2(void 0)
2594
2611
  };
2595
2612
  appendPart(m, part);
@@ -2598,38 +2615,47 @@ function ensureToolPart(m, toolCallId, toolName) {
2598
2615
  function appendPart(m, part) {
2599
2616
  m.partsSig.value = [...m.partsSig.value, part];
2600
2617
  }
2618
+ function appendSource(m, source) {
2619
+ if (m.partsSig.value.some((p35) => p35.kind === "source" && p35.sourceId === source.sourceId)) return;
2620
+ appendPart(m, source);
2621
+ }
2601
2622
  function applyTool(m, chunk) {
2602
2623
  switch (chunk.type) {
2603
2624
  case "tool-input-start":
2604
2625
  ensureToolPart(m, chunk.toolCallId, chunk.toolName);
2605
2626
  return;
2606
2627
  case "tool-input-delta": {
2607
- const p33 = ensureToolPart(m, chunk.toolCallId);
2608
- p33.inputPartialSig.value += chunk.delta;
2628
+ const p35 = ensureToolPart(m, chunk.toolCallId);
2629
+ p35.inputPartialSig.value += chunk.inputTextDelta;
2609
2630
  return;
2610
2631
  }
2611
2632
  case "tool-input-available": {
2612
- const p33 = ensureToolPart(m, chunk.toolCallId, chunk.toolName);
2613
- p33.inputSig.value = chunk.input;
2614
- p33.stateSig.value = isAskUserInputTool(p33.toolName) ? "awaiting-input" : "awaiting";
2633
+ const p35 = ensureToolPart(m, chunk.toolCallId, chunk.toolName);
2634
+ p35.inputSig.value = chunk.input;
2635
+ p35.stateSig.value = "input-available";
2615
2636
  return;
2616
2637
  }
2617
2638
  case "tool-approval-request": {
2618
- const p33 = ensureToolPart(m, chunk.toolCallId, chunk.toolName);
2619
- p33.approvalSig.value = { id: chunk.approvalId };
2620
- p33.stateSig.value = "awaiting-approval";
2639
+ const p35 = ensureToolPart(m, chunk.toolCallId, chunk.toolName);
2640
+ p35.approvalSig.value = { id: chunk.approvalId };
2641
+ p35.stateSig.value = "approval-requested";
2621
2642
  return;
2622
2643
  }
2623
2644
  case "tool-output-available": {
2624
- const p33 = ensureToolPart(m, chunk.toolCallId);
2625
- p33.outputSig.value = chunk.output;
2626
- p33.stateSig.value = "output";
2645
+ const p35 = ensureToolPart(m, chunk.toolCallId);
2646
+ p35.outputSig.value = chunk.output;
2647
+ p35.stateSig.value = "output-available";
2627
2648
  return;
2628
2649
  }
2629
2650
  case "tool-output-error": {
2630
- const p33 = ensureToolPart(m, chunk.toolCallId);
2631
- p33.errorSig.value = chunk.errorText;
2632
- p33.stateSig.value = "error";
2651
+ const p35 = ensureToolPart(m, chunk.toolCallId);
2652
+ p35.errorSig.value = chunk.errorText;
2653
+ p35.stateSig.value = "output-error";
2654
+ return;
2655
+ }
2656
+ case "tool-output-denied": {
2657
+ const p35 = ensureToolPart(m, chunk.toolCallId);
2658
+ p35.stateSig.value = "output-denied";
2633
2659
  return;
2634
2660
  }
2635
2661
  default:
@@ -3211,7 +3237,11 @@ var TID = {
3211
3237
  /** Tool-approval reject button. */
3212
3238
  toolReject: `${p2}-tool-reject`,
3213
3239
  /** Recorded tool decision summary (after approve/reject/submit). */
3214
- toolDecision: `${p2}-tool-decision`
3240
+ toolDecision: `${p2}-tool-decision`,
3241
+ /** Automatic (non-interactive) tool-call disclosure — shown only when `showToolCalls`. */
3242
+ toolCall: `${p2}-tool-call`,
3243
+ /** A citation source (web link or document reference) — shown only when `showSources`. */
3244
+ source: `${p2}-source`
3215
3245
  };
3216
3246
  function tid(base, suffix) {
3217
3247
  return `${base}-${suffix}`;
@@ -3322,24 +3352,24 @@ import { useCallback as useCallback2, useEffect as useEffect9, useRef as useRef6
3322
3352
  import { useEffect as useEffect2, useRef } from "preact/hooks";
3323
3353
  import { jsx as jsx3 } from "preact/jsx-runtime";
3324
3354
  function ResizeGrip({ panelEl, resize, position, initialSize, onSizeChange, strings }) {
3325
- const p33 = BRAND.cssPrefix;
3355
+ const p35 = BRAND.cssPrefix;
3326
3356
  const dragRef = useRef(null);
3327
3357
  useEffect2(() => {
3328
3358
  if (!panelEl) return;
3329
3359
  const style = panelEl.style;
3330
- if (resize.minWidth) style.setProperty(`--${p33}-resize-min-w`, resize.minWidth);
3331
- if (resize.maxWidth) style.setProperty(`--${p33}-resize-max-w`, resize.maxWidth);
3332
- if (resize.minHeight) style.setProperty(`--${p33}-resize-min-h`, resize.minHeight);
3333
- if (resize.maxHeight) style.setProperty(`--${p33}-resize-max-h`, resize.maxHeight);
3360
+ if (resize.minWidth) style.setProperty(`--${p35}-resize-min-w`, resize.minWidth);
3361
+ if (resize.maxWidth) style.setProperty(`--${p35}-resize-max-w`, resize.maxWidth);
3362
+ if (resize.minHeight) style.setProperty(`--${p35}-resize-min-h`, resize.minHeight);
3363
+ if (resize.maxHeight) style.setProperty(`--${p35}-resize-max-h`, resize.maxHeight);
3334
3364
  if (initialSize) {
3335
- style.setProperty(`--${p33}-widget-w`, `${initialSize.width}px`);
3336
- style.setProperty(`--${p33}-widget-h`, `${initialSize.height}px`);
3365
+ style.setProperty(`--${p35}-widget-w`, `${initialSize.width}px`);
3366
+ style.setProperty(`--${p35}-widget-h`, `${initialSize.height}px`);
3337
3367
  }
3338
- }, [panelEl, resize.minWidth, resize.maxWidth, resize.minHeight, resize.maxHeight, p33, initialSize]);
3368
+ }, [panelEl, resize.minWidth, resize.maxWidth, resize.minHeight, resize.maxHeight, p35, initialSize]);
3339
3369
  if (!panelEl) return null;
3340
3370
  const isTop = position.startsWith("top-");
3341
3371
  const isRight = position.endsWith("-right");
3342
- const cornerClass = `${p33}-resize-grip ${p33}-resize-grip--${isTop ? "bottom" : "top"}-${isRight ? "left" : "right"}`;
3372
+ const cornerClass = `${p35}-resize-grip ${p35}-resize-grip--${isTop ? "bottom" : "top"}-${isRight ? "left" : "right"}`;
3343
3373
  const onPointerDown = (e) => {
3344
3374
  if (!panelEl) return;
3345
3375
  const target = e.currentTarget;
@@ -3364,8 +3394,8 @@ function ResizeGrip({ panelEl, resize, position, initialSize, onSizeChange, stri
3364
3394
  if (!d || e.pointerId !== d.pointerId || !panelEl) return;
3365
3395
  const dx = (e.clientX - d.startX) * d.dirX;
3366
3396
  const dy = (e.clientY - d.startY) * d.dirY;
3367
- panelEl.style.setProperty(`--${p33}-widget-w`, `${d.startW + dx}px`);
3368
- panelEl.style.setProperty(`--${p33}-widget-h`, `${d.startH + dy}px`);
3397
+ panelEl.style.setProperty(`--${p35}-widget-w`, `${d.startW + dx}px`);
3398
+ panelEl.style.setProperty(`--${p35}-widget-h`, `${d.startH + dy}px`);
3369
3399
  };
3370
3400
  const onPointerUp = (e) => {
3371
3401
  const d = dragRef.current;
@@ -4102,7 +4132,7 @@ function usePopoverMenu({ itemCount, initialFocusIndex }) {
4102
4132
  // src/ui/overflow-menu.tsx
4103
4133
  import { jsx as jsx8, jsxs as jsxs6 } from "preact/jsx-runtime";
4104
4134
  function OverflowMenu({ items, triggerLabel }) {
4105
- const p33 = BRAND.cssPrefix;
4135
+ const p35 = BRAND.cssPrefix;
4106
4136
  const menu = usePopoverMenu({ itemCount: items.length });
4107
4137
  const handleSelect = (item) => {
4108
4138
  if (item.disabled) return;
@@ -4125,13 +4155,13 @@ function OverflowMenu({ items, triggerLabel }) {
4125
4155
  e.stopPropagation();
4126
4156
  pickSegment(item, segs[next].value);
4127
4157
  };
4128
- return /* @__PURE__ */ jsxs6("div", { class: `${p33}-menu-wrap`, children: [
4158
+ return /* @__PURE__ */ jsxs6("div", { class: `${p35}-menu-wrap`, children: [
4129
4159
  /* @__PURE__ */ jsx8(
4130
4160
  "button",
4131
4161
  {
4132
4162
  ref: menu.triggerRef,
4133
4163
  type: "button",
4134
- class: `${p33}-icon-btn`,
4164
+ class: `${p35}-icon-btn`,
4135
4165
  "aria-label": triggerLabel,
4136
4166
  "aria-haspopup": "menu",
4137
4167
  "aria-expanded": menu.open,
@@ -4145,7 +4175,7 @@ function OverflowMenu({ items, triggerLabel }) {
4145
4175
  "div",
4146
4176
  {
4147
4177
  ref: menu.menuRef,
4148
- class: `${p33}-menu`,
4178
+ class: `${p35}-menu`,
4149
4179
  role: "menu",
4150
4180
  "aria-label": triggerLabel,
4151
4181
  onKeyDown: menu.onMenuKey,
@@ -4155,14 +4185,14 @@ function OverflowMenu({ items, triggerLabel }) {
4155
4185
  "div",
4156
4186
  {
4157
4187
  role: "menuitem",
4158
- class: `${p33}-menu-item ${p33}-menu-item-segmented`,
4188
+ class: `${p35}-menu-item ${p35}-menu-item-segmented`,
4159
4189
  "aria-label": item.label,
4160
4190
  tabIndex: -1,
4161
4191
  onKeyDown: (e) => onSegmentRowKey(e, item),
4162
4192
  children: [
4163
- item.icon ? /* @__PURE__ */ jsx8("span", { class: `${p33}-menu-icon`, children: item.icon }) : null,
4164
- /* @__PURE__ */ jsx8("span", { class: `${p33}-menu-label`, children: item.label }),
4165
- /* @__PURE__ */ jsx8("span", { class: `${p33}-segmented`, role: "group", "aria-label": item.label, children: item.segments.map((seg) => {
4193
+ item.icon ? /* @__PURE__ */ jsx8("span", { class: `${p35}-menu-icon`, children: item.icon }) : null,
4194
+ /* @__PURE__ */ jsx8("span", { class: `${p35}-menu-label`, children: item.label }),
4195
+ /* @__PURE__ */ jsx8("span", { class: `${p35}-segmented`, role: "group", "aria-label": item.label, children: item.segments.map((seg) => {
4166
4196
  const active = seg.value === item.value;
4167
4197
  return /* @__PURE__ */ jsx8(
4168
4198
  "button",
@@ -4170,7 +4200,7 @@ function OverflowMenu({ items, triggerLabel }) {
4170
4200
  type: "button",
4171
4201
  role: "menuitemradio",
4172
4202
  "aria-checked": active,
4173
- class: `${p33}-segment`,
4203
+ class: `${p35}-segment`,
4174
4204
  "data-on": active ? "true" : void 0,
4175
4205
  lang: seg.lang,
4176
4206
  title: seg.value,
@@ -4190,14 +4220,14 @@ function OverflowMenu({ items, triggerLabel }) {
4190
4220
  {
4191
4221
  type: "button",
4192
4222
  role: "menuitem",
4193
- class: `${p33}-menu-item`,
4223
+ class: `${p35}-menu-item`,
4194
4224
  "aria-pressed": item.type === "switch" ? item.on : void 0,
4195
4225
  disabled: item.disabled,
4196
4226
  onClick: () => handleSelect(item),
4197
4227
  children: [
4198
- item.icon ? /* @__PURE__ */ jsx8("span", { class: `${p33}-menu-icon`, children: item.icon }) : null,
4199
- /* @__PURE__ */ jsx8("span", { class: `${p33}-menu-label`, children: item.label }),
4200
- item.type === "switch" && item.on ? /* @__PURE__ */ jsx8("span", { class: `${p33}-menu-check`, "aria-hidden": "true", children: /* @__PURE__ */ jsx8(CheckIcon, {}) }) : null
4228
+ item.icon ? /* @__PURE__ */ jsx8("span", { class: `${p35}-menu-icon`, children: item.icon }) : null,
4229
+ /* @__PURE__ */ jsx8("span", { class: `${p35}-menu-label`, children: item.label }),
4230
+ item.type === "switch" && item.on ? /* @__PURE__ */ jsx8("span", { class: `${p35}-menu-check`, "aria-hidden": "true", children: /* @__PURE__ */ jsx8(CheckIcon, {}) }) : null
4201
4231
  ]
4202
4232
  },
4203
4233
  item.id
@@ -4349,7 +4379,7 @@ function HeaderActions({ panelProps, variant }) {
4349
4379
 
4350
4380
  // src/ui/message-list.tsx
4351
4381
  import { useEffect as useEffect7, useLayoutEffect as useLayoutEffect2, useRef as useRef5, useState as useState6 } from "preact/hooks";
4352
- import { useComputed as useComputed5 } from "@preact/signals";
4382
+ import { useComputed as useComputed6 } from "@preact/signals";
4353
4383
 
4354
4384
  // src/ui/form/dynamic-form.tsx
4355
4385
  import { useState as useState5 } from "preact/hooks";
@@ -4737,7 +4767,14 @@ function FormDoneMarker({
4737
4767
  }
4738
4768
 
4739
4769
  // src/ui/message-bubble.tsx
4740
- import { useComputed as useComputed4 } from "@preact/signals";
4770
+ import { useComputed as useComputed5 } from "@preact/signals";
4771
+
4772
+ // src/stream/constants.ts
4773
+ function isAskUserInputTool(toolName) {
4774
+ if (!toolName) return false;
4775
+ const name = toolName.startsWith("tool:") ? toolName.slice(5) : toolName;
4776
+ return name === "ask-user-input" || name === "ask_user_input" || name === "request-user-input" || name === "request_user_input";
4777
+ }
4741
4778
 
4742
4779
  // src/ui/markdown.tsx
4743
4780
  import { useLayoutEffect, useMemo, useRef as useRef4 } from "preact/hooks";
@@ -4810,10 +4847,27 @@ function hardenLink(a) {
4810
4847
  a.rel = [...tokens].join(" ");
4811
4848
  }
4812
4849
 
4850
+ // src/ui/source-view.tsx
4851
+ import { jsx as jsx13, jsxs as jsxs10 } from "preact/jsx-runtime";
4852
+ var p12 = BRAND.cssPrefix;
4853
+ function SourceView({ part, strings }) {
4854
+ const label = part.title || part.filename || part.url || strings.sources;
4855
+ if (part.url) {
4856
+ return /* @__PURE__ */ jsxs10("a", { class: `${p12}-source`, href: part.url, target: "_blank", rel: "noreferrer noopener", "data-testid": TID.source, children: [
4857
+ /* @__PURE__ */ jsx13("span", { class: `${p12}-source-icon`, "aria-hidden": "true", children: "\u{1F517}" }),
4858
+ /* @__PURE__ */ jsx13("span", { class: `${p12}-source-label`, children: label })
4859
+ ] });
4860
+ }
4861
+ return /* @__PURE__ */ jsxs10("span", { class: `${p12}-source`, "data-testid": TID.source, children: [
4862
+ /* @__PURE__ */ jsx13("span", { class: `${p12}-source-icon`, "aria-hidden": "true", children: "\u{1F4C4}" }),
4863
+ /* @__PURE__ */ jsx13("span", { class: `${p12}-source-label`, children: label })
4864
+ ] });
4865
+ }
4866
+
4813
4867
  // src/ui/tool-approval.tsx
4814
4868
  import { useComputed as useComputed2, useSignal } from "@preact/signals";
4815
- import { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs10 } from "preact/jsx-runtime";
4816
- var p12 = BRAND.cssPrefix;
4869
+ import { Fragment as Fragment2, jsx as jsx14, jsxs as jsxs11 } from "preact/jsx-runtime";
4870
+ var p13 = BRAND.cssPrefix;
4817
4871
  function displayToolName(toolName) {
4818
4872
  return (toolName.startsWith("tool:") ? toolName.slice(5) : toolName).replace(/[-_]+/g, " ");
4819
4873
  }
@@ -4824,24 +4878,24 @@ function ToolApproval({ part, strings, active, onDecision }) {
4824
4878
  const decided = approval.value?.approved !== void 0;
4825
4879
  if (decided) {
4826
4880
  const ap = approval.value;
4827
- return /* @__PURE__ */ jsxs10("div", { class: `${p12}-tool-approval ${p12}-tool-decided`, "data-testid": TID.toolDecision, children: [
4828
- /* @__PURE__ */ jsx13("span", { class: `${p12}-tool-decided-label`, "data-approved": ap?.approved ? "true" : "false", children: ap?.approved ? strings.approved : strings.rejected }),
4829
- /* @__PURE__ */ jsx13("strong", { class: `${p12}-tool-title`, children: displayToolName(part.toolName) }),
4830
- ap?.reason ? /* @__PURE__ */ jsx13("span", { class: `${p12}-tool-decided-value`, children: ap.reason }) : null
4881
+ return /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-approval ${p13}-tool-decided`, "data-testid": TID.toolDecision, children: [
4882
+ /* @__PURE__ */ jsx14("span", { class: `${p13}-tool-decided-label`, "data-approved": ap?.approved ? "true" : "false", children: ap?.approved ? strings.approved : strings.rejected }),
4883
+ /* @__PURE__ */ jsx14("strong", { class: `${p13}-tool-title`, children: displayToolName(part.toolName) }),
4884
+ ap?.reason ? /* @__PURE__ */ jsx14("span", { class: `${p13}-tool-decided-value`, children: ap.reason }) : null
4831
4885
  ] });
4832
4886
  }
4833
4887
  const args = summarizeInput(input.value);
4834
- return /* @__PURE__ */ jsxs10("div", { class: `${p12}-tool-approval`, "data-testid": TID.toolApproval, children: [
4835
- /* @__PURE__ */ jsxs10("div", { class: `${p12}-tool-head`, children: [
4836
- /* @__PURE__ */ jsx13("span", { class: `${p12}-tool-badge`, children: strings.approvalRequired }),
4837
- /* @__PURE__ */ jsx13("strong", { class: `${p12}-tool-title`, children: displayToolName(part.toolName) })
4888
+ return /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-approval`, "data-testid": TID.toolApproval, children: [
4889
+ /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-head`, children: [
4890
+ /* @__PURE__ */ jsx14("span", { class: `${p13}-tool-badge`, children: strings.approvalRequired }),
4891
+ /* @__PURE__ */ jsx14("strong", { class: `${p13}-tool-title`, children: displayToolName(part.toolName) })
4838
4892
  ] }),
4839
- args ? /* @__PURE__ */ jsx13("pre", { class: `${p12}-tool-args`, children: args }) : null,
4840
- active ? /* @__PURE__ */ jsxs10(Fragment2, { children: [
4841
- /* @__PURE__ */ jsx13(
4893
+ args ? /* @__PURE__ */ jsx14("pre", { class: `${p13}-tool-args`, children: args }) : null,
4894
+ active ? /* @__PURE__ */ jsxs11(Fragment2, { children: [
4895
+ /* @__PURE__ */ jsx14(
4842
4896
  "input",
4843
4897
  {
4844
- class: `${p12}-field-input`,
4898
+ class: `${p13}-field-input`,
4845
4899
  value: reason.value,
4846
4900
  placeholder: strings.approvalReason,
4847
4901
  onInput: (e) => {
@@ -4849,29 +4903,29 @@ function ToolApproval({ part, strings, active, onDecision }) {
4849
4903
  }
4850
4904
  }
4851
4905
  ),
4852
- /* @__PURE__ */ jsxs10("div", { class: `${p12}-form-actions`, children: [
4853
- /* @__PURE__ */ jsx13(
4906
+ /* @__PURE__ */ jsxs11("div", { class: `${p13}-form-actions`, children: [
4907
+ /* @__PURE__ */ jsx14(
4854
4908
  "button",
4855
4909
  {
4856
4910
  type: "button",
4857
- class: `${p12}-tool-reject`,
4911
+ class: `${p13}-tool-reject`,
4858
4912
  onClick: () => onDecision(part.toolCallId, false, reason.value.trim() || void 0),
4859
4913
  "data-testid": TID.toolReject,
4860
4914
  children: strings.reject
4861
4915
  }
4862
4916
  ),
4863
- /* @__PURE__ */ jsx13(
4917
+ /* @__PURE__ */ jsx14(
4864
4918
  "button",
4865
4919
  {
4866
4920
  type: "button",
4867
- class: `${p12}-tool-approve`,
4921
+ class: `${p13}-tool-approve`,
4868
4922
  onClick: () => onDecision(part.toolCallId, true, reason.value.trim() || void 0),
4869
4923
  "data-testid": TID.toolApprove,
4870
4924
  children: strings.approve
4871
4925
  }
4872
4926
  )
4873
4927
  ] })
4874
- ] }) : /* @__PURE__ */ jsx13("p", { class: `${p12}-tool-stale-note`, children: strings.stepNoLongerActive })
4928
+ ] }) : /* @__PURE__ */ jsx14("p", { class: `${p13}-tool-stale-note`, children: strings.stepNoLongerActive })
4875
4929
  ] });
4876
4930
  }
4877
4931
  function summarizeInput(input) {
@@ -4942,13 +4996,13 @@ function num(v) {
4942
4996
  }
4943
4997
 
4944
4998
  // src/ui/tool-ask-input.tsx
4945
- import { jsx as jsx14, jsxs as jsxs11 } from "preact/jsx-runtime";
4946
- var p13 = BRAND.cssPrefix;
4999
+ import { jsx as jsx15, jsxs as jsxs12 } from "preact/jsx-runtime";
5000
+ var p14 = BRAND.cssPrefix;
4947
5001
  function ToolAskInput({ part, strings, active, onSubmit, onDecision }) {
4948
5002
  const state = useComputed3(() => part.stateSig.value);
4949
5003
  const approval = useComputed3(() => part.approvalSig.value);
4950
5004
  const request = useComputed3(() => parseAskUserInput(part.inputSig.value));
4951
- const decided = state.value === "output" || state.value === "error" || approval.value?.approved !== void 0;
5005
+ const decided = state.value === "output-available" || state.value === "output-error" || state.value === "output-denied" || state.value === "approval-responded" || approval.value?.approved !== void 0;
4952
5006
  const viaApproval = approval.value !== void 0;
4953
5007
  const resolve = (answer, accepted) => {
4954
5008
  if (viaApproval) onDecision(part.toolCallId, accepted, answer);
@@ -4956,42 +5010,42 @@ function ToolAskInput({ part, strings, active, onSubmit, onDecision }) {
4956
5010
  else onSubmit(part.toolCallId, accepted ? { answer } : {});
4957
5011
  };
4958
5012
  if (decided) {
4959
- return /* @__PURE__ */ jsx14(DecidedSummary, { part, strings });
5013
+ return /* @__PURE__ */ jsx15(DecidedSummary, { part, strings });
4960
5014
  }
4961
5015
  if (!active) {
4962
- return /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-ask-input ${p13}-tool-stale`, "data-testid": TID.toolAskInput, children: [
4963
- /* @__PURE__ */ jsx14(Header, { strings, title: request.value.title ?? request.value.question }),
4964
- /* @__PURE__ */ jsx14("p", { class: `${p13}-tool-stale-note`, children: strings.stepNoLongerActive })
5016
+ return /* @__PURE__ */ jsxs12("div", { class: `${p14}-tool-ask-input ${p14}-tool-stale`, "data-testid": TID.toolAskInput, children: [
5017
+ /* @__PURE__ */ jsx15(Header, { strings, title: request.value.title ?? request.value.question }),
5018
+ /* @__PURE__ */ jsx15("p", { class: `${p14}-tool-stale-note`, children: strings.stepNoLongerActive })
4965
5019
  ] });
4966
5020
  }
4967
5021
  const req = request.value;
4968
5022
  const isConfirmation = req.responseType === "confirmation";
4969
- return /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-ask-input`, "data-testid": TID.toolAskInput, children: [
4970
- /* @__PURE__ */ jsx14(Header, { strings, title: req.title }),
4971
- req.description ? /* @__PURE__ */ jsx14("p", { class: `${p13}-tool-desc`, children: req.description }) : null,
4972
- isConfirmation ? /* @__PURE__ */ jsx14("p", { class: `${p13}-tool-question`, children: req.question }) : null,
4973
- isConfirmation ? /* @__PURE__ */ jsxs11("div", { class: `${p13}-form-actions`, children: [
4974
- /* @__PURE__ */ jsx14(
5023
+ return /* @__PURE__ */ jsxs12("div", { class: `${p14}-tool-ask-input`, "data-testid": TID.toolAskInput, children: [
5024
+ /* @__PURE__ */ jsx15(Header, { strings, title: req.title }),
5025
+ req.description ? /* @__PURE__ */ jsx15("p", { class: `${p14}-tool-desc`, children: req.description }) : null,
5026
+ isConfirmation ? /* @__PURE__ */ jsx15("p", { class: `${p14}-tool-question`, children: req.question }) : null,
5027
+ isConfirmation ? /* @__PURE__ */ jsxs12("div", { class: `${p14}-form-actions`, children: [
5028
+ /* @__PURE__ */ jsx15(
4975
5029
  "button",
4976
5030
  {
4977
5031
  type: "button",
4978
- class: `${p13}-form-skip`,
5032
+ class: `${p14}-form-skip`,
4979
5033
  onClick: () => resolve(void 0, false),
4980
5034
  "data-testid": TID.toolInputSkip,
4981
5035
  children: strings.reject
4982
5036
  }
4983
5037
  ),
4984
- /* @__PURE__ */ jsx14(
5038
+ /* @__PURE__ */ jsx15(
4985
5039
  "button",
4986
5040
  {
4987
5041
  type: "button",
4988
- class: `${p13}-form-submit`,
5042
+ class: `${p14}-form-submit`,
4989
5043
  onClick: () => resolve(void 0, true),
4990
5044
  "data-testid": TID.toolInputSubmit,
4991
5045
  children: strings.approve
4992
5046
  }
4993
5047
  )
4994
- ] }) : /* @__PURE__ */ jsx14(
5048
+ ] }) : /* @__PURE__ */ jsx15(
4995
5049
  DynamicForm,
4996
5050
  {
4997
5051
  fields: askInputToFields(req),
@@ -5007,9 +5061,9 @@ function ToolAskInput({ part, strings, active, onSubmit, onDecision }) {
5007
5061
  ] });
5008
5062
  }
5009
5063
  function Header({ strings, title }) {
5010
- return /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-head`, children: [
5011
- /* @__PURE__ */ jsx14("span", { class: `${p13}-tool-badge`, children: strings.inputRequired }),
5012
- title ? /* @__PURE__ */ jsx14("strong", { class: `${p13}-tool-title`, children: title }) : null
5064
+ return /* @__PURE__ */ jsxs12("div", { class: `${p14}-tool-head`, children: [
5065
+ /* @__PURE__ */ jsx15("span", { class: `${p14}-tool-badge`, children: strings.inputRequired }),
5066
+ title ? /* @__PURE__ */ jsx15("strong", { class: `${p14}-tool-title`, children: title }) : null
5013
5067
  ] });
5014
5068
  }
5015
5069
  function DecidedSummary({ part, strings }) {
@@ -5017,9 +5071,9 @@ function DecidedSummary({ part, strings }) {
5017
5071
  const approval = useComputed3(() => part.approvalSig.value);
5018
5072
  const answer = approval.value?.approved !== void 0 ? approval.value.reason ?? "" : summarizeOutput(output.value);
5019
5073
  const skipped = approval.value?.approved === false;
5020
- return /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-ask-input ${p13}-tool-decided`, "data-testid": TID.toolDecision, children: [
5021
- /* @__PURE__ */ jsx14("span", { class: `${p13}-tool-decided-label`, children: skipped ? strings.inputSkip : strings.inputSubmitted }),
5022
- /* @__PURE__ */ jsx14("span", { class: `${p13}-tool-decided-value`, children: skipped ? "" : answer || strings.inputSubmitted })
5074
+ return /* @__PURE__ */ jsxs12("div", { class: `${p14}-tool-ask-input ${p14}-tool-decided`, "data-testid": TID.toolDecision, children: [
5075
+ /* @__PURE__ */ jsx15("span", { class: `${p14}-tool-decided-label`, children: skipped ? strings.inputSkip : strings.inputSubmitted }),
5076
+ /* @__PURE__ */ jsx15("span", { class: `${p14}-tool-decided-value`, children: skipped ? "" : answer || strings.inputSubmitted })
5023
5077
  ] });
5024
5078
  }
5025
5079
  function summarizeOutput(output) {
@@ -5033,37 +5087,70 @@ function summarizeOutput(output) {
5033
5087
  return String(output);
5034
5088
  }
5035
5089
 
5036
- // src/ui/tool-chip.tsx
5037
- import { jsx as jsx15, jsxs as jsxs12 } from "preact/jsx-runtime";
5038
- function ToolChip({ part, strings }) {
5039
- const p33 = BRAND.cssPrefix;
5040
- return /* @__PURE__ */ jsxs12("span", { class: `${p33}-tool-chip`, role: "status", children: [
5041
- /* @__PURE__ */ jsxs12("span", { children: [
5042
- strings.usedTool,
5043
- ":"
5090
+ // src/ui/tool-call.tsx
5091
+ import { useComputed as useComputed4 } from "@preact/signals";
5092
+ import { jsx as jsx16, jsxs as jsxs13 } from "preact/jsx-runtime";
5093
+ var p15 = BRAND.cssPrefix;
5094
+ function displayToolName2(toolName) {
5095
+ return (toolName.startsWith("tool:") ? toolName.slice(5) : toolName).replace(/[-_]+/g, " ").trim();
5096
+ }
5097
+ function ToolCall({ part, strings }) {
5098
+ const details = useComputed4(() => pretty(part.inputSig.value));
5099
+ const result = useComputed4(() => part.errorSig.value ?? pretty(unwrapResult(part.outputSig.value)));
5100
+ const isError = useComputed4(() => !!part.errorSig.value);
5101
+ if (!details.value && !result.value) return null;
5102
+ return /* @__PURE__ */ jsxs13("details", { class: `${p15}-tool-call`, "data-testid": TID.toolCall, children: [
5103
+ /* @__PURE__ */ jsxs13("summary", { class: `${p15}-tool-call-summary`, children: [
5104
+ /* @__PURE__ */ jsx16("span", { class: `${p15}-tool-badge`, children: strings.usedTool }),
5105
+ /* @__PURE__ */ jsx16("strong", { class: `${p15}-tool-title`, children: displayToolName2(part.toolName) })
5044
5106
  ] }),
5045
- /* @__PURE__ */ jsx15("strong", { children: part.toolName })
5107
+ details.value ? /* @__PURE__ */ jsxs13("div", { class: `${p15}-tool-call-section`, children: [
5108
+ /* @__PURE__ */ jsx16("span", { class: `${p15}-tool-call-label`, children: strings.toolDetails }),
5109
+ /* @__PURE__ */ jsx16("pre", { class: `${p15}-tool-args`, children: details.value })
5110
+ ] }) : null,
5111
+ result.value ? /* @__PURE__ */ jsxs13("div", { class: `${p15}-tool-call-section`, "data-error": isError.value ? "true" : void 0, children: [
5112
+ /* @__PURE__ */ jsx16("span", { class: `${p15}-tool-call-label`, children: strings.toolResult }),
5113
+ /* @__PURE__ */ jsx16("pre", { class: `${p15}-tool-args`, children: result.value })
5114
+ ] }) : null
5046
5115
  ] });
5047
5116
  }
5117
+ function unwrapResult(output) {
5118
+ if (output && typeof output === "object") {
5119
+ const rec = output;
5120
+ if (rec.storage === "tool-result-ref" && "summary" in rec) return rec.summary;
5121
+ }
5122
+ return output;
5123
+ }
5124
+ function pretty(value) {
5125
+ if (value == null) return "";
5126
+ try {
5127
+ const json = typeof value === "string" ? value : JSON.stringify(value, null, 2);
5128
+ if (!json || json === "{}" || json === "[]" || json === '""') return "";
5129
+ return json.length > 600 ? `${json.slice(0, 600)}\u2026` : json;
5130
+ } catch {
5131
+ return "";
5132
+ }
5133
+ }
5048
5134
 
5049
5135
  // src/ui/message-bubble.tsx
5050
- import { jsx as jsx16, jsxs as jsxs13 } from "preact/jsx-runtime";
5051
- var p14 = BRAND.cssPrefix;
5136
+ import { jsx as jsx17, jsxs as jsxs14 } from "preact/jsx-runtime";
5137
+ var p16 = BRAND.cssPrefix;
5052
5138
  function MessageBubble({
5053
5139
  message,
5054
5140
  strings,
5055
5141
  responseMode,
5056
5142
  showReasoning,
5057
5143
  showToolCalls,
5144
+ showSources,
5058
5145
  interactive = false,
5059
5146
  tool
5060
5147
  }) {
5061
- const parts = useComputed4(() => message.partsSig.value);
5148
+ const parts = useComputed5(() => message.partsSig.value);
5062
5149
  const partList = parts.value;
5063
- const hasAnswerText = useComputed4(
5150
+ const hasAnswerText = useComputed5(
5064
5151
  () => message.partsSig.value.some((part) => part.kind === "text" && part.textSig.value.length > 0)
5065
5152
  );
5066
- const reasoningVisible = useComputed4(
5153
+ const reasoningVisible = useComputed5(
5067
5154
  () => showReasoning && message.partsSig.value.some((part) => part.kind === "reasoning")
5068
5155
  );
5069
5156
  const streaming = message.role === "assistant" && message.status === "streaming";
@@ -5071,9 +5158,9 @@ function MessageBubble({
5071
5158
  const working = streaming && !hasAnswerText.value;
5072
5159
  const showStreamDots = streaming && !bufferedHold && !(reasoningVisible.value && working);
5073
5160
  const stamp = formatStamp(message.createdAt);
5074
- 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: [
5075
- /* @__PURE__ */ jsxs13("div", { class: `${p14}-bubble`, children: [
5076
- bufferedHold ? /* @__PURE__ */ jsx16(LoadingSpinner, { label: strings.loading }) : partList.map((part) => /* @__PURE__ */ jsx16(
5161
+ 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: [
5162
+ /* @__PURE__ */ jsxs14("div", { class: `${p16}-bubble`, children: [
5163
+ bufferedHold ? /* @__PURE__ */ jsx17(LoadingSpinner, { label: strings.loading }) : partList.map((part) => /* @__PURE__ */ jsx17(
5077
5164
  PartView,
5078
5165
  {
5079
5166
  part,
@@ -5081,15 +5168,16 @@ function MessageBubble({
5081
5168
  strings,
5082
5169
  showReasoning,
5083
5170
  showToolCalls,
5171
+ showSources,
5084
5172
  interactive,
5085
5173
  tool
5086
5174
  },
5087
5175
  partKey(part)
5088
5176
  )),
5089
- showStreamDots && /* @__PURE__ */ jsx16(TypingDots, {}),
5090
- message.status === "error" && message.errorText ? /* @__PURE__ */ jsx16("div", { class: `${p14}-error`, role: "alert", children: /* @__PURE__ */ jsx16("span", { children: message.errorText }) }) : null
5177
+ showStreamDots && /* @__PURE__ */ jsx17(TypingDots, {}),
5178
+ message.status === "error" && message.errorText ? /* @__PURE__ */ jsx17("div", { class: `${p16}-error`, role: "alert", children: /* @__PURE__ */ jsx17("span", { children: message.errorText }) }) : null
5091
5179
  ] }),
5092
- stamp ? /* @__PURE__ */ jsx16("time", { class: `${p14}-bubble-time`, dateTime: stamp.iso, title: stamp.full, children: stamp.short }) : null
5180
+ stamp ? /* @__PURE__ */ jsx17("time", { class: `${p16}-bubble-time`, dateTime: stamp.iso, title: stamp.full, children: stamp.short }) : null
5093
5181
  ] }) });
5094
5182
  }
5095
5183
  function formatStamp(createdAt) {
@@ -5111,16 +5199,17 @@ function PartView({
5111
5199
  strings,
5112
5200
  showReasoning,
5113
5201
  showToolCalls,
5202
+ showSources,
5114
5203
  interactive,
5115
5204
  tool
5116
5205
  }) {
5117
5206
  switch (part.kind) {
5118
5207
  case "text":
5119
- return /* @__PURE__ */ jsx16(MarkdownView, { textSig: part.textSig, doneSig: part.doneSig });
5208
+ return /* @__PURE__ */ jsx17(MarkdownView, { textSig: part.textSig, doneSig: part.doneSig });
5120
5209
  case "reasoning":
5121
- return showReasoning ? /* @__PURE__ */ jsx16(ReasoningView, { part, active, strings }) : null;
5210
+ return showReasoning ? /* @__PURE__ */ jsx17(ReasoningView, { part, active, strings }) : null;
5122
5211
  case "tool":
5123
- return /* @__PURE__ */ jsx16(
5212
+ return /* @__PURE__ */ jsx17(
5124
5213
  ToolPartView,
5125
5214
  {
5126
5215
  part,
@@ -5132,11 +5221,11 @@ function PartView({
5132
5221
  );
5133
5222
  case "file":
5134
5223
  if (part.mediaType.startsWith("image/")) {
5135
- return /* @__PURE__ */ jsx16("img", { src: part.url, alt: "", loading: "lazy" });
5224
+ return /* @__PURE__ */ jsx17("img", { src: part.url, alt: "", loading: "lazy" });
5136
5225
  }
5137
- return /* @__PURE__ */ jsx16("a", { href: part.url, target: "_blank", rel: "noreferrer noopener", children: part.url });
5226
+ return /* @__PURE__ */ jsx17("a", { href: part.url, target: "_blank", rel: "noreferrer noopener", children: part.url });
5138
5227
  case "source":
5139
- return null;
5228
+ return showSources ? /* @__PURE__ */ jsx17(SourceView, { part, strings }) : null;
5140
5229
  }
5141
5230
  }
5142
5231
  function ToolPartView({
@@ -5146,11 +5235,10 @@ function ToolPartView({
5146
5235
  interactive,
5147
5236
  tool
5148
5237
  }) {
5149
- const state = useComputed4(() => part.stateSig.value);
5150
- const hasApproval = useComputed4(() => part.approvalSig.value !== void 0);
5238
+ const hasApproval = useComputed5(() => part.approvalSig.value !== void 0);
5151
5239
  if (tool?.humanInLoop) {
5152
- if (isAskUserInputTool(part.toolName) || state.value === "awaiting-input") {
5153
- return /* @__PURE__ */ jsx16(
5240
+ if (isAskUserInputTool(part.toolName)) {
5241
+ return /* @__PURE__ */ jsx17(
5154
5242
  ToolAskInput,
5155
5243
  {
5156
5244
  part,
@@ -5161,20 +5249,20 @@ function ToolPartView({
5161
5249
  }
5162
5250
  );
5163
5251
  }
5164
- if (hasApproval.value || state.value === "awaiting-approval") {
5165
- return /* @__PURE__ */ jsx16(ToolApproval, { part, strings, active: interactive, onDecision: tool.onDecision });
5252
+ if (hasApproval.value) {
5253
+ return /* @__PURE__ */ jsx17(ToolApproval, { part, strings, active: interactive, onDecision: tool.onDecision });
5166
5254
  }
5167
5255
  }
5168
- return showToolCalls ? /* @__PURE__ */ jsx16(ToolChip, { part, strings }) : null;
5256
+ return showToolCalls ? /* @__PURE__ */ jsx17(ToolCall, { part, strings }) : null;
5169
5257
  }
5170
5258
  function ReasoningView({
5171
5259
  part,
5172
5260
  active,
5173
5261
  strings
5174
5262
  }) {
5175
- return /* @__PURE__ */ jsxs13("details", { class: `${p14}-reasoning`, open: active, "data-active": active ? "true" : void 0, children: [
5176
- /* @__PURE__ */ jsx16("summary", { class: `${p14}-reasoning-summary`, children: /* @__PURE__ */ jsx16("span", { class: `${p14}-reasoning-label`, children: active ? strings.thinking : strings.thoughts }) }),
5177
- /* @__PURE__ */ jsx16("div", { class: `${p14}-reasoning-body`, children: /* @__PURE__ */ jsx16(MarkdownView, { textSig: part.textSig, doneSig: part.doneSig }) })
5263
+ return /* @__PURE__ */ jsxs14("details", { class: `${p16}-reasoning`, open: active, "data-active": active ? "true" : void 0, children: [
5264
+ /* @__PURE__ */ jsx17("summary", { class: `${p16}-reasoning-summary`, children: /* @__PURE__ */ jsx17("span", { class: `${p16}-reasoning-label`, children: active ? strings.thinking : strings.thoughts }) }),
5265
+ /* @__PURE__ */ jsx17("div", { class: `${p16}-reasoning-body`, children: /* @__PURE__ */ jsx17(MarkdownView, { textSig: part.textSig, doneSig: part.doneSig }) })
5178
5266
  ] });
5179
5267
  }
5180
5268
  function partKey(part) {
@@ -5191,22 +5279,22 @@ function partKey(part) {
5191
5279
  }
5192
5280
  }
5193
5281
  function TypingDots() {
5194
- return /* @__PURE__ */ jsxs13("span", { class: `${p14}-typing`, "aria-hidden": "true", children: [
5195
- /* @__PURE__ */ jsx16("span", {}),
5196
- /* @__PURE__ */ jsx16("span", {}),
5197
- /* @__PURE__ */ jsx16("span", {})
5282
+ return /* @__PURE__ */ jsxs14("span", { class: `${p16}-typing`, "aria-hidden": "true", children: [
5283
+ /* @__PURE__ */ jsx17("span", {}),
5284
+ /* @__PURE__ */ jsx17("span", {}),
5285
+ /* @__PURE__ */ jsx17("span", {})
5198
5286
  ] });
5199
5287
  }
5200
5288
  function LoadingSpinner({ label }) {
5201
- return /* @__PURE__ */ jsxs13("span", { class: `${p14}-loading`, role: "status", children: [
5202
- /* @__PURE__ */ jsx16("span", { class: `${p14}-loading-spinner`, "aria-hidden": "true" }),
5203
- /* @__PURE__ */ jsx16("span", { class: `${p14}-loading-label`, children: label })
5289
+ return /* @__PURE__ */ jsxs14("span", { class: `${p16}-loading`, role: "status", children: [
5290
+ /* @__PURE__ */ jsx17("span", { class: `${p16}-loading-spinner`, "aria-hidden": "true" }),
5291
+ /* @__PURE__ */ jsx17("span", { class: `${p16}-loading-label`, children: label })
5204
5292
  ] });
5205
5293
  }
5206
5294
 
5207
5295
  // src/ui/message-list.tsx
5208
- import { jsx as jsx17, jsxs as jsxs14 } from "preact/jsx-runtime";
5209
- var p15 = BRAND.cssPrefix;
5296
+ import { jsx as jsx18, jsxs as jsxs15 } from "preact/jsx-runtime";
5297
+ var p17 = BRAND.cssPrefix;
5210
5298
  var STICK_THRESHOLD = 120;
5211
5299
  var INTERACTION_GRACE_MS = 350;
5212
5300
  var DIVIDER_IDLE_MS = 1200;
@@ -5216,6 +5304,7 @@ function MessageList({
5216
5304
  responseMode,
5217
5305
  showReasoning,
5218
5306
  showToolCalls,
5307
+ showSources,
5219
5308
  loading,
5220
5309
  idle,
5221
5310
  tool,
@@ -5224,7 +5313,7 @@ function MessageList({
5224
5313
  onFillForm
5225
5314
  }) {
5226
5315
  const ref = useRef5(null);
5227
- const messages = useComputed5(() => messagesSig.value);
5316
+ const messages = useComputed6(() => messagesSig.value);
5228
5317
  const [showJump, setShowJump] = useState6(false);
5229
5318
  const [scrolling, setScrolling] = useState6(false);
5230
5319
  const hasHydratedRef = useRef5(false);
@@ -5376,7 +5465,7 @@ function MessageList({
5376
5465
  const pendingMarkers = [...formMarkers ?? []].toSorted(
5377
5466
  (a, b) => (a.createdAt ?? Infinity) - (b.createdAt ?? Infinity)
5378
5467
  );
5379
- const markerRow = (marker) => /* @__PURE__ */ jsx17(
5468
+ const markerRow = (marker) => /* @__PURE__ */ jsx18(
5380
5469
  FormDoneMarker,
5381
5470
  {
5382
5471
  marker,
@@ -5397,12 +5486,12 @@ function MessageList({
5397
5486
  const day = dayKey(m.createdAt);
5398
5487
  if (day && day !== prevDay) {
5399
5488
  rows.push(
5400
- /* @__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}`)
5489
+ /* @__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}`)
5401
5490
  );
5402
5491
  prevDay = day;
5403
5492
  }
5404
5493
  rows.push(
5405
- /* @__PURE__ */ jsx17(
5494
+ /* @__PURE__ */ jsx18(
5406
5495
  MessageBubble,
5407
5496
  {
5408
5497
  message: m,
@@ -5410,6 +5499,7 @@ function MessageList({
5410
5499
  responseMode,
5411
5500
  showReasoning,
5412
5501
  showToolCalls,
5502
+ showSources,
5413
5503
  interactive: Boolean(idle) && m.id === lastId,
5414
5504
  tool
5415
5505
  },
@@ -5420,33 +5510,33 @@ function MessageList({
5420
5510
  for (const marker of pendingMarkers) {
5421
5511
  rows.push(markerRow(marker));
5422
5512
  }
5423
- return /* @__PURE__ */ jsxs14("div", { class: `${p15}-list-wrap`, children: [
5424
- /* @__PURE__ */ jsxs14(
5513
+ return /* @__PURE__ */ jsxs15("div", { class: `${p17}-list-wrap`, children: [
5514
+ /* @__PURE__ */ jsxs15(
5425
5515
  "div",
5426
5516
  {
5427
5517
  ref,
5428
- class: `${p15}-list`,
5518
+ class: `${p17}-list`,
5429
5519
  role: "log",
5430
5520
  "aria-live": "polite",
5431
5521
  "aria-relevant": "additions text",
5432
5522
  "data-scrolling": scrolling ? "true" : void 0,
5433
5523
  children: [
5434
- loading && messages.value.length === 0 ? /* @__PURE__ */ jsx17("div", { class: `${p15}-list-loading`, role: "status", children: strings.conversationLoading }) : null,
5524
+ loading && messages.value.length === 0 ? /* @__PURE__ */ jsx18("div", { class: `${p17}-list-loading`, role: "status", children: strings.conversationLoading }) : null,
5435
5525
  rows,
5436
- form ? /* @__PURE__ */ jsx17(FormGate, { form: form.form, strings, onSubmit: form.onSubmit, onSkip: form.onSkip }) : null
5526
+ form ? /* @__PURE__ */ jsx18(FormGate, { form: form.form, strings, onSubmit: form.onSubmit, onSkip: form.onSkip }) : null
5437
5527
  ]
5438
5528
  }
5439
5529
  ),
5440
- showJump ? /* @__PURE__ */ jsx17(
5530
+ showJump ? /* @__PURE__ */ jsx18(
5441
5531
  "button",
5442
5532
  {
5443
5533
  type: "button",
5444
- class: `${p15}-jump`,
5534
+ class: `${p17}-jump`,
5445
5535
  onClick: jumpToBottom,
5446
5536
  "aria-label": strings.scrollToBottom,
5447
5537
  title: strings.scrollToBottom,
5448
5538
  "data-testid": TID.scrollToBottom,
5449
- children: /* @__PURE__ */ jsx17(ChevronDownIcon, {})
5539
+ children: /* @__PURE__ */ jsx18(ChevronDownIcon, {})
5450
5540
  }
5451
5541
  ) : null
5452
5542
  ] });
@@ -5505,7 +5595,7 @@ function startOfDay(ms) {
5505
5595
  }
5506
5596
 
5507
5597
  // src/ui/conversation-list.tsx
5508
- import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs15 } from "preact/jsx-runtime";
5598
+ import { Fragment as Fragment3, jsx as jsx19, jsxs as jsxs16 } from "preact/jsx-runtime";
5509
5599
  var log12 = logger.scope("history");
5510
5600
  var DEFAULT_SKELETON_ROWS = 3;
5511
5601
  var MAX_SKELETON_ROWS = 6;
@@ -5532,7 +5622,7 @@ function ConversationList({
5532
5622
  onSelect,
5533
5623
  onNewConversation
5534
5624
  }) {
5535
- const p33 = BRAND.cssPrefix;
5625
+ const p35 = BRAND.cssPrefix;
5536
5626
  const seed = transport.peekConversations({ visitorId });
5537
5627
  const [state, setState] = useState7(seed ? "loaded" : "loading");
5538
5628
  const [conversations, setChats] = useState7(seed?.conversations ?? []);
@@ -5553,32 +5643,32 @@ function ConversationList({
5553
5643
  cancelled = true;
5554
5644
  };
5555
5645
  }, [transport, visitorId, persistence]);
5556
- const newChatButton = onNewConversation ? /* @__PURE__ */ jsx18("div", { class: `${p33}-history-footer`, children: /* @__PURE__ */ jsxs15(
5646
+ const newChatButton = onNewConversation ? /* @__PURE__ */ jsx19("div", { class: `${p35}-history-footer`, children: /* @__PURE__ */ jsxs16(
5557
5647
  "button",
5558
5648
  {
5559
5649
  type: "button",
5560
- class: `${p33}-history-new`,
5650
+ class: `${p35}-history-new`,
5561
5651
  onClick: onNewConversation,
5562
5652
  "data-testid": TID.sidebarNewConversation,
5563
5653
  children: [
5564
- /* @__PURE__ */ jsx18(PlusIcon, {}),
5654
+ /* @__PURE__ */ jsx19(PlusIcon, {}),
5565
5655
  strings.newConversation
5566
5656
  ]
5567
5657
  }
5568
5658
  ) }) : null;
5569
5659
  if (state === "loading") {
5570
5660
  const rows = Math.min(persistence.loadHistoryCount() ?? DEFAULT_SKELETON_ROWS, MAX_SKELETON_ROWS);
5571
- return /* @__PURE__ */ jsxs15(Fragment3, { children: [
5572
- /* @__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: [
5573
- /* @__PURE__ */ jsx18("div", { class: `${p33}-history-heading`, children: /* @__PURE__ */ jsx18("span", { class: `${p33}-skeleton ${p33}-skeleton-heading` }) }),
5574
- /* @__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: [
5575
- /* @__PURE__ */ jsx18("span", { class: `${p33}-history-avatar ${p33}-skeleton` }),
5576
- /* @__PURE__ */ jsxs15("span", { class: `${p33}-history-body`, children: [
5577
- /* @__PURE__ */ jsxs15("span", { class: `${p33}-history-row`, children: [
5578
- /* @__PURE__ */ jsx18("span", { class: `${p33}-history-title`, children: /* @__PURE__ */ jsx18("span", { class: `${p33}-skeleton ${p33}-skeleton-title` }) }),
5579
- /* @__PURE__ */ jsx18("span", { class: `${p33}-history-time`, children: /* @__PURE__ */ jsx18("span", { class: `${p33}-skeleton ${p33}-skeleton-time` }) })
5661
+ return /* @__PURE__ */ jsxs16(Fragment3, { children: [
5662
+ /* @__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: [
5663
+ /* @__PURE__ */ jsx19("div", { class: `${p35}-history-heading`, children: /* @__PURE__ */ jsx19("span", { class: `${p35}-skeleton ${p35}-skeleton-heading` }) }),
5664
+ /* @__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: [
5665
+ /* @__PURE__ */ jsx19("span", { class: `${p35}-history-avatar ${p35}-skeleton` }),
5666
+ /* @__PURE__ */ jsxs16("span", { class: `${p35}-history-body`, children: [
5667
+ /* @__PURE__ */ jsxs16("span", { class: `${p35}-history-row`, children: [
5668
+ /* @__PURE__ */ jsx19("span", { class: `${p35}-history-title`, children: /* @__PURE__ */ jsx19("span", { class: `${p35}-skeleton ${p35}-skeleton-title` }) }),
5669
+ /* @__PURE__ */ jsx19("span", { class: `${p35}-history-time`, children: /* @__PURE__ */ jsx19("span", { class: `${p35}-skeleton ${p35}-skeleton-time` }) })
5580
5670
  ] }),
5581
- /* @__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` }) }) })
5671
+ /* @__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` }) }) })
5582
5672
  ] })
5583
5673
  ] }, i)) })
5584
5674
  ] }) }),
@@ -5586,36 +5676,36 @@ function ConversationList({
5586
5676
  ] });
5587
5677
  }
5588
5678
  if (state === "error" || conversations.length === 0) {
5589
- return /* @__PURE__ */ jsxs15(Fragment3, { children: [
5590
- /* @__PURE__ */ jsx18("div", { class: `${p33}-history-empty`, children: strings.historyEmpty }),
5679
+ return /* @__PURE__ */ jsxs16(Fragment3, { children: [
5680
+ /* @__PURE__ */ jsx19("div", { class: `${p35}-history-empty`, children: strings.historyEmpty }),
5591
5681
  newChatButton
5592
5682
  ] });
5593
5683
  }
5594
5684
  const now = Date.now();
5595
5685
  const groups = groupByBucket(now, conversations);
5596
- return /* @__PURE__ */ jsxs15(Fragment3, { children: [
5597
- /* @__PURE__ */ jsx18("div", { class: `${p33}-history`, role: "list", children: groups.map((group) => /* @__PURE__ */ jsxs15("div", { class: `${p33}-history-group`, children: [
5598
- /* @__PURE__ */ jsx18("div", { class: `${p33}-history-heading`, children: strings[BUCKET_TO_STRING[group.bucket]] }),
5599
- /* @__PURE__ */ jsx18("div", { class: `${p33}-history-card`, children: group.conversations.map((chat) => /* @__PURE__ */ jsxs15(
5686
+ return /* @__PURE__ */ jsxs16(Fragment3, { children: [
5687
+ /* @__PURE__ */ jsx19("div", { class: `${p35}-history`, role: "list", children: groups.map((group) => /* @__PURE__ */ jsxs16("div", { class: `${p35}-history-group`, children: [
5688
+ /* @__PURE__ */ jsx19("div", { class: `${p35}-history-heading`, children: strings[BUCKET_TO_STRING[group.bucket]] }),
5689
+ /* @__PURE__ */ jsx19("div", { class: `${p35}-history-card`, children: group.conversations.map((chat) => /* @__PURE__ */ jsxs16(
5600
5690
  "button",
5601
5691
  {
5602
5692
  type: "button",
5603
5693
  role: "listitem",
5604
- class: `${p33}-history-item`,
5694
+ class: `${p35}-history-item`,
5605
5695
  onClick: () => onSelect(chat),
5606
5696
  "data-closed": chat.canContinue ? void 0 : "true",
5607
5697
  "data-unread": (chat.unreadCount ?? 0) > 0 ? "true" : void 0,
5608
5698
  "data-testid": tid(TID.historyItem, chat.conversationId),
5609
5699
  children: [
5610
- /* @__PURE__ */ jsx18("span", { class: `${p33}-history-avatar`, "aria-hidden": "true", children: /* @__PURE__ */ jsx18(MessageIcon, {}) }),
5611
- /* @__PURE__ */ jsxs15("span", { class: `${p33}-history-body`, children: [
5612
- /* @__PURE__ */ jsxs15("span", { class: `${p33}-history-row`, children: [
5613
- /* @__PURE__ */ jsx18("span", { class: `${p33}-history-title`, children: chat.title }),
5614
- /* @__PURE__ */ jsx18("span", { class: `${p33}-history-time`, children: rowTime(chat.lastMessageAt, now, locale) })
5700
+ /* @__PURE__ */ jsx19("span", { class: `${p35}-history-avatar`, "aria-hidden": "true", children: /* @__PURE__ */ jsx19(MessageIcon, {}) }),
5701
+ /* @__PURE__ */ jsxs16("span", { class: `${p35}-history-body`, children: [
5702
+ /* @__PURE__ */ jsxs16("span", { class: `${p35}-history-row`, children: [
5703
+ /* @__PURE__ */ jsx19("span", { class: `${p35}-history-title`, children: chat.title }),
5704
+ /* @__PURE__ */ jsx19("span", { class: `${p35}-history-time`, children: rowTime(chat.lastMessageAt, now, locale) })
5615
5705
  ] }),
5616
- /* @__PURE__ */ jsxs15("span", { class: `${p33}-history-row`, children: [
5617
- /* @__PURE__ */ jsx18("span", { class: `${p33}-history-preview`, children: chat.preview ?? (chat.canContinue ? strings.historyContinue : strings.conversationClosed) }),
5618
- (chat.unreadCount ?? 0) > 0 ? /* @__PURE__ */ jsx18("span", { class: `${p33}-history-dot` }) : null
5706
+ /* @__PURE__ */ jsxs16("span", { class: `${p35}-history-row`, children: [
5707
+ /* @__PURE__ */ jsx19("span", { class: `${p35}-history-preview`, children: chat.preview ?? (chat.canContinue ? strings.historyContinue : strings.conversationClosed) }),
5708
+ (chat.unreadCount ?? 0) > 0 ? /* @__PURE__ */ jsx19("span", { class: `${p35}-history-dot` }) : null
5619
5709
  ] })
5620
5710
  ] })
5621
5711
  ]
@@ -5628,15 +5718,15 @@ function ConversationList({
5628
5718
  }
5629
5719
 
5630
5720
  // src/ui/suggestions.tsx
5631
- import { jsx as jsx19 } from "preact/jsx-runtime";
5632
- var p16 = BRAND.cssPrefix;
5721
+ import { jsx as jsx20 } from "preact/jsx-runtime";
5722
+ var p18 = BRAND.cssPrefix;
5633
5723
  function Suggestions({ suggestions, onPick }) {
5634
5724
  if (suggestions.length === 0) return null;
5635
- return /* @__PURE__ */ jsx19("div", { class: `${p16}-suggestions`, role: "group", "aria-label": "Suggested replies", children: suggestions.map((s, i) => /* @__PURE__ */ jsx19(
5725
+ return /* @__PURE__ */ jsx20("div", { class: `${p18}-suggestions`, role: "group", "aria-label": "Suggested replies", children: suggestions.map((s, i) => /* @__PURE__ */ jsx20(
5636
5726
  "button",
5637
5727
  {
5638
5728
  type: "button",
5639
- class: `${p16}-suggestion`,
5729
+ class: `${p18}-suggestion`,
5640
5730
  onClick: () => onPick(s),
5641
5731
  "data-testid": tid(TID.suggestion, i),
5642
5732
  children: s.label
@@ -5646,8 +5736,8 @@ function Suggestions({ suggestions, onPick }) {
5646
5736
  }
5647
5737
 
5648
5738
  // src/ui/panel.tsx
5649
- import { Fragment as Fragment4, jsx as jsx20, jsxs as jsxs16 } from "preact/jsx-runtime";
5650
- var p17 = BRAND.cssPrefix;
5739
+ import { Fragment as Fragment4, jsx as jsx21, jsxs as jsxs17 } from "preact/jsx-runtime";
5740
+ var p19 = BRAND.cssPrefix;
5651
5741
  function Panel(props2) {
5652
5742
  const { options, onClose } = props2;
5653
5743
  const s = options.strings;
@@ -5671,18 +5761,18 @@ function Panel(props2) {
5671
5761
  }, []);
5672
5762
  const { visible: dragOver } = useFileDrop({ containerRef, onDrop: onDropItems });
5673
5763
  useDragMove(containerRef.current, options.mode === "modal");
5674
- return /* @__PURE__ */ jsxs16(
5764
+ return /* @__PURE__ */ jsxs17(
5675
5765
  "div",
5676
5766
  {
5677
5767
  ref: containerRef,
5678
- class: `${p17}-panel`,
5768
+ class: `${p19}-panel`,
5679
5769
  role: "dialog",
5680
5770
  "aria-modal": "false",
5681
5771
  "aria-label": s.panelTitle,
5682
5772
  style: { position: "relative" },
5683
5773
  "data-testid": TID.panel,
5684
5774
  children: [
5685
- /* @__PURE__ */ jsx20(
5775
+ /* @__PURE__ */ jsx21(
5686
5776
  PanelContent,
5687
5777
  {
5688
5778
  ...props2,
@@ -5691,7 +5781,7 @@ function Panel(props2) {
5691
5781
  composerAttachApiRef
5692
5782
  }
5693
5783
  ),
5694
- /* @__PURE__ */ jsx20(PoweredByBar, { poweredBy: props2.options.poweredBy })
5784
+ /* @__PURE__ */ jsx21(PoweredByBar, { poweredBy: props2.options.poweredBy })
5695
5785
  ]
5696
5786
  }
5697
5787
  );
@@ -5738,9 +5828,9 @@ function PanelContent(props2) {
5738
5828
  if (activeForm) {
5739
5829
  composerArea = null;
5740
5830
  } else if (canSend) {
5741
- composerArea = /* @__PURE__ */ jsxs16(Fragment4, { children: [
5742
- /* @__PURE__ */ jsx20(Suggestions, { suggestions, onPick: onSuggestion }),
5743
- /* @__PURE__ */ jsx20(
5831
+ composerArea = /* @__PURE__ */ jsxs17(Fragment4, { children: [
5832
+ /* @__PURE__ */ jsx21(Suggestions, { suggestions, onPick: onSuggestion }),
5833
+ /* @__PURE__ */ jsx21(
5744
5834
  Composer,
5745
5835
  {
5746
5836
  options,
@@ -5755,10 +5845,10 @@ function PanelContent(props2) {
5755
5845
  )
5756
5846
  ] });
5757
5847
  } else {
5758
- composerArea = /* @__PURE__ */ jsx20(ReadOnlyBanner, { label: s.conversationClosed, ctaLabel: s.startNewConversation, onNewConversation: onClear });
5848
+ composerArea = /* @__PURE__ */ jsx21(ReadOnlyBanner, { label: s.conversationClosed, ctaLabel: s.startNewConversation, onNewConversation: onClear });
5759
5849
  }
5760
- return /* @__PURE__ */ jsxs16(Fragment4, { children: [
5761
- view === "history" ? /* @__PURE__ */ jsx20(
5850
+ return /* @__PURE__ */ jsxs17(Fragment4, { children: [
5851
+ view === "history" ? /* @__PURE__ */ jsx21(
5762
5852
  HistoryHeader,
5763
5853
  {
5764
5854
  strings: s,
@@ -5766,22 +5856,22 @@ function PanelContent(props2) {
5766
5856
  onClose,
5767
5857
  showClose: canShowClose(options.mode, panelSize, options.actions)
5768
5858
  }
5769
- ) : /* @__PURE__ */ jsxs16("header", { class: `${p17}-header`, "data-testid": TID.panelHeader, children: [
5770
- onBack ? /* @__PURE__ */ jsx20(
5859
+ ) : /* @__PURE__ */ jsxs17("header", { class: `${p19}-header`, "data-testid": TID.panelHeader, children: [
5860
+ onBack ? /* @__PURE__ */ jsx21(
5771
5861
  "button",
5772
5862
  {
5773
5863
  type: "button",
5774
- class: `${p17}-icon-btn`,
5864
+ class: `${p19}-icon-btn`,
5775
5865
  onClick: onBack,
5776
5866
  "aria-label": s.moduleBack,
5777
5867
  title: s.moduleBack,
5778
- children: /* @__PURE__ */ jsx20(BackIcon, {})
5868
+ children: /* @__PURE__ */ jsx21(BackIcon, {})
5779
5869
  }
5780
5870
  ) : null,
5781
- agent ? /* @__PURE__ */ jsx20(AgentBadge, { agent, strings: s }) : /* @__PURE__ */ jsx20("h1", { children: s.panelTitle }),
5782
- /* @__PURE__ */ jsx20(HeaderActions, { panelProps: props2, variant: "chat" })
5871
+ agent ? /* @__PURE__ */ jsx21(AgentBadge, { agent, strings: s }) : /* @__PURE__ */ jsx21("h1", { children: s.panelTitle }),
5872
+ /* @__PURE__ */ jsx21(HeaderActions, { panelProps: props2, variant: "chat" })
5783
5873
  ] }),
5784
- view === "history" ? /* @__PURE__ */ jsx20(
5874
+ view === "history" ? /* @__PURE__ */ jsx21(
5785
5875
  ConversationList,
5786
5876
  {
5787
5877
  transport,
@@ -5792,9 +5882,9 @@ function PanelContent(props2) {
5792
5882
  onSelect: (conversation) => onSelectHistoryConversation(conversation.conversationId),
5793
5883
  onNewConversation
5794
5884
  }
5795
- ) : /* @__PURE__ */ jsxs16(Fragment4, { children: [
5796
- /* @__PURE__ */ jsx20(DropZone, { visible: dragOver, strings: s }),
5797
- /* @__PURE__ */ jsx20(
5885
+ ) : /* @__PURE__ */ jsxs17(Fragment4, { children: [
5886
+ /* @__PURE__ */ jsx21(DropZone, { visible: dragOver, strings: s }),
5887
+ /* @__PURE__ */ jsx21(
5798
5888
  MessageList,
5799
5889
  {
5800
5890
  messagesSig,
@@ -5802,6 +5892,7 @@ function PanelContent(props2) {
5802
5892
  responseMode: options.responseMode,
5803
5893
  showReasoning: options.showReasoning,
5804
5894
  showToolCalls: options.showToolCalls,
5895
+ showSources: options.showSources,
5805
5896
  loading: loadingMessages,
5806
5897
  idle: !isStreaming,
5807
5898
  tool,
@@ -5811,9 +5902,9 @@ function PanelContent(props2) {
5811
5902
  }
5812
5903
  ),
5813
5904
  composerArea,
5814
- /* @__PURE__ */ jsx20(ComposerFooter, { disclaimer: options.composerDisclaimer })
5905
+ /* @__PURE__ */ jsx21(ComposerFooter, { disclaimer: options.composerDisclaimer })
5815
5906
  ] }),
5816
- options.size.resize?.enabled ? /* @__PURE__ */ jsx20(
5907
+ options.size.resize?.enabled ? /* @__PURE__ */ jsx21(
5817
5908
  ResizeGrip,
5818
5909
  {
5819
5910
  panelEl: containerEl,
@@ -5832,28 +5923,28 @@ function HistoryHeader({
5832
5923
  onClose,
5833
5924
  showClose
5834
5925
  }) {
5835
- return /* @__PURE__ */ jsxs16("header", { class: `${p17}-header`, children: [
5836
- /* @__PURE__ */ jsx20(
5926
+ return /* @__PURE__ */ jsxs17("header", { class: `${p19}-header`, children: [
5927
+ /* @__PURE__ */ jsx21(
5837
5928
  "button",
5838
5929
  {
5839
5930
  type: "button",
5840
- class: `${p17}-icon-btn`,
5931
+ class: `${p19}-icon-btn`,
5841
5932
  onClick: onBack,
5842
5933
  "aria-label": strings.historyBack,
5843
5934
  title: strings.historyBack,
5844
- children: /* @__PURE__ */ jsx20(BackIcon, {})
5935
+ children: /* @__PURE__ */ jsx21(BackIcon, {})
5845
5936
  }
5846
5937
  ),
5847
- /* @__PURE__ */ jsx20("h1", { children: strings.historyTitle }),
5848
- showClose ? /* @__PURE__ */ jsx20(
5938
+ /* @__PURE__ */ jsx21("h1", { children: strings.historyTitle }),
5939
+ showClose ? /* @__PURE__ */ jsx21(
5849
5940
  "button",
5850
5941
  {
5851
5942
  type: "button",
5852
- class: `${p17}-icon-btn`,
5943
+ class: `${p19}-icon-btn`,
5853
5944
  onClick: onClose,
5854
5945
  "aria-label": strings.close,
5855
5946
  title: strings.close,
5856
- children: /* @__PURE__ */ jsx20(CloseIcon, {})
5947
+ children: /* @__PURE__ */ jsx21(CloseIcon, {})
5857
5948
  }
5858
5949
  ) : null
5859
5950
  ] });
@@ -5863,28 +5954,28 @@ function ReadOnlyBanner({
5863
5954
  ctaLabel,
5864
5955
  onNewConversation
5865
5956
  }) {
5866
- return /* @__PURE__ */ jsxs16("div", { class: `${p17}-readonly-banner`, role: "note", children: [
5867
- /* @__PURE__ */ jsx20("span", { class: `${p17}-readonly-label`, children: label }),
5868
- /* @__PURE__ */ jsx20("button", { type: "button", class: `${p17}-readonly-cta`, onClick: onNewConversation, children: ctaLabel })
5957
+ return /* @__PURE__ */ jsxs17("div", { class: `${p19}-readonly-banner`, role: "note", children: [
5958
+ /* @__PURE__ */ jsx21("span", { class: `${p19}-readonly-label`, children: label }),
5959
+ /* @__PURE__ */ jsx21("button", { type: "button", class: `${p19}-readonly-cta`, onClick: onNewConversation, children: ctaLabel })
5869
5960
  ] });
5870
5961
  }
5871
5962
  function ComposerFooter({ disclaimer }) {
5872
5963
  if (!disclaimer) return null;
5873
- return /* @__PURE__ */ jsx20("div", { class: `${p17}-composer-footer`, children: /* @__PURE__ */ jsx20("div", { class: `${p17}-disclaimer`, children: disclaimer }) });
5964
+ return /* @__PURE__ */ jsx21("div", { class: `${p19}-composer-footer`, children: /* @__PURE__ */ jsx21("div", { class: `${p19}-disclaimer`, children: disclaimer }) });
5874
5965
  }
5875
5966
  function PoweredByBar({ poweredBy }) {
5876
5967
  if (!poweredBy) return null;
5877
- return /* @__PURE__ */ jsx20("div", { class: `${p17}-poweredby-bar`, children: /* @__PURE__ */ jsx20(PoweredBy, { logoUrl: poweredBy.logoUrl, text: poweredBy.text, href: poweredBy.href }) });
5968
+ return /* @__PURE__ */ jsx21("div", { class: `${p19}-poweredby-bar`, children: /* @__PURE__ */ jsx21(PoweredBy, { logoUrl: poweredBy.logoUrl, text: poweredBy.text, href: poweredBy.href }) });
5878
5969
  }
5879
5970
  function PoweredBy({ logoUrl, text, href }) {
5880
- const inner = /* @__PURE__ */ jsxs16(Fragment4, { children: [
5881
- logoUrl ? /* @__PURE__ */ jsx20("img", { class: `${p17}-poweredby-logo`, src: logoUrl, alt: "", loading: "lazy" }) : null,
5882
- text ? /* @__PURE__ */ jsx20("span", { children: text }) : null
5971
+ const inner = /* @__PURE__ */ jsxs17(Fragment4, { children: [
5972
+ logoUrl ? /* @__PURE__ */ jsx21("img", { class: `${p19}-poweredby-logo`, src: logoUrl, alt: "", loading: "lazy" }) : null,
5973
+ text ? /* @__PURE__ */ jsx21("span", { children: text }) : null
5883
5974
  ] });
5884
5975
  if (href) {
5885
- return /* @__PURE__ */ jsx20("a", { class: `${p17}-poweredby`, href, target: "_blank", rel: "noopener noreferrer", children: inner });
5976
+ return /* @__PURE__ */ jsx21("a", { class: `${p19}-poweredby`, href, target: "_blank", rel: "noopener noreferrer", children: inner });
5886
5977
  }
5887
- return /* @__PURE__ */ jsx20("span", { class: `${p17}-poweredby`, children: inner });
5978
+ return /* @__PURE__ */ jsx21("span", { class: `${p19}-poweredby`, children: inner });
5888
5979
  }
5889
5980
 
5890
5981
  // src/ui/form/form-controller.ts
@@ -5967,34 +6058,34 @@ function whenPasses(form, d) {
5967
6058
  }
5968
6059
 
5969
6060
  // src/ui/sidebar.tsx
5970
- import { Fragment as Fragment5, jsx as jsx21, jsxs as jsxs17 } from "preact/jsx-runtime";
6061
+ import { Fragment as Fragment5, jsx as jsx22, jsxs as jsxs18 } from "preact/jsx-runtime";
5971
6062
  function Sidebar(props2) {
5972
- const p33 = BRAND.cssPrefix;
6063
+ const p35 = BRAND.cssPrefix;
5973
6064
  const { site, blocks, strings, collapsed } = props2;
5974
6065
  const navigation = blocks?.navigation ?? [];
5975
6066
  const linkCards = blocks?.linkCards ?? [];
5976
6067
  const toggleLabel = collapsed ? strings.expandSidebar : strings.collapseSidebar;
5977
- return /* @__PURE__ */ jsxs17("aside", { class: `${p33}-sidebar`, "data-collapsed": collapsed ? "true" : "false", "data-testid": TID.sidebar, children: [
5978
- /* @__PURE__ */ jsxs17("div", { class: `${p33}-sidebar-header`, children: [
5979
- /* @__PURE__ */ jsx21(SidebarBrand, { site }),
5980
- /* @__PURE__ */ jsx21(
6068
+ return /* @__PURE__ */ jsxs18("aside", { class: `${p35}-sidebar`, "data-collapsed": collapsed ? "true" : "false", "data-testid": TID.sidebar, children: [
6069
+ /* @__PURE__ */ jsxs18("div", { class: `${p35}-sidebar-header`, children: [
6070
+ /* @__PURE__ */ jsx22(SidebarBrand, { site }),
6071
+ /* @__PURE__ */ jsx22(
5981
6072
  "button",
5982
6073
  {
5983
6074
  type: "button",
5984
- class: `${p33}-sidebar-toggle`,
6075
+ class: `${p35}-sidebar-toggle`,
5985
6076
  "aria-label": toggleLabel,
5986
6077
  "aria-expanded": collapsed ? "false" : "true",
5987
6078
  title: toggleLabel,
5988
6079
  onClick: props2.onToggleCollapsed,
5989
6080
  "data-testid": TID.sidebarToggle,
5990
- children: /* @__PURE__ */ jsx21(SidebarToggleIcon, { collapsed })
6081
+ children: /* @__PURE__ */ jsx22(SidebarToggleIcon, { collapsed })
5991
6082
  }
5992
6083
  )
5993
6084
  ] }),
5994
- collapsed ? null : /* @__PURE__ */ jsxs17(Fragment5, { children: [
5995
- navigation.length > 0 ? /* @__PURE__ */ jsx21("nav", { class: `${p33}-sidebar-section`, "data-section": "navigation", children: /* @__PURE__ */ jsx21(SidebarNav, { items: navigation }) }) : null,
5996
- linkCards.length > 0 ? /* @__PURE__ */ jsx21("div", { class: `${p33}-sidebar-section`, "data-section": "link-cards", children: /* @__PURE__ */ jsx21(SidebarCards, { items: linkCards }) }) : null,
5997
- props2.showConversations ? /* @__PURE__ */ jsx21("div", { class: `${p33}-sidebar-conversations`, children: /* @__PURE__ */ jsx21(
6085
+ collapsed ? null : /* @__PURE__ */ jsxs18(Fragment5, { children: [
6086
+ navigation.length > 0 ? /* @__PURE__ */ jsx22("nav", { class: `${p35}-sidebar-section`, "data-section": "navigation", children: /* @__PURE__ */ jsx22(SidebarNav, { items: navigation }) }) : null,
6087
+ linkCards.length > 0 ? /* @__PURE__ */ jsx22("div", { class: `${p35}-sidebar-section`, "data-section": "link-cards", children: /* @__PURE__ */ jsx22(SidebarCards, { items: linkCards }) }) : null,
6088
+ props2.showConversations ? /* @__PURE__ */ jsx22("div", { class: `${p35}-sidebar-conversations`, children: /* @__PURE__ */ jsx22(
5998
6089
  ConversationList,
5999
6090
  {
6000
6091
  transport: props2.transport,
@@ -6010,18 +6101,18 @@ function Sidebar(props2) {
6010
6101
  ] });
6011
6102
  }
6012
6103
  function SidebarBrand({ site }) {
6013
- const p33 = BRAND.cssPrefix;
6104
+ const p35 = BRAND.cssPrefix;
6014
6105
  if (site?.logo?.url) {
6015
6106
  const alt = site.logo.alt ?? site.title ?? "Logo";
6016
- return /* @__PURE__ */ jsxs17("picture", { children: [
6017
- site.logoDark?.url ? /* @__PURE__ */ jsx21("source", { srcset: site.logoDark.url, media: "(prefers-color-scheme: dark)" }) : null,
6018
- /* @__PURE__ */ jsx21("img", { class: `${p33}-sidebar-logo`, src: site.logo.url, alt })
6107
+ return /* @__PURE__ */ jsxs18("picture", { children: [
6108
+ site.logoDark?.url ? /* @__PURE__ */ jsx22("source", { srcset: site.logoDark.url, media: "(prefers-color-scheme: dark)" }) : null,
6109
+ /* @__PURE__ */ jsx22("img", { class: `${p35}-sidebar-logo`, src: site.logo.url, alt })
6019
6110
  ] });
6020
6111
  }
6021
- return /* @__PURE__ */ jsx21("div", { class: `${p33}-sidebar-title`, children: site?.title ?? BRAND.name });
6112
+ return /* @__PURE__ */ jsx22("div", { class: `${p35}-sidebar-title`, children: site?.title ?? BRAND.name });
6022
6113
  }
6023
6114
  function SidebarToggleIcon({ collapsed }) {
6024
- return /* @__PURE__ */ jsx21(
6115
+ return /* @__PURE__ */ jsx22(
6025
6116
  "svg",
6026
6117
  {
6027
6118
  width: "16",
@@ -6031,38 +6122,38 @@ function SidebarToggleIcon({ collapsed }) {
6031
6122
  stroke: "currentColor",
6032
6123
  "stroke-width": "2",
6033
6124
  "aria-hidden": "true",
6034
- children: collapsed ? /* @__PURE__ */ jsx21("polyline", { points: "9 6 15 12 9 18" }) : /* @__PURE__ */ jsx21("polyline", { points: "15 6 9 12 15 18" })
6125
+ children: collapsed ? /* @__PURE__ */ jsx22("polyline", { points: "9 6 15 12 9 18" }) : /* @__PURE__ */ jsx22("polyline", { points: "15 6 9 12 15 18" })
6035
6126
  }
6036
6127
  );
6037
6128
  }
6038
6129
  function SidebarNav({ items }) {
6039
- const p33 = BRAND.cssPrefix;
6040
- return /* @__PURE__ */ jsx21("ul", { class: `${p33}-sidebar-nav`, children: items.map((item) => /* @__PURE__ */ jsx21("li", { children: /* @__PURE__ */ jsxs17(
6130
+ const p35 = BRAND.cssPrefix;
6131
+ return /* @__PURE__ */ jsx22("ul", { class: `${p35}-sidebar-nav`, children: items.map((item) => /* @__PURE__ */ jsx22("li", { children: /* @__PURE__ */ jsxs18(
6041
6132
  "a",
6042
6133
  {
6043
- class: `${p33}-sidebar-nav-item`,
6134
+ class: `${p35}-sidebar-nav-item`,
6044
6135
  href: item.href,
6045
6136
  target: item.href ? "_blank" : void 0,
6046
6137
  rel: item.href ? "noreferrer" : void 0,
6047
6138
  children: [
6048
- item.icon ? /* @__PURE__ */ jsx21("span", { class: `${p33}-sidebar-nav-icon`, "data-icon": item.icon }) : null,
6049
- /* @__PURE__ */ jsx21("span", { class: `${p33}-sidebar-nav-label`, children: item.label })
6139
+ item.icon ? /* @__PURE__ */ jsx22("span", { class: `${p35}-sidebar-nav-icon`, "data-icon": item.icon }) : null,
6140
+ /* @__PURE__ */ jsx22("span", { class: `${p35}-sidebar-nav-label`, children: item.label })
6050
6141
  ]
6051
6142
  }
6052
6143
  ) }, item.id ?? item.label)) });
6053
6144
  }
6054
6145
  function SidebarCards({ items }) {
6055
- const p33 = BRAND.cssPrefix;
6056
- return /* @__PURE__ */ jsx21("div", { class: `${p33}-sidebar-cards`, children: items.map((item) => /* @__PURE__ */ jsxs17(
6146
+ const p35 = BRAND.cssPrefix;
6147
+ return /* @__PURE__ */ jsx22("div", { class: `${p35}-sidebar-cards`, children: items.map((item) => /* @__PURE__ */ jsxs18(
6057
6148
  "a",
6058
6149
  {
6059
- class: `${p33}-sidebar-card`,
6150
+ class: `${p35}-sidebar-card`,
6060
6151
  href: item.href,
6061
6152
  target: item.href ? "_blank" : void 0,
6062
6153
  rel: item.href ? "noreferrer" : void 0,
6063
6154
  children: [
6064
- /* @__PURE__ */ jsx21("div", { class: `${p33}-sidebar-card-label`, children: item.label }),
6065
- item.description ? /* @__PURE__ */ jsx21("div", { class: `${p33}-sidebar-card-desc`, children: item.description }) : null
6155
+ /* @__PURE__ */ jsx22("div", { class: `${p35}-sidebar-card-label`, children: item.label }),
6156
+ item.description ? /* @__PURE__ */ jsx22("div", { class: `${p35}-sidebar-card-desc`, children: item.description }) : null
6066
6157
  ]
6067
6158
  },
6068
6159
  item.id ?? item.label
@@ -6070,11 +6161,11 @@ function SidebarCards({ items }) {
6070
6161
  }
6071
6162
 
6072
6163
  // src/ui/page-shell.tsx
6073
- import { jsx as jsx22, jsxs as jsxs18 } from "preact/jsx-runtime";
6074
- var p18 = BRAND.cssPrefix;
6164
+ import { jsx as jsx23, jsxs as jsxs19 } from "preact/jsx-runtime";
6165
+ var p20 = BRAND.cssPrefix;
6075
6166
  function PageShell(props2) {
6076
- return /* @__PURE__ */ jsxs18("main", { class: `${p18}-page-shell`, "data-sidebar-collapsed": props2.sidebarCollapsed ? "true" : "false", children: [
6077
- /* @__PURE__ */ jsx22(
6167
+ return /* @__PURE__ */ jsxs19("main", { class: `${p20}-page-shell`, "data-sidebar-collapsed": props2.sidebarCollapsed ? "true" : "false", children: [
6168
+ /* @__PURE__ */ jsx23(
6078
6169
  Sidebar,
6079
6170
  {
6080
6171
  site: props2.site,
@@ -6091,7 +6182,7 @@ function PageShell(props2) {
6091
6182
  onToggleCollapsed: props2.onToggleSidebarCollapsed
6092
6183
  }
6093
6184
  ),
6094
- /* @__PURE__ */ jsx22("section", { class: `${p18}-page-chat`, "aria-label": "Chat", children: props2.children })
6185
+ /* @__PURE__ */ jsx23("section", { class: `${p20}-page-chat`, "aria-label": "Chat", children: props2.children })
6095
6186
  ] });
6096
6187
  }
6097
6188
 
@@ -6129,7 +6220,7 @@ var atTabRoot = (s) => activeStack(s).length === 0;
6129
6220
 
6130
6221
  // src/ui/messenger-home.tsx
6131
6222
  import { useCallback as useCallback4, useEffect as useEffect14, useRef as useRef8 } from "preact/hooks";
6132
- import { useComputed as useComputed6 } from "@preact/signals";
6223
+ import { useComputed as useComputed7 } from "@preact/signals";
6133
6224
 
6134
6225
  // src/ui/modules/chat.tsx
6135
6226
  var chatLayout = {
@@ -6141,80 +6232,80 @@ var chatLayout = {
6141
6232
  import { useEffect as useEffect10, useMemo as useMemo2, useState as useState8 } from "preact/hooks";
6142
6233
 
6143
6234
  // src/ui/back-header.tsx
6144
- import { jsx as jsx23, jsxs as jsxs19 } from "preact/jsx-runtime";
6145
- var p19 = BRAND.cssPrefix;
6235
+ import { jsx as jsx24, jsxs as jsxs20 } from "preact/jsx-runtime";
6236
+ var p21 = BRAND.cssPrefix;
6146
6237
  function TitleBar({ title, actions }) {
6147
- return /* @__PURE__ */ jsxs19("header", { class: `${p19}-back-header`, "data-variant": "title", children: [
6148
- /* @__PURE__ */ jsx23("span", { class: `${p19}-back-spacer`, "aria-hidden": "true" }),
6149
- /* @__PURE__ */ jsx23("h1", { class: `${p19}-back-title`, children: title }),
6150
- actions ?? /* @__PURE__ */ jsx23("span", { class: `${p19}-back-spacer`, "aria-hidden": "true" })
6238
+ return /* @__PURE__ */ jsxs20("header", { class: `${p21}-back-header`, "data-variant": "title", children: [
6239
+ /* @__PURE__ */ jsx24("span", { class: `${p21}-back-spacer`, "aria-hidden": "true" }),
6240
+ /* @__PURE__ */ jsx24("h1", { class: `${p21}-back-title`, children: title }),
6241
+ actions ?? /* @__PURE__ */ jsx24("span", { class: `${p21}-back-spacer`, "aria-hidden": "true" })
6151
6242
  ] });
6152
6243
  }
6153
6244
  function BackHeader({ title, backLabel, onBack, actions, testid }) {
6154
- return /* @__PURE__ */ jsxs19("header", { class: `${p19}-back-header`, "data-testid": testid, children: [
6155
- /* @__PURE__ */ jsx23("button", { type: "button", class: `${p19}-icon-btn`, onClick: onBack, "aria-label": backLabel, title: backLabel, children: /* @__PURE__ */ jsx23(BackIcon, {}) }),
6156
- /* @__PURE__ */ jsx23("h1", { class: `${p19}-back-title`, children: title }),
6157
- actions ?? /* @__PURE__ */ jsx23("span", { class: `${p19}-back-spacer`, "aria-hidden": "true" })
6245
+ return /* @__PURE__ */ jsxs20("header", { class: `${p21}-back-header`, "data-testid": testid, children: [
6246
+ /* @__PURE__ */ jsx24("button", { type: "button", class: `${p21}-icon-btn`, onClick: onBack, "aria-label": backLabel, title: backLabel, children: /* @__PURE__ */ jsx24(BackIcon, {}) }),
6247
+ /* @__PURE__ */ jsx24("h1", { class: `${p21}-back-title`, children: title }),
6248
+ actions ?? /* @__PURE__ */ jsx24("span", { class: `${p21}-back-spacer`, "aria-hidden": "true" })
6158
6249
  ] });
6159
6250
  }
6160
6251
 
6161
6252
  // src/ui/home-search.tsx
6162
- import { jsx as jsx24, jsxs as jsxs20 } from "preact/jsx-runtime";
6163
- var p20 = BRAND.cssPrefix;
6253
+ import { jsx as jsx25, jsxs as jsxs21 } from "preact/jsx-runtime";
6254
+ var p22 = BRAND.cssPrefix;
6164
6255
  function HomeSearchButton({ placeholder, onActivate }) {
6165
- return /* @__PURE__ */ jsxs20("button", { type: "button", class: `${p20}-home-search`, onClick: onActivate, "data-testid": TID.homeSearch, children: [
6166
- /* @__PURE__ */ jsx24("span", { class: `${p20}-home-search-text`, children: placeholder }),
6167
- /* @__PURE__ */ jsx24("span", { class: `${p20}-home-search-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx24(SearchIcon, {}) })
6256
+ return /* @__PURE__ */ jsxs21("button", { type: "button", class: `${p22}-home-search`, onClick: onActivate, "data-testid": TID.homeSearch, children: [
6257
+ /* @__PURE__ */ jsx25("span", { class: `${p22}-home-search-text`, children: placeholder }),
6258
+ /* @__PURE__ */ jsx25("span", { class: `${p22}-home-search-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx25(SearchIcon, {}) })
6168
6259
  ] });
6169
6260
  }
6170
6261
  function HelpSearchInput({ placeholder, value, onInput }) {
6171
- return /* @__PURE__ */ jsxs20("div", { class: `${p20}-home-search`, "data-input": "true", children: [
6172
- /* @__PURE__ */ jsx24(
6262
+ return /* @__PURE__ */ jsxs21("div", { class: `${p22}-home-search`, "data-input": "true", children: [
6263
+ /* @__PURE__ */ jsx25(
6173
6264
  "input",
6174
6265
  {
6175
6266
  type: "search",
6176
- class: `${p20}-home-search-input`,
6267
+ class: `${p22}-home-search-input`,
6177
6268
  placeholder,
6178
6269
  value,
6179
6270
  onInput: (e) => onInput(e.currentTarget.value),
6180
6271
  "data-testid": TID.helpSearch
6181
6272
  }
6182
6273
  ),
6183
- /* @__PURE__ */ jsx24("span", { class: `${p20}-home-search-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx24(SearchIcon, {}) })
6274
+ /* @__PURE__ */ jsx25("span", { class: `${p22}-home-search-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx25(SearchIcon, {}) })
6184
6275
  ] });
6185
6276
  }
6186
6277
 
6187
6278
  // src/ui/list-row.tsx
6188
- import { jsx as jsx25, jsxs as jsxs21 } from "preact/jsx-runtime";
6189
- var p21 = BRAND.cssPrefix;
6279
+ import { jsx as jsx26, jsxs as jsxs22 } from "preact/jsx-runtime";
6280
+ var p23 = BRAND.cssPrefix;
6190
6281
  function ListRow({ title, subtitle, onClick, testid }) {
6191
- return /* @__PURE__ */ jsxs21("button", { type: "button", class: `${p21}-list-row`, onClick, "data-testid": testid, children: [
6192
- /* @__PURE__ */ jsxs21("span", { class: `${p21}-list-row-body`, children: [
6193
- /* @__PURE__ */ jsx25("span", { class: `${p21}-list-row-title`, children: title }),
6194
- subtitle ? /* @__PURE__ */ jsx25("span", { class: `${p21}-list-row-sub`, children: subtitle }) : null
6282
+ return /* @__PURE__ */ jsxs22("button", { type: "button", class: `${p23}-list-row`, onClick, "data-testid": testid, children: [
6283
+ /* @__PURE__ */ jsxs22("span", { class: `${p23}-list-row-body`, children: [
6284
+ /* @__PURE__ */ jsx26("span", { class: `${p23}-list-row-title`, children: title }),
6285
+ subtitle ? /* @__PURE__ */ jsx26("span", { class: `${p23}-list-row-sub`, children: subtitle }) : null
6195
6286
  ] }),
6196
- /* @__PURE__ */ jsx25("span", { class: `${p21}-list-row-chevron`, "aria-hidden": "true", children: /* @__PURE__ */ jsx25(ChevronRightIcon, {}) })
6287
+ /* @__PURE__ */ jsx26("span", { class: `${p23}-list-row-chevron`, "aria-hidden": "true", children: /* @__PURE__ */ jsx26(ChevronRightIcon, {}) })
6197
6288
  ] });
6198
6289
  }
6199
6290
 
6200
6291
  // src/ui/module-state.tsx
6201
- import { jsx as jsx26, jsxs as jsxs22 } from "preact/jsx-runtime";
6202
- var p22 = BRAND.cssPrefix;
6292
+ import { jsx as jsx27, jsxs as jsxs23 } from "preact/jsx-runtime";
6293
+ var p24 = BRAND.cssPrefix;
6203
6294
  function ModuleState({
6204
6295
  tone = "info",
6205
6296
  message,
6206
6297
  onRetry,
6207
6298
  strings
6208
6299
  }) {
6209
- return /* @__PURE__ */ jsxs22("div", { class: `${p22}-module-empty`, role: tone === "error" ? "alert" : "status", "aria-live": "polite", children: [
6210
- /* @__PURE__ */ jsx26("span", { children: message }),
6211
- onRetry ? /* @__PURE__ */ jsx26("button", { type: "button", class: `${p22}-module-retry`, onClick: onRetry, children: strings.errorRetry }) : null
6300
+ return /* @__PURE__ */ jsxs23("div", { class: `${p24}-module-empty`, role: tone === "error" ? "alert" : "status", "aria-live": "polite", children: [
6301
+ /* @__PURE__ */ jsx27("span", { children: message }),
6302
+ onRetry ? /* @__PURE__ */ jsx27("button", { type: "button", class: `${p24}-module-retry`, onClick: onRetry, children: strings.errorRetry }) : null
6212
6303
  ] });
6213
6304
  }
6214
6305
 
6215
6306
  // src/ui/modules/help.tsx
6216
- import { jsx as jsx27, jsxs as jsxs23 } from "preact/jsx-runtime";
6217
- var p23 = BRAND.cssPrefix;
6307
+ import { jsx as jsx28, jsxs as jsxs24 } from "preact/jsx-runtime";
6308
+ var p25 = BRAND.cssPrefix;
6218
6309
  var log13 = logger.scope("help");
6219
6310
  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 });
6220
6311
  function groupByCategory(items) {
@@ -6243,7 +6334,7 @@ function fuzzySearch(items, query) {
6243
6334
  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);
6244
6335
  }
6245
6336
  function ArticleRow({ article, nav }) {
6246
- return /* @__PURE__ */ jsx27(
6337
+ return /* @__PURE__ */ jsx28(
6247
6338
  ListRow,
6248
6339
  {
6249
6340
  title: article.title,
@@ -6288,46 +6379,46 @@ function HelpRoot({ transport, strings, config, nav, bus, panelProps }) {
6288
6379
  }, [query, results, bus]);
6289
6380
  function renderBody() {
6290
6381
  if (query.trim().length > 0) {
6291
- if (results.length === 0) return /* @__PURE__ */ jsx27(ModuleState, { message: strings.helpSearchEmpty, strings });
6292
- return /* @__PURE__ */ jsx27("div", { class: `${p23}-help-card`, children: results.map((a) => /* @__PURE__ */ jsx27(ArticleRow, { article: a, nav }, a.id)) });
6382
+ if (results.length === 0) return /* @__PURE__ */ jsx28(ModuleState, { message: strings.helpSearchEmpty, strings });
6383
+ return /* @__PURE__ */ jsx28("div", { class: `${p25}-help-card`, children: results.map((a) => /* @__PURE__ */ jsx28(ArticleRow, { article: a, nav }, a.id)) });
6293
6384
  }
6294
- if (state === "loading") return /* @__PURE__ */ jsx27(ModuleState, { message: strings.helpLoading, strings });
6385
+ if (state === "loading") return /* @__PURE__ */ jsx28(ModuleState, { message: strings.helpLoading, strings });
6295
6386
  if (state === "error") {
6296
- return /* @__PURE__ */ jsx27(ModuleState, { tone: "error", message: errorMsg, onRetry: () => setReloadKey((k) => k + 1), strings });
6387
+ return /* @__PURE__ */ jsx28(ModuleState, { tone: "error", message: errorMsg, onRetry: () => setReloadKey((k) => k + 1), strings });
6297
6388
  }
6298
- if (items.length === 0) return /* @__PURE__ */ jsx27(ModuleState, { message: strings.helpEmpty, strings });
6299
- return groupByCategory(items).map(([category, rows]) => /* @__PURE__ */ jsxs23("section", { class: `${p23}-help-group`, children: [
6300
- category ? /* @__PURE__ */ jsx27("h2", { class: `${p23}-help-section-title`, children: category }) : null,
6301
- /* @__PURE__ */ jsx27("div", { class: `${p23}-help-card`, children: rows.map((a) => /* @__PURE__ */ jsx27(ArticleRow, { article: a, nav }, a.id)) })
6389
+ if (items.length === 0) return /* @__PURE__ */ jsx28(ModuleState, { message: strings.helpEmpty, strings });
6390
+ return groupByCategory(items).map(([category, rows]) => /* @__PURE__ */ jsxs24("section", { class: `${p25}-help-group`, children: [
6391
+ category ? /* @__PURE__ */ jsx28("h2", { class: `${p25}-help-section-title`, children: category }) : null,
6392
+ /* @__PURE__ */ jsx28("div", { class: `${p25}-help-card`, children: rows.map((a) => /* @__PURE__ */ jsx28(ArticleRow, { article: a, nav }, a.id)) })
6302
6393
  ] }, category));
6303
6394
  }
6304
- return /* @__PURE__ */ jsxs23("div", { class: `${p23}-module`, children: [
6305
- /* @__PURE__ */ jsx27(TitleBar, { title: strings.helpTitle, actions: /* @__PURE__ */ jsx27(HeaderActions, { panelProps, variant: "plain" }) }),
6306
- /* @__PURE__ */ jsx27("div", { class: `${p23}-module-pad`, children: /* @__PURE__ */ jsx27(HelpSearchInput, { placeholder: strings.helpSearchPlaceholder, value: query, onInput: setQuery }) }),
6307
- /* @__PURE__ */ jsx27("div", { class: `${p23}-help-list`, children: renderBody() })
6395
+ return /* @__PURE__ */ jsxs24("div", { class: `${p25}-module`, children: [
6396
+ /* @__PURE__ */ jsx28(TitleBar, { title: strings.helpTitle, actions: /* @__PURE__ */ jsx28(HeaderActions, { panelProps, variant: "plain" }) }),
6397
+ /* @__PURE__ */ jsx28("div", { class: `${p25}-module-pad`, children: /* @__PURE__ */ jsx28(HelpSearchInput, { placeholder: strings.helpSearchPlaceholder, value: query, onInput: setQuery }) }),
6398
+ /* @__PURE__ */ jsx28("div", { class: `${p25}-help-list`, children: renderBody() })
6308
6399
  ] });
6309
6400
  }
6310
6401
  var helpLayout = {
6311
6402
  Icon: HelpIcon,
6312
- Root: (props2) => /* @__PURE__ */ jsx27(HelpRoot, { ...props2 })
6403
+ Root: (props2) => /* @__PURE__ */ jsx28(HelpRoot, { ...props2 })
6313
6404
  };
6314
6405
 
6315
6406
  // src/ui/modules/home.tsx
6316
6407
  import { useEffect as useEffect11, useState as useState9 } from "preact/hooks";
6317
6408
 
6318
6409
  // src/ui/home-card.tsx
6319
- import { jsx as jsx28 } from "preact/jsx-runtime";
6320
- var p24 = BRAND.cssPrefix;
6410
+ import { jsx as jsx29 } from "preact/jsx-runtime";
6411
+ var p26 = BRAND.cssPrefix;
6321
6412
  function HomeCard({ onClick, children, testid }) {
6322
6413
  if (onClick) {
6323
- return /* @__PURE__ */ jsx28("button", { type: "button", class: `${p24}-home-card`, "data-interactive": "true", onClick, "data-testid": testid, children });
6414
+ return /* @__PURE__ */ jsx29("button", { type: "button", class: `${p26}-home-card`, "data-interactive": "true", onClick, "data-testid": testid, children });
6324
6415
  }
6325
- return /* @__PURE__ */ jsx28("div", { class: `${p24}-home-card`, "data-testid": testid, children });
6416
+ return /* @__PURE__ */ jsx29("div", { class: `${p26}-home-card`, "data-testid": testid, children });
6326
6417
  }
6327
6418
 
6328
6419
  // src/ui/modules/home.tsx
6329
- import { Fragment as Fragment6, jsx as jsx29, jsxs as jsxs24 } from "preact/jsx-runtime";
6330
- var p25 = BRAND.cssPrefix;
6420
+ import { Fragment as Fragment6, jsx as jsx30, jsxs as jsxs25 } from "preact/jsx-runtime";
6421
+ var p27 = BRAND.cssPrefix;
6331
6422
  var log14 = logger.scope("home");
6332
6423
  function resolveGreeting(props2) {
6333
6424
  const name = props2.options.userContext?.name;
@@ -6370,49 +6461,49 @@ function HomeRoot(props2) {
6370
6461
  const status = config.status;
6371
6462
  const statusText = status?.text ? localizeText(strings, status.text) : strings.homeStatus;
6372
6463
  const contentTitle = config.contentBlockTitle ? localizeText(strings, config.contentBlockTitle) : strings.homeContentTitle;
6373
- return /* @__PURE__ */ jsx29("div", { class: `${p25}-module ${p25}-home`, "data-testid": TID.homeView, children: /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-scroll`, children: [
6374
- /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-hero`, children: [
6375
- /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-hero-top`, children: [
6376
- 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" }),
6377
- /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-hero-actions`, children: [
6378
- 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,
6379
- /* @__PURE__ */ jsx29(HeaderActions, { panelProps, variant: "plain" })
6464
+ return /* @__PURE__ */ jsx30("div", { class: `${p27}-module ${p27}-home`, "data-testid": TID.homeView, children: /* @__PURE__ */ jsxs25("div", { class: `${p27}-home-scroll`, children: [
6465
+ /* @__PURE__ */ jsxs25("div", { class: `${p27}-home-hero`, children: [
6466
+ /* @__PURE__ */ jsxs25("div", { class: `${p27}-home-hero-top`, children: [
6467
+ 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" }),
6468
+ /* @__PURE__ */ jsxs25("div", { class: `${p27}-home-hero-actions`, children: [
6469
+ 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,
6470
+ /* @__PURE__ */ jsx30(HeaderActions, { panelProps, variant: "plain" })
6380
6471
  ] })
6381
6472
  ] }),
6382
- config.showGreeting !== false ? /* @__PURE__ */ jsxs24(Fragment6, { children: [
6383
- /* @__PURE__ */ jsx29("h1", { class: `${p25}-home-greeting`, "data-testid": TID.homeGreeting, children: greeting.title }),
6384
- greeting.subtitle ? /* @__PURE__ */ jsx29("p", { class: `${p25}-home-lead`, children: greeting.subtitle }) : null
6473
+ config.showGreeting !== false ? /* @__PURE__ */ jsxs25(Fragment6, { children: [
6474
+ /* @__PURE__ */ jsx30("h1", { class: `${p27}-home-greeting`, "data-testid": TID.homeGreeting, children: greeting.title }),
6475
+ greeting.subtitle ? /* @__PURE__ */ jsx30("p", { class: `${p27}-home-lead`, children: greeting.subtitle }) : null
6385
6476
  ] }) : null
6386
6477
  ] }),
6387
- /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-cards`, children: [
6388
- config.showSearchBar !== false ? /* @__PURE__ */ jsx29(
6478
+ /* @__PURE__ */ jsxs25("div", { class: `${p27}-home-cards`, children: [
6479
+ config.showSearchBar !== false ? /* @__PURE__ */ jsx30(
6389
6480
  HomeSearchButton,
6390
6481
  {
6391
6482
  placeholder: strings.homeSearchPlaceholder,
6392
6483
  onActivate: () => nav.switchToLayout("help")
6393
6484
  }
6394
6485
  ) : null,
6395
- 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: [
6396
- /* @__PURE__ */ jsx29("span", { class: `${p25}-home-recent-avatar`, "aria-hidden": "true", children: /* @__PURE__ */ jsx29(BubblesIcon, {}) }),
6397
- /* @__PURE__ */ jsxs24("span", { class: `${p25}-home-recent-body`, children: [
6398
- /* @__PURE__ */ jsx29("span", { class: `${p25}-home-recent-title`, children: recent.title }),
6399
- recent.preview ? /* @__PURE__ */ jsx29("span", { class: `${p25}-home-recent-preview`, children: recent.preview }) : null
6486
+ 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: [
6487
+ /* @__PURE__ */ jsx30("span", { class: `${p27}-home-recent-avatar`, "aria-hidden": "true", children: /* @__PURE__ */ jsx30(BubblesIcon, {}) }),
6488
+ /* @__PURE__ */ jsxs25("span", { class: `${p27}-home-recent-body`, children: [
6489
+ /* @__PURE__ */ jsx30("span", { class: `${p27}-home-recent-title`, children: recent.title }),
6490
+ recent.preview ? /* @__PURE__ */ jsx30("span", { class: `${p27}-home-recent-preview`, children: recent.preview }) : null
6400
6491
  ] }),
6401
- (recent.unreadCount ?? 0) > 0 ? /* @__PURE__ */ jsx29("span", { class: `${p25}-home-recent-dot`, "aria-label": "Unread" }) : null
6492
+ (recent.unreadCount ?? 0) > 0 ? /* @__PURE__ */ jsx30("span", { class: `${p27}-home-recent-dot`, "aria-label": "Unread" }) : null
6402
6493
  ] }) }) : null,
6403
- status ? /* @__PURE__ */ jsx29(
6494
+ status ? /* @__PURE__ */ jsx30(
6404
6495
  HomeCard,
6405
6496
  {
6406
6497
  onClick: status.url ? () => nav.push({ kind: "iframe", url: status.url, title: statusText }) : void 0,
6407
- children: /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-status`, "data-level": status.level ?? "operational", children: [
6408
- /* @__PURE__ */ jsx29("span", { class: `${p25}-home-status-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx29(StatusOkIcon, {}) }),
6409
- /* @__PURE__ */ jsx29("span", { class: `${p25}-home-status-text`, children: statusText })
6498
+ children: /* @__PURE__ */ jsxs25("div", { class: `${p27}-home-status`, "data-level": status.level ?? "operational", children: [
6499
+ /* @__PURE__ */ jsx30("span", { class: `${p27}-home-status-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx30(StatusOkIcon, {}) }),
6500
+ /* @__PURE__ */ jsx30("span", { class: `${p27}-home-status-text`, children: statusText })
6410
6501
  ] })
6411
6502
  }
6412
6503
  ) : null,
6413
- content.length > 0 ? /* @__PURE__ */ jsxs24("section", { class: `${p25}-home-content`, children: [
6414
- /* @__PURE__ */ jsx29("div", { class: `${p25}-home-content-title`, children: contentTitle }),
6415
- /* @__PURE__ */ jsx29("div", { class: `${p25}-home-content-list`, children: content.map((item) => /* @__PURE__ */ jsx29(
6504
+ content.length > 0 ? /* @__PURE__ */ jsxs25("section", { class: `${p27}-home-content`, children: [
6505
+ /* @__PURE__ */ jsx30("div", { class: `${p27}-home-content-title`, children: contentTitle }),
6506
+ /* @__PURE__ */ jsx30("div", { class: `${p27}-home-content-list`, children: content.map((item) => /* @__PURE__ */ jsx30(
6416
6507
  ListRow,
6417
6508
  {
6418
6509
  title: item.title,
@@ -6428,13 +6519,13 @@ function HomeRoot(props2) {
6428
6519
  }
6429
6520
  var homeLayout = {
6430
6521
  Icon: HomeIcon,
6431
- Root: (props2) => /* @__PURE__ */ jsx29(HomeRoot, { ...props2 })
6522
+ Root: (props2) => /* @__PURE__ */ jsx30(HomeRoot, { ...props2 })
6432
6523
  };
6433
6524
 
6434
6525
  // src/ui/modules/news.tsx
6435
6526
  import { useEffect as useEffect12, useState as useState10 } from "preact/hooks";
6436
- import { jsx as jsx30, jsxs as jsxs25 } from "preact/jsx-runtime";
6437
- var p26 = BRAND.cssPrefix;
6527
+ import { jsx as jsx31, jsxs as jsxs26 } from "preact/jsx-runtime";
6528
+ var p28 = BRAND.cssPrefix;
6438
6529
  var log15 = logger.scope("news");
6439
6530
  function NewsRoot({ transport, strings, config, nav, bus, panelProps }) {
6440
6531
  const tags = config.contentTags;
@@ -6462,37 +6553,37 @@ function NewsRoot({ transport, strings, config, nav, bus, panelProps }) {
6462
6553
  };
6463
6554
  }, [transport, tags, reloadKey, bus]);
6464
6555
  function renderBody() {
6465
- if (state === "loading") return /* @__PURE__ */ jsx30(ModuleState, { message: strings.newsLoading, strings });
6556
+ if (state === "loading") return /* @__PURE__ */ jsx31(ModuleState, { message: strings.newsLoading, strings });
6466
6557
  if (state === "error") {
6467
- return /* @__PURE__ */ jsx30(ModuleState, { tone: "error", message: errorMsg, onRetry: () => setReloadKey((k) => k + 1), strings });
6558
+ return /* @__PURE__ */ jsx31(ModuleState, { tone: "error", message: errorMsg, onRetry: () => setReloadKey((k) => k + 1), strings });
6468
6559
  }
6469
- if (items.length === 0) return /* @__PURE__ */ jsx30(ModuleState, { message: strings.newsEmpty, strings });
6470
- return /* @__PURE__ */ jsx30("div", { class: `${p26}-news-list`, children: items.map((item) => /* @__PURE__ */ jsxs25(
6560
+ if (items.length === 0) return /* @__PURE__ */ jsx31(ModuleState, { message: strings.newsEmpty, strings });
6561
+ return /* @__PURE__ */ jsx31("div", { class: `${p28}-news-list`, children: items.map((item) => /* @__PURE__ */ jsxs26(
6471
6562
  "button",
6472
6563
  {
6473
6564
  type: "button",
6474
- class: `${p26}-news-card`,
6565
+ class: `${p28}-news-card`,
6475
6566
  onClick: () => nav.push({ kind: "content", id: item.id, title: item.title }),
6476
6567
  "data-testid": tid(TID.newsItem, item.id),
6477
6568
  children: [
6478
- item.image ? /* @__PURE__ */ jsx30("img", { class: `${p26}-news-hero`, src: item.image, alt: "", loading: "lazy" }) : null,
6479
- /* @__PURE__ */ jsxs25("span", { class: `${p26}-news-body`, children: [
6480
- /* @__PURE__ */ jsx30("span", { class: `${p26}-news-title`, children: item.title }),
6481
- item.description ? /* @__PURE__ */ jsx30("span", { class: `${p26}-news-summary`, children: item.description }) : null
6569
+ item.image ? /* @__PURE__ */ jsx31("img", { class: `${p28}-news-hero`, src: item.image, alt: "", loading: "lazy" }) : null,
6570
+ /* @__PURE__ */ jsxs26("span", { class: `${p28}-news-body`, children: [
6571
+ /* @__PURE__ */ jsx31("span", { class: `${p28}-news-title`, children: item.title }),
6572
+ item.description ? /* @__PURE__ */ jsx31("span", { class: `${p28}-news-summary`, children: item.description }) : null
6482
6573
  ] })
6483
6574
  ]
6484
6575
  },
6485
6576
  item.id
6486
6577
  )) });
6487
6578
  }
6488
- return /* @__PURE__ */ jsxs25("div", { class: `${p26}-module`, children: [
6489
- /* @__PURE__ */ jsx30(TitleBar, { title: strings.newsTitle, actions: /* @__PURE__ */ jsx30(HeaderActions, { panelProps, variant: "plain" }) }),
6490
- /* @__PURE__ */ jsx30("div", { class: `${p26}-module-scroll`, children: renderBody() })
6579
+ return /* @__PURE__ */ jsxs26("div", { class: `${p28}-module`, children: [
6580
+ /* @__PURE__ */ jsx31(TitleBar, { title: strings.newsTitle, actions: /* @__PURE__ */ jsx31(HeaderActions, { panelProps, variant: "plain" }) }),
6581
+ /* @__PURE__ */ jsx31("div", { class: `${p28}-module-scroll`, children: renderBody() })
6491
6582
  ] });
6492
6583
  }
6493
6584
  var newsLayout = {
6494
6585
  Icon: NewsIcon,
6495
- Root: (props2) => /* @__PURE__ */ jsx30(NewsRoot, { ...props2 })
6586
+ Root: (props2) => /* @__PURE__ */ jsx31(NewsRoot, { ...props2 })
6496
6587
  };
6497
6588
 
6498
6589
  // src/ui/modules/registry.ts
@@ -6504,28 +6595,28 @@ var LAYOUTS = {
6504
6595
  };
6505
6596
 
6506
6597
  // src/ui/home-tab-bar.tsx
6507
- import { jsx as jsx31, jsxs as jsxs26 } from "preact/jsx-runtime";
6508
- var p27 = BRAND.cssPrefix;
6598
+ import { jsx as jsx32, jsxs as jsxs27 } from "preact/jsx-runtime";
6599
+ var p29 = BRAND.cssPrefix;
6509
6600
  function HomeTabBar({ modules, activeTab, strings, unreadCount, onSelect }) {
6510
- return /* @__PURE__ */ jsx31("nav", { class: `${p27}-tabbar`, role: "tablist", "aria-label": strings.panelTitle, children: modules.map((m) => {
6601
+ return /* @__PURE__ */ jsx32("nav", { class: `${p29}-tabbar`, role: "tablist", "aria-label": strings.panelTitle, children: modules.map((m) => {
6511
6602
  const Icon = LAYOUTS[m.layout].Icon;
6512
6603
  const selected = m.id === activeTab;
6513
6604
  const badge = m.layout === "chat" && unreadCount > 0 ? unreadCount > 9 ? "9+" : String(unreadCount) : null;
6514
- return /* @__PURE__ */ jsxs26(
6605
+ return /* @__PURE__ */ jsxs27(
6515
6606
  "button",
6516
6607
  {
6517
6608
  type: "button",
6518
6609
  role: "tab",
6519
6610
  "aria-selected": selected,
6520
- class: `${p27}-tab`,
6611
+ class: `${p29}-tab`,
6521
6612
  onClick: () => onSelect(m.id),
6522
6613
  "data-testid": tid(TID.tab, m.id),
6523
6614
  children: [
6524
- /* @__PURE__ */ jsxs26("span", { class: `${p27}-tab-icon`, "aria-hidden": "true", children: [
6525
- /* @__PURE__ */ jsx31(Icon, {}),
6526
- badge ? /* @__PURE__ */ jsx31("span", { class: `${p27}-tab-badge`, "data-testid": TID.tabBadge, children: badge }) : null
6615
+ /* @__PURE__ */ jsxs27("span", { class: `${p29}-tab-icon`, "aria-hidden": "true", children: [
6616
+ /* @__PURE__ */ jsx32(Icon, {}),
6617
+ badge ? /* @__PURE__ */ jsx32("span", { class: `${p29}-tab-badge`, "data-testid": TID.tabBadge, children: badge }) : null
6527
6618
  ] }),
6528
- /* @__PURE__ */ jsx31("span", { class: `${p27}-tab-label`, children: localizeText(strings, m.label) })
6619
+ /* @__PURE__ */ jsx32("span", { class: `${p29}-tab-label`, children: localizeText(strings, m.label) })
6529
6620
  ]
6530
6621
  },
6531
6622
  m.id
@@ -6534,12 +6625,12 @@ function HomeTabBar({ modules, activeTab, strings, unreadCount, onSelect }) {
6534
6625
  }
6535
6626
 
6536
6627
  // src/ui/iframe-view.tsx
6537
- import { jsx as jsx32, jsxs as jsxs27 } from "preact/jsx-runtime";
6538
- var p28 = BRAND.cssPrefix;
6628
+ import { jsx as jsx33, jsxs as jsxs28 } from "preact/jsx-runtime";
6629
+ var p30 = BRAND.cssPrefix;
6539
6630
  var SANDBOX = "allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";
6540
6631
  function IframeView({ url, title, strings, onBack, actions }) {
6541
- return /* @__PURE__ */ jsxs27("div", { class: `${p28}-module`, children: [
6542
- /* @__PURE__ */ jsx32(
6632
+ return /* @__PURE__ */ jsxs28("div", { class: `${p30}-module`, children: [
6633
+ /* @__PURE__ */ jsx33(
6543
6634
  BackHeader,
6544
6635
  {
6545
6636
  title: title || strings.moduleBack,
@@ -6548,10 +6639,10 @@ function IframeView({ url, title, strings, onBack, actions }) {
6548
6639
  actions
6549
6640
  }
6550
6641
  ),
6551
- /* @__PURE__ */ jsx32(
6642
+ /* @__PURE__ */ jsx33(
6552
6643
  "iframe",
6553
6644
  {
6554
- class: `${p28}-content-frame`,
6645
+ class: `${p30}-content-frame`,
6555
6646
  src: url,
6556
6647
  title: title || "content",
6557
6648
  sandbox: SANDBOX,
@@ -6565,8 +6656,8 @@ function IframeView({ url, title, strings, onBack, actions }) {
6565
6656
 
6566
6657
  // src/ui/content-view.tsx
6567
6658
  import { useCallback as useCallback3, useEffect as useEffect13, useState as useState11 } from "preact/hooks";
6568
- import { jsx as jsx33, jsxs as jsxs28 } from "preact/jsx-runtime";
6569
- var p29 = BRAND.cssPrefix;
6659
+ import { jsx as jsx34, jsxs as jsxs29 } from "preact/jsx-runtime";
6660
+ var p31 = BRAND.cssPrefix;
6570
6661
  var log16 = logger.scope("content");
6571
6662
  var READ_DWELL_MS = 5e3;
6572
6663
  function ContentView({ id, title, transport, strings, bus, onBack, actions }) {
@@ -6610,16 +6701,16 @@ function ContentView({ id, title, transport, strings, bus, onBack, actions }) {
6610
6701
  [bus, id]
6611
6702
  );
6612
6703
  function renderBody() {
6613
- if (failed) return /* @__PURE__ */ jsx33(ModuleState, { tone: "error", message: strings.errorGeneric, onRetry: retry, strings });
6614
- if (item === null) return /* @__PURE__ */ jsx33(ModuleState, { message: strings.contentLoading, strings });
6615
- return /* @__PURE__ */ jsxs28("article", { class: `${p29}-content`, "data-testid": TID.contentView, onClick: onArticleClick, children: [
6616
- item.image ? /* @__PURE__ */ jsx33("img", { class: `${p29}-content-hero`, src: item.image, alt: "", loading: "lazy" }) : null,
6617
- item.description ? /* @__PURE__ */ jsx33("p", { class: `${p29}-content-subtitle`, children: item.description }) : null,
6618
- /* @__PURE__ */ jsx33(StaticMarkdown, { text: item.content ?? "" })
6704
+ if (failed) return /* @__PURE__ */ jsx34(ModuleState, { tone: "error", message: strings.errorGeneric, onRetry: retry, strings });
6705
+ if (item === null) return /* @__PURE__ */ jsx34(ModuleState, { message: strings.contentLoading, strings });
6706
+ return /* @__PURE__ */ jsxs29("article", { class: `${p31}-content`, "data-testid": TID.contentView, onClick: onArticleClick, children: [
6707
+ item.image ? /* @__PURE__ */ jsx34("img", { class: `${p31}-content-hero`, src: item.image, alt: "", loading: "lazy" }) : null,
6708
+ item.description ? /* @__PURE__ */ jsx34("p", { class: `${p31}-content-subtitle`, children: item.description }) : null,
6709
+ /* @__PURE__ */ jsx34(StaticMarkdown, { text: item.content ?? "" })
6619
6710
  ] });
6620
6711
  }
6621
- return /* @__PURE__ */ jsxs28("div", { class: `${p29}-module`, children: [
6622
- /* @__PURE__ */ jsx33(
6712
+ return /* @__PURE__ */ jsxs29("div", { class: `${p31}-module`, children: [
6713
+ /* @__PURE__ */ jsx34(
6623
6714
  BackHeader,
6624
6715
  {
6625
6716
  title: item?.title || title || strings.moduleBack,
@@ -6629,13 +6720,13 @@ function ContentView({ id, title, transport, strings, bus, onBack, actions }) {
6629
6720
  testid: TID.backHeader
6630
6721
  }
6631
6722
  ),
6632
- /* @__PURE__ */ jsx33("div", { class: `${p29}-module-scroll`, "data-testid": TID.contentScroll, children: renderBody() })
6723
+ /* @__PURE__ */ jsx34("div", { class: `${p31}-module-scroll`, "data-testid": TID.contentScroll, children: renderBody() })
6633
6724
  ] });
6634
6725
  }
6635
6726
 
6636
6727
  // src/ui/messenger-home.tsx
6637
- import { jsx as jsx34, jsxs as jsxs29 } from "preact/jsx-runtime";
6638
- var p30 = BRAND.cssPrefix;
6728
+ import { jsx as jsx35, jsxs as jsxs30 } from "preact/jsx-runtime";
6729
+ var p32 = BRAND.cssPrefix;
6639
6730
  function MessengerHome({
6640
6731
  panelProps,
6641
6732
  enabledModules,
@@ -6669,7 +6760,7 @@ function MessengerHome({
6669
6760
  }, []);
6670
6761
  const { visible: dragOver } = useFileDrop({ containerRef, onDrop: onDropItems });
6671
6762
  useDragMove(containerRef.current, options.mode === "modal");
6672
- const navState = useComputed6(() => nav.sig.value).value;
6763
+ const navState = useComputed7(() => nav.sig.value).value;
6673
6764
  const top = topScreen(navState);
6674
6765
  const activeModule = options.modules.byId[navState.activeTab];
6675
6766
  const isReader = top?.kind === "iframe" || top?.kind === "content";
@@ -6706,12 +6797,12 @@ function MessengerHome({
6706
6797
  bus,
6707
6798
  panelProps
6708
6799
  });
6709
- const plainActions = /* @__PURE__ */ jsx34(HeaderActions, { panelProps, variant: "plain" });
6800
+ const plainActions = /* @__PURE__ */ jsx35(HeaderActions, { panelProps, variant: "plain" });
6710
6801
  if (activeModule) visitedRef.current.add(activeModule.id);
6711
6802
  const visitedTabs = enabledModules.filter((m) => visitedRef.current.has(m.id));
6712
6803
  const tabRoot = (module) => {
6713
6804
  if (module.layout === "chat") {
6714
- return /* @__PURE__ */ jsx34(
6805
+ return /* @__PURE__ */ jsx35(
6715
6806
  PanelContent,
6716
6807
  {
6717
6808
  ...panelProps,
@@ -6722,14 +6813,14 @@ function MessengerHome({
6722
6813
  );
6723
6814
  }
6724
6815
  const Root = LAYOUTS[module.layout].Root;
6725
- return Root ? /* @__PURE__ */ jsx34(Root, { ...screenProps(module) }) : null;
6816
+ return Root ? /* @__PURE__ */ jsx35(Root, { ...screenProps(module) }) : null;
6726
6817
  };
6727
6818
  const renderReader = () => {
6728
6819
  if (top?.kind === "iframe") {
6729
- return /* @__PURE__ */ jsx34(IframeView, { url: top.url, title: top.title, strings, onBack: nav.pop, actions: plainActions });
6820
+ return /* @__PURE__ */ jsx35(IframeView, { url: top.url, title: top.title, strings, onBack: nav.pop, actions: plainActions });
6730
6821
  }
6731
6822
  if (top?.kind === "content") {
6732
- return /* @__PURE__ */ jsx34(
6823
+ return /* @__PURE__ */ jsx35(
6733
6824
  ContentView,
6734
6825
  {
6735
6826
  id: top.id,
@@ -6744,22 +6835,22 @@ function MessengerHome({
6744
6835
  }
6745
6836
  return null;
6746
6837
  };
6747
- return /* @__PURE__ */ jsxs29(
6838
+ return /* @__PURE__ */ jsxs30(
6748
6839
  "div",
6749
6840
  {
6750
6841
  ref: containerRef,
6751
- class: `${p30}-panel ${p30}-messenger`,
6842
+ class: `${p32}-panel ${p32}-messenger`,
6752
6843
  role: "dialog",
6753
6844
  "aria-modal": "false",
6754
6845
  "aria-label": strings.panelTitle,
6755
6846
  style: { position: "relative" },
6756
6847
  "data-testid": TID.messengerHome,
6757
6848
  children: [
6758
- /* @__PURE__ */ jsxs29("div", { class: `${p30}-messenger-body`, children: [
6759
- visitedTabs.map((m) => /* @__PURE__ */ jsx34("div", { class: `${p30}-messenger-pane`, hidden: isReader || m.id !== activeModule?.id, children: tabRoot(m) }, m.id)),
6849
+ /* @__PURE__ */ jsxs30("div", { class: `${p32}-messenger-body`, children: [
6850
+ visitedTabs.map((m) => /* @__PURE__ */ jsx35("div", { class: `${p32}-messenger-pane`, hidden: isReader || m.id !== activeModule?.id, children: tabRoot(m) }, m.id)),
6760
6851
  renderReader()
6761
6852
  ] }),
6762
- showTabBar ? /* @__PURE__ */ jsx34(
6853
+ showTabBar ? /* @__PURE__ */ jsx35(
6763
6854
  HomeTabBar,
6764
6855
  {
6765
6856
  modules: enabledModules,
@@ -6769,8 +6860,8 @@ function MessengerHome({
6769
6860
  onSelect: nav.switchTab
6770
6861
  }
6771
6862
  ) : null,
6772
- /* @__PURE__ */ jsx34(PoweredByBar, { poweredBy: options.poweredBy }),
6773
- options.size.resize?.enabled && !(activeModule?.layout === "chat" && !top) ? /* @__PURE__ */ jsx34(
6863
+ /* @__PURE__ */ jsx35(PoweredByBar, { poweredBy: options.poweredBy }),
6864
+ options.size.resize?.enabled && !(activeModule?.layout === "chat" && !top) ? /* @__PURE__ */ jsx35(
6774
6865
  ResizeGrip,
6775
6866
  {
6776
6867
  panelEl: containerRef.current,
@@ -6787,29 +6878,29 @@ function MessengerHome({
6787
6878
  }
6788
6879
 
6789
6880
  // src/ui/modules-empty.tsx
6790
- import { jsx as jsx35, jsxs as jsxs30 } from "preact/jsx-runtime";
6791
- var p31 = BRAND.cssPrefix;
6881
+ import { jsx as jsx36, jsxs as jsxs31 } from "preact/jsx-runtime";
6882
+ var p33 = BRAND.cssPrefix;
6792
6883
  function ModulesEmpty({ strings, onClose }) {
6793
- return /* @__PURE__ */ jsxs30(
6884
+ return /* @__PURE__ */ jsxs31(
6794
6885
  "div",
6795
6886
  {
6796
- class: `${p31}-panel ${p31}-modules-empty`,
6887
+ class: `${p33}-panel ${p33}-modules-empty`,
6797
6888
  role: "dialog",
6798
6889
  "aria-label": strings.panelTitle,
6799
6890
  "data-testid": TID.modulesEmpty,
6800
6891
  children: [
6801
- onClose ? /* @__PURE__ */ jsx35(
6892
+ onClose ? /* @__PURE__ */ jsx36(
6802
6893
  "button",
6803
6894
  {
6804
6895
  type: "button",
6805
- class: `${p31}-icon-btn ${p31}-modules-empty-close`,
6896
+ class: `${p33}-icon-btn ${p33}-modules-empty-close`,
6806
6897
  onClick: onClose,
6807
6898
  "aria-label": strings.close,
6808
6899
  title: strings.close,
6809
- children: /* @__PURE__ */ jsx35(CloseIcon, {})
6900
+ children: /* @__PURE__ */ jsx36(CloseIcon, {})
6810
6901
  }
6811
6902
  ) : null,
6812
- /* @__PURE__ */ jsx35("p", { class: `${p31}-modules-empty-text`, children: strings.modulesEmpty })
6903
+ /* @__PURE__ */ jsx36("p", { class: `${p33}-modules-empty-text`, children: strings.modulesEmpty })
6813
6904
  ]
6814
6905
  }
6815
6906
  );
@@ -6832,12 +6923,19 @@ function useLauncherCallout({ callout, persistence }) {
6832
6923
  }
6833
6924
 
6834
6925
  // src/ui/app.tsx
6835
- import { jsx as jsx36, jsxs as jsxs31 } from "preact/jsx-runtime";
6926
+ import { jsx as jsx37, jsxs as jsxs32 } from "preact/jsx-runtime";
6836
6927
  var log17 = logger.scope("app");
6837
- var p32 = BRAND.cssPrefix;
6928
+ var p34 = BRAND.cssPrefix;
6838
6929
  function makeLocalizedWelcome(w, strings) {
6839
6930
  return makeInstantWelcomeMessage({ ...w, text: localizeText(strings, w.text) });
6840
6931
  }
6932
+ function allToolPartsSettled(msg) {
6933
+ const tools = msg.partsSig.value.filter((p35) => p35.kind === "tool");
6934
+ return tools.length > 0 && tools.every((p35) => {
6935
+ const s = p35.stateSig.value;
6936
+ return s === "output-available" || s === "output-error" || s === "output-denied" || s === "approval-responded";
6937
+ });
6938
+ }
6841
6939
  function App({ options, hostElement, bus }) {
6842
6940
  const [persistence] = useState13(
6843
6941
  () => createPersistence(options.widgetId, options.storage, options.aiAgentDeploymentId)
@@ -7304,19 +7402,20 @@ function App({ options, hostElement, bus }) {
7304
7402
  return () => document.removeEventListener("keydown", onKey);
7305
7403
  }, [isOpen, options.mode]);
7306
7404
  const streamAssistant = useCallback6(
7307
- async (assistantMsg, trigger) => {
7405
+ async (assistantMsg, { continueExisting }) => {
7308
7406
  const activeConversationId = conversationIdSig.value ?? uuid7();
7309
7407
  if (!conversationIdSig.value) {
7310
7408
  conversationIdSig.value = activeConversationId;
7311
7409
  persistence.saveConversationId(activeConversationId);
7312
7410
  }
7411
+ const thread = continueExisting ? messagesSig.value : messagesSig.value.slice(0, -1);
7313
7412
  const body = buildSendMessageRequest({
7314
- messages: messagesSig.value.slice(0, -1).map(fromReactive),
7413
+ messages: thread.map(fromReactive),
7315
7414
  conversationId: activeConversationId,
7415
+ // The assistant message being generated / resumed.
7416
+ messageId: assistantMsg.id,
7316
7417
  // textModel + imageModel are backend-only — selected per deployment.
7317
7418
  tools: options.features.tools,
7318
- responseMode: options.responseMode,
7319
- trigger,
7320
7419
  // Identity + preferences ride on every message — server may need
7321
7420
  // them to route, persist, or reconcile in-flight.
7322
7421
  visitorId,
@@ -7350,23 +7449,23 @@ function App({ options, hostElement, bus }) {
7350
7449
  },
7351
7450
  [transport, reducer, messagesSig, conversationIdSig, options, bus, feedback, persistence, visitorId]
7352
7451
  );
7353
- const resolveTool = useCallback6(
7354
- (toolCallId, trigger, mutate) => {
7452
+ const decideTool = useCallback6(
7453
+ (toolCallId, mutate) => {
7355
7454
  if (streaming) return;
7356
7455
  const last = messagesSig.value.at(-1);
7357
7456
  const part = last?.partsSig.value.find(
7358
7457
  (pt) => pt.kind === "tool" && pt.toolCallId === toolCallId
7359
7458
  );
7360
- if (!part) {
7361
- log17.warn("resolveTool: tool part not found", { toolCallId });
7459
+ if (!last || !part) {
7460
+ log17.warn("decideTool: tool part not found", { toolCallId });
7362
7461
  return;
7363
7462
  }
7364
7463
  mutate(part);
7365
- if (last) last.partsSig.value = [...last.partsSig.value];
7366
- const assistantMsg = makeAssistantMessage();
7367
- messagesSig.value = [...messagesSig.value, assistantMsg];
7368
- reducer.attach(assistantMsg);
7369
- void streamAssistant(assistantMsg, trigger);
7464
+ last.partsSig.value = [...last.partsSig.value];
7465
+ if (!allToolPartsSettled(last)) return;
7466
+ last.status = "streaming";
7467
+ reducer.attach(last);
7468
+ void streamAssistant(last, { continueExisting: true });
7370
7469
  },
7371
7470
  [streaming, messagesSig, reducer, streamAssistant]
7372
7471
  );
@@ -7374,24 +7473,24 @@ function App({ options, hostElement, bus }) {
7374
7473
  (toolCallId, output) => {
7375
7474
  log17.info("toolResult", { toolCallId });
7376
7475
  bus.emit("toolResult", { toolCallId });
7377
- resolveTool(toolCallId, TRIGGER.toolResult, (part) => {
7476
+ decideTool(toolCallId, (part) => {
7378
7477
  part.outputSig.value = output;
7379
- part.stateSig.value = "output";
7478
+ part.stateSig.value = "output-available";
7380
7479
  });
7381
7480
  },
7382
- [bus, resolveTool]
7481
+ [bus, decideTool]
7383
7482
  );
7384
7483
  const handleToolDecision = useCallback6(
7385
7484
  (toolCallId, approved, reason) => {
7386
7485
  log17.info("toolDecision", { toolCallId, approved });
7387
7486
  bus.emit("toolDecision", { toolCallId, approved });
7388
- resolveTool(toolCallId, TRIGGER.toolApproval, (part) => {
7487
+ decideTool(toolCallId, (part) => {
7389
7488
  const id = part.approvalSig.value?.id ?? toolCallId;
7390
7489
  part.approvalSig.value = { id, approved, reason };
7391
- part.stateSig.value = "output";
7490
+ part.stateSig.value = "approval-responded";
7392
7491
  });
7393
7492
  },
7394
- [bus, resolveTool]
7493
+ [bus, decideTool]
7395
7494
  );
7396
7495
  const toolInteraction = useMemo3(
7397
7496
  () => ({ humanInLoop: options.features.humanInLoop, onResult: handleToolResult, onDecision: handleToolDecision }),
@@ -7429,12 +7528,12 @@ function App({ options, hostElement, bus }) {
7429
7528
  void transport.submitForm({ formId: form.id, conversationId: activeConversationId, trigger, values, skipped });
7430
7529
  }
7431
7530
  });
7432
- const activeForm = useComputed7(() => forms.activeForm.value);
7531
+ const activeForm = useComputed8(() => forms.activeForm.value);
7433
7532
  useEffect16(() => {
7434
7533
  forms.refresh();
7435
7534
  }, [effectiveForms, forms]);
7436
7535
  const pageArea = options.pageContext?.area ? String(options.pageContext.area) : void 0;
7437
- const msgCount = useComputed7(() => messagesSig.value.length);
7536
+ const msgCount = useComputed8(() => messagesSig.value.length);
7438
7537
  useEffect16(() => {
7439
7538
  if (conversationReady && formsReady) forms.fire("pre-chat");
7440
7539
  }, [conversationReady, formsReady, forms]);
@@ -7471,7 +7570,7 @@ function App({ options, hostElement, bus }) {
7471
7570
  messagesSig.value = [...messagesSig.value, userMsg, assistantMsg];
7472
7571
  reducer.attach(assistantMsg);
7473
7572
  emitMessage(bus, options, "user", text);
7474
- await streamAssistant(assistantMsg, TRIGGER.submitMessage);
7573
+ await streamAssistant(assistantMsg, { continueExisting: false });
7475
7574
  forms.fire("after-messages");
7476
7575
  },
7477
7576
  [streaming, transport, bus, options, suggestions.length, messagesSig, reducer, streamAssistant, forms]
@@ -7749,12 +7848,12 @@ function App({ options, hostElement, bus }) {
7749
7848
  const renderSurface = (size) => {
7750
7849
  const closeable = isActionVisible("close", effectiveOptions.mode, size);
7751
7850
  if (enabledModules.length === 0) {
7752
- return /* @__PURE__ */ jsx36(ModulesEmpty, { strings: effectiveOptions.strings, onClose: closeable ? handleClose : void 0 });
7851
+ return /* @__PURE__ */ jsx37(ModulesEmpty, { strings: effectiveOptions.strings, onClose: closeable ? handleClose : void 0 });
7753
7852
  }
7754
7853
  if (enabledModules.length === 1 && enabledModules[0]?.layout === "chat") {
7755
- return /* @__PURE__ */ jsx36(Panel, { ...panelProps, panelSize: size });
7854
+ return /* @__PURE__ */ jsx37(Panel, { ...panelProps, panelSize: size });
7756
7855
  }
7757
- return /* @__PURE__ */ jsx36(
7856
+ return /* @__PURE__ */ jsx37(
7758
7857
  MessengerHome,
7759
7858
  {
7760
7859
  panelProps: { ...panelProps, panelSize: size, onClose: closeable ? handleClose : void 0 },
@@ -7773,7 +7872,7 @@ function App({ options, hostElement, bus }) {
7773
7872
  void handleSelectHistoryConversation(chat.conversationId);
7774
7873
  };
7775
7874
  const conversationsEnabled = enabledModules.some((m) => m.layout === "chat");
7776
- return /* @__PURE__ */ jsx36("div", { class: `${p32}-anchor`, children: /* @__PURE__ */ jsx36(
7875
+ return /* @__PURE__ */ jsx37("div", { class: `${p34}-anchor`, children: /* @__PURE__ */ jsx37(
7777
7876
  PageShell,
7778
7877
  {
7779
7878
  site: parsedSite,
@@ -7794,15 +7893,15 @@ function App({ options, hostElement, bus }) {
7794
7893
  }
7795
7894
  if (isInlineLike) {
7796
7895
  const inlineSize = options.mode === "standalone" ? "fullscreen" : panelSize;
7797
- return /* @__PURE__ */ jsx36("div", { class: `${p32}-anchor`, children: renderSurface(inlineSize) });
7896
+ return /* @__PURE__ */ jsx37("div", { class: `${p34}-anchor`, children: renderSurface(inlineSize) });
7798
7897
  }
7799
7898
  const drawerEdgeTab = options.mode === "drawer";
7800
7899
  const triggerOwnedByPage = options.mode === "modal";
7801
7900
  const launcherVisible = !triggerOwnedByPage && !options.launcher.hidden && (!isOpen || launcherLeaving);
7802
7901
  const calloutToRender = launcherVisible && !launcherLeaving && !calloutDismissed && !drawerEdgeTab ? effectiveOptions.launcher.callout : null;
7803
- return /* @__PURE__ */ jsxs31("div", { class: `${p32}-anchor`, "data-launcher-size": effectiveOptions.launcher.size, children: [
7804
- isOpen || activated ? /* @__PURE__ */ jsx36("div", { class: `${p32}-surface`, hidden: !isOpen, children: renderSurface(panelSize) }) : null,
7805
- launcherVisible ? /* @__PURE__ */ jsx36(
7902
+ return /* @__PURE__ */ jsxs32("div", { class: `${p34}-anchor`, "data-launcher-size": effectiveOptions.launcher.size, children: [
7903
+ isOpen || activated ? /* @__PURE__ */ jsx37("div", { class: `${p34}-surface`, hidden: !isOpen, children: renderSurface(panelSize) }) : null,
7904
+ launcherVisible ? /* @__PURE__ */ jsx37(
7806
7905
  Launcher,
7807
7906
  {
7808
7907
  onToggle: handleOpen,
@@ -7812,7 +7911,7 @@ function App({ options, hostElement, bus }) {
7812
7911
  edgeTab: drawerEdgeTab
7813
7912
  }
7814
7913
  ) : null,
7815
- calloutToRender ? /* @__PURE__ */ jsx36(
7914
+ calloutToRender ? /* @__PURE__ */ jsx37(
7816
7915
  LauncherCallout,
7817
7916
  {
7818
7917
  callout: calloutToRender,
@@ -7877,34 +7976,34 @@ var TRACKED = {
7877
7976
  expand: (on) => ({ on }),
7878
7977
  fullscreen: (on) => ({ on }),
7879
7978
  // Conversation funnel. `send` is the key conversion; text never rides.
7880
- send: (p33) => ({ attachments: p33.attachmentCount }),
7881
- message: (p33) => ({ role: p33.role }),
7979
+ send: (p35) => ({ attachments: p35.attachmentCount }),
7980
+ message: (p35) => ({ role: p35.role }),
7882
7981
  stop: () => void 0,
7883
7982
  clear: () => void 0,
7884
7983
  suggestion: () => void 0,
7885
- toggleHistory: (p33) => ({ view: p33.view }),
7984
+ toggleHistory: (p35) => ({ view: p35.view }),
7886
7985
  handshake: () => void 0,
7887
7986
  // Forms + human-in-the-loop — ids and outcomes, never values.
7888
- formSubmit: (p33) => ({ formId: p33.formId, skipped: p33.skipped }),
7987
+ formSubmit: (p35) => ({ formId: p35.formId, skipped: p35.skipped }),
7889
7988
  toolResult: () => void 0,
7890
- toolDecision: (p33) => ({ approved: p33.approved }),
7989
+ toolDecision: (p35) => ({ approved: p35.approved }),
7891
7990
  // Content — ids, tags + counts only; titles/bodies never ride.
7892
- contentView: (p33) => ({ section: p33.section, tags: p33.tags, count: p33.count }),
7893
- contentOpen: (p33) => ({ contentId: p33.contentId, tags: p33.tags }),
7894
- contentSearch: (p33) => ({ qlen: p33.queryLength, hits: p33.hitCount }),
7895
- contentRead: (p33) => ({ contentId: p33.contentId }),
7896
- contentLinkClick: (p33) => ({ contentId: p33.contentId }),
7991
+ contentView: (p35) => ({ section: p35.section, tags: p35.tags, count: p35.count }),
7992
+ contentOpen: (p35) => ({ contentId: p35.contentId, tags: p35.tags }),
7993
+ contentSearch: (p35) => ({ qlen: p35.queryLength, hits: p35.hitCount }),
7994
+ contentRead: (p35) => ({ contentId: p35.contentId }),
7995
+ contentLinkClick: (p35) => ({ contentId: p35.contentId }),
7897
7996
  // Composer / attachments / voice.
7898
- attach: (p33) => ({ count: p33.count, bytes: p33.totalBytes }),
7997
+ attach: (p35) => ({ count: p35.count, bytes: p35.totalBytes }),
7899
7998
  voiceStart: () => void 0,
7900
- voiceStop: (p33) => ({ ms: p33.durationMs }),
7999
+ voiceStop: (p35) => ({ ms: p35.durationMs }),
7901
8000
  voiceCancel: () => void 0,
7902
8001
  // Preferences — how visitors tune the surface.
7903
8002
  localeChange: (locale) => ({ locale }),
7904
8003
  themeChange: (theme) => ({ theme }),
7905
8004
  textSizeChange: (size) => ({ size }),
7906
- soundToggle: (p33) => ({ muted: p33.muted }),
7907
- sidebarToggle: (p33) => ({ collapsed: p33.collapsed }),
8005
+ soundToggle: (p35) => ({ muted: p35.muted }),
8006
+ sidebarToggle: (p35) => ({ collapsed: p35.collapsed }),
7908
8007
  calloutDismiss: () => void 0,
7909
8008
  // Health signal only — the error object itself never leaves the page.
7910
8009
  error: () => void 0