@thewhatmatters/wmds 0.4.2 → 0.4.3
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/CHANGELOG.md +24 -0
- package/CONSUMING.md +2 -2
- package/bin/wmds-check.mjs +108 -10
- package/dist/components/organisms/ChatDock/ChatDock.d.ts +9 -18
- package/dist/components/organisms/ChatDock/ChatDock.d.ts.map +1 -1
- package/dist/components/organisms/ChatDock/ChatDock.js +411 -411
- package/dist/components/organisms/ChatDock/ChatDockGate.d.ts +19 -9
- package/dist/components/organisms/ChatDock/ChatDockGate.d.ts.map +1 -1
- package/dist/components/organisms/ChatDock/ChatDockGate.js +152 -123
- package/dist/components/organisms/ChatDock/chatDockGateContext.d.ts +11 -0
- package/dist/components/organisms/ChatDock/chatDockGateContext.d.ts.map +1 -0
- package/dist/components/organisms/ChatDock/chatDockGateContext.js +9 -0
- package/dist/components/organisms/ChatDock/chatDockGateStyles.d.ts +15 -10
- package/dist/components/organisms/ChatDock/chatDockGateStyles.d.ts.map +1 -1
- package/dist/components/organisms/ChatDock/chatDockGateStyles.js +3 -3
- package/dist/components/organisms/ChatDock/chatDockStyles.d.ts +10 -4
- package/dist/components/organisms/ChatDock/chatDockStyles.d.ts.map +1 -1
- package/dist/components/organisms/ChatDock/chatDockStyles.js +9 -6
- package/dist/components/organisms/ChatDock/chatDockViewport.d.ts +6 -0
- package/dist/components/organisms/ChatDock/chatDockViewport.d.ts.map +1 -1
- package/dist/components/organisms/ChatDock/chatDockViewport.js +14 -1
- package/dist/components/organisms/Dialog/Dialog.js +34 -34
- package/dist/components/organisms/Sheet/Sheet.js +38 -38
- package/dist/components/organisms/Toast/Toast.d.ts.map +1 -1
- package/dist/components/organisms/Toast/Toast.js +11 -5
- package/dist/lib/dialogOverlay.d.ts +5 -0
- package/dist/lib/dialogOverlay.d.ts.map +1 -1
- package/dist/lib/dialogOverlay.js +29 -15
- package/dist/styles.css +1 -1
- package/docs/component-contracts.md +4 -2
- package/docs/components.md +5 -5
- package/docs/exports.json +1 -1
- package/docs/patterns/components-accordion--flush.tsx +1 -1
- package/docs/patterns/components-avatar--dropdown-row.tsx +1 -1
- package/docs/patterns/components-badge--outline-tags.tsx +1 -1
- package/docs/patterns/components-badge--with-avatar.tsx +1 -1
- package/docs/patterns/components-breadcrumb--editorial.tsx +1 -1
- package/docs/patterns/components-breadcrumb--long-path.tsx +1 -1
- package/docs/patterns/components-breadcrumb--path.tsx +1 -1
- package/docs/patterns/components-breadcrumb--router-links.tsx +1 -1
- package/docs/patterns/components-button-button--copy-button.tsx +1 -1
- package/docs/patterns/components-button-button--destructive-action.tsx +1 -1
- package/docs/patterns/components-button-button--external-link.tsx +1 -1
- package/docs/patterns/components-button-button--ghost-action.tsx +1 -1
- package/docs/patterns/components-button-button--inverse-action.tsx +1 -1
- package/docs/patterns/components-button-button--link-render.tsx +1 -1
- package/docs/patterns/components-button-button--multi-state-badge.tsx +1 -1
- package/docs/patterns/components-button-button--outline-mono.tsx +1 -1
- package/docs/patterns/components-button-button--primary-action.tsx +1 -1
- package/docs/patterns/components-button-button--row-hug.tsx +1 -1
- package/docs/patterns/components-button-button--row-layout.tsx +1 -1
- package/docs/patterns/components-button-button--secondary-action.tsx +1 -1
- package/docs/patterns/components-button-button--suggestion-pills.tsx +1 -1
- package/docs/patterns/components-button-button--with-count.tsx +1 -1
- package/docs/patterns/components-button-button--with-icon.tsx +1 -1
- package/docs/patterns/components-button-floatingactionbutton--vertical-actions.tsx +1 -1
- package/docs/patterns/components-calembed--pattern-skip-in-footer.tsx +1 -1
- package/docs/patterns/components-card-card--body-slot-occupancy-history.tsx +1 -1
- package/docs/patterns/components-card-card--headerless-media.tsx +1 -1
- package/docs/patterns/components-card-card--outlined-layout.tsx +1 -1
- package/docs/patterns/components-card-card--pinned-height.tsx +1 -1
- package/docs/patterns/components-card-selectablecard--selectable-cards-pattern.tsx +1 -1
- package/docs/patterns/components-chart--audience-activity-heatmap.tsx +1 -1
- package/docs/patterns/components-chart--cartesian-no-data-gaps.tsx +1 -1
- package/docs/patterns/components-chart--occupancy-history-in-card.tsx +1 -1
- package/docs/patterns/components-chart--occupancy-in-card.tsx +1 -1
- package/docs/patterns/components-chart--post-reach-distribution.tsx +1 -1
- package/docs/patterns/components-chart--ranked-audience-breakdown.tsx +1 -1
- package/docs/patterns/components-chart--unit-grid-composition.tsx +1 -1
- package/docs/patterns/components-chatdock--pattern-chat-dock.tsx +1 -1
- package/docs/patterns/components-chatdock--pattern-start-project-gate.tsx +54 -11
- package/docs/patterns/components-chatqa--pattern-qa-with-reply.tsx +1 -1
- package/docs/patterns/components-checkbox-checkbox--default.tsx +1 -1
- package/docs/patterns/components-checkbox-checkbox--with-count.tsx +1 -1
- package/docs/patterns/components-checkbox-checkbox--with-description.tsx +1 -1
- package/docs/patterns/components-checkbox-checkboxgroup--default.tsx +1 -1
- package/docs/patterns/components-checkbox-checkboxgroup--option-counts.tsx +1 -1
- package/docs/patterns/components-descriptionlist--details.tsx +1 -1
- package/docs/patterns/components-descriptionlist--post-metadata.tsx +1 -1
- package/docs/patterns/components-dialog--alert-dialog-destructive.tsx +1 -1
- package/docs/patterns/components-dialog--default-dialog.tsx +1 -1
- package/docs/patterns/components-dialog--form-dialog.tsx +1 -1
- package/docs/patterns/components-displaycontrols--page-utilities.tsx +1 -1
- package/docs/patterns/components-field--horizontal-input.tsx +1 -1
- package/docs/patterns/components-field--horizontal-text-area.tsx +1 -1
- package/docs/patterns/components-field--multi-control.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-hero-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-hero-ruled-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-hero-with-gallery-intro.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-page-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--ruled-grid-footer-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--sequenced-marketing-hero.tsx +1 -1
- package/docs/patterns/components-herointro--two-line-intro.tsx +1 -1
- package/docs/patterns/components-herotilestack--marketing-hero-pattern.tsx +1 -1
- package/docs/patterns/components-herotilestack--marketing-hero-text-sequence.tsx +1 -1
- package/docs/patterns/components-herotilestack--marketing-hero-with-gallery-intro.tsx +1 -1
- package/docs/patterns/components-indexlist--post-index.tsx +1 -1
- package/docs/patterns/components-intakeconfirmation--booked-pattern.tsx +1 -1
- package/docs/patterns/components-intakeconfirmation--emailed-pattern.tsx +1 -1
- package/docs/patterns/components-intakeform--about-you-pattern.tsx +1 -1
- package/docs/patterns/components-intakemodal--intake-modal-pattern.tsx +1 -1
- package/docs/patterns/components-kbd--command-row.tsx +1 -1
- package/docs/patterns/components-kbd--numbered-choices.tsx +1 -1
- package/docs/patterns/components-kbd--shortcut.tsx +1 -1
- package/docs/patterns/components-moremenu--action-menu.tsx +1 -1
- package/docs/patterns/components-moremenu--in-card-header.tsx +1 -1
- package/docs/patterns/components-navlist--side-nav-settings.tsx +1 -1
- package/docs/patterns/components-pageheader--app-header-pattern.tsx +1 -1
- package/docs/patterns/components-pageheader--page-section-header.tsx +1 -1
- package/docs/patterns/components-pageheader--toolbar-header.tsx +1 -1
- package/docs/patterns/components-panel--end-detail-rail.tsx +1 -1
- package/docs/patterns/components-pillgroup--pill-group-pattern.tsx +1 -1
- package/docs/patterns/components-promptbar--pattern-prompt-bar.tsx +1 -1
- package/docs/patterns/components-prose--article-body.tsx +1 -1
- package/docs/patterns/components-radio-radiogroup--default.tsx +1 -1
- package/docs/patterns/components-scrollhorizontal--project-gallery-pattern.tsx +1 -1
- package/docs/patterns/components-scrollhorizontal--with-intro.tsx +1 -1
- package/docs/patterns/components-sectioncaption--column-caption.tsx +1 -1
- package/docs/patterns/components-sectioncaption--with-action.tsx +1 -1
- package/docs/patterns/components-sheet--bottom-sheet.tsx +1 -1
- package/docs/patterns/components-sheet--end-sheet.tsx +1 -1
- package/docs/patterns/components-sitenav--brand-and-cta.tsx +1 -1
- package/docs/patterns/components-sitenav--centered-links.tsx +1 -1
- package/docs/patterns/components-sitenav--compact.tsx +1 -1
- package/docs/patterns/components-sitenav--marketing-header.tsx +1 -1
- package/docs/patterns/components-sitenav--mega-menu.tsx +1 -1
- package/docs/patterns/components-stat--insights-row.tsx +1 -1
- package/docs/patterns/components-stepprogress--step-progress-pattern.tsx +1 -1
- package/docs/patterns/components-switch--default.tsx +1 -1
- package/docs/patterns/components-switch--settings-row.tsx +1 -1
- package/docs/patterns/components-tab--settings-pages.tsx +1 -1
- package/docs/patterns/components-taskrows--action-details.tsx +1 -1
- package/docs/patterns/components-taskrows--capsules.tsx +1 -1
- package/docs/patterns/components-taskrows--card-with-status-rows.tsx +1 -1
- package/docs/patterns/components-taskrows--controlled-expand.tsx +1 -1
- package/docs/patterns/components-taskrows--custom-slots.tsx +1 -1
- package/docs/patterns/components-taskrows--status-list.tsx +1 -1
- package/docs/patterns/components-taskrows--tag-chips.tsx +1 -1
- package/docs/patterns/components-textlink--external-destination.tsx +1 -1
- package/docs/patterns/components-textlink--inline-prose.tsx +1 -1
- package/docs/patterns/components-textlink--quiet-title.tsx +1 -1
- package/docs/patterns/components-textlink--supporting-copy.tsx +1 -1
- package/docs/patterns/components-textsequence--default.tsx +1 -1
- package/docs/patterns/components-textsequence--reduced-motion.tsx +1 -1
- package/docs/patterns/components-textsequence--shapes.tsx +1 -1
- package/docs/patterns/components-toast--stacked-notifications.tsx +1 -1
- package/docs/patterns/components-tooltip--controlled.tsx +1 -1
- package/docs/patterns/components-tooltip--disabled-control.tsx +1 -1
- package/docs/patterns/components-tooltip--icon-action.tsx +1 -1
- package/docs/patterns/components-tooltip--keyboard-shortcut.tsx +1 -1
- package/docs/patterns/components-tooltip--placement.tsx +1 -1
- package/docs/patterns/foundations-scroll-fade--horizontal-rail.tsx +1 -1
- package/docs/patterns/foundations-scroll-fade--overflowing-list.tsx +1 -1
- package/docs/patterns/guides-chart-explorations--comparison-gallery.tsx +1 -1
- package/docs/patterns/guides-filter-panel--filtered-index.tsx +41 -17
- package/docs/patterns/guides-overlay-flows--notification-preferences.tsx +1 -1
- package/docs/patterns/guides-post-page--post-page.tsx +34 -4
- package/docs/patterns/guides-profile-typography--editorial-profile.tsx +1 -1
- package/docs/patterns/index.json +1 -1
- package/package.json +1 -1
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../../lib/cn.js";
|
|
3
|
-
import { motionBeatSeconds as t, motionStaggerSeconds as n, motionTransitionProp as r
|
|
4
|
-
import { ButtonIcon as
|
|
5
|
-
import { Button as
|
|
6
|
-
import { IconButton as
|
|
3
|
+
import { motionBeatSeconds as t, motionStaggerSeconds as n, motionTransitionProp as r } from "../../../lib/motion.js";
|
|
4
|
+
import { ButtonIcon as i } from "../../atoms/Button/ButtonIcon.js";
|
|
5
|
+
import { Button as a } from "../../atoms/Button/Button.js";
|
|
6
|
+
import { IconButton as o } from "../../atoms/IconButton/IconButton.js";
|
|
7
7
|
import { Status as ee } from "../../atoms/Status/Status.js";
|
|
8
8
|
import { PromptBar as te } from "../../molecules/PromptBar/PromptBar.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
9
|
+
import { inertOutside as ne, lockBodyScroll as re, trapFocus as ie } from "../../../lib/dialogOverlay.js";
|
|
10
|
+
import { OverlayPanelHeader as ae } from "../Dialog/OverlayPanelHeader.js";
|
|
11
|
+
import { ChatDockGateContext as oe } from "./chatDockGateContext.js";
|
|
12
|
+
import { subscribeChatDockViewport as se, useChatDockReducedMotion as ce, useChatDockVisibleArea as le, useChatDockWide as ue } from "./chatDockViewport.js";
|
|
13
|
+
import { ChatDockGate as s, chatDockGateDefaultLabels as c } from "./ChatDockGate.js";
|
|
14
|
+
import { chatDockAssistantMessageClasses as l, chatDockComposerClasses as de, chatDockComposerFootSpacerClasses as fe, chatDockComposerHiddenClasses as pe, chatDockDisclaimerClasses as me, chatDockDockClasses as he, chatDockDockHoverClasses as ge, chatDockFollowUpRowClasses as _e, chatDockFollowUpsComposerClasses as ve, chatDockFollowUpsInlineClasses as ye, chatDockGateLayerClasses as be, chatDockGridClasses as xe, chatDockMarkClasses as Se, chatDockPillClasses as Ce, chatDockPillsClasses as we, chatDockPlacements as u, chatDockReplyActionsClasses as Te, chatDockReplyActionsPendingClasses as Ee, chatDockReplyButtonsClasses as De, chatDockReplyClasses as Oe, chatDockReplyMetaClasses as ke, chatDockRootClasses as Ae, chatDockRootModalClasses as je, chatDockRootRaisedClasses as Me, chatDockScrimClasses as Ne, chatDockSuggestionLabelClasses as Pe, chatDockSuggestionListClasses as Fe, chatDockSuggestionRowContentClasses as Ie, chatDockThinkingClasses as Le, chatDockThreadClasses as Re, chatDockUserMessageClasses as ze, chatDockWindowClasses as Be, chatDockWindowContentClasses as Ve } from "./chatDockStyles.js";
|
|
15
|
+
import { useContext as He, useEffect as d, useId as Ue, useLayoutEffect as We, useRef as f, useState as p, useSyncExternalStore as Ge } from "react";
|
|
16
|
+
import { Check as Ke, Copy as qe, CornerDownRight as Je, ThumbsDown as Ye, ThumbsUp as Xe } from "lucide-react";
|
|
17
|
+
import { Fragment as Ze, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
18
|
+
import { AnimatePresence as g, MotionConfigContext as Qe, motion as _ } from "motion/react";
|
|
17
19
|
//#region src/components/organisms/ChatDock/ChatDock.tsx
|
|
18
|
-
var
|
|
20
|
+
var $e = {
|
|
19
21
|
close: "Close chat",
|
|
20
22
|
thinking: "Thinking…",
|
|
21
23
|
conversation: "Conversation",
|
|
@@ -27,18 +29,18 @@ var Ke = {
|
|
|
27
29
|
copied: "Copied",
|
|
28
30
|
helpful: "Mark this reply helpful",
|
|
29
31
|
notHelpful: "Mark this reply not helpful"
|
|
30
|
-
},
|
|
31
|
-
function
|
|
32
|
+
}, v = ["inline", "composer"];
|
|
33
|
+
function et(e) {
|
|
32
34
|
return e.filter((e) => e.prompt != null && e.prompt.trim() !== "");
|
|
33
35
|
}
|
|
34
|
-
function
|
|
36
|
+
function tt(e, t) {
|
|
35
37
|
return e.length > 0 && t.length === 0;
|
|
36
38
|
}
|
|
37
|
-
function
|
|
39
|
+
function nt({ followUps: e, messages: t, thinking: n, sentAfterId: r }) {
|
|
38
40
|
let i = t[t.length - 1];
|
|
39
41
|
return e.length > 0 && !n && i?.role === "assistant" && i.id !== r;
|
|
40
42
|
}
|
|
41
|
-
function
|
|
43
|
+
function rt({ message: e, isLatest: t, thinking: n, takesVotes: r }) {
|
|
42
44
|
if (e.role !== "assistant") return null;
|
|
43
45
|
let i = {
|
|
44
46
|
copy: e.copyText != null,
|
|
@@ -50,189 +52,172 @@ function Xe({ message: e, isLatest: t, thinking: n, takesVotes: r }) {
|
|
|
50
52
|
ready: !(t && n)
|
|
51
53
|
};
|
|
52
54
|
}
|
|
53
|
-
var
|
|
54
|
-
function
|
|
55
|
+
var it = 2e3, at = 48;
|
|
56
|
+
function ot() {
|
|
55
57
|
return window.innerHeight;
|
|
56
58
|
}
|
|
57
|
-
function
|
|
59
|
+
function st() {
|
|
58
60
|
return Number.parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;
|
|
59
61
|
}
|
|
60
|
-
function
|
|
62
|
+
function ct(e, t, n) {
|
|
61
63
|
return e === "inline" ? 32 * n : Math.max(0, Math.min(40 * n, t - 7 * n));
|
|
62
64
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
let
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
let [kt, At] = h(null), [jt, Mt] = h(!I);
|
|
77
|
-
I && jt && Mt(!1);
|
|
78
|
-
let [Nt, Pt] = h(I);
|
|
79
|
-
!I && Nt && Pt(!1);
|
|
80
|
-
let z = ie(D === "fixed" && !A && !P), B = m(null), Ft = m(null), It = m(null), Lt = m(null), Rt = m(null), V = m(null), zt = m(null), Bt = m(F), H = m(I), U = m(null), Vt = m(null), Ht = m(!0), W = m(!1), Ut = m(M), Wt = m(M);
|
|
81
|
-
function G(e) {
|
|
82
|
-
e !== M && (_t || yt(e), lt?.(e));
|
|
65
|
+
function y({ title: s, subtitle: c, mark: u, greeting: v, messages: y = [], thinking: b = !1, suggestions: x = [], onSend: lt, onSuggestionSelect: ut, followUps: S = [], followUpsPlacement: dt = "inline", onMessageFeedback: ft, gate: pt, open: mt, defaultOpen: ht = !1, onOpenChange: gt, placeholder: _t, disclaimer: C, labels: vt, placement: w = "fixed", className: yt }) {
|
|
66
|
+
let T = {
|
|
67
|
+
...$e,
|
|
68
|
+
...vt
|
|
69
|
+
}, bt = Ue(), xt = Ue(), { reducedMotion: St } = He(Qe), E = ce(St), D = ue(), Ct = Ge(se, ot, () => 800), O = Ge(se, st, () => 16), wt = mt !== void 0, [Tt, Et] = p(ht), k = wt ? mt : Tt, [Dt, Ot] = p(""), [kt, At] = p(null), [A, jt] = p(null), [Mt, Nt] = p(!k);
|
|
70
|
+
k && Mt && Nt(!1);
|
|
71
|
+
let j = !k && Mt, M = pt != null, N = M && k, P = w === "fixed" && N, [Pt, Ft] = p(M);
|
|
72
|
+
!M && Pt && Ft(!1);
|
|
73
|
+
let [It, Lt] = p(N);
|
|
74
|
+
!N && It && Lt(!1);
|
|
75
|
+
let F = le(w === "fixed" && !D && !j), Rt = f(null), I = f(null), zt = f(null), Bt = f(null), Vt = f(null), Ht = f(null), Ut = f(M), L = f(N), R = f(null), Wt = f(null), z = f(!0), B = f(!1), V = f(k), H = f(k);
|
|
76
|
+
function U(e) {
|
|
77
|
+
e !== k && (wt || Et(e), gt?.(e));
|
|
83
78
|
}
|
|
84
79
|
function Gt(e) {
|
|
85
80
|
let t = e.trim();
|
|
86
|
-
t !== "" && (
|
|
81
|
+
t !== "" && (U(!0), z.current = !0, Ot(""), At(y[y.length - 1]?.id ?? null), lt(t));
|
|
87
82
|
}
|
|
88
|
-
function
|
|
89
|
-
|
|
83
|
+
function W(e) {
|
|
84
|
+
ut?.(e), e.prompt != null && Gt(e.prompt);
|
|
90
85
|
}
|
|
91
|
-
function
|
|
86
|
+
function Kt(e) {
|
|
92
87
|
let t = e.copyText, n = typeof navigator > "u" ? void 0 : navigator.clipboard;
|
|
93
|
-
t != null && n != null && n.writeText(t).then(() =>
|
|
88
|
+
t != null && n != null && n.writeText(t).then(() => jt({
|
|
94
89
|
id: e.id,
|
|
95
90
|
at: Date.now()
|
|
96
91
|
}), () => void 0);
|
|
97
92
|
}
|
|
98
|
-
|
|
99
|
-
if (
|
|
100
|
-
let e = window.setTimeout(() =>
|
|
93
|
+
d(() => {
|
|
94
|
+
if (A == null) return;
|
|
95
|
+
let e = window.setTimeout(() => jt(null), it);
|
|
101
96
|
return () => window.clearTimeout(e);
|
|
102
|
-
}, [
|
|
103
|
-
function
|
|
104
|
-
|
|
97
|
+
}, [A]);
|
|
98
|
+
function qt(e) {
|
|
99
|
+
W(e), R.current?.focus();
|
|
105
100
|
}
|
|
106
|
-
function
|
|
107
|
-
|
|
101
|
+
function Jt(e) {
|
|
102
|
+
W(e), e.prompt != null && R.current?.focus();
|
|
108
103
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
let e =
|
|
112
|
-
if (e != null &&
|
|
113
|
-
else if (e != null && !
|
|
114
|
-
let t = document.activeElement, n = t == null || t === document.body ||
|
|
115
|
-
t !== e && n && (
|
|
104
|
+
d(() => {
|
|
105
|
+
H.current = k;
|
|
106
|
+
let e = R.current;
|
|
107
|
+
if (e != null && k && !V.current) document.activeElement !== e && e.focus();
|
|
108
|
+
else if (e != null && !k && V.current) {
|
|
109
|
+
let t = document.activeElement, n = t == null || t === document.body || I.current?.contains(t) === !0;
|
|
110
|
+
t !== e && n && (B.current = !0, e.focus(), B.current = !1);
|
|
116
111
|
}
|
|
117
|
-
|
|
118
|
-
}, [
|
|
119
|
-
|
|
120
|
-
}),
|
|
121
|
-
if (
|
|
122
|
-
let e =
|
|
112
|
+
V.current = k;
|
|
113
|
+
}, [k]), d(() => {
|
|
114
|
+
M && !Ut.current && !H.current && U(!0), Ut.current = M;
|
|
115
|
+
}), d(() => {
|
|
116
|
+
if (N && !L.current) {
|
|
117
|
+
let e = Ht.current;
|
|
123
118
|
(e?.querySelector("[data-chat-dock-gate-focus]") ?? e)?.focus({ preventScroll: !0 });
|
|
124
|
-
} else if (!
|
|
125
|
-
let e =
|
|
126
|
-
e != null && n && (
|
|
119
|
+
} else if (!N && L.current && k) {
|
|
120
|
+
let e = R.current, t = document.activeElement, n = t == null || t === document.body || I.current?.contains(t) === !0;
|
|
121
|
+
e != null && n && (B.current = !0, e.focus({ preventScroll: !0 }), B.current = !1);
|
|
127
122
|
}
|
|
128
|
-
|
|
129
|
-
}, [
|
|
130
|
-
if (!
|
|
131
|
-
let e =
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
let t = new ResizeObserver(() => At(e.offsetHeight));
|
|
137
|
-
return t.observe(e), () => {
|
|
138
|
-
t.disconnect();
|
|
123
|
+
L.current = N;
|
|
124
|
+
}, [N, k]), d(() => {
|
|
125
|
+
if (!P) return;
|
|
126
|
+
let e = Rt.current, t = I.current;
|
|
127
|
+
if (e == null || t == null) return;
|
|
128
|
+
let n = ne(e), r = re(), i = ie(t);
|
|
129
|
+
return () => {
|
|
130
|
+
i(), r(), n();
|
|
139
131
|
};
|
|
140
|
-
}, []);
|
|
141
|
-
let
|
|
142
|
-
|
|
143
|
-
let e =
|
|
132
|
+
}, [P]);
|
|
133
|
+
let Yt = C != null, G = w === "fixed" && !D ? "rise" : "grow";
|
|
134
|
+
We(() => {
|
|
135
|
+
let e = I.current, t = Bt.current, n = Vt.current;
|
|
144
136
|
if (e == null || t == null || n == null) return;
|
|
145
137
|
let r = () => {
|
|
146
|
-
let r =
|
|
147
|
-
|
|
148
|
-
let i = tt({
|
|
149
|
-
windowHeight: K === "rise" ? window.innerHeight - z.top - z.bottom : x(D, window.innerHeight, j),
|
|
150
|
-
headerHeight: V.current?.offsetHeight || 4 * j,
|
|
151
|
-
bottomInset: n.offsetHeight + r,
|
|
152
|
-
remPx: j
|
|
153
|
-
});
|
|
154
|
-
e.style.setProperty("--chat-dock-gate-max", `${i}px`);
|
|
138
|
+
let r = G === "rise" ? Math.max(0, window.innerHeight - F.bottom - e.getBoundingClientRect().bottom) : 0;
|
|
139
|
+
zt.current?.style.setProperty("--chat-dock-composer", `${t.offsetHeight + n.offsetHeight + r}px`);
|
|
155
140
|
};
|
|
156
141
|
if (r(), typeof ResizeObserver > "u") return;
|
|
157
142
|
let i = new ResizeObserver(r);
|
|
158
|
-
return i.observe(t), i.observe(n),
|
|
143
|
+
return i.observe(t), i.observe(n), () => {
|
|
159
144
|
i.disconnect();
|
|
160
145
|
};
|
|
161
146
|
}, [
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
]), p(() => {
|
|
171
|
-
let e = Vt.current;
|
|
172
|
-
e != null && Ht.current && (e.scrollTop = e.scrollHeight);
|
|
147
|
+
Yt,
|
|
148
|
+
G,
|
|
149
|
+
Ct,
|
|
150
|
+
F.top,
|
|
151
|
+
F.bottom
|
|
152
|
+
]), We(() => {
|
|
153
|
+
let e = Wt.current;
|
|
154
|
+
e != null && z.current && (e.scrollTop = e.scrollHeight);
|
|
173
155
|
});
|
|
174
|
-
function
|
|
175
|
-
!
|
|
156
|
+
function Xt(e) {
|
|
157
|
+
!k || e.key !== "Escape" || e.defaultPrevented || (e.preventDefault(), U(!1));
|
|
176
158
|
}
|
|
177
|
-
let
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
},
|
|
186
|
-
|
|
159
|
+
let Zt = {
|
|
160
|
+
closeWindow: () => U(!1),
|
|
161
|
+
closeLabel: T.close
|
|
162
|
+
}, Qt = et(x), $t = !M && tt(x, y), en = !M && nt({
|
|
163
|
+
followUps: S,
|
|
164
|
+
messages: y,
|
|
165
|
+
thinking: b,
|
|
166
|
+
sentAfterId: kt
|
|
167
|
+
}), K = k ? "open" : "closed", q = r("medium"), J = r("fast"), Y = n(), X = t(1), Z = Y, Q = { duration: 0 }, $ = {
|
|
168
|
+
default: Q,
|
|
169
|
+
opacity: J
|
|
170
|
+
}, tn = 3.25 * O, nn = {
|
|
171
|
+
height: tn,
|
|
187
172
|
left: 0,
|
|
188
173
|
right: 0,
|
|
189
|
-
borderRadius:
|
|
190
|
-
},
|
|
191
|
-
height:
|
|
192
|
-
left: -
|
|
193
|
-
right: -
|
|
194
|
-
borderRadius:
|
|
195
|
-
},
|
|
174
|
+
borderRadius: tn / 2
|
|
175
|
+
}, rn = {
|
|
176
|
+
height: ct(w, Ct, O),
|
|
177
|
+
left: -O,
|
|
178
|
+
right: -O,
|
|
179
|
+
borderRadius: O
|
|
180
|
+
}, an = E ? {
|
|
196
181
|
open: {
|
|
197
|
-
...
|
|
182
|
+
...G === "grow" ? rn : { y: 0 },
|
|
198
183
|
opacity: 1,
|
|
199
|
-
transition:
|
|
184
|
+
transition: $
|
|
200
185
|
},
|
|
201
186
|
closed: {
|
|
202
|
-
...
|
|
187
|
+
...G === "grow" ? rn : { y: 0 },
|
|
203
188
|
opacity: 0,
|
|
204
|
-
transition:
|
|
189
|
+
transition: $
|
|
205
190
|
}
|
|
206
|
-
} :
|
|
191
|
+
} : G === "grow" ? {
|
|
207
192
|
open: {
|
|
208
|
-
...
|
|
193
|
+
...rn,
|
|
209
194
|
opacity: 1,
|
|
210
|
-
transition:
|
|
195
|
+
transition: q
|
|
211
196
|
},
|
|
212
197
|
closed: {
|
|
213
|
-
...
|
|
198
|
+
...nn,
|
|
214
199
|
opacity: 1,
|
|
215
200
|
transition: {
|
|
216
|
-
...
|
|
217
|
-
delay:
|
|
201
|
+
...q,
|
|
202
|
+
delay: Z
|
|
218
203
|
}
|
|
219
204
|
}
|
|
220
205
|
} : {
|
|
221
206
|
open: {
|
|
222
207
|
y: 0,
|
|
223
208
|
opacity: 1,
|
|
224
|
-
transition:
|
|
209
|
+
transition: q
|
|
225
210
|
},
|
|
226
211
|
closed: {
|
|
227
212
|
y: "100%",
|
|
228
213
|
opacity: 1,
|
|
229
214
|
transition: {
|
|
230
|
-
...
|
|
231
|
-
delay:
|
|
215
|
+
...q,
|
|
216
|
+
delay: Z
|
|
232
217
|
}
|
|
233
218
|
}
|
|
234
|
-
},
|
|
235
|
-
variants:
|
|
219
|
+
}, on = {
|
|
220
|
+
variants: E ? {
|
|
236
221
|
open: {},
|
|
237
222
|
closed: {}
|
|
238
223
|
} : {
|
|
@@ -240,86 +225,86 @@ function w({ title: c, subtitle: l, mark: d, greeting: b, messages: S = [], thin
|
|
|
240
225
|
opacity: 1,
|
|
241
226
|
y: 0,
|
|
242
227
|
transition: {
|
|
243
|
-
...
|
|
244
|
-
delay:
|
|
228
|
+
...J,
|
|
229
|
+
delay: X + e * Y
|
|
245
230
|
}
|
|
246
231
|
}),
|
|
247
232
|
closed: {
|
|
248
233
|
opacity: 0,
|
|
249
234
|
y: 8,
|
|
250
|
-
transition:
|
|
235
|
+
transition: J
|
|
251
236
|
}
|
|
252
237
|
},
|
|
253
238
|
initial: !1,
|
|
254
|
-
animate:
|
|
255
|
-
},
|
|
239
|
+
animate: K
|
|
240
|
+
}, sn = {
|
|
256
241
|
open: {
|
|
257
242
|
width: 0,
|
|
258
243
|
opacity: 0,
|
|
259
|
-
transition:
|
|
260
|
-
width:
|
|
261
|
-
opacity:
|
|
244
|
+
transition: E ? $ : {
|
|
245
|
+
width: q,
|
|
246
|
+
opacity: J
|
|
262
247
|
}
|
|
263
248
|
},
|
|
264
249
|
closed: {
|
|
265
250
|
width: "auto",
|
|
266
251
|
opacity: 1,
|
|
267
|
-
transition:
|
|
252
|
+
transition: E ? $ : {
|
|
268
253
|
width: {
|
|
269
|
-
...
|
|
270
|
-
delay:
|
|
254
|
+
...q,
|
|
255
|
+
delay: Z
|
|
271
256
|
},
|
|
272
257
|
opacity: {
|
|
273
|
-
...
|
|
274
|
-
delay:
|
|
258
|
+
...J,
|
|
259
|
+
delay: X
|
|
275
260
|
}
|
|
276
261
|
}
|
|
277
262
|
}
|
|
278
|
-
},
|
|
263
|
+
}, cn = {
|
|
279
264
|
open: {
|
|
280
265
|
height: "auto",
|
|
281
266
|
opacity: 1,
|
|
282
|
-
transition:
|
|
283
|
-
height:
|
|
267
|
+
transition: E ? $ : {
|
|
268
|
+
height: q,
|
|
284
269
|
opacity: {
|
|
285
|
-
...
|
|
286
|
-
delay:
|
|
270
|
+
...J,
|
|
271
|
+
delay: X
|
|
287
272
|
}
|
|
288
273
|
}
|
|
289
274
|
},
|
|
290
275
|
closed: {
|
|
291
276
|
height: 0,
|
|
292
277
|
opacity: 0,
|
|
293
|
-
transition:
|
|
278
|
+
transition: E ? $ : {
|
|
294
279
|
height: {
|
|
295
|
-
...
|
|
296
|
-
delay:
|
|
280
|
+
...q,
|
|
281
|
+
delay: Z
|
|
297
282
|
},
|
|
298
|
-
opacity:
|
|
283
|
+
opacity: J
|
|
299
284
|
}
|
|
300
285
|
}
|
|
301
|
-
},
|
|
302
|
-
initial: !
|
|
303
|
-
animate:
|
|
286
|
+
}, ln = {
|
|
287
|
+
initial: !E && "hidden",
|
|
288
|
+
animate: k ? "visible" : "folded",
|
|
304
289
|
exit: {
|
|
305
290
|
opacity: 0,
|
|
306
|
-
transition:
|
|
291
|
+
transition: Q
|
|
307
292
|
},
|
|
308
293
|
variants: {
|
|
309
294
|
hidden: {},
|
|
310
295
|
visible: {
|
|
311
296
|
opacity: 1,
|
|
312
297
|
transition: {
|
|
313
|
-
...
|
|
314
|
-
staggerChildren:
|
|
298
|
+
...J,
|
|
299
|
+
staggerChildren: Y
|
|
315
300
|
}
|
|
316
301
|
},
|
|
317
302
|
folded: {
|
|
318
303
|
opacity: 0,
|
|
319
|
-
transition:
|
|
304
|
+
transition: E ? Q : J
|
|
320
305
|
}
|
|
321
306
|
}
|
|
322
|
-
},
|
|
307
|
+
}, un = {
|
|
323
308
|
hidden: {
|
|
324
309
|
opacity: 0,
|
|
325
310
|
y: 6
|
|
@@ -327,147 +312,178 @@ function w({ title: c, subtitle: l, mark: d, greeting: b, messages: S = [], thin
|
|
|
327
312
|
visible: {
|
|
328
313
|
opacity: 1,
|
|
329
314
|
y: 0,
|
|
330
|
-
transition:
|
|
315
|
+
transition: J
|
|
331
316
|
}
|
|
332
|
-
},
|
|
333
|
-
function
|
|
334
|
-
let r =
|
|
335
|
-
return /* @__PURE__ */
|
|
336
|
-
className: e(
|
|
317
|
+
}, dn = (e) => e.preventDefault(), fn = D ? "sm" : "md";
|
|
318
|
+
function pn(t, n) {
|
|
319
|
+
let r = A?.id === t.id, i = t.feedback ?? null, a = (e) => ft?.(t, i === e ? null : e);
|
|
320
|
+
return /* @__PURE__ */ h("div", {
|
|
321
|
+
className: e(Te, n.ready ? void 0 : Ee),
|
|
337
322
|
"data-reply-actions": n.ready ? "ready" : "pending",
|
|
338
|
-
children: [n.copy || n.vote ? /* @__PURE__ */
|
|
339
|
-
className:
|
|
340
|
-
children: [n.copy ? /* @__PURE__ */
|
|
341
|
-
size:
|
|
342
|
-
icon:
|
|
343
|
-
"aria-label": r ?
|
|
344
|
-
onClick: () =>
|
|
345
|
-
}) : null, n.vote ? /* @__PURE__ */
|
|
346
|
-
size:
|
|
347
|
-
icon: /* @__PURE__ */
|
|
348
|
-
"aria-label":
|
|
323
|
+
children: [n.copy || n.vote ? /* @__PURE__ */ h("div", {
|
|
324
|
+
className: De,
|
|
325
|
+
children: [n.copy ? /* @__PURE__ */ m(o, {
|
|
326
|
+
size: fn,
|
|
327
|
+
icon: m(r ? Ke : qe, {}),
|
|
328
|
+
"aria-label": r ? T.copied : T.copy,
|
|
329
|
+
onClick: () => Kt(t)
|
|
330
|
+
}) : null, n.vote ? /* @__PURE__ */ h(Ze, { children: [/* @__PURE__ */ m(o, {
|
|
331
|
+
size: fn,
|
|
332
|
+
icon: /* @__PURE__ */ m(Xe, {}),
|
|
333
|
+
"aria-label": T.helpful,
|
|
349
334
|
pressed: i === "up",
|
|
350
335
|
onClick: () => a("up")
|
|
351
|
-
}), /* @__PURE__ */
|
|
352
|
-
size:
|
|
353
|
-
icon: /* @__PURE__ */
|
|
354
|
-
"aria-label":
|
|
336
|
+
}), /* @__PURE__ */ m(o, {
|
|
337
|
+
size: fn,
|
|
338
|
+
icon: /* @__PURE__ */ m(Ye, {}),
|
|
339
|
+
"aria-label": T.notHelpful,
|
|
355
340
|
pressed: i === "down",
|
|
356
341
|
onClick: () => a("down")
|
|
357
342
|
})] }) : null]
|
|
358
|
-
}) : null, t.meta == null ? null : /* @__PURE__ */
|
|
359
|
-
className:
|
|
360
|
-
children: [t.meta.label, t.meta.description == null ? null : /* @__PURE__ */
|
|
343
|
+
}) : null, t.meta == null ? null : /* @__PURE__ */ h("p", {
|
|
344
|
+
className: ke,
|
|
345
|
+
children: [t.meta.label, t.meta.description == null ? null : /* @__PURE__ */ h("span", {
|
|
361
346
|
className: "sr-only",
|
|
362
347
|
children: [". ", t.meta.description]
|
|
363
348
|
})]
|
|
364
349
|
})]
|
|
365
350
|
});
|
|
366
351
|
}
|
|
367
|
-
return /* @__PURE__ */
|
|
368
|
-
|
|
369
|
-
"
|
|
370
|
-
"data-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
"--chat-dock-vv-
|
|
352
|
+
return /* @__PURE__ */ h("div", {
|
|
353
|
+
ref: Rt,
|
|
354
|
+
className: e(Ae[w], w === "fixed" && !j ? Me : void 0, P ? je : void 0, yt),
|
|
355
|
+
"data-open": k ? "" : void 0,
|
|
356
|
+
"data-gate": N ? "" : void 0,
|
|
357
|
+
style: F.top > 0 || F.bottom > 0 ? {
|
|
358
|
+
"--chat-dock-vv-top": `${F.top}px`,
|
|
359
|
+
"--chat-dock-vv-bottom": `${F.bottom}px`
|
|
374
360
|
} : void 0,
|
|
375
|
-
children: /* @__PURE__ */ g
|
|
376
|
-
|
|
377
|
-
children: /* @__PURE__ */
|
|
361
|
+
children: [/* @__PURE__ */ m(g, {
|
|
362
|
+
initial: !1,
|
|
363
|
+
children: P ? /* @__PURE__ */ m(_.div, {
|
|
364
|
+
className: Ne,
|
|
365
|
+
"aria-hidden": "true",
|
|
366
|
+
"data-chat-dock-scrim": "",
|
|
367
|
+
initial: { opacity: 0 },
|
|
368
|
+
animate: {
|
|
369
|
+
opacity: 1,
|
|
370
|
+
transition: E ? J : q
|
|
371
|
+
},
|
|
372
|
+
exit: {
|
|
373
|
+
opacity: 0,
|
|
374
|
+
transition: E ? J : q
|
|
375
|
+
},
|
|
376
|
+
onClick: () => U(!1)
|
|
377
|
+
}, "scrim") : null
|
|
378
|
+
}), /* @__PURE__ */ m("div", {
|
|
379
|
+
className: xe,
|
|
380
|
+
children: /* @__PURE__ */ m("div", {
|
|
378
381
|
className: "band",
|
|
379
|
-
children: /* @__PURE__ */
|
|
380
|
-
ref:
|
|
381
|
-
className: e(
|
|
382
|
-
role:
|
|
383
|
-
"aria-modal":
|
|
384
|
-
"aria-labelledby":
|
|
385
|
-
"aria-describedby":
|
|
386
|
-
onKeyDown:
|
|
382
|
+
children: /* @__PURE__ */ h("div", {
|
|
383
|
+
ref: I,
|
|
384
|
+
className: e(he, j ? ge : void 0),
|
|
385
|
+
role: k ? "dialog" : void 0,
|
|
386
|
+
"aria-modal": k ? P ? "true" : "false" : void 0,
|
|
387
|
+
"aria-labelledby": k ? bt : void 0,
|
|
388
|
+
"aria-describedby": k && c != null ? xt : void 0,
|
|
389
|
+
onKeyDown: Xt,
|
|
387
390
|
children: [
|
|
388
|
-
/* @__PURE__ */ g
|
|
391
|
+
/* @__PURE__ */ m(g, {
|
|
389
392
|
initial: !1,
|
|
390
|
-
children: !
|
|
391
|
-
className:
|
|
393
|
+
children: !k && Qt.length > 0 ? /* @__PURE__ */ m(_.div, {
|
|
394
|
+
className: we,
|
|
392
395
|
role: "group",
|
|
393
|
-
"aria-label":
|
|
396
|
+
"aria-label": T.suggestions,
|
|
394
397
|
exit: {
|
|
395
398
|
opacity: 0,
|
|
396
|
-
transition:
|
|
399
|
+
transition: E ? Q : J
|
|
397
400
|
},
|
|
398
|
-
children: Qt.map((e, t) => /* @__PURE__ */
|
|
399
|
-
className:
|
|
401
|
+
children: Qt.map((e, t) => /* @__PURE__ */ m("span", {
|
|
402
|
+
className: Ce,
|
|
400
403
|
style: { "--chat-dock-pill-index": t },
|
|
401
|
-
children: /* @__PURE__ */
|
|
404
|
+
children: /* @__PURE__ */ m(a, {
|
|
402
405
|
type: "button",
|
|
403
406
|
role: "secondary",
|
|
404
407
|
size: "md",
|
|
405
408
|
icon: e.icon,
|
|
406
|
-
onClick: () =>
|
|
409
|
+
onClick: () => W(e),
|
|
407
410
|
children: e.label
|
|
408
411
|
})
|
|
409
412
|
}, e.id))
|
|
410
413
|
}, "pills") : null
|
|
411
414
|
}),
|
|
412
|
-
/* @__PURE__ */
|
|
413
|
-
ref:
|
|
414
|
-
className:
|
|
415
|
-
"data-chat-dock-window":
|
|
416
|
-
hidden:
|
|
417
|
-
variants:
|
|
415
|
+
/* @__PURE__ */ h(_.div, {
|
|
416
|
+
ref: zt,
|
|
417
|
+
className: Be[w],
|
|
418
|
+
"data-chat-dock-window": K,
|
|
419
|
+
hidden: j,
|
|
420
|
+
variants: an,
|
|
418
421
|
initial: !1,
|
|
419
|
-
animate:
|
|
422
|
+
animate: K,
|
|
420
423
|
onAnimationComplete: (e) => {
|
|
421
|
-
e === "closed" && !
|
|
424
|
+
e === "closed" && !H.current && Nt(!0);
|
|
422
425
|
},
|
|
423
|
-
children: /* @__PURE__ */ _
|
|
424
|
-
className:
|
|
426
|
+
children: [/* @__PURE__ */ h(_.div, {
|
|
427
|
+
className: e(Ve, Pt ? pe : void 0),
|
|
428
|
+
initial: !1,
|
|
429
|
+
animate: M ? {
|
|
430
|
+
opacity: 0,
|
|
431
|
+
transition: k ? J : Q
|
|
432
|
+
} : {
|
|
433
|
+
opacity: 1,
|
|
434
|
+
transition: k && !E ? {
|
|
435
|
+
...J,
|
|
436
|
+
delay: X
|
|
437
|
+
} : k ? J : Q
|
|
438
|
+
},
|
|
439
|
+
onAnimationComplete: () => {
|
|
440
|
+
M && Ft(!0);
|
|
441
|
+
},
|
|
425
442
|
children: [
|
|
426
|
-
/* @__PURE__ */
|
|
427
|
-
ref: V,
|
|
443
|
+
/* @__PURE__ */ m(_.div, {
|
|
428
444
|
className: "shrink-0",
|
|
429
445
|
custom: 0,
|
|
430
|
-
...
|
|
431
|
-
children: /* @__PURE__ */
|
|
432
|
-
titleId:
|
|
433
|
-
descriptionId:
|
|
434
|
-
title:
|
|
435
|
-
description:
|
|
436
|
-
headerStart:
|
|
437
|
-
closeLabel:
|
|
438
|
-
onClose: () =>
|
|
446
|
+
...on,
|
|
447
|
+
children: /* @__PURE__ */ m(ae, {
|
|
448
|
+
titleId: bt,
|
|
449
|
+
descriptionId: xt,
|
|
450
|
+
title: s,
|
|
451
|
+
description: c,
|
|
452
|
+
headerStart: u,
|
|
453
|
+
closeLabel: T.close,
|
|
454
|
+
onClose: () => U(!1),
|
|
439
455
|
delineated: !0
|
|
440
456
|
})
|
|
441
457
|
}),
|
|
442
|
-
/* @__PURE__ */ _
|
|
443
|
-
ref:
|
|
444
|
-
className:
|
|
458
|
+
/* @__PURE__ */ h(_.div, {
|
|
459
|
+
ref: Wt,
|
|
460
|
+
className: Re,
|
|
445
461
|
role: "log",
|
|
446
|
-
"aria-label":
|
|
462
|
+
"aria-label": T.conversation,
|
|
447
463
|
tabIndex: 0,
|
|
448
464
|
custom: 1,
|
|
449
|
-
...
|
|
465
|
+
...on,
|
|
450
466
|
onScroll: (e) => {
|
|
451
467
|
let t = e.currentTarget;
|
|
452
|
-
|
|
468
|
+
z.current = t.scrollHeight - t.scrollTop - t.clientHeight <= at;
|
|
453
469
|
},
|
|
454
|
-
children: [
|
|
455
|
-
className:
|
|
456
|
-
children:
|
|
457
|
-
}), /* @__PURE__ */
|
|
470
|
+
children: [v == null ? null : /* @__PURE__ */ m("div", {
|
|
471
|
+
className: l,
|
|
472
|
+
children: v
|
|
473
|
+
}), /* @__PURE__ */ h(g, {
|
|
458
474
|
initial: !1,
|
|
459
475
|
children: [
|
|
460
|
-
|
|
461
|
-
let n =
|
|
476
|
+
y.map((e, t) => {
|
|
477
|
+
let n = rt({
|
|
462
478
|
message: e,
|
|
463
|
-
isLatest: t ===
|
|
464
|
-
thinking:
|
|
465
|
-
takesVotes:
|
|
479
|
+
isLatest: t === y.length - 1,
|
|
480
|
+
thinking: b,
|
|
481
|
+
takesVotes: ft != null
|
|
466
482
|
});
|
|
467
|
-
return /* @__PURE__ */
|
|
483
|
+
return /* @__PURE__ */ m(_.div, {
|
|
468
484
|
"data-role": e.role,
|
|
469
|
-
className: e.role === "user" ?
|
|
470
|
-
initial: !
|
|
485
|
+
className: e.role === "user" ? ze : n == null ? l : Oe,
|
|
486
|
+
initial: !E && {
|
|
471
487
|
opacity: 0,
|
|
472
488
|
y: 8
|
|
473
489
|
},
|
|
@@ -475,223 +491,207 @@ function w({ title: c, subtitle: l, mark: d, greeting: b, messages: S = [], thin
|
|
|
475
491
|
opacity: 1,
|
|
476
492
|
y: 0
|
|
477
493
|
},
|
|
478
|
-
transition:
|
|
479
|
-
children: n == null ? e.content : /* @__PURE__ */
|
|
480
|
-
className:
|
|
494
|
+
transition: J,
|
|
495
|
+
children: n == null ? e.content : /* @__PURE__ */ h(Ze, { children: [/* @__PURE__ */ m("div", {
|
|
496
|
+
className: l,
|
|
481
497
|
children: e.content
|
|
482
|
-
}),
|
|
498
|
+
}), pn(e, n)] })
|
|
483
499
|
}, e.id);
|
|
484
500
|
}),
|
|
485
|
-
en &&
|
|
501
|
+
en && dt === "inline" ? /* @__PURE__ */ m(_.div, {
|
|
486
502
|
role: "group",
|
|
487
|
-
"aria-label":
|
|
503
|
+
"aria-label": T.followUps,
|
|
488
504
|
"data-follow-ups": "inline",
|
|
489
|
-
className:
|
|
490
|
-
...
|
|
505
|
+
className: ye,
|
|
506
|
+
...ln,
|
|
491
507
|
animate: "visible",
|
|
492
|
-
children:
|
|
493
|
-
className:
|
|
494
|
-
variants:
|
|
495
|
-
children: /* @__PURE__ */
|
|
508
|
+
children: S.map((e) => /* @__PURE__ */ m(_.div, {
|
|
509
|
+
className: _e,
|
|
510
|
+
variants: un,
|
|
511
|
+
children: /* @__PURE__ */ m(a, {
|
|
496
512
|
type: "button",
|
|
497
513
|
role: "ghost",
|
|
498
514
|
layout: "row",
|
|
499
|
-
onMouseDown:
|
|
500
|
-
onClick: () =>
|
|
501
|
-
children: /* @__PURE__ */
|
|
502
|
-
className:
|
|
503
|
-
children: [/* @__PURE__ */
|
|
515
|
+
onMouseDown: dn,
|
|
516
|
+
onClick: () => qt(e),
|
|
517
|
+
children: /* @__PURE__ */ h("span", {
|
|
518
|
+
className: Ie,
|
|
519
|
+
children: [/* @__PURE__ */ m(i, {
|
|
504
520
|
size: "md",
|
|
505
|
-
children: /* @__PURE__ */
|
|
506
|
-
}), /* @__PURE__ */
|
|
507
|
-
className:
|
|
521
|
+
children: /* @__PURE__ */ m(Je, {})
|
|
522
|
+
}), /* @__PURE__ */ m("span", {
|
|
523
|
+
className: Pe,
|
|
508
524
|
children: e.label
|
|
509
525
|
})]
|
|
510
526
|
})
|
|
511
527
|
})
|
|
512
528
|
}, e.id))
|
|
513
529
|
}, "follow-ups") : null,
|
|
514
|
-
|
|
515
|
-
className:
|
|
516
|
-
initial: !
|
|
530
|
+
b ? /* @__PURE__ */ h(_.div, {
|
|
531
|
+
className: Le,
|
|
532
|
+
initial: !E && { opacity: 0 },
|
|
517
533
|
animate: { opacity: 1 },
|
|
518
534
|
exit: {
|
|
519
535
|
opacity: 0,
|
|
520
|
-
transition:
|
|
536
|
+
transition: Q
|
|
521
537
|
},
|
|
522
|
-
transition:
|
|
523
|
-
children: [/* @__PURE__ */
|
|
538
|
+
transition: J,
|
|
539
|
+
children: [/* @__PURE__ */ m(ee, {
|
|
524
540
|
variant: "dot",
|
|
525
541
|
tone: "neutral",
|
|
526
542
|
pulsing: !0,
|
|
527
543
|
besideLabel: !0
|
|
528
|
-
}), /* @__PURE__ */
|
|
544
|
+
}), /* @__PURE__ */ m("span", { children: T.thinking })]
|
|
529
545
|
}, "thinking") : null
|
|
530
546
|
]
|
|
531
547
|
})]
|
|
532
548
|
}),
|
|
533
|
-
$t ? /* @__PURE__ */
|
|
534
|
-
className:
|
|
549
|
+
$t ? /* @__PURE__ */ m(_.div, {
|
|
550
|
+
className: Fe,
|
|
535
551
|
role: "group",
|
|
536
|
-
"aria-label":
|
|
552
|
+
"aria-label": T.suggestions,
|
|
537
553
|
custom: 2,
|
|
538
|
-
...
|
|
539
|
-
children:
|
|
554
|
+
...on,
|
|
555
|
+
children: x.map((e) => /* @__PURE__ */ m(a, {
|
|
540
556
|
type: "button",
|
|
541
557
|
role: "ghost",
|
|
542
558
|
layout: "row",
|
|
543
|
-
onMouseDown: e.prompt == null ? void 0 :
|
|
544
|
-
onClick: () =>
|
|
545
|
-
children: /* @__PURE__ */
|
|
546
|
-
className:
|
|
547
|
-
children: [e.icon == null ? null : /* @__PURE__ */
|
|
559
|
+
onMouseDown: e.prompt == null ? void 0 : dn,
|
|
560
|
+
onClick: () => Jt(e),
|
|
561
|
+
children: /* @__PURE__ */ h("span", {
|
|
562
|
+
className: Ie,
|
|
563
|
+
children: [e.icon == null ? null : /* @__PURE__ */ m(i, {
|
|
548
564
|
size: "md",
|
|
549
565
|
children: e.icon
|
|
550
|
-
}), /* @__PURE__ */
|
|
551
|
-
className:
|
|
566
|
+
}), /* @__PURE__ */ m("span", {
|
|
567
|
+
className: Pe,
|
|
552
568
|
children: e.label
|
|
553
569
|
})]
|
|
554
570
|
})
|
|
555
571
|
}, e.id))
|
|
556
572
|
}) : null,
|
|
557
|
-
/* @__PURE__ */ g
|
|
573
|
+
/* @__PURE__ */ m(g, {
|
|
558
574
|
initial: !1,
|
|
559
|
-
children: en &&
|
|
575
|
+
children: en && dt === "composer" ? /* @__PURE__ */ m(_.div, {
|
|
560
576
|
role: "group",
|
|
561
|
-
"aria-label":
|
|
577
|
+
"aria-label": T.followUps,
|
|
562
578
|
"data-follow-ups": "composer",
|
|
563
|
-
className:
|
|
564
|
-
...
|
|
565
|
-
children:
|
|
579
|
+
className: ve,
|
|
580
|
+
...ln,
|
|
581
|
+
children: S.map((e) => /* @__PURE__ */ m(_.span, {
|
|
566
582
|
className: "inline-flex",
|
|
567
|
-
variants:
|
|
568
|
-
children: /* @__PURE__ */
|
|
583
|
+
variants: un,
|
|
584
|
+
children: /* @__PURE__ */ m(a, {
|
|
569
585
|
type: "button",
|
|
570
586
|
role: "secondary",
|
|
571
587
|
size: "md",
|
|
572
|
-
onMouseDown:
|
|
573
|
-
onClick: () =>
|
|
588
|
+
onMouseDown: dn,
|
|
589
|
+
onClick: () => qt(e),
|
|
574
590
|
children: e.label
|
|
575
591
|
})
|
|
576
592
|
}, e.id))
|
|
577
593
|
}, "follow-ups") : null
|
|
578
594
|
})
|
|
579
595
|
]
|
|
580
|
-
})
|
|
581
|
-
|
|
582
|
-
|
|
596
|
+
}), /* @__PURE__ */ m(g, {
|
|
597
|
+
initial: !1,
|
|
598
|
+
children: M ? /* @__PURE__ */ m(_.div, {
|
|
599
|
+
ref: Ht,
|
|
600
|
+
className: be[w],
|
|
601
|
+
"data-chat-dock-gate": "",
|
|
602
|
+
initial: { opacity: 0 },
|
|
603
|
+
animate: k ? {
|
|
604
|
+
opacity: 1,
|
|
605
|
+
transition: E ? J : {
|
|
606
|
+
...J,
|
|
607
|
+
delay: X
|
|
608
|
+
}
|
|
609
|
+
} : {
|
|
610
|
+
opacity: 0,
|
|
611
|
+
transition: J
|
|
612
|
+
},
|
|
613
|
+
exit: {
|
|
614
|
+
opacity: 0,
|
|
615
|
+
transition: J
|
|
616
|
+
},
|
|
617
|
+
children: /* @__PURE__ */ m(oe.Provider, {
|
|
618
|
+
value: Zt,
|
|
619
|
+
children: pt
|
|
620
|
+
})
|
|
621
|
+
}, "gate") : null
|
|
622
|
+
})]
|
|
623
|
+
}, G),
|
|
624
|
+
/* @__PURE__ */ m("span", {
|
|
583
625
|
className: "sr-only",
|
|
584
626
|
role: "status",
|
|
585
|
-
children:
|
|
627
|
+
children: A == null ? "" : T.copied
|
|
586
628
|
}),
|
|
587
|
-
/* @__PURE__ */
|
|
588
|
-
className:
|
|
589
|
-
children: [/* @__PURE__ */
|
|
590
|
-
ref:
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
transition: {
|
|
614
|
-
...Y,
|
|
615
|
-
delay: k ? 0 : Y.duration
|
|
616
|
-
}
|
|
617
|
-
} : {
|
|
618
|
-
opacity: 0,
|
|
619
|
-
y: 12,
|
|
620
|
-
transition: Y
|
|
621
|
-
},
|
|
622
|
-
exit: {
|
|
623
|
-
opacity: 0,
|
|
624
|
-
y: 12,
|
|
625
|
-
transition: Y
|
|
626
|
-
},
|
|
627
|
-
onAnimationComplete: () => {
|
|
628
|
-
I || Mt(!0);
|
|
629
|
-
},
|
|
630
|
-
children: ot
|
|
631
|
-
}, "gate") : null
|
|
632
|
-
}), /* @__PURE__ */ g(y.div, {
|
|
633
|
-
className: e(le, I ? "pointer-events-none" : void 0),
|
|
634
|
-
hidden: Nt,
|
|
635
|
-
initial: !1,
|
|
636
|
-
animate: I ? {
|
|
637
|
-
opacity: 0,
|
|
638
|
-
transition: Y
|
|
639
|
-
} : {
|
|
640
|
-
opacity: 1,
|
|
641
|
-
transition: {
|
|
642
|
-
...Y,
|
|
643
|
-
delay: L && !k ? Y.duration : 0
|
|
644
|
-
}
|
|
629
|
+
/* @__PURE__ */ h("div", {
|
|
630
|
+
className: e(de, N ? "pointer-events-none" : void 0),
|
|
631
|
+
children: [/* @__PURE__ */ m("div", {
|
|
632
|
+
ref: Bt,
|
|
633
|
+
children: /* @__PURE__ */ m(_.div, {
|
|
634
|
+
className: It ? pe : void 0,
|
|
635
|
+
"aria-hidden": N ? !0 : void 0,
|
|
636
|
+
initial: !1,
|
|
637
|
+
animate: N ? {
|
|
638
|
+
opacity: 0,
|
|
639
|
+
transition: J
|
|
640
|
+
} : {
|
|
641
|
+
opacity: 1,
|
|
642
|
+
transition: k && !E ? {
|
|
643
|
+
...J,
|
|
644
|
+
delay: X
|
|
645
|
+
} : J
|
|
646
|
+
},
|
|
647
|
+
onAnimationComplete: () => {
|
|
648
|
+
N && Lt(!0);
|
|
649
|
+
},
|
|
650
|
+
children: /* @__PURE__ */ m(te, {
|
|
651
|
+
ref: R,
|
|
652
|
+
value: Dt,
|
|
653
|
+
onValueChange: (e) => {
|
|
654
|
+
Ot(e), U(!0);
|
|
645
655
|
},
|
|
646
|
-
|
|
647
|
-
|
|
656
|
+
onSend: Gt,
|
|
657
|
+
onFocus: () => {
|
|
658
|
+
B.current || U(!0);
|
|
648
659
|
},
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
"aria-hidden": M ? !0 : void 0,
|
|
663
|
-
variants: ln,
|
|
664
|
-
initial: !1,
|
|
665
|
-
animate: q,
|
|
666
|
-
children: d
|
|
667
|
-
}),
|
|
668
|
-
placeholder: ut,
|
|
669
|
-
"aria-label": O.field,
|
|
670
|
-
sendLabel: O.send
|
|
671
|
-
})
|
|
672
|
-
})]
|
|
660
|
+
onClick: () => U(!0),
|
|
661
|
+
start: u == null ? void 0 : /* @__PURE__ */ m(_.span, {
|
|
662
|
+
className: Se,
|
|
663
|
+
"aria-hidden": k ? !0 : void 0,
|
|
664
|
+
variants: sn,
|
|
665
|
+
initial: !1,
|
|
666
|
+
animate: K,
|
|
667
|
+
children: u
|
|
668
|
+
}),
|
|
669
|
+
placeholder: _t,
|
|
670
|
+
"aria-label": T.field,
|
|
671
|
+
sendLabel: T.send
|
|
672
|
+
})
|
|
673
673
|
})
|
|
674
|
-
}), /* @__PURE__ */
|
|
674
|
+
}), /* @__PURE__ */ m(_.div, {
|
|
675
675
|
className: "overflow-hidden",
|
|
676
|
-
"aria-hidden": !
|
|
677
|
-
variants:
|
|
676
|
+
"aria-hidden": !k || void 0,
|
|
677
|
+
variants: cn,
|
|
678
678
|
initial: !1,
|
|
679
|
-
animate:
|
|
680
|
-
children: /* @__PURE__ */
|
|
681
|
-
ref:
|
|
682
|
-
children:
|
|
683
|
-
className:
|
|
684
|
-
children:
|
|
685
|
-
}) : /* @__PURE__ */
|
|
679
|
+
animate: K,
|
|
680
|
+
children: /* @__PURE__ */ m("div", {
|
|
681
|
+
ref: Vt,
|
|
682
|
+
children: C != null && !N ? /* @__PURE__ */ m("p", {
|
|
683
|
+
className: me[w],
|
|
684
|
+
children: C
|
|
685
|
+
}) : /* @__PURE__ */ m("div", { className: fe[w] })
|
|
686
686
|
})
|
|
687
687
|
})]
|
|
688
688
|
})
|
|
689
689
|
]
|
|
690
690
|
})
|
|
691
691
|
})
|
|
692
|
-
})
|
|
692
|
+
})]
|
|
693
693
|
});
|
|
694
694
|
}
|
|
695
|
-
var
|
|
695
|
+
var b = Object.assign(y, { Gate: s });
|
|
696
696
|
//#endregion
|
|
697
|
-
export {
|
|
697
|
+
export { b as ChatDock, s as ChatDockGate, $e as chatDockDefaultLabels, v as chatDockFollowUpsPlacements, c as chatDockGateDefaultLabels, ct as chatDockOpenHeight, et as chatDockPillSuggestions, u as chatDockPlacements, rt as chatDockReplyRow, nt as chatDockShowsFollowUps, tt as chatDockShowsSuggestionRows };
|