@luzmo/analytics-components-kit 1.0.8-beta.2 → 1.0.8-beta.4
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.
- package/README.md +1 -1
- package/components/ai-chat/ai-chat.d.ts +10 -4
- package/components/ai-chat/index.cjs +1 -1
- package/components/ai-chat/index.js +2 -2
- package/components/ai-chat/session/ai-chat-session-types.d.ts +3 -1
- package/components/ai-chat/session/ai-chat-session.d.ts +3 -2
- package/components/{ai-chat-Dy_utMXO.js → ai-chat-CSoYb7E3.js} +41 -17
- package/components/{ai-chat-D1Rzwdxy.cjs → ai-chat-Dq88ryzU.cjs} +5 -4
- package/components/ai-interaction-textarea/ai-interaction-textarea.d.ts +15 -4
- package/components/ai-interaction-textarea/index.cjs +1 -1
- package/components/ai-interaction-textarea/index.d.ts +2 -0
- package/components/ai-interaction-textarea/index.js +1 -1
- package/components/ai-interaction-textarea/types.d.ts +2 -0
- package/components/ai-interaction-textarea-1WuexZ9Q.cjs +98 -0
- package/components/{ai-interaction-textarea-DMT8RNUP.js → ai-interaction-textarea-BZAeZunP.js} +28 -8
- package/components/area-chart-options.config-CiPCKvh7.cjs +20 -0
- package/components/{area-chart-options.config-Dc4P64YS.js → area-chart-options.config-HaYA8gPC.js} +34 -67
- package/components/area-chart-options.de-_tPBzxvf.cjs +20 -0
- package/components/{area-chart-options.de-DY-fWkTJ.js → area-chart-options.de-pUCTG-s0.js} +2 -0
- package/components/{area-chart-options.en-Dnm4crib.cjs → area-chart-options.en-AuSHs27k.cjs} +1 -1
- package/components/{area-chart-options.en-BwX3W0Rz.js → area-chart-options.en-YNsUeMwN.js} +2 -0
- package/components/{area-chart-options.es-DcNoi7rP.js → area-chart-options.es-2styw_Fz.js} +2 -0
- package/components/area-chart-options.es-BzRHGbo6.cjs +20 -0
- package/components/{area-chart-options.fr-T_BWw6Rr.js → area-chart-options.fr--WzQVf2z.js} +2 -0
- package/components/area-chart-options.fr-DYxUQE3x.cjs +20 -0
- package/components/{area-chart-options.nl-CbumBws7.js → area-chart-options.nl-BTEIqBtE.js} +2 -0
- package/components/area-chart-options.nl-M0xQQ_la.cjs +20 -0
- package/components/{area-chart-positioning.config-DeMlkQZO.js → area-chart-positioning.config-B2TiEOKI.js} +1 -1
- package/components/{area-chart-positioning.config-BstzDLRL.cjs → area-chart-positioning.config-CMNWsFdQ.cjs} +1 -1
- package/components/axis-options.config-BCP0Z8VI.js +270 -0
- package/components/axis-options.config-s-Js3ug-.cjs +20 -0
- package/components/axis-options.i18n-BOGRmWjp.js +486 -0
- package/components/axis-options.i18n-Cw-DmewV.cjs +20 -0
- package/components/{bar-chart-options.config-B7tknpxM.js → bar-chart-options.config--F0KfZ5y.js} +34 -75
- package/components/bar-chart-options.config-A5bcUHFc.cjs +20 -0
- package/components/{bar-chart-options.de-B3Q1SKCO.js → bar-chart-options.de-3qSh2TNr.js} +6 -6
- package/components/bar-chart-options.de-545XMRGl.cjs +20 -0
- package/components/bar-chart-options.en-DAee9yHp.cjs +20 -0
- package/components/{bar-chart-options.en-DA7MLNpQ.js → bar-chart-options.en-DrhQe9rV.js} +6 -6
- package/components/{bar-chart-options.es-Crk_EzMI.js → bar-chart-options.es-BZ1yNzUQ.js} +6 -6
- package/components/bar-chart-options.es-CfoAEZ-0.cjs +20 -0
- package/components/{bar-chart-options.fr-CMr4fQqa.js → bar-chart-options.fr-5i13R8bs.js} +6 -6
- package/components/bar-chart-options.fr-C2Ic0Dq0.cjs +20 -0
- package/components/bar-chart-options.nl-Bb6XiSDH.cjs +20 -0
- package/components/{bar-chart-options.nl-C396D-gg.js → bar-chart-options.nl-DLj-qucU.js} +6 -6
- package/components/{bar-chart-positioning.config-Cw4xXpaU.js → bar-chart-positioning.config-BrXy8UPf.js} +1 -1
- package/components/{bar-chart-positioning.config-DDKGGZhU.cjs → bar-chart-positioning.config-CfCl6YMX.cjs} +1 -1
- package/components/{base-DPqRkMth.js → base-CyMoOIH2.js} +1 -1
- package/components/{base-B0frB7oV.cjs → base-DY99ut2q.cjs} +1 -1
- package/components/{box-plot-options.config-D6Wvmx36.js → box-plot-options.config-CT4_71tE.js} +51 -78
- package/components/box-plot-options.config-ZZ_mvqGk.cjs +20 -0
- package/components/{box-plot-positioning.config-Cni8SYCB.cjs → box-plot-positioning.config-CYKg8ebh.cjs} +1 -1
- package/components/{box-plot-positioning.config-BQf8CX15.js → box-plot-positioning.config-DYHIaLKf.js} +1 -1
- package/components/bubble-chart-options.config-B_hTYgid.js +140 -0
- package/components/bubble-chart-options.config-BbB5dj43.cjs +20 -0
- package/components/{bubble-chart-positioning.config-1Q2GxFJ4.cjs → bubble-chart-positioning.config-D8uKM21g.cjs} +1 -1
- package/components/{bubble-chart-positioning.config-BYeXJRKW.js → bubble-chart-positioning.config-DW2fyRST.js} +1 -1
- package/components/{bullet-chart-options.config-B4vBSWrH.js → bullet-chart-options.config-DdTBWTAF.js} +4 -3
- package/components/bullet-chart-options.config-Drv0yQ4x.cjs +20 -0
- package/components/{bullet-chart-positioning.config-D-fuuO8D.js → bullet-chart-positioning.config-B0o0yLmt.js} +1 -1
- package/components/{bullet-chart-positioning.config-NSHvsWAf.cjs → bullet-chart-positioning.config-BZVi5Z37.cjs} +1 -1
- package/components/choropleth-map-options.config-CEGFnwKG.cjs +20 -0
- package/components/{choropleth-map-options.config-6-xaMCeR.js → choropleth-map-options.config-CsJjKLVP.js} +32 -30
- package/components/{choropleth-map-positioning.config-DZCuGwit.cjs → choropleth-map-positioning.config-ZoJMcINR.cjs} +1 -1
- package/components/{choropleth-map-positioning.config-Bk2lcbUF.js → choropleth-map-positioning.config-_cjikPvV.js} +1 -1
- package/components/circle-pack-chart-options.config-Dobt6Q5A.cjs +20 -0
- package/components/{circle-pack-chart-options.config-DWkyGqA_.js → circle-pack-chart-options.config-FcILD-Hi.js} +4 -3
- package/components/{circle-pack-chart-positioning.config-pvlFSoeh.js → circle-pack-chart-positioning.config-Bs_vUTrq.js} +1 -1
- package/components/{circle-pack-chart-positioning.config-CuESD4oH.cjs → circle-pack-chart-positioning.config-Dp14Xy4g.cjs} +1 -1
- package/components/circular-gauge-options.config-CSIUw2VN.cjs +20 -0
- package/components/circular-gauge-options.config-DtNYelhq.js +193 -0
- package/components/{circular-gauge-positioning.config-DIYxTFVO.cjs → circular-gauge-positioning.config-Bon_UJ9A.cjs} +1 -1
- package/components/{circular-gauge-positioning.config-BI5_9VzK.js → circular-gauge-positioning.config-Bsshd-zZ.js} +1 -1
- package/components/{column-chart-options.config-B_a7iN-c.js → column-chart-options.config-BzMjdyfp.js} +34 -75
- package/components/column-chart-options.config-iKKyzY3j.cjs +20 -0
- package/components/column-chart-options.de-BX13JkAO.cjs +20 -0
- package/components/{column-chart-options.de-vSfQkMVy.js → column-chart-options.de-CIYtauiG.js} +6 -6
- package/components/{column-chart-options.en-C2DVLfDZ.js → column-chart-options.en-BkAsfXYV.js} +6 -6
- package/components/column-chart-options.en-DAee9yHp.cjs +20 -0
- package/components/column-chart-options.es-CClMQLE-.cjs +20 -0
- package/components/{column-chart-options.es-CmZmT22A.js → column-chart-options.es-jWM7TxS7.js} +6 -6
- package/components/{column-chart-options.fr-UmB2ifIT.js → column-chart-options.fr-BB6301nS.js} +6 -6
- package/components/column-chart-options.fr-C2Ic0Dq0.cjs +20 -0
- package/components/column-chart-options.nl-Bb6XiSDH.cjs +20 -0
- package/components/{column-chart-options.nl-DRrIt7sx.js → column-chart-options.nl-HUMDgKdl.js} +6 -6
- package/components/{column-chart-positioning.config-CoekgrWc.js → column-chart-positioning.config-BrSD_Vrd.js} +1 -1
- package/components/{column-chart-positioning.config-F5liDplz.cjs → column-chart-positioning.config-DUcXbA1k.cjs} +1 -1
- package/components/{combination-chart-options.config-l4szBpws.js → combination-chart-options.config-BEMnrQdd.js} +46 -62
- package/components/combination-chart-options.config-BqQlqnhf.cjs +20 -0
- package/components/{combination-chart-options.de-BExnOCui.cjs → combination-chart-options.de-BiGjuWUS.cjs} +1 -1
- package/components/{combination-chart-options.de-BdV-j9VK.js → combination-chart-options.de-DVJ9sfLC.js} +2 -0
- package/components/{combination-chart-options.en-DquyU8wD.js → combination-chart-options.en-B5piXq82.js} +2 -0
- package/components/{combination-chart-options.en-iAkhHGFR.cjs → combination-chart-options.en-e4XMalU0.cjs} +1 -1
- package/components/{combination-chart-options.es-Oz29P_Vd.js → combination-chart-options.es-BmuyyP32.js} +2 -0
- package/components/{combination-chart-options.es-B2piaL6n.cjs → combination-chart-options.es-OXb8nozF.cjs} +1 -1
- package/components/{combination-chart-options.fr-L6m-7FiZ.js → combination-chart-options.fr-CIrnpWEu.js} +2 -0
- package/components/{combination-chart-options.fr-BEA5mDGS.cjs → combination-chart-options.fr-CYzANyZs.cjs} +1 -1
- package/components/{combination-chart-options.nl-DJDH3K_U.js → combination-chart-options.nl-BDJ7t0BY.js} +2 -0
- package/components/{combination-chart-options.nl-DDyajIyP.cjs → combination-chart-options.nl-DyAUjvqC.cjs} +1 -1
- package/components/{combination-chart-positioning.config-BIqhiqPc.cjs → combination-chart-positioning.config-DHvp-1kZ.cjs} +1 -1
- package/components/{combination-chart-positioning.config-gfmXofUL.js → combination-chart-positioning.config-DIWEeLYk.js} +1 -1
- package/components/conditional-number-options.config-ZVtstIjn.cjs +20 -0
- package/components/conditional-number-options.config-qdX9T4zu.js +210 -0
- package/components/{conditional-number-positioning.config-DoA_qMvA.js → conditional-number-positioning.config-BFzK6gRk.js} +1 -1
- package/components/{conditional-number-positioning.config-7xN8yNaC.cjs → conditional-number-positioning.config-BgKxHoAw.cjs} +1 -1
- package/components/data-field/index.cjs +1 -1
- package/components/data-field/index.js +1 -1
- package/components/{data-field-Ccsjj3o5.js → data-field-C_rVntAB.js} +3 -3
- package/components/{data-field-CZGdgBd7.cjs → data-field-LCJaGHTs.cjs} +1 -1
- package/components/data-field-level/index.cjs +1 -1
- package/components/data-field-level/index.js +1 -1
- package/components/{data-field-level-BautlamO.js → data-field-level-Bq4m_uay.js} +1 -1
- package/components/{data-field-level-DDYutkKV.cjs → data-field-level-DIS8fBDr.cjs} +1 -1
- package/components/data-field-panel/index.cjs +1 -1
- package/components/data-field-panel/index.js +1 -1
- package/components/{data-field-panel-COHppDw6.js → data-field-panel-B7CqUPNc.js} +3 -3
- package/components/{data-field-panel-B9aYsBfe.cjs → data-field-panel-DWRs7buc.cjs} +1 -1
- package/components/data-fields-select/index.cjs +1 -1
- package/components/data-fields-select/index.js +1 -1
- package/components/{data-fields-select-CvdABHum.js → data-fields-select-20qMlApt.js} +1 -1
- package/components/{data-fields-select-BMDWXAMz.cjs → data-fields-select-CGtDf-oP.cjs} +1 -1
- package/components/dataset-selector-list/dataset-selector-list.d.ts +6 -2
- package/components/dataset-selector-list/index.cjs +1 -1
- package/components/dataset-selector-list/index.js +1 -1
- package/components/{dataset-selector-list-yU9o-gBK.js → dataset-selector-list-DBLtXZrx.js} +14 -4
- package/components/{dataset-selector-list-CekhYtbU.cjs → dataset-selector-list-HHKokk1u.cjs} +2 -2
- package/components/dataset-selector-row/dataset-selector-row.d.ts +35 -7
- package/components/dataset-selector-row/index.cjs +1 -1
- package/components/dataset-selector-row/index.d.ts +1 -0
- package/components/dataset-selector-row/index.js +1 -1
- package/components/dataset-selector-row-BR5fZlp0.js +417 -0
- package/components/dataset-selector-row-D9cQeVQi.cjs +102 -0
- package/components/{de-CbIHJOex.js → de-CSvZ1Nhx.js} +3 -1
- package/components/de-CfAVa2SD.cjs +20 -0
- package/components/display-settings/index.cjs +1 -1
- package/components/display-settings/index.js +1 -1
- package/components/{display-settings-B_sY5MXH.cjs → display-settings-0-94VuDl.cjs} +1 -1
- package/components/{display-settings-DpPSk_da.js → display-settings-BB7xS-BO.js} +2 -2
- package/components/display-settings-binning/index.cjs +1 -1
- package/components/display-settings-binning/index.js +1 -1
- package/components/{display-settings-binning-w2pMC3eK.js → display-settings-binning-BdwOpAPi.js} +2 -2
- package/components/{display-settings-binning-BGYyLt7_.cjs → display-settings-binning-CgfWIih3.cjs} +1 -1
- package/components/display-settings-datetime/index.cjs +1 -1
- package/components/display-settings-datetime/index.js +1 -1
- package/components/{display-settings-datetime-l9LWhG3c.cjs → display-settings-datetime-BS7mUN1_.cjs} +1 -1
- package/components/{display-settings-datetime-Ditc8j2_.js → display-settings-datetime-CHZ9PRGK.js} +2 -2
- package/components/display-settings-grand-totals/index.cjs +1 -1
- package/components/display-settings-grand-totals/index.js +1 -1
- package/components/{display-settings-grand-totals-HcJLxYe2.js → display-settings-grand-totals-BLEb1hLW.js} +2 -2
- package/components/{display-settings-grand-totals-D-_CQpBV.cjs → display-settings-grand-totals-CzLxqBqm.cjs} +1 -1
- package/components/display-settings-numeric/index.cjs +1 -1
- package/components/display-settings-numeric/index.js +1 -1
- package/components/{display-settings-numeric-CShtLo7v.cjs → display-settings-numeric-0rg03IAh.cjs} +1 -1
- package/components/{display-settings-numeric-FWO7hFLp.js → display-settings-numeric-cJJcpFQf.js} +2 -2
- package/components/display-settings-period-over-period/index.cjs +1 -1
- package/components/display-settings-period-over-period/index.js +1 -1
- package/components/{display-settings-period-over-period-B1dHBjlg.js → display-settings-period-over-period-B4f8fbWG.js} +2 -2
- package/components/{display-settings-period-over-period-BdBYrWwJ.cjs → display-settings-period-over-period-DC3KxRpN.cjs} +1 -1
- package/components/donut-chart-options.config-D5Wkh0nh.js +212 -0
- package/components/donut-chart-options.config-DUIE-bdr.cjs +20 -0
- package/components/{donut-chart-positioning.config-DsHR-HET.cjs → donut-chart-positioning.config-BsKp1HXE.cjs} +1 -1
- package/components/{donut-chart-positioning.config-B-CWvQDP.js → donut-chart-positioning.config-DdDed2_1.js} +1 -1
- package/components/es-B-pveTvx.cjs +20 -0
- package/components/{es-bVLNpB-8.js → es-DvViVwvd.js} +3 -1
- package/components/evolution-number-options.config-CoGBgLLw.cjs +20 -0
- package/components/{evolution-number-options.config-C3tU650w.js → evolution-number-options.config-DT7iGQA8.js} +5 -3
- package/components/{evolution-number-positioning.config-DWJlecZ8.cjs → evolution-number-positioning.config-CYyOIuVk.cjs} +1 -1
- package/components/{evolution-number-positioning.config-DogBtixy.js → evolution-number-positioning.config-VL8htBRQ.js} +1 -1
- package/components/filter-expression-picker/index.cjs +1 -1
- package/components/filter-expression-picker/index.js +1 -1
- package/components/{filter-expression-picker-vZcmpdhp.js → filter-expression-picker-BrUtAgn8.js} +1 -1
- package/components/{filter-expression-picker-Dtd04YHa.cjs → filter-expression-picker-FKIEpvg6.cjs} +1 -1
- package/components/filter-item/index.cjs +1 -1
- package/components/filter-item/index.js +1 -1
- package/components/{filter-item-DhWm1nZ2.js → filter-item-BZbHQx0n.js} +5 -5
- package/components/{filter-item-QGXrunyl.cjs → filter-item-C8tt3MFg.cjs} +1 -1
- package/components/filter-parameter-picker/index.cjs +1 -1
- package/components/filter-parameter-picker/index.js +1 -1
- package/components/{filter-parameter-picker-_KpPQvwJ.cjs → filter-parameter-picker-msFqEEAh.cjs} +1 -1
- package/components/{filter-parameter-picker-Dq7rskJq.js → filter-parameter-picker-pioi6px3.js} +1 -1
- package/components/filter-value-picker/index.cjs +1 -1
- package/components/filter-value-picker/index.js +1 -1
- package/components/{filter-value-picker-DUPgUphE.cjs → filter-value-picker-CgLTYLwU.cjs} +1 -1
- package/components/{filter-value-picker-DL-XI9zN.js → filter-value-picker-Drt9dOXf.js} +4 -4
- package/components/filter-value-picker-datetime/index.cjs +1 -1
- package/components/filter-value-picker-datetime/index.js +1 -1
- package/components/{filter-value-picker-datetime-DrtBsmhk.js → filter-value-picker-datetime-B0o4rlXW.js} +1 -1
- package/components/{filter-value-picker-datetime-BYosmOVo.cjs → filter-value-picker-datetime-D5W0j1CH.cjs} +1 -1
- package/components/filter-value-picker-hierarchy/index.cjs +1 -1
- package/components/filter-value-picker-hierarchy/index.js +1 -1
- package/components/{filter-value-picker-hierarchy-Co7tEAF0.cjs → filter-value-picker-hierarchy-B1dnC37T.cjs} +1 -1
- package/components/{filter-value-picker-hierarchy-D9HPNjXi.js → filter-value-picker-hierarchy-BiUz-XXQ.js} +2 -2
- package/components/filter-value-picker-numeric/index.cjs +1 -1
- package/components/filter-value-picker-numeric/index.js +1 -1
- package/components/{filter-value-picker-numeric-BCaSriJT.cjs → filter-value-picker-numeric-BIvL94I1.cjs} +1 -1
- package/components/{filter-value-picker-numeric-CLRBOcom.js → filter-value-picker-numeric-BU7p1q3J.js} +1 -1
- package/components/filters/index.cjs +1 -1
- package/components/filters/index.js +1 -1
- package/components/{filters-hIID3Ol5.js → filters-Bq4S-VeF.js} +2 -2
- package/components/{filters-DPh6G5_6.cjs → filters-CC1WEkUl.cjs} +1 -1
- package/components/formula/index.cjs +1 -1
- package/components/formula/index.js +1 -1
- package/components/{formula-DJa0m0vt.cjs → formula-DzlOfUfI.cjs} +1 -1
- package/components/{formula-D6fZk242.js → formula-_2SPG88m.js} +2 -2
- package/components/{formula-codemirror-ClMjdWte.cjs → formula-codemirror-BXT_tfaJ.cjs} +1 -1
- package/components/{formula-codemirror-CS38irmY.js → formula-codemirror-CLm2OLSy.js} +4 -4
- package/components/{formula-display-store-riWDbPmO.cjs → formula-display-store-DBdEPEdf.cjs} +1 -1
- package/components/{formula-display-store-BVCcrqMB.js → formula-display-store-nqONAx35.js} +3 -3
- package/components/formula-editor/index.cjs +1 -1
- package/components/formula-editor/index.js +3 -3
- package/components/{formula-editor-C63ifj9i.js → formula-editor-B65HPmmh.js} +5 -5
- package/components/{formula-editor-KuJjGn6h.cjs → formula-editor-DEo-RcGC.cjs} +1 -1
- package/components/formula-field/index.cjs +1 -1
- package/components/formula-field/index.js +1 -1
- package/components/{formula-field-CZu-WBKI.js → formula-field-CXCuJ_sa.js} +1 -1
- package/components/{formula-field-BIseRR26.cjs → formula-field-DpPBypCh.cjs} +1 -1
- package/components/{formula-input-base-DhhV4mbQ.js → formula-input-base-DmjxzsEi.js} +1 -1
- package/components/{formula-input-base-B1D56Klw.cjs → formula-input-base-yBcGx5Oa.cjs} +1 -1
- package/components/{fr-BVATPudG.js → fr-CkDebjRX.js} +3 -1
- package/components/fr-CtsqUcEa.cjs +20 -0
- package/components/funnel-chart-options.config-CMOM4QN2.cjs +20 -0
- package/components/{funnel-chart-options.config-6ifTq7Xh.js → funnel-chart-options.config-Ca5-W17F.js} +5 -3
- package/components/{funnel-chart-positioning.config-D7871iXX.js → funnel-chart-positioning.config-BU7QpgsX.js} +1 -1
- package/components/{funnel-chart-positioning.config-DswPJ8VG.cjs → funnel-chart-positioning.config-DbpJfDa2.cjs} +1 -1
- package/components/get-dataset-name-Dgmhqlon.cjs +20 -0
- package/components/{get-dataset-name-CXdZ2oH_.js → get-dataset-name-ffz-R0AZ.js} +9 -4
- package/components/{groupings-BwzDflId.js → groupings-DBsH-kNN.js} +1 -1
- package/components/{groupings-Dt2yC9fH.cjs → groupings-DH6XUvSc.cjs} +1 -1
- package/components/guidelines-options.config-D-ZuReR_.cjs +20 -0
- package/components/guidelines-options.config-DyedEeX2.js +48 -0
- package/components/{heat-map-options.config-CezceVM3.js → heat-map-options.config-DkuYkbWu.js} +29 -27
- package/components/heat-map-options.config-DtDh9Gpy.cjs +20 -0
- package/components/{heat-map-positioning.config-sZTsAUnf.js → heat-map-positioning.config-DHO5wFHL.js} +1 -1
- package/components/{heat-map-positioning.config-C9xyxr1p.cjs → heat-map-positioning.config-DkQjSPaE.cjs} +1 -1
- package/components/{heat-table-options.config-C7kvRE10.js → heat-table-options.config-DT3d8VS7.js} +49 -154
- package/components/heat-table-options.config-Dl6GDA-m.cjs +20 -0
- package/components/{heat-table-positioning.config-DSsD8apM.js → heat-table-positioning.config-BrJkuNbc.js} +1 -1
- package/components/{heat-table-positioning.config-B5XgRMIn.cjs → heat-table-positioning.config-mw5AsGAJ.cjs} +1 -1
- package/components/hexbin-map-options.config-BGmgxnMh.cjs +20 -0
- package/components/{hexbin-map-options.config-8brGMkt_.js → hexbin-map-options.config-Bqp3u2bH.js} +16 -14
- package/components/{hexbin-map-positioning.config-Dc9wAdAv.js → hexbin-map-positioning.config-D5hP-can.js} +1 -1
- package/components/{hexbin-map-positioning.config-Dq2TuFz1.cjs → hexbin-map-positioning.config-DLYBOrHE.cjs} +1 -1
- package/components/index.cjs +1 -1
- package/components/index.js +54 -54
- package/components/info-tooltip-options.config-B9T0cwSM.cjs +20 -0
- package/components/info-tooltip-options.config-BmSMkirf.js +59 -0
- package/components/info-tooltip-options.i18n-B3u0H74j.cjs +20 -0
- package/components/info-tooltip-options.i18n-CDx47Py-.js +74 -0
- package/components/interactive-viz-item/index.cjs +1 -1
- package/components/interactive-viz-item/index.js +1 -1
- package/components/{interactive-viz-item-Bn9IhEvD.cjs → interactive-viz-item-CAuKz5tw.cjs} +1 -1
- package/components/{interactive-viz-item-CXHq9Csp.js → interactive-viz-item-rLknJxre.js} +5 -5
- package/components/item-grid/index.cjs +1 -1
- package/components/item-grid/index.js +1 -1
- package/components/{item-grid-B8tT6ztQ.cjs → item-grid-Bd3rXwND.cjs} +1 -1
- package/components/{item-grid-D7b0blK6.js → item-grid-jF9cv8_u.js} +1 -1
- package/components/item-option/index.cjs +1 -1
- package/components/item-option/index.js +1 -1
- package/components/{item-option-Dc4GNRMW.js → item-option-3sEzoA0L.js} +88 -72
- package/components/{item-option-dwknAAj9.cjs → item-option-DO2oJXcs.cjs} +1 -1
- package/components/item-option-action-button-group/index.cjs +1 -1
- package/components/item-option-action-button-group/index.js +1 -1
- package/components/{item-option-action-button-group-BhC0n29i.js → item-option-action-button-group-C4SxsHUp.js} +1 -1
- package/components/{item-option-action-button-group-BOOW6k_j.cjs → item-option-action-button-group-CebgGfxf.cjs} +1 -1
- package/components/{item-option-base-D1xRkleX.cjs → item-option-base-Gj1YRrI9.cjs} +1 -1
- package/components/{item-option-base-IMMzUkdt.js → item-option-base-Ierh9O_y.js} +1 -1
- package/components/item-option-color-palette-picker/index.cjs +1 -1
- package/components/item-option-color-palette-picker/index.js +1 -1
- package/components/{item-option-color-palette-picker-D6xT_kWC.js → item-option-color-palette-picker-CmD83j4z.js} +1 -1
- package/components/{item-option-color-palette-picker-DBqNzR3N.cjs → item-option-color-palette-picker-DXbPf9W-.cjs} +1 -1
- package/components/item-option-color-picker/index.cjs +1 -1
- package/components/item-option-color-picker/index.js +1 -1
- package/components/{item-option-color-picker-7Dth27ei.js → item-option-color-picker-DPOYXmqG.js} +1 -1
- package/components/{item-option-color-picker-BqjtUtrr.cjs → item-option-color-picker-DctZh5Mm.cjs} +1 -1
- package/components/item-option-color-range/index.cjs +1 -1
- package/components/item-option-color-range/index.js +1 -1
- package/components/{item-option-color-range-Cz1LuJmy.cjs → item-option-color-range-9v7VYG0c.cjs} +1 -1
- package/components/{item-option-color-range-Cj5tryJo.js → item-option-color-range-DEOogOTv.js} +1 -1
- package/components/item-option-guidelines/index.cjs +1 -1
- package/components/item-option-guidelines/index.js +1 -1
- package/components/{item-option-guidelines-8v9MZ0FH.js → item-option-guidelines-B115G2nq.js} +3 -3
- package/components/{item-option-guidelines-CgJEAiF5.cjs → item-option-guidelines-Bpg1RZ8x.cjs} +1 -1
- package/components/item-option-multi-language-field/index.cjs +1 -1
- package/components/item-option-multi-language-field/index.js +1 -1
- package/components/{item-option-multi-language-field-BkqcX9zw.js → item-option-multi-language-field-B-u0bans.js} +1 -1
- package/components/{item-option-multi-language-field-D9NK-noK.cjs → item-option-multi-language-field-DBBhowms.cjs} +1 -1
- package/components/item-option-number-field/index.cjs +1 -1
- package/components/item-option-number-field/index.js +1 -1
- package/components/{item-option-number-field-BXZD_sC2.cjs → item-option-number-field-DMy08TP2.cjs} +1 -1
- package/components/{item-option-number-field-DHl0phm5.js → item-option-number-field-DkYnFmJW.js} +1 -1
- package/components/item-option-panel/index.cjs +1 -1
- package/components/item-option-panel/index.js +1 -1
- package/components/{item-option-panel-Dv6v7RzM.cjs → item-option-panel-BNpgv1gX.cjs} +1 -1
- package/components/{item-option-panel-DIU-3auc.js → item-option-panel-Cz6GVI3l.js} +2 -2
- package/components/item-option-picker/index.cjs +1 -1
- package/components/item-option-picker/index.js +1 -1
- package/components/{item-option-picker-CmQFzBzN.js → item-option-picker-C9f4tyLr.js} +1 -1
- package/components/{item-option-picker-BUdP-MCI.cjs → item-option-picker-dmG9E9xR.cjs} +1 -1
- package/components/item-option-position-picker/index.cjs +1 -1
- package/components/item-option-position-picker/index.js +1 -1
- package/components/{item-option-position-picker-_2Dc6vhB.cjs → item-option-position-picker-CivQYly9.cjs} +1 -1
- package/components/{item-option-position-picker-CbnJ8Apk.js → item-option-position-picker-DNoDU6MW.js} +1 -1
- package/components/item-option-positions-number-field/index.cjs +1 -1
- package/components/item-option-positions-number-field/index.js +1 -1
- package/components/{item-option-positions-number-field-C41FMT4C.cjs → item-option-positions-number-field-BBkQN71c.cjs} +1 -1
- package/components/{item-option-positions-number-field-B6JzEtSc.js → item-option-positions-number-field-DyyEdaPZ.js} +1 -1
- package/components/item-option-radio-button-group/index.cjs +1 -1
- package/components/item-option-radio-button-group/index.js +1 -1
- package/components/{item-option-radio-button-group-rONmmmSf.js → item-option-radio-button-group--zidnOr9.js} +1 -1
- package/components/{item-option-radio-button-group-CjdCLmtq.cjs → item-option-radio-button-group-D0W86RmI.cjs} +1 -1
- package/components/item-option-slider/index.cjs +1 -1
- package/components/item-option-slider/index.js +1 -1
- package/components/{item-option-slider-CANy5MZL.cjs → item-option-slider-4vDy4etx.cjs} +1 -1
- package/components/{item-option-slider-slgdsaDM.js → item-option-slider-Baadoyqo.js} +1 -1
- package/components/item-option-switch/index.cjs +1 -1
- package/components/item-option-switch/index.js +1 -1
- package/components/{item-option-switch-CS6kid_8.cjs → item-option-switch-BaQDqsMY.cjs} +1 -1
- package/components/{item-option-switch-Cd9UA7J5.js → item-option-switch-CHYIbPgD.js} +1 -1
- package/components/item-option-text-field/index.cjs +1 -1
- package/components/item-option-text-field/index.js +1 -1
- package/components/{item-option-text-field-BFP8YnEc.js → item-option-text-field-CZ02qLJ4.js} +1 -1
- package/components/{item-option-text-field-6Y1zBJMK.cjs → item-option-text-field-D92viGBN.cjs} +1 -1
- package/components/item-options-configs.cjs +1 -1
- package/components/item-options-configs.js +35 -35
- package/components/item-slot-drop/index.cjs +1 -1
- package/components/item-slot-drop/index.js +1 -1
- package/components/{item-slot-drop-Ds06u_vn.cjs → item-slot-drop-BU2U3-HV.cjs} +1 -1
- package/components/{item-slot-drop-BL7DOudd.js → item-slot-drop-C1z1dxFw.js} +5 -5
- package/components/item-slot-drop-panel/index.cjs +1 -1
- package/components/item-slot-drop-panel/index.js +1 -1
- package/components/{item-slot-drop-panel-DkHylw7i.js → item-slot-drop-panel-CA9-hvpd.js} +39 -39
- package/components/{item-slot-drop-panel-D_EFyM9J.cjs → item-slot-drop-panel-CrMdoDfz.cjs} +1 -1
- package/components/item-slot-picker/index.cjs +1 -1
- package/components/item-slot-picker/index.js +1 -1
- package/components/{item-slot-picker-CywUgvNX.js → item-slot-picker-Btmi-rsC.js} +6 -6
- package/components/{item-slot-picker-BbpPIoIq.cjs → item-slot-picker-DwgJiY3S.cjs} +1 -1
- package/components/item-slot-picker-panel/index.cjs +1 -1
- package/components/item-slot-picker-panel/index.js +1 -1
- package/components/{item-slot-picker-panel-Bi8xZaYc.js → item-slot-picker-panel-BoSCNOU4.js} +3 -3
- package/components/{item-slot-picker-panel-DQLwQXdI.cjs → item-slot-picker-panel-HDUJLBsv.cjs} +1 -1
- package/components/{line-chart-options.config-OeRMkKMP.js → line-chart-options.config-BMT_e6dk.js} +49 -65
- package/components/line-chart-options.config-CL8SCDgU.cjs +20 -0
- package/components/{line-chart-options.de-DMuN0E3y.cjs → line-chart-options.de-CKbHARjX.cjs} +1 -1
- package/components/{line-chart-options.de-CihDXrQ4.js → line-chart-options.de-CtxTZ-Nx.js} +2 -0
- package/components/{line-chart-options.en-CPWllKeE.js → line-chart-options.en-BgXtU92P.js} +2 -0
- package/components/{line-chart-options.en-81dHDKJE.cjs → line-chart-options.en-DmtT3Hbw.cjs} +1 -1
- package/components/{line-chart-options.es-IX7Hu1Jk.js → line-chart-options.es--u7QlrhG.js} +2 -0
- package/components/{line-chart-options.es-CshvnhMH.cjs → line-chart-options.es-BwyQviz-.cjs} +1 -1
- package/components/{line-chart-options.fr-EMHHZpiy.cjs → line-chart-options.fr-BUwOFGR7.cjs} +1 -1
- package/components/{line-chart-options.fr-CkLIbP6Y.js → line-chart-options.fr-BaPc1M70.js} +2 -0
- package/components/{line-chart-options.nl-C9FWbWJy.cjs → line-chart-options.nl-BkPXShNF.cjs} +1 -1
- package/components/{line-chart-options.nl-Du2kphsn.js → line-chart-options.nl-C86fSn7a.js} +2 -0
- package/components/{line-chart-positioning.config-CCsZMpp-.cjs → line-chart-positioning.config-BEf1yZXt.cjs} +1 -1
- package/components/{line-chart-positioning.config-q_XJiQBO.js → line-chart-positioning.config-BcxVwrHz.js} +1 -1
- package/components/{localized-mixin-BbOPy_BO.cjs → localized-mixin-9QFQ92Y7.cjs} +1 -1
- package/components/{localized-mixin-D1ss6vE4.js → localized-mixin-BXDzTsZA.js} +1 -1
- package/components/marker-map-options.config-BE8GnY_T.js +122 -0
- package/components/marker-map-options.config-SkhbtEh0.cjs +20 -0
- package/components/{marker-map-positioning.config-B4GDDPUn.cjs → marker-map-positioning.config-CrtimrEf.cjs} +1 -1
- package/components/{marker-map-positioning.config-qEo6YbOG.js → marker-map-positioning.config-DgjLNbIX.js} +1 -1
- package/components/nl-C6_ScX0J.cjs +20 -0
- package/components/{nl-D6PNT9zh.js → nl-b0wCsQJf.js} +3 -1
- package/components/ohlc-chart-options.config-BAB4pyo9.js +89 -0
- package/components/{bullet-chart-options.config-B2afO5Xh.cjs → ohlc-chart-options.config-BrcfGxDw.cjs} +1 -1
- package/components/{ohlc-chart-options.de-DqGHkVNG.cjs → ohlc-chart-options.de-DtanuVcU.cjs} +1 -1
- package/components/{ohlc-chart-options.de-Brd2iN0B.js → ohlc-chart-options.de-LnJmQjiR.js} +2 -0
- package/components/{ohlc-chart-options.en-C3AWmo7s.js → ohlc-chart-options.en-B7TU8CK4.js} +2 -0
- package/components/{ohlc-chart-options.en-DrWja-A6.cjs → ohlc-chart-options.en-CStPyUia.cjs} +1 -1
- package/components/{ohlc-chart-options.es-Cwl_vxNQ.js → ohlc-chart-options.es-B7m8-_pA.js} +2 -0
- package/components/{ohlc-chart-options.es-Cac117z2.cjs → ohlc-chart-options.es-CfTI32Rg.cjs} +1 -1
- package/components/{ohlc-chart-options.fr-DJuaTjBf.cjs → ohlc-chart-options.fr-C53gRLh5.cjs} +1 -1
- package/components/{ohlc-chart-options.fr-STOjKGOk.js → ohlc-chart-options.fr-u_Bi9raw.js} +2 -0
- package/components/{ohlc-chart-options.nl-CV0A0J84.js → ohlc-chart-options.nl-BrpwjNGt.js} +2 -0
- package/components/{ohlc-chart-options.nl-C7_qhngI.cjs → ohlc-chart-options.nl-Dh9iPIWB.cjs} +1 -1
- package/components/{ohlc-chart-positioning.config-TquTA1gZ.cjs → ohlc-chart-positioning.config-BXQ8AWsP.cjs} +1 -1
- package/components/{ohlc-chart-positioning.config-CU7qaa8y.js → ohlc-chart-positioning.config-BvvfmqTO.js} +1 -1
- package/components/{parallel-coordinates-plot-options.config-Bw8T5EE4.js → parallel-coordinates-plot-options.config-BXsg-9wF.js} +4 -3
- package/components/parallel-coordinates-plot-options.config-DFRL952-.cjs +20 -0
- package/components/{parallel-coordinates-plot-positioning.config-DuQWnPKv.js → parallel-coordinates-plot-positioning.config-BH-BVeJ1.js} +1 -1
- package/components/{parallel-coordinates-plot-positioning.config-C8_F3uzs.cjs → parallel-coordinates-plot-positioning.config-afRUNe2y.cjs} +1 -1
- package/components/pivot-table-options.config-B9ZfmFZH.cjs +20 -0
- package/components/{pivot-table-options.config-gL2C_zvT.js → pivot-table-options.config-tf8f5F-n.js} +5 -3
- package/components/{pivot-table-positioning.config-B6ra1dbJ.js → pivot-table-positioning.config-BSYXa5pV.js} +1 -1
- package/components/{pivot-table-positioning.config-DhtDGn-Z.cjs → pivot-table-positioning.config-Dd_pHhFz.cjs} +1 -1
- package/components/{pyramid-chart-options.config-348RYXh8.js → pyramid-chart-options.config-BnCfeT-K.js} +19 -61
- package/components/pyramid-chart-options.config-LSOc6ALz.cjs +20 -0
- package/components/{pyramid-chart-positioning.config-C_KASxlG.js → pyramid-chart-positioning.config-BLWa7sSn.js} +1 -1
- package/components/{pyramid-chart-positioning.config-5bWhJBP_.cjs → pyramid-chart-positioning.config-CQIxlqqB.cjs} +1 -1
- package/components/radar-chart-options.config-B5WP2MPc.cjs +20 -0
- package/components/{radar-chart-options.config-BeGjchnc.js → radar-chart-options.config-DrNyOkHq.js} +7 -5
- package/components/{radar-chart-positioning.config-l6ioKbxT.js → radar-chart-positioning.config-C8lJliO6.js} +1 -1
- package/components/{radar-chart-positioning.config-D2NVgsg1.cjs → radar-chart-positioning.config-Dl25YwXp.cjs} +1 -1
- package/components/regular-table-options.config-CweBtAvm.js +153 -0
- package/components/regular-table-options.config-nBBnO4ru.cjs +20 -0
- package/components/route-map-options.config-DS9cCAQK.cjs +20 -0
- package/components/{route-map-options.config-DWG5127-.js → route-map-options.config-DXHqb8Ve.js} +39 -37
- package/components/{route-map-positioning.config-HDuhd3TI.js → route-map-positioning.config-CKX0xBYP.js} +1 -1
- package/components/{route-map-positioning.config-5Xju6VM-.cjs → route-map-positioning.config-zP_Dowc9.cjs} +1 -1
- package/components/{sankey-diagram-options.config-DW72WBKU.js → sankey-diagram-options.config-CpNK2oK6.js} +5 -3
- package/components/sankey-diagram-options.config-CuKQOPPW.cjs +20 -0
- package/components/{sankey-diagram-positioning.config-BXseVUED.cjs → sankey-diagram-positioning.config-Cxx05iu7.cjs} +1 -1
- package/components/{sankey-diagram-positioning.config-BKeksOQ2.js → sankey-diagram-positioning.config-wXM60Kuq.js} +1 -1
- package/components/scatter-plot-options.config-BA_hVuhw.js +128 -0
- package/components/scatter-plot-options.config-C-L2dJ2o.cjs +20 -0
- package/components/scatter-plot-options.de-3CPVK7Hi.cjs +20 -0
- package/components/{scatter-plot-options.de-BO73A_o5.js → scatter-plot-options.de-CNLrv6j3.js} +3 -0
- package/components/{scatter-plot-options.en-B6S8Yf66.js → scatter-plot-options.en-DigMzpQy.js} +3 -0
- package/components/{scatter-plot-options.en-SuHaPKPZ.cjs → scatter-plot-options.en-Dzvigy8-.cjs} +1 -1
- package/components/scatter-plot-options.es-C-IH7GVH.cjs +20 -0
- package/components/{scatter-plot-options.es-jbzKhq4S.js → scatter-plot-options.es-CQm_VVqJ.js} +3 -0
- package/components/scatter-plot-options.fr-Cdp6kPQi.cjs +20 -0
- package/components/{scatter-plot-options.fr-DMFP8FB4.js → scatter-plot-options.fr-s0M39VT4.js} +3 -0
- package/components/{scatter-plot-options.nl-BqN6XbnS.js → scatter-plot-options.nl-CqpPIO03.js} +3 -0
- package/components/scatter-plot-options.nl-DeINlMqc.cjs +20 -0
- package/components/{scatter-plot-positioning.config-Ci_UFZZ7.cjs → scatter-plot-positioning.config-6-jx5GCk.cjs} +1 -1
- package/components/{scatter-plot-positioning.config-MFGPELRh.js → scatter-plot-positioning.config-CnssCu8h.js} +1 -1
- package/components/{set-locale-B91FmqSp.js → set-locale-BHxiIDi2.js} +4 -4
- package/components/{set-locale-8XQ-p5_N.cjs → set-locale-CZowB-SY.cjs} +1 -1
- package/components/{slicer-filter-positioning.config-C2w10p-X.cjs → slicer-filter-positioning.config-5kOSDaxQ.cjs} +1 -1
- package/components/{slicer-filter-positioning.config-CKyzt_nF.js → slicer-filter-positioning.config-LR36iXmI.js} +1 -1
- package/components/slot-menu/index.cjs +1 -1
- package/components/slot-menu/index.js +1 -1
- package/components/{slot-menu-7Lsnn5mp.cjs → slot-menu-BALLbLoG.cjs} +1 -1
- package/components/{slot-menu-JcmVjv2g.js → slot-menu-CQ440_t5.js} +3 -3
- package/components/slot-menu-list/index.cjs +1 -1
- package/components/slot-menu-list/index.js +1 -1
- package/components/{slot-menu-list-tyN6sguq.cjs → slot-menu-list-BI1x89t3.cjs} +1 -1
- package/components/{slot-menu-list-Bcm2lpwi.js → slot-menu-list-C2gWKwVd.js} +1 -1
- package/components/speedometer-chart-options.config-CEIZfeYG.cjs +20 -0
- package/components/speedometer-chart-options.config-dsUupCqm.js +251 -0
- package/components/{speedometer-chart-positioning.config-BEWibjyH.js → speedometer-chart-positioning.config-Dmg94Tpt.js} +1 -1
- package/components/{speedometer-chart-positioning.config-Df5CIOwp.cjs → speedometer-chart-positioning.config-RJo6zE3F.cjs} +1 -1
- package/components/spike-map-options.config-BRwdTyrp.cjs +20 -0
- package/components/{spike-map-options.config-Ch0p9Q5l.js → spike-map-options.config-Dh4Ky5ZP.js} +42 -40
- package/components/{spike-map-positioning.config-CdT1dVMG.js → spike-map-positioning.config-Ceyd_KZR.js} +1 -1
- package/components/{spike-map-positioning.config-C6aRn7nn.cjs → spike-map-positioning.config-CxQLToDu.cjs} +1 -1
- package/components/strip-plot-options.config-DpRoR04b.cjs +20 -0
- package/components/{strip-plot-options.config-WICS2rnK.js → strip-plot-options.config-Vw3GoLef.js} +4 -3
- package/components/{strip-plot-positioning.config-DXJci5zk.cjs → strip-plot-positioning.config-DSRWJqxs.cjs} +1 -1
- package/components/{strip-plot-positioning.config-B8vN0A44.js → strip-plot-positioning.config-Dm3F1gk3.js} +1 -1
- package/components/{sunburst-chart-options.config-Bz-jP-gZ.js → sunburst-chart-options.config-0GUoeJMb.js} +5 -3
- package/components/sunburst-chart-options.config-CCNYG73m.cjs +20 -0
- package/components/{sunburst-chart-positioning.config-D-qWT3sC.js → sunburst-chart-positioning.config-B_dzmryh.js} +1 -1
- package/components/{sunburst-chart-positioning.config-XfxGkqp6.cjs → sunburst-chart-positioning.config-eJm51jNd.cjs} +1 -1
- package/components/symbol-map-options.config-Ce0Kv7N7.cjs +20 -0
- package/components/{symbol-map-options.config-I89tFJUU.js → symbol-map-options.config-Dultd0tF.js} +7 -5
- package/components/{symbol-map-positioning.config-BB8-Feba.cjs → symbol-map-positioning.config-BgAOtKCY.cjs} +1 -1
- package/components/{symbol-map-positioning.config-CAC8XCec.js → symbol-map-positioning.config-DnRK53sm.js} +1 -1
- package/components/treemap-chart-options.config-CtpfX7hs.js +209 -0
- package/components/treemap-chart-options.config-pA93-9cX.cjs +20 -0
- package/components/{treemap-chart-positioning.config-Daf9Kk3k.cjs → treemap-chart-positioning.config-BAeW42r1.cjs} +1 -1
- package/components/{treemap-chart-positioning.config-CJKe5rf1.js → treemap-chart-positioning.config-BaK7GoAz.js} +1 -1
- package/components/utils/base.cjs +1 -1
- package/components/utils/base.js +2 -2
- package/components/{utils-BMmRy1Nn.js → utils-5XxVlM3x.js} +1 -1
- package/components/{utils-D9CBsoMV.cjs → utils-CNtoiiWk.cjs} +1 -1
- package/components/utils.cjs +1 -1
- package/components/utils.js +2 -2
- package/components/{venn-diagram-positioning.config-DqxSgLGR.cjs → venn-diagram-positioning.config-ClSeknwP.cjs} +1 -1
- package/components/{venn-diagram-positioning.config-8pfbiReM.js → venn-diagram-positioning.config-Co6TTZdV.js} +1 -1
- package/components/viz-item-menu/index.cjs +1 -1
- package/components/viz-item-menu/index.js +1 -1
- package/components/{viz-item-menu-BSkDsdNg.cjs → viz-item-menu-MRVSyXuQ.cjs} +1 -1
- package/components/{viz-item-menu-CPqpF_PR.js → viz-item-menu-Tb9YmvWX.js} +1 -1
- package/components/wordcloud-chart-options.config-ConV1s49.cjs +20 -0
- package/components/wordcloud-chart-options.config-Dxu7-YcG.js +95 -0
- package/components/{wordcloud-chart-positioning.config-DUazjx5M.js → wordcloud-chart-positioning.config-HAtoG48Z.js} +1 -1
- package/components/{wordcloud-chart-positioning.config-Cb7lzr9N.cjs → wordcloud-chart-positioning.config-f8JZ14LL.cjs} +1 -1
- package/custom-elements.json +162 -28
- package/package.json +2 -2
- package/react/components/dataset-selector-row.component.ts +8 -2
- package/react/esm/components/dataset-selector-row.component.d.ts +5 -1
- package/react/esm/components/dataset-selector-row.component.js +5 -1
- package/react/luzmo-stub.d.ts +1 -0
- package/react/package.json +2 -2
- package/types/agent.types.d.ts +4 -0
- package/types.d.ts +1 -0
- package/utils/formatter/get-localized-name.d.ts +4 -0
- package/utils/formatter/tests/get-localized-name.test.d.ts +1 -0
- package/components/ai-interaction-textarea-CJO50_1F.cjs +0 -95
- package/components/area-chart-options.config-N24pwyqX.cjs +0 -20
- package/components/area-chart-options.de-C2WwBf7L.cjs +0 -20
- package/components/area-chart-options.es-CMcI1TAb.cjs +0 -20
- package/components/area-chart-options.fr-CHeI4bKx.cjs +0 -20
- package/components/area-chart-options.nl-BM7u0iDj.cjs +0 -20
- package/components/bar-chart-options.config-DnNGu3RV.cjs +0 -20
- package/components/bar-chart-options.de-BZ3uW1-o.cjs +0 -20
- package/components/bar-chart-options.en-YNlXBbD4.cjs +0 -20
- package/components/bar-chart-options.es-BNeN4ThD.cjs +0 -20
- package/components/bar-chart-options.fr-Cib__mEv.cjs +0 -20
- package/components/bar-chart-options.nl-CmGjKNyC.cjs +0 -20
- package/components/box-plot-options.config-DCDHZMGK.cjs +0 -20
- package/components/bubble-chart-options.config-CDY6pFK6.js +0 -135
- package/components/bubble-chart-options.config-DjdxlwRr.cjs +0 -20
- package/components/choropleth-map-options.config-6DXYO5_E.cjs +0 -20
- package/components/circle-pack-chart-options.config-CD8MWMTw.cjs +0 -20
- package/components/circular-gauge-options.config-C0T9GkZX.cjs +0 -20
- package/components/circular-gauge-options.config-D_xHWhBy.js +0 -188
- package/components/column-chart-options.config-D6we1uLn.cjs +0 -20
- package/components/column-chart-options.de-wUcJvrrW.cjs +0 -20
- package/components/column-chart-options.en-YNlXBbD4.cjs +0 -20
- package/components/column-chart-options.es-YKftTtkL.cjs +0 -20
- package/components/column-chart-options.fr-Cib__mEv.cjs +0 -20
- package/components/column-chart-options.nl-Tg07PDkZ.cjs +0 -20
- package/components/combination-chart-options.config-C4y9E0Gr.cjs +0 -20
- package/components/conditional-number-options.config-DB4_BYN2.js +0 -205
- package/components/conditional-number-options.config-T6oXXy14.cjs +0 -20
- package/components/dataset-selector-row-Cte3skmf.cjs +0 -90
- package/components/dataset-selector-row-eb2fUxMB.js +0 -306
- package/components/de-BZnsTnT9.cjs +0 -20
- package/components/donut-chart-options.config-BhKFa3dz.cjs +0 -20
- package/components/donut-chart-options.config-CjtEDiJI.js +0 -207
- package/components/es-D3v9KL7a.cjs +0 -20
- package/components/evolution-number-options.config-CKL01dAR.cjs +0 -20
- package/components/fr-uvrkqpp_.cjs +0 -20
- package/components/funnel-chart-options.config-BOI6bzbw.cjs +0 -20
- package/components/get-dataset-name-CIt7of_Z.cjs +0 -20
- package/components/heat-map-options.config-C4lqg4Gf.cjs +0 -20
- package/components/heat-table-options.config-DiX5eL4B.cjs +0 -20
- package/components/hexbin-map-options.config-BVajY1MH.cjs +0 -20
- package/components/line-chart-options.config-CVR_mb2z.cjs +0 -20
- package/components/marker-map-options.config-CtW7nl1C.js +0 -117
- package/components/marker-map-options.config-M9BvYinR.cjs +0 -20
- package/components/nl-DwF8NHcr.cjs +0 -20
- package/components/ohlc-chart-options.config-DOqKN6ov.cjs +0 -20
- package/components/ohlc-chart-options.config-Db40TXcB.js +0 -124
- package/components/parallel-coordinates-plot-options.config--6iJkURT.cjs +0 -20
- package/components/pivot-table-options.config-DdbSCsRL.cjs +0 -20
- package/components/pyramid-chart-options.config-I2ZIo_GV.cjs +0 -20
- package/components/radar-chart-options.config-CCMh7qJG.cjs +0 -20
- package/components/regular-table-options.config-Bf0VAtT_.js +0 -148
- package/components/regular-table-options.config-DqZD5P9l.cjs +0 -20
- package/components/route-map-options.config-DVo8FTke.cjs +0 -20
- package/components/sankey-diagram-options.config-C8Gm15Mi.cjs +0 -20
- package/components/scatter-plot-options.config-CUyWy2xE.js +0 -322
- package/components/scatter-plot-options.config-Cd4DvLoN.cjs +0 -20
- package/components/scatter-plot-options.de-DO4ns5t0.cjs +0 -20
- package/components/scatter-plot-options.es-B0alrlLR.cjs +0 -20
- package/components/scatter-plot-options.fr-CkJXV4Og.cjs +0 -20
- package/components/scatter-plot-options.nl-CuhZUABa.cjs +0 -20
- package/components/speedometer-chart-options.config-CtWGujmb.js +0 -246
- package/components/speedometer-chart-options.config-e9Ktyajm.cjs +0 -20
- package/components/spike-map-options.config-D-T_kT1C.cjs +0 -20
- package/components/strip-plot-options.config-TB3rkoj2.cjs +0 -20
- package/components/sunburst-chart-options.config-BojxVGMu.cjs +0 -20
- package/components/symbol-map-options.config-BmHEhC5t.cjs +0 -20
- package/components/treemap-chart-options.config-i7BH9mNl.js +0 -204
- package/components/treemap-chart-options.config-xtu6J11C.cjs +0 -20
- package/components/wordcloud-chart-options.config-BjLJyuyw.cjs +0 -20
- package/components/wordcloud-chart-options.config-D_AhgZRs.js +0 -90
|
@@ -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-
|
|
20
|
+
const e=require("./ai-interaction-textarea-1WuexZ9Q.cjs"),t=require("./base-DY99ut2q.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={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},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(e){return!this._config.requireDataset||this._state.selectedDatasets.length>0||!!e}getAiPromptUrl(){return bn(this._config.apiUrl??`https://api.luzmo.com`,this._config.apiVersion??`0.1.0`)}buildRequestBody(e,t,n=[],r=this._config.agentId){return On(this._config.agent,{prompt:e,datasetIds:t,authKey:this._config.authKey,authToken:this._config.authToken,conversationId:this._state.conversationId,agentId:r,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,e.agentId),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(e.agentId))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,agentId:e.agentId});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,e.agentId),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 _pickedAgentId(){return this.shadowRoot?.querySelector(`luzmo-ai-interaction-textarea`)?.selectedAgent?.id}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)}_handleAgentSelected(){this._processInitialPrompt()}async _submitViaSession(e,t={}){let n=this._session.requireSession();if(!n.isDatasetRequirementMet(t.agentId))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}:{},...e.detail.selectedAgent?{agentId:e.detail.selectedAgent.id}:{}})||(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,{agentId:this._pickedAgentId})}async _processInitialPrompt(){if(!this.initialPrompt||this.initialPrompt===this._lastProcessedInitialPrompt)return;let e=this._pickedAgentId;this._session.requireSession().isDatasetRequirementMet(e)&&(this._lastProcessedInitialPrompt=this.initialPrompt,await this._submitViaSession(this.initialPrompt,{skipUserMessage:!0,agentId:e}))}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,12 @@ 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
|
-
?
|
|
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
|
+
@luzmo-agent-selected=${this._handleAgentSelected}
|
|
317
318
|
></luzmo-ai-interaction-textarea>
|
|
318
319
|
</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:`
|
|
320
|
+
`}};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}});
|
|
@@ -2,6 +2,7 @@ import '@luzmo/lucero/action-button';
|
|
|
2
2
|
import '@luzmo/lucero/icon';
|
|
3
3
|
import '@luzmo/lucero/prompt-box';
|
|
4
4
|
import { LitElement, PropertyValues, TemplateResult } from 'lit';
|
|
5
|
+
import type { Agent } from '../../types/agent.types';
|
|
5
6
|
import type { Dataset } from '../../types/dataset.types';
|
|
6
7
|
import type { PromptBoxAttachment, PromptBoxFileIcons } from './types';
|
|
7
8
|
import '../dataset-icon';
|
|
@@ -24,7 +25,7 @@ import '../dataset-selector-row';
|
|
|
24
25
|
* @property {boolean} stoppable - When true, shows a stop control while `is-generating` is true
|
|
25
26
|
* @property {string} value - The current value of the textarea (can be controlled from parent to clear or set text)
|
|
26
27
|
* @property {boolean} retain-on-submit - When true, retains the input value after submission (default: false, clears on submit)
|
|
27
|
-
* @property {boolean} require-dataset - When true, at least one dataset
|
|
28
|
+
* @property {boolean} require-dataset - When true, a selected agent or at least one selected dataset is required before the prompt can be submitted
|
|
28
29
|
* @property {boolean} allow-images - When true, enables image attachments (paste or file picker); uploads eagerly on attach
|
|
29
30
|
* @property {boolean} allow-voice-input - When true, shows Lucero mic recording and streams transcript via `POST /aidictation`
|
|
30
31
|
* @property {string[]} accepted-file-types - Accepted MIME types or extensions for attachments (e.g. `image/png`, `.webp`)
|
|
@@ -62,10 +63,14 @@ export declare class LuzmoAiInteractionTextarea extends LitElement {
|
|
|
62
63
|
* @default https://app.luzmo.com
|
|
63
64
|
*/
|
|
64
65
|
appServer: string;
|
|
66
|
+
/** When true, shows public datasets alongside the user's other datasets. */
|
|
67
|
+
includePublicDatasets: boolean;
|
|
65
68
|
/**
|
|
66
|
-
*
|
|
69
|
+
* Alias for includePublicDatasets.
|
|
70
|
+
* @deprecated Use includePublicDatasets instead.
|
|
67
71
|
*/
|
|
68
|
-
flagOpendata: boolean;
|
|
72
|
+
get flagOpendata(): boolean;
|
|
73
|
+
set flagOpendata(value: boolean);
|
|
69
74
|
/**
|
|
70
75
|
* When true, disables the entire component (sets opacity to 60% and prevents all interactions)
|
|
71
76
|
*/
|
|
@@ -84,6 +89,10 @@ export declare class LuzmoAiInteractionTextarea extends LitElement {
|
|
|
84
89
|
hideDatasetIcons: boolean;
|
|
85
90
|
/** Maximum number of selected dataset tags shown before the overflow control. */
|
|
86
91
|
maxVisibleSelectedDatasets: number;
|
|
92
|
+
/**
|
|
93
|
+
* The saved Agent the prompt is scoped to, or null
|
|
94
|
+
*/
|
|
95
|
+
selectedAgent: Agent | null;
|
|
87
96
|
/**
|
|
88
97
|
* When true, disables the "+ Add dataset" button and disables dataset pill removal
|
|
89
98
|
*/
|
|
@@ -114,7 +123,7 @@ export declare class LuzmoAiInteractionTextarea extends LitElement {
|
|
|
114
123
|
*/
|
|
115
124
|
retainOnSubmit: boolean;
|
|
116
125
|
/**
|
|
117
|
-
* When true, at least one dataset
|
|
126
|
+
* When true, a selected agent or at least one selected dataset is required before the prompt can be submitted
|
|
118
127
|
*/
|
|
119
128
|
requireDataset: boolean;
|
|
120
129
|
/** When true, enables image attachments via paste or the file picker. */
|
|
@@ -188,6 +197,8 @@ export declare class LuzmoAiInteractionTextarea extends LitElement {
|
|
|
188
197
|
private _submitPrompt;
|
|
189
198
|
private _handleDatasetSelected;
|
|
190
199
|
private _handleDatasetRemoved;
|
|
200
|
+
private _handleAgentSelected;
|
|
201
|
+
private _handleAgentRemoved;
|
|
191
202
|
private _getLocalizedFieldLabel;
|
|
192
203
|
private _mapColumnToTriggerOption;
|
|
193
204
|
private _mapFormulaToTriggerOption;
|
|
@@ -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-
|
|
20
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../ai-interaction-textarea-1WuexZ9Q.cjs");Object.defineProperty(exports,"LuzmoAiInteractionTextarea",{enumerable:!0,get:function(){return e.t}});
|
|
@@ -6,3 +6,5 @@ declare global {
|
|
|
6
6
|
}
|
|
7
7
|
export { LuzmoAiInteractionTextarea } from './ai-interaction-textarea';
|
|
8
8
|
export type { PromptBoxAttachment, PromptBoxFileIcons, PromptSubmittedEventDetail } from './types';
|
|
9
|
+
export type { Agent } from '../../types/agent.types';
|
|
10
|
+
export type { Dataset } from '../../types/dataset.types';
|
|
@@ -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-
|
|
27
|
+
import { t as e } from "../ai-interaction-textarea-BZAeZunP.js";
|
|
28
28
|
export { e as LuzmoAiInteractionTextarea };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { PromptBoxAttachment, PromptBoxFileIcons } from '@luzmo/lucero';
|
|
2
|
+
import type { Agent } from '../../types/agent.types';
|
|
2
3
|
import type { Dataset } from '../../types/dataset.types';
|
|
3
4
|
export type { PromptBoxAttachment, PromptBoxFileIcons };
|
|
4
5
|
export interface PromptSubmittedEventDetail {
|
|
5
6
|
prompt: string;
|
|
6
7
|
selectedDatasets: Dataset[];
|
|
8
|
+
selectedAgent: Agent | null;
|
|
7
9
|
attachments: PromptBoxAttachment[];
|
|
8
10
|
/** Signed image URLs from eager upload on attach, ordered to match image attachments. */
|
|
9
11
|
attachmentUrls: string[];
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/*! * A kit of modern Luzmo Web Components for analytics in your web application.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2026 Luzmo
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Luzmo web components (“Luzmo Web Components”)
|
|
6
|
+
* must be used according to the Luzmo Terms of Service.
|
|
7
|
+
* This license allows users with a current active Luzmo account
|
|
8
|
+
* to use the Luzmo Web Components. This license terminates
|
|
9
|
+
* automatically if a user no longer has an active Luzmo account.
|
|
10
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
11
|
+
*
|
|
12
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
13
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
14
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
15
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
16
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
17
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
|
+
* SOFTWARE.
|
|
19
|
+
* */
|
|
20
|
+
const e=require("./decorate-DCJt-2rt.cjs"),t=require("./set-locale-CZowB-SY.cjs"),n=require("./data-broker-CyMYR6w1.cjs"),r=require("./calculate-data-field-icon-DenGmW74.cjs"),i=require("./localize-D3i4Epy_.cjs"),a=require("./get-dataset-name-Dgmhqlon.cjs");require("./dataset-icon-BAV0S4sZ.cjs"),require("./dataset-selector-row-D9cQeVQi.cjs");let o=require("@luzmo/icons");require("@luzmo/lucero/icon");let s=require("lit"),c=require("lit/decorators.js"),l=require("@lit/localize");require("@luzmo/lucero/action-button"),require("@luzmo/lucero/prompt-box");let u=require("lit/directives/class-map.js");var d=20,f=[`image/png`,`image/jpeg`,`image/webp`,`image/gif`],p=new Set(f),m={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,webp:`image/webp`,gif:`image/gif`};function h(e){try{return new URL(e).pathname.match(/\.([a-z0-9]+)$/i)?.[1]?.toLowerCase()}catch{return}}function g(e){try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}function _(e){return p.has(e.toLowerCase())}function v(e){if(e.type)return _(e.type);let t=e.name.split(`.`).pop()?.toLowerCase();return!!(t&&m[t])}function y(e){if(!g(e))return!1;let t=h(e);return!!(t&&m[t])}function b(e){if(e.length>20)throw Error(`Too many image inputs: received ${e.length}, but the maximum is 20 per request.`);for(let t of e){if(!t.trim())throw Error(`Image input URL must be a non-empty string.`);if(!g(t))throw Error(`Image input URL must be an absolute http(s) URL. Received "${t}".`);let e=h(t);if(e&&!m[e])throw Error(`Unsupported image input URL "${t}". Only PNG, JPEG, WebP, and GIF image URLs are accepted.`)}}function x(e){if(e.length>20)throw Error(`Too many image inputs: received ${e.length}, but the maximum is 20 per request.`);for(let t of e){if(!v(t))throw Error(`Unsupported image attachment "${t.name}" (${t.type||`unknown type`}). Only PNG, JPEG, WebP, and GIF images are accepted.`);if(t.size===0)throw Error(`Image "${t.name}" is empty.`);if(t.size>15728640)throw Error(`Image "${t.name}" is too large. Maximum size is 15 MB.`)}}function S(e,t=`0.1.0`){return`${e.replace(/\/+$/,``)}/${t.replace(/^\/+|\/+$/g,``)}/upload`}function C(e){let{files:t,authKey:n,authToken:r,apiUrl:i,apiVersion:a=`0.1.0`,signal:o,fetchImpl:s=fetch}=e;if(!n||!r)return Promise.reject(Error(`Image upload requires authKey and authToken.`));let c=S(i,a),l=a.replace(/^\/+|\/+$/g,``)||`0.1.0`;return Promise.all(t.map(e=>w(e,{url:c,authKey:n,authToken:r,version:l,signal:o,fetchImpl:s})))}async function w(e,t){let{url:n,authKey:r,authToken:i,version:a,signal:o,fetchImpl:s}=t,c=new FormData;c.append(`key`,r),c.append(`token`,i),c.append(`version`,a),c.append(`action`,`create`),c.append(`properties.type`,`image`),c.append(`file`,e,e.name);let l=await s(n,{method:`POST`,body:c,signal:o,redirect:`error`});if(!l.ok){let t=await T(l);throw Error(`Image upload failed for "${e.name}" (${l.status})${t?`: ${t}`:`.`}`)}let u=await l.json(),d=typeof u?.url==`string`?u.url.trim():``;if(!d)throw Error(`Image upload for "${e.name}" did not return a url.`);return d}async function T(e){try{return(await e.text()).trim().slice(0,200)}catch{return``}}function E(e,t=`0.1.0`){return`${e.replace(/\/+$/,``)}/${t.replace(/^\/+|\/+$/g,``)}/aidictation`}function D(e){let{authKey:t,authToken:n,audioBase64:r,mimeType:i,apiVersion:a=`0.1.0`,stream:o=!0,language:s}=e;return{key:t,token:n,action:`create`,version:a,properties:{audio:r,mimetype:i,stream:o,...s?{language:s}:{}}}}async function O(e){let t=await e.arrayBuffer(),n=new Uint8Array(t),r=32768,i=``;for(let e=0;e<n.length;e+=r){let t=n.subarray(e,e+r);i+=String.fromCharCode(...t)}return btoa(i)}async function k(e){let{audioBlob:t,mimeType:n,authKey:r,authToken:i,apiUrl:a,apiVersion:o=`0.1.0`,language:s,signal:c,onDelta:l,fetchImpl:u=fetch}=e;if(!r||!i)throw Error(`Voice transcription requires authKey and authToken.`);if(!t||t.size===0)throw Error(`Voice transcription requires a non-empty audio recording.`);let d=await O(t),f=E(a,o),p=D({authKey:r,authToken:i,audioBase64:d,mimeType:n||t.type||`audio/webm`,apiVersion:o,stream:!0,language:s}),m=await u(f,{method:`POST`,headers:{"Content-Type":`application/json`},mode:`cors`,redirect:`error`,body:JSON.stringify(p),signal:c});if(!m.ok){let e=await F(m);throw Error(`Voice transcription failed (${m.status})${e?`: ${e}`:`.`}`)}if(!m.body)throw Error(`Voice transcription response body is not readable.`);await N(m.body,e=>{let t=A(e);t&&l(t)})}function A(e){return e.type===`text_delta`&&typeof e.delta==`string`?e.delta:typeof e.text_delta==`string`?e.text_delta:``}var j=/^[a-z]+:/i;function M(e){let t=e.trim();if(!t||t.startsWith(`:`))return null;let n=t;if(n.startsWith(`data:`))n=n.slice(5).trimStart();else if(j.test(n))return null;return!n||n===`[DONE]`?null:JSON.parse(n)}async function N(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)P(e,t)}i+=r.decode();let e=i.trim();e&&P(e,t)}finally{n.releaseLock()}}function P(e,t){let n=M(e);n&&t(n)}async function F(e){try{return(await e.text()).trim().slice(0,200)}catch{return``}}var I=`:host{box-sizing:border-box;display:block}:host .content-wrapper{flex-direction:column;display:flex}:host .content-wrapper.single-line{align-items:stretch}:host .content-wrapper.disabled{opacity:var(--luzmo-ai-interaction-textarea-disabled-opacity,var(--ai-interaction-textarea-disabled-opacity));pointer-events:none;cursor:not-allowed}:host .content-wrapper.disabled *{pointer-events:none}:host luzmo-prompt-box{--luzmo-prompt-box-attachments-gap:var(--luzmo-spacing-3,8px);--luzmo-prompt-box-border-radius:var(--ai-interaction-textarea-prompt-box-border-radius);inline-size:100%}:host .attachment-error{color:var(--luzmo-negative-color,#ca221c);font-size:var(--luzmo-font-size-s,12px);margin-block-start:var(--luzmo-spacing-2,4px);line-height:1.4}:host{--ai-interaction-textarea-disabled-opacity:.6;--ai-interaction-textarea-prompt-box-border-radius:var(--luzmo-prompt-box-border-radius,var(--luzmo-border-radius-l,8px))}`,L=3e3,R=6e4,z=class extends s.LitElement{constructor(...e){super(...e),this.placeholder=`Type your prompt here...`,this.selectedDatasets=[],this.authKey=``,this.authToken=``,this.apiUrl=`https://api.luzmo.com`,this.appServer=`https://app.luzmo.com`,this.includePublicDatasets=!1,this.disabled=!1,this.singleLine=!1,this.hideDatasetButton=!1,this.hideDatasetIcons=!1,this.maxVisibleSelectedDatasets=5,this.selectedAgent=null,this.disableDatasetModification=!1,this.hideSelectedDatasets=!1,this.disableColumnMentions=!1,this.isGenerating=!1,this.stoppable=!1,this.value=``,this.retainOnSubmit=!1,this.requireDataset=!1,this.allowImages=!1,this.allowVoiceInput=!1,this.acceptedFileTypes=[],this.apiVersion=`0.1.0`,this.fileIcons={},this._promptValue=``,this._isPromptValid=!1,this._fieldTriggerOptions=[],this._datasetsFieldConfig=[],this._attachmentError=null,this._isRecording=!1,this._isTranscribing=!1,this._activeFieldRequestId=0,this._attachmentUploads=new Map,this._pendingAttachmentSync=null,this._attachmentSyncScheduled=!1,this._attachmentErrorClearHandle=0,this._submitInProgress=!1,this._voiceSessionActive=!1,this._preRecordingValue=``,this._voicePrefix=``,this._voiceSuffix=``,this._streamedTranscript=``,this._transcriptionController=null,this._renderFieldTriggerIcon=e=>{let t=e.data?.datasetInfo;return e.header&&t?s.html`
|
|
21
|
+
<span>
|
|
22
|
+
${this.hideDatasetIcons?s.html`<luzmo-icon .icon=${o.luzmoPlugin} size="s"></luzmo-icon>`:s.html`
|
|
23
|
+
<luzmo-dataset-icon
|
|
24
|
+
.datasetInfo=${t}
|
|
25
|
+
size="16px"
|
|
26
|
+
app-url=${this.appServer}
|
|
27
|
+
></luzmo-dataset-icon>
|
|
28
|
+
`}
|
|
29
|
+
</span>
|
|
30
|
+
`:e.icon?s.html`
|
|
31
|
+
<span>
|
|
32
|
+
<luzmo-icon .icon=${e.icon} size="s"></luzmo-icon>
|
|
33
|
+
</span>
|
|
34
|
+
`:s.nothing},this._handleAttachClick=()=>{this.openFilePicker()},this._handleAttachmentsChange=e=>{this._pendingAttachmentSync=e.detail?.attachments??this.getAttachments(),!this._attachmentSyncScheduled&&(this._attachmentSyncScheduled=!0,queueMicrotask(()=>{if(this._attachmentSyncScheduled=!1,!this.isConnected){this._pendingAttachmentSync=null;return}let e=this._pendingAttachmentSync??this.getAttachments();this._pendingAttachmentSync=null,this._syncAttachments(e)}))},this._handleVoiceKeydown=e=>{e.key===`Escape`&&this._isTranscribing&&(e.preventDefault(),e.stopPropagation(),this._cancelVoiceSession())},this._handleRecord=e=>{if(e.stopPropagation(),e.detail?.isRecording){this._captureVoiceInsertPoint(),this._isRecording=!0,this._isTranscribing=!1;return}this._isRecording=!1},this._handleRecordCancel=e=>{e.stopPropagation(),this._cancelVoiceSession()},this._handleRecordError=e=>{e.stopPropagation(),this._abortTranscription(),this._resetVoiceSessionState();let t=e.detail?.error?.trim()||(0,l.msg)(`Voice recording failed`,{desc:`Error when microphone recording fails in the AI prompt`});this._showAttachmentError(t)},this._handleRecordingComplete=e=>{e.stopPropagation();let{audioBlob:t,mimeType:n}=e.detail??{};if(!t){this._resetVoiceSessionState();return}this._transcribeRecording(t,n||t.type||`audio/webm`)}}static{this.styles=(0,s.unsafeCSS)(I)}static{this.tagName=`luzmo-ai-interaction-textarea`}get flagOpendata(){return this.includePublicDatasets}set flagOpendata(e){this.includePublicDatasets=e}get _voiceBusy(){return this._isRecording||this._isTranscribing}get _buttonDisabled(){return this.disabled||this.isGenerating||this._voiceBusy||!this._isPromptValid?!0:this.requireDataset&&this.selectedDatasets.length===0&&!this.selectedAgent}get _promptPending(){return this.isGenerating||this._isTranscribing}get _promptReadonly(){return this._voiceBusy}get _actionsDisabled(){return this.disabled||this.isGenerating||this._voiceBusy}get _fieldTriggers(){return this.disableColumnMentions?[]:[{key:`@`,options:this._fieldTriggerOptions,highlightSearch:!0,iconTemplate:this._renderFieldTriggerIcon}]}connectedCallback(){super.connectedCallback(),this._configureBroker(),this._refreshDatasetsFieldConfig(),this.addEventListener(`keydown`,this._handleVoiceKeydown)}disconnectedCallback(){window.clearTimeout(this._attachmentErrorClearHandle),this._abortAllAttachmentUploads(),this._abortTranscription(),this.removeEventListener(`keydown`,this._handleVoiceKeydown),super.disconnectedCallback()}_configureBroker(){n.t.configure({authKey:this.authKey,authToken:this.authToken,apiUrl:this.apiUrl})}_handlePromptInput(e){let t=e.target.value??``;this._promptValue=t,this._isPromptValid=t.trim().length>0}openFilePicker(){this._promptBox?.openFilePicker()}addFiles(e){return this._promptBox?.addFiles(e)??[]}removeAttachment(e){this._cleanupAttachmentUpload(e),this._promptBox?.removeAttachment(e)}setAttachmentLoading(e,t){this._promptBox?.setAttachmentLoading(e,t)}clearAttachments(){this._abortAllAttachmentUploads(),this._promptBox?.clearAttachments()}getAttachments(){return this._promptBox?.getAttachments()??[]}getAttachmentUrls(e=this.getAttachments()){return e.map(e=>this._attachmentUploads.get(e.id)?.url).filter(e=>typeof e==`string`&&e.length>0)}_showAttachmentError(e){this._attachmentError=e,window.clearTimeout(this._attachmentErrorClearHandle),this._attachmentErrorClearHandle=window.setTimeout(()=>{this._attachmentError=null},L)}_cleanupAttachmentUpload(e){this._attachmentUploads.get(e)?.controller?.abort(),this._attachmentUploads.delete(e)}_abortAllAttachmentUploads(){for(let e of this._attachmentUploads.values())e.controller?.abort();this._attachmentUploads.clear()}async _uploadSingleFile(e,t){let n=``;if(typeof this.uploadAttachments==`function`){let r=await this.uploadAttachments([e],{signal:t});n=Array.isArray(r)?r[0]?.trim()??``:``}else{if(!this.authKey||!this.authToken)throw Error(`Image upload requires authKey and authToken.`);let[r]=await C({files:[e],authKey:this.authKey,authToken:this.authToken,apiUrl:this.apiUrl,apiVersion:this.apiVersion,signal:t});n=r?.trim()??``}if(!n)throw Error(`Image upload for "${e.name}" did not return a url.`);return b([n]),n}_startAttachmentUpload(e){let{id:t,file:n}=e;if(!n){this.removeAttachment(t);return}if(!v(n)){this.removeAttachment(t),this._showAttachmentError((0,l.msg)(`Only PNG, JPEG, WebP, and GIF images can be attached.`,{desc:`Error when the user attaches an unsupported image type to the AI prompt`}));return}if(n.size===0){this.removeAttachment(t),this._showAttachmentError((0,l.msg)(`Failed to attach image`,{desc:`Error when an AI prompt image upload fails`}));return}if(n.size>15728640){this.removeAttachment(t),this._showAttachmentError((0,l.msg)(`Image is too large. Maximum size is 15 MB.`,{desc:`Error when an attached AI prompt image exceeds the 15 MB upload limit`}));return}this.setAttachmentLoading(t,!0);let r=new AbortController,i={controller:r};this._attachmentUploads.set(t,i);let a=window.setTimeout(()=>r.abort(),R),o=()=>{this.removeAttachment(t),this._showAttachmentError((0,l.msg)(`Failed to attach image`,{desc:`Error when an AI prompt image upload fails`}))};i.promise=(async()=>{try{let e=await this._uploadSingleFile(n,r.signal);window.clearTimeout(a);let i=this._attachmentUploads.get(t);if(!i||i.controller!==r)return;i.url=e,i.controller=void 0,i.promise=void 0,this.setAttachmentLoading(t,!1)}catch(e){if(window.clearTimeout(a),r.signal.aborted||e?.name===`AbortError`){this._attachmentUploads.get(t)?.controller===r&&o();return}o()}})()}_syncAttachments(e){let t=new Set(e.map(e=>e.id));for(let e of Array.from(this._attachmentUploads.keys()))t.has(e)||this._cleanupAttachmentUpload(e);let n=!1;for(let t of e)if(!this._attachmentUploads.has(t.id)){if(this._attachmentUploads.size>=20){n=!0,this._promptBox?.removeAttachment(t.id);continue}this._startAttachmentUpload(t)}n&&this._showAttachmentError((0,l.msg)(l.str`You can attach up to ${20} images.`,{desc:`Error when the user tries to attach more images than the AI prompt allows`}))}async _waitForAttachmentUploads(e){let t=e.map(e=>this._attachmentUploads.get(e.id)?.promise).filter(e=>!!e);t.length!==0&&await Promise.all(t)}async _submitPrompt(e=this._promptValue,t=[]){if(this._promptValue=e,this._isPromptValid=e.trim().length>0,!(this._buttonDisabled||this._submitInProgress)){this._submitInProgress=!0;try{let n=e.trim(),r=t.length>0?[...t]:this.getAttachments(),i=r.filter(e=>!!e.file&&v(e.file));await this._waitForAttachmentUploads(i);let a=[];for(let e of i){let t=this._attachmentUploads.get(e.id)?.url;if(!t){this._showAttachmentError((0,l.msg)(`Failed to attach image`,{desc:`Error when an AI prompt image upload fails`}));return}a.push(t)}this.retainOnSubmit||(this._promptValue=``,this._isPromptValid=!1,this._abortAllAttachmentUploads(),this._promptBox?.clear()),this.dispatchEvent(new CustomEvent(`prompt-submitted`,{detail:{prompt:n,selectedDatasets:this.selectedDatasets,selectedAgent:this.selectedAgent??null,attachments:r,attachmentUrls:a},bubbles:!0,composed:!0}))}finally{this._submitInProgress=!1}}}_handleDatasetSelected(e){let t=e.detail;this.selectedDatasets.some(e=>e.id===t.id)||(this.selectedDatasets=[...this.selectedDatasets,t])}_handleDatasetRemoved(e){let t=e.detail;this.selectedDatasets=this.selectedDatasets.filter(e=>e.id!==t.id)}_handleAgentSelected(e){this.selectedAgent=e.detail}_handleAgentRemoved(){this.selectedAgent=null}_getLocalizedFieldLabel(e){if(e)return typeof e==`string`?e:i.t(e,t.t())}_mapColumnToTriggerOption(e,t){return t.id?{label:this._getLocalizedFieldLabel(t.name)||t.id,value:`${e}:column:${t.id}`,icon:r.t(t,`s`),elementType:`data-field`,data:{datasetId:e,columnId:t.id,type:t.type,subtype:t.subtype}}:null}_mapFormulaToTriggerOption(e,t){return t.id?{label:this._getLocalizedFieldLabel(t.name)||t.id,value:`${e}:formula:${t.id}`,icon:r.r.formula[r.i(`s`)],elementType:`data-field`,data:{datasetId:e,formulaId:t.id,type:t.type,subtype:t.subtype}}:null}_updateFieldTriggerOptionsFromConfig(){let e=new Map(this._datasetsFieldConfig.map(e=>[e.id,e])),t=[];for(let n of this.selectedDatasets){let r=e.get(n.id),i=[],o=r?.columns?.filter(e=>!e.hidden)??[];for(let e of o){let t=this._mapColumnToTriggerOption(n.id,e);t&&i.push(t)}let s=r?.formulas?.filter(e=>!e.hidden)??[];for(let e of s){let t=this._mapFormulaToTriggerOption(n.id,e);t&&i.push(t)}i.length!==0&&(t.push({label:a.t(n),value:`dataset-header:${n.id}`,header:!0,data:{datasetInfo:n}}),t.push(...i))}this._fieldTriggerOptions=t}async _refreshDatasetsFieldConfig(){if(this.disableColumnMentions){this._datasetsFieldConfig=[],this._fieldTriggerOptions=[];return}let e=[...new Set(this.selectedDatasets.map(e=>e.id).filter(Boolean))];if(e.length===0){this._datasetsFieldConfig=[],this._fieldTriggerOptions=[];return}let t=++this._activeFieldRequestId;this._updateFieldTriggerOptionsFromConfig();try{let r=await n.t.fetchDatasetsWithColumnsAndFormulas(e);if(t!==this._activeFieldRequestId)return;this._datasetsFieldConfig=r,this._updateFieldTriggerOptionsFromConfig()}catch(e){console.error(`Error loading dataset fields for prompt triggers:`,e),t===this._activeFieldRequestId&&(this._datasetsFieldConfig=[],this._updateFieldTriggerOptionsFromConfig())}}_handlePromptSubmit(e){this._submitPrompt(e.detail?.value??this._promptValue,e.detail?.attachments??[])}_handlePromptStop(e){if(e.stopPropagation(),this._isTranscribing){this._cancelVoiceSession();return}this.dispatchEvent(new CustomEvent(`prompt-stopped`,{bubbles:!0,composed:!0}))}_getCaretTextOffset(){let e=this._promptBox?.shadowRoot;if(!e)return this._promptValue.length;let t=e.querySelector(`.rich-input`)??e.querySelector(`luzmo-text-field`);if(!t)return this._promptValue.length;let n=e.getSelection?.()??document.getSelection();if(!n||n.rangeCount===0)return this._promptValue.length;let r=n.getRangeAt(0);if(!t.contains(r.startContainer))return this._promptValue.length;let i=r.cloneRange();return i.selectNodeContents(t),i.setEnd(r.startContainer,r.startOffset),i.toString().length}_setPromptText(e){this._promptValue=e,this._isPromptValid=e.trim().length>0,this._syncControlledValueToPromptBox()}_captureVoiceInsertPoint(){let e=Math.min(Math.max(this._getCaretTextOffset(),0),this._promptValue.length);this._preRecordingValue=this._promptValue,this._voicePrefix=this._promptValue.slice(0,e),this._voiceSuffix=this._promptValue.slice(e),this._streamedTranscript=``,this._voiceSessionActive=!0}_applyStreamedTranscript(){this._setPromptText(`${this._voicePrefix}${this._streamedTranscript}${this._voiceSuffix}`)}_resetVoiceSessionState(){this._isRecording=!1,this._isTranscribing=!1,this._streamedTranscript=``,this._voicePrefix=``,this._voiceSuffix=``,this._preRecordingValue=``,this._voiceSessionActive=!1}_abortTranscription(){this._transcriptionController?.abort(),this._transcriptionController=null}_cancelVoiceSession(){if(!this._voiceSessionActive){this._abortTranscription(),this._resetVoiceSessionState();return}let e=this._preRecordingValue;this._abortTranscription(),this._resetVoiceSessionState(),this._setPromptText(e)}async _transcribeRecording(e,t){this._abortTranscription();let n=new AbortController;this._transcriptionController=n,this._isRecording=!1,this._isTranscribing=!0,this._streamedTranscript=``;try{if(await k({audioBlob:e,mimeType:t,authKey:this.authKey,authToken:this.authToken,apiUrl:this.apiUrl,apiVersion:this.apiVersion,signal:n.signal,onDelta:e=>{n.signal.aborted||(this._streamedTranscript+=e,this._applyStreamedTranscript())}}),n.signal.aborted)return;this._resetVoiceSessionState()}catch(e){if(n.signal.aborted)return;console.error(`Voice transcription failed:`,e),this._setPromptText(this._preRecordingValue),this._resetVoiceSessionState(),this._showAttachmentError((0,l.msg)(`Failed to transcribe audio`,{desc:`Error when AI prompt voice transcription fails`}))}finally{this._transcriptionController===n&&(this._transcriptionController=null)}}_syncControlledValueToPromptBox(){let e=this._promptBox;if(!e?.allowElements){e&&(e.value=this._promptValue);return}e.segments=this._promptValue?[{type:`text`,value:this._promptValue}]:[]}willUpdate(e){e.has(`value`)&&(this._promptValue=this.value,this._isPromptValid=this.value.trim().length>0);let t=e.has(`authKey`)||e.has(`authToken`)||e.has(`apiUrl`);t&&this._configureBroker(),(t||e.has(`selectedDatasets`)||e.has(`disableColumnMentions`))&&this._refreshDatasetsFieldConfig()}updated(e){super.updated(e),e.has(`value`)&&this._syncControlledValueToPromptBox()}render(){return s.html`
|
|
35
|
+
<div class=${(0,u.classMap)({"content-wrapper":!0,disabled:this.disabled,"single-line":this.singleLine})} aria-busy=${this.isGenerating||this._voiceBusy?`true`:`false`}>
|
|
36
|
+
<luzmo-prompt-box
|
|
37
|
+
?single-line=${this.singleLine}
|
|
38
|
+
?pending=${this._promptPending}
|
|
39
|
+
?stoppable=${this.stoppable&&this.isGenerating||this._isTranscribing}
|
|
40
|
+
?disabled=${this.disabled}
|
|
41
|
+
?readonly=${this._promptReadonly}
|
|
42
|
+
?disable-submit=${this._buttonDisabled}
|
|
43
|
+
?allow-images=${this.allowImages}
|
|
44
|
+
?recording=${this.allowVoiceInput}
|
|
45
|
+
.acceptedFileTypes=${this.acceptedFileTypes}
|
|
46
|
+
.fileIcons=${this.fileIcons}
|
|
47
|
+
grows
|
|
48
|
+
allow-elements
|
|
49
|
+
.placeholder=${this.placeholder}
|
|
50
|
+
.value=${this._promptValue}
|
|
51
|
+
.triggers=${this._fieldTriggers}
|
|
52
|
+
@input=${this._handlePromptInput}
|
|
53
|
+
@luzmo-submit=${this._handlePromptSubmit}
|
|
54
|
+
@luzmo-stop=${this._handlePromptStop}
|
|
55
|
+
@luzmo-attachments-change=${this._handleAttachmentsChange}
|
|
56
|
+
@luzmo-record=${this._handleRecord}
|
|
57
|
+
@luzmo-recording-complete=${this._handleRecordingComplete}
|
|
58
|
+
@luzmo-record-cancel=${this._handleRecordCancel}
|
|
59
|
+
@luzmo-record-error=${this._handleRecordError}
|
|
60
|
+
>
|
|
61
|
+
${this.hideSelectedDatasets||this.hideDatasetButton?``:s.html`
|
|
62
|
+
<luzmo-dataset-selector-row
|
|
63
|
+
slot="top-actions"
|
|
64
|
+
.selectedDatasets=${this.selectedDatasets}
|
|
65
|
+
.selectedAgent=${this.selectedAgent}
|
|
66
|
+
.maxVisibleSelectedDatasets=${this.maxVisibleSelectedDatasets}
|
|
67
|
+
auth-key=${this.authKey}
|
|
68
|
+
auth-token=${this.authToken}
|
|
69
|
+
api-url=${this.apiUrl}
|
|
70
|
+
app-server=${this.appServer}
|
|
71
|
+
?include-public-datasets=${this.includePublicDatasets}
|
|
72
|
+
?hide-dataset-icons=${this.hideDatasetIcons}
|
|
73
|
+
?disabled=${this._actionsDisabled}
|
|
74
|
+
?disable-dataset-modification=${this.disableDatasetModification}
|
|
75
|
+
@dataset-selected=${this._handleDatasetSelected}
|
|
76
|
+
@dataset-removed=${this._handleDatasetRemoved}
|
|
77
|
+
@luzmo-agent-selected=${this._handleAgentSelected}
|
|
78
|
+
@luzmo-agent-removed=${this._handleAgentRemoved}
|
|
79
|
+
></luzmo-dataset-selector-row>
|
|
80
|
+
`}
|
|
81
|
+
${this.allowImages?s.html`
|
|
82
|
+
<luzmo-action-button
|
|
83
|
+
slot="bottom-actions"
|
|
84
|
+
size="m"
|
|
85
|
+
quiet
|
|
86
|
+
?disabled=${this._actionsDisabled}
|
|
87
|
+
label=${(0,l.msg)(`Add attachments`,{desc:`Accessible label for the AI prompt attachment button`})}
|
|
88
|
+
@click=${this._handleAttachClick}
|
|
89
|
+
>
|
|
90
|
+
<luzmo-icon slot="icon" size="m" .icon=${o.luzmoPaperclip}></luzmo-icon>
|
|
91
|
+
</luzmo-action-button>
|
|
92
|
+
`:s.nothing}
|
|
93
|
+
</luzmo-prompt-box>
|
|
94
|
+
${this._attachmentError?s.html`
|
|
95
|
+
<div class="attachment-error" role="alert">${this._attachmentError}</div>
|
|
96
|
+
`:s.nothing}
|
|
97
|
+
</div>
|
|
98
|
+
`}};e.t([(0,c.property)({type:String})],z.prototype,`placeholder`,void 0),e.t([(0,c.property)({type:Array})],z.prototype,`selectedDatasets`,void 0),e.t([(0,c.property)({type:String,attribute:`auth-key`})],z.prototype,`authKey`,void 0),e.t([(0,c.property)({type:String,attribute:`auth-token`})],z.prototype,`authToken`,void 0),e.t([(0,c.property)({type:String,attribute:`api-url`})],z.prototype,`apiUrl`,void 0),e.t([(0,c.property)({type:String,attribute:`app-server`})],z.prototype,`appServer`,void 0),e.t([(0,c.property)({type:Boolean,reflect:!0,attribute:`include-public-datasets`})],z.prototype,`includePublicDatasets`,void 0),e.t([(0,c.property)({type:Boolean,attribute:`flag-opendata`})],z.prototype,`flagOpendata`,null),e.t([(0,c.property)({type:Boolean,reflect:!0,attribute:`disabled`})],z.prototype,`disabled`,void 0),e.t([(0,c.property)({type:Boolean,attribute:`single-line`})],z.prototype,`singleLine`,void 0),e.t([(0,c.property)({type:Boolean,attribute:`hide-dataset-button`})],z.prototype,`hideDatasetButton`,void 0),e.t([(0,c.property)({type:Boolean,attribute:`hide-dataset-icons`})],z.prototype,`hideDatasetIcons`,void 0),e.t([(0,c.property)({type:Number,reflect:!0,useDefault:!0,attribute:`max-visible-selected-datasets`})],z.prototype,`maxVisibleSelectedDatasets`,void 0),e.t([(0,c.property)({attribute:!1})],z.prototype,`selectedAgent`,void 0),e.t([(0,c.property)({type:Boolean,attribute:`disable-dataset-modification`})],z.prototype,`disableDatasetModification`,void 0),e.t([(0,c.property)({type:Boolean,attribute:`hide-selected-datasets`})],z.prototype,`hideSelectedDatasets`,void 0),e.t([(0,c.property)({type:Boolean,attribute:`disable-column-mentions`})],z.prototype,`disableColumnMentions`,void 0),e.t([(0,c.property)({type:Boolean,attribute:`is-generating`})],z.prototype,`isGenerating`,void 0),e.t([(0,c.property)({type:Boolean,reflect:!0})],z.prototype,`stoppable`,void 0),e.t([(0,c.property)({type:String})],z.prototype,`value`,void 0),e.t([(0,c.property)({type:Boolean,attribute:`retain-on-submit`})],z.prototype,`retainOnSubmit`,void 0),e.t([(0,c.property)({type:Boolean,attribute:`require-dataset`})],z.prototype,`requireDataset`,void 0),e.t([(0,c.property)({type:Boolean,reflect:!0,attribute:`allow-images`})],z.prototype,`allowImages`,void 0),e.t([(0,c.property)({type:Boolean,reflect:!0,attribute:`allow-voice-input`})],z.prototype,`allowVoiceInput`,void 0),e.t([(0,c.property)({type:Array,attribute:`accepted-file-types`})],z.prototype,`acceptedFileTypes`,void 0),e.t([(0,c.property)({type:String,attribute:`api-version`})],z.prototype,`apiVersion`,void 0),e.t([(0,c.property)({attribute:!1})],z.prototype,`uploadAttachments`,void 0),e.t([(0,c.property)({attribute:!1})],z.prototype,`fileIcons`,void 0),e.t([(0,c.state)()],z.prototype,`_promptValue`,void 0),e.t([(0,c.state)()],z.prototype,`_isPromptValid`,void 0),e.t([(0,c.state)()],z.prototype,`_fieldTriggerOptions`,void 0),e.t([(0,c.state)()],z.prototype,`_datasetsFieldConfig`,void 0),e.t([(0,c.state)()],z.prototype,`_attachmentError`,void 0),e.t([(0,c.state)()],z.prototype,`_isRecording`,void 0),e.t([(0,c.state)()],z.prototype,`_isTranscribing`,void 0),e.t([(0,c.query)(`luzmo-prompt-box`)],z.prototype,`_promptBox`,void 0),z=e.t([(0,l.localized)()],z),customElements.get(`luzmo-ai-interaction-textarea`)||customElements.define(`luzmo-ai-interaction-textarea`,z),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return x}});
|