@vertesia/ui 1.6.0-dev.20260918.090710Z → 1.6.0-dev.20260923.085325Z

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 (288) hide show
  1. package/lib/boot/branding.d.ts +13 -0
  2. package/lib/boot/branding.d.ts.map +1 -1
  3. package/lib/boot/branding.js +7 -0
  4. package/lib/boot/branding.js.map +1 -1
  5. package/lib/boot/index.d.ts +1 -1
  6. package/lib/boot/index.d.ts.map +1 -1
  7. package/lib/boot/index.js +5 -23
  8. package/lib/boot/index.js.map +1 -1
  9. package/lib/boot/loading.d.ts +4 -0
  10. package/lib/boot/loading.d.ts.map +1 -0
  11. package/lib/boot/loading.js +28 -0
  12. package/lib/boot/loading.js.map +1 -0
  13. package/lib/core/components/SelectList.d.ts.map +1 -1
  14. package/lib/core/components/SelectList.js +3 -3
  15. package/lib/core/components/SelectList.js.map +1 -1
  16. package/lib/core/components/SidePanel.d.ts.map +1 -1
  17. package/lib/core/components/SidePanel.js +2 -1
  18. package/lib/core/components/SidePanel.js.map +1 -1
  19. package/lib/core/components/shadcn/theme/ThemeProvider.d.ts.map +1 -1
  20. package/lib/core/components/shadcn/theme/ThemeProvider.js +21 -5
  21. package/lib/core/components/shadcn/theme/ThemeProvider.js.map +1 -1
  22. package/lib/env/index.d.ts +11 -0
  23. package/lib/env/index.d.ts.map +1 -1
  24. package/lib/env/index.js +16 -3
  25. package/lib/env/index.js.map +1 -1
  26. package/lib/features/agent/chat/ModernAgentConversation.js +4 -1
  27. package/lib/features/agent/chat/ModernAgentConversation.js.map +1 -1
  28. package/lib/features/agent/chat/ModernAgentOutput/MessageInput.d.ts +5 -1
  29. package/lib/features/agent/chat/ModernAgentOutput/MessageInput.d.ts.map +1 -1
  30. package/lib/features/agent/chat/ModernAgentOutput/MessageInput.js +9 -2
  31. package/lib/features/agent/chat/ModernAgentOutput/MessageInput.js.map +1 -1
  32. package/lib/features/magic-pdf/GroundedExtractionView.js +3 -3
  33. package/lib/features/magic-pdf/GroundedExtractionView.js.map +1 -1
  34. package/lib/features/media-viewer/AudioPanel.d.ts +10 -2
  35. package/lib/features/media-viewer/AudioPanel.d.ts.map +1 -1
  36. package/lib/features/media-viewer/AudioPanel.js +78 -13
  37. package/lib/features/media-viewer/AudioPanel.js.map +1 -1
  38. package/lib/features/oauth/McpConnectionsButton.d.ts +2 -2
  39. package/lib/features/oauth/McpConnectionsButton.d.ts.map +1 -1
  40. package/lib/features/oauth/McpConnectionsButton.js +9 -7
  41. package/lib/features/oauth/McpConnectionsButton.js.map +1 -1
  42. package/lib/features/oauth/McpConnectionsDialog.d.ts.map +1 -1
  43. package/lib/features/oauth/McpConnectionsDialog.js +7 -3
  44. package/lib/features/oauth/McpConnectionsDialog.js.map +1 -1
  45. package/lib/features/oauth/useMcpConnections.d.ts +4 -2
  46. package/lib/features/oauth/useMcpConnections.d.ts.map +1 -1
  47. package/lib/features/oauth/useMcpConnections.js +15 -9
  48. package/lib/features/oauth/useMcpConnections.js.map +1 -1
  49. package/lib/features/store/objects/selection/ObjectsActionContext.d.ts.map +1 -1
  50. package/lib/features/store/objects/selection/ObjectsActionContext.js +2 -0
  51. package/lib/features/store/objects/selection/ObjectsActionContext.js.map +1 -1
  52. package/lib/features/store/objects/selection/SelectionActions.d.ts +4 -2
  53. package/lib/features/store/objects/selection/SelectionActions.d.ts.map +1 -1
  54. package/lib/features/store/objects/selection/SelectionActions.js +6 -3
  55. package/lib/features/store/objects/selection/SelectionActions.js.map +1 -1
  56. package/lib/features/store/objects/selection/actions/StartWorkflowAction.d.ts +4 -0
  57. package/lib/features/store/objects/selection/actions/StartWorkflowAction.d.ts.map +1 -0
  58. package/lib/features/store/objects/selection/actions/StartWorkflowAction.js +81 -0
  59. package/lib/features/store/objects/selection/actions/StartWorkflowAction.js.map +1 -0
  60. package/lib/features/store/objects/selection/actions/index.d.ts +1 -0
  61. package/lib/features/store/objects/selection/actions/index.d.ts.map +1 -1
  62. package/lib/features/store/objects/selection/actions/index.js +1 -0
  63. package/lib/features/store/objects/selection/actions/index.js.map +1 -1
  64. package/lib/features/store/types/TypeRegistry.d.ts +345 -155
  65. package/lib/features/store/types/TypeRegistry.d.ts.map +1 -1
  66. package/lib/features/store/types/search/ObjectTypeSearchContext.d.ts +345 -155
  67. package/lib/features/store/types/search/ObjectTypeSearchContext.d.ts.map +1 -1
  68. package/lib/i18n/locales/ar.json +10 -2
  69. package/lib/i18n/locales/de.json +6 -2
  70. package/lib/i18n/locales/en.json +6 -2
  71. package/lib/i18n/locales/es.json +6 -2
  72. package/lib/i18n/locales/fr.json +7 -2
  73. package/lib/i18n/locales/it.json +6 -2
  74. package/lib/i18n/locales/ja.json +6 -2
  75. package/lib/i18n/locales/ko.json +6 -2
  76. package/lib/i18n/locales/pt.json +6 -2
  77. package/lib/i18n/locales/ru.json +8 -2
  78. package/lib/i18n/locales/tr.json +6 -2
  79. package/lib/i18n/locales/zh-TW.json +6 -2
  80. package/lib/i18n/locales/zh.json +6 -2
  81. package/lib/session/UserSession.d.ts +3 -0
  82. package/lib/session/UserSession.d.ts.map +1 -1
  83. package/lib/session/UserSession.js +18 -8
  84. package/lib/session/UserSession.js.map +1 -1
  85. package/lib/session/UserSessionProvider.d.ts.map +1 -1
  86. package/lib/session/UserSessionProvider.js +34 -24
  87. package/lib/session/UserSessionProvider.js.map +1 -1
  88. package/lib/session/auth/authRoundTrip.d.ts +8 -0
  89. package/lib/session/auth/authRoundTrip.d.ts.map +1 -0
  90. package/lib/session/auth/authRoundTrip.js +22 -0
  91. package/lib/session/auth/authRoundTrip.js.map +1 -0
  92. package/lib/session/auth/composable.d.ts.map +1 -1
  93. package/lib/session/auth/composable.js +9 -7
  94. package/lib/session/auth/composable.js.map +1 -1
  95. package/lib/session/auth/domainRouting.d.ts +13 -6
  96. package/lib/session/auth/domainRouting.d.ts.map +1 -1
  97. package/lib/session/auth/domainRouting.js +2 -21
  98. package/lib/session/auth/domainRouting.js.map +1 -1
  99. package/lib/session/auth/oauth.d.ts +6 -1
  100. package/lib/session/auth/oauth.d.ts.map +1 -1
  101. package/lib/session/auth/oauth.js +145 -8
  102. package/lib/session/auth/oauth.js.map +1 -1
  103. package/lib/session/auth/tokenIssuer.d.ts +3 -0
  104. package/lib/session/auth/tokenIssuer.d.ts.map +1 -0
  105. package/lib/session/auth/tokenIssuer.js +27 -0
  106. package/lib/session/auth/tokenIssuer.js.map +1 -0
  107. package/lib/session/auth/vertesiaHosts.d.ts +47 -0
  108. package/lib/session/auth/vertesiaHosts.d.ts.map +1 -0
  109. package/lib/session/auth/vertesiaHosts.js +79 -0
  110. package/lib/session/auth/vertesiaHosts.js.map +1 -0
  111. package/lib/session/index.d.ts +1 -0
  112. package/lib/session/index.d.ts.map +1 -1
  113. package/lib/session/index.js +1 -0
  114. package/lib/session/index.js.map +1 -1
  115. package/lib/shell/AuthScreenPreview.d.ts +1 -1
  116. package/lib/shell/AuthScreenPreview.d.ts.map +1 -1
  117. package/lib/shell/AuthScreenPreview.js +2 -5
  118. package/lib/shell/AuthScreenPreview.js.map +1 -1
  119. package/lib/shell/BrandedAuthScreens.d.ts +1 -4
  120. package/lib/shell/BrandedAuthScreens.d.ts.map +1 -1
  121. package/lib/shell/BrandedAuthScreens.js +5 -26
  122. package/lib/shell/BrandedAuthScreens.js.map +1 -1
  123. package/lib/shell/BrandedLoadingIndicator.d.ts +11 -0
  124. package/lib/shell/BrandedLoadingIndicator.d.ts.map +1 -0
  125. package/lib/shell/BrandedLoadingIndicator.js +27 -0
  126. package/lib/shell/BrandedLoadingIndicator.js.map +1 -0
  127. package/lib/shell/SplashScreen.d.ts.map +1 -1
  128. package/lib/shell/SplashScreen.js +2 -1
  129. package/lib/shell/SplashScreen.js.map +1 -1
  130. package/lib/shell/apps/AppInstallationProvider.d.ts +16 -4
  131. package/lib/shell/apps/AppInstallationProvider.d.ts.map +1 -1
  132. package/lib/shell/apps/iframe-auth.d.ts +2 -0
  133. package/lib/shell/apps/iframe-auth.d.ts.map +1 -1
  134. package/lib/shell/apps/iframe-auth.js +6 -2
  135. package/lib/shell/apps/iframe-auth.js.map +1 -1
  136. package/lib/shell/index.d.ts +1 -0
  137. package/lib/shell/index.d.ts.map +1 -1
  138. package/lib/shell/index.js +1 -0
  139. package/lib/shell/index.js.map +1 -1
  140. package/lib/shell/login/SignInAuthPending.js +2 -2
  141. package/lib/shell/login/SignInAuthPending.js.map +1 -1
  142. package/lib/shell/login/SignInEmailStep.d.ts.map +1 -1
  143. package/lib/shell/login/SignInEmailStep.js +2 -2
  144. package/lib/shell/login/SignInEmailStep.js.map +1 -1
  145. package/lib/shell/login/TerminalLogin.d.ts.map +1 -1
  146. package/lib/shell/login/TerminalLogin.js +28 -21
  147. package/lib/shell/login/TerminalLogin.js.map +1 -1
  148. package/lib/vertesia-ui-boot.js +33 -29
  149. package/lib/vertesia-ui-boot.js.map +1 -1
  150. package/lib/vertesia-ui-core.js +34 -34
  151. package/lib/vertesia-ui-core.js.map +1 -1
  152. package/lib/vertesia-ui-env.js +1 -1
  153. package/lib/vertesia-ui-env.js.map +1 -1
  154. package/lib/vertesia-ui-features.js +163 -163
  155. package/lib/vertesia-ui-features.js.map +1 -1
  156. package/lib/vertesia-ui-i18n.Bl8KeZUK.chunk.js +5 -0
  157. package/lib/vertesia-ui-i18n.Bl8KeZUK.chunk.js.map +1 -0
  158. package/lib/vertesia-ui-i18n.BmT06XFI.chunk.js +5 -0
  159. package/lib/vertesia-ui-i18n.BmT06XFI.chunk.js.map +1 -0
  160. package/lib/vertesia-ui-i18n.Ch-Jjj0L.chunk.js +5 -0
  161. package/lib/vertesia-ui-i18n.Ch-Jjj0L.chunk.js.map +1 -0
  162. package/lib/vertesia-ui-i18n.CjhloW9s.chunk.js +5 -0
  163. package/lib/vertesia-ui-i18n.CjhloW9s.chunk.js.map +1 -0
  164. package/lib/vertesia-ui-i18n.CkfHdQzY.chunk.js +5 -0
  165. package/lib/vertesia-ui-i18n.CkfHdQzY.chunk.js.map +1 -0
  166. package/lib/vertesia-ui-i18n.DFuKfTe1.chunk.js +5 -0
  167. package/lib/vertesia-ui-i18n.DFuKfTe1.chunk.js.map +1 -0
  168. package/lib/vertesia-ui-i18n.DHqNVekZ.chunk.js +5 -0
  169. package/lib/vertesia-ui-i18n.DHqNVekZ.chunk.js.map +1 -0
  170. package/lib/vertesia-ui-i18n.DOaKbmaj.chunk.js +5 -0
  171. package/lib/vertesia-ui-i18n.DOaKbmaj.chunk.js.map +1 -0
  172. package/lib/vertesia-ui-i18n.Dge3Gl-h.chunk.js +5 -0
  173. package/lib/vertesia-ui-i18n.Dge3Gl-h.chunk.js.map +1 -0
  174. package/lib/vertesia-ui-i18n.GLt-10Lx.chunk.js +5 -0
  175. package/lib/vertesia-ui-i18n.GLt-10Lx.chunk.js.map +1 -0
  176. package/lib/vertesia-ui-i18n.T-XtAGbw.chunk.js +5 -0
  177. package/lib/vertesia-ui-i18n.T-XtAGbw.chunk.js.map +1 -0
  178. package/lib/vertesia-ui-i18n.VOJyTpMM.chunk.js +5 -0
  179. package/lib/vertesia-ui-i18n.VOJyTpMM.chunk.js.map +1 -0
  180. package/lib/vertesia-ui-i18n.js +3 -3
  181. package/lib/vertesia-ui-i18n.js.map +1 -1
  182. package/lib/vertesia-ui-layout.js +15 -15
  183. package/lib/vertesia-ui-layout.js.map +1 -1
  184. package/lib/vertesia-ui-rich-text.js +44 -44
  185. package/lib/vertesia-ui-rich-text.js.map +1 -1
  186. package/lib/vertesia-ui-session.js +1 -1
  187. package/lib/vertesia-ui-session.js.map +1 -1
  188. package/lib/vertesia-ui-shell.js +72 -48
  189. package/lib/vertesia-ui-shell.js.map +1 -1
  190. package/lib/vertesia-ui-widgets.js +51 -51
  191. package/lib/vertesia-ui-widgets.js.map +1 -1
  192. package/package.json +19 -19
  193. package/src/boot/branding.ts +8 -0
  194. package/src/boot/index.ts +6 -23
  195. package/src/boot/loading.ts +27 -0
  196. package/src/core/components/SelectList.tsx +5 -2
  197. package/src/core/components/SidePanel.tsx +65 -60
  198. package/src/core/components/shadcn/theme/ThemeProvider.test.tsx +101 -0
  199. package/src/core/components/shadcn/theme/ThemeProvider.tsx +21 -9
  200. package/src/env/index.test.ts +21 -0
  201. package/src/env/index.ts +33 -2
  202. package/src/features/agent/chat/ModernAgentConversation.test.tsx +81 -0
  203. package/src/features/agent/chat/ModernAgentConversation.tsx +5 -0
  204. package/src/features/agent/chat/ModernAgentOutput/MessageInput.tsx +17 -1
  205. package/src/features/magic-pdf/GroundedExtractionView.tsx +3 -3
  206. package/src/features/media-viewer/AudioPanel.test.ts +84 -0
  207. package/src/features/media-viewer/AudioPanel.tsx +97 -14
  208. package/src/features/oauth/McpConnectionsButton.test.tsx +56 -0
  209. package/src/features/oauth/McpConnectionsButton.tsx +9 -6
  210. package/src/features/oauth/McpConnectionsDialog.tsx +14 -5
  211. package/src/features/oauth/useMcpConnections.test.ts +10 -0
  212. package/src/features/oauth/useMcpConnections.ts +18 -10
  213. package/src/features/store/objects/selection/ObjectsActionContext.tsx +2 -0
  214. package/src/features/store/objects/selection/SelectionActions.tsx +13 -6
  215. package/src/features/store/objects/selection/actions/StartWorkflowAction.tsx +162 -0
  216. package/src/features/store/objects/selection/actions/index.ts +1 -0
  217. package/src/i18n/locales/ar.json +10 -2
  218. package/src/i18n/locales/de.json +6 -2
  219. package/src/i18n/locales/en.json +6 -2
  220. package/src/i18n/locales/es.json +6 -2
  221. package/src/i18n/locales/fr.json +7 -2
  222. package/src/i18n/locales/it.json +6 -2
  223. package/src/i18n/locales/ja.json +6 -2
  224. package/src/i18n/locales/ko.json +6 -2
  225. package/src/i18n/locales/pt.json +6 -2
  226. package/src/i18n/locales/ru.json +8 -2
  227. package/src/i18n/locales/tr.json +6 -2
  228. package/src/i18n/locales/zh-TW.json +6 -2
  229. package/src/i18n/locales/zh.json +6 -2
  230. package/src/session/UserSession.test.ts +48 -3
  231. package/src/session/UserSession.ts +20 -8
  232. package/src/session/UserSessionProvider.handoff.test.tsx +103 -0
  233. package/src/session/UserSessionProvider.iframe.test.tsx +178 -0
  234. package/src/session/UserSessionProvider.state-mismatch.test.tsx +43 -0
  235. package/src/session/UserSessionProvider.tsx +35 -23
  236. package/src/session/auth/auth-flow.md +18 -5
  237. package/src/session/auth/authRoundTrip.ts +24 -0
  238. package/src/session/auth/composable.test.ts +23 -1
  239. package/src/session/auth/composable.ts +10 -8
  240. package/src/session/auth/domainRouting.ts +4 -25
  241. package/src/session/auth/oauth.test.ts +121 -4
  242. package/src/session/auth/oauth.ts +172 -11
  243. package/src/session/auth/tokenIssuer.test.ts +25 -0
  244. package/src/session/auth/tokenIssuer.ts +25 -0
  245. package/src/session/auth/vertesiaHosts.test.ts +26 -0
  246. package/src/session/auth/vertesiaHosts.ts +85 -0
  247. package/src/session/index.ts +1 -0
  248. package/src/shell/AuthScreenPreview.tsx +2 -6
  249. package/src/shell/BrandedAuthScreens.test.tsx +26 -0
  250. package/src/shell/BrandedAuthScreens.tsx +4 -40
  251. package/src/shell/BrandedLoadingIndicator.tsx +42 -0
  252. package/src/shell/SplashScreen.tsx +4 -4
  253. package/src/shell/apps/iframe-auth.test.ts +8 -11
  254. package/src/shell/apps/iframe-auth.ts +10 -1
  255. package/src/shell/index.tsx +1 -0
  256. package/src/shell/login/SignInAuthPending.tsx +2 -2
  257. package/src/shell/login/SignInEmailStep.tsx +4 -2
  258. package/src/shell/login/TerminalLogin.test.tsx +111 -0
  259. package/src/shell/login/TerminalLogin.tsx +61 -37
  260. package/lib/features/store/objects/selection/actions/StartWorkflowButton.d.ts +0 -7
  261. package/lib/features/store/objects/selection/actions/StartWorkflowButton.d.ts.map +0 -1
  262. package/lib/features/store/objects/selection/actions/StartWorkflowButton.js +0 -51
  263. package/lib/features/store/objects/selection/actions/StartWorkflowButton.js.map +0 -1
  264. package/lib/vertesia-ui-i18n.B3NFclwl.chunk.js +0 -5
  265. package/lib/vertesia-ui-i18n.B3NFclwl.chunk.js.map +0 -1
  266. package/lib/vertesia-ui-i18n.BWSrNIxc.chunk.js +0 -5
  267. package/lib/vertesia-ui-i18n.BWSrNIxc.chunk.js.map +0 -1
  268. package/lib/vertesia-ui-i18n.BWvWeB1p.chunk.js +0 -5
  269. package/lib/vertesia-ui-i18n.BWvWeB1p.chunk.js.map +0 -1
  270. package/lib/vertesia-ui-i18n.BZCXvTC1.chunk.js +0 -5
  271. package/lib/vertesia-ui-i18n.BZCXvTC1.chunk.js.map +0 -1
  272. package/lib/vertesia-ui-i18n.BbJMvFZW.chunk.js +0 -5
  273. package/lib/vertesia-ui-i18n.BbJMvFZW.chunk.js.map +0 -1
  274. package/lib/vertesia-ui-i18n.CE5ldwpt.chunk.js +0 -5
  275. package/lib/vertesia-ui-i18n.CE5ldwpt.chunk.js.map +0 -1
  276. package/lib/vertesia-ui-i18n.CMC0IShY.chunk.js +0 -5
  277. package/lib/vertesia-ui-i18n.CMC0IShY.chunk.js.map +0 -1
  278. package/lib/vertesia-ui-i18n.CkcRqBKU.chunk.js +0 -5
  279. package/lib/vertesia-ui-i18n.CkcRqBKU.chunk.js.map +0 -1
  280. package/lib/vertesia-ui-i18n.D-Mq1sw_.chunk.js +0 -5
  281. package/lib/vertesia-ui-i18n.D-Mq1sw_.chunk.js.map +0 -1
  282. package/lib/vertesia-ui-i18n.DkK68-A-.chunk.js +0 -5
  283. package/lib/vertesia-ui-i18n.DkK68-A-.chunk.js.map +0 -1
  284. package/lib/vertesia-ui-i18n.XE_dcCg6.chunk.js +0 -5
  285. package/lib/vertesia-ui-i18n.XE_dcCg6.chunk.js.map +0 -1
  286. package/lib/vertesia-ui-i18n.qgNqMPvK.chunk.js +0 -5
  287. package/lib/vertesia-ui-i18n.qgNqMPvK.chunk.js.map +0 -1
  288. package/src/features/store/objects/selection/actions/StartWorkflowButton.tsx +0 -104
@@ -1,282 +1,282 @@
1
1
  import{Fragment as e,jsx as t,jsxs as n}from"react/jsx-runtime";import{MarkdownComponentEditor as r,MarkdownDocumentEditor as i,MarkdownRichTextEditor as a,getMarkdownCompatibility as o}from"@vertesia/rich-text";import{Button as s,DropdownMenu as c,DropdownMenuContent as l,DropdownMenuItem as u,DropdownMenuTrigger as d,Modal as f,ModalBody as p,ModalFooter as m,ModalTitle as h,Spinner as g,Textarea as _,VTooltip as v,cn as y,usePortalContainer as b,useToast as x}from"@vertesia/ui/core";import{useUITranslation as S}from"@vertesia/ui/i18n";import*as C from"react";import w,{Suspense as T,createContext as E,createElement as D,forwardRef as O,lazy as k,memo as A,useCallback as j,useContext as M,useEffect as N,useId as ee,useMemo as P,useRef as F,useState as I}from"react";import{DismissableLayer as te,useDismissableLayerSurface as ne}from"@radix-ui/react-dismissable-layer";import{FocusScope as re}from"@radix-ui/react-focus-scope";import*as ie from"react-dom";import{useFocusGuards as ae}from"@radix-ui/react-focus-guards";import{RemoveScroll as oe}from"react-remove-scroll";import{hideOthers as se}from"aria-hidden";import{useUserSession as ce}from"@vertesia/ui/session";import{clsx as le}from"clsx";import{twMerge as ue}from"tailwind-merge";import{FusionFragmentHandler as de,FusionFragmentProvider as fe}from"@vertesia/fusion-ux";import pe from"dompurify";import{FloatingPortal as me,autoUpdate as he,flip as ge,offset as _e,shift as ve,useFloating as ye}from"@floating-ui/react";var be=Object.create,xe=Object.defineProperty,Se=Object.getOwnPropertyDescriptor,Ce=Object.getOwnPropertyNames,we=Object.getPrototypeOf,Te=Object.prototype.hasOwnProperty,Ee=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},De=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),Oe=(e,t)=>{let n={};for(var r in e)xe(n,r,{get:e[r],enumerable:!0});return t||xe(n,Symbol.toStringTag,{value:`Module`}),n},ke=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Ce(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Te.call(e,s)&&s!==n&&xe(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=Se(t,s))||r.enumerable});return e},Ae=(e,t,n)=>(n=e==null?{}:be(we(e)),ke(t||!e||!e.__esModule||!Te.call(e,`default`)?xe(n,`default`,{value:e,enumerable:!0}):n,e)),je=e=>Te.call(e,`module.exports`)?e[`module.exports`]:ke(xe({},`__esModule`,{value:!0}),e);const Me=w.createContext({});function Ne({children:e,artifactRunId:n,onProposalSelect:r,onProposalSubmit:i,MarkdownRenderer:a}){let o=P(()=>({artifactRunId:n,onProposalSelect:r,onProposalSubmit:i,MarkdownRenderer:a}),[n,r,i,a]);return t(Me.Provider,{value:o,children:e})}function Pe(){return w.useContext(Me)}const Fe=E(null);function Ie(){return M(Fe)}var Le=Object.defineProperty,Re=(e,t)=>Le(e,`name`,{value:t,configurable:!0}),ze=!!(typeof window<`u`&&window.document&&window.document.createElement);function Be(e,t,{checkForDefaultPrevented:n=!0}={}){return Re(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Re(Be,`composeEventHandlers`);function Ve(e){if(!ze)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Re(Ve,`getOwnerWindow`);function He(e){if(!ze)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Re(He,`getOwnerDocument`);function Ue(e,t=!1){let{activeElement:n}=He(e);if(!n?.nodeName)return null;if(We(n)&&n.contentDocument)return Ue(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=He(n).getElementById(e);if(t)return t}}return n}Re(Ue,`getActiveElement`);function We(e){return e.tagName===`IFRAME`}Re(We,`isFrame`);var Ge=Object.defineProperty,Ke=(e,t)=>Ge(e,`name`,{value:t,configurable:!0});function qe(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Ke(qe,`setRef`);function Je(...e){return t=>{let n=!1,r=e.map(e=>{let r=qe(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():qe(e[t],null)}}}}Ke(Je,`composeRefs`);function Ye(...e){return C.useCallback(Je(...e),e)}Ke(Ye,`useComposedRefs`);var Xe=Object.defineProperty,Ze=(e,t)=>Xe(e,`name`,{value:t,configurable:!0});function Qe(e,n){let r=C.createContext(n);r.displayName=e+`Context`;let i=Ze(e=>{let{children:n,...i}=e,a=C.useMemo(()=>i,Object.values(i));return t(r.Provider,{value:a,children:n})},`Provider`);i.displayName=e+`Provider`;function a(t,i={}){let{optional:a=!1}=i,o=C.useContext(r);if(o)return o;if(n!==void 0)return n;if(!a)throw Error(`\`${t}\` must be used within \`${e}\``)}return Ze(a,`useContext`),[i,a]}Ze(Qe,`createContext`);function $e(e,n=[]){let r=[];function i(n,i){let a=C.createContext(i);a.displayName=n+`Context`;let o=r.length;r=[...r,i];let s=Ze(n=>{let{scope:r,children:i,...s}=n,c=r?.[e]?.[o]||a,l=C.useMemo(()=>s,Object.values(s));return t(c.Provider,{value:l,children:i})},`Provider`);s.displayName=n+`Provider`;function c(t,r,s={}){let{optional:c=!1}=s,l=r?.[e]?.[o]||a,u=C.useContext(l);if(u)return u;if(i!==void 0)return i;if(!c)throw Error(`\`${t}\` must be used within \`${n}\``)}return Ze(c,`useContext`),[s,c]}Ze(i,`createContext`);let a=Ze(()=>{let t=r.map(e=>C.createContext(e));return Ze(function(n){let r=n?.[e]||t;return C.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return a.scopeName=e,[i,et(a,...n)]}Ze($e,`createContextScope`);function et(...e){let t=e[0];if(e.length===1)return t;let n=Ze(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Ze(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Ze(et,`composeContextScopes`);var tt=globalThis?.document?C.useLayoutEffect:()=>{},nt=Object.defineProperty,rt=(e,t)=>nt(e,`name`,{value:t,configurable:!0}),it=C.useId||(()=>void 0),at=0;function ot(e){let[t,n]=C.useState(it());return tt(()=>{e||n(e=>e??String(at++))},[e]),e||(t?`radix-${t}`:``)}rt(ot,`useId`);var st=Object.defineProperty,ct=(e,t)=>st(e,`name`,{value:t,configurable:!0}),lt=C.useEffectEvent,ut=C.useInsertionEffect;function dt(e){if(typeof lt==`function`)return lt(e);let t=C.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof ut==`function`?ut(()=>{t.current=e}):tt(()=>{t.current=e}),C.useMemo(()=>((...e)=>t.current?.(...e)),[])}ct(dt,`useEffectEvent`);var ft=Object.defineProperty,pt=(e,t)=>ft(e,`name`,{value:t,configurable:!0}),mt=C.useInsertionEffect||tt;function ht({prop:e,defaultProp:t,onChange:n=pt(()=>{},`onChange`),caller:r}){let[i,a,o]=gt({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,C.useCallback(t=>{if(s){let n=_t(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}pt(ht,`useControllableState`);function gt({defaultProp:e,onChange:t}){let[n,r]=C.useState(e),i=C.useRef(n),a=C.useRef(t);return mt(()=>{a.current=t},[t]),C.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}pt(gt,`useUncontrolledState`);function _t(e){return typeof e==`function`}pt(_t,`isFunction`);var vt=Symbol(`RADIX:SYNC_STATE`);function yt(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=dt(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=C.useReducer((t,n)=>{if(n.type===vt)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=C.useRef(p);C.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=C.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return C.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:vt,state:i})},[i,d.state,c]),[h,f]}pt(yt,`useControllableStateReducer`);var bt=Object.defineProperty,xt=(e,t)=>bt(e,`name`,{value:t,configurable:!0});function St(e){let t=C.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];At(r)&&typeof Pt==`function`&&(r=Pt(r._payload)),C.Children.forEach(r,e=>{if(Ot(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;At(n)&&typeof Pt==`function`&&(n=Pt(n._payload)),a=Tt(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=C.cloneElement(a,void 0,s):!o&&C.Children.count(r)===1&&C.isValidElement(r)&&(a=r);let c=a?Dt(a):void 0,l=Ye(n,c);if(!a){if(r||r===0)throw Error(o?Nt(e):Mt(e));return r}let u=Et(i,a.props??{});return a.type!==C.Fragment&&(u.ref=n?l:c),C.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}xt(St,`createSlot`);var Ct=Symbol.for(`radix.slottable`);function wt(e){let t=xt(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Ct,t}xt(wt,`createSlottable`);var Tt=xt((e,t)=>{if(`child`in e.props){let t=e.props.child;return C.isValidElement(t)?C.cloneElement(t,void 0,e.props.children(t.props.children)):null}return C.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Et(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}xt(Et,`mergeProps`);function Dt(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}xt(Dt,`getElementRef`);function Ot(e){return C.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Ct}xt(Ot,`isSlottable`);var kt=Symbol.for(`react.lazy`);function At(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===kt&&`_payload`in e&&jt(e._payload)}xt(At,`isLazyComponent`);function jt(e){return typeof e==`object`&&!!e&&`then`in e}xt(jt,`isPromiseLike`);var Mt=xt(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Nt=xt(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Pt=C.use,Ft=Object.defineProperty,It=(e,t)=>Ft(e,`name`,{value:t,configurable:!0}),Lt=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,n)=>{let r=St(`Primitive.${n}`),i=C.forwardRef((e,i)=>{let{asChild:a,...o}=e,s=a?r:n;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),t(s,{...o,ref:i})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{});function Rt(e,t){e&&ie.flushSync(()=>e.dispatchEvent(t))}It(Rt,`dispatchDiscreteCustomEvent`);var zt=Object.defineProperty,Bt=C.forwardRef(((e,t)=>zt(e,`name`,{value:t,configurable:!0}))(function(e,n){let{container:r,...i}=e,[a,o]=C.useState(!1);tt(()=>o(!0),[]);let s=r||a&&globalThis?.document?.body;return s?ie.createPortal(t(Lt.div,{...i,ref:n}),s):null},`Portal`)),Vt=Object.defineProperty,Ht=(e,t)=>Vt(e,`name`,{value:t,configurable:!0});function Ut(e,t){return C.useReducer((e,n)=>t[e][n]??e,e)}Ht(Ut,`useStateMachine`);var Wt=Ht(e=>{let{present:t,children:n}=e,r=Gt(t),i=typeof n==`function`?n({present:r.isPresent}):C.Children.only(n),a=qt(r.ref,Yt(i));return typeof n==`function`||r.isPresent?C.cloneElement(i,{ref:a}):null},`Presence`);function Gt(e){let[t,n]=C.useState(),r=C.useRef(null),i=C.useRef(e),a=C.useRef(`none`),o=C.useRef(void 0),[s,c]=Ut(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return C.useEffect(()=>{s===`mounted`?(a.current=o.current??Jt(r.current),o.current=void 0):a.current=`none`},[s]),tt(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Jt(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),tt(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Ht(a=>{let o=Jt(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Ht(e=>{e.target===t&&(a.current=Jt(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:C.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Jt(t)}else r.current=null;n(e)},[])}}Ht(Gt,`usePresence`);function Kt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Ht(Kt,`setRef`);function qt(...e){let t=C.useRef(e);return t.current=e,C.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Kt(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Kt(n[e],null)}}},[])}Ht(qt,`useStableComposedRefs`);function Jt(e){return e?.animationName||`none`}Ht(Jt,`getAnimationName`);function Yt(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Ht(Yt,`getElementRef`);var Xt=Object.defineProperty,Zt=(e,t)=>Xt(e,`name`,{value:t,configurable:!0}),Qt=`Dialog`,[$t,en]=$e(Qt),[tn,nn]=$t(Qt),rn=Zt(e=>{let{__scopeDialog:n,children:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=C.useRef(null),l=C.useRef(null),[u,d]=ht({prop:i,defaultProp:a??!1,onChange:o,caller:Qt}),[f,p]=C.useState(0),[m,h]=C.useState(0);return t(tn,{scope:n,triggerRef:c,contentRef:l,contentId:ot(),titleId:ot(),descriptionId:ot(),titlePresent:f>0,descriptionPresent:m>0,setTitleCount:p,setDescriptionCount:h,open:u,onOpenChange:d,onOpenToggle:C.useCallback(()=>d(e=>!e),[d]),modal:s,children:r})},`Dialog`),an=`DialogPortal`,[on,sn]=$t(an,{forceMount:void 0}),cn=Zt(e=>{let{__scopeDialog:n,forceMount:r,children:i,container:a}=e,o=nn(an,n);return t(on,{scope:n,forceMount:r,children:C.Children.map(i,e=>t(Wt,{present:r||o.open,children:t(Bt,{asChild:!0,container:a,children:e})}))})},`DialogPortal`),ln=`DialogOverlay`,un=C.forwardRef(Zt(function(e,n){let r=sn(ln,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=nn(ln,e.__scopeDialog);return o.modal?t(Wt,{present:i||o.open,children:t(fn,{...a,ref:n})}):null},`DialogOverlay`)),dn=St(`DialogOverlay.RemoveScroll`),fn=C.forwardRef(Zt(function(e,n){let{__scopeDialog:r,...i}=e,a=nn(ln,r),o=Ye(n,ne());return t(oe,{as:dn,allowPinchZoom:!0,shards:[a.contentRef],children:t(Lt.div,{"data-state":wn(a.open),...i,ref:o,style:{pointerEvents:`auto`,...i.style}})})},`DialogOverlayImpl`)),pn=`DialogContent`,mn=C.forwardRef(Zt(function(e,n){let r=sn(pn,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=nn(pn,e.__scopeDialog);return t(Wt,{present:i||o.open,children:o.modal?t(hn,{...a,ref:n}):t(gn,{...a,ref:n})})},`DialogContent`)),hn=C.forwardRef(Zt(function(e,n){let r=nn(pn,e.__scopeDialog),i=C.useRef(null),a=Ye(n,r.contentRef,i);return C.useEffect(()=>{let e=i.current;if(e)return se(e)},[]),t(_n,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Be(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Be(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Be(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),gn=C.forwardRef(Zt(function(e,n){let r=nn(pn,e.__scopeDialog),i=C.useRef(!1),a=C.useRef(!1);return t(_n,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||r.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,t.detail.originalEvent.type===`pointerdown`&&(a.current=!0));let n=t.target;r.triggerRef.current?.contains(n)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&a.current&&t.preventDefault()}})},`DialogContentNonModal`)),_n=C.forwardRef(Zt(function(n,r){let{__scopeDialog:i,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,...c}=n,l=nn(pn,i);return ae(),t(e,{children:t(re,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:s,children:t(te,{role:`dialog`,id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":wn(l.open),...c,ref:r,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},`DialogContentImpl`)),vn=`DialogTitle`,yn=C.forwardRef(Zt(function(e,n){let{__scopeDialog:r,...i}=e,a=nn(vn,r),{setTitleCount:o}=a;return tt(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),t(Lt.h2,{id:a.titleId,...i,ref:n})},`DialogTitle`)),bn=`DialogDescription`,xn=C.forwardRef(Zt(function(e,n){let{__scopeDialog:r,...i}=e,a=nn(bn,r),{setDescriptionCount:o}=a;return tt(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),t(Lt.p,{id:a.descriptionId,...i,ref:n})},`DialogDescription`)),Sn=`DialogClose`,Cn=C.forwardRef(Zt(function(e,n){let{__scopeDialog:r,...i}=e,a=nn(Sn,r);return t(Lt.button,{type:`button`,...i,ref:n,onClick:Be(e.onClick,()=>a.onOpenChange(!1))})},`DialogClose`));function wn(e){return e?`open`:`closed`}Zt(wn,`getState`);
2
2
  /**
3
- * @license lucide-react v1.45.0 - ISC
3
+ * @license lucide-react v1.47.0 - ISC
4
4
  *
5
5
  * This source code is licensed under the ISC license.
6
6
  * See the LICENSE file in the root directory of this source tree.
7
7
  */
8
8
  const Tn=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();
9
9
  /**
10
- * @license lucide-react v1.45.0 - ISC
10
+ * @license lucide-react v1.47.0 - ISC
11
11
  *
12
12
  * This source code is licensed under the ISC license.
13
13
  * See the LICENSE file in the root directory of this source tree.
14
14
  */
15
15
  function En(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Tn(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}
16
16
  /**
17
- * @license lucide-react v1.45.0 - ISC
17
+ * @license lucide-react v1.47.0 - ISC
18
18
  *
19
19
  * This source code is licensed under the ISC license.
20
20
  * See the LICENSE file in the root directory of this source tree.
21
21
  */
22
22
  const Dn=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},On=e=>{
23
23
  /**
24
- * @license lucide-react v1.45.0 - ISC
24
+ * @license lucide-react v1.47.0 - ISC
25
25
  *
26
26
  * This source code is licensed under the ISC license.
27
27
  * See the LICENSE file in the root directory of this source tree.
28
28
  */
29
29
  let t=Dn(e);return t.charAt(0).toUpperCase()+t.slice(1)},kn=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),An={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`}
30
30
  /**
31
- * @license lucide-react v1.45.0 - ISC
31
+ * @license lucide-react v1.47.0 - ISC
32
32
  *
33
33
  * This source code is licensed under the ISC license.
34
34
  * See the LICENSE file in the root directory of this source tree.
35
35
  */
36
36
  /**
37
- * @license lucide-react v1.45.0 - ISC
37
+ * @license lucide-react v1.47.0 - ISC
38
38
  *
39
39
  * This source code is licensed under the ISC license.
40
40
  * See the LICENSE file in the root directory of this source tree.
41
41
  */
42
42
  ;
43
43
  /**
44
- * @license lucide-react v1.45.0 - ISC
44
+ * @license lucide-react v1.47.0 - ISC
45
45
  *
46
46
  * This source code is licensed under the ISC license.
47
47
  * See the LICENSE file in the root directory of this source tree.
48
48
  */
49
49
  function jn(e){return e!=null}function Mn(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??An.width,a=e.size??e.height??An.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?kn(...c):kn(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??An[`stroke-width`])*Number(e.size??e.width??An.width)/Number(t.size??t.width??An.width):t.strokeWidth??An[`stroke-width`];return[`svg`,{...Object.entries(An).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&jn(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&jn(t.width)&&{[r(`width`)]:t.width},...`height`in t&&jn(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}
50
50
  /**
51
- * @license lucide-react v1.45.0 - ISC
51
+ * @license lucide-react v1.47.0 - ISC
52
52
  *
53
53
  * This source code is licensed under the ISC license.
54
54
  * See the LICENSE file in the root directory of this source tree.
55
55
  */
56
56
  function Nn(e,t={}){return Mn(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}
57
57
  /**
58
- * @license lucide-react v1.45.0 - ISC
58
+ * @license lucide-react v1.47.0 - ISC
59
59
  *
60
60
  * This source code is licensed under the ISC license.
61
61
  * See the LICENSE file in the root directory of this source tree.
62
62
  */
63
63
  const Pn=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Fn=E({}),In=()=>M(Fn),Ln=O(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{
64
64
  /**
65
- * @license lucide-react v1.45.0 - ISC
65
+ * @license lucide-react v1.47.0 - ISC
66
66
  *
67
67
  * This source code is licensed under the ISC license.
68
68
  * See the LICENSE file in the root directory of this source tree.
69
69
  */
70
70
  /**
71
- * @license lucide-react v1.45.0 - ISC
71
+ * @license lucide-react v1.47.0 - ISC
72
72
  *
73
73
  * This source code is licensed under the ISC license.
74
74
  * See the LICENSE file in the root directory of this source tree.
75
75
  */
76
76
  let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=In()??{},y=!!c||Pn(d),[b,x,S=[]]=Nn(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:kn(v,s),hasA11yProp:y,attributes:d});return D(b,{ref:f,...x},[...S.map(([e,t])=>D(e,t)),...Array.isArray(c)?c:[c]])});
77
77
  /**
78
- * @license lucide-react v1.45.0 - ISC
78
+ * @license lucide-react v1.47.0 - ISC
79
79
  *
80
80
  * This source code is licensed under the ISC license.
81
81
  * See the LICENSE file in the root directory of this source tree.
82
82
  */
83
83
  function L(e,t=[],n=[]){let r=typeof e==`string`?En(e,t,n):e,i=O(({className:e,...t},n)=>D(Ln,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=On(r.name)),i}
84
84
  /**
85
- * @license lucide-react v1.45.0 - ISC
85
+ * @license lucide-react v1.47.0 - ISC
86
86
  *
87
87
  * This source code is licensed under the ISC license.
88
88
  * See the LICENSE file in the root directory of this source tree.
89
89
  */
90
90
  const Rn={name:`bold`,size:24,node:[[`path`,{d:`M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8`,key:`mg9rjx`}]]};Rn.node;const zn=L(Rn),Bn={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]}
91
91
  /**
92
- * @license lucide-react v1.45.0 - ISC
92
+ * @license lucide-react v1.47.0 - ISC
93
93
  *
94
94
  * This source code is licensed under the ISC license.
95
95
  * See the LICENSE file in the root directory of this source tree.
96
96
  */
97
97
  ;Bn.node;const Vn=L(Bn),Hn={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]}
98
98
  /**
99
- * @license lucide-react v1.45.0 - ISC
99
+ * @license lucide-react v1.47.0 - ISC
100
100
  *
101
101
  * This source code is licensed under the ISC license.
102
102
  * See the LICENSE file in the root directory of this source tree.
103
103
  */
104
104
  ;Hn.node;const Un=L(Hn),Wn={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]}
105
105
  /**
106
- * @license lucide-react v1.45.0 - ISC
106
+ * @license lucide-react v1.47.0 - ISC
107
107
  *
108
108
  * This source code is licensed under the ISC license.
109
109
  * See the LICENSE file in the root directory of this source tree.
110
110
  */
111
111
  ;Wn.node;const Gn=L(Wn),Kn={name:`code`,size:24,node:[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]}
112
112
  /**
113
- * @license lucide-react v1.45.0 - ISC
113
+ * @license lucide-react v1.47.0 - ISC
114
114
  *
115
115
  * This source code is licensed under the ISC license.
116
116
  * See the LICENSE file in the root directory of this source tree.
117
117
  */
118
118
  ;Kn.node;const qn=L(Kn),Jn={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]}
119
119
  /**
120
- * @license lucide-react v1.45.0 - ISC
120
+ * @license lucide-react v1.47.0 - ISC
121
121
  *
122
122
  * This source code is licensed under the ISC license.
123
123
  * See the LICENSE file in the root directory of this source tree.
124
124
  */
125
125
  ;Jn.node;const Yn=L(Jn),Xn={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]}
126
126
  /**
127
- * @license lucide-react v1.45.0 - ISC
127
+ * @license lucide-react v1.47.0 - ISC
128
128
  *
129
129
  * This source code is licensed under the ISC license.
130
130
  * See the LICENSE file in the root directory of this source tree.
131
131
  */
132
132
  ;Xn.node;const Zn=L(Xn),Qn={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]}
133
133
  /**
134
- * @license lucide-react v1.45.0 - ISC
134
+ * @license lucide-react v1.47.0 - ISC
135
135
  *
136
136
  * This source code is licensed under the ISC license.
137
137
  * See the LICENSE file in the root directory of this source tree.
138
138
  */
139
139
  ;Qn.node;const $n=L(Qn),er={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]}
140
140
  /**
141
- * @license lucide-react v1.45.0 - ISC
141
+ * @license lucide-react v1.47.0 - ISC
142
142
  *
143
143
  * This source code is licensed under the ISC license.
144
144
  * See the LICENSE file in the root directory of this source tree.
145
145
  */
146
146
  ;er.node;const tr=L(er),nr={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]}
147
147
  /**
148
- * @license lucide-react v1.45.0 - ISC
148
+ * @license lucide-react v1.47.0 - ISC
149
149
  *
150
150
  * This source code is licensed under the ISC license.
151
151
  * See the LICENSE file in the root directory of this source tree.
152
152
  */
153
153
  ;nr.node;const rr=L(nr),ir={name:`italic`,size:24,node:[[`line`,{x1:`19`,x2:`10`,y1:`4`,y2:`4`,key:`15jd3p`}],[`line`,{x1:`14`,x2:`5`,y1:`20`,y2:`20`,key:`bu0au3`}],[`line`,{x1:`15`,x2:`9`,y1:`4`,y2:`20`,key:`uljnxc`}]]}
154
154
  /**
155
- * @license lucide-react v1.45.0 - ISC
155
+ * @license lucide-react v1.47.0 - ISC
156
156
  *
157
157
  * This source code is licensed under the ISC license.
158
158
  * See the LICENSE file in the root directory of this source tree.
159
159
  */
160
160
  ;ir.node;const ar=L(ir),or={name:`link`,size:24,node:[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]}
161
161
  /**
162
- * @license lucide-react v1.45.0 - ISC
162
+ * @license lucide-react v1.47.0 - ISC
163
163
  *
164
164
  * This source code is licensed under the ISC license.
165
165
  * See the LICENSE file in the root directory of this source tree.
166
166
  */
167
167
  ;or.node;const sr=L(or),cr={name:`list-ordered`,size:24,node:[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]}
168
168
  /**
169
- * @license lucide-react v1.45.0 - ISC
169
+ * @license lucide-react v1.47.0 - ISC
170
170
  *
171
171
  * This source code is licensed under the ISC license.
172
172
  * See the LICENSE file in the root directory of this source tree.
173
173
  */
174
- ;cr.node;const lr=L(cr),ur={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]}
174
+ ;cr.node;const lr=L(cr),ur={name:`list`,size:24,node:[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]}
175
175
  /**
176
- * @license lucide-react v1.45.0 - ISC
176
+ * @license lucide-react v1.47.0 - ISC
177
177
  *
178
178
  * This source code is licensed under the ISC license.
179
179
  * See the LICENSE file in the root directory of this source tree.
180
180
  */
181
- ;ur.node;const dr=L(ur),fr={name:`list`,size:24,node:[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]}
181
+ ;ur.node;const dr=L(ur),fr={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]}
182
182
  /**
183
- * @license lucide-react v1.45.0 - ISC
183
+ * @license lucide-react v1.47.0 - ISC
184
184
  *
185
185
  * This source code is licensed under the ISC license.
186
186
  * See the LICENSE file in the root directory of this source tree.
187
187
  */
188
188
  ;fr.node;const pr=L(fr),mr={name:`maximize-2`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]}
189
189
  /**
190
- * @license lucide-react v1.45.0 - ISC
190
+ * @license lucide-react v1.47.0 - ISC
191
191
  *
192
192
  * This source code is licensed under the ISC license.
193
193
  * See the LICENSE file in the root directory of this source tree.
194
194
  */
195
195
  ;mr.node;const hr=L(mr),gr={name:`message-square-plus`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]}
196
196
  /**
197
- * @license lucide-react v1.45.0 - ISC
197
+ * @license lucide-react v1.47.0 - ISC
198
198
  *
199
199
  * This source code is licensed under the ISC license.
200
200
  * See the LICENSE file in the root directory of this source tree.
201
201
  */
202
202
  ;gr.node;const _r=L(gr),vr={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]}
203
203
  /**
204
- * @license lucide-react v1.45.0 - ISC
204
+ * @license lucide-react v1.47.0 - ISC
205
205
  *
206
206
  * This source code is licensed under the ISC license.
207
207
  * See the LICENSE file in the root directory of this source tree.
208
208
  */
209
209
  ;vr.node;const yr=L(vr),br={name:`minimize-2`,size:24,node:[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]}
210
210
  /**
211
- * @license lucide-react v1.45.0 - ISC
211
+ * @license lucide-react v1.47.0 - ISC
212
212
  *
213
213
  * This source code is licensed under the ISC license.
214
214
  * See the LICENSE file in the root directory of this source tree.
215
215
  */
216
216
  ;br.node;const xr=L(br),Sr={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]}
217
217
  /**
218
- * @license lucide-react v1.45.0 - ISC
218
+ * @license lucide-react v1.47.0 - ISC
219
219
  *
220
220
  * This source code is licensed under the ISC license.
221
221
  * See the LICENSE file in the root directory of this source tree.
222
222
  */
223
223
  ;Sr.node;const Cr=L(Sr),wr={name:`quote`,size:24,node:[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]}
224
224
  /**
225
- * @license lucide-react v1.45.0 - ISC
225
+ * @license lucide-react v1.47.0 - ISC
226
226
  *
227
227
  * This source code is licensed under the ISC license.
228
228
  * See the LICENSE file in the root directory of this source tree.
229
229
  */
230
230
  ;wr.node;const Tr=L(wr),Er={name:`redo-2`,size:24,node:[[`path`,{d:`m15 14 5-5-5-5`,key:`12vg1m`}],[`path`,{d:`M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13`,key:`6uklza`}]]}
231
231
  /**
232
- * @license lucide-react v1.45.0 - ISC
232
+ * @license lucide-react v1.47.0 - ISC
233
233
  *
234
234
  * This source code is licensed under the ISC license.
235
235
  * See the LICENSE file in the root directory of this source tree.
236
236
  */
237
237
  ;Er.node;const Dr=L(Er),Or={name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]}
238
238
  /**
239
- * @license lucide-react v1.45.0 - ISC
239
+ * @license lucide-react v1.47.0 - ISC
240
240
  *
241
241
  * This source code is licensed under the ISC license.
242
242
  * See the LICENSE file in the root directory of this source tree.
243
243
  */
244
244
  ;Or.node;const kr=L(Or),Ar={name:`square-code`,size:24,node:[[`path`,{d:`m10 9-3 3 3 3`,key:`1oro0q`}],[`path`,{d:`m14 15 3-3-3-3`,key:`bz13h7`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]],aliases:[`code-square`]}
245
245
  /**
246
- * @license lucide-react v1.45.0 - ISC
246
+ * @license lucide-react v1.47.0 - ISC
247
247
  *
248
248
  * This source code is licensed under the ISC license.
249
249
  * See the LICENSE file in the root directory of this source tree.
250
250
  */
251
251
  ;Ar.node;const jr=L(Ar),Mr={name:`strikethrough`,size:24,node:[[`path`,{d:`M16 4H9a3 3 0 0 0-2.83 4`,key:`43sutm`}],[`path`,{d:`M14 12a4 4 0 0 1 0 8H6`,key:`nlfj13`}],[`line`,{x1:`4`,x2:`20`,y1:`12`,y2:`12`,key:`1e0a9i`}]]}
252
252
  /**
253
- * @license lucide-react v1.45.0 - ISC
253
+ * @license lucide-react v1.47.0 - ISC
254
254
  *
255
255
  * This source code is licensed under the ISC license.
256
256
  * See the LICENSE file in the root directory of this source tree.
257
257
  */
258
258
  ;Mr.node;const Nr=L(Mr),Pr={name:`table`,size:24,node:[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]}
259
259
  /**
260
- * @license lucide-react v1.45.0 - ISC
260
+ * @license lucide-react v1.47.0 - ISC
261
261
  *
262
262
  * This source code is licensed under the ISC license.
263
263
  * See the LICENSE file in the root directory of this source tree.
264
264
  */
265
265
  ;Pr.node;const Fr=L(Pr),Ir={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]}
266
266
  /**
267
- * @license lucide-react v1.45.0 - ISC
267
+ * @license lucide-react v1.47.0 - ISC
268
268
  *
269
269
  * This source code is licensed under the ISC license.
270
270
  * See the LICENSE file in the root directory of this source tree.
271
271
  */
272
272
  ;Ir.node;const Lr=L(Ir),Rr={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]}
273
273
  /**
274
- * @license lucide-react v1.45.0 - ISC
274
+ * @license lucide-react v1.47.0 - ISC
275
275
  *
276
276
  * This source code is licensed under the ISC license.
277
277
  * See the LICENSE file in the root directory of this source tree.
278
278
  */
279
- ;Rr.node;const zr=L(Rr);function Br(...e){return ue(le(e))}const Vr=E(null);function Hr(){return M(Vr)}function Ur(e){return e.startsWith(`agents/`)||e.startsWith(`documents/`)}function Wr(e,t,n=`inline`){return`artifact:${e}:${t}:${n}`}function Gr(e){return`file:${e}`}const Kr=k(()=>import(`react-vega`).then(({VegaEmbed:e})=>({default:e})));function qr({error:e,chartTitle:r}){return t(`div`,{className:`flex items-center justify-center h-full bg-red-50 dark:bg-red-950 rounded-md p-4`,children:n(`div`,{className:`text-center`,children:[n(`p`,{className:`text-sm font-medium text-red-600 dark:text-red-400`,children:[`Cannot render `,r||`Vega-Lite`,` chart`]}),t(`p`,{className:`text-xs text-red-500 dark:text-red-500 mt-1 max-w-xs truncate`,children:e})]})})}function Jr(){return t(`output`,{className:`flex items-center justify-center w-full h-full`,children:t(dr,{className:`w-5 h-5 animate-spin text-gray-500 dark:text-gray-400`})})}function Yr({isOpen:e,onClose:r,title:i,description:a,children:o}){let{t:c}=S();return t(rn,{open:e,onOpenChange:e=>!e&&r(),children:n(cn,{children:[t(un,{className:`fixed inset-0 z-50 bg-black/80 backdrop-blur-sm transition-all duration-300 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`}),n(mn,{className:`fixed inset-2 sm:inset-4 z-50 flex flex-col bg-white dark:bg-gray-900 rounded-xl shadow-2xl transition-all duration-300 ease-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-98 data-[state=open]:zoom-in-98 data-[state=closed]:slide-out-to-bottom-2 data-[state=open]:slide-in-from-bottom-2`,onEscapeKeyDown:r,children:[t(Cn,{asChild:!0,children:t(s,{variant:`unstyled`,onClick:r,className:`absolute top-3 end-3 z-10 p-2 rounded-lg bg-white/80 dark:bg-gray-800/80 backdrop-blur-sm hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors duration-150 shadow-sm`,"aria-label":c(`agent.closeFullscreen`),children:t(zr,{className:`w-5 h-5 text-gray-600 dark:text-gray-300`})})}),t(`div`,{className:`flex-1 overflow-auto p-4 sm:p-6 animate-in fade-in-0 duration-500 delay-150`,children:o}),t(`div`,{className:`flex items-center justify-between px-4 sm:px-6 py-3 border-t border-gray-200 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-800/50 rounded-b-xl`,children:n(`div`,{className:`flex flex-col`,children:[t(yn,{className:`text-base font-semibold text-gray-900 dark:text-gray-100`,children:i||c(`agent.dashboard`)}),a&&t(xn,{className:`text-sm text-gray-500 dark:text-gray-400 mt-0.5`,children:a})]})})]})]})})}function Xr(e,t){if(t===`chart`)return 280;let n=1;if(e.vconcat)n=Array.isArray(e.vconcat)?e.vconcat.length:1;else if(e.concat){let t=e.columns||2,r=Array.isArray(e.concat)?e.concat.length:1;n=Math.ceil(r/t)}else e.facet&&(n=2);return Math.max(500,n*280+40)}const Zr={categorical:[`#6366f1`,`#8b5cf6`,`#ec4899`,`#f43f5e`,`#f97316`,`#eab308`,`#22c55e`,`#14b8a6`,`#06b6d4`,`#3b82f6`],blues:[`#dbeafe`,`#93c5fd`,`#3b82f6`,`#1d4ed8`,`#1e3a8a`],purples:[`#f3e8ff`,`#c4b5fd`,`#8b5cf6`,`#6d28d9`,`#4c1d95`],greens:[`#dcfce7`,`#86efac`,`#22c55e`,`#15803d`,`#14532d`],diverging:[`#ef4444`,`#fca5a5`,`#fef3c7`,`#86efac`,`#22c55e`]};function Qr(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function $r(e){return Qr(e)}function ei(e){let t=JSON.parse(JSON.stringify(e)),n=[`vconcat`,`hconcat`,`concat`];if(!n.some(e=>Array.isArray(t[e])))return t;let r=[];if(Array.isArray(t.params))for(let e of t.params)e&&typeof e==`object`&&e.name&&e.select&&r.push({name:e.name,param:e});if(r.length===0)return t;for(let{name:e,param:i}of r){let r=i.select?.fields||[],a=i.select?.bind===`legend`,o=null;for(let e of n)if(Array.isArray(t[e])){o=t[e];break}if(!o||o.length===0)continue;let s=0;for(let e=0;e<o.length;e++){let t=o[e];if(ni(t,r)||a&&ri(t,r)){s=e;break}}let c=o[s];c.params||=[],c.params.push(i),t.params=(t.params??[]).filter(t=>t.name!==e)}return Array.isArray(t.params)&&t.params.length===0&&delete t.params,t}function ti(e,t){if(!t||Object.keys(t).length===0)return e;let n=JSON.parse(JSON.stringify(e)),r=e=>{for(let n of e)n.name&&n.name in t&&(n.value=t[n.name])};Array.isArray(n.params)&&r(n.params);let i=e=>{if(Array.isArray(e)){for(let t of e)if(Array.isArray(t.params)&&r(t.params),t.vconcat&&i(t.vconcat),t.hconcat&&i(t.hconcat),t.concat&&i(t.concat),Array.isArray(t.layer))for(let e of t.layer)Array.isArray(e.params)&&r(e.params)}};if(n.vconcat&&i(n.vconcat),n.hconcat&&i(n.hconcat),n.concat&&i(n.concat),Array.isArray(n.layer))for(let e of n.layer)e&&Array.isArray(e.params)&&r(e.params);return n}function ni(e,t){if(!e?.encoding)return!1;for(let n of t)for(let t of Object.values(e.encoding))if(t.field===n)return!0;if(Array.isArray(e.layer)){for(let n of e.layer)if(ni(n,t))return!0}return!1}function ri(e,t){if(!e)return!1;let n=e=>{if(!e)return!1;let n=e.color?.field;return!!n&&t.includes(n)};if(n(e.encoding))return!0;if(Array.isArray(e.layer)){for(let t of e.layer)if(n(t.encoding))return!0}return!1}function ii(e,t=[]){let n=[];if(!e||typeof e!=`object`)return n;if(e.data&&typeof e.data==`object`){let r=e.data.url;typeof r==`string`&&r.startsWith(`artifact:`)&&n.push({path:[...t,`data`],artifactPath:r.replace(/^artifact:/,``).trim()})}for(let r of[`layer`,`vconcat`,`hconcat`,`concat`,`spec`,`repeat`,`facet`])if(r in e){let i=e[r];Array.isArray(i)?i.forEach((e,i)=>{$r(e)&&n.push(...ii(e,[...t,r,String(i)]))}):$r(i)&&n.push(...ii(i,[...t,r]))}return n}function ai(e,t){let n=JSON.parse(JSON.stringify(e));for(let[e,r]of t){let t=e.split(`.`),i=n;for(let e=0;e<t.length-1;e++){let n=i[t[e]];if(!Qr(n))break;i=n}let a=t[t.length-1],o=i[a];Qr(o)&&(delete o.url,o.values=r)}return n}function oi(e){let t={background:`transparent`,view:{stroke:`transparent`},range:{category:Zr.categorical,diverging:Zr.diverging,heatmap:Zr.purples,ramp:Zr.blues},mark:{tooltip:!0},bar:{tooltip:!0,cornerRadiusTopLeft:4,cornerRadiusTopRight:4},line:{tooltip:!0,strokeWidth:2.5,strokeCap:`round`},point:{tooltip:!0,size:60,filled:!0},area:{tooltip:!0,fillOpacity:.7,line:!0},rect:{tooltip:!0,cornerRadius:2},arc:{tooltip:!0,cornerRadius:4},circle:{tooltip:!0,size:80}};return e?{...t,axis:{labelColor:`#a1a1aa`,titleColor:`#e4e4e7`,gridColor:`#3f3f46`,domainColor:`#52525b`,tickColor:`#52525b`,labelFont:`Inter, system-ui, sans-serif`,titleFont:`Inter, system-ui, sans-serif`,labelFontSize:11,titleFontSize:12,titleFontWeight:500},legend:{labelColor:`#a1a1aa`,titleColor:`#e4e4e7`,labelFont:`Inter, system-ui, sans-serif`,titleFont:`Inter, system-ui, sans-serif`,labelFontSize:11,titleFontSize:12,symbolSize:100},title:{color:`#fafafa`,font:`Inter, system-ui, sans-serif`,fontSize:14,fontWeight:600}}:{...t,axis:{labelColor:`#71717a`,titleColor:`#3f3f46`,gridColor:`#e4e4e7`,domainColor:`#d4d4d8`,tickColor:`#d4d4d8`,labelFont:`Inter, system-ui, sans-serif`,titleFont:`Inter, system-ui, sans-serif`,labelFontSize:11,titleFontSize:12,titleFontWeight:500},legend:{labelColor:`#71717a`,titleColor:`#3f3f46`,labelFont:`Inter, system-ui, sans-serif`,titleFont:`Inter, system-ui, sans-serif`,labelFontSize:11,titleFontSize:12,symbolSize:100},title:{color:`#18181b`,font:`Inter, system-ui, sans-serif`,fontSize:14,fontWeight:600}}}const si=A(function({spec:r,artifactRunId:i}){let{t:a}=S(),{title:o,description:c,options:l}=r,u=r.spec,[d,f]=I(!1),[p,m]=I(!1),[h,g]=I(null),[_,v]=I(!1),y=F(null),b=F(null),x=F(null),{client:C}=ce(),w=Hr(),E=F(C);E.current=C;let D=F(w);D.current=w;let[O,k]=I(null),[A,M]=I(!1),[ee,te]=I(null),ne=l?.mode||`chart`,re=ne===`dashboard`,ie=l?.enableFullscreen??re,ae=l?.height||Xr(u,ne);N(()=>{let e=ii(u);if(e.length===0){k(u),M(!1),te(null);return}i?console.info(`[VegaLiteChart] resolving artifacts with runId:`,i,e.map(e=>e.artifactPath)):console.warn(`[VegaLiteChart] artifact references found but artifactRunId is missing!`,{references:e.map(e=>e.artifactPath),artifactRunId:i});let t=!1;return M(!0),te(null),(async()=>{let n=new Map,r=E.current,a=D.current;for(let o of e)try{let e=o.path.join(`.`),t;if(i&&!Ur(o.artifactPath)){let e=Wr(i,o.artifactPath,`inline`);t=a?await a.getOrFetch(e,async()=>(await r.files.getArtifactDownloadUrl(i,o.artifactPath,`inline`)).url):(await r.files.getArtifactDownloadUrl(i,o.artifactPath,`inline`)).url}else{let e=Gr(o.artifactPath);t=a?await a.getOrFetch(e,async()=>(await r.files.getDownloadUrl(o.artifactPath)).url):(await r.files.getDownloadUrl(o.artifactPath)).url}let s=await fetch(t);if(!s.ok)throw Error(`Failed to fetch artifact data: ${s.statusText}`);let c=o.artifactPath.toLowerCase().endsWith(`.csv`),l;if(c){let{default:e}=await import(`papaparse`),t=await s.text();l=e.parse(t,{header:!0,skipEmptyLines:!0,dynamicTyping:!0}).data}else{let e=await s.json();l=Array.isArray(e)?e:[e]}n.set(e,l)}catch(e){console.error(`Failed to resolve artifact: ${o.artifactPath}`,e),t||te(`Failed to load data from artifact: ${o.artifactPath}`);return}if(!t){let e=ai(u,n);k(e),M(!1)}})(),()=>{t=!0}},[u,i]);let[oe,se]=I(!1),le=F(!1);N(()=>{let e=()=>{let e=document.documentElement.classList.contains(`dark`);e!==le.current&&(le.current=e,se(e))};e();let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},[]);let[ue,de]=I(0),fe=F(0);N(()=>{if(!x.current)return;let e,t=new ResizeObserver(t=>{clearTimeout(e),e=setTimeout(()=>{let e=t[0]?.contentRect.width;e&&e!==fe.current&&(fe.current=e,de(e))},100)});t.observe(x.current);let n=x.current.clientWidth;return fe.current=n,de(n),()=>{clearTimeout(e),t.disconnect()}},[]);let pe=P(()=>ii(u).length>0,[u]),me=P(()=>{if(pe&&!O)return null;let e=O||u;return e?(l?.parameterValues&&(e=ti(e,l.parameterValues)),ei(e)):null},[O,u,pe,l?.parameterValues]),he=j((e,t)=>{if(!e||typeof e!=`object`)return e;if(e.hconcat&&Array.isArray(e.hconcat)){let n=e.hconcat.length,r=(e.spacing??10)*(n-1),i=Math.floor((t-r)/n);return{...e,hconcat:e.hconcat.map(e=>he(e,i))}}if(e.vconcat&&Array.isArray(e.vconcat))return{...e,vconcat:e.vconcat.map(e=>he(e,t))};if(e.concat&&Array.isArray(e.concat)){let n=e.columns??e.concat.length,r=(e.spacing??10)*(n-1),i=Math.floor((t-r)/n);return{...e,concat:e.concat.map(e=>he(e,i))}}let n=e.width;return n===`container`||typeof n==`number`&&n>t?{...e,width:t}:e},[]),ge=j((e,t=!1)=>{if(!me)return null;let n=oi(oe),r=t?typeof window<`u`?Math.min(window.innerWidth-80,1400):1200:ue>0?ue-24:500,i=`vconcat`in me||`hconcat`in me||`concat`in me,a=i?{type:`pad`,contains:`padding`}:{type:`fit`,contains:`padding`},s=me;i&&r&&(s=he(me,r));let c=s.width,l=i?void 0:c===`container`?r:c??r,{width:u,...d}=s;return{$schema:`https://vega.github.io/schema/vega-lite/v6.json`,...!i&&l?{width:l}:{},height:t?void 0:e,autosize:a,...i?s:d,...o&&!me.title?{title:o}:{},config:{...n,...me.config}}},[me,o,oe,ue,he]),_e=j(async()=>{let e=_?b.current:y.current;if(e&&!p)try{(await e.toCanvas(2)).toBlob(async e=>{e&&(await navigator.clipboard.write([new ClipboardItem({"image/png":e})]),m(!0),setTimeout(()=>m(!1),2e3))},`image/png`)}catch(e){console.error(`Failed to copy chart:`,e)}},[p,_]),ve=j(async()=>{let e=_?b.current:y.current;if(e&&!d){f(!0);try{let t=await e.toImageURL(`png`,2),n=document.createElement(`a`);n.download=`${o||`chart`}.png`,n.href=t,n.click()}catch(e){console.error(`Failed to export chart:`,e)}finally{f(!1)}}},[o,d,_]),ye=j(e=>{y.current=e,g(null)},[]),be=j(e=>{b.current=e},[]),xe=j(e=>{console.error(`Vega-Lite rendering error:`,e),g(e instanceof Error?e.message:`Unknown error`)},[]),Se=j(()=>{v(e=>!e)},[]);N(()=>{g(null)},[u]);let Ce=({className:e})=>n(`div`,{className:Br(`flex items-center gap-2`,e),children:[n(s,{variant:`unstyled`,onClick:_e,disabled:p,className:`text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 cursor-pointer transition-colors disabled:opacity-50 flex items-center gap-1`,title:a(`agent.copyToClipboard`),children:[t(p?Un:Yn,{className:`w-3 h-3`}),a(p?`agent.copied`:`agent.copy`)]}),n(s,{variant:`unstyled`,onClick:ve,disabled:d,className:`text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 cursor-pointer transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1`,title:a(`agent.exportAsPng`),children:[t(Zn,{className:`w-3 h-3`}),a(d?`agent.exporting`:`agent.export`)]}),ie&&n(s,{variant:`unstyled`,onClick:Se,className:`text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 cursor-pointer transition-colors flex items-center gap-1`,title:a(_?`agent.exitFullscreen`:`agent.fullscreen`),children:[t(_?xr:hr,{className:`w-3 h-3`}),a(_?`agent.exit`:`agent.fullscreen`)]})]});if(A||pe&&!O)return t(`div`,{className:`bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-gray-900 dark:text-gray-100`,children:o||`Chart`})}),t(`div`,{className:`flex items-center justify-center bg-gray-50 dark:bg-gray-800 rounded`,style:{width:`100%`,height:ae},children:n(`div`,{className:`flex items-center gap-2 text-gray-500 dark:text-gray-400`,children:[t(dr,{className:`w-5 h-5 animate-spin`}),t(`span`,{className:`text-sm`,children:`Loading data from artifacts...`})]})})]})});if(ee)return t(`div`,{className:`bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-gray-900 dark:text-gray-100`,children:o||`Chart`})}),t(`div`,{style:{width:`100%`,height:ae},children:t(qr,{error:ee,chartTitle:o})})]})});if(h)return t(`div`,{className:`bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-gray-900 dark:text-gray-100`,children:o||`Chart`})}),t(`div`,{style:{width:`100%`,height:ae},children:t(qr,{error:h,chartTitle:o})})]})});let we=ge(ae),Te=ge(0,!0);return we?(typeof window<`u`&&localStorage.getItem(`DEBUG_VEGA_RENDERS`)&&console.log(`VegaLite rendering with spec:`,{title:o,hasData:!!we.data?.values,dataLength:we.data?.values?.length}),n(e,{children:[t(`div`,{className:Br(`bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm`,re&&`border-2`),children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[n(`div`,{className:`flex items-center justify-between`,children:[n(`div`,{className:`flex items-center gap-2`,children:[t(`span`,{className:`font-medium text-sm text-gray-900 dark:text-gray-100`,children:o||(re?`Dashboard`:`Chart`)}),re&&t(`span`,{className:`text-xs px-2 py-0.5 rounded-full bg-indigo-100 dark:bg-indigo-900 text-indigo-700 dark:text-indigo-300`,children:`Interactive`})]}),t(Ce,{})]}),c&&t(`span`,{className:`text-xs text-gray-500 dark:text-gray-400`,children:c}),t(`div`,{ref:x,className:`bg-white dark:bg-gray-900 rounded overflow-hidden`,style:{width:`100%`,height:ae,minWidth:0},children:t(T,{fallback:t(Jr,{}),children:t(Kr,{spec:we,onEmbed:e=>ye(e.view),onError:xe,options:{renderer:l?.renderer||`canvas`,actions:!1}})})})]})}),n(Yr,{isOpen:_,onClose:()=>v(!1),title:o||(re?`Dashboard`:`Chart`),description:c,children:[t(`div`,{className:`w-full h-full min-h-[calc(100vh-200px)]`,children:Te&&t(T,{fallback:t(Jr,{}),children:t(Kr,{spec:Te,onEmbed:e=>be(e.view),onError:xe,options:{renderer:l?.renderer||`canvas`,actions:!1}})})}),t(`div`,{className:`absolute bottom-6 end-6`,children:t(Ce,{className:`bg-white dark:bg-gray-800 rounded-lg shadow-lg p-2 border border-gray-200 dark:border-gray-700`})})]})]})):null},(e,t)=>JSON.stringify(e.spec)===JSON.stringify(t.spec)&&e.artifactRunId===t.artifactRunId),ci={chart:{icon:Vn,label:`chart`,defaultHeight:200},mermaid:{icon:tr,label:`diagram`,defaultHeight:150},proposal:{icon:yr,label:`options`,defaultHeight:100},code:{icon:qn,label:`code`,defaultHeight:80},image:{icon:rr,label:`image`,defaultHeight:150},link:{icon:sr,label:`link`,defaultHeight:24},expand:{icon:Zn,label:`content`,defaultHeight:100},table:{icon:Fr,label:`table`,defaultHeight:150},markdown:{icon:$n,label:`content`,defaultHeight:100},"fusion-fragment":{icon:qn,label:`fragment`,defaultHeight:150}};function R({type:e,error:r,onRetry:i,message:a,height:o}){let c=ci[e],l=o??c.defaultHeight,u=e===`link`;if(r)return n(`div`,{className:`flex items-center gap-2 rounded border border-destructive/30 bg-destructive/5 text-destructive ${u?`inline-flex px-2 py-1 text-sm`:`p-4`}`,style:u?void 0:{minHeight:l},children:[n(`span`,{className:`text-destructive`,children:[`Failed to load `,c.label]}),i&&t(s,{variant:`unstyled`,onClick:i,className:`ms-2 rounded bg-destructive/10 px-2 py-1 text-xs hover:bg-destructive/20 transition-colors text-destructive`,children:`Retry`})]});let d=c.icon;return u?n(`span`,{className:`inline-flex items-center gap-1 text-muted animate-pulse`,children:[t(d,{className:`h-3 w-3`}),t(`span`,{children:a||`Loading ${c.label}...`})]}):n(`div`,{className:`flex flex-col items-center justify-center gap-3 rounded border border-border bg-muted/30 animate-pulse`,style:{minHeight:l},children:[t(d,{className:`h-8 w-8 text-muted`}),t(`span`,{className:`text-sm text-muted`,children:a||`Loading ${c.label}...`}),t(`div`,{className:`flex gap-1`,children:[...[,,,]].map((e,n)=>t(`div`,{className:`h-2 w-2 rounded-full bg-muted animate-bounce`,style:{animationDelay:`${n*150}ms`}},`dot-${n}`))})]})}var li=class extends w.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(`CodeBlock rendering error (${this.props.type}):`,e,t),this.props.onError?.(e)}handleRetry=()=>{this.setState({hasError:!1,error:void 0})};render(){if(this.state.hasError){let{type:e,fallbackCode:r}=this.props;return n(`div`,{className:`space-y-2`,children:[t(R,{type:e,error:this.state.error?.message||`Rendering failed`,onRetry:this.handleRetry}),r&&n(`details`,{className:`text-sm`,children:[t(`summary`,{className:`cursor-pointer text-muted hover:text-foreground`,children:`Show raw content`}),t(`pre`,{className:`mt-2 overflow-x-auto rounded bg-muted/50 p-2 text-xs`,children:t(`code`,{children:r})})]})]})}return this.props.children}};function ui(e,t,n){let r=t.split(`.`).pop()?.toLowerCase();if(r===`svg`)return`mockup`;if([`png`,`jpg`,`jpeg`,`gif`,`webp`].includes(r||``))return`image`;if(r===`md`)return`markdown`;if(r===`csv`)return`table`;if(n===`json`&&typeof e==`object`&&e){let t=e;if(typeof t.$schema==`string`&&t.$schema.includes(`vega`)||t.library===`vega-lite`&&`spec`in t)return`vega-lite`;if(`template`in t&&`data`in t)return`fusion-fragment`;if(Array.isArray(e)&&e.length>0&&typeof e[0]==`object`)return`table`}return`code`}function di(e){if(typeof e!=`object`||!e)return null;let t=e;return t.library===`vega-lite`&&`spec`in t&&typeof t.spec==`object`&&t.spec!==null?t:typeof t.$schema==`string`&&t.$schema.includes(`vega`)?{library:`vega-lite`,spec:t}:null}function fi({content:e}){let{headers:r,rows:i}=P(()=>{if(!Array.isArray(e)||e.length===0)return{headers:[],rows:[]};let t=e[0];if(typeof t!=`object`||!t)return{headers:[],rows:[]};let n=Object.keys(t);return{headers:n,rows:e.map(e=>n.map(t=>{let n=e[t];return n==null?``:typeof n==`object`?JSON.stringify(n):String(n)}))}},[e]);return r.length===0?t(R,{type:`table`,error:`No table data found`}):n(`div`,{className:`overflow-x-auto`,children:[n(`table`,{className:`min-w-full text-sm border-collapse`,children:[t(`thead`,{children:t(`tr`,{className:`border-b`,children:r.map(e=>t(`th`,{className:`px-3 py-2 text-start font-medium text-muted`,children:e},e))})}),t(`tbody`,{children:i.slice(0,100).map((e,n)=>t(`tr`,{className:`border-b border-muted/20`,children:e.map((e,n)=>t(`td`,{className:`px-3 py-2`,children:e},`cell-${n}`))},`row-${n}`))})]}),i.length>100&&n(`div`,{className:`text-sm text-muted py-2`,children:[`Showing 100 of `,i.length,` rows`]})]})}function pi({content:e,path:n}){let r=n.split(`.`).pop()?.toLowerCase()||``,i=typeof e==`string`?e:JSON.stringify(e,null,2);return t(`pre`,{className:`overflow-x-auto p-3 bg-muted/10 rounded text-sm`,children:t(`code`,{className:`language-${r}`,children:i})})}function mi(e){return pe.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:[`use`],FORBID_TAGS:[`foreignObject`]})}function hi(e){return e.replace(/<svg([^>]*)>/i,(e,t)=>{let n=t;if(!/viewBox/i.test(n)){let e=/\swidth\s*=\s*["']?(\d+(?:\.\d+)?)/i.exec(n),t=/\sheight\s*=\s*["']?(\d+(?:\.\d+)?)/i.exec(n);e&&t&&(n+=` viewBox="0 0 ${e[1]} ${t[1]}"`)}return n=n.replace(/\swidth\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,``).replace(/\sheight\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,``),/style="/i.test(n)?n=n.replace(/style="([^"]*)"/i,(e,t)=>`style="${t};width:100%;height:auto;display:block;max-width:100%;"`):n+=` style="width:100%;height:auto;display:block;max-width:100%;"`,/preserveAspectRatio=/i.test(n)||(n+=` preserveAspectRatio="xMidYMid meet"`),`<svg${n}>`})}function gi({content:e}){let n=P(()=>{let t=typeof e==`string`?e.trim():``;return t?hi(mi(t)):null},[e]);return n?t(`div`,{style:{margin:`16px 0`,width:`100%`,overflowX:`auto`},dangerouslySetInnerHTML:{__html:n}}):t(R,{type:`expand`,error:`Empty mockup`})}function _i({content:e,path:n}){let r=typeof e==`string`?e:``,i=n.split(`/`).pop()||`Artifact image`;return t(`img`,{src:r,alt:i,className:`max-w-full h-auto rounded`,loading:`lazy`})}function vi({content:e,renderType:n,path:r,runId:i,contentType:a}){let{MarkdownRenderer:o}=Pe();switch(P(()=>n===`auto`?ui(e,r,a):n,[e,r,a,n])){case`chart`:{let n=di(e);return n?t(li,{type:`chart`,fallbackCode:JSON.stringify(e,null,2),children:t(si,{spec:n,artifactRunId:i})}):t(R,{type:`chart`,error:`Only Vega-Lite charts are supported. Recharts rendering has been retired.`})}case`vega-lite`:{let n=di(e);return n?t(li,{type:`chart`,fallbackCode:JSON.stringify(e,null,2),children:t(si,{spec:n,artifactRunId:i})}):t(R,{type:`chart`,error:`Invalid Vega-Lite specification`})}case`fusion-fragment`:{let n=e;return console.log(`[ArtifactContentRenderer] fusion-fragment:`,{hasTemplate:!!n.template,hasData:!!n.data,runId:i,hasVegaLiteChart:!!si}),n.template&&n.data?t(li,{type:`fusion-fragment`,fallbackCode:JSON.stringify(e,null,2),children:t(fe,{data:n.data,ChartComponent:si,artifactRunId:i,children:t(de,{code:JSON.stringify(n.template),data:n.data})})}):t(li,{type:`fusion-fragment`,fallbackCode:JSON.stringify(e,null,2),children:t(de,{code:JSON.stringify(e)})})}case`table`:return t(li,{type:`table`,fallbackCode:JSON.stringify(e,null,2),children:t(fi,{content:e})});case`markdown`:{let n=typeof e==`string`?e:String(e);return t(li,{type:`markdown`,fallbackCode:n,children:o?t(o,{artifactRunId:i,children:n}):t(`pre`,{className:`overflow-x-auto p-3 bg-muted/10 rounded text-sm`,children:t(`code`,{children:n})})})}case`mockup`:return t(li,{type:`expand`,fallbackCode:typeof e==`string`?e:r,children:t(gi,{content:e})});case`image`:return t(li,{type:`image`,fallbackCode:r,children:t(_i,{content:e,path:r})});default:return t(pi,{content:e,path:r})}}const yi=`Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif`;function bi(e){let t=e.trim(),n=``,r=!1,i=!1;for(let e=0;e<t.length;e++){let a=t[e],o=e>0?t[e-1]:``;if(a===`"`&&!i&&o!==`\\`){r=!r,n+=a;continue}if(a===`'`&&!r&&o!==`\\`){i=!i,n+=a;continue}if((r||i)&&a===`\\`){let r=e;for(;t[r]===`\\`;)r++;if(t[r]===`n`){n+=`<br/>`,e=r;continue}}n+=a}return n}function xi(e){return e.replace(/<svg([^<>]*)>/i,(e,t)=>{let n=t.replace(/\swidth="[^"]*"/i,``).replace(/\sheight="[^"]*"/i,``);return/style="/i.test(n)?n=n.replace(/style="([^"]*)"/i,(e,t)=>`style="${t};width:100%;height:auto;display:block;max-width:100%;"`):n+=` style="width:100%;height:auto;display:block;max-width:100%;"`,/preserveAspectRatio=/i.test(n)||(n+=` preserveAspectRatio="xMidYMid meet"`),`<svg${n}>`})}let Si;function Ci(){return Si||=import(`mermaid`).then(({default:e})=>(e.initialize({startOnLoad:!1,theme:`default`,securityLevel:`loose`,fontFamily:yi,suppressErrorRendering:!0,flowchart:{htmlLabels:!0,useMaxWidth:!0,nodeSpacing:40,rankSpacing:50,padding:12},sequence:{useMaxWidth:!0},themeVariables:{fontFamily:yi}}),e)),Si}function wi({code:e,className:n}){let r=F(null),[i,a]=I(null),[o,s]=I(null),c=ee().replace(/:/g,`_`);return N(()=>{let t=!1;return(async()=>{if(!e.trim()){a(null),s(null);return}try{s(null);let n=`mermaid-${c}-${Date.now()}`,r=bi(e),{svg:i}=await(await Ci()).render(n,r),o=xi(i);t||a(o)}catch(e){if(!t){let t=e instanceof Error?e.message:`Failed to render mermaid diagram`;s(t),a(null)}}})(),()=>{t=!0}},[e,c]),o?null:i?t(`div`,{ref:r,className:`my-4 w-full overflow-x-auto [&_svg]:mx-auto [&_svg]:w-full [&_svg]:h-auto [&_svg]:max-w-full ${n||``}`,dangerouslySetInnerHTML:{__html:i}}):t(`div`,{className:`my-4 p-4 bg-muted rounded-lg animate-pulse ${n||``}`,children:t(`div`,{className:`h-32 bg-muted rounded`})})}function Ti(e){switch(e.split(`.`).pop()?.toLowerCase()){case`json`:return`json`;case`md`:case`txt`:case`csv`:case`yaml`:case`yml`:return`text`;case`png`:case`jpg`:case`jpeg`:case`gif`:case`webp`:case`pdf`:return`binary`;default:return`text`}}function Ei({runId:e,path:t,parseJson:n=!0}){let{client:r}=ce(),i=Hr(),a=F(r);a.current=r;let o=F(i);o.current=i;let[s,c]=I({data:void 0,rawContent:void 0,isLoading:!0,error:void 0,contentType:void 0}),l=j(async()=>{if(!e){c({data:void 0,rawContent:void 0,isLoading:!1,error:`No run ID provided`,contentType:void 0});return}if(!t){c({data:void 0,rawContent:void 0,isLoading:!1,error:`No artifact path provided`,contentType:void 0});return}c(e=>({...e,isLoading:!0,error:void 0}));let r=a.current,i=o.current,s=Ti(t);try{let a=Wr(e,t,`inline`),o;o=i?await i.getOrFetch(a,async()=>(await r.files.getArtifactDownloadUrl(e,t,`inline`)).url):(await r.files.getArtifactDownloadUrl(e,t,`inline`)).url;let l=await fetch(o);if(!l.ok)throw Error(`Failed to fetch artifact: ${l.status} ${l.statusText}`);if(s===`binary`){c({data:o,rawContent:void 0,isLoading:!1,error:void 0,contentType:s,etag:l.headers.get(`etag`)?.replace(/^"(.*)"$/,`$1`)});return}let u=await l.text(),d;if(n&&s===`json`)try{d=JSON.parse(u)}catch{d=u}else d=u;c({data:d,rawContent:u,isLoading:!1,error:void 0,contentType:s,etag:l.headers.get(`etag`)?.replace(/^"(.*)"$/,`$1`)})}catch(e){let n=e instanceof Error?e.message:`Failed to fetch artifact`;console.error(`Failed to fetch artifact content:`,t,e),c({data:void 0,rawContent:void 0,isLoading:!1,error:n,contentType:s})}},[e,t,n]);N(()=>{l()},[l]);let u=j(()=>{c({data:void 0,rawContent:void 0,isLoading:!0,error:void 0,contentType:void 0}),l()},[l]);return{data:s.data,rawContent:s.rawContent,isLoading:s.isLoading,error:s.error,contentType:s.contentType,etag:s.etag,retry:u}}function Di(e){let t=e.trim();if(t.length<2)return!0;if(!t.startsWith(`{`))return!1;try{return JSON.parse(t),!1}catch(e){let n=e instanceof Error?e.message:``,r=[`unexpected end`,`unterminated string`,`expected`,`unexpected token`],i=n.toLowerCase();if(r.some(e=>i.includes(e))){let e=0,n=0,r=!1,i=!1;for(let a of t){if(i){i=!1;continue}if(a===`\\`){i=!0;continue}if(a===`"`){r=!r;continue}r||(a===`{`?e++:a===`}`?e--:a===`[`?n++:a===`]`&&n--)}return e>0||n>0||r}return!1}}function Oi(e){try{let t=e.trim(),n=t.indexOf(`{`),r=t.lastIndexOf(`}`);return n!==-1&&r>n&&(t=t.slice(n,r+1)),JSON.parse(t)}catch{return null}}function ki(e){let t=typeof e.$schema==`string`&&e.$schema.includes(`vega`),n=e.library===`vega-lite`&&`spec`in e;return t||n?`vega-lite`:null}function Ai({code:e}){let{artifactRunId:n}=Pe();n||console.warn(`[VegaLiteCodeBlockHandler] artifactRunId is missing from CodeBlockContext`);let r=P(()=>Di(e),[e]),i=P(()=>{if(r)return null;let t=Oi(e);return t?{library:`vega-lite`,spec:t}:null},[e,r]);return r?t(R,{type:`chart`,message:`Loading chart...`}):i?t(li,{type:`chart`,fallbackCode:e,children:t(si,{spec:i,artifactRunId:n})}):t(R,{type:`chart`,error:`Invalid Vega-Lite specification`})}function ji({code:e}){let{artifactRunId:n}=Pe();n||console.warn(`[ChartCodeBlockHandler] artifactRunId is missing from CodeBlockContext`);let r=P(()=>Di(e),[e]),i=P(()=>{if(r)return null;let t=Oi(e);return!t||!ki(t)?null:t.library===`vega-lite`&&`spec`in t&&typeof t.spec==`object`?t:{library:`vega-lite`,spec:t}},[e,r]);return r?t(R,{type:`chart`,message:`Loading chart...`}):i?t(li,{type:`chart`,fallbackCode:e,children:t(si,{spec:i,artifactRunId:n})}):t(R,{type:`chart`,error:`Invalid Vega-Lite chart specification`})}function Mi({code:e}){let n=e.trim();return n?t(li,{type:`mermaid`,fallbackCode:e,children:t(wi,{code:n})}):t(R,{type:`mermaid`,error:`Empty diagram`})}function Ni({code:e}){let n=P(()=>{let t=e.trim();return t?hi(mi(t)):null},[e]);return n?t(li,{type:`code`,fallbackCode:e,children:t(`div`,{style:{margin:`16px 0`,width:`100%`,overflowX:`auto`},dangerouslySetInnerHTML:{__html:n}})}):t(R,{type:`code`,error:`Empty mockup`})}function Pi({code:e,language:n}){let{artifactRunId:r}=Pe(),i=e.trim(),a=P(()=>{if(!n?.includes(`:`))return`auto`;let e=n.split(`:`)[1];return[`chart`,`vega-lite`,`table`,`markdown`,`fusion-fragment`,`mockup`,`code`,`image`,`auto`].includes(e)?e:`auto`},[n]),{data:o,isLoading:s,error:c,contentType:l}=Ei({runId:r,path:i});return r?s?t(R,{type:`expand`,message:`Loading ${i}...`}):c?t(R,{type:`expand`,error:`Failed to load artifact: ${c}`}):o===void 0?t(R,{type:`expand`,error:`No content found in artifact`}):t(vi,{content:o,renderType:a,path:i,runId:r,contentType:l}):t(R,{type:`expand`,error:`No artifact run ID available`})}function Fi(e){return e?.startsWith(`expand`)??!1}function Ii(){return{chart:ji,"vega-lite":Ai,vegalite:Ai,mermaid:Mi,mockup:Ni,svg:Ni}}const Li=new Set([`store`,`document`,`collection`,`interaction`,`prompt`,`agent`,`workflow`,`process`,`run`]);function Ri(e){return e.trim().replace(/^\/+/,``)}function zi(e){if(e.startsWith(`artifact:`))return{scheme:`artifact`,path:e.slice(9).trim()};if(e.startsWith(`image:`))return{scheme:`image`,path:e.slice(6).trim()};let t=e.indexOf(`:`);if(t>0){let n=e.slice(0,t);if(Li.has(n))return{scheme:n,path:Ri(e.slice(t+1))}}return{scheme:`standard`,path:e}}function Bi({rawUrl:e,artifactRunId:t,disposition:n=`inline`}){let{client:r}=ce(),i=Hr(),a=F(r);a.current=r;let o=F(i);o.current=i;let{scheme:s,path:c}=zi(e),[l,u]=I(()=>{if(s===`standard`)return{url:e,isLoading:!1,error:void 0};if(i&&(s===`artifact`||s===`image`)){let e;e=s===`artifact`&&t&&!Ur(c)?Wr(t,c,n):Gr(c);let r=i.getUrl(e);if(r)return{url:r,isLoading:!1,error:void 0}}return{url:void 0,isLoading:!0,error:void 0}}),d=j(async()=>{if(s===`standard`)return;if(s!==`artifact`&&s!==`image`){u({url:void 0,isLoading:!1,error:`Unknown scheme: ${s}`});return}u(e=>({...e,isLoading:!0,error:void 0}));let e=a.current,r=o.current;try{let i;if(s===`artifact`){if(t&&!Ur(c)){let a=Wr(t,c,n);i=r?await r.getOrFetch(a,async()=>(await e.files.getArtifactDownloadUrl(t,c,n)).url):(await e.files.getArtifactDownloadUrl(t,c,n)).url}else{let t=Gr(c);i=r?await r.getOrFetch(t,async()=>(await e.files.getDownloadUrl(c)).url):(await e.files.getDownloadUrl(c)).url}}else{let t=Gr(c);i=r?await r.getOrFetch(t,async()=>(await e.files.getDownloadUrl(c)).url):(await e.files.getDownloadUrl(c)).url}u({url:i,isLoading:!1,error:void 0})}catch(e){let t=e instanceof Error?e.message:`Failed to resolve URL`;console.error(`Failed to resolve URL:`,c,e),u({url:void 0,isLoading:!1,error:t})}},[s,c,t,n]);N(()=>{if(l.url&&!l.error)return;let e=!1;return e||(async()=>{await d()})(),()=>{e=!0}},[d,l.url,l.error]);let f=j(()=>{u({url:void 0,isLoading:!0,error:void 0}),d()},[d]);return{url:l.url,isLoading:l.isLoading,error:l.error,scheme:s,retry:f}}function Vi({src:e,alt:r,caption:i,className:a,artifactRunId:o}){let s=e||``,{scheme:c}=zi(s);return c===`standard`?n(`figure`,{className:`my-4`,children:[t(`img`,{src:e,alt:r,className:a}),t(`figcaption`,{className:`mt-2 text-sm text-muted text-center italic`,children:i})]}):t(Hi,{rawSrc:s,alt:r,caption:i,artifactRunId:o,className:a})}function Hi({rawSrc:e,alt:r,caption:i,artifactRunId:a,className:o}){let{url:s,isLoading:c,error:l,retry:u}=Bi({rawUrl:e,artifactRunId:a,disposition:`inline`});return c?t(R,{type:`image`,message:r?`Loading ${r}...`:void 0}):l?t(R,{type:`image`,error:l,onRetry:u}):s?n(`figure`,{className:`my-4`,children:[t(`img`,{src:s,alt:r,className:o}),t(`figcaption`,{className:`mt-2 text-sm text-muted text-center italic`,children:i})]}):null}function Ui({node:e,src:n,alt:r,className:i,artifactRunId:a,ExistingImg:o,...s}){let c=n||``,{scheme:l}=zi(c);return l===`standard`?typeof o==`function`?t(o,{node:e,src:n,alt:r,...s}):t(`img`,{src:n,alt:r,className:i,...s}):t(Wi,{rawSrc:c,alt:r,artifactRunId:a,className:i,rest:s})}function Wi({rawSrc:e,alt:n,artifactRunId:r,className:i,rest:a}){let{url:o,isLoading:s,error:c,retry:l}=Bi({rawUrl:e,artifactRunId:r,disposition:`inline`});return s?t(R,{type:`image`,message:n?`Loading ${n}...`:void 0}):c?t(R,{type:`image`,error:c,onRetry:l}):o?t(`img`,{src:o,alt:n,className:i,...a}):null}const Gi=E(()=>({kind:`none`}));Gi.Provider;function Ki(){return M(Gi)}const qi={store:`document`,document:`document`,collection:`collection`,interaction:`interaction`,prompt:`prompt`,agent:`agent`,workflow:`workflow`,process:`process`,run:`interaction_run`};function Ji(e){let t=e.indexOf(`:`);if(t<=0)return;let n=e.slice(0,t);if(!Object.hasOwn(qi,n))return;let r=e.slice(t+1).trim().replace(/^\/+/,``);if(r)return{type:qi[n],id:r}}function Yi({node:e,href:n,children:r,className:i,artifactRunId:a,onArtifactOpen:o,ExistingLink:s,...c}){let l=n||``,u=Ji(l);if(u)return t(Xi,{resource:u,rawHref:l,artifactRunId:a,className:i,ExistingLink:s,rest:c,children:r});let{scheme:d,path:f}=zi(l);return d===`standard`?typeof s==`function`?t(s,{node:e,href:n,className:i,...c,children:r}):t(`a`,{href:n,...c,className:i,target:`_blank`,rel:`noopener noreferrer`,children:r}):t(Zi,{rawHref:l,artifactRunId:a,artifactPath:d===`artifact`?f:void 0,onArtifactOpen:o,className:i,rest:c,children:r})}function Xi({resource:e,rawHref:n,artifactRunId:r,className:i,children:a,ExistingLink:o,rest:c}){let l=Ki()(e,{workflowRunId:r,source:`markdown`,rawHref:n});return l.kind===`navigate`?typeof o==`function`?t(o,{href:l.href,className:i,...c,children:a}):t(`a`,{href:l.href,...c,className:i,target:`_blank`,rel:`noopener noreferrer`,children:a}):l.kind===`activate`?t(s,{variant:`link`,size:`none`,className:i,onClick:l.onActivate,children:a}):t(`span`,{className:i,children:a})}function Zi({rawHref:e,artifactRunId:n,artifactPath:r,onArtifactOpen:i,className:a,children:o,rest:s}){let{url:c,isLoading:l,error:u,retry:d}=Bi({rawUrl:e,artifactRunId:n,disposition:`attachment`});return l?t(`span`,{className:`inline-flex items-center gap-1 text-muted`,children:t(R,{type:`link`})}):u?t(`span`,{className:`inline-flex items-center gap-1`,children:t(R,{type:`link`,error:u,onRetry:d})}):t(`a`,{href:c||`#`,...s,className:a,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>{r&&/\.md$/i.test(r)&&i&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&e.button===0&&(e.preventDefault(),i(r))},children:o})}function Qi(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}const $i=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ea=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ta={};function na(e,t){return((t||ta).jsx?ea:$i).test(e)}const ra=/[ \t\n\f\r]/g;function ia(e){return typeof e==`object`?e.type===`text`&&aa(e.value):aa(e)}function aa(e){return e.replace(ra,``)===``}var oa=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};oa.prototype.normal={},oa.prototype.property={},oa.prototype.space=void 0;function sa(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new oa(n,r,t)}function ca(e){return e.toLowerCase()}var z=class{constructor(e,t){this.attribute=t,this.property=e}};z.prototype.attribute=``,z.prototype.booleanish=!1,z.prototype.boolean=!1,z.prototype.commaOrSpaceSeparated=!1,z.prototype.commaSeparated=!1,z.prototype.defined=!1,z.prototype.mustUseProperty=!1,z.prototype.number=!1,z.prototype.overloadedBoolean=!1,z.prototype.property=``,z.prototype.spaceSeparated=!1,z.prototype.space=void 0;var la=Oe({boolean:()=>B,booleanish:()=>V,commaOrSpaceSeparated:()=>pa,commaSeparated:()=>fa,number:()=>H,overloadedBoolean:()=>da,spaceSeparated:()=>U});let ua=0;const B=ma(),V=ma(),da=ma(),H=ma(),U=ma(),fa=ma(),pa=ma();function ma(){return 2**++ua}const ha=Object.keys(la);var ga=class extends z{constructor(e,t,n,r){let i=-1;if(super(e,t),_a(this,`space`,r),typeof n==`number`)for(;++i<ha.length;){let e=ha[i];_a(this,ha[i],(n&la[e])===la[e])}}};ga.prototype.defined=!0;function _a(e,t,n){n&&(e[t]=n)}function va(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new ga(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[ca(r)]=r,n[ca(a.attribute)]=r}return new oa(t,n,e.space)}const ya=va({properties:{ariaActiveDescendant:null,ariaAtomic:V,ariaAutoComplete:null,ariaBusy:V,ariaChecked:V,ariaColCount:H,ariaColIndex:H,ariaColSpan:H,ariaControls:U,ariaCurrent:null,ariaDescribedBy:U,ariaDetails:null,ariaDisabled:V,ariaDropEffect:U,ariaErrorMessage:null,ariaExpanded:V,ariaFlowTo:U,ariaGrabbed:V,ariaHasPopup:null,ariaHidden:V,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:U,ariaLevel:H,ariaLive:null,ariaModal:V,ariaMultiLine:V,ariaMultiSelectable:V,ariaOrientation:null,ariaOwns:U,ariaPlaceholder:null,ariaPosInSet:H,ariaPressed:V,ariaReadOnly:V,ariaRelevant:null,ariaRequired:V,ariaRoleDescription:U,ariaRowCount:H,ariaRowIndex:H,ariaRowSpan:H,ariaSelected:V,ariaSetSize:H,ariaSort:null,ariaValueMax:H,ariaValueMin:H,ariaValueNow:H,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function ba(e,t){return t in e?e[t]:t}function xa(e,t){return ba(e,t.toLowerCase())}const Sa=va({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:fa,acceptCharset:U,accessKey:U,action:null,allow:null,allowFullScreen:B,allowPaymentRequest:B,allowUserMedia:B,alpha:B,alt:null,as:null,async:B,autoCapitalize:null,autoComplete:U,autoFocus:B,autoPlay:B,blocking:U,capture:null,charSet:null,checked:B,cite:null,className:U,closedBy:null,colorSpace:null,cols:H,colSpan:H,command:null,commandFor:null,content:null,contentEditable:V,controls:B,controlsList:U,coords:H|fa,crossOrigin:null,data:null,dateTime:null,decoding:null,default:B,defer:B,dir:null,dirName:null,disabled:B,download:da,draggable:V,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:B,formTarget:null,headers:U,height:H,hidden:da,high:H,href:null,hrefLang:null,htmlFor:U,httpEquiv:U,id:null,imageSizes:null,imageSrcSet:null,inert:B,inputMode:null,integrity:null,is:null,isMap:B,itemId:null,itemProp:U,itemRef:U,itemScope:B,itemType:U,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:B,low:H,manifest:null,max:null,maxLength:H,media:null,method:null,min:null,minLength:H,multiple:B,muted:B,name:null,nonce:null,noModule:B,noValidate:B,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:B,optimum:H,pattern:null,ping:U,placeholder:null,playsInline:B,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:B,referrerPolicy:null,rel:U,required:B,reversed:B,rows:H,rowSpan:H,sandbox:U,scope:null,scoped:B,seamless:B,selected:B,shadowRootClonable:B,shadowRootCustomElementRegistry:B,shadowRootDelegatesFocus:B,shadowRootMode:null,shadowRootSerializable:B,shape:null,size:H,sizes:null,slot:null,span:H,spellCheck:V,src:null,srcDoc:null,srcLang:null,srcSet:null,start:H,step:null,style:null,tabIndex:H,target:null,title:null,translate:null,type:null,typeMustMatch:B,useMap:null,value:V,width:H,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:U,axis:null,background:null,bgColor:null,border:H,borderColor:null,bottomMargin:H,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:B,declare:B,event:null,face:null,frame:null,frameBorder:null,hSpace:H,leftMargin:H,link:null,longDesc:null,lowSrc:null,marginHeight:H,marginWidth:H,noResize:B,noHref:B,noShade:B,noWrap:B,object:null,profile:null,prompt:null,rev:null,rightMargin:H,rules:null,scheme:null,scrolling:V,standby:null,summary:null,text:null,topMargin:H,valueType:null,version:null,vAlign:null,vLink:null,vSpace:H,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:B,disablePictureInPicture:B,disableRemotePlayback:B,exportParts:fa,part:U,prefix:null,property:null,results:H,security:null,unselectable:null},space:`html`,transform:xa}),Ca=va({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:pa,accentHeight:H,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:H,amplitude:H,arabicForm:null,ascent:H,attributeName:null,attributeType:null,azimuth:H,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:H,by:null,calcMode:null,capHeight:H,className:U,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:H,diffuseConstant:H,direction:null,display:null,dur:null,divisor:H,dominantBaseline:null,download:B,dx:null,dy:null,edgeMode:null,editable:null,elevation:H,enableBackground:null,end:null,event:null,exponent:H,externalResourcesRequired:null,fill:null,fillOpacity:H,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:fa,g2:fa,glyphName:fa,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:H,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:H,horizOriginX:H,horizOriginY:H,id:null,ideographic:H,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:H,k:H,k1:H,k2:H,k3:H,k4:H,kernelMatrix:pa,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:H,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:H,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:H,overlineThickness:H,paintOrder:null,panose1:null,path:null,pathLength:H,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:U,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:H,pointsAtY:H,pointsAtZ:H,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:pa,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:pa,rev:pa,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:pa,requiredFeatures:pa,requiredFonts:pa,requiredFormats:pa,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:H,specularExponent:H,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:H,strikethroughThickness:H,string:null,stroke:null,strokeDashArray:pa,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:H,strokeOpacity:H,strokeWidth:null,style:null,surfaceScale:H,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:pa,tabIndex:H,tableValues:null,target:null,targetX:H,targetY:H,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:pa,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:H,underlineThickness:H,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:H,values:null,vAlphabetic:H,vMathematical:H,vectorEffect:null,vHanging:H,vIdeographic:H,version:null,vertAdvY:H,vertOriginX:H,vertOriginY:H,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:H,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:ba}),wa=va({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Ta=va({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:xa}),Ea=va({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Da={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Oa=/[A-Z]/g,ka=/-[a-z]/g,Aa=/^data[-\w.:]+$/i;function ja(e,t){let n=ca(t),r=t,i=z;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Aa.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(ka,Na);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!ka.test(e)){let n=e.replace(Oa,Ma);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=ga}return new i(r,t)}function Ma(e){return`-`+e.toLowerCase()}function Na(e){return e.charAt(1).toUpperCase()}const Pa=sa([ya,Sa,wa,Ta,Ea],`html`),Fa=sa([ya,Ca,wa,Ta,Ea],`svg`);function Ia(e){return e.join(` `).trim()}function La(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(Ba);t&&(n+=t.length);var i=e.lastIndexOf(qa);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(Va)}function u(e){var t;for(e||=[];t=d();)t!==!1&&e.push(t);return e}function d(){var t=a();if(Ja==e.charAt(0)&&Ya==e.charAt(1)){for(var n=2;Xa!=e.charAt(n)&&(Ya!=e.charAt(n)||Ja!=e.charAt(n+1));)++n;if(n+=2,Xa===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:Za,comment:o})}}function f(){var e=a(),t=c(Ha);if(t){if(d(),!c(Ua))return s(`property missing ':'`);var n=c(Wa),r=e({type:Qa,property:Ra(t[0].replace(za,Xa)),value:n?Ra(n[0].replace(za,Xa)):Xa});return c(Ga),r}}function p(){var e=[];u(e);for(var t;t=f();)t!==!1&&(e.push(t),u(e));return e}return l(),p()}function Ra(e){return e?e.replace(Ka,Xa):Xa}var za,Ba,Va,Ha,Ua,Wa,Ga,Ka,qa,Ja,Ya,Xa,Za,Qa,$a=Ee((()=>{za=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ba=/\n/g,Va=/^\s*/,Ha=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Ua=/^:\s*/,Wa=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Ga=/^[;\s]*/,Ka=/^\s+|\s+$/g,qa=`
279
+ ;Rr.node;const zr=L(Rr);function Br(...e){return ue(le(e))}const Vr=E(null);function Hr(){return M(Vr)}function Ur(e){return e.startsWith(`agents/`)||e.startsWith(`documents/`)}function Wr(e,t,n=`inline`){return`artifact:${e}:${t}:${n}`}function Gr(e){return`file:${e}`}const Kr=k(()=>import(`react-vega`).then(({VegaEmbed:e})=>({default:e})));function qr({error:e,chartTitle:r}){return t(`div`,{className:`flex items-center justify-center h-full bg-red-50 dark:bg-red-950 rounded-md p-4`,children:n(`div`,{className:`text-center`,children:[n(`p`,{className:`text-sm font-medium text-red-600 dark:text-red-400`,children:[`Cannot render `,r||`Vega-Lite`,` chart`]}),t(`p`,{className:`text-xs text-red-500 dark:text-red-500 mt-1 max-w-xs truncate`,children:e})]})})}function Jr(){return t(`output`,{className:`flex items-center justify-center w-full h-full`,children:t(pr,{className:`w-5 h-5 animate-spin text-gray-500 dark:text-gray-400`})})}function Yr({isOpen:e,onClose:r,title:i,description:a,children:o}){let{t:c}=S();return t(rn,{open:e,onOpenChange:e=>!e&&r(),children:n(cn,{children:[t(un,{className:`fixed inset-0 z-50 bg-black/80 backdrop-blur-sm transition-all duration-300 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`}),n(mn,{className:`fixed inset-2 sm:inset-4 z-50 flex flex-col bg-white dark:bg-gray-900 rounded-xl shadow-2xl transition-all duration-300 ease-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-98 data-[state=open]:zoom-in-98 data-[state=closed]:slide-out-to-bottom-2 data-[state=open]:slide-in-from-bottom-2`,onEscapeKeyDown:r,children:[t(Cn,{asChild:!0,children:t(s,{variant:`unstyled`,onClick:r,className:`absolute top-3 end-3 z-10 p-2 rounded-lg bg-white/80 dark:bg-gray-800/80 backdrop-blur-sm hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors duration-150 shadow-sm`,"aria-label":c(`agent.closeFullscreen`),children:t(zr,{className:`w-5 h-5 text-gray-600 dark:text-gray-300`})})}),t(`div`,{className:`flex-1 overflow-auto p-4 sm:p-6 animate-in fade-in-0 duration-500 delay-150`,children:o}),t(`div`,{className:`flex items-center justify-between px-4 sm:px-6 py-3 border-t border-gray-200 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-800/50 rounded-b-xl`,children:n(`div`,{className:`flex flex-col`,children:[t(yn,{className:`text-base font-semibold text-gray-900 dark:text-gray-100`,children:i||c(`agent.dashboard`)}),a&&t(xn,{className:`text-sm text-gray-500 dark:text-gray-400 mt-0.5`,children:a})]})})]})]})})}function Xr(e,t){if(t===`chart`)return 280;let n=1;if(e.vconcat)n=Array.isArray(e.vconcat)?e.vconcat.length:1;else if(e.concat){let t=e.columns||2,r=Array.isArray(e.concat)?e.concat.length:1;n=Math.ceil(r/t)}else e.facet&&(n=2);return Math.max(500,n*280+40)}const Zr={categorical:[`#6366f1`,`#8b5cf6`,`#ec4899`,`#f43f5e`,`#f97316`,`#eab308`,`#22c55e`,`#14b8a6`,`#06b6d4`,`#3b82f6`],blues:[`#dbeafe`,`#93c5fd`,`#3b82f6`,`#1d4ed8`,`#1e3a8a`],purples:[`#f3e8ff`,`#c4b5fd`,`#8b5cf6`,`#6d28d9`,`#4c1d95`],greens:[`#dcfce7`,`#86efac`,`#22c55e`,`#15803d`,`#14532d`],diverging:[`#ef4444`,`#fca5a5`,`#fef3c7`,`#86efac`,`#22c55e`]};function Qr(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function $r(e){return Qr(e)}function ei(e){let t=JSON.parse(JSON.stringify(e)),n=[`vconcat`,`hconcat`,`concat`];if(!n.some(e=>Array.isArray(t[e])))return t;let r=[];if(Array.isArray(t.params))for(let e of t.params)e&&typeof e==`object`&&e.name&&e.select&&r.push({name:e.name,param:e});if(r.length===0)return t;for(let{name:e,param:i}of r){let r=i.select?.fields||[],a=i.select?.bind===`legend`,o=null;for(let e of n)if(Array.isArray(t[e])){o=t[e];break}if(!o||o.length===0)continue;let s=0;for(let e=0;e<o.length;e++){let t=o[e];if(ni(t,r)||a&&ri(t,r)){s=e;break}}let c=o[s];c.params||=[],c.params.push(i),t.params=(t.params??[]).filter(t=>t.name!==e)}return Array.isArray(t.params)&&t.params.length===0&&delete t.params,t}function ti(e,t){if(!t||Object.keys(t).length===0)return e;let n=JSON.parse(JSON.stringify(e)),r=e=>{for(let n of e)n.name&&n.name in t&&(n.value=t[n.name])};Array.isArray(n.params)&&r(n.params);let i=e=>{if(Array.isArray(e)){for(let t of e)if(Array.isArray(t.params)&&r(t.params),t.vconcat&&i(t.vconcat),t.hconcat&&i(t.hconcat),t.concat&&i(t.concat),Array.isArray(t.layer))for(let e of t.layer)Array.isArray(e.params)&&r(e.params)}};if(n.vconcat&&i(n.vconcat),n.hconcat&&i(n.hconcat),n.concat&&i(n.concat),Array.isArray(n.layer))for(let e of n.layer)e&&Array.isArray(e.params)&&r(e.params);return n}function ni(e,t){if(!e?.encoding)return!1;for(let n of t)for(let t of Object.values(e.encoding))if(t.field===n)return!0;if(Array.isArray(e.layer)){for(let n of e.layer)if(ni(n,t))return!0}return!1}function ri(e,t){if(!e)return!1;let n=e=>{if(!e)return!1;let n=e.color?.field;return!!n&&t.includes(n)};if(n(e.encoding))return!0;if(Array.isArray(e.layer)){for(let t of e.layer)if(n(t.encoding))return!0}return!1}function ii(e,t=[]){let n=[];if(!e||typeof e!=`object`)return n;if(e.data&&typeof e.data==`object`){let r=e.data.url;typeof r==`string`&&r.startsWith(`artifact:`)&&n.push({path:[...t,`data`],artifactPath:r.replace(/^artifact:/,``).trim()})}for(let r of[`layer`,`vconcat`,`hconcat`,`concat`,`spec`,`repeat`,`facet`])if(r in e){let i=e[r];Array.isArray(i)?i.forEach((e,i)=>{$r(e)&&n.push(...ii(e,[...t,r,String(i)]))}):$r(i)&&n.push(...ii(i,[...t,r]))}return n}function ai(e,t){let n=JSON.parse(JSON.stringify(e));for(let[e,r]of t){let t=e.split(`.`),i=n;for(let e=0;e<t.length-1;e++){let n=i[t[e]];if(!Qr(n))break;i=n}let a=t[t.length-1],o=i[a];Qr(o)&&(delete o.url,o.values=r)}return n}function oi(e){let t={background:`transparent`,view:{stroke:`transparent`},range:{category:Zr.categorical,diverging:Zr.diverging,heatmap:Zr.purples,ramp:Zr.blues},mark:{tooltip:!0},bar:{tooltip:!0,cornerRadiusTopLeft:4,cornerRadiusTopRight:4},line:{tooltip:!0,strokeWidth:2.5,strokeCap:`round`},point:{tooltip:!0,size:60,filled:!0},area:{tooltip:!0,fillOpacity:.7,line:!0},rect:{tooltip:!0,cornerRadius:2},arc:{tooltip:!0,cornerRadius:4},circle:{tooltip:!0,size:80}};return e?{...t,axis:{labelColor:`#a1a1aa`,titleColor:`#e4e4e7`,gridColor:`#3f3f46`,domainColor:`#52525b`,tickColor:`#52525b`,labelFont:`Inter, system-ui, sans-serif`,titleFont:`Inter, system-ui, sans-serif`,labelFontSize:11,titleFontSize:12,titleFontWeight:500},legend:{labelColor:`#a1a1aa`,titleColor:`#e4e4e7`,labelFont:`Inter, system-ui, sans-serif`,titleFont:`Inter, system-ui, sans-serif`,labelFontSize:11,titleFontSize:12,symbolSize:100},title:{color:`#fafafa`,font:`Inter, system-ui, sans-serif`,fontSize:14,fontWeight:600}}:{...t,axis:{labelColor:`#71717a`,titleColor:`#3f3f46`,gridColor:`#e4e4e7`,domainColor:`#d4d4d8`,tickColor:`#d4d4d8`,labelFont:`Inter, system-ui, sans-serif`,titleFont:`Inter, system-ui, sans-serif`,labelFontSize:11,titleFontSize:12,titleFontWeight:500},legend:{labelColor:`#71717a`,titleColor:`#3f3f46`,labelFont:`Inter, system-ui, sans-serif`,titleFont:`Inter, system-ui, sans-serif`,labelFontSize:11,titleFontSize:12,symbolSize:100},title:{color:`#18181b`,font:`Inter, system-ui, sans-serif`,fontSize:14,fontWeight:600}}}const si=A(function({spec:r,artifactRunId:i}){let{t:a}=S(),{title:o,description:c,options:l}=r,u=r.spec,[d,f]=I(!1),[p,m]=I(!1),[h,g]=I(null),[_,v]=I(!1),y=F(null),b=F(null),x=F(null),{client:C}=ce(),w=Hr(),E=F(C);E.current=C;let D=F(w);D.current=w;let[O,k]=I(null),[A,M]=I(!1),[ee,te]=I(null),ne=l?.mode||`chart`,re=ne===`dashboard`,ie=l?.enableFullscreen??re,ae=l?.height||Xr(u,ne);N(()=>{let e=ii(u);if(e.length===0){k(u),M(!1),te(null);return}i?console.info(`[VegaLiteChart] resolving artifacts with runId:`,i,e.map(e=>e.artifactPath)):console.warn(`[VegaLiteChart] artifact references found but artifactRunId is missing!`,{references:e.map(e=>e.artifactPath),artifactRunId:i});let t=!1;return M(!0),te(null),(async()=>{let n=new Map,r=E.current,a=D.current;for(let o of e)try{let e=o.path.join(`.`),t;if(i&&!Ur(o.artifactPath)){let e=Wr(i,o.artifactPath,`inline`);t=a?await a.getOrFetch(e,async()=>(await r.files.getArtifactDownloadUrl(i,o.artifactPath,`inline`)).url):(await r.files.getArtifactDownloadUrl(i,o.artifactPath,`inline`)).url}else{let e=Gr(o.artifactPath);t=a?await a.getOrFetch(e,async()=>(await r.files.getDownloadUrl(o.artifactPath)).url):(await r.files.getDownloadUrl(o.artifactPath)).url}let s=await fetch(t);if(!s.ok)throw Error(`Failed to fetch artifact data: ${s.statusText}`);let c=o.artifactPath.toLowerCase().endsWith(`.csv`),l;if(c){let{default:e}=await import(`papaparse`),t=await s.text();l=e.parse(t,{header:!0,skipEmptyLines:!0,dynamicTyping:!0}).data}else{let e=await s.json();l=Array.isArray(e)?e:[e]}n.set(e,l)}catch(e){console.error(`Failed to resolve artifact: ${o.artifactPath}`,e),t||te(`Failed to load data from artifact: ${o.artifactPath}`);return}if(!t){let e=ai(u,n);k(e),M(!1)}})(),()=>{t=!0}},[u,i]);let[oe,se]=I(!1),le=F(!1);N(()=>{let e=()=>{let e=document.documentElement.classList.contains(`dark`);e!==le.current&&(le.current=e,se(e))};e();let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},[]);let[ue,de]=I(0),fe=F(0);N(()=>{if(!x.current)return;let e,t=new ResizeObserver(t=>{clearTimeout(e),e=setTimeout(()=>{let e=t[0]?.contentRect.width;e&&e!==fe.current&&(fe.current=e,de(e))},100)});t.observe(x.current);let n=x.current.clientWidth;return fe.current=n,de(n),()=>{clearTimeout(e),t.disconnect()}},[]);let pe=P(()=>ii(u).length>0,[u]),me=P(()=>{if(pe&&!O)return null;let e=O||u;return e?(l?.parameterValues&&(e=ti(e,l.parameterValues)),ei(e)):null},[O,u,pe,l?.parameterValues]),he=j((e,t)=>{if(!e||typeof e!=`object`)return e;if(e.hconcat&&Array.isArray(e.hconcat)){let n=e.hconcat.length,r=(e.spacing??10)*(n-1),i=Math.floor((t-r)/n);return{...e,hconcat:e.hconcat.map(e=>he(e,i))}}if(e.vconcat&&Array.isArray(e.vconcat))return{...e,vconcat:e.vconcat.map(e=>he(e,t))};if(e.concat&&Array.isArray(e.concat)){let n=e.columns??e.concat.length,r=(e.spacing??10)*(n-1),i=Math.floor((t-r)/n);return{...e,concat:e.concat.map(e=>he(e,i))}}let n=e.width;return n===`container`||typeof n==`number`&&n>t?{...e,width:t}:e},[]),ge=j((e,t=!1)=>{if(!me)return null;let n=oi(oe),r=t?typeof window<`u`?Math.min(window.innerWidth-80,1400):1200:ue>0?ue-24:500,i=`vconcat`in me||`hconcat`in me||`concat`in me,a=i?{type:`pad`,contains:`padding`}:{type:`fit`,contains:`padding`},s=me;i&&r&&(s=he(me,r));let c=s.width,l=i?void 0:c===`container`?r:c??r,{width:u,...d}=s;return{$schema:`https://vega.github.io/schema/vega-lite/v6.json`,...!i&&l?{width:l}:{},height:t?void 0:e,autosize:a,...i?s:d,...o&&!me.title?{title:o}:{},config:{...n,...me.config}}},[me,o,oe,ue,he]),_e=j(async()=>{let e=_?b.current:y.current;if(e&&!p)try{(await e.toCanvas(2)).toBlob(async e=>{e&&(await navigator.clipboard.write([new ClipboardItem({"image/png":e})]),m(!0),setTimeout(()=>m(!1),2e3))},`image/png`)}catch(e){console.error(`Failed to copy chart:`,e)}},[p,_]),ve=j(async()=>{let e=_?b.current:y.current;if(e&&!d){f(!0);try{let t=await e.toImageURL(`png`,2),n=document.createElement(`a`);n.download=`${o||`chart`}.png`,n.href=t,n.click()}catch(e){console.error(`Failed to export chart:`,e)}finally{f(!1)}}},[o,d,_]),ye=j(e=>{y.current=e,g(null)},[]),be=j(e=>{b.current=e},[]),xe=j(e=>{console.error(`Vega-Lite rendering error:`,e),g(e instanceof Error?e.message:`Unknown error`)},[]),Se=j(()=>{v(e=>!e)},[]);N(()=>{g(null)},[u]);let Ce=({className:e})=>n(`div`,{className:Br(`flex items-center gap-2`,e),children:[n(s,{variant:`unstyled`,onClick:_e,disabled:p,className:`text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 cursor-pointer transition-colors disabled:opacity-50 flex items-center gap-1`,title:a(`agent.copyToClipboard`),children:[t(p?Un:Yn,{className:`w-3 h-3`}),a(p?`agent.copied`:`agent.copy`)]}),n(s,{variant:`unstyled`,onClick:ve,disabled:d,className:`text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 cursor-pointer transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1`,title:a(`agent.exportAsPng`),children:[t(Zn,{className:`w-3 h-3`}),a(d?`agent.exporting`:`agent.export`)]}),ie&&n(s,{variant:`unstyled`,onClick:Se,className:`text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 cursor-pointer transition-colors flex items-center gap-1`,title:a(_?`agent.exitFullscreen`:`agent.fullscreen`),children:[t(_?xr:hr,{className:`w-3 h-3`}),a(_?`agent.exit`:`agent.fullscreen`)]})]});if(A||pe&&!O)return t(`div`,{className:`bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-gray-900 dark:text-gray-100`,children:o||`Chart`})}),t(`div`,{className:`flex items-center justify-center bg-gray-50 dark:bg-gray-800 rounded`,style:{width:`100%`,height:ae},children:n(`div`,{className:`flex items-center gap-2 text-gray-500 dark:text-gray-400`,children:[t(pr,{className:`w-5 h-5 animate-spin`}),t(`span`,{className:`text-sm`,children:`Loading data from artifacts...`})]})})]})});if(ee)return t(`div`,{className:`bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-gray-900 dark:text-gray-100`,children:o||`Chart`})}),t(`div`,{style:{width:`100%`,height:ae},children:t(qr,{error:ee,chartTitle:o})})]})});if(h)return t(`div`,{className:`bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-gray-900 dark:text-gray-100`,children:o||`Chart`})}),t(`div`,{style:{width:`100%`,height:ae},children:t(qr,{error:h,chartTitle:o})})]})});let we=ge(ae),Te=ge(0,!0);return we?(typeof window<`u`&&localStorage.getItem(`DEBUG_VEGA_RENDERS`)&&console.log(`VegaLite rendering with spec:`,{title:o,hasData:!!we.data?.values,dataLength:we.data?.values?.length}),n(e,{children:[t(`div`,{className:Br(`bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm`,re&&`border-2`),children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[n(`div`,{className:`flex items-center justify-between`,children:[n(`div`,{className:`flex items-center gap-2`,children:[t(`span`,{className:`font-medium text-sm text-gray-900 dark:text-gray-100`,children:o||(re?`Dashboard`:`Chart`)}),re&&t(`span`,{className:`text-xs px-2 py-0.5 rounded-full bg-indigo-100 dark:bg-indigo-900 text-indigo-700 dark:text-indigo-300`,children:`Interactive`})]}),t(Ce,{})]}),c&&t(`span`,{className:`text-xs text-gray-500 dark:text-gray-400`,children:c}),t(`div`,{ref:x,className:`bg-white dark:bg-gray-900 rounded overflow-hidden`,style:{width:`100%`,height:ae,minWidth:0},children:t(T,{fallback:t(Jr,{}),children:t(Kr,{spec:we,onEmbed:e=>ye(e.view),onError:xe,options:{renderer:l?.renderer||`canvas`,actions:!1}})})})]})}),n(Yr,{isOpen:_,onClose:()=>v(!1),title:o||(re?`Dashboard`:`Chart`),description:c,children:[t(`div`,{className:`w-full h-full min-h-[calc(100vh-200px)]`,children:Te&&t(T,{fallback:t(Jr,{}),children:t(Kr,{spec:Te,onEmbed:e=>be(e.view),onError:xe,options:{renderer:l?.renderer||`canvas`,actions:!1}})})}),t(`div`,{className:`absolute bottom-6 end-6`,children:t(Ce,{className:`bg-white dark:bg-gray-800 rounded-lg shadow-lg p-2 border border-gray-200 dark:border-gray-700`})})]})]})):null},(e,t)=>JSON.stringify(e.spec)===JSON.stringify(t.spec)&&e.artifactRunId===t.artifactRunId),ci={chart:{icon:Vn,label:`chart`,defaultHeight:200},mermaid:{icon:tr,label:`diagram`,defaultHeight:150},proposal:{icon:yr,label:`options`,defaultHeight:100},code:{icon:qn,label:`code`,defaultHeight:80},image:{icon:rr,label:`image`,defaultHeight:150},link:{icon:sr,label:`link`,defaultHeight:24},expand:{icon:Zn,label:`content`,defaultHeight:100},table:{icon:Fr,label:`table`,defaultHeight:150},markdown:{icon:$n,label:`content`,defaultHeight:100},"fusion-fragment":{icon:qn,label:`fragment`,defaultHeight:150}};function R({type:e,error:r,onRetry:i,message:a,height:o}){let c=ci[e],l=o??c.defaultHeight,u=e===`link`;if(r)return n(`div`,{className:`flex items-center gap-2 rounded border border-destructive/30 bg-destructive/5 text-destructive ${u?`inline-flex px-2 py-1 text-sm`:`p-4`}`,style:u?void 0:{minHeight:l},children:[n(`span`,{className:`text-destructive`,children:[`Failed to load `,c.label]}),i&&t(s,{variant:`unstyled`,onClick:i,className:`ms-2 rounded bg-destructive/10 px-2 py-1 text-xs hover:bg-destructive/20 transition-colors text-destructive`,children:`Retry`})]});let d=c.icon;return u?n(`span`,{className:`inline-flex items-center gap-1 text-muted animate-pulse`,children:[t(d,{className:`h-3 w-3`}),t(`span`,{children:a||`Loading ${c.label}...`})]}):n(`div`,{className:`flex flex-col items-center justify-center gap-3 rounded border border-border bg-muted/30 animate-pulse`,style:{minHeight:l},children:[t(d,{className:`h-8 w-8 text-muted`}),t(`span`,{className:`text-sm text-muted`,children:a||`Loading ${c.label}...`}),t(`div`,{className:`flex gap-1`,children:[...[,,,]].map((e,n)=>t(`div`,{className:`h-2 w-2 rounded-full bg-muted animate-bounce`,style:{animationDelay:`${n*150}ms`}},`dot-${n}`))})]})}var li=class extends w.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(`CodeBlock rendering error (${this.props.type}):`,e,t),this.props.onError?.(e)}handleRetry=()=>{this.setState({hasError:!1,error:void 0})};render(){if(this.state.hasError){let{type:e,fallbackCode:r}=this.props;return n(`div`,{className:`space-y-2`,children:[t(R,{type:e,error:this.state.error?.message||`Rendering failed`,onRetry:this.handleRetry}),r&&n(`details`,{className:`text-sm`,children:[t(`summary`,{className:`cursor-pointer text-muted hover:text-foreground`,children:`Show raw content`}),t(`pre`,{className:`mt-2 overflow-x-auto rounded bg-muted/50 p-2 text-xs`,children:t(`code`,{children:r})})]})]})}return this.props.children}};function ui(e,t,n){let r=t.split(`.`).pop()?.toLowerCase();if(r===`svg`)return`mockup`;if([`png`,`jpg`,`jpeg`,`gif`,`webp`].includes(r||``))return`image`;if(r===`md`)return`markdown`;if(r===`csv`)return`table`;if(n===`json`&&typeof e==`object`&&e){let t=e;if(typeof t.$schema==`string`&&t.$schema.includes(`vega`)||t.library===`vega-lite`&&`spec`in t)return`vega-lite`;if(`template`in t&&`data`in t)return`fusion-fragment`;if(Array.isArray(e)&&e.length>0&&typeof e[0]==`object`)return`table`}return`code`}function di(e){if(typeof e!=`object`||!e)return null;let t=e;return t.library===`vega-lite`&&`spec`in t&&typeof t.spec==`object`&&t.spec!==null?t:typeof t.$schema==`string`&&t.$schema.includes(`vega`)?{library:`vega-lite`,spec:t}:null}function fi({content:e}){let{headers:r,rows:i}=P(()=>{if(!Array.isArray(e)||e.length===0)return{headers:[],rows:[]};let t=e[0];if(typeof t!=`object`||!t)return{headers:[],rows:[]};let n=Object.keys(t);return{headers:n,rows:e.map(e=>n.map(t=>{let n=e[t];return n==null?``:typeof n==`object`?JSON.stringify(n):String(n)}))}},[e]);return r.length===0?t(R,{type:`table`,error:`No table data found`}):n(`div`,{className:`overflow-x-auto`,children:[n(`table`,{className:`min-w-full text-sm border-collapse`,children:[t(`thead`,{children:t(`tr`,{className:`border-b`,children:r.map(e=>t(`th`,{className:`px-3 py-2 text-start font-medium text-muted`,children:e},e))})}),t(`tbody`,{children:i.slice(0,100).map((e,n)=>t(`tr`,{className:`border-b border-muted/20`,children:e.map((e,n)=>t(`td`,{className:`px-3 py-2`,children:e},`cell-${n}`))},`row-${n}`))})]}),i.length>100&&n(`div`,{className:`text-sm text-muted py-2`,children:[`Showing 100 of `,i.length,` rows`]})]})}function pi({content:e,path:n}){let r=n.split(`.`).pop()?.toLowerCase()||``,i=typeof e==`string`?e:JSON.stringify(e,null,2);return t(`pre`,{className:`overflow-x-auto p-3 bg-muted/10 rounded text-sm`,children:t(`code`,{className:`language-${r}`,children:i})})}function mi(e){return pe.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:[`use`],FORBID_TAGS:[`foreignObject`]})}function hi(e){return e.replace(/<svg([^>]*)>/i,(e,t)=>{let n=t;if(!/viewBox/i.test(n)){let e=/\swidth\s*=\s*["']?(\d+(?:\.\d+)?)/i.exec(n),t=/\sheight\s*=\s*["']?(\d+(?:\.\d+)?)/i.exec(n);e&&t&&(n+=` viewBox="0 0 ${e[1]} ${t[1]}"`)}return n=n.replace(/\swidth\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,``).replace(/\sheight\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,``),/style="/i.test(n)?n=n.replace(/style="([^"]*)"/i,(e,t)=>`style="${t};width:100%;height:auto;display:block;max-width:100%;"`):n+=` style="width:100%;height:auto;display:block;max-width:100%;"`,/preserveAspectRatio=/i.test(n)||(n+=` preserveAspectRatio="xMidYMid meet"`),`<svg${n}>`})}function gi({content:e}){let n=P(()=>{let t=typeof e==`string`?e.trim():``;return t?hi(mi(t)):null},[e]);return n?t(`div`,{style:{margin:`16px 0`,width:`100%`,overflowX:`auto`},dangerouslySetInnerHTML:{__html:n}}):t(R,{type:`expand`,error:`Empty mockup`})}function _i({content:e,path:n}){let r=typeof e==`string`?e:``,i=n.split(`/`).pop()||`Artifact image`;return t(`img`,{src:r,alt:i,className:`max-w-full h-auto rounded`,loading:`lazy`})}function vi({content:e,renderType:n,path:r,runId:i,contentType:a}){let{MarkdownRenderer:o}=Pe();switch(P(()=>n===`auto`?ui(e,r,a):n,[e,r,a,n])){case`chart`:{let n=di(e);return n?t(li,{type:`chart`,fallbackCode:JSON.stringify(e,null,2),children:t(si,{spec:n,artifactRunId:i})}):t(R,{type:`chart`,error:`Only Vega-Lite charts are supported. Recharts rendering has been retired.`})}case`vega-lite`:{let n=di(e);return n?t(li,{type:`chart`,fallbackCode:JSON.stringify(e,null,2),children:t(si,{spec:n,artifactRunId:i})}):t(R,{type:`chart`,error:`Invalid Vega-Lite specification`})}case`fusion-fragment`:{let n=e;return console.log(`[ArtifactContentRenderer] fusion-fragment:`,{hasTemplate:!!n.template,hasData:!!n.data,runId:i,hasVegaLiteChart:!!si}),n.template&&n.data?t(li,{type:`fusion-fragment`,fallbackCode:JSON.stringify(e,null,2),children:t(fe,{data:n.data,ChartComponent:si,artifactRunId:i,children:t(de,{code:JSON.stringify(n.template),data:n.data})})}):t(li,{type:`fusion-fragment`,fallbackCode:JSON.stringify(e,null,2),children:t(de,{code:JSON.stringify(e)})})}case`table`:return t(li,{type:`table`,fallbackCode:JSON.stringify(e,null,2),children:t(fi,{content:e})});case`markdown`:{let n=typeof e==`string`?e:String(e);return t(li,{type:`markdown`,fallbackCode:n,children:o?t(o,{artifactRunId:i,children:n}):t(`pre`,{className:`overflow-x-auto p-3 bg-muted/10 rounded text-sm`,children:t(`code`,{children:n})})})}case`mockup`:return t(li,{type:`expand`,fallbackCode:typeof e==`string`?e:r,children:t(gi,{content:e})});case`image`:return t(li,{type:`image`,fallbackCode:r,children:t(_i,{content:e,path:r})});default:return t(pi,{content:e,path:r})}}const yi=`Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif`;function bi(e){let t=e.trim(),n=``,r=!1,i=!1;for(let e=0;e<t.length;e++){let a=t[e],o=e>0?t[e-1]:``;if(a===`"`&&!i&&o!==`\\`){r=!r,n+=a;continue}if(a===`'`&&!r&&o!==`\\`){i=!i,n+=a;continue}if((r||i)&&a===`\\`){let r=e;for(;t[r]===`\\`;)r++;if(t[r]===`n`){n+=`<br/>`,e=r;continue}}n+=a}return n}function xi(e){return e.replace(/<svg([^<>]*)>/i,(e,t)=>{let n=t.replace(/\swidth="[^"]*"/i,``).replace(/\sheight="[^"]*"/i,``);return/style="/i.test(n)?n=n.replace(/style="([^"]*)"/i,(e,t)=>`style="${t};width:100%;height:auto;display:block;max-width:100%;"`):n+=` style="width:100%;height:auto;display:block;max-width:100%;"`,/preserveAspectRatio=/i.test(n)||(n+=` preserveAspectRatio="xMidYMid meet"`),`<svg${n}>`})}let Si;function Ci(){return Si||=import(`mermaid`).then(({default:e})=>(e.initialize({startOnLoad:!1,theme:`default`,securityLevel:`loose`,fontFamily:yi,suppressErrorRendering:!0,flowchart:{htmlLabels:!0,useMaxWidth:!0,nodeSpacing:40,rankSpacing:50,padding:12},sequence:{useMaxWidth:!0},themeVariables:{fontFamily:yi}}),e)),Si}function wi({code:e,className:n}){let r=F(null),[i,a]=I(null),[o,s]=I(null),c=ee().replace(/:/g,`_`);return N(()=>{let t=!1;return(async()=>{if(!e.trim()){a(null),s(null);return}try{s(null);let n=`mermaid-${c}-${Date.now()}`,r=bi(e),{svg:i}=await(await Ci()).render(n,r),o=xi(i);t||a(o)}catch(e){if(!t){let t=e instanceof Error?e.message:`Failed to render mermaid diagram`;s(t),a(null)}}})(),()=>{t=!0}},[e,c]),o?null:i?t(`div`,{ref:r,className:`my-4 w-full overflow-x-auto [&_svg]:mx-auto [&_svg]:w-full [&_svg]:h-auto [&_svg]:max-w-full ${n||``}`,dangerouslySetInnerHTML:{__html:i}}):t(`div`,{className:`my-4 p-4 bg-muted rounded-lg animate-pulse ${n||``}`,children:t(`div`,{className:`h-32 bg-muted rounded`})})}function Ti(e){switch(e.split(`.`).pop()?.toLowerCase()){case`json`:return`json`;case`md`:case`txt`:case`csv`:case`yaml`:case`yml`:return`text`;case`png`:case`jpg`:case`jpeg`:case`gif`:case`webp`:case`pdf`:return`binary`;default:return`text`}}function Ei({runId:e,path:t,parseJson:n=!0}){let{client:r}=ce(),i=Hr(),a=F(r);a.current=r;let o=F(i);o.current=i;let[s,c]=I({data:void 0,rawContent:void 0,isLoading:!0,error:void 0,contentType:void 0}),l=j(async()=>{if(!e){c({data:void 0,rawContent:void 0,isLoading:!1,error:`No run ID provided`,contentType:void 0});return}if(!t){c({data:void 0,rawContent:void 0,isLoading:!1,error:`No artifact path provided`,contentType:void 0});return}c(e=>({...e,isLoading:!0,error:void 0}));let r=a.current,i=o.current,s=Ti(t);try{let a=Wr(e,t,`inline`),o;o=i?await i.getOrFetch(a,async()=>(await r.files.getArtifactDownloadUrl(e,t,`inline`)).url):(await r.files.getArtifactDownloadUrl(e,t,`inline`)).url;let l=await fetch(o);if(!l.ok)throw Error(`Failed to fetch artifact: ${l.status} ${l.statusText}`);if(s===`binary`){c({data:o,rawContent:void 0,isLoading:!1,error:void 0,contentType:s,etag:l.headers.get(`etag`)?.replace(/^"(.*)"$/,`$1`)});return}let u=await l.text(),d;if(n&&s===`json`)try{d=JSON.parse(u)}catch{d=u}else d=u;c({data:d,rawContent:u,isLoading:!1,error:void 0,contentType:s,etag:l.headers.get(`etag`)?.replace(/^"(.*)"$/,`$1`)})}catch(e){let n=e instanceof Error?e.message:`Failed to fetch artifact`;console.error(`Failed to fetch artifact content:`,t,e),c({data:void 0,rawContent:void 0,isLoading:!1,error:n,contentType:s})}},[e,t,n]);N(()=>{l()},[l]);let u=j(()=>{c({data:void 0,rawContent:void 0,isLoading:!0,error:void 0,contentType:void 0}),l()},[l]);return{data:s.data,rawContent:s.rawContent,isLoading:s.isLoading,error:s.error,contentType:s.contentType,etag:s.etag,retry:u}}function Di(e){let t=e.trim();if(t.length<2)return!0;if(!t.startsWith(`{`))return!1;try{return JSON.parse(t),!1}catch(e){let n=e instanceof Error?e.message:``,r=[`unexpected end`,`unterminated string`,`expected`,`unexpected token`],i=n.toLowerCase();if(r.some(e=>i.includes(e))){let e=0,n=0,r=!1,i=!1;for(let a of t){if(i){i=!1;continue}if(a===`\\`){i=!0;continue}if(a===`"`){r=!r;continue}r||(a===`{`?e++:a===`}`?e--:a===`[`?n++:a===`]`&&n--)}return e>0||n>0||r}return!1}}function Oi(e){try{let t=e.trim(),n=t.indexOf(`{`),r=t.lastIndexOf(`}`);return n!==-1&&r>n&&(t=t.slice(n,r+1)),JSON.parse(t)}catch{return null}}function ki(e){let t=typeof e.$schema==`string`&&e.$schema.includes(`vega`),n=e.library===`vega-lite`&&`spec`in e;return t||n?`vega-lite`:null}function Ai({code:e}){let{artifactRunId:n}=Pe();n||console.warn(`[VegaLiteCodeBlockHandler] artifactRunId is missing from CodeBlockContext`);let r=P(()=>Di(e),[e]),i=P(()=>{if(r)return null;let t=Oi(e);return t?{library:`vega-lite`,spec:t}:null},[e,r]);return r?t(R,{type:`chart`,message:`Loading chart...`}):i?t(li,{type:`chart`,fallbackCode:e,children:t(si,{spec:i,artifactRunId:n})}):t(R,{type:`chart`,error:`Invalid Vega-Lite specification`})}function ji({code:e}){let{artifactRunId:n}=Pe();n||console.warn(`[ChartCodeBlockHandler] artifactRunId is missing from CodeBlockContext`);let r=P(()=>Di(e),[e]),i=P(()=>{if(r)return null;let t=Oi(e);return!t||!ki(t)?null:t.library===`vega-lite`&&`spec`in t&&typeof t.spec==`object`?t:{library:`vega-lite`,spec:t}},[e,r]);return r?t(R,{type:`chart`,message:`Loading chart...`}):i?t(li,{type:`chart`,fallbackCode:e,children:t(si,{spec:i,artifactRunId:n})}):t(R,{type:`chart`,error:`Invalid Vega-Lite chart specification`})}function Mi({code:e}){let n=e.trim();return n?t(li,{type:`mermaid`,fallbackCode:e,children:t(wi,{code:n})}):t(R,{type:`mermaid`,error:`Empty diagram`})}function Ni({code:e}){let n=P(()=>{let t=e.trim();return t?hi(mi(t)):null},[e]);return n?t(li,{type:`code`,fallbackCode:e,children:t(`div`,{style:{margin:`16px 0`,width:`100%`,overflowX:`auto`},dangerouslySetInnerHTML:{__html:n}})}):t(R,{type:`code`,error:`Empty mockup`})}function Pi({code:e,language:n}){let{artifactRunId:r}=Pe(),i=e.trim(),a=P(()=>{if(!n?.includes(`:`))return`auto`;let e=n.split(`:`)[1];return[`chart`,`vega-lite`,`table`,`markdown`,`fusion-fragment`,`mockup`,`code`,`image`,`auto`].includes(e)?e:`auto`},[n]),{data:o,isLoading:s,error:c,contentType:l}=Ei({runId:r,path:i});return r?s?t(R,{type:`expand`,message:`Loading ${i}...`}):c?t(R,{type:`expand`,error:`Failed to load artifact: ${c}`}):o===void 0?t(R,{type:`expand`,error:`No content found in artifact`}):t(vi,{content:o,renderType:a,path:i,runId:r,contentType:l}):t(R,{type:`expand`,error:`No artifact run ID available`})}function Fi(e){return e?.startsWith(`expand`)??!1}function Ii(){return{chart:ji,"vega-lite":Ai,vegalite:Ai,mermaid:Mi,mockup:Ni,svg:Ni}}const Li=new Set([`store`,`document`,`collection`,`interaction`,`prompt`,`agent`,`workflow`,`process`,`run`]);function Ri(e){return e.trim().replace(/^\/+/,``)}function zi(e){if(e.startsWith(`artifact:`))return{scheme:`artifact`,path:e.slice(9).trim()};if(e.startsWith(`image:`))return{scheme:`image`,path:e.slice(6).trim()};let t=e.indexOf(`:`);if(t>0){let n=e.slice(0,t);if(Li.has(n))return{scheme:n,path:Ri(e.slice(t+1))}}return{scheme:`standard`,path:e}}function Bi({rawUrl:e,artifactRunId:t,disposition:n=`inline`}){let{client:r}=ce(),i=Hr(),a=F(r);a.current=r;let o=F(i);o.current=i;let{scheme:s,path:c}=zi(e),[l,u]=I(()=>{if(s===`standard`)return{url:e,isLoading:!1,error:void 0};if(i&&(s===`artifact`||s===`image`)){let e;e=s===`artifact`&&t&&!Ur(c)?Wr(t,c,n):Gr(c);let r=i.getUrl(e);if(r)return{url:r,isLoading:!1,error:void 0}}return{url:void 0,isLoading:!0,error:void 0}}),d=j(async()=>{if(s===`standard`)return;if(s!==`artifact`&&s!==`image`){u({url:void 0,isLoading:!1,error:`Unknown scheme: ${s}`});return}u(e=>({...e,isLoading:!0,error:void 0}));let e=a.current,r=o.current;try{let i;if(s===`artifact`){if(t&&!Ur(c)){let a=Wr(t,c,n);i=r?await r.getOrFetch(a,async()=>(await e.files.getArtifactDownloadUrl(t,c,n)).url):(await e.files.getArtifactDownloadUrl(t,c,n)).url}else{let t=Gr(c);i=r?await r.getOrFetch(t,async()=>(await e.files.getDownloadUrl(c)).url):(await e.files.getDownloadUrl(c)).url}}else{let t=Gr(c);i=r?await r.getOrFetch(t,async()=>(await e.files.getDownloadUrl(c)).url):(await e.files.getDownloadUrl(c)).url}u({url:i,isLoading:!1,error:void 0})}catch(e){let t=e instanceof Error?e.message:`Failed to resolve URL`;console.error(`Failed to resolve URL:`,c,e),u({url:void 0,isLoading:!1,error:t})}},[s,c,t,n]);N(()=>{if(l.url&&!l.error)return;let e=!1;return e||(async()=>{await d()})(),()=>{e=!0}},[d,l.url,l.error]);let f=j(()=>{u({url:void 0,isLoading:!0,error:void 0}),d()},[d]);return{url:l.url,isLoading:l.isLoading,error:l.error,scheme:s,retry:f}}function Vi({src:e,alt:r,caption:i,className:a,artifactRunId:o}){let s=e||``,{scheme:c}=zi(s);return c===`standard`?n(`figure`,{className:`my-4`,children:[t(`img`,{src:e,alt:r,className:a}),t(`figcaption`,{className:`mt-2 text-sm text-muted text-center italic`,children:i})]}):t(Hi,{rawSrc:s,alt:r,caption:i,artifactRunId:o,className:a})}function Hi({rawSrc:e,alt:r,caption:i,artifactRunId:a,className:o}){let{url:s,isLoading:c,error:l,retry:u}=Bi({rawUrl:e,artifactRunId:a,disposition:`inline`});return c?t(R,{type:`image`,message:r?`Loading ${r}...`:void 0}):l?t(R,{type:`image`,error:l,onRetry:u}):s?n(`figure`,{className:`my-4`,children:[t(`img`,{src:s,alt:r,className:o}),t(`figcaption`,{className:`mt-2 text-sm text-muted text-center italic`,children:i})]}):null}function Ui({node:e,src:n,alt:r,className:i,artifactRunId:a,ExistingImg:o,...s}){let c=n||``,{scheme:l}=zi(c);return l===`standard`?typeof o==`function`?t(o,{node:e,src:n,alt:r,...s}):t(`img`,{src:n,alt:r,className:i,...s}):t(Wi,{rawSrc:c,alt:r,artifactRunId:a,className:i,rest:s})}function Wi({rawSrc:e,alt:n,artifactRunId:r,className:i,rest:a}){let{url:o,isLoading:s,error:c,retry:l}=Bi({rawUrl:e,artifactRunId:r,disposition:`inline`});return s?t(R,{type:`image`,message:n?`Loading ${n}...`:void 0}):c?t(R,{type:`image`,error:c,onRetry:l}):o?t(`img`,{src:o,alt:n,className:i,...a}):null}const Gi=E(()=>({kind:`none`}));Gi.Provider;function Ki(){return M(Gi)}const qi={store:`document`,document:`document`,collection:`collection`,interaction:`interaction`,prompt:`prompt`,agent:`agent`,workflow:`workflow`,process:`process`,run:`interaction_run`};function Ji(e){let t=e.indexOf(`:`);if(t<=0)return;let n=e.slice(0,t);if(!Object.hasOwn(qi,n))return;let r=e.slice(t+1).trim().replace(/^\/+/,``);if(r)return{type:qi[n],id:r}}function Yi({node:e,href:n,children:r,className:i,artifactRunId:a,onArtifactOpen:o,ExistingLink:s,...c}){let l=n||``,u=Ji(l);if(u)return t(Xi,{resource:u,rawHref:l,artifactRunId:a,className:i,ExistingLink:s,rest:c,children:r});let{scheme:d,path:f}=zi(l);return d===`standard`?typeof s==`function`?t(s,{node:e,href:n,className:i,...c,children:r}):t(`a`,{href:n,...c,className:i,target:`_blank`,rel:`noopener noreferrer`,children:r}):t(Zi,{rawHref:l,artifactRunId:a,artifactPath:d===`artifact`?f:void 0,onArtifactOpen:o,className:i,rest:c,children:r})}function Xi({resource:e,rawHref:n,artifactRunId:r,className:i,children:a,ExistingLink:o,rest:c}){let l=Ki()(e,{workflowRunId:r,source:`markdown`,rawHref:n});return l.kind===`navigate`?typeof o==`function`?t(o,{href:l.href,className:i,...c,children:a}):t(`a`,{href:l.href,...c,className:i,target:`_blank`,rel:`noopener noreferrer`,children:a}):l.kind===`activate`?t(s,{variant:`link`,size:`none`,className:i,onClick:l.onActivate,children:a}):t(`span`,{className:i,children:a})}function Zi({rawHref:e,artifactRunId:n,artifactPath:r,onArtifactOpen:i,className:a,children:o,rest:s}){let{url:c,isLoading:l,error:u,retry:d}=Bi({rawUrl:e,artifactRunId:n,disposition:`attachment`});return l?t(`span`,{className:`inline-flex items-center gap-1 text-muted`,children:t(R,{type:`link`})}):u?t(`span`,{className:`inline-flex items-center gap-1`,children:t(R,{type:`link`,error:u,onRetry:d})}):t(`a`,{href:c||`#`,...s,className:a,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>{r&&/\.md$/i.test(r)&&i&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&e.button===0&&(e.preventDefault(),i(r))},children:o})}function Qi(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}const $i=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ea=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ta={};function na(e,t){return((t||ta).jsx?ea:$i).test(e)}const ra=/[ \t\n\f\r]/g;function ia(e){return typeof e==`object`?e.type===`text`&&aa(e.value):aa(e)}function aa(e){return e.replace(ra,``)===``}var oa=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};oa.prototype.normal={},oa.prototype.property={},oa.prototype.space=void 0;function sa(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new oa(n,r,t)}function ca(e){return e.toLowerCase()}var z=class{constructor(e,t){this.attribute=t,this.property=e}};z.prototype.attribute=``,z.prototype.booleanish=!1,z.prototype.boolean=!1,z.prototype.commaOrSpaceSeparated=!1,z.prototype.commaSeparated=!1,z.prototype.defined=!1,z.prototype.mustUseProperty=!1,z.prototype.number=!1,z.prototype.overloadedBoolean=!1,z.prototype.property=``,z.prototype.spaceSeparated=!1,z.prototype.space=void 0;var la=Oe({boolean:()=>B,booleanish:()=>V,commaOrSpaceSeparated:()=>pa,commaSeparated:()=>fa,number:()=>H,overloadedBoolean:()=>da,spaceSeparated:()=>U});let ua=0;const B=ma(),V=ma(),da=ma(),H=ma(),U=ma(),fa=ma(),pa=ma();function ma(){return 2**++ua}const ha=Object.keys(la);var ga=class extends z{constructor(e,t,n,r){let i=-1;if(super(e,t),_a(this,`space`,r),typeof n==`number`)for(;++i<ha.length;){let e=ha[i];_a(this,ha[i],(n&la[e])===la[e])}}};ga.prototype.defined=!0;function _a(e,t,n){n&&(e[t]=n)}function va(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new ga(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[ca(r)]=r,n[ca(a.attribute)]=r}return new oa(t,n,e.space)}const ya=va({properties:{ariaActiveDescendant:null,ariaAtomic:V,ariaAutoComplete:null,ariaBusy:V,ariaChecked:V,ariaColCount:H,ariaColIndex:H,ariaColSpan:H,ariaControls:U,ariaCurrent:null,ariaDescribedBy:U,ariaDetails:null,ariaDisabled:V,ariaDropEffect:U,ariaErrorMessage:null,ariaExpanded:V,ariaFlowTo:U,ariaGrabbed:V,ariaHasPopup:null,ariaHidden:V,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:U,ariaLevel:H,ariaLive:null,ariaModal:V,ariaMultiLine:V,ariaMultiSelectable:V,ariaOrientation:null,ariaOwns:U,ariaPlaceholder:null,ariaPosInSet:H,ariaPressed:V,ariaReadOnly:V,ariaRelevant:null,ariaRequired:V,ariaRoleDescription:U,ariaRowCount:H,ariaRowIndex:H,ariaRowSpan:H,ariaSelected:V,ariaSetSize:H,ariaSort:null,ariaValueMax:H,ariaValueMin:H,ariaValueNow:H,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function ba(e,t){return t in e?e[t]:t}function xa(e,t){return ba(e,t.toLowerCase())}const Sa=va({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:fa,acceptCharset:U,accessKey:U,action:null,allow:null,allowFullScreen:B,allowPaymentRequest:B,allowUserMedia:B,alpha:B,alt:null,as:null,async:B,autoCapitalize:null,autoComplete:U,autoFocus:B,autoPlay:B,blocking:U,capture:null,charSet:null,checked:B,cite:null,className:U,closedBy:null,colorSpace:null,cols:H,colSpan:H,command:null,commandFor:null,content:null,contentEditable:V,controls:B,controlsList:U,coords:H|fa,crossOrigin:null,data:null,dateTime:null,decoding:null,default:B,defer:B,dir:null,dirName:null,disabled:B,download:da,draggable:V,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:B,formTarget:null,headers:U,height:H,hidden:da,high:H,href:null,hrefLang:null,htmlFor:U,httpEquiv:U,id:null,imageSizes:null,imageSrcSet:null,inert:B,inputMode:null,integrity:null,is:null,isMap:B,itemId:null,itemProp:U,itemRef:U,itemScope:B,itemType:U,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:B,low:H,manifest:null,max:null,maxLength:H,media:null,method:null,min:null,minLength:H,multiple:B,muted:B,name:null,nonce:null,noModule:B,noValidate:B,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:B,optimum:H,pattern:null,ping:U,placeholder:null,playsInline:B,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:B,referrerPolicy:null,rel:U,required:B,reversed:B,rows:H,rowSpan:H,sandbox:U,scope:null,scoped:B,seamless:B,selected:B,shadowRootClonable:B,shadowRootCustomElementRegistry:B,shadowRootDelegatesFocus:B,shadowRootMode:null,shadowRootSerializable:B,shape:null,size:H,sizes:null,slot:null,span:H,spellCheck:V,src:null,srcDoc:null,srcLang:null,srcSet:null,start:H,step:null,style:null,tabIndex:H,target:null,title:null,translate:null,type:null,typeMustMatch:B,useMap:null,value:V,width:H,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:U,axis:null,background:null,bgColor:null,border:H,borderColor:null,bottomMargin:H,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:B,declare:B,event:null,face:null,frame:null,frameBorder:null,hSpace:H,leftMargin:H,link:null,longDesc:null,lowSrc:null,marginHeight:H,marginWidth:H,noResize:B,noHref:B,noShade:B,noWrap:B,object:null,profile:null,prompt:null,rev:null,rightMargin:H,rules:null,scheme:null,scrolling:V,standby:null,summary:null,text:null,topMargin:H,valueType:null,version:null,vAlign:null,vLink:null,vSpace:H,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:B,disablePictureInPicture:B,disableRemotePlayback:B,exportParts:fa,part:U,prefix:null,property:null,results:H,security:null,unselectable:null},space:`html`,transform:xa}),Ca=va({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:pa,accentHeight:H,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:H,amplitude:H,arabicForm:null,ascent:H,attributeName:null,attributeType:null,azimuth:H,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:H,by:null,calcMode:null,capHeight:H,className:U,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:H,diffuseConstant:H,direction:null,display:null,dur:null,divisor:H,dominantBaseline:null,download:B,dx:null,dy:null,edgeMode:null,editable:null,elevation:H,enableBackground:null,end:null,event:null,exponent:H,externalResourcesRequired:null,fill:null,fillOpacity:H,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:fa,g2:fa,glyphName:fa,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:H,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:H,horizOriginX:H,horizOriginY:H,id:null,ideographic:H,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:H,k:H,k1:H,k2:H,k3:H,k4:H,kernelMatrix:pa,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:H,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:H,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:H,overlineThickness:H,paintOrder:null,panose1:null,path:null,pathLength:H,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:U,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:H,pointsAtY:H,pointsAtZ:H,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:pa,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:pa,rev:pa,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:pa,requiredFeatures:pa,requiredFonts:pa,requiredFormats:pa,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:H,specularExponent:H,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:H,strikethroughThickness:H,string:null,stroke:null,strokeDashArray:pa,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:H,strokeOpacity:H,strokeWidth:null,style:null,surfaceScale:H,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:pa,tabIndex:H,tableValues:null,target:null,targetX:H,targetY:H,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:pa,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:H,underlineThickness:H,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:H,values:null,vAlphabetic:H,vMathematical:H,vectorEffect:null,vHanging:H,vIdeographic:H,version:null,vertAdvY:H,vertOriginX:H,vertOriginY:H,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:H,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:ba}),wa=va({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Ta=va({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:xa}),Ea=va({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Da={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Oa=/[A-Z]/g,ka=/-[a-z]/g,Aa=/^data[-\w.:]+$/i;function ja(e,t){let n=ca(t),r=t,i=z;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Aa.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(ka,Na);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!ka.test(e)){let n=e.replace(Oa,Ma);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=ga}return new i(r,t)}function Ma(e){return`-`+e.toLowerCase()}function Na(e){return e.charAt(1).toUpperCase()}const Pa=sa([ya,Sa,wa,Ta,Ea],`html`),Fa=sa([ya,Ca,wa,Ta,Ea],`svg`);function Ia(e){return e.join(` `).trim()}function La(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(Ba);t&&(n+=t.length);var i=e.lastIndexOf(qa);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(Va)}function u(e){var t;for(e||=[];t=d();)t!==!1&&e.push(t);return e}function d(){var t=a();if(Ja==e.charAt(0)&&Ya==e.charAt(1)){for(var n=2;Xa!=e.charAt(n)&&(Ya!=e.charAt(n)||Ja!=e.charAt(n+1));)++n;if(n+=2,Xa===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:Za,comment:o})}}function f(){var e=a(),t=c(Ha);if(t){if(d(),!c(Ua))return s(`property missing ':'`);var n=c(Wa),r=e({type:Qa,property:Ra(t[0].replace(za,Xa)),value:n?Ra(n[0].replace(za,Xa)):Xa});return c(Ga),r}}function p(){var e=[];u(e);for(var t;t=f();)t!==!1&&(e.push(t),u(e));return e}return l(),p()}function Ra(e){return e?e.replace(Ka,Xa):Xa}var za,Ba,Va,Ha,Ua,Wa,Ga,Ka,qa,Ja,Ya,Xa,Za,Qa,$a=Ee((()=>{za=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ba=/\n/g,Va=/^\s*/,Ha=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Ua=/^:\s*/,Wa=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Ga=/^[;\s]*/,Ka=/^\s+|\s+$/g,qa=`
280
280
  `,Ja=`/`,Ya=`*`,Xa=``,Za=`comment`,Qa=`declaration`})),eo=Oe({default:()=>to});function to(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=La(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n||={},n[r]=a)}),n}var no=Ee((()=>{$a()})),ro=De((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),io=De(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})((no(),je(eo))),r=ro();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i}));const ao=so(`end`),oo=so(`start`);function so(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function co(e){let t=oo(e),n=ao(e);if(t&&n)return{start:t,end:n}}function lo(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?fo(e.position):`start`in e||`end`in e?fo(e):`line`in e||`column`in e?uo(e):``}function uo(e){return po(e&&e.line)+`:`+po(e&&e.column)}function fo(e){return uo(e&&e.start)+`-`+uo(e&&e.end)}function po(e){return e&&typeof e==`number`?e:1}var W=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=lo(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};W.prototype.file=``,W.prototype.name=``,W.prototype.reason=``,W.prototype.message=``,W.prototype.stack=``,W.prototype.column=void 0,W.prototype.line=void 0,W.prototype.ancestors=void 0,W.prototype.cause=void 0,W.prototype.fatal=void 0,W.prototype.place=void 0,W.prototype.ruleId=void 0,W.prototype.source=void 0;var mo=Ae(io(),1);const ho={}.hasOwnProperty,go=new Map,_o=/[A-Z]/g,vo=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),yo=new Set([`td`,`th`]),bo=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function xo(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=Mo(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=jo(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Fa:Pa,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=So(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function So(e,t,n){if(t.type===`element`)return Co(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return wo(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Eo(e,t,n);if(t.type===`mdxjsEsm`)return To(e,t);if(t.type===`root`)return Do(e,t,n);if(t.type===`text`)return Oo(e,t)}function Co(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Fa,e.schema=i),e.ancestors.push(t);let a=Ro(e,t.tagName,!1),o=No(e,t),s=Fo(e,t);return vo.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!ia(e)})),ko(e,o,a,t),Ao(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function wo(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}zo(e,t.position)}function To(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);zo(e,t.position)}function Eo(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Fa,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Ro(e,t.name,!0),o=Po(e,t),s=Fo(e,t);return ko(e,o,a,t),Ao(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Do(e,t,n){let r={};return Ao(r,Fo(e,t)),e.create(t,e.Fragment,r,n)}function Oo(e,t){return t.value}function ko(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ao(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function jo(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function Mo(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=oo(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function No(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&ho.call(t.properties,i)){let a=Io(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&yo.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Po(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else zo(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else zo(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Fo(e,t){let n=[],r=-1,i=e.passKeys?new Map:go;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=So(e,a,o);s!==void 0&&n.push(s)}return n}function Io(e,t,n){let r=ja(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Qi(n):Ia(n)),r.property===`style`){let t=typeof n==`object`?n:Lo(e,String(n));return e.stylePropertyNameCase===`css`&&(t=Bo(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Da[r.property]||r.property:r.attribute,n]}}function Lo(e,t){try{return(0,mo.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new W("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=bo+`#cannot-parse-style-attribute`,r}}function Ro(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=na(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=na(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return ho.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);zo(e)}function zo(e,t){let n=new W("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=bo+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function Bo(e){let t={},n;for(n in e)ho.call(e,n)&&(t[Vo(n)]=e[n]);return t}function Vo(e){let t=e.replace(_o,Ho);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Ho(e){return`-`+e.toLowerCase()}const Uo={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},Wo={};function Go(e,t){let n=t||Wo;return Ko(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function Ko(e,t,n){if(Jo(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return qo(e.children,t,n)}return Array.isArray(e)?qo(e,t,n):``}function qo(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Ko(e[i],t,n);return r.join(``)}function Jo(e){return!!(e&&typeof e==`object`)}const Yo=document.createElement(`i`);function Xo(e){let t=`&`+e+`;`;Yo.innerHTML=t;let n=Yo.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function G(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Zo(e,t){return e.length>0?(G(e,e.length,0,t),e):t}const Qo={}.hasOwnProperty;function $o(e){let t={},n=-1;for(;++n<e.length;)es(t,e[n]);return t}function es(e,t){let n;for(n in t){let r=(Qo.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Qo.call(r,a)||(r[a]=[]);let e=i[a];ts(r[a],Array.isArray(e)?e:e?[e]:[])}}}function ts(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);G(e,0,0,r)}function ns(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function rs(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}const K=ds(/[A-Za-z]/),q=ds(/[\dA-Za-z]/),is=ds(/[#-'*+\--9=?A-Z^-~]/);function as(e){return e!==null&&(e<32||e===127)}const os=ds(/\d/),ss=ds(/[\dA-Fa-f]/),cs=ds(/[!-/:-@[-`{-~]/);function J(e){return e!==null&&e<-2}function Y(e){return e!==null&&(e<0||e===32)}function X(e){return e===-2||e===-1||e===32}const ls=ds(/\p{P}|\p{S}/u),us=ds(/\s/);function ds(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function fs(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&q(e.charCodeAt(n+1))&&q(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Z(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return X(r)?(e.enter(n),s(r)):t(r)}function s(r){return X(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}const ps={tokenize:ms};function ms(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Z(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return J(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}const hs={tokenize:_s},gs={tokenize:vs};function _s(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return G(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(gs,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(gs,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return J(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;G(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function vs(e,t,n){return Z(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function ys(e){if(e===null||Y(e)||us(e))return 1;if(ls(e))return 2}function bs(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const xs={name:`attention`,resolveAll:Ss,tokenize:Cs};function Ss(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};ws(d,-c),ws(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Zo(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=Zo(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=Zo(l,bs(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Zo(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=Zo(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,G(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Cs(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ys(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=ys(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function ws(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Ts={name:`autolink`,tokenize:Es};function Es(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return K(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||q(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||q(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||as(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):is(t)?(e.consume(t),l):n(t)}function u(e){return q(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||q(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}const Ds={partial:!0,tokenize:Os};function Os(e,t,n){return r;function r(t){return X(t)?Z(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||J(e)?t(e):n(e)}}const ks={continuation:{tokenize:js},exit:Ms,name:`blockQuote`,tokenize:As};function As(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return X(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function js(e,t,n){let r=this;return i;function i(t){return X(t)?Z(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(ks,t,n)(r)}}function Ms(e){e.exit(`blockQuote`)}const Ns={name:`characterEscape`,tokenize:Ps};function Ps(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return cs(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}const Fs={name:`characterReference`,tokenize:Is};function Is(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=q,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=ss,u):(e.enter(`characterReferenceValue`),a=7,o=os,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===q&&!Xo(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}const Ls={partial:!0,tokenize:Bs},Rs={concrete:!0,name:`codeFenced`,tokenize:zs};function zs(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),X(t)?Z(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||J(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Ls,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||J(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):X(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Z(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||J(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||J(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&X(t)?Z(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||J(t)?e.check(Ls,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||J(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),X(t)?Z(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),X(t)?Z(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||J(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Bs(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const Vs={name:`codeIndented`,tokenize:Us},Hs={partial:!0,tokenize:Ws};function Us(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Z(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):J(t)?e.attempt(Hs,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||J(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Ws(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):J(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Z(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):J(e)?i(e):n(e)}}const Gs={name:`codeText`,previous:qs,resolve:Ks,tokenize:Js};function Ks(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function qs(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Js(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):J(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||J(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Ys=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Xs(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Xs(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Xs(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);Xs(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Xs(this.left,t.reverse())}}}};function Xs(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Zs(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Ys(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Qs(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return G(e,0,1/0,u.slice(0)),!l}function Qs(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}const $s={resolve:tc,tokenize:nc},ec={partial:!0,tokenize:rc};function tc(e){return Zs(e),e}function nc(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):J(t)?e.check(ec,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function rc(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Z(e,a,`linePrefix`)}function a(i){if(i===null||J(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function ic(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||as(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||J(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||Y(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||as(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function ac(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):J(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||J(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!X(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function oc(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):J(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Z(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||J(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function sc(e,t){let n;return r;function r(i){return J(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):X(i)?Z(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}const cc={name:`definition`,tokenize:uc},lc={partial:!0,tokenize:dc};function uc(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return ac.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=rs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return Y(t)?sc(e,l)(t):l(t)}function l(t){return ic(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(lc,d,d)(t)}function d(t){return X(t)?Z(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||J(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function dc(e,t,n){return r;function r(t){return Y(t)?sc(e,i)(t):n(t)}function i(t){return oc(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return X(t)?Z(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||J(e)?t(e):n(e)}}const fc={name:`hardBreakEscape`,tokenize:pc};function pc(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return J(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}const mc={name:`headingAtx`,resolve:hc,tokenize:gc};function hc(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},G(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function gc(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||Y(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||J(n)?(e.exit(`atxHeading`),t(n)):X(n)?Z(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||Y(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}const _c=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),vc=[`pre`,`script`,`style`,`textarea`],yc={concrete:!0,name:`htmlFlow`,resolveTo:Sc,tokenize:Cc},bc={partial:!0,tokenize:Tc},xc={partial:!0,tokenize:wc};function Sc(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Cc(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:F):K(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):K(a)?(e.consume(a),i=4,r.interrupt?t:F):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:F):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return K(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Y(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&vc.includes(l)?(i=1,r.interrupt?t(s):O(s)):_c.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||q(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return X(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||K(t)?(e.consume(t),b):X(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||q(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):X(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):X(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||J(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||Y(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||X(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||J(t)?O(t):X(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),I):t===63&&i===3?(e.consume(t),F):t===93&&i===5?(e.consume(t),P):J(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(bc,te,k)(t)):t===null||J(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(xc,A,te)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||J(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),F):O(t)}function N(t){return t===47?(e.consume(t),o=``,ee):O(t)}function ee(t){if(t===62){let n=o.toLowerCase();return vc.includes(n)?(e.consume(t),I):O(t)}return K(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ee):O(t)}function P(t){return t===93?(e.consume(t),F):O(t)}function F(t){return t===62?(e.consume(t),I):t===45&&i===2?(e.consume(t),F):O(t)}function I(t){return t===null||J(t)?(e.exit(`htmlFlowData`),te(t)):(e.consume(t),I)}function te(n){return e.exit(`htmlFlow`),t(n)}}function wc(e,t,n){let r=this;return i;function i(t){return J(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Tc(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Ds,t,n)}}const Ec={name:`htmlText`,tokenize:Dc};function Dc(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):K(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):K(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):J(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):J(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):J(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):J(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return K(t)?(e.consume(t),S):n(t)}function S(t){return t===45||q(t)?(e.consume(t),S):C(t)}function C(t){return J(t)?(o=C,N(t)):X(t)?(e.consume(t),C):M(t)}function w(t){return t===45||q(t)?(e.consume(t),w):t===47||t===62||Y(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||K(t)?(e.consume(t),E):J(t)?(o=T,N(t)):X(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||q(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):J(t)?(o=D,N(t)):X(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):J(t)?(o=O,N(t)):X(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):J(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||Y(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||Y(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return X(t)?Z(e,P,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):P(t)}function P(t){return e.enter(`htmlTextData`),o(t)}}const Oc={name:`labelEnd`,resolveAll:Mc,resolveTo:Nc,tokenize:Pc},kc={tokenize:Fc},Ac={tokenize:Ic},jc={tokenize:Lc};function Mc(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&G(e,0,e.length,n),e}function Nc(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=Zo(s,e.slice(a+1,a+r+3)),s=Zo(s,[[`enter`,u,t]]),s=Zo(s,bs(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=Zo(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=Zo(s,e.slice(o+1)),s=Zo(s,[[`exit`,c,t]]),G(e,a,e.length,s),e}function Pc(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(rs(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(kc,u,o?u:d)(t):t===91?e.attempt(Ac,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(jc,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Fc(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return Y(t)?sc(e,a)(t):a(t)}function a(t){return t===41?u(t):ic(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Y(t)?sc(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?oc(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Y(t)?sc(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Ic(e,t,n){let r=this;return i;function i(t){return ac.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(rs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Lc(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}const Rc={name:`labelStartImage`,resolveAll:Oc.resolveAll,tokenize:zc};function zc(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const Bc={name:`labelStartLink`,resolveAll:Oc.resolveAll,tokenize:Vc};function Vc(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const Hc={name:`lineEnding`,tokenize:Uc};function Uc(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Z(e,t,`linePrefix`)}}const Wc={name:`thematicBreak`,tokenize:Gc};function Gc(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||J(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),X(t)?Z(e,s,`whitespace`)(t):s(t))}}const Kc={continuation:{tokenize:Xc},exit:Qc,name:`list`,tokenize:Yc},qc={partial:!0,tokenize:$c},Jc={partial:!0,tokenize:Zc};function Yc(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:os(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Wc,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return os(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Ds,r.interrupt?n:u,e.attempt(qc,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return X(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Xc(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Ds,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Z(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!X(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Jc,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Z(e,e.attempt(Kc,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Zc(e,t,n){let r=this;return Z(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Qc(e){e.exit(this.containerState.type)}function $c(e,t,n){let r=this;return Z(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!X(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}const el={name:`setextUnderline`,resolveTo:tl,tokenize:nl};function tl(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function nl(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),X(t)?Z(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||J(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}const rl={tokenize:il};function il(e){let t=this,n=e.attempt(Ds,r,e.attempt(this.parser.constructs.flowInitial,i,Z(e,e.attempt(this.parser.constructs.flow,i,e.attempt($s,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}const al={resolveAll:ll()},ol=cl(`string`),sl=cl(`text`);function cl(e){return{resolveAll:ll(e===`text`?ul:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function ll(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function ul(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var dl=Oe({attentionMarkers:()=>yl,contentInitial:()=>pl,disable:()=>bl,document:()=>fl,flow:()=>hl,flowInitial:()=>ml,insideSpan:()=>vl,string:()=>gl,text:()=>_l});const fl={42:Kc,43:Kc,45:Kc,48:Kc,49:Kc,50:Kc,51:Kc,52:Kc,53:Kc,54:Kc,55:Kc,56:Kc,57:Kc,62:ks},pl={91:cc},ml={[-2]:Vs,[-1]:Vs,32:Vs},hl={35:mc,42:Wc,45:[el,Wc],60:yc,61:el,95:Wc,96:Rs,126:Rs},gl={38:Fs,92:Ns},_l={[-5]:Hc,[-4]:Hc,[-3]:Hc,33:Rc,38:Fs,42:xs,60:[Ts,Ec],91:Bc,92:[fc,Ns],93:Oc,95:xs,96:Gs},vl={null:[xs,al]},yl={null:[42,95]},bl={null:[]};function xl(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=Zo(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=bs(a,l.events,l),l.events):[]}function f(e,t){return Cl(p(e),t)}function p(e){return Sl(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){J(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&G(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Sl(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Cl(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
281
281
  `;break;case-3:o=`\r
282
282
  `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function wl(e){let t={constructs:$o([dl,...(e||{}).extensions||[]]),content:n(ps),defined:[],document:n(hs),flow:n(rl),lazy:{},string:n(ol),text:n(sl)};return t;function n(e){return n;function n(n){return xl(t,e,n)}}}function Tl(e){for(;!Zs(e););return e}const El=/[\0\t\n\r]/g;function Dl(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(El.lastIndex=u,c=El.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}const Ol=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function kl(e){return e.replace(Ol,Al)}function Al(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return ns(n.slice(t?2:1),t?16:10)}return Xo(n)||e}const jl={}.hasOwnProperty;function Ml(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),Nl(n)(Tl(wl(n).document().write(Dl()(e,t,!0))))}function Nl(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(ve),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(me),blockQuote:a(le),characterEscape:T,characterReference:T,codeFenced:a(ue),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ue,o),codeText:a(de,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(fe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(pe),hardBreakEscape:a(he),hardBreakTrailing:a(he),htmlFlow:a(ge,o),htmlFlowData:T,htmlText:a(ge,o),htmlTextData:T,image:a(_e),label:o,link:a(ve),listItem:a(be),listItemValue:f,listOrdered:a(ye,d),listUnordered:a(ye),paragraph:a(xe),reference:ne,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(me),strong:a(Se),thematicBreak:a(we)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ce,autolinkProtocol:se,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ie,characterReferenceMarkerNumeric:ie,characterReferenceValue:ae,characterReference:oe,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:P,labelText:ee,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:re,resourceDestinationString:F,resourceTitleString:I,resource:te,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};Fl(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];jl.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Ll).call(a,void 0,e[0])}for(r.position={start:Pl(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Pl(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:Pl(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Ll).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+lo({start:e.start,end:e.end})+`): it’s not open`);n.position.end=Pl(e.end)}function u(){return Go(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=rs(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Ce(),n.position={start:Pl(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Pl(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=Pl(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ee(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=kl(t),n.identifier=rs(t).toLowerCase()}function P(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function F(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function te(){this.data.inReference=void 0}function ne(){this.data.referenceType=`collapsed`}function re(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=rs(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ie(e){this.data.characterReferenceType=e.type}function ae(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=ns(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=Xo(t);let i=this.stack[this.stack.length-1];i.value+=r}function oe(e){let t=this.stack.pop();t.position.end=Pl(e.end)}function se(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ce(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function le(){return{type:`blockquote`,children:[]}}function ue(){return{type:`code`,lang:null,meta:null,value:``}}function de(){return{type:`inlineCode`,value:``}}function fe(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function pe(){return{type:`emphasis`,children:[]}}function me(){return{type:`heading`,depth:0,children:[]}}function he(){return{type:`break`}}function ge(){return{type:`html`,value:``}}function _e(){return{type:`image`,title:null,url:``,alt:null}}function ve(){return{type:`link`,title:null,url:``,children:[]}}function ye(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function be(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function xe(){return{type:`paragraph`,children:[]}}function Se(){return{type:`strong`,children:[]}}function Ce(){return{type:`text`,value:``}}function we(){return{type:`thematicBreak`}}}function Pl(e){return{line:e.line,column:e.column,offset:e.offset}}function Fl(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Fl(e,r):Il(e,r)}}function Il(e,t){let n;for(n in t)if(jl.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function Ll(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+lo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+lo({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+lo({start:t.start,end:t.end})+`) is still open`)}function Rl(e){let t=this;t.parser=n;function n(n){return Ml(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function zl(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Bl(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
@@ -324,5 +324,5 @@ const Rn={name:`bold`,size:24,node:[[`path`,{d:`M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0
324
324
  `)),c+=a.move(o),s(),c}function r(e,n,r){let i=e.value||``,a=1;for(t||a++;RegExp(`(^|[^$])`+`\\$`.repeat(a)+`([^$]|$)`).test(i);)a++;let o=`$`.repeat(a);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` `+i+` `);let s=-1;for(;++s<r.unsafe.length;){let e=r.unsafe[s];if(!e.atBreak)continue;let t=r.compilePattern(e),n;for(;n=t.exec(i);){let e=n.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=i.slice(0,e)+` `+i.slice(n.index+1)}}return o+i+o}function i(){return`$`}}const qg={tokenize:Yg,concrete:!0,name:`mathFlow`},Jg={tokenize:Xg,partial:!0};function Yg(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){return e.enter(`mathFlow`),e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),c(t)}function c(t){return t===36?(e.consume(t),o++,c):o<2?n(t):(e.exit(`mathFlowFenceSequence`),Z(e,l,`whitespace`)(t))}function l(t){return t===null||J(t)?d(t):(e.enter(`mathFlowFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===null||J(t)?(e.exit(`chunkString`),e.exit(`mathFlowFenceMeta`),d(t)):t===36?n(t):(e.consume(t),u)}function d(n){return e.exit(`mathFlowFence`),r.interrupt?t(n):e.attempt(Jg,f,g)(n)}function f(t){return e.attempt({tokenize:_,partial:!0},g,p)(t)}function p(t){return(a?Z(e,m,`linePrefix`,a+1):m)(t)}function m(t){return t===null?g(t):J(t)?e.attempt(Jg,f,g)(t):(e.enter(`mathFlowValue`),h(t))}function h(t){return t===null||J(t)?(e.exit(`mathFlowValue`),m(t)):(e.consume(t),h)}function g(n){return e.exit(`mathFlow`),t(n)}function _(e,t,n){let i=0;return Z(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),s(t)}function s(t){return t===36?(i++,e.consume(t),s):i<o?n(t):(e.exit(`mathFlowFenceSequence`),Z(e,c,`whitespace`)(t))}function c(r){return r===null||J(r)?(e.exit(`mathFlowFence`),t(r)):n(r)}}}function Xg(e,t,n){let r=this;return i;function i(n){return n===null?t(n):(e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Zg(e){let t=(e||{}).singleDollarTextMath;return t??=!0,{tokenize:n,resolve:Qg,previous:$g,name:`mathText`};function n(e,n,r){let i=0,a,o;return s;function s(t){return e.enter(`mathText`),e.enter(`mathTextSequence`),c(t)}function c(n){return n===36?(e.consume(n),i++,c):i<2&&!t?r(n):(e.exit(`mathTextSequence`),l(n))}function l(t){return t===null?r(t):t===36?(o=e.enter(`mathTextSequence`),a=0,d(t)):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),l):J(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),l):(e.enter(`mathTextData`),u(t))}function u(t){return t===null||t===32||t===36||J(t)?(e.exit(`mathTextData`),l(t)):(e.consume(t),u)}function d(t){return t===36?(e.consume(t),a++,d):a===i?(e.exit(`mathTextSequence`),e.exit(`mathText`),n(t)):(o.type=`mathTextData`,u(t))}}}function Qg(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`mathTextData`){e[t][1].type=`mathTextPadding`,e[n][1].type=`mathTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`mathTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function $g(e){return e!==36||this.events[this.events.length-1][1].type===`characterEscape`}function e_(e){return{flow:{36:qg},text:{36:Zg(e)}}}const t_={};function n_(e){let t=this,n=e||t_,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(e_(n)),a.push(Gg()),o.push(Kg(n))}const r_=(function(e){if(e==null)return c_;if(typeof e==`string`)return o_(e);if(typeof e==`object`)return Array.isArray(e)?i_(e):a_(e);if(typeof e==`function`)return s_(e);throw Error(`Expected function, string, or object as test`)});function i_(e){let t=[],n=-1;for(;++n<e.length;)t[n]=r_(e[n]);return s_(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].call(this,...e))return!0;return!1}}function a_(e){return s_(t);function t(t){let n;for(n in e)if(t[n]!==e[n])return!1;return!0}}function o_(e){return s_(t);function t(t){return t&&t.type===e}}function s_(e){return t;function t(t,...n){return!!(t&&typeof t==`object`&&`type`in t&&e.call(this,t,...n))}}function c_(){return!0}function l_(e){return e}const u_=(function(e,t,n,r){typeof t==`function`&&typeof n!=`function`&&(r=n,n=t,t=null);let i=r_(t),a=r?-1:1;o(e,void 0,[])();function o(e,s,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+l_(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=[],u,d,f;if((!t||i(e,s,c[c.length-1]||null))&&(l=d_(n(e,c)),l[0]===!1))return l;if(e.children&&l[0]!==`skip`)for(d=(r?e.children.length:-1)+a,f=c.concat(e);d>-1&&d<e.children.length;){if(u=o(e.children[d],d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+a}return l}}});function d_(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:[e]}const f_=(function(e,t,n,r){typeof t==`function`&&typeof n!=`function`&&(r=n,n=t,t=null),u_(e,t,i,r);function i(e,t){let r=t[t.length-1];return n(e,r?r.children.indexOf(e):null,r)}});function p_(){return e=>{f_(e,[`text`],(e,t,n)=>{if(e.type!==`text`)return;let{value:r}=e,i=r.split(/\^/);if(i.length===1||i.length%2==0)return;let a=i.map((e,t)=>t%2==0?{type:`text`,value:e}:{type:`superscript`,data:{hName:`sup`},children:[{type:`text`,value:e}]});n.children.splice(t,1,...a)}),f_(e,[`text`],(e,t,n)=>{if(e.type!==`text`)return;let{value:r}=e,i=r.split(/\~/);if(i.length===1||i.length%2==0)return;let a=i.map((e,t)=>t%2==0?{type:`text`,value:e}:{type:`subscript`,data:{hName:`sub`},children:[{type:`text`,value:e}]});n.children.splice(t,1,...a)})}}const m_=[`artifact:`,`image:`,`store:`,`document://`,`collection:`,`interaction:`,`prompt:`,`agent:`,`workflow:`,`process:`,`run:`],h_=/(!?\[[^[\]\n]*\]\()((?:artifact:|image:|store:|document:\/\/|collection:|interaction:|prompt:|agent:|workflow:|process:|run:)[^)[\n]+)(\))/g,g_=/`[^`\n]*`/g,__=/(^|\n)(`{3,}|~{3,})[^\n]*\n[\s\S]*?\n\2(?=\n|$)/g,v_=/\s+("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|\([^)]*\))\s*$/;function y_(e){return m_.some(t=>e.startsWith(t))}function b_(e){let t=e.trim();if(t.startsWith(`<`)){let n=t.indexOf(`>`);if(n>0&&y_(t.slice(1,n).trim()))return e}let n=t.match(v_)?.index??-1,r=(n>=0?t.slice(0,n):t).trim(),i=n>=0?t.slice(n):``;return y_(r)?`<${r}>${i}`:e}function x_(e){return e.replace(h_,(e,t,n,r)=>`${t}${b_(n)}${r}`)}function S_(e){let t=``,n=0;for(let r of e.matchAll(g_))t+=x_(e.slice(n,r.index)),t+=r[0],n=r.index+r[0].length;return t+=x_(e.slice(n)),t}function C_(e){if(!e||!m_.some(t=>e.includes(t)))return e;let t=``,n=0;for(let r of e.matchAll(__))t+=S_(e.slice(n,r.index)),t+=r[0],n=r.index+r[0].length;return t+=S_(e.slice(n)),t}const w_=/^([ \t]*):::([^\n]*?):::[ \t]*$/gm,T_=/^\w+/;function E_(e){return e?.includes(`:::`)?e.replace(w_,(e,t,n)=>{let r=n.trim(),i=T_.exec(r);if(!i)return e;let a=i[0],o=r.slice(a.length).trim();return o?`${t}:::${a}\n${t}${o}\n${t}:::`:`${t}::${a}`}):e}const D_=/(^|\n)(`{3,}|~{3,})[^\n]*\n[\s\S]*?\n\2(?=\n|$)/g,O_=/`[^`\n]*`/g,k_=/\\\$/g,A_=/\\[^\s]/,j_=/[{}]/,M_=/[_^][\w{]/,N_=/^[a-zA-Z]$/,P_=/^[a-zA-Z]\s*=/,F_=/^\s/,I_=/\s$/,L_=/[+*/-]$/,R_=/\^[+-]$/;function z_(e){return A_.test(e)||j_.test(e)||M_.test(e)||N_.test(e)||P_.test(e)}function B_(e){return!!(F_.test(e)||I_.test(e)||L_.test(e)&&!R_.test(e))}function V_(e){let t=[];for(let n=0;n<e.length;n++)if(e[n]===`$`&&!(n>0&&e[n-1]===`\\`)){if(n+1<e.length&&e[n+1]===`$`){n++;continue}n>0&&e[n-1]===`$`&&(n<2||e[n-2]!==`\\`)||t.push(n)}return t}function H_(e,t,n){let r=e.slice(t+1,n);return r.length===0||r.includes(`
325
325
  `)?null:r}function U_(e){let t=V_(e);if(t.length<2)return e;let n=new Set,r=new Set,i=Array(t.length-1);for(let n=0;n<t.length-1;n++)i[n]=H_(e,t[n],t[n+1]);let a=[];for(let e=0;e<t.length-1;e++){if(n.has(e))continue;let r=i[e];r!==null&&z_(r)&&(n.add(e),n.add(e+1),a.push([t[e],t[e+1]]))}let o=0;for(;o<t.length;){if(n.has(o)){o++;continue}let e=o+1;for(;e<t.length&&n.has(e);)e++;if(e>=t.length)break;if(e>o+1){r.add(t[o]),o++;continue}let a=i[o];if(a===null){o++;continue}B_(a)&&(r.add(t[o]),r.add(t[e])),n.add(o),n.add(e),o=e+1}for(let e=0;e<t.length;e++)n.has(e)||e+1<t.length&&n.has(e+1)&&r.add(t[e]);if(r.size===0&&a.length===0)return e;let s=[],c=0,l=Array.from(r).sort((e,t)=>e-t),u=0,d=0;for(;u<l.length||d<a.length;){let t=u<l.length?l[u]:1/0;if(t<(d<a.length?a[d][0]:1/0))t>c&&s.push(e.slice(c,t)),s.push(`\\$`),c=t+1,u++;else{let[t,n]=a[d];t>c&&s.push(e.slice(c,t));let r=e.slice(t,n+1);for(s.push(r.replace(k_,`\\text{\\textdollar}`)),c=n+1;u<l.length&&l[u]<=n;)u++;d++}}return c<e.length&&s.push(e.slice(c)),s.join(``)}function W_(e){let t=[],n=0;for(let r of e.matchAll(O_))t.push(U_(e.slice(n,r.index))),t.push(r[0]),n=r.index+r[0].length;return t.push(U_(e.slice(n))),t.join(``)}function G_(e){if(!e?.includes(`$`))return e;let t=[],n=0;for(let r of e.matchAll(D_))t.push(W_(e.slice(n,r.index))),t.push(r[0]),n=r.index+r[0].length;return t.push(W_(e.slice(n))),t.join(``)}const K_={note:`md-callout-info`,tip:`md-callout-info`,warning:`md-callout-attention`,important:`md-callout-attention`,caution:`md-callout-destructive`},q_={note:`Note`,tip:`Tip`,warning:`Warning`,important:`Important`,caution:`Caution`};function J_(){return(e,t)=>{Uu(e,(e,n,r)=>{if(e.type===`textDirective`){let i=e.position?.start.offset,a=e.position?.end.offset;if(r&&n!==void 0&&i!==void 0&&a!==void 0){let o={type:`text`,value:t.toString().slice(i,a),position:e.position};r.children[n]=o}return Bu}if(e.type!==`containerDirective`&&e.type!==`leafDirective`)return;let i=e;i.data||={};let a=i.data,o=i.attributes||{},s=i.name;if(s===`pagebreak`){a.hName=`hr`,a.hProperties={className:`md-pagebreak`};return}if(s===`columns`){a.hName=`div`,a.hProperties={className:`md-columns`};return}if(s===`column`){a.hName=`div`;let e={className:`md-column`};o.width&&(e.style=`flex-basis:${o.width};flex-grow:0;flex-shrink:0`),a.hProperties=e;return}if(s in K_){a.hName=`div`,a.hProperties={className:`md-callout ${K_[s]}`,"data-callout-type":s};let e=q_[s];if(e&&i.children){let t={type:`paragraph`,data:{hName:`p`,hProperties:{className:`md-callout-title`}},children:[{type:`text`,value:e}]};i.children.unshift(t)}return}a.hName=`div`,a.hProperties={className:`md-${s}`,...Object.fromEntries(Object.entries(o).filter(([e])=>e!==`class`))},o.class&&(a.hProperties.className+=` ${o.class}`)})}}const Y_=/(?:^|[^\\])\$/,X_=[];let Z_,Q_;function $_(){return Q_||=import(`rehype-katex`).then(({default:e})=>(Z_=e,e)),Q_}function ev(e){let t=w.useMemo(()=>Y_.test(e),[e]),[n,r]=w.useState(()=>Z_);return w.useEffect(()=>{if(!t||n)return;let e=!1;return $_().then(t=>{e||r(()=>t)}).catch(e=>{console.error(`Failed to load KaTeX; math will render unstyled`,e)}),()=>{e=!0}},[t,n]),w.useMemo(()=>n?[n]:X_,[n])}const tv=[`artifact:`,`image:`,`store:`,`document:`,`document://`,`collection:`,`interaction:`,`prompt:`,`agent:`,`workflow:`,`process:`,`run:`];function nv(e){return tv.some(t=>e.startsWith(t))?e:Gd(e)}function rv(){return e=>{Uu(e,`html`,(e,t,n)=>{let r=e,i=n;if(typeof r.value==`string`&&/<!--[\s\S]*?-->/.test(r.value)&&i?.children&&typeof t==`number`)return i.children.splice(t,1),[Bu,t]})}}const iv=Ii();function av({children:e,components:n,remarkPlugins:r=[],removeComments:i=!0,artifactRunId:a,onArtifactOpen:o,className:s,codeClassName:c,inlineCodeClassName:l,linkClassName:u,imageClassName:d,onProposalSelect:f,onProposalSubmit:p,preserveSourcePositions:m=!1}){let h=Ie(),g=w.useMemo(()=>m?e:E_(C_(G_(e))),[e,m]),_=w.useMemo(()=>{let e=[zg,Vp,J_,Hg,Tf,p_,n_,...r];return i&&e.push(rv),e},[r,i]),v=ev(g),y=w.useMemo(()=>({handlers:{...Cf}}),[]),b=w.useMemo(()=>{let e=n||{},r=e.code,i=e.a,s=e.img,f=({node:e,className:n,children:i,...a})=>{let o=/language-([\w-]+)/.exec(n||``),s=!o,u=o?o[1]:``;if(!s&&u){if(h){let e=h.getComponent(u);if(e){let n=String(i||``).trim();return t(e,{code:n,language:u})}}if(Fi(u)){let e=String(i||``).trim();return t(Pi,{code:e,language:u})}let e=iv[u];if(e){let n=String(i||``).trim();return t(e,{code:n,language:u})}}return typeof r==`function`?t(r,{node:e,className:n,...a,children:i}):t(`code`,{...a,className:s?`px-1.5 py-0.5 rounded ${l||``}`:` ${c||``}`,children:i})},p=e=>{let{node:n,href:r,children:s,...c}=e;return t(Yi,{node:n,href:r,className:u,artifactRunId:a,onArtifactOpen:o,ExistingLink:typeof i==`function`?i:void 0,...c,children:s})},m=e=>{let{node:n,src:r,alt:i,title:o,...c}=e;return o?t(Vi,{src:r,alt:i,caption:o,className:d,artifactRunId:a}):t(Ui,{node:n,src:r,alt:i,className:d,artifactRunId:a,ExistingImg:typeof s==`function`?s:void 0,...c})};return{...e,code:f,a:p,img:m}},[n,a,o,h,c,l,u,d]),x=t(Ne,{artifactRunId:a,onProposalSelect:f,onProposalSubmit:p,MarkdownRenderer:av,children:t(Vd,{remarkPlugins:_,rehypePlugins:v,remarkRehypeOptions:y,components:b,urlTransform:nv,children:g})});return s?t(`div`,{className:`md-content ${s}`,children:x}):t(`div`,{className:`md-content`,children:x})}const $=e=>e.chain(),ov=e=>e.can().chain();function sv(e){let[,t]=I(0);N(()=>{if(!e)return;let n=()=>t(e=>e+1);return e.on(`transaction`,n),e.on(`selectionUpdate`,n),()=>{e.off(`transaction`,n),e.off(`selectionUpdate`,n)}},[e])}const cv=e=>e.preventDefault();function lv(){return typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():`c-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function uv(e){let{from:t,to:n}=e.state.selection;if(t>=n)return null;let r=e.state.doc.textBetween(t,n,`
326
326
  `,` `).trim();if(!r)return null;let i=e.state.doc.resolve(t),a=`paragraph`;for(let e=i.depth;e>=0;e--){let t=i.node(e).type.name;if(t===`heading`){a=`heading`;break}if(t===`codeBlock`||t===`vertesiaCodeBlock`){a=`code block`;break}if(t===`blockquote`){a=`quote`;break}if(t===`listItem`||t===`taskItem`){a=`list item`;break}if(t===`table`){a=`table`;break}}return{blockLabel:a,quote:r,from:t,to:n}}function dv(e){let t=e.length,n=e.map((e,t)=>`${t+1}. On the ${e.blockLabel} “${e.quote}”:\n ${e.comment}`);return[`I've left ${t} comment${t===1?``:`s`} on the document:`,``,...n,``,`Please revise the document to address each comment, preserving everything else.`].join(`
327
- `)}function fv(e,t){return{contextElement:e.view.dom,getBoundingClientRect:()=>{try{let n=e.view.coordsAtPos(t.to),r=Math.max(1,n.bottom-n.top);return new DOMRect(n.right,n.top,1,r)}catch{return e.view.dom.getBoundingClientRect()}}}}function pv({editor:e,selection:r,composing:i,draft:a,onStart:o,onDraftChange:c,onCancel:l,onAdd:u}){let{t:d}=S(),f=b(),{refs:p,floatingStyles:m}=ye({placement:`right-start`,strategy:`fixed`,middleware:[_e(8),ge({fallbackPlacements:[`left-start`,`bottom-start`]}),ve({padding:12})],whileElementsMounted:he}),h=P(()=>fv(e,r),[e,r]);return N(()=>{p.setPositionReference(h)},[h,p]),t(me,{root:f,children:t(`div`,{ref:p.setFloating,style:m,className:`pointer-events-auto z-100`,children:i?n(`div`,{role:`dialog`,"aria-label":d(`agent.commentOnSelection`),className:`w-80 max-w-[calc(100vw-1.5rem)] space-y-2 rounded-lg border border-mixer-muted/25 bg-popover p-3 text-popover-foreground shadow-lg`,children:[n(`div`,{className:`line-clamp-2 text-xs text-muted`,children:[t(`span`,{className:`font-medium text-foreground`,children:d(`agent.commentingOn`)}),` `,n(`span`,{className:`italic`,children:[`“`,r.quote,`”`]})]}),t(_,{value:a,onChange:e=>c(e.target.value),placeholder:d(`agent.commentOnSelectionPlaceholder`),rows:3,autoFocus:!0,onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),l();return}e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),u())}}),n(`div`,{className:`flex justify-end gap-2`,children:[t(s,{variant:`outline`,size:`sm`,onClick:l,children:d(`store.cancelEdit`)}),t(s,{size:`sm`,onClick:u,disabled:!a.trim(),children:d(`agent.addComment`)})]})]}):t(v,{description:d(`agent.commentOnSelection`),asChild:!0,children:t(s,{variant:`secondary`,size:`sm`,onMouseDown:cv,onClick:o,"aria-label":d(`agent.commentOnSelection`),className:`size-9 rounded-full p-0 shadow-md`,children:t(_r,{className:`size-4`})})})})})}function mv({icon:e,label:n,active:r=!1,disabled:i=!1,onClick:a}){return t(s,{variant:`ghost`,size:`sm`,"aria-label":n,title:n,"aria-pressed":r,disabled:i,onMouseDown:cv,onClick:a,className:y(`size-8 shrink-0 rounded-md p-0 text-foreground hover:bg-muted/60`,r&&`bg-muted text-foreground`),children:t(e,{className:`size-4`})})}function hv(){return t(`div`,{className:`mx-0.5 h-5 w-px shrink-0 bg-mixer-muted/30`,"aria-hidden":!0})}function gv({onSend:e,hasUnsentChanges:r,isSending:i,disabled:a}){let{t:o}=S();return n(s,{variant:r?`primary`:`ghost`,size:`sm`,className:y(`h-8 gap-1.5`,!r&&`text-muted`),onMouseDown:cv,onClick:()=>void e(),disabled:a||!r||i,children:[i?t(g,{size:`sm`}):t(kr,{className:`size-3.5`}),o(`agent.sendChangesToAgent`)]})}function _v({editor:r,className:i,editable:a=!0,onSendComment:o,onSendChangesToAgent:f,hasUnsentChanges:p=!1,isSendingChanges:m=!1,sendChangesDisabled:h=!1,toolbarStatus:g}){let{t:_}=S(),v=x();sv(r);let[b,C]=I(!1),[w,T]=I(``),[E,D]=I(null),[O,k]=I(null),[A,M]=I([]),[ee,P]=I(!1),[te,ne]=I(!1),re=F(null);N(()=>{if(!r||!o)return;let e=()=>{let e=uv(r);k(e),e&&(re.current=e)};return e(),r.on(`selectionUpdate`,e),r.on(`transaction`,e),()=>{r.off(`selectionUpdate`,e),r.off(`transaction`,e)}},[r,o]);let ie=j(()=>{let e=re.current;if(!e){v({status:`info`,title:_(`agent.selectTextToComment`),duration:2500});return}D(e),T(``),C(!0)},[_,v]),ae=j(()=>{C(!1),D(null),T(``)},[]),oe=j(()=>{let e=w.trim();E&&e&&(M(t=>[...t,{id:lv(),...E,comment:e}]),C(!1),D(null),T(``),P(!0))},[w,E]),se=j(e=>{M(t=>t.filter(t=>t.id!==e))},[]),ce=j(async()=>{if(o&&A.length!==0&&!te){ne(!0);try{await o(dv(A)),M([]),P(!1)}finally{ne(!1)}}},[te,o,A]);if(!r)return null;let le=[1,2,3].find(e=>r.isActive(`heading`,{level:e})),ue=_(le===1?`richText.heading1`:le===2?`richText.heading2`:le===3?`richText.heading3`:`richText.paragraph`),de=r.isActive(`table`),fe=E??O;return n(e,{children:[n(`div`,{role:`toolbar`,"aria-label":_(`richText.blockStyle`),className:y(`flex min-h-10 shrink-0 items-center gap-0.5 overflow-x-auto border-b border-mixer-muted/25 px-1.5 py-1`,i),children:[t(mv,{icon:Lr,label:_(`richText.undo`),disabled:!a||!ov(r).focus().undo().run(),onClick:()=>$(r).focus().undo().run()}),t(mv,{icon:Dr,label:_(`richText.redo`),disabled:!a||!ov(r).focus().redo().run(),onClick:()=>$(r).focus().redo().run()}),t(hv,{}),n(c,{children:[t(d,{asChild:!0,children:n(s,{variant:`ghost`,size:`sm`,disabled:!a,onMouseDown:cv,className:`h-8 shrink-0 gap-1 px-2 text-xs font-medium text-foreground hover:bg-muted/60`,children:[ue,t(Gn,{className:`size-3 opacity-60`})]})}),n(l,{align:`start`,children:[t(u,{onClick:()=>$(r).focus().setParagraph().run(),children:_(`richText.paragraph`)}),t(u,{onClick:()=>$(r).focus().setHeading({level:1}).run(),children:_(`richText.heading1`)}),t(u,{onClick:()=>$(r).focus().setHeading({level:2}).run(),children:_(`richText.heading2`)}),t(u,{onClick:()=>$(r).focus().setHeading({level:3}).run(),children:_(`richText.heading3`)})]})]}),t(hv,{}),t(mv,{icon:zn,label:_(`richText.bold`),active:r.isActive(`bold`),disabled:!a,onClick:()=>$(r).focus().toggleBold().run()}),t(mv,{icon:ar,label:_(`richText.italic`),active:r.isActive(`italic`),disabled:!a,onClick:()=>$(r).focus().toggleItalic().run()}),t(mv,{icon:Nr,label:_(`richText.strike`),active:r.isActive(`strike`),disabled:!a,onClick:()=>$(r).focus().toggleStrike().run()}),t(mv,{icon:qn,label:_(`richText.inlineCode`),active:r.isActive(`code`),disabled:!a,onClick:()=>$(r).focus().toggleCode().run()}),t(hv,{}),t(mv,{icon:pr,label:_(`richText.bulletList`),active:r.isActive(`bulletList`),disabled:!a,onClick:()=>$(r).focus().toggleBulletList().run()}),t(mv,{icon:lr,label:_(`richText.orderedList`),active:r.isActive(`orderedList`),disabled:!a,onClick:()=>$(r).focus().toggleOrderedList().run()}),t(mv,{icon:Tr,label:_(`richText.blockquote`),active:r.isActive(`blockquote`),disabled:!a,onClick:()=>$(r).focus().toggleBlockquote().run()}),t(mv,{icon:jr,label:_(`richText.codeBlock`),active:r.isActive(`codeBlock`),disabled:!a,onClick:()=>$(r).focus().toggleCodeBlock().run()}),t(hv,{}),t(mv,{icon:Cr,label:_(`richText.horizontalRule`),disabled:!a,onClick:()=>$(r).focus().setHorizontalRule().run()}),n(c,{children:[t(d,{asChild:!0,children:t(s,{variant:`ghost`,size:`sm`,disabled:!a,"aria-label":_(`richText.tableActions`),title:_(de?`richText.tableActions`:`richText.table`),onMouseDown:cv,className:y(`size-8 shrink-0 rounded-md p-0 text-foreground hover:bg-muted/60`,de&&`bg-muted`),children:t(Fr,{className:`size-4`})})}),t(l,{align:`start`,children:de?n(e,{children:[t(u,{onClick:()=>$(r).focus().addRowBefore().run(),children:_(`richText.addRowAbove`)}),t(u,{onClick:()=>$(r).focus().addRowAfter().run(),children:_(`richText.addRowBelow`)}),t(u,{onClick:()=>$(r).focus().deleteRow().run(),children:_(`richText.deleteRow`)}),t(u,{onClick:()=>$(r).focus().addColumnBefore().run(),children:_(`richText.addColumnLeft`)}),t(u,{onClick:()=>$(r).focus().addColumnAfter().run(),children:_(`richText.addColumnRight`)}),t(u,{onClick:()=>$(r).focus().deleteColumn().run(),children:_(`richText.deleteColumn`)}),t(u,{onClick:()=>$(r).focus().deleteTable().run(),children:_(`richText.deleteTable`)})]}):t(u,{onClick:()=>$(r).focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),children:_(`richText.table`)})})]}),o||f?n(`div`,{className:`ms-auto flex shrink-0 items-center gap-1 ps-1`,children:[A.length>0?n(e,{children:[n(s,{variant:`ghost`,size:`sm`,className:`h-8 px-2 text-xs text-muted`,onClick:()=>P(e=>!e),children:[_(`agent.comments`),` (`,A.length,`)`]}),n(s,{size:`sm`,className:`h-8`,onClick:()=>void ce(),disabled:te,children:[t(kr,{className:`me-1 size-4`}),_(`agent.sendToAgent`)]})]}):null,f?n(e,{children:[g,t(gv,{onSend:f,hasUnsentChanges:p,isSending:m,disabled:h})]}):null]}):null]}),o&&fe?t(pv,{editor:r,selection:fe,composing:b,draft:w,onStart:ie,onDraftChange:T,onCancel:ae,onAdd:oe}):null,ee&&A.length>0?t(`ul`,{className:`max-h-48 shrink-0 space-y-1.5 overflow-y-auto border-b border-mixer-muted/15 px-3 py-2`,children:A.map(e=>n(`li`,{className:`flex items-start gap-2 rounded-md border border-mixer-muted/20 bg-muted/10 px-2 py-1.5`,children:[n(`div`,{className:`min-w-0 flex-1`,children:[n(`div`,{className:`truncate text-[11px] italic text-muted`,children:[`“`,e.quote,`”`]}),t(`div`,{className:`whitespace-pre-wrap text-xs text-foreground`,children:e.comment})]}),t(s,{variant:`ghost`,size:`sm`,"aria-label":_(`agent.deleteComment`),title:_(`agent.deleteComment`),className:`size-6 shrink-0 p-0 text-muted`,onClick:()=>se(e.id),children:t(zr,{className:`size-3.5`})})]},e.id))}):null]})}const vv=Ii();function yv({code:e,language:n}){let r=Ie(),i=n?r?.getComponent(n):void 0,a=n?vv[n]:void 0,o=n?.startsWith(`expand:`)?Pi:i??a;return o?t(o,{code:e,language:n}):null}function bv({src:e,alt:n,title:r}){let{artifactRunId:i}=Pe();return r?t(Vi,{src:e,alt:n,caption:r,artifactRunId:i}):t(Ui,{src:e,alt:n,artifactRunId:i})}function xv({href:e,title:n,children:r}){let{artifactRunId:i}=Pe();return t(Yi,{href:e,artifactRunId:i,children:t(`span`,{title:n,children:r})})}function Sv({raw:e}){let{artifactRunId:n}=Pe();return t(av,{artifactRunId:n,children:e})}const Cv={codeBlock:yv,image:bv,link:xv,opaqueBlock:Sv};function wv({artifactRunId:e,...n}){return t(Ne,{artifactRunId:e,MarkdownRenderer:av,children:t(a,{...n,...Cv})})}function Tv({artifactRunId:e,className:i,contentClassName:a,editorClassName:o,onEditor:s,...c}){let[l,u]=I(null),d=j(e=>{u(e),s?.(e)},[s]);return t(Ne,{artifactRunId:e,MarkdownRenderer:av,children:n(`div`,{className:y(`overflow-hidden rounded-md border border-mixer-muted/30 bg-background`,i),children:[t(_v,{editor:l,editable:c.editable!==!1}),t(r,{...c,...Cv,onEditor:d,contentClassName:y(`max-h-80 overflow-auto`,a),editorClassName:y(`vprose prose-sm min-h-24 max-w-none px-3 py-2 outline-none`,o)})]})})}function Ev({artifactRunId:e,className:r,contentClassName:a,editorClassName:c,onEditor:l,onSendComment:u,onSendChangesToAgent:d,hasUnsentChanges:g=!1,isSendingChanges:v=!1,sendChangesDisabled:b=!1,toolbarStatus:x,...C}){let{t:w}=S(),[T,E]=I(null),D=j(e=>{E(e),l?.(e)},[l]),[O,k]=I(()=>o(C.value)===`lossy`?`choose`:`rich-text`);return n(Ne,{artifactRunId:e,MarkdownRenderer:av,children:[(O===`choose`?`source`:O)===`rich-text`?n(`div`,{className:y(`flex h-full min-h-0 flex-col bg-background`,r),children:[t(_v,{editor:T,editable:C.editable!==!1,onSendComment:u,onSendChangesToAgent:d,hasUnsentChanges:g,isSendingChanges:v,sendChangesDisabled:b,toolbarStatus:x}),t(i,{...C,...Cv,onEditor:D,ariaLabel:C.ariaLabel??w(`richText.documentEditor`),className:`flex min-h-0 flex-1 flex-col`,contentClassName:y(`min-h-0 flex-1 overflow-auto`,a),editorClassName:y(`vprose prose-sm mx-auto min-h-full w-full max-w-5xl px-6 py-5 outline-none`,c)})]}):n(`div`,{className:y(`flex h-full min-h-0 flex-col bg-background`,r),children:[d?n(`div`,{className:`flex min-h-10 shrink-0 items-center justify-end gap-1 border-b border-mixer-muted/25 px-1.5 py-1`,children:[x,t(gv,{onSend:d,hasUnsentChanges:g,isSending:v,disabled:b})]}):null,t(_,{value:C.value,onChange:e=>C.onChange?.(e.target.value),onFocus:()=>C.onFocusChange?.(!0),onBlur:()=>C.onFocusChange?.(!1),disabled:C.editable===!1,"aria-label":w(`richText.markdownSourceEditor`),className:y(`vertesia-markdown-document-editor-content min-h-0 flex-1 resize-none rounded-none`,`border-0 px-6 py-5 font-mono text-sm leading-6 outline-none focus-visible:ring-0`,a,c)})]}),n(f,{isOpen:O===`choose`,onClose:()=>k(`source`),className:`sm:max-w-lg`,disableCloseOnClickOutside:!0,children:[t(h,{children:w(`richText.sourceCompatibilityWarningTitle`)}),t(p,{children:t(`p`,{className:`text-sm text-muted`,children:w(`richText.sourceCompatibilityWarningDescription`)})}),n(m,{align:`right`,children:[t(s,{variant:`outline`,onClick:()=>k(`source`),children:w(`richText.editMarkdownSource`)}),t(s,{variant:`secondary`,onClick:()=>k(`rich-text`),children:w(`richText.continueRichText`)})]})]})]})}export{Tv as VertesiaMarkdownComponentEditor,Ev as VertesiaMarkdownDocumentEditor,wv as VertesiaMarkdownRichTextEditor,Cv as vertesiaRichTextRenderers};
327
+ `)}function fv(e,t){return{contextElement:e.view.dom,getBoundingClientRect:()=>{try{let n=e.view.coordsAtPos(t.to),r=Math.max(1,n.bottom-n.top);return new DOMRect(n.right,n.top,1,r)}catch{return e.view.dom.getBoundingClientRect()}}}}function pv({editor:e,selection:r,composing:i,draft:a,onStart:o,onDraftChange:c,onCancel:l,onAdd:u}){let{t:d}=S(),f=b(),{refs:p,floatingStyles:m}=ye({placement:`right-start`,strategy:`fixed`,middleware:[_e(8),ge({fallbackPlacements:[`left-start`,`bottom-start`]}),ve({padding:12})],whileElementsMounted:he}),h=P(()=>fv(e,r),[e,r]);return N(()=>{p.setPositionReference(h)},[h,p]),t(me,{root:f,children:t(`div`,{ref:p.setFloating,style:m,className:`pointer-events-auto z-100`,children:i?n(`div`,{role:`dialog`,"aria-label":d(`agent.commentOnSelection`),className:`w-80 max-w-[calc(100vw-1.5rem)] space-y-2 rounded-lg border border-mixer-muted/25 bg-popover p-3 text-popover-foreground shadow-lg`,children:[n(`div`,{className:`line-clamp-2 text-xs text-muted`,children:[t(`span`,{className:`font-medium text-foreground`,children:d(`agent.commentingOn`)}),` `,n(`span`,{className:`italic`,children:[`“`,r.quote,`”`]})]}),t(_,{value:a,onChange:e=>c(e.target.value),placeholder:d(`agent.commentOnSelectionPlaceholder`),rows:3,autoFocus:!0,onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),l();return}e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),u())}}),n(`div`,{className:`flex justify-end gap-2`,children:[t(s,{variant:`outline`,size:`sm`,onClick:l,children:d(`store.cancelEdit`)}),t(s,{size:`sm`,onClick:u,disabled:!a.trim(),children:d(`agent.addComment`)})]})]}):t(v,{description:d(`agent.commentOnSelection`),asChild:!0,children:t(s,{variant:`secondary`,size:`sm`,onMouseDown:cv,onClick:o,"aria-label":d(`agent.commentOnSelection`),className:`size-9 rounded-full p-0 shadow-md`,children:t(_r,{className:`size-4`})})})})})}function mv({icon:e,label:n,active:r=!1,disabled:i=!1,onClick:a}){return t(s,{variant:`ghost`,size:`sm`,"aria-label":n,title:n,"aria-pressed":r,disabled:i,onMouseDown:cv,onClick:a,className:y(`size-8 shrink-0 rounded-md p-0 text-foreground hover:bg-muted/60`,r&&`bg-muted text-foreground`),children:t(e,{className:`size-4`})})}function hv(){return t(`div`,{className:`mx-0.5 h-5 w-px shrink-0 bg-mixer-muted/30`,"aria-hidden":!0})}function gv({onSend:e,hasUnsentChanges:r,isSending:i,disabled:a}){let{t:o}=S();return n(s,{variant:r?`primary`:`ghost`,size:`sm`,className:y(`h-8 gap-1.5`,!r&&`text-muted`),onMouseDown:cv,onClick:()=>void e(),disabled:a||!r||i,children:[i?t(g,{size:`sm`}):t(kr,{className:`size-3.5`}),o(`agent.sendChangesToAgent`)]})}function _v({editor:r,className:i,editable:a=!0,onSendComment:o,onSendChangesToAgent:f,hasUnsentChanges:p=!1,isSendingChanges:m=!1,sendChangesDisabled:h=!1,toolbarStatus:g}){let{t:_}=S(),v=x();sv(r);let[b,C]=I(!1),[w,T]=I(``),[E,D]=I(null),[O,k]=I(null),[A,M]=I([]),[ee,P]=I(!1),[te,ne]=I(!1),re=F(null);N(()=>{if(!r||!o)return;let e=()=>{let e=uv(r);k(e),e&&(re.current=e)};return e(),r.on(`selectionUpdate`,e),r.on(`transaction`,e),()=>{r.off(`selectionUpdate`,e),r.off(`transaction`,e)}},[r,o]);let ie=j(()=>{let e=re.current;if(!e){v({status:`info`,title:_(`agent.selectTextToComment`),duration:2500});return}D(e),T(``),C(!0)},[_,v]),ae=j(()=>{C(!1),D(null),T(``)},[]),oe=j(()=>{let e=w.trim();E&&e&&(M(t=>[...t,{id:lv(),...E,comment:e}]),C(!1),D(null),T(``),P(!0))},[w,E]),se=j(e=>{M(t=>t.filter(t=>t.id!==e))},[]),ce=j(async()=>{if(o&&A.length!==0&&!te){ne(!0);try{await o(dv(A)),M([]),P(!1)}finally{ne(!1)}}},[te,o,A]);if(!r)return null;let le=[1,2,3].find(e=>r.isActive(`heading`,{level:e})),ue=_(le===1?`richText.heading1`:le===2?`richText.heading2`:le===3?`richText.heading3`:`richText.paragraph`),de=r.isActive(`table`),fe=E??O;return n(e,{children:[n(`div`,{role:`toolbar`,"aria-label":_(`richText.blockStyle`),className:y(`flex min-h-10 shrink-0 items-center gap-0.5 overflow-x-auto border-b border-mixer-muted/25 px-1.5 py-1`,i),children:[t(mv,{icon:Lr,label:_(`richText.undo`),disabled:!a||!ov(r).focus().undo().run(),onClick:()=>$(r).focus().undo().run()}),t(mv,{icon:Dr,label:_(`richText.redo`),disabled:!a||!ov(r).focus().redo().run(),onClick:()=>$(r).focus().redo().run()}),t(hv,{}),n(c,{children:[t(d,{asChild:!0,children:n(s,{variant:`ghost`,size:`sm`,disabled:!a,onMouseDown:cv,className:`h-8 shrink-0 gap-1 px-2 text-xs font-medium text-foreground hover:bg-muted/60`,children:[ue,t(Gn,{className:`size-3 opacity-60`})]})}),n(l,{align:`start`,children:[t(u,{onClick:()=>$(r).focus().setParagraph().run(),children:_(`richText.paragraph`)}),t(u,{onClick:()=>$(r).focus().setHeading({level:1}).run(),children:_(`richText.heading1`)}),t(u,{onClick:()=>$(r).focus().setHeading({level:2}).run(),children:_(`richText.heading2`)}),t(u,{onClick:()=>$(r).focus().setHeading({level:3}).run(),children:_(`richText.heading3`)})]})]}),t(hv,{}),t(mv,{icon:zn,label:_(`richText.bold`),active:r.isActive(`bold`),disabled:!a,onClick:()=>$(r).focus().toggleBold().run()}),t(mv,{icon:ar,label:_(`richText.italic`),active:r.isActive(`italic`),disabled:!a,onClick:()=>$(r).focus().toggleItalic().run()}),t(mv,{icon:Nr,label:_(`richText.strike`),active:r.isActive(`strike`),disabled:!a,onClick:()=>$(r).focus().toggleStrike().run()}),t(mv,{icon:qn,label:_(`richText.inlineCode`),active:r.isActive(`code`),disabled:!a,onClick:()=>$(r).focus().toggleCode().run()}),t(hv,{}),t(mv,{icon:dr,label:_(`richText.bulletList`),active:r.isActive(`bulletList`),disabled:!a,onClick:()=>$(r).focus().toggleBulletList().run()}),t(mv,{icon:lr,label:_(`richText.orderedList`),active:r.isActive(`orderedList`),disabled:!a,onClick:()=>$(r).focus().toggleOrderedList().run()}),t(mv,{icon:Tr,label:_(`richText.blockquote`),active:r.isActive(`blockquote`),disabled:!a,onClick:()=>$(r).focus().toggleBlockquote().run()}),t(mv,{icon:jr,label:_(`richText.codeBlock`),active:r.isActive(`codeBlock`),disabled:!a,onClick:()=>$(r).focus().toggleCodeBlock().run()}),t(hv,{}),t(mv,{icon:Cr,label:_(`richText.horizontalRule`),disabled:!a,onClick:()=>$(r).focus().setHorizontalRule().run()}),n(c,{children:[t(d,{asChild:!0,children:t(s,{variant:`ghost`,size:`sm`,disabled:!a,"aria-label":_(`richText.tableActions`),title:_(de?`richText.tableActions`:`richText.table`),onMouseDown:cv,className:y(`size-8 shrink-0 rounded-md p-0 text-foreground hover:bg-muted/60`,de&&`bg-muted`),children:t(Fr,{className:`size-4`})})}),t(l,{align:`start`,children:de?n(e,{children:[t(u,{onClick:()=>$(r).focus().addRowBefore().run(),children:_(`richText.addRowAbove`)}),t(u,{onClick:()=>$(r).focus().addRowAfter().run(),children:_(`richText.addRowBelow`)}),t(u,{onClick:()=>$(r).focus().deleteRow().run(),children:_(`richText.deleteRow`)}),t(u,{onClick:()=>$(r).focus().addColumnBefore().run(),children:_(`richText.addColumnLeft`)}),t(u,{onClick:()=>$(r).focus().addColumnAfter().run(),children:_(`richText.addColumnRight`)}),t(u,{onClick:()=>$(r).focus().deleteColumn().run(),children:_(`richText.deleteColumn`)}),t(u,{onClick:()=>$(r).focus().deleteTable().run(),children:_(`richText.deleteTable`)})]}):t(u,{onClick:()=>$(r).focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),children:_(`richText.table`)})})]}),o||f?n(`div`,{className:`ms-auto flex shrink-0 items-center gap-1 ps-1`,children:[A.length>0?n(e,{children:[n(s,{variant:`ghost`,size:`sm`,className:`h-8 px-2 text-xs text-muted`,onClick:()=>P(e=>!e),children:[_(`agent.comments`),` (`,A.length,`)`]}),n(s,{size:`sm`,className:`h-8`,onClick:()=>void ce(),disabled:te,children:[t(kr,{className:`me-1 size-4`}),_(`agent.sendToAgent`)]})]}):null,f?n(e,{children:[g,t(gv,{onSend:f,hasUnsentChanges:p,isSending:m,disabled:h})]}):null]}):null]}),o&&fe?t(pv,{editor:r,selection:fe,composing:b,draft:w,onStart:ie,onDraftChange:T,onCancel:ae,onAdd:oe}):null,ee&&A.length>0?t(`ul`,{className:`max-h-48 shrink-0 space-y-1.5 overflow-y-auto border-b border-mixer-muted/15 px-3 py-2`,children:A.map(e=>n(`li`,{className:`flex items-start gap-2 rounded-md border border-mixer-muted/20 bg-muted/10 px-2 py-1.5`,children:[n(`div`,{className:`min-w-0 flex-1`,children:[n(`div`,{className:`truncate text-[11px] italic text-muted`,children:[`“`,e.quote,`”`]}),t(`div`,{className:`whitespace-pre-wrap text-xs text-foreground`,children:e.comment})]}),t(s,{variant:`ghost`,size:`sm`,"aria-label":_(`agent.deleteComment`),title:_(`agent.deleteComment`),className:`size-6 shrink-0 p-0 text-muted`,onClick:()=>se(e.id),children:t(zr,{className:`size-3.5`})})]},e.id))}):null]})}const vv=Ii();function yv({code:e,language:n}){let r=Ie(),i=n?r?.getComponent(n):void 0,a=n?vv[n]:void 0,o=n?.startsWith(`expand:`)?Pi:i??a;return o?t(o,{code:e,language:n}):null}function bv({src:e,alt:n,title:r}){let{artifactRunId:i}=Pe();return r?t(Vi,{src:e,alt:n,caption:r,artifactRunId:i}):t(Ui,{src:e,alt:n,artifactRunId:i})}function xv({href:e,title:n,children:r}){let{artifactRunId:i}=Pe();return t(Yi,{href:e,artifactRunId:i,children:t(`span`,{title:n,children:r})})}function Sv({raw:e}){let{artifactRunId:n}=Pe();return t(av,{artifactRunId:n,children:e})}const Cv={codeBlock:yv,image:bv,link:xv,opaqueBlock:Sv};function wv({artifactRunId:e,...n}){return t(Ne,{artifactRunId:e,MarkdownRenderer:av,children:t(a,{...n,...Cv})})}function Tv({artifactRunId:e,className:i,contentClassName:a,editorClassName:o,onEditor:s,...c}){let[l,u]=I(null),d=j(e=>{u(e),s?.(e)},[s]);return t(Ne,{artifactRunId:e,MarkdownRenderer:av,children:n(`div`,{className:y(`overflow-hidden rounded-md border border-mixer-muted/30 bg-background`,i),children:[t(_v,{editor:l,editable:c.editable!==!1}),t(r,{...c,...Cv,onEditor:d,contentClassName:y(`max-h-80 overflow-auto`,a),editorClassName:y(`vprose prose-sm min-h-24 max-w-none px-3 py-2 outline-none`,o)})]})})}function Ev({artifactRunId:e,className:r,contentClassName:a,editorClassName:c,onEditor:l,onSendComment:u,onSendChangesToAgent:d,hasUnsentChanges:g=!1,isSendingChanges:v=!1,sendChangesDisabled:b=!1,toolbarStatus:x,...C}){let{t:w}=S(),[T,E]=I(null),D=j(e=>{E(e),l?.(e)},[l]),[O,k]=I(()=>o(C.value)===`lossy`?`choose`:`rich-text`);return n(Ne,{artifactRunId:e,MarkdownRenderer:av,children:[(O===`choose`?`source`:O)===`rich-text`?n(`div`,{className:y(`flex h-full min-h-0 flex-col bg-background`,r),children:[t(_v,{editor:T,editable:C.editable!==!1,onSendComment:u,onSendChangesToAgent:d,hasUnsentChanges:g,isSendingChanges:v,sendChangesDisabled:b,toolbarStatus:x}),t(i,{...C,...Cv,onEditor:D,ariaLabel:C.ariaLabel??w(`richText.documentEditor`),className:`flex min-h-0 flex-1 flex-col`,contentClassName:y(`min-h-0 flex-1 overflow-auto`,a),editorClassName:y(`vprose prose-sm mx-auto min-h-full w-full max-w-5xl px-6 py-5 outline-none`,c)})]}):n(`div`,{className:y(`flex h-full min-h-0 flex-col bg-background`,r),children:[d?n(`div`,{className:`flex min-h-10 shrink-0 items-center justify-end gap-1 border-b border-mixer-muted/25 px-1.5 py-1`,children:[x,t(gv,{onSend:d,hasUnsentChanges:g,isSending:v,disabled:b})]}):null,t(_,{value:C.value,onChange:e=>C.onChange?.(e.target.value),onFocus:()=>C.onFocusChange?.(!0),onBlur:()=>C.onFocusChange?.(!1),disabled:C.editable===!1,"aria-label":w(`richText.markdownSourceEditor`),className:y(`vertesia-markdown-document-editor-content min-h-0 flex-1 resize-none rounded-none`,`border-0 px-6 py-5 font-mono text-sm leading-6 outline-none focus-visible:ring-0`,a,c)})]}),n(f,{isOpen:O===`choose`,onClose:()=>k(`source`),className:`sm:max-w-lg`,disableCloseOnClickOutside:!0,children:[t(h,{children:w(`richText.sourceCompatibilityWarningTitle`)}),t(p,{children:t(`p`,{className:`text-sm text-muted`,children:w(`richText.sourceCompatibilityWarningDescription`)})}),n(m,{align:`right`,children:[t(s,{variant:`outline`,onClick:()=>k(`source`),children:w(`richText.editMarkdownSource`)}),t(s,{variant:`secondary`,onClick:()=>k(`rich-text`),children:w(`richText.continueRichText`)})]})]})]})}export{Tv as VertesiaMarkdownComponentEditor,Ev as VertesiaMarkdownDocumentEditor,wv as VertesiaMarkdownRichTextEditor,Cv as vertesiaRichTextRenderers};
328
328
  //# sourceMappingURL=vertesia-ui-rich-text.js.map