@luzmo/analytics-components-kit 1.0.9-beta.1 → 1.0.9-beta.11

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 (1112) hide show
  1. package/README.md +7 -1
  2. package/components/add-to-dashboard/add-to-dashboard.d.ts +134 -0
  3. package/components/add-to-dashboard/dashboard-actions.d.ts +14 -0
  4. package/components/add-to-dashboard/helpers/add-to-dashboard-helpers.d.ts +3 -0
  5. package/components/add-to-dashboard/index.cjs +20 -0
  6. package/components/add-to-dashboard/index.d.ts +11 -0
  7. package/components/add-to-dashboard/index.js +21 -0
  8. package/components/add-to-dashboard/types.d.ts +7 -0
  9. package/components/add-to-dashboard-BY70QBzE.js +805 -0
  10. package/components/add-to-dashboard-nYUaDghN.cjs +166 -0
  11. package/components/ai-chat/ai-chat-request.d.ts +1 -1
  12. package/components/ai-chat/ai-chat.d.ts +12 -4
  13. package/components/ai-chat/empty-state/ai-chat-empty-state.d.ts +9 -2
  14. package/components/ai-chat/helpers/elicitation-template.d.ts +3 -1
  15. package/components/ai-chat/index.cjs +1 -1
  16. package/components/ai-chat/index.d.ts +2 -2
  17. package/components/ai-chat/index.js +2 -9
  18. package/components/ai-chat-DfuJOWao.cjs +338 -0
  19. package/components/ai-chat-DmDtBF47.js +4325 -0
  20. package/components/ai-interaction-textarea/ai-interaction-textarea.d.ts +8 -1
  21. package/components/ai-interaction-textarea/index.cjs +1 -1
  22. package/components/ai-interaction-textarea/index.js +1 -8
  23. package/components/ai-interaction-textarea-6ECwAdeT.js +823 -0
  24. package/components/ai-interaction-textarea-CRyyTj_B.cjs +101 -0
  25. package/components/area-chart-positioning.config-CoCdjr2E.cjs +20 -0
  26. package/components/area-chart-positioning.config-o-uJPEr5.js +55 -0
  27. package/components/bar-chart-positioning.config-CZgrS6lc.js +59 -0
  28. package/components/bar-chart-positioning.config-fsB82756.cjs +20 -0
  29. package/components/base-BmvsQ-s1.cjs +20 -0
  30. package/components/base-CrpOMVeU.js +248 -0
  31. package/components/base-store-CkIsrRcu.cjs +20 -0
  32. package/components/base-store-gYqg__8A.js +151 -0
  33. package/components/box-plot-positioning.config-BMfGGDfe.cjs +20 -0
  34. package/components/box-plot-positioning.config-CDq460FI.js +48 -0
  35. package/components/bubble-chart-positioning.config-C9MmTtTX.cjs +20 -0
  36. package/components/bubble-chart-positioning.config-DWfz4tud.js +55 -0
  37. package/components/bullet-chart-positioning.config-BwHPM5ui.cjs +20 -0
  38. package/components/bullet-chart-positioning.config-DmSlVIjL.js +56 -0
  39. package/components/chart-helpers-DQS2iqSd.js +250 -0
  40. package/components/chart-helpers-ufZ6VbXs.cjs +20 -0
  41. package/components/choropleth-map-options.config-CP-IK-4W.js +352 -0
  42. package/components/choropleth-map-options.config-DSXndhIY.cjs +20 -0
  43. package/components/choropleth-map-positioning.config-C0m6zzD3.cjs +20 -0
  44. package/components/choropleth-map-positioning.config-cjBzi_Db.js +55 -0
  45. package/components/circle-pack-chart-positioning.config-BAFFQSHe.cjs +20 -0
  46. package/components/circle-pack-chart-positioning.config-CY2rLb57.js +48 -0
  47. package/components/circular-gauge-positioning.config-6pZUNxYa.js +48 -0
  48. package/components/circular-gauge-positioning.config-BfWAjAY2.cjs +20 -0
  49. package/components/color-B7SELPGq.js +3812 -0
  50. package/components/color-BIEQvHs4.cjs +20 -0
  51. package/components/color-range-utils-6oEqHV0y.js +63 -0
  52. package/components/color-range-utils-Bgzuy2bR.cjs +20 -0
  53. package/components/column-chart-positioning.config-hrAvNd7T.js +55 -0
  54. package/components/column-chart-positioning.config-xgRuA_l5.cjs +20 -0
  55. package/components/combination-chart-positioning.config-BI8HroaG.js +48 -0
  56. package/components/combination-chart-positioning.config-D0TU4hge.cjs +20 -0
  57. package/components/conditional-number-positioning.config-B_yISWne.cjs +20 -0
  58. package/components/conditional-number-positioning.config-CWaDhMLA.js +48 -0
  59. package/components/data-broker-Cb-Fq9xy.cjs +20 -0
  60. package/components/data-broker-DNfq_8Lg.js +1695 -0
  61. package/components/data-field/index.cjs +1 -1
  62. package/components/data-field/index.js +1 -8
  63. package/components/data-field-D4YFqg1H.js +119 -0
  64. package/components/data-field-Hi-ITTzx.cjs +54 -0
  65. package/components/data-field-level/index.cjs +1 -1
  66. package/components/data-field-level/index.js +1 -8
  67. package/components/data-field-level-BWQPtFP5.cjs +55 -0
  68. package/components/data-field-level-CB5GtdU5.js +245 -0
  69. package/components/data-field-panel/index.cjs +1 -1
  70. package/components/data-field-panel/index.js +1 -8
  71. package/components/data-field-panel-64HoViNT.js +383 -0
  72. package/components/data-field-panel-DzKwmQi_.cjs +87 -0
  73. package/components/data-fields-select/data-fields-select.d.ts +1 -1
  74. package/components/data-fields-select/index.cjs +1 -1
  75. package/components/data-fields-select/index.js +1 -8
  76. package/components/data-fields-select-BOwoWq0j.js +290 -0
  77. package/components/data-fields-select-DXv6PQHG.cjs +43 -0
  78. package/components/dataset-icon/dataset-icon.d.ts +5 -4
  79. package/components/dataset-icon/index.cjs +1 -1
  80. package/components/dataset-icon/index.js +1 -8
  81. package/components/dataset-icon-Bag_eDv8.js +115 -0
  82. package/components/dataset-icon-CWKBYjGJ.cjs +62 -0
  83. package/components/dataset-selector-list/index.cjs +1 -1
  84. package/components/dataset-selector-list/index.js +1 -8
  85. package/components/dataset-selector-list-DFC2bvn0.js +321 -0
  86. package/components/dataset-selector-list-_AL1-GWw.cjs +75 -0
  87. package/components/dataset-selector-row/dataset-selector-row.d.ts +10 -1
  88. package/components/dataset-selector-row/index.cjs +1 -1
  89. package/components/dataset-selector-row/index.js +1 -8
  90. package/components/dataset-selector-row-By2ko-Rd.cjs +104 -0
  91. package/components/dataset-selector-row-DC6mrVyF.js +448 -0
  92. package/components/de-CjQMTFtl.cjs +20 -0
  93. package/components/de-Yl3kqB03.js +594 -0
  94. package/components/defineProperty-AldSMFEH.js +58 -0
  95. package/components/defineProperty-X1c4tIPD.cjs +20 -0
  96. package/components/display-settings/display-settings.d.ts +2 -2
  97. package/components/display-settings/index.cjs +1 -1
  98. package/components/display-settings/index.js +1 -8
  99. package/components/display-settings-B2V_F_CU.cjs +142 -0
  100. package/components/display-settings-BsCKV9ae.js +316 -0
  101. package/components/display-settings-binning/index.cjs +1 -1
  102. package/components/display-settings-binning/index.js +1 -8
  103. package/components/display-settings-binning-BdtxayZT.cjs +56 -0
  104. package/components/display-settings-binning-CkrbhPVB.js +111 -0
  105. package/components/display-settings-datetime/index.cjs +1 -1
  106. package/components/display-settings-datetime/index.js +1 -8
  107. package/components/display-settings-datetime-CpFyrcGk.cjs +217 -0
  108. package/components/display-settings-datetime-mVh5Tjrx.js +414 -0
  109. package/components/display-settings-grand-totals/index.cjs +1 -1
  110. package/components/display-settings-grand-totals/index.js +1 -8
  111. package/components/display-settings-grand-totals-CwOGoE06.cjs +44 -0
  112. package/components/display-settings-grand-totals-D7unOEKl.js +90 -0
  113. package/components/display-settings-numeric/index.cjs +1 -1
  114. package/components/display-settings-numeric/index.js +1 -8
  115. package/components/display-settings-numeric-DDZyFNFF.js +480 -0
  116. package/components/display-settings-numeric-DhiXPU3f.cjs +190 -0
  117. package/components/display-settings-period-over-period/display-settings-period-over-period.d.ts +2 -2
  118. package/components/display-settings-period-over-period/index.cjs +1 -1
  119. package/components/display-settings-period-over-period/index.js +1 -8
  120. package/components/display-settings-period-over-period-BNFjbgP0.cjs +227 -0
  121. package/components/display-settings-period-over-period-Hd172SzT.js +443 -0
  122. package/components/donut-chart-positioning.config-B2CrxOig.js +48 -0
  123. package/components/donut-chart-positioning.config-DQb53kWI.cjs +20 -0
  124. package/components/es-Ctf1SIsp.js +594 -0
  125. package/components/es-DmmTP7D0.cjs +20 -0
  126. package/components/evolution-number-positioning.config-BdH8pv6_.js +48 -0
  127. package/components/evolution-number-positioning.config-BzBsGcD4.cjs +20 -0
  128. package/components/filter-expression-picker/index.cjs +1 -1
  129. package/components/filter-expression-picker/index.js +1 -8
  130. package/components/filter-expression-picker-Bn_jAdQX.cjs +40 -0
  131. package/components/filter-expression-picker-Cjr8xWxy.js +434 -0
  132. package/components/filter-item/filter-item.d.ts +1 -1
  133. package/components/filter-item/index.cjs +1 -1
  134. package/components/filter-item/index.js +1 -8
  135. package/components/filter-item-CHJDVOju.cjs +111 -0
  136. package/components/filter-item-D6y8eCmG.js +793 -0
  137. package/components/filter-parameter-picker/index.cjs +1 -1
  138. package/components/filter-parameter-picker/index.js +1 -8
  139. package/components/filter-parameter-picker-C955tF0T.js +372 -0
  140. package/components/filter-parameter-picker-jyrh3POQ.cjs +124 -0
  141. package/components/filter-value-picker/index.cjs +1 -1
  142. package/components/filter-value-picker/index.js +1 -8
  143. package/components/filter-value-picker-B8nA8hTV.js +170 -0
  144. package/components/filter-value-picker-DmWiNLZH.cjs +69 -0
  145. package/components/filter-value-picker-datetime/index.cjs +1 -1
  146. package/components/filter-value-picker-datetime/index.js +1 -8
  147. package/components/filter-value-picker-datetime-BAhXn1BS.js +160 -0
  148. package/components/filter-value-picker-datetime-U4XWKSFx.cjs +51 -0
  149. package/components/filter-value-picker-hierarchy/index.cjs +1 -1
  150. package/components/filter-value-picker-hierarchy/index.js +1 -8
  151. package/components/filter-value-picker-hierarchy-1ya1_rS3.cjs +54 -0
  152. package/components/filter-value-picker-hierarchy-CUPz5Ggs.js +316 -0
  153. package/components/filter-value-picker-numeric/index.cjs +1 -1
  154. package/components/filter-value-picker-numeric/index.js +1 -8
  155. package/components/filter-value-picker-numeric-D8mLaxzj.js +237 -0
  156. package/components/filter-value-picker-numeric-DrHdHj31.cjs +54 -0
  157. package/components/filters/index.cjs +1 -1
  158. package/components/filters/index.js +1 -8
  159. package/components/filters-Byy8HE19.js +927 -0
  160. package/components/filters-C8xz8DV-.cjs +199 -0
  161. package/components/formula/formula.d.ts +2 -2
  162. package/components/formula/index.cjs +1 -1
  163. package/components/formula/index.js +1 -8
  164. package/components/formula-C6dPJyKm.cjs +45 -0
  165. package/components/formula-D_ipR6d1.js +136 -0
  166. package/components/formula-codemirror/formula-codemirror.d.ts +2 -2
  167. package/components/formula-codemirror/pills/formula-aggregation/formula-aggregation.d.ts +2 -2
  168. package/components/formula-codemirror/pills/formula-empty-argument-pill/formula-empty-argument-pill.d.ts +2 -2
  169. package/components/formula-codemirror/pills/formula-include-exclude-panel.d.ts +1 -1
  170. package/components/formula-codemirror-C1UFMf6i.cjs +215 -0
  171. package/components/formula-codemirror-CdlIly66.js +12008 -0
  172. package/components/formula-display-store-B0ifmvCi.cjs +20 -0
  173. package/components/formula-display-store-CfObcBCd.js +1087 -0
  174. package/components/formula-editor/formula-aggregations-list.d.ts +2 -2
  175. package/components/formula-editor/formula-datasets-list.d.ts +2 -2
  176. package/components/formula-editor/formula-description.d.ts +1 -1
  177. package/components/formula-editor/formula-editor.d.ts +1 -1
  178. package/components/formula-editor/formula-functions-list.d.ts +2 -2
  179. package/components/formula-editor/index.cjs +1 -1
  180. package/components/formula-editor/index.d.ts +3 -3
  181. package/components/formula-editor/index.js +3 -10
  182. package/components/formula-editor-B9ikCsLK.cjs +224 -0
  183. package/components/formula-editor-DJ-0AVCl.js +685 -0
  184. package/components/formula-field/formula-field.d.ts +1 -1
  185. package/components/formula-field/index.cjs +1 -1
  186. package/components/formula-field/index.js +1 -8
  187. package/components/formula-field-Bq-RYt0H.js +38 -0
  188. package/components/formula-field-CNqn6Xbh.cjs +20 -0
  189. package/components/formula-input-base-Dple-9bo.js +236 -0
  190. package/components/formula-input-base-KSmmN1uI.cjs +49 -0
  191. package/components/fr-DKDPLLAZ.cjs +20 -0
  192. package/components/fr-zWhjQv4B.js +594 -0
  193. package/components/funnel-chart-positioning.config-DgRle8n1.js +48 -0
  194. package/components/funnel-chart-positioning.config-DleNZIG-.cjs +20 -0
  195. package/components/get-dataset-name-3UfKdy0m.cjs +20 -0
  196. package/components/get-dataset-name-trrlomzY.js +32 -0
  197. package/components/grid-core-BFNgmaGk.js +4490 -0
  198. package/components/grid-core-DY0vyroD.cjs +68 -0
  199. package/components/grid-core.cjs +20 -0
  200. package/components/grid-core.js +21 -0
  201. package/components/groupings-B55Oba6e.js +52 -0
  202. package/components/groupings-DEpTt8DV.cjs +20 -0
  203. package/components/heat-map-options.config-D58595hz.js +226 -0
  204. package/components/heat-map-options.config-DhQrM9S9.cjs +20 -0
  205. package/components/heat-map-positioning.config-BTabq_f9.js +48 -0
  206. package/components/heat-map-positioning.config-DCB3Eagz.cjs +20 -0
  207. package/components/heat-table-options.config-AhmEjDAb.cjs +20 -0
  208. package/components/heat-table-options.config-x-KBTZo1.js +269 -0
  209. package/components/heat-table-positioning.config-Dnu133l4.cjs +20 -0
  210. package/components/heat-table-positioning.config-pK8Wn1dw.js +55 -0
  211. package/components/hexbin-map-positioning.config-DjYp-lX8.js +48 -0
  212. package/components/hexbin-map-positioning.config-IqRt8f29.cjs +20 -0
  213. package/components/index.cjs +1 -1
  214. package/components/index.js +69 -73
  215. package/components/interactive-viz-item/index.cjs +1 -1
  216. package/components/interactive-viz-item/index.d.ts +2 -0
  217. package/components/interactive-viz-item/index.js +3 -9
  218. package/components/interactive-viz-item/interactive-viz-item.d.ts +21 -4
  219. package/components/interactive-viz-item/load-add-to-dashboard.d.ts +1 -0
  220. package/components/interactive-viz-item-CM-LoEa5.cjs +261 -0
  221. package/components/interactive-viz-item-D6lWVMHb.js +528 -0
  222. package/components/item-grid/actions.d.ts +2 -1
  223. package/components/item-grid/helpers/grid-chart-rendering.d.ts +12 -0
  224. package/components/item-grid/helpers/grid-events.d.ts +1 -56
  225. package/components/item-grid/helpers/grid-interactions.d.ts +1 -88
  226. package/components/item-grid/helpers/grid-item-management.d.ts +5 -26
  227. package/components/item-grid/helpers/grid-item-popover.d.ts +1 -21
  228. package/components/item-grid/helpers/grid-items.d.ts +1 -9
  229. package/components/item-grid/helpers/grid-keyboard-updates.d.ts +1 -18
  230. package/components/item-grid/helpers/grid-keydown-event.d.ts +1 -18
  231. package/components/item-grid/helpers/grid-popover-cleanup.d.ts +1 -4
  232. package/components/item-grid/helpers/grid-rendering.d.ts +0 -50
  233. package/components/item-grid/helpers/grid-stack-lifecycle.d.ts +1 -26
  234. package/components/item-grid/helpers/grid-theme.d.ts +2 -14
  235. package/components/item-grid/helpers/grid-update-cycle.d.ts +1 -22
  236. package/components/item-grid/index.cjs +1 -1
  237. package/components/item-grid/index.d.ts +3 -3
  238. package/components/item-grid/index.js +3 -9
  239. package/components/item-grid/item-grid.d.ts +12 -207
  240. package/components/item-grid/types.d.ts +1 -57
  241. package/components/item-grid-CbXKsQm4.js +245 -0
  242. package/components/item-grid-DTishUCb.cjs +41 -0
  243. package/components/item-grid-item-actions-menu/index.cjs +20 -0
  244. package/components/item-grid-item-actions-menu/index.d.ts +8 -0
  245. package/components/item-grid-item-actions-menu/index.js +21 -0
  246. package/components/item-grid-item-actions-menu/item-grid-item-actions-menu.d.ts +70 -0
  247. package/components/item-grid-item-actions-menu/types.d.ts +11 -0
  248. package/components/item-grid-item-actions-menu-B7ylgTwO.js +199 -0
  249. package/components/item-grid-item-actions-menu-C3BUxZJc.cjs +52 -0
  250. package/components/item-option/index.cjs +1 -1
  251. package/components/item-option/index.js +1 -8
  252. package/components/item-option-BTSV33ft.cjs +269 -0
  253. package/components/item-option-BUju6ZE1.js +953 -0
  254. package/components/item-option-action-button-group/index.cjs +1 -1
  255. package/components/item-option-action-button-group/index.js +1 -8
  256. package/components/item-option-action-button-group-CuDeyDRi.cjs +53 -0
  257. package/components/item-option-action-button-group-DnTBh3R4.js +117 -0
  258. package/components/item-option-base-BIDIiNfI.js +120 -0
  259. package/components/item-option-base-C6RQH9M8.cjs +56 -0
  260. package/components/item-option-color-palette-picker/index.cjs +1 -1
  261. package/components/item-option-color-palette-picker/index.js +1 -8
  262. package/components/item-option-color-palette-picker-DbsqP2zA.js +2040 -0
  263. package/components/item-option-color-palette-picker-DsG-wxGB.cjs +40 -0
  264. package/components/item-option-color-picker/index.cjs +1 -1
  265. package/components/item-option-color-picker/index.js +1 -8
  266. package/components/item-option-color-picker-BUN5YK-t.cjs +34 -0
  267. package/components/item-option-color-picker-CKGUj3cW.js +86 -0
  268. package/components/item-option-color-range/index.cjs +1 -1
  269. package/components/item-option-color-range/index.js +1 -8
  270. package/components/item-option-color-range-BN81ePAI.cjs +98 -0
  271. package/components/item-option-color-range-dMehrwqA.js +219 -0
  272. package/components/item-option-guidelines/index.cjs +1 -1
  273. package/components/item-option-guidelines/index.js +1 -8
  274. package/components/item-option-guidelines-Bn1HSCgL.js +420 -0
  275. package/components/item-option-guidelines-CmPaMdqb.cjs +135 -0
  276. package/components/item-option-multi-language-field/index.cjs +1 -1
  277. package/components/item-option-multi-language-field/index.js +1 -8
  278. package/components/item-option-multi-language-field-BFgbOzMM.js +81 -0
  279. package/components/item-option-multi-language-field-Du609wC_.cjs +33 -0
  280. package/components/item-option-number-field/index.cjs +1 -1
  281. package/components/item-option-number-field/index.js +1 -8
  282. package/components/item-option-number-field-CDcf6_4D.js +101 -0
  283. package/components/item-option-number-field-CVAtj0UX.cjs +38 -0
  284. package/components/item-option-panel/index.cjs +1 -1
  285. package/components/item-option-panel/index.js +1 -8
  286. package/components/item-option-panel-0iHLl9-q.cjs +67 -0
  287. package/components/item-option-panel-DUlIB6qj.js +181 -0
  288. package/components/item-option-picker/index.cjs +1 -1
  289. package/components/item-option-picker/index.js +1 -8
  290. package/components/item-option-picker-ClKAGpgs.js +76 -0
  291. package/components/item-option-picker-Dkc3nd3x.cjs +37 -0
  292. package/components/item-option-position-picker/index.cjs +1 -1
  293. package/components/item-option-position-picker/index.js +1 -8
  294. package/components/item-option-position-picker-O8PpyiRv.js +116 -0
  295. package/components/item-option-position-picker-qCKh0Mfs.cjs +32 -0
  296. package/components/item-option-positions-number-field/index.cjs +1 -1
  297. package/components/item-option-positions-number-field/index.js +1 -8
  298. package/components/item-option-positions-number-field-CBx4uQ39.js +165 -0
  299. package/components/item-option-positions-number-field-Dfe4ufnF.cjs +49 -0
  300. package/components/item-option-radio-button-group/index.cjs +1 -1
  301. package/components/item-option-radio-button-group/index.js +1 -8
  302. package/components/item-option-radio-button-group-B5OVbLRg.cjs +37 -0
  303. package/components/item-option-radio-button-group-J_ZusHOP.js +73 -0
  304. package/components/item-option-slider/index.cjs +1 -1
  305. package/components/item-option-slider/index.js +1 -8
  306. package/components/item-option-slider-BDAEs7Fk.cjs +33 -0
  307. package/components/item-option-slider-V9z4qqyE.js +97 -0
  308. package/components/item-option-switch/index.cjs +1 -1
  309. package/components/item-option-switch/index.js +1 -8
  310. package/components/item-option-switch-BA4ifIHK.js +68 -0
  311. package/components/item-option-switch-Bzy2VRLg.cjs +30 -0
  312. package/components/item-option-text-field/index.cjs +1 -1
  313. package/components/item-option-text-field/index.js +1 -8
  314. package/components/item-option-text-field-C-sTkUre.cjs +33 -0
  315. package/components/item-option-text-field-Cf0khC48.js +79 -0
  316. package/components/item-options-configs.cjs +1 -1
  317. package/components/item-options-configs.js +5 -5
  318. package/components/item-slot-drop/index.cjs +1 -1
  319. package/components/item-slot-drop/index.js +1 -8
  320. package/components/item-slot-drop-D2VDgqYS.js +329 -0
  321. package/components/item-slot-drop-DrJRtG7b.cjs +91 -0
  322. package/components/item-slot-drop-panel/index.cjs +1 -1
  323. package/components/item-slot-drop-panel/index.js +1 -8
  324. package/components/item-slot-drop-panel-CCCOwtYM.js +353 -0
  325. package/components/item-slot-drop-panel-CFerKcdH.cjs +57 -0
  326. package/components/item-slot-picker/index.cjs +1 -1
  327. package/components/item-slot-picker/index.js +1 -8
  328. package/components/item-slot-picker-BdfYcBKT.js +503 -0
  329. package/components/item-slot-picker-aqePvZ9B.cjs +174 -0
  330. package/components/item-slot-picker-panel/index.cjs +1 -1
  331. package/components/item-slot-picker-panel/index.js +1 -8
  332. package/components/item-slot-picker-panel-DC3i7XZP.js +446 -0
  333. package/components/item-slot-picker-panel-dU6NywBo.cjs +81 -0
  334. package/components/line-chart-positioning.config-BW19v66B.js +55 -0
  335. package/components/line-chart-positioning.config-DX5mLAP7.cjs +20 -0
  336. package/components/load-data-fields-for-datasets-C4h8NWIE.cjs +20 -0
  337. package/components/load-data-fields-for-datasets-CInmiDlZ.js +42 -0
  338. package/components/localized-mixin-Bt25Frg1.cjs +20 -0
  339. package/components/localized-mixin-CYMFnS-n.js +45 -0
  340. package/components/marker-map-positioning.config-BJGwlWKz.js +48 -0
  341. package/components/marker-map-positioning.config-C0V5LZG-.cjs +20 -0
  342. package/components/nl-BrjaaktE.cjs +20 -0
  343. package/components/nl-TUFktGm6.js +594 -0
  344. package/components/ohlc-chart-positioning.config-Bu1_IBVK.cjs +20 -0
  345. package/components/ohlc-chart-positioning.config-CFvbZzCR.js +78 -0
  346. package/components/parallel-coordinates-plot-positioning.config-Bc3qCyxq.js +48 -0
  347. package/components/parallel-coordinates-plot-positioning.config-EJz1XA1k.cjs +20 -0
  348. package/components/pivot-table-positioning.config-Bay8gxV-.js +55 -0
  349. package/components/pivot-table-positioning.config-CMzGb-BR.cjs +20 -0
  350. package/components/pyramid-chart-positioning.config-BUSeYxYH.js +55 -0
  351. package/components/pyramid-chart-positioning.config-CrU2vKM-.cjs +20 -0
  352. package/components/radar-chart-positioning.config-BEzqTXyr.cjs +20 -0
  353. package/components/radar-chart-positioning.config-DOLpdn-d.js +55 -0
  354. package/components/route-map-options.config-BnufVGcz.js +328 -0
  355. package/components/route-map-options.config-DA3k24sP.cjs +20 -0
  356. package/components/route-map-positioning.config-BgjizdWh.cjs +20 -0
  357. package/components/route-map-positioning.config-Brg6_eCi.js +66 -0
  358. package/components/sankey-diagram-positioning.config-DJlWiNYL.js +66 -0
  359. package/components/sankey-diagram-positioning.config-vccTz1pG.cjs +20 -0
  360. package/components/scatter-plot-positioning.config-BKqPHMrS.js +77 -0
  361. package/components/scatter-plot-positioning.config-D7uFFBVZ.cjs +20 -0
  362. package/components/set-locale-Bgz1WNGE.cjs +20 -0
  363. package/components/set-locale-s-1X7Jce.js +43 -0
  364. package/components/slicer-filter-positioning.config-D1kR4xly.cjs +20 -0
  365. package/components/slicer-filter-positioning.config-Gl9jhO_G.js +48 -0
  366. package/components/slot-menu/index.cjs +1 -1
  367. package/components/slot-menu/index.js +1 -8
  368. package/components/slot-menu/types.d.ts +1 -1
  369. package/components/slot-menu-CAhxaK5-.cjs +71 -0
  370. package/components/slot-menu-Dw53Y-iu.js +429 -0
  371. package/components/slot-menu-list/index.cjs +1 -1
  372. package/components/slot-menu-list/index.js +1 -8
  373. package/components/slot-menu-list-5NsRo9XD.js +348 -0
  374. package/components/slot-menu-list-CUsmYkiV.cjs +44 -0
  375. package/components/speedometer-chart-positioning.config-VBLrLNmO.js +48 -0
  376. package/components/speedometer-chart-positioning.config-fa90zZdb.cjs +20 -0
  377. package/components/spike-map-options.config-34Vf0UbN.cjs +20 -0
  378. package/components/spike-map-options.config-CBpHkAfo.js +415 -0
  379. package/components/spike-map-positioning.config-DrxdeFsj.cjs +20 -0
  380. package/components/spike-map-positioning.config-oYjk3n9a.js +55 -0
  381. package/components/strip-plot-positioning.config-Bx_fqmEj.cjs +20 -0
  382. package/components/strip-plot-positioning.config-lMn33cM4.js +48 -0
  383. package/components/sunburst-chart-positioning.config-C-We-zZF.js +48 -0
  384. package/components/sunburst-chart-positioning.config-D-GRWmyF.cjs +20 -0
  385. package/components/superPropGet-CBezYwzm.js +52 -0
  386. package/components/superPropGet-DmmlTXgo.cjs +20 -0
  387. package/components/symbol-map-positioning.config-B0sLlLzK.cjs +20 -0
  388. package/components/symbol-map-positioning.config-_TJSfpVj.js +55 -0
  389. package/components/tokens-BWMfo_w4.cjs +20 -0
  390. package/components/tokens-Ov1pCR4Y.js +29 -0
  391. package/components/treemap-chart-positioning.config-CO05Gv7X.cjs +20 -0
  392. package/components/treemap-chart-positioning.config-DAdvoS2I.js +55 -0
  393. package/components/utils/base.cjs +1 -1
  394. package/components/utils/base.js +2 -2
  395. package/components/utils/store.cjs +1 -1
  396. package/components/utils/store.js +1 -1
  397. package/components/utils-CGJh0jrq.cjs +20 -0
  398. package/components/utils-Dk4dM9xv.js +240 -0
  399. package/components/utils.cjs +1 -1
  400. package/components/utils.js +3 -3
  401. package/components/venn-diagram-positioning.config-DKXWVaUI.cjs +20 -0
  402. package/components/venn-diagram-positioning.config-DUwmPQ1A.js +55 -0
  403. package/components/wordcloud-chart-positioning.config-CgbB_SI0.cjs +20 -0
  404. package/components/wordcloud-chart-positioning.config-qK5_CF7v.js +55 -0
  405. package/custom-elements.json +7065 -5792
  406. package/deprecated-react/components/add-to-dashboard.component.cjs +1 -0
  407. package/deprecated-react/components/item-grid-item-actions-menu.component.cjs +1 -0
  408. package/grid-core/helpers/grid-events.d.ts +56 -0
  409. package/grid-core/helpers/grid-interactions.d.ts +88 -0
  410. package/grid-core/helpers/grid-item-management.d.ts +28 -0
  411. package/grid-core/helpers/grid-item-popover.d.ts +21 -0
  412. package/grid-core/helpers/grid-items.d.ts +9 -0
  413. package/grid-core/helpers/grid-keyboard-updates.d.ts +18 -0
  414. package/grid-core/helpers/grid-keydown-event.d.ts +18 -0
  415. package/grid-core/helpers/grid-popover-cleanup.d.ts +4 -0
  416. package/grid-core/helpers/grid-rendering.d.ts +41 -0
  417. package/grid-core/helpers/grid-stack-lifecycle.d.ts +26 -0
  418. package/grid-core/helpers/grid-theme.d.ts +15 -0
  419. package/grid-core/helpers/grid-update-cycle.d.ts +22 -0
  420. package/grid-core/index.d.ts +5 -0
  421. package/grid-core/item-grid-base.d.ts +223 -0
  422. package/grid-core/types.d.ts +57 -0
  423. package/index.d.ts +2 -1
  424. package/package.json +20 -9
  425. package/react/components/add-to-dashboard.component.ts +30 -0
  426. package/react/components/ai-chat.component.ts +1 -1
  427. package/react/components/interactive-viz-item.component.ts +11 -5
  428. package/react/components/item-grid-item-actions-menu.component.ts +30 -0
  429. package/react/components/item-grid.component.ts +4 -1
  430. package/react/esm/components/add-to-dashboard.component.d.ts +14 -0
  431. package/react/esm/components/add-to-dashboard.component.js +19 -0
  432. package/react/esm/components/ai-chat.component.d.ts +1 -1
  433. package/react/esm/components/ai-chat.component.js +1 -1
  434. package/react/esm/components/interactive-viz-item.component.d.ts +8 -4
  435. package/react/esm/components/interactive-viz-item.component.js +8 -4
  436. package/react/esm/components/item-grid-item-actions-menu.component.d.ts +14 -0
  437. package/react/esm/components/item-grid-item-actions-menu.component.js +19 -0
  438. package/react/esm/components/item-grid.component.d.ts +3 -1
  439. package/react/esm/components/item-grid.component.js +2 -0
  440. package/react/esm/index.d.ts +4 -3
  441. package/react/esm/index.js +10 -6
  442. package/react/index.ts +10 -6
  443. package/react/luzmo-stub.d.ts +15 -6
  444. package/react/package.json +2 -2
  445. package/standalone/chunks/add-to-dashboard-BrWieRxp.js +148 -0
  446. package/standalone/chunks/area-chart-options.config-CXWPLl-0.js +2 -0
  447. package/standalone/chunks/area-chart-options.de-Dr8RVJtb.js +2 -0
  448. package/standalone/chunks/area-chart-options.en-DV1AZ274.js +2 -0
  449. package/standalone/chunks/area-chart-options.es-Cg7uU7OK.js +2 -0
  450. package/standalone/chunks/area-chart-options.fr-CJjgrAt2.js +2 -0
  451. package/standalone/chunks/area-chart-options.nl-CTGxVXNo.js +2 -0
  452. package/standalone/chunks/area-chart-slots.config-Bxvau_Ii.js +2 -0
  453. package/standalone/chunks/axis-options.config-DP9f04t6.js +2 -0
  454. package/standalone/chunks/axis-options.i18n-BwkGC9PX.js +2 -0
  455. package/standalone/chunks/bar-chart-options.config-w4REKu0t.js +2 -0
  456. package/standalone/chunks/bar-chart-options.de-DCVBVtFi.js +2 -0
  457. package/standalone/chunks/bar-chart-options.en-B4xiZxTy.js +2 -0
  458. package/standalone/chunks/bar-chart-options.es-UqehXB9Z.js +2 -0
  459. package/standalone/chunks/bar-chart-options.fr-CaUBeZBK.js +2 -0
  460. package/standalone/chunks/bar-chart-options.nl-C2tFvUE8.js +2 -0
  461. package/standalone/chunks/bar-chart-slots.config-BWQoKCYJ.js +2 -0
  462. package/standalone/chunks/base-CLcNr-fQ.js +2 -0
  463. package/standalone/chunks/bliss-BS5cbLqS.js +2 -0
  464. package/standalone/chunks/box-plot-options.config-BlYMd4FN.js +2 -0
  465. package/standalone/chunks/box-plot-options.de-RDAv8kHb.js +2 -0
  466. package/standalone/chunks/box-plot-options.en-kGLfLsv3.js +2 -0
  467. package/standalone/chunks/box-plot-options.es-Dw3ivv22.js +2 -0
  468. package/standalone/chunks/box-plot-options.fr-De5nkQNr.js +2 -0
  469. package/standalone/chunks/box-plot-options.nl-DD1f-Nlt.js +2 -0
  470. package/standalone/chunks/box-plot-slots.config-4hmeA6nr.js +2 -0
  471. package/standalone/chunks/bubble-chart-options.config-BKPTymfC.js +2 -0
  472. package/standalone/chunks/bubble-chart-options.de-C4pA9ZdS.js +2 -0
  473. package/standalone/chunks/bubble-chart-options.en-DM-MH8pT.js +2 -0
  474. package/standalone/chunks/bubble-chart-options.es-C2VE7E7k.js +2 -0
  475. package/standalone/chunks/bubble-chart-options.fr-BugyvkW9.js +2 -0
  476. package/standalone/chunks/bubble-chart-options.nl-oDPNybDE.js +2 -0
  477. package/standalone/chunks/bubble-chart-slots.config-CqTUMwvW.js +2 -0
  478. package/standalone/chunks/bullet-chart-options.config-Cc5lKDjs.js +2 -0
  479. package/standalone/chunks/bullet-chart-options.de-Ci81seQn.js +2 -0
  480. package/standalone/chunks/bullet-chart-options.en-Dk95moRX.js +2 -0
  481. package/standalone/chunks/bullet-chart-options.es-eIqahAOr.js +2 -0
  482. package/standalone/chunks/bullet-chart-options.fr-CEABbpT0.js +2 -0
  483. package/standalone/chunks/bullet-chart-options.nl-B3gOPn5D.js +2 -0
  484. package/standalone/chunks/bullet-chart-slots.config-BiFMJsgN.js +2 -0
  485. package/standalone/chunks/calculate-data-field-icon-CrEVAfzJ.js +2 -0
  486. package/standalone/chunks/chart-helpers-BplLoVQz.js +2 -0
  487. package/standalone/chunks/choropleth-map-options.config-Ul1FSTwf.js +2 -0
  488. package/standalone/chunks/choropleth-map-options.de-eALhIYgW.js +2 -0
  489. package/standalone/chunks/choropleth-map-options.en-DNdPCTz7.js +2 -0
  490. package/standalone/chunks/choropleth-map-options.es-BoHXBNpE.js +2 -0
  491. package/standalone/chunks/choropleth-map-options.fr-Di8f-OWA.js +2 -0
  492. package/standalone/chunks/choropleth-map-options.nl-XKS-glHm.js +2 -0
  493. package/standalone/chunks/choropleth-map-slots.config-CRF7J3QP.js +2 -0
  494. package/standalone/chunks/circle-pack-chart-options.config-CjDkh4DG.js +2 -0
  495. package/standalone/chunks/circle-pack-chart-options.de-Dwf0pYf1.js +2 -0
  496. package/standalone/chunks/circle-pack-chart-options.en-DhCFF4vx.js +2 -0
  497. package/standalone/chunks/circle-pack-chart-options.es-DDKEbXse.js +2 -0
  498. package/standalone/chunks/circle-pack-chart-options.fr-Dezqd3QL.js +2 -0
  499. package/standalone/chunks/circle-pack-chart-options.nl-BNXyskRD.js +2 -0
  500. package/standalone/chunks/circle-pack-chart-slots.config-Deq7IUoK.js +2 -0
  501. package/standalone/chunks/circular-gauge-options.config-p2zb-ORR.js +2 -0
  502. package/standalone/chunks/circular-gauge-options.de-DXGoiD0i.js +2 -0
  503. package/standalone/chunks/circular-gauge-options.en-SHYrAgsX.js +2 -0
  504. package/standalone/chunks/circular-gauge-options.es-D4xJXTQ-.js +2 -0
  505. package/standalone/chunks/circular-gauge-options.fr-6vBd5iUe.js +2 -0
  506. package/standalone/chunks/circular-gauge-options.nl-CDoO99Is.js +2 -0
  507. package/standalone/chunks/circular-gauge-slots.config-C7yUFfFJ.js +2 -0
  508. package/standalone/chunks/classic-CHhNczKi.js +2 -0
  509. package/standalone/chunks/classic-dark-Cmrn7jod.js +2 -0
  510. package/standalone/chunks/color-DaeCRJ5Q.js +2 -0
  511. package/standalone/chunks/color-palettes-B41FvzWH.js +2 -0
  512. package/standalone/chunks/color-range-utils-CLqVCA5J.js +2 -0
  513. package/standalone/chunks/column-chart-options.config-v7fBgXRI.js +2 -0
  514. package/standalone/chunks/column-chart-options.de-OoMpZc7N.js +2 -0
  515. package/standalone/chunks/column-chart-options.en-B4xiZxTy.js +2 -0
  516. package/standalone/chunks/column-chart-options.es-BL-wKXpp.js +2 -0
  517. package/standalone/chunks/column-chart-options.fr-CaUBeZBK.js +2 -0
  518. package/standalone/chunks/column-chart-options.nl-C2tFvUE8.js +2 -0
  519. package/standalone/chunks/column-chart-slots.config-ZBLvqhEb.js +2 -0
  520. package/standalone/chunks/combination-chart-options.config-C9hmUPal.js +2 -0
  521. package/standalone/chunks/combination-chart-options.de-ChlEhT09.js +2 -0
  522. package/standalone/chunks/combination-chart-options.en-DhCXqnwj.js +2 -0
  523. package/standalone/chunks/combination-chart-options.es-DESqZp0U.js +2 -0
  524. package/standalone/chunks/combination-chart-options.fr-v6P2xQCi.js +2 -0
  525. package/standalone/chunks/combination-chart-options.nl-D8ato2ve.js +2 -0
  526. package/standalone/chunks/combination-chart-slots.config-BNVJfRB2.js +2 -0
  527. package/standalone/chunks/conditional-number-options.config-hdARPTD7.js +2 -0
  528. package/standalone/chunks/conditional-number-options.de-BNkYWqfn.js +2 -0
  529. package/standalone/chunks/conditional-number-options.en-J7yPXdbP.js +2 -0
  530. package/standalone/chunks/conditional-number-options.es-CKDTBiYp.js +2 -0
  531. package/standalone/chunks/conditional-number-options.fr-BX1cbt1S.js +2 -0
  532. package/standalone/chunks/conditional-number-options.nl-6IE86oA9.js +2 -0
  533. package/standalone/chunks/conditional-number-slots.config-B4kqODqw.js +2 -0
  534. package/standalone/chunks/create-lazy-loader-DC0rJePE.js +2 -0
  535. package/standalone/chunks/cs-DLnr3a23.js +2 -0
  536. package/standalone/chunks/da-BJgbo0uE.js +2 -0
  537. package/standalone/chunks/data-broker-Dgg5mQze.js +2 -0
  538. package/standalone/chunks/date-comparison-filter-options.config-a_qCDcWA.js +2 -0
  539. package/standalone/chunks/date-comparison-filter-options.de-WqpVCnC1.js +2 -0
  540. package/standalone/chunks/date-comparison-filter-options.en-Obm6KfbI.js +2 -0
  541. package/standalone/chunks/date-comparison-filter-options.es-CxYTNaTq.js +2 -0
  542. package/standalone/chunks/date-comparison-filter-options.fr-DhrKNPxX.js +2 -0
  543. package/standalone/chunks/date-comparison-filter-options.nl-D2RV7246.js +2 -0
  544. package/standalone/chunks/date-comparison-filter-slots.config-DfHq9lB8.js +2 -0
  545. package/standalone/chunks/date-filter-options.config-DHTbxiWn.js +2 -0
  546. package/standalone/chunks/date-filter-options.de-B83VkpDz.js +2 -0
  547. package/standalone/chunks/date-filter-options.en-DKQexBC1.js +2 -0
  548. package/standalone/chunks/date-filter-options.es-DfDqzkVB.js +2 -0
  549. package/standalone/chunks/date-filter-options.fr-DoZy8DU8.js +2 -0
  550. package/standalone/chunks/date-filter-options.nl-DKtF0sFB.js +2 -0
  551. package/standalone/chunks/date-filter-slots.config-DHaOkULx.js +2 -0
  552. package/standalone/chunks/de-BtQ1ecN1.js +2 -0
  553. package/standalone/chunks/de-DPgYMyja.js +2 -0
  554. package/standalone/chunks/decompose-numeric-format-BXLQ97e2.js +2 -0
  555. package/standalone/chunks/default-Bi3Z4SMm.js +2 -0
  556. package/standalone/chunks/default-dark-C2ykXPQt.js +2 -0
  557. package/standalone/chunks/default-local-formats-CES1ItiK.js +2 -0
  558. package/standalone/chunks/display-settings-binning-B_lKObyP.js +38 -0
  559. package/standalone/chunks/display-settings-datetime-CTmJyEOX.js +199 -0
  560. package/standalone/chunks/display-settings-grand-totals-IjcbBoyZ.js +26 -0
  561. package/standalone/chunks/display-settings-numeric-D9hvRtfN.js +172 -0
  562. package/standalone/chunks/display-settings-period-over-period-Dnstsyqe.js +209 -0
  563. package/standalone/chunks/donut-chart-options.config-BuZj-QX5.js +2 -0
  564. package/standalone/chunks/donut-chart-options.de-QusCBL9B.js +2 -0
  565. package/standalone/chunks/donut-chart-options.en-D0ligFH6.js +2 -0
  566. package/standalone/chunks/donut-chart-options.es-Bmn34sGt.js +2 -0
  567. package/standalone/chunks/donut-chart-options.fr-DGBawYKp.js +2 -0
  568. package/standalone/chunks/donut-chart-options.nl-DzNTu0v4.js +2 -0
  569. package/standalone/chunks/donut-chart-slots.config-7pDpzNBG.js +2 -0
  570. package/standalone/chunks/dropdown-filter-options.config-zwR7hmkX.js +2 -0
  571. package/standalone/chunks/dropdown-filter-options.de-dj6aTNQQ.js +2 -0
  572. package/standalone/chunks/dropdown-filter-options.en-DH7Jfk8Q.js +2 -0
  573. package/standalone/chunks/dropdown-filter-options.es-K2L8ln9j.js +2 -0
  574. package/standalone/chunks/dropdown-filter-options.fr-CMapzFiR.js +2 -0
  575. package/standalone/chunks/dropdown-filter-options.nl-BLAyit4D.js +2 -0
  576. package/standalone/chunks/dropdown-filter-slots.config-DkqLjilE.js +2 -0
  577. package/standalone/chunks/embed-Dymwil3u.js +228 -0
  578. package/standalone/chunks/en-BD2RCLuw.js +2 -0
  579. package/standalone/chunks/en-GB-DnwmFNwC.js +2 -0
  580. package/standalone/chunks/en-US-BD2RCLuw.js +2 -0
  581. package/standalone/chunks/es-CAWreooi.js +2 -0
  582. package/standalone/chunks/es-Dp1UuDDz.js +2 -0
  583. package/standalone/chunks/evolution-number-options.config-B5Cj0YAQ.js +2 -0
  584. package/standalone/chunks/evolution-number-options.de-Ch0LaHwI.js +2 -0
  585. package/standalone/chunks/evolution-number-options.en-riChGfa6.js +2 -0
  586. package/standalone/chunks/evolution-number-options.es-BdG3lvVQ.js +2 -0
  587. package/standalone/chunks/evolution-number-options.fr-_h0kLeRL.js +2 -0
  588. package/standalone/chunks/evolution-number-options.nl-CqycrLe1.js +2 -0
  589. package/standalone/chunks/evolution-number-slots.config-IqPfnCrw.js +2 -0
  590. package/standalone/chunks/fi-CLQ6vC7V.js +2 -0
  591. package/standalone/chunks/filters-CBmZhipt.js +544 -0
  592. package/standalone/chunks/formatter-B7zz6UOp.js +2 -0
  593. package/standalone/chunks/formula-codemirror-D2F6Aj2h.js +197 -0
  594. package/standalone/chunks/fr-BG0nQk8g.js +2 -0
  595. package/standalone/chunks/fr-D8xrUEX4.js +2 -0
  596. package/standalone/chunks/funnel-chart-options.config-1SyJ_qYd.js +2 -0
  597. package/standalone/chunks/funnel-chart-options.de-BTxwd7Pe.js +2 -0
  598. package/standalone/chunks/funnel-chart-options.en-CmY-uO1P.js +2 -0
  599. package/standalone/chunks/funnel-chart-options.es-DLqBydsE.js +2 -0
  600. package/standalone/chunks/funnel-chart-options.fr-ztQ5OMZi.js +2 -0
  601. package/standalone/chunks/funnel-chart-options.nl-DVysx7tP.js +2 -0
  602. package/standalone/chunks/funnel-chart-slots.config-DfeuNGEL.js +2 -0
  603. package/standalone/chunks/guidelines-options.config-CS29_J9M.js +2 -0
  604. package/standalone/chunks/he-DHPb0VBo.js +2 -0
  605. package/standalone/chunks/heat-map-options.config-DYIrP8cV.js +2 -0
  606. package/standalone/chunks/heat-map-options.de-BfJMMX2Q.js +2 -0
  607. package/standalone/chunks/heat-map-options.en-Dr653pN6.js +2 -0
  608. package/standalone/chunks/heat-map-options.es-CklrBP1w.js +2 -0
  609. package/standalone/chunks/heat-map-options.fr-DwtCOHrA.js +2 -0
  610. package/standalone/chunks/heat-map-options.nl-DQBLussF.js +2 -0
  611. package/standalone/chunks/heat-map-slots.config-BVBzVjJJ.js +2 -0
  612. package/standalone/chunks/heat-table-options.config-ByHwT44G.js +2 -0
  613. package/standalone/chunks/heat-table-options.de-BMx67hXo.js +2 -0
  614. package/standalone/chunks/heat-table-options.en-BbobGoXs.js +2 -0
  615. package/standalone/chunks/heat-table-options.es-zKo-QMBY.js +2 -0
  616. package/standalone/chunks/heat-table-options.fr-XSTL1CSb.js +2 -0
  617. package/standalone/chunks/heat-table-options.nl-Cgcccsee.js +2 -0
  618. package/standalone/chunks/heat-table-slots.config-CcOl-PCp.js +2 -0
  619. package/standalone/chunks/helpers-DalWg6k7.js +2 -0
  620. package/standalone/chunks/hexbin-map-options.config-Elr44Jin.js +2 -0
  621. package/standalone/chunks/hexbin-map-options.de-C45yz1mZ.js +2 -0
  622. package/standalone/chunks/hexbin-map-options.en-CIrLRJJ1.js +2 -0
  623. package/standalone/chunks/hexbin-map-options.es-wf4yF2eW.js +2 -0
  624. package/standalone/chunks/hexbin-map-options.fr-C0SN47Nq.js +2 -0
  625. package/standalone/chunks/hexbin-map-options.nl-CweMyvfk.js +2 -0
  626. package/standalone/chunks/hexbin-map-slots.config-D6qVm4nj.js +2 -0
  627. package/standalone/chunks/hu-BpaYooip.js +2 -0
  628. package/standalone/chunks/image-options.config-Cj4r1ypi.js +2 -0
  629. package/standalone/chunks/image-options.de-CFUHfYzb.js +2 -0
  630. package/standalone/chunks/image-options.en-BIyq9f_H.js +2 -0
  631. package/standalone/chunks/image-options.es-BD---IOk.js +2 -0
  632. package/standalone/chunks/image-options.fr-BGFgsNTs.js +2 -0
  633. package/standalone/chunks/image-options.nl-DD1JEJSa.js +2 -0
  634. package/standalone/chunks/image-slots.config-CdWEUY0l.js +2 -0
  635. package/standalone/chunks/info-tooltip-options.config-DtfU5ZO8.js +2 -0
  636. package/standalone/chunks/info-tooltip-options.i18n-B_gjTq0R.js +2 -0
  637. package/standalone/chunks/interactivity-options.config-09eXx6k6.js +2 -0
  638. package/standalone/chunks/interactivity-options.i18n-BLDCmZkC.js +2 -0
  639. package/standalone/chunks/it-DWTvD2Xn.js +2 -0
  640. package/standalone/chunks/item-option-action-button-group-BZyiRTfe.js +35 -0
  641. package/standalone/chunks/item-option-base-Bk5qxdcQ.js +38 -0
  642. package/standalone/chunks/item-option-color-palette-picker-O8kT0i8p.js +22 -0
  643. package/standalone/chunks/item-option-color-picker-CUTCc_yN.js +16 -0
  644. package/standalone/chunks/item-option-color-range-DsKPvjLj.js +80 -0
  645. package/standalone/chunks/item-option-guidelines-CZyvhgtN.js +117 -0
  646. package/standalone/chunks/item-option-multi-language-field-DlC-cCD7.js +15 -0
  647. package/standalone/chunks/item-option-number-field-BW9VpN9_.js +20 -0
  648. package/standalone/chunks/item-option-panel-BXA3sIYG.js +298 -0
  649. package/standalone/chunks/item-option-picker-B2KmO7a6.js +19 -0
  650. package/standalone/chunks/item-option-position-picker-C9C9SKDD.js +14 -0
  651. package/standalone/chunks/item-option-positions-number-field-C2ahVlxe.js +31 -0
  652. package/standalone/chunks/item-option-radio-button-group-2q3doUXH.js +19 -0
  653. package/standalone/chunks/item-option-slider-C7TT3CqL.js +15 -0
  654. package/standalone/chunks/item-option-switch-CZR2_Bs9.js +12 -0
  655. package/standalone/chunks/item-option-text-field-DBUOD_fv.js +15 -0
  656. package/standalone/chunks/item-slot-picker-panel-CTePASjI.js +439 -0
  657. package/standalone/chunks/ja-CtDlXHD1.js +2 -0
  658. package/standalone/chunks/ko-CekuHU50.js +2 -0
  659. package/standalone/chunks/line-chart-options.config-DyqQLGw8.js +2 -0
  660. package/standalone/chunks/line-chart-options.de-BScjvJsI.js +2 -0
  661. package/standalone/chunks/line-chart-options.en-BVWFsre-.js +2 -0
  662. package/standalone/chunks/line-chart-options.es-CxNJevNs.js +2 -0
  663. package/standalone/chunks/line-chart-options.fr-LCsLx0Uh.js +2 -0
  664. package/standalone/chunks/line-chart-options.nl-BOgcjx48.js +2 -0
  665. package/standalone/chunks/line-chart-slots.config-CavGuJXK.js +2 -0
  666. package/standalone/chunks/lit-localize-CIGP-NUw.js +2 -0
  667. package/standalone/chunks/load-data-fields-for-datasets-CPf_Q7p4.js +25 -0
  668. package/standalone/chunks/load-formula-codemirror-CA7NW4Zq.js +6 -0
  669. package/standalone/chunks/localize-BXHWaHdZ.js +2 -0
  670. package/standalone/chunks/localized-decorator-Buib6Rq1.js +2 -0
  671. package/standalone/chunks/localized-mixin-DN2aV3CC.js +2 -0
  672. package/standalone/chunks/luzmo-icon-markup-27PRW8QM.js +13 -0
  673. package/standalone/chunks/luzmoAlignLeft-HA-XKPHy.js +2 -0
  674. package/standalone/chunks/luzmoAngleDown-PNrItYzK.js +2 -0
  675. package/standalone/chunks/luzmoAngleLeft-ebJO7ROy.js +2 -0
  676. package/standalone/chunks/luzmoArrowsHorizontal-TohKbcQD.js +2 -0
  677. package/standalone/chunks/luzmoBorderDotted-CWXwQ_Hm.js +2 -0
  678. package/standalone/chunks/luzmoCheckbox-BksyONqE.js +2 -0
  679. package/standalone/chunks/luzmoCog-C4v4vc5N.js +2 -0
  680. package/standalone/chunks/luzmoLockOutline-Dctb86HR.js +2 -0
  681. package/standalone/chunks/luzmoPlus-Dyrrz0v8.js +2 -0
  682. package/standalone/chunks/luzmoTable-BYeZ8pW6.js +2 -0
  683. package/standalone/chunks/luzmoTrashOutline-DXZpJx7f.js +2 -0
  684. package/standalone/chunks/map-tile-providers-DZT1QZX_.js +2 -0
  685. package/standalone/chunks/marker-map-options.config-D_OTOZRe.js +2 -0
  686. package/standalone/chunks/marker-map-options.de-SuCAxwxR.js +2 -0
  687. package/standalone/chunks/marker-map-options.en-B-gl_14v.js +2 -0
  688. package/standalone/chunks/marker-map-options.es-CSJGCzjk.js +2 -0
  689. package/standalone/chunks/marker-map-options.fr-D5P_HjSn.js +2 -0
  690. package/standalone/chunks/marker-map-options.nl-DdeyYFJQ.js +2 -0
  691. package/standalone/chunks/marker-map-slots.config-CtzpU-rK.js +2 -0
  692. package/standalone/chunks/mk-Dq3YK4jD.js +2 -0
  693. package/standalone/chunks/nl-7csxtU-I.js +2 -0
  694. package/standalone/chunks/nl-BXPduS2Q.js +2 -0
  695. package/standalone/chunks/no-DJNRx8au.js +2 -0
  696. package/standalone/chunks/ohlc-chart-options.config-Bu2GKlAH.js +2 -0
  697. package/standalone/chunks/ohlc-chart-options.de-DeQ8wdeE.js +2 -0
  698. package/standalone/chunks/ohlc-chart-options.en-DopM1kPj.js +2 -0
  699. package/standalone/chunks/ohlc-chart-options.es-BKjQWwH0.js +2 -0
  700. package/standalone/chunks/ohlc-chart-options.fr-DWhV_lXz.js +2 -0
  701. package/standalone/chunks/ohlc-chart-options.nl-D8lhNKIv.js +2 -0
  702. package/standalone/chunks/ohlc-chart-slots.config-xYpPbmg2.js +2 -0
  703. package/standalone/chunks/orion-BHOu-xse.js +2 -0
  704. package/standalone/chunks/parallel-coordinates-plot-options.config-BcIYCRdF.js +2 -0
  705. package/standalone/chunks/parallel-coordinates-plot-options.de-Dvi0gBbB.js +2 -0
  706. package/standalone/chunks/parallel-coordinates-plot-options.en-LdifcLcc.js +2 -0
  707. package/standalone/chunks/parallel-coordinates-plot-options.es-DNisZWdC.js +2 -0
  708. package/standalone/chunks/parallel-coordinates-plot-options.fr-DwOBR0cp.js +2 -0
  709. package/standalone/chunks/parallel-coordinates-plot-options.nl-DCXeTldD.js +2 -0
  710. package/standalone/chunks/parallel-coordinates-plot-slots.config-DvJljfr8.js +2 -0
  711. package/standalone/chunks/period-over-period-condition.const-AC_onvUf.js +2 -0
  712. package/standalone/chunks/periods.const-Cie50jR4.js +2 -0
  713. package/standalone/chunks/pinky-CkEB6Fvc.js +2 -0
  714. package/standalone/chunks/pivot-table-options.config-BZpId1ju.js +2 -0
  715. package/standalone/chunks/pivot-table-options.de-B0l711Q7.js +2 -0
  716. package/standalone/chunks/pivot-table-options.en-D3MYHTWH.js +2 -0
  717. package/standalone/chunks/pivot-table-options.es-CDACogGQ.js +2 -0
  718. package/standalone/chunks/pivot-table-options.fr-C-w1sys8.js +2 -0
  719. package/standalone/chunks/pivot-table-options.nl-Dy9VJ1bm.js +2 -0
  720. package/standalone/chunks/pivot-table-slots.config-DZOE04Ea.js +2 -0
  721. package/standalone/chunks/pl-zDnuk9Gd.js +2 -0
  722. package/standalone/chunks/pt-BEVAH5AJ.js +2 -0
  723. package/standalone/chunks/pyramid-chart-options.config-CBd-pgn_.js +2 -0
  724. package/standalone/chunks/pyramid-chart-options.de-CBL_8UjH.js +2 -0
  725. package/standalone/chunks/pyramid-chart-options.en-CTozc1Uh.js +2 -0
  726. package/standalone/chunks/pyramid-chart-options.es-BKciL-nO.js +2 -0
  727. package/standalone/chunks/pyramid-chart-options.fr-B04m8B_b.js +2 -0
  728. package/standalone/chunks/pyramid-chart-options.nl-DIhj1NYF.js +2 -0
  729. package/standalone/chunks/pyramid-chart-slots.config-DKBFy-TL.js +2 -0
  730. package/standalone/chunks/radar-chart-options.config-CnQ8mbs9.js +2 -0
  731. package/standalone/chunks/radar-chart-options.de-_LSueG69.js +2 -0
  732. package/standalone/chunks/radar-chart-options.en-DBA8TpKJ.js +2 -0
  733. package/standalone/chunks/radar-chart-options.es-DjSsFQkP.js +2 -0
  734. package/standalone/chunks/radar-chart-options.fr-CCh2jYPS.js +2 -0
  735. package/standalone/chunks/radar-chart-options.nl-tZ0JRjXD.js +2 -0
  736. package/standalone/chunks/radar-chart-slots.config-CHauNDhi.js +2 -0
  737. package/standalone/chunks/radiant-BfVbXYeP.js +2 -0
  738. package/standalone/chunks/regular-table-options.config-BnhDzc-m.js +2 -0
  739. package/standalone/chunks/regular-table-options.de-DPmii-jp.js +2 -0
  740. package/standalone/chunks/regular-table-options.en-DQugncwx.js +2 -0
  741. package/standalone/chunks/regular-table-options.es-DzbTEFoh.js +2 -0
  742. package/standalone/chunks/regular-table-options.fr-roRCzuK8.js +2 -0
  743. package/standalone/chunks/regular-table-options.nl-DxYUm_Rz.js +2 -0
  744. package/standalone/chunks/regular-table-slots.config-BqEJgzhG.js +2 -0
  745. package/standalone/chunks/route-map-options.config-CWyA9_SB.js +2 -0
  746. package/standalone/chunks/route-map-options.de-Ke-Bybpi.js +2 -0
  747. package/standalone/chunks/route-map-options.en-CDXIcBc0.js +2 -0
  748. package/standalone/chunks/route-map-options.es-CCEXcHLb.js +2 -0
  749. package/standalone/chunks/route-map-options.fr-BXoMKK54.js +2 -0
  750. package/standalone/chunks/route-map-options.nl-U52AE8MW.js +2 -0
  751. package/standalone/chunks/route-map-slots.config-B5G4JVnI.js +2 -0
  752. package/standalone/chunks/royale-Bcd5VvC5.js +2 -0
  753. package/standalone/chunks/ru-Ceji1Fqk.js +2 -0
  754. package/standalone/chunks/sankey-diagram-options.config-Curc2-If.js +2 -0
  755. package/standalone/chunks/sankey-diagram-options.de-Bisx6mpj.js +2 -0
  756. package/standalone/chunks/sankey-diagram-options.en-DonChVRz.js +2 -0
  757. package/standalone/chunks/sankey-diagram-options.es-TCXmlth5.js +2 -0
  758. package/standalone/chunks/sankey-diagram-options.fr-B3iAnJNW.js +2 -0
  759. package/standalone/chunks/sankey-diagram-options.nl-BnXZQEKn.js +2 -0
  760. package/standalone/chunks/sankey-diagram-slots.config-jyKqjUsV.js +2 -0
  761. package/standalone/chunks/scatter-plot-options.config-BV9Lb6-v.js +2 -0
  762. package/standalone/chunks/scatter-plot-options.de-Dg3O1b2R.js +2 -0
  763. package/standalone/chunks/scatter-plot-options.en-CJH2ZlFW.js +2 -0
  764. package/standalone/chunks/scatter-plot-options.es-7kExRi4J.js +2 -0
  765. package/standalone/chunks/scatter-plot-options.fr-Bbkf8efT.js +2 -0
  766. package/standalone/chunks/scatter-plot-options.nl-zrEXoM-k.js +2 -0
  767. package/standalone/chunks/scatter-plot-slots.config-CF2Ii2Ez.js +2 -0
  768. package/standalone/chunks/search-filter-options.config-DPhYMtlJ.js +2 -0
  769. package/standalone/chunks/search-filter-options.de-DewLFwK0.js +2 -0
  770. package/standalone/chunks/search-filter-options.en-DyIupnO9.js +2 -0
  771. package/standalone/chunks/search-filter-options.es-Dx1WGz-q.js +2 -0
  772. package/standalone/chunks/search-filter-options.fr-BdnlKNNx.js +2 -0
  773. package/standalone/chunks/search-filter-options.nl-DsKcc6ke.js +2 -0
  774. package/standalone/chunks/search-filter-slots.config-BcTF-DAh.js +2 -0
  775. package/standalone/chunks/seasonal-f6I--CYV.js +2 -0
  776. package/standalone/chunks/slicer-filter-options.config-BQ1vpcTb.js +2 -0
  777. package/standalone/chunks/slicer-filter-options.de-v0So4hDH.js +2 -0
  778. package/standalone/chunks/slicer-filter-options.en-BkVZDku6.js +2 -0
  779. package/standalone/chunks/slicer-filter-options.es-BATOs827.js +2 -0
  780. package/standalone/chunks/slicer-filter-options.fr-DROih5R8.js +2 -0
  781. package/standalone/chunks/slicer-filter-options.nl-CT4HfMiT.js +2 -0
  782. package/standalone/chunks/slicer-filter-slots.config-DL3Q0Zbm.js +2 -0
  783. package/standalone/chunks/slider-filter-options.config-ZCkBkeXQ.js +2 -0
  784. package/standalone/chunks/slider-filter-options.de-BToTmIkJ.js +2 -0
  785. package/standalone/chunks/slider-filter-options.en-Du0cf6NC.js +2 -0
  786. package/standalone/chunks/slider-filter-options.es-6yGUkJ9r.js +2 -0
  787. package/standalone/chunks/slider-filter-options.fr-DeupuOm1.js +2 -0
  788. package/standalone/chunks/slider-filter-options.nl-K6BEul4-.js +2 -0
  789. package/standalone/chunks/slider-filter-slots.config-52Bs7zu3.js +2 -0
  790. package/standalone/chunks/spacer-options.config-DmYOnwBz.js +2 -0
  791. package/standalone/chunks/speedometer-chart-options.config-YmUv49lQ.js +2 -0
  792. package/standalone/chunks/speedometer-chart-options.de-CWVMBrx9.js +2 -0
  793. package/standalone/chunks/speedometer-chart-options.en-DtCdA113.js +2 -0
  794. package/standalone/chunks/speedometer-chart-options.es-BC1Y-Hje.js +2 -0
  795. package/standalone/chunks/speedometer-chart-options.fr-BqnVNM9x.js +2 -0
  796. package/standalone/chunks/speedometer-chart-options.nl-D2dmDbhJ.js +2 -0
  797. package/standalone/chunks/speedometer-chart-slots.config-Cfsna_2O.js +2 -0
  798. package/standalone/chunks/spike-map-options.config-YOYHTzZs.js +2 -0
  799. package/standalone/chunks/spike-map-options.de-cIVh4l8Z.js +2 -0
  800. package/standalone/chunks/spike-map-options.en-CKjynYQl.js +2 -0
  801. package/standalone/chunks/spike-map-options.es-_GxcrK73.js +2 -0
  802. package/standalone/chunks/spike-map-options.fr-DHi_gHN6.js +2 -0
  803. package/standalone/chunks/spike-map-options.nl-Bicq35x0.js +2 -0
  804. package/standalone/chunks/spike-map-slots.config-FfXNX2O3.js +2 -0
  805. package/standalone/chunks/strip-plot-options.config-D84diNaB.js +2 -0
  806. package/standalone/chunks/strip-plot-options.de-DjNnWJl2.js +2 -0
  807. package/standalone/chunks/strip-plot-options.en-Of1sTT_A.js +2 -0
  808. package/standalone/chunks/strip-plot-options.es-BEHY8I7g.js +2 -0
  809. package/standalone/chunks/strip-plot-options.fr-DLfEoXBO.js +2 -0
  810. package/standalone/chunks/strip-plot-options.nl-CA3oh18P.js +2 -0
  811. package/standalone/chunks/strip-plot-slots.config-DQrrby2Y.js +2 -0
  812. package/standalone/chunks/sunburst-chart-options.config-DRjBFJV0.js +2 -0
  813. package/standalone/chunks/sunburst-chart-options.de-D6enQCjV.js +2 -0
  814. package/standalone/chunks/sunburst-chart-options.en-D9DSivE2.js +2 -0
  815. package/standalone/chunks/sunburst-chart-options.es-Bb7iCI1h.js +2 -0
  816. package/standalone/chunks/sunburst-chart-options.fr-CCzUgv7r.js +2 -0
  817. package/standalone/chunks/sunburst-chart-options.nl-bGOCvc4m.js +2 -0
  818. package/standalone/chunks/sunburst-chart-slots.config-DqW1e0nf.js +2 -0
  819. package/standalone/chunks/sv-CgssnOqA.js +2 -0
  820. package/standalone/chunks/symbol-map-options.config-Bbb3xIKg.js +2 -0
  821. package/standalone/chunks/symbol-map-options.de-CqxosoVr.js +2 -0
  822. package/standalone/chunks/symbol-map-options.en-DT7vsjRh.js +2 -0
  823. package/standalone/chunks/symbol-map-options.es-PGR-C-uM.js +2 -0
  824. package/standalone/chunks/symbol-map-options.fr-CPNydqFW.js +2 -0
  825. package/standalone/chunks/symbol-map-options.nl-BBHmJwLF.js +2 -0
  826. package/standalone/chunks/symbol-map-slots.config-B_UtYexb.js +2 -0
  827. package/standalone/chunks/task-CNp3cEJA.js +2 -0
  828. package/standalone/chunks/text-options.config-Chv14kyQ.js +2 -0
  829. package/standalone/chunks/text-options.de-CRVu5VAm.js +2 -0
  830. package/standalone/chunks/text-options.en-CupCY5Us.js +2 -0
  831. package/standalone/chunks/text-options.es-uKgRI4LZ.js +2 -0
  832. package/standalone/chunks/text-options.fr-C256Njqd.js +2 -0
  833. package/standalone/chunks/text-options.nl-CpMqMCOZ.js +2 -0
  834. package/standalone/chunks/text-slots.config-D33nu0FP.js +2 -0
  835. package/standalone/chunks/themes-BD5sKr3j.js +2 -0
  836. package/standalone/chunks/tr-i3G2sFi4.js +2 -0
  837. package/standalone/chunks/treemap-chart-options.config-DxkumoYq.js +2 -0
  838. package/standalone/chunks/treemap-chart-options.de-DdhcpjTu.js +2 -0
  839. package/standalone/chunks/treemap-chart-options.en-DB87QjbN.js +2 -0
  840. package/standalone/chunks/treemap-chart-options.es-DEImFeIB.js +2 -0
  841. package/standalone/chunks/treemap-chart-options.fr-BzM5c_vV.js +2 -0
  842. package/standalone/chunks/treemap-chart-options.nl-CFJgBJi2.js +2 -0
  843. package/standalone/chunks/treemap-chart-slots.config-CaearczZ.js +2 -0
  844. package/standalone/chunks/type-check-CC6bgirK.js +2 -0
  845. package/standalone/chunks/types-BS6dxSMT.js +2 -0
  846. package/standalone/chunks/urban-BEeGnayr.js +2 -0
  847. package/standalone/chunks/v4-CI0qP0ur.js +2 -0
  848. package/standalone/chunks/venn-diagram-options.config-DmYOnwBz.js +2 -0
  849. package/standalone/chunks/venn-diagram-slots.config-GnP5AAAL.js +2 -0
  850. package/standalone/chunks/version-DJES6maY.js +2 -0
  851. package/standalone/chunks/video-options.config-CfgT_MAw.js +2 -0
  852. package/standalone/chunks/video-options.de-Cxs3-JN3.js +2 -0
  853. package/standalone/chunks/video-options.en-ck74JByC.js +2 -0
  854. package/standalone/chunks/video-options.es-UdEH3Rzk.js +2 -0
  855. package/standalone/chunks/video-options.fr-p5bOI-bw.js +2 -0
  856. package/standalone/chunks/video-options.nl-CBYWp-Df.js +2 -0
  857. package/standalone/chunks/video-slots.config-ufoVcXKL.js +2 -0
  858. package/standalone/chunks/vivid-BC9AYKyD.js +2 -0
  859. package/standalone/chunks/wordcloud-chart-options.config-b-ibtRWp.js +2 -0
  860. package/standalone/chunks/wordcloud-chart-options.de-B0CeI2KB.js +2 -0
  861. package/standalone/chunks/wordcloud-chart-options.en-BQ-8ciOw.js +2 -0
  862. package/standalone/chunks/wordcloud-chart-options.es-DyMrHpJL.js +2 -0
  863. package/standalone/chunks/wordcloud-chart-options.fr-V1k_70yq.js +2 -0
  864. package/standalone/chunks/wordcloud-chart-options.nl-CrfYuaYy.js +2 -0
  865. package/standalone/chunks/wordcloud-chart-slots.config-g7QwS2dG.js +2 -0
  866. package/standalone/chunks/zh-CN-NVnv57dz.js +2 -0
  867. package/standalone/chunks/zh-TW-NVnv57dz.js +2 -0
  868. package/standalone/interactive-viz-item.js +263 -0
  869. package/standalone/item-grid.js +123 -0
  870. package/standalone/manifest.json +436 -0
  871. package/storybook/register-components.d.ts +2 -1
  872. package/styles/tokens.d.ts +1 -0
  873. package/types/add-to-dashboard.types.d.ts +51 -0
  874. package/types.d.ts +3 -1
  875. package/utils/data-broker/index.d.ts +19 -1
  876. package/utils/filters/filter-text.d.ts +1 -1
  877. package/utils/formula/base/formula-base.d.ts +2 -2
  878. package/utils/formula/config/build-datasets.d.ts +2 -2
  879. package/utils/formula/store/formula-display-store.d.ts +1 -1
  880. package/components/ai-chat-1OlRpimu.cjs +0 -337
  881. package/components/ai-chat-PesGGOLP.js +0 -4350
  882. package/components/ai-interaction-textarea-BXKG2elT.js +0 -820
  883. package/components/ai-interaction-textarea-CmFGJzbb.cjs +0 -99
  884. package/components/area-chart-positioning.config-C37nmNfP.cjs +0 -20
  885. package/components/area-chart-positioning.config-CF8Z7PuX.js +0 -55
  886. package/components/bar-chart-positioning.config-C4ii41mE.cjs +0 -20
  887. package/components/bar-chart-positioning.config-vuRQZsYr.js +0 -59
  888. package/components/base-8L8Jt2vi.js +0 -249
  889. package/components/base-K-bf6_7X.cjs +0 -20
  890. package/components/base-store-BhGpnbqi.js +0 -152
  891. package/components/base-store-D5cDq6d4.cjs +0 -20
  892. package/components/box-plot-positioning.config-D2LpbgQ_.cjs +0 -20
  893. package/components/box-plot-positioning.config-DMIsI9yU.js +0 -48
  894. package/components/bubble-chart-positioning.config-Btak-zwN.cjs +0 -20
  895. package/components/bubble-chart-positioning.config-jYu0Q0Mc.js +0 -55
  896. package/components/bullet-chart-positioning.config-BWHfPPyA.js +0 -56
  897. package/components/bullet-chart-positioning.config-CwoRVgNS.cjs +0 -20
  898. package/components/choropleth-map-options.config-DWWydGJ3.js +0 -352
  899. package/components/choropleth-map-options.config-VG10yjwC.cjs +0 -20
  900. package/components/choropleth-map-positioning.config-DttV0Dk_.cjs +0 -20
  901. package/components/choropleth-map-positioning.config-KtxcLW7E.js +0 -55
  902. package/components/circle-pack-chart-positioning.config-N-rZvQjR.cjs +0 -20
  903. package/components/circle-pack-chart-positioning.config-QBO-pwDr.js +0 -48
  904. package/components/circular-gauge-positioning.config-Cf1zuLXa.cjs +0 -20
  905. package/components/circular-gauge-positioning.config-DKGmEpFj.js +0 -48
  906. package/components/color-BWnYpOu7.js +0 -3812
  907. package/components/color-Bl8h58rV.cjs +0 -20
  908. package/components/color-range-utils-C3HJJUS1.cjs +0 -20
  909. package/components/color-range-utils-CiqduHJS.js +0 -63
  910. package/components/column-chart-positioning.config-DcErS56C.cjs +0 -20
  911. package/components/column-chart-positioning.config-LkQSNtSH.js +0 -55
  912. package/components/combination-chart-positioning.config-7iAEpO7h.js +0 -48
  913. package/components/combination-chart-positioning.config-Dzi93oAp.cjs +0 -20
  914. package/components/conditional-number-positioning.config-Bse6AKPP.js +0 -48
  915. package/components/conditional-number-positioning.config-CTy0zLXu.cjs +0 -20
  916. package/components/data-broker-B0uUO5er.js +0 -1684
  917. package/components/data-broker-CyMYR6w1.cjs +0 -20
  918. package/components/data-field-CSm9APdz.js +0 -121
  919. package/components/data-field-D2y4cv9j.cjs +0 -54
  920. package/components/data-field-level-B0aj8c5M.js +0 -247
  921. package/components/data-field-level-Llx0Y9m-.cjs +0 -55
  922. package/components/data-field-panel-DpBWJnes.js +0 -385
  923. package/components/data-field-panel-Dv60lRUC.cjs +0 -87
  924. package/components/data-fields-select-69TDpIG_.js +0 -289
  925. package/components/data-fields-select-BHa8THub.cjs +0 -43
  926. package/components/dataset-icon-BAV0S4sZ.cjs +0 -64
  927. package/components/dataset-icon-CWT5Ju8w.js +0 -125
  928. package/components/dataset-selector-list-D5lBv2sD.cjs +0 -75
  929. package/components/dataset-selector-list-DTMXvqfO.js +0 -323
  930. package/components/dataset-selector-row-gHWsZlrC.cjs +0 -102
  931. package/components/dataset-selector-row-kiHtzZcP.js +0 -427
  932. package/components/de-BhKtDR6p.js +0 -565
  933. package/components/de-DXFLsh4N.cjs +0 -20
  934. package/components/display-settings-DKuvd62j.js +0 -315
  935. package/components/display-settings-DPqTRJ7E.cjs +0 -142
  936. package/components/display-settings-binning-BkCNSkgf.js +0 -110
  937. package/components/display-settings-binning-DZKo_tBm.cjs +0 -56
  938. package/components/display-settings-datetime-BTgriFcv.js +0 -413
  939. package/components/display-settings-datetime-DD7Oh-2T.cjs +0 -217
  940. package/components/display-settings-grand-totals-BsIZg67h.cjs +0 -44
  941. package/components/display-settings-grand-totals-DH7AoyQY.js +0 -89
  942. package/components/display-settings-numeric-CkFpOoWU.js +0 -479
  943. package/components/display-settings-numeric-CsmrnEp2.cjs +0 -190
  944. package/components/display-settings-period-over-period-CdI5wuL_.js +0 -442
  945. package/components/display-settings-period-over-period-Co37HcSm.cjs +0 -227
  946. package/components/donut-chart-positioning.config-BThtaJEt.cjs +0 -20
  947. package/components/donut-chart-positioning.config-D2uG_Irk.js +0 -48
  948. package/components/es-DK-49nGv.cjs +0 -20
  949. package/components/es-DUENN-m1.js +0 -565
  950. package/components/evolution-number-positioning.config-BtjobZqK.js +0 -48
  951. package/components/evolution-number-positioning.config-DtYiv9oB.cjs +0 -20
  952. package/components/filter-expression-picker-C4kE_Thd.js +0 -433
  953. package/components/filter-expression-picker-CU-OfSmI.cjs +0 -40
  954. package/components/filter-item-Be6Z7NMz.js +0 -792
  955. package/components/filter-item-CxPrwF-R.cjs +0 -111
  956. package/components/filter-parameter-picker-Ba8bvoPZ.js +0 -371
  957. package/components/filter-parameter-picker-BtJLCUbT.cjs +0 -124
  958. package/components/filter-value-picker-DD206JZl.js +0 -169
  959. package/components/filter-value-picker-Dpua1vcJ.cjs +0 -69
  960. package/components/filter-value-picker-datetime-Bj0YaPtB.js +0 -159
  961. package/components/filter-value-picker-datetime-DWgI83nJ.cjs +0 -51
  962. package/components/filter-value-picker-hierarchy-BEoqkQq0.cjs +0 -54
  963. package/components/filter-value-picker-hierarchy-ZMThNJYm.js +0 -315
  964. package/components/filter-value-picker-numeric-1Vxp_Vam.cjs +0 -54
  965. package/components/filter-value-picker-numeric-CVaDogFQ.js +0 -236
  966. package/components/filters-Cnm0Kwk3.js +0 -926
  967. package/components/filters-Dtbt99BP.cjs +0 -199
  968. package/components/formula-BE9bipho.js +0 -138
  969. package/components/formula-DGMnKmnR.cjs +0 -45
  970. package/components/formula-codemirror-B14vsZXJ.cjs +0 -215
  971. package/components/formula-codemirror-xfm0QtJN.js +0 -12018
  972. package/components/formula-display-store-8hohve9v.cjs +0 -20
  973. package/components/formula-display-store-JAaWuYNB.js +0 -1087
  974. package/components/formula-editor-CkW-JfyT.cjs +0 -224
  975. package/components/formula-editor-DN87mT8q.js +0 -690
  976. package/components/formula-field-B1EMJOfK.js +0 -40
  977. package/components/formula-field-CQYFSBHL.cjs +0 -20
  978. package/components/formula-input-base-BCQXmd1P.cjs +0 -49
  979. package/components/formula-input-base-HL0Fg74x.js +0 -236
  980. package/components/fr-CePmGBUH.js +0 -565
  981. package/components/fr-uE3fb3kc.cjs +0 -20
  982. package/components/funnel-chart-positioning.config-DeLnAGGT.cjs +0 -20
  983. package/components/funnel-chart-positioning.config-TVzSiV6I.js +0 -48
  984. package/components/get-dataset-name-DLjeChNS.js +0 -32
  985. package/components/get-dataset-name-mGNEfkAv.cjs +0 -20
  986. package/components/groupings-CODDxpbZ.js +0 -52
  987. package/components/groupings-DKMq8DgS.cjs +0 -20
  988. package/components/heat-map-options.config-DtDh9Gpy.cjs +0 -20
  989. package/components/heat-map-options.config-X96sw-BV.js +0 -226
  990. package/components/heat-map-positioning.config--wm9l7bB.js +0 -48
  991. package/components/heat-map-positioning.config-ddrgZXa9.cjs +0 -20
  992. package/components/heat-table-options.config-CugBuoUA.cjs +0 -20
  993. package/components/heat-table-options.config-D6dA9J97.js +0 -269
  994. package/components/heat-table-positioning.config-CIhhBEMg.js +0 -55
  995. package/components/heat-table-positioning.config-qMDSRhZR.cjs +0 -20
  996. package/components/hexbin-map-positioning.config-E_BpcIFy.cjs +0 -20
  997. package/components/hexbin-map-positioning.config-S7VYUwVD.js +0 -48
  998. package/components/interactive-viz-item--kqitfEZ.cjs +0 -249
  999. package/components/interactive-viz-item-cdShBZQA.js +0 -722
  1000. package/components/item-grid/item-grid-item-actions-menu.d.ts +0 -35
  1001. package/components/item-grid-BfhqMuQA.cjs +0 -113
  1002. package/components/item-grid-xCM8AqRH.js +0 -4559
  1003. package/components/item-option-B5FraAiv.cjs +0 -269
  1004. package/components/item-option-DaAlj_OB.js +0 -955
  1005. package/components/item-option-action-button-group-4w8ub3cT.js +0 -118
  1006. package/components/item-option-action-button-group-DHu8VjCy.cjs +0 -53
  1007. package/components/item-option-base-4Bwn-3Fc.cjs +0 -56
  1008. package/components/item-option-base-BxQUwXzg.js +0 -123
  1009. package/components/item-option-color-palette-picker-D5nO-Bqb.js +0 -2041
  1010. package/components/item-option-color-palette-picker-DrhHKaAK.cjs +0 -40
  1011. package/components/item-option-color-picker-Bhv_k1uW.cjs +0 -34
  1012. package/components/item-option-color-picker-CKokPQcS.js +0 -87
  1013. package/components/item-option-color-range-CwDkzRcx.cjs +0 -98
  1014. package/components/item-option-color-range-DYsMbFEb.js +0 -220
  1015. package/components/item-option-guidelines-CXl4Yla4.js +0 -419
  1016. package/components/item-option-guidelines-DMjA-h3h.cjs +0 -135
  1017. package/components/item-option-multi-language-field-C75Hd2fG.cjs +0 -33
  1018. package/components/item-option-multi-language-field-S6Mt3k23.js +0 -82
  1019. package/components/item-option-number-field-Bg5r0IAX.cjs +0 -38
  1020. package/components/item-option-number-field-CALw8q_J.js +0 -102
  1021. package/components/item-option-panel-DBXgOsM4.cjs +0 -67
  1022. package/components/item-option-panel-v7yUS9hb.js +0 -183
  1023. package/components/item-option-picker-CZyzd3Nq.js +0 -77
  1024. package/components/item-option-picker-RFstpFwI.cjs +0 -37
  1025. package/components/item-option-position-picker-C8cnHEH4.js +0 -117
  1026. package/components/item-option-position-picker-CKHbHHl1.cjs +0 -32
  1027. package/components/item-option-positions-number-field-BGs3WWaz.cjs +0 -49
  1028. package/components/item-option-positions-number-field-BJTY1qZR.js +0 -164
  1029. package/components/item-option-radio-button-group-CN8TLtsV.cjs +0 -37
  1030. package/components/item-option-radio-button-group-vhm4r4_k.js +0 -74
  1031. package/components/item-option-slider-CQOKWBZQ.js +0 -96
  1032. package/components/item-option-slider-DbLPhpJd.cjs +0 -33
  1033. package/components/item-option-switch-CWpb0nf3.cjs +0 -30
  1034. package/components/item-option-switch-azZX2vJr.js +0 -69
  1035. package/components/item-option-text-field-CIM_38yi.js +0 -80
  1036. package/components/item-option-text-field-CS3Lccda.cjs +0 -33
  1037. package/components/item-slot-drop-C8WYPu_w.cjs +0 -91
  1038. package/components/item-slot-drop-DeZ2GvAu.js +0 -331
  1039. package/components/item-slot-drop-panel-BcBHDDTT.cjs +0 -57
  1040. package/components/item-slot-drop-panel-LpfX7ap0.js +0 -355
  1041. package/components/item-slot-picker-BSO1ltXC.js +0 -505
  1042. package/components/item-slot-picker-CvySq194.cjs +0 -174
  1043. package/components/item-slot-picker-panel-CsntXcAp.js +0 -448
  1044. package/components/item-slot-picker-panel-DQ_OzMO_.cjs +0 -81
  1045. package/components/line-chart-positioning.config-CrreArf5.js +0 -55
  1046. package/components/line-chart-positioning.config-DMe1Ldwk.cjs +0 -20
  1047. package/components/load-data-fields-for-datasets-B3XcFFfg.js +0 -42
  1048. package/components/load-data-fields-for-datasets-rL24A68g.cjs +0 -20
  1049. package/components/localized-mixin-DaLXe5J9.js +0 -45
  1050. package/components/localized-mixin-DiUJOd06.cjs +0 -20
  1051. package/components/marker-map-positioning.config-CpI8nCtC.cjs +0 -20
  1052. package/components/marker-map-positioning.config-DW9tMO2M.js +0 -48
  1053. package/components/nl-BaZM3WoR.js +0 -565
  1054. package/components/nl-BoEhzeIh.cjs +0 -20
  1055. package/components/ohlc-chart-positioning.config-9DETh4xy.cjs +0 -20
  1056. package/components/ohlc-chart-positioning.config-CkX8gyS2.js +0 -78
  1057. package/components/parallel-coordinates-plot-positioning.config-CLDZdGdh.cjs +0 -20
  1058. package/components/parallel-coordinates-plot-positioning.config-DTJZLEeT.js +0 -48
  1059. package/components/pivot-table-positioning.config-B-SALuVb.cjs +0 -20
  1060. package/components/pivot-table-positioning.config-CtSYHD-n.js +0 -55
  1061. package/components/pyramid-chart-positioning.config-0Juiava5.js +0 -55
  1062. package/components/pyramid-chart-positioning.config-BllFtneP.cjs +0 -20
  1063. package/components/radar-chart-positioning.config-BPbb63S6.js +0 -55
  1064. package/components/radar-chart-positioning.config-BY4RKNDi.cjs +0 -20
  1065. package/components/route-map-options.config-C65J81_7.js +0 -328
  1066. package/components/route-map-options.config-DS9cCAQK.cjs +0 -20
  1067. package/components/route-map-positioning.config-D6nZFd8f.js +0 -66
  1068. package/components/route-map-positioning.config-GQ9AJfej.cjs +0 -20
  1069. package/components/sankey-diagram-positioning.config-DAuj5A08.cjs +0 -20
  1070. package/components/sankey-diagram-positioning.config-R1EjoR5F.js +0 -66
  1071. package/components/scatter-plot-positioning.config-DGoMnNZy.js +0 -77
  1072. package/components/scatter-plot-positioning.config-o4c-wuRo.cjs +0 -20
  1073. package/components/set-locale-Xh_1AFbC.cjs +0 -20
  1074. package/components/set-locale-ydAPif-7.js +0 -43
  1075. package/components/slicer-filter-positioning.config-BqpIENEm.cjs +0 -20
  1076. package/components/slicer-filter-positioning.config-D_didkcw.js +0 -48
  1077. package/components/slot-menu-CUdbaW3K.js +0 -428
  1078. package/components/slot-menu-DRx1Ffla.cjs +0 -71
  1079. package/components/slot-menu-list-DVSxamVa.js +0 -347
  1080. package/components/slot-menu-list-DaHzz_ve.cjs +0 -44
  1081. package/components/speedometer-chart-positioning.config-CmxsV4-x.js +0 -48
  1082. package/components/speedometer-chart-positioning.config-eVUWDhkL.cjs +0 -20
  1083. package/components/spike-map-options.config-BRwdTyrp.cjs +0 -20
  1084. package/components/spike-map-options.config-DjoTrAsC.js +0 -415
  1085. package/components/spike-map-positioning.config-B38djRlf.cjs +0 -20
  1086. package/components/spike-map-positioning.config-Bta7ar9e.js +0 -55
  1087. package/components/strip-plot-positioning.config-0vlAfmDB.js +0 -48
  1088. package/components/strip-plot-positioning.config-atH68L8u.cjs +0 -20
  1089. package/components/sunburst-chart-positioning.config-B2x6afBV.js +0 -48
  1090. package/components/sunburst-chart-positioning.config-NFzFNuXB.cjs +0 -20
  1091. package/components/symbol-map-positioning.config-B6v9PFTk.js +0 -55
  1092. package/components/symbol-map-positioning.config-DGpmp_N1.cjs +0 -20
  1093. package/components/treemap-chart-positioning.config-Bf2VNVRQ.js +0 -55
  1094. package/components/treemap-chart-positioning.config-NMULB8UM.cjs +0 -20
  1095. package/components/utils-SzKvwZ9-.cjs +0 -20
  1096. package/components/utils-_8LPCz9-.js +0 -240
  1097. package/components/venn-diagram-positioning.config-D4cODPGV.cjs +0 -20
  1098. package/components/venn-diagram-positioning.config-DgOl0Vh-.js +0 -55
  1099. package/components/viz-item-menu/index.cjs +0 -20
  1100. package/components/viz-item-menu/index.d.ts +0 -8
  1101. package/components/viz-item-menu/index.js +0 -28
  1102. package/components/viz-item-menu/types.d.ts +0 -9
  1103. package/components/viz-item-menu/viz-item-menu.d.ts +0 -78
  1104. package/components/viz-item-menu-CNHv6qDa.cjs +0 -55
  1105. package/components/viz-item-menu-L_j0L08h.js +0 -170
  1106. package/components/wordcloud-chart-positioning.config-BP6iqy-N.js +0 -55
  1107. package/components/wordcloud-chart-positioning.config-DZEkWvb0.cjs +0 -20
  1108. package/deprecated-react/components/viz-item-menu.component.cjs +0 -1
  1109. package/react/components/viz-item-menu.component.ts +0 -33
  1110. package/react/esm/components/viz-item-menu.component.d.ts +0 -16
  1111. package/react/esm/components/viz-item-menu.component.js +0 -21
  1112. /package/{storybook/inject-global-vars.d.ts → utils/data-broker/tests/data-broker.test.d.ts} +0 -0
@@ -0,0 +1,4325 @@
1
+ /*! * A kit of modern Luzmo Web Components for analytics in your web application.
2
+ *
3
+ * Copyright © 2026 Luzmo
4
+ * All rights reserved.
5
+ * Luzmo web components (“Luzmo Web Components”)
6
+ * must be used according to the Luzmo Terms of Service.
7
+ * This license allows users with a current active Luzmo account
8
+ * to use the Luzmo Web Components. This license terminates
9
+ * automatically if a user no longer has an active Luzmo account.
10
+ * Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
11
+ *
12
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
+ * SOFTWARE.
19
+ * */
20
+ import "./tokens-Ov1pCR4Y.js";
21
+ import { c as e, d as t, s as n, u as r } from "./ai-interaction-textarea-6ECwAdeT.js";
22
+ import { i, n as a } from "./base-CrpOMVeU.js";
23
+ import { t as o } from "./decorate-DyMgX_Uh.js";
24
+ import { t as s } from "./defineProperty-AldSMFEH.js";
25
+ import { msg as c } from "@lit/localize/lit-localize";
26
+ import { luzmoEllipsisVertical as l, luzmoIcon as u, luzmoSpin as d } from "@luzmo/icons";
27
+ import "@luzmo/lucero/button";
28
+ import "@luzmo/lucero/chat-message";
29
+ import "@luzmo/lucero/icon";
30
+ import "@luzmo/lucero/overlay";
31
+ import "@luzmo/lucero/popover";
32
+ import "@luzmo/lucero/progress-steps";
33
+ import { html as f, nothing as p, unsafeCSS as m } from "lit";
34
+ import { property as h, state as g } from "lit/decorators.js";
35
+ import { unsafeHTML as ee } from "lit/directives/unsafe-html.js";
36
+ import "@luzmo/lucero/action-button";
37
+ import "@luzmo/lucero/question-box";
38
+ import { guard as te } from "lit/directives/guard.js";
39
+ import { keyed as ne } from "lit/directives/keyed.js";
40
+ //#region node_modules/dompurify/dist/purify.es.mjs
41
+ function _(e, t) {
42
+ this.v = e, this.k = t;
43
+ }
44
+ function re(e, t) {
45
+ (t == null || t > e.length) && (t = e.length);
46
+ for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
47
+ return r;
48
+ }
49
+ function ie(e) {
50
+ if (Array.isArray(e)) return e;
51
+ }
52
+ function ae(e, t) {
53
+ var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
54
+ if (n != null) {
55
+ var r, i, a, o, s = [], c = !0, l = !1;
56
+ try {
57
+ if (a = (n = n.call(e)).next, t === 0) {
58
+ if (Object(n) !== n) return;
59
+ c = !1;
60
+ } else for (; !(c = (r = a.call(n)).done) && (s.push(r.value), s.length !== t); c = !0);
61
+ } catch (e) {
62
+ l = !0, i = e;
63
+ } finally {
64
+ try {
65
+ if (!c && n.return != null && (o = n.return(), Object(o) !== o)) return;
66
+ } finally {
67
+ if (l) throw i;
68
+ }
69
+ }
70
+ return s;
71
+ }
72
+ }
73
+ function oe() {
74
+ throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
75
+ }
76
+ function v(e, t) {
77
+ return ie(e) || ae(e, t) || se(e, t) || oe();
78
+ }
79
+ function se(e, t) {
80
+ if (e) {
81
+ if (typeof e == "string") return re(e, t);
82
+ var n = {}.toString.call(e).slice(8, -1);
83
+ return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? re(e, t) : void 0;
84
+ }
85
+ }
86
+ function ce(e) {
87
+ var t, n;
88
+ function r(t, n) {
89
+ try {
90
+ var a = e[t](n), o = a.value, s = o instanceof _;
91
+ Promise.resolve(s ? o.v : o).then(function(n) {
92
+ if (s) {
93
+ var c = t === "return" && o.k ? t : "next";
94
+ if (!o.k || n.done) return r(c, n);
95
+ n = e[c](n).value;
96
+ }
97
+ i(!!a.done, n);
98
+ }, function(e) {
99
+ r("throw", e);
100
+ });
101
+ } catch (e) {
102
+ i(2, e);
103
+ }
104
+ }
105
+ function i(e, i) {
106
+ e === 2 ? t.reject(i) : t.resolve({
107
+ value: i,
108
+ done: e
109
+ }), (t = t.next) ? r(t.key, t.arg) : n = null;
110
+ }
111
+ this._invoke = function(e, i) {
112
+ return new Promise(function(a, o) {
113
+ var s = {
114
+ key: e,
115
+ arg: i,
116
+ resolve: a,
117
+ reject: o,
118
+ next: null
119
+ };
120
+ n ? n = n.next = s : (t = n = s, r(e, i));
121
+ });
122
+ }, typeof e.return != "function" && (this.return = void 0);
123
+ }
124
+ ce.prototype[typeof Symbol == "function" && Symbol.asyncIterator || "@@asyncIterator"] = function() {
125
+ return this;
126
+ }, ce.prototype.next = function(e) {
127
+ return this._invoke("next", e);
128
+ }, ce.prototype.throw = function(e) {
129
+ return this._invoke("throw", e);
130
+ }, ce.prototype.return = function(e) {
131
+ return this._invoke("return", e);
132
+ };
133
+ var le = Object.entries, ue = Object.setPrototypeOf, de = Object.isFrozen, fe = Object.getPrototypeOf, pe = Object.getOwnPropertyDescriptor, y = Object.freeze, b = Object.seal, me = Object.create, he = typeof Reflect < "u" && Reflect, ge = he.apply, _e = he.construct;
134
+ y ||= function(e) {
135
+ return e;
136
+ }, b ||= function(e) {
137
+ return e;
138
+ }, ge ||= function(e, t) {
139
+ var n = [...arguments].slice(2);
140
+ return e.apply(t, n);
141
+ }, _e ||= function(e) {
142
+ return new e(...[...arguments].slice(1));
143
+ };
144
+ var ve = C(Array.prototype.forEach);
145
+ Array.prototype.indexOf;
146
+ var ye = C(Array.prototype.lastIndexOf), be = C(Array.prototype.pop), xe = C(Array.prototype.push);
147
+ Array.prototype.slice;
148
+ var Se = C(Array.prototype.splice), Ce = Array.isArray, we = C(String.prototype.toLowerCase), Te = C(String.prototype.toString), Ee = C(String.prototype.match), De = C(String.prototype.replace), Oe = C(String.prototype.indexOf), ke = C(String.prototype.trim), Ae = C(Number.prototype.toString), je = C(Boolean.prototype.toString), Me = typeof BigInt > "u" ? null : C(BigInt.prototype.toString), Ne = typeof Symbol > "u" ? null : C(Symbol.prototype.toString), x = C(Object.prototype.hasOwnProperty), Pe = C(Object.prototype.toString), S = C(RegExp.prototype.test), Fe = Ie(TypeError);
149
+ function C(e) {
150
+ return function(t) {
151
+ t instanceof RegExp && (t.lastIndex = 0);
152
+ var n = [...arguments].slice(1);
153
+ return ge(e, t, n);
154
+ };
155
+ }
156
+ function Ie(e) {
157
+ return function() {
158
+ return _e(e, [...arguments]);
159
+ };
160
+ }
161
+ function w(e, t) {
162
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : we;
163
+ if (ue && ue(e, null), !Ce(t)) return e;
164
+ let r = t.length;
165
+ for (; r--;) {
166
+ let i = t[r];
167
+ if (typeof i == "string") {
168
+ let e = n(i);
169
+ e !== i && (de(t) || (t[r] = e), i = e);
170
+ }
171
+ e[i] = !0;
172
+ }
173
+ return e;
174
+ }
175
+ function Le(e) {
176
+ for (let t = 0; t < e.length; t++) x(e, t) || (e[t] = null);
177
+ return e;
178
+ }
179
+ function T(e) {
180
+ let t = me(null);
181
+ for (let r of le(e)) {
182
+ var n = v(r, 2);
183
+ let i = n[0], a = n[1];
184
+ x(e, i) && (Ce(a) ? t[i] = Le(a) : a && typeof a == "object" && a.constructor === Object ? t[i] = T(a) : t[i] = a);
185
+ }
186
+ return t;
187
+ }
188
+ function Re(e) {
189
+ switch (typeof e) {
190
+ case "string": return e;
191
+ case "number": return Ae(e);
192
+ case "boolean": return je(e);
193
+ case "bigint": return Me ? Me(e) : "0";
194
+ case "symbol": return Ne ? Ne(e) : "Symbol()";
195
+ case "undefined": return Pe(e);
196
+ case "function":
197
+ case "object": {
198
+ if (e === null) return Pe(e);
199
+ let t = e, n = E(t, "toString");
200
+ if (typeof n == "function") {
201
+ let e = n(t);
202
+ return typeof e == "string" ? e : Pe(e);
203
+ }
204
+ return Pe(e);
205
+ }
206
+ default: return Pe(e);
207
+ }
208
+ }
209
+ function E(e, t) {
210
+ for (; e !== null;) {
211
+ let n = pe(e, t);
212
+ if (n) {
213
+ if (n.get) return C(n.get);
214
+ if (typeof n.value == "function") return C(n.value);
215
+ }
216
+ e = fe(e);
217
+ }
218
+ function n() {
219
+ return null;
220
+ }
221
+ return n;
222
+ }
223
+ function ze(e) {
224
+ try {
225
+ return S(e, ""), !0;
226
+ } catch {
227
+ return !1;
228
+ }
229
+ }
230
+ var Be = y(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), Ve = y(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), He = y([
231
+ "feBlend",
232
+ "feColorMatrix",
233
+ "feComponentTransfer",
234
+ "feComposite",
235
+ "feConvolveMatrix",
236
+ "feDiffuseLighting",
237
+ "feDisplacementMap",
238
+ "feDistantLight",
239
+ "feDropShadow",
240
+ "feFlood",
241
+ "feFuncA",
242
+ "feFuncB",
243
+ "feFuncG",
244
+ "feFuncR",
245
+ "feGaussianBlur",
246
+ "feImage",
247
+ "feMerge",
248
+ "feMergeNode",
249
+ "feMorphology",
250
+ "feOffset",
251
+ "fePointLight",
252
+ "feSpecularLighting",
253
+ "feSpotLight",
254
+ "feTile",
255
+ "feTurbulence"
256
+ ]), Ue = y([
257
+ "animate",
258
+ "color-profile",
259
+ "cursor",
260
+ "discard",
261
+ "font-face",
262
+ "font-face-format",
263
+ "font-face-name",
264
+ "font-face-src",
265
+ "font-face-uri",
266
+ "foreignobject",
267
+ "hatch",
268
+ "hatchpath",
269
+ "mesh",
270
+ "meshgradient",
271
+ "meshpatch",
272
+ "meshrow",
273
+ "missing-glyph",
274
+ "script",
275
+ "set",
276
+ "solidcolor",
277
+ "unknown",
278
+ "use"
279
+ ]), We = y(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), Ge = y([
280
+ "maction",
281
+ "maligngroup",
282
+ "malignmark",
283
+ "mlongdiv",
284
+ "mscarries",
285
+ "mscarry",
286
+ "msgroup",
287
+ "mstack",
288
+ "msline",
289
+ "msrow",
290
+ "semantics",
291
+ "annotation",
292
+ "annotation-xml",
293
+ "mprescripts",
294
+ "none"
295
+ ]), Ke = y(["#text"]), qe = y(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), Je = y(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), Ye = y(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), Xe = y([
296
+ "xlink:href",
297
+ "xml:id",
298
+ "xlink:title",
299
+ "xml:space",
300
+ "xmlns:xlink"
301
+ ]), Ze = b(/{{[\w\W]*|^[\w\W]*}}/g), Qe = b(/<%[\w\W]*|^[\w\W]*%>/g), $e = b(/\${[\w\W]*/g), et = b(/^data-[\-\w.\u00B7-\uFFFF]+$/), tt = b(/^aria-[\-\w]+$/), nt = b(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), rt = b(/^(?:\w+script|data):/i), it = b(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), at = b(/^html$/i), ot = b(/^[a-z][.\w]*(-[.\w]+)+$/i), st = b(/<[/\w!]/g), ct = b(/<[/\w]/g), lt = b(/<\/no(script|embed|frames)/i), ut = b(/\/>/i), D = {
302
+ element: 1,
303
+ attribute: 2,
304
+ text: 3,
305
+ cdataSection: 4,
306
+ entityReference: 5,
307
+ entityNode: 6,
308
+ processingInstruction: 7,
309
+ comment: 8,
310
+ document: 9,
311
+ documentType: 10,
312
+ documentFragment: 11,
313
+ notation: 12
314
+ }, dt = [
315
+ "style",
316
+ "script",
317
+ "xmp",
318
+ "iframe",
319
+ "noembed",
320
+ "noframes",
321
+ "plaintext",
322
+ "noscript"
323
+ ], ft = y(w({}, dt)), pt = function() {
324
+ let e = {};
325
+ return ve(dt, (t) => {
326
+ e[t] = b(RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
327
+ }), y(e);
328
+ }(), mt = function() {
329
+ return typeof window > "u" ? null : window;
330
+ }, ht = function(e, t) {
331
+ if (typeof e != "object" || typeof e.createPolicy != "function") return null;
332
+ let n = null, r = "data-tt-policy-suffix";
333
+ t && t.hasAttribute(r) && (n = t.getAttribute(r));
334
+ let i = "dompurify" + (n ? "#" + n : "");
335
+ try {
336
+ return e.createPolicy(i, {
337
+ createHTML(e) {
338
+ return e;
339
+ },
340
+ createScriptURL(e) {
341
+ return e;
342
+ }
343
+ });
344
+ } catch {
345
+ return console.warn("TrustedTypes policy " + i + " could not be created."), null;
346
+ }
347
+ }, gt = function() {
348
+ return {
349
+ afterSanitizeAttributes: [],
350
+ afterSanitizeElements: [],
351
+ afterSanitizeShadowDOM: [],
352
+ beforeSanitizeAttributes: [],
353
+ beforeSanitizeElements: [],
354
+ beforeSanitizeShadowDOM: [],
355
+ uponSanitizeAttribute: [],
356
+ uponSanitizeElement: [],
357
+ uponSanitizeShadowNode: []
358
+ };
359
+ }, _t = function(e, t, n, r) {
360
+ return x(e, t) && Ce(e[t]) ? w(r.base ? T(r.base) : {}, e[t], r.transform) : n;
361
+ }, vt = function(e, t, n) {
362
+ let r = x(e, t) ? e[t] : void 0;
363
+ return r && typeof r == "object" ? T(r) : n();
364
+ };
365
+ function yt() {
366
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : mt(), t = (e) => yt(e);
367
+ if (t.version = "3.4.16", t.removed = [], !e || !e.document || e.document.nodeType !== D.document || !e.Element) return t.isSupported = !1, t;
368
+ let n = e.document, r = n, i = r.currentScript;
369
+ e.DocumentFragment;
370
+ let a = e.HTMLTemplateElement, o = e.Node, s = e.Element, c = e.NodeFilter;
371
+ e.NamedNodeMap === void 0 && (e.NamedNodeMap || e.MozNamedAttrMap), e.HTMLFormElement;
372
+ let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f = E(d, "cloneNode"), p = E(d, "remove"), m = E(d, "removeAttributeNode"), h = E(d, "nextSibling"), g = E(d, "childNodes"), ee = E(d, "parentNode"), te = E(d, "shadowRoot"), ne = E(d, "attributes"), _ = o && o.prototype ? E(o.prototype, "nodeType") : null, re = o && o.prototype ? E(o.prototype, "nodeName") : null, ie = o && o.prototype ? E(o.prototype, "ownerDocument") : null, ae = function(e) {
373
+ return _ ? _(e) : e.nodeType;
374
+ }, oe = function(e) {
375
+ return re ? re(e) : e.nodeName;
376
+ };
377
+ if (typeof a == "function") {
378
+ let e = n.createElement("template");
379
+ e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
380
+ }
381
+ let v, se = "", ce, ue = !1, de = 0, fe = function() {
382
+ if (de > 0) throw Fe("A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted Types\" section of the README.");
383
+ }, pe = function(e) {
384
+ fe(), de++;
385
+ try {
386
+ return v.createHTML(e);
387
+ } finally {
388
+ de--;
389
+ }
390
+ }, he = function(e) {
391
+ fe(), de++;
392
+ try {
393
+ return v.createScriptURL(e);
394
+ } finally {
395
+ de--;
396
+ }
397
+ }, ge = function() {
398
+ return ue ||= (ce = ht(u, i), !0), ce;
399
+ }, _e = n, Ae = _e.implementation, je = _e.createNodeIterator, Me = _e.createDocumentFragment, Ne = _e.getElementsByTagName, Pe = r.importNode, C = gt();
400
+ t.isSupported = typeof le == "function" && typeof ee == "function" && Ae && Ae.createHTMLDocument !== void 0;
401
+ let Ie = Ze, Le = Qe, dt = $e, bt = et, xt = tt, St = rt, O = it, Ct = ot, k = nt, A = null, j = w({}, [
402
+ ...Be,
403
+ ...Ve,
404
+ ...He,
405
+ ...We,
406
+ ...Ke
407
+ ]), M = null, N = w({}, [
408
+ ...qe,
409
+ ...Je,
410
+ ...Ye,
411
+ ...Xe
412
+ ]), P = Object.seal(me(null, {
413
+ tagNameCheck: {
414
+ writable: !0,
415
+ configurable: !1,
416
+ enumerable: !0,
417
+ value: null
418
+ },
419
+ attributeNameCheck: {
420
+ writable: !0,
421
+ configurable: !1,
422
+ enumerable: !0,
423
+ value: null
424
+ },
425
+ allowCustomizedBuiltInElements: {
426
+ writable: !0,
427
+ configurable: !1,
428
+ enumerable: !0,
429
+ value: !1
430
+ }
431
+ })), wt = null, Tt = null, F = Object.seal(me(null, {
432
+ tagCheck: {
433
+ writable: !0,
434
+ configurable: !1,
435
+ enumerable: !0,
436
+ value: null
437
+ },
438
+ attributeCheck: {
439
+ writable: !0,
440
+ configurable: !1,
441
+ enumerable: !0,
442
+ value: null
443
+ }
444
+ })), Et = !0, Dt = !0, Ot = !1, kt = !0, I = !1, L = !0, At = !1, jt = !1, Mt = null, Nt = null, Pt = !1, R = !1, Ft = !1, It = !1, Lt = !0, Rt = !1, zt = "user-content-", Bt = !0, Vt = !1, Ht = {}, Ut = null, Wt = w({}, /* @__PURE__ */ "annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp".split(".")), Gt = null, Kt = w({}, [
445
+ "audio",
446
+ "video",
447
+ "img",
448
+ "source",
449
+ "image",
450
+ "track"
451
+ ]), qt = null, Jt = w({}, [
452
+ "alt",
453
+ "class",
454
+ "for",
455
+ "id",
456
+ "label",
457
+ "name",
458
+ "pattern",
459
+ "placeholder",
460
+ "role",
461
+ "summary",
462
+ "title",
463
+ "value",
464
+ "style",
465
+ "xmlns"
466
+ ]), Yt = "http://www.w3.org/1998/Math/MathML", Xt = "http://www.w3.org/2000/svg", z = "http://www.w3.org/1999/xhtml", Zt = z, Qt = !1, $t = null, en = w({}, [
467
+ Yt,
468
+ Xt,
469
+ z
470
+ ], Te), tn = y([
471
+ "mi",
472
+ "mo",
473
+ "mn",
474
+ "ms",
475
+ "mtext"
476
+ ]), nn = w({}, tn), rn = y(["annotation-xml"]), an = w({}, rn), on = w({}, [
477
+ "title",
478
+ "style",
479
+ "font",
480
+ "a",
481
+ "script"
482
+ ]), sn = null, cn = ["application/xhtml+xml", "text/html"], B = null, ln = null, un = n.createElement("form"), dn = function(e) {
483
+ return e instanceof RegExp || e instanceof Function;
484
+ }, fn = function() {
485
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
486
+ if (ln && ln === e) return;
487
+ (!e || typeof e != "object") && (e = {}), e = T(e), sn = cn.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, B = sn === "application/xhtml+xml" ? Te : we, A = _t(e, "ALLOWED_TAGS", j, { transform: B }), M = _t(e, "ALLOWED_ATTR", N, { transform: B }), $t = _t(e, "ALLOWED_NAMESPACES", en, { transform: Te }), qt = _t(e, "ADD_URI_SAFE_ATTR", Jt, {
488
+ transform: B,
489
+ base: Jt
490
+ }), Gt = _t(e, "ADD_DATA_URI_TAGS", Kt, {
491
+ transform: B,
492
+ base: Kt
493
+ }), Ut = _t(e, "FORBID_CONTENTS", Wt, { transform: B }), wt = _t(e, "FORBID_TAGS", T({}), { transform: B }), Tt = _t(e, "FORBID_ATTR", T({}), { transform: B }), Ht = x(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? T(e.USE_PROFILES) : e.USE_PROFILES : !1, Et = e.ALLOW_ARIA_ATTR !== !1, Dt = e.ALLOW_DATA_ATTR !== !1, Ot = e.ALLOW_UNKNOWN_PROTOCOLS || !1, kt = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, I = e.SAFE_FOR_TEMPLATES || !1, L = e.SAFE_FOR_XML !== !1, At = e.WHOLE_DOCUMENT || !1, R = e.RETURN_DOM || !1, Ft = e.RETURN_DOM_FRAGMENT || !1, It = e.RETURN_TRUSTED_TYPE || !1, Pt = e.FORCE_BODY || !1, Lt = e.SANITIZE_DOM !== !1, Rt = e.SANITIZE_NAMED_PROPS || !1, Bt = e.KEEP_CONTENT !== !1, Vt = e.IN_PLACE || !1, k = ze(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : nt, Zt = typeof e.NAMESPACE == "string" ? e.NAMESPACE : z, nn = vt(e, "MATHML_TEXT_INTEGRATION_POINTS", () => w({}, tn)), an = vt(e, "HTML_INTEGRATION_POINTS", () => w({}, rn));
494
+ let t = vt(e, "CUSTOM_ELEMENT_HANDLING", () => me(null));
495
+ if (P = me(null), x(t, "tagNameCheck") && dn(t.tagNameCheck) && (P.tagNameCheck = t.tagNameCheck), x(t, "attributeNameCheck") && dn(t.attributeNameCheck) && (P.attributeNameCheck = t.attributeNameCheck), x(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (P.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), b(P), I && (Dt = !1), Ft && (R = !0), Ht && (A = w({}, Ke), M = me(null), Ht.html === !0 && (w(A, Be), w(M, qe)), Ht.svg === !0 && (w(A, Ve), w(M, Je), w(M, Xe)), Ht.svgFilters === !0 && (w(A, He), w(M, Je), w(M, Xe)), Ht.mathMl === !0 && (w(A, We), w(M, Ye), w(M, Xe))), F.tagCheck = null, F.attributeCheck = null, x(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? F.tagCheck = e.ADD_TAGS : Ce(e.ADD_TAGS) && (A === j && (A = T(A)), w(A, e.ADD_TAGS, B))), x(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? F.attributeCheck = e.ADD_ATTR : Ce(e.ADD_ATTR) && (M === N && (M = T(M)), w(M, e.ADD_ATTR, B))), x(e, "ADD_FORBID_CONTENTS") && Ce(e.ADD_FORBID_CONTENTS) && (Ut === Wt && (Ut = T(Ut)), w(Ut, e.ADD_FORBID_CONTENTS, B)), Bt && (A["#text"] = !0), At && w(A, [
496
+ "html",
497
+ "head",
498
+ "body"
499
+ ]), A.table && (w(A, ["tbody"]), delete wt.tbody), e.TRUSTED_TYPES_POLICY) {
500
+ if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw Fe("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
501
+ if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Fe("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
502
+ let t = v;
503
+ v = e.TRUSTED_TYPES_POLICY;
504
+ try {
505
+ se = pe("");
506
+ } catch (e) {
507
+ throw v = t, e;
508
+ }
509
+ } else e.TRUSTED_TYPES_POLICY === null ? (v = void 0, se = "") : (v === void 0 && (v = ge()), v && typeof se == "string" && (se = pe("")));
510
+ y && y(e), ln = e;
511
+ }, pn = w({}, [
512
+ ...Ve,
513
+ ...He,
514
+ ...Ue
515
+ ]), mn = w({}, [...We, ...Ge]), hn = function(e, t, n) {
516
+ return t.namespaceURI === z ? e === "svg" : t.namespaceURI === Yt ? e === "svg" && (n === "annotation-xml" || nn[n]) : !!pn[e];
517
+ }, gn = function(e, t, n) {
518
+ return t.namespaceURI === z ? e === "math" : t.namespaceURI === Xt ? e === "math" && an[n] : !!mn[e];
519
+ }, _n = function(e, t, n) {
520
+ return t.namespaceURI === Xt && !an[n] || t.namespaceURI === Yt && !nn[n] ? !1 : !mn[e] && (on[e] || !pn[e]);
521
+ }, vn = function(e) {
522
+ let t = ee(e);
523
+ (!t || !t.tagName) && (t = {
524
+ namespaceURI: Zt,
525
+ tagName: "template"
526
+ });
527
+ let n = we(e.tagName), r = we(t.tagName);
528
+ return $t[e.namespaceURI] ? e.namespaceURI === Xt ? hn(n, t, r) : e.namespaceURI === Yt ? gn(n, t, r) : e.namespaceURI === z ? _n(n, t, r) : !!(sn === "application/xhtml+xml" && $t[e.namespaceURI]) : !1;
529
+ }, V = function(e) {
530
+ xe(t.removed, { element: e });
531
+ try {
532
+ ee(e).removeChild(e);
533
+ } catch {
534
+ if (p(e), !ee(e)) throw Fe("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
535
+ }
536
+ }, yn = function(e, t, n) {
537
+ try {
538
+ m(e, t);
539
+ } catch {
540
+ try {
541
+ e.removeAttribute(n);
542
+ } catch {}
543
+ }
544
+ }, bn = function(e) {
545
+ Sn(e);
546
+ let t = g(e);
547
+ if (t) {
548
+ let e = [];
549
+ ve(t, (t) => {
550
+ xe(e, t);
551
+ }), ve(e, (e) => {
552
+ try {
553
+ p(e);
554
+ } catch {}
555
+ });
556
+ }
557
+ let n = ne(e);
558
+ if (n) for (let t = n.length - 1; t >= 0; --t) {
559
+ let r = n[t], i = r && r.name;
560
+ typeof i == "string" && yn(e, r, i);
561
+ }
562
+ }, H = function(e, n, r) {
563
+ if (!r) try {
564
+ r = n.getAttributeNode(e);
565
+ } catch {
566
+ r = null;
567
+ }
568
+ xe(t.removed, {
569
+ attribute: r || null,
570
+ from: n
571
+ });
572
+ try {
573
+ r ? m(n, r) : n.removeAttribute(e);
574
+ } catch {
575
+ try {
576
+ n.removeAttribute(e);
577
+ } catch {}
578
+ }
579
+ if (e === "is") if (R || Ft) try {
580
+ V(n);
581
+ } catch {}
582
+ else try {
583
+ n.setAttribute(e, "");
584
+ } catch {}
585
+ }, xn = function(e) {
586
+ let t = ne(e);
587
+ if (t) for (let n = t.length - 1; n >= 0; --n) {
588
+ let r = t[n], i = r && r.name;
589
+ typeof i != "string" || M[B(i)] || yn(e, r, i);
590
+ }
591
+ }, Sn = function(e) {
592
+ let t = [e];
593
+ for (; t.length > 0;) {
594
+ let e = t.pop();
595
+ ae(e) === D.element && xn(e);
596
+ let n = g(e);
597
+ if (n) for (let e = n.length - 1; e >= 0; --e) t.push(n[e]);
598
+ }
599
+ }, U = function(e, t) {
600
+ return L ? e === "patchsrc" || e === "for" && t !== "label" && t !== "output" : !1;
601
+ }, Cn = function(e) {
602
+ if (!L) return;
603
+ let t = [e];
604
+ for (; t.length > 0;) {
605
+ let e = t.pop(), n = ae(e);
606
+ if (n === D.processingInstruction || n === D.comment && S(ct, e.data)) {
607
+ try {
608
+ p(e);
609
+ } catch {}
610
+ continue;
611
+ }
612
+ if (n === D.element) {
613
+ let t = e, n = B(oe(e));
614
+ try {
615
+ t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && U("for", n) && t.removeAttribute("for");
616
+ } catch {}
617
+ }
618
+ let r = g(e);
619
+ if (r) for (let e = r.length - 1; e >= 0; --e) t.push(r[e]);
620
+ }
621
+ }, wn = function(e) {
622
+ let t = null, r = null;
623
+ if (Pt) e = "<remove></remove>" + e;
624
+ else {
625
+ let t = Ee(e, /^[\r\n\t ]+/);
626
+ r = t && t[0];
627
+ }
628
+ sn === "application/xhtml+xml" && Zt === z && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
629
+ let i = v ? pe(e) : e;
630
+ if (Zt === z) try {
631
+ t = new l().parseFromString(i, sn);
632
+ } catch {}
633
+ if (!t || !t.documentElement) {
634
+ t = Ae.createDocument(Zt, "template", null);
635
+ try {
636
+ t.documentElement.innerHTML = Qt ? se : i;
637
+ } catch {}
638
+ }
639
+ let a = t.body || t.documentElement;
640
+ return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), Zt === z ? Ne.call(t, At ? "html" : "body")[0] : At ? t.documentElement : a;
641
+ }, W = function(e) {
642
+ let t = ie ? ie(e) : e.ownerDocument;
643
+ return je.call(t || e, e, c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION, null);
644
+ }, Tn = function(e) {
645
+ return e = De(e, Ie, " "), e = De(e, Le, " "), e = De(e, dt, " "), e;
646
+ }, En = function(e) {
647
+ e.normalize();
648
+ let t = ie ? ie(e) : e.ownerDocument, n = je.call(t || e, e, c.SHOW_TEXT | c.SHOW_COMMENT | c.SHOW_CDATA_SECTION | c.SHOW_PROCESSING_INSTRUCTION, null), r = n.nextNode();
649
+ for (; r;) r.data = Tn(r.data), r = n.nextNode();
650
+ let i = e.querySelectorAll?.call(e, "template");
651
+ i && ve(i, (e) => {
652
+ On(e.content) && En(e.content);
653
+ });
654
+ }, Dn = function(e) {
655
+ let t = re ? re(e) : null;
656
+ return typeof t != "string" || B(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== ne(e) || typeof e.removeAttribute != "function" || typeof e.removeAttributeNode != "function" || typeof e.getAttributeNode != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== _(e) || e.childNodes !== g(e);
657
+ }, On = function(e) {
658
+ if (!_ || typeof e != "object" || !e) return !1;
659
+ try {
660
+ return _(e) === D.documentFragment;
661
+ } catch {
662
+ return !1;
663
+ }
664
+ }, kn = function(e) {
665
+ if (!_ || typeof e != "object" || !e) return !1;
666
+ try {
667
+ return typeof _(e) == "number";
668
+ } catch {
669
+ return !1;
670
+ }
671
+ };
672
+ function G(e, n, r) {
673
+ e.length !== 0 && ve(e, (e) => {
674
+ e.call(t, n, r, ln);
675
+ });
676
+ }
677
+ let K = function(e, t) {
678
+ return !!(L && e.hasChildNodes() && !kn(e.firstElementChild) && S(st, e.textContent) && S(st, e.innerHTML) || L && e.namespaceURI === z && ft[t] && (kn(e.firstElementChild) || typeof e.textContent == "string" && S(pt[t], e.textContent)) || e.nodeType === D.processingInstruction || L && e.nodeType === D.comment && S(ct, e.data));
679
+ }, An = function(e, t) {
680
+ return e instanceof RegExp ? S(e, t) : e instanceof Function && !!e(t, ...[...arguments].slice(2));
681
+ }, jn = function(e, t, n) {
682
+ if (!wt[t] && Nn(t) && An(P.tagNameCheck, t)) return !1;
683
+ if (Bt && !Ut[t]) {
684
+ let t = ee(e), r = g(e);
685
+ if (r && t) {
686
+ let i = r.length;
687
+ for (let a = i - 1; a >= 0; --a) {
688
+ let i = e === n ? f(r[a], !0) : r[a];
689
+ t.insertBefore(i, h(e));
690
+ }
691
+ }
692
+ }
693
+ return V(e), !0;
694
+ }, q = function(e, t, n, r) {
695
+ return e.length === 0 ? t : t === n || t === r ? T(t) : t;
696
+ }, J = function(e, t) {
697
+ return e === t || ee(e) !== null ? !1 : (Vt && Sn(e), !0);
698
+ }, Y = function(e, n) {
699
+ if (G(C.beforeSanitizeElements, e, null), J(e, n)) return !0;
700
+ if (Dn(e)) return V(e), !0;
701
+ let r = B(oe(e));
702
+ if (A = q(C.uponSanitizeElement, A, j, Mt), G(C.uponSanitizeElement, e, {
703
+ tagName: r,
704
+ allowedTags: A
705
+ }), J(e, n)) return !0;
706
+ if (K(e, r)) return V(e), !0;
707
+ if (wt[r] || !(F.tagCheck instanceof Function && F.tagCheck(r)) && !A[r]) {
708
+ let t = jn(e, r, n);
709
+ return t === !1 && (G(C.afterSanitizeElements, e, null), J(e, n)) ? !0 : t;
710
+ }
711
+ if (ae(e) === D.element && !vn(e) || (r === "noscript" || r === "noembed" || r === "noframes") && S(lt, e.innerHTML)) return V(e), !0;
712
+ if (I && e.nodeType === D.text) {
713
+ let n = Tn(e.textContent);
714
+ e.textContent !== n && (xe(t.removed, { element: e.cloneNode() }), e.textContent = n);
715
+ }
716
+ return G(C.afterSanitizeElements, e, null), J(e, n);
717
+ }, X = function(e, t, r) {
718
+ if (Tt[t] || U(t, e) || Lt && (t === "id" || t === "name") && (r in n || r in un)) return !1;
719
+ let i = M[t] || F.attributeCheck instanceof Function && F.attributeCheck(t, e);
720
+ return Dt && S(bt, t) || Et && S(xt, t) ? !0 : i ? qt[t] || S(k, De(r, O, "")) || (t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Oe(r, "data:") === 0 && Gt[e] || Ot && !S(St, De(r, O, "")) ? !0 : !r : Nn(e) && An(P.tagNameCheck, e) && An(P.attributeNameCheck, t, e) || t === "is" && P.allowCustomizedBuiltInElements && An(P.tagNameCheck, r);
721
+ }, Mn = w({}, [
722
+ "annotation-xml",
723
+ "color-profile",
724
+ "font-face",
725
+ "font-face-format",
726
+ "font-face-name",
727
+ "font-face-src",
728
+ "font-face-uri",
729
+ "missing-glyph"
730
+ ]), Nn = function(e) {
731
+ return !Mn[we(e)] && S(Ct, e);
732
+ }, Pn = function(e, t, n, r) {
733
+ if (v && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
734
+ case "TrustedHTML": return pe(r);
735
+ case "TrustedScriptURL": return he(r);
736
+ }
737
+ return r;
738
+ }, Fn = function(e, t, n, r) {
739
+ try {
740
+ return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), Dn(e) ? (V(e), !1) : !0;
741
+ } catch {
742
+ return H(t, e), !1;
743
+ }
744
+ }, In = function(e, n) {
745
+ if (G(C.beforeSanitizeAttributes, e, null), J(e, n)) return;
746
+ let r = e.attributes;
747
+ if (!r || Dn(e)) return;
748
+ M = q(C.uponSanitizeAttribute, M, N, Nt);
749
+ let i = {
750
+ attrName: "",
751
+ attrValue: "",
752
+ keepAttr: !0,
753
+ allowedAttributes: M,
754
+ forceKeepAttr: void 0
755
+ }, a = r.length, o = B(e.nodeName);
756
+ for (; a--;) {
757
+ let n = r[a], s = n.name, c = n.namespaceURI, l = n.value, u = B(s), d = l, f = s === "value" ? d : ke(d), p = !1;
758
+ if (i.attrName = u, i.attrValue = f, i.keepAttr = !0, i.forceKeepAttr = void 0, G(C.uponSanitizeAttribute, e, i), f = i.attrValue, Rt && (u === "id" || u === "name") && Oe(f, zt) !== 0 && (H(s, e, n), f = zt + f, p = !0), L && S(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, f)) {
759
+ H(s, e, n);
760
+ continue;
761
+ }
762
+ if (u === "attributename" && Ee(f, "href")) {
763
+ H(s, e, n);
764
+ continue;
765
+ }
766
+ if (!i.forceKeepAttr) {
767
+ if (!i.keepAttr) {
768
+ H(s, e, n);
769
+ continue;
770
+ }
771
+ if (!kt && S(ut, f)) {
772
+ H(s, e, n);
773
+ continue;
774
+ }
775
+ if (I && (f = Tn(f)), !X(o, u, f)) {
776
+ H(s, e, n);
777
+ continue;
778
+ }
779
+ f = Pn(o, u, c, f), f !== d && Fn(e, s, c, f) && p && be(t.removed);
780
+ }
781
+ }
782
+ G(C.afterSanitizeAttributes, e, null), J(e, n);
783
+ }, Z = function(e) {
784
+ let t = null, n = W(e);
785
+ for (G(C.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (G(C.uponSanitizeShadowNode, t, null), Y(t, e), In(t, e), On(t.content) && Z(t.content), ae(t) === D.element) {
786
+ let e = te(t);
787
+ On(e) && (Ln(e), Z(e));
788
+ }
789
+ G(C.afterSanitizeShadowDOM, e, null);
790
+ }, Ln = function(e) {
791
+ let t = [{
792
+ node: e,
793
+ shadow: null
794
+ }];
795
+ for (; t.length > 0;) {
796
+ let e = t.pop();
797
+ if (e.shadow) {
798
+ Z(e.shadow);
799
+ continue;
800
+ }
801
+ let n = e.node, r = ae(n) === D.element, i = g(n);
802
+ if (i) for (let e = i.length - 1; e >= 0; --e) t.push({
803
+ node: i[e],
804
+ shadow: null
805
+ });
806
+ if (r) {
807
+ let e = re ? re(n) : null;
808
+ if (typeof e == "string" && B(e) === "template") {
809
+ let e = n.content;
810
+ On(e) && t.push({
811
+ node: e,
812
+ shadow: null
813
+ });
814
+ }
815
+ }
816
+ if (r) {
817
+ let e = te(n);
818
+ On(e) && t.push({
819
+ node: null,
820
+ shadow: e
821
+ }, {
822
+ node: e,
823
+ shadow: null
824
+ });
825
+ }
826
+ }
827
+ };
828
+ return t.sanitize = function(e) {
829
+ let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, a = null, o = null, s = null;
830
+ if (Qt = !e, Qt && (e = "<!-->"), typeof e != "string" && !kn(e) && (e = Re(e), typeof e != "string")) throw Fe("dirty is not a string, aborting");
831
+ if (!t.isSupported) return e;
832
+ jt ? (A = Mt, M = Nt) : fn(n), (C.uponSanitizeElement.length > 0 || C.uponSanitizeAttribute.length > 0) && (A = T(A)), C.uponSanitizeAttribute.length > 0 && (M = T(M)), t.removed = [];
833
+ let c = Vt && typeof e != "string" && kn(e);
834
+ if (c) {
835
+ Cn(e);
836
+ let t = oe(e);
837
+ if (typeof t == "string") {
838
+ let n = B(t);
839
+ if (!A[n] || wt[n]) throw bn(e), Fe("root node is forbidden and cannot be sanitized in-place");
840
+ }
841
+ if (Dn(e)) throw bn(e), Fe("root node is clobbered and cannot be sanitized in-place");
842
+ try {
843
+ Ln(e);
844
+ } catch (t) {
845
+ throw bn(e), t;
846
+ }
847
+ } else if (kn(e)) i = wn("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType === D.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), Ln(i);
848
+ else {
849
+ if (!R && !I && !At && e.indexOf("<") === -1) return v && It ? pe(e) : e;
850
+ if (i = wn(e), !i) return R ? null : It ? se : "";
851
+ }
852
+ i && Pt && V(i.firstChild);
853
+ let l = c ? e : i;
854
+ try {
855
+ let e = W(l);
856
+ for (; o = e.nextNode();) Y(o, l), In(o, l), On(o.content) && Z(o.content);
857
+ } catch (n) {
858
+ throw c && (bn(e), ve(t.removed, (e) => {
859
+ e.element && Sn(e.element);
860
+ })), n;
861
+ }
862
+ if (c) {
863
+ let n = !1;
864
+ if (ve(t.removed, (t) => {
865
+ t.element && (t.element === e && (n = !0), Sn(t.element));
866
+ }), n) throw Fe("a node selected for removal could not be safely returned; refusing to sanitize in place");
867
+ return I && En(e), e;
868
+ }
869
+ if (R) {
870
+ if (I && En(i), Ft) for (s = Me.call(i.ownerDocument); i.firstChild;) s.appendChild(i.firstChild);
871
+ else s = i;
872
+ return (M.shadowroot || M.shadowrootmode) && (s = Pe.call(r, s, !0)), s;
873
+ }
874
+ let u = At ? i.outerHTML : i.innerHTML;
875
+ return At && A["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && S(at, i.ownerDocument.doctype.name) && (u = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + u), I && (u = Tn(u)), v && It ? pe(u) : u;
876
+ }, t.setConfig = function() {
877
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
878
+ fn(e), jt = !0, Mt = A, Nt = M;
879
+ }, t.clearConfig = function() {
880
+ ln = null, jt = !1, Mt = null, Nt = null, v = ce, se = "";
881
+ }, t.isValidAttribute = function(e, t, n) {
882
+ ln || fn({});
883
+ let r = B(e), i = B(t);
884
+ return X(r, i, n);
885
+ }, t.addHook = function(e, t) {
886
+ typeof t == "function" && x(C, e) && xe(C[e], t);
887
+ }, t.removeHook = function(e, t) {
888
+ if (x(C, e)) {
889
+ if (t !== void 0) {
890
+ let n = ye(C[e], t);
891
+ return n === -1 ? void 0 : Se(C[e], n, 1)[0];
892
+ }
893
+ return be(C[e]);
894
+ }
895
+ }, t.removeHooks = function(e) {
896
+ x(C, e) && (C[e] = []);
897
+ }, t.removeAllHooks = function() {
898
+ C = gt();
899
+ }, t;
900
+ }
901
+ var bt = yt(), xt;
902
+ function St() {
903
+ return {
904
+ async: !1,
905
+ breaks: !1,
906
+ extensions: null,
907
+ gfm: !0,
908
+ hooks: null,
909
+ pedantic: !1,
910
+ renderer: null,
911
+ silent: !1,
912
+ tokenizer: null,
913
+ walkTokens: null
914
+ };
915
+ }
916
+ var O = St();
917
+ function Ct(e) {
918
+ O = e;
919
+ }
920
+ var k = { exec: () => null };
921
+ function A(e) {
922
+ let t = [];
923
+ return (n) => {
924
+ let r = Math.max(0, Math.min(3, n - 1)), i = t[r];
925
+ return i || (i = e(r), t[r] = i), i;
926
+ };
927
+ }
928
+ function j(e, t = "") {
929
+ let n = typeof e == "string" ? e : e.source, r = {
930
+ replace: (e, t) => {
931
+ let i = typeof t == "string" ? t : t.source;
932
+ return i = i.replace(N.caret, "$1"), n = n.replace(e, i), r;
933
+ },
934
+ getRegex: () => new RegExp(n, t)
935
+ };
936
+ return r;
937
+ }
938
+ var M = ((e = "") => {
939
+ try {
940
+ return !!RegExp("(?<=1)(?<!1)" + e);
941
+ } catch {
942
+ return !1;
943
+ }
944
+ })(), N = {
945
+ codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
946
+ outputLinkReplace: /\\([\[\]])/g,
947
+ indentCodeCompensation: /^(\s+)(?:```)/,
948
+ beginningSpace: /^\s+/,
949
+ endingHash: /#$/,
950
+ startingSpaceChar: /^ /,
951
+ endingSpaceChar: / $/,
952
+ nonSpaceChar: /[^ ]/,
953
+ newLineCharGlobal: /\n/g,
954
+ tabCharGlobal: /\t/g,
955
+ multipleSpaceGlobal: /\s+/g,
956
+ blankLine: /^[ \t]*$/,
957
+ doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
958
+ blockquoteStart: /^ {0,3}>/,
959
+ blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
960
+ blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
961
+ listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
962
+ listIsTask: /^\[[ xX]\] +\S/,
963
+ listReplaceTask: /^\[[ xX]\] +/,
964
+ listTaskCheckbox: /\[[ xX]\]/,
965
+ anyLine: /\n.*\n/,
966
+ hrefBrackets: /^<(.*)>$/,
967
+ tableDelimiter: /[:|]/,
968
+ tableAlignChars: /^\||\| *$/g,
969
+ tableRowBlankLine: /\n[ \t]*$/,
970
+ tableAlignRight: /^ *-+: *$/,
971
+ tableAlignCenter: /^ *:-+: *$/,
972
+ tableAlignLeft: /^ *:-+ *$/,
973
+ startATag: /^<a /i,
974
+ endATag: /^<\/a>/i,
975
+ startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i,
976
+ endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i,
977
+ startAngleBracket: /^</,
978
+ endAngleBracket: />$/,
979
+ pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
980
+ unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
981
+ escapeTest: /[&<>"']/,
982
+ escapeReplace: /[&<>"']/g,
983
+ escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
984
+ escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
985
+ caret: /(^|[^\[])\^/g,
986
+ percentDecode: /%25/g,
987
+ findPipe: /\|/g,
988
+ splitPipe: / \|/,
989
+ slashPipe: /\\\|/g,
990
+ carriageReturn: /\r\n|\r/g,
991
+ spaceLine: /^ +$/gm,
992
+ notSpaceStart: /^\S*/,
993
+ endingNewline: /\n$/,
994
+ listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
995
+ nextBulletRegex: A((e) => RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
996
+ hrRegex: A((e) => RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),
997
+ fencesBeginRegex: A((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
998
+ headingBeginRegex: A((e) => RegExp(`^ {0,${e}}#`)),
999
+ htmlBeginRegex: A((e) => RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`, "i")),
1000
+ blockquoteBeginRegex: A((e) => RegExp(`^ {0,${e}}>`))
1001
+ }, P = /^(?:[ \t]*(?:\n|$))+/, wt = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Tt = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, F = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Et = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Dt = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Ot = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, kt = j(Ot).replace(/bull/g, Dt).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), I = j(Ot).replace(/bull/g, Dt).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), L = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, At = /^[^\n]+/, jt = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Mt = j(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", jt).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Nt = j(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, Dt).getRegex(), Pt = "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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", R = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Ft = j("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", R).replace("tag", Pt).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), It = j(L).replace("hr", F).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Pt).getRegex(), Lt = {
1002
+ blockquote: j(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", It).getRegex(),
1003
+ code: wt,
1004
+ def: Mt,
1005
+ fences: Tt,
1006
+ heading: Et,
1007
+ hr: F,
1008
+ html: Ft,
1009
+ lheading: kt,
1010
+ list: Nt,
1011
+ newline: P,
1012
+ paragraph: It,
1013
+ table: k,
1014
+ text: At
1015
+ }, Rt = j("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", F).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Pt).getRegex(), zt = {
1016
+ ...Lt,
1017
+ lheading: I,
1018
+ table: Rt,
1019
+ paragraph: j(L).replace("hr", F).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Rt).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Pt).getRegex()
1020
+ }, Bt = {
1021
+ ...Lt,
1022
+ html: j("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", R).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
1023
+ def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
1024
+ heading: /^(#{1,6})(.*)(?:\n+|$)/,
1025
+ fences: k,
1026
+ lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
1027
+ paragraph: j(L).replace("hr", F).replace("heading", " *#{1,6} *[^\n]").replace("lheading", kt).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
1028
+ }, Vt = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ht = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Ut = /^( {2,}|\\)\n(?!\s*$)/, Wt = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Gt = /[\p{P}\p{S}]/u, Kt = /[\s\p{P}\p{S}]/u, qt = /[^\s\p{P}\p{S}]/u, Jt = j(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Kt).getRegex(), Yt = /(?!~)[\p{P}\p{S}]/u, Xt = /(?!~)[\s\p{P}\p{S}]/u, z = /(?:[^\s\p{P}\p{S}]|~)/u, Zt = j(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", M ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Qt = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, $t = j(Qt, "u").replace(/punct/g, Gt).getRegex(), en = j(Qt, "u").replace(/punct/g, Yt).getRegex(), tn = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", nn = j(tn, "gu").replace(/notPunctSpace/g, qt).replace(/punctSpace/g, Kt).replace(/punct/g, Gt).getRegex(), rn = j(tn, "gu").replace(/notPunctSpace/g, z).replace(/punctSpace/g, Xt).replace(/punct/g, Yt).getRegex(), an = j("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, qt).replace(/punctSpace/g, Kt).replace(/punct/g, Gt).getRegex(), on = j(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Gt).getRegex(), sn = j("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, qt).replace(/punctSpace/g, Kt).replace(/punct/g, Gt).getRegex(), cn = j(/\\(punct)/, "gu").replace(/punct/g, Gt).getRegex(), B = j(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[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])?)+(?![-_])/).getRegex(), ln = j(R).replace("(?:-->|$)", "-->").getRegex(), un = j("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", ln).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), dn = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, fn = j(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", dn).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), pn = j(/^!?\[(label)\]\[(ref)\]/).replace("label", dn).replace("ref", jt).getRegex(), mn = j(/^!?\[(ref)\](?:\[\])?/).replace("ref", jt).getRegex(), hn = j("reflink|nolink(?!\\()", "g").replace("reflink", pn).replace("nolink", mn).getRegex(), gn = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, _n = {
1029
+ _backpedal: k,
1030
+ anyPunctuation: cn,
1031
+ autolink: B,
1032
+ blockSkip: Zt,
1033
+ br: Ut,
1034
+ code: Ht,
1035
+ del: k,
1036
+ delLDelim: k,
1037
+ delRDelim: k,
1038
+ emStrongLDelim: $t,
1039
+ emStrongRDelimAst: nn,
1040
+ emStrongRDelimUnd: an,
1041
+ escape: Vt,
1042
+ link: fn,
1043
+ nolink: mn,
1044
+ punctuation: Jt,
1045
+ reflink: pn,
1046
+ reflinkSearch: hn,
1047
+ tag: un,
1048
+ text: Wt,
1049
+ url: k
1050
+ }, vn = {
1051
+ ..._n,
1052
+ link: j(/^!?\[(label)\]\((.*?)\)/).replace("label", dn).getRegex(),
1053
+ reflink: j(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", dn).getRegex()
1054
+ }, V = {
1055
+ ..._n,
1056
+ emStrongRDelimAst: rn,
1057
+ emStrongLDelim: en,
1058
+ delLDelim: on,
1059
+ delRDelim: sn,
1060
+ url: j(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", gn).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
1061
+ _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
1062
+ del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
1063
+ text: j(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", gn).getRegex()
1064
+ }, yn = {
1065
+ ...V,
1066
+ br: j(Ut).replace("{2,}", "*").getRegex(),
1067
+ text: j(V.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
1068
+ }, bn = {
1069
+ normal: Lt,
1070
+ gfm: zt,
1071
+ pedantic: Bt
1072
+ }, H = {
1073
+ normal: _n,
1074
+ gfm: V,
1075
+ breaks: yn,
1076
+ pedantic: vn
1077
+ }, xn = {
1078
+ "&": "&amp;",
1079
+ "<": "&lt;",
1080
+ ">": "&gt;",
1081
+ "\"": "&quot;",
1082
+ "'": "&#39;"
1083
+ }, Sn = (e) => xn[e];
1084
+ function U(e, t) {
1085
+ if (t) {
1086
+ if (N.escapeTest.test(e)) return e.replace(N.escapeReplace, Sn);
1087
+ } else if (N.escapeTestNoEncode.test(e)) return e.replace(N.escapeReplaceNoEncode, Sn);
1088
+ return e;
1089
+ }
1090
+ function Cn(e) {
1091
+ try {
1092
+ e = encodeURI(e).replace(N.percentDecode, "%");
1093
+ } catch {
1094
+ return null;
1095
+ }
1096
+ return e;
1097
+ }
1098
+ function wn(e, t) {
1099
+ let n = e.replace(N.findPipe, (e, t, n) => {
1100
+ let r = !1, i = t;
1101
+ for (; --i >= 0 && n[i] === "\\";) r = !r;
1102
+ return r ? "|" : " |";
1103
+ }).split(N.splitPipe), r = 0;
1104
+ if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) if (n.length > t) n.splice(t);
1105
+ else for (; n.length < t;) n.push("");
1106
+ for (; r < n.length; r++) n[r] = n[r].trim().replace(N.slashPipe, "|");
1107
+ return n;
1108
+ }
1109
+ function W(e, t, n) {
1110
+ let r = e.length;
1111
+ if (r === 0) return "";
1112
+ let i = 0;
1113
+ for (; i < r;) {
1114
+ let a = e.charAt(r - i - 1);
1115
+ if (a === t && !n) i++;
1116
+ else if (a !== t && n) i++;
1117
+ else break;
1118
+ }
1119
+ return e.slice(0, r - i);
1120
+ }
1121
+ function Tn(e) {
1122
+ let t = e.split("\n"), n = t.length - 1;
1123
+ for (; n >= 0 && N.blankLine.test(t[n]);) n--;
1124
+ return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
1125
+ }
1126
+ function En(e, t) {
1127
+ if (e.indexOf(t[1]) === -1) return -1;
1128
+ let n = 0;
1129
+ for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
1130
+ else if (e[r] === t[0]) n++;
1131
+ else if (e[r] === t[1] && (n--, n < 0)) return r;
1132
+ return n > 0 ? -2 : -1;
1133
+ }
1134
+ function Dn(e, t = 0) {
1135
+ let n = t, r = "";
1136
+ for (let t of e) if (t === " ") {
1137
+ let e = 4 - n % 4;
1138
+ r += " ".repeat(e), n += e;
1139
+ } else r += t, n++;
1140
+ return r;
1141
+ }
1142
+ function On(e, t, n, r, i) {
1143
+ let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1");
1144
+ r.state.inLink = !0;
1145
+ let c = {
1146
+ type: e[0].charAt(0) === "!" ? "image" : "link",
1147
+ raw: n,
1148
+ href: a,
1149
+ title: o,
1150
+ text: s,
1151
+ tokens: r.inlineTokens(s)
1152
+ };
1153
+ return r.state.inLink = !1, c;
1154
+ }
1155
+ function kn(e, t, n) {
1156
+ let r = e.match(n.other.indentCodeCompensation);
1157
+ if (r === null) return t;
1158
+ let i = r[1];
1159
+ return t.split("\n").map((e) => {
1160
+ let t = e.match(n.other.beginningSpace);
1161
+ if (t === null) return e;
1162
+ let [r] = t;
1163
+ return r.length >= i.length ? e.slice(i.length) : e;
1164
+ }).join("\n");
1165
+ }
1166
+ var G = class {
1167
+ constructor(e) {
1168
+ s(this, "options", void 0), s(this, "rules", void 0), s(this, "lexer", void 0), this.options = e || O;
1169
+ }
1170
+ space(e) {
1171
+ let t = this.rules.block.newline.exec(e);
1172
+ if (t && t[0].length > 0) return {
1173
+ type: "space",
1174
+ raw: t[0]
1175
+ };
1176
+ }
1177
+ code(e) {
1178
+ let t = this.rules.block.code.exec(e);
1179
+ if (t) {
1180
+ let e = this.options.pedantic ? t[0] : Tn(t[0]);
1181
+ return {
1182
+ type: "code",
1183
+ raw: e,
1184
+ codeBlockStyle: "indented",
1185
+ text: e.replace(this.rules.other.codeRemoveIndent, "")
1186
+ };
1187
+ }
1188
+ }
1189
+ fences(e) {
1190
+ let t = this.rules.block.fences.exec(e);
1191
+ if (t) {
1192
+ let e = t[0], n = kn(e, t[3] || "", this.rules);
1193
+ return {
1194
+ type: "code",
1195
+ raw: e,
1196
+ lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
1197
+ text: n
1198
+ };
1199
+ }
1200
+ }
1201
+ heading(e) {
1202
+ let t = this.rules.block.heading.exec(e);
1203
+ if (t) {
1204
+ let e = t[2].trim();
1205
+ if (this.rules.other.endingHash.test(e)) {
1206
+ let t = W(e, "#");
1207
+ (this.options.pedantic || !t || this.rules.other.endingSpaceChar.test(t)) && (e = t.trim());
1208
+ }
1209
+ return {
1210
+ type: "heading",
1211
+ raw: W(t[0], "\n"),
1212
+ depth: t[1].length,
1213
+ text: e,
1214
+ tokens: this.lexer.inline(e)
1215
+ };
1216
+ }
1217
+ }
1218
+ hr(e) {
1219
+ let t = this.rules.block.hr.exec(e);
1220
+ if (t) return {
1221
+ type: "hr",
1222
+ raw: W(t[0], "\n")
1223
+ };
1224
+ }
1225
+ blockquote(e) {
1226
+ let t = this.rules.block.blockquote.exec(e);
1227
+ if (t) {
1228
+ let e = W(t[0], "\n").split("\n"), n = "", r = "", i = [];
1229
+ for (; e.length > 0;) {
1230
+ let t = !1, a = [], o;
1231
+ for (o = 0; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
1232
+ else if (!t) a.push(e[o]);
1233
+ else break;
1234
+ e = e.slice(o);
1235
+ let s = a.join("\n"), c = s.replace(this.rules.other.blockquoteSetextReplace, "\n $1").replace(this.rules.other.blockquoteSetextReplace2, "");
1236
+ n = n ? `${n}
1237
+ ${s}` : s, r = r ? `${r}
1238
+ ${c}` : c;
1239
+ let l = this.lexer.state.top;
1240
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(c, i, !0), this.lexer.state.top = l, e.length === 0) break;
1241
+ let u = i.at(-1);
1242
+ if (u?.type === "code") break;
1243
+ if (u?.type === "blockquote") {
1244
+ let t = u, a = t.raw + "\n" + e.join("\n"), o = this.blockquote(a);
1245
+ i[i.length - 1] = o, n = n.substring(0, n.length - t.raw.length) + o.raw, r = r.substring(0, r.length - t.text.length) + o.text;
1246
+ break;
1247
+ } else if (u?.type === "list") {
1248
+ let t = u, a = t.raw + "\n" + e.join("\n"), o = this.list(a);
1249
+ i[i.length - 1] = o, n = n.substring(0, n.length - u.raw.length) + o.raw, r = r.substring(0, r.length - t.raw.length) + o.raw, e = a.substring(i.at(-1).raw.length).split("\n");
1250
+ continue;
1251
+ }
1252
+ }
1253
+ return {
1254
+ type: "blockquote",
1255
+ raw: n,
1256
+ tokens: i,
1257
+ text: r
1258
+ };
1259
+ }
1260
+ }
1261
+ list(e) {
1262
+ let t = this.rules.block.list.exec(e);
1263
+ if (t) {
1264
+ let n = t[1].trim(), r = n.length > 1, i = {
1265
+ type: "list",
1266
+ raw: "",
1267
+ ordered: r,
1268
+ start: r ? +n.slice(0, -1) : "",
1269
+ loose: !1,
1270
+ items: []
1271
+ };
1272
+ n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
1273
+ let a = this.rules.other.listItemRegex(n), o = !1;
1274
+ for (; e;) {
1275
+ let n = !1, r = "", s = "";
1276
+ if (!(t = a.exec(e)) || this.rules.block.hr.test(e)) break;
1277
+ r = t[0], e = e.substring(r.length);
1278
+ let c = Dn(t[2].split("\n", 1)[0], t[1].length), l = e.split("\n", 1)[0], u = !c.trim(), d = 0;
1279
+ if (this.options.pedantic ? (d = 2, s = c.trimStart()) : u ? d = t[1].length + 1 : (d = c.search(this.rules.other.nonSpaceChar), d = d > 4 ? 1 : d, s = c.slice(d), d += t[1].length), u && this.rules.other.blankLine.test(l) && (r += l + "\n", e = e.substring(l.length + 1), n = !0), !n) {
1280
+ let t = this.rules.other.nextBulletRegex(d), n = this.rules.other.hrRegex(d), i = this.rules.other.fencesBeginRegex(d), a = this.rules.other.headingBeginRegex(d), o = this.rules.other.htmlBeginRegex(d), f = this.rules.other.blockquoteBeginRegex(d);
1281
+ for (; e;) {
1282
+ let p = e.split("\n", 1)[0], m;
1283
+ if (l = p, this.options.pedantic ? (l = l.replace(this.rules.other.listReplaceNesting, " "), m = l) : m = l.replace(this.rules.other.tabCharGlobal, " "), i.test(l) || a.test(l) || o.test(l) || f.test(l) || t.test(l) || n.test(l)) break;
1284
+ if (m.search(this.rules.other.nonSpaceChar) >= d || !l.trim()) s += "\n" + m.slice(d);
1285
+ else {
1286
+ if (u || c.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || i.test(c) || a.test(c) || n.test(c)) break;
1287
+ s += "\n" + l;
1288
+ }
1289
+ u = !l.trim(), r += p + "\n", e = e.substring(p.length + 1), c = m.slice(d);
1290
+ }
1291
+ }
1292
+ i.loose || (o ? i.loose = !0 : this.rules.other.doubleBlankLine.test(r) && (o = !0)), i.items.push({
1293
+ type: "list_item",
1294
+ raw: r,
1295
+ task: !!this.options.gfm && this.rules.other.listIsTask.test(s),
1296
+ loose: !1,
1297
+ text: s,
1298
+ tokens: []
1299
+ }), i.raw += r;
1300
+ }
1301
+ let s = i.items.at(-1);
1302
+ if (s) s.raw = s.raw.trimEnd(), s.text = s.text.trimEnd();
1303
+ else return;
1304
+ i.raw = i.raw.trimEnd();
1305
+ for (let e of i.items) {
1306
+ this.lexer.state.top = !1, e.tokens = this.lexer.blockTokens(e.text, []);
1307
+ let t = e.tokens[0];
1308
+ if (e.task && (t?.type === "text" || t?.type === "paragraph")) {
1309
+ e.text = e.text.replace(this.rules.other.listReplaceTask, ""), t.raw = t.raw.replace(this.rules.other.listReplaceTask, ""), t.text = t.text.replace(this.rules.other.listReplaceTask, "");
1310
+ for (let e = this.lexer.inlineQueue.length - 1; e >= 0; e--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)) {
1311
+ this.lexer.inlineQueue[e].src = this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask, "");
1312
+ break;
1313
+ }
1314
+ let n = this.rules.other.listTaskCheckbox.exec(e.raw);
1315
+ if (n) {
1316
+ let t = {
1317
+ type: "checkbox",
1318
+ raw: n[0] + " ",
1319
+ checked: n[0] !== "[ ]"
1320
+ };
1321
+ e.checked = t.checked, i.loose ? e.tokens[0] && ["paragraph", "text"].includes(e.tokens[0].type) && "tokens" in e.tokens[0] && e.tokens[0].tokens ? (e.tokens[0].raw = t.raw + e.tokens[0].raw, e.tokens[0].text = t.raw + e.tokens[0].text, e.tokens[0].tokens.unshift(t)) : e.tokens.unshift({
1322
+ type: "paragraph",
1323
+ raw: t.raw,
1324
+ text: t.raw,
1325
+ tokens: [t]
1326
+ }) : e.tokens.unshift(t);
1327
+ }
1328
+ } else e.task &&= !1;
1329
+ if (!i.loose) {
1330
+ let t = e.tokens.filter((e) => e.type === "space");
1331
+ i.loose = t.length > 0 && t.some((e) => this.rules.other.anyLine.test(e.raw));
1332
+ }
1333
+ }
1334
+ if (i.loose) for (let e of i.items) {
1335
+ e.loose = !0;
1336
+ for (let t of e.tokens) t.type === "text" && (t.type = "paragraph");
1337
+ }
1338
+ return i;
1339
+ }
1340
+ }
1341
+ html(e) {
1342
+ let t = this.rules.block.html.exec(e);
1343
+ if (t) {
1344
+ let e = Tn(t[0]);
1345
+ return {
1346
+ type: "html",
1347
+ block: !0,
1348
+ raw: e,
1349
+ pre: t[1] === "pre" || t[1] === "script" || t[1] === "style",
1350
+ text: e
1351
+ };
1352
+ }
1353
+ }
1354
+ def(e) {
1355
+ let t = this.rules.block.def.exec(e);
1356
+ if (t) {
1357
+ let e = t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), n = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
1358
+ return {
1359
+ type: "def",
1360
+ tag: e,
1361
+ raw: W(t[0], "\n"),
1362
+ href: n,
1363
+ title: r
1364
+ };
1365
+ }
1366
+ }
1367
+ table(e) {
1368
+ let t = this.rules.block.table.exec(e);
1369
+ if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
1370
+ let n = wn(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], a = {
1371
+ type: "table",
1372
+ raw: W(t[0], "\n"),
1373
+ header: [],
1374
+ align: [],
1375
+ rows: []
1376
+ };
1377
+ if (n.length === r.length) {
1378
+ for (let e of r) this.rules.other.tableAlignRight.test(e) ? a.align.push("right") : this.rules.other.tableAlignCenter.test(e) ? a.align.push("center") : this.rules.other.tableAlignLeft.test(e) ? a.align.push("left") : a.align.push(null);
1379
+ for (let e = 0; e < n.length; e++) a.header.push({
1380
+ text: n[e],
1381
+ tokens: this.lexer.inline(n[e]),
1382
+ header: !0,
1383
+ align: a.align[e]
1384
+ });
1385
+ for (let e of i) a.rows.push(wn(e, a.header.length).map((e, t) => ({
1386
+ text: e,
1387
+ tokens: this.lexer.inline(e),
1388
+ header: !1,
1389
+ align: a.align[t]
1390
+ })));
1391
+ return a;
1392
+ }
1393
+ }
1394
+ lheading(e) {
1395
+ let t = this.rules.block.lheading.exec(e);
1396
+ if (t) {
1397
+ let e = t[1].trim();
1398
+ return {
1399
+ type: "heading",
1400
+ raw: W(t[0], "\n"),
1401
+ depth: t[2].charAt(0) === "=" ? 1 : 2,
1402
+ text: e,
1403
+ tokens: this.lexer.inline(e)
1404
+ };
1405
+ }
1406
+ }
1407
+ paragraph(e) {
1408
+ let t = this.rules.block.paragraph.exec(e);
1409
+ if (t) {
1410
+ let e = t[1].charAt(t[1].length - 1) === "\n" ? t[1].slice(0, -1) : t[1];
1411
+ return {
1412
+ type: "paragraph",
1413
+ raw: t[0],
1414
+ text: e,
1415
+ tokens: this.lexer.inline(e)
1416
+ };
1417
+ }
1418
+ }
1419
+ text(e) {
1420
+ let t = this.rules.block.text.exec(e);
1421
+ if (t) return {
1422
+ type: "text",
1423
+ raw: t[0],
1424
+ text: t[0],
1425
+ tokens: this.lexer.inline(t[0])
1426
+ };
1427
+ }
1428
+ escape(e) {
1429
+ let t = this.rules.inline.escape.exec(e);
1430
+ if (t) return {
1431
+ type: "escape",
1432
+ raw: t[0],
1433
+ text: t[1]
1434
+ };
1435
+ }
1436
+ tag(e) {
1437
+ let t = this.rules.inline.tag.exec(e);
1438
+ if (t) return !this.lexer.state.inLink && this.rules.other.startATag.test(t[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && this.rules.other.endATag.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t[0]) && (this.lexer.state.inRawBlock = !1), {
1439
+ type: "html",
1440
+ raw: t[0],
1441
+ inLink: this.lexer.state.inLink,
1442
+ inRawBlock: this.lexer.state.inRawBlock,
1443
+ block: !1,
1444
+ text: t[0]
1445
+ };
1446
+ }
1447
+ link(e) {
1448
+ let t = this.rules.inline.link.exec(e);
1449
+ if (t) {
1450
+ let e = t[2].trim();
1451
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(e)) {
1452
+ if (!this.rules.other.endAngleBracket.test(e)) return;
1453
+ let t = W(e.slice(0, -1), "\\");
1454
+ if ((e.length - t.length) % 2 == 0) return;
1455
+ } else {
1456
+ let e = En(t[2], "()");
1457
+ if (e === -2) return;
1458
+ if (e > -1) {
1459
+ let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
1460
+ t[2] = t[2].substring(0, e), t[0] = t[0].substring(0, n).trim(), t[3] = "";
1461
+ }
1462
+ }
1463
+ let n = t[2], r = "";
1464
+ if (this.options.pedantic) {
1465
+ let e = this.rules.other.pedanticHrefTitle.exec(n);
1466
+ e && (n = e[1], r = e[3]);
1467
+ } else r = t[3] ? t[3].slice(1, -1) : "";
1468
+ return n = n.trim(), this.rules.other.startAngleBracket.test(n) && (n = this.options.pedantic && !this.rules.other.endAngleBracket.test(e) ? n.slice(1) : n.slice(1, -1)), On(t, {
1469
+ href: n && n.replace(this.rules.inline.anyPunctuation, "$1"),
1470
+ title: r && r.replace(this.rules.inline.anyPunctuation, "$1")
1471
+ }, t[0], this.lexer, this.rules);
1472
+ }
1473
+ }
1474
+ reflink(e, t) {
1475
+ let n;
1476
+ if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
1477
+ let e = t[(n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " ").toLowerCase()];
1478
+ if (!e) {
1479
+ let e = n[0].charAt(0);
1480
+ return {
1481
+ type: "text",
1482
+ raw: e,
1483
+ text: e
1484
+ };
1485
+ }
1486
+ return On(n, e, n[0], this.lexer, this.rules);
1487
+ }
1488
+ }
1489
+ emStrong(e, t, n = "") {
1490
+ let r = this.rules.inline.emStrongLDelim.exec(e);
1491
+ if (!(!r || !r[1] && !r[2] && !r[3] && !r[4] || r[4] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(r[1] || r[3]) || !n || this.rules.inline.punctuation.exec(n))) {
1492
+ let n = [...r[0]].length - 1, i, a, o = n, s = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
1493
+ for (c.lastIndex = 0, t = t.slice(-1 * e.length + n); (r = c.exec(t)) !== null;) {
1494
+ if (i = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !i) continue;
1495
+ if (a = [...i].length, r[3] || r[4]) {
1496
+ o += a;
1497
+ continue;
1498
+ } else if ((r[5] || r[6]) && n % 3 && !((n + a) % 3)) {
1499
+ s += a;
1500
+ continue;
1501
+ }
1502
+ if (o -= a, o > 0) continue;
1503
+ a = Math.min(a, a + o + s);
1504
+ let t = [...r[0]][0].length, c = e.slice(0, n + r.index + t + a);
1505
+ if (Math.min(n, a) % 2) {
1506
+ let e = c.slice(1, -1);
1507
+ return {
1508
+ type: "em",
1509
+ raw: c,
1510
+ text: e,
1511
+ tokens: this.lexer.inlineTokens(e)
1512
+ };
1513
+ }
1514
+ let l = c.slice(2, -2);
1515
+ return {
1516
+ type: "strong",
1517
+ raw: c,
1518
+ text: l,
1519
+ tokens: this.lexer.inlineTokens(l)
1520
+ };
1521
+ }
1522
+ }
1523
+ }
1524
+ codespan(e) {
1525
+ let t = this.rules.inline.code.exec(e);
1526
+ if (t) {
1527
+ let e = t[2].replace(this.rules.other.newLineCharGlobal, " "), n = this.rules.other.nonSpaceChar.test(e), r = this.rules.other.startingSpaceChar.test(e) && this.rules.other.endingSpaceChar.test(e);
1528
+ return n && r && (e = e.substring(1, e.length - 1)), {
1529
+ type: "codespan",
1530
+ raw: t[0],
1531
+ text: e
1532
+ };
1533
+ }
1534
+ }
1535
+ br(e) {
1536
+ let t = this.rules.inline.br.exec(e);
1537
+ if (t) return {
1538
+ type: "br",
1539
+ raw: t[0]
1540
+ };
1541
+ }
1542
+ del(e, t, n = "") {
1543
+ let r = this.rules.inline.delLDelim.exec(e);
1544
+ if (r && (!r[1] || !n || this.rules.inline.punctuation.exec(n))) {
1545
+ let n = [...r[0]].length - 1, i, a, o = n, s = this.rules.inline.delRDelim;
1546
+ for (s.lastIndex = 0, t = t.slice(-1 * e.length + n); (r = s.exec(t)) !== null;) {
1547
+ if (i = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !i || (a = [...i].length, a !== n)) continue;
1548
+ if (r[3] || r[4]) {
1549
+ o += a;
1550
+ continue;
1551
+ }
1552
+ if (o -= a, o > 0) continue;
1553
+ a = Math.min(a, a + o);
1554
+ let t = [...r[0]][0].length, s = e.slice(0, n + r.index + t + a), c = s.slice(n, -n);
1555
+ return {
1556
+ type: "del",
1557
+ raw: s,
1558
+ text: c,
1559
+ tokens: this.lexer.inlineTokens(c)
1560
+ };
1561
+ }
1562
+ }
1563
+ }
1564
+ autolink(e) {
1565
+ let t = this.rules.inline.autolink.exec(e);
1566
+ if (t) {
1567
+ let e, n;
1568
+ return t[2] === "@" ? (e = t[1], n = "mailto:" + e) : (e = t[1], n = e), {
1569
+ type: "link",
1570
+ raw: t[0],
1571
+ text: e,
1572
+ href: n,
1573
+ tokens: [{
1574
+ type: "text",
1575
+ raw: e,
1576
+ text: e
1577
+ }]
1578
+ };
1579
+ }
1580
+ }
1581
+ url(e) {
1582
+ let t;
1583
+ if (t = this.rules.inline.url.exec(e)) {
1584
+ let e, n;
1585
+ if (t[2] === "@") e = t[0], n = "mailto:" + e;
1586
+ else {
1587
+ let r;
1588
+ do
1589
+ r = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
1590
+ while (r !== t[0]);
1591
+ e = t[0], n = t[1] === "www." ? "http://" + t[0] : t[0];
1592
+ }
1593
+ return {
1594
+ type: "link",
1595
+ raw: t[0],
1596
+ text: e,
1597
+ href: n,
1598
+ tokens: [{
1599
+ type: "text",
1600
+ raw: e,
1601
+ text: e
1602
+ }]
1603
+ };
1604
+ }
1605
+ }
1606
+ inlineText(e) {
1607
+ let t = this.rules.inline.text.exec(e);
1608
+ if (t) {
1609
+ let e = this.lexer.state.inRawBlock;
1610
+ return {
1611
+ type: "text",
1612
+ raw: t[0],
1613
+ text: t[0],
1614
+ escaped: e
1615
+ };
1616
+ }
1617
+ }
1618
+ }, K = class e {
1619
+ constructor(e) {
1620
+ s(this, "tokens", void 0), s(this, "options", void 0), s(this, "state", void 0), s(this, "inlineQueue", void 0), s(this, "tokenizer", void 0), this.tokens = [], this.tokens.links = Object.create(null), this.options = e || O, this.options.tokenizer = this.options.tokenizer || new G(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
1621
+ inLink: !1,
1622
+ inRawBlock: !1,
1623
+ top: !0
1624
+ };
1625
+ let t = {
1626
+ other: N,
1627
+ block: bn.normal,
1628
+ inline: H.normal
1629
+ };
1630
+ this.options.pedantic ? (t.block = bn.pedantic, t.inline = H.pedantic) : this.options.gfm && (t.block = bn.gfm, this.options.breaks ? t.inline = H.breaks : t.inline = H.gfm), this.tokenizer.rules = t;
1631
+ }
1632
+ static get rules() {
1633
+ return {
1634
+ block: bn,
1635
+ inline: H
1636
+ };
1637
+ }
1638
+ static lex(t, n) {
1639
+ return new e(n).lex(t);
1640
+ }
1641
+ static lexInline(t, n) {
1642
+ return new e(n).inlineTokens(t);
1643
+ }
1644
+ lex(e) {
1645
+ e = e.replace(N.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
1646
+ for (let e = 0; e < this.inlineQueue.length; e++) {
1647
+ let t = this.inlineQueue[e];
1648
+ this.inlineTokens(t.src, t.tokens);
1649
+ }
1650
+ return this.inlineQueue = [], this.tokens;
1651
+ }
1652
+ blockTokens(e, t = [], n = !1) {
1653
+ this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(N.tabCharGlobal, " ").replace(N.spaceLine, ""));
1654
+ let r = Infinity;
1655
+ for (; e;) {
1656
+ if (e.length < r) r = e.length;
1657
+ else {
1658
+ this.infiniteLoopError(e.charCodeAt(0));
1659
+ break;
1660
+ }
1661
+ let i;
1662
+ if (this.options.extensions?.block?.some((n) => (i = n.call({ lexer: this }, e, t)) ? (e = e.substring(i.raw.length), t.push(i), !0) : !1)) continue;
1663
+ if (i = this.tokenizer.space(e)) {
1664
+ e = e.substring(i.raw.length);
1665
+ let n = t.at(-1);
1666
+ i.raw.length === 1 && n !== void 0 ? n.raw += "\n" : t.push(i);
1667
+ continue;
1668
+ }
1669
+ if (i = this.tokenizer.code(e)) {
1670
+ e = e.substring(i.raw.length);
1671
+ let n = t.at(-1);
1672
+ n?.type === "paragraph" || n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + i.raw, n.text += "\n" + i.text, this.inlineQueue.at(-1).src = n.text) : t.push(i);
1673
+ continue;
1674
+ }
1675
+ if (i = this.tokenizer.fences(e)) {
1676
+ e = e.substring(i.raw.length), t.push(i);
1677
+ continue;
1678
+ }
1679
+ if (i = this.tokenizer.heading(e)) {
1680
+ e = e.substring(i.raw.length), t.push(i);
1681
+ continue;
1682
+ }
1683
+ if (i = this.tokenizer.hr(e)) {
1684
+ e = e.substring(i.raw.length), t.push(i);
1685
+ continue;
1686
+ }
1687
+ if (i = this.tokenizer.blockquote(e)) {
1688
+ e = e.substring(i.raw.length), t.push(i);
1689
+ continue;
1690
+ }
1691
+ if (i = this.tokenizer.list(e)) {
1692
+ e = e.substring(i.raw.length), t.push(i);
1693
+ continue;
1694
+ }
1695
+ if (i = this.tokenizer.html(e)) {
1696
+ e = e.substring(i.raw.length), t.push(i);
1697
+ continue;
1698
+ }
1699
+ if (i = this.tokenizer.def(e)) {
1700
+ e = e.substring(i.raw.length);
1701
+ let n = t.at(-1);
1702
+ n?.type === "paragraph" || n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + i.raw, n.text += "\n" + i.raw, this.inlineQueue.at(-1).src = n.text) : this.tokens.links[i.tag] || (this.tokens.links[i.tag] = {
1703
+ href: i.href,
1704
+ title: i.title
1705
+ }, t.push(i));
1706
+ continue;
1707
+ }
1708
+ if (i = this.tokenizer.table(e)) {
1709
+ e = e.substring(i.raw.length), t.push(i);
1710
+ continue;
1711
+ }
1712
+ if (i = this.tokenizer.lheading(e)) {
1713
+ e = e.substring(i.raw.length), t.push(i);
1714
+ continue;
1715
+ }
1716
+ let a = e;
1717
+ if (this.options.extensions?.startBlock) {
1718
+ let t = Infinity, n = e.slice(1), r;
1719
+ this.options.extensions.startBlock.forEach((e) => {
1720
+ r = e.call({ lexer: this }, n), typeof r == "number" && r >= 0 && (t = Math.min(t, r));
1721
+ }), t < Infinity && t >= 0 && (a = e.substring(0, t + 1));
1722
+ }
1723
+ if (this.state.top && (i = this.tokenizer.paragraph(a))) {
1724
+ let r = t.at(-1);
1725
+ n && r?.type === "paragraph" ? (r.raw += (r.raw.endsWith("\n") ? "" : "\n") + i.raw, r.text += "\n" + i.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = r.text) : t.push(i), n = a.length !== e.length, e = e.substring(i.raw.length);
1726
+ continue;
1727
+ }
1728
+ if (i = this.tokenizer.text(e)) {
1729
+ e = e.substring(i.raw.length);
1730
+ let n = t.at(-1);
1731
+ n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + i.raw, n.text += "\n" + i.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = n.text) : t.push(i);
1732
+ continue;
1733
+ }
1734
+ if (e) {
1735
+ this.infiniteLoopError(e.charCodeAt(0));
1736
+ break;
1737
+ }
1738
+ }
1739
+ return this.state.top = !0, t;
1740
+ }
1741
+ inline(e, t = []) {
1742
+ return this.inlineQueue.push({
1743
+ src: e,
1744
+ tokens: t
1745
+ }), t;
1746
+ }
1747
+ inlineTokens(e, t = []) {
1748
+ this.tokenizer.lexer = this;
1749
+ let n = e, r = null;
1750
+ if (this.tokens.links) {
1751
+ let e = Object.keys(this.tokens.links);
1752
+ if (e.length > 0) for (; (r = this.tokenizer.rules.inline.reflinkSearch.exec(n)) !== null;) e.includes(r[0].slice(r[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
1753
+ }
1754
+ for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) !== null;) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
1755
+ let i;
1756
+ for (; (r = this.tokenizer.rules.inline.blockSkip.exec(n)) !== null;) i = r[2] ? r[2].length : 0, n = n.slice(0, r.index + i) + "[" + "a".repeat(r[0].length - i - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
1757
+ n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
1758
+ let a = !1, o = "", s = Infinity;
1759
+ for (; e;) {
1760
+ if (e.length < s) s = e.length;
1761
+ else {
1762
+ this.infiniteLoopError(e.charCodeAt(0));
1763
+ break;
1764
+ }
1765
+ a || (o = ""), a = !1;
1766
+ let r;
1767
+ if (this.options.extensions?.inline?.some((n) => (r = n.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1)) continue;
1768
+ if (r = this.tokenizer.escape(e)) {
1769
+ e = e.substring(r.raw.length), t.push(r);
1770
+ continue;
1771
+ }
1772
+ if (r = this.tokenizer.tag(e)) {
1773
+ e = e.substring(r.raw.length), t.push(r);
1774
+ continue;
1775
+ }
1776
+ if (r = this.tokenizer.link(e)) {
1777
+ e = e.substring(r.raw.length), t.push(r);
1778
+ continue;
1779
+ }
1780
+ if (r = this.tokenizer.reflink(e, this.tokens.links)) {
1781
+ e = e.substring(r.raw.length);
1782
+ let n = t.at(-1);
1783
+ r.type === "text" && n?.type === "text" ? (n.raw += r.raw, n.text += r.text) : t.push(r);
1784
+ continue;
1785
+ }
1786
+ if (r = this.tokenizer.emStrong(e, n, o)) {
1787
+ e = e.substring(r.raw.length), t.push(r);
1788
+ continue;
1789
+ }
1790
+ if (r = this.tokenizer.codespan(e)) {
1791
+ e = e.substring(r.raw.length), t.push(r);
1792
+ continue;
1793
+ }
1794
+ if (r = this.tokenizer.br(e)) {
1795
+ e = e.substring(r.raw.length), t.push(r);
1796
+ continue;
1797
+ }
1798
+ if (r = this.tokenizer.del(e, n, o)) {
1799
+ e = e.substring(r.raw.length), t.push(r);
1800
+ continue;
1801
+ }
1802
+ if (r = this.tokenizer.autolink(e)) {
1803
+ e = e.substring(r.raw.length), t.push(r);
1804
+ continue;
1805
+ }
1806
+ if (!this.state.inLink && (r = this.tokenizer.url(e))) {
1807
+ e = e.substring(r.raw.length), t.push(r);
1808
+ continue;
1809
+ }
1810
+ let i = e;
1811
+ if (this.options.extensions?.startInline) {
1812
+ let t = Infinity, n = e.slice(1), r;
1813
+ this.options.extensions.startInline.forEach((e) => {
1814
+ r = e.call({ lexer: this }, n), typeof r == "number" && r >= 0 && (t = Math.min(t, r));
1815
+ }), t < Infinity && t >= 0 && (i = e.substring(0, t + 1));
1816
+ }
1817
+ if (r = this.tokenizer.inlineText(i)) {
1818
+ e = e.substring(r.raw.length), r.raw.slice(-1) !== "_" && (o = r.raw.slice(-1)), a = !0;
1819
+ let n = t.at(-1);
1820
+ n?.type === "text" ? (n.raw += r.raw, n.text += r.text) : t.push(r);
1821
+ continue;
1822
+ }
1823
+ if (e) {
1824
+ this.infiniteLoopError(e.charCodeAt(0));
1825
+ break;
1826
+ }
1827
+ }
1828
+ return t;
1829
+ }
1830
+ infiniteLoopError(e) {
1831
+ let t = "Infinite loop on byte: " + e;
1832
+ if (this.options.silent) console.error(t);
1833
+ else throw Error(t);
1834
+ }
1835
+ }, An = class {
1836
+ constructor(e) {
1837
+ s(this, "options", void 0), s(this, "parser", void 0), this.options = e || O;
1838
+ }
1839
+ space(e) {
1840
+ return "";
1841
+ }
1842
+ code({ text: e, lang: t, escaped: n }) {
1843
+ let r = (t || "").match(N.notSpaceStart)?.[0], i = e.replace(N.endingNewline, "") + "\n";
1844
+ return r ? "<pre><code class=\"language-" + U(r) + "\">" + (n ? i : U(i, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? i : U(i, !0)) + "</code></pre>\n";
1845
+ }
1846
+ blockquote({ tokens: e }) {
1847
+ return `<blockquote>
1848
+ ${this.parser.parse(e)}</blockquote>
1849
+ `;
1850
+ }
1851
+ html({ text: e }) {
1852
+ return e;
1853
+ }
1854
+ def(e) {
1855
+ return "";
1856
+ }
1857
+ heading({ tokens: e, depth: t }) {
1858
+ return `<h${t}>${this.parser.parseInline(e)}</h${t}>
1859
+ `;
1860
+ }
1861
+ hr(e) {
1862
+ return "<hr>\n";
1863
+ }
1864
+ list(e) {
1865
+ let t = e.ordered, n = e.start, r = "";
1866
+ for (let t = 0; t < e.items.length; t++) {
1867
+ let n = e.items[t];
1868
+ r += this.listitem(n);
1869
+ }
1870
+ let i = t ? "ol" : "ul", a = t && n !== 1 ? " start=\"" + n + "\"" : "";
1871
+ return "<" + i + a + ">\n" + r + "</" + i + ">\n";
1872
+ }
1873
+ listitem(e) {
1874
+ return `<li>${this.parser.parse(e.tokens)}</li>
1875
+ `;
1876
+ }
1877
+ checkbox({ checked: e }) {
1878
+ return "<input " + (e ? "checked=\"\" " : "") + "disabled=\"\" type=\"checkbox\"> ";
1879
+ }
1880
+ paragraph({ tokens: e }) {
1881
+ return `<p>${this.parser.parseInline(e)}</p>
1882
+ `;
1883
+ }
1884
+ table(e) {
1885
+ let t = "", n = "";
1886
+ for (let t = 0; t < e.header.length; t++) n += this.tablecell(e.header[t]);
1887
+ t += this.tablerow({ text: n });
1888
+ let r = "";
1889
+ for (let t = 0; t < e.rows.length; t++) {
1890
+ let i = e.rows[t];
1891
+ n = "";
1892
+ for (let e = 0; e < i.length; e++) n += this.tablecell(i[e]);
1893
+ r += this.tablerow({ text: n });
1894
+ }
1895
+ return r &&= `<tbody>${r}</tbody>`, "<table>\n<thead>\n" + t + "</thead>\n" + r + "</table>\n";
1896
+ }
1897
+ tablerow({ text: e }) {
1898
+ return `<tr>
1899
+ ${e}</tr>
1900
+ `;
1901
+ }
1902
+ tablecell(e) {
1903
+ let t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
1904
+ return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
1905
+ `;
1906
+ }
1907
+ strong({ tokens: e }) {
1908
+ return `<strong>${this.parser.parseInline(e)}</strong>`;
1909
+ }
1910
+ em({ tokens: e }) {
1911
+ return `<em>${this.parser.parseInline(e)}</em>`;
1912
+ }
1913
+ codespan({ text: e }) {
1914
+ return `<code>${U(e, !0)}</code>`;
1915
+ }
1916
+ br(e) {
1917
+ return "<br>";
1918
+ }
1919
+ del({ tokens: e }) {
1920
+ return `<del>${this.parser.parseInline(e)}</del>`;
1921
+ }
1922
+ link({ href: e, title: t, tokens: n }) {
1923
+ let r = this.parser.parseInline(n), i = Cn(e);
1924
+ if (i === null) return r;
1925
+ e = i;
1926
+ let a = "<a href=\"" + e + "\"";
1927
+ return t && (a += " title=\"" + U(t) + "\""), a += ">" + r + "</a>", a;
1928
+ }
1929
+ image({ href: e, title: t, text: n, tokens: r }) {
1930
+ r && (n = this.parser.parseInline(r, this.parser.textRenderer));
1931
+ let i = Cn(e);
1932
+ if (i === null) return U(n);
1933
+ e = i;
1934
+ let a = `<img src="${e}" alt="${U(n)}"`;
1935
+ return t && (a += ` title="${U(t)}"`), a += ">", a;
1936
+ }
1937
+ text(e) {
1938
+ return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : U(e.text);
1939
+ }
1940
+ }, jn = class {
1941
+ strong({ text: e }) {
1942
+ return e;
1943
+ }
1944
+ em({ text: e }) {
1945
+ return e;
1946
+ }
1947
+ codespan({ text: e }) {
1948
+ return e;
1949
+ }
1950
+ del({ text: e }) {
1951
+ return e;
1952
+ }
1953
+ html({ text: e }) {
1954
+ return e;
1955
+ }
1956
+ text({ text: e }) {
1957
+ return e;
1958
+ }
1959
+ link({ text: e }) {
1960
+ return "" + e;
1961
+ }
1962
+ image({ text: e }) {
1963
+ return "" + e;
1964
+ }
1965
+ br() {
1966
+ return "";
1967
+ }
1968
+ checkbox({ raw: e }) {
1969
+ return e;
1970
+ }
1971
+ }, q = class e {
1972
+ constructor(e) {
1973
+ s(this, "options", void 0), s(this, "renderer", void 0), s(this, "textRenderer", void 0), this.options = e || O, this.options.renderer = this.options.renderer || new An(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new jn();
1974
+ }
1975
+ static parse(t, n) {
1976
+ return new e(n).parse(t);
1977
+ }
1978
+ static parseInline(t, n) {
1979
+ return new e(n).parseInline(t);
1980
+ }
1981
+ parse(e) {
1982
+ this.renderer.parser = this;
1983
+ let t = "";
1984
+ for (let n = 0; n < e.length; n++) {
1985
+ let r = e[n];
1986
+ if (this.options.extensions?.renderers?.[r.type]) {
1987
+ let e = r, n = this.options.extensions.renderers[e.type].call({ parser: this }, e);
1988
+ if (n !== !1 || ![
1989
+ "space",
1990
+ "hr",
1991
+ "heading",
1992
+ "code",
1993
+ "table",
1994
+ "blockquote",
1995
+ "list",
1996
+ "html",
1997
+ "def",
1998
+ "paragraph",
1999
+ "text"
2000
+ ].includes(e.type)) {
2001
+ t += n || "";
2002
+ continue;
2003
+ }
2004
+ }
2005
+ let i = r;
2006
+ switch (i.type) {
2007
+ case "space":
2008
+ t += this.renderer.space(i);
2009
+ break;
2010
+ case "hr":
2011
+ t += this.renderer.hr(i);
2012
+ break;
2013
+ case "heading":
2014
+ t += this.renderer.heading(i);
2015
+ break;
2016
+ case "code":
2017
+ t += this.renderer.code(i);
2018
+ break;
2019
+ case "table":
2020
+ t += this.renderer.table(i);
2021
+ break;
2022
+ case "blockquote":
2023
+ t += this.renderer.blockquote(i);
2024
+ break;
2025
+ case "list":
2026
+ t += this.renderer.list(i);
2027
+ break;
2028
+ case "checkbox":
2029
+ t += this.renderer.checkbox(i);
2030
+ break;
2031
+ case "html":
2032
+ t += this.renderer.html(i);
2033
+ break;
2034
+ case "def":
2035
+ t += this.renderer.def(i);
2036
+ break;
2037
+ case "paragraph":
2038
+ t += this.renderer.paragraph(i);
2039
+ break;
2040
+ case "text":
2041
+ t += this.renderer.text(i);
2042
+ break;
2043
+ default: {
2044
+ let e = "Token with \"" + i.type + "\" type was not found.";
2045
+ if (this.options.silent) return console.error(e), "";
2046
+ throw Error(e);
2047
+ }
2048
+ }
2049
+ }
2050
+ return t;
2051
+ }
2052
+ parseInline(e, t = this.renderer) {
2053
+ this.renderer.parser = this;
2054
+ let n = "";
2055
+ for (let r = 0; r < e.length; r++) {
2056
+ let i = e[r];
2057
+ if (this.options.extensions?.renderers?.[i.type]) {
2058
+ let e = this.options.extensions.renderers[i.type].call({ parser: this }, i);
2059
+ if (e !== !1 || ![
2060
+ "escape",
2061
+ "html",
2062
+ "link",
2063
+ "image",
2064
+ "strong",
2065
+ "em",
2066
+ "codespan",
2067
+ "br",
2068
+ "del",
2069
+ "text"
2070
+ ].includes(i.type)) {
2071
+ n += e || "";
2072
+ continue;
2073
+ }
2074
+ }
2075
+ let a = i;
2076
+ switch (a.type) {
2077
+ case "escape":
2078
+ n += t.text(a);
2079
+ break;
2080
+ case "html":
2081
+ n += t.html(a);
2082
+ break;
2083
+ case "link":
2084
+ n += t.link(a);
2085
+ break;
2086
+ case "image":
2087
+ n += t.image(a);
2088
+ break;
2089
+ case "checkbox":
2090
+ n += t.checkbox(a);
2091
+ break;
2092
+ case "strong":
2093
+ n += t.strong(a);
2094
+ break;
2095
+ case "em":
2096
+ n += t.em(a);
2097
+ break;
2098
+ case "codespan":
2099
+ n += t.codespan(a);
2100
+ break;
2101
+ case "br":
2102
+ n += t.br(a);
2103
+ break;
2104
+ case "del":
2105
+ n += t.del(a);
2106
+ break;
2107
+ case "text":
2108
+ n += t.text(a);
2109
+ break;
2110
+ default: {
2111
+ let e = "Token with \"" + a.type + "\" type was not found.";
2112
+ if (this.options.silent) return console.error(e), "";
2113
+ throw Error(e);
2114
+ }
2115
+ }
2116
+ }
2117
+ return n;
2118
+ }
2119
+ }, J = (xt = class {
2120
+ constructor(e) {
2121
+ s(this, "options", void 0), s(this, "block", void 0), this.options = e || O;
2122
+ }
2123
+ preprocess(e) {
2124
+ return e;
2125
+ }
2126
+ postprocess(e) {
2127
+ return e;
2128
+ }
2129
+ processAllTokens(e) {
2130
+ return e;
2131
+ }
2132
+ emStrongMask(e) {
2133
+ return e;
2134
+ }
2135
+ provideLexer(e = this.block) {
2136
+ return e ? K.lex : K.lexInline;
2137
+ }
2138
+ provideParser(e = this.block) {
2139
+ return e ? q.parse : q.parseInline;
2140
+ }
2141
+ }, s(xt, "passThroughHooks", /* @__PURE__ */ new Set([
2142
+ "preprocess",
2143
+ "postprocess",
2144
+ "processAllTokens",
2145
+ "emStrongMask"
2146
+ ])), s(xt, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set([
2147
+ "preprocess",
2148
+ "postprocess",
2149
+ "processAllTokens"
2150
+ ])), xt), Y = new class {
2151
+ constructor(...e) {
2152
+ s(this, "defaults", St()), s(this, "options", this.setOptions), s(this, "parse", this.parseMarkdown(!0)), s(this, "parseInline", this.parseMarkdown(!1)), s(this, "Parser", q), s(this, "Renderer", An), s(this, "TextRenderer", jn), s(this, "Lexer", K), s(this, "Tokenizer", G), s(this, "Hooks", J), this.use(...e);
2153
+ }
2154
+ walkTokens(e, t) {
2155
+ let n = [];
2156
+ for (let r of e) switch (n = n.concat(t.call(this, r)), r.type) {
2157
+ case "table": {
2158
+ let e = r;
2159
+ for (let r of e.header) n = n.concat(this.walkTokens(r.tokens, t));
2160
+ for (let r of e.rows) for (let e of r) n = n.concat(this.walkTokens(e.tokens, t));
2161
+ break;
2162
+ }
2163
+ case "list": {
2164
+ let e = r;
2165
+ n = n.concat(this.walkTokens(e.items, t));
2166
+ break;
2167
+ }
2168
+ default: {
2169
+ let e = r;
2170
+ this.defaults.extensions?.childTokens?.[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((r) => {
2171
+ let i = e[r].flat(Infinity);
2172
+ n = n.concat(this.walkTokens(i, t));
2173
+ }) : e.tokens && (n = n.concat(this.walkTokens(e.tokens, t)));
2174
+ }
2175
+ }
2176
+ return n;
2177
+ }
2178
+ use(...e) {
2179
+ let t = this.defaults.extensions || {
2180
+ renderers: {},
2181
+ childTokens: {}
2182
+ };
2183
+ return e.forEach((e) => {
2184
+ let n = { ...e };
2185
+ if (n.async = this.defaults.async || n.async || !1, e.extensions && (e.extensions.forEach((e) => {
2186
+ if (!e.name) throw Error("extension name required");
2187
+ if ("renderer" in e) {
2188
+ let n = t.renderers[e.name];
2189
+ n ? t.renderers[e.name] = function(...t) {
2190
+ let r = e.renderer.apply(this, t);
2191
+ return r === !1 && (r = n.apply(this, t)), r;
2192
+ } : t.renderers[e.name] = e.renderer;
2193
+ }
2194
+ if ("tokenizer" in e) {
2195
+ if (!e.level || e.level !== "block" && e.level !== "inline") throw Error("extension level must be 'block' or 'inline'");
2196
+ let n = t[e.level];
2197
+ n ? n.unshift(e.tokenizer) : t[e.level] = [e.tokenizer], e.start && (e.level === "block" ? t.startBlock ? t.startBlock.push(e.start) : t.startBlock = [e.start] : e.level === "inline" && (t.startInline ? t.startInline.push(e.start) : t.startInline = [e.start]));
2198
+ }
2199
+ "childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
2200
+ }), n.extensions = t), e.renderer) {
2201
+ let t = this.defaults.renderer || new An(this.defaults);
2202
+ for (let n in e.renderer) {
2203
+ if (!(n in t)) throw Error(`renderer '${n}' does not exist`);
2204
+ if (["options", "parser"].includes(n)) continue;
2205
+ let r = n, i = e.renderer[r], a = t[r];
2206
+ t[r] = (...e) => {
2207
+ let n = i.apply(t, e);
2208
+ return n === !1 && (n = a.apply(t, e)), n || "";
2209
+ };
2210
+ }
2211
+ n.renderer = t;
2212
+ }
2213
+ if (e.tokenizer) {
2214
+ let t = this.defaults.tokenizer || new G(this.defaults);
2215
+ for (let n in e.tokenizer) {
2216
+ if (!(n in t)) throw Error(`tokenizer '${n}' does not exist`);
2217
+ if ([
2218
+ "options",
2219
+ "rules",
2220
+ "lexer"
2221
+ ].includes(n)) continue;
2222
+ let r = n, i = e.tokenizer[r], a = t[r];
2223
+ t[r] = (...e) => {
2224
+ let n = i.apply(t, e);
2225
+ return n === !1 && (n = a.apply(t, e)), n;
2226
+ };
2227
+ }
2228
+ n.tokenizer = t;
2229
+ }
2230
+ if (e.hooks) {
2231
+ let t = this.defaults.hooks || new J();
2232
+ for (let n in e.hooks) {
2233
+ if (!(n in t)) throw Error(`hook '${n}' does not exist`);
2234
+ if (["options", "block"].includes(n)) continue;
2235
+ let r = n, i = e.hooks[r], a = t[r];
2236
+ J.passThroughHooks.has(n) ? t[r] = (e) => {
2237
+ if (this.defaults.async && J.passThroughHooksRespectAsync.has(n)) return (async () => {
2238
+ let n = await i.call(t, e);
2239
+ return a.call(t, n);
2240
+ })();
2241
+ let r = i.call(t, e);
2242
+ return a.call(t, r);
2243
+ } : t[r] = (...e) => {
2244
+ if (this.defaults.async) return (async () => {
2245
+ let n = await i.apply(t, e);
2246
+ return n === !1 && (n = await a.apply(t, e)), n;
2247
+ })();
2248
+ let n = i.apply(t, e);
2249
+ return n === !1 && (n = a.apply(t, e)), n;
2250
+ };
2251
+ }
2252
+ n.hooks = t;
2253
+ }
2254
+ if (e.walkTokens) {
2255
+ let t = this.defaults.walkTokens, r = e.walkTokens;
2256
+ n.walkTokens = function(e) {
2257
+ let n = [];
2258
+ return n.push(r.call(this, e)), t && (n = n.concat(t.call(this, e))), n;
2259
+ };
2260
+ }
2261
+ this.defaults = {
2262
+ ...this.defaults,
2263
+ ...n
2264
+ };
2265
+ }), this;
2266
+ }
2267
+ setOptions(e) {
2268
+ return this.defaults = {
2269
+ ...this.defaults,
2270
+ ...e
2271
+ }, this;
2272
+ }
2273
+ lexer(e, t) {
2274
+ return K.lex(e, t ?? this.defaults);
2275
+ }
2276
+ parser(e, t) {
2277
+ return q.parse(e, t ?? this.defaults);
2278
+ }
2279
+ parseMarkdown(e) {
2280
+ return (t, n) => {
2281
+ let r = { ...n }, i = {
2282
+ ...this.defaults,
2283
+ ...r
2284
+ }, a = this.onError(!!i.silent, !!i.async);
2285
+ if (this.defaults.async === !0 && r.async === !1) return a(/* @__PURE__ */ Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
2286
+ if (typeof t > "u" || t === null) return a(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
2287
+ if (typeof t != "string") return a(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
2288
+ if (i.hooks && (i.hooks.options = i, i.hooks.block = e), i.async) return (async () => {
2289
+ let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ? K.lex : K.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
2290
+ i.walkTokens && await Promise.all(this.walkTokens(a, i.walkTokens));
2291
+ let o = await (i.hooks ? await i.hooks.provideParser(e) : e ? q.parse : q.parseInline)(a, i);
2292
+ return i.hooks ? await i.hooks.postprocess(o) : o;
2293
+ })().catch(a);
2294
+ try {
2295
+ i.hooks && (t = i.hooks.preprocess(t));
2296
+ let n = (i.hooks ? i.hooks.provideLexer(e) : e ? K.lex : K.lexInline)(t, i);
2297
+ i.hooks && (n = i.hooks.processAllTokens(n)), i.walkTokens && this.walkTokens(n, i.walkTokens);
2298
+ let r = (i.hooks ? i.hooks.provideParser(e) : e ? q.parse : q.parseInline)(n, i);
2299
+ return i.hooks && (r = i.hooks.postprocess(r)), r;
2300
+ } catch (e) {
2301
+ return a(e);
2302
+ }
2303
+ };
2304
+ }
2305
+ onError(e, t) {
2306
+ return (n) => {
2307
+ if (n.message += "\nPlease report this to https://github.com/markedjs/marked.", e) {
2308
+ let e = "<p>An error occurred:</p><pre>" + U(n.message + "", !0) + "</pre>";
2309
+ return t ? Promise.resolve(e) : e;
2310
+ }
2311
+ if (t) return Promise.reject(n);
2312
+ throw n;
2313
+ };
2314
+ }
2315
+ }();
2316
+ function X(e, t) {
2317
+ return Y.parse(e, t);
2318
+ }
2319
+ X.options = X.setOptions = function(e) {
2320
+ return Y.setOptions(e), X.defaults = Y.defaults, Ct(X.defaults), X;
2321
+ }, X.getDefaults = St, X.defaults = O, X.use = function(...e) {
2322
+ return Y.use(...e), X.defaults = Y.defaults, Ct(X.defaults), X;
2323
+ }, X.walkTokens = function(e, t) {
2324
+ return Y.walkTokens(e, t);
2325
+ }, X.parseInline = Y.parseInline, X.Parser = q, X.parser = q.parse, X.Renderer = An, X.TextRenderer = jn, X.Lexer = K, X.lexer = K.lex, X.Tokenizer = G, X.Hooks = J, X.parse = X, X.options, X.setOptions, X.use, X.walkTokens, X.parseInline, q.parse, K.lex;
2326
+ //#endregion
2327
+ //#region src/components/ai-chat/ai-chat.module.scss?inline
2328
+ var Mn = ":host{box-sizing:border-box;flex-direction:column;width:100%;height:100%;display:flex}:host .chat-container{background:var(--luzmo-ai-chat-background,var(--ai-chat-background));border-radius:var(--luzmo-ai-chat-border-radius,var(--ai-chat-border-radius));width:100%;height:100%;min-height:0;padding:var(--luzmo-ai-chat-padding,var(--ai-chat-padding));gap:var(--luzmo-ai-chat-gap,var(--ai-chat-gap));border:var(--luzmo-ai-chat-border,var(--ai-chat-border));box-shadow:var(--luzmo-ai-chat-box-shadow,var(--ai-chat-box-shadow));box-sizing:border-box;flex-direction:column;flex:1;display:flex;overflow:hidden}:host .chat-messages-container{gap:var(--luzmo-ai-chat-gap,var(--ai-chat-gap));flex-direction:column;flex:1;min-height:0;display:flex;overflow:auto}:host .chat-messages-container luzmo-ai-chat-empty-state{flex:1;min-height:0}:host .chat-messages-container::-webkit-scrollbar{width:var(--luzmo-ai-chat-scrollbar-width,var(--ai-chat-scrollbar-width))}:host .chat-messages-container::-webkit-scrollbar-track{background:var(--luzmo-ai-chat-scrollbar-track-background,var(--ai-chat-scrollbar-track-background));border-radius:var(--luzmo-ai-chat-scrollbar-track-border-radius,var(--ai-chat-scrollbar-track-border-radius))}:host .chat-messages-container::-webkit-scrollbar-thumb{background:var(--luzmo-ai-chat-scrollbar-thumb-background,var(--ai-chat-scrollbar-thumb-background));border-radius:var(--luzmo-ai-chat-scrollbar-thumb-border-radius,var(--ai-chat-scrollbar-thumb-border-radius))}:host .chat-messages-container::-webkit-scrollbar-thumb:hover{background:var(--luzmo-ai-chat-scrollbar-thumb-hover-background,var(--ai-chat-scrollbar-thumb-hover-background))}:host .chat-messages-container{scrollbar-width:var(--luzmo-scrollbar-width,thin);scrollbar-color:var(--luzmo-ai-chat-scrollbar-thumb-background,var(--ai-chat-scrollbar-thumb-background)) var(--luzmo-ai-chat-scrollbar-track-background,var(--ai-chat-scrollbar-track-background))}:host luzmo-chat-message{--luzmo-primary:rgba(var(--luzmo-primary-rgb), .08);--chat-message-primary-text-color:var(--luzmo-font-color);--chat-message-primary-border-color:transparent}:host luzmo-chat-message.error{color:var(--luzmo-ai-chat-error-message-color,var(--ai-chat-error-message-color))}:host luzmo-chat-message.cancelled{color:var(--luzmo-ai-chat-cancelled-message-color,var(--ai-chat-cancelled-message-color));font-style:italic}:host .user-message-content{gap:var(--luzmo-spacing-3,8px);flex-direction:column;display:flex}:host .user-message-attachments{gap:var(--luzmo-spacing-2,4px);flex-wrap:wrap;display:flex}:host .user-message-attachment{width:var(--luzmo-ai-chat-user-message-attachment-size,var(--ai-chat-user-message-attachment-size));height:var(--luzmo-ai-chat-user-message-attachment-size,var(--ai-chat-user-message-attachment-size));object-fit:cover;object-position:center;border-radius:var(--luzmo-border-radius-s,4px);pointer-events:none;display:block}:host .user-message-text{white-space:pre-wrap;overflow-wrap:anywhere}:host .markdown-content{line-height:var(--luzmo-ai-chat-markdown-line-height,var(--ai-chat-markdown-line-height))}:host .markdown-content>:first-child{margin-top:0}:host .markdown-content>:last-child{margin-bottom:0}:host .markdown-content p,:host .markdown-content ul,:host .markdown-content ol,:host .markdown-content blockquote,:host .markdown-content pre,:host .markdown-content table{margin:0 0 var(--luzmo-ai-chat-markdown-spacing,var(--ai-chat-markdown-spacing))}:host .markdown-content h1,:host .markdown-content h2,:host .markdown-content h3,:host .markdown-content h4,:host .markdown-content h5,:host .markdown-content h6{margin:var(--luzmo-ai-chat-markdown-heading-spacing,var(--ai-chat-markdown-heading-spacing)) 0 var(--luzmo-ai-chat-markdown-spacing,var(--ai-chat-markdown-spacing));font-weight:var(--luzmo-ai-chat-markdown-heading-font-weight,var(--ai-chat-markdown-heading-font-weight))}:host .markdown-content ul,:host .markdown-content ol{padding-inline-start:var(--luzmo-ai-chat-markdown-list-indent,var(--ai-chat-markdown-list-indent))}:host .markdown-content a{color:var(--luzmo-ai-chat-markdown-link-color,var(--ai-chat-markdown-link-color))}:host .markdown-content code{font-family:var(--luzmo-ai-chat-markdown-code-font-family,var(--ai-chat-markdown-code-font-family));font-size:var(--luzmo-ai-chat-markdown-code-font-size,var(--ai-chat-markdown-code-font-size));background:var(--luzmo-ai-chat-markdown-code-background,var(--ai-chat-markdown-code-background));border-radius:var(--luzmo-ai-chat-markdown-code-border-radius,var(--ai-chat-markdown-code-border-radius));padding:.1em .3em}:host .markdown-content pre{background:var(--luzmo-ai-chat-markdown-code-background,var(--ai-chat-markdown-code-background));border-radius:var(--luzmo-ai-chat-markdown-code-border-radius,var(--ai-chat-markdown-code-border-radius));padding:.75em 1em;overflow-x:auto}:host .markdown-content pre code{background:0 0;padding:0}:host .markdown-content blockquote{border-inline-start:.1875rem solid var(--luzmo-ai-chat-markdown-border-color,var(--ai-chat-markdown-border-color));padding-inline-start:.75rem}:host .markdown-content hr{border:0;border-top:.0625rem solid var(--luzmo-ai-chat-markdown-border-color,var(--ai-chat-markdown-border-color));margin:var(--luzmo-ai-chat-markdown-heading-spacing,var(--ai-chat-markdown-heading-spacing)) 0}:host .markdown-content table{border-collapse:collapse;width:100%}:host .markdown-content th,:host .markdown-content td{border:.0625rem solid var(--luzmo-ai-chat-markdown-border-color,var(--ai-chat-markdown-border-color));text-align:start;padding:.375rem .625rem}:host .markdown-content th{background:var(--luzmo-ai-chat-markdown-table-header-background,var(--ai-chat-markdown-table-header-background));font-weight:600}:host .assistant-message-wrapper{gap:var(--luzmo-ai-chat-assistant-message-actions-margin-top,var(--ai-chat-assistant-message-actions-margin-top));font-family:var(--luzmo-ai-chat-assistant-message-font-family,var(--ai-chat-assistant-message-font-family));font-size:var(--luzmo-ai-chat-assistant-message-font-size,var(--ai-chat-assistant-message-font-size));line-height:var(--luzmo-ai-chat-assistant-message-line-height,var(--ai-chat-assistant-message-line-height));flex-direction:column;display:flex}:host luzmo-chat-message[position=left]{--luzmo-chat-message-font-family:var(--luzmo-ai-chat-assistant-message-font-family,var(--ai-chat-assistant-message-font-family));--luzmo-chat-message-font-size:var(--luzmo-ai-chat-assistant-message-font-size,var(--ai-chat-assistant-message-font-size));--luzmo-chat-message-line-height:var(--luzmo-ai-chat-assistant-message-line-height,var(--ai-chat-assistant-message-line-height))}:host .assistant-message-body{justify-content:space-between;align-items:flex-start;gap:1rem;display:flex}:host .assistant-message-actions{align-items:center;gap:var(--luzmo-ai-chat-assistant-message-actions-gap,var(--ai-chat-assistant-message-actions-gap));flex-wrap:wrap;display:none}:host .assistant-message-actions.assistant-message-actions--has-content{display:flex}:host .assistant-message-actions.assistant-message-actions--confirming{flex-direction:column;align-items:flex-start}:host .assistant-message-actions .assistant-message-action-confirm-message{font-style:var(--luzmo-ai-chat-assistant-message-actions-font-style,var(--ai-chat-assistant-message-actions-font-style));color:var(--luzmo-ai-chat-assistant-message-actions-color,var(--ai-chat-assistant-message-actions-color));white-space:pre-line}:host .assistant-message-actions .assistant-message-action-confirm-controls{align-items:center;gap:var(--luzmo-ai-chat-assistant-message-actions-gap,var(--ai-chat-assistant-message-actions-gap));flex-wrap:wrap;display:flex}:host .assistant-message-actions luzmo-button.assistant-message-action,:host .assistant-message-actions slot::slotted(luzmo-button),:host .assistant-message-actions slot::slotted(button),:host .assistant-message-actions slot::slotted(a),:host .assistant-message-actions slot::slotted(input),:host .assistant-message-actions slot::slotted(select),:host .assistant-message-actions slot::slotted(textarea){font-style:normal}:host .assistant-message-actions slot::slotted(:not(luzmo-button):not(button):not(a):not(input):not(select):not(textarea)){font-style:var(--luzmo-ai-chat-assistant-message-actions-font-style,var(--ai-chat-assistant-message-actions-font-style));color:var(--luzmo-ai-chat-assistant-message-actions-color,var(--ai-chat-assistant-message-actions-color))}:host .assistant-context-menu-trigger{width:var(--luzmo-ai-chat-context-menu-trigger-size,var(--ai-chat-context-menu-trigger-size));height:var(--luzmo-ai-chat-context-menu-trigger-size,var(--ai-chat-context-menu-trigger-size));border:.0625rem solid var(--luzmo-ai-chat-context-menu-trigger-border-color,var(--ai-chat-context-menu-trigger-border-color));border-radius:var(--luzmo-ai-chat-context-menu-trigger-border-radius,var(--ai-chat-context-menu-trigger-border-radius));background:var(--luzmo-ai-chat-context-menu-trigger-background,var(--ai-chat-context-menu-trigger-background));color:var(--luzmo-ai-chat-context-menu-trigger-color,var(--ai-chat-context-menu-trigger-color));cursor:pointer;font-size:var(--ai-chat-context-menu-trigger-icon-size);justify-content:center;align-items:center;padding:0;line-height:1;transition:all .15s;display:inline-flex}:host .assistant-context-menu-trigger:hover{background:var(--luzmo-ai-chat-context-menu-trigger-hover-background,var(--ai-chat-context-menu-trigger-hover-background));border-color:var(--luzmo-ai-chat-context-menu-trigger-hover-border-color,var(--ai-chat-context-menu-trigger-hover-border-color));color:var(--luzmo-ai-chat-context-menu-trigger-hover-color,var(--ai-chat-context-menu-trigger-hover-color))}:host .assistant-context-menu-trigger:disabled{cursor:not-allowed;opacity:.6}:host .assistant-context-menu-trigger:disabled:hover{background:var(--luzmo-ai-chat-context-menu-trigger-background,var(--ai-chat-context-menu-trigger-background));border-color:var(--luzmo-ai-chat-context-menu-trigger-border-color,var(--ai-chat-context-menu-trigger-border-color));color:var(--luzmo-ai-chat-context-menu-trigger-color,var(--ai-chat-context-menu-trigger-color))}:host .assistant-context-menu-item{width:100%;color:var(--luzmo-font-color);text-align:start;cursor:pointer;font-family:var(--luzmo-ai-chat-context-menu-item-font-family,var(--ai-chat-context-menu-item-font-family));background:0 0;border:0;padding:.5rem .75rem}:host .assistant-context-menu-item:hover{background:var(--luzmo-ai-chat-context-menu-item-hover-background,var(--ai-chat-context-menu-item-hover-background))}:host .assistant-context-menu-item:disabled{opacity:.4;cursor:not-allowed}:host .assistant-context-menu-item:disabled:hover{background:0 0}:host luzmo-ai-interaction-textarea{flex-grow:0;flex-shrink:0}:host .loading-message{color:var(--luzmo-font-color);align-items:center;gap:.5rem;display:flex}:host .loading-message svg{color:var(--luzmo-ai-chat-loading-message-color,var(--ai-chat-loading-message-color));font-size:var(--luzmo-ai-chat-loading-message-icon-font-size,var(--ai-chat-loading-message-icon-font-size));justify-content:center;align-items:center;display:flex}:host .loading-message svg.spin{animation:1s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){:host .assistant-context-menu-trigger{transition:none}:host .loading-message svg.spin{animation:none}}:host{--ai-chat-background:var(--luzmo-background-color);--ai-chat-border-radius:0;--ai-chat-padding:0;--ai-chat-gap:var(--luzmo-spacing-5);--ai-chat-border:none;--ai-chat-box-shadow:none;--ai-chat-loading-message-color:var(--luzmo-primary);--ai-chat-loading-message-icon-font-size:var(--luzmo-icon-size-m);--ai-chat-error-message-color:var(--luzmo-danger,#dc3545);--ai-chat-cancelled-message-color:var(--luzmo-font-color-dimmed,var(--luzmo-font-color-extra-dimmed));--ai-chat-scrollbar-width:var(--luzmo-scrollbar-size);--ai-chat-scrollbar-track-background:var(--luzmo-scrollbar-track-background);--ai-chat-scrollbar-track-border-radius:var(--luzmo-scrollbar-track-border-radius);--ai-chat-scrollbar-thumb-background:var(--luzmo-scrollbar-thumb-background);--ai-chat-scrollbar-thumb-border-radius:var(--luzmo-scrollbar-thumb-border-radius);--ai-chat-scrollbar-thumb-hover-background:var(--luzmo-scrollbar-thumb-hover-background);--ai-chat-context-menu-trigger-size:var(--luzmo-component-height-xs);--ai-chat-context-menu-trigger-icon-size:var(--luzmo-icon-size-s);--ai-chat-context-menu-trigger-border-color:var(--luzmo-border-color);--ai-chat-context-menu-trigger-border-radius:.375rem;--ai-chat-context-menu-trigger-background:var(--luzmo-background-color,transparent);--ai-chat-context-menu-trigger-color:var(--luzmo-font-color,#5a5a5a);--ai-chat-context-menu-trigger-hover-background:var(--luzmo-background-color-hover,#4434ff14);--ai-chat-context-menu-trigger-hover-border-color:var(--luzmo-border-color-hover,var(--luzmo-border-color));--ai-chat-context-menu-trigger-hover-color:var(--luzmo-font-color,#5a5a5a);--ai-chat-context-menu-item-hover-background:var(--luzmo-background-color-hover,#4434ff14);--ai-chat-context-menu-item-font-family:var(--luzmo-font-family);--ai-chat-markdown-line-height:1.5;--ai-chat-markdown-spacing:var(--luzmo-spacing-3);--ai-chat-markdown-heading-spacing:var(--luzmo-spacing-4);--ai-chat-markdown-heading-font-weight:var(--luzmo-font-weight-bold);--ai-chat-markdown-list-indent:calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-3));--ai-chat-markdown-link-color:var(--luzmo-primary);--ai-chat-markdown-code-font-family:var(--luzmo-font-family-mono,ui-monospace, monospace);--ai-chat-markdown-code-font-size:.875em;--ai-chat-markdown-code-background:var(--luzmo-background-color-highlight);--ai-chat-markdown-code-border-radius:var(--luzmo-border-radius-s);--ai-chat-markdown-border-color:var(--luzmo-border-color);--ai-chat-markdown-table-header-background:var(--luzmo-background-color-highlight);--ai-chat-assistant-message-actions-gap:var(--luzmo-spacing-2);--ai-chat-assistant-message-actions-margin-top:var(--luzmo-spacing-3);--ai-chat-assistant-message-actions-color:var(--luzmo-font-color-extra-dimmed);--ai-chat-assistant-message-actions-font-style:italic;--ai-chat-assistant-message-font-family:var(--luzmo-font-family);--ai-chat-assistant-message-font-size:var(--luzmo-font-size-m);--ai-chat-assistant-message-line-height:var(--ai-chat-markdown-line-height);--ai-chat-user-message-attachment-size:64px}:host([size=s]){--ai-chat-gap:var(--luzmo-spacing-4);--ai-chat-loading-message-icon-font-size:var(--luzmo-icon-size-s);--ai-chat-context-menu-trigger-icon-size:var(--luzmo-icon-size-xs);--ai-chat-assistant-message-font-size:var(--luzmo-font-size-s)}:host([size=l]){--ai-chat-gap:calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-2));--ai-chat-loading-message-icon-font-size:var(--luzmo-icon-size-l);--ai-chat-context-menu-trigger-size:var(--luzmo-component-height-s);--ai-chat-context-menu-trigger-icon-size:var(--luzmo-icon-size-m);--ai-chat-assistant-message-font-size:var(--luzmo-font-size-l)}:host([size=xl]){--ai-chat-gap:calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-3));--ai-chat-loading-message-icon-font-size:var(--luzmo-icon-size-xl);--ai-chat-context-menu-trigger-size:var(--luzmo-component-height);--ai-chat-context-menu-trigger-icon-size:var(--luzmo-icon-size-l);--ai-chat-assistant-message-font-size:var(--luzmo-font-size-xl)}";
2329
+ //#endregion
2330
+ //#region src/components/ai-chat/helpers/agent-config.ts
2331
+ function Nn(e, t) {
2332
+ if (e.agentConfig) {
2333
+ let n = e.agentConfig, r = t ?? Nn({
2334
+ ...e,
2335
+ agentConfig: void 0
2336
+ });
2337
+ return n.context === void 0 && n.type === r.type ? {
2338
+ ...r,
2339
+ ...n,
2340
+ context: r.context
2341
+ } : n.context === void 0 ? {
2342
+ ...n,
2343
+ context: null
2344
+ } : n;
2345
+ }
2346
+ switch (e.agent ?? "item") {
2347
+ case "item":
2348
+ default: return {
2349
+ type: "item",
2350
+ context: {
2351
+ chart: e.chart,
2352
+ task: e.task
2353
+ }
2354
+ };
2355
+ case "dashboard": return {
2356
+ type: "dashboard",
2357
+ context: {
2358
+ dashboard: e.dashboard,
2359
+ currentScreenMode: e.currentScreenMode
2360
+ }
2361
+ };
2362
+ case "custom-item": return {
2363
+ type: "custom-item",
2364
+ context: { customItem: e.customItem }
2365
+ };
2366
+ case "analyst": return { type: "analyst" };
2367
+ }
2368
+ }
2369
+ function Pn(e) {
2370
+ return {
2371
+ chart: null,
2372
+ dashboard: null,
2373
+ customItem: null,
2374
+ currentScreenMode: void 0,
2375
+ task: void 0,
2376
+ ...e.context
2377
+ };
2378
+ }
2379
+ //#endregion
2380
+ //#region src/components/ai-chat/empty-state/ai-chat-empty-state.module.scss?inline
2381
+ var Fn = ":host{box-sizing:border-box;width:100%;min-height:0;padding-block:var(--luzmo-ai-chat-empty-state-padding-block,var(--ai-chat-empty-state-padding-block));padding-inline:var(--luzmo-ai-chat-empty-state-padding-inline,var(--ai-chat-empty-state-padding-inline));flex:1;justify-content:center;align-items:center;display:flex}.empty-state{justify-content:center;align-items:center;gap:var(--luzmo-ai-chat-empty-state-header-actions-gap,var(--ai-chat-empty-state-header-actions-gap));width:100%;max-width:var(--luzmo-ai-chat-empty-state-max-width,var(--ai-chat-empty-state-max-width));text-align:center;flex-direction:column;display:flex}.header{flex-direction:column;align-items:center;width:100%;display:flex}.actions{align-items:center;gap:var(--luzmo-ai-chat-empty-state-actions-gap,var(--ai-chat-empty-state-actions-gap));flex-direction:column;width:100%;display:flex}.title{font-family:var(--luzmo-font-family);font-size:var(--luzmo-ai-chat-empty-state-title-font-size,var(--ai-chat-empty-state-title-font-size));font-weight:var(--luzmo-ai-chat-empty-state-title-font-weight,var(--ai-chat-empty-state-title-font-weight));line-height:var(--luzmo-ai-chat-empty-state-title-line-height,var(--ai-chat-empty-state-title-line-height));color:var(--luzmo-ai-chat-empty-state-title-color,var(--ai-chat-empty-state-title-color));text-wrap:balance;margin:0}.subtitle{font-family:var(--luzmo-font-family);font-size:var(--luzmo-ai-chat-empty-state-subtitle-font-size,var(--ai-chat-empty-state-subtitle-font-size));font-weight:var(--luzmo-ai-chat-empty-state-subtitle-font-weight,var(--ai-chat-empty-state-subtitle-font-weight));line-height:var(--luzmo-ai-chat-empty-state-subtitle-line-height,var(--ai-chat-empty-state-subtitle-line-height));color:var(--luzmo-ai-chat-empty-state-subtitle-color,var(--ai-chat-empty-state-subtitle-color));margin:0}.suggestions{justify-content:center;align-items:center;gap:var(--luzmo-ai-chat-empty-state-suggestions-gap,var(--ai-chat-empty-state-suggestions-gap));flex-wrap:wrap;width:100%;display:flex}luzmo-action-button{max-width:100%}:host{--ai-chat-empty-state-header-actions-gap:1.5rem;--ai-chat-empty-state-actions-gap:var(--luzmo-spacing-4);--ai-chat-empty-state-suggestions-gap:var(--luzmo-spacing-3);--ai-chat-empty-state-max-width:22.5rem;--ai-chat-empty-state-padding-block:2rem;--ai-chat-empty-state-padding-inline:var(--luzmo-spacing-5);--ai-chat-empty-state-title-font-size:var(--luzmo-font-size-l);--ai-chat-empty-state-title-font-weight:var(--luzmo-font-weight);--ai-chat-empty-state-title-line-height:1.4;--ai-chat-empty-state-title-color:var(--luzmo-font-color-hard);--ai-chat-empty-state-subtitle-font-size:var(--luzmo-font-size-s);--ai-chat-empty-state-subtitle-font-weight:var(--luzmo-font-weight);--ai-chat-empty-state-subtitle-line-height:var(--luzmo-line-height);--ai-chat-empty-state-subtitle-color:var(--luzmo-font-color-dimmed,var(--luzmo-font-color-extra-dimmed))}:host([size=s]){--ai-chat-empty-state-title-font-size:var(--luzmo-font-size-m)}:host([size=l]){--ai-chat-empty-state-title-font-size:var(--luzmo-font-size-xl);--ai-chat-empty-state-subtitle-font-size:var(--luzmo-font-size-m)}:host([size=xl]){--ai-chat-empty-state-title-font-size:var(--luzmo-font-size-xxl);--ai-chat-empty-state-subtitle-font-size:var(--luzmo-font-size-l)}", In, Z = class extends a(i, { validSizes: [
2382
+ "s",
2383
+ "m",
2384
+ "l",
2385
+ "xl"
2386
+ ] }) {
2387
+ constructor(...e) {
2388
+ super(...e), this.title = c("What can I help you with?", { desc: "Title for the AI chat empty state" }), this.subtitle = "", this.suggestions = [], this.disabled = !1;
2389
+ }
2390
+ _handleSuggestionActivate(e) {
2391
+ if (this.disabled) return;
2392
+ let t = e.prompt ?? e.label;
2393
+ this.dispatchEvent(new CustomEvent("luzmo-suggestion-selected", {
2394
+ detail: {
2395
+ label: e.label,
2396
+ prompt: t,
2397
+ selectedDatasets: e.selectedDatasets
2398
+ },
2399
+ bubbles: !0,
2400
+ composed: !0
2401
+ }));
2402
+ }
2403
+ render() {
2404
+ let e = this.suggestions.length > 0;
2405
+ return f`
2406
+ <section class="empty-state" aria-labelledby="ai-chat-empty-state-title">
2407
+ <header class="header">
2408
+ <h2 id="ai-chat-empty-state-title" class="title">${this.title}</h2>
2409
+ </header>
2410
+
2411
+ ${e ? f`
2412
+ <div class="actions">
2413
+ ${this.subtitle ? f`<p class="subtitle">${this.subtitle}</p>` : p}
2414
+ <div
2415
+ class="suggestions"
2416
+ role="group"
2417
+ aria-label=${c("Prompt suggestions", { desc: "Accessible label for the AI chat empty state suggestion list" })}
2418
+ >
2419
+ ${this.suggestions.map((e) => f`
2420
+ <luzmo-action-button
2421
+ variant="accent"
2422
+ .size=${this.size}
2423
+ ?disabled=${this.disabled}
2424
+ @click=${() => this._handleSuggestionActivate(e)}
2425
+ >
2426
+ ${e.label}
2427
+ </luzmo-action-button>
2428
+ `)}
2429
+ </div>
2430
+ </div>
2431
+ ` : p}
2432
+ </section>
2433
+ `;
2434
+ }
2435
+ };
2436
+ //#endregion
2437
+ //#region src/components/ai-chat/empty-state/index.ts
2438
+ In = Z, In.styles = m(Fn), In.tagName = "luzmo-ai-chat-empty-state", o([h({ type: String })], Z.prototype, "title", void 0), o([h({ type: String })], Z.prototype, "subtitle", void 0), o([h({ type: Array })], Z.prototype, "suggestions", void 0), o([h({
2439
+ type: Boolean,
2440
+ reflect: !0
2441
+ })], Z.prototype, "disabled", void 0), customElements.get("luzmo-ai-chat-empty-state") || customElements.define("luzmo-ai-chat-empty-state", Z);
2442
+ //#endregion
2443
+ //#region src/components/ai-chat/helpers/elicitation-template.ts
2444
+ var Ln = "answer", Rn = (e) => e.stopPropagation();
2445
+ function zn(e) {
2446
+ let t = e.content?.[Ln];
2447
+ return typeof t == "string" ? t : void 0;
2448
+ }
2449
+ async function Bn(e) {
2450
+ e.stopPropagation();
2451
+ let t = e.currentTarget;
2452
+ await t.updateComplete, t.submit();
2453
+ }
2454
+ function Vn({ message: e, state: t, size: n, onSubmit: r }) {
2455
+ let i = e.elicitation;
2456
+ if (!i) return p;
2457
+ let a = [{
2458
+ id: Ln,
2459
+ type: "single",
2460
+ title: i.question,
2461
+ required: !0,
2462
+ options: i.options.map((e) => ({
2463
+ value: e,
2464
+ label: e
2465
+ }))
2466
+ }];
2467
+ return ne(`${e.id}:${t}`, f`
2468
+ <luzmo-question-box
2469
+ .size=${n}
2470
+ .questions=${a}
2471
+ .value=${te([i.answer], () => i.answer ? { [Ln]: i.answer } : {})}
2472
+ .labels=${{
2473
+ submit: c("Submit", { desc: "Button that sends the chosen answer to an AI agent question" }),
2474
+ answerTitle: c("Answer", { desc: "Heading above the answer chosen for an AI agent question" }),
2475
+ change: c("Change", { desc: "Button that goes back to pick another answer for an AI agent question" })
2476
+ }}
2477
+ ?readonly=${t === "answered"}
2478
+ ?disabled=${t === "closed"}
2479
+ hide-close
2480
+ hide-skip
2481
+ @luzmo-submit=${r}
2482
+ @input=${Rn}
2483
+ @change=${Bn}
2484
+ @luzmo-cancel=${Rn}
2485
+ ></luzmo-question-box>
2486
+ `);
2487
+ }
2488
+ //#endregion
2489
+ //#region src/components/ai-chat/ai-chat-request.ts
2490
+ function Hn(e, t) {
2491
+ return `${e.replace(/\/+$/, "")}/${t.replace(/^\/+|\/+$/g, "")}/aiprompt`;
2492
+ }
2493
+ function Un(e) {
2494
+ return e.type === "placeholder" ? null : {
2495
+ ...e,
2496
+ version: e.version || "",
2497
+ title: e.title || e.options?.title,
2498
+ filters: e.filterGroups || [],
2499
+ aichartId: e.aichartId || ""
2500
+ };
2501
+ }
2502
+ function Wn(e, t, n = []) {
2503
+ return [
2504
+ {
2505
+ type: "text",
2506
+ text: e
2507
+ },
2508
+ ...t.map((e) => ({
2509
+ type: "dataset",
2510
+ id: e
2511
+ })),
2512
+ ...n.map((e) => ({
2513
+ type: "image",
2514
+ url: e
2515
+ }))
2516
+ ];
2517
+ }
2518
+ function Gn(e) {
2519
+ return {
2520
+ stream: e.stream ?? !0,
2521
+ response_mode: "mixed",
2522
+ ...e.conversationId ? { conversation_id: e.conversationId } : {},
2523
+ ...e.localeId ? { locale_id: e.localeId } : {}
2524
+ };
2525
+ }
2526
+ function Kn(e, t, n) {
2527
+ return {
2528
+ agent: e,
2529
+ task: t,
2530
+ ...Gn(n)
2531
+ };
2532
+ }
2533
+ function qn(e) {
2534
+ let t = Wn(e.prompt, e.datasetIds, e.attachmentUrls), n = e.chart ? Un(e.chart) : null;
2535
+ return n && t.push({
2536
+ type: "item",
2537
+ value: n
2538
+ }), {
2539
+ ...Kn("item", e.task ?? "generate", e),
2540
+ input: t
2541
+ };
2542
+ }
2543
+ function Jn(e) {
2544
+ let t = Wn(e.prompt, e.datasetIds, e.attachmentUrls);
2545
+ return e.dashboard && t.push({
2546
+ type: "dashboard",
2547
+ value: e.dashboard,
2548
+ ...e.currentScreenMode ? { current_screen_mode: e.currentScreenMode } : {}
2549
+ }), {
2550
+ ...Kn("dashboard", "generate", e),
2551
+ timezone_id: e.timezoneId ?? "UTC",
2552
+ input: t
2553
+ };
2554
+ }
2555
+ function Yn(e) {
2556
+ return {
2557
+ ...Kn("analyst", "generate", e),
2558
+ input: Wn(e.prompt, e.datasetIds, e.attachmentUrls)
2559
+ };
2560
+ }
2561
+ function Xn(e) {
2562
+ let t = Wn(e.prompt, [], e.attachmentUrls);
2563
+ return e.customItem && t.push({
2564
+ type: "custom-item",
2565
+ value: e.customItem
2566
+ }), {
2567
+ ...Kn("custom-item", "generate", e),
2568
+ text_format: "markdown",
2569
+ ...e.internal ? { internal: !0 } : {},
2570
+ input: t
2571
+ };
2572
+ }
2573
+ function Zn(e, t) {
2574
+ let n = Wn(t.prompt, t.datasetIds, t.attachmentUrls), r = t.chart ? Un(t.chart) : null;
2575
+ return r && n.push({
2576
+ type: "item",
2577
+ value: r
2578
+ }), t.dashboard && n.push({
2579
+ type: "dashboard",
2580
+ value: t.dashboard,
2581
+ ...t.currentScreenMode ? { current_screen_mode: t.currentScreenMode } : {}
2582
+ }), {
2583
+ agent_id: e,
2584
+ ...Gn(t),
2585
+ input: n
2586
+ };
2587
+ }
2588
+ function Qn(e, t) {
2589
+ if (t.agentId) return Zn(t.agentId, t);
2590
+ switch (e) {
2591
+ case "dashboard": return Jn(t);
2592
+ case "analyst": return Yn(t);
2593
+ case "custom-item": return Xn(t);
2594
+ default: return qn(t);
2595
+ }
2596
+ }
2597
+ function $n(e, n) {
2598
+ let { authKey: r, authToken: i, apiVersion: a = "0.1.0" } = n;
2599
+ return n.attachmentUrls?.length && t(n.attachmentUrls), {
2600
+ key: r,
2601
+ token: i,
2602
+ action: "create",
2603
+ version: a,
2604
+ properties: Qn(e, n)
2605
+ };
2606
+ }
2607
+ function er(e, t, n, r = "0.1.0", i = null) {
2608
+ return {
2609
+ key: t,
2610
+ token: n,
2611
+ action: "delete",
2612
+ version: r,
2613
+ properties: {
2614
+ agent: "item",
2615
+ restore_to_message_id: e,
2616
+ ...i ? { conversation_id: i } : {}
2617
+ }
2618
+ };
2619
+ }
2620
+ //#endregion
2621
+ //#region src/components/ai-chat/stream/transport.ts
2622
+ async function tr(e) {
2623
+ let t = await fetch(e.url, {
2624
+ method: "POST",
2625
+ headers: { "Content-Type": "application/json" },
2626
+ mode: "cors",
2627
+ body: JSON.stringify(e.body),
2628
+ signal: e.signal
2629
+ });
2630
+ if (!t.ok) {
2631
+ let e = await t.json().catch(() => null);
2632
+ throw Error(e?.message || `API request failed with status ${t.status}`);
2633
+ }
2634
+ if (!t.body) throw Error("Response body is not readable");
2635
+ return {
2636
+ body: t.body,
2637
+ conversationId: t.headers.get("x-conversation-id")
2638
+ };
2639
+ }
2640
+ function nr(e) {
2641
+ let t = e.trim();
2642
+ if (!t || t.startsWith(":") || t.startsWith("event:") || t.startsWith("id:")) return null;
2643
+ let n = t;
2644
+ return n.startsWith("data:") && (n = n.slice(5).trimStart()), !n || n === "[DONE]" ? null : JSON.parse(n);
2645
+ }
2646
+ function rr(e, t) {
2647
+ try {
2648
+ let n = nr(e);
2649
+ n && t(n);
2650
+ } catch {
2651
+ console.error("Failed to parse stream line");
2652
+ }
2653
+ }
2654
+ async function ir(e, t) {
2655
+ let n = e.getReader(), r = new TextDecoder(), i = "";
2656
+ try {
2657
+ for (;;) {
2658
+ let { done: e, value: a } = await n.read();
2659
+ if (e) break;
2660
+ i += r.decode(a, { stream: !0 });
2661
+ let o = i.split(/\r?\n/);
2662
+ i = o.pop() ?? "";
2663
+ for (let e of o) rr(e, t);
2664
+ }
2665
+ i += r.decode();
2666
+ let e = i.trim();
2667
+ e && rr(e, t);
2668
+ } finally {
2669
+ n.releaseLock();
2670
+ }
2671
+ }
2672
+ //#endregion
2673
+ //#region src/components/ai-chat/stream/progress.ts
2674
+ function ar() {
2675
+ return {
2676
+ id: "root",
2677
+ step: "root",
2678
+ status: "pending",
2679
+ children: [{
2680
+ id: "client-init",
2681
+ step: "iqInit",
2682
+ status: "inProgress",
2683
+ description: c("Thinking", { desc: "Label shown in the AI chat progress tree while the assistant starts processing a prompt" })
2684
+ }]
2685
+ };
2686
+ }
2687
+ function or(e) {
2688
+ let t = e.progress;
2689
+ return typeof t != "object" || !t ? !1 : "id" in t && "step" in t && "status" in t;
2690
+ }
2691
+ //#endregion
2692
+ //#region src/components/ai-chat/stream/chunk-extractors.ts
2693
+ function sr(e) {
2694
+ if (!e || typeof e != "object") return "";
2695
+ let t = e.assistant_message;
2696
+ if (!t || typeof t != "object") return "";
2697
+ if (typeof t.message == "string") return t.message;
2698
+ if (typeof t.text == "string") return t.text;
2699
+ if (typeof t.summary == "string") return t.summary;
2700
+ let n = t.content;
2701
+ return typeof n == "string" ? n : n && typeof n == "object" && typeof n.text == "string" ? n.text : "";
2702
+ }
2703
+ function cr(e) {
2704
+ return e.type === "text_delta" && typeof e.delta == "string" ? e.delta : typeof e.text_delta == "string" ? e.text_delta : typeof e.chunk == "string" ? e.chunk : typeof e.message == "string" ? e.message : typeof e.summary == "string" ? e.summary : "";
2705
+ }
2706
+ function lr(e) {
2707
+ return sr(e.result);
2708
+ }
2709
+ function ur(e) {
2710
+ return !!e.done || e.type === "finish" || e.type === "done" || "question" in e;
2711
+ }
2712
+ function dr(e, t) {
2713
+ let n = typeof e.conversation_id == "string" && e.conversation_id || typeof e.conversationId == "string" && e.conversationId;
2714
+ n && t.callbacks.onConversationIdChange(n);
2715
+ }
2716
+ function fr(e) {
2717
+ for (let t of e) if (t && typeof t == "object" && t.type === "item") {
2718
+ let e = t.value;
2719
+ if (e && typeof e == "object") return e;
2720
+ }
2721
+ return null;
2722
+ }
2723
+ function pr(e) {
2724
+ let t = e.chart ?? e.generatedChart;
2725
+ if (t && typeof t == "object") return t;
2726
+ let n = e.aiMessageAssets ?? e.ai_message_assets;
2727
+ if (Array.isArray(n)) {
2728
+ let e = fr(n);
2729
+ if (e) return e;
2730
+ }
2731
+ let r = e.result;
2732
+ if (r && typeof r == "object") {
2733
+ let e = r.assistant_message, t = e?.aiMessageAssets ?? e?.ai_message_assets;
2734
+ if (Array.isArray(t)) return fr(t);
2735
+ }
2736
+ return null;
2737
+ }
2738
+ function mr(e) {
2739
+ for (let t of e) if (t && typeof t == "object" && t.type === "dashboard") {
2740
+ let e = t.value;
2741
+ if (e && typeof e == "object" && Array.isArray(e.views)) return e;
2742
+ }
2743
+ return null;
2744
+ }
2745
+ function hr(e) {
2746
+ for (let t of e) if (t && typeof t == "object" && t.type === "dashboard") {
2747
+ let e = t.name;
2748
+ if (e && typeof e == "object") return e;
2749
+ }
2750
+ }
2751
+ function gr(...e) {
2752
+ return e.find(Array.isArray);
2753
+ }
2754
+ function _r(e) {
2755
+ if (e.views && Array.isArray(e.views)) return e;
2756
+ let t = e.aiMessageAssets ?? e.ai_message_assets;
2757
+ if (Array.isArray(t)) return mr(t);
2758
+ let n = e.result;
2759
+ if (n && typeof n == "object") {
2760
+ let e = n.assistant_message, t = e?.aiMessageAssets ?? e?.ai_message_assets;
2761
+ if (Array.isArray(t)) return mr(t);
2762
+ }
2763
+ return null;
2764
+ }
2765
+ function vr(e) {
2766
+ let t = e.aiMessageAssets ?? e.ai_message_assets, n = e.result?.assistant_message, r = gr(t, n?.aiMessageAssets ?? n?.ai_message_assets);
2767
+ return r ? hr(r) : void 0;
2768
+ }
2769
+ function yr(e) {
2770
+ let t = e.result?.assistant_message;
2771
+ for (let n of [e.aiMessageAssets ?? e.ai_message_assets, t?.aiMessageAssets ?? t?.ai_message_assets]) if (Array.isArray(n)) {
2772
+ for (let e of n) if (e && typeof e == "object" && e.type === "custom-item" && e.value && typeof e.value == "object" && !Array.isArray(e.value)) return e.value;
2773
+ }
2774
+ return null;
2775
+ }
2776
+ //#endregion
2777
+ //#region src/components/ai-chat/stream/stream-processor.ts
2778
+ var br = /* @__PURE__ */ new Set([
2779
+ "conversation-id",
2780
+ "conversation_id",
2781
+ "keepalive",
2782
+ "ping",
2783
+ "finish",
2784
+ "done"
2785
+ ]);
2786
+ function xr(e, t, n) {
2787
+ return {
2788
+ agent: n.agent,
2789
+ conversationId: t.callbacks.getConversationId(),
2790
+ ...typeof e.messageId == "string" ? { messageId: e.messageId } : {},
2791
+ raw: e
2792
+ };
2793
+ }
2794
+ function Q(e, t, n, r, i) {
2795
+ let a = {
2796
+ ...xr(n, e, t),
2797
+ recognized: !0,
2798
+ type: r,
2799
+ data: i
2800
+ };
2801
+ e.callbacks.onStep(a);
2802
+ }
2803
+ function Sr(e, t, n, r, i) {
2804
+ let a = {
2805
+ ...xr(n, e, t),
2806
+ recognized: !1,
2807
+ type: r,
2808
+ data: i
2809
+ };
2810
+ e.callbacks.onStep(a);
2811
+ }
2812
+ function Cr(e) {
2813
+ e.state.progressCollapsed || (e.state.progressCollapsed = !0, e.callbacks.onProgressCollapsed(!0));
2814
+ }
2815
+ function wr(e, t) {
2816
+ Cr(e), e.aiMessage.message = (e.aiMessage.message || "") + t, e.callbacks.onMessageUpdate(e.aiMessage);
2817
+ }
2818
+ function Tr(e) {
2819
+ if (!e) return null;
2820
+ let t = e.descriptionMetadata?.decision;
2821
+ if (t === "create" || t === "edit" || t === "question") return t;
2822
+ for (let t of e.children ?? []) {
2823
+ let e = Tr(t);
2824
+ if (e) return e;
2825
+ }
2826
+ return null;
2827
+ }
2828
+ function Er(e, t, n) {
2829
+ if (!or(e)) return !1;
2830
+ let r = e.progress;
2831
+ if (t.callbacks.onProgress(r), Q(t, n, e, "progress", r), t.state.decision === null) {
2832
+ let i = Tr(r);
2833
+ i && (t.state.decision = i, Q(t, n, e, "decision", { decision: i }));
2834
+ }
2835
+ return !0;
2836
+ }
2837
+ function Dr(e) {
2838
+ return !!e.error || e.type === "error" || typeof e.error_text == "string";
2839
+ }
2840
+ function Or(e) {
2841
+ return typeof e.error_text == "string" && e.error_text ? e.error_text : typeof e.error == "string" && e.error ? e.error : c("Something went wrong. Please try again.", { desc: "Generic error message shown in ai chat when the API request fails" });
2842
+ }
2843
+ function kr(e, t, n) {
2844
+ if (!Dr(e)) return !1;
2845
+ let r = Or(e);
2846
+ return t.aiMessage.message = r, t.aiMessage.isError = !0, delete t.aiMessage.elicitation, t.callbacks.onMessageUpdate(t.aiMessage), $r(e, t, n, e.error ?? r), !0;
2847
+ }
2848
+ function Ar(e) {
2849
+ return typeof e.question == "string" && e.question ? e.question : typeof e.text == "string" && e.text ? e.text : "";
2850
+ }
2851
+ function jr(e, t, n) {
2852
+ if (e.type !== "interrupt") return !1;
2853
+ let r = Ar(e);
2854
+ return r && (t.state.interruptQuestion = r, wr(t, r), Q(t, n, e, "interrupt", { question: r })), $r(e, t, n), !0;
2855
+ }
2856
+ function Mr(e) {
2857
+ let t = e.elicitation;
2858
+ if (!t || typeof t != "object") return null;
2859
+ let { question: n, options: r } = t, i = typeof n == "string" ? n.trim() : "", a = Array.isArray(r) ? [...new Set(r.filter((e) => typeof e == "string").map((e) => e.trim()))].filter(Boolean) : [];
2860
+ return i && a.length >= 2 ? {
2861
+ question: i,
2862
+ options: a
2863
+ } : null;
2864
+ }
2865
+ function Nr(e, t, n) {
2866
+ if (e.type !== "elicitation") return !1;
2867
+ let r = Mr(e);
2868
+ return r ? (Cr(t), t.aiMessage.elicitation = r, t.callbacks.onMessageUpdate(t.aiMessage), Q(t, n, e, "elicitation", {
2869
+ question: r.question,
2870
+ options: r.options
2871
+ }), !0) : (Sr(t, n, e, "elicitation", e), !0);
2872
+ }
2873
+ function Pr(e) {
2874
+ return typeof e.asset_id == "string" ? e.asset_id : typeof e.asset_type == "string" ? e.asset_type : "default";
2875
+ }
2876
+ function Fr(e) {
2877
+ return typeof e.asset_type == "string" ? e.asset_type : "";
2878
+ }
2879
+ function Ir(e) {
2880
+ return {
2881
+ assetType: Fr(e),
2882
+ snapshot: {}
2883
+ };
2884
+ }
2885
+ function Lr(e, t) {
2886
+ return {
2887
+ ...e,
2888
+ ...t
2889
+ };
2890
+ }
2891
+ function Rr(e) {
2892
+ let t = e.asset_delta ?? e.delta;
2893
+ return t && typeof t == "object" ? t : null;
2894
+ }
2895
+ function zr(e, t) {
2896
+ t.state.assets[Pr(e)] = Ir(e);
2897
+ }
2898
+ function Br(e, t) {
2899
+ let n = Pr(e), r = t.state.assets[n] ?? Ir(e), i = Rr(e);
2900
+ i && (r.snapshot = Lr(r.snapshot, i)), t.state.assets[n] = r;
2901
+ }
2902
+ function Vr(e, t) {
2903
+ let n = e.asset ?? e.value ?? e.asset_delta ?? e.delta;
2904
+ return n && typeof n == "object" ? Lr(t?.snapshot ?? {}, n) : t?.snapshot ?? {};
2905
+ }
2906
+ function Hr(e, t, n) {
2907
+ let r = Pr(e), i = t.state.assets[r], a = i?.assetType || Fr(e), o = Vr(e, i);
2908
+ delete t.state.assets[r], Kr(a, o, e, t, n);
2909
+ }
2910
+ function Ur(e, t, n) {
2911
+ switch (e.type) {
2912
+ case "asset_start": return zr(e, t), !0;
2913
+ case "asset_delta": return Br(e, t), !0;
2914
+ case "asset_end": return Hr(e, t, n), !0;
2915
+ default: return !1;
2916
+ }
2917
+ }
2918
+ function Wr(e, t, n, r) {
2919
+ n.state.chartSnapshot = e, n.aiMessage.hasChart = !0, typeof t.messageId == "string" && (n.aiMessage.apiMessageId = t.messageId), n.callbacks.onMessageUpdate(n.aiMessage), Q(n, r, t, "chart", e);
2920
+ }
2921
+ function Gr(e, t, n, r) {
2922
+ n.state.customItemSnapshot = e, Q(n, r, t, "custom-item", e);
2923
+ }
2924
+ function Kr(e, t, n, r, i) {
2925
+ switch (e) {
2926
+ case "dashboard-title": {
2927
+ let e = t.name;
2928
+ e && typeof e == "object" && (r.state.dashboardName = e, Q(r, i, n, "dashboard-title", { name: e }));
2929
+ return;
2930
+ }
2931
+ case "dashboard-layout":
2932
+ Q(r, i, n, "dashboard-layout", t);
2933
+ return;
2934
+ case "dashboard-item":
2935
+ Q(r, i, n, "dashboard-item", {
2936
+ slot: Number(t.slot),
2937
+ chart: t.chart ?? t
2938
+ });
2939
+ return;
2940
+ case "dashboard":
2941
+ r.state.dashboardSnapshot = t;
2942
+ return;
2943
+ default: qr(e, t, n, r, i);
2944
+ }
2945
+ }
2946
+ function qr(e, t, n, r, i) {
2947
+ if (i.chartAssetType && e === i.chartAssetType) {
2948
+ Wr(t, n, r, i);
2949
+ return;
2950
+ }
2951
+ if (i.dashboardAssetType && e === i.dashboardAssetType) {
2952
+ r.state.dashboardSnapshot = t;
2953
+ return;
2954
+ }
2955
+ if (i.customItemAssetType && e === i.customItemAssetType) {
2956
+ Gr(t, n, r, i);
2957
+ return;
2958
+ }
2959
+ Sr(r, i, n, e || "asset", t);
2960
+ }
2961
+ function Jr(e, t, n) {
2962
+ let r = !1;
2963
+ if (n.dashboardAssetType) {
2964
+ let n = _r(e);
2965
+ if (n) {
2966
+ t.state.dashboardSnapshot = n;
2967
+ let i = vr(e);
2968
+ i && (t.state.dashboardName = i), r = !0;
2969
+ }
2970
+ }
2971
+ if (n.chartAssetType && !t.state.chartSnapshot) {
2972
+ let i = pr(e);
2973
+ i && (Wr(i, e, t, n), r = !0);
2974
+ }
2975
+ if (n.customItemAssetType && !t.state.customItemSnapshot) {
2976
+ let i = yr(e);
2977
+ i && (Gr(i, e, t, n), r = !0);
2978
+ }
2979
+ return r;
2980
+ }
2981
+ function Yr(e, t, n) {
2982
+ return {
2983
+ ...e,
2984
+ generatedChart: t,
2985
+ conversationId: n.callbacks.getConversationId()
2986
+ };
2987
+ }
2988
+ function Xr(e, t, n) {
2989
+ for (let r of Object.keys(t.state.assets)) {
2990
+ let i = t.state.assets[r];
2991
+ delete t.state.assets[r], !(n.chartAssetType && i.assetType === n.chartAssetType && t.state.chartSnapshot || n.dashboardAssetType && i.assetType === n.dashboardAssetType && t.state.dashboardSnapshot || n.customItemAssetType && i.assetType === n.customItemAssetType && t.state.customItemSnapshot) && Kr(i.assetType, i.snapshot, e, t, n);
2992
+ }
2993
+ }
2994
+ function Zr(e, t) {
2995
+ let n = lr(e);
2996
+ !n || t.aiMessage.message === n || (t.aiMessage.message = n, t.callbacks.onMessageUpdate(t.aiMessage));
2997
+ }
2998
+ function Qr(e, t, n) {
2999
+ let r = t.state.dashboardSnapshot ?? (n.dashboardAssetType ? _r(e) : null), i = t.state.chartSnapshot ?? (n.chartAssetType ? pr(e) : null);
3000
+ return {
3001
+ agent: n.agent,
3002
+ conversationId: t.callbacks.getConversationId(),
3003
+ message: t.aiMessage,
3004
+ ...r ? { dashboard: r } : {},
3005
+ ...i ? { chart: Yr(e, i, t) } : {},
3006
+ ...t.state.customItemSnapshot ? { customItem: t.state.customItemSnapshot } : {},
3007
+ ...t.state.dashboardName ? { name: t.state.dashboardName } : {},
3008
+ raw: e
3009
+ };
3010
+ }
3011
+ function $r(e, t, n, r) {
3012
+ if (!t.state.completed) {
3013
+ if (t.state.completed = !0, Xr(e, t, n), Cr(t), r !== void 0) {
3014
+ t.callbacks.onComplete({
3015
+ agent: n.agent,
3016
+ conversationId: t.callbacks.getConversationId(),
3017
+ message: t.aiMessage,
3018
+ error: r,
3019
+ raw: e
3020
+ });
3021
+ return;
3022
+ }
3023
+ Zr(e, t), t.callbacks.onComplete(Qr(e, t, n));
3024
+ }
3025
+ }
3026
+ function ei(e) {
3027
+ return typeof e.type == "string" && e.type ? e.type : typeof e.asset_type == "string" && e.asset_type ? e.asset_type : "";
3028
+ }
3029
+ function ti(e, t, n) {
3030
+ let r = cr(e);
3031
+ return r ? (t.state.accumulatedText += r, wr(t, r), Q(t, n, e, "text", {
3032
+ delta: r,
3033
+ text: t.state.accumulatedText
3034
+ }), !0) : !1;
3035
+ }
3036
+ function ni(e, t, n, r, i) {
3037
+ if (r || i) return;
3038
+ let a = ei(e);
3039
+ a && !br.has(a) && Sr(t, n, e, a, e);
3040
+ }
3041
+ function ri(e, t, n) {
3042
+ if (dr(e, t), Er(e, t, n) || kr(e, t, n) || jr(e, t, n) || Nr(e, t, n) || Ur(e, t, n)) return;
3043
+ let r = ti(e, t, n), i = Jr(e, t, n), a = r || i, o = ur(e);
3044
+ ni(e, t, n, a, o), o && $r(e, t, n);
3045
+ }
3046
+ //#endregion
3047
+ //#region src/components/ai-chat/stream/registry.ts
3048
+ function ii(e) {
3049
+ switch (e) {
3050
+ case "dashboard": return {
3051
+ agent: e,
3052
+ dashboardAssetType: "dashboard"
3053
+ };
3054
+ case "item": return {
3055
+ agent: e,
3056
+ chartAssetType: "item"
3057
+ };
3058
+ case "custom-item": return {
3059
+ agent: e,
3060
+ customItemAssetType: "custom-item"
3061
+ };
3062
+ default: return { agent: e };
3063
+ }
3064
+ }
3065
+ function ai(e) {
3066
+ let t = ii(e);
3067
+ return (e, n) => ri(e, n, t);
3068
+ }
3069
+ function oi() {
3070
+ return {
3071
+ progressCollapsed: !1,
3072
+ accumulatedText: "",
3073
+ decision: null,
3074
+ assets: {},
3075
+ dashboardSnapshot: null,
3076
+ dashboardName: void 0,
3077
+ chartSnapshot: null,
3078
+ customItemSnapshot: null,
3079
+ interruptQuestion: null,
3080
+ completed: !1
3081
+ };
3082
+ }
3083
+ //#endregion
3084
+ //#region src/components/ai-chat/session/ai-chat-session.ts
3085
+ function si() {
3086
+ return `msg-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
3087
+ }
3088
+ var ci = class {
3089
+ constructor(e, t = {}) {
3090
+ this._uiBridgeCallbacks = {}, this._subscribers = /* @__PURE__ */ new Set(), this._state = {
3091
+ messages: [],
3092
+ selectedDatasets: [],
3093
+ isGenerating: !1,
3094
+ progress: null,
3095
+ progressCollapsed: !1,
3096
+ conversationId: null,
3097
+ inflightMessage: null
3098
+ }, this._abortController = null, this._inflightMessage = null, this._receivedProgress = !1, this._config = {
3099
+ apiUrl: "https://api.luzmo.com",
3100
+ apiVersion: "0.1.0",
3101
+ stream: !0,
3102
+ ...e
3103
+ }, e.agentConfig && (this._config.agentConfig = Nn(e)), this._hostCallbacks = t, this._state = {
3104
+ ...this._state,
3105
+ messages: e.messages ? [...e.messages] : [],
3106
+ selectedDatasets: e.selectedDatasets ? [...e.selectedDatasets] : [],
3107
+ conversationId: e.conversationId ?? null,
3108
+ isGenerating: e.isGenerating ?? !1,
3109
+ progress: e.progress ?? null,
3110
+ progressCollapsed: e.progressCollapsed ?? !1
3111
+ };
3112
+ }
3113
+ get state() {
3114
+ return this._state;
3115
+ }
3116
+ get isGenerating() {
3117
+ return this._state.isGenerating;
3118
+ }
3119
+ get agentConfig() {
3120
+ return Nn(this._config);
3121
+ }
3122
+ subscribe(e) {
3123
+ return this._subscribers.add(e), e(this._state), () => {
3124
+ this._subscribers.delete(e);
3125
+ };
3126
+ }
3127
+ setUiBridge(e) {
3128
+ this._uiBridgeCallbacks = e;
3129
+ }
3130
+ updateConfig(e) {
3131
+ let t = this.agentConfig, n = this._config.agentConfig !== void 0;
3132
+ this._config = {
3133
+ ...this._config,
3134
+ ...e
3135
+ }, e.agentConfig && (this._config.agentConfig = Nn(this._config, t));
3136
+ let r = {};
3137
+ if ("conversationId" in e) {
3138
+ let t = e.conversationId ?? null;
3139
+ t !== this._state.conversationId && (r.conversationId = t);
3140
+ }
3141
+ if ("selectedDatasets" in e && e.selectedDatasets) {
3142
+ let t = [...e.selectedDatasets];
3143
+ this._areSelectedDatasetsEqual(t, this._state.selectedDatasets) || (r.selectedDatasets = t);
3144
+ }
3145
+ if ("messages" in e && e.messages) {
3146
+ let t = [...e.messages];
3147
+ this._areChatMessagesEqual(t, this._state.messages) || (r.messages = t);
3148
+ }
3149
+ if ("isGenerating" in e && e.isGenerating !== this._state.isGenerating && (r.isGenerating = e.isGenerating), "progress" in e && (r.progress = e.progress ?? null), "progressCollapsed" in e && e.progressCollapsed !== this._state.progressCollapsed && (r.progressCollapsed = e.progressCollapsed), Object.keys(r).length > 0) this._patchState(r);
3150
+ else if ("agentConfig" in e && (n || this._config.agentConfig !== void 0)) {
3151
+ let e = this.agentConfig;
3152
+ (e.type !== t.type || e.context !== t.context) && this._notifySubscribers();
3153
+ }
3154
+ }
3155
+ setSelectedDatasets(e) {
3156
+ this._patchState({ selectedDatasets: [...e] }), this._emit("onDatasetsChanged", this._state.selectedDatasets);
3157
+ }
3158
+ addDataset(e) {
3159
+ this._state.selectedDatasets.some((t) => t.id === e.id) || (this._patchState({ selectedDatasets: [...this._state.selectedDatasets, e] }), this._emit("onDatasetsChanged", this._state.selectedDatasets));
3160
+ }
3161
+ removeDataset(e) {
3162
+ let t = this._state.selectedDatasets.filter((t) => t.id !== e);
3163
+ t.length !== this._state.selectedDatasets.length && (this._patchState({ selectedDatasets: t }), this._emit("onDatasetsChanged", this._state.selectedDatasets));
3164
+ }
3165
+ isDatasetRequirementMet(e) {
3166
+ return !this._config.requireDataset || this._state.selectedDatasets.length > 0 || !!e;
3167
+ }
3168
+ getAiPromptUrl() {
3169
+ return Hn(this._config.apiUrl ?? "https://api.luzmo.com", this._config.apiVersion ?? "0.1.0");
3170
+ }
3171
+ buildRequestBody(e, t, n = [], r = this._config.agentId, i = {}) {
3172
+ return $n(this.agentConfig.type, {
3173
+ prompt: e,
3174
+ datasetIds: t,
3175
+ authKey: this._config.authKey,
3176
+ authToken: this._config.authToken,
3177
+ conversationId: this._state.conversationId,
3178
+ agentId: r,
3179
+ chart: this._config.chart ?? null,
3180
+ dashboard: this._config.dashboard ?? null,
3181
+ customItem: this._config.customItem ?? null,
3182
+ currentScreenMode: this._config.currentScreenMode,
3183
+ localeId: this._config.localeId,
3184
+ timezoneId: this._config.timezoneId,
3185
+ task: this._config.task,
3186
+ ...this._config.agentConfig ? Pn(this.agentConfig) : {},
3187
+ modelPreference: this._config.modelPreference,
3188
+ apiVersion: this._config.apiVersion,
3189
+ stream: this._config.stream,
3190
+ attachmentUrls: n,
3191
+ internal: i.internal
3192
+ });
3193
+ }
3194
+ buildPromptSubmittedDetail(e) {
3195
+ let t = e.attachmentUrls ?? [];
3196
+ return {
3197
+ prompt: e.prompt,
3198
+ selectedDatasets: e.selectedDatasets,
3199
+ datasetIds: e.datasetIds,
3200
+ agent: this.agentConfig.type,
3201
+ request: this.buildRequestBody(e.prompt, e.datasetIds, t, e.agentId, { internal: e.internal }),
3202
+ url: this.getAiPromptUrl(),
3203
+ ...e.signal ? { signal: e.signal } : {},
3204
+ ...e.attachments?.length ? { attachments: e.attachments } : {},
3205
+ ...t.length ? { attachmentUrls: t } : {}
3206
+ };
3207
+ }
3208
+ async _resolveAttachmentUrls(e, i) {
3209
+ if (e.attachmentUrls?.length) return t(e.attachmentUrls), [...e.attachmentUrls];
3210
+ let a = (e.attachments ?? []).map((e) => e.file).filter((e) => !!e);
3211
+ if (a.length === 0) return [];
3212
+ r(a);
3213
+ let o = this._hostCallbacks.uploadAttachments ?? this._uiBridgeCallbacks.uploadAttachments;
3214
+ if (typeof o == "function") return this._normalizeUploadedUrls(await o(a, { signal: i }), a.length);
3215
+ let { authKey: s, authToken: c, apiUrl: l = "https://api.luzmo.com", apiVersion: u = "0.1.0" } = this._config;
3216
+ if (!s || !c) {
3217
+ if (this._hasCallback("onPromptSubmitted")) return [];
3218
+ throw Error("Image attachments require authKey/authToken for built-in upload, or provide uploadAttachments / attachmentUrls.");
3219
+ }
3220
+ return this._normalizeUploadedUrls(await n({
3221
+ files: a,
3222
+ authKey: s,
3223
+ authToken: c,
3224
+ apiUrl: l,
3225
+ apiVersion: u,
3226
+ signal: i
3227
+ }), a.length);
3228
+ }
3229
+ _normalizeUploadedUrls(e, n) {
3230
+ let r = Array.isArray(e) ? e.filter((e) => typeof e == "string" && e.trim().length > 0) : [];
3231
+ if (r.length !== n) throw Error(`Image upload returned ${r.length} URL(s) for ${n} file(s). Return one non-empty signed URL per file, in the same order.`);
3232
+ return t(r), r;
3233
+ }
3234
+ async submit(e) {
3235
+ await this._submit(e);
3236
+ }
3237
+ async _submit(e) {
3238
+ let t = e.datasetIds ?? this._state.selectedDatasets.map((e) => e.id);
3239
+ if (!this.isDatasetRequirementMet(e.agentId)) return !1;
3240
+ this._abortInflight();
3241
+ let n = new AbortController();
3242
+ this._abortController = n;
3243
+ let r;
3244
+ try {
3245
+ r = await this._resolveAttachmentUrls(e, n.signal);
3246
+ } catch (e) {
3247
+ if (this._abortController === n && (this._abortController = null), n.signal.aborted || e.name === "AbortError") return !1;
3248
+ throw e;
3249
+ }
3250
+ if (n.signal.aborted || this._abortController !== n) return !1;
3251
+ let i = {
3252
+ id: e.aiMessageId ?? si(),
3253
+ type: "ai",
3254
+ message: ""
3255
+ }, a = [...this._state.messages];
3256
+ if (!e.skipUserMessage) {
3257
+ let t = {
3258
+ id: si(),
3259
+ type: "user",
3260
+ message: e.prompt,
3261
+ ...r.length ? { attachmentUrls: r } : {}
3262
+ };
3263
+ a = [...a, t], this._emit("onMessageSent", t, [...this._state.selectedDatasets]);
3264
+ }
3265
+ a = [...a, i], this._inflightMessage = i, this._receivedProgress = !1, this._patchState({
3266
+ messages: a,
3267
+ isGenerating: !0,
3268
+ progress: ar(),
3269
+ progressCollapsed: !1,
3270
+ inflightMessage: i
3271
+ });
3272
+ let o = t, s = [...this._state.selectedDatasets];
3273
+ if (this._hasCallback("onPromptSubmitted")) {
3274
+ let t = this.buildPromptSubmittedDetail({
3275
+ prompt: e.prompt,
3276
+ selectedDatasets: s,
3277
+ datasetIds: o,
3278
+ signal: n.signal,
3279
+ attachments: e.attachments,
3280
+ attachmentUrls: r,
3281
+ agentId: e.agentId,
3282
+ internal: e.internal
3283
+ });
3284
+ try {
3285
+ await this._invokeCallback("onPromptSubmitted", t);
3286
+ } catch (e) {
3287
+ e.name === "AbortError" ? this.abort() : (this._handleSubmitError(e, i, t.agent), this._finalizeInflightMessage()), this._patchState({ isGenerating: !1 });
3288
+ }
3289
+ return !0;
3290
+ }
3291
+ let c = this.buildRequestBody(e.prompt, t, r, e.agentId, { internal: e.internal }), l = this.agentConfig.type, u = ai(l), d = {
3292
+ aiMessage: i,
3293
+ callbacks: this._createStreamCallbacks(),
3294
+ state: oi()
3295
+ }, f = this._config.fetchStreaming ?? tr, p = !1;
3296
+ try {
3297
+ let { body: e, conversationId: t } = await f({
3298
+ url: this.getAiPromptUrl(),
3299
+ body: c,
3300
+ signal: n.signal
3301
+ });
3302
+ t && this._setConversationId(t), await ir(e, (e) => u(e, d)), p = !0;
3303
+ } catch (e) {
3304
+ e.name !== "AbortError" && (this._handleSubmitError(e, i, l), p = !0);
3305
+ } finally {
3306
+ this._abortController === n && (p ? this._finalizeInflightMessage() : this._discardInflightMessage(), this._patchState({ isGenerating: !1 }), this._abortController = null);
3307
+ }
3308
+ return !0;
3309
+ }
3310
+ async answerElicitation(e, t, n = {}) {
3311
+ let r = this._state.messages.at(-1), i = r?.id === e ? r.elicitation : void 0;
3312
+ if (this._state.isGenerating || !i || i.answer || !i.options.includes(t) || !this.isDatasetRequirementMet(n.agentId)) return !1;
3313
+ let a = (t) => {
3314
+ this._patchState({ messages: this._state.messages.map((n) => n.id === e ? {
3315
+ ...n,
3316
+ elicitation: {
3317
+ ...i,
3318
+ answer: t
3319
+ }
3320
+ } : n) });
3321
+ };
3322
+ a(t);
3323
+ let o = !1;
3324
+ try {
3325
+ o = await this._submit({
3326
+ ...n,
3327
+ prompt: t
3328
+ });
3329
+ } finally {
3330
+ o || a(void 0);
3331
+ }
3332
+ return o;
3333
+ }
3334
+ async restore(e) {
3335
+ let t = this.agentConfig.type;
3336
+ if (t !== "item") return {};
3337
+ let n = er(e.restoreToMessageId, this._config.authKey, this._config.authToken, this._config.apiVersion, this._state.conversationId);
3338
+ if (this._patchState({
3339
+ isGenerating: !0,
3340
+ progress: null,
3341
+ progressCollapsed: !1
3342
+ }), this._hasCallback("onRestoreRequested")) {
3343
+ let t = {
3344
+ apiMessageId: e.restoreToMessageId,
3345
+ messageIndex: e.messageIndex,
3346
+ request: n,
3347
+ url: this.getAiPromptUrl()
3348
+ };
3349
+ try {
3350
+ await this._invokeCallback("onRestoreRequested", t);
3351
+ } finally {
3352
+ this._patchState({ isGenerating: !1 });
3353
+ }
3354
+ return {};
3355
+ }
3356
+ try {
3357
+ let r = await fetch(this.getAiPromptUrl(), {
3358
+ method: "POST",
3359
+ headers: { "Content-Type": "application/json" },
3360
+ mode: "cors",
3361
+ body: JSON.stringify(n)
3362
+ });
3363
+ if (!r.ok) {
3364
+ let e = await r.json().catch(() => null);
3365
+ throw Error(e?.message || `API request failed with status ${r.status}`);
3366
+ }
3367
+ let i = await r.json().catch(() => null), a = i?.generatedChart ?? (i ? pr(i) : null), o = {
3368
+ ...typeof i?.message == "string" ? { message: i.message } : {},
3369
+ ...a ? { chart: {
3370
+ ...i,
3371
+ generatedChart: a
3372
+ } } : {}
3373
+ }, s = e.messageIndex >= 0 && e.messageIndex < this._state.messages.length ? this._state.messages.slice(0, e.messageIndex + 1) : this._state.messages;
3374
+ if (o.message && s[e.messageIndex]?.type === "ai" && (s[e.messageIndex] = {
3375
+ ...s[e.messageIndex],
3376
+ message: o.message
3377
+ }), this._patchState({ messages: [...s] }), o.chart || o.message) {
3378
+ let n = s[e.messageIndex], r = n?.type === "ai" ? n : {
3379
+ id: si(),
3380
+ type: "ai",
3381
+ message: o.message ?? ""
3382
+ };
3383
+ this._emit("onComplete", {
3384
+ agent: t,
3385
+ conversationId: this._state.conversationId,
3386
+ message: r,
3387
+ ...o.chart ? { chart: o.chart } : {},
3388
+ ...i ? { raw: i } : {}
3389
+ });
3390
+ }
3391
+ return o;
3392
+ } finally {
3393
+ this._patchState({ isGenerating: !1 });
3394
+ }
3395
+ }
3396
+ buildRestoreRequest(e) {
3397
+ return er(e, this._config.authKey, this._config.authToken, this._config.apiVersion, this._state.conversationId);
3398
+ }
3399
+ abort(e = {}) {
3400
+ this._abortController?.abort(), this._abortController = null, e.notify && this._inflightMessage ? this._markInflightCancelled(e.cancelledMessage) : this._discardInflightMessage(), this._patchState({
3401
+ isGenerating: !1,
3402
+ progress: null,
3403
+ progressCollapsed: !1
3404
+ }), e.notify && this._emit("onPromptStopped");
3405
+ }
3406
+ _abortInflight() {
3407
+ this._abortController?.abort(), this._abortController = null, this._discardInflightMessage();
3408
+ }
3409
+ _createStreamCallbacks() {
3410
+ return {
3411
+ onConversationIdChange: (e) => this._setConversationId(e),
3412
+ onProgress: (e) => {
3413
+ this._receivedProgress = !0, this._patchState({ progress: e });
3414
+ },
3415
+ onProgressCollapsed: (e) => {
3416
+ this._patchState({ progressCollapsed: e });
3417
+ },
3418
+ onMessageUpdate: (e) => {
3419
+ this._inflightMessage = e, this._upsertMessage(e), this._patchState({ inflightMessage: { ...e } });
3420
+ },
3421
+ getConversationId: () => this._state.conversationId,
3422
+ onStep: (e) => {
3423
+ this._emit("onStep", e);
3424
+ },
3425
+ onComplete: (e) => {
3426
+ this._emit("onComplete", e);
3427
+ }
3428
+ };
3429
+ }
3430
+ _setConversationId(e) {
3431
+ this._config = {
3432
+ ...this._config,
3433
+ conversationId: e
3434
+ }, this._patchState({ conversationId: e }), this._emit("onConversationIdChange", e);
3435
+ }
3436
+ _upsertMessage(e) {
3437
+ let t = this._state.messages.findIndex((t) => t.id === e.id);
3438
+ if (t === -1) {
3439
+ this._patchState({ messages: [...this._state.messages, { ...e }] });
3440
+ return;
3441
+ }
3442
+ let n = this._state.messages.map((n, r) => r === t ? { ...e } : n);
3443
+ this._patchState({ messages: n });
3444
+ }
3445
+ _finalizeInflightMessage() {
3446
+ this._inflightMessage && (this._state.progress && this._receivedProgress && (this._inflightMessage.progress = structuredClone(this._state.progress), this._upsertMessage(this._inflightMessage)), this._inflightMessage = null, this._receivedProgress = !1, this._patchState({
3447
+ progress: null,
3448
+ progressCollapsed: !1,
3449
+ inflightMessage: null
3450
+ }));
3451
+ }
3452
+ _removeInflightFromMessages() {
3453
+ this._inflightMessage && this._patchState({ messages: this._state.messages.filter((e) => e.id !== this._inflightMessage.id) });
3454
+ }
3455
+ _markInflightCancelled(e) {
3456
+ this._inflightMessage && (this._inflightMessage.message = e ?? c("Response cancelled.", { desc: "Placeholder shown in ai chat where the assistant reply would appear when the user stops an in-flight response" }), this._inflightMessage.isCancelled = !0, this._inflightMessage.hasChart = !1, delete this._inflightMessage.progress, delete this._inflightMessage.elicitation, this._upsertMessage(this._inflightMessage), this._inflightMessage = null, this._receivedProgress = !1, this._patchState({ inflightMessage: null }));
3457
+ }
3458
+ _discardInflightMessage() {
3459
+ let e = !!(this._inflightMessage || this._state.inflightMessage);
3460
+ this._removeInflightFromMessages(), this._inflightMessage = null, this._receivedProgress = !1, e && this._patchState({ inflightMessage: null });
3461
+ }
3462
+ _handleSubmitError(e, t, n) {
3463
+ t.message = c("Something went wrong. Please try again.", { desc: "Generic error message shown in ai chat when the API request fails" }), t.isError = !0, delete t.progress, delete t.elicitation, this._inflightMessage = t, this._upsertMessage(t), this._patchState({
3464
+ inflightMessage: { ...t },
3465
+ progress: null,
3466
+ progressCollapsed: !1
3467
+ }), this._emit("onComplete", {
3468
+ agent: n,
3469
+ conversationId: this._state.conversationId,
3470
+ message: t,
3471
+ error: e
3472
+ });
3473
+ }
3474
+ _hasCallback(e) {
3475
+ return typeof this._hostCallbacks[e] == "function" || typeof this._uiBridgeCallbacks[e] == "function";
3476
+ }
3477
+ _emit(e, ...t) {
3478
+ this._invokeCallback(e, ...t);
3479
+ }
3480
+ async _invokeCallback(e, ...t) {
3481
+ let n = this._hostCallbacks[e], r = this._uiBridgeCallbacks[e];
3482
+ typeof n == "function" && await n(...t), typeof r == "function" && await r(...t);
3483
+ }
3484
+ _patchState(e) {
3485
+ this._state = {
3486
+ ...this._state,
3487
+ ...e
3488
+ }, this._emit("onStateChange", this._state), this._notifySubscribers();
3489
+ }
3490
+ _notifySubscribers() {
3491
+ for (let e of this._subscribers) e(this._state);
3492
+ }
3493
+ _areSelectedDatasetsEqual(e, t) {
3494
+ return e.length === t.length && e.every((e, n) => e.id === t[n]?.id);
3495
+ }
3496
+ _areChatMessagesEqual(e, t) {
3497
+ return e.length === t.length && e.every((e, n) => {
3498
+ let r = t[n];
3499
+ return e.id === r?.id && e.apiMessageId === r?.apiMessageId && e.type === r?.type && e.message === r?.message && e.isError === r?.isError && e.isCancelled === r?.isCancelled && e.hasChart === r?.hasChart && JSON.stringify(e.progress ?? null) === JSON.stringify(r?.progress ?? null) && JSON.stringify(e.actions ?? null) === JSON.stringify(r?.actions ?? null) && JSON.stringify(e.attachmentUrls ?? null) === JSON.stringify(r?.attachmentUrls ?? null) && JSON.stringify(e.elicitation ?? null) === JSON.stringify(r?.elicitation ?? null);
3500
+ });
3501
+ }
3502
+ };
3503
+ function li(e, t) {
3504
+ return new ci(e, t);
3505
+ }
3506
+ //#endregion
3507
+ //#region src/components/ai-chat/session/ai-chat-session-controller.ts
3508
+ var ui = class {
3509
+ constructor(e) {
3510
+ this.options = e, this._session = null, this._ownsSession = !1, this._customItemFromProps = !1, this._seededFromProps = !1, this._unsubscribe = null;
3511
+ }
3512
+ get current() {
3513
+ return this._session;
3514
+ }
3515
+ get state() {
3516
+ if (this._session) return this._session.state;
3517
+ let e = this.options.getSeed();
3518
+ return {
3519
+ messages: e.messages,
3520
+ selectedDatasets: e.selectedDatasets,
3521
+ isGenerating: !1,
3522
+ progress: null,
3523
+ progressCollapsed: !1,
3524
+ conversationId: e.conversationId,
3525
+ inflightMessage: null
3526
+ };
3527
+ }
3528
+ get ownsCurrentSession() {
3529
+ return this._ownsSession;
3530
+ }
3531
+ setSession(e) {
3532
+ if (!e) {
3533
+ this._clearSession();
3534
+ return;
3535
+ }
3536
+ this._ownsSession && this._session !== e && this._session?.abort(), this._ownsSession = !1, this._session = e, this._mergeHostElementConfig(e), this._wire(e);
3537
+ }
3538
+ syncProperties(e) {
3539
+ if (!e.has("chatSession")) {
3540
+ if (this._createSessionIfMissing(), this._session) {
3541
+ let t = this.options.getConfig();
3542
+ if (Object.keys(t).some((t) => e.has(t)) && (this._ownsSession ? this._session.updateConfig(t) : this._mergeHostElementConfig(this._session)), e.has("selectedDatasets") && this._ownsSession) {
3543
+ let e = this.options.getSeed().selectedDatasets, t = this._session.state.selectedDatasets;
3544
+ (e.length !== t.length || e.some((e, n) => e.id !== t[n]?.id)) && this._session.updateConfig({ selectedDatasets: e });
3545
+ }
3546
+ }
3547
+ (e.has("messages") || e.has("selectedDatasets")) && this._seedFromPropsOnce();
3548
+ }
3549
+ }
3550
+ requireSession() {
3551
+ return this._createSessionIfMissing(), this._ownsSession ? this._session.updateConfig(this.options.getConfig()) : this._session && this._mergeHostElementConfig(this._session), this._session;
3552
+ }
3553
+ _mergeHostElementConfig(e) {
3554
+ let t = this.options.getConfig(), n = {
3555
+ authKey: t.authKey,
3556
+ authToken: t.authToken,
3557
+ apiUrl: t.apiUrl,
3558
+ apiVersion: t.apiVersion,
3559
+ stream: t.stream,
3560
+ localeId: t.localeId,
3561
+ timezoneId: t.timezoneId,
3562
+ modelPreference: t.modelPreference,
3563
+ requireDataset: t.requireDataset,
3564
+ agent: t.agent
3565
+ };
3566
+ t.agentConfig !== void 0 && (n.agentConfig = t.agentConfig), t.task !== void 0 && (n.task = t.task), t.chart != null && (n.chart = t.chart), t.dashboard != null && (n.dashboard = t.dashboard), t.customItem != null && (this._customItemFromProps = !0), this._customItemFromProps && (n.customItem = t.customItem ?? null), t.currentScreenMode != null && (n.currentScreenMode = t.currentScreenMode), t.conversationId != null && (n.conversationId = t.conversationId), e.updateConfig(n);
3567
+ }
3568
+ connect() {
3569
+ this._session && this._wire(this._session);
3570
+ }
3571
+ teardown() {
3572
+ this._unwire(), this._ownsSession &&= (this._session?.abort(), this._session = null, !1), this._seededFromProps = !1;
3573
+ }
3574
+ _createSessionIfMissing() {
3575
+ if (this._session) return;
3576
+ let e = this.options.getSeed();
3577
+ this._session = li({
3578
+ ...this.options.getConfig(),
3579
+ messages: e.messages.length > 0 ? [...e.messages] : void 0,
3580
+ selectedDatasets: e.selectedDatasets.length > 0 ? [...e.selectedDatasets] : void 0
3581
+ }), this._ownsSession = !0, this._seededFromProps = e.messages.length > 0 || e.selectedDatasets.length > 0, this._wire(this._session);
3582
+ }
3583
+ _clearSession() {
3584
+ this._unwire(), this._ownsSession && this._session?.abort(), this._session = null, this._ownsSession = !1;
3585
+ }
3586
+ _seedFromPropsOnce() {
3587
+ if (!this._ownsSession || this._seededFromProps) return;
3588
+ let e = this.requireSession(), t = this.options.getSeed(), n = {};
3589
+ e.state.messages.length === 0 && t.messages.length > 0 && (n.messages = [...t.messages]), e.state.selectedDatasets.length === 0 && t.selectedDatasets.length > 0 && (n.selectedDatasets = [...t.selectedDatasets]), Object.keys(n).length > 0 && (e.updateConfig(n), this._seededFromProps = !0);
3590
+ }
3591
+ _wire(e) {
3592
+ this._unwire(), e.setUiBridge(this.options.createDomBridge()), this._unsubscribe = e.subscribe(() => {
3593
+ this.options.onRenderNeeded();
3594
+ });
3595
+ }
3596
+ _unwire() {
3597
+ this._unsubscribe?.(), this._unsubscribe = null;
3598
+ }
3599
+ }, di, $ = class t extends a(i, { validSizes: [
3600
+ "s",
3601
+ "m",
3602
+ "l",
3603
+ "xl"
3604
+ ] }) {
3605
+ constructor(...e) {
3606
+ super(...e), this.messages = [], this.selectedDatasets = [], this.placeholder = "Describe your change", this.disabled = !1, this.stoppable = !1, this.showAssistantContextMenu = !1, this.authKey = "", this.authToken = "", this.apiUrl = "https://api.luzmo.com", this.appServer = "https://app.luzmo.com", this.includePublicDatasets = !1, this.hideDatasetButton = !1, this.hideDatasetIcons = !1, this.disableDatasetModification = !1, this.hideSelectedDatasets = !1, this.hideAgents = !1, this.disableColumnMentions = !1, this.requireDataset = !1, this.allowImages = !1, this.allowVoiceInput = !1, this.acceptedFileTypes = [], this.agent = "item", this.task = "generate", this.modelPreference = "performance", this.chatSession = null, this.conversationId = null, this.chart = null, this.dashboard = null, this.customItem = null, this.timezoneId = "UTC", this.apiVersion = "0.1.0", this.stream = !0, this.loadingMessage = null, this.cancelledMessage = null, this.initialPrompt = null, this.emptyStateTitle = "", this.emptyStateSubtitle = "", this.emptyStateSuggestions = [], this._textareaValue = "", this._assistantMessageActionsSlotHasContent = !1, this._pendingAssistantMessageAction = null, this._shouldFocusAssistantMessageActionConfirm = !1, this._lastProcessedInitialPrompt = null, this._session = new ui({
3607
+ getConfig: () => this._buildSessionConfig(),
3608
+ getSeed: () => ({
3609
+ messages: this.messages,
3610
+ selectedDatasets: Array.isArray(this.selectedDatasets) ? this.selectedDatasets : [],
3611
+ conversationId: this.conversationId
3612
+ }),
3613
+ createDomBridge: () => this._createDomBridgeCallbacks(),
3614
+ onRenderNeeded: () => {
3615
+ this.requestUpdate(), this.updateComplete.then(() => this._scrollToBottom());
3616
+ }
3617
+ }), this._handleAssistantMessageActionsSlotChange = (e) => {
3618
+ let t = e.target.assignedElements({ flatten: !0 }).length > 0;
3619
+ this._setAssistantMessageActionsSlotHasContent(t);
3620
+ }, this._handleAssistantMessageActionConfirmKeydown = (e) => {
3621
+ e.key !== "Escape" || !this._pendingAssistantMessageAction || (e.preventDefault(), e.stopPropagation(), this._cancelAssistantMessageActionConfirm());
3622
+ };
3623
+ }
3624
+ get flagOpendata() {
3625
+ return this.includePublicDatasets;
3626
+ }
3627
+ set flagOpendata(e) {
3628
+ this.includePublicDatasets = e;
3629
+ }
3630
+ get session() {
3631
+ return this._session.current;
3632
+ }
3633
+ _getRenderState() {
3634
+ return this._session.state;
3635
+ }
3636
+ _createDomBridgeCallbacks() {
3637
+ return {
3638
+ onMessageSent: (e, t) => {
3639
+ this.dispatchEvent(new CustomEvent("luzmo-message-sent", {
3640
+ detail: {
3641
+ message: e,
3642
+ selectedDatasets: t
3643
+ },
3644
+ bubbles: !0,
3645
+ composed: !0
3646
+ }));
3647
+ },
3648
+ onDatasetsChanged: (e) => {
3649
+ this.dispatchEvent(new CustomEvent("luzmo-datasets-changed", {
3650
+ detail: { selectedDatasets: e },
3651
+ bubbles: !0,
3652
+ composed: !0
3653
+ }));
3654
+ },
3655
+ onConversationIdChange: (e) => this._emitConversationIdChanged(e),
3656
+ onStep: (e) => {
3657
+ this.dispatchEvent(new CustomEvent("luzmo-step", {
3658
+ detail: e,
3659
+ bubbles: !0,
3660
+ composed: !0
3661
+ }));
3662
+ },
3663
+ onComplete: (e) => {
3664
+ this.dispatchEvent(new CustomEvent("luzmo-complete", {
3665
+ detail: e,
3666
+ bubbles: !0,
3667
+ composed: !0
3668
+ }));
3669
+ },
3670
+ onPromptStopped: () => {
3671
+ this.dispatchEvent(new CustomEvent("luzmo-stop", {
3672
+ bubbles: !0,
3673
+ composed: !0
3674
+ }));
3675
+ },
3676
+ ...typeof this.uploadAttachments == "function" ? { uploadAttachments: (e, t) => this.uploadAttachments(e, t) } : {}
3677
+ };
3678
+ }
3679
+ get _pickedAgentId() {
3680
+ if (!this.hideAgents) return this.shadowRoot?.querySelector("luzmo-ai-interaction-textarea")?.selectedAgent?.id;
3681
+ }
3682
+ get _oneSizeSmaller() {
3683
+ return {
3684
+ s: "xs",
3685
+ m: "s",
3686
+ l: "m",
3687
+ xl: "l"
3688
+ }[this.size] ?? "s";
3689
+ }
3690
+ get _resolvedAcceptedFileTypes() {
3691
+ return this.acceptedFileTypes.length > 0 ? this.acceptedFileTypes : this.allowImages ? [...e] : [];
3692
+ }
3693
+ _buildSessionConfig() {
3694
+ return {
3695
+ agent: this.agent,
3696
+ agentConfig: this.agentConfig,
3697
+ agentId: this.agentId,
3698
+ authKey: this.authKey,
3699
+ authToken: this.authToken,
3700
+ apiUrl: this.apiUrl,
3701
+ apiVersion: this.apiVersion,
3702
+ stream: this.stream,
3703
+ conversationId: this.conversationId,
3704
+ chart: this.chart,
3705
+ dashboard: this.dashboard,
3706
+ customItem: this.customItem,
3707
+ currentScreenMode: this.currentScreenMode,
3708
+ localeId: this.localeId,
3709
+ timezoneId: this.timezoneId,
3710
+ task: this.task,
3711
+ modelPreference: this.modelPreference,
3712
+ requireDataset: this.requireDataset
3713
+ };
3714
+ }
3715
+ _getAgentConfig() {
3716
+ let e = this._session.current?.agentConfig;
3717
+ return this.agentConfig === void 0 && this.chatSession && e ? e : Nn(this._buildSessionConfig(), e);
3718
+ }
3719
+ _emitConversationIdChanged(e) {
3720
+ this.conversationId = e, this.dispatchEvent(new CustomEvent("luzmo-conversation-id-changed", {
3721
+ detail: { conversationId: e },
3722
+ bubbles: !0,
3723
+ composed: !0
3724
+ }));
3725
+ }
3726
+ async _restoreViaSession(e, t) {
3727
+ await this._session.requireSession().restore({
3728
+ restoreToMessageId: e,
3729
+ messageIndex: t
3730
+ });
3731
+ }
3732
+ async _handleRestoreState(e, t) {
3733
+ if (e.apiMessageId && this._getAgentConfig().type === "item") try {
3734
+ await this._restoreViaSession(e.apiMessageId, t);
3735
+ } catch (e) {
3736
+ console.error("AI restore error:", e);
3737
+ }
3738
+ }
3739
+ _handleDatasetSelected(e) {
3740
+ this._session.requireSession().addDataset(e.detail);
3741
+ }
3742
+ _handleDatasetRemoved(e) {
3743
+ this._session.requireSession().removeDataset(e.detail.id);
3744
+ }
3745
+ _handleAgentSelected() {
3746
+ this._processInitialPrompt();
3747
+ }
3748
+ async _submitViaSession(e, t = {}) {
3749
+ let n = this._session.requireSession();
3750
+ if (!n.isDatasetRequirementMet(t.agentId)) return !1;
3751
+ this._textareaValue = "";
3752
+ try {
3753
+ return await n.submit({
3754
+ prompt: e,
3755
+ ...t
3756
+ }), !0;
3757
+ } catch (e) {
3758
+ return e.name !== "AbortError" && console.error("AI prompt session error:", e), !1;
3759
+ }
3760
+ }
3761
+ async _handlePromptSubmitted(e) {
3762
+ let t = e.detail.prompt;
3763
+ await this._submitViaSession(t, {
3764
+ ...e.detail.attachments?.length ? { attachments: e.detail.attachments } : {},
3765
+ ...e.detail.attachmentUrls?.length ? { attachmentUrls: e.detail.attachmentUrls } : {},
3766
+ ...e.detail.selectedAgent ? { agentId: e.detail.selectedAgent.id } : {}
3767
+ }) || (this._textareaValue = t);
3768
+ }
3769
+ _handlePromptStopped() {
3770
+ let e = this._session.current;
3771
+ if (this._textareaValue = "", e) {
3772
+ e.abort({
3773
+ notify: !0,
3774
+ cancelledMessage: this.cancelledMessage ?? void 0
3775
+ });
3776
+ return;
3777
+ }
3778
+ this.dispatchEvent(new CustomEvent("luzmo-stop", {
3779
+ bubbles: !0,
3780
+ composed: !0
3781
+ }));
3782
+ }
3783
+ async _handleEmptyStateSuggestionSelected(e) {
3784
+ let { prompt: t, selectedDatasets: n } = e.detail, r = this._session.requireSession();
3785
+ n?.length && r.setSelectedDatasets(n), await this._submitViaSession(t, { agentId: this._pickedAgentId });
3786
+ }
3787
+ async _processInitialPrompt() {
3788
+ if (!this.initialPrompt || this.initialPrompt === this._lastProcessedInitialPrompt) return;
3789
+ let e = this._pickedAgentId;
3790
+ this._session.requireSession().isDatasetRequirementMet(e) && (this._lastProcessedInitialPrompt = this.initialPrompt, await this._submitViaSession(this.initialPrompt, {
3791
+ skipUserMessage: !0,
3792
+ agentId: e
3793
+ }));
3794
+ }
3795
+ connectedCallback() {
3796
+ super.connectedCallback(), this._session.connect();
3797
+ }
3798
+ disconnectedCallback() {
3799
+ super.disconnectedCallback(), this._session.teardown();
3800
+ }
3801
+ _scrollToBottom() {
3802
+ let e = this.shadowRoot?.querySelector(".chat-messages-container");
3803
+ e && requestAnimationFrame(() => {
3804
+ requestAnimationFrame(() => {
3805
+ e.scrollTop = e.scrollHeight;
3806
+ });
3807
+ });
3808
+ }
3809
+ willUpdate(e) {
3810
+ super.willUpdate?.(e), this._syncPendingAssistantMessageAction();
3811
+ }
3812
+ updated(e) {
3813
+ super.updated?.(e), this._syncSession(e), this._handleInitialPromptChange(), e.has("uploadAttachments") && this._session.current?.setUiBridge(this._createDomBridgeCallbacks()), this.updateComplete.then(() => {
3814
+ this._syncAssistantMessageActionsVisibility(), this._focusPendingAssistantMessageActionConfirm();
3815
+ });
3816
+ }
3817
+ _syncSession(e) {
3818
+ if (e.has("chatSession")) {
3819
+ this._session.setSession(this.chatSession);
3820
+ return;
3821
+ }
3822
+ this._session.syncProperties(e);
3823
+ }
3824
+ _handleInitialPromptChange() {
3825
+ this.initialPrompt && this.initialPrompt !== this._lastProcessedInitialPrompt ? this._processInitialPrompt() : this.initialPrompt || (this._lastProcessedInitialPrompt = null);
3826
+ }
3827
+ _renderMarkdown(e) {
3828
+ let t = String(X.parse(e, { async: !1 }));
3829
+ return bt.sanitize(t, {
3830
+ ALLOWED_TAGS: /* @__PURE__ */ "p.br.strong.em.b.i.u.s.code.pre.blockquote.hr.ul.ol.li.h1.h2.h3.h4.h5.h6.table.thead.tbody.tr.th.td.a".split("."),
3831
+ ALLOWED_ATTR: [
3832
+ "href",
3833
+ "title",
3834
+ "target",
3835
+ "rel"
3836
+ ],
3837
+ ALLOW_DATA_ATTR: !1,
3838
+ FORBID_TAGS: [
3839
+ "script",
3840
+ "style",
3841
+ "iframe",
3842
+ "object",
3843
+ "embed",
3844
+ "link",
3845
+ "form",
3846
+ "input",
3847
+ "button"
3848
+ ],
3849
+ FORBID_ATTR: [
3850
+ "onerror",
3851
+ "onload",
3852
+ "onclick",
3853
+ "onmouseover",
3854
+ "onfocus",
3855
+ "onblur"
3856
+ ]
3857
+ });
3858
+ }
3859
+ _renderProgress() {
3860
+ let { progress: e, progressCollapsed: t } = this._getRenderState();
3861
+ return e?.children?.length ? f`
3862
+ <luzmo-progress-steps
3863
+ .progress=${e}
3864
+ ?collapsed=${t}
3865
+ .size=${this.size}
3866
+ ></luzmo-progress-steps>
3867
+ ` : p;
3868
+ }
3869
+ _syncAssistantMessageActionsVisibility() {
3870
+ let e = ((this.shadowRoot?.querySelector(`slot[name="${t.assistantMessageActionsSlot}"]`) ?? null)?.assignedElements({ flatten: !0 }).length ?? 0) > 0;
3871
+ this._setAssistantMessageActionsSlotHasContent(e);
3872
+ }
3873
+ _setAssistantMessageActionsSlotHasContent(e) {
3874
+ e !== this._assistantMessageActionsSlotHasContent && (this._assistantMessageActionsSlotHasContent = e);
3875
+ }
3876
+ _isLatestAssistantMessage(e, t) {
3877
+ return !!(t && e === t);
3878
+ }
3879
+ _hasBuiltInAssistantMessageActions(e) {
3880
+ return (e.actions?.length ?? 0) > 0;
3881
+ }
3882
+ _assistantMessageActionsFooterHasContent(e, t) {
3883
+ return this._hasBuiltInAssistantMessageActions(e) || t && this._assistantMessageActionsSlotHasContent;
3884
+ }
3885
+ _syncPendingAssistantMessageAction() {
3886
+ let e = this._pendingAssistantMessageAction;
3887
+ if (!e) return;
3888
+ let { messages: t } = this._getRenderState(), n = t.find((t) => t.id === e.messageId), r = n?.actions?.find((t) => t.id === e.actionId);
3889
+ (!n || !r?.confirm) && (this._pendingAssistantMessageAction = null, this._shouldFocusAssistantMessageActionConfirm = !1);
3890
+ }
3891
+ _getDefaultAssistantMessageActionConfirmMessage() {
3892
+ return c("Are you sure?", { desc: "Default assistant message action confirmation prompt" });
3893
+ }
3894
+ _isAssistantMessageActionConfirming(e) {
3895
+ let t = this._pendingAssistantMessageAction, n = e.id;
3896
+ return !!(t && n && t.messageId === n);
3897
+ }
3898
+ _getPendingAssistantMessageAction(e) {
3899
+ let t = this._pendingAssistantMessageAction, n = e.id;
3900
+ if (!(!t || !n || t.messageId !== n)) return e.actions?.find((e) => e.id === t.actionId);
3901
+ }
3902
+ _handleAssistantMessageAction(e, t) {
3903
+ let n = e.id;
3904
+ n && this.dispatchEvent(new CustomEvent("luzmo-assistant-message-action", {
3905
+ detail: {
3906
+ messageId: n,
3907
+ actionId: t.id,
3908
+ message: e
3909
+ },
3910
+ bubbles: !0,
3911
+ composed: !0
3912
+ }));
3913
+ }
3914
+ _handleAssistantMessageActionClick(e, t) {
3915
+ let n = e.id;
3916
+ if (n) {
3917
+ if (t.confirm) {
3918
+ this._pendingAssistantMessageAction = {
3919
+ messageId: n,
3920
+ actionId: t.id
3921
+ }, this._shouldFocusAssistantMessageActionConfirm = !0;
3922
+ return;
3923
+ }
3924
+ this._handleAssistantMessageAction(e, t);
3925
+ }
3926
+ }
3927
+ _cancelAssistantMessageActionConfirm() {
3928
+ this._pendingAssistantMessageAction = null, this._shouldFocusAssistantMessageActionConfirm = !1;
3929
+ }
3930
+ _confirmAssistantMessageAction(e, t) {
3931
+ this._pendingAssistantMessageAction = null, this._shouldFocusAssistantMessageActionConfirm = !1, this._handleAssistantMessageAction(e, t);
3932
+ }
3933
+ _focusPendingAssistantMessageActionConfirm() {
3934
+ !this._shouldFocusAssistantMessageActionConfirm || !this._pendingAssistantMessageAction || (this._shouldFocusAssistantMessageActionConfirm = !1, (this.shadowRoot?.querySelector("luzmo-button.assistant-message-action-confirm-cancel"))?.focus?.());
3935
+ }
3936
+ _renderBuiltInAssistantMessageAction(e, t) {
3937
+ let n = this.disabled || t.disabled || !e.id;
3938
+ return f`
3939
+ <luzmo-button
3940
+ class="assistant-message-action"
3941
+ .size=${this._oneSizeSmaller}
3942
+ variant="neutral"
3943
+ treatment="outline"
3944
+ ?disabled=${n}
3945
+ @click=${() => this._handleAssistantMessageActionClick(e, t)}
3946
+ >
3947
+ ${t.icon ? f`<luzmo-icon slot="icon" .icon=${t.icon} .size=${this._oneSizeSmaller}></luzmo-icon>` : p}
3948
+ ${t.label}
3949
+ </luzmo-button>
3950
+ `;
3951
+ }
3952
+ _renderAssistantMessageActionConfirm(e) {
3953
+ let t = this._getPendingAssistantMessageAction(e);
3954
+ if (!t) return p;
3955
+ let n = t.confirmMessage ?? this._getDefaultAssistantMessageActionConfirmMessage(), r = this.disabled || t.disabled || !e.id;
3956
+ return f`
3957
+ <span class="assistant-message-action-confirm-message" role="status" aria-live="polite">${n}</span>
3958
+ <div class="assistant-message-action-confirm-controls">
3959
+ <luzmo-button
3960
+ class="assistant-message-action-confirm-cancel"
3961
+ .size=${this._oneSizeSmaller}
3962
+ variant="neutral"
3963
+ treatment="outline"
3964
+ ?disabled=${this.disabled}
3965
+ @click=${this._cancelAssistantMessageActionConfirm}
3966
+ >
3967
+ ${c("Cancel", { desc: "Cancel assistant message action confirmation" })}
3968
+ </luzmo-button>
3969
+ <luzmo-button
3970
+ class="assistant-message-action-confirm-confirm"
3971
+ .size=${this._oneSizeSmaller}
3972
+ variant=${t.confirmVariant ?? "negative"}
3973
+ ?disabled=${r}
3974
+ @click=${() => this._confirmAssistantMessageAction(e, t)}
3975
+ >
3976
+ ${t.label}
3977
+ </luzmo-button>
3978
+ </div>
3979
+ `;
3980
+ }
3981
+ _renderAssistantMessageActions(e, n) {
3982
+ let r = e.actions ?? [], i = r.length > 0, a = this._isLatestAssistantMessage(e, n), o = this._isAssistantMessageActionConfirming(e);
3983
+ return !i && !a ? p : f`
3984
+ <div
3985
+ class="assistant-message-actions ${this._assistantMessageActionsFooterHasContent(e, a) ? "assistant-message-actions--has-content" : ""} ${o ? "assistant-message-actions--confirming" : ""}"
3986
+ @keydown=${o ? this._handleAssistantMessageActionConfirmKeydown : p}
3987
+ >
3988
+ ${o ? this._renderAssistantMessageActionConfirm(e) : f`
3989
+ ${r.map((t) => this._renderBuiltInAssistantMessageAction(e, t))}
3990
+ ${a ? f`
3991
+ <slot
3992
+ name=${t.assistantMessageActionsSlot}
3993
+ @slotchange=${this._handleAssistantMessageActionsSlotChange}
3994
+ ></slot>
3995
+ ` : p}
3996
+ `}
3997
+ </div>
3998
+ `;
3999
+ }
4000
+ _renderRestoreMenu(e, t, n, r = !1) {
4001
+ if (!(this._getAgentConfig().type === "item" && this.showAssistantContextMenu && e.hasChart && e.apiMessageId && !e.isError && e.id !== n)) return p;
4002
+ let i = `context-menu-trigger-${e.apiMessageId}`;
4003
+ return f`
4004
+ <div class="assistant-context-menu">
4005
+ <button
4006
+ id=${i}
4007
+ class="assistant-context-menu-trigger"
4008
+ type="button"
4009
+ aria-label=${c("Open restore menu", { desc: "Accessible label for the ai chat restore menu trigger" })}
4010
+ aria-haspopup="menu"
4011
+ ?disabled=${r}
4012
+ >
4013
+ ${u(l)}
4014
+ </button>
4015
+ <luzmo-overlay
4016
+ trigger="${i}@click"
4017
+ placement="bottom-end"
4018
+ >
4019
+ <luzmo-popover>
4020
+ <button
4021
+ class="assistant-context-menu-item"
4022
+ type="button"
4023
+ ?disabled=${r}
4024
+ @click=${() => this._handleRestoreState(e, t)}
4025
+ >
4026
+ ${c("Restore state", { desc: "Context menu action that restores the chart to this message state" })}
4027
+ </button>
4028
+ </luzmo-popover>
4029
+ </luzmo-overlay>
4030
+ </div>
4031
+ `;
4032
+ }
4033
+ _renderMessages() {
4034
+ let { messages: e, inflightMessage: t, isGenerating: n } = this._getRenderState(), r = t !== null, i = e.filter((e) => !t || e.id !== t.id), a = [...i].reverse().find((e) => e.type === "ai"), o = a?.id;
4035
+ return i.map((t) => {
4036
+ let s = t.progress?.children?.length ? f`
4037
+ <luzmo-progress-steps
4038
+ .progress=${t.progress}
4039
+ collapsed
4040
+ no-animate
4041
+ .size=${this.size}
4042
+ ></luzmo-progress-steps>
4043
+ ` : p;
4044
+ if (t.type === "user") {
4045
+ let e = t.attachmentUrls ?? [];
4046
+ return f`
4047
+ <luzmo-chat-message
4048
+ avatar-placement="bottom"
4049
+ position="right"
4050
+ variant="primary"
4051
+ .size=${this.size}
4052
+ >
4053
+ <div class="user-message-content">
4054
+ ${e.length > 0 ? f`
4055
+ <div class="user-message-attachments">
4056
+ ${e.map((e) => f`
4057
+ <img
4058
+ class="user-message-attachment"
4059
+ src=${e}
4060
+ alt=${c("Attached image", { desc: "Accessible label for an image attached to a user chat message" })}
4061
+ width="64"
4062
+ height="64"
4063
+ />
4064
+ `)}
4065
+ </div>
4066
+ ` : p}
4067
+ <div class="user-message-text">${t.message}</div>
4068
+ </div>
4069
+ </luzmo-chat-message>
4070
+ `;
4071
+ }
4072
+ let l = e.indexOf(t), u = t.isError ? "error" : t.isCancelled ? "cancelled" : "", d = !!t.elicitation && (!t.message.trim() || t.message.trim() === t.elicitation?.question), m = t.isCancelled ? t.message : d ? p : f`<div class="markdown-content">${ee(this._renderMarkdown(t.message))}</div>`;
4073
+ return f`
4074
+ ${s}
4075
+ <div class="assistant-message-wrapper">
4076
+ <div class="assistant-message-body">
4077
+ <luzmo-chat-message
4078
+ class=${u}
4079
+ role=${t.isError ? "alert" : p}
4080
+ avatar-placement="bottom"
4081
+ position="left"
4082
+ quiet
4083
+ .size=${this.size}
4084
+ >
4085
+ ${m}
4086
+ ${Vn({
4087
+ message: t,
4088
+ size: this.size,
4089
+ state: t.elicitation?.answer ? "answered" : t.id && t === i.at(-1) && !n && !this.disabled ? "open" : "closed",
4090
+ onSubmit: (e) => this._handleElicitationSubmit(t, e)
4091
+ })}
4092
+ </luzmo-chat-message>
4093
+
4094
+ ${this._renderRestoreMenu(t, l, o, r)}
4095
+ </div>
4096
+
4097
+ ${this._renderAssistantMessageActions(t, a)}
4098
+ </div>
4099
+ `;
4100
+ });
4101
+ }
4102
+ async _handleElicitationSubmit(e, t) {
4103
+ t.stopPropagation();
4104
+ let n = t.currentTarget, r = n.parentElement, i = zn(t.detail), a = !1;
4105
+ if (e.id && i) try {
4106
+ let t = this._session.requireSession().answerElicitation(e.id, i, { agentId: this._pickedAgentId });
4107
+ await this.updateComplete;
4108
+ let n = r?.querySelector("luzmo-question-box[readonly]");
4109
+ await n?.updateComplete, n?.focus(), a = await t;
4110
+ } catch (e) {
4111
+ e.name !== "AbortError" && console.error("AI prompt session error:", e);
4112
+ }
4113
+ a || (n.reset(), await n.updateComplete, n.focus());
4114
+ }
4115
+ _renderStreamingResponse() {
4116
+ let { inflightMessage: e } = this._getRenderState();
4117
+ return e?.message ? f`
4118
+ <luzmo-chat-message
4119
+ avatar-placement="bottom"
4120
+ position="left"
4121
+ quiet
4122
+ .size=${this.size}
4123
+ >
4124
+ <div class="markdown-content">${ee(this._renderMarkdown(e.message))}</div>
4125
+ </luzmo-chat-message>
4126
+ ` : p;
4127
+ }
4128
+ _renderLoadingMessage() {
4129
+ let { isGenerating: e, progress: t, inflightMessage: n } = this._getRenderState();
4130
+ if (!e || t?.children?.length || n?.message) return p;
4131
+ let r = this._getAgentConfig(), i = Pn(r), a = r.type === "dashboard" ? !i.dashboard : i.chart?.type === "placeholder", o = r.type === "dashboard" ? a ? c("Creating dashboard...", { desc: "Label for ai chat creating dashboard message" }) : c("Updating dashboard...", { desc: "Label for ai chat updating dashboard message" }) : a ? c("Creating item...", { desc: "Label for ai chat creating item message" }) : c("Updating item...", { desc: "Label for ai chat updating item message" });
4132
+ return f`
4133
+ <luzmo-chat-message
4134
+ avatar-placement="bottom"
4135
+ position="left"
4136
+ quiet
4137
+ .size=${this.size}
4138
+ >
4139
+ <div class="loading-message" role="status" aria-live="polite">
4140
+ <span class="icon-lg">${u(d, { className: "spin" })}</span>
4141
+ <span class="loading-message-text">${this.loadingMessage || o}</span>
4142
+ </div>
4143
+ </luzmo-chat-message>
4144
+ `;
4145
+ }
4146
+ _renderEmptyState() {
4147
+ if (this._getRenderState().messages.length > 0) return p;
4148
+ let e = c("What can I help you with?", { desc: "Title for the AI chat empty state" }), t = this.emptyStateSuggestions.length > 0;
4149
+ return f`
4150
+ <luzmo-ai-chat-empty-state
4151
+ .title=${this.emptyStateTitle || e}
4152
+ .subtitle=${t ? this.emptyStateSubtitle : ""}
4153
+ .suggestions=${this.emptyStateSuggestions}
4154
+ .size=${this.size}
4155
+ ?disabled=${this.disabled || this._getRenderState().isGenerating}
4156
+ @luzmo-suggestion-selected=${this._handleEmptyStateSuggestionSelected}
4157
+ ></luzmo-ai-chat-empty-state>
4158
+ `;
4159
+ }
4160
+ render() {
4161
+ let { selectedDatasets: e, isGenerating: t } = this._getRenderState();
4162
+ return f`
4163
+ <div class="chat-container" role="region" aria-label=${c("AI Chat", { desc: "Accessible label for AI chat region" })}>
4164
+ <div class="chat-messages-container" role="log" aria-live="polite">
4165
+ ${this._renderEmptyState()}
4166
+ ${this._renderMessages()}
4167
+ ${this._renderProgress()}
4168
+ ${this._renderStreamingResponse()}
4169
+ ${this._renderLoadingMessage()}
4170
+ </div>
4171
+
4172
+ <luzmo-ai-interaction-textarea
4173
+ role="group"
4174
+ aria-label=${c("AI prompt input", { desc: "Accessible label for the ai chat prompt input area" })}
4175
+ .size=${this.size}
4176
+ .value=${this._textareaValue}
4177
+ .selectedDatasets=${e}
4178
+ .placeholder=${this.placeholder}
4179
+ ?disabled=${this.disabled}
4180
+ ?is-generating=${t}
4181
+ ?stoppable=${this.stoppable}
4182
+ ?hide-dataset-button=${this.hideDatasetButton}
4183
+ ?hide-dataset-icons=${this.hideDatasetIcons}
4184
+ ?disable-dataset-modification=${this.disableDatasetModification}
4185
+ ?hide-selected-datasets=${this.hideSelectedDatasets}
4186
+ ?hide-agents=${this.hideAgents}
4187
+ ?disable-column-mentions=${this.disableColumnMentions}
4188
+ ?require-dataset=${this.requireDataset}
4189
+ ?allow-images=${this.allowImages}
4190
+ ?allow-voice-input=${this.allowVoiceInput}
4191
+ .acceptedFileTypes=${this._resolvedAcceptedFileTypes}
4192
+ .uploadAttachments=${this.uploadAttachments}
4193
+ auth-key=${this.authKey}
4194
+ auth-token=${this.authToken}
4195
+ api-url=${this.apiUrl}
4196
+ api-version=${this.apiVersion}
4197
+ app-server=${this.appServer}
4198
+ ?include-public-datasets=${this.includePublicDatasets}
4199
+ @prompt-submitted=${this._handlePromptSubmitted}
4200
+ @prompt-stopped=${this._handlePromptStopped}
4201
+ @dataset-selected=${this._handleDatasetSelected}
4202
+ @dataset-removed=${this._handleDatasetRemoved}
4203
+ @luzmo-agent-selected=${this._handleAgentSelected}
4204
+ ></luzmo-ai-interaction-textarea>
4205
+ </div>
4206
+ `;
4207
+ }
4208
+ };
4209
+ di = $, di.styles = m(Mn), di.tagName = "luzmo-ai-chat", di.assistantMessageActionsSlot = "assistant-message-actions", o([h({ type: Array })], $.prototype, "messages", void 0), o([h({
4210
+ type: Array,
4211
+ attribute: "selected-datasets"
4212
+ })], $.prototype, "selectedDatasets", void 0), o([h({ type: String })], $.prototype, "placeholder", void 0), o([h({
4213
+ type: Boolean,
4214
+ reflect: !0
4215
+ })], $.prototype, "disabled", void 0), o([h({
4216
+ type: Boolean,
4217
+ reflect: !0
4218
+ })], $.prototype, "stoppable", void 0), o([h({
4219
+ type: Boolean,
4220
+ attribute: "show-assistant-context-menu"
4221
+ })], $.prototype, "showAssistantContextMenu", void 0), o([h({
4222
+ type: String,
4223
+ attribute: "auth-key"
4224
+ })], $.prototype, "authKey", void 0), o([h({
4225
+ type: String,
4226
+ attribute: "auth-token"
4227
+ })], $.prototype, "authToken", void 0), o([h({
4228
+ type: String,
4229
+ attribute: "api-url"
4230
+ })], $.prototype, "apiUrl", void 0), o([h({
4231
+ type: String,
4232
+ attribute: "app-server"
4233
+ })], $.prototype, "appServer", void 0), o([h({
4234
+ type: Boolean,
4235
+ reflect: !0,
4236
+ attribute: "include-public-datasets"
4237
+ })], $.prototype, "includePublicDatasets", void 0), o([h({
4238
+ type: Boolean,
4239
+ attribute: "flag-opendata"
4240
+ })], $.prototype, "flagOpendata", null), o([h({
4241
+ type: Boolean,
4242
+ attribute: "hide-dataset-button"
4243
+ })], $.prototype, "hideDatasetButton", void 0), o([h({
4244
+ type: Boolean,
4245
+ attribute: "hide-dataset-icons"
4246
+ })], $.prototype, "hideDatasetIcons", void 0), o([h({
4247
+ type: Boolean,
4248
+ attribute: "disable-dataset-modification"
4249
+ })], $.prototype, "disableDatasetModification", void 0), o([h({
4250
+ type: Boolean,
4251
+ attribute: "hide-selected-datasets"
4252
+ })], $.prototype, "hideSelectedDatasets", void 0), o([h({
4253
+ type: Boolean,
4254
+ reflect: !0,
4255
+ attribute: "hide-agents"
4256
+ })], $.prototype, "hideAgents", void 0), o([h({
4257
+ type: Boolean,
4258
+ attribute: "disable-column-mentions"
4259
+ })], $.prototype, "disableColumnMentions", void 0), o([h({
4260
+ type: Boolean,
4261
+ attribute: "require-dataset"
4262
+ })], $.prototype, "requireDataset", void 0), o([h({
4263
+ type: Boolean,
4264
+ reflect: !0,
4265
+ attribute: "allow-images"
4266
+ })], $.prototype, "allowImages", void 0), o([h({
4267
+ type: Boolean,
4268
+ reflect: !0,
4269
+ attribute: "allow-voice-input"
4270
+ })], $.prototype, "allowVoiceInput", void 0), o([h({
4271
+ type: Array,
4272
+ attribute: "accepted-file-types"
4273
+ })], $.prototype, "acceptedFileTypes", void 0), o([h({ attribute: !1 })], $.prototype, "uploadAttachments", void 0), o([h({ type: String })], $.prototype, "agent", void 0), o([h({ attribute: !1 })], $.prototype, "agentConfig", void 0), o([h({
4274
+ type: String,
4275
+ attribute: "agent-id"
4276
+ })], $.prototype, "agentId", void 0), o([h({ type: String })], $.prototype, "task", void 0), o([h({
4277
+ type: String,
4278
+ attribute: "model-preference"
4279
+ })], $.prototype, "modelPreference", void 0), o([h({ attribute: !1 })], $.prototype, "chatSession", void 0), o([h({
4280
+ type: String,
4281
+ attribute: "conversation-id"
4282
+ })], $.prototype, "conversationId", void 0), o([h({
4283
+ type: Object,
4284
+ attribute: "chart"
4285
+ })], $.prototype, "chart", void 0), o([h({ type: Object })], $.prototype, "dashboard", void 0), o([h({ attribute: !1 })], $.prototype, "customItem", void 0), o([h({
4286
+ type: String,
4287
+ attribute: "current-screen-mode"
4288
+ })], $.prototype, "currentScreenMode", void 0), o([h({
4289
+ type: String,
4290
+ attribute: "locale-id"
4291
+ })], $.prototype, "localeId", void 0), o([h({
4292
+ type: String,
4293
+ attribute: "timezone-id"
4294
+ })], $.prototype, "timezoneId", void 0), o([h({
4295
+ type: String,
4296
+ attribute: "api-version"
4297
+ })], $.prototype, "apiVersion", void 0), o([h({ converter: { fromAttribute: (e) => e !== "false" && e !== null } })], $.prototype, "stream", void 0), o([h({
4298
+ type: String,
4299
+ attribute: "loading-message"
4300
+ })], $.prototype, "loadingMessage", void 0), o([h({
4301
+ type: String,
4302
+ attribute: "cancelled-message"
4303
+ })], $.prototype, "cancelledMessage", void 0), o([h({
4304
+ type: String,
4305
+ attribute: "initial-prompt"
4306
+ })], $.prototype, "initialPrompt", void 0), o([h({
4307
+ type: String,
4308
+ attribute: "empty-state-title"
4309
+ })], $.prototype, "emptyStateTitle", void 0), o([h({
4310
+ type: String,
4311
+ attribute: "empty-state-subtitle"
4312
+ })], $.prototype, "emptyStateSubtitle", void 0), o([h({
4313
+ type: Array,
4314
+ attribute: !1
4315
+ })], $.prototype, "emptyStateSuggestions", void 0), o([g()], $.prototype, "_textareaValue", void 0), o([g()], $.prototype, "_assistantMessageActionsSlotHasContent", void 0), o([g()], $.prototype, "_pendingAssistantMessageAction", void 0);
4316
+ //#endregion
4317
+ //#region src/components/ai-chat/ai-chat-events.ts
4318
+ function fi(e) {
4319
+ return e.recognized === !0;
4320
+ }
4321
+ //#endregion
4322
+ //#region src/components/ai-chat/index.ts
4323
+ customElements.get("luzmo-ai-chat") || customElements.define("luzmo-ai-chat", $);
4324
+ //#endregion
4325
+ export { qn as C, Z as D, Hn as E, Jn as S, Un as T, er as _, li as a, Yn as b, ii as c, _r as d, ar as f, ir as g, nr as h, ci as i, ri as l, tr as m, $ as n, oi as o, or as p, ui as r, ai as s, fi as t, pr as u, Qn as v, Zn as w, Xn as x, $n as y };