@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/web-component.mjs CHANGED
@@ -6,8 +6,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
6
6
  import { h as h2, render as render2 } from "preact";
7
7
 
8
8
  // src/ui/app.tsx
9
- import { useCallback as 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",
@@ -435,11 +437,11 @@ var DEFAULT_FEATURES = {
435
437
  voice: "local",
436
438
  humanInLoop: true
437
439
  };
438
- var DEFAULT_INTAKE = { enabled: false, fields: [], skippable: false };
440
+ var DEFAULT_FORMS = { list: [], byTrigger: {} };
439
441
  var DEFAULT_ENDPOINTS = {
440
442
  upload: "/ai/agent/upload-file",
441
443
  transcribe: "/ai/agent/transcribe-audio",
442
- intake: "/ai/agent/intake"
444
+ submitForm: "/ai/agent/submit-form"
443
445
  };
444
446
  var DEFAULT_LAUNCHER = {
445
447
  variant: "circle",
@@ -504,11 +506,11 @@ function resolveOptions(rawOpts) {
504
506
  humanInLoop: opts.features?.humanInLoop ?? DEFAULT_FEATURES.humanInLoop,
505
507
  tools: opts.features?.tools
506
508
  },
507
- intake: resolveIntake(opts.intake),
509
+ forms: resolveForms(opts.forms),
508
510
  endpoints: {
509
511
  upload: opts.endpoints?.upload ?? DEFAULT_ENDPOINTS.upload,
510
512
  transcribe: opts.endpoints?.transcribe ?? DEFAULT_ENDPOINTS.transcribe,
511
- intake: opts.endpoints?.intake ?? DEFAULT_ENDPOINTS.intake
513
+ submitForm: opts.endpoints?.submitForm ?? DEFAULT_ENDPOINTS.submitForm
512
514
  },
513
515
  attachments: {
514
516
  accept: opts.composer?.attachments?.accept ?? DEFAULT_ATTACHMENTS.accept,
@@ -607,17 +609,57 @@ function resolveModules(overrides) {
607
609
  const byId = Object.fromEntries(list.map((m) => [m.id, m]));
608
610
  return { list, byId };
609
611
  }
610
- function resolveIntake(overrides) {
611
- const fields = (overrides?.fields ?? []).filter((f) => Boolean(f && f.name && f.label && f.type));
612
- if (fields.length === 0) return DEFAULT_INTAKE;
613
- return {
614
- enabled: overrides?.enabled ?? false,
615
- title: overrides?.title,
616
- description: overrides?.description,
617
- fields,
618
- submitLabel: overrides?.submitLabel,
619
- skippable: overrides?.skippable ?? false
620
- };
612
+ var BLOCKABLE_KINDS = /* @__PURE__ */ new Set(["pre-chat", "after-messages"]);
613
+ function resolveForms(overrides) {
614
+ var _a;
615
+ if (!overrides?.length) return DEFAULT_FORMS;
616
+ const list = [];
617
+ const seen = /* @__PURE__ */ new Set();
618
+ for (const def of overrides) {
619
+ if (!def?.id || seen.has(def.id)) continue;
620
+ const fields = (def.fields ?? []).filter((f) => Boolean(f && f.name && f.label && f.type));
621
+ const triggers = (Array.isArray(def.on) ? def.on : [def.on]).map(parseTrigger).filter((t) => t !== null);
622
+ if (fields.length === 0 || triggers.length === 0) continue;
623
+ seen.add(def.id);
624
+ const blockable = triggers.some((t) => BLOCKABLE_KINDS.has(t.kind));
625
+ list.push({
626
+ id: def.id,
627
+ triggers,
628
+ when: def.when,
629
+ fields,
630
+ title: def.title,
631
+ description: def.description,
632
+ submitLabel: def.submitLabel,
633
+ skippable: def.skippable ?? false,
634
+ blocking: (def.blocking ?? false) && blockable,
635
+ frequency: def.frequency ?? "once",
636
+ mirrorToContext: def.mirrorToContext ?? true
637
+ });
638
+ }
639
+ const byTrigger = {};
640
+ for (const form of list) {
641
+ for (const t of form.triggers) (byTrigger[_a = t.kind] ?? (byTrigger[_a] = [])).push(form);
642
+ }
643
+ return { list, byTrigger };
644
+ }
645
+ function parseTrigger(raw) {
646
+ if (typeof raw !== "string") return null;
647
+ if (raw === "pre-chat" || raw === "conversation-closed" || raw === "panel-close" || raw === "manual") {
648
+ return { kind: raw };
649
+ }
650
+ const [head, param] = raw.split(":", 2);
651
+ if (head === "after-messages") {
652
+ const n = Number(param);
653
+ return Number.isFinite(n) && n > 0 ? { kind: "after-messages", param: n } : null;
654
+ }
655
+ if (head === "idle") {
656
+ const n = Number(param);
657
+ return Number.isFinite(n) && n > 0 ? { kind: "idle", param: n } : null;
658
+ }
659
+ if (head === "page-area") {
660
+ return param ? { kind: "page-area", param } : null;
661
+ }
662
+ return null;
621
663
  }
622
664
  function resolveLauncher(overrides) {
623
665
  const callout = overrides?.callout?.text ? {
@@ -664,7 +706,6 @@ var SECTION_KEYS = [
664
706
  "i18n",
665
707
  "footer",
666
708
  "features",
667
- "intake",
668
709
  "endpoints"
669
710
  ];
670
711
  function mergeServerConfig(user, server) {
@@ -682,6 +723,7 @@ function mergeServerConfig(user, server) {
682
723
  out[key] = mergeLeaves(sv, uv);
683
724
  }
684
725
  if (server.modules !== void 0 && user.modules === void 0) out.modules = server.modules;
726
+ if (server.forms !== void 0 && user.forms === void 0) out.forms = server.forms;
685
727
  const userI18n = user.i18n;
686
728
  const serverI18n = server.i18n;
687
729
  if (userI18n || serverI18n) {
@@ -909,7 +951,7 @@ function bindHostCommands(host, handlers) {
909
951
  const entries = Object.entries(handlers);
910
952
  const wrapped = entries.map(([cmd, fn]) => {
911
953
  const event = commandEventName(cmd);
912
- const listener = () => fn();
954
+ const listener = (e) => fn(e.detail);
913
955
  host.addEventListener(event, listener);
914
956
  return [event, listener];
915
957
  });
@@ -925,7 +967,7 @@ var tokens_default = ':host{--__P__-accent: __BRAND_ACCENT__;--__P__-accent-text
925
967
  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';
926
968
 
927
969
  // src/styles/panel.css
928
- 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';
970
+ 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';
929
971
 
930
972
  // src/styles/standalone.css
931
973
  var standalone_default = ".__P__-standalone-page{margin:0;height:100vh;background:var(--__P__-bg, #fff);display:grid;place-items:stretch}\n";
@@ -1013,22 +1055,22 @@ function attachAdoptedSheet(shadow, doc) {
1013
1055
  }
1014
1056
  }
1015
1057
  function applyThemeOverrides(host, overrides) {
1016
- const p33 = BRAND.cssPrefix;
1017
- if (overrides.accent) host.style.setProperty(`--${p33}-accent`, overrides.accent);
1018
- if (overrides.accentText) host.style.setProperty(`--${p33}-accent-text`, overrides.accentText);
1019
- if (overrides.radius) host.style.setProperty(`--${p33}-radius`, overrides.radius);
1020
- if (overrides.fontFamily) host.style.setProperty(`--${p33}-font`, overrides.fontFamily);
1058
+ const p34 = BRAND.cssPrefix;
1059
+ if (overrides.accent) host.style.setProperty(`--${p34}-accent`, overrides.accent);
1060
+ if (overrides.accentText) host.style.setProperty(`--${p34}-accent-text`, overrides.accentText);
1061
+ if (overrides.radius) host.style.setProperty(`--${p34}-radius`, overrides.radius);
1062
+ if (overrides.fontFamily) host.style.setProperty(`--${p34}-font`, overrides.fontFamily);
1021
1063
  }
1022
1064
  function applyThemeMode(host, mode) {
1023
1065
  host.dataset.theme = mode;
1024
1066
  }
1025
1067
  function applySize(host, size) {
1026
- const p33 = BRAND.cssPrefix;
1027
- if (size.width !== void 0) host.style.setProperty(`--${p33}-panel-w`, size.width);
1028
- if (size.height !== void 0) host.style.setProperty(`--${p33}-panel-h`, size.height);
1029
- if (size.expanded?.width !== void 0) host.style.setProperty(`--${p33}-expanded-w`, size.expanded.width);
1030
- if (size.expanded?.height !== void 0) host.style.setProperty(`--${p33}-expanded-h`, size.expanded.height);
1031
- if (size.inset !== void 0) host.style.setProperty(`--${p33}-panel-inset`, size.inset);
1068
+ const p34 = BRAND.cssPrefix;
1069
+ if (size.width !== void 0) host.style.setProperty(`--${p34}-panel-w`, size.width);
1070
+ if (size.height !== void 0) host.style.setProperty(`--${p34}-panel-h`, size.height);
1071
+ if (size.expanded?.width !== void 0) host.style.setProperty(`--${p34}-expanded-w`, size.expanded.width);
1072
+ if (size.expanded?.height !== void 0) host.style.setProperty(`--${p34}-expanded-h`, size.expanded.height);
1073
+ if (size.inset !== void 0) host.style.setProperty(`--${p34}-panel-inset`, size.inset);
1032
1074
  }
1033
1075
  function applyPosition(host, pos) {
1034
1076
  host.dataset.position = pos;
@@ -1130,7 +1172,7 @@ var StreamError = class extends Error {
1130
1172
 
1131
1173
  // src/stream/parser.ts
1132
1174
  var log3 = logger.scope("parser");
1133
- async function* parseChatStream(response, signal6) {
1175
+ async function* parseChatStream(response, signal7) {
1134
1176
  if (!response.ok) {
1135
1177
  const text = await response.text().catch(() => "");
1136
1178
  throw new StreamError(`server responded ${response.status}: ${text.slice(0, 200)}`, "server", response.status);
@@ -1140,7 +1182,7 @@ async function* parseChatStream(response, signal6) {
1140
1182
  let buffer = "";
1141
1183
  try {
1142
1184
  while (true) {
1143
- if (signal6.aborted) throw new DOMException("aborted", "AbortError");
1185
+ if (signal7.aborted) throw new DOMException("aborted", "AbortError");
1144
1186
  const { done, value } = await reader.read();
1145
1187
  if (done) {
1146
1188
  const trailing = buffer.trim();
@@ -1199,11 +1241,11 @@ function toBase64Url(json) {
1199
1241
  var nonEmpty = (ctx) => ctx && Object.keys(ctx).length > 0 ? ctx : void 0;
1200
1242
  function encodeContext(user, page) {
1201
1243
  const u = nonEmpty(user);
1202
- const p33 = nonEmpty(page);
1203
- if (!u && !p33) return void 0;
1244
+ const p34 = nonEmpty(page);
1245
+ if (!u && !p34) return void 0;
1204
1246
  const envelope = {};
1205
1247
  if (u) envelope.user = u;
1206
- if (p33) envelope.page = p33;
1248
+ if (p34) envelope.page = p34;
1207
1249
  return toBase64Url(JSON.stringify(envelope));
1208
1250
  }
1209
1251
 
@@ -1244,13 +1286,12 @@ var DEFAULT_PATHS = {
1244
1286
  /** All widget content via one filtered endpoint. `GET /ai/agent/content?tags=…`. */
1245
1287
  content: "/ai/agent/content",
1246
1288
  /**
1247
- * Optional pre-chat intake submission. POST `{ visitorId, sessionId, values,
1248
- * skipped? }` → record the lead immediately (before/independent of the first
1249
- * message), keyed by the same visitor + session as the conversation.
1250
- * Overridable via `endpoints.intake`. Fire-and-forget; 404 on older backends
1251
- * is ignored.
1289
+ * Form submission (the event-driven forms engine). POST `{ visitorId,
1290
+ * sessionId, formId, trigger, values, skipped? }` → record the form's answers
1291
+ * immediately, keyed by the same visitor + session as the conversation.
1292
+ * Overridable via `endpoints.submitForm`. Fire-and-forget; 404 is ignored.
1252
1293
  */
1253
- intake: "/ai/agent/intake"
1294
+ submitForm: "/ai/agent/submit-form"
1254
1295
  };
1255
1296
  var CONTEXT_PARAM = "context";
1256
1297
  function buildSendMessageRequest(params) {
@@ -1274,8 +1315,8 @@ function buildSendMessageRequest(params) {
1274
1315
  if (Object.keys(data).length > 0) body.data = data;
1275
1316
  return body;
1276
1317
  }
1277
- function isResolvedToolPart(p33) {
1278
- return p33.state === "output" || p33.state === "error" || p33.approval?.approved !== void 0;
1318
+ function isResolvedToolPart(p34) {
1319
+ return p34.state === "output" || p34.state === "error" || p34.approval?.approved !== void 0;
1279
1320
  }
1280
1321
  function normalizeToolRef(ref) {
1281
1322
  if (typeof ref === "string") return ref ? { code: ref } : null;
@@ -1283,24 +1324,24 @@ function normalizeToolRef(ref) {
1283
1324
  }
1284
1325
  function messageToWireParts(m) {
1285
1326
  const out = [];
1286
- for (const p33 of m.parts) {
1287
- if (p33.kind === "text" && p33.text) {
1288
- out.push({ text: p33.text, type: "text" });
1327
+ for (const p34 of m.parts) {
1328
+ if (p34.kind === "text" && p34.text) {
1329
+ out.push({ text: p34.text, type: "text" });
1289
1330
  }
1290
- if (p33.kind === "file" && p33.url) {
1291
- out.push({ mediaType: p33.mediaType, type: "file", url: p33.url });
1331
+ if (p34.kind === "file" && p34.url) {
1332
+ out.push({ mediaType: p34.mediaType, type: "file", url: p34.url });
1292
1333
  }
1293
- if (p33.kind === "tool" && isResolvedToolPart(p33)) {
1334
+ if (p34.kind === "tool" && isResolvedToolPart(p34)) {
1294
1335
  const part = {
1295
1336
  type: "tool",
1296
- toolCallId: p33.toolCallId,
1297
- toolName: p33.toolName,
1298
- state: p33.state
1337
+ toolCallId: p34.toolCallId,
1338
+ toolName: p34.toolName,
1339
+ state: p34.state
1299
1340
  };
1300
- if (p33.input !== void 0) part.input = p33.input;
1301
- if (p33.output !== void 0) part.output = p33.output;
1302
- if (p33.error !== void 0) part.errorText = p33.error;
1303
- if (p33.approval && p33.approval.approved !== void 0) part.approval = p33.approval;
1341
+ if (p34.input !== void 0) part.input = p34.input;
1342
+ if (p34.output !== void 0) part.output = p34.output;
1343
+ if (p34.error !== void 0) part.errorText = p34.error;
1344
+ if (p34.approval && p34.approval.approved !== void 0) part.approval = p34.approval;
1304
1345
  out.push(part);
1305
1346
  }
1306
1347
  }
@@ -1334,15 +1375,15 @@ function retryAfterMs(headers) {
1334
1375
  const ms = Number.isFinite(secs) ? secs * 1e3 : Date.parse(raw) - Date.now();
1335
1376
  return Number.isFinite(ms) && ms >= 0 ? Math.min(ms, 3e4) : null;
1336
1377
  }
1337
- function sleep(ms, signal6) {
1378
+ function sleep(ms, signal7) {
1338
1379
  return new Promise((resolve) => {
1339
- if (signal6?.aborted) return resolve();
1380
+ if (signal7?.aborted) return resolve();
1340
1381
  const id = setTimeout(done, ms);
1341
1382
  const onAbort = () => done();
1342
- signal6?.addEventListener("abort", onAbort, { once: true });
1383
+ signal7?.addEventListener("abort", onAbort, { once: true });
1343
1384
  function done() {
1344
1385
  clearTimeout(id);
1345
- signal6?.removeEventListener("abort", onAbort);
1386
+ signal7?.removeEventListener("abort", onAbort);
1346
1387
  resolve();
1347
1388
  }
1348
1389
  });
@@ -1548,23 +1589,22 @@ var AgentTransport = class {
1548
1589
  get transcribePath() {
1549
1590
  return this.opts.endpoints?.transcribe ?? "/ai/agent/transcribe-audio";
1550
1591
  }
1551
- get intakePath() {
1552
- return this.opts.endpoints?.intake ?? DEFAULT_PATHS.intake;
1592
+ get submitFormPath() {
1593
+ return this.opts.endpoints?.submitForm ?? DEFAULT_PATHS.submitForm;
1553
1594
  }
1554
1595
  /**
1555
- * Record a completed pre-chat intake form. Fire-and-forget — the lead is
1556
- * captured even if the visitor never sends a message. `sessionId` is explicit
1557
- * so the record ties to the conversation that follows; `visitorId` + context
1558
- * ride the envelope. A failure (e.g. 404 on a backend that doesn't implement
1559
- * the endpoint) is non-fatal the values still reach the agent as
1560
- * `userContext` on the next message, so callers don't await this.
1596
+ * Record a completed form (intake, CSAT, claim, …). Fire-and-forget — the
1597
+ * record is captured even if the visitor never sends a message. `sessionId`,
1598
+ * `formId`, and `trigger` are explicit so the backend can tie + route;
1599
+ * `visitorId` + context ride the envelope. A failure (e.g. 404 on a backend
1600
+ * that doesn't implement the endpoint) is non-fatal, so callers don't await.
1561
1601
  */
1562
- async submitIntake(sessionId, values, skipped = false) {
1563
- log4.debug("submitIntake \u2192", { sessionId, fields: Object.keys(values).length, skipped });
1602
+ async submitForm(body) {
1603
+ log4.debug("submitForm \u2192", { formId: body.formId, trigger: body.trigger, fields: Object.keys(body.values).length });
1564
1604
  try {
1565
- await this.postJson(this.intakePath, { sessionId, values, skipped }, "submitIntake");
1605
+ await this.postJson(this.submitFormPath, body, "submitForm");
1566
1606
  } catch (err) {
1567
- log4.debug("submitIntake failed (non-fatal)", { err });
1607
+ log4.debug("submitForm failed (non-fatal)", { err });
1568
1608
  }
1569
1609
  }
1570
1610
  sendMessage(body) {
@@ -1704,7 +1744,7 @@ var AgentTransport = class {
1704
1744
  }).catch((err) => log4.debug("cancel POST failed (non-fatal)", { err }));
1705
1745
  }
1706
1746
  // ---- Low-level fetch helpers ------------------------------------------
1707
- async *openMessageStream(body, signal6) {
1747
+ async *openMessageStream(body, signal7) {
1708
1748
  const res = await this.fetchImpl(this.url(DEFAULT_PATHS.streamMessage), {
1709
1749
  method: "POST",
1710
1750
  credentials: "omit",
@@ -1714,9 +1754,9 @@ var AgentTransport = class {
1714
1754
  ...this.opts.auth.headers()
1715
1755
  },
1716
1756
  body: JSON.stringify(this.withEnvelope(body)),
1717
- signal: signal6
1757
+ signal: signal7
1718
1758
  });
1719
- yield* parseChatStream(res, signal6);
1759
+ yield* parseChatStream(res, signal7);
1720
1760
  }
1721
1761
  /**
1722
1762
  * Resume URL: `GET /stream-resume` with the envelope (visitorId / sessionId /
@@ -1894,7 +1934,7 @@ function fromWireMessage(w) {
1894
1934
  };
1895
1935
  }
1896
1936
  return null;
1897
- }).filter((p33) => p33 !== null);
1937
+ }).filter((p34) => p34 !== null);
1898
1938
  return {
1899
1939
  id: w.id,
1900
1940
  role: w.role,
@@ -1924,43 +1964,43 @@ function assistantText(m) {
1924
1964
  }
1925
1965
  return out;
1926
1966
  }
1927
- function partToReactive(p33) {
1928
- if (p33.kind === "text" || p33.kind === "reasoning") {
1929
- return { kind: p33.kind, id: p33.id, textSig: signal(p33.text), doneSig: signal(p33.done) };
1967
+ function partToReactive(p34) {
1968
+ if (p34.kind === "text" || p34.kind === "reasoning") {
1969
+ return { kind: p34.kind, id: p34.id, textSig: signal(p34.text), doneSig: signal(p34.done) };
1930
1970
  }
1931
- if (p33.kind === "tool") {
1971
+ if (p34.kind === "tool") {
1932
1972
  return {
1933
1973
  kind: "tool",
1934
- toolCallId: p33.toolCallId,
1935
- toolName: p33.toolName,
1936
- inputPartialSig: signal(p33.inputPartial),
1937
- inputSig: signal(p33.input),
1938
- outputSig: signal(p33.output),
1939
- errorSig: signal(p33.error),
1940
- stateSig: signal(p33.state),
1941
- approvalSig: signal(p33.approval)
1974
+ toolCallId: p34.toolCallId,
1975
+ toolName: p34.toolName,
1976
+ inputPartialSig: signal(p34.inputPartial),
1977
+ inputSig: signal(p34.input),
1978
+ outputSig: signal(p34.output),
1979
+ errorSig: signal(p34.error),
1980
+ stateSig: signal(p34.state),
1981
+ approvalSig: signal(p34.approval)
1942
1982
  };
1943
1983
  }
1944
- return p33;
1984
+ return p34;
1945
1985
  }
1946
- function partFromReactive(p33) {
1947
- if (p33.kind === "text" || p33.kind === "reasoning") {
1948
- return { kind: p33.kind, id: p33.id, text: p33.textSig.value, done: p33.doneSig.value };
1986
+ function partFromReactive(p34) {
1987
+ if (p34.kind === "text" || p34.kind === "reasoning") {
1988
+ return { kind: p34.kind, id: p34.id, text: p34.textSig.value, done: p34.doneSig.value };
1949
1989
  }
1950
- if (p33.kind === "tool") {
1990
+ if (p34.kind === "tool") {
1951
1991
  return {
1952
1992
  kind: "tool",
1953
- toolCallId: p33.toolCallId,
1954
- toolName: p33.toolName,
1955
- inputPartial: p33.inputPartialSig.value,
1956
- input: p33.inputSig.value,
1957
- output: p33.outputSig.value,
1958
- error: p33.errorSig.value,
1959
- state: p33.stateSig.value,
1960
- approval: p33.approvalSig.value
1993
+ toolCallId: p34.toolCallId,
1994
+ toolName: p34.toolName,
1995
+ inputPartial: p34.inputPartialSig.value,
1996
+ input: p34.inputSig.value,
1997
+ output: p34.outputSig.value,
1998
+ error: p34.errorSig.value,
1999
+ state: p34.stateSig.value,
2000
+ approval: p34.approvalSig.value
1961
2001
  };
1962
2002
  }
1963
- return p33;
2003
+ return p34;
1964
2004
  }
1965
2005
 
1966
2006
  // src/stream/reducer.ts
@@ -2015,8 +2055,8 @@ var StreamReducer = class {
2015
2055
  ensureTextPart(m, "text", chunk.id);
2016
2056
  return;
2017
2057
  case "text-delta": {
2018
- const p33 = ensureTextPart(m, "text", chunk.id);
2019
- p33.textSig.value += chunk.delta;
2058
+ const p34 = ensureTextPart(m, "text", chunk.id);
2059
+ p34.textSig.value += chunk.delta;
2020
2060
  return;
2021
2061
  }
2022
2062
  case "text-end":
@@ -2026,8 +2066,8 @@ var StreamReducer = class {
2026
2066
  ensureTextPart(m, "reasoning", chunk.id).doneSig.value = false;
2027
2067
  return;
2028
2068
  case "reasoning-delta": {
2029
- const p33 = ensureTextPart(m, "reasoning", chunk.id);
2030
- p33.textSig.value += chunk.delta;
2069
+ const p34 = ensureTextPart(m, "reasoning", chunk.id);
2070
+ p34.textSig.value += chunk.delta;
2031
2071
  return;
2032
2072
  }
2033
2073
  case "reasoning-end":
@@ -2046,7 +2086,7 @@ var StreamReducer = class {
2046
2086
  return;
2047
2087
  case "source-url": {
2048
2088
  const parts = m.partsSig.value;
2049
- if (parts.some((p33) => p33.kind === "source" && p33.sourceId === chunk.sourceId)) return;
2089
+ if (parts.some((p34) => p34.kind === "source" && p34.sourceId === chunk.sourceId)) return;
2050
2090
  appendPart(m, { kind: "source", sourceId: chunk.sourceId, url: chunk.url, title: chunk.title });
2051
2091
  return;
2052
2092
  }
@@ -2070,14 +2110,14 @@ var StreamReducer = class {
2070
2110
  }
2071
2111
  };
2072
2112
  function ensureTextPart(m, kind, id) {
2073
- const existing = m.partsSig.value.find((p33) => p33.kind === kind && p33.id === id);
2113
+ const existing = m.partsSig.value.find((p34) => p34.kind === kind && p34.id === id);
2074
2114
  if (existing) return existing;
2075
2115
  const part = { kind, id, textSig: signal2(""), doneSig: signal2(false) };
2076
2116
  appendPart(m, part);
2077
2117
  return part;
2078
2118
  }
2079
2119
  function ensureToolPart(m, toolCallId, toolName) {
2080
- const existing = m.partsSig.value.find((p33) => p33.kind === "tool" && p33.toolCallId === toolCallId);
2120
+ const existing = m.partsSig.value.find((p34) => p34.kind === "tool" && p34.toolCallId === toolCallId);
2081
2121
  if (existing) return existing;
2082
2122
  const part = {
2083
2123
  kind: "tool",
@@ -2102,32 +2142,32 @@ function applyTool(m, chunk) {
2102
2142
  ensureToolPart(m, chunk.toolCallId, chunk.toolName);
2103
2143
  return;
2104
2144
  case "tool-input-delta": {
2105
- const p33 = ensureToolPart(m, chunk.toolCallId);
2106
- p33.inputPartialSig.value += chunk.delta;
2145
+ const p34 = ensureToolPart(m, chunk.toolCallId);
2146
+ p34.inputPartialSig.value += chunk.delta;
2107
2147
  return;
2108
2148
  }
2109
2149
  case "tool-input-available": {
2110
- const p33 = ensureToolPart(m, chunk.toolCallId, chunk.toolName);
2111
- p33.inputSig.value = chunk.input;
2112
- p33.stateSig.value = isAskUserInputTool(p33.toolName) ? "awaiting-input" : "awaiting";
2150
+ const p34 = ensureToolPart(m, chunk.toolCallId, chunk.toolName);
2151
+ p34.inputSig.value = chunk.input;
2152
+ p34.stateSig.value = isAskUserInputTool(p34.toolName) ? "awaiting-input" : "awaiting";
2113
2153
  return;
2114
2154
  }
2115
2155
  case "tool-approval-request": {
2116
- const p33 = ensureToolPart(m, chunk.toolCallId, chunk.toolName);
2117
- p33.approvalSig.value = { id: chunk.approvalId };
2118
- p33.stateSig.value = "awaiting-approval";
2156
+ const p34 = ensureToolPart(m, chunk.toolCallId, chunk.toolName);
2157
+ p34.approvalSig.value = { id: chunk.approvalId };
2158
+ p34.stateSig.value = "awaiting-approval";
2119
2159
  return;
2120
2160
  }
2121
2161
  case "tool-output-available": {
2122
- const p33 = ensureToolPart(m, chunk.toolCallId);
2123
- p33.outputSig.value = chunk.output;
2124
- p33.stateSig.value = "output";
2162
+ const p34 = ensureToolPart(m, chunk.toolCallId);
2163
+ p34.outputSig.value = chunk.output;
2164
+ p34.stateSig.value = "output";
2125
2165
  return;
2126
2166
  }
2127
2167
  case "tool-output-error": {
2128
- const p33 = ensureToolPart(m, chunk.toolCallId);
2129
- p33.errorSig.value = chunk.errorText;
2130
- p33.stateSig.value = "error";
2168
+ const p34 = ensureToolPart(m, chunk.toolCallId);
2169
+ p34.errorSig.value = chunk.errorText;
2170
+ p34.stateSig.value = "error";
2131
2171
  return;
2132
2172
  }
2133
2173
  default:
@@ -2147,7 +2187,7 @@ function createPersistence(widgetId, storage = defaultStorage) {
2147
2187
  const KEY_CALLOUT_DISMISSED = `${prefix}.calloutDismissed`;
2148
2188
  const KEY_SIDEBAR_COLLAPSED = `${prefix}.sidebarCollapsed`;
2149
2189
  const KEY_ACTIVE_MODULE = `${prefix}.activeModule`;
2150
- const KEY_INTAKE = `${prefix}.intake`;
2190
+ const KEY_FORMS_DONE = `${prefix}.formsDone`;
2151
2191
  const persistence = {
2152
2192
  getVisitorId() {
2153
2193
  const existing = storage.get(KEY_VISITOR);
@@ -2230,22 +2270,24 @@ function createPersistence(widgetId, storage = defaultStorage) {
2230
2270
  saveActiveModule(id) {
2231
2271
  storage.set(KEY_ACTIVE_MODULE, id);
2232
2272
  },
2233
- loadIntake() {
2234
- const raw = storage.get(KEY_INTAKE);
2235
- if (!raw) return null;
2273
+ loadFormsDone() {
2274
+ const raw = storage.get(KEY_FORMS_DONE);
2275
+ if (!raw) return {};
2236
2276
  try {
2237
2277
  const parsed = JSON.parse(raw);
2238
- return isPlainObject2(parsed) ? parsed : null;
2278
+ return isPlainObject2(parsed) ? parsed : {};
2239
2279
  } catch (error) {
2240
- log6.warn("loadIntake parse failed", { error });
2241
- return null;
2280
+ log6.warn("loadFormsDone parse failed", { error });
2281
+ return {};
2242
2282
  }
2243
2283
  },
2244
- saveIntake(values) {
2284
+ saveFormDone(id) {
2245
2285
  try {
2246
- storage.set(KEY_INTAKE, JSON.stringify(values));
2286
+ const done = persistence.loadFormsDone();
2287
+ done[id] = Date.now();
2288
+ storage.set(KEY_FORMS_DONE, JSON.stringify(done));
2247
2289
  } catch (error) {
2248
- log6.warn("saveIntake serialise failed", { error });
2290
+ log6.warn("saveFormDone serialise failed", { error });
2249
2291
  }
2250
2292
  },
2251
2293
  clearSession() {
@@ -2790,13 +2832,17 @@ var TID = {
2790
2832
  helpArticle: `${p2}-help-article`,
2791
2833
  /** News list item — suffix `-{id}`. */
2792
2834
  newsItem: `${p2}-news-item`,
2793
- // ── Forms + human-in-the-loop (intake / ask-input / approval) ────
2794
- /** Pre-chat intake form root (blocking gate). */
2795
- intakeForm: `${p2}-intake-form`,
2796
- /** Intake submit button. */
2797
- intakeSubmit: `${p2}-intake-submit`,
2798
- /** Intake skip button (only when `skippable`). */
2799
- intakeSkip: `${p2}-intake-skip`,
2835
+ // ── Forms + human-in-the-loop (forms / ask-input / approval) ─────
2836
+ /** Blocking form gate root (replaces the composer). */
2837
+ formGate: `${p2}-form-gate`,
2838
+ /** Inline form card root (in the transcript). */
2839
+ formCard: `${p2}-form-card`,
2840
+ /** Form submit button. */
2841
+ formSubmit: `${p2}-form-submit`,
2842
+ /** Form skip button (blocking gate, when `skippable`). */
2843
+ formSkip: `${p2}-form-skip`,
2844
+ /** Inline form-card dismiss button. */
2845
+ formDismiss: `${p2}-form-dismiss`,
2800
2846
  /** A single form field control — suffix `-{name}` at the JSX site. */
2801
2847
  formField: `${p2}-form-field`,
2802
2848
  /** Ask-input tool root (inline form in a message bubble). */
@@ -2923,24 +2969,24 @@ import { useCallback as useCallback2, useEffect as useEffect10, useRef as useRef
2923
2969
  import { useEffect as useEffect2, useRef } from "preact/hooks";
2924
2970
  import { jsx as jsx3 } from "preact/jsx-runtime";
2925
2971
  function ResizeGrip({ panelEl, resize, position, initialSize, onSizeChange, strings }) {
2926
- const p33 = BRAND.cssPrefix;
2972
+ const p34 = BRAND.cssPrefix;
2927
2973
  const dragRef = useRef(null);
2928
2974
  useEffect2(() => {
2929
2975
  if (!panelEl) return;
2930
2976
  const style = panelEl.style;
2931
- if (resize.minWidth) style.setProperty(`--${p33}-resize-min-w`, resize.minWidth);
2932
- if (resize.maxWidth) style.setProperty(`--${p33}-resize-max-w`, resize.maxWidth);
2933
- if (resize.minHeight) style.setProperty(`--${p33}-resize-min-h`, resize.minHeight);
2934
- if (resize.maxHeight) style.setProperty(`--${p33}-resize-max-h`, resize.maxHeight);
2977
+ if (resize.minWidth) style.setProperty(`--${p34}-resize-min-w`, resize.minWidth);
2978
+ if (resize.maxWidth) style.setProperty(`--${p34}-resize-max-w`, resize.maxWidth);
2979
+ if (resize.minHeight) style.setProperty(`--${p34}-resize-min-h`, resize.minHeight);
2980
+ if (resize.maxHeight) style.setProperty(`--${p34}-resize-max-h`, resize.maxHeight);
2935
2981
  if (initialSize) {
2936
- style.setProperty(`--${p33}-widget-w`, `${initialSize.width}px`);
2937
- style.setProperty(`--${p33}-widget-h`, `${initialSize.height}px`);
2982
+ style.setProperty(`--${p34}-widget-w`, `${initialSize.width}px`);
2983
+ style.setProperty(`--${p34}-widget-h`, `${initialSize.height}px`);
2938
2984
  }
2939
- }, [panelEl, resize.minWidth, resize.maxWidth, resize.minHeight, resize.maxHeight, p33, initialSize]);
2985
+ }, [panelEl, resize.minWidth, resize.maxWidth, resize.minHeight, resize.maxHeight, p34, initialSize]);
2940
2986
  if (!panelEl) return null;
2941
2987
  const isTop = position.startsWith("top-");
2942
2988
  const isRight = position.endsWith("-right");
2943
- const cornerClass = `${p33}-resize-grip ${p33}-resize-grip--${isTop ? "bottom" : "top"}-${isRight ? "left" : "right"}`;
2989
+ const cornerClass = `${p34}-resize-grip ${p34}-resize-grip--${isTop ? "bottom" : "top"}-${isRight ? "left" : "right"}`;
2944
2990
  const onPointerDown = (e) => {
2945
2991
  if (!panelEl) return;
2946
2992
  const target = e.currentTarget;
@@ -2964,8 +3010,8 @@ function ResizeGrip({ panelEl, resize, position, initialSize, onSizeChange, stri
2964
3010
  if (!d || e.pointerId !== d.pointerId || !panelEl) return;
2965
3011
  const dx = (e.clientX - d.startX) * d.dirX;
2966
3012
  const dy = (e.clientY - d.startY) * d.dirY;
2967
- panelEl.style.setProperty(`--${p33}-widget-w`, `${d.startW + dx}px`);
2968
- panelEl.style.setProperty(`--${p33}-widget-h`, `${d.startH + dy}px`);
3013
+ panelEl.style.setProperty(`--${p34}-widget-w`, `${d.startW + dx}px`);
3014
+ panelEl.style.setProperty(`--${p34}-widget-h`, `${d.startH + dy}px`);
2969
3015
  };
2970
3016
  const onPointerUp = (e) => {
2971
3017
  const d = dragRef.current;
@@ -3700,20 +3746,20 @@ function usePopoverMenu({ itemCount, initialFocusIndex }) {
3700
3746
  // src/ui/overflow-menu.tsx
3701
3747
  import { jsx as jsx8, jsxs as jsxs6 } from "preact/jsx-runtime";
3702
3748
  function OverflowMenu({ items, triggerLabel }) {
3703
- const p33 = BRAND.cssPrefix;
3749
+ const p34 = BRAND.cssPrefix;
3704
3750
  const menu = usePopoverMenu({ itemCount: items.length });
3705
3751
  const handleSelect = (item) => {
3706
3752
  if (item.disabled) return;
3707
3753
  item.onSelect();
3708
3754
  if (!item.keepOpen) menu.close();
3709
3755
  };
3710
- return /* @__PURE__ */ jsxs6("div", { class: `${p33}-menu-wrap`, children: [
3756
+ return /* @__PURE__ */ jsxs6("div", { class: `${p34}-menu-wrap`, children: [
3711
3757
  /* @__PURE__ */ jsx8(
3712
3758
  "button",
3713
3759
  {
3714
3760
  ref: menu.triggerRef,
3715
3761
  type: "button",
3716
- class: `${p33}-icon-btn`,
3762
+ class: `${p34}-icon-btn`,
3717
3763
  "aria-label": triggerLabel,
3718
3764
  "aria-haspopup": "menu",
3719
3765
  "aria-expanded": menu.open,
@@ -3727,7 +3773,7 @@ function OverflowMenu({ items, triggerLabel }) {
3727
3773
  "div",
3728
3774
  {
3729
3775
  ref: menu.menuRef,
3730
- class: `${p33}-menu`,
3776
+ class: `${p34}-menu`,
3731
3777
  role: "menu",
3732
3778
  "aria-label": triggerLabel,
3733
3779
  onKeyDown: menu.onMenuKey,
@@ -3737,15 +3783,15 @@ function OverflowMenu({ items, triggerLabel }) {
3737
3783
  {
3738
3784
  type: "button",
3739
3785
  role: "menuitem",
3740
- class: `${p33}-menu-item`,
3786
+ class: `${p34}-menu-item`,
3741
3787
  "aria-pressed": item.type === "switch" ? item.on : void 0,
3742
3788
  disabled: item.disabled,
3743
3789
  lang: item.lang,
3744
3790
  onClick: () => handleSelect(item),
3745
3791
  children: [
3746
- item.icon ? /* @__PURE__ */ jsx8("span", { class: `${p33}-menu-icon`, children: item.icon }) : null,
3747
- /* @__PURE__ */ jsx8("span", { class: `${p33}-menu-label`, children: item.label }),
3748
- item.type === "switch" && item.on ? /* @__PURE__ */ jsx8("span", { class: `${p33}-menu-check`, "aria-hidden": "true", children: /* @__PURE__ */ jsx8(CheckIcon, {}) }) : null
3792
+ item.icon ? /* @__PURE__ */ jsx8("span", { class: `${p34}-menu-icon`, children: item.icon }) : null,
3793
+ /* @__PURE__ */ jsx8("span", { class: `${p34}-menu-label`, children: item.label }),
3794
+ item.type === "switch" && item.on ? /* @__PURE__ */ jsx8("span", { class: `${p34}-menu-check`, "aria-hidden": "true", children: /* @__PURE__ */ jsx8(CheckIcon, {}) }) : null
3749
3795
  ]
3750
3796
  },
3751
3797
  item.id
@@ -4161,7 +4207,17 @@ function renderControl(args) {
4161
4207
  }
4162
4208
  }
4163
4209
  function inputType(type) {
4164
- return type === "number" || type === "email" || type === "tel" || type === "url" ? type : "text";
4210
+ switch (type) {
4211
+ case "number":
4212
+ case "email":
4213
+ case "tel":
4214
+ case "url":
4215
+ case "date":
4216
+ case "time":
4217
+ return type;
4218
+ default:
4219
+ return "text";
4220
+ }
4165
4221
  }
4166
4222
  function seedValues(fields) {
4167
4223
  const out = {};
@@ -4186,24 +4242,24 @@ function resolveValues(fields, values, other) {
4186
4242
  return out;
4187
4243
  }
4188
4244
 
4189
- // src/ui/intake-gate.tsx
4245
+ // src/ui/form/form-gate.tsx
4190
4246
  import { jsx as jsx11, jsxs as jsxs9 } from "preact/jsx-runtime";
4191
4247
  var p11 = BRAND.cssPrefix;
4192
- function IntakeGate({ intake, strings, onComplete }) {
4193
- return /* @__PURE__ */ jsxs9("div", { class: `${p11}-intake`, "data-testid": TID.intakeForm, children: [
4194
- intake.title ? /* @__PURE__ */ jsx11("h3", { class: `${p11}-intake-title`, children: intake.title }) : null,
4195
- intake.description ? /* @__PURE__ */ jsx11("p", { class: `${p11}-intake-desc`, children: intake.description }) : null,
4248
+ function FormGate({ form, strings, onSubmit, onSkip }) {
4249
+ return /* @__PURE__ */ jsxs9("div", { class: `${p11}-form-gate`, "data-testid": TID.formGate, children: [
4250
+ form.title ? /* @__PURE__ */ jsx11("h3", { class: `${p11}-form-gate-title`, children: form.title }) : null,
4251
+ form.description ? /* @__PURE__ */ jsx11("p", { class: `${p11}-form-gate-desc`, children: form.description }) : null,
4196
4252
  /* @__PURE__ */ jsx11(
4197
4253
  DynamicForm,
4198
4254
  {
4199
- fields: intake.fields,
4255
+ fields: form.fields,
4200
4256
  strings,
4201
- submitLabel: intake.submitLabel ?? strings.intakeSubmit,
4202
- onSubmit: onComplete,
4203
- skipLabel: intake.skippable ? strings.intakeSkip : void 0,
4204
- onSkip: intake.skippable ? () => onComplete({}) : void 0,
4205
- submitTestId: TID.intakeSubmit,
4206
- skipTestId: TID.intakeSkip
4257
+ submitLabel: form.submitLabel ?? strings.formSubmit,
4258
+ onSubmit,
4259
+ skipLabel: form.skippable ? strings.formSkip : void 0,
4260
+ onSkip: form.skippable ? onSkip : void 0,
4261
+ submitTestId: TID.formSubmit,
4262
+ skipTestId: TID.formSkip
4207
4263
  }
4208
4264
  )
4209
4265
  ] });
@@ -4213,6 +4269,40 @@ function IntakeGate({ intake, strings, onComplete }) {
4213
4269
  import { useEffect as useEffect8, useLayoutEffect, useRef as useRef5, useState as useState6 } from "preact/hooks";
4214
4270
  import { useComputed as useComputed5 } from "@preact/signals";
4215
4271
 
4272
+ // src/ui/form/form-card.tsx
4273
+ import { jsx as jsx12, jsxs as jsxs10 } from "preact/jsx-runtime";
4274
+ var p12 = BRAND.cssPrefix;
4275
+ function FormCard({ form, strings, onSubmit, onSkip }) {
4276
+ return /* @__PURE__ */ jsxs10("div", { class: `${p12}-form-card`, "data-testid": TID.formCard, children: [
4277
+ /* @__PURE__ */ jsxs10("div", { class: `${p12}-form-card-head`, children: [
4278
+ form.title ? /* @__PURE__ */ jsx12("strong", { class: `${p12}-form-card-title`, children: form.title }) : /* @__PURE__ */ jsx12("span", {}),
4279
+ /* @__PURE__ */ jsx12(
4280
+ "button",
4281
+ {
4282
+ type: "button",
4283
+ class: `${p12}-icon-btn`,
4284
+ onClick: onSkip,
4285
+ "aria-label": strings.formDismiss,
4286
+ title: strings.formDismiss,
4287
+ "data-testid": TID.formDismiss,
4288
+ children: /* @__PURE__ */ jsx12(CloseIcon, {})
4289
+ }
4290
+ )
4291
+ ] }),
4292
+ form.description ? /* @__PURE__ */ jsx12("p", { class: `${p12}-form-card-desc`, children: form.description }) : null,
4293
+ /* @__PURE__ */ jsx12(
4294
+ DynamicForm,
4295
+ {
4296
+ fields: form.fields,
4297
+ strings,
4298
+ submitLabel: form.submitLabel ?? strings.formSubmit,
4299
+ onSubmit,
4300
+ submitTestId: TID.formSubmit
4301
+ }
4302
+ )
4303
+ ] });
4304
+ }
4305
+
4216
4306
  // src/ui/message-bubble.tsx
4217
4307
  import { useComputed as useComputed4 } from "@preact/signals";
4218
4308
 
@@ -4220,7 +4310,7 @@ import { useComputed as useComputed4 } from "@preact/signals";
4220
4310
  import { useEffect as useEffect7, useMemo, useRef as useRef4 } from "preact/hooks";
4221
4311
  import { effect, signal as signal4 } from "@preact/signals";
4222
4312
  import * as smd from "streaming-markdown";
4223
- import { jsx as jsx12 } from "preact/jsx-runtime";
4313
+ import { jsx as jsx13 } from "preact/jsx-runtime";
4224
4314
  function MarkdownView({ textSig, doneSig }) {
4225
4315
  const ref = useRef4(null);
4226
4316
  useEffect7(() => {
@@ -4270,12 +4360,12 @@ function MarkdownView({ textSig, doneSig }) {
4270
4360
  el.removeEventListener("click", onClick);
4271
4361
  };
4272
4362
  }, [textSig, doneSig]);
4273
- return /* @__PURE__ */ jsx12("div", { ref });
4363
+ return /* @__PURE__ */ jsx13("div", { ref });
4274
4364
  }
4275
4365
  function StaticMarkdown({ text }) {
4276
4366
  const textSig = useMemo(() => signal4(text), [text]);
4277
4367
  const doneSig = useMemo(() => signal4(true), []);
4278
- return /* @__PURE__ */ jsx12(MarkdownView, { textSig, doneSig });
4368
+ return /* @__PURE__ */ jsx13(MarkdownView, { textSig, doneSig });
4279
4369
  }
4280
4370
  function hardenLink(a) {
4281
4371
  const href = a.getAttribute("href") ?? "";
@@ -4289,8 +4379,8 @@ function hardenLink(a) {
4289
4379
 
4290
4380
  // src/ui/tool-approval.tsx
4291
4381
  import { useComputed as useComputed2, useSignal } from "@preact/signals";
4292
- import { Fragment, jsx as jsx13, jsxs as jsxs10 } from "preact/jsx-runtime";
4293
- var p12 = BRAND.cssPrefix;
4382
+ import { Fragment, jsx as jsx14, jsxs as jsxs11 } from "preact/jsx-runtime";
4383
+ var p13 = BRAND.cssPrefix;
4294
4384
  function ToolApproval({ part, strings, active, onDecision }) {
4295
4385
  const approval = useComputed2(() => part.approvalSig.value);
4296
4386
  const input = useComputed2(() => part.inputSig.value);
@@ -4298,24 +4388,24 @@ function ToolApproval({ part, strings, active, onDecision }) {
4298
4388
  const decided = approval.value?.approved !== void 0;
4299
4389
  if (decided) {
4300
4390
  const ap = approval.value;
4301
- return /* @__PURE__ */ jsxs10("div", { class: `${p12}-tool-approval ${p12}-tool-decided`, "data-testid": TID.toolDecision, children: [
4302
- /* @__PURE__ */ jsx13("span", { class: `${p12}-tool-decided-label`, "data-approved": ap?.approved ? "true" : "false", children: ap?.approved ? strings.approved : strings.rejected }),
4303
- /* @__PURE__ */ jsx13("strong", { class: `${p12}-tool-title`, children: part.toolName }),
4304
- ap?.reason ? /* @__PURE__ */ jsx13("span", { class: `${p12}-tool-decided-value`, children: ap.reason }) : null
4391
+ return /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-approval ${p13}-tool-decided`, "data-testid": TID.toolDecision, children: [
4392
+ /* @__PURE__ */ jsx14("span", { class: `${p13}-tool-decided-label`, "data-approved": ap?.approved ? "true" : "false", children: ap?.approved ? strings.approved : strings.rejected }),
4393
+ /* @__PURE__ */ jsx14("strong", { class: `${p13}-tool-title`, children: part.toolName }),
4394
+ ap?.reason ? /* @__PURE__ */ jsx14("span", { class: `${p13}-tool-decided-value`, children: ap.reason }) : null
4305
4395
  ] });
4306
4396
  }
4307
4397
  const args = summarizeInput(input.value);
4308
- return /* @__PURE__ */ jsxs10("div", { class: `${p12}-tool-approval`, "data-testid": TID.toolApproval, children: [
4309
- /* @__PURE__ */ jsxs10("div", { class: `${p12}-tool-head`, children: [
4310
- /* @__PURE__ */ jsx13("span", { class: `${p12}-tool-badge`, children: strings.approvalRequired }),
4311
- /* @__PURE__ */ jsx13("strong", { class: `${p12}-tool-title`, children: part.toolName })
4398
+ return /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-approval`, "data-testid": TID.toolApproval, children: [
4399
+ /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-head`, children: [
4400
+ /* @__PURE__ */ jsx14("span", { class: `${p13}-tool-badge`, children: strings.approvalRequired }),
4401
+ /* @__PURE__ */ jsx14("strong", { class: `${p13}-tool-title`, children: part.toolName })
4312
4402
  ] }),
4313
- args ? /* @__PURE__ */ jsx13("pre", { class: `${p12}-tool-args`, children: args }) : null,
4314
- active ? /* @__PURE__ */ jsxs10(Fragment, { children: [
4315
- /* @__PURE__ */ jsx13(
4403
+ args ? /* @__PURE__ */ jsx14("pre", { class: `${p13}-tool-args`, children: args }) : null,
4404
+ active ? /* @__PURE__ */ jsxs11(Fragment, { children: [
4405
+ /* @__PURE__ */ jsx14(
4316
4406
  "input",
4317
4407
  {
4318
- class: `${p12}-field-input`,
4408
+ class: `${p13}-field-input`,
4319
4409
  value: reason.value,
4320
4410
  placeholder: strings.approvalReason,
4321
4411
  onInput: (e) => {
@@ -4323,29 +4413,29 @@ function ToolApproval({ part, strings, active, onDecision }) {
4323
4413
  }
4324
4414
  }
4325
4415
  ),
4326
- /* @__PURE__ */ jsxs10("div", { class: `${p12}-form-actions`, children: [
4327
- /* @__PURE__ */ jsx13(
4416
+ /* @__PURE__ */ jsxs11("div", { class: `${p13}-form-actions`, children: [
4417
+ /* @__PURE__ */ jsx14(
4328
4418
  "button",
4329
4419
  {
4330
4420
  type: "button",
4331
- class: `${p12}-tool-reject`,
4421
+ class: `${p13}-tool-reject`,
4332
4422
  onClick: () => onDecision(part.toolCallId, false, reason.value.trim() || void 0),
4333
4423
  "data-testid": TID.toolReject,
4334
4424
  children: strings.reject
4335
4425
  }
4336
4426
  ),
4337
- /* @__PURE__ */ jsx13(
4427
+ /* @__PURE__ */ jsx14(
4338
4428
  "button",
4339
4429
  {
4340
4430
  type: "button",
4341
- class: `${p12}-tool-approve`,
4431
+ class: `${p13}-tool-approve`,
4342
4432
  onClick: () => onDecision(part.toolCallId, true, reason.value.trim() || void 0),
4343
4433
  "data-testid": TID.toolApprove,
4344
4434
  children: strings.approve
4345
4435
  }
4346
4436
  )
4347
4437
  ] })
4348
- ] }) : /* @__PURE__ */ jsx13("p", { class: `${p12}-tool-stale-note`, children: strings.stepNoLongerActive })
4438
+ ] }) : /* @__PURE__ */ jsx14("p", { class: `${p13}-tool-stale-note`, children: strings.stepNoLongerActive })
4349
4439
  ] });
4350
4440
  }
4351
4441
  function summarizeInput(input) {
@@ -4416,49 +4506,49 @@ function num(v) {
4416
4506
  }
4417
4507
 
4418
4508
  // src/ui/tool-ask-input.tsx
4419
- import { jsx as jsx14, jsxs as jsxs11 } from "preact/jsx-runtime";
4420
- var p13 = BRAND.cssPrefix;
4509
+ import { jsx as jsx15, jsxs as jsxs12 } from "preact/jsx-runtime";
4510
+ var p14 = BRAND.cssPrefix;
4421
4511
  function ToolAskInput({ part, strings, active, onSubmit }) {
4422
4512
  const state = useComputed3(() => part.stateSig.value);
4423
4513
  const request = useComputed3(() => parseAskUserInput(part.inputSig.value));
4424
4514
  const decided = state.value === "output" || state.value === "error";
4425
4515
  if (decided) {
4426
- return /* @__PURE__ */ jsx14(DecidedSummary, { part, strings });
4516
+ return /* @__PURE__ */ jsx15(DecidedSummary, { part, strings });
4427
4517
  }
4428
4518
  if (!active) {
4429
- return /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-ask-input ${p13}-tool-stale`, "data-testid": TID.toolAskInput, children: [
4430
- /* @__PURE__ */ jsx14(Header, { strings, title: request.value.title ?? request.value.question }),
4431
- /* @__PURE__ */ jsx14("p", { class: `${p13}-tool-stale-note`, children: strings.stepNoLongerActive })
4519
+ return /* @__PURE__ */ jsxs12("div", { class: `${p14}-tool-ask-input ${p14}-tool-stale`, "data-testid": TID.toolAskInput, children: [
4520
+ /* @__PURE__ */ jsx15(Header, { strings, title: request.value.title ?? request.value.question }),
4521
+ /* @__PURE__ */ jsx15("p", { class: `${p14}-tool-stale-note`, children: strings.stepNoLongerActive })
4432
4522
  ] });
4433
4523
  }
4434
4524
  const req = request.value;
4435
4525
  const isConfirmation = req.responseType === "confirmation";
4436
- return /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-ask-input`, "data-testid": TID.toolAskInput, children: [
4437
- /* @__PURE__ */ jsx14(Header, { strings, title: req.title }),
4438
- req.description ? /* @__PURE__ */ jsx14("p", { class: `${p13}-tool-desc`, children: req.description }) : null,
4439
- isConfirmation ? /* @__PURE__ */ jsx14("p", { class: `${p13}-tool-question`, children: req.question }) : null,
4440
- isConfirmation ? /* @__PURE__ */ jsxs11("div", { class: `${p13}-form-actions`, children: [
4441
- /* @__PURE__ */ jsx14(
4526
+ return /* @__PURE__ */ jsxs12("div", { class: `${p14}-tool-ask-input`, "data-testid": TID.toolAskInput, children: [
4527
+ /* @__PURE__ */ jsx15(Header, { strings, title: req.title }),
4528
+ req.description ? /* @__PURE__ */ jsx15("p", { class: `${p14}-tool-desc`, children: req.description }) : null,
4529
+ isConfirmation ? /* @__PURE__ */ jsx15("p", { class: `${p14}-tool-question`, children: req.question }) : null,
4530
+ isConfirmation ? /* @__PURE__ */ jsxs12("div", { class: `${p14}-form-actions`, children: [
4531
+ /* @__PURE__ */ jsx15(
4442
4532
  "button",
4443
4533
  {
4444
4534
  type: "button",
4445
- class: `${p13}-form-skip`,
4535
+ class: `${p14}-form-skip`,
4446
4536
  onClick: () => onSubmit(part.toolCallId, { confirmed: false }),
4447
4537
  "data-testid": TID.toolInputSkip,
4448
4538
  children: strings.reject
4449
4539
  }
4450
4540
  ),
4451
- /* @__PURE__ */ jsx14(
4541
+ /* @__PURE__ */ jsx15(
4452
4542
  "button",
4453
4543
  {
4454
4544
  type: "button",
4455
- class: `${p13}-form-submit`,
4545
+ class: `${p14}-form-submit`,
4456
4546
  onClick: () => onSubmit(part.toolCallId, { confirmed: true }),
4457
4547
  "data-testid": TID.toolInputSubmit,
4458
4548
  children: strings.approve
4459
4549
  }
4460
4550
  )
4461
- ] }) : /* @__PURE__ */ jsx14(
4551
+ ] }) : /* @__PURE__ */ jsx15(
4462
4552
  DynamicForm,
4463
4553
  {
4464
4554
  fields: askInputToFields(req),
@@ -4474,17 +4564,17 @@ function ToolAskInput({ part, strings, active, onSubmit }) {
4474
4564
  ] });
4475
4565
  }
4476
4566
  function Header({ strings, title }) {
4477
- return /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-head`, children: [
4478
- /* @__PURE__ */ jsx14("span", { class: `${p13}-tool-badge`, children: strings.inputRequired }),
4479
- title ? /* @__PURE__ */ jsx14("strong", { class: `${p13}-tool-title`, children: title }) : null
4567
+ return /* @__PURE__ */ jsxs12("div", { class: `${p14}-tool-head`, children: [
4568
+ /* @__PURE__ */ jsx15("span", { class: `${p14}-tool-badge`, children: strings.inputRequired }),
4569
+ title ? /* @__PURE__ */ jsx15("strong", { class: `${p14}-tool-title`, children: title }) : null
4480
4570
  ] });
4481
4571
  }
4482
4572
  function DecidedSummary({ part, strings }) {
4483
4573
  const output = useComputed3(() => part.outputSig.value);
4484
4574
  const text = summarizeOutput(output.value) || strings.inputSubmitted;
4485
- return /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-ask-input ${p13}-tool-decided`, "data-testid": TID.toolDecision, children: [
4486
- /* @__PURE__ */ jsx14("span", { class: `${p13}-tool-decided-label`, children: strings.inputSubmitted }),
4487
- /* @__PURE__ */ jsx14("span", { class: `${p13}-tool-decided-value`, children: text })
4575
+ return /* @__PURE__ */ jsxs12("div", { class: `${p14}-tool-ask-input ${p14}-tool-decided`, "data-testid": TID.toolDecision, children: [
4576
+ /* @__PURE__ */ jsx15("span", { class: `${p14}-tool-decided-label`, children: strings.inputSubmitted }),
4577
+ /* @__PURE__ */ jsx15("span", { class: `${p14}-tool-decided-value`, children: text })
4488
4578
  ] });
4489
4579
  }
4490
4580
  function summarizeOutput(output) {
@@ -4499,21 +4589,21 @@ function summarizeOutput(output) {
4499
4589
  }
4500
4590
 
4501
4591
  // src/ui/tool-chip.tsx
4502
- import { jsx as jsx15, jsxs as jsxs12 } from "preact/jsx-runtime";
4592
+ import { jsx as jsx16, jsxs as jsxs13 } from "preact/jsx-runtime";
4503
4593
  function ToolChip({ part, strings }) {
4504
- const p33 = BRAND.cssPrefix;
4505
- return /* @__PURE__ */ jsxs12("span", { class: `${p33}-tool-chip`, role: "status", children: [
4506
- /* @__PURE__ */ jsxs12("span", { children: [
4594
+ const p34 = BRAND.cssPrefix;
4595
+ return /* @__PURE__ */ jsxs13("span", { class: `${p34}-tool-chip`, role: "status", children: [
4596
+ /* @__PURE__ */ jsxs13("span", { children: [
4507
4597
  strings.usedTool,
4508
4598
  ":"
4509
4599
  ] }),
4510
- /* @__PURE__ */ jsx15("strong", { children: part.toolName })
4600
+ /* @__PURE__ */ jsx16("strong", { children: part.toolName })
4511
4601
  ] });
4512
4602
  }
4513
4603
 
4514
4604
  // src/ui/message-bubble.tsx
4515
- import { jsx as jsx16, jsxs as jsxs13 } from "preact/jsx-runtime";
4516
- var p14 = BRAND.cssPrefix;
4605
+ import { jsx as jsx17, jsxs as jsxs14 } from "preact/jsx-runtime";
4606
+ var p15 = BRAND.cssPrefix;
4517
4607
  function MessageBubble({
4518
4608
  message,
4519
4609
  strings,
@@ -4536,9 +4626,9 @@ function MessageBubble({
4536
4626
  const working = streaming && !hasAnswerText.value;
4537
4627
  const showStreamDots = streaming && !bufferedHold && !(reasoningVisible.value && working);
4538
4628
  const stamp = formatStamp(message.createdAt);
4539
- 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: [
4540
- /* @__PURE__ */ jsxs13("div", { class: `${p14}-bubble`, children: [
4541
- bufferedHold ? /* @__PURE__ */ jsx16(LoadingSpinner, { label: strings.loading }) : partList.map((part) => /* @__PURE__ */ jsx16(
4629
+ 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: [
4630
+ /* @__PURE__ */ jsxs14("div", { class: `${p15}-bubble`, children: [
4631
+ bufferedHold ? /* @__PURE__ */ jsx17(LoadingSpinner, { label: strings.loading }) : partList.map((part) => /* @__PURE__ */ jsx17(
4542
4632
  PartView,
4543
4633
  {
4544
4634
  part,
@@ -4551,10 +4641,10 @@ function MessageBubble({
4551
4641
  },
4552
4642
  partKey(part)
4553
4643
  )),
4554
- showStreamDots && /* @__PURE__ */ jsx16(TypingDots, {}),
4555
- message.status === "error" && message.errorText ? /* @__PURE__ */ jsx16("div", { class: `${p14}-error`, role: "alert", children: /* @__PURE__ */ jsx16("span", { children: message.errorText }) }) : null
4644
+ showStreamDots && /* @__PURE__ */ jsx17(TypingDots, {}),
4645
+ message.status === "error" && message.errorText ? /* @__PURE__ */ jsx17("div", { class: `${p15}-error`, role: "alert", children: /* @__PURE__ */ jsx17("span", { children: message.errorText }) }) : null
4556
4646
  ] }),
4557
- stamp ? /* @__PURE__ */ jsx16("time", { class: `${p14}-bubble-time`, dateTime: stamp.iso, title: stamp.full, children: stamp.short }) : null
4647
+ stamp ? /* @__PURE__ */ jsx17("time", { class: `${p15}-bubble-time`, dateTime: stamp.iso, title: stamp.full, children: stamp.short }) : null
4558
4648
  ] }) });
4559
4649
  }
4560
4650
  function formatStamp(createdAt) {
@@ -4581,11 +4671,11 @@ function PartView({
4581
4671
  }) {
4582
4672
  switch (part.kind) {
4583
4673
  case "text":
4584
- return /* @__PURE__ */ jsx16(MarkdownView, { textSig: part.textSig, doneSig: part.doneSig });
4674
+ return /* @__PURE__ */ jsx17(MarkdownView, { textSig: part.textSig, doneSig: part.doneSig });
4585
4675
  case "reasoning":
4586
- return showReasoning ? /* @__PURE__ */ jsx16(ReasoningView, { part, active, strings }) : null;
4676
+ return showReasoning ? /* @__PURE__ */ jsx17(ReasoningView, { part, active, strings }) : null;
4587
4677
  case "tool":
4588
- return /* @__PURE__ */ jsx16(
4678
+ return /* @__PURE__ */ jsx17(
4589
4679
  ToolPartView,
4590
4680
  {
4591
4681
  part,
@@ -4597,9 +4687,9 @@ function PartView({
4597
4687
  );
4598
4688
  case "file":
4599
4689
  if (part.mediaType.startsWith("image/")) {
4600
- return /* @__PURE__ */ jsx16("img", { src: part.url, alt: "", loading: "lazy" });
4690
+ return /* @__PURE__ */ jsx17("img", { src: part.url, alt: "", loading: "lazy" });
4601
4691
  }
4602
- return /* @__PURE__ */ jsx16("a", { href: part.url, target: "_blank", rel: "noreferrer noopener", children: part.url });
4692
+ return /* @__PURE__ */ jsx17("a", { href: part.url, target: "_blank", rel: "noreferrer noopener", children: part.url });
4603
4693
  case "source":
4604
4694
  return null;
4605
4695
  }
@@ -4615,22 +4705,22 @@ function ToolPartView({
4615
4705
  const hasApproval = useComputed4(() => part.approvalSig.value !== void 0);
4616
4706
  if (tool?.humanInLoop) {
4617
4707
  if (hasApproval.value || state.value === "awaiting-approval") {
4618
- return /* @__PURE__ */ jsx16(ToolApproval, { part, strings, active: interactive, onDecision: tool.onDecision });
4708
+ return /* @__PURE__ */ jsx17(ToolApproval, { part, strings, active: interactive, onDecision: tool.onDecision });
4619
4709
  }
4620
4710
  if (isAskUserInputTool(part.toolName) || state.value === "awaiting-input") {
4621
- return /* @__PURE__ */ jsx16(ToolAskInput, { part, strings, active: interactive, onSubmit: tool.onResult });
4711
+ return /* @__PURE__ */ jsx17(ToolAskInput, { part, strings, active: interactive, onSubmit: tool.onResult });
4622
4712
  }
4623
4713
  }
4624
- return showToolCalls ? /* @__PURE__ */ jsx16(ToolChip, { part, strings }) : null;
4714
+ return showToolCalls ? /* @__PURE__ */ jsx17(ToolChip, { part, strings }) : null;
4625
4715
  }
4626
4716
  function ReasoningView({
4627
4717
  part,
4628
4718
  active,
4629
4719
  strings
4630
4720
  }) {
4631
- return /* @__PURE__ */ jsxs13("details", { class: `${p14}-reasoning`, open: active, "data-active": active ? "true" : void 0, children: [
4632
- /* @__PURE__ */ jsx16("summary", { class: `${p14}-reasoning-summary`, children: /* @__PURE__ */ jsx16("span", { class: `${p14}-reasoning-label`, children: active ? strings.thinking : strings.thoughts }) }),
4633
- /* @__PURE__ */ jsx16("div", { class: `${p14}-reasoning-body`, children: /* @__PURE__ */ jsx16(MarkdownView, { textSig: part.textSig, doneSig: part.doneSig }) })
4721
+ return /* @__PURE__ */ jsxs14("details", { class: `${p15}-reasoning`, open: active, "data-active": active ? "true" : void 0, children: [
4722
+ /* @__PURE__ */ jsx17("summary", { class: `${p15}-reasoning-summary`, children: /* @__PURE__ */ jsx17("span", { class: `${p15}-reasoning-label`, children: active ? strings.thinking : strings.thoughts }) }),
4723
+ /* @__PURE__ */ jsx17("div", { class: `${p15}-reasoning-body`, children: /* @__PURE__ */ jsx17(MarkdownView, { textSig: part.textSig, doneSig: part.doneSig }) })
4634
4724
  ] });
4635
4725
  }
4636
4726
  function partKey(part) {
@@ -4647,22 +4737,22 @@ function partKey(part) {
4647
4737
  }
4648
4738
  }
4649
4739
  function TypingDots() {
4650
- return /* @__PURE__ */ jsxs13("span", { class: `${p14}-typing`, "aria-hidden": "true", children: [
4651
- /* @__PURE__ */ jsx16("span", {}),
4652
- /* @__PURE__ */ jsx16("span", {}),
4653
- /* @__PURE__ */ jsx16("span", {})
4740
+ return /* @__PURE__ */ jsxs14("span", { class: `${p15}-typing`, "aria-hidden": "true", children: [
4741
+ /* @__PURE__ */ jsx17("span", {}),
4742
+ /* @__PURE__ */ jsx17("span", {}),
4743
+ /* @__PURE__ */ jsx17("span", {})
4654
4744
  ] });
4655
4745
  }
4656
4746
  function LoadingSpinner({ label }) {
4657
- return /* @__PURE__ */ jsxs13("span", { class: `${p14}-loading`, role: "status", children: [
4658
- /* @__PURE__ */ jsx16("span", { class: `${p14}-loading-spinner`, "aria-hidden": "true" }),
4659
- /* @__PURE__ */ jsx16("span", { class: `${p14}-loading-label`, children: label })
4747
+ return /* @__PURE__ */ jsxs14("span", { class: `${p15}-loading`, role: "status", children: [
4748
+ /* @__PURE__ */ jsx17("span", { class: `${p15}-loading-spinner`, "aria-hidden": "true" }),
4749
+ /* @__PURE__ */ jsx17("span", { class: `${p15}-loading-label`, children: label })
4660
4750
  ] });
4661
4751
  }
4662
4752
 
4663
4753
  // src/ui/message-list.tsx
4664
- import { jsx as jsx17, jsxs as jsxs14 } from "preact/jsx-runtime";
4665
- var p15 = BRAND.cssPrefix;
4754
+ import { jsx as jsx18, jsxs as jsxs15 } from "preact/jsx-runtime";
4755
+ var p16 = BRAND.cssPrefix;
4666
4756
  var STICK_THRESHOLD = 120;
4667
4757
  var DIVIDER_IDLE_MS = 1200;
4668
4758
  function MessageList({
@@ -4673,7 +4763,10 @@ function MessageList({
4673
4763
  showToolCalls,
4674
4764
  loading,
4675
4765
  idle,
4676
- tool
4766
+ tool,
4767
+ inlineForm,
4768
+ onFormSubmit,
4769
+ onFormSkip
4677
4770
  }) {
4678
4771
  const ref = useRef5(null);
4679
4772
  const messages = useComputed5(() => messagesSig.value);
@@ -4758,12 +4851,12 @@ function MessageList({
4758
4851
  const day = dayKey(m.createdAt);
4759
4852
  if (day && day !== prevDay) {
4760
4853
  rows.push(
4761
- /* @__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}`)
4854
+ /* @__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}`)
4762
4855
  );
4763
4856
  prevDay = day;
4764
4857
  }
4765
4858
  rows.push(
4766
- /* @__PURE__ */ jsx17(
4859
+ /* @__PURE__ */ jsx18(
4767
4860
  MessageBubble,
4768
4861
  {
4769
4862
  message: m,
@@ -4778,32 +4871,33 @@ function MessageList({
4778
4871
  )
4779
4872
  );
4780
4873
  }
4781
- return /* @__PURE__ */ jsxs14("div", { class: `${p15}-list-wrap`, children: [
4782
- /* @__PURE__ */ jsxs14(
4874
+ return /* @__PURE__ */ jsxs15("div", { class: `${p16}-list-wrap`, children: [
4875
+ /* @__PURE__ */ jsxs15(
4783
4876
  "div",
4784
4877
  {
4785
4878
  ref,
4786
- class: `${p15}-list`,
4879
+ class: `${p16}-list`,
4787
4880
  role: "log",
4788
4881
  "aria-live": "polite",
4789
4882
  "aria-relevant": "additions text",
4790
4883
  "data-scrolling": scrolling ? "true" : void 0,
4791
4884
  children: [
4792
- loading && messages.value.length === 0 ? /* @__PURE__ */ jsx17("div", { class: `${p15}-list-loading`, role: "status", children: strings.messagesLoading }) : null,
4793
- rows
4885
+ loading && messages.value.length === 0 ? /* @__PURE__ */ jsx18("div", { class: `${p16}-list-loading`, role: "status", children: strings.messagesLoading }) : null,
4886
+ rows,
4887
+ inlineForm && onFormSubmit && onFormSkip ? /* @__PURE__ */ jsx18(FormCard, { form: inlineForm, strings, onSubmit: onFormSubmit, onSkip: onFormSkip }) : null
4794
4888
  ]
4795
4889
  }
4796
4890
  ),
4797
- showJump ? /* @__PURE__ */ jsx17(
4891
+ showJump ? /* @__PURE__ */ jsx18(
4798
4892
  "button",
4799
4893
  {
4800
4894
  type: "button",
4801
- class: `${p15}-jump`,
4895
+ class: `${p16}-jump`,
4802
4896
  onClick: jumpToBottom,
4803
4897
  "aria-label": strings.scrollToBottom,
4804
4898
  title: strings.scrollToBottom,
4805
4899
  "data-testid": TID.scrollToBottom,
4806
- children: /* @__PURE__ */ jsx17(ChevronDownIcon, {})
4900
+ children: /* @__PURE__ */ jsx18(ChevronDownIcon, {})
4807
4901
  }
4808
4902
  ) : null
4809
4903
  ] });
@@ -4862,7 +4956,7 @@ function startOfDay(ms) {
4862
4956
  }
4863
4957
 
4864
4958
  // src/ui/conversation-list.tsx
4865
- import { Fragment as Fragment2, jsx as jsx18, jsxs as jsxs15 } from "preact/jsx-runtime";
4959
+ import { Fragment as Fragment2, jsx as jsx19, jsxs as jsxs16 } from "preact/jsx-runtime";
4866
4960
  var log11 = logger.scope("history");
4867
4961
  var BUCKET_TO_STRING = {
4868
4962
  today: "dateToday",
@@ -4871,7 +4965,7 @@ var BUCKET_TO_STRING = {
4871
4965
  older: "dateOlder"
4872
4966
  };
4873
4967
  function ConversationList({ transport, strings, visitorId, onSelect, onNewChat }) {
4874
- const p33 = BRAND.cssPrefix;
4968
+ const p34 = BRAND.cssPrefix;
4875
4969
  const [state, setState] = useState7("loading");
4876
4970
  const [sessions, setChats] = useState7([]);
4877
4971
  useEffect9(() => {
@@ -4889,38 +4983,38 @@ function ConversationList({ transport, strings, visitorId, onSelect, onNewChat }
4889
4983
  cancelled = true;
4890
4984
  };
4891
4985
  }, [transport, visitorId]);
4892
- 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: [
4893
- /* @__PURE__ */ jsx18(PlusIcon, {}),
4986
+ 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: [
4987
+ /* @__PURE__ */ jsx19(PlusIcon, {}),
4894
4988
  strings.historyNewChat
4895
4989
  ] }) }) : null;
4896
4990
  if (state === "loading") {
4897
- return /* @__PURE__ */ jsxs15(Fragment2, { children: [
4898
- /* @__PURE__ */ jsx18("div", { class: `${p33}-history-empty`, children: strings.historyLoading }),
4991
+ return /* @__PURE__ */ jsxs16(Fragment2, { children: [
4992
+ /* @__PURE__ */ jsx19("div", { class: `${p34}-history-empty`, children: strings.historyLoading }),
4899
4993
  newChatButton
4900
4994
  ] });
4901
4995
  }
4902
4996
  if (state === "error" || sessions.length === 0) {
4903
- return /* @__PURE__ */ jsxs15(Fragment2, { children: [
4904
- /* @__PURE__ */ jsx18("div", { class: `${p33}-history-empty`, children: strings.historyEmpty }),
4997
+ return /* @__PURE__ */ jsxs16(Fragment2, { children: [
4998
+ /* @__PURE__ */ jsx19("div", { class: `${p34}-history-empty`, children: strings.historyEmpty }),
4905
4999
  newChatButton
4906
5000
  ] });
4907
5001
  }
4908
5002
  const groups = groupByBucket(Date.now(), sessions);
4909
- return /* @__PURE__ */ jsxs15(Fragment2, { children: [
4910
- /* @__PURE__ */ jsx18("div", { class: `${p33}-history`, role: "list", children: groups.map((group) => /* @__PURE__ */ jsxs15("div", { class: `${p33}-history-group`, children: [
4911
- /* @__PURE__ */ jsx18("div", { class: `${p33}-history-heading`, children: strings[BUCKET_TO_STRING[group.bucket]] }),
4912
- group.sessions.map((chat) => /* @__PURE__ */ jsxs15(
5003
+ return /* @__PURE__ */ jsxs16(Fragment2, { children: [
5004
+ /* @__PURE__ */ jsx19("div", { class: `${p34}-history`, role: "list", children: groups.map((group) => /* @__PURE__ */ jsxs16("div", { class: `${p34}-history-group`, children: [
5005
+ /* @__PURE__ */ jsx19("div", { class: `${p34}-history-heading`, children: strings[BUCKET_TO_STRING[group.bucket]] }),
5006
+ group.sessions.map((chat) => /* @__PURE__ */ jsxs16(
4913
5007
  "button",
4914
5008
  {
4915
5009
  type: "button",
4916
5010
  role: "listitem",
4917
- class: `${p33}-history-item`,
5011
+ class: `${p34}-history-item`,
4918
5012
  onClick: () => onSelect(chat),
4919
5013
  "data-closed": chat.canContinue ? void 0 : "true",
4920
5014
  "data-testid": tid(TID.historyItem, chat.sessionId),
4921
5015
  children: [
4922
- /* @__PURE__ */ jsx18("span", { class: `${p33}-history-title`, children: chat.title }),
4923
- chat.preview ? /* @__PURE__ */ jsx18("span", { class: `${p33}-history-preview`, children: chat.preview }) : null
5016
+ /* @__PURE__ */ jsx19("span", { class: `${p34}-history-title`, children: chat.title }),
5017
+ chat.preview ? /* @__PURE__ */ jsx19("span", { class: `${p34}-history-preview`, children: chat.preview }) : null
4924
5018
  ]
4925
5019
  },
4926
5020
  chat.sessionId
@@ -4931,21 +5025,21 @@ function ConversationList({ transport, strings, visitorId, onSelect, onNewChat }
4931
5025
  }
4932
5026
 
4933
5027
  // src/ui/chat-history-pane.tsx
4934
- import { jsx as jsx19 } from "preact/jsx-runtime";
5028
+ import { jsx as jsx20 } from "preact/jsx-runtime";
4935
5029
  function ChatHistoryPane(props2) {
4936
- return /* @__PURE__ */ jsx19(ConversationList, { ...props2 });
5030
+ return /* @__PURE__ */ jsx20(ConversationList, { ...props2 });
4937
5031
  }
4938
5032
 
4939
5033
  // src/ui/suggestions.tsx
4940
- import { jsx as jsx20 } from "preact/jsx-runtime";
4941
- var p16 = BRAND.cssPrefix;
5034
+ import { jsx as jsx21 } from "preact/jsx-runtime";
5035
+ var p17 = BRAND.cssPrefix;
4942
5036
  function Suggestions({ suggestions, onPick }) {
4943
5037
  if (suggestions.length === 0) return null;
4944
- return /* @__PURE__ */ jsx20("div", { class: `${p16}-suggestions`, role: "group", "aria-label": "Suggested replies", children: suggestions.map((s, i) => /* @__PURE__ */ jsx20(
5038
+ return /* @__PURE__ */ jsx21("div", { class: `${p17}-suggestions`, role: "group", "aria-label": "Suggested replies", children: suggestions.map((s, i) => /* @__PURE__ */ jsx21(
4945
5039
  "button",
4946
5040
  {
4947
5041
  type: "button",
4948
- class: `${p16}-suggestion`,
5042
+ class: `${p17}-suggestion`,
4949
5043
  onClick: () => onPick(s),
4950
5044
  "data-testid": tid(TID.suggestion, i),
4951
5045
  children: s.label
@@ -4955,8 +5049,8 @@ function Suggestions({ suggestions, onPick }) {
4955
5049
  }
4956
5050
 
4957
5051
  // src/ui/panel.tsx
4958
- import { Fragment as Fragment3, jsx as jsx21, jsxs as jsxs16 } from "preact/jsx-runtime";
4959
- var p17 = BRAND.cssPrefix;
5052
+ import { Fragment as Fragment3, jsx as jsx22, jsxs as jsxs17 } from "preact/jsx-runtime";
5053
+ var p18 = BRAND.cssPrefix;
4960
5054
  function Panel(props2) {
4961
5055
  const { options, onClose } = props2;
4962
5056
  const s = options.strings;
@@ -4980,18 +5074,18 @@ function Panel(props2) {
4980
5074
  }, []);
4981
5075
  const { visible: dragOver } = useFileDrop({ containerRef, onDrop: onDropItems });
4982
5076
  useDragMove(containerRef.current, options.mode === "modal");
4983
- return /* @__PURE__ */ jsxs16(
5077
+ return /* @__PURE__ */ jsxs17(
4984
5078
  "div",
4985
5079
  {
4986
5080
  ref: containerRef,
4987
- class: `${p17}-panel`,
5081
+ class: `${p18}-panel`,
4988
5082
  role: "dialog",
4989
5083
  "aria-modal": "false",
4990
5084
  "aria-label": s.panelTitle,
4991
5085
  style: { position: "relative" },
4992
5086
  "data-testid": TID.panel,
4993
5087
  children: [
4994
- /* @__PURE__ */ jsx21(
5088
+ /* @__PURE__ */ jsx22(
4995
5089
  PanelContent,
4996
5090
  {
4997
5091
  ...props2,
@@ -5000,7 +5094,7 @@ function Panel(props2) {
5000
5094
  composerAttachApiRef
5001
5095
  }
5002
5096
  ),
5003
- /* @__PURE__ */ jsx21(PoweredByBar, { poweredBy: props2.options.poweredBy })
5097
+ /* @__PURE__ */ jsx22(PoweredByBar, { poweredBy: props2.options.poweredBy })
5004
5098
  ]
5005
5099
  }
5006
5100
  );
@@ -5031,8 +5125,10 @@ function PanelContent(props2) {
5031
5125
  onSend,
5032
5126
  onStop,
5033
5127
  onSuggestion,
5034
- intakePending,
5035
- onIntakeComplete,
5128
+ blockingForm,
5129
+ inlineForm,
5130
+ onFormSubmit,
5131
+ onFormSkip,
5036
5132
  tool,
5037
5133
  containerEl,
5038
5134
  dragOver,
@@ -5040,12 +5136,12 @@ function PanelContent(props2) {
5040
5136
  } = props2;
5041
5137
  const s = options.strings;
5042
5138
  let composerArea;
5043
- if (intakePending) {
5044
- composerArea = /* @__PURE__ */ jsx21(IntakeGate, { intake: options.intake, strings: s, onComplete: onIntakeComplete });
5139
+ if (blockingForm) {
5140
+ composerArea = /* @__PURE__ */ jsx22(FormGate, { form: blockingForm, strings: s, onSubmit: onFormSubmit, onSkip: onFormSkip });
5045
5141
  } else if (canSend) {
5046
- composerArea = /* @__PURE__ */ jsxs16(Fragment3, { children: [
5047
- /* @__PURE__ */ jsx21(Suggestions, { suggestions, onPick: onSuggestion }),
5048
- /* @__PURE__ */ jsx21(
5142
+ composerArea = /* @__PURE__ */ jsxs17(Fragment3, { children: [
5143
+ /* @__PURE__ */ jsx22(Suggestions, { suggestions, onPick: onSuggestion }),
5144
+ /* @__PURE__ */ jsx22(
5049
5145
  Composer,
5050
5146
  {
5051
5147
  options,
@@ -5060,10 +5156,10 @@ function PanelContent(props2) {
5060
5156
  )
5061
5157
  ] });
5062
5158
  } else {
5063
- composerArea = /* @__PURE__ */ jsx21(ReadOnlyBanner, { label: s.chatClosed, ctaLabel: s.startNewConversation, onNewChat: onClear });
5159
+ composerArea = /* @__PURE__ */ jsx22(ReadOnlyBanner, { label: s.chatClosed, ctaLabel: s.startNewConversation, onNewChat: onClear });
5064
5160
  }
5065
- return /* @__PURE__ */ jsxs16(Fragment3, { children: [
5066
- view === "history" ? /* @__PURE__ */ jsx21(
5161
+ return /* @__PURE__ */ jsxs17(Fragment3, { children: [
5162
+ view === "history" ? /* @__PURE__ */ jsx22(
5067
5163
  HistoryHeader,
5068
5164
  {
5069
5165
  strings: s,
@@ -5071,22 +5167,22 @@ function PanelContent(props2) {
5071
5167
  onClose,
5072
5168
  showClose: canShowClose(options.mode, panelSize, options.actions)
5073
5169
  }
5074
- ) : /* @__PURE__ */ jsxs16("header", { class: `${p17}-header`, "data-testid": TID.panelHeader, children: [
5075
- onBack ? /* @__PURE__ */ jsx21(
5170
+ ) : /* @__PURE__ */ jsxs17("header", { class: `${p18}-header`, "data-testid": TID.panelHeader, children: [
5171
+ onBack ? /* @__PURE__ */ jsx22(
5076
5172
  "button",
5077
5173
  {
5078
5174
  type: "button",
5079
- class: `${p17}-icon-btn`,
5175
+ class: `${p18}-icon-btn`,
5080
5176
  onClick: onBack,
5081
5177
  "aria-label": s.moduleBack,
5082
5178
  title: s.moduleBack,
5083
- children: /* @__PURE__ */ jsx21(BackIcon, {})
5179
+ children: /* @__PURE__ */ jsx22(BackIcon, {})
5084
5180
  }
5085
5181
  ) : null,
5086
- agent ? /* @__PURE__ */ jsx21(AgentBadge, { agent }) : /* @__PURE__ */ jsx21("h1", { children: s.panelTitle }),
5087
- /* @__PURE__ */ jsx21(HeaderActions, { panelProps: props2, variant: "chat" })
5182
+ agent ? /* @__PURE__ */ jsx22(AgentBadge, { agent }) : /* @__PURE__ */ jsx22("h1", { children: s.panelTitle }),
5183
+ /* @__PURE__ */ jsx22(HeaderActions, { panelProps: props2, variant: "chat" })
5088
5184
  ] }),
5089
- view === "history" ? /* @__PURE__ */ jsx21(
5185
+ view === "history" ? /* @__PURE__ */ jsx22(
5090
5186
  ChatHistoryPane,
5091
5187
  {
5092
5188
  transport,
@@ -5095,9 +5191,9 @@ function PanelContent(props2) {
5095
5191
  onSelect: (chat) => onSelectHistoryChat(chat.sessionId),
5096
5192
  onNewChat
5097
5193
  }
5098
- ) : /* @__PURE__ */ jsxs16(Fragment3, { children: [
5099
- /* @__PURE__ */ jsx21(DropZone, { visible: dragOver, strings: s }),
5100
- /* @__PURE__ */ jsx21(
5194
+ ) : /* @__PURE__ */ jsxs17(Fragment3, { children: [
5195
+ /* @__PURE__ */ jsx22(DropZone, { visible: dragOver, strings: s }),
5196
+ /* @__PURE__ */ jsx22(
5101
5197
  MessageList,
5102
5198
  {
5103
5199
  messagesSig,
@@ -5107,13 +5203,16 @@ function PanelContent(props2) {
5107
5203
  showToolCalls: options.showToolCalls,
5108
5204
  loading: loadingMessages,
5109
5205
  idle: !isStreaming,
5110
- tool
5206
+ tool,
5207
+ inlineForm,
5208
+ onFormSubmit,
5209
+ onFormSkip
5111
5210
  }
5112
5211
  ),
5113
5212
  composerArea,
5114
- /* @__PURE__ */ jsx21(ComposerFooter, { disclaimer: options.composerDisclaimer })
5213
+ /* @__PURE__ */ jsx22(ComposerFooter, { disclaimer: options.composerDisclaimer })
5115
5214
  ] }),
5116
- options.size.resize?.enabled ? /* @__PURE__ */ jsx21(
5215
+ options.size.resize?.enabled ? /* @__PURE__ */ jsx22(
5117
5216
  ResizeGrip,
5118
5217
  {
5119
5218
  panelEl: containerEl,
@@ -5132,86 +5231,157 @@ function HistoryHeader({
5132
5231
  onClose,
5133
5232
  showClose
5134
5233
  }) {
5135
- return /* @__PURE__ */ jsxs16("header", { class: `${p17}-header`, children: [
5136
- /* @__PURE__ */ jsx21(
5234
+ return /* @__PURE__ */ jsxs17("header", { class: `${p18}-header`, children: [
5235
+ /* @__PURE__ */ jsx22(
5137
5236
  "button",
5138
5237
  {
5139
5238
  type: "button",
5140
- class: `${p17}-icon-btn`,
5239
+ class: `${p18}-icon-btn`,
5141
5240
  onClick: onBack,
5142
5241
  "aria-label": strings.historyBack,
5143
5242
  title: strings.historyBack,
5144
- children: /* @__PURE__ */ jsx21(BackIcon, {})
5243
+ children: /* @__PURE__ */ jsx22(BackIcon, {})
5145
5244
  }
5146
5245
  ),
5147
- /* @__PURE__ */ jsx21("h1", { children: strings.historyTitle }),
5148
- showClose ? /* @__PURE__ */ jsx21(
5246
+ /* @__PURE__ */ jsx22("h1", { children: strings.historyTitle }),
5247
+ showClose ? /* @__PURE__ */ jsx22(
5149
5248
  "button",
5150
5249
  {
5151
5250
  type: "button",
5152
- class: `${p17}-icon-btn`,
5251
+ class: `${p18}-icon-btn`,
5153
5252
  onClick: onClose,
5154
5253
  "aria-label": strings.close,
5155
5254
  title: strings.close,
5156
- children: /* @__PURE__ */ jsx21(CloseIcon, {})
5255
+ children: /* @__PURE__ */ jsx22(CloseIcon, {})
5157
5256
  }
5158
5257
  ) : null
5159
5258
  ] });
5160
5259
  }
5161
5260
  function ReadOnlyBanner({ label, ctaLabel, onNewChat }) {
5162
- return /* @__PURE__ */ jsxs16("div", { class: `${p17}-readonly-banner`, role: "note", children: [
5163
- /* @__PURE__ */ jsx21("span", { class: `${p17}-readonly-label`, children: label }),
5164
- /* @__PURE__ */ jsx21("button", { type: "button", class: `${p17}-readonly-cta`, onClick: onNewChat, children: ctaLabel })
5261
+ return /* @__PURE__ */ jsxs17("div", { class: `${p18}-readonly-banner`, role: "note", children: [
5262
+ /* @__PURE__ */ jsx22("span", { class: `${p18}-readonly-label`, children: label }),
5263
+ /* @__PURE__ */ jsx22("button", { type: "button", class: `${p18}-readonly-cta`, onClick: onNewChat, children: ctaLabel })
5165
5264
  ] });
5166
5265
  }
5167
5266
  function ComposerFooter({ disclaimer }) {
5168
5267
  if (!disclaimer) return null;
5169
- return /* @__PURE__ */ jsx21("div", { class: `${p17}-composer-footer`, children: /* @__PURE__ */ jsx21("div", { class: `${p17}-disclaimer`, children: disclaimer }) });
5268
+ return /* @__PURE__ */ jsx22("div", { class: `${p18}-composer-footer`, children: /* @__PURE__ */ jsx22("div", { class: `${p18}-disclaimer`, children: disclaimer }) });
5170
5269
  }
5171
5270
  function PoweredByBar({ poweredBy }) {
5172
5271
  if (!poweredBy) return null;
5173
- return /* @__PURE__ */ jsx21("div", { class: `${p17}-poweredby-bar`, children: /* @__PURE__ */ jsx21(PoweredBy, { logoUrl: poweredBy.logoUrl, text: poweredBy.text, href: poweredBy.href }) });
5272
+ return /* @__PURE__ */ jsx22("div", { class: `${p18}-poweredby-bar`, children: /* @__PURE__ */ jsx22(PoweredBy, { logoUrl: poweredBy.logoUrl, text: poweredBy.text, href: poweredBy.href }) });
5174
5273
  }
5175
5274
  function PoweredBy({ logoUrl, text, href }) {
5176
- const inner = /* @__PURE__ */ jsxs16(Fragment3, { children: [
5177
- logoUrl ? /* @__PURE__ */ jsx21("img", { class: `${p17}-poweredby-logo`, src: logoUrl, alt: "", loading: "lazy" }) : null,
5178
- text ? /* @__PURE__ */ jsx21("span", { children: text }) : null
5275
+ const inner = /* @__PURE__ */ jsxs17(Fragment3, { children: [
5276
+ logoUrl ? /* @__PURE__ */ jsx22("img", { class: `${p18}-poweredby-logo`, src: logoUrl, alt: "", loading: "lazy" }) : null,
5277
+ text ? /* @__PURE__ */ jsx22("span", { children: text }) : null
5179
5278
  ] });
5180
5279
  if (href) {
5181
- return /* @__PURE__ */ jsx21("a", { class: `${p17}-poweredby`, href, target: "_blank", rel: "noopener noreferrer", children: inner });
5280
+ return /* @__PURE__ */ jsx22("a", { class: `${p18}-poweredby`, href, target: "_blank", rel: "noopener noreferrer", children: inner });
5281
+ }
5282
+ return /* @__PURE__ */ jsx22("span", { class: `${p18}-poweredby`, children: inner });
5283
+ }
5284
+
5285
+ // src/ui/form/form-controller.ts
5286
+ import { signal as signal5 } from "@preact/signals";
5287
+ import { useRef as useRef7 } from "preact/hooks";
5288
+ function useForms(deps) {
5289
+ const depsRef = useRef7(deps);
5290
+ depsRef.current = deps;
5291
+ const ctrlRef = useRef7(null);
5292
+ ctrlRef.current ?? (ctrlRef.current = createController(depsRef));
5293
+ return ctrlRef.current;
5294
+ }
5295
+ function createController(depsRef) {
5296
+ const activeForm = signal5(null);
5297
+ const sessionDone = /* @__PURE__ */ new Set();
5298
+ const isDone = (form) => {
5299
+ if (form.frequency === "always") return false;
5300
+ if (form.frequency === "session") return sessionDone.has(form.id);
5301
+ return form.id in depsRef.current.persistence.loadFormsDone();
5302
+ };
5303
+ const fire = (kind, param) => {
5304
+ if (activeForm.value) return;
5305
+ const d = depsRef.current;
5306
+ if (kind === "manual") {
5307
+ const form = d.forms.list.find((f) => f.id === param);
5308
+ if (form) activeForm.value = { form, trigger: "manual" };
5309
+ return;
5310
+ }
5311
+ for (const form of d.forms.byTrigger[kind] ?? []) {
5312
+ const t = form.triggers.find((tr) => tr.kind === kind);
5313
+ if (!t || !triggerMatches(t, d) || isDone(form) || !whenPasses(form, d)) continue;
5314
+ activeForm.value = { form, trigger: kind };
5315
+ return;
5316
+ }
5317
+ };
5318
+ const finish = (values, skipped) => {
5319
+ const active = activeForm.value;
5320
+ if (!active) return;
5321
+ activeForm.value = null;
5322
+ const { form, trigger } = active;
5323
+ if (form.frequency === "session") sessionDone.add(form.id);
5324
+ else if (form.frequency !== "always") depsRef.current.persistence.saveFormDone(form.id);
5325
+ depsRef.current.onComplete(form, trigger, values, skipped);
5326
+ };
5327
+ return {
5328
+ activeForm,
5329
+ fire,
5330
+ complete: (values) => finish(values, false),
5331
+ skip: () => finish({}, true)
5332
+ };
5333
+ }
5334
+ function triggerMatches(t, d) {
5335
+ if (t.kind === "after-messages") return d.messageCount() >= Number(t.param ?? 0);
5336
+ if (t.kind === "page-area") return d.pageArea() === t.param;
5337
+ return true;
5338
+ }
5339
+ function whenPasses(form, d) {
5340
+ const w = form.when;
5341
+ if (!w) return true;
5342
+ if (w.missingContext?.length) {
5343
+ const ctx = d.userContext() ?? {};
5344
+ if (w.missingContext.some((key) => ctx[key] !== void 0 && ctx[key] !== "")) return false;
5345
+ }
5346
+ if (w.pageArea) {
5347
+ const areas = Array.isArray(w.pageArea) ? w.pageArea : [w.pageArea];
5348
+ if (!areas.includes(d.pageArea() ?? "")) return false;
5182
5349
  }
5183
- return /* @__PURE__ */ jsx21("span", { class: `${p17}-poweredby`, children: inner });
5350
+ const count = d.messageCount();
5351
+ if (w.minMessages != null && count < w.minMessages) return false;
5352
+ if (w.maxMessages != null && count > w.maxMessages) return false;
5353
+ return true;
5184
5354
  }
5185
5355
 
5186
5356
  // src/ui/sidebar.tsx
5187
- import { Fragment as Fragment4, jsx as jsx22, jsxs as jsxs17 } from "preact/jsx-runtime";
5357
+ import { Fragment as Fragment4, jsx as jsx23, jsxs as jsxs18 } from "preact/jsx-runtime";
5188
5358
  function Sidebar(props2) {
5189
- const p33 = BRAND.cssPrefix;
5359
+ const p34 = BRAND.cssPrefix;
5190
5360
  const { site, blocks, strings, collapsed } = props2;
5191
5361
  const navigation = blocks?.navigation ?? [];
5192
5362
  const linkCards = blocks?.linkCards ?? [];
5193
5363
  const toggleLabel = collapsed ? strings.expandSidebar : strings.collapseSidebar;
5194
- return /* @__PURE__ */ jsxs17("aside", { class: `${p33}-sidebar`, "data-collapsed": collapsed ? "true" : "false", "data-testid": TID.sidebar, children: [
5195
- /* @__PURE__ */ jsxs17("div", { class: `${p33}-sidebar-header`, children: [
5196
- /* @__PURE__ */ jsx22(SidebarBrand, { site }),
5197
- /* @__PURE__ */ jsx22(
5364
+ return /* @__PURE__ */ jsxs18("aside", { class: `${p34}-sidebar`, "data-collapsed": collapsed ? "true" : "false", "data-testid": TID.sidebar, children: [
5365
+ /* @__PURE__ */ jsxs18("div", { class: `${p34}-sidebar-header`, children: [
5366
+ /* @__PURE__ */ jsx23(SidebarBrand, { site }),
5367
+ /* @__PURE__ */ jsx23(
5198
5368
  "button",
5199
5369
  {
5200
5370
  type: "button",
5201
- class: `${p33}-sidebar-toggle`,
5371
+ class: `${p34}-sidebar-toggle`,
5202
5372
  "aria-label": toggleLabel,
5203
5373
  "aria-expanded": collapsed ? "false" : "true",
5204
5374
  title: toggleLabel,
5205
5375
  onClick: props2.onToggleCollapsed,
5206
5376
  "data-testid": TID.sidebarToggle,
5207
- children: /* @__PURE__ */ jsx22(SidebarToggleIcon, { collapsed })
5377
+ children: /* @__PURE__ */ jsx23(SidebarToggleIcon, { collapsed })
5208
5378
  }
5209
5379
  )
5210
5380
  ] }),
5211
- collapsed ? null : /* @__PURE__ */ jsxs17(Fragment4, { children: [
5212
- navigation.length > 0 ? /* @__PURE__ */ jsx22("nav", { class: `${p33}-sidebar-section`, "data-section": "navigation", children: /* @__PURE__ */ jsx22(SidebarNav, { items: navigation }) }) : null,
5213
- linkCards.length > 0 ? /* @__PURE__ */ jsx22("div", { class: `${p33}-sidebar-section`, "data-section": "link-cards", children: /* @__PURE__ */ jsx22(SidebarCards, { items: linkCards }) }) : null,
5214
- props2.showConversations ? /* @__PURE__ */ jsx22("div", { class: `${p33}-sidebar-conversations`, children: /* @__PURE__ */ jsx22(
5381
+ collapsed ? null : /* @__PURE__ */ jsxs18(Fragment4, { children: [
5382
+ navigation.length > 0 ? /* @__PURE__ */ jsx23("nav", { class: `${p34}-sidebar-section`, "data-section": "navigation", children: /* @__PURE__ */ jsx23(SidebarNav, { items: navigation }) }) : null,
5383
+ linkCards.length > 0 ? /* @__PURE__ */ jsx23("div", { class: `${p34}-sidebar-section`, "data-section": "link-cards", children: /* @__PURE__ */ jsx23(SidebarCards, { items: linkCards }) }) : null,
5384
+ props2.showConversations ? /* @__PURE__ */ jsx23("div", { class: `${p34}-sidebar-conversations`, children: /* @__PURE__ */ jsx23(
5215
5385
  ConversationList,
5216
5386
  {
5217
5387
  transport: props2.transport,
@@ -5225,18 +5395,18 @@ function Sidebar(props2) {
5225
5395
  ] });
5226
5396
  }
5227
5397
  function SidebarBrand({ site }) {
5228
- const p33 = BRAND.cssPrefix;
5398
+ const p34 = BRAND.cssPrefix;
5229
5399
  if (site?.logo?.url) {
5230
5400
  const alt = site.logo.alt ?? site.title ?? "Logo";
5231
- return /* @__PURE__ */ jsxs17("picture", { children: [
5232
- site.logoDark?.url ? /* @__PURE__ */ jsx22("source", { srcset: site.logoDark.url, media: "(prefers-color-scheme: dark)" }) : null,
5233
- /* @__PURE__ */ jsx22("img", { class: `${p33}-sidebar-logo`, src: site.logo.url, alt })
5401
+ return /* @__PURE__ */ jsxs18("picture", { children: [
5402
+ site.logoDark?.url ? /* @__PURE__ */ jsx23("source", { srcset: site.logoDark.url, media: "(prefers-color-scheme: dark)" }) : null,
5403
+ /* @__PURE__ */ jsx23("img", { class: `${p34}-sidebar-logo`, src: site.logo.url, alt })
5234
5404
  ] });
5235
5405
  }
5236
- return /* @__PURE__ */ jsx22("div", { class: `${p33}-sidebar-title`, children: site?.title ?? BRAND.name });
5406
+ return /* @__PURE__ */ jsx23("div", { class: `${p34}-sidebar-title`, children: site?.title ?? BRAND.name });
5237
5407
  }
5238
5408
  function SidebarToggleIcon({ collapsed }) {
5239
- return /* @__PURE__ */ jsx22(
5409
+ return /* @__PURE__ */ jsx23(
5240
5410
  "svg",
5241
5411
  {
5242
5412
  width: "16",
@@ -5246,38 +5416,38 @@ function SidebarToggleIcon({ collapsed }) {
5246
5416
  stroke: "currentColor",
5247
5417
  "stroke-width": "2",
5248
5418
  "aria-hidden": "true",
5249
- children: collapsed ? /* @__PURE__ */ jsx22("polyline", { points: "9 6 15 12 9 18" }) : /* @__PURE__ */ jsx22("polyline", { points: "15 6 9 12 15 18" })
5419
+ children: collapsed ? /* @__PURE__ */ jsx23("polyline", { points: "9 6 15 12 9 18" }) : /* @__PURE__ */ jsx23("polyline", { points: "15 6 9 12 15 18" })
5250
5420
  }
5251
5421
  );
5252
5422
  }
5253
5423
  function SidebarNav({ items }) {
5254
- const p33 = BRAND.cssPrefix;
5255
- return /* @__PURE__ */ jsx22("ul", { class: `${p33}-sidebar-nav`, children: items.map((item) => /* @__PURE__ */ jsx22("li", { children: /* @__PURE__ */ jsxs17(
5424
+ const p34 = BRAND.cssPrefix;
5425
+ return /* @__PURE__ */ jsx23("ul", { class: `${p34}-sidebar-nav`, children: items.map((item) => /* @__PURE__ */ jsx23("li", { children: /* @__PURE__ */ jsxs18(
5256
5426
  "a",
5257
5427
  {
5258
- class: `${p33}-sidebar-nav-item`,
5428
+ class: `${p34}-sidebar-nav-item`,
5259
5429
  href: item.href,
5260
5430
  target: item.href ? "_blank" : void 0,
5261
5431
  rel: item.href ? "noreferrer" : void 0,
5262
5432
  children: [
5263
- item.icon ? /* @__PURE__ */ jsx22("span", { class: `${p33}-sidebar-nav-icon`, "data-icon": item.icon }) : null,
5264
- /* @__PURE__ */ jsx22("span", { class: `${p33}-sidebar-nav-label`, children: item.label })
5433
+ item.icon ? /* @__PURE__ */ jsx23("span", { class: `${p34}-sidebar-nav-icon`, "data-icon": item.icon }) : null,
5434
+ /* @__PURE__ */ jsx23("span", { class: `${p34}-sidebar-nav-label`, children: item.label })
5265
5435
  ]
5266
5436
  }
5267
5437
  ) }, item.id ?? item.label)) });
5268
5438
  }
5269
5439
  function SidebarCards({ items }) {
5270
- const p33 = BRAND.cssPrefix;
5271
- return /* @__PURE__ */ jsx22("div", { class: `${p33}-sidebar-cards`, children: items.map((item) => /* @__PURE__ */ jsxs17(
5440
+ const p34 = BRAND.cssPrefix;
5441
+ return /* @__PURE__ */ jsx23("div", { class: `${p34}-sidebar-cards`, children: items.map((item) => /* @__PURE__ */ jsxs18(
5272
5442
  "a",
5273
5443
  {
5274
- class: `${p33}-sidebar-card`,
5444
+ class: `${p34}-sidebar-card`,
5275
5445
  href: item.href,
5276
5446
  target: item.href ? "_blank" : void 0,
5277
5447
  rel: item.href ? "noreferrer" : void 0,
5278
5448
  children: [
5279
- /* @__PURE__ */ jsx22("div", { class: `${p33}-sidebar-card-label`, children: item.label }),
5280
- item.description ? /* @__PURE__ */ jsx22("div", { class: `${p33}-sidebar-card-desc`, children: item.description }) : null
5449
+ /* @__PURE__ */ jsx23("div", { class: `${p34}-sidebar-card-label`, children: item.label }),
5450
+ item.description ? /* @__PURE__ */ jsx23("div", { class: `${p34}-sidebar-card-desc`, children: item.description }) : null
5281
5451
  ]
5282
5452
  },
5283
5453
  item.id ?? item.label
@@ -5285,11 +5455,11 @@ function SidebarCards({ items }) {
5285
5455
  }
5286
5456
 
5287
5457
  // src/ui/page-shell.tsx
5288
- import { jsx as jsx23, jsxs as jsxs18 } from "preact/jsx-runtime";
5289
- var p18 = BRAND.cssPrefix;
5458
+ import { jsx as jsx24, jsxs as jsxs19 } from "preact/jsx-runtime";
5459
+ var p19 = BRAND.cssPrefix;
5290
5460
  function PageShell(props2) {
5291
- return /* @__PURE__ */ jsxs18("main", { class: `${p18}-page-shell`, "data-sidebar-collapsed": props2.sidebarCollapsed ? "true" : "false", children: [
5292
- /* @__PURE__ */ jsx23(
5461
+ return /* @__PURE__ */ jsxs19("main", { class: `${p19}-page-shell`, "data-sidebar-collapsed": props2.sidebarCollapsed ? "true" : "false", children: [
5462
+ /* @__PURE__ */ jsx24(
5293
5463
  Sidebar,
5294
5464
  {
5295
5465
  site: props2.site,
@@ -5304,15 +5474,15 @@ function PageShell(props2) {
5304
5474
  onToggleCollapsed: props2.onToggleSidebarCollapsed
5305
5475
  }
5306
5476
  ),
5307
- /* @__PURE__ */ jsx23("section", { class: `${p18}-page-chat`, "aria-label": "Chat", children: props2.children })
5477
+ /* @__PURE__ */ jsx24("section", { class: `${p19}-page-chat`, "aria-label": "Chat", children: props2.children })
5308
5478
  ] });
5309
5479
  }
5310
5480
 
5311
5481
  // src/ui/home-nav.ts
5312
- import { signal as signal5 } from "@preact/signals";
5482
+ import { signal as signal6 } from "@preact/signals";
5313
5483
  var emptyStacks = (tabs) => Object.fromEntries(tabs.map((t) => [t, []]));
5314
5484
  function createHomeNav(initialTab, tabs, onSwitch) {
5315
- const sig = signal5({ activeTab: initialTab, stacks: emptyStacks(tabs) });
5485
+ const sig = signal6({ activeTab: initialTab, stacks: emptyStacks(tabs) });
5316
5486
  return {
5317
5487
  sig,
5318
5488
  switchTab(tab) {
@@ -5341,7 +5511,7 @@ var topScreen = (s) => activeStack(s).at(-1);
5341
5511
  var atTabRoot = (s) => activeStack(s).length === 0;
5342
5512
 
5343
5513
  // src/ui/messenger-home.tsx
5344
- import { useCallback as useCallback4, useEffect as useEffect15, useRef as useRef7 } from "preact/hooks";
5514
+ import { useCallback as useCallback4, useEffect as useEffect15, useRef as useRef8 } from "preact/hooks";
5345
5515
  import { useComputed as useComputed6 } from "@preact/signals";
5346
5516
 
5347
5517
  // src/ui/modules/messages.tsx
@@ -5354,80 +5524,80 @@ var chatLayout = {
5354
5524
  import { useEffect as useEffect11, useMemo as useMemo2, useState as useState8 } from "preact/hooks";
5355
5525
 
5356
5526
  // src/ui/back-header.tsx
5357
- import { jsx as jsx24, jsxs as jsxs19 } from "preact/jsx-runtime";
5358
- var p19 = BRAND.cssPrefix;
5527
+ import { jsx as jsx25, jsxs as jsxs20 } from "preact/jsx-runtime";
5528
+ var p20 = BRAND.cssPrefix;
5359
5529
  function TitleBar({ title, actions }) {
5360
- return /* @__PURE__ */ jsxs19("header", { class: `${p19}-back-header`, "data-variant": "title", children: [
5361
- /* @__PURE__ */ jsx24("span", { class: `${p19}-back-spacer`, "aria-hidden": "true" }),
5362
- /* @__PURE__ */ jsx24("h1", { class: `${p19}-back-title`, children: title }),
5363
- actions ?? /* @__PURE__ */ jsx24("span", { class: `${p19}-back-spacer`, "aria-hidden": "true" })
5530
+ return /* @__PURE__ */ jsxs20("header", { class: `${p20}-back-header`, "data-variant": "title", children: [
5531
+ /* @__PURE__ */ jsx25("span", { class: `${p20}-back-spacer`, "aria-hidden": "true" }),
5532
+ /* @__PURE__ */ jsx25("h1", { class: `${p20}-back-title`, children: title }),
5533
+ actions ?? /* @__PURE__ */ jsx25("span", { class: `${p20}-back-spacer`, "aria-hidden": "true" })
5364
5534
  ] });
5365
5535
  }
5366
5536
  function BackHeader({ title, backLabel, onBack, actions, testid }) {
5367
- return /* @__PURE__ */ jsxs19("header", { class: `${p19}-back-header`, "data-testid": testid, children: [
5368
- /* @__PURE__ */ jsx24("button", { type: "button", class: `${p19}-icon-btn`, onClick: onBack, "aria-label": backLabel, title: backLabel, children: /* @__PURE__ */ jsx24(BackIcon, {}) }),
5369
- /* @__PURE__ */ jsx24("h1", { class: `${p19}-back-title`, children: title }),
5370
- actions ?? /* @__PURE__ */ jsx24("span", { class: `${p19}-back-spacer`, "aria-hidden": "true" })
5537
+ return /* @__PURE__ */ jsxs20("header", { class: `${p20}-back-header`, "data-testid": testid, children: [
5538
+ /* @__PURE__ */ jsx25("button", { type: "button", class: `${p20}-icon-btn`, onClick: onBack, "aria-label": backLabel, title: backLabel, children: /* @__PURE__ */ jsx25(BackIcon, {}) }),
5539
+ /* @__PURE__ */ jsx25("h1", { class: `${p20}-back-title`, children: title }),
5540
+ actions ?? /* @__PURE__ */ jsx25("span", { class: `${p20}-back-spacer`, "aria-hidden": "true" })
5371
5541
  ] });
5372
5542
  }
5373
5543
 
5374
5544
  // src/ui/home-search.tsx
5375
- import { jsx as jsx25, jsxs as jsxs20 } from "preact/jsx-runtime";
5376
- var p20 = BRAND.cssPrefix;
5545
+ import { jsx as jsx26, jsxs as jsxs21 } from "preact/jsx-runtime";
5546
+ var p21 = BRAND.cssPrefix;
5377
5547
  function HomeSearchButton({ placeholder, onActivate }) {
5378
- return /* @__PURE__ */ jsxs20("button", { type: "button", class: `${p20}-home-search`, onClick: onActivate, "data-testid": TID.homeSearch, children: [
5379
- /* @__PURE__ */ jsx25("span", { class: `${p20}-home-search-text`, children: placeholder }),
5380
- /* @__PURE__ */ jsx25("span", { class: `${p20}-home-search-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx25(SearchIcon, {}) })
5548
+ return /* @__PURE__ */ jsxs21("button", { type: "button", class: `${p21}-home-search`, onClick: onActivate, "data-testid": TID.homeSearch, children: [
5549
+ /* @__PURE__ */ jsx26("span", { class: `${p21}-home-search-text`, children: placeholder }),
5550
+ /* @__PURE__ */ jsx26("span", { class: `${p21}-home-search-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx26(SearchIcon, {}) })
5381
5551
  ] });
5382
5552
  }
5383
5553
  function HelpSearchInput({ placeholder, value, onInput }) {
5384
- return /* @__PURE__ */ jsxs20("div", { class: `${p20}-home-search`, "data-input": "true", children: [
5385
- /* @__PURE__ */ jsx25(
5554
+ return /* @__PURE__ */ jsxs21("div", { class: `${p21}-home-search`, "data-input": "true", children: [
5555
+ /* @__PURE__ */ jsx26(
5386
5556
  "input",
5387
5557
  {
5388
5558
  type: "search",
5389
- class: `${p20}-home-search-input`,
5559
+ class: `${p21}-home-search-input`,
5390
5560
  placeholder,
5391
5561
  value,
5392
5562
  onInput: (e) => onInput(e.currentTarget.value),
5393
5563
  "data-testid": TID.helpSearch
5394
5564
  }
5395
5565
  ),
5396
- /* @__PURE__ */ jsx25("span", { class: `${p20}-home-search-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx25(SearchIcon, {}) })
5566
+ /* @__PURE__ */ jsx26("span", { class: `${p21}-home-search-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx26(SearchIcon, {}) })
5397
5567
  ] });
5398
5568
  }
5399
5569
 
5400
5570
  // src/ui/list-row.tsx
5401
- import { jsx as jsx26, jsxs as jsxs21 } from "preact/jsx-runtime";
5402
- var p21 = BRAND.cssPrefix;
5571
+ import { jsx as jsx27, jsxs as jsxs22 } from "preact/jsx-runtime";
5572
+ var p22 = BRAND.cssPrefix;
5403
5573
  function ListRow({ title, subtitle, onClick, testid }) {
5404
- return /* @__PURE__ */ jsxs21("button", { type: "button", class: `${p21}-list-row`, onClick, "data-testid": testid, children: [
5405
- /* @__PURE__ */ jsxs21("span", { class: `${p21}-list-row-body`, children: [
5406
- /* @__PURE__ */ jsx26("span", { class: `${p21}-list-row-title`, children: title }),
5407
- subtitle ? /* @__PURE__ */ jsx26("span", { class: `${p21}-list-row-sub`, children: subtitle }) : null
5574
+ return /* @__PURE__ */ jsxs22("button", { type: "button", class: `${p22}-list-row`, onClick, "data-testid": testid, children: [
5575
+ /* @__PURE__ */ jsxs22("span", { class: `${p22}-list-row-body`, children: [
5576
+ /* @__PURE__ */ jsx27("span", { class: `${p22}-list-row-title`, children: title }),
5577
+ subtitle ? /* @__PURE__ */ jsx27("span", { class: `${p22}-list-row-sub`, children: subtitle }) : null
5408
5578
  ] }),
5409
- /* @__PURE__ */ jsx26("span", { class: `${p21}-list-row-chevron`, "aria-hidden": "true", children: /* @__PURE__ */ jsx26(ChevronRightIcon, {}) })
5579
+ /* @__PURE__ */ jsx27("span", { class: `${p22}-list-row-chevron`, "aria-hidden": "true", children: /* @__PURE__ */ jsx27(ChevronRightIcon, {}) })
5410
5580
  ] });
5411
5581
  }
5412
5582
 
5413
5583
  // src/ui/module-state.tsx
5414
- import { jsx as jsx27, jsxs as jsxs22 } from "preact/jsx-runtime";
5415
- var p22 = BRAND.cssPrefix;
5584
+ import { jsx as jsx28, jsxs as jsxs23 } from "preact/jsx-runtime";
5585
+ var p23 = BRAND.cssPrefix;
5416
5586
  function ModuleState({
5417
5587
  tone = "info",
5418
5588
  message,
5419
5589
  onRetry,
5420
5590
  strings
5421
5591
  }) {
5422
- return /* @__PURE__ */ jsxs22("div", { class: `${p22}-module-empty`, role: tone === "error" ? "alert" : "status", "aria-live": "polite", children: [
5423
- /* @__PURE__ */ jsx27("span", { children: message }),
5424
- onRetry ? /* @__PURE__ */ jsx27("button", { type: "button", class: `${p22}-module-retry`, onClick: onRetry, children: strings.errorRetry }) : null
5592
+ return /* @__PURE__ */ jsxs23("div", { class: `${p23}-module-empty`, role: tone === "error" ? "alert" : "status", "aria-live": "polite", children: [
5593
+ /* @__PURE__ */ jsx28("span", { children: message }),
5594
+ onRetry ? /* @__PURE__ */ jsx28("button", { type: "button", class: `${p23}-module-retry`, onClick: onRetry, children: strings.errorRetry }) : null
5425
5595
  ] });
5426
5596
  }
5427
5597
 
5428
5598
  // src/ui/modules/help.tsx
5429
- import { jsx as jsx28, jsxs as jsxs23 } from "preact/jsx-runtime";
5430
- var p23 = BRAND.cssPrefix;
5599
+ import { jsx as jsx29, jsxs as jsxs24 } from "preact/jsx-runtime";
5600
+ var p24 = BRAND.cssPrefix;
5431
5601
  var log12 = logger.scope("help");
5432
5602
  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 });
5433
5603
  function groupByCategory(items) {
@@ -5456,7 +5626,7 @@ function fuzzySearch(items, query) {
5456
5626
  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);
5457
5627
  }
5458
5628
  function ArticleRow({ article, nav }) {
5459
- return /* @__PURE__ */ jsx28(
5629
+ return /* @__PURE__ */ jsx29(
5460
5630
  ListRow,
5461
5631
  {
5462
5632
  title: article.title,
@@ -5493,46 +5663,46 @@ function HelpRoot({ transport, strings, config, nav, panelProps }) {
5493
5663
  const results = useMemo2(() => fuzzySearch(items, query), [items, query]);
5494
5664
  function renderBody() {
5495
5665
  if (query.trim().length > 0) {
5496
- if (results.length === 0) return /* @__PURE__ */ jsx28(ModuleState, { message: strings.helpSearchEmpty, strings });
5497
- return /* @__PURE__ */ jsx28("div", { class: `${p23}-help-card`, children: results.map((a) => /* @__PURE__ */ jsx28(ArticleRow, { article: a, nav }, a.id)) });
5666
+ if (results.length === 0) return /* @__PURE__ */ jsx29(ModuleState, { message: strings.helpSearchEmpty, strings });
5667
+ return /* @__PURE__ */ jsx29("div", { class: `${p24}-help-card`, children: results.map((a) => /* @__PURE__ */ jsx29(ArticleRow, { article: a, nav }, a.id)) });
5498
5668
  }
5499
- if (state === "loading") return /* @__PURE__ */ jsx28(ModuleState, { message: strings.helpLoading, strings });
5669
+ if (state === "loading") return /* @__PURE__ */ jsx29(ModuleState, { message: strings.helpLoading, strings });
5500
5670
  if (state === "error") {
5501
- return /* @__PURE__ */ jsx28(ModuleState, { tone: "error", message: errorMsg, onRetry: () => setReloadKey((k) => k + 1), strings });
5671
+ return /* @__PURE__ */ jsx29(ModuleState, { tone: "error", message: errorMsg, onRetry: () => setReloadKey((k) => k + 1), strings });
5502
5672
  }
5503
- if (items.length === 0) return /* @__PURE__ */ jsx28(ModuleState, { message: strings.helpEmpty, strings });
5504
- return groupByCategory(items).map(([category, rows]) => /* @__PURE__ */ jsxs23("section", { class: `${p23}-help-group`, children: [
5505
- category ? /* @__PURE__ */ jsx28("h2", { class: `${p23}-help-section-title`, children: category }) : null,
5506
- /* @__PURE__ */ jsx28("div", { class: `${p23}-help-card`, children: rows.map((a) => /* @__PURE__ */ jsx28(ArticleRow, { article: a, nav }, a.id)) })
5673
+ if (items.length === 0) return /* @__PURE__ */ jsx29(ModuleState, { message: strings.helpEmpty, strings });
5674
+ return groupByCategory(items).map(([category, rows]) => /* @__PURE__ */ jsxs24("section", { class: `${p24}-help-group`, children: [
5675
+ category ? /* @__PURE__ */ jsx29("h2", { class: `${p24}-help-section-title`, children: category }) : null,
5676
+ /* @__PURE__ */ jsx29("div", { class: `${p24}-help-card`, children: rows.map((a) => /* @__PURE__ */ jsx29(ArticleRow, { article: a, nav }, a.id)) })
5507
5677
  ] }, category));
5508
5678
  }
5509
- return /* @__PURE__ */ jsxs23("div", { class: `${p23}-module`, children: [
5510
- /* @__PURE__ */ jsx28(TitleBar, { title: strings.helpTitle, actions: /* @__PURE__ */ jsx28(HeaderActions, { panelProps, variant: "plain" }) }),
5511
- /* @__PURE__ */ jsx28("div", { class: `${p23}-module-pad`, children: /* @__PURE__ */ jsx28(HelpSearchInput, { placeholder: strings.helpSearchPlaceholder, value: query, onInput: setQuery }) }),
5512
- /* @__PURE__ */ jsx28("div", { class: `${p23}-help-list`, children: renderBody() })
5679
+ return /* @__PURE__ */ jsxs24("div", { class: `${p24}-module`, children: [
5680
+ /* @__PURE__ */ jsx29(TitleBar, { title: strings.helpTitle, actions: /* @__PURE__ */ jsx29(HeaderActions, { panelProps, variant: "plain" }) }),
5681
+ /* @__PURE__ */ jsx29("div", { class: `${p24}-module-pad`, children: /* @__PURE__ */ jsx29(HelpSearchInput, { placeholder: strings.helpSearchPlaceholder, value: query, onInput: setQuery }) }),
5682
+ /* @__PURE__ */ jsx29("div", { class: `${p24}-help-list`, children: renderBody() })
5513
5683
  ] });
5514
5684
  }
5515
5685
  var helpLayout = {
5516
5686
  Icon: HelpIcon,
5517
- Root: (props2) => /* @__PURE__ */ jsx28(HelpRoot, { ...props2 })
5687
+ Root: (props2) => /* @__PURE__ */ jsx29(HelpRoot, { ...props2 })
5518
5688
  };
5519
5689
 
5520
5690
  // src/ui/modules/home.tsx
5521
5691
  import { useEffect as useEffect12, useState as useState9 } from "preact/hooks";
5522
5692
 
5523
5693
  // src/ui/home-card.tsx
5524
- import { jsx as jsx29 } from "preact/jsx-runtime";
5525
- var p24 = BRAND.cssPrefix;
5694
+ import { jsx as jsx30 } from "preact/jsx-runtime";
5695
+ var p25 = BRAND.cssPrefix;
5526
5696
  function HomeCard({ onClick, children, testid }) {
5527
5697
  if (onClick) {
5528
- return /* @__PURE__ */ jsx29("button", { type: "button", class: `${p24}-home-card`, "data-interactive": "true", onClick, "data-testid": testid, children });
5698
+ return /* @__PURE__ */ jsx30("button", { type: "button", class: `${p25}-home-card`, "data-interactive": "true", onClick, "data-testid": testid, children });
5529
5699
  }
5530
- return /* @__PURE__ */ jsx29("div", { class: `${p24}-home-card`, "data-testid": testid, children });
5700
+ return /* @__PURE__ */ jsx30("div", { class: `${p25}-home-card`, "data-testid": testid, children });
5531
5701
  }
5532
5702
 
5533
5703
  // src/ui/modules/home.tsx
5534
- import { Fragment as Fragment5, jsx as jsx30, jsxs as jsxs24 } from "preact/jsx-runtime";
5535
- var p25 = BRAND.cssPrefix;
5704
+ import { Fragment as Fragment5, jsx as jsx31, jsxs as jsxs25 } from "preact/jsx-runtime";
5705
+ var p26 = BRAND.cssPrefix;
5536
5706
  var log13 = logger.scope("home");
5537
5707
  function resolveGreeting(props2) {
5538
5708
  const name = props2.options.userContext?.name;
@@ -5569,49 +5739,49 @@ function HomeRoot(props2) {
5569
5739
  const avatars = config.userAvatars ?? [];
5570
5740
  const status = config.status;
5571
5741
  const contentTitle = config.contentBlockTitle ? moduleLabel(strings, config.contentBlockTitle) : strings.homeContentTitle;
5572
- return /* @__PURE__ */ jsx30("div", { class: `${p25}-module ${p25}-home`, "data-testid": TID.homeView, children: /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-scroll`, children: [
5573
- /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-hero`, children: [
5574
- /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-hero-top`, children: [
5575
- 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" }),
5576
- /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-hero-actions`, children: [
5577
- 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,
5578
- /* @__PURE__ */ jsx30(HeaderActions, { panelProps, variant: "plain" })
5742
+ return /* @__PURE__ */ jsx31("div", { class: `${p26}-module ${p26}-home`, "data-testid": TID.homeView, children: /* @__PURE__ */ jsxs25("div", { class: `${p26}-home-scroll`, children: [
5743
+ /* @__PURE__ */ jsxs25("div", { class: `${p26}-home-hero`, children: [
5744
+ /* @__PURE__ */ jsxs25("div", { class: `${p26}-home-hero-top`, children: [
5745
+ 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" }),
5746
+ /* @__PURE__ */ jsxs25("div", { class: `${p26}-home-hero-actions`, children: [
5747
+ 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,
5748
+ /* @__PURE__ */ jsx31(HeaderActions, { panelProps, variant: "plain" })
5579
5749
  ] })
5580
5750
  ] }),
5581
- config.showGreeting !== false ? /* @__PURE__ */ jsxs24(Fragment5, { children: [
5582
- /* @__PURE__ */ jsx30("h1", { class: `${p25}-home-greeting`, "data-testid": TID.homeGreeting, children: greeting.title }),
5583
- greeting.subtitle ? /* @__PURE__ */ jsx30("p", { class: `${p25}-home-lead`, children: greeting.subtitle }) : null
5751
+ config.showGreeting !== false ? /* @__PURE__ */ jsxs25(Fragment5, { children: [
5752
+ /* @__PURE__ */ jsx31("h1", { class: `${p26}-home-greeting`, "data-testid": TID.homeGreeting, children: greeting.title }),
5753
+ greeting.subtitle ? /* @__PURE__ */ jsx31("p", { class: `${p26}-home-lead`, children: greeting.subtitle }) : null
5584
5754
  ] }) : null
5585
5755
  ] }),
5586
- /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-cards`, children: [
5587
- config.showSearchBar !== false ? /* @__PURE__ */ jsx30(
5756
+ /* @__PURE__ */ jsxs25("div", { class: `${p26}-home-cards`, children: [
5757
+ config.showSearchBar !== false ? /* @__PURE__ */ jsx31(
5588
5758
  HomeSearchButton,
5589
5759
  {
5590
5760
  placeholder: strings.homeSearchPlaceholder,
5591
5761
  onActivate: () => nav.switchToLayout("help")
5592
5762
  }
5593
5763
  ) : null,
5594
- 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: [
5595
- /* @__PURE__ */ jsx30("span", { class: `${p25}-home-recent-avatar`, "aria-hidden": "true", children: /* @__PURE__ */ jsx30(BubblesIcon, {}) }),
5596
- /* @__PURE__ */ jsxs24("span", { class: `${p25}-home-recent-body`, children: [
5597
- /* @__PURE__ */ jsx30("span", { class: `${p25}-home-recent-title`, children: recent.title }),
5598
- recent.preview ? /* @__PURE__ */ jsx30("span", { class: `${p25}-home-recent-preview`, children: recent.preview }) : null
5764
+ 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: [
5765
+ /* @__PURE__ */ jsx31("span", { class: `${p26}-home-recent-avatar`, "aria-hidden": "true", children: /* @__PURE__ */ jsx31(BubblesIcon, {}) }),
5766
+ /* @__PURE__ */ jsxs25("span", { class: `${p26}-home-recent-body`, children: [
5767
+ /* @__PURE__ */ jsx31("span", { class: `${p26}-home-recent-title`, children: recent.title }),
5768
+ recent.preview ? /* @__PURE__ */ jsx31("span", { class: `${p26}-home-recent-preview`, children: recent.preview }) : null
5599
5769
  ] }),
5600
- (recent.unreadCount ?? 0) > 0 ? /* @__PURE__ */ jsx30("span", { class: `${p25}-home-recent-dot`, "aria-label": "Unread" }) : null
5770
+ (recent.unreadCount ?? 0) > 0 ? /* @__PURE__ */ jsx31("span", { class: `${p26}-home-recent-dot`, "aria-label": "Unread" }) : null
5601
5771
  ] }) }) : null,
5602
- status ? /* @__PURE__ */ jsx30(
5772
+ status ? /* @__PURE__ */ jsx31(
5603
5773
  HomeCard,
5604
5774
  {
5605
5775
  onClick: status.url ? () => nav.push({ kind: "iframe", url: status.url, title: status.text }) : void 0,
5606
- children: /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-status`, "data-level": status.level ?? "operational", children: [
5607
- /* @__PURE__ */ jsx30("span", { class: `${p25}-home-status-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx30(StatusOkIcon, {}) }),
5608
- /* @__PURE__ */ jsx30("span", { class: `${p25}-home-status-text`, children: status.text })
5776
+ children: /* @__PURE__ */ jsxs25("div", { class: `${p26}-home-status`, "data-level": status.level ?? "operational", children: [
5777
+ /* @__PURE__ */ jsx31("span", { class: `${p26}-home-status-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx31(StatusOkIcon, {}) }),
5778
+ /* @__PURE__ */ jsx31("span", { class: `${p26}-home-status-text`, children: status.text })
5609
5779
  ] })
5610
5780
  }
5611
5781
  ) : null,
5612
- content.length > 0 ? /* @__PURE__ */ jsxs24("section", { class: `${p25}-home-content`, children: [
5613
- /* @__PURE__ */ jsx30("div", { class: `${p25}-home-content-title`, children: contentTitle }),
5614
- /* @__PURE__ */ jsx30("div", { class: `${p25}-home-content-list`, children: content.map((item) => /* @__PURE__ */ jsx30(
5782
+ content.length > 0 ? /* @__PURE__ */ jsxs25("section", { class: `${p26}-home-content`, children: [
5783
+ /* @__PURE__ */ jsx31("div", { class: `${p26}-home-content-title`, children: contentTitle }),
5784
+ /* @__PURE__ */ jsx31("div", { class: `${p26}-home-content-list`, children: content.map((item) => /* @__PURE__ */ jsx31(
5615
5785
  ListRow,
5616
5786
  {
5617
5787
  title: item.title,
@@ -5627,13 +5797,13 @@ function HomeRoot(props2) {
5627
5797
  }
5628
5798
  var homeLayout = {
5629
5799
  Icon: HomeIcon,
5630
- Root: (props2) => /* @__PURE__ */ jsx30(HomeRoot, { ...props2 })
5800
+ Root: (props2) => /* @__PURE__ */ jsx31(HomeRoot, { ...props2 })
5631
5801
  };
5632
5802
 
5633
5803
  // src/ui/modules/news.tsx
5634
5804
  import { useEffect as useEffect13, useState as useState10 } from "preact/hooks";
5635
- import { jsx as jsx31, jsxs as jsxs25 } from "preact/jsx-runtime";
5636
- var p26 = BRAND.cssPrefix;
5805
+ import { jsx as jsx32, jsxs as jsxs26 } from "preact/jsx-runtime";
5806
+ var p27 = BRAND.cssPrefix;
5637
5807
  var log14 = logger.scope("news");
5638
5808
  function NewsRoot({ transport, strings, config, nav, panelProps }) {
5639
5809
  const tags = config.contentTags;
@@ -5659,38 +5829,38 @@ function NewsRoot({ transport, strings, config, nav, panelProps }) {
5659
5829
  };
5660
5830
  }, [transport, tags, reloadKey]);
5661
5831
  function renderBody() {
5662
- if (state === "loading") return /* @__PURE__ */ jsx31(ModuleState, { message: strings.newsLoading, strings });
5832
+ if (state === "loading") return /* @__PURE__ */ jsx32(ModuleState, { message: strings.newsLoading, strings });
5663
5833
  if (state === "error") {
5664
- return /* @__PURE__ */ jsx31(ModuleState, { tone: "error", message: errorMsg, onRetry: () => setReloadKey((k) => k + 1), strings });
5834
+ return /* @__PURE__ */ jsx32(ModuleState, { tone: "error", message: errorMsg, onRetry: () => setReloadKey((k) => k + 1), strings });
5665
5835
  }
5666
- if (items.length === 0) return /* @__PURE__ */ jsx31(ModuleState, { message: strings.newsEmpty, strings });
5667
- return /* @__PURE__ */ jsx31("div", { class: `${p26}-news-list`, children: items.map((item) => /* @__PURE__ */ jsxs25(
5836
+ if (items.length === 0) return /* @__PURE__ */ jsx32(ModuleState, { message: strings.newsEmpty, strings });
5837
+ return /* @__PURE__ */ jsx32("div", { class: `${p27}-news-list`, children: items.map((item) => /* @__PURE__ */ jsxs26(
5668
5838
  "button",
5669
5839
  {
5670
5840
  type: "button",
5671
- class: `${p26}-news-card`,
5841
+ class: `${p27}-news-card`,
5672
5842
  onClick: () => nav.push({ kind: "content", id: item.id, title: item.title }),
5673
5843
  "data-testid": tid(TID.newsItem, item.id),
5674
5844
  children: [
5675
- item.image ? /* @__PURE__ */ jsx31("img", { class: `${p26}-news-hero`, src: item.image, alt: "", loading: "lazy" }) : null,
5676
- /* @__PURE__ */ jsxs25("span", { class: `${p26}-news-body`, children: [
5677
- 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,
5678
- /* @__PURE__ */ jsx31("span", { class: `${p26}-news-title`, children: item.title }),
5679
- item.description ? /* @__PURE__ */ jsx31("span", { class: `${p26}-news-summary`, children: item.description }) : null
5845
+ item.image ? /* @__PURE__ */ jsx32("img", { class: `${p27}-news-hero`, src: item.image, alt: "", loading: "lazy" }) : null,
5846
+ /* @__PURE__ */ jsxs26("span", { class: `${p27}-news-body`, children: [
5847
+ 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,
5848
+ /* @__PURE__ */ jsx32("span", { class: `${p27}-news-title`, children: item.title }),
5849
+ item.description ? /* @__PURE__ */ jsx32("span", { class: `${p27}-news-summary`, children: item.description }) : null
5680
5850
  ] })
5681
5851
  ]
5682
5852
  },
5683
5853
  item.id
5684
5854
  )) });
5685
5855
  }
5686
- return /* @__PURE__ */ jsxs25("div", { class: `${p26}-module`, children: [
5687
- /* @__PURE__ */ jsx31(TitleBar, { title: strings.newsTitle, actions: /* @__PURE__ */ jsx31(HeaderActions, { panelProps, variant: "plain" }) }),
5688
- /* @__PURE__ */ jsx31("div", { class: `${p26}-module-scroll`, children: renderBody() })
5856
+ return /* @__PURE__ */ jsxs26("div", { class: `${p27}-module`, children: [
5857
+ /* @__PURE__ */ jsx32(TitleBar, { title: strings.newsTitle, actions: /* @__PURE__ */ jsx32(HeaderActions, { panelProps, variant: "plain" }) }),
5858
+ /* @__PURE__ */ jsx32("div", { class: `${p27}-module-scroll`, children: renderBody() })
5689
5859
  ] });
5690
5860
  }
5691
5861
  var newsLayout = {
5692
5862
  Icon: NewsIcon,
5693
- Root: (props2) => /* @__PURE__ */ jsx31(NewsRoot, { ...props2 })
5863
+ Root: (props2) => /* @__PURE__ */ jsx32(NewsRoot, { ...props2 })
5694
5864
  };
5695
5865
 
5696
5866
  // src/ui/modules/registry.ts
@@ -5702,28 +5872,28 @@ var LAYOUTS = {
5702
5872
  };
5703
5873
 
5704
5874
  // src/ui/home-tab-bar.tsx
5705
- import { jsx as jsx32, jsxs as jsxs26 } from "preact/jsx-runtime";
5706
- var p27 = BRAND.cssPrefix;
5875
+ import { jsx as jsx33, jsxs as jsxs27 } from "preact/jsx-runtime";
5876
+ var p28 = BRAND.cssPrefix;
5707
5877
  function HomeTabBar({ modules, activeTab, strings, unreadCount, onSelect }) {
5708
- return /* @__PURE__ */ jsx32("nav", { class: `${p27}-tabbar`, role: "tablist", "aria-label": strings.panelTitle, children: modules.map((m) => {
5878
+ return /* @__PURE__ */ jsx33("nav", { class: `${p28}-tabbar`, role: "tablist", "aria-label": strings.panelTitle, children: modules.map((m) => {
5709
5879
  const Icon = LAYOUTS[m.layout].Icon;
5710
5880
  const selected = m.id === activeTab;
5711
5881
  const badge = m.layout === "chat" && unreadCount > 0 ? unreadCount > 9 ? "9+" : String(unreadCount) : null;
5712
- return /* @__PURE__ */ jsxs26(
5882
+ return /* @__PURE__ */ jsxs27(
5713
5883
  "button",
5714
5884
  {
5715
5885
  type: "button",
5716
5886
  role: "tab",
5717
5887
  "aria-selected": selected,
5718
- class: `${p27}-tab`,
5888
+ class: `${p28}-tab`,
5719
5889
  onClick: () => onSelect(m.id),
5720
5890
  "data-testid": tid(TID.tab, m.id),
5721
5891
  children: [
5722
- /* @__PURE__ */ jsxs26("span", { class: `${p27}-tab-icon`, "aria-hidden": "true", children: [
5723
- /* @__PURE__ */ jsx32(Icon, {}),
5724
- badge ? /* @__PURE__ */ jsx32("span", { class: `${p27}-tab-badge`, "data-testid": TID.tabBadge, children: badge }) : null
5892
+ /* @__PURE__ */ jsxs27("span", { class: `${p28}-tab-icon`, "aria-hidden": "true", children: [
5893
+ /* @__PURE__ */ jsx33(Icon, {}),
5894
+ badge ? /* @__PURE__ */ jsx33("span", { class: `${p28}-tab-badge`, "data-testid": TID.tabBadge, children: badge }) : null
5725
5895
  ] }),
5726
- /* @__PURE__ */ jsx32("span", { class: `${p27}-tab-label`, children: moduleLabel(strings, m.label) })
5896
+ /* @__PURE__ */ jsx33("span", { class: `${p28}-tab-label`, children: moduleLabel(strings, m.label) })
5727
5897
  ]
5728
5898
  },
5729
5899
  m.id
@@ -5732,12 +5902,12 @@ function HomeTabBar({ modules, activeTab, strings, unreadCount, onSelect }) {
5732
5902
  }
5733
5903
 
5734
5904
  // src/ui/iframe-view.tsx
5735
- import { jsx as jsx33, jsxs as jsxs27 } from "preact/jsx-runtime";
5736
- var p28 = BRAND.cssPrefix;
5905
+ import { jsx as jsx34, jsxs as jsxs28 } from "preact/jsx-runtime";
5906
+ var p29 = BRAND.cssPrefix;
5737
5907
  var SANDBOX = "allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";
5738
5908
  function IframeView({ url, title, strings, onBack, actions }) {
5739
- return /* @__PURE__ */ jsxs27("div", { class: `${p28}-module`, children: [
5740
- /* @__PURE__ */ jsx33(
5909
+ return /* @__PURE__ */ jsxs28("div", { class: `${p29}-module`, children: [
5910
+ /* @__PURE__ */ jsx34(
5741
5911
  BackHeader,
5742
5912
  {
5743
5913
  title: title || strings.moduleBack,
@@ -5746,10 +5916,10 @@ function IframeView({ url, title, strings, onBack, actions }) {
5746
5916
  actions
5747
5917
  }
5748
5918
  ),
5749
- /* @__PURE__ */ jsx33(
5919
+ /* @__PURE__ */ jsx34(
5750
5920
  "iframe",
5751
5921
  {
5752
- class: `${p28}-content-frame`,
5922
+ class: `${p29}-content-frame`,
5753
5923
  src: url,
5754
5924
  title: title || "content",
5755
5925
  sandbox: SANDBOX,
@@ -5763,8 +5933,8 @@ function IframeView({ url, title, strings, onBack, actions }) {
5763
5933
 
5764
5934
  // src/ui/content-view.tsx
5765
5935
  import { useCallback as useCallback3, useEffect as useEffect14, useState as useState11 } from "preact/hooks";
5766
- import { jsx as jsx34, jsxs as jsxs28 } from "preact/jsx-runtime";
5767
- var p29 = BRAND.cssPrefix;
5936
+ import { jsx as jsx35, jsxs as jsxs29 } from "preact/jsx-runtime";
5937
+ var p30 = BRAND.cssPrefix;
5768
5938
  var log15 = logger.scope("content");
5769
5939
  function ContentView({ id, title, transport, strings, onBack, actions }) {
5770
5940
  const [item, setItem] = useState11(null);
@@ -5792,17 +5962,17 @@ function ContentView({ id, title, transport, strings, onBack, actions }) {
5792
5962
  };
5793
5963
  }, [transport, id, reloadKey]);
5794
5964
  function renderBody() {
5795
- if (failed) return /* @__PURE__ */ jsx34(ModuleState, { tone: "error", message: strings.errorGeneric, onRetry: retry, strings });
5796
- if (item === null) return /* @__PURE__ */ jsx34(ModuleState, { message: strings.contentLoading, strings });
5797
- return /* @__PURE__ */ jsxs28("article", { class: `${p29}-content`, "data-testid": TID.contentView, children: [
5798
- item.image ? /* @__PURE__ */ jsx34("img", { class: `${p29}-content-hero`, src: item.image, alt: "", loading: "lazy" }) : null,
5799
- item.description ? /* @__PURE__ */ jsx34("p", { class: `${p29}-content-subtitle`, children: item.description }) : null,
5800
- 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,
5801
- /* @__PURE__ */ jsx34(StaticMarkdown, { text: item.content ?? "" })
5965
+ if (failed) return /* @__PURE__ */ jsx35(ModuleState, { tone: "error", message: strings.errorGeneric, onRetry: retry, strings });
5966
+ if (item === null) return /* @__PURE__ */ jsx35(ModuleState, { message: strings.contentLoading, strings });
5967
+ return /* @__PURE__ */ jsxs29("article", { class: `${p30}-content`, "data-testid": TID.contentView, children: [
5968
+ item.image ? /* @__PURE__ */ jsx35("img", { class: `${p30}-content-hero`, src: item.image, alt: "", loading: "lazy" }) : null,
5969
+ item.description ? /* @__PURE__ */ jsx35("p", { class: `${p30}-content-subtitle`, children: item.description }) : null,
5970
+ 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,
5971
+ /* @__PURE__ */ jsx35(StaticMarkdown, { text: item.content ?? "" })
5802
5972
  ] });
5803
5973
  }
5804
- return /* @__PURE__ */ jsxs28("div", { class: `${p29}-module`, children: [
5805
- /* @__PURE__ */ jsx34(
5974
+ return /* @__PURE__ */ jsxs29("div", { class: `${p30}-module`, children: [
5975
+ /* @__PURE__ */ jsx35(
5806
5976
  BackHeader,
5807
5977
  {
5808
5978
  title: item?.title || title || strings.moduleBack,
@@ -5812,13 +5982,13 @@ function ContentView({ id, title, transport, strings, onBack, actions }) {
5812
5982
  testid: TID.backHeader
5813
5983
  }
5814
5984
  ),
5815
- /* @__PURE__ */ jsx34("div", { class: `${p29}-module-scroll`, "data-testid": TID.contentScroll, children: renderBody() })
5985
+ /* @__PURE__ */ jsx35("div", { class: `${p30}-module-scroll`, "data-testid": TID.contentScroll, children: renderBody() })
5816
5986
  ] });
5817
5987
  }
5818
5988
 
5819
5989
  // src/ui/messenger-home.tsx
5820
- import { jsx as jsx35, jsxs as jsxs29 } from "preact/jsx-runtime";
5821
- var p30 = BRAND.cssPrefix;
5990
+ import { jsx as jsx36, jsxs as jsxs30 } from "preact/jsx-runtime";
5991
+ var p31 = BRAND.cssPrefix;
5822
5992
  function MessengerHome({
5823
5993
  panelProps,
5824
5994
  enabledModules,
@@ -5830,7 +6000,7 @@ function MessengerHome({
5830
6000
  }) {
5831
6001
  const options = panelProps.options;
5832
6002
  const strings = options.strings;
5833
- const containerRef = useRef7(null);
6003
+ const containerRef = useRef8(null);
5834
6004
  useEffect15(() => {
5835
6005
  const el = containerRef.current;
5836
6006
  if (!el) return;
@@ -5844,7 +6014,7 @@ function MessengerHome({
5844
6014
  el.removeEventListener("keydown", onKey);
5845
6015
  };
5846
6016
  }, [panelProps.onClose]);
5847
- const composerAttachApiRef = useRef7(null);
6017
+ const composerAttachApiRef = useRef8(null);
5848
6018
  const onDropItems = useCallback4((items) => {
5849
6019
  composerAttachApiRef.current?.attachFromDrop(items);
5850
6020
  }, []);
@@ -5855,7 +6025,7 @@ function MessengerHome({
5855
6025
  const activeModule = options.modules.byId[navState.activeTab];
5856
6026
  const isReader = top?.kind === "iframe" || top?.kind === "content";
5857
6027
  const showTabBar = enabledModules.length > 1 && (atTabRoot(navState) || !isReader);
5858
- const savedSize = useRef7(null);
6028
+ const savedSize = useRef8(null);
5859
6029
  useEffect15(() => {
5860
6030
  if (isReader && savedSize.current === null) {
5861
6031
  savedSize.current = panelProps.panelSize;
@@ -5886,12 +6056,12 @@ function MessengerHome({
5886
6056
  nav: moduleNav,
5887
6057
  panelProps
5888
6058
  });
5889
- const plainActions = /* @__PURE__ */ jsx35(HeaderActions, { panelProps, variant: "plain" });
6059
+ const plainActions = /* @__PURE__ */ jsx36(HeaderActions, { panelProps, variant: "plain" });
5890
6060
  let body;
5891
6061
  if (top?.kind === "iframe") {
5892
- body = /* @__PURE__ */ jsx35(IframeView, { url: top.url, title: top.title, strings, onBack: nav.pop, actions: plainActions });
6062
+ body = /* @__PURE__ */ jsx36(IframeView, { url: top.url, title: top.title, strings, onBack: nav.pop, actions: plainActions });
5893
6063
  } else if (top?.kind === "content") {
5894
- body = /* @__PURE__ */ jsx35(
6064
+ body = /* @__PURE__ */ jsx36(
5895
6065
  ContentView,
5896
6066
  {
5897
6067
  id: top.id,
@@ -5903,7 +6073,7 @@ function MessengerHome({
5903
6073
  }
5904
6074
  );
5905
6075
  } else if (activeModule?.layout === "chat") {
5906
- body = /* @__PURE__ */ jsx35(
6076
+ body = /* @__PURE__ */ jsx36(
5907
6077
  PanelContent,
5908
6078
  {
5909
6079
  ...panelProps,
@@ -5914,23 +6084,23 @@ function MessengerHome({
5914
6084
  );
5915
6085
  } else if (activeModule) {
5916
6086
  const Root = LAYOUTS[activeModule.layout].Root;
5917
- body = Root ? /* @__PURE__ */ jsx35(Root, { ...screenProps(activeModule) }, activeModule.id) : null;
6087
+ body = Root ? /* @__PURE__ */ jsx36(Root, { ...screenProps(activeModule) }, activeModule.id) : null;
5918
6088
  } else {
5919
6089
  body = null;
5920
6090
  }
5921
- return /* @__PURE__ */ jsxs29(
6091
+ return /* @__PURE__ */ jsxs30(
5922
6092
  "div",
5923
6093
  {
5924
6094
  ref: containerRef,
5925
- class: `${p30}-panel ${p30}-messenger`,
6095
+ class: `${p31}-panel ${p31}-messenger`,
5926
6096
  role: "dialog",
5927
6097
  "aria-modal": "false",
5928
6098
  "aria-label": strings.panelTitle,
5929
6099
  style: { position: "relative" },
5930
6100
  "data-testid": TID.messengerHome,
5931
6101
  children: [
5932
- /* @__PURE__ */ jsx35("div", { class: `${p30}-messenger-body`, children: body }),
5933
- showTabBar ? /* @__PURE__ */ jsx35(
6102
+ /* @__PURE__ */ jsx36("div", { class: `${p31}-messenger-body`, children: body }),
6103
+ showTabBar ? /* @__PURE__ */ jsx36(
5934
6104
  HomeTabBar,
5935
6105
  {
5936
6106
  modules: enabledModules,
@@ -5940,8 +6110,8 @@ function MessengerHome({
5940
6110
  onSelect: nav.switchTab
5941
6111
  }
5942
6112
  ) : null,
5943
- /* @__PURE__ */ jsx35(PoweredByBar, { poweredBy: options.poweredBy }),
5944
- options.size.resize?.enabled && !(activeModule?.layout === "chat" && !top) ? /* @__PURE__ */ jsx35(
6113
+ /* @__PURE__ */ jsx36(PoweredByBar, { poweredBy: options.poweredBy }),
6114
+ options.size.resize?.enabled && !(activeModule?.layout === "chat" && !top) ? /* @__PURE__ */ jsx36(
5945
6115
  ResizeGrip,
5946
6116
  {
5947
6117
  panelEl: containerRef.current,
@@ -5958,29 +6128,29 @@ function MessengerHome({
5958
6128
  }
5959
6129
 
5960
6130
  // src/ui/modules-empty.tsx
5961
- import { jsx as jsx36, jsxs as jsxs30 } from "preact/jsx-runtime";
5962
- var p31 = BRAND.cssPrefix;
6131
+ import { jsx as jsx37, jsxs as jsxs31 } from "preact/jsx-runtime";
6132
+ var p32 = BRAND.cssPrefix;
5963
6133
  function ModulesEmpty({ strings, onClose }) {
5964
- return /* @__PURE__ */ jsxs30(
6134
+ return /* @__PURE__ */ jsxs31(
5965
6135
  "div",
5966
6136
  {
5967
- class: `${p31}-panel ${p31}-modules-empty`,
6137
+ class: `${p32}-panel ${p32}-modules-empty`,
5968
6138
  role: "dialog",
5969
6139
  "aria-label": strings.panelTitle,
5970
6140
  "data-testid": TID.modulesEmpty,
5971
6141
  children: [
5972
- onClose ? /* @__PURE__ */ jsx36(
6142
+ onClose ? /* @__PURE__ */ jsx37(
5973
6143
  "button",
5974
6144
  {
5975
6145
  type: "button",
5976
- class: `${p31}-icon-btn ${p31}-modules-empty-close`,
6146
+ class: `${p32}-icon-btn ${p32}-modules-empty-close`,
5977
6147
  onClick: onClose,
5978
6148
  "aria-label": strings.close,
5979
6149
  title: strings.close,
5980
- children: /* @__PURE__ */ jsx36(CloseIcon, {})
6150
+ children: /* @__PURE__ */ jsx37(CloseIcon, {})
5981
6151
  }
5982
6152
  ) : null,
5983
- /* @__PURE__ */ jsx36("p", { class: `${p31}-modules-empty-text`, children: strings.modulesEmpty })
6153
+ /* @__PURE__ */ jsx37("p", { class: `${p32}-modules-empty-text`, children: strings.modulesEmpty })
5984
6154
  ]
5985
6155
  }
5986
6156
  );
@@ -6051,9 +6221,9 @@ function useLauncherCallout({ callout, persistence }) {
6051
6221
  }
6052
6222
 
6053
6223
  // src/ui/app.tsx
6054
- import { jsx as jsx37, jsxs as jsxs31 } from "preact/jsx-runtime";
6224
+ import { jsx as jsx38, jsxs as jsxs32 } from "preact/jsx-runtime";
6055
6225
  var log16 = logger.scope("app");
6056
- var p32 = BRAND.cssPrefix;
6226
+ var p33 = BRAND.cssPrefix;
6057
6227
  function App({ options, hostElement, bus }) {
6058
6228
  const [persistence] = useState13(() => createPersistence(options.widgetId, options.storage));
6059
6229
  const [visitorId, setVisitorId] = useState13(() => persistence.getVisitorId());
@@ -6076,21 +6246,21 @@ function App({ options, hostElement, bus }) {
6076
6246
  function chatTabId() {
6077
6247
  return options.modules.list.find((m) => m.layout === "chat")?.id;
6078
6248
  }
6079
- const homeNavRef = useRef8();
6249
+ const homeNavRef = useRef9();
6080
6250
  if (!homeNavRef.current) {
6081
6251
  const ids = options.modules.list.map((m) => m.id);
6082
6252
  homeNavRef.current = createHomeNav(landingTab(), ids, (tab) => persistence.saveActiveModule(tab));
6083
6253
  }
6084
6254
  const homeNav = homeNavRef.current;
6085
- const chatTabIdRef = useRef8(void 0);
6255
+ const chatTabIdRef = useRef9(void 0);
6086
6256
  chatTabIdRef.current = chatTabId();
6087
6257
  const [sessionReady, setSessionReady] = useState13(false);
6088
6258
  const isInlineLike = options.mode === "standalone" || options.mode === "inline";
6089
- const initialPanelRef = useRef8(
6259
+ const initialPanelRef = useRef9(
6090
6260
  resolveInitialPanelState(options, currentViewportWidth(), persistence.loadPanelOpen(), persistence.loadPanelSize())
6091
6261
  );
6092
6262
  const [isOpen, setIsOpen] = useState13(initialPanelRef.current.panelOpen);
6093
- const initialPanelApplied = useRef8(false);
6263
+ const initialPanelApplied = useRef9(false);
6094
6264
  const [launcherLeaving, setLauncherLeaving] = useState13(false);
6095
6265
  const { dismissed: calloutDismissed, dismissCallout: dismissCalloutRaw } = useLauncherCallout({
6096
6266
  callout: options.launcher.callout,
@@ -6103,18 +6273,18 @@ function App({ options, hostElement, bus }) {
6103
6273
  dismissCalloutRaw();
6104
6274
  }, [bus, dismissCalloutRaw]);
6105
6275
  const [panelSize, setPanelSize] = useState13(initialPanelRef.current.panelSize);
6106
- const initialSizeApplied = useRef8(false);
6276
+ const initialSizeApplied = useRef9(false);
6107
6277
  const [view, setView] = useState13("chat");
6108
6278
  const [canSend, setCanSend] = useState13(true);
6109
6279
  const [streaming, setStreaming] = useState13(false);
6110
6280
  const [agent, setAgent] = useState13(null);
6111
6281
  const [suggestions, setSuggestions] = useState13([]);
6112
6282
  const [activeCancel, setActiveCancel] = useState13(null);
6113
- const welcomeAbortRef = useRef8(null);
6283
+ const welcomeAbortRef = useRef9(null);
6114
6284
  const [parsedSite, setParsedSite] = useState13(void 0);
6115
6285
  const [parsedBlocks, setParsedBlocks] = useState13(void 0);
6116
6286
  const [sidebarCollapsed, setSidebarCollapsed] = useState13(() => persistence.loadSidebarCollapsed() ?? false);
6117
- const [intakeValues, setIntakeValues] = useState13(() => persistence.loadIntake());
6287
+ const [formContext, setFormContext] = useState13({});
6118
6288
  const [transport] = useState13(
6119
6289
  () => new AgentTransport({
6120
6290
  baseUrl: options.baseUrl,
@@ -6175,9 +6345,9 @@ function App({ options, hostElement, bus }) {
6175
6345
  setIsOpen(state.panelOpen);
6176
6346
  setPanelSize(state.panelSize);
6177
6347
  }, [sessionReady, options, persistence]);
6178
- const homeNavSeeded = useRef8(false);
6179
- const resumeActiveRef = useRef8(false);
6180
- const resumeBubbleRef = useRef8(null);
6348
+ const homeNavSeeded = useRef9(false);
6349
+ const resumeActiveRef = useRef9(false);
6350
+ const resumeBubbleRef = useRef9(null);
6181
6351
  useEffect17(() => {
6182
6352
  if (!sessionReady || homeNavSeeded.current) return;
6183
6353
  homeNavSeeded.current = true;
@@ -6205,7 +6375,7 @@ function App({ options, hostElement, bus }) {
6205
6375
  },
6206
6376
  [messagesSig, options.welcome]
6207
6377
  );
6208
- const connectGenRef = useRef8(0);
6378
+ const connectGenRef = useRef9(0);
6209
6379
  const runStartSession = useCallback6(
6210
6380
  async ({ newConversation }) => {
6211
6381
  const myGen = ++connectGenRef.current;
@@ -6297,11 +6467,11 @@ function App({ options, hostElement, bus }) {
6297
6467
  );
6298
6468
  const userSig = JSON.stringify(options.userContext ?? null);
6299
6469
  const pageSig = JSON.stringify(options.pageContext ?? null);
6300
- const intakeSig = JSON.stringify(intakeValues ?? null);
6470
+ const formCtxSig = JSON.stringify(formContext);
6301
6471
  useEffect17(() => {
6302
- const merged = intakeValues ? { ...intakeValues, ...options.userContext } : options.userContext;
6472
+ const merged = Object.keys(formContext).length ? { ...formContext, ...options.userContext } : options.userContext;
6303
6473
  transport.setContext(merged, toWirePageContext(options.pageContext));
6304
- }, [transport, userSig, pageSig, intakeSig]);
6474
+ }, [transport, userSig, pageSig, formCtxSig]);
6305
6475
  const runResume = useCallback6(
6306
6476
  async (handle) => {
6307
6477
  let bubble = null;
@@ -6360,7 +6530,7 @@ function App({ options, hostElement, bus }) {
6360
6530
  resume?.cancel();
6361
6531
  };
6362
6532
  }, []);
6363
- const lastUserSig = useRef8(userSig);
6533
+ const lastUserSig = useRef9(userSig);
6364
6534
  useEffect17(() => {
6365
6535
  if (!sessionReady || lastUserSig.current === userSig) return;
6366
6536
  lastUserSig.current = userSig;
@@ -6483,25 +6653,48 @@ function App({ options, hostElement, bus }) {
6483
6653
  () => ({ humanInLoop: options.features.humanInLoop, onResult: handleToolResult, onDecision: handleToolDecision }),
6484
6654
  [options.features.humanInLoop, handleToolResult, handleToolDecision]
6485
6655
  );
6486
- const intakePending = options.intake.enabled && intakeValues === null;
6487
- const handleIntakeComplete = useCallback6(
6488
- (values) => {
6489
- const hasValues = Object.keys(values).length > 0;
6490
- log16.info("intakeComplete", { fields: Object.keys(values).length, skipped: !hasValues });
6491
- persistence.saveIntake(values);
6492
- setIntakeValues(values);
6493
- bus.emit("intakeSubmit", values);
6494
- if (!hasValues) return;
6656
+ const userMessageCount = () => messagesSig.value.reduce((n, m) => n + (m.role === "user" ? 1 : 0), 0);
6657
+ const forms = useForms({
6658
+ forms: options.forms,
6659
+ persistence,
6660
+ userContext: () => options.userContext,
6661
+ messageCount: userMessageCount,
6662
+ pageArea: () => options.pageContext?.area ? String(options.pageContext.area) : void 0,
6663
+ onComplete: (form, trigger, values, skipped) => {
6664
+ log16.info("formSubmit", { formId: form.id, trigger, skipped });
6665
+ bus.emit("formSubmit", { formId: form.id, values, skipped });
6666
+ if (skipped || Object.keys(values).length === 0) return;
6495
6667
  const activeSessionId = sessionIdSig.value ?? uuid7();
6496
6668
  if (!sessionIdSig.value) {
6497
6669
  sessionIdSig.value = activeSessionId;
6498
6670
  persistence.saveSessionId(activeSessionId);
6499
6671
  transport.primeIdentity(void 0, activeSessionId);
6500
6672
  }
6501
- void transport.submitIntake(activeSessionId, values);
6502
- },
6503
- [persistence, bus, sessionIdSig, transport]
6504
- );
6673
+ if (form.mirrorToContext) setFormContext((prev) => ({ ...prev, ...values }));
6674
+ void transport.submitForm({ formId: form.id, sessionId: activeSessionId, trigger, values });
6675
+ }
6676
+ });
6677
+ const activeForm = useComputed7(() => forms.activeForm.value);
6678
+ const pageArea = options.pageContext?.area ? String(options.pageContext.area) : void 0;
6679
+ const msgCount = useComputed7(() => messagesSig.value.length);
6680
+ useEffect17(() => {
6681
+ if (sessionReady) forms.fire("pre-chat");
6682
+ }, [sessionReady, forms]);
6683
+ useEffect17(() => {
6684
+ if (!canSend) forms.fire("conversation-closed");
6685
+ }, [canSend, forms]);
6686
+ useEffect17(() => {
6687
+ if (pageArea) forms.fire("page-area");
6688
+ }, [pageArea, forms]);
6689
+ const idleMs = useMemo3(() => {
6690
+ const secs = options.forms.list.flatMap((f) => f.triggers).filter((t) => t.kind === "idle").map((t) => Number(t.param));
6691
+ return secs.length ? Math.min(...secs) * 1e3 : 0;
6692
+ }, [options.forms]);
6693
+ useEffect17(() => {
6694
+ if (!idleMs || !isOpen) return;
6695
+ const id = setTimeout(() => forms.fire("idle"), idleMs);
6696
+ return () => clearTimeout(id);
6697
+ }, [idleMs, isOpen, forms, msgCount.value]);
6505
6698
  const handleSend = useCallback6(
6506
6699
  async (text, attachments) => {
6507
6700
  log16.info("send", { textLen: text.length, attachments: attachments.length, streaming });
@@ -6521,8 +6714,9 @@ function App({ options, hostElement, bus }) {
6521
6714
  reducer.attach(assistantMsg);
6522
6715
  emitMessage(bus, options, "user", text);
6523
6716
  await streamAssistant(assistantMsg, TRIGGER.submitMessage);
6717
+ forms.fire("after-messages");
6524
6718
  },
6525
- [streaming, transport, bus, options, suggestions.length, messagesSig, reducer, streamAssistant]
6719
+ [streaming, transport, bus, options, suggestions.length, messagesSig, reducer, streamAssistant, forms]
6526
6720
  );
6527
6721
  const handleStop = useCallback6(() => {
6528
6722
  log16.info("stop");
@@ -6543,18 +6737,19 @@ function App({ options, hostElement, bus }) {
6543
6737
  return;
6544
6738
  }
6545
6739
  log16.info("close \u2192 panel closed", { mode: options.mode });
6740
+ forms.fire("panel-close");
6546
6741
  setIsOpen(false);
6547
6742
  persistence.savePanelOpen(false);
6548
6743
  bus.emit("close", void 0);
6549
6744
  options.onClose?.();
6550
- }, [bus, options, persistence, panelSize]);
6745
+ }, [bus, options, persistence, panelSize, forms]);
6551
6746
  const refreshUnread = useCallback6(() => {
6552
6747
  if (!options.modules.list.some((m) => m.layout === "chat")) return;
6553
6748
  transport.listSessions({ limit: 50 }).then((res) => {
6554
6749
  unreadCountSig.value = res.sessions.reduce((sum, c) => sum + (c.unreadCount ?? 0), 0);
6555
6750
  }).catch((err) => log16.debug("refreshUnread failed (non-fatal)", { err }));
6556
6751
  }, [transport, options.modules, unreadCountSig]);
6557
- const unreadSeeded = useRef8(false);
6752
+ const unreadSeeded = useRef9(false);
6558
6753
  useEffect17(() => {
6559
6754
  if (!sessionReady || unreadSeeded.current) return;
6560
6755
  unreadSeeded.current = true;
@@ -6685,10 +6880,11 @@ function App({ options, hostElement, bus }) {
6685
6880
  close: handleClose,
6686
6881
  expand: handleExpand,
6687
6882
  fullscreen: handleFullscreen,
6688
- popout: handlePopOut
6883
+ popout: handlePopOut,
6884
+ openForm: (id) => forms.fire("manual", typeof id === "string" ? id : void 0)
6689
6885
  });
6690
6886
  return unsub;
6691
- }, [hostElement, handleOpen, handleClose, handleExpand, handleFullscreen, handlePopOut]);
6887
+ }, [hostElement, handleOpen, handleClose, handleExpand, handleFullscreen, handlePopOut, forms]);
6692
6888
  const effectiveOptions = useMemo3(
6693
6889
  () => applyOptionOverrides(options, activeLocale, activeThemeMode),
6694
6890
  [options, activeLocale, activeThemeMode]
@@ -6727,8 +6923,12 @@ function App({ options, hostElement, bus }) {
6727
6923
  bus.emit("suggestion", { text });
6728
6924
  void handleSend(text, []);
6729
6925
  },
6730
- intakePending,
6731
- onIntakeComplete: handleIntakeComplete,
6926
+ // Active form: a blocking one replaces the composer (gate); a non-blocking
6927
+ // one renders inline at the end of the transcript (card).
6928
+ blockingForm: activeForm.value?.form.blocking ? activeForm.value.form : null,
6929
+ inlineForm: activeForm.value && !activeForm.value.form.blocking ? activeForm.value.form : null,
6930
+ onFormSubmit: forms.complete,
6931
+ onFormSkip: forms.skip,
6732
6932
  tool: toolInteraction
6733
6933
  };
6734
6934
  const onSelectSession = (sessionId) => {
@@ -6741,12 +6941,12 @@ function App({ options, hostElement, bus }) {
6741
6941
  const renderSurface = (size) => {
6742
6942
  const closeable = isActionVisible("close", effectiveOptions.mode, size);
6743
6943
  if (enabledModules.length === 0) {
6744
- return /* @__PURE__ */ jsx37(ModulesEmpty, { strings: effectiveOptions.strings, onClose: closeable ? handleClose : void 0 });
6944
+ return /* @__PURE__ */ jsx38(ModulesEmpty, { strings: effectiveOptions.strings, onClose: closeable ? handleClose : void 0 });
6745
6945
  }
6746
6946
  if (enabledModules.length === 1 && enabledModules[0]?.layout === "chat") {
6747
- return /* @__PURE__ */ jsx37(Panel, { ...panelProps, panelSize: size });
6947
+ return /* @__PURE__ */ jsx38(Panel, { ...panelProps, panelSize: size });
6748
6948
  }
6749
- return /* @__PURE__ */ jsx37(
6949
+ return /* @__PURE__ */ jsx38(
6750
6950
  MessengerHome,
6751
6951
  {
6752
6952
  panelProps: { ...panelProps, panelSize: size, onClose: closeable ? handleClose : void 0 },
@@ -6764,7 +6964,7 @@ function App({ options, hostElement, bus }) {
6764
6964
  void handleSelectHistoryChat(chat.sessionId);
6765
6965
  };
6766
6966
  const messagesEnabled = enabledModules.some((m) => m.layout === "chat");
6767
- return /* @__PURE__ */ jsx37("div", { class: `${p32}-anchor`, children: /* @__PURE__ */ jsx37(
6967
+ return /* @__PURE__ */ jsx38("div", { class: `${p33}-anchor`, children: /* @__PURE__ */ jsx38(
6768
6968
  PageShell,
6769
6969
  {
6770
6970
  site: parsedSite,
@@ -6783,15 +6983,15 @@ function App({ options, hostElement, bus }) {
6783
6983
  }
6784
6984
  if (isInlineLike) {
6785
6985
  const inlineSize = options.mode === "standalone" ? "fullscreen" : panelSize;
6786
- return /* @__PURE__ */ jsx37("div", { class: `${p32}-anchor`, children: renderSurface(inlineSize) });
6986
+ return /* @__PURE__ */ jsx38("div", { class: `${p33}-anchor`, children: renderSurface(inlineSize) });
6787
6987
  }
6788
6988
  const drawerEdgeTab = options.mode === "drawer";
6789
6989
  const triggerOwnedByPage = options.mode === "modal";
6790
6990
  const launcherVisible = !triggerOwnedByPage && !options.launcher.hidden && (!isOpen || launcherLeaving);
6791
6991
  const calloutToRender = launcherVisible && !launcherLeaving && !calloutDismissed && !drawerEdgeTab ? effectiveOptions.launcher.callout : null;
6792
- return /* @__PURE__ */ jsxs31("div", { class: `${p32}-anchor`, "data-launcher-size": effectiveOptions.launcher.size, children: [
6992
+ return /* @__PURE__ */ jsxs32("div", { class: `${p33}-anchor`, "data-launcher-size": effectiveOptions.launcher.size, children: [
6793
6993
  isOpen ? renderSurface(panelSize) : null,
6794
- launcherVisible ? /* @__PURE__ */ jsx37(
6994
+ launcherVisible ? /* @__PURE__ */ jsx38(
6795
6995
  Launcher,
6796
6996
  {
6797
6997
  onToggle: handleOpen,
@@ -6801,7 +7001,7 @@ function App({ options, hostElement, bus }) {
6801
7001
  edgeTab: drawerEdgeTab
6802
7002
  }
6803
7003
  ) : null,
6804
- calloutToRender ? /* @__PURE__ */ jsx37(
7004
+ calloutToRender ? /* @__PURE__ */ jsx38(
6805
7005
  LauncherCallout,
6806
7006
  {
6807
7007
  callout: calloutToRender,