themelia-ui 2.0.0 → 2.0.1

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 (402) hide show
  1. package/.agents/skills/themelia-ui/references/components/INDEX.json +1 -2
  2. package/.agents/skills/themelia-ui/references/components/base--qr-code.md +2 -2
  3. package/.agents/skills/themelia-ui/references/components/base--typography.md +1 -1
  4. package/.agents/skills/themelia-ui/references/components/features--schema-form.md +1 -1
  5. package/.agents/skills/themelia-ui/references/components/features--theme-tweaker.md +3 -2
  6. package/.agents/skills/themelia-ui/references/components/theming.md +3 -2
  7. package/.agents/skills/themelia-ui/references/components/ui-provider.md +1 -0
  8. package/.agents/skills/themelia-ui/references/migration.md +16 -1
  9. package/.agents/skills/themelia-ui/references/theming.md +1 -1
  10. package/CHANGELOG.md +52 -0
  11. package/README.md +1 -1
  12. package/dist/{accordion-DLW9FGTP.js → accordion-B4zNzH7s.js} +3 -4
  13. package/dist/accordion-VazE3cHZ.cjs +1 -0
  14. package/dist/{action-menu-DqQX1_H8.js → action-menu-BrMchcyt.js} +4 -4
  15. package/dist/{action-menu-BFDQbOMx.cjs → action-menu-CO6DZ2xa.cjs} +1 -1
  16. package/dist/admin/patterns/access.cjs +1 -1
  17. package/dist/admin/patterns/access.js +9 -9
  18. package/dist/admin/patterns/commerce.cjs +1 -1
  19. package/dist/admin/patterns/commerce.js +20 -19
  20. package/dist/{alert-dialog-BPePUOHx.cjs → alert-dialog-ByJw3YGj.cjs} +1 -1
  21. package/dist/{alert-dialog-DzqaOiE5.js → alert-dialog-ZHkE0QEz.js} +1 -1
  22. package/dist/{avatar-2v-o_zEv.js → avatar-C30TNJoy.js} +1 -1
  23. package/dist/{avatar-Cdw0zuGn.cjs → avatar-b2IaEzda.cjs} +1 -1
  24. package/dist/base/accordion.cjs +1 -1
  25. package/dist/base/accordion.js +1 -1
  26. package/dist/base/action-menu.cjs +1 -1
  27. package/dist/base/action-menu.js +1 -1
  28. package/dist/base/alert-dialog.cjs +1 -1
  29. package/dist/base/alert-dialog.js +1 -1
  30. package/dist/base/avatar.cjs +1 -1
  31. package/dist/base/avatar.js +1 -1
  32. package/dist/base/batch-action-bar.cjs +1 -1
  33. package/dist/base/batch-action-bar.js +1 -1
  34. package/dist/base/buttons.cjs +1 -1
  35. package/dist/base/buttons.js +1 -1
  36. package/dist/base/cards.cjs +1 -1
  37. package/dist/base/cards.js +1 -1
  38. package/dist/base/carousel.cjs +1 -1
  39. package/dist/base/carousel.js +1 -1
  40. package/dist/base/choice-inputs.cjs +1 -1
  41. package/dist/base/choice-inputs.js +1 -1
  42. package/dist/base/combobox.cjs +1 -1
  43. package/dist/base/combobox.js +1 -1
  44. package/dist/base/command.cjs +1 -1
  45. package/dist/base/command.js +1 -1
  46. package/dist/base/context-menu.cjs +1 -1
  47. package/dist/base/context-menu.js +2 -2
  48. package/dist/base/copyable.cjs +1 -1
  49. package/dist/base/copyable.js +1 -1
  50. package/dist/base/date-pickers.cjs +1 -1
  51. package/dist/base/date-pickers.js +1 -1
  52. package/dist/base/dialog.cjs +1 -1
  53. package/dist/base/dialog.js +1 -1
  54. package/dist/base/display.cjs +1 -1
  55. package/dist/base/display.js +1 -1
  56. package/dist/base/dropdown-menu.cjs +1 -1
  57. package/dist/base/dropdown-menu.js +1 -1
  58. package/dist/base/feedback.cjs +1 -1
  59. package/dist/base/feedback.js +1 -1
  60. package/dist/base/forms-numeric.cjs +1 -1
  61. package/dist/base/forms-numeric.js +1 -1
  62. package/dist/base/forms.cjs +1 -1
  63. package/dist/base/forms.js +1 -1
  64. package/dist/base/hover-card.cjs +1 -1
  65. package/dist/base/hover-card.js +1 -1
  66. package/dist/base/input-group.cjs +1 -1
  67. package/dist/base/input-group.js +1 -1
  68. package/dist/base/item.cjs +1 -1
  69. package/dist/base/item.js +1 -1
  70. package/dist/base/label.cjs +1 -1
  71. package/dist/base/label.js +1 -1
  72. package/dist/base/navigation-menu.cjs +1 -1
  73. package/dist/base/navigation-menu.js +1 -1
  74. package/dist/base/navigation.cjs +1 -1
  75. package/dist/base/navigation.js +1 -1
  76. package/dist/base/otp-input.cjs +1 -1
  77. package/dist/base/otp-input.js +1 -1
  78. package/dist/base/overlay.cjs +1 -1
  79. package/dist/base/overlay.js +1 -1
  80. package/dist/base/popover-menu.cjs +1 -1
  81. package/dist/base/popover-menu.js +1 -1
  82. package/dist/base/popover.cjs +1 -1
  83. package/dist/base/popover.js +1 -1
  84. package/dist/base/qr-code.cjs +1 -1
  85. package/dist/base/qr-code.js +47 -43
  86. package/dist/base/repeaters.cjs +1 -1
  87. package/dist/base/repeaters.js +1 -1
  88. package/dist/base/sheet.cjs +1 -1
  89. package/dist/base/sheet.js +1 -1
  90. package/dist/base/sidebar.cjs +1 -1
  91. package/dist/base/sidebar.js +1 -1
  92. package/dist/base/skeleton.cjs +1 -1
  93. package/dist/base/skeleton.js +1 -1
  94. package/dist/base/table.cjs +1 -1
  95. package/dist/base/table.js +1 -1
  96. package/dist/base/timeline.cjs +1 -1
  97. package/dist/base/timeline.js +1 -1
  98. package/dist/base/toaster.cjs +1 -1
  99. package/dist/base/toaster.js +1 -1
  100. package/dist/base/toolbar.cjs +1 -1
  101. package/dist/base/toolbar.js +1 -1
  102. package/dist/base/tooltip.cjs +1 -1
  103. package/dist/base/tooltip.js +1 -1
  104. package/dist/base/typography.cjs +1 -1
  105. package/dist/base/typography.js +1 -1
  106. package/dist/base/upload.cjs +1 -1
  107. package/dist/base/upload.js +1 -1
  108. package/dist/base/value-inputs.cjs +1 -1
  109. package/dist/base/value-inputs.js +1 -1
  110. package/dist/{batch-action-bar-Cvnz248b.cjs → batch-action-bar-BMIiHBU8.cjs} +1 -1
  111. package/dist/{batch-action-bar-BRCopWlT.js → batch-action-bar-CAIjntVw.js} +2 -2
  112. package/dist/{buttons-CMsvnL6-.cjs → buttons-Dwl42fIr.cjs} +1 -1
  113. package/dist/{buttons-Corm-KHK.js → buttons-riLAPVQV.js} +4 -3
  114. package/dist/{cards-CEtNjl6A.js → cards-CcwLsQQS.js} +8 -9
  115. package/dist/cards-DQPevRTY.cjs +1 -0
  116. package/dist/{choice-inputs-Ca9PoQwa.js → choice-inputs-BjZYCdzk.js} +7 -7
  117. package/dist/{choice-inputs-CySnLjfA.cjs → choice-inputs-C8LMAkh8.cjs} +1 -1
  118. package/dist/combobox-bDQg27j0.cjs +1 -0
  119. package/dist/{combobox-Dl1xWnR7.js → combobox-exdUS4qj.js} +8 -9
  120. package/dist/{command-DWZf3CPI.js → command-Dv84KSRv.js} +3 -3
  121. package/dist/{command-BSvB58XI.cjs → command-Geb5eIzu.cjs} +1 -1
  122. package/dist/{comments-CVD4jB9V.cjs → comments-CV9tvSAi.cjs} +1 -1
  123. package/dist/{comments-CIZ1L-DR.js → comments-CqdhAH1O.js} +485 -491
  124. package/dist/components/base/buttons/button.d.cts +1 -1
  125. package/dist/components/base/buttons/button.d.ts +1 -1
  126. package/dist/components/base/qr-code/qr-code.d.cts +2 -2
  127. package/dist/components/base/qr-code/qr-code.d.ts +2 -2
  128. package/dist/components/base/typography/rich-text/rich-text.d.cts +1 -0
  129. package/dist/components/base/typography/rich-text/rich-text.d.ts +1 -0
  130. package/dist/{copyable-Bbd_Tsxc.cjs → copyable-CMhsv_91.cjs} +1 -1
  131. package/dist/{copyable-CRdTLtmK.js → copyable-uzkCHMzl.js} +3 -3
  132. package/dist/core.css +1 -1
  133. package/dist/css/access.css +1 -1
  134. package/dist/css/accordion.css +1 -1
  135. package/dist/css/action-menu.css +1 -1
  136. package/dist/css/activities.css +1 -1
  137. package/dist/css/ai-chat.css +1 -1
  138. package/dist/css/analytics.css +1 -1
  139. package/dist/css/app-shell.css +1 -1
  140. package/dist/css/async-preview.css +1 -1
  141. package/dist/css/auth.css +1 -1
  142. package/dist/css/avatar.css +1 -1
  143. package/dist/css/badge.css +1 -1
  144. package/dist/css/batch-action-bar.css +1 -1
  145. package/dist/css/buttons.css +1 -1
  146. package/dist/css/cards.css +1 -1
  147. package/dist/css/carousel.css +1 -1
  148. package/dist/css/chart.css +1 -1
  149. package/dist/css/choice-inputs.css +1 -1
  150. package/dist/css/combobox.css +1 -1
  151. package/dist/css/combobox2.css +1 -1
  152. package/dist/css/command.css +1 -1
  153. package/dist/css/comments.css +1 -1
  154. package/dist/css/commerce.css +1 -1
  155. package/dist/css/copyable.css +1 -1
  156. package/dist/css/data-view.css +1 -1
  157. package/dist/css/date-pickers.css +1 -1
  158. package/dist/css/display.css +1 -1
  159. package/dist/css/dropdown-menu.css +1 -1
  160. package/dist/css/event-calendar.css +1 -1
  161. package/dist/css/feedback.css +1 -1
  162. package/dist/css/filters.css +1 -1
  163. package/dist/css/forms.css +1 -1
  164. package/dist/css/global-search.css +1 -1
  165. package/dist/css/header.css +1 -1
  166. package/dist/css/hover-card.css +1 -1
  167. package/dist/css/input-group.css +1 -1
  168. package/dist/css/item.css +1 -1
  169. package/dist/css/kanban.css +1 -1
  170. package/dist/css/label.css +1 -1
  171. package/dist/css/map.css +1 -1
  172. package/dist/css/media-library.css +1 -1
  173. package/dist/css/mentions.css +1 -1
  174. package/dist/css/navigation-menu.css +1 -1
  175. package/dist/css/navigation.css +1 -1
  176. package/dist/css/navigation2.css +1 -1
  177. package/dist/css/overlay.css +1 -1
  178. package/dist/css/popover-menu.css +1 -1
  179. package/dist/css/popover.css +1 -1
  180. package/dist/css/products.css +1 -1
  181. package/dist/css/qr-code.css +1 -1
  182. package/dist/css/repeaters.css +1 -1
  183. package/dist/css/resource-assignment.css +1 -1
  184. package/dist/css/resource.css +1 -1
  185. package/dist/css/rich-text-editor.css +1 -1
  186. package/dist/css/schema-form.css +1 -1
  187. package/dist/css/sidebar2.css +1 -1
  188. package/dist/css/skeleton.css +1 -1
  189. package/dist/css/styles.css +1 -1
  190. package/dist/css/sync.css +1 -1
  191. package/dist/css/table.css +1 -1
  192. package/dist/css/table2.css +1 -1
  193. package/dist/css/text-inputs.css +1 -1
  194. package/dist/css/theme-tweaker.css +1 -1
  195. package/dist/css/timeline.css +1 -1
  196. package/dist/css/toaster.css +1 -1
  197. package/dist/css/toggle.css +1 -1
  198. package/dist/css/toolbar.css +1 -1
  199. package/dist/css/tooltip.css +1 -1
  200. package/dist/css/typography.css +1 -1
  201. package/dist/css/upload.css +1 -1
  202. package/dist/css/value-inputs.css +1 -1
  203. package/dist/css/workspace.css +1 -1
  204. package/dist/{date-pickers-Dy9BVNnb.js → date-pickers-1_Ah7qWO.js} +5 -5
  205. package/dist/{date-pickers-C6rE7fLo.cjs → date-pickers-DejXe5oe.cjs} +1 -1
  206. package/dist/{dialog-CLwUz8Gb.js → dialog-CXugTX8t.js} +1 -1
  207. package/dist/{dialog-Bf7tBRkZ.cjs → dialog-DZ9_m_qc.cjs} +1 -1
  208. package/dist/display-CFj87iEn.cjs +1 -0
  209. package/dist/{display-DVhYS75K.js → display-Dehpw83R.js} +6 -5
  210. package/dist/{dropdown-menu-CIXxWTpw.js → dropdown-menu-BdgB__AC.js} +1 -1
  211. package/dist/{dropdown-menu-0OW7zJto.cjs → dropdown-menu-DCf_EqVG.cjs} +1 -1
  212. package/dist/features/actions.cjs +1 -1
  213. package/dist/features/actions.js +1 -1
  214. package/dist/features/activities.cjs +1 -1
  215. package/dist/features/activities.js +361 -363
  216. package/dist/features/ai-chat.cjs +2 -2
  217. package/dist/features/ai-chat.js +11 -10
  218. package/dist/features/async-preview.cjs +1 -1
  219. package/dist/features/async-preview.js +4 -4
  220. package/dist/features/combobox.cjs +1 -1
  221. package/dist/features/combobox.js +5 -5
  222. package/dist/features/comments.cjs +1 -1
  223. package/dist/features/comments.js +1 -1
  224. package/dist/features/data-view.cjs +1 -1
  225. package/dist/features/data-view.js +6 -6
  226. package/dist/features/event-calendar.cjs +1 -1
  227. package/dist/features/event-calendar.js +10 -10
  228. package/dist/features/filters.cjs +1 -1
  229. package/dist/features/filters.js +1 -1
  230. package/dist/features/global-search.cjs +1 -1
  231. package/dist/features/global-search.js +8 -8
  232. package/dist/features/kanban.cjs +1 -1
  233. package/dist/features/kanban.js +4 -5
  234. package/dist/features/map.cjs +1 -1
  235. package/dist/features/map.js +318 -317
  236. package/dist/features/media-library.cjs +1 -1
  237. package/dist/features/media-library.js +751 -771
  238. package/dist/features/mentions.cjs +1 -1
  239. package/dist/features/mentions.js +1 -1
  240. package/dist/features/overlays.cjs +1 -1
  241. package/dist/features/overlays.js +1 -1
  242. package/dist/features/products.cjs +1 -1
  243. package/dist/features/products.js +15 -15
  244. package/dist/features/resource-assignment.cjs +1 -1
  245. package/dist/features/resource-assignment.js +6 -6
  246. package/dist/features/resource.cjs +1 -1
  247. package/dist/features/resource.js +6 -6
  248. package/dist/features/rich-text-editor.cjs +1 -1
  249. package/dist/features/rich-text-editor.js +1 -1
  250. package/dist/features/schema-form.cjs +1 -1
  251. package/dist/features/schema-form.css +1 -1
  252. package/dist/features/schema-form.js +207 -223
  253. package/dist/features/sync.cjs +1 -1
  254. package/dist/features/sync.js +3 -3
  255. package/dist/features/table.cjs +1 -1
  256. package/dist/features/table.js +1 -1
  257. package/dist/features/theme-tweaker.cjs +2 -2
  258. package/dist/features/theme-tweaker.js +105 -124
  259. package/dist/{feedback-BmquisO3.js → feedback-C8QtkdHc.js} +3 -3
  260. package/dist/feedback-IpUFKqgv.cjs +1 -0
  261. package/dist/{filters-BD0zRwCE.js → filters-BMKZHnBA.js} +22 -17
  262. package/dist/filters-Ct07D74Q.cjs +1 -0
  263. package/dist/{forms-zF9SP3Ai.js → forms-C-d0-GML.js} +5 -7
  264. package/dist/forms-mJ0fjWEl.cjs +1 -0
  265. package/dist/{forms-numeric-B1cqc9Vn.cjs → forms-numeric-B7TRpwvH.cjs} +1 -1
  266. package/dist/{forms-numeric-DzxBaEg1.js → forms-numeric-MKOgf5BF.js} +1 -1
  267. package/dist/index.cjs +1 -1
  268. package/dist/index.js +2 -2
  269. package/dist/{input-group-Bnc24cRI.cjs → input-group-HplgNyti.cjs} +1 -1
  270. package/dist/{input-group-CTSiVEGd.js → input-group-xFaO6qrB.js} +2 -2
  271. package/dist/{item-Cye3hJmr.cjs → item-BxPJsxh2.cjs} +1 -1
  272. package/dist/{item-OVu-oGxQ.js → item-C7Wfarcx.js} +2 -2
  273. package/dist/{label-Cr4NpRvn.cjs → label-B8WTGCTZ.cjs} +1 -1
  274. package/dist/{label-DYJT1uER.js → label-DumoMDm6.js} +1 -1
  275. package/dist/layout/app-shell.cjs +1 -1
  276. package/dist/layout/app-shell.js +1 -1
  277. package/dist/layout/auth.cjs +1 -1
  278. package/dist/layout/auth.js +4 -2
  279. package/dist/layout/header.cjs +1 -1
  280. package/dist/layout/header.js +10 -10
  281. package/dist/layout/navigation.cjs +1 -1
  282. package/dist/layout/navigation.js +1 -1
  283. package/dist/layout/page.cjs +1 -1
  284. package/dist/layout/page.js +4 -4
  285. package/dist/layout/settings.cjs +1 -1
  286. package/dist/layout/settings.js +2 -2
  287. package/dist/layout/sidebar.cjs +1 -1
  288. package/dist/layout/sidebar.js +7 -7
  289. package/dist/layout/workspace.cjs +1 -1
  290. package/dist/layout/workspace.js +6 -7
  291. package/dist/lib/theming/recipes.d.cts +5 -2
  292. package/dist/lib/theming/recipes.d.ts +5 -2
  293. package/dist/lib/ui-provider/types.d.cts +4 -1
  294. package/dist/lib/ui-provider/types.d.ts +4 -1
  295. package/dist/{mentions-DbQAE-Ug.cjs → mentions-Ckm9Ct-r.cjs} +1 -1
  296. package/dist/{mentions-BU1sDupC.js → mentions-D_b-yVXN.js} +5 -5
  297. package/dist/{navigation-D00jGH59.js → navigation-COnv0B1H.js} +6 -5
  298. package/dist/navigation-D_hEWZYv.cjs +1 -0
  299. package/dist/{navigation-BRv9Xerv.js → navigation-DwNUlszz.js} +17 -15
  300. package/dist/navigation-UfUJU2LC.cjs +1 -0
  301. package/dist/{overlay-Bdri8Z7E.js → overlay-A5bE-8n5.js} +2 -2
  302. package/dist/{overlay-D1wEvshK.cjs → overlay-BtQz_AN3.cjs} +1 -1
  303. package/dist/{overlays-CaBkEKRc.js → overlays-DX9ux-XL.js} +7 -7
  304. package/dist/{overlays-BnWOasE6.cjs → overlays-MmLNLV9f.cjs} +1 -1
  305. package/dist/patterns/analytics.cjs +1 -1
  306. package/dist/patterns/analytics.js +41 -44
  307. package/dist/patterns/onboarding.cjs +1 -1
  308. package/dist/patterns/onboarding.js +4 -4
  309. package/dist/patterns/timelines.cjs +1 -1
  310. package/dist/patterns/timelines.js +1 -1
  311. package/dist/{popover-Dt8IXXKy.js → popover-CM1nxkAM.js} +2 -2
  312. package/dist/{popover-menu-BeNyDDo1.js → popover-menu-BCs5CLkw.js} +4 -4
  313. package/dist/{popover-menu-Cm10om_m.cjs → popover-menu-DcDdf9H2.cjs} +1 -1
  314. package/dist/{popover-BUebuMJK.cjs → popover-rLMSEj5V.cjs} +1 -1
  315. package/dist/{primitives-B2aeaudR.js → primitives-BnXNg-Kr.js} +2 -2
  316. package/dist/{primitives-BP7kGVYZ.cjs → primitives-kywiHMJE.cjs} +1 -1
  317. package/dist/primitives.cjs +1 -1
  318. package/dist/primitives.js +1 -1
  319. package/dist/{repeaters-BIvKI1CQ.cjs → repeaters-B4dnWxUE.cjs} +1 -1
  320. package/dist/{repeaters-C43GWEE_.js → repeaters-B4oohPvd.js} +4 -4
  321. package/dist/{rich-text-editor-CqqHeJDp.cjs → rich-text-editor-7GYD-4Qq.cjs} +1 -1
  322. package/dist/{rich-text-editor-CVo4FB26.js → rich-text-editor-CgsfAGMo.js} +3 -3
  323. package/dist/{sheet-BP2BmI-Z.js → sheet-3sbsGFus.js} +2 -2
  324. package/dist/{sheet-FA8TfP1E.cjs → sheet-B4_LNS7m.cjs} +1 -1
  325. package/dist/{sidebar-C-TSBDj5.cjs → sidebar--uZUOGHE.cjs} +1 -1
  326. package/dist/{sidebar-DOmsOhCp.js → sidebar-BMgoyRxy.js} +10 -9
  327. package/dist/{skeleton-vN_fsg7X.js → skeleton-Bxqw8kwa.js} +1 -1
  328. package/dist/{skeleton-3RdcmQ7K.cjs → skeleton-DeuQS4AK.cjs} +1 -1
  329. package/dist/style.css +1 -1
  330. package/dist/styles/SCOPES.md +28 -9
  331. package/dist/styles/TOKENS.md +165 -9
  332. package/dist/styles/index.css +0 -1
  333. package/dist/styles/map.css +14 -8
  334. package/dist/styles/mentions.css +37 -44
  335. package/dist/styles/tailwind.css +2 -1
  336. package/dist/styles/themes/default.css +16 -14
  337. package/dist/styles/theming/colors.css +28 -22
  338. package/dist/styles/theming/feedback.css +0 -1
  339. package/dist/styles/theming/focus.css +15 -8
  340. package/dist/styles/theming/motion.css +8 -5
  341. package/dist/styles/theming/overlay.css +7 -0
  342. package/dist/styles/theming/sizing.css +8 -4
  343. package/dist/styles/theming/text.css +3 -1
  344. package/dist/styles/theming/typography.css +3 -0
  345. package/dist/styles/tokens/components.css +1 -1
  346. package/dist/styles/tokens/states.css +4 -4
  347. package/dist/{table-B9zwmrtt.cjs → table-3abrkeib.cjs} +1 -1
  348. package/dist/{table-CzsDKBR2.js → table-BXL7IP5P.js} +1 -1
  349. package/dist/{table-CaFQyjTz.cjs → table-CXRnlkV5.cjs} +1 -1
  350. package/dist/{table-CtUahid0.js → table-DszexXEh.js} +14 -14
  351. package/dist/tailwind.css +2 -1
  352. package/dist/{theming-B52zPV1p.cjs → theming-8U04chn7.cjs} +1 -1
  353. package/dist/{theming-y5FKH_La.js → theming-D6KRU7hO.js} +9 -9
  354. package/dist/theming.cjs +1 -1
  355. package/dist/theming.js +1 -1
  356. package/dist/{timeline-B3f7rEXh.cjs → timeline-CzAIDLzd.cjs} +1 -1
  357. package/dist/{timeline-DskNs3lw.js → timeline-ptWoY2GY.js} +2 -2
  358. package/dist/{timelines-wlcL01Rf.js → timelines-BquC31uF.js} +4 -4
  359. package/dist/{timelines-DJdBmWPj.cjs → timelines-DLsQhK72.cjs} +1 -1
  360. package/dist/{toaster-D3Fsaf3I.cjs → toaster-BVTOrAb5.cjs} +1 -1
  361. package/dist/{toaster-CaTwpule.js → toaster-DOBJDiXt.js} +1 -1
  362. package/dist/tokens.json +8 -7
  363. package/dist/{toolbar-CvUhAFhi.js → toolbar-3GLSD7Fi.js} +1 -1
  364. package/dist/{toolbar-Bap7y244.cjs → toolbar-aZKjtFDt.cjs} +1 -1
  365. package/dist/{tooltip-Dewu4Ynm.cjs → tooltip-CEcUVmor.cjs} +1 -1
  366. package/dist/{tooltip-B82dN7Oy.js → tooltip-DksScngC.js} +1 -1
  367. package/dist/{typography-B8Iurhy1.js → typography-BkxEiwQ1.js} +1 -1
  368. package/dist/{typography-LMez-POJ.cjs → typography-Cf5zEv4y.cjs} +1 -1
  369. package/dist/ui-provider-DI1VxMDT.cjs +1 -0
  370. package/dist/{ui-provider-BzyJxcKH.js → ui-provider-gNDv-ZRY.js} +4 -1
  371. package/dist/ui-provider.cjs +1 -1
  372. package/dist/ui-provider.js +1 -1
  373. package/dist/{upload-5tzkI0NC.cjs → upload-Bg8tyH5a.cjs} +1 -1
  374. package/dist/{upload-BL8HIPbS.js → upload-wTBh4QQx.js} +4 -4
  375. package/dist/{value-inputs-DzErolfh.cjs → value-inputs-B6ZURTUl.cjs} +1 -1
  376. package/dist/{value-inputs-DQGHd7k8.js → value-inputs-DnQKmVqW.js} +4 -4
  377. package/docs/generated/component-index.json +1 -2
  378. package/docs/generated/components/base--qr-code.md +2 -2
  379. package/docs/generated/components/base--typography.md +1 -1
  380. package/docs/generated/components/features--schema-form.md +1 -1
  381. package/docs/generated/components/features--theme-tweaker.md +3 -2
  382. package/docs/generated/components/theming.md +3 -2
  383. package/docs/generated/components/ui-provider.md +1 -0
  384. package/docs/generated/migration-codemod.json +28 -3
  385. package/docs/generated/migration.md +72 -3
  386. package/docs/generated/profiles.md +1 -1
  387. package/docs/learn/migration.md +16 -1
  388. package/docs/learn/theming.md +1 -1
  389. package/package.json +1 -1
  390. package/src/styles/SCOPES.md +28 -9
  391. package/src/styles/TOKENS.md +165 -9
  392. package/dist/accordion-BH9vNfdb.cjs +0 -1
  393. package/dist/cards-CO5LHALb.cjs +0 -1
  394. package/dist/combobox-CTUFSblt.cjs +0 -1
  395. package/dist/display-BUiiuPS9.cjs +0 -1
  396. package/dist/feedback-Da53xAUT.cjs +0 -1
  397. package/dist/filters-B8dkhzan.cjs +0 -1
  398. package/dist/forms-BEQN1X5A.cjs +0 -1
  399. package/dist/navigation-BaIANCwE.cjs +0 -1
  400. package/dist/navigation-BmZabEfZ.cjs +0 -1
  401. package/dist/styles/theming/mentions.css +0 -33
  402. package/dist/ui-provider-B3v22pQY.cjs +0 -1
@@ -2,13 +2,13 @@
2
2
  import "../core.css";
3
3
  import "../css/workspace.css";
4
4
  import { t as e } from "../cx--CBrhWH0.js";
5
- import { a as t, i as n, o as r } from "../typography-B8Iurhy1.js";
6
- import { s as i } from "../feedback-BmquisO3.js";
7
- import { d as a, n as o } from "../display-DVhYS75K.js";
8
- import { H as s } from "../primitives-B2aeaudR.js";
5
+ import { a as t, i as n, o as r } from "../typography-BkxEiwQ1.js";
6
+ import { s as i } from "../feedback-C8QtkdHc.js";
7
+ import { d as a, n as o } from "../display-Dehpw83R.js";
8
+ import { H as s } from "../primitives-BnXNg-Kr.js";
9
9
  import { t as c } from "../badge-D34FkKLD.js";
10
- import { c as l, i as u, o as d, r as f, t as p, u as m } from "../item-OVu-oGxQ.js";
11
- import { o as h } from "../navigation-D00jGH59.js";
10
+ import { c as l, i as u, o as d, r as f, t as p, u as m } from "../item-C7Wfarcx.js";
11
+ import { o as h } from "../navigation-COnv0B1H.js";
12
12
  import { t as g } from "../layout.types-CTDrZCGP.js";
13
13
  import { CheckIcon as _, CircleAlertIcon as v, CircleIcon as y } from "lucide-react";
14
14
  import { Fragment as b } from "react";
@@ -73,7 +73,6 @@ function A({ title: n, description: i, media: a, badges: s, status: c, metadata:
73
73
  children: n
74
74
  }),
75
75
  description: i == null ? void 0 : /* @__PURE__ */ S(r, {
76
- size: "sm",
77
76
  type: "secondary",
78
77
  children: i
79
78
  }),
@@ -10,11 +10,14 @@ export interface ThemeTypeScaleRecipe {
10
10
  ratio?: number;
11
11
  }
12
12
  export interface ThemeElevationRecipe {
13
- /** 0 is flat, 1 is pronounced. */
13
+ /** 0 is flat, 1 is pronounced; 0.8 reproduces the default theme. */
14
14
  intensity: number;
15
15
  }
16
16
  /** A coherent brand from one primary colour. */
17
17
  export declare function deriveThemePalette({ primary, mode }: ThemePaletteRecipe): ThemeOverrides;
18
18
  export declare function deriveThemeTypeScale({ baseSize, ratio, }: ThemeTypeScaleRecipe): ThemeOverrides;
19
- /** The whole shadow ladder from one intensity. */
19
+ /**
20
+ * The whole shadow ladder from one intensity: the default theme's geometry and
21
+ * `--shadow-ink`, with every layer's ink scaled so 0.8 reproduces it exactly.
22
+ */
20
23
  export declare function deriveThemeElevation({ intensity }: ThemeElevationRecipe): ThemeOverrides;
@@ -10,11 +10,14 @@ export interface ThemeTypeScaleRecipe {
10
10
  ratio?: number;
11
11
  }
12
12
  export interface ThemeElevationRecipe {
13
- /** 0 is flat, 1 is pronounced. */
13
+ /** 0 is flat, 1 is pronounced; 0.8 reproduces the default theme. */
14
14
  intensity: number;
15
15
  }
16
16
  /** A coherent brand from one primary colour. */
17
17
  export declare function deriveThemePalette({ primary, mode }: ThemePaletteRecipe): ThemeOverrides;
18
18
  export declare function deriveThemeTypeScale({ baseSize, ratio, }: ThemeTypeScaleRecipe): ThemeOverrides;
19
- /** The whole shadow ladder from one intensity. */
19
+ /**
20
+ * The whole shadow ladder from one intensity: the default theme's geometry and
21
+ * `--shadow-ink`, with every layer's ink scaled so 0.8 reproduces it exactly.
22
+ */
20
23
  export declare function deriveThemeElevation({ intensity }: ThemeElevationRecipe): ThemeOverrides;
@@ -5,7 +5,10 @@ export type { ComponentScale };
5
5
  export type { PaletteToken, SemanticToken };
6
6
  /** Spacing and control-geometry preset. Sets `--density-scale` through `data-density`. */
7
7
  export type Density = "compact" | "default" | "comfortable";
8
- /** Step on the type scale. `inherit` lets the surrounding size flow through. */
8
+ /**
9
+ * Step on the type scale. `inherit` lets the surrounding size flow through.
10
+ * `xxs` is deprecated: it renders as `xs`, so write `xs`.
11
+ */
9
12
  export type TextSize = "inherit" | "xxs" | "xs" | "pxs" | "sm" | "base" | "lg" | "xl";
10
13
  export type ColorScheme = "light" | "dark" | "system";
11
14
  /** Theme overrides. Token names are generated from the stylesheet, so a typo is a type error. */
@@ -5,7 +5,10 @@ export type { ComponentScale };
5
5
  export type { PaletteToken, SemanticToken };
6
6
  /** Spacing and control-geometry preset. Sets `--density-scale` through `data-density`. */
7
7
  export type Density = "compact" | "default" | "comfortable";
8
- /** Step on the type scale. `inherit` lets the surrounding size flow through. */
8
+ /**
9
+ * Step on the type scale. `inherit` lets the surrounding size flow through.
10
+ * `xxs` is deprecated: it renders as `xs`, so write `xs`.
11
+ */
9
12
  export type TextSize = "inherit" | "xxs" | "xs" | "pxs" | "sm" | "base" | "lg" | "xl";
10
13
  export type ColorScheme = "light" | "dark" | "system";
11
14
  /** Theme overrides. Token names are generated from the stylesheet, so a typo is a type error. */
@@ -1 +1 @@
1
- const e=require("./typography-LMez-POJ.cjs"),t=require("./item-Cye3hJmr.cjs"),n=require("./use-debounced-callback-BiZB-QB2.cjs"),r=require("./avatar-Cdw0zuGn.cjs"),i=require("./popover-BUebuMJK.cjs"),a=require("./command-BSvB58XI.cjs"),o=require("./spinner-ChYwza6q.cjs");let s=require("react"),c=require("react/jsx-runtime"),l=require("hast-util-from-html"),u=require("clsx");function d({mention:e,resource:t,asLink:n=!0,onClick:r,trailing:i,className:a,...o}){if(t?.renderChip)return(0,c.jsx)(c.Fragment,{children:t.renderChip(e)});let s=t?.icon,l=t?.tone,d=(0,c.jsxs)(c.Fragment,{children:[!!s&&(0,c.jsx)(s,{}),e.label,i]}),f={"data-ref-id":e.id,"data-ref-kind":e.kind,"data-ref-tone":l,className:(0,u.clsx)(`mention-chip--component`,a)};return n&&e.href?(0,c.jsx)(`a`,{...f,href:e.href,target:`_blank`,rel:`noreferrer noopener`,onClick:r,children:d}):(0,c.jsx)(`span`,{...f,onClick:r,...o,children:d})}function f({html:t,mentions:n,resources:r,renderMention:i,sanitizer:a,...o}){let u=(0,s.useMemo)(()=>a?a(t??``):e.n(t??``),[t,a]),f=(0,s.useMemo)(()=>{let e=new Map;for(let t of n??[])e.set(t.id,t);return e},[n]),p=(0,s.useMemo)(()=>(0,l.fromHtml)(u,{fragment:!0}),[u]);if(!u)return null;function m(e,t){if(e.type===`text`)return e.value;if(e.type!==`element`)return null;let n=e.properties.dataRefId,a=typeof n==`string`?f.get(n):void 0;if(a&&(e.tagName===`span`||e.tagName===`a`))return(0,s.createElement)(s.Fragment,{key:t},i?i(a):(0,c.jsx)(d,{mention:a,resource:r?.[a.kind]}));let o={key:t};for(let[t,n]of Object.entries(e.properties)){let e=t.startsWith(`data`)?t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`):t;o[e]=Array.isArray(n)?n.join(` `):n}return(0,s.createElement)(e.tagName,o,...e.children.length?e.children.map((e,n)=>m(e,`${t}-${n}`)):[])}return(0,c.jsx)(e.t,{...o,children:p.children.map((e,t)=>m(e,String(t)))})}var p={title:`Insert reference`,formatQuery:e=>`\u201c${e}\u201d`,empty:`No matches.`,loading:`Searching…`,listLabel:`Reference suggestions`},m={...p,searchPlaceholder:`Search…`},h={panel:`mentions__panel___UnLzV`,panelInline:`mentions__panelInline___7ohA_`,panelHeader:`mentions__panelHeader___Knvg3`,panelQuery:`mentions__panelQuery___vDLi5`,tabs:`mentions__tabs___p8mVm`,tab:`mentions__tab___PvBzn`,list:`mentions__list___Lu9gd`,listState:`mentions__listState___JLYq1`,row:`mentions__row___cbg34`,rowIcon:`mentions__rowIcon___Z1goN`,rowText:`mentions__rowText___wAv05`,command:`mentions__command___n2D38`,commandList:`mentions__commandList___1GF_A`};function g({kinds:t,activeKind:n,onSelect:r,resources:i,suggestionsByKind:a,focusable:o=!0}){return t.length<=1?null:(0,c.jsx)(`div`,{className:(0,u.clsx)(`mention-kind-tabs--component`,h.tabs),role:`tablist`,children:t.map(s=>{let l=i?.[s],u=s===n,d=a?.[s]?.length??0;return(0,c.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":u,tabIndex:o&&u?0:-1,onKeyDown:e=>{if(![`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key))return;e.preventDefault();let n=t.indexOf(s),i=e.key===`Home`?0:e.key===`End`?t.length-1:(n+(e.key===`ArrowRight`?1:-1)+t.length)%t.length,a=t[i];a!==void 0&&r(a),(e.currentTarget.parentElement?.querySelectorAll(`[role=tab]`)[i])?.focus()},"data-active":u||void 0,"data-empty":d===0||void 0,onClick:()=>r(s),className:h.tab,children:[(0,c.jsx)(e.o,{tag:`span`,weight:`medium`,type:`inherit`,children:l?.label??String(s)}),d>0&&(0,c.jsx)(e.o,{tag:`span`,size:`xs`,weight:`medium`,type:`inherit`,numeric:!0,children:d})]},s)})})}function _({suggestions:n,activeKind:i,loading:l,loadingLabel:d,emptyLabel:f,listLabel:p,onSelect:m,className:g,resources:_,command:v=!1,activeIndex:y,onActiveIndexChange:b,focusable:x=!0,id:S}){let[C,w]=(0,s.useState)(0),T=Math.min(y??C,Math.max(0,n.length-1)),E=e=>{w(e),b?.(e)};return l?(0,c.jsx)(`div`,{id:S,className:(0,u.clsx)(`mention-rows--component`,h.list,h.listState,g),children:(0,c.jsx)(o.t,{label:d})}):n.length===0?(0,c.jsx)(`div`,{id:S,role:`status`,className:(0,u.clsx)(`mention-rows--component`,h.list,h.listState,g),children:(0,c.jsx)(e.o,{type:`secondary`,children:f})}):(0,c.jsx)(`div`,{id:S,role:v?void 0:`listbox`,"aria-label":v?void 0:p,className:(0,u.clsx)(`mention-rows--component`,h.list,g),children:n.map((o,s)=>{let l=o.kind??i??``,u=o.icon??_?.[l]?.icon,d=(0,c.jsxs)(c.Fragment,{children:[o.avatar?(0,c.jsxs)(r.r,{size:`sm`,children:[(0,c.jsx)(r.c,{src:o.avatar,alt:``}),(0,c.jsx)(r.a,{children:o.label.slice(0,1)})]}):!!u&&(0,c.jsx)(u,{className:h.rowIcon}),(0,c.jsxs)(`span`,{className:h.rowText,children:[(0,c.jsx)(e.o,{tag:`span`,weight:`medium`,truncate:!0,children:o.label}),!!o.description&&(0,c.jsx)(e.o,{tag:`span`,size:`xs`,type:`secondary`,truncate:!0,children:o.description})]})]}),f=`${l}:${o.id}`;return v?(0,c.jsx)(a.o,{value:f,onSelect:()=>m(o),className:h.row,"data-suggestion-id":f,children:d},f):(0,c.jsx)(t.t,{id:S?`${S}-${s}`:void 0,render:(0,c.jsx)(`button`,{type:`button`}),role:`option`,"aria-selected":T===s,tabIndex:x&&T===s?0:-1,"data-suggestion-id":f,className:h.row,onPointerMove:()=>E(s),onFocus:()=>E(s),onClick:()=>m(o),onKeyDown:e=>{if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;e.preventDefault();let t=(s+(e.key===`ArrowDown`?1:-1)+n.length)%n.length;E(t),(e.currentTarget.parentElement?.querySelectorAll(`[role=option]`)[t])?.focus()},children:d},f)})})}function v({open:t,activeKind:n,setActiveKind:r,kinds:o,resources:s,suggestionsByKind:l,query:d,setQuery:f,suggestions:p,loading:v,onSelect:y,strings:b,className:x}){let S={...m,...b};return t?(0,c.jsxs)(i.r,{align:`start`,inset:`flush`,width:void 0,"aria-label":S.title,className:(0,u.clsx)(`mention-picker--component`,h.panel,x),children:[(0,c.jsxs)(`div`,{className:h.panelHeader,children:[(0,c.jsx)(`div`,{className:`sr-only`,children:(0,c.jsx)(e.o,{size:`xs`,weight:`medium`,type:`secondary`,children:S.title})}),(0,c.jsx)(g,{kinds:o,activeKind:n,resources:s,suggestionsByKind:l,onSelect:r})]}),(0,c.jsxs)(a.t,{shouldFilter:!1,className:h.command,children:[(0,c.jsx)(a.a,{autoFocus:!0,"aria-label":S.searchPlaceholder,placeholder:S.searchPlaceholder,value:d,onValueChange:f}),(0,c.jsx)(a.s,{"aria-label":S.listLabel,className:h.commandList,children:(0,c.jsx)(_,{command:!0,resources:s,suggestions:p,activeKind:n,loading:v,loadingLabel:S.loading,emptyLabel:S.empty,listLabel:S.listLabel,onSelect:y})})]})]}):null}function y({open:t,activeKind:n,setActiveKind:r,kinds:i,resources:a,suggestionsByKind:o,suggestions:l,loading:d,query:f,onManualKindChange:m,onSelect:v,onDismiss:y,strings:b,className:x}){let S={...p,...b},C=(0,s.useRef)(null),[w,T]=(0,s.useState)(`bottom`),E=(0,s.useId)(),D=`${n}:${f??``}:${l.map(e=>e.id).join(`,`)}`,[O,k]=(0,s.useState)({key:``,index:0}),[A,j]=(0,s.useState)(null),M=t&&A!==D,N=O.key===D?Math.min(O.index,Math.max(0,l.length-1)):0;return!t&&A!==null&&j(null),(0,s.useEffect)(()=>{if(!M)return;let e=C.current?.ownerDocument.activeElement;if(!e?.matches(`[contenteditable=true], textarea, input`))return;let t={"aria-controls":E,"aria-autocomplete":`list`,"aria-activedescendant":l.length&&!d?`${E}-${N}`:``},n=Object.fromEntries(Object.keys(t).map(t=>[t,e.getAttribute(t)]));for(let[n,r]of Object.entries(t))e.setAttribute(n,r);let r=()=>{j(D),y?.()},i=e=>{if(!(e.isComposing||e.keyCode===229)){if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),r();return}if(!(d||l.length===0)){if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation();let t=(N+(e.key===`ArrowDown`?1:-1)+l.length)%l.length;k({key:D,index:t}),C.current?.querySelectorAll(`[role=option]`)[t]?.scrollIntoView({block:`nearest`})}else if(e.key===`Enter`){let t=l[N];t&&(e.preventDefault(),e.stopPropagation(),v(t))}}}};return e.addEventListener(`keydown`,i,!0),e.addEventListener(`blur`,r),()=>{e.removeEventListener(`keydown`,i,!0),e.removeEventListener(`blur`,r);for(let[t,r]of Object.entries(n))r===null?e.removeAttribute(t):e.setAttribute(t,r)}},[M,N,E,D,d,y,v,l]),(0,s.useLayoutEffect)(()=>{if(!M){T(`bottom`);return}let e=C.current;if(!e)return;let t=()=>{let t=e.offsetParent;if(!t)return;let n=t.getBoundingClientRect(),r=e.offsetHeight,i=window.visualViewport,a=i?.offsetTop??0,o=a+(i?.height??window.innerHeight)-n.bottom,s=n.top-a,c=r>o&&s>o?`top`:`bottom`;T(c);let l=getComputedStyle(e),u=(Number.parseFloat(l.marginTop)||0)+(Number.parseFloat(l.marginBottom)||0);e.style.setProperty(`--mention-available-height`,`${Math.max(0,(c===`top`?s:o)-u*2)}px`)};t(),window.addEventListener(`resize`,t),window.addEventListener(`scroll`,t,!0);let n=new ResizeObserver(t);return n.observe(e),window.visualViewport?.addEventListener(`resize`,t),()=>{window.removeEventListener(`resize`,t),window.removeEventListener(`scroll`,t,!0),n.disconnect(),window.visualViewport?.removeEventListener(`resize`,t)}},[M,l,n]),M?(0,c.jsxs)(`div`,{ref:C,"data-placement":w,onMouseDown:e=>e.preventDefault(),className:(0,u.clsx)(`mention-inline-suggestions--component`,h.panel,h.panelInline,x),children:[(0,c.jsxs)(`div`,{className:h.panelHeader,children:[(0,c.jsxs)(`div`,{className:`sr-only`,children:[(0,c.jsx)(e.o,{size:`xs`,weight:`medium`,type:`secondary`,children:S.title}),!!f&&(0,c.jsx)(e.o,{size:`xs`,type:`secondary`,className:h.panelQuery,children:S.formatQuery(f)})]}),(0,c.jsx)(g,{focusable:!1,kinds:i,activeKind:n,resources:a,suggestionsByKind:o,onSelect:e=>{r(e),m?.()}})]}),(0,c.jsx)(_,{id:E,resources:a,focusable:!1,activeIndex:N,onActiveIndexChange:e=>k({key:D,index:e}),suggestions:l,activeKind:n,loading:d,loadingLabel:S.loading,emptyLabel:S.empty,listLabel:S.listLabel,onSelect:v})]}):null}var b=RegExp(`<((?:span|a))\\b[^>]*?data-ref-id\\s*=\\s*"([^"]+)"[^>]*?>([\\s\\S]*?)<\\/\\1>`,`gi`),x=/data-ref-kind\s*=\s*"([^"]+)"/i,S=/^[@#$&%!~]\s*/;function C(e){return String(e??``).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function w(e){return String(e??``).replace(/"/g,`&quot;`)}function T(e,t){return`<span data-ref-id="${w(e.id)}" data-ref-kind="${w(e.kind)}"${t?.tone?` data-ref-tone="${w(t.tone)}"`:``} contenteditable="false">${C(t?.triggerChar??(e.kind===`user`?`@`:``))}${C(e.label)}</span>&nbsp;`}function E(e){let t=[];if(!e)return t;let n=new Set;b.lastIndex=0;let r;for(;(r=b.exec(e))!==null;){let[e,,i,a]=r;if(n.has(i))continue;n.add(i);let o=e.match(x)?.[1]??i.split(`:`)[0]??``,s=(a??``).replace(/<[^>]*>/g,``).replace(/&nbsp;/g,` `).replace(S,``).trim();t.push({id:i,kind:o,label:s})}return t}function D(e){if(!e)return[];let t=[],n=0;b.lastIndex=0;let r;for(;(r=b.exec(e))!==null;){let[i,,a]=r,o=e.slice(n,r.index);o.length>0&&t.push({kind:`html`,value:o}),t.push({kind:`mention`,refId:a,fallback:i}),n=r.index+i.length}let i=e.slice(n);return i.length>0&&t.push({kind:`html`,value:i}),t}function O(e){return!!(e&&e.name===`AbortError`)}function k(e={}){let{resources:t,onResourceSearch:r,initialMentions:i,debounceMs:a=300,onError:o}=e,c=JSON.stringify(Object.keys(t??{})),l=(0,s.useMemo)(()=>JSON.parse(c),[c]),[u,d]=(0,s.useState)(()=>l[0]??null),f=u&&l.includes(u)?u:l[0]??null,[p,m]=(0,s.useState)(!1),[h,g]=(0,s.useState)(``),[_,v]=(0,s.useState)({}),[y,b]=(0,s.useState)(!1),[x,S]=(0,s.useState)(null),[C,w]=(0,s.useState)({}),[T,E]=(0,s.useState)(0),[D,k]=(0,s.useState)(()=>i?[...i]:[]),A=(0,s.useRef)(0),j=(0,s.useRef)(null),M=(0,s.useRef)(t),N=(0,s.useRef)(r),P=(0,s.useRef)(o);(0,s.useEffect)(()=>{M.current=t,N.current=r,P.current=o});let F=(0,s.useMemo)(()=>f&&t?t[f]??null:null,[f,t]),I=(0,s.useCallback)(async(e,t,n)=>{let r=M.current?.[e];if(r?.search)return(await r.search(t,{kind:e,signal:n})).map(t=>({...t,kind:e}));if(r?.suggestions){let n=r.suggestions;return(t.trim().length===0?n:n.filter(e=>e.label.toLowerCase().includes(t.toLowerCase()))).map(t=>({...t,kind:e}))}return N.current?(await N.current(t,e,{kind:e,signal:n})).map(t=>({...t,kind:e})):[]},[]),L=n.t((e,t,n,r)=>{(async()=>{b(!0);try{let i=await Promise.all(e.map(async e=>{try{return{kind:e,list:await I(e,t,r),error:null}}catch(t){return{kind:e,list:[],error:t}}}));if(n!==A.current||r.aborted)return;let a={},o={},s=null;for(let e of i)a[e.kind]=e.list,e.error!==null&&!O(e.error)&&(o[e.kind]=e.error,s??=e.error,P.current?.(e.error,{query:t,kind:e.kind}));v(a),w(o),S(s)}finally{n===A.current&&!r.aborted&&b(!1)}})()},a);(0,s.useEffect)(()=>{let e=new AbortController;j.current=e;let t=()=>{e.abort(),j.current===e&&(j.current=null)};if(l.length===0)return v({}),b(!1),S(null),w({}),t;let n=++A.current;return S(null),w({}),L(l,h,n,e.signal),()=>{L.cancel(),t()}},[l,h,T,L]);let R=(0,s.useCallback)(()=>E(e=>e+1),[]);(0,s.useEffect)(()=>{if(p||!f||(_[f]?.length??0)>0)return;let e=l.find(e=>(_[e]?.length??0)>0);e&&e!==f&&d(e)},[f,l,p,_]);let z=(0,s.useCallback)(e=>d(e),[]),B=(0,s.useCallback)(e=>g(e),[]),V=(0,s.useCallback)(e=>{k(t=>t.some(t=>t.id===e.id)?t:[...t,e])},[]),H=(0,s.useCallback)(e=>{k(t=>t.filter(t=>t.id!==e))},[]),U=(0,s.useCallback)(e=>k(t=>typeof e==`function`?[...e(t)]:[...e]),[]),W=(0,s.useCallback)(()=>{j.current?.abort(),A.current++,k([]),g(``),m(!1),v({}),b(!1),S(null),w({})},[]),G=(0,s.useCallback)(e=>{let n=e.kind??f,r={id:`${n}:${e.id}`,kind:n,label:e.label,href:e.href??t?.[n]?.buildHref?.(e),data:e.data};return V(r),r},[f,V,t]);return{kinds:l,activeKind:f,setActiveKind:z,activeResource:F,query:h,setQuery:B,suggestions:(0,s.useMemo)(()=>f?_[f]??[]:[],[f,_]),suggestionsByKind:_,isLoading:y,error:x,isError:x!==null,errorsByKind:C,retry:R,mentions:D,addMention:V,removeMention:H,setMentions:U,reset:W,selectSuggestion:G,manualKindOverride:p,setManualKindOverride:m}}var A=e=>e.replace(/[.*+?^${}()|[\]\\^-]/g,`\\$&`);function j(e={}){let{resources:t,editorRef:n}=e,r=e.onResourceSearch,i=k({...e,resources:t,onResourceSearch:r}),[a,o]=(0,s.useState)(!1),[c,l]=(0,s.useState)(!1),u=(0,s.useRef)(null),d=(0,s.useRef)(null),f=(0,s.useRef)(null),p=(0,s.useCallback)(e=>{o(e),f.current=e?null:n?.current?.getCaretContext()?.textBefore??null,e||(u.current=null,d.current=null,l(!1),i.setManualKindOverride(!1))},[i,n]),m=(0,s.useCallback)(()=>{if(!t)return;let e={};for(let[n,r]of Object.entries(t)){let t=r?.trigger;typeof t==`string`&&t.length>0&&(e[t]=n)}if(Object.keys(e).length===0)return;let r=n?.current?.getCaretContext(),a=()=>{u.current&&(u.current=null,p(!1))};if(!r){a();return}if(f.current===r.textBefore)return;f.current=null;let s=Object.keys(e).map(A).join(``),c=RegExp(`(?:^|\\s)([${s}])([\\p{L}\\p{N}_-]*)$`,`u`),m=r.textBefore.match(c);if(!m){a();return}let h=m[1],g=m[2]??``,_=e[h];u.current={kind:_,triggerChar:h,consumedLength:h.length+g.length},l(!0),d.current!==h&&(i.activeKind!==_&&i.setActiveKind(_),i.setManualKindOverride(!1),d.current=h),i.query!==g&&i.setQuery(g),o(!0)},[n,t,i,p]),h=(0,s.useCallback)(e=>{let r=i.selectSuggestion(e),a=u.current,o=T(r,{triggerChar:a?.triggerChar,tone:t?.[r.kind]?.tone}),s=n?.current;return s&&(a&&a.consumedLength>0?(s.replaceBeforeCaret(a.consumedLength,o),u.current=null):s.insertHTML(o)),p(!1),r},[n,t,i,p]);return{...i,pickerOpen:a,setPickerOpen:p,triggerActive:c,handleCaretChange:m,pickSuggestion:h}}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return p}});
1
+ const e=require("./typography-Cf5zEv4y.cjs"),t=require("./item-BxPJsxh2.cjs"),n=require("./use-debounced-callback-BiZB-QB2.cjs"),r=require("./avatar-b2IaEzda.cjs"),i=require("./popover-rLMSEj5V.cjs"),a=require("./command-Geb5eIzu.cjs"),o=require("./spinner-ChYwza6q.cjs");let s=require("react"),c=require("react/jsx-runtime"),l=require("hast-util-from-html"),u=require("clsx");function d({mention:e,resource:t,asLink:n=!0,onClick:r,trailing:i,className:a,...o}){if(t?.renderChip)return(0,c.jsx)(c.Fragment,{children:t.renderChip(e)});let s=t?.icon,l=t?.tone,d=(0,c.jsxs)(c.Fragment,{children:[!!s&&(0,c.jsx)(s,{}),e.label,i]}),f={"data-ref-id":e.id,"data-ref-kind":e.kind,"data-ref-tone":l,className:(0,u.clsx)(`mention-chip--component`,a)};return n&&e.href?(0,c.jsx)(`a`,{...f,href:e.href,target:`_blank`,rel:`noreferrer noopener`,onClick:r,children:d}):(0,c.jsx)(`span`,{...f,onClick:r,...o,children:d})}function f({html:t,mentions:n,resources:r,renderMention:i,sanitizer:a,...o}){let u=(0,s.useMemo)(()=>a?a(t??``):e.n(t??``),[t,a]),f=(0,s.useMemo)(()=>{let e=new Map;for(let t of n??[])e.set(t.id,t);return e},[n]),p=(0,s.useMemo)(()=>(0,l.fromHtml)(u,{fragment:!0}),[u]);if(!u)return null;function m(e,t){if(e.type===`text`)return e.value;if(e.type!==`element`)return null;let n=e.properties.dataRefId,a=typeof n==`string`?f.get(n):void 0;if(a&&(e.tagName===`span`||e.tagName===`a`))return(0,s.createElement)(s.Fragment,{key:t},i?i(a):(0,c.jsx)(d,{mention:a,resource:r?.[a.kind]}));let o={key:t};for(let[t,n]of Object.entries(e.properties)){let e=t.startsWith(`data`)?t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`):t;o[e]=Array.isArray(n)?n.join(` `):n}return(0,s.createElement)(e.tagName,o,...e.children.length?e.children.map((e,n)=>m(e,`${t}-${n}`)):[])}return(0,c.jsx)(e.t,{...o,children:p.children.map((e,t)=>m(e,String(t)))})}var p={title:`Insert reference`,formatQuery:e=>`\u201c${e}\u201d`,empty:`No matches.`,loading:`Searching…`,listLabel:`Reference suggestions`},m={...p,searchPlaceholder:`Search…`},h={panel:`mentions__panel___UnLzV`,panelInline:`mentions__panelInline___7ohA_`,panelHeader:`mentions__panelHeader___Knvg3`,panelQuery:`mentions__panelQuery___vDLi5`,tabs:`mentions__tabs___p8mVm`,tab:`mentions__tab___PvBzn`,list:`mentions__list___Lu9gd`,listState:`mentions__listState___JLYq1`,row:`mentions__row___cbg34`,rowIcon:`mentions__rowIcon___Z1goN`,rowText:`mentions__rowText___wAv05`,command:`mentions__command___n2D38`,commandList:`mentions__commandList___1GF_A`};function g({kinds:t,activeKind:n,onSelect:r,resources:i,suggestionsByKind:a,focusable:o=!0}){return t.length<=1?null:(0,c.jsx)(`div`,{className:(0,u.clsx)(`mention-kind-tabs--component`,h.tabs),role:`tablist`,children:t.map(s=>{let l=i?.[s],u=s===n,d=a?.[s]?.length??0;return(0,c.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":u,tabIndex:o&&u?0:-1,onKeyDown:e=>{if(![`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key))return;e.preventDefault();let n=t.indexOf(s),i=e.key===`Home`?0:e.key===`End`?t.length-1:(n+(e.key===`ArrowRight`?1:-1)+t.length)%t.length,a=t[i];a!==void 0&&r(a),(e.currentTarget.parentElement?.querySelectorAll(`[role=tab]`)[i])?.focus()},"data-active":u||void 0,"data-empty":d===0||void 0,onClick:()=>r(s),className:h.tab,children:[(0,c.jsx)(e.o,{tag:`span`,weight:`medium`,type:`inherit`,children:l?.label??String(s)}),d>0&&(0,c.jsx)(e.o,{tag:`span`,size:`xs`,weight:`medium`,type:`inherit`,numeric:!0,children:d})]},s)})})}function _({suggestions:n,activeKind:i,loading:l,loadingLabel:d,emptyLabel:f,listLabel:p,onSelect:m,className:g,resources:_,command:v=!1,activeIndex:y,onActiveIndexChange:b,focusable:x=!0,id:S}){let[C,w]=(0,s.useState)(0),T=Math.min(y??C,Math.max(0,n.length-1)),E=e=>{w(e),b?.(e)};return l?(0,c.jsx)(`div`,{id:S,className:(0,u.clsx)(`mention-rows--component`,h.list,h.listState,g),children:(0,c.jsx)(o.t,{label:d})}):n.length===0?(0,c.jsx)(`div`,{id:S,role:`status`,className:(0,u.clsx)(`mention-rows--component`,h.list,h.listState,g),children:(0,c.jsx)(e.o,{type:`secondary`,children:f})}):(0,c.jsx)(`div`,{id:S,role:v?void 0:`listbox`,"aria-label":v?void 0:p,className:(0,u.clsx)(`mention-rows--component`,h.list,g),children:n.map((o,s)=>{let l=o.kind??i??``,u=o.icon??_?.[l]?.icon,d=(0,c.jsxs)(c.Fragment,{children:[o.avatar?(0,c.jsxs)(r.r,{size:`sm`,children:[(0,c.jsx)(r.c,{src:o.avatar,alt:``}),(0,c.jsx)(r.a,{children:o.label.slice(0,1)})]}):!!u&&(0,c.jsx)(u,{className:h.rowIcon}),(0,c.jsxs)(`span`,{className:h.rowText,children:[(0,c.jsx)(e.o,{tag:`span`,weight:`medium`,truncate:!0,children:o.label}),!!o.description&&(0,c.jsx)(e.o,{tag:`span`,size:`xs`,type:`secondary`,truncate:!0,children:o.description})]})]}),f=`${l}:${o.id}`;return v?(0,c.jsx)(a.o,{value:f,onSelect:()=>m(o),className:h.row,"data-suggestion-id":f,children:d},f):(0,c.jsx)(t.t,{id:S?`${S}-${s}`:void 0,render:(0,c.jsx)(`button`,{type:`button`}),role:`option`,"aria-selected":T===s,tabIndex:x&&T===s?0:-1,"data-suggestion-id":f,className:h.row,onPointerMove:()=>E(s),onFocus:()=>E(s),onClick:()=>m(o),onKeyDown:e=>{if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;e.preventDefault();let t=(s+(e.key===`ArrowDown`?1:-1)+n.length)%n.length;E(t),(e.currentTarget.parentElement?.querySelectorAll(`[role=option]`)[t])?.focus()},children:d},f)})})}function v({open:t,activeKind:n,setActiveKind:r,kinds:o,resources:s,suggestionsByKind:l,query:d,setQuery:f,suggestions:p,loading:v,onSelect:y,strings:b,className:x}){let S={...m,...b};return t?(0,c.jsxs)(i.r,{align:`start`,inset:`flush`,width:void 0,"aria-label":S.title,className:(0,u.clsx)(`mention-picker--component`,h.panel,x),children:[(0,c.jsxs)(`div`,{className:h.panelHeader,children:[(0,c.jsx)(`div`,{className:`sr-only`,children:(0,c.jsx)(e.o,{size:`xs`,weight:`medium`,type:`secondary`,children:S.title})}),(0,c.jsx)(g,{kinds:o,activeKind:n,resources:s,suggestionsByKind:l,onSelect:r})]}),(0,c.jsxs)(a.t,{shouldFilter:!1,className:h.command,children:[(0,c.jsx)(a.a,{autoFocus:!0,"aria-label":S.searchPlaceholder,placeholder:S.searchPlaceholder,value:d,onValueChange:f}),(0,c.jsx)(a.s,{"aria-label":S.listLabel,className:h.commandList,children:(0,c.jsx)(_,{command:!0,resources:s,suggestions:p,activeKind:n,loading:v,loadingLabel:S.loading,emptyLabel:S.empty,listLabel:S.listLabel,onSelect:y})})]})]}):null}function y({open:t,activeKind:n,setActiveKind:r,kinds:i,resources:a,suggestionsByKind:o,suggestions:l,loading:d,query:f,onManualKindChange:m,onSelect:v,onDismiss:y,strings:b,className:x}){let S={...p,...b},C=(0,s.useRef)(null),[w,T]=(0,s.useState)(`bottom`),E=(0,s.useId)(),D=`${n}:${f??``}:${l.map(e=>e.id).join(`,`)}`,[O,k]=(0,s.useState)({key:``,index:0}),[A,j]=(0,s.useState)(null),M=t&&A!==D,N=O.key===D?Math.min(O.index,Math.max(0,l.length-1)):0;return!t&&A!==null&&j(null),(0,s.useEffect)(()=>{if(!M)return;let e=C.current?.ownerDocument.activeElement;if(!e?.matches(`[contenteditable=true], textarea, input`))return;let t={"aria-controls":E,"aria-autocomplete":`list`,"aria-activedescendant":l.length&&!d?`${E}-${N}`:``},n=Object.fromEntries(Object.keys(t).map(t=>[t,e.getAttribute(t)]));for(let[n,r]of Object.entries(t))e.setAttribute(n,r);let r=()=>{j(D),y?.()},i=e=>{if(!(e.isComposing||e.keyCode===229)){if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),r();return}if(!(d||l.length===0)){if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation();let t=(N+(e.key===`ArrowDown`?1:-1)+l.length)%l.length;k({key:D,index:t}),C.current?.querySelectorAll(`[role=option]`)[t]?.scrollIntoView({block:`nearest`})}else if(e.key===`Enter`){let t=l[N];t&&(e.preventDefault(),e.stopPropagation(),v(t))}}}};return e.addEventListener(`keydown`,i,!0),e.addEventListener(`blur`,r),()=>{e.removeEventListener(`keydown`,i,!0),e.removeEventListener(`blur`,r);for(let[t,r]of Object.entries(n))r===null?e.removeAttribute(t):e.setAttribute(t,r)}},[M,N,E,D,d,y,v,l]),(0,s.useLayoutEffect)(()=>{if(!M){T(`bottom`);return}let e=C.current;if(!e)return;let t=()=>{let t=e.offsetParent;if(!t)return;let n=t.getBoundingClientRect(),r=e.offsetHeight,i=window.visualViewport,a=i?.offsetTop??0,o=a+(i?.height??window.innerHeight)-n.bottom,s=n.top-a,c=r>o&&s>o?`top`:`bottom`;T(c);let l=getComputedStyle(e),u=(Number.parseFloat(l.marginTop)||0)+(Number.parseFloat(l.marginBottom)||0);e.style.setProperty(`--mention-available-height`,`${Math.max(0,(c===`top`?s:o)-u*2)}px`)};t(),window.addEventListener(`resize`,t),window.addEventListener(`scroll`,t,!0);let n=new ResizeObserver(t);return n.observe(e),window.visualViewport?.addEventListener(`resize`,t),()=>{window.removeEventListener(`resize`,t),window.removeEventListener(`scroll`,t,!0),n.disconnect(),window.visualViewport?.removeEventListener(`resize`,t)}},[M,l,n]),M?(0,c.jsxs)(`div`,{ref:C,"data-placement":w,onMouseDown:e=>e.preventDefault(),className:(0,u.clsx)(`mention-inline-suggestions--component`,h.panel,h.panelInline,x),children:[(0,c.jsxs)(`div`,{className:h.panelHeader,children:[(0,c.jsxs)(`div`,{className:`sr-only`,children:[(0,c.jsx)(e.o,{size:`xs`,weight:`medium`,type:`secondary`,children:S.title}),!!f&&(0,c.jsx)(e.o,{size:`xs`,type:`secondary`,className:h.panelQuery,children:S.formatQuery(f)})]}),(0,c.jsx)(g,{focusable:!1,kinds:i,activeKind:n,resources:a,suggestionsByKind:o,onSelect:e=>{r(e),m?.()}})]}),(0,c.jsx)(_,{id:E,resources:a,focusable:!1,activeIndex:N,onActiveIndexChange:e=>k({key:D,index:e}),suggestions:l,activeKind:n,loading:d,loadingLabel:S.loading,emptyLabel:S.empty,listLabel:S.listLabel,onSelect:v})]}):null}var b=RegExp(`<((?:span|a))\\b[^>]*?data-ref-id\\s*=\\s*"([^"]+)"[^>]*?>([\\s\\S]*?)<\\/\\1>`,`gi`),x=/data-ref-kind\s*=\s*"([^"]+)"/i,S=/^[@#$&%!~]\s*/;function C(e){return String(e??``).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function w(e){return String(e??``).replace(/"/g,`&quot;`)}function T(e,t){return`<span data-ref-id="${w(e.id)}" data-ref-kind="${w(e.kind)}"${t?.tone?` data-ref-tone="${w(t.tone)}"`:``} contenteditable="false">${C(t?.triggerChar??(e.kind===`user`?`@`:``))}${C(e.label)}</span>&nbsp;`}function E(e){let t=[];if(!e)return t;let n=new Set;b.lastIndex=0;let r;for(;(r=b.exec(e))!==null;){let[e,,i,a]=r;if(n.has(i))continue;n.add(i);let o=e.match(x)?.[1]??i.split(`:`)[0]??``,s=(a??``).replace(/<[^>]*>/g,``).replace(/&nbsp;/g,` `).replace(S,``).trim();t.push({id:i,kind:o,label:s})}return t}function D(e){if(!e)return[];let t=[],n=0;b.lastIndex=0;let r;for(;(r=b.exec(e))!==null;){let[i,,a]=r,o=e.slice(n,r.index);o.length>0&&t.push({kind:`html`,value:o}),t.push({kind:`mention`,refId:a,fallback:i}),n=r.index+i.length}let i=e.slice(n);return i.length>0&&t.push({kind:`html`,value:i}),t}function O(e){return!!(e&&e.name===`AbortError`)}function k(e={}){let{resources:t,onResourceSearch:r,initialMentions:i,debounceMs:a=300,onError:o}=e,c=JSON.stringify(Object.keys(t??{})),l=(0,s.useMemo)(()=>JSON.parse(c),[c]),[u,d]=(0,s.useState)(()=>l[0]??null),f=u&&l.includes(u)?u:l[0]??null,[p,m]=(0,s.useState)(!1),[h,g]=(0,s.useState)(``),[_,v]=(0,s.useState)({}),[y,b]=(0,s.useState)(!1),[x,S]=(0,s.useState)(null),[C,w]=(0,s.useState)({}),[T,E]=(0,s.useState)(0),[D,k]=(0,s.useState)(()=>i?[...i]:[]),A=(0,s.useRef)(0),j=(0,s.useRef)(null),M=(0,s.useRef)(t),N=(0,s.useRef)(r),P=(0,s.useRef)(o);(0,s.useEffect)(()=>{M.current=t,N.current=r,P.current=o});let F=(0,s.useMemo)(()=>f&&t?t[f]??null:null,[f,t]),I=(0,s.useCallback)(async(e,t,n)=>{let r=M.current?.[e];if(r?.search)return(await r.search(t,{kind:e,signal:n})).map(t=>({...t,kind:e}));if(r?.suggestions){let n=r.suggestions;return(t.trim().length===0?n:n.filter(e=>e.label.toLowerCase().includes(t.toLowerCase()))).map(t=>({...t,kind:e}))}return N.current?(await N.current(t,e,{kind:e,signal:n})).map(t=>({...t,kind:e})):[]},[]),L=n.t((e,t,n,r)=>{(async()=>{b(!0);try{let i=await Promise.all(e.map(async e=>{try{return{kind:e,list:await I(e,t,r),error:null}}catch(t){return{kind:e,list:[],error:t}}}));if(n!==A.current||r.aborted)return;let a={},o={},s=null;for(let e of i)a[e.kind]=e.list,e.error!==null&&!O(e.error)&&(o[e.kind]=e.error,s??=e.error,P.current?.(e.error,{query:t,kind:e.kind}));v(a),w(o),S(s)}finally{n===A.current&&!r.aborted&&b(!1)}})()},a);(0,s.useEffect)(()=>{let e=new AbortController;j.current=e;let t=()=>{e.abort(),j.current===e&&(j.current=null)};if(l.length===0)return v({}),b(!1),S(null),w({}),t;let n=++A.current;return S(null),w({}),L(l,h,n,e.signal),()=>{L.cancel(),t()}},[l,h,T,L]);let R=(0,s.useCallback)(()=>E(e=>e+1),[]);(0,s.useEffect)(()=>{if(p||!f||(_[f]?.length??0)>0)return;let e=l.find(e=>(_[e]?.length??0)>0);e&&e!==f&&d(e)},[f,l,p,_]);let z=(0,s.useCallback)(e=>d(e),[]),B=(0,s.useCallback)(e=>g(e),[]),V=(0,s.useCallback)(e=>{k(t=>t.some(t=>t.id===e.id)?t:[...t,e])},[]),H=(0,s.useCallback)(e=>{k(t=>t.filter(t=>t.id!==e))},[]),U=(0,s.useCallback)(e=>k(t=>typeof e==`function`?[...e(t)]:[...e]),[]),W=(0,s.useCallback)(()=>{j.current?.abort(),A.current++,k([]),g(``),m(!1),v({}),b(!1),S(null),w({})},[]),G=(0,s.useCallback)(e=>{let n=e.kind??f,r={id:`${n}:${e.id}`,kind:n,label:e.label,href:e.href??t?.[n]?.buildHref?.(e),data:e.data};return V(r),r},[f,V,t]);return{kinds:l,activeKind:f,setActiveKind:z,activeResource:F,query:h,setQuery:B,suggestions:(0,s.useMemo)(()=>f?_[f]??[]:[],[f,_]),suggestionsByKind:_,isLoading:y,error:x,isError:x!==null,errorsByKind:C,retry:R,mentions:D,addMention:V,removeMention:H,setMentions:U,reset:W,selectSuggestion:G,manualKindOverride:p,setManualKindOverride:m}}var A=e=>e.replace(/[.*+?^${}()|[\]\\^-]/g,`\\$&`);function j(e={}){let{resources:t,editorRef:n}=e,r=e.onResourceSearch,i=k({...e,resources:t,onResourceSearch:r}),[a,o]=(0,s.useState)(!1),[c,l]=(0,s.useState)(!1),u=(0,s.useRef)(null),d=(0,s.useRef)(null),f=(0,s.useRef)(null),p=(0,s.useCallback)(e=>{o(e),f.current=e?null:n?.current?.getCaretContext()?.textBefore??null,e||(u.current=null,d.current=null,l(!1),i.setManualKindOverride(!1))},[i,n]),m=(0,s.useCallback)(()=>{if(!t)return;let e={};for(let[n,r]of Object.entries(t)){let t=r?.trigger;typeof t==`string`&&t.length>0&&(e[t]=n)}if(Object.keys(e).length===0)return;let r=n?.current?.getCaretContext(),a=()=>{u.current&&(u.current=null,p(!1))};if(!r){a();return}if(f.current===r.textBefore)return;f.current=null;let s=Object.keys(e).map(A).join(``),c=RegExp(`(?:^|\\s)([${s}])([\\p{L}\\p{N}_-]*)$`,`u`),m=r.textBefore.match(c);if(!m){a();return}let h=m[1],g=m[2]??``,_=e[h];u.current={kind:_,triggerChar:h,consumedLength:h.length+g.length},l(!0),d.current!==h&&(i.activeKind!==_&&i.setActiveKind(_),i.setManualKindOverride(!1),d.current=h),i.query!==g&&i.setQuery(g),o(!0)},[n,t,i,p]),h=(0,s.useCallback)(e=>{let r=i.selectSuggestion(e),a=u.current,o=T(r,{triggerChar:a?.triggerChar,tone:t?.[r.kind]?.tone}),s=n?.current;return s&&(a&&a.consumedLength>0?(s.replaceBeforeCaret(a.consumedLength,o),u.current=null):s.insertHTML(o)),p(!1),r},[n,t,i,p]);return{...i,pickerOpen:a,setPickerOpen:p,triggerActive:c,handleCaretChange:m,pickSuggestion:h}}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return p}});
@@ -1,11 +1,11 @@
1
1
  import "./css/mentions.css";
2
2
  import { t as e } from "./cx--CBrhWH0.js";
3
- import { n as t, o as n, t as r } from "./typography-B8Iurhy1.js";
4
- import { t as i } from "./item-OVu-oGxQ.js";
3
+ import { n as t, o as n, t as r } from "./typography-BkxEiwQ1.js";
4
+ import { t as i } from "./item-C7Wfarcx.js";
5
5
  import { t as a } from "./use-debounced-callback-BcKYwxqp.js";
6
- import { a as o, c as s, r as c } from "./avatar-2v-o_zEv.js";
7
- import { r as l } from "./popover-Dt8IXXKy.js";
8
- import { a as u, o as d, s as f, t as p } from "./command-DWZf3CPI.js";
6
+ import { a as o, c as s, r as c } from "./avatar-C30TNJoy.js";
7
+ import { r as l } from "./popover-CM1nxkAM.js";
8
+ import { a as u, o as d, s as f, t as p } from "./command-Dv84KSRv.js";
9
9
  import { t as m } from "./spinner-Bv-2R-7S.js";
10
10
  import { Fragment as h, createElement as g, useCallback as _, useEffect as v, useId as y, useLayoutEffect as b, useMemo as x, useRef as S, useState as C } from "react";
11
11
  import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
@@ -1,16 +1,16 @@
1
1
  import "./css/navigation.css";
2
2
  import { t as e } from "./cvm-DtsCA8iZ.js";
3
3
  import { t } from "./cx--CBrhWH0.js";
4
- import { a as n, i as r, o as i } from "./typography-B8Iurhy1.js";
5
- import { c as a } from "./buttons-Corm-KHK.js";
6
- import { a as o, g as s, r as c, t as l } from "./dropdown-menu-CIXxWTpw.js";
7
- import { d as u, m as d, v as f } from "./display-DVhYS75K.js";
4
+ import { a as n, i as r, o as i } from "./typography-BkxEiwQ1.js";
5
+ import { c as a } from "./buttons-riLAPVQV.js";
6
+ import { a as o, g as s, r as c, t as l } from "./dropdown-menu-BdgB__AC.js";
7
+ import { d as u, m as d, v as f } from "./display-Dehpw83R.js";
8
8
  import { t as p } from "./badge-D34FkKLD.js";
9
9
  import { i as m, t as h } from "./observers-CKohiJqU.js";
10
10
  import { t as g } from "./strings-Co9_qArR.js";
11
11
  import { n as _, t as v } from "./scroll-edges-CWjEJktN.js";
12
12
  import { n as y } from "./navigation-Db1UQSIU.js";
13
- import { r as b } from "./choice-inputs-Ca9PoQwa.js";
13
+ import { r as b } from "./choice-inputs-BjZYCdzk.js";
14
14
  import { CheckIcon as x, ChevronLeftIcon as S, ChevronRightIcon as C, GlobeIcon as w } from "lucide-react";
15
15
  import * as T from "react";
16
16
  import { useId as E, useRef as D } from "react";
@@ -259,6 +259,7 @@ function U({ items: e, separator: n, label: r, strings: a, className: o, ...s })
259
259
  let o = a === e.length - 1, s = o ? /* @__PURE__ */ k(i, {
260
260
  tag: "span",
261
261
  size: "sm",
262
+ weight: "medium",
262
263
  className: F.breadcrumbCurrent,
263
264
  "aria-current": "page",
264
265
  children: r.label
@@ -0,0 +1 @@
1
+ const e=require("./rolldown-runtime-BocRIvOZ.cjs"),t=require("./typography-Cf5zEv4y.cjs"),n=require("./primitives-kywiHMJE.cjs"),r=require("./badge-BRX7GXRH.cjs"),i=require("./item-BxPJsxh2.cjs"),a=require("./observers-jagR5BK7.cjs"),o=require("./strings-BiKL6k6b.cjs"),s=require("./timeline-CzAIDLzd.cjs"),c=require("./navigation-CnYYy8iw.cjs");let l=require("lucide-react"),u=require("react");u=e.t(u,1);let d=require("react/jsx-runtime"),f=require("clsx");var p={sideNav:`navigation__sideNav___7Qdq3`,group:`navigation__group___JA2AL`,groupLabel:`navigation__groupLabel___HK5ir`,groupLabelStatic:`navigation__groupLabelStatic___AzoAh`,groupChevron:`navigation__groupChevron___rViKW`,list:`navigation__list___vrt8O`,item:`navigation__item___-8yPf`,itemIcon:`navigation__itemIcon___Cfwcd`,itemLabel:`navigation__itemLabel___gr0xG`,sectionNav:`navigation__sectionNav___roPOp`,sectionItem:`navigation__sectionItem___d9CTa`,sectionItemNested:`navigation__sectionItemNested___se_7O`,categoryNav:`navigation__categoryNav___QFLi8`,categoryRow:`navigation__categoryRow___Ia7R-`,categoryChevron:`navigation__categoryChevron___lcrYi`,progress:`navigation__progress___e-Uqw`,progressHead:`navigation__progressHead___6HTAe`},m={step:(e,t,n)=>n===`completed`?`Step ${e}: ${t}, completed`:`Step ${e}: ${t}`,position:(e,t)=>`Step ${e} of ${t}`},h={label:`On this page`},g={label:`Section navigation`},_=e=>typeof e==`string`||typeof e==`number`;function v(e,t){if(t)return c.n(t,e.map(e=>e.href))}function y({items:e,groups:n,currentPath:i,renderLink:a,strings:o,className:s,...c}){let m={...g,...o},h=n??[{id:`default`,items:e??[]}],y=v(h.flatMap(e=>e.items),i),[b,x]=u.useState(()=>new Set(h.filter(e=>e.defaultCollapsed).map(e=>e.id))),S=e=>x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,d.jsx)(`nav`,{"aria-label":m.label,"data-slot":`side-nav`,className:(0,f.clsx)(`side-nav--component`,p.sideNav,s),...c,children:h.map(e=>{let n=b.has(e.id);return(0,d.jsxs)(`div`,{className:p.group,"data-collapsed":e.collapsible&&n?``:void 0,children:[!!e.label&&(e.collapsible?(0,d.jsxs)(`button`,{type:`button`,className:p.groupLabel,"data-hit-area":!0,"aria-expanded":!n,onClick:()=>S(e.id),children:[e.label,(0,d.jsx)(l.ChevronDownIcon,{"aria-hidden":!0,className:p.groupChevron})]}):(0,d.jsx)(t.o,{tag:`span`,size:`xs`,weight:`medium`,type:`secondary`,className:p.groupLabelStatic,children:e.label})),(0,d.jsx)(`ul`,{className:p.list,children:e.items.map(e=>{let t=e.href===y,n=(0,d.jsxs)(d.Fragment,{children:[!!e.icon&&(0,d.jsx)(e.icon,{"aria-hidden":!0,className:p.itemIcon}),(0,d.jsx)(`span`,{className:p.itemLabel,children:e.label}),_(e.badge)?(0,d.jsx)(r.t,{tone:`neutral`,children:e.badge}):e.badge]}),i={href:e.href,className:p.item,children:n,"aria-current":t?`page`:void 0,"aria-disabled":e.disabled||void 0};return(0,d.jsx)(`li`,{children:a?a(i):(0,d.jsx)(`a`,{...i})},e.href)})})]},e.id)})})}function b({items:e,rootMargin:t=`-10% 0px -70% 0px`,onSelect:n,strings:r,className:i,...o}){let s={...h,...r},[c,l]=u.useState(e[0]?.id),m=e.map(e=>e.id).join(`|`);return u.useEffect(()=>{if(typeof IntersectionObserver>`u`)return;let e=m.split(`|`).filter(Boolean).map(e=>document.getElementById(e)).filter(e=>e!==null);if(e.length!==0)return a.n(e,e=>{let t=e.filter(e=>e.isIntersecting).sort((e,t)=>e.boundingClientRect.top-t.boundingClientRect.top);t[0]&&l(t[0].target.id)},{rootMargin:t})},[m,t]),(0,d.jsx)(`nav`,{"aria-label":s.label,"data-slot":`section-nav`,className:(0,f.clsx)(`section-nav--component`,p.sectionNav,i),...o,children:e.map(e=>(0,d.jsx)(`a`,{href:`#${e.id}`,"aria-current":e.id===c?`true`:void 0,className:(0,f.clsx)(p.sectionItem,(e.depth??1)>1&&p.sectionItemNested),onClick:()=>n?.(e.id),children:e.label},e.id))})}function x({label:e,items:t,activeId:n,onSelect:a,className:o,...s}){return(0,d.jsx)(`nav`,{"data-slot":`category-nav`,"aria-label":e,className:(0,f.clsx)(`category-nav--component`,p.categoryNav,o),...s,children:(0,d.jsx)(i.o,{children:t.map(e=>{let t=e.icon,o=e.id===n;return(0,d.jsxs)(i.t,{render:(0,d.jsx)(`button`,{type:`button`}),"aria-current":o||void 0,"data-active":o||void 0,onClick:()=>a?.(e.id),className:p.categoryRow,children:[!!t&&(0,d.jsx)(i.c,{variant:`icon`,children:(0,d.jsx)(t,{})}),(0,d.jsxs)(i.r,{children:[(0,d.jsx)(i.u,{children:e.label}),!!e.hint&&(0,d.jsx)(i.i,{children:e.hint})]}),(0,d.jsxs)(i.n,{children:[typeof e.count==`number`&&(0,d.jsx)(r.t,{tone:o?`primary`:`neutral`,children:e.count}),(0,d.jsx)(l.ChevronRightIcon,{"aria-hidden":!0,className:p.categoryChevron})]})]},e.id)})})})}function S({steps:e,currentIndex:r,onStepClick:i,strings:a,className:c,...l}){let u=o.t(m,a),h=e.length||1,g=e.map((e,t)=>{let n=t<r?`completed`:t===r?`current`:`upcoming`;return{id:e.id,label:e.label,hint:e.hint,status:n,accessibleName:u.step(t+1,typeof e.label==`string`?e.label:String(e.id),n)}});return(0,d.jsxs)(`div`,{"data-slot":`breadcrumb-progress`,className:(0,f.clsx)(`breadcrumb-progress--component`,p.progress,c),...l,children:[(0,d.jsxs)(`div`,{className:p.progressHead,children:[(0,d.jsx)(t.i,{children:u.position(r+1,h)}),(0,d.jsx)(n.T,{value:Math.round((r+1)/h*100),scaled:!0,size:`xs`,weight:`semibold`})]}),(0,d.jsx)(s.t,{variant:`trail`,steps:g,onStepClick:i})]})}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return S}});
@@ -1,12 +1,12 @@
1
1
  import "./css/navigation2.css";
2
2
  import { t as e } from "./cx--CBrhWH0.js";
3
- import { i as t, o as n } from "./typography-B8Iurhy1.js";
4
- import { T as r } from "./primitives-B2aeaudR.js";
3
+ import { i as t, o as n } from "./typography-BkxEiwQ1.js";
4
+ import { T as r } from "./primitives-BnXNg-Kr.js";
5
5
  import { t as i } from "./badge-D34FkKLD.js";
6
- import { c as a, i as o, n as s, o as c, r as l, t as u, u as d } from "./item-OVu-oGxQ.js";
6
+ import { c as a, i as o, n as s, o as c, r as l, t as u, u as d } from "./item-C7Wfarcx.js";
7
7
  import { n as f } from "./observers-CKohiJqU.js";
8
8
  import { t as p } from "./strings-Co9_qArR.js";
9
- import { t as m } from "./timeline-DskNs3lw.js";
9
+ import { t as m } from "./timeline-ptWoY2GY.js";
10
10
  import { n as h } from "./navigation-Db1UQSIU.js";
11
11
  import { ChevronDownIcon as g, ChevronRightIcon as _ } from "lucide-react";
12
12
  import * as v from "react";
@@ -52,30 +52,31 @@ function O({ items: t, groups: r, currentPath: a, renderLink: o, strings: s, cla
52
52
  "data-slot": "side-nav",
53
53
  className: e("side-nav--component", S.sideNav, c),
54
54
  ...l,
55
- children: d.map((t) => {
56
- let r = p.has(t.id);
55
+ children: d.map((e) => {
56
+ let t = p.has(e.id);
57
57
  return /* @__PURE__ */ x("div", {
58
58
  className: S.group,
59
- "data-collapsed": t.collapsible && r ? "" : void 0,
60
- children: [!!t.label && (t.collapsible ? /* @__PURE__ */ x("button", {
59
+ "data-collapsed": e.collapsible && t ? "" : void 0,
60
+ children: [!!e.label && (e.collapsible ? /* @__PURE__ */ x("button", {
61
61
  type: "button",
62
62
  className: S.groupLabel,
63
63
  "data-hit-area": !0,
64
- "aria-expanded": !r,
65
- onClick: () => h(t.id),
66
- children: [t.label, /* @__PURE__ */ b(g, {
64
+ "aria-expanded": !t,
65
+ onClick: () => h(e.id),
66
+ children: [e.label, /* @__PURE__ */ b(g, {
67
67
  "aria-hidden": !0,
68
68
  className: S.groupChevron
69
69
  })]
70
70
  }) : /* @__PURE__ */ b(n, {
71
71
  tag: "span",
72
72
  size: "xs",
73
+ weight: "medium",
73
74
  type: "secondary",
74
- className: e(S.groupLabel, S.groupLabelStatic),
75
- children: t.label
75
+ className: S.groupLabelStatic,
76
+ children: e.label
76
77
  })), /* @__PURE__ */ b("ul", {
77
78
  className: S.list,
78
- children: t.items.map((e) => {
79
+ children: e.items.map((e) => {
79
80
  let t = e.href === f, n = /* @__PURE__ */ x(y, { children: [
80
81
  !!e.icon && /* @__PURE__ */ b(e.icon, {
81
82
  "aria-hidden": !0,
@@ -99,7 +100,7 @@ function O({ items: t, groups: r, currentPath: a, renderLink: o, strings: s, cla
99
100
  return /* @__PURE__ */ b("li", { children: o ? o(r) : /* @__PURE__ */ b("a", { ...r }) }, e.href);
100
101
  })
101
102
  })]
102
- }, t.id);
103
+ }, e.id);
103
104
  })
104
105
  });
105
106
  }
@@ -142,6 +143,7 @@ function A({ label: t, items: n, activeId: r, onSelect: f, className: p, ...m })
142
143
  children: /* @__PURE__ */ b(c, { children: n.map((e) => {
143
144
  let t = e.icon, n = e.id === r;
144
145
  return /* @__PURE__ */ x(u, {
146
+ render: /* @__PURE__ */ b("button", { type: "button" }),
145
147
  "aria-current": n || void 0,
146
148
  "data-active": n || void 0,
147
149
  onClick: () => f?.(e.id),
@@ -0,0 +1 @@
1
+ const e=require("./rolldown-runtime-BocRIvOZ.cjs"),t=require("./cvm-CHrYqf6y.cjs"),n=require("./typography-Cf5zEv4y.cjs"),r=require("./buttons-Dwl42fIr.cjs"),i=require("./dropdown-menu-DCf_EqVG.cjs"),a=require("./display-CFj87iEn.cjs"),o=require("./badge-BRX7GXRH.cjs"),s=require("./observers-jagR5BK7.cjs"),c=require("./strings-BiKL6k6b.cjs"),l=require("./scroll-edges-CrUcSo-b.cjs"),u=require("./navigation-CnYYy8iw.cjs"),d=require("./choice-inputs-C8LMAkh8.cjs");let f=require("lucide-react"),p=require("react");p=e.t(p,1);let m=require("react/jsx-runtime"),h=require("clsx");var g={label:`Pagination`,previous:`Previous`,next:`Next`,morePages:`More pages`,page:e=>`Page ${e}`},_={label:`Breadcrumb`},v={label:`Language`},y={previous:`Scroll tabs backward`,next:`Scroll tabs forward`},b={tabs:`navigation__tabs___MoJyv`,tabRail:`navigation__tabRail___fkXu3`,tabScroll:`navigation__tabScroll___6MKV9`,tabList:`navigation__tabList___6fCJE`,tabListEnclosed:`navigation__tabListEnclosed___RpZu7`,tabsPill:`navigation__tabsPill___Ug0fU`,tab:`navigation__tab___o1EUP`,tabPanel:`navigation__tabPanel___aUaAn`,breadcrumb:`navigation__breadcrumb___eRfAg`,breadcrumbItem:`navigation__breadcrumbItem___shfye`,breadcrumbLink:`navigation__breadcrumbLink___zHDIh`,breadcrumbCurrent:`navigation__breadcrumbCurrent___9BQhW`,breadcrumbSeparator:`navigation__breadcrumbSeparator___2Okqy`,pagination:`navigation__pagination___QauKM`,paginationArrowWord:`navigation__paginationArrowWord___rmxzx`,paginationEllipsis:`navigation__paginationEllipsis___MEC8A`,pageHeading:`navigation__pageHeading___R7jSV`,pageHeadingCrumbs:`navigation__pageHeadingCrumbs___0JeR1`,pageHeadingRow:`navigation__pageHeadingRow___1SVff`,pageHeadingLeading:`navigation__pageHeadingLeading___Ydk6o`,pageHeadingMain:`navigation__pageHeadingMain___c9iIe`,pageHeadingGrid:`navigation__pageHeadingGrid___D0Ddi`,pageHeadingPrefix:`navigation__pageHeadingPrefix___Ef0P3`,pageHeadingBlock:`navigation__pageHeadingBlock___Wpd1x`,pageHeadingHeadline:`navigation__pageHeadingHeadline___8cftu`,pageHeadingActions:`navigation__pageHeadingActions___xyJOE`,pageHeadingTitleRow:`navigation__pageHeadingTitleRow___77qXV`,pageHeadingTitle:`navigation__pageHeadingTitle___wqE4c`,pageHeadingBadges:`navigation__pageHeadingBadges___ByzY3`,pageHeadingDescription:`navigation__pageHeadingDescription___cCQrC`,pageHeadingChildren:`navigation__pageHeadingChildren___0CTs2`,pageHeadingSeparator:`navigation__pageHeadingSeparator___yGoaX`,tabBar:`navigation__tabBar___WTgSO`,tabBarWrap:`navigation__tabBarWrap___kohcY`},x=p.createContext(null);function S(e){let t=p.useContext(x);if(!t)throw Error(`<${e}> must be used within <Tabs>`);return t}function C({value:e,defaultValue:t=``,onValueChange:n,className:r,children:i,...a}){let[o,s]=p.useState(t),c=e!==void 0,l=c?e:o,u=p.useId(),d=p.useCallback(e=>{c||s(e),n?.(e)},[c,n]),[f,g]=p.useState(()=>new Set),_=p.useCallback(e=>(g(t=>{let n=new Set(t);return n.add(e),n}),()=>g(t=>{let n=new Set(t);return n.delete(e),n})),[]),v=p.useMemo(()=>({value:l,setValue:d,id:u,panels:f,registerPanel:_}),[l,d,u,f,_]);return(0,m.jsx)(x.Provider,{value:v,children:(0,m.jsx)(`div`,{"data-slot":`tabs`,className:(0,h.clsx)(`tabs--component`,b.tabs,r),...a,children:i})})}var w=t.t(b.tabList,{variants:{variant:{underline:void 0,enclosed:b.tabListEnclosed,pill:b.tabsPill}},defaultVariants:{variant:`underline`}});function T({variant:e,label:t,edgeFade:n=!1,strings:i,className:o,children:u,ref:d,onKeyDown:g,onScroll:_,id:v,...x}){let C=p.useRef(null),T=p.useRef(null),E=p.useId(),D=v??E,{value:O}=S(`TabList`),k=c.t(y,i),[A,j]=p.useState({overflow:!1,previous:!1,next:!1});p.useImperativeHandle(d,()=>C.current);let M=p.useCallback(()=>{let e=C.current,t=T.current;if(!e||!t)return;let n=getComputedStyle(e),r=t.clientWidth-(parseFloat(n.marginLeft)||0)-(parseFloat(n.marginRight)||0),i=e.scrollWidth>r+1,{start:a,end:o}=l.t(e),s={overflow:i,previous:a,next:o};j(e=>e.overflow===s.overflow&&e.previous===s.previous&&e.next===s.next?e:s)},[]),N=p.useCallback(()=>{let e=C.current,t=e?.querySelector(`[role="tab"][aria-selected="true"]`);if(!e||!t)return;let r=e.getBoundingClientRect(),i=t.getBoundingClientRect(),a=getComputedStyle(e),o=n&&parseFloat(a.scrollPaddingInlineStart)||0,s=r.left+(parseFloat(a.paddingLeft)||0)+o,c=r.right-(parseFloat(a.paddingRight)||0)-o;i.left<s?e.scrollLeft+=i.left-s:i.right>c&&(e.scrollLeft+=i.right-c),M()},[n,M]);p.useEffect(()=>{let e=C.current,t=T.current;if(!e||!t)return;let n=()=>{M(),N()},r=s.i([t,e,...e.children],n);return n(),r},[u,M,N]),p.useEffect(N,[O,A.overflow,N]);let P=e=>{let t=C.current;if(!t)return;let n=getComputedStyle(t).direction===`rtl`?-1:1;t.scrollBy({left:e*n*t.clientWidth*.75,behavior:s.t(`(prefers-reduced-motion: reduce)`)?`instant`:`smooth`})};return(0,m.jsxs)(`div`,{ref:T,className:(0,h.clsx)(`tabs--rail`,b.tabRail),children:[A.overflow&&(0,m.jsx)(r.c,{iconOnly:!0,tone:`neutral`,buttonStyle:`ghost`,className:b.tabScroll,"aria-label":k.previous,"aria-controls":D,disabled:!A.previous,onClick:()=>P(-1),children:(0,m.jsx)(f.ChevronLeftIcon,{})}),(0,m.jsx)(a.m,{ref:C,id:D,tabIndex:-1,role:`tablist`,"aria-label":t,"data-slot":`tab-list`,"data-fade-start":n&&A.overflow&&A.previous?``:void 0,"data-fade-end":n&&A.overflow&&A.next?``:void 0,className:(0,h.clsx)(`tabs--list`,w({variant:e}),o),onKeyDown:e=>{if(g?.(e),e.defaultPrevented||![`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key))return;let t=[...C.current?.querySelectorAll(`[role="tab"]:not(:disabled)`)??[]];if(t.length===0)return;let n=t.indexOf(document.activeElement),r=n,i=getComputedStyle(e.currentTarget).direction===`rtl`;e.key===(i?`ArrowRight`:`ArrowLeft`)?r=n<=0?t.length-1:n-1:e.key===(i?`ArrowLeft`:`ArrowRight`)?r=n===t.length-1?0:n+1:e.key===`Home`?r=0:e.key===`End`&&(r=t.length-1),e.preventDefault(),t[r]?.focus({preventScroll:!0}),t[r]?.click()},onScroll:e=>{M(),_?.(e)},...x,children:u}),A.overflow&&(0,m.jsx)(r.c,{iconOnly:!0,tone:`neutral`,buttonStyle:`ghost`,className:b.tabScroll,"aria-label":k.next,"aria-controls":D,disabled:!A.next,onClick:()=>P(1),children:(0,m.jsx)(f.ChevronRightIcon,{})})]})}function E({value:e,className:t,onClick:n,...r}){let{value:i,setValue:a,id:o,panels:s}=S(`Tab`),c=i===e,l=c&&s.has(e)?`${o}-panel-${e}`:void 0;return(0,m.jsx)(`button`,{type:`button`,role:`tab`,id:`${o}-tab-${e}`,"aria-selected":c,"aria-controls":l,tabIndex:c?0:-1,"data-slot":`tab`,className:(0,h.clsx)(`tabs--tab`,b.tab,t),onClick:t=>{n?.(t),t.defaultPrevented||a(e)},...r})}function D({value:e,className:t,children:n,...r}){let{value:i,id:a,registerPanel:o}=S(`TabPanel`);return p.useEffect(()=>o(e),[o,e]),i===e?(0,m.jsx)(`div`,{role:`tabpanel`,id:`${a}-panel-${e}`,"aria-labelledby":`${a}-tab-${e}`,tabIndex:0,"data-slot":`tab-panel`,className:(0,h.clsx)(`tabs--panel`,b.tabPanel,t),...r,children:n}):null}function O({items:e,separator:t,label:r,strings:i,className:a,...o}){let s=c.t(_,i);return(0,m.jsx)(`nav`,{"aria-label":r??s.label,"data-slot":`breadcrumbs`,className:(0,h.clsx)(`breadcrumbs--component`,a),...o,children:(0,m.jsx)(`ol`,{className:b.breadcrumb,children:e.map((r,i)=>{let a=i===e.length-1,o=a?(0,m.jsx)(n.o,{tag:`span`,size:`sm`,weight:`medium`,className:b.breadcrumbCurrent,"aria-current":`page`,children:r.label}):r.render?p.cloneElement(r.render,{className:(0,h.clsx)(b.breadcrumbLink,r.render.props.className),children:r.label,"data-hit-area":``}):(0,m.jsx)(`a`,{href:r.href,"data-hit-area":!0,className:b.breadcrumbLink,children:(0,m.jsx)(n.o,{tag:`span`,size:`sm`,type:`inherit`,children:r.label})});return(0,m.jsxs)(`li`,{className:b.breadcrumbItem,children:[o,!a&&(0,m.jsx)(`span`,{className:b.breadcrumbSeparator,"aria-hidden":!0,children:t??(0,m.jsx)(f.ChevronRightIcon,{})})]},i)})})})}function k(e,t,n=1){if(t<=n*2+5)return Array.from({length:t},(e,t)=>t+1);let r=Math.max(e-n,1),i=Math.min(e+n,t),a=r>2,o=i<t-1,s=[1];a&&s.push(null);for(let e=Math.max(r,2);e<=Math.min(i,t-1);e++)s.push(e);return o&&s.push(null),s.push(t),s}function A({page:e,total:t,onPageChange:n,disabled:i=!1,siblings:o=1,labels:s=`responsive`,numbers:c=!0,renderLink:l,strings:u,className:d,..._}){let v={...g,...u},y=c?k(e,t,o):[],x=(e,{label:t,current:a,disabled:o,children:s,...c})=>{let u=i||o,d=t=>{if(u)return t.preventDefault();n(e)},f=a?`page`:void 0;if(l&&!u){let n=l(e,{"aria-label":t,"aria-current":f,onClick:d,children:s});return p.isValidElement(n)?(0,m.jsx)(r.c,{"aria-label":t,"aria-current":f,render:n,...c,children:s}):n}return(0,m.jsx)(r.c,{"aria-label":t,"aria-current":f,disabled:i||void 0,"aria-disabled":!i&&!!o||void 0,onClick:d,...c,children:s})},S=s!==`icon`,C=e=>s===`responsive`?(0,m.jsx)(`span`,{className:b.paginationArrowWord,children:e}):e;return(0,m.jsx)(`nav`,{"aria-label":v.label,"data-slot":`pagination`,className:(0,h.clsx)(`pagination--component`,d),..._,children:(0,m.jsxs)(`div`,{className:b.pagination,"data-labels":s,children:[x(e-1,{label:v.previous,disabled:e<=1,tone:`neutral`,buttonStyle:`ghost`,iconOnly:!S,children:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(f.ChevronLeftIcon,{}),S&&C(v.previous)]})}),y.map((t,n)=>t===null?(0,m.jsxs)(p.Fragment,{children:[(0,m.jsx)(`span`,{className:b.paginationEllipsis,"aria-hidden":!0,children:`…`}),(0,m.jsx)(a.d,{children:v.morePages})]},`gap-${n}`):(0,m.jsx)(p.Fragment,{children:x(t,{label:v.page(t),current:t===e,tone:`secondary`,buttonStyle:t===e?`outline`:`ghost`,iconOnly:!0,children:t})},t)),x(e+1,{label:v.next,disabled:e>=t,tone:`neutral`,buttonStyle:`ghost`,iconOnly:!S,children:(0,m.jsxs)(m.Fragment,{children:[S&&C(v.next),(0,m.jsx)(f.ChevronRightIcon,{})]})})]})})}var j=e=>typeof e==`string`||typeof e==`number`;function M({eyebrow:e,title:t,description:r,level:i=1,badge:s,badges:c,breadcrumbs:l,leading:u,beforeTitle:d,titlePrefix:f,titleSuffix:p,afterDescription:g,actions:_,children:v,withSeparator:y=!1,className:x,contentClassName:S,titleRowClassName:C,actionsClassName:w,...T}){let E=c??(s?[s]:[]);return(0,m.jsxs)(`header`,{"data-slot":`page-heading`,className:(0,h.clsx)(`page-heading--component`,b.pageHeading,x),...T,children:[!!l&&(0,m.jsx)(`div`,{className:b.pageHeadingCrumbs,children:l}),(0,m.jsxs)(`div`,{className:b.pageHeadingRow,children:[u!=null&&(0,m.jsx)(`div`,{className:b.pageHeadingLeading,children:u}),(0,m.jsxs)(`div`,{className:(0,h.clsx)(b.pageHeadingMain,S),children:[e!=null&&(j(e)?(0,m.jsx)(n.i,{className:`page-heading--eyebrow`,children:e}):e),d,(0,m.jsxs)(`div`,{"data-has-prefix":f?``:void 0,className:(0,h.clsx)(b.pageHeadingGrid,C),children:[!!f&&(0,m.jsx)(`span`,{className:b.pageHeadingPrefix,children:f}),(0,m.jsxs)(`div`,{className:b.pageHeadingHeadline,children:[(0,m.jsxs)(`div`,{className:b.pageHeadingTitleRow,children:[j(t)?(0,m.jsx)(n.a,{level:i,className:b.pageHeadingTitle,children:t}):t,E.length>0&&(0,m.jsx)(`div`,{className:b.pageHeadingBadges,children:E.map((e,t)=>(0,m.jsx)(o.t,{tone:e.tone??`neutral`,children:e.label},e.key??t))}),p]}),!!_&&(0,m.jsx)(`div`,{className:(0,h.clsx)(b.pageHeadingActions,w),children:_})]}),(r!=null||g!=null)&&(0,m.jsxs)(`div`,{className:b.pageHeadingBlock,children:[r!=null&&(j(r)?(0,m.jsx)(n.o,{type:`secondary`,className:b.pageHeadingDescription,children:r}):r),g]})]})]})]}),!!v&&(0,m.jsx)(`div`,{className:b.pageHeadingChildren,children:v}),!!y&&(0,m.jsx)(a.v,{className:b.pageHeadingSeparator})]})}var N={label:`Sections`},P={label:`Sections`};function F({items:e,currentPath:t=`/`,renderLink:n,variant:r=`underline`,strings:i,className:a,...o}){let s={...N,...i},c=u.n(t,e.map(e=>e.href)),d=(0,p.useRef)(null),f=l.n(d,[e]);return(0,m.jsx)(`nav`,{"aria-label":s.label,"data-fade-start":f.start||void 0,"data-fade-end":f.end||void 0,className:(0,h.clsx)(`navigation-tabs--component`,b.tabBarWrap,a),...o,children:(0,m.jsx)(`div`,{ref:d,className:(0,h.clsx)(b.tabBar,r===`pill`&&b.tabsPill),children:e.map(e=>{let t=!!c&&e.href===c,r=(0,m.jsxs)(m.Fragment,{children:[e.icon,e.label,e.badge]}),i={className:b.tab,"data-active":t||void 0,"aria-current":t?`page`:void 0,"aria-disabled":e.disabled||void 0};return n?(0,m.jsx)(`span`,{style:{display:`contents`},children:n({href:e.href,children:r,active:t,disabled:e.disabled,...i})},e.href):(0,m.jsx)(`a`,{href:e.disabled?void 0:e.href,...i,children:r},e.href)})})})}function I({items:e,value:t,onValueChange:n,strings:r,className:i,...a}){let o={...P,...r},s=(0,h.clsx)(`overflow-tab-bar--component`,i);if(e.length>0&&e.every(e=>e.href)){let r=new Map(e.map(e=>[e.href,e.id])),i=e.find(e=>e.id===t)?.href;return(0,m.jsx)(F,{...a,className:s,items:e.map(e=>({label:e.label,href:e.href,icon:e.icon,badge:e.badge,disabled:e.disabled})),currentPath:i??``,variant:`pill`,strings:{label:o.label},renderLink:({href:e,children:t,active:i,disabled:a,external:o,...s})=>(0,m.jsx)(`a`,{...s,href:a?void 0:e,onClick:()=>{let t=e?r.get(e):void 0;t&&n?.(t)},children:t})})}let c=e.some(e=>e.id===t),l=e.find(e=>!e.disabled)?.id;return(0,m.jsx)(C,{...a,value:t??``,onValueChange:e=>n?.(e),className:s,children:(0,m.jsx)(T,{label:o.label,variant:`pill`,edgeFade:!0,children:e.map(e=>(0,m.jsxs)(E,{value:e.id,disabled:e.disabled,"data-tab-id":e.id,...!c&&e.id===l?{tabIndex:0}:null,children:[e.icon,e.label,e.badge]},e.id))})})}function L({locales:e,value:t,onSelect:n,variant:a=`menu`,label:o,strings:s,className:l,...u}){let g=c.t(v,s),_=e.find(e=>e.value===t),y=(0,p.useId)(),b=(0,p.useId)();return a===`pills`?(0,m.jsx)(`div`,{className:(0,h.clsx)(`language-switcher--component`,l),...u,children:(0,m.jsx)(d.r,{"aria-label":o??g.label,value:t??null,onValueChange:e=>e&&n?.(e),options:e.map(e=>({value:e.value,label:(0,m.jsx)(`span`,{lang:e.value,children:e.label})}))})}):(0,m.jsxs)(`div`,{className:(0,h.clsx)(`language-switcher--component`,l),...u,children:[(0,m.jsx)(`span`,{id:y,hidden:!0,children:o??g.label}),(0,m.jsxs)(i.t,{children:[(0,m.jsx)(i.g,{render:(0,m.jsxs)(r.c,{tone:`neutral`,buttonStyle:`ghost`,"aria-labelledby":_?`${y} ${b}`:o?void 0:y,children:[(0,m.jsx)(f.GlobeIcon,{}),_?(0,m.jsx)(`span`,{id:b,lang:_.value,children:_.label}):o]})}),(0,m.jsx)(i.r,{align:`end`,children:e.map(e=>(0,m.jsx)(i.a,{lang:e.value,onClick:()=>n?.(e.value),trailing:e.value===t?(0,m.jsx)(f.CheckIcon,{"aria-hidden":!0}):void 0,children:e.label},e.value))})]})]})}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return E}});
@@ -1,9 +1,9 @@
1
1
  import "./css/overlay.css";
2
2
  import { t as e } from "./cvm-DtsCA8iZ.js";
3
3
  import { t } from "./cx--CBrhWH0.js";
4
- import { o as n } from "./typography-B8Iurhy1.js";
4
+ import { o as n } from "./typography-BkxEiwQ1.js";
5
5
  import { t as r } from "./slot-2Jf4M2nC.js";
6
- import { d as i } from "./ui-provider-BzyJxcKH.js";
6
+ import { d as i } from "./ui-provider-gNDv-ZRY.js";
7
7
  import { o as a } from "./structure-D0WGQAP3.js";
8
8
  import { t as o } from "./render-with-children-Clu_g9wb.js";
9
9
  import { XIcon as s } from "lucide-react";
@@ -1 +1 @@
1
- const e=require("./rolldown-runtime-BocRIvOZ.cjs"),t=require("./cvm-CHrYqf6y.cjs"),n=require("./typography-LMez-POJ.cjs"),r=require("./slot-B-qWS3Ng.cjs"),i=require("./ui-provider-B3v22pQY.cjs"),a=require("./structure-CXTLV2t8.cjs"),o=require("./render-with-children-BZwzInAH.cjs");let s=require("lucide-react"),c=require("react");c=e.t(c,1);let l=require("react/jsx-runtime"),u=require("@base-ui/react/use-render"),d=require("clsx");var f=0,p=``;function m(){if(f===0){let e=document.body.style.overflow;p=e===`hidden`?``:e,document.body.style.overflow=`hidden`}return f+=1,()=>{--f,f===0&&(document.body.style.overflow=p)}}function h({open:e,onOpenChange:t,modal:n=!0,closeOnBackdropClick:r=!0,closeOnEscape:i=!0,initialFocusRef:a}){let o=c.useRef(null),s=c.useRef(t);c.useEffect(()=>{s.current=t},[t]);let l=n===!0,u=n!==!1,d=c.useCallback(t=>{let n=o.current;if(!n)return;let r=t??e;if(r&&!n.open){l?n.showModal():n.show();let e=a?.current;e&&e.focus()}else!r&&n.open&&n.close()},[e,l,a]);c.useEffect(()=>{d()});let f=c.useCallback(()=>{s.current?.(!1)},[]),p=c.useCallback(e=>{i||e.preventDefault()},[i]);return c.useEffect(()=>{let e=o.current;if(!e||!r||!l)return;let t=t=>{if(t.target!==e)return;let n=e.getBoundingClientRect();t.clientX>=n.left&&t.clientX<=n.right&&t.clientY>=n.top&&t.clientY<=n.bottom||s.current?.(!1)};return e.addEventListener(`click`,t),()=>e.removeEventListener(`click`,t)},[r,l]),c.useEffect(()=>{let t=o.current;if(!t||l||!e||!i)return;let n=e=>{e.key!==`Escape`||e.defaultPrevented||e.isComposing||!(e.target instanceof Node)||!t.contains(e.target)||(e.preventDefault(),s.current?.(!1))};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[l,e,i]),c.useEffect(()=>{let t=o.current;if(!t||l||!u||!e)return;let n=e=>{if(e.key!==`Tab`)return;let n=t.querySelectorAll(`a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`),r=n[0],i=n[n.length-1];!r||!i||(e.shiftKey&&document.activeElement===r?(e.preventDefault(),i.focus()):!e.shiftKey&&document.activeElement===i&&(e.preventDefault(),r.focus()))};return t.addEventListener(`keydown`,n),()=>t.removeEventListener(`keydown`,n)},[l,u,e]),c.useEffect(()=>{if(!e||!a)return;let t=requestAnimationFrame(()=>{let e=o.current,t=a.current;!e||!t||e.contains(document.activeElement)||t.focus()});return()=>cancelAnimationFrame(t)},[e,a]),c.useEffect(()=>{if(!(!e||!l))return m()},[e,l]),{ref:o,onClose:f,onCancel:p,reconcile:d}}var g=(0,c.createContext)(null);function _(){return(0,c.useContext)(g)}function v(e){let t=(0,c.useContext)(g);if(!t)throw Error(`<${e}> must be used within <Overlay>`);return t}var y={close:`Close`},b={root:`overlay__root___Pl83q`,placementCenter:`overlay__placementCenter___3-qbr`,placementInlineStart:`overlay__placementInlineStart___huO7E`,placementInlineEnd:`overlay__placementInlineEnd___4i7UK`,placementBlockStart:`overlay__placementBlockStart___o9KBU`,placementBlockEnd:`overlay__placementBlockEnd___4OVis`,close:`overlay__close___7xoV5`,header:`overlay__header___VvzcY`,body:`overlay__body___eHNnO`,footer:`overlay__footer___d58kO`,title:`overlay__title___JiPe2`,description:`overlay__description___sZ5di`,bare:`overlay__bare___-pW44`},x=c.forwardRef(function({className:e,...t},n){return(0,l.jsx)(a.o,{gap:`xs`,ref:n,"data-slot":`overlay-header`,className:(0,d.clsx)(`overlay--header`,b.header,e),...t})}),S=c.forwardRef(function({className:e,...t},n){return(0,l.jsx)(`div`,{ref:n,"data-slot":`overlay-body`,className:(0,d.clsx)(`overlay--body`,b.body,e),...t})}),C=c.forwardRef(function({className:e,...t},n){return(0,l.jsx)(a.o,{direction:`horizontal`,align:`center`,wrap:!0,gap:`md`,justify:`end`,ref:n,"data-slot":`overlay-footer`,className:(0,d.clsx)(`overlay--footer`,b.footer,e),...t})}),w=c.forwardRef(function({children:e,className:t,id:r,...i},a){let o=_(),s=c.useId(),u=r??s,f=o?.setTitleId;c.useEffect(()=>{if(f)return f(u),()=>f(void 0)},[f,u]);let p=typeof e==`string`||typeof e==`number`;return(0,l.jsx)(`h2`,{ref:a,id:u,"data-slot":`overlay-title`,className:(0,d.clsx)(`overlay--title`,b.title,t),...i,children:p?(0,l.jsx)(n.o,{tag:`span`,size:`inherit`,weight:`semibold`,children:e}):e})}),T=c.forwardRef(function({children:e,className:t,id:r,...i},a){let o=_(),s=c.useId(),u=r??s,f=o?.setDescriptionId;c.useEffect(()=>{if(f)return f(u),()=>f(void 0)},[f,u]);let p=typeof e==`string`||typeof e==`number`;return(0,l.jsx)(`p`,{ref:a,id:u,"data-slot":`overlay-description`,className:(0,d.clsx)(`overlay--description`,b.description,t),...i,children:p?(0,l.jsx)(n.o,{tag:`span`,size:`inherit`,type:`secondary`,children:e}):e})}),E={sm:`var(--overlay-edge-sm)`,md:`var(--overlay-edge-md)`,lg:`var(--overlay-edge-lg)`,full:`var(--overlay-edge-full)`},D={sm:`20rem`,md:`24rem`,lg:`32rem`,full:`100%`},O=`calc(100% - var(--overlay-edge-inset) * 2)`;function k(e){if(e===`full`)return O;let t=/^(\d+(?:\.\d+)?)%$/.exec(e.trim());return t?`calc(${O} * ${Number(t[1])/100})`:e}function A(e,t,n){let r={};return e&&(r[`--overlay-edge-size`]=E[e]??e,r[`--overlay-edge-cap`]=D[e]??e),t&&(r[`--overlay-edge-length`]=k(t)),n&&(r[`--overlay-edge-inset`]=n===!0?`var(--overlay-edge-inset-default)`:n),r}function j({open:e,defaultOpen:t=!1,onOpenChange:n,children:r}){let[i,a]=c.useState(t),o=e!==void 0,s=o?e:i,u=c.useRef(null),d=c.useCallback(e=>{o||a(e),n?.(e),u.current?.(e)},[o,n]),[f,p]=c.useState(),[m,h]=c.useState(),_=c.useMemo(()=>({open:s,setOpen:d,reconcileRef:u,titleId:f,descriptionId:m,setTitleId:p,setDescriptionId:h}),[s,d,f,m]);return(0,l.jsx)(g.Provider,{value:_,children:(0,l.jsx)(`div`,{"data-slot":`overlay`,style:{display:`contents`},children:r})})}function M({render:e,onClick:t,className:n,children:r,...i}){let{open:a,setOpen:s}=v(`OverlayTrigger`),{ref:c,...l}=i;return(0,u.useRender)({defaultTagName:`button`,render:e?o.t(e,r):void 0,ref:c,props:{"data-slot":`overlay-trigger`,type:e?void 0:`button`,"aria-haspopup":`dialog`,"aria-expanded":a,className:(0,d.clsx)(`overlay--trigger`,n),children:r,onClick:e=>{t?.(e),!e.defaultPrevented&&(e.currentTarget.focus({preventScroll:!0}),s(!0))},...l}})}function N({render:e,onClick:t,className:n,children:i,...a}){let{setOpen:s}=v(`OverlayClose`),c=e!==void 0;return(0,l.jsx)(c?r.t:`button`,{"data-slot":`overlay-close`,type:c?void 0:`button`,className:(0,d.clsx)(`overlay--close`,n),onClick:e=>{t?.(e),e.defaultPrevented||s(!1)},...a,children:e?o.t(e,i):i})}var P=t.t(b.root,{variants:{placement:{center:b.placementCenter,"inline-start":b.placementInlineStart,"inline-end":b.placementInlineEnd,"block-start":b.placementBlockStart,"block-end":b.placementBlockEnd},surface:{framed:void 0,bare:b.bare}},defaultVariants:{placement:`center`,surface:`framed`}});function F({placement:e=`center`,size:t,length:n,inset:r,modality:a=`modal`,surface:o=`framed`,dismissal:u,initialFocusRef:f,showCloseButton:p=!0,strings:m,className:g,style:_,children:x,...S}){let C={...y,...m},{open:w,setOpen:T,reconcileRef:E,titleId:D,descriptionId:O}=v(`OverlayContent`),{ref:k,onClose:j,onCancel:M,reconcile:F}=h({open:w,onOpenChange:T,modal:a===`modal`||a===`trap-focus`&&`trap-focus`,closeOnBackdropClick:u?.backdrop??!0,closeOnEscape:u?.escape??!0,initialFocusRef:f});return c.useEffect(()=>(E.current=F,()=>{E.current=null}),[F,E]),(0,l.jsxs)(`dialog`,{ref:k,"data-slot":`overlay-content`,"data-placement":e,"data-modality":a,"data-inset":r?``:void 0,"aria-labelledby":S[`aria-label`]?void 0:D,"aria-describedby":O,style:{...A(t,n,r),..._},className:(0,d.clsx)(`overlay--component`,P({placement:e,surface:o}),g),onClose:j,onCancel:M,...S,children:[(0,l.jsx)(i.d,{children:x}),!!p&&(0,l.jsx)(N,{render:(0,l.jsx)(`button`,{type:`button`,className:b.close,"aria-label":C.close}),children:(0,l.jsx)(s.XIcon,{})})]})}function I({children:e,...t}){let{setOpen:n}=v(`OverlayDismissArea`);return(0,l.jsx)(`div`,{style:{display:`contents`},onClick:e=>{e.target.closest(`button`)&&!e.defaultPrevented&&n(!1)},...t,children:e})}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return x}});
1
+ const e=require("./rolldown-runtime-BocRIvOZ.cjs"),t=require("./cvm-CHrYqf6y.cjs"),n=require("./typography-Cf5zEv4y.cjs"),r=require("./slot-B-qWS3Ng.cjs"),i=require("./ui-provider-DI1VxMDT.cjs"),a=require("./structure-CXTLV2t8.cjs"),o=require("./render-with-children-BZwzInAH.cjs");let s=require("lucide-react"),c=require("react");c=e.t(c,1);let l=require("react/jsx-runtime"),u=require("@base-ui/react/use-render"),d=require("clsx");var f=0,p=``;function m(){if(f===0){let e=document.body.style.overflow;p=e===`hidden`?``:e,document.body.style.overflow=`hidden`}return f+=1,()=>{--f,f===0&&(document.body.style.overflow=p)}}function h({open:e,onOpenChange:t,modal:n=!0,closeOnBackdropClick:r=!0,closeOnEscape:i=!0,initialFocusRef:a}){let o=c.useRef(null),s=c.useRef(t);c.useEffect(()=>{s.current=t},[t]);let l=n===!0,u=n!==!1,d=c.useCallback(t=>{let n=o.current;if(!n)return;let r=t??e;if(r&&!n.open){l?n.showModal():n.show();let e=a?.current;e&&e.focus()}else!r&&n.open&&n.close()},[e,l,a]);c.useEffect(()=>{d()});let f=c.useCallback(()=>{s.current?.(!1)},[]),p=c.useCallback(e=>{i||e.preventDefault()},[i]);return c.useEffect(()=>{let e=o.current;if(!e||!r||!l)return;let t=t=>{if(t.target!==e)return;let n=e.getBoundingClientRect();t.clientX>=n.left&&t.clientX<=n.right&&t.clientY>=n.top&&t.clientY<=n.bottom||s.current?.(!1)};return e.addEventListener(`click`,t),()=>e.removeEventListener(`click`,t)},[r,l]),c.useEffect(()=>{let t=o.current;if(!t||l||!e||!i)return;let n=e=>{e.key!==`Escape`||e.defaultPrevented||e.isComposing||!(e.target instanceof Node)||!t.contains(e.target)||(e.preventDefault(),s.current?.(!1))};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[l,e,i]),c.useEffect(()=>{let t=o.current;if(!t||l||!u||!e)return;let n=e=>{if(e.key!==`Tab`)return;let n=t.querySelectorAll(`a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`),r=n[0],i=n[n.length-1];!r||!i||(e.shiftKey&&document.activeElement===r?(e.preventDefault(),i.focus()):!e.shiftKey&&document.activeElement===i&&(e.preventDefault(),r.focus()))};return t.addEventListener(`keydown`,n),()=>t.removeEventListener(`keydown`,n)},[l,u,e]),c.useEffect(()=>{if(!e||!a)return;let t=requestAnimationFrame(()=>{let e=o.current,t=a.current;!e||!t||e.contains(document.activeElement)||t.focus()});return()=>cancelAnimationFrame(t)},[e,a]),c.useEffect(()=>{if(!(!e||!l))return m()},[e,l]),{ref:o,onClose:f,onCancel:p,reconcile:d}}var g=(0,c.createContext)(null);function _(){return(0,c.useContext)(g)}function v(e){let t=(0,c.useContext)(g);if(!t)throw Error(`<${e}> must be used within <Overlay>`);return t}var y={close:`Close`},b={root:`overlay__root___Pl83q`,placementCenter:`overlay__placementCenter___3-qbr`,placementInlineStart:`overlay__placementInlineStart___huO7E`,placementInlineEnd:`overlay__placementInlineEnd___4i7UK`,placementBlockStart:`overlay__placementBlockStart___o9KBU`,placementBlockEnd:`overlay__placementBlockEnd___4OVis`,close:`overlay__close___7xoV5`,header:`overlay__header___VvzcY`,body:`overlay__body___eHNnO`,footer:`overlay__footer___d58kO`,title:`overlay__title___JiPe2`,description:`overlay__description___sZ5di`,bare:`overlay__bare___-pW44`},x=c.forwardRef(function({className:e,...t},n){return(0,l.jsx)(a.o,{gap:`xs`,ref:n,"data-slot":`overlay-header`,className:(0,d.clsx)(`overlay--header`,b.header,e),...t})}),S=c.forwardRef(function({className:e,...t},n){return(0,l.jsx)(`div`,{ref:n,"data-slot":`overlay-body`,className:(0,d.clsx)(`overlay--body`,b.body,e),...t})}),C=c.forwardRef(function({className:e,...t},n){return(0,l.jsx)(a.o,{direction:`horizontal`,align:`center`,wrap:!0,gap:`md`,justify:`end`,ref:n,"data-slot":`overlay-footer`,className:(0,d.clsx)(`overlay--footer`,b.footer,e),...t})}),w=c.forwardRef(function({children:e,className:t,id:r,...i},a){let o=_(),s=c.useId(),u=r??s,f=o?.setTitleId;c.useEffect(()=>{if(f)return f(u),()=>f(void 0)},[f,u]);let p=typeof e==`string`||typeof e==`number`;return(0,l.jsx)(`h2`,{ref:a,id:u,"data-slot":`overlay-title`,className:(0,d.clsx)(`overlay--title`,b.title,t),...i,children:p?(0,l.jsx)(n.o,{tag:`span`,size:`inherit`,weight:`semibold`,children:e}):e})}),T=c.forwardRef(function({children:e,className:t,id:r,...i},a){let o=_(),s=c.useId(),u=r??s,f=o?.setDescriptionId;c.useEffect(()=>{if(f)return f(u),()=>f(void 0)},[f,u]);let p=typeof e==`string`||typeof e==`number`;return(0,l.jsx)(`p`,{ref:a,id:u,"data-slot":`overlay-description`,className:(0,d.clsx)(`overlay--description`,b.description,t),...i,children:p?(0,l.jsx)(n.o,{tag:`span`,size:`inherit`,type:`secondary`,children:e}):e})}),E={sm:`var(--overlay-edge-sm)`,md:`var(--overlay-edge-md)`,lg:`var(--overlay-edge-lg)`,full:`var(--overlay-edge-full)`},D={sm:`20rem`,md:`24rem`,lg:`32rem`,full:`100%`},O=`calc(100% - var(--overlay-edge-inset) * 2)`;function k(e){if(e===`full`)return O;let t=/^(\d+(?:\.\d+)?)%$/.exec(e.trim());return t?`calc(${O} * ${Number(t[1])/100})`:e}function A(e,t,n){let r={};return e&&(r[`--overlay-edge-size`]=E[e]??e,r[`--overlay-edge-cap`]=D[e]??e),t&&(r[`--overlay-edge-length`]=k(t)),n&&(r[`--overlay-edge-inset`]=n===!0?`var(--overlay-edge-inset-default)`:n),r}function j({open:e,defaultOpen:t=!1,onOpenChange:n,children:r}){let[i,a]=c.useState(t),o=e!==void 0,s=o?e:i,u=c.useRef(null),d=c.useCallback(e=>{o||a(e),n?.(e),u.current?.(e)},[o,n]),[f,p]=c.useState(),[m,h]=c.useState(),_=c.useMemo(()=>({open:s,setOpen:d,reconcileRef:u,titleId:f,descriptionId:m,setTitleId:p,setDescriptionId:h}),[s,d,f,m]);return(0,l.jsx)(g.Provider,{value:_,children:(0,l.jsx)(`div`,{"data-slot":`overlay`,style:{display:`contents`},children:r})})}function M({render:e,onClick:t,className:n,children:r,...i}){let{open:a,setOpen:s}=v(`OverlayTrigger`),{ref:c,...l}=i;return(0,u.useRender)({defaultTagName:`button`,render:e?o.t(e,r):void 0,ref:c,props:{"data-slot":`overlay-trigger`,type:e?void 0:`button`,"aria-haspopup":`dialog`,"aria-expanded":a,className:(0,d.clsx)(`overlay--trigger`,n),children:r,onClick:e=>{t?.(e),!e.defaultPrevented&&(e.currentTarget.focus({preventScroll:!0}),s(!0))},...l}})}function N({render:e,onClick:t,className:n,children:i,...a}){let{setOpen:s}=v(`OverlayClose`),c=e!==void 0;return(0,l.jsx)(c?r.t:`button`,{"data-slot":`overlay-close`,type:c?void 0:`button`,className:(0,d.clsx)(`overlay--close`,n),onClick:e=>{t?.(e),e.defaultPrevented||s(!1)},...a,children:e?o.t(e,i):i})}var P=t.t(b.root,{variants:{placement:{center:b.placementCenter,"inline-start":b.placementInlineStart,"inline-end":b.placementInlineEnd,"block-start":b.placementBlockStart,"block-end":b.placementBlockEnd},surface:{framed:void 0,bare:b.bare}},defaultVariants:{placement:`center`,surface:`framed`}});function F({placement:e=`center`,size:t,length:n,inset:r,modality:a=`modal`,surface:o=`framed`,dismissal:u,initialFocusRef:f,showCloseButton:p=!0,strings:m,className:g,style:_,children:x,...S}){let C={...y,...m},{open:w,setOpen:T,reconcileRef:E,titleId:D,descriptionId:O}=v(`OverlayContent`),{ref:k,onClose:j,onCancel:M,reconcile:F}=h({open:w,onOpenChange:T,modal:a===`modal`||a===`trap-focus`&&`trap-focus`,closeOnBackdropClick:u?.backdrop??!0,closeOnEscape:u?.escape??!0,initialFocusRef:f});return c.useEffect(()=>(E.current=F,()=>{E.current=null}),[F,E]),(0,l.jsxs)(`dialog`,{ref:k,"data-slot":`overlay-content`,"data-placement":e,"data-modality":a,"data-inset":r?``:void 0,"aria-labelledby":S[`aria-label`]?void 0:D,"aria-describedby":O,style:{...A(t,n,r),..._},className:(0,d.clsx)(`overlay--component`,P({placement:e,surface:o}),g),onClose:j,onCancel:M,...S,children:[(0,l.jsx)(i.d,{children:x}),!!p&&(0,l.jsx)(N,{render:(0,l.jsx)(`button`,{type:`button`,className:b.close,"aria-label":C.close}),children:(0,l.jsx)(s.XIcon,{})})]})}function I({children:e,...t}){let{setOpen:n}=v(`OverlayDismissArea`);return(0,l.jsx)(`div`,{style:{display:`contents`},onClick:e=>{e.target.closest(`button`)&&!e.defaultPrevented&&n(!1)},...t,children:e})}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return x}});
@@ -1,13 +1,13 @@
1
1
  import "./css/overlays.css";
2
2
  import { t as e } from "./cx--CBrhWH0.js";
3
- import { _ as t, h as n } from "./feedback-BmquisO3.js";
4
- import { c as r } from "./buttons-Corm-KHK.js";
3
+ import { _ as t, h as n } from "./feedback-C8QtkdHc.js";
4
+ import { c as r } from "./buttons-riLAPVQV.js";
5
5
  import { t as i } from "./use-latest-CF0678ae.js";
6
- import { d as a } from "./display-DVhYS75K.js";
7
- import { a as o, c as s, l as c, o as l, s as u, t as d, u as f } from "./overlay-Bdri8Z7E.js";
8
- import { r as p } from "./alert-dialog-DzqaOiE5.js";
9
- import { t as m } from "./dialog-CLwUz8Gb.js";
10
- import { t as h } from "./sheet-BP2BmI-Z.js";
6
+ import { d as a } from "./display-Dehpw83R.js";
7
+ import { a as o, c as s, l as c, o as l, s as u, t as d, u as f } from "./overlay-A5bE-8n5.js";
8
+ import { r as p } from "./alert-dialog-ZHkE0QEz.js";
9
+ import { t as m } from "./dialog-CXugTX8t.js";
10
+ import { t as h } from "./sheet-3sbsGFus.js";
11
11
  import { CircleAlertIcon as g, CircleCheckIcon as _, CircleHelpIcon as v, InfoIcon as y, TriangleAlertIcon as b } from "lucide-react";
12
12
  import { isValidElement as x, useCallback as S, useEffect as C, useId as w, useMemo as T, useRef as E, useState as D } from "react";
13
13
  import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
@@ -1 +1 @@
1
- const e=require("./feedback-Da53xAUT.cjs"),t=require("./buttons-CMsvnL6-.cjs"),n=require("./use-latest-BT2X4Opg.cjs"),r=require("./display-BUiiuPS9.cjs"),i=require("./overlay-D1wEvshK.cjs"),a=require("./alert-dialog-BPePUOHx.cjs"),o=require("./dialog-Bf7tBRkZ.cjs"),s=require("./sheet-FA8TfP1E.cjs");let c=require("lucide-react"),l=require("react"),u=require("react/jsx-runtime"),d=require("clsx");var f={titleRow:`overlays__titleRow___K3_u1`,toneIcon:`overlays__toneIcon___mxd2g`,titleText:`overlays__titleText___F2r7M`,notice:`overlays__notice___33HUh`,actions:`overlays__actions___M1iJc`},p={neutral:(0,u.jsx)(c.CircleHelpIcon,{"aria-hidden":!0}),destructive:(0,u.jsx)(c.CircleAlertIcon,{"aria-hidden":!0}),warning:(0,u.jsx)(c.TriangleAlertIcon,{"aria-hidden":!0}),info:(0,u.jsx)(c.InfoIcon,{"aria-hidden":!0}),success:(0,u.jsx)(c.CircleCheckIcon,{"aria-hidden":!0})};function m({tone:e}){return(0,u.jsx)(`span`,{"data-tone":e,className:f.toneIcon,children:p[e]})}function h({tone:e,showIcon:t,children:n}){return t?(0,u.jsxs)(`span`,{className:f.titleRow,children:[(0,u.jsx)(m,{tone:e}),(0,u.jsx)(`span`,{className:f.titleText,children:n})]}):(0,u.jsx)(u.Fragment,{children:n})}function g({tone:t,children:n}){return(0,u.jsx)(`div`,{className:f.notice,children:(0,u.jsx)(e.h,{tone:t===`neutral`?`info`:t,children:(0,u.jsx)(e._,{children:n})})})}function _({copy:e,showCancel:n,showConfirm:r,confirmTone:i,confirmStyle:a,busy:o,formId:s,onCancel:c,onConfirm:l}){return!n&&!r?null:(0,u.jsxs)(`div`,{className:(0,d.clsx)(`overlay-actions--component`,f.actions),children:[n&&(0,u.jsx)(t.c,{type:`button`,tone:`neutral`,buttonStyle:`outline`,disabled:o,onClick:c,children:e.cancel}),r&&(0,u.jsx)(t.c,{type:s?`submit`:`button`,form:s,tone:i,buttonStyle:a,loading:o,onClick:s?void 0:()=>void l(),children:e.confirm})]})}function v({title:e,description:t,titleId:n,descriptionId:i,Title:a,Description:o}){return(0,u.jsxs)(r.d,{children:[!!e&&(0,u.jsx)(a,{id:n,children:e}),!!t&&(0,u.jsx)(o,{id:i,children:t})]})}var y={confirm:`Confirm`,cancel:`Cancel`},b={confirm:`Continue`,cancel:`Cancel`};function x({close:e,open:t=!0,onConfirm:n,onAsyncConfirm:r,closeOnAsyncComplete:i=!0,confirmTone:a=`primary`,loading:o=!1,formId:s,onCancel:c,onError:u,strings:d,defaults:f=y,emphasis:p=!1,tone:m=`neutral`}){let h={...f,...d},[g,_]=(0,l.useState)(!1),v=(0,l.useRef)(!1),b=(0,l.useRef)(0);(0,l.useEffect)(()=>(v.current=!1,_(!1),()=>{b.current+=1,v.current=!1}),[t]);let x=(0,l.useCallback)(async()=>{if(o||v.current||!t)return;v.current=!0;let a=b.current;try{n?(n(),e()):r?(_(!0),await r(),b.current===a&&i&&e()):e()}catch(e){b.current===a&&u?.(e)}finally{b.current===a&&(v.current=!1,_(!1))}},[o,t,n,r,i,e,u]),S=(0,l.useCallback)(()=>{if(!s||o||v.current||!t)return;let e=document.getElementById(s);e instanceof HTMLFormElement&&e.requestSubmit()},[s,o,t]),C=(0,l.useCallback)(()=>{o||v.current||!t||(c?.(),e())},[c,e,o,t]),w=(0,l.useMemo)(()=>p&&(m===`destructive`||m===`warning`||m===`success`)?m:a,[p,m,a]);return{copy:h,pending:g,confirm:s?S:x,cancel:C,confirmTone:w,busy:g||o}}function S(e,t){return typeof e==`function`?e(t):e}function C({defaultOpen:e=!1,open:t,onOpenChange:r,onOpen:i,onClose:a}={}){let[o,s]=(0,l.useState)(e),c=t!==void 0,u=c?t:o,d=n.t(u),f=(0,l.useCallback)(e=>{let t=S(e,d.current);t!==d.current&&(c||s(t),r?.(t),t?i?.():a?.())},[c,r,i,a,d]);return{open:u,setOpen:f,show:(0,l.useCallback)(()=>f(!0),[f]),hide:(0,l.useCallback)(()=>f(!1),[f]),toggle:(0,l.useCallback)(()=>f(e=>!e),[f]),overlayProps:(0,l.useMemo)(()=>({open:u,onOpenChange:f}),[u,f])}}function w(e,{defaultOpen:t,open:r,onOpenChange:i,closeOthersOnOpen:a=!1}={}){let o=(0,l.useCallback)(t=>Object.fromEntries(e.map(e=>[e,!!t?.[e]])),[e]),[s,c]=(0,l.useState)(()=>o(t)),u=r!==void 0,d=u?o(r):s,f=n.t(d),p=(0,l.useCallback)((t,n)=>{let r=f.current,o=S(n,r[t]);if(o===r[t])return;let s=a&&o?Object.fromEntries(e.map(e=>[e,e===t])):{...r,[t]:o};u||c(s),i?.(t,o,s)},[a,u,e,i,f]);return(0,l.useMemo)(()=>Object.fromEntries(e.map(e=>{let t=t=>p(e,t);return[e,{open:d[e],setOpen:t,show:()=>p(e,!0),hide:()=>p(e,!1),toggle:()=>p(e,e=>!e),overlayProps:{open:d[e],onOpenChange:t}}]})),[e,p,d])}function T({open:e,onOpenChange:t,onClose:n,children:r,title:a,description:o,hideHeader:s=!1,showCloseButton:c=!0,initialFocusRef:f,closeOnEscape:p=!0,closeOnBackdropClick:m=!0,surfaceStyle:y,className:b,contentClassName:S,strings:w,trigger:T,showCancel:E=!0,showConfirm:D=!0,onCancel:O,onConfirm:k,onAsyncConfirm:A,onError:j,closeOnAsyncComplete:M=!0,confirmTone:ee=`primary`,confirmStyle:N=`solid`,loading:P=!1,formId:F,footer:I,emphasis:L=!1,tone:R=`neutral`,showIcon:z,alertMessage:B,parts:V,hook:H,contentProps:U,alwaysRenderBody:W=!1,showFooter:G=!0,dismissible:K=!0,defaultStrings:q,showIconByDefault:J=!1}){let{Content:te}=V,Y=(0,l.useId)(),X=a?`${Y}-title`:void 0,Z=o?`${Y}-description`:void 0,Q=C({open:e,onOpenChange:t,onClose:n}),$=x({close:Q.hide,open:Q.open,onConfirm:k,onAsyncConfirm:A,closeOnAsyncComplete:M,confirmTone:ee,loading:P,formId:F,onCancel:O,onError:j,strings:w,...q?{defaults:q}:null,emphasis:L,tone:R}),ne={escape:p&&!$.busy,backdrop:m&&!$.busy},re=G&&(I!==void 0||E||D),ie=W||r!=null||!!B,ae=z??J;return(0,u.jsxs)(i.t,{...Q.overlayProps,children:[(0,l.isValidElement)(T)&&(0,u.jsx)(i.a,{render:T}),(0,u.jsxs)(te,{"aria-labelledby":X,"aria-describedby":Z,...K?{showCloseButton:c&&!$.busy,initialFocusRef:f,dismissal:ne}:null,...U?.({busy:$.busy}),className:(0,d.clsx)(`${H}--component`,b),style:y,children:[s?(0,u.jsx)(v,{title:a,description:o,titleId:X,descriptionId:Z,Title:i.s,Description:i.o}):(!!a||!!o)&&(0,u.jsxs)(i.u,{children:[!!a&&(0,u.jsx)(i.s,{id:X,children:(0,u.jsx)(h,{tone:R,showIcon:ae,children:a})}),!!o&&(0,u.jsx)(i.o,{id:Z,children:o})]}),ie&&(0,u.jsxs)(i.l,{className:S,children:[!!B&&(0,u.jsx)(g,{tone:R,children:B}),r]}),re&&(0,u.jsx)(i.c,{children:I??(0,u.jsx)(_,{copy:$.copy,showCancel:E,showConfirm:D,confirmTone:$.confirmTone,confirmStyle:N,busy:$.busy,formId:F,onCancel:$.cancel,onConfirm:$.confirm})})]})]})}var E={sm:`24rem`,md:`32rem`,lg:`42rem`,xl:`56rem`,full:`100vw`},D={Content:o.t};function O({width:e=`md`,surfaceStyle:t,...n}){return(0,u.jsx)(T,{...n,parts:D,hook:`action-dialog`,surfaceStyle:{"--overlay-max-width":E[e]??e,...t}})}var k={Content:s.t};function A({side:e=`inline-end`,size:t,length:n,inset:r,modality:i=`modal`,showFooter:a=!0,...o}){return(0,u.jsx)(T,{...o,parts:k,hook:`action-sheet`,alwaysRenderBody:!0,showFooter:a,contentProps:()=>({side:e,size:t,length:n,inset:r,modality:i})})}var j={Content:a.r};function M({tone:e,confirmTone:t,destructive:n=!1,...r}){let i=e??(n?`destructive`:`neutral`);return(0,u.jsx)(T,{...r,parts:j,hook:`confirm-dialog`,tone:i,confirmTone:t??(n?`destructive`:`primary`),emphasis:!0,showIconByDefault:!0,defaultStrings:b,dismissible:!1,showFooter:!0})}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return M}});
1
+ const e=require("./feedback-IpUFKqgv.cjs"),t=require("./buttons-Dwl42fIr.cjs"),n=require("./use-latest-BT2X4Opg.cjs"),r=require("./display-CFj87iEn.cjs"),i=require("./overlay-BtQz_AN3.cjs"),a=require("./alert-dialog-ByJw3YGj.cjs"),o=require("./dialog-DZ9_m_qc.cjs"),s=require("./sheet-B4_LNS7m.cjs");let c=require("lucide-react"),l=require("react"),u=require("react/jsx-runtime"),d=require("clsx");var f={titleRow:`overlays__titleRow___K3_u1`,toneIcon:`overlays__toneIcon___mxd2g`,titleText:`overlays__titleText___F2r7M`,notice:`overlays__notice___33HUh`,actions:`overlays__actions___M1iJc`},p={neutral:(0,u.jsx)(c.CircleHelpIcon,{"aria-hidden":!0}),destructive:(0,u.jsx)(c.CircleAlertIcon,{"aria-hidden":!0}),warning:(0,u.jsx)(c.TriangleAlertIcon,{"aria-hidden":!0}),info:(0,u.jsx)(c.InfoIcon,{"aria-hidden":!0}),success:(0,u.jsx)(c.CircleCheckIcon,{"aria-hidden":!0})};function m({tone:e}){return(0,u.jsx)(`span`,{"data-tone":e,className:f.toneIcon,children:p[e]})}function h({tone:e,showIcon:t,children:n}){return t?(0,u.jsxs)(`span`,{className:f.titleRow,children:[(0,u.jsx)(m,{tone:e}),(0,u.jsx)(`span`,{className:f.titleText,children:n})]}):(0,u.jsx)(u.Fragment,{children:n})}function g({tone:t,children:n}){return(0,u.jsx)(`div`,{className:f.notice,children:(0,u.jsx)(e.h,{tone:t===`neutral`?`info`:t,children:(0,u.jsx)(e._,{children:n})})})}function _({copy:e,showCancel:n,showConfirm:r,confirmTone:i,confirmStyle:a,busy:o,formId:s,onCancel:c,onConfirm:l}){return!n&&!r?null:(0,u.jsxs)(`div`,{className:(0,d.clsx)(`overlay-actions--component`,f.actions),children:[n&&(0,u.jsx)(t.c,{type:`button`,tone:`neutral`,buttonStyle:`outline`,disabled:o,onClick:c,children:e.cancel}),r&&(0,u.jsx)(t.c,{type:s?`submit`:`button`,form:s,tone:i,buttonStyle:a,loading:o,onClick:s?void 0:()=>void l(),children:e.confirm})]})}function v({title:e,description:t,titleId:n,descriptionId:i,Title:a,Description:o}){return(0,u.jsxs)(r.d,{children:[!!e&&(0,u.jsx)(a,{id:n,children:e}),!!t&&(0,u.jsx)(o,{id:i,children:t})]})}var y={confirm:`Confirm`,cancel:`Cancel`},b={confirm:`Continue`,cancel:`Cancel`};function x({close:e,open:t=!0,onConfirm:n,onAsyncConfirm:r,closeOnAsyncComplete:i=!0,confirmTone:a=`primary`,loading:o=!1,formId:s,onCancel:c,onError:u,strings:d,defaults:f=y,emphasis:p=!1,tone:m=`neutral`}){let h={...f,...d},[g,_]=(0,l.useState)(!1),v=(0,l.useRef)(!1),b=(0,l.useRef)(0);(0,l.useEffect)(()=>(v.current=!1,_(!1),()=>{b.current+=1,v.current=!1}),[t]);let x=(0,l.useCallback)(async()=>{if(o||v.current||!t)return;v.current=!0;let a=b.current;try{n?(n(),e()):r?(_(!0),await r(),b.current===a&&i&&e()):e()}catch(e){b.current===a&&u?.(e)}finally{b.current===a&&(v.current=!1,_(!1))}},[o,t,n,r,i,e,u]),S=(0,l.useCallback)(()=>{if(!s||o||v.current||!t)return;let e=document.getElementById(s);e instanceof HTMLFormElement&&e.requestSubmit()},[s,o,t]),C=(0,l.useCallback)(()=>{o||v.current||!t||(c?.(),e())},[c,e,o,t]),w=(0,l.useMemo)(()=>p&&(m===`destructive`||m===`warning`||m===`success`)?m:a,[p,m,a]);return{copy:h,pending:g,confirm:s?S:x,cancel:C,confirmTone:w,busy:g||o}}function S(e,t){return typeof e==`function`?e(t):e}function C({defaultOpen:e=!1,open:t,onOpenChange:r,onOpen:i,onClose:a}={}){let[o,s]=(0,l.useState)(e),c=t!==void 0,u=c?t:o,d=n.t(u),f=(0,l.useCallback)(e=>{let t=S(e,d.current);t!==d.current&&(c||s(t),r?.(t),t?i?.():a?.())},[c,r,i,a,d]);return{open:u,setOpen:f,show:(0,l.useCallback)(()=>f(!0),[f]),hide:(0,l.useCallback)(()=>f(!1),[f]),toggle:(0,l.useCallback)(()=>f(e=>!e),[f]),overlayProps:(0,l.useMemo)(()=>({open:u,onOpenChange:f}),[u,f])}}function w(e,{defaultOpen:t,open:r,onOpenChange:i,closeOthersOnOpen:a=!1}={}){let o=(0,l.useCallback)(t=>Object.fromEntries(e.map(e=>[e,!!t?.[e]])),[e]),[s,c]=(0,l.useState)(()=>o(t)),u=r!==void 0,d=u?o(r):s,f=n.t(d),p=(0,l.useCallback)((t,n)=>{let r=f.current,o=S(n,r[t]);if(o===r[t])return;let s=a&&o?Object.fromEntries(e.map(e=>[e,e===t])):{...r,[t]:o};u||c(s),i?.(t,o,s)},[a,u,e,i,f]);return(0,l.useMemo)(()=>Object.fromEntries(e.map(e=>{let t=t=>p(e,t);return[e,{open:d[e],setOpen:t,show:()=>p(e,!0),hide:()=>p(e,!1),toggle:()=>p(e,e=>!e),overlayProps:{open:d[e],onOpenChange:t}}]})),[e,p,d])}function T({open:e,onOpenChange:t,onClose:n,children:r,title:a,description:o,hideHeader:s=!1,showCloseButton:c=!0,initialFocusRef:f,closeOnEscape:p=!0,closeOnBackdropClick:m=!0,surfaceStyle:y,className:b,contentClassName:S,strings:w,trigger:T,showCancel:E=!0,showConfirm:D=!0,onCancel:O,onConfirm:k,onAsyncConfirm:A,onError:j,closeOnAsyncComplete:M=!0,confirmTone:ee=`primary`,confirmStyle:N=`solid`,loading:P=!1,formId:F,footer:I,emphasis:L=!1,tone:R=`neutral`,showIcon:z,alertMessage:B,parts:V,hook:H,contentProps:U,alwaysRenderBody:W=!1,showFooter:G=!0,dismissible:K=!0,defaultStrings:q,showIconByDefault:J=!1}){let{Content:te}=V,Y=(0,l.useId)(),X=a?`${Y}-title`:void 0,Z=o?`${Y}-description`:void 0,Q=C({open:e,onOpenChange:t,onClose:n}),$=x({close:Q.hide,open:Q.open,onConfirm:k,onAsyncConfirm:A,closeOnAsyncComplete:M,confirmTone:ee,loading:P,formId:F,onCancel:O,onError:j,strings:w,...q?{defaults:q}:null,emphasis:L,tone:R}),ne={escape:p&&!$.busy,backdrop:m&&!$.busy},re=G&&(I!==void 0||E||D),ie=W||r!=null||!!B,ae=z??J;return(0,u.jsxs)(i.t,{...Q.overlayProps,children:[(0,l.isValidElement)(T)&&(0,u.jsx)(i.a,{render:T}),(0,u.jsxs)(te,{"aria-labelledby":X,"aria-describedby":Z,...K?{showCloseButton:c&&!$.busy,initialFocusRef:f,dismissal:ne}:null,...U?.({busy:$.busy}),className:(0,d.clsx)(`${H}--component`,b),style:y,children:[s?(0,u.jsx)(v,{title:a,description:o,titleId:X,descriptionId:Z,Title:i.s,Description:i.o}):(!!a||!!o)&&(0,u.jsxs)(i.u,{children:[!!a&&(0,u.jsx)(i.s,{id:X,children:(0,u.jsx)(h,{tone:R,showIcon:ae,children:a})}),!!o&&(0,u.jsx)(i.o,{id:Z,children:o})]}),ie&&(0,u.jsxs)(i.l,{className:S,children:[!!B&&(0,u.jsx)(g,{tone:R,children:B}),r]}),re&&(0,u.jsx)(i.c,{children:I??(0,u.jsx)(_,{copy:$.copy,showCancel:E,showConfirm:D,confirmTone:$.confirmTone,confirmStyle:N,busy:$.busy,formId:F,onCancel:$.cancel,onConfirm:$.confirm})})]})]})}var E={sm:`24rem`,md:`32rem`,lg:`42rem`,xl:`56rem`,full:`100vw`},D={Content:o.t};function O({width:e=`md`,surfaceStyle:t,...n}){return(0,u.jsx)(T,{...n,parts:D,hook:`action-dialog`,surfaceStyle:{"--overlay-max-width":E[e]??e,...t}})}var k={Content:s.t};function A({side:e=`inline-end`,size:t,length:n,inset:r,modality:i=`modal`,showFooter:a=!0,...o}){return(0,u.jsx)(T,{...o,parts:k,hook:`action-sheet`,alwaysRenderBody:!0,showFooter:a,contentProps:()=>({side:e,size:t,length:n,inset:r,modality:i})})}var j={Content:a.r};function M({tone:e,confirmTone:t,destructive:n=!1,...r}){let i=e??(n?`destructive`:`neutral`);return(0,u.jsx)(T,{...r,parts:j,hook:`confirm-dialog`,tone:i,confirmTone:t??(n?`destructive`:`primary`),emphasis:!0,showIconByDefault:!0,defaultStrings:b,dismissible:!1,showFooter:!0})}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return M}});
@@ -1 +1 @@
1
- "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../rolldown-runtime-BocRIvOZ.cjs"),t=require("../typography-LMez-POJ.cjs"),n=require("../feedback-Da53xAUT.cjs"),r=require("../buttons-CMsvnL6-.cjs"),i=require("../tooltip-Dewu4Ynm.cjs"),a=require("../display-BUiiuPS9.cjs"),o=require("../primitives-BP7kGVYZ.cjs"),s=require("../badge-BRX7GXRH.cjs"),c=require("../cards-CO5LHALb.cjs"),l=require("../skeleton-3RdcmQ7K.cjs"),u=require("../chart-BYGLuXR9.cjs");let d=require("lucide-react"),f=require("react"),p=require("react/jsx-runtime"),m=require("recharts");m=e.t(m,1);let h=require("clsx");var g={metricErrorLabel:`Unable to load metric`,metricProgressLabel:e=>`${e} progress`,metricInfoLabel:`More information`},_={currentLabel:`This period`,previousLabel:`Previous period`,suffix:`vs previous`},v={dayLabels:[`Mon`,``,`Wed`,``,`Fri`,``,``],monthNames:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],legendLess:`Less`,legendMore:`More`,formatDay:(e,t)=>`${e}: level ${t}`},y={legendNone:`None`,legendLow:`Low`,legendMedium:`Medium`,legendHigh:`High`,legendNow:`Now`,formatHour:e=>String(e).padStart(2,`0`),formatHourTitle:(e,t)=>`${e}:00 — ${t}`};function b(e){if(e.value===null||e.value===void 0)return`—`;let t=typeof e.value==`number`?e.value:null;if(t===null)return String(e.value);switch(e.valueType){case`currency`:return o.W(t,{currency:e.currency,currencyDisplay:`code`}).replace(/ /g,` `);case`percentage`:return o.q(t);case`duration`:return o.G(t);case`number`:return o.K(t);default:return String(t)}}function x(e){return e.trend?e.trend:e.change?.direction===`up`?`positive`:e.change?.direction===`down`?`negative`:`neutral`}var S={metric:`analytics__metric___ABm3m`,metricError:`analytics__metricError___BXV4k`,metricSpark:`analytics__metricSpark___XK3Mr`,metricTile:`analytics__metricTile___lBSAR`,metricLabelGroup:`analytics__metricLabelGroup___eXcvu`,metricLabelIcon:`analytics__metricLabelIcon___WS-ag`,metricValueRow:`analytics__metricValueRow___eXH_0`,metricCard:`analytics__metricCard___pJGk0`,metricCardBody:`analytics__metricCardBody___0mnKA`,metricDelta:`analytics__metricDelta___7U0sx`,metricInfo:`analytics__metricInfo___gv5VD`,metricMinimal:`analytics__metricMinimal___Mlsnk`,metricCompact:`analytics__metricCompact___V1YVN`,metricCompactBody:`analytics__metricCompactBody___QC64E`,metricPanel:`analytics__metricPanel___LIAJb`,metricHead:`analytics__metricHead___AJY0t`,metricDot:`analytics__metricDot___wtdkg`,metricSegments:`analytics__metricSegments___f02TG`,metricSegment:`analytics__metricSegment___D4FlH`,metricAccent:`analytics__metricAccent___3A2Bv`,metricAccentBody:`analytics__metricAccentBody___KNBI4`,trendChip:`analytics__trendChip___ki9Wj`,trendChipIcon:`analytics__trendChipIcon___WfDeH`,metricSkeleton:`analytics__metricSkeleton___iSZ3B`,skeletonLabel:`analytics__skeletonLabel___JDG-8`,skeletonValue:`analytics__skeletonValue___x94uA`,skeletonSpark:`analytics__skeletonSpark___eFm3T`,metricGridRoot:`analytics__metricGridRoot___-4KDJ`,metricGrid:`analytics__metricGrid___whfsg`,metricBar:`analytics__metricBar___tVCXk`,metricBarRow:`analytics__metricBarRow___gF3Ht`,metricBarPeriod:`analytics__metricBarPeriod___r-BFe`,metricBarCells:`analytics__metricBarCells___YjD3s`,metricBarCell:`analytics__metricBarCell___DXv6t`,metricBarFooter:`analytics__metricBarFooter___KNRS-`,tileLabel:`analytics__tileLabel___o_4pP`,tileValue:`analytics__tileValue___3Ehdx`,tileChange:`analytics__tileChange___R0dqg`,tileSubtitle:`analytics__tileSubtitle___EV2FJ`,tileFooter:`analytics__tileFooter___MWYyp`,comparison:`analytics__comparison___iotur`,comparisonPeriods:`analytics__comparisonPeriods___kXG2t`,comparisonPair:`analytics__comparisonPair___x0EQz`,comparisonBox:`analytics__comparisonBox___zJRGv`,comparisonBoxPrevious:`analytics__comparisonBoxPrevious___YI5pT`,comparisonArrow:`analytics__comparisonArrow___t5JjL`,comparisonArrowWide:`analytics__comparisonArrowWide___ENOy5`,comparisonArrowNarrow:`analytics__comparisonArrowNarrow___8rB0J`,comparisonDelta:`analytics__comparisonDelta___9eVe8`,comparisonChip:`analytics__comparisonChip___f2VX9`,comparisonChipIcon:`analytics__comparisonChipIcon___GLOJW`,comparisonPercent:`analytics__comparisonPercent___p1H1O`,chartCardChart:`analytics__chartCardChart___Xi2Wm`,chartCardFooter:`analytics__chartCardFooter___Czn_7`,heatmap:`analytics__heatmap___AZOwH`,heatmapScroll:`analytics__heatmapScroll___zsgH0`,heatmapMonths:`analytics__heatmapMonths___v46H6`,heatmapMonth:`analytics__heatmapMonth___X8Z3Y`,heatmapBody:`analytics__heatmapBody___TtpZx`,heatmapDays:`analytics__heatmapDays___pMwB2`,heatmapDay:`analytics__heatmapDay___wwn-n`,heatmapWeeks:`analytics__heatmapWeeks___d2bhI`,heatmapWeek:`analytics__heatmapWeek___yHvtf`,heatmapCell:`analytics__heatmapCell___Wx6jb`,heatmapLegend:`analytics__heatmapLegend___Q1Kjo`,ruler:`analytics__ruler___MndUw`,rulerBar:`analytics__rulerBar___fYhMa`,rulerHour:`analytics__rulerHour___pP5gx`,rulerMarker:`analytics__rulerMarker___rTveo`,rulerTicks:`analytics__rulerTicks___NcpDF`,rulerTick:`analytics__rulerTick___28A2K`,rulerLegend:`analytics__rulerLegend___z9OpU`,rulerLegendItem:`analytics__rulerLegendItem___wO3ZD`,rulerSwatch:`analytics__rulerSwatch___Rzxdp`,rulerMarkerSwatch:`analytics__rulerMarkerSwatch___KEiDG`,microGridRoot:`analytics__microGridRoot___Gn1rZ`,microGrid:`analytics__microGrid___Fx2mG`,microCell:`analytics__microCell___EAxNp`,microBars:`analytics__microBars___vGAcD`,microBar:`analytics__microBar___8d6Py`,microDots:`analytics__microDots___LmCvD`,microDot:`analytics__microDot___moAoI`,microProgress:`analytics__microProgress___AnghW`,microMarkRow:`analytics__microMarkRow___O7hVd`,microPie:`analytics__microPie___vJc5y`,microSvg:`analytics__microSvg___d5Icp`,microLine:`analytics__microLine___fkc2Y`,microArea:`analytics__microArea___xcp4z`,gradient:`analytics__gradient___4x1lh`,gradientHead:`analytics__gradientHead___GjlWy`,gradientHeadText:`analytics__gradientHeadText___KXa4Q`,gradientValue:`analytics__gradientValue___mlLhr`,gradientSubtitle:`analytics__gradientSubtitle___511KJ`,gradientChip:`analytics__gradientChip___FvalW`,gradientPlot:`analytics__gradientPlot___k5Yi_`};function C({variant:e=`default`,className:t,...n}){return(0,p.jsxs)(a.l,{surface:e===`accent`?`card`:`plain`,"data-variant":e,"aria-busy":`true`,className:(0,h.clsx)(`metric-skeleton--component`,S.metricSkeleton,t),...n,children:[(0,p.jsx)(l.o,{className:S.skeletonLabel}),(0,p.jsx)(l.o,{className:S.skeletonValue}),e!==`minimal`&&e!==`compact`&&(0,p.jsx)(l.o,{className:S.skeletonSpark})]})}var w={up:d.ArrowUpIcon,down:d.ArrowDownIcon,neutral:d.MinusIcon};function T(e,t){return e||(t===`up`?`positive`:t===`down`?`negative`:`neutral`)}function E({change:e,trend:n,variant:r=`default`,className:i,...a}){let o=T(n,e.direction),s=w[e.direction],c=e.direction===`up`?`+`:``;return(0,p.jsxs)(`span`,{"data-tone":o,"data-variant":r,className:(0,h.clsx)(`metric-trend-chip--component`,S.trendChip,i),...a,children:[r!==`inline`&&(0,p.jsx)(s,{className:S.trendChipIcon,"aria-hidden":`true`}),(0,p.jsxs)(t.o,{tag:`span`,type:`inherit`,size:`xs`,weight:`medium`,numeric:!0,className:`metric-trend-chip--value`,children:[c,e.value]}),e.label!=null&&(0,p.jsx)(t.o,{tag:`span`,size:`xs`,type:`secondary`,className:`metric-trend-chip--label`,children:e.label})]})}var D=16,O={positive:`success`,negative:`destructive`,neutral:`neutral`};function k({data:e,variant:n=`default`,tone:r=`neutral`,showSparkline:o=!0,showChange:s=!0,showIcon:l=!0,loading:f=!1,error:m=!1,strings:_,progress:v=0,className:y,...w}){let T={...g,..._},k=b(e),A=x(e),j=e.icon,M=o&&!!e.sparkline?.length,N=s&&!!e.change,P=(0,h.clsx)(`metric--component`,S.metric,y);if(f)return(0,p.jsx)(C,{variant:n,className:P});if(m)return(0,p.jsx)(a.l,{surface:`card`,"data-variant":n,className:(0,h.clsx)(P,S.metricError),...w,children:(0,p.jsx)(t.o,{type:`secondary`,children:T.metricErrorLabel})});let F=M?(0,p.jsx)(u.t,{data:e.sparkline,tone:O[A],className:(0,h.clsx)(`metric--sparkline`,S.metricSpark)}):null,I=t=>N?(0,p.jsx)(E,{change:e.change,trend:e.trend,variant:t}):null;if(n===`minimal`)return(0,p.jsxs)(`span`,{"data-variant":`minimal`,className:(0,h.clsx)(P,S.metricMinimal),...w,children:[(0,p.jsxs)(t.i,{className:`metric--label`,children:[e.label,`:`]}),(0,p.jsx)(t.o,{tag:`span`,weight:`semibold`,numeric:!0,className:`metric--value`,children:k}),I(`inline`)]});if(n===`card`)return(0,p.jsxs)(c.i,{"data-variant":`card`,className:(0,h.clsx)(P,S.metricCard),onClick:e.onClick,...w,children:[(0,p.jsxs)(`div`,{className:S.metricCardBody,children:[(0,p.jsxs)(`span`,{className:S.metricLabelGroup,children:[l&&j&&(0,p.jsx)(j,{className:S.metricLabelIcon,"aria-hidden":`true`}),(0,p.jsx)(t.i,{className:`metric--label`,children:e.label}),!!e.tooltip&&(0,p.jsxs)(i.t,{children:[(0,p.jsx)(i.i,{render:(0,p.jsx)(`button`,{type:`button`,"data-hit-area":!0,className:S.metricInfo,"aria-label":T.metricInfoLabel??g.metricInfoLabel}),children:(0,p.jsx)(d.InfoIcon,{"aria-hidden":`true`})}),(0,p.jsx)(i.n,{children:e.tooltip})]})]}),(0,p.jsx)(t.o,{size:`lg`,weight:`bold`,numeric:!0,lineHeight:`tight`,truncate:!0,title:k,className:`metric--value`,children:k}),(N||e.subtitle!=null)&&(0,p.jsxs)(`div`,{className:S.metricDelta,children:[I(`badge`),e.subtitle!=null&&(0,p.jsx)(t.o,{tag:`span`,size:`xs`,type:`secondary`,className:`metric--subtitle`,children:e.subtitle})]})]}),F,e.footer!=null&&(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,className:`metric--footer`,children:e.footer})]});if(n===`compact`)return(0,p.jsxs)(`div`,{"data-variant":`compact`,className:(0,h.clsx)(P,S.metricCompact),...w,children:[l&&j&&(0,p.jsx)(a.u,{icon:j,"aria-hidden":`true`}),(0,p.jsxs)(`div`,{className:S.metricCompactBody,children:[(0,p.jsx)(t.i,{className:`metric--label`,children:e.label}),(0,p.jsx)(t.o,{weight:`bold`,numeric:!0,lineHeight:`tight`,className:`metric--value`,children:k})]}),I(`badge`)]});if(n===`accent`)return(0,p.jsxs)(`div`,{"data-variant":`accent`,"data-theme":`dark`,className:(0,h.clsx)(P,S.metricAccent),...w,children:[(0,p.jsxs)(`div`,{className:S.metricAccentBody,children:[(0,p.jsxs)(`div`,{className:S.metricHead,children:[(0,p.jsx)(t.i,{className:`metric--label`,children:e.label}),l&&j&&(0,p.jsx)(a.u,{icon:j,"aria-hidden":`true`})]}),(0,p.jsxs)(`div`,{className:S.metricValueRow,children:[(0,p.jsx)(t.o,{size:`lg`,weight:`bold`,numeric:!0,lineHeight:`none`,className:`metric--value`,children:k}),I(`compact`)]}),e.subtitle!=null&&(0,p.jsx)(t.o,{size:`xs`,className:`metric--subtitle`,children:e.subtitle})]}),F]});if(n===`colored`){let n=Math.min(Math.max(v,0),100),i=Math.round(n/100*D);return(0,p.jsxs)(a.l,{surface:`card`,"data-variant":`colored`,"data-tone":r,className:(0,h.clsx)(P,S.metricPanel),...w,children:[(0,p.jsxs)(`div`,{className:S.metricHead,children:[(0,p.jsx)(t.i,{className:`metric--label`,children:e.label}),(0,p.jsx)(`span`,{className:S.metricDot,"aria-hidden":`true`})]}),(0,p.jsxs)(`div`,{className:S.metricValueRow,children:[(0,p.jsx)(t.o,{size:`lg`,weight:`bold`,numeric:!0,lineHeight:`none`,className:`metric--value`,children:k}),e.subtitle!=null&&(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,className:`metric--subtitle`,children:e.subtitle})]}),(0,p.jsx)(`div`,{className:S.metricSegments,role:`progressbar`,"aria-label":T.metricProgressLabel(e.label),"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,children:Array.from({length:D},(e,t)=>(0,p.jsx)(`span`,{"data-filled":t<i?``:void 0,className:S.metricSegment},t))}),I(`default`),e.footer!=null&&(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,className:`metric--footer`,children:e.footer})]})}return n===`bordered`?(0,p.jsxs)(a.l,{surface:`card`,"data-variant":`bordered`,"data-tone":r,className:(0,h.clsx)(P,S.metricPanel),...w,children:[(0,p.jsxs)(`div`,{className:S.metricHead,children:[(0,p.jsxs)(`span`,{className:S.metricLabelGroup,children:[l&&j&&(0,p.jsx)(j,{className:S.metricLabelIcon,"aria-hidden":`true`}),(0,p.jsx)(t.i,{className:`metric--label`,children:e.label})]}),I(`badge`)]}),(0,p.jsx)(t.o,{size:`lg`,weight:`bold`,numeric:!0,lineHeight:`none`,className:`metric--value`,children:k}),e.subtitle!=null&&(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,className:`metric--subtitle`,children:e.subtitle}),F,e.footer!=null&&(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,className:`metric--footer`,children:e.footer})]}):(0,p.jsxs)(`div`,{"data-variant":`default`,className:(0,h.clsx)(P,S.metricTile),...w,children:[(0,p.jsxs)(`span`,{className:(0,h.clsx)(S.metricLabelGroup,S.tileLabel),children:[l&&j&&(0,p.jsx)(j,{className:S.metricLabelIcon,"aria-hidden":`true`}),(0,p.jsx)(t.i,{className:`metric--label`,children:e.label})]}),(0,p.jsx)(t.o,{size:`lg`,weight:`bold`,numeric:!0,lineHeight:`tight`,truncate:!0,title:k,className:(0,h.clsx)(`metric--value`,S.tileValue),children:k}),N&&(0,p.jsx)(E,{change:e.change,trend:e.trend,variant:`compact`,className:S.tileChange}),e.subtitle!=null&&(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,className:(0,h.clsx)(`metric--subtitle`,S.tileSubtitle),children:e.subtitle}),F,e.footer!=null&&(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,className:(0,h.clsx)(`metric--footer`,S.tileFooter),children:e.footer})]})}function A({metrics:e,period:n,onPeriodChange:i,showSparklines:o=!0,showChanges:s=!0,footerText:c,className:l,...u}){return(0,p.jsxs)(a.l,{surface:`card`,flush:!0,className:(0,h.clsx)(`metric-bar--component`,S.metricBar,l),...u,children:[(0,p.jsxs)(`div`,{className:S.metricBarRow,children:[n&&(0,p.jsx)(`div`,{className:S.metricBarPeriod,children:(0,p.jsxs)(r.c,{tone:`secondary`,buttonStyle:`ghost`,onClick:i?()=>i(n.value):void 0,children:[(0,p.jsx)(d.CalendarIcon,{"aria-hidden":`true`}),n.label]})}),(0,p.jsx)(`div`,{className:S.metricBarCells,children:e.map(e=>(0,p.jsx)(`div`,{className:S.metricBarCell,children:(0,p.jsx)(k,{data:e,variant:`default`,showSparkline:o,showChange:s})},e.id))})]}),c!=null&&(0,p.jsx)(`div`,{className:S.metricBarFooter,children:(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,children:c})})]})}function j(e){return e<=1?1:e===2?2:e===3?3:e===4?4:e<=6?6:4}function M({metrics:e,variant:t=`card`,tone:n=`neutral`,columns:r=`auto`,showSparklines:i=!0,showChanges:a=!0,showIcons:o=!0,loading:s=!1,className:c,...l}){let u=r===`auto`?j(e.length):r;return(0,p.jsx)(`div`,{className:(0,h.clsx)(`metric-grid--component`,S.metricGridRoot,c),...l,children:(0,p.jsx)(`div`,{"data-columns":u,className:(0,h.clsx)(`metric-grid--grid`,S.metricGrid),children:e.map(e=>(0,p.jsx)(k,{data:e,variant:t,tone:n,showSparkline:i,showChange:a,showIcon:o,loading:s},e.id))})})}function N(e){if(e==null)return null;if(typeof e==`number`)return e;let t=Number(e);return Number.isFinite(t)?t:null}function P({current:e,previous:n,currentPeriod:r,previousPeriod:i,strings:o,className:c,...l}){let u={..._,...o},f=N(e.value),m=N(n.value),g=f!==null&&m!==null,v=g?f-m:0,y=g&&m!==0?Math.round(v/m*100):null,x=v===0,C=v>0,w=x?d.EqualIcon:C?d.ArrowUpIcon:d.ArrowDownIcon,T=x?`neutral`:C?`positive`:`negative`,E=b({...e,value:Math.abs(v)});return(0,p.jsxs)(`div`,{className:(0,h.clsx)(`metric-comparison--component`,S.comparison,c),...l,children:[(r!=null||i!=null)&&(0,p.jsxs)(`div`,{className:S.comparisonPeriods,children:[r!=null&&(0,p.jsx)(s.t,{tone:`secondary`,children:r}),i!=null&&(0,p.jsx)(s.t,{tone:`secondary`,children:i})]}),(0,p.jsxs)(`div`,{className:S.comparisonPair,children:[(0,p.jsxs)(a.l,{surface:`card`,className:S.comparisonBox,children:[(0,p.jsx)(t.i,{children:u.currentLabel}),(0,p.jsx)(t.o,{size:`lg`,weight:`semibold`,numeric:!0,lineHeight:`tight`,children:b(e)})]}),(0,p.jsxs)(`div`,{className:S.comparisonArrow,"aria-hidden":`true`,children:[(0,p.jsx)(d.ArrowRightIcon,{className:S.comparisonArrowWide}),(0,p.jsx)(d.ArrowDownIcon,{className:S.comparisonArrowNarrow})]}),(0,p.jsxs)(a.l,{surface:`card`,className:(0,h.clsx)(S.comparisonBox,S.comparisonBoxPrevious),children:[(0,p.jsx)(t.i,{children:u.previousLabel}),(0,p.jsx)(t.o,{size:`lg`,weight:`semibold`,numeric:!0,lineHeight:`tight`,type:`secondary`,children:b(n)})]})]}),g&&(0,p.jsxs)(`div`,{"data-tone":T,className:S.comparisonDelta,children:[(0,p.jsxs)(`span`,{className:S.comparisonChip,children:[(0,p.jsx)(w,{className:S.comparisonChipIcon,"aria-hidden":`true`}),(0,p.jsxs)(t.o,{tag:`span`,size:`xs`,weight:`semibold`,numeric:!0,children:[C?`+`:x?``:`−`,E]})]}),y!==null&&(0,p.jsxs)(t.o,{size:`xs`,numeric:!0,className:S.comparisonPercent,children:[C?`+`:x?``:`−`,Math.abs(y),`%`]}),(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,children:u.suffix})]})]})}var F=[`bars`,`line`,`dots`,`progress`,`area`,`pie`];function I(e){let t=Math.max(...e,0),n=Math.min(...e,0),r=t-n||1;return e.map(e=>(e-n)/r)}function L(e,t){let n=I(e),r=60/Math.max(n.length-1,1);return n.map((e,n)=>`${n*r},${t-e*(t-2)}`)}function R({kind:e,data:t,label:r}){if(e===`bars`){let e=I(t.slice(0,6));return(0,p.jsx)(`span`,{className:S.microBars,"aria-hidden":`true`,children:e.map((e,t)=>(0,p.jsx)(`span`,{className:S.microBar,style:{"--micro-bar":`${Math.max(e,.08)*100}%`}},t))})}if(e===`dots`){let e=I(t.slice(0,5));return(0,p.jsx)(`span`,{className:S.microDots,"aria-hidden":`true`,children:e.map((e,t)=>(0,p.jsx)(`span`,{className:S.microDot,style:{"--micro-dot":`${Math.round(e*12)}px`}},t))})}if(e===`progress`){let[e=0,i=100]=t;return(0,p.jsx)(n.s,{value:e,max:i,label:r,className:S.microProgress})}if(e===`pie`){let e=t.reduce((e,t)=>e+t,0)||1,n=t.slice(0,3),r=n.map((t,r)=>{let i=n.slice(0,r).reduce((e,t)=>e+t,0),a=i/e*100,o=(i+t)/e*100;return`var(--chart-${r+1}) ${a}% ${o}%`});return(0,p.jsx)(`span`,{className:S.microMarkRow,"aria-hidden":`true`,children:(0,p.jsx)(`span`,{className:S.microPie,style:{"--micro-pie":`conic-gradient(${r.join(`, `)})`}})})}let i=L(t.slice(0,8),16);return e===`area`?(0,p.jsx)(`svg`,{viewBox:`0 0 60 16`,className:S.microSvg,preserveAspectRatio:`none`,"aria-hidden":`true`,children:(0,p.jsx)(`polygon`,{className:S.microArea,points:`0,16 ${i.join(` `)} 60,16`})}):(0,p.jsx)(`svg`,{viewBox:`0 0 60 16`,className:S.microSvg,preserveAspectRatio:`none`,"aria-hidden":`true`,children:(0,p.jsx)(`polyline`,{className:S.microLine,points:i.join(` `)})})}function z({cells:e,className:n,...r}){return(0,p.jsx)(`div`,{className:(0,h.clsx)(`metric-micro-grid--component`,S.microGridRoot,n),...r,children:(0,p.jsx)(a.l,{surface:`bordered`,flush:!0,className:S.microGrid,children:e.map((e,n)=>{let r=e.chart??F[n%F.length]??`bars`;return(0,p.jsxs)(`div`,{className:(0,h.clsx)(`metric-micro-grid--cell`,S.microCell),children:[(0,p.jsx)(t.i,{children:e.label}),(0,p.jsx)(t.o,{weight:`semibold`,numeric:!0,lineHeight:`tight`,className:`metric-micro-grid--value`,children:e.value}),(0,p.jsx)(R,{kind:r,data:e.data,label:e.label})]},e.id??e.label)})})})}function B({title:e,value:n,change:r,data:i,theme:a=`cool`,subtitle:o,className:s,...c}){let l=`metric-gradient-${(0,f.useId)().replaceAll(`:`,``)}`;return(0,p.jsxs)(`div`,{"data-theme-ramp":a,"data-theme":`dark`,className:(0,h.clsx)(`metric-gradient--component`,S.gradient,s),...c,children:[(0,p.jsxs)(`div`,{className:S.gradientHead,children:[(0,p.jsxs)(`div`,{className:S.gradientHeadText,children:[(0,p.jsx)(t.i,{children:e}),n!=null&&(0,p.jsx)(t.o,{size:`lg`,weight:`bold`,numeric:!0,lineHeight:`none`,className:S.gradientValue,children:n}),o!=null&&(0,p.jsx)(t.o,{size:`xs`,className:S.gradientSubtitle,children:o})]}),r&&(0,p.jsx)(E,{change:r,variant:`badge`,className:S.gradientChip})]}),(0,p.jsx)(`div`,{className:S.gradientPlot,children:(0,p.jsx)(m.ResponsiveContainer,{width:`100%`,height:`100%`,initialDimension:{width:1,height:1},children:(0,p.jsxs)(m.AreaChart,{data:i,margin:{top:4,right:0,bottom:0,left:0},children:[(0,p.jsx)(`defs`,{children:(0,p.jsxs)(`linearGradient`,{id:l,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,p.jsx)(`stop`,{offset:`0%`,stopColor:`var(--foreground)`,stopOpacity:.3}),(0,p.jsx)(`stop`,{offset:`100%`,stopColor:`var(--foreground)`,stopOpacity:0})]})}),(0,p.jsx)(m.Area,{type:`monotone`,dataKey:`value`,stroke:`var(--muted-foreground)`,strokeWidth:2,fill:`url(#${l})`,dot:!1,activeDot:!1,isAnimationActive:!1})]})})})]})}function V(e,t){if(e.length===0)return{weeks:[],months:[]};let n=[...e].sort((e,t)=>e.date.localeCompare(t.date)),r=n[0],i=n[n.length-1];if(!r||!i)return{weeks:[],months:[]};let a=new Date(`${r.date}T00:00:00`),o=new Date(`${i.date}T00:00:00`),s=a.getDay(),c=new Date(a);c.setDate(c.getDate()+(s===0?-6:1-s));let l=new Map(n.map(e=>[e.date,e.level])),u=[],d=[],f=[],p=-1;for(;c<=o;){let e=`${c.getFullYear()}-${String(c.getMonth()+1).padStart(2,`0`)}-${String(c.getDate()).padStart(2,`0`)}`,n=(c.getDay()+6)%7;if(n===0&&f.length>0&&(u.push(f),f=[]),c.getMonth()!==p){let e=n===0?u.length:u.length+1,r=t[c.getMonth()];r&&!d.some(t=>t.weekIndex===e)&&d.push({label:r,weekIndex:e}),p=c.getMonth()}f.push({date:e,level:l.get(e)??0}),c.setDate(c.getDate()+1)}if(f.length>0){for(;f.length<7;)f.push(null);u.push(f)}return{weeks:u,months:d}}var H=[0,1,2,3,4];function U({data:e,strings:n,className:r,...i}){let a={...v,...n},{weeks:o,months:s}=V(e,a.monthNames),c=s.filter((e,t,n)=>{let r=n[t-1];return!r||e.weekIndex-r.weekIndex>=3});return(0,p.jsxs)(`div`,{className:(0,h.clsx)(`activity-heatmap--component`,S.heatmap,r),...i,children:[(0,p.jsxs)(`div`,{className:S.heatmapScroll,children:[(0,p.jsx)(`div`,{className:S.heatmapMonths,style:{"--heatmap-weeks":o.length},children:c.map(e=>(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,className:S.heatmapMonth,style:{"--heatmap-week":e.weekIndex},children:e.label},`${e.label}-${e.weekIndex}`))}),(0,p.jsxs)(`div`,{className:S.heatmapBody,children:[(0,p.jsx)(`div`,{className:S.heatmapDays,children:a.dayLabels.map((e,n)=>(0,p.jsx)(`span`,{className:S.heatmapDay,children:e?(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,children:e}):null},n))}),(0,p.jsx)(`div`,{className:S.heatmapWeeks,children:o.map((e,t)=>(0,p.jsx)(`div`,{className:S.heatmapWeek,children:e.map((e,t)=>(0,p.jsx)(`span`,{"data-level":e?e.level:void 0,"data-empty":e?void 0:``,className:S.heatmapCell,title:e?a.formatDay(e.date,e.level):void 0},t))},t))})]})]}),(0,p.jsxs)(`div`,{className:S.heatmapLegend,children:[(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,children:a.legendLess}),H.map(e=>(0,p.jsx)(`span`,{"data-level":e,className:S.heatmapCell,"aria-hidden":`true`},e)),(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,children:a.legendMore})]})]})}function W({config:e,children:t,footer:n,className:r,...i}){return(0,p.jsxs)(a.l,{className:(0,h.clsx)(`chart-card--component`,r),...i,children:[(0,p.jsx)(u.n,{config:e,label:typeof i.title==`string`?i.title:void 0,className:(0,h.clsx)(`chart-card--chart`,S.chartCardChart),children:t}),n!=null&&(0,p.jsx)(`div`,{className:S.chartCardFooter,children:n})]})}function G(e,t){if(e===0)return 0;let n=e/t;return n<1/3?1:n<2/3?2:3}function K({hours:e,currentHour:n,strings:r,className:i,...a}){let o={...y,...r},s=Math.max(...e,1),c=e.indexOf(Math.max(...e)),l=n!==void 0&&n>=0&&n<24;return(0,p.jsxs)(`div`,{className:(0,h.clsx)(`time-ruler--component`,S.ruler,i),...a,children:[(0,p.jsxs)(`div`,{className:S.rulerBar,children:[e.map((e,t)=>(0,p.jsx)(`span`,{"data-band":G(e,s),"data-peak":t===c?``:void 0,className:S.rulerHour,title:o.formatHourTitle(o.formatHour(t),e)},t)),l&&(0,p.jsx)(`span`,{"aria-hidden":`true`,className:S.rulerMarker,style:{"--ruler-now":n}})]}),(0,p.jsx)(`div`,{className:S.rulerTicks,children:e.map((e,n)=>(0,p.jsx)(`span`,{className:S.rulerTick,children:n%4==0&&(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,numeric:!0,children:o.formatHour(n)})},n))}),(0,p.jsxs)(`div`,{className:S.rulerLegend,children:[[0,1,2,3].map(e=>(0,p.jsxs)(`span`,{className:S.rulerLegendItem,children:[(0,p.jsx)(`span`,{"data-band":e,className:S.rulerSwatch,"aria-hidden":`true`}),(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,children:[o.legendNone,o.legendLow,o.legendMedium,o.legendHigh][e]})]},e)),l&&(0,p.jsxs)(`span`,{className:S.rulerLegendItem,children:[(0,p.jsx)(`span`,{className:S.rulerMarkerSwatch,"aria-hidden":`true`}),(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,children:o.legendNow})]})]})]})}exports.ActivityHeatmap=U,exports.ChartCard=W,exports.Metric=k,exports.MetricBar=A,exports.MetricComparison=P,exports.MetricGradient=B,exports.MetricGrid=M,exports.MetricMicroGrid=z,exports.MetricSkeleton=C,exports.MetricTrendChip=E,exports.TimeRuler=K,exports.defaultActivityHeatmapStrings=v,exports.defaultAnalyticsStrings=g,exports.defaultMetricComparisonStrings=_,exports.defaultTimeRulerStrings=y,exports.formatMetricValue=b,exports.resolveTrend=x;
1
+ "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../rolldown-runtime-BocRIvOZ.cjs"),t=require("../typography-Cf5zEv4y.cjs"),n=require("../feedback-IpUFKqgv.cjs"),r=require("../buttons-Dwl42fIr.cjs"),i=require("../tooltip-CEcUVmor.cjs"),a=require("../display-CFj87iEn.cjs"),o=require("../primitives-kywiHMJE.cjs"),s=require("../badge-BRX7GXRH.cjs"),c=require("../cards-DQPevRTY.cjs"),l=require("../skeleton-DeuQS4AK.cjs"),u=require("../chart-BYGLuXR9.cjs");let d=require("lucide-react"),f=require("react"),p=require("react/jsx-runtime"),m=require("recharts");m=e.t(m,1);let h=require("clsx");var g={metricErrorLabel:`Unable to load metric`,metricProgressLabel:e=>`${e} progress`,metricInfoLabel:`More information`},_={currentLabel:`This period`,previousLabel:`Previous period`,suffix:`vs previous`},v={dayLabels:[`Mon`,``,`Wed`,``,`Fri`,``,``],monthNames:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],legendLess:`Less`,legendMore:`More`,formatDay:(e,t)=>`${e}: level ${t}`},y={legendNone:`None`,legendLow:`Low`,legendMedium:`Medium`,legendHigh:`High`,legendNow:`Now`,formatHour:e=>String(e).padStart(2,`0`),formatHourTitle:(e,t)=>`${e}:00 — ${t}`};function b(e){if(e.value===null||e.value===void 0)return`—`;let t=typeof e.value==`number`?e.value:null;if(t===null)return String(e.value);switch(e.valueType){case`currency`:return o.W(t,{currency:e.currency,currencyDisplay:`code`}).replace(/ /g,` `);case`percentage`:return o.q(t);case`duration`:return o.G(t);case`number`:return o.K(t);default:return String(t)}}function x(e){return e.trend?e.trend:e.change?.direction===`up`?`positive`:e.change?.direction===`down`?`negative`:`neutral`}var S={metric:`analytics__metric___ABm3m`,metricError:`analytics__metricError___BXV4k`,metricSpark:`analytics__metricSpark___XK3Mr`,metricTile:`analytics__metricTile___lBSAR`,metricLabelGroup:`analytics__metricLabelGroup___eXcvu`,metricLabelIcon:`analytics__metricLabelIcon___WS-ag`,metricValueRow:`analytics__metricValueRow___eXH_0`,metricCard:`analytics__metricCard___pJGk0`,metricCardBody:`analytics__metricCardBody___0mnKA`,metricDelta:`analytics__metricDelta___7U0sx`,metricInfo:`analytics__metricInfo___gv5VD`,metricMinimal:`analytics__metricMinimal___Mlsnk`,metricCompact:`analytics__metricCompact___V1YVN`,metricCompactBody:`analytics__metricCompactBody___QC64E`,metricPanel:`analytics__metricPanel___LIAJb`,metricHead:`analytics__metricHead___AJY0t`,metricDot:`analytics__metricDot___wtdkg`,metricSegments:`analytics__metricSegments___f02TG`,metricSegment:`analytics__metricSegment___D4FlH`,metricAccent:`analytics__metricAccent___3A2Bv`,metricAccentBody:`analytics__metricAccentBody___KNBI4`,trendChip:`analytics__trendChip___ki9Wj`,trendChipIcon:`analytics__trendChipIcon___WfDeH`,metricSkeleton:`analytics__metricSkeleton___iSZ3B`,skeletonLabel:`analytics__skeletonLabel___JDG-8`,skeletonValue:`analytics__skeletonValue___x94uA`,skeletonSpark:`analytics__skeletonSpark___eFm3T`,metricGridRoot:`analytics__metricGridRoot___-4KDJ`,metricGrid:`analytics__metricGrid___whfsg`,metricBar:`analytics__metricBar___tVCXk`,metricBarRow:`analytics__metricBarRow___gF3Ht`,metricBarPeriod:`analytics__metricBarPeriod___r-BFe`,metricBarCells:`analytics__metricBarCells___YjD3s`,metricBarCell:`analytics__metricBarCell___DXv6t`,metricBarFooter:`analytics__metricBarFooter___KNRS-`,tileLabel:`analytics__tileLabel___o_4pP`,tileValue:`analytics__tileValue___3Ehdx`,tileChange:`analytics__tileChange___R0dqg`,tileSubtitle:`analytics__tileSubtitle___EV2FJ`,tileFooter:`analytics__tileFooter___MWYyp`,comparison:`analytics__comparison___iotur`,comparisonPeriods:`analytics__comparisonPeriods___kXG2t`,comparisonPair:`analytics__comparisonPair___x0EQz`,comparisonBox:`analytics__comparisonBox___zJRGv`,comparisonBoxPrevious:`analytics__comparisonBoxPrevious___YI5pT`,comparisonArrow:`analytics__comparisonArrow___t5JjL`,comparisonArrowWide:`analytics__comparisonArrowWide___ENOy5`,comparisonArrowNarrow:`analytics__comparisonArrowNarrow___8rB0J`,comparisonDelta:`analytics__comparisonDelta___9eVe8`,comparisonChip:`analytics__comparisonChip___f2VX9`,comparisonChipIcon:`analytics__comparisonChipIcon___GLOJW`,chartCardChart:`analytics__chartCardChart___Xi2Wm`,chartCardFooter:`analytics__chartCardFooter___Czn_7`,heatmap:`analytics__heatmap___AZOwH`,heatmapScroll:`analytics__heatmapScroll___zsgH0`,heatmapMonths:`analytics__heatmapMonths___v46H6`,heatmapMonth:`analytics__heatmapMonth___X8Z3Y`,heatmapBody:`analytics__heatmapBody___TtpZx`,heatmapDays:`analytics__heatmapDays___pMwB2`,heatmapDay:`analytics__heatmapDay___wwn-n`,heatmapWeeks:`analytics__heatmapWeeks___d2bhI`,heatmapWeek:`analytics__heatmapWeek___yHvtf`,heatmapCell:`analytics__heatmapCell___Wx6jb`,heatmapLegend:`analytics__heatmapLegend___Q1Kjo`,ruler:`analytics__ruler___MndUw`,rulerBar:`analytics__rulerBar___fYhMa`,rulerHour:`analytics__rulerHour___pP5gx`,rulerMarker:`analytics__rulerMarker___rTveo`,rulerTicks:`analytics__rulerTicks___NcpDF`,rulerTick:`analytics__rulerTick___28A2K`,rulerLegend:`analytics__rulerLegend___z9OpU`,rulerLegendItem:`analytics__rulerLegendItem___wO3ZD`,rulerSwatch:`analytics__rulerSwatch___Rzxdp`,rulerMarkerSwatch:`analytics__rulerMarkerSwatch___KEiDG`,microGridRoot:`analytics__microGridRoot___Gn1rZ`,microGrid:`analytics__microGrid___Fx2mG`,microCell:`analytics__microCell___EAxNp`,microBars:`analytics__microBars___vGAcD`,microBar:`analytics__microBar___8d6Py`,microDots:`analytics__microDots___LmCvD`,microDot:`analytics__microDot___moAoI`,microProgress:`analytics__microProgress___AnghW`,microMarkRow:`analytics__microMarkRow___O7hVd`,microPie:`analytics__microPie___vJc5y`,microSvg:`analytics__microSvg___d5Icp`,microLine:`analytics__microLine___fkc2Y`,microArea:`analytics__microArea___xcp4z`,gradient:`analytics__gradient___4x1lh`,gradientHead:`analytics__gradientHead___GjlWy`,gradientHeadText:`analytics__gradientHeadText___KXa4Q`,gradientChip:`analytics__gradientChip___FvalW`,gradientPlot:`analytics__gradientPlot___k5Yi_`};function C({variant:e=`default`,className:t,...n}){return(0,p.jsxs)(a.l,{surface:e===`accent`?`card`:`plain`,"data-variant":e,"aria-busy":`true`,className:(0,h.clsx)(`metric-skeleton--component`,S.metricSkeleton,t),...n,children:[(0,p.jsx)(l.o,{className:S.skeletonLabel}),(0,p.jsx)(l.o,{className:S.skeletonValue}),e!==`minimal`&&e!==`compact`&&(0,p.jsx)(l.o,{className:S.skeletonSpark})]})}var w={up:d.ArrowUpIcon,down:d.ArrowDownIcon,neutral:d.MinusIcon};function T(e,t){return e||(t===`up`?`positive`:t===`down`?`negative`:`neutral`)}function E({change:e,trend:n,variant:r=`default`,className:i,...a}){let o=T(n,e.direction),s=w[e.direction],c=e.direction===`up`?`+`:``;return(0,p.jsxs)(`span`,{"data-tone":o,"data-variant":r,className:(0,h.clsx)(`metric-trend-chip--component`,S.trendChip,i),...a,children:[r!==`inline`&&(0,p.jsx)(s,{className:S.trendChipIcon,"aria-hidden":`true`}),(0,p.jsxs)(t.o,{tag:`span`,type:`inherit`,size:`xs`,weight:`medium`,numeric:!0,className:`metric-trend-chip--value`,children:[c,e.value]}),e.label!=null&&(0,p.jsx)(t.o,{tag:`span`,size:`xs`,type:`secondary`,className:`metric-trend-chip--label`,children:e.label})]})}var D=16,O={positive:`success`,negative:`destructive`,neutral:`neutral`};function k({data:e,variant:n=`default`,tone:r=`neutral`,showSparkline:o=!0,showChange:s=!0,showIcon:l=!0,loading:f=!1,error:m=!1,strings:_,progress:v=0,className:y,...w}){let T={...g,..._},k=b(e),A=x(e),j=e.icon,M=o&&!!e.sparkline?.length,N=s&&!!e.change,P=(0,h.clsx)(`metric--component`,S.metric,y);if(f)return(0,p.jsx)(C,{variant:n,className:P});if(m)return(0,p.jsx)(a.l,{surface:`card`,"data-variant":n,className:(0,h.clsx)(P,S.metricError),...w,children:(0,p.jsx)(t.o,{type:`secondary`,children:T.metricErrorLabel})});let F=M?(0,p.jsx)(u.t,{data:e.sparkline,tone:O[A],className:(0,h.clsx)(`metric--sparkline`,S.metricSpark)}):null,I=t=>N?(0,p.jsx)(E,{change:e.change,trend:e.trend,variant:t}):null;if(n===`minimal`)return(0,p.jsxs)(`span`,{"data-variant":`minimal`,className:(0,h.clsx)(P,S.metricMinimal),...w,children:[(0,p.jsxs)(t.i,{className:`metric--label`,children:[e.label,`:`]}),(0,p.jsx)(t.o,{tag:`span`,weight:`semibold`,numeric:!0,className:`metric--value`,children:k}),I(`inline`)]});if(n===`card`)return(0,p.jsxs)(c.i,{"data-variant":`card`,className:(0,h.clsx)(P,S.metricCard),onClick:e.onClick,...w,children:[(0,p.jsxs)(`div`,{className:S.metricCardBody,children:[(0,p.jsxs)(`span`,{className:S.metricLabelGroup,children:[l&&j&&(0,p.jsx)(j,{className:S.metricLabelIcon,"aria-hidden":`true`}),(0,p.jsx)(t.i,{className:`metric--label`,children:e.label}),!!e.tooltip&&(0,p.jsxs)(i.t,{children:[(0,p.jsx)(i.i,{render:(0,p.jsx)(`button`,{type:`button`,"data-hit-area":!0,className:S.metricInfo,"aria-label":T.metricInfoLabel??g.metricInfoLabel}),children:(0,p.jsx)(d.InfoIcon,{"aria-hidden":`true`})}),(0,p.jsx)(i.n,{children:e.tooltip})]})]}),(0,p.jsx)(t.o,{size:`lg`,weight:`semibold`,numeric:!0,lineHeight:`tight`,truncate:!0,title:k,className:`metric--value`,children:k}),(N||e.subtitle!=null)&&(0,p.jsxs)(`div`,{className:S.metricDelta,children:[I(`badge`),e.subtitle!=null&&(0,p.jsx)(t.o,{tag:`span`,size:`xs`,type:`secondary`,className:`metric--subtitle`,children:e.subtitle})]})]}),F,e.footer!=null&&(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,className:`metric--footer`,children:e.footer})]});if(n===`compact`)return(0,p.jsxs)(`div`,{"data-variant":`compact`,className:(0,h.clsx)(P,S.metricCompact),...w,children:[l&&j&&(0,p.jsx)(a.u,{icon:j,"aria-hidden":`true`}),(0,p.jsxs)(`div`,{className:S.metricCompactBody,children:[(0,p.jsx)(t.i,{className:`metric--label`,children:e.label}),(0,p.jsx)(t.o,{weight:`semibold`,numeric:!0,lineHeight:`tight`,className:`metric--value`,children:k})]}),I(`badge`)]});if(n===`accent`)return(0,p.jsxs)(`div`,{"data-variant":`accent`,"data-theme":`dark`,className:(0,h.clsx)(P,S.metricAccent),...w,children:[(0,p.jsxs)(`div`,{className:S.metricAccentBody,children:[(0,p.jsxs)(`div`,{className:S.metricHead,children:[(0,p.jsx)(t.i,{className:`metric--label`,children:e.label}),l&&j&&(0,p.jsx)(a.u,{icon:j,"aria-hidden":`true`})]}),(0,p.jsxs)(`div`,{className:S.metricValueRow,children:[(0,p.jsx)(t.o,{size:`lg`,weight:`semibold`,numeric:!0,lineHeight:`tight`,className:`metric--value`,children:k}),I(`compact`)]}),e.subtitle!=null&&(0,p.jsx)(t.o,{size:`xs`,className:`metric--subtitle`,children:e.subtitle})]}),F]});if(n===`colored`){let n=Math.min(Math.max(v,0),100),i=Math.round(n/100*D);return(0,p.jsxs)(a.l,{surface:`card`,"data-variant":`colored`,"data-tone":r,className:(0,h.clsx)(P,S.metricPanel),...w,children:[(0,p.jsxs)(`div`,{className:S.metricHead,children:[(0,p.jsx)(t.i,{className:`metric--label`,children:e.label}),(0,p.jsx)(`span`,{className:S.metricDot,"aria-hidden":`true`})]}),(0,p.jsxs)(`div`,{className:S.metricValueRow,children:[(0,p.jsx)(t.o,{size:`lg`,weight:`semibold`,numeric:!0,lineHeight:`tight`,className:`metric--value`,children:k}),e.subtitle!=null&&(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,className:`metric--subtitle`,children:e.subtitle})]}),(0,p.jsx)(`div`,{className:S.metricSegments,role:`progressbar`,"aria-label":T.metricProgressLabel(e.label),"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,children:Array.from({length:D},(e,t)=>(0,p.jsx)(`span`,{"data-filled":t<i?``:void 0,className:S.metricSegment},t))}),I(`default`),e.footer!=null&&(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,className:`metric--footer`,children:e.footer})]})}return n===`bordered`?(0,p.jsxs)(a.l,{surface:`card`,"data-variant":`bordered`,"data-tone":r,className:(0,h.clsx)(P,S.metricPanel),...w,children:[(0,p.jsxs)(`div`,{className:S.metricHead,children:[(0,p.jsxs)(`span`,{className:S.metricLabelGroup,children:[l&&j&&(0,p.jsx)(j,{className:S.metricLabelIcon,"aria-hidden":`true`}),(0,p.jsx)(t.i,{className:`metric--label`,children:e.label})]}),I(`badge`)]}),(0,p.jsx)(t.o,{size:`lg`,weight:`semibold`,numeric:!0,lineHeight:`tight`,className:`metric--value`,children:k}),e.subtitle!=null&&(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,className:`metric--subtitle`,children:e.subtitle}),F,e.footer!=null&&(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,className:`metric--footer`,children:e.footer})]}):(0,p.jsxs)(`div`,{"data-variant":`default`,className:(0,h.clsx)(P,S.metricTile),...w,children:[(0,p.jsxs)(`span`,{className:(0,h.clsx)(S.metricLabelGroup,S.tileLabel),children:[l&&j&&(0,p.jsx)(j,{className:S.metricLabelIcon,"aria-hidden":`true`}),(0,p.jsx)(t.i,{className:`metric--label`,children:e.label})]}),(0,p.jsx)(t.o,{size:`lg`,weight:`semibold`,numeric:!0,lineHeight:`tight`,truncate:!0,title:k,className:(0,h.clsx)(`metric--value`,S.tileValue),children:k}),N&&(0,p.jsx)(E,{change:e.change,trend:e.trend,variant:`compact`,className:S.tileChange}),e.subtitle!=null&&(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,className:(0,h.clsx)(`metric--subtitle`,S.tileSubtitle),children:e.subtitle}),F,e.footer!=null&&(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,className:(0,h.clsx)(`metric--footer`,S.tileFooter),children:e.footer})]})}function A({metrics:e,period:n,onPeriodChange:i,showSparklines:o=!0,showChanges:s=!0,footerText:c,className:l,...u}){return(0,p.jsxs)(a.l,{surface:`card`,flush:!0,className:(0,h.clsx)(`metric-bar--component`,S.metricBar,l),...u,children:[(0,p.jsxs)(`div`,{className:S.metricBarRow,children:[n&&(0,p.jsx)(`div`,{className:S.metricBarPeriod,children:(0,p.jsxs)(r.c,{tone:`secondary`,buttonStyle:`ghost`,onClick:i?()=>i(n.value):void 0,children:[(0,p.jsx)(d.CalendarIcon,{"aria-hidden":`true`}),n.label]})}),(0,p.jsx)(`div`,{className:S.metricBarCells,children:e.map(e=>(0,p.jsx)(`div`,{className:S.metricBarCell,children:(0,p.jsx)(k,{data:e,variant:`default`,showSparkline:o,showChange:s})},e.id))})]}),c!=null&&(0,p.jsx)(`div`,{className:S.metricBarFooter,children:(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,children:c})})]})}function j(e){return e<=1?1:e===2?2:e===3?3:e===4?4:e<=6?6:4}function M({metrics:e,variant:t=`card`,tone:n=`neutral`,columns:r=`auto`,showSparklines:i=!0,showChanges:a=!0,showIcons:o=!0,loading:s=!1,className:c,...l}){let u=r===`auto`?j(e.length):r;return(0,p.jsx)(`div`,{className:(0,h.clsx)(`metric-grid--component`,S.metricGridRoot,c),...l,children:(0,p.jsx)(`div`,{"data-columns":u,className:(0,h.clsx)(`metric-grid--grid`,S.metricGrid),children:e.map(e=>(0,p.jsx)(k,{data:e,variant:t,tone:n,showSparkline:i,showChange:a,showIcon:o,loading:s},e.id))})})}function N(e){if(e==null)return null;if(typeof e==`number`)return e;let t=Number(e);return Number.isFinite(t)?t:null}function P({current:e,previous:n,currentPeriod:r,previousPeriod:i,strings:o,className:c,...l}){let u={..._,...o},f=N(e.value),m=N(n.value),g=f!==null&&m!==null,v=g?f-m:0,y=g&&m!==0?Math.round(v/m*100):null,x=v===0,C=v>0,w=x?d.EqualIcon:C?d.ArrowUpIcon:d.ArrowDownIcon,T=x?`neutral`:C?`positive`:`negative`,E=b({...e,value:Math.abs(v)});return(0,p.jsxs)(`div`,{className:(0,h.clsx)(`metric-comparison--component`,S.comparison,c),...l,children:[(r!=null||i!=null)&&(0,p.jsxs)(`div`,{className:S.comparisonPeriods,children:[r!=null&&(0,p.jsx)(s.t,{tone:`secondary`,children:r}),i!=null&&(0,p.jsx)(s.t,{tone:`secondary`,children:i})]}),(0,p.jsxs)(`div`,{className:S.comparisonPair,children:[(0,p.jsxs)(a.l,{surface:`card`,className:S.comparisonBox,children:[(0,p.jsx)(t.i,{children:u.currentLabel}),(0,p.jsx)(t.o,{size:`lg`,weight:`semibold`,numeric:!0,lineHeight:`tight`,children:b(e)})]}),(0,p.jsxs)(`div`,{className:S.comparisonArrow,"aria-hidden":`true`,children:[(0,p.jsx)(d.ArrowRightIcon,{className:S.comparisonArrowWide}),(0,p.jsx)(d.ArrowDownIcon,{className:S.comparisonArrowNarrow})]}),(0,p.jsxs)(a.l,{surface:`card`,className:(0,h.clsx)(S.comparisonBox,S.comparisonBoxPrevious),children:[(0,p.jsx)(t.i,{children:u.previousLabel}),(0,p.jsx)(t.o,{size:`lg`,weight:`semibold`,numeric:!0,lineHeight:`tight`,type:`secondary`,children:b(n)})]})]}),g&&(0,p.jsxs)(`div`,{"data-tone":T,className:S.comparisonDelta,children:[(0,p.jsxs)(`span`,{className:S.comparisonChip,children:[(0,p.jsx)(w,{className:S.comparisonChipIcon,"aria-hidden":`true`}),(0,p.jsxs)(t.o,{tag:`span`,size:`xs`,type:`inherit`,weight:`semibold`,numeric:!0,children:[C?`+`:x?``:`−`,E]})]}),y!==null&&(0,p.jsxs)(t.o,{size:`xs`,type:x?`secondary`:`inherit`,numeric:!0,children:[C?`+`:x?``:`−`,Math.abs(y),`%`]}),(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,children:u.suffix})]})]})}var F=[`bars`,`line`,`dots`,`progress`,`area`,`pie`];function I(e){let t=Math.max(...e,0),n=Math.min(...e,0),r=t-n||1;return e.map(e=>(e-n)/r)}function L(e,t){let n=I(e),r=60/Math.max(n.length-1,1);return n.map((e,n)=>`${n*r},${t-e*(t-2)}`)}function R({kind:e,data:t,label:r}){if(e===`bars`){let e=I(t.slice(0,6));return(0,p.jsx)(`span`,{className:S.microBars,"aria-hidden":`true`,children:e.map((e,t)=>(0,p.jsx)(`span`,{className:S.microBar,style:{"--micro-bar":`${Math.max(e,.08)*100}%`}},t))})}if(e===`dots`){let e=I(t.slice(0,5));return(0,p.jsx)(`span`,{className:S.microDots,"aria-hidden":`true`,children:e.map((e,t)=>(0,p.jsx)(`span`,{className:S.microDot,style:{"--micro-dot":`${Math.round(e*12)}px`}},t))})}if(e===`progress`){let[e=0,i=100]=t;return(0,p.jsx)(n.s,{value:e,max:i,label:r,className:S.microProgress})}if(e===`pie`){let e=t.reduce((e,t)=>e+t,0)||1,n=t.slice(0,3),r=n.map((t,r)=>{let i=n.slice(0,r).reduce((e,t)=>e+t,0),a=i/e*100,o=(i+t)/e*100;return`var(--chart-${r+1}) ${a}% ${o}%`});return(0,p.jsx)(`span`,{className:S.microMarkRow,"aria-hidden":`true`,children:(0,p.jsx)(`span`,{className:S.microPie,style:{"--micro-pie":`conic-gradient(${r.join(`, `)})`}})})}let i=L(t.slice(0,8),16);return e===`area`?(0,p.jsx)(`svg`,{viewBox:`0 0 60 16`,className:S.microSvg,preserveAspectRatio:`none`,"aria-hidden":`true`,children:(0,p.jsx)(`polygon`,{className:S.microArea,points:`0,16 ${i.join(` `)} 60,16`})}):(0,p.jsx)(`svg`,{viewBox:`0 0 60 16`,className:S.microSvg,preserveAspectRatio:`none`,"aria-hidden":`true`,children:(0,p.jsx)(`polyline`,{className:S.microLine,points:i.join(` `)})})}function z({cells:e,className:n,...r}){return(0,p.jsx)(`div`,{className:(0,h.clsx)(`metric-micro-grid--component`,S.microGridRoot,n),...r,children:(0,p.jsx)(a.l,{surface:`bordered`,flush:!0,className:S.microGrid,children:e.map((e,n)=>{let r=e.chart??F[n%F.length]??`bars`;return(0,p.jsxs)(`div`,{className:(0,h.clsx)(`metric-micro-grid--cell`,S.microCell),children:[(0,p.jsx)(t.i,{children:e.label}),(0,p.jsx)(t.o,{weight:`semibold`,numeric:!0,lineHeight:`tight`,className:`metric-micro-grid--value`,children:e.value}),(0,p.jsx)(R,{kind:r,data:e.data,label:e.label})]},e.id??e.label)})})})}function B({title:e,value:n,change:r,data:i,theme:a=`cool`,subtitle:o,className:s,...c}){let l=`metric-gradient-${(0,f.useId)().replaceAll(`:`,``)}`;return(0,p.jsxs)(`div`,{"data-theme-ramp":a,"data-theme":`dark`,className:(0,h.clsx)(`metric-gradient--component`,S.gradient,s),...c,children:[(0,p.jsxs)(`div`,{className:S.gradientHead,children:[(0,p.jsxs)(`div`,{className:S.gradientHeadText,children:[(0,p.jsx)(t.i,{children:e}),n!=null&&(0,p.jsx)(t.o,{size:`lg`,weight:`semibold`,numeric:!0,lineHeight:`tight`,children:n}),o!=null&&(0,p.jsx)(t.o,{size:`xs`,children:o})]}),r&&(0,p.jsx)(E,{change:r,variant:`badge`,className:S.gradientChip})]}),(0,p.jsx)(`div`,{className:S.gradientPlot,children:(0,p.jsx)(m.ResponsiveContainer,{width:`100%`,height:`100%`,initialDimension:{width:1,height:1},children:(0,p.jsxs)(m.AreaChart,{data:i,margin:{top:4,right:0,bottom:0,left:0},children:[(0,p.jsx)(`defs`,{children:(0,p.jsxs)(`linearGradient`,{id:l,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,p.jsx)(`stop`,{offset:`0%`,stopColor:`var(--foreground)`,stopOpacity:.3}),(0,p.jsx)(`stop`,{offset:`100%`,stopColor:`var(--foreground)`,stopOpacity:0})]})}),(0,p.jsx)(m.Area,{type:`monotone`,dataKey:`value`,stroke:`var(--muted-foreground)`,strokeWidth:2,fill:`url(#${l})`,dot:!1,activeDot:!1,isAnimationActive:!1})]})})})]})}function V(e,t){if(e.length===0)return{weeks:[],months:[]};let n=[...e].sort((e,t)=>e.date.localeCompare(t.date)),r=n[0],i=n[n.length-1];if(!r||!i)return{weeks:[],months:[]};let a=new Date(`${r.date}T00:00:00`),o=new Date(`${i.date}T00:00:00`),s=a.getDay(),c=new Date(a);c.setDate(c.getDate()+(s===0?-6:1-s));let l=new Map(n.map(e=>[e.date,e.level])),u=[],d=[],f=[],p=-1;for(;c<=o;){let e=`${c.getFullYear()}-${String(c.getMonth()+1).padStart(2,`0`)}-${String(c.getDate()).padStart(2,`0`)}`,n=(c.getDay()+6)%7;if(n===0&&f.length>0&&(u.push(f),f=[]),c.getMonth()!==p){let e=n===0?u.length:u.length+1,r=t[c.getMonth()];r&&!d.some(t=>t.weekIndex===e)&&d.push({label:r,weekIndex:e}),p=c.getMonth()}f.push({date:e,level:l.get(e)??0}),c.setDate(c.getDate()+1)}if(f.length>0){for(;f.length<7;)f.push(null);u.push(f)}return{weeks:u,months:d}}var H=[0,1,2,3,4];function U({data:e,strings:n,className:r,...i}){let a={...v,...n},{weeks:o,months:s}=V(e,a.monthNames),c=s.filter((e,t,n)=>{let r=n[t-1];return!r||e.weekIndex-r.weekIndex>=3});return(0,p.jsxs)(`div`,{className:(0,h.clsx)(`activity-heatmap--component`,S.heatmap,r),...i,children:[(0,p.jsxs)(`div`,{className:S.heatmapScroll,children:[(0,p.jsx)(`div`,{className:S.heatmapMonths,style:{"--heatmap-weeks":o.length},children:c.map(e=>(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,lineHeight:`none`,className:S.heatmapMonth,style:{"--heatmap-week":e.weekIndex},children:e.label},`${e.label}-${e.weekIndex}`))}),(0,p.jsxs)(`div`,{className:S.heatmapBody,children:[(0,p.jsx)(`div`,{className:S.heatmapDays,children:a.dayLabels.map((e,n)=>(0,p.jsx)(`span`,{className:S.heatmapDay,children:e?(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,children:e}):null},n))}),(0,p.jsx)(`div`,{className:S.heatmapWeeks,children:o.map((e,t)=>(0,p.jsx)(`div`,{className:S.heatmapWeek,children:e.map((e,t)=>(0,p.jsx)(`span`,{"data-level":e?e.level:void 0,"data-empty":e?void 0:``,className:S.heatmapCell,title:e?a.formatDay(e.date,e.level):void 0},t))},t))})]})]}),(0,p.jsxs)(`div`,{className:S.heatmapLegend,children:[(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,children:a.legendLess}),H.map(e=>(0,p.jsx)(`span`,{"data-level":e,className:S.heatmapCell,"aria-hidden":`true`},e)),(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,children:a.legendMore})]})]})}function W({config:e,children:t,footer:n,className:r,...i}){return(0,p.jsxs)(a.l,{className:(0,h.clsx)(`chart-card--component`,r),...i,children:[(0,p.jsx)(u.n,{config:e,label:typeof i.title==`string`?i.title:void 0,className:(0,h.clsx)(`chart-card--chart`,S.chartCardChart),children:t}),n!=null&&(0,p.jsx)(`div`,{className:S.chartCardFooter,children:n})]})}function G(e,t){if(e===0)return 0;let n=e/t;return n<1/3?1:n<2/3?2:3}function K({hours:e,currentHour:n,strings:r,className:i,...a}){let o={...y,...r},s=Math.max(...e,1),c=e.indexOf(Math.max(...e)),l=n!==void 0&&n>=0&&n<24;return(0,p.jsxs)(`div`,{className:(0,h.clsx)(`time-ruler--component`,S.ruler,i),...a,children:[(0,p.jsxs)(`div`,{className:S.rulerBar,children:[e.map((e,t)=>(0,p.jsx)(`span`,{"data-band":G(e,s),"data-peak":t===c?``:void 0,className:S.rulerHour,title:o.formatHourTitle(o.formatHour(t),e)},t)),l&&(0,p.jsx)(`span`,{"aria-hidden":`true`,className:S.rulerMarker,style:{"--ruler-now":n}})]}),(0,p.jsx)(`div`,{className:S.rulerTicks,children:e.map((e,n)=>(0,p.jsx)(`span`,{className:S.rulerTick,children:n%4==0&&(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,numeric:!0,children:o.formatHour(n)})},n))}),(0,p.jsxs)(`div`,{className:S.rulerLegend,children:[[0,1,2,3].map(e=>(0,p.jsxs)(`span`,{className:S.rulerLegendItem,children:[(0,p.jsx)(`span`,{"data-band":e,className:S.rulerSwatch,"aria-hidden":`true`}),(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,children:[o.legendNone,o.legendLow,o.legendMedium,o.legendHigh][e]})]},e)),l&&(0,p.jsxs)(`span`,{className:S.rulerLegendItem,children:[(0,p.jsx)(`span`,{className:S.rulerMarkerSwatch,"aria-hidden":`true`}),(0,p.jsx)(t.o,{size:`xs`,type:`secondary`,children:o.legendNow})]})]})]})}exports.ActivityHeatmap=U,exports.ChartCard=W,exports.Metric=k,exports.MetricBar=A,exports.MetricComparison=P,exports.MetricGradient=B,exports.MetricGrid=M,exports.MetricMicroGrid=z,exports.MetricSkeleton=C,exports.MetricTrendChip=E,exports.TimeRuler=K,exports.defaultActivityHeatmapStrings=v,exports.defaultAnalyticsStrings=g,exports.defaultMetricComparisonStrings=_,exports.defaultTimeRulerStrings=y,exports.formatMetricValue=b,exports.resolveTrend=x;