@helpai/elements 0.9.2 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/web-component.mjs CHANGED
@@ -6,7 +6,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
6
6
  import { h as h2, render as render2 } from "preact";
7
7
 
8
8
  // src/ui/app.tsx
9
- import { useCallback as useCallback8, useEffect as useEffect17, useMemo as useMemo3, useRef as useRef8, useState as useState11 } from "preact/hooks";
9
+ import { useCallback as useCallback6, useEffect as useEffect17, useMemo as useMemo3, useRef as useRef8, useState as useState11 } from "preact/hooks";
10
10
  import { useSignal } from "@preact/signals";
11
11
 
12
12
  // src/core/brand.ts
@@ -130,14 +130,6 @@ function isNestedShape(override) {
130
130
  }
131
131
  return false;
132
132
  }
133
- function localeDisplayName(target, displayInLocale) {
134
- try {
135
- const dn = new Intl.DisplayNames([displayInLocale], { type: "language" });
136
- return dn.of(target) ?? target.toUpperCase();
137
- } catch {
138
- return target.toUpperCase();
139
- }
140
- }
141
133
 
142
134
  // src/core/storage.ts
143
135
  var LocalStorageAdapter = class {
@@ -805,7 +797,7 @@ var tokens_default = ':host{--__P__-accent: __BRAND_ACCENT__;--__P__-accent-text
805
797
  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';
806
798
 
807
799
  // src/styles/panel.css
808
- var panel_default = '.__P__-anchor{right:16px;bottom:16px}: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:14px}.__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:14px;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:#ffffff26}.__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)}: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;align-items:stretch;padding:0}: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}: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:12px 14px;border-bottom:1px solid var(--__P__-border);background:var(--__P__-bg)}.__P__-header h1{font-size:14px;font-weight:600;flex:1;letter-spacing:-.01em}.__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:14px;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{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-4);display:flex;flex-direction:column;gap:14px;scroll-behavior:smooth;scrollbar-width:thin;scrollbar-color:var(--__P__-border-strong) transparent;scrollbar-gutter:stable}.__P__-list::-webkit-scrollbar{width:8px}.__P__-list::-webkit-scrollbar-thumb{background:var(--__P__-border-strong);border-radius:8px}.__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:85%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);line-height:1.6;font-size:14px;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)}@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-bottom-right-radius:var(--__P__-radius-sm)}.__P__-bubble-row[data-role=assistant] .__P__-bubble{background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border-bottom-left-radius:var(--__P__-radius-sm)}.__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-left:1.5em;margin:10px 0}.__P__-md ul{list-style:disc}.__P__-md ol{list-style:decimal}.__P__-md li{margin:6px 0;padding-left: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:12.5px;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-left:3px solid color-mix(in srgb,var(--__P__-accent) 50%,transparent);background:color-mix(in srgb,var(--__P__-accent) 5%,transparent);border-radius:0 var(--__P__-radius-sm) var(--__P__-radius-sm) 0;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:left}.__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:6px;height:6px;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-left:var(--__P__-space-3);border-left: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::-webkit-details-marker{display:none}.__P__-reasoning-summary:before{content:"";width:5px;height:5px;border-right: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:14px;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:16px}.__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:14px;text-align:center}.__P__-history-group{display:flex;flex-direction:column;padding:0 var(--__P__-space-2)}.__P__-history-heading{font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);padding:12px 8px 6px;text-transform:uppercase;letter-spacing:.04em}.__P__-history-item{all:unset;display:flex;flex-direction:column;gap:3px;padding:10px 12px;border-radius:var(--__P__-radius-md);cursor:pointer;transition:background var(--__P__-dur-base) var(--__P__-ease)}.__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-title{font-size:14px;font-weight:500;color:var(--__P__-fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-preview{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-item[data-closed=true] .__P__-history-title:after{content:"\\2022";margin-left:var(--__P__-space-2);opacity:.5}.__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:11px;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:11px;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%;right: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__-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{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.__P__-module{display:flex;flex-direction:column;height:100%;min-height:0}.__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{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__-help-card .__P__-list-row:hover{background:var(--__P__-hover)}.__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:10px;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:14px;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-close{color:#fff}.__P__-home-greeting{margin:28px 0 0;font-family:var(--__P__-font-display);font-size:var(--__P__-text-2xl);font-weight:800;line-height:1.18;letter-spacing:-.01em;overflow-wrap:anywhere}.__P__-home-lead{margin:2px 0 0;font-family:var(--__P__-font-display);font-size:var(--__P__-text-2xl);font-weight:800;line-height:1.18;letter-spacing:-.01em;color:color-mix(in srgb,var(--__P__-on-accent) 88%,transparent);overflow-wrap:anywhere}.__P__-home-avatars{display:flex}.__P__-home-avatar{width:30px;height:30px;border-radius:999px;overflow:hidden;margin-left:-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-left: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:left;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:14px}.__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:14px}.__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:left}.__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:14px}.__P__-home-search-input{flex:1;border:0;background:transparent;font-size:14px;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:left;padding:var(--__P__-space-3) var(--__P__-space-2);border-radius:var(--__P__-radius-sm)}.__P__-list-row:hover{background:var(--__P__-bg-elevated)}.__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:left;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-tags{display:flex;gap:6px;flex-wrap:wrap}.__P__-news-tag{font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-accent);background:color-mix(in srgb,var(--__P__-accent) 12%,transparent);padding:2px 8px;border-radius:999px}.__P__-news-title{font-weight:700;font-size:var(--__P__-text-md)}.__P__-news-summary{color:var(--__P__-fg-muted);font-size:14px;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;right:12px}.__P__-modules-empty-text{color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}\n';
800
+ var panel_default = '.__P__-anchor{right:16px;bottom:16px}: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:14px}.__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:14px;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:#ffffff26}.__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)}: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;align-items:stretch;padding:0}: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}: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:12px 14px;border-bottom:1px solid var(--__P__-border);background:var(--__P__-bg)}.__P__-header h1{font-size:14px;font-weight:600;flex:1;letter-spacing:-.01em}.__P__-header-actions{margin-left: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:14px;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{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;scrollbar-width:thin;scrollbar-color:var(--__P__-border-strong) transparent;scrollbar-gutter:stable}.__P__-list::-webkit-scrollbar{width:8px}.__P__-list::-webkit-scrollbar-thumb{background:var(--__P__-border-strong);border-radius:8px}.__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:85%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);line-height:1.6;font-size:14px;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)}@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-bottom-right-radius:var(--__P__-radius-sm)}.__P__-bubble-row[data-role=assistant] .__P__-bubble{background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border-bottom-left-radius:var(--__P__-radius-sm)}.__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-left:1.5em;margin:10px 0}.__P__-md ul{list-style:disc}.__P__-md ol{list-style:decimal}.__P__-md li{margin:6px 0;padding-left: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:12.5px;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-left:3px solid color-mix(in srgb,var(--__P__-accent) 50%,transparent);background:color-mix(in srgb,var(--__P__-accent) 5%,transparent);border-radius:0 var(--__P__-radius-sm) var(--__P__-radius-sm) 0;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:left}.__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:6px;height:6px;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-left:var(--__P__-space-3);border-left: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::-webkit-details-marker{display:none}.__P__-reasoning-summary:before{content:"";width:5px;height:5px;border-right: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:14px;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:16px}.__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:14px;text-align:center}.__P__-history-group{display:flex;flex-direction:column;padding:0 var(--__P__-space-2)}.__P__-history-heading{font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);padding:12px 8px 6px;text-transform:uppercase;letter-spacing:.04em}.__P__-history-item{all:unset;display:flex;flex-direction:column;gap:3px;padding:10px 12px;border-radius:var(--__P__-radius-md);cursor:pointer;transition:background var(--__P__-dur-base) var(--__P__-ease)}.__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-title{font-size:14px;font-weight:500;color:var(--__P__-fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-preview{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-item[data-closed=true] .__P__-history-title:after{content:"\\2022";margin-left:var(--__P__-space-2);opacity:.5}.__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:11px;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:11px;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%;right: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__-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{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.__P__-module{display:flex;flex-direction:column;height:100%;min-height:0}.__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{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__-help-card .__P__-list-row:hover{background:var(--__P__-hover)}.__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:10px;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:14px;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-greeting{margin:28px 0 0;font-family:var(--__P__-font-display);font-size:var(--__P__-text-2xl);font-weight:800;line-height:1.18;letter-spacing:-.01em;overflow-wrap:anywhere}.__P__-home-lead{margin:2px 0 0;font-family:var(--__P__-font-display);font-size:var(--__P__-text-2xl);font-weight:800;line-height:1.18;letter-spacing:-.01em;color:color-mix(in srgb,var(--__P__-on-accent) 88%,transparent);overflow-wrap:anywhere}.__P__-home-avatars{display:flex}.__P__-home-avatar{width:30px;height:30px;border-radius:999px;overflow:hidden;margin-left:-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-left: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:left;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:14px}.__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:14px}.__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:left}.__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:14px}.__P__-home-search-input{flex:1;border:0;background:transparent;font-size:14px;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:left;padding:var(--__P__-space-3) var(--__P__-space-2);border-radius:var(--__P__-radius-sm)}.__P__-list-row:hover{background:var(--__P__-bg-elevated)}.__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:left;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-tags{display:flex;gap:6px;flex-wrap:wrap}.__P__-news-tag{font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-accent);background:color-mix(in srgb,var(--__P__-accent) 12%,transparent);padding:2px 8px;border-radius:999px}.__P__-news-title{font-weight:700;font-size:var(--__P__-text-md)}.__P__-news-summary{color:var(--__P__-fg-muted);font-size:14px;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;right:12px}.__P__-modules-empty-text{color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}\n';
809
801
 
810
802
  // src/styles/standalone.css
811
803
  var standalone_default = ".__P__-standalone-page{margin:0;height:100vh;background:var(--__P__-bg, #fff);display:grid;place-items:stretch}\n";
@@ -893,22 +885,22 @@ function attachAdoptedSheet(shadow, doc) {
893
885
  }
894
886
  }
895
887
  function applyThemeOverrides(host, overrides) {
896
- const p28 = BRAND.cssPrefix;
897
- if (overrides.accent) host.style.setProperty(`--${p28}-accent`, overrides.accent);
898
- if (overrides.accentText) host.style.setProperty(`--${p28}-accent-text`, overrides.accentText);
899
- if (overrides.radius) host.style.setProperty(`--${p28}-radius`, overrides.radius);
900
- if (overrides.fontFamily) host.style.setProperty(`--${p28}-font`, overrides.fontFamily);
888
+ const p29 = BRAND.cssPrefix;
889
+ if (overrides.accent) host.style.setProperty(`--${p29}-accent`, overrides.accent);
890
+ if (overrides.accentText) host.style.setProperty(`--${p29}-accent-text`, overrides.accentText);
891
+ if (overrides.radius) host.style.setProperty(`--${p29}-radius`, overrides.radius);
892
+ if (overrides.fontFamily) host.style.setProperty(`--${p29}-font`, overrides.fontFamily);
901
893
  }
902
894
  function applyThemeMode(host, mode) {
903
895
  host.dataset.theme = mode;
904
896
  }
905
897
  function applySize(host, size) {
906
- const p28 = BRAND.cssPrefix;
907
- if (size.width !== void 0) host.style.setProperty(`--${p28}-panel-w`, size.width);
908
- if (size.height !== void 0) host.style.setProperty(`--${p28}-panel-h`, size.height);
909
- if (size.expanded?.width !== void 0) host.style.setProperty(`--${p28}-expanded-w`, size.expanded.width);
910
- if (size.expanded?.height !== void 0) host.style.setProperty(`--${p28}-expanded-h`, size.expanded.height);
911
- if (size.inset !== void 0) host.style.setProperty(`--${p28}-panel-inset`, size.inset);
898
+ const p29 = BRAND.cssPrefix;
899
+ if (size.width !== void 0) host.style.setProperty(`--${p29}-panel-w`, size.width);
900
+ if (size.height !== void 0) host.style.setProperty(`--${p29}-panel-h`, size.height);
901
+ if (size.expanded?.width !== void 0) host.style.setProperty(`--${p29}-expanded-w`, size.expanded.width);
902
+ if (size.expanded?.height !== void 0) host.style.setProperty(`--${p29}-expanded-h`, size.expanded.height);
903
+ if (size.inset !== void 0) host.style.setProperty(`--${p29}-panel-inset`, size.inset);
912
904
  }
913
905
  function applyPosition(host, pos) {
914
906
  host.dataset.position = pos;
@@ -1079,11 +1071,11 @@ function toBase64Url(json) {
1079
1071
  var nonEmpty = (ctx) => ctx && Object.keys(ctx).length > 0 ? ctx : void 0;
1080
1072
  function encodeContext(user, page) {
1081
1073
  const u = nonEmpty(user);
1082
- const p28 = nonEmpty(page);
1083
- if (!u && !p28) return void 0;
1074
+ const p29 = nonEmpty(page);
1075
+ if (!u && !p29) return void 0;
1084
1076
  const envelope = {};
1085
1077
  if (u) envelope.user = u;
1086
- if (p28) envelope.page = p28;
1078
+ if (p29) envelope.page = p29;
1087
1079
  return toBase64Url(JSON.stringify(envelope));
1088
1080
  }
1089
1081
 
@@ -1151,12 +1143,12 @@ function normalizeToolRef(ref) {
1151
1143
  }
1152
1144
  function messageToWireParts(m) {
1153
1145
  const out = [];
1154
- for (const p28 of m.parts) {
1155
- if (p28.kind === "text" && p28.text) {
1156
- out.push({ text: p28.text, type: "text" });
1146
+ for (const p29 of m.parts) {
1147
+ if (p29.kind === "text" && p29.text) {
1148
+ out.push({ text: p29.text, type: "text" });
1157
1149
  }
1158
- if (p28.kind === "file" && p28.url) {
1159
- out.push({ mediaType: p28.mediaType, type: "file", url: p28.url });
1150
+ if (p29.kind === "file" && p29.url) {
1151
+ out.push({ mediaType: p29.mediaType, type: "file", url: p29.url });
1160
1152
  }
1161
1153
  }
1162
1154
  for (const a of m.attachments ?? []) {
@@ -1717,7 +1709,7 @@ function fromWireMessage(w) {
1717
1709
  return { kind: "file", url: part.url, mediaType: part.mediaType };
1718
1710
  }
1719
1711
  return null;
1720
- }).filter((p28) => p28 !== null);
1712
+ }).filter((p29) => p29 !== null);
1721
1713
  return {
1722
1714
  id: w.id,
1723
1715
  role: w.role,
@@ -1745,41 +1737,41 @@ function assistantText(m) {
1745
1737
  }
1746
1738
  return out;
1747
1739
  }
1748
- function partToReactive(p28) {
1749
- if (p28.kind === "text" || p28.kind === "reasoning") {
1750
- return { kind: p28.kind, id: p28.id, textSig: signal(p28.text), doneSig: signal(p28.done) };
1740
+ function partToReactive(p29) {
1741
+ if (p29.kind === "text" || p29.kind === "reasoning") {
1742
+ return { kind: p29.kind, id: p29.id, textSig: signal(p29.text), doneSig: signal(p29.done) };
1751
1743
  }
1752
- if (p28.kind === "tool") {
1744
+ if (p29.kind === "tool") {
1753
1745
  return {
1754
1746
  kind: "tool",
1755
- toolCallId: p28.toolCallId,
1756
- toolName: p28.toolName,
1757
- inputPartialSig: signal(p28.inputPartial),
1758
- inputSig: signal(p28.input),
1759
- outputSig: signal(p28.output),
1760
- errorSig: signal(p28.error),
1761
- stateSig: signal(p28.state)
1747
+ toolCallId: p29.toolCallId,
1748
+ toolName: p29.toolName,
1749
+ inputPartialSig: signal(p29.inputPartial),
1750
+ inputSig: signal(p29.input),
1751
+ outputSig: signal(p29.output),
1752
+ errorSig: signal(p29.error),
1753
+ stateSig: signal(p29.state)
1762
1754
  };
1763
1755
  }
1764
- return p28;
1756
+ return p29;
1765
1757
  }
1766
- function partFromReactive(p28) {
1767
- if (p28.kind === "text" || p28.kind === "reasoning") {
1768
- return { kind: p28.kind, id: p28.id, text: p28.textSig.value, done: p28.doneSig.value };
1758
+ function partFromReactive(p29) {
1759
+ if (p29.kind === "text" || p29.kind === "reasoning") {
1760
+ return { kind: p29.kind, id: p29.id, text: p29.textSig.value, done: p29.doneSig.value };
1769
1761
  }
1770
- if (p28.kind === "tool") {
1762
+ if (p29.kind === "tool") {
1771
1763
  return {
1772
1764
  kind: "tool",
1773
- toolCallId: p28.toolCallId,
1774
- toolName: p28.toolName,
1775
- inputPartial: p28.inputPartialSig.value,
1776
- input: p28.inputSig.value,
1777
- output: p28.outputSig.value,
1778
- error: p28.errorSig.value,
1779
- state: p28.stateSig.value
1765
+ toolCallId: p29.toolCallId,
1766
+ toolName: p29.toolName,
1767
+ inputPartial: p29.inputPartialSig.value,
1768
+ input: p29.inputSig.value,
1769
+ output: p29.outputSig.value,
1770
+ error: p29.errorSig.value,
1771
+ state: p29.stateSig.value
1780
1772
  };
1781
1773
  }
1782
- return p28;
1774
+ return p29;
1783
1775
  }
1784
1776
 
1785
1777
  // src/stream/reducer.ts
@@ -1821,8 +1813,8 @@ var StreamReducer = class {
1821
1813
  ensureTextPart(m, "text", chunk.id);
1822
1814
  return;
1823
1815
  case "text-delta": {
1824
- const p28 = ensureTextPart(m, "text", chunk.id);
1825
- p28.textSig.value += chunk.delta;
1816
+ const p29 = ensureTextPart(m, "text", chunk.id);
1817
+ p29.textSig.value += chunk.delta;
1826
1818
  return;
1827
1819
  }
1828
1820
  case "text-end":
@@ -1832,8 +1824,8 @@ var StreamReducer = class {
1832
1824
  ensureTextPart(m, "reasoning", chunk.id).doneSig.value = false;
1833
1825
  return;
1834
1826
  case "reasoning-delta": {
1835
- const p28 = ensureTextPart(m, "reasoning", chunk.id);
1836
- p28.textSig.value += chunk.delta;
1827
+ const p29 = ensureTextPart(m, "reasoning", chunk.id);
1828
+ p29.textSig.value += chunk.delta;
1837
1829
  return;
1838
1830
  }
1839
1831
  case "reasoning-end":
@@ -1851,7 +1843,7 @@ var StreamReducer = class {
1851
1843
  return;
1852
1844
  case "source-url": {
1853
1845
  const parts = m.partsSig.value;
1854
- if (parts.some((p28) => p28.kind === "source" && p28.sourceId === chunk.sourceId)) return;
1846
+ if (parts.some((p29) => p29.kind === "source" && p29.sourceId === chunk.sourceId)) return;
1855
1847
  appendPart(m, { kind: "source", sourceId: chunk.sourceId, url: chunk.url, title: chunk.title });
1856
1848
  return;
1857
1849
  }
@@ -1875,14 +1867,14 @@ var StreamReducer = class {
1875
1867
  }
1876
1868
  };
1877
1869
  function ensureTextPart(m, kind, id) {
1878
- const existing = m.partsSig.value.find((p28) => p28.kind === kind && p28.id === id);
1870
+ const existing = m.partsSig.value.find((p29) => p29.kind === kind && p29.id === id);
1879
1871
  if (existing) return existing;
1880
1872
  const part = { kind, id, textSig: signal2(""), doneSig: signal2(false) };
1881
1873
  appendPart(m, part);
1882
1874
  return part;
1883
1875
  }
1884
1876
  function ensureToolPart(m, toolCallId, toolName) {
1885
- const existing = m.partsSig.value.find((p28) => p28.kind === "tool" && p28.toolCallId === toolCallId);
1877
+ const existing = m.partsSig.value.find((p29) => p29.kind === "tool" && p29.toolCallId === toolCallId);
1886
1878
  if (existing) return existing;
1887
1879
  const part = {
1888
1880
  kind: "tool",
@@ -1906,26 +1898,26 @@ function applyTool(m, chunk) {
1906
1898
  ensureToolPart(m, chunk.toolCallId, chunk.toolName);
1907
1899
  return;
1908
1900
  case "tool-input-delta": {
1909
- const p28 = ensureToolPart(m, chunk.toolCallId);
1910
- p28.inputPartialSig.value += chunk.delta;
1901
+ const p29 = ensureToolPart(m, chunk.toolCallId);
1902
+ p29.inputPartialSig.value += chunk.delta;
1911
1903
  return;
1912
1904
  }
1913
1905
  case "tool-input-available": {
1914
- const p28 = ensureToolPart(m, chunk.toolCallId, chunk.toolName);
1915
- p28.inputSig.value = chunk.input;
1916
- p28.stateSig.value = "awaiting";
1906
+ const p29 = ensureToolPart(m, chunk.toolCallId, chunk.toolName);
1907
+ p29.inputSig.value = chunk.input;
1908
+ p29.stateSig.value = "awaiting";
1917
1909
  return;
1918
1910
  }
1919
1911
  case "tool-output-available": {
1920
- const p28 = ensureToolPart(m, chunk.toolCallId);
1921
- p28.outputSig.value = chunk.output;
1922
- p28.stateSig.value = "output";
1912
+ const p29 = ensureToolPart(m, chunk.toolCallId);
1913
+ p29.outputSig.value = chunk.output;
1914
+ p29.stateSig.value = "output";
1923
1915
  return;
1924
1916
  }
1925
1917
  case "tool-output-error": {
1926
- const p28 = ensureToolPart(m, chunk.toolCallId);
1927
- p28.errorSig.value = chunk.errorText;
1928
- p28.stateSig.value = "error";
1918
+ const p29 = ensureToolPart(m, chunk.toolCallId);
1919
+ p29.errorSig.value = chunk.errorText;
1920
+ p29.stateSig.value = "error";
1929
1921
  return;
1930
1922
  }
1931
1923
  default:
@@ -2361,11 +2353,6 @@ var HistoryIcon = () => /* @__PURE__ */ jsxs("svg", { ...props, "aria-hidden": "
2361
2353
  /* @__PURE__ */ jsx("path", { d: "M3.05 13A9 9 0 1 0 6 5.3L3 9" }),
2362
2354
  /* @__PURE__ */ jsx("path", { d: "M12 7v5l3 2" })
2363
2355
  ] });
2364
- var GlobeIcon = () => /* @__PURE__ */ jsxs("svg", { ...props, "aria-hidden": "true", children: [
2365
- /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
2366
- /* @__PURE__ */ jsx("path", { d: "M2 12h20" }),
2367
- /* @__PURE__ */ jsx("path", { d: "M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" })
2368
- ] });
2369
2356
  var BackIcon = () => /* @__PURE__ */ jsx("svg", { ...props, "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M19 12H5M12 19l-7-7 7-7" }) });
2370
2357
  var PopOutIcon = () => /* @__PURE__ */ jsx("svg", { ...props, "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M15 3h6v6M10 14 21 3M21 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5" }) });
2371
2358
  var TrashIcon = () => /* @__PURE__ */ jsx("svg", { ...props, "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6" }) });
@@ -2704,30 +2691,30 @@ function resolveCalloutPosition(configured, launcherPosition) {
2704
2691
  }
2705
2692
 
2706
2693
  // src/ui/panel.tsx
2707
- import { useCallback as useCallback4, useEffect as useEffect10, useRef as useRef6 } from "preact/hooks";
2694
+ import { useCallback as useCallback2, useEffect as useEffect10, useRef as useRef6 } from "preact/hooks";
2708
2695
 
2709
2696
  // src/ui/resize-grip.tsx
2710
2697
  import { useEffect as useEffect2, useRef } from "preact/hooks";
2711
2698
  import { jsx as jsx3 } from "preact/jsx-runtime";
2712
2699
  function ResizeGrip({ panelEl, resize, position, initialSize, onSizeChange, strings }) {
2713
- const p28 = BRAND.cssPrefix;
2700
+ const p29 = BRAND.cssPrefix;
2714
2701
  const dragRef = useRef(null);
2715
2702
  useEffect2(() => {
2716
2703
  if (!panelEl) return;
2717
2704
  const style = panelEl.style;
2718
- if (resize.minWidth) style.setProperty(`--${p28}-resize-min-w`, resize.minWidth);
2719
- if (resize.maxWidth) style.setProperty(`--${p28}-resize-max-w`, resize.maxWidth);
2720
- if (resize.minHeight) style.setProperty(`--${p28}-resize-min-h`, resize.minHeight);
2721
- if (resize.maxHeight) style.setProperty(`--${p28}-resize-max-h`, resize.maxHeight);
2705
+ if (resize.minWidth) style.setProperty(`--${p29}-resize-min-w`, resize.minWidth);
2706
+ if (resize.maxWidth) style.setProperty(`--${p29}-resize-max-w`, resize.maxWidth);
2707
+ if (resize.minHeight) style.setProperty(`--${p29}-resize-min-h`, resize.minHeight);
2708
+ if (resize.maxHeight) style.setProperty(`--${p29}-resize-max-h`, resize.maxHeight);
2722
2709
  if (initialSize) {
2723
- style.setProperty(`--${p28}-widget-w`, `${initialSize.width}px`);
2724
- style.setProperty(`--${p28}-widget-h`, `${initialSize.height}px`);
2710
+ style.setProperty(`--${p29}-widget-w`, `${initialSize.width}px`);
2711
+ style.setProperty(`--${p29}-widget-h`, `${initialSize.height}px`);
2725
2712
  }
2726
- }, [panelEl, resize.minWidth, resize.maxWidth, resize.minHeight, resize.maxHeight, p28, initialSize]);
2713
+ }, [panelEl, resize.minWidth, resize.maxWidth, resize.minHeight, resize.maxHeight, p29, initialSize]);
2727
2714
  if (!panelEl) return null;
2728
2715
  const isTop = position.startsWith("top-");
2729
2716
  const isRight = position.endsWith("-right");
2730
- const cornerClass = `${p28}-resize-grip ${p28}-resize-grip--${isTop ? "bottom" : "top"}-${isRight ? "left" : "right"}`;
2717
+ const cornerClass = `${p29}-resize-grip ${p29}-resize-grip--${isTop ? "bottom" : "top"}-${isRight ? "left" : "right"}`;
2731
2718
  const onPointerDown = (e) => {
2732
2719
  if (!panelEl) return;
2733
2720
  const target = e.currentTarget;
@@ -2751,8 +2738,8 @@ function ResizeGrip({ panelEl, resize, position, initialSize, onSizeChange, stri
2751
2738
  if (!d || e.pointerId !== d.pointerId || !panelEl) return;
2752
2739
  const dx = (e.clientX - d.startX) * d.dirX;
2753
2740
  const dy = (e.clientY - d.startY) * d.dirY;
2754
- panelEl.style.setProperty(`--${p28}-widget-w`, `${d.startW + dx}px`);
2755
- panelEl.style.setProperty(`--${p28}-widget-h`, `${d.startH + dy}px`);
2741
+ panelEl.style.setProperty(`--${p29}-widget-w`, `${d.startW + dx}px`);
2742
+ panelEl.style.setProperty(`--${p29}-widget-h`, `${d.startH + dy}px`);
2756
2743
  };
2757
2744
  const onPointerUp = (e) => {
2758
2745
  const d = dragRef.current;
@@ -2835,9 +2822,6 @@ function useDragMove(panelEl, enabled) {
2835
2822
  }, [panelEl, enabled]);
2836
2823
  }
2837
2824
 
2838
- // src/ui/panel.tsx
2839
- import { useComputed as useComputed3 } from "@preact/signals";
2840
-
2841
2825
  // src/ui/action-visibility.ts
2842
2826
  function isActionVisible(name, mode, panelSize, ctx) {
2843
2827
  switch (name) {
@@ -2859,9 +2843,6 @@ function isActionVisible(name, mode, panelSize, ctx) {
2859
2843
  return true;
2860
2844
  }
2861
2845
  }
2862
- function visibleActions(actions, mode, panelSize, ctx) {
2863
- return actions.filter((name) => isActionVisible(name, mode, panelSize, ctx));
2864
- }
2865
2846
  function canShowClose(mode, panelSize, actions) {
2866
2847
  if (!isActionVisible("close", mode, panelSize)) return false;
2867
2848
  return actions.main.includes("close") || actions.overflow.includes("close");
@@ -3412,21 +3393,269 @@ function useFileDrop({ containerRef, onDrop }) {
3412
3393
  return { visible };
3413
3394
  }
3414
3395
 
3396
+ // src/ui/header-actions.tsx
3397
+ import { useComputed } from "@preact/signals";
3398
+
3399
+ // src/ui/use-popover-menu.ts
3400
+ import { useCallback, useEffect as useEffect6, useRef as useRef3, useState as useState4 } from "preact/hooks";
3401
+ function usePopoverMenu({ itemCount, initialFocusIndex }) {
3402
+ const [open, setOpen] = useState4(false);
3403
+ const triggerRef = useRef3(null);
3404
+ const menuRef = useRef3(null);
3405
+ const [focusIndex, setFocusIndex] = useState4(-1);
3406
+ const close = useCallback(() => {
3407
+ setOpen(false);
3408
+ setFocusIndex(-1);
3409
+ triggerRef.current?.focus();
3410
+ }, []);
3411
+ const toggle = useCallback(() => setOpen((v) => !v), []);
3412
+ useEffect6(() => {
3413
+ if (!open) return;
3414
+ const onDocClick = (e) => {
3415
+ const menu = menuRef.current;
3416
+ const trigger = triggerRef.current;
3417
+ if (!menu || !trigger) return;
3418
+ const path = e.composedPath();
3419
+ if (path.includes(menu) || path.includes(trigger)) return;
3420
+ setOpen(false);
3421
+ setFocusIndex(-1);
3422
+ };
3423
+ document.addEventListener("click", onDocClick, true);
3424
+ return () => document.removeEventListener("click", onDocClick, true);
3425
+ }, [open]);
3426
+ useEffect6(() => {
3427
+ if (!open) return;
3428
+ if (itemCount === 0) return;
3429
+ const desired = initialFocusIndex?.() ?? 0;
3430
+ const clamped = desired < 0 || desired >= itemCount ? 0 : desired;
3431
+ setFocusIndex(clamped);
3432
+ }, [open, itemCount, initialFocusIndex]);
3433
+ useEffect6(() => {
3434
+ if (!open || focusIndex < 0) return;
3435
+ const items = menuRef.current?.querySelectorAll("[role='menuitem']");
3436
+ items?.[focusIndex]?.focus();
3437
+ }, [open, focusIndex]);
3438
+ const onTriggerKey = useCallback((e) => {
3439
+ if (e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") {
3440
+ e.preventDefault();
3441
+ setOpen(true);
3442
+ }
3443
+ }, []);
3444
+ const onMenuKey = useCallback(
3445
+ (e) => {
3446
+ if (itemCount === 0) return;
3447
+ switch (e.key) {
3448
+ case "Escape":
3449
+ e.preventDefault();
3450
+ close();
3451
+ return;
3452
+ case "ArrowDown":
3453
+ e.preventDefault();
3454
+ setFocusIndex((i) => (i + 1) % itemCount);
3455
+ return;
3456
+ case "ArrowUp":
3457
+ e.preventDefault();
3458
+ setFocusIndex((i) => (i - 1 + itemCount) % itemCount);
3459
+ return;
3460
+ case "Home":
3461
+ e.preventDefault();
3462
+ setFocusIndex(0);
3463
+ return;
3464
+ case "End":
3465
+ e.preventDefault();
3466
+ setFocusIndex(itemCount - 1);
3467
+ }
3468
+ },
3469
+ [itemCount, close]
3470
+ );
3471
+ return { open, focusIndex, triggerRef, menuRef, toggle, close, onTriggerKey, onMenuKey };
3472
+ }
3473
+
3474
+ // src/ui/overflow-menu.tsx
3475
+ import { jsx as jsx8, jsxs as jsxs6 } from "preact/jsx-runtime";
3476
+ function OverflowMenu({ items, triggerLabel }) {
3477
+ const p29 = BRAND.cssPrefix;
3478
+ const menu = usePopoverMenu({ itemCount: items.length });
3479
+ const handleSelect = (item) => {
3480
+ if (item.disabled) return;
3481
+ item.onSelect();
3482
+ if (!item.keepOpen) menu.close();
3483
+ };
3484
+ return /* @__PURE__ */ jsxs6("div", { class: `${p29}-menu-wrap`, children: [
3485
+ /* @__PURE__ */ jsx8(
3486
+ "button",
3487
+ {
3488
+ ref: menu.triggerRef,
3489
+ type: "button",
3490
+ class: `${p29}-icon-btn`,
3491
+ "aria-label": triggerLabel,
3492
+ "aria-haspopup": "menu",
3493
+ "aria-expanded": menu.open,
3494
+ title: triggerLabel,
3495
+ onClick: menu.toggle,
3496
+ onKeyDown: menu.onTriggerKey,
3497
+ children: /* @__PURE__ */ jsx8(MoreIcon, {})
3498
+ }
3499
+ ),
3500
+ menu.open ? /* @__PURE__ */ jsx8(
3501
+ "div",
3502
+ {
3503
+ ref: menu.menuRef,
3504
+ class: `${p29}-menu`,
3505
+ role: "menu",
3506
+ "aria-label": triggerLabel,
3507
+ onKeyDown: menu.onMenuKey,
3508
+ tabIndex: -1,
3509
+ children: items.map((item) => /* @__PURE__ */ jsxs6(
3510
+ "button",
3511
+ {
3512
+ type: "button",
3513
+ role: "menuitem",
3514
+ class: `${p29}-menu-item`,
3515
+ "aria-pressed": item.type === "switch" ? item.on : void 0,
3516
+ disabled: item.disabled,
3517
+ lang: item.lang,
3518
+ onClick: () => handleSelect(item),
3519
+ children: [
3520
+ item.icon ? /* @__PURE__ */ jsx8("span", { class: `${p29}-menu-icon`, children: item.icon }) : null,
3521
+ /* @__PURE__ */ jsx8("span", { class: `${p29}-menu-label`, children: item.label }),
3522
+ item.type === "switch" && item.on ? /* @__PURE__ */ jsx8("span", { class: `${p29}-menu-check`, "aria-hidden": "true", children: /* @__PURE__ */ jsx8(CheckIcon, {}) }) : null
3523
+ ]
3524
+ },
3525
+ item.id
3526
+ ))
3527
+ }
3528
+ ) : null
3529
+ ] });
3530
+ }
3531
+
3532
+ // src/ui/header-actions.tsx
3533
+ import { jsx as jsx9, jsxs as jsxs7 } from "preact/jsx-runtime";
3534
+ var p9 = BRAND.cssPrefix;
3535
+ var NEXT_THEME = { auto: "dark", dark: "light", light: "auto" };
3536
+ function themeIcon(mode) {
3537
+ if (mode === "light") return /* @__PURE__ */ jsx9(SunIcon, {});
3538
+ if (mode === "dark") return /* @__PURE__ */ jsx9(MoonIcon, {});
3539
+ return /* @__PURE__ */ jsx9(ThemeAutoIcon, {});
3540
+ }
3541
+ function HeaderActions({ panelProps, variant }) {
3542
+ const { options, panelSize, feedback, onClose, onClear, onExpand, onFullscreen, onPopOut, onSoundToggle } = panelProps;
3543
+ const { onToggleHistory, onLocaleChange, onThemeChange } = panelProps;
3544
+ const s = options.strings;
3545
+ const mode = options.mode;
3546
+ const isChat = variant === "chat";
3547
+ const muted = useComputed(() => feedback.mutedSig.value).value;
3548
+ const enabled = /* @__PURE__ */ new Set([...options.actions.main, ...options.actions.overflow]);
3549
+ const has = (name) => enabled.has(name);
3550
+ const visible = (name) => isActionVisible(name, mode, panelSize, { popOutUrl: options.popOutUrl });
3551
+ const themeMode = options.themeMode;
3552
+ const themeLabel = { auto: s.themeAuto, light: s.themeLight, dark: s.themeDark };
3553
+ const items = [];
3554
+ if (has("theme")) {
3555
+ items.push({
3556
+ id: "theme",
3557
+ icon: themeIcon(themeMode),
3558
+ label: `${s.theme}: ${themeLabel[themeMode]}`,
3559
+ onSelect: () => onThemeChange(NEXT_THEME[themeMode]),
3560
+ keepOpen: true
3561
+ });
3562
+ }
3563
+ if (has("language") && options.availableLocales.length > 1) {
3564
+ for (const locale of options.availableLocales) {
3565
+ items.push({
3566
+ id: `language:${locale}`,
3567
+ label: `${s.language} \u2014 ${locale}`,
3568
+ lang: locale,
3569
+ type: "switch",
3570
+ on: locale === options.locale,
3571
+ onSelect: () => onLocaleChange(locale)
3572
+ });
3573
+ }
3574
+ }
3575
+ if (has("expand") && visible("expand")) {
3576
+ const on = panelSize === "expanded";
3577
+ items.push({
3578
+ id: "expand",
3579
+ icon: on ? /* @__PURE__ */ jsx9(CollapseIcon, {}) : /* @__PURE__ */ jsx9(ExpandIcon, {}),
3580
+ label: on ? s.collapse : s.expand,
3581
+ type: "switch",
3582
+ on,
3583
+ onSelect: onExpand
3584
+ });
3585
+ }
3586
+ if (has("fullscreen") && visible("fullscreen")) {
3587
+ const on = panelSize === "fullscreen";
3588
+ items.push({
3589
+ id: "fullscreen",
3590
+ icon: on ? /* @__PURE__ */ jsx9(FullscreenExitIcon, {}) : /* @__PURE__ */ jsx9(FullscreenIcon, {}),
3591
+ label: on ? s.exitFullscreen : s.fullscreen,
3592
+ type: "switch",
3593
+ on,
3594
+ onSelect: onFullscreen
3595
+ });
3596
+ }
3597
+ if (has("popOut") && visible("popOut")) {
3598
+ items.push({ id: "popOut", icon: /* @__PURE__ */ jsx9(PopOutIcon, {}), label: s.popOut, onSelect: onPopOut });
3599
+ }
3600
+ if (isChat && has("sound")) {
3601
+ items.push({
3602
+ id: "sound",
3603
+ icon: muted ? /* @__PURE__ */ jsx9(SpeakerMutedIcon, {}) : /* @__PURE__ */ jsx9(SpeakerIcon, {}),
3604
+ label: muted ? s.soundOff : s.soundOn,
3605
+ type: "switch",
3606
+ on: !muted,
3607
+ onSelect: onSoundToggle
3608
+ });
3609
+ }
3610
+ if (isChat && has("clear")) {
3611
+ items.push({ id: "clear", icon: /* @__PURE__ */ jsx9(TrashIcon, {}), label: s.newConversation, onSelect: onClear });
3612
+ }
3613
+ const showClose = !!onClose && canShowClose(mode, panelSize, options.actions);
3614
+ const showHistory = isChat && has("history");
3615
+ return /* @__PURE__ */ jsxs7("div", { class: `${p9}-header-actions`, children: [
3616
+ showHistory ? /* @__PURE__ */ jsx9(
3617
+ "button",
3618
+ {
3619
+ type: "button",
3620
+ class: `${p9}-icon-btn`,
3621
+ onClick: onToggleHistory,
3622
+ "aria-label": s.history,
3623
+ title: s.history,
3624
+ "data-testid": TID.actionHistory,
3625
+ children: /* @__PURE__ */ jsx9(HistoryIcon, {})
3626
+ }
3627
+ ) : null,
3628
+ showClose ? /* @__PURE__ */ jsx9(
3629
+ "button",
3630
+ {
3631
+ type: "button",
3632
+ class: `${p9}-icon-btn`,
3633
+ onClick: onClose,
3634
+ "aria-label": s.close,
3635
+ title: s.close,
3636
+ "data-testid": TID.actionClose,
3637
+ children: /* @__PURE__ */ jsx9(CloseIcon, {})
3638
+ }
3639
+ ) : null,
3640
+ items.length > 0 ? /* @__PURE__ */ jsx9(OverflowMenu, { items, triggerLabel: s.moreActions }) : null
3641
+ ] });
3642
+ }
3643
+
3415
3644
  // src/ui/message-list.tsx
3416
- import { useEffect as useEffect7, useLayoutEffect, useRef as useRef4 } from "preact/hooks";
3417
- import { useComputed as useComputed2 } from "@preact/signals";
3645
+ import { useEffect as useEffect8, useLayoutEffect, useRef as useRef5 } from "preact/hooks";
3646
+ import { useComputed as useComputed3 } from "@preact/signals";
3418
3647
 
3419
3648
  // src/ui/message-bubble.tsx
3420
- import { useComputed } from "@preact/signals";
3649
+ import { useComputed as useComputed2 } from "@preact/signals";
3421
3650
 
3422
3651
  // src/ui/markdown.tsx
3423
- import { useEffect as useEffect6, useMemo, useRef as useRef3 } from "preact/hooks";
3652
+ import { useEffect as useEffect7, useMemo, useRef as useRef4 } from "preact/hooks";
3424
3653
  import { effect, signal as signal4 } from "@preact/signals";
3425
3654
  import * as smd from "streaming-markdown";
3426
- import { jsx as jsx8 } from "preact/jsx-runtime";
3655
+ import { jsx as jsx10 } from "preact/jsx-runtime";
3427
3656
  function MarkdownView({ textSig, doneSig }) {
3428
- const ref = useRef3(null);
3429
- useEffect6(() => {
3657
+ const ref = useRef4(null);
3658
+ useEffect7(() => {
3430
3659
  const el = ref.current;
3431
3660
  if (!el) return;
3432
3661
  el.classList.add(`${BRAND.cssPrefix}-md`);
@@ -3473,12 +3702,12 @@ function MarkdownView({ textSig, doneSig }) {
3473
3702
  el.removeEventListener("click", onClick);
3474
3703
  };
3475
3704
  }, [textSig, doneSig]);
3476
- return /* @__PURE__ */ jsx8("div", { ref });
3705
+ return /* @__PURE__ */ jsx10("div", { ref });
3477
3706
  }
3478
3707
  function StaticMarkdown({ text }) {
3479
3708
  const textSig = useMemo(() => signal4(text), [text]);
3480
3709
  const doneSig = useMemo(() => signal4(true), []);
3481
- return /* @__PURE__ */ jsx8(MarkdownView, { textSig, doneSig });
3710
+ return /* @__PURE__ */ jsx10(MarkdownView, { textSig, doneSig });
3482
3711
  }
3483
3712
  function hardenLink(a) {
3484
3713
  const href = a.getAttribute("href") ?? "";
@@ -3491,36 +3720,36 @@ function hardenLink(a) {
3491
3720
  }
3492
3721
 
3493
3722
  // src/ui/tool-chip.tsx
3494
- import { jsx as jsx9, jsxs as jsxs6 } from "preact/jsx-runtime";
3723
+ import { jsx as jsx11, jsxs as jsxs8 } from "preact/jsx-runtime";
3495
3724
  function ToolChip({ part, strings }) {
3496
- const p28 = BRAND.cssPrefix;
3497
- return /* @__PURE__ */ jsxs6("span", { class: `${p28}-tool-chip`, role: "status", children: [
3498
- /* @__PURE__ */ jsxs6("span", { children: [
3725
+ const p29 = BRAND.cssPrefix;
3726
+ return /* @__PURE__ */ jsxs8("span", { class: `${p29}-tool-chip`, role: "status", children: [
3727
+ /* @__PURE__ */ jsxs8("span", { children: [
3499
3728
  strings.usedTool,
3500
3729
  ":"
3501
3730
  ] }),
3502
- /* @__PURE__ */ jsx9("strong", { children: part.toolName })
3731
+ /* @__PURE__ */ jsx11("strong", { children: part.toolName })
3503
3732
  ] });
3504
3733
  }
3505
3734
 
3506
3735
  // src/ui/message-bubble.tsx
3507
- import { jsx as jsx10, jsxs as jsxs7 } from "preact/jsx-runtime";
3508
- var p9 = BRAND.cssPrefix;
3736
+ import { jsx as jsx12, jsxs as jsxs9 } from "preact/jsx-runtime";
3737
+ var p10 = BRAND.cssPrefix;
3509
3738
  function MessageBubble({ message, strings, responseMode, showReasoning, showToolCalls }) {
3510
- const parts = useComputed(() => message.partsSig.value);
3739
+ const parts = useComputed2(() => message.partsSig.value);
3511
3740
  const partList = parts.value;
3512
- const hasAnswerText = useComputed(
3741
+ const hasAnswerText = useComputed2(
3513
3742
  () => message.partsSig.value.some((part) => part.kind === "text" && part.textSig.value.length > 0)
3514
3743
  );
3515
- const reasoningVisible = useComputed(
3744
+ const reasoningVisible = useComputed2(
3516
3745
  () => showReasoning && message.partsSig.value.some((part) => part.kind === "reasoning")
3517
3746
  );
3518
3747
  const streaming = message.role === "assistant" && message.status === "streaming";
3519
3748
  const bufferedHold = responseMode === "buffered" && streaming;
3520
3749
  const working = streaming && !hasAnswerText.value;
3521
3750
  const showStreamDots = streaming && !bufferedHold && !(reasoningVisible.value && working);
3522
- return /* @__PURE__ */ jsx10("div", { class: `${p9}-bubble-row`, "data-role": message.role, "data-testid": tid(TID.messageBubble, message.id), children: /* @__PURE__ */ jsxs7("div", { class: `${p9}-bubble`, children: [
3523
- bufferedHold ? /* @__PURE__ */ jsx10(LoadingSpinner, { label: strings.loading }) : partList.map((part) => /* @__PURE__ */ jsx10(
3751
+ return /* @__PURE__ */ jsx12("div", { class: `${p10}-bubble-row`, "data-role": message.role, "data-testid": tid(TID.messageBubble, message.id), children: /* @__PURE__ */ jsxs9("div", { class: `${p10}-bubble`, children: [
3752
+ bufferedHold ? /* @__PURE__ */ jsx12(LoadingSpinner, { label: strings.loading }) : partList.map((part) => /* @__PURE__ */ jsx12(
3524
3753
  PartView,
3525
3754
  {
3526
3755
  part,
@@ -3531,8 +3760,8 @@ function MessageBubble({ message, strings, responseMode, showReasoning, showTool
3531
3760
  },
3532
3761
  partKey(part)
3533
3762
  )),
3534
- showStreamDots && /* @__PURE__ */ jsx10(TypingDots, {}),
3535
- message.status === "error" && message.errorText ? /* @__PURE__ */ jsx10("div", { class: `${p9}-error`, role: "alert", children: /* @__PURE__ */ jsx10("span", { children: message.errorText }) }) : null
3763
+ showStreamDots && /* @__PURE__ */ jsx12(TypingDots, {}),
3764
+ message.status === "error" && message.errorText ? /* @__PURE__ */ jsx12("div", { class: `${p10}-error`, role: "alert", children: /* @__PURE__ */ jsx12("span", { children: message.errorText }) }) : null
3536
3765
  ] }) });
3537
3766
  }
3538
3767
  function PartView({
@@ -3544,16 +3773,16 @@ function PartView({
3544
3773
  }) {
3545
3774
  switch (part.kind) {
3546
3775
  case "text":
3547
- return /* @__PURE__ */ jsx10(MarkdownView, { textSig: part.textSig, doneSig: part.doneSig });
3776
+ return /* @__PURE__ */ jsx12(MarkdownView, { textSig: part.textSig, doneSig: part.doneSig });
3548
3777
  case "reasoning":
3549
- return showReasoning ? /* @__PURE__ */ jsx10(ReasoningView, { part, active, strings }) : null;
3778
+ return showReasoning ? /* @__PURE__ */ jsx12(ReasoningView, { part, active, strings }) : null;
3550
3779
  case "tool":
3551
- return showToolCalls ? /* @__PURE__ */ jsx10(ToolChip, { part, strings }) : null;
3780
+ return showToolCalls ? /* @__PURE__ */ jsx12(ToolChip, { part, strings }) : null;
3552
3781
  case "file":
3553
3782
  if (part.mediaType.startsWith("image/")) {
3554
- return /* @__PURE__ */ jsx10("img", { src: part.url, alt: "", loading: "lazy" });
3783
+ return /* @__PURE__ */ jsx12("img", { src: part.url, alt: "", loading: "lazy" });
3555
3784
  }
3556
- return /* @__PURE__ */ jsx10("a", { href: part.url, target: "_blank", rel: "noreferrer noopener", children: part.url });
3785
+ return /* @__PURE__ */ jsx12("a", { href: part.url, target: "_blank", rel: "noreferrer noopener", children: part.url });
3557
3786
  case "source":
3558
3787
  return null;
3559
3788
  }
@@ -3563,9 +3792,9 @@ function ReasoningView({
3563
3792
  active,
3564
3793
  strings
3565
3794
  }) {
3566
- return /* @__PURE__ */ jsxs7("details", { class: `${p9}-reasoning`, open: active, "data-active": active ? "true" : void 0, children: [
3567
- /* @__PURE__ */ jsx10("summary", { class: `${p9}-reasoning-summary`, children: /* @__PURE__ */ jsx10("span", { class: `${p9}-reasoning-label`, children: active ? strings.thinking : strings.thoughts }) }),
3568
- /* @__PURE__ */ jsx10("div", { class: `${p9}-reasoning-body`, children: /* @__PURE__ */ jsx10(MarkdownView, { textSig: part.textSig, doneSig: part.doneSig }) })
3795
+ return /* @__PURE__ */ jsxs9("details", { class: `${p10}-reasoning`, open: active, "data-active": active ? "true" : void 0, children: [
3796
+ /* @__PURE__ */ jsx12("summary", { class: `${p10}-reasoning-summary`, children: /* @__PURE__ */ jsx12("span", { class: `${p10}-reasoning-label`, children: active ? strings.thinking : strings.thoughts }) }),
3797
+ /* @__PURE__ */ jsx12("div", { class: `${p10}-reasoning-body`, children: /* @__PURE__ */ jsx12(MarkdownView, { textSig: part.textSig, doneSig: part.doneSig }) })
3569
3798
  ] });
3570
3799
  }
3571
3800
  function partKey(part) {
@@ -3582,27 +3811,27 @@ function partKey(part) {
3582
3811
  }
3583
3812
  }
3584
3813
  function TypingDots() {
3585
- return /* @__PURE__ */ jsxs7("span", { class: `${p9}-typing`, "aria-hidden": "true", children: [
3586
- /* @__PURE__ */ jsx10("span", {}),
3587
- /* @__PURE__ */ jsx10("span", {}),
3588
- /* @__PURE__ */ jsx10("span", {})
3814
+ return /* @__PURE__ */ jsxs9("span", { class: `${p10}-typing`, "aria-hidden": "true", children: [
3815
+ /* @__PURE__ */ jsx12("span", {}),
3816
+ /* @__PURE__ */ jsx12("span", {}),
3817
+ /* @__PURE__ */ jsx12("span", {})
3589
3818
  ] });
3590
3819
  }
3591
3820
  function LoadingSpinner({ label }) {
3592
- return /* @__PURE__ */ jsxs7("span", { class: `${p9}-loading`, role: "status", children: [
3593
- /* @__PURE__ */ jsx10("span", { class: `${p9}-loading-spinner`, "aria-hidden": "true" }),
3594
- /* @__PURE__ */ jsx10("span", { class: `${p9}-loading-label`, children: label })
3821
+ return /* @__PURE__ */ jsxs9("span", { class: `${p10}-loading`, role: "status", children: [
3822
+ /* @__PURE__ */ jsx12("span", { class: `${p10}-loading-spinner`, "aria-hidden": "true" }),
3823
+ /* @__PURE__ */ jsx12("span", { class: `${p10}-loading-label`, children: label })
3595
3824
  ] });
3596
3825
  }
3597
3826
 
3598
3827
  // src/ui/message-list.tsx
3599
- import { jsx as jsx11, jsxs as jsxs8 } from "preact/jsx-runtime";
3600
- var p10 = BRAND.cssPrefix;
3828
+ import { jsx as jsx13, jsxs as jsxs10 } from "preact/jsx-runtime";
3829
+ var p11 = BRAND.cssPrefix;
3601
3830
  var STICK_THRESHOLD = 120;
3602
3831
  function MessageList({ messagesSig, strings, responseMode, showReasoning, showToolCalls, loading }) {
3603
- const ref = useRef4(null);
3604
- const messages = useComputed2(() => messagesSig.value);
3605
- const hasHydratedRef = useRef4(false);
3832
+ const ref = useRef5(null);
3833
+ const messages = useComputed3(() => messagesSig.value);
3834
+ const hasHydratedRef = useRef5(false);
3606
3835
  const firstMessageId = messages.value[0]?.id;
3607
3836
  useLayoutEffect(() => {
3608
3837
  const el = ref.current;
@@ -3627,34 +3856,34 @@ function MessageList({ messagesSig, strings, responseMode, showReasoning, showTo
3627
3856
  clearTimeout(timerId);
3628
3857
  };
3629
3858
  }, [firstMessageId]);
3630
- useEffect7(() => {
3859
+ useEffect8(() => {
3631
3860
  const el = ref.current;
3632
3861
  if (!el) return;
3633
3862
  if (!hasHydratedRef.current) return;
3634
3863
  const distanceFromBottom = el.scrollHeight - el.scrollTop - el.clientHeight;
3635
3864
  if (distanceFromBottom < STICK_THRESHOLD) el.scrollTop = el.scrollHeight;
3636
3865
  }, [messages.value.length]);
3637
- useEffect7(() => {
3866
+ useEffect8(() => {
3638
3867
  const el = ref.current;
3639
3868
  if (!el) return;
3640
3869
  const last = messages.value.at(-1);
3641
3870
  if (!last) return;
3871
+ const pinIfNear = () => {
3872
+ const distance = el.scrollHeight - el.scrollTop - el.clientHeight;
3873
+ if (distance < STICK_THRESHOLD * 2) el.scrollTop = el.scrollHeight;
3874
+ };
3642
3875
  if (last.status !== "streaming") {
3643
- const rafId = requestAnimationFrame(() => {
3644
- const distance = el.scrollHeight - el.scrollTop - el.clientHeight;
3645
- if (distance < STICK_THRESHOLD * 2) el.scrollTop = el.scrollHeight;
3646
- });
3876
+ const rafId = requestAnimationFrame(pinIfNear);
3647
3877
  return () => cancelAnimationFrame(rafId);
3648
3878
  }
3649
- const id = setInterval(() => {
3650
- const distance = el.scrollHeight - el.scrollTop - el.clientHeight;
3651
- if (distance < STICK_THRESHOLD * 2) el.scrollTop = el.scrollHeight;
3652
- }, 250);
3653
- return () => clearInterval(id);
3879
+ pinIfNear();
3880
+ const obs = new MutationObserver(pinIfNear);
3881
+ obs.observe(el, { childList: true, subtree: true, characterData: true });
3882
+ return () => obs.disconnect();
3654
3883
  }, [messages.value]);
3655
- return /* @__PURE__ */ jsxs8("div", { ref, class: `${p10}-list`, role: "log", "aria-live": "polite", "aria-relevant": "additions text", children: [
3656
- loading && messages.value.length === 0 ? /* @__PURE__ */ jsx11("div", { class: `${p10}-list-loading`, role: "status", children: strings.messagesLoading }) : null,
3657
- messages.value.map((m) => /* @__PURE__ */ jsx11(
3884
+ return /* @__PURE__ */ jsxs10("div", { ref, class: `${p11}-list`, role: "log", "aria-live": "polite", "aria-relevant": "additions text", children: [
3885
+ loading && messages.value.length === 0 ? /* @__PURE__ */ jsx13("div", { class: `${p11}-list-loading`, role: "status", children: strings.messagesLoading }) : null,
3886
+ messages.value.map((m) => /* @__PURE__ */ jsx13(
3658
3887
  MessageBubble,
3659
3888
  {
3660
3889
  message: m,
@@ -3668,139 +3897,6 @@ function MessageList({ messagesSig, strings, responseMode, showReasoning, showTo
3668
3897
  ] });
3669
3898
  }
3670
3899
 
3671
- // src/ui/use-popover-menu.ts
3672
- import { useCallback, useEffect as useEffect8, useRef as useRef5, useState as useState4 } from "preact/hooks";
3673
- function usePopoverMenu({ itemCount, initialFocusIndex }) {
3674
- const [open, setOpen] = useState4(false);
3675
- const triggerRef = useRef5(null);
3676
- const menuRef = useRef5(null);
3677
- const [focusIndex, setFocusIndex] = useState4(-1);
3678
- const close = useCallback(() => {
3679
- setOpen(false);
3680
- setFocusIndex(-1);
3681
- triggerRef.current?.focus();
3682
- }, []);
3683
- const toggle = useCallback(() => setOpen((v) => !v), []);
3684
- useEffect8(() => {
3685
- if (!open) return;
3686
- const onDocClick = (e) => {
3687
- const menu = menuRef.current;
3688
- const trigger = triggerRef.current;
3689
- if (!menu || !trigger) return;
3690
- const path = e.composedPath();
3691
- if (path.includes(menu) || path.includes(trigger)) return;
3692
- setOpen(false);
3693
- setFocusIndex(-1);
3694
- };
3695
- document.addEventListener("click", onDocClick, true);
3696
- return () => document.removeEventListener("click", onDocClick, true);
3697
- }, [open]);
3698
- useEffect8(() => {
3699
- if (!open) return;
3700
- if (itemCount === 0) return;
3701
- const desired = initialFocusIndex?.() ?? 0;
3702
- const clamped = desired < 0 || desired >= itemCount ? 0 : desired;
3703
- setFocusIndex(clamped);
3704
- }, [open, itemCount, initialFocusIndex]);
3705
- useEffect8(() => {
3706
- if (!open || focusIndex < 0) return;
3707
- const items = menuRef.current?.querySelectorAll("[role='menuitem']");
3708
- items?.[focusIndex]?.focus();
3709
- }, [open, focusIndex]);
3710
- const onTriggerKey = useCallback((e) => {
3711
- if (e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") {
3712
- e.preventDefault();
3713
- setOpen(true);
3714
- }
3715
- }, []);
3716
- const onMenuKey = useCallback(
3717
- (e) => {
3718
- if (itemCount === 0) return;
3719
- switch (e.key) {
3720
- case "Escape":
3721
- e.preventDefault();
3722
- close();
3723
- return;
3724
- case "ArrowDown":
3725
- e.preventDefault();
3726
- setFocusIndex((i) => (i + 1) % itemCount);
3727
- return;
3728
- case "ArrowUp":
3729
- e.preventDefault();
3730
- setFocusIndex((i) => (i - 1 + itemCount) % itemCount);
3731
- return;
3732
- case "Home":
3733
- e.preventDefault();
3734
- setFocusIndex(0);
3735
- return;
3736
- case "End":
3737
- e.preventDefault();
3738
- setFocusIndex(itemCount - 1);
3739
- }
3740
- },
3741
- [itemCount, close]
3742
- );
3743
- return { open, focusIndex, triggerRef, menuRef, toggle, close, onTriggerKey, onMenuKey };
3744
- }
3745
-
3746
- // src/ui/overflow-menu.tsx
3747
- import { jsx as jsx12, jsxs as jsxs9 } from "preact/jsx-runtime";
3748
- function OverflowMenu({ items, triggerLabel }) {
3749
- const p28 = BRAND.cssPrefix;
3750
- const menu = usePopoverMenu({ itemCount: items.length });
3751
- const handleSelect = (item) => {
3752
- if (item.disabled) return;
3753
- item.onSelect();
3754
- menu.close();
3755
- };
3756
- return /* @__PURE__ */ jsxs9("div", { class: `${p28}-menu-wrap`, children: [
3757
- /* @__PURE__ */ jsx12(
3758
- "button",
3759
- {
3760
- ref: menu.triggerRef,
3761
- type: "button",
3762
- class: `${p28}-icon-btn`,
3763
- "aria-label": triggerLabel,
3764
- "aria-haspopup": "menu",
3765
- "aria-expanded": menu.open,
3766
- title: triggerLabel,
3767
- onClick: menu.toggle,
3768
- onKeyDown: menu.onTriggerKey,
3769
- children: /* @__PURE__ */ jsx12(MoreIcon, {})
3770
- }
3771
- ),
3772
- menu.open ? /* @__PURE__ */ jsx12(
3773
- "div",
3774
- {
3775
- ref: menu.menuRef,
3776
- class: `${p28}-menu`,
3777
- role: "menu",
3778
- "aria-label": triggerLabel,
3779
- onKeyDown: menu.onMenuKey,
3780
- tabIndex: -1,
3781
- children: items.map((item) => /* @__PURE__ */ jsxs9(
3782
- "button",
3783
- {
3784
- type: "button",
3785
- role: "menuitem",
3786
- class: `${p28}-menu-item`,
3787
- "aria-pressed": item.type === "switch" ? item.on : void 0,
3788
- disabled: item.disabled,
3789
- lang: item.lang,
3790
- onClick: () => handleSelect(item),
3791
- children: [
3792
- item.icon ? /* @__PURE__ */ jsx12("span", { class: `${p28}-menu-icon`, children: item.icon }) : null,
3793
- /* @__PURE__ */ jsx12("span", { class: `${p28}-menu-label`, children: item.label }),
3794
- item.type === "switch" && item.on ? /* @__PURE__ */ jsx12("span", { class: `${p28}-menu-check`, "aria-hidden": "true", children: /* @__PURE__ */ jsx12(CheckIcon, {}) }) : null
3795
- ]
3796
- },
3797
- item.id
3798
- ))
3799
- }
3800
- ) : null
3801
- ] });
3802
- }
3803
-
3804
3900
  // src/ui/conversation-list.tsx
3805
3901
  import { useEffect as useEffect9, useState as useState5 } from "preact/hooks";
3806
3902
 
@@ -3832,7 +3928,7 @@ function startOfDay(ms) {
3832
3928
  }
3833
3929
 
3834
3930
  // src/ui/conversation-list.tsx
3835
- import { Fragment, jsx as jsx13, jsxs as jsxs10 } from "preact/jsx-runtime";
3931
+ import { Fragment, jsx as jsx14, jsxs as jsxs11 } from "preact/jsx-runtime";
3836
3932
  var log11 = logger.scope("history");
3837
3933
  var BUCKET_TO_STRING = {
3838
3934
  today: "dateToday",
@@ -3841,7 +3937,7 @@ var BUCKET_TO_STRING = {
3841
3937
  older: "dateOlder"
3842
3938
  };
3843
3939
  function ConversationList({ transport, strings, visitorId, onSelect, onNewChat }) {
3844
- const p28 = BRAND.cssPrefix;
3940
+ const p29 = BRAND.cssPrefix;
3845
3941
  const [state, setState] = useState5("loading");
3846
3942
  const [sessions, setChats] = useState5([]);
3847
3943
  useEffect9(() => {
@@ -3859,38 +3955,38 @@ function ConversationList({ transport, strings, visitorId, onSelect, onNewChat }
3859
3955
  cancelled = true;
3860
3956
  };
3861
3957
  }, [transport, visitorId]);
3862
- const newChatButton = onNewChat ? /* @__PURE__ */ jsx13("div", { class: `${p28}-history-footer`, children: /* @__PURE__ */ jsxs10("button", { type: "button", class: `${p28}-history-new`, onClick: onNewChat, "data-testid": TID.sidebarNewChat, children: [
3863
- /* @__PURE__ */ jsx13(PlusIcon, {}),
3958
+ const newChatButton = onNewChat ? /* @__PURE__ */ jsx14("div", { class: `${p29}-history-footer`, children: /* @__PURE__ */ jsxs11("button", { type: "button", class: `${p29}-history-new`, onClick: onNewChat, "data-testid": TID.sidebarNewChat, children: [
3959
+ /* @__PURE__ */ jsx14(PlusIcon, {}),
3864
3960
  strings.historyNewChat
3865
3961
  ] }) }) : null;
3866
3962
  if (state === "loading") {
3867
- return /* @__PURE__ */ jsxs10(Fragment, { children: [
3868
- /* @__PURE__ */ jsx13("div", { class: `${p28}-history-empty`, children: strings.historyLoading }),
3963
+ return /* @__PURE__ */ jsxs11(Fragment, { children: [
3964
+ /* @__PURE__ */ jsx14("div", { class: `${p29}-history-empty`, children: strings.historyLoading }),
3869
3965
  newChatButton
3870
3966
  ] });
3871
3967
  }
3872
3968
  if (state === "error" || sessions.length === 0) {
3873
- return /* @__PURE__ */ jsxs10(Fragment, { children: [
3874
- /* @__PURE__ */ jsx13("div", { class: `${p28}-history-empty`, children: strings.historyEmpty }),
3969
+ return /* @__PURE__ */ jsxs11(Fragment, { children: [
3970
+ /* @__PURE__ */ jsx14("div", { class: `${p29}-history-empty`, children: strings.historyEmpty }),
3875
3971
  newChatButton
3876
3972
  ] });
3877
3973
  }
3878
3974
  const groups = groupByBucket(Date.now(), sessions);
3879
- return /* @__PURE__ */ jsxs10(Fragment, { children: [
3880
- /* @__PURE__ */ jsx13("div", { class: `${p28}-history`, role: "list", children: groups.map((group) => /* @__PURE__ */ jsxs10("div", { class: `${p28}-history-group`, children: [
3881
- /* @__PURE__ */ jsx13("div", { class: `${p28}-history-heading`, children: strings[BUCKET_TO_STRING[group.bucket]] }),
3882
- group.sessions.map((chat) => /* @__PURE__ */ jsxs10(
3975
+ return /* @__PURE__ */ jsxs11(Fragment, { children: [
3976
+ /* @__PURE__ */ jsx14("div", { class: `${p29}-history`, role: "list", children: groups.map((group) => /* @__PURE__ */ jsxs11("div", { class: `${p29}-history-group`, children: [
3977
+ /* @__PURE__ */ jsx14("div", { class: `${p29}-history-heading`, children: strings[BUCKET_TO_STRING[group.bucket]] }),
3978
+ group.sessions.map((chat) => /* @__PURE__ */ jsxs11(
3883
3979
  "button",
3884
3980
  {
3885
3981
  type: "button",
3886
3982
  role: "listitem",
3887
- class: `${p28}-history-item`,
3983
+ class: `${p29}-history-item`,
3888
3984
  onClick: () => onSelect(chat),
3889
3985
  "data-closed": chat.canContinue ? void 0 : "true",
3890
3986
  "data-testid": tid(TID.historyItem, chat.sessionId),
3891
3987
  children: [
3892
- /* @__PURE__ */ jsx13("span", { class: `${p28}-history-title`, children: chat.title }),
3893
- chat.preview ? /* @__PURE__ */ jsx13("span", { class: `${p28}-history-preview`, children: chat.preview }) : null
3988
+ /* @__PURE__ */ jsx14("span", { class: `${p29}-history-title`, children: chat.title }),
3989
+ chat.preview ? /* @__PURE__ */ jsx14("span", { class: `${p29}-history-preview`, children: chat.preview }) : null
3894
3990
  ]
3895
3991
  },
3896
3992
  chat.sessionId
@@ -3901,153 +3997,21 @@ function ConversationList({ transport, strings, visitorId, onSelect, onNewChat }
3901
3997
  }
3902
3998
 
3903
3999
  // src/ui/chat-history-pane.tsx
3904
- import { jsx as jsx14 } from "preact/jsx-runtime";
4000
+ import { jsx as jsx15 } from "preact/jsx-runtime";
3905
4001
  function ChatHistoryPane(props2) {
3906
- return /* @__PURE__ */ jsx14(ConversationList, { ...props2 });
3907
- }
3908
-
3909
- // src/ui/language-switcher.tsx
3910
- import { useCallback as useCallback2 } from "preact/hooks";
3911
- import { jsx as jsx15, jsxs as jsxs11 } from "preact/jsx-runtime";
3912
- function LanguageSwitcher({ available, active, onSelect, triggerLabel }) {
3913
- const p28 = BRAND.cssPrefix;
3914
- const initialFocusIndex = useCallback2(() => available.indexOf(active), [available, active]);
3915
- const menu = usePopoverMenu({ itemCount: available.length, initialFocusIndex });
3916
- const handleSelect = (locale) => {
3917
- onSelect(locale);
3918
- menu.close();
3919
- };
3920
- return /* @__PURE__ */ jsxs11("div", { class: `${p28}-menu-wrap`, children: [
3921
- /* @__PURE__ */ jsx15(
3922
- "button",
3923
- {
3924
- ref: menu.triggerRef,
3925
- type: "button",
3926
- class: `${p28}-icon-btn`,
3927
- "aria-label": triggerLabel,
3928
- "aria-haspopup": "menu",
3929
- "aria-expanded": menu.open,
3930
- title: triggerLabel,
3931
- onClick: menu.toggle,
3932
- onKeyDown: menu.onTriggerKey,
3933
- children: /* @__PURE__ */ jsx15(GlobeIcon, {})
3934
- }
3935
- ),
3936
- menu.open ? /* @__PURE__ */ jsx15(
3937
- "div",
3938
- {
3939
- ref: menu.menuRef,
3940
- class: `${p28}-menu`,
3941
- role: "menu",
3942
- "aria-label": triggerLabel,
3943
- onKeyDown: menu.onMenuKey,
3944
- tabIndex: -1,
3945
- children: available.map((locale) => {
3946
- const isActive = locale === active;
3947
- return /* @__PURE__ */ jsxs11(
3948
- "button",
3949
- {
3950
- type: "button",
3951
- role: "menuitem",
3952
- class: `${p28}-menu-item`,
3953
- lang: locale,
3954
- "aria-current": isActive ? "true" : void 0,
3955
- onClick: () => handleSelect(locale),
3956
- children: [
3957
- /* @__PURE__ */ jsx15("span", { class: `${p28}-menu-label`, children: localeDisplayName(locale, active) }),
3958
- isActive ? /* @__PURE__ */ jsx15("span", { class: `${p28}-menu-check`, "aria-hidden": "true", children: /* @__PURE__ */ jsx15(CheckIcon, {}) }) : null
3959
- ]
3960
- },
3961
- locale
3962
- );
3963
- })
3964
- }
3965
- ) : null
3966
- ] });
3967
- }
3968
-
3969
- // src/ui/theme-switcher.tsx
3970
- import { useCallback as useCallback3 } from "preact/hooks";
3971
- import { jsx as jsx16, jsxs as jsxs12 } from "preact/jsx-runtime";
3972
- var OPTIONS = ["auto", "light", "dark"];
3973
- function iconFor(mode) {
3974
- switch (mode) {
3975
- case "light":
3976
- return /* @__PURE__ */ jsx16(SunIcon, {});
3977
- case "dark":
3978
- return /* @__PURE__ */ jsx16(MoonIcon, {});
3979
- case "auto":
3980
- return /* @__PURE__ */ jsx16(ThemeAutoIcon, {});
3981
- }
3982
- }
3983
- function ThemeSwitcher({ active, onSelect, triggerLabel, optionLabels }) {
3984
- const p28 = BRAND.cssPrefix;
3985
- const initialFocusIndex = useCallback3(() => OPTIONS.indexOf(active), [active]);
3986
- const menu = usePopoverMenu({ itemCount: OPTIONS.length, initialFocusIndex });
3987
- const handleSelect = (mode) => {
3988
- onSelect(mode);
3989
- menu.close();
3990
- };
3991
- return /* @__PURE__ */ jsxs12("div", { class: `${p28}-menu-wrap`, children: [
3992
- /* @__PURE__ */ jsx16(
3993
- "button",
3994
- {
3995
- ref: menu.triggerRef,
3996
- type: "button",
3997
- class: `${p28}-icon-btn`,
3998
- "aria-label": triggerLabel,
3999
- "aria-haspopup": "menu",
4000
- "aria-expanded": menu.open,
4001
- title: triggerLabel,
4002
- "data-theme-active": active,
4003
- onClick: menu.toggle,
4004
- onKeyDown: menu.onTriggerKey,
4005
- children: iconFor(active)
4006
- }
4007
- ),
4008
- menu.open ? /* @__PURE__ */ jsx16(
4009
- "div",
4010
- {
4011
- ref: menu.menuRef,
4012
- class: `${p28}-menu`,
4013
- role: "menu",
4014
- "aria-label": triggerLabel,
4015
- onKeyDown: menu.onMenuKey,
4016
- tabIndex: -1,
4017
- children: OPTIONS.map((mode) => {
4018
- const isActive = mode === active;
4019
- return /* @__PURE__ */ jsxs12(
4020
- "button",
4021
- {
4022
- type: "button",
4023
- role: "menuitem",
4024
- class: `${p28}-menu-item`,
4025
- "aria-current": isActive ? "true" : void 0,
4026
- onClick: () => handleSelect(mode),
4027
- children: [
4028
- /* @__PURE__ */ jsx16("span", { class: `${p28}-menu-icon`, children: iconFor(mode) }),
4029
- /* @__PURE__ */ jsx16("span", { class: `${p28}-menu-label`, children: optionLabels[mode] }),
4030
- isActive ? /* @__PURE__ */ jsx16("span", { class: `${p28}-menu-check`, "aria-hidden": "true", children: /* @__PURE__ */ jsx16(CheckIcon, {}) }) : null
4031
- ]
4032
- },
4033
- mode
4034
- );
4035
- })
4036
- }
4037
- ) : null
4038
- ] });
4002
+ return /* @__PURE__ */ jsx15(ConversationList, { ...props2 });
4039
4003
  }
4040
4004
 
4041
4005
  // src/ui/suggestions.tsx
4042
- import { jsx as jsx17 } from "preact/jsx-runtime";
4043
- var p11 = BRAND.cssPrefix;
4006
+ import { jsx as jsx16 } from "preact/jsx-runtime";
4007
+ var p12 = BRAND.cssPrefix;
4044
4008
  function Suggestions({ suggestions, onPick }) {
4045
4009
  if (suggestions.length === 0) return null;
4046
- return /* @__PURE__ */ jsx17("div", { class: `${p11}-suggestions`, role: "group", "aria-label": "Suggested replies", children: suggestions.map((s, i) => /* @__PURE__ */ jsx17(
4010
+ return /* @__PURE__ */ jsx16("div", { class: `${p12}-suggestions`, role: "group", "aria-label": "Suggested replies", children: suggestions.map((s, i) => /* @__PURE__ */ jsx16(
4047
4011
  "button",
4048
4012
  {
4049
4013
  type: "button",
4050
- class: `${p11}-suggestion`,
4014
+ class: `${p12}-suggestion`,
4051
4015
  onClick: () => onPick(s),
4052
4016
  "data-testid": tid(TID.suggestion, i),
4053
4017
  children: s.label
@@ -4057,8 +4021,8 @@ function Suggestions({ suggestions, onPick }) {
4057
4021
  }
4058
4022
 
4059
4023
  // src/ui/panel.tsx
4060
- import { Fragment as Fragment2, jsx as jsx18, jsxs as jsxs13 } from "preact/jsx-runtime";
4061
- var p12 = BRAND.cssPrefix;
4024
+ import { Fragment as Fragment2, jsx as jsx17, jsxs as jsxs12 } from "preact/jsx-runtime";
4025
+ var p13 = BRAND.cssPrefix;
4062
4026
  function Panel(props2) {
4063
4027
  const { options, onClose } = props2;
4064
4028
  const s = options.strings;
@@ -4077,23 +4041,23 @@ function Panel(props2) {
4077
4041
  };
4078
4042
  }, [onClose]);
4079
4043
  const composerAttachApiRef = useRef6(null);
4080
- const onDropItems = useCallback4((items) => {
4044
+ const onDropItems = useCallback2((items) => {
4081
4045
  composerAttachApiRef.current?.attachFromDrop(items);
4082
4046
  }, []);
4083
4047
  const { visible: dragOver } = useFileDrop({ containerRef, onDrop: onDropItems });
4084
4048
  useDragMove(containerRef.current, options.mode === "modal");
4085
- return /* @__PURE__ */ jsxs13(
4049
+ return /* @__PURE__ */ jsxs12(
4086
4050
  "div",
4087
4051
  {
4088
4052
  ref: containerRef,
4089
- class: `${p12}-panel`,
4053
+ class: `${p13}-panel`,
4090
4054
  role: "dialog",
4091
4055
  "aria-modal": "false",
4092
4056
  "aria-label": s.panelTitle,
4093
4057
  style: { position: "relative" },
4094
4058
  "data-testid": TID.panel,
4095
4059
  children: [
4096
- /* @__PURE__ */ jsx18(
4060
+ /* @__PURE__ */ jsx17(
4097
4061
  PanelContent,
4098
4062
  {
4099
4063
  ...props2,
@@ -4102,49 +4066,44 @@ function Panel(props2) {
4102
4066
  composerAttachApiRef
4103
4067
  }
4104
4068
  ),
4105
- /* @__PURE__ */ jsx18(PoweredByBar, { poweredBy: props2.options.poweredBy })
4069
+ /* @__PURE__ */ jsx17(PoweredByBar, { poweredBy: props2.options.poweredBy })
4106
4070
  ]
4107
4071
  }
4108
4072
  );
4109
4073
  }
4110
- function PanelContent({
4111
- options,
4112
- transport,
4113
- feedback,
4114
- bus,
4115
- panelSize,
4116
- view,
4117
- canSend,
4118
- isStreaming,
4119
- loadingMessages,
4120
- messagesSig,
4121
- agent,
4122
- suggestions,
4123
- initialWidgetSize,
4124
- visitorId,
4125
- onClose,
4126
- onBack,
4127
- onClear,
4128
- onExpand,
4129
- onFullscreen,
4130
- onPopOut,
4131
- onSoundToggle,
4132
- onToggleHistory,
4133
- onSelectHistoryChat,
4134
- onNewChat,
4135
- onLocaleChange,
4136
- onThemeChange,
4137
- onWidgetSizeChange,
4138
- onSend,
4139
- onStop,
4140
- onSuggestion,
4141
- containerEl,
4142
- dragOver,
4143
- composerAttachApiRef
4144
- }) {
4074
+ function PanelContent(props2) {
4075
+ const {
4076
+ options,
4077
+ transport,
4078
+ feedback,
4079
+ bus,
4080
+ panelSize,
4081
+ view,
4082
+ canSend,
4083
+ isStreaming,
4084
+ loadingMessages,
4085
+ messagesSig,
4086
+ agent,
4087
+ suggestions,
4088
+ initialWidgetSize,
4089
+ visitorId,
4090
+ onClose,
4091
+ onBack,
4092
+ onClear,
4093
+ onToggleHistory,
4094
+ onSelectHistoryChat,
4095
+ onNewChat,
4096
+ onWidgetSizeChange,
4097
+ onSend,
4098
+ onStop,
4099
+ onSuggestion,
4100
+ containerEl,
4101
+ dragOver,
4102
+ composerAttachApiRef
4103
+ } = props2;
4145
4104
  const s = options.strings;
4146
- return /* @__PURE__ */ jsxs13(Fragment2, { children: [
4147
- view === "history" ? /* @__PURE__ */ jsx18(
4105
+ return /* @__PURE__ */ jsxs12(Fragment2, { children: [
4106
+ view === "history" ? /* @__PURE__ */ jsx17(
4148
4107
  HistoryHeader,
4149
4108
  {
4150
4109
  strings: s,
@@ -4152,39 +4111,22 @@ function PanelContent({
4152
4111
  onClose,
4153
4112
  showClose: canShowClose(options.mode, panelSize, options.actions)
4154
4113
  }
4155
- ) : /* @__PURE__ */ jsx18(
4156
- Header,
4157
- {
4158
- agent,
4159
- onBack,
4160
- backLabel: s.moduleBack,
4161
- moreActionsLabel: s.moreActions,
4162
- languageLabel: s.language,
4163
- themeLabel: s.theme,
4164
- themeOptionLabels: { auto: s.themeAuto, light: s.themeLight, dark: s.themeDark },
4165
- activeThemeMode: options.themeMode,
4166
- onThemeChange,
4167
- panelTitle: s.panelTitle,
4168
- activeLocale: options.locale,
4169
- availableLocales: options.availableLocales,
4170
- onLocaleChange,
4171
- main: visibleActions(options.actions.main, options.mode, panelSize, { popOutUrl: options.popOutUrl }),
4172
- overflow: visibleActions(options.actions.overflow, options.mode, panelSize, { popOutUrl: options.popOutUrl }),
4173
- descriptors: buildDescriptors({
4174
- strings: s,
4175
- panelSize,
4176
- feedback,
4177
- onClear,
4178
- onExpand,
4179
- onFullscreen,
4180
- onPopOut,
4181
- onSoundToggle,
4182
- onToggleHistory,
4183
- onClose
4184
- })
4185
- }
4186
- ),
4187
- view === "history" ? /* @__PURE__ */ jsx18(
4114
+ ) : /* @__PURE__ */ jsxs12("header", { class: `${p13}-header`, "data-testid": TID.panelHeader, children: [
4115
+ onBack ? /* @__PURE__ */ jsx17(
4116
+ "button",
4117
+ {
4118
+ type: "button",
4119
+ class: `${p13}-icon-btn`,
4120
+ onClick: onBack,
4121
+ "aria-label": s.moduleBack,
4122
+ title: s.moduleBack,
4123
+ children: /* @__PURE__ */ jsx17(BackIcon, {})
4124
+ }
4125
+ ) : null,
4126
+ agent ? /* @__PURE__ */ jsx17(AgentBadge, { agent }) : /* @__PURE__ */ jsx17("h1", { children: s.panelTitle }),
4127
+ /* @__PURE__ */ jsx17(HeaderActions, { panelProps: props2, variant: "chat" })
4128
+ ] }),
4129
+ view === "history" ? /* @__PURE__ */ jsx17(
4188
4130
  ChatHistoryPane,
4189
4131
  {
4190
4132
  transport,
@@ -4193,9 +4135,9 @@ function PanelContent({
4193
4135
  onSelect: (chat) => onSelectHistoryChat(chat.sessionId),
4194
4136
  onNewChat
4195
4137
  }
4196
- ) : /* @__PURE__ */ jsxs13(Fragment2, { children: [
4197
- /* @__PURE__ */ jsx18(DropZone, { visible: dragOver, strings: s }),
4198
- /* @__PURE__ */ jsx18(
4138
+ ) : /* @__PURE__ */ jsxs12(Fragment2, { children: [
4139
+ /* @__PURE__ */ jsx17(DropZone, { visible: dragOver, strings: s }),
4140
+ /* @__PURE__ */ jsx17(
4199
4141
  MessageList,
4200
4142
  {
4201
4143
  messagesSig,
@@ -4206,9 +4148,9 @@ function PanelContent({
4206
4148
  loading: loadingMessages
4207
4149
  }
4208
4150
  ),
4209
- canSend ? /* @__PURE__ */ jsxs13(Fragment2, { children: [
4210
- /* @__PURE__ */ jsx18(Suggestions, { suggestions, onPick: onSuggestion }),
4211
- /* @__PURE__ */ jsx18(
4151
+ canSend ? /* @__PURE__ */ jsxs12(Fragment2, { children: [
4152
+ /* @__PURE__ */ jsx17(Suggestions, { suggestions, onPick: onSuggestion }),
4153
+ /* @__PURE__ */ jsx17(
4212
4154
  Composer,
4213
4155
  {
4214
4156
  options,
@@ -4221,10 +4163,10 @@ function PanelContent({
4221
4163
  attachApiRef: composerAttachApiRef
4222
4164
  }
4223
4165
  )
4224
- ] }) : /* @__PURE__ */ jsx18(ReadOnlyBanner, { label: s.chatClosed, ctaLabel: s.startNewConversation, onNewChat: onClear }),
4225
- /* @__PURE__ */ jsx18(ComposerFooter, { disclaimer: options.composerDisclaimer })
4166
+ ] }) : /* @__PURE__ */ jsx17(ReadOnlyBanner, { label: s.chatClosed, ctaLabel: s.startNewConversation, onNewChat: onClear }),
4167
+ /* @__PURE__ */ jsx17(ComposerFooter, { disclaimer: options.composerDisclaimer })
4226
4168
  ] }),
4227
- options.size.resize?.enabled ? /* @__PURE__ */ jsx18(
4169
+ options.size.resize?.enabled ? /* @__PURE__ */ jsx17(
4228
4170
  ResizeGrip,
4229
4171
  {
4230
4172
  panelEl: containerEl,
@@ -4243,236 +4185,86 @@ function HistoryHeader({
4243
4185
  onClose,
4244
4186
  showClose
4245
4187
  }) {
4246
- return /* @__PURE__ */ jsxs13("header", { class: `${p12}-header`, children: [
4247
- /* @__PURE__ */ jsx18(
4188
+ return /* @__PURE__ */ jsxs12("header", { class: `${p13}-header`, children: [
4189
+ /* @__PURE__ */ jsx17(
4248
4190
  "button",
4249
4191
  {
4250
4192
  type: "button",
4251
- class: `${p12}-icon-btn`,
4193
+ class: `${p13}-icon-btn`,
4252
4194
  onClick: onBack,
4253
4195
  "aria-label": strings.historyBack,
4254
4196
  title: strings.historyBack,
4255
- children: /* @__PURE__ */ jsx18(BackIcon, {})
4197
+ children: /* @__PURE__ */ jsx17(BackIcon, {})
4256
4198
  }
4257
4199
  ),
4258
- /* @__PURE__ */ jsx18("h1", { children: strings.historyTitle }),
4259
- showClose ? /* @__PURE__ */ jsx18(
4200
+ /* @__PURE__ */ jsx17("h1", { children: strings.historyTitle }),
4201
+ showClose ? /* @__PURE__ */ jsx17(
4260
4202
  "button",
4261
4203
  {
4262
4204
  type: "button",
4263
- class: `${p12}-icon-btn`,
4205
+ class: `${p13}-icon-btn`,
4264
4206
  onClick: onClose,
4265
4207
  "aria-label": strings.close,
4266
4208
  title: strings.close,
4267
- children: /* @__PURE__ */ jsx18(CloseIcon, {})
4209
+ children: /* @__PURE__ */ jsx17(CloseIcon, {})
4268
4210
  }
4269
4211
  ) : null
4270
4212
  ] });
4271
4213
  }
4272
4214
  function ReadOnlyBanner({ label, ctaLabel, onNewChat }) {
4273
- return /* @__PURE__ */ jsxs13("div", { class: `${p12}-readonly-banner`, role: "note", children: [
4274
- /* @__PURE__ */ jsx18("span", { class: `${p12}-readonly-label`, children: label }),
4275
- /* @__PURE__ */ jsx18("button", { type: "button", class: `${p12}-readonly-cta`, onClick: onNewChat, children: ctaLabel })
4215
+ return /* @__PURE__ */ jsxs12("div", { class: `${p13}-readonly-banner`, role: "note", children: [
4216
+ /* @__PURE__ */ jsx17("span", { class: `${p13}-readonly-label`, children: label }),
4217
+ /* @__PURE__ */ jsx17("button", { type: "button", class: `${p13}-readonly-cta`, onClick: onNewChat, children: ctaLabel })
4276
4218
  ] });
4277
4219
  }
4278
4220
  function ComposerFooter({ disclaimer }) {
4279
4221
  if (!disclaimer) return null;
4280
- return /* @__PURE__ */ jsx18("div", { class: `${p12}-composer-footer`, children: /* @__PURE__ */ jsx18("div", { class: `${p12}-disclaimer`, children: disclaimer }) });
4222
+ return /* @__PURE__ */ jsx17("div", { class: `${p13}-composer-footer`, children: /* @__PURE__ */ jsx17("div", { class: `${p13}-disclaimer`, children: disclaimer }) });
4281
4223
  }
4282
4224
  function PoweredByBar({ poweredBy }) {
4283
4225
  if (!poweredBy) return null;
4284
- return /* @__PURE__ */ jsx18("div", { class: `${p12}-poweredby-bar`, children: /* @__PURE__ */ jsx18(PoweredBy, { logoUrl: poweredBy.logoUrl, text: poweredBy.text, href: poweredBy.href }) });
4226
+ return /* @__PURE__ */ jsx17("div", { class: `${p13}-poweredby-bar`, children: /* @__PURE__ */ jsx17(PoweredBy, { logoUrl: poweredBy.logoUrl, text: poweredBy.text, href: poweredBy.href }) });
4285
4227
  }
4286
4228
  function PoweredBy({ logoUrl, text, href }) {
4287
- const inner = /* @__PURE__ */ jsxs13(Fragment2, { children: [
4288
- logoUrl ? /* @__PURE__ */ jsx18("img", { class: `${p12}-poweredby-logo`, src: logoUrl, alt: "", loading: "lazy" }) : null,
4289
- text ? /* @__PURE__ */ jsx18("span", { children: text }) : null
4229
+ const inner = /* @__PURE__ */ jsxs12(Fragment2, { children: [
4230
+ logoUrl ? /* @__PURE__ */ jsx17("img", { class: `${p13}-poweredby-logo`, src: logoUrl, alt: "", loading: "lazy" }) : null,
4231
+ text ? /* @__PURE__ */ jsx17("span", { children: text }) : null
4290
4232
  ] });
4291
4233
  if (href) {
4292
- return /* @__PURE__ */ jsx18("a", { class: `${p12}-poweredby`, href, target: "_blank", rel: "noopener noreferrer", children: inner });
4293
- }
4294
- return /* @__PURE__ */ jsx18("span", { class: `${p12}-poweredby`, children: inner });
4295
- }
4296
- function Header({
4297
- agent,
4298
- onBack,
4299
- backLabel,
4300
- moreActionsLabel,
4301
- languageLabel,
4302
- themeLabel,
4303
- themeOptionLabels,
4304
- activeThemeMode,
4305
- onThemeChange,
4306
- panelTitle,
4307
- activeLocale,
4308
- availableLocales,
4309
- onLocaleChange,
4310
- main,
4311
- overflow,
4312
- descriptors
4313
- }) {
4314
- const showLanguage = availableLocales.length > 1;
4315
- const overflowItems = [];
4316
- for (const name of overflow) {
4317
- if (name === "theme") continue;
4318
- if (name === "language") {
4319
- if (!showLanguage) continue;
4320
- for (const locale of availableLocales) {
4321
- overflowItems.push({
4322
- id: `language:${locale}`,
4323
- label: languageLabel + ` \u2014 ${locale}`,
4324
- lang: locale,
4325
- onSelect: () => onLocaleChange(locale),
4326
- type: "switch",
4327
- on: locale === activeLocale
4328
- });
4329
- }
4330
- continue;
4331
- }
4332
- const d = descriptors[name];
4333
- overflowItems.push({
4334
- id: name,
4335
- icon: d.icon,
4336
- label: d.label,
4337
- onSelect: d.onSelect,
4338
- type: d.switchable ? "switch" : "button",
4339
- on: d.switchOn
4340
- });
4234
+ return /* @__PURE__ */ jsx17("a", { class: `${p13}-poweredby`, href, target: "_blank", rel: "noopener noreferrer", children: inner });
4341
4235
  }
4342
- const themeInOverflow = overflow.includes("theme");
4343
- return /* @__PURE__ */ jsxs13("header", { class: `${p12}-header`, "data-testid": TID.panelHeader, children: [
4344
- onBack ? /* @__PURE__ */ jsx18("button", { type: "button", class: `${p12}-icon-btn`, onClick: onBack, "aria-label": backLabel, title: backLabel, children: /* @__PURE__ */ jsx18(BackIcon, {}) }) : null,
4345
- agent ? /* @__PURE__ */ jsx18(AgentBadge, { agent }) : /* @__PURE__ */ jsx18("h1", { children: panelTitle }),
4346
- main.map((name) => {
4347
- if (name === "language") {
4348
- if (!showLanguage) return null;
4349
- return /* @__PURE__ */ jsx18(
4350
- LanguageSwitcher,
4351
- {
4352
- available: availableLocales,
4353
- active: activeLocale,
4354
- onSelect: onLocaleChange,
4355
- triggerLabel: languageLabel
4356
- },
4357
- "language"
4358
- );
4359
- }
4360
- if (name === "theme") {
4361
- return /* @__PURE__ */ jsx18(
4362
- ThemeSwitcher,
4363
- {
4364
- active: activeThemeMode,
4365
- onSelect: onThemeChange,
4366
- triggerLabel: themeLabel,
4367
- optionLabels: themeOptionLabels
4368
- },
4369
- "theme"
4370
- );
4371
- }
4372
- const d = descriptors[name];
4373
- return /* @__PURE__ */ jsx18(
4374
- "button",
4375
- {
4376
- type: "button",
4377
- class: `${p12}-icon-btn`,
4378
- onClick: d.onSelect,
4379
- "aria-label": d.label,
4380
- "aria-pressed": d.switchable ? d.switchOn : void 0,
4381
- title: d.label,
4382
- "data-testid": ACTION_TID[name],
4383
- children: d.icon
4384
- },
4385
- name
4386
- );
4387
- }),
4388
- themeInOverflow ? /* @__PURE__ */ jsx18(
4389
- ThemeSwitcher,
4390
- {
4391
- active: activeThemeMode,
4392
- onSelect: onThemeChange,
4393
- triggerLabel: themeLabel,
4394
- optionLabels: themeOptionLabels
4395
- }
4396
- ) : null,
4397
- overflowItems.length > 0 ? /* @__PURE__ */ jsx18(OverflowMenu, { items: overflowItems, triggerLabel: moreActionsLabel }) : null
4398
- ] });
4399
- }
4400
- function buildDescriptors(args) {
4401
- const {
4402
- strings,
4403
- panelSize,
4404
- feedback,
4405
- onClear,
4406
- onExpand,
4407
- onFullscreen,
4408
- onPopOut,
4409
- onSoundToggle,
4410
- onToggleHistory,
4411
- onClose
4412
- } = args;
4413
- const expandedNow = panelSize === "expanded";
4414
- const fullscreenNow = panelSize === "fullscreen";
4415
- const muted = useComputed3(() => feedback.mutedSig.value).value;
4416
- return {
4417
- clear: { icon: /* @__PURE__ */ jsx18(TrashIcon, {}), label: strings.newConversation, onSelect: onClear },
4418
- expand: {
4419
- icon: expandedNow ? /* @__PURE__ */ jsx18(CollapseIcon, {}) : /* @__PURE__ */ jsx18(ExpandIcon, {}),
4420
- label: expandedNow ? strings.collapse : strings.expand,
4421
- onSelect: onExpand,
4422
- switchable: true,
4423
- switchOn: expandedNow
4424
- },
4425
- fullscreen: {
4426
- icon: fullscreenNow ? /* @__PURE__ */ jsx18(FullscreenExitIcon, {}) : /* @__PURE__ */ jsx18(FullscreenIcon, {}),
4427
- label: fullscreenNow ? strings.exitFullscreen : strings.fullscreen,
4428
- onSelect: onFullscreen,
4429
- switchable: true,
4430
- switchOn: fullscreenNow
4431
- },
4432
- popOut: { icon: /* @__PURE__ */ jsx18(PopOutIcon, {}), label: strings.popOut, onSelect: onPopOut },
4433
- sound: {
4434
- icon: muted ? /* @__PURE__ */ jsx18(SpeakerMutedIcon, {}) : /* @__PURE__ */ jsx18(SpeakerIcon, {}),
4435
- label: muted ? strings.soundOff : strings.soundOn,
4436
- onSelect: onSoundToggle,
4437
- switchable: true,
4438
- // The switch is "on" when sound is ENABLED (not muted).
4439
- switchOn: !muted
4440
- },
4441
- history: { icon: /* @__PURE__ */ jsx18(HistoryIcon, {}), label: strings.history, onSelect: onToggleHistory },
4442
- close: { icon: /* @__PURE__ */ jsx18(CloseIcon, {}), label: strings.close, onSelect: onClose ?? (() => {
4443
- }) }
4444
- };
4236
+ return /* @__PURE__ */ jsx17("span", { class: `${p13}-poweredby`, children: inner });
4445
4237
  }
4446
4238
 
4447
4239
  // src/ui/sidebar.tsx
4448
- import { Fragment as Fragment3, jsx as jsx19, jsxs as jsxs14 } from "preact/jsx-runtime";
4240
+ import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs13 } from "preact/jsx-runtime";
4449
4241
  function Sidebar(props2) {
4450
- const p28 = BRAND.cssPrefix;
4242
+ const p29 = BRAND.cssPrefix;
4451
4243
  const { site, blocks, strings, collapsed } = props2;
4452
4244
  const navigation = blocks?.navigation ?? [];
4453
4245
  const linkCards = blocks?.linkCards ?? [];
4454
4246
  const toggleLabel = collapsed ? strings.expandSidebar : strings.collapseSidebar;
4455
- return /* @__PURE__ */ jsxs14("aside", { class: `${p28}-sidebar`, "data-collapsed": collapsed ? "true" : "false", "data-testid": TID.sidebar, children: [
4456
- /* @__PURE__ */ jsxs14("div", { class: `${p28}-sidebar-header`, children: [
4457
- /* @__PURE__ */ jsx19(SidebarBrand, { site }),
4458
- /* @__PURE__ */ jsx19(
4247
+ return /* @__PURE__ */ jsxs13("aside", { class: `${p29}-sidebar`, "data-collapsed": collapsed ? "true" : "false", "data-testid": TID.sidebar, children: [
4248
+ /* @__PURE__ */ jsxs13("div", { class: `${p29}-sidebar-header`, children: [
4249
+ /* @__PURE__ */ jsx18(SidebarBrand, { site }),
4250
+ /* @__PURE__ */ jsx18(
4459
4251
  "button",
4460
4252
  {
4461
4253
  type: "button",
4462
- class: `${p28}-sidebar-toggle`,
4254
+ class: `${p29}-sidebar-toggle`,
4463
4255
  "aria-label": toggleLabel,
4464
4256
  "aria-expanded": collapsed ? "false" : "true",
4465
4257
  title: toggleLabel,
4466
4258
  onClick: props2.onToggleCollapsed,
4467
4259
  "data-testid": TID.sidebarToggle,
4468
- children: /* @__PURE__ */ jsx19(SidebarToggleIcon, { collapsed })
4260
+ children: /* @__PURE__ */ jsx18(SidebarToggleIcon, { collapsed })
4469
4261
  }
4470
4262
  )
4471
4263
  ] }),
4472
- collapsed ? null : /* @__PURE__ */ jsxs14(Fragment3, { children: [
4473
- navigation.length > 0 ? /* @__PURE__ */ jsx19("nav", { class: `${p28}-sidebar-section`, "data-section": "navigation", children: /* @__PURE__ */ jsx19(SidebarNav, { items: navigation }) }) : null,
4474
- linkCards.length > 0 ? /* @__PURE__ */ jsx19("div", { class: `${p28}-sidebar-section`, "data-section": "link-cards", children: /* @__PURE__ */ jsx19(SidebarCards, { items: linkCards }) }) : null,
4475
- props2.showConversations ? /* @__PURE__ */ jsx19("div", { class: `${p28}-sidebar-conversations`, children: /* @__PURE__ */ jsx19(
4264
+ collapsed ? null : /* @__PURE__ */ jsxs13(Fragment3, { children: [
4265
+ navigation.length > 0 ? /* @__PURE__ */ jsx18("nav", { class: `${p29}-sidebar-section`, "data-section": "navigation", children: /* @__PURE__ */ jsx18(SidebarNav, { items: navigation }) }) : null,
4266
+ linkCards.length > 0 ? /* @__PURE__ */ jsx18("div", { class: `${p29}-sidebar-section`, "data-section": "link-cards", children: /* @__PURE__ */ jsx18(SidebarCards, { items: linkCards }) }) : null,
4267
+ props2.showConversations ? /* @__PURE__ */ jsx18("div", { class: `${p29}-sidebar-conversations`, children: /* @__PURE__ */ jsx18(
4476
4268
  ConversationList,
4477
4269
  {
4478
4270
  transport: props2.transport,
@@ -4486,18 +4278,18 @@ function Sidebar(props2) {
4486
4278
  ] });
4487
4279
  }
4488
4280
  function SidebarBrand({ site }) {
4489
- const p28 = BRAND.cssPrefix;
4281
+ const p29 = BRAND.cssPrefix;
4490
4282
  if (site?.logo?.url) {
4491
4283
  const alt = site.logo.alt ?? site.title ?? "Logo";
4492
- return /* @__PURE__ */ jsxs14("picture", { children: [
4493
- site.logoDark?.url ? /* @__PURE__ */ jsx19("source", { srcset: site.logoDark.url, media: "(prefers-color-scheme: dark)" }) : null,
4494
- /* @__PURE__ */ jsx19("img", { class: `${p28}-sidebar-logo`, src: site.logo.url, alt })
4284
+ return /* @__PURE__ */ jsxs13("picture", { children: [
4285
+ site.logoDark?.url ? /* @__PURE__ */ jsx18("source", { srcset: site.logoDark.url, media: "(prefers-color-scheme: dark)" }) : null,
4286
+ /* @__PURE__ */ jsx18("img", { class: `${p29}-sidebar-logo`, src: site.logo.url, alt })
4495
4287
  ] });
4496
4288
  }
4497
- return /* @__PURE__ */ jsx19("div", { class: `${p28}-sidebar-title`, children: site?.title ?? BRAND.name });
4289
+ return /* @__PURE__ */ jsx18("div", { class: `${p29}-sidebar-title`, children: site?.title ?? BRAND.name });
4498
4290
  }
4499
4291
  function SidebarToggleIcon({ collapsed }) {
4500
- return /* @__PURE__ */ jsx19(
4292
+ return /* @__PURE__ */ jsx18(
4501
4293
  "svg",
4502
4294
  {
4503
4295
  width: "16",
@@ -4507,38 +4299,38 @@ function SidebarToggleIcon({ collapsed }) {
4507
4299
  stroke: "currentColor",
4508
4300
  "stroke-width": "2",
4509
4301
  "aria-hidden": "true",
4510
- children: collapsed ? /* @__PURE__ */ jsx19("polyline", { points: "9 6 15 12 9 18" }) : /* @__PURE__ */ jsx19("polyline", { points: "15 6 9 12 15 18" })
4302
+ children: collapsed ? /* @__PURE__ */ jsx18("polyline", { points: "9 6 15 12 9 18" }) : /* @__PURE__ */ jsx18("polyline", { points: "15 6 9 12 15 18" })
4511
4303
  }
4512
4304
  );
4513
4305
  }
4514
4306
  function SidebarNav({ items }) {
4515
- const p28 = BRAND.cssPrefix;
4516
- return /* @__PURE__ */ jsx19("ul", { class: `${p28}-sidebar-nav`, children: items.map((item) => /* @__PURE__ */ jsx19("li", { children: /* @__PURE__ */ jsxs14(
4307
+ const p29 = BRAND.cssPrefix;
4308
+ return /* @__PURE__ */ jsx18("ul", { class: `${p29}-sidebar-nav`, children: items.map((item) => /* @__PURE__ */ jsx18("li", { children: /* @__PURE__ */ jsxs13(
4517
4309
  "a",
4518
4310
  {
4519
- class: `${p28}-sidebar-nav-item`,
4311
+ class: `${p29}-sidebar-nav-item`,
4520
4312
  href: item.href,
4521
4313
  target: item.href ? "_blank" : void 0,
4522
4314
  rel: item.href ? "noreferrer" : void 0,
4523
4315
  children: [
4524
- item.icon ? /* @__PURE__ */ jsx19("span", { class: `${p28}-sidebar-nav-icon`, "data-icon": item.icon }) : null,
4525
- /* @__PURE__ */ jsx19("span", { class: `${p28}-sidebar-nav-label`, children: item.label })
4316
+ item.icon ? /* @__PURE__ */ jsx18("span", { class: `${p29}-sidebar-nav-icon`, "data-icon": item.icon }) : null,
4317
+ /* @__PURE__ */ jsx18("span", { class: `${p29}-sidebar-nav-label`, children: item.label })
4526
4318
  ]
4527
4319
  }
4528
4320
  ) }, item.id ?? item.label)) });
4529
4321
  }
4530
4322
  function SidebarCards({ items }) {
4531
- const p28 = BRAND.cssPrefix;
4532
- return /* @__PURE__ */ jsx19("div", { class: `${p28}-sidebar-cards`, children: items.map((item) => /* @__PURE__ */ jsxs14(
4323
+ const p29 = BRAND.cssPrefix;
4324
+ return /* @__PURE__ */ jsx18("div", { class: `${p29}-sidebar-cards`, children: items.map((item) => /* @__PURE__ */ jsxs13(
4533
4325
  "a",
4534
4326
  {
4535
- class: `${p28}-sidebar-card`,
4327
+ class: `${p29}-sidebar-card`,
4536
4328
  href: item.href,
4537
4329
  target: item.href ? "_blank" : void 0,
4538
4330
  rel: item.href ? "noreferrer" : void 0,
4539
4331
  children: [
4540
- /* @__PURE__ */ jsx19("div", { class: `${p28}-sidebar-card-label`, children: item.label }),
4541
- item.description ? /* @__PURE__ */ jsx19("div", { class: `${p28}-sidebar-card-desc`, children: item.description }) : null
4332
+ /* @__PURE__ */ jsx18("div", { class: `${p29}-sidebar-card-label`, children: item.label }),
4333
+ item.description ? /* @__PURE__ */ jsx18("div", { class: `${p29}-sidebar-card-desc`, children: item.description }) : null
4542
4334
  ]
4543
4335
  },
4544
4336
  item.id ?? item.label
@@ -4546,11 +4338,11 @@ function SidebarCards({ items }) {
4546
4338
  }
4547
4339
 
4548
4340
  // src/ui/page-shell.tsx
4549
- import { jsx as jsx20, jsxs as jsxs15 } from "preact/jsx-runtime";
4550
- var p13 = BRAND.cssPrefix;
4341
+ import { jsx as jsx19, jsxs as jsxs14 } from "preact/jsx-runtime";
4342
+ var p14 = BRAND.cssPrefix;
4551
4343
  function PageShell(props2) {
4552
- return /* @__PURE__ */ jsxs15("main", { class: `${p13}-page-shell`, "data-sidebar-collapsed": props2.sidebarCollapsed ? "true" : "false", children: [
4553
- /* @__PURE__ */ jsx20(
4344
+ return /* @__PURE__ */ jsxs14("main", { class: `${p14}-page-shell`, "data-sidebar-collapsed": props2.sidebarCollapsed ? "true" : "false", children: [
4345
+ /* @__PURE__ */ jsx19(
4554
4346
  Sidebar,
4555
4347
  {
4556
4348
  site: props2.site,
@@ -4565,7 +4357,7 @@ function PageShell(props2) {
4565
4357
  onToggleCollapsed: props2.onToggleSidebarCollapsed
4566
4358
  }
4567
4359
  ),
4568
- /* @__PURE__ */ jsx20("section", { class: `${p13}-page-chat`, "aria-label": "Chat", children: props2.children })
4360
+ /* @__PURE__ */ jsx19("section", { class: `${p14}-page-chat`, "aria-label": "Chat", children: props2.children })
4569
4361
  ] });
4570
4362
  }
4571
4363
 
@@ -4602,7 +4394,7 @@ var topScreen = (s) => activeStack(s).at(-1);
4602
4394
  var atTabRoot = (s) => activeStack(s).length === 0;
4603
4395
 
4604
4396
  // src/ui/messenger-home.tsx
4605
- import { useCallback as useCallback6, useEffect as useEffect15, useRef as useRef7 } from "preact/hooks";
4397
+ import { useCallback as useCallback4, useEffect as useEffect15, useRef as useRef7 } from "preact/hooks";
4606
4398
  import { useComputed as useComputed4 } from "@preact/signals";
4607
4399
 
4608
4400
  // src/ui/modules/messages.tsx
@@ -4615,80 +4407,80 @@ var chatLayout = {
4615
4407
  import { useEffect as useEffect11, useMemo as useMemo2, useState as useState6 } from "preact/hooks";
4616
4408
 
4617
4409
  // src/ui/back-header.tsx
4618
- import { jsx as jsx21, jsxs as jsxs16 } from "preact/jsx-runtime";
4619
- var p14 = BRAND.cssPrefix;
4620
- function TitleBar({ title, onClose, closeLabel }) {
4621
- return /* @__PURE__ */ jsxs16("header", { class: `${p14}-back-header`, "data-variant": "title", children: [
4622
- /* @__PURE__ */ jsx21("span", { class: `${p14}-back-spacer`, "aria-hidden": "true" }),
4623
- /* @__PURE__ */ jsx21("h1", { class: `${p14}-back-title`, children: title }),
4624
- onClose ? /* @__PURE__ */ jsx21("button", { type: "button", class: `${p14}-icon-btn`, onClick: onClose, "aria-label": closeLabel, title: closeLabel, children: /* @__PURE__ */ jsx21(CloseIcon, {}) }) : /* @__PURE__ */ jsx21("span", { class: `${p14}-back-spacer`, "aria-hidden": "true" })
4410
+ import { jsx as jsx20, jsxs as jsxs15 } from "preact/jsx-runtime";
4411
+ var p15 = BRAND.cssPrefix;
4412
+ function TitleBar({ title, actions }) {
4413
+ return /* @__PURE__ */ jsxs15("header", { class: `${p15}-back-header`, "data-variant": "title", children: [
4414
+ /* @__PURE__ */ jsx20("span", { class: `${p15}-back-spacer`, "aria-hidden": "true" }),
4415
+ /* @__PURE__ */ jsx20("h1", { class: `${p15}-back-title`, children: title }),
4416
+ actions ?? /* @__PURE__ */ jsx20("span", { class: `${p15}-back-spacer`, "aria-hidden": "true" })
4625
4417
  ] });
4626
4418
  }
4627
- function BackHeader({ title, backLabel, onBack, onClose, closeLabel, testid }) {
4628
- return /* @__PURE__ */ jsxs16("header", { class: `${p14}-back-header`, "data-testid": testid, children: [
4629
- /* @__PURE__ */ jsx21("button", { type: "button", class: `${p14}-icon-btn`, onClick: onBack, "aria-label": backLabel, title: backLabel, children: /* @__PURE__ */ jsx21(BackIcon, {}) }),
4630
- /* @__PURE__ */ jsx21("h1", { class: `${p14}-back-title`, children: title }),
4631
- onClose ? /* @__PURE__ */ jsx21("button", { type: "button", class: `${p14}-icon-btn`, onClick: onClose, "aria-label": closeLabel, title: closeLabel, children: /* @__PURE__ */ jsx21(CloseIcon, {}) }) : /* @__PURE__ */ jsx21("span", { class: `${p14}-back-spacer`, "aria-hidden": "true" })
4419
+ function BackHeader({ title, backLabel, onBack, actions, testid }) {
4420
+ return /* @__PURE__ */ jsxs15("header", { class: `${p15}-back-header`, "data-testid": testid, children: [
4421
+ /* @__PURE__ */ jsx20("button", { type: "button", class: `${p15}-icon-btn`, onClick: onBack, "aria-label": backLabel, title: backLabel, children: /* @__PURE__ */ jsx20(BackIcon, {}) }),
4422
+ /* @__PURE__ */ jsx20("h1", { class: `${p15}-back-title`, children: title }),
4423
+ actions ?? /* @__PURE__ */ jsx20("span", { class: `${p15}-back-spacer`, "aria-hidden": "true" })
4632
4424
  ] });
4633
4425
  }
4634
4426
 
4635
4427
  // src/ui/home-search.tsx
4636
- import { jsx as jsx22, jsxs as jsxs17 } from "preact/jsx-runtime";
4637
- var p15 = BRAND.cssPrefix;
4428
+ import { jsx as jsx21, jsxs as jsxs16 } from "preact/jsx-runtime";
4429
+ var p16 = BRAND.cssPrefix;
4638
4430
  function HomeSearchButton({ placeholder, onActivate }) {
4639
- return /* @__PURE__ */ jsxs17("button", { type: "button", class: `${p15}-home-search`, onClick: onActivate, "data-testid": TID.homeSearch, children: [
4640
- /* @__PURE__ */ jsx22("span", { class: `${p15}-home-search-text`, children: placeholder }),
4641
- /* @__PURE__ */ jsx22("span", { class: `${p15}-home-search-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx22(SearchIcon, {}) })
4431
+ return /* @__PURE__ */ jsxs16("button", { type: "button", class: `${p16}-home-search`, onClick: onActivate, "data-testid": TID.homeSearch, children: [
4432
+ /* @__PURE__ */ jsx21("span", { class: `${p16}-home-search-text`, children: placeholder }),
4433
+ /* @__PURE__ */ jsx21("span", { class: `${p16}-home-search-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx21(SearchIcon, {}) })
4642
4434
  ] });
4643
4435
  }
4644
4436
  function HelpSearchInput({ placeholder, value, onInput }) {
4645
- return /* @__PURE__ */ jsxs17("div", { class: `${p15}-home-search`, "data-input": "true", children: [
4646
- /* @__PURE__ */ jsx22(
4437
+ return /* @__PURE__ */ jsxs16("div", { class: `${p16}-home-search`, "data-input": "true", children: [
4438
+ /* @__PURE__ */ jsx21(
4647
4439
  "input",
4648
4440
  {
4649
4441
  type: "search",
4650
- class: `${p15}-home-search-input`,
4442
+ class: `${p16}-home-search-input`,
4651
4443
  placeholder,
4652
4444
  value,
4653
4445
  onInput: (e) => onInput(e.currentTarget.value),
4654
4446
  "data-testid": TID.helpSearch
4655
4447
  }
4656
4448
  ),
4657
- /* @__PURE__ */ jsx22("span", { class: `${p15}-home-search-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx22(SearchIcon, {}) })
4449
+ /* @__PURE__ */ jsx21("span", { class: `${p16}-home-search-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx21(SearchIcon, {}) })
4658
4450
  ] });
4659
4451
  }
4660
4452
 
4661
4453
  // src/ui/list-row.tsx
4662
- import { jsx as jsx23, jsxs as jsxs18 } from "preact/jsx-runtime";
4663
- var p16 = BRAND.cssPrefix;
4454
+ import { jsx as jsx22, jsxs as jsxs17 } from "preact/jsx-runtime";
4455
+ var p17 = BRAND.cssPrefix;
4664
4456
  function ListRow({ title, subtitle, onClick, testid }) {
4665
- return /* @__PURE__ */ jsxs18("button", { type: "button", class: `${p16}-list-row`, onClick, "data-testid": testid, children: [
4666
- /* @__PURE__ */ jsxs18("span", { class: `${p16}-list-row-body`, children: [
4667
- /* @__PURE__ */ jsx23("span", { class: `${p16}-list-row-title`, children: title }),
4668
- subtitle ? /* @__PURE__ */ jsx23("span", { class: `${p16}-list-row-sub`, children: subtitle }) : null
4457
+ return /* @__PURE__ */ jsxs17("button", { type: "button", class: `${p17}-list-row`, onClick, "data-testid": testid, children: [
4458
+ /* @__PURE__ */ jsxs17("span", { class: `${p17}-list-row-body`, children: [
4459
+ /* @__PURE__ */ jsx22("span", { class: `${p17}-list-row-title`, children: title }),
4460
+ subtitle ? /* @__PURE__ */ jsx22("span", { class: `${p17}-list-row-sub`, children: subtitle }) : null
4669
4461
  ] }),
4670
- /* @__PURE__ */ jsx23("span", { class: `${p16}-list-row-chevron`, "aria-hidden": "true", children: /* @__PURE__ */ jsx23(ChevronRightIcon, {}) })
4462
+ /* @__PURE__ */ jsx22("span", { class: `${p17}-list-row-chevron`, "aria-hidden": "true", children: /* @__PURE__ */ jsx22(ChevronRightIcon, {}) })
4671
4463
  ] });
4672
4464
  }
4673
4465
 
4674
4466
  // src/ui/module-state.tsx
4675
- import { jsx as jsx24, jsxs as jsxs19 } from "preact/jsx-runtime";
4676
- var p17 = BRAND.cssPrefix;
4467
+ import { jsx as jsx23, jsxs as jsxs18 } from "preact/jsx-runtime";
4468
+ var p18 = BRAND.cssPrefix;
4677
4469
  function ModuleState({
4678
4470
  tone = "info",
4679
4471
  message,
4680
4472
  onRetry,
4681
4473
  strings
4682
4474
  }) {
4683
- return /* @__PURE__ */ jsxs19("div", { class: `${p17}-module-empty`, role: tone === "error" ? "alert" : "status", "aria-live": "polite", children: [
4684
- /* @__PURE__ */ jsx24("span", { children: message }),
4685
- onRetry ? /* @__PURE__ */ jsx24("button", { type: "button", class: `${p17}-module-retry`, onClick: onRetry, children: strings.errorRetry }) : null
4475
+ return /* @__PURE__ */ jsxs18("div", { class: `${p18}-module-empty`, role: tone === "error" ? "alert" : "status", "aria-live": "polite", children: [
4476
+ /* @__PURE__ */ jsx23("span", { children: message }),
4477
+ onRetry ? /* @__PURE__ */ jsx23("button", { type: "button", class: `${p18}-module-retry`, onClick: onRetry, children: strings.errorRetry }) : null
4686
4478
  ] });
4687
4479
  }
4688
4480
 
4689
4481
  // src/ui/modules/help.tsx
4690
- import { jsx as jsx25, jsxs as jsxs20 } from "preact/jsx-runtime";
4691
- var p18 = BRAND.cssPrefix;
4482
+ import { jsx as jsx24, jsxs as jsxs19 } from "preact/jsx-runtime";
4483
+ var p19 = BRAND.cssPrefix;
4692
4484
  var log12 = logger.scope("help");
4693
4485
  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 });
4694
4486
  function groupByCategory(items) {
@@ -4717,7 +4509,7 @@ function fuzzySearch(items, query) {
4717
4509
  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);
4718
4510
  }
4719
4511
  function ArticleRow({ article, nav }) {
4720
- return /* @__PURE__ */ jsx25(
4512
+ return /* @__PURE__ */ jsx24(
4721
4513
  ListRow,
4722
4514
  {
4723
4515
  title: article.title,
@@ -4754,46 +4546,46 @@ function HelpRoot({ transport, strings, config, nav, panelProps }) {
4754
4546
  const results = useMemo2(() => fuzzySearch(items, query), [items, query]);
4755
4547
  function renderBody() {
4756
4548
  if (query.trim().length > 0) {
4757
- if (results.length === 0) return /* @__PURE__ */ jsx25(ModuleState, { message: strings.helpSearchEmpty, strings });
4758
- return /* @__PURE__ */ jsx25("div", { class: `${p18}-help-card`, children: results.map((a) => /* @__PURE__ */ jsx25(ArticleRow, { article: a, nav }, a.id)) });
4549
+ if (results.length === 0) return /* @__PURE__ */ jsx24(ModuleState, { message: strings.helpSearchEmpty, strings });
4550
+ return /* @__PURE__ */ jsx24("div", { class: `${p19}-help-card`, children: results.map((a) => /* @__PURE__ */ jsx24(ArticleRow, { article: a, nav }, a.id)) });
4759
4551
  }
4760
- if (state === "loading") return /* @__PURE__ */ jsx25(ModuleState, { message: strings.helpLoading, strings });
4552
+ if (state === "loading") return /* @__PURE__ */ jsx24(ModuleState, { message: strings.helpLoading, strings });
4761
4553
  if (state === "error") {
4762
- return /* @__PURE__ */ jsx25(ModuleState, { tone: "error", message: errorMsg, onRetry: () => setReloadKey((k) => k + 1), strings });
4554
+ return /* @__PURE__ */ jsx24(ModuleState, { tone: "error", message: errorMsg, onRetry: () => setReloadKey((k) => k + 1), strings });
4763
4555
  }
4764
- if (items.length === 0) return /* @__PURE__ */ jsx25(ModuleState, { message: strings.helpEmpty, strings });
4765
- return groupByCategory(items).map(([category, rows]) => /* @__PURE__ */ jsxs20("section", { class: `${p18}-help-group`, children: [
4766
- category ? /* @__PURE__ */ jsx25("h2", { class: `${p18}-help-section-title`, children: category }) : null,
4767
- /* @__PURE__ */ jsx25("div", { class: `${p18}-help-card`, children: rows.map((a) => /* @__PURE__ */ jsx25(ArticleRow, { article: a, nav }, a.id)) })
4556
+ if (items.length === 0) return /* @__PURE__ */ jsx24(ModuleState, { message: strings.helpEmpty, strings });
4557
+ return groupByCategory(items).map(([category, rows]) => /* @__PURE__ */ jsxs19("section", { class: `${p19}-help-group`, children: [
4558
+ category ? /* @__PURE__ */ jsx24("h2", { class: `${p19}-help-section-title`, children: category }) : null,
4559
+ /* @__PURE__ */ jsx24("div", { class: `${p19}-help-card`, children: rows.map((a) => /* @__PURE__ */ jsx24(ArticleRow, { article: a, nav }, a.id)) })
4768
4560
  ] }, category));
4769
4561
  }
4770
- return /* @__PURE__ */ jsxs20("div", { class: `${p18}-module`, children: [
4771
- /* @__PURE__ */ jsx25(TitleBar, { title: strings.helpTitle, onClose: panelProps.onClose, closeLabel: strings.close }),
4772
- /* @__PURE__ */ jsx25("div", { class: `${p18}-module-pad`, children: /* @__PURE__ */ jsx25(HelpSearchInput, { placeholder: strings.helpSearchPlaceholder, value: query, onInput: setQuery }) }),
4773
- /* @__PURE__ */ jsx25("div", { class: `${p18}-help-list`, children: renderBody() })
4562
+ return /* @__PURE__ */ jsxs19("div", { class: `${p19}-module`, children: [
4563
+ /* @__PURE__ */ jsx24(TitleBar, { title: strings.helpTitle, actions: /* @__PURE__ */ jsx24(HeaderActions, { panelProps, variant: "plain" }) }),
4564
+ /* @__PURE__ */ jsx24("div", { class: `${p19}-module-pad`, children: /* @__PURE__ */ jsx24(HelpSearchInput, { placeholder: strings.helpSearchPlaceholder, value: query, onInput: setQuery }) }),
4565
+ /* @__PURE__ */ jsx24("div", { class: `${p19}-help-list`, children: renderBody() })
4774
4566
  ] });
4775
4567
  }
4776
4568
  var helpLayout = {
4777
4569
  Icon: HelpIcon,
4778
- Root: (props2) => /* @__PURE__ */ jsx25(HelpRoot, { ...props2 })
4570
+ Root: (props2) => /* @__PURE__ */ jsx24(HelpRoot, { ...props2 })
4779
4571
  };
4780
4572
 
4781
4573
  // src/ui/modules/home.tsx
4782
4574
  import { useEffect as useEffect12, useState as useState7 } from "preact/hooks";
4783
4575
 
4784
4576
  // src/ui/home-card.tsx
4785
- import { jsx as jsx26 } from "preact/jsx-runtime";
4786
- var p19 = BRAND.cssPrefix;
4577
+ import { jsx as jsx25 } from "preact/jsx-runtime";
4578
+ var p20 = BRAND.cssPrefix;
4787
4579
  function HomeCard({ onClick, children, testid }) {
4788
4580
  if (onClick) {
4789
- return /* @__PURE__ */ jsx26("button", { type: "button", class: `${p19}-home-card`, "data-interactive": "true", onClick, "data-testid": testid, children });
4581
+ return /* @__PURE__ */ jsx25("button", { type: "button", class: `${p20}-home-card`, "data-interactive": "true", onClick, "data-testid": testid, children });
4790
4582
  }
4791
- return /* @__PURE__ */ jsx26("div", { class: `${p19}-home-card`, "data-testid": testid, children });
4583
+ return /* @__PURE__ */ jsx25("div", { class: `${p20}-home-card`, "data-testid": testid, children });
4792
4584
  }
4793
4585
 
4794
4586
  // src/ui/modules/home.tsx
4795
- import { Fragment as Fragment4, jsx as jsx27, jsxs as jsxs21 } from "preact/jsx-runtime";
4796
- var p20 = BRAND.cssPrefix;
4587
+ import { Fragment as Fragment4, jsx as jsx26, jsxs as jsxs20 } from "preact/jsx-runtime";
4588
+ var p21 = BRAND.cssPrefix;
4797
4589
  var log13 = logger.scope("home");
4798
4590
  function resolveGreeting(props2) {
4799
4591
  const name = props2.options.userContext?.name;
@@ -4830,59 +4622,49 @@ function HomeRoot(props2) {
4830
4622
  const avatars = config.userAvatars ?? [];
4831
4623
  const status = config.status;
4832
4624
  const contentTitle = config.contentBlockTitle ? moduleLabel(strings, config.contentBlockTitle) : strings.homeContentTitle;
4833
- return /* @__PURE__ */ jsx27("div", { class: `${p20}-module ${p20}-home`, "data-testid": TID.homeView, children: /* @__PURE__ */ jsxs21("div", { class: `${p20}-home-scroll`, children: [
4834
- /* @__PURE__ */ jsxs21("div", { class: `${p20}-home-hero`, children: [
4835
- /* @__PURE__ */ jsxs21("div", { class: `${p20}-home-hero-top`, children: [
4836
- config.brandName ? /* @__PURE__ */ jsx27("span", { class: `${p20}-home-brand`, "data-testid": TID.homeBrand, children: config.brandName }) : /* @__PURE__ */ jsx27("span", { class: `${p20}-home-brand-spacer`, "aria-hidden": "true" }),
4837
- /* @__PURE__ */ jsxs21("div", { class: `${p20}-home-hero-actions`, children: [
4838
- avatars.length > 0 ? /* @__PURE__ */ jsx27("div", { class: `${p20}-home-avatars`, children: avatars.map((a) => /* @__PURE__ */ jsx27("span", { class: `${p20}-home-avatar`, title: a.role ? `${a.name} \xB7 ${a.role}` : a.name, children: a.avatar ? /* @__PURE__ */ jsx27("img", { src: a.avatar, alt: "", loading: "lazy" }) : /* @__PURE__ */ jsx27("span", { children: initials(a.name) }) }, a.name)) }) : null,
4839
- panelProps.onClose ? /* @__PURE__ */ jsx27(
4840
- "button",
4841
- {
4842
- type: "button",
4843
- class: `${p20}-icon-btn ${p20}-home-close`,
4844
- onClick: panelProps.onClose,
4845
- "aria-label": strings.close,
4846
- title: strings.close,
4847
- children: /* @__PURE__ */ jsx27(CloseIcon, {})
4848
- }
4849
- ) : null
4625
+ return /* @__PURE__ */ jsx26("div", { class: `${p21}-module ${p21}-home`, "data-testid": TID.homeView, children: /* @__PURE__ */ jsxs20("div", { class: `${p21}-home-scroll`, children: [
4626
+ /* @__PURE__ */ jsxs20("div", { class: `${p21}-home-hero`, children: [
4627
+ /* @__PURE__ */ jsxs20("div", { class: `${p21}-home-hero-top`, children: [
4628
+ config.brandName ? /* @__PURE__ */ jsx26("span", { class: `${p21}-home-brand`, "data-testid": TID.homeBrand, children: config.brandName }) : /* @__PURE__ */ jsx26("span", { class: `${p21}-home-brand-spacer`, "aria-hidden": "true" }),
4629
+ /* @__PURE__ */ jsxs20("div", { class: `${p21}-home-hero-actions`, children: [
4630
+ avatars.length > 0 ? /* @__PURE__ */ jsx26("div", { class: `${p21}-home-avatars`, children: avatars.map((a) => /* @__PURE__ */ jsx26("span", { class: `${p21}-home-avatar`, title: a.role ? `${a.name} \xB7 ${a.role}` : a.name, children: a.avatar ? /* @__PURE__ */ jsx26("img", { src: a.avatar, alt: "", loading: "lazy" }) : /* @__PURE__ */ jsx26("span", { children: initials(a.name) }) }, a.name)) }) : null,
4631
+ /* @__PURE__ */ jsx26(HeaderActions, { panelProps, variant: "plain" })
4850
4632
  ] })
4851
4633
  ] }),
4852
- config.showGreeting !== false ? /* @__PURE__ */ jsxs21(Fragment4, { children: [
4853
- /* @__PURE__ */ jsx27("h1", { class: `${p20}-home-greeting`, "data-testid": TID.homeGreeting, children: greeting.title }),
4854
- greeting.subtitle ? /* @__PURE__ */ jsx27("p", { class: `${p20}-home-lead`, children: greeting.subtitle }) : null
4634
+ config.showGreeting !== false ? /* @__PURE__ */ jsxs20(Fragment4, { children: [
4635
+ /* @__PURE__ */ jsx26("h1", { class: `${p21}-home-greeting`, "data-testid": TID.homeGreeting, children: greeting.title }),
4636
+ greeting.subtitle ? /* @__PURE__ */ jsx26("p", { class: `${p21}-home-lead`, children: greeting.subtitle }) : null
4855
4637
  ] }) : null
4856
4638
  ] }),
4857
- /* @__PURE__ */ jsxs21("div", { class: `${p20}-home-cards`, children: [
4858
- config.showSearchBar !== false ? /* @__PURE__ */ jsx27(
4639
+ /* @__PURE__ */ jsxs20("div", { class: `${p21}-home-cards`, children: [
4640
+ config.showSearchBar !== false ? /* @__PURE__ */ jsx26(
4859
4641
  HomeSearchButton,
4860
4642
  {
4861
4643
  placeholder: strings.homeSearchPlaceholder,
4862
4644
  onActivate: () => nav.switchToLayout("help")
4863
4645
  }
4864
4646
  ) : null,
4865
- recent ? /* @__PURE__ */ jsx27(HomeCard, { onClick: () => nav.selectSession(recent.sessionId), testid: TID.homeRecent, children: /* @__PURE__ */ jsxs21("div", { class: `${p20}-home-recent-row`, "data-unread": (recent.unreadCount ?? 0) > 0 ? "true" : void 0, children: [
4866
- /* @__PURE__ */ jsx27("span", { class: `${p20}-home-recent-avatar`, "aria-hidden": "true", children: /* @__PURE__ */ jsx27(BubblesIcon, {}) }),
4867
- /* @__PURE__ */ jsxs21("span", { class: `${p20}-home-recent-body`, children: [
4868
- /* @__PURE__ */ jsx27("span", { class: `${p20}-home-recent-title`, children: recent.title }),
4869
- recent.preview ? /* @__PURE__ */ jsx27("span", { class: `${p20}-home-recent-preview`, children: recent.preview }) : null
4647
+ recent ? /* @__PURE__ */ jsx26(HomeCard, { onClick: () => nav.selectSession(recent.sessionId), testid: TID.homeRecent, children: /* @__PURE__ */ jsxs20("div", { class: `${p21}-home-recent-row`, "data-unread": (recent.unreadCount ?? 0) > 0 ? "true" : void 0, children: [
4648
+ /* @__PURE__ */ jsx26("span", { class: `${p21}-home-recent-avatar`, "aria-hidden": "true", children: /* @__PURE__ */ jsx26(BubblesIcon, {}) }),
4649
+ /* @__PURE__ */ jsxs20("span", { class: `${p21}-home-recent-body`, children: [
4650
+ /* @__PURE__ */ jsx26("span", { class: `${p21}-home-recent-title`, children: recent.title }),
4651
+ recent.preview ? /* @__PURE__ */ jsx26("span", { class: `${p21}-home-recent-preview`, children: recent.preview }) : null
4870
4652
  ] }),
4871
- (recent.unreadCount ?? 0) > 0 ? /* @__PURE__ */ jsx27("span", { class: `${p20}-home-recent-dot`, "aria-label": "Unread" }) : null
4653
+ (recent.unreadCount ?? 0) > 0 ? /* @__PURE__ */ jsx26("span", { class: `${p21}-home-recent-dot`, "aria-label": "Unread" }) : null
4872
4654
  ] }) }) : null,
4873
- status ? /* @__PURE__ */ jsx27(
4655
+ status ? /* @__PURE__ */ jsx26(
4874
4656
  HomeCard,
4875
4657
  {
4876
4658
  onClick: status.url ? () => nav.push({ kind: "iframe", url: status.url, title: status.text }) : void 0,
4877
- children: /* @__PURE__ */ jsxs21("div", { class: `${p20}-home-status`, "data-level": status.level ?? "operational", children: [
4878
- /* @__PURE__ */ jsx27("span", { class: `${p20}-home-status-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx27(StatusOkIcon, {}) }),
4879
- /* @__PURE__ */ jsx27("span", { class: `${p20}-home-status-text`, children: status.text })
4659
+ children: /* @__PURE__ */ jsxs20("div", { class: `${p21}-home-status`, "data-level": status.level ?? "operational", children: [
4660
+ /* @__PURE__ */ jsx26("span", { class: `${p21}-home-status-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx26(StatusOkIcon, {}) }),
4661
+ /* @__PURE__ */ jsx26("span", { class: `${p21}-home-status-text`, children: status.text })
4880
4662
  ] })
4881
4663
  }
4882
4664
  ) : null,
4883
- content.length > 0 ? /* @__PURE__ */ jsxs21("section", { class: `${p20}-home-content`, children: [
4884
- /* @__PURE__ */ jsx27("div", { class: `${p20}-home-content-title`, children: contentTitle }),
4885
- /* @__PURE__ */ jsx27("div", { class: `${p20}-home-content-list`, children: content.map((item) => /* @__PURE__ */ jsx27(
4665
+ content.length > 0 ? /* @__PURE__ */ jsxs20("section", { class: `${p21}-home-content`, children: [
4666
+ /* @__PURE__ */ jsx26("div", { class: `${p21}-home-content-title`, children: contentTitle }),
4667
+ /* @__PURE__ */ jsx26("div", { class: `${p21}-home-content-list`, children: content.map((item) => /* @__PURE__ */ jsx26(
4886
4668
  ListRow,
4887
4669
  {
4888
4670
  title: item.title,
@@ -4898,13 +4680,13 @@ function HomeRoot(props2) {
4898
4680
  }
4899
4681
  var homeLayout = {
4900
4682
  Icon: HomeIcon,
4901
- Root: (props2) => /* @__PURE__ */ jsx27(HomeRoot, { ...props2 })
4683
+ Root: (props2) => /* @__PURE__ */ jsx26(HomeRoot, { ...props2 })
4902
4684
  };
4903
4685
 
4904
4686
  // src/ui/modules/news.tsx
4905
4687
  import { useEffect as useEffect13, useState as useState8 } from "preact/hooks";
4906
- import { jsx as jsx28, jsxs as jsxs22 } from "preact/jsx-runtime";
4907
- var p21 = BRAND.cssPrefix;
4688
+ import { jsx as jsx27, jsxs as jsxs21 } from "preact/jsx-runtime";
4689
+ var p22 = BRAND.cssPrefix;
4908
4690
  var log14 = logger.scope("news");
4909
4691
  function NewsRoot({ transport, strings, config, nav, panelProps }) {
4910
4692
  const tags = config.contentTags;
@@ -4930,38 +4712,38 @@ function NewsRoot({ transport, strings, config, nav, panelProps }) {
4930
4712
  };
4931
4713
  }, [transport, tags, reloadKey]);
4932
4714
  function renderBody() {
4933
- if (state === "loading") return /* @__PURE__ */ jsx28(ModuleState, { message: strings.newsLoading, strings });
4715
+ if (state === "loading") return /* @__PURE__ */ jsx27(ModuleState, { message: strings.newsLoading, strings });
4934
4716
  if (state === "error") {
4935
- return /* @__PURE__ */ jsx28(ModuleState, { tone: "error", message: errorMsg, onRetry: () => setReloadKey((k) => k + 1), strings });
4717
+ return /* @__PURE__ */ jsx27(ModuleState, { tone: "error", message: errorMsg, onRetry: () => setReloadKey((k) => k + 1), strings });
4936
4718
  }
4937
- if (items.length === 0) return /* @__PURE__ */ jsx28(ModuleState, { message: strings.newsEmpty, strings });
4938
- return /* @__PURE__ */ jsx28("div", { class: `${p21}-news-list`, children: items.map((item) => /* @__PURE__ */ jsxs22(
4719
+ if (items.length === 0) return /* @__PURE__ */ jsx27(ModuleState, { message: strings.newsEmpty, strings });
4720
+ return /* @__PURE__ */ jsx27("div", { class: `${p22}-news-list`, children: items.map((item) => /* @__PURE__ */ jsxs21(
4939
4721
  "button",
4940
4722
  {
4941
4723
  type: "button",
4942
- class: `${p21}-news-card`,
4724
+ class: `${p22}-news-card`,
4943
4725
  onClick: () => nav.push({ kind: "content", id: item.id, title: item.title }),
4944
4726
  "data-testid": tid(TID.newsItem, item.id),
4945
4727
  children: [
4946
- item.image ? /* @__PURE__ */ jsx28("img", { class: `${p21}-news-hero`, src: item.image, alt: "", loading: "lazy" }) : null,
4947
- /* @__PURE__ */ jsxs22("span", { class: `${p21}-news-body`, children: [
4948
- item.tags && item.tags.length > 0 ? /* @__PURE__ */ jsx28("span", { class: `${p21}-news-tags`, children: item.tags.map((t) => /* @__PURE__ */ jsx28("span", { class: `${p21}-news-tag`, children: t }, t)) }) : null,
4949
- /* @__PURE__ */ jsx28("span", { class: `${p21}-news-title`, children: item.title }),
4950
- item.description ? /* @__PURE__ */ jsx28("span", { class: `${p21}-news-summary`, children: item.description }) : null
4728
+ item.image ? /* @__PURE__ */ jsx27("img", { class: `${p22}-news-hero`, src: item.image, alt: "", loading: "lazy" }) : null,
4729
+ /* @__PURE__ */ jsxs21("span", { class: `${p22}-news-body`, children: [
4730
+ item.tags && item.tags.length > 0 ? /* @__PURE__ */ jsx27("span", { class: `${p22}-news-tags`, children: item.tags.map((t) => /* @__PURE__ */ jsx27("span", { class: `${p22}-news-tag`, children: t }, t)) }) : null,
4731
+ /* @__PURE__ */ jsx27("span", { class: `${p22}-news-title`, children: item.title }),
4732
+ item.description ? /* @__PURE__ */ jsx27("span", { class: `${p22}-news-summary`, children: item.description }) : null
4951
4733
  ] })
4952
4734
  ]
4953
4735
  },
4954
4736
  item.id
4955
4737
  )) });
4956
4738
  }
4957
- return /* @__PURE__ */ jsxs22("div", { class: `${p21}-module`, children: [
4958
- /* @__PURE__ */ jsx28(TitleBar, { title: strings.newsTitle, onClose: panelProps.onClose, closeLabel: strings.close }),
4959
- /* @__PURE__ */ jsx28("div", { class: `${p21}-module-scroll`, children: renderBody() })
4739
+ return /* @__PURE__ */ jsxs21("div", { class: `${p22}-module`, children: [
4740
+ /* @__PURE__ */ jsx27(TitleBar, { title: strings.newsTitle, actions: /* @__PURE__ */ jsx27(HeaderActions, { panelProps, variant: "plain" }) }),
4741
+ /* @__PURE__ */ jsx27("div", { class: `${p22}-module-scroll`, children: renderBody() })
4960
4742
  ] });
4961
4743
  }
4962
4744
  var newsLayout = {
4963
4745
  Icon: NewsIcon,
4964
- Root: (props2) => /* @__PURE__ */ jsx28(NewsRoot, { ...props2 })
4746
+ Root: (props2) => /* @__PURE__ */ jsx27(NewsRoot, { ...props2 })
4965
4747
  };
4966
4748
 
4967
4749
  // src/ui/modules/registry.ts
@@ -4973,28 +4755,28 @@ var LAYOUTS = {
4973
4755
  };
4974
4756
 
4975
4757
  // src/ui/home-tab-bar.tsx
4976
- import { jsx as jsx29, jsxs as jsxs23 } from "preact/jsx-runtime";
4977
- var p22 = BRAND.cssPrefix;
4758
+ import { jsx as jsx28, jsxs as jsxs22 } from "preact/jsx-runtime";
4759
+ var p23 = BRAND.cssPrefix;
4978
4760
  function HomeTabBar({ modules, activeTab, strings, unreadCount, onSelect }) {
4979
- return /* @__PURE__ */ jsx29("nav", { class: `${p22}-tabbar`, role: "tablist", "aria-label": strings.panelTitle, children: modules.map((m) => {
4761
+ return /* @__PURE__ */ jsx28("nav", { class: `${p23}-tabbar`, role: "tablist", "aria-label": strings.panelTitle, children: modules.map((m) => {
4980
4762
  const Icon = LAYOUTS[m.layout].Icon;
4981
4763
  const selected = m.id === activeTab;
4982
4764
  const badge = m.layout === "chat" && unreadCount > 0 ? unreadCount > 9 ? "9+" : String(unreadCount) : null;
4983
- return /* @__PURE__ */ jsxs23(
4765
+ return /* @__PURE__ */ jsxs22(
4984
4766
  "button",
4985
4767
  {
4986
4768
  type: "button",
4987
4769
  role: "tab",
4988
4770
  "aria-selected": selected,
4989
- class: `${p22}-tab`,
4771
+ class: `${p23}-tab`,
4990
4772
  onClick: () => onSelect(m.id),
4991
4773
  "data-testid": tid(TID.tab, m.id),
4992
4774
  children: [
4993
- /* @__PURE__ */ jsxs23("span", { class: `${p22}-tab-icon`, "aria-hidden": "true", children: [
4994
- /* @__PURE__ */ jsx29(Icon, {}),
4995
- badge ? /* @__PURE__ */ jsx29("span", { class: `${p22}-tab-badge`, "data-testid": TID.tabBadge, children: badge }) : null
4775
+ /* @__PURE__ */ jsxs22("span", { class: `${p23}-tab-icon`, "aria-hidden": "true", children: [
4776
+ /* @__PURE__ */ jsx28(Icon, {}),
4777
+ badge ? /* @__PURE__ */ jsx28("span", { class: `${p23}-tab-badge`, "data-testid": TID.tabBadge, children: badge }) : null
4996
4778
  ] }),
4997
- /* @__PURE__ */ jsx29("span", { class: `${p22}-tab-label`, children: moduleLabel(strings, m.label) })
4779
+ /* @__PURE__ */ jsx28("span", { class: `${p23}-tab-label`, children: moduleLabel(strings, m.label) })
4998
4780
  ]
4999
4781
  },
5000
4782
  m.id
@@ -5003,25 +4785,24 @@ function HomeTabBar({ modules, activeTab, strings, unreadCount, onSelect }) {
5003
4785
  }
5004
4786
 
5005
4787
  // src/ui/iframe-view.tsx
5006
- import { jsx as jsx30, jsxs as jsxs24 } from "preact/jsx-runtime";
5007
- var p23 = BRAND.cssPrefix;
4788
+ import { jsx as jsx29, jsxs as jsxs23 } from "preact/jsx-runtime";
4789
+ var p24 = BRAND.cssPrefix;
5008
4790
  var SANDBOX = "allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";
5009
- function IframeView({ url, title, strings, onBack, onClose }) {
5010
- return /* @__PURE__ */ jsxs24("div", { class: `${p23}-module`, children: [
5011
- /* @__PURE__ */ jsx30(
4791
+ function IframeView({ url, title, strings, onBack, actions }) {
4792
+ return /* @__PURE__ */ jsxs23("div", { class: `${p24}-module`, children: [
4793
+ /* @__PURE__ */ jsx29(
5012
4794
  BackHeader,
5013
4795
  {
5014
4796
  title: title || strings.moduleBack,
5015
4797
  backLabel: strings.moduleBack,
5016
4798
  onBack,
5017
- onClose,
5018
- closeLabel: strings.close
4799
+ actions
5019
4800
  }
5020
4801
  ),
5021
- /* @__PURE__ */ jsx30(
4802
+ /* @__PURE__ */ jsx29(
5022
4803
  "iframe",
5023
4804
  {
5024
- class: `${p23}-content-frame`,
4805
+ class: `${p24}-content-frame`,
5025
4806
  src: url,
5026
4807
  title: title || "content",
5027
4808
  sandbox: SANDBOX,
@@ -5034,15 +4815,15 @@ function IframeView({ url, title, strings, onBack, onClose }) {
5034
4815
  }
5035
4816
 
5036
4817
  // src/ui/content-view.tsx
5037
- import { useCallback as useCallback5, useEffect as useEffect14, useState as useState9 } from "preact/hooks";
5038
- import { jsx as jsx31, jsxs as jsxs25 } from "preact/jsx-runtime";
5039
- var p24 = BRAND.cssPrefix;
4818
+ import { useCallback as useCallback3, useEffect as useEffect14, useState as useState9 } from "preact/hooks";
4819
+ import { jsx as jsx30, jsxs as jsxs24 } from "preact/jsx-runtime";
4820
+ var p25 = BRAND.cssPrefix;
5040
4821
  var log15 = logger.scope("content");
5041
- function ContentView({ id, title, transport, strings, onBack, onClose }) {
4822
+ function ContentView({ id, title, transport, strings, onBack, actions }) {
5042
4823
  const [item, setItem] = useState9(null);
5043
4824
  const [failed, setFailed] = useState9(false);
5044
4825
  const [reloadKey, setReloadKey] = useState9(0);
5045
- const retry = useCallback5(() => {
4826
+ const retry = useCallback3(() => {
5046
4827
  setFailed(false);
5047
4828
  setItem(null);
5048
4829
  setReloadKey((k) => k + 1);
@@ -5064,34 +4845,33 @@ function ContentView({ id, title, transport, strings, onBack, onClose }) {
5064
4845
  };
5065
4846
  }, [transport, id, reloadKey]);
5066
4847
  function renderBody() {
5067
- if (failed) return /* @__PURE__ */ jsx31(ModuleState, { tone: "error", message: strings.errorGeneric, onRetry: retry, strings });
5068
- if (item === null) return /* @__PURE__ */ jsx31(ModuleState, { message: strings.contentLoading, strings });
5069
- return /* @__PURE__ */ jsxs25("article", { class: `${p24}-content`, "data-testid": TID.contentView, children: [
5070
- item.image ? /* @__PURE__ */ jsx31("img", { class: `${p24}-content-hero`, src: item.image, alt: "", loading: "lazy" }) : null,
5071
- item.description ? /* @__PURE__ */ jsx31("p", { class: `${p24}-content-subtitle`, children: item.description }) : null,
5072
- item.tags && item.tags.length > 0 ? /* @__PURE__ */ jsx31("span", { class: `${p24}-news-tags`, children: item.tags.map((t) => /* @__PURE__ */ jsx31("span", { class: `${p24}-news-tag`, children: t }, t)) }) : null,
5073
- /* @__PURE__ */ jsx31(StaticMarkdown, { text: item.content ?? "" })
4848
+ if (failed) return /* @__PURE__ */ jsx30(ModuleState, { tone: "error", message: strings.errorGeneric, onRetry: retry, strings });
4849
+ if (item === null) return /* @__PURE__ */ jsx30(ModuleState, { message: strings.contentLoading, strings });
4850
+ return /* @__PURE__ */ jsxs24("article", { class: `${p25}-content`, "data-testid": TID.contentView, children: [
4851
+ item.image ? /* @__PURE__ */ jsx30("img", { class: `${p25}-content-hero`, src: item.image, alt: "", loading: "lazy" }) : null,
4852
+ item.description ? /* @__PURE__ */ jsx30("p", { class: `${p25}-content-subtitle`, children: item.description }) : null,
4853
+ item.tags && item.tags.length > 0 ? /* @__PURE__ */ jsx30("span", { class: `${p25}-news-tags`, children: item.tags.map((t) => /* @__PURE__ */ jsx30("span", { class: `${p25}-news-tag`, children: t }, t)) }) : null,
4854
+ /* @__PURE__ */ jsx30(StaticMarkdown, { text: item.content ?? "" })
5074
4855
  ] });
5075
4856
  }
5076
- return /* @__PURE__ */ jsxs25("div", { class: `${p24}-module`, children: [
5077
- /* @__PURE__ */ jsx31(
4857
+ return /* @__PURE__ */ jsxs24("div", { class: `${p25}-module`, children: [
4858
+ /* @__PURE__ */ jsx30(
5078
4859
  BackHeader,
5079
4860
  {
5080
4861
  title: item?.title || title || strings.moduleBack,
5081
4862
  backLabel: strings.moduleBack,
5082
4863
  onBack,
5083
- onClose,
5084
- closeLabel: strings.close,
4864
+ actions,
5085
4865
  testid: TID.backHeader
5086
4866
  }
5087
4867
  ),
5088
- /* @__PURE__ */ jsx31("div", { class: `${p24}-module-scroll`, "data-testid": TID.contentScroll, children: renderBody() })
4868
+ /* @__PURE__ */ jsx30("div", { class: `${p25}-module-scroll`, "data-testid": TID.contentScroll, children: renderBody() })
5089
4869
  ] });
5090
4870
  }
5091
4871
 
5092
4872
  // src/ui/messenger-home.tsx
5093
- import { jsx as jsx32, jsxs as jsxs26 } from "preact/jsx-runtime";
5094
- var p25 = BRAND.cssPrefix;
4873
+ import { jsx as jsx31, jsxs as jsxs25 } from "preact/jsx-runtime";
4874
+ var p26 = BRAND.cssPrefix;
5095
4875
  function MessengerHome({
5096
4876
  panelProps,
5097
4877
  enabledModules,
@@ -5118,7 +4898,7 @@ function MessengerHome({
5118
4898
  };
5119
4899
  }, [panelProps.onClose]);
5120
4900
  const composerAttachApiRef = useRef7(null);
5121
- const onDropItems = useCallback6((items) => {
4901
+ const onDropItems = useCallback4((items) => {
5122
4902
  composerAttachApiRef.current?.attachFromDrop(items);
5123
4903
  }, []);
5124
4904
  const { visible: dragOver } = useFileDrop({ containerRef, onDrop: onDropItems });
@@ -5159,11 +4939,12 @@ function MessengerHome({
5159
4939
  nav: moduleNav,
5160
4940
  panelProps
5161
4941
  });
4942
+ const plainActions = /* @__PURE__ */ jsx31(HeaderActions, { panelProps, variant: "plain" });
5162
4943
  let body;
5163
4944
  if (top?.kind === "iframe") {
5164
- body = /* @__PURE__ */ jsx32(IframeView, { url: top.url, title: top.title, strings, onBack: nav.pop, onClose: panelProps.onClose });
4945
+ body = /* @__PURE__ */ jsx31(IframeView, { url: top.url, title: top.title, strings, onBack: nav.pop, actions: plainActions });
5165
4946
  } else if (top?.kind === "content") {
5166
- body = /* @__PURE__ */ jsx32(
4947
+ body = /* @__PURE__ */ jsx31(
5167
4948
  ContentView,
5168
4949
  {
5169
4950
  id: top.id,
@@ -5171,11 +4952,11 @@ function MessengerHome({
5171
4952
  transport: panelProps.transport,
5172
4953
  strings,
5173
4954
  onBack: nav.pop,
5174
- onClose: panelProps.onClose
4955
+ actions: plainActions
5175
4956
  }
5176
4957
  );
5177
4958
  } else if (activeModule?.layout === "chat") {
5178
- body = /* @__PURE__ */ jsx32(
4959
+ body = /* @__PURE__ */ jsx31(
5179
4960
  PanelContent,
5180
4961
  {
5181
4962
  ...panelProps,
@@ -5186,23 +4967,23 @@ function MessengerHome({
5186
4967
  );
5187
4968
  } else if (activeModule) {
5188
4969
  const Root = LAYOUTS[activeModule.layout].Root;
5189
- body = Root ? /* @__PURE__ */ jsx32(Root, { ...screenProps(activeModule) }, activeModule.id) : null;
4970
+ body = Root ? /* @__PURE__ */ jsx31(Root, { ...screenProps(activeModule) }, activeModule.id) : null;
5190
4971
  } else {
5191
4972
  body = null;
5192
4973
  }
5193
- return /* @__PURE__ */ jsxs26(
4974
+ return /* @__PURE__ */ jsxs25(
5194
4975
  "div",
5195
4976
  {
5196
4977
  ref: containerRef,
5197
- class: `${p25}-panel ${p25}-messenger`,
4978
+ class: `${p26}-panel ${p26}-messenger`,
5198
4979
  role: "dialog",
5199
4980
  "aria-modal": "false",
5200
4981
  "aria-label": strings.panelTitle,
5201
4982
  style: { position: "relative" },
5202
4983
  "data-testid": TID.messengerHome,
5203
4984
  children: [
5204
- /* @__PURE__ */ jsx32("div", { class: `${p25}-messenger-body`, children: body }),
5205
- showTabBar ? /* @__PURE__ */ jsx32(
4985
+ /* @__PURE__ */ jsx31("div", { class: `${p26}-messenger-body`, children: body }),
4986
+ showTabBar ? /* @__PURE__ */ jsx31(
5206
4987
  HomeTabBar,
5207
4988
  {
5208
4989
  modules: enabledModules,
@@ -5212,8 +4993,8 @@ function MessengerHome({
5212
4993
  onSelect: nav.switchTab
5213
4994
  }
5214
4995
  ) : null,
5215
- /* @__PURE__ */ jsx32(PoweredByBar, { poweredBy: options.poweredBy }),
5216
- options.size.resize?.enabled && !(activeModule?.layout === "chat" && !top) ? /* @__PURE__ */ jsx32(
4996
+ /* @__PURE__ */ jsx31(PoweredByBar, { poweredBy: options.poweredBy }),
4997
+ options.size.resize?.enabled && !(activeModule?.layout === "chat" && !top) ? /* @__PURE__ */ jsx31(
5217
4998
  ResizeGrip,
5218
4999
  {
5219
5000
  panelEl: containerRef.current,
@@ -5230,29 +5011,29 @@ function MessengerHome({
5230
5011
  }
5231
5012
 
5232
5013
  // src/ui/modules-empty.tsx
5233
- import { jsx as jsx33, jsxs as jsxs27 } from "preact/jsx-runtime";
5234
- var p26 = BRAND.cssPrefix;
5014
+ import { jsx as jsx32, jsxs as jsxs26 } from "preact/jsx-runtime";
5015
+ var p27 = BRAND.cssPrefix;
5235
5016
  function ModulesEmpty({ strings, onClose }) {
5236
- return /* @__PURE__ */ jsxs27(
5017
+ return /* @__PURE__ */ jsxs26(
5237
5018
  "div",
5238
5019
  {
5239
- class: `${p26}-panel ${p26}-modules-empty`,
5020
+ class: `${p27}-panel ${p27}-modules-empty`,
5240
5021
  role: "dialog",
5241
5022
  "aria-label": strings.panelTitle,
5242
5023
  "data-testid": TID.modulesEmpty,
5243
5024
  children: [
5244
- onClose ? /* @__PURE__ */ jsx33(
5025
+ onClose ? /* @__PURE__ */ jsx32(
5245
5026
  "button",
5246
5027
  {
5247
5028
  type: "button",
5248
- class: `${p26}-icon-btn ${p26}-modules-empty-close`,
5029
+ class: `${p27}-icon-btn ${p27}-modules-empty-close`,
5249
5030
  onClick: onClose,
5250
5031
  "aria-label": strings.close,
5251
5032
  title: strings.close,
5252
- children: /* @__PURE__ */ jsx33(CloseIcon, {})
5033
+ children: /* @__PURE__ */ jsx32(CloseIcon, {})
5253
5034
  }
5254
5035
  ) : null,
5255
- /* @__PURE__ */ jsx33("p", { class: `${p26}-modules-empty-text`, children: strings.modulesEmpty })
5036
+ /* @__PURE__ */ jsx32("p", { class: `${p27}-modules-empty-text`, children: strings.modulesEmpty })
5256
5037
  ]
5257
5038
  }
5258
5039
  );
@@ -5307,7 +5088,7 @@ function animateTypewriter(msg, text, charsPerSecond, abort) {
5307
5088
  }
5308
5089
 
5309
5090
  // src/ui/use-launcher-callout.ts
5310
- import { useCallback as useCallback7, useEffect as useEffect16, useState as useState10 } from "preact/hooks";
5091
+ import { useCallback as useCallback5, useEffect as useEffect16, useState as useState10 } from "preact/hooks";
5311
5092
  function useLauncherCallout({ callout, persistence }) {
5312
5093
  const textKey = callout?.text ?? "";
5313
5094
  const persistent = callout?.persistent ?? true;
@@ -5315,7 +5096,7 @@ function useLauncherCallout({ callout, persistence }) {
5315
5096
  useEffect16(() => {
5316
5097
  setDismissed(persistent ? false : persistence.loadCalloutDismissed(textKey));
5317
5098
  }, [textKey, persistent, persistence]);
5318
- const dismissCallout = useCallback7(() => {
5099
+ const dismissCallout = useCallback5(() => {
5319
5100
  setDismissed(true);
5320
5101
  if (!persistent) persistence.saveCalloutDismissed(textKey);
5321
5102
  }, [persistence, textKey, persistent]);
@@ -5323,9 +5104,9 @@ function useLauncherCallout({ callout, persistence }) {
5323
5104
  }
5324
5105
 
5325
5106
  // src/ui/app.tsx
5326
- import { jsx as jsx34, jsxs as jsxs28 } from "preact/jsx-runtime";
5107
+ import { jsx as jsx33, jsxs as jsxs27 } from "preact/jsx-runtime";
5327
5108
  var log16 = logger.scope("app");
5328
- var p27 = BRAND.cssPrefix;
5109
+ var p28 = BRAND.cssPrefix;
5329
5110
  function App({ options, hostElement, bus }) {
5330
5111
  const [persistence] = useState11(() => createPersistence(options.widgetId, options.storage));
5331
5112
  const [visitorId, setVisitorId] = useState11(() => persistence.getVisitorId());
@@ -5369,7 +5150,7 @@ function App({ options, hostElement, bus }) {
5369
5150
  persistence
5370
5151
  });
5371
5152
  const calloutPersistent = options.launcher.callout?.persistent ?? true;
5372
- const dismissCallout = useCallback8(() => {
5153
+ const dismissCallout = useCallback6(() => {
5373
5154
  log16.info("calloutDismiss");
5374
5155
  bus.emit("calloutDismiss", void 0);
5375
5156
  dismissCalloutRaw();
@@ -5399,7 +5180,7 @@ function App({ options, hostElement, bus }) {
5399
5180
  );
5400
5181
  const [reducer] = useState11(() => new StreamReducer(messagesSig));
5401
5182
  const [feedback] = useState11(() => new FeedbackBus(options.sound, options.haptics));
5402
- const patchAndSync = useCallback8(
5183
+ const patchAndSync = useCallback6(
5403
5184
  (patch) => {
5404
5185
  persistence.patchUserPrefs(patch);
5405
5186
  transport.saveUserPrefs(persistence.loadUserPrefs()).catch((err) => {
@@ -5459,7 +5240,7 @@ function App({ options, hostElement, bus }) {
5459
5240
  }
5460
5241
  homeNav.reset(landingTab());
5461
5242
  }, [sessionReady]);
5462
- const playWelcome = useCallback8(
5243
+ const playWelcome = useCallback6(
5463
5244
  (welcomeMessages) => {
5464
5245
  if (!welcomeMessages || welcomeMessages.length === 0) return;
5465
5246
  const { animation, speed } = options.welcome;
@@ -5477,7 +5258,7 @@ function App({ options, hostElement, bus }) {
5477
5258
  [messagesSig, options.welcome]
5478
5259
  );
5479
5260
  const connectGenRef = useRef8(0);
5480
- const runStartSession = useCallback8(
5261
+ const runStartSession = useCallback6(
5481
5262
  async ({ newConversation }) => {
5482
5263
  const myGen = ++connectGenRef.current;
5483
5264
  const isStale = () => myGen !== connectGenRef.current;
@@ -5571,7 +5352,7 @@ function App({ options, hostElement, bus }) {
5571
5352
  useEffect17(() => {
5572
5353
  transport.setContext(options.userContext, toWirePageContext(options.pageContext));
5573
5354
  }, [transport, userSig, pageSig]);
5574
- const runResume = useCallback8(
5355
+ const runResume = useCallback6(
5575
5356
  async (handle) => {
5576
5357
  let bubble = null;
5577
5358
  try {
@@ -5658,7 +5439,7 @@ function App({ options, hostElement, bus }) {
5658
5439
  document.addEventListener("keydown", onKey);
5659
5440
  return () => document.removeEventListener("keydown", onKey);
5660
5441
  }, [isOpen, options.mode]);
5661
- const handleSend = useCallback8(
5442
+ const handleSend = useCallback6(
5662
5443
  async (text, attachments) => {
5663
5444
  log16.info("send", { textLen: text.length, attachments: attachments.length, streaming });
5664
5445
  if (streaming) return;
@@ -5733,18 +5514,18 @@ function App({ options, hostElement, bus }) {
5733
5514
  visitorId
5734
5515
  ]
5735
5516
  );
5736
- const handleStop = useCallback8(() => {
5517
+ const handleStop = useCallback6(() => {
5737
5518
  log16.info("stop");
5738
5519
  bus.emit("stop", void 0);
5739
5520
  activeCancel?.();
5740
5521
  }, [activeCancel, bus]);
5741
- const handleSoundToggle = useCallback8(() => {
5522
+ const handleSoundToggle = useCallback6(() => {
5742
5523
  feedback.toggleMuted();
5743
5524
  const muted = feedback.mutedSig.value;
5744
5525
  log16.info("soundToggle", { muted });
5745
5526
  bus.emit("soundToggle", { muted });
5746
5527
  }, [feedback, bus]);
5747
- const handleClose = useCallback8(() => {
5528
+ const handleClose = useCallback6(() => {
5748
5529
  if (resolveCloseAction(options.mode, panelSize) === "exit-fullscreen") {
5749
5530
  log16.info("close \u2192 exit-fullscreen", { mode: options.mode });
5750
5531
  setPanelSize("normal");
@@ -5757,7 +5538,7 @@ function App({ options, hostElement, bus }) {
5757
5538
  bus.emit("close", void 0);
5758
5539
  options.onClose?.();
5759
5540
  }, [bus, options, persistence, panelSize]);
5760
- const refreshUnread = useCallback8(() => {
5541
+ const refreshUnread = useCallback6(() => {
5761
5542
  if (!options.modules.list.some((m) => m.layout === "chat")) return;
5762
5543
  transport.listSessions({ limit: 50 }).then((res) => {
5763
5544
  unreadCountSig.value = res.sessions.reduce((sum, c) => sum + (c.unreadCount ?? 0), 0);
@@ -5769,7 +5550,7 @@ function App({ options, hostElement, bus }) {
5769
5550
  unreadSeeded.current = true;
5770
5551
  refreshUnread();
5771
5552
  }, [sessionReady, refreshUnread]);
5772
- const handleOpen = useCallback8(() => {
5553
+ const handleOpen = useCallback6(() => {
5773
5554
  log16.info("open", { mode: options.mode });
5774
5555
  feedback.unlock();
5775
5556
  setLauncherLeaving(true);
@@ -5781,7 +5562,7 @@ function App({ options, hostElement, bus }) {
5781
5562
  bus.emit("open", void 0);
5782
5563
  options.onOpen?.();
5783
5564
  }, [bus, options, feedback, persistence, calloutDismissed, calloutPersistent, dismissCallout, refreshUnread]);
5784
- const handleClear = useCallback8(() => {
5565
+ const handleClear = useCallback6(() => {
5785
5566
  log16.info("clear \u2192 new conversation", { wasStreaming: streaming });
5786
5567
  bus.emit("clear", void 0);
5787
5568
  if (streaming) activeCancel?.();
@@ -5792,27 +5573,27 @@ function App({ options, hostElement, bus }) {
5792
5573
  setCanSend(true);
5793
5574
  void runStartSession({ newConversation: true });
5794
5575
  }, [streaming, activeCancel, messagesSig, sessionIdSig, persistence, runStartSession, bus]);
5795
- const handleNewChat = useCallback8(() => {
5576
+ const handleNewChat = useCallback6(() => {
5796
5577
  handleClear();
5797
5578
  setView("chat");
5798
5579
  const chatId = options.modules.list.find((m) => m.layout === "chat")?.id;
5799
5580
  if (chatId) homeNav.switchTab(chatId);
5800
5581
  }, [handleClear, homeNav, options]);
5801
- const handleExpand = useCallback8(() => {
5582
+ const handleExpand = useCallback6(() => {
5802
5583
  const nextSize = panelSize === "expanded" ? "normal" : "expanded";
5803
5584
  log16.info("expand", { from: panelSize, expanded: nextSize === "expanded" });
5804
5585
  setPanelSize(nextSize);
5805
5586
  persistence.savePanelSize(nextSize);
5806
5587
  bus.emit("expand", nextSize === "expanded");
5807
5588
  }, [bus, panelSize, persistence]);
5808
- const handleFullscreen = useCallback8(() => {
5589
+ const handleFullscreen = useCallback6(() => {
5809
5590
  const nextSize = panelSize === "fullscreen" ? "normal" : "fullscreen";
5810
5591
  log16.info("fullscreen", { from: panelSize, fullscreen: nextSize === "fullscreen" });
5811
5592
  setPanelSize(nextSize);
5812
5593
  persistence.savePanelSize(nextSize);
5813
5594
  bus.emit("fullscreen", nextSize === "fullscreen");
5814
5595
  }, [bus, panelSize, persistence]);
5815
- const handlePopOut = useCallback8(() => {
5596
+ const handlePopOut = useCallback6(() => {
5816
5597
  if (!options.popOutUrl) return;
5817
5598
  const url = new URL(options.popOutUrl);
5818
5599
  if (sessionIdSig.value) url.searchParams.set("chat", sessionIdSig.value);
@@ -5821,7 +5602,7 @@ function App({ options, hostElement, bus }) {
5821
5602
  window.open(url.toString(), "_blank", "noopener,noreferrer");
5822
5603
  bus.emit("popOut", void 0);
5823
5604
  }, [bus, sessionIdSig, options.popOutUrl, options.widgetId]);
5824
- const handleToggleHistory = useCallback8(() => {
5605
+ const handleToggleHistory = useCallback6(() => {
5825
5606
  setView((v) => {
5826
5607
  const next = v === "history" ? "chat" : "history";
5827
5608
  log16.info("toggleHistory", { view: next });
@@ -5829,7 +5610,7 @@ function App({ options, hostElement, bus }) {
5829
5610
  return next;
5830
5611
  });
5831
5612
  }, [bus]);
5832
- const handleLocaleChange = useCallback8(
5613
+ const handleLocaleChange = useCallback6(
5833
5614
  (locale) => {
5834
5615
  log16.info("localeChange", { locale });
5835
5616
  setActiveLocale(locale);
@@ -5838,7 +5619,7 @@ function App({ options, hostElement, bus }) {
5838
5619
  },
5839
5620
  [patchAndSync, bus]
5840
5621
  );
5841
- const handleThemeChange = useCallback8(
5622
+ const handleThemeChange = useCallback6(
5842
5623
  (mode) => {
5843
5624
  log16.info("themeChange", { mode });
5844
5625
  setActiveThemeMode(mode);
@@ -5848,7 +5629,7 @@ function App({ options, hostElement, bus }) {
5848
5629
  },
5849
5630
  [hostElement, patchAndSync, bus]
5850
5631
  );
5851
- const handleToggleSidebarCollapsed = useCallback8(() => {
5632
+ const handleToggleSidebarCollapsed = useCallback6(() => {
5852
5633
  setSidebarCollapsed((prev) => {
5853
5634
  const next = !prev;
5854
5635
  log16.info("sidebarToggle", { collapsed: next });
@@ -5857,7 +5638,7 @@ function App({ options, hostElement, bus }) {
5857
5638
  return next;
5858
5639
  });
5859
5640
  }, [persistence, bus]);
5860
- const handleWidgetSizeChange = useCallback8(
5641
+ const handleWidgetSizeChange = useCallback6(
5861
5642
  (size) => {
5862
5643
  log16.info("resize", size);
5863
5644
  patchAndSync({ widgetSize: size });
@@ -5865,7 +5646,7 @@ function App({ options, hostElement, bus }) {
5865
5646
  },
5866
5647
  [patchAndSync, bus]
5867
5648
  );
5868
- const handleSelectHistoryChat = useCallback8(
5649
+ const handleSelectHistoryChat = useCallback6(
5869
5650
  async (targetChatId) => {
5870
5651
  log16.info("selectChat", { sessionId: targetChatId });
5871
5652
  bus.emit("selectChat", { sessionId: targetChatId });
@@ -5947,12 +5728,12 @@ function App({ options, hostElement, bus }) {
5947
5728
  const renderSurface = (size) => {
5948
5729
  const closeable = isActionVisible("close", effectiveOptions.mode, size);
5949
5730
  if (enabledModules.length === 0) {
5950
- return /* @__PURE__ */ jsx34(ModulesEmpty, { strings: effectiveOptions.strings, onClose: closeable ? handleClose : void 0 });
5731
+ return /* @__PURE__ */ jsx33(ModulesEmpty, { strings: effectiveOptions.strings, onClose: closeable ? handleClose : void 0 });
5951
5732
  }
5952
5733
  if (enabledModules.length === 1 && enabledModules[0]?.layout === "chat") {
5953
- return /* @__PURE__ */ jsx34(Panel, { ...panelProps, panelSize: size });
5734
+ return /* @__PURE__ */ jsx33(Panel, { ...panelProps, panelSize: size });
5954
5735
  }
5955
- return /* @__PURE__ */ jsx34(
5736
+ return /* @__PURE__ */ jsx33(
5956
5737
  MessengerHome,
5957
5738
  {
5958
5739
  panelProps: { ...panelProps, panelSize: size, onClose: closeable ? handleClose : void 0 },
@@ -5970,7 +5751,7 @@ function App({ options, hostElement, bus }) {
5970
5751
  void handleSelectHistoryChat(chat.sessionId);
5971
5752
  };
5972
5753
  const messagesEnabled = enabledModules.some((m) => m.layout === "chat");
5973
- return /* @__PURE__ */ jsx34("div", { class: `${p27}-anchor`, children: /* @__PURE__ */ jsx34(
5754
+ return /* @__PURE__ */ jsx33("div", { class: `${p28}-anchor`, children: /* @__PURE__ */ jsx33(
5974
5755
  PageShell,
5975
5756
  {
5976
5757
  site: parsedSite,
@@ -5989,15 +5770,15 @@ function App({ options, hostElement, bus }) {
5989
5770
  }
5990
5771
  if (isInlineLike) {
5991
5772
  const inlineSize = options.mode === "standalone" ? "fullscreen" : panelSize;
5992
- return /* @__PURE__ */ jsx34("div", { class: `${p27}-anchor`, children: renderSurface(inlineSize) });
5773
+ return /* @__PURE__ */ jsx33("div", { class: `${p28}-anchor`, children: renderSurface(inlineSize) });
5993
5774
  }
5994
5775
  const drawerEdgeTab = options.mode === "drawer";
5995
5776
  const triggerOwnedByPage = options.mode === "modal";
5996
5777
  const launcherVisible = !triggerOwnedByPage && !options.launcher.hidden && (!isOpen || launcherLeaving);
5997
5778
  const calloutToRender = launcherVisible && !launcherLeaving && !calloutDismissed && !drawerEdgeTab ? effectiveOptions.launcher.callout : null;
5998
- return /* @__PURE__ */ jsxs28("div", { class: `${p27}-anchor`, "data-launcher-size": effectiveOptions.launcher.size, children: [
5779
+ return /* @__PURE__ */ jsxs27("div", { class: `${p28}-anchor`, "data-launcher-size": effectiveOptions.launcher.size, children: [
5999
5780
  isOpen ? renderSurface(panelSize) : null,
6000
- launcherVisible ? /* @__PURE__ */ jsx34(
5781
+ launcherVisible ? /* @__PURE__ */ jsx33(
6001
5782
  Launcher,
6002
5783
  {
6003
5784
  onToggle: handleOpen,
@@ -6007,7 +5788,7 @@ function App({ options, hostElement, bus }) {
6007
5788
  edgeTab: drawerEdgeTab
6008
5789
  }
6009
5790
  ) : null,
6010
- calloutToRender ? /* @__PURE__ */ jsx34(
5791
+ calloutToRender ? /* @__PURE__ */ jsx33(
6011
5792
  LauncherCallout,
6012
5793
  {
6013
5794
  callout: calloutToRender,