@copilotkit/a2ui-renderer 1.51.4 → 1.51.5-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (338) hide show
  1. package/dist/A2UIMessageRenderer.cjs +135 -0
  2. package/dist/A2UIMessageRenderer.cjs.map +1 -0
  3. package/dist/A2UIMessageRenderer.d.cts +11 -0
  4. package/dist/A2UIMessageRenderer.d.cts.map +1 -0
  5. package/dist/A2UIMessageRenderer.d.mts +11 -0
  6. package/dist/A2UIMessageRenderer.d.mts.map +1 -0
  7. package/dist/A2UIMessageRenderer.mjs +134 -0
  8. package/dist/A2UIMessageRenderer.mjs.map +1 -0
  9. package/dist/A2UIViewer.cjs +154 -0
  10. package/dist/A2UIViewer.cjs.map +1 -0
  11. package/dist/A2UIViewer.d.cts +39 -0
  12. package/dist/A2UIViewer.d.cts.map +1 -0
  13. package/dist/A2UIViewer.d.mts +39 -0
  14. package/dist/A2UIViewer.d.mts.map +1 -0
  15. package/dist/A2UIViewer.mjs +152 -0
  16. package/dist/A2UIViewer.mjs.map +1 -0
  17. package/dist/_virtual/_rolldown/runtime.cjs +29 -0
  18. package/dist/index.cjs +8 -0
  19. package/dist/index.d.cts +15 -0
  20. package/dist/index.d.cts.map +1 -0
  21. package/dist/index.d.mts +15 -0
  22. package/dist/index.d.mts.map +1 -0
  23. package/dist/index.mjs +5 -0
  24. package/dist/index.umd.js +3070 -2
  25. package/dist/index.umd.js.map +1 -1
  26. package/dist/react-renderer/components/content/AudioPlayer.cjs +34 -0
  27. package/dist/react-renderer/components/content/AudioPlayer.cjs.map +1 -0
  28. package/dist/react-renderer/components/content/AudioPlayer.mjs +33 -0
  29. package/dist/react-renderer/components/content/AudioPlayer.mjs.map +1 -0
  30. package/dist/react-renderer/components/content/Divider.cjs +31 -0
  31. package/dist/react-renderer/components/content/Divider.cjs.map +1 -0
  32. package/dist/react-renderer/components/content/Divider.mjs +30 -0
  33. package/dist/react-renderer/components/content/Divider.mjs.map +1 -0
  34. package/dist/react-renderer/components/content/Icon.cjs +50 -0
  35. package/dist/react-renderer/components/content/Icon.cjs.map +1 -0
  36. package/dist/react-renderer/components/content/Icon.mjs +49 -0
  37. package/dist/react-renderer/components/content/Icon.mjs.map +1 -0
  38. package/dist/react-renderer/components/content/Image.cjs +43 -0
  39. package/dist/react-renderer/components/content/Image.cjs.map +1 -0
  40. package/dist/react-renderer/components/content/Image.mjs +42 -0
  41. package/dist/react-renderer/components/content/Image.mjs.map +1 -0
  42. package/dist/react-renderer/components/content/Text.cjs +131 -0
  43. package/dist/react-renderer/components/content/Text.cjs.map +1 -0
  44. package/dist/react-renderer/components/content/Text.mjs +129 -0
  45. package/dist/react-renderer/components/content/Text.mjs.map +1 -0
  46. package/dist/react-renderer/components/content/Video.cjs +56 -0
  47. package/dist/react-renderer/components/content/Video.cjs.map +1 -0
  48. package/dist/react-renderer/components/content/Video.mjs +55 -0
  49. package/dist/react-renderer/components/content/Video.mjs.map +1 -0
  50. package/dist/react-renderer/components/interactive/Button.cjs +39 -0
  51. package/dist/react-renderer/components/interactive/Button.cjs.map +1 -0
  52. package/dist/react-renderer/components/interactive/Button.mjs +38 -0
  53. package/dist/react-renderer/components/interactive/Button.mjs.map +1 -0
  54. package/dist/react-renderer/components/interactive/CheckBox.cjs +58 -0
  55. package/dist/react-renderer/components/interactive/CheckBox.cjs.map +1 -0
  56. package/dist/react-renderer/components/interactive/CheckBox.mjs +57 -0
  57. package/dist/react-renderer/components/interactive/CheckBox.mjs.map +1 -0
  58. package/dist/react-renderer/components/interactive/DateTimeInput.cjs +65 -0
  59. package/dist/react-renderer/components/interactive/DateTimeInput.cjs.map +1 -0
  60. package/dist/react-renderer/components/interactive/DateTimeInput.mjs +64 -0
  61. package/dist/react-renderer/components/interactive/DateTimeInput.mjs.map +1 -0
  62. package/dist/react-renderer/components/interactive/MultipleChoice.cjs +54 -0
  63. package/dist/react-renderer/components/interactive/MultipleChoice.cjs.map +1 -0
  64. package/dist/react-renderer/components/interactive/MultipleChoice.mjs +53 -0
  65. package/dist/react-renderer/components/interactive/MultipleChoice.mjs.map +1 -0
  66. package/dist/react-renderer/components/interactive/Slider.cjs +72 -0
  67. package/dist/react-renderer/components/interactive/Slider.cjs.map +1 -0
  68. package/dist/react-renderer/components/interactive/Slider.mjs +71 -0
  69. package/dist/react-renderer/components/interactive/Slider.mjs.map +1 -0
  70. package/dist/react-renderer/components/interactive/TextField.cjs +74 -0
  71. package/dist/react-renderer/components/interactive/TextField.cjs.map +1 -0
  72. package/dist/react-renderer/components/interactive/TextField.mjs +73 -0
  73. package/dist/react-renderer/components/interactive/TextField.mjs.map +1 -0
  74. package/dist/react-renderer/components/layout/Card.cjs +46 -0
  75. package/dist/react-renderer/components/layout/Card.cjs.map +1 -0
  76. package/dist/react-renderer/components/layout/Card.mjs +45 -0
  77. package/dist/react-renderer/components/layout/Card.mjs.map +1 -0
  78. package/dist/react-renderer/components/layout/Column.cjs +43 -0
  79. package/dist/react-renderer/components/layout/Column.cjs.map +1 -0
  80. package/dist/react-renderer/components/layout/Column.mjs +42 -0
  81. package/dist/react-renderer/components/layout/Column.mjs.map +1 -0
  82. package/dist/react-renderer/components/layout/List.cjs +41 -0
  83. package/dist/react-renderer/components/layout/List.cjs.map +1 -0
  84. package/dist/react-renderer/components/layout/List.mjs +40 -0
  85. package/dist/react-renderer/components/layout/List.mjs.map +1 -0
  86. package/dist/react-renderer/components/layout/Modal.cjs +92 -0
  87. package/dist/react-renderer/components/layout/Modal.cjs.map +1 -0
  88. package/dist/react-renderer/components/layout/Modal.mjs +91 -0
  89. package/dist/react-renderer/components/layout/Modal.mjs.map +1 -0
  90. package/dist/react-renderer/components/layout/Row.cjs +43 -0
  91. package/dist/react-renderer/components/layout/Row.cjs.map +1 -0
  92. package/dist/react-renderer/components/layout/Row.mjs +42 -0
  93. package/dist/react-renderer/components/layout/Row.mjs.map +1 -0
  94. package/dist/react-renderer/components/layout/Tabs.cjs +47 -0
  95. package/dist/react-renderer/components/layout/Tabs.cjs.map +1 -0
  96. package/dist/react-renderer/components/layout/Tabs.mjs +46 -0
  97. package/dist/react-renderer/components/layout/Tabs.mjs.map +1 -0
  98. package/dist/react-renderer/core/A2UIProvider.cjs +123 -0
  99. package/dist/react-renderer/core/A2UIProvider.cjs.map +1 -0
  100. package/dist/react-renderer/core/A2UIProvider.mjs +120 -0
  101. package/dist/react-renderer/core/A2UIProvider.mjs.map +1 -0
  102. package/dist/react-renderer/core/A2UIRenderer.cjs +93 -0
  103. package/dist/react-renderer/core/A2UIRenderer.cjs.map +1 -0
  104. package/dist/react-renderer/core/A2UIRenderer.mjs +92 -0
  105. package/dist/react-renderer/core/A2UIRenderer.mjs.map +1 -0
  106. package/dist/react-renderer/core/ComponentNode.cjs +53 -0
  107. package/dist/react-renderer/core/ComponentNode.cjs.map +1 -0
  108. package/dist/react-renderer/core/ComponentNode.mjs +52 -0
  109. package/dist/react-renderer/core/ComponentNode.mjs.map +1 -0
  110. package/dist/react-renderer/hooks/useA2UI.cjs +46 -0
  111. package/dist/react-renderer/hooks/useA2UI.cjs.map +1 -0
  112. package/dist/react-renderer/hooks/useA2UI.mjs +46 -0
  113. package/dist/react-renderer/hooks/useA2UI.mjs.map +1 -0
  114. package/dist/react-renderer/hooks/useA2UIComponent.cjs +173 -0
  115. package/dist/react-renderer/hooks/useA2UIComponent.cjs.map +1 -0
  116. package/dist/react-renderer/hooks/useA2UIComponent.mjs +172 -0
  117. package/dist/react-renderer/hooks/useA2UIComponent.mjs.map +1 -0
  118. package/dist/react-renderer/lib/utils.cjs +39 -0
  119. package/dist/react-renderer/lib/utils.cjs.map +1 -0
  120. package/dist/react-renderer/lib/utils.mjs +37 -0
  121. package/dist/react-renderer/lib/utils.mjs.map +1 -0
  122. package/dist/react-renderer/registry/ComponentRegistry.cjs +114 -0
  123. package/dist/react-renderer/registry/ComponentRegistry.cjs.map +1 -0
  124. package/dist/react-renderer/registry/ComponentRegistry.mjs +113 -0
  125. package/dist/react-renderer/registry/ComponentRegistry.mjs.map +1 -0
  126. package/dist/react-renderer/registry/defaultCatalog.cjs +57 -0
  127. package/dist/react-renderer/registry/defaultCatalog.cjs.map +1 -0
  128. package/dist/react-renderer/registry/defaultCatalog.mjs +57 -0
  129. package/dist/react-renderer/registry/defaultCatalog.mjs.map +1 -0
  130. package/dist/react-renderer/styles/index.cjs +458 -0
  131. package/dist/react-renderer/styles/index.cjs.map +1 -0
  132. package/dist/react-renderer/styles/{index.js → index.mjs} +47 -64
  133. package/dist/react-renderer/styles/index.mjs.map +1 -0
  134. package/dist/react-renderer/styles/reset.cjs +29 -0
  135. package/dist/react-renderer/styles/reset.cjs.map +1 -0
  136. package/dist/react-renderer/styles/reset.mjs +28 -0
  137. package/dist/react-renderer/styles/reset.mjs.map +1 -0
  138. package/dist/react-renderer/theme/ThemeContext.cjs +35 -0
  139. package/dist/react-renderer/theme/ThemeContext.cjs.map +1 -0
  140. package/dist/react-renderer/theme/ThemeContext.mjs +33 -0
  141. package/dist/react-renderer/theme/ThemeContext.mjs.map +1 -0
  142. package/dist/react-renderer/theme/litTheme.cjs +368 -0
  143. package/dist/react-renderer/theme/litTheme.cjs.map +1 -0
  144. package/dist/react-renderer/theme/litTheme.mjs +367 -0
  145. package/dist/react-renderer/theme/litTheme.mjs.map +1 -0
  146. package/dist/react-renderer/theme/utils.cjs +41 -0
  147. package/dist/react-renderer/theme/utils.cjs.map +1 -0
  148. package/dist/react-renderer/theme/utils.mjs +39 -0
  149. package/dist/react-renderer/theme/utils.mjs.map +1 -0
  150. package/dist/theme/viewer-theme.cjs +366 -0
  151. package/dist/theme/viewer-theme.cjs.map +1 -0
  152. package/dist/theme/viewer-theme.d.cts +7 -0
  153. package/dist/theme/viewer-theme.d.cts.map +1 -0
  154. package/dist/theme/viewer-theme.d.mts +7 -0
  155. package/dist/theme/viewer-theme.d.mts.map +1 -0
  156. package/dist/theme/viewer-theme.mjs +365 -0
  157. package/dist/theme/viewer-theme.mjs.map +1 -0
  158. package/package.json +14 -9
  159. package/dist/.tsbuildinfo +0 -1
  160. package/dist/A2UIMessageRenderer.d.ts +0 -7
  161. package/dist/A2UIMessageRenderer.d.ts.map +0 -1
  162. package/dist/A2UIMessageRenderer.js +0 -126
  163. package/dist/A2UIMessageRenderer.js.map +0 -1
  164. package/dist/A2UIViewer.d.ts +0 -32
  165. package/dist/A2UIViewer.d.ts.map +0 -1
  166. package/dist/A2UIViewer.js +0 -121
  167. package/dist/A2UIViewer.js.map +0 -1
  168. package/dist/__tests__/A2UIMessageRenderer.test.d.ts +0 -2
  169. package/dist/__tests__/A2UIMessageRenderer.test.d.ts.map +0 -1
  170. package/dist/__tests__/A2UIMessageRenderer.test.js +0 -229
  171. package/dist/__tests__/A2UIMessageRenderer.test.js.map +0 -1
  172. package/dist/__tests__/clsx-shim.d.ts +0 -8
  173. package/dist/__tests__/clsx-shim.d.ts.map +0 -1
  174. package/dist/__tests__/clsx-shim.js +0 -24
  175. package/dist/__tests__/clsx-shim.js.map +0 -1
  176. package/dist/__tests__/setup.d.ts +0 -2
  177. package/dist/__tests__/setup.d.ts.map +0 -1
  178. package/dist/__tests__/setup.js +0 -29
  179. package/dist/__tests__/setup.js.map +0 -1
  180. package/dist/index.d.ts +0 -13
  181. package/dist/index.d.ts.map +0 -1
  182. package/dist/index.js +0 -19
  183. package/dist/index.js.map +0 -1
  184. package/dist/react-renderer/components/content/AudioPlayer.d.ts +0 -8
  185. package/dist/react-renderer/components/content/AudioPlayer.d.ts.map +0 -1
  186. package/dist/react-renderer/components/content/AudioPlayer.js +0 -23
  187. package/dist/react-renderer/components/content/AudioPlayer.js.map +0 -1
  188. package/dist/react-renderer/components/content/Divider.d.ts +0 -13
  189. package/dist/react-renderer/components/content/Divider.d.ts.map +0 -1
  190. package/dist/react-renderer/components/content/Divider.js +0 -22
  191. package/dist/react-renderer/components/content/Divider.js.map +0 -1
  192. package/dist/react-renderer/components/content/Icon.d.ts +0 -16
  193. package/dist/react-renderer/components/content/Icon.d.ts.map +0 -1
  194. package/dist/react-renderer/components/content/Icon.js +0 -40
  195. package/dist/react-renderer/components/content/Icon.js.map +0 -1
  196. package/dist/react-renderer/components/content/Image.d.ts +0 -11
  197. package/dist/react-renderer/components/content/Image.d.ts.map +0 -1
  198. package/dist/react-renderer/components/content/Image.js +0 -34
  199. package/dist/react-renderer/components/content/Image.js.map +0 -1
  200. package/dist/react-renderer/components/content/Text.d.ts +0 -28
  201. package/dist/react-renderer/components/content/Text.d.ts.map +0 -1
  202. package/dist/react-renderer/components/content/Text.js +0 -134
  203. package/dist/react-renderer/components/content/Text.js.map +0 -1
  204. package/dist/react-renderer/components/content/Video.d.ts +0 -10
  205. package/dist/react-renderer/components/content/Video.d.ts.map +0 -1
  206. package/dist/react-renderer/components/content/Video.js +0 -41
  207. package/dist/react-renderer/components/content/Video.js.map +0 -1
  208. package/dist/react-renderer/components/content/index.d.ts +0 -7
  209. package/dist/react-renderer/components/content/index.d.ts.map +0 -1
  210. package/dist/react-renderer/components/content/index.js +0 -7
  211. package/dist/react-renderer/components/content/index.js.map +0 -1
  212. package/dist/react-renderer/components/interactive/Button.d.ts +0 -11
  213. package/dist/react-renderer/components/interactive/Button.d.ts.map +0 -1
  214. package/dist/react-renderer/components/interactive/Button.js +0 -27
  215. package/dist/react-renderer/components/interactive/Button.js.map +0 -1
  216. package/dist/react-renderer/components/interactive/CheckBox.d.ts +0 -10
  217. package/dist/react-renderer/components/interactive/CheckBox.d.ts.map +0 -1
  218. package/dist/react-renderer/components/interactive/CheckBox.js +0 -55
  219. package/dist/react-renderer/components/interactive/CheckBox.js.map +0 -1
  220. package/dist/react-renderer/components/interactive/DateTimeInput.d.ts +0 -10
  221. package/dist/react-renderer/components/interactive/DateTimeInput.d.ts.map +0 -1
  222. package/dist/react-renderer/components/interactive/DateTimeInput.js +0 -68
  223. package/dist/react-renderer/components/interactive/DateTimeInput.js.map +0 -1
  224. package/dist/react-renderer/components/interactive/MultipleChoice.d.ts +0 -11
  225. package/dist/react-renderer/components/interactive/MultipleChoice.d.ts.map +0 -1
  226. package/dist/react-renderer/components/interactive/MultipleChoice.js +0 -43
  227. package/dist/react-renderer/components/interactive/MultipleChoice.js.map +0 -1
  228. package/dist/react-renderer/components/interactive/Slider.d.ts +0 -10
  229. package/dist/react-renderer/components/interactive/Slider.d.ts.map +0 -1
  230. package/dist/react-renderer/components/interactive/Slider.js +0 -62
  231. package/dist/react-renderer/components/interactive/Slider.js.map +0 -1
  232. package/dist/react-renderer/components/interactive/TextField.d.ts +0 -10
  233. package/dist/react-renderer/components/interactive/TextField.d.ts.map +0 -1
  234. package/dist/react-renderer/components/interactive/TextField.js +0 -59
  235. package/dist/react-renderer/components/interactive/TextField.js.map +0 -1
  236. package/dist/react-renderer/components/interactive/index.d.ts +0 -7
  237. package/dist/react-renderer/components/interactive/index.d.ts.map +0 -1
  238. package/dist/react-renderer/components/interactive/index.js +0 -7
  239. package/dist/react-renderer/components/interactive/index.js.map +0 -1
  240. package/dist/react-renderer/components/layout/Card.d.ts +0 -17
  241. package/dist/react-renderer/components/layout/Card.d.ts.map +0 -1
  242. package/dist/react-renderer/components/layout/Card.js +0 -39
  243. package/dist/react-renderer/components/layout/Card.js.map +0 -1
  244. package/dist/react-renderer/components/layout/Column.d.ts +0 -10
  245. package/dist/react-renderer/components/layout/Column.d.ts.map +0 -1
  246. package/dist/react-renderer/components/layout/Column.js +0 -33
  247. package/dist/react-renderer/components/layout/Column.js.map +0 -1
  248. package/dist/react-renderer/components/layout/List.d.ts +0 -10
  249. package/dist/react-renderer/components/layout/List.d.ts.map +0 -1
  250. package/dist/react-renderer/components/layout/List.js +0 -32
  251. package/dist/react-renderer/components/layout/List.js.map +0 -1
  252. package/dist/react-renderer/components/layout/Modal.d.ts +0 -15
  253. package/dist/react-renderer/components/layout/Modal.d.ts.map +0 -1
  254. package/dist/react-renderer/components/layout/Modal.js +0 -65
  255. package/dist/react-renderer/components/layout/Modal.js.map +0 -1
  256. package/dist/react-renderer/components/layout/Row.d.ts +0 -10
  257. package/dist/react-renderer/components/layout/Row.d.ts.map +0 -1
  258. package/dist/react-renderer/components/layout/Row.js +0 -33
  259. package/dist/react-renderer/components/layout/Row.js.map +0 -1
  260. package/dist/react-renderer/components/layout/Tabs.d.ts +0 -8
  261. package/dist/react-renderer/components/layout/Tabs.d.ts.map +0 -1
  262. package/dist/react-renderer/components/layout/Tabs.js +0 -29
  263. package/dist/react-renderer/components/layout/Tabs.js.map +0 -1
  264. package/dist/react-renderer/components/layout/index.d.ts +0 -7
  265. package/dist/react-renderer/components/layout/index.d.ts.map +0 -1
  266. package/dist/react-renderer/components/layout/index.js +0 -7
  267. package/dist/react-renderer/components/layout/index.js.map +0 -1
  268. package/dist/react-renderer/core/A2UIProvider.d.ts +0 -82
  269. package/dist/react-renderer/core/A2UIProvider.d.ts.map +0 -1
  270. package/dist/react-renderer/core/A2UIProvider.js +0 -156
  271. package/dist/react-renderer/core/A2UIProvider.js.map +0 -1
  272. package/dist/react-renderer/core/A2UIRenderer.d.ts +0 -36
  273. package/dist/react-renderer/core/A2UIRenderer.d.ts.map +0 -1
  274. package/dist/react-renderer/core/A2UIRenderer.js +0 -83
  275. package/dist/react-renderer/core/A2UIRenderer.js.map +0 -1
  276. package/dist/react-renderer/core/A2UIViewer.d.ts +0 -56
  277. package/dist/react-renderer/core/A2UIViewer.d.ts.map +0 -1
  278. package/dist/react-renderer/core/A2UIViewer.js +0 -135
  279. package/dist/react-renderer/core/A2UIViewer.js.map +0 -1
  280. package/dist/react-renderer/core/ComponentNode.d.ts +0 -25
  281. package/dist/react-renderer/core/ComponentNode.d.ts.map +0 -1
  282. package/dist/react-renderer/core/ComponentNode.js +0 -43
  283. package/dist/react-renderer/core/ComponentNode.js.map +0 -1
  284. package/dist/react-renderer/core/store.d.ts +0 -37
  285. package/dist/react-renderer/core/store.d.ts.map +0 -1
  286. package/dist/react-renderer/core/store.js +0 -2
  287. package/dist/react-renderer/core/store.js.map +0 -1
  288. package/dist/react-renderer/hooks/useA2UI.d.ts +0 -46
  289. package/dist/react-renderer/hooks/useA2UI.d.ts.map +0 -1
  290. package/dist/react-renderer/hooks/useA2UI.js +0 -41
  291. package/dist/react-renderer/hooks/useA2UI.js.map +0 -1
  292. package/dist/react-renderer/hooks/useA2UIComponent.d.ts +0 -52
  293. package/dist/react-renderer/hooks/useA2UIComponent.d.ts.map +0 -1
  294. package/dist/react-renderer/hooks/useA2UIComponent.js +0 -175
  295. package/dist/react-renderer/hooks/useA2UIComponent.js.map +0 -1
  296. package/dist/react-renderer/index.d.ts +0 -37
  297. package/dist/react-renderer/index.d.ts.map +0 -1
  298. package/dist/react-renderer/index.js +0 -40
  299. package/dist/react-renderer/index.js.map +0 -1
  300. package/dist/react-renderer/lib/utils.d.ts +0 -32
  301. package/dist/react-renderer/lib/utils.d.ts.map +0 -1
  302. package/dist/react-renderer/lib/utils.js +0 -41
  303. package/dist/react-renderer/lib/utils.js.map +0 -1
  304. package/dist/react-renderer/registry/ComponentRegistry.d.ts +0 -78
  305. package/dist/react-renderer/registry/ComponentRegistry.d.ts.map +0 -1
  306. package/dist/react-renderer/registry/ComponentRegistry.js +0 -113
  307. package/dist/react-renderer/registry/ComponentRegistry.js.map +0 -1
  308. package/dist/react-renderer/registry/defaultCatalog.d.ts +0 -13
  309. package/dist/react-renderer/registry/defaultCatalog.d.ts.map +0 -1
  310. package/dist/react-renderer/registry/defaultCatalog.js +0 -59
  311. package/dist/react-renderer/registry/defaultCatalog.js.map +0 -1
  312. package/dist/react-renderer/styles/index.d.ts +0 -41
  313. package/dist/react-renderer/styles/index.d.ts.map +0 -1
  314. package/dist/react-renderer/styles/index.js.map +0 -1
  315. package/dist/react-renderer/styles/reset.d.ts +0 -18
  316. package/dist/react-renderer/styles/reset.d.ts.map +0 -1
  317. package/dist/react-renderer/styles/reset.js +0 -24
  318. package/dist/react-renderer/styles/reset.js.map +0 -1
  319. package/dist/react-renderer/theme/ThemeContext.d.ts +0 -29
  320. package/dist/react-renderer/theme/ThemeContext.d.ts.map +0 -1
  321. package/dist/react-renderer/theme/ThemeContext.js +0 -35
  322. package/dist/react-renderer/theme/ThemeContext.js.map +0 -1
  323. package/dist/react-renderer/theme/litTheme.d.ts +0 -8
  324. package/dist/react-renderer/theme/litTheme.d.ts.map +0 -1
  325. package/dist/react-renderer/theme/litTheme.js +0 -401
  326. package/dist/react-renderer/theme/litTheme.js.map +0 -1
  327. package/dist/react-renderer/theme/utils.d.ts +0 -23
  328. package/dist/react-renderer/theme/utils.d.ts.map +0 -1
  329. package/dist/react-renderer/theme/utils.js +0 -46
  330. package/dist/react-renderer/theme/utils.js.map +0 -1
  331. package/dist/react-renderer/types.d.ts +0 -53
  332. package/dist/react-renderer/types.d.ts.map +0 -1
  333. package/dist/react-renderer/types.js +0 -2
  334. package/dist/react-renderer/types.js.map +0 -1
  335. package/dist/theme/viewer-theme.d.ts +0 -3
  336. package/dist/theme/viewer-theme.d.ts.map +0 -1
  337. package/dist/theme/viewer-theme.js +0 -391
  338. package/dist/theme/viewer-theme.js.map +0 -1
package/dist/index.umd.js CHANGED
@@ -1,2 +1,3070 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react/jsx-runtime"),require("@copilotkit/react-core/v2"),require("@a2ui/lit"),require("react"),require("zod"),require("@a2ui/lit/0.8")):"function"==typeof define&&define.amd?define(["exports","react/jsx-runtime","@copilotkit/react-core/v2","@a2ui/lit","react","zod","@a2ui/lit/0.8"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).CopilotKitA2UIRenderer={},e.React,e.CopilotKitReactCore,e.A2UILit,e.React,e.Zod,e.A2UILit)}(this,function(e,t,n,r,o,s,i){"use strict";"function"==typeof SuppressedError&&SuppressedError;const a={"typography-f-sf":!0,"typography-fs-n":!0,"typography-w-500":!0,"layout-as-n":!0,"layout-dis-iflx":!0,"layout-al-c":!0,"typography-td-none":!0,"color-c-p40":!0},l={"typography-f-sf":!0,"typography-fs-n":!0,"typography-w-500":!0,"layout-mt-0":!0,"layout-mb-2":!0},c={"typography-f-sf":!0,"typography-fs-n":!0,"typography-w-400":!0,"layout-pl-4":!0,"layout-pr-4":!0,"layout-pt-2":!0,"layout-pb-2":!0,"border-br-6":!0,"border-bw-1":!0,"color-bc-s70":!0,"border-bs-s":!0,"layout-as-n":!0,"color-c-n10":!0},u={"typography-f-s":!0,"typography-fs-n":!0,"typography-w-400":!0,"layout-m-0":!0,"typography-sz-bm":!0,"layout-as-n":!0,"color-c-n10":!0},h={"typography-f-s":!0,"typography-fs-n":!0,"typography-w-400":!0,"layout-m-0":!0,"typography-sz-bm":!0,"layout-as-n":!0,"color-c-n10":!0},p={components:{AudioPlayer:{},Divider:{},Icon:{},Image:{all:{"border-br-5":!0,"layout-el-cv":!0,"layout-w-100":!0,"layout-h-100":!0},avatar:{"is-avatar":!0},header:{},icon:{},largeFeature:{},mediumFeature:{},smallFeature:{}},Text:{all:{"layout-w-100":!0,"layout-g-2":!0},h1:{"typography-f-sf":!0,"typography-v-r":!0,"typography-w-400":!0,"layout-m-0":!0,"layout-p-0":!0,"typography-sz-hs":!0},h2:{"typography-f-sf":!0,"typography-v-r":!0,"typography-w-400":!0,"layout-m-0":!0,"layout-p-0":!0,"typography-sz-tl":!0},h3:{"typography-f-sf":!0,"typography-v-r":!0,"typography-w-400":!0,"layout-m-0":!0,"layout-p-0":!0,"typography-sz-tl":!0},h4:{"typography-f-sf":!0,"typography-v-r":!0,"typography-w-400":!0,"layout-m-0":!0,"layout-p-0":!0,"typography-sz-bl":!0},h5:{"typography-f-sf":!0,"typography-v-r":!0,"typography-w-400":!0,"layout-m-0":!0,"layout-p-0":!0,"typography-sz-bm":!0},body:{},caption:{}},Video:{"border-br-5":!0,"layout-el-cv":!0},Card:{"border-br-9":!0,"layout-p-4":!0,"color-bgc-n100":!0},Column:{"layout-g-2":!0},List:{"layout-g-4":!0,"layout-p-2":!0},Modal:{backdrop:{"color-bbgc-p60_20":!0},element:{"border-br-2":!0,"color-bgc-p100":!0,"layout-p-4":!0,"border-bw-1":!0,"border-bs-s":!0,"color-bc-p80":!0}},Row:{"layout-g-4":!0},Tabs:{container:{},controls:{all:{},selected:{}},element:{}},Button:{"layout-pt-2":!0,"layout-pb-2":!0,"layout-pl-3":!0,"layout-pr-3":!0,"border-br-12":!0,"border-bw-0":!0,"border-bs-s":!0,"color-bgc-p30":!0,"color-c-p100":!0,"behavior-ho-70":!0,"typography-w-400":!0},CheckBox:{container:{"layout-dsp-iflex":!0,"layout-al-c":!0},element:{"layout-m-0":!0,"layout-mr-2":!0,"layout-p-2":!0,"border-br-12":!0,"border-bw-1":!0,"border-bs-s":!0,"color-bgc-p100":!0,"color-bc-p60":!0,"color-c-n30":!0,"color-c-p30":!0},label:{"color-c-p30":!0,"typography-f-sf":!0,"typography-v-r":!0,"typography-w-400":!0,"layout-flx-1":!0,"typography-sz-ll":!0}},DateTimeInput:{container:{"typography-sz-bm":!0,"layout-w-100":!0,"layout-g-2":!0,"layout-dsp-flexhor":!0,"layout-al-c":!0,"typography-ws-nw":!0},label:{"color-c-p30":!0,"typography-sz-bm":!0},element:{"layout-pt-2":!0,"layout-pb-2":!0,"layout-pl-3":!0,"layout-pr-3":!0,"border-br-2":!0,"border-bw-1":!0,"border-bs-s":!0,"color-bgc-p100":!0,"color-bc-p60":!0,"color-c-n30":!0,"color-c-p30":!0}},MultipleChoice:{container:{},label:{},element:{}},Slider:{container:{},label:{},element:{}},TextField:{container:{"typography-sz-bm":!0,"layout-w-100":!0,"layout-g-2":!0,"layout-dsp-flexhor":!0,"layout-al-c":!0,"typography-ws-nw":!0},label:{"layout-flx-0":!0,"color-c-p30":!0},element:{"typography-sz-bm":!0,"layout-pt-2":!0,"layout-pb-2":!0,"layout-pl-3":!0,"layout-pr-3":!0,"border-br-2":!0,"border-bw-1":!0,"border-bs-s":!0,"color-bgc-p100":!0,"color-bc-p60":!0,"color-c-n30":!0,"color-c-p30":!0}}},elements:{a:a,audio:{"layout-w-100":!0},body:{"typography-f-s":!0,"typography-fs-n":!0,"typography-w-400":!0,"layout-mt-0":!0,"layout-mb-2":!0,"typography-sz-bm":!0,"color-c-n10":!0},button:{"typography-f-sf":!0,"typography-fs-n":!0,"typography-w-500":!0,"layout-pt-3":!0,"layout-pb-3":!0,"layout-pl-5":!0,"layout-pr-5":!0,"layout-mb-1":!0,"border-br-16":!0,"border-bw-0":!0,"border-c-n70":!0,"border-bs-s":!0,"color-bgc-s30":!0,"behavior-ho-80":!0},h1:l,h2:l,h3:l,h4:l,h5:l,iframe:{"behavior-sw-n":!0},input:c,p:u,pre:{"typography-f-c":!0,"typography-fs-n":!0,"typography-w-400":!0,"typography-sz-bm":!0,"typography-ws-p":!0,"layout-as-n":!0},textarea:Object.assign(Object.assign({},c),{"layout-r-none":!0,"layout-fs-c":!0}),video:{"layout-el-cv":!0}},markdown:{p:Object.keys(u),h1:Object.keys(l),h2:Object.keys(l),h3:Object.keys(l),h4:Object.keys(l),h5:Object.keys(l),ul:Object.keys(h),ol:Object.keys(h),li:Object.keys(h),a:Object.keys(a),strong:[],em:[]}},d=o.createContext(void 0);function f({theme:e,children:n}){return t.jsx(d.Provider,{value:null!=e?e:p,children:n})}const m=o.createContext(null),g=o.createContext(null);function y({onAction:e,theme:n,children:r}){const s=o.useRef(null);s.current||(s.current=i.Data.createSignalA2uiMessageProcessor());const a=s.current,[l,c]=o.useState(0),u=o.useRef(null!=e?e:null);u.current=null!=e?e:null;const h=o.useRef(null);h.current||(h.current={processMessages:e=>{a.processMessages(e),c(e=>e+1)},setData:(e,t,n,r)=>{a.setData(e,t,n,r),c(e=>e+1)},dispatch:e=>{u.current&&u.current(e)},clearSurfaces:()=>{a.clearSurfaces(),c(e=>e+1)},getSurface:e=>a.getSurfaces().get(e),getSurfaces:()=>a.getSurfaces(),getData:(e,t,n)=>a.getData(e,t,n),resolvePath:(e,t)=>a.resolvePath(e,t)});const p=h.current,d=o.useMemo(()=>({version:l}),[l]);return t.jsx(m.Provider,{value:p,children:t.jsx(g.Provider,{value:d,children:t.jsx(f,{theme:n,children:r})})})}function b(){const e=o.useContext(m);if(!e)throw new Error("useA2UIActions must be used within an A2UIProvider");return e}function _(){const e=o.useContext(g);if(!e)throw new Error("useA2UIState must be used within an A2UIProvider");return e}class k{constructor(){this.registry=new Map,this.lazyCache=new Map}static getInstance(){return k._instance||(k._instance=new k),k._instance}static resetInstance(){k._instance=null}register(e,t){this.registry.set(e,t)}unregister(e){this.registry.delete(e),this.lazyCache.delete(e)}has(e){return this.registry.has(e)}get(e){const t=this.registry.get(e);if(!t)return null;if(t.lazy&&"function"==typeof t.component){const n=this.lazyCache.get(e);if(n)return n;const r=o.lazy(t.component);return this.lazyCache.set(e,r),r}return t.component}getRegisteredTypes(){return Array.from(this.registry.keys())}clear(){this.registry.clear(),this.lazyCache.clear()}}k._instance=null;const v=o.memo(function(){return t.jsx("div",{className:"a2ui-loading",style:{padding:"8px",opacity:.5},children:"Loading..."})}),x=o.memo(function({node:e,surfaceId:n,registry:r}){const s=null!=r?r:k.getInstance(),i=e&&"object"==typeof e&&"type"in e?e.type:null,a=o.useMemo(()=>i?s.get(i):null,[s,i]);return i?a?t.jsx(o.Suspense,{fallback:t.jsx(v,{}),children:t.jsx(a,{node:e,surfaceId:n})}):(console.warn(`[A2UI] Unknown component type: ${i}`),null):(e&&console.warn("[A2UI] Invalid component node (not resolved?):",e),null)});function C(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=C(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function D(e){return e?Object.entries(e).filter(([,e])=>e).map(([e])=>e).join(" "):""}function w(e){if(!e||0===Object.keys(e).length)return;const t={};for(const[n,r]of Object.entries(e))if(n.startsWith("--"))t[n]=r;else{t[n.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())]=r}return t}function A(...e){return function(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=C(e))&&(r&&(r+=" "),r+=t);return r}(e)}function E(...e){const t=e.filter(e=>void 0!==e);return 0===t.length?{}:i.Styles.merge(...t)}const F=o.memo(function(){return t.jsx("div",{className:"a2ui-loading",style:{padding:"16px",opacity:.5},children:"Loading..."})}),S=o.memo(function({surfaceId:e,className:n,fallback:r=null,loadingFallback:s,registry:i}){const{getSurface:a,version:l}=function(){const e=b(),t=_();return{processMessages:e.processMessages,getSurface:e.getSurface,getSurfaces:e.getSurfaces,clearSurfaces:e.clearSurfaces,version:t.version}}(),c=a(e),u=o.useMemo(()=>{if(!(null==c?void 0:c.styles))return{};const e={};for(const[t,n]of Object.entries(c.styles))switch(t){case"primaryColor":e["--p-100"]="#ffffff",e["--p-99"]=`color-mix(in srgb, ${n} 2%, white 98%)`,e["--p-98"]=`color-mix(in srgb, ${n} 4%, white 96%)`,e["--p-95"]=`color-mix(in srgb, ${n} 10%, white 90%)`,e["--p-90"]=`color-mix(in srgb, ${n} 20%, white 80%)`,e["--p-80"]=`color-mix(in srgb, ${n} 40%, white 60%)`,e["--p-70"]=`color-mix(in srgb, ${n} 60%, white 40%)`,e["--p-60"]=`color-mix(in srgb, ${n} 80%, white 20%)`,e["--p-50"]=String(n),e["--p-40"]=`color-mix(in srgb, ${n} 80%, black 20%)`,e["--p-35"]=`color-mix(in srgb, ${n} 70%, black 30%)`,e["--p-30"]=`color-mix(in srgb, ${n} 60%, black 40%)`,e["--p-25"]=`color-mix(in srgb, ${n} 50%, black 50%)`,e["--p-20"]=`color-mix(in srgb, ${n} 40%, black 60%)`,e["--p-15"]=`color-mix(in srgb, ${n} 30%, black 70%)`,e["--p-10"]=`color-mix(in srgb, ${n} 20%, black 80%)`,e["--p-5"]=`color-mix(in srgb, ${n} 10%, black 90%)`,e["--p-0"]="#000000";break;case"font":e["--font-family"]=String(n),e["--font-family-flex"]=String(n)}return e},[null==c?void 0:c.styles]);if(!c||!c.componentTree)return t.jsx(t.Fragment,{children:r});const h=null!=s?s:t.jsx(F,{});return t.jsx("div",{className:A("a2ui-surface",n),style:u,"data-surface-id":e,"data-version":l,children:t.jsx(o.Suspense,{fallback:h,children:t.jsx(x,{node:c.componentTree,surfaceId:e,registry:i})})})});function j(e,t){const n=b(),r=function(){const e=o.useContext(d);if(!e)throw new Error("useTheme must be used within a ThemeProvider or A2UIProvider");return e}(),s=o.useId();_();const i=o.useCallback(r=>{if(!r)return null;if("object"!=typeof r)return null;if(void 0!==r.literalString)return r.literalString;if(void 0!==r.literal)return String(r.literal);if(r.path){const o=n.getData(e,r.path,t);return null!==o?String(o):null}return null},[n,e,t]),a=o.useCallback(r=>{if(!r)return null;if("object"!=typeof r)return null;if(void 0!==r.literalNumber)return r.literalNumber;if(void 0!==r.literal)return Number(r.literal);if(r.path){const o=n.getData(e,r.path,t);return null!==o?Number(o):null}return null},[n,e,t]),l=o.useCallback(r=>{if(!r)return null;if("object"!=typeof r)return null;if(void 0!==r.literalBoolean)return r.literalBoolean;if(void 0!==r.literal)return Boolean(r.literal);if(r.path){const o=n.getData(e,r.path,t);return null!==o?Boolean(o):null}return null},[n,e,t]),c=o.useCallback((r,o)=>{n.setData(e,r,o,t)},[n,e,t]),u=o.useCallback(r=>n.getData(e,r,t),[n,e,t]),h=o.useCallback(r=>{const o={};if(r.context)for(const s of r.context)if(void 0!==s.value.literalString)o[s.key]=s.value.literalString;else if(void 0!==s.value.literalNumber)o[s.key]=s.value.literalNumber;else if(void 0!==s.value.literalBoolean)o[s.key]=s.value.literalBoolean;else if(s.value.path){const r=n.resolvePath(s.value.path,e.dataContextPath);o[s.key]=n.getData(e,r,t)}n.dispatch({userAction:{name:r.name,sourceComponentId:e.id,surfaceId:t,timestamp:(new Date).toISOString(),context:o}})},[n,e,t]),p=o.useCallback(e=>`${e}${s}`,[s]);return o.useMemo(()=>({theme:r,resolveString:i,resolveNumber:a,resolveBoolean:l,setValue:c,getValue:u,sendAction:h,getUniqueId:p}),[r,i,a,l,c,u,h,p])}const I={};function z(e,t){"string"!=typeof t&&(t=z.defaultChars);const n=function(e){let t=I[e];if(t)return t;t=I[e]=[];for(let e=0;e<128;e++){const n=String.fromCharCode(e);t.push(n)}for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return t}(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(e){let t="";for(let r=0,o=e.length;r<o;r+=3){const s=parseInt(e.slice(r+1,r+3),16);if(s<128)t+=n[s];else{if(192==(224&s)&&r+3<o){const n=parseInt(e.slice(r+4,r+6),16);if(128==(192&n)){const e=s<<6&1984|63&n;t+=e<128?"��":String.fromCharCode(e),r+=3;continue}}if(224==(240&s)&&r+6<o){const n=parseInt(e.slice(r+4,r+6),16),o=parseInt(e.slice(r+7,r+9),16);if(128==(192&n)&&128==(192&o)){const e=s<<12&61440|n<<6&4032|63&o;t+=e<2048||e>=55296&&e<=57343?"���":String.fromCharCode(e),r+=6;continue}}if(240==(248&s)&&r+9<o){const n=parseInt(e.slice(r+4,r+6),16),o=parseInt(e.slice(r+7,r+9),16),i=parseInt(e.slice(r+10,r+12),16);if(128==(192&n)&&128==(192&o)&&128==(192&i)){let e=s<<18&1835008|n<<12&258048|o<<6&4032|63&i;e<65536||e>1114111?t+="����":(e-=65536,t+=String.fromCharCode(55296+(e>>10),56320+(1023&e))),r+=9;continue}}t+="�"}}return t})}z.defaultChars=";/?:@&=+$,#",z.componentChars="";const B={};function L(e,t,n){"string"!=typeof t&&(n=t,t=L.defaultChars),void 0===n&&(n=!0);const r=function(e){let t=B[e];if(t)return t;t=B[e]=[];for(let e=0;e<128;e++){const n=String.fromCharCode(e);/^[0-9a-z]$/i.test(n)?t.push(n):t.push("%"+("0"+e.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}(t);let o="";for(let t=0,s=e.length;t<s;t++){const i=e.charCodeAt(t);if(n&&37===i&&t+2<s&&/^[0-9a-f]{2}$/i.test(e.slice(t+1,t+3)))o+=e.slice(t,t+3),t+=2;else if(i<128)o+=r[i];else if(i>=55296&&i<=57343){if(i>=55296&&i<=56319&&t+1<s){const n=e.charCodeAt(t+1);if(n>=56320&&n<=57343){o+=encodeURIComponent(e[t]+e[t+1]),t++;continue}}o+="%EF%BF%BD"}else o+=encodeURIComponent(e[t])}return o}function N(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&-1!==e.hostname.indexOf(":")?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function T(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}L.defaultChars=";/?:@&=+$,-_.!~*'()#",L.componentChars="-_.!~*'()";const M=/^([a-z0-9.+-]+:)/i,q=/:[0-9]*$/,O=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,R=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),P=["'"].concat(R),$=["%","/","?",";","#"].concat(P),U=["/","?","#"],Z=/^[+a-z0-9A-Z_-]{0,63}$/,V=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,H={javascript:!0,"javascript:":!0},G={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function W(e,t){if(e&&e instanceof T)return e;const n=new T;return n.parse(e,t),n}T.prototype.parse=function(e,t){let n,r,o,s=e;if(s=s.trim(),!t&&1===e.split("#").length){const e=O.exec(s);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let i=M.exec(s);if(i&&(i=i[0],n=i.toLowerCase(),this.protocol=i,s=s.substr(i.length)),(t||i||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o="//"===s.substr(0,2),!o||i&&H[i]||(s=s.substr(2),this.slashes=!0)),!H[i]&&(o||i&&!G[i])){let e,t,n=-1;for(let e=0;e<U.length;e++)r=s.indexOf(U[e]),-1!==r&&(-1===n||r<n)&&(n=r);t=-1===n?s.lastIndexOf("@"):s.lastIndexOf("@",n),-1!==t&&(e=s.slice(0,t),s=s.slice(t+1),this.auth=e),n=-1;for(let e=0;e<$.length;e++)r=s.indexOf($[e]),-1!==r&&(-1===n||r<n)&&(n=r);-1===n&&(n=s.length),":"===s[n-1]&&n--;const o=s.slice(0,n);s=s.slice(n),this.parseHost(o),this.hostname=this.hostname||"";const i="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!i){const e=this.hostname.split(/\./);for(let t=0,n=e.length;t<n;t++){const n=e[t];if(n&&!n.match(Z)){let r="";for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+="x":r+=n[e];if(!r.match(Z)){const r=e.slice(0,t),o=e.slice(t+1),i=n.match(V);i&&(r.push(i[1]),o.unshift(i[2])),o.length&&(s=o.join(".")+s),this.hostname=r.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),i&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=s.indexOf("#");-1!==a&&(this.hash=s.substr(a),s=s.slice(0,a));const l=s.indexOf("?");return-1!==l&&(this.search=s.substr(l),s=s.slice(0,l)),s&&(this.pathname=s),G[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this},T.prototype.parseHost=function(e){let t=q.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var J,Q=Object.freeze({__proto__:null,decode:z,encode:L,format:N,parse:W}),K=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,X=/[\0-\x1F\x7F-\x9F]/,Y=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,ee=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,te=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,ne=Object.freeze({__proto__:null,Any:K,Cc:X,Cf:/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,P:Y,S:ee,Z:te}),re=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),oe=new Uint16Array("Ȁaglq\tɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));const se=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),ie=null!==(J=String.fromCodePoint)&&void 0!==J?J:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e),t};var ae;!function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"}(ae||(ae={}));var le,ce,ue;function he(e){return e>=ae.ZERO&&e<=ae.NINE}function pe(e){return e>=ae.UPPER_A&&e<=ae.UPPER_F||e>=ae.LOWER_A&&e<=ae.LOWER_F}function de(e){return e===ae.EQUALS||function(e){return e>=ae.UPPER_A&&e<=ae.UPPER_Z||e>=ae.LOWER_A&&e<=ae.LOWER_Z||he(e)}(e)}!function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"}(le||(le={})),function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"}(ce||(ce={})),function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"}(ue||(ue={}));class fe{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=ce.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ue.Strict}startEntity(e){this.decodeMode=e,this.state=ce.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case ce.EntityStart:return e.charCodeAt(t)===ae.NUM?(this.state=ce.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=ce.NamedEntity,this.stateNamedEntity(e,t));case ce.NumericStart:return this.stateNumericStart(e,t);case ce.NumericDecimal:return this.stateNumericDecimal(e,t);case ce.NumericHex:return this.stateNumericHex(e,t);case ce.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(32|e.charCodeAt(t))===ae.LOWER_X?(this.state=ce.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=ce.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){const o=n-t;this.result=this.result*Math.pow(r,o)+parseInt(e.substr(t,o),r),this.consumed+=o}}stateNumericHex(e,t){const n=t;for(;t<e.length;){const r=e.charCodeAt(t);if(!he(r)&&!pe(r))return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3);t+=1}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){const n=t;for(;t<e.length;){const r=e.charCodeAt(t);if(!he(r))return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2);t+=1}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return null===(n=this.errors)||void 0===n||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===ae.SEMI)this.consumed+=1;else if(this.decodeMode===ue.Strict)return 0;return this.emitCodePoint(function(e){var t;return e>=55296&&e<=57343||e>1114111?65533:null!==(t=se.get(e))&&void 0!==t?t:e}(this.result),this.consumed),this.errors&&(e!==ae.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let r=n[this.treeIndex],o=(r&le.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const s=e.charCodeAt(t);if(this.treeIndex=ge(n,r,this.treeIndex+Math.max(1,o),s),this.treeIndex<0)return 0===this.result||this.decodeMode===ue.Attribute&&(0===o||de(s))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],o=(r&le.VALUE_LENGTH)>>14,0!==o){if(s===ae.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==ue.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,r=(n[t]&le.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),null===(e=this.errors)||void 0===e||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:r}=this;return this.emitCodePoint(1===t?r[e]&~le.VALUE_LENGTH:r[e+1],n),3===t&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case ce.NamedEntity:return 0===this.result||this.decodeMode===ue.Attribute&&this.result!==this.treeIndex?0:this.emitNotTerminatedNamedEntity();case ce.NumericDecimal:return this.emitNumericEntity(0,2);case ce.NumericHex:return this.emitNumericEntity(0,3);case ce.NumericStart:return null===(e=this.errors)||void 0===e||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ce.EntityStart:return 0}}}function me(e){let t="";const n=new fe(e,e=>t+=ie(e));return function(e,r){let o=0,s=0;for(;(s=e.indexOf("&",s))>=0;){t+=e.slice(o,s),n.startEntity(r);const i=n.write(e,s+1);if(i<0){o=s+n.end();break}o=s+i,s=0===i?o+1:o}const i=t+e.slice(o);return t="",i}}function ge(e,t,n,r){const o=(t&le.BRANCH_LENGTH)>>7,s=t&le.JUMP_TABLE;if(0===o)return 0!==s&&r===s?n:-1;if(s){const t=r-s;return t<0||t>=o?-1:e[n+t]-1}let i=n,a=i+o-1;for(;i<=a;){const t=i+a>>>1,n=e[t];if(n<r)i=t+1;else{if(!(n>r))return e[t+o];a=t-1}}return-1}const ye=me(re);function be(e,t=ue.Legacy){return ye(e,t)}function _e(e){return"[object String]"===function(e){return Object.prototype.toString.call(e)}(e)}me(oe);const ke=Object.prototype.hasOwnProperty;function ve(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e}function xe(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function Ce(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(!!(65535&~e&&65534!=(65535&e))&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function De(e){if(e>65535){const t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const we=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Ae=new RegExp(we.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),Ee=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Fe(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(Ae,function(e,t,n){return t||function(e,t){if(35===t.charCodeAt(0)&&Ee.test(t)){const n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Ce(n)?De(n):e}const n=be(e);return n!==e?n:e}(e,n)})}const Se=/[&<>"]/,je=/[&<>"]/g,Ie={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function ze(e){return Ie[e]}function Be(e){return Se.test(e)?e.replace(je,ze):e}const Le=/[.?*+^$[\]\\(){}|-]/g;function Ne(e){switch(e){case 9:case 32:return!0}return!1}function Te(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Me(e){return Y.test(e)||ee.test(e)}function qe(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Oe(e){return e=e.trim().replace(/\s+/g," "),"Ṿ"==="ẞ".toLowerCase()&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}const Re={mdurl:Q,ucmicro:ne};var Pe=Object.freeze({__proto__:null,arrayReplaceAt:xe,assign:ve,escapeHtml:Be,escapeRE:function(e){return e.replace(Le,"\\$&")},fromCodePoint:De,has:function(e,t){return ke.call(e,t)},isMdAsciiPunct:qe,isPunctChar:Me,isSpace:Ne,isString:_e,isValidEntityCode:Ce,isWhiteSpace:Te,lib:Re,normalizeReference:Oe,unescapeAll:Fe,unescapeMd:function(e){return e.indexOf("\\")<0?e:e.replace(we,"$1")}});var $e=Object.freeze({__proto__:null,parseLinkDestination:function(e,t,n){let r,o=t;const s={ok:!1,pos:0,str:""};if(60===e.charCodeAt(o)){for(o++;o<n;){if(r=e.charCodeAt(o),10===r)return s;if(60===r)return s;if(62===r)return s.pos=o+1,s.str=Fe(e.slice(t+1,o)),s.ok=!0,s;92===r&&o+1<n?o+=2:o++}return s}let i=0;for(;o<n&&(r=e.charCodeAt(o),32!==r)&&!(r<32||127===r);)if(92===r&&o+1<n){if(32===e.charCodeAt(o+1))break;o+=2}else{if(40===r&&(i++,i>32))return s;if(41===r){if(0===i)break;i--}o++}return t===o||0!==i||(s.str=Fe(e.slice(t,o)),s.pos=o,s.ok=!0),s},parseLinkLabel:function(e,t,n){let r,o,s,i;const a=e.posMax,l=e.pos;for(e.pos=t+1,r=1;e.pos<a;){if(s=e.src.charCodeAt(e.pos),93===s&&(r--,0===r)){o=!0;break}if(i=e.pos,e.md.inline.skipToken(e),91===s)if(i===e.pos-1)r++;else if(n)return e.pos=l,-1}let c=-1;return o&&(c=e.pos),e.pos=l,c},parseLinkTitle:function(e,t,n,r){let o,s=t;const i={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)i.str=r.str,i.marker=r.marker;else{if(s>=n)return i;let r=e.charCodeAt(s);if(34!==r&&39!==r&&40!==r)return i;t++,s++,40===r&&(r=41),i.marker=r}for(;s<n;){if(o=e.charCodeAt(s),o===i.marker)return i.pos=s+1,i.str+=Fe(e.slice(t,s)),i.ok=!0,i;if(40===o&&41===i.marker)return i;92===o&&s+1<n&&s++,s++}return i.can_continue=!0,i.str+=Fe(e.slice(t,s)),i}});const Ue={};function Ze(){this.rules=ve({},Ue)}function Ve(){this.__rules__=[],this.__cache__=null}function He(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}function Ge(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}Ue.code_inline=function(e,t,n,r,o){const s=e[t];return"<code"+o.renderAttrs(s)+">"+Be(s.content)+"</code>"},Ue.code_block=function(e,t,n,r,o){const s=e[t];return"<pre"+o.renderAttrs(s)+"><code>"+Be(e[t].content)+"</code></pre>\n"},Ue.fence=function(e,t,n,r,o){const s=e[t],i=s.info?Fe(s.info).trim():"";let a,l="",c="";if(i){const e=i.split(/(\s+)/g);l=e[0],c=e.slice(2).join("")}if(a=n.highlight&&n.highlight(s.content,l,c)||Be(s.content),0===a.indexOf("<pre"))return a+"\n";if(i){const e=s.attrIndex("class"),t=s.attrs?s.attrs.slice():[];e<0?t.push(["class",n.langPrefix+l]):(t[e]=t[e].slice(),t[e][1]+=" "+n.langPrefix+l);const r={attrs:t};return`<pre><code${o.renderAttrs(r)}>${a}</code></pre>\n`}return`<pre><code${o.renderAttrs(s)}>${a}</code></pre>\n`},Ue.image=function(e,t,n,r,o){const s=e[t];return s.attrs[s.attrIndex("alt")][1]=o.renderInlineAsText(s.children,n,r),o.renderToken(e,t,n)},Ue.hardbreak=function(e,t,n){return n.xhtmlOut?"<br />\n":"<br>\n"},Ue.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},Ue.text=function(e,t){return Be(e[t].content)},Ue.html_block=function(e,t){return e[t].content},Ue.html_inline=function(e,t){return e[t].content},Ze.prototype.renderAttrs=function(e){let t,n,r;if(!e.attrs)return"";for(r="",t=0,n=e.attrs.length;t<n;t++)r+=" "+Be(e.attrs[t][0])+'="'+Be(e.attrs[t][1])+'"';return r},Ze.prototype.renderToken=function(e,t,n){const r=e[t];let o="";if(r.hidden)return"";r.block&&-1!==r.nesting&&t&&e[t-1].hidden&&(o+="\n"),o+=(-1===r.nesting?"</":"<")+r.tag,o+=this.renderAttrs(r),0===r.nesting&&n.xhtmlOut&&(o+=" /");let s=!1;if(r.block&&(s=!0,1===r.nesting&&t+1<e.length)){const n=e[t+1];("inline"===n.type||n.hidden||-1===n.nesting&&n.tag===r.tag)&&(s=!1)}return o+=s?">\n":">",o},Ze.prototype.renderInline=function(e,t,n){let r="";const o=this.rules;for(let s=0,i=e.length;s<i;s++){const i=e[s].type;void 0!==o[i]?r+=o[i](e,s,t,n,this):r+=this.renderToken(e,s,t)}return r},Ze.prototype.renderInlineAsText=function(e,t,n){let r="";for(let o=0,s=e.length;o<s;o++)switch(e[o].type){case"text":case"html_inline":case"html_block":r+=e[o].content;break;case"image":r+=this.renderInlineAsText(e[o].children,t,n);break;case"softbreak":case"hardbreak":r+="\n"}return r},Ze.prototype.render=function(e,t,n){let r="";const o=this.rules;for(let s=0,i=e.length;s<i;s++){const i=e[s].type;"inline"===i?r+=this.renderInline(e[s].children,t,n):void 0!==o[i]?r+=o[i](e,s,t,n,this):r+=this.renderToken(e,s,t,n)}return r},Ve.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1},Ve.prototype.__compile__=function(){const e=this,t=[""];e.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(e){t.indexOf(e)<0&&t.push(e)})}),e.__cache__={},t.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(n){n.enabled&&(t&&n.alt.indexOf(t)<0||e.__cache__[t].push(n.fn))})})},Ve.prototype.at=function(e,t,n){const r=this.__find__(e),o=n||{};if(-1===r)throw new Error("Parser rule not found: "+e);this.__rules__[r].fn=t,this.__rules__[r].alt=o.alt||[],this.__cache__=null},Ve.prototype.before=function(e,t,n,r){const o=this.__find__(e),s=r||{};if(-1===o)throw new Error("Parser rule not found: "+e);this.__rules__.splice(o,0,{name:t,enabled:!0,fn:n,alt:s.alt||[]}),this.__cache__=null},Ve.prototype.after=function(e,t,n,r){const o=this.__find__(e),s=r||{};if(-1===o)throw new Error("Parser rule not found: "+e);this.__rules__.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:s.alt||[]}),this.__cache__=null},Ve.prototype.push=function(e,t,n){const r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},Ve.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(e){const r=this.__find__(e);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+e)}this.__rules__[r].enabled=!0,n.push(e)},this),this.__cache__=null,n},Ve.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(e){e.enabled=!1}),this.enable(e,t)},Ve.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(e){const r=this.__find__(e);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+e)}this.__rules__[r].enabled=!1,n.push(e)},this),this.__cache__=null,n},Ve.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[]},He.prototype.attrIndex=function(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,r=t.length;n<r;n++)if(t[n][0]===e)return n;return-1},He.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},He.prototype.attrSet=function(e,t){const n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r},He.prototype.attrGet=function(e){const t=this.attrIndex(e);let n=null;return t>=0&&(n=this.attrs[t][1]),n},He.prototype.attrJoin=function(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+" "+t},Ge.prototype.Token=He;const We=/\r\n?|\n/g,Je=/\0/g;function Qe(e){return/^<a[>\s]/i.test(e)}function Ke(e){return/^<\/a\s*>/i.test(e)}const Xe=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,Ye=/\((c|tm|r)\)/i,et=/\((c|tm|r)\)/gi,tt={c:"©",r:"®",tm:"™"};function nt(e,t){return tt[t.toLowerCase()]}function rt(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];"text"!==r.type||t||(r.content=r.content.replace(et,nt)),"link_open"===r.type&&"auto"===r.info&&t--,"link_close"===r.type&&"auto"===r.info&&t++}}function ot(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];"text"!==r.type||t||Xe.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),"link_open"===r.type&&"auto"===r.info&&t--,"link_close"===r.type&&"auto"===r.info&&t++}}const st=/['"]/,it=/['"]/g;function at(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function lt(e,t){let n;const r=[];for(let o=0;o<e.length;o++){const s=e[o],i=e[o].level;for(n=r.length-1;n>=0&&!(r[n].level<=i);n--);if(r.length=n+1,"text"!==s.type)continue;let a=s.content,l=0,c=a.length;e:for(;l<c;){it.lastIndex=l;const u=it.exec(a);if(!u)break;let h=!0,p=!0;l=u.index+1;const d="'"===u[0];let f=32;if(u.index-1>=0)f=a.charCodeAt(u.index-1);else for(n=o-1;n>=0&&("softbreak"!==e[n].type&&"hardbreak"!==e[n].type);n--)if(e[n].content){f=e[n].content.charCodeAt(e[n].content.length-1);break}let m=32;if(l<c)m=a.charCodeAt(l);else for(n=o+1;n<e.length&&("softbreak"!==e[n].type&&"hardbreak"!==e[n].type);n++)if(e[n].content){m=e[n].content.charCodeAt(0);break}const g=qe(f)||Me(String.fromCharCode(f)),y=qe(m)||Me(String.fromCharCode(m)),b=Te(f),_=Te(m);if(_?h=!1:y&&(b||g||(h=!1)),b?p=!1:g&&(_||y||(p=!1)),34===m&&'"'===u[0]&&f>=48&&f<=57&&(p=h=!1),h&&p&&(h=g,p=y),h||p){if(p)for(n=r.length-1;n>=0;n--){let h=r[n];if(r[n].level<i)break;if(h.single===d&&r[n].level===i){let i,p;h=r[n],d?(i=t.md.options.quotes[2],p=t.md.options.quotes[3]):(i=t.md.options.quotes[0],p=t.md.options.quotes[1]),s.content=at(s.content,u.index,p),e[h.token].content=at(e[h.token].content,h.pos,i),l+=p.length-1,h.token===o&&(l+=i.length-1),a=s.content,c=a.length,r.length=n;continue e}}h?r.push({token:o,pos:u.index,single:d,level:i}):p&&d&&(s.content=at(s.content,u.index,"’"))}else d&&(s.content=at(s.content,u.index,"’"))}}}const ct=[["normalize",function(e){let t;t=e.src.replace(We,"\n"),t=t.replace(Je,"�"),e.src=t}],["block",function(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}],["inline",function(e){const t=e.tokens;for(let n=0,r=t.length;n<r;n++){const r=t[n];"inline"===r.type&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}],["linkify",function(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,r=t.length;n<r;n++){if("inline"!==t[n].type||!e.md.linkify.pretest(t[n].content))continue;let r=t[n].children,o=0;for(let s=r.length-1;s>=0;s--){const i=r[s];if("link_close"!==i.type){if("html_inline"===i.type&&(Qe(i.content)&&o>0&&o--,Ke(i.content)&&o++),!(o>0)&&"text"===i.type&&e.md.linkify.test(i.content)){const o=i.content;let a=e.md.linkify.match(o);const l=[];let c=i.level,u=0;a.length>0&&0===a[0].index&&s>0&&"text_special"===r[s-1].type&&(a=a.slice(1));for(let t=0;t<a.length;t++){const n=a[t].url,r=e.md.normalizeLink(n);if(!e.md.validateLink(r))continue;let s=a[t].text;s=a[t].schema?"mailto:"!==a[t].schema||/^mailto:/i.test(s)?e.md.normalizeLinkText(s):e.md.normalizeLinkText("mailto:"+s).replace(/^mailto:/,""):e.md.normalizeLinkText("http://"+s).replace(/^http:\/\//,"");const i=a[t].index;if(i>u){const t=new e.Token("text","",0);t.content=o.slice(u,i),t.level=c,l.push(t)}const h=new e.Token("link_open","a",1);h.attrs=[["href",r]],h.level=c++,h.markup="linkify",h.info="auto",l.push(h);const p=new e.Token("text","",0);p.content=s,p.level=c,l.push(p);const d=new e.Token("link_close","a",-1);d.level=--c,d.markup="linkify",d.info="auto",l.push(d),u=a[t].lastIndex}if(u<o.length){const t=new e.Token("text","",0);t.content=o.slice(u),t.level=c,l.push(t)}t[n].children=r=xe(r,s,l)}}else for(s--;r[s].level!==i.level&&"link_open"!==r[s].type;)s--}}}],["replacements",function(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)"inline"===e.tokens[t].type&&(Ye.test(e.tokens[t].content)&&rt(e.tokens[t].children),Xe.test(e.tokens[t].content)&&ot(e.tokens[t].children))}],["smartquotes",function(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)"inline"===e.tokens[t].type&&st.test(e.tokens[t].content)&&lt(e.tokens[t].children,e)}],["text_join",function(e){let t,n;const r=e.tokens,o=r.length;for(let e=0;e<o;e++){if("inline"!==r[e].type)continue;const o=r[e].children,s=o.length;for(t=0;t<s;t++)"text_special"===o[t].type&&(o[t].type="text");for(t=n=0;t<s;t++)"text"===o[t].type&&t+1<s&&"text"===o[t+1].type?o[t+1].content=o[t].content+o[t+1].content:(t!==n&&(o[n]=o[t]),n++);t!==n&&(o.length=n)}}]];function ut(){this.ruler=new Ve;for(let e=0;e<ct.length;e++)this.ruler.push(ct[e][0],ct[e][1])}function ht(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const o=this.src;for(let e=0,t=0,n=0,r=0,s=o.length,i=!1;t<s;t++){const a=o.charCodeAt(t);if(!i){if(Ne(a)){n++,9===a?r+=4-r%4:r++;continue}i=!0}10!==a&&t!==s-1||(10!==a&&t++,this.bMarks.push(e),this.eMarks.push(t),this.tShift.push(n),this.sCount.push(r),this.bsCount.push(0),i=!1,n=0,r=0,e=t+1)}this.bMarks.push(o.length),this.eMarks.push(o.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}ut.prototype.process=function(e){const t=this.ruler.getRules("");for(let n=0,r=t.length;n<r;n++)t[n](e)},ut.prototype.State=Ge,ht.prototype.push=function(e,t,n){const r=new He(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r},ht.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},ht.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},ht.prototype.skipSpaces=function(e){for(let t=this.src.length;e<t;e++){if(!Ne(this.src.charCodeAt(e)))break}return e},ht.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!Ne(this.src.charCodeAt(--e)))return e+1;return e},ht.prototype.skipChars=function(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},ht.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},ht.prototype.getLines=function(e,t,n,r){if(e>=t)return"";const o=new Array(t-e);for(let s=0,i=e;i<t;i++,s++){let e=0;const a=this.bMarks[i];let l,c=a;for(l=i+1<t||r?this.eMarks[i]+1:this.eMarks[i];c<l&&e<n;){const t=this.src.charCodeAt(c);if(Ne(t))9===t?e+=4-(e+this.bsCount[i])%4:e++;else{if(!(c-a<this.tShift[i]))break;e++}c++}o[s]=e>n?new Array(e-n+1).join(" ")+this.src.slice(c,l):this.src.slice(c,l)}return o.join("")},ht.prototype.Token=He;function pt(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function dt(e){const t=[],n=e.length;let r=0,o=e.charCodeAt(r),s=!1,i=0,a="";for(;r<n;)124===o&&(s?(a+=e.substring(i,r-1),i=r):(t.push(a+e.substring(i,r)),a="",i=r+1)),s=92===o,r++,o=e.charCodeAt(r);return t.push(a+e.substring(i)),t}function ft(e,t){const n=e.eMarks[t];let r=e.bMarks[t]+e.tShift[t];const o=e.src.charCodeAt(r++);if(42!==o&&45!==o&&43!==o)return-1;if(r<n){if(!Ne(e.src.charCodeAt(r)))return-1}return r}function mt(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];let o=n;if(o+1>=r)return-1;let s=e.src.charCodeAt(o++);if(s<48||s>57)return-1;for(;;){if(o>=r)return-1;if(s=e.src.charCodeAt(o++),!(s>=48&&s<=57)){if(41===s||46===s)break;return-1}if(o-n>=10)return-1}return o<r&&(s=e.src.charCodeAt(o),!Ne(s))?-1:o}const gt="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",yt="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",bt=new RegExp("^(?:"+gt+"|"+yt+"|\x3c!---?>|\x3c!--(?:[^-]|-[^-]|--[^>])*--\x3e|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)"),_t=new RegExp("^(?:"+gt+"|"+yt+")"),kt=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+["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"].join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(_t.source+"\\s*$"),/^$/,!1]];const vt=[["table",function(e,t,n,r){if(t+2>n)return!1;let o=t+1;if(e.sCount[o]<e.blkIndent)return!1;if(e.sCount[o]-e.blkIndent>=4)return!1;let s=e.bMarks[o]+e.tShift[o];if(s>=e.eMarks[o])return!1;const i=e.src.charCodeAt(s++);if(124!==i&&45!==i&&58!==i)return!1;if(s>=e.eMarks[o])return!1;const a=e.src.charCodeAt(s++);if(124!==a&&45!==a&&58!==a&&!Ne(a))return!1;if(45===i&&Ne(a))return!1;for(;s<e.eMarks[o];){const t=e.src.charCodeAt(s);if(124!==t&&45!==t&&58!==t&&!Ne(t))return!1;s++}let l=pt(e,t+1),c=l.split("|");const u=[];for(let e=0;e<c.length;e++){const t=c[e].trim();if(!t){if(0===e||e===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(t))return!1;58===t.charCodeAt(t.length-1)?u.push(58===t.charCodeAt(0)?"center":"right"):58===t.charCodeAt(0)?u.push("left"):u.push("")}if(l=pt(e,t).trim(),-1===l.indexOf("|"))return!1;if(e.sCount[t]-e.blkIndent>=4)return!1;c=dt(l),c.length&&""===c[0]&&c.shift(),c.length&&""===c[c.length-1]&&c.pop();const h=c.length;if(0===h||h!==u.length)return!1;if(r)return!0;const p=e.parentType;e.parentType="table";const d=e.md.block.ruler.getRules("blockquote"),f=[t,0];e.push("table_open","table",1).map=f,e.push("thead_open","thead",1).map=[t,t+1],e.push("tr_open","tr",1).map=[t,t+1];for(let t=0;t<c.length;t++){const n=e.push("th_open","th",1);u[t]&&(n.attrs=[["style","text-align:"+u[t]]]);const r=e.push("inline","",0);r.content=c[t].trim(),r.children=[],e.push("th_close","th",-1)}let m;e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let g=0;for(o=t+2;o<n&&!(e.sCount[o]<e.blkIndent);o++){let r=!1;for(let t=0,s=d.length;t<s;t++)if(d[t](e,o,n,!0)){r=!0;break}if(r)break;if(l=pt(e,o).trim(),!l)break;if(e.sCount[o]-e.blkIndent>=4)break;if(c=dt(l),c.length&&""===c[0]&&c.shift(),c.length&&""===c[c.length-1]&&c.pop(),g+=h-c.length,g>65536)break;if(o===t+2){e.push("tbody_open","tbody",1).map=m=[t+2,0]}e.push("tr_open","tr",1).map=[o,o+1];for(let t=0;t<h;t++){const n=e.push("td_open","td",1);u[t]&&(n.attrs=[["style","text-align:"+u[t]]]);const r=e.push("inline","",0);r.content=c[t]?c[t].trim():"",r.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return m&&(e.push("tbody_close","tbody",-1),m[1]=o),e.push("table_close","table",-1),f[1]=o,e.parentType=p,e.line=o,!0},["paragraph","reference"]],["code",function(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,o=r;for(;r<n;)if(e.isEmpty(r))r++;else{if(!(e.sCount[r]-e.blkIndent>=4))break;r++,o=r}e.line=o;const s=e.push("code_block","code",0);return s.content=e.getLines(t,o,4+e.blkIndent,!1)+"\n",s.map=[t,e.line],!0}],["fence",function(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(o+3>s)return!1;const i=e.src.charCodeAt(o);if(126!==i&&96!==i)return!1;let a=o;o=e.skipChars(o,i);let l=o-a;if(l<3)return!1;const c=e.src.slice(a,o),u=e.src.slice(o,s);if(96===i&&u.indexOf(String.fromCharCode(i))>=0)return!1;if(r)return!0;let h=t,p=!1;for(;(h++,!(h>=n))&&(o=a=e.bMarks[h]+e.tShift[h],s=e.eMarks[h],!(o<s&&e.sCount[h]<e.blkIndent));)if(e.src.charCodeAt(o)===i&&!(e.sCount[h]-e.blkIndent>=4||(o=e.skipChars(o,i),o-a<l||(o=e.skipSpaces(o),o<s)))){p=!0;break}l=e.sCount[t],e.line=h+(p?1:0);const d=e.push("fence","code",0);return d.info=u,d.content=e.getLines(t+1,h,l,!0),d.markup=c,d.map=[t,e.line],!0},["paragraph","reference","blockquote","list"]],["blockquote",function(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];const i=e.lineMax;if(e.sCount[t]-e.blkIndent>=4)return!1;if(62!==e.src.charCodeAt(o))return!1;if(r)return!0;const a=[],l=[],c=[],u=[],h=e.md.block.ruler.getRules("blockquote"),p=e.parentType;e.parentType="blockquote";let d,f=!1;for(d=t;d<n;d++){const t=e.sCount[d]<e.blkIndent;if(o=e.bMarks[d]+e.tShift[d],s=e.eMarks[d],o>=s)break;if(62===e.src.charCodeAt(o++)&&!t){let t,n,r=e.sCount[d]+1;32===e.src.charCodeAt(o)?(o++,r++,n=!1,t=!0):9===e.src.charCodeAt(o)?(t=!0,(e.bsCount[d]+r)%4==3?(o++,r++,n=!1):n=!0):t=!1;let i=r;for(a.push(e.bMarks[d]),e.bMarks[d]=o;o<s;){const t=e.src.charCodeAt(o);if(!Ne(t))break;9===t?i+=4-(i+e.bsCount[d]+(n?1:0))%4:i++,o++}f=o>=s,l.push(e.bsCount[d]),e.bsCount[d]=e.sCount[d]+1+(t?1:0),c.push(e.sCount[d]),e.sCount[d]=i-r,u.push(e.tShift[d]),e.tShift[d]=o-e.bMarks[d];continue}if(f)break;let r=!1;for(let t=0,o=h.length;t<o;t++)if(h[t](e,d,n,!0)){r=!0;break}if(r){e.lineMax=d,0!==e.blkIndent&&(a.push(e.bMarks[d]),l.push(e.bsCount[d]),u.push(e.tShift[d]),c.push(e.sCount[d]),e.sCount[d]-=e.blkIndent);break}a.push(e.bMarks[d]),l.push(e.bsCount[d]),u.push(e.tShift[d]),c.push(e.sCount[d]),e.sCount[d]=-1}const m=e.blkIndent;e.blkIndent=0;const g=e.push("blockquote_open","blockquote",1);g.markup=">";const y=[t,0];g.map=y,e.md.block.tokenize(e,t,d),e.push("blockquote_close","blockquote",-1).markup=">",e.lineMax=i,e.parentType=p,y[1]=e.line;for(let n=0;n<u.length;n++)e.bMarks[n+t]=a[n],e.tShift[n+t]=u[n],e.sCount[n+t]=c[n],e.bsCount[n+t]=l[n];return e.blkIndent=m,!0},["paragraph","reference","blockquote","list"]],["hr",function(e,t,n,r){const o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.bMarks[t]+e.tShift[t];const i=e.src.charCodeAt(s++);if(42!==i&&45!==i&&95!==i)return!1;let a=1;for(;s<o;){const t=e.src.charCodeAt(s++);if(t!==i&&!Ne(t))return!1;t===i&&a++}if(a<3)return!1;if(r)return!0;e.line=t+1;const l=e.push("hr","hr",0);return l.map=[t,e.line],l.markup=Array(a+1).join(String.fromCharCode(i)),!0},["paragraph","reference","blockquote","list"]],["list",function(e,t,n,r){let o,s,i,a,l=t,c=!0;if(e.sCount[l]-e.blkIndent>=4)return!1;if(e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let u,h,p,d=!1;if(r&&"paragraph"===e.parentType&&e.sCount[l]>=e.blkIndent&&(d=!0),(p=mt(e,l))>=0){if(u=!0,i=e.bMarks[l]+e.tShift[l],h=Number(e.src.slice(i,p-1)),d&&1!==h)return!1}else{if(!((p=ft(e,l))>=0))return!1;u=!1}if(d&&e.skipSpaces(p)>=e.eMarks[l])return!1;if(r)return!0;const f=e.src.charCodeAt(p-1),m=e.tokens.length;u?(a=e.push("ordered_list_open","ol",1),1!==h&&(a.attrs=[["start",h]])):a=e.push("bullet_list_open","ul",1);const g=[l,0];a.map=g,a.markup=String.fromCharCode(f);let y=!1;const b=e.md.block.ruler.getRules("list"),_=e.parentType;for(e.parentType="list";l<n;){s=p,o=e.eMarks[l];const t=e.sCount[l]+p-(e.bMarks[l]+e.tShift[l]);let r=t;for(;s<o;){const t=e.src.charCodeAt(s);if(9===t)r+=4-(r+e.bsCount[l])%4;else{if(32!==t)break;r++}s++}const h=s;let d;d=h>=o?1:r-t,d>4&&(d=1);const m=t+d;a=e.push("list_item_open","li",1),a.markup=String.fromCharCode(f);const g=[l,0];a.map=g,u&&(a.info=e.src.slice(i,p-1));const _=e.tight,k=e.tShift[l],v=e.sCount[l],x=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=m,e.tight=!0,e.tShift[l]=h-e.bMarks[l],e.sCount[l]=r,h>=o&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),e.tight&&!y||(c=!1),y=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=x,e.tShift[l]=k,e.sCount[l]=v,e.tight=_,a=e.push("list_item_close","li",-1),a.markup=String.fromCharCode(f),l=e.line,g[1]=l,l>=n)break;if(e.sCount[l]<e.blkIndent)break;if(e.sCount[l]-e.blkIndent>=4)break;let C=!1;for(let t=0,r=b.length;t<r;t++)if(b[t](e,l,n,!0)){C=!0;break}if(C)break;if(u){if(p=mt(e,l),p<0)break;i=e.bMarks[l]+e.tShift[l]}else if(p=ft(e,l),p<0)break;if(f!==e.src.charCodeAt(p-1))break}return a=u?e.push("ordered_list_close","ol",-1):e.push("bullet_list_close","ul",-1),a.markup=String.fromCharCode(f),g[1]=l,e.line=l,e.parentType=_,c&&function(e,t){const n=e.level+2;for(let r=t+2,o=e.tokens.length-2;r<o;r++)e.tokens[r].level===n&&"paragraph_open"===e.tokens[r].type&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}(e,m),!0},["paragraph","reference","blockquote"]],["reference",function(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t],i=t+1;if(e.sCount[t]-e.blkIndent>=4)return!1;if(91!==e.src.charCodeAt(o))return!1;function a(t){const n=e.lineMax;if(t>=n||e.isEmpty(t))return null;let r=!1;if(e.sCount[t]-e.blkIndent>3&&(r=!0),e.sCount[t]<0&&(r=!0),!r){const r=e.md.block.ruler.getRules("reference"),o=e.parentType;e.parentType="reference";let s=!1;for(let o=0,i=r.length;o<i;o++)if(r[o](e,t,n,!0)){s=!0;break}if(e.parentType=o,s)return null}const o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];return e.src.slice(o,s+1)}let l=e.src.slice(o,s+1);s=l.length;let c=-1;for(o=1;o<s;o++){const e=l.charCodeAt(o);if(91===e)return!1;if(93===e){c=o;break}if(10===e){const e=a(i);null!==e&&(l+=e,s=l.length,i++)}else if(92===e&&(o++,o<s&&10===l.charCodeAt(o))){const e=a(i);null!==e&&(l+=e,s=l.length,i++)}}if(c<0||58!==l.charCodeAt(c+1))return!1;for(o=c+2;o<s;o++){const e=l.charCodeAt(o);if(10===e){const e=a(i);null!==e&&(l+=e,s=l.length,i++)}else if(!Ne(e))break}const u=e.md.helpers.parseLinkDestination(l,o,s);if(!u.ok)return!1;const h=e.md.normalizeLink(u.str);if(!e.md.validateLink(h))return!1;o=u.pos;const p=o,d=i,f=o;for(;o<s;o++){const e=l.charCodeAt(o);if(10===e){const e=a(i);null!==e&&(l+=e,s=l.length,i++)}else if(!Ne(e))break}let m,g=e.md.helpers.parseLinkTitle(l,o,s);for(;g.can_continue;){const t=a(i);if(null===t)break;l+=t,o=s,s=l.length,i++,g=e.md.helpers.parseLinkTitle(l,o,s,g)}for(o<s&&f!==o&&g.ok?(m=g.str,o=g.pos):(m="",o=p,i=d);o<s;){if(!Ne(l.charCodeAt(o)))break;o++}if(o<s&&10!==l.charCodeAt(o)&&m)for(m="",o=p,i=d;o<s;){if(!Ne(l.charCodeAt(o)))break;o++}if(o<s&&10!==l.charCodeAt(o))return!1;const y=Oe(l.slice(1,c));return!!y&&(r||(void 0===e.env.references&&(e.env.references={}),void 0===e.env.references[y]&&(e.env.references[y]={title:m,href:h}),e.line=i),!0)}],["html_block",function(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(!e.md.options.html)return!1;if(60!==e.src.charCodeAt(o))return!1;let i=e.src.slice(o,s),a=0;for(;a<kt.length&&!kt[a][0].test(i);a++);if(a===kt.length)return!1;if(r)return kt[a][2];let l=t+1;if(!kt[a][1].test(i))for(;l<n&&!(e.sCount[l]<e.blkIndent);l++)if(o=e.bMarks[l]+e.tShift[l],s=e.eMarks[l],i=e.src.slice(o,s),kt[a][1].test(i)){0!==i.length&&l++;break}e.line=l;const c=e.push("html_block","",0);return c.map=[t,l],c.content=e.getLines(t,l,e.blkIndent,!0),!0},["paragraph","reference","blockquote"]],["heading",function(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.src.charCodeAt(o);if(35!==i||o>=s)return!1;let a=1;for(i=e.src.charCodeAt(++o);35===i&&o<s&&a<=6;)a++,i=e.src.charCodeAt(++o);if(a>6||o<s&&!Ne(i))return!1;if(r)return!0;s=e.skipSpacesBack(s,o);const l=e.skipCharsBack(s,35,o);l>o&&Ne(e.src.charCodeAt(l-1))&&(s=l),e.line=t+1;const c=e.push("heading_open","h"+String(a),1);c.markup="########".slice(0,a),c.map=[t,e.line];const u=e.push("inline","",0);return u.content=e.src.slice(o,s).trim(),u.map=[t,e.line],u.children=[],e.push("heading_close","h"+String(a),-1).markup="########".slice(0,a),!0},["paragraph","reference","blockquote"]],["lheading",function(e,t,n){const r=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const o=e.parentType;e.parentType="paragraph";let s,i=0,a=t+1;for(;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3)continue;if(e.sCount[a]>=e.blkIndent){let t=e.bMarks[a]+e.tShift[a];const n=e.eMarks[a];if(t<n&&(s=e.src.charCodeAt(t),(45===s||61===s)&&(t=e.skipChars(t,s),t=e.skipSpaces(t),t>=n))){i=61===s?1:2;break}}if(e.sCount[a]<0)continue;let t=!1;for(let o=0,s=r.length;o<s;o++)if(r[o](e,a,n,!0)){t=!0;break}if(t)break}if(!i)return!1;const l=e.getLines(t,a,e.blkIndent,!1).trim();e.line=a+1;const c=e.push("heading_open","h"+String(i),1);c.markup=String.fromCharCode(s),c.map=[t,e.line];const u=e.push("inline","",0);return u.content=l,u.map=[t,e.line-1],u.children=[],e.push("heading_close","h"+String(i),-1).markup=String.fromCharCode(s),e.parentType=o,!0}],["paragraph",function(e,t,n){const r=e.md.block.ruler.getRules("paragraph"),o=e.parentType;let s=t+1;for(e.parentType="paragraph";s<n&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3)continue;if(e.sCount[s]<0)continue;let t=!1;for(let o=0,i=r.length;o<i;o++)if(r[o](e,s,n,!0)){t=!0;break}if(t)break}const i=e.getLines(t,s,e.blkIndent,!1).trim();e.line=s,e.push("paragraph_open","p",1).map=[t,e.line];const a=e.push("inline","",0);return a.content=i,a.map=[t,e.line],a.children=[],e.push("paragraph_close","p",-1),e.parentType=o,!0}]];function xt(){this.ruler=new Ve;for(let e=0;e<vt.length;e++)this.ruler.push(vt[e][0],vt[e][1],{alt:(vt[e][2]||[]).slice()})}function Ct(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}function Dt(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}xt.prototype.tokenize=function(e,t,n){const r=this.ruler.getRules(""),o=r.length,s=e.md.options.maxNesting;let i=t,a=!1;for(;i<n&&(e.line=i=e.skipEmptyLines(i),!(i>=n))&&!(e.sCount[i]<e.blkIndent);){if(e.level>=s){e.line=n;break}const t=e.line;let l=!1;for(let s=0;s<o;s++)if(l=r[s](e,i,n,!1),l){if(t>=e.line)throw new Error("block rule didn't increment state.line");break}if(!l)throw new Error("none of the block rules matched");e.tight=!a,e.isEmpty(e.line-1)&&(a=!0),i=e.line,i<n&&e.isEmpty(i)&&(a=!0,i++,e.line=i)}},xt.prototype.parse=function(e,t,n,r){if(!e)return;const o=new this.State(e,t,n,r);this.tokenize(o,o.line,o.lineMax)},xt.prototype.State=ht,Ct.prototype.pushPending=function(){const e=new He("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e},Ct.prototype.push=function(e,t,n){this.pending&&this.pushPending();const r=new He(e,t,n);let o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(o),r},Ct.prototype.scanDelims=function(e,t){const n=this.posMax,r=this.src.charCodeAt(e),o=e>0?this.src.charCodeAt(e-1):32;let s=e;for(;s<n&&this.src.charCodeAt(s)===r;)s++;const i=s-e,a=s<n?this.src.charCodeAt(s):32,l=qe(o)||Me(String.fromCharCode(o)),c=qe(a)||Me(String.fromCharCode(a)),u=Te(o),h=Te(a),p=!h&&(!c||u||l),d=!u&&(!l||h||c);return{can_open:p&&(t||!d||l),can_close:d&&(t||!p||c),length:i}},Ct.prototype.Token=He;const wt=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;const At=[];for(let e=0;e<256;e++)At.push(0);function Et(e,t){let n;const r=[],o=t.length;for(let s=0;s<o;s++){const o=t[s];if(126!==o.marker)continue;if(-1===o.end)continue;const i=t[o.end];n=e.tokens[o.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[i.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="","text"===e.tokens[i.token-1].type&&"~"===e.tokens[i.token-1].content&&r.push(i.token-1)}for(;r.length;){const t=r.pop();let o=t+1;for(;o<e.tokens.length&&"s_close"===e.tokens[o].type;)o++;o--,t!==o&&(n=e.tokens[o],e.tokens[o]=e.tokens[t],e.tokens[t]=n)}}"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){At[e.charCodeAt(0)]=1});var Ft={tokenize:function(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t)return!1;if(126!==r)return!1;const o=e.scanDelims(e.pos,!0);let s=o.length;const i=String.fromCharCode(r);if(s<2)return!1;let a;s%2&&(a=e.push("text","",0),a.content=i,s--);for(let t=0;t<s;t+=2)a=e.push("text","",0),a.content=i+i,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close});return e.pos+=o.length,!0},postProcess:function(e){const t=e.tokens_meta,n=e.tokens_meta.length;Et(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&Et(e,t[r].delimiters)}};function St(e,t){for(let n=t.length-1;n>=0;n--){const r=t[n];if(95!==r.marker&&42!==r.marker)continue;if(-1===r.end)continue;const o=t[r.end],s=n>0&&t[n-1].end===r.end+1&&t[n-1].marker===r.marker&&t[n-1].token===r.token-1&&t[r.end+1].token===o.token+1,i=String.fromCharCode(r.marker),a=e.tokens[r.token];a.type=s?"strong_open":"em_open",a.tag=s?"strong":"em",a.nesting=1,a.markup=s?i+i:i,a.content="";const l=e.tokens[o.token];l.type=s?"strong_close":"em_close",l.tag=s?"strong":"em",l.nesting=-1,l.markup=s?i+i:i,l.content="",s&&(e.tokens[t[n-1].token].content="",e.tokens[t[r.end+1].token].content="",n--)}}var jt={tokenize:function(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t)return!1;if(95!==r&&42!==r)return!1;const o=e.scanDelims(e.pos,42===r);for(let t=0;t<o.length;t++){e.push("text","",0).content=String.fromCharCode(r),e.delimiters.push({marker:r,length:o.length,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close})}return e.pos+=o.length,!0},postProcess:function(e){const t=e.tokens_meta,n=e.tokens_meta.length;St(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&St(e,t[r].delimiters)}};const It=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,zt=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;const Bt=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Lt=/^&([a-z][a-z0-9]{1,31});/i;function Nt(e){const t={},n=e.length;if(!n)return;let r=0,o=-2;const s=[];for(let i=0;i<n;i++){const n=e[i];if(s.push(0),e[r].marker===n.marker&&o===n.token-1||(r=i),o=n.token,n.length=n.length||0,!n.close)continue;t.hasOwnProperty(n.marker)||(t[n.marker]=[-1,-1,-1,-1,-1,-1]);const a=t[n.marker][(n.open?3:0)+n.length%3];let l=r-s[r]-1,c=l;for(;l>a;l-=s[l]+1){const t=e[l];if(t.marker===n.marker&&(t.open&&t.end<0)){let r=!1;if((t.close||n.open)&&(t.length+n.length)%3==0&&(t.length%3==0&&n.length%3==0||(r=!0)),!r){const r=l>0&&!e[l-1].open?s[l-1]+1:0;s[i]=i-l+r,s[l]=r,n.open=!1,t.end=i,t.close=!1,c=-1,o=-2;break}}}-1!==c&&(t[n.marker][(n.open?3:0)+(n.length||0)%3]=c)}}const Tt=[["text",function(e,t){let n=e.pos;for(;n<e.posMax&&!Dt(e.src.charCodeAt(n));)n++;return n!==e.pos&&(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}],["linkify",function(e,t){if(!e.md.options.linkify)return!1;if(e.linkLevel>0)return!1;const n=e.pos;if(n+3>e.posMax)return!1;if(58!==e.src.charCodeAt(n))return!1;if(47!==e.src.charCodeAt(n+1))return!1;if(47!==e.src.charCodeAt(n+2))return!1;const r=e.pending.match(wt);if(!r)return!1;const o=r[1],s=e.md.linkify.matchAtStart(e.src.slice(n-o.length));if(!s)return!1;let i=s.url;if(i.length<=o.length)return!1;i=i.replace(/\*+$/,"");const a=e.md.normalizeLink(i);if(!e.md.validateLink(a))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const t=e.push("link_open","a",1);t.attrs=[["href",a]],t.markup="linkify",t.info="auto";e.push("text","",0).content=e.md.normalizeLinkText(i);const n=e.push("link_close","a",-1);n.markup="linkify",n.info="auto"}return e.pos+=i.length-o.length,!0}],["newline",function(e,t){let n=e.pos;if(10!==e.src.charCodeAt(n))return!1;const r=e.pending.length-1,o=e.posMax;if(!t)if(r>=0&&32===e.pending.charCodeAt(r))if(r>=1&&32===e.pending.charCodeAt(r-1)){let t=r-1;for(;t>=1&&32===e.pending.charCodeAt(t-1);)t--;e.pending=e.pending.slice(0,t),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n<o&&Ne(e.src.charCodeAt(n));)n++;return e.pos=n,!0}],["escape",function(e,t){let n=e.pos;const r=e.posMax;if(92!==e.src.charCodeAt(n))return!1;if(n++,n>=r)return!1;let o=e.src.charCodeAt(n);if(10===o){for(t||e.push("hardbreak","br",0),n++;n<r&&(o=e.src.charCodeAt(n),Ne(o));)n++;return e.pos=n,!0}let s=e.src[n];if(o>=55296&&o<=56319&&n+1<r){const t=e.src.charCodeAt(n+1);t>=56320&&t<=57343&&(s+=e.src[n+1],n++)}const i="\\"+s;if(!t){const t=e.push("text_special","",0);o<256&&0!==At[o]?t.content=s:t.content=i,t.markup=i,t.info="escape"}return e.pos=n+1,!0}],["backticks",function(e,t){let n=e.pos;if(96!==e.src.charCodeAt(n))return!1;const r=n;n++;const o=e.posMax;for(;n<o&&96===e.src.charCodeAt(n);)n++;const s=e.src.slice(r,n),i=s.length;if(e.backticksScanned&&(e.backticks[i]||0)<=r)return t||(e.pending+=s),e.pos+=i,!0;let a,l=n;for(;-1!==(a=e.src.indexOf("`",l));){for(l=a+1;l<o&&96===e.src.charCodeAt(l);)l++;const r=l-a;if(r===i){if(!t){const t=e.push("code_inline","code",0);t.markup=s,t.content=e.src.slice(n,a).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=l,!0}e.backticks[r]=a}return e.backticksScanned=!0,t||(e.pending+=s),e.pos+=i,!0}],["strikethrough",Ft.tokenize],["emphasis",jt.tokenize],["link",function(e,t){let n,r,o,s,i="",a="",l=e.pos,c=!0;if(91!==e.src.charCodeAt(e.pos))return!1;const u=e.pos,h=e.posMax,p=e.pos+1,d=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(d<0)return!1;let f=d+1;if(f<h&&40===e.src.charCodeAt(f)){for(c=!1,f++;f<h&&(n=e.src.charCodeAt(f),Ne(n)||10===n);f++);if(f>=h)return!1;if(l=f,o=e.md.helpers.parseLinkDestination(e.src,f,e.posMax),o.ok){for(i=e.md.normalizeLink(o.str),e.md.validateLink(i)?f=o.pos:i="",l=f;f<h&&(n=e.src.charCodeAt(f),Ne(n)||10===n);f++);if(o=e.md.helpers.parseLinkTitle(e.src,f,e.posMax),f<h&&l!==f&&o.ok)for(a=o.str,f=o.pos;f<h&&(n=e.src.charCodeAt(f),Ne(n)||10===n);f++);}(f>=h||41!==e.src.charCodeAt(f))&&(c=!0),f++}if(c){if(void 0===e.env.references)return!1;if(f<h&&91===e.src.charCodeAt(f)?(l=f+1,f=e.md.helpers.parseLinkLabel(e,f),f>=0?r=e.src.slice(l,f++):f=d+1):f=d+1,r||(r=e.src.slice(p,d)),s=e.env.references[Oe(r)],!s)return e.pos=u,!1;i=s.href,a=s.title}if(!t){e.pos=p,e.posMax=d;const t=[["href",i]];e.push("link_open","a",1).attrs=t,a&&t.push(["title",a]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=f,e.posMax=h,!0}],["image",function(e,t){let n,r,o,s,i,a,l,c,u="";const h=e.pos,p=e.posMax;if(33!==e.src.charCodeAt(e.pos))return!1;if(91!==e.src.charCodeAt(e.pos+1))return!1;const d=e.pos+2,f=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(f<0)return!1;if(s=f+1,s<p&&40===e.src.charCodeAt(s)){for(s++;s<p&&(n=e.src.charCodeAt(s),Ne(n)||10===n);s++);if(s>=p)return!1;for(c=s,a=e.md.helpers.parseLinkDestination(e.src,s,e.posMax),a.ok&&(u=e.md.normalizeLink(a.str),e.md.validateLink(u)?s=a.pos:u=""),c=s;s<p&&(n=e.src.charCodeAt(s),Ne(n)||10===n);s++);if(a=e.md.helpers.parseLinkTitle(e.src,s,e.posMax),s<p&&c!==s&&a.ok)for(l=a.str,s=a.pos;s<p&&(n=e.src.charCodeAt(s),Ne(n)||10===n);s++);else l="";if(s>=p||41!==e.src.charCodeAt(s))return e.pos=h,!1;s++}else{if(void 0===e.env.references)return!1;if(s<p&&91===e.src.charCodeAt(s)?(c=s+1,s=e.md.helpers.parseLinkLabel(e,s),s>=0?o=e.src.slice(c,s++):s=f+1):s=f+1,o||(o=e.src.slice(d,f)),i=e.env.references[Oe(o)],!i)return e.pos=h,!1;u=i.href,l=i.title}if(!t){r=e.src.slice(d,f);const t=[];e.md.inline.parse(r,e.md,e.env,t);const n=e.push("image","img",0),o=[["src",u],["alt",""]];n.attrs=o,n.children=t,n.content=r,l&&o.push(["title",l])}return e.pos=s,e.posMax=p,!0}],["autolink",function(e,t){let n=e.pos;if(60!==e.src.charCodeAt(n))return!1;const r=e.pos,o=e.posMax;for(;;){if(++n>=o)return!1;const t=e.src.charCodeAt(n);if(60===t)return!1;if(62===t)break}const s=e.src.slice(r+1,n);if(zt.test(s)){const n=e.md.normalizeLink(s);if(!e.md.validateLink(n))return!1;if(!t){const t=e.push("link_open","a",1);t.attrs=[["href",n]],t.markup="autolink",t.info="auto";e.push("text","",0).content=e.md.normalizeLinkText(s);const r=e.push("link_close","a",-1);r.markup="autolink",r.info="auto"}return e.pos+=s.length+2,!0}if(It.test(s)){const n=e.md.normalizeLink("mailto:"+s);if(!e.md.validateLink(n))return!1;if(!t){const t=e.push("link_open","a",1);t.attrs=[["href",n]],t.markup="autolink",t.info="auto";e.push("text","",0).content=e.md.normalizeLinkText(s);const r=e.push("link_close","a",-1);r.markup="autolink",r.info="auto"}return e.pos+=s.length+2,!0}return!1}],["html_inline",function(e,t){if(!e.md.options.html)return!1;const n=e.posMax,r=e.pos;if(60!==e.src.charCodeAt(r)||r+2>=n)return!1;const o=e.src.charCodeAt(r+1);if(33!==o&&63!==o&&47!==o&&!function(e){const t=32|e;return t>=97&&t<=122}(o))return!1;const s=e.src.slice(r).match(bt);if(!s)return!1;if(!t){const t=e.push("html_inline","",0);t.content=s[0],i=t.content,/^<a[>\s]/i.test(i)&&e.linkLevel++,function(e){return/^<\/a\s*>/i.test(e)}(t.content)&&e.linkLevel--}var i;return e.pos+=s[0].length,!0}],["entity",function(e,t){const n=e.pos,r=e.posMax;if(38!==e.src.charCodeAt(n))return!1;if(n+1>=r)return!1;if(35===e.src.charCodeAt(n+1)){const r=e.src.slice(n).match(Bt);if(r){if(!t){const t="x"===r[1][0].toLowerCase()?parseInt(r[1].slice(1),16):parseInt(r[1],10),n=e.push("text_special","",0);n.content=Ce(t)?De(t):De(65533),n.markup=r[0],n.info="entity"}return e.pos+=r[0].length,!0}}else{const r=e.src.slice(n).match(Lt);if(r){const n=be(r[0]);if(n!==r[0]){if(!t){const t=e.push("text_special","",0);t.content=n,t.markup=r[0],t.info="entity"}return e.pos+=r[0].length,!0}}}return!1}]],Mt=[["balance_pairs",function(e){const t=e.tokens_meta,n=e.tokens_meta.length;Nt(e.delimiters);for(let e=0;e<n;e++)t[e]&&t[e].delimiters&&Nt(t[e].delimiters)}],["strikethrough",Ft.postProcess],["emphasis",jt.postProcess],["fragments_join",function(e){let t,n,r=0;const o=e.tokens,s=e.tokens.length;for(t=n=0;t<s;t++)o[t].nesting<0&&r--,o[t].level=r,o[t].nesting>0&&r++,"text"===o[t].type&&t+1<s&&"text"===o[t+1].type?o[t+1].content=o[t].content+o[t+1].content:(t!==n&&(o[n]=o[t]),n++);t!==n&&(o.length=n)}]];function qt(){this.ruler=new Ve;for(let e=0;e<Tt.length;e++)this.ruler.push(Tt[e][0],Tt[e][1]);this.ruler2=new Ve;for(let e=0;e<Mt.length;e++)this.ruler2.push(Mt[e][0],Mt[e][1])}function Ot(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function Rt(e){return Object.prototype.toString.call(e)}function Pt(e){return"[object Function]"===Rt(e)}function $t(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}qt.prototype.skipToken=function(e){const t=e.pos,n=this.ruler.getRules(""),r=n.length,o=e.md.options.maxNesting,s=e.cache;if(void 0!==s[t])return void(e.pos=s[t]);let i=!1;if(e.level<o){for(let o=0;o<r;o++)if(e.level++,i=n[o](e,!0),e.level--,i){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;i||e.pos++,s[t]=e.pos},qt.prototype.tokenize=function(e){const t=this.ruler.getRules(""),n=t.length,r=e.posMax,o=e.md.options.maxNesting;for(;e.pos<r;){const s=e.pos;let i=!1;if(e.level<o)for(let r=0;r<n;r++)if(i=t[r](e,!1),i){if(s>=e.pos)throw new Error("inline rule didn't increment state.pos");break}if(i){if(e.pos>=r)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},qt.prototype.parse=function(e,t,n,r){const o=new this.State(e,t,n,r);this.tokenize(o);const s=this.ruler2.getRules(""),i=s.length;for(let e=0;e<i;e++)s[e](o)},qt.prototype.State=Ct;const Ut={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};const Zt={"http:":{validate:function(e,t,n){const r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&":"===e[t-3]||t>=3&&"/"===e[t-3]?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},Vt="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function Ht(e){const t=e.re=function(e){const t={};e=e||{},t.src_Any=K.source,t.src_Cc=X.source,t.src_Z=te.source,t.src_P=Y.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter="(?:(?![><|]|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|[><|]|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+n+"|[()[\\]{}.,\"'?!\\-;]).|\\[(?:(?!"+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy='(^|[><|]|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}(e.__opts__),n=e.__tlds__.slice();function r(e){return e.replace("%TLDS%",t.src_tlds)}e.onCompile(),e.__tlds_replaced__||n.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),n.push(t.src_xn),t.src_tlds=n.join("|"),t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),"i");const o=[];function s(e,t){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}e.__compiled__={},Object.keys(e.__schemas__).forEach(function(t){const n=e.__schemas__[t];if(null===n)return;const r={validate:null,link:null};if(e.__compiled__[t]=r,"[object Object]"===Rt(n))return!function(e){return"[object RegExp]"===Rt(e)}(n.validate)?Pt(n.validate)?r.validate=n.validate:s(t,n):r.validate=function(e){return function(t,n){const r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}(n.validate),void(Pt(n.normalize)?r.normalize=n.normalize:n.normalize?s(t,n):r.normalize=function(e,t){t.normalize(e)});!function(e){return"[object String]"===Rt(e)}(n)?s(t,n):o.push(t)}),o.forEach(function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)}),e.__compiled__[""]={validate:null,normalize:function(e,t){t.normalize(e)}};const i=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t]}).map($t).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+i+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+i+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),function(e){e.__index__=-1,e.__text_cache__=""}(e)}function Gt(e,t){const n=e.__index__,r=e.__last_index__,o=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=o,this.text=o,this.url=o}function Wt(e,t){const n=new Gt(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function Jt(e,t){if(!(this instanceof Jt))return new Jt(e,t);var n;t||(n=e,Object.keys(n||{}).reduce(function(e,t){return e||Ut.hasOwnProperty(t)},!1)&&(t=e,e={})),this.__opts__=Ot({},Ut,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Ot({},Zt,e),this.__compiled__={},this.__tlds__=Vt,this.__tlds_replaced__=!1,this.re={},Ht(this)}Jt.prototype.add=function(e,t){return this.__schemas__[e]=t,Ht(this),this},Jt.prototype.set=function(e){return this.__opts__=Ot(this.__opts__,e),this},Jt.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let t,n,r,o,s,i,a,l,c;if(this.re.schema_test.test(e))for(a=this.re.schema_search,a.lastIndex=0;null!==(t=a.exec(e));)if(o=this.testSchemaAt(e,t[2],a.lastIndex),o){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+o;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=e.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l<this.__index__)&&null!==(n=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))&&(s=n.index+n[1].length,(this.__index__<0||s<this.__index__)&&(this.__schema__="",this.__index__=s,this.__last_index__=n.index+n[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(c=e.indexOf("@"),c>=0&&null!==(r=e.match(this.re.email_fuzzy))&&(s=r.index+r[1].length,i=r.index+r[0].length,(this.__index__<0||s<this.__index__||s===this.__index__&&i>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=s,this.__last_index__=i))),this.__index__>=0},Jt.prototype.pretest=function(e){return this.re.pretest.test(e)},Jt.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},Jt.prototype.match=function(e){const t=[];let n=0;this.__index__>=0&&this.__text_cache__===e&&(t.push(Wt(this,n)),n=this.__last_index__);let r=n?e.slice(n):e;for(;this.test(r);)t.push(Wt(this,n)),r=r.slice(this.__last_index__),n+=this.__last_index__;return t.length?t:null},Jt.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;const t=this.re.schema_at_start.exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);return n?(this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+n,Wt(this,0)):null},Jt.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,t,n){return e!==n[t-1]}).reverse(),Ht(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Ht(this),this)},Jt.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)},Jt.prototype.onCompile=function(){};const Qt=2147483647,Kt=36,Xt=/^xn--/,Yt=/[^\0-\x7F]/,en=/[\x2E\u3002\uFF0E\uFF61]/g,tn={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},nn=Math.floor,rn=String.fromCharCode;function on(e){throw new RangeError(tn[e])}function sn(e,t){const n=e.split("@");let r="";n.length>1&&(r=n[0]+"@",e=n[1]);const o=function(e,t){const n=[];let r=e.length;for(;r--;)n[r]=t(e[r]);return n}((e=e.replace(en,".")).split("."),t).join(".");return r+o}function an(e){const t=[];let n=0;const r=e.length;for(;n<r;){const o=e.charCodeAt(n++);if(o>=55296&&o<=56319&&n<r){const r=e.charCodeAt(n++);56320==(64512&r)?t.push(((1023&o)<<10)+(1023&r)+65536):(t.push(o),n--)}else t.push(o)}return t}const ln=function(e){return e>=48&&e<58?e-48+26:e>=65&&e<91?e-65:e>=97&&e<123?e-97:Kt},cn=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},un=function(e,t,n){let r=0;for(e=n?nn(e/700):e>>1,e+=nn(e/t);e>455;r+=Kt)e=nn(e/35);return nn(r+36*e/(e+38))},hn=function(e){const t=[],n=e.length;let r=0,o=128,s=72,i=e.lastIndexOf("-");i<0&&(i=0);for(let n=0;n<i;++n)e.charCodeAt(n)>=128&&on("not-basic"),t.push(e.charCodeAt(n));for(let a=i>0?i+1:0;a<n;){const i=r;for(let t=1,o=Kt;;o+=Kt){a>=n&&on("invalid-input");const i=ln(e.charCodeAt(a++));i>=Kt&&on("invalid-input"),i>nn((Qt-r)/t)&&on("overflow"),r+=i*t;const l=o<=s?1:o>=s+26?26:o-s;if(i<l)break;const c=Kt-l;t>nn(Qt/c)&&on("overflow"),t*=c}const l=t.length+1;s=un(r-i,l,0==i),nn(r/l)>Qt-o&&on("overflow"),o+=nn(r/l),r%=l,t.splice(r++,0,o)}return String.fromCodePoint(...t)},pn=function(e){const t=[],n=(e=an(e)).length;let r=128,o=0,s=72;for(const n of e)n<128&&t.push(rn(n));const i=t.length;let a=i;for(i&&t.push("-");a<n;){let n=Qt;for(const t of e)t>=r&&t<n&&(n=t);const l=a+1;n-r>nn((Qt-o)/l)&&on("overflow"),o+=(n-r)*l,r=n;for(const n of e)if(n<r&&++o>Qt&&on("overflow"),n===r){let e=o;for(let n=Kt;;n+=Kt){const r=n<=s?1:n>=s+26?26:n-s;if(e<r)break;const o=e-r,i=Kt-r;t.push(rn(cn(r+o%i,0))),e=nn(o/i)}t.push(rn(cn(e,0))),s=un(o,l,a===i),o=0,++a}++o,++r}return t.join("")},dn=function(e){return sn(e,function(e){return Yt.test(e)?"xn--"+pn(e):e})},fn=function(e){return sn(e,function(e){return Xt.test(e)?hn(e.slice(4).toLowerCase()):e})};const mn={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},gn=/^(vbscript|javascript|file|data):/,yn=/^data:image\/(gif|png|jpeg|webp);/;function bn(e){const t=e.trim().toLowerCase();return!gn.test(t)||yn.test(t)}const _n=["http:","https:","mailto:"];function kn(e){const t=W(e,!0);if(t.hostname&&(!t.protocol||_n.indexOf(t.protocol)>=0))try{t.hostname=dn(t.hostname)}catch(e){}return L(N(t))}function vn(e){const t=W(e,!0);if(t.hostname&&(!t.protocol||_n.indexOf(t.protocol)>=0))try{t.hostname=fn(t.hostname)}catch(e){}return z(N(t),z.defaultChars+"%")}function xn(e,t){if(!(this instanceof xn))return new xn(e,t);t||_e(e)||(t=e||{},e="default"),this.inline=new qt,this.block=new xt,this.core=new ut,this.renderer=new Ze,this.linkify=new Jt,this.validateLink=bn,this.normalizeLink=kn,this.normalizeLinkText=vn,this.utils=Pe,this.helpers=ve({},$e),this.options={},this.configure(e),t&&this.set(t)}xn.prototype.set=function(e){return ve(this.options,e),this},xn.prototype.configure=function(e){const t=this;if(_e(e)){const t=e;if(!(e=mn[t]))throw new Error('Wrong `markdown-it` preset "'+t+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this},xn.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(t){n=n.concat(this[t].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));const r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this},xn.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(t){n=n.concat(this[t].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));const r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this},xn.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},xn.prototype.parse=function(e,t){if("string"!=typeof e)throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},xn.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},xn.prototype.parseInline=function(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},xn.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};const Cn=new xn;const Dn=o.memo(function({node:e,surfaceId:n}){var r;const{theme:s,resolveString:i}=j(e,n),a=e.properties,l=i(a.text),c=a.usageHint,u=E(s.components.Text.all,c?s.components.Text[c]:{}),h=o.useMemo(()=>{var e;const t=null===(e=s.additionalStyles)||void 0===e?void 0:e.Text;if(t){if("object"==typeof(n=t)&&n&&!Array.isArray(n)&&["h1","h2","h3","h4","h5","caption","body"].some(e=>e in n)){return w(t[null!=c?c:"body"])}var n;return w(t)}},[null===(r=s.additionalStyles)||void 0===r?void 0:r.Text,c]),p=o.useMemo(()=>{if(null==l)return null;let e=l;switch(c){case"h1":e=`# ${e}`;break;case"h2":e=`## ${e}`;break;case"h3":e=`### ${e}`;break;case"h4":e=`#### ${e}`;break;case"h5":e=`##### ${e}`;break;case"caption":e=`*${e}*`}const t=function(e,t){if(!t)return e;const n=[];for(const[e,r]of Object.entries(t)){if(!r||Array.isArray(r)&&0===r.length)continue;const t=Array.isArray(r)?r.join(" "):D(r);if(!t)continue;const o=new RegExp(`<${e}(?=\\s|>|/>)`,"gi");n.push([o,`<${e} class="${t}"`])}let r=e;for(const[e,t]of n)r=r.replace(e,t);return r}(Cn.render(e),s.markdown);return{__html:t}},[l,s.markdown,c]);if(!p)return null;const d=void 0!==e.weight?{"--weight":e.weight}:{};return t.jsx("div",{className:"a2ui-text",style:d,children:t.jsx("section",{className:D(u),style:h,dangerouslySetInnerHTML:p})})}),wn=o.memo(function({node:e,surfaceId:n}){var r,o;const{theme:s,resolveString:i}=j(e,n),a=e.properties,l=i(a.url),c=a.usageHint,u=null!==(r=a.fit)&&void 0!==r?r:"fill",h=E(s.components.Image.all,c?s.components.Image[c]:{}),p=Object.assign(Object.assign({},w(null===(o=s.additionalStyles)||void 0===o?void 0:o.Image)),{"--object-fit":u});if(!l)return null;const d=void 0!==e.weight?{"--weight":e.weight}:{};return t.jsx("div",{className:"a2ui-image",style:d,children:t.jsx("section",{className:D(h),style:p,children:t.jsx("img",{src:l,alt:""})})})});const An=o.memo(function({node:e,surfaceId:n}){var r;const{theme:o,resolveString:s}=j(e,n),i=s(e.properties.name);if(!i)return null;const a=i.replace(/([A-Z])/g,"_$1").toLowerCase();const l=void 0!==e.weight?{"--weight":e.weight}:{};return t.jsx("div",{className:"a2ui-icon",style:l,children:t.jsx("section",{className:D(o.components.Icon),style:w(null===(r=o.additionalStyles)||void 0===r?void 0:r.Icon),children:t.jsx("span",{className:"g-icon",children:a})})})}),En=o.memo(function({node:e,surfaceId:n}){var r;const{theme:o}=j(e,n),s=void 0!==e.weight?{"--weight":e.weight}:{};return t.jsx("div",{className:"a2ui-divider",style:s,children:t.jsx("hr",{className:D(o.components.Divider),style:w(null===(r=o.additionalStyles)||void 0===r?void 0:r.Divider)})})});const Fn=o.memo(function({node:e,surfaceId:n}){var r;const{theme:o,resolveString:s}=j(e,n),i=s(e.properties.url);if(!i)return null;const a=function(e){const t=[/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([^&\s?]+)/];for(const n of t){const t=e.match(n);if(t&&t.length>1)return t[1]}return null}(i),l=void 0!==e.weight?{"--weight":e.weight}:{};return t.jsx("div",{className:"a2ui-video",style:l,children:t.jsx("section",{className:D(o.components.Video),style:w(null===(r=o.additionalStyles)||void 0===r?void 0:r.Video),children:a?t.jsx("iframe",{src:`https://www.youtube.com/embed/${a}`,title:"YouTube video player",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,style:{border:"none",width:"100%",aspectRatio:"16/9"}}):t.jsx("video",{src:i,controls:!0})})})}),Sn=o.memo(function({node:e,surfaceId:n}){var r,o;const{theme:s,resolveString:i}=j(e,n),a=e.properties,l=i(a.url),c=i(null!==(r=a.description)&&void 0!==r?r:null);if(!l)return null;const u=void 0!==e.weight?{"--weight":e.weight}:{};return t.jsx("div",{className:"a2ui-audio",style:u,children:t.jsxs("section",{className:D(s.components.AudioPlayer),style:w(null===(o=s.additionalStyles)||void 0===o?void 0:o.AudioPlayer),children:[c&&t.jsx("p",{children:c}),t.jsx("audio",{src:l,controls:!0})]})})}),jn=o.memo(function({node:e,surfaceId:n}){var r,o,s;const{theme:i}=j(e,n),a=e.properties,l=null!==(r=a.alignment)&&void 0!==r?r:"stretch",c=null!==(o=a.distribution)&&void 0!==o?o:"start",u=Array.isArray(a.children)?a.children:[],h=void 0!==e.weight?{"--weight":e.weight}:{};return t.jsx("div",{className:"a2ui-row","data-alignment":l,"data-distribution":c,style:h,children:t.jsx("section",{className:D(i.components.Row),style:w(null===(s=i.additionalStyles)||void 0===s?void 0:s.Row),children:u.map((e,r)=>{const o="object"==typeof e&&null!==e&&"id"in e?e.id:`child-${r}`,s="object"==typeof e&&null!==e&&"type"in e?e:null;return t.jsx(x,{node:s,surfaceId:n},o)})})})}),In=o.memo(function({node:e,surfaceId:n}){var r,o,s;const{theme:i}=j(e,n),a=e.properties,l=null!==(r=a.alignment)&&void 0!==r?r:"stretch",c=null!==(o=a.distribution)&&void 0!==o?o:"start",u=Array.isArray(a.children)?a.children:[],h=void 0!==e.weight?{"--weight":e.weight}:{};return t.jsx("div",{className:"a2ui-column","data-alignment":l,"data-distribution":c,style:h,children:t.jsx("section",{className:D(i.components.Column),style:w(null===(s=i.additionalStyles)||void 0===s?void 0:s.Column),children:u.map((e,r)=>{const o="object"==typeof e&&null!==e&&"id"in e?e.id:`child-${r}`,s="object"==typeof e&&null!==e&&"type"in e?e:null;return t.jsx(x,{node:s,surfaceId:n},o)})})})}),zn=o.memo(function({node:e,surfaceId:n}){var r,o;const{theme:s}=j(e,n),i=e.properties,a=null!==(r=i.direction)&&void 0!==r?r:"vertical",l=Array.isArray(i.children)?i.children:[],c=void 0!==e.weight?{"--weight":e.weight}:{};return t.jsx("div",{className:"a2ui-list","data-direction":a,style:c,children:t.jsx("section",{className:D(s.components.List),style:w(null===(o=s.additionalStyles)||void 0===o?void 0:o.List),children:l.map((e,r)=>{const o="object"==typeof e&&null!==e&&"id"in e?e.id:`child-${r}`,s="object"==typeof e&&null!==e&&"type"in e?e:null;return t.jsx(x,{node:s,surfaceId:n},o)})})})}),Bn=o.memo(function({node:e,surfaceId:n}){var r,o;const{theme:s}=j(e,n),i=e.properties,a=null!==(r=i.children)&&void 0!==r?r:i.child?[i.child]:[],l=Array.isArray(a)?a:[],c=void 0!==e.weight?{"--weight":e.weight}:{};return t.jsx("div",{className:"a2ui-card",style:c,children:t.jsx("section",{className:D(s.components.Card),style:w(null===(o=s.additionalStyles)||void 0===o?void 0:o.Card),children:l.map((e,r)=>{const o="object"==typeof e&&null!==e&&"id"in e?e.id:`child-${r}`,s="object"==typeof e&&null!==e&&"type"in e?e:null;return t.jsx(x,{node:s,surfaceId:n},o)})})})}),Ln=o.memo(function({node:e,surfaceId:n}){var r,s;const{theme:i,resolveString:a}=j(e,n),l=e.properties,[c,u]=o.useState(0),h=null!==(r=l.tabItems)&&void 0!==r?r:[],p=void 0!==e.weight?{"--weight":e.weight}:{};return t.jsx("div",{className:"a2ui-tabs",style:p,children:t.jsxs("section",{className:D(i.components.Tabs.container),style:w(null===(s=i.additionalStyles)||void 0===s?void 0:s.Tabs),children:[t.jsx("div",{id:"buttons",className:D(i.components.Tabs.element),children:h.map((e,n)=>{const r=a(e.title),o=n===c,s=o?E(i.components.Tabs.controls.all,i.components.Tabs.controls.selected):i.components.Tabs.controls.all;return t.jsx("button",{disabled:o,className:D(s),onClick:()=>u(n),children:r},n)})}),h[c]&&t.jsx(x,{node:h[c].child,surfaceId:n})]})})}),Nn=o.memo(function({node:e,surfaceId:n}){var r;const{theme:s}=j(e,n),i=e.properties,[a,l]=o.useState(!1),c=o.useRef(null),u=o.useCallback(()=>{l(!0)},[]),h=o.useCallback(()=>{l(!1)},[]);o.useEffect(()=>{const e=c.current;if(!e)return;a&&!e.open&&e.showModal();const t=()=>{l(!1)};return e.addEventListener("close",t),()=>e.removeEventListener("close",t)},[a]);const p=o.useCallback(e=>{e.target===e.currentTarget&&h()},[h]),d=o.useCallback(e=>{"Escape"===e.key&&h()},[h]),f=void 0!==e.weight?{"--weight":e.weight}:{};return a?t.jsx("div",{className:"a2ui-modal",style:f,children:t.jsx("dialog",{ref:c,className:D(s.components.Modal.backdrop),onClick:p,onKeyDown:d,children:t.jsxs("section",{className:D(s.components.Modal.element),style:w(null===(r=s.additionalStyles)||void 0===r?void 0:r.Modal),children:[t.jsx("div",{id:"controls",children:t.jsx("button",{onClick:h,"aria-label":"Close modal",children:t.jsx("span",{className:"g-icon",children:"close"})})}),t.jsx(x,{node:i.contentChild,surfaceId:n})]})})}):t.jsx("div",{className:"a2ui-modal",style:f,children:t.jsx("section",{onClick:u,style:{cursor:"pointer"},children:t.jsx(x,{node:i.entryPointChild,surfaceId:n})})})}),Tn=o.memo(function({node:e,surfaceId:n}){var r;const{theme:s,sendAction:i}=j(e,n),a=e.properties,l=o.useCallback(()=>{a.action&&i(a.action)},[a.action,i]),c=void 0!==e.weight?{"--weight":e.weight}:{};return t.jsx("div",{className:"a2ui-button",style:c,children:t.jsx("button",{className:D(s.components.Button),style:w(null===(r=s.additionalStyles)||void 0===r?void 0:r.Button),onClick:l,children:t.jsx(x,{node:a.child,surfaceId:n})})})}),Mn=o.memo(function({node:e,surfaceId:n}){var r,s,i,a;const{theme:l,resolveString:c,setValue:u,getValue:h}=j(e,n),p=e.properties,d=o.useId(),f=c(p.label),m=null===(r=p.text)||void 0===r?void 0:r.path,g=null!==(s=c(p.text))&&void 0!==s?s:"",y=p.type,b=p.validationRegexp,[_,k]=o.useState(g),[v,x]=o.useState(!0);o.useEffect(()=>{if(m){const e=h(m);null!==e&&String(e)!==_&&k(String(e))}},[m,h]);const C=o.useCallback(e=>{const t=e.target.value;k(t),b&&x(new RegExp(b).test(t)),m&&u(m,t)},[b,m,u]),A="number"===y?"number":"date"===y?"date":"text",E="longText"===y,F=void 0!==e.weight?{"--weight":e.weight}:{};return t.jsx("div",{className:"a2ui-textfield",style:F,children:t.jsxs("section",{className:D(l.components.TextField.container),children:[f&&t.jsx("label",{htmlFor:d,className:D(l.components.TextField.label),children:f}),E?t.jsx("textarea",{id:d,value:_,onChange:C,placeholder:"Please enter a value",className:D(l.components.TextField.element),style:w(null===(i=l.additionalStyles)||void 0===i?void 0:i.TextField)}):t.jsx("input",{type:A,id:d,value:_,onChange:C,placeholder:"Please enter a value",className:D(l.components.TextField.element),style:w(null===(a=l.additionalStyles)||void 0===a?void 0:a.TextField)})]})})}),qn=o.memo(function({node:e,surfaceId:n}){var r,s,i,a;const{theme:l,resolveString:c,resolveBoolean:u,setValue:h,getValue:p}=j(e,n),d=e.properties,f=o.useId(),m=c(d.label),g=null===(r=d.value)||void 0===r?void 0:r.path,y=null!==(s=u(d.value))&&void 0!==s&&s,[b,_]=o.useState(y);o.useEffect(()=>{if(g){const e=p(g);null!==e&&Boolean(e)!==b&&_(Boolean(e))}},[g,p]),o.useEffect(()=>{var e;void 0!==(null===(e=d.value)||void 0===e?void 0:e.literalBoolean)&&_(d.value.literalBoolean)},[null===(i=d.value)||void 0===i?void 0:i.literalBoolean]);const k=o.useCallback(e=>{const t=e.target.checked;_(t),g&&h(g,t)},[g,h]),v=void 0!==e.weight?{"--weight":e.weight}:{};return t.jsx("div",{className:"a2ui-checkbox",style:v,children:t.jsxs("section",{className:D(l.components.CheckBox.container),style:w(null===(a=l.additionalStyles)||void 0===a?void 0:a.CheckBox),children:[t.jsx("input",{type:"checkbox",id:f,checked:b,onChange:k,className:D(l.components.CheckBox.element)}),m&&t.jsx("label",{htmlFor:f,className:D(l.components.CheckBox.label),children:m})]})})}),On=o.memo(function({node:e,surfaceId:n}){var r,s,i,a,l,c;const{theme:u,resolveNumber:h,resolveString:p,setValue:d,getValue:f}=j(e,n),m=e.properties,g=o.useId(),y=null===(r=m.value)||void 0===r?void 0:r.path,b=null!==(s=h(m.value))&&void 0!==s?s:0,_=null!==(i=m.minValue)&&void 0!==i?i:0,k=null!==(a=m.maxValue)&&void 0!==a?a:0,[v,x]=o.useState(b);o.useEffect(()=>{if(y){const e=f(y);null!==e&&Number(e)!==v&&x(Number(e))}},[y,f]),o.useEffect(()=>{var e;void 0!==(null===(e=m.value)||void 0===e?void 0:e.literalNumber)&&x(m.value.literalNumber)},[null===(l=m.value)||void 0===l?void 0:l.literalNumber]);const C=o.useCallback(e=>{const t=Number(e.target.value);x(t),y&&d(y,t)},[y,d]),A=m.label,E=A?p(A):"",F=void 0!==e.weight?{"--weight":e.weight}:{};return t.jsx("div",{className:"a2ui-slider",style:F,children:t.jsxs("section",{className:D(u.components.Slider.container),children:[t.jsx("label",{htmlFor:g,className:D(u.components.Slider.label),children:E}),t.jsx("input",{type:"range",id:g,name:"data",value:v,min:_,max:k,onChange:C,className:D(u.components.Slider.element),style:w(null===(c=u.additionalStyles)||void 0===c?void 0:c.Slider)}),t.jsx("span",{className:D(u.components.Slider.label),children:v})]})})}),Rn=o.memo(function({node:e,surfaceId:n}){var r,s,i,a,l;const{theme:c,resolveString:u,setValue:h,getValue:p}=j(e,n),d=e.properties,f=o.useId(),m=null===(r=d.value)||void 0===r?void 0:r.path,g=null!==(s=u(d.value))&&void 0!==s?s:"",y=null===(i=d.enableDate)||void 0===i||i,b=null!==(a=d.enableTime)&&void 0!==a&&a,[_,k]=o.useState(g);o.useEffect(()=>{if(m){const e=p(m);null!==e&&String(e)!==_&&k(String(e))}},[m,p]);const v=o.useCallback(e=>{const t=e.target.value;k(t),m&&h(m,t)},[m,h]);let x="date";y&&b?x="datetime-local":b&&!y&&(x="time");const C=void 0!==e.weight?{"--weight":e.weight}:{};return t.jsx("div",{className:"a2ui-datetime-input",style:C,children:t.jsxs("section",{className:D(c.components.DateTimeInput.container),children:[t.jsx("label",{htmlFor:f,className:D(c.components.DateTimeInput.label),children:y&&b?"Date & Time":b?"Time":"Date"}),t.jsx("input",{type:x,id:f,value:_,onChange:v,className:D(c.components.DateTimeInput.element),style:w(null===(l=c.additionalStyles)||void 0===l?void 0:l.DateTimeInput)})]})})}),Pn=o.memo(function({node:e,surfaceId:n}){var r,s,i,a;const{theme:l,resolveString:c,setValue:u}=j(e,n),h=e.properties,p=o.useId(),d=null!==(r=h.options)&&void 0!==r?r:[],f=null===(s=h.selections)||void 0===s?void 0:s.path,m=null!==(i=c(h.description))&&void 0!==i?i:"Select an item",g=o.useCallback(e=>{f&&u(f,[e.target.value])},[f,u]),y=void 0!==e.weight?{"--weight":e.weight}:{};return t.jsx("div",{className:"a2ui-multiplechoice",style:y,children:t.jsxs("section",{className:D(l.components.MultipleChoice.container),children:[t.jsx("label",{htmlFor:p,className:D(l.components.MultipleChoice.label),children:m}),t.jsx("select",{name:"data",id:p,className:D(l.components.MultipleChoice.element),style:w(null===(a=l.additionalStyles)||void 0===a?void 0:a.MultipleChoice),onChange:g,children:d.map(e=>{const n=c(e.label);return t.jsx("option",{value:e.value,children:n},e.value)})})]})})});function $n(){var e;(e=k.getInstance()).register("Text",{component:Dn}),e.register("Image",{component:wn}),e.register("Icon",{component:An}),e.register("Divider",{component:En}),e.register("Video",{component:Fn}),e.register("AudioPlayer",{component:Sn}),e.register("Row",{component:jn}),e.register("Column",{component:In}),e.register("List",{component:zn}),e.register("Card",{component:Bn}),e.register("Tabs",{component:Ln}),e.register("Modal",{component:Nn}),e.register("Button",{component:Tn}),e.register("TextField",{component:Mn}),e.register("CheckBox",{component:qn}),e.register("Slider",{component:On}),e.register("DateTimeInput",{component:Rn}),e.register("MultipleChoice",{component:Pn})}const Un=i.Styles.structuralStyles.replace(/:host\s*\{/g,".a2ui-surface {");function Zn(){if("undefined"==typeof document)return;const e="a2ui-structural-styles";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="\n@layer a2ui-reset {\n :where(.a2ui-surface) :where(*) {\n all: revert;\n }\n}\n\n"+Un+'\n\n/* =========================================================================\n * Card (from Lit card.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-card {\n display: block;\n flex: var(--weight);\n min-height: 0;\n overflow: auto;\n}\n\n/* section { height: 100%; width: 100%; min-height: 0; overflow: auto; } */\n/* Use > to target only Card\'s direct section, not nested sections (e.g., TextField\'s section) */\n.a2ui-surface .a2ui-card > section {\n height: 100%;\n width: 100%;\n min-height: 0;\n overflow: auto;\n}\n\n/* section ::slotted(*) { height: 100%; width: 100%; } */\n/* Use > section > to only target Card\'s slotted children, not deeply nested elements */\n.a2ui-surface .a2ui-card > section > * {\n height: 100%;\n width: 100%;\n}\n\n/* =========================================================================\n * Divider (from Lit divider.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-divider {\n display: block;\n min-height: 0;\n overflow: auto;\n}\n\n/* hr { height: 1px; background: #ccc; border: none; } */\n/* Use :where() for low specificity (0,0,1) so theme utility classes can override */\n/* Browser default margins apply (margin-block: 0.5em, margin-inline: auto) */\n:where(.a2ui-surface .a2ui-divider) hr {\n height: 1px;\n background: #ccc;\n border: none;\n}\n\n/* =========================================================================\n * Text (from Lit text.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); } */\n.a2ui-surface .a2ui-text {\n display: block;\n flex: var(--weight);\n}\n\n/* h1, h2, h3, h4, h5 { line-height: inherit; font: inherit; } */\n/* Use :where() to match Lit\'s low specificity (0,0,0,1 - just element) */\n:where(.a2ui-surface .a2ui-text) h1,\n:where(.a2ui-surface .a2ui-text) h2,\n:where(.a2ui-surface .a2ui-text) h3,\n:where(.a2ui-surface .a2ui-text) h4,\n:where(.a2ui-surface .a2ui-text) h5 {\n line-height: inherit;\n font: inherit;\n}\n\n/* Ensure markdown paragraph margins are reset */\n.a2ui-surface .a2ui-text p {\n margin: 0;\n}\n\n/* =========================================================================\n * TextField (from Lit text-field.ts static styles)\n * ========================================================================= */\n\n/* :host { display: flex; flex: var(--weight); } */\n.a2ui-surface .a2ui-textfield {\n display: flex;\n flex: var(--weight);\n}\n\n/* input { display: block; width: 100%; } */\n:where(.a2ui-surface .a2ui-textfield) input {\n display: block;\n width: 100%;\n}\n\n/* label { display: block; margin-bottom: 4px; } */\n:where(.a2ui-surface .a2ui-textfield) label {\n display: block;\n margin-bottom: 4px;\n}\n\n/* textarea - same styling as input for multiline text fields */\n:where(.a2ui-surface .a2ui-textfield) textarea {\n display: block;\n width: 100%;\n}\n\n/* =========================================================================\n * CheckBox (from Lit checkbox.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-checkbox {\n display: block;\n flex: var(--weight);\n min-height: 0;\n overflow: auto;\n}\n\n/* input { display: block; width: 100%; } */\n:where(.a2ui-surface .a2ui-checkbox) input {\n display: block;\n width: 100%;\n}\n\n/* =========================================================================\n * Slider (from Lit slider.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); } */\n.a2ui-surface .a2ui-slider {\n display: block;\n flex: var(--weight);\n}\n\n/* input { display: block; width: 100%; } */\n:where(.a2ui-surface .a2ui-slider) input {\n display: block;\n width: 100%;\n}\n\n/* =========================================================================\n * Button (from Lit button.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; } */\n.a2ui-surface .a2ui-button {\n display: block;\n flex: var(--weight);\n min-height: 0;\n}\n\n/* =========================================================================\n * Icon (from Lit icon.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-icon {\n display: block;\n flex: var(--weight);\n min-height: 0;\n overflow: auto;\n}\n\n/* =========================================================================\n * Tabs (from Lit tabs.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); } */\n.a2ui-surface .a2ui-tabs {\n display: block;\n flex: var(--weight);\n}\n\n/* =========================================================================\n * Modal (from Lit modal.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); } */\n.a2ui-surface .a2ui-modal {\n display: block;\n flex: var(--weight);\n}\n\n/* dialog { padding: 0; border: none; background: none; } */\n:where(.a2ui-surface .a2ui-modal) dialog {\n padding: 0;\n border: none;\n background: none;\n}\n\n/* dialog section #controls { display: flex; justify-content: end; margin-bottom: 4px; } */\n.a2ui-surface .a2ui-modal dialog section #controls {\n display: flex;\n justify-content: end;\n margin-bottom: 4px;\n}\n\n/* dialog section #controls button { padding: 0; background: none; ... } */\n.a2ui-surface .a2ui-modal dialog section #controls button {\n padding: 0;\n background: none;\n width: 20px;\n height: 20px;\n cursor: pointer;\n border: none;\n}\n\n/* =========================================================================\n * Image (from Lit image.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-image {\n display: block;\n flex: var(--weight);\n min-height: 0;\n overflow: auto;\n}\n\n/* img { display: block; width: 100%; height: 100%; object-fit: var(--object-fit, fill); } */\n:where(.a2ui-surface .a2ui-image) img {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: var(--object-fit, fill);\n}\n\n/* =========================================================================\n * Video (from Lit video.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-video {\n display: block;\n flex: var(--weight);\n min-height: 0;\n overflow: auto;\n}\n\n/* video { display: block; width: 100%; } */\n:where(.a2ui-surface .a2ui-video) video {\n display: block;\n width: 100%;\n}\n\n/* =========================================================================\n * AudioPlayer (from Lit audio.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-audio {\n display: block;\n flex: var(--weight);\n min-height: 0;\n overflow: auto;\n}\n\n/* audio { display: block; width: 100%; } */\n:where(.a2ui-surface .a2ui-audio) audio {\n display: block;\n width: 100%;\n}\n\n/* =========================================================================\n * MultipleChoice (from Lit multiple-choice.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-multiplechoice {\n display: block;\n flex: var(--weight);\n min-height: 0;\n overflow: auto;\n}\n\n/* select { width: 100%; } */\n:where(.a2ui-surface .a2ui-multiplechoice) select {\n width: 100%;\n}\n\n/* =========================================================================\n * Column (from Lit column.ts static styles)\n * ========================================================================= */\n\n/* :host { display: flex; flex: var(--weight); } */\n.a2ui-surface .a2ui-column {\n display: flex;\n flex: var(--weight);\n}\n\n/* section { display: flex; flex-direction: column; min-width: 100%; height: 100%; } */\n.a2ui-surface .a2ui-column > section {\n display: flex;\n flex-direction: column;\n min-width: 100%;\n height: 100%;\n}\n\n/* :host([alignment="..."]) section { align-items: ...; } */\n/* Use > section to only target Column\'s direct section, not nested sections (e.g., CheckBox\'s section) */\n.a2ui-surface .a2ui-column[data-alignment="start"] > section { align-items: start; }\n.a2ui-surface .a2ui-column[data-alignment="center"] > section { align-items: center; }\n.a2ui-surface .a2ui-column[data-alignment="end"] > section { align-items: end; }\n.a2ui-surface .a2ui-column[data-alignment="stretch"] > section { align-items: stretch; }\n\n/* :host([distribution="..."]) section { justify-content: ...; } */\n.a2ui-surface .a2ui-column[data-distribution="start"] > section { justify-content: start; }\n.a2ui-surface .a2ui-column[data-distribution="center"] > section { justify-content: center; }\n.a2ui-surface .a2ui-column[data-distribution="end"] > section { justify-content: end; }\n.a2ui-surface .a2ui-column[data-distribution="spaceBetween"] > section { justify-content: space-between; }\n.a2ui-surface .a2ui-column[data-distribution="spaceAround"] > section { justify-content: space-around; }\n.a2ui-surface .a2ui-column[data-distribution="spaceEvenly"] > section { justify-content: space-evenly; }\n\n/* =========================================================================\n * Row (from Lit row.ts static styles)\n * ========================================================================= */\n\n/* :host { display: flex; flex: var(--weight); } */\n.a2ui-surface .a2ui-row {\n display: flex;\n flex: var(--weight);\n}\n\n/* section { display: flex; flex-direction: row; width: 100%; min-height: 100%; } */\n.a2ui-surface .a2ui-row > section {\n display: flex;\n flex-direction: row;\n width: 100%;\n min-height: 100%;\n}\n\n/* :host([alignment="..."]) section { align-items: ...; } */\n/* Use > section to only target Row\'s direct section, not nested sections */\n.a2ui-surface .a2ui-row[data-alignment="start"] > section { align-items: start; }\n.a2ui-surface .a2ui-row[data-alignment="center"] > section { align-items: center; }\n.a2ui-surface .a2ui-row[data-alignment="end"] > section { align-items: end; }\n.a2ui-surface .a2ui-row[data-alignment="stretch"] > section { align-items: stretch; }\n\n/* :host([distribution="..."]) section { justify-content: ...; } */\n.a2ui-surface .a2ui-row[data-distribution="start"] > section { justify-content: start; }\n.a2ui-surface .a2ui-row[data-distribution="center"] > section { justify-content: center; }\n.a2ui-surface .a2ui-row[data-distribution="end"] > section { justify-content: end; }\n.a2ui-surface .a2ui-row[data-distribution="spaceBetween"] > section { justify-content: space-between; }\n.a2ui-surface .a2ui-row[data-distribution="spaceAround"] > section { justify-content: space-around; }\n.a2ui-surface .a2ui-row[data-distribution="spaceEvenly"] > section { justify-content: space-evenly; }\n\n/* =========================================================================\n * List (from Lit list.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-list {\n display: block;\n flex: var(--weight);\n min-height: 0;\n overflow: auto;\n}\n\n/* :host([direction="vertical"]) section { display: grid; } */\n.a2ui-surface .a2ui-list[data-direction="vertical"] > section {\n display: grid;\n}\n\n/* :host([direction="horizontal"]) section { display: flex; max-width: 100%; overflow-x: scroll; ... } */\n.a2ui-surface .a2ui-list[data-direction="horizontal"] > section {\n display: flex;\n max-width: 100%;\n overflow-x: scroll;\n overflow-y: hidden;\n scrollbar-width: none;\n}\n\n/* :host([direction="horizontal"]) section > ::slotted(*) { flex: 1 0 fit-content; ... } */\n.a2ui-surface .a2ui-list[data-direction="horizontal"] > section > * {\n flex: 1 0 fit-content;\n max-width: min(80%, 400px);\n}\n\n/* =========================================================================\n * DateTimeInput (from Lit datetime-input.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-datetime-input {\n display: block;\n flex: var(--weight);\n min-height: 0;\n overflow: auto;\n}\n\n/* input { display: block; border-radius: 8px; padding: 8px; border: 1px solid #ccc; width: 100%; } */\n/* Use :where() to match Lit\'s low specificity (0,0,0,1) so theme utility classes can override */\n:where(.a2ui-surface .a2ui-datetime-input) input {\n display: block;\n border-radius: 8px;\n padding: 8px;\n border: 1px solid #ccc;\n width: 100%;\n}\n\n/* =========================================================================\n * Global box-sizing (matches Lit\'s * { box-sizing: border-box; } in components)\n * ========================================================================= */\n\n.a2ui-surface *,\n.a2ui-surface *::before,\n.a2ui-surface *::after {\n box-sizing: border-box;\n}\n',document.head.appendChild(t)}let Vn=!1;function Hn({surfaceId:e,operations:n,theme:r,agent:s,copilotkit:i}){const a=o.useCallback(async e=>{var t;if(s)try{console.info("[A2UI] Action dispatched",e.userAction),i.setProperties(Object.assign(Object.assign({},null!==(t=i.properties)&&void 0!==t?t:{}),{a2uiAction:e})),await i.runAgent({agent:s})}finally{if(i.properties){const e=i.properties,{a2uiAction:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["a2uiAction"]);i.setProperties(n)}}},[s,i]);return t.jsx("div",{className:"flex w-full flex-none overflow-hidden rounded-lg bg-white/5 p-4",children:t.jsxs(y,{onAction:a,theme:r,children:[t.jsx(Gn,{surfaceId:e,operations:n}),t.jsx(S,{surfaceId:e,className:"flex flex-1"})]})})}function Gn({surfaceId:e,operations:t}){const{processMessages:n}=b(),r=o.useRef("");return o.useEffect(()=>{const o=`${e}-${JSON.stringify(t)}`;o!==r.current&&(r.current=o,n(t))},[n,e,t]),null}function Wn(e){var t,n,r,o,s,i,a,l;return e&&"object"==typeof e?"string"==typeof e.surfaceId?e.surfaceId:null!==(l=null!==(i=null!==(o=null!==(n=null===(t=null==e?void 0:e.beginRendering)||void 0===t?void 0:t.surfaceId)&&void 0!==n?n:null===(r=null==e?void 0:e.surfaceUpdate)||void 0===r?void 0:r.surfaceId)&&void 0!==o?o:null===(s=null==e?void 0:e.dataModelUpdate)||void 0===s?void 0:s.surfaceId)&&void 0!==i?i:null===(a=null==e?void 0:e.deleteSurface)||void 0===a?void 0:a.surfaceId)&&void 0!==l?l:null:null}const Jn={"typography-f-sf":!0,"typography-fs-n":!0,"typography-w-500":!0,"layout-mt-0":!0,"layout-mb-2":!0,"color-c-n10":!0},Qn=Object.assign(Object.assign({},Jn),{"typography-sz-tl":!0}),Kn=Object.assign(Object.assign({},Jn),{"typography-sz-tm":!0}),Xn=Object.assign(Object.assign({},Jn),{"typography-sz-ts":!0}),Yn={"typography-f-sf":!0,"typography-fs-n":!0,"typography-w-400":!0,"layout-pl-4":!0,"layout-pr-4":!0,"layout-pt-2":!0,"layout-pb-2":!0,"border-br-6":!0,"border-bw-1":!0,"color-bc-s70":!0,"border-bs-s":!0,"layout-as-n":!0,"color-c-n10":!0},er=Object.assign(Object.assign({},Yn),{"layout-r-none":!0,"layout-fs-c":!0}),tr=r.v0_8.Styles.merge({"typography-f-sf":!0,"typography-fs-n":!0,"typography-w-500":!0,"layout-as-n":!0,"layout-dis-iflx":!0,"layout-al-c":!0},{"color-c-n5":!0}),nr=r.v0_8.Styles.merge(Yn,{"color-c-n5":!0}),rr=r.v0_8.Styles.merge(er,{"color-c-n5":!0}),or=r.v0_8.Styles.merge({"typography-f-sf":!0,"typography-fs-n":!0,"typography-w-500":!0,"layout-pt-3":!0,"layout-pb-3":!0,"layout-pl-5":!0,"layout-pr-5":!0,"layout-mb-1":!0,"border-br-16":!0,"border-bw-0":!0,"border-c-n70":!0,"border-bs-s":!0,"color-bgc-s30":!0,"color-c-n100":!0,"behavior-ho-80":!0},{"color-c-n100":!0}),sr=r.v0_8.Styles.merge(Qn,{"color-c-n5":!0}),ir=r.v0_8.Styles.merge(Kn,{"color-c-n5":!0}),ar=r.v0_8.Styles.merge(Xn,{"color-c-n5":!0}),lr=r.v0_8.Styles.merge({"typography-f-s":!0,"typography-fs-n":!0,"typography-w-400":!0,"layout-mt-0":!0,"layout-mb-2":!0,"typography-sz-bm":!0,"color-c-n10":!0},{"color-c-n5":!0}),cr=r.v0_8.Styles.merge({"typography-f-s":!0,"typography-fs-n":!0,"typography-w-400":!0,"layout-m-0":!0,"typography-sz-bm":!0,"layout-as-n":!0,"color-c-n10":!0},{"color-c-n35":!0}),ur=r.v0_8.Styles.merge({"typography-f-c":!0,"typography-fs-n":!0,"typography-w-400":!0,"typography-sz-bm":!0,"typography-ws-p":!0,"layout-as-n":!0},{"color-c-n35":!0}),hr=r.v0_8.Styles.merge({"typography-f-s":!0,"typography-fs-n":!0,"typography-w-400":!0,"layout-m-0":!0,"typography-sz-bm":!0,"layout-as-n":!0},{"color-c-n35":!0}),pr=r.v0_8.Styles.merge({"typography-f-s":!0,"typography-fs-n":!0,"typography-w-400":!0,"layout-m-0":!0,"typography-sz-bm":!0,"layout-as-n":!0},{"color-c-n35":!0}),dr=r.v0_8.Styles.merge({"typography-f-s":!0,"typography-fs-n":!0,"typography-w-400":!0,"layout-m-0":!0,"typography-sz-bm":!0,"layout-as-n":!0},{"color-c-n35":!0}),fr={additionalStyles:{Button:{"--n-35":"var(--n-100)"},Card:{padding:"32px"}},components:{AudioPlayer:{},Button:{"layout-pt-2":!0,"layout-pb-2":!0,"layout-pl-3":!0,"layout-pr-3":!0,"border-br-12":!0,"border-bw-0":!0,"border-bs-s":!0,"color-bgc-p30":!0,"color-c-n100":!0,"behavior-ho-70":!0},Card:{"border-br-9":!0,"color-bgc-p100":!0},CheckBox:{element:{"layout-m-0":!0,"layout-mr-2":!0,"layout-p-2":!0,"border-br-12":!0,"border-bw-1":!0,"border-bs-s":!0,"color-bgc-p100":!0,"color-bc-p60":!0,"color-c-n30":!0,"color-c-p30":!0},label:{"color-c-p30":!0,"typography-f-sf":!0,"typography-v-r":!0,"typography-w-400":!0,"layout-flx-1":!0,"typography-sz-ll":!0},container:{"layout-dsp-iflex":!0,"layout-al-c":!0}},Column:{"layout-g-2":!0},DateTimeInput:{container:{},label:{},element:{"layout-pt-2":!0,"layout-pb-2":!0,"layout-pl-3":!0,"layout-pr-3":!0,"border-br-12":!0,"border-bw-1":!0,"border-bs-s":!0,"color-bgc-p100":!0,"color-bc-p60":!0,"color-c-n30":!0,"color-c-p30":!0}},Divider:{},Image:{all:{"border-br-5":!0,"layout-el-cv":!0,"layout-w-100":!0,"layout-h-100":!0},avatar:{"is-avatar":!0},header:{},icon:{},largeFeature:{},mediumFeature:{},smallFeature:{}},Icon:{},List:{"layout-g-4":!0,"layout-p-2":!0},Modal:{backdrop:{"color-bbgc-p60_20":!0},element:{"border-br-2":!0,"color-bgc-p100":!0,"layout-p-4":!0,"border-bw-1":!0,"border-bs-s":!0,"color-bc-p80":!0}},MultipleChoice:{container:{},label:{},element:{}},Row:{"layout-g-4":!0},Slider:{container:{},label:{},element:{}},Tabs:{container:{},controls:{all:{},selected:{}},element:{}},Text:{all:{"layout-w-100":!0,"layout-g-2":!0},h1:{"typography-f-sf":!0,"typography-v-r":!0,"typography-w-400":!0,"layout-m-0":!0,"layout-p-0":!0,"typography-sz-tl":!0},h2:{"typography-f-sf":!0,"typography-v-r":!0,"typography-w-400":!0,"layout-m-0":!0,"layout-p-0":!0,"typography-sz-tm":!0},h3:{"typography-f-sf":!0,"typography-v-r":!0,"typography-w-400":!0,"layout-m-0":!0,"layout-p-0":!0,"typography-sz-ts":!0},h4:{"typography-f-sf":!0,"typography-v-r":!0,"typography-w-400":!0,"layout-m-0":!0,"layout-p-0":!0,"typography-sz-bl":!0},h5:{"typography-f-sf":!0,"typography-v-r":!0,"typography-w-400":!0,"layout-m-0":!0,"layout-p-0":!0,"typography-sz-bm":!0},body:{},caption:{}},TextField:{container:{"typography-sz-bm":!0,"layout-w-100":!0,"layout-g-2":!0,"layout-dsp-flexhor":!0,"layout-al-c":!0},label:{"layout-flx-0":!0},element:{"typography-sz-bm":!0,"layout-pt-2":!0,"layout-pb-2":!0,"layout-pl-3":!0,"layout-pr-3":!0,"border-br-12":!0,"border-bw-1":!0,"border-bs-s":!0,"color-bgc-p100":!0,"color-bc-p60":!0,"color-c-n30":!0,"color-c-p30":!0}},Video:{"border-br-5":!0,"layout-el-cv":!0}},elements:{a:tr,audio:{"layout-w-100":!0},body:lr,button:or,h1:sr,h2:ir,h3:ar,h4:{},h5:{},iframe:{"behavior-sw-n":!0},input:nr,p:cr,pre:ur,textarea:rr,video:{"layout-el-cv":!0}},markdown:{p:[...Object.keys(cr)],h1:[...Object.keys(sr)],h2:[...Object.keys(ir)],h3:[...Object.keys(ar)],h4:[],h5:[],ul:[...Object.keys(pr)],ol:[...Object.keys(hr)],li:[...Object.keys(dr)],a:[...Object.keys(tr)],strong:[],em:[]}};let mr=!1;function gr({surfaceId:e,root:n,components:r,data:s,styles:i,className:a}){const{processMessages:l}=b(),c=o.useRef("");return o.useEffect(()=>{const t=`${e}-${JSON.stringify(r)}-${JSON.stringify(s)}`;if(t===c.current)return;c.current=t;const o=[{beginRendering:{surfaceId:e,root:n,styles:null!=i?i:{}}},{surfaceUpdate:{surfaceId:e,components:r}}];if(s&&Object.keys(s).length>0){const t=yr(s);t.length>0&&o.push({dataModelUpdate:{surfaceId:e,path:"/",contents:t}})}l(o)},[l,e,n,r,s,i]),t.jsx("div",{className:a,children:t.jsx(S,{surfaceId:e})})}function yr(e){return Object.entries(e).map(([e,t])=>br(e,t))}function br(e,t){if("string"==typeof t)return{key:e,valueString:t};if("number"==typeof t)return{key:e,valueNumber:t};if("boolean"==typeof t)return{key:e,valueBoolean:t};if(null==t)return{key:e};if(Array.isArray(t)){return{key:e,valueMap:t.map((e,t)=>br(String(t),e))}}if("object"==typeof t){return{key:e,valueMap:yr(t)}}return{key:e}}e.A2UIViewer=function({root:e,components:n,data:r,onAction:s,styles:i,className:a}){mr||($n(),Zn(),mr=!0);const l=o.useId(),c=o.useMemo(()=>{const t=`${e}-${JSON.stringify(n)}`;let r=0;for(let e=0;e<t.length;e++){r=(r<<5)-r+t.charCodeAt(e),r&=r}return`surface${l.replace(/:/g,"-")}${r}`},[l,e,n]),u=o.useMemo(()=>{if(s)return e=>{var t;const n=e.userAction;n&&s({actionName:n.name,sourceComponentId:n.sourceComponentId,timestamp:n.timestamp,context:null!==(t=n.context)&&void 0!==t?t:{}})}},[s]);return n&&0!==n.length?t.jsx(y,{onAction:u,theme:fr,children:t.jsx(gr,{surfaceId:c,root:e,components:n,data:null!=r?r:{},styles:i,className:a})}):t.jsx("div",{className:a,style:{padding:16,color:"#666",fontFamily:"system-ui"},children:"No content to display"})},e.createA2UIMessageRenderer=function(e){const{theme:i}=e;return{activityType:"a2ui-surface",content:s.z.any(),render:({content:e,agent:s})=>{Vn||($n(),Zn(),Vn=!0);const[a,l]=o.useState([]),c=o.useRef(null),{copilotkit:u}=n.useCopilotKit();o.useEffect(()=>{if(!e||!Array.isArray(e.operations))return c.current=null,void l([]);const t=e.operations,n=function(e){try{return JSON.stringify(e)}catch(e){return null}}(t);n&&n===c.current||(c.current=n,l(t))},[e]);const h=o.useMemo(()=>{var e;const t=new Map;for(const n of a){const o=null!==(e=Wn(n))&&void 0!==e?e:r.v0_8.Data.A2uiMessageProcessor.DEFAULT_SURFACE_ID;t.has(o)||t.set(o,[]),t.get(o).push(n)}return t},[a]);return h.size?t.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-6 overflow-auto py-6",children:Array.from(h.entries()).map(([e,n])=>t.jsx(Hn,{surfaceId:e,operations:n,theme:i,agent:s,copilotkit:u},e))}):null}}},e.viewerTheme=fr});
2
- //# sourceMappingURL=index.umd.js.map
1
+ (function(global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@copilotkit/react-core/v2'), require('@a2ui/lit'), require('react'), require('zod'), require('@a2ui/lit/0.8'), require('react/jsx-runtime'), require('clsx'), require('markdown-it')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', '@copilotkit/react-core/v2', '@a2ui/lit', 'react', 'zod', '@a2ui/lit/0.8', 'react/jsx-runtime', 'clsx', 'markdown-it'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.CopilotKitA2UIRenderer = {}), global.CopilotKitReactCore,global.A2UILit,global.React,global.Zod,global.A2UILit,global.React,global.clsx,global.markdownit));
5
+ })(this, function(exports, _copilotkit_react_core_v2, _a2ui_lit, react, zod, _a2ui_lit_0_8, react_jsx_runtime, clsx, markdown_it) {
6
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
7
+ //#region \0rolldown/runtime.js
8
+ var __create = Object.create;
9
+ var __defProp = Object.defineProperty;
10
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
11
+ var __getOwnPropNames = Object.getOwnPropertyNames;
12
+ var __getProtoOf = Object.getPrototypeOf;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
17
+ key = keys[i];
18
+ if (!__hasOwnProp.call(to, key) && key !== except) {
19
+ __defProp(to, key, {
20
+ get: ((k) => from[k]).bind(null, key),
21
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
22
+ });
23
+ }
24
+ }
25
+ }
26
+ return to;
27
+ };
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
29
+ value: mod,
30
+ enumerable: true
31
+ }) : target, mod));
32
+
33
+ //#endregion
34
+ react = __toESM(react);
35
+ markdown_it = __toESM(markdown_it);
36
+
37
+ //#region src/react-renderer/theme/litTheme.ts
38
+ /**
39
+ * Default theme for A2UI React components.
40
+ *
41
+ * This theme uses the same CSS class conventions as the Lit renderer,
42
+ * ensuring visual consistency between React and Lit implementations.
43
+ *
44
+ * IMPORTANT: This theme must be kept in sync with the Lit renderer's internal
45
+ * styling. If Lit components change their class maps, this file must be updated
46
+ * to match. Ideally, Lit would export its default theme for direct import.
47
+ *
48
+ * Requires the structural styles to be injected:
49
+ * @example
50
+ * ```tsx
51
+ * import { A2UIProvider } from '@a2ui/react';
52
+ * import { injectStyles } from '@a2ui/react/styles';
53
+ *
54
+ * // Inject structural CSS at app startup
55
+ * injectStyles();
56
+ *
57
+ * function App() {
58
+ * return (
59
+ * <A2UIProvider>
60
+ * <A2UIRenderer surfaceId="main" />
61
+ * </A2UIProvider>
62
+ * );
63
+ * }
64
+ * ```
65
+ */
66
+ const elementA = {
67
+ "typography-f-sf": true,
68
+ "typography-fs-n": true,
69
+ "typography-w-500": true,
70
+ "layout-as-n": true,
71
+ "layout-dis-iflx": true,
72
+ "layout-al-c": true,
73
+ "typography-td-none": true,
74
+ "color-c-p40": true
75
+ };
76
+ const elementAudio = { "layout-w-100": true };
77
+ const elementBody = {
78
+ "typography-f-s": true,
79
+ "typography-fs-n": true,
80
+ "typography-w-400": true,
81
+ "layout-mt-0": true,
82
+ "layout-mb-2": true,
83
+ "typography-sz-bm": true,
84
+ "color-c-n10": true
85
+ };
86
+ const elementButton = {
87
+ "typography-f-sf": true,
88
+ "typography-fs-n": true,
89
+ "typography-w-500": true,
90
+ "layout-pt-3": true,
91
+ "layout-pb-3": true,
92
+ "layout-pl-5": true,
93
+ "layout-pr-5": true,
94
+ "layout-mb-1": true,
95
+ "border-br-16": true,
96
+ "border-bw-0": true,
97
+ "border-c-n70": true,
98
+ "border-bs-s": true,
99
+ "color-bgc-s30": true,
100
+ "behavior-ho-80": true
101
+ };
102
+ const elementHeading = {
103
+ "typography-f-sf": true,
104
+ "typography-fs-n": true,
105
+ "typography-w-500": true,
106
+ "layout-mt-0": true,
107
+ "layout-mb-2": true
108
+ };
109
+ const elementIframe = { "behavior-sw-n": true };
110
+ const elementInput = {
111
+ "typography-f-sf": true,
112
+ "typography-fs-n": true,
113
+ "typography-w-400": true,
114
+ "layout-pl-4": true,
115
+ "layout-pr-4": true,
116
+ "layout-pt-2": true,
117
+ "layout-pb-2": true,
118
+ "border-br-6": true,
119
+ "border-bw-1": true,
120
+ "color-bc-s70": true,
121
+ "border-bs-s": true,
122
+ "layout-as-n": true,
123
+ "color-c-n10": true
124
+ };
125
+ const elementP = {
126
+ "typography-f-s": true,
127
+ "typography-fs-n": true,
128
+ "typography-w-400": true,
129
+ "layout-m-0": true,
130
+ "typography-sz-bm": true,
131
+ "layout-as-n": true,
132
+ "color-c-n10": true
133
+ };
134
+ const elementList = {
135
+ "typography-f-s": true,
136
+ "typography-fs-n": true,
137
+ "typography-w-400": true,
138
+ "layout-m-0": true,
139
+ "typography-sz-bm": true,
140
+ "layout-as-n": true,
141
+ "color-c-n10": true
142
+ };
143
+ const elementPre = {
144
+ "typography-f-c": true,
145
+ "typography-fs-n": true,
146
+ "typography-w-400": true,
147
+ "typography-sz-bm": true,
148
+ "typography-ws-p": true,
149
+ "layout-as-n": true
150
+ };
151
+ const elementTextarea = {
152
+ ...elementInput,
153
+ "layout-r-none": true,
154
+ "layout-fs-c": true
155
+ };
156
+ const elementVideo = { "layout-el-cv": true };
157
+ const litTheme = {
158
+ components: {
159
+ AudioPlayer: {},
160
+ Divider: {},
161
+ Icon: {},
162
+ Image: {
163
+ all: {
164
+ "border-br-5": true,
165
+ "layout-el-cv": true,
166
+ "layout-w-100": true,
167
+ "layout-h-100": true
168
+ },
169
+ avatar: { "is-avatar": true },
170
+ header: {},
171
+ icon: {},
172
+ largeFeature: {},
173
+ mediumFeature: {},
174
+ smallFeature: {}
175
+ },
176
+ Text: {
177
+ all: {
178
+ "layout-w-100": true,
179
+ "layout-g-2": true
180
+ },
181
+ h1: {
182
+ "typography-f-sf": true,
183
+ "typography-v-r": true,
184
+ "typography-w-400": true,
185
+ "layout-m-0": true,
186
+ "layout-p-0": true,
187
+ "typography-sz-hs": true
188
+ },
189
+ h2: {
190
+ "typography-f-sf": true,
191
+ "typography-v-r": true,
192
+ "typography-w-400": true,
193
+ "layout-m-0": true,
194
+ "layout-p-0": true,
195
+ "typography-sz-tl": true
196
+ },
197
+ h3: {
198
+ "typography-f-sf": true,
199
+ "typography-v-r": true,
200
+ "typography-w-400": true,
201
+ "layout-m-0": true,
202
+ "layout-p-0": true,
203
+ "typography-sz-tl": true
204
+ },
205
+ h4: {
206
+ "typography-f-sf": true,
207
+ "typography-v-r": true,
208
+ "typography-w-400": true,
209
+ "layout-m-0": true,
210
+ "layout-p-0": true,
211
+ "typography-sz-bl": true
212
+ },
213
+ h5: {
214
+ "typography-f-sf": true,
215
+ "typography-v-r": true,
216
+ "typography-w-400": true,
217
+ "layout-m-0": true,
218
+ "layout-p-0": true,
219
+ "typography-sz-bm": true
220
+ },
221
+ body: {},
222
+ caption: {}
223
+ },
224
+ Video: {
225
+ "border-br-5": true,
226
+ "layout-el-cv": true
227
+ },
228
+ Card: {
229
+ "border-br-9": true,
230
+ "layout-p-4": true,
231
+ "color-bgc-n100": true
232
+ },
233
+ Column: { "layout-g-2": true },
234
+ List: {
235
+ "layout-g-4": true,
236
+ "layout-p-2": true
237
+ },
238
+ Modal: {
239
+ backdrop: { "color-bbgc-p60_20": true },
240
+ element: {
241
+ "border-br-2": true,
242
+ "color-bgc-p100": true,
243
+ "layout-p-4": true,
244
+ "border-bw-1": true,
245
+ "border-bs-s": true,
246
+ "color-bc-p80": true
247
+ }
248
+ },
249
+ Row: { "layout-g-4": true },
250
+ Tabs: {
251
+ container: {},
252
+ controls: {
253
+ all: {},
254
+ selected: {}
255
+ },
256
+ element: {}
257
+ },
258
+ Button: {
259
+ "layout-pt-2": true,
260
+ "layout-pb-2": true,
261
+ "layout-pl-3": true,
262
+ "layout-pr-3": true,
263
+ "border-br-12": true,
264
+ "border-bw-0": true,
265
+ "border-bs-s": true,
266
+ "color-bgc-p30": true,
267
+ "color-c-p100": true,
268
+ "behavior-ho-70": true,
269
+ "typography-w-400": true
270
+ },
271
+ CheckBox: {
272
+ container: {
273
+ "layout-dsp-iflex": true,
274
+ "layout-al-c": true
275
+ },
276
+ element: {
277
+ "layout-m-0": true,
278
+ "layout-mr-2": true,
279
+ "layout-p-2": true,
280
+ "border-br-12": true,
281
+ "border-bw-1": true,
282
+ "border-bs-s": true,
283
+ "color-bgc-p100": true,
284
+ "color-bc-p60": true,
285
+ "color-c-n30": true,
286
+ "color-c-p30": true
287
+ },
288
+ label: {
289
+ "color-c-p30": true,
290
+ "typography-f-sf": true,
291
+ "typography-v-r": true,
292
+ "typography-w-400": true,
293
+ "layout-flx-1": true,
294
+ "typography-sz-ll": true
295
+ }
296
+ },
297
+ DateTimeInput: {
298
+ container: {
299
+ "typography-sz-bm": true,
300
+ "layout-w-100": true,
301
+ "layout-g-2": true,
302
+ "layout-dsp-flexhor": true,
303
+ "layout-al-c": true,
304
+ "typography-ws-nw": true
305
+ },
306
+ label: {
307
+ "color-c-p30": true,
308
+ "typography-sz-bm": true
309
+ },
310
+ element: {
311
+ "layout-pt-2": true,
312
+ "layout-pb-2": true,
313
+ "layout-pl-3": true,
314
+ "layout-pr-3": true,
315
+ "border-br-2": true,
316
+ "border-bw-1": true,
317
+ "border-bs-s": true,
318
+ "color-bgc-p100": true,
319
+ "color-bc-p60": true,
320
+ "color-c-n30": true,
321
+ "color-c-p30": true
322
+ }
323
+ },
324
+ MultipleChoice: {
325
+ container: {},
326
+ label: {},
327
+ element: {}
328
+ },
329
+ Slider: {
330
+ container: {},
331
+ label: {},
332
+ element: {}
333
+ },
334
+ TextField: {
335
+ container: {
336
+ "typography-sz-bm": true,
337
+ "layout-w-100": true,
338
+ "layout-g-2": true,
339
+ "layout-dsp-flexhor": true,
340
+ "layout-al-c": true,
341
+ "typography-ws-nw": true
342
+ },
343
+ label: {
344
+ "layout-flx-0": true,
345
+ "color-c-p30": true
346
+ },
347
+ element: {
348
+ "typography-sz-bm": true,
349
+ "layout-pt-2": true,
350
+ "layout-pb-2": true,
351
+ "layout-pl-3": true,
352
+ "layout-pr-3": true,
353
+ "border-br-2": true,
354
+ "border-bw-1": true,
355
+ "border-bs-s": true,
356
+ "color-bgc-p100": true,
357
+ "color-bc-p60": true,
358
+ "color-c-n30": true,
359
+ "color-c-p30": true
360
+ }
361
+ }
362
+ },
363
+ elements: {
364
+ a: elementA,
365
+ audio: elementAudio,
366
+ body: elementBody,
367
+ button: elementButton,
368
+ h1: elementHeading,
369
+ h2: elementHeading,
370
+ h3: elementHeading,
371
+ h4: elementHeading,
372
+ h5: elementHeading,
373
+ iframe: elementIframe,
374
+ input: elementInput,
375
+ p: elementP,
376
+ pre: elementPre,
377
+ textarea: elementTextarea,
378
+ video: elementVideo
379
+ },
380
+ markdown: {
381
+ p: Object.keys(elementP),
382
+ h1: Object.keys(elementHeading),
383
+ h2: Object.keys(elementHeading),
384
+ h3: Object.keys(elementHeading),
385
+ h4: Object.keys(elementHeading),
386
+ h5: Object.keys(elementHeading),
387
+ ul: Object.keys(elementList),
388
+ ol: Object.keys(elementList),
389
+ li: Object.keys(elementList),
390
+ a: Object.keys(elementA),
391
+ strong: [],
392
+ em: []
393
+ }
394
+ };
395
+ /**
396
+ * Alias for litTheme - the default theme for A2UI React components.
397
+ * @see litTheme
398
+ */
399
+ const defaultTheme = litTheme;
400
+
401
+ //#endregion
402
+ //#region src/react-renderer/theme/ThemeContext.tsx
403
+ /**
404
+ * React context for the A2UI theme.
405
+ */
406
+ const ThemeContext = (0, react.createContext)(void 0);
407
+ /**
408
+ * Provider component that makes the A2UI theme available to descendant components.
409
+ */
410
+ function ThemeProvider({ theme, children }) {
411
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThemeContext.Provider, {
412
+ value: theme !== null && theme !== void 0 ? theme : defaultTheme,
413
+ children
414
+ });
415
+ }
416
+ /**
417
+ * Hook to access the current A2UI theme.
418
+ *
419
+ * @returns The current theme
420
+ * @throws If used outside of a ThemeProvider
421
+ */
422
+ function useTheme() {
423
+ const theme = (0, react.useContext)(ThemeContext);
424
+ if (!theme) throw new Error("useTheme must be used within a ThemeProvider or A2UIProvider");
425
+ return theme;
426
+ }
427
+
428
+ //#endregion
429
+ //#region src/react-renderer/core/A2UIProvider.tsx
430
+ /**
431
+ * Context for stable actions (never changes reference, prevents re-renders).
432
+ * Components that only need to dispatch actions or read data won't re-render.
433
+ */
434
+ const A2UIActionsContext = (0, react.createContext)(null);
435
+ /**
436
+ * Context for reactive state (changes trigger re-renders).
437
+ * Only components that need to react to state changes subscribe to this.
438
+ */
439
+ const A2UIStateContext = (0, react.createContext)(null);
440
+ /**
441
+ * Provider component that sets up the A2UI context for descendant components.
442
+ *
443
+ * This provider uses a two-context architecture for performance:
444
+ * - A2UIActionsContext: Stable actions that never change (no re-renders)
445
+ * - A2UIStateContext: Reactive state that triggers re-renders when needed
446
+ *
447
+ * @example
448
+ * ```tsx
449
+ * function App() {
450
+ * const handleAction = async (message) => {
451
+ * const response = await fetch('/api/a2ui', {
452
+ * method: 'POST',
453
+ * body: JSON.stringify(message)
454
+ * });
455
+ * const newMessages = await response.json();
456
+ * };
457
+ *
458
+ * return (
459
+ * <A2UIProvider onAction={handleAction}>
460
+ * <A2UIRenderer surfaceId="main" />
461
+ * </A2UIProvider>
462
+ * );
463
+ * }
464
+ * ```
465
+ */
466
+ function A2UIProvider({ onAction, theme, children }) {
467
+ const processorRef = (0, react.useRef)(null);
468
+ if (!processorRef.current) processorRef.current = _a2ui_lit_0_8.Data.createSignalA2uiMessageProcessor();
469
+ const processor = processorRef.current;
470
+ const [version, setVersion] = (0, react.useState)(0);
471
+ const onActionRef = (0, react.useRef)(onAction !== null && onAction !== void 0 ? onAction : null);
472
+ onActionRef.current = onAction !== null && onAction !== void 0 ? onAction : null;
473
+ const actionsRef = (0, react.useRef)(null);
474
+ if (!actionsRef.current) actionsRef.current = {
475
+ processMessages: (messages) => {
476
+ processor.processMessages(messages);
477
+ setVersion((v) => v + 1);
478
+ },
479
+ setData: (node, path, value, surfaceId) => {
480
+ processor.setData(node, path, value, surfaceId);
481
+ setVersion((v) => v + 1);
482
+ },
483
+ dispatch: (message) => {
484
+ if (onActionRef.current) onActionRef.current(message);
485
+ },
486
+ clearSurfaces: () => {
487
+ processor.clearSurfaces();
488
+ setVersion((v) => v + 1);
489
+ },
490
+ getSurface: (surfaceId) => {
491
+ return processor.getSurfaces().get(surfaceId);
492
+ },
493
+ getSurfaces: () => {
494
+ return processor.getSurfaces();
495
+ },
496
+ getData: (node, path, surfaceId) => {
497
+ return processor.getData(node, path, surfaceId);
498
+ },
499
+ resolvePath: (path, dataContextPath) => {
500
+ return processor.resolvePath(path, dataContextPath);
501
+ }
502
+ };
503
+ const actions = actionsRef.current;
504
+ const stateValue = (0, react.useMemo)(() => ({ version }), [version]);
505
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(A2UIActionsContext.Provider, {
506
+ value: actions,
507
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(A2UIStateContext.Provider, {
508
+ value: stateValue,
509
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThemeProvider, {
510
+ theme,
511
+ children
512
+ })
513
+ })
514
+ });
515
+ }
516
+ /**
517
+ * Hook to access stable A2UI actions (won't cause re-renders).
518
+ * Use this when you only need to dispatch actions or read data.
519
+ *
520
+ * @returns Stable actions object
521
+ * @throws If used outside of an A2UIProvider
522
+ */
523
+ function useA2UIActions() {
524
+ const actions = (0, react.useContext)(A2UIActionsContext);
525
+ if (!actions) throw new Error("useA2UIActions must be used within an A2UIProvider");
526
+ return actions;
527
+ }
528
+ /**
529
+ * Hook to subscribe to A2UI state changes.
530
+ * Components using this will re-render when state changes.
531
+ *
532
+ * @returns Current version number
533
+ * @throws If used outside of an A2UIProvider
534
+ */
535
+ function useA2UIState() {
536
+ const state = (0, react.useContext)(A2UIStateContext);
537
+ if (!state) throw new Error("useA2UIState must be used within an A2UIProvider");
538
+ return state;
539
+ }
540
+
541
+ //#endregion
542
+ //#region src/react-renderer/hooks/useA2UI.ts
543
+ /**
544
+ * Main API hook for A2UI. Provides methods to process messages
545
+ * and access surface state.
546
+ *
547
+ * Note: This hook subscribes to state changes. Components using this
548
+ * will re-render when the A2UI state changes. For action-only usage
549
+ * (no re-renders), use useA2UIActions() instead.
550
+ *
551
+ * @returns Object with message processing and surface access methods
552
+ *
553
+ * @example
554
+ * ```tsx
555
+ * function ChatApp() {
556
+ * const { processMessages, getSurface } = useA2UI();
557
+ *
558
+ * useEffect(() => {
559
+ * const ws = new WebSocket('wss://agent.example.com');
560
+ * ws.onmessage = (event) => {
561
+ * const messages = JSON.parse(event.data);
562
+ * processMessages(messages);
563
+ * };
564
+ * return () => ws.close();
565
+ * }, [processMessages]);
566
+ *
567
+ * return <A2UIRenderer surfaceId="main" />;
568
+ * }
569
+ * ```
570
+ */
571
+ function useA2UI() {
572
+ const actions = useA2UIActions();
573
+ const state = useA2UIState();
574
+ return {
575
+ processMessages: actions.processMessages,
576
+ getSurface: actions.getSurface,
577
+ getSurfaces: actions.getSurfaces,
578
+ clearSurfaces: actions.clearSurfaces,
579
+ version: state.version
580
+ };
581
+ }
582
+
583
+ //#endregion
584
+ //#region src/react-renderer/registry/ComponentRegistry.ts
585
+ /**
586
+ * Registry for A2UI components. Allows registration of custom components
587
+ * and supports lazy loading for code splitting.
588
+ *
589
+ * @example
590
+ * ```tsx
591
+ * const registry = new ComponentRegistry();
592
+ *
593
+ * // Register a component directly
594
+ * registry.register('Text', { component: Text });
595
+ *
596
+ * // Register with lazy loading
597
+ * registry.register('Modal', {
598
+ * component: () => import('./components/Modal'),
599
+ * lazy: true
600
+ * });
601
+ *
602
+ * // Use with A2UIRenderer
603
+ * <A2UIRenderer surfaceId="main" registry={registry} />
604
+ * ```
605
+ */
606
+ var ComponentRegistry = class ComponentRegistry {
607
+ constructor() {
608
+ this.registry = /* @__PURE__ */ new Map();
609
+ this.lazyCache = /* @__PURE__ */ new Map();
610
+ }
611
+ /**
612
+ * Get the singleton instance of the registry.
613
+ * Use this for the default global registry.
614
+ */
615
+ static getInstance() {
616
+ if (!ComponentRegistry._instance) ComponentRegistry._instance = new ComponentRegistry();
617
+ return ComponentRegistry._instance;
618
+ }
619
+ /**
620
+ * Reset the singleton instance.
621
+ * Useful for testing.
622
+ */
623
+ static resetInstance() {
624
+ ComponentRegistry._instance = null;
625
+ }
626
+ /**
627
+ * Register a component type.
628
+ *
629
+ * @param type - The A2UI component type name (e.g., 'Text', 'Button')
630
+ * @param registration - The component registration
631
+ */
632
+ register(type, registration) {
633
+ this.registry.set(type, registration);
634
+ }
635
+ /**
636
+ * Unregister a component type.
637
+ *
638
+ * @param type - The component type to unregister
639
+ */
640
+ unregister(type) {
641
+ this.registry.delete(type);
642
+ this.lazyCache.delete(type);
643
+ }
644
+ /**
645
+ * Check if a component type is registered.
646
+ *
647
+ * @param type - The component type to check
648
+ * @returns True if the component is registered
649
+ */
650
+ has(type) {
651
+ return this.registry.has(type);
652
+ }
653
+ /**
654
+ * Get a component by type. If the component is registered with lazy loading,
655
+ * returns a React.lazy wrapped component.
656
+ *
657
+ * @param type - The component type to get
658
+ * @returns The React component, or null if not found
659
+ */
660
+ get(type) {
661
+ const registration = this.registry.get(type);
662
+ if (!registration) return null;
663
+ if (registration.lazy && typeof registration.component === "function") {
664
+ const cached = this.lazyCache.get(type);
665
+ if (cached) return cached;
666
+ const lazyComponent = (0, react.lazy)(registration.component);
667
+ this.lazyCache.set(type, lazyComponent);
668
+ return lazyComponent;
669
+ }
670
+ return registration.component;
671
+ }
672
+ /**
673
+ * Get all registered component types.
674
+ *
675
+ * @returns Array of registered type names
676
+ */
677
+ getRegisteredTypes() {
678
+ return Array.from(this.registry.keys());
679
+ }
680
+ /**
681
+ * Clear all registrations.
682
+ */
683
+ clear() {
684
+ this.registry.clear();
685
+ this.lazyCache.clear();
686
+ }
687
+ };
688
+ ComponentRegistry._instance = null;
689
+
690
+ //#endregion
691
+ //#region src/react-renderer/core/ComponentNode.tsx
692
+ /** Memoized loading fallback to avoid recreating on each render */
693
+ const LoadingFallback = (0, react.memo)(function LoadingFallback() {
694
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
695
+ className: "a2ui-loading",
696
+ style: {
697
+ padding: "8px",
698
+ opacity: .5
699
+ },
700
+ children: "Loading..."
701
+ });
702
+ });
703
+ /**
704
+ * ComponentNode - dynamically renders an A2UI component based on its type.
705
+ *
706
+ * Looks up the component in the registry and renders it with the appropriate props.
707
+ * Supports lazy-loaded components via React.Suspense.
708
+ *
709
+ * No wrapper div is rendered - the component's root div (e.g., .a2ui-image) is the
710
+ * direct flex child, exactly matching Lit's structure where the :host element IS
711
+ * the flex item. Each component handles --weight CSS variable on its root div.
712
+ *
713
+ * Memoized to prevent unnecessary re-renders when parent updates but node hasn't changed.
714
+ */
715
+ const ComponentNode = (0, react.memo)(function ComponentNode({ node, surfaceId, registry }) {
716
+ const actualRegistry = registry !== null && registry !== void 0 ? registry : ComponentRegistry.getInstance();
717
+ const nodeType = node && typeof node === "object" && "type" in node ? node.type : null;
718
+ const Component = (0, react.useMemo)(() => nodeType ? actualRegistry.get(nodeType) : null, [actualRegistry, nodeType]);
719
+ if (!nodeType) {
720
+ if (node) console.warn("[A2UI] Invalid component node (not resolved?):", node);
721
+ return null;
722
+ }
723
+ if (!Component) {
724
+ console.warn(`[A2UI] Unknown component type: ${nodeType}`);
725
+ return null;
726
+ }
727
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Suspense, {
728
+ fallback: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LoadingFallback, {}),
729
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
730
+ node,
731
+ surfaceId
732
+ })
733
+ });
734
+ });
735
+
736
+ //#endregion
737
+ //#region src/react-renderer/theme/utils.ts
738
+ /**
739
+ * Converts a theme class map (Record<string, boolean>) to a className string.
740
+ *
741
+ * @param classMap - An object where keys are class names and values are booleans
742
+ * @returns A space-separated string of class names where the value is true
743
+ *
744
+ * @example
745
+ * classMapToString({ 'a2ui-button': true, 'a2ui-button--primary': true, 'disabled': false })
746
+ * // Returns: 'a2ui-button a2ui-button--primary'
747
+ */
748
+ function classMapToString(classMap) {
749
+ if (!classMap) return "";
750
+ return Object.entries(classMap).filter(([, enabled]) => enabled).map(([className]) => className).join(" ");
751
+ }
752
+ /**
753
+ * Converts an additional styles object (Record<string, string>) to a React style object.
754
+ *
755
+ * @param styles - An object with CSS property names as keys and values as strings
756
+ * @returns A React-compatible style object, or undefined if no styles
757
+ *
758
+ * @example
759
+ * stylesToObject({ 'background-color': 'red', 'font-size': '16px', '--custom-var': 'blue' })
760
+ * // Returns: { backgroundColor: 'red', fontSize: '16px', '--custom-var': 'blue' }
761
+ */
762
+ function stylesToObject(styles) {
763
+ if (!styles || Object.keys(styles).length === 0) return void 0;
764
+ const result = {};
765
+ for (const [key, value] of Object.entries(styles)) if (key.startsWith("--")) result[key] = value;
766
+ else {
767
+ const camelKey = key.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
768
+ result[camelKey] = value;
769
+ }
770
+ return result;
771
+ }
772
+
773
+ //#endregion
774
+ //#region src/react-renderer/lib/utils.ts
775
+ /**
776
+ * Utility function to merge class names.
777
+ * Combines clsx for conditional classes.
778
+ *
779
+ * @param inputs - Class values to merge
780
+ * @returns Merged class name string
781
+ *
782
+ * @example
783
+ * cn('base-class', condition && 'conditional-class', { 'object-class': true })
784
+ */
785
+ function cn(...inputs) {
786
+ return (0, clsx.clsx)(inputs);
787
+ }
788
+ /**
789
+ * Merges multiple class maps into a single class map.
790
+ * Uses Lit's Styles.merge() function directly for consistency.
791
+ *
792
+ * Lit's merge handles prefix conflicts: if you have 'layout-p-2' and 'layout-p-4',
793
+ * only the latter is kept (same prefix 'layout-p-' means they conflict).
794
+ *
795
+ * @param maps - Class maps to merge
796
+ * @returns A merged class map
797
+ */
798
+ function mergeClassMaps(...maps) {
799
+ const validMaps = maps.filter((m) => m !== void 0);
800
+ if (validMaps.length === 0) return {};
801
+ return _a2ui_lit_0_8.Styles.merge(...validMaps);
802
+ }
803
+
804
+ //#endregion
805
+ //#region src/react-renderer/core/A2UIRenderer.tsx
806
+ /** Default loading fallback - memoized to prevent recreation */
807
+ const DefaultLoadingFallback = (0, react.memo)(function DefaultLoadingFallback() {
808
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
809
+ className: "a2ui-loading",
810
+ style: {
811
+ padding: "16px",
812
+ opacity: .5
813
+ },
814
+ children: "Loading..."
815
+ });
816
+ });
817
+ /**
818
+ * A2UIRenderer - renders an A2UI surface.
819
+ *
820
+ * This is the main entry point for rendering A2UI content in your React app.
821
+ * It reads the surface state from the A2UI store and renders the component tree.
822
+ *
823
+ * Memoized to prevent unnecessary re-renders when props haven't changed.
824
+ *
825
+ * @example
826
+ * ```tsx
827
+ * function App() {
828
+ * return (
829
+ * <A2UIProvider onAction={handleAction}>
830
+ * <A2UIRenderer surfaceId="main" />
831
+ * </A2UIProvider>
832
+ * );
833
+ * }
834
+ * ```
835
+ */
836
+ const A2UIRenderer = (0, react.memo)(function A2UIRenderer({ surfaceId, className, fallback = null, loadingFallback, registry }) {
837
+ const { getSurface, version } = useA2UI();
838
+ const surface = getSurface(surfaceId);
839
+ const surfaceStyles = (0, react.useMemo)(() => {
840
+ if (!(surface === null || surface === void 0 ? void 0 : surface.styles)) return {};
841
+ const styles = {};
842
+ for (const [key, value] of Object.entries(surface.styles)) switch (key) {
843
+ case "primaryColor":
844
+ styles["--p-100"] = "#ffffff";
845
+ styles["--p-99"] = `color-mix(in srgb, ${value} 2%, white 98%)`;
846
+ styles["--p-98"] = `color-mix(in srgb, ${value} 4%, white 96%)`;
847
+ styles["--p-95"] = `color-mix(in srgb, ${value} 10%, white 90%)`;
848
+ styles["--p-90"] = `color-mix(in srgb, ${value} 20%, white 80%)`;
849
+ styles["--p-80"] = `color-mix(in srgb, ${value} 40%, white 60%)`;
850
+ styles["--p-70"] = `color-mix(in srgb, ${value} 60%, white 40%)`;
851
+ styles["--p-60"] = `color-mix(in srgb, ${value} 80%, white 20%)`;
852
+ styles["--p-50"] = String(value);
853
+ styles["--p-40"] = `color-mix(in srgb, ${value} 80%, black 20%)`;
854
+ styles["--p-35"] = `color-mix(in srgb, ${value} 70%, black 30%)`;
855
+ styles["--p-30"] = `color-mix(in srgb, ${value} 60%, black 40%)`;
856
+ styles["--p-25"] = `color-mix(in srgb, ${value} 50%, black 50%)`;
857
+ styles["--p-20"] = `color-mix(in srgb, ${value} 40%, black 60%)`;
858
+ styles["--p-15"] = `color-mix(in srgb, ${value} 30%, black 70%)`;
859
+ styles["--p-10"] = `color-mix(in srgb, ${value} 20%, black 80%)`;
860
+ styles["--p-5"] = `color-mix(in srgb, ${value} 10%, black 90%)`;
861
+ styles["--p-0"] = "#000000";
862
+ break;
863
+ case "font":
864
+ styles["--font-family"] = String(value);
865
+ styles["--font-family-flex"] = String(value);
866
+ break;
867
+ }
868
+ return styles;
869
+ }, [surface === null || surface === void 0 ? void 0 : surface.styles]);
870
+ if (!surface || !surface.componentTree) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: fallback });
871
+ const actualLoadingFallback = loadingFallback !== null && loadingFallback !== void 0 ? loadingFallback : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DefaultLoadingFallback, {});
872
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
873
+ className: cn("a2ui-surface", className),
874
+ style: surfaceStyles,
875
+ "data-surface-id": surfaceId,
876
+ "data-version": version,
877
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Suspense, {
878
+ fallback: actualLoadingFallback,
879
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ComponentNode, {
880
+ node: surface.componentTree,
881
+ surfaceId,
882
+ registry
883
+ })
884
+ })
885
+ });
886
+ });
887
+
888
+ //#endregion
889
+ //#region src/react-renderer/hooks/useA2UIComponent.ts
890
+ /**
891
+ * Base hook for A2UI components. Provides data binding, theme access,
892
+ * and action dispatching.
893
+ *
894
+ * @param node - The component node from the A2UI message processor
895
+ * @param surfaceId - The surface ID this component belongs to
896
+ * @returns Object with theme, data binding helpers, and action dispatcher
897
+ *
898
+ * @example
899
+ * ```tsx
900
+ * function TextField({ node, surfaceId }: A2UIComponentProps<Types.TextFieldNode>) {
901
+ * const { theme, resolveString, setValue } = useA2UIComponent(node, surfaceId);
902
+ *
903
+ * const label = resolveString(node.properties.label);
904
+ * const value = resolveString(node.properties.text) ?? '';
905
+ *
906
+ * return (
907
+ * <div className={classMapToString(theme.components.TextField.container)}>
908
+ * <label>{label}</label>
909
+ * <input
910
+ * value={value}
911
+ * onChange={(e) => setValue(node.properties.text?.path!, e.target.value)}
912
+ * />
913
+ * </div>
914
+ * );
915
+ * }
916
+ * ```
917
+ */
918
+ function useA2UIComponent(node, surfaceId) {
919
+ const actions = useA2UIActions();
920
+ const theme = useTheme();
921
+ const baseId = (0, react.useId)();
922
+ useA2UIState();
923
+ /**
924
+ * Resolve a StringValue to its actual string value.
925
+ * Checks literalString, literal, then path in that order.
926
+ * Note: This reads from data model via stable actions reference.
927
+ */
928
+ const resolveString = (0, react.useCallback)((value) => {
929
+ if (!value) return null;
930
+ if (typeof value !== "object") return null;
931
+ if (value.literalString !== void 0) return value.literalString;
932
+ if (value.literal !== void 0) return String(value.literal);
933
+ if (value.path) {
934
+ const data = actions.getData(node, value.path, surfaceId);
935
+ return data !== null ? String(data) : null;
936
+ }
937
+ return null;
938
+ }, [
939
+ actions,
940
+ node,
941
+ surfaceId
942
+ ]);
943
+ /**
944
+ * Resolve a NumberValue to its actual number value.
945
+ */
946
+ const resolveNumber = (0, react.useCallback)((value) => {
947
+ if (!value) return null;
948
+ if (typeof value !== "object") return null;
949
+ if (value.literalNumber !== void 0) return value.literalNumber;
950
+ if (value.literal !== void 0) return Number(value.literal);
951
+ if (value.path) {
952
+ const data = actions.getData(node, value.path, surfaceId);
953
+ return data !== null ? Number(data) : null;
954
+ }
955
+ return null;
956
+ }, [
957
+ actions,
958
+ node,
959
+ surfaceId
960
+ ]);
961
+ /**
962
+ * Resolve a BooleanValue to its actual boolean value.
963
+ */
964
+ const resolveBoolean = (0, react.useCallback)((value) => {
965
+ if (!value) return null;
966
+ if (typeof value !== "object") return null;
967
+ if (value.literalBoolean !== void 0) return value.literalBoolean;
968
+ if (value.literal !== void 0) return Boolean(value.literal);
969
+ if (value.path) {
970
+ const data = actions.getData(node, value.path, surfaceId);
971
+ return data !== null ? Boolean(data) : null;
972
+ }
973
+ return null;
974
+ }, [
975
+ actions,
976
+ node,
977
+ surfaceId
978
+ ]);
979
+ /**
980
+ * Set a value in the data model for two-way binding.
981
+ */
982
+ const setValue = (0, react.useCallback)((path, value) => {
983
+ actions.setData(node, path, value, surfaceId);
984
+ }, [
985
+ actions,
986
+ node,
987
+ surfaceId
988
+ ]);
989
+ /**
990
+ * Get a value from the data model.
991
+ */
992
+ const getValue = (0, react.useCallback)((path) => {
993
+ return actions.getData(node, path, surfaceId);
994
+ }, [
995
+ actions,
996
+ node,
997
+ surfaceId
998
+ ]);
999
+ /**
1000
+ * Dispatch a user action to the server.
1001
+ * Resolves all context bindings before dispatching.
1002
+ */
1003
+ const sendAction = (0, react.useCallback)((action) => {
1004
+ const actionContext = {};
1005
+ if (action.context) {
1006
+ for (const item of action.context) if (item.value.literalString !== void 0) actionContext[item.key] = item.value.literalString;
1007
+ else if (item.value.literalNumber !== void 0) actionContext[item.key] = item.value.literalNumber;
1008
+ else if (item.value.literalBoolean !== void 0) actionContext[item.key] = item.value.literalBoolean;
1009
+ else if (item.value.path) {
1010
+ const resolvedPath = actions.resolvePath(item.value.path, node.dataContextPath);
1011
+ actionContext[item.key] = actions.getData(node, resolvedPath, surfaceId);
1012
+ }
1013
+ }
1014
+ actions.dispatch({ userAction: {
1015
+ name: action.name,
1016
+ sourceComponentId: node.id,
1017
+ surfaceId,
1018
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1019
+ context: actionContext
1020
+ } });
1021
+ }, [
1022
+ actions,
1023
+ node,
1024
+ surfaceId
1025
+ ]);
1026
+ /**
1027
+ * Generate a unique ID for accessibility purposes.
1028
+ * Uses React's useId() for SSR and Concurrent Mode compatibility.
1029
+ */
1030
+ const getUniqueId = (0, react.useCallback)((prefix) => {
1031
+ return `${prefix}${baseId}`;
1032
+ }, [baseId]);
1033
+ return (0, react.useMemo)(() => ({
1034
+ theme,
1035
+ resolveString,
1036
+ resolveNumber,
1037
+ resolveBoolean,
1038
+ setValue,
1039
+ getValue,
1040
+ sendAction,
1041
+ getUniqueId
1042
+ }), [
1043
+ theme,
1044
+ resolveString,
1045
+ resolveNumber,
1046
+ resolveBoolean,
1047
+ setValue,
1048
+ getValue,
1049
+ sendAction,
1050
+ getUniqueId
1051
+ ]);
1052
+ }
1053
+
1054
+ //#endregion
1055
+ //#region src/react-renderer/components/content/Text.tsx
1056
+ function isHintedStyles(styles) {
1057
+ if (typeof styles !== "object" || !styles || Array.isArray(styles)) return false;
1058
+ return [
1059
+ "h1",
1060
+ "h2",
1061
+ "h3",
1062
+ "h4",
1063
+ "h5",
1064
+ "caption",
1065
+ "body"
1066
+ ].some((v) => v in styles);
1067
+ }
1068
+ /**
1069
+ * Markdown-it instance for rendering markdown text.
1070
+ * Uses synchronous import to ensure availability at first render (matches Lit renderer).
1071
+ *
1072
+ * Configuration matches Lit's markdown directive (uses MarkdownIt defaults):
1073
+ * - html: false (default) - Security: disable raw HTML
1074
+ * - linkify: false (default) - Don't auto-convert URLs/emails to links
1075
+ * - breaks: false (default) - Don't convert \n to <br>
1076
+ * - typographer: false (default) - Don't use smart quotes/dashes
1077
+ */
1078
+ const markdownRenderer = new markdown_it.default();
1079
+ /**
1080
+ * Apply theme classes to markdown HTML elements.
1081
+ * Replaces default element tags with themed versions.
1082
+ */
1083
+ function applyMarkdownTheme(html, markdownTheme) {
1084
+ if (!markdownTheme) return html;
1085
+ const replacements = [];
1086
+ for (const [element, classes] of Object.entries(markdownTheme)) {
1087
+ if (!classes || Array.isArray(classes) && classes.length === 0) continue;
1088
+ const classString = Array.isArray(classes) ? classes.join(" ") : classMapToString(classes);
1089
+ if (!classString) continue;
1090
+ const tagRegex = new RegExp(`<${element}(?=\\s|>|/>)`, "gi");
1091
+ replacements.push([tagRegex, `<${element} class="${classString}"`]);
1092
+ }
1093
+ let result = html;
1094
+ for (const [regex, replacement] of replacements) result = result.replace(regex, replacement);
1095
+ return result;
1096
+ }
1097
+ /**
1098
+ * Text component - renders text content with markdown support.
1099
+ *
1100
+ * Structure mirrors Lit's Text component:
1101
+ * <div class="a2ui-text"> ← :host equivalent
1102
+ * <section class="..."> ← theme classes
1103
+ * <h2>...</h2> ← rendered markdown content
1104
+ * </section>
1105
+ * </div>
1106
+ *
1107
+ * Text is parsed as markdown and rendered as HTML (matches Lit renderer behavior).
1108
+ * Supports usageHint values: h1, h2, h3, h4, h5, caption, body
1109
+ *
1110
+ * Markdown features supported:
1111
+ * - **Bold** and *italic* text
1112
+ * - Lists (ordered and unordered)
1113
+ * - `inline code` and code blocks
1114
+ * - [Links](url) (auto-linkified URLs too)
1115
+ * - Blockquotes
1116
+ * - Horizontal rules
1117
+ *
1118
+ * Note: Raw HTML is disabled for security.
1119
+ */
1120
+ const Text = (0, react.memo)(function Text({ node, surfaceId }) {
1121
+ var _theme$additionalStyl2;
1122
+ const { theme, resolveString } = useA2UIComponent(node, surfaceId);
1123
+ const props = node.properties;
1124
+ const textValue = resolveString(props.text);
1125
+ const usageHint = props.usageHint;
1126
+ const classes = mergeClassMaps(theme.components.Text.all, usageHint ? theme.components.Text[usageHint] : {});
1127
+ const additionalStyles = (0, react.useMemo)(() => {
1128
+ var _theme$additionalStyl;
1129
+ const textStyles = (_theme$additionalStyl = theme.additionalStyles) === null || _theme$additionalStyl === void 0 ? void 0 : _theme$additionalStyl.Text;
1130
+ if (!textStyles) return void 0;
1131
+ if (isHintedStyles(textStyles)) return stylesToObject(textStyles[usageHint !== null && usageHint !== void 0 ? usageHint : "body"]);
1132
+ return stylesToObject(textStyles);
1133
+ }, [(_theme$additionalStyl2 = theme.additionalStyles) === null || _theme$additionalStyl2 === void 0 ? void 0 : _theme$additionalStyl2.Text, usageHint]);
1134
+ const renderedContent = (0, react.useMemo)(() => {
1135
+ if (textValue === null || textValue === void 0) return null;
1136
+ let markdownText = textValue;
1137
+ switch (usageHint) {
1138
+ case "h1":
1139
+ markdownText = `# ${markdownText}`;
1140
+ break;
1141
+ case "h2":
1142
+ markdownText = `## ${markdownText}`;
1143
+ break;
1144
+ case "h3":
1145
+ markdownText = `### ${markdownText}`;
1146
+ break;
1147
+ case "h4":
1148
+ markdownText = `#### ${markdownText}`;
1149
+ break;
1150
+ case "h5":
1151
+ markdownText = `##### ${markdownText}`;
1152
+ break;
1153
+ case "caption":
1154
+ markdownText = `*${markdownText}*`;
1155
+ break;
1156
+ default: break;
1157
+ }
1158
+ return { __html: applyMarkdownTheme(markdownRenderer.render(markdownText), theme.markdown) };
1159
+ }, [
1160
+ textValue,
1161
+ theme.markdown,
1162
+ usageHint
1163
+ ]);
1164
+ if (!renderedContent) return null;
1165
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1166
+ className: "a2ui-text",
1167
+ style: node.weight !== void 0 ? { "--weight": node.weight } : {},
1168
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
1169
+ className: classMapToString(classes),
1170
+ style: additionalStyles,
1171
+ dangerouslySetInnerHTML: renderedContent
1172
+ })
1173
+ });
1174
+ });
1175
+
1176
+ //#endregion
1177
+ //#region src/react-renderer/components/content/Image.tsx
1178
+ /**
1179
+ * Image component - renders an image from a URL with optional sizing and fit modes.
1180
+ *
1181
+ * Supports usageHint values: icon, avatar, smallFeature, mediumFeature, largeFeature, header
1182
+ * Supports fit values: contain, cover, fill, none, scale-down (maps to object-fit via CSS variable)
1183
+ */
1184
+ const Image = (0, react.memo)(function Image({ node, surfaceId }) {
1185
+ var _ref, _theme$additionalStyl;
1186
+ const { theme, resolveString } = useA2UIComponent(node, surfaceId);
1187
+ const props = node.properties;
1188
+ const url = resolveString(props.url);
1189
+ const usageHint = props.usageHint;
1190
+ const fit = (_ref = props.fit) !== null && _ref !== void 0 ? _ref : "fill";
1191
+ const classes = mergeClassMaps(theme.components.Image.all, usageHint ? theme.components.Image[usageHint] : {});
1192
+ const style = {
1193
+ ...stylesToObject((_theme$additionalStyl = theme.additionalStyles) === null || _theme$additionalStyl === void 0 ? void 0 : _theme$additionalStyl.Image),
1194
+ "--object-fit": fit
1195
+ };
1196
+ if (!url) return null;
1197
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1198
+ className: "a2ui-image",
1199
+ style: node.weight !== void 0 ? { "--weight": node.weight } : {},
1200
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
1201
+ className: classMapToString(classes),
1202
+ style,
1203
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
1204
+ src: url,
1205
+ alt: ""
1206
+ })
1207
+ })
1208
+ });
1209
+ });
1210
+
1211
+ //#endregion
1212
+ //#region src/react-renderer/components/content/Icon.tsx
1213
+ /**
1214
+ * Convert camelCase to snake_case for Material Symbols font.
1215
+ * e.g., "shoppingCart" -> "shopping_cart"
1216
+ * This matches the Lit renderer's approach.
1217
+ */
1218
+ function toSnakeCase(str) {
1219
+ return str.replace(/([A-Z])/g, "_$1").toLowerCase();
1220
+ }
1221
+ /**
1222
+ * Icon component - renders an icon using Material Symbols Outlined font.
1223
+ *
1224
+ * This matches the Lit renderer's approach using the g-icon class with
1225
+ * Material Symbols Outlined font.
1226
+ *
1227
+ * @example Add Material Symbols font to your HTML:
1228
+ * ```html
1229
+ * <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined" rel="stylesheet">
1230
+ * ```
1231
+ */
1232
+ const Icon = (0, react.memo)(function Icon({ node, surfaceId }) {
1233
+ var _theme$additionalStyl;
1234
+ const { theme, resolveString } = useA2UIComponent(node, surfaceId);
1235
+ const props = node.properties;
1236
+ const iconName = resolveString(props.name);
1237
+ if (!iconName) return null;
1238
+ const snakeCaseName = toSnakeCase(iconName);
1239
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1240
+ className: "a2ui-icon",
1241
+ style: node.weight !== void 0 ? { "--weight": node.weight } : {},
1242
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
1243
+ className: classMapToString(theme.components.Icon),
1244
+ style: stylesToObject((_theme$additionalStyl = theme.additionalStyles) === null || _theme$additionalStyl === void 0 ? void 0 : _theme$additionalStyl.Icon),
1245
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1246
+ className: "g-icon",
1247
+ children: snakeCaseName
1248
+ })
1249
+ })
1250
+ });
1251
+ });
1252
+
1253
+ //#endregion
1254
+ //#region src/react-renderer/components/content/Divider.tsx
1255
+ /**
1256
+ * Divider component - renders a visual separator line.
1257
+ *
1258
+ * Structure mirrors Lit's Divider component:
1259
+ * <div class="a2ui-divider"> ← :host equivalent
1260
+ * <hr class="..."> ← internal element
1261
+ * </div>
1262
+ */
1263
+ const Divider = (0, react.memo)(function Divider({ node, surfaceId }) {
1264
+ var _theme$additionalStyl;
1265
+ const { theme } = useA2UIComponent(node, surfaceId);
1266
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1267
+ className: "a2ui-divider",
1268
+ style: node.weight !== void 0 ? { "--weight": node.weight } : {},
1269
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hr", {
1270
+ className: classMapToString(theme.components.Divider),
1271
+ style: stylesToObject((_theme$additionalStyl = theme.additionalStyles) === null || _theme$additionalStyl === void 0 ? void 0 : _theme$additionalStyl.Divider)
1272
+ })
1273
+ });
1274
+ });
1275
+
1276
+ //#endregion
1277
+ //#region src/react-renderer/components/content/Video.tsx
1278
+ /**
1279
+ * Check if a URL is a YouTube URL and extract the video ID.
1280
+ */
1281
+ function getYouTubeVideoId(url) {
1282
+ for (const pattern of [/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([^&\s?]+)/]) {
1283
+ const match = url.match(pattern);
1284
+ if (match && match.length > 1) return match[1];
1285
+ }
1286
+ return null;
1287
+ }
1288
+ /**
1289
+ * Video component - renders a video player.
1290
+ *
1291
+ * Supports regular video URLs and YouTube URLs (renders as embedded iframe).
1292
+ */
1293
+ const Video = (0, react.memo)(function Video({ node, surfaceId }) {
1294
+ var _theme$additionalStyl;
1295
+ const { theme, resolveString } = useA2UIComponent(node, surfaceId);
1296
+ const props = node.properties;
1297
+ const url = resolveString(props.url);
1298
+ if (!url) return null;
1299
+ const youtubeId = getYouTubeVideoId(url);
1300
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1301
+ className: "a2ui-video",
1302
+ style: node.weight !== void 0 ? { "--weight": node.weight } : {},
1303
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
1304
+ className: classMapToString(theme.components.Video),
1305
+ style: stylesToObject((_theme$additionalStyl = theme.additionalStyles) === null || _theme$additionalStyl === void 0 ? void 0 : _theme$additionalStyl.Video),
1306
+ children: youtubeId ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("iframe", {
1307
+ src: `https://www.youtube.com/embed/${youtubeId}`,
1308
+ title: "YouTube video player",
1309
+ allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
1310
+ allowFullScreen: true,
1311
+ style: {
1312
+ border: "none",
1313
+ width: "100%",
1314
+ aspectRatio: "16/9"
1315
+ }
1316
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("video", {
1317
+ src: url,
1318
+ controls: true
1319
+ })
1320
+ })
1321
+ });
1322
+ });
1323
+
1324
+ //#endregion
1325
+ //#region src/react-renderer/components/content/AudioPlayer.tsx
1326
+ /**
1327
+ * AudioPlayer component - renders an audio player with optional description.
1328
+ */
1329
+ const AudioPlayer = (0, react.memo)(function AudioPlayer({ node, surfaceId }) {
1330
+ var _props$description, _theme$additionalStyl;
1331
+ const { theme, resolveString } = useA2UIComponent(node, surfaceId);
1332
+ const props = node.properties;
1333
+ const url = resolveString(props.url);
1334
+ const description = resolveString((_props$description = props.description) !== null && _props$description !== void 0 ? _props$description : null);
1335
+ if (!url) return null;
1336
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1337
+ className: "a2ui-audio",
1338
+ style: node.weight !== void 0 ? { "--weight": node.weight } : {},
1339
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
1340
+ className: classMapToString(theme.components.AudioPlayer),
1341
+ style: stylesToObject((_theme$additionalStyl = theme.additionalStyles) === null || _theme$additionalStyl === void 0 ? void 0 : _theme$additionalStyl.AudioPlayer),
1342
+ children: [description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: description }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("audio", {
1343
+ src: url,
1344
+ controls: true
1345
+ })]
1346
+ })
1347
+ });
1348
+ });
1349
+
1350
+ //#endregion
1351
+ //#region src/react-renderer/components/layout/Row.tsx
1352
+ /**
1353
+ * Row component - arranges children horizontally using flexbox.
1354
+ *
1355
+ * Supports distribution (justify-content) and alignment (align-items) properties.
1356
+ */
1357
+ const Row = (0, react.memo)(function Row({ node, surfaceId }) {
1358
+ var _props$alignment, _props$distribution, _theme$additionalStyl;
1359
+ const { theme } = useA2UIComponent(node, surfaceId);
1360
+ const props = node.properties;
1361
+ const alignment = (_props$alignment = props.alignment) !== null && _props$alignment !== void 0 ? _props$alignment : "stretch";
1362
+ const distribution = (_props$distribution = props.distribution) !== null && _props$distribution !== void 0 ? _props$distribution : "start";
1363
+ const children = Array.isArray(props.children) ? props.children : [];
1364
+ const hostStyle = node.weight !== void 0 ? { "--weight": node.weight } : {};
1365
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1366
+ className: "a2ui-row",
1367
+ "data-alignment": alignment,
1368
+ "data-distribution": distribution,
1369
+ style: hostStyle,
1370
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
1371
+ className: classMapToString(theme.components.Row),
1372
+ style: stylesToObject((_theme$additionalStyl = theme.additionalStyles) === null || _theme$additionalStyl === void 0 ? void 0 : _theme$additionalStyl.Row),
1373
+ children: children.map((child, index) => {
1374
+ const childId = typeof child === "object" && child !== null && "id" in child ? child.id : `child-${index}`;
1375
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ComponentNode, {
1376
+ node: typeof child === "object" && child !== null && "type" in child ? child : null,
1377
+ surfaceId
1378
+ }, childId);
1379
+ })
1380
+ })
1381
+ });
1382
+ });
1383
+
1384
+ //#endregion
1385
+ //#region src/react-renderer/components/layout/Column.tsx
1386
+ /**
1387
+ * Column component - arranges children vertically using flexbox.
1388
+ *
1389
+ * Supports distribution (justify-content) and alignment (align-items) properties.
1390
+ */
1391
+ const Column = (0, react.memo)(function Column({ node, surfaceId }) {
1392
+ var _props$alignment, _props$distribution, _theme$additionalStyl;
1393
+ const { theme } = useA2UIComponent(node, surfaceId);
1394
+ const props = node.properties;
1395
+ const alignment = (_props$alignment = props.alignment) !== null && _props$alignment !== void 0 ? _props$alignment : "stretch";
1396
+ const distribution = (_props$distribution = props.distribution) !== null && _props$distribution !== void 0 ? _props$distribution : "start";
1397
+ const children = Array.isArray(props.children) ? props.children : [];
1398
+ const hostStyle = node.weight !== void 0 ? { "--weight": node.weight } : {};
1399
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1400
+ className: "a2ui-column",
1401
+ "data-alignment": alignment,
1402
+ "data-distribution": distribution,
1403
+ style: hostStyle,
1404
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
1405
+ className: classMapToString(theme.components.Column),
1406
+ style: stylesToObject((_theme$additionalStyl = theme.additionalStyles) === null || _theme$additionalStyl === void 0 ? void 0 : _theme$additionalStyl.Column),
1407
+ children: children.map((child, index) => {
1408
+ const childId = typeof child === "object" && child !== null && "id" in child ? child.id : `child-${index}`;
1409
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ComponentNode, {
1410
+ node: typeof child === "object" && child !== null && "type" in child ? child : null,
1411
+ surfaceId
1412
+ }, childId);
1413
+ })
1414
+ })
1415
+ });
1416
+ });
1417
+
1418
+ //#endregion
1419
+ //#region src/react-renderer/components/layout/List.tsx
1420
+ /**
1421
+ * List component - renders a scrollable list of items.
1422
+ *
1423
+ * Supports direction (vertical/horizontal) properties.
1424
+ */
1425
+ const List = (0, react.memo)(function List({ node, surfaceId }) {
1426
+ var _props$direction, _theme$additionalStyl;
1427
+ const { theme } = useA2UIComponent(node, surfaceId);
1428
+ const props = node.properties;
1429
+ const direction = (_props$direction = props.direction) !== null && _props$direction !== void 0 ? _props$direction : "vertical";
1430
+ const children = Array.isArray(props.children) ? props.children : [];
1431
+ const hostStyle = node.weight !== void 0 ? { "--weight": node.weight } : {};
1432
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1433
+ className: "a2ui-list",
1434
+ "data-direction": direction,
1435
+ style: hostStyle,
1436
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
1437
+ className: classMapToString(theme.components.List),
1438
+ style: stylesToObject((_theme$additionalStyl = theme.additionalStyles) === null || _theme$additionalStyl === void 0 ? void 0 : _theme$additionalStyl.List),
1439
+ children: children.map((child, index) => {
1440
+ const childId = typeof child === "object" && child !== null && "id" in child ? child.id : `child-${index}`;
1441
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ComponentNode, {
1442
+ node: typeof child === "object" && child !== null && "type" in child ? child : null,
1443
+ surfaceId
1444
+ }, childId);
1445
+ })
1446
+ })
1447
+ });
1448
+ });
1449
+
1450
+ //#endregion
1451
+ //#region src/react-renderer/components/layout/Card.tsx
1452
+ /**
1453
+ * Card component - a container that visually groups content.
1454
+ *
1455
+ * Structure mirrors Lit's Card component:
1456
+ * <div class="a2ui-card"> ← :host equivalent
1457
+ * <section class="..."> ← theme classes (border, padding, background)
1458
+ * {children} ← ::slotted(*) equivalent
1459
+ * </section>
1460
+ * </div>
1461
+ *
1462
+ * All styles come from componentSpecificStyles CSS, no inline styles needed.
1463
+ */
1464
+ const Card = (0, react.memo)(function Card({ node, surfaceId }) {
1465
+ var _props$children, _theme$additionalStyl;
1466
+ const { theme } = useA2UIComponent(node, surfaceId);
1467
+ const props = node.properties;
1468
+ const rawChildren = (_props$children = props.children) !== null && _props$children !== void 0 ? _props$children : props.child ? [props.child] : [];
1469
+ const children = Array.isArray(rawChildren) ? rawChildren : [];
1470
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1471
+ className: "a2ui-card",
1472
+ style: node.weight !== void 0 ? { "--weight": node.weight } : {},
1473
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
1474
+ className: classMapToString(theme.components.Card),
1475
+ style: stylesToObject((_theme$additionalStyl = theme.additionalStyles) === null || _theme$additionalStyl === void 0 ? void 0 : _theme$additionalStyl.Card),
1476
+ children: children.map((child, index) => {
1477
+ const childId = typeof child === "object" && child !== null && "id" in child ? child.id : `child-${index}`;
1478
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ComponentNode, {
1479
+ node: typeof child === "object" && child !== null && "type" in child ? child : null,
1480
+ surfaceId
1481
+ }, childId);
1482
+ })
1483
+ })
1484
+ });
1485
+ });
1486
+
1487
+ //#endregion
1488
+ //#region src/react-renderer/components/layout/Tabs.tsx
1489
+ /**
1490
+ * Tabs component - displays content in switchable tabs.
1491
+ */
1492
+ const Tabs = (0, react.memo)(function Tabs({ node, surfaceId }) {
1493
+ var _props$tabItems, _theme$additionalStyl;
1494
+ const { theme, resolveString } = useA2UIComponent(node, surfaceId);
1495
+ const props = node.properties;
1496
+ const [selectedIndex, setSelectedIndex] = (0, react.useState)(0);
1497
+ const tabItems = (_props$tabItems = props.tabItems) !== null && _props$tabItems !== void 0 ? _props$tabItems : [];
1498
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1499
+ className: "a2ui-tabs",
1500
+ style: node.weight !== void 0 ? { "--weight": node.weight } : {},
1501
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
1502
+ className: classMapToString(theme.components.Tabs.container),
1503
+ style: stylesToObject((_theme$additionalStyl = theme.additionalStyles) === null || _theme$additionalStyl === void 0 ? void 0 : _theme$additionalStyl.Tabs),
1504
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1505
+ id: "buttons",
1506
+ className: classMapToString(theme.components.Tabs.element),
1507
+ children: tabItems.map((tab, index) => {
1508
+ const title = resolveString(tab.title);
1509
+ const isSelected = index === selectedIndex;
1510
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1511
+ disabled: isSelected,
1512
+ className: classMapToString(isSelected ? mergeClassMaps(theme.components.Tabs.controls.all, theme.components.Tabs.controls.selected) : theme.components.Tabs.controls.all),
1513
+ onClick: () => setSelectedIndex(index),
1514
+ children: title
1515
+ }, index);
1516
+ })
1517
+ }), tabItems[selectedIndex] && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ComponentNode, {
1518
+ node: tabItems[selectedIndex].child,
1519
+ surfaceId
1520
+ })]
1521
+ })
1522
+ });
1523
+ });
1524
+
1525
+ //#endregion
1526
+ //#region src/react-renderer/components/layout/Modal.tsx
1527
+ /**
1528
+ * Modal component - displays content in a dialog overlay.
1529
+ *
1530
+ * Matches Lit's rendering approach:
1531
+ * - When closed: renders section with entry point child
1532
+ * - When open: renders dialog with content child (entry point is replaced)
1533
+ *
1534
+ * The dialog is rendered in place (no portal) so it stays inside .a2ui-surface
1535
+ * and CSS selectors work correctly. showModal() handles the top-layer overlay.
1536
+ */
1537
+ const Modal = (0, react.memo)(function Modal({ node, surfaceId }) {
1538
+ var _theme$additionalStyl;
1539
+ const { theme } = useA2UIComponent(node, surfaceId);
1540
+ const props = node.properties;
1541
+ const [isOpen, setIsOpen] = (0, react.useState)(false);
1542
+ const dialogRef = (0, react.useRef)(null);
1543
+ const openModal = (0, react.useCallback)(() => {
1544
+ setIsOpen(true);
1545
+ }, []);
1546
+ const closeModal = (0, react.useCallback)(() => {
1547
+ setIsOpen(false);
1548
+ }, []);
1549
+ (0, react.useEffect)(() => {
1550
+ const dialog = dialogRef.current;
1551
+ if (!dialog) return;
1552
+ if (isOpen && !dialog.open) dialog.showModal();
1553
+ const handleClose = () => {
1554
+ setIsOpen(false);
1555
+ };
1556
+ dialog.addEventListener("close", handleClose);
1557
+ return () => dialog.removeEventListener("close", handleClose);
1558
+ }, [isOpen]);
1559
+ const handleBackdropClick = (0, react.useCallback)((e) => {
1560
+ if (e.target === e.currentTarget) closeModal();
1561
+ }, [closeModal]);
1562
+ const handleKeyDown = (0, react.useCallback)((e) => {
1563
+ if (e.key === "Escape") closeModal();
1564
+ }, [closeModal]);
1565
+ const hostStyle = node.weight !== void 0 ? { "--weight": node.weight } : {};
1566
+ if (!isOpen) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1567
+ className: "a2ui-modal",
1568
+ style: hostStyle,
1569
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
1570
+ onClick: openModal,
1571
+ style: { cursor: "pointer" },
1572
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ComponentNode, {
1573
+ node: props.entryPointChild,
1574
+ surfaceId
1575
+ })
1576
+ })
1577
+ });
1578
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1579
+ className: "a2ui-modal",
1580
+ style: hostStyle,
1581
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dialog", {
1582
+ ref: dialogRef,
1583
+ className: classMapToString(theme.components.Modal.backdrop),
1584
+ onClick: handleBackdropClick,
1585
+ onKeyDown: handleKeyDown,
1586
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
1587
+ className: classMapToString(theme.components.Modal.element),
1588
+ style: stylesToObject((_theme$additionalStyl = theme.additionalStyles) === null || _theme$additionalStyl === void 0 ? void 0 : _theme$additionalStyl.Modal),
1589
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1590
+ id: "controls",
1591
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1592
+ onClick: closeModal,
1593
+ "aria-label": "Close modal",
1594
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1595
+ className: "g-icon",
1596
+ children: "close"
1597
+ })
1598
+ })
1599
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ComponentNode, {
1600
+ node: props.contentChild,
1601
+ surfaceId
1602
+ })]
1603
+ })
1604
+ })
1605
+ });
1606
+ });
1607
+
1608
+ //#endregion
1609
+ //#region src/react-renderer/components/interactive/Button.tsx
1610
+ /**
1611
+ * Button component - a clickable element that triggers an action.
1612
+ *
1613
+ * Contains a child component (usually Text or Icon) and dispatches
1614
+ * a user action when clicked.
1615
+ */
1616
+ const Button = (0, react.memo)(function Button({ node, surfaceId }) {
1617
+ var _theme$additionalStyl;
1618
+ const { theme, sendAction } = useA2UIComponent(node, surfaceId);
1619
+ const props = node.properties;
1620
+ const handleClick = (0, react.useCallback)(() => {
1621
+ if (props.action) sendAction(props.action);
1622
+ }, [props.action, sendAction]);
1623
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1624
+ className: "a2ui-button",
1625
+ style: node.weight !== void 0 ? { "--weight": node.weight } : {},
1626
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1627
+ className: classMapToString(theme.components.Button),
1628
+ style: stylesToObject((_theme$additionalStyl = theme.additionalStyles) === null || _theme$additionalStyl === void 0 ? void 0 : _theme$additionalStyl.Button),
1629
+ onClick: handleClick,
1630
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ComponentNode, {
1631
+ node: props.child,
1632
+ surfaceId
1633
+ })
1634
+ })
1635
+ });
1636
+ });
1637
+
1638
+ //#endregion
1639
+ //#region src/react-renderer/components/interactive/TextField.tsx
1640
+ /**
1641
+ * TextField component - an input field for text entry.
1642
+ *
1643
+ * Supports various input types and two-way data binding.
1644
+ */
1645
+ const TextField = (0, react.memo)(function TextField({ node, surfaceId }) {
1646
+ var _props$text, _resolveString, _theme$additionalStyl, _theme$additionalStyl2;
1647
+ const { theme, resolveString, setValue, getValue } = useA2UIComponent(node, surfaceId);
1648
+ const props = node.properties;
1649
+ const id = (0, react.useId)();
1650
+ const label = resolveString(props.label);
1651
+ const textPath = (_props$text = props.text) === null || _props$text === void 0 ? void 0 : _props$text.path;
1652
+ const initialValue = (_resolveString = resolveString(props.text)) !== null && _resolveString !== void 0 ? _resolveString : "";
1653
+ const fieldType = props.type;
1654
+ const validationRegexp = props.validationRegexp;
1655
+ const [value, setLocalValue] = (0, react.useState)(initialValue);
1656
+ const [_isValid, setIsValid] = (0, react.useState)(true);
1657
+ (0, react.useEffect)(() => {
1658
+ if (textPath) {
1659
+ const externalValue = getValue(textPath);
1660
+ if (externalValue !== null && String(externalValue) !== value) setLocalValue(String(externalValue));
1661
+ }
1662
+ }, [textPath, getValue]);
1663
+ const handleChange = (0, react.useCallback)((e) => {
1664
+ const newValue = e.target.value;
1665
+ setLocalValue(newValue);
1666
+ if (validationRegexp) setIsValid(new RegExp(validationRegexp).test(newValue));
1667
+ if (textPath) setValue(textPath, newValue);
1668
+ }, [
1669
+ validationRegexp,
1670
+ textPath,
1671
+ setValue
1672
+ ]);
1673
+ const inputType = fieldType === "number" ? "number" : fieldType === "date" ? "date" : "text";
1674
+ const isTextArea = fieldType === "longText";
1675
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1676
+ className: "a2ui-textfield",
1677
+ style: node.weight !== void 0 ? { "--weight": node.weight } : {},
1678
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
1679
+ className: classMapToString(theme.components.TextField.container),
1680
+ children: [label && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
1681
+ htmlFor: id,
1682
+ className: classMapToString(theme.components.TextField.label),
1683
+ children: label
1684
+ }), isTextArea ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
1685
+ id,
1686
+ value,
1687
+ onChange: handleChange,
1688
+ placeholder: "Please enter a value",
1689
+ className: classMapToString(theme.components.TextField.element),
1690
+ style: stylesToObject((_theme$additionalStyl = theme.additionalStyles) === null || _theme$additionalStyl === void 0 ? void 0 : _theme$additionalStyl.TextField)
1691
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
1692
+ type: inputType,
1693
+ id,
1694
+ value,
1695
+ onChange: handleChange,
1696
+ placeholder: "Please enter a value",
1697
+ className: classMapToString(theme.components.TextField.element),
1698
+ style: stylesToObject((_theme$additionalStyl2 = theme.additionalStyles) === null || _theme$additionalStyl2 === void 0 ? void 0 : _theme$additionalStyl2.TextField)
1699
+ })]
1700
+ })
1701
+ });
1702
+ });
1703
+
1704
+ //#endregion
1705
+ //#region src/react-renderer/components/interactive/CheckBox.tsx
1706
+ /**
1707
+ * CheckBox component - a boolean toggle with a label.
1708
+ *
1709
+ * Supports two-way data binding for the checked state.
1710
+ */
1711
+ const CheckBox = (0, react.memo)(function CheckBox({ node, surfaceId }) {
1712
+ var _props$value, _resolveBoolean, _props$value3, _theme$additionalStyl;
1713
+ const { theme, resolveString, resolveBoolean, setValue, getValue } = useA2UIComponent(node, surfaceId);
1714
+ const props = node.properties;
1715
+ const id = (0, react.useId)();
1716
+ const label = resolveString(props.label);
1717
+ const valuePath = (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.path;
1718
+ const [checked, setChecked] = (0, react.useState)((_resolveBoolean = resolveBoolean(props.value)) !== null && _resolveBoolean !== void 0 ? _resolveBoolean : false);
1719
+ (0, react.useEffect)(() => {
1720
+ if (valuePath) {
1721
+ const externalValue = getValue(valuePath);
1722
+ if (externalValue !== null && Boolean(externalValue) !== checked) setChecked(Boolean(externalValue));
1723
+ }
1724
+ }, [valuePath, getValue]);
1725
+ (0, react.useEffect)(() => {
1726
+ var _props$value2;
1727
+ if (((_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.literalBoolean) !== void 0) setChecked(props.value.literalBoolean);
1728
+ }, [(_props$value3 = props.value) === null || _props$value3 === void 0 ? void 0 : _props$value3.literalBoolean]);
1729
+ const handleChange = (0, react.useCallback)((e) => {
1730
+ const newValue = e.target.checked;
1731
+ setChecked(newValue);
1732
+ if (valuePath) setValue(valuePath, newValue);
1733
+ }, [valuePath, setValue]);
1734
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1735
+ className: "a2ui-checkbox",
1736
+ style: node.weight !== void 0 ? { "--weight": node.weight } : {},
1737
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
1738
+ className: classMapToString(theme.components.CheckBox.container),
1739
+ style: stylesToObject((_theme$additionalStyl = theme.additionalStyles) === null || _theme$additionalStyl === void 0 ? void 0 : _theme$additionalStyl.CheckBox),
1740
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
1741
+ type: "checkbox",
1742
+ id,
1743
+ checked,
1744
+ onChange: handleChange,
1745
+ className: classMapToString(theme.components.CheckBox.element)
1746
+ }), label && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
1747
+ htmlFor: id,
1748
+ className: classMapToString(theme.components.CheckBox.label),
1749
+ children: label
1750
+ })]
1751
+ })
1752
+ });
1753
+ });
1754
+
1755
+ //#endregion
1756
+ //#region src/react-renderer/components/interactive/Slider.tsx
1757
+ /**
1758
+ * Slider component - a numeric value selector with a range.
1759
+ *
1760
+ * Supports two-way data binding for the value.
1761
+ */
1762
+ const Slider = (0, react.memo)(function Slider({ node, surfaceId }) {
1763
+ var _props$value, _resolveNumber, _props$minValue, _props$maxValue, _props$value3, _theme$additionalStyl;
1764
+ const { theme, resolveNumber, resolveString, setValue, getValue } = useA2UIComponent(node, surfaceId);
1765
+ const props = node.properties;
1766
+ const id = (0, react.useId)();
1767
+ const valuePath = (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.path;
1768
+ const initialValue = (_resolveNumber = resolveNumber(props.value)) !== null && _resolveNumber !== void 0 ? _resolveNumber : 0;
1769
+ const minValue = (_props$minValue = props.minValue) !== null && _props$minValue !== void 0 ? _props$minValue : 0;
1770
+ const maxValue = (_props$maxValue = props.maxValue) !== null && _props$maxValue !== void 0 ? _props$maxValue : 0;
1771
+ const [value, setLocalValue] = (0, react.useState)(initialValue);
1772
+ (0, react.useEffect)(() => {
1773
+ if (valuePath) {
1774
+ const externalValue = getValue(valuePath);
1775
+ if (externalValue !== null && Number(externalValue) !== value) setLocalValue(Number(externalValue));
1776
+ }
1777
+ }, [valuePath, getValue]);
1778
+ (0, react.useEffect)(() => {
1779
+ var _props$value2;
1780
+ if (((_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.literalNumber) !== void 0) setLocalValue(props.value.literalNumber);
1781
+ }, [(_props$value3 = props.value) === null || _props$value3 === void 0 ? void 0 : _props$value3.literalNumber]);
1782
+ const handleChange = (0, react.useCallback)((e) => {
1783
+ const newValue = Number(e.target.value);
1784
+ setLocalValue(newValue);
1785
+ if (valuePath) setValue(valuePath, newValue);
1786
+ }, [valuePath, setValue]);
1787
+ const labelValue = props.label;
1788
+ const label = labelValue ? resolveString(labelValue) : "";
1789
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1790
+ className: "a2ui-slider",
1791
+ style: node.weight !== void 0 ? { "--weight": node.weight } : {},
1792
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
1793
+ className: classMapToString(theme.components.Slider.container),
1794
+ children: [
1795
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
1796
+ htmlFor: id,
1797
+ className: classMapToString(theme.components.Slider.label),
1798
+ children: label
1799
+ }),
1800
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
1801
+ type: "range",
1802
+ id,
1803
+ name: "data",
1804
+ value,
1805
+ min: minValue,
1806
+ max: maxValue,
1807
+ onChange: handleChange,
1808
+ className: classMapToString(theme.components.Slider.element),
1809
+ style: stylesToObject((_theme$additionalStyl = theme.additionalStyles) === null || _theme$additionalStyl === void 0 ? void 0 : _theme$additionalStyl.Slider)
1810
+ }),
1811
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1812
+ className: classMapToString(theme.components.Slider.label),
1813
+ children: value
1814
+ })
1815
+ ]
1816
+ })
1817
+ });
1818
+ });
1819
+
1820
+ //#endregion
1821
+ //#region src/react-renderer/components/interactive/DateTimeInput.tsx
1822
+ /**
1823
+ * DateTimeInput component - a date and/or time picker.
1824
+ *
1825
+ * Supports enabling date, time, or both. Uses native HTML5 date/time inputs.
1826
+ */
1827
+ const DateTimeInput = (0, react.memo)(function DateTimeInput({ node, surfaceId }) {
1828
+ var _props$value, _resolveString, _props$enableDate, _props$enableTime, _theme$additionalStyl;
1829
+ const { theme, resolveString, setValue, getValue } = useA2UIComponent(node, surfaceId);
1830
+ const props = node.properties;
1831
+ const id = (0, react.useId)();
1832
+ const valuePath = (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.path;
1833
+ const initialValue = (_resolveString = resolveString(props.value)) !== null && _resolveString !== void 0 ? _resolveString : "";
1834
+ const enableDate = (_props$enableDate = props.enableDate) !== null && _props$enableDate !== void 0 ? _props$enableDate : true;
1835
+ const enableTime = (_props$enableTime = props.enableTime) !== null && _props$enableTime !== void 0 ? _props$enableTime : false;
1836
+ const [value, setLocalValue] = (0, react.useState)(initialValue);
1837
+ (0, react.useEffect)(() => {
1838
+ if (valuePath) {
1839
+ const externalValue = getValue(valuePath);
1840
+ if (externalValue !== null && String(externalValue) !== value) setLocalValue(String(externalValue));
1841
+ }
1842
+ }, [valuePath, getValue]);
1843
+ const handleChange = (0, react.useCallback)((e) => {
1844
+ const newValue = e.target.value;
1845
+ setLocalValue(newValue);
1846
+ if (valuePath) setValue(valuePath, newValue);
1847
+ }, [valuePath, setValue]);
1848
+ let inputType = "date";
1849
+ if (enableDate && enableTime) inputType = "datetime-local";
1850
+ else if (enableTime && !enableDate) inputType = "time";
1851
+ const getPlaceholderText = () => {
1852
+ if (enableDate && enableTime) return "Date & Time";
1853
+ else if (enableTime) return "Time";
1854
+ return "Date";
1855
+ };
1856
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1857
+ className: "a2ui-datetime-input",
1858
+ style: node.weight !== void 0 ? { "--weight": node.weight } : {},
1859
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
1860
+ className: classMapToString(theme.components.DateTimeInput.container),
1861
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
1862
+ htmlFor: id,
1863
+ className: classMapToString(theme.components.DateTimeInput.label),
1864
+ children: getPlaceholderText()
1865
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
1866
+ type: inputType,
1867
+ id,
1868
+ value,
1869
+ onChange: handleChange,
1870
+ className: classMapToString(theme.components.DateTimeInput.element),
1871
+ style: stylesToObject((_theme$additionalStyl = theme.additionalStyles) === null || _theme$additionalStyl === void 0 ? void 0 : _theme$additionalStyl.DateTimeInput)
1872
+ })]
1873
+ })
1874
+ });
1875
+ });
1876
+
1877
+ //#endregion
1878
+ //#region src/react-renderer/components/interactive/MultipleChoice.tsx
1879
+ /**
1880
+ * MultipleChoice component - a selection component using a dropdown.
1881
+ *
1882
+ * Renders a <select> element with options, matching the Lit renderer's behavior.
1883
+ * Supports two-way data binding for the selected value.
1884
+ */
1885
+ const MultipleChoice = (0, react.memo)(function MultipleChoice({ node, surfaceId }) {
1886
+ var _ref, _props$selections, _resolveString, _theme$additionalStyl;
1887
+ const { theme, resolveString, setValue } = useA2UIComponent(node, surfaceId);
1888
+ const props = node.properties;
1889
+ const id = (0, react.useId)();
1890
+ const options = (_ref = props.options) !== null && _ref !== void 0 ? _ref : [];
1891
+ const selectionsPath = (_props$selections = props.selections) === null || _props$selections === void 0 ? void 0 : _props$selections.path;
1892
+ const description = (_resolveString = resolveString(props.description)) !== null && _resolveString !== void 0 ? _resolveString : "Select an item";
1893
+ const handleChange = (0, react.useCallback)((e) => {
1894
+ if (selectionsPath) setValue(selectionsPath, [e.target.value]);
1895
+ }, [selectionsPath, setValue]);
1896
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1897
+ className: "a2ui-multiplechoice",
1898
+ style: node.weight !== void 0 ? { "--weight": node.weight } : {},
1899
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
1900
+ className: classMapToString(theme.components.MultipleChoice.container),
1901
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
1902
+ htmlFor: id,
1903
+ className: classMapToString(theme.components.MultipleChoice.label),
1904
+ children: description
1905
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
1906
+ name: "data",
1907
+ id,
1908
+ className: classMapToString(theme.components.MultipleChoice.element),
1909
+ style: stylesToObject((_theme$additionalStyl = theme.additionalStyles) === null || _theme$additionalStyl === void 0 ? void 0 : _theme$additionalStyl.MultipleChoice),
1910
+ onChange: handleChange,
1911
+ children: options.map((option) => {
1912
+ const label = resolveString(option.label);
1913
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
1914
+ value: option.value,
1915
+ children: label
1916
+ }, option.value);
1917
+ })
1918
+ })]
1919
+ })
1920
+ });
1921
+ });
1922
+
1923
+ //#endregion
1924
+ //#region src/react-renderer/registry/defaultCatalog.ts
1925
+ /**
1926
+ * Registers all standard A2UI components in the registry.
1927
+ *
1928
+ * @param registry - The component registry to populate
1929
+ */
1930
+ function registerDefaultCatalog(registry) {
1931
+ registry.register("Text", { component: Text });
1932
+ registry.register("Image", { component: Image });
1933
+ registry.register("Icon", { component: Icon });
1934
+ registry.register("Divider", { component: Divider });
1935
+ registry.register("Video", { component: Video });
1936
+ registry.register("AudioPlayer", { component: AudioPlayer });
1937
+ registry.register("Row", { component: Row });
1938
+ registry.register("Column", { component: Column });
1939
+ registry.register("List", { component: List });
1940
+ registry.register("Card", { component: Card });
1941
+ registry.register("Tabs", { component: Tabs });
1942
+ registry.register("Modal", { component: Modal });
1943
+ registry.register("Button", { component: Button });
1944
+ registry.register("TextField", { component: TextField });
1945
+ registry.register("CheckBox", { component: CheckBox });
1946
+ registry.register("Slider", { component: Slider });
1947
+ registry.register("DateTimeInput", { component: DateTimeInput });
1948
+ registry.register("MultipleChoice", { component: MultipleChoice });
1949
+ }
1950
+ /**
1951
+ * Initialize the default catalog in the singleton registry.
1952
+ * Call this once at app startup.
1953
+ */
1954
+ function initializeDefaultCatalog() {
1955
+ registerDefaultCatalog(ComponentRegistry.getInstance());
1956
+ }
1957
+
1958
+ //#endregion
1959
+ //#region src/react-renderer/styles/reset.ts
1960
+ /**
1961
+ * Browser default reset for A2UI surfaces.
1962
+ *
1963
+ * The React renderer uses Light DOM, which means host-app CSS resets
1964
+ * (e.g. Tailwind preflight, normalize.css) can strip browser defaults
1965
+ * like heading margins, list styles, and form element appearance from
1966
+ * elements inside the renderer.
1967
+ *
1968
+ * The Lit renderer avoids this because Shadow DOM isolates its elements
1969
+ * from external stylesheets.
1970
+ *
1971
+ * This reset restores browser defaults inside `.a2ui-surface` by using
1972
+ * `all: revert` in a CSS @layer. Layered styles have the lowest author
1973
+ * priority, so every other A2UI style (utility classes, component styles,
1974
+ * theme classes, inline styles) automatically overrides the reset.
1975
+ */
1976
+ const resetStyles = `
1977
+ @layer a2ui-reset {
1978
+ :where(.a2ui-surface) :where(*) {
1979
+ all: revert;
1980
+ }
1981
+ }
1982
+ `;
1983
+
1984
+ //#endregion
1985
+ //#region src/react-renderer/styles/index.ts
1986
+ /**
1987
+ * Structural CSS styles from the Lit renderer, converted for global DOM use.
1988
+ * These styles define all the utility classes (layout-*, typography-*, color-*, etc.)
1989
+ * Converts :host selectors to .a2ui-surface for scoped use outside Shadow DOM.
1990
+ */
1991
+ const structuralStyles = _a2ui_lit_0_8.Styles.structuralStyles.replace(/:host\s*\{/g, ".a2ui-surface {");
1992
+ /**
1993
+ * Component-specific styles that replicate Lit's Shadow DOM scoped CSS.
1994
+ *
1995
+ * Each Lit component has `static styles` with :host, element selectors, and ::slotted().
1996
+ * Since React uses Light DOM, we transform these to global CSS scoped under .a2ui-surface.
1997
+ *
1998
+ * Transformation rules:
1999
+ * :host → .a2ui-surface .a2ui-{component}
2000
+ * section → .a2ui-surface .a2ui-{component} section
2001
+ * ::slotted(*) → .a2ui-surface .a2ui-{component} section > *
2002
+ */
2003
+ const componentSpecificStyles = `
2004
+ /* =========================================================================
2005
+ * Card (from Lit card.ts static styles)
2006
+ * ========================================================================= */
2007
+
2008
+ /* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */
2009
+ .a2ui-surface .a2ui-card {
2010
+ display: block;
2011
+ flex: var(--weight);
2012
+ min-height: 0;
2013
+ overflow: auto;
2014
+ }
2015
+
2016
+ /* section { height: 100%; width: 100%; min-height: 0; overflow: auto; } */
2017
+ /* Use > to target only Card's direct section, not nested sections (e.g., TextField's section) */
2018
+ .a2ui-surface .a2ui-card > section {
2019
+ height: 100%;
2020
+ width: 100%;
2021
+ min-height: 0;
2022
+ overflow: auto;
2023
+ }
2024
+
2025
+ /* section ::slotted(*) { height: 100%; width: 100%; } */
2026
+ /* Use > section > to only target Card's slotted children, not deeply nested elements */
2027
+ .a2ui-surface .a2ui-card > section > * {
2028
+ height: 100%;
2029
+ width: 100%;
2030
+ }
2031
+
2032
+ /* =========================================================================
2033
+ * Divider (from Lit divider.ts static styles)
2034
+ * ========================================================================= */
2035
+
2036
+ /* :host { display: block; min-height: 0; overflow: auto; } */
2037
+ .a2ui-surface .a2ui-divider {
2038
+ display: block;
2039
+ min-height: 0;
2040
+ overflow: auto;
2041
+ }
2042
+
2043
+ /* hr { height: 1px; background: #ccc; border: none; } */
2044
+ /* Use :where() for low specificity (0,0,1) so theme utility classes can override */
2045
+ /* Browser default margins apply (margin-block: 0.5em, margin-inline: auto) */
2046
+ :where(.a2ui-surface .a2ui-divider) hr {
2047
+ height: 1px;
2048
+ background: #ccc;
2049
+ border: none;
2050
+ }
2051
+
2052
+ /* =========================================================================
2053
+ * Text (from Lit text.ts static styles)
2054
+ * ========================================================================= */
2055
+
2056
+ /* :host { display: block; flex: var(--weight); } */
2057
+ .a2ui-surface .a2ui-text {
2058
+ display: block;
2059
+ flex: var(--weight);
2060
+ }
2061
+
2062
+ /* h1, h2, h3, h4, h5 { line-height: inherit; font: inherit; } */
2063
+ /* Use :where() to match Lit's low specificity (0,0,0,1 - just element) */
2064
+ :where(.a2ui-surface .a2ui-text) h1,
2065
+ :where(.a2ui-surface .a2ui-text) h2,
2066
+ :where(.a2ui-surface .a2ui-text) h3,
2067
+ :where(.a2ui-surface .a2ui-text) h4,
2068
+ :where(.a2ui-surface .a2ui-text) h5 {
2069
+ line-height: inherit;
2070
+ font: inherit;
2071
+ }
2072
+
2073
+ /* Ensure markdown paragraph margins are reset */
2074
+ .a2ui-surface .a2ui-text p {
2075
+ margin: 0;
2076
+ }
2077
+
2078
+ /* =========================================================================
2079
+ * TextField (from Lit text-field.ts static styles)
2080
+ * ========================================================================= */
2081
+
2082
+ /* :host { display: flex; flex: var(--weight); } */
2083
+ .a2ui-surface .a2ui-textfield {
2084
+ display: flex;
2085
+ flex: var(--weight);
2086
+ }
2087
+
2088
+ /* input { display: block; width: 100%; } */
2089
+ :where(.a2ui-surface .a2ui-textfield) input {
2090
+ display: block;
2091
+ width: 100%;
2092
+ }
2093
+
2094
+ /* label { display: block; margin-bottom: 4px; } */
2095
+ :where(.a2ui-surface .a2ui-textfield) label {
2096
+ display: block;
2097
+ margin-bottom: 4px;
2098
+ }
2099
+
2100
+ /* textarea - same styling as input for multiline text fields */
2101
+ :where(.a2ui-surface .a2ui-textfield) textarea {
2102
+ display: block;
2103
+ width: 100%;
2104
+ }
2105
+
2106
+ /* =========================================================================
2107
+ * CheckBox (from Lit checkbox.ts static styles)
2108
+ * ========================================================================= */
2109
+
2110
+ /* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */
2111
+ .a2ui-surface .a2ui-checkbox {
2112
+ display: block;
2113
+ flex: var(--weight);
2114
+ min-height: 0;
2115
+ overflow: auto;
2116
+ }
2117
+
2118
+ /* input { display: block; width: 100%; } */
2119
+ :where(.a2ui-surface .a2ui-checkbox) input {
2120
+ display: block;
2121
+ width: 100%;
2122
+ }
2123
+
2124
+ /* =========================================================================
2125
+ * Slider (from Lit slider.ts static styles)
2126
+ * ========================================================================= */
2127
+
2128
+ /* :host { display: block; flex: var(--weight); } */
2129
+ .a2ui-surface .a2ui-slider {
2130
+ display: block;
2131
+ flex: var(--weight);
2132
+ }
2133
+
2134
+ /* input { display: block; width: 100%; } */
2135
+ :where(.a2ui-surface .a2ui-slider) input {
2136
+ display: block;
2137
+ width: 100%;
2138
+ }
2139
+
2140
+ /* =========================================================================
2141
+ * Button (from Lit button.ts static styles)
2142
+ * ========================================================================= */
2143
+
2144
+ /* :host { display: block; flex: var(--weight); min-height: 0; } */
2145
+ .a2ui-surface .a2ui-button {
2146
+ display: block;
2147
+ flex: var(--weight);
2148
+ min-height: 0;
2149
+ }
2150
+
2151
+ /* =========================================================================
2152
+ * Icon (from Lit icon.ts static styles)
2153
+ * ========================================================================= */
2154
+
2155
+ /* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */
2156
+ .a2ui-surface .a2ui-icon {
2157
+ display: block;
2158
+ flex: var(--weight);
2159
+ min-height: 0;
2160
+ overflow: auto;
2161
+ }
2162
+
2163
+ /* =========================================================================
2164
+ * Tabs (from Lit tabs.ts static styles)
2165
+ * ========================================================================= */
2166
+
2167
+ /* :host { display: block; flex: var(--weight); } */
2168
+ .a2ui-surface .a2ui-tabs {
2169
+ display: block;
2170
+ flex: var(--weight);
2171
+ }
2172
+
2173
+ /* =========================================================================
2174
+ * Modal (from Lit modal.ts static styles)
2175
+ * ========================================================================= */
2176
+
2177
+ /* :host { display: block; flex: var(--weight); } */
2178
+ .a2ui-surface .a2ui-modal {
2179
+ display: block;
2180
+ flex: var(--weight);
2181
+ }
2182
+
2183
+ /* dialog { padding: 0; border: none; background: none; } */
2184
+ :where(.a2ui-surface .a2ui-modal) dialog {
2185
+ padding: 0;
2186
+ border: none;
2187
+ background: none;
2188
+ }
2189
+
2190
+ /* dialog section #controls { display: flex; justify-content: end; margin-bottom: 4px; } */
2191
+ .a2ui-surface .a2ui-modal dialog section #controls {
2192
+ display: flex;
2193
+ justify-content: end;
2194
+ margin-bottom: 4px;
2195
+ }
2196
+
2197
+ /* dialog section #controls button { padding: 0; background: none; ... } */
2198
+ .a2ui-surface .a2ui-modal dialog section #controls button {
2199
+ padding: 0;
2200
+ background: none;
2201
+ width: 20px;
2202
+ height: 20px;
2203
+ cursor: pointer;
2204
+ border: none;
2205
+ }
2206
+
2207
+ /* =========================================================================
2208
+ * Image (from Lit image.ts static styles)
2209
+ * ========================================================================= */
2210
+
2211
+ /* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */
2212
+ .a2ui-surface .a2ui-image {
2213
+ display: block;
2214
+ flex: var(--weight);
2215
+ min-height: 0;
2216
+ overflow: auto;
2217
+ }
2218
+
2219
+ /* img { display: block; width: 100%; height: 100%; object-fit: var(--object-fit, fill); } */
2220
+ :where(.a2ui-surface .a2ui-image) img {
2221
+ display: block;
2222
+ width: 100%;
2223
+ height: 100%;
2224
+ object-fit: var(--object-fit, fill);
2225
+ }
2226
+
2227
+ /* =========================================================================
2228
+ * Video (from Lit video.ts static styles)
2229
+ * ========================================================================= */
2230
+
2231
+ /* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */
2232
+ .a2ui-surface .a2ui-video {
2233
+ display: block;
2234
+ flex: var(--weight);
2235
+ min-height: 0;
2236
+ overflow: auto;
2237
+ }
2238
+
2239
+ /* video { display: block; width: 100%; } */
2240
+ :where(.a2ui-surface .a2ui-video) video {
2241
+ display: block;
2242
+ width: 100%;
2243
+ }
2244
+
2245
+ /* =========================================================================
2246
+ * AudioPlayer (from Lit audio.ts static styles)
2247
+ * ========================================================================= */
2248
+
2249
+ /* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */
2250
+ .a2ui-surface .a2ui-audio {
2251
+ display: block;
2252
+ flex: var(--weight);
2253
+ min-height: 0;
2254
+ overflow: auto;
2255
+ }
2256
+
2257
+ /* audio { display: block; width: 100%; } */
2258
+ :where(.a2ui-surface .a2ui-audio) audio {
2259
+ display: block;
2260
+ width: 100%;
2261
+ }
2262
+
2263
+ /* =========================================================================
2264
+ * MultipleChoice (from Lit multiple-choice.ts static styles)
2265
+ * ========================================================================= */
2266
+
2267
+ /* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */
2268
+ .a2ui-surface .a2ui-multiplechoice {
2269
+ display: block;
2270
+ flex: var(--weight);
2271
+ min-height: 0;
2272
+ overflow: auto;
2273
+ }
2274
+
2275
+ /* select { width: 100%; } */
2276
+ :where(.a2ui-surface .a2ui-multiplechoice) select {
2277
+ width: 100%;
2278
+ }
2279
+
2280
+ /* =========================================================================
2281
+ * Column (from Lit column.ts static styles)
2282
+ * ========================================================================= */
2283
+
2284
+ /* :host { display: flex; flex: var(--weight); } */
2285
+ .a2ui-surface .a2ui-column {
2286
+ display: flex;
2287
+ flex: var(--weight);
2288
+ }
2289
+
2290
+ /* section { display: flex; flex-direction: column; min-width: 100%; height: 100%; } */
2291
+ .a2ui-surface .a2ui-column > section {
2292
+ display: flex;
2293
+ flex-direction: column;
2294
+ min-width: 100%;
2295
+ height: 100%;
2296
+ }
2297
+
2298
+ /* :host([alignment="..."]) section { align-items: ...; } */
2299
+ /* Use > section to only target Column's direct section, not nested sections (e.g., CheckBox's section) */
2300
+ .a2ui-surface .a2ui-column[data-alignment="start"] > section { align-items: start; }
2301
+ .a2ui-surface .a2ui-column[data-alignment="center"] > section { align-items: center; }
2302
+ .a2ui-surface .a2ui-column[data-alignment="end"] > section { align-items: end; }
2303
+ .a2ui-surface .a2ui-column[data-alignment="stretch"] > section { align-items: stretch; }
2304
+
2305
+ /* :host([distribution="..."]) section { justify-content: ...; } */
2306
+ .a2ui-surface .a2ui-column[data-distribution="start"] > section { justify-content: start; }
2307
+ .a2ui-surface .a2ui-column[data-distribution="center"] > section { justify-content: center; }
2308
+ .a2ui-surface .a2ui-column[data-distribution="end"] > section { justify-content: end; }
2309
+ .a2ui-surface .a2ui-column[data-distribution="spaceBetween"] > section { justify-content: space-between; }
2310
+ .a2ui-surface .a2ui-column[data-distribution="spaceAround"] > section { justify-content: space-around; }
2311
+ .a2ui-surface .a2ui-column[data-distribution="spaceEvenly"] > section { justify-content: space-evenly; }
2312
+
2313
+ /* =========================================================================
2314
+ * Row (from Lit row.ts static styles)
2315
+ * ========================================================================= */
2316
+
2317
+ /* :host { display: flex; flex: var(--weight); } */
2318
+ .a2ui-surface .a2ui-row {
2319
+ display: flex;
2320
+ flex: var(--weight);
2321
+ }
2322
+
2323
+ /* section { display: flex; flex-direction: row; width: 100%; min-height: 100%; } */
2324
+ .a2ui-surface .a2ui-row > section {
2325
+ display: flex;
2326
+ flex-direction: row;
2327
+ width: 100%;
2328
+ min-height: 100%;
2329
+ }
2330
+
2331
+ /* :host([alignment="..."]) section { align-items: ...; } */
2332
+ /* Use > section to only target Row's direct section, not nested sections */
2333
+ .a2ui-surface .a2ui-row[data-alignment="start"] > section { align-items: start; }
2334
+ .a2ui-surface .a2ui-row[data-alignment="center"] > section { align-items: center; }
2335
+ .a2ui-surface .a2ui-row[data-alignment="end"] > section { align-items: end; }
2336
+ .a2ui-surface .a2ui-row[data-alignment="stretch"] > section { align-items: stretch; }
2337
+
2338
+ /* :host([distribution="..."]) section { justify-content: ...; } */
2339
+ .a2ui-surface .a2ui-row[data-distribution="start"] > section { justify-content: start; }
2340
+ .a2ui-surface .a2ui-row[data-distribution="center"] > section { justify-content: center; }
2341
+ .a2ui-surface .a2ui-row[data-distribution="end"] > section { justify-content: end; }
2342
+ .a2ui-surface .a2ui-row[data-distribution="spaceBetween"] > section { justify-content: space-between; }
2343
+ .a2ui-surface .a2ui-row[data-distribution="spaceAround"] > section { justify-content: space-around; }
2344
+ .a2ui-surface .a2ui-row[data-distribution="spaceEvenly"] > section { justify-content: space-evenly; }
2345
+
2346
+ /* =========================================================================
2347
+ * List (from Lit list.ts static styles)
2348
+ * ========================================================================= */
2349
+
2350
+ /* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */
2351
+ .a2ui-surface .a2ui-list {
2352
+ display: block;
2353
+ flex: var(--weight);
2354
+ min-height: 0;
2355
+ overflow: auto;
2356
+ }
2357
+
2358
+ /* :host([direction="vertical"]) section { display: grid; } */
2359
+ .a2ui-surface .a2ui-list[data-direction="vertical"] > section {
2360
+ display: grid;
2361
+ }
2362
+
2363
+ /* :host([direction="horizontal"]) section { display: flex; max-width: 100%; overflow-x: scroll; ... } */
2364
+ .a2ui-surface .a2ui-list[data-direction="horizontal"] > section {
2365
+ display: flex;
2366
+ max-width: 100%;
2367
+ overflow-x: scroll;
2368
+ overflow-y: hidden;
2369
+ scrollbar-width: none;
2370
+ }
2371
+
2372
+ /* :host([direction="horizontal"]) section > ::slotted(*) { flex: 1 0 fit-content; ... } */
2373
+ .a2ui-surface .a2ui-list[data-direction="horizontal"] > section > * {
2374
+ flex: 1 0 fit-content;
2375
+ max-width: min(80%, 400px);
2376
+ }
2377
+
2378
+ /* =========================================================================
2379
+ * DateTimeInput (from Lit datetime-input.ts static styles)
2380
+ * ========================================================================= */
2381
+
2382
+ /* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */
2383
+ .a2ui-surface .a2ui-datetime-input {
2384
+ display: block;
2385
+ flex: var(--weight);
2386
+ min-height: 0;
2387
+ overflow: auto;
2388
+ }
2389
+
2390
+ /* input { display: block; border-radius: 8px; padding: 8px; border: 1px solid #ccc; width: 100%; } */
2391
+ /* Use :where() to match Lit's low specificity (0,0,0,1) so theme utility classes can override */
2392
+ :where(.a2ui-surface .a2ui-datetime-input) input {
2393
+ display: block;
2394
+ border-radius: 8px;
2395
+ padding: 8px;
2396
+ border: 1px solid #ccc;
2397
+ width: 100%;
2398
+ }
2399
+
2400
+ /* =========================================================================
2401
+ * Global box-sizing (matches Lit's * { box-sizing: border-box; } in components)
2402
+ * ========================================================================= */
2403
+
2404
+ .a2ui-surface *,
2405
+ .a2ui-surface *::before,
2406
+ .a2ui-surface *::after {
2407
+ box-sizing: border-box;
2408
+ }
2409
+ `;
2410
+ /**
2411
+ * Injects A2UI structural styles into the document head.
2412
+ * Includes utility classes (layout-*, typography-*, color-*, etc.) and React-specific overrides.
2413
+ * Call this once at application startup.
2414
+ *
2415
+ * NOTE: CSS variables (--n-*, --p-*, etc.) must be defined by the host application on :root,
2416
+ * just like in the Lit renderer. This allows full customization of the color palette.
2417
+ *
2418
+ * @example
2419
+ * ```tsx
2420
+ * import { injectStyles } from '@a2ui/react/styles';
2421
+ *
2422
+ * // In your app entry point:
2423
+ * injectStyles();
2424
+ * ```
2425
+ */
2426
+ function injectStyles() {
2427
+ if (typeof document === "undefined") return;
2428
+ const styleId = "a2ui-structural-styles";
2429
+ if (document.getElementById(styleId)) return;
2430
+ const styleElement = document.createElement("style");
2431
+ styleElement.id = styleId;
2432
+ styleElement.textContent = resetStyles + "\n" + structuralStyles + "\n" + componentSpecificStyles;
2433
+ document.head.appendChild(styleElement);
2434
+ }
2435
+
2436
+ //#endregion
2437
+ //#region src/A2UIMessageRenderer.tsx
2438
+ let initialized$1 = false;
2439
+ function ensureInitialized$1() {
2440
+ if (!initialized$1) {
2441
+ initializeDefaultCatalog();
2442
+ injectStyles();
2443
+ initialized$1 = true;
2444
+ }
2445
+ }
2446
+ function createA2UIMessageRenderer(options) {
2447
+ const { theme } = options;
2448
+ return {
2449
+ activityType: "a2ui-surface",
2450
+ content: zod.z.any(),
2451
+ render: ({ content, agent }) => {
2452
+ ensureInitialized$1();
2453
+ const [operations, setOperations] = (0, react.useState)([]);
2454
+ const lastSignatureRef = (0, react.useRef)(null);
2455
+ const { copilotkit } = (0, _copilotkit_react_core_v2.useCopilotKit)();
2456
+ (0, react.useEffect)(() => {
2457
+ if (!content || !Array.isArray(content.operations)) {
2458
+ lastSignatureRef.current = null;
2459
+ setOperations([]);
2460
+ return;
2461
+ }
2462
+ const incoming = content.operations;
2463
+ const signature = stringifyOperations(incoming);
2464
+ if (signature && signature === lastSignatureRef.current) return;
2465
+ lastSignatureRef.current = signature;
2466
+ setOperations(incoming);
2467
+ }, [content]);
2468
+ const groupedOperations = (0, react.useMemo)(() => {
2469
+ const groups = /* @__PURE__ */ new Map();
2470
+ for (const operation of operations) {
2471
+ var _getOperationSurfaceI;
2472
+ const surfaceId = (_getOperationSurfaceI = getOperationSurfaceId(operation)) !== null && _getOperationSurfaceI !== void 0 ? _getOperationSurfaceI : _a2ui_lit.v0_8.Data.A2uiMessageProcessor.DEFAULT_SURFACE_ID;
2473
+ if (!groups.has(surfaceId)) groups.set(surfaceId, []);
2474
+ groups.get(surfaceId).push(operation);
2475
+ }
2476
+ return groups;
2477
+ }, [operations]);
2478
+ if (!groupedOperations.size) return null;
2479
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2480
+ className: "flex min-h-0 flex-1 flex-col gap-6 overflow-auto py-6",
2481
+ children: Array.from(groupedOperations.entries()).map(([surfaceId, ops]) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ReactSurfaceHost, {
2482
+ surfaceId,
2483
+ operations: ops,
2484
+ theme,
2485
+ agent,
2486
+ copilotkit
2487
+ }, surfaceId))
2488
+ });
2489
+ }
2490
+ };
2491
+ }
2492
+ /**
2493
+ * Renders a single A2UI surface using the React renderer.
2494
+ * Wraps A2UIProvider + A2UIRenderer and bridges actions back to CopilotKit.
2495
+ */
2496
+ function ReactSurfaceHost({ surfaceId, operations, theme, agent, copilotkit }) {
2497
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2498
+ className: "flex w-full flex-none overflow-hidden rounded-lg bg-white/5 p-4",
2499
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(A2UIProvider, {
2500
+ onAction: (0, react.useCallback)(async (message) => {
2501
+ if (!agent) return;
2502
+ try {
2503
+ var _copilotkit$propertie;
2504
+ console.info("[A2UI] Action dispatched", message.userAction);
2505
+ copilotkit.setProperties({
2506
+ ...(_copilotkit$propertie = copilotkit.properties) !== null && _copilotkit$propertie !== void 0 ? _copilotkit$propertie : {},
2507
+ a2uiAction: message
2508
+ });
2509
+ await copilotkit.runAgent({ agent });
2510
+ } finally {
2511
+ if (copilotkit.properties) {
2512
+ const { a2uiAction, ...rest } = copilotkit.properties;
2513
+ copilotkit.setProperties(rest);
2514
+ }
2515
+ }
2516
+ }, [agent, copilotkit]),
2517
+ theme,
2518
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SurfaceMessageProcessor, {
2519
+ surfaceId,
2520
+ operations
2521
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(A2UIRenderer, {
2522
+ surfaceId,
2523
+ className: "flex flex-1"
2524
+ })]
2525
+ })
2526
+ });
2527
+ }
2528
+ /**
2529
+ * Processes A2UI operations into the provider's message processor.
2530
+ * Must be a child of A2UIProvider to access the actions context.
2531
+ */
2532
+ function SurfaceMessageProcessor({ surfaceId, operations }) {
2533
+ const { processMessages } = useA2UIActions();
2534
+ const lastProcessedRef = (0, react.useRef)("");
2535
+ (0, react.useEffect)(() => {
2536
+ const key = `${surfaceId}-${JSON.stringify(operations)}`;
2537
+ if (key === lastProcessedRef.current) return;
2538
+ lastProcessedRef.current = key;
2539
+ processMessages(operations);
2540
+ }, [
2541
+ processMessages,
2542
+ surfaceId,
2543
+ operations
2544
+ ]);
2545
+ return null;
2546
+ }
2547
+ function getOperationSurfaceId(operation) {
2548
+ var _ref, _ref2, _ref3, _operation$beginRende, _operation$beginRende2, _operation$surfaceUpd, _operation$dataModelU, _operation$deleteSurf;
2549
+ if (!operation || typeof operation !== "object") return null;
2550
+ if (typeof operation.surfaceId === "string") return operation.surfaceId;
2551
+ return (_ref = (_ref2 = (_ref3 = (_operation$beginRende = operation === null || operation === void 0 || (_operation$beginRende2 = operation.beginRendering) === null || _operation$beginRende2 === void 0 ? void 0 : _operation$beginRende2.surfaceId) !== null && _operation$beginRende !== void 0 ? _operation$beginRende : operation === null || operation === void 0 || (_operation$surfaceUpd = operation.surfaceUpdate) === null || _operation$surfaceUpd === void 0 ? void 0 : _operation$surfaceUpd.surfaceId) !== null && _ref3 !== void 0 ? _ref3 : operation === null || operation === void 0 || (_operation$dataModelU = operation.dataModelUpdate) === null || _operation$dataModelU === void 0 ? void 0 : _operation$dataModelU.surfaceId) !== null && _ref2 !== void 0 ? _ref2 : operation === null || operation === void 0 || (_operation$deleteSurf = operation.deleteSurface) === null || _operation$deleteSurf === void 0 ? void 0 : _operation$deleteSurf.surfaceId) !== null && _ref !== void 0 ? _ref : null;
2552
+ }
2553
+ function stringifyOperations(ops) {
2554
+ try {
2555
+ return JSON.stringify(ops);
2556
+ } catch (error) {
2557
+ return null;
2558
+ }
2559
+ }
2560
+
2561
+ //#endregion
2562
+ //#region src/theme/viewer-theme.ts
2563
+ /** Elements */
2564
+ const a = {
2565
+ "typography-f-sf": true,
2566
+ "typography-fs-n": true,
2567
+ "typography-w-500": true,
2568
+ "layout-as-n": true,
2569
+ "layout-dis-iflx": true,
2570
+ "layout-al-c": true
2571
+ };
2572
+ const audio = { "layout-w-100": true };
2573
+ const body = {
2574
+ "typography-f-s": true,
2575
+ "typography-fs-n": true,
2576
+ "typography-w-400": true,
2577
+ "layout-mt-0": true,
2578
+ "layout-mb-2": true,
2579
+ "typography-sz-bm": true,
2580
+ "color-c-n10": true
2581
+ };
2582
+ const button = {
2583
+ "typography-f-sf": true,
2584
+ "typography-fs-n": true,
2585
+ "typography-w-500": true,
2586
+ "layout-pt-3": true,
2587
+ "layout-pb-3": true,
2588
+ "layout-pl-5": true,
2589
+ "layout-pr-5": true,
2590
+ "layout-mb-1": true,
2591
+ "border-br-16": true,
2592
+ "border-bw-0": true,
2593
+ "border-c-n70": true,
2594
+ "border-bs-s": true,
2595
+ "color-bgc-s30": true,
2596
+ "color-c-n100": true,
2597
+ "behavior-ho-80": true
2598
+ };
2599
+ const heading = {
2600
+ "typography-f-sf": true,
2601
+ "typography-fs-n": true,
2602
+ "typography-w-500": true,
2603
+ "layout-mt-0": true,
2604
+ "layout-mb-2": true,
2605
+ "color-c-n10": true
2606
+ };
2607
+ const h1 = {
2608
+ ...heading,
2609
+ "typography-sz-tl": true
2610
+ };
2611
+ const h2 = {
2612
+ ...heading,
2613
+ "typography-sz-tm": true
2614
+ };
2615
+ const h3 = {
2616
+ ...heading,
2617
+ "typography-sz-ts": true
2618
+ };
2619
+ const iframe = { "behavior-sw-n": true };
2620
+ const input = {
2621
+ "typography-f-sf": true,
2622
+ "typography-fs-n": true,
2623
+ "typography-w-400": true,
2624
+ "layout-pl-4": true,
2625
+ "layout-pr-4": true,
2626
+ "layout-pt-2": true,
2627
+ "layout-pb-2": true,
2628
+ "border-br-6": true,
2629
+ "border-bw-1": true,
2630
+ "color-bc-s70": true,
2631
+ "border-bs-s": true,
2632
+ "layout-as-n": true,
2633
+ "color-c-n10": true
2634
+ };
2635
+ const p = {
2636
+ "typography-f-s": true,
2637
+ "typography-fs-n": true,
2638
+ "typography-w-400": true,
2639
+ "layout-m-0": true,
2640
+ "typography-sz-bm": true,
2641
+ "layout-as-n": true,
2642
+ "color-c-n10": true
2643
+ };
2644
+ const orderedList = {
2645
+ "typography-f-s": true,
2646
+ "typography-fs-n": true,
2647
+ "typography-w-400": true,
2648
+ "layout-m-0": true,
2649
+ "typography-sz-bm": true,
2650
+ "layout-as-n": true
2651
+ };
2652
+ const unorderedList = {
2653
+ "typography-f-s": true,
2654
+ "typography-fs-n": true,
2655
+ "typography-w-400": true,
2656
+ "layout-m-0": true,
2657
+ "typography-sz-bm": true,
2658
+ "layout-as-n": true
2659
+ };
2660
+ const listItem = {
2661
+ "typography-f-s": true,
2662
+ "typography-fs-n": true,
2663
+ "typography-w-400": true,
2664
+ "layout-m-0": true,
2665
+ "typography-sz-bm": true,
2666
+ "layout-as-n": true
2667
+ };
2668
+ const pre = {
2669
+ "typography-f-c": true,
2670
+ "typography-fs-n": true,
2671
+ "typography-w-400": true,
2672
+ "typography-sz-bm": true,
2673
+ "typography-ws-p": true,
2674
+ "layout-as-n": true
2675
+ };
2676
+ const textarea = {
2677
+ ...input,
2678
+ "layout-r-none": true,
2679
+ "layout-fs-c": true
2680
+ };
2681
+ const video = { "layout-el-cv": true };
2682
+ const aLight = _a2ui_lit.v0_8.Styles.merge(a, { "color-c-n5": true });
2683
+ const inputLight = _a2ui_lit.v0_8.Styles.merge(input, { "color-c-n5": true });
2684
+ const textareaLight = _a2ui_lit.v0_8.Styles.merge(textarea, { "color-c-n5": true });
2685
+ const buttonLight = _a2ui_lit.v0_8.Styles.merge(button, { "color-c-n100": true });
2686
+ const h1Light = _a2ui_lit.v0_8.Styles.merge(h1, { "color-c-n5": true });
2687
+ const h2Light = _a2ui_lit.v0_8.Styles.merge(h2, { "color-c-n5": true });
2688
+ const h3Light = _a2ui_lit.v0_8.Styles.merge(h3, { "color-c-n5": true });
2689
+ const bodyLight = _a2ui_lit.v0_8.Styles.merge(body, { "color-c-n5": true });
2690
+ const pLight = _a2ui_lit.v0_8.Styles.merge(p, { "color-c-n35": true });
2691
+ const preLight = _a2ui_lit.v0_8.Styles.merge(pre, { "color-c-n35": true });
2692
+ const orderedListLight = _a2ui_lit.v0_8.Styles.merge(orderedList, { "color-c-n35": true });
2693
+ const unorderedListLight = _a2ui_lit.v0_8.Styles.merge(unorderedList, { "color-c-n35": true });
2694
+ const listItemLight = _a2ui_lit.v0_8.Styles.merge(listItem, { "color-c-n35": true });
2695
+ const theme = {
2696
+ additionalStyles: {
2697
+ Button: { "--n-35": "var(--n-100)" },
2698
+ Card: { padding: "32px" }
2699
+ },
2700
+ components: {
2701
+ AudioPlayer: {},
2702
+ Button: {
2703
+ "layout-pt-2": true,
2704
+ "layout-pb-2": true,
2705
+ "layout-pl-3": true,
2706
+ "layout-pr-3": true,
2707
+ "border-br-12": true,
2708
+ "border-bw-0": true,
2709
+ "border-bs-s": true,
2710
+ "color-bgc-p30": true,
2711
+ "color-c-n100": true,
2712
+ "behavior-ho-70": true
2713
+ },
2714
+ Card: {
2715
+ "border-br-9": true,
2716
+ "color-bgc-p100": true
2717
+ },
2718
+ CheckBox: {
2719
+ element: {
2720
+ "layout-m-0": true,
2721
+ "layout-mr-2": true,
2722
+ "layout-p-2": true,
2723
+ "border-br-12": true,
2724
+ "border-bw-1": true,
2725
+ "border-bs-s": true,
2726
+ "color-bgc-p100": true,
2727
+ "color-bc-p60": true,
2728
+ "color-c-n30": true,
2729
+ "color-c-p30": true
2730
+ },
2731
+ label: {
2732
+ "color-c-p30": true,
2733
+ "typography-f-sf": true,
2734
+ "typography-v-r": true,
2735
+ "typography-w-400": true,
2736
+ "layout-flx-1": true,
2737
+ "typography-sz-ll": true
2738
+ },
2739
+ container: {
2740
+ "layout-dsp-iflex": true,
2741
+ "layout-al-c": true
2742
+ }
2743
+ },
2744
+ Column: { "layout-g-2": true },
2745
+ DateTimeInput: {
2746
+ container: {},
2747
+ label: {},
2748
+ element: {
2749
+ "layout-pt-2": true,
2750
+ "layout-pb-2": true,
2751
+ "layout-pl-3": true,
2752
+ "layout-pr-3": true,
2753
+ "border-br-12": true,
2754
+ "border-bw-1": true,
2755
+ "border-bs-s": true,
2756
+ "color-bgc-p100": true,
2757
+ "color-bc-p60": true,
2758
+ "color-c-n30": true,
2759
+ "color-c-p30": true
2760
+ }
2761
+ },
2762
+ Divider: {},
2763
+ Image: {
2764
+ all: {
2765
+ "border-br-5": true,
2766
+ "layout-el-cv": true,
2767
+ "layout-w-100": true,
2768
+ "layout-h-100": true
2769
+ },
2770
+ avatar: { "is-avatar": true },
2771
+ header: {},
2772
+ icon: {},
2773
+ largeFeature: {},
2774
+ mediumFeature: {},
2775
+ smallFeature: {}
2776
+ },
2777
+ Icon: {},
2778
+ List: {
2779
+ "layout-g-4": true,
2780
+ "layout-p-2": true
2781
+ },
2782
+ Modal: {
2783
+ backdrop: { "color-bbgc-p60_20": true },
2784
+ element: {
2785
+ "border-br-2": true,
2786
+ "color-bgc-p100": true,
2787
+ "layout-p-4": true,
2788
+ "border-bw-1": true,
2789
+ "border-bs-s": true,
2790
+ "color-bc-p80": true
2791
+ }
2792
+ },
2793
+ MultipleChoice: {
2794
+ container: {},
2795
+ label: {},
2796
+ element: {}
2797
+ },
2798
+ Row: { "layout-g-4": true },
2799
+ Slider: {
2800
+ container: {},
2801
+ label: {},
2802
+ element: {}
2803
+ },
2804
+ Tabs: {
2805
+ container: {},
2806
+ controls: {
2807
+ all: {},
2808
+ selected: {}
2809
+ },
2810
+ element: {}
2811
+ },
2812
+ Text: {
2813
+ all: {
2814
+ "layout-w-100": true,
2815
+ "layout-g-2": true
2816
+ },
2817
+ h1: {
2818
+ "typography-f-sf": true,
2819
+ "typography-v-r": true,
2820
+ "typography-w-400": true,
2821
+ "layout-m-0": true,
2822
+ "layout-p-0": true,
2823
+ "typography-sz-tl": true
2824
+ },
2825
+ h2: {
2826
+ "typography-f-sf": true,
2827
+ "typography-v-r": true,
2828
+ "typography-w-400": true,
2829
+ "layout-m-0": true,
2830
+ "layout-p-0": true,
2831
+ "typography-sz-tm": true
2832
+ },
2833
+ h3: {
2834
+ "typography-f-sf": true,
2835
+ "typography-v-r": true,
2836
+ "typography-w-400": true,
2837
+ "layout-m-0": true,
2838
+ "layout-p-0": true,
2839
+ "typography-sz-ts": true
2840
+ },
2841
+ h4: {
2842
+ "typography-f-sf": true,
2843
+ "typography-v-r": true,
2844
+ "typography-w-400": true,
2845
+ "layout-m-0": true,
2846
+ "layout-p-0": true,
2847
+ "typography-sz-bl": true
2848
+ },
2849
+ h5: {
2850
+ "typography-f-sf": true,
2851
+ "typography-v-r": true,
2852
+ "typography-w-400": true,
2853
+ "layout-m-0": true,
2854
+ "layout-p-0": true,
2855
+ "typography-sz-bm": true
2856
+ },
2857
+ body: {},
2858
+ caption: {}
2859
+ },
2860
+ TextField: {
2861
+ container: {
2862
+ "typography-sz-bm": true,
2863
+ "layout-w-100": true,
2864
+ "layout-g-2": true,
2865
+ "layout-dsp-flexhor": true,
2866
+ "layout-al-c": true
2867
+ },
2868
+ label: { "layout-flx-0": true },
2869
+ element: {
2870
+ "typography-sz-bm": true,
2871
+ "layout-pt-2": true,
2872
+ "layout-pb-2": true,
2873
+ "layout-pl-3": true,
2874
+ "layout-pr-3": true,
2875
+ "border-br-12": true,
2876
+ "border-bw-1": true,
2877
+ "border-bs-s": true,
2878
+ "color-bgc-p100": true,
2879
+ "color-bc-p60": true,
2880
+ "color-c-n30": true,
2881
+ "color-c-p30": true
2882
+ }
2883
+ },
2884
+ Video: {
2885
+ "border-br-5": true,
2886
+ "layout-el-cv": true
2887
+ }
2888
+ },
2889
+ elements: {
2890
+ a: aLight,
2891
+ audio,
2892
+ body: bodyLight,
2893
+ button: buttonLight,
2894
+ h1: h1Light,
2895
+ h2: h2Light,
2896
+ h3: h3Light,
2897
+ h4: {},
2898
+ h5: {},
2899
+ iframe,
2900
+ input: inputLight,
2901
+ p: pLight,
2902
+ pre: preLight,
2903
+ textarea: textareaLight,
2904
+ video
2905
+ },
2906
+ markdown: {
2907
+ p: [...Object.keys(pLight)],
2908
+ h1: [...Object.keys(h1Light)],
2909
+ h2: [...Object.keys(h2Light)],
2910
+ h3: [...Object.keys(h3Light)],
2911
+ h4: [],
2912
+ h5: [],
2913
+ ul: [...Object.keys(unorderedListLight)],
2914
+ ol: [...Object.keys(orderedListLight)],
2915
+ li: [...Object.keys(listItemLight)],
2916
+ a: [...Object.keys(aLight)],
2917
+ strong: [],
2918
+ em: []
2919
+ }
2920
+ };
2921
+
2922
+ //#endregion
2923
+ //#region src/A2UIViewer.tsx
2924
+ let initialized = false;
2925
+ function ensureInitialized() {
2926
+ if (!initialized) {
2927
+ initializeDefaultCatalog();
2928
+ injectStyles();
2929
+ initialized = true;
2930
+ }
2931
+ }
2932
+ /**
2933
+ * A2UIViewer renders an A2UI component tree from a JSON definition and data.
2934
+ * It re-renders cleanly when props change, discarding previous state.
2935
+ */
2936
+ function A2UIViewer({ root, components, data, onAction, styles, className }) {
2937
+ ensureInitialized();
2938
+ const baseId = (0, react.useId)();
2939
+ const surfaceId = (0, react.useMemo)(() => {
2940
+ const definitionKey = `${root}-${JSON.stringify(components)}`;
2941
+ let hash = 0;
2942
+ for (let i = 0; i < definitionKey.length; i++) {
2943
+ const char = definitionKey.charCodeAt(i);
2944
+ hash = (hash << 5) - hash + char;
2945
+ hash = hash & hash;
2946
+ }
2947
+ return `surface${baseId.replace(/:/g, "-")}${hash}`;
2948
+ }, [
2949
+ baseId,
2950
+ root,
2951
+ components
2952
+ ]);
2953
+ const handleAction = (0, react.useMemo)(() => {
2954
+ if (!onAction) return void 0;
2955
+ return (message) => {
2956
+ const userAction = message.userAction;
2957
+ if (userAction) {
2958
+ var _userAction$context;
2959
+ onAction({
2960
+ actionName: userAction.name,
2961
+ sourceComponentId: userAction.sourceComponentId,
2962
+ timestamp: userAction.timestamp,
2963
+ context: (_userAction$context = userAction.context) !== null && _userAction$context !== void 0 ? _userAction$context : {}
2964
+ });
2965
+ }
2966
+ };
2967
+ }, [onAction]);
2968
+ if (!components || components.length === 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2969
+ className,
2970
+ style: {
2971
+ padding: 16,
2972
+ color: "#666",
2973
+ fontFamily: "system-ui"
2974
+ },
2975
+ children: "No content to display"
2976
+ });
2977
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(A2UIProvider, {
2978
+ onAction: handleAction,
2979
+ theme,
2980
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(A2UIViewerInner, {
2981
+ surfaceId,
2982
+ root,
2983
+ components,
2984
+ data: data !== null && data !== void 0 ? data : {},
2985
+ styles,
2986
+ className
2987
+ })
2988
+ });
2989
+ }
2990
+ /**
2991
+ * Inner component that processes messages within the provider context.
2992
+ */
2993
+ function A2UIViewerInner({ surfaceId, root, components, data, styles, className }) {
2994
+ const { processMessages } = useA2UIActions();
2995
+ const lastProcessedRef = (0, react.useRef)("");
2996
+ (0, react.useEffect)(() => {
2997
+ const key = `${surfaceId}-${JSON.stringify(components)}-${JSON.stringify(data)}`;
2998
+ if (key === lastProcessedRef.current) return;
2999
+ lastProcessedRef.current = key;
3000
+ const messages = [{ beginRendering: {
3001
+ surfaceId,
3002
+ root,
3003
+ styles: styles !== null && styles !== void 0 ? styles : {}
3004
+ } }, { surfaceUpdate: {
3005
+ surfaceId,
3006
+ components
3007
+ } }];
3008
+ if (data && Object.keys(data).length > 0) {
3009
+ const contents = objectToValueMaps(data);
3010
+ if (contents.length > 0) messages.push({ dataModelUpdate: {
3011
+ surfaceId,
3012
+ path: "/",
3013
+ contents
3014
+ } });
3015
+ }
3016
+ processMessages(messages);
3017
+ }, [
3018
+ processMessages,
3019
+ surfaceId,
3020
+ root,
3021
+ components,
3022
+ data,
3023
+ styles
3024
+ ]);
3025
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3026
+ className,
3027
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(A2UIRenderer, { surfaceId })
3028
+ });
3029
+ }
3030
+ /**
3031
+ * Converts a nested JavaScript object to the ValueMap[] format
3032
+ * expected by A2UI's dataModelUpdate message.
3033
+ */
3034
+ function objectToValueMaps(obj) {
3035
+ return Object.entries(obj).map(([key, value]) => valueToValueMap(key, value));
3036
+ }
3037
+ /**
3038
+ * Converts a single key-value pair to a ValueMap.
3039
+ */
3040
+ function valueToValueMap(key, value) {
3041
+ if (typeof value === "string") return {
3042
+ key,
3043
+ valueString: value
3044
+ };
3045
+ if (typeof value === "number") return {
3046
+ key,
3047
+ valueNumber: value
3048
+ };
3049
+ if (typeof value === "boolean") return {
3050
+ key,
3051
+ valueBoolean: value
3052
+ };
3053
+ if (value === null || value === void 0) return { key };
3054
+ if (Array.isArray(value)) return {
3055
+ key,
3056
+ valueMap: value.map((item, index) => valueToValueMap(String(index), item))
3057
+ };
3058
+ if (typeof value === "object") return {
3059
+ key,
3060
+ valueMap: objectToValueMaps(value)
3061
+ };
3062
+ return { key };
3063
+ }
3064
+
3065
+ //#endregion
3066
+ exports.A2UIViewer = A2UIViewer;
3067
+ exports.createA2UIMessageRenderer = createA2UIMessageRenderer;
3068
+ exports.viewerTheme = theme;
3069
+ });
3070
+ //# sourceMappingURL=index.umd.js.map