@helpai/elements 0.13.0 → 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/configurator.mjs +120 -84
- package/elements-web-component.esm.js +25 -25
- package/elements-web-component.esm.js.map +4 -4
- package/elements.cjs.js +27 -27
- package/elements.cjs.js.map +4 -4
- package/elements.esm.js +27 -27
- package/elements.esm.js.map +4 -4
- package/elements.js +25 -25
- package/elements.js.map +4 -4
- package/index.d.ts +101 -38
- package/index.mjs +772 -572
- package/package.json +1 -1
- package/schema.d.ts +166 -76
- package/schema.json +673 -407
- package/schema.mjs +124 -85
- package/style.css +1 -1
- package/web-component.mjs +768 -569
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
|
|
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 (
|
|
110
|
-
|
|
111
|
-
|
|
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 (
|
|
215
|
-
|
|
216
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
return
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
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
|
|
1017
|
-
if (overrides.accent) host.style.setProperty(`--${
|
|
1018
|
-
if (overrides.accentText) host.style.setProperty(`--${
|
|
1019
|
-
if (overrides.radius) host.style.setProperty(`--${
|
|
1020
|
-
if (overrides.fontFamily) host.style.setProperty(`--${
|
|
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
|
|
1027
|
-
if (size.width !== void 0) host.style.setProperty(`--${
|
|
1028
|
-
if (size.height !== void 0) host.style.setProperty(`--${
|
|
1029
|
-
if (size.expanded?.width !== void 0) host.style.setProperty(`--${
|
|
1030
|
-
if (size.expanded?.height !== void 0) host.style.setProperty(`--${
|
|
1031
|
-
if (size.inset !== void 0) host.style.setProperty(`--${
|
|
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,
|
|
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 (
|
|
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
|
|
1203
|
-
if (!u && !
|
|
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 (
|
|
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
|
-
*
|
|
1248
|
-
* skipped? }` → record the
|
|
1249
|
-
*
|
|
1250
|
-
* Overridable via `endpoints.
|
|
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
|
-
|
|
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(
|
|
1278
|
-
return
|
|
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
|
|
1287
|
-
if (
|
|
1288
|
-
out.push({ 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 (
|
|
1291
|
-
out.push({ mediaType:
|
|
1331
|
+
if (p34.kind === "file" && p34.url) {
|
|
1332
|
+
out.push({ mediaType: p34.mediaType, type: "file", url: p34.url });
|
|
1292
1333
|
}
|
|
1293
|
-
if (
|
|
1334
|
+
if (p34.kind === "tool" && isResolvedToolPart(p34)) {
|
|
1294
1335
|
const part = {
|
|
1295
1336
|
type: "tool",
|
|
1296
|
-
toolCallId:
|
|
1297
|
-
toolName:
|
|
1298
|
-
state:
|
|
1337
|
+
toolCallId: p34.toolCallId,
|
|
1338
|
+
toolName: p34.toolName,
|
|
1339
|
+
state: p34.state
|
|
1299
1340
|
};
|
|
1300
|
-
if (
|
|
1301
|
-
if (
|
|
1302
|
-
if (
|
|
1303
|
-
if (
|
|
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,
|
|
1378
|
+
function sleep(ms, signal7) {
|
|
1338
1379
|
return new Promise((resolve) => {
|
|
1339
|
-
if (
|
|
1380
|
+
if (signal7?.aborted) return resolve();
|
|
1340
1381
|
const id = setTimeout(done, ms);
|
|
1341
1382
|
const onAbort = () => done();
|
|
1342
|
-
|
|
1383
|
+
signal7?.addEventListener("abort", onAbort, { once: true });
|
|
1343
1384
|
function done() {
|
|
1344
1385
|
clearTimeout(id);
|
|
1345
|
-
|
|
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
|
|
1552
|
-
return this.opts.endpoints?.
|
|
1592
|
+
get submitFormPath() {
|
|
1593
|
+
return this.opts.endpoints?.submitForm ?? DEFAULT_PATHS.submitForm;
|
|
1553
1594
|
}
|
|
1554
1595
|
/**
|
|
1555
|
-
* Record a completed
|
|
1556
|
-
* captured even if the visitor never sends a message. `sessionId
|
|
1557
|
-
*
|
|
1558
|
-
* ride the envelope. A failure (e.g. 404 on a backend
|
|
1559
|
-
* the endpoint) is non-fatal
|
|
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
|
|
1563
|
-
log4.debug("
|
|
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.
|
|
1605
|
+
await this.postJson(this.submitFormPath, body, "submitForm");
|
|
1566
1606
|
} catch (err) {
|
|
1567
|
-
log4.debug("
|
|
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,
|
|
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:
|
|
1757
|
+
signal: signal7
|
|
1718
1758
|
});
|
|
1719
|
-
yield* parseChatStream(res,
|
|
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((
|
|
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(
|
|
1928
|
-
if (
|
|
1929
|
-
return { kind:
|
|
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 (
|
|
1971
|
+
if (p34.kind === "tool") {
|
|
1932
1972
|
return {
|
|
1933
1973
|
kind: "tool",
|
|
1934
|
-
toolCallId:
|
|
1935
|
-
toolName:
|
|
1936
|
-
inputPartialSig: signal(
|
|
1937
|
-
inputSig: signal(
|
|
1938
|
-
outputSig: signal(
|
|
1939
|
-
errorSig: signal(
|
|
1940
|
-
stateSig: signal(
|
|
1941
|
-
approvalSig: signal(
|
|
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
|
|
1984
|
+
return p34;
|
|
1945
1985
|
}
|
|
1946
|
-
function partFromReactive(
|
|
1947
|
-
if (
|
|
1948
|
-
return { kind:
|
|
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 (
|
|
1990
|
+
if (p34.kind === "tool") {
|
|
1951
1991
|
return {
|
|
1952
1992
|
kind: "tool",
|
|
1953
|
-
toolCallId:
|
|
1954
|
-
toolName:
|
|
1955
|
-
inputPartial:
|
|
1956
|
-
input:
|
|
1957
|
-
output:
|
|
1958
|
-
error:
|
|
1959
|
-
state:
|
|
1960
|
-
approval:
|
|
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
|
|
2003
|
+
return p34;
|
|
1964
2004
|
}
|
|
1965
2005
|
|
|
1966
2006
|
// src/stream/reducer.ts
|
|
@@ -1969,9 +2009,7 @@ import { signal as signal2 } from "@preact/signals";
|
|
|
1969
2009
|
// src/stream/constants.ts
|
|
1970
2010
|
var ASK_USER_INPUT_TOOL = "tool:ask-user-input";
|
|
1971
2011
|
function isAskUserInputTool(toolName) {
|
|
1972
|
-
|
|
1973
|
-
const t = toolName.toLowerCase();
|
|
1974
|
-
return t === ASK_USER_INPUT_TOOL || t === "ask-user-input" || t === "ask_user_input";
|
|
2012
|
+
return toolName === ASK_USER_INPUT_TOOL;
|
|
1975
2013
|
}
|
|
1976
2014
|
var TRIGGER = {
|
|
1977
2015
|
submitMessage: "submit-message",
|
|
@@ -2017,8 +2055,8 @@ var StreamReducer = class {
|
|
|
2017
2055
|
ensureTextPart(m, "text", chunk.id);
|
|
2018
2056
|
return;
|
|
2019
2057
|
case "text-delta": {
|
|
2020
|
-
const
|
|
2021
|
-
|
|
2058
|
+
const p34 = ensureTextPart(m, "text", chunk.id);
|
|
2059
|
+
p34.textSig.value += chunk.delta;
|
|
2022
2060
|
return;
|
|
2023
2061
|
}
|
|
2024
2062
|
case "text-end":
|
|
@@ -2028,8 +2066,8 @@ var StreamReducer = class {
|
|
|
2028
2066
|
ensureTextPart(m, "reasoning", chunk.id).doneSig.value = false;
|
|
2029
2067
|
return;
|
|
2030
2068
|
case "reasoning-delta": {
|
|
2031
|
-
const
|
|
2032
|
-
|
|
2069
|
+
const p34 = ensureTextPart(m, "reasoning", chunk.id);
|
|
2070
|
+
p34.textSig.value += chunk.delta;
|
|
2033
2071
|
return;
|
|
2034
2072
|
}
|
|
2035
2073
|
case "reasoning-end":
|
|
@@ -2048,7 +2086,7 @@ var StreamReducer = class {
|
|
|
2048
2086
|
return;
|
|
2049
2087
|
case "source-url": {
|
|
2050
2088
|
const parts = m.partsSig.value;
|
|
2051
|
-
if (parts.some((
|
|
2089
|
+
if (parts.some((p34) => p34.kind === "source" && p34.sourceId === chunk.sourceId)) return;
|
|
2052
2090
|
appendPart(m, { kind: "source", sourceId: chunk.sourceId, url: chunk.url, title: chunk.title });
|
|
2053
2091
|
return;
|
|
2054
2092
|
}
|
|
@@ -2072,14 +2110,14 @@ var StreamReducer = class {
|
|
|
2072
2110
|
}
|
|
2073
2111
|
};
|
|
2074
2112
|
function ensureTextPart(m, kind, id) {
|
|
2075
|
-
const existing = m.partsSig.value.find((
|
|
2113
|
+
const existing = m.partsSig.value.find((p34) => p34.kind === kind && p34.id === id);
|
|
2076
2114
|
if (existing) return existing;
|
|
2077
2115
|
const part = { kind, id, textSig: signal2(""), doneSig: signal2(false) };
|
|
2078
2116
|
appendPart(m, part);
|
|
2079
2117
|
return part;
|
|
2080
2118
|
}
|
|
2081
2119
|
function ensureToolPart(m, toolCallId, toolName) {
|
|
2082
|
-
const existing = m.partsSig.value.find((
|
|
2120
|
+
const existing = m.partsSig.value.find((p34) => p34.kind === "tool" && p34.toolCallId === toolCallId);
|
|
2083
2121
|
if (existing) return existing;
|
|
2084
2122
|
const part = {
|
|
2085
2123
|
kind: "tool",
|
|
@@ -2104,32 +2142,32 @@ function applyTool(m, chunk) {
|
|
|
2104
2142
|
ensureToolPart(m, chunk.toolCallId, chunk.toolName);
|
|
2105
2143
|
return;
|
|
2106
2144
|
case "tool-input-delta": {
|
|
2107
|
-
const
|
|
2108
|
-
|
|
2145
|
+
const p34 = ensureToolPart(m, chunk.toolCallId);
|
|
2146
|
+
p34.inputPartialSig.value += chunk.delta;
|
|
2109
2147
|
return;
|
|
2110
2148
|
}
|
|
2111
2149
|
case "tool-input-available": {
|
|
2112
|
-
const
|
|
2113
|
-
|
|
2114
|
-
|
|
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";
|
|
2115
2153
|
return;
|
|
2116
2154
|
}
|
|
2117
2155
|
case "tool-approval-request": {
|
|
2118
|
-
const
|
|
2119
|
-
|
|
2120
|
-
|
|
2156
|
+
const p34 = ensureToolPart(m, chunk.toolCallId, chunk.toolName);
|
|
2157
|
+
p34.approvalSig.value = { id: chunk.approvalId };
|
|
2158
|
+
p34.stateSig.value = "awaiting-approval";
|
|
2121
2159
|
return;
|
|
2122
2160
|
}
|
|
2123
2161
|
case "tool-output-available": {
|
|
2124
|
-
const
|
|
2125
|
-
|
|
2126
|
-
|
|
2162
|
+
const p34 = ensureToolPart(m, chunk.toolCallId);
|
|
2163
|
+
p34.outputSig.value = chunk.output;
|
|
2164
|
+
p34.stateSig.value = "output";
|
|
2127
2165
|
return;
|
|
2128
2166
|
}
|
|
2129
2167
|
case "tool-output-error": {
|
|
2130
|
-
const
|
|
2131
|
-
|
|
2132
|
-
|
|
2168
|
+
const p34 = ensureToolPart(m, chunk.toolCallId);
|
|
2169
|
+
p34.errorSig.value = chunk.errorText;
|
|
2170
|
+
p34.stateSig.value = "error";
|
|
2133
2171
|
return;
|
|
2134
2172
|
}
|
|
2135
2173
|
default:
|
|
@@ -2149,7 +2187,7 @@ function createPersistence(widgetId, storage = defaultStorage) {
|
|
|
2149
2187
|
const KEY_CALLOUT_DISMISSED = `${prefix}.calloutDismissed`;
|
|
2150
2188
|
const KEY_SIDEBAR_COLLAPSED = `${prefix}.sidebarCollapsed`;
|
|
2151
2189
|
const KEY_ACTIVE_MODULE = `${prefix}.activeModule`;
|
|
2152
|
-
const
|
|
2190
|
+
const KEY_FORMS_DONE = `${prefix}.formsDone`;
|
|
2153
2191
|
const persistence = {
|
|
2154
2192
|
getVisitorId() {
|
|
2155
2193
|
const existing = storage.get(KEY_VISITOR);
|
|
@@ -2232,22 +2270,24 @@ function createPersistence(widgetId, storage = defaultStorage) {
|
|
|
2232
2270
|
saveActiveModule(id) {
|
|
2233
2271
|
storage.set(KEY_ACTIVE_MODULE, id);
|
|
2234
2272
|
},
|
|
2235
|
-
|
|
2236
|
-
const raw = storage.get(
|
|
2237
|
-
if (!raw) return
|
|
2273
|
+
loadFormsDone() {
|
|
2274
|
+
const raw = storage.get(KEY_FORMS_DONE);
|
|
2275
|
+
if (!raw) return {};
|
|
2238
2276
|
try {
|
|
2239
2277
|
const parsed = JSON.parse(raw);
|
|
2240
|
-
return isPlainObject2(parsed) ? parsed :
|
|
2278
|
+
return isPlainObject2(parsed) ? parsed : {};
|
|
2241
2279
|
} catch (error) {
|
|
2242
|
-
log6.warn("
|
|
2243
|
-
return
|
|
2280
|
+
log6.warn("loadFormsDone parse failed", { error });
|
|
2281
|
+
return {};
|
|
2244
2282
|
}
|
|
2245
2283
|
},
|
|
2246
|
-
|
|
2284
|
+
saveFormDone(id) {
|
|
2247
2285
|
try {
|
|
2248
|
-
|
|
2286
|
+
const done = persistence.loadFormsDone();
|
|
2287
|
+
done[id] = Date.now();
|
|
2288
|
+
storage.set(KEY_FORMS_DONE, JSON.stringify(done));
|
|
2249
2289
|
} catch (error) {
|
|
2250
|
-
log6.warn("
|
|
2290
|
+
log6.warn("saveFormDone serialise failed", { error });
|
|
2251
2291
|
}
|
|
2252
2292
|
},
|
|
2253
2293
|
clearSession() {
|
|
@@ -2792,13 +2832,17 @@ var TID = {
|
|
|
2792
2832
|
helpArticle: `${p2}-help-article`,
|
|
2793
2833
|
/** News list item — suffix `-{id}`. */
|
|
2794
2834
|
newsItem: `${p2}-news-item`,
|
|
2795
|
-
// ── Forms + human-in-the-loop (
|
|
2796
|
-
/**
|
|
2797
|
-
|
|
2798
|
-
/**
|
|
2799
|
-
|
|
2800
|
-
/**
|
|
2801
|
-
|
|
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`,
|
|
2802
2846
|
/** A single form field control — suffix `-{name}` at the JSX site. */
|
|
2803
2847
|
formField: `${p2}-form-field`,
|
|
2804
2848
|
/** Ask-input tool root (inline form in a message bubble). */
|
|
@@ -2925,24 +2969,24 @@ import { useCallback as useCallback2, useEffect as useEffect10, useRef as useRef
|
|
|
2925
2969
|
import { useEffect as useEffect2, useRef } from "preact/hooks";
|
|
2926
2970
|
import { jsx as jsx3 } from "preact/jsx-runtime";
|
|
2927
2971
|
function ResizeGrip({ panelEl, resize, position, initialSize, onSizeChange, strings }) {
|
|
2928
|
-
const
|
|
2972
|
+
const p34 = BRAND.cssPrefix;
|
|
2929
2973
|
const dragRef = useRef(null);
|
|
2930
2974
|
useEffect2(() => {
|
|
2931
2975
|
if (!panelEl) return;
|
|
2932
2976
|
const style = panelEl.style;
|
|
2933
|
-
if (resize.minWidth) style.setProperty(`--${
|
|
2934
|
-
if (resize.maxWidth) style.setProperty(`--${
|
|
2935
|
-
if (resize.minHeight) style.setProperty(`--${
|
|
2936
|
-
if (resize.maxHeight) style.setProperty(`--${
|
|
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);
|
|
2937
2981
|
if (initialSize) {
|
|
2938
|
-
style.setProperty(`--${
|
|
2939
|
-
style.setProperty(`--${
|
|
2982
|
+
style.setProperty(`--${p34}-widget-w`, `${initialSize.width}px`);
|
|
2983
|
+
style.setProperty(`--${p34}-widget-h`, `${initialSize.height}px`);
|
|
2940
2984
|
}
|
|
2941
|
-
}, [panelEl, resize.minWidth, resize.maxWidth, resize.minHeight, resize.maxHeight,
|
|
2985
|
+
}, [panelEl, resize.minWidth, resize.maxWidth, resize.minHeight, resize.maxHeight, p34, initialSize]);
|
|
2942
2986
|
if (!panelEl) return null;
|
|
2943
2987
|
const isTop = position.startsWith("top-");
|
|
2944
2988
|
const isRight = position.endsWith("-right");
|
|
2945
|
-
const cornerClass = `${
|
|
2989
|
+
const cornerClass = `${p34}-resize-grip ${p34}-resize-grip--${isTop ? "bottom" : "top"}-${isRight ? "left" : "right"}`;
|
|
2946
2990
|
const onPointerDown = (e) => {
|
|
2947
2991
|
if (!panelEl) return;
|
|
2948
2992
|
const target = e.currentTarget;
|
|
@@ -2966,8 +3010,8 @@ function ResizeGrip({ panelEl, resize, position, initialSize, onSizeChange, stri
|
|
|
2966
3010
|
if (!d || e.pointerId !== d.pointerId || !panelEl) return;
|
|
2967
3011
|
const dx = (e.clientX - d.startX) * d.dirX;
|
|
2968
3012
|
const dy = (e.clientY - d.startY) * d.dirY;
|
|
2969
|
-
panelEl.style.setProperty(`--${
|
|
2970
|
-
panelEl.style.setProperty(`--${
|
|
3013
|
+
panelEl.style.setProperty(`--${p34}-widget-w`, `${d.startW + dx}px`);
|
|
3014
|
+
panelEl.style.setProperty(`--${p34}-widget-h`, `${d.startH + dy}px`);
|
|
2971
3015
|
};
|
|
2972
3016
|
const onPointerUp = (e) => {
|
|
2973
3017
|
const d = dragRef.current;
|
|
@@ -3702,20 +3746,20 @@ function usePopoverMenu({ itemCount, initialFocusIndex }) {
|
|
|
3702
3746
|
// src/ui/overflow-menu.tsx
|
|
3703
3747
|
import { jsx as jsx8, jsxs as jsxs6 } from "preact/jsx-runtime";
|
|
3704
3748
|
function OverflowMenu({ items, triggerLabel }) {
|
|
3705
|
-
const
|
|
3749
|
+
const p34 = BRAND.cssPrefix;
|
|
3706
3750
|
const menu = usePopoverMenu({ itemCount: items.length });
|
|
3707
3751
|
const handleSelect = (item) => {
|
|
3708
3752
|
if (item.disabled) return;
|
|
3709
3753
|
item.onSelect();
|
|
3710
3754
|
if (!item.keepOpen) menu.close();
|
|
3711
3755
|
};
|
|
3712
|
-
return /* @__PURE__ */ jsxs6("div", { class: `${
|
|
3756
|
+
return /* @__PURE__ */ jsxs6("div", { class: `${p34}-menu-wrap`, children: [
|
|
3713
3757
|
/* @__PURE__ */ jsx8(
|
|
3714
3758
|
"button",
|
|
3715
3759
|
{
|
|
3716
3760
|
ref: menu.triggerRef,
|
|
3717
3761
|
type: "button",
|
|
3718
|
-
class: `${
|
|
3762
|
+
class: `${p34}-icon-btn`,
|
|
3719
3763
|
"aria-label": triggerLabel,
|
|
3720
3764
|
"aria-haspopup": "menu",
|
|
3721
3765
|
"aria-expanded": menu.open,
|
|
@@ -3729,7 +3773,7 @@ function OverflowMenu({ items, triggerLabel }) {
|
|
|
3729
3773
|
"div",
|
|
3730
3774
|
{
|
|
3731
3775
|
ref: menu.menuRef,
|
|
3732
|
-
class: `${
|
|
3776
|
+
class: `${p34}-menu`,
|
|
3733
3777
|
role: "menu",
|
|
3734
3778
|
"aria-label": triggerLabel,
|
|
3735
3779
|
onKeyDown: menu.onMenuKey,
|
|
@@ -3739,15 +3783,15 @@ function OverflowMenu({ items, triggerLabel }) {
|
|
|
3739
3783
|
{
|
|
3740
3784
|
type: "button",
|
|
3741
3785
|
role: "menuitem",
|
|
3742
|
-
class: `${
|
|
3786
|
+
class: `${p34}-menu-item`,
|
|
3743
3787
|
"aria-pressed": item.type === "switch" ? item.on : void 0,
|
|
3744
3788
|
disabled: item.disabled,
|
|
3745
3789
|
lang: item.lang,
|
|
3746
3790
|
onClick: () => handleSelect(item),
|
|
3747
3791
|
children: [
|
|
3748
|
-
item.icon ? /* @__PURE__ */ jsx8("span", { class: `${
|
|
3749
|
-
/* @__PURE__ */ jsx8("span", { class: `${
|
|
3750
|
-
item.type === "switch" && item.on ? /* @__PURE__ */ jsx8("span", { class: `${
|
|
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
|
|
3751
3795
|
]
|
|
3752
3796
|
},
|
|
3753
3797
|
item.id
|
|
@@ -4163,7 +4207,17 @@ function renderControl(args) {
|
|
|
4163
4207
|
}
|
|
4164
4208
|
}
|
|
4165
4209
|
function inputType(type) {
|
|
4166
|
-
|
|
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
|
+
}
|
|
4167
4221
|
}
|
|
4168
4222
|
function seedValues(fields) {
|
|
4169
4223
|
const out = {};
|
|
@@ -4188,24 +4242,24 @@ function resolveValues(fields, values, other) {
|
|
|
4188
4242
|
return out;
|
|
4189
4243
|
}
|
|
4190
4244
|
|
|
4191
|
-
// src/ui/
|
|
4245
|
+
// src/ui/form/form-gate.tsx
|
|
4192
4246
|
import { jsx as jsx11, jsxs as jsxs9 } from "preact/jsx-runtime";
|
|
4193
4247
|
var p11 = BRAND.cssPrefix;
|
|
4194
|
-
function
|
|
4195
|
-
return /* @__PURE__ */ jsxs9("div", { class: `${p11}-
|
|
4196
|
-
|
|
4197
|
-
|
|
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,
|
|
4198
4252
|
/* @__PURE__ */ jsx11(
|
|
4199
4253
|
DynamicForm,
|
|
4200
4254
|
{
|
|
4201
|
-
fields:
|
|
4255
|
+
fields: form.fields,
|
|
4202
4256
|
strings,
|
|
4203
|
-
submitLabel:
|
|
4204
|
-
onSubmit
|
|
4205
|
-
skipLabel:
|
|
4206
|
-
onSkip:
|
|
4207
|
-
submitTestId: TID.
|
|
4208
|
-
skipTestId: TID.
|
|
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
|
|
4209
4263
|
}
|
|
4210
4264
|
)
|
|
4211
4265
|
] });
|
|
@@ -4215,6 +4269,40 @@ function IntakeGate({ intake, strings, onComplete }) {
|
|
|
4215
4269
|
import { useEffect as useEffect8, useLayoutEffect, useRef as useRef5, useState as useState6 } from "preact/hooks";
|
|
4216
4270
|
import { useComputed as useComputed5 } from "@preact/signals";
|
|
4217
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
|
+
|
|
4218
4306
|
// src/ui/message-bubble.tsx
|
|
4219
4307
|
import { useComputed as useComputed4 } from "@preact/signals";
|
|
4220
4308
|
|
|
@@ -4222,7 +4310,7 @@ import { useComputed as useComputed4 } from "@preact/signals";
|
|
|
4222
4310
|
import { useEffect as useEffect7, useMemo, useRef as useRef4 } from "preact/hooks";
|
|
4223
4311
|
import { effect, signal as signal4 } from "@preact/signals";
|
|
4224
4312
|
import * as smd from "streaming-markdown";
|
|
4225
|
-
import { jsx as
|
|
4313
|
+
import { jsx as jsx13 } from "preact/jsx-runtime";
|
|
4226
4314
|
function MarkdownView({ textSig, doneSig }) {
|
|
4227
4315
|
const ref = useRef4(null);
|
|
4228
4316
|
useEffect7(() => {
|
|
@@ -4272,12 +4360,12 @@ function MarkdownView({ textSig, doneSig }) {
|
|
|
4272
4360
|
el.removeEventListener("click", onClick);
|
|
4273
4361
|
};
|
|
4274
4362
|
}, [textSig, doneSig]);
|
|
4275
|
-
return /* @__PURE__ */
|
|
4363
|
+
return /* @__PURE__ */ jsx13("div", { ref });
|
|
4276
4364
|
}
|
|
4277
4365
|
function StaticMarkdown({ text }) {
|
|
4278
4366
|
const textSig = useMemo(() => signal4(text), [text]);
|
|
4279
4367
|
const doneSig = useMemo(() => signal4(true), []);
|
|
4280
|
-
return /* @__PURE__ */
|
|
4368
|
+
return /* @__PURE__ */ jsx13(MarkdownView, { textSig, doneSig });
|
|
4281
4369
|
}
|
|
4282
4370
|
function hardenLink(a) {
|
|
4283
4371
|
const href = a.getAttribute("href") ?? "";
|
|
@@ -4291,8 +4379,8 @@ function hardenLink(a) {
|
|
|
4291
4379
|
|
|
4292
4380
|
// src/ui/tool-approval.tsx
|
|
4293
4381
|
import { useComputed as useComputed2, useSignal } from "@preact/signals";
|
|
4294
|
-
import { Fragment, jsx as
|
|
4295
|
-
var
|
|
4382
|
+
import { Fragment, jsx as jsx14, jsxs as jsxs11 } from "preact/jsx-runtime";
|
|
4383
|
+
var p13 = BRAND.cssPrefix;
|
|
4296
4384
|
function ToolApproval({ part, strings, active, onDecision }) {
|
|
4297
4385
|
const approval = useComputed2(() => part.approvalSig.value);
|
|
4298
4386
|
const input = useComputed2(() => part.inputSig.value);
|
|
@@ -4300,23 +4388,24 @@ function ToolApproval({ part, strings, active, onDecision }) {
|
|
|
4300
4388
|
const decided = approval.value?.approved !== void 0;
|
|
4301
4389
|
if (decided) {
|
|
4302
4390
|
const ap = approval.value;
|
|
4303
|
-
return /* @__PURE__ */
|
|
4304
|
-
/* @__PURE__ */
|
|
4305
|
-
/* @__PURE__ */
|
|
4306
|
-
ap?.reason ? /* @__PURE__ */
|
|
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
|
|
4307
4395
|
] });
|
|
4308
4396
|
}
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
/* @__PURE__ */
|
|
4397
|
+
const args = summarizeInput(input.value);
|
|
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 })
|
|
4313
4402
|
] }),
|
|
4314
|
-
|
|
4315
|
-
active ? /* @__PURE__ */
|
|
4316
|
-
/* @__PURE__ */
|
|
4403
|
+
args ? /* @__PURE__ */ jsx14("pre", { class: `${p13}-tool-args`, children: args }) : null,
|
|
4404
|
+
active ? /* @__PURE__ */ jsxs11(Fragment, { children: [
|
|
4405
|
+
/* @__PURE__ */ jsx14(
|
|
4317
4406
|
"input",
|
|
4318
4407
|
{
|
|
4319
|
-
class: `${
|
|
4408
|
+
class: `${p13}-field-input`,
|
|
4320
4409
|
value: reason.value,
|
|
4321
4410
|
placeholder: strings.approvalReason,
|
|
4322
4411
|
onInput: (e) => {
|
|
@@ -4324,29 +4413,29 @@ function ToolApproval({ part, strings, active, onDecision }) {
|
|
|
4324
4413
|
}
|
|
4325
4414
|
}
|
|
4326
4415
|
),
|
|
4327
|
-
/* @__PURE__ */
|
|
4328
|
-
/* @__PURE__ */
|
|
4416
|
+
/* @__PURE__ */ jsxs11("div", { class: `${p13}-form-actions`, children: [
|
|
4417
|
+
/* @__PURE__ */ jsx14(
|
|
4329
4418
|
"button",
|
|
4330
4419
|
{
|
|
4331
4420
|
type: "button",
|
|
4332
|
-
class: `${
|
|
4421
|
+
class: `${p13}-tool-reject`,
|
|
4333
4422
|
onClick: () => onDecision(part.toolCallId, false, reason.value.trim() || void 0),
|
|
4334
4423
|
"data-testid": TID.toolReject,
|
|
4335
4424
|
children: strings.reject
|
|
4336
4425
|
}
|
|
4337
4426
|
),
|
|
4338
|
-
/* @__PURE__ */
|
|
4427
|
+
/* @__PURE__ */ jsx14(
|
|
4339
4428
|
"button",
|
|
4340
4429
|
{
|
|
4341
4430
|
type: "button",
|
|
4342
|
-
class: `${
|
|
4431
|
+
class: `${p13}-tool-approve`,
|
|
4343
4432
|
onClick: () => onDecision(part.toolCallId, true, reason.value.trim() || void 0),
|
|
4344
4433
|
"data-testid": TID.toolApprove,
|
|
4345
4434
|
children: strings.approve
|
|
4346
4435
|
}
|
|
4347
4436
|
)
|
|
4348
4437
|
] })
|
|
4349
|
-
] }) : /* @__PURE__ */
|
|
4438
|
+
] }) : /* @__PURE__ */ jsx14("p", { class: `${p13}-tool-stale-note`, children: strings.stepNoLongerActive })
|
|
4350
4439
|
] });
|
|
4351
4440
|
}
|
|
4352
4441
|
function summarizeInput(input) {
|
|
@@ -4417,52 +4506,52 @@ function num(v) {
|
|
|
4417
4506
|
}
|
|
4418
4507
|
|
|
4419
4508
|
// src/ui/tool-ask-input.tsx
|
|
4420
|
-
import { jsx as
|
|
4421
|
-
var
|
|
4509
|
+
import { jsx as jsx15, jsxs as jsxs12 } from "preact/jsx-runtime";
|
|
4510
|
+
var p14 = BRAND.cssPrefix;
|
|
4422
4511
|
function ToolAskInput({ part, strings, active, onSubmit }) {
|
|
4423
4512
|
const state = useComputed3(() => part.stateSig.value);
|
|
4424
4513
|
const request = useComputed3(() => parseAskUserInput(part.inputSig.value));
|
|
4425
4514
|
const decided = state.value === "output" || state.value === "error";
|
|
4426
4515
|
if (decided) {
|
|
4427
|
-
return /* @__PURE__ */
|
|
4516
|
+
return /* @__PURE__ */ jsx15(DecidedSummary, { part, strings });
|
|
4428
4517
|
}
|
|
4429
4518
|
if (!active) {
|
|
4430
|
-
return /* @__PURE__ */
|
|
4431
|
-
/* @__PURE__ */
|
|
4432
|
-
/* @__PURE__ */
|
|
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 })
|
|
4433
4522
|
] });
|
|
4434
4523
|
}
|
|
4435
4524
|
const req = request.value;
|
|
4436
|
-
const
|
|
4437
|
-
return /* @__PURE__ */
|
|
4438
|
-
/* @__PURE__ */
|
|
4439
|
-
req.description ? /* @__PURE__ */
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
/* @__PURE__ */
|
|
4525
|
+
const isConfirmation = req.responseType === "confirmation";
|
|
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(
|
|
4443
4532
|
"button",
|
|
4444
4533
|
{
|
|
4445
4534
|
type: "button",
|
|
4446
|
-
class: `${
|
|
4535
|
+
class: `${p14}-form-skip`,
|
|
4447
4536
|
onClick: () => onSubmit(part.toolCallId, { confirmed: false }),
|
|
4448
4537
|
"data-testid": TID.toolInputSkip,
|
|
4449
4538
|
children: strings.reject
|
|
4450
4539
|
}
|
|
4451
4540
|
),
|
|
4452
|
-
/* @__PURE__ */
|
|
4541
|
+
/* @__PURE__ */ jsx15(
|
|
4453
4542
|
"button",
|
|
4454
4543
|
{
|
|
4455
4544
|
type: "button",
|
|
4456
|
-
class: `${
|
|
4545
|
+
class: `${p14}-form-submit`,
|
|
4457
4546
|
onClick: () => onSubmit(part.toolCallId, { confirmed: true }),
|
|
4458
4547
|
"data-testid": TID.toolInputSubmit,
|
|
4459
4548
|
children: strings.approve
|
|
4460
4549
|
}
|
|
4461
4550
|
)
|
|
4462
|
-
] }) : /* @__PURE__ */
|
|
4551
|
+
] }) : /* @__PURE__ */ jsx15(
|
|
4463
4552
|
DynamicForm,
|
|
4464
4553
|
{
|
|
4465
|
-
fields,
|
|
4554
|
+
fields: askInputToFields(req),
|
|
4466
4555
|
strings,
|
|
4467
4556
|
submitLabel: strings.inputSubmit,
|
|
4468
4557
|
onSubmit: (values) => onSubmit(part.toolCallId, values),
|
|
@@ -4475,17 +4564,17 @@ function ToolAskInput({ part, strings, active, onSubmit }) {
|
|
|
4475
4564
|
] });
|
|
4476
4565
|
}
|
|
4477
4566
|
function Header({ strings, title }) {
|
|
4478
|
-
return /* @__PURE__ */
|
|
4479
|
-
/* @__PURE__ */
|
|
4480
|
-
title ? /* @__PURE__ */
|
|
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
|
|
4481
4570
|
] });
|
|
4482
4571
|
}
|
|
4483
4572
|
function DecidedSummary({ part, strings }) {
|
|
4484
4573
|
const output = useComputed3(() => part.outputSig.value);
|
|
4485
4574
|
const text = summarizeOutput(output.value) || strings.inputSubmitted;
|
|
4486
|
-
return /* @__PURE__ */
|
|
4487
|
-
/* @__PURE__ */
|
|
4488
|
-
/* @__PURE__ */
|
|
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 })
|
|
4489
4578
|
] });
|
|
4490
4579
|
}
|
|
4491
4580
|
function summarizeOutput(output) {
|
|
@@ -4500,21 +4589,21 @@ function summarizeOutput(output) {
|
|
|
4500
4589
|
}
|
|
4501
4590
|
|
|
4502
4591
|
// src/ui/tool-chip.tsx
|
|
4503
|
-
import { jsx as
|
|
4592
|
+
import { jsx as jsx16, jsxs as jsxs13 } from "preact/jsx-runtime";
|
|
4504
4593
|
function ToolChip({ part, strings }) {
|
|
4505
|
-
const
|
|
4506
|
-
return /* @__PURE__ */
|
|
4507
|
-
/* @__PURE__ */
|
|
4594
|
+
const p34 = BRAND.cssPrefix;
|
|
4595
|
+
return /* @__PURE__ */ jsxs13("span", { class: `${p34}-tool-chip`, role: "status", children: [
|
|
4596
|
+
/* @__PURE__ */ jsxs13("span", { children: [
|
|
4508
4597
|
strings.usedTool,
|
|
4509
4598
|
":"
|
|
4510
4599
|
] }),
|
|
4511
|
-
/* @__PURE__ */
|
|
4600
|
+
/* @__PURE__ */ jsx16("strong", { children: part.toolName })
|
|
4512
4601
|
] });
|
|
4513
4602
|
}
|
|
4514
4603
|
|
|
4515
4604
|
// src/ui/message-bubble.tsx
|
|
4516
|
-
import { jsx as
|
|
4517
|
-
var
|
|
4605
|
+
import { jsx as jsx17, jsxs as jsxs14 } from "preact/jsx-runtime";
|
|
4606
|
+
var p15 = BRAND.cssPrefix;
|
|
4518
4607
|
function MessageBubble({
|
|
4519
4608
|
message,
|
|
4520
4609
|
strings,
|
|
@@ -4537,9 +4626,9 @@ function MessageBubble({
|
|
|
4537
4626
|
const working = streaming && !hasAnswerText.value;
|
|
4538
4627
|
const showStreamDots = streaming && !bufferedHold && !(reasoningVisible.value && working);
|
|
4539
4628
|
const stamp = formatStamp(message.createdAt);
|
|
4540
|
-
return /* @__PURE__ */
|
|
4541
|
-
/* @__PURE__ */
|
|
4542
|
-
bufferedHold ? /* @__PURE__ */
|
|
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(
|
|
4543
4632
|
PartView,
|
|
4544
4633
|
{
|
|
4545
4634
|
part,
|
|
@@ -4552,10 +4641,10 @@ function MessageBubble({
|
|
|
4552
4641
|
},
|
|
4553
4642
|
partKey(part)
|
|
4554
4643
|
)),
|
|
4555
|
-
showStreamDots && /* @__PURE__ */
|
|
4556
|
-
message.status === "error" && message.errorText ? /* @__PURE__ */
|
|
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
|
|
4557
4646
|
] }),
|
|
4558
|
-
stamp ? /* @__PURE__ */
|
|
4647
|
+
stamp ? /* @__PURE__ */ jsx17("time", { class: `${p15}-bubble-time`, dateTime: stamp.iso, title: stamp.full, children: stamp.short }) : null
|
|
4559
4648
|
] }) });
|
|
4560
4649
|
}
|
|
4561
4650
|
function formatStamp(createdAt) {
|
|
@@ -4582,11 +4671,11 @@ function PartView({
|
|
|
4582
4671
|
}) {
|
|
4583
4672
|
switch (part.kind) {
|
|
4584
4673
|
case "text":
|
|
4585
|
-
return /* @__PURE__ */
|
|
4674
|
+
return /* @__PURE__ */ jsx17(MarkdownView, { textSig: part.textSig, doneSig: part.doneSig });
|
|
4586
4675
|
case "reasoning":
|
|
4587
|
-
return showReasoning ? /* @__PURE__ */
|
|
4676
|
+
return showReasoning ? /* @__PURE__ */ jsx17(ReasoningView, { part, active, strings }) : null;
|
|
4588
4677
|
case "tool":
|
|
4589
|
-
return /* @__PURE__ */
|
|
4678
|
+
return /* @__PURE__ */ jsx17(
|
|
4590
4679
|
ToolPartView,
|
|
4591
4680
|
{
|
|
4592
4681
|
part,
|
|
@@ -4598,9 +4687,9 @@ function PartView({
|
|
|
4598
4687
|
);
|
|
4599
4688
|
case "file":
|
|
4600
4689
|
if (part.mediaType.startsWith("image/")) {
|
|
4601
|
-
return /* @__PURE__ */
|
|
4690
|
+
return /* @__PURE__ */ jsx17("img", { src: part.url, alt: "", loading: "lazy" });
|
|
4602
4691
|
}
|
|
4603
|
-
return /* @__PURE__ */
|
|
4692
|
+
return /* @__PURE__ */ jsx17("a", { href: part.url, target: "_blank", rel: "noreferrer noopener", children: part.url });
|
|
4604
4693
|
case "source":
|
|
4605
4694
|
return null;
|
|
4606
4695
|
}
|
|
@@ -4616,22 +4705,22 @@ function ToolPartView({
|
|
|
4616
4705
|
const hasApproval = useComputed4(() => part.approvalSig.value !== void 0);
|
|
4617
4706
|
if (tool?.humanInLoop) {
|
|
4618
4707
|
if (hasApproval.value || state.value === "awaiting-approval") {
|
|
4619
|
-
return /* @__PURE__ */
|
|
4708
|
+
return /* @__PURE__ */ jsx17(ToolApproval, { part, strings, active: interactive, onDecision: tool.onDecision });
|
|
4620
4709
|
}
|
|
4621
4710
|
if (isAskUserInputTool(part.toolName) || state.value === "awaiting-input") {
|
|
4622
|
-
return /* @__PURE__ */
|
|
4711
|
+
return /* @__PURE__ */ jsx17(ToolAskInput, { part, strings, active: interactive, onSubmit: tool.onResult });
|
|
4623
4712
|
}
|
|
4624
4713
|
}
|
|
4625
|
-
return showToolCalls ? /* @__PURE__ */
|
|
4714
|
+
return showToolCalls ? /* @__PURE__ */ jsx17(ToolChip, { part, strings }) : null;
|
|
4626
4715
|
}
|
|
4627
4716
|
function ReasoningView({
|
|
4628
4717
|
part,
|
|
4629
4718
|
active,
|
|
4630
4719
|
strings
|
|
4631
4720
|
}) {
|
|
4632
|
-
return /* @__PURE__ */
|
|
4633
|
-
/* @__PURE__ */
|
|
4634
|
-
/* @__PURE__ */
|
|
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 }) })
|
|
4635
4724
|
] });
|
|
4636
4725
|
}
|
|
4637
4726
|
function partKey(part) {
|
|
@@ -4648,22 +4737,22 @@ function partKey(part) {
|
|
|
4648
4737
|
}
|
|
4649
4738
|
}
|
|
4650
4739
|
function TypingDots() {
|
|
4651
|
-
return /* @__PURE__ */
|
|
4652
|
-
/* @__PURE__ */
|
|
4653
|
-
/* @__PURE__ */
|
|
4654
|
-
/* @__PURE__ */
|
|
4740
|
+
return /* @__PURE__ */ jsxs14("span", { class: `${p15}-typing`, "aria-hidden": "true", children: [
|
|
4741
|
+
/* @__PURE__ */ jsx17("span", {}),
|
|
4742
|
+
/* @__PURE__ */ jsx17("span", {}),
|
|
4743
|
+
/* @__PURE__ */ jsx17("span", {})
|
|
4655
4744
|
] });
|
|
4656
4745
|
}
|
|
4657
4746
|
function LoadingSpinner({ label }) {
|
|
4658
|
-
return /* @__PURE__ */
|
|
4659
|
-
/* @__PURE__ */
|
|
4660
|
-
/* @__PURE__ */
|
|
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 })
|
|
4661
4750
|
] });
|
|
4662
4751
|
}
|
|
4663
4752
|
|
|
4664
4753
|
// src/ui/message-list.tsx
|
|
4665
|
-
import { jsx as
|
|
4666
|
-
var
|
|
4754
|
+
import { jsx as jsx18, jsxs as jsxs15 } from "preact/jsx-runtime";
|
|
4755
|
+
var p16 = BRAND.cssPrefix;
|
|
4667
4756
|
var STICK_THRESHOLD = 120;
|
|
4668
4757
|
var DIVIDER_IDLE_MS = 1200;
|
|
4669
4758
|
function MessageList({
|
|
@@ -4674,7 +4763,10 @@ function MessageList({
|
|
|
4674
4763
|
showToolCalls,
|
|
4675
4764
|
loading,
|
|
4676
4765
|
idle,
|
|
4677
|
-
tool
|
|
4766
|
+
tool,
|
|
4767
|
+
inlineForm,
|
|
4768
|
+
onFormSubmit,
|
|
4769
|
+
onFormSkip
|
|
4678
4770
|
}) {
|
|
4679
4771
|
const ref = useRef5(null);
|
|
4680
4772
|
const messages = useComputed5(() => messagesSig.value);
|
|
@@ -4759,12 +4851,12 @@ function MessageList({
|
|
|
4759
4851
|
const day = dayKey(m.createdAt);
|
|
4760
4852
|
if (day && day !== prevDay) {
|
|
4761
4853
|
rows.push(
|
|
4762
|
-
/* @__PURE__ */
|
|
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}`)
|
|
4763
4855
|
);
|
|
4764
4856
|
prevDay = day;
|
|
4765
4857
|
}
|
|
4766
4858
|
rows.push(
|
|
4767
|
-
/* @__PURE__ */
|
|
4859
|
+
/* @__PURE__ */ jsx18(
|
|
4768
4860
|
MessageBubble,
|
|
4769
4861
|
{
|
|
4770
4862
|
message: m,
|
|
@@ -4779,32 +4871,33 @@ function MessageList({
|
|
|
4779
4871
|
)
|
|
4780
4872
|
);
|
|
4781
4873
|
}
|
|
4782
|
-
return /* @__PURE__ */
|
|
4783
|
-
/* @__PURE__ */
|
|
4874
|
+
return /* @__PURE__ */ jsxs15("div", { class: `${p16}-list-wrap`, children: [
|
|
4875
|
+
/* @__PURE__ */ jsxs15(
|
|
4784
4876
|
"div",
|
|
4785
4877
|
{
|
|
4786
4878
|
ref,
|
|
4787
|
-
class: `${
|
|
4879
|
+
class: `${p16}-list`,
|
|
4788
4880
|
role: "log",
|
|
4789
4881
|
"aria-live": "polite",
|
|
4790
4882
|
"aria-relevant": "additions text",
|
|
4791
4883
|
"data-scrolling": scrolling ? "true" : void 0,
|
|
4792
4884
|
children: [
|
|
4793
|
-
loading && messages.value.length === 0 ? /* @__PURE__ */
|
|
4794
|
-
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
|
|
4795
4888
|
]
|
|
4796
4889
|
}
|
|
4797
4890
|
),
|
|
4798
|
-
showJump ? /* @__PURE__ */
|
|
4891
|
+
showJump ? /* @__PURE__ */ jsx18(
|
|
4799
4892
|
"button",
|
|
4800
4893
|
{
|
|
4801
4894
|
type: "button",
|
|
4802
|
-
class: `${
|
|
4895
|
+
class: `${p16}-jump`,
|
|
4803
4896
|
onClick: jumpToBottom,
|
|
4804
4897
|
"aria-label": strings.scrollToBottom,
|
|
4805
4898
|
title: strings.scrollToBottom,
|
|
4806
4899
|
"data-testid": TID.scrollToBottom,
|
|
4807
|
-
children: /* @__PURE__ */
|
|
4900
|
+
children: /* @__PURE__ */ jsx18(ChevronDownIcon, {})
|
|
4808
4901
|
}
|
|
4809
4902
|
) : null
|
|
4810
4903
|
] });
|
|
@@ -4863,7 +4956,7 @@ function startOfDay(ms) {
|
|
|
4863
4956
|
}
|
|
4864
4957
|
|
|
4865
4958
|
// src/ui/conversation-list.tsx
|
|
4866
|
-
import { Fragment as Fragment2, jsx as
|
|
4959
|
+
import { Fragment as Fragment2, jsx as jsx19, jsxs as jsxs16 } from "preact/jsx-runtime";
|
|
4867
4960
|
var log11 = logger.scope("history");
|
|
4868
4961
|
var BUCKET_TO_STRING = {
|
|
4869
4962
|
today: "dateToday",
|
|
@@ -4872,7 +4965,7 @@ var BUCKET_TO_STRING = {
|
|
|
4872
4965
|
older: "dateOlder"
|
|
4873
4966
|
};
|
|
4874
4967
|
function ConversationList({ transport, strings, visitorId, onSelect, onNewChat }) {
|
|
4875
|
-
const
|
|
4968
|
+
const p34 = BRAND.cssPrefix;
|
|
4876
4969
|
const [state, setState] = useState7("loading");
|
|
4877
4970
|
const [sessions, setChats] = useState7([]);
|
|
4878
4971
|
useEffect9(() => {
|
|
@@ -4890,38 +4983,38 @@ function ConversationList({ transport, strings, visitorId, onSelect, onNewChat }
|
|
|
4890
4983
|
cancelled = true;
|
|
4891
4984
|
};
|
|
4892
4985
|
}, [transport, visitorId]);
|
|
4893
|
-
const newChatButton = onNewChat ? /* @__PURE__ */
|
|
4894
|
-
/* @__PURE__ */
|
|
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, {}),
|
|
4895
4988
|
strings.historyNewChat
|
|
4896
4989
|
] }) }) : null;
|
|
4897
4990
|
if (state === "loading") {
|
|
4898
|
-
return /* @__PURE__ */
|
|
4899
|
-
/* @__PURE__ */
|
|
4991
|
+
return /* @__PURE__ */ jsxs16(Fragment2, { children: [
|
|
4992
|
+
/* @__PURE__ */ jsx19("div", { class: `${p34}-history-empty`, children: strings.historyLoading }),
|
|
4900
4993
|
newChatButton
|
|
4901
4994
|
] });
|
|
4902
4995
|
}
|
|
4903
4996
|
if (state === "error" || sessions.length === 0) {
|
|
4904
|
-
return /* @__PURE__ */
|
|
4905
|
-
/* @__PURE__ */
|
|
4997
|
+
return /* @__PURE__ */ jsxs16(Fragment2, { children: [
|
|
4998
|
+
/* @__PURE__ */ jsx19("div", { class: `${p34}-history-empty`, children: strings.historyEmpty }),
|
|
4906
4999
|
newChatButton
|
|
4907
5000
|
] });
|
|
4908
5001
|
}
|
|
4909
5002
|
const groups = groupByBucket(Date.now(), sessions);
|
|
4910
|
-
return /* @__PURE__ */
|
|
4911
|
-
/* @__PURE__ */
|
|
4912
|
-
/* @__PURE__ */
|
|
4913
|
-
group.sessions.map((chat) => /* @__PURE__ */
|
|
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(
|
|
4914
5007
|
"button",
|
|
4915
5008
|
{
|
|
4916
5009
|
type: "button",
|
|
4917
5010
|
role: "listitem",
|
|
4918
|
-
class: `${
|
|
5011
|
+
class: `${p34}-history-item`,
|
|
4919
5012
|
onClick: () => onSelect(chat),
|
|
4920
5013
|
"data-closed": chat.canContinue ? void 0 : "true",
|
|
4921
5014
|
"data-testid": tid(TID.historyItem, chat.sessionId),
|
|
4922
5015
|
children: [
|
|
4923
|
-
/* @__PURE__ */
|
|
4924
|
-
chat.preview ? /* @__PURE__ */
|
|
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
|
|
4925
5018
|
]
|
|
4926
5019
|
},
|
|
4927
5020
|
chat.sessionId
|
|
@@ -4932,21 +5025,21 @@ function ConversationList({ transport, strings, visitorId, onSelect, onNewChat }
|
|
|
4932
5025
|
}
|
|
4933
5026
|
|
|
4934
5027
|
// src/ui/chat-history-pane.tsx
|
|
4935
|
-
import { jsx as
|
|
5028
|
+
import { jsx as jsx20 } from "preact/jsx-runtime";
|
|
4936
5029
|
function ChatHistoryPane(props2) {
|
|
4937
|
-
return /* @__PURE__ */
|
|
5030
|
+
return /* @__PURE__ */ jsx20(ConversationList, { ...props2 });
|
|
4938
5031
|
}
|
|
4939
5032
|
|
|
4940
5033
|
// src/ui/suggestions.tsx
|
|
4941
|
-
import { jsx as
|
|
4942
|
-
var
|
|
5034
|
+
import { jsx as jsx21 } from "preact/jsx-runtime";
|
|
5035
|
+
var p17 = BRAND.cssPrefix;
|
|
4943
5036
|
function Suggestions({ suggestions, onPick }) {
|
|
4944
5037
|
if (suggestions.length === 0) return null;
|
|
4945
|
-
return /* @__PURE__ */
|
|
5038
|
+
return /* @__PURE__ */ jsx21("div", { class: `${p17}-suggestions`, role: "group", "aria-label": "Suggested replies", children: suggestions.map((s, i) => /* @__PURE__ */ jsx21(
|
|
4946
5039
|
"button",
|
|
4947
5040
|
{
|
|
4948
5041
|
type: "button",
|
|
4949
|
-
class: `${
|
|
5042
|
+
class: `${p17}-suggestion`,
|
|
4950
5043
|
onClick: () => onPick(s),
|
|
4951
5044
|
"data-testid": tid(TID.suggestion, i),
|
|
4952
5045
|
children: s.label
|
|
@@ -4956,8 +5049,8 @@ function Suggestions({ suggestions, onPick }) {
|
|
|
4956
5049
|
}
|
|
4957
5050
|
|
|
4958
5051
|
// src/ui/panel.tsx
|
|
4959
|
-
import { Fragment as Fragment3, jsx as
|
|
4960
|
-
var
|
|
5052
|
+
import { Fragment as Fragment3, jsx as jsx22, jsxs as jsxs17 } from "preact/jsx-runtime";
|
|
5053
|
+
var p18 = BRAND.cssPrefix;
|
|
4961
5054
|
function Panel(props2) {
|
|
4962
5055
|
const { options, onClose } = props2;
|
|
4963
5056
|
const s = options.strings;
|
|
@@ -4981,18 +5074,18 @@ function Panel(props2) {
|
|
|
4981
5074
|
}, []);
|
|
4982
5075
|
const { visible: dragOver } = useFileDrop({ containerRef, onDrop: onDropItems });
|
|
4983
5076
|
useDragMove(containerRef.current, options.mode === "modal");
|
|
4984
|
-
return /* @__PURE__ */
|
|
5077
|
+
return /* @__PURE__ */ jsxs17(
|
|
4985
5078
|
"div",
|
|
4986
5079
|
{
|
|
4987
5080
|
ref: containerRef,
|
|
4988
|
-
class: `${
|
|
5081
|
+
class: `${p18}-panel`,
|
|
4989
5082
|
role: "dialog",
|
|
4990
5083
|
"aria-modal": "false",
|
|
4991
5084
|
"aria-label": s.panelTitle,
|
|
4992
5085
|
style: { position: "relative" },
|
|
4993
5086
|
"data-testid": TID.panel,
|
|
4994
5087
|
children: [
|
|
4995
|
-
/* @__PURE__ */
|
|
5088
|
+
/* @__PURE__ */ jsx22(
|
|
4996
5089
|
PanelContent,
|
|
4997
5090
|
{
|
|
4998
5091
|
...props2,
|
|
@@ -5001,7 +5094,7 @@ function Panel(props2) {
|
|
|
5001
5094
|
composerAttachApiRef
|
|
5002
5095
|
}
|
|
5003
5096
|
),
|
|
5004
|
-
/* @__PURE__ */
|
|
5097
|
+
/* @__PURE__ */ jsx22(PoweredByBar, { poweredBy: props2.options.poweredBy })
|
|
5005
5098
|
]
|
|
5006
5099
|
}
|
|
5007
5100
|
);
|
|
@@ -5032,8 +5125,10 @@ function PanelContent(props2) {
|
|
|
5032
5125
|
onSend,
|
|
5033
5126
|
onStop,
|
|
5034
5127
|
onSuggestion,
|
|
5035
|
-
|
|
5036
|
-
|
|
5128
|
+
blockingForm,
|
|
5129
|
+
inlineForm,
|
|
5130
|
+
onFormSubmit,
|
|
5131
|
+
onFormSkip,
|
|
5037
5132
|
tool,
|
|
5038
5133
|
containerEl,
|
|
5039
5134
|
dragOver,
|
|
@@ -5041,12 +5136,12 @@ function PanelContent(props2) {
|
|
|
5041
5136
|
} = props2;
|
|
5042
5137
|
const s = options.strings;
|
|
5043
5138
|
let composerArea;
|
|
5044
|
-
if (
|
|
5045
|
-
composerArea = /* @__PURE__ */
|
|
5139
|
+
if (blockingForm) {
|
|
5140
|
+
composerArea = /* @__PURE__ */ jsx22(FormGate, { form: blockingForm, strings: s, onSubmit: onFormSubmit, onSkip: onFormSkip });
|
|
5046
5141
|
} else if (canSend) {
|
|
5047
|
-
composerArea = /* @__PURE__ */
|
|
5048
|
-
/* @__PURE__ */
|
|
5049
|
-
/* @__PURE__ */
|
|
5142
|
+
composerArea = /* @__PURE__ */ jsxs17(Fragment3, { children: [
|
|
5143
|
+
/* @__PURE__ */ jsx22(Suggestions, { suggestions, onPick: onSuggestion }),
|
|
5144
|
+
/* @__PURE__ */ jsx22(
|
|
5050
5145
|
Composer,
|
|
5051
5146
|
{
|
|
5052
5147
|
options,
|
|
@@ -5061,10 +5156,10 @@ function PanelContent(props2) {
|
|
|
5061
5156
|
)
|
|
5062
5157
|
] });
|
|
5063
5158
|
} else {
|
|
5064
|
-
composerArea = /* @__PURE__ */
|
|
5159
|
+
composerArea = /* @__PURE__ */ jsx22(ReadOnlyBanner, { label: s.chatClosed, ctaLabel: s.startNewConversation, onNewChat: onClear });
|
|
5065
5160
|
}
|
|
5066
|
-
return /* @__PURE__ */
|
|
5067
|
-
view === "history" ? /* @__PURE__ */
|
|
5161
|
+
return /* @__PURE__ */ jsxs17(Fragment3, { children: [
|
|
5162
|
+
view === "history" ? /* @__PURE__ */ jsx22(
|
|
5068
5163
|
HistoryHeader,
|
|
5069
5164
|
{
|
|
5070
5165
|
strings: s,
|
|
@@ -5072,22 +5167,22 @@ function PanelContent(props2) {
|
|
|
5072
5167
|
onClose,
|
|
5073
5168
|
showClose: canShowClose(options.mode, panelSize, options.actions)
|
|
5074
5169
|
}
|
|
5075
|
-
) : /* @__PURE__ */
|
|
5076
|
-
onBack ? /* @__PURE__ */
|
|
5170
|
+
) : /* @__PURE__ */ jsxs17("header", { class: `${p18}-header`, "data-testid": TID.panelHeader, children: [
|
|
5171
|
+
onBack ? /* @__PURE__ */ jsx22(
|
|
5077
5172
|
"button",
|
|
5078
5173
|
{
|
|
5079
5174
|
type: "button",
|
|
5080
|
-
class: `${
|
|
5175
|
+
class: `${p18}-icon-btn`,
|
|
5081
5176
|
onClick: onBack,
|
|
5082
5177
|
"aria-label": s.moduleBack,
|
|
5083
5178
|
title: s.moduleBack,
|
|
5084
|
-
children: /* @__PURE__ */
|
|
5179
|
+
children: /* @__PURE__ */ jsx22(BackIcon, {})
|
|
5085
5180
|
}
|
|
5086
5181
|
) : null,
|
|
5087
|
-
agent ? /* @__PURE__ */
|
|
5088
|
-
/* @__PURE__ */
|
|
5182
|
+
agent ? /* @__PURE__ */ jsx22(AgentBadge, { agent }) : /* @__PURE__ */ jsx22("h1", { children: s.panelTitle }),
|
|
5183
|
+
/* @__PURE__ */ jsx22(HeaderActions, { panelProps: props2, variant: "chat" })
|
|
5089
5184
|
] }),
|
|
5090
|
-
view === "history" ? /* @__PURE__ */
|
|
5185
|
+
view === "history" ? /* @__PURE__ */ jsx22(
|
|
5091
5186
|
ChatHistoryPane,
|
|
5092
5187
|
{
|
|
5093
5188
|
transport,
|
|
@@ -5096,9 +5191,9 @@ function PanelContent(props2) {
|
|
|
5096
5191
|
onSelect: (chat) => onSelectHistoryChat(chat.sessionId),
|
|
5097
5192
|
onNewChat
|
|
5098
5193
|
}
|
|
5099
|
-
) : /* @__PURE__ */
|
|
5100
|
-
/* @__PURE__ */
|
|
5101
|
-
/* @__PURE__ */
|
|
5194
|
+
) : /* @__PURE__ */ jsxs17(Fragment3, { children: [
|
|
5195
|
+
/* @__PURE__ */ jsx22(DropZone, { visible: dragOver, strings: s }),
|
|
5196
|
+
/* @__PURE__ */ jsx22(
|
|
5102
5197
|
MessageList,
|
|
5103
5198
|
{
|
|
5104
5199
|
messagesSig,
|
|
@@ -5108,13 +5203,16 @@ function PanelContent(props2) {
|
|
|
5108
5203
|
showToolCalls: options.showToolCalls,
|
|
5109
5204
|
loading: loadingMessages,
|
|
5110
5205
|
idle: !isStreaming,
|
|
5111
|
-
tool
|
|
5206
|
+
tool,
|
|
5207
|
+
inlineForm,
|
|
5208
|
+
onFormSubmit,
|
|
5209
|
+
onFormSkip
|
|
5112
5210
|
}
|
|
5113
5211
|
),
|
|
5114
5212
|
composerArea,
|
|
5115
|
-
/* @__PURE__ */
|
|
5213
|
+
/* @__PURE__ */ jsx22(ComposerFooter, { disclaimer: options.composerDisclaimer })
|
|
5116
5214
|
] }),
|
|
5117
|
-
options.size.resize?.enabled ? /* @__PURE__ */
|
|
5215
|
+
options.size.resize?.enabled ? /* @__PURE__ */ jsx22(
|
|
5118
5216
|
ResizeGrip,
|
|
5119
5217
|
{
|
|
5120
5218
|
panelEl: containerEl,
|
|
@@ -5133,86 +5231,157 @@ function HistoryHeader({
|
|
|
5133
5231
|
onClose,
|
|
5134
5232
|
showClose
|
|
5135
5233
|
}) {
|
|
5136
|
-
return /* @__PURE__ */
|
|
5137
|
-
/* @__PURE__ */
|
|
5234
|
+
return /* @__PURE__ */ jsxs17("header", { class: `${p18}-header`, children: [
|
|
5235
|
+
/* @__PURE__ */ jsx22(
|
|
5138
5236
|
"button",
|
|
5139
5237
|
{
|
|
5140
5238
|
type: "button",
|
|
5141
|
-
class: `${
|
|
5239
|
+
class: `${p18}-icon-btn`,
|
|
5142
5240
|
onClick: onBack,
|
|
5143
5241
|
"aria-label": strings.historyBack,
|
|
5144
5242
|
title: strings.historyBack,
|
|
5145
|
-
children: /* @__PURE__ */
|
|
5243
|
+
children: /* @__PURE__ */ jsx22(BackIcon, {})
|
|
5146
5244
|
}
|
|
5147
5245
|
),
|
|
5148
|
-
/* @__PURE__ */
|
|
5149
|
-
showClose ? /* @__PURE__ */
|
|
5246
|
+
/* @__PURE__ */ jsx22("h1", { children: strings.historyTitle }),
|
|
5247
|
+
showClose ? /* @__PURE__ */ jsx22(
|
|
5150
5248
|
"button",
|
|
5151
5249
|
{
|
|
5152
5250
|
type: "button",
|
|
5153
|
-
class: `${
|
|
5251
|
+
class: `${p18}-icon-btn`,
|
|
5154
5252
|
onClick: onClose,
|
|
5155
5253
|
"aria-label": strings.close,
|
|
5156
5254
|
title: strings.close,
|
|
5157
|
-
children: /* @__PURE__ */
|
|
5255
|
+
children: /* @__PURE__ */ jsx22(CloseIcon, {})
|
|
5158
5256
|
}
|
|
5159
5257
|
) : null
|
|
5160
5258
|
] });
|
|
5161
5259
|
}
|
|
5162
5260
|
function ReadOnlyBanner({ label, ctaLabel, onNewChat }) {
|
|
5163
|
-
return /* @__PURE__ */
|
|
5164
|
-
/* @__PURE__ */
|
|
5165
|
-
/* @__PURE__ */
|
|
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 })
|
|
5166
5264
|
] });
|
|
5167
5265
|
}
|
|
5168
5266
|
function ComposerFooter({ disclaimer }) {
|
|
5169
5267
|
if (!disclaimer) return null;
|
|
5170
|
-
return /* @__PURE__ */
|
|
5268
|
+
return /* @__PURE__ */ jsx22("div", { class: `${p18}-composer-footer`, children: /* @__PURE__ */ jsx22("div", { class: `${p18}-disclaimer`, children: disclaimer }) });
|
|
5171
5269
|
}
|
|
5172
5270
|
function PoweredByBar({ poweredBy }) {
|
|
5173
5271
|
if (!poweredBy) return null;
|
|
5174
|
-
return /* @__PURE__ */
|
|
5272
|
+
return /* @__PURE__ */ jsx22("div", { class: `${p18}-poweredby-bar`, children: /* @__PURE__ */ jsx22(PoweredBy, { logoUrl: poweredBy.logoUrl, text: poweredBy.text, href: poweredBy.href }) });
|
|
5175
5273
|
}
|
|
5176
5274
|
function PoweredBy({ logoUrl, text, href }) {
|
|
5177
|
-
const inner = /* @__PURE__ */
|
|
5178
|
-
logoUrl ? /* @__PURE__ */
|
|
5179
|
-
text ? /* @__PURE__ */
|
|
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
|
|
5180
5278
|
] });
|
|
5181
5279
|
if (href) {
|
|
5182
|
-
return /* @__PURE__ */
|
|
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;
|
|
5183
5349
|
}
|
|
5184
|
-
|
|
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;
|
|
5185
5354
|
}
|
|
5186
5355
|
|
|
5187
5356
|
// src/ui/sidebar.tsx
|
|
5188
|
-
import { Fragment as Fragment4, jsx as
|
|
5357
|
+
import { Fragment as Fragment4, jsx as jsx23, jsxs as jsxs18 } from "preact/jsx-runtime";
|
|
5189
5358
|
function Sidebar(props2) {
|
|
5190
|
-
const
|
|
5359
|
+
const p34 = BRAND.cssPrefix;
|
|
5191
5360
|
const { site, blocks, strings, collapsed } = props2;
|
|
5192
5361
|
const navigation = blocks?.navigation ?? [];
|
|
5193
5362
|
const linkCards = blocks?.linkCards ?? [];
|
|
5194
5363
|
const toggleLabel = collapsed ? strings.expandSidebar : strings.collapseSidebar;
|
|
5195
|
-
return /* @__PURE__ */
|
|
5196
|
-
/* @__PURE__ */
|
|
5197
|
-
/* @__PURE__ */
|
|
5198
|
-
/* @__PURE__ */
|
|
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(
|
|
5199
5368
|
"button",
|
|
5200
5369
|
{
|
|
5201
5370
|
type: "button",
|
|
5202
|
-
class: `${
|
|
5371
|
+
class: `${p34}-sidebar-toggle`,
|
|
5203
5372
|
"aria-label": toggleLabel,
|
|
5204
5373
|
"aria-expanded": collapsed ? "false" : "true",
|
|
5205
5374
|
title: toggleLabel,
|
|
5206
5375
|
onClick: props2.onToggleCollapsed,
|
|
5207
5376
|
"data-testid": TID.sidebarToggle,
|
|
5208
|
-
children: /* @__PURE__ */
|
|
5377
|
+
children: /* @__PURE__ */ jsx23(SidebarToggleIcon, { collapsed })
|
|
5209
5378
|
}
|
|
5210
5379
|
)
|
|
5211
5380
|
] }),
|
|
5212
|
-
collapsed ? null : /* @__PURE__ */
|
|
5213
|
-
navigation.length > 0 ? /* @__PURE__ */
|
|
5214
|
-
linkCards.length > 0 ? /* @__PURE__ */
|
|
5215
|
-
props2.showConversations ? /* @__PURE__ */
|
|
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(
|
|
5216
5385
|
ConversationList,
|
|
5217
5386
|
{
|
|
5218
5387
|
transport: props2.transport,
|
|
@@ -5226,18 +5395,18 @@ function Sidebar(props2) {
|
|
|
5226
5395
|
] });
|
|
5227
5396
|
}
|
|
5228
5397
|
function SidebarBrand({ site }) {
|
|
5229
|
-
const
|
|
5398
|
+
const p34 = BRAND.cssPrefix;
|
|
5230
5399
|
if (site?.logo?.url) {
|
|
5231
5400
|
const alt = site.logo.alt ?? site.title ?? "Logo";
|
|
5232
|
-
return /* @__PURE__ */
|
|
5233
|
-
site.logoDark?.url ? /* @__PURE__ */
|
|
5234
|
-
/* @__PURE__ */
|
|
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 })
|
|
5235
5404
|
] });
|
|
5236
5405
|
}
|
|
5237
|
-
return /* @__PURE__ */
|
|
5406
|
+
return /* @__PURE__ */ jsx23("div", { class: `${p34}-sidebar-title`, children: site?.title ?? BRAND.name });
|
|
5238
5407
|
}
|
|
5239
5408
|
function SidebarToggleIcon({ collapsed }) {
|
|
5240
|
-
return /* @__PURE__ */
|
|
5409
|
+
return /* @__PURE__ */ jsx23(
|
|
5241
5410
|
"svg",
|
|
5242
5411
|
{
|
|
5243
5412
|
width: "16",
|
|
@@ -5247,38 +5416,38 @@ function SidebarToggleIcon({ collapsed }) {
|
|
|
5247
5416
|
stroke: "currentColor",
|
|
5248
5417
|
"stroke-width": "2",
|
|
5249
5418
|
"aria-hidden": "true",
|
|
5250
|
-
children: collapsed ? /* @__PURE__ */
|
|
5419
|
+
children: collapsed ? /* @__PURE__ */ jsx23("polyline", { points: "9 6 15 12 9 18" }) : /* @__PURE__ */ jsx23("polyline", { points: "15 6 9 12 15 18" })
|
|
5251
5420
|
}
|
|
5252
5421
|
);
|
|
5253
5422
|
}
|
|
5254
5423
|
function SidebarNav({ items }) {
|
|
5255
|
-
const
|
|
5256
|
-
return /* @__PURE__ */
|
|
5424
|
+
const p34 = BRAND.cssPrefix;
|
|
5425
|
+
return /* @__PURE__ */ jsx23("ul", { class: `${p34}-sidebar-nav`, children: items.map((item) => /* @__PURE__ */ jsx23("li", { children: /* @__PURE__ */ jsxs18(
|
|
5257
5426
|
"a",
|
|
5258
5427
|
{
|
|
5259
|
-
class: `${
|
|
5428
|
+
class: `${p34}-sidebar-nav-item`,
|
|
5260
5429
|
href: item.href,
|
|
5261
5430
|
target: item.href ? "_blank" : void 0,
|
|
5262
5431
|
rel: item.href ? "noreferrer" : void 0,
|
|
5263
5432
|
children: [
|
|
5264
|
-
item.icon ? /* @__PURE__ */
|
|
5265
|
-
/* @__PURE__ */
|
|
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 })
|
|
5266
5435
|
]
|
|
5267
5436
|
}
|
|
5268
5437
|
) }, item.id ?? item.label)) });
|
|
5269
5438
|
}
|
|
5270
5439
|
function SidebarCards({ items }) {
|
|
5271
|
-
const
|
|
5272
|
-
return /* @__PURE__ */
|
|
5440
|
+
const p34 = BRAND.cssPrefix;
|
|
5441
|
+
return /* @__PURE__ */ jsx23("div", { class: `${p34}-sidebar-cards`, children: items.map((item) => /* @__PURE__ */ jsxs18(
|
|
5273
5442
|
"a",
|
|
5274
5443
|
{
|
|
5275
|
-
class: `${
|
|
5444
|
+
class: `${p34}-sidebar-card`,
|
|
5276
5445
|
href: item.href,
|
|
5277
5446
|
target: item.href ? "_blank" : void 0,
|
|
5278
5447
|
rel: item.href ? "noreferrer" : void 0,
|
|
5279
5448
|
children: [
|
|
5280
|
-
/* @__PURE__ */
|
|
5281
|
-
item.description ? /* @__PURE__ */
|
|
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
|
|
5282
5451
|
]
|
|
5283
5452
|
},
|
|
5284
5453
|
item.id ?? item.label
|
|
@@ -5286,11 +5455,11 @@ function SidebarCards({ items }) {
|
|
|
5286
5455
|
}
|
|
5287
5456
|
|
|
5288
5457
|
// src/ui/page-shell.tsx
|
|
5289
|
-
import { jsx as
|
|
5290
|
-
var
|
|
5458
|
+
import { jsx as jsx24, jsxs as jsxs19 } from "preact/jsx-runtime";
|
|
5459
|
+
var p19 = BRAND.cssPrefix;
|
|
5291
5460
|
function PageShell(props2) {
|
|
5292
|
-
return /* @__PURE__ */
|
|
5293
|
-
/* @__PURE__ */
|
|
5461
|
+
return /* @__PURE__ */ jsxs19("main", { class: `${p19}-page-shell`, "data-sidebar-collapsed": props2.sidebarCollapsed ? "true" : "false", children: [
|
|
5462
|
+
/* @__PURE__ */ jsx24(
|
|
5294
5463
|
Sidebar,
|
|
5295
5464
|
{
|
|
5296
5465
|
site: props2.site,
|
|
@@ -5305,15 +5474,15 @@ function PageShell(props2) {
|
|
|
5305
5474
|
onToggleCollapsed: props2.onToggleSidebarCollapsed
|
|
5306
5475
|
}
|
|
5307
5476
|
),
|
|
5308
|
-
/* @__PURE__ */
|
|
5477
|
+
/* @__PURE__ */ jsx24("section", { class: `${p19}-page-chat`, "aria-label": "Chat", children: props2.children })
|
|
5309
5478
|
] });
|
|
5310
5479
|
}
|
|
5311
5480
|
|
|
5312
5481
|
// src/ui/home-nav.ts
|
|
5313
|
-
import { signal as
|
|
5482
|
+
import { signal as signal6 } from "@preact/signals";
|
|
5314
5483
|
var emptyStacks = (tabs) => Object.fromEntries(tabs.map((t) => [t, []]));
|
|
5315
5484
|
function createHomeNav(initialTab, tabs, onSwitch) {
|
|
5316
|
-
const sig =
|
|
5485
|
+
const sig = signal6({ activeTab: initialTab, stacks: emptyStacks(tabs) });
|
|
5317
5486
|
return {
|
|
5318
5487
|
sig,
|
|
5319
5488
|
switchTab(tab) {
|
|
@@ -5342,7 +5511,7 @@ var topScreen = (s) => activeStack(s).at(-1);
|
|
|
5342
5511
|
var atTabRoot = (s) => activeStack(s).length === 0;
|
|
5343
5512
|
|
|
5344
5513
|
// src/ui/messenger-home.tsx
|
|
5345
|
-
import { useCallback as useCallback4, useEffect as useEffect15, useRef as
|
|
5514
|
+
import { useCallback as useCallback4, useEffect as useEffect15, useRef as useRef8 } from "preact/hooks";
|
|
5346
5515
|
import { useComputed as useComputed6 } from "@preact/signals";
|
|
5347
5516
|
|
|
5348
5517
|
// src/ui/modules/messages.tsx
|
|
@@ -5355,80 +5524,80 @@ var chatLayout = {
|
|
|
5355
5524
|
import { useEffect as useEffect11, useMemo as useMemo2, useState as useState8 } from "preact/hooks";
|
|
5356
5525
|
|
|
5357
5526
|
// src/ui/back-header.tsx
|
|
5358
|
-
import { jsx as
|
|
5359
|
-
var
|
|
5527
|
+
import { jsx as jsx25, jsxs as jsxs20 } from "preact/jsx-runtime";
|
|
5528
|
+
var p20 = BRAND.cssPrefix;
|
|
5360
5529
|
function TitleBar({ title, actions }) {
|
|
5361
|
-
return /* @__PURE__ */
|
|
5362
|
-
/* @__PURE__ */
|
|
5363
|
-
/* @__PURE__ */
|
|
5364
|
-
actions ?? /* @__PURE__ */
|
|
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" })
|
|
5365
5534
|
] });
|
|
5366
5535
|
}
|
|
5367
5536
|
function BackHeader({ title, backLabel, onBack, actions, testid }) {
|
|
5368
|
-
return /* @__PURE__ */
|
|
5369
|
-
/* @__PURE__ */
|
|
5370
|
-
/* @__PURE__ */
|
|
5371
|
-
actions ?? /* @__PURE__ */
|
|
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" })
|
|
5372
5541
|
] });
|
|
5373
5542
|
}
|
|
5374
5543
|
|
|
5375
5544
|
// src/ui/home-search.tsx
|
|
5376
|
-
import { jsx as
|
|
5377
|
-
var
|
|
5545
|
+
import { jsx as jsx26, jsxs as jsxs21 } from "preact/jsx-runtime";
|
|
5546
|
+
var p21 = BRAND.cssPrefix;
|
|
5378
5547
|
function HomeSearchButton({ placeholder, onActivate }) {
|
|
5379
|
-
return /* @__PURE__ */
|
|
5380
|
-
/* @__PURE__ */
|
|
5381
|
-
/* @__PURE__ */
|
|
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, {}) })
|
|
5382
5551
|
] });
|
|
5383
5552
|
}
|
|
5384
5553
|
function HelpSearchInput({ placeholder, value, onInput }) {
|
|
5385
|
-
return /* @__PURE__ */
|
|
5386
|
-
/* @__PURE__ */
|
|
5554
|
+
return /* @__PURE__ */ jsxs21("div", { class: `${p21}-home-search`, "data-input": "true", children: [
|
|
5555
|
+
/* @__PURE__ */ jsx26(
|
|
5387
5556
|
"input",
|
|
5388
5557
|
{
|
|
5389
5558
|
type: "search",
|
|
5390
|
-
class: `${
|
|
5559
|
+
class: `${p21}-home-search-input`,
|
|
5391
5560
|
placeholder,
|
|
5392
5561
|
value,
|
|
5393
5562
|
onInput: (e) => onInput(e.currentTarget.value),
|
|
5394
5563
|
"data-testid": TID.helpSearch
|
|
5395
5564
|
}
|
|
5396
5565
|
),
|
|
5397
|
-
/* @__PURE__ */
|
|
5566
|
+
/* @__PURE__ */ jsx26("span", { class: `${p21}-home-search-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx26(SearchIcon, {}) })
|
|
5398
5567
|
] });
|
|
5399
5568
|
}
|
|
5400
5569
|
|
|
5401
5570
|
// src/ui/list-row.tsx
|
|
5402
|
-
import { jsx as
|
|
5403
|
-
var
|
|
5571
|
+
import { jsx as jsx27, jsxs as jsxs22 } from "preact/jsx-runtime";
|
|
5572
|
+
var p22 = BRAND.cssPrefix;
|
|
5404
5573
|
function ListRow({ title, subtitle, onClick, testid }) {
|
|
5405
|
-
return /* @__PURE__ */
|
|
5406
|
-
/* @__PURE__ */
|
|
5407
|
-
/* @__PURE__ */
|
|
5408
|
-
subtitle ? /* @__PURE__ */
|
|
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
|
|
5409
5578
|
] }),
|
|
5410
|
-
/* @__PURE__ */
|
|
5579
|
+
/* @__PURE__ */ jsx27("span", { class: `${p22}-list-row-chevron`, "aria-hidden": "true", children: /* @__PURE__ */ jsx27(ChevronRightIcon, {}) })
|
|
5411
5580
|
] });
|
|
5412
5581
|
}
|
|
5413
5582
|
|
|
5414
5583
|
// src/ui/module-state.tsx
|
|
5415
|
-
import { jsx as
|
|
5416
|
-
var
|
|
5584
|
+
import { jsx as jsx28, jsxs as jsxs23 } from "preact/jsx-runtime";
|
|
5585
|
+
var p23 = BRAND.cssPrefix;
|
|
5417
5586
|
function ModuleState({
|
|
5418
5587
|
tone = "info",
|
|
5419
5588
|
message,
|
|
5420
5589
|
onRetry,
|
|
5421
5590
|
strings
|
|
5422
5591
|
}) {
|
|
5423
|
-
return /* @__PURE__ */
|
|
5424
|
-
/* @__PURE__ */
|
|
5425
|
-
onRetry ? /* @__PURE__ */
|
|
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
|
|
5426
5595
|
] });
|
|
5427
5596
|
}
|
|
5428
5597
|
|
|
5429
5598
|
// src/ui/modules/help.tsx
|
|
5430
|
-
import { jsx as
|
|
5431
|
-
var
|
|
5599
|
+
import { jsx as jsx29, jsxs as jsxs24 } from "preact/jsx-runtime";
|
|
5600
|
+
var p24 = BRAND.cssPrefix;
|
|
5432
5601
|
var log12 = logger.scope("help");
|
|
5433
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 });
|
|
5434
5603
|
function groupByCategory(items) {
|
|
@@ -5457,7 +5626,7 @@ function fuzzySearch(items, query) {
|
|
|
5457
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);
|
|
5458
5627
|
}
|
|
5459
5628
|
function ArticleRow({ article, nav }) {
|
|
5460
|
-
return /* @__PURE__ */
|
|
5629
|
+
return /* @__PURE__ */ jsx29(
|
|
5461
5630
|
ListRow,
|
|
5462
5631
|
{
|
|
5463
5632
|
title: article.title,
|
|
@@ -5494,46 +5663,46 @@ function HelpRoot({ transport, strings, config, nav, panelProps }) {
|
|
|
5494
5663
|
const results = useMemo2(() => fuzzySearch(items, query), [items, query]);
|
|
5495
5664
|
function renderBody() {
|
|
5496
5665
|
if (query.trim().length > 0) {
|
|
5497
|
-
if (results.length === 0) return /* @__PURE__ */
|
|
5498
|
-
return /* @__PURE__ */
|
|
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)) });
|
|
5499
5668
|
}
|
|
5500
|
-
if (state === "loading") return /* @__PURE__ */
|
|
5669
|
+
if (state === "loading") return /* @__PURE__ */ jsx29(ModuleState, { message: strings.helpLoading, strings });
|
|
5501
5670
|
if (state === "error") {
|
|
5502
|
-
return /* @__PURE__ */
|
|
5671
|
+
return /* @__PURE__ */ jsx29(ModuleState, { tone: "error", message: errorMsg, onRetry: () => setReloadKey((k) => k + 1), strings });
|
|
5503
5672
|
}
|
|
5504
|
-
if (items.length === 0) return /* @__PURE__ */
|
|
5505
|
-
return groupByCategory(items).map(([category, rows]) => /* @__PURE__ */
|
|
5506
|
-
category ? /* @__PURE__ */
|
|
5507
|
-
/* @__PURE__ */
|
|
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)) })
|
|
5508
5677
|
] }, category));
|
|
5509
5678
|
}
|
|
5510
|
-
return /* @__PURE__ */
|
|
5511
|
-
/* @__PURE__ */
|
|
5512
|
-
/* @__PURE__ */
|
|
5513
|
-
/* @__PURE__ */
|
|
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() })
|
|
5514
5683
|
] });
|
|
5515
5684
|
}
|
|
5516
5685
|
var helpLayout = {
|
|
5517
5686
|
Icon: HelpIcon,
|
|
5518
|
-
Root: (props2) => /* @__PURE__ */
|
|
5687
|
+
Root: (props2) => /* @__PURE__ */ jsx29(HelpRoot, { ...props2 })
|
|
5519
5688
|
};
|
|
5520
5689
|
|
|
5521
5690
|
// src/ui/modules/home.tsx
|
|
5522
5691
|
import { useEffect as useEffect12, useState as useState9 } from "preact/hooks";
|
|
5523
5692
|
|
|
5524
5693
|
// src/ui/home-card.tsx
|
|
5525
|
-
import { jsx as
|
|
5526
|
-
var
|
|
5694
|
+
import { jsx as jsx30 } from "preact/jsx-runtime";
|
|
5695
|
+
var p25 = BRAND.cssPrefix;
|
|
5527
5696
|
function HomeCard({ onClick, children, testid }) {
|
|
5528
5697
|
if (onClick) {
|
|
5529
|
-
return /* @__PURE__ */
|
|
5698
|
+
return /* @__PURE__ */ jsx30("button", { type: "button", class: `${p25}-home-card`, "data-interactive": "true", onClick, "data-testid": testid, children });
|
|
5530
5699
|
}
|
|
5531
|
-
return /* @__PURE__ */
|
|
5700
|
+
return /* @__PURE__ */ jsx30("div", { class: `${p25}-home-card`, "data-testid": testid, children });
|
|
5532
5701
|
}
|
|
5533
5702
|
|
|
5534
5703
|
// src/ui/modules/home.tsx
|
|
5535
|
-
import { Fragment as Fragment5, jsx as
|
|
5536
|
-
var
|
|
5704
|
+
import { Fragment as Fragment5, jsx as jsx31, jsxs as jsxs25 } from "preact/jsx-runtime";
|
|
5705
|
+
var p26 = BRAND.cssPrefix;
|
|
5537
5706
|
var log13 = logger.scope("home");
|
|
5538
5707
|
function resolveGreeting(props2) {
|
|
5539
5708
|
const name = props2.options.userContext?.name;
|
|
@@ -5570,49 +5739,49 @@ function HomeRoot(props2) {
|
|
|
5570
5739
|
const avatars = config.userAvatars ?? [];
|
|
5571
5740
|
const status = config.status;
|
|
5572
5741
|
const contentTitle = config.contentBlockTitle ? moduleLabel(strings, config.contentBlockTitle) : strings.homeContentTitle;
|
|
5573
|
-
return /* @__PURE__ */
|
|
5574
|
-
/* @__PURE__ */
|
|
5575
|
-
/* @__PURE__ */
|
|
5576
|
-
config.brandName ? /* @__PURE__ */
|
|
5577
|
-
/* @__PURE__ */
|
|
5578
|
-
avatars.length > 0 ? /* @__PURE__ */
|
|
5579
|
-
/* @__PURE__ */
|
|
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" })
|
|
5580
5749
|
] })
|
|
5581
5750
|
] }),
|
|
5582
|
-
config.showGreeting !== false ? /* @__PURE__ */
|
|
5583
|
-
/* @__PURE__ */
|
|
5584
|
-
greeting.subtitle ? /* @__PURE__ */
|
|
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
|
|
5585
5754
|
] }) : null
|
|
5586
5755
|
] }),
|
|
5587
|
-
/* @__PURE__ */
|
|
5588
|
-
config.showSearchBar !== false ? /* @__PURE__ */
|
|
5756
|
+
/* @__PURE__ */ jsxs25("div", { class: `${p26}-home-cards`, children: [
|
|
5757
|
+
config.showSearchBar !== false ? /* @__PURE__ */ jsx31(
|
|
5589
5758
|
HomeSearchButton,
|
|
5590
5759
|
{
|
|
5591
5760
|
placeholder: strings.homeSearchPlaceholder,
|
|
5592
5761
|
onActivate: () => nav.switchToLayout("help")
|
|
5593
5762
|
}
|
|
5594
5763
|
) : null,
|
|
5595
|
-
recent ? /* @__PURE__ */
|
|
5596
|
-
/* @__PURE__ */
|
|
5597
|
-
/* @__PURE__ */
|
|
5598
|
-
/* @__PURE__ */
|
|
5599
|
-
recent.preview ? /* @__PURE__ */
|
|
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
|
|
5600
5769
|
] }),
|
|
5601
|
-
(recent.unreadCount ?? 0) > 0 ? /* @__PURE__ */
|
|
5770
|
+
(recent.unreadCount ?? 0) > 0 ? /* @__PURE__ */ jsx31("span", { class: `${p26}-home-recent-dot`, "aria-label": "Unread" }) : null
|
|
5602
5771
|
] }) }) : null,
|
|
5603
|
-
status ? /* @__PURE__ */
|
|
5772
|
+
status ? /* @__PURE__ */ jsx31(
|
|
5604
5773
|
HomeCard,
|
|
5605
5774
|
{
|
|
5606
5775
|
onClick: status.url ? () => nav.push({ kind: "iframe", url: status.url, title: status.text }) : void 0,
|
|
5607
|
-
children: /* @__PURE__ */
|
|
5608
|
-
/* @__PURE__ */
|
|
5609
|
-
/* @__PURE__ */
|
|
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 })
|
|
5610
5779
|
] })
|
|
5611
5780
|
}
|
|
5612
5781
|
) : null,
|
|
5613
|
-
content.length > 0 ? /* @__PURE__ */
|
|
5614
|
-
/* @__PURE__ */
|
|
5615
|
-
/* @__PURE__ */
|
|
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(
|
|
5616
5785
|
ListRow,
|
|
5617
5786
|
{
|
|
5618
5787
|
title: item.title,
|
|
@@ -5628,13 +5797,13 @@ function HomeRoot(props2) {
|
|
|
5628
5797
|
}
|
|
5629
5798
|
var homeLayout = {
|
|
5630
5799
|
Icon: HomeIcon,
|
|
5631
|
-
Root: (props2) => /* @__PURE__ */
|
|
5800
|
+
Root: (props2) => /* @__PURE__ */ jsx31(HomeRoot, { ...props2 })
|
|
5632
5801
|
};
|
|
5633
5802
|
|
|
5634
5803
|
// src/ui/modules/news.tsx
|
|
5635
5804
|
import { useEffect as useEffect13, useState as useState10 } from "preact/hooks";
|
|
5636
|
-
import { jsx as
|
|
5637
|
-
var
|
|
5805
|
+
import { jsx as jsx32, jsxs as jsxs26 } from "preact/jsx-runtime";
|
|
5806
|
+
var p27 = BRAND.cssPrefix;
|
|
5638
5807
|
var log14 = logger.scope("news");
|
|
5639
5808
|
function NewsRoot({ transport, strings, config, nav, panelProps }) {
|
|
5640
5809
|
const tags = config.contentTags;
|
|
@@ -5660,38 +5829,38 @@ function NewsRoot({ transport, strings, config, nav, panelProps }) {
|
|
|
5660
5829
|
};
|
|
5661
5830
|
}, [transport, tags, reloadKey]);
|
|
5662
5831
|
function renderBody() {
|
|
5663
|
-
if (state === "loading") return /* @__PURE__ */
|
|
5832
|
+
if (state === "loading") return /* @__PURE__ */ jsx32(ModuleState, { message: strings.newsLoading, strings });
|
|
5664
5833
|
if (state === "error") {
|
|
5665
|
-
return /* @__PURE__ */
|
|
5834
|
+
return /* @__PURE__ */ jsx32(ModuleState, { tone: "error", message: errorMsg, onRetry: () => setReloadKey((k) => k + 1), strings });
|
|
5666
5835
|
}
|
|
5667
|
-
if (items.length === 0) return /* @__PURE__ */
|
|
5668
|
-
return /* @__PURE__ */
|
|
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(
|
|
5669
5838
|
"button",
|
|
5670
5839
|
{
|
|
5671
5840
|
type: "button",
|
|
5672
|
-
class: `${
|
|
5841
|
+
class: `${p27}-news-card`,
|
|
5673
5842
|
onClick: () => nav.push({ kind: "content", id: item.id, title: item.title }),
|
|
5674
5843
|
"data-testid": tid(TID.newsItem, item.id),
|
|
5675
5844
|
children: [
|
|
5676
|
-
item.image ? /* @__PURE__ */
|
|
5677
|
-
/* @__PURE__ */
|
|
5678
|
-
item.tags && item.tags.length > 0 ? /* @__PURE__ */
|
|
5679
|
-
/* @__PURE__ */
|
|
5680
|
-
item.description ? /* @__PURE__ */
|
|
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
|
|
5681
5850
|
] })
|
|
5682
5851
|
]
|
|
5683
5852
|
},
|
|
5684
5853
|
item.id
|
|
5685
5854
|
)) });
|
|
5686
5855
|
}
|
|
5687
|
-
return /* @__PURE__ */
|
|
5688
|
-
/* @__PURE__ */
|
|
5689
|
-
/* @__PURE__ */
|
|
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() })
|
|
5690
5859
|
] });
|
|
5691
5860
|
}
|
|
5692
5861
|
var newsLayout = {
|
|
5693
5862
|
Icon: NewsIcon,
|
|
5694
|
-
Root: (props2) => /* @__PURE__ */
|
|
5863
|
+
Root: (props2) => /* @__PURE__ */ jsx32(NewsRoot, { ...props2 })
|
|
5695
5864
|
};
|
|
5696
5865
|
|
|
5697
5866
|
// src/ui/modules/registry.ts
|
|
@@ -5703,28 +5872,28 @@ var LAYOUTS = {
|
|
|
5703
5872
|
};
|
|
5704
5873
|
|
|
5705
5874
|
// src/ui/home-tab-bar.tsx
|
|
5706
|
-
import { jsx as
|
|
5707
|
-
var
|
|
5875
|
+
import { jsx as jsx33, jsxs as jsxs27 } from "preact/jsx-runtime";
|
|
5876
|
+
var p28 = BRAND.cssPrefix;
|
|
5708
5877
|
function HomeTabBar({ modules, activeTab, strings, unreadCount, onSelect }) {
|
|
5709
|
-
return /* @__PURE__ */
|
|
5878
|
+
return /* @__PURE__ */ jsx33("nav", { class: `${p28}-tabbar`, role: "tablist", "aria-label": strings.panelTitle, children: modules.map((m) => {
|
|
5710
5879
|
const Icon = LAYOUTS[m.layout].Icon;
|
|
5711
5880
|
const selected = m.id === activeTab;
|
|
5712
5881
|
const badge = m.layout === "chat" && unreadCount > 0 ? unreadCount > 9 ? "9+" : String(unreadCount) : null;
|
|
5713
|
-
return /* @__PURE__ */
|
|
5882
|
+
return /* @__PURE__ */ jsxs27(
|
|
5714
5883
|
"button",
|
|
5715
5884
|
{
|
|
5716
5885
|
type: "button",
|
|
5717
5886
|
role: "tab",
|
|
5718
5887
|
"aria-selected": selected,
|
|
5719
|
-
class: `${
|
|
5888
|
+
class: `${p28}-tab`,
|
|
5720
5889
|
onClick: () => onSelect(m.id),
|
|
5721
5890
|
"data-testid": tid(TID.tab, m.id),
|
|
5722
5891
|
children: [
|
|
5723
|
-
/* @__PURE__ */
|
|
5724
|
-
/* @__PURE__ */
|
|
5725
|
-
badge ? /* @__PURE__ */
|
|
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
|
|
5726
5895
|
] }),
|
|
5727
|
-
/* @__PURE__ */
|
|
5896
|
+
/* @__PURE__ */ jsx33("span", { class: `${p28}-tab-label`, children: moduleLabel(strings, m.label) })
|
|
5728
5897
|
]
|
|
5729
5898
|
},
|
|
5730
5899
|
m.id
|
|
@@ -5733,12 +5902,12 @@ function HomeTabBar({ modules, activeTab, strings, unreadCount, onSelect }) {
|
|
|
5733
5902
|
}
|
|
5734
5903
|
|
|
5735
5904
|
// src/ui/iframe-view.tsx
|
|
5736
|
-
import { jsx as
|
|
5737
|
-
var
|
|
5905
|
+
import { jsx as jsx34, jsxs as jsxs28 } from "preact/jsx-runtime";
|
|
5906
|
+
var p29 = BRAND.cssPrefix;
|
|
5738
5907
|
var SANDBOX = "allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";
|
|
5739
5908
|
function IframeView({ url, title, strings, onBack, actions }) {
|
|
5740
|
-
return /* @__PURE__ */
|
|
5741
|
-
/* @__PURE__ */
|
|
5909
|
+
return /* @__PURE__ */ jsxs28("div", { class: `${p29}-module`, children: [
|
|
5910
|
+
/* @__PURE__ */ jsx34(
|
|
5742
5911
|
BackHeader,
|
|
5743
5912
|
{
|
|
5744
5913
|
title: title || strings.moduleBack,
|
|
@@ -5747,10 +5916,10 @@ function IframeView({ url, title, strings, onBack, actions }) {
|
|
|
5747
5916
|
actions
|
|
5748
5917
|
}
|
|
5749
5918
|
),
|
|
5750
|
-
/* @__PURE__ */
|
|
5919
|
+
/* @__PURE__ */ jsx34(
|
|
5751
5920
|
"iframe",
|
|
5752
5921
|
{
|
|
5753
|
-
class: `${
|
|
5922
|
+
class: `${p29}-content-frame`,
|
|
5754
5923
|
src: url,
|
|
5755
5924
|
title: title || "content",
|
|
5756
5925
|
sandbox: SANDBOX,
|
|
@@ -5764,8 +5933,8 @@ function IframeView({ url, title, strings, onBack, actions }) {
|
|
|
5764
5933
|
|
|
5765
5934
|
// src/ui/content-view.tsx
|
|
5766
5935
|
import { useCallback as useCallback3, useEffect as useEffect14, useState as useState11 } from "preact/hooks";
|
|
5767
|
-
import { jsx as
|
|
5768
|
-
var
|
|
5936
|
+
import { jsx as jsx35, jsxs as jsxs29 } from "preact/jsx-runtime";
|
|
5937
|
+
var p30 = BRAND.cssPrefix;
|
|
5769
5938
|
var log15 = logger.scope("content");
|
|
5770
5939
|
function ContentView({ id, title, transport, strings, onBack, actions }) {
|
|
5771
5940
|
const [item, setItem] = useState11(null);
|
|
@@ -5793,17 +5962,17 @@ function ContentView({ id, title, transport, strings, onBack, actions }) {
|
|
|
5793
5962
|
};
|
|
5794
5963
|
}, [transport, id, reloadKey]);
|
|
5795
5964
|
function renderBody() {
|
|
5796
|
-
if (failed) return /* @__PURE__ */
|
|
5797
|
-
if (item === null) return /* @__PURE__ */
|
|
5798
|
-
return /* @__PURE__ */
|
|
5799
|
-
item.image ? /* @__PURE__ */
|
|
5800
|
-
item.description ? /* @__PURE__ */
|
|
5801
|
-
item.tags && item.tags.length > 0 ? /* @__PURE__ */
|
|
5802
|
-
/* @__PURE__ */
|
|
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 ?? "" })
|
|
5803
5972
|
] });
|
|
5804
5973
|
}
|
|
5805
|
-
return /* @__PURE__ */
|
|
5806
|
-
/* @__PURE__ */
|
|
5974
|
+
return /* @__PURE__ */ jsxs29("div", { class: `${p30}-module`, children: [
|
|
5975
|
+
/* @__PURE__ */ jsx35(
|
|
5807
5976
|
BackHeader,
|
|
5808
5977
|
{
|
|
5809
5978
|
title: item?.title || title || strings.moduleBack,
|
|
@@ -5813,13 +5982,13 @@ function ContentView({ id, title, transport, strings, onBack, actions }) {
|
|
|
5813
5982
|
testid: TID.backHeader
|
|
5814
5983
|
}
|
|
5815
5984
|
),
|
|
5816
|
-
/* @__PURE__ */
|
|
5985
|
+
/* @__PURE__ */ jsx35("div", { class: `${p30}-module-scroll`, "data-testid": TID.contentScroll, children: renderBody() })
|
|
5817
5986
|
] });
|
|
5818
5987
|
}
|
|
5819
5988
|
|
|
5820
5989
|
// src/ui/messenger-home.tsx
|
|
5821
|
-
import { jsx as
|
|
5822
|
-
var
|
|
5990
|
+
import { jsx as jsx36, jsxs as jsxs30 } from "preact/jsx-runtime";
|
|
5991
|
+
var p31 = BRAND.cssPrefix;
|
|
5823
5992
|
function MessengerHome({
|
|
5824
5993
|
panelProps,
|
|
5825
5994
|
enabledModules,
|
|
@@ -5831,7 +6000,7 @@ function MessengerHome({
|
|
|
5831
6000
|
}) {
|
|
5832
6001
|
const options = panelProps.options;
|
|
5833
6002
|
const strings = options.strings;
|
|
5834
|
-
const containerRef =
|
|
6003
|
+
const containerRef = useRef8(null);
|
|
5835
6004
|
useEffect15(() => {
|
|
5836
6005
|
const el = containerRef.current;
|
|
5837
6006
|
if (!el) return;
|
|
@@ -5845,7 +6014,7 @@ function MessengerHome({
|
|
|
5845
6014
|
el.removeEventListener("keydown", onKey);
|
|
5846
6015
|
};
|
|
5847
6016
|
}, [panelProps.onClose]);
|
|
5848
|
-
const composerAttachApiRef =
|
|
6017
|
+
const composerAttachApiRef = useRef8(null);
|
|
5849
6018
|
const onDropItems = useCallback4((items) => {
|
|
5850
6019
|
composerAttachApiRef.current?.attachFromDrop(items);
|
|
5851
6020
|
}, []);
|
|
@@ -5856,7 +6025,7 @@ function MessengerHome({
|
|
|
5856
6025
|
const activeModule = options.modules.byId[navState.activeTab];
|
|
5857
6026
|
const isReader = top?.kind === "iframe" || top?.kind === "content";
|
|
5858
6027
|
const showTabBar = enabledModules.length > 1 && (atTabRoot(navState) || !isReader);
|
|
5859
|
-
const savedSize =
|
|
6028
|
+
const savedSize = useRef8(null);
|
|
5860
6029
|
useEffect15(() => {
|
|
5861
6030
|
if (isReader && savedSize.current === null) {
|
|
5862
6031
|
savedSize.current = panelProps.panelSize;
|
|
@@ -5887,12 +6056,12 @@ function MessengerHome({
|
|
|
5887
6056
|
nav: moduleNav,
|
|
5888
6057
|
panelProps
|
|
5889
6058
|
});
|
|
5890
|
-
const plainActions = /* @__PURE__ */
|
|
6059
|
+
const plainActions = /* @__PURE__ */ jsx36(HeaderActions, { panelProps, variant: "plain" });
|
|
5891
6060
|
let body;
|
|
5892
6061
|
if (top?.kind === "iframe") {
|
|
5893
|
-
body = /* @__PURE__ */
|
|
6062
|
+
body = /* @__PURE__ */ jsx36(IframeView, { url: top.url, title: top.title, strings, onBack: nav.pop, actions: plainActions });
|
|
5894
6063
|
} else if (top?.kind === "content") {
|
|
5895
|
-
body = /* @__PURE__ */
|
|
6064
|
+
body = /* @__PURE__ */ jsx36(
|
|
5896
6065
|
ContentView,
|
|
5897
6066
|
{
|
|
5898
6067
|
id: top.id,
|
|
@@ -5904,7 +6073,7 @@ function MessengerHome({
|
|
|
5904
6073
|
}
|
|
5905
6074
|
);
|
|
5906
6075
|
} else if (activeModule?.layout === "chat") {
|
|
5907
|
-
body = /* @__PURE__ */
|
|
6076
|
+
body = /* @__PURE__ */ jsx36(
|
|
5908
6077
|
PanelContent,
|
|
5909
6078
|
{
|
|
5910
6079
|
...panelProps,
|
|
@@ -5915,23 +6084,23 @@ function MessengerHome({
|
|
|
5915
6084
|
);
|
|
5916
6085
|
} else if (activeModule) {
|
|
5917
6086
|
const Root = LAYOUTS[activeModule.layout].Root;
|
|
5918
|
-
body = Root ? /* @__PURE__ */
|
|
6087
|
+
body = Root ? /* @__PURE__ */ jsx36(Root, { ...screenProps(activeModule) }, activeModule.id) : null;
|
|
5919
6088
|
} else {
|
|
5920
6089
|
body = null;
|
|
5921
6090
|
}
|
|
5922
|
-
return /* @__PURE__ */
|
|
6091
|
+
return /* @__PURE__ */ jsxs30(
|
|
5923
6092
|
"div",
|
|
5924
6093
|
{
|
|
5925
6094
|
ref: containerRef,
|
|
5926
|
-
class: `${
|
|
6095
|
+
class: `${p31}-panel ${p31}-messenger`,
|
|
5927
6096
|
role: "dialog",
|
|
5928
6097
|
"aria-modal": "false",
|
|
5929
6098
|
"aria-label": strings.panelTitle,
|
|
5930
6099
|
style: { position: "relative" },
|
|
5931
6100
|
"data-testid": TID.messengerHome,
|
|
5932
6101
|
children: [
|
|
5933
|
-
/* @__PURE__ */
|
|
5934
|
-
showTabBar ? /* @__PURE__ */
|
|
6102
|
+
/* @__PURE__ */ jsx36("div", { class: `${p31}-messenger-body`, children: body }),
|
|
6103
|
+
showTabBar ? /* @__PURE__ */ jsx36(
|
|
5935
6104
|
HomeTabBar,
|
|
5936
6105
|
{
|
|
5937
6106
|
modules: enabledModules,
|
|
@@ -5941,8 +6110,8 @@ function MessengerHome({
|
|
|
5941
6110
|
onSelect: nav.switchTab
|
|
5942
6111
|
}
|
|
5943
6112
|
) : null,
|
|
5944
|
-
/* @__PURE__ */
|
|
5945
|
-
options.size.resize?.enabled && !(activeModule?.layout === "chat" && !top) ? /* @__PURE__ */
|
|
6113
|
+
/* @__PURE__ */ jsx36(PoweredByBar, { poweredBy: options.poweredBy }),
|
|
6114
|
+
options.size.resize?.enabled && !(activeModule?.layout === "chat" && !top) ? /* @__PURE__ */ jsx36(
|
|
5946
6115
|
ResizeGrip,
|
|
5947
6116
|
{
|
|
5948
6117
|
panelEl: containerRef.current,
|
|
@@ -5959,29 +6128,29 @@ function MessengerHome({
|
|
|
5959
6128
|
}
|
|
5960
6129
|
|
|
5961
6130
|
// src/ui/modules-empty.tsx
|
|
5962
|
-
import { jsx as
|
|
5963
|
-
var
|
|
6131
|
+
import { jsx as jsx37, jsxs as jsxs31 } from "preact/jsx-runtime";
|
|
6132
|
+
var p32 = BRAND.cssPrefix;
|
|
5964
6133
|
function ModulesEmpty({ strings, onClose }) {
|
|
5965
|
-
return /* @__PURE__ */
|
|
6134
|
+
return /* @__PURE__ */ jsxs31(
|
|
5966
6135
|
"div",
|
|
5967
6136
|
{
|
|
5968
|
-
class: `${
|
|
6137
|
+
class: `${p32}-panel ${p32}-modules-empty`,
|
|
5969
6138
|
role: "dialog",
|
|
5970
6139
|
"aria-label": strings.panelTitle,
|
|
5971
6140
|
"data-testid": TID.modulesEmpty,
|
|
5972
6141
|
children: [
|
|
5973
|
-
onClose ? /* @__PURE__ */
|
|
6142
|
+
onClose ? /* @__PURE__ */ jsx37(
|
|
5974
6143
|
"button",
|
|
5975
6144
|
{
|
|
5976
6145
|
type: "button",
|
|
5977
|
-
class: `${
|
|
6146
|
+
class: `${p32}-icon-btn ${p32}-modules-empty-close`,
|
|
5978
6147
|
onClick: onClose,
|
|
5979
6148
|
"aria-label": strings.close,
|
|
5980
6149
|
title: strings.close,
|
|
5981
|
-
children: /* @__PURE__ */
|
|
6150
|
+
children: /* @__PURE__ */ jsx37(CloseIcon, {})
|
|
5982
6151
|
}
|
|
5983
6152
|
) : null,
|
|
5984
|
-
/* @__PURE__ */
|
|
6153
|
+
/* @__PURE__ */ jsx37("p", { class: `${p32}-modules-empty-text`, children: strings.modulesEmpty })
|
|
5985
6154
|
]
|
|
5986
6155
|
}
|
|
5987
6156
|
);
|
|
@@ -6052,9 +6221,9 @@ function useLauncherCallout({ callout, persistence }) {
|
|
|
6052
6221
|
}
|
|
6053
6222
|
|
|
6054
6223
|
// src/ui/app.tsx
|
|
6055
|
-
import { jsx as
|
|
6224
|
+
import { jsx as jsx38, jsxs as jsxs32 } from "preact/jsx-runtime";
|
|
6056
6225
|
var log16 = logger.scope("app");
|
|
6057
|
-
var
|
|
6226
|
+
var p33 = BRAND.cssPrefix;
|
|
6058
6227
|
function App({ options, hostElement, bus }) {
|
|
6059
6228
|
const [persistence] = useState13(() => createPersistence(options.widgetId, options.storage));
|
|
6060
6229
|
const [visitorId, setVisitorId] = useState13(() => persistence.getVisitorId());
|
|
@@ -6077,21 +6246,21 @@ function App({ options, hostElement, bus }) {
|
|
|
6077
6246
|
function chatTabId() {
|
|
6078
6247
|
return options.modules.list.find((m) => m.layout === "chat")?.id;
|
|
6079
6248
|
}
|
|
6080
|
-
const homeNavRef =
|
|
6249
|
+
const homeNavRef = useRef9();
|
|
6081
6250
|
if (!homeNavRef.current) {
|
|
6082
6251
|
const ids = options.modules.list.map((m) => m.id);
|
|
6083
6252
|
homeNavRef.current = createHomeNav(landingTab(), ids, (tab) => persistence.saveActiveModule(tab));
|
|
6084
6253
|
}
|
|
6085
6254
|
const homeNav = homeNavRef.current;
|
|
6086
|
-
const chatTabIdRef =
|
|
6255
|
+
const chatTabIdRef = useRef9(void 0);
|
|
6087
6256
|
chatTabIdRef.current = chatTabId();
|
|
6088
6257
|
const [sessionReady, setSessionReady] = useState13(false);
|
|
6089
6258
|
const isInlineLike = options.mode === "standalone" || options.mode === "inline";
|
|
6090
|
-
const initialPanelRef =
|
|
6259
|
+
const initialPanelRef = useRef9(
|
|
6091
6260
|
resolveInitialPanelState(options, currentViewportWidth(), persistence.loadPanelOpen(), persistence.loadPanelSize())
|
|
6092
6261
|
);
|
|
6093
6262
|
const [isOpen, setIsOpen] = useState13(initialPanelRef.current.panelOpen);
|
|
6094
|
-
const initialPanelApplied =
|
|
6263
|
+
const initialPanelApplied = useRef9(false);
|
|
6095
6264
|
const [launcherLeaving, setLauncherLeaving] = useState13(false);
|
|
6096
6265
|
const { dismissed: calloutDismissed, dismissCallout: dismissCalloutRaw } = useLauncherCallout({
|
|
6097
6266
|
callout: options.launcher.callout,
|
|
@@ -6104,18 +6273,18 @@ function App({ options, hostElement, bus }) {
|
|
|
6104
6273
|
dismissCalloutRaw();
|
|
6105
6274
|
}, [bus, dismissCalloutRaw]);
|
|
6106
6275
|
const [panelSize, setPanelSize] = useState13(initialPanelRef.current.panelSize);
|
|
6107
|
-
const initialSizeApplied =
|
|
6276
|
+
const initialSizeApplied = useRef9(false);
|
|
6108
6277
|
const [view, setView] = useState13("chat");
|
|
6109
6278
|
const [canSend, setCanSend] = useState13(true);
|
|
6110
6279
|
const [streaming, setStreaming] = useState13(false);
|
|
6111
6280
|
const [agent, setAgent] = useState13(null);
|
|
6112
6281
|
const [suggestions, setSuggestions] = useState13([]);
|
|
6113
6282
|
const [activeCancel, setActiveCancel] = useState13(null);
|
|
6114
|
-
const welcomeAbortRef =
|
|
6283
|
+
const welcomeAbortRef = useRef9(null);
|
|
6115
6284
|
const [parsedSite, setParsedSite] = useState13(void 0);
|
|
6116
6285
|
const [parsedBlocks, setParsedBlocks] = useState13(void 0);
|
|
6117
6286
|
const [sidebarCollapsed, setSidebarCollapsed] = useState13(() => persistence.loadSidebarCollapsed() ?? false);
|
|
6118
|
-
const [
|
|
6287
|
+
const [formContext, setFormContext] = useState13({});
|
|
6119
6288
|
const [transport] = useState13(
|
|
6120
6289
|
() => new AgentTransport({
|
|
6121
6290
|
baseUrl: options.baseUrl,
|
|
@@ -6176,9 +6345,9 @@ function App({ options, hostElement, bus }) {
|
|
|
6176
6345
|
setIsOpen(state.panelOpen);
|
|
6177
6346
|
setPanelSize(state.panelSize);
|
|
6178
6347
|
}, [sessionReady, options, persistence]);
|
|
6179
|
-
const homeNavSeeded =
|
|
6180
|
-
const resumeActiveRef =
|
|
6181
|
-
const resumeBubbleRef =
|
|
6348
|
+
const homeNavSeeded = useRef9(false);
|
|
6349
|
+
const resumeActiveRef = useRef9(false);
|
|
6350
|
+
const resumeBubbleRef = useRef9(null);
|
|
6182
6351
|
useEffect17(() => {
|
|
6183
6352
|
if (!sessionReady || homeNavSeeded.current) return;
|
|
6184
6353
|
homeNavSeeded.current = true;
|
|
@@ -6206,7 +6375,7 @@ function App({ options, hostElement, bus }) {
|
|
|
6206
6375
|
},
|
|
6207
6376
|
[messagesSig, options.welcome]
|
|
6208
6377
|
);
|
|
6209
|
-
const connectGenRef =
|
|
6378
|
+
const connectGenRef = useRef9(0);
|
|
6210
6379
|
const runStartSession = useCallback6(
|
|
6211
6380
|
async ({ newConversation }) => {
|
|
6212
6381
|
const myGen = ++connectGenRef.current;
|
|
@@ -6298,11 +6467,11 @@ function App({ options, hostElement, bus }) {
|
|
|
6298
6467
|
);
|
|
6299
6468
|
const userSig = JSON.stringify(options.userContext ?? null);
|
|
6300
6469
|
const pageSig = JSON.stringify(options.pageContext ?? null);
|
|
6301
|
-
const
|
|
6470
|
+
const formCtxSig = JSON.stringify(formContext);
|
|
6302
6471
|
useEffect17(() => {
|
|
6303
|
-
const merged =
|
|
6472
|
+
const merged = Object.keys(formContext).length ? { ...formContext, ...options.userContext } : options.userContext;
|
|
6304
6473
|
transport.setContext(merged, toWirePageContext(options.pageContext));
|
|
6305
|
-
}, [transport, userSig, pageSig,
|
|
6474
|
+
}, [transport, userSig, pageSig, formCtxSig]);
|
|
6306
6475
|
const runResume = useCallback6(
|
|
6307
6476
|
async (handle) => {
|
|
6308
6477
|
let bubble = null;
|
|
@@ -6361,7 +6530,7 @@ function App({ options, hostElement, bus }) {
|
|
|
6361
6530
|
resume?.cancel();
|
|
6362
6531
|
};
|
|
6363
6532
|
}, []);
|
|
6364
|
-
const lastUserSig =
|
|
6533
|
+
const lastUserSig = useRef9(userSig);
|
|
6365
6534
|
useEffect17(() => {
|
|
6366
6535
|
if (!sessionReady || lastUserSig.current === userSig) return;
|
|
6367
6536
|
lastUserSig.current = userSig;
|
|
@@ -6484,25 +6653,48 @@ function App({ options, hostElement, bus }) {
|
|
|
6484
6653
|
() => ({ humanInLoop: options.features.humanInLoop, onResult: handleToolResult, onDecision: handleToolDecision }),
|
|
6485
6654
|
[options.features.humanInLoop, handleToolResult, handleToolDecision]
|
|
6486
6655
|
);
|
|
6487
|
-
const
|
|
6488
|
-
const
|
|
6489
|
-
|
|
6490
|
-
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
|
|
6494
|
-
|
|
6495
|
-
|
|
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;
|
|
6496
6667
|
const activeSessionId = sessionIdSig.value ?? uuid7();
|
|
6497
6668
|
if (!sessionIdSig.value) {
|
|
6498
6669
|
sessionIdSig.value = activeSessionId;
|
|
6499
6670
|
persistence.saveSessionId(activeSessionId);
|
|
6500
6671
|
transport.primeIdentity(void 0, activeSessionId);
|
|
6501
6672
|
}
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
);
|
|
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]);
|
|
6506
6698
|
const handleSend = useCallback6(
|
|
6507
6699
|
async (text, attachments) => {
|
|
6508
6700
|
log16.info("send", { textLen: text.length, attachments: attachments.length, streaming });
|
|
@@ -6522,8 +6714,9 @@ function App({ options, hostElement, bus }) {
|
|
|
6522
6714
|
reducer.attach(assistantMsg);
|
|
6523
6715
|
emitMessage(bus, options, "user", text);
|
|
6524
6716
|
await streamAssistant(assistantMsg, TRIGGER.submitMessage);
|
|
6717
|
+
forms.fire("after-messages");
|
|
6525
6718
|
},
|
|
6526
|
-
[streaming, transport, bus, options, suggestions.length, messagesSig, reducer, streamAssistant]
|
|
6719
|
+
[streaming, transport, bus, options, suggestions.length, messagesSig, reducer, streamAssistant, forms]
|
|
6527
6720
|
);
|
|
6528
6721
|
const handleStop = useCallback6(() => {
|
|
6529
6722
|
log16.info("stop");
|
|
@@ -6544,18 +6737,19 @@ function App({ options, hostElement, bus }) {
|
|
|
6544
6737
|
return;
|
|
6545
6738
|
}
|
|
6546
6739
|
log16.info("close \u2192 panel closed", { mode: options.mode });
|
|
6740
|
+
forms.fire("panel-close");
|
|
6547
6741
|
setIsOpen(false);
|
|
6548
6742
|
persistence.savePanelOpen(false);
|
|
6549
6743
|
bus.emit("close", void 0);
|
|
6550
6744
|
options.onClose?.();
|
|
6551
|
-
}, [bus, options, persistence, panelSize]);
|
|
6745
|
+
}, [bus, options, persistence, panelSize, forms]);
|
|
6552
6746
|
const refreshUnread = useCallback6(() => {
|
|
6553
6747
|
if (!options.modules.list.some((m) => m.layout === "chat")) return;
|
|
6554
6748
|
transport.listSessions({ limit: 50 }).then((res) => {
|
|
6555
6749
|
unreadCountSig.value = res.sessions.reduce((sum, c) => sum + (c.unreadCount ?? 0), 0);
|
|
6556
6750
|
}).catch((err) => log16.debug("refreshUnread failed (non-fatal)", { err }));
|
|
6557
6751
|
}, [transport, options.modules, unreadCountSig]);
|
|
6558
|
-
const unreadSeeded =
|
|
6752
|
+
const unreadSeeded = useRef9(false);
|
|
6559
6753
|
useEffect17(() => {
|
|
6560
6754
|
if (!sessionReady || unreadSeeded.current) return;
|
|
6561
6755
|
unreadSeeded.current = true;
|
|
@@ -6686,10 +6880,11 @@ function App({ options, hostElement, bus }) {
|
|
|
6686
6880
|
close: handleClose,
|
|
6687
6881
|
expand: handleExpand,
|
|
6688
6882
|
fullscreen: handleFullscreen,
|
|
6689
|
-
popout: handlePopOut
|
|
6883
|
+
popout: handlePopOut,
|
|
6884
|
+
openForm: (id) => forms.fire("manual", typeof id === "string" ? id : void 0)
|
|
6690
6885
|
});
|
|
6691
6886
|
return unsub;
|
|
6692
|
-
}, [hostElement, handleOpen, handleClose, handleExpand, handleFullscreen, handlePopOut]);
|
|
6887
|
+
}, [hostElement, handleOpen, handleClose, handleExpand, handleFullscreen, handlePopOut, forms]);
|
|
6693
6888
|
const effectiveOptions = useMemo3(
|
|
6694
6889
|
() => applyOptionOverrides(options, activeLocale, activeThemeMode),
|
|
6695
6890
|
[options, activeLocale, activeThemeMode]
|
|
@@ -6728,8 +6923,12 @@ function App({ options, hostElement, bus }) {
|
|
|
6728
6923
|
bus.emit("suggestion", { text });
|
|
6729
6924
|
void handleSend(text, []);
|
|
6730
6925
|
},
|
|
6731
|
-
|
|
6732
|
-
|
|
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,
|
|
6733
6932
|
tool: toolInteraction
|
|
6734
6933
|
};
|
|
6735
6934
|
const onSelectSession = (sessionId) => {
|
|
@@ -6742,12 +6941,12 @@ function App({ options, hostElement, bus }) {
|
|
|
6742
6941
|
const renderSurface = (size) => {
|
|
6743
6942
|
const closeable = isActionVisible("close", effectiveOptions.mode, size);
|
|
6744
6943
|
if (enabledModules.length === 0) {
|
|
6745
|
-
return /* @__PURE__ */
|
|
6944
|
+
return /* @__PURE__ */ jsx38(ModulesEmpty, { strings: effectiveOptions.strings, onClose: closeable ? handleClose : void 0 });
|
|
6746
6945
|
}
|
|
6747
6946
|
if (enabledModules.length === 1 && enabledModules[0]?.layout === "chat") {
|
|
6748
|
-
return /* @__PURE__ */
|
|
6947
|
+
return /* @__PURE__ */ jsx38(Panel, { ...panelProps, panelSize: size });
|
|
6749
6948
|
}
|
|
6750
|
-
return /* @__PURE__ */
|
|
6949
|
+
return /* @__PURE__ */ jsx38(
|
|
6751
6950
|
MessengerHome,
|
|
6752
6951
|
{
|
|
6753
6952
|
panelProps: { ...panelProps, panelSize: size, onClose: closeable ? handleClose : void 0 },
|
|
@@ -6765,7 +6964,7 @@ function App({ options, hostElement, bus }) {
|
|
|
6765
6964
|
void handleSelectHistoryChat(chat.sessionId);
|
|
6766
6965
|
};
|
|
6767
6966
|
const messagesEnabled = enabledModules.some((m) => m.layout === "chat");
|
|
6768
|
-
return /* @__PURE__ */
|
|
6967
|
+
return /* @__PURE__ */ jsx38("div", { class: `${p33}-anchor`, children: /* @__PURE__ */ jsx38(
|
|
6769
6968
|
PageShell,
|
|
6770
6969
|
{
|
|
6771
6970
|
site: parsedSite,
|
|
@@ -6784,15 +6983,15 @@ function App({ options, hostElement, bus }) {
|
|
|
6784
6983
|
}
|
|
6785
6984
|
if (isInlineLike) {
|
|
6786
6985
|
const inlineSize = options.mode === "standalone" ? "fullscreen" : panelSize;
|
|
6787
|
-
return /* @__PURE__ */
|
|
6986
|
+
return /* @__PURE__ */ jsx38("div", { class: `${p33}-anchor`, children: renderSurface(inlineSize) });
|
|
6788
6987
|
}
|
|
6789
6988
|
const drawerEdgeTab = options.mode === "drawer";
|
|
6790
6989
|
const triggerOwnedByPage = options.mode === "modal";
|
|
6791
6990
|
const launcherVisible = !triggerOwnedByPage && !options.launcher.hidden && (!isOpen || launcherLeaving);
|
|
6792
6991
|
const calloutToRender = launcherVisible && !launcherLeaving && !calloutDismissed && !drawerEdgeTab ? effectiveOptions.launcher.callout : null;
|
|
6793
|
-
return /* @__PURE__ */
|
|
6992
|
+
return /* @__PURE__ */ jsxs32("div", { class: `${p33}-anchor`, "data-launcher-size": effectiveOptions.launcher.size, children: [
|
|
6794
6993
|
isOpen ? renderSurface(panelSize) : null,
|
|
6795
|
-
launcherVisible ? /* @__PURE__ */
|
|
6994
|
+
launcherVisible ? /* @__PURE__ */ jsx38(
|
|
6796
6995
|
Launcher,
|
|
6797
6996
|
{
|
|
6798
6997
|
onToggle: handleOpen,
|
|
@@ -6802,7 +7001,7 @@ function App({ options, hostElement, bus }) {
|
|
|
6802
7001
|
edgeTab: drawerEdgeTab
|
|
6803
7002
|
}
|
|
6804
7003
|
) : null,
|
|
6805
|
-
calloutToRender ? /* @__PURE__ */
|
|
7004
|
+
calloutToRender ? /* @__PURE__ */ jsx38(
|
|
6806
7005
|
LauncherCallout,
|
|
6807
7006
|
{
|
|
6808
7007
|
callout: calloutToRender,
|