drizzle-cube 0.6.3 → 0.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/adapters/compiler-DyyBaLry.cjs +166 -0
  2. package/dist/adapters/{compiler-LKTN9PTt.js → compiler-lG6eNsoI.js} +214 -210
  3. package/dist/adapters/express/index.cjs +1 -1
  4. package/dist/adapters/express/index.js +1 -1
  5. package/dist/adapters/fastify/index.cjs +1 -1
  6. package/dist/adapters/fastify/index.js +1 -1
  7. package/dist/adapters/hono/index.cjs +1 -1
  8. package/dist/adapters/hono/index.js +1 -1
  9. package/dist/adapters/nextjs/index.cjs +1 -1
  10. package/dist/adapters/nextjs/index.d.ts +10 -0
  11. package/dist/adapters/nextjs/index.js +13 -9
  12. package/dist/cjs/adapters/nextjs/index.d.ts +10 -0
  13. package/dist/cjs/client/components/AnalysisBuilder/utils/filterUtils.d.ts +4 -10
  14. package/dist/cjs/client/components/shared/utils.d.ts +2 -1
  15. package/dist/cjs/client/shared/filters/filterOperations.d.ts +95 -0
  16. package/dist/cjs/client/shared/filters/index.d.ts +10 -0
  17. package/dist/cjs/client/shared/filters/operators.d.ts +23 -0
  18. package/dist/cjs/client/shared/index.d.ts +3 -2
  19. package/dist/cjs/client/shared/types.d.ts +3 -10
  20. package/dist/cjs/client/shared/utils.d.ts +1 -59
  21. package/dist/cjs/client/utils/filterUtils.d.ts +2 -9
  22. package/dist/cjs/server/logical-plan/logical-plan-builder.d.ts +0 -5
  23. package/dist/cjs/server/logical-plan/schema-builder.d.ts +19 -0
  24. package/dist/client/chunks/{DashboardEditModal-CWurUU2B.js → DashboardEditModal-Cs1ig1_V.js} +1520 -1119
  25. package/dist/client/chunks/DashboardEditModal-Cs1ig1_V.js.map +1 -0
  26. package/dist/client/chunks/{analysis-builder-Uj_Fxv0-.js → analysis-builder-B64yaeDe.js} +73 -73
  27. package/dist/client/chunks/{analysis-builder-Uj_Fxv0-.js.map → analysis-builder-B64yaeDe.js.map} +1 -1
  28. package/dist/client/chunks/{analysis-builder-shared-AdAYIfj_.js → analysis-builder-shared-CD0n2Nb8.js} +948 -1023
  29. package/dist/client/chunks/analysis-builder-shared-CD0n2Nb8.js.map +1 -0
  30. package/dist/client/chunks/{useDirtyStateTracking-BY_IIG1n.js → useDirtyStateTracking-BT6zqCFl.js} +249 -590
  31. package/dist/client/chunks/useDirtyStateTracking-BT6zqCFl.js.map +1 -0
  32. package/dist/client/chunks/{useExplainAI-PjMBmj2p.js → useExplainAI-Dq_meKNN.js} +2 -2
  33. package/dist/client/chunks/{useExplainAI-PjMBmj2p.js.map → useExplainAI-Dq_meKNN.js.map} +1 -1
  34. package/dist/client/components/AnalysisBuilder/utils/filterUtils.d.ts +4 -10
  35. package/dist/client/components/shared/utils.d.ts +2 -1
  36. package/dist/client/components.js +2 -2
  37. package/dist/client/hooks.js +2 -2
  38. package/dist/client/index.js +13 -13
  39. package/dist/client/index.js.map +1 -1
  40. package/dist/client/shared/filters/filterOperations.d.ts +95 -0
  41. package/dist/client/shared/filters/index.d.ts +10 -0
  42. package/dist/client/shared/filters/operators.d.ts +23 -0
  43. package/dist/client/shared/index.d.ts +3 -2
  44. package/dist/client/shared/types.d.ts +3 -10
  45. package/dist/client/shared/utils.d.ts +1 -59
  46. package/dist/client/utils/filterUtils.d.ts +2 -9
  47. package/dist/client-bundle-stats.html +1 -1
  48. package/dist/server/index.cjs +33 -33
  49. package/dist/server/index.js +1272 -1268
  50. package/dist/server/logical-plan/logical-plan-builder.d.ts +0 -5
  51. package/dist/server/logical-plan/schema-builder.d.ts +19 -0
  52. package/package.json +3 -3
  53. package/dist/adapters/compiler-ChGO4ZLU.cjs +0 -166
  54. package/dist/client/chunks/DashboardEditModal-CWurUU2B.js.map +0 -1
  55. package/dist/client/chunks/analysis-builder-shared-AdAYIfj_.js.map +0 -1
  56. package/dist/client/chunks/useDirtyStateTracking-BY_IIG1n.js.map +0 -1
@@ -2,422 +2,87 @@ import { H as e, Z as t, k as n, z as r } from "./chart-data-table-D4g5_jfF.js";
2
2
  import { n as i } from "./chart-sankey-DjrvKw6K.js";
3
3
  import { i as a, l as o } from "./chart-funnel-CToKSBaL.js";
4
4
  import { useCallback as s, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
5
- //#region src/client/shared/types.ts
6
- var f = {
7
- equals: {
8
- label: "filter.operator.equals.label",
9
- description: "filter.operator.equals.description",
10
- requiresValues: !0,
11
- supportsMultipleValues: !0,
12
- valueType: "any",
13
- fieldTypes: [
14
- "string",
15
- "number",
16
- "boolean",
17
- "time"
18
- ]
19
- },
20
- notEquals: {
21
- label: "filter.operator.notEquals.label",
22
- description: "filter.operator.notEquals.description",
23
- requiresValues: !0,
24
- supportsMultipleValues: !0,
25
- valueType: "any",
26
- fieldTypes: [
27
- "string",
28
- "number",
29
- "boolean",
30
- "time"
31
- ]
32
- },
33
- contains: {
34
- label: "filter.operator.contains.label",
35
- description: "filter.operator.contains.description",
36
- requiresValues: !0,
37
- supportsMultipleValues: !1,
38
- valueType: "string",
39
- fieldTypes: ["string"]
40
- },
41
- notContains: {
42
- label: "filter.operator.notContains.label",
43
- description: "filter.operator.notContains.description",
44
- requiresValues: !0,
45
- supportsMultipleValues: !1,
46
- valueType: "string",
47
- fieldTypes: ["string"]
48
- },
49
- startsWith: {
50
- label: "filter.operator.startsWith.label",
51
- description: "filter.operator.startsWith.description",
52
- requiresValues: !0,
53
- supportsMultipleValues: !1,
54
- valueType: "string",
55
- fieldTypes: ["string"]
56
- },
57
- notStartsWith: {
58
- label: "filter.operator.notStartsWith.label",
59
- description: "filter.operator.notStartsWith.description",
60
- requiresValues: !0,
61
- supportsMultipleValues: !1,
62
- valueType: "string",
63
- fieldTypes: ["string"]
64
- },
65
- endsWith: {
66
- label: "filter.operator.endsWith.label",
67
- description: "filter.operator.endsWith.description",
68
- requiresValues: !0,
69
- supportsMultipleValues: !1,
70
- valueType: "string",
71
- fieldTypes: ["string"]
72
- },
73
- notEndsWith: {
74
- label: "filter.operator.notEndsWith.label",
75
- description: "filter.operator.notEndsWith.description",
76
- requiresValues: !0,
77
- supportsMultipleValues: !1,
78
- valueType: "string",
79
- fieldTypes: ["string"]
80
- },
81
- like: {
82
- label: "filter.operator.like.label",
83
- description: "filter.operator.like.description",
84
- requiresValues: !0,
85
- supportsMultipleValues: !1,
86
- valueType: "string",
87
- fieldTypes: ["string"]
88
- },
89
- notLike: {
90
- label: "filter.operator.notLike.label",
91
- description: "filter.operator.notLike.description",
92
- requiresValues: !0,
93
- supportsMultipleValues: !1,
94
- valueType: "string",
95
- fieldTypes: ["string"]
96
- },
97
- ilike: {
98
- label: "filter.operator.ilike.label",
99
- description: "filter.operator.ilike.description",
100
- requiresValues: !0,
101
- supportsMultipleValues: !1,
102
- valueType: "string",
103
- fieldTypes: ["string"]
104
- },
105
- gt: {
106
- label: "filter.operator.gt.label",
107
- description: "filter.operator.gt.description",
108
- requiresValues: !0,
109
- supportsMultipleValues: !1,
110
- valueType: "number",
111
- fieldTypes: [
112
- "number",
113
- "count",
114
- "sum",
115
- "avg",
116
- "min",
117
- "max"
118
- ]
119
- },
120
- gte: {
121
- label: "filter.operator.gte.label",
122
- description: "filter.operator.gte.description",
123
- requiresValues: !0,
124
- supportsMultipleValues: !1,
125
- valueType: "number",
126
- fieldTypes: [
127
- "number",
128
- "count",
129
- "sum",
130
- "avg",
131
- "min",
132
- "max"
133
- ]
134
- },
135
- lt: {
136
- label: "filter.operator.lt.label",
137
- description: "filter.operator.lt.description",
138
- requiresValues: !0,
139
- supportsMultipleValues: !1,
140
- valueType: "number",
141
- fieldTypes: [
142
- "number",
143
- "count",
144
- "sum",
145
- "avg",
146
- "min",
147
- "max"
148
- ]
149
- },
150
- lte: {
151
- label: "filter.operator.lte.label",
152
- description: "filter.operator.lte.description",
153
- requiresValues: !0,
154
- supportsMultipleValues: !1,
155
- valueType: "number",
156
- fieldTypes: [
157
- "number",
158
- "count",
159
- "sum",
160
- "avg",
161
- "min",
162
- "max"
163
- ]
164
- },
165
- between: {
166
- label: "filter.operator.between.label",
167
- description: "filter.operator.between.description",
168
- requiresValues: !0,
169
- supportsMultipleValues: !1,
170
- valueType: "number",
171
- fieldTypes: [
172
- "number",
173
- "count",
174
- "sum",
175
- "avg",
176
- "min",
177
- "max"
178
- ]
179
- },
180
- notBetween: {
181
- label: "filter.operator.notBetween.label",
182
- description: "filter.operator.notBetween.description",
183
- requiresValues: !0,
184
- supportsMultipleValues: !1,
185
- valueType: "number",
186
- fieldTypes: [
187
- "number",
188
- "count",
189
- "sum",
190
- "avg",
191
- "min",
192
- "max"
193
- ]
194
- },
195
- in: {
196
- label: "filter.operator.in.label",
197
- description: "filter.operator.in.description",
198
- requiresValues: !0,
199
- supportsMultipleValues: !0,
200
- valueType: "any",
201
- fieldTypes: [
202
- "string",
203
- "number",
204
- "boolean"
205
- ]
206
- },
207
- notIn: {
208
- label: "filter.operator.notIn.label",
209
- description: "filter.operator.notIn.description",
210
- requiresValues: !0,
211
- supportsMultipleValues: !0,
212
- valueType: "any",
213
- fieldTypes: [
214
- "string",
215
- "number",
216
- "boolean"
217
- ]
218
- },
219
- set: {
220
- label: "filter.operator.set.label",
221
- description: "filter.operator.set.description",
222
- requiresValues: !1,
223
- supportsMultipleValues: !1,
224
- valueType: "any",
225
- fieldTypes: [
226
- "string",
227
- "number",
228
- "time",
229
- "boolean"
230
- ]
231
- },
232
- notSet: {
233
- label: "filter.operator.notSet.label",
234
- description: "filter.operator.notSet.description",
235
- requiresValues: !1,
236
- supportsMultipleValues: !1,
237
- valueType: "any",
238
- fieldTypes: [
239
- "string",
240
- "number",
241
- "time",
242
- "boolean"
243
- ]
244
- },
245
- isEmpty: {
246
- label: "filter.operator.isEmpty.label",
247
- description: "filter.operator.isEmpty.description",
248
- requiresValues: !1,
249
- supportsMultipleValues: !1,
250
- valueType: "string",
251
- fieldTypes: ["string"]
252
- },
253
- isNotEmpty: {
254
- label: "filter.operator.isNotEmpty.label",
255
- description: "filter.operator.isNotEmpty.description",
256
- requiresValues: !1,
257
- supportsMultipleValues: !1,
258
- valueType: "string",
259
- fieldTypes: ["string"]
260
- },
261
- inDateRange: {
262
- label: "filter.operator.inDateRange.label",
263
- description: "filter.operator.inDateRange.description",
264
- requiresValues: !0,
265
- supportsMultipleValues: !1,
266
- valueType: "date",
267
- fieldTypes: ["time"]
268
- },
269
- beforeDate: {
270
- label: "filter.operator.beforeDate.label",
271
- description: "filter.operator.beforeDate.description",
272
- requiresValues: !0,
273
- supportsMultipleValues: !1,
274
- valueType: "date",
275
- fieldTypes: ["time"]
276
- },
277
- afterDate: {
278
- label: "filter.operator.afterDate.label",
279
- description: "filter.operator.afterDate.description",
280
- requiresValues: !0,
281
- supportsMultipleValues: !1,
282
- valueType: "date",
283
- fieldTypes: ["time"]
284
- },
285
- regex: {
286
- label: "filter.operator.regex.label",
287
- description: "filter.operator.regex.description",
288
- requiresValues: !0,
289
- supportsMultipleValues: !1,
290
- valueType: "string",
291
- fieldTypes: ["string"]
292
- },
293
- notRegex: {
294
- label: "filter.operator.notRegex.label",
295
- description: "filter.operator.notRegex.description",
296
- requiresValues: !0,
297
- supportsMultipleValues: !1,
298
- valueType: "string",
299
- fieldTypes: ["string"]
300
- },
301
- arrayContains: {
302
- label: "filter.operator.arrayContains.label",
303
- description: "filter.operator.arrayContains.description",
304
- requiresValues: !0,
305
- supportsMultipleValues: !0,
306
- valueType: "string",
307
- fieldTypes: ["string"]
308
- },
309
- arrayOverlaps: {
310
- label: "filter.operator.arrayOverlaps.label",
311
- description: "filter.operator.arrayOverlaps.description",
312
- requiresValues: !0,
313
- supportsMultipleValues: !0,
314
- valueType: "string",
315
- fieldTypes: ["string"]
316
- },
317
- arrayContained: {
318
- label: "filter.operator.arrayContained.label",
319
- description: "filter.operator.arrayContained.description",
320
- requiresValues: !0,
321
- supportsMultipleValues: !0,
322
- valueType: "string",
323
- fieldTypes: ["string"]
324
- }
325
- }, p = [
326
- {
327
- value: "custom",
328
- label: "dateRange.custom"
329
- },
330
- {
331
- value: "today",
332
- label: "dateRange.today"
333
- },
334
- {
335
- value: "yesterday",
336
- label: "dateRange.yesterday"
337
- },
338
- {
339
- value: "this_week",
340
- label: "dateRange.thisWeek"
341
- },
342
- {
343
- value: "this_month",
344
- label: "dateRange.thisMonth"
345
- },
346
- {
347
- value: "this_quarter",
348
- label: "dateRange.thisQuarter"
349
- },
350
- {
351
- value: "this_year",
352
- label: "dateRange.thisYear"
353
- },
354
- {
355
- value: "last_7_days",
356
- label: "dateRange.last7Days"
357
- },
358
- {
359
- value: "last_30_days",
360
- label: "dateRange.last30Days"
361
- },
362
- {
363
- value: "last_n_days",
364
- label: "dateRange.lastNDays"
365
- },
366
- {
367
- value: "last_week",
368
- label: "dateRange.lastWeek"
369
- },
370
- {
371
- value: "last_n_weeks",
372
- label: "dateRange.lastNWeeks"
373
- },
374
- {
375
- value: "last_month",
376
- label: "dateRange.lastMonth"
377
- },
378
- {
379
- value: "last_12_months",
380
- label: "dateRange.last12Months"
381
- },
382
- {
383
- value: "last_n_months",
384
- label: "dateRange.lastNMonths"
385
- },
386
- {
387
- value: "last_quarter",
388
- label: "dateRange.lastQuarter"
389
- },
390
- {
391
- value: "last_n_quarters",
392
- label: "dateRange.lastNQuarters"
393
- },
394
- {
395
- value: "last_year",
396
- label: "dateRange.lastYear"
397
- },
398
- {
399
- value: "last_n_years",
400
- label: "dateRange.lastNYears"
401
- }
402
- ];
403
- //#endregion
404
5
  //#region src/client/shared/queryTransforms.ts
405
- function m(e) {
6
+ function f(e) {
406
7
  let t = {};
407
8
  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;
408
9
  }
409
10
  //#endregion
410
- //#region src/client/shared/utils.ts
11
+ //#region src/client/shared/filters/filterOperations.ts
12
+ function p(e) {
13
+ return "member" in e && "operator" in e;
14
+ }
15
+ function m(e) {
16
+ return "type" in e && "filters" in e;
17
+ }
411
18
  function h(e) {
412
- return "member" in e && "operator" in e && "values" in e;
19
+ let t = 0, n = (e) => {
20
+ p(e) ? t++ : m(e) && e.filters.forEach(n);
21
+ };
22
+ return e.forEach(n), t;
413
23
  }
414
24
  function g(e) {
415
- return "type" in e && "filters" in e;
25
+ let t = [], n = (e) => {
26
+ p(e) ? t.push(e.member) : m(e) && e.filters.forEach(n);
27
+ };
28
+ return e.forEach(n), t;
416
29
  }
417
- function _(e) {
30
+ function _(e, t, n) {
31
+ if (t.length === 0) return e.length === 0 ? [n] : e.length === 1 && p(e[0]) ? [{
32
+ type: "and",
33
+ filters: [e[0], n]
34
+ }] : e.length === 1 && m(e[0]) ? [{
35
+ ...e[0],
36
+ filters: [...e[0].filters, n]
37
+ }] : [{
38
+ type: "and",
39
+ filters: [...e, n]
40
+ }];
41
+ let [r, ...i] = t, a = [...e], o = a[r];
42
+ return m(o) && (i.length === 0 ? a[r] = {
43
+ ...o,
44
+ filters: [...o.filters, n]
45
+ } : a[r] = {
46
+ ...o,
47
+ filters: _(o.filters, i, n)
48
+ }), a;
49
+ }
50
+ function v(e, t) {
51
+ let n = e.filter((e, n) => n !== t);
52
+ if (n.length === 1 && m(n[0])) {
53
+ let e = n[0];
54
+ if (e.filters.length === 1) return [e.filters[0]];
55
+ }
56
+ return n;
57
+ }
58
+ function y(e) {
59
+ return {
60
+ ...e,
61
+ type: e.type === "and" ? "or" : "and"
62
+ };
63
+ }
64
+ function b(e, t) {
65
+ for (let n of e) if (m(n)) {
66
+ let e = b(n.filters, t);
67
+ if (e) return e;
68
+ } else if (p(n) && n.member === t && n.operator === "inDateRange" && n.dateRange) return { dateRange: n.dateRange };
69
+ }
70
+ function x(e, t, n) {
71
+ return e.reduce((e, r) => {
72
+ if (m(r)) {
73
+ let i = x(r.filters, t, n);
74
+ i.length > 0 && e.push({
75
+ type: r.type,
76
+ filters: i
77
+ });
78
+ } else p(r) && r.member === t && (n === void 0 || r.operator === n) || e.push(r);
79
+ return e;
80
+ }, []);
81
+ }
82
+ function S(e) {
418
83
  let t = (e) => {
419
- if (h(e)) return e;
420
- if (g(e)) {
84
+ if (p(e)) return e;
85
+ if (m(e)) {
421
86
  let n = e.filters.map(t);
422
87
  return e.type === "and" ? { and: n } : { or: n };
423
88
  }
@@ -425,19 +90,13 @@ function _(e) {
425
90
  };
426
91
  return e.map(t);
427
92
  }
428
- function v(e) {
429
- let t = m(e);
430
- return t.filters && t.filters.length > 0 && (t.filters = _(t.filters)), t;
431
- }
432
- function y(e) {
433
- let t = [];
434
- for (let [n, r] of Object.entries(f)) r.fieldTypes.includes(e) && t.push({
435
- operator: n,
436
- label: r.label
437
- });
438
- return t;
93
+ //#endregion
94
+ //#region src/client/shared/utils.ts
95
+ function C(e) {
96
+ let t = f(e);
97
+ return t.filters && t.filters.length > 0 && (t.filters = S(t.filters)), t;
439
98
  }
440
- function b(e, t) {
99
+ function w(e, t) {
441
100
  let n = {
442
101
  today: "today",
443
102
  yesterday: "yesterday",
@@ -459,15 +118,15 @@ function b(e, t) {
459
118
  }
460
119
  return n[e] || e;
461
120
  }
462
- function x(e) {
121
+ function T(e) {
463
122
  return e.startsWith("last_n_");
464
123
  }
465
- function S(e) {
124
+ function E(e) {
466
125
  return e.toISOString().split("T")[0];
467
126
  }
468
127
  //#endregion
469
128
  //#region src/client/shared/queryKey.ts
470
- function C(e) {
129
+ function D(e) {
471
130
  let t = /* @__PURE__ */ new WeakSet(), n = (e) => {
472
131
  if (typeof e != "object" || !e) return JSON.stringify(e);
473
132
  if (t.has(e)) return "\"[Circular]\"";
@@ -479,8 +138,8 @@ function C(e) {
479
138
  }
480
139
  //#endregion
481
140
  //#region src/client/hooks/useDebounceQuery.ts
482
- function w(e, t) {
483
- let { isValid: n, skip: r = !1, debounceMs: i = 300 } = t, [a, o] = d(null), [s, f] = d(!1), p = u(null), m = u(""), h = u(r), g = l(() => e ? C(e) : "", [e]);
141
+ function O(e, t) {
142
+ let { isValid: n, skip: r = !1, debounceMs: i = 300 } = t, [a, o] = d(null), [s, f] = d(!1), p = u(null), m = u(""), h = u(r), g = l(() => e ? D(e) : "", [e]);
484
143
  return c(() => {
485
144
  let t = h.current && !r;
486
145
  if (h.current = r, !(g === m.current && !t)) return p.current && clearTimeout(p.current), n && !r ? (f(!0), p.current = setTimeout(() => {
@@ -501,58 +160,58 @@ function w(e, t) {
501
160
  }
502
161
  //#endregion
503
162
  //#region src/client/hooks/queries/useCubeLoadQuery.ts
504
- var T = 300;
505
- function E(e) {
163
+ var k = 300;
164
+ function A(e) {
506
165
  return e ? [
507
166
  "cube",
508
167
  "load",
509
- C(e)
168
+ D(e)
510
169
  ] : [
511
170
  "cube",
512
171
  "load",
513
172
  null
514
173
  ];
515
174
  }
516
- function D(e) {
175
+ function j(e) {
517
176
  return e ? !!(e.measures && e.measures.length > 0) || !!(e.dimensions && e.dimensions.length > 0) || !!(e.timeDimensions && e.timeDimensions.length > 0) : !1;
518
177
  }
519
- function O(i, a = {}) {
520
- let { skip: o = !1, debounceMs: f = T, resetResultSetOnChange: p = !0, staleTime: m = 60 * 1e3, keepPreviousData: h = !0 } = a, { cubeApi: g, batchCoordinator: _, enableBatching: y } = r(), b = t(), { features: x } = n(), S = x.manualRefresh ?? !1, [O, k] = d(null), A = D(i), { debouncedValue: j, isDebouncing: M } = w(i, {
521
- isValid: A,
178
+ function M(i, a = {}) {
179
+ let { skip: o = !1, debounceMs: f = k, resetResultSetOnChange: p = !0, staleTime: m = 60 * 1e3, keepPreviousData: h = !0 } = a, { cubeApi: g, batchCoordinator: _, enableBatching: v } = r(), y = t(), { features: b } = n(), x = b.manualRefresh ?? !1, [S, w] = d(null), T = j(i), { debouncedValue: E, isDebouncing: M } = O(i, {
180
+ isValid: T,
522
181
  skip: o,
523
182
  debounceMs: f
524
- }), N = l(() => j ? v(j) : null, [j]), P = N ? C(N) : null, F = l(() => !S || !P || O === null ? !1 : P !== O, [
525
- S,
183
+ }), N = l(() => E ? C(E) : null, [E]), P = N ? D(N) : null, F = l(() => !x || !P || S === null ? !1 : P !== S, [
184
+ x,
526
185
  P,
527
- O
528
- ]), I = l(() => !N || o ? !1 : !S || O === null ? !0 : O === P, [
186
+ S
187
+ ]), I = l(() => !N || o ? !1 : !x || S === null ? !0 : S === P, [
529
188
  N,
530
189
  o,
190
+ x,
531
191
  S,
532
- O,
533
192
  P
534
193
  ]), L = u(!1), R = e({
535
- queryKey: E(N),
194
+ queryKey: A(N),
536
195
  queryFn: async () => {
537
196
  if (!N) throw Error("No query provided");
538
197
  let e = L.current;
539
- return L.current = !1, e ? g.load(N, { bustCache: !0 }) : y && _ ? _.register(N) : g.load(N);
198
+ return L.current = !1, e ? g.load(N, { bustCache: !0 }) : v && _ ? _.register(N) : g.load(N);
540
199
  },
541
200
  enabled: I,
542
201
  staleTime: m,
543
202
  placeholderData: h ? (e) => e : void 0
544
203
  });
545
204
  c(() => {
546
- !S && N && !o && k(P);
205
+ !x && N && !o && w(P);
547
206
  }, [
548
- S,
207
+ x,
549
208
  N,
550
209
  o,
551
210
  P
552
211
  ]), c(() => {
553
- S && I && R.isSuccess && !R.isFetching && N && k(P);
212
+ x && I && R.isSuccess && !R.isFetching && N && w(P);
554
213
  }, [
555
- S,
214
+ x,
556
215
  I,
557
216
  R.isSuccess,
558
217
  R.isFetching,
@@ -571,11 +230,11 @@ function O(i, a = {}) {
571
230
  let e = R.data.loadResponse;
572
231
  return e.results && e.results[0]?.warnings ? e.results[0].warnings : e.warnings;
573
232
  }, [R.data]), V = s((e) => {
574
- N && (k(P), e?.bustCache && (L.current = !0), b.invalidateQueries({ queryKey: E(N) }));
233
+ N && (w(P), e?.bustCache && (L.current = !0), y.invalidateQueries({ queryKey: A(N) }));
575
234
  }, [
576
235
  N,
577
236
  P,
578
- b
237
+ y
579
238
  ]), H = V;
580
239
  return {
581
240
  resultSet: l(() => R.data ?? null, [
@@ -588,11 +247,11 @@ function O(i, a = {}) {
588
247
  isFetching: R.isFetching,
589
248
  isDebouncing: M,
590
249
  error: R.error,
591
- debouncedQuery: j,
592
- isValidQuery: A,
250
+ debouncedQuery: E,
251
+ isValidQuery: T,
593
252
  refetch: H,
594
253
  clearCache: () => {
595
- b.removeQueries({ queryKey: ["cube", "load"] });
254
+ y.removeQueries({ queryKey: ["cube", "load"] });
596
255
  },
597
256
  needsRefresh: F,
598
257
  executeQuery: V,
@@ -601,11 +260,11 @@ function O(i, a = {}) {
601
260
  }
602
261
  //#endregion
603
262
  //#region src/client/utils/multiQueryUtils.ts
604
- function k(e) {
263
+ function N(e) {
605
264
  return e.length > 0 && typeof e[0] == "object" && e[0] !== null && "__queryIndex" in e[0];
606
265
  }
607
- function A(e) {
608
- if (!k(e)) return [];
266
+ function P(e) {
267
+ if (!N(e)) return [];
609
268
  let t = /* @__PURE__ */ new Set();
610
269
  for (let n of e) {
611
270
  let e = n.__queryLabel;
@@ -613,8 +272,8 @@ function A(e) {
613
272
  }
614
273
  return Array.from(t);
615
274
  }
616
- function j(e) {
617
- if (!k(e)) return [];
275
+ function F(e) {
276
+ if (!N(e)) return [];
618
277
  let t = /* @__PURE__ */ new Set();
619
278
  for (let n of e) {
620
279
  let e = n.__queryIndex;
@@ -622,7 +281,7 @@ function j(e) {
622
281
  }
623
282
  return Array.from(t).sort((e, t) => e - t);
624
283
  }
625
- function M(e, t, n) {
284
+ function I(e, t, n) {
626
285
  let r = [];
627
286
  return e.forEach((e, t) => {
628
287
  let i = e.rawData(), a = n?.[t] || `Query ${t + 1}`;
@@ -635,7 +294,7 @@ function M(e, t, n) {
635
294
  });
636
295
  }), r;
637
296
  }
638
- function N(e, t, n, r) {
297
+ function L(e, t, n, r) {
639
298
  let i = /* @__PURE__ */ new Map();
640
299
  return e.forEach((e, r) => {
641
300
  let a = e.rawData(), o = t[r].measures || [];
@@ -656,10 +315,10 @@ function N(e, t, n, r) {
656
315
  });
657
316
  }), Array.from(i.values()).sort((e, t) => String(e[n[0]] ?? "").localeCompare(String(t[n[0]] ?? "")));
658
317
  }
659
- function P(e, t, n, r, i) {
660
- return e.length === 0 ? [] : e.length === 1 ? e[0].rawData() : n === "merge" && r && r.length > 0 ? N(e, t, r, i) : M(e, t, i);
318
+ function R(e, t, n, r, i) {
319
+ return e.length === 0 ? [] : e.length === 1 ? e[0].rawData() : n === "merge" && r && r.length > 0 ? L(e, t, r, i) : I(e, t, i);
661
320
  }
662
- function F(e, t) {
321
+ function z(e, t) {
663
322
  let n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
664
323
  return e.forEach((e) => {
665
324
  e.measures?.forEach((e) => n.add(e)), e.dimensions?.forEach((e) => r.add(e)), e.timeDimensions?.forEach((e) => i.add(e.dimension));
@@ -669,14 +328,14 @@ function F(e, t) {
669
328
  timeDimensions: Array.from(i)
670
329
  };
671
330
  }
672
- function I(e, t) {
331
+ function B(e, t) {
673
332
  if (e.measures && e.measures.length > 0) {
674
333
  let t = e.measures[0], n = t.split(".");
675
334
  return n.length > 1 ? n[n.length - 1] : t;
676
335
  }
677
336
  return `Query ${t + 1}`;
678
337
  }
679
- function L(e, t) {
338
+ function V(e, t) {
680
339
  let n = [];
681
340
  return e.forEach((e, r) => {
682
341
  [...e.dimensions || [], ...e.timeDimensions?.map((e) => e.dimension) || []].includes(t) || n.push(r);
@@ -687,35 +346,35 @@ function L(e, t) {
687
346
  }
688
347
  //#endregion
689
348
  //#region src/client/hooks/queries/useMultiCubeLoadQuery.ts
690
- var R = 300;
691
- function z(e) {
349
+ var H = 300;
350
+ function U(e) {
692
351
  return e ? [
693
352
  "cube",
694
353
  "multiLoad",
695
- C(e)
354
+ D(e)
696
355
  ] : [
697
356
  "cube",
698
357
  "multiLoad",
699
358
  null
700
359
  ];
701
360
  }
702
- function B(e) {
361
+ function ee(e) {
703
362
  return !e || !e.queries || e.queries.length < 2 ? !1 : e.queries.filter((e) => e.measures && e.measures.length > 0 || e.dimensions && e.dimensions.length > 0 || e.timeDimensions && e.timeDimensions.length > 0).length >= 2;
704
363
  }
705
- function V(n, i = {}) {
706
- let { skip: a = !1, debounceMs: o = R, resetResultSetOnChange: s = !0, staleTime: c = 60 * 1e3, keepPreviousData: u = !0 } = i, { cubeApi: d, batchCoordinator: f, enableBatching: p } = r(), m = t(), h = B(n), { debouncedValue: g, isDebouncing: _ } = w(n, {
364
+ function te(n, i = {}) {
365
+ let { skip: a = !1, debounceMs: o = H, resetResultSetOnChange: s = !0, staleTime: c = 60 * 1e3, keepPreviousData: u = !0 } = i, { cubeApi: d, batchCoordinator: f, enableBatching: p } = r(), m = t(), h = ee(n), { debouncedValue: g, isDebouncing: _ } = O(n, {
707
366
  isValid: h,
708
367
  skip: a,
709
368
  debounceMs: o
710
- }), y = l(() => g ? {
369
+ }), v = l(() => g ? {
711
370
  ...g,
712
- queries: g.queries.map((e) => v(e))
713
- } : null, [g]), b = e({
714
- queryKey: z(y),
371
+ queries: g.queries.map((e) => C(e))
372
+ } : null, [g]), y = e({
373
+ queryKey: U(v),
715
374
  queryFn: async () => {
716
- if (!y) throw Error("No config provided");
375
+ if (!v) throw Error("No config provided");
717
376
  let e;
718
- e = p && f ? await Promise.all(y.queries.map((e) => f.register(e))) : await d.batchLoad(y.queries);
377
+ e = p && f ? await Promise.all(v.queries.map((e) => f.register(e))) : await d.batchLoad(v.queries);
719
378
  let t = e.map((e) => e && "error" in e && e.error ? Error(e.error) : null), n = e.map((e, n) => {
720
379
  if (t[n]) return null;
721
380
  try {
@@ -723,54 +382,54 @@ function V(n, i = {}) {
723
382
  } catch {
724
383
  return null;
725
384
  }
726
- }), r = e.filter((e, n) => !t[n]), i = y.queries.filter((e, n) => !t[n]);
385
+ }), r = e.filter((e, n) => !t[n]), i = v.queries.filter((e, n) => !t[n]);
727
386
  return {
728
- data: r.length > 0 ? P(r, i, y.mergeStrategy, y.mergeKeys, y.queryLabels) : [],
387
+ data: r.length > 0 ? R(r, i, v.mergeStrategy, v.mergeKeys, v.queryLabels) : [],
729
388
  resultSets: e,
730
389
  perQueryData: n,
731
390
  errors: t,
732
391
  firstError: t.find((e) => e !== null) || null
733
392
  };
734
393
  },
735
- enabled: !!y && !a,
394
+ enabled: !!v && !a,
736
395
  staleTime: c,
737
396
  placeholderData: u ? (e) => e : void 0
738
397
  });
739
398
  return {
740
- data: b.data?.data ?? null,
741
- resultSets: b.data?.resultSets ?? null,
742
- perQueryData: b.data?.perQueryData ?? null,
743
- isLoading: b.isLoading || _,
744
- isFetching: b.isFetching,
399
+ data: y.data?.data ?? null,
400
+ resultSets: y.data?.resultSets ?? null,
401
+ perQueryData: y.data?.perQueryData ?? null,
402
+ isLoading: y.isLoading || _,
403
+ isFetching: y.isFetching,
745
404
  isDebouncing: _,
746
- error: b.data?.firstError ?? b.error,
747
- errors: b.data?.errors ?? [],
405
+ error: y.data?.firstError ?? y.error,
406
+ errors: y.data?.errors ?? [],
748
407
  debouncedConfig: g,
749
408
  isValidConfig: h,
750
409
  refetch: (e) => {
751
- y && (e?.bustCache ? (m.removeQueries({ queryKey: z(y) }), m.fetchQuery({
752
- queryKey: z(y),
410
+ v && (e?.bustCache ? (m.removeQueries({ queryKey: U(v) }), m.fetchQuery({
411
+ queryKey: U(v),
753
412
  queryFn: async () => {
754
- let e = await d.batchLoad(y.queries, { bustCache: !0 }), t = e.map((e) => e && "error" in e && e.error ? Error(e.error) : null);
413
+ let e = await d.batchLoad(v.queries, { bustCache: !0 }), t = e.map((e) => e && "error" in e && e.error ? Error(e.error) : null);
755
414
  return {
756
- data: y.mergeStrategy === "concat" ? e.flatMap((e) => e?.rawData() || []) : e[0]?.rawData() || [],
415
+ data: v.mergeStrategy === "concat" ? e.flatMap((e) => e?.rawData() || []) : e[0]?.rawData() || [],
757
416
  resultSets: e,
758
- perQueryData: y.mergeStrategy === "concat" ? e.map((e) => e?.rawData() || []) : [],
417
+ perQueryData: v.mergeStrategy === "concat" ? e.map((e) => e?.rawData() || []) : [],
759
418
  errors: t,
760
419
  firstError: t.find((e) => e !== null) || null
761
420
  };
762
421
  }
763
- })) : m.refetchQueries({ queryKey: z(y) }));
422
+ })) : m.refetchQueries({ queryKey: U(v) }));
764
423
  }
765
424
  };
766
425
  }
767
426
  //#endregion
768
427
  //#region src/client/hooks/queries/useFunnelQuery.ts
769
- var H = 300;
770
- function U(e) {
428
+ var ne = 300;
429
+ function W(e) {
771
430
  return e.isError ? "error" : e.isLoading ? "executing" : e.isSuccess ? "success" : "idle";
772
431
  }
773
- function W(e, t, n, r, i) {
432
+ function G(e, t, n, r, i) {
774
433
  return {
775
434
  stepIndex: t,
776
435
  stepName: e.name,
@@ -785,7 +444,7 @@ function W(e, t, n, r, i) {
785
444
  error: null
786
445
  };
787
446
  }
788
- function G(e, t) {
447
+ function K(e, t) {
789
448
  return e || {
790
449
  id: "prebuilt-funnel",
791
450
  name: "Funnel Analysis",
@@ -798,7 +457,7 @@ function G(e, t) {
798
457
  }))
799
458
  };
800
459
  }
801
- function K(e) {
460
+ function q(e) {
802
461
  if (!e || !e.bindingKey || !e.steps || e.steps.length < 2) return !1;
803
462
  if (typeof e.bindingKey.dimension == "string") {
804
463
  if (!e.bindingKey.dimension) return !1;
@@ -809,58 +468,58 @@ function K(e) {
809
468
  }
810
469
  return !0;
811
470
  }
812
- function q(i, u = {}) {
813
- let { skip: f = !1, debounceMs: p = H, onComplete: m, onError: h, prebuiltServerQuery: g } = u, { cubeApi: _ } = r(), v = t(), { features: y } = n(), b = y.manualRefresh ?? !1, [x, S] = d(null), T = K(i), { debouncedValue: E, isDebouncing: D } = w(i, {
814
- isValid: T,
471
+ function J(i, u = {}) {
472
+ let { skip: f = !1, debounceMs: p = ne, onComplete: m, onError: h, prebuiltServerQuery: g } = u, { cubeApi: _ } = r(), v = t(), { features: y } = n(), b = y.manualRefresh ?? !1, [x, S] = d(null), C = q(i), { debouncedValue: w, isDebouncing: T } = O(i, {
473
+ isValid: C,
815
474
  skip: f,
816
475
  debounceMs: p
817
- }), O = l(() => {
476
+ }), E = l(() => {
818
477
  if (g) return g;
819
- if (!E || !T) return null;
478
+ if (!w || !C) return null;
820
479
  try {
821
- return a(E.steps.map((e) => e.query), E.bindingKey, E.steps.map((e) => e.name), E.steps.map((e) => e.timeToConvert || null), !0);
480
+ return a(w.steps.map((e) => e.query), w.bindingKey, w.steps.map((e) => e.name), w.steps.map((e) => e.timeToConvert || null), !0);
822
481
  } catch (e) {
823
482
  return console.error("Failed to build server funnel query:", e), null;
824
483
  }
825
484
  }, [
826
485
  g,
827
- E,
828
- T
829
- ]), k = l(() => O ? [
486
+ w,
487
+ C
488
+ ]), k = l(() => E ? [
830
489
  "cube",
831
490
  "funnel",
832
- O.funnel?.steps?.length || 0,
833
- JSON.stringify(O)
491
+ E.funnel?.steps?.length || 0,
492
+ JSON.stringify(E)
834
493
  ] : [
835
494
  "cube",
836
495
  "funnel",
837
496
  null
838
- ], [O]), A = O ? C(O) : null, j = l(() => !b || !A || x === null ? !1 : A !== x, [
497
+ ], [E]), A = E ? D(E) : null, j = l(() => !b || !A || x === null ? !1 : A !== x, [
839
498
  b,
840
499
  A,
841
500
  x
842
- ]), M = l(() => !O || f ? !1 : !b || x === null ? !0 : x === A, [
843
- O,
501
+ ]), M = l(() => !E || f ? !1 : !b || x === null ? !0 : x === A, [
502
+ E,
844
503
  f,
845
504
  b,
846
505
  x,
847
506
  A
848
507
  ]);
849
508
  c(() => {
850
- !b && O && !f && S(A);
509
+ !b && E && !f && S(A);
851
510
  }, [
852
511
  b,
853
- O,
512
+ E,
854
513
  f,
855
514
  A
856
515
  ]);
857
516
  let N = e({
858
517
  queryKey: k,
859
518
  queryFn: async () => {
860
- if (!O) throw Error("No server query available");
519
+ if (!E) throw Error("No server query available");
861
520
  let e = performance.now();
862
521
  try {
863
- let t = await _.load(O);
522
+ let t = await _.load(E);
864
523
  return {
865
524
  rawData: t.rawData(),
866
525
  executionTime: performance.now() - e,
@@ -876,31 +535,31 @@ function q(i, u = {}) {
876
535
  gcTime: 300 * 1e3
877
536
  });
878
537
  c(() => {
879
- b && M && N.isSuccess && !N.isFetching && O && S(A);
538
+ b && M && N.isSuccess && !N.isFetching && E && S(A);
880
539
  }, [
881
540
  b,
882
541
  M,
883
542
  N.isSuccess,
884
543
  N.isFetching,
885
- O,
544
+ E,
886
545
  A
887
546
  ]);
888
- let P = l(() => g?.funnel?.steps ? g.funnel.steps.map((e) => e.name) : E?.steps?.map((e) => e.name), [g, E]), F = l(() => g?.funnel?.steps ? g.funnel.steps.length : E?.steps?.length || 0, [g, E]), I = l(() => !N.data?.rawData || N.data.rawData.length !== F ? [] : o(N.data.rawData, P), [
547
+ let P = l(() => g?.funnel?.steps ? g.funnel.steps.map((e) => e.name) : w?.steps?.map((e) => e.name), [g, w]), F = l(() => g?.funnel?.steps ? g.funnel.steps.length : w?.steps?.length || 0, [g, w]), I = l(() => !N.data?.rawData || N.data.rawData.length !== F ? [] : o(N.data.rawData, P), [
889
548
  N.data,
890
549
  F,
891
550
  P
892
551
  ]), L = l(() => {
893
552
  if (!I.length) return [];
894
553
  let e = I[0]?.value || 0, t = N.data?.executionTime || 0;
895
- return I.map((n, r) => W(n, r, e, E, t));
554
+ return I.map((n, r) => G(n, r, e, w, t));
896
555
  }, [
897
556
  I,
898
- E,
557
+ w,
899
558
  N.data?.executionTime
900
559
  ]), R = l(() => {
901
- if (!I.length || !E && !g) return null;
560
+ if (!I.length || !w && !g) return null;
902
561
  let e = I[0]?.value || 0, t = I[I.length - 1]?.value || 0, n = {
903
- config: G(E, g),
562
+ config: K(w, g),
904
563
  steps: L,
905
564
  summary: {
906
565
  totalEntries: e,
@@ -909,26 +568,26 @@ function q(i, u = {}) {
909
568
  totalExecutionTime: N.data?.executionTime || 0
910
569
  },
911
570
  chartData: I,
912
- status: U(N),
571
+ status: W(N),
913
572
  error: N.error,
914
573
  currentStepIndex: null
915
574
  };
916
575
  return N.isSuccess && !N.isFetching && m?.(n), n;
917
576
  }, [
918
- E,
577
+ w,
919
578
  g,
920
579
  I,
921
580
  L,
922
581
  N,
923
582
  m
924
- ]), z = U(N), B = s(async (e) => {
925
- if (!O) return null;
583
+ ]), z = W(N), B = s(async (e) => {
584
+ if (!E) return null;
926
585
  S(A);
927
586
  try {
928
587
  return e?.bustCache ? (v.removeQueries({ queryKey: k }), await v.fetchQuery({
929
588
  queryKey: k,
930
589
  queryFn: async () => {
931
- let e = performance.now(), t = await _.load(O, { bustCache: !0 });
590
+ let e = performance.now(), t = await _.load(E, { bustCache: !0 });
932
591
  return {
933
592
  rawData: t.rawData(),
934
593
  executionTime: performance.now() - e,
@@ -940,21 +599,21 @@ function q(i, u = {}) {
940
599
  return R;
941
600
  }
942
601
  }, [
943
- O,
602
+ E,
944
603
  N,
945
604
  R,
946
605
  v,
947
606
  k,
948
607
  _,
949
608
  A
950
- ]), V = s(() => {}, []), q = s(() => {
609
+ ]), V = s(() => {}, []), H = s(() => {
951
610
  v.removeQueries({ queryKey: k });
952
611
  }, [v, k]);
953
612
  return {
954
613
  result: R,
955
614
  status: z,
956
615
  isExecuting: N.isLoading || N.isFetching,
957
- isDebouncing: D,
616
+ isDebouncing: T,
958
617
  currentStepIndex: null,
959
618
  stepLoadingStates: [],
960
619
  stepResults: L,
@@ -962,14 +621,14 @@ function q(i, u = {}) {
962
621
  error: N.error,
963
622
  execute: B,
964
623
  cancel: V,
965
- reset: q,
624
+ reset: H,
966
625
  executedQueries: [],
967
- serverQuery: O,
626
+ serverQuery: E,
968
627
  cacheInfo: N.data?.cacheInfo ?? null,
969
628
  needsRefresh: j
970
629
  };
971
630
  }
972
- function J(e) {
631
+ function Y(e) {
973
632
  return e ? [
974
633
  "cube",
975
634
  "funnel",
@@ -982,13 +641,13 @@ function J(e) {
982
641
  }
983
642
  //#endregion
984
643
  //#region src/client/hooks/queries/useFlowQuery.ts
985
- var Y = 300;
986
- function X(e) {
644
+ var X = 300;
645
+ function re(e) {
987
646
  if (!e?.flow) return !1;
988
647
  let { flow: t } = e;
989
648
  return !(!t.bindingKey || !t.timeDimension || !t.eventDimension || !t.startingStep?.filter || t.stepsBefore < 0 || t.stepsBefore > 5 || t.stepsAfter < 0 || t.stepsAfter > 5);
990
649
  }
991
- function Z(e) {
650
+ function ie(e) {
992
651
  if (e.length === 1) {
993
652
  let t = e[0];
994
653
  if (t && typeof t == "object" && "nodes" in t && "links" in t) return t;
@@ -999,42 +658,42 @@ function Z(e) {
999
658
  }
1000
659
  return null;
1001
660
  }
1002
- function ee(i, a = {}) {
1003
- let { skip: o = !1, debounceMs: u = Y, onComplete: f, onError: p } = a, { cubeApi: m } = r(), h = t(), { features: g } = n(), _ = g.manualRefresh ?? !1, [v, y] = d(null), b = X(i), { debouncedValue: x, isDebouncing: S } = w(i, {
661
+ function ae(i, a = {}) {
662
+ let { skip: o = !1, debounceMs: u = X, onComplete: f, onError: p } = a, { cubeApi: m } = r(), h = t(), { features: g } = n(), _ = g.manualRefresh ?? !1, [v, y] = d(null), b = re(i), { debouncedValue: x, isDebouncing: S } = O(i, {
1004
663
  isValid: b,
1005
664
  skip: o,
1006
665
  debounceMs: u
1007
- }), T = l(() => x ? JSON.stringify(x) : null, [x]), E = l(() => i ? JSON.stringify(i) : null, [i]), D = l(() => x ? [
666
+ }), C = l(() => x ? JSON.stringify(x) : null, [x]), w = l(() => i ? JSON.stringify(i) : null, [i]), T = l(() => x ? [
1008
667
  "cube",
1009
668
  "flow",
1010
- T
669
+ C
1011
670
  ] : [
1012
671
  "cube",
1013
672
  "flow",
1014
673
  null
1015
- ], [x, T]), O = i ? C(i) : null, k = l(() => !_ || !O || v === null ? !1 : O !== v, [
674
+ ], [x, C]), E = i ? D(i) : null, k = l(() => !_ || !E || v === null ? !1 : E !== v, [
1016
675
  _,
1017
- O,
676
+ E,
1018
677
  v
1019
- ]), A = l(() => !b || !x || o ? !1 : !_ || v === null ? !0 : v === O, [
678
+ ]), A = l(() => !b || !x || o ? !1 : !_ || v === null ? !0 : v === E, [
1020
679
  b,
1021
680
  x,
1022
681
  o,
1023
682
  _,
1024
683
  v,
1025
- O
684
+ E
1026
685
  ]);
1027
686
  c(() => {
1028
- !_ && i && !o && b && y(O);
687
+ !_ && i && !o && b && y(E);
1029
688
  }, [
1030
689
  _,
1031
690
  i,
1032
691
  o,
1033
692
  b,
1034
- O
693
+ E
1035
694
  ]);
1036
695
  let j = e({
1037
- queryKey: D,
696
+ queryKey: T,
1038
697
  queryFn: async () => {
1039
698
  if (!x) throw Error("No flow query available");
1040
699
  let e = performance.now();
@@ -1044,7 +703,7 @@ function ee(i, a = {}) {
1044
703
  rawData: t.rawData(),
1045
704
  executionTime: performance.now() - e,
1046
705
  cacheInfo: t.cacheInfo?.(),
1047
- queryKeyString: E
706
+ queryKeyString: w
1048
707
  };
1049
708
  } catch (e) {
1050
709
  let t = e instanceof Error ? e : Error(String(e));
@@ -1056,18 +715,18 @@ function ee(i, a = {}) {
1056
715
  gcTime: 300 * 1e3
1057
716
  });
1058
717
  c(() => {
1059
- _ && A && j.isSuccess && !j.isFetching && x && y(O);
718
+ _ && A && j.isSuccess && !j.isFetching && x && y(E);
1060
719
  }, [
1061
720
  _,
1062
721
  A,
1063
722
  j.isSuccess,
1064
723
  j.isFetching,
1065
724
  x,
1066
- O
725
+ E
1067
726
  ]);
1068
- let M = E !== null && j.data?.queryKeyString !== void 0 && j.data.queryKeyString !== E, N = l(() => {
727
+ let M = w !== null && j.data?.queryKeyString !== void 0 && j.data.queryKeyString !== w, N = l(() => {
1069
728
  if (M || !j.data?.rawData) return null;
1070
- let e = Z(j.data.rawData);
729
+ let e = ie(j.data.rawData);
1071
730
  return e && j.isSuccess && !j.isFetching && f?.(e), e;
1072
731
  }, [
1073
732
  j.data,
@@ -1076,8 +735,8 @@ function ee(i, a = {}) {
1076
735
  f,
1077
736
  M
1078
737
  ]), P = s((e) => {
1079
- x && b && (y(O), e?.bustCache ? (h.removeQueries({ queryKey: D }), h.fetchQuery({
1080
- queryKey: D,
738
+ x && b && (y(E), e?.bustCache ? (h.removeQueries({ queryKey: T }), h.fetchQuery({
739
+ queryKey: T,
1081
740
  queryFn: async () => {
1082
741
  let e = performance.now(), t = await m.load(x, { bustCache: !0 });
1083
742
  return {
@@ -1092,12 +751,12 @@ function ee(i, a = {}) {
1092
751
  b,
1093
752
  j,
1094
753
  h,
1095
- D,
754
+ T,
1096
755
  m,
1097
- O
756
+ E
1098
757
  ]), F = s(() => {
1099
- h.removeQueries({ queryKey: D });
1100
- }, [h, D]);
758
+ h.removeQueries({ queryKey: T });
759
+ }, [h, T]);
1101
760
  return {
1102
761
  data: N,
1103
762
  rawData: M ? null : j.data?.rawData ?? null,
@@ -1113,7 +772,7 @@ function ee(i, a = {}) {
1113
772
  needsRefresh: k
1114
773
  };
1115
774
  }
1116
- function te(e) {
775
+ function oe(e) {
1117
776
  return e ? [
1118
777
  "cube",
1119
778
  "flow",
@@ -1126,11 +785,11 @@ function te(e) {
1126
785
  }
1127
786
  //#endregion
1128
787
  //#region src/client/hooks/queries/useRetentionQuery.ts
1129
- var ne = 300;
1130
- function re(e) {
788
+ var se = 300;
789
+ function ce(e) {
1131
790
  return !(!e || !e.retention || !e.retention.timeDimension || !e.retention.bindingKey || !e.retention.periods || e.retention.periods < 1);
1132
791
  }
1133
- function ie(e) {
792
+ function le(e) {
1134
793
  if (e) {
1135
794
  if (typeof e == "string") return e.split(".").pop();
1136
795
  if (Array.isArray(e) && e.length > 0) {
@@ -1139,7 +798,7 @@ function ie(e) {
1139
798
  }
1140
799
  }
1141
800
  }
1142
- function ae(e) {
801
+ function Z(e) {
1143
802
  if (typeof e == "string") return e;
1144
803
  if (e && typeof e == "object" && !Array.isArray(e)) {
1145
804
  let t = Object.values(e);
@@ -1161,7 +820,7 @@ function Q(e, t, n) {
1161
820
  cohortSize: Number(t.cohortSize ?? t.cohort_size ?? 0),
1162
821
  retainedUsers: Number(t.retainedUsers ?? t.retained_users ?? 0),
1163
822
  retentionRate: Number(t.retentionRate ?? t.retention_rate ?? 0),
1164
- breakdownValue: ae(t.breakdownValues) ?? t.breakdownValue ?? t.breakdown_value ?? null
823
+ breakdownValue: Z(t.breakdownValues) ?? t.breakdownValue ?? t.breakdown_value ?? null
1165
824
  };
1166
825
  }), i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
1167
826
  r.forEach((e) => {
@@ -1172,12 +831,12 @@ function Q(e, t, n) {
1172
831
  rows: r,
1173
832
  periods: o,
1174
833
  breakdownValues: s,
1175
- summary: oe(r, s),
834
+ summary: ue(r, s),
1176
835
  granularity: t,
1177
836
  bindingKeyLabel: n
1178
837
  };
1179
838
  }
1180
- function oe(e, t) {
839
+ function ue(e, t) {
1181
840
  let n = e.filter((e) => e.period === 1).map((e) => e.retentionRate);
1182
841
  return {
1183
842
  totalUsers: e.filter((e) => e.period === 0).reduce((e, t) => e + t.cohortSize, 0),
@@ -1187,12 +846,12 @@ function oe(e, t) {
1187
846
  segmentCount: t?.length || 1
1188
847
  };
1189
848
  }
1190
- function se(i, a = {}) {
1191
- let { skip: o = !1, debounceMs: u = ne, onComplete: f, onError: p, getFieldLabel: m } = a, { cubeApi: h } = r(), g = t(), { features: _ } = n(), v = _.manualRefresh ?? !1, [y, b] = d(null), { debouncedValue: x, isDebouncing: S } = w(i, {
1192
- isValid: re(i),
849
+ function de(i, a = {}) {
850
+ let { skip: o = !1, debounceMs: u = se, onComplete: f, onError: p, getFieldLabel: m } = a, { cubeApi: h } = r(), g = t(), { features: _ } = n(), v = _.manualRefresh ?? !1, [y, b] = d(null), { debouncedValue: x, isDebouncing: S } = O(i, {
851
+ isValid: ce(i),
1193
852
  skip: o,
1194
853
  debounceMs: u
1195
- }), T = l(() => x ? [
854
+ }), C = l(() => x ? [
1196
855
  "cube",
1197
856
  "retention",
1198
857
  JSON.stringify(x)
@@ -1200,27 +859,27 @@ function se(i, a = {}) {
1200
859
  "cube",
1201
860
  "retention",
1202
861
  null
1203
- ], [x]), E = x ? C(x) : null, D = l(() => !v || !E || y === null ? !1 : E !== y, [
862
+ ], [x]), w = x ? D(x) : null, T = l(() => !v || !w || y === null ? !1 : w !== y, [
1204
863
  v,
1205
- E,
864
+ w,
1206
865
  y
1207
- ]), O = l(() => !x || o ? !1 : !v || y === null ? !0 : y === E, [
866
+ ]), E = l(() => !x || o ? !1 : !v || y === null ? !0 : y === w, [
1208
867
  x,
1209
868
  o,
1210
869
  v,
1211
870
  y,
1212
- E
871
+ w
1213
872
  ]);
1214
873
  c(() => {
1215
- !v && x && !o && b(E);
874
+ !v && x && !o && b(w);
1216
875
  }, [
1217
876
  v,
1218
877
  x,
1219
878
  o,
1220
- E
879
+ w
1221
880
  ]);
1222
881
  let k = e({
1223
- queryKey: T,
882
+ queryKey: C,
1224
883
  queryFn: async () => {
1225
884
  if (!x) throw Error("No retention query available");
1226
885
  let e = performance.now();
@@ -1236,19 +895,19 @@ function se(i, a = {}) {
1236
895
  throw p?.(t), t;
1237
896
  }
1238
897
  },
1239
- enabled: O,
898
+ enabled: E,
1240
899
  staleTime: 6e4,
1241
900
  gcTime: 300 * 1e3
1242
901
  });
1243
902
  c(() => {
1244
- v && O && k.isSuccess && !k.isFetching && x && b(E);
903
+ v && E && k.isSuccess && !k.isFetching && x && b(w);
1245
904
  }, [
1246
905
  v,
1247
- O,
906
+ E,
1248
907
  k.isSuccess,
1249
908
  k.isFetching,
1250
909
  x,
1251
- E
910
+ w
1252
911
  ]);
1253
912
  let A = i?.retention?.granularity, j = l(() => {
1254
913
  let e = i?.retention?.bindingKey;
@@ -1261,7 +920,7 @@ function se(i, a = {}) {
1261
920
  let e = m(j);
1262
921
  if (e && e !== j) return e;
1263
922
  }
1264
- return ie(i?.retention?.bindingKey);
923
+ return le(i?.retention?.bindingKey);
1265
924
  }, [
1266
925
  j,
1267
926
  m,
@@ -1277,8 +936,8 @@ function se(i, a = {}) {
1277
936
  f,
1278
937
  A,
1279
938
  M
1280
- ]), P = s(async (e) => x ? (e?.bustCache && g.removeQueries({ queryKey: T }), b(E), Q((await g.fetchQuery({
1281
- queryKey: T,
939
+ ]), P = s(async (e) => x ? (e?.bustCache && g.removeQueries({ queryKey: C }), b(w), Q((await g.fetchQuery({
940
+ queryKey: C,
1282
941
  queryFn: async () => {
1283
942
  let e = await h.load(x);
1284
943
  return {
@@ -1290,9 +949,9 @@ function se(i, a = {}) {
1290
949
  })).rawData, A, M)) : null, [
1291
950
  x,
1292
951
  g,
1293
- T,
952
+ C,
1294
953
  h,
1295
- E,
954
+ w,
1296
955
  A,
1297
956
  M
1298
957
  ]), F = s(() => {
@@ -1313,13 +972,13 @@ function se(i, a = {}) {
1313
972
  cacheInfo: k.data?.cacheInfo ?? null,
1314
973
  execute: P,
1315
974
  refetch: F,
1316
- needsRefresh: D
975
+ needsRefresh: T
1317
976
  };
1318
977
  }
1319
978
  //#endregion
1320
979
  //#region src/client/hooks/useResponsiveDashboard.ts
1321
- var $ = 1200, ce = 768;
1322
- function le() {
980
+ var $ = 1200, fe = 768;
981
+ function pe() {
1323
982
  let [e, t] = d(() => typeof window < "u" ? window.innerWidth : $), n = u(null), r = u(null), i = s((e) => {
1324
983
  if (n.current &&= (n.current.disconnect(), null), r.current = e, e) {
1325
984
  let r = e.offsetWidth;
@@ -1344,7 +1003,7 @@ function le() {
1344
1003
  window.removeEventListener("resize", e), clearTimeout(n);
1345
1004
  };
1346
1005
  }, []);
1347
- let a = l(() => e >= $ ? "desktop" : e >= ce ? "scaled" : "mobile", [e]);
1006
+ let a = l(() => e >= $ ? "desktop" : e >= fe ? "scaled" : "mobile", [e]);
1348
1007
  return {
1349
1008
  containerRef: i,
1350
1009
  containerWidth: e,
@@ -1356,8 +1015,8 @@ function le() {
1356
1015
  }
1357
1016
  //#endregion
1358
1017
  //#region src/client/hooks/useFilterValues.ts
1359
- function ue(e, t = !0) {
1360
- let [n, r] = d(null), i = u(""), { resultSet: a, isLoading: o, error: f } = O(n, {
1018
+ function me(e, t = !0) {
1019
+ let [n, r] = d(null), i = u(""), { resultSet: a, isLoading: o, error: f } = M(n, {
1361
1020
  skip: !n || !t || !e,
1362
1021
  debounceMs: 150,
1363
1022
  keepPreviousData: !0
@@ -1423,7 +1082,7 @@ function ue(e, t = !0) {
1423
1082
  }
1424
1083
  //#endregion
1425
1084
  //#region src/client/hooks/useDebounce.ts
1426
- function de(e, t) {
1085
+ function he(e, t) {
1427
1086
  let [n, r] = d(e);
1428
1087
  return c(() => {
1429
1088
  let n = setTimeout(() => {
@@ -1436,7 +1095,7 @@ function de(e, t) {
1436
1095
  }
1437
1096
  //#endregion
1438
1097
  //#region src/client/hooks/useDirtyStateTracking.ts
1439
- function fe({ initialConfig: e, onConfigChange: t, onSave: n, onDirtyStateChange: r }) {
1098
+ function ge({ initialConfig: e, onConfigChange: t, onSave: n, onDirtyStateChange: r }) {
1440
1099
  let i = u(e), a = u(!1), o = s(async (e) => {
1441
1100
  if (a.current) {
1442
1101
  r && r(!0);
@@ -1459,6 +1118,6 @@ function fe({ initialConfig: e, onConfigChange: t, onSave: n, onDirtyStateChange
1459
1118
  };
1460
1119
  }
1461
1120
  //#endregion
1462
- export { f as A, C, y as D, S as E, x as O, O as S, b as T, P as _, se as a, L as b, J as c, V as d, I as f, k as g, A as h, le as i, p as k, q as l, j as m, de as n, te as o, F as p, ue as r, ee as s, fe as t, z as u, N as v, v as w, E as x, M as y };
1121
+ export { g as A, D as C, T as D, E, x as F, y as I, S as L, m as M, p as N, _ as O, v as P, M as S, w as T, R as _, de as a, V as b, Y as c, te as d, B as f, N as g, P as h, pe as i, b as j, h as k, J as l, F as m, he as n, oe as o, z as p, me as r, ae as s, ge as t, U as u, L as v, C as w, A as x, I as y };
1463
1122
 
1464
- //# sourceMappingURL=useDirtyStateTracking-BY_IIG1n.js.map
1123
+ //# sourceMappingURL=useDirtyStateTracking-BT6zqCFl.js.map