@luzmo/analytics-components-kit 1.0.8-beta.2 → 1.0.8-beta.3

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 (250) hide show
  1. package/components/ai-chat/ai-chat.d.ts +6 -2
  2. package/components/ai-chat/index.cjs +1 -1
  3. package/components/ai-chat/index.js +2 -2
  4. package/components/{ai-chat-D1Rzwdxy.cjs → ai-chat-CQtzaiZ_.cjs} +4 -4
  5. package/components/{ai-chat-Dy_utMXO.js → ai-chat-CTr-dplW.js} +14 -4
  6. package/components/ai-interaction-textarea/ai-interaction-textarea.d.ts +6 -2
  7. package/components/ai-interaction-textarea/index.cjs +1 -1
  8. package/components/ai-interaction-textarea/index.js +1 -1
  9. package/components/ai-interaction-textarea-CMz5ixwt.cjs +95 -0
  10. package/components/{ai-interaction-textarea-DMT8RNUP.js → ai-interaction-textarea-uc14Goa4.js} +14 -4
  11. package/components/area-chart-options.config-CiPCKvh7.cjs +20 -0
  12. package/components/{area-chart-options.config-Dc4P64YS.js → area-chart-options.config-HaYA8gPC.js} +34 -67
  13. package/components/area-chart-options.de-_tPBzxvf.cjs +20 -0
  14. package/components/{area-chart-options.de-DY-fWkTJ.js → area-chart-options.de-pUCTG-s0.js} +2 -0
  15. package/components/{area-chart-options.en-Dnm4crib.cjs → area-chart-options.en-AuSHs27k.cjs} +1 -1
  16. package/components/{area-chart-options.en-BwX3W0Rz.js → area-chart-options.en-YNsUeMwN.js} +2 -0
  17. package/components/{area-chart-options.es-DcNoi7rP.js → area-chart-options.es-2styw_Fz.js} +2 -0
  18. package/components/area-chart-options.es-BzRHGbo6.cjs +20 -0
  19. package/components/{area-chart-options.fr-T_BWw6Rr.js → area-chart-options.fr--WzQVf2z.js} +2 -0
  20. package/components/area-chart-options.fr-DYxUQE3x.cjs +20 -0
  21. package/components/{area-chart-options.nl-CbumBws7.js → area-chart-options.nl-BTEIqBtE.js} +2 -0
  22. package/components/area-chart-options.nl-M0xQQ_la.cjs +20 -0
  23. package/components/axis-options.config-BCP0Z8VI.js +270 -0
  24. package/components/axis-options.config-s-Js3ug-.cjs +20 -0
  25. package/components/axis-options.i18n-BOGRmWjp.js +486 -0
  26. package/components/axis-options.i18n-Cw-DmewV.cjs +20 -0
  27. package/components/{bar-chart-options.config-B7tknpxM.js → bar-chart-options.config--F0KfZ5y.js} +34 -75
  28. package/components/bar-chart-options.config-A5bcUHFc.cjs +20 -0
  29. package/components/{bar-chart-options.de-B3Q1SKCO.js → bar-chart-options.de-3qSh2TNr.js} +6 -6
  30. package/components/bar-chart-options.de-545XMRGl.cjs +20 -0
  31. package/components/bar-chart-options.en-DAee9yHp.cjs +20 -0
  32. package/components/{bar-chart-options.en-DA7MLNpQ.js → bar-chart-options.en-DrhQe9rV.js} +6 -6
  33. package/components/{bar-chart-options.es-Crk_EzMI.js → bar-chart-options.es-BZ1yNzUQ.js} +6 -6
  34. package/components/bar-chart-options.es-CfoAEZ-0.cjs +20 -0
  35. package/components/{bar-chart-options.fr-CMr4fQqa.js → bar-chart-options.fr-5i13R8bs.js} +6 -6
  36. package/components/bar-chart-options.fr-C2Ic0Dq0.cjs +20 -0
  37. package/components/bar-chart-options.nl-Bb6XiSDH.cjs +20 -0
  38. package/components/{bar-chart-options.nl-C396D-gg.js → bar-chart-options.nl-DLj-qucU.js} +6 -6
  39. package/components/{box-plot-options.config-D6Wvmx36.js → box-plot-options.config-CT4_71tE.js} +51 -78
  40. package/components/box-plot-options.config-ZZ_mvqGk.cjs +20 -0
  41. package/components/bubble-chart-options.config-B_hTYgid.js +140 -0
  42. package/components/bubble-chart-options.config-BbB5dj43.cjs +20 -0
  43. package/components/{bullet-chart-options.config-B4vBSWrH.js → bullet-chart-options.config-DdTBWTAF.js} +4 -3
  44. package/components/bullet-chart-options.config-Drv0yQ4x.cjs +20 -0
  45. package/components/choropleth-map-options.config-CEGFnwKG.cjs +20 -0
  46. package/components/{choropleth-map-options.config-6-xaMCeR.js → choropleth-map-options.config-CsJjKLVP.js} +32 -30
  47. package/components/{strip-plot-options.config-TB3rkoj2.cjs → circle-pack-chart-options.config-Dobt6Q5A.cjs} +1 -1
  48. package/components/{circle-pack-chart-options.config-DWkyGqA_.js → circle-pack-chart-options.config-FcILD-Hi.js} +4 -3
  49. package/components/circular-gauge-options.config-CSIUw2VN.cjs +20 -0
  50. package/components/circular-gauge-options.config-DtNYelhq.js +193 -0
  51. package/components/{column-chart-options.config-B_a7iN-c.js → column-chart-options.config-BzMjdyfp.js} +34 -75
  52. package/components/column-chart-options.config-iKKyzY3j.cjs +20 -0
  53. package/components/column-chart-options.de-BX13JkAO.cjs +20 -0
  54. package/components/{column-chart-options.de-vSfQkMVy.js → column-chart-options.de-CIYtauiG.js} +6 -6
  55. package/components/{column-chart-options.en-C2DVLfDZ.js → column-chart-options.en-BkAsfXYV.js} +6 -6
  56. package/components/column-chart-options.en-DAee9yHp.cjs +20 -0
  57. package/components/column-chart-options.es-CClMQLE-.cjs +20 -0
  58. package/components/{column-chart-options.es-CmZmT22A.js → column-chart-options.es-jWM7TxS7.js} +6 -6
  59. package/components/{column-chart-options.fr-UmB2ifIT.js → column-chart-options.fr-BB6301nS.js} +6 -6
  60. package/components/column-chart-options.fr-C2Ic0Dq0.cjs +20 -0
  61. package/components/column-chart-options.nl-Bb6XiSDH.cjs +20 -0
  62. package/components/{column-chart-options.nl-DRrIt7sx.js → column-chart-options.nl-HUMDgKdl.js} +6 -6
  63. package/components/{combination-chart-options.config-l4szBpws.js → combination-chart-options.config-BEMnrQdd.js} +46 -62
  64. package/components/combination-chart-options.config-BqQlqnhf.cjs +20 -0
  65. package/components/{combination-chart-options.de-BExnOCui.cjs → combination-chart-options.de-BiGjuWUS.cjs} +1 -1
  66. package/components/{combination-chart-options.de-BdV-j9VK.js → combination-chart-options.de-DVJ9sfLC.js} +2 -0
  67. package/components/{combination-chart-options.en-DquyU8wD.js → combination-chart-options.en-B5piXq82.js} +2 -0
  68. package/components/{combination-chart-options.en-iAkhHGFR.cjs → combination-chart-options.en-e4XMalU0.cjs} +1 -1
  69. package/components/{combination-chart-options.es-Oz29P_Vd.js → combination-chart-options.es-BmuyyP32.js} +2 -0
  70. package/components/{combination-chart-options.es-B2piaL6n.cjs → combination-chart-options.es-OXb8nozF.cjs} +1 -1
  71. package/components/{combination-chart-options.fr-L6m-7FiZ.js → combination-chart-options.fr-CIrnpWEu.js} +2 -0
  72. package/components/{combination-chart-options.fr-BEA5mDGS.cjs → combination-chart-options.fr-CYzANyZs.cjs} +1 -1
  73. package/components/{combination-chart-options.nl-DJDH3K_U.js → combination-chart-options.nl-BDJ7t0BY.js} +2 -0
  74. package/components/{combination-chart-options.nl-DDyajIyP.cjs → combination-chart-options.nl-DyAUjvqC.cjs} +1 -1
  75. package/components/conditional-number-options.config-ZVtstIjn.cjs +20 -0
  76. package/components/conditional-number-options.config-qdX9T4zu.js +210 -0
  77. package/components/dataset-selector-list/dataset-selector-list.d.ts +6 -2
  78. package/components/dataset-selector-list/index.cjs +1 -1
  79. package/components/dataset-selector-list/index.js +1 -1
  80. package/components/{dataset-selector-list-yU9o-gBK.js → dataset-selector-list-5y3eFlPa.js} +13 -3
  81. package/components/{dataset-selector-list-CekhYtbU.cjs → dataset-selector-list-BWgvikkr.cjs} +2 -2
  82. package/components/dataset-selector-row/dataset-selector-row.d.ts +6 -2
  83. package/components/dataset-selector-row/index.cjs +1 -1
  84. package/components/dataset-selector-row/index.js +1 -1
  85. package/components/{dataset-selector-row-Cte3skmf.cjs → dataset-selector-row-BjyeiTVy.cjs} +3 -3
  86. package/components/{dataset-selector-row-eb2fUxMB.js → dataset-selector-row-pEM8hLyJ.js} +13 -3
  87. package/components/donut-chart-options.config-D5Wkh0nh.js +212 -0
  88. package/components/donut-chart-options.config-DUIE-bdr.cjs +20 -0
  89. package/components/evolution-number-options.config-CoGBgLLw.cjs +20 -0
  90. package/components/{evolution-number-options.config-C3tU650w.js → evolution-number-options.config-DT7iGQA8.js} +5 -3
  91. package/components/funnel-chart-options.config-CMOM4QN2.cjs +20 -0
  92. package/components/{funnel-chart-options.config-6ifTq7Xh.js → funnel-chart-options.config-Ca5-W17F.js} +5 -3
  93. package/components/guidelines-options.config-D-ZuReR_.cjs +20 -0
  94. package/components/guidelines-options.config-DyedEeX2.js +48 -0
  95. package/components/{heat-map-options.config-CezceVM3.js → heat-map-options.config-DkuYkbWu.js} +29 -27
  96. package/components/heat-map-options.config-DtDh9Gpy.cjs +20 -0
  97. package/components/{heat-table-options.config-C7kvRE10.js → heat-table-options.config-DT3d8VS7.js} +49 -154
  98. package/components/heat-table-options.config-Dl6GDA-m.cjs +20 -0
  99. package/components/hexbin-map-options.config-BGmgxnMh.cjs +20 -0
  100. package/components/{hexbin-map-options.config-8brGMkt_.js → hexbin-map-options.config-Bqp3u2bH.js} +16 -14
  101. package/components/index.cjs +1 -1
  102. package/components/index.js +7 -7
  103. package/components/info-tooltip-options.config-B9T0cwSM.cjs +20 -0
  104. package/components/info-tooltip-options.config-BmSMkirf.js +59 -0
  105. package/components/info-tooltip-options.i18n-B3u0H74j.cjs +20 -0
  106. package/components/info-tooltip-options.i18n-CDx47Py-.js +74 -0
  107. package/components/interactive-viz-item/index.cjs +1 -1
  108. package/components/interactive-viz-item/index.js +1 -1
  109. package/components/{interactive-viz-item-Bn9IhEvD.cjs → interactive-viz-item-CcIWn6Tz.cjs} +1 -1
  110. package/components/{interactive-viz-item-CXHq9Csp.js → interactive-viz-item-wZ0r8XHx.js} +1 -1
  111. package/components/item-option/index.cjs +1 -1
  112. package/components/item-option/index.js +1 -1
  113. package/components/{item-option-dwknAAj9.cjs → item-option-B-Rgy3_8.cjs} +1 -1
  114. package/components/{item-option-Dc4GNRMW.js → item-option-B0EzSGTP.js} +87 -71
  115. package/components/item-option-panel/index.cjs +1 -1
  116. package/components/item-option-panel/index.js +1 -1
  117. package/components/{item-option-panel-DIU-3auc.js → item-option-panel-DOOOOgfV.js} +1 -1
  118. package/components/{item-option-panel-Dv6v7RzM.cjs → item-option-panel-mHwmWhJY.cjs} +1 -1
  119. package/components/item-options-configs.cjs +1 -1
  120. package/components/item-options-configs.js +35 -35
  121. package/components/{line-chart-options.config-OeRMkKMP.js → line-chart-options.config-BMT_e6dk.js} +49 -65
  122. package/components/line-chart-options.config-CL8SCDgU.cjs +20 -0
  123. package/components/{line-chart-options.de-DMuN0E3y.cjs → line-chart-options.de-CKbHARjX.cjs} +1 -1
  124. package/components/{line-chart-options.de-CihDXrQ4.js → line-chart-options.de-CtxTZ-Nx.js} +2 -0
  125. package/components/{line-chart-options.en-CPWllKeE.js → line-chart-options.en-BgXtU92P.js} +2 -0
  126. package/components/{line-chart-options.en-81dHDKJE.cjs → line-chart-options.en-DmtT3Hbw.cjs} +1 -1
  127. package/components/{line-chart-options.es-IX7Hu1Jk.js → line-chart-options.es--u7QlrhG.js} +2 -0
  128. package/components/{line-chart-options.es-CshvnhMH.cjs → line-chart-options.es-BwyQviz-.cjs} +1 -1
  129. package/components/{line-chart-options.fr-EMHHZpiy.cjs → line-chart-options.fr-BUwOFGR7.cjs} +1 -1
  130. package/components/{line-chart-options.fr-CkLIbP6Y.js → line-chart-options.fr-BaPc1M70.js} +2 -0
  131. package/components/{line-chart-options.nl-C9FWbWJy.cjs → line-chart-options.nl-BkPXShNF.cjs} +1 -1
  132. package/components/{line-chart-options.nl-Du2kphsn.js → line-chart-options.nl-C86fSn7a.js} +2 -0
  133. package/components/marker-map-options.config-BE8GnY_T.js +122 -0
  134. package/components/marker-map-options.config-SkhbtEh0.cjs +20 -0
  135. package/components/ohlc-chart-options.config-BAB4pyo9.js +89 -0
  136. package/components/{bullet-chart-options.config-B2afO5Xh.cjs → ohlc-chart-options.config-BrcfGxDw.cjs} +1 -1
  137. package/components/{ohlc-chart-options.de-DqGHkVNG.cjs → ohlc-chart-options.de-DtanuVcU.cjs} +1 -1
  138. package/components/{ohlc-chart-options.de-Brd2iN0B.js → ohlc-chart-options.de-LnJmQjiR.js} +2 -0
  139. package/components/{ohlc-chart-options.en-C3AWmo7s.js → ohlc-chart-options.en-B7TU8CK4.js} +2 -0
  140. package/components/{ohlc-chart-options.en-DrWja-A6.cjs → ohlc-chart-options.en-CStPyUia.cjs} +1 -1
  141. package/components/{ohlc-chart-options.es-Cwl_vxNQ.js → ohlc-chart-options.es-B7m8-_pA.js} +2 -0
  142. package/components/{ohlc-chart-options.es-Cac117z2.cjs → ohlc-chart-options.es-CfTI32Rg.cjs} +1 -1
  143. package/components/{ohlc-chart-options.fr-DJuaTjBf.cjs → ohlc-chart-options.fr-C53gRLh5.cjs} +1 -1
  144. package/components/{ohlc-chart-options.fr-STOjKGOk.js → ohlc-chart-options.fr-u_Bi9raw.js} +2 -0
  145. package/components/{ohlc-chart-options.nl-CV0A0J84.js → ohlc-chart-options.nl-BrpwjNGt.js} +2 -0
  146. package/components/{ohlc-chart-options.nl-C7_qhngI.cjs → ohlc-chart-options.nl-Dh9iPIWB.cjs} +1 -1
  147. package/components/{parallel-coordinates-plot-options.config-Bw8T5EE4.js → parallel-coordinates-plot-options.config-BXsg-9wF.js} +4 -3
  148. package/components/{parallel-coordinates-plot-options.config--6iJkURT.cjs → parallel-coordinates-plot-options.config-DFRL952-.cjs} +1 -1
  149. package/components/pivot-table-options.config-B9ZfmFZH.cjs +20 -0
  150. package/components/{pivot-table-options.config-gL2C_zvT.js → pivot-table-options.config-tf8f5F-n.js} +5 -3
  151. package/components/{pyramid-chart-options.config-348RYXh8.js → pyramid-chart-options.config-BnCfeT-K.js} +19 -61
  152. package/components/pyramid-chart-options.config-LSOc6ALz.cjs +20 -0
  153. package/components/radar-chart-options.config-B5WP2MPc.cjs +20 -0
  154. package/components/{radar-chart-options.config-BeGjchnc.js → radar-chart-options.config-DrNyOkHq.js} +7 -5
  155. package/components/regular-table-options.config-CweBtAvm.js +153 -0
  156. package/components/regular-table-options.config-nBBnO4ru.cjs +20 -0
  157. package/components/route-map-options.config-DS9cCAQK.cjs +20 -0
  158. package/components/{route-map-options.config-DWG5127-.js → route-map-options.config-DXHqb8Ve.js} +39 -37
  159. package/components/{sankey-diagram-options.config-DW72WBKU.js → sankey-diagram-options.config-CpNK2oK6.js} +5 -3
  160. package/components/sankey-diagram-options.config-CuKQOPPW.cjs +20 -0
  161. package/components/scatter-plot-options.config-BA_hVuhw.js +128 -0
  162. package/components/scatter-plot-options.config-C-L2dJ2o.cjs +20 -0
  163. package/components/scatter-plot-options.de-3CPVK7Hi.cjs +20 -0
  164. package/components/{scatter-plot-options.de-BO73A_o5.js → scatter-plot-options.de-CNLrv6j3.js} +3 -0
  165. package/components/{scatter-plot-options.en-B6S8Yf66.js → scatter-plot-options.en-DigMzpQy.js} +3 -0
  166. package/components/{scatter-plot-options.en-SuHaPKPZ.cjs → scatter-plot-options.en-Dzvigy8-.cjs} +1 -1
  167. package/components/scatter-plot-options.es-C-IH7GVH.cjs +20 -0
  168. package/components/{scatter-plot-options.es-jbzKhq4S.js → scatter-plot-options.es-CQm_VVqJ.js} +3 -0
  169. package/components/scatter-plot-options.fr-Cdp6kPQi.cjs +20 -0
  170. package/components/{scatter-plot-options.fr-DMFP8FB4.js → scatter-plot-options.fr-s0M39VT4.js} +3 -0
  171. package/components/{scatter-plot-options.nl-BqN6XbnS.js → scatter-plot-options.nl-CqpPIO03.js} +3 -0
  172. package/components/scatter-plot-options.nl-DeINlMqc.cjs +20 -0
  173. package/components/speedometer-chart-options.config-CEIZfeYG.cjs +20 -0
  174. package/components/speedometer-chart-options.config-dsUupCqm.js +251 -0
  175. package/components/spike-map-options.config-BRwdTyrp.cjs +20 -0
  176. package/components/{spike-map-options.config-Ch0p9Q5l.js → spike-map-options.config-Dh4Ky5ZP.js} +42 -40
  177. package/components/{circle-pack-chart-options.config-CD8MWMTw.cjs → strip-plot-options.config-DpRoR04b.cjs} +1 -1
  178. package/components/{strip-plot-options.config-WICS2rnK.js → strip-plot-options.config-Vw3GoLef.js} +4 -3
  179. package/components/{sunburst-chart-options.config-Bz-jP-gZ.js → sunburst-chart-options.config-0GUoeJMb.js} +5 -3
  180. package/components/sunburst-chart-options.config-CCNYG73m.cjs +20 -0
  181. package/components/symbol-map-options.config-Ce0Kv7N7.cjs +20 -0
  182. package/components/{symbol-map-options.config-I89tFJUU.js → symbol-map-options.config-Dultd0tF.js} +7 -5
  183. package/components/treemap-chart-options.config-CtpfX7hs.js +209 -0
  184. package/components/treemap-chart-options.config-pA93-9cX.cjs +20 -0
  185. package/components/wordcloud-chart-options.config-ConV1s49.cjs +20 -0
  186. package/components/wordcloud-chart-options.config-Dxu7-YcG.js +95 -0
  187. package/custom-elements.json +96 -16
  188. package/package.json +1 -1
  189. package/react/package.json +2 -2
  190. package/components/ai-interaction-textarea-CJO50_1F.cjs +0 -95
  191. package/components/area-chart-options.config-N24pwyqX.cjs +0 -20
  192. package/components/area-chart-options.de-C2WwBf7L.cjs +0 -20
  193. package/components/area-chart-options.es-CMcI1TAb.cjs +0 -20
  194. package/components/area-chart-options.fr-CHeI4bKx.cjs +0 -20
  195. package/components/area-chart-options.nl-BM7u0iDj.cjs +0 -20
  196. package/components/bar-chart-options.config-DnNGu3RV.cjs +0 -20
  197. package/components/bar-chart-options.de-BZ3uW1-o.cjs +0 -20
  198. package/components/bar-chart-options.en-YNlXBbD4.cjs +0 -20
  199. package/components/bar-chart-options.es-BNeN4ThD.cjs +0 -20
  200. package/components/bar-chart-options.fr-Cib__mEv.cjs +0 -20
  201. package/components/bar-chart-options.nl-CmGjKNyC.cjs +0 -20
  202. package/components/box-plot-options.config-DCDHZMGK.cjs +0 -20
  203. package/components/bubble-chart-options.config-CDY6pFK6.js +0 -135
  204. package/components/bubble-chart-options.config-DjdxlwRr.cjs +0 -20
  205. package/components/choropleth-map-options.config-6DXYO5_E.cjs +0 -20
  206. package/components/circular-gauge-options.config-C0T9GkZX.cjs +0 -20
  207. package/components/circular-gauge-options.config-D_xHWhBy.js +0 -188
  208. package/components/column-chart-options.config-D6we1uLn.cjs +0 -20
  209. package/components/column-chart-options.de-wUcJvrrW.cjs +0 -20
  210. package/components/column-chart-options.en-YNlXBbD4.cjs +0 -20
  211. package/components/column-chart-options.es-YKftTtkL.cjs +0 -20
  212. package/components/column-chart-options.fr-Cib__mEv.cjs +0 -20
  213. package/components/column-chart-options.nl-Tg07PDkZ.cjs +0 -20
  214. package/components/combination-chart-options.config-C4y9E0Gr.cjs +0 -20
  215. package/components/conditional-number-options.config-DB4_BYN2.js +0 -205
  216. package/components/conditional-number-options.config-T6oXXy14.cjs +0 -20
  217. package/components/donut-chart-options.config-BhKFa3dz.cjs +0 -20
  218. package/components/donut-chart-options.config-CjtEDiJI.js +0 -207
  219. package/components/evolution-number-options.config-CKL01dAR.cjs +0 -20
  220. package/components/funnel-chart-options.config-BOI6bzbw.cjs +0 -20
  221. package/components/heat-map-options.config-C4lqg4Gf.cjs +0 -20
  222. package/components/heat-table-options.config-DiX5eL4B.cjs +0 -20
  223. package/components/hexbin-map-options.config-BVajY1MH.cjs +0 -20
  224. package/components/line-chart-options.config-CVR_mb2z.cjs +0 -20
  225. package/components/marker-map-options.config-CtW7nl1C.js +0 -117
  226. package/components/marker-map-options.config-M9BvYinR.cjs +0 -20
  227. package/components/ohlc-chart-options.config-DOqKN6ov.cjs +0 -20
  228. package/components/ohlc-chart-options.config-Db40TXcB.js +0 -124
  229. package/components/pivot-table-options.config-DdbSCsRL.cjs +0 -20
  230. package/components/pyramid-chart-options.config-I2ZIo_GV.cjs +0 -20
  231. package/components/radar-chart-options.config-CCMh7qJG.cjs +0 -20
  232. package/components/regular-table-options.config-Bf0VAtT_.js +0 -148
  233. package/components/regular-table-options.config-DqZD5P9l.cjs +0 -20
  234. package/components/route-map-options.config-DVo8FTke.cjs +0 -20
  235. package/components/sankey-diagram-options.config-C8Gm15Mi.cjs +0 -20
  236. package/components/scatter-plot-options.config-CUyWy2xE.js +0 -322
  237. package/components/scatter-plot-options.config-Cd4DvLoN.cjs +0 -20
  238. package/components/scatter-plot-options.de-DO4ns5t0.cjs +0 -20
  239. package/components/scatter-plot-options.es-B0alrlLR.cjs +0 -20
  240. package/components/scatter-plot-options.fr-CkJXV4Og.cjs +0 -20
  241. package/components/scatter-plot-options.nl-CuhZUABa.cjs +0 -20
  242. package/components/speedometer-chart-options.config-CtWGujmb.js +0 -246
  243. package/components/speedometer-chart-options.config-e9Ktyajm.cjs +0 -20
  244. package/components/spike-map-options.config-D-T_kT1C.cjs +0 -20
  245. package/components/sunburst-chart-options.config-BojxVGMu.cjs +0 -20
  246. package/components/symbol-map-options.config-BmHEhC5t.cjs +0 -20
  247. package/components/treemap-chart-options.config-i7BH9mNl.js +0 -204
  248. package/components/treemap-chart-options.config-xtu6J11C.cjs +0 -20
  249. package/components/wordcloud-chart-options.config-BjLJyuyw.cjs +0 -20
  250. package/components/wordcloud-chart-options.config-D_AhgZRs.js +0 -90
@@ -121,10 +121,14 @@ export declare class LuzmoAiChat extends LuzmoElement {
121
121
  * @default https://app.luzmo.com
122
122
  */
123
123
  appServer: string;
124
+ /** When true, shows public datasets alongside the user's other datasets. */
125
+ includePublicDatasets: boolean;
124
126
  /**
125
- * When true, restricts results to public datasets (opendata parity)
127
+ * Alias for includePublicDatasets.
128
+ * @deprecated Use includePublicDatasets instead.
126
129
  */
127
- flagOpendata: boolean;
130
+ get flagOpendata(): boolean;
131
+ set flagOpendata(value: boolean);
128
132
  /**
129
133
  * When true, hides the "+ Add dataset" button in the input
130
134
  */
@@ -17,4 +17,4 @@
17
17
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
18
  * SOFTWARE.
19
19
  * */
20
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../ai-interaction-textarea-CJO50_1F.cjs"),t=require("../ai-chat-D1Rzwdxy.cjs");exports.AI_PROMPT_ACCEPTED_IMAGE_MIME_TYPES=e.c,exports.AI_PROMPT_MAX_ATTACHMENTS=e.l,exports.AiChatSession=t.i,exports.AiChatSessionController=t.r,exports.LuzmoAiChat=t.n,exports.LuzmoAiChatEmptyState=t.E,exports.assertValidAiPromptAttachmentFiles=e.u,exports.assertValidAiPromptAttachmentUrls=e.d,exports.blobToBase64=e.n,exports.buildAiDictationRequest=e.r,exports.buildAiPromptDeleteRequest=t._,exports.buildAiPromptProperties=t.v,exports.buildAiPromptRequest=t.y,exports.buildAnalystAiPromptProperties=t.b,exports.buildDashboardAiPromptProperties=t.x,exports.buildItemAiPromptProperties=t.S,exports.buildSavedAgentAiPromptProperties=t.C,exports.chartToItemAsset=t.w,exports.createAiChatSession=t.a,exports.createInitialProgress=t.f,exports.createInitialStreamState=t.o,exports.createStreamHandler=t.s,exports.extractChartFromChunk=t.u,exports.extractDashboardFromChunk=t.d,exports.fetchStreamingResponse=t.m,exports.getAgentStreamDefinition=t.c,exports.getAiDictationUrl=e.i,exports.getAiPromptUrl=t.T,exports.getUploadUrl=e.o,exports.hasProgressChunk=t.p,exports.isAiPromptAcceptedImageFile=e.f,exports.isAiPromptAcceptedImageMimeType=e.p,exports.isAiPromptAcceptedImageUrl=e.m,exports.isRecognizedStep=t.t,exports.parseStreamLine=t.h,exports.processStreamChunk=t.l,exports.readNdjsonStream=t.g,exports.streamAiDictation=e.a,exports.uploadAiPromptImages=e.s;
20
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../ai-interaction-textarea-CMz5ixwt.cjs"),t=require("../ai-chat-CQtzaiZ_.cjs");exports.AI_PROMPT_ACCEPTED_IMAGE_MIME_TYPES=e.c,exports.AI_PROMPT_MAX_ATTACHMENTS=e.l,exports.AiChatSession=t.i,exports.AiChatSessionController=t.r,exports.LuzmoAiChat=t.n,exports.LuzmoAiChatEmptyState=t.E,exports.assertValidAiPromptAttachmentFiles=e.u,exports.assertValidAiPromptAttachmentUrls=e.d,exports.blobToBase64=e.n,exports.buildAiDictationRequest=e.r,exports.buildAiPromptDeleteRequest=t._,exports.buildAiPromptProperties=t.v,exports.buildAiPromptRequest=t.y,exports.buildAnalystAiPromptProperties=t.b,exports.buildDashboardAiPromptProperties=t.x,exports.buildItemAiPromptProperties=t.S,exports.buildSavedAgentAiPromptProperties=t.C,exports.chartToItemAsset=t.w,exports.createAiChatSession=t.a,exports.createInitialProgress=t.f,exports.createInitialStreamState=t.o,exports.createStreamHandler=t.s,exports.extractChartFromChunk=t.u,exports.extractDashboardFromChunk=t.d,exports.fetchStreamingResponse=t.m,exports.getAgentStreamDefinition=t.c,exports.getAiDictationUrl=e.i,exports.getAiPromptUrl=t.T,exports.getUploadUrl=e.o,exports.hasProgressChunk=t.p,exports.isAiPromptAcceptedImageFile=e.f,exports.isAiPromptAcceptedImageMimeType=e.p,exports.isAiPromptAcceptedImageUrl=e.m,exports.isRecognizedStep=t.t,exports.parseStreamLine=t.h,exports.processStreamChunk=t.l,exports.readNdjsonStream=t.g,exports.streamAiDictation=e.a,exports.uploadAiPromptImages=e.s;
@@ -24,6 +24,6 @@
24
24
  e.setAttribute("data-luzmo-vars", ""), e.textContent = "html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: color-mix(in oklch, var(--luzmo-border-color-full), black 25%);--luzmo-border-color-full-down: color-mix(in oklch, var(--luzmo-border-color-full), black 45%);--luzmo-border-color-full-focus: color-mix(in oklch, var(--luzmo-border-color-full), black 25%);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: color-mix( in oklch, color-mix(in oklch, var(--luzmo-background-color), var(--luzmo-primary) 5%), black 1.5% );--luzmo-background-color-down: color-mix(in oklch, color-mix(in oklch, var(--luzmo-background-color), var(--luzmo-primary) 7%), black 1%);--luzmo-background-color-focus: color-mix( in oklch, color-mix(in oklch, var(--luzmo-background-color), var(--luzmo-primary) 5%), black 1.5% );--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: color-mix(in oklch, var(--luzmo-background-color-highlight), black 10%);--luzmo-background-color-highlight-down: color-mix(in oklch, var(--luzmo-background-color-highlight), black 20%);--luzmo-background-color-highlight-focus: color-mix(in oklch, var(--luzmo-background-color-highlight), black 10%);--luzmo-background-color-alt-1: rgb(250, 250, 250);--luzmo-background-color-alt-2: rgb(239, 239, 239);--luzmo-border-width: 1px;--luzmo-shadow-color-rgb: 0, 0, 0;--luzmo-shadow-opacity: 0.1;--luzmo-shadow-color: rgba(var(--luzmo-shadow-color-rgb), var(--luzmo-shadow-opacity));--luzmo-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-hard: #000;--luzmo-font-color-disabled: var(--luzmo-color-disabled);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: color-mix(in oklch, var(--luzmo-font-color), black 8%);--luzmo-font-color-down: color-mix(in oklch, var(--luzmo-font-color), black 20%);--luzmo-font-color-focus: color-mix(in oklch, var(--luzmo-font-color), black 8%);--luzmo-scrollbar-size: 6px;--luzmo-scrollbar-width: thin;--luzmo-scrollbar-track-background: transparent;--luzmo-scrollbar-track-border-radius: var(--luzmo-border-radius-s);--luzmo-scrollbar-thumb-background: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-scrollbar-thumb-border-radius: var(--luzmo-border-radius-s);--luzmo-scrollbar-thumb-hover-background: rgba(var(--luzmo-border-color-rgb), 0.4);--luzmo-primary: #4434ff;--luzmo-primary-hover: color-mix(in oklch, var(--luzmo-primary), black 8%);--luzmo-primary-down: color-mix(in oklch, var(--luzmo-primary), black 20%);--luzmo-primary-focus: color-mix(in oklch, var(--luzmo-primary), black 8%);--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-secondary: #ff00ff;--luzmo-secondary-hover: color-mix(in oklch, var(--luzmo-secondary), black 8%);--luzmo-secondary-down: color-mix(in oklch, var(--luzmo-secondary), black 20%);--luzmo-secondary-focus: color-mix(in oklch, var(--luzmo-secondary), black 8%);--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 255, 0, 255;--luzmo-secondary-outline: rgba(255, 0, 255, 0.2);--luzmo-negative-color: #ca221c;--luzmo-negative-color-hover: color-mix(in oklch, var(--luzmo-negative-color), black 8%);--luzmo-negative-color-down: color-mix(in oklch, var(--luzmo-negative-color), black 20%);--luzmo-negative-color-focus: color-mix(in oklch, var(--luzmo-negative-color), black 8%);--luzmo-negative-color-rgb: 202, 34, 28;--luzmo-positive-color: rgb(20, 150, 101);--luzmo-positive-color-hover: color-mix(in oklch, var(--luzmo-positive-color), black 8%);--luzmo-positive-color-down: color-mix(in oklch, var(--luzmo-positive-color), black 20%);--luzmo-positive-color-focus: color-mix(in oklch, var(--luzmo-positive-color), black 8%);--luzmo-positive-color-rgb: 20, 150, 101;--luzmo-selected-color: rgb(110, 110, 110);--luzmo-selected-color-hover: color-mix(in oklch, var(--luzmo-selected-color), black 25%);--luzmo-selected-color-down: color-mix(in oklch, var(--luzmo-selected-color), black 45%);--luzmo-selected-color-focus: color-mix(in oklch, var(--luzmo-selected-color), black 25%);--luzmo-selected-color-hard: #1e1e1e;--luzmo-selected-color-hard-hover: color-mix(in oklch, var(--luzmo-selected-color-hard), black 25%);--luzmo-selected-color-hard-down: color-mix(in oklch, var(--luzmo-selected-color-hard), black 45%);--luzmo-selected-color-hard-focus: color-mix(in oklch, var(--luzmo-selected-color-hard), black 25%);--luzmo-color-informative: #1a77e9;--luzmo-color-informative-rgb: 26, 119, 233;--luzmo-color-disabled: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 12px;--luzmo-icon-size-xs: 14px;--luzmo-icon-size-s: 16px;--luzmo-icon-size-m: 18px;--luzmo-icon-size-l: 20px;--luzmo-icon-size-xl: 22px;--luzmo-icon-size-xxl: 32px}", document.head.appendChild(e);
25
25
  }
26
26
  })();
27
- import { a as e, c as t, d as n, f as r, i, l as a, m as o, n as s, o as c, p as l, r as u, s as d, u as f } from "../ai-interaction-textarea-DMT8RNUP.js";
28
- import { C as p, E as m, S as h, T as g, _, a as v, b as y, c as b, d as x, f as S, g as C, h as w, i as T, l as E, m as D, n as O, o as k, p as A, r as j, s as M, t as N, u as P, v as F, w as I, x as L, y as R } from "../ai-chat-Dy_utMXO.js";
27
+ import { a as e, c as t, d as n, f as r, i, l as a, m as o, n as s, o as c, p as l, r as u, s as d, u as f } from "../ai-interaction-textarea-uc14Goa4.js";
28
+ import { C as p, E as m, S as h, T as g, _, a as v, b as y, c as b, d as x, f as S, g as C, h as w, i as T, l as E, m as D, n as O, o as k, p as A, r as j, s as M, t as N, u as P, v as F, w as I, x as L, y as R } from "../ai-chat-CTr-dplW.js";
29
29
  export { t as AI_PROMPT_ACCEPTED_IMAGE_MIME_TYPES, a as AI_PROMPT_MAX_ATTACHMENTS, T as AiChatSession, j as AiChatSessionController, O as LuzmoAiChat, m as LuzmoAiChatEmptyState, f as assertValidAiPromptAttachmentFiles, n as assertValidAiPromptAttachmentUrls, s as blobToBase64, u as buildAiDictationRequest, _ as buildAiPromptDeleteRequest, F as buildAiPromptProperties, R as buildAiPromptRequest, y as buildAnalystAiPromptProperties, L as buildDashboardAiPromptProperties, h as buildItemAiPromptProperties, p as buildSavedAgentAiPromptProperties, I as chartToItemAsset, v as createAiChatSession, S as createInitialProgress, k as createInitialStreamState, M as createStreamHandler, P as extractChartFromChunk, x as extractDashboardFromChunk, D as fetchStreamingResponse, b as getAgentStreamDefinition, i as getAiDictationUrl, g as getAiPromptUrl, c as getUploadUrl, A as hasProgressChunk, r as isAiPromptAcceptedImageFile, l as isAiPromptAcceptedImageMimeType, o as isAiPromptAcceptedImageUrl, N as isRecognizedStep, w as parseStreamLine, E as processStreamChunk, C as readNdjsonStream, e as streamAiDictation, d as uploadAiPromptImages };
@@ -17,7 +17,7 @@
17
17
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
18
  * SOFTWARE.
19
19
  * */
20
- const e=require("./ai-interaction-textarea-CJO50_1F.cjs"),t=require("./base-B0frB7oV.cjs"),n=require("./decorate-DCJt-2rt.cjs");let r=require("@lit/localize/lit-localize"),i=require("@luzmo/icons");require("@luzmo/lucero/button"),require("@luzmo/lucero/chat-message"),require("@luzmo/lucero/icon"),require("@luzmo/lucero/overlay"),require("@luzmo/lucero/popover"),require("@luzmo/lucero/progress-steps");let a=require("lit"),o=require("lit/decorators.js"),s=require("lit/directives/unsafe-html.js");require("@luzmo/lucero/action-button");function c(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(e){if(Array.isArray(e))return e}function u(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function d(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
20
+ const e=require("./ai-interaction-textarea-CMz5ixwt.cjs"),t=require("./base-B0frB7oV.cjs"),n=require("./decorate-DCJt-2rt.cjs");let r=require("@lit/localize/lit-localize"),i=require("@luzmo/icons");require("@luzmo/lucero/button"),require("@luzmo/lucero/chat-message"),require("@luzmo/lucero/icon"),require("@luzmo/lucero/overlay"),require("@luzmo/lucero/popover"),require("@luzmo/lucero/progress-steps");let a=require("lit"),o=require("lit/decorators.js"),s=require("lit/directives/unsafe-html.js");require("@luzmo/lucero/action-button");function c(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(e){if(Array.isArray(e))return e}function u(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function d(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
21
21
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f(e,t){return l(e)||u(e,t)||p(e,t)||d()}function p(e,t){if(e){if(typeof e==`string`)return c(e,t);var n={}.toString.call(e).slice(8,-1);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)?c(e,t):void 0}}var ee=Object.entries,te=Object.setPrototypeOf,ne=Object.isFrozen,re=Object.getPrototypeOf,ie=Object.getOwnPropertyDescriptor,m=Object.freeze,h=Object.seal,ae=Object.create,oe=typeof Reflect<`u`&&Reflect,se=oe.apply,g=oe.construct;m||=function(e){return e},h||=function(e){return e},se||=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.apply(t,r)},g||=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)};var ce=b(Array.prototype.forEach),le=b(Array.prototype.lastIndexOf),ue=b(Array.prototype.pop),de=b(Array.prototype.push),fe=b(Array.prototype.splice),pe=Array.isArray,me=b(String.prototype.toLowerCase),he=b(String.prototype.toString),ge=b(String.prototype.match),_e=b(String.prototype.replace),ve=b(String.prototype.indexOf),ye=b(String.prototype.trim),be=b(Number.prototype.toString),xe=b(Boolean.prototype.toString),Se=typeof BigInt>`u`?null:b(BigInt.prototype.toString),Ce=typeof Symbol>`u`?null:b(Symbol.prototype.toString),_=b(Object.prototype.hasOwnProperty),v=b(Object.prototype.toString),y=b(RegExp.prototype.test),we=Te(TypeError);function b(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return se(e,t,r)}}function Te(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return g(e,n)}}function x(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:me;if(te&&te(e,null),!pe(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(ne(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Ee(e){for(let t=0;t<e.length;t++)_(e,t)||(e[t]=null);return e}function S(e){let t=ae(null);for(let r of ee(e)){var n=f(r,2);let i=n[0],a=n[1];_(e,i)&&(pe(a)?t[i]=Ee(a):a&&typeof a==`object`&&a.constructor===Object?t[i]=S(a):t[i]=a)}return t}function De(e){switch(typeof e){case`string`:return e;case`number`:return be(e);case`boolean`:return xe(e);case`bigint`:return Se?Se(e):`0`;case`symbol`:return Ce?Ce(e):`Symbol()`;case`undefined`:return v(e);case`function`:case`object`:{if(e===null)return v(e);let t=e,n=C(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:v(e)}return v(e)}default:return v(e)}}function C(e,t){for(;e!==null;){let n=ie(e,t);if(n){if(n.get)return b(n.get);if(typeof n.value==`function`)return b(n.value)}e=re(e)}function n(){return null}return n}function Oe(e){try{return y(e,``),!0}catch{return!1}}var ke=m(`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(`.`)),Ae=m(`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(`.`)),je=m([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Me=m([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Ne=m(`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(`.`)),Pe=m([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Fe=m([`#text`]),Ie=m(`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(`.`)),Le=m(`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(`.`)),Re=m(`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(`.`)),ze=m([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Be=h(/{{[\w\W]*|^[\w\W]*}}/g),Ve=h(/<%[\w\W]*|^[\w\W]*%>/g),He=h(/\${[\w\W]*/g),Ue=h(/^data-[\-\w.\u00B7-\uFFFF]+$/),We=h(/^aria-[\-\w]+$/),Ge=h(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ke=h(/^(?:\w+script|data):/i),qe=h(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Je=h(/^html$/i),Ye=h(/^[a-z][.\w]*(-[.\w]+)+$/i),Xe=h(/<[/\w!]/g),Ze=h(/<[/\w]/g),Qe=h(/<\/no(script|embed|frames)/i),$e=h(/\/>/i),w={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},et=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],tt=m(x({},et)),nt=function(){let e={};return ce(et,t=>{e[t]=h(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),m(e)}(),rt=function(){return typeof window>`u`?null:window},it=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},at=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ot=function(e,t,n,r){return _(e,t)&&pe(e[t])?x(r.base?S(r.base):{},e[t],r.transform):n},st=function(e,t,n){let r=_(e,t)?e[t]:void 0;return r&&typeof r==`object`?S(r):n()};function ct(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:rt(),t=e=>ct(e);if(t.version=`3.4.15`,t.removed=[],!e||!e.document||e.document.nodeType!==w.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=C(d,`cloneNode`),p=C(d,`remove`),te=C(d,`removeAttributeNode`),ne=C(d,`nextSibling`),re=C(d,`childNodes`),ie=C(d,`parentNode`),oe=C(d,`shadowRoot`),se=C(d,`attributes`),g=o&&o.prototype?C(o.prototype,`nodeType`):null,be=o&&o.prototype?C(o.prototype,`nodeName`):null,xe=o&&o.prototype?C(o.prototype,`ownerDocument`):null,Se=function(e){return g?g(e):e.nodeType},Ce=function(e){return be?be(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let v,b=``,Te,Ee=!1,et=0,lt=function(){if(et>0)throw we(`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.`)},T=function(e){lt(),et++;try{return v.createHTML(e)}finally{et--}},ut=function(e){lt(),et++;try{return v.createScriptURL(e)}finally{et--}},dt=function(){return Ee||=(Te=it(u,i),!0),Te},E=n,D=E.implementation,O=E.createNodeIterator,ft=E.createDocumentFragment,k=E.getElementsByTagName,pt=r.importNode,A=at();t.isSupported=typeof ee==`function`&&typeof ie==`function`&&D&&D.createHTMLDocument!==void 0;let mt=Be,ht=Ve,gt=He,_t=Ue,vt=We,yt=Ke,bt=qe,xt=Ye,St=Ge,j=null,Ct=x({},[...ke,...Ae,...je,...Ne,...Fe]),M=null,wt=x({},[...Ie,...Le,...Re,...ze]),N=Object.seal(ae(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Tt=null,Et=null,P=Object.seal(ae(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Dt=!0,Ot=!0,kt=!1,At=!0,F=!1,I=!0,jt=!1,L=!1,Mt=null,Nt=null,Pt=!1,Ft=!1,It=!1,Lt=!1,Rt=!0,zt=!1,Bt=`user-content-`,Vt=!0,Ht=!1,Ut={},Wt=null,Gt=x({},`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(`.`)),Kt=null,qt=x({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Jt=null,Yt=x({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Xt=`http://www.w3.org/1998/Math/MathML`,Zt=`http://www.w3.org/2000/svg`,R=`http://www.w3.org/1999/xhtml`,Qt=R,$t=!1,en=null,tn=x({},[Xt,Zt,R],he),nn=m([`mi`,`mo`,`mn`,`ms`,`mtext`]),rn=x({},nn),an=m([`annotation-xml`]),on=x({},an),sn=x({},[`title`,`style`,`font`,`a`,`script`]),z=null,cn=[`application/xhtml+xml`,`text/html`],B=null,ln=null,V=n.createElement(`form`),un=function(e){return e instanceof RegExp||e instanceof Function},dn=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ln&&ln===e)return;(!e||typeof e!=`object`)&&(e={}),e=S(e),z=cn.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,B=z===`application/xhtml+xml`?he:me,j=ot(e,`ALLOWED_TAGS`,Ct,{transform:B}),M=ot(e,`ALLOWED_ATTR`,wt,{transform:B}),en=ot(e,`ALLOWED_NAMESPACES`,tn,{transform:he}),Jt=ot(e,`ADD_URI_SAFE_ATTR`,Yt,{transform:B,base:Yt}),Kt=ot(e,`ADD_DATA_URI_TAGS`,qt,{transform:B,base:qt}),Wt=ot(e,`FORBID_CONTENTS`,Gt,{transform:B}),Tt=ot(e,`FORBID_TAGS`,S({}),{transform:B}),Et=ot(e,`FORBID_ATTR`,S({}),{transform:B}),Ut=_(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?S(e.USE_PROFILES):e.USE_PROFILES:!1,Dt=e.ALLOW_ARIA_ATTR!==!1,Ot=e.ALLOW_DATA_ATTR!==!1,kt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,At=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,F=e.SAFE_FOR_TEMPLATES||!1,I=e.SAFE_FOR_XML!==!1,jt=e.WHOLE_DOCUMENT||!1,Ft=e.RETURN_DOM||!1,It=e.RETURN_DOM_FRAGMENT||!1,Lt=e.RETURN_TRUSTED_TYPE||!1,Pt=e.FORCE_BODY||!1,Rt=e.SANITIZE_DOM!==!1,zt=e.SANITIZE_NAMED_PROPS||!1,Vt=e.KEEP_CONTENT!==!1,Ht=e.IN_PLACE||!1,St=Oe(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Ge,Qt=typeof e.NAMESPACE==`string`?e.NAMESPACE:R,rn=st(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>x({},nn)),on=st(e,`HTML_INTEGRATION_POINTS`,()=>x({},an));let t=st(e,`CUSTOM_ELEMENT_HANDLING`,()=>ae(null));if(N=ae(null),_(t,`tagNameCheck`)&&un(t.tagNameCheck)&&(N.tagNameCheck=t.tagNameCheck),_(t,`attributeNameCheck`)&&un(t.attributeNameCheck)&&(N.attributeNameCheck=t.attributeNameCheck),_(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(N.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),h(N),F&&(Ot=!1),It&&(Ft=!0),Ut&&(j=x({},Fe),M=ae(null),Ut.html===!0&&(x(j,ke),x(M,Ie)),Ut.svg===!0&&(x(j,Ae),x(M,Le),x(M,ze)),Ut.svgFilters===!0&&(x(j,je),x(M,Le),x(M,ze)),Ut.mathMl===!0&&(x(j,Ne),x(M,Re),x(M,ze))),P.tagCheck=null,P.attributeCheck=null,_(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?P.tagCheck=e.ADD_TAGS:pe(e.ADD_TAGS)&&(j===Ct&&(j=S(j)),x(j,e.ADD_TAGS,B))),_(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?P.attributeCheck=e.ADD_ATTR:pe(e.ADD_ATTR)&&(M===wt&&(M=S(M)),x(M,e.ADD_ATTR,B))),_(e,`ADD_FORBID_CONTENTS`)&&pe(e.ADD_FORBID_CONTENTS)&&(Wt===Gt&&(Wt=S(Wt)),x(Wt,e.ADD_FORBID_CONTENTS,B)),Vt&&(j[`#text`]=!0),jt&&x(j,[`html`,`head`,`body`]),j.table&&(x(j,[`tbody`]),delete Tt.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw we(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw we(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=v;v=e.TRUSTED_TYPES_POLICY;try{b=T(``)}catch(e){throw v=t,e}}else e.TRUSTED_TYPES_POLICY===null?(v=void 0,b=``):(v===void 0&&(v=dt()),v&&typeof b==`string`&&(b=T(``)));m&&m(e),ln=e},H=x({},[...Ae,...je,...Me]),fn=x({},[...Ne,...Pe]),pn=function(e,t,n){return t.namespaceURI===R?e===`svg`:t.namespaceURI===Xt?e===`svg`&&(n===`annotation-xml`||rn[n]):!!H[e]},mn=function(e,t,n){return t.namespaceURI===R?e===`math`:t.namespaceURI===Zt?e===`math`&&on[n]:!!fn[e]},hn=function(e,t,n){return t.namespaceURI===Zt&&!on[n]||t.namespaceURI===Xt&&!rn[n]?!1:!fn[e]&&(sn[e]||!H[e])},gn=function(e){let t=ie(e);(!t||!t.tagName)&&(t={namespaceURI:Qt,tagName:`template`});let n=me(e.tagName),r=me(t.tagName);return en[e.namespaceURI]?e.namespaceURI===Zt?pn(n,t,r):e.namespaceURI===Xt?mn(n,t,r):e.namespaceURI===R?hn(n,t,r):!!(z===`application/xhtml+xml`&&en[e.namespaceURI]):!1},U=function(e){de(t.removed,{element:e});try{ie(e).removeChild(e)}catch{if(p(e),!ie(e))throw we(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},W=function(e,t,n){try{te(e,t)}catch{try{e.removeAttribute(n)}catch{}}},_n=function(e){q(e);let t=re(e);if(t){let e=[];ce(t,t=>{de(e,t)}),ce(e,e=>{try{p(e)}catch{}})}let n=se(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&W(e,r,i)}},G=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}de(t.removed,{attribute:r||null,from:n});try{r?te(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`)if(Ft||It)try{U(n)}catch{}else try{n.setAttribute(e,``)}catch{}},K=function(e){let t=se(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||M[B(i)]||W(e,r,i)}},q=function(e){let t=[e];for(;t.length>0;){let e=t.pop();Se(e)===w.element&&K(e);let n=re(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},J=function(e,t){return I?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Y=function(e){if(!I)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=Se(e);if(n===w.processingInstruction||n===w.comment&&y(Ze,e.data)){try{p(e)}catch{}continue}if(n===w.element){let t=e,n=B(Ce(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&J(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=re(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},vn=function(e){let t=null,r=null;if(Pt)e=`<remove></remove>`+e;else{let t=ge(e,/^[\r\n\t ]+/);r=t&&t[0]}z===`application/xhtml+xml`&&Qt===R&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=v?T(e):e;if(Qt===R)try{t=new l().parseFromString(i,z)}catch{}if(!t||!t.documentElement){t=D.createDocument(Qt,`template`,null);try{t.documentElement.innerHTML=$t?b:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Qt===R?k.call(t,jt?`html`:`body`)[0]:jt?t.documentElement:a},yn=function(e){let t=xe?xe(e):e.ownerDocument;return O.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},X=function(e){return e=_e(e,mt,` `),e=_e(e,ht,` `),e=_e(e,gt,` `),e},bn=function(e){e.normalize();let t=xe?xe(e):e.ownerDocument,n=O.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=X(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&ce(i,e=>{Z(e.content)&&bn(e.content)})},xn=function(e){let t=be?be(e):null;return typeof t!=`string`||B(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==se(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!==g(e)||e.childNodes!==re(e)},Z=function(e){if(!g||typeof e!=`object`||!e)return!1;try{return g(e)===w.documentFragment}catch{return!1}},Sn=function(e){if(!g||typeof e!=`object`||!e)return!1;try{return typeof g(e)==`number`}catch{return!1}};function Q(e,n,r){e.length!==0&&ce(e,e=>{e.call(t,n,r,ln)})}let Cn=function(e,t){return!!(I&&e.hasChildNodes()&&!Sn(e.firstElementChild)&&y(Xe,e.textContent)&&y(Xe,e.innerHTML)||I&&e.namespaceURI===R&&tt[t]&&(Sn(e.firstElementChild)||typeof e.textContent==`string`&&y(nt[t],e.textContent))||e.nodeType===w.processingInstruction||I&&e.nodeType===w.comment&&y(Ze,e.data))},wn=function(e,t){if(e instanceof RegExp)return y(e,t);if(e instanceof Function){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return!!e(t,...r)}return!1},Tn=function(e,t,n){if(!Tt[t]&&jn(t)&&wn(N.tagNameCheck,t))return!1;if(Vt&&!Wt[t]){let t=ie(e),r=re(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,ne(e))}}}return U(e),!0},En=function(e,t,n,r){return e.length===0?t:t===n||t===r?S(t):t},Dn=function(e,t){return e===t||ie(e)!==null?!1:(Ht&&q(e),!0)},On=function(e,n){if(Q(A.beforeSanitizeElements,e,null),Dn(e,n))return!0;if(xn(e))return U(e),!0;let r=B(Ce(e));if(j=En(A.uponSanitizeElement,j,Ct,Mt),Q(A.uponSanitizeElement,e,{tagName:r,allowedTags:j}),Dn(e,n))return!0;if(Cn(e,r))return U(e),!0;if(Tt[r]||!(P.tagCheck instanceof Function&&P.tagCheck(r))&&!j[r]){let t=Tn(e,r,n);return t===!1&&Q(A.afterSanitizeElements,e,null),t}if(Se(e)===w.element&&!gn(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&y(Qe,e.innerHTML))return U(e),!0;if(F&&e.nodeType===w.text){let n=X(e.textContent);e.textContent!==n&&(de(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Q(A.afterSanitizeElements,e,null),!1},kn=function(e,t,r){if(Et[t]||J(t,e)||Rt&&(t===`id`||t===`name`)&&(r in n||r in V))return!1;let i=M[t]||P.attributeCheck instanceof Function&&P.attributeCheck(t,e);return Ot&&y(_t,t)||Dt&&y(vt,t)?!0:i?Jt[t]||y(St,_e(r,bt,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&ve(r,`data:`)===0&&Kt[e]||kt&&!y(yt,_e(r,bt,``))?!0:!r:jn(e)&&wn(N.tagNameCheck,e)&&wn(N.attributeNameCheck,t,e)||t===`is`&&N.allowCustomizedBuiltInElements&&wn(N.tagNameCheck,r)},An=x({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),jn=function(e){return!An[me(e)]&&y(xt,e)},Mn=function(e,t,n,r){if(v&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return T(r);case`TrustedScriptURL`:return ut(r)}return r},Nn=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),xn(e)?(U(e),!1):!0}catch{return G(t,e),!1}},Pn=function(e){Q(A.beforeSanitizeAttributes,e,null);let n=e.attributes;if(!n||xn(e))return;M=En(A.uponSanitizeAttribute,M,wt,Nt);let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:M,forceKeepAttr:void 0},i=n.length,a=B(e.nodeName);for(;i--;){let o=n[i],s=o.name,c=o.namespaceURI,l=o.value,u=B(s),d=l,f=s===`value`?d:ye(d),p=!1;if(r.attrName=u,r.attrValue=f,r.keepAttr=!0,r.forceKeepAttr=void 0,Q(A.uponSanitizeAttribute,e,r),f=r.attrValue,zt&&(u===`id`||u===`name`)&&ve(f,Bt)!==0&&(G(s,e,o),f=Bt+f,p=!0),I&&y(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){G(s,e,o);continue}if(u===`attributename`&&ge(f,`href`)){G(s,e,o);continue}if(!r.forceKeepAttr){if(!r.keepAttr){G(s,e,o);continue}if(!At&&y($e,f)){G(s,e,o);continue}if(F&&(f=X(f)),!kn(a,u,f)){G(s,e,o);continue}f=Mn(a,u,c,f),f!==d&&Nn(e,s,c,f)&&p&&ue(t.removed)}}Q(A.afterSanitizeAttributes,e,null)},Fn=function(e){let t=null,n=yn(e);for(Q(A.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Q(A.uponSanitizeShadowNode,t,null),On(t,e),Pn(t),Z(t.content)&&Fn(t.content),Se(t)===w.element){let e=oe(t);Z(e)&&(In(e),Fn(e))}Q(A.afterSanitizeShadowDOM,e,null)},In=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Fn(e.shadow);continue}let n=e.node,r=Se(n)===w.element,i=re(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=be?be(n):null;if(typeof e==`string`&&B(e)===`template`){let e=n.content;Z(e)&&t.push({node:e,shadow:null})}}if(r){let e=oe(n);Z(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if($t=!e,$t&&(e=`<!-->`),typeof e!=`string`&&!Sn(e)&&(e=De(e),typeof e!=`string`))throw we(`dirty is not a string, aborting`);if(!t.isSupported)return e;L?(j=Mt,M=Nt):dn(n),(A.uponSanitizeElement.length>0||A.uponSanitizeAttribute.length>0)&&(j=S(j)),A.uponSanitizeAttribute.length>0&&(M=S(M)),t.removed=[];let c=Ht&&typeof e!=`string`&&Sn(e);if(c){Y(e);let t=Ce(e);if(typeof t==`string`){let n=B(t);if(!j[n]||Tt[n])throw _n(e),we(`root node is forbidden and cannot be sanitized in-place`)}if(xn(e))throw _n(e),we(`root node is clobbered and cannot be sanitized in-place`);try{In(e)}catch(t){throw _n(e),t}}else if(Sn(e))i=vn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===w.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),In(i);else{if(!Ft&&!F&&!jt&&e.indexOf(`<`)===-1)return v&&Lt?T(e):e;if(i=vn(e),!i)return Ft?null:Lt?b:``}i&&Pt&&U(i.firstChild);let l=c?e:i;try{let e=yn(l);for(;o=e.nextNode();)On(o,l),Pn(o),Z(o.content)&&Fn(o.content)}catch(n){throw c&&(_n(e),ce(t.removed,e=>{e.element&&q(e.element)})),n}if(c)return ce(t.removed,e=>{e.element&&q(e.element)}),F&&bn(e),e;if(Ft){if(F&&bn(i),It)for(s=ft.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(M.shadowroot||M.shadowrootmode)&&(s=pt.call(r,s,!0)),s}let u=jt?i.outerHTML:i.innerHTML;return jt&&j[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&y(Je,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
22
22
  `+u),F&&(u=X(u)),v&&Lt?T(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dn(e),L=!0,Mt=j,Nt=M},t.clearConfig=function(){ln=null,L=!1,Mt=null,Nt=null,v=Te,b=``},t.isValidAttribute=function(e,t,n){ln||dn({});let r=B(e),i=B(t);return kn(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&_(A,e)&&de(A[e],t)},t.removeHook=function(e,t){if(_(A,e)){if(t!==void 0){let n=le(A[e],t);return n===-1?void 0:fe(A[e],n,1)[0]}return ue(A[e])}},t.removeHooks=function(e){_(A,e)&&(A[e]=[])},t.removeAllHooks=function(){A=at()},t}var lt=ct();function T(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ut=T();function dt(e){ut=e}var E={exec:()=>null};function D(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function O(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(k.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var ft=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),k={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:D(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:D(e=>RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:D(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:D(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:D(e=>RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,`i`)),blockquoteBeginRegex:D(e=>RegExp(`^ {0,${e}}>`))},pt=/^(?:[ \t]*(?:\n|$))+/,A=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,mt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ht=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,gt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,_t=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,vt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,yt=O(vt).replace(/bull/g,_t).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(),bt=O(vt).replace(/bull/g,_t).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(),xt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,St=/^[^\n]+/,j=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ct=O(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,j).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),M=O(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,_t).getRegex(),wt=`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`,N=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Tt=O(`^ {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`,N).replace(`tag`,wt).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Et=O(xt).replace(`hr`,ht).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`,wt).getRegex(),P={blockquote:O(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Et).getRegex(),code:A,def:Ct,fences:mt,heading:gt,hr:ht,html:Tt,lheading:yt,list:M,newline:pt,paragraph:Et,table:E,text:St},Dt=O(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,ht).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`,wt).getRegex(),Ot={...P,lheading:bt,table:Dt,paragraph:O(xt).replace(`hr`,ht).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Dt).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`,wt).getRegex()},kt={...P,html:O(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,N).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(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:E,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:O(xt).replace(`hr`,ht).replace(`heading`,` *#{1,6} *[^
23
23
  ]`).replace(`lheading`,yt).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},At=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,F=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,I=/^( {2,}|\\)\n(?!\s*$)/,jt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,L=/[\p{P}\p{S}]/u,Mt=/[\s\p{P}\p{S}]/u,Nt=/[^\s\p{P}\p{S}]/u,Pt=O(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,Mt).getRegex(),Ft=/(?!~)[\p{P}\p{S}]/u,It=/(?!~)[\s\p{P}\p{S}]/u,Lt=/(?:[^\s\p{P}\p{S}]|~)/u,Rt=O(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,ft?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),zt=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Bt=O(zt,`u`).replace(/punct/g,L).getRegex(),Vt=O(zt,`u`).replace(/punct/g,Ft).getRegex(),Ht=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Ut=O(Ht,`gu`).replace(/notPunctSpace/g,Nt).replace(/punctSpace/g,Mt).replace(/punct/g,L).getRegex(),Wt=O(Ht,`gu`).replace(/notPunctSpace/g,Lt).replace(/punctSpace/g,It).replace(/punct/g,Ft).getRegex(),Gt=O(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,Nt).replace(/punctSpace/g,Mt).replace(/punct/g,L).getRegex(),Kt=O(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,L).getRegex(),qt=O(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Nt).replace(/punctSpace/g,Mt).replace(/punct/g,L).getRegex(),Jt=O(/\\(punct)/,`gu`).replace(/punct/g,L).getRegex(),Yt=O(/^<(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(),Xt=O(N).replace(`(?:-->|$)`,`-->`).getRegex(),Zt=O(`^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`,Xt).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),R=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Qt=O(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,R).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),$t=O(/^!?\[(label)\]\[(ref)\]/).replace(`label`,R).replace(`ref`,j).getRegex(),en=O(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,j).getRegex(),tn=O(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,$t).replace(`nolink`,en).getRegex(),nn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,rn={_backpedal:E,anyPunctuation:Jt,autolink:Yt,blockSkip:Rt,br:I,code:F,del:E,delLDelim:E,delRDelim:E,emStrongLDelim:Bt,emStrongRDelimAst:Ut,emStrongRDelimUnd:Gt,escape:At,link:Qt,nolink:en,punctuation:Pt,reflink:$t,reflinkSearch:tn,tag:Zt,text:jt,url:E},an={...rn,link:O(/^!?\[(label)\]\((.*?)\)/).replace(`label`,R).getRegex(),reflink:O(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,R).getRegex()},on={...rn,emStrongRDelimAst:Wt,emStrongLDelim:Vt,delLDelim:Kt,delRDelim:qt,url:O(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,nn).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:O(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,nn).getRegex()},sn={...on,br:O(I).replace(`{2,}`,`*`).getRegex(),text:O(on.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},z={normal:P,gfm:Ot,pedantic:kt},cn={normal:rn,gfm:on,breaks:sn,pedantic:an},B={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},ln=e=>B[e];function V(e,t){if(t){if(k.escapeTest.test(e))return e.replace(k.escapeReplace,ln)}else if(k.escapeTestNoEncode.test(e))return e.replace(k.escapeReplaceNoEncode,ln);return e}function un(e){try{e=encodeURI(e).replace(k.percentDecode,`%`)}catch{return null}return e}function dn(e,t){let n=e.replace(k.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(k.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(k.slashPipe,`|`);return n}function H(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function fn(e){let t=e.split(`
@@ -110,7 +110,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
110
110
  </div>
111
111
  `:a.nothing}
112
112
  </section>
113
- `}};n.t([(0,o.property)({type:String})],X.prototype,`title`,void 0),n.t([(0,o.property)({type:String})],X.prototype,`subtitle`,void 0),n.t([(0,o.property)({type:Array})],X.prototype,`suggestions`,void 0),n.t([(0,o.property)({type:Boolean,reflect:!0})],X.prototype,`disabled`,void 0),customElements.get(`luzmo-ai-chat-empty-state`)||customElements.define(`luzmo-ai-chat-empty-state`,X);function bn(e,t){return`${e.replace(/\/+$/,``)}/${t.replace(/^\/+|\/+$/g,``)}/aiprompt`}function xn(e){return e.type===`placeholder`?null:{...e,version:e.version||``,title:e.title||e.options?.title,filters:e.filterGroups||[],aichartId:e.aichartId||``}}function Z(e,t,n=[]){return[{type:`text`,text:e},...t.map(e=>({type:`dataset`,id:e})),...n.map(e=>({type:`image`,url:e}))]}function Sn(e){return{stream:e.stream??!0,response_mode:`mixed`,...e.conversationId?{conversation_id:e.conversationId}:{},...e.localeId?{locale_id:e.localeId}:{}}}function Q(e,t,n){return{agent:e,task:t,...Sn(n)}}function Cn(e){let t=Z(e.prompt,e.datasetIds,e.attachmentUrls),n=e.chart?xn(e.chart):null;return n&&t.push({type:`item`,value:n}),{...Q(`item`,e.task??`generate`,e),input:t}}function wn(e){let t=Z(e.prompt,e.datasetIds,e.attachmentUrls);return e.dashboard&&t.push({type:`dashboard`,value:e.dashboard,...e.currentScreenMode?{current_screen_mode:e.currentScreenMode}:{}}),{...Q(`dashboard`,`generate`,e),timezone_id:e.timezoneId??`UTC`,input:t}}function Tn(e){return{...Q(`analyst`,`generate`,e),input:Z(e.prompt,e.datasetIds,e.attachmentUrls)}}function En(e,t){let n=Z(t.prompt,t.datasetIds,t.attachmentUrls),r=t.chart?xn(t.chart):null;return r&&n.push({type:`item`,value:r}),t.dashboard&&n.push({type:`dashboard`,value:t.dashboard,...t.currentScreenMode?{current_screen_mode:t.currentScreenMode}:{}}),{agent_id:e,...Sn(t),input:n}}function Dn(e,t){if(t.agentId)return En(t.agentId,t);switch(e){case`dashboard`:return wn(t);case`analyst`:return Tn(t);default:return Cn(t)}}function On(t,n){let{authKey:r,authToken:i,apiVersion:a=`0.1.0`}=n;return n.attachmentUrls?.length&&e.d(n.attachmentUrls),{key:r,token:i,action:`create`,version:a,properties:Dn(t,n)}}function kn(e,t,n,r=`0.1.0`,i=null){return{key:t,token:n,action:`delete`,version:r,properties:{agent:`item`,restore_to_message_id:e,...i?{conversation_id:i}:{}}}}async function An(e){let t=await fetch(e.url,{method:`POST`,headers:{"Content-Type":`application/json`},mode:`cors`,body:JSON.stringify(e.body),signal:e.signal});if(!t.ok){let e=await t.json().catch(()=>null);throw Error(e?.message||`API request failed with status ${t.status}`)}if(!t.body)throw Error(`Response body is not readable`);return{body:t.body,conversationId:t.headers.get(`x-conversation-id`)}}function jn(e){let t=e.trim();if(!t||t.startsWith(`:`)||t.startsWith(`event:`)||t.startsWith(`id:`))return null;let n=t;return n.startsWith(`data:`)&&(n=n.slice(5).trimStart()),!n||n===`[DONE]`?null:JSON.parse(n)}function Mn(e,t){try{let n=jn(e);n&&t(n)}catch{console.error(`Failed to parse stream line`)}}async function Nn(e,t){let n=e.getReader(),r=new TextDecoder,i=``;try{for(;;){let{done:e,value:a}=await n.read();if(e)break;i+=r.decode(a,{stream:!0});let o=i.split(/\r?\n/);i=o.pop()??``;for(let e of o)Mn(e,t)}i+=r.decode();let e=i.trim();e&&Mn(e,t)}finally{n.releaseLock()}}function Pn(){return{id:`root`,step:`root`,status:`pending`,children:[{id:`client-init`,step:`iqInit`,status:`inProgress`,description:(0,r.msg)(`Thinking`,{desc:`Label shown in the AI chat progress tree while the assistant starts processing a prompt`})}]}}function Fn(e){let t=e.progress;return typeof t!=`object`||!t?!1:`id`in t&&`step`in t&&`status`in t}function In(e){if(!e||typeof e!=`object`)return``;let t=e.assistant_message;if(!t||typeof t!=`object`)return``;if(typeof t.message==`string`)return t.message;if(typeof t.text==`string`)return t.text;if(typeof t.summary==`string`)return t.summary;let n=t.content;return typeof n==`string`?n:n&&typeof n==`object`&&typeof n.text==`string`?n.text:``}function Ln(e){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:``}function Rn(e){return In(e.result)}function zn(e){return!!e.done||e.type===`finish`||e.type===`done`||`question`in e}function Bn(e,t){let n=typeof e.conversation_id==`string`&&e.conversation_id||typeof e.conversationId==`string`&&e.conversationId;n&&t.callbacks.onConversationIdChange(n)}function Vn(e){for(let t of e)if(t&&typeof t==`object`&&t.type===`item`){let e=t.value;if(e&&typeof e==`object`)return e}return null}function Hn(e){let t=e.chart??e.generatedChart;if(t&&typeof t==`object`)return t;let n=e.aiMessageAssets??e.ai_message_assets;if(Array.isArray(n)){let e=Vn(n);if(e)return e}let r=e.result;if(r&&typeof r==`object`){let e=r.assistant_message,t=e?.aiMessageAssets??e?.ai_message_assets;if(Array.isArray(t))return Vn(t)}return null}function Un(e){for(let t of e)if(t&&typeof t==`object`&&t.type===`dashboard`){let e=t.value;if(e&&typeof e==`object`&&Array.isArray(e.views))return e}return null}function Wn(e){for(let t of e)if(t&&typeof t==`object`&&t.type===`dashboard`){let e=t.name;if(e&&typeof e==`object`)return e}}function Gn(...e){return e.find(Array.isArray)}function Kn(e){if(e.views&&Array.isArray(e.views))return e;let t=e.aiMessageAssets??e.ai_message_assets;if(Array.isArray(t))return Un(t);let n=e.result;if(n&&typeof n==`object`){let e=n.assistant_message,t=e?.aiMessageAssets??e?.ai_message_assets;if(Array.isArray(t))return Un(t)}return null}function qn(e){let t=e.aiMessageAssets??e.ai_message_assets,n=e.result?.assistant_message,r=Gn(t,n?.aiMessageAssets??n?.ai_message_assets);return r?Wn(r):void 0}var Jn=new Set([`conversation-id`,`conversation_id`,`keepalive`,`ping`,`finish`,`done`]);function Yn(e,t,n){return{agent:n.agent,conversationId:t.callbacks.getConversationId(),...typeof e.messageId==`string`?{messageId:e.messageId}:{},raw:e}}function Xn(e,t,n,r,i){let a={...Yn(n,e,t),recognized:!0,type:r,data:i};e.callbacks.onStep(a)}function Zn(e,t,n,r,i){let a={...Yn(n,e,t),recognized:!1,type:r,data:i};e.callbacks.onStep(a)}function Qn(e){e.state.progressCollapsed||(e.state.progressCollapsed=!0,e.callbacks.onProgressCollapsed(!0))}function $n(e,t){Qn(e),e.aiMessage.message=(e.aiMessage.message||``)+t,e.callbacks.onMessageUpdate(e.aiMessage)}function er(e){if(!e)return null;let t=e.descriptionMetadata?.decision;if(t===`create`||t===`edit`||t===`question`)return t;for(let t of e.children??[]){let e=er(t);if(e)return e}return null}function tr(e,t,n){if(!Fn(e))return!1;let r=e.progress;if(t.callbacks.onProgress(r),Xn(t,n,e,`progress`,r),t.state.decision===null){let i=er(r);i&&(t.state.decision=i,Xn(t,n,e,`decision`,{decision:i}))}return!0}function nr(e){return!!e.error||e.type===`error`||typeof e.error_text==`string`}function rr(e){return typeof e.error_text==`string`&&e.error_text?e.error_text:typeof e.error==`string`&&e.error?e.error:(0,r.msg)(`Something went wrong. Please try again.`,{desc:`Generic error message shown in ai chat when the API request fails`})}function ir(e,t,n){if(!nr(e))return!1;let r=rr(e);return t.aiMessage.message=r,t.aiMessage.isError=!0,t.callbacks.onMessageUpdate(t.aiMessage),Tr(e,t,n,e.error??r),!0}function ar(e){return typeof e.question==`string`&&e.question?e.question:typeof e.text==`string`&&e.text?e.text:``}function or(e,t,n){if(e.type!==`interrupt`)return!1;let r=ar(e);return r&&(t.state.interruptQuestion=r,$n(t,r),Xn(t,n,e,`interrupt`,{question:r})),Tr(e,t,n),!0}function sr(e){return typeof e.asset_id==`string`?e.asset_id:typeof e.asset_type==`string`?e.asset_type:`default`}function cr(e){return typeof e.asset_type==`string`?e.asset_type:``}function lr(e){return{assetType:cr(e),snapshot:{}}}function ur(e,t){return{...e,...t}}function dr(e){let t=e.asset_delta??e.delta;return t&&typeof t==`object`?t:null}function fr(e,t){t.state.assets[sr(e)]=lr(e)}function pr(e,t){let n=sr(e),r=t.state.assets[n]??lr(e),i=dr(e);i&&(r.snapshot=ur(r.snapshot,i)),t.state.assets[n]=r}function mr(e,t){let n=e.asset??e.value??e.asset_delta??e.delta;return n&&typeof n==`object`?ur(t?.snapshot??{},n):t?.snapshot??{}}function hr(e,t,n){let r=sr(e),i=t.state.assets[r],a=i?.assetType||cr(e),o=mr(e,i);delete t.state.assets[r],vr(a,o,e,t,n)}function gr(e,t,n){switch(e.type){case`asset_start`:return fr(e,t),!0;case`asset_delta`:return pr(e,t),!0;case`asset_end`:return hr(e,t,n),!0;default:return!1}}function _r(e,t,n,r){n.state.chartSnapshot=e,n.aiMessage.hasChart=!0,typeof t.messageId==`string`&&(n.aiMessage.apiMessageId=t.messageId),n.callbacks.onMessageUpdate(n.aiMessage),Xn(n,r,t,`chart`,e)}function vr(e,t,n,r,i){switch(e){case`dashboard-title`:{let e=t.name;e&&typeof e==`object`&&(r.state.dashboardName=e,Xn(r,i,n,`dashboard-title`,{name:e}));return}case`dashboard-layout`:Xn(r,i,n,`dashboard-layout`,t);return;case`dashboard-item`:Xn(r,i,n,`dashboard-item`,{slot:Number(t.slot),chart:t.chart??t});return;case`dashboard`:r.state.dashboardSnapshot=t;return;default:yr(e,t,n,r,i)}}function yr(e,t,n,r,i){if(i.chartAssetType&&e===i.chartAssetType){_r(t,n,r,i);return}if(i.dashboardAssetType&&e===i.dashboardAssetType){r.state.dashboardSnapshot=t;return}Zn(r,i,n,e||`asset`,t)}function br(e,t,n){let r=!1;if(n.dashboardAssetType){let n=Kn(e);if(n){t.state.dashboardSnapshot=n;let i=qn(e);i&&(t.state.dashboardName=i),r=!0}}if(n.chartAssetType&&!t.state.chartSnapshot){let i=Hn(e);i&&(_r(i,e,t,n),r=!0)}return r}function xr(e,t,n){return{...e,generatedChart:t,conversationId:n.callbacks.getConversationId()}}function Sr(e,t,n){for(let r of Object.keys(t.state.assets)){let i=t.state.assets[r];delete t.state.assets[r],!(n.chartAssetType&&i.assetType===n.chartAssetType&&t.state.chartSnapshot||n.dashboardAssetType&&i.assetType===n.dashboardAssetType&&t.state.dashboardSnapshot)&&vr(i.assetType,i.snapshot,e,t,n)}}function Cr(e,t){let n=Rn(e);!n||t.aiMessage.message===n||(t.aiMessage.message=n,t.callbacks.onMessageUpdate(t.aiMessage))}function wr(e,t,n){let r=t.state.dashboardSnapshot??(n.dashboardAssetType?Kn(e):null),i=t.state.chartSnapshot??(n.chartAssetType?Hn(e):null);return{agent:n.agent,conversationId:t.callbacks.getConversationId(),message:t.aiMessage,...r?{dashboard:r}:{},...i?{chart:xr(e,i,t)}:{},...t.state.dashboardName?{name:t.state.dashboardName}:{},raw:e}}function Tr(e,t,n,r){if(!t.state.completed){if(t.state.completed=!0,Sr(e,t,n),Qn(t),r!==void 0){t.callbacks.onComplete({agent:n.agent,conversationId:t.callbacks.getConversationId(),message:t.aiMessage,error:r,raw:e});return}Cr(e,t),t.callbacks.onComplete(wr(e,t,n))}}function Er(e){return typeof e.type==`string`&&e.type?e.type:typeof e.asset_type==`string`&&e.asset_type?e.asset_type:``}function Dr(e,t,n){let r=Ln(e);return r?(t.state.accumulatedText+=r,$n(t,r),Xn(t,n,e,`text`,{delta:r,text:t.state.accumulatedText}),!0):!1}function Or(e,t,n,r,i){if(r||i)return;let a=Er(e);a&&!Jn.has(a)&&Zn(t,n,e,a,e)}function kr(e,t,n){if(Bn(e,t),tr(e,t,n)||ir(e,t,n)||or(e,t,n)||gr(e,t,n))return;let r=Dr(e,t,n),i=br(e,t,n),a=r||i,o=zn(e);Or(e,t,n,a,o),o&&Tr(e,t,n)}function Ar(e){switch(e){case`dashboard`:return{agent:e,dashboardAssetType:`dashboard`};case`item`:return{agent:e,chartAssetType:`item`};default:return{agent:e}}}function jr(e){let t=Ar(e);return(e,n)=>kr(e,n,t)}function Mr(){return{progressCollapsed:!1,accumulatedText:``,decision:null,assets:{},dashboardSnapshot:null,dashboardName:void 0,chartSnapshot:null,interruptQuestion:null,completed:!1}}function Nr(){return`msg-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}var Pr=class{constructor(e,t={}){this._uiBridgeCallbacks={},this._subscribers=new Set,this._state={messages:[],selectedDatasets:[],isGenerating:!1,progress:null,progressCollapsed:!1,conversationId:null,inflightMessage:null},this._abortController=null,this._inflightMessage=null,this._receivedProgress=!1,this._config={apiUrl:`https://api.luzmo.com`,apiVersion:`0.1.0`,stream:!0,...e},this._hostCallbacks=t,this._state={...this._state,messages:e.messages?[...e.messages]:[],selectedDatasets:e.selectedDatasets?[...e.selectedDatasets]:[],conversationId:e.conversationId??null,isGenerating:e.isGenerating??!1,progress:e.progress??null,progressCollapsed:e.progressCollapsed??!1}}get state(){return this._state}get isGenerating(){return this._state.isGenerating}subscribe(e){return this._subscribers.add(e),e(this._state),()=>{this._subscribers.delete(e)}}setUiBridge(e){this._uiBridgeCallbacks=e}updateConfig(e){this._config={...this._config,...e};let t={};if(`conversationId`in e){let n=e.conversationId??null;n!==this._state.conversationId&&(t.conversationId=n)}if(`selectedDatasets`in e&&e.selectedDatasets){let n=[...e.selectedDatasets];this._areSelectedDatasetsEqual(n,this._state.selectedDatasets)||(t.selectedDatasets=n)}if(`messages`in e&&e.messages){let n=[...e.messages];this._areChatMessagesEqual(n,this._state.messages)||(t.messages=n)}`isGenerating`in e&&e.isGenerating!==this._state.isGenerating&&(t.isGenerating=e.isGenerating),`progress`in e&&(t.progress=e.progress??null),`progressCollapsed`in e&&e.progressCollapsed!==this._state.progressCollapsed&&(t.progressCollapsed=e.progressCollapsed),Object.keys(t).length>0&&this._patchState(t)}setSelectedDatasets(e){this._patchState({selectedDatasets:[...e]}),this._emit(`onDatasetsChanged`,this._state.selectedDatasets)}addDataset(e){this._state.selectedDatasets.some(t=>t.id===e.id)||(this._patchState({selectedDatasets:[...this._state.selectedDatasets,e]}),this._emit(`onDatasetsChanged`,this._state.selectedDatasets))}removeDataset(e){let t=this._state.selectedDatasets.filter(t=>t.id!==e);t.length!==this._state.selectedDatasets.length&&(this._patchState({selectedDatasets:t}),this._emit(`onDatasetsChanged`,this._state.selectedDatasets))}isDatasetRequirementMet(){return!this._config.requireDataset||this._state.selectedDatasets.length>0}getAiPromptUrl(){return bn(this._config.apiUrl??`https://api.luzmo.com`,this._config.apiVersion??`0.1.0`)}buildRequestBody(e,t,n=[]){return On(this._config.agent,{prompt:e,datasetIds:t,authKey:this._config.authKey,authToken:this._config.authToken,conversationId:this._state.conversationId,agentId:this._config.agentId,chart:this._config.chart??null,dashboard:this._config.dashboard??null,currentScreenMode:this._config.currentScreenMode,localeId:this._config.localeId,timezoneId:this._config.timezoneId,task:this._config.task,modelPreference:this._config.modelPreference,apiVersion:this._config.apiVersion,stream:this._config.stream,attachmentUrls:n})}buildPromptSubmittedDetail(e){let t=e.attachmentUrls??[];return{prompt:e.prompt,selectedDatasets:e.selectedDatasets,datasetIds:e.datasetIds,agent:this._config.agent,request:this.buildRequestBody(e.prompt,e.datasetIds,t),url:this.getAiPromptUrl(),...e.signal?{signal:e.signal}:{},...e.attachments?.length?{attachments:e.attachments}:{},...t.length?{attachmentUrls:t}:{}}}async _resolveAttachmentUrls(t,n){if(t.attachmentUrls?.length)return e.d(t.attachmentUrls),[...t.attachmentUrls];let r=(t.attachments??[]).map(e=>e.file).filter(e=>!!e);if(r.length===0)return[];e.u(r);let i=this._hostCallbacks.uploadAttachments??this._uiBridgeCallbacks.uploadAttachments;if(typeof i==`function`)return this._normalizeUploadedUrls(await i(r,{signal:n}),r.length);let{authKey:a,authToken:o,apiUrl:s=`https://api.luzmo.com`,apiVersion:c=`0.1.0`}=this._config;if(!a||!o){if(this._hasCallback(`onPromptSubmitted`))return[];throw Error(`Image attachments require authKey/authToken for built-in upload, or provide uploadAttachments / attachmentUrls.`)}return this._normalizeUploadedUrls(await e.s({files:r,authKey:a,authToken:o,apiUrl:s,apiVersion:c,signal:n}),r.length)}_normalizeUploadedUrls(t,n){let r=Array.isArray(t)?t.filter(e=>typeof e==`string`&&e.trim().length>0):[];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.`);return e.d(r),r}async submit(e){let t=e.datasetIds??this._state.selectedDatasets.map(e=>e.id);if(!this.isDatasetRequirementMet())return;this._abortInflight();let n=new AbortController;this._abortController=n;let r;try{r=await this._resolveAttachmentUrls(e,n.signal)}catch(e){if(this._abortController===n&&(this._abortController=null),n.signal.aborted||e.name===`AbortError`)return;throw e}if(n.signal.aborted||this._abortController!==n)return;let i={id:e.aiMessageId??Nr(),type:`ai`,message:``},a=[...this._state.messages];if(!e.skipUserMessage){let t={id:Nr(),type:`user`,message:e.prompt,...r.length?{attachmentUrls:r}:{}};a=[...a,t],this._emit(`onMessageSent`,t,[...this._state.selectedDatasets])}a=[...a,i],this._inflightMessage=i,this._receivedProgress=!1,this._patchState({messages:a,isGenerating:!0,progress:Pn(),progressCollapsed:!1,inflightMessage:i});let o=t,s=[...this._state.selectedDatasets];if(this._hasCallback(`onPromptSubmitted`)){let t=this.buildPromptSubmittedDetail({prompt:e.prompt,selectedDatasets:s,datasetIds:o,signal:n.signal,attachments:e.attachments,attachmentUrls:r});try{await this._invokeCallback(`onPromptSubmitted`,t)}catch(e){e.name===`AbortError`?this.abort():(this._handleSubmitError(e,i),this._finalizeInflightMessage()),this._patchState({isGenerating:!1})}return}let c=this.buildRequestBody(e.prompt,t,r),l=jr(this._config.agent),u={aiMessage:i,callbacks:this._createStreamCallbacks(),state:Mr()},d=this._config.fetchStreaming??An,f=!1;try{let{body:e,conversationId:t}=await d({url:this.getAiPromptUrl(),body:c,signal:n.signal});t&&this._setConversationId(t),await Nn(e,e=>l(e,u)),f=!0}catch(e){e.name!==`AbortError`&&(this._handleSubmitError(e,i),f=!0)}finally{this._abortController===n&&(f?this._finalizeInflightMessage():this._discardInflightMessage(),this._patchState({isGenerating:!1}),this._abortController=null)}}async restore(e){if(this._config.agent!==`item`)return{};let t=kn(e.restoreToMessageId,this._config.authKey,this._config.authToken,this._config.apiVersion,this._state.conversationId);if(this._patchState({isGenerating:!0,progress:null,progressCollapsed:!1}),this._hasCallback(`onRestoreRequested`)){let n={apiMessageId:e.restoreToMessageId,messageIndex:e.messageIndex,request:t,url:this.getAiPromptUrl()};try{await this._invokeCallback(`onRestoreRequested`,n)}finally{this._patchState({isGenerating:!1})}return{}}try{let n=await fetch(this.getAiPromptUrl(),{method:`POST`,headers:{"Content-Type":`application/json`},mode:`cors`,body:JSON.stringify(t)});if(!n.ok){let e=await n.json().catch(()=>null);throw Error(e?.message||`API request failed with status ${n.status}`)}let r=await n.json().catch(()=>null),i=r?.generatedChart??(r?Hn(r):null),a={...typeof r?.message==`string`?{message:r.message}:{},...i?{chart:{...r,generatedChart:i}}:{}},o=e.messageIndex>=0&&e.messageIndex<this._state.messages.length?this._state.messages.slice(0,e.messageIndex+1):this._state.messages;if(a.message&&o[e.messageIndex]?.type===`ai`&&(o[e.messageIndex]={...o[e.messageIndex],message:a.message}),this._patchState({messages:[...o]}),a.chart||a.message){let t=o[e.messageIndex],n=t?.type===`ai`?t:{id:Nr(),type:`ai`,message:a.message??``};this._emit(`onComplete`,{agent:this._config.agent,conversationId:this._state.conversationId,message:n,...a.chart?{chart:a.chart}:{},...r?{raw:r}:{}})}return a}finally{this._patchState({isGenerating:!1})}}buildRestoreRequest(e){return kn(e,this._config.authKey,this._config.authToken,this._config.apiVersion,this._state.conversationId)}abort(e={}){this._abortController?.abort(),this._abortController=null,e.notify&&this._inflightMessage?this._markInflightCancelled(e.cancelledMessage):this._discardInflightMessage(),this._patchState({isGenerating:!1,progress:null,progressCollapsed:!1}),e.notify&&this._emit(`onPromptStopped`)}_abortInflight(){this._abortController?.abort(),this._abortController=null,this._discardInflightMessage()}_createStreamCallbacks(){return{onConversationIdChange:e=>this._setConversationId(e),onProgress:e=>{this._receivedProgress=!0,this._patchState({progress:e})},onProgressCollapsed:e=>{this._patchState({progressCollapsed:e})},onMessageUpdate:e=>{this._inflightMessage=e,this._upsertMessage(e),this._patchState({inflightMessage:{...e}})},getConversationId:()=>this._state.conversationId,onStep:e=>{this._emit(`onStep`,e)},onComplete:e=>{this._emit(`onComplete`,e)}}}_setConversationId(e){this._config={...this._config,conversationId:e},this._patchState({conversationId:e}),this._emit(`onConversationIdChange`,e)}_upsertMessage(e){let t=this._state.messages.findIndex(t=>t.id===e.id);if(t===-1){this._patchState({messages:[...this._state.messages,{...e}]});return}let n=this._state.messages.map((n,r)=>r===t?{...e}:n);this._patchState({messages:n})}_finalizeInflightMessage(){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({progress:null,progressCollapsed:!1,inflightMessage:null}))}_removeInflightFromMessages(){this._inflightMessage&&this._patchState({messages:this._state.messages.filter(e=>e.id!==this._inflightMessage.id)})}_markInflightCancelled(e){this._inflightMessage&&(this._inflightMessage.message=e??(0,r.msg)(`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,this._upsertMessage(this._inflightMessage),this._inflightMessage=null,this._receivedProgress=!1,this._patchState({inflightMessage:null}))}_discardInflightMessage(){let e=!!(this._inflightMessage||this._state.inflightMessage);this._removeInflightFromMessages(),this._inflightMessage=null,this._receivedProgress=!1,e&&this._patchState({inflightMessage:null})}_handleSubmitError(e,t){t.message=(0,r.msg)(`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,this._inflightMessage=t,this._upsertMessage(t),this._patchState({inflightMessage:{...t},progress:null,progressCollapsed:!1}),this._emit(`onComplete`,{agent:this._config.agent,conversationId:this._state.conversationId,message:t,error:e})}_hasCallback(e){return typeof this._hostCallbacks[e]==`function`||typeof this._uiBridgeCallbacks[e]==`function`}_emit(e,...t){this._invokeCallback(e,...t)}async _invokeCallback(e,...t){let n=this._hostCallbacks[e],r=this._uiBridgeCallbacks[e];typeof n==`function`&&await n(...t),typeof r==`function`&&await r(...t)}_patchState(e){this._state={...this._state,...e},this._emit(`onStateChange`,this._state);for(let e of this._subscribers)e(this._state)}_areSelectedDatasetsEqual(e,t){return e.length===t.length&&e.every((e,n)=>e.id===t[n]?.id)}_areChatMessagesEqual(e,t){return e.length===t.length&&e.every((e,n)=>{let r=t[n];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)})}};function Fr(e,t){return new Pr(e,t)}var Ir=class{constructor(e){this.options=e,this._session=null,this._ownsSession=!1,this._seededFromProps=!1,this._unsubscribe=null}get current(){return this._session}get state(){if(this._session)return this._session.state;let e=this.options.getSeed();return{messages:e.messages,selectedDatasets:e.selectedDatasets,isGenerating:!1,progress:null,progressCollapsed:!1,conversationId:e.conversationId,inflightMessage:null}}get ownsCurrentSession(){return this._ownsSession}setSession(e){if(!e){this._clearSession();return}this._ownsSession&&this._session!==e&&this._session?.abort(),this._ownsSession=!1,this._session=e,this._mergeHostElementConfig(e),this._wire(e)}syncProperties(e){if(!e.has(`chatSession`)){if(this._createSessionIfMissing(),this._session){let t=this.options.getConfig();if(Object.keys(t).some(t=>e.has(t))&&(this._ownsSession?this._session.updateConfig(t):this._mergeHostElementConfig(this._session)),e.has(`selectedDatasets`)&&this._ownsSession){let e=this.options.getSeed().selectedDatasets,t=this._session.state.selectedDatasets;(e.length!==t.length||e.some((e,n)=>e.id!==t[n]?.id))&&this._session.updateConfig({selectedDatasets:e})}}(e.has(`messages`)||e.has(`selectedDatasets`))&&this._seedFromPropsOnce()}}requireSession(){return this._createSessionIfMissing(),this._ownsSession?this._session.updateConfig(this.options.getConfig()):this._session&&this._mergeHostElementConfig(this._session),this._session}_mergeHostElementConfig(e){let t=this.options.getConfig(),n={authKey:t.authKey,authToken:t.authToken,apiUrl:t.apiUrl,apiVersion:t.apiVersion,stream:t.stream,localeId:t.localeId,timezoneId:t.timezoneId,modelPreference:t.modelPreference,requireDataset:t.requireDataset,agent:t.agent};t.task!==void 0&&(n.task=t.task),t.chart!=null&&(n.chart=t.chart),t.dashboard!=null&&(n.dashboard=t.dashboard),t.currentScreenMode!=null&&(n.currentScreenMode=t.currentScreenMode),t.conversationId!=null&&(n.conversationId=t.conversationId),e.updateConfig(n)}connect(){this._session&&this._wire(this._session)}teardown(){this._unwire(),this._ownsSession&&=(this._session?.abort(),this._session=null,!1),this._seededFromProps=!1}_createSessionIfMissing(){if(this._session)return;let e=this.options.getSeed();this._session=Fr({...this.options.getConfig(),messages:e.messages.length>0?[...e.messages]:void 0,selectedDatasets:e.selectedDatasets.length>0?[...e.selectedDatasets]:void 0}),this._ownsSession=!0,this._seededFromProps=e.messages.length>0||e.selectedDatasets.length>0,this._wire(this._session)}_clearSession(){this._unwire(),this._ownsSession&&this._session?.abort(),this._session=null,this._ownsSession=!1}_seedFromPropsOnce(){if(!this._ownsSession||this._seededFromProps)return;let e=this.requireSession(),t=this.options.getSeed(),n={};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)}_wire(e){this._unwire(),e.setUiBridge(this.options.createDomBridge()),this._unsubscribe=e.subscribe(()=>{this.options.onRenderNeeded()})}_unwire(){this._unsubscribe?.(),this._unsubscribe=null}},$=class n extends t.i{constructor(...e){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.flagOpendata=!1,this.hideDatasetButton=!1,this.hideDatasetIcons=!1,this.disableDatasetModification=!1,this.hideSelectedDatasets=!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.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 Ir({getConfig:()=>this._buildSessionConfig(),getSeed:()=>({messages:this.messages,selectedDatasets:Array.isArray(this.selectedDatasets)?this.selectedDatasets:[],conversationId:this.conversationId}),createDomBridge:()=>this._createDomBridgeCallbacks(),onRenderNeeded:()=>{this.requestUpdate(),this.updateComplete.then(()=>this._scrollToBottom())}}),this._handleAssistantMessageActionsSlotChange=e=>{let t=e.target.assignedElements({flatten:!0}).length>0;this._setAssistantMessageActionsSlotHasContent(t)},this._handleAssistantMessageActionConfirmKeydown=e=>{e.key!==`Escape`||!this._pendingAssistantMessageAction||(e.preventDefault(),e.stopPropagation(),this._cancelAssistantMessageActionConfirm())}}static{this.styles=(0,a.unsafeCSS)(vn)}static{this.tagName=`luzmo-ai-chat`}static{this.assistantMessageActionsSlot=`assistant-message-actions`}get session(){return this._session.current}_getRenderState(){return this._session.state}_createDomBridgeCallbacks(){return{onMessageSent:(e,t)=>{this.dispatchEvent(new CustomEvent(`luzmo-message-sent`,{detail:{message:e,selectedDatasets:t},bubbles:!0,composed:!0}))},onDatasetsChanged:e=>{this.dispatchEvent(new CustomEvent(`luzmo-datasets-changed`,{detail:{selectedDatasets:e},bubbles:!0,composed:!0}))},onConversationIdChange:e=>this._emitConversationIdChanged(e),onStep:e=>{this.dispatchEvent(new CustomEvent(`luzmo-step`,{detail:e,bubbles:!0,composed:!0}))},onComplete:e=>{this.dispatchEvent(new CustomEvent(`luzmo-complete`,{detail:e,bubbles:!0,composed:!0}))},onPromptStopped:()=>{this.dispatchEvent(new CustomEvent(`luzmo-stop`,{bubbles:!0,composed:!0}))},...typeof this.uploadAttachments==`function`?{uploadAttachments:(e,t)=>this.uploadAttachments(e,t)}:{}}}get _resolvedAcceptedFileTypes(){return this.acceptedFileTypes.length>0?this.acceptedFileTypes:this.allowImages?[...e.c]:[]}_buildSessionConfig(){return{agent:this.agent,agentId:this.agentId,authKey:this.authKey,authToken:this.authToken,apiUrl:this.apiUrl,apiVersion:this.apiVersion,stream:this.stream,conversationId:this.conversationId,chart:this.chart,dashboard:this.dashboard,currentScreenMode:this.currentScreenMode,localeId:this.localeId,timezoneId:this.timezoneId,task:this.task,modelPreference:this.modelPreference,requireDataset:this.requireDataset}}_emitConversationIdChanged(e){this.conversationId=e,this.dispatchEvent(new CustomEvent(`luzmo-conversation-id-changed`,{detail:{conversationId:e},bubbles:!0,composed:!0}))}async _restoreViaSession(e,t){await this._session.requireSession().restore({restoreToMessageId:e,messageIndex:t})}async _handleRestoreState(e,t){if(e.apiMessageId&&this.agent===`item`)try{await this._restoreViaSession(e.apiMessageId,t)}catch(e){console.error(`AI restore error:`,e)}}_handleDatasetSelected(e){this._session.requireSession().addDataset(e.detail)}_handleDatasetRemoved(e){this._session.requireSession().removeDataset(e.detail.id)}async _submitViaSession(e,t={}){let n=this._session.requireSession();if(!n.isDatasetRequirementMet())return!1;this._textareaValue=``;try{return await n.submit({prompt:e,...t}),!0}catch(e){return e.name!==`AbortError`&&console.error(`AI prompt session error:`,e),!1}}async _handlePromptSubmitted(e){let t=e.detail.prompt;await this._submitViaSession(t,{...e.detail.attachments?.length?{attachments:e.detail.attachments}:{},...e.detail.attachmentUrls?.length?{attachmentUrls:e.detail.attachmentUrls}:{}})||(this._textareaValue=t)}_handlePromptStopped(){let e=this._session.current;if(this._textareaValue=``,e){e.abort({notify:!0,cancelledMessage:this.cancelledMessage??void 0});return}this.dispatchEvent(new CustomEvent(`luzmo-stop`,{bubbles:!0,composed:!0}))}async _handleEmptyStateSuggestionSelected(e){let{prompt:t,selectedDatasets:n}=e.detail,r=this._session.requireSession();n?.length&&r.setSelectedDatasets(n),await this._submitViaSession(t)}async _processInitialPrompt(){!this.initialPrompt||this.initialPrompt===this._lastProcessedInitialPrompt||this._session.requireSession().isDatasetRequirementMet()&&(this._lastProcessedInitialPrompt=this.initialPrompt,await this._submitViaSession(this.initialPrompt,{skipUserMessage:!0}))}connectedCallback(){super.connectedCallback(),this._session.connect()}disconnectedCallback(){super.disconnectedCallback(),this._session.teardown()}_scrollToBottom(){let e=this.shadowRoot?.querySelector(`.chat-messages-container`);e&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.scrollTop=e.scrollHeight})})}willUpdate(e){super.willUpdate?.(e),this._syncPendingAssistantMessageAction()}updated(e){super.updated?.(e),this._syncSession(e),this._handleInitialPromptChange(),e.has(`uploadAttachments`)&&this._session.current?.setUiBridge(this._createDomBridgeCallbacks()),this.updateComplete.then(()=>{this._syncAssistantMessageActionsVisibility(),this._focusPendingAssistantMessageActionConfirm()})}_syncSession(e){if(e.has(`chatSession`)){this._session.setSession(this.chatSession);return}this._session.syncProperties(e)}_handleInitialPromptChange(){this.initialPrompt&&this.initialPrompt!==this._lastProcessedInitialPrompt?this._processInitialPrompt():this.initialPrompt||(this._lastProcessedInitialPrompt=null)}_renderMarkdown(e){let t=String(Y.parse(e,{async:!1}));return lt.sanitize(t,{ALLOWED_TAGS:`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(`.`),ALLOWED_ATTR:[`href`,`title`,`target`,`rel`],ALLOW_DATA_ATTR:!1,FORBID_TAGS:[`script`,`style`,`iframe`,`object`,`embed`,`link`,`form`,`input`,`button`],FORBID_ATTR:[`onerror`,`onload`,`onclick`,`onmouseover`,`onfocus`,`onblur`]})}_renderProgress(){let{progress:e,progressCollapsed:t}=this._getRenderState();return e?.children?.length?a.html`
113
+ `}};n.t([(0,o.property)({type:String})],X.prototype,`title`,void 0),n.t([(0,o.property)({type:String})],X.prototype,`subtitle`,void 0),n.t([(0,o.property)({type:Array})],X.prototype,`suggestions`,void 0),n.t([(0,o.property)({type:Boolean,reflect:!0})],X.prototype,`disabled`,void 0),customElements.get(`luzmo-ai-chat-empty-state`)||customElements.define(`luzmo-ai-chat-empty-state`,X);function bn(e,t){return`${e.replace(/\/+$/,``)}/${t.replace(/^\/+|\/+$/g,``)}/aiprompt`}function xn(e){return e.type===`placeholder`?null:{...e,version:e.version||``,title:e.title||e.options?.title,filters:e.filterGroups||[],aichartId:e.aichartId||``}}function Z(e,t,n=[]){return[{type:`text`,text:e},...t.map(e=>({type:`dataset`,id:e})),...n.map(e=>({type:`image`,url:e}))]}function Sn(e){return{stream:e.stream??!0,response_mode:`mixed`,...e.conversationId?{conversation_id:e.conversationId}:{},...e.localeId?{locale_id:e.localeId}:{}}}function Q(e,t,n){return{agent:e,task:t,...Sn(n)}}function Cn(e){let t=Z(e.prompt,e.datasetIds,e.attachmentUrls),n=e.chart?xn(e.chart):null;return n&&t.push({type:`item`,value:n}),{...Q(`item`,e.task??`generate`,e),input:t}}function wn(e){let t=Z(e.prompt,e.datasetIds,e.attachmentUrls);return e.dashboard&&t.push({type:`dashboard`,value:e.dashboard,...e.currentScreenMode?{current_screen_mode:e.currentScreenMode}:{}}),{...Q(`dashboard`,`generate`,e),timezone_id:e.timezoneId??`UTC`,input:t}}function Tn(e){return{...Q(`analyst`,`generate`,e),input:Z(e.prompt,e.datasetIds,e.attachmentUrls)}}function En(e,t){let n=Z(t.prompt,t.datasetIds,t.attachmentUrls),r=t.chart?xn(t.chart):null;return r&&n.push({type:`item`,value:r}),t.dashboard&&n.push({type:`dashboard`,value:t.dashboard,...t.currentScreenMode?{current_screen_mode:t.currentScreenMode}:{}}),{agent_id:e,...Sn(t),input:n}}function Dn(e,t){if(t.agentId)return En(t.agentId,t);switch(e){case`dashboard`:return wn(t);case`analyst`:return Tn(t);default:return Cn(t)}}function On(t,n){let{authKey:r,authToken:i,apiVersion:a=`0.1.0`}=n;return n.attachmentUrls?.length&&e.d(n.attachmentUrls),{key:r,token:i,action:`create`,version:a,properties:Dn(t,n)}}function kn(e,t,n,r=`0.1.0`,i=null){return{key:t,token:n,action:`delete`,version:r,properties:{agent:`item`,restore_to_message_id:e,...i?{conversation_id:i}:{}}}}async function An(e){let t=await fetch(e.url,{method:`POST`,headers:{"Content-Type":`application/json`},mode:`cors`,body:JSON.stringify(e.body),signal:e.signal});if(!t.ok){let e=await t.json().catch(()=>null);throw Error(e?.message||`API request failed with status ${t.status}`)}if(!t.body)throw Error(`Response body is not readable`);return{body:t.body,conversationId:t.headers.get(`x-conversation-id`)}}function jn(e){let t=e.trim();if(!t||t.startsWith(`:`)||t.startsWith(`event:`)||t.startsWith(`id:`))return null;let n=t;return n.startsWith(`data:`)&&(n=n.slice(5).trimStart()),!n||n===`[DONE]`?null:JSON.parse(n)}function Mn(e,t){try{let n=jn(e);n&&t(n)}catch{console.error(`Failed to parse stream line`)}}async function Nn(e,t){let n=e.getReader(),r=new TextDecoder,i=``;try{for(;;){let{done:e,value:a}=await n.read();if(e)break;i+=r.decode(a,{stream:!0});let o=i.split(/\r?\n/);i=o.pop()??``;for(let e of o)Mn(e,t)}i+=r.decode();let e=i.trim();e&&Mn(e,t)}finally{n.releaseLock()}}function Pn(){return{id:`root`,step:`root`,status:`pending`,children:[{id:`client-init`,step:`iqInit`,status:`inProgress`,description:(0,r.msg)(`Thinking`,{desc:`Label shown in the AI chat progress tree while the assistant starts processing a prompt`})}]}}function Fn(e){let t=e.progress;return typeof t!=`object`||!t?!1:`id`in t&&`step`in t&&`status`in t}function In(e){if(!e||typeof e!=`object`)return``;let t=e.assistant_message;if(!t||typeof t!=`object`)return``;if(typeof t.message==`string`)return t.message;if(typeof t.text==`string`)return t.text;if(typeof t.summary==`string`)return t.summary;let n=t.content;return typeof n==`string`?n:n&&typeof n==`object`&&typeof n.text==`string`?n.text:``}function Ln(e){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:``}function Rn(e){return In(e.result)}function zn(e){return!!e.done||e.type===`finish`||e.type===`done`||`question`in e}function Bn(e,t){let n=typeof e.conversation_id==`string`&&e.conversation_id||typeof e.conversationId==`string`&&e.conversationId;n&&t.callbacks.onConversationIdChange(n)}function Vn(e){for(let t of e)if(t&&typeof t==`object`&&t.type===`item`){let e=t.value;if(e&&typeof e==`object`)return e}return null}function Hn(e){let t=e.chart??e.generatedChart;if(t&&typeof t==`object`)return t;let n=e.aiMessageAssets??e.ai_message_assets;if(Array.isArray(n)){let e=Vn(n);if(e)return e}let r=e.result;if(r&&typeof r==`object`){let e=r.assistant_message,t=e?.aiMessageAssets??e?.ai_message_assets;if(Array.isArray(t))return Vn(t)}return null}function Un(e){for(let t of e)if(t&&typeof t==`object`&&t.type===`dashboard`){let e=t.value;if(e&&typeof e==`object`&&Array.isArray(e.views))return e}return null}function Wn(e){for(let t of e)if(t&&typeof t==`object`&&t.type===`dashboard`){let e=t.name;if(e&&typeof e==`object`)return e}}function Gn(...e){return e.find(Array.isArray)}function Kn(e){if(e.views&&Array.isArray(e.views))return e;let t=e.aiMessageAssets??e.ai_message_assets;if(Array.isArray(t))return Un(t);let n=e.result;if(n&&typeof n==`object`){let e=n.assistant_message,t=e?.aiMessageAssets??e?.ai_message_assets;if(Array.isArray(t))return Un(t)}return null}function qn(e){let t=e.aiMessageAssets??e.ai_message_assets,n=e.result?.assistant_message,r=Gn(t,n?.aiMessageAssets??n?.ai_message_assets);return r?Wn(r):void 0}var Jn=new Set([`conversation-id`,`conversation_id`,`keepalive`,`ping`,`finish`,`done`]);function Yn(e,t,n){return{agent:n.agent,conversationId:t.callbacks.getConversationId(),...typeof e.messageId==`string`?{messageId:e.messageId}:{},raw:e}}function Xn(e,t,n,r,i){let a={...Yn(n,e,t),recognized:!0,type:r,data:i};e.callbacks.onStep(a)}function Zn(e,t,n,r,i){let a={...Yn(n,e,t),recognized:!1,type:r,data:i};e.callbacks.onStep(a)}function Qn(e){e.state.progressCollapsed||(e.state.progressCollapsed=!0,e.callbacks.onProgressCollapsed(!0))}function $n(e,t){Qn(e),e.aiMessage.message=(e.aiMessage.message||``)+t,e.callbacks.onMessageUpdate(e.aiMessage)}function er(e){if(!e)return null;let t=e.descriptionMetadata?.decision;if(t===`create`||t===`edit`||t===`question`)return t;for(let t of e.children??[]){let e=er(t);if(e)return e}return null}function tr(e,t,n){if(!Fn(e))return!1;let r=e.progress;if(t.callbacks.onProgress(r),Xn(t,n,e,`progress`,r),t.state.decision===null){let i=er(r);i&&(t.state.decision=i,Xn(t,n,e,`decision`,{decision:i}))}return!0}function nr(e){return!!e.error||e.type===`error`||typeof e.error_text==`string`}function rr(e){return typeof e.error_text==`string`&&e.error_text?e.error_text:typeof e.error==`string`&&e.error?e.error:(0,r.msg)(`Something went wrong. Please try again.`,{desc:`Generic error message shown in ai chat when the API request fails`})}function ir(e,t,n){if(!nr(e))return!1;let r=rr(e);return t.aiMessage.message=r,t.aiMessage.isError=!0,t.callbacks.onMessageUpdate(t.aiMessage),Tr(e,t,n,e.error??r),!0}function ar(e){return typeof e.question==`string`&&e.question?e.question:typeof e.text==`string`&&e.text?e.text:``}function or(e,t,n){if(e.type!==`interrupt`)return!1;let r=ar(e);return r&&(t.state.interruptQuestion=r,$n(t,r),Xn(t,n,e,`interrupt`,{question:r})),Tr(e,t,n),!0}function sr(e){return typeof e.asset_id==`string`?e.asset_id:typeof e.asset_type==`string`?e.asset_type:`default`}function cr(e){return typeof e.asset_type==`string`?e.asset_type:``}function lr(e){return{assetType:cr(e),snapshot:{}}}function ur(e,t){return{...e,...t}}function dr(e){let t=e.asset_delta??e.delta;return t&&typeof t==`object`?t:null}function fr(e,t){t.state.assets[sr(e)]=lr(e)}function pr(e,t){let n=sr(e),r=t.state.assets[n]??lr(e),i=dr(e);i&&(r.snapshot=ur(r.snapshot,i)),t.state.assets[n]=r}function mr(e,t){let n=e.asset??e.value??e.asset_delta??e.delta;return n&&typeof n==`object`?ur(t?.snapshot??{},n):t?.snapshot??{}}function hr(e,t,n){let r=sr(e),i=t.state.assets[r],a=i?.assetType||cr(e),o=mr(e,i);delete t.state.assets[r],vr(a,o,e,t,n)}function gr(e,t,n){switch(e.type){case`asset_start`:return fr(e,t),!0;case`asset_delta`:return pr(e,t),!0;case`asset_end`:return hr(e,t,n),!0;default:return!1}}function _r(e,t,n,r){n.state.chartSnapshot=e,n.aiMessage.hasChart=!0,typeof t.messageId==`string`&&(n.aiMessage.apiMessageId=t.messageId),n.callbacks.onMessageUpdate(n.aiMessage),Xn(n,r,t,`chart`,e)}function vr(e,t,n,r,i){switch(e){case`dashboard-title`:{let e=t.name;e&&typeof e==`object`&&(r.state.dashboardName=e,Xn(r,i,n,`dashboard-title`,{name:e}));return}case`dashboard-layout`:Xn(r,i,n,`dashboard-layout`,t);return;case`dashboard-item`:Xn(r,i,n,`dashboard-item`,{slot:Number(t.slot),chart:t.chart??t});return;case`dashboard`:r.state.dashboardSnapshot=t;return;default:yr(e,t,n,r,i)}}function yr(e,t,n,r,i){if(i.chartAssetType&&e===i.chartAssetType){_r(t,n,r,i);return}if(i.dashboardAssetType&&e===i.dashboardAssetType){r.state.dashboardSnapshot=t;return}Zn(r,i,n,e||`asset`,t)}function br(e,t,n){let r=!1;if(n.dashboardAssetType){let n=Kn(e);if(n){t.state.dashboardSnapshot=n;let i=qn(e);i&&(t.state.dashboardName=i),r=!0}}if(n.chartAssetType&&!t.state.chartSnapshot){let i=Hn(e);i&&(_r(i,e,t,n),r=!0)}return r}function xr(e,t,n){return{...e,generatedChart:t,conversationId:n.callbacks.getConversationId()}}function Sr(e,t,n){for(let r of Object.keys(t.state.assets)){let i=t.state.assets[r];delete t.state.assets[r],!(n.chartAssetType&&i.assetType===n.chartAssetType&&t.state.chartSnapshot||n.dashboardAssetType&&i.assetType===n.dashboardAssetType&&t.state.dashboardSnapshot)&&vr(i.assetType,i.snapshot,e,t,n)}}function Cr(e,t){let n=Rn(e);!n||t.aiMessage.message===n||(t.aiMessage.message=n,t.callbacks.onMessageUpdate(t.aiMessage))}function wr(e,t,n){let r=t.state.dashboardSnapshot??(n.dashboardAssetType?Kn(e):null),i=t.state.chartSnapshot??(n.chartAssetType?Hn(e):null);return{agent:n.agent,conversationId:t.callbacks.getConversationId(),message:t.aiMessage,...r?{dashboard:r}:{},...i?{chart:xr(e,i,t)}:{},...t.state.dashboardName?{name:t.state.dashboardName}:{},raw:e}}function Tr(e,t,n,r){if(!t.state.completed){if(t.state.completed=!0,Sr(e,t,n),Qn(t),r!==void 0){t.callbacks.onComplete({agent:n.agent,conversationId:t.callbacks.getConversationId(),message:t.aiMessage,error:r,raw:e});return}Cr(e,t),t.callbacks.onComplete(wr(e,t,n))}}function Er(e){return typeof e.type==`string`&&e.type?e.type:typeof e.asset_type==`string`&&e.asset_type?e.asset_type:``}function Dr(e,t,n){let r=Ln(e);return r?(t.state.accumulatedText+=r,$n(t,r),Xn(t,n,e,`text`,{delta:r,text:t.state.accumulatedText}),!0):!1}function Or(e,t,n,r,i){if(r||i)return;let a=Er(e);a&&!Jn.has(a)&&Zn(t,n,e,a,e)}function kr(e,t,n){if(Bn(e,t),tr(e,t,n)||ir(e,t,n)||or(e,t,n)||gr(e,t,n))return;let r=Dr(e,t,n),i=br(e,t,n),a=r||i,o=zn(e);Or(e,t,n,a,o),o&&Tr(e,t,n)}function Ar(e){switch(e){case`dashboard`:return{agent:e,dashboardAssetType:`dashboard`};case`item`:return{agent:e,chartAssetType:`item`};default:return{agent:e}}}function jr(e){let t=Ar(e);return(e,n)=>kr(e,n,t)}function Mr(){return{progressCollapsed:!1,accumulatedText:``,decision:null,assets:{},dashboardSnapshot:null,dashboardName:void 0,chartSnapshot:null,interruptQuestion:null,completed:!1}}function Nr(){return`msg-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}var Pr=class{constructor(e,t={}){this._uiBridgeCallbacks={},this._subscribers=new Set,this._state={messages:[],selectedDatasets:[],isGenerating:!1,progress:null,progressCollapsed:!1,conversationId:null,inflightMessage:null},this._abortController=null,this._inflightMessage=null,this._receivedProgress=!1,this._config={apiUrl:`https://api.luzmo.com`,apiVersion:`0.1.0`,stream:!0,...e},this._hostCallbacks=t,this._state={...this._state,messages:e.messages?[...e.messages]:[],selectedDatasets:e.selectedDatasets?[...e.selectedDatasets]:[],conversationId:e.conversationId??null,isGenerating:e.isGenerating??!1,progress:e.progress??null,progressCollapsed:e.progressCollapsed??!1}}get state(){return this._state}get isGenerating(){return this._state.isGenerating}subscribe(e){return this._subscribers.add(e),e(this._state),()=>{this._subscribers.delete(e)}}setUiBridge(e){this._uiBridgeCallbacks=e}updateConfig(e){this._config={...this._config,...e};let t={};if(`conversationId`in e){let n=e.conversationId??null;n!==this._state.conversationId&&(t.conversationId=n)}if(`selectedDatasets`in e&&e.selectedDatasets){let n=[...e.selectedDatasets];this._areSelectedDatasetsEqual(n,this._state.selectedDatasets)||(t.selectedDatasets=n)}if(`messages`in e&&e.messages){let n=[...e.messages];this._areChatMessagesEqual(n,this._state.messages)||(t.messages=n)}`isGenerating`in e&&e.isGenerating!==this._state.isGenerating&&(t.isGenerating=e.isGenerating),`progress`in e&&(t.progress=e.progress??null),`progressCollapsed`in e&&e.progressCollapsed!==this._state.progressCollapsed&&(t.progressCollapsed=e.progressCollapsed),Object.keys(t).length>0&&this._patchState(t)}setSelectedDatasets(e){this._patchState({selectedDatasets:[...e]}),this._emit(`onDatasetsChanged`,this._state.selectedDatasets)}addDataset(e){this._state.selectedDatasets.some(t=>t.id===e.id)||(this._patchState({selectedDatasets:[...this._state.selectedDatasets,e]}),this._emit(`onDatasetsChanged`,this._state.selectedDatasets))}removeDataset(e){let t=this._state.selectedDatasets.filter(t=>t.id!==e);t.length!==this._state.selectedDatasets.length&&(this._patchState({selectedDatasets:t}),this._emit(`onDatasetsChanged`,this._state.selectedDatasets))}isDatasetRequirementMet(){return!this._config.requireDataset||this._state.selectedDatasets.length>0}getAiPromptUrl(){return bn(this._config.apiUrl??`https://api.luzmo.com`,this._config.apiVersion??`0.1.0`)}buildRequestBody(e,t,n=[]){return On(this._config.agent,{prompt:e,datasetIds:t,authKey:this._config.authKey,authToken:this._config.authToken,conversationId:this._state.conversationId,agentId:this._config.agentId,chart:this._config.chart??null,dashboard:this._config.dashboard??null,currentScreenMode:this._config.currentScreenMode,localeId:this._config.localeId,timezoneId:this._config.timezoneId,task:this._config.task,modelPreference:this._config.modelPreference,apiVersion:this._config.apiVersion,stream:this._config.stream,attachmentUrls:n})}buildPromptSubmittedDetail(e){let t=e.attachmentUrls??[];return{prompt:e.prompt,selectedDatasets:e.selectedDatasets,datasetIds:e.datasetIds,agent:this._config.agent,request:this.buildRequestBody(e.prompt,e.datasetIds,t),url:this.getAiPromptUrl(),...e.signal?{signal:e.signal}:{},...e.attachments?.length?{attachments:e.attachments}:{},...t.length?{attachmentUrls:t}:{}}}async _resolveAttachmentUrls(t,n){if(t.attachmentUrls?.length)return e.d(t.attachmentUrls),[...t.attachmentUrls];let r=(t.attachments??[]).map(e=>e.file).filter(e=>!!e);if(r.length===0)return[];e.u(r);let i=this._hostCallbacks.uploadAttachments??this._uiBridgeCallbacks.uploadAttachments;if(typeof i==`function`)return this._normalizeUploadedUrls(await i(r,{signal:n}),r.length);let{authKey:a,authToken:o,apiUrl:s=`https://api.luzmo.com`,apiVersion:c=`0.1.0`}=this._config;if(!a||!o){if(this._hasCallback(`onPromptSubmitted`))return[];throw Error(`Image attachments require authKey/authToken for built-in upload, or provide uploadAttachments / attachmentUrls.`)}return this._normalizeUploadedUrls(await e.s({files:r,authKey:a,authToken:o,apiUrl:s,apiVersion:c,signal:n}),r.length)}_normalizeUploadedUrls(t,n){let r=Array.isArray(t)?t.filter(e=>typeof e==`string`&&e.trim().length>0):[];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.`);return e.d(r),r}async submit(e){let t=e.datasetIds??this._state.selectedDatasets.map(e=>e.id);if(!this.isDatasetRequirementMet())return;this._abortInflight();let n=new AbortController;this._abortController=n;let r;try{r=await this._resolveAttachmentUrls(e,n.signal)}catch(e){if(this._abortController===n&&(this._abortController=null),n.signal.aborted||e.name===`AbortError`)return;throw e}if(n.signal.aborted||this._abortController!==n)return;let i={id:e.aiMessageId??Nr(),type:`ai`,message:``},a=[...this._state.messages];if(!e.skipUserMessage){let t={id:Nr(),type:`user`,message:e.prompt,...r.length?{attachmentUrls:r}:{}};a=[...a,t],this._emit(`onMessageSent`,t,[...this._state.selectedDatasets])}a=[...a,i],this._inflightMessage=i,this._receivedProgress=!1,this._patchState({messages:a,isGenerating:!0,progress:Pn(),progressCollapsed:!1,inflightMessage:i});let o=t,s=[...this._state.selectedDatasets];if(this._hasCallback(`onPromptSubmitted`)){let t=this.buildPromptSubmittedDetail({prompt:e.prompt,selectedDatasets:s,datasetIds:o,signal:n.signal,attachments:e.attachments,attachmentUrls:r});try{await this._invokeCallback(`onPromptSubmitted`,t)}catch(e){e.name===`AbortError`?this.abort():(this._handleSubmitError(e,i),this._finalizeInflightMessage()),this._patchState({isGenerating:!1})}return}let c=this.buildRequestBody(e.prompt,t,r),l=jr(this._config.agent),u={aiMessage:i,callbacks:this._createStreamCallbacks(),state:Mr()},d=this._config.fetchStreaming??An,f=!1;try{let{body:e,conversationId:t}=await d({url:this.getAiPromptUrl(),body:c,signal:n.signal});t&&this._setConversationId(t),await Nn(e,e=>l(e,u)),f=!0}catch(e){e.name!==`AbortError`&&(this._handleSubmitError(e,i),f=!0)}finally{this._abortController===n&&(f?this._finalizeInflightMessage():this._discardInflightMessage(),this._patchState({isGenerating:!1}),this._abortController=null)}}async restore(e){if(this._config.agent!==`item`)return{};let t=kn(e.restoreToMessageId,this._config.authKey,this._config.authToken,this._config.apiVersion,this._state.conversationId);if(this._patchState({isGenerating:!0,progress:null,progressCollapsed:!1}),this._hasCallback(`onRestoreRequested`)){let n={apiMessageId:e.restoreToMessageId,messageIndex:e.messageIndex,request:t,url:this.getAiPromptUrl()};try{await this._invokeCallback(`onRestoreRequested`,n)}finally{this._patchState({isGenerating:!1})}return{}}try{let n=await fetch(this.getAiPromptUrl(),{method:`POST`,headers:{"Content-Type":`application/json`},mode:`cors`,body:JSON.stringify(t)});if(!n.ok){let e=await n.json().catch(()=>null);throw Error(e?.message||`API request failed with status ${n.status}`)}let r=await n.json().catch(()=>null),i=r?.generatedChart??(r?Hn(r):null),a={...typeof r?.message==`string`?{message:r.message}:{},...i?{chart:{...r,generatedChart:i}}:{}},o=e.messageIndex>=0&&e.messageIndex<this._state.messages.length?this._state.messages.slice(0,e.messageIndex+1):this._state.messages;if(a.message&&o[e.messageIndex]?.type===`ai`&&(o[e.messageIndex]={...o[e.messageIndex],message:a.message}),this._patchState({messages:[...o]}),a.chart||a.message){let t=o[e.messageIndex],n=t?.type===`ai`?t:{id:Nr(),type:`ai`,message:a.message??``};this._emit(`onComplete`,{agent:this._config.agent,conversationId:this._state.conversationId,message:n,...a.chart?{chart:a.chart}:{},...r?{raw:r}:{}})}return a}finally{this._patchState({isGenerating:!1})}}buildRestoreRequest(e){return kn(e,this._config.authKey,this._config.authToken,this._config.apiVersion,this._state.conversationId)}abort(e={}){this._abortController?.abort(),this._abortController=null,e.notify&&this._inflightMessage?this._markInflightCancelled(e.cancelledMessage):this._discardInflightMessage(),this._patchState({isGenerating:!1,progress:null,progressCollapsed:!1}),e.notify&&this._emit(`onPromptStopped`)}_abortInflight(){this._abortController?.abort(),this._abortController=null,this._discardInflightMessage()}_createStreamCallbacks(){return{onConversationIdChange:e=>this._setConversationId(e),onProgress:e=>{this._receivedProgress=!0,this._patchState({progress:e})},onProgressCollapsed:e=>{this._patchState({progressCollapsed:e})},onMessageUpdate:e=>{this._inflightMessage=e,this._upsertMessage(e),this._patchState({inflightMessage:{...e}})},getConversationId:()=>this._state.conversationId,onStep:e=>{this._emit(`onStep`,e)},onComplete:e=>{this._emit(`onComplete`,e)}}}_setConversationId(e){this._config={...this._config,conversationId:e},this._patchState({conversationId:e}),this._emit(`onConversationIdChange`,e)}_upsertMessage(e){let t=this._state.messages.findIndex(t=>t.id===e.id);if(t===-1){this._patchState({messages:[...this._state.messages,{...e}]});return}let n=this._state.messages.map((n,r)=>r===t?{...e}:n);this._patchState({messages:n})}_finalizeInflightMessage(){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({progress:null,progressCollapsed:!1,inflightMessage:null}))}_removeInflightFromMessages(){this._inflightMessage&&this._patchState({messages:this._state.messages.filter(e=>e.id!==this._inflightMessage.id)})}_markInflightCancelled(e){this._inflightMessage&&(this._inflightMessage.message=e??(0,r.msg)(`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,this._upsertMessage(this._inflightMessage),this._inflightMessage=null,this._receivedProgress=!1,this._patchState({inflightMessage:null}))}_discardInflightMessage(){let e=!!(this._inflightMessage||this._state.inflightMessage);this._removeInflightFromMessages(),this._inflightMessage=null,this._receivedProgress=!1,e&&this._patchState({inflightMessage:null})}_handleSubmitError(e,t){t.message=(0,r.msg)(`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,this._inflightMessage=t,this._upsertMessage(t),this._patchState({inflightMessage:{...t},progress:null,progressCollapsed:!1}),this._emit(`onComplete`,{agent:this._config.agent,conversationId:this._state.conversationId,message:t,error:e})}_hasCallback(e){return typeof this._hostCallbacks[e]==`function`||typeof this._uiBridgeCallbacks[e]==`function`}_emit(e,...t){this._invokeCallback(e,...t)}async _invokeCallback(e,...t){let n=this._hostCallbacks[e],r=this._uiBridgeCallbacks[e];typeof n==`function`&&await n(...t),typeof r==`function`&&await r(...t)}_patchState(e){this._state={...this._state,...e},this._emit(`onStateChange`,this._state);for(let e of this._subscribers)e(this._state)}_areSelectedDatasetsEqual(e,t){return e.length===t.length&&e.every((e,n)=>e.id===t[n]?.id)}_areChatMessagesEqual(e,t){return e.length===t.length&&e.every((e,n)=>{let r=t[n];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)})}};function Fr(e,t){return new Pr(e,t)}var Ir=class{constructor(e){this.options=e,this._session=null,this._ownsSession=!1,this._seededFromProps=!1,this._unsubscribe=null}get current(){return this._session}get state(){if(this._session)return this._session.state;let e=this.options.getSeed();return{messages:e.messages,selectedDatasets:e.selectedDatasets,isGenerating:!1,progress:null,progressCollapsed:!1,conversationId:e.conversationId,inflightMessage:null}}get ownsCurrentSession(){return this._ownsSession}setSession(e){if(!e){this._clearSession();return}this._ownsSession&&this._session!==e&&this._session?.abort(),this._ownsSession=!1,this._session=e,this._mergeHostElementConfig(e),this._wire(e)}syncProperties(e){if(!e.has(`chatSession`)){if(this._createSessionIfMissing(),this._session){let t=this.options.getConfig();if(Object.keys(t).some(t=>e.has(t))&&(this._ownsSession?this._session.updateConfig(t):this._mergeHostElementConfig(this._session)),e.has(`selectedDatasets`)&&this._ownsSession){let e=this.options.getSeed().selectedDatasets,t=this._session.state.selectedDatasets;(e.length!==t.length||e.some((e,n)=>e.id!==t[n]?.id))&&this._session.updateConfig({selectedDatasets:e})}}(e.has(`messages`)||e.has(`selectedDatasets`))&&this._seedFromPropsOnce()}}requireSession(){return this._createSessionIfMissing(),this._ownsSession?this._session.updateConfig(this.options.getConfig()):this._session&&this._mergeHostElementConfig(this._session),this._session}_mergeHostElementConfig(e){let t=this.options.getConfig(),n={authKey:t.authKey,authToken:t.authToken,apiUrl:t.apiUrl,apiVersion:t.apiVersion,stream:t.stream,localeId:t.localeId,timezoneId:t.timezoneId,modelPreference:t.modelPreference,requireDataset:t.requireDataset,agent:t.agent};t.task!==void 0&&(n.task=t.task),t.chart!=null&&(n.chart=t.chart),t.dashboard!=null&&(n.dashboard=t.dashboard),t.currentScreenMode!=null&&(n.currentScreenMode=t.currentScreenMode),t.conversationId!=null&&(n.conversationId=t.conversationId),e.updateConfig(n)}connect(){this._session&&this._wire(this._session)}teardown(){this._unwire(),this._ownsSession&&=(this._session?.abort(),this._session=null,!1),this._seededFromProps=!1}_createSessionIfMissing(){if(this._session)return;let e=this.options.getSeed();this._session=Fr({...this.options.getConfig(),messages:e.messages.length>0?[...e.messages]:void 0,selectedDatasets:e.selectedDatasets.length>0?[...e.selectedDatasets]:void 0}),this._ownsSession=!0,this._seededFromProps=e.messages.length>0||e.selectedDatasets.length>0,this._wire(this._session)}_clearSession(){this._unwire(),this._ownsSession&&this._session?.abort(),this._session=null,this._ownsSession=!1}_seedFromPropsOnce(){if(!this._ownsSession||this._seededFromProps)return;let e=this.requireSession(),t=this.options.getSeed(),n={};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)}_wire(e){this._unwire(),e.setUiBridge(this.options.createDomBridge()),this._unsubscribe=e.subscribe(()=>{this.options.onRenderNeeded()})}_unwire(){this._unsubscribe?.(),this._unsubscribe=null}},$=class n extends t.i{constructor(...e){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.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.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 Ir({getConfig:()=>this._buildSessionConfig(),getSeed:()=>({messages:this.messages,selectedDatasets:Array.isArray(this.selectedDatasets)?this.selectedDatasets:[],conversationId:this.conversationId}),createDomBridge:()=>this._createDomBridgeCallbacks(),onRenderNeeded:()=>{this.requestUpdate(),this.updateComplete.then(()=>this._scrollToBottom())}}),this._handleAssistantMessageActionsSlotChange=e=>{let t=e.target.assignedElements({flatten:!0}).length>0;this._setAssistantMessageActionsSlotHasContent(t)},this._handleAssistantMessageActionConfirmKeydown=e=>{e.key!==`Escape`||!this._pendingAssistantMessageAction||(e.preventDefault(),e.stopPropagation(),this._cancelAssistantMessageActionConfirm())}}static{this.styles=(0,a.unsafeCSS)(vn)}static{this.tagName=`luzmo-ai-chat`}static{this.assistantMessageActionsSlot=`assistant-message-actions`}get flagOpendata(){return this.includePublicDatasets}set flagOpendata(e){this.includePublicDatasets=e}get session(){return this._session.current}_getRenderState(){return this._session.state}_createDomBridgeCallbacks(){return{onMessageSent:(e,t)=>{this.dispatchEvent(new CustomEvent(`luzmo-message-sent`,{detail:{message:e,selectedDatasets:t},bubbles:!0,composed:!0}))},onDatasetsChanged:e=>{this.dispatchEvent(new CustomEvent(`luzmo-datasets-changed`,{detail:{selectedDatasets:e},bubbles:!0,composed:!0}))},onConversationIdChange:e=>this._emitConversationIdChanged(e),onStep:e=>{this.dispatchEvent(new CustomEvent(`luzmo-step`,{detail:e,bubbles:!0,composed:!0}))},onComplete:e=>{this.dispatchEvent(new CustomEvent(`luzmo-complete`,{detail:e,bubbles:!0,composed:!0}))},onPromptStopped:()=>{this.dispatchEvent(new CustomEvent(`luzmo-stop`,{bubbles:!0,composed:!0}))},...typeof this.uploadAttachments==`function`?{uploadAttachments:(e,t)=>this.uploadAttachments(e,t)}:{}}}get _resolvedAcceptedFileTypes(){return this.acceptedFileTypes.length>0?this.acceptedFileTypes:this.allowImages?[...e.c]:[]}_buildSessionConfig(){return{agent:this.agent,agentId:this.agentId,authKey:this.authKey,authToken:this.authToken,apiUrl:this.apiUrl,apiVersion:this.apiVersion,stream:this.stream,conversationId:this.conversationId,chart:this.chart,dashboard:this.dashboard,currentScreenMode:this.currentScreenMode,localeId:this.localeId,timezoneId:this.timezoneId,task:this.task,modelPreference:this.modelPreference,requireDataset:this.requireDataset}}_emitConversationIdChanged(e){this.conversationId=e,this.dispatchEvent(new CustomEvent(`luzmo-conversation-id-changed`,{detail:{conversationId:e},bubbles:!0,composed:!0}))}async _restoreViaSession(e,t){await this._session.requireSession().restore({restoreToMessageId:e,messageIndex:t})}async _handleRestoreState(e,t){if(e.apiMessageId&&this.agent===`item`)try{await this._restoreViaSession(e.apiMessageId,t)}catch(e){console.error(`AI restore error:`,e)}}_handleDatasetSelected(e){this._session.requireSession().addDataset(e.detail)}_handleDatasetRemoved(e){this._session.requireSession().removeDataset(e.detail.id)}async _submitViaSession(e,t={}){let n=this._session.requireSession();if(!n.isDatasetRequirementMet())return!1;this._textareaValue=``;try{return await n.submit({prompt:e,...t}),!0}catch(e){return e.name!==`AbortError`&&console.error(`AI prompt session error:`,e),!1}}async _handlePromptSubmitted(e){let t=e.detail.prompt;await this._submitViaSession(t,{...e.detail.attachments?.length?{attachments:e.detail.attachments}:{},...e.detail.attachmentUrls?.length?{attachmentUrls:e.detail.attachmentUrls}:{}})||(this._textareaValue=t)}_handlePromptStopped(){let e=this._session.current;if(this._textareaValue=``,e){e.abort({notify:!0,cancelledMessage:this.cancelledMessage??void 0});return}this.dispatchEvent(new CustomEvent(`luzmo-stop`,{bubbles:!0,composed:!0}))}async _handleEmptyStateSuggestionSelected(e){let{prompt:t,selectedDatasets:n}=e.detail,r=this._session.requireSession();n?.length&&r.setSelectedDatasets(n),await this._submitViaSession(t)}async _processInitialPrompt(){!this.initialPrompt||this.initialPrompt===this._lastProcessedInitialPrompt||this._session.requireSession().isDatasetRequirementMet()&&(this._lastProcessedInitialPrompt=this.initialPrompt,await this._submitViaSession(this.initialPrompt,{skipUserMessage:!0}))}connectedCallback(){super.connectedCallback(),this._session.connect()}disconnectedCallback(){super.disconnectedCallback(),this._session.teardown()}_scrollToBottom(){let e=this.shadowRoot?.querySelector(`.chat-messages-container`);e&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.scrollTop=e.scrollHeight})})}willUpdate(e){super.willUpdate?.(e),this._syncPendingAssistantMessageAction()}updated(e){super.updated?.(e),this._syncSession(e),this._handleInitialPromptChange(),e.has(`uploadAttachments`)&&this._session.current?.setUiBridge(this._createDomBridgeCallbacks()),this.updateComplete.then(()=>{this._syncAssistantMessageActionsVisibility(),this._focusPendingAssistantMessageActionConfirm()})}_syncSession(e){if(e.has(`chatSession`)){this._session.setSession(this.chatSession);return}this._session.syncProperties(e)}_handleInitialPromptChange(){this.initialPrompt&&this.initialPrompt!==this._lastProcessedInitialPrompt?this._processInitialPrompt():this.initialPrompt||(this._lastProcessedInitialPrompt=null)}_renderMarkdown(e){let t=String(Y.parse(e,{async:!1}));return lt.sanitize(t,{ALLOWED_TAGS:`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(`.`),ALLOWED_ATTR:[`href`,`title`,`target`,`rel`],ALLOW_DATA_ATTR:!1,FORBID_TAGS:[`script`,`style`,`iframe`,`object`,`embed`,`link`,`form`,`input`,`button`],FORBID_ATTR:[`onerror`,`onload`,`onclick`,`onmouseover`,`onfocus`,`onblur`]})}_renderProgress(){let{progress:e,progressCollapsed:t}=this._getRenderState();return e?.children?.length?a.html`
114
114
  <luzmo-progress-steps
115
115
  .progress=${e}
116
116
  ?collapsed=${t}
@@ -309,11 +309,11 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
309
309
  api-url=${this.apiUrl}
310
310
  api-version=${this.apiVersion}
311
311
  app-server=${this.appServer}
312
- ?flag-opendata=${this.flagOpendata}
312
+ ?include-public-datasets=${this.includePublicDatasets}
313
313
  @prompt-submitted=${this._handlePromptSubmitted}
314
314
  @prompt-stopped=${this._handlePromptStopped}
315
315
  @dataset-selected=${this._handleDatasetSelected}
316
316
  @dataset-removed=${this._handleDatasetRemoved}
317
317
  ></luzmo-ai-interaction-textarea>
318
318
  </div>
319
- `}};n.t([(0,o.property)({type:Array})],$.prototype,`messages`,void 0),n.t([(0,o.property)({type:Array,attribute:`selected-datasets`})],$.prototype,`selectedDatasets`,void 0),n.t([(0,o.property)({type:String})],$.prototype,`placeholder`,void 0),n.t([(0,o.property)({type:Boolean,reflect:!0})],$.prototype,`disabled`,void 0),n.t([(0,o.property)({type:Boolean,reflect:!0})],$.prototype,`stoppable`,void 0),n.t([(0,o.property)({type:Boolean,attribute:`show-assistant-context-menu`})],$.prototype,`showAssistantContextMenu`,void 0),n.t([(0,o.property)({type:String,attribute:`auth-key`})],$.prototype,`authKey`,void 0),n.t([(0,o.property)({type:String,attribute:`auth-token`})],$.prototype,`authToken`,void 0),n.t([(0,o.property)({type:String,attribute:`api-url`})],$.prototype,`apiUrl`,void 0),n.t([(0,o.property)({type:String,attribute:`app-server`})],$.prototype,`appServer`,void 0),n.t([(0,o.property)({type:Boolean,attribute:`flag-opendata`})],$.prototype,`flagOpendata`,void 0),n.t([(0,o.property)({type:Boolean,attribute:`hide-dataset-button`})],$.prototype,`hideDatasetButton`,void 0),n.t([(0,o.property)({type:Boolean,attribute:`hide-dataset-icons`})],$.prototype,`hideDatasetIcons`,void 0),n.t([(0,o.property)({type:Boolean,attribute:`disable-dataset-modification`})],$.prototype,`disableDatasetModification`,void 0),n.t([(0,o.property)({type:Boolean,attribute:`hide-selected-datasets`})],$.prototype,`hideSelectedDatasets`,void 0),n.t([(0,o.property)({type:Boolean,attribute:`disable-column-mentions`})],$.prototype,`disableColumnMentions`,void 0),n.t([(0,o.property)({type:Boolean,attribute:`require-dataset`})],$.prototype,`requireDataset`,void 0),n.t([(0,o.property)({type:Boolean,reflect:!0,attribute:`allow-images`})],$.prototype,`allowImages`,void 0),n.t([(0,o.property)({type:Boolean,reflect:!0,attribute:`allow-voice-input`})],$.prototype,`allowVoiceInput`,void 0),n.t([(0,o.property)({type:Array,attribute:`accepted-file-types`})],$.prototype,`acceptedFileTypes`,void 0),n.t([(0,o.property)({attribute:!1})],$.prototype,`uploadAttachments`,void 0),n.t([(0,o.property)({type:String})],$.prototype,`agent`,void 0),n.t([(0,o.property)({type:String,attribute:`agent-id`})],$.prototype,`agentId`,void 0),n.t([(0,o.property)({type:String})],$.prototype,`task`,void 0),n.t([(0,o.property)({type:String,attribute:`model-preference`})],$.prototype,`modelPreference`,void 0),n.t([(0,o.property)({attribute:!1})],$.prototype,`chatSession`,void 0),n.t([(0,o.property)({type:String,attribute:`conversation-id`})],$.prototype,`conversationId`,void 0),n.t([(0,o.property)({type:Object,attribute:`chart`})],$.prototype,`chart`,void 0),n.t([(0,o.property)({type:Object})],$.prototype,`dashboard`,void 0),n.t([(0,o.property)({type:String,attribute:`current-screen-mode`})],$.prototype,`currentScreenMode`,void 0),n.t([(0,o.property)({type:String,attribute:`locale-id`})],$.prototype,`localeId`,void 0),n.t([(0,o.property)({type:String,attribute:`timezone-id`})],$.prototype,`timezoneId`,void 0),n.t([(0,o.property)({type:String,attribute:`api-version`})],$.prototype,`apiVersion`,void 0),n.t([(0,o.property)({converter:{fromAttribute:e=>e!==`false`&&e!==null}})],$.prototype,`stream`,void 0),n.t([(0,o.property)({type:String,attribute:`loading-message`})],$.prototype,`loadingMessage`,void 0),n.t([(0,o.property)({type:String,attribute:`cancelled-message`})],$.prototype,`cancelledMessage`,void 0),n.t([(0,o.property)({type:String,attribute:`initial-prompt`})],$.prototype,`initialPrompt`,void 0),n.t([(0,o.property)({type:String,attribute:`empty-state-title`})],$.prototype,`emptyStateTitle`,void 0),n.t([(0,o.property)({type:String,attribute:`empty-state-subtitle`})],$.prototype,`emptyStateSubtitle`,void 0),n.t([(0,o.property)({type:Array,attribute:!1})],$.prototype,`emptyStateSuggestions`,void 0),n.t([(0,o.state)()],$.prototype,`_textareaValue`,void 0),n.t([(0,o.state)()],$.prototype,`_assistantMessageActionsSlotHasContent`,void 0),n.t([(0,o.state)()],$.prototype,`_pendingAssistantMessageAction`,void 0);function Lr(e){return e.recognized===!0}customElements.get(`luzmo-ai-chat`)||customElements.define(`luzmo-ai-chat`,$),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return En}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return Cn}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return bn}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return kn}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Fr}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return Tn}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return Ar}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return Kn}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return Pn}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return Nn}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return jn}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Pr}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return kr}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return An}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return Mr}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return Fn}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Ir}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return jr}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Lr}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return Hn}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return Dn}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return xn}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return wn}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return On}});
319
+ `}};n.t([(0,o.property)({type:Array})],$.prototype,`messages`,void 0),n.t([(0,o.property)({type:Array,attribute:`selected-datasets`})],$.prototype,`selectedDatasets`,void 0),n.t([(0,o.property)({type:String})],$.prototype,`placeholder`,void 0),n.t([(0,o.property)({type:Boolean,reflect:!0})],$.prototype,`disabled`,void 0),n.t([(0,o.property)({type:Boolean,reflect:!0})],$.prototype,`stoppable`,void 0),n.t([(0,o.property)({type:Boolean,attribute:`show-assistant-context-menu`})],$.prototype,`showAssistantContextMenu`,void 0),n.t([(0,o.property)({type:String,attribute:`auth-key`})],$.prototype,`authKey`,void 0),n.t([(0,o.property)({type:String,attribute:`auth-token`})],$.prototype,`authToken`,void 0),n.t([(0,o.property)({type:String,attribute:`api-url`})],$.prototype,`apiUrl`,void 0),n.t([(0,o.property)({type:String,attribute:`app-server`})],$.prototype,`appServer`,void 0),n.t([(0,o.property)({type:Boolean,reflect:!0,attribute:`include-public-datasets`})],$.prototype,`includePublicDatasets`,void 0),n.t([(0,o.property)({type:Boolean,attribute:`flag-opendata`})],$.prototype,`flagOpendata`,null),n.t([(0,o.property)({type:Boolean,attribute:`hide-dataset-button`})],$.prototype,`hideDatasetButton`,void 0),n.t([(0,o.property)({type:Boolean,attribute:`hide-dataset-icons`})],$.prototype,`hideDatasetIcons`,void 0),n.t([(0,o.property)({type:Boolean,attribute:`disable-dataset-modification`})],$.prototype,`disableDatasetModification`,void 0),n.t([(0,o.property)({type:Boolean,attribute:`hide-selected-datasets`})],$.prototype,`hideSelectedDatasets`,void 0),n.t([(0,o.property)({type:Boolean,attribute:`disable-column-mentions`})],$.prototype,`disableColumnMentions`,void 0),n.t([(0,o.property)({type:Boolean,attribute:`require-dataset`})],$.prototype,`requireDataset`,void 0),n.t([(0,o.property)({type:Boolean,reflect:!0,attribute:`allow-images`})],$.prototype,`allowImages`,void 0),n.t([(0,o.property)({type:Boolean,reflect:!0,attribute:`allow-voice-input`})],$.prototype,`allowVoiceInput`,void 0),n.t([(0,o.property)({type:Array,attribute:`accepted-file-types`})],$.prototype,`acceptedFileTypes`,void 0),n.t([(0,o.property)({attribute:!1})],$.prototype,`uploadAttachments`,void 0),n.t([(0,o.property)({type:String})],$.prototype,`agent`,void 0),n.t([(0,o.property)({type:String,attribute:`agent-id`})],$.prototype,`agentId`,void 0),n.t([(0,o.property)({type:String})],$.prototype,`task`,void 0),n.t([(0,o.property)({type:String,attribute:`model-preference`})],$.prototype,`modelPreference`,void 0),n.t([(0,o.property)({attribute:!1})],$.prototype,`chatSession`,void 0),n.t([(0,o.property)({type:String,attribute:`conversation-id`})],$.prototype,`conversationId`,void 0),n.t([(0,o.property)({type:Object,attribute:`chart`})],$.prototype,`chart`,void 0),n.t([(0,o.property)({type:Object})],$.prototype,`dashboard`,void 0),n.t([(0,o.property)({type:String,attribute:`current-screen-mode`})],$.prototype,`currentScreenMode`,void 0),n.t([(0,o.property)({type:String,attribute:`locale-id`})],$.prototype,`localeId`,void 0),n.t([(0,o.property)({type:String,attribute:`timezone-id`})],$.prototype,`timezoneId`,void 0),n.t([(0,o.property)({type:String,attribute:`api-version`})],$.prototype,`apiVersion`,void 0),n.t([(0,o.property)({converter:{fromAttribute:e=>e!==`false`&&e!==null}})],$.prototype,`stream`,void 0),n.t([(0,o.property)({type:String,attribute:`loading-message`})],$.prototype,`loadingMessage`,void 0),n.t([(0,o.property)({type:String,attribute:`cancelled-message`})],$.prototype,`cancelledMessage`,void 0),n.t([(0,o.property)({type:String,attribute:`initial-prompt`})],$.prototype,`initialPrompt`,void 0),n.t([(0,o.property)({type:String,attribute:`empty-state-title`})],$.prototype,`emptyStateTitle`,void 0),n.t([(0,o.property)({type:String,attribute:`empty-state-subtitle`})],$.prototype,`emptyStateSubtitle`,void 0),n.t([(0,o.property)({type:Array,attribute:!1})],$.prototype,`emptyStateSuggestions`,void 0),n.t([(0,o.state)()],$.prototype,`_textareaValue`,void 0),n.t([(0,o.state)()],$.prototype,`_assistantMessageActionsSlotHasContent`,void 0),n.t([(0,o.state)()],$.prototype,`_pendingAssistantMessageAction`,void 0);function Lr(e){return e.recognized===!0}customElements.get(`luzmo-ai-chat`)||customElements.define(`luzmo-ai-chat`,$),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return En}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return Cn}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return bn}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return kn}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Fr}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return Tn}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return Ar}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return Kn}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return Pn}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return Nn}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return jn}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Pr}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return kr}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return An}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return Mr}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return Fn}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Ir}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return jr}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Lr}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return Hn}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return Dn}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return xn}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return wn}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return On}});
@@ -17,7 +17,7 @@
17
17
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
18
  * SOFTWARE.
19
19
  * */
20
- import { c as e, d as t, s as n, u as r } from "./ai-interaction-textarea-DMT8RNUP.js";
20
+ import { c as e, d as t, s as n, u as r } from "./ai-interaction-textarea-uc14Goa4.js";
21
21
  import { i } from "./base-DPqRkMth.js";
22
22
  import { t as a } from "./decorate-DyMgX_Uh.js";
23
23
  import { msg as o } from "@lit/localize/lit-localize";
@@ -3365,7 +3365,7 @@ var Wr = class {
3365
3365
  }
3366
3366
  }, $ = class t extends i {
3367
3367
  constructor(...e) {
3368
- 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.flagOpendata = !1, this.hideDatasetButton = !1, this.hideDatasetIcons = !1, this.disableDatasetModification = !1, this.hideSelectedDatasets = !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.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 Wr({
3368
+ 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.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.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 Wr({
3369
3369
  getConfig: () => this._buildSessionConfig(),
3370
3370
  getSeed: () => ({
3371
3371
  messages: this.messages,
@@ -3392,6 +3392,12 @@ var Wr = class {
3392
3392
  static {
3393
3393
  this.assistantMessageActionsSlot = "assistant-message-actions";
3394
3394
  }
3395
+ get flagOpendata() {
3396
+ return this.includePublicDatasets;
3397
+ }
3398
+ set flagOpendata(e) {
3399
+ this.includePublicDatasets = e;
3400
+ }
3395
3401
  get session() {
3396
3402
  return this._session.current;
3397
3403
  }
@@ -3916,7 +3922,7 @@ var Wr = class {
3916
3922
  api-url=${this.apiUrl}
3917
3923
  api-version=${this.apiVersion}
3918
3924
  app-server=${this.appServer}
3919
- ?flag-opendata=${this.flagOpendata}
3925
+ ?include-public-datasets=${this.includePublicDatasets}
3920
3926
  @prompt-submitted=${this._handlePromptSubmitted}
3921
3927
  @prompt-stopped=${this._handlePromptStopped}
3922
3928
  @dataset-selected=${this._handleDatasetSelected}
@@ -3951,9 +3957,13 @@ a([p({ type: Array })], $.prototype, "messages", void 0), a([p({
3951
3957
  type: String,
3952
3958
  attribute: "app-server"
3953
3959
  })], $.prototype, "appServer", void 0), a([p({
3960
+ type: Boolean,
3961
+ reflect: !0,
3962
+ attribute: "include-public-datasets"
3963
+ })], $.prototype, "includePublicDatasets", void 0), a([p({
3954
3964
  type: Boolean,
3955
3965
  attribute: "flag-opendata"
3956
- })], $.prototype, "flagOpendata", void 0), a([p({
3966
+ })], $.prototype, "flagOpendata", null), a([p({
3957
3967
  type: Boolean,
3958
3968
  attribute: "hide-dataset-button"
3959
3969
  })], $.prototype, "hideDatasetButton", void 0), a([p({
@@ -62,10 +62,14 @@ export declare class LuzmoAiInteractionTextarea extends LitElement {
62
62
  * @default https://app.luzmo.com
63
63
  */
64
64
  appServer: string;
65
+ /** When true, shows public datasets alongside the user's other datasets. */
66
+ includePublicDatasets: boolean;
65
67
  /**
66
- * When true, restricts results to public datasets (opendata parity)
68
+ * Alias for includePublicDatasets.
69
+ * @deprecated Use includePublicDatasets instead.
67
70
  */
68
- flagOpendata: boolean;
71
+ get flagOpendata(): boolean;
72
+ set flagOpendata(value: boolean);
69
73
  /**
70
74
  * When true, disables the entire component (sets opacity to 60% and prevents all interactions)
71
75
  */
@@ -17,4 +17,4 @@
17
17
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
18
  * SOFTWARE.
19
19
  * */
20
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../ai-interaction-textarea-CJO50_1F.cjs");Object.defineProperty(exports,"LuzmoAiInteractionTextarea",{enumerable:!0,get:function(){return e.t}});
20
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../ai-interaction-textarea-CMz5ixwt.cjs");Object.defineProperty(exports,"LuzmoAiInteractionTextarea",{enumerable:!0,get:function(){return e.t}});
@@ -24,5 +24,5 @@
24
24
  e.setAttribute("data-luzmo-vars", ""), e.textContent = "html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: color-mix(in oklch, var(--luzmo-border-color-full), black 25%);--luzmo-border-color-full-down: color-mix(in oklch, var(--luzmo-border-color-full), black 45%);--luzmo-border-color-full-focus: color-mix(in oklch, var(--luzmo-border-color-full), black 25%);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: color-mix( in oklch, color-mix(in oklch, var(--luzmo-background-color), var(--luzmo-primary) 5%), black 1.5% );--luzmo-background-color-down: color-mix(in oklch, color-mix(in oklch, var(--luzmo-background-color), var(--luzmo-primary) 7%), black 1%);--luzmo-background-color-focus: color-mix( in oklch, color-mix(in oklch, var(--luzmo-background-color), var(--luzmo-primary) 5%), black 1.5% );--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: color-mix(in oklch, var(--luzmo-background-color-highlight), black 10%);--luzmo-background-color-highlight-down: color-mix(in oklch, var(--luzmo-background-color-highlight), black 20%);--luzmo-background-color-highlight-focus: color-mix(in oklch, var(--luzmo-background-color-highlight), black 10%);--luzmo-background-color-alt-1: rgb(250, 250, 250);--luzmo-background-color-alt-2: rgb(239, 239, 239);--luzmo-border-width: 1px;--luzmo-shadow-color-rgb: 0, 0, 0;--luzmo-shadow-opacity: 0.1;--luzmo-shadow-color: rgba(var(--luzmo-shadow-color-rgb), var(--luzmo-shadow-opacity));--luzmo-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-hard: #000;--luzmo-font-color-disabled: var(--luzmo-color-disabled);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: color-mix(in oklch, var(--luzmo-font-color), black 8%);--luzmo-font-color-down: color-mix(in oklch, var(--luzmo-font-color), black 20%);--luzmo-font-color-focus: color-mix(in oklch, var(--luzmo-font-color), black 8%);--luzmo-scrollbar-size: 6px;--luzmo-scrollbar-width: thin;--luzmo-scrollbar-track-background: transparent;--luzmo-scrollbar-track-border-radius: var(--luzmo-border-radius-s);--luzmo-scrollbar-thumb-background: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-scrollbar-thumb-border-radius: var(--luzmo-border-radius-s);--luzmo-scrollbar-thumb-hover-background: rgba(var(--luzmo-border-color-rgb), 0.4);--luzmo-primary: #4434ff;--luzmo-primary-hover: color-mix(in oklch, var(--luzmo-primary), black 8%);--luzmo-primary-down: color-mix(in oklch, var(--luzmo-primary), black 20%);--luzmo-primary-focus: color-mix(in oklch, var(--luzmo-primary), black 8%);--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-secondary: #ff00ff;--luzmo-secondary-hover: color-mix(in oklch, var(--luzmo-secondary), black 8%);--luzmo-secondary-down: color-mix(in oklch, var(--luzmo-secondary), black 20%);--luzmo-secondary-focus: color-mix(in oklch, var(--luzmo-secondary), black 8%);--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 255, 0, 255;--luzmo-secondary-outline: rgba(255, 0, 255, 0.2);--luzmo-negative-color: #ca221c;--luzmo-negative-color-hover: color-mix(in oklch, var(--luzmo-negative-color), black 8%);--luzmo-negative-color-down: color-mix(in oklch, var(--luzmo-negative-color), black 20%);--luzmo-negative-color-focus: color-mix(in oklch, var(--luzmo-negative-color), black 8%);--luzmo-negative-color-rgb: 202, 34, 28;--luzmo-positive-color: rgb(20, 150, 101);--luzmo-positive-color-hover: color-mix(in oklch, var(--luzmo-positive-color), black 8%);--luzmo-positive-color-down: color-mix(in oklch, var(--luzmo-positive-color), black 20%);--luzmo-positive-color-focus: color-mix(in oklch, var(--luzmo-positive-color), black 8%);--luzmo-positive-color-rgb: 20, 150, 101;--luzmo-selected-color: rgb(110, 110, 110);--luzmo-selected-color-hover: color-mix(in oklch, var(--luzmo-selected-color), black 25%);--luzmo-selected-color-down: color-mix(in oklch, var(--luzmo-selected-color), black 45%);--luzmo-selected-color-focus: color-mix(in oklch, var(--luzmo-selected-color), black 25%);--luzmo-selected-color-hard: #1e1e1e;--luzmo-selected-color-hard-hover: color-mix(in oklch, var(--luzmo-selected-color-hard), black 25%);--luzmo-selected-color-hard-down: color-mix(in oklch, var(--luzmo-selected-color-hard), black 45%);--luzmo-selected-color-hard-focus: color-mix(in oklch, var(--luzmo-selected-color-hard), black 25%);--luzmo-color-informative: #1a77e9;--luzmo-color-informative-rgb: 26, 119, 233;--luzmo-color-disabled: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 12px;--luzmo-icon-size-xs: 14px;--luzmo-icon-size-s: 16px;--luzmo-icon-size-m: 18px;--luzmo-icon-size-l: 20px;--luzmo-icon-size-xl: 22px;--luzmo-icon-size-xxl: 32px}", document.head.appendChild(e);
25
25
  }
26
26
  })();
27
- import { t as e } from "../ai-interaction-textarea-DMT8RNUP.js";
27
+ import { t as e } from "../ai-interaction-textarea-uc14Goa4.js";
28
28
  export { e as LuzmoAiInteractionTextarea };