@luzmo/analytics-components-kit 1.0.1-alpha.84 → 1.0.1-alpha.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/angular/components/droppable-slot.component.ts +2 -2
  2. package/angular/esm/components/droppable-slot.component.d.ts +2 -2
  3. package/angular/esm/types.d.ts +1 -1
  4. package/angular/types.ts +2 -2
  5. package/components/ai-chat-messages-container/index.cjs +1 -1
  6. package/components/ai-chat-messages-container/index.js +2 -2
  7. package/components/ai-interaction-textarea/index.cjs +50 -0
  8. package/components/ai-interaction-textarea/index.d.ts +1 -1
  9. package/components/ai-interaction-textarea/index.js +152 -0
  10. package/components/area-chart-options.config-Bl8bhhOo.cjs +20 -0
  11. package/components/{area-chart-options.config-_J0sG4NF.js → area-chart-options.config-u8itidsi.js} +14 -26
  12. package/components/bar-chart-options.config-CePAqM83.cjs +20 -0
  13. package/components/{bar-chart-options.config-D1mb5TDl.js → bar-chart-options.config-DIirbAJ0.js} +21 -35
  14. package/components/box-plot-options.config-BVNrV2eD.cjs +20 -0
  15. package/components/{box-plot-options.config-xu_i6ms7.js → box-plot-options.config-BWROiguA.js} +52 -88
  16. package/components/{bubble-chart-options.config-BacgXkJ_.js → bubble-chart-options.config-4QD8VPhU.js} +9 -18
  17. package/components/bubble-chart-options.config-BDgOe3GQ.cjs +20 -0
  18. package/components/{bullet-chart-options.config-CDPpX1yc.js → bullet-chart-options.config-3bH7uekx.js} +1 -1
  19. package/components/{bullet-chart-options.config-DfS4Bwds.cjs → bullet-chart-options.config-tWb6Fio-.cjs} +1 -1
  20. package/components/calculate-data-item-icon-C8CbsMQf.js +139 -0
  21. package/components/{calculate-data-item-icon-DjW1_RI1.cjs → calculate-data-item-icon-CX4VW9Km.cjs} +1 -1
  22. package/components/{choropleth-map-options.config-B_W9-rhe.js → choropleth-map-options.config-CMxx3ORp.js} +63 -84
  23. package/components/choropleth-map-options.config-CWJACFd0.cjs +20 -0
  24. package/components/circular-gauge-options.config-BMxgq3zH.cjs +20 -0
  25. package/components/{circular-gauge-options.config-DAIjz4Rl.js → circular-gauge-options.config-DhIKn44k.js} +23 -36
  26. package/components/{color-DuJ4-73S.js → color-B7m0j8lX.js} +941 -950
  27. package/components/color-Czp4Im5q.cjs +20 -0
  28. package/components/{color-range-utils-Bvo9sm5A.js → color-range-utils-BSfqtB3A.js} +31 -32
  29. package/components/color-range-utils-DYYR-iwx.cjs +20 -0
  30. package/components/column-chart-options.config-BV9R3ssH.cjs +20 -0
  31. package/components/{column-chart-options.config-B5SjBVdy.js → column-chart-options.config-D5-yR7iq.js} +27 -37
  32. package/components/conditional-number-options.config-Co099Qfm.cjs +20 -0
  33. package/components/{conditional-number-options.config-BCEpSK9J.js → conditional-number-options.config-DPYsdML5.js} +24 -40
  34. package/components/dataset-selector-list/index.cjs +11 -11
  35. package/components/dataset-selector-list/index.js +65 -69
  36. package/components/dataset-selector-row/dataset-selector-row.d.ts +1 -0
  37. package/components/dataset-selector-row/index.cjs +79 -0
  38. package/components/dataset-selector-row/index.d.ts +1 -1
  39. package/components/dataset-selector-row/index.js +209 -0
  40. package/components/{date-comparison-filter-options.config-JA_yYpJa.js → date-comparison-filter-options.config-CSwGyuBg.js} +3 -6
  41. package/components/{date-comparison-filter-options.config-DAVncmi0.cjs → date-comparison-filter-options.config-QaoWaFUn.cjs} +1 -1
  42. package/components/{date-filter-options.config-DBRxlTWy.js → date-filter-options.config-BTVyHRkp.js} +3 -6
  43. package/components/{date-filter-options.config-CWPMtA18.cjs → date-filter-options.config-n-zhWaYa.cjs} +1 -1
  44. package/components/display-settings/index.cjs +1 -1
  45. package/components/display-settings/index.js +1 -1
  46. package/components/display-settings-binning/index.cjs +5 -5
  47. package/components/display-settings-binning/index.js +29 -30
  48. package/components/display-settings-datetime/index.cjs +29 -29
  49. package/components/display-settings-datetime/index.js +112 -120
  50. package/components/display-settings-grand-totals/index.cjs +4 -4
  51. package/components/display-settings-grand-totals/index.js +23 -24
  52. package/components/display-settings-numeric/index.cjs +48 -48
  53. package/components/display-settings-numeric/index.js +194 -211
  54. package/components/display-settings-period-over-period/index.cjs +16 -16
  55. package/components/display-settings-period-over-period/index.js +91 -97
  56. package/components/{donut-chart-options.config-BulUEiaH.js → donut-chart-options.config-3ZqX8Cbb.js} +21 -37
  57. package/components/donut-chart-options.config-BQyPgnC9.cjs +20 -0
  58. package/components/draggable-data-item/index.cjs +8 -8
  59. package/components/draggable-data-item/index.js +44 -45
  60. package/components/draggable-data-item-level/index.cjs +11 -11
  61. package/components/draggable-data-item-level/index.js +89 -92
  62. package/components/{dropdown-filter-options.config-D9dvPypF.js → dropdown-filter-options.config-CGJTtgAX.js} +7 -10
  63. package/components/{dropdown-filter-options.config-DS-MORmq.cjs → dropdown-filter-options.config-DJvfCTk7.cjs} +1 -1
  64. package/components/droppable-slot/droppable-slot.d.ts +2 -2
  65. package/components/droppable-slot/index.cjs +20 -20
  66. package/components/droppable-slot/index.js +167 -181
  67. package/components/edit-item/index.cjs +9 -9
  68. package/components/edit-item/index.js +116 -119
  69. package/components/edit-option/index.cjs +1 -1
  70. package/components/edit-option/index.js +1 -1
  71. package/components/edit-option-action-button-group/index.cjs +8 -8
  72. package/components/edit-option-action-button-group/index.js +52 -53
  73. package/components/{edit-option-base-DIc7iC-b.js → edit-option-base-Bh29-Cak.js} +1 -1
  74. package/components/{edit-option-base-VhTih9T1.cjs → edit-option-base-tFr8Qg2B.cjs} +1 -1
  75. package/components/edit-option-color-palette-picker/index.cjs +1 -1
  76. package/components/edit-option-color-palette-picker/index.js +1 -1
  77. package/components/edit-option-color-picker/index.cjs +1 -1
  78. package/components/edit-option-color-picker/index.js +1 -1
  79. package/components/edit-option-color-range/index.cjs +19 -19
  80. package/components/edit-option-color-range/index.js +106 -117
  81. package/components/edit-option-multi-language-field/index.cjs +3 -3
  82. package/components/edit-option-multi-language-field/index.js +26 -27
  83. package/components/edit-option-number-field/index.cjs +1 -1
  84. package/components/edit-option-number-field/index.js +1 -1
  85. package/components/edit-option-picker/index.cjs +5 -5
  86. package/components/edit-option-picker/index.js +7 -7
  87. package/components/edit-option-position-picker/index.cjs +4 -4
  88. package/components/edit-option-position-picker/index.js +21 -25
  89. package/components/edit-option-positions-number-field/index.cjs +9 -9
  90. package/components/edit-option-positions-number-field/index.js +76 -81
  91. package/components/edit-option-radio-button-group/index.cjs +6 -6
  92. package/components/edit-option-radio-button-group/index.js +21 -22
  93. package/components/edit-option-slider/index.cjs +1 -1
  94. package/components/edit-option-slider/index.js +1 -1
  95. package/components/edit-option-switch/index.cjs +1 -1
  96. package/components/edit-option-switch/index.js +1 -1
  97. package/components/edit-option-text-field/index.cjs +2 -2
  98. package/components/edit-option-text-field/index.js +22 -23
  99. package/components/en--a5SfjnM.cjs +20 -0
  100. package/components/en-CtCctD2c.js +1483 -0
  101. package/components/{en-GB-DG6uS3sM.cjs → en-GB-CXVKFWyH.cjs} +1 -1
  102. package/components/{en-GB-CEHEs8F2.js → en-GB-CbNfyZMo.js} +1 -1
  103. package/components/{evolution-number-options.config-DzkfeoIN.js → evolution-number-options.config-BIPO_4n3.js} +11 -14
  104. package/components/{evolution-number-options.config-BgIZY4gQ.cjs → evolution-number-options.config-Bc9eKYnn.cjs} +1 -1
  105. package/components/{extrapolate-color-0j_AeYkz.cjs → extrapolate-color-C0n1UDs-.cjs} +1 -1
  106. package/components/{extrapolate-color-CC9CURf6.js → extrapolate-color-v1PimdQr.js} +1 -1
  107. package/components/filter-data-item-picker/index.cjs +7 -7
  108. package/components/filter-data-item-picker/index.js +85 -86
  109. package/components/filter-expression-picker/index.cjs +1 -1
  110. package/components/filter-expression-picker/index.js +1 -1
  111. package/components/filter-item/index.cjs +6 -6
  112. package/components/filter-item/index.js +109 -119
  113. package/components/filter-value-picker/index.cjs +2 -2
  114. package/components/filter-value-picker/index.js +34 -36
  115. package/components/filter-value-picker-datetime/index.cjs +8 -8
  116. package/components/filter-value-picker-datetime/index.js +56 -71
  117. package/components/filter-value-picker-hierarchy/index.cjs +12 -12
  118. package/components/filter-value-picker-hierarchy/index.js +113 -124
  119. package/components/filter-value-picker-numeric/index.cjs +8 -8
  120. package/components/filter-value-picker-numeric/index.js +101 -110
  121. package/components/{focusable-DCIFkpiW.js → focusable-BS2pbY7w.js} +24 -26
  122. package/components/focusable-QLh-LlNt.cjs +20 -0
  123. package/components/{funnel-chart-options.config-C_VjTOvD.js → funnel-chart-options.config-CrJy2U7_.js} +5 -20
  124. package/components/funnel-chart-options.config-DrP4AFgk.cjs +20 -0
  125. package/components/{get-css-variable-DLiZYZEi.cjs → get-css-variable-CuDaWSjr.cjs} +2 -2
  126. package/components/{get-css-variable-YlLiVgo8.js → get-css-variable-DEf4GhTH.js} +4 -4
  127. package/components/grid/index.cjs +46 -46
  128. package/components/grid/index.js +2612 -1873
  129. package/components/heat-map-options.config-CIHnPdYE.cjs +20 -0
  130. package/components/{heat-map-options.config-BnLWe8jS.js → heat-map-options.config-CmL87j1j.js} +35 -41
  131. package/components/{heat-table-options.config-CUsDdgUr.js → heat-table-options.config-BrCYAgYD.js} +60 -88
  132. package/components/heat-table-options.config-DTlZRc_i.cjs +20 -0
  133. package/components/helpers-9I0oLoUB.cjs +20 -0
  134. package/components/helpers-bR8Ibjqh.js +79 -0
  135. package/components/{hexbin-map-options.config-F-7uCqxb.js → hexbin-map-options.config-BguV1w8q.js} +20 -38
  136. package/components/hexbin-map-options.config-CKnn3VAB.cjs +20 -0
  137. package/components/{index-Do7O9azB.js → index-3WsfvkZF.js} +112 -123
  138. package/components/{index-PMDgRSzR.js → index-BDFBUGBc.js} +94 -104
  139. package/components/index-BGb_wRRW.js +1766 -0
  140. package/components/{index-BPNsFiyq.cjs → index-BNAmjOkm.cjs} +4 -4
  141. package/components/index-BUal0r_D.cjs +121 -0
  142. package/components/index-D1Y5TRsH.cjs +20 -0
  143. package/components/index-DvkzMbLt.cjs +249 -0
  144. package/components/{index-CdIUfo-L.js → index-haa7WNrl.js} +453 -481
  145. package/components/index.cjs +1 -60
  146. package/components/index.js +102 -281
  147. package/components/item-options-configs.cjs +1 -1
  148. package/components/item-options-configs.js +37 -37
  149. package/components/{line-chart-options.config-DB3IsXXr.js → line-chart-options.config-BhirTGqD.js} +13 -28
  150. package/components/line-chart-options.config-Cqwou5u6.cjs +20 -0
  151. package/components/{localize-r7ALOUy_.cjs → localize-C4zNlrwK.cjs} +1 -1
  152. package/components/{localize-BX7q0S0M.js → localize-CcDpq940.js} +10 -10
  153. package/components/{marker-map-options.config-DPJ955tt.js → marker-map-options.config-Bx17jmiq.js} +1 -1
  154. package/components/{marker-map-options.config-_FYZzRwA.cjs → marker-map-options.config-CvhCylSC.cjs} +1 -1
  155. package/components/{pivot-table-options.config-DNK_AIG7.js → pivot-table-options.config-CFc7y0IT.js} +15 -24
  156. package/components/pivot-table-options.config-uZDAertf.cjs +20 -0
  157. package/components/{pyramid-chart-options.config-CcVMatYx.js → pyramid-chart-options.config-2Waxb11l.js} +29 -43
  158. package/components/pyramid-chart-options.config-DoGfEvzU.cjs +20 -0
  159. package/components/{radar-chart-options.config-CUZn_3Fd.js → radar-chart-options.config-CPN5fOl8.js} +11 -23
  160. package/components/radar-chart-options.config-CtNUMN1l.cjs +20 -0
  161. package/components/{regular-table-options.config-BoLZsBry.js → regular-table-options.config-CFKCJQK1.js} +17 -23
  162. package/components/{regular-table-options.config-DTx3RTnS.cjs → regular-table-options.config-YRuoijIk.cjs} +1 -1
  163. package/components/route-map-options.config-CVTk5RVL.cjs +20 -0
  164. package/components/{route-map-options.config-CN86T7c0.js → route-map-options.config-CyolTJfK.js} +87 -109
  165. package/components/{sankey-diagram-options.config-RFB83YLZ.cjs → sankey-diagram-options.config-D7OSvSqm.cjs} +1 -1
  166. package/components/{sankey-diagram-options.config-tVLKy_Zn.js → sankey-diagram-options.config-Ldjk84ro.js} +7 -10
  167. package/components/scatter-plot-options.config-5gN7pMTm.cjs +20 -0
  168. package/components/{scatter-plot-options.config-Corlzno1.js → scatter-plot-options.config-CfxEfkQ1.js} +56 -86
  169. package/components/{search-filter-options.config-BE3JhR-F.js → search-filter-options.config-C0syQmP4.js} +3 -6
  170. package/components/{search-filter-options.config-BCaDlYqZ.cjs → search-filter-options.config-Oqco9BKj.cjs} +1 -1
  171. package/components/{set-locale-B-Tz2sdI.js → set-locale-nv7fWEtl.js} +1 -8
  172. package/components/slicer-filter-options.config-CrusP6a0.cjs +20 -0
  173. package/components/{slicer-filter-options.config-3JZZcw5C.js → slicer-filter-options.config-DmOe3440.js} +9 -18
  174. package/components/{slider-filter-options.config-DH4SS8wH.js → slider-filter-options.config-B1M8RcDs.js} +1 -1
  175. package/components/{slider-filter-options.config-_8Z2zKmU.cjs → slider-filter-options.config-k45I-t6G.cjs} +1 -1
  176. package/components/slot-contents-picker/index.cjs +33 -33
  177. package/components/slot-contents-picker/index.js +194 -205
  178. package/components/slot-menu/index.cjs +12 -12
  179. package/components/slot-menu/index.js +171 -184
  180. package/components/slot-menu-list/index.cjs +3 -3
  181. package/components/slot-menu-list/index.js +97 -103
  182. package/components/speedometer-chart-options.config-B4ceg_qI.cjs +20 -0
  183. package/components/{speedometer-chart-options.config-SL581yOa.js → speedometer-chart-options.config-CzOmuEF8.js} +31 -53
  184. package/components/spike-map-options.config-BkkDqb4g.cjs +20 -0
  185. package/components/{spike-map-options.config-C5KewecZ.js → spike-map-options.config-Cbt1YUw6.js} +91 -122
  186. package/components/{sunburst-chart-options.config-AbNjWS6t.cjs → sunburst-chart-options.config-Yrxc2i57.cjs} +1 -1
  187. package/components/{sunburst-chart-options.config-CNauGQJv.js → sunburst-chart-options.config-_dyLQxPJ.js} +9 -20
  188. package/components/{symbol-map-options.config-DdDA4aa7.js → symbol-map-options.config-BORL1NSU.js} +11 -20
  189. package/components/symbol-map-options.config-NpBKm64d.cjs +20 -0
  190. package/components/{treemap-chart-options.config-D5AJaF_u.js → treemap-chart-options.config-B9i9qIm_.js} +20 -37
  191. package/components/treemap-chart-options.config-x4J54WSw.cjs +20 -0
  192. package/components/utils.cjs +1 -1
  193. package/components/utils.js +64 -65
  194. package/components/{video-options.config-CGsDTwHc.cjs → video-options.config-B0asgYt8.cjs} +1 -1
  195. package/components/{video-options.config-Dk36zJ1B.js → video-options.config-UX-9MDfS.js} +7 -10
  196. package/components/{wordcloud-chart-options.config-vGfCW8kE.cjs → wordcloud-chart-options.config-BKtJT8Va.cjs} +1 -1
  197. package/components/{wordcloud-chart-options.config-w2NUIWVA.js → wordcloud-chart-options.config-BoB_KuhA.js} +4 -7
  198. package/custom-elements.json +22 -2
  199. package/index.d.ts +1 -0
  200. package/package.json +5 -5
  201. package/types.d.ts +1 -1
  202. package/components/area-chart-options.config-C7sMAHco.cjs +0 -20
  203. package/components/bar-chart-options.config-DcxEkOT5.cjs +0 -20
  204. package/components/box-plot-options.config-SrrbDEYW.cjs +0 -20
  205. package/components/bubble-chart-options.config-Ihn6eVQI.cjs +0 -20
  206. package/components/calculate-data-item-icon-DZDqb3xu.js +0 -139
  207. package/components/choropleth-map-options.config-ZW8yoZH2.cjs +0 -20
  208. package/components/circular-gauge-options.config-msZ4mfpN.cjs +0 -20
  209. package/components/color-B6LaL8qz.cjs +0 -20
  210. package/components/color-range-utils-C5yXW7ZC.cjs +0 -20
  211. package/components/column-chart-options.config-BjDvA7i9.cjs +0 -20
  212. package/components/conditional-number-options.config-DgzUo0xi.cjs +0 -20
  213. package/components/donut-chart-options.config-tNpqBZfR.cjs +0 -20
  214. package/components/en-BKBhKBXY.cjs +0 -20
  215. package/components/en-BOTjhwEc.js +0 -1488
  216. package/components/focusable-B3E_hQmm.cjs +0 -20
  217. package/components/funnel-chart-options.config-D7H7gFcx.cjs +0 -20
  218. package/components/heat-map-options.config-DVH-Bb5-.cjs +0 -20
  219. package/components/heat-table-options.config-B12JEYnp.cjs +0 -20
  220. package/components/helpers-DXQwEH1P.cjs +0 -20
  221. package/components/helpers-v1bPALRP.js +0 -91
  222. package/components/hexbin-map-options.config-DZERRhM8.cjs +0 -20
  223. package/components/index-BPN3bG9X.js +0 -1733
  224. package/components/index-CQ9ck-BO.cjs +0 -249
  225. package/components/index-CXn67vdn.cjs +0 -121
  226. package/components/index-cfj52IbK.cjs +0 -20
  227. package/components/line-chart-options.config-DSugoe0t.cjs +0 -20
  228. package/components/pivot-table-options.config-BiJXKSFR.cjs +0 -20
  229. package/components/pyramid-chart-options.config-C4zbFS26.cjs +0 -20
  230. package/components/radar-chart-options.config-EqQu6PTh.cjs +0 -20
  231. package/components/route-map-options.config-D7NJePTu.cjs +0 -20
  232. package/components/scatter-plot-options.config-CFfGJXsV.cjs +0 -20
  233. package/components/slicer-filter-options.config-DNI-XevE.cjs +0 -20
  234. package/components/speedometer-chart-options.config-BX9LTQBH.cjs +0 -20
  235. package/components/spike-map-options.config-DoBFXPmN.cjs +0 -20
  236. package/components/symbol-map-options.config-m-lwLTtu.cjs +0 -20
  237. package/components/treemap-chart-options.config-C0Q9aQ1Z.cjs +0 -20
@@ -17,11 +17,11 @@
17
17
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
18
  * SOFTWARE.
19
19
  * */
20
- "use strict";require("@luzmo/lucero/field-label");require("@luzmo/lucero/menu");require("@luzmo/lucero/select");const h=require("lit"),e=require("@lit/localize"),u=require("@luzmo/lucero/utils"),p=require("lit/decorators.js"),f=require("./set-locale-BRRalqne.cjs"),x=()=>[{id:"? = ?",key:"? = ?",expression:"? = ?",name:e.msg("equals",{desc:"Filter expression for equals comparison"}),description:e.msg("equals",{desc:"Filter expression for equals comparison"}),tiny:e.msg("eq",{desc:"Short form of equals comparison"}),type:["numeric","hierarchy"],subtype:["ip_address"]},{id:"? != ?",key:"? != ?",expression:"? != ?",name:e.msg("not equals",{desc:"Filter expression for not equals comparison"}),description:e.msg("not equals",{desc:"Filter expression for not equals comparison"}),tiny:e.msg("not eq",{desc:"Short form of not equals comparison"}),type:["numeric","hierarchy"],subtype:["ip_address"]},{id:"? in ?",key:"? in ?",expression:"? in ?",name:e.msg("is in",{desc:"Filter expression for in comparison"}),description:e.msg("is in",{desc:"Filter expression for in comparison"}),tiny:e.msg("is in",{desc:"Filter expression for in comparison"}),type:["numeric","hierarchy"],subtype:["ip_address"]},{id:"? not in ?",key:"? not in ?",expression:"? not in ?",name:e.msg("is not in",{desc:"Filter expression for not in comparison"}),description:e.msg("is not in",{desc:"Filter expression for not in comparison"}),tiny:e.msg("is not in",{desc:"Filter expression for not in comparison"}),type:["numeric","hierarchy"],subtype:["ip_address"]},{id:"? like ?",key:"? like ?",expression:"? like ?",name:e.msg("contains",{desc:"Filter expression for contains comparison"}),description:e.msg("contains",{desc:"Filter expression for contains comparison"}),tiny:e.msg("cont",{desc:"Short form of contains comparison in filter expression"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? not like ?",key:"? not like ?",expression:"? not like ?",name:e.msg("does not contain",{desc:"Filter expression for does not contain comparison"}),description:e.msg("does not contain",{desc:"Filter expression for does not contain comparison"}),tiny:e.msg("not cont",{desc:"Short form of does not contain comparison in filter expression"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? starts with ?",key:"? starts with ?",expression:"? starts with ?",name:e.msg("starts with",{desc:"Filter expression for starts with comparison"}),description:e.msg("starts with",{desc:"Filter expression for starts with comparison"}),tiny:e.msg("starts with",{desc:"Filter expression for starts with comparison"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? not starts with ?",key:"? not starts with ?",expression:"? not starts with ?",name:e.msg("does not start with",{desc:"Filter expression for does not start with comparison"}),description:e.msg("does not start with",{desc:"Filter expression for does not start with comparison"}),tiny:e.msg("not starts with",{desc:"Short form of does not start with comparison in filter expression"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? ends with ?",key:"? ends with ?",expression:"? ends with ?",name:e.msg("ends with",{desc:"Filter expression for ends with comparison"}),description:e.msg("ends with",{desc:"Filter expression for ends with comparison"}),tiny:e.msg("ends with",{desc:"Filter expression for ends with comparison"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? not ends with ?",key:"? not ends with ?",expression:"? not ends with ?",name:e.msg("does not end with",{desc:"Filter expression for does not end with comparison"}),description:e.msg("does not end with",{desc:"Filter expression for does not end with comparison"}),tiny:e.msg("not ends with",{desc:"Short form of does not end with comparison in filter expression"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? < ?",key:"? < ?",expression:"? < ?",name:e.msg("less than",{desc:"Filter expression for less than comparison"}),description:e.msg("less than",{desc:"Filter expression for less than comparison"}),tiny:e.msg("less than",{desc:"Filter expression for less than comparison"}),type:["numeric","datetime"],subtype:["ip_address"]},{id:"? <= ?",key:"? <= ?",expression:"? <= ?",name:e.msg("less than or equal",{desc:"Filter expression for less than or equal comparison"}),description:e.msg("less than or equal",{desc:"Filter expression for less than or equal comparison"}),tiny:e.msg("<=",{desc:"Short form of less than or equal comparison in filter expression"}),type:["numeric","datetime"],subtype:["ip_address"]},{id:"? > ?",key:"? > ?",expression:"? > ?",name:e.msg("greater than",{desc:"Filter expression for greater than comparison"}),description:e.msg("greater than",{desc:"Filter expression for greater than comparison"}),tiny:e.msg(">",{desc:"Short form of greater than comparison in filter expression"}),type:["numeric","datetime"],subtype:["ip_address"]},{id:"? >= ?",key:"? >= ?",expression:"? >= ?",name:e.msg("greater than or equal",{desc:"Filter expression for greater than or equal comparison"}),description:e.msg("greater than or equal",{desc:"Filter expression for greater than or equal comparison"}),tiny:e.msg(">=",{desc:"Short form of greater than or equal comparison in filter expression"}),type:["numeric","datetime"],subtype:["ip_address"]},{id:"? between ?",key:"? between ?",expression:"? between ?",name:e.msg("is between",{desc:"Filter expression for between comparison"}),description:e.msg("is between",{desc:"Filter expression for between comparison"}),tiny:e.msg("between",{desc:"Short form of between comparison in filter expression"}),type:[],subtype:["ip_address"]},{id:"last_now",key:"last_now",expression:"last_now",name:e.msg("last (x) periods",{desc:"Filter expression for last (x) periods"}),description:e.msg("last (x) periods",{desc:"Filter expression for last (x) periods"}),tiny:e.msg("last",{desc:"Short form of last (x) periods in filter expression"}),type:["datetime"]},{id:"last_available",key:"last_available",expression:"last_available",name:e.msg("last (x) available periods",{desc:"Filter expression for last (x) available periods"}),description:e.msg("last (x) available periods",{desc:"Filter expression for last (x) available periods"}),tiny:e.msg("last available",{desc:"Short form of last (x) available periods in filter expression"}),type:["datetime"]},{id:"last_completed",key:"last_completed",expression:"last_completed",name:e.msg("last completed period",{desc:"Filter expression for last completed period"}),description:e.msg("last completed (period)",{desc:"Filter expression for last completed period"}),tiny:e.msg("last completed",{desc:"Short form of last completed period in filter expression"}),type:["datetime"]},{id:"next_now",key:"next_now",expression:"next_now",name:e.msg("next (x) periods",{desc:"Filter expression for next (x) periods"}),description:e.msg("next (x) periods",{desc:"Filter expression for next (x) periods"}),tiny:e.msg("next",{desc:"Short form of next (x) periods in filter expression"}),type:["datetime"]},{id:"next_full",key:"next_full",expression:"next_full",name:e.msg("next full (period)",{desc:"Filter expression for next full period"}),description:e.msg("next full (period)",{desc:"Filter expression for next full period"}),tiny:e.msg("next full",{desc:"Short form of next full period in filter expression"}),type:["datetime"]},{id:"WTD",key:"to_date",expression:"to_date",unit:4,name:e.msg("week to date",{desc:"Filter expression for week to date"}),description:e.msg("week to date",{desc:"Filter expression for week to date"}),tiny:e.msg("WTD",{desc:"Short form of week to date in filter expression"}),type:["datetime"]},{id:"MTD",key:"to_date",expression:"to_date",unit:3,name:e.msg("month to date",{desc:"Filter expression for month to date"}),description:e.msg("month to date",{desc:"Filter expression for month to date"}),tiny:e.msg("MTD",{desc:"Short form of month to date in filter expression"}),type:["datetime"]},{id:"QTD",key:"to_date",expression:"to_date",unit:2,name:e.msg("quarter to date",{desc:"Filter expression for quarter to date"}),description:e.msg("quarter to date",{desc:"Filter expression for quarter to date"}),tiny:e.msg("QTD",{desc:"Short form of quarter to date in filter expression"}),type:["datetime"]},{id:"YTD",key:"to_date",expression:"to_date",unit:1,name:e.msg("year to date",{desc:"Filter expression for year to date"}),description:e.msg("year to date",{desc:"Filter expression for year to date"}),tiny:e.msg("YTD",{desc:"Short form of year to date in filter expression"}),type:["datetime"]},{id:"? is null",key:"? is null",expression:"? is null",name:e.msg("is missing",{desc:"Filter expression for is missing"}),description:e.msg("is missing",{desc:"Filter expression for is missing"}),tiny:e.msg("missing",{desc:"Short form of is missing in filter expression"}),type:["numeric","datetime","hierarchy","spatial"],subtype:["ip_address"]},{id:"? is not null",key:"? is not null",expression:"? is not null",name:e.msg("is not missing",{desc:"Filter expression for is not missing"}),description:e.msg("is not missing",{desc:"Filter expression for is not missing"}),tiny:e.msg("not missing",{desc:"Short form of is not missing in filter expression"}),type:["numeric","datetime","hierarchy","spatial"],subtype:["ip_address"]}],y=(d,s,i)=>{const r=new Set(["? in ?","? not in ?"]);return!d&&!s?x():x().filter(t=>{var o;return(d&&t.type.includes(d)||s&&((o=t.subtype)==null?void 0:o.includes(s)))&&!(i&&r.has(t.key))})},q=":host{font-family:var(--luzmo-font-family)}:host{--var: blue}";var z=Object.defineProperty,v=Object.getOwnPropertyDescriptor,a=(d,s,i,r)=>{for(var t=r>1?void 0:r?v(s,i):s,o=d.length-1,n;o>=0;o--)(n=d[o])&&(t=(r?n(s,i,t):n(t))||t);return r&&t&&z(s,i,t),t};exports.LuzmoFilterExpressionPicker=class extends u.SizedMixin(u.LuzmoElement,{validSizes:Object.values(u.ElementSizes)}){constructor(){super(...arguments),this.language="en",this.hasLabel=!1,this.allowEmpty=!1,this.placeholder="",this.disabled=!1,this.invalid=!1,this.isFormula=!1,this._expressionConfigurations=x()}static get styles(){return[h.unsafeCSS(q)]}_sendChangeEvent(){var i,r,t,o,n,l,c;if(this.disabled)return;const s={expression:(i=this.filter)==null?void 0:i.expression};(o=(t=(r=this.filter)==null?void 0:r.parameters)==null?void 0:t[1])!=null&&o.unit&&(s.unit=(c=(l=(n=this.filter)==null?void 0:n.parameters)==null?void 0:l[1])==null?void 0:c.unit),this.dispatchEvent(new CustomEvent("expression-selected",{bubbles:!0,composed:!0,cancelable:!0,detail:s}))}setExpression(s){var t,o;this._richExpression=(o=(t=s==null?void 0:s.detail)==null?void 0:t.value)==null?void 0:o[0];const i=this._expressionConfigurations.find(n=>n.id===this._richExpression),r=structuredClone(this.filter);r.expression=i==null?void 0:i.expression,i!=null&&i.unit&&(this._unit=i.unit,r!=null&&r.parameters[0]&&(r.parameters[1]={unit:this._unit})),this.filter=r,this._sendChangeEvent()}willUpdate(s){var g,F,b,w,_,k,E;const i=s.has("language"),r=s.has("filter"),t=s.has("type"),o=s.has("subtype"),n=s.has("isFormula");i&&this.language!==f.getLocale()&&([...f.targetLocales].includes(this.language??"en")||this.language==="en")&&f.setLocale(this.language);const l=y(this.type,this.subtype,this.isFormula),c=["YTD","QTD","MTD","WTD"];if(((g=this.filter)==null?void 0:g.expression)==="to_date"){const m=((b=(F=this.filter)==null?void 0:F.parameters[1])==null?void 0:b.unit)??1;this._unit=m,this._richExpression=c[m-1]??"YTD"}else this._richExpression=(w=this.filter)==null?void 0:w.expression;(t||o||n||r)&&this.filter&&!this.disabled&&!(l!=null&&l.find(m=>{var S;return m.expression===((S=this.filter)==null?void 0:S.expression)}))?(this.invalid=!0,console.warn(`Warning: ${(_=this.filter)==null?void 0:_.expression} is not valid given the type: ${this.type} and subtype: ${this.subtype}`)):this.invalid=!1,!((k=this.filter)!=null&&k.expression)&&!this.allowEmpty&&(this._richExpression=(E=l==null?void 0:l[0])==null?void 0:E.id,this.filter={...this.filter,expression:this._richExpression},this._sendChangeEvent())}render(){var t,o;const s=(t=y(this.type,this.subtype,this.isFormula))==null?void 0:t.map(n=>({value:n.id,label:n.description,shortLabel:n.tiny})),i=this.disabled||!((o=this.filter)!=null&&o.expression)&&!this.allowEmpty,r=h.html`<luzmo-field-label
20
+ "use strict";require("@luzmo/lucero/field-label");require("@luzmo/lucero/menu");require("@luzmo/lucero/select");const c=require("lit"),e=require("@lit/localize"),m=require("@luzmo/lucero/utils"),n=require("lit/decorators.js"),h=require("./set-locale-BRRalqne.cjs"),f=()=>[{id:"? = ?",key:"? = ?",expression:"? = ?",name:e.msg("equals",{desc:"Filter expression for equals comparison"}),description:e.msg("equals",{desc:"Filter expression for equals comparison"}),tiny:e.msg("eq",{desc:"Short form of equals comparison"}),type:["numeric","hierarchy"],subtype:["ip_address"]},{id:"? != ?",key:"? != ?",expression:"? != ?",name:e.msg("not equals",{desc:"Filter expression for not equals comparison"}),description:e.msg("not equals",{desc:"Filter expression for not equals comparison"}),tiny:e.msg("not eq",{desc:"Short form of not equals comparison"}),type:["numeric","hierarchy"],subtype:["ip_address"]},{id:"? in ?",key:"? in ?",expression:"? in ?",name:e.msg("is in",{desc:"Filter expression for in comparison"}),description:e.msg("is in",{desc:"Filter expression for in comparison"}),tiny:e.msg("is in",{desc:"Filter expression for in comparison"}),type:["numeric","hierarchy"],subtype:["ip_address"]},{id:"? not in ?",key:"? not in ?",expression:"? not in ?",name:e.msg("is not in",{desc:"Filter expression for not in comparison"}),description:e.msg("is not in",{desc:"Filter expression for not in comparison"}),tiny:e.msg("is not in",{desc:"Filter expression for not in comparison"}),type:["numeric","hierarchy"],subtype:["ip_address"]},{id:"? like ?",key:"? like ?",expression:"? like ?",name:e.msg("contains",{desc:"Filter expression for contains comparison"}),description:e.msg("contains",{desc:"Filter expression for contains comparison"}),tiny:e.msg("cont",{desc:"Short form of contains comparison in filter expression"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? not like ?",key:"? not like ?",expression:"? not like ?",name:e.msg("does not contain",{desc:"Filter expression for does not contain comparison"}),description:e.msg("does not contain",{desc:"Filter expression for does not contain comparison"}),tiny:e.msg("not cont",{desc:"Short form of does not contain comparison in filter expression"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? starts with ?",key:"? starts with ?",expression:"? starts with ?",name:e.msg("starts with",{desc:"Filter expression for starts with comparison"}),description:e.msg("starts with",{desc:"Filter expression for starts with comparison"}),tiny:e.msg("starts with",{desc:"Filter expression for starts with comparison"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? not starts with ?",key:"? not starts with ?",expression:"? not starts with ?",name:e.msg("does not start with",{desc:"Filter expression for does not start with comparison"}),description:e.msg("does not start with",{desc:"Filter expression for does not start with comparison"}),tiny:e.msg("not starts with",{desc:"Short form of does not start with comparison in filter expression"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? ends with ?",key:"? ends with ?",expression:"? ends with ?",name:e.msg("ends with",{desc:"Filter expression for ends with comparison"}),description:e.msg("ends with",{desc:"Filter expression for ends with comparison"}),tiny:e.msg("ends with",{desc:"Filter expression for ends with comparison"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? not ends with ?",key:"? not ends with ?",expression:"? not ends with ?",name:e.msg("does not end with",{desc:"Filter expression for does not end with comparison"}),description:e.msg("does not end with",{desc:"Filter expression for does not end with comparison"}),tiny:e.msg("not ends with",{desc:"Short form of does not end with comparison in filter expression"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? < ?",key:"? < ?",expression:"? < ?",name:e.msg("less than",{desc:"Filter expression for less than comparison"}),description:e.msg("less than",{desc:"Filter expression for less than comparison"}),tiny:e.msg("less than",{desc:"Filter expression for less than comparison"}),type:["numeric","datetime"],subtype:["ip_address"]},{id:"? <= ?",key:"? <= ?",expression:"? <= ?",name:e.msg("less than or equal",{desc:"Filter expression for less than or equal comparison"}),description:e.msg("less than or equal",{desc:"Filter expression for less than or equal comparison"}),tiny:e.msg("<=",{desc:"Short form of less than or equal comparison in filter expression"}),type:["numeric","datetime"],subtype:["ip_address"]},{id:"? > ?",key:"? > ?",expression:"? > ?",name:e.msg("greater than",{desc:"Filter expression for greater than comparison"}),description:e.msg("greater than",{desc:"Filter expression for greater than comparison"}),tiny:e.msg(">",{desc:"Short form of greater than comparison in filter expression"}),type:["numeric","datetime"],subtype:["ip_address"]},{id:"? >= ?",key:"? >= ?",expression:"? >= ?",name:e.msg("greater than or equal",{desc:"Filter expression for greater than or equal comparison"}),description:e.msg("greater than or equal",{desc:"Filter expression for greater than or equal comparison"}),tiny:e.msg(">=",{desc:"Short form of greater than or equal comparison in filter expression"}),type:["numeric","datetime"],subtype:["ip_address"]},{id:"? between ?",key:"? between ?",expression:"? between ?",name:e.msg("is between",{desc:"Filter expression for between comparison"}),description:e.msg("is between",{desc:"Filter expression for between comparison"}),tiny:e.msg("between",{desc:"Short form of between comparison in filter expression"}),type:[],subtype:["ip_address"]},{id:"last_now",key:"last_now",expression:"last_now",name:e.msg("last (x) periods",{desc:"Filter expression for last (x) periods"}),description:e.msg("last (x) periods",{desc:"Filter expression for last (x) periods"}),tiny:e.msg("last",{desc:"Short form of last (x) periods in filter expression"}),type:["datetime"]},{id:"last_available",key:"last_available",expression:"last_available",name:e.msg("last (x) available periods",{desc:"Filter expression for last (x) available periods"}),description:e.msg("last (x) available periods",{desc:"Filter expression for last (x) available periods"}),tiny:e.msg("last available",{desc:"Short form of last (x) available periods in filter expression"}),type:["datetime"]},{id:"last_completed",key:"last_completed",expression:"last_completed",name:e.msg("last completed period",{desc:"Filter expression for last completed period"}),description:e.msg("last completed (period)",{desc:"Filter expression for last completed period"}),tiny:e.msg("last completed",{desc:"Short form of last completed period in filter expression"}),type:["datetime"]},{id:"next_now",key:"next_now",expression:"next_now",name:e.msg("next (x) periods",{desc:"Filter expression for next (x) periods"}),description:e.msg("next (x) periods",{desc:"Filter expression for next (x) periods"}),tiny:e.msg("next",{desc:"Short form of next (x) periods in filter expression"}),type:["datetime"]},{id:"next_full",key:"next_full",expression:"next_full",name:e.msg("next full (period)",{desc:"Filter expression for next full period"}),description:e.msg("next full (period)",{desc:"Filter expression for next full period"}),tiny:e.msg("next full",{desc:"Short form of next full period in filter expression"}),type:["datetime"]},{id:"WTD",key:"to_date",expression:"to_date",unit:4,name:e.msg("week to date",{desc:"Filter expression for week to date"}),description:e.msg("week to date",{desc:"Filter expression for week to date"}),tiny:e.msg("WTD",{desc:"Short form of week to date in filter expression"}),type:["datetime"]},{id:"MTD",key:"to_date",expression:"to_date",unit:3,name:e.msg("month to date",{desc:"Filter expression for month to date"}),description:e.msg("month to date",{desc:"Filter expression for month to date"}),tiny:e.msg("MTD",{desc:"Short form of month to date in filter expression"}),type:["datetime"]},{id:"QTD",key:"to_date",expression:"to_date",unit:2,name:e.msg("quarter to date",{desc:"Filter expression for quarter to date"}),description:e.msg("quarter to date",{desc:"Filter expression for quarter to date"}),tiny:e.msg("QTD",{desc:"Short form of quarter to date in filter expression"}),type:["datetime"]},{id:"YTD",key:"to_date",expression:"to_date",unit:1,name:e.msg("year to date",{desc:"Filter expression for year to date"}),description:e.msg("year to date",{desc:"Filter expression for year to date"}),tiny:e.msg("YTD",{desc:"Short form of year to date in filter expression"}),type:["datetime"]},{id:"? is null",key:"? is null",expression:"? is null",name:e.msg("is missing",{desc:"Filter expression for is missing"}),description:e.msg("is missing",{desc:"Filter expression for is missing"}),tiny:e.msg("missing",{desc:"Short form of is missing in filter expression"}),type:["numeric","datetime","hierarchy","spatial"],subtype:["ip_address"]},{id:"? is not null",key:"? is not null",expression:"? is not null",name:e.msg("is not missing",{desc:"Filter expression for is not missing"}),description:e.msg("is not missing",{desc:"Filter expression for is not missing"}),tiny:e.msg("not missing",{desc:"Short form of is not missing in filter expression"}),type:["numeric","datetime","hierarchy","spatial"],subtype:["ip_address"]}],u=(a,s,o)=>{const t=new Set(["? in ?","? not in ?"]);return!a&&!s?f():f().filter(i=>(a&&i.type.includes(a)||s&&i.subtype?.includes(s))&&!(o&&t.has(i.key)))},g=":host{font-family:var(--luzmo-font-family)}:host{--var: blue}";var F=Object.defineProperty,b=Object.getOwnPropertyDescriptor,r=(a,s,o,t)=>{for(var i=t>1?void 0:t?b(s,o):s,p=a.length-1,l;p>=0;p--)(l=a[p])&&(i=(t?l(s,o,i):l(i))||i);return t&&i&&F(s,o,i),i};exports.LuzmoFilterExpressionPicker=class extends m.SizedMixin(m.LuzmoElement,{validSizes:Object.values(m.ElementSizes)}){constructor(){super(...arguments),this.language="en",this.hasLabel=!1,this.allowEmpty=!1,this.placeholder="",this.disabled=!1,this.invalid=!1,this.isFormula=!1,this._expressionConfigurations=f()}static get styles(){return[c.unsafeCSS(g)]}_sendChangeEvent(){if(this.disabled)return;const s={expression:this.filter?.expression};this.filter?.parameters?.[1]?.unit&&(s.unit=this.filter?.parameters?.[1]?.unit),this.dispatchEvent(new CustomEvent("expression-selected",{bubbles:!0,composed:!0,cancelable:!0,detail:s}))}setExpression(s){this._richExpression=s?.detail?.value?.[0];const o=this._expressionConfigurations.find(i=>i.id===this._richExpression),t=structuredClone(this.filter);t.expression=o?.expression,o?.unit&&(this._unit=o.unit,t?.parameters[0]&&(t.parameters[1]={unit:this._unit})),this.filter=t,this._sendChangeEvent()}willUpdate(s){const o=s.has("language"),t=s.has("filter"),i=s.has("type"),p=s.has("subtype"),l=s.has("isFormula");o&&this.language!==h.getLocale()&&([...h.targetLocales].includes(this.language??"en")||this.language==="en")&&h.setLocale(this.language);const x=u(this.type,this.subtype,this.isFormula),y=["YTD","QTD","MTD","WTD"];if(this.filter?.expression==="to_date"){const d=this.filter?.parameters[1]?.unit??1;this._unit=d,this._richExpression=y[d-1]??"YTD"}else this._richExpression=this.filter?.expression;(i||p||l||t)&&this.filter&&!this.disabled&&!x?.find(d=>d.expression===this.filter?.expression)?(this.invalid=!0,console.warn(`Warning: ${this.filter?.expression} is not valid given the type: ${this.type} and subtype: ${this.subtype}`)):this.invalid=!1,!this.filter?.expression&&!this.allowEmpty&&(this._richExpression=x?.[0]?.id,this.filter={...this.filter,expression:this._richExpression},this._sendChangeEvent())}render(){const s=u(this.type,this.subtype,this.isFormula)?.map(i=>({value:i.id,label:i.description,shortLabel:i.tiny})),o=this.disabled||!this.filter?.expression&&!this.allowEmpty,t=c.html`<luzmo-field-label
21
21
  for="expression"
22
22
  size=${this.size}
23
23
  >${this.label??e.msg("Select an expression",{desc:"Label for expression picker"})}</luzmo-field-label
24
- >`;return h.html`${this.hasLabel?r:""}
24
+ >`;return c.html`${this.hasLabel?t:""}
25
25
  <luzmo-select
26
26
  label=${this.placeholder??e.msg("Select...")}
27
27
  id="expression"
@@ -29,10 +29,10 @@
29
29
  variant="highlight"
30
30
  selects="single"
31
31
  .language=${this.language}
32
- ?disabled=${i}
32
+ ?disabled=${o}
33
33
  ?invalid=${this.invalid}
34
34
  .options=${s}
35
35
  .value=${[this._richExpression]}
36
36
  @change=${this.setExpression}
37
37
  >
38
- </luzmo-select>`}};a([p.property({type:String,reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"language",2);a([p.property({type:String,reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"filter",2);a([p.property({type:Boolean,attribute:"has-label",reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"hasLabel",2);a([p.property({type:String,reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"label",2);a([p.property({type:Boolean,attribute:"allow-empty",reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"allowEmpty",2);a([p.property({type:String,attribute:"placeholder",reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"placeholder",2);a([p.property({type:Boolean,attribute:"disabled",reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"disabled",2);a([p.property({type:String,attribute:"type",reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"type",2);a([p.property({type:String,attribute:"subtype",reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"subtype",2);a([p.property({type:Boolean,attribute:"invalid",reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"invalid",2);a([p.property({type:Boolean,attribute:"is-formula",reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"isFormula",2);a([p.state()],exports.LuzmoFilterExpressionPicker.prototype,"_richExpression",2);a([p.state()],exports.LuzmoFilterExpressionPicker.prototype,"_unit",2);exports.LuzmoFilterExpressionPicker=a([e.localized()],exports.LuzmoFilterExpressionPicker);customElements.get("luzmo-filter-expression-picker")||customElements.define("luzmo-filter-expression-picker",exports.LuzmoFilterExpressionPicker);exports.getValidExpressions=y;
38
+ </luzmo-select>`}};r([n.property({type:String,reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"language",2);r([n.property({type:String,reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"filter",2);r([n.property({type:Boolean,attribute:"has-label",reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"hasLabel",2);r([n.property({type:String,reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"label",2);r([n.property({type:Boolean,attribute:"allow-empty",reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"allowEmpty",2);r([n.property({type:String,attribute:"placeholder",reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"placeholder",2);r([n.property({type:Boolean,attribute:"disabled",reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"disabled",2);r([n.property({type:String,attribute:"type",reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"type",2);r([n.property({type:String,attribute:"subtype",reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"subtype",2);r([n.property({type:Boolean,attribute:"invalid",reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"invalid",2);r([n.property({type:Boolean,attribute:"is-formula",reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"isFormula",2);r([n.state()],exports.LuzmoFilterExpressionPicker.prototype,"_richExpression",2);r([n.state()],exports.LuzmoFilterExpressionPicker.prototype,"_unit",2);exports.LuzmoFilterExpressionPicker=r([e.localized()],exports.LuzmoFilterExpressionPicker);customElements.get("luzmo-filter-expression-picker")||customElements.define("luzmo-filter-expression-picker",exports.LuzmoFilterExpressionPicker);exports.getValidExpressions=u;
@@ -0,0 +1,121 @@
1
+ /*! * A kit of modern Luzmo Web Components for analytics in your web application.
2
+ *
3
+ * Copyright © 2025 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
+ "use strict";const v=require("@lit-labs/signals"),h=require("@lit/context"),z=require("@lit/task");require("@luzmo/lucero/divider");require("@luzmo/lucero/field-label");require("@luzmo/lucero/icon");require("@luzmo/lucero/multi-language-field");require("@luzmo/lucero/progress-circle");require("@luzmo/lucero/text-field");require("@luzmo/lucero/tooltip");const n=require("lit"),i=require("lit/decorators.js"),g=require("@lit/localize"),d=require("@luzmo/icons"),f=require("./focusable-QLh-LlNt.cjs"),c=require("./sized-mixin-DcvJLFeo.cjs"),b=require("./en--a5SfjnM.cjs"),y=h.createContext(Symbol("slot-store-context")),_=":host{font-family:var(--luzmo-display-settings-font-family, var(--luzmo-font-family));font-size:var(--luzmo-display-settings-font-size, var(--display-settings-font-size));color:var(--luzmo-display-settings-font-color, var(--luzmo-font-color))}.settings-container{display:flex;flex-direction:column;gap:var(--luzmo-display-settings-vertical-gap, var(--luzmo-spacing-2))}.settings-row{display:flex;justify-content:flex-start;align-items:center;gap:var(--luzmo-display-settings-gap, var(--display-settings-gap))}luzmo-divider{margin:var(--luzmo-display-settings-ids-container-vertical-margin, var(--display-settings-ids-container-vertical-margin)) 0}luzmo-tooltip{--tooltip-font-size: var( --luzmo-display-settings-tooltip-font-size, var(--tooltip-font-size) )}.setting{display:flex;align-items:center}.label-action-container{display:flex;align-items:center;justify-content:space-between;gap:var(--luzmo-display-settings-info-to-remove-icon-gap, var(--display-settings-info-to-remove-icon-gap))}.id-button,.remove-button{outline:none;cursor:pointer;border:none;background:none;font-size:var(--luzmo-display-settings-id-button-font-size, var(--luzmo-display-settings-font-size, var(--display-settings-font-size)));color:var(--luzmo-display-settings-font-color, var(--luzmo-font-color))}.remove-button{display:block;width:var(--luzmo-display-settings-remove-button-size, var(--display-settings-remove-button-size));height:var(--luzmo-display-settings-remove-button-size, var(--display-settings-remove-button-size));border-radius:var(--luzmo-display-settings-remove-button-border-radius, 50%)}.remove-button:hover{background-color:var(--luzmo-display-settings-remove-button-background-color-hover, var(--luzmo-background-color-hover))}.remove-button:active,.remove-button:focus{background-color:var(--luzmo-display-settings-remove-button-background-color-down, var(--luzmo-background-color-down))}.remove-button:focus-visible{box-shadow:0 0 0 var(--luzmo-display-settings-remove-button-indicator-thickness, var(--display-settings-remove-button-indicator-thickness)) var(--highcontrast-remove-button-indicator-color, var(--luzmo-display-settings-remove-button-indicator-color, var(--display-settings-remove-button-indicator-color)))}.ids-container{display:flex;flex-direction:column;gap:var(--luzmo-display-settings-ids-container-gap, var(--luzmo-spacing-2));border-radius:50%}.id-label{text-transform:var(--luzmo-display-settings-id-label-text-transform, var(--display-settings-id-label-text-transform));font-size:var(--luzmo-display-settings-id-label-font-size, var(--display-settings-id-label-font-size));color:var(--luzmo-display-settings-id-label-color, var(--display-settings-id-label-color))}.id-value{-webkit-user-select:text;user-select:text;cursor:text}.example-container{line-height:var(--luzmo-display-settings-example-height, var(--display-settings-example-height));font-size:var(--luzmo-display-settings-example-font-size, var(--display-settings-example-font-size));color:var(--luzmo-display-settings-example-color, var(--display-settings-example-color))}.example-container .example-label{font-weight:var(--luzmo-display-settings-example-label-font-weight, var(--display-settings-example-label-font-weight));color:var(--luzmo-display-settings-example-label-color, var(--display-settings-example-label-color))}.example-container .example-language{text-transform:uppercase;color:var(--luzmo-display-settings-example-language-color, var(--display-settings-example-language-color))}.example-container{gap:var(--luzmo-display-settings-example-container-gap, var(--luzmo-spacing-2))}:host{--display-settings-font-family: var(--luzmo-font-family);--display-settings-id-label-text-transform: uppercase;--display-settings-id-label-color: var(--luzmo-secondary);--display-settings-remove-button-indicator-color: var(--luzmo-primary);--display-settings-remove-button-indicator-thickness: var( --luzmo-border-width )}:host{--display-settings-font-size: var(--luzmo-font-size);--display-settings-id-label-font-size: var(--luzmo-font-size-s);--display-settings-gap: var(--luzmo-spacing-3);--display-settings-ids-container-vertical-margin: var(--luzmo-spacing-4);--display-settings-info-to-remove-icon-gap: var(--luzmo-spacing-5);--display-settings-remove-button-size: var(--luzmo-component-height)}:host([size=s]){--display-settings-id-label-font-size: var(--luzmo-font-size-s);--display-settings-font-size: var(--luzmo-font-size-s);--display-settings-gap: var(--luzmo-spacing-3);--display-settings-ids-container-vertical-margin: var(--luzmo-spacing-3);--display-settings-info-to-remove-icon-gap: var(--luzmo-spacing-4);--display-settings-remove-button-size: var(--luzmo-component-height-s)}:host([size=l]){--display-settings-id-label-font-size: var(--luzmo-font-size);--display-settings-font-size: var(--luzmo-font-size-l);--display-settings-gap: var(--luzmo-spacing-4);--display-settings-ids-container-vertical-margin: var(--luzmo-spacing-5);--display-settings-info-to-remove-icon-gap: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--display-settings-remove-button-size: var(--luzmo-component-height-l)}:host([size=xl]){--display-settings-id-label-font-size: var(--luzmo-font-size-l);--display-settings-font-size: var(--luzmo-font-size-xl);--display-settings-gap: var(--luzmo-spacing-5);--display-settings-ids-container-vertical-margin: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--display-settings-info-to-remove-icon-gap: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-2) );--display-settings-remove-button-size: var(--luzmo-component-height-xl)}:host{--display-settings-example-font-size: var(--luzmo-font-size);--display-settings-example-color: var(--luzmo-font-color);--display-settings-example-label-font-weight: bold;--display-settings-example-label-color: var(--luzmo-primary);--display-settings-example-language-color: var(--luzmo-primary)}:host{--display-settings-example-height: var(--luzmo-component-height)}:host([size=s]){--display-settings-example-height: var(--luzmo-component-height-s);--display-settings-example-font-size: var(--luzmo-font-size-s)}:host([size=l]){--display-settings-example-height: var(--luzmo-component-height-l);--display-settings-example-font-size: var(--luzmo-font-size)}:host([size=xl]){--display-settings-example-height: var(--luzmo-component-height-xl);--display-settings-example-font-size: var(--luzmo-font-size-l)}";var C=Object.defineProperty,s=(m,t,o,p)=>{for(var a=void 0,r=m.length-1,u;r>=0;r--)(u=m[r])&&(a=u(t,o,a)||a);return a&&C(t,o,a),a};class e extends v.SignalWatcher(c.SizedMixin(f.LuzmoElement,{validSizes:Object.values(c.ElementSizes)})){constructor(){super(...arguments),this._loadDisplaySettings=new z.Task(this,{task:async([t,o,p,a,r,u])=>{const l=[];u&&l.push("grandTotals"),p&&l.push("periodOverPeriod"),(t==="numeric"||t==="mixed"&&this._currentSlotContent?.type==="numeric")&&l.push("numeric"),t!=="numeric"&&this._currentSlotContent?.type==="datetime"&&l.push("datetime"),!["numeric","mixed"].includes(t??"")&&this._currentSlotContent?.type==="numeric"&&!a&&l.push("binning"),p&&!this._settingsTypeLoaded.periodOverPeriod&&(await Promise.resolve().then(()=>require("./display-settings-period-over-period/index.cjs")),this._settingsTypeLoaded.periodOverPeriod=!0),l.length>0&&!o&&(l.includes("numeric")&&!this._settingsTypeLoaded.numeric?(await Promise.resolve().then(()=>require("./display-settings-numeric/index.cjs")),this._settingsTypeLoaded.numeric=!0):l.includes("datetime")&&!this._settingsTypeLoaded.datetime&&r?(await Promise.resolve().then(()=>require("./display-settings-datetime/index.cjs")),this._settingsTypeLoaded.datetime=!0):l.includes("binning")&&!this._settingsTypeLoaded.binning?(await Promise.resolve().then(()=>require("./display-settings-binning/index.cjs")),this._settingsTypeLoaded.binning=!0):l.includes("grandTotals")&&!this._settingsTypeLoaded.grandTotals&&(await Promise.resolve().then(()=>require("./display-settings-grand-totals/index.cjs")),this._settingsTypeLoaded.grandTotals=!0))},args:()=>[this.slotType,this.hideDisplaySettings,this._store?.periodOverPeriodUiType.get(),this.isBinningDisabled,this.areDatetimeOptionsEnabled,this.areGrandTotalsEnabled,this.slotContent]}),this.language="en",this.contentLanguage="en",this.slotType="numeric",this.slotContent={},this._showIds=!1,this.measureColumns=[],this._settingsTypeLoaded={binning:!1,datetime:!1,numeric:!1,grandTotals:!1,periodOverPeriod:!1,hierarchy:!0},this._currentSlotContent={}}static get styles(){return[n.unsafeCSS(_)]}_datasetDatetimeColumns(){return this._store?.linkedDataset.get().flatMap(t=>t.columns?.filter(o=>o.type==="datetime").map(o=>({...o,datasetId:t.id})))}willUpdate(){const t=this._store?.activeSlotContents.get(),o=this._store?.periodOverPeriodUiType.get();this.periodOverPeriodUiType!==o&&(this.periodOverPeriodUiType=o),t&&t!==this._currentSlotContent&&(this._currentSlotContent=structuredClone(t))}_onSlotContentChange(t){t.stopPropagation(),t.preventDefault(),this._currentSlotContent=structuredClone(t.detail.slotContent),this._sendEvent(),this.requestUpdate()}_onLabelChange(){this._currentSlotContent=structuredClone(this._currentSlotContent),this._currentSlotContent.label=this._multiLanguageFieldElement.value||{},this._sendEvent(),this.requestUpdate()}_sendEvent(){this.dispatchEvent(new CustomEvent("slot-content-changed",{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:{...this._currentSlotContent}}})),this._store&&this._store.updateContent({...this._currentSlotContent})}_removeEvent(){this.dispatchEvent(new CustomEvent("remove-slot-content",{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:this._currentSlotContent}}))}_toggleIds(){this._showIds=!this._showIds}_renderExampleRow(){const t=this.slotType==="numeric"||this.slotType==="mixed"&&this._currentSlotContent.type==="numeric",o=this.slotType!=="datetime"&&this._currentSlotContent.type==="datetime"&&this.areDatetimeOptionsEnabled;if(!(t||o))return n.nothing;const p=!this._currentSlotContent.datetimeDisplayMode||this._currentSlotContent.datetimeDisplayMode==="default",a=t?1234.56:p?new Date:1,r=b.formatter({...this._currentSlotContent,type:t?"numeric":"datetime"},{locale:this.contentLanguage,level:this._currentSlotContent?.level})(a);return n.html`<div class="settings-row example-container">
21
+ <span class="example-label"
22
+ >${g.msg("Example",{desc:"Label for example"})}:</span
23
+ >
24
+ <span class="example">${r}</span>
25
+ </div>`}_renderDisplaySettings(){return n.html`<div class="settings-container">
26
+ <div class="settings-row">
27
+ <div class="setting">
28
+ <div class="label-container">
29
+ <luzmo-field-label side-aligned="start" .size=${this.size}
30
+ >Label:</luzmo-field-label
31
+ >
32
+ <luzmo-multi-language-field
33
+ .language=${this.language}
34
+ .value=${this._currentSlotContent.label}
35
+ .size=${this.size}
36
+ debounce="200"
37
+ @change=${this._onLabelChange}
38
+ ></luzmo-multi-language-field>
39
+ </div>
40
+ <div class="label-action-container">
41
+ <button class="id-button" @click=${this._toggleIds}>
42
+ ${d.luzmoIcon(d.luzmoInfoCircleOutline)}
43
+ <luzmo-tooltip self-managed placement="top" size=${this.size}>
44
+ Show dataset and column id's
45
+ </luzmo-tooltip>
46
+ </button>
47
+ ${this.showRemoveButton?n.html`<button
48
+ class="remove-button"
49
+ @click=${this._removeEvent}
50
+ >
51
+ ${d.luzmoIcon(d.luzmoTrashOutline)}
52
+ <luzmo-tooltip
53
+ self-managed
54
+ placement="top"
55
+ size=${this.size}
56
+ >
57
+ Remove
58
+ </luzmo-tooltip>
59
+ </button>`:""}
60
+ </div>
61
+ </div>
62
+ </div>
63
+ ${this.areGrandTotalsEnabled?n.html`<luzmo-display-settings-grand-totals
64
+ .language=${this.language}
65
+ .slotContent=${this._currentSlotContent}
66
+ .size=${this.size}
67
+ @slot-content-changed=${this._onSlotContentChange}
68
+ ></luzmo-display-settings-grand-totals>`:""}
69
+ ${this.slotType==="numeric"||this.slotType==="mixed"&&this._currentSlotContent.type==="numeric"?n.html`<luzmo-display-settings-numeric
70
+ .language=${this.language}
71
+ .slotContent=${this._currentSlotContent}
72
+ .size=${this.size}
73
+ .measureColumns=${this.measureColumns}
74
+ .isAggregationDisabled=${this.isAggregationDisabled}
75
+ .isCumulativeSumEnabled=${this.isCumulativeSumEnabled}
76
+ @slot-content-changed=${this._onSlotContentChange}
77
+ ></luzmo-display-settings-numeric>`:""}
78
+ ${this.slotType!=="numeric"&&this._currentSlotContent.type==="datetime"&&this.areDatetimeOptionsEnabled?n.html`<luzmo-display-settings-datetime
79
+ .language=${this.language}
80
+ .contentLanguage=${this.contentLanguage}
81
+ .slotContent=${this._currentSlotContent}
82
+ .size=${this.size}
83
+ @slot-content-changed=${this._onSlotContentChange}
84
+ ></luzmo-display-settings-datetime>`:""}
85
+ ${!["numeric","mixed"].includes(this.slotType??"")&&this._currentSlotContent.type==="numeric"&&!this.isBinningDisabled?n.html`<luzmo-display-settings-binning
86
+ .language=${this.language}
87
+ .slotContent=${this._currentSlotContent}
88
+ .size=${this.size}
89
+ @slot-content-changed=${this._onSlotContentChange}
90
+ ></luzmo-display-settings-binning>`:""}
91
+ ${this.periodOverPeriodUiType?n.html`<luzmo-display-settings-period-over-period
92
+ .language=${this.language}
93
+ .slotContent=${this._currentSlotContent}
94
+ .size=${this.size}
95
+ .periodOverPeriodUiType=${this.periodOverPeriodUiType}
96
+ .linkedDatasetDatetimeColumns=${this._datasetDatetimeColumns()}
97
+ @slot-content-changed=${this._onSlotContentChange}
98
+ ></luzmo-display-settings-period-over-period>`:""}
99
+ ${this._renderExampleRow()}
100
+ </div>
101
+ ${this._showIds?n.html` <luzmo-divider></luzmo-divider>
102
+ <div class="ids-container">
103
+ <div>
104
+ <span class="id-label"
105
+ >${this._currentSlotContent.formula?g.msg("Formula",{desc:"Label for formula type"}):g.msg("Column",{desc:"Label for column type"})}:
106
+ </span>
107
+ <span class="id-value">
108
+ ${this._currentSlotContent.formula??this._currentSlotContent.columnId??this._currentSlotContent.column}
109
+ </span>
110
+ </div>
111
+ <div>
112
+ <span class="id-label">Dataset: </span>
113
+ <span class="id-value">
114
+ ${this._currentSlotContent.datasetId??this._currentSlotContent.set}
115
+ </span>
116
+ </div>
117
+ <div></div>
118
+ </div>`:""}`}render(){return this._loadDisplaySettings.render({pending:()=>n.html`<luzmo-progress-circle
119
+ indeterminate
120
+ .size=${this.size}
121
+ ></luzmo-progress-circle>`,complete:()=>this._renderDisplaySettings(),error:()=>this._renderDisplaySettings()})}disconnectedCallback(){super.disconnectedCallback?.(),this._loadDisplaySettings.abort?.()}}s([i.property({type:String})],e.prototype,"language");s([i.property({type:String,attribute:"content-language"})],e.prototype,"contentLanguage");s([i.property({type:Boolean,attribute:"hide-display-settings"})],e.prototype,"hideDisplaySettings");s([i.property({type:Boolean})],e.prototype,"isBinningDisabled");s([i.property({type:Boolean})],e.prototype,"areDatetimeOptionsEnabled");s([i.property({type:Boolean})],e.prototype,"areGrandTotalsEnabled");s([i.property({type:Boolean})],e.prototype,"isAggregationDisabled");s([i.property({type:Boolean})],e.prototype,"isCumulativeSumEnabled");s([i.property({type:String})],e.prototype,"periodOverPeriodUiType");s([i.property({type:Boolean,attribute:"show-remove-button"})],e.prototype,"showRemoveButton");s([i.property({type:String,attribute:"slot-type"})],e.prototype,"slotType");s([i.property()],e.prototype,"slotContent");s([i.state()],e.prototype,"_showIds");s([i.property({type:Array,reflect:!1})],e.prototype,"measureColumns");s([i.query("luzmo-multi-language-field")],e.prototype,"_multiLanguageFieldElement");s([h.consume({context:y,subscribe:!0})],e.prototype,"_store");customElements.get("luzmo-display-settings")||customElements.define("luzmo-display-settings",e);exports.LuzmoDisplaySettings=e;exports.slotContext=y;
@@ -0,0 +1,20 @@
1
+ /*! * A kit of modern Luzmo Web Components for analytics in your web application.
2
+ *
3
+ * Copyright © 2025 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
+ "use strict";var T=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Z={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},X=class{#t=Z;#e=!1;setTimeoutProvider(t){this.#t=t}setTimeout(t,e){return this.#t.setTimeout(t,e)}clearTimeout(t){this.#t.clearTimeout(t)}setInterval(t,e){return this.#t.setInterval(t,e)}clearInterval(t){this.#t.clearInterval(t)}},Q=new X;function Y(t){setTimeout(t,0)}var M=typeof window>"u"||"Deno"in globalThis;function v(){}function tt(t,e){return typeof t=="function"?t(e):t}function et(t){return typeof t=="number"&&t>=0&&t!==1/0}function st(t,e){return Math.max(t+(e||0)-Date.now(),0)}function E(t,e){return typeof t=="function"?t(e):t}function it(t,e){return typeof t=="function"?t(e):t}function U(t,e){const{type:s="all",exact:i,fetchStatus:n,predicate:a,queryKey:o,stale:r}=t;if(o){if(i){if(e.queryHash!==j(o,e.options))return!1}else if(!F(e.queryKey,o))return!1}if(s!=="all"){const u=e.isActive();if(s==="active"&&!u||s==="inactive"&&u)return!1}return!(typeof r=="boolean"&&e.isStale()!==r||n&&n!==e.state.fetchStatus||a&&!a(e))}function x(t,e){const{exact:s,status:i,predicate:n,mutationKey:a}=t;if(a){if(!e.options.mutationKey)return!1;if(s){if(q(e.options.mutationKey)!==q(a))return!1}else if(!F(e.options.mutationKey,a))return!1}return!(i&&e.state.status!==i||n&&!n(e))}function j(t,e){return(e?.queryKeyHashFn||q)(t)}function q(t){return JSON.stringify(t,(e,s)=>R(s)?Object.keys(s).sort().reduce((i,n)=>(i[n]=s[n],i),{}):s)}function F(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(s=>F(t[s],e[s])):!1}var rt=Object.prototype.hasOwnProperty;function $(t,e){if(t===e)return t;const s=L(t)&&L(e);if(!s&&!(R(t)&&R(e)))return e;const n=(s?t:Object.keys(t)).length,a=s?e:Object.keys(e),o=a.length,r=s?new Array(o):{};let u=0;for(let h=0;h<o;h++){const f=s?h:a[h],l=t[f],m=e[f];if(l===m){r[f]=l,(s?h<n:rt.call(t,f))&&u++;continue}if(l===null||m===null||typeof l!="object"||typeof m!="object"){r[f]=m;continue}const w=$(l,m);r[f]=w,w===l&&u++}return n===o&&u===n?t:r}function L(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function R(t){if(!H(t))return!1;const e=t.constructor;if(e===void 0)return!0;const s=e.prototype;return!(!H(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function H(t){return Object.prototype.toString.call(t)==="[object Object]"}function nt(t){return new Promise(e=>{Q.setTimeout(e,t)})}function at(t,e,s){return typeof s.structuralSharing=="function"?s.structuralSharing(t,e):s.structuralSharing!==!1?$(t,e):e}function ot(t,e,s=0){const i=[...t,e];return s&&i.length>s?i.slice(1):i}function ut(t,e,s=0){const i=[e,...t];return s&&i.length>s?i.slice(0,-1):i}var I=Symbol();function J(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===I?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var ht=class extends T{#t;#e;#s;constructor(){super(),this.#s=t=>{if(!M&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#e||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#s=t,this.#e?.(),this.#e=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#t!==t&&(this.#t=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},B=new ht;function ct(){let t,e;const s=new Promise((n,a)=>{t=n,e=a});s.status="pending",s.catch(()=>{});function i(n){Object.assign(s,n),delete s.resolve,delete s.reject}return s.resolve=n=>{i({status:"fulfilled",value:n}),t(n)},s.reject=n=>{i({status:"rejected",reason:n}),e(n)},s}var lt=Y;function ft(){let t=[],e=0,s=r=>{r()},i=r=>{r()},n=lt;const a=r=>{e?t.push(r):n(()=>{s(r)})},o=()=>{const r=t;t=[],r.length&&n(()=>{i(()=>{r.forEach(u=>{s(u)})})})};return{batch:r=>{let u;e++;try{u=r()}finally{e--,e||o()}return u},batchCalls:r=>(...u)=>{a(()=>{r(...u)})},schedule:a,setNotifyFunction:r=>{s=r},setBatchNotifyFunction:r=>{i=r},setScheduler:r=>{n=r}}}var y=ft(),dt=class extends T{#t=!0;#e;#s;constructor(){super(),this.#s=t=>{if(!M&&window.addEventListener){const e=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#e||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#s=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#t!==t&&(this.#t=t,this.listeners.forEach(s=>{s(t)}))}isOnline(){return this.#t}},A=new dt;function yt(t){return Math.min(1e3*2**t,3e4)}function _(t){return(t??"online")==="online"?A.isOnline():!0}var K=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function z(t){let e=!1,s=0,i;const n=ct(),a=()=>n.status!=="pending",o=c=>{if(!a()){const p=new K(c);m(p),t.onCancel?.(p)}},r=()=>{e=!0},u=()=>{e=!1},h=()=>B.isFocused()&&(t.networkMode==="always"||A.isOnline())&&t.canRun(),f=()=>_(t.networkMode)&&t.canRun(),l=c=>{a()||(i?.(),n.resolve(c))},m=c=>{a()||(i?.(),n.reject(c))},w=()=>new Promise(c=>{i=p=>{(a()||h())&&c(p)},t.onPause?.()}).then(()=>{i=void 0,a()||t.onContinue?.()}),d=()=>{if(a())return;let c;const p=s===0?t.initialPromise:void 0;try{c=p??t.fn()}catch(g){c=Promise.reject(g)}Promise.resolve(c).then(l).catch(g=>{if(a())return;const b=t.retry??(M?0:3),C=t.retryDelay??yt,P=typeof C=="function"?C(s,g):C,S=b===!0||typeof b=="number"&&s<b||typeof b=="function"&&b(s,g);if(e||!S){m(g);return}s++,t.onFail?.(s,g),nt(P).then(()=>h()?void 0:w()).then(()=>{e?m(g):d()})})};return{promise:n,status:()=>n.status,cancel:o,continue:()=>(i?.(),n),cancelRetry:r,continueRetry:u,canStart:f,start:()=>(f()?d():w().then(d),n)}}var W=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),et(this.gcTime)&&(this.#t=Q.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(M?1/0:5*60*1e3))}clearGcTimeout(){this.#t&&(Q.clearTimeout(this.#t),this.#t=void 0)}},pt=class extends W{#t;#e;#s;#r;#i;#a;#o;constructor(t){super(),this.#o=!1,this.#a=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#r=t.client,this.#s=this.#r.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#t=G(this.options),this.state=t.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(t){if(this.options={...this.#a,...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=G(this.options);e.data!==void 0&&(this.setData(e.data,{updatedAt:e.dataUpdatedAt,manual:!0}),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#s.remove(this)}setData(t,e){const s=at(this.state.data,t,this.options);return this.#n({data:s,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),s}setState(t,e){this.#n({type:"setState",state:t,setStateOptions:e})}cancel(t){const e=this.#i?.promise;return this.#i?.cancel(t),e?e.then(v).catch(v):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(t=>it(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===I||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>E(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!st(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#i&&(this.#o?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#s.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#n({type:"invalidate"})}async fetch(t,e){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(t&&this.setOptions(t),!this.options.queryFn){const r=this.observers.find(u=>u.options.queryFn);r&&this.setOptions(r.options)}const s=new AbortController,i=r=>{Object.defineProperty(r,"signal",{enumerable:!0,get:()=>(this.#o=!0,s.signal)})},n=()=>{const r=J(this.options,e),h=(()=>{const f={client:this.#r,queryKey:this.queryKey,meta:this.meta};return i(f),f})();return this.#o=!1,this.options.persister?this.options.persister(r,h,this):r(h)},o=(()=>{const r={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:n};return i(r),r})();this.options.behavior?.onFetch(o,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#n({type:"fetch",meta:o.fetchOptions?.meta}),this.#i=z({initialPromise:e?.initialPromise,fn:o.fetchFn,onCancel:r=>{r instanceof K&&r.revert&&this.setState({...this.#e,fetchStatus:"idle"}),s.abort()},onFail:(r,u)=>{this.#n({type:"failed",failureCount:r,error:u})},onPause:()=>{this.#n({type:"pause"})},onContinue:()=>{this.#n({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const r=await this.#i.start();if(r===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(r),this.#s.config.onSuccess?.(r,this),this.#s.config.onSettled?.(r,this.state.error,this),r}catch(r){if(r instanceof K){if(r.silent)return this.#i.promise;if(r.revert){if(this.state.data===void 0)throw r;return this.state.data}}throw this.#n({type:"error",error:r}),this.#s.config.onError?.(r,this),this.#s.config.onSettled?.(this.state.data,r,this),r}finally{this.scheduleGc()}}#n(t){const e=s=>{switch(t.type){case"failed":return{...s,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...mt(s.data,this.options),fetchMeta:t.meta??null};case"success":const i={...s,data:t.data,dataUpdateCount:s.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=t.manual?i:void 0,i;case"error":const n=t.error;return{...s,error:n,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...t.state}}};this.state=e(this.state),y.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#s.notify({query:this,type:"updated",action:t})})}};function mt(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:_(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function G(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,s=e!==void 0,i=s?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}function N(t){return{onFetch:(e,s)=>{const i=e.options,n=e.fetchOptions?.meta?.fetchMore?.direction,a=e.state.data?.pages||[],o=e.state.data?.pageParams||[];let r={pages:[],pageParams:[]},u=0;const h=async()=>{let f=!1;const l=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(e.signal.aborted?f=!0:e.signal.addEventListener("abort",()=>{f=!0}),e.signal)})},m=J(e.options,e.fetchOptions),w=async(d,c,p)=>{if(f)return Promise.reject();if(c==null&&d.pages.length)return Promise.resolve(d);const b=(()=>{const k={client:e.client,queryKey:e.queryKey,pageParam:c,direction:p?"backward":"forward",meta:e.options.meta};return l(k),k})(),C=await m(b),{maxPages:P}=e.options,S=p?ut:ot;return{pages:S(d.pages,C,P),pageParams:S(d.pageParams,c,P)}};if(n&&a.length){const d=n==="backward",c=d?vt:V,p={pages:a,pageParams:o},g=c(i,p);r=await w(p,g,d)}else{const d=t??a.length;do{const c=u===0?o[0]??i.initialPageParam:V(i,r);if(u>0&&c==null)break;r=await w(r,c),u++}while(u<d)}return r};e.options.persister?e.fetchFn=()=>e.options.persister?.(h,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s):e.fetchFn=h}}}function V(t,{pages:e,pageParams:s}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,s[i],s):void 0}function vt(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}var gt=class extends W{#t;#e;#s;#r;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#e=[],this.state=t.state||wt(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#s.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#i({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=z({fn:()=>this.options.mutationFn?this.options.mutationFn(t,s):Promise.reject(new Error("No mutationFn found")),onFail:(a,o)=>{this.#i({type:"failed",failureCount:a,error:o})},onPause:()=>{this.#i({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const i=this.state.status==="pending",n=!this.#r.canStart();try{if(i)e();else{this.#i({type:"pending",variables:t,isPaused:n}),await this.#s.config.onMutate?.(t,this,s);const o=await this.options.onMutate?.(t,s);o!==this.state.context&&this.#i({type:"pending",context:o,variables:t,isPaused:n})}const a=await this.#r.start();return await this.#s.config.onSuccess?.(a,t,this.state.context,this,s),await this.options.onSuccess?.(a,t,this.state.context,s),await this.#s.config.onSettled?.(a,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(a,null,t,this.state.context,s),this.#i({type:"success",data:a}),a}catch(a){try{throw await this.#s.config.onError?.(a,t,this.state.context,this,s),await this.options.onError?.(a,t,this.state.context,s),await this.#s.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(void 0,a,t,this.state.context,s),a}finally{this.#i({type:"error",error:a})}}finally{this.#s.runNext(this)}}#i(t){const e=s=>{switch(t.type){case"failed":return{...s,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...s,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:t.error,failureCount:s.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),y.batch(()=>{this.#e.forEach(s=>{s.onMutationUpdate(t)}),this.#s.notify({mutation:this,type:"updated",action:t})})}};function wt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var bt=class extends T{constructor(t={}){super(),this.config=t,this.#t=new Set,this.#e=new Map,this.#s=0}#t;#e;#s;build(t,e,s){const i=new gt({client:t,mutationCache:this,mutationId:++this.#s,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#t.add(t);const e=D(t);if(typeof e=="string"){const s=this.#e.get(e);s?s.push(t):this.#e.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#t.delete(t)){const e=D(t);if(typeof e=="string"){const s=this.#e.get(e);if(s)if(s.length>1){const i=s.indexOf(t);i!==-1&&s.splice(i,1)}else s[0]===t&&this.#e.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=D(t);if(typeof e=="string"){const i=this.#e.get(e)?.find(n=>n.state.status==="pending");return!i||i===t}else return!0}runNext(t){const e=D(t);return typeof e=="string"?this.#e.get(e)?.find(i=>i!==t&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){y.batch(()=>{this.#t.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(t){const e={exact:!0,...t};return this.getAll().find(s=>x(e,s))}findAll(t={}){return this.getAll().filter(e=>x(t,e))}notify(t){y.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>e.state.isPaused);return y.batch(()=>Promise.all(t.map(e=>e.continue().catch(v))))}};function D(t){return t.options.scope?.id}var Ot=class extends T{constructor(t={}){super(),this.config=t,this.#t=new Map}#t;build(t,e,s){const i=e.queryKey,n=e.queryHash??j(i,e);let a=this.get(n);return a||(a=new pt({client:t,queryKey:i,queryHash:n,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(i)}),this.add(a)),a}add(t){this.#t.has(t.queryHash)||(this.#t.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#t.get(t.queryHash);e&&(t.destroy(),e===t&&this.#t.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){y.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#t.get(t)}getAll(){return[...this.#t.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(s=>U(e,s))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(s=>U(t,s)):e}notify(t){y.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){y.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){y.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ct=class{#t;#e;#s;#r;#i;#a;#o;#n;constructor(t={}){this.#t=t.queryCache||new Ot,this.#e=t.mutationCache||new bt,this.#s=t.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=B.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#n=A.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#n?.(),this.#n=void 0)}isFetching(t){return this.#t.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#e.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#t.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=this.#t.build(this,e),i=s.state.data;return i===void 0?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(E(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return this.#t.findAll(t).map(({queryKey:e,state:s})=>{const i=s.data;return[e,i]})}setQueryData(t,e,s){const i=this.defaultQueryOptions({queryKey:t}),a=this.#t.get(i.queryHash)?.state.data,o=tt(e,a);if(o!==void 0)return this.#t.build(this,i).setData(o,{...s,manual:!0})}setQueriesData(t,e,s){return y.batch(()=>this.#t.findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,e,s)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#t.get(e.queryHash)?.state}removeQueries(t){const e=this.#t;y.batch(()=>{e.findAll(t).forEach(s=>{e.remove(s)})})}resetQueries(t,e){const s=this.#t;return y.batch(()=>(s.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const s={revert:!0,...e},i=y.batch(()=>this.#t.findAll(t).map(n=>n.cancel(s)));return Promise.all(i).then(v).catch(v)}invalidateQueries(t,e={}){return y.batch(()=>(this.#t.findAll(t).forEach(s=>{s.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const s={...e,cancelRefetch:e.cancelRefetch??!0},i=y.batch(()=>this.#t.findAll(t).filter(n=>!n.isDisabled()&&!n.isStatic()).map(n=>{let a=n.fetch(void 0,s);return s.throwOnError||(a=a.catch(v)),n.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(i).then(v)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const s=this.#t.build(this,e);return s.isStaleByTime(E(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(v).catch(v)}fetchInfiniteQuery(t){return t.behavior=N(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(v).catch(v)}ensureInfiniteQueryData(t){return t.behavior=N(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return A.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#s}setDefaultOptions(t){this.#s=t}setQueryDefaults(t,e){this.#r.set(q(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#r.values()],s={};return e.forEach(i=>{F(t,i.queryKey)&&Object.assign(s,i.defaultOptions)}),s}setMutationDefaults(t,e){this.#i.set(q(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#i.values()],s={};return e.forEach(i=>{F(t,i.mutationKey)&&Object.assign(s,i.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#s.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=j(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===I&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#s.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}};class O{constructor(e={}){this.availableDatasets=[],this.apiUrl=e.apiUrl||"https://api.luzmo.com",this.apiVersion=e.apiVersion||"0.1.0",this.authKey=e.authKey||"",this.authToken=e.authToken||"",this.queryClient=new Ct({defaultOptions:{queries:{staleTime:e.staleTime||5*60*1e3,gcTime:e.gcTime||10*60*1e3,retry:e.retry||3,retryDelay:e.retryDelay||(s=>Math.min(1e3*2**s,3e4))}}}),this.initNetworkListeners()}configure(e={}){if(e.apiVersion&&(this.apiVersion=e.apiVersion),e.apiUrl&&(this.apiUrl=e.apiUrl),e.authKey&&(this.authKey=e.authKey),e.authToken&&(this.authToken=e.authToken),e.staleTime||e.gcTime||e.retry){const s={};e.staleTime&&(s.staleTime=e.staleTime),e.gcTime&&(s.gcTime=e.gcTime),e.retry&&(s.retry=e.retry),this.queryClient.setDefaultOptions({queries:{...this.queryClient.getDefaultOptions().queries,...s}})}}initNetworkListeners(){typeof window<"u"&&window.addEventListener("online",()=>{console.warn("Network connection restored, refreshing data..."),this.refreshAll()})}getHeaders(e={}){return{"Content-Type":"application/json",...e}}async fetchApi(e,s,i={}){const n=`${this.apiUrl}/${this.apiVersion}${e}`,o={method:i.method||"POST",headers:this.getHeaders(i.headers),mode:"cors",...i};s!==void 0&&(s.key=this.authKey,s.token=this.authToken,o.body=JSON.stringify(s));try{const r=await fetch(n,o);if(!r.ok){const u=await r.json().catch(()=>null);throw r.status===401||r.status===403?new Error("Authentication failed. Please check your API token."):r.status===404?new Error(`Resource not found: ${e}`):r.status===429?new Error("Rate limit exceeded. Please try again later."):new Error(u?.message||`API request failed with status ${r.status}`)}return await r.json()}catch(r){throw console.error(`API request to ${e} failed:`,r),r instanceof Error&&(r.endpoint=e,r.timestamp=new Date().toISOString()),r}}async fetchAllDatasets(e={}){const s=e.offset||0,i=e.limit||50,n=["datasets",s,i];return await this.queryClient.fetchQuery({queryKey:n,queryFn:async()=>{const a={action:"get",version:this.apiVersion,find:{where:{type:"dataset"},limit:i,offset:s}},o=await this.fetchApi("/securable",a);return{data:o?.rows||[],pagination:{offset:s,limit:i,total:o?.count??0,pages:Math.ceil((o?.count??0)/i)}}}})}async searchDatasets(e,s){if(!e)return[];const i=["datasets","search",e,s];return await this.queryClient.fetchQuery({queryKey:i,queryFn:async()=>{const n={action:"get",version:this.apiVersion,find:{where:{type:"dataset"}}};e?.length>0&&(n.find.search={match_types:["name"],keyphrase:e}),s?.offset&&(n.find.offset=s?.offset),s?.limit&&(n.find.limit=s?.limit);const a=await this.fetchApi("/securable",n),o={data:a?.rows||[]};return s?.limit&&(o.pagination={offset:s?.offset??0,limit:s?.limit,total:a?.count??0,pages:Math.ceil((a?.count??0)/s?.limit)}),o}})}async fetchDatasetsWithColumnsAndFormulas(e){if(!e||e.length===0)throw new Error("At least one dataset ID is required");const s=["datasets",e,this.authKey,this.authToken];return await this.queryClient.fetchQuery({queryKey:s,queryFn:async()=>{const i={action:"get",version:this.apiVersion,find:{where:{type:"dataset",id:{in:e}},attributes:["name","id"],include:[{model:"Column",attributes:["id","name","description","type","subtype","format","hidden","lowestLevel","expression"],separate:!0,order:[["order","asc"]],include:[{model:"Column",attributes:["id","securable_id","hierarchy_enabled","currency_id"],as:"Joins"}]},{model:"Formula",attributes:["id","name","description","type","subtype","format","hidden","lowestLevel","expression"]}]}};return(await this.fetchApi("/securable",i))?.rows||[]}})}async fetchDataset(e){if(!e)throw new Error("Dataset ID is required");const s=["dataset",e];return await this.queryClient.fetchQuery({queryKey:s,queryFn:async()=>{const i={action:"get",version:this.apiVersion,find:{where:{type:"dataset",id:e},attributes:["name","id"],include:[{model:"Column"},{model:"Formula"}]}};return(await this.fetchApi("/securable",i))?.rows?.[0]||null}})}async fetchData(e){if(!e)throw new Error("Query is required");const s=["data",e];return await this.queryClient.fetchQuery({queryKey:s,queryFn:async()=>{const i={action:"get",version:this.apiVersion,find:{queries:[e]}},n=await this.fetchApi("/data",i);return{data:n?.data||[],performance:n?.performance||{}}}})}refreshAll(){this.queryClient.refetchQueries()}invalidateDatasetData(e){e?(this.queryClient.invalidateQueries({queryKey:["dataset",e]}),this.queryClient.invalidateQueries({queryKey:["columns",e]})):this.queryClient.invalidateQueries({queryKey:["datasets"]})}invalidateAll(){this.queryClient.clear()}static getInstance(e={}){return O.instance?Object.keys(e).length>0&&O.instance.configure(e):O.instance=new O(e),O.instance}async fetchDatasetsRecursive(e){if(!e||e.length===0)throw new Error("At least one dataset ID is required");const s=[...new Set(e)],i=new Set,n=new Map,a=o=>{o&&!i.has(o)&&!s.includes(o)&&s.push(o)};for(;s.length>0;){const o=[];for(;s.length>0&&o.length<50;){const r=s.shift();i.has(r)||o.push(r)}if(o.length!==0)try{(await this.fetchDatasetsWithColumnsAndFormulas(o)).forEach(u=>{const h=this.postProcessDatasetMetadata(u);i.add(h.id),this.queryClient.setQueryData(["dataset",h.id],h),(h.outgoingJoins??[]).map(l=>l.securable_id).filter(l=>l&&l!==h.id).forEach(l=>{a(l)}),n.set(h.id,h),this.availableDatasets.some(l=>l.id===h.id)||this.availableDatasets.push({id:h.id,name:h.name,columns:h.columns})})}catch(r){console.error("Error fetching datasets recursively:",r)}}return[...n.values()]}postProcessDatasetMetadata(e){e.dateLoaded=new Date,e.outgoingJoins=[];for(const s of e.columns)if(s.joins?.length>0)for(const i of s.joins)e.outgoingJoins.push(i);return e}getAvailableDatasets(){return this.availableDatasets}getLinkedDatasetsIds(e){const s=this.queryClient.getQueryData(["dataset",e]);return s?(s.outgoingJoins??[]).map(i=>i.securable_id).filter(i=>i&&i!==e):[]}}const qt=O.getInstance();exports.dataBroker=qt;