@apple-pie/slice 0.0.0 → 0.0.2

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 (291) hide show
  1. package/dist/cjs/chunks/Avatar-8-wPWe0V.js +68 -0
  2. package/dist/cjs/chunks/AvatarGroup-CVKmgBbD.js +39 -0
  3. package/dist/cjs/chunks/Badge-CMapJCij.js +41 -0
  4. package/dist/cjs/chunks/CheckBox-7AACxrdZ.js +76 -0
  5. package/dist/cjs/chunks/DivInput-BKKJTFeV.js +204 -0
  6. package/dist/cjs/chunks/DocIcons-BRWOzK96.js +41 -0
  7. package/dist/cjs/chunks/Dot-Dnr9M9na.js +80 -0
  8. package/dist/cjs/chunks/DrggablePanel-C6TPsDB-.js +302 -0
  9. package/dist/cjs/chunks/DropDown-D9sf_m2I.js +154 -0
  10. package/dist/cjs/chunks/EditorButtonBar-CUNDgRQd.js +244 -0
  11. package/dist/cjs/chunks/ErrorSummary-Dv44onsV.js +42 -0
  12. package/dist/cjs/chunks/FlexDiv-DZBpswHV.js +103 -0
  13. package/dist/cjs/chunks/Grouper-_kd2nU78.js +50 -0
  14. package/dist/cjs/chunks/IconButton-BfsPlKTb.js +84 -0
  15. package/dist/cjs/chunks/Logos-DSlAUz8l.js +119 -0
  16. package/dist/cjs/chunks/MessageInput-CiHFo2j8.js +399 -0
  17. package/dist/cjs/chunks/Overlay-DwCPvGB5.js +45 -0
  18. package/dist/cjs/chunks/Pager-CFtZ0IIW.js +42 -0
  19. package/dist/cjs/chunks/ProgressIndicator-C5oB7Mky.js +121 -0
  20. package/dist/cjs/chunks/RadioButton-e_y2qiPE.js +65 -0
  21. package/dist/cjs/chunks/RadioButtonList-I81UwHmM.js +116 -0
  22. package/dist/cjs/chunks/Slider-C-gn7Sby.js +285 -0
  23. package/dist/cjs/chunks/Spacer-BEY2-_PB.js +16 -0
  24. package/dist/cjs/chunks/Switch-CtkFtogd.js +43 -0
  25. package/dist/cjs/chunks/TabBar-D3bj4pjj.js +176 -0
  26. package/dist/cjs/chunks/TextArea-B1oKK3_b.js +153 -0
  27. package/dist/cjs/chunks/TextField-CiQdPP5E.js +248 -0
  28. package/dist/cjs/chunks/Tip-C2pzExut.js +91 -0
  29. package/dist/cjs/chunks/Toast-DrijUwoL.js +141 -0
  30. package/dist/cjs/chunks/UIButton-CH4p-8yq.js +317 -0
  31. package/dist/cjs/chunks/UIButtonBar-0fHPB0ww.js +58 -0
  32. package/dist/cjs/chunks/UICard-DBDSyT7E.js +36 -0
  33. package/dist/cjs/chunks/UIChip-kjhvRrOV.js +93 -0
  34. package/dist/cjs/chunks/UIFileIcon-ZrbDIeYz.js +54 -0
  35. package/dist/cjs/chunks/UILabel-DkBE2AIt.js +116 -0
  36. package/dist/cjs/chunks/_types-CoWzQFsT.js +714 -0
  37. package/dist/cjs/chunks/sharedTypes-BvTjh6M5.js +9 -0
  38. package/dist/cjs/chunks/style-inject.es-XZHJH68X.js +30 -0
  39. package/dist/cjs/chunks/tipStore-C9oV9SIh.js +23 -0
  40. package/dist/cjs/chunks/toastStore-C-ETP9H6.js +23 -0
  41. package/dist/cjs/chunks/tslib.es6-4H29ixHs.js +48 -0
  42. package/dist/cjs/chunks/utils-CbayehuI.js +126 -0
  43. package/dist/cjs/hooks/useDoubleClick.js +26 -0
  44. package/dist/cjs/hooks/useKeyboardShortcuts.js +42 -0
  45. package/dist/cjs/hooks/useLastUpdated.js +53 -0
  46. package/dist/cjs/hooks/useLocalStore.js +52 -0
  47. package/dist/cjs/hooks/useObserveResize.js +56 -0
  48. package/dist/cjs/hooks/useObserveTheme.js +36 -0
  49. package/dist/cjs/hooks/useTheme.js +85 -0
  50. package/dist/cjs/hooks/useToolTip.js +36 -0
  51. package/dist/cjs/hooks/useTrackRenders.js +38 -0
  52. package/dist/cjs/hooks/useWindow.js +64 -0
  53. package/dist/cjs/hooks.js +32 -0
  54. package/dist/cjs/index.js +121 -0
  55. package/dist/cjs/providers/ThemeProvider.js +51 -0
  56. package/dist/cjs/providers.js +13 -0
  57. package/dist/cjs/stores/tip.js +12 -0
  58. package/dist/cjs/stores/toast.js +12 -0
  59. package/dist/cjs/stores.js +18 -0
  60. package/dist/cjs/theme/colors.js +383 -0
  61. package/dist/cjs/theme/corners.js +14 -0
  62. package/dist/cjs/theme/themes.js +23 -0
  63. package/dist/cjs/theme/type.js +316 -0
  64. package/dist/cjs/theme.js +13 -0
  65. package/dist/cjs/uikit/Avatar.js +11 -0
  66. package/dist/cjs/uikit/AvatarGroup.js +12 -0
  67. package/dist/cjs/uikit/Badge.js +11 -0
  68. package/dist/cjs/uikit/CheckBox.js +21 -0
  69. package/dist/cjs/uikit/DivInput.js +13 -0
  70. package/dist/cjs/uikit/DocIcon.js +17 -0
  71. package/dist/cjs/uikit/Dot.js +12 -0
  72. package/dist/cjs/uikit/DraggablePanel.js +20 -0
  73. package/dist/cjs/uikit/DropDown.js +20 -0
  74. package/dist/cjs/uikit/EditorButtonBar.js +27 -0
  75. package/dist/cjs/uikit/ErrorSummary.js +12 -0
  76. package/dist/cjs/uikit/FlexDiv.js +12 -0
  77. package/dist/cjs/uikit/Grouper.js +22 -0
  78. package/dist/cjs/uikit/Icon.js +22 -0
  79. package/dist/cjs/uikit/IconButton.js +24 -0
  80. package/dist/cjs/uikit/Logos.js +17 -0
  81. package/dist/cjs/uikit/MessageInput.js +29 -0
  82. package/dist/cjs/uikit/Overlay.js +12 -0
  83. package/dist/cjs/uikit/Pager.js +12 -0
  84. package/dist/cjs/uikit/Progress.js +20 -0
  85. package/dist/cjs/uikit/RadioButton.js +25 -0
  86. package/dist/cjs/uikit/RadioButtonList.js +26 -0
  87. package/dist/cjs/uikit/Slider.js +13 -0
  88. package/dist/cjs/uikit/Spacer.js +10 -0
  89. package/dist/cjs/uikit/Switch.js +12 -0
  90. package/dist/cjs/uikit/TabBar.js +25 -0
  91. package/dist/cjs/uikit/TextArea.js +26 -0
  92. package/dist/cjs/uikit/Textfield.js +27 -0
  93. package/dist/cjs/uikit/Tip.js +13 -0
  94. package/dist/cjs/uikit/Toast.js +25 -0
  95. package/dist/cjs/uikit/UIButton.js +25 -0
  96. package/dist/cjs/uikit/UIButtonBar.js +25 -0
  97. package/dist/cjs/uikit/UICard.js +20 -0
  98. package/dist/cjs/uikit/UIChip.js +21 -0
  99. package/dist/cjs/uikit/UIFileIcon.js +17 -0
  100. package/dist/cjs/uikit/UILabel.js +18 -0
  101. package/dist/esm/chunks/Avatar-D_muqPrW.js +66 -0
  102. package/dist/esm/chunks/AvatarGroup-D8Xmrn52.js +37 -0
  103. package/dist/esm/chunks/Badge-PPf5Uvw3.js +39 -0
  104. package/dist/esm/chunks/CheckBox-CswFI0Xc.js +74 -0
  105. package/dist/esm/chunks/DivInput-iKFkeU2F.js +202 -0
  106. package/dist/esm/chunks/DocIcons-CbOX4n8Y.js +39 -0
  107. package/dist/esm/chunks/Dot-B84UVs2e.js +78 -0
  108. package/dist/esm/chunks/DrggablePanel-CYYwTmFd.js +300 -0
  109. package/dist/esm/chunks/DropDown-D4t6EhKL.js +152 -0
  110. package/dist/esm/chunks/EditorButtonBar-FnMa8Zv2.js +242 -0
  111. package/dist/esm/chunks/ErrorSummary-DhU5SKPt.js +40 -0
  112. package/dist/esm/chunks/FlexDiv-CmMpORgn.js +101 -0
  113. package/dist/esm/chunks/Grouper-BbreOXI9.js +48 -0
  114. package/dist/esm/chunks/IconButton-CguHGkBM.js +82 -0
  115. package/dist/esm/chunks/Logos-DwZP-TR2.js +117 -0
  116. package/dist/esm/chunks/MessageInput-DMHzCwjO.js +397 -0
  117. package/dist/esm/chunks/Overlay-CCBy7n7H.js +43 -0
  118. package/dist/esm/chunks/Pager-BsSti93V.js +40 -0
  119. package/dist/esm/chunks/ProgressIndicator-BVukxMU6.js +118 -0
  120. package/dist/esm/chunks/RadioButton-B5BxQI0R.js +63 -0
  121. package/dist/esm/chunks/RadioButtonList-C2z8McAD.js +114 -0
  122. package/dist/esm/chunks/Slider-C-PcWqTz.js +283 -0
  123. package/dist/esm/chunks/Spacer-DbZSG5x3.js +14 -0
  124. package/dist/esm/chunks/Switch-DjfrSiQz.js +41 -0
  125. package/dist/esm/chunks/TabBar-BSBcgTbd.js +174 -0
  126. package/dist/esm/chunks/TextArea-COM0UPo2.js +151 -0
  127. package/dist/esm/chunks/TextField-Bh24bRWs.js +246 -0
  128. package/dist/esm/chunks/Tip-Ct19Ljul.js +89 -0
  129. package/dist/esm/chunks/Toast-BR0oMX6z.js +139 -0
  130. package/dist/esm/chunks/UIButton-DKx-_O8h.js +315 -0
  131. package/dist/esm/chunks/UIButtonBar-BNdA5eVq.js +56 -0
  132. package/dist/esm/chunks/UICard-Dn5f3wg8.js +34 -0
  133. package/dist/esm/chunks/UIChip-DqnGeVyR.js +91 -0
  134. package/dist/esm/chunks/UIFileIcon-qGxIPsJJ.js +52 -0
  135. package/dist/esm/chunks/UILabel-RnbodPCS.js +114 -0
  136. package/dist/esm/chunks/_types-BaYeLEWK.js +712 -0
  137. package/dist/esm/chunks/sharedTypes-BfZzG1KX.js +9 -0
  138. package/dist/esm/chunks/style-inject.es-tgCJW-Cu.js +28 -0
  139. package/dist/esm/chunks/tipStore-nBYJ6tmE.js +17 -0
  140. package/dist/esm/chunks/toastStore-r3pvNa28.js +17 -0
  141. package/dist/esm/chunks/tslib.es6-0pkUdtrF.js +45 -0
  142. package/dist/esm/chunks/utils-BRZK2Drn.js +119 -0
  143. package/dist/esm/hooks/useDoubleClick.js +24 -0
  144. package/dist/esm/hooks/useKeyboardShortcuts.js +40 -0
  145. package/dist/esm/hooks/useLastUpdated.js +51 -0
  146. package/dist/esm/hooks/useLocalStore.js +50 -0
  147. package/dist/esm/hooks/useObserveResize.js +54 -0
  148. package/dist/esm/hooks/useObserveTheme.js +34 -0
  149. package/dist/esm/hooks/useTheme.js +83 -0
  150. package/dist/esm/hooks/useToolTip.js +34 -0
  151. package/dist/esm/hooks/useTrackRenders.js +36 -0
  152. package/dist/esm/hooks/useWindow.js +62 -0
  153. package/dist/esm/hooks.js +14 -0
  154. package/dist/esm/index.js +57 -0
  155. package/dist/esm/providers/ThemeProvider.js +49 -0
  156. package/dist/esm/providers.js +7 -0
  157. package/dist/esm/stores/tip.js +2 -0
  158. package/dist/esm/stores/toast.js +2 -0
  159. package/dist/esm/stores.js +3 -0
  160. package/dist/esm/theme/colors.js +377 -0
  161. package/dist/esm/theme/corners.js +12 -0
  162. package/dist/esm/theme/themes.js +20 -0
  163. package/dist/esm/theme/type.js +312 -0
  164. package/dist/esm/theme.js +4 -0
  165. package/dist/esm/uikit/Avatar.js +5 -0
  166. package/dist/esm/uikit/AvatarGroup.js +6 -0
  167. package/dist/esm/uikit/Badge.js +5 -0
  168. package/dist/esm/uikit/CheckBox.js +15 -0
  169. package/dist/esm/uikit/DivInput.js +7 -0
  170. package/dist/esm/uikit/DocIcon.js +11 -0
  171. package/dist/esm/uikit/Dot.js +6 -0
  172. package/dist/esm/uikit/DraggablePanel.js +14 -0
  173. package/dist/esm/uikit/DropDown.js +14 -0
  174. package/dist/esm/uikit/EditorButtonBar.js +21 -0
  175. package/dist/esm/uikit/ErrorSummary.js +6 -0
  176. package/dist/esm/uikit/FlexDiv.js +6 -0
  177. package/dist/esm/uikit/Grouper.js +16 -0
  178. package/dist/esm/uikit/Icon.js +12 -0
  179. package/dist/esm/uikit/IconButton.js +18 -0
  180. package/dist/esm/uikit/Logos.js +11 -0
  181. package/dist/esm/uikit/MessageInput.js +23 -0
  182. package/dist/esm/uikit/Overlay.js +6 -0
  183. package/dist/esm/uikit/Pager.js +6 -0
  184. package/dist/esm/uikit/Progress.js +13 -0
  185. package/dist/esm/uikit/RadioButton.js +19 -0
  186. package/dist/esm/uikit/RadioButtonList.js +20 -0
  187. package/dist/esm/uikit/Slider.js +7 -0
  188. package/dist/esm/uikit/Spacer.js +4 -0
  189. package/dist/esm/uikit/Switch.js +6 -0
  190. package/dist/esm/uikit/TabBar.js +19 -0
  191. package/dist/esm/uikit/TextArea.js +20 -0
  192. package/dist/esm/uikit/Textfield.js +21 -0
  193. package/dist/esm/uikit/Tip.js +7 -0
  194. package/dist/esm/uikit/Toast.js +15 -0
  195. package/dist/esm/uikit/UIButton.js +19 -0
  196. package/dist/esm/uikit/UIButtonBar.js +19 -0
  197. package/dist/esm/uikit/UICard.js +14 -0
  198. package/dist/esm/uikit/UIChip.js +15 -0
  199. package/dist/esm/uikit/UIFileIcon.js +11 -0
  200. package/dist/esm/uikit/UILabel.js +12 -0
  201. package/dist/types/hooks/index.d.ts +9 -2
  202. package/dist/types/hooks/useDoubleClick/useDoubleClick.d.ts +1 -0
  203. package/dist/types/hooks/useKeyboardShortcuts/useKeyboardShortcuts.d.ts +6 -0
  204. package/dist/types/hooks/useLastUpdated/useLastUpdated.d.ts +4 -0
  205. package/dist/types/hooks/useLocalStore/useLocalStore.d.ts +1 -0
  206. package/dist/types/hooks/{useObserveResize.d.ts → useObserveResize/useObserveResize.d.ts} +1 -1
  207. package/dist/types/hooks/useObserveTheme/useObserveTheme.d.ts +2 -0
  208. package/dist/types/hooks/useTheme/useTheme.d.ts +47 -0
  209. package/dist/types/hooks/useToolTip/useToolTip.d.ts +6 -0
  210. package/dist/types/hooks/useWindow/useWindow.d.ts +15 -0
  211. package/dist/types/index.d.ts +9 -4
  212. package/dist/types/providers/ThemeProvider.d.ts +1 -0
  213. package/dist/types/stores/index.d.ts +2 -0
  214. package/dist/types/stores/tip/_types.d.ts +8 -0
  215. package/dist/types/stores/tip/index.d.ts +2 -0
  216. package/dist/types/stores/tip/tipStore.d.ts +12 -0
  217. package/dist/types/stores/toast/_types.d.ts +14 -0
  218. package/dist/types/stores/toast/index.d.ts +2 -0
  219. package/dist/types/stores/toast/toastStore.d.ts +12 -0
  220. package/dist/types/theme/colors/colors.d.ts +2 -0
  221. package/dist/types/theme/colors/types.d.ts +14 -0
  222. package/dist/types/theme/components/BrandColors.d.ts +1 -0
  223. package/dist/types/theme/components/ColorTile.d.ts +6 -0
  224. package/dist/types/theme/components/ColorTileGroup.d.ts +6 -0
  225. package/dist/types/theme/components/ThemeColors.d.ts +2 -0
  226. package/dist/types/theme/components/_types.d.ts +15 -0
  227. package/dist/types/theme/index.d.ts +1 -1
  228. package/dist/types/theme/themes.d.ts +3 -3
  229. package/dist/types/theme/type/type.d.ts +3 -0
  230. package/dist/types/uikit/Avatar/_types.d.ts +3 -2
  231. package/dist/types/uikit/AvatarGroup/_types.d.ts +4 -2
  232. package/dist/types/uikit/Badge/_types.d.ts +5 -2
  233. package/dist/types/uikit/CheckBox/_types.d.ts +5 -2
  234. package/dist/types/uikit/DivInput/_types.d.ts +4 -2
  235. package/dist/types/uikit/DocIcon/_types.d.ts +5 -2
  236. package/dist/types/uikit/Dot/_types.d.ts +6 -2
  237. package/dist/types/uikit/DraggablePanel/DrggablePanel.d.ts +3 -2
  238. package/dist/types/uikit/DropDown/DropDown.d.ts +2 -1
  239. package/dist/types/uikit/DropDown/_types.d.ts +5 -2
  240. package/dist/types/uikit/EditorButtonBar/_types.d.ts +4 -2
  241. package/dist/types/uikit/ErrorSummary/ErrorSummary.d.ts +2 -1
  242. package/dist/types/uikit/ErrorSummary/_types.d.ts +5 -2
  243. package/dist/types/uikit/FlexDiv/FlexDiv.d.ts +59 -2
  244. package/dist/types/uikit/FlexDiv/_types.d.ts +8 -2
  245. package/dist/types/uikit/Grouper/_types.d.ts +6 -2
  246. package/dist/types/uikit/Icon/_types.d.ts +7 -2
  247. package/dist/types/uikit/Icon/iconRegistry.d.ts +1 -0
  248. package/dist/types/uikit/IconButton/_types.d.ts +4 -2
  249. package/dist/types/uikit/Logos/_types.d.ts +8 -4
  250. package/dist/types/uikit/MessageInput/InputField/_types.d.ts +5 -2
  251. package/dist/types/uikit/Overlay/_types.d.ts +5 -2
  252. package/dist/types/uikit/Pager/_types.d.ts +5 -2
  253. package/dist/types/uikit/Progress/DoneCheck/_types.d.ts +5 -2
  254. package/dist/types/uikit/Progress/ProgressIndicator/_types.d.ts +5 -2
  255. package/dist/types/uikit/RadioButton/_types.d.ts +5 -2
  256. package/dist/types/uikit/RadioButtonList/_types.d.ts +5 -2
  257. package/dist/types/uikit/Slider/_types.d.ts +5 -2
  258. package/dist/types/uikit/Spacer/_types.d.ts +5 -2
  259. package/dist/types/uikit/Switch/Switch.d.ts +1 -1
  260. package/dist/types/uikit/Switch/_types.d.ts +5 -4
  261. package/dist/types/uikit/TabBar/_types.d.ts +5 -2
  262. package/dist/types/uikit/TextArea/_types.d.ts +5 -2
  263. package/dist/types/uikit/Textfield/_types.d.ts +4 -2
  264. package/dist/types/uikit/Tip/Tip.d.ts +3 -0
  265. package/dist/types/uikit/Tip/_types.d.ts +28 -0
  266. package/dist/types/uikit/Tip/index.d.ts +2 -0
  267. package/dist/types/uikit/Toast/Toast.d.ts +3 -0
  268. package/dist/types/uikit/Toast/_types.d.ts +24 -0
  269. package/dist/types/uikit/Toast/index.d.ts +2 -0
  270. package/dist/types/uikit/UIButton/UIButton.d.ts +73 -2
  271. package/dist/types/uikit/UIButton/_types.d.ts +4 -2
  272. package/dist/types/uikit/UIButtonBar/_types.d.ts +5 -2
  273. package/dist/types/uikit/UICard/_types.d.ts +5 -2
  274. package/dist/types/uikit/UIChip/_types.d.ts +4 -2
  275. package/dist/types/uikit/UIFileIcon/UIFileIcon.d.ts +1 -1
  276. package/dist/types/uikit/UIFileIcon/_types.d.ts +4 -2
  277. package/dist/types/uikit/UILabel/_types.d.ts +4 -2
  278. package/dist/types/util/utils.d.ts +12 -0
  279. package/package.json +80 -5
  280. package/dist/colors.css +0 -237
  281. package/dist/index.esm.js +0 -4831
  282. package/dist/index.esm.js.map +0 -1
  283. package/dist/index.js +0 -4873
  284. package/dist/index.js.map +0 -1
  285. package/dist/type.css +0 -16
  286. package/dist/types/hooks/useMayaTheme.d.ts +0 -7
  287. package/dist/types/hooks/useTheme.d.ts +0 -2
  288. package/dist/types/uikit/Avatar/AvatarInline.stories.d.ts +0 -7
  289. /package/dist/{flexBox.module.css → css/flexBox.module.css} +0 -0
  290. /package/dist/{type.module.css → css/type.module.css} +0 -0
  291. /package/dist/types/hooks/{useTrackRenders.d.ts → useTrackRenders/useTrackRenders.d.ts} +0 -0
@@ -0,0 +1,397 @@
1
+ import { _ as __rest } from './tslib.es6-0pkUdtrF.js';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { AnimatePresence } from 'motion/react';
4
+ import { memo, useCallback, useMemo, useState, useEffect, useRef } from 'react';
5
+ import { useTheme } from '../hooks/useTheme.js';
6
+ import '../theme/colors.js';
7
+ import '../hooks/useWindow.js';
8
+ import { U as UIButton } from './UIButton-DKx-_O8h.js';
9
+ import { I as Icon } from './_types-BaYeLEWK.js';
10
+ import { I as IconButton } from './IconButton-CguHGkBM.js';
11
+ import { s as styleInject } from './style-inject.es-tgCJW-Cu.js';
12
+ import { U as UIFileIcon } from './UIFileIcon-qGxIPsJJ.js';
13
+ import { A as Avatar } from './Avatar-D_muqPrW.js';
14
+
15
+ var css_248z$3 = ".flexBox-module_row__PWxbe {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__27lKK {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__nJZnW {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__dHcOU {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__MP2Xd {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__Kg8cV {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__zcmtk {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__157yI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__u2nwI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__QWEzl {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__FxEAv {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__rf7AV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__8-FO- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__qyYq- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__7GQ5Z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__Qtp5G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__Ieh9K {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__0lZ3I {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__Ar4d3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__6tV1n {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__I8Q1v {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-bold__QFgN8 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-medium__jGIb2 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__tdBSi {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__-7Uyu {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__8hGYF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 28px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Cryjg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 28px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.ExcerptList-module_excerptList__1tvcr {\n\talign-items: flex-start;\n\twidth: 100%;\n\tflex-wrap: wrap;\n\tgap: 8px;\n}\n\n.ExcerptList-module_excerptButton__A3ZJh {\n\talign-items: flex-start;\n\tpadding: 10px 16px 14px 12px;\n\tbackground: var(--core-surface-primary);\n\tborder: 1px solid var(--core-outline-primary);\n\tborder-radius: 24px;\n\tmin-height: 48px;\n\tcursor: default;\n}\n\n.ExcerptList-module_icon__E8d4K {\n\theight: 20px;\n\twidth: 20px;\n}\n\n.ExcerptList-module_content__TBPjX {\n\tmax-width: 300px;\n\tpadding: 0px 16px 0px 8px;\n\tgap: 4px;\n}\n\n.ExcerptList-module_label__xv7up {\n\tcolor: var(--core-text-primary);\n\tmax-width: 300px;\n\tline-height: 1.5em;\n\toverflow: hidden;\n\tword-break: normal;\n\tdisplay: -webkit-box;\n\t-webkit-line-clamp: 3;\n\t-webkit-box-orient: vertical;\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n.ExcerptList-module_type__i9e14 {\n\tpadding-top: 4px;\n\tcolor: var(--core-text-disabled);\n\tgap: 4px;\n}\n\n.ExcerptList-module_typeIcon__WwWEY {\n\theight: 16px;\n\twidth: 16px;\n\toverflow: hidden;\n}\n";
16
+ var css$3 = {"excerptList":"ExcerptList-module_excerptList__1tvcr flexBox-module_rowStart__nJZnW","excerptButton":"ExcerptList-module_excerptButton__A3ZJh flexBox-module_rowStart__nJZnW","icon":"ExcerptList-module_icon__E8d4K flexBox-module_row__PWxbe","content":"ExcerptList-module_content__TBPjX flexBox-module_columnStart__Kg8cV","label":"ExcerptList-module_label__xv7up type-module_body-m-regular__Qtp5G","type":"ExcerptList-module_type__i9e14 flexBox-module_rowStart__nJZnW type-module_body-xs-regular__QWEzl"};
17
+ styleInject(css_248z$3);
18
+
19
+ const ExcerptList = memo(function ExcerptList(props) {
20
+ const { excerpts = [], onChange = () => null, onToolTip = () => null, } = props;
21
+ const theme = useTheme();
22
+ // memo remove file
23
+ const handleRemoveFile = useCallback((content) => {
24
+ const updatedList = excerpts.filter((excerpt) => {
25
+ return content !== excerpt.content;
26
+ });
27
+ onChange(updatedList);
28
+ }, [excerpts, onChange]);
29
+ const excerptItems = useMemo(() => {
30
+ return excerpts.map((excerpt, index) => {
31
+ return (jsxs("div", { className: css$3.excerptButton, children: [jsxs("div", { className: css$3.content, children: [jsxs("div", { className: css$3.type, children: [jsx(Icon, { name: "recent chats", size: 16, strokeColor: theme.current.colors['core-text-disabled'] }), excerpt.docTitle ? excerpt.docTitle : 'Document excerpt'] }), jsx("div", { className: css$3.label, children: excerpt.content })] }), jsx("div", { className: css$3.icon, children: jsx(IconButton, { icon: 'x', hover: false, toggle: false, frameSize: 20, iconSize: 20, onClick: (e) => {
32
+ e.stopPropagation();
33
+ handleRemoveFile(excerpt.content);
34
+ }, tooltip: 'remove excerpt', onToolTip: (tip) => onToolTip(tip) }) })] }, `${excerpt.content}-${index}`));
35
+ });
36
+ }, [excerpts, theme.current.colors, onToolTip, handleRemoveFile]);
37
+ return (jsx("div", { className: css$3.excerptList, onKeyDown: (e) => e.stopPropagation(), onClick: (e) => e.stopPropagation(), children: excerptItems }));
38
+ });
39
+
40
+ var UIFileIcons;
41
+ (function (UIFileIcons) {
42
+ UIFileIcons["Pdf"] = "pdf";
43
+ UIFileIcons["Document"] = "document";
44
+ UIFileIcons["Spreadhseet"] = "spreadsheet";
45
+ })(UIFileIcons || (UIFileIcons = {}));
46
+
47
+ var css_248z$2 = ".flexBox-module_row__PWxbe {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__27lKK {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__nJZnW {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__dHcOU {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__MP2Xd {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__Kg8cV {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__zcmtk {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__157yI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__u2nwI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__QWEzl {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__FxEAv {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__rf7AV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__8-FO- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__qyYq- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__7GQ5Z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__Qtp5G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__Ieh9K {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__0lZ3I {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__Ar4d3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__6tV1n {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__I8Q1v {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-bold__QFgN8 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-medium__jGIb2 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__tdBSi {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__-7Uyu {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__8hGYF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 28px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Cryjg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 28px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.FileList-module_fileList__uw9o6 {\n\talign-items: flex-start;\n\twidth: 100%;\n\tflex-wrap: wrap;\n\tgap: 8px;\n}\n\n.FileList-module_fileButton__XnXaN {\n\talign-items: flex-start;\n\tpadding: 10px 16px 14px 12px;\n\tbackground: var(--core-surface-primary);\n\tborder: 1px solid var(--core-outline-primary);\n\tborder-radius: 24px;\n\tmin-height: 48px;\n\tcursor: default;\n}\n\n.FileList-module_icon__fiu9M {\n\theight: 20px;\n\twidth: 20px;\n}\n\n.FileList-module_content__Kb8mh {\n\tmax-width: 300px;\n\tpadding: 0px 16px 0px 8px;\n\tgap: 4px;\n}\n\n.FileList-module_label__hoDXY {\n\tcolor: var(--core-text-primary);\n\tmax-width: 300px;\n\tline-height: 1.5em;\n\toverflow: hidden;\n\tword-break: normal;\n\tdisplay: -webkit-box;\n\t-webkit-line-clamp: 3;\n\t-webkit-box-orient: vertical;\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n.FileList-module_type__zOO2e {\n\tpadding-top: 4px;\n\tcolor: var(--core-text-disabled);\n\tgap: 4px;\n}\n\n.FileList-module_typeIcon__8SvkW {\n\theight: 16px;\n\twidth: 16px;\n\toverflow: hidden;\n}\n";
48
+ var css$2 = {"fileList":"FileList-module_fileList__uw9o6 flexBox-module_rowStart__nJZnW","fileButton":"FileList-module_fileButton__XnXaN flexBox-module_rowStart__nJZnW","icon":"FileList-module_icon__fiu9M flexBox-module_row__PWxbe","content":"FileList-module_content__Kb8mh flexBox-module_columnStart__Kg8cV","label":"FileList-module_label__hoDXY type-module_body-m-regular__Qtp5G","type":"FileList-module_type__zOO2e flexBox-module_rowStart__nJZnW type-module_body-xs-regular__QWEzl"};
49
+ styleInject(css_248z$2);
50
+
51
+ const FileList = memo(function FileList(props) {
52
+ const { files = [], onChange = () => null, onToolTip = () => null } = props;
53
+ const handleRemoveFile = useCallback((fileName) => {
54
+ const updatedList = files.filter((file) => {
55
+ return file.name !== fileName;
56
+ });
57
+ onChange(updatedList);
58
+ }, [files, onChange]);
59
+ const fileType = useCallback((file) => {
60
+ switch (file.type) {
61
+ case 'text/plain':
62
+ return 'Text file';
63
+ case 'text/html':
64
+ return 'Web HTML file';
65
+ case 'text/csv':
66
+ return 'CSV spread shseet';
67
+ case 'application/pdf':
68
+ return 'PDF document';
69
+ case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':
70
+ case 'application/docx':
71
+ return 'Word document';
72
+ default:
73
+ return 'Unknown file type';
74
+ }
75
+ }, []);
76
+ const fileIcon = useCallback((file) => {
77
+ switch (file.type) {
78
+ case 'text/plain':
79
+ case 'text/html':
80
+ case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':
81
+ return UIFileIcons.Document;
82
+ case 'text/csv':
83
+ return UIFileIcons.Spreadhseet;
84
+ case 'application/pdf':
85
+ return UIFileIcons.Pdf;
86
+ default:
87
+ return UIFileIcons.Document;
88
+ }
89
+ }, []);
90
+ const handleRemoveClick = useCallback((e, fileName) => {
91
+ e.stopPropagation();
92
+ handleRemoveFile(fileName);
93
+ }, [handleRemoveFile]);
94
+ return (jsx("div", { className: css$2.fileList, children: files.map((file, index) => {
95
+ return (jsxs("div", { className: css$2.fileButton, children: [jsxs("div", { className: css$2.content, children: [jsxs("div", { className: css$2.type, children: [jsx(UIFileIcon, { name: fileIcon(file), size: 18 }), fileType(file)] }), jsx("div", { className: css$2.label, children: file.name })] }), jsx("div", { className: css$2.icon, children: jsx(IconButton, { icon: 'x', hover: false, toggle: false, frameSize: 20, iconSize: 20, onClick: (e) => handleRemoveClick(e, file.name), tooltip: 'remove file', onToolTip: (tip) => onToolTip(tip) }) })] }, `${file.name}-${index}`));
96
+ }) }));
97
+ });
98
+
99
+ var css_248z$1 = ".flexBox-module_row__PWxbe {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__27lKK {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__nJZnW {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__dHcOU {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__MP2Xd {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__Kg8cV {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__zcmtk {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__157yI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__u2nwI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__QWEzl {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__FxEAv {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__rf7AV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__8-FO- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__qyYq- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__7GQ5Z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__Qtp5G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__Ieh9K {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__0lZ3I {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__Ar4d3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__6tV1n {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__I8Q1v {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-bold__QFgN8 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-medium__jGIb2 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__tdBSi {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__-7Uyu {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__8hGYF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 28px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Cryjg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 28px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.UserList-module_promptList__M6-D9 {\n\twidth: 100%;\n\tgap: 8px;\n}\n\n@keyframes UserList-module_blink__695OA {\n\t0% {\n\t\topacity: 1;\n\t}\n\t50% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n\n.UserList-module_userPrompt__YyVU5 {\n\talign-items: flex-start;\n\tpadding: 10px 12px;\n\tborder-radius: 24px;\n\tbackground: var(--core-surface-primary);\n\tborder: 1px solid var(--core-outline-primary);\n\tcursor: default;\n}\n\n.UserList-module_avatar__WvAyh {\n\theight: 24px;\n\twidth: 24px;\n}\n\n.UserList-module_prompt__2on5a {\n\tflex: 1;\n\tpadding: 0px 16px 0px 8px;\n\tcolor: var(--core-text-tertiary);\n\tfont-weight: 380;\n\tline-height: 1.5em;\n\tmin-height: 24px;\n}\n\n.UserList-module_promptStrong__-2WPf {\n\tfont-size: inherit;\n\tfont-weight: inherit;\n\tline-height: inherit;\n\tcolor: var(--core-text-primary);\n}\n\n.UserList-module_promptParagraph__L6phk {\n\tmargin: 0;\n\tpadding: 0;\n}\n\n.UserList-module_control__iBmvg {\n\tborder-radius: 100%;\n\tborder: 1px solid var(--control-border-color);\n\theight: 24px;\n\twidth: 24px;\n\tcursor: pointer;\n}\n\n.UserList-module_cursor__xmRjh {\n\tdisplay: block;\n\tbackground: var(--cursor-background);\n\tmin-width: 0.5em;\n\tmin-height: 0.5em;\n\twidth: 0.5em;\n\theight: 0.5em;\n\tborder-radius: var(--cursor-border-radius);\n\tanimation: var(--cursor-animation);\n}\n";
100
+ var css$1 = {"promptList":"UserList-module_promptList__M6-D9 flexBox-module_columnStart__Kg8cV","userPrompt":"UserList-module_userPrompt__YyVU5 flexBox-module_rowStart__nJZnW","avatar":"UserList-module_avatar__WvAyh flexBox-module_row__PWxbe","prompt":"UserList-module_prompt__2on5a flexBox-module_rowStart__nJZnW type-module_body-s-regular__8-FO-","promptStrong":"UserList-module_promptStrong__-2WPf","promptParagraph":"UserList-module_promptParagraph__L6phk","control":"UserList-module_control__iBmvg flexBox-module_row__PWxbe","cursor":"UserList-module_cursor__xmRjh"};
101
+ styleInject(css_248z$1);
102
+
103
+ var PrompState;
104
+ (function (PrompState) {
105
+ PrompState["Idle"] = "idle";
106
+ PrompState["Disabled"] = "disabled";
107
+ PrompState["Enabled"] = "enabled";
108
+ })(PrompState || (PrompState = {}));
109
+ var Role$1;
110
+ (function (Role) {
111
+ Role["Owner"] = "owner";
112
+ Role["Editor"] = "editor";
113
+ Role["Viewer"] = "viewer";
114
+ })(Role$1 || (Role$1 = {}));
115
+
116
+ function UserListComponent(props) {
117
+ const theme = useTheme();
118
+ const { userPresence = [], onTogglePrompt = () => null, owner = '', currentUser = '', presenceID = '', } = props;
119
+ const [userList, setUserList] = useState(userPresence);
120
+ useEffect(() => setUserList(userPresence), [userPresence]);
121
+ const handleTogglePrompt = useCallback((user) => {
122
+ if (currentUser !== owner)
123
+ return;
124
+ let promptState = PrompState.Disabled;
125
+ if (user.promptState) {
126
+ promptState =
127
+ user.promptState === PrompState.Disabled
128
+ ? PrompState.Enabled
129
+ : PrompState.Disabled;
130
+ }
131
+ const presenceUpdate = Object.assign(Object.assign({}, user), { promptState });
132
+ onTogglePrompt(presenceUpdate);
133
+ }, [currentUser, owner, onTogglePrompt]);
134
+ const getCssVars = useCallback((enabled) => ({
135
+ '--control-border-color': enabled
136
+ ? theme.current.colors['core-outline-primary']
137
+ : theme.current.colors['feedback-warning'],
138
+ '--cursor-background': enabled
139
+ ? theme.current.colors['core-icon-primary']
140
+ : theme.current.colors['feedback-warning'],
141
+ '--cursor-border-radius': enabled ? '100px' : '2px',
142
+ '--cursor-animation': enabled ? 'blink 2s infinite' : 'none',
143
+ }), [theme.current.colors]);
144
+ const renderedUserList = useMemo(() => userList.map((user, index) => {
145
+ if (user.id === presenceID)
146
+ return null;
147
+ if (!user.promptContent || user.promptContent === '')
148
+ return null;
149
+ const enabled = user.promptState !== PrompState.Disabled;
150
+ const cssVars = getCssVars(enabled);
151
+ return (jsxs("div", { className: css$1.userPrompt, onClick: (e) => e.stopPropagation(), onKeyDown: (e) => e.stopPropagation(), children: [jsx("div", { className: css$1.avatar, children: jsx(Avatar, { size: 20, first: user.first, last: user.last, image: user.avatar, bgColor: user.bgColor, color: user.color, border: 0 }) }), jsx("div", { className: css$1.prompt, children: jsxs("p", { className: css$1.promptParagraph, children: [jsxs("strong", { className: css$1.promptStrong, children: [user.first, ":"] }), ' ', user.promptContent] }) }), currentUser === owner &&
152
+ currentUser !== user.email &&
153
+ user.promptContent !== '' && (jsx("div", { className: css$1.control, style: cssVars, role: 'button', "aria-label": 'Stop/Play', onKeyDown: () => handleTogglePrompt(user), onClick: () => handleTogglePrompt(user), tabIndex: 0, children: jsx("span", { className: css$1.cursor }) }))] }, `${user.email}-${index}`));
154
+ }), [userList, presenceID, currentUser, owner, getCssVars, handleTogglePrompt]);
155
+ return jsx("div", { className: css$1.promptList, children: renderedUserList });
156
+ }
157
+ const UserList = memo(UserListComponent);
158
+
159
+ var PromptType;
160
+ (function (PromptType) {
161
+ PromptType[PromptType["none"] = -1] = "none";
162
+ PromptType[PromptType["text"] = 0] = "text";
163
+ PromptType[PromptType["expand"] = 1] = "expand";
164
+ PromptType[PromptType["summarize"] = 2] = "summarize";
165
+ PromptType[PromptType["research"] = 3] = "research";
166
+ PromptType[PromptType["translate"] = 4] = "translate";
167
+ PromptType[PromptType["shorten"] = 5] = "shorten";
168
+ PromptType[PromptType["file"] = 6] = "file";
169
+ PromptType[PromptType["compliance"] = 7] = "compliance";
170
+ })(PromptType || (PromptType = {}));
171
+ var Role;
172
+ (function (Role) {
173
+ Role["USER"] = "user";
174
+ Role["ASSISTANT"] = "assistant";
175
+ Role["TOOL"] = "tool";
176
+ Role["SYSTEM"] = "system";
177
+ })(Role || (Role = {}));
178
+
179
+ var css_248z = ".flexBox-module_row__PWxbe {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__27lKK {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__nJZnW {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__dHcOU {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__MP2Xd {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__Kg8cV {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__zcmtk {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__157yI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__u2nwI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__QWEzl {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__FxEAv {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__rf7AV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__8-FO- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__qyYq- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__7GQ5Z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__Qtp5G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__Ieh9K {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__0lZ3I {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__Ar4d3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__6tV1n {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__I8Q1v {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-bold__QFgN8 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-medium__jGIb2 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__tdBSi {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__-7Uyu {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__8hGYF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 28px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Cryjg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 28px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.MessageInput-module_wrapper__CDukE {\n\talign-self: center;\n\twidth: 100%;\n\tmin-width: 300px;\n\toverflow: visible;\n\toverflow-y: hidden;\n\tpadding: var(--wrapper-padding);\n\tborder-radius: 16px;\n\tbackground: var(--core-surface-primary);\n\tbox-shadow: var(--wrapper-shadow);\n\toutline: none;\n\ttransition: all 0.3s ease-in-out 0s;\n}\n\n.MessageInput-module_wrapper__CDukE.MessageInput-module_focused__DTxPV {\n\tbox-shadow: var(--wrapper-shadow-focused);\n}\n\n.MessageInput-module_textarea__p5ot8 {\n\twidth: 100%;\n\toverflow-y: hidden;\n\tresize: none;\n\tborder: 0;\n\toutline: none;\n\tcolor: var(--core-text-primary);\n\tbackground: transparent;\n\tpadding: 0 0 5px;\n}\n\n.MessageInput-module_textarea__p5ot8::placeholder {\n\tcolor: var(--core-text-disabled);\n}\n\n.MessageInput-module_buttonRow__cbSNm {\n\twidth: 100%;\n\tpadding: 0;\n}\n\n.MessageInput-module_actionButtons__mtfoV {\n\tcolor: var(--core-text-disabled);\n\tz-index: 1;\n\tgap: 12px;\n}\n\n.MessageInput-module_send__UksvP {\n\tposition: relative;\n}\n\n.MessageInput-module_inputWrapper__sB-l0 {\n\talign-items: flex-end;\n\twidth: 100%;\n\tpadding: var(--input-wrapper-padding);\n}\n";
180
+ var css = {"wrapper":"MessageInput-module_wrapper__CDukE flexBox-module_columnEnd__u2nwI","textarea":"MessageInput-module_textarea__p5ot8 type-module_body-m-regular__Qtp5G","buttonRow":"MessageInput-module_buttonRow__cbSNm flexBox-module_rowBetween__27lKK","actionButtons":"MessageInput-module_actionButtons__mtfoV flexBox-module_row__PWxbe type-module_body-m-regular__Qtp5G","send":"MessageInput-module_send__UksvP flexBox-module_row__PWxbe","inputWrapper":"MessageInput-module_inputWrapper__sB-l0 flexBox-module_columnEnd__u2nwI"};
181
+ styleInject(css_248z);
182
+
183
+ function MessageInput(props) {
184
+ var _a, _b, _c, _d;
185
+ const { maxHeight = 300, focused = false, error = null, value = '', placeholder = 'Ask me anytning HR compliance', isStreaming = false, isFetching = false, isShort = true, jurisdiction = null, files = [], excerpts = [], users = [], currentUser, presenceID, owner, jurisdictionClick = () => null, attachClick = () => null, onChangeFiles = () => null, onChangeExcerpts = () => null, onTogglePrompt = () => null, onChange = () => null, onBlur = () => null, onFocus = () => null, onStop = () => null, onSend = () => null, onToolTip = () => null } = props, divAttributes = __rest(props, ["maxHeight", "focused", "error", "value", "placeholder", "isStreaming", "isFetching", "isShort", "jurisdiction", "files", "excerpts", "users", "currentUser", "presenceID", "owner", "jurisdictionClick", "attachClick", "onChangeFiles", "onChangeExcerpts", "onTogglePrompt", "onChange", "onBlur", "onFocus", "onStop", "onSend", "onToolTip"]);
186
+ const { id: divId, className, style } = divAttributes, rest = __rest(divAttributes, ["id", "className", "style"]);
187
+ const divStyle = style !== null && style !== void 0 ? style : {};
188
+ const divClass = className ? ` ${className}` : '';
189
+ const theme = useTheme();
190
+ const ref = useRef(null);
191
+ const wrapperRef = useRef(null);
192
+ const [message, setMessage] = useState(value);
193
+ const [isFocused, setIsFocused] = useState(focused);
194
+ const [promptType, setPromptType] = useState(PromptType.text);
195
+ const [invalid, setInvalid] = useState(error);
196
+ const [remoteDisabled, setRemoteDisabled] = useState(false);
197
+ // reset size if the wrapper size changes
198
+ useEffect(() => {
199
+ if (ref === null || ref === void 0 ? void 0 : ref.current) {
200
+ ref.current.style.height = '0px';
201
+ ref.current.style.height = `${Math.min(ref.current.scrollHeight, maxHeight)}px`;
202
+ }
203
+ }, [maxHeight]);
204
+ // reset the message text of the active document is changed
205
+ useEffect(() => setMessage(value), [value]);
206
+ // enable setting focus byt changing the focus prop
207
+ useEffect(() => {
208
+ if (ref === null || ref === void 0 ? void 0 : ref.current) {
209
+ if (focused)
210
+ ref.current.focus();
211
+ else
212
+ ref.current.blur();
213
+ setIsFocused(focused);
214
+ }
215
+ }, [focused]);
216
+ // disabled prompt if remote owner disabled the user
217
+ useEffect(() => {
218
+ if (users.length > 0) {
219
+ const myPresensce = users.filter((user) => {
220
+ return user.email === currentUser;
221
+ });
222
+ if (myPresensce && myPresensce.length > 0) {
223
+ setRemoteDisabled(myPresensce[0].promptState === PrompState.Disabled);
224
+ }
225
+ return;
226
+ }
227
+ setRemoteDisabled(false);
228
+ }, [users, currentUser]);
229
+ // update error is prop changes
230
+ useEffect(() => setInvalid(error), [error]);
231
+ const resetHeight = useCallback(() => {
232
+ if (ref === null || ref === void 0 ? void 0 : ref.current) {
233
+ ref.current.style.height = '0px';
234
+ ref.current.style.height = `${Math.min(ref.current.scrollHeight, maxHeight)}px`;
235
+ }
236
+ }, [maxHeight]);
237
+ const doSubmit = useCallback((e) => {
238
+ e === null || e === void 0 ? void 0 : e.preventDefault();
239
+ e === null || e === void 0 ? void 0 : e.stopPropagation();
240
+ onToolTip(null);
241
+ if (message !== '' && ref.current) {
242
+ const newMessage = {
243
+ id: crypto.randomUUID(),
244
+ content: message,
245
+ timestamp: new Date().toISOString(),
246
+ promptType,
247
+ role: Role.USER,
248
+ htmlContent: '',
249
+ files,
250
+ excerpts,
251
+ done: false,
252
+ };
253
+ onSend(newMessage);
254
+ setMessage('');
255
+ onChange('');
256
+ resetHeight();
257
+ setIsFocused(false);
258
+ ref.current.blur();
259
+ ref.current.value = '';
260
+ }
261
+ }, [
262
+ message,
263
+ promptType,
264
+ files,
265
+ excerpts,
266
+ onSend,
267
+ onChange,
268
+ resetHeight,
269
+ onToolTip,
270
+ ]);
271
+ const handleKeyDown = useCallback((e) => {
272
+ if (!e.shiftKey && e.key === 'Enter' && message !== '')
273
+ doSubmit(e);
274
+ else
275
+ return;
276
+ }, [message, doSubmit]);
277
+ const setFocus = useCallback(() => {
278
+ if (ref === null || ref === void 0 ? void 0 : ref.current) {
279
+ ref.current.focus();
280
+ setIsFocused(true);
281
+ onFocus();
282
+ }
283
+ }, [onFocus]);
284
+ const setBlur = useCallback(() => {
285
+ if (ref === null || ref === void 0 ? void 0 : ref.current) {
286
+ ref.current.blur();
287
+ setIsFocused(false);
288
+ onBlur();
289
+ }
290
+ }, [onBlur]);
291
+ const setDisabled = useCallback(() => {
292
+ if (remoteDisabled)
293
+ return 'disabled';
294
+ if (isStreaming)
295
+ return 'normal';
296
+ if (!isStreaming && files.length > 0)
297
+ return 'normal';
298
+ if (invalid && invalid !== '')
299
+ return 'disabled';
300
+ if (!isStreaming && isFetching)
301
+ return 'disabled';
302
+ if (!isStreaming && message === '')
303
+ return 'disabled';
304
+ return 'normal';
305
+ }, [remoteDisabled, isStreaming, files.length, invalid, isFetching, message]);
306
+ const iconColor = useCallback(() => {
307
+ var _a, _b, _c, _d;
308
+ if (isFetching || isStreaming) {
309
+ if (theme.current.name === 'lightMode')
310
+ return (_a = theme === null || theme === void 0 ? void 0 : theme.current.colors) === null || _a === void 0 ? void 0 : _a['core-text-light'];
311
+ return (_b = theme === null || theme === void 0 ? void 0 : theme.current.colors) === null || _b === void 0 ? void 0 : _b['core-surface-primary'];
312
+ }
313
+ if (message === '') {
314
+ return (_c = theme === null || theme === void 0 ? void 0 : theme.current.colors) === null || _c === void 0 ? void 0 : _c['core-surface-secondary'];
315
+ }
316
+ return (_d = theme === null || theme === void 0 ? void 0 : theme.current.colors) === null || _d === void 0 ? void 0 : _d['core-text-light'];
317
+ }, [
318
+ isFetching,
319
+ isStreaming,
320
+ theme.current.name,
321
+ theme === null || theme === void 0 ? void 0 : theme.current.colors,
322
+ message,
323
+ ]);
324
+ const handleUpload = useCallback((e, type) => {
325
+ e === null || e === void 0 ? void 0 : e.preventDefault();
326
+ e === null || e === void 0 ? void 0 : e.stopPropagation();
327
+ setPromptType(type);
328
+ attachClick(e);
329
+ }, [attachClick]);
330
+ const handleChange = useCallback((input) => {
331
+ if (message !== input)
332
+ onChange(input);
333
+ setMessage(input);
334
+ }, [message, onChange]);
335
+ const handleStop = useCallback((e) => {
336
+ e === null || e === void 0 ? void 0 : e.preventDefault();
337
+ e === null || e === void 0 ? void 0 : e.stopPropagation();
338
+ onToolTip(null);
339
+ setBlur();
340
+ onStop();
341
+ }, [onToolTip, setBlur, onStop]);
342
+ const working = useCallback(() => {
343
+ if (isStreaming)
344
+ return false;
345
+ if (isFetching)
346
+ return true;
347
+ return false;
348
+ }, [isStreaming, isFetching]);
349
+ const toolTip = useCallback(() => {
350
+ if (isStreaming)
351
+ return 'Stop';
352
+ if (isFetching)
353
+ return 'Working ...';
354
+ return 'Send';
355
+ }, [isStreaming, isFetching]);
356
+ const setJurisdiction = useCallback(() => {
357
+ const country = jurisdiction === null || jurisdiction === void 0 ? void 0 : jurisdiction.country;
358
+ const state = jurisdiction === null || jurisdiction === void 0 ? void 0 : jurisdiction.state;
359
+ if (!country || country === 'None')
360
+ return 'None';
361
+ if (state !== 'None')
362
+ return state;
363
+ return country;
364
+ }, [jurisdiction === null || jurisdiction === void 0 ? void 0 : jurisdiction.country, jurisdiction === null || jurisdiction === void 0 ? void 0 : jurisdiction.state]);
365
+ // memo css vars
366
+ const cssVars = useMemo(() => {
367
+ const shadowValue = isShort ? 0 : 1;
368
+ return {
369
+ '--wrapper-padding': isShort
370
+ ? '16px 12px 8px 16px'
371
+ : '16px 12px 16px 16px',
372
+ '--wrapper-shadow': `0 0 1px ${shadowValue}px transparent`,
373
+ // biome-ignore lint/style/noUnusedTemplateLiteral: <explanation>
374
+ '--wrapper-shadow-focused': `0 0 1px 2px var(--core-outline-special)`,
375
+ '--input-wrapper-padding': isShort
376
+ ? '4px 4px 0px 4px'
377
+ : '4px 4px 16px 4px',
378
+ };
379
+ }, [isShort]);
380
+ const wrapperClassName = [css.wrapper, isFocused ? 'focused' : '']
381
+ .filter(Boolean)
382
+ .join(' ');
383
+ return (jsxs("div", Object.assign({ id: divId, className: `${wrapperClassName}${divClass}`, style: Object.assign(Object.assign({}, divStyle), cssVars), onKeyDown: () => null, onClick: () => {
384
+ if (!isFocused)
385
+ setFocus();
386
+ }, ref: wrapperRef }, rest, { children: [jsx(AnimatePresence, { initial: false, children: excerpts.length > 0 && (jsx(ExcerptList, { excerpts: excerpts, onChange: (excerpts) => onChangeExcerpts(excerpts), onToolTip: (tip) => onToolTip(tip) })) }), jsx(AnimatePresence, { initial: false, children: files.length > 0 && (jsx(FileList, { files: files, onChange: (items) => onChangeFiles(items), onToolTip: (tip) => onToolTip(tip) })) }), jsx("div", { className: css.inputWrapper, style: cssVars, children: jsx("textarea", { id: 'messageInput', name: 'messageInput', className: css.textarea, ref: ref, value: message, onChange: ({ target }) => handleChange(target.value), onInput: () => resetHeight(), onKeyDown: (e) => handleKeyDown(e), placeholder: placeholder, disabled: isStreaming, onFocus: () => setFocus(), onBlur: () => setBlur(), rows: 1 }) }), jsx(AnimatePresence, { initial: false, children: users.length > 0 && (jsx(UserList, { userPresence: users, owner: owner, currentUser: currentUser, presenceID: presenceID, onTogglePrompt: (presence) => onTogglePrompt(presence), onToolTip: (tip) => onToolTip(tip) })) }), jsxs("div", { className: css.buttonRow, children: [jsxs("div", { className: css.actionButtons, children: [jsx(UIButton, { variant: 'outline', iconLeft: 'plus', tooltip: 'Attach file', onClick: (e) => handleUpload(e, PromptType.file), size: 'medium', iconColor: theme.current.colors['core-icon-primary'], round: true, onToolTip: (tip) => onToolTip(tip) }), jsx(UIButton, { paddingRight: 18, paddingLeft: 8, variant: 'outline', label: `Focus: ${setJurisdiction()}`, tooltip: 'Jurisdication Focus', onClick: (_e) => jurisdictionClick(), iconLeft: 'focus', size: 'medium', iconColor: theme.current.colors['core-icon-primary'], labelColor: (_a = theme === null || theme === void 0 ? void 0 : theme.current.colors) === null || _a === void 0 ? void 0 : _a['core-text-secondary'], onToolTip: (tip) => onToolTip(tip) })] }), jsx("div", { className: css.send, children: jsx(UIButton, { variant: 'solid', iconLeft: isStreaming ? 'stop' : 'arrow up', bgColorDisabled: (_b = theme === null || theme === void 0 ? void 0 : theme.current.colors) === null || _b === void 0 ? void 0 : _b['core-badge-secondary'], bgColor: isFetching || isStreaming
387
+ ? (_c = theme === null || theme === void 0 ? void 0 : theme.current.colors) === null || _c === void 0 ? void 0 : _c['core-text-primary']
388
+ : (_d = theme === null || theme === void 0 ? void 0 : theme.current.colors) === null || _d === void 0 ? void 0 : _d['core-button-primary'], iconColor: iconColor(), state: setDisabled(), size: 'medium', progress: true, working: working(), round: true, onClick: (e) => {
389
+ if (isStreaming)
390
+ handleStop(e);
391
+ if (isFetching)
392
+ return;
393
+ doSubmit(e);
394
+ }, tooltip: toolTip(), onToolTip: (tip) => onToolTip(tip) }) })] })] })));
395
+ }
396
+
397
+ export { MessageInput as M };
@@ -0,0 +1,43 @@
1
+ import { _ as __rest } from './tslib.es6-0pkUdtrF.js';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { AnimatePresence, motion } from 'motion/react';
4
+ import React, { useMemo, useCallback } from 'react';
5
+ import { s as styleInject } from './style-inject.es-tgCJW-Cu.js';
6
+
7
+ var css_248z = ".Overlay-module_overlay__QJZO- {\n\tposition: fixed;\n\ttop: 0;\n\tleft: 0;\n\tright: 0;\n\tbottom: 0;\n\tbackground-color: var(--overlay-color);\n\tz-index: 500;\n}\n";
8
+ var css = {"overlay":"Overlay-module_overlay__QJZO-"};
9
+ styleInject(css_248z);
10
+
11
+ const Overlay = React.memo((props) => {
12
+ const { onClick = () => null, toggleOverlay = () => null, opacity = 0, color = 'rgb(0,0,0)', type = 'clear', global = false, overlay } = props, divAttributes = __rest(props, ["onClick", "toggleOverlay", "opacity", "color", "type", "global", "overlay"]);
13
+ const { id: divId, className, style } = divAttributes, rest = __rest(divAttributes, ["id", "className", "style"]);
14
+ const divStyle = style !== null && style !== void 0 ? style : {};
15
+ const divClass = className ? ` ${className}` : '';
16
+ const show = !global || (global && overlay);
17
+ // Memoize computed opacity value
18
+ const computedOpacity = useMemo(() => {
19
+ if (type === 'clear')
20
+ return 0;
21
+ if (opacity !== undefined)
22
+ return opacity;
23
+ if (type === 'dark')
24
+ return 0.8;
25
+ return 0;
26
+ }, [type, opacity]);
27
+ const handleClick = useCallback(() => {
28
+ if (global)
29
+ toggleOverlay(false);
30
+ onClick();
31
+ }, [global, toggleOverlay, onClick]);
32
+ const handleContextMenu = useCallback((e) => {
33
+ e.preventDefault();
34
+ }, []);
35
+ const cssVars = useMemo(() => {
36
+ return {
37
+ '--overlay-color': color !== null && color !== void 0 ? color : 'rgb(0,0,0)',
38
+ };
39
+ }, [color]);
40
+ return (jsx(AnimatePresence, { initial: false, children: show && (jsx(motion.div, Object.assign({ id: divId, className: `${css.overlay}${divClass}`, style: Object.assign(Object.assign({}, divStyle), cssVars), initial: { opacity: 0 }, animate: { opacity: computedOpacity }, exit: { opacity: 0 }, onClick: handleClick, onContextMenu: handleContextMenu }, rest))) }));
41
+ });
42
+
43
+ export { Overlay as O };
@@ -0,0 +1,40 @@
1
+ import { _ as __rest } from './tslib.es6-0pkUdtrF.js';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import React, { useState, useMemo, useEffect, useCallback } from 'react';
4
+ import { a as accessibleKeyDown } from './utils-BRZK2Drn.js';
5
+ import { s as styleInject } from './style-inject.es-tgCJW-Cu.js';
6
+
7
+ var css_248z = ".flexBox-module_row__PWxbe {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__27lKK {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__nJZnW {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__dHcOU {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__MP2Xd {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__Kg8cV {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__zcmtk {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__157yI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__u2nwI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}\n\n.Pager-module_wrapper__L8AZG {\n\tgap: var(--pager-gap);\n\twidth: 100%;\n}\n\n.Pager-module_bullet__tj-vE {\n\twidth: var(--pager-size);\n\theight: var(--pager-size);\n\tmax-width: var(--pager-size);\n\tmax-height: var(--pager-size);\n\tbackground: var(--pager-color);\n\tborder-radius: 100%;\n\tborder: 0;\n\tcursor: pointer;\n\ttransition: background 0.25s ease-in-out 0s;\n\t&:hover {\n\t\tbackground: var(--pager-colorHover);\n\t}\n}\n\n.Pager-module_selected__EdNnR {\n\tbackground: var(--pager-colorOn);\n\t&:hover {\n\t\tbackground: var(--pager-colorOn);\n\t}\n}\n";
8
+ var css = {"wrapper":"Pager-module_wrapper__L8AZG flexBox-module_row__PWxbe","bullet":"Pager-module_bullet__tj-vE flexBox-module_row__PWxbe","selected":"Pager-module_selected__EdNnR"};
9
+ styleInject(css_248z);
10
+
11
+ const Pager = React.memo((props) => {
12
+ const { size = 8, index = 0, color = undefined, colorHover = undefined, colorOn = undefined, pages = 2, gap = 4, onChange = () => null } = props, divAttributes = __rest(props, ["size", "index", "color", "colorHover", "colorOn", "pages", "gap", "onChange"]);
13
+ const { id: divId, className, style } = divAttributes, rest = __rest(divAttributes, ["id", "className", "style"]);
14
+ const divStyle = style !== null && style !== void 0 ? style : {};
15
+ const divClass = className ? ` ${className}` : '';
16
+ const [selected, setSelected] = useState(index);
17
+ const bullets = useMemo(() => {
18
+ return Array.from({ length: pages }, (_, i) => i);
19
+ }, [pages]);
20
+ useEffect(() => setSelected(index), [index]);
21
+ const handleClick = useCallback((i) => {
22
+ setSelected(i);
23
+ onChange(i);
24
+ }, [onChange]);
25
+ // memo css vars
26
+ const cssVars = useMemo(() => {
27
+ return {
28
+ '--pager-gap': `${gap}px`,
29
+ '--pager-size': `${size}px`,
30
+ '--pager-color': color !== null && color !== void 0 ? color : 'var(--core-text-disabled)',
31
+ '--pager-colorOn': colorOn !== null && colorOn !== void 0 ? colorOn : 'var(--core-text-primary)',
32
+ '--pager-colorHover': colorHover !== null && colorHover !== void 0 ? colorHover : 'var(--core-text-disabled)',
33
+ };
34
+ }, [gap, size, color, colorOn, colorHover]);
35
+ return (jsx("div", Object.assign({ id: divId, style: Object.assign(Object.assign({}, divStyle), cssVars), className: `${css.wrapper}${divClass}` }, rest, { children: bullets.map((bulletId) => {
36
+ return (jsx("input", { className: `${css.bullet} ${selected === bulletId ? css.selected : ''}`, type: 'button', onClick: () => handleClick(bulletId), onKeyDown: (e) => accessibleKeyDown(e, () => handleClick(bulletId)), onTouchStart: () => handleClick(bulletId), tabIndex: bulletId }, `paging_bullet_${bulletId}`));
37
+ }) })));
38
+ });
39
+
40
+ export { Pager as P };