@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,326 +1,326 @@
1
1
  import{Fragment as e,jsx as t,jsxs as n}from"react/jsx-runtime";import{Button as r,Center as i,DotBadge as a,DropdownMenu as o,DropdownMenuContent as s,DropdownMenuItem as c,DropdownMenuTrigger as l,FormItem as u,MessageBox as d,Modal as f,ModalBody as p,ModalFooter as m,ModalTitle as h,SelectBox as g,Spinner as _,Styles as v,Switch as y,Table as b,Textarea as x,VTooltip as S,cn as C,errorMessage as w,useClickOutside as T,useFlag as E,useTheme as D,useToast as O}from"@vertesia/ui/core";import k,{clsx as A}from"clsx";import*as j from"react";import M,{Suspense as ee,createContext as N,createElement as te,forwardRef as P,lazy as ne,memo as re,useCallback as F,useContext as I,useEffect as L,useId as ie,useMemo as R,useRef as z,useState as B}from"react";import ae from"ajv";import oe from"ajv-formats";import{useUITranslation as se}from"@vertesia/ui/i18n";import ce from"debounce";import{FusionFragmentHandler as le,FusionFragmentProvider as ue}from"@vertesia/fusion-ux";import de from"dompurify";import{DismissableLayer as fe,useDismissableLayerSurface as pe}from"@radix-ui/react-dismissable-layer";import{FocusScope as me}from"@radix-ui/react-focus-scope";import*as he from"react-dom";import{useFocusGuards as ge}from"@radix-ui/react-focus-guards";import{RemoveScroll as _e}from"react-remove-scroll";import{hideOthers as ve}from"aria-hidden";import{useUserSession as ye}from"@vertesia/ui/session";import{twMerge as be}from"tailwind-merge";import{isNil as xe,omit as V}from"lodash-es";var Se=Object.create,Ce=Object.defineProperty,we=Object.getOwnPropertyDescriptor,Te=Object.getOwnPropertyNames,Ee=Object.getPrototypeOf,De=Object.prototype.hasOwnProperty,Oe=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},ke=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),Ae=(e,t)=>{let n={};for(var r in e)Ce(n,r,{get:e[r],enumerable:!0});return t||Ce(n,Symbol.toStringTag,{value:`Module`}),n},je=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Te(t),a=0,o=i.length,s;a<o;a++)s=i[a],!De.call(e,s)&&s!==n&&Ce(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=we(t,s))||r.enumerable});return e},Me=(e,t,n)=>(n=e==null?{}:Se(Ee(e)),je(t||!e||!e.__esModule||!De.call(e,`default`)?Ce(n,`default`,{value:e,enumerable:!0}):n,e)),Ne=e=>De.call(e,`module.exports`)?e[`module.exports`]:je(Ce({},`__esModule`,{value:!0}),e);
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 Pe=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 Fe(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Pe(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 Ie=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},Le=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=Ie(e);return t.charAt(0).toUpperCase()+t.slice(1)},Re=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),ze={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 Be(e){return e!=null}function Ve(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??ze.width,a=e.size??e.height??ze.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?Re(...c):Re(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??ze[`stroke-width`])*Number(e.size??e.width??ze.width)/Number(t.size??t.width??ze.width):t.strokeWidth??ze[`stroke-width`];return[`svg`,{...Object.entries(ze).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&Be(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&Be(t.width)&&{[r(`width`)]:t.width},...`height`in t&&Be(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 He(e,t={}){return Ve(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 Ue=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},We=N({}),Ge=()=>I(We),Ke=P(({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=``}=Ge()??{},y=!!c||Ue(d),[b,x,S=[]]=He(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:Re(v,s),hasA11yProp:y,attributes:d});return te(b,{ref:f,...x},[...S.map(([e,t])=>te(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 H(e,t=[],n=[]){let r=typeof e==`string`?Fe(e,t,n):e,i=P(({className:e,...t},n)=>te(Ke,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=Le(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 qe={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`]};qe.node;const Je=H(qe),Ye={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]}
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
  ;Ye.node;const Xe=H(Ye),Ze={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]}
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
  ;Ze.node;const Qe=H(Ze),$e={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]}
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
  ;$e.node;const et=H($e),tt={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]}
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
  ;tt.node;const nt=H(tt),rt={name:`circle-check-big`,size:24,node:[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]],aliases:[`check-circle`]}
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
  ;rt.node;const it=H(rt),at={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]}
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
  ;at.node;const ot=H(at),st={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]}
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
  ;st.node;const ct=H(st),lt={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`}]]}
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
  ;lt.node;const ut=H(lt),dt={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`}]]}
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
  ;dt.node;const ft=H(dt),pt={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`}]]}
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
  ;pt.node;const mt=H(pt),ht={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`}]]}
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
  ;ht.node;const gt=H(ht),_t={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`}]]}
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
174
  ;_t.node;const vt=H(_t),yt={name:`git-commit-horizontal`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]],aliases:[`git-commit`]}
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
181
  ;yt.node;const bt=H(yt),xt={name:`heading-2`,size:24,node:[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]}
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
  ;xt.node;const St=H(xt),Ct={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`}]]}
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
  ;Ct.node;const wt=H(Ct),Tt={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]}
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
  ;Tt.node;const Et=H(Tt),Dt={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`}]]}
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
- ;Dt.node;const Ot=H(Dt),kt={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]}
209
+ ;Dt.node;const Ot=H(Dt),kt={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`}]]}
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
- ;kt.node;const At=H(kt),jt={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`}]]}
216
+ ;kt.node;const At=H(kt),jt={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]}
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
  ;jt.node;const Mt=H(jt),Nt={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`}]]}
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
  ;Nt.node;const Pt=H(Nt),Ft={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`}]]}
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
  ;Ft.node;const It=H(Ft),Lt={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`}]]}
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
  ;Lt.node;const Rt=H(Lt),zt={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]}
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
  ;zt.node;const Bt=H(zt),Vt={name:`pilcrow`,size:24,node:[[`path`,{d:`M13 4v16`,key:`8vvj80`}],[`path`,{d:`M17 4v16`,key:`7dpous`}],[`path`,{d:`M19 4H9.5a4.5 4.5 0 0 0 0 9H13`,key:`sh4n9v`}]]}
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
  ;Vt.node;const Ht=H(Vt),Ut={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]}
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
  ;Ut.node;const Wt=H(Ut),Gt={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`}]]}
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
  ;Gt.node;const Kt=H(Gt),qt={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`}]]}
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
279
  ;qt.node;const Jt=H(qt),Yt={name:`square-pen`,size:24,node:[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]],aliases:[`pen-box`,`edit`,`pen-square`]}
280
280
  /**
281
- * @license lucide-react v1.45.0 - ISC
281
+ * @license lucide-react v1.47.0 - ISC
282
282
  *
283
283
  * This source code is licensed under the ISC license.
284
284
  * See the LICENSE file in the root directory of this source tree.
285
285
  */
286
286
  ;Yt.node;const Xt=H(Yt),Zt={name:`table-2`,size:24,node:[[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]}
287
287
  /**
288
- * @license lucide-react v1.45.0 - ISC
288
+ * @license lucide-react v1.47.0 - ISC
289
289
  *
290
290
  * This source code is licensed under the ISC license.
291
291
  * See the LICENSE file in the root directory of this source tree.
292
292
  */
293
293
  ;Zt.node;const Qt=H(Zt),$t={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`}]]}
294
294
  /**
295
- * @license lucide-react v1.45.0 - ISC
295
+ * @license lucide-react v1.47.0 - ISC
296
296
  *
297
297
  * This source code is licensed under the ISC license.
298
298
  * See the LICENSE file in the root directory of this source tree.
299
299
  */
300
300
  ;$t.node;const en=H($t),tn={name:`text-align-start`,size:24,node:[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]],aliases:[`text`,`align-left`]}
301
301
  /**
302
- * @license lucide-react v1.45.0 - ISC
302
+ * @license lucide-react v1.47.0 - ISC
303
303
  *
304
304
  * This source code is licensed under the ISC license.
305
305
  * See the LICENSE file in the root directory of this source tree.
306
306
  */
307
307
  ;tn.node;const nn=H(tn),rn={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]}
308
308
  /**
309
- * @license lucide-react v1.45.0 - ISC
309
+ * @license lucide-react v1.47.0 - ISC
310
310
  *
311
311
  * This source code is licensed under the ISC license.
312
312
  * See the LICENSE file in the root directory of this source tree.
313
313
  */
314
314
  ;rn.node;const an=H(rn),on={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]}
315
315
  /**
316
- * @license lucide-react v1.45.0 - ISC
316
+ * @license lucide-react v1.47.0 - ISC
317
317
  *
318
318
  * This source code is licensed under the ISC license.
319
319
  * See the LICENSE file in the root directory of this source tree.
320
320
  */
321
321
  ;on.node;const sn=H(on),cn={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]}
322
322
  /**
323
- * @license lucide-react v1.45.0 - ISC
323
+ * @license lucide-react v1.47.0 - ISC
324
324
  *
325
325
  * This source code is licensed under the ISC license.
326
326
  * See the LICENSE file in the root directory of this source tree.
@@ -329,7 +329,7 @@ const qe={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16
329
329
  `),[i]);return t(`pre`,{className:`h-full overflow-auto rounded-md border bg-background p-3 font-mono text-xs leading-5 text-foreground ${r||``}`,children:t(`code`,{children:a.map((e,t)=>n(`span`,{children:[Jn(e),t<a.length-1?`
330
330
  `:null]},`line-${t}`))})})}const Kn=/("(?:\\.|[^"\\])*"?)|\b(true|false|null)\b|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)/g,qn=/^\s*:/;function Jn(e){Kn.lastIndex=0;let n=[],r=0,i=Kn.exec(e);for(;i!==null;){i.index>r&&n.push(e.slice(r,i.index));let[a,o,s,c]=i,l=o!==void 0&&qn.test(e.slice(i.index+a.length))?`text-info`:o?`text-success`:s?`text-info`:c?`text-attention`:void 0;n.push(t(`span`,{className:l,children:a},`${i.index}-${a}`)),r=i.index+a.length,i=Kn.exec(e)}return r<e.length&&n.push(e.slice(r)),n.length?n:e}function Yn({value:e}){return Array.isArray(e)?t(`div`,{className:`flex flex-col gap-4 px-2 h-full overflow-auto`,children:t($n,{value:e})}):typeof e!=`object`||!e?t(`div`,{className:`flex flex-col gap-4 px-2 h-full overflow-auto`,children:t(Qn,{name:`value`,value:e})}):t(`div`,{className:`flex flex-col gap-4 px-2 h-full overflow-auto`,children:Object.entries(e).map(([e,n])=>t(Qn,{name:e,value:n},e))})}function Xn({name:e}){return t(`div`,{className:`text-sm font-semibold`,children:Fn(e)})}function Zn({children:e,className:n}){return t(`div`,{className:k(`flex flex-col gap-4 py-2 ps-4 border-s-4 border-s-solid border-s-border`,n),children:e})}function Qn({name:e,value:r}){let i=nr(r);switch(i.type){case tr.Inline:return n(`div`,{className:`w-full flex gap-2 text-sm`,children:[t(Xn,{name:`${e}:`}),t(`p`,{children:i.value})]});case tr.Paragraph:return n(`div`,{className:`w-full flex flex-col gap-2 text-sm`,children:[t(Xn,{name:e}),t(`p`,{children:i.value})]});case tr.Prose:return n(`div`,{className:`prose dark:prose-invert`,children:[t(Xn,{name:e}),t(`div`,{className:`vprose prose-sm dark:prose-invert`,children:i.value})]});case tr.Array:return t($n,{name:e,value:r});case tr.Object:return n(`div`,{className:`w-full flex flex-col gap-2 text-sm`,children:[t(Xn,{name:e}),t(Zn,{className:`mt-2`,children:Object.entries(r).map(([e,n])=>t(Qn,{name:e,value:n},e))})]})}}function $n({name:e,value:r}){let i=r.join(` `).length,o=i/r.length,s=typeof r[0]==`string`&&(i<80||i<400&&o<32),c=r.length>9,l=r.map((e,t)=>({item:e,index:t,key:`${t}-${JSON.stringify(e)}`}));return s?n(`div`,{className:`flex gap-2 flex-wrap`,children:[e&&t(Xn,{name:`${e}:`}),l.map(({item:e,key:n})=>t(a,{children:String(e)},n))]}):n(`div`,{children:[e&&t(Xn,{name:e}),t(`div`,{className:`flex flex-col gap-2`,children:l.map(({item:e,index:n,key:r})=>t(er,{index:n,value:e,useBullet:c},r))})]})}function er({index:e,value:r,useBullet:i}){let a=i?t(`span`,{className:`text-xl`,children:`•`}):n(`span`,{children:[e+1,`.`]}),o=nr(r),s;switch(o.type){case tr.Object:s=t(Zn,{children:Object.entries(r).map(([e,n])=>t(Qn,{name:e,value:n},e))});break;case tr.Array:s=t($n,{value:r});break;case tr.Prose:s=t(`div`,{className:`prose dark:prose-invert`,children:o.value});break;default:s=t(`div`,{children:o.value})}return n(`div`,{className:`flex gap-4 hover:bg-muted py-2 pe-2 ps-4`,children:[t(`div`,{className:`font-semibold text-muted`,children:a}),t(`div`,{children:s})]})}var tr;(function(e){e[e.Inline=0]=`Inline`,e[e.Paragraph=1]=`Paragraph`,e[e.Prose=2]=`Prose`,e[e.Array=3]=`Array`,e[e.Object=4]=`Object`})(tr||={});function nr(e){if(e==null)return{value:`-`,type:tr.Inline};if(Array.isArray(e))return{value:e,type:tr.Array};if(typeof e==`string`){let t=e.length,n,r=e;return t<80?n=tr.Inline:t>400?n=tr.Prose:(n=tr.Paragraph,r=e.replace(/(?:\n\n)+/g,`
331
331
 
332
- `)),{type:n,value:r}}return typeof e==`number`||typeof e==`boolean`?{value:String(e),type:tr.Inline}:{value:e,type:tr.Object}}function rr({value:e,viewCode:n=!1}){let{t:r}=se();return e?t(`div`,{className:`relative w-full h-full flex flex-col`,children:n||!ir(e)?t(Gn,{data:e}):t(`div`,{className:`flex-1 min-h-0 overflow-auto`,children:t(Yn,{value:e})})}):t(`pre`,{className:`whitespace-pre-wrap`,children:r(`misc.noData`)})}function ir(e){return e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`?!0:Array.isArray(e)?e.every(ir):typeof e==`object`&&Object.values(e).every(ir)}const ar=new Set;function or(e){ar.has(`markdown`)||(ar.add(`markdown`),e.languages.registerFoldingRangeProvider(`markdown`,{provideFoldingRanges(e){let t=[],n=e.getLinesContent(),r=/^(#{1,6})\s/,i=[];for(let e=0;e<n.length;e++){let a=e+1,o=r.exec(n[e]);if(o){let e=o[1].length;for(;i.length>0&&i[i.length-1].level>=e;){let e=i.pop();e&&a-1>e.line&&t.push({start:e.line,end:a-1})}i.push({level:e,line:a})}}let a=n.length;for(;i.length>0;){let e=i.pop();e&&a>e.line&&t.push({start:e.line,end:a})}return t}}));for(let t of[`javascript`,`typescript`])ar.has(t)||(ar.add(t),e.languages.registerFoldingRangeProvider(t,{provideFoldingRanges(e){let t=e.getLinesContent(),n=/^(#{1,6})\s/,r=[],i=[],a=[],o=[],s=!1,c=!1,l=``;for(let e=0;e<t.length;e++){let u=e+1,d=t[e],f=s;for(let e=0;e<d.length;e++){let t=d[e];if(t===`\\`){e++;continue}if(c){t===l&&(c=!1);continue}if(s){t==="`"&&(s=!1);continue}if(t==="`"){s=!0;continue}if(t===`"`||t===`'`){c=!0,l=t;continue}if(t===`{`&&a.push(u),t===`}`&&a.length>0){let t=a.pop(),n=d.slice(e+1).trimStart().length>0?u-1:u;t!==void 0&&n>t&&r.push({start:t,end:n})}}if(f){let e=n.exec(d);if(e){let t=e[1].length;for(;o.length>0&&o[o.length-1].level>=t;){let e=o.pop();e&&u-1>e.line&&i.push({start:e.line,end:u-1})}o.push({level:t,line:u})}if(!s)for(;o.length>0;){let e=o.pop();e&&u>e.line&&i.push({start:e.line,end:u})}}}return[...r,...i]}}))}let sr=!1;function cr(e){sr||=(e.config({paths:{vs:`https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs`}}),!0)}let lr;function ur(){return lr??=import(`@monaco-editor/react`).then(e=>(cr(e.loader),e)).catch(e=>{throw lr=void 0,e}),lr}const dr=ne(()=>ur().then(({Editor:e})=>({default:e})));let fr;function pr(){if(!(typeof document>`u`)){if(!fr){let e=document.createElement(`div`);e.className=`monaco-editor`,e.style.position=`absolute`,e.style.top=`0`,e.style.left=`0`,e.style.zIndex=`10000`,document.body.appendChild(e),fr=e}return fr}}const mr=new Map;let hr=0;function gr(e){(e.languages.json?.jsonDefaults)?.setDiagnosticsOptions({validate:!0,enableSchemaRequest:!1,schemas:Array.from(mr.entries()).map(([e,t])=>({uri:`vertesia://schemas/${encodeURIComponent(e)}`,fileMatch:[e],schema:t}))})}var _r=class{VgetValue;VsetValue;constructor(e,t){this.VgetValue=e,this.VsetValue=t}getValue(){return this.VgetValue()}setValue(e){this.VsetValue(e||``)}};function vr({onChange:e,value:n,className:r,editorRef:i,language:a=`javascript`,path:o,debounceTimeout:s=0,options:c={},beforeMount:l,onMount:u,defaultValue:d,useCustomFolding:f=!1,jsonSchema:p}){let[m,h]=B(n||d||``),g=z(null),_=z(null),[v]=B(()=>p?`inmemory://vertesia/json/${++hr}.json`:void 0),y=o??v,{theme:b}=D(),x=b===`system`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:b,S=n||d||``,C=z(()=>m),w=z(e=>{h(e),g.current&&g.current.setValue(e)});L(()=>{C.current=()=>m},[m]),L(()=>(i&&(i.current=new _r(()=>C.current(),e=>w.current(e))),()=>{i&&(i.current=void 0)}),[i]);let T=R(()=>{if(e)return s>0?ce(t=>e(t),s):e},[e,s]),E=F(async(e,t)=>{let n=e.getModel();if(n)for(let r of n.getValue().matchAll(/```[\s\S]*?```/g)){let i=n.getPositionAt(r.index).lineNumber,a=n.getPositionAt(r.index+r[0].length).lineNumber;e.setSelection(new t.Selection(i,1,a,1)),await e.getAction(`editor.createFoldingRangeFromSelection`)?.run()}},[]),O=F(e=>{let t=e||``;if(h(t),T){let e={docChanged:!0,state:{doc:{toString:()=>t,length:t.length}}};T(e)}},[T]),A=F((e,t)=>{g.current=e,_.current=t,p&&y&&a===`json`&&(mr.set(y,p),gr(t)),f&&or(t),w.current=t=>{h(t),e.setValue(t)},t.editor.defineTheme(`errorLineTheme`,{base:x===`dark`?`vs-dark`:`vs`,inherit:!0,rules:[],colors:{"editorError.background":`#ffebee`,"editorError.border":`#f44336`}}),t.editor.setTheme(`errorLineTheme`),f&&setTimeout(()=>E(e,t),300),u?.(e,t)},[u,x,f,E,p,y,a]);L(()=>()=>{p&&y&&mr.delete(y)&&_.current&&gr(_.current)},[p,y]),L(()=>{g.current?.hasTextFocus()||h(e=>S===e?e:(g.current&&g.current.setValue(S),S))},[S]),L(()=>{if(!S||!f||!g.current||!_.current||g.current.hasTextFocus())return;let e=g.current,t=_.current,n=setTimeout(()=>E(e,t),300);return()=>clearTimeout(n)},[S,f,E]);let j={fontSize:14,fontFamily:`monospace`,minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:`on`,lineNumbers:`on`,folding:!0,lineDecorationsWidth:10,lineNumbersMinChars:3,automaticLayout:!0,formatOnPaste:!0,formatOnType:!0,tabSize:2,insertSpaces:!0,fixedOverflowWidgets:!0,overflowWidgetsDomNode:pr(),glyphMargin:!0,renderValidationDecorations:`on`,renderLineHighlight:`line`,hover:{enabled:`on`,delay:100},quickSuggestions:{other:!0,comments:!0,strings:!0},...c};return t(`div`,{className:k(r,`w-full h-full!`),children:t(ee,{fallback:t(`div`,{className:`h-full w-full`}),children:t(dr,{className:`h-full w-full`,height:`100%`,theme:x===`dark`?`vs-dark`:`light`,language:a,path:y,onChange:O,onMount:A,beforeMount:l,options:j,defaultValue:S})})})}function yr({value:e,onChange:r,onValidChange:i,readonly:a=!1,height:o=`200px`,placeholder:s,className:c}){let{theme:l}=D(),u=z(void 0),[d,f]=B(null),p=R(()=>{if(e==null)return s??`{}`;try{return JSON.stringify(e,null,2)}catch{return`{}`}},[e,s]),m=F(()=>{if(!u.current||a)return;let e=u.current.getValue();try{let t=JSON.parse(e);f(null),i?.(t)}catch{f(`Invalid JSON`)}},[a,i]);return n(`div`,{className:c,children:[t(`div`,{className:`border rounded overflow-hidden`,style:{height:o},children:t(vr,{defaultValue:p,editorRef:u,language:`json`,theme:l===`dark`?`vs-dark`:`vs`,onChange:m,options:a?{readOnly:!0,domReadOnly:!0}:void 0})}),d&&t(`p`,{className:`text-xs text-destructive mt-1`,children:d})]})}function br(e){if(!e.current)return null;try{return JSON.parse(e.current.getValue())}catch{return null}}function xr({title:e,viewCode:i,setViewCode:a}){return n(`div`,{className:`flex items-center gap-1 bg-muted mb-2 p-1 rounded`,children:[t(r,{variant:i?`ghost`:`primary`,size:`sm`,title:`Preview properties`,onClick:()=>a(!1),children:e}),t(r,{variant:i?`primary`:`ghost`,size:`sm`,title:`View in JSON format`,onClick:()=>a(!0),children:`JSON`})]})}function Sr(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[_-]+/g,` `).replace(/\s+/g,` `).trim().replace(/^./,e=>e.toUpperCase())}function Cr(r){return r==null?`Failed to query`:typeof r==`string`?r:Array.isArray(r)?r.length===0?`None`:r.some(e=>e&&typeof e==`object`)?t(e,{children:r.map((e,r)=>n(`div`,{className:`flex gap-1`,children:[n(`span`,{className:`text-xs align-top pe-2 font-medium`,children:[r+1,`:`]}),t(`span`,{className:`text-xs`,children:Cr(e)})]},`item-${r}`))}):r.map(e=>String(e)).join(`, `):typeof r==`object`?t(e,{children:Object.entries(r).map(([e,r])=>n(`div`,{className:`flex gap-1`,children:[n(`span`,{className:`text-xs align-top pe-2 font-medium`,children:[Sr(e),`:`]}),t(`span`,{className:`text-xs`,children:Cr(r)})]},e))}):String(r)}function wr({data:e,className:r}){let i=e?Object.entries(e):[];return t(`table`,{className:r||`mb-2 text-xs bg-muted rounded-sm w-full`,children:t(`tbody`,{children:i.map(([e,r])=>n(`tr`,{className:`align-top hover:bg-background border-y`,children:[t(`td`,{className:`align-top pe-4 p-2`,children:Sr(e)}),t(`td`,{className:`p-2`,children:Cr(r)})]},e))})})}const Tr=N(()=>({kind:`none`})),Er=Tr.Provider;function Dr(){return I(Tr)}const Or={store:`document`,document:`document`,collection:`collection`,interaction:`interaction`,prompt:`prompt`,agent:`agent`,workflow:`workflow`,process:`process`,run:`interaction_run`};function kr(e){let t=e.indexOf(`:`);if(t<=0)return;let n=e.slice(0,t);if(!Object.hasOwn(Or,n))return;let r=e.slice(t+1).trim().replace(/^\/+/,``);if(r)return{type:Or[n],id:r}}var Ar=Object.defineProperty,jr=(e,t)=>Ar(e,`name`,{value:t,configurable:!0}),Mr=!!(typeof window<`u`&&window.document&&window.document.createElement);function Nr(e,t,{checkForDefaultPrevented:n=!0}={}){return jr(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}jr(Nr,`composeEventHandlers`);function Pr(e){if(!Mr)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}jr(Pr,`getOwnerWindow`);function Fr(e){if(!Mr)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}jr(Fr,`getOwnerDocument`);function Ir(e,t=!1){let{activeElement:n}=Fr(e);if(!n?.nodeName)return null;if(Lr(n)&&n.contentDocument)return Ir(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Fr(n).getElementById(e);if(t)return t}}return n}jr(Ir,`getActiveElement`);function Lr(e){return e.tagName===`IFRAME`}jr(Lr,`isFrame`);var Rr=Object.defineProperty,zr=(e,t)=>Rr(e,`name`,{value:t,configurable:!0});function Br(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}zr(Br,`setRef`);function Vr(...e){return t=>{let n=!1,r=e.map(e=>{let r=Br(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():Br(e[t],null)}}}}zr(Vr,`composeRefs`);function Hr(...e){return j.useCallback(Vr(...e),e)}zr(Hr,`useComposedRefs`);var Ur=Object.defineProperty,Wr=(e,t)=>Ur(e,`name`,{value:t,configurable:!0});function Gr(e,n){let r=j.createContext(n);r.displayName=e+`Context`;let i=Wr(e=>{let{children:n,...i}=e,a=j.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=j.useContext(r);if(o)return o;if(n!==void 0)return n;if(!a)throw Error(`\`${t}\` must be used within \`${e}\``)}return Wr(a,`useContext`),[i,a]}Wr(Gr,`createContext`);function Kr(e,n=[]){let r=[];function i(n,i){let a=j.createContext(i);a.displayName=n+`Context`;let o=r.length;r=[...r,i];let s=Wr(n=>{let{scope:r,children:i,...s}=n,c=r?.[e]?.[o]||a,l=j.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=j.useContext(l);if(u)return u;if(i!==void 0)return i;if(!c)throw Error(`\`${t}\` must be used within \`${n}\``)}return Wr(c,`useContext`),[s,c]}Wr(i,`createContext`);let a=Wr(()=>{let t=r.map(e=>j.createContext(e));return Wr(function(n){let r=n?.[e]||t;return j.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return a.scopeName=e,[i,qr(a,...n)]}Wr(Kr,`createContextScope`);function qr(...e){let t=e[0];if(e.length===1)return t;let n=Wr(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Wr(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return j.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Wr(qr,`composeContextScopes`);var Jr=globalThis?.document?j.useLayoutEffect:()=>{},Yr=Object.defineProperty,Xr=(e,t)=>Yr(e,`name`,{value:t,configurable:!0}),Zr=j.useId||(()=>void 0),Qr=0;function $r(e){let[t,n]=j.useState(Zr());return Jr(()=>{e||n(e=>e??String(Qr++))},[e]),e||(t?`radix-${t}`:``)}Xr($r,`useId`);var ei=Object.defineProperty,ti=(e,t)=>ei(e,`name`,{value:t,configurable:!0}),ni=j.useEffectEvent,ri=j.useInsertionEffect;function ii(e){if(typeof ni==`function`)return ni(e);let t=j.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof ri==`function`?ri(()=>{t.current=e}):Jr(()=>{t.current=e}),j.useMemo(()=>((...e)=>t.current?.(...e)),[])}ti(ii,`useEffectEvent`);var ai=Object.defineProperty,oi=(e,t)=>ai(e,`name`,{value:t,configurable:!0}),si=j.useInsertionEffect||Jr;function ci({prop:e,defaultProp:t,onChange:n=oi(()=>{},`onChange`),caller:r}){let[i,a,o]=li({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,j.useCallback(t=>{if(s){let n=ui(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}oi(ci,`useControllableState`);function li({defaultProp:e,onChange:t}){let[n,r]=j.useState(e),i=j.useRef(n),a=j.useRef(t);return si(()=>{a.current=t},[t]),j.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}oi(li,`useUncontrolledState`);function ui(e){return typeof e==`function`}oi(ui,`isFunction`);var di=Symbol(`RADIX:SYNC_STATE`);function fi(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=ii(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=j.useReducer((t,n)=>{if(n.type===di)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=j.useRef(p);j.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=j.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return j.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:di,state:i})},[i,d.state,c]),[h,f]}oi(fi,`useControllableStateReducer`);var pi=Object.defineProperty,mi=(e,t)=>pi(e,`name`,{value:t,configurable:!0});function hi(e){let t=j.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Ci(r)&&typeof Di==`function`&&(r=Di(r._payload)),j.Children.forEach(r,e=>{if(xi(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Ci(n)&&typeof Di==`function`&&(n=Di(n._payload)),a=vi(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=j.cloneElement(a,void 0,s):!o&&j.Children.count(r)===1&&j.isValidElement(r)&&(a=r);let c=a?bi(a):void 0,l=Hr(n,c);if(!a){if(r||r===0)throw Error(o?Ei(e):Ti(e));return r}let u=yi(i,a.props??{});return a.type!==j.Fragment&&(u.ref=n?l:c),j.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}mi(hi,`createSlot`);var gi=Symbol.for(`radix.slottable`);function _i(e){let t=mi(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=gi,t}mi(_i,`createSlottable`);var vi=mi((e,t)=>{if(`child`in e.props){let t=e.props.child;return j.isValidElement(t)?j.cloneElement(t,void 0,e.props.children(t.props.children)):null}return j.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function yi(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}}mi(yi,`mergeProps`);function bi(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)}mi(bi,`getElementRef`);function xi(e){return j.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===gi}mi(xi,`isSlottable`);var Si=Symbol.for(`react.lazy`);function Ci(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Si&&`_payload`in e&&wi(e._payload)}mi(Ci,`isLazyComponent`);function wi(e){return typeof e==`object`&&!!e&&`then`in e}mi(wi,`isPromiseLike`);var Ti=mi(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Ei=mi(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Di=j.use,Oi=Object.defineProperty,ki=(e,t)=>Oi(e,`name`,{value:t,configurable:!0}),Ai=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,n)=>{let r=hi(`Primitive.${n}`),i=j.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 ji(e,t){e&&he.flushSync(()=>e.dispatchEvent(t))}ki(ji,`dispatchDiscreteCustomEvent`);var Mi=Object.defineProperty,Ni=j.forwardRef(((e,t)=>Mi(e,`name`,{value:t,configurable:!0}))(function(e,n){let{container:r,...i}=e,[a,o]=j.useState(!1);Jr(()=>o(!0),[]);let s=r||a&&globalThis?.document?.body;return s?he.createPortal(t(Ai.div,{...i,ref:n}),s):null},`Portal`)),Pi=Object.defineProperty,Fi=(e,t)=>Pi(e,`name`,{value:t,configurable:!0});function Ii(e,t){return j.useReducer((e,n)=>t[e][n]??e,e)}Fi(Ii,`useStateMachine`);var Li=Fi(e=>{let{present:t,children:n}=e,r=Ri(t),i=typeof n==`function`?n({present:r.isPresent}):j.Children.only(n),a=Bi(r.ref,Hi(i));return typeof n==`function`||r.isPresent?j.cloneElement(i,{ref:a}):null},`Presence`);function Ri(e){let[t,n]=j.useState(),r=j.useRef(null),i=j.useRef(e),a=j.useRef(`none`),o=j.useRef(void 0),[s,c]=Ii(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return j.useEffect(()=>{s===`mounted`?(a.current=o.current??Vi(r.current),o.current=void 0):a.current=`none`},[s]),Jr(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Vi(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]),Jr(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Fi(a=>{let o=Vi(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=Fi(e=>{e.target===t&&(a.current=Vi(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:j.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Vi(t)}else r.current=null;n(e)},[])}}Fi(Ri,`usePresence`);function zi(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Fi(zi,`setRef`);function Bi(...e){let t=j.useRef(e);return t.current=e,j.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=zi(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():zi(n[e],null)}}},[])}Fi(Bi,`useStableComposedRefs`);function Vi(e){return e?.animationName||`none`}Fi(Vi,`getAnimationName`);function Hi(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)}Fi(Hi,`getElementRef`);var Ui=Object.defineProperty,Wi=(e,t)=>Ui(e,`name`,{value:t,configurable:!0}),Gi=`Dialog`,[Ki,qi]=Kr(Gi),[Ji,Yi]=Ki(Gi),Xi=Wi(e=>{let{__scopeDialog:n,children:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=j.useRef(null),l=j.useRef(null),[u,d]=ci({prop:i,defaultProp:a??!1,onChange:o,caller:Gi}),[f,p]=j.useState(0),[m,h]=j.useState(0);return t(Ji,{scope:n,triggerRef:c,contentRef:l,contentId:$r(),titleId:$r(),descriptionId:$r(),titlePresent:f>0,descriptionPresent:m>0,setTitleCount:p,setDescriptionCount:h,open:u,onOpenChange:d,onOpenToggle:j.useCallback(()=>d(e=>!e),[d]),modal:s,children:r})},`Dialog`),Zi=`DialogPortal`,[Qi,$i]=Ki(Zi,{forceMount:void 0}),ea=Wi(e=>{let{__scopeDialog:n,forceMount:r,children:i,container:a}=e,o=Yi(Zi,n);return t(Qi,{scope:n,forceMount:r,children:j.Children.map(i,e=>t(Li,{present:r||o.open,children:t(Ni,{asChild:!0,container:a,children:e})}))})},`DialogPortal`),ta=`DialogOverlay`,na=j.forwardRef(Wi(function(e,n){let r=$i(ta,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=Yi(ta,e.__scopeDialog);return o.modal?t(Li,{present:i||o.open,children:t(ia,{...a,ref:n})}):null},`DialogOverlay`)),ra=hi(`DialogOverlay.RemoveScroll`),ia=j.forwardRef(Wi(function(e,n){let{__scopeDialog:r,...i}=e,a=Yi(ta,r),o=Hr(n,pe());return t(_e,{as:ra,allowPinchZoom:!0,shards:[a.contentRef],children:t(Ai.div,{"data-state":ga(a.open),...i,ref:o,style:{pointerEvents:`auto`,...i.style}})})},`DialogOverlayImpl`)),aa=`DialogContent`,oa=j.forwardRef(Wi(function(e,n){let r=$i(aa,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=Yi(aa,e.__scopeDialog);return t(Li,{present:i||o.open,children:o.modal?t(sa,{...a,ref:n}):t(ca,{...a,ref:n})})},`DialogContent`)),sa=j.forwardRef(Wi(function(e,n){let r=Yi(aa,e.__scopeDialog),i=j.useRef(null),a=Hr(n,r.contentRef,i);return j.useEffect(()=>{let e=i.current;if(e)return ve(e)},[]),t(la,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Nr(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Nr(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Nr(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),ca=j.forwardRef(Wi(function(e,n){let r=Yi(aa,e.__scopeDialog),i=j.useRef(!1),a=j.useRef(!1);return t(la,{...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`)),la=j.forwardRef(Wi(function(n,r){let{__scopeDialog:i,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,...c}=n,l=Yi(aa,i);return ge(),t(e,{children:t(me,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:s,children:t(fe,{role:`dialog`,id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":ga(l.open),...c,ref:r,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},`DialogContentImpl`)),ua=`DialogTitle`,da=j.forwardRef(Wi(function(e,n){let{__scopeDialog:r,...i}=e,a=Yi(ua,r),{setTitleCount:o}=a;return Jr(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),t(Ai.h2,{id:a.titleId,...i,ref:n})},`DialogTitle`)),fa=`DialogDescription`,pa=j.forwardRef(Wi(function(e,n){let{__scopeDialog:r,...i}=e,a=Yi(fa,r),{setDescriptionCount:o}=a;return Jr(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),t(Ai.p,{id:a.descriptionId,...i,ref:n})},`DialogDescription`)),ma=`DialogClose`,ha=j.forwardRef(Wi(function(e,n){let{__scopeDialog:r,...i}=e,a=Yi(ma,r);return t(Ai.button,{type:`button`,...i,ref:n,onClick:Nr(e.onClick,()=>a.onOpenChange(!1))})},`DialogClose`));function ga(e){return e?`open`:`closed`}Wi(ga,`getState`);function _a(...e){return be(A(e))}const va=N(null);function ya(){return I(va)}function ba(e){return e.startsWith(`agents/`)||e.startsWith(`documents/`)}function xa(e,t,n=`inline`){return`artifact:${e}:${t}:${n}`}function Sa(e){return`file:${e}`}const Ca=ne(()=>import(`react-vega`).then(({VegaEmbed:e})=>({default:e})));function wa({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 Ta(){return t(`output`,{className:`flex items-center justify-center w-full h-full`,children:t(At,{className:`w-5 h-5 animate-spin text-gray-500 dark:text-gray-400`})})}function Ea({isOpen:e,onClose:i,title:a,description:o,children:s}){let{t:c}=se();return t(Xi,{open:e,onOpenChange:e=>!e&&i(),children:n(ea,{children:[t(na,{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(oa,{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:i,children:[t(ha,{asChild:!0,children:t(r,{variant:`unstyled`,onClick:i,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(ln,{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:s}),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(da,{className:`text-base font-semibold text-gray-900 dark:text-gray-100`,children:a||c(`agent.dashboard`)}),o&&t(pa,{className:`text-sm text-gray-500 dark:text-gray-400 mt-0.5`,children:o})]})})]})]})})}function Da(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 Oa={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 ka(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Aa(e){return ka(e)}function ja(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(Na(t,r)||a&&Pa(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 Ma(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 Na(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(Na(n,t))return!0}return!1}function Pa(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 Fa(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)=>{Aa(e)&&n.push(...Fa(e,[...t,r,String(i)]))}):Aa(i)&&n.push(...Fa(i,[...t,r]))}return n}function Ia(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(!ka(n))break;i=n}let a=t[t.length-1],o=i[a];ka(o)&&(delete o.url,o.values=r)}return n}function La(e){let t={background:`transparent`,view:{stroke:`transparent`},range:{category:Oa.categorical,diverging:Oa.diverging,heatmap:Oa.purples,ramp:Oa.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 Ra=re(function({spec:i,artifactRunId:a}){let{t:o}=se(),{title:s,description:c,options:l}=i,u=i.spec,[d,f]=B(!1),[p,m]=B(!1),[h,g]=B(null),[_,v]=B(!1),y=z(null),b=z(null),x=z(null),{client:S}=ye(),C=ya(),w=z(S);w.current=S;let T=z(C);T.current=C;let[E,D]=B(null),[O,k]=B(!1),[A,j]=B(null),M=l?.mode||`chart`,N=M===`dashboard`,te=l?.enableFullscreen??N,P=l?.height||Da(u,M);L(()=>{let e=Fa(u);if(e.length===0){D(u),k(!1),j(null);return}a?console.info(`[VegaLiteChart] resolving artifacts with runId:`,a,e.map(e=>e.artifactPath)):console.warn(`[VegaLiteChart] artifact references found but artifactRunId is missing!`,{references:e.map(e=>e.artifactPath),artifactRunId:a});let t=!1;return k(!0),j(null),(async()=>{let n=new Map,r=w.current,i=T.current;for(let o of e)try{let e=o.path.join(`.`),t;if(a&&!ba(o.artifactPath)){let e=xa(a,o.artifactPath,`inline`);t=i?await i.getOrFetch(e,async()=>(await r.files.getArtifactDownloadUrl(a,o.artifactPath,`inline`)).url):(await r.files.getArtifactDownloadUrl(a,o.artifactPath,`inline`)).url}else{let e=Sa(o.artifactPath);t=i?await i.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||j(`Failed to load data from artifact: ${o.artifactPath}`);return}if(!t){let e=Ia(u,n);D(e),k(!1)}})(),()=>{t=!0}},[u,a]);let[ne,re]=B(!1),I=z(!1);L(()=>{let e=()=>{let e=document.documentElement.classList.contains(`dark`);e!==I.current&&(I.current=e,re(e))};e();let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},[]);let[ie,ae]=B(0),oe=z(0);L(()=>{if(!x.current)return;let e,t=new ResizeObserver(t=>{clearTimeout(e),e=setTimeout(()=>{let e=t[0]?.contentRect.width;e&&e!==oe.current&&(oe.current=e,ae(e))},100)});t.observe(x.current);let n=x.current.clientWidth;return oe.current=n,ae(n),()=>{clearTimeout(e),t.disconnect()}},[]);let ce=R(()=>Fa(u).length>0,[u]),le=R(()=>{if(ce&&!E)return null;let e=E||u;return e?(l?.parameterValues&&(e=Ma(e,l.parameterValues)),ja(e)):null},[E,u,ce,l?.parameterValues]),ue=F((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=>ue(e,i))}}if(e.vconcat&&Array.isArray(e.vconcat))return{...e,vconcat:e.vconcat.map(e=>ue(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=>ue(e,i))}}let n=e.width;return n===`container`||typeof n==`number`&&n>t?{...e,width:t}:e},[]),de=F((e,t=!1)=>{if(!le)return null;let n=La(ne),r=t?typeof window<`u`?Math.min(window.innerWidth-80,1400):1200:ie>0?ie-24:500,i=`vconcat`in le||`hconcat`in le||`concat`in le,a=i?{type:`pad`,contains:`padding`}:{type:`fit`,contains:`padding`},o=le;i&&r&&(o=ue(le,r));let c=o.width,l=i?void 0:c===`container`?r:c??r,{width:u,...d}=o;return{$schema:`https://vega.github.io/schema/vega-lite/v6.json`,...!i&&l?{width:l}:{},height:t?void 0:e,autosize:a,...i?o:d,...s&&!le.title?{title:s}:{},config:{...n,...le.config}}},[le,s,ne,ie,ue]),fe=F(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,_]),pe=F(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=`${s||`chart`}.png`,n.href=t,n.click()}catch(e){console.error(`Failed to export chart:`,e)}finally{f(!1)}}},[s,d,_]),me=F(e=>{y.current=e,g(null)},[]),he=F(e=>{b.current=e},[]),ge=F(e=>{console.error(`Vega-Lite rendering error:`,e),g(e instanceof Error?e.message:`Unknown error`)},[]),_e=F(()=>{v(e=>!e)},[]);L(()=>{g(null)},[u]);let ve=({className:e})=>n(`div`,{className:_a(`flex items-center gap-2`,e),children:[n(r,{variant:`unstyled`,onClick:fe,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:o(`agent.copyToClipboard`),children:[t(p?Xe:ft,{className:`w-3 h-3`}),o(p?`agent.copied`:`agent.copy`)]}),n(r,{variant:`unstyled`,onClick:pe,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:o(`agent.exportAsPng`),children:[t(mt,{className:`w-3 h-3`}),o(d?`agent.exporting`:`agent.export`)]}),te&&n(r,{variant:`unstyled`,onClick:_e,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:o(_?`agent.exitFullscreen`:`agent.fullscreen`),children:[t(_?Rt:Pt,{className:`w-3 h-3`}),o(_?`agent.exit`:`agent.fullscreen`)]})]});if(O||ce&&!E)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:s||`Chart`})}),t(`div`,{className:`flex items-center justify-center bg-gray-50 dark:bg-gray-800 rounded`,style:{width:`100%`,height:P},children:n(`div`,{className:`flex items-center gap-2 text-gray-500 dark:text-gray-400`,children:[t(At,{className:`w-5 h-5 animate-spin`}),t(`span`,{className:`text-sm`,children:`Loading data from artifacts...`})]})})]})});if(A)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:s||`Chart`})}),t(`div`,{style:{width:`100%`,height:P},children:t(wa,{error:A,chartTitle:s})})]})});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:s||`Chart`})}),t(`div`,{style:{width:`100%`,height:P},children:t(wa,{error:h,chartTitle:s})})]})});let be=de(P),xe=de(0,!0);return be?(typeof window<`u`&&localStorage.getItem(`DEBUG_VEGA_RENDERS`)&&console.log(`VegaLite rendering with spec:`,{title:s,hasData:!!be.data?.values,dataLength:be.data?.values?.length}),n(e,{children:[t(`div`,{className:_a(`bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm`,N&&`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:s||(N?`Dashboard`:`Chart`)}),N&&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(ve,{})]}),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:P,minWidth:0},children:t(ee,{fallback:t(Ta,{}),children:t(Ca,{spec:be,onEmbed:e=>me(e.view),onError:ge,options:{renderer:l?.renderer||`canvas`,actions:!1}})})})]})}),n(Ea,{isOpen:_,onClose:()=>v(!1),title:s||(N?`Dashboard`:`Chart`),description:c,children:[t(`div`,{className:`w-full h-full min-h-[calc(100vh-200px)]`,children:xe&&t(ee,{fallback:t(Ta,{}),children:t(Ca,{spec:xe,onEmbed:e=>he(e.view),onError:ge,options:{renderer:l?.renderer||`canvas`,actions:!1}})})}),t(`div`,{className:`absolute bottom-6 end-6`,children:t(ve,{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),za=M.createContext({});function Ba({children:e,artifactRunId:n,onProposalSelect:r,onProposalSubmit:i,MarkdownRenderer:a}){let o=R(()=>({artifactRunId:n,onProposalSelect:r,onProposalSubmit:i,MarkdownRenderer:a}),[n,r,i,a]);return t(za.Provider,{value:o,children:e})}function Va(){return M.useContext(za)}const Ha={chart:{icon:Je,label:`chart`,defaultHeight:200},mermaid:{icon:vt,label:`diagram`,defaultHeight:150},proposal:{icon:It,label:`options`,defaultHeight:100},code:{icon:ut,label:`code`,defaultHeight:80},image:{icon:wt,label:`image`,defaultHeight:150},link:{icon:Ot,label:`link`,defaultHeight:24},expand:{icon:mt,label:`content`,defaultHeight:100},table:{icon:en,label:`table`,defaultHeight:150},markdown:{icon:gt,label:`content`,defaultHeight:100},"fusion-fragment":{icon:ut,label:`fragment`,defaultHeight:150}};function U({type:e,error:i,onRetry:a,message:o,height:s}){let c=Ha[e],l=s??c.defaultHeight,u=e===`link`;if(i)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]}),a&&t(r,{variant:`unstyled`,onClick:a,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:o||`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:o||`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 Ua=class extends M.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(U,{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 Wa(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 Ga(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 Ka({content:e}){let{headers:r,rows:i}=R(()=>{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(U,{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 qa({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 Ja(e){return de.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:[`use`],FORBID_TAGS:[`foreignObject`]})}function Ya(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 Xa({content:e}){let n=R(()=>{let t=typeof e==`string`?e.trim():``;return t?Ya(Ja(t)):null},[e]);return n?t(`div`,{style:{margin:`16px 0`,width:`100%`,overflowX:`auto`},dangerouslySetInnerHTML:{__html:n}}):t(U,{type:`expand`,error:`Empty mockup`})}function Za({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 Qa({content:e,renderType:n,path:r,runId:i,contentType:a}){let{MarkdownRenderer:o}=Va();switch(R(()=>n===`auto`?Wa(e,r,a):n,[e,r,a,n])){case`chart`:{let n=Ga(e);return n?t(Ua,{type:`chart`,fallbackCode:JSON.stringify(e,null,2),children:t(Ra,{spec:n,artifactRunId:i})}):t(U,{type:`chart`,error:`Only Vega-Lite charts are supported. Recharts rendering has been retired.`})}case`vega-lite`:{let n=Ga(e);return n?t(Ua,{type:`chart`,fallbackCode:JSON.stringify(e,null,2),children:t(Ra,{spec:n,artifactRunId:i})}):t(U,{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:!!Ra}),n.template&&n.data?t(Ua,{type:`fusion-fragment`,fallbackCode:JSON.stringify(e,null,2),children:t(ue,{data:n.data,ChartComponent:Ra,artifactRunId:i,children:t(le,{code:JSON.stringify(n.template),data:n.data})})}):t(Ua,{type:`fusion-fragment`,fallbackCode:JSON.stringify(e,null,2),children:t(le,{code:JSON.stringify(e)})})}case`table`:return t(Ua,{type:`table`,fallbackCode:JSON.stringify(e,null,2),children:t(Ka,{content:e})});case`markdown`:{let n=typeof e==`string`?e:String(e);return t(Ua,{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(Ua,{type:`expand`,fallbackCode:typeof e==`string`?e:r,children:t(Xa,{content:e})});case`image`:return t(Ua,{type:`image`,fallbackCode:r,children:t(Za,{content:e,path:r})});default:return t(qa,{content:e,path:r})}}function $a(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}const eo=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,to=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,no={};function ro(e,t){return((t||no).jsx?to:eo).test(e)}const io=/[ \t\n\f\r]/g;function ao(e){return typeof e==`object`?e.type===`text`&&oo(e.value):oo(e)}function oo(e){return e.replace(io,``)===``}var so=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};so.prototype.normal={},so.prototype.property={},so.prototype.space=void 0;function co(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new so(n,r,t)}function lo(e){return e.toLowerCase()}var uo=class{constructor(e,t){this.attribute=t,this.property=e}};uo.prototype.attribute=``,uo.prototype.booleanish=!1,uo.prototype.boolean=!1,uo.prototype.commaOrSpaceSeparated=!1,uo.prototype.commaSeparated=!1,uo.prototype.defined=!1,uo.prototype.mustUseProperty=!1,uo.prototype.number=!1,uo.prototype.overloadedBoolean=!1,uo.prototype.property=``,uo.prototype.spaceSeparated=!1,uo.prototype.space=void 0;var fo=Ae({boolean:()=>W,booleanish:()=>G,commaOrSpaceSeparated:()=>go,commaSeparated:()=>ho,number:()=>K,overloadedBoolean:()=>mo,spaceSeparated:()=>q});let po=0;const W=_o(),G=_o(),mo=_o(),K=_o(),q=_o(),ho=_o(),go=_o();function _o(){return 2**++po}const vo=Object.keys(fo);var yo=class extends uo{constructor(e,t,n,r){let i=-1;if(super(e,t),bo(this,`space`,r),typeof n==`number`)for(;++i<vo.length;){let e=vo[i];bo(this,vo[i],(n&fo[e])===fo[e])}}};yo.prototype.defined=!0;function bo(e,t,n){n&&(e[t]=n)}function xo(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new yo(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[lo(r)]=r,n[lo(a.attribute)]=r}return new so(t,n,e.space)}const So=xo({properties:{ariaActiveDescendant:null,ariaAtomic:G,ariaAutoComplete:null,ariaBusy:G,ariaChecked:G,ariaColCount:K,ariaColIndex:K,ariaColSpan:K,ariaControls:q,ariaCurrent:null,ariaDescribedBy:q,ariaDetails:null,ariaDisabled:G,ariaDropEffect:q,ariaErrorMessage:null,ariaExpanded:G,ariaFlowTo:q,ariaGrabbed:G,ariaHasPopup:null,ariaHidden:G,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:q,ariaLevel:K,ariaLive:null,ariaModal:G,ariaMultiLine:G,ariaMultiSelectable:G,ariaOrientation:null,ariaOwns:q,ariaPlaceholder:null,ariaPosInSet:K,ariaPressed:G,ariaReadOnly:G,ariaRelevant:null,ariaRequired:G,ariaRoleDescription:q,ariaRowCount:K,ariaRowIndex:K,ariaRowSpan:K,ariaSelected:G,ariaSetSize:K,ariaSort:null,ariaValueMax:K,ariaValueMin:K,ariaValueNow:K,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Co(e,t){return t in e?e[t]:t}function wo(e,t){return Co(e,t.toLowerCase())}const To=xo({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:ho,acceptCharset:q,accessKey:q,action:null,allow:null,allowFullScreen:W,allowPaymentRequest:W,allowUserMedia:W,alpha:W,alt:null,as:null,async:W,autoCapitalize:null,autoComplete:q,autoFocus:W,autoPlay:W,blocking:q,capture:null,charSet:null,checked:W,cite:null,className:q,closedBy:null,colorSpace:null,cols:K,colSpan:K,command:null,commandFor:null,content:null,contentEditable:G,controls:W,controlsList:q,coords:K|ho,crossOrigin:null,data:null,dateTime:null,decoding:null,default:W,defer:W,dir:null,dirName:null,disabled:W,download:mo,draggable:G,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:W,formTarget:null,headers:q,height:K,hidden:mo,high:K,href:null,hrefLang:null,htmlFor:q,httpEquiv:q,id:null,imageSizes:null,imageSrcSet:null,inert:W,inputMode:null,integrity:null,is:null,isMap:W,itemId:null,itemProp:q,itemRef:q,itemScope:W,itemType:q,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:W,low:K,manifest:null,max:null,maxLength:K,media:null,method:null,min:null,minLength:K,multiple:W,muted:W,name:null,nonce:null,noModule:W,noValidate:W,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:W,optimum:K,pattern:null,ping:q,placeholder:null,playsInline:W,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:W,referrerPolicy:null,rel:q,required:W,reversed:W,rows:K,rowSpan:K,sandbox:q,scope:null,scoped:W,seamless:W,selected:W,shadowRootClonable:W,shadowRootCustomElementRegistry:W,shadowRootDelegatesFocus:W,shadowRootMode:null,shadowRootSerializable:W,shape:null,size:K,sizes:null,slot:null,span:K,spellCheck:G,src:null,srcDoc:null,srcLang:null,srcSet:null,start:K,step:null,style:null,tabIndex:K,target:null,title:null,translate:null,type:null,typeMustMatch:W,useMap:null,value:G,width:K,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:q,axis:null,background:null,bgColor:null,border:K,borderColor:null,bottomMargin:K,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:W,declare:W,event:null,face:null,frame:null,frameBorder:null,hSpace:K,leftMargin:K,link:null,longDesc:null,lowSrc:null,marginHeight:K,marginWidth:K,noResize:W,noHref:W,noShade:W,noWrap:W,object:null,profile:null,prompt:null,rev:null,rightMargin:K,rules:null,scheme:null,scrolling:G,standby:null,summary:null,text:null,topMargin:K,valueType:null,version:null,vAlign:null,vLink:null,vSpace:K,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:W,disablePictureInPicture:W,disableRemotePlayback:W,exportParts:ho,part:q,prefix:null,property:null,results:K,security:null,unselectable:null},space:`html`,transform:wo}),Eo=xo({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:go,accentHeight:K,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:K,amplitude:K,arabicForm:null,ascent:K,attributeName:null,attributeType:null,azimuth:K,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:K,by:null,calcMode:null,capHeight:K,className:q,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:K,diffuseConstant:K,direction:null,display:null,dur:null,divisor:K,dominantBaseline:null,download:W,dx:null,dy:null,edgeMode:null,editable:null,elevation:K,enableBackground:null,end:null,event:null,exponent:K,externalResourcesRequired:null,fill:null,fillOpacity:K,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:ho,g2:ho,glyphName:ho,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:K,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:K,horizOriginX:K,horizOriginY:K,id:null,ideographic:K,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:K,k:K,k1:K,k2:K,k3:K,k4:K,kernelMatrix:go,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:K,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:K,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:K,overlineThickness:K,paintOrder:null,panose1:null,path:null,pathLength:K,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:q,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:K,pointsAtY:K,pointsAtZ:K,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:go,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:go,rev:go,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:go,requiredFeatures:go,requiredFonts:go,requiredFormats:go,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:K,specularExponent:K,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:K,strikethroughThickness:K,string:null,stroke:null,strokeDashArray:go,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:K,strokeOpacity:K,strokeWidth:null,style:null,surfaceScale:K,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:go,tabIndex:K,tableValues:null,target:null,targetX:K,targetY:K,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:go,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:K,underlineThickness:K,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:K,values:null,vAlphabetic:K,vMathematical:K,vectorEffect:null,vHanging:K,vIdeographic:K,version:null,vertAdvY:K,vertOriginX:K,vertOriginY:K,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:K,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Co}),Do=xo({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()}}),Oo=xo({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:wo}),ko=xo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Ao={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`},jo=/[A-Z]/g,Mo=/-[a-z]/g,No=/^data[-\w.:]+$/i;function Po(e,t){let n=lo(t),r=t,i=uo;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&No.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Mo,Io);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Mo.test(e)){let n=e.replace(jo,Fo);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=yo}return new i(r,t)}function Fo(e){return`-`+e.toLowerCase()}function Io(e){return e.charAt(1).toUpperCase()}const Lo=co([So,To,Do,Oo,ko],`html`),Ro=co([So,Eo,Do,Oo,ko],`svg`);function zo(e){return e.join(` `).trim()}function Bo(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(Uo);t&&(n+=t.length);var i=e.lastIndexOf(Xo);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(Wo)}function u(e){var t;for(e||=[];t=d();)t!==!1&&e.push(t);return e}function d(){var t=a();if(Zo==e.charAt(0)&&Qo==e.charAt(1)){for(var n=2;$o!=e.charAt(n)&&(Qo!=e.charAt(n)||Zo!=e.charAt(n+1));)++n;if(n+=2,$o===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:es,comment:o})}}function f(){var e=a(),t=c(Go);if(t){if(d(),!c(Ko))return s(`property missing ':'`);var n=c(qo),r=e({type:ts,property:Vo(t[0].replace(Ho,$o)),value:n?Vo(n[0].replace(Ho,$o)):$o});return c(Jo),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 Vo(e){return e?e.replace(Yo,$o):$o}var Ho,Uo,Wo,Go,Ko,qo,Jo,Yo,Xo,Zo,Qo,$o,es,ts,ns=Oe((()=>{Ho=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Uo=/\n/g,Wo=/^\s*/,Go=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Ko=/^:\s*/,qo=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Jo=/^[;\s]*/,Yo=/^\s+|\s+$/g,Xo=`
332
+ `)),{type:n,value:r}}return typeof e==`number`||typeof e==`boolean`?{value:String(e),type:tr.Inline}:{value:e,type:tr.Object}}function rr({value:e,viewCode:n=!1}){let{t:r}=se();return e?t(`div`,{className:`relative w-full h-full flex flex-col`,children:n||!ir(e)?t(Gn,{data:e}):t(`div`,{className:`flex-1 min-h-0 overflow-auto`,children:t(Yn,{value:e})})}):t(`pre`,{className:`whitespace-pre-wrap`,children:r(`misc.noData`)})}function ir(e){return e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`?!0:Array.isArray(e)?e.every(ir):typeof e==`object`&&Object.values(e).every(ir)}const ar=new Set;function or(e){ar.has(`markdown`)||(ar.add(`markdown`),e.languages.registerFoldingRangeProvider(`markdown`,{provideFoldingRanges(e){let t=[],n=e.getLinesContent(),r=/^(#{1,6})\s/,i=[];for(let e=0;e<n.length;e++){let a=e+1,o=r.exec(n[e]);if(o){let e=o[1].length;for(;i.length>0&&i[i.length-1].level>=e;){let e=i.pop();e&&a-1>e.line&&t.push({start:e.line,end:a-1})}i.push({level:e,line:a})}}let a=n.length;for(;i.length>0;){let e=i.pop();e&&a>e.line&&t.push({start:e.line,end:a})}return t}}));for(let t of[`javascript`,`typescript`])ar.has(t)||(ar.add(t),e.languages.registerFoldingRangeProvider(t,{provideFoldingRanges(e){let t=e.getLinesContent(),n=/^(#{1,6})\s/,r=[],i=[],a=[],o=[],s=!1,c=!1,l=``;for(let e=0;e<t.length;e++){let u=e+1,d=t[e],f=s;for(let e=0;e<d.length;e++){let t=d[e];if(t===`\\`){e++;continue}if(c){t===l&&(c=!1);continue}if(s){t==="`"&&(s=!1);continue}if(t==="`"){s=!0;continue}if(t===`"`||t===`'`){c=!0,l=t;continue}if(t===`{`&&a.push(u),t===`}`&&a.length>0){let t=a.pop(),n=d.slice(e+1).trimStart().length>0?u-1:u;t!==void 0&&n>t&&r.push({start:t,end:n})}}if(f){let e=n.exec(d);if(e){let t=e[1].length;for(;o.length>0&&o[o.length-1].level>=t;){let e=o.pop();e&&u-1>e.line&&i.push({start:e.line,end:u-1})}o.push({level:t,line:u})}if(!s)for(;o.length>0;){let e=o.pop();e&&u>e.line&&i.push({start:e.line,end:u})}}}return[...r,...i]}}))}let sr=!1;function cr(e){sr||=(e.config({paths:{vs:`https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs`}}),!0)}let lr;function ur(){return lr??=import(`@monaco-editor/react`).then(e=>(cr(e.loader),e)).catch(e=>{throw lr=void 0,e}),lr}const dr=ne(()=>ur().then(({Editor:e})=>({default:e})));let fr;function pr(){if(!(typeof document>`u`)){if(!fr){let e=document.createElement(`div`);e.className=`monaco-editor`,e.style.position=`absolute`,e.style.top=`0`,e.style.left=`0`,e.style.zIndex=`10000`,document.body.appendChild(e),fr=e}return fr}}const mr=new Map;let hr=0;function gr(e){(e.languages.json?.jsonDefaults)?.setDiagnosticsOptions({validate:!0,enableSchemaRequest:!1,schemas:Array.from(mr.entries()).map(([e,t])=>({uri:`vertesia://schemas/${encodeURIComponent(e)}`,fileMatch:[e],schema:t}))})}var _r=class{VgetValue;VsetValue;constructor(e,t){this.VgetValue=e,this.VsetValue=t}getValue(){return this.VgetValue()}setValue(e){this.VsetValue(e||``)}};function vr({onChange:e,value:n,className:r,editorRef:i,language:a=`javascript`,path:o,debounceTimeout:s=0,options:c={},beforeMount:l,onMount:u,defaultValue:d,useCustomFolding:f=!1,jsonSchema:p}){let[m,h]=B(n||d||``),g=z(null),_=z(null),[v]=B(()=>p?`inmemory://vertesia/json/${++hr}.json`:void 0),y=o??v,{theme:b}=D(),x=b===`system`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:b,S=n||d||``,C=z(()=>m),w=z(e=>{h(e),g.current&&g.current.setValue(e)});L(()=>{C.current=()=>m},[m]),L(()=>(i&&(i.current=new _r(()=>C.current(),e=>w.current(e))),()=>{i&&(i.current=void 0)}),[i]);let T=R(()=>{if(e)return s>0?ce(t=>e(t),s):e},[e,s]),E=F(async(e,t)=>{let n=e.getModel();if(n)for(let r of n.getValue().matchAll(/```[\s\S]*?```/g)){let i=n.getPositionAt(r.index).lineNumber,a=n.getPositionAt(r.index+r[0].length).lineNumber;e.setSelection(new t.Selection(i,1,a,1)),await e.getAction(`editor.createFoldingRangeFromSelection`)?.run()}},[]),O=F(e=>{let t=e||``;if(h(t),T){let e={docChanged:!0,state:{doc:{toString:()=>t,length:t.length}}};T(e)}},[T]),A=F((e,t)=>{g.current=e,_.current=t,p&&y&&a===`json`&&(mr.set(y,p),gr(t)),f&&or(t),w.current=t=>{h(t),e.setValue(t)},t.editor.defineTheme(`errorLineTheme`,{base:x===`dark`?`vs-dark`:`vs`,inherit:!0,rules:[],colors:{"editorError.background":`#ffebee`,"editorError.border":`#f44336`}}),t.editor.setTheme(`errorLineTheme`),f&&setTimeout(()=>E(e,t),300),u?.(e,t)},[u,x,f,E,p,y,a]);L(()=>()=>{p&&y&&mr.delete(y)&&_.current&&gr(_.current)},[p,y]),L(()=>{g.current?.hasTextFocus()||h(e=>S===e?e:(g.current&&g.current.setValue(S),S))},[S]),L(()=>{if(!S||!f||!g.current||!_.current||g.current.hasTextFocus())return;let e=g.current,t=_.current,n=setTimeout(()=>E(e,t),300);return()=>clearTimeout(n)},[S,f,E]);let j={fontSize:14,fontFamily:`monospace`,minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:`on`,lineNumbers:`on`,folding:!0,lineDecorationsWidth:10,lineNumbersMinChars:3,automaticLayout:!0,formatOnPaste:!0,formatOnType:!0,tabSize:2,insertSpaces:!0,fixedOverflowWidgets:!0,overflowWidgetsDomNode:pr(),glyphMargin:!0,renderValidationDecorations:`on`,renderLineHighlight:`line`,hover:{enabled:`on`,delay:100},quickSuggestions:{other:!0,comments:!0,strings:!0},...c};return t(`div`,{className:k(r,`w-full h-full!`),children:t(ee,{fallback:t(`div`,{className:`h-full w-full`}),children:t(dr,{className:`h-full w-full`,height:`100%`,theme:x===`dark`?`vs-dark`:`light`,language:a,path:y,onChange:O,onMount:A,beforeMount:l,options:j,defaultValue:S})})})}function yr({value:e,onChange:r,onValidChange:i,readonly:a=!1,height:o=`200px`,placeholder:s,className:c}){let{theme:l}=D(),u=z(void 0),[d,f]=B(null),p=R(()=>{if(e==null)return s??`{}`;try{return JSON.stringify(e,null,2)}catch{return`{}`}},[e,s]),m=F(()=>{if(!u.current||a)return;let e=u.current.getValue();try{let t=JSON.parse(e);f(null),i?.(t)}catch{f(`Invalid JSON`)}},[a,i]);return n(`div`,{className:c,children:[t(`div`,{className:`border rounded overflow-hidden`,style:{height:o},children:t(vr,{defaultValue:p,editorRef:u,language:`json`,theme:l===`dark`?`vs-dark`:`vs`,onChange:m,options:a?{readOnly:!0,domReadOnly:!0}:void 0})}),d&&t(`p`,{className:`text-xs text-destructive mt-1`,children:d})]})}function br(e){if(!e.current)return null;try{return JSON.parse(e.current.getValue())}catch{return null}}function xr({title:e,viewCode:i,setViewCode:a}){return n(`div`,{className:`flex items-center gap-1 bg-muted mb-2 p-1 rounded`,children:[t(r,{variant:i?`ghost`:`primary`,size:`sm`,title:`Preview properties`,onClick:()=>a(!1),children:e}),t(r,{variant:i?`primary`:`ghost`,size:`sm`,title:`View in JSON format`,onClick:()=>a(!0),children:`JSON`})]})}function Sr(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[_-]+/g,` `).replace(/\s+/g,` `).trim().replace(/^./,e=>e.toUpperCase())}function Cr(r){return r==null?`Failed to query`:typeof r==`string`?r:Array.isArray(r)?r.length===0?`None`:r.some(e=>e&&typeof e==`object`)?t(e,{children:r.map((e,r)=>n(`div`,{className:`flex gap-1`,children:[n(`span`,{className:`text-xs align-top pe-2 font-medium`,children:[r+1,`:`]}),t(`span`,{className:`text-xs`,children:Cr(e)})]},`item-${r}`))}):r.map(e=>String(e)).join(`, `):typeof r==`object`?t(e,{children:Object.entries(r).map(([e,r])=>n(`div`,{className:`flex gap-1`,children:[n(`span`,{className:`text-xs align-top pe-2 font-medium`,children:[Sr(e),`:`]}),t(`span`,{className:`text-xs`,children:Cr(r)})]},e))}):String(r)}function wr({data:e,className:r}){let i=e?Object.entries(e):[];return t(`table`,{className:r||`mb-2 text-xs bg-muted rounded-sm w-full`,children:t(`tbody`,{children:i.map(([e,r])=>n(`tr`,{className:`align-top hover:bg-background border-y`,children:[t(`td`,{className:`align-top pe-4 p-2`,children:Sr(e)}),t(`td`,{className:`p-2`,children:Cr(r)})]},e))})})}const Tr=N(()=>({kind:`none`})),Er=Tr.Provider;function Dr(){return I(Tr)}const Or={store:`document`,document:`document`,collection:`collection`,interaction:`interaction`,prompt:`prompt`,agent:`agent`,workflow:`workflow`,process:`process`,run:`interaction_run`};function kr(e){let t=e.indexOf(`:`);if(t<=0)return;let n=e.slice(0,t);if(!Object.hasOwn(Or,n))return;let r=e.slice(t+1).trim().replace(/^\/+/,``);if(r)return{type:Or[n],id:r}}var Ar=Object.defineProperty,jr=(e,t)=>Ar(e,`name`,{value:t,configurable:!0}),Mr=!!(typeof window<`u`&&window.document&&window.document.createElement);function Nr(e,t,{checkForDefaultPrevented:n=!0}={}){return jr(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}jr(Nr,`composeEventHandlers`);function Pr(e){if(!Mr)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}jr(Pr,`getOwnerWindow`);function Fr(e){if(!Mr)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}jr(Fr,`getOwnerDocument`);function Ir(e,t=!1){let{activeElement:n}=Fr(e);if(!n?.nodeName)return null;if(Lr(n)&&n.contentDocument)return Ir(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Fr(n).getElementById(e);if(t)return t}}return n}jr(Ir,`getActiveElement`);function Lr(e){return e.tagName===`IFRAME`}jr(Lr,`isFrame`);var Rr=Object.defineProperty,zr=(e,t)=>Rr(e,`name`,{value:t,configurable:!0});function Br(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}zr(Br,`setRef`);function Vr(...e){return t=>{let n=!1,r=e.map(e=>{let r=Br(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():Br(e[t],null)}}}}zr(Vr,`composeRefs`);function Hr(...e){return j.useCallback(Vr(...e),e)}zr(Hr,`useComposedRefs`);var Ur=Object.defineProperty,Wr=(e,t)=>Ur(e,`name`,{value:t,configurable:!0});function Gr(e,n){let r=j.createContext(n);r.displayName=e+`Context`;let i=Wr(e=>{let{children:n,...i}=e,a=j.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=j.useContext(r);if(o)return o;if(n!==void 0)return n;if(!a)throw Error(`\`${t}\` must be used within \`${e}\``)}return Wr(a,`useContext`),[i,a]}Wr(Gr,`createContext`);function Kr(e,n=[]){let r=[];function i(n,i){let a=j.createContext(i);a.displayName=n+`Context`;let o=r.length;r=[...r,i];let s=Wr(n=>{let{scope:r,children:i,...s}=n,c=r?.[e]?.[o]||a,l=j.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=j.useContext(l);if(u)return u;if(i!==void 0)return i;if(!c)throw Error(`\`${t}\` must be used within \`${n}\``)}return Wr(c,`useContext`),[s,c]}Wr(i,`createContext`);let a=Wr(()=>{let t=r.map(e=>j.createContext(e));return Wr(function(n){let r=n?.[e]||t;return j.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return a.scopeName=e,[i,qr(a,...n)]}Wr(Kr,`createContextScope`);function qr(...e){let t=e[0];if(e.length===1)return t;let n=Wr(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Wr(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return j.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Wr(qr,`composeContextScopes`);var Jr=globalThis?.document?j.useLayoutEffect:()=>{},Yr=Object.defineProperty,Xr=(e,t)=>Yr(e,`name`,{value:t,configurable:!0}),Zr=j.useId||(()=>void 0),Qr=0;function $r(e){let[t,n]=j.useState(Zr());return Jr(()=>{e||n(e=>e??String(Qr++))},[e]),e||(t?`radix-${t}`:``)}Xr($r,`useId`);var ei=Object.defineProperty,ti=(e,t)=>ei(e,`name`,{value:t,configurable:!0}),ni=j.useEffectEvent,ri=j.useInsertionEffect;function ii(e){if(typeof ni==`function`)return ni(e);let t=j.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof ri==`function`?ri(()=>{t.current=e}):Jr(()=>{t.current=e}),j.useMemo(()=>((...e)=>t.current?.(...e)),[])}ti(ii,`useEffectEvent`);var ai=Object.defineProperty,oi=(e,t)=>ai(e,`name`,{value:t,configurable:!0}),si=j.useInsertionEffect||Jr;function ci({prop:e,defaultProp:t,onChange:n=oi(()=>{},`onChange`),caller:r}){let[i,a,o]=li({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,j.useCallback(t=>{if(s){let n=ui(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}oi(ci,`useControllableState`);function li({defaultProp:e,onChange:t}){let[n,r]=j.useState(e),i=j.useRef(n),a=j.useRef(t);return si(()=>{a.current=t},[t]),j.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}oi(li,`useUncontrolledState`);function ui(e){return typeof e==`function`}oi(ui,`isFunction`);var di=Symbol(`RADIX:SYNC_STATE`);function fi(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=ii(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=j.useReducer((t,n)=>{if(n.type===di)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=j.useRef(p);j.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=j.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return j.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:di,state:i})},[i,d.state,c]),[h,f]}oi(fi,`useControllableStateReducer`);var pi=Object.defineProperty,mi=(e,t)=>pi(e,`name`,{value:t,configurable:!0});function hi(e){let t=j.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Ci(r)&&typeof Di==`function`&&(r=Di(r._payload)),j.Children.forEach(r,e=>{if(xi(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Ci(n)&&typeof Di==`function`&&(n=Di(n._payload)),a=vi(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=j.cloneElement(a,void 0,s):!o&&j.Children.count(r)===1&&j.isValidElement(r)&&(a=r);let c=a?bi(a):void 0,l=Hr(n,c);if(!a){if(r||r===0)throw Error(o?Ei(e):Ti(e));return r}let u=yi(i,a.props??{});return a.type!==j.Fragment&&(u.ref=n?l:c),j.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}mi(hi,`createSlot`);var gi=Symbol.for(`radix.slottable`);function _i(e){let t=mi(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=gi,t}mi(_i,`createSlottable`);var vi=mi((e,t)=>{if(`child`in e.props){let t=e.props.child;return j.isValidElement(t)?j.cloneElement(t,void 0,e.props.children(t.props.children)):null}return j.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function yi(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}}mi(yi,`mergeProps`);function bi(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)}mi(bi,`getElementRef`);function xi(e){return j.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===gi}mi(xi,`isSlottable`);var Si=Symbol.for(`react.lazy`);function Ci(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Si&&`_payload`in e&&wi(e._payload)}mi(Ci,`isLazyComponent`);function wi(e){return typeof e==`object`&&!!e&&`then`in e}mi(wi,`isPromiseLike`);var Ti=mi(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Ei=mi(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Di=j.use,Oi=Object.defineProperty,ki=(e,t)=>Oi(e,`name`,{value:t,configurable:!0}),Ai=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,n)=>{let r=hi(`Primitive.${n}`),i=j.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 ji(e,t){e&&he.flushSync(()=>e.dispatchEvent(t))}ki(ji,`dispatchDiscreteCustomEvent`);var Mi=Object.defineProperty,Ni=j.forwardRef(((e,t)=>Mi(e,`name`,{value:t,configurable:!0}))(function(e,n){let{container:r,...i}=e,[a,o]=j.useState(!1);Jr(()=>o(!0),[]);let s=r||a&&globalThis?.document?.body;return s?he.createPortal(t(Ai.div,{...i,ref:n}),s):null},`Portal`)),Pi=Object.defineProperty,Fi=(e,t)=>Pi(e,`name`,{value:t,configurable:!0});function Ii(e,t){return j.useReducer((e,n)=>t[e][n]??e,e)}Fi(Ii,`useStateMachine`);var Li=Fi(e=>{let{present:t,children:n}=e,r=Ri(t),i=typeof n==`function`?n({present:r.isPresent}):j.Children.only(n),a=Bi(r.ref,Hi(i));return typeof n==`function`||r.isPresent?j.cloneElement(i,{ref:a}):null},`Presence`);function Ri(e){let[t,n]=j.useState(),r=j.useRef(null),i=j.useRef(e),a=j.useRef(`none`),o=j.useRef(void 0),[s,c]=Ii(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return j.useEffect(()=>{s===`mounted`?(a.current=o.current??Vi(r.current),o.current=void 0):a.current=`none`},[s]),Jr(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Vi(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]),Jr(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Fi(a=>{let o=Vi(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=Fi(e=>{e.target===t&&(a.current=Vi(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:j.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Vi(t)}else r.current=null;n(e)},[])}}Fi(Ri,`usePresence`);function zi(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Fi(zi,`setRef`);function Bi(...e){let t=j.useRef(e);return t.current=e,j.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=zi(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():zi(n[e],null)}}},[])}Fi(Bi,`useStableComposedRefs`);function Vi(e){return e?.animationName||`none`}Fi(Vi,`getAnimationName`);function Hi(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)}Fi(Hi,`getElementRef`);var Ui=Object.defineProperty,Wi=(e,t)=>Ui(e,`name`,{value:t,configurable:!0}),Gi=`Dialog`,[Ki,qi]=Kr(Gi),[Ji,Yi]=Ki(Gi),Xi=Wi(e=>{let{__scopeDialog:n,children:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=j.useRef(null),l=j.useRef(null),[u,d]=ci({prop:i,defaultProp:a??!1,onChange:o,caller:Gi}),[f,p]=j.useState(0),[m,h]=j.useState(0);return t(Ji,{scope:n,triggerRef:c,contentRef:l,contentId:$r(),titleId:$r(),descriptionId:$r(),titlePresent:f>0,descriptionPresent:m>0,setTitleCount:p,setDescriptionCount:h,open:u,onOpenChange:d,onOpenToggle:j.useCallback(()=>d(e=>!e),[d]),modal:s,children:r})},`Dialog`),Zi=`DialogPortal`,[Qi,$i]=Ki(Zi,{forceMount:void 0}),ea=Wi(e=>{let{__scopeDialog:n,forceMount:r,children:i,container:a}=e,o=Yi(Zi,n);return t(Qi,{scope:n,forceMount:r,children:j.Children.map(i,e=>t(Li,{present:r||o.open,children:t(Ni,{asChild:!0,container:a,children:e})}))})},`DialogPortal`),ta=`DialogOverlay`,na=j.forwardRef(Wi(function(e,n){let r=$i(ta,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=Yi(ta,e.__scopeDialog);return o.modal?t(Li,{present:i||o.open,children:t(ia,{...a,ref:n})}):null},`DialogOverlay`)),ra=hi(`DialogOverlay.RemoveScroll`),ia=j.forwardRef(Wi(function(e,n){let{__scopeDialog:r,...i}=e,a=Yi(ta,r),o=Hr(n,pe());return t(_e,{as:ra,allowPinchZoom:!0,shards:[a.contentRef],children:t(Ai.div,{"data-state":ga(a.open),...i,ref:o,style:{pointerEvents:`auto`,...i.style}})})},`DialogOverlayImpl`)),aa=`DialogContent`,oa=j.forwardRef(Wi(function(e,n){let r=$i(aa,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=Yi(aa,e.__scopeDialog);return t(Li,{present:i||o.open,children:o.modal?t(sa,{...a,ref:n}):t(ca,{...a,ref:n})})},`DialogContent`)),sa=j.forwardRef(Wi(function(e,n){let r=Yi(aa,e.__scopeDialog),i=j.useRef(null),a=Hr(n,r.contentRef,i);return j.useEffect(()=>{let e=i.current;if(e)return ve(e)},[]),t(la,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Nr(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Nr(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Nr(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),ca=j.forwardRef(Wi(function(e,n){let r=Yi(aa,e.__scopeDialog),i=j.useRef(!1),a=j.useRef(!1);return t(la,{...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`)),la=j.forwardRef(Wi(function(n,r){let{__scopeDialog:i,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,...c}=n,l=Yi(aa,i);return ge(),t(e,{children:t(me,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:s,children:t(fe,{role:`dialog`,id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":ga(l.open),...c,ref:r,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},`DialogContentImpl`)),ua=`DialogTitle`,da=j.forwardRef(Wi(function(e,n){let{__scopeDialog:r,...i}=e,a=Yi(ua,r),{setTitleCount:o}=a;return Jr(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),t(Ai.h2,{id:a.titleId,...i,ref:n})},`DialogTitle`)),fa=`DialogDescription`,pa=j.forwardRef(Wi(function(e,n){let{__scopeDialog:r,...i}=e,a=Yi(fa,r),{setDescriptionCount:o}=a;return Jr(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),t(Ai.p,{id:a.descriptionId,...i,ref:n})},`DialogDescription`)),ma=`DialogClose`,ha=j.forwardRef(Wi(function(e,n){let{__scopeDialog:r,...i}=e,a=Yi(ma,r);return t(Ai.button,{type:`button`,...i,ref:n,onClick:Nr(e.onClick,()=>a.onOpenChange(!1))})},`DialogClose`));function ga(e){return e?`open`:`closed`}Wi(ga,`getState`);function _a(...e){return be(A(e))}const va=N(null);function ya(){return I(va)}function ba(e){return e.startsWith(`agents/`)||e.startsWith(`documents/`)}function xa(e,t,n=`inline`){return`artifact:${e}:${t}:${n}`}function Sa(e){return`file:${e}`}const Ca=ne(()=>import(`react-vega`).then(({VegaEmbed:e})=>({default:e})));function wa({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 Ta(){return t(`output`,{className:`flex items-center justify-center w-full h-full`,children:t(Mt,{className:`w-5 h-5 animate-spin text-gray-500 dark:text-gray-400`})})}function Ea({isOpen:e,onClose:i,title:a,description:o,children:s}){let{t:c}=se();return t(Xi,{open:e,onOpenChange:e=>!e&&i(),children:n(ea,{children:[t(na,{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(oa,{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:i,children:[t(ha,{asChild:!0,children:t(r,{variant:`unstyled`,onClick:i,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(ln,{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:s}),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(da,{className:`text-base font-semibold text-gray-900 dark:text-gray-100`,children:a||c(`agent.dashboard`)}),o&&t(pa,{className:`text-sm text-gray-500 dark:text-gray-400 mt-0.5`,children:o})]})})]})]})})}function Da(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 Oa={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 ka(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Aa(e){return ka(e)}function ja(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(Na(t,r)||a&&Pa(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 Ma(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 Na(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(Na(n,t))return!0}return!1}function Pa(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 Fa(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)=>{Aa(e)&&n.push(...Fa(e,[...t,r,String(i)]))}):Aa(i)&&n.push(...Fa(i,[...t,r]))}return n}function Ia(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(!ka(n))break;i=n}let a=t[t.length-1],o=i[a];ka(o)&&(delete o.url,o.values=r)}return n}function La(e){let t={background:`transparent`,view:{stroke:`transparent`},range:{category:Oa.categorical,diverging:Oa.diverging,heatmap:Oa.purples,ramp:Oa.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 Ra=re(function({spec:i,artifactRunId:a}){let{t:o}=se(),{title:s,description:c,options:l}=i,u=i.spec,[d,f]=B(!1),[p,m]=B(!1),[h,g]=B(null),[_,v]=B(!1),y=z(null),b=z(null),x=z(null),{client:S}=ye(),C=ya(),w=z(S);w.current=S;let T=z(C);T.current=C;let[E,D]=B(null),[O,k]=B(!1),[A,j]=B(null),M=l?.mode||`chart`,N=M===`dashboard`,te=l?.enableFullscreen??N,P=l?.height||Da(u,M);L(()=>{let e=Fa(u);if(e.length===0){D(u),k(!1),j(null);return}a?console.info(`[VegaLiteChart] resolving artifacts with runId:`,a,e.map(e=>e.artifactPath)):console.warn(`[VegaLiteChart] artifact references found but artifactRunId is missing!`,{references:e.map(e=>e.artifactPath),artifactRunId:a});let t=!1;return k(!0),j(null),(async()=>{let n=new Map,r=w.current,i=T.current;for(let o of e)try{let e=o.path.join(`.`),t;if(a&&!ba(o.artifactPath)){let e=xa(a,o.artifactPath,`inline`);t=i?await i.getOrFetch(e,async()=>(await r.files.getArtifactDownloadUrl(a,o.artifactPath,`inline`)).url):(await r.files.getArtifactDownloadUrl(a,o.artifactPath,`inline`)).url}else{let e=Sa(o.artifactPath);t=i?await i.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||j(`Failed to load data from artifact: ${o.artifactPath}`);return}if(!t){let e=Ia(u,n);D(e),k(!1)}})(),()=>{t=!0}},[u,a]);let[ne,re]=B(!1),I=z(!1);L(()=>{let e=()=>{let e=document.documentElement.classList.contains(`dark`);e!==I.current&&(I.current=e,re(e))};e();let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},[]);let[ie,ae]=B(0),oe=z(0);L(()=>{if(!x.current)return;let e,t=new ResizeObserver(t=>{clearTimeout(e),e=setTimeout(()=>{let e=t[0]?.contentRect.width;e&&e!==oe.current&&(oe.current=e,ae(e))},100)});t.observe(x.current);let n=x.current.clientWidth;return oe.current=n,ae(n),()=>{clearTimeout(e),t.disconnect()}},[]);let ce=R(()=>Fa(u).length>0,[u]),le=R(()=>{if(ce&&!E)return null;let e=E||u;return e?(l?.parameterValues&&(e=Ma(e,l.parameterValues)),ja(e)):null},[E,u,ce,l?.parameterValues]),ue=F((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=>ue(e,i))}}if(e.vconcat&&Array.isArray(e.vconcat))return{...e,vconcat:e.vconcat.map(e=>ue(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=>ue(e,i))}}let n=e.width;return n===`container`||typeof n==`number`&&n>t?{...e,width:t}:e},[]),de=F((e,t=!1)=>{if(!le)return null;let n=La(ne),r=t?typeof window<`u`?Math.min(window.innerWidth-80,1400):1200:ie>0?ie-24:500,i=`vconcat`in le||`hconcat`in le||`concat`in le,a=i?{type:`pad`,contains:`padding`}:{type:`fit`,contains:`padding`},o=le;i&&r&&(o=ue(le,r));let c=o.width,l=i?void 0:c===`container`?r:c??r,{width:u,...d}=o;return{$schema:`https://vega.github.io/schema/vega-lite/v6.json`,...!i&&l?{width:l}:{},height:t?void 0:e,autosize:a,...i?o:d,...s&&!le.title?{title:s}:{},config:{...n,...le.config}}},[le,s,ne,ie,ue]),fe=F(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,_]),pe=F(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=`${s||`chart`}.png`,n.href=t,n.click()}catch(e){console.error(`Failed to export chart:`,e)}finally{f(!1)}}},[s,d,_]),me=F(e=>{y.current=e,g(null)},[]),he=F(e=>{b.current=e},[]),ge=F(e=>{console.error(`Vega-Lite rendering error:`,e),g(e instanceof Error?e.message:`Unknown error`)},[]),_e=F(()=>{v(e=>!e)},[]);L(()=>{g(null)},[u]);let ve=({className:e})=>n(`div`,{className:_a(`flex items-center gap-2`,e),children:[n(r,{variant:`unstyled`,onClick:fe,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:o(`agent.copyToClipboard`),children:[t(p?Xe:ft,{className:`w-3 h-3`}),o(p?`agent.copied`:`agent.copy`)]}),n(r,{variant:`unstyled`,onClick:pe,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:o(`agent.exportAsPng`),children:[t(mt,{className:`w-3 h-3`}),o(d?`agent.exporting`:`agent.export`)]}),te&&n(r,{variant:`unstyled`,onClick:_e,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:o(_?`agent.exitFullscreen`:`agent.fullscreen`),children:[t(_?Rt:Pt,{className:`w-3 h-3`}),o(_?`agent.exit`:`agent.fullscreen`)]})]});if(O||ce&&!E)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:s||`Chart`})}),t(`div`,{className:`flex items-center justify-center bg-gray-50 dark:bg-gray-800 rounded`,style:{width:`100%`,height:P},children:n(`div`,{className:`flex items-center gap-2 text-gray-500 dark:text-gray-400`,children:[t(Mt,{className:`w-5 h-5 animate-spin`}),t(`span`,{className:`text-sm`,children:`Loading data from artifacts...`})]})})]})});if(A)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:s||`Chart`})}),t(`div`,{style:{width:`100%`,height:P},children:t(wa,{error:A,chartTitle:s})})]})});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:s||`Chart`})}),t(`div`,{style:{width:`100%`,height:P},children:t(wa,{error:h,chartTitle:s})})]})});let be=de(P),xe=de(0,!0);return be?(typeof window<`u`&&localStorage.getItem(`DEBUG_VEGA_RENDERS`)&&console.log(`VegaLite rendering with spec:`,{title:s,hasData:!!be.data?.values,dataLength:be.data?.values?.length}),n(e,{children:[t(`div`,{className:_a(`bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm`,N&&`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:s||(N?`Dashboard`:`Chart`)}),N&&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(ve,{})]}),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:P,minWidth:0},children:t(ee,{fallback:t(Ta,{}),children:t(Ca,{spec:be,onEmbed:e=>me(e.view),onError:ge,options:{renderer:l?.renderer||`canvas`,actions:!1}})})})]})}),n(Ea,{isOpen:_,onClose:()=>v(!1),title:s||(N?`Dashboard`:`Chart`),description:c,children:[t(`div`,{className:`w-full h-full min-h-[calc(100vh-200px)]`,children:xe&&t(ee,{fallback:t(Ta,{}),children:t(Ca,{spec:xe,onEmbed:e=>he(e.view),onError:ge,options:{renderer:l?.renderer||`canvas`,actions:!1}})})}),t(`div`,{className:`absolute bottom-6 end-6`,children:t(ve,{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),za=M.createContext({});function Ba({children:e,artifactRunId:n,onProposalSelect:r,onProposalSubmit:i,MarkdownRenderer:a}){let o=R(()=>({artifactRunId:n,onProposalSelect:r,onProposalSubmit:i,MarkdownRenderer:a}),[n,r,i,a]);return t(za.Provider,{value:o,children:e})}function Va(){return M.useContext(za)}const Ha={chart:{icon:Je,label:`chart`,defaultHeight:200},mermaid:{icon:vt,label:`diagram`,defaultHeight:150},proposal:{icon:It,label:`options`,defaultHeight:100},code:{icon:ut,label:`code`,defaultHeight:80},image:{icon:wt,label:`image`,defaultHeight:150},link:{icon:Ot,label:`link`,defaultHeight:24},expand:{icon:mt,label:`content`,defaultHeight:100},table:{icon:en,label:`table`,defaultHeight:150},markdown:{icon:gt,label:`content`,defaultHeight:100},"fusion-fragment":{icon:ut,label:`fragment`,defaultHeight:150}};function U({type:e,error:i,onRetry:a,message:o,height:s}){let c=Ha[e],l=s??c.defaultHeight,u=e===`link`;if(i)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]}),a&&t(r,{variant:`unstyled`,onClick:a,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:o||`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:o||`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 Ua=class extends M.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(U,{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 Wa(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 Ga(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 Ka({content:e}){let{headers:r,rows:i}=R(()=>{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(U,{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 qa({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 Ja(e){return de.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:[`use`],FORBID_TAGS:[`foreignObject`]})}function Ya(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 Xa({content:e}){let n=R(()=>{let t=typeof e==`string`?e.trim():``;return t?Ya(Ja(t)):null},[e]);return n?t(`div`,{style:{margin:`16px 0`,width:`100%`,overflowX:`auto`},dangerouslySetInnerHTML:{__html:n}}):t(U,{type:`expand`,error:`Empty mockup`})}function Za({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 Qa({content:e,renderType:n,path:r,runId:i,contentType:a}){let{MarkdownRenderer:o}=Va();switch(R(()=>n===`auto`?Wa(e,r,a):n,[e,r,a,n])){case`chart`:{let n=Ga(e);return n?t(Ua,{type:`chart`,fallbackCode:JSON.stringify(e,null,2),children:t(Ra,{spec:n,artifactRunId:i})}):t(U,{type:`chart`,error:`Only Vega-Lite charts are supported. Recharts rendering has been retired.`})}case`vega-lite`:{let n=Ga(e);return n?t(Ua,{type:`chart`,fallbackCode:JSON.stringify(e,null,2),children:t(Ra,{spec:n,artifactRunId:i})}):t(U,{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:!!Ra}),n.template&&n.data?t(Ua,{type:`fusion-fragment`,fallbackCode:JSON.stringify(e,null,2),children:t(ue,{data:n.data,ChartComponent:Ra,artifactRunId:i,children:t(le,{code:JSON.stringify(n.template),data:n.data})})}):t(Ua,{type:`fusion-fragment`,fallbackCode:JSON.stringify(e,null,2),children:t(le,{code:JSON.stringify(e)})})}case`table`:return t(Ua,{type:`table`,fallbackCode:JSON.stringify(e,null,2),children:t(Ka,{content:e})});case`markdown`:{let n=typeof e==`string`?e:String(e);return t(Ua,{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(Ua,{type:`expand`,fallbackCode:typeof e==`string`?e:r,children:t(Xa,{content:e})});case`image`:return t(Ua,{type:`image`,fallbackCode:r,children:t(Za,{content:e,path:r})});default:return t(qa,{content:e,path:r})}}function $a(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}const eo=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,to=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,no={};function ro(e,t){return((t||no).jsx?to:eo).test(e)}const io=/[ \t\n\f\r]/g;function ao(e){return typeof e==`object`?e.type===`text`&&oo(e.value):oo(e)}function oo(e){return e.replace(io,``)===``}var so=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};so.prototype.normal={},so.prototype.property={},so.prototype.space=void 0;function co(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new so(n,r,t)}function lo(e){return e.toLowerCase()}var uo=class{constructor(e,t){this.attribute=t,this.property=e}};uo.prototype.attribute=``,uo.prototype.booleanish=!1,uo.prototype.boolean=!1,uo.prototype.commaOrSpaceSeparated=!1,uo.prototype.commaSeparated=!1,uo.prototype.defined=!1,uo.prototype.mustUseProperty=!1,uo.prototype.number=!1,uo.prototype.overloadedBoolean=!1,uo.prototype.property=``,uo.prototype.spaceSeparated=!1,uo.prototype.space=void 0;var fo=Ae({boolean:()=>W,booleanish:()=>G,commaOrSpaceSeparated:()=>go,commaSeparated:()=>ho,number:()=>K,overloadedBoolean:()=>mo,spaceSeparated:()=>q});let po=0;const W=_o(),G=_o(),mo=_o(),K=_o(),q=_o(),ho=_o(),go=_o();function _o(){return 2**++po}const vo=Object.keys(fo);var yo=class extends uo{constructor(e,t,n,r){let i=-1;if(super(e,t),bo(this,`space`,r),typeof n==`number`)for(;++i<vo.length;){let e=vo[i];bo(this,vo[i],(n&fo[e])===fo[e])}}};yo.prototype.defined=!0;function bo(e,t,n){n&&(e[t]=n)}function xo(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new yo(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[lo(r)]=r,n[lo(a.attribute)]=r}return new so(t,n,e.space)}const So=xo({properties:{ariaActiveDescendant:null,ariaAtomic:G,ariaAutoComplete:null,ariaBusy:G,ariaChecked:G,ariaColCount:K,ariaColIndex:K,ariaColSpan:K,ariaControls:q,ariaCurrent:null,ariaDescribedBy:q,ariaDetails:null,ariaDisabled:G,ariaDropEffect:q,ariaErrorMessage:null,ariaExpanded:G,ariaFlowTo:q,ariaGrabbed:G,ariaHasPopup:null,ariaHidden:G,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:q,ariaLevel:K,ariaLive:null,ariaModal:G,ariaMultiLine:G,ariaMultiSelectable:G,ariaOrientation:null,ariaOwns:q,ariaPlaceholder:null,ariaPosInSet:K,ariaPressed:G,ariaReadOnly:G,ariaRelevant:null,ariaRequired:G,ariaRoleDescription:q,ariaRowCount:K,ariaRowIndex:K,ariaRowSpan:K,ariaSelected:G,ariaSetSize:K,ariaSort:null,ariaValueMax:K,ariaValueMin:K,ariaValueNow:K,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Co(e,t){return t in e?e[t]:t}function wo(e,t){return Co(e,t.toLowerCase())}const To=xo({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:ho,acceptCharset:q,accessKey:q,action:null,allow:null,allowFullScreen:W,allowPaymentRequest:W,allowUserMedia:W,alpha:W,alt:null,as:null,async:W,autoCapitalize:null,autoComplete:q,autoFocus:W,autoPlay:W,blocking:q,capture:null,charSet:null,checked:W,cite:null,className:q,closedBy:null,colorSpace:null,cols:K,colSpan:K,command:null,commandFor:null,content:null,contentEditable:G,controls:W,controlsList:q,coords:K|ho,crossOrigin:null,data:null,dateTime:null,decoding:null,default:W,defer:W,dir:null,dirName:null,disabled:W,download:mo,draggable:G,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:W,formTarget:null,headers:q,height:K,hidden:mo,high:K,href:null,hrefLang:null,htmlFor:q,httpEquiv:q,id:null,imageSizes:null,imageSrcSet:null,inert:W,inputMode:null,integrity:null,is:null,isMap:W,itemId:null,itemProp:q,itemRef:q,itemScope:W,itemType:q,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:W,low:K,manifest:null,max:null,maxLength:K,media:null,method:null,min:null,minLength:K,multiple:W,muted:W,name:null,nonce:null,noModule:W,noValidate:W,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:W,optimum:K,pattern:null,ping:q,placeholder:null,playsInline:W,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:W,referrerPolicy:null,rel:q,required:W,reversed:W,rows:K,rowSpan:K,sandbox:q,scope:null,scoped:W,seamless:W,selected:W,shadowRootClonable:W,shadowRootCustomElementRegistry:W,shadowRootDelegatesFocus:W,shadowRootMode:null,shadowRootSerializable:W,shape:null,size:K,sizes:null,slot:null,span:K,spellCheck:G,src:null,srcDoc:null,srcLang:null,srcSet:null,start:K,step:null,style:null,tabIndex:K,target:null,title:null,translate:null,type:null,typeMustMatch:W,useMap:null,value:G,width:K,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:q,axis:null,background:null,bgColor:null,border:K,borderColor:null,bottomMargin:K,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:W,declare:W,event:null,face:null,frame:null,frameBorder:null,hSpace:K,leftMargin:K,link:null,longDesc:null,lowSrc:null,marginHeight:K,marginWidth:K,noResize:W,noHref:W,noShade:W,noWrap:W,object:null,profile:null,prompt:null,rev:null,rightMargin:K,rules:null,scheme:null,scrolling:G,standby:null,summary:null,text:null,topMargin:K,valueType:null,version:null,vAlign:null,vLink:null,vSpace:K,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:W,disablePictureInPicture:W,disableRemotePlayback:W,exportParts:ho,part:q,prefix:null,property:null,results:K,security:null,unselectable:null},space:`html`,transform:wo}),Eo=xo({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:go,accentHeight:K,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:K,amplitude:K,arabicForm:null,ascent:K,attributeName:null,attributeType:null,azimuth:K,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:K,by:null,calcMode:null,capHeight:K,className:q,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:K,diffuseConstant:K,direction:null,display:null,dur:null,divisor:K,dominantBaseline:null,download:W,dx:null,dy:null,edgeMode:null,editable:null,elevation:K,enableBackground:null,end:null,event:null,exponent:K,externalResourcesRequired:null,fill:null,fillOpacity:K,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:ho,g2:ho,glyphName:ho,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:K,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:K,horizOriginX:K,horizOriginY:K,id:null,ideographic:K,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:K,k:K,k1:K,k2:K,k3:K,k4:K,kernelMatrix:go,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:K,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:K,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:K,overlineThickness:K,paintOrder:null,panose1:null,path:null,pathLength:K,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:q,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:K,pointsAtY:K,pointsAtZ:K,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:go,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:go,rev:go,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:go,requiredFeatures:go,requiredFonts:go,requiredFormats:go,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:K,specularExponent:K,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:K,strikethroughThickness:K,string:null,stroke:null,strokeDashArray:go,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:K,strokeOpacity:K,strokeWidth:null,style:null,surfaceScale:K,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:go,tabIndex:K,tableValues:null,target:null,targetX:K,targetY:K,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:go,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:K,underlineThickness:K,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:K,values:null,vAlphabetic:K,vMathematical:K,vectorEffect:null,vHanging:K,vIdeographic:K,version:null,vertAdvY:K,vertOriginX:K,vertOriginY:K,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:K,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Co}),Do=xo({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()}}),Oo=xo({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:wo}),ko=xo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Ao={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`},jo=/[A-Z]/g,Mo=/-[a-z]/g,No=/^data[-\w.:]+$/i;function Po(e,t){let n=lo(t),r=t,i=uo;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&No.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Mo,Io);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Mo.test(e)){let n=e.replace(jo,Fo);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=yo}return new i(r,t)}function Fo(e){return`-`+e.toLowerCase()}function Io(e){return e.charAt(1).toUpperCase()}const Lo=co([So,To,Do,Oo,ko],`html`),Ro=co([So,Eo,Do,Oo,ko],`svg`);function zo(e){return e.join(` `).trim()}function Bo(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(Uo);t&&(n+=t.length);var i=e.lastIndexOf(Xo);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(Wo)}function u(e){var t;for(e||=[];t=d();)t!==!1&&e.push(t);return e}function d(){var t=a();if(Zo==e.charAt(0)&&Qo==e.charAt(1)){for(var n=2;$o!=e.charAt(n)&&(Qo!=e.charAt(n)||Zo!=e.charAt(n+1));)++n;if(n+=2,$o===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:es,comment:o})}}function f(){var e=a(),t=c(Go);if(t){if(d(),!c(Ko))return s(`property missing ':'`);var n=c(qo),r=e({type:ts,property:Vo(t[0].replace(Ho,$o)),value:n?Vo(n[0].replace(Ho,$o)):$o});return c(Jo),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 Vo(e){return e?e.replace(Yo,$o):$o}var Ho,Uo,Wo,Go,Ko,qo,Jo,Yo,Xo,Zo,Qo,$o,es,ts,ns=Oe((()=>{Ho=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Uo=/\n/g,Wo=/^\s*/,Go=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Ko=/^:\s*/,qo=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Jo=/^[;\s]*/,Yo=/^\s+|\s+$/g,Xo=`
333
333
  `,Zo=`/`,Qo=`*`,$o=``,es=`comment`,ts=`declaration`})),rs=Ae({default:()=>is});function is(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=Bo(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 as=Oe((()=>{ns()})),os=ke((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))}})),ss=ke(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})((as(),Ne(rs))),r=os();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 cs=us(`end`),ls=us(`start`);function us(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 ds(e){let t=ls(e),n=cs(e);if(t&&n)return{start:t,end:n}}function fs(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?ms(e.position):`start`in e||`end`in e?ms(e):`line`in e||`column`in e?ps(e):``}function ps(e){return hs(e&&e.line)+`:`+hs(e&&e.column)}function ms(e){return ps(e&&e.start)+`-`+ps(e&&e.end)}function hs(e){return e&&typeof e==`number`?e:1}var gs=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=fs(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}};gs.prototype.file=``,gs.prototype.name=``,gs.prototype.reason=``,gs.prototype.message=``,gs.prototype.stack=``,gs.prototype.column=void 0,gs.prototype.line=void 0,gs.prototype.ancestors=void 0,gs.prototype.cause=void 0,gs.prototype.fatal=void 0,gs.prototype.place=void 0,gs.prototype.ruleId=void 0,gs.prototype.source=void 0;var _s=Me(ss(),1);const vs={}.hasOwnProperty,ys=new Map,bs=/[A-Z]/g,xs=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Ss=new Set([`td`,`th`]),Cs=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function ws(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=Fs(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=Ps(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`?Ro:Lo,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Ts(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Ts(e,t,n){if(t.type===`element`)return Es(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Ds(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return ks(e,t,n);if(t.type===`mdxjsEsm`)return Os(e,t);if(t.type===`root`)return As(e,t,n);if(t.type===`text`)return js(e,t)}function Es(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Ro,e.schema=i),e.ancestors.push(t);let a=Vs(e,t.tagName,!1),o=Is(e,t),s=Rs(e,t);return xs.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!ao(e)})),Ms(e,o,a,t),Ns(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Ds(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)}Hs(e,t.position)}function Os(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Hs(e,t.position)}function ks(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Ro,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Vs(e,t.name,!0),o=Ls(e,t),s=Rs(e,t);return Ms(e,o,a,t),Ns(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function As(e,t,n){let r={};return Ns(r,Rs(e,t)),e.create(t,e.Fragment,r,n)}function js(e,t){return t.value}function Ms(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ns(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Ps(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 Fs(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=ls(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 Is(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&vs.call(t.properties,i)){let a=zs(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Ss.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 Ls(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 Hs(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 Hs(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Rs(e,t){let n=[],r=-1,i=e.passKeys?new Map:ys;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=Ts(e,a,o);s!==void 0&&n.push(s)}return n}function zs(e,t,n){let r=Po(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?$a(n):zo(n)),r.property===`style`){let t=typeof n==`object`?n:Bs(e,String(n));return e.stylePropertyNameCase===`css`&&(t=Us(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Ao[r.property]||r.property:r.attribute,n]}}function Bs(e,t){try{return(0,_s.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new gs("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=Cs+`#cannot-parse-style-attribute`,r}}function Vs(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=ro(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=ro(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return vs.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Hs(e)}function Hs(e,t){let n=new gs("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=Cs+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function Us(e){let t={},n;for(n in e)vs.call(e,n)&&(t[Ws(n)]=e[n]);return t}function Ws(e){let t=e.replace(bs,Gs);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Gs(e){return`-`+e.toLowerCase()}const Ks={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`]},qs={};function Js(e,t){let n=t||qs;return Ys(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function Ys(e,t,n){if(Zs(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 Xs(e.children,t,n)}return Array.isArray(e)?Xs(e,t,n):``}function Xs(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Ys(e[i],t,n);return r.join(``)}function Zs(e){return!!(e&&typeof e==`object`)}const Qs=document.createElement(`i`);function $s(e){let t=`&`+e+`;`;Qs.innerHTML=t;let n=Qs.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function J(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 ec(e,t){return e.length>0?(J(e,e.length,0,t),e):t}const tc={}.hasOwnProperty;function nc(e){let t={},n=-1;for(;++n<e.length;)rc(t,e[n]);return t}function rc(e,t){let n;for(n in t){let r=(tc.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){tc.call(r,a)||(r[a]=[]);let e=i[a];ic(r[a],Array.isArray(e)?e:e?[e]:[])}}}function ic(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);J(e,0,0,r)}function ac(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 oc(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}const sc=gc(/[A-Za-z]/),cc=gc(/[\dA-Za-z]/),lc=gc(/[#-'*+\--9=?A-Z^-~]/);function uc(e){return e!==null&&(e<32||e===127)}const dc=gc(/\d/),fc=gc(/[\dA-Fa-f]/),pc=gc(/[!-/:-@[-`{-~]/);function Y(e){return e!==null&&e<-2}function X(e){return e!==null&&(e<0||e===32)}function Z(e){return e===-2||e===-1||e===32}const mc=gc(/\p{P}|\p{S}/u),hc=gc(/\s/);function gc(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function _c(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&cc(e.charCodeAt(n+1))&&cc(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 Q(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Z(r)?(e.enter(n),s(r)):t(r)}function s(r){return Z(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}const vc={tokenize:yc};function yc(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`),Q(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 Y(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}const bc={tokenize:Sc},xc={tokenize:Cc};function Sc(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 J(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(xc,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(xc,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 Y(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++;J(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 Cc(e,t,n){return Q(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function wc(e){if(e===null||X(e)||hc(e))return 1;if(mc(e))return 2}function Tc(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 Ec={name:`attention`,resolveAll:Dc,tokenize:Oc};function Dc(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};kc(d,-c),kc(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=ec(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=ec(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=ec(l,Tc(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=ec(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=ec(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,J(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 Oc(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=wc(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=wc(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 kc(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Ac={name:`autolink`,tokenize:jc};function jc(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 sc(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||cc(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||cc(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||uc(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):lc(t)?(e.consume(t),l):n(t)}function u(e){return cc(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||cc(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}const Mc={partial:!0,tokenize:Nc};function Nc(e,t,n){return r;function r(t){return Z(t)?Q(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Y(e)?t(e):n(e)}}const Pc={continuation:{tokenize:Ic},exit:Lc,name:`blockQuote`,tokenize:Fc};function Fc(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 Z(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Ic(e,t,n){let r=this;return i;function i(t){return Z(t)?Q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Pc,t,n)(r)}}function Lc(e){e.exit(`blockQuote`)}const Rc={name:`characterEscape`,tokenize:zc};function zc(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 pc(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}const Bc={name:`characterReference`,tokenize:Vc};function Vc(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=cc,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=fc,u):(e.enter(`characterReferenceValue`),a=7,o=dc,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===cc&&!$s(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 Hc={partial:!0,tokenize:Gc},Uc={concrete:!0,name:`codeFenced`,tokenize:Wc};function Wc(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`),Z(t)?Q(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Y(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Hc,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Q(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Y(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Y(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&&Z(t)?Q(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Y(t)?e.check(Hc,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Y(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`),Z(t)?Q(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`),Z(t)?Q(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Y(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Gc(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 Kc={name:`codeIndented`,tokenize:Jc},qc={partial:!0,tokenize:Yc};function Jc(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Q(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):Y(t)?e.attempt(qc,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Yc(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Q(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):Y(e)?i(e):n(e)}}const Xc={name:`codeText`,previous:Qc,resolve:Zc,tokenize:$c};function Zc(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 Qc(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function $c(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)):Y(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||Y(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 el=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&&tl(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),tl(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),tl(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);tl(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);tl(this.left,t.reverse())}}}};function tl(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 nl(e){let t={},n=-1,r,i,a,o,s,c,l,u=new el(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,rl(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 J(e,0,1/0,u.slice(0)),!l}function rl(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 il={resolve:ol,tokenize:sl},al={partial:!0,tokenize:cl};function ol(e){return nl(e),e}function sl(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):Y(t)?e.check(al,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 cl(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,a,`linePrefix`)}function a(i){if(i===null||Y(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 ll(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||uc(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||Y(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||X(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||uc(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 ul(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):Y(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||Y(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Z(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function dl(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):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Y(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 fl(e,t){let n;return r;function r(i){return Y(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Z(i)?Q(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}const pl={name:`definition`,tokenize:hl},ml={partial:!0,tokenize:gl};function hl(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return ul.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=oc(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 X(t)?fl(e,l)(t):l(t)}function l(t){return ll(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(ml,d,d)(t)}function d(t){return Z(t)?Q(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Y(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function gl(e,t,n){return r;function r(t){return X(t)?fl(e,i)(t):n(t)}function i(t){return dl(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Z(t)?Q(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Y(e)?t(e):n(e)}}const _l={name:`hardBreakEscape`,tokenize:vl};function vl(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Y(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}const yl={name:`headingAtx`,resolve:bl,tokenize:xl};function bl(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`},J(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function xl(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||X(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Y(n)?(e.exit(`atxHeading`),t(n)):Z(n)?Q(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||X(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}const Sl=`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(`.`),Cl=[`pre`,`script`,`style`,`textarea`],wl={concrete:!0,name:`htmlFlow`,resolveTo:Dl,tokenize:Ol},Tl={partial:!0,tokenize:Al},El={partial:!0,tokenize:kl};function Dl(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 Ol(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:P):sc(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):sc(a)?(e.consume(a),i=4,r.interrupt?t:P):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:P):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 sc(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||X(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Cl.includes(l)?(i=1,r.interrupt?t(s):O(s)):Sl.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||cc(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 Z(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||sc(t)?(e.consume(t),b):Z(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||cc(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Z(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):Z(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Y(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||X(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Z(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Y(t)?O(t):Z(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),ee):t===62&&i===4?(e.consume(t),ne):t===63&&i===3?(e.consume(t),P):t===93&&i===5?(e.consume(t),te):Y(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Tl,re,k)(t)):t===null||Y(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(El,A,re)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||Y(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),P):O(t)}function ee(t){return t===47?(e.consume(t),o=``,N):O(t)}function N(t){if(t===62){let n=o.toLowerCase();return Cl.includes(n)?(e.consume(t),ne):O(t)}return sc(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),N):O(t)}function te(t){return t===93?(e.consume(t),P):O(t)}function P(t){return t===62?(e.consume(t),ne):t===45&&i===2?(e.consume(t),P):O(t)}function ne(t){return t===null||Y(t)?(e.exit(`htmlFlowData`),re(t)):(e.consume(t),ne)}function re(n){return e.exit(`htmlFlow`),t(n)}}function kl(e,t,n){let r=this;return i;function i(t){return Y(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 Al(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Mc,t,n)}}const jl={name:`htmlText`,tokenize:Ml};function Ml(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):sc(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):sc(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):Y(t)?(o=d,ee(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):Y(t)?(o=h,ee(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):Y(t)?(o=v,ee(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Y(t)?(o=y,ee(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return sc(t)?(e.consume(t),S):n(t)}function S(t){return t===45||cc(t)?(e.consume(t),S):C(t)}function C(t){return Y(t)?(o=C,ee(t)):Z(t)?(e.consume(t),C):M(t)}function w(t){return t===45||cc(t)?(e.consume(t),w):t===47||t===62||X(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||sc(t)?(e.consume(t),E):Y(t)?(o=T,ee(t)):Z(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||cc(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Y(t)?(o=D,ee(t)):Z(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):Y(t)?(o=O,ee(t)):Z(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):Y(t)?(o=k,ee(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||X(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||X(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function ee(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),N}function N(t){return Z(t)?Q(e,te,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):te(t)}function te(t){return e.enter(`htmlTextData`),o(t)}}const Nl={name:`labelEnd`,resolveAll:Ll,resolveTo:Rl,tokenize:zl},Pl={tokenize:Bl},Fl={tokenize:Vl},Il={tokenize:Hl};function Ll(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&&J(e,0,e.length,n),e}function Rl(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=ec(s,e.slice(a+1,a+r+3)),s=ec(s,[[`enter`,u,t]]),s=ec(s,Tc(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=ec(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=ec(s,e.slice(o+1)),s=ec(s,[[`exit`,c,t]]),J(e,a,e.length,s),e}function zl(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(oc(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(Pl,u,o?u:d)(t):t===91?e.attempt(Fl,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Il,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Bl(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 X(t)?fl(e,a)(t):a(t)}function a(t){return t===41?u(t):ll(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return X(t)?fl(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?dl(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return X(t)?fl(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 Vl(e,t,n){let r=this;return i;function i(t){return ul.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(oc(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Hl(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 Ul={name:`labelStartImage`,resolveAll:Nl.resolveAll,tokenize:Wl};function Wl(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 Gl={name:`labelStartLink`,resolveAll:Nl.resolveAll,tokenize:Kl};function Kl(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 ql={name:`lineEnding`,tokenize:Jl};function Jl(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}}const Yl={name:`thematicBreak`,tokenize:Xl};function Xl(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||Y(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Z(t)?Q(e,s,`whitespace`)(t):s(t))}}const Zl={continuation:{tokenize:tu},exit:ru,name:`list`,tokenize:eu},Ql={partial:!0,tokenize:iu},$l={partial:!0,tokenize:nu};function eu(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:dc(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(Yl,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 dc(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(Mc,r.interrupt?n:u,e.attempt(Ql,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Z(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 tu(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Mc,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Q(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Z(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($l,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Q(e,e.attempt(Zl,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function nu(e,t,n){let r=this;return Q(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 ru(e){e.exit(this.containerState.type)}function iu(e,t,n){let r=this;return Q(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!Z(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}const au={name:`setextUnderline`,resolveTo:ou,tokenize:su};function ou(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 su(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`),Z(t)?Q(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Y(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}const cu={tokenize:lu};function lu(e){let t=this,n=e.attempt(Mc,r,e.attempt(this.parser.constructs.flowInitial,i,Q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(il,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 uu={resolveAll:mu()},du=pu(`string`),fu=pu(`text`);function pu(e){return{resolveAll:mu(e===`text`?hu: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 mu(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 hu(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 gu=Ae({attentionMarkers:()=>wu,contentInitial:()=>vu,disable:()=>Tu,document:()=>_u,flow:()=>bu,flowInitial:()=>yu,insideSpan:()=>Cu,string:()=>xu,text:()=>Su});const _u={42:Zl,43:Zl,45:Zl,48:Zl,49:Zl,50:Zl,51:Zl,52:Zl,53:Zl,54:Zl,55:Zl,56:Zl,57:Zl,62:Pc},vu={91:pl},yu={[-2]:Kc,[-1]:Kc,32:Kc},bu={35:yl,42:Yl,45:[au,Yl],60:wl,61:au,95:Yl,96:Uc,126:Uc},xu={38:Bc,92:Rc},Su={[-5]:ql,[-4]:ql,[-3]:ql,33:Ul,38:Bc,42:Ec,60:[Ac,jl],91:Gl,92:[_l,Rc],93:Nl,95:Ec,96:Xc},Cu={null:[Ec,uu]},wu={null:[42,95]},Tu={null:[]};function Eu(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=ec(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Tc(a,l.events,l),l.events):[]}function f(e,t){return Ou(p(e),t)}function p(e){return Du(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){Y(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&&J(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 Du(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 Ou(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=`
334
334
  `;break;case-3:o=`\r
335
335
  `;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 ku(e){let t={constructs:nc([gu,...(e||{}).extensions||[]]),content:n(vc),defined:[],document:n(bc),flow:n(cu),lazy:{},string:n(du),text:n(fu)};return t;function n(e){return n;function n(n){return Eu(t,e,n)}}}function Au(e){for(;!nl(e););return e}const ju=/[\0\t\n\r]/g;function Mu(){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(ju.lastIndex=u,c=ju.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 Nu=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Pu(e){return e.replace(Nu,Fu)}function Fu(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return ac(n.slice(t?2:1),t?16:10)}return $s(n)||e}const Iu={}.hasOwnProperty;function Lu(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),Ru(n)(Au(ku(n).document().write(Mu()(e,t,!0))))}function Ru(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(me),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ue),blockQuote:a(ae),characterEscape:T,characterReference:T,codeFenced:a(oe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(oe,o),codeText:a(se,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(ce),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(le),hardBreakEscape:a(de),hardBreakTrailing:a(de),htmlFlow:a(fe,o),htmlFlowData:T,htmlText:a(fe,o),htmlTextData:T,image:a(pe),label:o,link:a(me),listItem:a(ge),listItemValue:f,listOrdered:a(he,d),listUnordered:a(he),paragraph:a(_e),reference:F,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ue),strong:a(ve),thematicBreak:a(be)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:B,autolinkProtocol:z,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:L,characterReferenceMarkerNumeric:L,characterReferenceValue:ie,characterReference:R,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(ee),label:te,labelText:N,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:I,resourceDestinationString:P,resourceTitleString:ne,resource:re,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};Bu(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]];Iu.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]||Hu).call(a,void 0,e[0])}for(r.position={start:zu(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:zu(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:zu(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]||Hu).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+fs({start:e.start,end:e.end})+`): it’s not open`);n.position.end=zu(e.end)}function u(){return Js(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=oc(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=ye(),n.position={start:zu(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=zu(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=zu(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 ee(){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(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Pu(t),n.identifier=oc(t).toLowerCase()}function te(){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 P(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function re(){this.data.inReference=void 0}function F(){this.data.referenceType=`collapsed`}function I(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=oc(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function L(e){this.data.characterReferenceType=e.type}function ie(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=ac(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=$s(t);let i=this.stack[this.stack.length-1];i.value+=r}function R(e){let t=this.stack.pop();t.position.end=zu(e.end)}function z(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function B(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ae(){return{type:`blockquote`,children:[]}}function oe(){return{type:`code`,lang:null,meta:null,value:``}}function se(){return{type:`inlineCode`,value:``}}function ce(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function le(){return{type:`emphasis`,children:[]}}function ue(){return{type:`heading`,depth:0,children:[]}}function de(){return{type:`break`}}function fe(){return{type:`html`,value:``}}function pe(){return{type:`image`,title:null,url:``,alt:null}}function me(){return{type:`link`,title:null,url:``,children:[]}}function he(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function ge(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function _e(){return{type:`paragraph`,children:[]}}function ve(){return{type:`strong`,children:[]}}function ye(){return{type:`text`,value:``}}function be(){return{type:`thematicBreak`}}}function zu(e){return{line:e.line,column:e.column,offset:e.offset}}function Bu(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Bu(e,r):Vu(e,r)}}function Vu(e,t){let n;for(n in t)if(Iu.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 Hu(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+fs({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+fs({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+fs({start:t.start,end:t.end})+`) is still open`)}function Uu(e){let t=this;t.parser=n;function n(n){return Lu(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Wu(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 Gu(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
@@ -379,7 +379,7 @@ const qe={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16
379
379
  `)){let e=Xy.exec(a);if(e){let t=e[1]?.[0];r?t===r&&(r=null):r=t??null,i+=a.length+1;continue}if(!r){let e=Yy.exec(a);if(e){let t=e[1]?.length??1,r=e[2]?.trim();r&&(n.length=t-1,n[t-1]=r)}}if(i+=a.length+1,i>t)break}return n.filter(e=>!!e)}function nb(e,t,n,r){if(!t)return 0;let i=0,a=e.indexOf(t);for(;a>=0&&a<n;){let n=tb(e,a);n.length===r.length&&n.every((e,t)=>e===r[t])&&i++,a=e.indexOf(t,a+Math.max(1,t.length))}return i}function rb(e){return e.kind===`store_document`?`store:${e.document_id}`:`artifact:${e.path} (run ${e.run_id})`}function ib(...e){let t=0;for(let n of e)for(let e of n.matchAll(/`+/g))t=Math.max(t,e[0].length);return"`".repeat(Math.max(3,t+1))}function ab(e,t){let n=t.user_change;if(!n)return;let{before:r,after:i}=n,a=t.anchor.source_range;if(a&&e.slice(a.start,a.end)===r)return e.slice(0,a.start)+i+e.slice(a.end);let o=t.anchor.prefix;if(o){let t=e.indexOf(o+r);if(t>=0&&e.indexOf(o+r,t+1)<0){let n=t+o.length;return e.slice(0,n)+i+e.slice(n+r.length)}}let s=e.indexOf(r);if(!(s<0||e.indexOf(r,s+1)>=0))return e.slice(0,s)+i+e.slice(s+r.length)}function ob(e){let t=rb(e.resource),n=e.anchor.block_type.replace(`_`,` `);if(e.action===`edit`&&e.user_change&&e.applied){let r=ib(e.user_change.before,e.user_change.after);return[`I already edited the ${n} in ${t} myself and the change is saved${e.updated_document_id?` as revision ${e.updated_document_id}`:``}.`,`Operation: ${e.operation_id}`,`This is a notification only. Do not apply this change again and do not modify the document in response; acknowledge briefly and use the latest content going forward.`,``,`Before:`,`${r}markdown`,e.user_change.before,r,``,`After:`,`${r}markdown`,e.user_change.after,r].join(`
380
380
  `)}if(e.action===`edit`&&e.user_change){let r=ib(e.user_change.before,e.user_change.after);return[`Apply my edit to the ${n} in ${t}, then update the resource.`,`Operation: ${e.operation_id}`,`Preserve all content outside the selected block exactly; do not regenerate unrelated sections.`,``,`Before:`,`${r}markdown`,e.user_change.before,r,``,`After:`,`${r}markdown`,e.user_change.after,r].join(`
381
381
  `)}let r=ib(e.anchor.exact_text);return[`Update the ${n} in ${t} based on this comment:`,`Operation: ${e.operation_id}`,`Preserve all content outside the selected block exactly; do not regenerate unrelated sections.`,``,e.comment??``,``,`Selected content:`,`${r}markdown`,e.anchor.exact_text,r].join(`
382
- `)}function sb(){let e=I(Ky);if(!e)throw Error(`Collaborative Markdown blocks must be rendered inside CollaborativeMarkdownRenderer`);return e}function cb({anchor:e,mode:i,initialDraft:a}){let{t:o}=se(),{artifactRunId:s,readOnly:c,allowComments:l,cancelEditing:u,submit:d,updateDraft:f}=sb(),[p,m]=B(i===`edit`?e.exact_text:i===`insert`?a??``:``),[h,g]=B(!1),_=i===`comment`?!l:c,v=e=>{m(e),f(e)},y=async()=>{if(p.trim()&&!h){g(!0);try{await d(e,i,i===`comment`?p.trim():p)}finally{g(!1)}}};return n(`div`,{className:`mb-2 space-y-2`,children:[i===`edit`||i===`insert`?t(ee,{fallback:t(x,{value:p,onChange:e=>v(e.target.value),placeholder:o(`agent.editSelectionPlaceholder`),rows:6,autoFocus:!0}),children:t(Jy,{value:p,onChange:v,artifactRunId:s,editable:!c,externalValueSync:`manual`,autoFocus:!0})}):t(x,{value:p,onChange:e=>v(e.target.value),placeholder:o(`agent.commentOnSelectionPlaceholder`),rows:3,autoFocus:!0,disabled:!l}),n(`div`,{className:`flex justify-end gap-2`,children:[n(r,{variant:`outline`,size:`sm`,onClick:u,disabled:h,children:[t(ln,{className:`me-1 size-4`}),o(`store.cancelEdit`)]}),n(r,{size:`sm`,onClick:()=>void y(),disabled:_||!p.trim()||h,children:[t(Jt,{className:`me-1 size-4`}),o(`agent.send`)]})]})]})}function lb(i,a,u){return function({node:d,children:f,...p}){let{t:m}=se(),{markdown:h,readOnly:g,allowComments:_,activeEditing:v,highlightChangesFrom:y,flashChangedBlocks:b,beginEditing:x}=sb(),w=I(qy),T=u?M.createElement(u,{node:d,...p},f):M.createElement(i,p,f);if(w)return T;let E=Qy(h,d,a),D=!!(E.source_range&&E.exact_text),O=!g&&D,k=_&&D,A=v?.anchor.block_id===E.block_id,j=A&&v?.mode===`edit`,ee=b&&!!E.exact_text&&!!y&&!y?.includes(E.exact_text),N=C(`group/collab relative rounded-md border transition-colors duration-700`,`-mx-2 -my-1 px-2 py-1`,j?`border-transparent`:A?`border-info bg-mixer-info/5`:O||k?`border-transparent hover:border-mixer-info/30 hover:bg-mixer-muted/10`:`border-transparent`,ee&&`border-mixer-success/50 bg-mixer-success/15 ring-1 ring-mixer-success/20`),te=O||k||A?n(e,{children:[n(`div`,{className:C(`absolute end-1 top-1 z-10 flex items-center gap-0.5 rounded-md border bg-background p-0.5 shadow-sm`,(!O&&!k||j)&&`hidden`,A?`opacity-100`:`pointer-events-none opacity-0 group-hover/collab:pointer-events-auto group-hover/collab:opacity-100 group-focus-within/collab:pointer-events-auto group-focus-within/collab:opacity-100`),children:[k?t(S,{description:m(`agent.commentOnSelection`),asChild:!0,children:t(r,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0`,"aria-label":m(`agent.commentOnSelection`),onClick:()=>x(E,`comment`),children:t(It,{className:`size-4`})})}):null,O?t(S,{description:m(`agent.editSelection`),asChild:!0,children:t(r,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0`,"aria-label":m(`agent.editSelection`),onClick:()=>x(E,`edit`),children:t(Bt,{className:`size-4`})})}):null,O?n(o,{children:[t(S,{description:m(`agent.insertComponent`),asChild:!0,children:t(l,{asChild:!0,children:t(r,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0`,"aria-label":m(`agent.insertComponent`),children:t(Wt,{className:`size-4`})})})}),n(s,{align:`end`,className:`w-52`,children:[n(c,{onClick:()=>x(E,`insert`,m(`richText.paragraph`)),children:[t(Ht,{}),m(`richText.paragraph`)]}),n(c,{onClick:()=>x(E,`insert`,`## ${m(`richText.heading2`)}`),children:[t(St,{}),m(`richText.heading2`)]}),n(c,{onClick:()=>x(E,`insert`,`- ${m(`richText.bulletList`)}`),children:[t(Mt,{}),m(`richText.bulletList`)]}),n(c,{onClick:()=>x(E,`insert`,`> ${m(`richText.blockquote`)}`),children:[t(Kt,{}),m(`richText.blockquote`)]}),n(c,{onClick:()=>x(E,`insert`,"```\nCode\n```"),children:[t(ct,{}),m(`richText.codeBlock`)]}),n(c,{onClick:()=>x(E,`insert`,`| Column | Value |
382
+ `)}function sb(){let e=I(Ky);if(!e)throw Error(`Collaborative Markdown blocks must be rendered inside CollaborativeMarkdownRenderer`);return e}function cb({anchor:e,mode:i,initialDraft:a}){let{t:o}=se(),{artifactRunId:s,readOnly:c,allowComments:l,cancelEditing:u,submit:d,updateDraft:f}=sb(),[p,m]=B(i===`edit`?e.exact_text:i===`insert`?a??``:``),[h,g]=B(!1),_=i===`comment`?!l:c,v=e=>{m(e),f(e)},y=async()=>{if(p.trim()&&!h){g(!0);try{await d(e,i,i===`comment`?p.trim():p)}finally{g(!1)}}};return n(`div`,{className:`mb-2 space-y-2`,children:[i===`edit`||i===`insert`?t(ee,{fallback:t(x,{value:p,onChange:e=>v(e.target.value),placeholder:o(`agent.editSelectionPlaceholder`),rows:6,autoFocus:!0}),children:t(Jy,{value:p,onChange:v,artifactRunId:s,editable:!c,externalValueSync:`manual`,autoFocus:!0})}):t(x,{value:p,onChange:e=>v(e.target.value),placeholder:o(`agent.commentOnSelectionPlaceholder`),rows:3,autoFocus:!0,disabled:!l}),n(`div`,{className:`flex justify-end gap-2`,children:[n(r,{variant:`outline`,size:`sm`,onClick:u,disabled:h,children:[t(ln,{className:`me-1 size-4`}),o(`store.cancelEdit`)]}),n(r,{size:`sm`,onClick:()=>void y(),disabled:_||!p.trim()||h,children:[t(Jt,{className:`me-1 size-4`}),o(`agent.send`)]})]})]})}function lb(i,a,u){return function({node:d,children:f,...p}){let{t:m}=se(),{markdown:h,readOnly:g,allowComments:_,activeEditing:v,highlightChangesFrom:y,flashChangedBlocks:b,beginEditing:x}=sb(),w=I(qy),T=u?M.createElement(u,{node:d,...p},f):M.createElement(i,p,f);if(w)return T;let E=Qy(h,d,a),D=!!(E.source_range&&E.exact_text),O=!g&&D,k=_&&D,A=v?.anchor.block_id===E.block_id,j=A&&v?.mode===`edit`,ee=b&&!!E.exact_text&&!!y&&!y?.includes(E.exact_text),N=C(`group/collab relative rounded-md border transition-colors duration-700`,`-mx-2 -my-1 px-2 py-1`,j?`border-transparent`:A?`border-info bg-mixer-info/5`:O||k?`border-transparent hover:border-mixer-info/30 hover:bg-mixer-muted/10`:`border-transparent`,ee&&`border-mixer-success/50 bg-mixer-success/15 ring-1 ring-mixer-success/20`),te=O||k||A?n(e,{children:[n(`div`,{className:C(`absolute end-1 top-1 z-10 flex items-center gap-0.5 rounded-md border bg-background p-0.5 shadow-sm`,(!O&&!k||j)&&`hidden`,A?`opacity-100`:`pointer-events-none opacity-0 group-hover/collab:pointer-events-auto group-hover/collab:opacity-100 group-focus-within/collab:pointer-events-auto group-focus-within/collab:opacity-100`),children:[k?t(S,{description:m(`agent.commentOnSelection`),asChild:!0,children:t(r,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0`,"aria-label":m(`agent.commentOnSelection`),onClick:()=>x(E,`comment`),children:t(It,{className:`size-4`})})}):null,O?t(S,{description:m(`agent.editSelection`),asChild:!0,children:t(r,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0`,"aria-label":m(`agent.editSelection`),onClick:()=>x(E,`edit`),children:t(Bt,{className:`size-4`})})}):null,O?n(o,{children:[t(S,{description:m(`agent.insertComponent`),asChild:!0,children:t(l,{asChild:!0,children:t(r,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0`,"aria-label":m(`agent.insertComponent`),children:t(Wt,{className:`size-4`})})})}),n(s,{align:`end`,className:`w-52`,children:[n(c,{onClick:()=>x(E,`insert`,m(`richText.paragraph`)),children:[t(Ht,{}),m(`richText.paragraph`)]}),n(c,{onClick:()=>x(E,`insert`,`## ${m(`richText.heading2`)}`),children:[t(St,{}),m(`richText.heading2`)]}),n(c,{onClick:()=>x(E,`insert`,`- ${m(`richText.bulletList`)}`),children:[t(At,{}),m(`richText.bulletList`)]}),n(c,{onClick:()=>x(E,`insert`,`> ${m(`richText.blockquote`)}`),children:[t(Kt,{}),m(`richText.blockquote`)]}),n(c,{onClick:()=>x(E,`insert`,"```\nCode\n```"),children:[t(ct,{}),m(`richText.codeBlock`)]}),n(c,{onClick:()=>x(E,`insert`,`| Column | Value |
383
383
  | --- | --- |
384
384
  | A | 1 |`),children:[t(Qt,{}),m(`richText.table`)]}),n(c,{onClick:()=>x(E,`insert`,`[${m(`agent.insertLink`)}](https://example.com)`),children:[t(Ot,{}),m(`agent.insertLink`)]}),n(c,{onClick:()=>x(E,`insert`,'```chart\n{"$schema":"https://vega.github.io/schema/vega-lite/v5.json","data":{"values":[{"category":"A","value":1}]},"mark":"bar","encoding":{"x":{"field":"category","type":"nominal"},"y":{"field":"value","type":"quantitative"}}}\n```'),children:[t(Je,{}),m(`agent.insertChart`)]})]})]}):null]}),A&&v?t(cb,{anchor:v.anchor,mode:v.mode,initialDraft:v.initialDraft},`${v.anchor.block_id}:${v.mode}:${v.initialDraft??``}`):null]}):null,P=Gy.has(a)?t(qy.Provider,{value:!0,children:T}):T;return n(`div`,{className:N,"data-collaborative-block":E.block_id,children:[j?null:P,te]})}}function ub({children:e,resource:i,baseVersion:a,artifactRunId:o,components:s,readOnly:c=!1,allowComments:l=!c,highlightChangesFrom:u,highlightVersion:d=0,onAction:f,className:p,...m}){let{t:h}=se(),[g,_]=B(),[v,y]=B(),[b,S]=B(!1),C=z(``);L(()=>{if(!u||d<=0)return;S(!0);let e=window.setTimeout(()=>S(!1),1800);return()=>window.clearTimeout(e)},[u,d]),L(()=>{let t=g?.anchor.source_range;if(!g||!t||e.slice(t.start,t.end)===g.anchor.exact_text)return;let n=C.current,r=g.mode===`edit`?g.anchor.exact_text:g.mode===`insert`?g.initialDraft??``:``;n.trim()&&n!==r&&y({...g,draft:n}),_(void 0)},[g,e]);let w=R(()=>({...s,p:lb(`p`,`paragraph`,s?.p),h1:lb(`h1`,`heading`,s?.h1),h2:lb(`h2`,`heading`,s?.h2),h3:lb(`h3`,`heading`,s?.h3),h4:lb(`h4`,`heading`,s?.h4),h5:lb(`h5`,`heading`,s?.h5),h6:lb(`h6`,`heading`,s?.h6),ul:lb(`ul`,`list`,s?.ul),ol:lb(`ol`,`list`,s?.ol),blockquote:lb(`blockquote`,`blockquote`,s?.blockquote),pre:lb(`pre`,`code_block`,s?.pre),table:lb(`table`,`table`,s?.table),hr:lb(`hr`,`separator`,s?.hr)}),[s]),T=F((t,n,r)=>{if(n===`comment`&&!l||n!==`comment`&&c)return;let i=$y(e,t);C.current=n===`edit`?i.exact_text:r??``,_({anchor:i,mode:n,initialDraft:r})},[l,e,c]),E=F(()=>{C.current=``,_(void 0)},[]),D=F(e=>{C.current=e},[]),O=F(async(e,t,n)=>{if(t===`comment`&&!l||t!==`comment`&&c)return;let r=t===`insert`?`${e.exact_text.replace(/\s+$/,``)}\n\n${n.trim()}`:n;await f({operation_id:Zy(),resource:i,base_version:a,action:t===`insert`?`edit`:t,anchor:e,...t===`comment`?{comment:n}:{user_change:{before:e.exact_text,after:r}}}),C.current=``,_(void 0)},[l,a,f,c,i]),k=R(()=>({markdown:e,artifactRunId:o,readOnly:c,allowComments:l,activeEditing:g,highlightChangesFrom:u,flashChangedBlocks:b,beginEditing:T,cancelEditing:E,updateDraft:D,submit:O}),[g,l,o,T,E,b,u,e,c,O,D]);return n(Ky.Provider,{value:k,children:[v?n(`div`,{className:`not-prose mb-3 rounded-md border border-mixer-attention/35 bg-mixer-attention/10 p-3`,children:[n(`div`,{className:`flex items-start justify-between gap-3`,children:[n(`div`,{children:[t(`div`,{className:`text-sm font-semibold text-foreground`,children:h(`agent.documentEditingDraftPreserved`)}),t(`div`,{className:`mt-0.5 text-xs leading-4 text-muted`,children:h(`agent.documentEditingDraftPreservedDescription`)})]}),t(r,{variant:`ghost`,size:`sm`,className:`h-7 w-7 shrink-0 p-0`,onClick:()=>y(void 0),"aria-label":h(`agent.close`),children:t(ln,{className:`size-4`})})]}),t(x,{className:`mt-2`,value:v.draft,onChange:e=>y(t=>t&&{...t,draft:e.target.value}),rows:4})]}):null,t(Wy,{...m,artifactRunId:o,className:p,components:w,preserveSourcePositions:!0,children:e})]})}function db(e){return e.split(/(\s+)/).filter(e=>e.length>0)}function fb(e,t,n){if(!n)return;let r=e[e.length-1];r&&r.type===t?r.text+=n:e.push({type:t,text:n})}function pb(e,t,n){let r=e.length+1,i=t.length+1,a=new Uint32Array(r*i);for(let n=e.length-1;n>=0;n--)for(let r=t.length-1;r>=0;r--)a[n*i+r]=e[n]===t[r]?a[(n+1)*i+r+1]+1:Math.max(a[(n+1)*i+r],a[n*i+r+1]);let o=0,s=0;for(;o<e.length&&s<t.length;)e[o]===t[s]?(fb(n,`equal`,e[o]),o++,s++):a[(o+1)*i+s]>=a[o*i+s+1]?(fb(n,`removed`,e[o]),o++):(fb(n,`added`,t[s]),s++);fb(n,`removed`,e.slice(o).join(``)),fb(n,`added`,t.slice(s).join(``))}function mb(e,t){if(e===t)return e?[{type:`equal`,text:e}]:[];let n=db(e),r=db(t),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;let a=n.length,o=r.length;for(;a>i&&o>i&&n[a-1]===r[o-1];)a--,o--;let s=[];fb(s,`equal`,n.slice(0,i).join(``));let c=n.slice(i,a),l=r.slice(i,o);return c.length*l.length>36e4?(fb(s,`removed`,c.join(``)),fb(s,`added`,l.join(``))):pb(c,l,s),fb(s,`equal`,n.slice(a).join(``)),s}function hb(e,t){let n=[],r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];)n.push({type:`equal`,line:e[r]}),r++;let i=e.length,a=t.length,o=[];for(;i>r&&a>r&&e[i-1]===t[a-1];)i--,a--,o.unshift({type:`equal`,line:e[i]});let s=e.slice(r,i),c=t.slice(r,a);if(s.length*c.length>36e4){for(let e of s)n.push({type:`removed`,line:e});for(let e of c)n.push({type:`added`,line:e});return[...n,...o]}let l=s.length+1,u=c.length+1,d=new Uint32Array(l*u);for(let e=s.length-1;e>=0;e--)for(let t=c.length-1;t>=0;t--)d[e*u+t]=s[e]===c[t]?d[(e+1)*u+t+1]+1:Math.max(d[(e+1)*u+t],d[e*u+t+1]);let f=0,p=0;for(;f<s.length&&p<c.length;)s[f]===c[p]?(n.push({type:`equal`,line:s[f]}),f++,p++):d[(f+1)*u+p]>=d[f*u+p+1]?(n.push({type:`removed`,line:s[f]}),f++):(n.push({type:`added`,line:c[p]}),p++);for(;f<s.length;)n.push({type:`removed`,line:s[f++]});for(;p<c.length;)n.push({type:`added`,line:c[p++]});return[...n,...o]}function gb(e){return e.match(/[^\n]*\n|[^\n]+$/g)??[]}function _b(e,t){if(!e.includes(`
385
385
  `)&&!t.includes(`