@helpai/elements 0.13.1 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -6,8 +6,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
6
6
  import { h, render } from "preact";
7
7
 
8
8
  // src/ui/app.tsx
9
- import { useCallback as useCallback6, useEffect as useEffect17, useMemo as useMemo3, useRef as useRef8, useState as useState13 } from "preact/hooks";
10
- import { useSignal as useSignal2 } from "@preact/signals";
9
+ import { useCallback as useCallback6, useEffect as useEffect17, useMemo as useMemo3, useRef as useRef9, useState as useState13 } from "preact/hooks";
10
+ import { useComputed as useComputed7, useSignal as useSignal2 } from "@preact/signals";
11
11
 
12
12
  // src/core/brand.ts
13
13
  var BRAND = {
@@ -106,9 +106,10 @@ var STRINGS_EN = {
106
106
  newsLoading: "Loading news\u2026",
107
107
  newsBack: "Back to news",
108
108
  newsPublishedAt: "Published {date}",
109
- // ── Forms + human-in-the-loop (intake / ask-input / approval) ───
110
- intakeSubmit: "Start chat",
111
- intakeSkip: "Skip for now",
109
+ // ── Forms + human-in-the-loop (forms / ask-input / approval) ────
110
+ formSubmit: "Submit",
111
+ formSkip: "Skip for now",
112
+ formDismiss: "Dismiss",
112
113
  formRequired: "This field is required",
113
114
  formInvalidEmail: "Enter a valid email address",
114
115
  formInvalidTel: "Enter a valid phone number",
@@ -211,9 +212,10 @@ var STRINGS_FR = {
211
212
  newsLoading: "Chargement des actualit\xE9s\u2026",
212
213
  newsBack: "Retour aux actualit\xE9s",
213
214
  newsPublishedAt: "Publi\xE9 le {date}",
214
- // ── Forms + human-in-the-loop (intake / ask-input / approval) ───
215
- intakeSubmit: "D\xE9marrer le chat",
216
- intakeSkip: "Ignorer pour l'instant",
215
+ // ── Forms + human-in-the-loop (forms / ask-input / approval) ────
216
+ formSubmit: "Envoyer",
217
+ formSkip: "Ignorer pour l'instant",
218
+ formDismiss: "Fermer",
217
219
  formRequired: "Ce champ est obligatoire",
218
220
  formInvalidEmail: "Saisissez une adresse e-mail valide",
219
221
  formInvalidTel: "Saisissez un num\xE9ro de t\xE9l\xE9phone valide",
@@ -450,11 +452,11 @@ var DEFAULT_FEATURES = {
450
452
  voice: "local",
451
453
  humanInLoop: true
452
454
  };
453
- var DEFAULT_INTAKE = { enabled: false, fields: [], skippable: false };
455
+ var DEFAULT_FORMS = { list: [], byTrigger: {} };
454
456
  var DEFAULT_ENDPOINTS = {
455
457
  upload: "/ai/agent/upload-file",
456
458
  transcribe: "/ai/agent/transcribe-audio",
457
- intake: "/ai/agent/intake"
459
+ submitForm: "/ai/agent/submit-form"
458
460
  };
459
461
  var DEFAULT_LAUNCHER = {
460
462
  variant: "circle",
@@ -519,11 +521,11 @@ function resolveOptions(rawOpts) {
519
521
  humanInLoop: opts.features?.humanInLoop ?? DEFAULT_FEATURES.humanInLoop,
520
522
  tools: opts.features?.tools
521
523
  },
522
- intake: resolveIntake(opts.intake),
524
+ forms: resolveForms(opts.forms),
523
525
  endpoints: {
524
526
  upload: opts.endpoints?.upload ?? DEFAULT_ENDPOINTS.upload,
525
527
  transcribe: opts.endpoints?.transcribe ?? DEFAULT_ENDPOINTS.transcribe,
526
- intake: opts.endpoints?.intake ?? DEFAULT_ENDPOINTS.intake
528
+ submitForm: opts.endpoints?.submitForm ?? DEFAULT_ENDPOINTS.submitForm
527
529
  },
528
530
  attachments: {
529
531
  accept: opts.composer?.attachments?.accept ?? DEFAULT_ATTACHMENTS.accept,
@@ -622,17 +624,57 @@ function resolveModules(overrides) {
622
624
  const byId = Object.fromEntries(list.map((m) => [m.id, m]));
623
625
  return { list, byId };
624
626
  }
625
- function resolveIntake(overrides) {
626
- const fields = (overrides?.fields ?? []).filter((f) => Boolean(f && f.name && f.label && f.type));
627
- if (fields.length === 0) return DEFAULT_INTAKE;
628
- return {
629
- enabled: overrides?.enabled ?? false,
630
- title: overrides?.title,
631
- description: overrides?.description,
632
- fields,
633
- submitLabel: overrides?.submitLabel,
634
- skippable: overrides?.skippable ?? false
635
- };
627
+ var BLOCKABLE_KINDS = /* @__PURE__ */ new Set(["pre-chat", "after-messages"]);
628
+ function resolveForms(overrides) {
629
+ var _a;
630
+ if (!overrides?.length) return DEFAULT_FORMS;
631
+ const list = [];
632
+ const seen = /* @__PURE__ */ new Set();
633
+ for (const def of overrides) {
634
+ if (!def?.id || seen.has(def.id)) continue;
635
+ const fields = (def.fields ?? []).filter((f) => Boolean(f && f.name && f.label && f.type));
636
+ const triggers = (Array.isArray(def.on) ? def.on : [def.on]).map(parseTrigger).filter((t) => t !== null);
637
+ if (fields.length === 0 || triggers.length === 0) continue;
638
+ seen.add(def.id);
639
+ const blockable = triggers.some((t) => BLOCKABLE_KINDS.has(t.kind));
640
+ list.push({
641
+ id: def.id,
642
+ triggers,
643
+ when: def.when,
644
+ fields,
645
+ title: def.title,
646
+ description: def.description,
647
+ submitLabel: def.submitLabel,
648
+ skippable: def.skippable ?? false,
649
+ blocking: (def.blocking ?? false) && blockable,
650
+ frequency: def.frequency ?? "once",
651
+ mirrorToContext: def.mirrorToContext ?? true
652
+ });
653
+ }
654
+ const byTrigger = {};
655
+ for (const form of list) {
656
+ for (const t of form.triggers) (byTrigger[_a = t.kind] ?? (byTrigger[_a] = [])).push(form);
657
+ }
658
+ return { list, byTrigger };
659
+ }
660
+ function parseTrigger(raw) {
661
+ if (typeof raw !== "string") return null;
662
+ if (raw === "pre-chat" || raw === "conversation-closed" || raw === "panel-close" || raw === "manual") {
663
+ return { kind: raw };
664
+ }
665
+ const [head, param] = raw.split(":", 2);
666
+ if (head === "after-messages") {
667
+ const n = Number(param);
668
+ return Number.isFinite(n) && n > 0 ? { kind: "after-messages", param: n } : null;
669
+ }
670
+ if (head === "idle") {
671
+ const n = Number(param);
672
+ return Number.isFinite(n) && n > 0 ? { kind: "idle", param: n } : null;
673
+ }
674
+ if (head === "page-area") {
675
+ return param ? { kind: "page-area", param } : null;
676
+ }
677
+ return null;
636
678
  }
637
679
  function resolveLauncher(overrides) {
638
680
  const callout = overrides?.callout?.text ? {
@@ -679,7 +721,6 @@ var SECTION_KEYS = [
679
721
  "i18n",
680
722
  "footer",
681
723
  "features",
682
- "intake",
683
724
  "endpoints"
684
725
  ];
685
726
  function mergeServerConfig(user, server) {
@@ -697,6 +738,7 @@ function mergeServerConfig(user, server) {
697
738
  out[key] = mergeLeaves(sv, uv);
698
739
  }
699
740
  if (server.modules !== void 0 && user.modules === void 0) out.modules = server.modules;
741
+ if (server.forms !== void 0 && user.forms === void 0) out.forms = server.forms;
700
742
  const userI18n = user.i18n;
701
743
  const serverI18n = server.i18n;
702
744
  if (userI18n || serverI18n) {
@@ -847,14 +889,14 @@ function isBlocksConfigShape(raw) {
847
889
  function commandEventName(cmd) {
848
890
  return `${BRAND.cssPrefix}:${cmd}`;
849
891
  }
850
- function dispatchHostCommand(host, cmd) {
851
- host.dispatchEvent(new CustomEvent(commandEventName(cmd)));
892
+ function dispatchHostCommand(host, cmd, detail) {
893
+ host.dispatchEvent(new CustomEvent(commandEventName(cmd), { detail }));
852
894
  }
853
895
  function bindHostCommands(host, handlers) {
854
896
  const entries2 = Object.entries(handlers);
855
897
  const wrapped = entries2.map(([cmd, fn]) => {
856
898
  const event = commandEventName(cmd);
857
- const listener = () => fn();
899
+ const listener = (e) => fn(e.detail);
858
900
  host.addEventListener(event, listener);
859
901
  return [event, listener];
860
902
  });
@@ -870,7 +912,7 @@ var tokens_default = ':host{--__P__-accent: __BRAND_ACCENT__;--__P__-accent-text
870
912
  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';
871
913
 
872
914
  // src/styles/panel.css
873
- 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:10px 12px;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-wrap{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}.__P__-jump{position:absolute;right:14px;bottom:14px;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:999px;border:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);color:var(--__P__-fg);box-shadow:var(--__P__-shadow-panel);cursor:pointer;opacity:.85;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease);animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-jump:hover{opacity:1}.__P__-jump:active{transform:translateY(1px)}.__P__-jump svg{width:18px;height:18px}.__P__-list{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-4);padding-bottom:var(--__P__-space-8);display:flex;flex-direction:column;gap:14px;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__-date-divider{position:sticky;top:var(--__P__-space-2);z-index:2;display:flex;justify-content:center;margin:var(--__P__-space-1) 0;pointer-events:none}.__P__-date-pill{padding:3px 10px;border-radius:999px;font-size:11px;font-weight:600;color:var(--__P__-fg-muted);background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);box-shadow:var(--__P__-shadow-card);opacity:0;pointer-events:none;transition:opacity var(--__P__-dur-base) var(--__P__-ease)}.__P__-list[data-scrolling=true] .__P__-date-pill{opacity:1;pointer-events:auto}@media(prefers-reduced-motion:reduce){.__P__-date-pill{transition:none}}.__P__-bubble-row{display:flex}.__P__-bubble-row[data-role=user]{justify-content:flex-end}.__P__-bubble-row[data-role=assistant]{justify-content:flex-start}.__P__-bubble{max-width:100%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);line-height:1.6;font-size: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)}.__P__-bubble-row[data-role=user] .__P__-bubble ::selection{background:#fff6;color:var(--__P__-bubble-user-text)}@keyframes __P__-bubble-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-bubble-row[data-role=user] .__P__-bubble{background:var(--__P__-bubble-user);color:var(--__P__-bubble-user-text);border-bottom-right-radius:5px}.__P__-bubble-row[data-role=assistant] .__P__-bubble{background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border-bottom-left-radius:5px}.__P__-bubble-col{display:flex;flex-direction:column;max-width:85%;min-width:0}.__P__-bubble-row[data-role=user] .__P__-bubble-col{align-items:flex-end}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col{align-items:flex-start}.__P__-bubble-time{margin-top:3px;padding:0 4px;font-size:11px;line-height:1;color:var(--__P__-fg-muted);user-select:none}.__P__-md>*:first-child{margin-top:0}.__P__-md>*:last-child{margin-bottom:0}.__P__-md p{margin:10px 0}.__P__-md h1,.__P__-md h2,.__P__-md h3,.__P__-md h4,.__P__-md h5,.__P__-md h6{margin:18px 0 8px;line-height:1.3;letter-spacing:-.01em;font-weight:700}.__P__-md h1{font-size:1.4em}.__P__-md h2{font-size:1.22em}.__P__-md h3{font-size:1.08em}.__P__-md h4,.__P__-md h5,.__P__-md h6{font-size:1em}.__P__-md>h1:first-child,.__P__-md>h2:first-child,.__P__-md>h3:first-child,.__P__-md>h4:first-child,.__P__-md>h5:first-child,.__P__-md>h6:first-child{margin-top:0}.__P__-md ul,.__P__-md ol{padding-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:5px;height:5px;border-radius:999px;background:currentColor;opacity:.4;animation:__P__-blink 1.2s var(--__P__-ease) infinite}.__P__-typing span:nth-child(2){animation-delay:.2s}.__P__-typing span:nth-child(3){animation-delay:.4s}@keyframes __P__-blink{0%,80%,to{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-2px)}}.__P__-reasoning{margin:var(--__P__-space-1) 0 var(--__P__-space-2);padding-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)}.__P__-form{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-field{display:flex;flex-direction:column;gap:4px}.__P__-field-label{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-field-req{color:var(--__P__-danger)}.__P__-field-input{width:100%;box-sizing:border-box;padding:var(--__P__-space-2) var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);color:var(--__P__-fg);font:inherit;font-size:var(--__P__-text-sm);resize:vertical;transition:border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-field-input:focus-visible{outline:none;border-color:var(--__P__-accent)}.__P__-field[data-invalid=true] .__P__-field-input{border-color:var(--__P__-danger)}.__P__-field-hint{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-field-error{font-size:var(--__P__-text-xs);color:var(--__P__-danger)}.__P__-field-choices{display:flex;flex-direction:column;gap:6px}.__P__-choice{display:flex;align-items:flex-start;gap:8px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);cursor:pointer}.__P__-choice input{margin-top:2px;accent-color:var(--__P__-accent)}.__P__-form-actions{display:flex;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:2px}.__P__-form-submit,.__P__-tool-approve{padding:var(--__P__-space-2) var(--__P__-space-4);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);cursor:pointer;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-submit:hover:not(:disabled),.__P__-tool-approve:hover:not(:disabled){filter:brightness(1.06)}.__P__-form-submit:disabled{opacity:.6;cursor:default}.__P__-form-skip,.__P__-tool-reject{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:transparent;color:var(--__P__-fg-muted);font:inherit;font-size:var(--__P__-text-sm);cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-skip:hover:not(:disabled),.__P__-tool-reject:hover:not(:disabled){background:var(--__P__-bg-elevated)}.__P__-intake{display:flex;flex-direction:column;gap:var(--__P__-space-2);padding:var(--__P__-space-3) var(--__P__-space-4) var(--__P__-space-4);border-top:1px solid var(--__P__-border);overflow-y:auto}.__P__-intake-title{margin:0;font-size:var(--__P__-text-base);font-weight:700;color:var(--__P__-fg)}.__P__-intake-desc{margin:0 0 var(--__P__-space-1);font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted)}.__P__-tool-ask-input,.__P__-tool-approval{display:flex;flex-direction:column;gap:var(--__P__-space-2);margin-top:6px;padding:var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated)}.__P__-tool-head{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.__P__-tool-badge{padding:2px 8px;border-radius:999px;background:var(--__P__-warning, #f59e0b);color:#1a1206;font-size:var(--__P__-text-xs);font-weight:600}.__P__-tool-title{font-size:var(--__P__-text-sm);color:var(--__P__-fg)}.__P__-tool-question{margin:0;font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-tool-desc{margin:0;font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted)}.__P__-tool-args{margin:0;padding:var(--__P__-space-2);max-height:160px;overflow:auto;border-radius:var(--__P__-radius-sm);background:var(--__P__-bg);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);white-space:pre-wrap;word-break:break-word}.__P__-tool-stale-note{margin:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-tool-decided{flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px}.__P__-tool-decided-label{padding:2px 8px;border-radius:999px;background:var(--__P__-bg);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-tool-decided-label[data-approved=true]{color:var(--__P__-success, #16a34a);border-color:var(--__P__-success, #16a34a)}.__P__-tool-decided-label[data-approved=false]{color:var(--__P__-danger);border-color:var(--__P__-danger)}.__P__-tool-decided-value{font-size:var(--__P__-text-sm);color:var(--__P__-fg)}\n';
915
+ 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:10px 12px;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-wrap{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}.__P__-jump{position:absolute;right:14px;bottom:14px;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:999px;border:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);color:var(--__P__-fg);box-shadow:var(--__P__-shadow-panel);cursor:pointer;opacity:.85;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease);animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-jump:hover{opacity:1}.__P__-jump:active{transform:translateY(1px)}.__P__-jump svg{width:18px;height:18px}.__P__-list{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-4);padding-bottom:var(--__P__-space-8);display:flex;flex-direction:column;gap:14px;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__-date-divider{position:sticky;top:var(--__P__-space-2);z-index:2;display:flex;justify-content:center;margin:var(--__P__-space-1) 0;pointer-events:none}.__P__-date-pill{padding:3px 10px;border-radius:999px;font-size:11px;font-weight:600;color:var(--__P__-fg-muted);background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);box-shadow:var(--__P__-shadow-card);opacity:0;pointer-events:none;transition:opacity var(--__P__-dur-base) var(--__P__-ease)}.__P__-list[data-scrolling=true] .__P__-date-pill{opacity:1;pointer-events:auto}@media(prefers-reduced-motion:reduce){.__P__-date-pill{transition:none}}.__P__-bubble-row{display:flex}.__P__-bubble-row[data-role=user]{justify-content:flex-end}.__P__-bubble-row[data-role=assistant]{justify-content:flex-start}.__P__-bubble{max-width:100%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);line-height:1.6;font-size: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)}.__P__-bubble-row[data-role=user] .__P__-bubble ::selection{background:#fff6;color:var(--__P__-bubble-user-text)}@keyframes __P__-bubble-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-bubble-row[data-role=user] .__P__-bubble{background:var(--__P__-bubble-user);color:var(--__P__-bubble-user-text);border-bottom-right-radius:5px}.__P__-bubble-row[data-role=assistant] .__P__-bubble{background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border-bottom-left-radius:5px}.__P__-bubble-col{display:flex;flex-direction:column;max-width:85%;min-width:0}.__P__-bubble-row[data-role=user] .__P__-bubble-col{align-items:flex-end}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col{align-items:flex-start}.__P__-bubble-time{margin-top:3px;padding:0 4px;font-size:11px;line-height:1;color:var(--__P__-fg-muted);user-select:none}.__P__-md>*:first-child{margin-top:0}.__P__-md>*:last-child{margin-bottom:0}.__P__-md p{margin:10px 0}.__P__-md h1,.__P__-md h2,.__P__-md h3,.__P__-md h4,.__P__-md h5,.__P__-md h6{margin:18px 0 8px;line-height:1.3;letter-spacing:-.01em;font-weight:700}.__P__-md h1{font-size:1.4em}.__P__-md h2{font-size:1.22em}.__P__-md h3{font-size:1.08em}.__P__-md h4,.__P__-md h5,.__P__-md h6{font-size:1em}.__P__-md>h1:first-child,.__P__-md>h2:first-child,.__P__-md>h3:first-child,.__P__-md>h4:first-child,.__P__-md>h5:first-child,.__P__-md>h6:first-child{margin-top:0}.__P__-md ul,.__P__-md ol{padding-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:5px;height:5px;border-radius:999px;background:currentColor;opacity:.4;animation:__P__-blink 1.2s var(--__P__-ease) infinite}.__P__-typing span:nth-child(2){animation-delay:.2s}.__P__-typing span:nth-child(3){animation-delay:.4s}@keyframes __P__-blink{0%,80%,to{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-2px)}}.__P__-reasoning{margin:var(--__P__-space-1) 0 var(--__P__-space-2);padding-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)}.__P__-form{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-field{display:flex;flex-direction:column;gap:4px}.__P__-field-label{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-field-req{color:var(--__P__-danger)}.__P__-field-input{width:100%;box-sizing:border-box;padding:var(--__P__-space-2) var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);color:var(--__P__-fg);font:inherit;font-size:var(--__P__-text-sm);resize:vertical;transition:border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-field-input:focus-visible{outline:none;border-color:var(--__P__-accent)}.__P__-field[data-invalid=true] .__P__-field-input{border-color:var(--__P__-danger)}.__P__-field-hint{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-field-error{font-size:var(--__P__-text-xs);color:var(--__P__-danger)}.__P__-field-choices{display:flex;flex-direction:column;gap:6px}.__P__-choice{display:flex;align-items:flex-start;gap:8px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);cursor:pointer}.__P__-choice input{margin-top:2px;accent-color:var(--__P__-accent)}.__P__-form-actions{display:flex;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:2px}.__P__-form-submit,.__P__-tool-approve{padding:var(--__P__-space-2) var(--__P__-space-4);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);cursor:pointer;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-submit:hover:not(:disabled),.__P__-tool-approve:hover:not(:disabled){filter:brightness(1.06)}.__P__-form-submit:disabled{opacity:.6;cursor:default}.__P__-form-skip,.__P__-tool-reject{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:transparent;color:var(--__P__-fg-muted);font:inherit;font-size:var(--__P__-text-sm);cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-skip:hover:not(:disabled),.__P__-tool-reject:hover:not(:disabled){background:var(--__P__-bg-elevated)}.__P__-form-gate{display:flex;flex-direction:column;gap:var(--__P__-space-2);padding:var(--__P__-space-3) var(--__P__-space-4) var(--__P__-space-4);border-top:1px solid var(--__P__-border);overflow-y:auto}.__P__-form-gate-title{margin:0;font-size:var(--__P__-text-base);font-weight:700;color:var(--__P__-fg)}.__P__-form-gate-desc{margin:0 0 var(--__P__-space-1);font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted)}.__P__-form-card{display:flex;flex-direction:column;gap:var(--__P__-space-2);margin:var(--__P__-space-2) 0;padding:var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated)}.__P__-form-card-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.__P__-form-card-title{font-size:var(--__P__-text-sm);font-weight:700;color:var(--__P__-fg)}.__P__-form-card-desc{margin:0;font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted)}.__P__-tool-ask-input,.__P__-tool-approval{display:flex;flex-direction:column;gap:var(--__P__-space-2);margin-top:6px;padding:var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated)}.__P__-tool-head{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.__P__-tool-badge{padding:2px 8px;border-radius:999px;background:var(--__P__-warning, #f59e0b);color:#1a1206;font-size:var(--__P__-text-xs);font-weight:600}.__P__-tool-title{font-size:var(--__P__-text-sm);color:var(--__P__-fg)}.__P__-tool-question{margin:0;font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-tool-desc{margin:0;font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted)}.__P__-tool-args{margin:0;padding:var(--__P__-space-2);max-height:160px;overflow:auto;border-radius:var(--__P__-radius-sm);background:var(--__P__-bg);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);white-space:pre-wrap;word-break:break-word}.__P__-tool-stale-note{margin:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-tool-decided{flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px}.__P__-tool-decided-label{padding:2px 8px;border-radius:999px;background:var(--__P__-bg);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-tool-decided-label[data-approved=true]{color:var(--__P__-success, #16a34a);border-color:var(--__P__-success, #16a34a)}.__P__-tool-decided-label[data-approved=false]{color:var(--__P__-danger);border-color:var(--__P__-danger)}.__P__-tool-decided-value{font-size:var(--__P__-text-sm);color:var(--__P__-fg)}\n';
874
916
 
875
917
  // src/styles/standalone.css
876
918
  var standalone_default = ".__P__-standalone-page{margin:0;height:100vh;background:var(--__P__-bg, #fff);display:grid;place-items:stretch}\n";
@@ -958,22 +1000,22 @@ function attachAdoptedSheet(shadow, doc) {
958
1000
  }
959
1001
  }
960
1002
  function applyThemeOverrides(host, overrides) {
961
- const p33 = BRAND.cssPrefix;
962
- if (overrides.accent) host.style.setProperty(`--${p33}-accent`, overrides.accent);
963
- if (overrides.accentText) host.style.setProperty(`--${p33}-accent-text`, overrides.accentText);
964
- if (overrides.radius) host.style.setProperty(`--${p33}-radius`, overrides.radius);
965
- if (overrides.fontFamily) host.style.setProperty(`--${p33}-font`, overrides.fontFamily);
1003
+ const p34 = BRAND.cssPrefix;
1004
+ if (overrides.accent) host.style.setProperty(`--${p34}-accent`, overrides.accent);
1005
+ if (overrides.accentText) host.style.setProperty(`--${p34}-accent-text`, overrides.accentText);
1006
+ if (overrides.radius) host.style.setProperty(`--${p34}-radius`, overrides.radius);
1007
+ if (overrides.fontFamily) host.style.setProperty(`--${p34}-font`, overrides.fontFamily);
966
1008
  }
967
1009
  function applyThemeMode(host, mode) {
968
1010
  host.dataset.theme = mode;
969
1011
  }
970
1012
  function applySize(host, size) {
971
- const p33 = BRAND.cssPrefix;
972
- if (size.width !== void 0) host.style.setProperty(`--${p33}-panel-w`, size.width);
973
- if (size.height !== void 0) host.style.setProperty(`--${p33}-panel-h`, size.height);
974
- if (size.expanded?.width !== void 0) host.style.setProperty(`--${p33}-expanded-w`, size.expanded.width);
975
- if (size.expanded?.height !== void 0) host.style.setProperty(`--${p33}-expanded-h`, size.expanded.height);
976
- if (size.inset !== void 0) host.style.setProperty(`--${p33}-panel-inset`, size.inset);
1013
+ const p34 = BRAND.cssPrefix;
1014
+ if (size.width !== void 0) host.style.setProperty(`--${p34}-panel-w`, size.width);
1015
+ if (size.height !== void 0) host.style.setProperty(`--${p34}-panel-h`, size.height);
1016
+ if (size.expanded?.width !== void 0) host.style.setProperty(`--${p34}-expanded-w`, size.expanded.width);
1017
+ if (size.expanded?.height !== void 0) host.style.setProperty(`--${p34}-expanded-h`, size.expanded.height);
1018
+ if (size.inset !== void 0) host.style.setProperty(`--${p34}-panel-inset`, size.inset);
977
1019
  }
978
1020
  function applyPosition(host, pos) {
979
1021
  host.dataset.position = pos;
@@ -1075,7 +1117,7 @@ var StreamError = class extends Error {
1075
1117
 
1076
1118
  // src/stream/parser.ts
1077
1119
  var log3 = logger.scope("parser");
1078
- async function* parseChatStream(response, signal6) {
1120
+ async function* parseChatStream(response, signal7) {
1079
1121
  if (!response.ok) {
1080
1122
  const text = await response.text().catch(() => "");
1081
1123
  throw new StreamError(`server responded ${response.status}: ${text.slice(0, 200)}`, "server", response.status);
@@ -1085,7 +1127,7 @@ async function* parseChatStream(response, signal6) {
1085
1127
  let buffer = "";
1086
1128
  try {
1087
1129
  while (true) {
1088
- if (signal6.aborted) throw new DOMException("aborted", "AbortError");
1130
+ if (signal7.aborted) throw new DOMException("aborted", "AbortError");
1089
1131
  const { done, value } = await reader.read();
1090
1132
  if (done) {
1091
1133
  const trailing = buffer.trim();
@@ -1144,11 +1186,11 @@ function toBase64Url(json) {
1144
1186
  var nonEmpty = (ctx) => ctx && Object.keys(ctx).length > 0 ? ctx : void 0;
1145
1187
  function encodeContext(user, page) {
1146
1188
  const u = nonEmpty(user);
1147
- const p33 = nonEmpty(page);
1148
- if (!u && !p33) return void 0;
1189
+ const p34 = nonEmpty(page);
1190
+ if (!u && !p34) return void 0;
1149
1191
  const envelope = {};
1150
1192
  if (u) envelope.user = u;
1151
- if (p33) envelope.page = p33;
1193
+ if (p34) envelope.page = p34;
1152
1194
  return toBase64Url(JSON.stringify(envelope));
1153
1195
  }
1154
1196
 
@@ -1189,13 +1231,12 @@ var DEFAULT_PATHS = {
1189
1231
  /** All widget content via one filtered endpoint. `GET /ai/agent/content?tags=…`. */
1190
1232
  content: "/ai/agent/content",
1191
1233
  /**
1192
- * Optional pre-chat intake submission. POST `{ visitorId, sessionId, values,
1193
- * skipped? }` → record the lead immediately (before/independent of the first
1194
- * message), keyed by the same visitor + session as the conversation.
1195
- * Overridable via `endpoints.intake`. Fire-and-forget; 404 on older backends
1196
- * is ignored.
1234
+ * Form submission (the event-driven forms engine). POST `{ visitorId,
1235
+ * sessionId, formId, trigger, values, skipped? }` → record the form's answers
1236
+ * immediately, keyed by the same visitor + session as the conversation.
1237
+ * Overridable via `endpoints.submitForm`. Fire-and-forget; 404 is ignored.
1197
1238
  */
1198
- intake: "/ai/agent/intake"
1239
+ submitForm: "/ai/agent/submit-form"
1199
1240
  };
1200
1241
  var CONTEXT_PARAM = "context";
1201
1242
  function buildSendMessageRequest(params) {
@@ -1219,8 +1260,8 @@ function buildSendMessageRequest(params) {
1219
1260
  if (Object.keys(data).length > 0) body.data = data;
1220
1261
  return body;
1221
1262
  }
1222
- function isResolvedToolPart(p33) {
1223
- return p33.state === "output" || p33.state === "error" || p33.approval?.approved !== void 0;
1263
+ function isResolvedToolPart(p34) {
1264
+ return p34.state === "output" || p34.state === "error" || p34.approval?.approved !== void 0;
1224
1265
  }
1225
1266
  function normalizeToolRef(ref) {
1226
1267
  if (typeof ref === "string") return ref ? { code: ref } : null;
@@ -1228,24 +1269,24 @@ function normalizeToolRef(ref) {
1228
1269
  }
1229
1270
  function messageToWireParts(m) {
1230
1271
  const out = [];
1231
- for (const p33 of m.parts) {
1232
- if (p33.kind === "text" && p33.text) {
1233
- out.push({ text: p33.text, type: "text" });
1272
+ for (const p34 of m.parts) {
1273
+ if (p34.kind === "text" && p34.text) {
1274
+ out.push({ text: p34.text, type: "text" });
1234
1275
  }
1235
- if (p33.kind === "file" && p33.url) {
1236
- out.push({ mediaType: p33.mediaType, type: "file", url: p33.url });
1276
+ if (p34.kind === "file" && p34.url) {
1277
+ out.push({ mediaType: p34.mediaType, type: "file", url: p34.url });
1237
1278
  }
1238
- if (p33.kind === "tool" && isResolvedToolPart(p33)) {
1279
+ if (p34.kind === "tool" && isResolvedToolPart(p34)) {
1239
1280
  const part = {
1240
1281
  type: "tool",
1241
- toolCallId: p33.toolCallId,
1242
- toolName: p33.toolName,
1243
- state: p33.state
1282
+ toolCallId: p34.toolCallId,
1283
+ toolName: p34.toolName,
1284
+ state: p34.state
1244
1285
  };
1245
- if (p33.input !== void 0) part.input = p33.input;
1246
- if (p33.output !== void 0) part.output = p33.output;
1247
- if (p33.error !== void 0) part.errorText = p33.error;
1248
- if (p33.approval && p33.approval.approved !== void 0) part.approval = p33.approval;
1286
+ if (p34.input !== void 0) part.input = p34.input;
1287
+ if (p34.output !== void 0) part.output = p34.output;
1288
+ if (p34.error !== void 0) part.errorText = p34.error;
1289
+ if (p34.approval && p34.approval.approved !== void 0) part.approval = p34.approval;
1249
1290
  out.push(part);
1250
1291
  }
1251
1292
  }
@@ -1279,15 +1320,15 @@ function retryAfterMs(headers) {
1279
1320
  const ms = Number.isFinite(secs) ? secs * 1e3 : Date.parse(raw) - Date.now();
1280
1321
  return Number.isFinite(ms) && ms >= 0 ? Math.min(ms, 3e4) : null;
1281
1322
  }
1282
- function sleep(ms, signal6) {
1323
+ function sleep(ms, signal7) {
1283
1324
  return new Promise((resolve) => {
1284
- if (signal6?.aborted) return resolve();
1325
+ if (signal7?.aborted) return resolve();
1285
1326
  const id = setTimeout(done, ms);
1286
1327
  const onAbort = () => done();
1287
- signal6?.addEventListener("abort", onAbort, { once: true });
1328
+ signal7?.addEventListener("abort", onAbort, { once: true });
1288
1329
  function done() {
1289
1330
  clearTimeout(id);
1290
- signal6?.removeEventListener("abort", onAbort);
1331
+ signal7?.removeEventListener("abort", onAbort);
1291
1332
  resolve();
1292
1333
  }
1293
1334
  });
@@ -1493,23 +1534,22 @@ var AgentTransport = class {
1493
1534
  get transcribePath() {
1494
1535
  return this.opts.endpoints?.transcribe ?? "/ai/agent/transcribe-audio";
1495
1536
  }
1496
- get intakePath() {
1497
- return this.opts.endpoints?.intake ?? DEFAULT_PATHS.intake;
1537
+ get submitFormPath() {
1538
+ return this.opts.endpoints?.submitForm ?? DEFAULT_PATHS.submitForm;
1498
1539
  }
1499
1540
  /**
1500
- * Record a completed pre-chat intake form. Fire-and-forget — the lead is
1501
- * captured even if the visitor never sends a message. `sessionId` is explicit
1502
- * so the record ties to the conversation that follows; `visitorId` + context
1503
- * ride the envelope. A failure (e.g. 404 on a backend that doesn't implement
1504
- * the endpoint) is non-fatal the values still reach the agent as
1505
- * `userContext` on the next message, so callers don't await this.
1541
+ * Record a completed form (intake, CSAT, claim, …). Fire-and-forget — the
1542
+ * record is captured even if the visitor never sends a message. `sessionId`,
1543
+ * `formId`, and `trigger` are explicit so the backend can tie + route;
1544
+ * `visitorId` + context ride the envelope. A failure (e.g. 404 on a backend
1545
+ * that doesn't implement the endpoint) is non-fatal, so callers don't await.
1506
1546
  */
1507
- async submitIntake(sessionId, values, skipped = false) {
1508
- log4.debug("submitIntake \u2192", { sessionId, fields: Object.keys(values).length, skipped });
1547
+ async submitForm(body) {
1548
+ log4.debug("submitForm \u2192", { formId: body.formId, trigger: body.trigger, fields: Object.keys(body.values).length });
1509
1549
  try {
1510
- await this.postJson(this.intakePath, { sessionId, values, skipped }, "submitIntake");
1550
+ await this.postJson(this.submitFormPath, body, "submitForm");
1511
1551
  } catch (err) {
1512
- log4.debug("submitIntake failed (non-fatal)", { err });
1552
+ log4.debug("submitForm failed (non-fatal)", { err });
1513
1553
  }
1514
1554
  }
1515
1555
  sendMessage(body) {
@@ -1649,7 +1689,7 @@ var AgentTransport = class {
1649
1689
  }).catch((err) => log4.debug("cancel POST failed (non-fatal)", { err }));
1650
1690
  }
1651
1691
  // ---- Low-level fetch helpers ------------------------------------------
1652
- async *openMessageStream(body, signal6) {
1692
+ async *openMessageStream(body, signal7) {
1653
1693
  const res = await this.fetchImpl(this.url(DEFAULT_PATHS.streamMessage), {
1654
1694
  method: "POST",
1655
1695
  credentials: "omit",
@@ -1659,9 +1699,9 @@ var AgentTransport = class {
1659
1699
  ...this.opts.auth.headers()
1660
1700
  },
1661
1701
  body: JSON.stringify(this.withEnvelope(body)),
1662
- signal: signal6
1702
+ signal: signal7
1663
1703
  });
1664
- yield* parseChatStream(res, signal6);
1704
+ yield* parseChatStream(res, signal7);
1665
1705
  }
1666
1706
  /**
1667
1707
  * Resume URL: `GET /stream-resume` with the envelope (visitorId / sessionId /
@@ -1839,7 +1879,7 @@ function fromWireMessage(w) {
1839
1879
  };
1840
1880
  }
1841
1881
  return null;
1842
- }).filter((p33) => p33 !== null);
1882
+ }).filter((p34) => p34 !== null);
1843
1883
  return {
1844
1884
  id: w.id,
1845
1885
  role: w.role,
@@ -1869,43 +1909,43 @@ function assistantText(m) {
1869
1909
  }
1870
1910
  return out;
1871
1911
  }
1872
- function partToReactive(p33) {
1873
- if (p33.kind === "text" || p33.kind === "reasoning") {
1874
- return { kind: p33.kind, id: p33.id, textSig: signal(p33.text), doneSig: signal(p33.done) };
1912
+ function partToReactive(p34) {
1913
+ if (p34.kind === "text" || p34.kind === "reasoning") {
1914
+ return { kind: p34.kind, id: p34.id, textSig: signal(p34.text), doneSig: signal(p34.done) };
1875
1915
  }
1876
- if (p33.kind === "tool") {
1916
+ if (p34.kind === "tool") {
1877
1917
  return {
1878
1918
  kind: "tool",
1879
- toolCallId: p33.toolCallId,
1880
- toolName: p33.toolName,
1881
- inputPartialSig: signal(p33.inputPartial),
1882
- inputSig: signal(p33.input),
1883
- outputSig: signal(p33.output),
1884
- errorSig: signal(p33.error),
1885
- stateSig: signal(p33.state),
1886
- approvalSig: signal(p33.approval)
1919
+ toolCallId: p34.toolCallId,
1920
+ toolName: p34.toolName,
1921
+ inputPartialSig: signal(p34.inputPartial),
1922
+ inputSig: signal(p34.input),
1923
+ outputSig: signal(p34.output),
1924
+ errorSig: signal(p34.error),
1925
+ stateSig: signal(p34.state),
1926
+ approvalSig: signal(p34.approval)
1887
1927
  };
1888
1928
  }
1889
- return p33;
1929
+ return p34;
1890
1930
  }
1891
- function partFromReactive(p33) {
1892
- if (p33.kind === "text" || p33.kind === "reasoning") {
1893
- return { kind: p33.kind, id: p33.id, text: p33.textSig.value, done: p33.doneSig.value };
1931
+ function partFromReactive(p34) {
1932
+ if (p34.kind === "text" || p34.kind === "reasoning") {
1933
+ return { kind: p34.kind, id: p34.id, text: p34.textSig.value, done: p34.doneSig.value };
1894
1934
  }
1895
- if (p33.kind === "tool") {
1935
+ if (p34.kind === "tool") {
1896
1936
  return {
1897
1937
  kind: "tool",
1898
- toolCallId: p33.toolCallId,
1899
- toolName: p33.toolName,
1900
- inputPartial: p33.inputPartialSig.value,
1901
- input: p33.inputSig.value,
1902
- output: p33.outputSig.value,
1903
- error: p33.errorSig.value,
1904
- state: p33.stateSig.value,
1905
- approval: p33.approvalSig.value
1938
+ toolCallId: p34.toolCallId,
1939
+ toolName: p34.toolName,
1940
+ inputPartial: p34.inputPartialSig.value,
1941
+ input: p34.inputSig.value,
1942
+ output: p34.outputSig.value,
1943
+ error: p34.errorSig.value,
1944
+ state: p34.stateSig.value,
1945
+ approval: p34.approvalSig.value
1906
1946
  };
1907
1947
  }
1908
- return p33;
1948
+ return p34;
1909
1949
  }
1910
1950
 
1911
1951
  // src/stream/reducer.ts
@@ -1960,8 +2000,8 @@ var StreamReducer = class {
1960
2000
  ensureTextPart(m, "text", chunk.id);
1961
2001
  return;
1962
2002
  case "text-delta": {
1963
- const p33 = ensureTextPart(m, "text", chunk.id);
1964
- p33.textSig.value += chunk.delta;
2003
+ const p34 = ensureTextPart(m, "text", chunk.id);
2004
+ p34.textSig.value += chunk.delta;
1965
2005
  return;
1966
2006
  }
1967
2007
  case "text-end":
@@ -1971,8 +2011,8 @@ var StreamReducer = class {
1971
2011
  ensureTextPart(m, "reasoning", chunk.id).doneSig.value = false;
1972
2012
  return;
1973
2013
  case "reasoning-delta": {
1974
- const p33 = ensureTextPart(m, "reasoning", chunk.id);
1975
- p33.textSig.value += chunk.delta;
2014
+ const p34 = ensureTextPart(m, "reasoning", chunk.id);
2015
+ p34.textSig.value += chunk.delta;
1976
2016
  return;
1977
2017
  }
1978
2018
  case "reasoning-end":
@@ -1991,7 +2031,7 @@ var StreamReducer = class {
1991
2031
  return;
1992
2032
  case "source-url": {
1993
2033
  const parts = m.partsSig.value;
1994
- if (parts.some((p33) => p33.kind === "source" && p33.sourceId === chunk.sourceId)) return;
2034
+ if (parts.some((p34) => p34.kind === "source" && p34.sourceId === chunk.sourceId)) return;
1995
2035
  appendPart(m, { kind: "source", sourceId: chunk.sourceId, url: chunk.url, title: chunk.title });
1996
2036
  return;
1997
2037
  }
@@ -2015,14 +2055,14 @@ var StreamReducer = class {
2015
2055
  }
2016
2056
  };
2017
2057
  function ensureTextPart(m, kind, id) {
2018
- const existing = m.partsSig.value.find((p33) => p33.kind === kind && p33.id === id);
2058
+ const existing = m.partsSig.value.find((p34) => p34.kind === kind && p34.id === id);
2019
2059
  if (existing) return existing;
2020
2060
  const part = { kind, id, textSig: signal2(""), doneSig: signal2(false) };
2021
2061
  appendPart(m, part);
2022
2062
  return part;
2023
2063
  }
2024
2064
  function ensureToolPart(m, toolCallId, toolName) {
2025
- const existing = m.partsSig.value.find((p33) => p33.kind === "tool" && p33.toolCallId === toolCallId);
2065
+ const existing = m.partsSig.value.find((p34) => p34.kind === "tool" && p34.toolCallId === toolCallId);
2026
2066
  if (existing) return existing;
2027
2067
  const part = {
2028
2068
  kind: "tool",
@@ -2047,32 +2087,32 @@ function applyTool(m, chunk) {
2047
2087
  ensureToolPart(m, chunk.toolCallId, chunk.toolName);
2048
2088
  return;
2049
2089
  case "tool-input-delta": {
2050
- const p33 = ensureToolPart(m, chunk.toolCallId);
2051
- p33.inputPartialSig.value += chunk.delta;
2090
+ const p34 = ensureToolPart(m, chunk.toolCallId);
2091
+ p34.inputPartialSig.value += chunk.delta;
2052
2092
  return;
2053
2093
  }
2054
2094
  case "tool-input-available": {
2055
- const p33 = ensureToolPart(m, chunk.toolCallId, chunk.toolName);
2056
- p33.inputSig.value = chunk.input;
2057
- p33.stateSig.value = isAskUserInputTool(p33.toolName) ? "awaiting-input" : "awaiting";
2095
+ const p34 = ensureToolPart(m, chunk.toolCallId, chunk.toolName);
2096
+ p34.inputSig.value = chunk.input;
2097
+ p34.stateSig.value = isAskUserInputTool(p34.toolName) ? "awaiting-input" : "awaiting";
2058
2098
  return;
2059
2099
  }
2060
2100
  case "tool-approval-request": {
2061
- const p33 = ensureToolPart(m, chunk.toolCallId, chunk.toolName);
2062
- p33.approvalSig.value = { id: chunk.approvalId };
2063
- p33.stateSig.value = "awaiting-approval";
2101
+ const p34 = ensureToolPart(m, chunk.toolCallId, chunk.toolName);
2102
+ p34.approvalSig.value = { id: chunk.approvalId };
2103
+ p34.stateSig.value = "awaiting-approval";
2064
2104
  return;
2065
2105
  }
2066
2106
  case "tool-output-available": {
2067
- const p33 = ensureToolPart(m, chunk.toolCallId);
2068
- p33.outputSig.value = chunk.output;
2069
- p33.stateSig.value = "output";
2107
+ const p34 = ensureToolPart(m, chunk.toolCallId);
2108
+ p34.outputSig.value = chunk.output;
2109
+ p34.stateSig.value = "output";
2070
2110
  return;
2071
2111
  }
2072
2112
  case "tool-output-error": {
2073
- const p33 = ensureToolPart(m, chunk.toolCallId);
2074
- p33.errorSig.value = chunk.errorText;
2075
- p33.stateSig.value = "error";
2113
+ const p34 = ensureToolPart(m, chunk.toolCallId);
2114
+ p34.errorSig.value = chunk.errorText;
2115
+ p34.stateSig.value = "error";
2076
2116
  return;
2077
2117
  }
2078
2118
  default:
@@ -2092,7 +2132,7 @@ function createPersistence(widgetId, storage = defaultStorage) {
2092
2132
  const KEY_CALLOUT_DISMISSED = `${prefix}.calloutDismissed`;
2093
2133
  const KEY_SIDEBAR_COLLAPSED = `${prefix}.sidebarCollapsed`;
2094
2134
  const KEY_ACTIVE_MODULE = `${prefix}.activeModule`;
2095
- const KEY_INTAKE = `${prefix}.intake`;
2135
+ const KEY_FORMS_DONE = `${prefix}.formsDone`;
2096
2136
  const persistence = {
2097
2137
  getVisitorId() {
2098
2138
  const existing = storage.get(KEY_VISITOR);
@@ -2175,22 +2215,24 @@ function createPersistence(widgetId, storage = defaultStorage) {
2175
2215
  saveActiveModule(id) {
2176
2216
  storage.set(KEY_ACTIVE_MODULE, id);
2177
2217
  },
2178
- loadIntake() {
2179
- const raw = storage.get(KEY_INTAKE);
2180
- if (!raw) return null;
2218
+ loadFormsDone() {
2219
+ const raw = storage.get(KEY_FORMS_DONE);
2220
+ if (!raw) return {};
2181
2221
  try {
2182
2222
  const parsed = JSON.parse(raw);
2183
- return isPlainObject2(parsed) ? parsed : null;
2223
+ return isPlainObject2(parsed) ? parsed : {};
2184
2224
  } catch (error) {
2185
- log6.warn("loadIntake parse failed", { error });
2186
- return null;
2225
+ log6.warn("loadFormsDone parse failed", { error });
2226
+ return {};
2187
2227
  }
2188
2228
  },
2189
- saveIntake(values) {
2229
+ saveFormDone(id) {
2190
2230
  try {
2191
- storage.set(KEY_INTAKE, JSON.stringify(values));
2231
+ const done = persistence.loadFormsDone();
2232
+ done[id] = Date.now();
2233
+ storage.set(KEY_FORMS_DONE, JSON.stringify(done));
2192
2234
  } catch (error) {
2193
- log6.warn("saveIntake serialise failed", { error });
2235
+ log6.warn("saveFormDone serialise failed", { error });
2194
2236
  }
2195
2237
  },
2196
2238
  clearSession() {
@@ -2735,13 +2777,17 @@ var TID = {
2735
2777
  helpArticle: `${p2}-help-article`,
2736
2778
  /** News list item — suffix `-{id}`. */
2737
2779
  newsItem: `${p2}-news-item`,
2738
- // ── Forms + human-in-the-loop (intake / ask-input / approval) ────
2739
- /** Pre-chat intake form root (blocking gate). */
2740
- intakeForm: `${p2}-intake-form`,
2741
- /** Intake submit button. */
2742
- intakeSubmit: `${p2}-intake-submit`,
2743
- /** Intake skip button (only when `skippable`). */
2744
- intakeSkip: `${p2}-intake-skip`,
2780
+ // ── Forms + human-in-the-loop (forms / ask-input / approval) ─────
2781
+ /** Blocking form gate root (replaces the composer). */
2782
+ formGate: `${p2}-form-gate`,
2783
+ /** Inline form card root (in the transcript). */
2784
+ formCard: `${p2}-form-card`,
2785
+ /** Form submit button. */
2786
+ formSubmit: `${p2}-form-submit`,
2787
+ /** Form skip button (blocking gate, when `skippable`). */
2788
+ formSkip: `${p2}-form-skip`,
2789
+ /** Inline form-card dismiss button. */
2790
+ formDismiss: `${p2}-form-dismiss`,
2745
2791
  /** A single form field control — suffix `-{name}` at the JSX site. */
2746
2792
  formField: `${p2}-form-field`,
2747
2793
  /** Ask-input tool root (inline form in a message bubble). */
@@ -2868,24 +2914,24 @@ import { useCallback as useCallback2, useEffect as useEffect10, useRef as useRef
2868
2914
  import { useEffect as useEffect2, useRef } from "preact/hooks";
2869
2915
  import { jsx as jsx3 } from "preact/jsx-runtime";
2870
2916
  function ResizeGrip({ panelEl, resize, position, initialSize, onSizeChange, strings }) {
2871
- const p33 = BRAND.cssPrefix;
2917
+ const p34 = BRAND.cssPrefix;
2872
2918
  const dragRef = useRef(null);
2873
2919
  useEffect2(() => {
2874
2920
  if (!panelEl) return;
2875
2921
  const style = panelEl.style;
2876
- if (resize.minWidth) style.setProperty(`--${p33}-resize-min-w`, resize.minWidth);
2877
- if (resize.maxWidth) style.setProperty(`--${p33}-resize-max-w`, resize.maxWidth);
2878
- if (resize.minHeight) style.setProperty(`--${p33}-resize-min-h`, resize.minHeight);
2879
- if (resize.maxHeight) style.setProperty(`--${p33}-resize-max-h`, resize.maxHeight);
2922
+ if (resize.minWidth) style.setProperty(`--${p34}-resize-min-w`, resize.minWidth);
2923
+ if (resize.maxWidth) style.setProperty(`--${p34}-resize-max-w`, resize.maxWidth);
2924
+ if (resize.minHeight) style.setProperty(`--${p34}-resize-min-h`, resize.minHeight);
2925
+ if (resize.maxHeight) style.setProperty(`--${p34}-resize-max-h`, resize.maxHeight);
2880
2926
  if (initialSize) {
2881
- style.setProperty(`--${p33}-widget-w`, `${initialSize.width}px`);
2882
- style.setProperty(`--${p33}-widget-h`, `${initialSize.height}px`);
2927
+ style.setProperty(`--${p34}-widget-w`, `${initialSize.width}px`);
2928
+ style.setProperty(`--${p34}-widget-h`, `${initialSize.height}px`);
2883
2929
  }
2884
- }, [panelEl, resize.minWidth, resize.maxWidth, resize.minHeight, resize.maxHeight, p33, initialSize]);
2930
+ }, [panelEl, resize.minWidth, resize.maxWidth, resize.minHeight, resize.maxHeight, p34, initialSize]);
2885
2931
  if (!panelEl) return null;
2886
2932
  const isTop = position.startsWith("top-");
2887
2933
  const isRight = position.endsWith("-right");
2888
- const cornerClass = `${p33}-resize-grip ${p33}-resize-grip--${isTop ? "bottom" : "top"}-${isRight ? "left" : "right"}`;
2934
+ const cornerClass = `${p34}-resize-grip ${p34}-resize-grip--${isTop ? "bottom" : "top"}-${isRight ? "left" : "right"}`;
2889
2935
  const onPointerDown = (e) => {
2890
2936
  if (!panelEl) return;
2891
2937
  const target = e.currentTarget;
@@ -2909,8 +2955,8 @@ function ResizeGrip({ panelEl, resize, position, initialSize, onSizeChange, stri
2909
2955
  if (!d || e.pointerId !== d.pointerId || !panelEl) return;
2910
2956
  const dx = (e.clientX - d.startX) * d.dirX;
2911
2957
  const dy = (e.clientY - d.startY) * d.dirY;
2912
- panelEl.style.setProperty(`--${p33}-widget-w`, `${d.startW + dx}px`);
2913
- panelEl.style.setProperty(`--${p33}-widget-h`, `${d.startH + dy}px`);
2958
+ panelEl.style.setProperty(`--${p34}-widget-w`, `${d.startW + dx}px`);
2959
+ panelEl.style.setProperty(`--${p34}-widget-h`, `${d.startH + dy}px`);
2914
2960
  };
2915
2961
  const onPointerUp = (e) => {
2916
2962
  const d = dragRef.current;
@@ -3645,20 +3691,20 @@ function usePopoverMenu({ itemCount, initialFocusIndex }) {
3645
3691
  // src/ui/overflow-menu.tsx
3646
3692
  import { jsx as jsx8, jsxs as jsxs6 } from "preact/jsx-runtime";
3647
3693
  function OverflowMenu({ items, triggerLabel }) {
3648
- const p33 = BRAND.cssPrefix;
3694
+ const p34 = BRAND.cssPrefix;
3649
3695
  const menu = usePopoverMenu({ itemCount: items.length });
3650
3696
  const handleSelect = (item) => {
3651
3697
  if (item.disabled) return;
3652
3698
  item.onSelect();
3653
3699
  if (!item.keepOpen) menu.close();
3654
3700
  };
3655
- return /* @__PURE__ */ jsxs6("div", { class: `${p33}-menu-wrap`, children: [
3701
+ return /* @__PURE__ */ jsxs6("div", { class: `${p34}-menu-wrap`, children: [
3656
3702
  /* @__PURE__ */ jsx8(
3657
3703
  "button",
3658
3704
  {
3659
3705
  ref: menu.triggerRef,
3660
3706
  type: "button",
3661
- class: `${p33}-icon-btn`,
3707
+ class: `${p34}-icon-btn`,
3662
3708
  "aria-label": triggerLabel,
3663
3709
  "aria-haspopup": "menu",
3664
3710
  "aria-expanded": menu.open,
@@ -3672,7 +3718,7 @@ function OverflowMenu({ items, triggerLabel }) {
3672
3718
  "div",
3673
3719
  {
3674
3720
  ref: menu.menuRef,
3675
- class: `${p33}-menu`,
3721
+ class: `${p34}-menu`,
3676
3722
  role: "menu",
3677
3723
  "aria-label": triggerLabel,
3678
3724
  onKeyDown: menu.onMenuKey,
@@ -3682,15 +3728,15 @@ function OverflowMenu({ items, triggerLabel }) {
3682
3728
  {
3683
3729
  type: "button",
3684
3730
  role: "menuitem",
3685
- class: `${p33}-menu-item`,
3731
+ class: `${p34}-menu-item`,
3686
3732
  "aria-pressed": item.type === "switch" ? item.on : void 0,
3687
3733
  disabled: item.disabled,
3688
3734
  lang: item.lang,
3689
3735
  onClick: () => handleSelect(item),
3690
3736
  children: [
3691
- item.icon ? /* @__PURE__ */ jsx8("span", { class: `${p33}-menu-icon`, children: item.icon }) : null,
3692
- /* @__PURE__ */ jsx8("span", { class: `${p33}-menu-label`, children: item.label }),
3693
- item.type === "switch" && item.on ? /* @__PURE__ */ jsx8("span", { class: `${p33}-menu-check`, "aria-hidden": "true", children: /* @__PURE__ */ jsx8(CheckIcon, {}) }) : null
3737
+ item.icon ? /* @__PURE__ */ jsx8("span", { class: `${p34}-menu-icon`, children: item.icon }) : null,
3738
+ /* @__PURE__ */ jsx8("span", { class: `${p34}-menu-label`, children: item.label }),
3739
+ item.type === "switch" && item.on ? /* @__PURE__ */ jsx8("span", { class: `${p34}-menu-check`, "aria-hidden": "true", children: /* @__PURE__ */ jsx8(CheckIcon, {}) }) : null
3694
3740
  ]
3695
3741
  },
3696
3742
  item.id
@@ -4106,7 +4152,17 @@ function renderControl(args) {
4106
4152
  }
4107
4153
  }
4108
4154
  function inputType(type) {
4109
- return type === "number" || type === "email" || type === "tel" || type === "url" ? type : "text";
4155
+ switch (type) {
4156
+ case "number":
4157
+ case "email":
4158
+ case "tel":
4159
+ case "url":
4160
+ case "date":
4161
+ case "time":
4162
+ return type;
4163
+ default:
4164
+ return "text";
4165
+ }
4110
4166
  }
4111
4167
  function seedValues(fields) {
4112
4168
  const out = {};
@@ -4131,24 +4187,24 @@ function resolveValues(fields, values, other) {
4131
4187
  return out;
4132
4188
  }
4133
4189
 
4134
- // src/ui/intake-gate.tsx
4190
+ // src/ui/form/form-gate.tsx
4135
4191
  import { jsx as jsx11, jsxs as jsxs9 } from "preact/jsx-runtime";
4136
4192
  var p11 = BRAND.cssPrefix;
4137
- function IntakeGate({ intake, strings, onComplete }) {
4138
- return /* @__PURE__ */ jsxs9("div", { class: `${p11}-intake`, "data-testid": TID.intakeForm, children: [
4139
- intake.title ? /* @__PURE__ */ jsx11("h3", { class: `${p11}-intake-title`, children: intake.title }) : null,
4140
- intake.description ? /* @__PURE__ */ jsx11("p", { class: `${p11}-intake-desc`, children: intake.description }) : null,
4193
+ function FormGate({ form, strings, onSubmit, onSkip }) {
4194
+ return /* @__PURE__ */ jsxs9("div", { class: `${p11}-form-gate`, "data-testid": TID.formGate, children: [
4195
+ form.title ? /* @__PURE__ */ jsx11("h3", { class: `${p11}-form-gate-title`, children: form.title }) : null,
4196
+ form.description ? /* @__PURE__ */ jsx11("p", { class: `${p11}-form-gate-desc`, children: form.description }) : null,
4141
4197
  /* @__PURE__ */ jsx11(
4142
4198
  DynamicForm,
4143
4199
  {
4144
- fields: intake.fields,
4200
+ fields: form.fields,
4145
4201
  strings,
4146
- submitLabel: intake.submitLabel ?? strings.intakeSubmit,
4147
- onSubmit: onComplete,
4148
- skipLabel: intake.skippable ? strings.intakeSkip : void 0,
4149
- onSkip: intake.skippable ? () => onComplete({}) : void 0,
4150
- submitTestId: TID.intakeSubmit,
4151
- skipTestId: TID.intakeSkip
4202
+ submitLabel: form.submitLabel ?? strings.formSubmit,
4203
+ onSubmit,
4204
+ skipLabel: form.skippable ? strings.formSkip : void 0,
4205
+ onSkip: form.skippable ? onSkip : void 0,
4206
+ submitTestId: TID.formSubmit,
4207
+ skipTestId: TID.formSkip
4152
4208
  }
4153
4209
  )
4154
4210
  ] });
@@ -4158,6 +4214,40 @@ function IntakeGate({ intake, strings, onComplete }) {
4158
4214
  import { useEffect as useEffect8, useLayoutEffect, useRef as useRef5, useState as useState6 } from "preact/hooks";
4159
4215
  import { useComputed as useComputed5 } from "@preact/signals";
4160
4216
 
4217
+ // src/ui/form/form-card.tsx
4218
+ import { jsx as jsx12, jsxs as jsxs10 } from "preact/jsx-runtime";
4219
+ var p12 = BRAND.cssPrefix;
4220
+ function FormCard({ form, strings, onSubmit, onSkip }) {
4221
+ return /* @__PURE__ */ jsxs10("div", { class: `${p12}-form-card`, "data-testid": TID.formCard, children: [
4222
+ /* @__PURE__ */ jsxs10("div", { class: `${p12}-form-card-head`, children: [
4223
+ form.title ? /* @__PURE__ */ jsx12("strong", { class: `${p12}-form-card-title`, children: form.title }) : /* @__PURE__ */ jsx12("span", {}),
4224
+ /* @__PURE__ */ jsx12(
4225
+ "button",
4226
+ {
4227
+ type: "button",
4228
+ class: `${p12}-icon-btn`,
4229
+ onClick: onSkip,
4230
+ "aria-label": strings.formDismiss,
4231
+ title: strings.formDismiss,
4232
+ "data-testid": TID.formDismiss,
4233
+ children: /* @__PURE__ */ jsx12(CloseIcon, {})
4234
+ }
4235
+ )
4236
+ ] }),
4237
+ form.description ? /* @__PURE__ */ jsx12("p", { class: `${p12}-form-card-desc`, children: form.description }) : null,
4238
+ /* @__PURE__ */ jsx12(
4239
+ DynamicForm,
4240
+ {
4241
+ fields: form.fields,
4242
+ strings,
4243
+ submitLabel: form.submitLabel ?? strings.formSubmit,
4244
+ onSubmit,
4245
+ submitTestId: TID.formSubmit
4246
+ }
4247
+ )
4248
+ ] });
4249
+ }
4250
+
4161
4251
  // src/ui/message-bubble.tsx
4162
4252
  import { useComputed as useComputed4 } from "@preact/signals";
4163
4253
 
@@ -4165,7 +4255,7 @@ import { useComputed as useComputed4 } from "@preact/signals";
4165
4255
  import { useEffect as useEffect7, useMemo, useRef as useRef4 } from "preact/hooks";
4166
4256
  import { effect, signal as signal4 } from "@preact/signals";
4167
4257
  import * as smd from "streaming-markdown";
4168
- import { jsx as jsx12 } from "preact/jsx-runtime";
4258
+ import { jsx as jsx13 } from "preact/jsx-runtime";
4169
4259
  function MarkdownView({ textSig, doneSig }) {
4170
4260
  const ref = useRef4(null);
4171
4261
  useEffect7(() => {
@@ -4215,12 +4305,12 @@ function MarkdownView({ textSig, doneSig }) {
4215
4305
  el.removeEventListener("click", onClick);
4216
4306
  };
4217
4307
  }, [textSig, doneSig]);
4218
- return /* @__PURE__ */ jsx12("div", { ref });
4308
+ return /* @__PURE__ */ jsx13("div", { ref });
4219
4309
  }
4220
4310
  function StaticMarkdown({ text }) {
4221
4311
  const textSig = useMemo(() => signal4(text), [text]);
4222
4312
  const doneSig = useMemo(() => signal4(true), []);
4223
- return /* @__PURE__ */ jsx12(MarkdownView, { textSig, doneSig });
4313
+ return /* @__PURE__ */ jsx13(MarkdownView, { textSig, doneSig });
4224
4314
  }
4225
4315
  function hardenLink(a) {
4226
4316
  const href = a.getAttribute("href") ?? "";
@@ -4234,8 +4324,8 @@ function hardenLink(a) {
4234
4324
 
4235
4325
  // src/ui/tool-approval.tsx
4236
4326
  import { useComputed as useComputed2, useSignal } from "@preact/signals";
4237
- import { Fragment, jsx as jsx13, jsxs as jsxs10 } from "preact/jsx-runtime";
4238
- var p12 = BRAND.cssPrefix;
4327
+ import { Fragment, jsx as jsx14, jsxs as jsxs11 } from "preact/jsx-runtime";
4328
+ var p13 = BRAND.cssPrefix;
4239
4329
  function ToolApproval({ part, strings, active, onDecision }) {
4240
4330
  const approval = useComputed2(() => part.approvalSig.value);
4241
4331
  const input = useComputed2(() => part.inputSig.value);
@@ -4243,24 +4333,24 @@ function ToolApproval({ part, strings, active, onDecision }) {
4243
4333
  const decided = approval.value?.approved !== void 0;
4244
4334
  if (decided) {
4245
4335
  const ap = approval.value;
4246
- return /* @__PURE__ */ jsxs10("div", { class: `${p12}-tool-approval ${p12}-tool-decided`, "data-testid": TID.toolDecision, children: [
4247
- /* @__PURE__ */ jsx13("span", { class: `${p12}-tool-decided-label`, "data-approved": ap?.approved ? "true" : "false", children: ap?.approved ? strings.approved : strings.rejected }),
4248
- /* @__PURE__ */ jsx13("strong", { class: `${p12}-tool-title`, children: part.toolName }),
4249
- ap?.reason ? /* @__PURE__ */ jsx13("span", { class: `${p12}-tool-decided-value`, children: ap.reason }) : null
4336
+ return /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-approval ${p13}-tool-decided`, "data-testid": TID.toolDecision, children: [
4337
+ /* @__PURE__ */ jsx14("span", { class: `${p13}-tool-decided-label`, "data-approved": ap?.approved ? "true" : "false", children: ap?.approved ? strings.approved : strings.rejected }),
4338
+ /* @__PURE__ */ jsx14("strong", { class: `${p13}-tool-title`, children: part.toolName }),
4339
+ ap?.reason ? /* @__PURE__ */ jsx14("span", { class: `${p13}-tool-decided-value`, children: ap.reason }) : null
4250
4340
  ] });
4251
4341
  }
4252
4342
  const args = summarizeInput(input.value);
4253
- return /* @__PURE__ */ jsxs10("div", { class: `${p12}-tool-approval`, "data-testid": TID.toolApproval, children: [
4254
- /* @__PURE__ */ jsxs10("div", { class: `${p12}-tool-head`, children: [
4255
- /* @__PURE__ */ jsx13("span", { class: `${p12}-tool-badge`, children: strings.approvalRequired }),
4256
- /* @__PURE__ */ jsx13("strong", { class: `${p12}-tool-title`, children: part.toolName })
4343
+ return /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-approval`, "data-testid": TID.toolApproval, children: [
4344
+ /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-head`, children: [
4345
+ /* @__PURE__ */ jsx14("span", { class: `${p13}-tool-badge`, children: strings.approvalRequired }),
4346
+ /* @__PURE__ */ jsx14("strong", { class: `${p13}-tool-title`, children: part.toolName })
4257
4347
  ] }),
4258
- args ? /* @__PURE__ */ jsx13("pre", { class: `${p12}-tool-args`, children: args }) : null,
4259
- active ? /* @__PURE__ */ jsxs10(Fragment, { children: [
4260
- /* @__PURE__ */ jsx13(
4348
+ args ? /* @__PURE__ */ jsx14("pre", { class: `${p13}-tool-args`, children: args }) : null,
4349
+ active ? /* @__PURE__ */ jsxs11(Fragment, { children: [
4350
+ /* @__PURE__ */ jsx14(
4261
4351
  "input",
4262
4352
  {
4263
- class: `${p12}-field-input`,
4353
+ class: `${p13}-field-input`,
4264
4354
  value: reason.value,
4265
4355
  placeholder: strings.approvalReason,
4266
4356
  onInput: (e) => {
@@ -4268,29 +4358,29 @@ function ToolApproval({ part, strings, active, onDecision }) {
4268
4358
  }
4269
4359
  }
4270
4360
  ),
4271
- /* @__PURE__ */ jsxs10("div", { class: `${p12}-form-actions`, children: [
4272
- /* @__PURE__ */ jsx13(
4361
+ /* @__PURE__ */ jsxs11("div", { class: `${p13}-form-actions`, children: [
4362
+ /* @__PURE__ */ jsx14(
4273
4363
  "button",
4274
4364
  {
4275
4365
  type: "button",
4276
- class: `${p12}-tool-reject`,
4366
+ class: `${p13}-tool-reject`,
4277
4367
  onClick: () => onDecision(part.toolCallId, false, reason.value.trim() || void 0),
4278
4368
  "data-testid": TID.toolReject,
4279
4369
  children: strings.reject
4280
4370
  }
4281
4371
  ),
4282
- /* @__PURE__ */ jsx13(
4372
+ /* @__PURE__ */ jsx14(
4283
4373
  "button",
4284
4374
  {
4285
4375
  type: "button",
4286
- class: `${p12}-tool-approve`,
4376
+ class: `${p13}-tool-approve`,
4287
4377
  onClick: () => onDecision(part.toolCallId, true, reason.value.trim() || void 0),
4288
4378
  "data-testid": TID.toolApprove,
4289
4379
  children: strings.approve
4290
4380
  }
4291
4381
  )
4292
4382
  ] })
4293
- ] }) : /* @__PURE__ */ jsx13("p", { class: `${p12}-tool-stale-note`, children: strings.stepNoLongerActive })
4383
+ ] }) : /* @__PURE__ */ jsx14("p", { class: `${p13}-tool-stale-note`, children: strings.stepNoLongerActive })
4294
4384
  ] });
4295
4385
  }
4296
4386
  function summarizeInput(input) {
@@ -4361,49 +4451,49 @@ function num(v) {
4361
4451
  }
4362
4452
 
4363
4453
  // src/ui/tool-ask-input.tsx
4364
- import { jsx as jsx14, jsxs as jsxs11 } from "preact/jsx-runtime";
4365
- var p13 = BRAND.cssPrefix;
4454
+ import { jsx as jsx15, jsxs as jsxs12 } from "preact/jsx-runtime";
4455
+ var p14 = BRAND.cssPrefix;
4366
4456
  function ToolAskInput({ part, strings, active, onSubmit }) {
4367
4457
  const state = useComputed3(() => part.stateSig.value);
4368
4458
  const request = useComputed3(() => parseAskUserInput(part.inputSig.value));
4369
4459
  const decided = state.value === "output" || state.value === "error";
4370
4460
  if (decided) {
4371
- return /* @__PURE__ */ jsx14(DecidedSummary, { part, strings });
4461
+ return /* @__PURE__ */ jsx15(DecidedSummary, { part, strings });
4372
4462
  }
4373
4463
  if (!active) {
4374
- return /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-ask-input ${p13}-tool-stale`, "data-testid": TID.toolAskInput, children: [
4375
- /* @__PURE__ */ jsx14(Header, { strings, title: request.value.title ?? request.value.question }),
4376
- /* @__PURE__ */ jsx14("p", { class: `${p13}-tool-stale-note`, children: strings.stepNoLongerActive })
4464
+ return /* @__PURE__ */ jsxs12("div", { class: `${p14}-tool-ask-input ${p14}-tool-stale`, "data-testid": TID.toolAskInput, children: [
4465
+ /* @__PURE__ */ jsx15(Header, { strings, title: request.value.title ?? request.value.question }),
4466
+ /* @__PURE__ */ jsx15("p", { class: `${p14}-tool-stale-note`, children: strings.stepNoLongerActive })
4377
4467
  ] });
4378
4468
  }
4379
4469
  const req = request.value;
4380
4470
  const isConfirmation = req.responseType === "confirmation";
4381
- return /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-ask-input`, "data-testid": TID.toolAskInput, children: [
4382
- /* @__PURE__ */ jsx14(Header, { strings, title: req.title }),
4383
- req.description ? /* @__PURE__ */ jsx14("p", { class: `${p13}-tool-desc`, children: req.description }) : null,
4384
- isConfirmation ? /* @__PURE__ */ jsx14("p", { class: `${p13}-tool-question`, children: req.question }) : null,
4385
- isConfirmation ? /* @__PURE__ */ jsxs11("div", { class: `${p13}-form-actions`, children: [
4386
- /* @__PURE__ */ jsx14(
4471
+ return /* @__PURE__ */ jsxs12("div", { class: `${p14}-tool-ask-input`, "data-testid": TID.toolAskInput, children: [
4472
+ /* @__PURE__ */ jsx15(Header, { strings, title: req.title }),
4473
+ req.description ? /* @__PURE__ */ jsx15("p", { class: `${p14}-tool-desc`, children: req.description }) : null,
4474
+ isConfirmation ? /* @__PURE__ */ jsx15("p", { class: `${p14}-tool-question`, children: req.question }) : null,
4475
+ isConfirmation ? /* @__PURE__ */ jsxs12("div", { class: `${p14}-form-actions`, children: [
4476
+ /* @__PURE__ */ jsx15(
4387
4477
  "button",
4388
4478
  {
4389
4479
  type: "button",
4390
- class: `${p13}-form-skip`,
4480
+ class: `${p14}-form-skip`,
4391
4481
  onClick: () => onSubmit(part.toolCallId, { confirmed: false }),
4392
4482
  "data-testid": TID.toolInputSkip,
4393
4483
  children: strings.reject
4394
4484
  }
4395
4485
  ),
4396
- /* @__PURE__ */ jsx14(
4486
+ /* @__PURE__ */ jsx15(
4397
4487
  "button",
4398
4488
  {
4399
4489
  type: "button",
4400
- class: `${p13}-form-submit`,
4490
+ class: `${p14}-form-submit`,
4401
4491
  onClick: () => onSubmit(part.toolCallId, { confirmed: true }),
4402
4492
  "data-testid": TID.toolInputSubmit,
4403
4493
  children: strings.approve
4404
4494
  }
4405
4495
  )
4406
- ] }) : /* @__PURE__ */ jsx14(
4496
+ ] }) : /* @__PURE__ */ jsx15(
4407
4497
  DynamicForm,
4408
4498
  {
4409
4499
  fields: askInputToFields(req),
@@ -4419,17 +4509,17 @@ function ToolAskInput({ part, strings, active, onSubmit }) {
4419
4509
  ] });
4420
4510
  }
4421
4511
  function Header({ strings, title }) {
4422
- return /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-head`, children: [
4423
- /* @__PURE__ */ jsx14("span", { class: `${p13}-tool-badge`, children: strings.inputRequired }),
4424
- title ? /* @__PURE__ */ jsx14("strong", { class: `${p13}-tool-title`, children: title }) : null
4512
+ return /* @__PURE__ */ jsxs12("div", { class: `${p14}-tool-head`, children: [
4513
+ /* @__PURE__ */ jsx15("span", { class: `${p14}-tool-badge`, children: strings.inputRequired }),
4514
+ title ? /* @__PURE__ */ jsx15("strong", { class: `${p14}-tool-title`, children: title }) : null
4425
4515
  ] });
4426
4516
  }
4427
4517
  function DecidedSummary({ part, strings }) {
4428
4518
  const output = useComputed3(() => part.outputSig.value);
4429
4519
  const text = summarizeOutput(output.value) || strings.inputSubmitted;
4430
- return /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-ask-input ${p13}-tool-decided`, "data-testid": TID.toolDecision, children: [
4431
- /* @__PURE__ */ jsx14("span", { class: `${p13}-tool-decided-label`, children: strings.inputSubmitted }),
4432
- /* @__PURE__ */ jsx14("span", { class: `${p13}-tool-decided-value`, children: text })
4520
+ return /* @__PURE__ */ jsxs12("div", { class: `${p14}-tool-ask-input ${p14}-tool-decided`, "data-testid": TID.toolDecision, children: [
4521
+ /* @__PURE__ */ jsx15("span", { class: `${p14}-tool-decided-label`, children: strings.inputSubmitted }),
4522
+ /* @__PURE__ */ jsx15("span", { class: `${p14}-tool-decided-value`, children: text })
4433
4523
  ] });
4434
4524
  }
4435
4525
  function summarizeOutput(output) {
@@ -4444,21 +4534,21 @@ function summarizeOutput(output) {
4444
4534
  }
4445
4535
 
4446
4536
  // src/ui/tool-chip.tsx
4447
- import { jsx as jsx15, jsxs as jsxs12 } from "preact/jsx-runtime";
4537
+ import { jsx as jsx16, jsxs as jsxs13 } from "preact/jsx-runtime";
4448
4538
  function ToolChip({ part, strings }) {
4449
- const p33 = BRAND.cssPrefix;
4450
- return /* @__PURE__ */ jsxs12("span", { class: `${p33}-tool-chip`, role: "status", children: [
4451
- /* @__PURE__ */ jsxs12("span", { children: [
4539
+ const p34 = BRAND.cssPrefix;
4540
+ return /* @__PURE__ */ jsxs13("span", { class: `${p34}-tool-chip`, role: "status", children: [
4541
+ /* @__PURE__ */ jsxs13("span", { children: [
4452
4542
  strings.usedTool,
4453
4543
  ":"
4454
4544
  ] }),
4455
- /* @__PURE__ */ jsx15("strong", { children: part.toolName })
4545
+ /* @__PURE__ */ jsx16("strong", { children: part.toolName })
4456
4546
  ] });
4457
4547
  }
4458
4548
 
4459
4549
  // src/ui/message-bubble.tsx
4460
- import { jsx as jsx16, jsxs as jsxs13 } from "preact/jsx-runtime";
4461
- var p14 = BRAND.cssPrefix;
4550
+ import { jsx as jsx17, jsxs as jsxs14 } from "preact/jsx-runtime";
4551
+ var p15 = BRAND.cssPrefix;
4462
4552
  function MessageBubble({
4463
4553
  message,
4464
4554
  strings,
@@ -4481,9 +4571,9 @@ function MessageBubble({
4481
4571
  const working = streaming && !hasAnswerText.value;
4482
4572
  const showStreamDots = streaming && !bufferedHold && !(reasoningVisible.value && working);
4483
4573
  const stamp = formatStamp(message.createdAt);
4484
- return /* @__PURE__ */ jsx16("div", { class: `${p14}-bubble-row`, "data-role": message.role, "data-testid": tid(TID.messageBubble, message.id), children: /* @__PURE__ */ jsxs13("div", { class: `${p14}-bubble-col`, children: [
4485
- /* @__PURE__ */ jsxs13("div", { class: `${p14}-bubble`, children: [
4486
- bufferedHold ? /* @__PURE__ */ jsx16(LoadingSpinner, { label: strings.loading }) : partList.map((part) => /* @__PURE__ */ jsx16(
4574
+ return /* @__PURE__ */ jsx17("div", { class: `${p15}-bubble-row`, "data-role": message.role, "data-testid": tid(TID.messageBubble, message.id), children: /* @__PURE__ */ jsxs14("div", { class: `${p15}-bubble-col`, children: [
4575
+ /* @__PURE__ */ jsxs14("div", { class: `${p15}-bubble`, children: [
4576
+ bufferedHold ? /* @__PURE__ */ jsx17(LoadingSpinner, { label: strings.loading }) : partList.map((part) => /* @__PURE__ */ jsx17(
4487
4577
  PartView,
4488
4578
  {
4489
4579
  part,
@@ -4496,10 +4586,10 @@ function MessageBubble({
4496
4586
  },
4497
4587
  partKey(part)
4498
4588
  )),
4499
- showStreamDots && /* @__PURE__ */ jsx16(TypingDots, {}),
4500
- message.status === "error" && message.errorText ? /* @__PURE__ */ jsx16("div", { class: `${p14}-error`, role: "alert", children: /* @__PURE__ */ jsx16("span", { children: message.errorText }) }) : null
4589
+ showStreamDots && /* @__PURE__ */ jsx17(TypingDots, {}),
4590
+ message.status === "error" && message.errorText ? /* @__PURE__ */ jsx17("div", { class: `${p15}-error`, role: "alert", children: /* @__PURE__ */ jsx17("span", { children: message.errorText }) }) : null
4501
4591
  ] }),
4502
- stamp ? /* @__PURE__ */ jsx16("time", { class: `${p14}-bubble-time`, dateTime: stamp.iso, title: stamp.full, children: stamp.short }) : null
4592
+ stamp ? /* @__PURE__ */ jsx17("time", { class: `${p15}-bubble-time`, dateTime: stamp.iso, title: stamp.full, children: stamp.short }) : null
4503
4593
  ] }) });
4504
4594
  }
4505
4595
  function formatStamp(createdAt) {
@@ -4526,11 +4616,11 @@ function PartView({
4526
4616
  }) {
4527
4617
  switch (part.kind) {
4528
4618
  case "text":
4529
- return /* @__PURE__ */ jsx16(MarkdownView, { textSig: part.textSig, doneSig: part.doneSig });
4619
+ return /* @__PURE__ */ jsx17(MarkdownView, { textSig: part.textSig, doneSig: part.doneSig });
4530
4620
  case "reasoning":
4531
- return showReasoning ? /* @__PURE__ */ jsx16(ReasoningView, { part, active, strings }) : null;
4621
+ return showReasoning ? /* @__PURE__ */ jsx17(ReasoningView, { part, active, strings }) : null;
4532
4622
  case "tool":
4533
- return /* @__PURE__ */ jsx16(
4623
+ return /* @__PURE__ */ jsx17(
4534
4624
  ToolPartView,
4535
4625
  {
4536
4626
  part,
@@ -4542,9 +4632,9 @@ function PartView({
4542
4632
  );
4543
4633
  case "file":
4544
4634
  if (part.mediaType.startsWith("image/")) {
4545
- return /* @__PURE__ */ jsx16("img", { src: part.url, alt: "", loading: "lazy" });
4635
+ return /* @__PURE__ */ jsx17("img", { src: part.url, alt: "", loading: "lazy" });
4546
4636
  }
4547
- return /* @__PURE__ */ jsx16("a", { href: part.url, target: "_blank", rel: "noreferrer noopener", children: part.url });
4637
+ return /* @__PURE__ */ jsx17("a", { href: part.url, target: "_blank", rel: "noreferrer noopener", children: part.url });
4548
4638
  case "source":
4549
4639
  return null;
4550
4640
  }
@@ -4560,22 +4650,22 @@ function ToolPartView({
4560
4650
  const hasApproval = useComputed4(() => part.approvalSig.value !== void 0);
4561
4651
  if (tool?.humanInLoop) {
4562
4652
  if (hasApproval.value || state.value === "awaiting-approval") {
4563
- return /* @__PURE__ */ jsx16(ToolApproval, { part, strings, active: interactive, onDecision: tool.onDecision });
4653
+ return /* @__PURE__ */ jsx17(ToolApproval, { part, strings, active: interactive, onDecision: tool.onDecision });
4564
4654
  }
4565
4655
  if (isAskUserInputTool(part.toolName) || state.value === "awaiting-input") {
4566
- return /* @__PURE__ */ jsx16(ToolAskInput, { part, strings, active: interactive, onSubmit: tool.onResult });
4656
+ return /* @__PURE__ */ jsx17(ToolAskInput, { part, strings, active: interactive, onSubmit: tool.onResult });
4567
4657
  }
4568
4658
  }
4569
- return showToolCalls ? /* @__PURE__ */ jsx16(ToolChip, { part, strings }) : null;
4659
+ return showToolCalls ? /* @__PURE__ */ jsx17(ToolChip, { part, strings }) : null;
4570
4660
  }
4571
4661
  function ReasoningView({
4572
4662
  part,
4573
4663
  active,
4574
4664
  strings
4575
4665
  }) {
4576
- return /* @__PURE__ */ jsxs13("details", { class: `${p14}-reasoning`, open: active, "data-active": active ? "true" : void 0, children: [
4577
- /* @__PURE__ */ jsx16("summary", { class: `${p14}-reasoning-summary`, children: /* @__PURE__ */ jsx16("span", { class: `${p14}-reasoning-label`, children: active ? strings.thinking : strings.thoughts }) }),
4578
- /* @__PURE__ */ jsx16("div", { class: `${p14}-reasoning-body`, children: /* @__PURE__ */ jsx16(MarkdownView, { textSig: part.textSig, doneSig: part.doneSig }) })
4666
+ return /* @__PURE__ */ jsxs14("details", { class: `${p15}-reasoning`, open: active, "data-active": active ? "true" : void 0, children: [
4667
+ /* @__PURE__ */ jsx17("summary", { class: `${p15}-reasoning-summary`, children: /* @__PURE__ */ jsx17("span", { class: `${p15}-reasoning-label`, children: active ? strings.thinking : strings.thoughts }) }),
4668
+ /* @__PURE__ */ jsx17("div", { class: `${p15}-reasoning-body`, children: /* @__PURE__ */ jsx17(MarkdownView, { textSig: part.textSig, doneSig: part.doneSig }) })
4579
4669
  ] });
4580
4670
  }
4581
4671
  function partKey(part) {
@@ -4592,22 +4682,22 @@ function partKey(part) {
4592
4682
  }
4593
4683
  }
4594
4684
  function TypingDots() {
4595
- return /* @__PURE__ */ jsxs13("span", { class: `${p14}-typing`, "aria-hidden": "true", children: [
4596
- /* @__PURE__ */ jsx16("span", {}),
4597
- /* @__PURE__ */ jsx16("span", {}),
4598
- /* @__PURE__ */ jsx16("span", {})
4685
+ return /* @__PURE__ */ jsxs14("span", { class: `${p15}-typing`, "aria-hidden": "true", children: [
4686
+ /* @__PURE__ */ jsx17("span", {}),
4687
+ /* @__PURE__ */ jsx17("span", {}),
4688
+ /* @__PURE__ */ jsx17("span", {})
4599
4689
  ] });
4600
4690
  }
4601
4691
  function LoadingSpinner({ label }) {
4602
- return /* @__PURE__ */ jsxs13("span", { class: `${p14}-loading`, role: "status", children: [
4603
- /* @__PURE__ */ jsx16("span", { class: `${p14}-loading-spinner`, "aria-hidden": "true" }),
4604
- /* @__PURE__ */ jsx16("span", { class: `${p14}-loading-label`, children: label })
4692
+ return /* @__PURE__ */ jsxs14("span", { class: `${p15}-loading`, role: "status", children: [
4693
+ /* @__PURE__ */ jsx17("span", { class: `${p15}-loading-spinner`, "aria-hidden": "true" }),
4694
+ /* @__PURE__ */ jsx17("span", { class: `${p15}-loading-label`, children: label })
4605
4695
  ] });
4606
4696
  }
4607
4697
 
4608
4698
  // src/ui/message-list.tsx
4609
- import { jsx as jsx17, jsxs as jsxs14 } from "preact/jsx-runtime";
4610
- var p15 = BRAND.cssPrefix;
4699
+ import { jsx as jsx18, jsxs as jsxs15 } from "preact/jsx-runtime";
4700
+ var p16 = BRAND.cssPrefix;
4611
4701
  var STICK_THRESHOLD = 120;
4612
4702
  var DIVIDER_IDLE_MS = 1200;
4613
4703
  function MessageList({
@@ -4618,7 +4708,10 @@ function MessageList({
4618
4708
  showToolCalls,
4619
4709
  loading,
4620
4710
  idle,
4621
- tool
4711
+ tool,
4712
+ inlineForm,
4713
+ onFormSubmit,
4714
+ onFormSkip
4622
4715
  }) {
4623
4716
  const ref = useRef5(null);
4624
4717
  const messages = useComputed5(() => messagesSig.value);
@@ -4703,12 +4796,12 @@ function MessageList({
4703
4796
  const day = dayKey(m.createdAt);
4704
4797
  if (day && day !== prevDay) {
4705
4798
  rows.push(
4706
- /* @__PURE__ */ jsx17("div", { class: `${p15}-date-divider`, children: /* @__PURE__ */ jsx17("span", { class: `${p15}-date-pill`, title: fullDate(m.createdAt), children: dayLabel(m.createdAt, strings) }) }, `day:${day}`)
4799
+ /* @__PURE__ */ jsx18("div", { class: `${p16}-date-divider`, children: /* @__PURE__ */ jsx18("span", { class: `${p16}-date-pill`, title: fullDate(m.createdAt), children: dayLabel(m.createdAt, strings) }) }, `day:${day}`)
4707
4800
  );
4708
4801
  prevDay = day;
4709
4802
  }
4710
4803
  rows.push(
4711
- /* @__PURE__ */ jsx17(
4804
+ /* @__PURE__ */ jsx18(
4712
4805
  MessageBubble,
4713
4806
  {
4714
4807
  message: m,
@@ -4723,32 +4816,33 @@ function MessageList({
4723
4816
  )
4724
4817
  );
4725
4818
  }
4726
- return /* @__PURE__ */ jsxs14("div", { class: `${p15}-list-wrap`, children: [
4727
- /* @__PURE__ */ jsxs14(
4819
+ return /* @__PURE__ */ jsxs15("div", { class: `${p16}-list-wrap`, children: [
4820
+ /* @__PURE__ */ jsxs15(
4728
4821
  "div",
4729
4822
  {
4730
4823
  ref,
4731
- class: `${p15}-list`,
4824
+ class: `${p16}-list`,
4732
4825
  role: "log",
4733
4826
  "aria-live": "polite",
4734
4827
  "aria-relevant": "additions text",
4735
4828
  "data-scrolling": scrolling ? "true" : void 0,
4736
4829
  children: [
4737
- loading && messages.value.length === 0 ? /* @__PURE__ */ jsx17("div", { class: `${p15}-list-loading`, role: "status", children: strings.messagesLoading }) : null,
4738
- rows
4830
+ loading && messages.value.length === 0 ? /* @__PURE__ */ jsx18("div", { class: `${p16}-list-loading`, role: "status", children: strings.messagesLoading }) : null,
4831
+ rows,
4832
+ inlineForm && onFormSubmit && onFormSkip ? /* @__PURE__ */ jsx18(FormCard, { form: inlineForm, strings, onSubmit: onFormSubmit, onSkip: onFormSkip }) : null
4739
4833
  ]
4740
4834
  }
4741
4835
  ),
4742
- showJump ? /* @__PURE__ */ jsx17(
4836
+ showJump ? /* @__PURE__ */ jsx18(
4743
4837
  "button",
4744
4838
  {
4745
4839
  type: "button",
4746
- class: `${p15}-jump`,
4840
+ class: `${p16}-jump`,
4747
4841
  onClick: jumpToBottom,
4748
4842
  "aria-label": strings.scrollToBottom,
4749
4843
  title: strings.scrollToBottom,
4750
4844
  "data-testid": TID.scrollToBottom,
4751
- children: /* @__PURE__ */ jsx17(ChevronDownIcon, {})
4845
+ children: /* @__PURE__ */ jsx18(ChevronDownIcon, {})
4752
4846
  }
4753
4847
  ) : null
4754
4848
  ] });
@@ -4807,7 +4901,7 @@ function startOfDay(ms) {
4807
4901
  }
4808
4902
 
4809
4903
  // src/ui/conversation-list.tsx
4810
- import { Fragment as Fragment2, jsx as jsx18, jsxs as jsxs15 } from "preact/jsx-runtime";
4904
+ import { Fragment as Fragment2, jsx as jsx19, jsxs as jsxs16 } from "preact/jsx-runtime";
4811
4905
  var log11 = logger.scope("history");
4812
4906
  var BUCKET_TO_STRING = {
4813
4907
  today: "dateToday",
@@ -4816,7 +4910,7 @@ var BUCKET_TO_STRING = {
4816
4910
  older: "dateOlder"
4817
4911
  };
4818
4912
  function ConversationList({ transport, strings, visitorId, onSelect, onNewChat }) {
4819
- const p33 = BRAND.cssPrefix;
4913
+ const p34 = BRAND.cssPrefix;
4820
4914
  const [state, setState] = useState7("loading");
4821
4915
  const [sessions, setChats] = useState7([]);
4822
4916
  useEffect9(() => {
@@ -4834,38 +4928,38 @@ function ConversationList({ transport, strings, visitorId, onSelect, onNewChat }
4834
4928
  cancelled = true;
4835
4929
  };
4836
4930
  }, [transport, visitorId]);
4837
- const newChatButton = onNewChat ? /* @__PURE__ */ jsx18("div", { class: `${p33}-history-footer`, children: /* @__PURE__ */ jsxs15("button", { type: "button", class: `${p33}-history-new`, onClick: onNewChat, "data-testid": TID.sidebarNewChat, children: [
4838
- /* @__PURE__ */ jsx18(PlusIcon, {}),
4931
+ const newChatButton = onNewChat ? /* @__PURE__ */ jsx19("div", { class: `${p34}-history-footer`, children: /* @__PURE__ */ jsxs16("button", { type: "button", class: `${p34}-history-new`, onClick: onNewChat, "data-testid": TID.sidebarNewChat, children: [
4932
+ /* @__PURE__ */ jsx19(PlusIcon, {}),
4839
4933
  strings.historyNewChat
4840
4934
  ] }) }) : null;
4841
4935
  if (state === "loading") {
4842
- return /* @__PURE__ */ jsxs15(Fragment2, { children: [
4843
- /* @__PURE__ */ jsx18("div", { class: `${p33}-history-empty`, children: strings.historyLoading }),
4936
+ return /* @__PURE__ */ jsxs16(Fragment2, { children: [
4937
+ /* @__PURE__ */ jsx19("div", { class: `${p34}-history-empty`, children: strings.historyLoading }),
4844
4938
  newChatButton
4845
4939
  ] });
4846
4940
  }
4847
4941
  if (state === "error" || sessions.length === 0) {
4848
- return /* @__PURE__ */ jsxs15(Fragment2, { children: [
4849
- /* @__PURE__ */ jsx18("div", { class: `${p33}-history-empty`, children: strings.historyEmpty }),
4942
+ return /* @__PURE__ */ jsxs16(Fragment2, { children: [
4943
+ /* @__PURE__ */ jsx19("div", { class: `${p34}-history-empty`, children: strings.historyEmpty }),
4850
4944
  newChatButton
4851
4945
  ] });
4852
4946
  }
4853
4947
  const groups = groupByBucket(Date.now(), sessions);
4854
- return /* @__PURE__ */ jsxs15(Fragment2, { children: [
4855
- /* @__PURE__ */ jsx18("div", { class: `${p33}-history`, role: "list", children: groups.map((group) => /* @__PURE__ */ jsxs15("div", { class: `${p33}-history-group`, children: [
4856
- /* @__PURE__ */ jsx18("div", { class: `${p33}-history-heading`, children: strings[BUCKET_TO_STRING[group.bucket]] }),
4857
- group.sessions.map((chat) => /* @__PURE__ */ jsxs15(
4948
+ return /* @__PURE__ */ jsxs16(Fragment2, { children: [
4949
+ /* @__PURE__ */ jsx19("div", { class: `${p34}-history`, role: "list", children: groups.map((group) => /* @__PURE__ */ jsxs16("div", { class: `${p34}-history-group`, children: [
4950
+ /* @__PURE__ */ jsx19("div", { class: `${p34}-history-heading`, children: strings[BUCKET_TO_STRING[group.bucket]] }),
4951
+ group.sessions.map((chat) => /* @__PURE__ */ jsxs16(
4858
4952
  "button",
4859
4953
  {
4860
4954
  type: "button",
4861
4955
  role: "listitem",
4862
- class: `${p33}-history-item`,
4956
+ class: `${p34}-history-item`,
4863
4957
  onClick: () => onSelect(chat),
4864
4958
  "data-closed": chat.canContinue ? void 0 : "true",
4865
4959
  "data-testid": tid(TID.historyItem, chat.sessionId),
4866
4960
  children: [
4867
- /* @__PURE__ */ jsx18("span", { class: `${p33}-history-title`, children: chat.title }),
4868
- chat.preview ? /* @__PURE__ */ jsx18("span", { class: `${p33}-history-preview`, children: chat.preview }) : null
4961
+ /* @__PURE__ */ jsx19("span", { class: `${p34}-history-title`, children: chat.title }),
4962
+ chat.preview ? /* @__PURE__ */ jsx19("span", { class: `${p34}-history-preview`, children: chat.preview }) : null
4869
4963
  ]
4870
4964
  },
4871
4965
  chat.sessionId
@@ -4876,21 +4970,21 @@ function ConversationList({ transport, strings, visitorId, onSelect, onNewChat }
4876
4970
  }
4877
4971
 
4878
4972
  // src/ui/chat-history-pane.tsx
4879
- import { jsx as jsx19 } from "preact/jsx-runtime";
4973
+ import { jsx as jsx20 } from "preact/jsx-runtime";
4880
4974
  function ChatHistoryPane(props2) {
4881
- return /* @__PURE__ */ jsx19(ConversationList, { ...props2 });
4975
+ return /* @__PURE__ */ jsx20(ConversationList, { ...props2 });
4882
4976
  }
4883
4977
 
4884
4978
  // src/ui/suggestions.tsx
4885
- import { jsx as jsx20 } from "preact/jsx-runtime";
4886
- var p16 = BRAND.cssPrefix;
4979
+ import { jsx as jsx21 } from "preact/jsx-runtime";
4980
+ var p17 = BRAND.cssPrefix;
4887
4981
  function Suggestions({ suggestions, onPick }) {
4888
4982
  if (suggestions.length === 0) return null;
4889
- return /* @__PURE__ */ jsx20("div", { class: `${p16}-suggestions`, role: "group", "aria-label": "Suggested replies", children: suggestions.map((s, i) => /* @__PURE__ */ jsx20(
4983
+ return /* @__PURE__ */ jsx21("div", { class: `${p17}-suggestions`, role: "group", "aria-label": "Suggested replies", children: suggestions.map((s, i) => /* @__PURE__ */ jsx21(
4890
4984
  "button",
4891
4985
  {
4892
4986
  type: "button",
4893
- class: `${p16}-suggestion`,
4987
+ class: `${p17}-suggestion`,
4894
4988
  onClick: () => onPick(s),
4895
4989
  "data-testid": tid(TID.suggestion, i),
4896
4990
  children: s.label
@@ -4900,8 +4994,8 @@ function Suggestions({ suggestions, onPick }) {
4900
4994
  }
4901
4995
 
4902
4996
  // src/ui/panel.tsx
4903
- import { Fragment as Fragment3, jsx as jsx21, jsxs as jsxs16 } from "preact/jsx-runtime";
4904
- var p17 = BRAND.cssPrefix;
4997
+ import { Fragment as Fragment3, jsx as jsx22, jsxs as jsxs17 } from "preact/jsx-runtime";
4998
+ var p18 = BRAND.cssPrefix;
4905
4999
  function Panel(props2) {
4906
5000
  const { options, onClose } = props2;
4907
5001
  const s = options.strings;
@@ -4925,18 +5019,18 @@ function Panel(props2) {
4925
5019
  }, []);
4926
5020
  const { visible: dragOver } = useFileDrop({ containerRef, onDrop: onDropItems });
4927
5021
  useDragMove(containerRef.current, options.mode === "modal");
4928
- return /* @__PURE__ */ jsxs16(
5022
+ return /* @__PURE__ */ jsxs17(
4929
5023
  "div",
4930
5024
  {
4931
5025
  ref: containerRef,
4932
- class: `${p17}-panel`,
5026
+ class: `${p18}-panel`,
4933
5027
  role: "dialog",
4934
5028
  "aria-modal": "false",
4935
5029
  "aria-label": s.panelTitle,
4936
5030
  style: { position: "relative" },
4937
5031
  "data-testid": TID.panel,
4938
5032
  children: [
4939
- /* @__PURE__ */ jsx21(
5033
+ /* @__PURE__ */ jsx22(
4940
5034
  PanelContent,
4941
5035
  {
4942
5036
  ...props2,
@@ -4945,7 +5039,7 @@ function Panel(props2) {
4945
5039
  composerAttachApiRef
4946
5040
  }
4947
5041
  ),
4948
- /* @__PURE__ */ jsx21(PoweredByBar, { poweredBy: props2.options.poweredBy })
5042
+ /* @__PURE__ */ jsx22(PoweredByBar, { poweredBy: props2.options.poweredBy })
4949
5043
  ]
4950
5044
  }
4951
5045
  );
@@ -4976,8 +5070,10 @@ function PanelContent(props2) {
4976
5070
  onSend,
4977
5071
  onStop,
4978
5072
  onSuggestion,
4979
- intakePending,
4980
- onIntakeComplete,
5073
+ blockingForm,
5074
+ inlineForm,
5075
+ onFormSubmit,
5076
+ onFormSkip,
4981
5077
  tool,
4982
5078
  containerEl,
4983
5079
  dragOver,
@@ -4985,12 +5081,12 @@ function PanelContent(props2) {
4985
5081
  } = props2;
4986
5082
  const s = options.strings;
4987
5083
  let composerArea;
4988
- if (intakePending) {
4989
- composerArea = /* @__PURE__ */ jsx21(IntakeGate, { intake: options.intake, strings: s, onComplete: onIntakeComplete });
5084
+ if (blockingForm) {
5085
+ composerArea = /* @__PURE__ */ jsx22(FormGate, { form: blockingForm, strings: s, onSubmit: onFormSubmit, onSkip: onFormSkip });
4990
5086
  } else if (canSend) {
4991
- composerArea = /* @__PURE__ */ jsxs16(Fragment3, { children: [
4992
- /* @__PURE__ */ jsx21(Suggestions, { suggestions, onPick: onSuggestion }),
4993
- /* @__PURE__ */ jsx21(
5087
+ composerArea = /* @__PURE__ */ jsxs17(Fragment3, { children: [
5088
+ /* @__PURE__ */ jsx22(Suggestions, { suggestions, onPick: onSuggestion }),
5089
+ /* @__PURE__ */ jsx22(
4994
5090
  Composer,
4995
5091
  {
4996
5092
  options,
@@ -5005,10 +5101,10 @@ function PanelContent(props2) {
5005
5101
  )
5006
5102
  ] });
5007
5103
  } else {
5008
- composerArea = /* @__PURE__ */ jsx21(ReadOnlyBanner, { label: s.chatClosed, ctaLabel: s.startNewConversation, onNewChat: onClear });
5104
+ composerArea = /* @__PURE__ */ jsx22(ReadOnlyBanner, { label: s.chatClosed, ctaLabel: s.startNewConversation, onNewChat: onClear });
5009
5105
  }
5010
- return /* @__PURE__ */ jsxs16(Fragment3, { children: [
5011
- view === "history" ? /* @__PURE__ */ jsx21(
5106
+ return /* @__PURE__ */ jsxs17(Fragment3, { children: [
5107
+ view === "history" ? /* @__PURE__ */ jsx22(
5012
5108
  HistoryHeader,
5013
5109
  {
5014
5110
  strings: s,
@@ -5016,22 +5112,22 @@ function PanelContent(props2) {
5016
5112
  onClose,
5017
5113
  showClose: canShowClose(options.mode, panelSize, options.actions)
5018
5114
  }
5019
- ) : /* @__PURE__ */ jsxs16("header", { class: `${p17}-header`, "data-testid": TID.panelHeader, children: [
5020
- onBack ? /* @__PURE__ */ jsx21(
5115
+ ) : /* @__PURE__ */ jsxs17("header", { class: `${p18}-header`, "data-testid": TID.panelHeader, children: [
5116
+ onBack ? /* @__PURE__ */ jsx22(
5021
5117
  "button",
5022
5118
  {
5023
5119
  type: "button",
5024
- class: `${p17}-icon-btn`,
5120
+ class: `${p18}-icon-btn`,
5025
5121
  onClick: onBack,
5026
5122
  "aria-label": s.moduleBack,
5027
5123
  title: s.moduleBack,
5028
- children: /* @__PURE__ */ jsx21(BackIcon, {})
5124
+ children: /* @__PURE__ */ jsx22(BackIcon, {})
5029
5125
  }
5030
5126
  ) : null,
5031
- agent ? /* @__PURE__ */ jsx21(AgentBadge, { agent }) : /* @__PURE__ */ jsx21("h1", { children: s.panelTitle }),
5032
- /* @__PURE__ */ jsx21(HeaderActions, { panelProps: props2, variant: "chat" })
5127
+ agent ? /* @__PURE__ */ jsx22(AgentBadge, { agent }) : /* @__PURE__ */ jsx22("h1", { children: s.panelTitle }),
5128
+ /* @__PURE__ */ jsx22(HeaderActions, { panelProps: props2, variant: "chat" })
5033
5129
  ] }),
5034
- view === "history" ? /* @__PURE__ */ jsx21(
5130
+ view === "history" ? /* @__PURE__ */ jsx22(
5035
5131
  ChatHistoryPane,
5036
5132
  {
5037
5133
  transport,
@@ -5040,9 +5136,9 @@ function PanelContent(props2) {
5040
5136
  onSelect: (chat) => onSelectHistoryChat(chat.sessionId),
5041
5137
  onNewChat
5042
5138
  }
5043
- ) : /* @__PURE__ */ jsxs16(Fragment3, { children: [
5044
- /* @__PURE__ */ jsx21(DropZone, { visible: dragOver, strings: s }),
5045
- /* @__PURE__ */ jsx21(
5139
+ ) : /* @__PURE__ */ jsxs17(Fragment3, { children: [
5140
+ /* @__PURE__ */ jsx22(DropZone, { visible: dragOver, strings: s }),
5141
+ /* @__PURE__ */ jsx22(
5046
5142
  MessageList,
5047
5143
  {
5048
5144
  messagesSig,
@@ -5052,13 +5148,16 @@ function PanelContent(props2) {
5052
5148
  showToolCalls: options.showToolCalls,
5053
5149
  loading: loadingMessages,
5054
5150
  idle: !isStreaming,
5055
- tool
5151
+ tool,
5152
+ inlineForm,
5153
+ onFormSubmit,
5154
+ onFormSkip
5056
5155
  }
5057
5156
  ),
5058
5157
  composerArea,
5059
- /* @__PURE__ */ jsx21(ComposerFooter, { disclaimer: options.composerDisclaimer })
5158
+ /* @__PURE__ */ jsx22(ComposerFooter, { disclaimer: options.composerDisclaimer })
5060
5159
  ] }),
5061
- options.size.resize?.enabled ? /* @__PURE__ */ jsx21(
5160
+ options.size.resize?.enabled ? /* @__PURE__ */ jsx22(
5062
5161
  ResizeGrip,
5063
5162
  {
5064
5163
  panelEl: containerEl,
@@ -5077,86 +5176,157 @@ function HistoryHeader({
5077
5176
  onClose,
5078
5177
  showClose
5079
5178
  }) {
5080
- return /* @__PURE__ */ jsxs16("header", { class: `${p17}-header`, children: [
5081
- /* @__PURE__ */ jsx21(
5179
+ return /* @__PURE__ */ jsxs17("header", { class: `${p18}-header`, children: [
5180
+ /* @__PURE__ */ jsx22(
5082
5181
  "button",
5083
5182
  {
5084
5183
  type: "button",
5085
- class: `${p17}-icon-btn`,
5184
+ class: `${p18}-icon-btn`,
5086
5185
  onClick: onBack,
5087
5186
  "aria-label": strings.historyBack,
5088
5187
  title: strings.historyBack,
5089
- children: /* @__PURE__ */ jsx21(BackIcon, {})
5188
+ children: /* @__PURE__ */ jsx22(BackIcon, {})
5090
5189
  }
5091
5190
  ),
5092
- /* @__PURE__ */ jsx21("h1", { children: strings.historyTitle }),
5093
- showClose ? /* @__PURE__ */ jsx21(
5191
+ /* @__PURE__ */ jsx22("h1", { children: strings.historyTitle }),
5192
+ showClose ? /* @__PURE__ */ jsx22(
5094
5193
  "button",
5095
5194
  {
5096
5195
  type: "button",
5097
- class: `${p17}-icon-btn`,
5196
+ class: `${p18}-icon-btn`,
5098
5197
  onClick: onClose,
5099
5198
  "aria-label": strings.close,
5100
5199
  title: strings.close,
5101
- children: /* @__PURE__ */ jsx21(CloseIcon, {})
5200
+ children: /* @__PURE__ */ jsx22(CloseIcon, {})
5102
5201
  }
5103
5202
  ) : null
5104
5203
  ] });
5105
5204
  }
5106
5205
  function ReadOnlyBanner({ label, ctaLabel, onNewChat }) {
5107
- return /* @__PURE__ */ jsxs16("div", { class: `${p17}-readonly-banner`, role: "note", children: [
5108
- /* @__PURE__ */ jsx21("span", { class: `${p17}-readonly-label`, children: label }),
5109
- /* @__PURE__ */ jsx21("button", { type: "button", class: `${p17}-readonly-cta`, onClick: onNewChat, children: ctaLabel })
5206
+ return /* @__PURE__ */ jsxs17("div", { class: `${p18}-readonly-banner`, role: "note", children: [
5207
+ /* @__PURE__ */ jsx22("span", { class: `${p18}-readonly-label`, children: label }),
5208
+ /* @__PURE__ */ jsx22("button", { type: "button", class: `${p18}-readonly-cta`, onClick: onNewChat, children: ctaLabel })
5110
5209
  ] });
5111
5210
  }
5112
5211
  function ComposerFooter({ disclaimer }) {
5113
5212
  if (!disclaimer) return null;
5114
- return /* @__PURE__ */ jsx21("div", { class: `${p17}-composer-footer`, children: /* @__PURE__ */ jsx21("div", { class: `${p17}-disclaimer`, children: disclaimer }) });
5213
+ return /* @__PURE__ */ jsx22("div", { class: `${p18}-composer-footer`, children: /* @__PURE__ */ jsx22("div", { class: `${p18}-disclaimer`, children: disclaimer }) });
5115
5214
  }
5116
5215
  function PoweredByBar({ poweredBy }) {
5117
5216
  if (!poweredBy) return null;
5118
- return /* @__PURE__ */ jsx21("div", { class: `${p17}-poweredby-bar`, children: /* @__PURE__ */ jsx21(PoweredBy, { logoUrl: poweredBy.logoUrl, text: poweredBy.text, href: poweredBy.href }) });
5217
+ return /* @__PURE__ */ jsx22("div", { class: `${p18}-poweredby-bar`, children: /* @__PURE__ */ jsx22(PoweredBy, { logoUrl: poweredBy.logoUrl, text: poweredBy.text, href: poweredBy.href }) });
5119
5218
  }
5120
5219
  function PoweredBy({ logoUrl, text, href }) {
5121
- const inner = /* @__PURE__ */ jsxs16(Fragment3, { children: [
5122
- logoUrl ? /* @__PURE__ */ jsx21("img", { class: `${p17}-poweredby-logo`, src: logoUrl, alt: "", loading: "lazy" }) : null,
5123
- text ? /* @__PURE__ */ jsx21("span", { children: text }) : null
5220
+ const inner = /* @__PURE__ */ jsxs17(Fragment3, { children: [
5221
+ logoUrl ? /* @__PURE__ */ jsx22("img", { class: `${p18}-poweredby-logo`, src: logoUrl, alt: "", loading: "lazy" }) : null,
5222
+ text ? /* @__PURE__ */ jsx22("span", { children: text }) : null
5124
5223
  ] });
5125
5224
  if (href) {
5126
- return /* @__PURE__ */ jsx21("a", { class: `${p17}-poweredby`, href, target: "_blank", rel: "noopener noreferrer", children: inner });
5225
+ return /* @__PURE__ */ jsx22("a", { class: `${p18}-poweredby`, href, target: "_blank", rel: "noopener noreferrer", children: inner });
5226
+ }
5227
+ return /* @__PURE__ */ jsx22("span", { class: `${p18}-poweredby`, children: inner });
5228
+ }
5229
+
5230
+ // src/ui/form/form-controller.ts
5231
+ import { signal as signal5 } from "@preact/signals";
5232
+ import { useRef as useRef7 } from "preact/hooks";
5233
+ function useForms(deps) {
5234
+ const depsRef = useRef7(deps);
5235
+ depsRef.current = deps;
5236
+ const ctrlRef = useRef7(null);
5237
+ ctrlRef.current ?? (ctrlRef.current = createController(depsRef));
5238
+ return ctrlRef.current;
5239
+ }
5240
+ function createController(depsRef) {
5241
+ const activeForm = signal5(null);
5242
+ const sessionDone = /* @__PURE__ */ new Set();
5243
+ const isDone = (form) => {
5244
+ if (form.frequency === "always") return false;
5245
+ if (form.frequency === "session") return sessionDone.has(form.id);
5246
+ return form.id in depsRef.current.persistence.loadFormsDone();
5247
+ };
5248
+ const fire = (kind, param) => {
5249
+ if (activeForm.value) return;
5250
+ const d = depsRef.current;
5251
+ if (kind === "manual") {
5252
+ const form = d.forms.list.find((f) => f.id === param);
5253
+ if (form) activeForm.value = { form, trigger: "manual" };
5254
+ return;
5255
+ }
5256
+ for (const form of d.forms.byTrigger[kind] ?? []) {
5257
+ const t = form.triggers.find((tr) => tr.kind === kind);
5258
+ if (!t || !triggerMatches(t, d) || isDone(form) || !whenPasses(form, d)) continue;
5259
+ activeForm.value = { form, trigger: kind };
5260
+ return;
5261
+ }
5262
+ };
5263
+ const finish = (values, skipped) => {
5264
+ const active = activeForm.value;
5265
+ if (!active) return;
5266
+ activeForm.value = null;
5267
+ const { form, trigger } = active;
5268
+ if (form.frequency === "session") sessionDone.add(form.id);
5269
+ else if (form.frequency !== "always") depsRef.current.persistence.saveFormDone(form.id);
5270
+ depsRef.current.onComplete(form, trigger, values, skipped);
5271
+ };
5272
+ return {
5273
+ activeForm,
5274
+ fire,
5275
+ complete: (values) => finish(values, false),
5276
+ skip: () => finish({}, true)
5277
+ };
5278
+ }
5279
+ function triggerMatches(t, d) {
5280
+ if (t.kind === "after-messages") return d.messageCount() >= Number(t.param ?? 0);
5281
+ if (t.kind === "page-area") return d.pageArea() === t.param;
5282
+ return true;
5283
+ }
5284
+ function whenPasses(form, d) {
5285
+ const w = form.when;
5286
+ if (!w) return true;
5287
+ if (w.missingContext?.length) {
5288
+ const ctx = d.userContext() ?? {};
5289
+ if (w.missingContext.some((key) => ctx[key] !== void 0 && ctx[key] !== "")) return false;
5290
+ }
5291
+ if (w.pageArea) {
5292
+ const areas = Array.isArray(w.pageArea) ? w.pageArea : [w.pageArea];
5293
+ if (!areas.includes(d.pageArea() ?? "")) return false;
5127
5294
  }
5128
- return /* @__PURE__ */ jsx21("span", { class: `${p17}-poweredby`, children: inner });
5295
+ const count = d.messageCount();
5296
+ if (w.minMessages != null && count < w.minMessages) return false;
5297
+ if (w.maxMessages != null && count > w.maxMessages) return false;
5298
+ return true;
5129
5299
  }
5130
5300
 
5131
5301
  // src/ui/sidebar.tsx
5132
- import { Fragment as Fragment4, jsx as jsx22, jsxs as jsxs17 } from "preact/jsx-runtime";
5302
+ import { Fragment as Fragment4, jsx as jsx23, jsxs as jsxs18 } from "preact/jsx-runtime";
5133
5303
  function Sidebar(props2) {
5134
- const p33 = BRAND.cssPrefix;
5304
+ const p34 = BRAND.cssPrefix;
5135
5305
  const { site, blocks, strings, collapsed } = props2;
5136
5306
  const navigation = blocks?.navigation ?? [];
5137
5307
  const linkCards = blocks?.linkCards ?? [];
5138
5308
  const toggleLabel = collapsed ? strings.expandSidebar : strings.collapseSidebar;
5139
- return /* @__PURE__ */ jsxs17("aside", { class: `${p33}-sidebar`, "data-collapsed": collapsed ? "true" : "false", "data-testid": TID.sidebar, children: [
5140
- /* @__PURE__ */ jsxs17("div", { class: `${p33}-sidebar-header`, children: [
5141
- /* @__PURE__ */ jsx22(SidebarBrand, { site }),
5142
- /* @__PURE__ */ jsx22(
5309
+ return /* @__PURE__ */ jsxs18("aside", { class: `${p34}-sidebar`, "data-collapsed": collapsed ? "true" : "false", "data-testid": TID.sidebar, children: [
5310
+ /* @__PURE__ */ jsxs18("div", { class: `${p34}-sidebar-header`, children: [
5311
+ /* @__PURE__ */ jsx23(SidebarBrand, { site }),
5312
+ /* @__PURE__ */ jsx23(
5143
5313
  "button",
5144
5314
  {
5145
5315
  type: "button",
5146
- class: `${p33}-sidebar-toggle`,
5316
+ class: `${p34}-sidebar-toggle`,
5147
5317
  "aria-label": toggleLabel,
5148
5318
  "aria-expanded": collapsed ? "false" : "true",
5149
5319
  title: toggleLabel,
5150
5320
  onClick: props2.onToggleCollapsed,
5151
5321
  "data-testid": TID.sidebarToggle,
5152
- children: /* @__PURE__ */ jsx22(SidebarToggleIcon, { collapsed })
5322
+ children: /* @__PURE__ */ jsx23(SidebarToggleIcon, { collapsed })
5153
5323
  }
5154
5324
  )
5155
5325
  ] }),
5156
- collapsed ? null : /* @__PURE__ */ jsxs17(Fragment4, { children: [
5157
- navigation.length > 0 ? /* @__PURE__ */ jsx22("nav", { class: `${p33}-sidebar-section`, "data-section": "navigation", children: /* @__PURE__ */ jsx22(SidebarNav, { items: navigation }) }) : null,
5158
- linkCards.length > 0 ? /* @__PURE__ */ jsx22("div", { class: `${p33}-sidebar-section`, "data-section": "link-cards", children: /* @__PURE__ */ jsx22(SidebarCards, { items: linkCards }) }) : null,
5159
- props2.showConversations ? /* @__PURE__ */ jsx22("div", { class: `${p33}-sidebar-conversations`, children: /* @__PURE__ */ jsx22(
5326
+ collapsed ? null : /* @__PURE__ */ jsxs18(Fragment4, { children: [
5327
+ navigation.length > 0 ? /* @__PURE__ */ jsx23("nav", { class: `${p34}-sidebar-section`, "data-section": "navigation", children: /* @__PURE__ */ jsx23(SidebarNav, { items: navigation }) }) : null,
5328
+ linkCards.length > 0 ? /* @__PURE__ */ jsx23("div", { class: `${p34}-sidebar-section`, "data-section": "link-cards", children: /* @__PURE__ */ jsx23(SidebarCards, { items: linkCards }) }) : null,
5329
+ props2.showConversations ? /* @__PURE__ */ jsx23("div", { class: `${p34}-sidebar-conversations`, children: /* @__PURE__ */ jsx23(
5160
5330
  ConversationList,
5161
5331
  {
5162
5332
  transport: props2.transport,
@@ -5170,18 +5340,18 @@ function Sidebar(props2) {
5170
5340
  ] });
5171
5341
  }
5172
5342
  function SidebarBrand({ site }) {
5173
- const p33 = BRAND.cssPrefix;
5343
+ const p34 = BRAND.cssPrefix;
5174
5344
  if (site?.logo?.url) {
5175
5345
  const alt = site.logo.alt ?? site.title ?? "Logo";
5176
- return /* @__PURE__ */ jsxs17("picture", { children: [
5177
- site.logoDark?.url ? /* @__PURE__ */ jsx22("source", { srcset: site.logoDark.url, media: "(prefers-color-scheme: dark)" }) : null,
5178
- /* @__PURE__ */ jsx22("img", { class: `${p33}-sidebar-logo`, src: site.logo.url, alt })
5346
+ return /* @__PURE__ */ jsxs18("picture", { children: [
5347
+ site.logoDark?.url ? /* @__PURE__ */ jsx23("source", { srcset: site.logoDark.url, media: "(prefers-color-scheme: dark)" }) : null,
5348
+ /* @__PURE__ */ jsx23("img", { class: `${p34}-sidebar-logo`, src: site.logo.url, alt })
5179
5349
  ] });
5180
5350
  }
5181
- return /* @__PURE__ */ jsx22("div", { class: `${p33}-sidebar-title`, children: site?.title ?? BRAND.name });
5351
+ return /* @__PURE__ */ jsx23("div", { class: `${p34}-sidebar-title`, children: site?.title ?? BRAND.name });
5182
5352
  }
5183
5353
  function SidebarToggleIcon({ collapsed }) {
5184
- return /* @__PURE__ */ jsx22(
5354
+ return /* @__PURE__ */ jsx23(
5185
5355
  "svg",
5186
5356
  {
5187
5357
  width: "16",
@@ -5191,38 +5361,38 @@ function SidebarToggleIcon({ collapsed }) {
5191
5361
  stroke: "currentColor",
5192
5362
  "stroke-width": "2",
5193
5363
  "aria-hidden": "true",
5194
- children: collapsed ? /* @__PURE__ */ jsx22("polyline", { points: "9 6 15 12 9 18" }) : /* @__PURE__ */ jsx22("polyline", { points: "15 6 9 12 15 18" })
5364
+ children: collapsed ? /* @__PURE__ */ jsx23("polyline", { points: "9 6 15 12 9 18" }) : /* @__PURE__ */ jsx23("polyline", { points: "15 6 9 12 15 18" })
5195
5365
  }
5196
5366
  );
5197
5367
  }
5198
5368
  function SidebarNav({ items }) {
5199
- const p33 = BRAND.cssPrefix;
5200
- return /* @__PURE__ */ jsx22("ul", { class: `${p33}-sidebar-nav`, children: items.map((item) => /* @__PURE__ */ jsx22("li", { children: /* @__PURE__ */ jsxs17(
5369
+ const p34 = BRAND.cssPrefix;
5370
+ return /* @__PURE__ */ jsx23("ul", { class: `${p34}-sidebar-nav`, children: items.map((item) => /* @__PURE__ */ jsx23("li", { children: /* @__PURE__ */ jsxs18(
5201
5371
  "a",
5202
5372
  {
5203
- class: `${p33}-sidebar-nav-item`,
5373
+ class: `${p34}-sidebar-nav-item`,
5204
5374
  href: item.href,
5205
5375
  target: item.href ? "_blank" : void 0,
5206
5376
  rel: item.href ? "noreferrer" : void 0,
5207
5377
  children: [
5208
- item.icon ? /* @__PURE__ */ jsx22("span", { class: `${p33}-sidebar-nav-icon`, "data-icon": item.icon }) : null,
5209
- /* @__PURE__ */ jsx22("span", { class: `${p33}-sidebar-nav-label`, children: item.label })
5378
+ item.icon ? /* @__PURE__ */ jsx23("span", { class: `${p34}-sidebar-nav-icon`, "data-icon": item.icon }) : null,
5379
+ /* @__PURE__ */ jsx23("span", { class: `${p34}-sidebar-nav-label`, children: item.label })
5210
5380
  ]
5211
5381
  }
5212
5382
  ) }, item.id ?? item.label)) });
5213
5383
  }
5214
5384
  function SidebarCards({ items }) {
5215
- const p33 = BRAND.cssPrefix;
5216
- return /* @__PURE__ */ jsx22("div", { class: `${p33}-sidebar-cards`, children: items.map((item) => /* @__PURE__ */ jsxs17(
5385
+ const p34 = BRAND.cssPrefix;
5386
+ return /* @__PURE__ */ jsx23("div", { class: `${p34}-sidebar-cards`, children: items.map((item) => /* @__PURE__ */ jsxs18(
5217
5387
  "a",
5218
5388
  {
5219
- class: `${p33}-sidebar-card`,
5389
+ class: `${p34}-sidebar-card`,
5220
5390
  href: item.href,
5221
5391
  target: item.href ? "_blank" : void 0,
5222
5392
  rel: item.href ? "noreferrer" : void 0,
5223
5393
  children: [
5224
- /* @__PURE__ */ jsx22("div", { class: `${p33}-sidebar-card-label`, children: item.label }),
5225
- item.description ? /* @__PURE__ */ jsx22("div", { class: `${p33}-sidebar-card-desc`, children: item.description }) : null
5394
+ /* @__PURE__ */ jsx23("div", { class: `${p34}-sidebar-card-label`, children: item.label }),
5395
+ item.description ? /* @__PURE__ */ jsx23("div", { class: `${p34}-sidebar-card-desc`, children: item.description }) : null
5226
5396
  ]
5227
5397
  },
5228
5398
  item.id ?? item.label
@@ -5230,11 +5400,11 @@ function SidebarCards({ items }) {
5230
5400
  }
5231
5401
 
5232
5402
  // src/ui/page-shell.tsx
5233
- import { jsx as jsx23, jsxs as jsxs18 } from "preact/jsx-runtime";
5234
- var p18 = BRAND.cssPrefix;
5403
+ import { jsx as jsx24, jsxs as jsxs19 } from "preact/jsx-runtime";
5404
+ var p19 = BRAND.cssPrefix;
5235
5405
  function PageShell(props2) {
5236
- return /* @__PURE__ */ jsxs18("main", { class: `${p18}-page-shell`, "data-sidebar-collapsed": props2.sidebarCollapsed ? "true" : "false", children: [
5237
- /* @__PURE__ */ jsx23(
5406
+ return /* @__PURE__ */ jsxs19("main", { class: `${p19}-page-shell`, "data-sidebar-collapsed": props2.sidebarCollapsed ? "true" : "false", children: [
5407
+ /* @__PURE__ */ jsx24(
5238
5408
  Sidebar,
5239
5409
  {
5240
5410
  site: props2.site,
@@ -5249,15 +5419,15 @@ function PageShell(props2) {
5249
5419
  onToggleCollapsed: props2.onToggleSidebarCollapsed
5250
5420
  }
5251
5421
  ),
5252
- /* @__PURE__ */ jsx23("section", { class: `${p18}-page-chat`, "aria-label": "Chat", children: props2.children })
5422
+ /* @__PURE__ */ jsx24("section", { class: `${p19}-page-chat`, "aria-label": "Chat", children: props2.children })
5253
5423
  ] });
5254
5424
  }
5255
5425
 
5256
5426
  // src/ui/home-nav.ts
5257
- import { signal as signal5 } from "@preact/signals";
5427
+ import { signal as signal6 } from "@preact/signals";
5258
5428
  var emptyStacks = (tabs) => Object.fromEntries(tabs.map((t) => [t, []]));
5259
5429
  function createHomeNav(initialTab, tabs, onSwitch) {
5260
- const sig = signal5({ activeTab: initialTab, stacks: emptyStacks(tabs) });
5430
+ const sig = signal6({ activeTab: initialTab, stacks: emptyStacks(tabs) });
5261
5431
  return {
5262
5432
  sig,
5263
5433
  switchTab(tab) {
@@ -5286,7 +5456,7 @@ var topScreen = (s) => activeStack(s).at(-1);
5286
5456
  var atTabRoot = (s) => activeStack(s).length === 0;
5287
5457
 
5288
5458
  // src/ui/messenger-home.tsx
5289
- import { useCallback as useCallback4, useEffect as useEffect15, useRef as useRef7 } from "preact/hooks";
5459
+ import { useCallback as useCallback4, useEffect as useEffect15, useRef as useRef8 } from "preact/hooks";
5290
5460
  import { useComputed as useComputed6 } from "@preact/signals";
5291
5461
 
5292
5462
  // src/ui/modules/messages.tsx
@@ -5299,80 +5469,80 @@ var chatLayout = {
5299
5469
  import { useEffect as useEffect11, useMemo as useMemo2, useState as useState8 } from "preact/hooks";
5300
5470
 
5301
5471
  // src/ui/back-header.tsx
5302
- import { jsx as jsx24, jsxs as jsxs19 } from "preact/jsx-runtime";
5303
- var p19 = BRAND.cssPrefix;
5472
+ import { jsx as jsx25, jsxs as jsxs20 } from "preact/jsx-runtime";
5473
+ var p20 = BRAND.cssPrefix;
5304
5474
  function TitleBar({ title, actions }) {
5305
- return /* @__PURE__ */ jsxs19("header", { class: `${p19}-back-header`, "data-variant": "title", children: [
5306
- /* @__PURE__ */ jsx24("span", { class: `${p19}-back-spacer`, "aria-hidden": "true" }),
5307
- /* @__PURE__ */ jsx24("h1", { class: `${p19}-back-title`, children: title }),
5308
- actions ?? /* @__PURE__ */ jsx24("span", { class: `${p19}-back-spacer`, "aria-hidden": "true" })
5475
+ return /* @__PURE__ */ jsxs20("header", { class: `${p20}-back-header`, "data-variant": "title", children: [
5476
+ /* @__PURE__ */ jsx25("span", { class: `${p20}-back-spacer`, "aria-hidden": "true" }),
5477
+ /* @__PURE__ */ jsx25("h1", { class: `${p20}-back-title`, children: title }),
5478
+ actions ?? /* @__PURE__ */ jsx25("span", { class: `${p20}-back-spacer`, "aria-hidden": "true" })
5309
5479
  ] });
5310
5480
  }
5311
5481
  function BackHeader({ title, backLabel, onBack, actions, testid }) {
5312
- return /* @__PURE__ */ jsxs19("header", { class: `${p19}-back-header`, "data-testid": testid, children: [
5313
- /* @__PURE__ */ jsx24("button", { type: "button", class: `${p19}-icon-btn`, onClick: onBack, "aria-label": backLabel, title: backLabel, children: /* @__PURE__ */ jsx24(BackIcon, {}) }),
5314
- /* @__PURE__ */ jsx24("h1", { class: `${p19}-back-title`, children: title }),
5315
- actions ?? /* @__PURE__ */ jsx24("span", { class: `${p19}-back-spacer`, "aria-hidden": "true" })
5482
+ return /* @__PURE__ */ jsxs20("header", { class: `${p20}-back-header`, "data-testid": testid, children: [
5483
+ /* @__PURE__ */ jsx25("button", { type: "button", class: `${p20}-icon-btn`, onClick: onBack, "aria-label": backLabel, title: backLabel, children: /* @__PURE__ */ jsx25(BackIcon, {}) }),
5484
+ /* @__PURE__ */ jsx25("h1", { class: `${p20}-back-title`, children: title }),
5485
+ actions ?? /* @__PURE__ */ jsx25("span", { class: `${p20}-back-spacer`, "aria-hidden": "true" })
5316
5486
  ] });
5317
5487
  }
5318
5488
 
5319
5489
  // src/ui/home-search.tsx
5320
- import { jsx as jsx25, jsxs as jsxs20 } from "preact/jsx-runtime";
5321
- var p20 = BRAND.cssPrefix;
5490
+ import { jsx as jsx26, jsxs as jsxs21 } from "preact/jsx-runtime";
5491
+ var p21 = BRAND.cssPrefix;
5322
5492
  function HomeSearchButton({ placeholder, onActivate }) {
5323
- return /* @__PURE__ */ jsxs20("button", { type: "button", class: `${p20}-home-search`, onClick: onActivate, "data-testid": TID.homeSearch, children: [
5324
- /* @__PURE__ */ jsx25("span", { class: `${p20}-home-search-text`, children: placeholder }),
5325
- /* @__PURE__ */ jsx25("span", { class: `${p20}-home-search-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx25(SearchIcon, {}) })
5493
+ return /* @__PURE__ */ jsxs21("button", { type: "button", class: `${p21}-home-search`, onClick: onActivate, "data-testid": TID.homeSearch, children: [
5494
+ /* @__PURE__ */ jsx26("span", { class: `${p21}-home-search-text`, children: placeholder }),
5495
+ /* @__PURE__ */ jsx26("span", { class: `${p21}-home-search-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx26(SearchIcon, {}) })
5326
5496
  ] });
5327
5497
  }
5328
5498
  function HelpSearchInput({ placeholder, value, onInput }) {
5329
- return /* @__PURE__ */ jsxs20("div", { class: `${p20}-home-search`, "data-input": "true", children: [
5330
- /* @__PURE__ */ jsx25(
5499
+ return /* @__PURE__ */ jsxs21("div", { class: `${p21}-home-search`, "data-input": "true", children: [
5500
+ /* @__PURE__ */ jsx26(
5331
5501
  "input",
5332
5502
  {
5333
5503
  type: "search",
5334
- class: `${p20}-home-search-input`,
5504
+ class: `${p21}-home-search-input`,
5335
5505
  placeholder,
5336
5506
  value,
5337
5507
  onInput: (e) => onInput(e.currentTarget.value),
5338
5508
  "data-testid": TID.helpSearch
5339
5509
  }
5340
5510
  ),
5341
- /* @__PURE__ */ jsx25("span", { class: `${p20}-home-search-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx25(SearchIcon, {}) })
5511
+ /* @__PURE__ */ jsx26("span", { class: `${p21}-home-search-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx26(SearchIcon, {}) })
5342
5512
  ] });
5343
5513
  }
5344
5514
 
5345
5515
  // src/ui/list-row.tsx
5346
- import { jsx as jsx26, jsxs as jsxs21 } from "preact/jsx-runtime";
5347
- var p21 = BRAND.cssPrefix;
5516
+ import { jsx as jsx27, jsxs as jsxs22 } from "preact/jsx-runtime";
5517
+ var p22 = BRAND.cssPrefix;
5348
5518
  function ListRow({ title, subtitle, onClick, testid }) {
5349
- return /* @__PURE__ */ jsxs21("button", { type: "button", class: `${p21}-list-row`, onClick, "data-testid": testid, children: [
5350
- /* @__PURE__ */ jsxs21("span", { class: `${p21}-list-row-body`, children: [
5351
- /* @__PURE__ */ jsx26("span", { class: `${p21}-list-row-title`, children: title }),
5352
- subtitle ? /* @__PURE__ */ jsx26("span", { class: `${p21}-list-row-sub`, children: subtitle }) : null
5519
+ return /* @__PURE__ */ jsxs22("button", { type: "button", class: `${p22}-list-row`, onClick, "data-testid": testid, children: [
5520
+ /* @__PURE__ */ jsxs22("span", { class: `${p22}-list-row-body`, children: [
5521
+ /* @__PURE__ */ jsx27("span", { class: `${p22}-list-row-title`, children: title }),
5522
+ subtitle ? /* @__PURE__ */ jsx27("span", { class: `${p22}-list-row-sub`, children: subtitle }) : null
5353
5523
  ] }),
5354
- /* @__PURE__ */ jsx26("span", { class: `${p21}-list-row-chevron`, "aria-hidden": "true", children: /* @__PURE__ */ jsx26(ChevronRightIcon, {}) })
5524
+ /* @__PURE__ */ jsx27("span", { class: `${p22}-list-row-chevron`, "aria-hidden": "true", children: /* @__PURE__ */ jsx27(ChevronRightIcon, {}) })
5355
5525
  ] });
5356
5526
  }
5357
5527
 
5358
5528
  // src/ui/module-state.tsx
5359
- import { jsx as jsx27, jsxs as jsxs22 } from "preact/jsx-runtime";
5360
- var p22 = BRAND.cssPrefix;
5529
+ import { jsx as jsx28, jsxs as jsxs23 } from "preact/jsx-runtime";
5530
+ var p23 = BRAND.cssPrefix;
5361
5531
  function ModuleState({
5362
5532
  tone = "info",
5363
5533
  message,
5364
5534
  onRetry,
5365
5535
  strings
5366
5536
  }) {
5367
- return /* @__PURE__ */ jsxs22("div", { class: `${p22}-module-empty`, role: tone === "error" ? "alert" : "status", "aria-live": "polite", children: [
5368
- /* @__PURE__ */ jsx27("span", { children: message }),
5369
- onRetry ? /* @__PURE__ */ jsx27("button", { type: "button", class: `${p22}-module-retry`, onClick: onRetry, children: strings.errorRetry }) : null
5537
+ return /* @__PURE__ */ jsxs23("div", { class: `${p23}-module-empty`, role: tone === "error" ? "alert" : "status", "aria-live": "polite", children: [
5538
+ /* @__PURE__ */ jsx28("span", { children: message }),
5539
+ onRetry ? /* @__PURE__ */ jsx28("button", { type: "button", class: `${p23}-module-retry`, onClick: onRetry, children: strings.errorRetry }) : null
5370
5540
  ] });
5371
5541
  }
5372
5542
 
5373
5543
  // src/ui/modules/help.tsx
5374
- import { jsx as jsx28, jsxs as jsxs23 } from "preact/jsx-runtime";
5375
- var p23 = BRAND.cssPrefix;
5544
+ import { jsx as jsx29, jsxs as jsxs24 } from "preact/jsx-runtime";
5545
+ var p24 = BRAND.cssPrefix;
5376
5546
  var log12 = logger.scope("help");
5377
5547
  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 });
5378
5548
  function groupByCategory(items) {
@@ -5401,7 +5571,7 @@ function fuzzySearch(items, query) {
5401
5571
  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);
5402
5572
  }
5403
5573
  function ArticleRow({ article, nav }) {
5404
- return /* @__PURE__ */ jsx28(
5574
+ return /* @__PURE__ */ jsx29(
5405
5575
  ListRow,
5406
5576
  {
5407
5577
  title: article.title,
@@ -5438,46 +5608,46 @@ function HelpRoot({ transport, strings, config, nav, panelProps }) {
5438
5608
  const results = useMemo2(() => fuzzySearch(items, query), [items, query]);
5439
5609
  function renderBody() {
5440
5610
  if (query.trim().length > 0) {
5441
- if (results.length === 0) return /* @__PURE__ */ jsx28(ModuleState, { message: strings.helpSearchEmpty, strings });
5442
- return /* @__PURE__ */ jsx28("div", { class: `${p23}-help-card`, children: results.map((a) => /* @__PURE__ */ jsx28(ArticleRow, { article: a, nav }, a.id)) });
5611
+ if (results.length === 0) return /* @__PURE__ */ jsx29(ModuleState, { message: strings.helpSearchEmpty, strings });
5612
+ return /* @__PURE__ */ jsx29("div", { class: `${p24}-help-card`, children: results.map((a) => /* @__PURE__ */ jsx29(ArticleRow, { article: a, nav }, a.id)) });
5443
5613
  }
5444
- if (state === "loading") return /* @__PURE__ */ jsx28(ModuleState, { message: strings.helpLoading, strings });
5614
+ if (state === "loading") return /* @__PURE__ */ jsx29(ModuleState, { message: strings.helpLoading, strings });
5445
5615
  if (state === "error") {
5446
- return /* @__PURE__ */ jsx28(ModuleState, { tone: "error", message: errorMsg, onRetry: () => setReloadKey((k) => k + 1), strings });
5616
+ return /* @__PURE__ */ jsx29(ModuleState, { tone: "error", message: errorMsg, onRetry: () => setReloadKey((k) => k + 1), strings });
5447
5617
  }
5448
- if (items.length === 0) return /* @__PURE__ */ jsx28(ModuleState, { message: strings.helpEmpty, strings });
5449
- return groupByCategory(items).map(([category, rows]) => /* @__PURE__ */ jsxs23("section", { class: `${p23}-help-group`, children: [
5450
- category ? /* @__PURE__ */ jsx28("h2", { class: `${p23}-help-section-title`, children: category }) : null,
5451
- /* @__PURE__ */ jsx28("div", { class: `${p23}-help-card`, children: rows.map((a) => /* @__PURE__ */ jsx28(ArticleRow, { article: a, nav }, a.id)) })
5618
+ if (items.length === 0) return /* @__PURE__ */ jsx29(ModuleState, { message: strings.helpEmpty, strings });
5619
+ return groupByCategory(items).map(([category, rows]) => /* @__PURE__ */ jsxs24("section", { class: `${p24}-help-group`, children: [
5620
+ category ? /* @__PURE__ */ jsx29("h2", { class: `${p24}-help-section-title`, children: category }) : null,
5621
+ /* @__PURE__ */ jsx29("div", { class: `${p24}-help-card`, children: rows.map((a) => /* @__PURE__ */ jsx29(ArticleRow, { article: a, nav }, a.id)) })
5452
5622
  ] }, category));
5453
5623
  }
5454
- return /* @__PURE__ */ jsxs23("div", { class: `${p23}-module`, children: [
5455
- /* @__PURE__ */ jsx28(TitleBar, { title: strings.helpTitle, actions: /* @__PURE__ */ jsx28(HeaderActions, { panelProps, variant: "plain" }) }),
5456
- /* @__PURE__ */ jsx28("div", { class: `${p23}-module-pad`, children: /* @__PURE__ */ jsx28(HelpSearchInput, { placeholder: strings.helpSearchPlaceholder, value: query, onInput: setQuery }) }),
5457
- /* @__PURE__ */ jsx28("div", { class: `${p23}-help-list`, children: renderBody() })
5624
+ return /* @__PURE__ */ jsxs24("div", { class: `${p24}-module`, children: [
5625
+ /* @__PURE__ */ jsx29(TitleBar, { title: strings.helpTitle, actions: /* @__PURE__ */ jsx29(HeaderActions, { panelProps, variant: "plain" }) }),
5626
+ /* @__PURE__ */ jsx29("div", { class: `${p24}-module-pad`, children: /* @__PURE__ */ jsx29(HelpSearchInput, { placeholder: strings.helpSearchPlaceholder, value: query, onInput: setQuery }) }),
5627
+ /* @__PURE__ */ jsx29("div", { class: `${p24}-help-list`, children: renderBody() })
5458
5628
  ] });
5459
5629
  }
5460
5630
  var helpLayout = {
5461
5631
  Icon: HelpIcon,
5462
- Root: (props2) => /* @__PURE__ */ jsx28(HelpRoot, { ...props2 })
5632
+ Root: (props2) => /* @__PURE__ */ jsx29(HelpRoot, { ...props2 })
5463
5633
  };
5464
5634
 
5465
5635
  // src/ui/modules/home.tsx
5466
5636
  import { useEffect as useEffect12, useState as useState9 } from "preact/hooks";
5467
5637
 
5468
5638
  // src/ui/home-card.tsx
5469
- import { jsx as jsx29 } from "preact/jsx-runtime";
5470
- var p24 = BRAND.cssPrefix;
5639
+ import { jsx as jsx30 } from "preact/jsx-runtime";
5640
+ var p25 = BRAND.cssPrefix;
5471
5641
  function HomeCard({ onClick, children, testid }) {
5472
5642
  if (onClick) {
5473
- return /* @__PURE__ */ jsx29("button", { type: "button", class: `${p24}-home-card`, "data-interactive": "true", onClick, "data-testid": testid, children });
5643
+ return /* @__PURE__ */ jsx30("button", { type: "button", class: `${p25}-home-card`, "data-interactive": "true", onClick, "data-testid": testid, children });
5474
5644
  }
5475
- return /* @__PURE__ */ jsx29("div", { class: `${p24}-home-card`, "data-testid": testid, children });
5645
+ return /* @__PURE__ */ jsx30("div", { class: `${p25}-home-card`, "data-testid": testid, children });
5476
5646
  }
5477
5647
 
5478
5648
  // src/ui/modules/home.tsx
5479
- import { Fragment as Fragment5, jsx as jsx30, jsxs as jsxs24 } from "preact/jsx-runtime";
5480
- var p25 = BRAND.cssPrefix;
5649
+ import { Fragment as Fragment5, jsx as jsx31, jsxs as jsxs25 } from "preact/jsx-runtime";
5650
+ var p26 = BRAND.cssPrefix;
5481
5651
  var log13 = logger.scope("home");
5482
5652
  function resolveGreeting(props2) {
5483
5653
  const name = props2.options.userContext?.name;
@@ -5514,49 +5684,49 @@ function HomeRoot(props2) {
5514
5684
  const avatars = config.userAvatars ?? [];
5515
5685
  const status = config.status;
5516
5686
  const contentTitle = config.contentBlockTitle ? moduleLabel(strings, config.contentBlockTitle) : strings.homeContentTitle;
5517
- return /* @__PURE__ */ jsx30("div", { class: `${p25}-module ${p25}-home`, "data-testid": TID.homeView, children: /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-scroll`, children: [
5518
- /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-hero`, children: [
5519
- /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-hero-top`, children: [
5520
- config.brandName ? /* @__PURE__ */ jsx30("span", { class: `${p25}-home-brand`, "data-testid": TID.homeBrand, children: config.brandName }) : /* @__PURE__ */ jsx30("span", { class: `${p25}-home-brand-spacer`, "aria-hidden": "true" }),
5521
- /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-hero-actions`, children: [
5522
- avatars.length > 0 ? /* @__PURE__ */ jsx30("div", { class: `${p25}-home-avatars`, children: avatars.map((a) => /* @__PURE__ */ jsx30("span", { class: `${p25}-home-avatar`, title: a.role ? `${a.name} \xB7 ${a.role}` : a.name, children: a.avatar ? /* @__PURE__ */ jsx30("img", { src: a.avatar, alt: "", loading: "lazy" }) : /* @__PURE__ */ jsx30("span", { children: initials(a.name) }) }, a.name)) }) : null,
5523
- /* @__PURE__ */ jsx30(HeaderActions, { panelProps, variant: "plain" })
5687
+ return /* @__PURE__ */ jsx31("div", { class: `${p26}-module ${p26}-home`, "data-testid": TID.homeView, children: /* @__PURE__ */ jsxs25("div", { class: `${p26}-home-scroll`, children: [
5688
+ /* @__PURE__ */ jsxs25("div", { class: `${p26}-home-hero`, children: [
5689
+ /* @__PURE__ */ jsxs25("div", { class: `${p26}-home-hero-top`, children: [
5690
+ config.brandName ? /* @__PURE__ */ jsx31("span", { class: `${p26}-home-brand`, "data-testid": TID.homeBrand, children: config.brandName }) : /* @__PURE__ */ jsx31("span", { class: `${p26}-home-brand-spacer`, "aria-hidden": "true" }),
5691
+ /* @__PURE__ */ jsxs25("div", { class: `${p26}-home-hero-actions`, children: [
5692
+ avatars.length > 0 ? /* @__PURE__ */ jsx31("div", { class: `${p26}-home-avatars`, children: avatars.map((a) => /* @__PURE__ */ jsx31("span", { class: `${p26}-home-avatar`, title: a.role ? `${a.name} \xB7 ${a.role}` : a.name, children: a.avatar ? /* @__PURE__ */ jsx31("img", { src: a.avatar, alt: "", loading: "lazy" }) : /* @__PURE__ */ jsx31("span", { children: initials(a.name) }) }, a.name)) }) : null,
5693
+ /* @__PURE__ */ jsx31(HeaderActions, { panelProps, variant: "plain" })
5524
5694
  ] })
5525
5695
  ] }),
5526
- config.showGreeting !== false ? /* @__PURE__ */ jsxs24(Fragment5, { children: [
5527
- /* @__PURE__ */ jsx30("h1", { class: `${p25}-home-greeting`, "data-testid": TID.homeGreeting, children: greeting.title }),
5528
- greeting.subtitle ? /* @__PURE__ */ jsx30("p", { class: `${p25}-home-lead`, children: greeting.subtitle }) : null
5696
+ config.showGreeting !== false ? /* @__PURE__ */ jsxs25(Fragment5, { children: [
5697
+ /* @__PURE__ */ jsx31("h1", { class: `${p26}-home-greeting`, "data-testid": TID.homeGreeting, children: greeting.title }),
5698
+ greeting.subtitle ? /* @__PURE__ */ jsx31("p", { class: `${p26}-home-lead`, children: greeting.subtitle }) : null
5529
5699
  ] }) : null
5530
5700
  ] }),
5531
- /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-cards`, children: [
5532
- config.showSearchBar !== false ? /* @__PURE__ */ jsx30(
5701
+ /* @__PURE__ */ jsxs25("div", { class: `${p26}-home-cards`, children: [
5702
+ config.showSearchBar !== false ? /* @__PURE__ */ jsx31(
5533
5703
  HomeSearchButton,
5534
5704
  {
5535
5705
  placeholder: strings.homeSearchPlaceholder,
5536
5706
  onActivate: () => nav.switchToLayout("help")
5537
5707
  }
5538
5708
  ) : null,
5539
- recent ? /* @__PURE__ */ jsx30(HomeCard, { onClick: () => nav.selectSession(recent.sessionId), testid: TID.homeRecent, children: /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-recent-row`, "data-unread": (recent.unreadCount ?? 0) > 0 ? "true" : void 0, children: [
5540
- /* @__PURE__ */ jsx30("span", { class: `${p25}-home-recent-avatar`, "aria-hidden": "true", children: /* @__PURE__ */ jsx30(BubblesIcon, {}) }),
5541
- /* @__PURE__ */ jsxs24("span", { class: `${p25}-home-recent-body`, children: [
5542
- /* @__PURE__ */ jsx30("span", { class: `${p25}-home-recent-title`, children: recent.title }),
5543
- recent.preview ? /* @__PURE__ */ jsx30("span", { class: `${p25}-home-recent-preview`, children: recent.preview }) : null
5709
+ recent ? /* @__PURE__ */ jsx31(HomeCard, { onClick: () => nav.selectSession(recent.sessionId), testid: TID.homeRecent, children: /* @__PURE__ */ jsxs25("div", { class: `${p26}-home-recent-row`, "data-unread": (recent.unreadCount ?? 0) > 0 ? "true" : void 0, children: [
5710
+ /* @__PURE__ */ jsx31("span", { class: `${p26}-home-recent-avatar`, "aria-hidden": "true", children: /* @__PURE__ */ jsx31(BubblesIcon, {}) }),
5711
+ /* @__PURE__ */ jsxs25("span", { class: `${p26}-home-recent-body`, children: [
5712
+ /* @__PURE__ */ jsx31("span", { class: `${p26}-home-recent-title`, children: recent.title }),
5713
+ recent.preview ? /* @__PURE__ */ jsx31("span", { class: `${p26}-home-recent-preview`, children: recent.preview }) : null
5544
5714
  ] }),
5545
- (recent.unreadCount ?? 0) > 0 ? /* @__PURE__ */ jsx30("span", { class: `${p25}-home-recent-dot`, "aria-label": "Unread" }) : null
5715
+ (recent.unreadCount ?? 0) > 0 ? /* @__PURE__ */ jsx31("span", { class: `${p26}-home-recent-dot`, "aria-label": "Unread" }) : null
5546
5716
  ] }) }) : null,
5547
- status ? /* @__PURE__ */ jsx30(
5717
+ status ? /* @__PURE__ */ jsx31(
5548
5718
  HomeCard,
5549
5719
  {
5550
5720
  onClick: status.url ? () => nav.push({ kind: "iframe", url: status.url, title: status.text }) : void 0,
5551
- children: /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-status`, "data-level": status.level ?? "operational", children: [
5552
- /* @__PURE__ */ jsx30("span", { class: `${p25}-home-status-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx30(StatusOkIcon, {}) }),
5553
- /* @__PURE__ */ jsx30("span", { class: `${p25}-home-status-text`, children: status.text })
5721
+ children: /* @__PURE__ */ jsxs25("div", { class: `${p26}-home-status`, "data-level": status.level ?? "operational", children: [
5722
+ /* @__PURE__ */ jsx31("span", { class: `${p26}-home-status-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx31(StatusOkIcon, {}) }),
5723
+ /* @__PURE__ */ jsx31("span", { class: `${p26}-home-status-text`, children: status.text })
5554
5724
  ] })
5555
5725
  }
5556
5726
  ) : null,
5557
- content.length > 0 ? /* @__PURE__ */ jsxs24("section", { class: `${p25}-home-content`, children: [
5558
- /* @__PURE__ */ jsx30("div", { class: `${p25}-home-content-title`, children: contentTitle }),
5559
- /* @__PURE__ */ jsx30("div", { class: `${p25}-home-content-list`, children: content.map((item) => /* @__PURE__ */ jsx30(
5727
+ content.length > 0 ? /* @__PURE__ */ jsxs25("section", { class: `${p26}-home-content`, children: [
5728
+ /* @__PURE__ */ jsx31("div", { class: `${p26}-home-content-title`, children: contentTitle }),
5729
+ /* @__PURE__ */ jsx31("div", { class: `${p26}-home-content-list`, children: content.map((item) => /* @__PURE__ */ jsx31(
5560
5730
  ListRow,
5561
5731
  {
5562
5732
  title: item.title,
@@ -5572,13 +5742,13 @@ function HomeRoot(props2) {
5572
5742
  }
5573
5743
  var homeLayout = {
5574
5744
  Icon: HomeIcon,
5575
- Root: (props2) => /* @__PURE__ */ jsx30(HomeRoot, { ...props2 })
5745
+ Root: (props2) => /* @__PURE__ */ jsx31(HomeRoot, { ...props2 })
5576
5746
  };
5577
5747
 
5578
5748
  // src/ui/modules/news.tsx
5579
5749
  import { useEffect as useEffect13, useState as useState10 } from "preact/hooks";
5580
- import { jsx as jsx31, jsxs as jsxs25 } from "preact/jsx-runtime";
5581
- var p26 = BRAND.cssPrefix;
5750
+ import { jsx as jsx32, jsxs as jsxs26 } from "preact/jsx-runtime";
5751
+ var p27 = BRAND.cssPrefix;
5582
5752
  var log14 = logger.scope("news");
5583
5753
  function NewsRoot({ transport, strings, config, nav, panelProps }) {
5584
5754
  const tags = config.contentTags;
@@ -5604,38 +5774,38 @@ function NewsRoot({ transport, strings, config, nav, panelProps }) {
5604
5774
  };
5605
5775
  }, [transport, tags, reloadKey]);
5606
5776
  function renderBody() {
5607
- if (state === "loading") return /* @__PURE__ */ jsx31(ModuleState, { message: strings.newsLoading, strings });
5777
+ if (state === "loading") return /* @__PURE__ */ jsx32(ModuleState, { message: strings.newsLoading, strings });
5608
5778
  if (state === "error") {
5609
- return /* @__PURE__ */ jsx31(ModuleState, { tone: "error", message: errorMsg, onRetry: () => setReloadKey((k) => k + 1), strings });
5779
+ return /* @__PURE__ */ jsx32(ModuleState, { tone: "error", message: errorMsg, onRetry: () => setReloadKey((k) => k + 1), strings });
5610
5780
  }
5611
- if (items.length === 0) return /* @__PURE__ */ jsx31(ModuleState, { message: strings.newsEmpty, strings });
5612
- return /* @__PURE__ */ jsx31("div", { class: `${p26}-news-list`, children: items.map((item) => /* @__PURE__ */ jsxs25(
5781
+ if (items.length === 0) return /* @__PURE__ */ jsx32(ModuleState, { message: strings.newsEmpty, strings });
5782
+ return /* @__PURE__ */ jsx32("div", { class: `${p27}-news-list`, children: items.map((item) => /* @__PURE__ */ jsxs26(
5613
5783
  "button",
5614
5784
  {
5615
5785
  type: "button",
5616
- class: `${p26}-news-card`,
5786
+ class: `${p27}-news-card`,
5617
5787
  onClick: () => nav.push({ kind: "content", id: item.id, title: item.title }),
5618
5788
  "data-testid": tid(TID.newsItem, item.id),
5619
5789
  children: [
5620
- item.image ? /* @__PURE__ */ jsx31("img", { class: `${p26}-news-hero`, src: item.image, alt: "", loading: "lazy" }) : null,
5621
- /* @__PURE__ */ jsxs25("span", { class: `${p26}-news-body`, children: [
5622
- item.tags && item.tags.length > 0 ? /* @__PURE__ */ jsx31("span", { class: `${p26}-news-tags`, children: item.tags.map((t) => /* @__PURE__ */ jsx31("span", { class: `${p26}-news-tag`, children: t }, t)) }) : null,
5623
- /* @__PURE__ */ jsx31("span", { class: `${p26}-news-title`, children: item.title }),
5624
- item.description ? /* @__PURE__ */ jsx31("span", { class: `${p26}-news-summary`, children: item.description }) : null
5790
+ item.image ? /* @__PURE__ */ jsx32("img", { class: `${p27}-news-hero`, src: item.image, alt: "", loading: "lazy" }) : null,
5791
+ /* @__PURE__ */ jsxs26("span", { class: `${p27}-news-body`, children: [
5792
+ item.tags && item.tags.length > 0 ? /* @__PURE__ */ jsx32("span", { class: `${p27}-news-tags`, children: item.tags.map((t) => /* @__PURE__ */ jsx32("span", { class: `${p27}-news-tag`, children: t }, t)) }) : null,
5793
+ /* @__PURE__ */ jsx32("span", { class: `${p27}-news-title`, children: item.title }),
5794
+ item.description ? /* @__PURE__ */ jsx32("span", { class: `${p27}-news-summary`, children: item.description }) : null
5625
5795
  ] })
5626
5796
  ]
5627
5797
  },
5628
5798
  item.id
5629
5799
  )) });
5630
5800
  }
5631
- return /* @__PURE__ */ jsxs25("div", { class: `${p26}-module`, children: [
5632
- /* @__PURE__ */ jsx31(TitleBar, { title: strings.newsTitle, actions: /* @__PURE__ */ jsx31(HeaderActions, { panelProps, variant: "plain" }) }),
5633
- /* @__PURE__ */ jsx31("div", { class: `${p26}-module-scroll`, children: renderBody() })
5801
+ return /* @__PURE__ */ jsxs26("div", { class: `${p27}-module`, children: [
5802
+ /* @__PURE__ */ jsx32(TitleBar, { title: strings.newsTitle, actions: /* @__PURE__ */ jsx32(HeaderActions, { panelProps, variant: "plain" }) }),
5803
+ /* @__PURE__ */ jsx32("div", { class: `${p27}-module-scroll`, children: renderBody() })
5634
5804
  ] });
5635
5805
  }
5636
5806
  var newsLayout = {
5637
5807
  Icon: NewsIcon,
5638
- Root: (props2) => /* @__PURE__ */ jsx31(NewsRoot, { ...props2 })
5808
+ Root: (props2) => /* @__PURE__ */ jsx32(NewsRoot, { ...props2 })
5639
5809
  };
5640
5810
 
5641
5811
  // src/ui/modules/registry.ts
@@ -5647,28 +5817,28 @@ var LAYOUTS = {
5647
5817
  };
5648
5818
 
5649
5819
  // src/ui/home-tab-bar.tsx
5650
- import { jsx as jsx32, jsxs as jsxs26 } from "preact/jsx-runtime";
5651
- var p27 = BRAND.cssPrefix;
5820
+ import { jsx as jsx33, jsxs as jsxs27 } from "preact/jsx-runtime";
5821
+ var p28 = BRAND.cssPrefix;
5652
5822
  function HomeTabBar({ modules, activeTab, strings, unreadCount, onSelect }) {
5653
- return /* @__PURE__ */ jsx32("nav", { class: `${p27}-tabbar`, role: "tablist", "aria-label": strings.panelTitle, children: modules.map((m) => {
5823
+ return /* @__PURE__ */ jsx33("nav", { class: `${p28}-tabbar`, role: "tablist", "aria-label": strings.panelTitle, children: modules.map((m) => {
5654
5824
  const Icon = LAYOUTS[m.layout].Icon;
5655
5825
  const selected = m.id === activeTab;
5656
5826
  const badge = m.layout === "chat" && unreadCount > 0 ? unreadCount > 9 ? "9+" : String(unreadCount) : null;
5657
- return /* @__PURE__ */ jsxs26(
5827
+ return /* @__PURE__ */ jsxs27(
5658
5828
  "button",
5659
5829
  {
5660
5830
  type: "button",
5661
5831
  role: "tab",
5662
5832
  "aria-selected": selected,
5663
- class: `${p27}-tab`,
5833
+ class: `${p28}-tab`,
5664
5834
  onClick: () => onSelect(m.id),
5665
5835
  "data-testid": tid(TID.tab, m.id),
5666
5836
  children: [
5667
- /* @__PURE__ */ jsxs26("span", { class: `${p27}-tab-icon`, "aria-hidden": "true", children: [
5668
- /* @__PURE__ */ jsx32(Icon, {}),
5669
- badge ? /* @__PURE__ */ jsx32("span", { class: `${p27}-tab-badge`, "data-testid": TID.tabBadge, children: badge }) : null
5837
+ /* @__PURE__ */ jsxs27("span", { class: `${p28}-tab-icon`, "aria-hidden": "true", children: [
5838
+ /* @__PURE__ */ jsx33(Icon, {}),
5839
+ badge ? /* @__PURE__ */ jsx33("span", { class: `${p28}-tab-badge`, "data-testid": TID.tabBadge, children: badge }) : null
5670
5840
  ] }),
5671
- /* @__PURE__ */ jsx32("span", { class: `${p27}-tab-label`, children: moduleLabel(strings, m.label) })
5841
+ /* @__PURE__ */ jsx33("span", { class: `${p28}-tab-label`, children: moduleLabel(strings, m.label) })
5672
5842
  ]
5673
5843
  },
5674
5844
  m.id
@@ -5677,12 +5847,12 @@ function HomeTabBar({ modules, activeTab, strings, unreadCount, onSelect }) {
5677
5847
  }
5678
5848
 
5679
5849
  // src/ui/iframe-view.tsx
5680
- import { jsx as jsx33, jsxs as jsxs27 } from "preact/jsx-runtime";
5681
- var p28 = BRAND.cssPrefix;
5850
+ import { jsx as jsx34, jsxs as jsxs28 } from "preact/jsx-runtime";
5851
+ var p29 = BRAND.cssPrefix;
5682
5852
  var SANDBOX = "allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";
5683
5853
  function IframeView({ url, title, strings, onBack, actions }) {
5684
- return /* @__PURE__ */ jsxs27("div", { class: `${p28}-module`, children: [
5685
- /* @__PURE__ */ jsx33(
5854
+ return /* @__PURE__ */ jsxs28("div", { class: `${p29}-module`, children: [
5855
+ /* @__PURE__ */ jsx34(
5686
5856
  BackHeader,
5687
5857
  {
5688
5858
  title: title || strings.moduleBack,
@@ -5691,10 +5861,10 @@ function IframeView({ url, title, strings, onBack, actions }) {
5691
5861
  actions
5692
5862
  }
5693
5863
  ),
5694
- /* @__PURE__ */ jsx33(
5864
+ /* @__PURE__ */ jsx34(
5695
5865
  "iframe",
5696
5866
  {
5697
- class: `${p28}-content-frame`,
5867
+ class: `${p29}-content-frame`,
5698
5868
  src: url,
5699
5869
  title: title || "content",
5700
5870
  sandbox: SANDBOX,
@@ -5708,8 +5878,8 @@ function IframeView({ url, title, strings, onBack, actions }) {
5708
5878
 
5709
5879
  // src/ui/content-view.tsx
5710
5880
  import { useCallback as useCallback3, useEffect as useEffect14, useState as useState11 } from "preact/hooks";
5711
- import { jsx as jsx34, jsxs as jsxs28 } from "preact/jsx-runtime";
5712
- var p29 = BRAND.cssPrefix;
5881
+ import { jsx as jsx35, jsxs as jsxs29 } from "preact/jsx-runtime";
5882
+ var p30 = BRAND.cssPrefix;
5713
5883
  var log15 = logger.scope("content");
5714
5884
  function ContentView({ id, title, transport, strings, onBack, actions }) {
5715
5885
  const [item, setItem] = useState11(null);
@@ -5737,17 +5907,17 @@ function ContentView({ id, title, transport, strings, onBack, actions }) {
5737
5907
  };
5738
5908
  }, [transport, id, reloadKey]);
5739
5909
  function renderBody() {
5740
- if (failed) return /* @__PURE__ */ jsx34(ModuleState, { tone: "error", message: strings.errorGeneric, onRetry: retry, strings });
5741
- if (item === null) return /* @__PURE__ */ jsx34(ModuleState, { message: strings.contentLoading, strings });
5742
- return /* @__PURE__ */ jsxs28("article", { class: `${p29}-content`, "data-testid": TID.contentView, children: [
5743
- item.image ? /* @__PURE__ */ jsx34("img", { class: `${p29}-content-hero`, src: item.image, alt: "", loading: "lazy" }) : null,
5744
- item.description ? /* @__PURE__ */ jsx34("p", { class: `${p29}-content-subtitle`, children: item.description }) : null,
5745
- item.tags && item.tags.length > 0 ? /* @__PURE__ */ jsx34("span", { class: `${p29}-news-tags`, children: item.tags.map((t) => /* @__PURE__ */ jsx34("span", { class: `${p29}-news-tag`, children: t }, t)) }) : null,
5746
- /* @__PURE__ */ jsx34(StaticMarkdown, { text: item.content ?? "" })
5910
+ if (failed) return /* @__PURE__ */ jsx35(ModuleState, { tone: "error", message: strings.errorGeneric, onRetry: retry, strings });
5911
+ if (item === null) return /* @__PURE__ */ jsx35(ModuleState, { message: strings.contentLoading, strings });
5912
+ return /* @__PURE__ */ jsxs29("article", { class: `${p30}-content`, "data-testid": TID.contentView, children: [
5913
+ item.image ? /* @__PURE__ */ jsx35("img", { class: `${p30}-content-hero`, src: item.image, alt: "", loading: "lazy" }) : null,
5914
+ item.description ? /* @__PURE__ */ jsx35("p", { class: `${p30}-content-subtitle`, children: item.description }) : null,
5915
+ item.tags && item.tags.length > 0 ? /* @__PURE__ */ jsx35("span", { class: `${p30}-news-tags`, children: item.tags.map((t) => /* @__PURE__ */ jsx35("span", { class: `${p30}-news-tag`, children: t }, t)) }) : null,
5916
+ /* @__PURE__ */ jsx35(StaticMarkdown, { text: item.content ?? "" })
5747
5917
  ] });
5748
5918
  }
5749
- return /* @__PURE__ */ jsxs28("div", { class: `${p29}-module`, children: [
5750
- /* @__PURE__ */ jsx34(
5919
+ return /* @__PURE__ */ jsxs29("div", { class: `${p30}-module`, children: [
5920
+ /* @__PURE__ */ jsx35(
5751
5921
  BackHeader,
5752
5922
  {
5753
5923
  title: item?.title || title || strings.moduleBack,
@@ -5757,13 +5927,13 @@ function ContentView({ id, title, transport, strings, onBack, actions }) {
5757
5927
  testid: TID.backHeader
5758
5928
  }
5759
5929
  ),
5760
- /* @__PURE__ */ jsx34("div", { class: `${p29}-module-scroll`, "data-testid": TID.contentScroll, children: renderBody() })
5930
+ /* @__PURE__ */ jsx35("div", { class: `${p30}-module-scroll`, "data-testid": TID.contentScroll, children: renderBody() })
5761
5931
  ] });
5762
5932
  }
5763
5933
 
5764
5934
  // src/ui/messenger-home.tsx
5765
- import { jsx as jsx35, jsxs as jsxs29 } from "preact/jsx-runtime";
5766
- var p30 = BRAND.cssPrefix;
5935
+ import { jsx as jsx36, jsxs as jsxs30 } from "preact/jsx-runtime";
5936
+ var p31 = BRAND.cssPrefix;
5767
5937
  function MessengerHome({
5768
5938
  panelProps,
5769
5939
  enabledModules,
@@ -5775,7 +5945,7 @@ function MessengerHome({
5775
5945
  }) {
5776
5946
  const options = panelProps.options;
5777
5947
  const strings = options.strings;
5778
- const containerRef = useRef7(null);
5948
+ const containerRef = useRef8(null);
5779
5949
  useEffect15(() => {
5780
5950
  const el = containerRef.current;
5781
5951
  if (!el) return;
@@ -5789,7 +5959,7 @@ function MessengerHome({
5789
5959
  el.removeEventListener("keydown", onKey);
5790
5960
  };
5791
5961
  }, [panelProps.onClose]);
5792
- const composerAttachApiRef = useRef7(null);
5962
+ const composerAttachApiRef = useRef8(null);
5793
5963
  const onDropItems = useCallback4((items) => {
5794
5964
  composerAttachApiRef.current?.attachFromDrop(items);
5795
5965
  }, []);
@@ -5800,7 +5970,7 @@ function MessengerHome({
5800
5970
  const activeModule = options.modules.byId[navState.activeTab];
5801
5971
  const isReader = top?.kind === "iframe" || top?.kind === "content";
5802
5972
  const showTabBar = enabledModules.length > 1 && (atTabRoot(navState) || !isReader);
5803
- const savedSize = useRef7(null);
5973
+ const savedSize = useRef8(null);
5804
5974
  useEffect15(() => {
5805
5975
  if (isReader && savedSize.current === null) {
5806
5976
  savedSize.current = panelProps.panelSize;
@@ -5831,12 +6001,12 @@ function MessengerHome({
5831
6001
  nav: moduleNav,
5832
6002
  panelProps
5833
6003
  });
5834
- const plainActions = /* @__PURE__ */ jsx35(HeaderActions, { panelProps, variant: "plain" });
6004
+ const plainActions = /* @__PURE__ */ jsx36(HeaderActions, { panelProps, variant: "plain" });
5835
6005
  let body;
5836
6006
  if (top?.kind === "iframe") {
5837
- body = /* @__PURE__ */ jsx35(IframeView, { url: top.url, title: top.title, strings, onBack: nav.pop, actions: plainActions });
6007
+ body = /* @__PURE__ */ jsx36(IframeView, { url: top.url, title: top.title, strings, onBack: nav.pop, actions: plainActions });
5838
6008
  } else if (top?.kind === "content") {
5839
- body = /* @__PURE__ */ jsx35(
6009
+ body = /* @__PURE__ */ jsx36(
5840
6010
  ContentView,
5841
6011
  {
5842
6012
  id: top.id,
@@ -5848,7 +6018,7 @@ function MessengerHome({
5848
6018
  }
5849
6019
  );
5850
6020
  } else if (activeModule?.layout === "chat") {
5851
- body = /* @__PURE__ */ jsx35(
6021
+ body = /* @__PURE__ */ jsx36(
5852
6022
  PanelContent,
5853
6023
  {
5854
6024
  ...panelProps,
@@ -5859,23 +6029,23 @@ function MessengerHome({
5859
6029
  );
5860
6030
  } else if (activeModule) {
5861
6031
  const Root = LAYOUTS[activeModule.layout].Root;
5862
- body = Root ? /* @__PURE__ */ jsx35(Root, { ...screenProps(activeModule) }, activeModule.id) : null;
6032
+ body = Root ? /* @__PURE__ */ jsx36(Root, { ...screenProps(activeModule) }, activeModule.id) : null;
5863
6033
  } else {
5864
6034
  body = null;
5865
6035
  }
5866
- return /* @__PURE__ */ jsxs29(
6036
+ return /* @__PURE__ */ jsxs30(
5867
6037
  "div",
5868
6038
  {
5869
6039
  ref: containerRef,
5870
- class: `${p30}-panel ${p30}-messenger`,
6040
+ class: `${p31}-panel ${p31}-messenger`,
5871
6041
  role: "dialog",
5872
6042
  "aria-modal": "false",
5873
6043
  "aria-label": strings.panelTitle,
5874
6044
  style: { position: "relative" },
5875
6045
  "data-testid": TID.messengerHome,
5876
6046
  children: [
5877
- /* @__PURE__ */ jsx35("div", { class: `${p30}-messenger-body`, children: body }),
5878
- showTabBar ? /* @__PURE__ */ jsx35(
6047
+ /* @__PURE__ */ jsx36("div", { class: `${p31}-messenger-body`, children: body }),
6048
+ showTabBar ? /* @__PURE__ */ jsx36(
5879
6049
  HomeTabBar,
5880
6050
  {
5881
6051
  modules: enabledModules,
@@ -5885,8 +6055,8 @@ function MessengerHome({
5885
6055
  onSelect: nav.switchTab
5886
6056
  }
5887
6057
  ) : null,
5888
- /* @__PURE__ */ jsx35(PoweredByBar, { poweredBy: options.poweredBy }),
5889
- options.size.resize?.enabled && !(activeModule?.layout === "chat" && !top) ? /* @__PURE__ */ jsx35(
6058
+ /* @__PURE__ */ jsx36(PoweredByBar, { poweredBy: options.poweredBy }),
6059
+ options.size.resize?.enabled && !(activeModule?.layout === "chat" && !top) ? /* @__PURE__ */ jsx36(
5890
6060
  ResizeGrip,
5891
6061
  {
5892
6062
  panelEl: containerRef.current,
@@ -5903,29 +6073,29 @@ function MessengerHome({
5903
6073
  }
5904
6074
 
5905
6075
  // src/ui/modules-empty.tsx
5906
- import { jsx as jsx36, jsxs as jsxs30 } from "preact/jsx-runtime";
5907
- var p31 = BRAND.cssPrefix;
6076
+ import { jsx as jsx37, jsxs as jsxs31 } from "preact/jsx-runtime";
6077
+ var p32 = BRAND.cssPrefix;
5908
6078
  function ModulesEmpty({ strings, onClose }) {
5909
- return /* @__PURE__ */ jsxs30(
6079
+ return /* @__PURE__ */ jsxs31(
5910
6080
  "div",
5911
6081
  {
5912
- class: `${p31}-panel ${p31}-modules-empty`,
6082
+ class: `${p32}-panel ${p32}-modules-empty`,
5913
6083
  role: "dialog",
5914
6084
  "aria-label": strings.panelTitle,
5915
6085
  "data-testid": TID.modulesEmpty,
5916
6086
  children: [
5917
- onClose ? /* @__PURE__ */ jsx36(
6087
+ onClose ? /* @__PURE__ */ jsx37(
5918
6088
  "button",
5919
6089
  {
5920
6090
  type: "button",
5921
- class: `${p31}-icon-btn ${p31}-modules-empty-close`,
6091
+ class: `${p32}-icon-btn ${p32}-modules-empty-close`,
5922
6092
  onClick: onClose,
5923
6093
  "aria-label": strings.close,
5924
6094
  title: strings.close,
5925
- children: /* @__PURE__ */ jsx36(CloseIcon, {})
6095
+ children: /* @__PURE__ */ jsx37(CloseIcon, {})
5926
6096
  }
5927
6097
  ) : null,
5928
- /* @__PURE__ */ jsx36("p", { class: `${p31}-modules-empty-text`, children: strings.modulesEmpty })
6098
+ /* @__PURE__ */ jsx37("p", { class: `${p32}-modules-empty-text`, children: strings.modulesEmpty })
5929
6099
  ]
5930
6100
  }
5931
6101
  );
@@ -5996,9 +6166,9 @@ function useLauncherCallout({ callout, persistence }) {
5996
6166
  }
5997
6167
 
5998
6168
  // src/ui/app.tsx
5999
- import { jsx as jsx37, jsxs as jsxs31 } from "preact/jsx-runtime";
6169
+ import { jsx as jsx38, jsxs as jsxs32 } from "preact/jsx-runtime";
6000
6170
  var log16 = logger.scope("app");
6001
- var p32 = BRAND.cssPrefix;
6171
+ var p33 = BRAND.cssPrefix;
6002
6172
  function App({ options, hostElement, bus }) {
6003
6173
  const [persistence] = useState13(() => createPersistence(options.widgetId, options.storage));
6004
6174
  const [visitorId, setVisitorId] = useState13(() => persistence.getVisitorId());
@@ -6021,21 +6191,21 @@ function App({ options, hostElement, bus }) {
6021
6191
  function chatTabId() {
6022
6192
  return options.modules.list.find((m) => m.layout === "chat")?.id;
6023
6193
  }
6024
- const homeNavRef = useRef8();
6194
+ const homeNavRef = useRef9();
6025
6195
  if (!homeNavRef.current) {
6026
6196
  const ids = options.modules.list.map((m) => m.id);
6027
6197
  homeNavRef.current = createHomeNav(landingTab(), ids, (tab) => persistence.saveActiveModule(tab));
6028
6198
  }
6029
6199
  const homeNav = homeNavRef.current;
6030
- const chatTabIdRef = useRef8(void 0);
6200
+ const chatTabIdRef = useRef9(void 0);
6031
6201
  chatTabIdRef.current = chatTabId();
6032
6202
  const [sessionReady, setSessionReady] = useState13(false);
6033
6203
  const isInlineLike = options.mode === "standalone" || options.mode === "inline";
6034
- const initialPanelRef = useRef8(
6204
+ const initialPanelRef = useRef9(
6035
6205
  resolveInitialPanelState(options, currentViewportWidth(), persistence.loadPanelOpen(), persistence.loadPanelSize())
6036
6206
  );
6037
6207
  const [isOpen, setIsOpen] = useState13(initialPanelRef.current.panelOpen);
6038
- const initialPanelApplied = useRef8(false);
6208
+ const initialPanelApplied = useRef9(false);
6039
6209
  const [launcherLeaving, setLauncherLeaving] = useState13(false);
6040
6210
  const { dismissed: calloutDismissed, dismissCallout: dismissCalloutRaw } = useLauncherCallout({
6041
6211
  callout: options.launcher.callout,
@@ -6048,18 +6218,18 @@ function App({ options, hostElement, bus }) {
6048
6218
  dismissCalloutRaw();
6049
6219
  }, [bus, dismissCalloutRaw]);
6050
6220
  const [panelSize, setPanelSize] = useState13(initialPanelRef.current.panelSize);
6051
- const initialSizeApplied = useRef8(false);
6221
+ const initialSizeApplied = useRef9(false);
6052
6222
  const [view, setView] = useState13("chat");
6053
6223
  const [canSend, setCanSend] = useState13(true);
6054
6224
  const [streaming, setStreaming] = useState13(false);
6055
6225
  const [agent, setAgent] = useState13(null);
6056
6226
  const [suggestions, setSuggestions] = useState13([]);
6057
6227
  const [activeCancel, setActiveCancel] = useState13(null);
6058
- const welcomeAbortRef = useRef8(null);
6228
+ const welcomeAbortRef = useRef9(null);
6059
6229
  const [parsedSite, setParsedSite] = useState13(void 0);
6060
6230
  const [parsedBlocks, setParsedBlocks] = useState13(void 0);
6061
6231
  const [sidebarCollapsed, setSidebarCollapsed] = useState13(() => persistence.loadSidebarCollapsed() ?? false);
6062
- const [intakeValues, setIntakeValues] = useState13(() => persistence.loadIntake());
6232
+ const [formContext, setFormContext] = useState13({});
6063
6233
  const [transport] = useState13(
6064
6234
  () => new AgentTransport({
6065
6235
  baseUrl: options.baseUrl,
@@ -6120,9 +6290,9 @@ function App({ options, hostElement, bus }) {
6120
6290
  setIsOpen(state.panelOpen);
6121
6291
  setPanelSize(state.panelSize);
6122
6292
  }, [sessionReady, options, persistence]);
6123
- const homeNavSeeded = useRef8(false);
6124
- const resumeActiveRef = useRef8(false);
6125
- const resumeBubbleRef = useRef8(null);
6293
+ const homeNavSeeded = useRef9(false);
6294
+ const resumeActiveRef = useRef9(false);
6295
+ const resumeBubbleRef = useRef9(null);
6126
6296
  useEffect17(() => {
6127
6297
  if (!sessionReady || homeNavSeeded.current) return;
6128
6298
  homeNavSeeded.current = true;
@@ -6150,7 +6320,7 @@ function App({ options, hostElement, bus }) {
6150
6320
  },
6151
6321
  [messagesSig, options.welcome]
6152
6322
  );
6153
- const connectGenRef = useRef8(0);
6323
+ const connectGenRef = useRef9(0);
6154
6324
  const runStartSession = useCallback6(
6155
6325
  async ({ newConversation }) => {
6156
6326
  const myGen = ++connectGenRef.current;
@@ -6242,11 +6412,11 @@ function App({ options, hostElement, bus }) {
6242
6412
  );
6243
6413
  const userSig = JSON.stringify(options.userContext ?? null);
6244
6414
  const pageSig = JSON.stringify(options.pageContext ?? null);
6245
- const intakeSig = JSON.stringify(intakeValues ?? null);
6415
+ const formCtxSig = JSON.stringify(formContext);
6246
6416
  useEffect17(() => {
6247
- const merged = intakeValues ? { ...intakeValues, ...options.userContext } : options.userContext;
6417
+ const merged = Object.keys(formContext).length ? { ...formContext, ...options.userContext } : options.userContext;
6248
6418
  transport.setContext(merged, toWirePageContext(options.pageContext));
6249
- }, [transport, userSig, pageSig, intakeSig]);
6419
+ }, [transport, userSig, pageSig, formCtxSig]);
6250
6420
  const runResume = useCallback6(
6251
6421
  async (handle) => {
6252
6422
  let bubble = null;
@@ -6305,7 +6475,7 @@ function App({ options, hostElement, bus }) {
6305
6475
  resume?.cancel();
6306
6476
  };
6307
6477
  }, []);
6308
- const lastUserSig = useRef8(userSig);
6478
+ const lastUserSig = useRef9(userSig);
6309
6479
  useEffect17(() => {
6310
6480
  if (!sessionReady || lastUserSig.current === userSig) return;
6311
6481
  lastUserSig.current = userSig;
@@ -6428,25 +6598,48 @@ function App({ options, hostElement, bus }) {
6428
6598
  () => ({ humanInLoop: options.features.humanInLoop, onResult: handleToolResult, onDecision: handleToolDecision }),
6429
6599
  [options.features.humanInLoop, handleToolResult, handleToolDecision]
6430
6600
  );
6431
- const intakePending = options.intake.enabled && intakeValues === null;
6432
- const handleIntakeComplete = useCallback6(
6433
- (values) => {
6434
- const hasValues = Object.keys(values).length > 0;
6435
- log16.info("intakeComplete", { fields: Object.keys(values).length, skipped: !hasValues });
6436
- persistence.saveIntake(values);
6437
- setIntakeValues(values);
6438
- bus.emit("intakeSubmit", values);
6439
- if (!hasValues) return;
6601
+ const userMessageCount = () => messagesSig.value.reduce((n, m) => n + (m.role === "user" ? 1 : 0), 0);
6602
+ const forms = useForms({
6603
+ forms: options.forms,
6604
+ persistence,
6605
+ userContext: () => options.userContext,
6606
+ messageCount: userMessageCount,
6607
+ pageArea: () => options.pageContext?.area ? String(options.pageContext.area) : void 0,
6608
+ onComplete: (form, trigger, values, skipped) => {
6609
+ log16.info("formSubmit", { formId: form.id, trigger, skipped });
6610
+ bus.emit("formSubmit", { formId: form.id, values, skipped });
6611
+ if (skipped || Object.keys(values).length === 0) return;
6440
6612
  const activeSessionId = sessionIdSig.value ?? uuid7();
6441
6613
  if (!sessionIdSig.value) {
6442
6614
  sessionIdSig.value = activeSessionId;
6443
6615
  persistence.saveSessionId(activeSessionId);
6444
6616
  transport.primeIdentity(void 0, activeSessionId);
6445
6617
  }
6446
- void transport.submitIntake(activeSessionId, values);
6447
- },
6448
- [persistence, bus, sessionIdSig, transport]
6449
- );
6618
+ if (form.mirrorToContext) setFormContext((prev) => ({ ...prev, ...values }));
6619
+ void transport.submitForm({ formId: form.id, sessionId: activeSessionId, trigger, values });
6620
+ }
6621
+ });
6622
+ const activeForm = useComputed7(() => forms.activeForm.value);
6623
+ const pageArea = options.pageContext?.area ? String(options.pageContext.area) : void 0;
6624
+ const msgCount = useComputed7(() => messagesSig.value.length);
6625
+ useEffect17(() => {
6626
+ if (sessionReady) forms.fire("pre-chat");
6627
+ }, [sessionReady, forms]);
6628
+ useEffect17(() => {
6629
+ if (!canSend) forms.fire("conversation-closed");
6630
+ }, [canSend, forms]);
6631
+ useEffect17(() => {
6632
+ if (pageArea) forms.fire("page-area");
6633
+ }, [pageArea, forms]);
6634
+ const idleMs = useMemo3(() => {
6635
+ const secs = options.forms.list.flatMap((f) => f.triggers).filter((t) => t.kind === "idle").map((t) => Number(t.param));
6636
+ return secs.length ? Math.min(...secs) * 1e3 : 0;
6637
+ }, [options.forms]);
6638
+ useEffect17(() => {
6639
+ if (!idleMs || !isOpen) return;
6640
+ const id = setTimeout(() => forms.fire("idle"), idleMs);
6641
+ return () => clearTimeout(id);
6642
+ }, [idleMs, isOpen, forms, msgCount.value]);
6450
6643
  const handleSend = useCallback6(
6451
6644
  async (text, attachments) => {
6452
6645
  log16.info("send", { textLen: text.length, attachments: attachments.length, streaming });
@@ -6466,8 +6659,9 @@ function App({ options, hostElement, bus }) {
6466
6659
  reducer.attach(assistantMsg);
6467
6660
  emitMessage(bus, options, "user", text);
6468
6661
  await streamAssistant(assistantMsg, TRIGGER.submitMessage);
6662
+ forms.fire("after-messages");
6469
6663
  },
6470
- [streaming, transport, bus, options, suggestions.length, messagesSig, reducer, streamAssistant]
6664
+ [streaming, transport, bus, options, suggestions.length, messagesSig, reducer, streamAssistant, forms]
6471
6665
  );
6472
6666
  const handleStop = useCallback6(() => {
6473
6667
  log16.info("stop");
@@ -6488,18 +6682,19 @@ function App({ options, hostElement, bus }) {
6488
6682
  return;
6489
6683
  }
6490
6684
  log16.info("close \u2192 panel closed", { mode: options.mode });
6685
+ forms.fire("panel-close");
6491
6686
  setIsOpen(false);
6492
6687
  persistence.savePanelOpen(false);
6493
6688
  bus.emit("close", void 0);
6494
6689
  options.onClose?.();
6495
- }, [bus, options, persistence, panelSize]);
6690
+ }, [bus, options, persistence, panelSize, forms]);
6496
6691
  const refreshUnread = useCallback6(() => {
6497
6692
  if (!options.modules.list.some((m) => m.layout === "chat")) return;
6498
6693
  transport.listSessions({ limit: 50 }).then((res) => {
6499
6694
  unreadCountSig.value = res.sessions.reduce((sum, c) => sum + (c.unreadCount ?? 0), 0);
6500
6695
  }).catch((err) => log16.debug("refreshUnread failed (non-fatal)", { err }));
6501
6696
  }, [transport, options.modules, unreadCountSig]);
6502
- const unreadSeeded = useRef8(false);
6697
+ const unreadSeeded = useRef9(false);
6503
6698
  useEffect17(() => {
6504
6699
  if (!sessionReady || unreadSeeded.current) return;
6505
6700
  unreadSeeded.current = true;
@@ -6630,10 +6825,11 @@ function App({ options, hostElement, bus }) {
6630
6825
  close: handleClose,
6631
6826
  expand: handleExpand,
6632
6827
  fullscreen: handleFullscreen,
6633
- popout: handlePopOut
6828
+ popout: handlePopOut,
6829
+ openForm: (id) => forms.fire("manual", typeof id === "string" ? id : void 0)
6634
6830
  });
6635
6831
  return unsub;
6636
- }, [hostElement, handleOpen, handleClose, handleExpand, handleFullscreen, handlePopOut]);
6832
+ }, [hostElement, handleOpen, handleClose, handleExpand, handleFullscreen, handlePopOut, forms]);
6637
6833
  const effectiveOptions = useMemo3(
6638
6834
  () => applyOptionOverrides(options, activeLocale, activeThemeMode),
6639
6835
  [options, activeLocale, activeThemeMode]
@@ -6672,8 +6868,12 @@ function App({ options, hostElement, bus }) {
6672
6868
  bus.emit("suggestion", { text });
6673
6869
  void handleSend(text, []);
6674
6870
  },
6675
- intakePending,
6676
- onIntakeComplete: handleIntakeComplete,
6871
+ // Active form: a blocking one replaces the composer (gate); a non-blocking
6872
+ // one renders inline at the end of the transcript (card).
6873
+ blockingForm: activeForm.value?.form.blocking ? activeForm.value.form : null,
6874
+ inlineForm: activeForm.value && !activeForm.value.form.blocking ? activeForm.value.form : null,
6875
+ onFormSubmit: forms.complete,
6876
+ onFormSkip: forms.skip,
6677
6877
  tool: toolInteraction
6678
6878
  };
6679
6879
  const onSelectSession = (sessionId) => {
@@ -6686,12 +6886,12 @@ function App({ options, hostElement, bus }) {
6686
6886
  const renderSurface = (size) => {
6687
6887
  const closeable = isActionVisible("close", effectiveOptions.mode, size);
6688
6888
  if (enabledModules.length === 0) {
6689
- return /* @__PURE__ */ jsx37(ModulesEmpty, { strings: effectiveOptions.strings, onClose: closeable ? handleClose : void 0 });
6889
+ return /* @__PURE__ */ jsx38(ModulesEmpty, { strings: effectiveOptions.strings, onClose: closeable ? handleClose : void 0 });
6690
6890
  }
6691
6891
  if (enabledModules.length === 1 && enabledModules[0]?.layout === "chat") {
6692
- return /* @__PURE__ */ jsx37(Panel, { ...panelProps, panelSize: size });
6892
+ return /* @__PURE__ */ jsx38(Panel, { ...panelProps, panelSize: size });
6693
6893
  }
6694
- return /* @__PURE__ */ jsx37(
6894
+ return /* @__PURE__ */ jsx38(
6695
6895
  MessengerHome,
6696
6896
  {
6697
6897
  panelProps: { ...panelProps, panelSize: size, onClose: closeable ? handleClose : void 0 },
@@ -6709,7 +6909,7 @@ function App({ options, hostElement, bus }) {
6709
6909
  void handleSelectHistoryChat(chat.sessionId);
6710
6910
  };
6711
6911
  const messagesEnabled = enabledModules.some((m) => m.layout === "chat");
6712
- return /* @__PURE__ */ jsx37("div", { class: `${p32}-anchor`, children: /* @__PURE__ */ jsx37(
6912
+ return /* @__PURE__ */ jsx38("div", { class: `${p33}-anchor`, children: /* @__PURE__ */ jsx38(
6713
6913
  PageShell,
6714
6914
  {
6715
6915
  site: parsedSite,
@@ -6728,15 +6928,15 @@ function App({ options, hostElement, bus }) {
6728
6928
  }
6729
6929
  if (isInlineLike) {
6730
6930
  const inlineSize = options.mode === "standalone" ? "fullscreen" : panelSize;
6731
- return /* @__PURE__ */ jsx37("div", { class: `${p32}-anchor`, children: renderSurface(inlineSize) });
6931
+ return /* @__PURE__ */ jsx38("div", { class: `${p33}-anchor`, children: renderSurface(inlineSize) });
6732
6932
  }
6733
6933
  const drawerEdgeTab = options.mode === "drawer";
6734
6934
  const triggerOwnedByPage = options.mode === "modal";
6735
6935
  const launcherVisible = !triggerOwnedByPage && !options.launcher.hidden && (!isOpen || launcherLeaving);
6736
6936
  const calloutToRender = launcherVisible && !launcherLeaving && !calloutDismissed && !drawerEdgeTab ? effectiveOptions.launcher.callout : null;
6737
- return /* @__PURE__ */ jsxs31("div", { class: `${p32}-anchor`, "data-launcher-size": effectiveOptions.launcher.size, children: [
6937
+ return /* @__PURE__ */ jsxs32("div", { class: `${p33}-anchor`, "data-launcher-size": effectiveOptions.launcher.size, children: [
6738
6938
  isOpen ? renderSurface(panelSize) : null,
6739
- launcherVisible ? /* @__PURE__ */ jsx37(
6939
+ launcherVisible ? /* @__PURE__ */ jsx38(
6740
6940
  Launcher,
6741
6941
  {
6742
6942
  onToggle: handleOpen,
@@ -6746,7 +6946,7 @@ function App({ options, hostElement, bus }) {
6746
6946
  edgeTab: drawerEdgeTab
6747
6947
  }
6748
6948
  ) : null,
6749
- calloutToRender ? /* @__PURE__ */ jsx37(
6949
+ calloutToRender ? /* @__PURE__ */ jsx38(
6750
6950
  LauncherCallout,
6751
6951
  {
6752
6952
  callout: calloutToRender,
@@ -6946,7 +7146,7 @@ var EVENT_NAMES = [
6946
7146
  "suggestion",
6947
7147
  "toggleHistory",
6948
7148
  // Forms + human-in-the-loop
6949
- "intakeSubmit",
7149
+ "formSubmit",
6950
7150
  "toolResult",
6951
7151
  "toolDecision",
6952
7152
  // Composer / attachments / voice
@@ -7043,6 +7243,7 @@ function mount(opts) {
7043
7243
  close: () => dispatchHostCommand(host, "close"),
7044
7244
  expand: () => dispatchHostCommand(host, "expand"),
7045
7245
  popOut: () => dispatchHostCommand(host, "popout"),
7246
+ openForm: (id) => dispatchHostCommand(host, "openForm", id),
7046
7247
  on: (name, fn) => bus.on(name, fn),
7047
7248
  update: (patch) => {
7048
7249
  log20.debug("update", { patch });