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