@thewhatmatters/wmds 0.4.3 → 0.4.4

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