drizzle-cube 0.4.28 → 0.4.30

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 (382) hide show
  1. package/dist/adapters/anthropic-BIva8k1r.cjs +1 -0
  2. package/dist/adapters/anthropic-B_rg0BhK.js +140 -0
  3. package/dist/adapters/dist-Boc63-1q.cjs +2 -0
  4. package/dist/adapters/dist-De5fzUEM.js +581 -0
  5. package/dist/adapters/express/index.cjs +2 -10
  6. package/dist/adapters/express/index.js +232 -342
  7. package/dist/adapters/fastify/index.cjs +2 -10
  8. package/dist/adapters/fastify/index.js +275 -424
  9. package/dist/adapters/google-CT4kgmBf.js +154 -0
  10. package/dist/adapters/google-Dgo9-Kb5.cjs +2 -0
  11. package/dist/adapters/handler-B8vuFQYP.cjs +25 -0
  12. package/dist/adapters/handler-D-2-6uLM.js +2951 -0
  13. package/dist/adapters/hono/index.cjs +2 -10
  14. package/dist/adapters/hono/index.js +307 -402
  15. package/dist/adapters/mcp-prompts-BAutSQYA.js +344 -0
  16. package/dist/adapters/mcp-prompts-DsAkafVn.cjs +5 -0
  17. package/dist/adapters/mcp-transport-CuugoG8t.js +7821 -0
  18. package/dist/adapters/mcp-transport-Dpp6hdZe.cjs +253 -0
  19. package/dist/adapters/nextjs/index.cjs +1 -9
  20. package/dist/adapters/nextjs/index.js +377 -600
  21. package/dist/adapters/openai-CjBvA6mK.js +4114 -0
  22. package/dist/adapters/openai-DhLE0A9Z.cjs +1 -0
  23. package/dist/adapters/openai-Zjw4Zo4R.js +153 -0
  24. package/dist/adapters/openai-eJBw3LfQ.cjs +16 -0
  25. package/dist/adapters/types.cjs +0 -1
  26. package/dist/adapters/types.js +0 -1
  27. package/dist/adapters/utils-ChhNGUOF.js +5396 -0
  28. package/dist/adapters/utils-CwJplXR5.cjs +15 -0
  29. package/dist/adapters/utils.cjs +1 -19
  30. package/dist/adapters/utils.js +2 -21333
  31. package/dist/client/charts.js +15 -186
  32. package/dist/client/chunks/DashboardEditModal-C076pscL.js +6678 -0
  33. package/dist/client/chunks/DashboardEditModal-C076pscL.js.map +1 -0
  34. package/dist/client/chunks/FieldSearchModal-C0DjSWk3.js +2631 -0
  35. package/dist/client/chunks/FieldSearchModal-C0DjSWk3.js.map +1 -0
  36. package/dist/client/chunks/RetentionCombinedChart-DuGXc-AP.js +270 -0
  37. package/dist/client/chunks/RetentionCombinedChart-DuGXc-AP.js.map +1 -0
  38. package/dist/client/chunks/RetentionCombinedChart.config-DprbXd1N.js +56 -0
  39. package/dist/client/chunks/RetentionCombinedChart.config-DprbXd1N.js.map +1 -0
  40. package/dist/client/chunks/RetentionHeatmap-BoGY6mlZ.js +193 -0
  41. package/dist/client/chunks/RetentionHeatmap-BoGY6mlZ.js.map +1 -0
  42. package/dist/client/chunks/RetentionHeatmap.config-cbaNExVy.js +25 -0
  43. package/dist/client/chunks/RetentionHeatmap.config-cbaNExVy.js.map +1 -0
  44. package/dist/client/chunks/analysis-builder-DF0XntqC.js +6111 -0
  45. package/dist/client/chunks/analysis-builder-DF0XntqC.js.map +1 -0
  46. package/dist/client/chunks/analysis-builder-shared-2QhKYbs6.js +3114 -0
  47. package/dist/client/chunks/analysis-builder-shared-2QhKYbs6.js.map +1 -0
  48. package/dist/client/chunks/chart-activity-grid-CNES9VBk.js +803 -0
  49. package/dist/client/chunks/chart-activity-grid-CNES9VBk.js.map +1 -0
  50. package/dist/client/chunks/chart-area-CRJc3KOu.js +449 -0
  51. package/dist/client/chunks/chart-area-CRJc3KOu.js.map +1 -0
  52. package/dist/client/chunks/chart-bar-DD2PjJ5n.js +270 -0
  53. package/dist/client/chunks/chart-bar-DD2PjJ5n.js.map +1 -0
  54. package/dist/client/chunks/chart-box-plot-BcqleldJ.js +377 -0
  55. package/dist/client/chunks/chart-box-plot-BcqleldJ.js.map +1 -0
  56. package/dist/client/chunks/chart-bubble-BmQkVk4K.js +273 -0
  57. package/dist/client/chunks/chart-bubble-BmQkVk4K.js.map +1 -0
  58. package/dist/client/chunks/chart-candlestick-C3Rep469.js +306 -0
  59. package/dist/client/chunks/chart-candlestick-C3Rep469.js.map +1 -0
  60. package/dist/client/chunks/chart-config-activity-grid-USo7JrPh.js +51 -0
  61. package/dist/client/chunks/chart-config-activity-grid-USo7JrPh.js.map +1 -0
  62. package/dist/client/chunks/chart-config-area-D_ZufYzg.js +93 -0
  63. package/dist/client/chunks/chart-config-area-D_ZufYzg.js.map +1 -0
  64. package/dist/client/chunks/chart-config-bar-BCi2Wmd6.js +87 -0
  65. package/dist/client/chunks/chart-config-bar-BCi2Wmd6.js.map +1 -0
  66. package/dist/client/chunks/chart-config-box-plot-afKLzJSp.js +35 -0
  67. package/dist/client/chunks/chart-config-box-plot-afKLzJSp.js.map +1 -0
  68. package/dist/client/chunks/chart-config-bubble-CgbBjPv8.js +82 -0
  69. package/dist/client/chunks/chart-config-bubble-CgbBjPv8.js.map +1 -0
  70. package/dist/client/chunks/chart-config-candlestick-7boGjZ-A.js +72 -0
  71. package/dist/client/chunks/chart-config-candlestick-7boGjZ-A.js.map +1 -0
  72. package/dist/client/chunks/chart-config-data-table-Cl7sBasW.js +30 -0
  73. package/dist/client/chunks/chart-config-data-table-Cl7sBasW.js.map +1 -0
  74. package/dist/client/chunks/chart-config-funnel-CXPYQtTl.js +93 -0
  75. package/dist/client/chunks/chart-config-funnel-CXPYQtTl.js.map +1 -0
  76. package/dist/client/chunks/chart-config-gauge-DUNEUCvh.js +64 -0
  77. package/dist/client/chunks/chart-config-gauge-DUNEUCvh.js.map +1 -0
  78. package/dist/client/chunks/chart-config-heat-map-BFf1tO11.js +91 -0
  79. package/dist/client/chunks/chart-config-heat-map-BFf1tO11.js.map +1 -0
  80. package/dist/client/chunks/chart-config-kpi-delta-C5k2waIJ.js +94 -0
  81. package/dist/client/chunks/chart-config-kpi-delta-C5k2waIJ.js.map +1 -0
  82. package/dist/client/chunks/chart-config-kpi-number-DptOyhk0.js +75 -0
  83. package/dist/client/chunks/chart-config-kpi-number-DptOyhk0.js.map +1 -0
  84. package/dist/client/chunks/chart-config-kpi-text-D9DdVWqd.js +47 -0
  85. package/dist/client/chunks/chart-config-kpi-text-D9DdVWqd.js.map +1 -0
  86. package/dist/client/chunks/chart-config-line-B3NgLF7K.js +104 -0
  87. package/dist/client/chunks/chart-config-line-B3NgLF7K.js.map +1 -0
  88. package/dist/client/chunks/chart-config-markdown-tlfivQTt.js +117 -0
  89. package/dist/client/chunks/chart-config-markdown-tlfivQTt.js.map +1 -0
  90. package/dist/client/chunks/chart-config-measure-profile-D7XDwrU2.js +82 -0
  91. package/dist/client/chunks/chart-config-measure-profile-D7XDwrU2.js.map +1 -0
  92. package/dist/client/chunks/chart-config-pie-wY0B52PC.js +68 -0
  93. package/dist/client/chunks/chart-config-pie-wY0B52PC.js.map +1 -0
  94. package/dist/client/chunks/chart-config-radar-DRpJBy1M.js +49 -0
  95. package/dist/client/chunks/chart-config-radar-DRpJBy1M.js.map +1 -0
  96. package/dist/client/chunks/chart-config-radial-bar-DCUpXv9G.js +38 -0
  97. package/dist/client/chunks/chart-config-radial-bar-DCUpXv9G.js.map +1 -0
  98. package/dist/client/chunks/chart-config-sankey-CdOhlm4h.js +66 -0
  99. package/dist/client/chunks/chart-config-sankey-CdOhlm4h.js.map +1 -0
  100. package/dist/client/chunks/chart-config-scatter-B2su_x8f.js +61 -0
  101. package/dist/client/chunks/chart-config-scatter-B2su_x8f.js.map +1 -0
  102. package/dist/client/chunks/chart-config-sunburst-BPdjbk18.js +45 -0
  103. package/dist/client/chunks/chart-config-sunburst-BPdjbk18.js.map +1 -0
  104. package/dist/client/chunks/chart-config-tree-map-Cbsh2fe2.js +51 -0
  105. package/dist/client/chunks/chart-config-tree-map-Cbsh2fe2.js.map +1 -0
  106. package/dist/client/chunks/chart-config-waterfall-DGmuZfQF.js +59 -0
  107. package/dist/client/chunks/chart-config-waterfall-DGmuZfQF.js.map +1 -0
  108. package/dist/client/chunks/chart-data-table-DehW1C1G.js +4088 -0
  109. package/dist/client/chunks/chart-data-table-DehW1C1G.js.map +1 -0
  110. package/dist/client/chunks/chart-funnel-BjkpnG5g.js +447 -0
  111. package/dist/client/chunks/chart-funnel-BjkpnG5g.js.map +1 -0
  112. package/dist/client/chunks/chart-gauge-BWW_HEfg.js +424 -0
  113. package/dist/client/chunks/chart-gauge-BWW_HEfg.js.map +1 -0
  114. package/dist/client/chunks/chart-heat-map-BWuOuDcm.js +236 -0
  115. package/dist/client/chunks/chart-heat-map-BWuOuDcm.js.map +1 -0
  116. package/dist/client/chunks/chart-kpi-delta-D5OHtDJx.js +343 -0
  117. package/dist/client/chunks/chart-kpi-delta-D5OHtDJx.js.map +1 -0
  118. package/dist/client/chunks/chart-kpi-number-C9zH-aKC.js +326 -0
  119. package/dist/client/chunks/chart-kpi-number-C9zH-aKC.js.map +1 -0
  120. package/dist/client/chunks/chart-kpi-text-ChVn3S7j.js +149 -0
  121. package/dist/client/chunks/chart-kpi-text-ChVn3S7j.js.map +1 -0
  122. package/dist/client/chunks/chart-line-DOIMkP0b.js +431 -0
  123. package/dist/client/chunks/chart-line-DOIMkP0b.js.map +1 -0
  124. package/dist/client/chunks/chart-markdown-DXxc43w1.js +3457 -0
  125. package/dist/client/chunks/chart-markdown-DXxc43w1.js.map +1 -0
  126. package/dist/client/chunks/chart-measure-profile-C6wrr9il.js +179 -0
  127. package/dist/client/chunks/chart-measure-profile-C6wrr9il.js.map +1 -0
  128. package/dist/client/chunks/chart-pie-BU_FgwDc.js +172 -0
  129. package/dist/client/chunks/chart-pie-BU_FgwDc.js.map +1 -0
  130. package/dist/client/chunks/chart-radar-DlufwnAX.js +154 -0
  131. package/dist/client/chunks/chart-radar-DlufwnAX.js.map +1 -0
  132. package/dist/client/chunks/chart-radial-bar-B5vS_Aw5.js +148 -0
  133. package/dist/client/chunks/chart-radial-bar-B5vS_Aw5.js.map +1 -0
  134. package/dist/client/chunks/chart-sankey-FChb26UX.js +222 -0
  135. package/dist/client/chunks/chart-sankey-FChb26UX.js.map +1 -0
  136. package/dist/client/chunks/chart-scatter-DW0cAZ2H.js +255 -0
  137. package/dist/client/chunks/chart-scatter-DW0cAZ2H.js.map +1 -0
  138. package/dist/client/chunks/chart-sunburst-Clf-6WxW.js +221 -0
  139. package/dist/client/chunks/chart-sunburst-Clf-6WxW.js.map +1 -0
  140. package/dist/client/chunks/chart-tree-map-p_VwUJPF.js +298 -0
  141. package/dist/client/chunks/chart-tree-map-p_VwUJPF.js.map +1 -0
  142. package/dist/client/chunks/chart-waterfall-jt44IQ-w.js +237 -0
  143. package/dist/client/chunks/chart-waterfall-jt44IQ-w.js.map +1 -0
  144. package/dist/client/chunks/charts-core-CUVzf4cV.js +215 -0
  145. package/dist/client/chunks/charts-core-CUVzf4cV.js.map +1 -0
  146. package/dist/client/chunks/charts-loader-AGpph8_I.js +259 -0
  147. package/dist/client/chunks/charts-loader-AGpph8_I.js.map +1 -0
  148. package/dist/client/chunks/core-D1TOj17W.js +845 -0
  149. package/dist/client/chunks/core-D1TOj17W.js.map +1 -0
  150. package/dist/client/chunks/dist-DDBeV_JI.js +847 -0
  151. package/dist/client/chunks/dist-DDBeV_JI.js.map +1 -0
  152. package/dist/client/chunks/javascript-BBwTSo6e.js +438 -0
  153. package/dist/client/chunks/javascript-BBwTSo6e.js.map +1 -0
  154. package/dist/client/chunks/json-BpTrLZSh.js +38 -0
  155. package/dist/client/chunks/json-BpTrLZSh.js.map +1 -0
  156. package/dist/client/chunks/lazyChartConfigRegistry-BjhxDaSf.js +149 -0
  157. package/dist/client/chunks/lazyChartConfigRegistry-BjhxDaSf.js.map +1 -0
  158. package/dist/client/chunks/providers-DX3Vw5kc.js +7 -0
  159. package/dist/client/chunks/providers-DX3Vw5kc.js.map +1 -0
  160. package/dist/client/chunks/retention-UEXlSdZ-.js +132 -0
  161. package/dist/client/chunks/retention-UEXlSdZ-.js.map +1 -0
  162. package/dist/client/chunks/rolldown-runtime-lc2dmIiU.js +20 -0
  163. package/dist/client/chunks/schema-visualization-ZugB4Io9.js +1073 -0
  164. package/dist/client/chunks/schema-visualization-ZugB4Io9.js.map +1 -0
  165. package/dist/client/chunks/sql-B0chxcEK.js +120 -0
  166. package/dist/client/chunks/sql-B0chxcEK.js.map +1 -0
  167. package/dist/client/chunks/syntaxHighlighting-87bOwTxj.js +30 -0
  168. package/dist/client/chunks/syntaxHighlighting-87bOwTxj.js.map +1 -0
  169. package/dist/client/chunks/useDebounce-BQjNWndQ.js +1394 -0
  170. package/dist/client/chunks/useDebounce-BQjNWndQ.js.map +1 -0
  171. package/dist/client/chunks/useDirtyStateTracking-CgKZWkel.js +66 -0
  172. package/dist/client/chunks/useDirtyStateTracking-CgKZWkel.js.map +1 -0
  173. package/dist/client/chunks/useExplainAI-c_bHxZe5.js +203 -0
  174. package/dist/client/chunks/useExplainAI-c_bHxZe5.js.map +1 -0
  175. package/dist/client/chunks/useNotebookLayout-BFZ_33Kb.js +37 -0
  176. package/dist/client/chunks/useNotebookLayout-BFZ_33Kb.js.map +1 -0
  177. package/dist/client/chunks/utils-A54Ny29G.js +128 -0
  178. package/dist/client/chunks/utils-A54Ny29G.js.map +1 -0
  179. package/dist/client/chunks/vendor-CoPBRumI.js +828 -0
  180. package/dist/client/chunks/vendor-CoPBRumI.js.map +1 -0
  181. package/dist/client/components.js +4 -18
  182. package/dist/client/hooks.js +6 -58
  183. package/dist/client/icons.js +2 -15
  184. package/dist/client/index.js +1061 -1295
  185. package/dist/client/index.js.map +1 -1
  186. package/dist/client/providers.js +3 -9
  187. package/dist/client/styles.css +2 -1
  188. package/dist/client/types.d.ts +1 -0
  189. package/dist/client/utils.js +7 -74
  190. package/dist/client-bundle-stats.html +1 -1
  191. package/dist/server/anthropic-BsNspi1r.js +140 -0
  192. package/dist/server/anthropic-DsCEX6Fm.cjs +1 -0
  193. package/dist/server/dist-CMWZC51B.js +581 -0
  194. package/dist/server/dist-DxegvyZF.cjs +2 -0
  195. package/dist/server/google-BXwMolCu.js +154 -0
  196. package/dist/server/google-DzQWXFwF.cjs +2 -0
  197. package/dist/server/index.cjs +109 -127
  198. package/dist/server/index.d.ts +13 -4
  199. package/dist/server/index.js +15089 -34349
  200. package/dist/server/openai-BPhmb8mi.js +4114 -0
  201. package/dist/server/openai-CLsoLaue.cjs +1 -0
  202. package/dist/server/openai-D1kZ5sdM.js +153 -0
  203. package/dist/server/openai-DkOKbVLC.cjs +16 -0
  204. package/package.json +5 -5
  205. package/dist/adapters/anthropic-BTkjgFpT.cjs +0 -1
  206. package/dist/adapters/anthropic-CTu9E801.js +0 -126
  207. package/dist/adapters/google-BAK9pnQf.cjs +0 -2
  208. package/dist/adapters/google-DficVAsJ.js +0 -146
  209. package/dist/adapters/handler-BV2_dul8.js +0 -2713
  210. package/dist/adapters/handler-LMRPeTNJ.cjs +0 -39
  211. package/dist/adapters/index-BgCeQBuN.cjs +0 -2
  212. package/dist/adapters/index-C3PskWTr.js +0 -5353
  213. package/dist/adapters/index-C45_meK_.js +0 -719
  214. package/dist/adapters/index-ht4NPca9.cjs +0 -23
  215. package/dist/adapters/mcp-transport-B6ZudTSk.js +0 -11010
  216. package/dist/adapters/mcp-transport-DCiSGtp1.cjs +0 -257
  217. package/dist/adapters/openai-BvA6eLs8.cjs +0 -1
  218. package/dist/adapters/openai-mcE24du8.js +0 -131
  219. package/dist/client/charts.js.map +0 -1
  220. package/dist/client/chunks/RetentionCombinedChart--SnU4Y_I.js +0 -256
  221. package/dist/client/chunks/RetentionCombinedChart--SnU4Y_I.js.map +0 -1
  222. package/dist/client/chunks/RetentionCombinedChart.config-Bbp2ghim.js +0 -48
  223. package/dist/client/chunks/RetentionCombinedChart.config-Bbp2ghim.js.map +0 -1
  224. package/dist/client/chunks/RetentionHeatmap-BHYU8MXY.js +0 -178
  225. package/dist/client/chunks/RetentionHeatmap-BHYU8MXY.js.map +0 -1
  226. package/dist/client/chunks/RetentionHeatmap.config-BWf_-vdj.js +0 -29
  227. package/dist/client/chunks/RetentionHeatmap.config-BWf_-vdj.js.map +0 -1
  228. package/dist/client/chunks/analysis-builder-DMFoAkjT.js +0 -6203
  229. package/dist/client/chunks/analysis-builder-DMFoAkjT.js.map +0 -1
  230. package/dist/client/chunks/analysis-builder-shared-CunrT3gi.js +0 -3140
  231. package/dist/client/chunks/analysis-builder-shared-CunrT3gi.js.map +0 -1
  232. package/dist/client/chunks/chart-activity-grid-DCznpK6N.js +0 -347
  233. package/dist/client/chunks/chart-activity-grid-DCznpK6N.js.map +0 -1
  234. package/dist/client/chunks/chart-area-CqKRIUpj.js +0 -234
  235. package/dist/client/chunks/chart-area-CqKRIUpj.js.map +0 -1
  236. package/dist/client/chunks/chart-bar-Bl5jvrU_.js +0 -267
  237. package/dist/client/chunks/chart-bar-Bl5jvrU_.js.map +0 -1
  238. package/dist/client/chunks/chart-box-plot-CzMb00z_.js +0 -322
  239. package/dist/client/chunks/chart-box-plot-CzMb00z_.js.map +0 -1
  240. package/dist/client/chunks/chart-bubble-BF8Z52eW.js +0 -249
  241. package/dist/client/chunks/chart-bubble-BF8Z52eW.js.map +0 -1
  242. package/dist/client/chunks/chart-candlestick-ByWS945g.js +0 -269
  243. package/dist/client/chunks/chart-candlestick-ByWS945g.js.map +0 -1
  244. package/dist/client/chunks/chart-config-activity-grid-CmOqDuOT.js +0 -50
  245. package/dist/client/chunks/chart-config-activity-grid-CmOqDuOT.js.map +0 -1
  246. package/dist/client/chunks/chart-config-area-CK_GVApT.js +0 -77
  247. package/dist/client/chunks/chart-config-area-CK_GVApT.js.map +0 -1
  248. package/dist/client/chunks/chart-config-bar-C8uzktxl.js +0 -71
  249. package/dist/client/chunks/chart-config-bar-C8uzktxl.js.map +0 -1
  250. package/dist/client/chunks/chart-config-box-plot-D_E_SSc2.js +0 -38
  251. package/dist/client/chunks/chart-config-box-plot-D_E_SSc2.js.map +0 -1
  252. package/dist/client/chunks/chart-config-bubble-q3DoQX5F.js +0 -71
  253. package/dist/client/chunks/chart-config-bubble-q3DoQX5F.js.map +0 -1
  254. package/dist/client/chunks/chart-config-candlestick-CRCpD43-.js +0 -70
  255. package/dist/client/chunks/chart-config-candlestick-CRCpD43-.js.map +0 -1
  256. package/dist/client/chunks/chart-config-data-table-B20Y5JCm.js +0 -28
  257. package/dist/client/chunks/chart-config-data-table-B20Y5JCm.js.map +0 -1
  258. package/dist/client/chunks/chart-config-funnel-3eYnGg8M.js +0 -92
  259. package/dist/client/chunks/chart-config-funnel-3eYnGg8M.js.map +0 -1
  260. package/dist/client/chunks/chart-config-gauge-CQx9w3d4.js +0 -64
  261. package/dist/client/chunks/chart-config-gauge-CQx9w3d4.js.map +0 -1
  262. package/dist/client/chunks/chart-config-heat-map-_wEnTnRA.js +0 -77
  263. package/dist/client/chunks/chart-config-heat-map-_wEnTnRA.js.map +0 -1
  264. package/dist/client/chunks/chart-config-kpi-delta-DLGZ2A3X.js +0 -97
  265. package/dist/client/chunks/chart-config-kpi-delta-DLGZ2A3X.js.map +0 -1
  266. package/dist/client/chunks/chart-config-kpi-number-K-wzviXF.js +0 -75
  267. package/dist/client/chunks/chart-config-kpi-number-K-wzviXF.js.map +0 -1
  268. package/dist/client/chunks/chart-config-kpi-text-BjYqwqaJ.js +0 -47
  269. package/dist/client/chunks/chart-config-kpi-text-BjYqwqaJ.js.map +0 -1
  270. package/dist/client/chunks/chart-config-line-JNagi9tf.js +0 -88
  271. package/dist/client/chunks/chart-config-line-JNagi9tf.js.map +0 -1
  272. package/dist/client/chunks/chart-config-markdown-BWQSjJpy.js +0 -97
  273. package/dist/client/chunks/chart-config-markdown-BWQSjJpy.js.map +0 -1
  274. package/dist/client/chunks/chart-config-measure-profile-ZYaMrtws.js +0 -70
  275. package/dist/client/chunks/chart-config-measure-profile-ZYaMrtws.js.map +0 -1
  276. package/dist/client/chunks/chart-config-pie-CNLXb-fr.js +0 -39
  277. package/dist/client/chunks/chart-config-pie-CNLXb-fr.js.map +0 -1
  278. package/dist/client/chunks/chart-config-radar-oxHfRAa3.js +0 -44
  279. package/dist/client/chunks/chart-config-radar-oxHfRAa3.js.map +0 -1
  280. package/dist/client/chunks/chart-config-radial-bar-_Aw3jAEm.js +0 -37
  281. package/dist/client/chunks/chart-config-radial-bar-_Aw3jAEm.js.map +0 -1
  282. package/dist/client/chunks/chart-config-sankey-C8FX9hGF.js +0 -61
  283. package/dist/client/chunks/chart-config-sankey-C8FX9hGF.js.map +0 -1
  284. package/dist/client/chunks/chart-config-scatter-DFKM80eO.js +0 -53
  285. package/dist/client/chunks/chart-config-scatter-DFKM80eO.js.map +0 -1
  286. package/dist/client/chunks/chart-config-sunburst-BmC0NLTU.js +0 -50
  287. package/dist/client/chunks/chart-config-sunburst-BmC0NLTU.js.map +0 -1
  288. package/dist/client/chunks/chart-config-tree-map-DGMbNTaa.js +0 -47
  289. package/dist/client/chunks/chart-config-tree-map-DGMbNTaa.js.map +0 -1
  290. package/dist/client/chunks/chart-config-waterfall-DTyXV_fo.js +0 -60
  291. package/dist/client/chunks/chart-config-waterfall-DTyXV_fo.js.map +0 -1
  292. package/dist/client/chunks/chart-data-table-HwfF-Ujv.js +0 -293
  293. package/dist/client/chunks/chart-data-table-HwfF-Ujv.js.map +0 -1
  294. package/dist/client/chunks/chart-funnel-WmuoWlCq.js +0 -259
  295. package/dist/client/chunks/chart-funnel-WmuoWlCq.js.map +0 -1
  296. package/dist/client/chunks/chart-gauge-Cot4By-w.js +0 -374
  297. package/dist/client/chunks/chart-gauge-Cot4By-w.js.map +0 -1
  298. package/dist/client/chunks/chart-heat-map-bGNtsZMr.js +0 -231
  299. package/dist/client/chunks/chart-heat-map-bGNtsZMr.js.map +0 -1
  300. package/dist/client/chunks/chart-kpi-delta-DeyKMxgq.js +0 -351
  301. package/dist/client/chunks/chart-kpi-delta-DeyKMxgq.js.map +0 -1
  302. package/dist/client/chunks/chart-kpi-number-D1z1gxXO.js +0 -476
  303. package/dist/client/chunks/chart-kpi-number-D1z1gxXO.js.map +0 -1
  304. package/dist/client/chunks/chart-kpi-text-b7q6KWc0.js +0 -165
  305. package/dist/client/chunks/chart-kpi-text-b7q6KWc0.js.map +0 -1
  306. package/dist/client/chunks/chart-line-3Nf-EPqJ.js +0 -450
  307. package/dist/client/chunks/chart-line-3Nf-EPqJ.js.map +0 -1
  308. package/dist/client/chunks/chart-markdown-BT_-MBq1.js +0 -2721
  309. package/dist/client/chunks/chart-markdown-BT_-MBq1.js.map +0 -1
  310. package/dist/client/chunks/chart-measure-profile-BVjUonqU.js +0 -114
  311. package/dist/client/chunks/chart-measure-profile-BVjUonqU.js.map +0 -1
  312. package/dist/client/chunks/chart-pie-DblG6w7g.js +0 -137
  313. package/dist/client/chunks/chart-pie-DblG6w7g.js.map +0 -1
  314. package/dist/client/chunks/chart-radar-BHZbeeTg.js +0 -129
  315. package/dist/client/chunks/chart-radar-BHZbeeTg.js.map +0 -1
  316. package/dist/client/chunks/chart-radial-bar-AlEJC1Jo.js +0 -119
  317. package/dist/client/chunks/chart-radial-bar-AlEJC1Jo.js.map +0 -1
  318. package/dist/client/chunks/chart-sankey-E8vYKjQF.js +0 -189
  319. package/dist/client/chunks/chart-sankey-E8vYKjQF.js.map +0 -1
  320. package/dist/client/chunks/chart-scatter-Bbxqi0iw.js +0 -202
  321. package/dist/client/chunks/chart-scatter-Bbxqi0iw.js.map +0 -1
  322. package/dist/client/chunks/chart-sunburst-BgnTKolT.js +0 -188
  323. package/dist/client/chunks/chart-sunburst-BgnTKolT.js.map +0 -1
  324. package/dist/client/chunks/chart-tree-map-i9LGCLwl.js +0 -284
  325. package/dist/client/chunks/chart-tree-map-i9LGCLwl.js.map +0 -1
  326. package/dist/client/chunks/chart-waterfall-BeIhCm83.js +0 -191
  327. package/dist/client/chunks/chart-waterfall-BeIhCm83.js.map +0 -1
  328. package/dist/client/chunks/charts-core-BUUO36OM.js +0 -692
  329. package/dist/client/chunks/charts-core-BUUO36OM.js.map +0 -1
  330. package/dist/client/chunks/charts-loader-goTYnavu.js +0 -258
  331. package/dist/client/chunks/charts-loader-goTYnavu.js.map +0 -1
  332. package/dist/client/chunks/components-BFgYvFq6.js +0 -10066
  333. package/dist/client/chunks/components-BFgYvFq6.js.map +0 -1
  334. package/dist/client/chunks/core-Y9e-sNfb.js +0 -1068
  335. package/dist/client/chunks/core-Y9e-sNfb.js.map +0 -1
  336. package/dist/client/chunks/flow-utils-CjQZG5qq.js +0 -16
  337. package/dist/client/chunks/flow-utils-CjQZG5qq.js.map +0 -1
  338. package/dist/client/chunks/funnel-utils-CyonoNeC.js +0 -135
  339. package/dist/client/chunks/funnel-utils-CyonoNeC.js.map +0 -1
  340. package/dist/client/chunks/icons-CwvgmdIP.js +0 -1636
  341. package/dist/client/chunks/icons-CwvgmdIP.js.map +0 -1
  342. package/dist/client/chunks/index-CApFCBF9.js +0 -81
  343. package/dist/client/chunks/index-CApFCBF9.js.map +0 -1
  344. package/dist/client/chunks/index-_2PSgbkC.js +0 -1046
  345. package/dist/client/chunks/index-_2PSgbkC.js.map +0 -1
  346. package/dist/client/chunks/javascript-DII1YQGr.js +0 -659
  347. package/dist/client/chunks/javascript-DII1YQGr.js.map +0 -1
  348. package/dist/client/chunks/json-C_6Prymp.js +0 -39
  349. package/dist/client/chunks/json-C_6Prymp.js.map +0 -1
  350. package/dist/client/chunks/providers-Ds7DRmnO.js +0 -554
  351. package/dist/client/chunks/providers-Ds7DRmnO.js.map +0 -1
  352. package/dist/client/chunks/retention-CzCo8262.js +0 -120
  353. package/dist/client/chunks/retention-CzCo8262.js.map +0 -1
  354. package/dist/client/chunks/schema-visualization-B97a1Ybu.js +0 -772
  355. package/dist/client/chunks/schema-visualization-B97a1Ybu.js.map +0 -1
  356. package/dist/client/chunks/sql-IeKX8fQ8.js +0 -616
  357. package/dist/client/chunks/sql-IeKX8fQ8.js.map +0 -1
  358. package/dist/client/chunks/syntaxHighlighting-DAMSW_A6.js +0 -34
  359. package/dist/client/chunks/syntaxHighlighting-DAMSW_A6.js.map +0 -1
  360. package/dist/client/chunks/theme-Dp3hFed1.js +0 -112
  361. package/dist/client/chunks/theme-Dp3hFed1.js.map +0 -1
  362. package/dist/client/chunks/useDirtyStateTracking-CyAXd07d.js +0 -1231
  363. package/dist/client/chunks/useDirtyStateTracking-CyAXd07d.js.map +0 -1
  364. package/dist/client/chunks/useExplainAI-CfQ_JmF1.js +0 -182
  365. package/dist/client/chunks/useExplainAI-CfQ_JmF1.js.map +0 -1
  366. package/dist/client/chunks/vendor-B2EH3V58.js +0 -2892
  367. package/dist/client/chunks/vendor-B2EH3V58.js.map +0 -1
  368. package/dist/client/components.js.map +0 -1
  369. package/dist/client/hooks.js.map +0 -1
  370. package/dist/client/icons.js.map +0 -1
  371. package/dist/client/providers.js.map +0 -1
  372. package/dist/client/utils.js.map +0 -1
  373. package/dist/server/anthropic-BTkjgFpT.cjs +0 -1
  374. package/dist/server/anthropic-CTu9E801.js +0 -126
  375. package/dist/server/google-BAK9pnQf.cjs +0 -2
  376. package/dist/server/google-DficVAsJ.js +0 -146
  377. package/dist/server/index-BgCeQBuN.cjs +0 -2
  378. package/dist/server/index-C3PskWTr.js +0 -5353
  379. package/dist/server/index-C45_meK_.js +0 -719
  380. package/dist/server/index-ht4NPca9.cjs +0 -23
  381. package/dist/server/openai-BvA6eLs8.cjs +0 -1
  382. package/dist/server/openai-mcE24du8.js +0 -131
@@ -1,1231 +0,0 @@
1
- import { u as W, a as U } from "./vendor-B2EH3V58.js";
2
- import { useState as A, useRef as I, useMemo as v, useEffect as q, useCallback as M } from "react";
3
- import { f as $, g as J } from "./providers-Ds7DRmnO.js";
4
- import { b as ee, t as te } from "./funnel-utils-CyonoNeC.js";
5
- import { i as re } from "./flow-utils-CjQZG5qq.js";
6
- const ne = {
7
- // String operators
8
- equals: {
9
- label: "equals",
10
- description: "Exact match",
11
- requiresValues: !0,
12
- supportsMultipleValues: !0,
13
- valueType: "any",
14
- fieldTypes: ["string", "number", "boolean", "time"]
15
- },
16
- notEquals: {
17
- label: "not equals",
18
- description: "Does not match",
19
- requiresValues: !0,
20
- supportsMultipleValues: !0,
21
- valueType: "any",
22
- fieldTypes: ["string", "number", "boolean", "time"]
23
- },
24
- contains: {
25
- label: "contains",
26
- description: "Contains text (case insensitive)",
27
- requiresValues: !0,
28
- supportsMultipleValues: !1,
29
- valueType: "string",
30
- fieldTypes: ["string"]
31
- },
32
- notContains: {
33
- label: "not contains",
34
- description: "Does not contain text",
35
- requiresValues: !0,
36
- supportsMultipleValues: !1,
37
- valueType: "string",
38
- fieldTypes: ["string"]
39
- },
40
- startsWith: {
41
- label: "starts with",
42
- description: "Starts with text",
43
- requiresValues: !0,
44
- supportsMultipleValues: !1,
45
- valueType: "string",
46
- fieldTypes: ["string"]
47
- },
48
- notStartsWith: {
49
- label: "not starts with",
50
- description: "Does not start with text",
51
- requiresValues: !0,
52
- supportsMultipleValues: !1,
53
- valueType: "string",
54
- fieldTypes: ["string"]
55
- },
56
- endsWith: {
57
- label: "ends with",
58
- description: "Ends with text",
59
- requiresValues: !0,
60
- supportsMultipleValues: !1,
61
- valueType: "string",
62
- fieldTypes: ["string"]
63
- },
64
- notEndsWith: {
65
- label: "not ends with",
66
- description: "Does not end with text",
67
- requiresValues: !0,
68
- supportsMultipleValues: !1,
69
- valueType: "string",
70
- fieldTypes: ["string"]
71
- },
72
- like: {
73
- label: "like",
74
- description: "SQL LIKE pattern matching (case sensitive)",
75
- requiresValues: !0,
76
- supportsMultipleValues: !1,
77
- valueType: "string",
78
- fieldTypes: ["string"]
79
- },
80
- notLike: {
81
- label: "not like",
82
- description: "SQL NOT LIKE pattern matching (case sensitive)",
83
- requiresValues: !0,
84
- supportsMultipleValues: !1,
85
- valueType: "string",
86
- fieldTypes: ["string"]
87
- },
88
- ilike: {
89
- label: "ilike",
90
- description: "SQL ILIKE pattern matching (case insensitive)",
91
- requiresValues: !0,
92
- supportsMultipleValues: !1,
93
- valueType: "string",
94
- fieldTypes: ["string"]
95
- },
96
- // Numeric operators
97
- gt: {
98
- label: "greater than",
99
- description: "Greater than value",
100
- requiresValues: !0,
101
- supportsMultipleValues: !1,
102
- valueType: "number",
103
- fieldTypes: ["number", "count", "sum", "avg", "min", "max"]
104
- },
105
- gte: {
106
- label: "greater than or equal",
107
- description: "Greater than or equal to value",
108
- requiresValues: !0,
109
- supportsMultipleValues: !1,
110
- valueType: "number",
111
- fieldTypes: ["number", "count", "sum", "avg", "min", "max"]
112
- },
113
- lt: {
114
- label: "less than",
115
- description: "Less than value",
116
- requiresValues: !0,
117
- supportsMultipleValues: !1,
118
- valueType: "number",
119
- fieldTypes: ["number", "count", "sum", "avg", "min", "max"]
120
- },
121
- lte: {
122
- label: "less than or equal",
123
- description: "Less than or equal to value",
124
- requiresValues: !0,
125
- supportsMultipleValues: !1,
126
- valueType: "number",
127
- fieldTypes: ["number", "count", "sum", "avg", "min", "max"]
128
- },
129
- between: {
130
- label: "between",
131
- description: "Between two values (inclusive)",
132
- requiresValues: !0,
133
- supportsMultipleValues: !1,
134
- valueType: "number",
135
- fieldTypes: ["number", "count", "sum", "avg", "min", "max"]
136
- },
137
- notBetween: {
138
- label: "not between",
139
- description: "Not between two values",
140
- requiresValues: !0,
141
- supportsMultipleValues: !1,
142
- valueType: "number",
143
- fieldTypes: ["number", "count", "sum", "avg", "min", "max"]
144
- },
145
- // Array operators
146
- in: {
147
- label: "in",
148
- description: "Matches any of the provided values",
149
- requiresValues: !0,
150
- supportsMultipleValues: !0,
151
- valueType: "any",
152
- fieldTypes: ["string", "number", "boolean"]
153
- },
154
- notIn: {
155
- label: "not in",
156
- description: "Does not match any of the provided values",
157
- requiresValues: !0,
158
- supportsMultipleValues: !0,
159
- valueType: "any",
160
- fieldTypes: ["string", "number", "boolean"]
161
- },
162
- // Null/Empty operators
163
- set: {
164
- label: "is set",
165
- description: "Is not null/empty",
166
- requiresValues: !1,
167
- supportsMultipleValues: !1,
168
- valueType: "any",
169
- fieldTypes: ["string", "number", "time", "boolean"]
170
- },
171
- notSet: {
172
- label: "is not set",
173
- description: "Is null/empty",
174
- requiresValues: !1,
175
- supportsMultipleValues: !1,
176
- valueType: "any",
177
- fieldTypes: ["string", "number", "time", "boolean"]
178
- },
179
- isEmpty: {
180
- label: "is empty",
181
- description: "Is empty string or null",
182
- requiresValues: !1,
183
- supportsMultipleValues: !1,
184
- valueType: "string",
185
- fieldTypes: ["string"]
186
- },
187
- isNotEmpty: {
188
- label: "is not empty",
189
- description: "Is not empty string and not null",
190
- requiresValues: !1,
191
- supportsMultipleValues: !1,
192
- valueType: "string",
193
- fieldTypes: ["string"]
194
- },
195
- // Date operators
196
- inDateRange: {
197
- label: "in date range",
198
- description: "Between two dates",
199
- requiresValues: !0,
200
- supportsMultipleValues: !1,
201
- valueType: "date",
202
- fieldTypes: ["time"]
203
- },
204
- beforeDate: {
205
- label: "before date",
206
- description: "Before specified date",
207
- requiresValues: !0,
208
- supportsMultipleValues: !1,
209
- valueType: "date",
210
- fieldTypes: ["time"]
211
- },
212
- afterDate: {
213
- label: "after date",
214
- description: "After specified date",
215
- requiresValues: !0,
216
- supportsMultipleValues: !1,
217
- valueType: "date",
218
- fieldTypes: ["time"]
219
- },
220
- // Regex operators
221
- regex: {
222
- label: "matches regex",
223
- description: "Matches regular expression pattern",
224
- requiresValues: !0,
225
- supportsMultipleValues: !1,
226
- valueType: "string",
227
- fieldTypes: ["string"]
228
- },
229
- notRegex: {
230
- label: "not matches regex",
231
- description: "Does not match regular expression pattern",
232
- requiresValues: !0,
233
- supportsMultipleValues: !1,
234
- valueType: "string",
235
- fieldTypes: ["string"]
236
- },
237
- // PostgreSQL array operators
238
- arrayContains: {
239
- label: "array contains all",
240
- description: "Array field contains all specified values (PostgreSQL only)",
241
- requiresValues: !0,
242
- supportsMultipleValues: !0,
243
- valueType: "string",
244
- fieldTypes: ["string"]
245
- },
246
- arrayOverlaps: {
247
- label: "array contains any",
248
- description: "Array field contains any of the specified values (PostgreSQL only)",
249
- requiresValues: !0,
250
- supportsMultipleValues: !0,
251
- valueType: "string",
252
- fieldTypes: ["string"]
253
- },
254
- arrayContained: {
255
- label: "array values in",
256
- description: "All array field values are within specified values (PostgreSQL only)",
257
- requiresValues: !0,
258
- supportsMultipleValues: !0,
259
- valueType: "string",
260
- fieldTypes: ["string"]
261
- }
262
- }, Me = [
263
- { value: "custom", label: "Custom" },
264
- { value: "today", label: "Today" },
265
- { value: "yesterday", label: "Yesterday" },
266
- { value: "this_week", label: "This week" },
267
- { value: "this_month", label: "This month" },
268
- { value: "this_quarter", label: "This quarter" },
269
- { value: "this_year", label: "This year" },
270
- { value: "last_7_days", label: "Last 7 days" },
271
- { value: "last_30_days", label: "Last 30 days" },
272
- { value: "last_n_days", label: "Last N days" },
273
- { value: "last_week", label: "Last week" },
274
- { value: "last_n_weeks", label: "Last N weeks" },
275
- { value: "last_month", label: "Last month" },
276
- { value: "last_12_months", label: "Last 12 months" },
277
- { value: "last_n_months", label: "Last N months" },
278
- { value: "last_quarter", label: "Last quarter" },
279
- { value: "last_n_quarters", label: "Last N quarters" },
280
- { value: "last_year", label: "Last year" },
281
- { value: "last_n_years", label: "Last N years" }
282
- ];
283
- function se(e) {
284
- return "member" in e && "operator" in e && "values" in e;
285
- }
286
- function ie(e) {
287
- return "type" in e && "filters" in e;
288
- }
289
- function ae(e) {
290
- const t = (r) => {
291
- if (se(r))
292
- return r;
293
- if (ie(r)) {
294
- const n = r.filters.map(t);
295
- return r.type === "and" ? { and: n } : { or: n };
296
- }
297
- return r;
298
- };
299
- return e.map(t);
300
- }
301
- function ue(e) {
302
- const t = {};
303
- return e.measures && e.measures.length > 0 && (t.measures = e.measures), e.dimensions && e.dimensions.length > 0 && (t.dimensions = e.dimensions), e.timeDimensions && e.timeDimensions.length > 0 && (t.timeDimensions = e.timeDimensions), e.filters && e.filters.length > 0 && (t.filters = e.filters), e.order && (t.order = e.order), e.limit && (t.limit = e.limit), e.offset && (t.offset = e.offset), e.segments && e.segments.length > 0 && (t.segments = e.segments), t;
304
- }
305
- function X(e) {
306
- const t = ue(e);
307
- return t.filters && t.filters.length > 0 && (t.filters = ae(t.filters)), t;
308
- }
309
- function xe(e) {
310
- const t = [];
311
- for (const [r, n] of Object.entries(ne))
312
- n.fieldTypes.includes(e) && t.push({
313
- operator: r,
314
- label: n.label
315
- });
316
- return t;
317
- }
318
- function qe(e, t) {
319
- const r = {
320
- today: "today",
321
- yesterday: "yesterday",
322
- this_week: "this week",
323
- this_month: "this month",
324
- this_quarter: "this quarter",
325
- this_year: "this year",
326
- last_7_days: "last 7 days",
327
- last_30_days: "last 30 days",
328
- last_week: "last week",
329
- last_month: "last month",
330
- last_quarter: "last quarter",
331
- last_year: "last year",
332
- last_12_months: "last 12 months"
333
- };
334
- if (e.startsWith("last_n_") && t !== void 0 && t > 0) {
335
- const n = e.replace("last_n_", ""), d = n.slice(0, -1);
336
- return t === 1 ? `last ${d}` : `last ${t} ${n}`;
337
- }
338
- return r[e] || e;
339
- }
340
- function Ke(e) {
341
- return e.startsWith("last_n_");
342
- }
343
- function ke(e) {
344
- return e.toISOString().split("T")[0];
345
- }
346
- function B(e) {
347
- const t = /* @__PURE__ */ new WeakSet(), r = (n) => {
348
- if (n === null || typeof n != "object")
349
- return JSON.stringify(n);
350
- if (t.has(n))
351
- return '"[Circular]"';
352
- if (t.add(n), Array.isArray(n))
353
- return `[${n.map((m) => r(m)).join(",")}]`;
354
- const d = n;
355
- return `{${Object.keys(d).sort().map((m) => `${JSON.stringify(m)}:${r(d[m])}`).join(",")}}`;
356
- };
357
- return r(e);
358
- }
359
- function j(e, t) {
360
- const { isValid: r, skip: n = !1, debounceMs: d = 300 } = t, [f, a] = A(null), [m, h] = A(!1), p = I(null), i = I(""), u = I(n), l = v(() => e ? B(e) : "", [e]);
361
- return q(() => {
362
- const c = u.current && !n;
363
- if (u.current = n, !(l === i.current && !c))
364
- return p.current && clearTimeout(p.current), r && !n ? (h(!0), p.current = setTimeout(() => {
365
- i.current = l, a(e), h(!1);
366
- }, d)) : (i.current = l, a(null), h(!1)), () => {
367
- p.current && clearTimeout(p.current);
368
- };
369
- }, [l, r, n, d, e]), {
370
- debouncedValue: f,
371
- isDebouncing: m
372
- };
373
- }
374
- const oe = 300;
375
- function H(e) {
376
- return e ? ["cube", "load", B(e)] : ["cube", "load", null];
377
- }
378
- function le(e) {
379
- if (!e) return !1;
380
- const t = !!(e.measures && e.measures.length > 0), r = !!(e.dimensions && e.dimensions.length > 0), n = !!(e.timeDimensions && e.timeDimensions.length > 0);
381
- return t || r || n;
382
- }
383
- function ce(e, t = {}) {
384
- const {
385
- skip: r = !1,
386
- debounceMs: n = oe,
387
- resetResultSetOnChange: d = !0,
388
- staleTime: f = 60 * 1e3,
389
- keepPreviousData: a = !0
390
- } = t, { cubeApi: m, batchCoordinator: h, enableBatching: p } = $(), i = W(), { features: u } = J(), l = u.manualRefresh ?? !1, [o, c] = A(null), k = le(e), { debouncedValue: w, isDebouncing: T } = j(e, {
391
- isValid: k,
392
- skip: r,
393
- debounceMs: n
394
- }), y = v(() => w ? X(w) : null, [w]), F = y ? B(y) : null, g = v(() => !l || !F || o === null ? !1 : F !== o, [l, F, o]), s = v(() => !y || r ? !1 : !l || o === null ? !0 : o === F, [y, r, l, o, F]), D = I(!1), S = U({
395
- queryKey: H(y),
396
- queryFn: async () => {
397
- if (!y) throw new Error("No query provided");
398
- const C = D.current;
399
- return D.current = !1, C ? m.load(y, { bustCache: !0 }) : p && h ? h.register(y) : m.load(y);
400
- },
401
- enabled: s,
402
- staleTime: f,
403
- placeholderData: a ? (C) => C : void 0
404
- });
405
- q(() => {
406
- !l && y && !r && c(F);
407
- }, [l, y, r, F]), q(() => {
408
- l && s && S.isSuccess && !S.isFetching && y && c(F);
409
- }, [l, s, S.isSuccess, S.isFetching, y, F]);
410
- const R = v(() => {
411
- if (!S.data) return null;
412
- try {
413
- return S.data.rawData();
414
- } catch {
415
- return null;
416
- }
417
- }, [S.data]), x = v(() => {
418
- if (!S.data?.loadResponse) return;
419
- const C = S.data.loadResponse;
420
- return C.results && C.results[0]?.warnings ? C.results[0].warnings : C.warnings;
421
- }, [S.data]), V = M((C) => {
422
- y && (c(F), C?.bustCache && (D.current = !0), i.invalidateQueries({ queryKey: H(y) }));
423
- }, [y, F, i]), E = V, b = () => {
424
- i.removeQueries({ queryKey: ["cube", "load"] });
425
- };
426
- return {
427
- resultSet: v(() => S.data ?? null, [S.data, T, d]),
428
- rawData: R,
429
- isLoading: S.isLoading || T,
430
- isFetching: S.isFetching,
431
- isDebouncing: T,
432
- error: S.error,
433
- debouncedQuery: w,
434
- isValidQuery: k,
435
- refetch: E,
436
- clearCache: b,
437
- needsRefresh: g,
438
- executeQuery: V,
439
- warnings: x
440
- };
441
- }
442
- function Z(e) {
443
- return e.length > 0 && typeof e[0] == "object" && e[0] !== null && "__queryIndex" in e[0];
444
- }
445
- function Ie(e) {
446
- if (!Z(e)) return [];
447
- const t = /* @__PURE__ */ new Set();
448
- for (const r of e) {
449
- const n = r.__queryLabel;
450
- typeof n == "string" && t.add(n);
451
- }
452
- return Array.from(t);
453
- }
454
- function Ae(e) {
455
- if (!Z(e)) return [];
456
- const t = /* @__PURE__ */ new Set();
457
- for (const r of e) {
458
- const n = r.__queryIndex;
459
- typeof n == "number" && t.add(n);
460
- }
461
- return Array.from(t).sort((r, n) => r - n);
462
- }
463
- function fe(e, t, r) {
464
- const n = [];
465
- return e.forEach((d, f) => {
466
- const a = d.rawData(), m = r?.[f] || `Query ${f + 1}`;
467
- a.forEach((h) => {
468
- n.push({
469
- ...h,
470
- __queryIndex: f,
471
- __queryLabel: m
472
- });
473
- });
474
- }), n;
475
- }
476
- function de(e, t, r, n) {
477
- const d = /* @__PURE__ */ new Map();
478
- return e.forEach((f, a) => {
479
- const m = f.rawData(), h = t[a].measures || [];
480
- m.forEach((p) => {
481
- const i = r.map((l) => String(p[l] ?? "")).join("|");
482
- if (!d.has(i)) {
483
- const l = {};
484
- r.forEach((o) => {
485
- l[o] = p[o];
486
- }), d.set(i, l);
487
- }
488
- const u = d.get(i);
489
- h.forEach((l) => {
490
- l in u || (u[l] = p[l]);
491
- }), a === 0 && Object.keys(p).forEach((l) => {
492
- !r.includes(l) && !h.includes(l) && (l in u || (u[l] = p[l]));
493
- });
494
- });
495
- }), Array.from(d.values()).sort((f, a) => {
496
- const m = String(f[r[0]] ?? ""), h = String(a[r[0]] ?? "");
497
- return m.localeCompare(h);
498
- });
499
- }
500
- function pe(e, t, r, n, d) {
501
- return e.length === 0 ? [] : e.length === 1 ? e[0].rawData() : r === "merge" && n && n.length > 0 ? de(e, t, n) : fe(e, t, d);
502
- }
503
- function Oe(e, t) {
504
- const r = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set();
505
- return e.forEach((f) => {
506
- f.measures?.forEach((a) => r.add(a)), f.dimensions?.forEach((a) => n.add(a)), f.timeDimensions?.forEach((a) => d.add(a.dimension));
507
- }), {
508
- measures: Array.from(r),
509
- dimensions: Array.from(n),
510
- timeDimensions: Array.from(d)
511
- };
512
- }
513
- function Be(e, t) {
514
- if (e.measures && e.measures.length > 0) {
515
- const r = e.measures[0], n = r.split(".");
516
- return n.length > 1 ? n[n.length - 1] : r;
517
- }
518
- return `Query ${t + 1}`;
519
- }
520
- function Ne(e, t) {
521
- const r = [];
522
- return e.forEach((n, d) => {
523
- [
524
- ...n.dimensions || [],
525
- ...n.timeDimensions?.map((a) => a.dimension) || []
526
- ].includes(t) || r.push(d);
527
- }), {
528
- isValid: r.length === 0,
529
- missingInQueries: r
530
- };
531
- }
532
- const me = 300;
533
- function P(e) {
534
- return e ? ["cube", "multiLoad", B(e)] : ["cube", "multiLoad", null];
535
- }
536
- function ye(e) {
537
- return !e || !e.queries || e.queries.length < 2 ? !1 : e.queries.filter(
538
- (r) => r.measures && r.measures.length > 0 || r.dimensions && r.dimensions.length > 0 || r.timeDimensions && r.timeDimensions.length > 0
539
- ).length >= 2;
540
- }
541
- function We(e, t = {}) {
542
- const {
543
- skip: r = !1,
544
- debounceMs: n = me,
545
- staleTime: d = 60 * 1e3,
546
- keepPreviousData: f = !0
547
- } = t, { cubeApi: a, batchCoordinator: m, enableBatching: h } = $(), p = W(), i = ye(e), { debouncedValue: u, isDebouncing: l } = j(e, {
548
- isValid: i,
549
- skip: r,
550
- debounceMs: n
551
- }), o = v(() => u ? {
552
- ...u,
553
- queries: u.queries.map((s) => X(s))
554
- } : null, [u]), c = U({
555
- queryKey: P(o),
556
- queryFn: async () => {
557
- if (!o) throw new Error("No config provided");
558
- let s;
559
- h && m ? s = await Promise.all(
560
- o.queries.map((E) => m.register(E))
561
- ) : s = await a.batchLoad(o.queries);
562
- const D = s.map((E) => E && "error" in E && E.error ? new Error(E.error) : null), S = s.map((E, b) => {
563
- if (D[b]) return null;
564
- try {
565
- return E.rawData();
566
- } catch {
567
- return null;
568
- }
569
- }), R = s.filter((E, b) => !D[b]), x = o.queries.filter((E, b) => !D[b]);
570
- return {
571
- data: R.length > 0 ? pe(
572
- R,
573
- x,
574
- o.mergeStrategy,
575
- o.mergeKeys,
576
- o.queryLabels
577
- ) : [],
578
- resultSets: s,
579
- perQueryData: S,
580
- errors: D,
581
- firstError: D.find((E) => E !== null) || null
582
- };
583
- },
584
- enabled: !!o && !r,
585
- staleTime: d,
586
- placeholderData: f ? (s) => s : void 0
587
- }), k = (s) => {
588
- o && (s?.bustCache ? (p.removeQueries({
589
- queryKey: P(o)
590
- }), p.fetchQuery({
591
- queryKey: P(o),
592
- queryFn: async () => {
593
- const D = await a.batchLoad(
594
- o.queries,
595
- { bustCache: !0 }
596
- ), S = D.map((V) => V && "error" in V && V.error ? new Error(V.error) : null), R = o.mergeStrategy === "concat" ? D.flatMap((V) => V?.rawData() || []) : D[0]?.rawData() || [], x = o.mergeStrategy === "concat" ? D.map((V) => V?.rawData() || []) : [];
597
- return {
598
- data: R,
599
- resultSets: D,
600
- perQueryData: x,
601
- errors: S,
602
- firstError: S.find((V) => V !== null) || null
603
- };
604
- }
605
- })) : p.refetchQueries({
606
- queryKey: P(o)
607
- }));
608
- }, w = c.data?.data ?? null, T = c.data?.resultSets ?? null, y = c.data?.perQueryData ?? null, F = c.data?.errors ?? [], g = c.data?.firstError ?? c.error;
609
- return {
610
- data: w,
611
- resultSets: T,
612
- perQueryData: y,
613
- isLoading: c.isLoading || l,
614
- isFetching: c.isFetching,
615
- isDebouncing: l,
616
- error: g,
617
- errors: F,
618
- debouncedConfig: u,
619
- isValidConfig: i,
620
- refetch: k
621
- };
622
- }
623
- const he = 300;
624
- function ge(e) {
625
- if (!e || !e.bindingKey || !e.steps || e.steps.length < 2) return !1;
626
- if (typeof e.bindingKey.dimension == "string") {
627
- if (!e.bindingKey.dimension) return !1;
628
- } else if (Array.isArray(e.bindingKey.dimension) && e.bindingKey.dimension.length === 0)
629
- return !1;
630
- for (const t of e.steps) {
631
- const r = t.query;
632
- if (!(r.measures && r.measures.length > 0 || r.dimensions && r.dimensions.length > 0 || r.timeDimensions && r.timeDimensions.length > 0 || r.filters && r.filters.length > 0)) return !1;
633
- }
634
- return !0;
635
- }
636
- function Ue(e, t = {}) {
637
- const {
638
- skip: r = !1,
639
- debounceMs: n = he,
640
- onComplete: d,
641
- onError: f,
642
- prebuiltServerQuery: a
643
- } = t, { cubeApi: m } = $(), h = W(), { features: p } = J(), i = p.manualRefresh ?? !1, [u, l] = A(null), o = ge(e), { debouncedValue: c, isDebouncing: k } = j(e, {
644
- isValid: o,
645
- skip: r,
646
- debounceMs: n
647
- }), w = v(() => {
648
- if (a)
649
- return a;
650
- if (!c || !o)
651
- return null;
652
- try {
653
- return ee(
654
- c.steps.map((_) => _.query),
655
- c.bindingKey,
656
- c.steps.map((_) => _.name),
657
- c.steps.map((_) => _.timeToConvert || null),
658
- !0
659
- // includeTimeMetrics
660
- );
661
- } catch (Q) {
662
- return console.error("Failed to build server funnel query:", Q), null;
663
- }
664
- }, [a, c, o]), T = v(() => w ? ["cube", "funnel", w.funnel?.steps?.length || 0, JSON.stringify(w)] : ["cube", "funnel", null], [w]), y = w ? B(w) : null, F = v(() => !i || !y || u === null ? !1 : y !== u, [i, y, u]), g = v(() => !w || r ? !1 : !i || u === null ? !0 : u === y, [w, r, i, u, y]);
665
- q(() => {
666
- !i && w && !r && l(y);
667
- }, [i, w, r, y]);
668
- const s = U({
669
- queryKey: T,
670
- queryFn: async () => {
671
- if (!w)
672
- throw new Error("No server query available");
673
- const Q = performance.now();
674
- try {
675
- const _ = await m.load(w), K = _.rawData(), N = performance.now() - Q, O = _.cacheInfo?.();
676
- return {
677
- rawData: K,
678
- executionTime: N,
679
- cacheInfo: O
680
- };
681
- } catch (_) {
682
- const K = _ instanceof Error ? _ : new Error(String(_));
683
- throw f?.(K, 0), K;
684
- }
685
- },
686
- // Enable when we have a server query (either prebuilt or built from config)
687
- // In manual refresh mode, only execute when explicitly triggered
688
- enabled: g,
689
- staleTime: 6e4,
690
- // 1 minute cache
691
- gcTime: 300 * 1e3
692
- // 5 minute garbage collection
693
- });
694
- q(() => {
695
- i && g && s.isSuccess && !s.isFetching && w && l(y);
696
- }, [i, g, s.isSuccess, s.isFetching, w, y]);
697
- const D = v(() => a?.funnel?.steps ? a.funnel.steps.map((Q) => Q.name) : c?.steps?.map((Q) => Q.name), [a, c]), S = v(() => a?.funnel?.steps ? a.funnel.steps.length : c?.steps?.length || 0, [a, c]), R = v(() => s.data?.rawData ? s.data.rawData.length !== S ? [] : te(
698
- s.data.rawData,
699
- D
700
- ) : [], [s.data, S, D]), x = v(() => {
701
- if (!R.length) return [];
702
- const Q = R[0]?.value || 0;
703
- return R.map((_, K) => ({
704
- stepIndex: K,
705
- stepName: _.name,
706
- // Get step ID from config, or generate one for prebuilt queries
707
- stepId: c?.steps?.[K]?.id || `step-${K}`,
708
- data: [],
709
- // Raw data not available from server funnel
710
- bindingKeyValues: [],
711
- // Not available from server funnel
712
- bindingKeyTotalCount: 0,
713
- count: _.value,
714
- conversionRate: _.conversionRate !== null ? _.conversionRate / 100 : null,
715
- cumulativeConversionRate: Q > 0 ? _.value / Q : 0,
716
- executionTime: s.data?.executionTime || 0,
717
- error: null
718
- }));
719
- }, [R, c, s.data?.executionTime]), V = v(() => {
720
- if (!R.length || !c && !a) return null;
721
- const Q = R[0]?.value || 0, _ = R[R.length - 1]?.value || 0, N = {
722
- config: c || {
723
- id: "prebuilt-funnel",
724
- name: "Funnel Analysis",
725
- bindingKey: {
726
- dimension: typeof a?.funnel?.bindingKey == "string" ? a.funnel.bindingKey : a?.funnel?.bindingKey?.[0]?.dimension || ""
727
- },
728
- steps: (a?.funnel?.steps || []).map((O, G) => ({
729
- id: `step-${G}`,
730
- name: O.name,
731
- query: { filters: O.filter ? [O.filter] : [] },
732
- timeToConvert: O.timeToConvert || void 0
733
- }))
734
- },
735
- steps: x,
736
- summary: {
737
- totalEntries: Q,
738
- totalCompletions: _,
739
- overallConversionRate: Q > 0 ? _ / Q : 0,
740
- totalExecutionTime: s.data?.executionTime || 0
741
- },
742
- chartData: R,
743
- status: s.isError ? "error" : s.isLoading ? "executing" : s.isSuccess ? "success" : "idle",
744
- error: s.error,
745
- currentStepIndex: null
746
- };
747
- return s.isSuccess && !s.isFetching && d?.(N), N;
748
- }, [c, a, R, x, s, d]), E = s.isError ? "error" : s.isLoading ? "executing" : s.isSuccess ? "success" : "idle", b = M(async (Q) => {
749
- if (!w) return null;
750
- l(y);
751
- try {
752
- return Q?.bustCache ? (h.removeQueries({ queryKey: T }), await h.fetchQuery({
753
- queryKey: T,
754
- queryFn: async () => {
755
- const _ = performance.now(), K = await m.load(
756
- w,
757
- { bustCache: !0 }
758
- ), N = K.rawData(), O = performance.now() - _, G = K.cacheInfo?.();
759
- return { rawData: N, executionTime: O, cacheInfo: G };
760
- }
761
- })) : await s.refetch(), V;
762
- } catch {
763
- return V;
764
- }
765
- }, [w, s, V, h, T, m, y]), L = M(() => {
766
- }, []), C = M(() => {
767
- h.removeQueries({ queryKey: T });
768
- }, [h, T]);
769
- return {
770
- result: V,
771
- status: E,
772
- isExecuting: s.isLoading || s.isFetching,
773
- isDebouncing: k,
774
- currentStepIndex: null,
775
- // Not applicable for server-side execution
776
- stepLoadingStates: [],
777
- // Not applicable for server-side execution
778
- stepResults: x,
779
- chartData: R,
780
- error: s.error,
781
- execute: b,
782
- cancel: L,
783
- reset: C,
784
- // Not exposing executedQueries - server builds the query internally
785
- executedQueries: [],
786
- // Expose the server query for debug panel display
787
- // This is the actual { funnel: {...} } query sent to the server
788
- serverQuery: w,
789
- cacheInfo: s.data?.cacheInfo ?? null,
790
- // Manual refresh mode support
791
- needsRefresh: F
792
- };
793
- }
794
- function $e(e) {
795
- return e ? ["cube", "funnel", JSON.stringify(e)] : ["cube", "funnel", null];
796
- }
797
- const be = 300;
798
- function we(e) {
799
- if (!e?.flow) return !1;
800
- const { flow: t } = e;
801
- return !(!t.bindingKey || !t.timeDimension || !t.eventDimension || !t.startingStep?.filter || t.stepsBefore < 0 || t.stepsBefore > 5 || t.stepsAfter < 0 || t.stepsAfter > 5);
802
- }
803
- function ve(e) {
804
- if (e.length === 1) {
805
- const t = e[0];
806
- if (t && typeof t == "object" && "nodes" in t && "links" in t)
807
- return t;
808
- }
809
- if (e.length > 0) {
810
- const t = e[0];
811
- if (t && typeof t == "object" && re(t))
812
- return t;
813
- }
814
- return null;
815
- }
816
- function je(e, t = {}) {
817
- const {
818
- skip: r = !1,
819
- debounceMs: n = be,
820
- onComplete: d,
821
- onError: f
822
- } = t, { cubeApi: a } = $(), m = W(), { features: h } = J(), p = h.manualRefresh ?? !1, [i, u] = A(null), l = we(e), { debouncedValue: o, isDebouncing: c } = j(
823
- e,
824
- {
825
- isValid: l,
826
- skip: r,
827
- debounceMs: n
828
- }
829
- ), k = v(() => o ? JSON.stringify(o) : null, [o]), w = v(() => e ? JSON.stringify(e) : null, [e]), T = v(() => o ? ["cube", "flow", k] : ["cube", "flow", null], [o, k]), y = e ? B(e) : null, F = v(() => !p || !y || i === null ? !1 : y !== i, [p, y, i]), g = v(() => !l || !o || r ? !1 : !p || i === null ? !0 : i === y, [l, o, r, p, i, y]);
830
- q(() => {
831
- !p && e && !r && l && u(y);
832
- }, [p, e, r, l, y]);
833
- const s = U({
834
- queryKey: T,
835
- queryFn: async () => {
836
- if (!o)
837
- throw new Error("No flow query available");
838
- const V = performance.now();
839
- try {
840
- const E = await a.load(
841
- o
842
- ), b = E.rawData(), L = performance.now() - V, C = E.cacheInfo?.();
843
- return {
844
- rawData: b,
845
- executionTime: L,
846
- cacheInfo: C,
847
- // Include query key in result so we can detect stale data
848
- // (data from a different query key, e.g., sankey vs sunburst mode)
849
- // We store the RAW query key so we can compare against the current raw query
850
- queryKeyString: w
851
- };
852
- } catch (E) {
853
- const b = E instanceof Error ? E : new Error(String(E));
854
- throw f?.(b), b;
855
- }
856
- },
857
- // In manual refresh mode, only execute when explicitly triggered
858
- enabled: g,
859
- staleTime: 6e4,
860
- // 1 minute cache
861
- gcTime: 300 * 1e3
862
- // 5 minute garbage collection
863
- });
864
- q(() => {
865
- p && g && s.isSuccess && !s.isFetching && o && u(y);
866
- }, [p, g, s.isSuccess, s.isFetching, o, y]);
867
- const D = w !== null && s.data?.queryKeyString !== void 0 && s.data.queryKeyString !== w, S = v(() => {
868
- if (D || !s.data?.rawData) return null;
869
- const V = ve(s.data.rawData);
870
- return V && s.isSuccess && !s.isFetching && d?.(V), V;
871
- }, [s.data, s.isSuccess, s.isFetching, d, D]), R = M((V) => {
872
- o && l && (u(y), V?.bustCache ? (m.removeQueries({ queryKey: T }), m.fetchQuery({
873
- queryKey: T,
874
- queryFn: async () => {
875
- const E = performance.now(), b = await a.load(
876
- o,
877
- { bustCache: !0 }
878
- ), L = b.rawData(), C = performance.now() - E, Q = b.cacheInfo?.();
879
- return { rawData: L, executionTime: C, cacheInfo: Q };
880
- }
881
- })) : s.refetch());
882
- }, [o, l, s, m, T, a, y]), x = M(() => {
883
- m.removeQueries({ queryKey: T });
884
- }, [m, T]);
885
- return {
886
- data: S,
887
- rawData: D ? null : s.data?.rawData ?? null,
888
- cacheInfo: s.data?.cacheInfo ?? null,
889
- isLoading: s.isLoading || D,
890
- isFetching: s.isFetching,
891
- isDebouncing: c,
892
- isExecuting: s.isLoading || s.isFetching || D,
893
- error: s.error,
894
- refetch: R,
895
- reset: x,
896
- serverQuery: o,
897
- // Manual refresh mode support
898
- needsRefresh: F
899
- };
900
- }
901
- function Pe(e) {
902
- return e ? ["cube", "flow", JSON.stringify(e)] : ["cube", "flow", null];
903
- }
904
- const Te = 300;
905
- function Se(e) {
906
- return !(!e || !e.retention || !e.retention.timeDimension || !e.retention.bindingKey || !e.retention.periods || e.retention.periods < 1);
907
- }
908
- function De(e) {
909
- if (e) {
910
- if (typeof e == "string")
911
- return e.split(".").pop();
912
- if (Array.isArray(e) && e.length > 0) {
913
- const t = e[0];
914
- if (t?.dimension)
915
- return t.dimension.split(".").pop();
916
- }
917
- }
918
- }
919
- function Ve(e) {
920
- if (typeof e == "string")
921
- return e;
922
- if (e && typeof e == "object" && !Array.isArray(e)) {
923
- const t = Object.values(e);
924
- if (t.length > 0 && t[0] != null)
925
- return String(t[0]);
926
- }
927
- return null;
928
- }
929
- function Y(e, t, r) {
930
- if (!e || !Array.isArray(e) || e.length === 0)
931
- return { rows: [], periods: [], granularity: t, bindingKeyLabel: r };
932
- const n = e.map((p) => {
933
- const i = p;
934
- return {
935
- period: Number(i.period ?? i.period_number ?? 0),
936
- cohortSize: Number(i.cohortSize ?? i.cohort_size ?? 0),
937
- retainedUsers: Number(i.retainedUsers ?? i.retained_users ?? 0),
938
- retentionRate: Number(i.retentionRate ?? i.retention_rate ?? 0),
939
- // Server returns breakdownValues (object) or breakdownValue (string) or breakdown_value (snake_case)
940
- breakdownValue: Ve(i.breakdownValues) ?? i.breakdownValue ?? i.breakdown_value ?? null
941
- };
942
- }), d = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set();
943
- n.forEach((p) => {
944
- d.add(p.period), p.breakdownValue && f.add(p.breakdownValue);
945
- });
946
- const a = Array.from(d).sort((p, i) => p - i), m = f.size > 0 ? Array.from(f).sort() : void 0, h = Ee(n, m);
947
- return { rows: n, periods: a, breakdownValues: m, summary: h, granularity: t, bindingKeyLabel: r };
948
- }
949
- function Ee(e, t) {
950
- const n = e.filter((f) => f.period === 1).map((f) => f.retentionRate);
951
- return {
952
- totalUsers: e.filter((f) => f.period === 0).reduce((f, a) => f + a.cohortSize, 0),
953
- avgPeriod1Retention: n.length > 0 ? n.reduce((f, a) => f + a, 0) / n.length : 0,
954
- maxPeriod1Retention: n.length > 0 ? Math.max(...n) : 0,
955
- minPeriod1Retention: n.length > 0 ? Math.min(...n) : 0,
956
- segmentCount: t?.length || 1
957
- };
958
- }
959
- function ze(e, t = {}) {
960
- const { skip: r = !1, debounceMs: n = Te, onComplete: d, onError: f, getFieldLabel: a } = t, { cubeApi: m } = $(), h = W(), { features: p } = J(), i = p.manualRefresh ?? !1, [u, l] = A(null), o = Se(e), { debouncedValue: c, isDebouncing: k } = j(e, {
961
- isValid: o,
962
- skip: r,
963
- debounceMs: n
964
- }), w = v(() => c ? ["cube", "retention", JSON.stringify(c)] : ["cube", "retention", null], [c]), T = c ? B(c) : null, y = v(() => !i || !T || u === null ? !1 : T !== u, [i, T, u]), F = v(() => !c || r ? !1 : !i || u === null ? !0 : u === T, [c, r, i, u, T]);
965
- q(() => {
966
- !i && c && !r && l(T);
967
- }, [i, c, r, T]);
968
- const g = U({
969
- queryKey: w,
970
- queryFn: async () => {
971
- if (!c)
972
- throw new Error("No retention query available");
973
- const b = performance.now();
974
- try {
975
- const L = await m.load(c), C = L.rawData(), Q = performance.now() - b, _ = L.cacheInfo?.();
976
- return {
977
- rawData: C,
978
- executionTime: Q,
979
- cacheInfo: _
980
- };
981
- } catch (L) {
982
- const C = L instanceof Error ? L : new Error(String(L));
983
- throw f?.(C), C;
984
- }
985
- },
986
- enabled: F,
987
- staleTime: 6e4,
988
- // 1 minute cache
989
- gcTime: 300 * 1e3
990
- // 5 minute garbage collection
991
- });
992
- q(() => {
993
- i && F && g.isSuccess && !g.isFetching && c && l(T);
994
- }, [i, F, g.isSuccess, g.isFetching, c, T]);
995
- const s = e?.retention?.granularity, D = v(() => {
996
- const b = e?.retention?.bindingKey;
997
- if (b) {
998
- if (typeof b == "string") return b;
999
- if (Array.isArray(b) && b.length > 0)
1000
- return b[0]?.dimension;
1001
- }
1002
- }, [e?.retention?.bindingKey]), S = v(() => {
1003
- if (D && a) {
1004
- const b = a(D);
1005
- if (b && b !== D)
1006
- return b;
1007
- }
1008
- return De(e?.retention?.bindingKey);
1009
- }, [D, a, e?.retention?.bindingKey]), R = v(() => {
1010
- if (!g.data?.rawData) return null;
1011
- const b = Y(
1012
- g.data.rawData,
1013
- s,
1014
- S
1015
- );
1016
- return g.isSuccess && !g.isFetching && d?.(b), b;
1017
- }, [g.data, g.isSuccess, g.isFetching, d, s, S]), x = M(
1018
- async (b) => {
1019
- if (!c) return null;
1020
- b?.bustCache && h.removeQueries({ queryKey: w }), l(T);
1021
- const L = await h.fetchQuery({
1022
- queryKey: w,
1023
- queryFn: async () => {
1024
- const C = await m.load(c), Q = C.rawData(), _ = C.cacheInfo?.();
1025
- return { rawData: Q, executionTime: 0, cacheInfo: _ };
1026
- }
1027
- });
1028
- return Y(L.rawData, s, S);
1029
- },
1030
- [c, h, w, m, T, s, S]
1031
- ), V = M(() => {
1032
- g.refetch();
1033
- }, [g]), E = v(() => g.isError ? "error" : g.isLoading ? "loading" : g.isSuccess ? "success" : "idle", [g.isError, g.isLoading, g.isSuccess]);
1034
- return {
1035
- chartData: R,
1036
- rawData: g.data?.rawData ?? null,
1037
- status: E,
1038
- isLoading: g.isLoading,
1039
- isFetching: g.isFetching,
1040
- isDebouncing: k,
1041
- error: g.error,
1042
- cacheInfo: g.data?.cacheInfo ?? null,
1043
- execute: x,
1044
- refetch: V,
1045
- needsRefresh: y
1046
- };
1047
- }
1048
- function Je(e, t = !0) {
1049
- const [r, n] = A(null), d = I(""), {
1050
- resultSet: f,
1051
- isLoading: a,
1052
- error: m
1053
- } = ce(r, {
1054
- skip: !r || !t || !e,
1055
- debounceMs: 150,
1056
- // Quick debounce for filter searches
1057
- keepPreviousData: !0
1058
- }), h = v(() => {
1059
- if (!f || a || m || !e)
1060
- return [];
1061
- try {
1062
- const u = f.tablePivot(), l = /* @__PURE__ */ new Set();
1063
- return u.forEach((o) => {
1064
- const c = o[e];
1065
- c != null && c !== "" && l.add(c);
1066
- }), Array.from(l);
1067
- } catch (u) {
1068
- return console.error("Error extracting values from result set:", u), [];
1069
- }
1070
- }, [f, a, m, e]);
1071
- q(() => {
1072
- (!e || !t) && (n(null), d.current = "");
1073
- }, [e, t]);
1074
- const p = M(() => {
1075
- if (e) {
1076
- d.current = "";
1077
- try {
1078
- const u = {
1079
- dimensions: [e],
1080
- limit: 25,
1081
- order: { [e]: "asc" }
1082
- };
1083
- n(u);
1084
- } catch (u) {
1085
- console.error("Error creating query:", u);
1086
- }
1087
- }
1088
- }, [e]), i = M((u, l = !1) => {
1089
- if (e && !(!l && u === d.current)) {
1090
- d.current = u;
1091
- try {
1092
- const o = {
1093
- dimensions: [e],
1094
- limit: 25,
1095
- order: { [e]: "asc" }
1096
- };
1097
- u && u.trim() && (o.filters = [{
1098
- member: e,
1099
- operator: "contains",
1100
- values: [u.trim()]
1101
- }]), n(o);
1102
- } catch (o) {
1103
- console.error("Error creating search query:", o);
1104
- }
1105
- }
1106
- }, [e]);
1107
- return {
1108
- values: h,
1109
- loading: a,
1110
- error: m ? m instanceof Error ? m.message : String(m) : null,
1111
- refetch: p,
1112
- searchValues: i
1113
- };
1114
- }
1115
- function Ge(e, t) {
1116
- const [r, n] = A(e);
1117
- return q(() => {
1118
- const d = setTimeout(() => {
1119
- n(e);
1120
- }, t);
1121
- return () => {
1122
- clearTimeout(d);
1123
- };
1124
- }, [e, t]), r;
1125
- }
1126
- const z = 1200, _e = 768;
1127
- function He() {
1128
- const [e, t] = A(
1129
- () => typeof window < "u" ? window.innerWidth : z
1130
- ), r = I(null), n = I(null), d = M((h) => {
1131
- if (r.current && (r.current.disconnect(), r.current = null), n.current = h, h) {
1132
- const p = h.offsetWidth;
1133
- p > 0 && t(p), r.current = new ResizeObserver((i) => {
1134
- const u = i[0]?.contentRect.width;
1135
- u && u > 0 && t(u);
1136
- }), r.current.observe(h);
1137
- }
1138
- }, []);
1139
- q(() => () => {
1140
- r.current && r.current.disconnect();
1141
- }, []), q(() => {
1142
- const h = () => {
1143
- if (n.current) {
1144
- const i = n.current.offsetWidth;
1145
- i > 0 && t(i);
1146
- }
1147
- };
1148
- window.addEventListener("resize", h);
1149
- const p = setTimeout(h, 100);
1150
- return () => {
1151
- window.removeEventListener("resize", h), clearTimeout(p);
1152
- };
1153
- }, []);
1154
- const f = v(() => e >= z ? "desktop" : e >= _e ? "scaled" : "mobile", [e]), a = v(() => f !== "scaled" ? 1 : e / z, [e, f]);
1155
- return {
1156
- containerRef: d,
1157
- containerWidth: e,
1158
- displayMode: f,
1159
- scaleFactor: a,
1160
- isEditable: f === "desktop",
1161
- designWidth: z
1162
- };
1163
- }
1164
- function Ye({
1165
- initialConfig: e,
1166
- onConfigChange: t,
1167
- onSave: r,
1168
- onDirtyStateChange: n
1169
- }) {
1170
- const d = I(e), f = I(!1), a = M(
1171
- async (i) => {
1172
- if (f.current) {
1173
- n && n(!0);
1174
- try {
1175
- r && await r(i), d.current = i, n && n(!1);
1176
- } catch (u) {
1177
- throw console.error("Save failed:", u), u;
1178
- }
1179
- }
1180
- },
1181
- [r, n]
1182
- ), m = M(
1183
- (i) => {
1184
- t && t(i);
1185
- const u = JSON.stringify(i), l = JSON.stringify(d.current);
1186
- u !== l && (f.current = !0, n && n(!0));
1187
- },
1188
- [t, n]
1189
- ), h = M(() => f.current, []), p = M((i) => {
1190
- d.current = i, f.current = !1;
1191
- }, []);
1192
- return {
1193
- handleConfigChange: m,
1194
- handleSave: a,
1195
- hasChanged: h,
1196
- resetInitialConfig: p
1197
- };
1198
- }
1199
- export {
1200
- H as A,
1201
- ke as B,
1202
- Me as D,
1203
- ne as F,
1204
- We as a,
1205
- Ue as b,
1206
- X as c,
1207
- $e as d,
1208
- je as e,
1209
- Pe as f,
1210
- fe as g,
1211
- de as h,
1212
- Z as i,
1213
- Oe as j,
1214
- Ie as k,
1215
- Ae as l,
1216
- pe as m,
1217
- Be as n,
1218
- qe as o,
1219
- ze as p,
1220
- Ge as q,
1221
- xe as r,
1222
- B as s,
1223
- Je as t,
1224
- ce as u,
1225
- Ne as v,
1226
- Ke as w,
1227
- Ye as x,
1228
- He as y,
1229
- P as z
1230
- };
1231
- //# sourceMappingURL=useDirtyStateTracking-CyAXd07d.js.map