@krak-stack/registry 0.10.20 → 0.11.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 (451) hide show
  1. package/CHANGELOG.md +89 -3
  2. package/README.md +11 -8
  3. package/dist/components/agent/index.d.ts +454 -0
  4. package/dist/components/agent/react.d.ts +55 -0
  5. package/dist/components/agent/react.js +2440 -0
  6. package/dist/components/agent/schema.d.ts +55 -0
  7. package/dist/components/animated-list/classes.d.ts +9 -0
  8. package/dist/components/animated-list/html.d.ts +11 -0
  9. package/dist/components/animated-list/html.js +533 -0
  10. package/dist/components/animated-list/index.d.ts +205 -0
  11. package/dist/components/animated-list/react.d.ts +11 -0
  12. package/dist/components/{ui/animated-list.js → animated-list/react.js} +199 -54
  13. package/dist/components/animated-list/schema.d.ts +44 -0
  14. package/dist/components/animated-number/html.d.ts +19 -0
  15. package/dist/components/animated-number/html.js +101 -0
  16. package/dist/components/animated-number/index.d.ts +80 -0
  17. package/dist/components/{ui/animated-number.d.ts → animated-number/react.d.ts} +2 -7
  18. package/dist/components/animated-number/react.js +124 -0
  19. package/dist/components/animated-number/schema.d.ts +9 -0
  20. package/dist/components/app-brand/classes.d.ts +11 -0
  21. package/dist/components/app-brand/html.d.ts +26 -0
  22. package/dist/components/app-brand/html.js +78 -0
  23. package/dist/components/app-brand/react.d.ts +12 -0
  24. package/dist/components/app-brand/react.js +86 -0
  25. package/dist/components/app-brand/schema.d.ts +36 -0
  26. package/dist/components/app-switcher/classes.d.ts +15 -0
  27. package/dist/components/app-switcher/html.d.ts +72 -0
  28. package/dist/components/app-switcher/html.js +327 -0
  29. package/dist/components/app-switcher/index.d.ts +47 -0
  30. package/dist/components/app-switcher/react.d.ts +12 -0
  31. package/dist/components/{ui/app-switcher.js → app-switcher/react.js} +84 -15
  32. package/dist/components/app-switcher/schema.d.ts +39 -0
  33. package/dist/components/async-action-button/classes.d.ts +11 -0
  34. package/dist/components/async-action-button/html.d.ts +46 -0
  35. package/dist/components/async-action-button/html.js +266 -0
  36. package/dist/components/async-action-button/index.d.ts +73 -0
  37. package/dist/components/async-action-button/react.d.ts +10 -0
  38. package/dist/components/async-action-button/react.js +224 -0
  39. package/dist/components/async-action-button/schema.d.ts +28 -0
  40. package/dist/{services/events/client/audit-log-table.d.ts → components/audit-log-table/react.d.ts} +2 -2
  41. package/dist/{services/events/client/audit-log-table.js → components/audit-log-table/react.js} +1964 -847
  42. package/dist/components/auto-height/html.d.ts +8 -0
  43. package/dist/components/auto-height/html.js +81 -0
  44. package/dist/components/auto-height/index.d.ts +2 -0
  45. package/dist/components/{ui/auto-height.d.ts → auto-height/react.d.ts} +2 -4
  46. package/dist/components/auto-height/react.js +75 -0
  47. package/dist/components/auto-height/schema.d.ts +7 -0
  48. package/dist/components/bulk-list-input/classes.d.ts +7 -0
  49. package/dist/components/bulk-list-input/html.d.ts +41 -0
  50. package/dist/components/bulk-list-input/html.js +265 -0
  51. package/dist/components/bulk-list-input/index.d.ts +76 -0
  52. package/dist/components/bulk-list-input/react.d.ts +12 -0
  53. package/dist/components/{ui/bulk-list-input.js → bulk-list-input/react.js} +71 -4
  54. package/dist/components/bulk-list-input/schema.d.ts +33 -0
  55. package/dist/components/choice-cards/classes.d.ts +19 -0
  56. package/dist/components/choice-cards/html.d.ts +76 -0
  57. package/dist/components/choice-cards/html.js +237 -0
  58. package/dist/components/choice-cards/index.d.ts +1 -0
  59. package/dist/components/choice-cards/react.d.ts +21 -0
  60. package/dist/components/{ui/choice-cards.js → choice-cards/react.js} +29 -10
  61. package/dist/components/choice-cards/schema.d.ts +100 -0
  62. package/dist/components/code-block/classes.d.ts +13 -0
  63. package/dist/components/code-block/html.d.ts +21 -0
  64. package/dist/components/code-block/html.js +381 -0
  65. package/dist/components/code-block/index.d.ts +4 -0
  66. package/dist/components/code-block/react.d.ts +4 -0
  67. package/dist/components/{ui/code-block.js → code-block/react.js} +168 -50
  68. package/dist/components/code-block/schema.d.ts +29 -0
  69. package/dist/components/color-input/classes.d.ts +9 -0
  70. package/dist/components/color-input/html.d.ts +48 -0
  71. package/dist/components/color-input/html.js +187 -0
  72. package/dist/components/color-input/index.d.ts +88 -0
  73. package/dist/components/color-input/react.d.ts +7 -0
  74. package/dist/components/{ui/color-picker.js → color-input/react.js} +165 -233
  75. package/dist/components/color-input/schema.d.ts +40 -0
  76. package/dist/components/copy-button/html.d.ts +48 -0
  77. package/dist/components/copy-button/html.js +266 -0
  78. package/dist/components/copy-button/index.d.ts +73 -0
  79. package/dist/components/copy-button/react.d.ts +12 -0
  80. package/dist/components/copy-button/react.js +234 -0
  81. package/dist/components/copy-button/schema.d.ts +37 -0
  82. package/dist/components/copy-value/html.d.ts +37 -0
  83. package/dist/components/copy-value/html.js +426 -0
  84. package/dist/components/copy-value/index.d.ts +57 -0
  85. package/dist/components/copy-value/react.d.ts +9 -0
  86. package/dist/components/{ui/copy-value.js → copy-value/react.js} +243 -65
  87. package/dist/components/copy-value/schema.d.ts +45 -0
  88. package/dist/components/cron-input/classes.d.ts +25 -0
  89. package/dist/components/cron-input/html.d.ts +36 -0
  90. package/dist/components/cron-input/html.js +204 -0
  91. package/dist/components/cron-input/index.d.ts +59 -0
  92. package/dist/components/cron-input/react.d.ts +7 -0
  93. package/dist/components/{ui/cron-expression-editor.js → cron-input/react.js} +126 -54
  94. package/dist/components/cron-input/schema.d.ts +24 -0
  95. package/dist/components/danger-confirmation/classes.d.ts +7 -0
  96. package/dist/components/danger-confirmation/html.d.ts +39 -0
  97. package/dist/components/danger-confirmation/html.js +227 -0
  98. package/dist/components/danger-confirmation/index.d.ts +113 -0
  99. package/dist/components/{ui/danger-confirmation.d.ts → danger-confirmation/react.d.ts} +3 -12
  100. package/dist/components/{ui/danger-confirmation.js → danger-confirmation/react.js} +203 -205
  101. package/dist/components/danger-confirmation/schema.d.ts +34 -0
  102. package/dist/components/data-table/classes.d.ts +63 -0
  103. package/dist/components/data-table/html.d.ts +1938 -0
  104. package/dist/components/data-table/html.js +2682 -0
  105. package/dist/components/data-table/index.d.ts +2686 -0
  106. package/dist/components/data-table/react.d.ts +578 -0
  107. package/dist/components/{ui/data-table.js → data-table/react.js} +1958 -835
  108. package/dist/components/data-table/schema.d.ts +3012 -0
  109. package/dist/components/date-input/classes.d.ts +17 -0
  110. package/dist/components/date-input/html.d.ts +60 -0
  111. package/dist/components/date-input/html.js +418 -0
  112. package/dist/components/date-input/index.d.ts +91 -0
  113. package/dist/components/date-input/react.d.ts +10 -0
  114. package/dist/components/{ui/date-picker.js → date-input/react.js} +233 -79
  115. package/dist/components/date-input/schema.d.ts +41 -0
  116. package/dist/components/editable-text/classes.d.ts +17 -0
  117. package/dist/components/editable-text/html.d.ts +51 -0
  118. package/dist/components/editable-text/html.js +370 -0
  119. package/dist/components/editable-text/index.d.ts +143 -0
  120. package/dist/components/editable-text/react.d.ts +6 -0
  121. package/dist/components/editable-text/react.js +345 -0
  122. package/dist/components/editable-text/schema.d.ts +31 -0
  123. package/dist/components/editing-locale-switcher/classes.d.ts +7 -0
  124. package/dist/components/editing-locale-switcher/html.d.ts +27 -0
  125. package/dist/components/editing-locale-switcher/html.js +250 -0
  126. package/dist/components/editing-locale-switcher/index.d.ts +52 -0
  127. package/dist/components/editing-locale-switcher/react.d.ts +7 -0
  128. package/dist/components/{ui/editing-locale-switcher.js → editing-locale-switcher/react.js} +63 -10
  129. package/dist/components/editing-locale-switcher/schema.d.ts +16 -0
  130. package/dist/components/{ui/effect-form.d.ts → effect-form/react.d.ts} +2 -2
  131. package/dist/components/{ui/effect-form.js → effect-form/react.js} +302 -76
  132. package/dist/components/effectcn/alert-dialog.d.ts +13 -0
  133. package/dist/components/effectcn/button.d.ts +31 -0
  134. package/dist/components/effectcn/calendar.d.ts +12 -0
  135. package/dist/components/effectcn/checkbox.d.ts +10 -0
  136. package/dist/components/effectcn/combobox.d.ts +25 -0
  137. package/dist/components/effectcn/dialog.d.ts +19 -0
  138. package/dist/components/effectcn/field.d.ts +11 -0
  139. package/dist/components/effectcn/file-drop.d.ts +8 -0
  140. package/dist/components/effectcn/input.d.ts +26 -0
  141. package/dist/components/effectcn/menu.d.ts +85 -0
  142. package/dist/components/effectcn/menubar.d.ts +8 -0
  143. package/dist/components/effectcn/popover.d.ts +18 -0
  144. package/dist/components/effectcn/scroll-area.d.ts +12 -0
  145. package/dist/components/effectcn/select.d.ts +68 -0
  146. package/dist/components/effectcn/toast.d.ts +29 -0
  147. package/dist/components/email-composer/index.d.ts +229 -0
  148. package/dist/components/email-composer/labels.d.ts +12 -0
  149. package/dist/components/email-composer/react.d.ts +5 -0
  150. package/dist/components/{ui/email-composer.js → email-composer/react.js} +461 -127
  151. package/dist/components/email-composer/schema.d.ts +42 -0
  152. package/dist/components/email-editor/classes.d.ts +21 -0
  153. package/dist/components/email-editor/html.d.ts +360 -0
  154. package/dist/components/email-editor/html.js +1706 -0
  155. package/dist/components/email-editor/index.d.ts +693 -0
  156. package/dist/components/{ui/email-editor.d.ts → email-editor/labels.d.ts} +1 -21
  157. package/dist/components/email-editor/legacy-editor.html.d.ts +160 -0
  158. package/dist/components/email-editor/react.d.ts +11 -0
  159. package/dist/components/{ui/email-editor.js → email-editor/react.js} +600 -230
  160. package/dist/components/email-editor/schema.d.ts +162 -0
  161. package/dist/components/error-component/classes.d.ts +7 -0
  162. package/dist/components/error-component/html.d.ts +120 -0
  163. package/dist/components/error-component/html.js +346 -0
  164. package/dist/components/error-component/index.d.ts +69 -0
  165. package/dist/components/error-component/react.d.ts +8 -0
  166. package/dist/components/{ui/error-component.js → error-component/react.js} +281 -78
  167. package/dist/components/error-component/schema.d.ts +56 -0
  168. package/dist/components/file-input/classes.d.ts +7 -0
  169. package/dist/components/file-input/html.d.ts +95 -0
  170. package/dist/components/file-input/html.js +368 -0
  171. package/dist/components/file-input/index.d.ts +99 -0
  172. package/dist/components/file-input/react.d.ts +11 -0
  173. package/dist/components/{ui/file-picker.js → file-input/react.js} +122 -19
  174. package/dist/components/file-input/schema.d.ts +37 -0
  175. package/dist/components/{ui/form.d.ts → form/react.d.ts} +7 -7
  176. package/dist/components/{ui/form.js → form/react.js} +300 -74
  177. package/dist/components/icon-input/html.d.ts +55 -0
  178. package/dist/components/icon-input/html.js +538 -0
  179. package/dist/components/icon-input/index.d.ts +143 -0
  180. package/dist/components/icon-input/react.d.ts +6 -0
  181. package/dist/components/{ui/icon-input.js → icon-input/react.js} +305 -89
  182. package/dist/components/icon-input/schema.d.ts +23 -0
  183. package/dist/components/image-crop-editor/classes.d.ts +19 -0
  184. package/dist/components/image-crop-editor/html.d.ts +66 -0
  185. package/dist/components/image-crop-editor/html.js +561 -0
  186. package/dist/components/image-crop-editor/index.d.ts +183 -0
  187. package/dist/components/image-crop-editor/react.d.ts +8 -0
  188. package/dist/components/image-crop-editor/react.js +648 -0
  189. package/dist/components/image-crop-editor/schema.d.ts +54 -0
  190. package/dist/components/krakstack-provider/html.d.ts +17 -0
  191. package/dist/components/krakstack-provider/html.js +37 -0
  192. package/dist/components/krakstack-provider/index.d.ts +7 -0
  193. package/dist/components/krakstack-provider/react.d.ts +8 -0
  194. package/dist/components/{ui/krakstack-provider.js → krakstack-provider/react.js} +14 -5
  195. package/dist/components/krakstack-provider/schema.d.ts +6 -0
  196. package/dist/components/loading/classes.d.ts +5 -0
  197. package/dist/components/loading/html.d.ts +18 -0
  198. package/dist/components/loading/html.js +166 -0
  199. package/dist/components/loading/index.d.ts +6 -0
  200. package/dist/components/loading/react.d.ts +4 -0
  201. package/dist/components/loading/react.js +51 -0
  202. package/dist/components/loading/schema.d.ts +23 -0
  203. package/dist/components/locale-switcher/html.d.ts +22 -0
  204. package/dist/components/locale-switcher/html.js +264 -0
  205. package/dist/components/locale-switcher/index.d.ts +50 -0
  206. package/dist/components/locale-switcher/react.d.ts +7 -0
  207. package/dist/components/{ui/locale-switcher.js → locale-switcher/react.js} +55 -22
  208. package/dist/components/locale-switcher/schema.d.ts +12 -0
  209. package/dist/components/map-menu/classes.d.ts +13 -0
  210. package/dist/components/map-menu/google-maps.d.ts +80 -0
  211. package/dist/components/map-menu/google-viewport.d.ts +7 -0
  212. package/dist/components/map-menu/html.d.ts +274 -0
  213. package/dist/components/map-menu/html.js +934 -0
  214. package/dist/components/map-menu/index.d.ts +246 -0
  215. package/dist/components/map-menu/map.d.ts +47 -0
  216. package/dist/components/map-menu/react.d.ts +40 -0
  217. package/dist/components/{ui/map-menu.js → map-menu/react.js} +321 -83
  218. package/dist/components/map-menu/schema.d.ts +132 -0
  219. package/dist/components/markdown/classes.d.ts +1 -0
  220. package/dist/components/markdown/html.d.ts +23 -0
  221. package/dist/components/markdown/html.js +510 -0
  222. package/dist/components/markdown/index.d.ts +6 -0
  223. package/dist/components/markdown/react.d.ts +3 -0
  224. package/dist/components/markdown/react.js +392 -0
  225. package/dist/components/markdown/schema.d.ts +20 -0
  226. package/dist/components/notification-menu/classes.d.ts +11 -0
  227. package/dist/components/notification-menu/html.d.ts +67 -0
  228. package/dist/components/notification-menu/html.js +425 -0
  229. package/dist/components/notification-menu/index.d.ts +132 -0
  230. package/dist/components/notification-menu/react.d.ts +57 -0
  231. package/dist/components/notification-menu/react.js +829 -0
  232. package/dist/components/notification-menu/schema.d.ts +59 -0
  233. package/dist/components/pagination/classes.d.ts +19 -0
  234. package/dist/components/pagination/html.d.ts +49 -0
  235. package/dist/components/pagination/html.js +387 -0
  236. package/dist/components/pagination/index.d.ts +109 -0
  237. package/dist/components/pagination/react.d.ts +9 -0
  238. package/dist/components/{ui/pagination.js → pagination/react.js} +123 -23
  239. package/dist/components/pagination/schema.d.ts +36 -0
  240. package/dist/components/phone-number-input/classes.d.ts +17 -0
  241. package/dist/components/phone-number-input/html.d.ts +52 -0
  242. package/dist/components/phone-number-input/html.js +655 -0
  243. package/dist/components/phone-number-input/index.d.ts +59 -0
  244. package/dist/components/phone-number-input/react.d.ts +11 -0
  245. package/dist/components/{ui/phone-number-input.js → phone-number-input/react.js} +368 -138
  246. package/dist/components/phone-number-input/schema.d.ts +31 -0
  247. package/dist/components/presence-transition/html.d.ts +13 -0
  248. package/dist/components/presence-transition/html.js +128 -0
  249. package/dist/components/presence-transition/index.d.ts +57 -0
  250. package/dist/components/{ui/presence-transition.d.ts → presence-transition/react.d.ts} +3 -5
  251. package/dist/components/presence-transition/react.js +139 -0
  252. package/dist/components/presence-transition/schema.d.ts +7 -0
  253. package/dist/components/registry-previews/component-example.d.ts +31 -0
  254. package/dist/components/registry-previews/component-example.js +525 -0
  255. package/dist/components/registry-previews/html-preview.d.ts +17 -0
  256. package/dist/components/registry-previews/html-preview.js +83 -0
  257. package/dist/components/rich-text-editor/classes.d.ts +15 -0
  258. package/dist/components/rich-text-editor/engine.d.ts +9 -0
  259. package/dist/components/rich-text-editor/html.d.ts +246 -0
  260. package/dist/components/rich-text-editor/html.js +830 -0
  261. package/dist/components/rich-text-editor/index.d.ts +453 -0
  262. package/dist/components/rich-text-editor/labels.d.ts +42 -0
  263. package/dist/components/rich-text-editor/react.d.ts +19 -0
  264. package/dist/components/{ui/rich-text-editor.js → rich-text-editor/react.js} +365 -96
  265. package/dist/components/rich-text-editor/schema.d.ts +116 -0
  266. package/dist/components/search-menu/classes.d.ts +9 -0
  267. package/dist/components/search-menu/html.d.ts +127 -0
  268. package/dist/components/search-menu/html.js +432 -0
  269. package/dist/components/search-menu/index.d.ts +85 -0
  270. package/dist/components/search-menu/react.d.ts +18 -0
  271. package/dist/components/{ui/search-menu.js → search-menu/react.js} +128 -23
  272. package/dist/components/search-menu/schema.d.ts +78 -0
  273. package/dist/components/select-with-custom-input/classes.d.ts +17 -0
  274. package/dist/components/select-with-custom-input/html.d.ts +60 -0
  275. package/dist/components/select-with-custom-input/html.js +238 -0
  276. package/dist/components/select-with-custom-input/index.d.ts +114 -0
  277. package/dist/components/select-with-custom-input/react.d.ts +7 -0
  278. package/dist/components/{ui/select-with-custom-input.js → select-with-custom-input/react.js} +127 -22
  279. package/dist/components/select-with-custom-input/schema.d.ts +54 -0
  280. package/dist/components/sidebar-layout/classes.d.ts +21 -0
  281. package/dist/components/sidebar-layout/html.d.ts +97 -0
  282. package/dist/components/sidebar-layout/html.js +361 -0
  283. package/dist/components/sidebar-layout/index.d.ts +57 -0
  284. package/dist/components/sidebar-layout/react.d.ts +30 -0
  285. package/dist/components/{ui/sidebar-layout.js → sidebar-layout/react.js} +199 -39
  286. package/dist/components/sidebar-layout/schema.d.ts +54 -0
  287. package/dist/components/stats-card/classes.d.ts +11 -0
  288. package/dist/components/stats-card/html.d.ts +15 -0
  289. package/dist/components/stats-card/html.js +55 -0
  290. package/dist/components/stats-card/react.d.ts +7 -0
  291. package/dist/components/{ui/stats-card.js → stats-card/react.js} +19 -15
  292. package/dist/components/stats-card/schema.d.ts +14 -0
  293. package/dist/components/stepper/classes.d.ts +39 -0
  294. package/dist/components/stepper/html.d.ts +107 -0
  295. package/dist/components/stepper/html.js +397 -0
  296. package/dist/components/stepper/index.d.ts +83 -0
  297. package/dist/components/stepper/react.d.ts +17 -0
  298. package/dist/components/{ui/stepper.js → stepper/react.js} +120 -21
  299. package/dist/components/stepper/schema.d.ts +52 -0
  300. package/dist/components/support/classes.d.ts +55 -0
  301. package/dist/components/support/form.d.ts +19 -0
  302. package/dist/components/support/html.d.ts +266 -0
  303. package/dist/components/support/html.js +604 -0
  304. package/dist/components/support/index.d.ts +226 -0
  305. package/dist/components/support/multipart.d.ts +21 -0
  306. package/dist/components/support/react.d.ts +54 -0
  307. package/dist/components/support/react.js +1098 -0
  308. package/dist/components/support/schema.d.ts +69 -0
  309. package/dist/components/support.d.ts +1 -66
  310. package/dist/components/theme-switcher/html.d.ts +28 -0
  311. package/dist/components/theme-switcher/html.js +288 -0
  312. package/dist/components/theme-switcher/index.d.ts +59 -0
  313. package/dist/components/{ui/theme-switcher.d.ts → theme-switcher/react.d.ts} +4 -12
  314. package/dist/components/{ui/theme-switcher.js → theme-switcher/react.js} +69 -35
  315. package/dist/components/theme-switcher/schema.d.ts +33 -0
  316. package/dist/components/time-input/classes.d.ts +23 -0
  317. package/dist/components/time-input/html.d.ts +75 -0
  318. package/dist/components/time-input/html.js +571 -0
  319. package/dist/components/time-input/index.d.ts +164 -0
  320. package/dist/components/time-input/react.d.ts +7 -0
  321. package/dist/components/{ui/time-picker.js → time-input/react.js} +286 -114
  322. package/dist/components/time-input/schema.d.ts +96 -0
  323. package/dist/components/timezone-input/classes.d.ts +13 -0
  324. package/dist/components/timezone-input/html.d.ts +58 -0
  325. package/dist/components/timezone-input/html.js +804 -0
  326. package/dist/components/timezone-input/index.d.ts +170 -0
  327. package/dist/components/timezone-input/react.d.ts +9 -0
  328. package/dist/components/{ui/timezone-select.js → timezone-input/react.js} +337 -104
  329. package/dist/components/timezone-input/schema.d.ts +43 -0
  330. package/dist/components/toast/classes.d.ts +7 -0
  331. package/dist/components/toast/html.d.ts +34 -0
  332. package/dist/components/toast/html.js +280 -0
  333. package/dist/components/toast/index.d.ts +10 -0
  334. package/dist/components/toast/react.d.ts +9 -0
  335. package/dist/components/{ui/toast.js → toast/react.js} +35 -15
  336. package/dist/components/toast/schema.d.ts +24 -0
  337. package/dist/{services/events/client/tracking-notice.d.ts → components/tracking-notice/react.d.ts} +7 -1
  338. package/dist/{services/events/client/tracking-notice.js → components/tracking-notice/react.js} +13 -7
  339. package/dist/components/ui/animated-list.d.ts +1 -21
  340. package/dist/components/ui/app-brand.d.ts +1 -33
  341. package/dist/components/ui/async-action-button.d.ts +1 -17
  342. package/dist/components/ui/code-block.d.ts +1 -14
  343. package/dist/components/ui/copy-button.d.ts +1 -21
  344. package/dist/components/ui/data-table.d.ts +1 -584
  345. package/dist/components/ui/krakstack-provider.d.ts +1 -9
  346. package/dist/components/ui/loading.d.ts +1 -13
  347. package/dist/components/ui/pagination.d.ts +1 -47
  348. package/dist/components/ui/rich-text-editor.d.ts +1 -72
  349. package/dist/components/ui/search-menu.d.ts +1 -36
  350. package/dist/components/ui/sidebar-layout.d.ts +1 -40
  351. package/dist/components/ui/virtualized-combobox.d.ts +1 -59
  352. package/dist/components/unsaved-changes-guard/html.d.ts +34 -0
  353. package/dist/components/unsaved-changes-guard/html.js +172 -0
  354. package/dist/components/unsaved-changes-guard/index.d.ts +56 -0
  355. package/dist/components/unsaved-changes-guard/react.d.ts +4 -0
  356. package/dist/components/{ui/unsaved-changes-guard.js → unsaved-changes-guard/react.js} +74 -11
  357. package/dist/components/unsaved-changes-guard/schema.d.ts +37 -0
  358. package/dist/components/upload-attachment/classes.d.ts +11 -0
  359. package/dist/components/upload-attachment/html.d.ts +84 -0
  360. package/dist/components/upload-attachment/html.js +312 -0
  361. package/dist/components/upload-attachment/index.d.ts +72 -0
  362. package/dist/components/upload-attachment/react.d.ts +9 -0
  363. package/dist/components/{ui/upload-attachment.js → upload-attachment/react.js} +114 -17
  364. package/dist/components/upload-attachment/schema.d.ts +53 -0
  365. package/dist/components/virtualized-combobox/classes.d.ts +7 -0
  366. package/dist/components/virtualized-combobox/html.d.ts +97 -0
  367. package/dist/components/virtualized-combobox/html.js +310 -0
  368. package/dist/components/virtualized-combobox/index.d.ts +182 -0
  369. package/dist/components/virtualized-combobox/react.d.ts +31 -0
  370. package/dist/components/{ui/virtualized-combobox.js → virtualized-combobox/react.js} +160 -40
  371. package/dist/components/virtualized-combobox/schema.d.ts +92 -0
  372. package/dist/components/webhook-delivery-table/html.d.ts +216 -0
  373. package/dist/components/webhook-delivery-table/html.js +3008 -0
  374. package/dist/components/webhook-delivery-table/index.d.ts +405 -0
  375. package/dist/components/webhook-delivery-table/react.d.ts +13 -0
  376. package/dist/{services/webhooks/client/delivery-table.js → components/webhook-delivery-table/react.js} +2278 -917
  377. package/dist/components/webhook-delivery-table/schema.d.ts +134 -0
  378. package/dist/lib/docs.d.ts +17 -1
  379. package/dist/lib/docs.integrations.server.js +341 -75
  380. package/dist/lib/docs.js +715 -299
  381. package/dist/lib/docs.server.js +325 -59
  382. package/dist/lib/documentation-toolkit.d.ts +4 -4
  383. package/dist/lib/documentation-toolkit.js +337 -71
  384. package/dist/lib/effect-ui-adapter/model-runtime.d.ts +17 -0
  385. package/dist/lib/effect-ui-adapter/use-model.d.ts +9 -0
  386. package/dist/lib/effect-ui-adapter/use-model.js +158 -0
  387. package/dist/lib/effectcn-form.d.ts +3 -0
  388. package/dist/lib/effectcn-form.js +54 -0
  389. package/dist/lib/email-composer/index.d.ts +12 -0
  390. package/dist/lib/email-composer/schema.d.ts +14 -0
  391. package/dist/lib/httpapi-toolkit.d.ts +1 -1
  392. package/dist/lib/lucide-effect.d.ts +39 -0
  393. package/dist/lib/markdown/content.d.ts +1 -12
  394. package/dist/lib/rich-text/model.d.ts +5 -0
  395. package/dist/lib/webfetch-toolkit.d.ts +1 -1
  396. package/dist/services/agent/client/index.js +530 -168
  397. package/dist/services/agent/client/widget.d.ts +1 -55
  398. package/dist/services/notification/client/index.js +138 -27
  399. package/dist/services/notification/client/notification-menu.d.ts +1 -85
  400. package/dist/services/notification/public.js +138 -27
  401. package/dist/services/opentelemetry/browser.js +15 -9
  402. package/dist/services/webhooks/index.d.ts +4 -3
  403. package/package.json +185 -142
  404. package/dist/components/support-dialog.js +0 -881
  405. package/dist/components/support.js +0 -881
  406. package/dist/components/ui/animated-number.js +0 -75
  407. package/dist/components/ui/app-brand.js +0 -126
  408. package/dist/components/ui/app-switcher.d.ts +0 -26
  409. package/dist/components/ui/async-action-button.js +0 -149
  410. package/dist/components/ui/auto-height.js +0 -86
  411. package/dist/components/ui/bulk-list-input.d.ts +0 -25
  412. package/dist/components/ui/choice-cards.d.ts +0 -33
  413. package/dist/components/ui/color-picker.d.ts +0 -31
  414. package/dist/components/ui/copy-button.js +0 -138
  415. package/dist/components/ui/copy-value.d.ts +0 -24
  416. package/dist/components/ui/cron-expression-editor.d.ts +0 -16
  417. package/dist/components/ui/cron-expression-editor.schema.d.ts +0 -7
  418. package/dist/components/ui/date-picker.d.ts +0 -33
  419. package/dist/components/ui/date-picker.schema.d.ts +0 -9
  420. package/dist/components/ui/editable-text.d.ts +0 -19
  421. package/dist/components/ui/editable-text.js +0 -341
  422. package/dist/components/ui/editing-locale-switcher.d.ts +0 -11
  423. package/dist/components/ui/error-component.d.ts +0 -34
  424. package/dist/components/ui/file-picker.d.ts +0 -37
  425. package/dist/components/ui/icon-input.d.ts +0 -58
  426. package/dist/components/ui/image-crop-editor.d.ts +0 -41
  427. package/dist/components/ui/image-crop-editor.js +0 -417
  428. package/dist/components/ui/loading.js +0 -39
  429. package/dist/components/ui/locale-switcher.d.ts +0 -11
  430. package/dist/components/ui/map-menu-map.d.ts +0 -115
  431. package/dist/components/ui/map-menu.d.ts +0 -87
  432. package/dist/components/ui/phone-number-input.d.ts +0 -22
  433. package/dist/components/ui/phone-number-input.schema.d.ts +0 -7
  434. package/dist/components/ui/presence-transition.js +0 -94
  435. package/dist/components/ui/select-with-custom-input.d.ts +0 -36
  436. package/dist/components/ui/stats-card.d.ts +0 -12
  437. package/dist/components/ui/stepper.d.ts +0 -37
  438. package/dist/components/ui/time-picker.d.ts +0 -50
  439. package/dist/components/ui/time-picker.schema.d.ts +0 -28
  440. package/dist/components/ui/timezone-select.d.ts +0 -57
  441. package/dist/components/ui/timezone-select.schema.d.ts +0 -9
  442. package/dist/components/ui/toast.d.ts +0 -18
  443. package/dist/components/ui/unsaved-changes-guard.d.ts +0 -16
  444. package/dist/components/ui/upload-attachment.d.ts +0 -39
  445. package/dist/services/notification/persistence/drizzle.d.ts +0 -868
  446. package/dist/services/notification/persistence/drizzle.js +0 -214
  447. package/dist/services/notification/persistence/index.d.ts +0 -2
  448. package/dist/services/notification/persistence/index.js +0 -227
  449. package/dist/services/notification/persistence/schema.d.ts +0 -143
  450. package/dist/services/notification/persistence/schema.js +0 -118
  451. package/dist/services/webhooks/client/delivery-table.d.ts +0 -62
@@ -0,0 +1,1098 @@
1
+ // ../../src/components/support/react.tsx
2
+ import { useModel } from "@krak-stack/registry/effect-ui-adapter/react";
3
+ import { Component as Component2 } from "effect/ui";
4
+ import { Option, Redacted as Redacted2, Schema as Schema5 } from "effect";
5
+ import { Check, Image, Paperclip, X } from "lucide-react";
6
+ import {
7
+ useId,
8
+ useLayoutEffect,
9
+ useRef,
10
+ useState
11
+ } from "react";
12
+
13
+ // ../../src/components/ui/button.tsx
14
+ import { Button as ButtonPrimitive } from "@base-ui/react/button";
15
+ import { cva } from "class-variance-authority";
16
+
17
+ // ../../src/lib/utils.ts
18
+ import { cn } from "cn";
19
+
20
+ // ../../src/components/ui/button.tsx
21
+ import { jsx } from "react/jsx-runtime";
22
+ var buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
23
+ variants: {
24
+ variant: {
25
+ default: "bg-primary text-primary-foreground hover:bg-primary/80",
26
+ outline: "border-border bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
27
+ secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
28
+ ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
29
+ destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
30
+ link: "text-primary underline-offset-4 hover:underline"
31
+ },
32
+ size: {
33
+ default: "h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
34
+ xs: "h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
35
+ sm: "h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",
36
+ lg: "h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
37
+ icon: "size-9",
38
+ "icon-xs": "size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3",
39
+ "icon-sm": "size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md",
40
+ "icon-lg": "size-10"
41
+ }
42
+ },
43
+ defaultVariants: {
44
+ variant: "default",
45
+ size: "default"
46
+ }
47
+ });
48
+ function Button({
49
+ className,
50
+ variant = "default",
51
+ size = "default",
52
+ ...props
53
+ }) {
54
+ return /* @__PURE__ */ jsx(ButtonPrimitive, {
55
+ "data-slot": "button",
56
+ className: cn(buttonVariants({ variant, size, className })),
57
+ ...props
58
+ });
59
+ }
60
+
61
+ // ../../src/components/ui/dialog.tsx
62
+ import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
63
+ import { cn as cn2 } from "cn";
64
+ import { XIcon } from "lucide-react";
65
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
66
+ function Dialog({ ...props }) {
67
+ return /* @__PURE__ */ jsx2(DialogPrimitive.Root, {
68
+ "data-slot": "dialog",
69
+ ...props
70
+ });
71
+ }
72
+ function DialogTrigger({ ...props }) {
73
+ return /* @__PURE__ */ jsx2(DialogPrimitive.Trigger, {
74
+ "data-slot": "dialog-trigger",
75
+ ...props
76
+ });
77
+ }
78
+ function DialogPortal({ ...props }) {
79
+ return /* @__PURE__ */ jsx2(DialogPrimitive.Portal, {
80
+ "data-slot": "dialog-portal",
81
+ ...props
82
+ });
83
+ }
84
+ function DialogClose({ ...props }) {
85
+ return /* @__PURE__ */ jsx2(DialogPrimitive.Close, {
86
+ "data-slot": "dialog-close",
87
+ ...props
88
+ });
89
+ }
90
+ function DialogOverlay({
91
+ className,
92
+ ...props
93
+ }) {
94
+ return /* @__PURE__ */ jsx2(DialogPrimitive.Backdrop, {
95
+ "data-slot": "dialog-overlay",
96
+ className: cn2("data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs", className),
97
+ ...props
98
+ });
99
+ }
100
+ function DialogContent({
101
+ className,
102
+ children,
103
+ showCloseButton = true,
104
+ ...props
105
+ }) {
106
+ return /* @__PURE__ */ jsxs(DialogPortal, {
107
+ children: [
108
+ /* @__PURE__ */ jsx2(DialogOverlay, {}),
109
+ /* @__PURE__ */ jsxs(DialogPrimitive.Popup, {
110
+ "data-slot": "dialog-content",
111
+ className: cn2("bg-popover text-popover-foreground ring-foreground/10 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl p-6 text-sm ring-1 duration-100 outline-none sm:max-w-md", className),
112
+ ...props,
113
+ children: [
114
+ children,
115
+ showCloseButton && /* @__PURE__ */ jsxs(DialogPrimitive.Close, {
116
+ "data-slot": "dialog-close",
117
+ render: /* @__PURE__ */ jsx2(Button, {
118
+ variant: "ghost",
119
+ className: "absolute top-4 right-4",
120
+ size: "icon-sm"
121
+ }),
122
+ children: [
123
+ /* @__PURE__ */ jsx2(XIcon, {}),
124
+ /* @__PURE__ */ jsx2("span", {
125
+ className: "sr-only",
126
+ children: "Close"
127
+ })
128
+ ]
129
+ })
130
+ ]
131
+ })
132
+ ]
133
+ });
134
+ }
135
+ function DialogHeader({ className, ...props }) {
136
+ return /* @__PURE__ */ jsx2("div", {
137
+ "data-slot": "dialog-header",
138
+ className: cn2("flex flex-col gap-2", className),
139
+ ...props
140
+ });
141
+ }
142
+ function DialogTitle({ className, ...props }) {
143
+ return /* @__PURE__ */ jsx2(DialogPrimitive.Title, {
144
+ "data-slot": "dialog-title",
145
+ className: cn2("leading-none font-medium", className),
146
+ ...props
147
+ });
148
+ }
149
+ function DialogDescription({
150
+ className,
151
+ ...props
152
+ }) {
153
+ return /* @__PURE__ */ jsx2(DialogPrimitive.Description, {
154
+ "data-slot": "dialog-description",
155
+ className: cn2("text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3", className),
156
+ ...props
157
+ });
158
+ }
159
+
160
+ // ../../src/components/ui/field.tsx
161
+ import { useMemo } from "react";
162
+ import { cva as cva2 } from "class-variance-authority";
163
+
164
+ // ../../src/components/ui/label.tsx
165
+ import { jsx as jsx3 } from "react/jsx-runtime";
166
+ "use client";
167
+ function Label({ className, ...props }) {
168
+ return /* @__PURE__ */ jsx3("label", {
169
+ "data-slot": "label",
170
+ className: cn("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", className),
171
+ ...props
172
+ });
173
+ }
174
+
175
+ // ../../src/components/ui/separator.tsx
176
+ import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";
177
+
178
+ // ../../src/components/ui/field.tsx
179
+ import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
180
+ var fieldVariants = cva2("group/field flex w-full gap-3 data-[invalid=true]:text-destructive", {
181
+ variants: {
182
+ orientation: {
183
+ vertical: "flex-col *:w-full [&>.sr-only]:w-auto",
184
+ horizontal: "flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
185
+ responsive: "flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
186
+ }
187
+ },
188
+ defaultVariants: {
189
+ orientation: "vertical"
190
+ }
191
+ });
192
+ function Field({
193
+ className,
194
+ orientation = "vertical",
195
+ ...props
196
+ }) {
197
+ return /* @__PURE__ */ jsx4("div", {
198
+ role: "group",
199
+ "data-slot": "field",
200
+ "data-orientation": orientation,
201
+ className: cn(fieldVariants({ orientation }), className),
202
+ ...props
203
+ });
204
+ }
205
+ function FieldLabel({
206
+ className,
207
+ ...props
208
+ }) {
209
+ return /* @__PURE__ */ jsx4(Label, {
210
+ "data-slot": "field-label",
211
+ className: cn("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border *:data-[slot=field]:p-3 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col", className),
212
+ ...props
213
+ });
214
+ }
215
+ function FieldError({
216
+ className,
217
+ children,
218
+ errors,
219
+ ...props
220
+ }) {
221
+ const content = useMemo(() => {
222
+ if (children) {
223
+ return children;
224
+ }
225
+ if (!errors?.length) {
226
+ return null;
227
+ }
228
+ const uniqueErrors = [
229
+ ...new Map(errors.map((error) => [error?.message, error])).values()
230
+ ];
231
+ if (uniqueErrors?.length == 1) {
232
+ return uniqueErrors[0]?.message;
233
+ }
234
+ return /* @__PURE__ */ jsx4("ul", {
235
+ className: "ml-4 flex list-disc flex-col gap-1",
236
+ children: uniqueErrors.map((error, index) => error?.message && /* @__PURE__ */ jsx4("li", {
237
+ children: error.message
238
+ }, index))
239
+ });
240
+ }, [children, errors]);
241
+ if (!content) {
242
+ return null;
243
+ }
244
+ return /* @__PURE__ */ jsx4("div", {
245
+ role: "alert",
246
+ "data-slot": "field-error",
247
+ className: cn("text-sm font-normal text-destructive", className),
248
+ ...props,
249
+ children: content
250
+ });
251
+ }
252
+
253
+ // ../../src/components/ui/input.tsx
254
+ import { Input as InputPrimitive } from "@base-ui/react/input";
255
+ import { jsx as jsx5 } from "react/jsx-runtime";
256
+ function Input({ className, type, ...props }) {
257
+ return /* @__PURE__ */ jsx5(InputPrimitive, {
258
+ type,
259
+ "data-slot": "input",
260
+ className: cn("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className),
261
+ ...props
262
+ });
263
+ }
264
+
265
+ // ../../src/components/ui/textarea.tsx
266
+ import { jsx as jsx6 } from "react/jsx-runtime";
267
+ function Textarea({ className, ...props }) {
268
+ return /* @__PURE__ */ jsx6("textarea", {
269
+ "data-slot": "textarea",
270
+ className: cn("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-2.5 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className),
271
+ ...props
272
+ });
273
+ }
274
+
275
+ // ../../src/components/support/react.tsx
276
+ import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider/react";
277
+
278
+ // ../../src/components/support/index.ts
279
+ import { Command, Component, UiSchema, View } from "effect/ui";
280
+ import { Effect, Redacted, Schema as Schema3 } from "effect";
281
+
282
+ // ../../src/components/support/form.ts
283
+ import { Result, Schema as Schema2, SchemaIssue } from "effect";
284
+
285
+ // ../../src/components/support/schema.ts
286
+ import { Schema, Struct } from "effect";
287
+
288
+ // ../../src/components/support/classes.ts
289
+ var defaultSupportClasses = {
290
+ page: "mx-auto grid w-full max-w-xl gap-8 self-start",
291
+ pageHeader: "grid gap-3",
292
+ pageTitle: "m-0 text-[2rem] font-semibold tracking-tight",
293
+ pageDescription: "m-0 text-muted-foreground",
294
+ form: "grid min-w-0 gap-4",
295
+ fieldset: "m-0 grid min-w-0 gap-4 border-0 p-0",
296
+ optional: "font-normal text-muted-foreground",
297
+ message: "grid gap-2",
298
+ actions: "flex flex-wrap justify-end gap-2",
299
+ attachments: "m-0 flex min-w-0 list-none flex-wrap gap-2 p-0",
300
+ attachment: "inline-flex max-w-full min-w-0 items-center gap-1.5 rounded-md border border-border bg-card py-1 ps-1.5 pe-1 text-xs leading-none text-card-foreground",
301
+ attachmentMedia: "grid size-7 shrink-0 place-items-center rounded-sm bg-muted text-foreground",
302
+ filename: "min-w-0 truncate font-medium",
303
+ attach: "relative me-auto w-fit",
304
+ file: "absolute inset-0 size-full cursor-pointer opacity-0",
305
+ alert: "m-0 text-sm text-destructive",
306
+ details: "flex items-center gap-2 text-sm font-medium",
307
+ link: "[overflow-wrap:anywhere] underline underline-offset-4",
308
+ closeAction: "self-start text-start",
309
+ dialogTitle: "flex items-center gap-2",
310
+ statusHeader: "grid gap-1.5",
311
+ statusTitle: "m-0 text-base font-semibold",
312
+ description: "m-0 text-sm leading-normal text-muted-foreground",
313
+ confirmation: "flex flex-col items-center gap-3 rounded-md border border-border px-6 py-8 text-center",
314
+ checkBadge: "mb-1 grid size-12 place-items-center rounded-full bg-primary/10 text-primary"
315
+ };
316
+ var resolveSupportClasses = (classes) => ({
317
+ ...defaultSupportClasses,
318
+ ...classes
319
+ });
320
+
321
+ // ../../src/components/support/schema.ts
322
+ var supportMessageLimit = 5000;
323
+ var supportReplyEmailLimit = 254;
324
+ var supportErrorDetailsLimit = 8000;
325
+ var supportScreenshotLimit = 3;
326
+ var supportScreenshotMaxBytes = 5 * 1024 * 1024;
327
+ var screenshotFormats = new Map([
328
+ [
329
+ "image/png",
330
+ { extension: "png", signatures: [[0, [137, 80, 78, 71, 13, 10, 26, 10]]] }
331
+ ],
332
+ ["image/jpeg", { extension: "jpg", signatures: [[0, [255, 216, 255]]] }],
333
+ [
334
+ "image/webp",
335
+ {
336
+ extension: "webp",
337
+ signatures: [
338
+ [0, [82, 73, 70, 70]],
339
+ [8, [87, 69, 66, 80]]
340
+ ]
341
+ }
342
+ ]
343
+ ]);
344
+ var screenshotAccept = Array.from(screenshotFormats.keys()).join(",");
345
+ var SupportMessage = Schema.Trim.check(Schema.isNonEmpty(), Schema.isMaxLength(supportMessageLimit)).annotate({ identifier: "SupportMessage" });
346
+ var SupportReplyEmail = Schema.Trim.check(Schema.isMaxLength(supportReplyEmailLimit), Schema.isPattern(/^[^\s@,<>]+@[^\s@,<>]+$/)).annotate({ identifier: "SupportReplyEmail" });
347
+ var SupportScreenshots = Schema.Array(Schema.File.check(Schema.makeFilter((file) => screenshotFormats.has(file.type) && file.size > 0 && file.size <= supportScreenshotMaxBytes))).check(Schema.isMaxLength(supportScreenshotLimit)).annotate({ identifier: "SupportScreenshots" });
348
+ var SupportErrorDetails = Schema.String.check(Schema.isNonEmpty(), Schema.isMaxLength(supportErrorDetailsLimit)).annotate({ identifier: "SupportErrorDetails" });
349
+ var SupportRequestSchema = Schema.Struct({
350
+ message: SupportMessage,
351
+ replyEmail: Schema.optionalKey(SupportReplyEmail),
352
+ errorDetails: Schema.optionalKey(SupportErrorDetails),
353
+ attachments: SupportScreenshots
354
+ }).annotate({ identifier: "SupportRequest" });
355
+ var SupportFormState = Schema.Struct({
356
+ attachments: Schema.Array(Schema.File),
357
+ invalidAttachments: Schema.Boolean,
358
+ invalidFields: Schema.optional(Schema.Array(Schema.Literals(["message", "replyEmail"]))),
359
+ status: Schema.Literals(["idle", "pending", "invalid", "failed", "success"])
360
+ }).annotate({ identifier: "SupportFormState" });
361
+ var SupportFormMessages = Schema.Struct({
362
+ title: Schema.String,
363
+ description: Schema.optional(Schema.String),
364
+ placeholder: Schema.optional(Schema.String),
365
+ replyEmail: Schema.String,
366
+ replyEmailPlaceholder: Schema.optional(Schema.String),
367
+ attach: Schema.String,
368
+ invalidAttachments: Schema.String,
369
+ removeAttachment: Schema.String,
370
+ submit: Schema.String,
371
+ pending: Schema.String,
372
+ success: Schema.String,
373
+ successDescription: Schema.optional(Schema.String),
374
+ close: Schema.String,
375
+ invalid: Schema.String,
376
+ invalidMessage: Schema.optional(Schema.String),
377
+ invalidReplyEmail: Schema.optional(Schema.String),
378
+ failed: Schema.String,
379
+ includeErrorDetails: Schema.optional(Schema.String),
380
+ optional: Schema.optional(Schema.String),
381
+ directEmail: Schema.optional(Schema.String)
382
+ }).annotate({ identifier: "SupportFormMessages" });
383
+ var SupportClassOverrides = Schema.Record(Schema.Literals(Struct.keys(defaultSupportClasses)), Schema.optionalKey(Schema.String)).annotate({ identifier: "SupportClassOverrides" });
384
+ var SupportProps = Schema.Struct({
385
+ messages: Schema.optional(SupportFormMessages),
386
+ locale: Schema.optional(Schema.String),
387
+ className: Schema.optional(Schema.String),
388
+ classes: Schema.optional(SupportClassOverrides),
389
+ inline: Schema.optional(Schema.Boolean),
390
+ supportEmail: Schema.optional(Schema.String),
391
+ askForReplyEmail: Schema.optional(Schema.Boolean),
392
+ defaultReplyEmail: Schema.optional(Schema.Redacted(Schema.String)),
393
+ errorDetails: Schema.optional(Schema.Redacted(Schema.String))
394
+ }).annotate({ identifier: "SupportDialogProps" });
395
+ var SupportFormFields = Schema.Struct({
396
+ message: Schema.String,
397
+ replyEmail: Schema.optional(Schema.String),
398
+ includeErrorDetails: Schema.Boolean
399
+ }).annotate({ identifier: "SupportFormFields" });
400
+
401
+ // ../../src/components/support/form.ts
402
+ var decodeScreenshots = Schema2.decodeResult(SupportScreenshots);
403
+ var decodeRequest = Schema2.decodeUnknownResult(SupportRequestSchema, {
404
+ errors: "all"
405
+ });
406
+ var formatIssue = SchemaIssue.makeFormatterStandardSchemaV1();
407
+ var emptySupportForm = {
408
+ attachments: [],
409
+ invalidAttachments: false,
410
+ status: "idle"
411
+ };
412
+ var addSupportAttachments = (state, files) => {
413
+ if (state.status === "pending" || files.length === 0)
414
+ return state;
415
+ const result = decodeScreenshots([...state.attachments, ...files]);
416
+ if (Result.isFailure(result))
417
+ return { ...state, invalidAttachments: true };
418
+ return { ...state, attachments: result.success, invalidAttachments: false };
419
+ };
420
+ var removeSupportAttachment = (state, index) => {
421
+ if (state.status === "pending")
422
+ return state;
423
+ return {
424
+ ...state,
425
+ attachments: state.attachments.filter((_, position) => position !== index),
426
+ invalidAttachments: false
427
+ };
428
+ };
429
+ var supportDiagnostics = (details) => details?.trim().slice(0, supportErrorDetailsLimit);
430
+ var beginSupportSubmission = (state, fields) => {
431
+ if (state.status === "pending" || state.status === "success")
432
+ return { state };
433
+ const includeReplyEmail = fields.askForReplyEmail === true || fields.askForReplyEmail !== false && Boolean(fields.replyEmail);
434
+ const details = fields.includeErrorDetails ? supportDiagnostics(fields.errorDetails) : undefined;
435
+ const draft = {
436
+ message: fields.message,
437
+ attachments: state.attachments
438
+ };
439
+ if (includeReplyEmail)
440
+ draft.replyEmail = fields.replyEmail;
441
+ if (details)
442
+ draft.errorDetails = details;
443
+ const result = decodeRequest(draft);
444
+ if (Result.isFailure(result)) {
445
+ const issues = formatIssue(result.failure.issue).issues;
446
+ const invalidFields = ["message", "replyEmail"].filter((field) => issues.some((issue) => issue.path?.[0] === field));
447
+ return { state: { ...state, status: "invalid", invalidFields } };
448
+ }
449
+ return {
450
+ state: { ...state, status: "pending", invalidFields: undefined },
451
+ request: result.success
452
+ };
453
+ };
454
+ var finishSupportSubmission = (state, accepted) => {
455
+ if (state.status !== "pending")
456
+ return state;
457
+ return accepted ? { ...emptySupportForm, status: "success" } : { ...state, status: "failed" };
458
+ };
459
+
460
+ // ../../src/components/support/index.ts
461
+ var defaultMessages = {
462
+ en: {
463
+ title: "Tell us how we can help",
464
+ description: "Share any details that will help us answer your question or understand what went wrong.",
465
+ placeholder: "I need help with…",
466
+ replyEmail: "Reply email",
467
+ replyEmailPlaceholder: "you@example.com",
468
+ attach: "Attach screenshots",
469
+ invalidAttachments: "Screenshots weren’t added. Choose up to 3 PNG, JPEG or WebP images, 5 MB each.",
470
+ removeAttachment: "Remove screenshot",
471
+ submit: "Send message",
472
+ pending: "Sending…",
473
+ success: "Message sent",
474
+ successDescription: "We will get back to you as soon as possible.",
475
+ close: "Close",
476
+ invalid: "Check your message and reply email if requested.",
477
+ invalidMessage: "Enter a message of 5,000 characters or fewer.",
478
+ invalidReplyEmail: "Enter a valid reply email address.",
479
+ failed: "Could not send your message. Try again.",
480
+ includeErrorDetails: "Include error details",
481
+ optional: "optional",
482
+ directEmail: "Or email us directly at"
483
+ },
484
+ fr: {
485
+ title: "Dites-nous comment nous pouvons vous aider",
486
+ description: "Donnez-nous les détails qui nous aideront à répondre à votre question ou à comprendre le problème.",
487
+ placeholder: "J’ai besoin d’aide pour…",
488
+ replyEmail: "Adresse courriel pour la réponse",
489
+ replyEmailPlaceholder: "vous@example.com",
490
+ attach: "Joindre des captures d’écran",
491
+ invalidAttachments: "Les captures d’écran n’ont pas été ajoutées. Choisissez jusqu’à 3 images PNG, JPEG ou WebP de 5 Mo chacune.",
492
+ removeAttachment: "Retirer la capture d’écran",
493
+ submit: "Envoyer le message",
494
+ pending: "Envoi en cours…",
495
+ success: "Message envoyé",
496
+ successDescription: "Nous vous répondrons dès que possible.",
497
+ close: "Fermer",
498
+ invalid: "Vérifiez le message et, si elle est demandée, l’adresse courriel.",
499
+ invalidMessage: "Saisissez un message d’au plus 5 000 caractères.",
500
+ invalidReplyEmail: "Saisissez une adresse courriel de réponse valide.",
501
+ failed: "Impossible d’envoyer votre message. Réessayez.",
502
+ includeErrorDetails: "Inclure les détails de l’erreur",
503
+ optional: "facultatif",
504
+ directEmail: "Ou écrivez-nous directement à"
505
+ }
506
+ };
507
+ var getSupportFormMessages = (locale = "en", messages) => {
508
+ const language = locale.split("-")[0] ?? locale;
509
+ return {
510
+ ...language === "fr" ? defaultMessages.fr : defaultMessages.en,
511
+ ...messages?.[language],
512
+ ...messages?.[locale]
513
+ };
514
+ };
515
+ var SupportModel = Schema3.Struct({
516
+ open: Schema3.Boolean,
517
+ form: Schema3.Redacted(SupportFormState, { disallowJsonEncode: true })
518
+ }).annotate({ identifier: "SupportDialogModel" });
519
+ var readForm = (model) => Redacted.value(model.form);
520
+ var initialForm = Redacted.make(emptySupportForm);
521
+ var initialSupportModel = (open = false) => ({
522
+ open,
523
+ form: initialForm
524
+ });
525
+ var SupportMessage2 = UiSchema.TaggedEnum({
526
+ RequestedOpen: {},
527
+ RequestedClose: {},
528
+ AddedScreenshots: { files: Schema3.Redacted(Schema3.Array(Schema3.File)) },
529
+ RemovedScreenshot: { index: Schema3.Int },
530
+ SubmittedForm: { fields: Schema3.Redacted(SupportFormFields) },
531
+ SendFinished: { accepted: Schema3.Boolean }
532
+ }).annotate({ identifier: "SupportDialogMessage" });
533
+
534
+ class SendSupport extends Command.Service()("support/SendSupport", {
535
+ args: {
536
+ request: Schema3.Redacted(SupportRequestSchema, {
537
+ disallowJsonEncode: true
538
+ })
539
+ },
540
+ success: SupportMessage2
541
+ }) {
542
+ static layerFromSubmit = (submit) => SendSupport.toLayer(({ request }) => Effect.tryPromise(async () => submit(Redacted.value(request))).pipe(Effect.match({
543
+ onSuccess: () => SupportMessage2.SendFinished({ accepted: true }),
544
+ onFailure: () => SupportMessage2.SendFinished({ accepted: false })
545
+ })));
546
+ }
547
+ var supportOptions = {
548
+ name: "AdapterSupportDialog",
549
+ props: SupportProps,
550
+ model: SupportModel,
551
+ message: SupportMessage2,
552
+ restore: false
553
+ };
554
+ var SupportDefinition = Component.define(supportOptions);
555
+ var supportBehaviours = {
556
+ init: SupportDefinition.init(({ props }) => initialSupportModel(props.inline)),
557
+ update: SupportDefinition.update({
558
+ RequestedOpen: ($) => $.model.open ? $.model : $.evolve({ open: true }),
559
+ RequestedClose: ($) => readForm($.model).status === "pending" ? $.model : $.evolve({ open: false, form: initialForm }),
560
+ AddedScreenshots: ($, { files }) => !$.model.open ? $.model : $.evolve({
561
+ form: Redacted.make(addSupportAttachments(readForm($.model), Redacted.value(files)))
562
+ }),
563
+ RemovedScreenshot: ($, { index }) => !$.model.open ? $.model : $.evolve({
564
+ form: Redacted.make(removeSupportAttachment(readForm($.model), index))
565
+ }),
566
+ SubmittedForm: ($, { fields }) => {
567
+ if (!$.model.open)
568
+ return $.model;
569
+ const { message, replyEmail, includeErrorDetails } = Redacted.value(fields);
570
+ const { request, state } = beginSupportSubmission(readForm($.model), {
571
+ message,
572
+ replyEmail,
573
+ includeErrorDetails,
574
+ askForReplyEmail: $.props.askForReplyEmail,
575
+ errorDetails: $.props.errorDetails && Redacted.value($.props.errorDetails)
576
+ });
577
+ const next = $.evolve({ form: Redacted.make(state) });
578
+ return request ? next.run(SendSupport.make({ request: Redacted.make(request) })) : next;
579
+ },
580
+ SendFinished: ($, { accepted }) => $.evolve({
581
+ form: Redacted.make(finishSupportSubmission(readForm($.model), accepted))
582
+ })
583
+ })
584
+ };
585
+ var SupportDialogModel = SupportDefinition.make({
586
+ ...supportBehaviours,
587
+ view: () => View.text("")
588
+ });
589
+ // ../../src/components/support/multipart.ts
590
+ import { Effect as Effect2, FileSystem, Schema as Schema4 } from "effect";
591
+ import { Multipart } from "effect/http";
592
+ import { HttpApiSchema } from "effect/http-api";
593
+ var SupportMultipartPayload = Schema4.Struct({
594
+ message: SupportMessage,
595
+ replyEmail: Schema4.optionalKey(SupportReplyEmail),
596
+ errorDetails: Schema4.optionalKey(SupportErrorDetails),
597
+ attachments: Schema4.optionalKey(Multipart.FilesSchema.check(Schema4.isMaxLength(supportScreenshotLimit)))
598
+ }).annotate({ identifier: "SupportMultipartPayload" }).pipe(HttpApiSchema.asMultipart({
599
+ maxParts: supportScreenshotLimit + 3,
600
+ maxFieldSize: 32 * 1024,
601
+ maxFileSize: supportScreenshotMaxBytes,
602
+ maxTotalSize: supportScreenshotLimit * supportScreenshotMaxBytes + 1024 * 1024
603
+ }));
604
+
605
+ class InvalidSupportScreenshot extends Schema4.TaggedError()("InvalidSupportScreenshot", {}) {
606
+ }
607
+ var readSupportScreenshots = Effect2.fn("Support.readScreenshots")(function* (files) {
608
+ const fs = yield* FileSystem.FileSystem;
609
+ return yield* Effect2.forEach(files, (file, index) => Effect2.gen(function* () {
610
+ const format = screenshotFormats.get(file.contentType);
611
+ if (!format)
612
+ return yield* new InvalidSupportScreenshot;
613
+ const content = yield* fs.readFile(file.path);
614
+ if (!format.signatures.every(([offset, signature]) => signature.every((byte, index) => content[offset + index] === byte))) {
615
+ return yield* new InvalidSupportScreenshot;
616
+ }
617
+ return {
618
+ content,
619
+ contentType: file.contentType,
620
+ filename: `screenshot-${index + 1}.${format.extension}`
621
+ };
622
+ }));
623
+ });
624
+
625
+ // ../../src/components/support/react.tsx
626
+ import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
627
+ "use client";
628
+ var useSupportFormMessages = (locale, messages) => getSupportFormMessages(useKrakstackLocale(locale), messages);
629
+ var SupportConfirmation = ({
630
+ title,
631
+ description,
632
+ classes
633
+ }) => /* @__PURE__ */ jsxs3("div", {
634
+ role: "status",
635
+ className: classes.confirmation,
636
+ children: [
637
+ /* @__PURE__ */ jsx7("span", {
638
+ className: classes.checkBadge,
639
+ children: /* @__PURE__ */ jsx7(Check, {
640
+ size: 24,
641
+ "aria-hidden": "true"
642
+ })
643
+ }),
644
+ /* @__PURE__ */ jsx7("h2", {
645
+ className: classes.statusTitle,
646
+ children: title
647
+ }),
648
+ description && /* @__PURE__ */ jsx7("p", {
649
+ className: classes.description,
650
+ children: description
651
+ })
652
+ ]
653
+ });
654
+ var SupportForm = (props) => /* @__PURE__ */ jsx7(SupportWithSubmit, {
655
+ ...props,
656
+ view: "form"
657
+ });
658
+ var SupportFormView = ({
659
+ className,
660
+ classes: classOverrides,
661
+ messages: copy,
662
+ state: { attachments, invalidAttachments, invalidFields, status },
663
+ askForReplyEmail,
664
+ defaultReplyEmail,
665
+ supportEmail,
666
+ showDetails,
667
+ onSubmit,
668
+ onAddScreenshots,
669
+ onRemoveScreenshot
670
+ }) => {
671
+ const classes = resolveSupportClasses(classOverrides);
672
+ const id = useId();
673
+ const fileInput = useRef(null);
674
+ const directEmail = Schema5.decodeUnknownOption(SupportReplyEmail)(supportEmail);
675
+ const pending = status === "pending";
676
+ const messageError = invalidFields?.includes("message") ? copy.invalidMessage ?? copy.invalid : undefined;
677
+ const emailError = invalidFields?.includes("replyEmail") ? copy.invalidReplyEmail ?? copy.invalid : undefined;
678
+ return /* @__PURE__ */ jsxs3("div", {
679
+ className: cn(classes.form, className),
680
+ children: [
681
+ status === "success" ? /* @__PURE__ */ jsx7(SupportConfirmation, {
682
+ title: copy.success,
683
+ description: copy.successDescription,
684
+ classes
685
+ }) : /* @__PURE__ */ jsxs3("form", {
686
+ noValidate: true,
687
+ className: classes.form,
688
+ onSubmit: (event) => {
689
+ event.preventDefault();
690
+ onSubmit(new FormData(event.currentTarget));
691
+ },
692
+ "aria-busy": pending,
693
+ children: [
694
+ /* @__PURE__ */ jsxs3("fieldset", {
695
+ disabled: pending,
696
+ className: classes.fieldset,
697
+ children: [
698
+ askForReplyEmail !== false && /* @__PURE__ */ jsxs3(Field, {
699
+ children: [
700
+ /* @__PURE__ */ jsxs3(FieldLabel, {
701
+ className: classes.closeAction,
702
+ htmlFor: `${id}-email`,
703
+ children: [
704
+ copy.replyEmail,
705
+ askForReplyEmail !== true && copy.optional && /* @__PURE__ */ jsxs3("span", {
706
+ className: classes.optional,
707
+ children: [
708
+ " (",
709
+ copy.optional,
710
+ ")"
711
+ ]
712
+ })
713
+ ]
714
+ }),
715
+ /* @__PURE__ */ jsx7(Input, {
716
+ id: `${id}-email`,
717
+ type: "email",
718
+ name: "replyEmail",
719
+ "aria-invalid": emailError ? true : undefined,
720
+ "aria-describedby": emailError ? `${id}-email-error` : undefined,
721
+ autoComplete: "email",
722
+ placeholder: copy.replyEmailPlaceholder,
723
+ maxLength: supportReplyEmailLimit,
724
+ defaultValue: defaultReplyEmail,
725
+ required: askForReplyEmail === true
726
+ }),
727
+ /* @__PURE__ */ jsx7(FieldError, {
728
+ id: `${id}-email-error`,
729
+ children: emailError
730
+ })
731
+ ]
732
+ }),
733
+ /* @__PURE__ */ jsxs3("div", {
734
+ className: classes.message,
735
+ children: [
736
+ /* @__PURE__ */ jsxs3(Field, {
737
+ children: [
738
+ /* @__PURE__ */ jsx7(Textarea, {
739
+ "aria-label": copy.title,
740
+ "aria-invalid": messageError ? true : undefined,
741
+ "aria-describedby": messageError ? `${id}-message-error` : undefined,
742
+ name: "message",
743
+ rows: 8,
744
+ placeholder: copy.placeholder,
745
+ required: true,
746
+ maxLength: supportMessageLimit,
747
+ onPaste: (event) => {
748
+ const files = Array.from(event.clipboardData.files).filter(({ type }) => type.startsWith("image/"));
749
+ if (!files.length)
750
+ return;
751
+ event.preventDefault();
752
+ onAddScreenshots(files);
753
+ }
754
+ }),
755
+ /* @__PURE__ */ jsx7(FieldError, {
756
+ id: `${id}-message-error`,
757
+ children: messageError
758
+ })
759
+ ]
760
+ }),
761
+ /* @__PURE__ */ jsx7("input", {
762
+ ref: fileInput,
763
+ type: "file",
764
+ "aria-label": copy.attach,
765
+ accept: screenshotAccept,
766
+ multiple: true,
767
+ hidden: true,
768
+ onChange: (event) => {
769
+ onAddScreenshots(Array.from(event.currentTarget.files ?? []));
770
+ event.currentTarget.value = "";
771
+ }
772
+ }),
773
+ attachments.length > 0 && /* @__PURE__ */ jsx7("ul", {
774
+ className: classes.attachments,
775
+ children: attachments.map((file, index) => /* @__PURE__ */ jsxs3("li", {
776
+ className: classes.attachment,
777
+ children: [
778
+ /* @__PURE__ */ jsx7("span", {
779
+ className: classes.attachmentMedia,
780
+ children: /* @__PURE__ */ jsx7(Image, {
781
+ size: 14,
782
+ "aria-hidden": "true"
783
+ })
784
+ }),
785
+ /* @__PURE__ */ jsx7("span", {
786
+ className: classes.filename,
787
+ title: file.name,
788
+ children: file.name
789
+ }),
790
+ /* @__PURE__ */ jsx7(Button, {
791
+ variant: "ghost",
792
+ size: "icon-sm",
793
+ className: "size-6",
794
+ type: "button",
795
+ "aria-label": `${copy.removeAttachment}: ${file.name}`,
796
+ onClick: () => onRemoveScreenshot(index),
797
+ children: /* @__PURE__ */ jsx7(X, {
798
+ size: 16,
799
+ "aria-hidden": "true"
800
+ })
801
+ })
802
+ ]
803
+ }, index))
804
+ }),
805
+ invalidAttachments && /* @__PURE__ */ jsx7("p", {
806
+ role: "alert",
807
+ className: classes.alert,
808
+ children: copy.invalidAttachments
809
+ })
810
+ ]
811
+ }),
812
+ showDetails && /* @__PURE__ */ jsxs3("div", {
813
+ className: classes.details,
814
+ children: [
815
+ /* @__PURE__ */ jsx7("input", {
816
+ type: "checkbox",
817
+ id: `${id}-include-error-details`,
818
+ name: "includeErrorDetails",
819
+ defaultChecked: true,
820
+ disabled: pending
821
+ }),
822
+ /* @__PURE__ */ jsx7("label", {
823
+ htmlFor: `${id}-include-error-details`,
824
+ children: copy.includeErrorDetails
825
+ })
826
+ ]
827
+ })
828
+ ]
829
+ }),
830
+ (status === "failed" || status === "invalid" && !messageError && !emailError) && /* @__PURE__ */ jsx7("p", {
831
+ role: "alert",
832
+ className: classes.alert,
833
+ children: status === "invalid" ? copy.invalid : copy.failed
834
+ }),
835
+ /* @__PURE__ */ jsxs3("div", {
836
+ className: classes.actions,
837
+ children: [
838
+ /* @__PURE__ */ jsxs3(Button, {
839
+ type: "button",
840
+ variant: "outline",
841
+ className: classes.attach,
842
+ size: "sm",
843
+ disabled: pending,
844
+ onClick: () => fileInput.current?.click(),
845
+ children: [
846
+ /* @__PURE__ */ jsx7(Paperclip, {
847
+ size: 16,
848
+ "aria-hidden": "true"
849
+ }),
850
+ copy.attach
851
+ ]
852
+ }),
853
+ /* @__PURE__ */ jsx7(Button, {
854
+ type: "submit",
855
+ size: "sm",
856
+ disabled: pending,
857
+ children: pending ? copy.pending : copy.submit
858
+ })
859
+ ]
860
+ })
861
+ ]
862
+ }),
863
+ status !== "success" && directEmail._tag === "Some" && /* @__PURE__ */ jsxs3("p", {
864
+ className: classes.description,
865
+ children: [
866
+ copy.directEmail,
867
+ " ",
868
+ /* @__PURE__ */ jsx7("a", {
869
+ className: classes.link,
870
+ href: `mailto:${encodeURIComponent(directEmail.value).replace(/%40/g, "@")}`,
871
+ children: directEmail.value
872
+ })
873
+ ]
874
+ })
875
+ ]
876
+ });
877
+ };
878
+ var SupportPage = (props) => /* @__PURE__ */ jsx7(SupportWithSubmit, {
879
+ ...props,
880
+ view: "page"
881
+ });
882
+ var SupportPageView = ({
883
+ className,
884
+ classes: classOverrides,
885
+ messages: { title, description },
886
+ children
887
+ }) => {
888
+ const classes = resolveSupportClasses(classOverrides);
889
+ const titleId = useId();
890
+ return /* @__PURE__ */ jsxs3("section", {
891
+ "aria-labelledby": titleId,
892
+ className: cn(classes.page, className),
893
+ children: [
894
+ /* @__PURE__ */ jsxs3("header", {
895
+ className: classes.pageHeader,
896
+ children: [
897
+ /* @__PURE__ */ jsx7("h1", {
898
+ id: titleId,
899
+ className: classes.pageTitle,
900
+ children: title
901
+ }),
902
+ description && /* @__PURE__ */ jsx7("p", {
903
+ className: classes.pageDescription,
904
+ children: description
905
+ })
906
+ ]
907
+ }),
908
+ children
909
+ ]
910
+ });
911
+ };
912
+ var SupportDialog = (props) => /* @__PURE__ */ jsx7(SupportWithSubmit, {
913
+ ...props,
914
+ view: "dialog"
915
+ });
916
+ var SupportWithSubmit = ({
917
+ className,
918
+ classes,
919
+ view,
920
+ trigger,
921
+ locale,
922
+ messages,
923
+ askForReplyEmail,
924
+ supportEmail,
925
+ defaultReplyEmail,
926
+ errorDetails,
927
+ onSubmit
928
+ }) => {
929
+ const copy = useSupportFormMessages(locale, messages);
930
+ const [submission] = useState(() => {
931
+ let submit = onSubmit;
932
+ const component = SupportDialogModel.pipe(Component2.provide(SendSupport.layerFromSubmit((request) => submit(request))));
933
+ return {
934
+ component,
935
+ setSubmit: (next) => {
936
+ submit = next;
937
+ }
938
+ };
939
+ });
940
+ useLayoutEffect(() => {
941
+ submission.setSubmit(onSubmit);
942
+ }, [onSubmit, submission]);
943
+ return /* @__PURE__ */ jsx7(SupportModelView, {
944
+ config: SupportProps.make({
945
+ className,
946
+ classes,
947
+ messages: copy,
948
+ inline: view !== "dialog",
949
+ askForReplyEmail,
950
+ supportEmail,
951
+ defaultReplyEmail: defaultReplyEmail === undefined ? undefined : Redacted2.make(defaultReplyEmail),
952
+ errorDetails: errorDetails === undefined ? undefined : Redacted2.make(errorDetails)
953
+ }),
954
+ component: submission.component,
955
+ view,
956
+ trigger
957
+ });
958
+ };
959
+ var SupportDialogView = ({
960
+ className,
961
+ classes,
962
+ messages: copy,
963
+ trigger,
964
+ open,
965
+ pending,
966
+ sent,
967
+ onOpenChange,
968
+ children
969
+ }) => {
970
+ return /* @__PURE__ */ jsxs3(Dialog, {
971
+ open,
972
+ onOpenChange: (next, event) => {
973
+ if (!next && pending || onOpenChange(next) === false)
974
+ event.cancel();
975
+ },
976
+ children: [
977
+ /* @__PURE__ */ jsx7(DialogTrigger, {
978
+ render: trigger ?? /* @__PURE__ */ jsx7(Button, {
979
+ variant: "outline",
980
+ children: copy.title
981
+ })
982
+ }),
983
+ /* @__PURE__ */ jsxs3(DialogContent, {
984
+ className,
985
+ showCloseButton: false,
986
+ children: [
987
+ /* @__PURE__ */ jsxs3(DialogHeader, {
988
+ role: sent ? "status" : undefined,
989
+ children: [
990
+ /* @__PURE__ */ jsxs3(DialogTitle, {
991
+ className: resolveSupportClasses(classes).dialogTitle,
992
+ children: [
993
+ sent ? copy.success : copy.title,
994
+ sent && /* @__PURE__ */ jsx7(Check, {
995
+ size: 16,
996
+ "aria-hidden": "true"
997
+ })
998
+ ]
999
+ }),
1000
+ (sent ? copy.successDescription : copy.description) && /* @__PURE__ */ jsx7(DialogDescription, {
1001
+ children: sent ? copy.successDescription : copy.description
1002
+ })
1003
+ ]
1004
+ }),
1005
+ /* @__PURE__ */ jsx7(DialogClose, {
1006
+ render: /* @__PURE__ */ jsx7(Button, {
1007
+ variant: "ghost",
1008
+ size: "icon-sm",
1009
+ className: "absolute end-4 top-4",
1010
+ disabled: pending,
1011
+ "aria-label": copy.close
1012
+ }),
1013
+ children: /* @__PURE__ */ jsx7(X, {
1014
+ size: 16,
1015
+ "aria-hidden": "true"
1016
+ })
1017
+ }),
1018
+ !sent && children
1019
+ ]
1020
+ })
1021
+ ]
1022
+ });
1023
+ };
1024
+ var SupportDialogReact = ({
1025
+ config,
1026
+ component
1027
+ }) => /* @__PURE__ */ jsx7(SupportModelView, {
1028
+ config,
1029
+ component,
1030
+ view: config.inline ? "page" : "dialog"
1031
+ });
1032
+ var SupportModelView = ({
1033
+ config,
1034
+ component,
1035
+ view,
1036
+ trigger
1037
+ }) => {
1038
+ const { model, send } = useModel(component, config);
1039
+ const { defaultReplyEmail, errorDetails } = config;
1040
+ const messages = config.messages ?? getSupportFormMessages(config.locale);
1041
+ const state = Redacted2.value(model.form);
1042
+ const form = /* @__PURE__ */ jsx7(SupportFormView, {
1043
+ className: view === "form" ? config.className : undefined,
1044
+ classes: config.classes,
1045
+ messages,
1046
+ state,
1047
+ askForReplyEmail: config.askForReplyEmail,
1048
+ defaultReplyEmail: defaultReplyEmail && Redacted2.value(defaultReplyEmail),
1049
+ supportEmail: config.supportEmail,
1050
+ showDetails: Boolean(supportDiagnostics(errorDetails && Redacted2.value(errorDetails))),
1051
+ onSubmit: (fields) => send(SupportMessage2.SubmittedForm({
1052
+ fields: Redacted2.make({
1053
+ message: readTextField(fields, "message") ?? "",
1054
+ replyEmail: readTextField(fields, "replyEmail"),
1055
+ includeErrorDetails: fields.has("includeErrorDetails")
1056
+ })
1057
+ })),
1058
+ onAddScreenshots: (files) => send(SupportMessage2.AddedScreenshots({ files: Redacted2.make(files) })),
1059
+ onRemoveScreenshot: (index) => send(SupportMessage2.RemovedScreenshot({ index }))
1060
+ });
1061
+ if (view === "form")
1062
+ return form;
1063
+ if (view === "page")
1064
+ return /* @__PURE__ */ jsx7(SupportPageView, {
1065
+ className: config.className,
1066
+ classes: config.classes,
1067
+ messages,
1068
+ children: form
1069
+ });
1070
+ return /* @__PURE__ */ jsx7(SupportDialogView, {
1071
+ className: config.className,
1072
+ classes: config.classes,
1073
+ messages,
1074
+ trigger,
1075
+ open: model.open,
1076
+ pending: state.status === "pending",
1077
+ sent: state.status === "success",
1078
+ onOpenChange: (open) => send(open ? SupportMessage2.RequestedOpen() : SupportMessage2.RequestedClose()),
1079
+ children: form
1080
+ });
1081
+ };
1082
+ var decodeTextField = Schema5.decodeUnknownOption(Schema5.String);
1083
+ var readTextField = (fields, name) => Option.getOrUndefined(decodeTextField(fields.get(name)));
1084
+ export {
1085
+ InvalidSupportScreenshot,
1086
+ SupportDialog,
1087
+ SupportDialogReact,
1088
+ SupportDialogView,
1089
+ SupportForm,
1090
+ SupportFormView,
1091
+ SupportMultipartPayload,
1092
+ SupportPage,
1093
+ SupportPageView,
1094
+ SupportReplyEmail,
1095
+ SupportRequestSchema,
1096
+ getSupportFormMessages,
1097
+ readSupportScreenshots
1098
+ };