@gv-tech/ui-web 2.29.2 → 2.29.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 (265) hide show
  1. package/dist/accordion.cjs +1 -1
  2. package/dist/accordion.mjs +53 -1
  3. package/dist/alert-dialog.cjs +1 -1
  4. package/dist/alert-dialog.mjs +99 -1
  5. package/dist/alert.cjs +1 -1
  6. package/dist/alert.mjs +1 -1
  7. package/dist/aspect-ratio.cjs +1 -1
  8. package/dist/aspect-ratio.mjs +10 -1
  9. package/dist/attachment.cjs +1 -1
  10. package/dist/attachment.mjs +25 -24
  11. package/dist/avatar.cjs +1 -1
  12. package/dist/avatar.mjs +49 -1
  13. package/dist/badge.cjs +1 -1
  14. package/dist/badge.mjs +5 -4
  15. package/dist/breadcrumb.cjs +1 -1
  16. package/dist/breadcrumb.mjs +12 -11
  17. package/dist/bubble.cjs +1 -1
  18. package/dist/bubble.mjs +4 -3
  19. package/dist/button-group.cjs +1 -1
  20. package/dist/button-group.mjs +12 -11
  21. package/dist/button.cjs +1 -1
  22. package/dist/button.mjs +4 -3
  23. package/dist/calendar.cjs +1 -1
  24. package/dist/calendar.mjs +97 -1
  25. package/dist/card.cjs +1 -1
  26. package/dist/card.mjs +1 -1
  27. package/dist/carousel.cjs +1 -1
  28. package/dist/carousel.mjs +107 -1
  29. package/dist/chart.cjs +2 -2
  30. package/dist/chart.mjs +1 -1
  31. package/dist/checkbox.cjs +1 -1
  32. package/dist/checkbox.mjs +19 -1
  33. package/dist/collapsible.cjs +1 -1
  34. package/dist/collapsible.mjs +12 -12
  35. package/dist/combobox.cjs +1 -1
  36. package/dist/combobox.mjs +161 -1
  37. package/dist/command.cjs +1 -1
  38. package/dist/command.mjs +89 -1
  39. package/dist/context-menu.cjs +1 -1
  40. package/dist/context-menu.mjs +123 -1
  41. package/dist/dialog.cjs +1 -1
  42. package/dist/dialog.mjs +40 -40
  43. package/dist/direction.cjs +1 -1
  44. package/dist/direction.mjs +7 -7
  45. package/dist/drawer.cjs +1 -1
  46. package/dist/drawer.mjs +1 -1
  47. package/dist/dropdown-menu.cjs +1 -1
  48. package/dist/dropdown-menu.mjs +126 -1
  49. package/dist/empty.cjs +1 -1
  50. package/dist/empty.mjs +1 -1
  51. package/dist/field.cjs +1 -1
  52. package/dist/field.mjs +36 -36
  53. package/dist/form.cjs +1 -1
  54. package/dist/form.mjs +36 -36
  55. package/dist/hover-card.cjs +1 -1
  56. package/dist/hover-card.mjs +30 -1
  57. package/dist/index.cjs +1 -1
  58. package/dist/index.mjs +36 -36
  59. package/dist/input-group.cjs +1 -1
  60. package/dist/input-group.mjs +26 -26
  61. package/dist/input-otp.cjs +1 -1
  62. package/dist/input-otp.mjs +45 -1
  63. package/dist/input.cjs +1 -1
  64. package/dist/input.mjs +1 -1
  65. package/dist/item.cjs +1 -1
  66. package/dist/item.mjs +28 -27
  67. package/dist/kbd.cjs +1 -1
  68. package/dist/kbd.mjs +1 -1
  69. package/dist/label.cjs +1 -1
  70. package/dist/label.mjs +13 -1
  71. package/dist/marker.cjs +1 -1
  72. package/dist/marker.mjs +4 -3
  73. package/dist/menubar.cjs +1 -1
  74. package/dist/menubar.mjs +133 -1
  75. package/dist/message-scroller.cjs +1 -1
  76. package/dist/message-scroller.mjs +59 -1
  77. package/dist/message.cjs +1 -1
  78. package/dist/message.mjs +1 -1
  79. package/dist/native-select.cjs +1 -1
  80. package/dist/native-select.mjs +1 -1
  81. package/dist/navigation-menu.cjs +1 -1
  82. package/dist/navigation-menu.mjs +79 -1
  83. package/dist/pagination.cjs +1 -1
  84. package/dist/pagination.mjs +14 -14
  85. package/dist/popover.cjs +1 -1
  86. package/dist/popover.mjs +54 -1
  87. package/dist/progress.cjs +1 -1
  88. package/dist/progress.mjs +19 -1
  89. package/dist/questionnaire.cjs +1 -1
  90. package/dist/questionnaire.mjs +168 -1
  91. package/dist/radio-group.cjs +1 -1
  92. package/dist/radio-group.mjs +25 -1
  93. package/dist/resizable.cjs +1 -1
  94. package/dist/resizable.mjs +26 -1
  95. package/dist/rolldown-runtime-BocRIvOZ.js +1 -0
  96. package/dist/scroll-area.cjs +1 -1
  97. package/dist/scroll-area.mjs +35 -1
  98. package/dist/scroll-to-top.cjs +1 -1
  99. package/dist/search.cjs +1 -1
  100. package/dist/search.mjs +1 -1
  101. package/dist/select.cjs +1 -1
  102. package/dist/select.mjs +98 -1
  103. package/dist/separator.cjs +1 -1
  104. package/dist/separator.mjs +15 -1
  105. package/dist/sheet.cjs +1 -1
  106. package/dist/sheet.mjs +38 -38
  107. package/dist/{sidebar-C2ax_A0G.mjs → sidebar-DrU3nKaL.mjs} +138 -134
  108. package/dist/sidebar-uOtFHnBs.js +1 -0
  109. package/dist/sidebar.cjs +1 -1
  110. package/dist/sidebar.mjs +3 -1
  111. package/dist/skeleton.cjs +1 -1
  112. package/dist/skeleton.mjs +1 -1
  113. package/dist/slider.cjs +1 -1
  114. package/dist/slider.mjs +34 -1
  115. package/dist/spinner.cjs +1 -1
  116. package/dist/spinner.mjs +1 -1
  117. package/dist/support-fab.cjs +1 -1
  118. package/dist/switch.cjs +1 -1
  119. package/dist/switch.mjs +18 -1
  120. package/dist/table-of-contents.cjs +1 -1
  121. package/dist/table.cjs +1 -1
  122. package/dist/table.mjs +1 -1
  123. package/dist/tabs.cjs +1 -1
  124. package/dist/tabs.mjs +44 -1
  125. package/dist/text.cjs +1 -1
  126. package/dist/textarea.cjs +1 -1
  127. package/dist/textarea.mjs +1 -1
  128. package/dist/{theme-toggle-BSMwXb8o.mjs → theme-toggle-9KtAIRxy.mjs} +6 -6
  129. package/dist/theme-toggle-DkNI3bfh.js +1 -0
  130. package/dist/theme-toggle.cjs +1 -1
  131. package/dist/theme-toggle.mjs +2 -1
  132. package/dist/toast.cjs +1 -1
  133. package/dist/toast.mjs +52 -1
  134. package/dist/{toaster-D2BV6jez.mjs → toaster-8RrHPtlc.mjs} +8 -8
  135. package/dist/toaster-AFud4l6l.js +1 -0
  136. package/dist/toaster.cjs +1 -1
  137. package/dist/toaster.mjs +2 -1
  138. package/dist/toggle-group.cjs +1 -1
  139. package/dist/toggle-group.mjs +49 -1
  140. package/dist/toggle.cjs +1 -1
  141. package/dist/toggle.mjs +35 -1
  142. package/dist/tooltip.cjs +1 -1
  143. package/dist/tooltip.mjs +34 -1
  144. package/package.json +1 -1
  145. package/dist/accordion-Bd0-CZQn.js +0 -1
  146. package/dist/accordion-Cf6DNbLH.mjs +0 -244
  147. package/dist/alert-dialog-BxFH0Lwn.mjs +0 -180
  148. package/dist/alert-dialog-C6vNmGBL.js +0 -1
  149. package/dist/aspect-ratio-CdQevcDV.mjs +0 -38
  150. package/dist/aspect-ratio-Z4Nkc56X.js +0 -1
  151. package/dist/avatar-B5PWwGhY.mjs +0 -136
  152. package/dist/avatar-CFhYRM52.js +0 -1
  153. package/dist/calendar-D5qgt2o2.js +0 -1
  154. package/dist/calendar-DIqXNjOR.mjs +0 -3029
  155. package/dist/carousel-D-xEqRCX.js +0 -1
  156. package/dist/carousel-DPjWmM_A.mjs +0 -1169
  157. package/dist/checkbox-DEPm1BBc.mjs +0 -184
  158. package/dist/checkbox-DI9Hn_e_.js +0 -1
  159. package/dist/chunk-HBS6WEDP-D2-yWzIN.js +0 -1
  160. package/dist/chunk-HBS6WEDP-DD8ZmxRM.mjs +0 -62
  161. package/dist/combobox-C4y8AbZX.mjs +0 -5644
  162. package/dist/combobox-boXp-mix.js +0 -3
  163. package/dist/command-BnW6UIVk.js +0 -1
  164. package/dist/command-Cbsp7PBx.mjs +0 -542
  165. package/dist/context-menu-CwsdFpx1.js +0 -1
  166. package/dist/context-menu-FNgV55ZV.mjs +0 -315
  167. package/dist/dist-7YyzJonC.mjs +0 -39
  168. package/dist/dist-AlmToDtO.mjs +0 -17
  169. package/dist/dist-B76UOZbx.mjs +0 -40
  170. package/dist/dist-B7Ph9-T6.mjs +0 -44
  171. package/dist/dist-B7jnFMko.js +0 -1
  172. package/dist/dist-BOiFyvyS.mjs +0 -10
  173. package/dist/dist-BQkDLAY7.js +0 -1
  174. package/dist/dist-Bal96K8t.js +0 -1
  175. package/dist/dist-Blgp9lfa.js +0 -1
  176. package/dist/dist-BnlI08Je.mjs +0 -96
  177. package/dist/dist-Bu-uFV1C.mjs +0 -191
  178. package/dist/dist-C2BHd5i1.mjs +0 -460
  179. package/dist/dist-C516Vwxy.mjs +0 -116
  180. package/dist/dist-CBlqVBTk.js +0 -1
  181. package/dist/dist-CDcZ8WMF.js +0 -1
  182. package/dist/dist-CDksSmTD.mjs +0 -189
  183. package/dist/dist-CF-qVmmV.js +0 -1
  184. package/dist/dist-CIgGRTmJ.js +0 -1
  185. package/dist/dist-CJqVmdrU.js +0 -1
  186. package/dist/dist-COqM3IM6.mjs +0 -89
  187. package/dist/dist-CbWpCWog.mjs +0 -180
  188. package/dist/dist-CcGLWbPa.mjs +0 -19
  189. package/dist/dist-Cn4F8XlY.mjs +0 -220
  190. package/dist/dist-CoTs6T03.js +0 -1
  191. package/dist/dist-Co_xSt6d.js +0 -1
  192. package/dist/dist-Cu0GG-3j.mjs +0 -15
  193. package/dist/dist-DJqkhIXb.js +0 -1
  194. package/dist/dist-DKI-XYwI.mjs +0 -98
  195. package/dist/dist-DQeXXRYL.mjs +0 -201
  196. package/dist/dist-DW2ltK5-.js +0 -1
  197. package/dist/dist-DWcKY_sJ.js +0 -1
  198. package/dist/dist-DZiOPWLp.js +0 -1
  199. package/dist/dist-DdAeWIwf.js +0 -1
  200. package/dist/dist-DhubV_gU.mjs +0 -4
  201. package/dist/dist-DmY7elIQ.js +0 -1
  202. package/dist/dist-DoWtzxYc.mjs +0 -684
  203. package/dist/dist-DuQlxGyN.js +0 -1
  204. package/dist/dist-KFF7QKuL.js +0 -1
  205. package/dist/dist-RXrZgzkO.js +0 -1
  206. package/dist/dist-R_G5UQRm.js +0 -1
  207. package/dist/dist-dwRwxUPt.mjs +0 -22
  208. package/dist/dist-fzmUl3YX.mjs +0 -553
  209. package/dist/dist-hBsne-A2.mjs +0 -92
  210. package/dist/dist-ljiGYyay.mjs +0 -29
  211. package/dist/dist-pqMcQ1Nk.js +0 -1
  212. package/dist/dist-zmnQp5Xf.js +0 -1
  213. package/dist/dropdown-menu-ChuqZeix.js +0 -1
  214. package/dist/dropdown-menu-DU7KNoXP.mjs +0 -311
  215. package/dist/es2015-BooeZGhO.mjs +0 -554
  216. package/dist/es2015-Dggv0vx3.js +0 -41
  217. package/dist/floating-ui.react-dom-2hihjuTL.mjs +0 -1057
  218. package/dist/floating-ui.react-dom-BtFIezY4.js +0 -1
  219. package/dist/hover-card-BeqCs_2R.js +0 -1
  220. package/dist/hover-card-w8PmCyw2.mjs +0 -176
  221. package/dist/input-otp-Bn_Uy1mR.mjs +0 -398
  222. package/dist/input-otp-CTRB_0Xp.js +0 -20
  223. package/dist/label-Da0kELfR.mjs +0 -26
  224. package/dist/label-JMa1tFfC.js +0 -1
  225. package/dist/menubar-B7sRxpE4.mjs +0 -405
  226. package/dist/menubar-Bd-QKMcw.js +0 -1
  227. package/dist/message-scroller-B8AU0v3Y.mjs +0 -805
  228. package/dist/message-scroller-BJb4Mh_I.js +0 -1
  229. package/dist/navigation-menu-B-RwfscB.mjs +0 -638
  230. package/dist/navigation-menu-kPwxYZCR.js +0 -1
  231. package/dist/popover-Cq5cTNtC.js +0 -1
  232. package/dist/popover-T6Ra737i.mjs +0 -241
  233. package/dist/progress-e9YzxvRo.mjs +0 -90
  234. package/dist/progress-iUSEI7J9.js +0 -6
  235. package/dist/questionnaire-BLCvUX1C.mjs +0 -1137
  236. package/dist/questionnaire-CcymIPae.js +0 -1
  237. package/dist/radio-group-BKpiDcIb.mjs +0 -264
  238. package/dist/radio-group-DPEzCmxe.js +0 -1
  239. package/dist/resizable-ByF0NmN9.mjs +0 -2153
  240. package/dist/resizable-oL3v42zT.js +0 -1
  241. package/dist/rolldown-runtime-D7yIeQp2.mjs +0 -13
  242. package/dist/rolldown-runtime-DbbDpzbe.js +0 -1
  243. package/dist/scroll-area-BzNeOQ6C.mjs +0 -568
  244. package/dist/scroll-area-s4_ZJK59.js +0 -1
  245. package/dist/select-B_nRxX2Y.mjs +0 -831
  246. package/dist/select-j5_dph9S.js +0 -1
  247. package/dist/separator-Bn-3XUSJ.js +0 -1
  248. package/dist/separator-CCcMNS78.mjs +0 -38
  249. package/dist/sidebar-Cnem2n5A.js +0 -1
  250. package/dist/slider-B2PUTc7W.mjs +0 -484
  251. package/dist/slider-wZuXwuib.js +0 -1
  252. package/dist/switch-CD675xU7.js +0 -1
  253. package/dist/switch-ikzIzrme.mjs +0 -172
  254. package/dist/tabs-DCm5zOYB.mjs +0 -158
  255. package/dist/tabs-fcahDQDp.js +0 -1
  256. package/dist/theme-toggle-BGTJsIA-.js +0 -1
  257. package/dist/toast-C31v9P1K.js +0 -1
  258. package/dist/toast-vU5ISM03.mjs +0 -445
  259. package/dist/toaster-CaJyOCyC.js +0 -1
  260. package/dist/toggle-CSZdCCwX.js +0 -1
  261. package/dist/toggle-Cv9YYwLI.mjs +0 -58
  262. package/dist/toggle-group-RT8wyBwK.js +0 -1
  263. package/dist/toggle-group-qvjasXS-.mjs +0 -166
  264. package/dist/tooltip-7ERoN5mV.mjs +0 -386
  265. package/dist/tooltip-CC9_spXT.js +0 -1
@@ -1,805 +0,0 @@
1
- import { n as e, r as t, t as n } from "./chunk-HBS6WEDP-DD8ZmxRM.mjs";
2
- import { t as r } from "./dist-DoWtzxYc.mjs";
3
- import { Button as i } from "./button.mjs";
4
- import { ArrowDownIcon as a } from "lucide-react";
5
- import * as o from "react";
6
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
7
- // ../../node_modules/.bun/@shadcn+react@0.3.1+0ac650c021fb1b59/node_modules/@shadcn/react/dist/message-scroller/index.js
8
- var u = 8, d = 64, f = 0, p = .5, m = 180, h = /* @__PURE__ */ new Set([
9
- "ArrowDown",
10
- "ArrowUp",
11
- "End",
12
- "Home",
13
- "PageDown",
14
- "PageUp",
15
- " "
16
- ]), g = {
17
- start: !1,
18
- end: !1
19
- }, _ = {
20
- currentAnchorId: null,
21
- visibleMessageIds: []
22
- };
23
- function v({ content: e, scrollEdgeThreshold: t, spacer: n, viewport: r }) {
24
- if (!r || !e) return g;
25
- let i = k({
26
- content: e,
27
- spacer: n,
28
- viewport: r
29
- });
30
- return {
31
- start: r.scrollTop > t,
32
- end: i - r.scrollTop - r.clientHeight > t
33
- };
34
- }
35
- function y({ content: e, scrollMargin: t, scrollPreviousItemPeek: n, spacer: r, viewport: i, visibleMessageIds: a }) {
36
- if (!e || !i) return _;
37
- let o = i.getBoundingClientRect(), s = o.top + t + n, c = typeof IntersectionObserver > "u", l = [], u = null;
38
- for (let t of b(e, r)) {
39
- let e = t.dataset.messageId;
40
- if (!e) continue;
41
- let n = t.dataset.scrollAnchor === "true", r = n || c ? t.getBoundingClientRect() : null;
42
- (c && r ? r.bottom > s && r.top < o.bottom : a.has(e)) && l.push(e), n && r && r.top <= s + p && (u = e);
43
- }
44
- return l.length === 0 && u === null ? _ : {
45
- currentAnchorId: u,
46
- visibleMessageIds: l
47
- };
48
- }
49
- function b(e, t) {
50
- return Array.from(e.children).filter((e) => e instanceof HTMLElement && e !== t);
51
- }
52
- function x(e, t) {
53
- for (let n = t; n < e.length; n++) {
54
- let t = e[n];
55
- if (t?.dataset.scrollAnchor === "true") return t;
56
- }
57
- return null;
58
- }
59
- function S(e, t) {
60
- for (let n of e) if (n.dataset.scrollAnchor === "true" && !t.has(n)) return n;
61
- return null;
62
- }
63
- function C(e, t) {
64
- let n = 0;
65
- for (let r = t; r < e.length; r++) if (e[r]?.dataset.scrollAnchor === "true" && (n += 1, n > 1)) return !0;
66
- return !1;
67
- }
68
- function w(e) {
69
- for (let t = e.length - 1; t >= 0; t--) {
70
- let n = e[t];
71
- if (n?.dataset.scrollAnchor === "true") return n;
72
- }
73
- return null;
74
- }
75
- function T({ content: e, spacer: t, viewport: n }) {
76
- let r = n.getBoundingClientRect();
77
- for (let n of b(e, t)) {
78
- if (!n.dataset.messageId) continue;
79
- let e = n.getBoundingClientRect();
80
- if (e.bottom > r.top && e.top < r.bottom) return n;
81
- }
82
- return null;
83
- }
84
- function E({ align: e, element: t, scrollMargin: n, spacer: r, viewport: i }) {
85
- let a = ee(t, i), o = t.getBoundingClientRect().height, s = j(r);
86
- if (e === "center") {
87
- let e = Math.max(0, i.clientHeight - s.start - s.end);
88
- return a - s.start - (e - o) / 2 - n;
89
- }
90
- if (e === "end") return a - i.clientHeight + o + s.end + n;
91
- if (e === "nearest") {
92
- let e = a + o, t = i.scrollTop + s.start, r = i.scrollTop + i.clientHeight - s.end;
93
- return a >= t && e <= r ? i.scrollTop : a < t ? a - s.start - n : e - i.clientHeight + s.end + n;
94
- }
95
- return a - s.start - n;
96
- }
97
- function ee(e, t) {
98
- let n = e.getBoundingClientRect(), r = t.getBoundingClientRect();
99
- return n.top - r.top + t.scrollTop;
100
- }
101
- function D(e, t) {
102
- return e.getBoundingClientRect().top - t.getBoundingClientRect().top;
103
- }
104
- function O({ content: e, scrollTop: t, spacer: n, viewport: r }) {
105
- let i = k({
106
- content: e,
107
- spacer: n,
108
- viewport: r
109
- });
110
- return t + r.clientHeight - i;
111
- }
112
- function k({ content: e, spacer: t, viewport: n }) {
113
- let r = b(e, t), i = A(e), a = n.getBoundingClientRect(), o = n.scrollTop, s = i.start + i.end;
114
- for (let e of r) {
115
- let t = e.getBoundingClientRect();
116
- s = Math.max(s, t.bottom - a.top + o + i.end);
117
- }
118
- return s;
119
- }
120
- function te(e) {
121
- return Math.max(0, e.scrollHeight - e.clientHeight);
122
- }
123
- function A(e) {
124
- let t = window.getComputedStyle(e);
125
- return {
126
- end: M(t.paddingBlockEnd || t.paddingBottom),
127
- start: M(t.paddingBlockStart || t.paddingTop)
128
- };
129
- }
130
- function j(e) {
131
- let t = e?.parentElement;
132
- return t ? A(t) : {
133
- end: 0,
134
- start: 0
135
- };
136
- }
137
- function ne(e) {
138
- if (!e) return 0;
139
- let t = window.getComputedStyle(e);
140
- return M(t.rowGap === "normal" ? t.gap : t.rowGap);
141
- }
142
- function M(e) {
143
- if (!e) return 0;
144
- let t = Number.parseFloat(e);
145
- return Number.isFinite(t) ? t : 0;
146
- }
147
- function re(e, t) {
148
- let n = e, r = /* @__PURE__ */ new Set();
149
- return {
150
- getSnapshot: () => n,
151
- hasListeners: () => r.size > 0,
152
- setSnapshot: (e) => {
153
- t(n, e) || (n = e, r.forEach((e) => e()));
154
- },
155
- subscribe: (e, t, n) => {
156
- let i = r.size === 0;
157
- return r.add(e), i && t?.(), () => {
158
- r.delete(e), r.size === 0 && n?.();
159
- };
160
- }
161
- };
162
- }
163
- function N(e, t) {
164
- return re(e, t);
165
- }
166
- function ie() {
167
- return re(_, oe);
168
- }
169
- function ae(e, t) {
170
- return e.start === t.start && e.end === t.end;
171
- }
172
- function oe(e, t) {
173
- return e.currentAnchorId !== t.currentAnchorId || e.visibleMessageIds.length !== t.visibleMessageIds.length ? !1 : e.visibleMessageIds.every((e, n) => e === t.visibleMessageIds[n]);
174
- }
175
- function se({ autoScroll: e, defaultScrollPosition: t, scrollEdgeThreshold: n, scrollMargin: r, scrollPreviousItemPeek: i }) {
176
- let a = o.useRef(e), s = o.useRef(!1), c = o.useRef(null), l = o.useRef(!1), u = o.useRef(n), d = o.useRef(0), f = o.useRef(null), p = o.useRef(0), m = o.useRef(e ? "following-bottom" : "free-scrolling"), h = o.useRef(/* @__PURE__ */ new Map()), _ = o.useRef(null), v = o.useRef(null), y = o.useRef(null), b = o.useRef(i), x = o.useRef(!0), S = o.useRef(null), C = o.useRef(r), w = o.useRef(null), T = o.useRef(0), E = o.useRef(0), ee = o.useRef(null), D = o.useRef(null), O = o.useRef(null), k = o.useRef(null), te = o.useRef(null), A = o.useRef(null), j = o.useRef(null), ne = o.useRef(null), M = o.useRef(null), re = o.useRef(/* @__PURE__ */ new Set()), oe = o.useRef(/* @__PURE__ */ new WeakSet());
177
- return O.current === null && (O.current = N(t === "end" || t === "last-anchor", (e, t) => e === t)), k.current === null && (k.current = N(g, ae)), M.current === null && (M.current = ie()), a.current = e, u.current = n, C.current = r, b.current = i, {
178
- autoScrollRef: a,
179
- autoscrollingRef: s,
180
- autoscrollingTimeoutRef: te,
181
- streamingTurnRef: y,
182
- contentRef: c,
183
- defaultScrollPositionAppliedRef: l,
184
- firstItemRef: f,
185
- itemCountRef: d,
186
- lastScrollTopRef: p,
187
- messageElementsRef: h,
188
- modeRef: m,
189
- pendingScrollFrameRef: w,
190
- pendingScrollToMessageRef: _,
191
- prependRestoreRef: v,
192
- preserveScrollOnPrependRef: x,
193
- pendingDefaultScrollStore: O.current,
194
- rootRef: S,
195
- scrollEdgeThresholdRef: u,
196
- scrollMarginRef: C,
197
- scrollPreviousItemPeekRef: b,
198
- spacerGapRef: T,
199
- spacerHeightRef: E,
200
- spacerRef: ee,
201
- stateFrameRef: D,
202
- stateStore: k.current,
203
- viewportRef: A,
204
- visibilityFrameRef: j,
205
- visibilityObserverRef: ne,
206
- visibilityStore: M.current,
207
- visibleMessageIdsRef: re,
208
- handledScrollAnchorsRef: oe
209
- };
210
- }
211
- function ce(e) {
212
- e.pendingDefaultScrollStore.setSnapshot(!1);
213
- }
214
- function le(e) {
215
- e.defaultScrollPositionAppliedRef.current = !0, ce(e);
216
- }
217
- function ue({ refs: e, commitScrollState: t, scheduleStateCommit: n, scheduleVisibilitySync: r }) {
218
- let { streamingTurnRef: i, autoScrollRef: a, autoscrollingRef: s, autoscrollingTimeoutRef: c, contentRef: l, itemCountRef: u, messageElementsRef: d, modeRef: f, pendingScrollToMessageRef: h, prependRestoreRef: g, scrollMarginRef: _, scrollPreviousItemPeekRef: v, spacerGapRef: y, spacerHeightRef: b, spacerRef: x, viewportRef: S } = e, C = o.useCallback((e) => {
219
- c.current !== null && (window.clearTimeout(c.current), c.current = null), s.current !== e && (s.current = e, t()), e && (c.current = window.setTimeout(() => {
220
- c.current = null, s.current = !1, t();
221
- }, m));
222
- }, [t]), w = o.useCallback((e) => {
223
- let t = x.current;
224
- if (!t) return;
225
- let n = Math.max(0, Math.ceil(e));
226
- b.current !== n && (b.current = n, t.hidden = n === 0, t.style.height = `${n}px`, t.style.marginTop = n > 0 ? `${-y.current}px` : "");
227
- }, []), T = o.useCallback((e, { behavior: r = "auto", autoscrolling: i = !1 } = {}) => {
228
- let a = S.current;
229
- if (!a) return;
230
- let o = Math.max(0, e);
231
- Math.abs(a.scrollTop - o) <= p ? (a.scrollTop = o, t()) : (i && C(!0), a.scrollTo({
232
- top: o,
233
- behavior: r
234
- }), n());
235
- }, [
236
- t,
237
- n,
238
- C
239
- ]), ee = o.useCallback(({ behavior: e = "auto" } = {}) => S.current ? (w(0), i.current = null, f.current = "free-scrolling", T(0, { behavior: e }), r(), !0) : !1, [
240
- r,
241
- T,
242
- w
243
- ]), k = o.useCallback(({ behavior: e = "auto" } = {}) => {
244
- let t = S.current;
245
- return t ? (w(0), i.current = null, f.current = a.current ? "following-bottom" : "free-scrolling", T(te(t), {
246
- autoscrolling: !0,
247
- behavior: e
248
- }), r(), !0) : !1;
249
- }, [
250
- r,
251
- T,
252
- w
253
- ]), A = o.useCallback((e, { align: t = "start", behavior: n = "auto", scrollMargin: a = _.current } = {}, { keepPreviousPeek: o = !1 } = {}) => {
254
- let s = l.current, c = S.current;
255
- if (!s || !c || !s.contains(e)) return !1;
256
- let u = E({
257
- align: t,
258
- element: e,
259
- scrollMargin: o ? a + v.current : a,
260
- spacer: x.current,
261
- viewport: c
262
- }), d = O({
263
- content: s,
264
- scrollTop: u,
265
- spacer: x.current,
266
- viewport: c
267
- });
268
- return w(d), g.current = {
269
- element: e,
270
- viewportTop: D(e, c)
271
- }, f.current = o ? "anchored-to-message" : "settling-jump", i.current = o ? e : null, T(u, { behavior: n }), r(), !0;
272
- }, [
273
- r,
274
- T,
275
- w
276
- ]), j = o.useCallback(() => {
277
- let e = i.current;
278
- return !e || !e.isConnected || f.current !== "anchored-to-message" ? !1 : A(e, { align: "start" }, { keepPreviousPeek: !0 });
279
- }, [A]), ne = o.useCallback((t, n) => {
280
- let r = d.current.get(t);
281
- return r ? (le(e), A(r, n) ? (h.current = null, !0) : (h.current = {
282
- messageId: t,
283
- options: n
284
- }, !0)) : u.current === 0 && (h.current = {
285
- messageId: t,
286
- options: n
287
- }, le(e), !0);
288
- }, [A]);
289
- return {
290
- flushPendingScrollToMessage: o.useCallback(() => {
291
- let t = h.current;
292
- if (!t) return !1;
293
- let n = d.current.get(t.messageId);
294
- return !n || !A(n, t.options) ? !1 : (h.current = null, le(e), !0);
295
- }, [A]),
296
- reanchorToAnchoredMessage: j,
297
- scrollToElement: A,
298
- scrollToEnd: k,
299
- scrollToMessage: ne,
300
- scrollToStart: ee
301
- };
302
- }
303
- function de(e, t) {
304
- return o.useCallback((n) => {
305
- e.current = n, n && t();
306
- }, [e, t]);
307
- }
308
- function fe({ autoScroll: e = !1, defaultScrollPosition: t = "end", scrollEdgeThreshold: n = u, scrollPreviousItemPeek: r = d, scrollMargin: i = f }) {
309
- let a = se({
310
- autoScroll: e,
311
- defaultScrollPosition: t,
312
- scrollEdgeThreshold: n,
313
- scrollMargin: i,
314
- scrollPreviousItemPeek: r
315
- }), { streamingTurnRef: s, autoScrollRef: c, autoscrollingRef: l, autoscrollingTimeoutRef: m, contentRef: h, defaultScrollPositionAppliedRef: g, firstItemRef: E, itemCountRef: O, lastScrollTopRef: te, messageElementsRef: A, modeRef: j, pendingScrollFrameRef: M, pendingScrollToMessageRef: re, prependRestoreRef: N, preserveScrollOnPrependRef: ie, pendingDefaultScrollStore: ae, rootRef: oe, scrollEdgeThresholdRef: fe, scrollMarginRef: pe, scrollPreviousItemPeekRef: P, spacerGapRef: me, spacerHeightRef: F, spacerRef: I, stateFrameRef: L, stateStore: R, viewportRef: z, visibilityFrameRef: B, visibilityObserverRef: V, visibilityStore: H, visibleMessageIdsRef: U, handledScrollAnchorsRef: he } = a, ge = o.useRef(t);
316
- ge.current !== t && (ge.current = t, g.current = !1);
317
- let W = o.useCallback((e) => {
318
- let t = oe.current, n = z.current, r = [e.start && "start", e.end && "end"].filter(Boolean).join(" "), i = l.current;
319
- for (let e of [t, n]) e && (r ? e.setAttribute("data-scrollable", r) : e.removeAttribute("data-scrollable"), e.toggleAttribute("data-autoscrolling", i));
320
- }, []), G = o.useCallback((e) => {
321
- let t = z.current?.scrollTop ?? 0, n = t < te.current - p;
322
- te.current = t, c.current && !e.end && j.current !== "settling-jump" && j.current !== "anchored-to-message" ? j.current = "following-bottom" : j.current === "following-bottom" && e.end && n && !l.current && (j.current = "free-scrolling");
323
- }, []), K = o.useCallback(() => {
324
- let e = v({
325
- content: h.current,
326
- scrollEdgeThreshold: fe.current,
327
- spacer: I.current,
328
- viewport: z.current
329
- });
330
- G(e);
331
- let t = j.current === "following-bottom" ? {
332
- ...e,
333
- end: !1
334
- } : e;
335
- W(t), R.setSnapshot(t);
336
- }, [
337
- G,
338
- R,
339
- W
340
- ]), q = o.useCallback(() => {
341
- L.current === null && (L.current = window.requestAnimationFrame(() => {
342
- L.current = null, K();
343
- }));
344
- }, [K]), J = o.useCallback(() => {
345
- H.hasListeners() && B.current === null && (B.current = window.requestAnimationFrame(() => {
346
- B.current = null, H.hasListeners() && H.setSnapshot(y({
347
- content: h.current,
348
- scrollMargin: pe.current,
349
- scrollPreviousItemPeek: P.current,
350
- spacer: I.current,
351
- viewport: z.current,
352
- visibleMessageIds: U.current
353
- }));
354
- }));
355
- }, [H]), { flushPendingScrollToMessage: Y, reanchorToAnchoredMessage: _e, scrollToElement: X, scrollToEnd: Z, scrollToMessage: ve, scrollToStart: ye } = ue({
356
- refs: a,
357
- commitScrollState: K,
358
- scheduleStateCommit: q,
359
- scheduleVisibilitySync: J
360
- }), be = o.useCallback(() => {
361
- let e = N.current, t = z.current;
362
- if (!e || !t || !e.element.isConnected) return !1;
363
- let n = D(e.element, t) - e.viewportTop;
364
- return Math.abs(n) <= p ? !1 : (t.scrollTop += n, e.viewportTop = D(e.element, t), q(), J(), !0);
365
- }, [q, J]), Q = o.useCallback(() => {
366
- let e = h.current, t = z.current;
367
- if (!e || !t) {
368
- N.current = null;
369
- return;
370
- }
371
- let n = T({
372
- content: e,
373
- spacer: I.current,
374
- viewport: t
375
- });
376
- N.current = n ? {
377
- element: n,
378
- viewportTop: D(n, t)
379
- } : null;
380
- }, []), xe = o.useCallback(() => {
381
- M.current === null && (M.current = window.requestAnimationFrame(() => {
382
- M.current = null, Y() && Q();
383
- }));
384
- }, [Q, Y]), $ = o.useCallback(() => {
385
- if (!t || g.current || O.current === 0) return !1;
386
- let e = !1;
387
- if (t === "last-anchor") {
388
- let t = h.current, n = z.current, r = t && n ? w(b(t, I.current)) : null;
389
- if (!t || !n || !r) e = Z({ behavior: "auto" });
390
- else {
391
- let i = ee(r, n);
392
- e = k({
393
- content: t,
394
- spacer: I.current,
395
- viewport: n
396
- }) - i <= n.clientHeight ? Z({ behavior: "auto" }) : X(r, { align: "start" }, { keepPreviousPeek: !0 });
397
- }
398
- } else e = t === "end" ? Z({ behavior: "auto" }) : ye({ behavior: "auto" });
399
- return e ? (le(a), !0) : !1;
400
- }, [
401
- t,
402
- X,
403
- Z,
404
- ye
405
- ]), Se = o.useCallback(() => {
406
- let e = h.current;
407
- if (!e) return;
408
- let t = b(e, I.current), n = O.current, r = E.current;
409
- O.current = t.length, E.current = t[0] ?? null, (() => {
410
- if (Y()) return;
411
- if (n === 0) {
412
- if ($() || t.length > 0 && c.current && Z({ behavior: "auto" })) return;
413
- K(), J();
414
- return;
415
- }
416
- let e = r ? t.indexOf(r) : -1;
417
- if (ie.current && e > 0) be();
418
- else {
419
- if (t.length > n) {
420
- let e = x(t, n);
421
- if (e) {
422
- if (c.current && j.current === "following-bottom" && C(t, n)) {
423
- Z({ behavior: "auto" });
424
- return;
425
- }
426
- X(e, { align: "start" }, { keepPreviousPeek: !0 }), he.current.add(e);
427
- return;
428
- }
429
- }
430
- if (t.length === n) {
431
- let e = S(t, he.current);
432
- if (e) {
433
- X(e, { align: "start" }, { keepPreviousPeek: !0 }), he.current.add(e);
434
- return;
435
- }
436
- }
437
- j.current === "following-bottom" && c.current ? Z({ behavior: "auto" }) : (K(), J());
438
- }
439
- })(), Q();
440
- }, [
441
- $,
442
- Q,
443
- K,
444
- Y,
445
- be,
446
- J,
447
- X,
448
- Z
449
- ]), Ce = o.useCallback(() => {
450
- if (j.current === "following-bottom" && c.current) {
451
- Z({ behavior: "auto" });
452
- return;
453
- }
454
- let e = F.current;
455
- _e() ? c.current && e > 0 && F.current === 0 && Z({ behavior: "auto" }) : (q(), J());
456
- }, [
457
- _e,
458
- q,
459
- J,
460
- Z
461
- ]), we = o.useCallback(() => {
462
- let e = z.current;
463
- if (e && H.hasListeners()) {
464
- if (typeof IntersectionObserver > "u") {
465
- J();
466
- return;
467
- }
468
- V.current ||= new IntersectionObserver((e) => {
469
- for (let t of e) {
470
- let e = t.target.dataset.messageId;
471
- e && (t.isIntersecting ? U.current.add(e) : U.current.delete(e));
472
- }
473
- J();
474
- }, {
475
- root: e,
476
- rootMargin: `${-(pe.current + P.current)}px 0px 0px 0px`,
477
- threshold: [
478
- 0,
479
- .01,
480
- .5,
481
- 1
482
- ]
483
- }), A.current.forEach((e) => {
484
- V.current?.observe(e);
485
- }), J();
486
- }
487
- }, [J, H]), Te = o.useCallback(() => {
488
- B.current !== null && (window.cancelAnimationFrame(B.current), B.current = null), V.current?.disconnect(), V.current = null, U.current.clear(), H.setSnapshot(_);
489
- }, [H]), Ee = o.useCallback((e, t, n) => {
490
- t ? (A.current.set(e, t), V.current?.observe(t), J(), re.current?.messageId === e && xe()) : n && A.current.get(e) === n && (A.current.delete(e), U.current.delete(e), V.current?.unobserve(n), J());
491
- }, [xe, J]), De = o.useCallback(() => {
492
- (j.current === "following-bottom" || j.current === "anchored-to-message" || j.current === "settling-jump") && (s.current = null, j.current = "free-scrolling");
493
- }, []), Oe = o.useCallback(() => W(R.getSnapshot()), [R, W]), ke = de(oe, Oe), Ae = de(z, Oe), je = o.useCallback((e) => {
494
- h.current = e;
495
- }, []), Me = o.useCallback((e) => {
496
- I.current = e, me.current = ne(e?.parentElement ?? null);
497
- }, []), Ne = o.useCallback(() => {
498
- K(), J(), Q();
499
- }, [
500
- Q,
501
- K,
502
- J
503
- ]), Pe = o.useMemo(() => ({
504
- handleContentChange: Se,
505
- handleResize: Ce,
506
- observeVisibility: we,
507
- pendingDefaultScrollStore: ae,
508
- preserveScrollOnPrependRef: ie,
509
- scrollToEnd: Z,
510
- scrollToMessage: ve,
511
- scrollToStart: ye,
512
- setContentElement: je,
513
- setRootElement: ke,
514
- setSpacerElement: Me,
515
- setViewportElement: Ae,
516
- stateStore: R,
517
- syncAfterScroll: Ne,
518
- unobserveVisibility: Te,
519
- userScrollIntent: De,
520
- viewportRef: z,
521
- visibilityStore: H
522
- }), [
523
- Se,
524
- Ce,
525
- we,
526
- ae,
527
- Z,
528
- ve,
529
- ye,
530
- je,
531
- ke,
532
- Me,
533
- Ae,
534
- R,
535
- Ne,
536
- Te,
537
- De,
538
- H
539
- ]);
540
- return o.useLayoutEffect(() => {
541
- $() || O.current === 0 && ce(a);
542
- }, [$]), o.useEffect(() => () => {
543
- L.current !== null && (window.cancelAnimationFrame(L.current), L.current = null), B.current !== null && (window.cancelAnimationFrame(B.current), B.current = null), m.current !== null && (window.clearTimeout(m.current), m.current = null), M.current !== null && (window.cancelAnimationFrame(M.current), M.current = null), V.current?.disconnect(), V.current = null;
544
- }, []), o.useLayoutEffect(() => {
545
- e && j.current === "following-bottom" && O.current > 0 ? Z({ behavior: "auto" }) : K();
546
- }, [
547
- e,
548
- K,
549
- Z
550
- ]), {
551
- context: Pe,
552
- registerMessage: Ee
553
- };
554
- }
555
- function pe(e) {
556
- let t = o.useRef(e);
557
- return t.current = e, t;
558
- }
559
- var P = o.createContext(null), me = o.createContext(null);
560
- function F() {
561
- let e = o.useContext(P);
562
- if (!e) throw Error("useMessageScroller must be used within a MessageScroller.");
563
- return e;
564
- }
565
- function I() {
566
- let e = o.useContext(me);
567
- if (!e) throw Error("MessageScrollerItem must be used within a MessageScroller.");
568
- return e;
569
- }
570
- function L() {
571
- let { scrollToEnd: e, scrollToMessage: t, scrollToStart: n } = F();
572
- return o.useMemo(() => ({
573
- scrollToEnd: e,
574
- scrollToMessage: t,
575
- scrollToStart: n
576
- }), [
577
- e,
578
- t,
579
- n
580
- ]);
581
- }
582
- function R() {
583
- let { stateStore: e } = F();
584
- return o.useSyncExternalStore(e.subscribe, e.getSnapshot, e.getSnapshot);
585
- }
586
- function z() {
587
- let { observeVisibility: e, unobserveVisibility: t, visibilityStore: n } = F(), r = o.useCallback((r) => n.subscribe(r, e, t), [
588
- e,
589
- t,
590
- n
591
- ]);
592
- return o.useSyncExternalStore(r, n.getSnapshot, n.getSnapshot);
593
- }
594
- function B({ autoScroll: e = !1, children: t, defaultScrollPosition: n = "end", scrollEdgeThreshold: r, scrollPreviousItemPeek: i, scrollMargin: a }) {
595
- let { context: o, registerMessage: s } = fe({
596
- autoScroll: e,
597
- defaultScrollPosition: n,
598
- scrollEdgeThreshold: r,
599
- scrollPreviousItemPeek: i,
600
- scrollMargin: a
601
- });
602
- return c(P.Provider, {
603
- value: o,
604
- children: c(me.Provider, {
605
- value: s,
606
- children: t
607
- })
608
- });
609
- }
610
- function V() {
611
- let { pendingDefaultScrollStore: e } = F();
612
- return o.useSyncExternalStore(e.subscribe, e.getSnapshot, e.getSnapshot);
613
- }
614
- function H({ children: e, ...t }) {
615
- let { setRootElement: n } = F(), r = V();
616
- return c("div", {
617
- ref: n,
618
- ...t,
619
- ...r ? { "data-pending-scroll": "" } : null,
620
- children: e
621
- });
622
- }
623
- function U({ "aria-label": e, children: n, onKeyDown: r, onScroll: i, onTouchMove: a, onWheel: s, preserveScrollOnPrepend: l = !0, ref: u, role: d, tabIndex: f, ...p }) {
624
- let { handleResize: m, preserveScrollOnPrependRef: g, setViewportElement: _, syncAfterScroll: v, userScrollIntent: y, viewportRef: b } = F(), x = V();
625
- g.current = l;
626
- let S = o.useCallback((e) => {
627
- _(e), t(u)?.(e);
628
- }, [u, _]);
629
- function C(e) {
630
- v(), i?.(e);
631
- }
632
- function w(e) {
633
- y(), s?.(e);
634
- }
635
- function T(e) {
636
- y(), a?.(e);
637
- }
638
- function E(e) {
639
- h.has(e.key) && y(), r?.(e);
640
- }
641
- return o.useEffect(() => {
642
- let e = b.current;
643
- if (!e || typeof ResizeObserver > "u") return;
644
- let t = 0, n = new ResizeObserver(() => {
645
- window.cancelAnimationFrame(t), t = window.requestAnimationFrame(m);
646
- });
647
- return n.observe(e), () => {
648
- window.cancelAnimationFrame(t), n.disconnect();
649
- };
650
- }, [m, b]), c("div", {
651
- ref: S,
652
- role: d ?? "region",
653
- "aria-label": e ?? "Messages",
654
- tabIndex: f ?? 0,
655
- onKeyDown: E,
656
- onScroll: C,
657
- onTouchMove: T,
658
- onWheel: w,
659
- ...p,
660
- ...x ? { "data-pending-scroll": "" } : null,
661
- children: n
662
- });
663
- }
664
- function he({ "aria-relevant": e, children: n, ref: r, role: i, spacerClassName: a, ...s }) {
665
- let { handleContentChange: u, handleResize: d, setContentElement: f, setSpacerElement: p } = F(), m = o.useRef(null), h = o.useCallback((e) => {
666
- m.current = e, f(e), t(r)?.(e);
667
- }, [r, f]);
668
- return o.useLayoutEffect(() => {
669
- let e = m.current;
670
- if (!e || (u(), typeof MutationObserver > "u")) return;
671
- let t = new MutationObserver(() => {
672
- u();
673
- });
674
- return t.observe(e, { childList: !0 }), () => t.disconnect();
675
- }, [u]), o.useEffect(() => {
676
- let e = m.current;
677
- if (!e || typeof ResizeObserver > "u") return;
678
- let t = 0, n = new ResizeObserver(() => {
679
- window.cancelAnimationFrame(t), t = window.requestAnimationFrame(d);
680
- });
681
- return n.observe(e), () => {
682
- window.cancelAnimationFrame(t), n.disconnect();
683
- };
684
- }, [d]), l("div", {
685
- ref: h,
686
- role: i ?? "log",
687
- "aria-relevant": e ?? "additions",
688
- ...s,
689
- children: [n, c("div", {
690
- ref: p,
691
- "aria-hidden": "true",
692
- "data-message-scroller-spacer": "",
693
- hidden: !0,
694
- className: a
695
- })]
696
- });
697
- }
698
- function ge({ messageId: e, ref: n, scrollAnchor: r = !1, ...i }) {
699
- let a = I(), s = o.useRef(null), l = o.useCallback((r) => {
700
- let i = s.current;
701
- s.current = r, e && a(e, r, i), t(n)?.(r);
702
- }, [
703
- e,
704
- n,
705
- a
706
- ]);
707
- return c("div", {
708
- ref: l,
709
- "data-message-id": e,
710
- "data-scroll-anchor": r ? "true" : "false",
711
- ...i
712
- });
713
- }
714
- function W({ behavior: t = "smooth", children: r, direction: i = "end", onClick: a, render: s, tabIndex: c, type: u = "button", ...d }) {
715
- let { scrollToEnd: f, scrollToStart: p, stateStore: m } = F(), h = pe(a), g = o.useCallback((e) => m.subscribe(e), [m]), _ = o.useCallback(() => {
716
- let e = m.getSnapshot();
717
- return i === "start" ? e.start : e.end;
718
- }, [i, m]), v = o.useSyncExternalStore(g, _, _), y = o.useCallback((e) => {
719
- v && (h.current?.(e), e.defaultPrevented || (e.currentTarget.blur(), i === "start" ? p({ behavior: t }) : f({ behavior: t })));
720
- }, [
721
- t,
722
- i,
723
- v,
724
- h,
725
- f,
726
- p
727
- ]);
728
- return n({
729
- defaultTagName: "button",
730
- props: e({
731
- type: u,
732
- inert: !v,
733
- tabIndex: v ? c : -1,
734
- children: r ?? l("span", { children: ["Scroll to ", i] }),
735
- onClick: y
736
- }, d),
737
- render: s,
738
- state: {
739
- active: v,
740
- direction: i
741
- },
742
- stateAttributesMapping: { active: (e) => ({ "data-active": e ? "true" : "false" }) }
743
- });
744
- }
745
- var G = {
746
- Provider: B,
747
- Root: H,
748
- Viewport: U,
749
- Content: he,
750
- Item: ge,
751
- Button: W
752
- };
753
- // src/message-scroller.tsx
754
- function K(e) {
755
- return /* @__PURE__ */ c(G.Provider, { ...e });
756
- }
757
- function q({ className: e, ...t }) {
758
- return /* @__PURE__ */ c(G.Root, {
759
- "data-slot": "message-scroller",
760
- className: r("group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden", e),
761
- ...t
762
- });
763
- }
764
- function J({ className: e, ...t }) {
765
- return /* @__PURE__ */ c(G.Viewport, {
766
- "data-slot": "message-scroller-viewport",
767
- className: r("scroll-fade-b size-full min-h-0 min-w-0 scrollbar-thin scrollbar-gutter-stable overflow-y-auto overscroll-contain contain-content data-autoscrolling:scrollbar-thumb-transparent data-autoscrolling:scrollbar-track-transparent data-pending-scroll:invisible", e),
768
- ...t
769
- });
770
- }
771
- function Y({ className: e, ...t }) {
772
- return /* @__PURE__ */ c(G.Content, {
773
- "data-slot": "message-scroller-content",
774
- className: r("flex h-max min-h-full flex-col gap-6", e),
775
- ...t
776
- });
777
- }
778
- function _e({ className: e, scrollAnchor: t = !1, ...n }) {
779
- return /* @__PURE__ */ c(G.Item, {
780
- "data-slot": "message-scroller-item",
781
- scrollAnchor: t,
782
- className: r("min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]", e),
783
- ...n
784
- });
785
- }
786
- function X({ direction: e = "end", className: t, children: n, render: o, variant: u = "secondary", size: d = "icon-sm", ...f }) {
787
- return /* @__PURE__ */ c(G.Button, {
788
- "data-slot": "message-scroller-button",
789
- "data-direction": e,
790
- "data-variant": u,
791
- "data-size": d,
792
- direction: e,
793
- className: r("border-border bg-background text-foreground hover:bg-muted hover:text-foreground absolute inset-s-1/2 -translate-x-1/2 transition-[translate,scale,opacity] duration-200 data-[active=false]:pointer-events-none data-[active=false]:scale-95 data-[active=false]:opacity-0 data-[active=false]:duration-400 data-[active=false]:ease-[cubic-bezier(0.7,0,0.84,0)] data-[active=true]:translate-y-0 data-[active=true]:scale-100 data-[active=true]:opacity-100 data-[active=true]:ease-[cubic-bezier(0.23,1,0.32,1)] data-[direction=end]:bottom-4 data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:top-4 data-[direction=start]:data-[active=false]:-translate-y-full rtl:translate-x-1/2 data-[direction=start]:[&_svg]:rotate-180", t),
794
- render: o ?? /* @__PURE__ */ c(i, {
795
- variant: u,
796
- size: d
797
- }),
798
- ...f,
799
- children: n ?? /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(a, {}), /* @__PURE__ */ c("span", {
800
- className: "sr-only",
801
- children: e === "end" ? "Scroll to end" : "Scroll to start"
802
- })] })
803
- });
804
- }
805
- export { K as a, L as c, _e as i, R as l, X as n, J as o, Y as r, z as s, q as t };