drizzle-cube 0.3.33 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/express/index.cjs +1 -1
- package/dist/adapters/express/index.js +1 -1
- package/dist/adapters/fastify/index.cjs +1 -1
- package/dist/adapters/fastify/index.js +1 -1
- package/dist/adapters/hono/index.cjs +1 -1
- package/dist/adapters/hono/index.js +1 -1
- package/dist/adapters/{mcp-transport-n-4QT0Xg.js → mcp-transport-Dmolep14.js} +4373 -3281
- package/dist/adapters/mcp-transport-h__yKJm9.cjs +257 -0
- package/dist/adapters/nextjs/index.cjs +1 -1
- package/dist/adapters/nextjs/index.js +1 -1
- package/dist/adapters/utils.cjs +8 -8
- package/dist/adapters/utils.d.ts +2 -137
- package/dist/adapters/utils.js +1347 -1356
- package/dist/client/chunks/{DashboardEditModal-rLcmZpe_.js → DashboardEditModal-fg72EPDl.js} +14 -13
- package/dist/client/chunks/DashboardEditModal-fg72EPDl.js.map +1 -0
- package/dist/client/chunks/{analysis-builder-DCt5C58c.js → analysis-builder-C1QDrzgM.js} +2986 -3043
- package/dist/client/chunks/analysis-builder-C1QDrzgM.js.map +1 -0
- package/dist/client/chunks/{analysis-builder-shared-ysrRYGiU.js → analysis-builder-shared-BkwUHObk.js} +361 -360
- package/dist/client/chunks/analysis-builder-shared-BkwUHObk.js.map +1 -0
- package/dist/client/chunks/useDirtyStateTracking-CTS_m9mg.js.map +1 -1
- package/dist/client/components/AnalysisBuilder/AnalysisResultsPanel.d.ts +2 -1
- package/dist/client/components/AnalysisBuilder/types.d.ts +18 -6
- package/dist/client/components.js +1 -1
- package/dist/client/hooks/queries/useDryRunQuery.d.ts +14 -48
- package/dist/client/hooks/useAnalysisBuilderHook.d.ts +6 -33
- package/dist/client/hooks/useAnalysisQueryExecution.d.ts +7 -7
- package/dist/client/hooks.js +194 -22
- package/dist/client/hooks.js.map +1 -1
- package/dist/client/index.js +3 -3
- package/dist/client/shared/types.d.ts +27 -0
- package/dist/client/styles.css +1 -1
- package/dist/client/utils/filterUtils.d.ts +6 -0
- package/dist/client-bundle-stats.html +1 -1
- package/dist/server/index.cjs +50 -50
- package/dist/server/index.d.ts +1727 -547
- package/dist/server/index.js +5648 -4529
- package/package.json +1 -1
- package/dist/adapters/mcp-transport-CV5Mv8KV.cjs +0 -257
- package/dist/client/chunks/DashboardEditModal-rLcmZpe_.js.map +0 -1
- package/dist/client/chunks/analysis-builder-DCt5C58c.js.map +0 -1
- package/dist/client/chunks/analysis-builder-shared-ysrRYGiU.js.map +0 -1
- package/dist/client/chunks/hooks-CdyIO1-j.js +0 -236
- package/dist/client/chunks/hooks-CdyIO1-j.js.map +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsxs as b, jsx as p, Fragment as G } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { l as
|
|
4
|
-
import { b as
|
|
5
|
-
import { u as
|
|
6
|
-
import { c as
|
|
7
|
-
import { d as
|
|
8
|
-
import { Y as
|
|
9
|
-
import { F as
|
|
10
|
-
import { n as
|
|
11
|
-
import { c as
|
|
12
|
-
import {
|
|
13
|
-
function
|
|
2
|
+
import Pe, { useState as Ce, useRef as ae, useEffect as se, memo as kn, useContext as yt, createContext as In, useMemo as A, useCallback as U } from "react";
|
|
3
|
+
import { l as qn, g as Bn } from "./syntaxHighlighting-DAT9C6Ss.js";
|
|
4
|
+
import { b as nt } from "./icons-DRreo6m8.js";
|
|
5
|
+
import { u as Nn, g as Vn } from "./providers-D2xswCYu.js";
|
|
6
|
+
import { c as En, d as rt, e as it, s as st, p as Pn, f as Un, l as gt } from "./vendor-DfDLOfBe.js";
|
|
7
|
+
import { d as _n, R as Ln, a as Kn, g as $n, D as Gn } from "./retention-CzCo8262.js";
|
|
8
|
+
import { Y as Hn, Z as $, _ as we, $ as W, a0 as J, a1 as Y, S as On, K as ht, a2 as jn } from "./DashboardEditModal-fg72EPDl.js";
|
|
9
|
+
import { F as at, b as ot } from "./flow-utils-CjQZG5qq.js";
|
|
10
|
+
import { n as zn, u as Wn, a as Jn, b as Yn, d as Xn, o as Zn } from "./useDirtyStateTracking-CTS_m9mg.js";
|
|
11
|
+
import { c as er, a as pt } from "./funnel-utils-CyonoNeC.js";
|
|
12
|
+
import { useDryRunQueries as tr, useDryRunQuery as Ne } from "../hooks.js";
|
|
13
|
+
function nr(t) {
|
|
14
14
|
const i = /* @__PURE__ */ new Date(), e = t.toLowerCase().trim(), n = i.getUTCFullYear(), r = i.getUTCMonth(), s = i.getUTCDate(), o = i.getUTCDay();
|
|
15
15
|
if (e === "today") {
|
|
16
16
|
const y = new Date(i);
|
|
@@ -90,27 +90,27 @@ function rr(t) {
|
|
|
90
90
|
}
|
|
91
91
|
return null;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function rr(t) {
|
|
94
94
|
if (Array.isArray(t)) {
|
|
95
95
|
if (t.length < 2) return null;
|
|
96
96
|
const i = new Date(t[0]), e = new Date(t[1]);
|
|
97
97
|
return isNaN(i.getTime()) || isNaN(e.getTime()) ? null : (e.setUTCHours(23, 59, 59, 999), { start: i, end: e });
|
|
98
98
|
}
|
|
99
|
-
return
|
|
99
|
+
return nr(t);
|
|
100
100
|
}
|
|
101
101
|
function pe(t) {
|
|
102
102
|
return t.toISOString().split("T")[0];
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function ir(t, i) {
|
|
105
105
|
const e = i.getTime() - t.getTime(), n = Math.ceil(e / (1e3 * 60 * 60 * 24)), r = new Date(t);
|
|
106
106
|
r.setUTCDate(r.getUTCDate() - 1), r.setUTCHours(23, 59, 59, 999);
|
|
107
107
|
const s = new Date(r);
|
|
108
108
|
return s.setUTCDate(s.getUTCDate() - n + 1), s.setUTCHours(0, 0, 0, 0), { start: s, end: r };
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function Ct(t, i) {
|
|
111
111
|
for (const e of t)
|
|
112
112
|
if ("type" in e && "filters" in e) {
|
|
113
|
-
const r =
|
|
113
|
+
const r = Ct(e.filters, i);
|
|
114
114
|
if (r) return r;
|
|
115
115
|
} else if ("member" in e) {
|
|
116
116
|
const n = e;
|
|
@@ -118,21 +118,21 @@ function pt(t, i) {
|
|
|
118
118
|
return { dateRange: n.dateRange };
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
const e =
|
|
121
|
+
function wt(t, i) {
|
|
122
|
+
const e = Ct(i, t);
|
|
123
123
|
if (!e?.dateRange) return;
|
|
124
|
-
const n =
|
|
124
|
+
const n = rr(e.dateRange);
|
|
125
125
|
if (!n) return;
|
|
126
|
-
const r =
|
|
126
|
+
const r = ir(n.start, n.end);
|
|
127
127
|
return [
|
|
128
128
|
[pe(n.start), pe(n.end)],
|
|
129
129
|
[pe(r.start), pe(r.end)]
|
|
130
130
|
];
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function bt(t, i) {
|
|
133
133
|
return t.reduce((e, n) => {
|
|
134
134
|
if ("type" in n && "filters" in n) {
|
|
135
|
-
const r = n, s =
|
|
135
|
+
const r = n, s = bt(r.filters, i);
|
|
136
136
|
s.length > 0 && e.push({ type: r.type, filters: s });
|
|
137
137
|
} else if ("member" in n) {
|
|
138
138
|
const r = n;
|
|
@@ -147,7 +147,8 @@ function be(t, i, e, n, r = !1) {
|
|
|
147
147
|
let o = e;
|
|
148
148
|
if (!r)
|
|
149
149
|
for (const d of s)
|
|
150
|
-
o =
|
|
150
|
+
o = bt(o, d);
|
|
151
|
+
o = o.filter((d) => Hn(d));
|
|
151
152
|
const l = {
|
|
152
153
|
measures: t.map((d) => d.field),
|
|
153
154
|
dimensions: i.filter((d) => !d.isTimeDimension).map((d) => d.field),
|
|
@@ -157,7 +158,7 @@ function be(t, i, e, n, r = !1) {
|
|
|
157
158
|
granularity: d.granularity || "day"
|
|
158
159
|
};
|
|
159
160
|
if (d.enableComparison) {
|
|
160
|
-
const m =
|
|
161
|
+
const m = wt(d.field, e);
|
|
161
162
|
m && (f.compareDateRange = m);
|
|
162
163
|
}
|
|
163
164
|
return f;
|
|
@@ -167,7 +168,7 @@ function be(t, i, e, n, r = !1) {
|
|
|
167
168
|
};
|
|
168
169
|
return l.measures?.length === 0 && delete l.measures, l.dimensions?.length === 0 && delete l.dimensions, l.timeDimensions?.length === 0 && delete l.timeDimensions, l;
|
|
169
170
|
}
|
|
170
|
-
const
|
|
171
|
+
const sr = "drizzle-cube-analysis-builder-v3";
|
|
171
172
|
function R() {
|
|
172
173
|
return {
|
|
173
174
|
metrics: [],
|
|
@@ -178,7 +179,7 @@ function R() {
|
|
|
178
179
|
validationError: null
|
|
179
180
|
};
|
|
180
181
|
}
|
|
181
|
-
const
|
|
182
|
+
const Ue = ({
|
|
182
183
|
code: t,
|
|
183
184
|
language: i,
|
|
184
185
|
title: e,
|
|
@@ -187,14 +188,14 @@ const Pe = ({
|
|
|
187
188
|
className: s = "",
|
|
188
189
|
headerRight: o
|
|
189
190
|
}) => {
|
|
190
|
-
const [l, d] = Ce(!1), f = ae(null), m =
|
|
191
|
+
const [l, d] = Ce(!1), f = ae(null), m = nt("copy"), y = nt("check");
|
|
191
192
|
se(() => {
|
|
192
193
|
if (!f.current) return;
|
|
193
194
|
const g = f.current;
|
|
194
195
|
let S = !0;
|
|
195
|
-
return g.textContent = t,
|
|
196
|
+
return g.textContent = t, qn().then(() => {
|
|
196
197
|
if (!S) return;
|
|
197
|
-
const w =
|
|
198
|
+
const w = Bn();
|
|
198
199
|
w && (g.innerHTML = w.highlight(t, { language: i }).value);
|
|
199
200
|
}).catch(() => {
|
|
200
201
|
S && (g.textContent = t);
|
|
@@ -249,23 +250,23 @@ const Pe = ({
|
|
|
249
250
|
)
|
|
250
251
|
] });
|
|
251
252
|
};
|
|
252
|
-
function
|
|
253
|
+
function St(t) {
|
|
253
254
|
return t.isTimeDimension;
|
|
254
255
|
}
|
|
255
|
-
function
|
|
256
|
-
return t.find(
|
|
256
|
+
function ar(t) {
|
|
257
|
+
return t.find(St);
|
|
257
258
|
}
|
|
258
|
-
function
|
|
259
|
+
function or(t) {
|
|
259
260
|
return t.find((i) => !i.isTimeDimension);
|
|
260
261
|
}
|
|
261
|
-
function
|
|
262
|
+
function je(t) {
|
|
262
263
|
return t.filter((i) => !i.isTimeDimension);
|
|
263
264
|
}
|
|
264
|
-
function
|
|
265
|
-
return t.filter(
|
|
265
|
+
function vt(t) {
|
|
266
|
+
return t.filter(St);
|
|
266
267
|
}
|
|
267
|
-
function
|
|
268
|
-
const n = i.length, r =
|
|
268
|
+
function ze(t, i, e) {
|
|
269
|
+
const n = i.length, r = je(e).length, s = vt(e).length, o = e.length;
|
|
269
270
|
switch (t) {
|
|
270
271
|
// Always available charts
|
|
271
272
|
case "table":
|
|
@@ -310,7 +311,7 @@ function je(t, i, e) {
|
|
|
310
311
|
return { available: !0 };
|
|
311
312
|
}
|
|
312
313
|
}
|
|
313
|
-
function
|
|
314
|
+
function lr(t, i) {
|
|
314
315
|
const e = [
|
|
315
316
|
"activityGrid",
|
|
316
317
|
"area",
|
|
@@ -329,21 +330,21 @@ function cr(t, i) {
|
|
|
329
330
|
"treemap"
|
|
330
331
|
], n = {};
|
|
331
332
|
for (const r of e)
|
|
332
|
-
n[r] =
|
|
333
|
+
n[r] = ze(r, t, i);
|
|
333
334
|
return n;
|
|
334
335
|
}
|
|
335
|
-
function
|
|
336
|
-
if (
|
|
336
|
+
function xt(t, i, e) {
|
|
337
|
+
if (ze(e, t, i).available || t.length === 0 && i.length === 0)
|
|
337
338
|
return e;
|
|
338
|
-
const r =
|
|
339
|
+
const r = vt(i).length > 0, s = je(i).length > 0, o = t.length > 0;
|
|
339
340
|
return r && o ? "line" : s && o ? "bar" : o && !s && !r ? "kpiNumber" : "table";
|
|
340
341
|
}
|
|
341
|
-
function
|
|
342
|
-
const n =
|
|
342
|
+
function Ve(t, i, e) {
|
|
343
|
+
const n = xt(t, i, e), r = cr(n, t, i);
|
|
343
344
|
return { chartType: n, chartConfig: r };
|
|
344
345
|
}
|
|
345
|
-
function
|
|
346
|
-
const n =
|
|
346
|
+
function cr(t, i, e) {
|
|
347
|
+
const n = ar(e), r = or(e), s = je(e), o = e;
|
|
347
348
|
switch (t) {
|
|
348
349
|
case "line":
|
|
349
350
|
case "area":
|
|
@@ -414,35 +415,35 @@ function dr(t, i, e) {
|
|
|
414
415
|
};
|
|
415
416
|
}
|
|
416
417
|
}
|
|
417
|
-
function
|
|
418
|
-
if (n &&
|
|
418
|
+
function dr(t, i, e, n) {
|
|
419
|
+
if (n && ze(e, t, i).available)
|
|
419
420
|
return null;
|
|
420
|
-
const r =
|
|
421
|
+
const r = xt(t, i, e);
|
|
421
422
|
return r !== e ? r : null;
|
|
422
423
|
}
|
|
423
424
|
function j(t) {
|
|
424
425
|
return typeof t == "string" ? t : typeof t == "object" && t !== null ? JSON.stringify(t) : String(t ?? "");
|
|
425
426
|
}
|
|
426
|
-
const
|
|
427
|
+
const ur = {
|
|
427
428
|
good: "bg-dc-success-bg text-dc-success border-dc-success",
|
|
428
429
|
warning: "bg-dc-warning-bg text-dc-warning border-dc-warning",
|
|
429
430
|
critical: "bg-dc-danger-bg text-dc-error border-dc-error"
|
|
430
|
-
},
|
|
431
|
+
}, fr = {
|
|
431
432
|
critical: "bg-dc-danger-bg text-dc-error",
|
|
432
433
|
warning: "bg-dc-warning-bg text-dc-warning",
|
|
433
434
|
suggestion: "bg-dc-accent-bg text-dc-accent"
|
|
434
|
-
},
|
|
435
|
+
}, mr = {
|
|
435
436
|
high: "text-dc-error",
|
|
436
437
|
medium: "text-dc-warning",
|
|
437
438
|
low: "text-dc-text-muted"
|
|
438
439
|
};
|
|
439
|
-
function
|
|
440
|
+
function yr({ assessment: t, reason: i }) {
|
|
440
441
|
const e = {
|
|
441
442
|
good: "Good",
|
|
442
443
|
warning: "Warning",
|
|
443
444
|
critical: "Critical"
|
|
444
445
|
};
|
|
445
|
-
return /* @__PURE__ */ b("div", { className: `dc:p-4 dc:rounded-lg dc:border ${
|
|
446
|
+
return /* @__PURE__ */ b("div", { className: `dc:p-4 dc:rounded-lg dc:border ${ur[t]}`, children: [
|
|
446
447
|
/* @__PURE__ */ p("div", { className: "dc:flex dc:items-center dc:gap-2 dc:mb-1", children: /* @__PURE__ */ b("span", { className: "dc:font-semibold dc:uppercase dc:text-base", children: [
|
|
447
448
|
t === "good" && "✓ ",
|
|
448
449
|
t === "warning" && "⚠ ",
|
|
@@ -452,9 +453,9 @@ function gr({ assessment: t, reason: i }) {
|
|
|
452
453
|
/* @__PURE__ */ p("p", { className: "dc:text-sm", children: j(i) })
|
|
453
454
|
] });
|
|
454
455
|
}
|
|
455
|
-
function
|
|
456
|
+
function gr({ issue: t }) {
|
|
456
457
|
return /* @__PURE__ */ b("div", { className: "dc:flex dc:items-start dc:gap-2 dc:py-2", children: [
|
|
457
|
-
/* @__PURE__ */ b("span", { className: `dc:text-sm ${
|
|
458
|
+
/* @__PURE__ */ b("span", { className: `dc:text-sm ${mr[t.severity]}`, children: [
|
|
458
459
|
t.severity === "high" && "●",
|
|
459
460
|
t.severity === "medium" && "○",
|
|
460
461
|
t.severity === "low" && "○"
|
|
@@ -462,8 +463,8 @@ function hr({ issue: t }) {
|
|
|
462
463
|
/* @__PURE__ */ p("span", { className: "dc:text-sm text-dc-text-secondary", children: j(t.description) })
|
|
463
464
|
] });
|
|
464
465
|
}
|
|
465
|
-
function
|
|
466
|
-
const [i, e] =
|
|
466
|
+
function lt({ text: t }) {
|
|
467
|
+
const [i, e] = Pe.useState(!1);
|
|
467
468
|
return /* @__PURE__ */ p(
|
|
468
469
|
"button",
|
|
469
470
|
{
|
|
@@ -480,7 +481,7 @@ function ot({ text: t }) {
|
|
|
480
481
|
}
|
|
481
482
|
);
|
|
482
483
|
}
|
|
483
|
-
function
|
|
484
|
+
function hr({ rec: t }) {
|
|
484
485
|
const i = {
|
|
485
486
|
index: "INDEX",
|
|
486
487
|
table: "TABLE",
|
|
@@ -492,7 +493,7 @@ function pr({ rec: t }) {
|
|
|
492
493
|
/* @__PURE__ */ p(
|
|
493
494
|
"span",
|
|
494
495
|
{
|
|
495
|
-
className: `dc:px-2 dc:py-0.5 dc:text-xs dc:font-medium dc:rounded ${
|
|
496
|
+
className: `dc:px-2 dc:py-0.5 dc:text-xs dc:font-medium dc:rounded ${fr[t.severity]}`,
|
|
496
497
|
children: i[t.type]
|
|
497
498
|
}
|
|
498
499
|
),
|
|
@@ -500,11 +501,11 @@ function pr({ rec: t }) {
|
|
|
500
501
|
] }),
|
|
501
502
|
/* @__PURE__ */ p("p", { className: "dc:text-sm text-dc-text-secondary dc:mb-3", children: j(t.description) }),
|
|
502
503
|
t.sql && /* @__PURE__ */ p("div", { className: "dc:mt-2", children: /* @__PURE__ */ p(
|
|
503
|
-
|
|
504
|
+
Ue,
|
|
504
505
|
{
|
|
505
506
|
code: t.sql,
|
|
506
507
|
language: "sql",
|
|
507
|
-
headerRight: /* @__PURE__ */ p(
|
|
508
|
+
headerRight: /* @__PURE__ */ p(lt, { text: t.sql })
|
|
508
509
|
}
|
|
509
510
|
) }),
|
|
510
511
|
t.cubeCode && /* @__PURE__ */ b("div", { className: "dc:mt-2", children: [
|
|
@@ -515,7 +516,7 @@ function pr({ rec: t }) {
|
|
|
515
516
|
] }),
|
|
516
517
|
/* @__PURE__ */ b("div", { className: "dc:relative", children: [
|
|
517
518
|
/* @__PURE__ */ p("pre", { className: "dc:p-3 dc:text-xs bg-dc-surface-secondary dc:rounded dc:overflow-x-auto dc:font-mono text-dc-text", children: t.cubeCode }),
|
|
518
|
-
/* @__PURE__ */ p("div", { className: "dc:absolute dc:top-1 dc:right-1", children: /* @__PURE__ */ p(
|
|
519
|
+
/* @__PURE__ */ p("div", { className: "dc:absolute dc:top-1 dc:right-1", children: /* @__PURE__ */ p(lt, { text: t.cubeCode }) })
|
|
519
520
|
] })
|
|
520
521
|
] }),
|
|
521
522
|
t.estimatedImpact && /* @__PURE__ */ b("p", { className: "dc:text-xs text-dc-text-muted dc:mt-2", children: [
|
|
@@ -525,14 +526,14 @@ function pr({ rec: t }) {
|
|
|
525
526
|
] })
|
|
526
527
|
] });
|
|
527
528
|
}
|
|
528
|
-
function
|
|
529
|
+
function pr({ analysis: t, onClose: i, onClear: e }) {
|
|
529
530
|
const n = i || e;
|
|
530
|
-
return
|
|
531
|
+
return Pe.useEffect(() => {
|
|
531
532
|
const r = (s) => {
|
|
532
533
|
s.key === "Escape" && n && n();
|
|
533
534
|
};
|
|
534
535
|
return window.addEventListener("keydown", r), () => window.removeEventListener("keydown", r);
|
|
535
|
-
}, [n]),
|
|
536
|
+
}, [n]), Pe.useEffect(() => (document.body.style.overflow = "hidden", () => {
|
|
536
537
|
document.body.style.overflow = "";
|
|
537
538
|
}), []), /* @__PURE__ */ b("div", { className: "dc:fixed dc:inset-0 dc:z-50 dc:flex dc:items-center dc:justify-center dc:p-4 bg-black/50", children: [
|
|
538
539
|
/* @__PURE__ */ p(
|
|
@@ -561,7 +562,7 @@ function Cr({ analysis: t, onClose: i, onClear: e }) {
|
|
|
561
562
|
] }),
|
|
562
563
|
/* @__PURE__ */ b("div", { className: "dc:flex-1 dc:overflow-y-auto dc:px-6 dc:py-4 dc:space-y-6", children: [
|
|
563
564
|
/* @__PURE__ */ p(
|
|
564
|
-
|
|
565
|
+
yr,
|
|
565
566
|
{
|
|
566
567
|
assessment: t.assessment,
|
|
567
568
|
reason: t.assessmentReason
|
|
@@ -581,7 +582,7 @@ function Cr({ analysis: t, onClose: i, onClear: e }) {
|
|
|
581
582
|
t.issues.length,
|
|
582
583
|
")"
|
|
583
584
|
] }),
|
|
584
|
-
/* @__PURE__ */ p("div", { className: "dc:space-y-1 bg-dc-surface-secondary dc:rounded-lg dc:p-3", children: t.issues.map((r, s) => /* @__PURE__ */ p(
|
|
585
|
+
/* @__PURE__ */ p("div", { className: "dc:space-y-1 bg-dc-surface-secondary dc:rounded-lg dc:p-3", children: t.issues.map((r, s) => /* @__PURE__ */ p(gr, { issue: r }, s)) })
|
|
585
586
|
] }),
|
|
586
587
|
t.recommendations && t.recommendations.length > 0 && /* @__PURE__ */ b("div", { children: [
|
|
587
588
|
/* @__PURE__ */ b("h4", { className: "dc:text-sm dc:font-semibold text-dc-text-muted dc:uppercase dc:mb-3", children: [
|
|
@@ -589,7 +590,7 @@ function Cr({ analysis: t, onClose: i, onClear: e }) {
|
|
|
589
590
|
t.recommendations.length,
|
|
590
591
|
")"
|
|
591
592
|
] }),
|
|
592
|
-
/* @__PURE__ */ p("div", { className: "dc:space-y-4", children: t.recommendations.map((r, s) => /* @__PURE__ */ p(
|
|
593
|
+
/* @__PURE__ */ p("div", { className: "dc:space-y-4", children: t.recommendations.map((r, s) => /* @__PURE__ */ p(hr, { rec: r }, s)) })
|
|
593
594
|
] }),
|
|
594
595
|
(!t.recommendations || t.recommendations.length === 0) && /* @__PURE__ */ p("div", { className: "text-dc-text-muted dc:italic dc:p-4 bg-dc-surface-secondary dc:rounded-lg", children: "No specific recommendations. The query appears to be well-optimized." })
|
|
595
596
|
] }),
|
|
@@ -611,7 +612,7 @@ function Cr({ analysis: t, onClose: i, onClear: e }) {
|
|
|
611
612
|
] })
|
|
612
613
|
] });
|
|
613
614
|
}
|
|
614
|
-
const
|
|
615
|
+
const gi = kn(function({
|
|
615
616
|
sql: i,
|
|
616
617
|
sqlLoading: e = !1,
|
|
617
618
|
sqlError: n,
|
|
@@ -658,7 +659,7 @@ const hi = Rn(function({
|
|
|
658
659
|
/* @__PURE__ */ p("h4", { className: "dc:text-sm dc:font-semibold text-dc-text dc:mb-2", children: v }),
|
|
659
660
|
/* @__PURE__ */ p("div", { className: "text-dc-error dc:text-sm bg-dc-danger-bg dc:p-3 dc:rounded dc:border border-dc-error", style: { height: h }, children: n.message })
|
|
660
661
|
] }) : i ? /* @__PURE__ */ p(
|
|
661
|
-
|
|
662
|
+
Ue,
|
|
662
663
|
{
|
|
663
664
|
code: M,
|
|
664
665
|
language: "sql",
|
|
@@ -731,7 +732,7 @@ const hi = Rn(function({
|
|
|
731
732
|
s.summary.usedIndexes.join(", ")
|
|
732
733
|
] }),
|
|
733
734
|
/* @__PURE__ */ p(
|
|
734
|
-
|
|
735
|
+
Ue,
|
|
735
736
|
{
|
|
736
737
|
code: s.raw,
|
|
737
738
|
language: "sql",
|
|
@@ -747,7 +748,7 @@ const hi = Rn(function({
|
|
|
747
748
|
u.message
|
|
748
749
|
] }),
|
|
749
750
|
_ && m && /* @__PURE__ */ p(
|
|
750
|
-
|
|
751
|
+
pr,
|
|
751
752
|
{
|
|
752
753
|
analysis: m,
|
|
753
754
|
onClose: C
|
|
@@ -755,7 +756,7 @@ const hi = Rn(function({
|
|
|
755
756
|
)
|
|
756
757
|
] });
|
|
757
758
|
});
|
|
758
|
-
function
|
|
759
|
+
function ct() {
|
|
759
760
|
return {
|
|
760
761
|
metrics: [],
|
|
761
762
|
breakdowns: [],
|
|
@@ -765,10 +766,10 @@ function lt() {
|
|
|
765
766
|
validationError: null
|
|
766
767
|
};
|
|
767
768
|
}
|
|
768
|
-
function
|
|
769
|
+
function Cr(t) {
|
|
769
770
|
return t.map((i) => i.field);
|
|
770
771
|
}
|
|
771
|
-
function
|
|
772
|
+
function wr(t, i) {
|
|
772
773
|
const e = [], n = [];
|
|
773
774
|
for (const r of t)
|
|
774
775
|
if (r.isTimeDimension) {
|
|
@@ -777,7 +778,7 @@ function br(t, i) {
|
|
|
777
778
|
granularity: r.granularity || "day"
|
|
778
779
|
};
|
|
779
780
|
if (r.enableComparison) {
|
|
780
|
-
const o =
|
|
781
|
+
const o = wt(r.field, i);
|
|
781
782
|
o && (s.compareDateRange = o);
|
|
782
783
|
}
|
|
783
784
|
n.push(s);
|
|
@@ -785,24 +786,24 @@ function br(t, i) {
|
|
|
785
786
|
e.push(r.field);
|
|
786
787
|
return { dimensions: e, timeDimensions: n };
|
|
787
788
|
}
|
|
788
|
-
function
|
|
789
|
-
const { dimensions: i, timeDimensions: e } =
|
|
789
|
+
function br(t) {
|
|
790
|
+
const { dimensions: i, timeDimensions: e } = wr(
|
|
790
791
|
t.breakdowns,
|
|
791
792
|
t.filters
|
|
792
793
|
), n = {
|
|
793
|
-
measures:
|
|
794
|
+
measures: Cr(t.metrics),
|
|
794
795
|
dimensions: i
|
|
795
796
|
};
|
|
796
797
|
return e.length > 0 && (n.timeDimensions = e), t.filters.length > 0 && (n.filters = t.filters), t.order && Object.keys(t.order).length > 0 && (n.order = t.order), n;
|
|
797
798
|
}
|
|
798
|
-
function
|
|
799
|
+
function Sr(t) {
|
|
799
800
|
return t.map((i, e) => ({
|
|
800
801
|
id: $(),
|
|
801
802
|
field: i,
|
|
802
803
|
label: we(e)
|
|
803
804
|
}));
|
|
804
805
|
}
|
|
805
|
-
function
|
|
806
|
+
function vr(t) {
|
|
806
807
|
const i = [];
|
|
807
808
|
if (t.dimensions)
|
|
808
809
|
for (const e of t.dimensions)
|
|
@@ -824,24 +825,24 @@ function xr(t) {
|
|
|
824
825
|
}
|
|
825
826
|
return i;
|
|
826
827
|
}
|
|
827
|
-
function
|
|
828
|
+
function dt(t) {
|
|
828
829
|
return {
|
|
829
|
-
metrics:
|
|
830
|
-
breakdowns:
|
|
830
|
+
metrics: Sr(t.measures || []),
|
|
831
|
+
breakdowns: vr(t),
|
|
831
832
|
filters: t.filters || [],
|
|
832
833
|
order: t.order,
|
|
833
834
|
validationStatus: "idle",
|
|
834
835
|
validationError: null
|
|
835
836
|
};
|
|
836
837
|
}
|
|
837
|
-
function
|
|
838
|
+
function xr(t) {
|
|
838
839
|
return typeof t == "object" && t !== null && "queries" in t && Array.isArray(t.queries);
|
|
839
840
|
}
|
|
840
841
|
const K = {
|
|
841
842
|
type: "query",
|
|
842
843
|
createInitial() {
|
|
843
844
|
return {
|
|
844
|
-
queryStates: [
|
|
845
|
+
queryStates: [ct()],
|
|
845
846
|
activeQueryIndex: 0,
|
|
846
847
|
mergeStrategy: "concat"
|
|
847
848
|
};
|
|
@@ -864,22 +865,22 @@ const K = {
|
|
|
864
865
|
`Cannot load ${t.analysisType} config with query adapter`
|
|
865
866
|
);
|
|
866
867
|
const i = t;
|
|
867
|
-
if (
|
|
868
|
-
const e = i.query, n = e.queries.map(
|
|
869
|
-
return n.length === 0 && n.push(
|
|
868
|
+
if (xr(i.query)) {
|
|
869
|
+
const e = i.query, n = e.queries.map(dt);
|
|
870
|
+
return n.length === 0 && n.push(ct()), {
|
|
870
871
|
queryStates: n,
|
|
871
872
|
activeQueryIndex: 0,
|
|
872
873
|
mergeStrategy: e.mergeStrategy || "concat"
|
|
873
874
|
};
|
|
874
875
|
}
|
|
875
876
|
return {
|
|
876
|
-
queryStates: [
|
|
877
|
+
queryStates: [dt(i.query)],
|
|
877
878
|
activeQueryIndex: 0,
|
|
878
879
|
mergeStrategy: "concat"
|
|
879
880
|
};
|
|
880
881
|
},
|
|
881
882
|
save(t, i, e) {
|
|
882
|
-
const n = t.queryStates.map(
|
|
883
|
+
const n = t.queryStates.map(br), s = n.length === 1 && t.mergeStrategy === "concat" ? n[0] : {
|
|
883
884
|
queries: n,
|
|
884
885
|
mergeStrategy: t.mergeStrategy
|
|
885
886
|
};
|
|
@@ -926,9 +927,9 @@ const K = {
|
|
|
926
927
|
};
|
|
927
928
|
}
|
|
928
929
|
}, E = /* @__PURE__ */ new Map();
|
|
929
|
-
let
|
|
930
|
-
function
|
|
931
|
-
|
|
930
|
+
let _e = !1;
|
|
931
|
+
function Ee() {
|
|
932
|
+
_e || (E.has("query") || E.set("query", K), E.has("funnel") || E.set("funnel", W), E.has("flow") || E.set("flow", J), E.has("retention") || E.set("retention", Y), _e = !0);
|
|
932
933
|
}
|
|
933
934
|
const L = {
|
|
934
935
|
/**
|
|
@@ -951,7 +952,7 @@ const L = {
|
|
|
951
952
|
* @throws Error if no adapter is registered for the type
|
|
952
953
|
*/
|
|
953
954
|
get(t) {
|
|
954
|
-
|
|
955
|
+
Ee();
|
|
955
956
|
const i = E.get(t);
|
|
956
957
|
if (!i)
|
|
957
958
|
throw new Error(
|
|
@@ -967,7 +968,7 @@ const L = {
|
|
|
967
968
|
* @returns True if an adapter is registered
|
|
968
969
|
*/
|
|
969
970
|
has(t) {
|
|
970
|
-
return
|
|
971
|
+
return Ee(), E.has(t);
|
|
971
972
|
},
|
|
972
973
|
/**
|
|
973
974
|
* Get all registered analysis types.
|
|
@@ -976,7 +977,7 @@ const L = {
|
|
|
976
977
|
* @returns Array of registered types
|
|
977
978
|
*/
|
|
978
979
|
getRegisteredTypes() {
|
|
979
|
-
return
|
|
980
|
+
return Ee(), Array.from(E.keys());
|
|
980
981
|
},
|
|
981
982
|
/**
|
|
982
983
|
* Clear all registered adapters.
|
|
@@ -984,9 +985,9 @@ const L = {
|
|
|
984
985
|
* Note: Built-in adapters will be re-initialized on next access.
|
|
985
986
|
*/
|
|
986
987
|
clear() {
|
|
987
|
-
E.clear(),
|
|
988
|
+
E.clear(), _e = !1;
|
|
988
989
|
}
|
|
989
|
-
},
|
|
990
|
+
}, Dt = () => ({
|
|
990
991
|
analysisType: "query",
|
|
991
992
|
// Use adapter defaults as single source of truth for chart configuration
|
|
992
993
|
charts: {
|
|
@@ -1004,8 +1005,8 @@ const L = {
|
|
|
1004
1005
|
},
|
|
1005
1006
|
userManuallySelectedChart: !1,
|
|
1006
1007
|
localPaletteName: "default"
|
|
1007
|
-
}),
|
|
1008
|
-
...
|
|
1008
|
+
}), Dr = (t, i) => ({
|
|
1009
|
+
...Dt(),
|
|
1009
1010
|
setAnalysisType: (e) => {
|
|
1010
1011
|
t((n) => {
|
|
1011
1012
|
const r = { ...n.charts };
|
|
@@ -1224,12 +1225,12 @@ const L = {
|
|
|
1224
1225
|
...m
|
|
1225
1226
|
});
|
|
1226
1227
|
}
|
|
1227
|
-
}),
|
|
1228
|
+
}), Le = () => ({
|
|
1228
1229
|
queryStates: [R()],
|
|
1229
1230
|
activeQueryIndex: 0,
|
|
1230
1231
|
mergeStrategy: "concat"
|
|
1231
|
-
}),
|
|
1232
|
-
...
|
|
1232
|
+
}), Tr = (t, i) => ({
|
|
1233
|
+
...Le(),
|
|
1233
1234
|
// ==========================================================================
|
|
1234
1235
|
// Query State Management
|
|
1235
1236
|
// ==========================================================================
|
|
@@ -1390,7 +1391,7 @@ const L = {
|
|
|
1390
1391
|
member: y.field,
|
|
1391
1392
|
operator: "inDateRange",
|
|
1392
1393
|
values: [],
|
|
1393
|
-
dateRange:
|
|
1394
|
+
dateRange: zn("last_n_months", 3)
|
|
1394
1395
|
};
|
|
1395
1396
|
f[m] = {
|
|
1396
1397
|
...f[m],
|
|
@@ -1499,7 +1500,7 @@ const L = {
|
|
|
1499
1500
|
queryLabels: r.map((s, o) => `Q${o + 1}`)
|
|
1500
1501
|
};
|
|
1501
1502
|
}
|
|
1502
|
-
}),
|
|
1503
|
+
}), Ke = () => ({
|
|
1503
1504
|
funnelCube: null,
|
|
1504
1505
|
funnelSteps: [],
|
|
1505
1506
|
activeFunnelStepIndex: 0,
|
|
@@ -1507,8 +1508,8 @@ const L = {
|
|
|
1507
1508
|
funnelBindingKey: null,
|
|
1508
1509
|
stepTimeToConvert: []
|
|
1509
1510
|
// Deprecated - kept for backward compat
|
|
1510
|
-
}),
|
|
1511
|
-
...
|
|
1511
|
+
}), Fr = (t, i) => ({
|
|
1512
|
+
...Ke(),
|
|
1512
1513
|
addFunnelStep: () => t((e) => {
|
|
1513
1514
|
const n = e.funnelSteps[e.funnelSteps.length - 1], r = {
|
|
1514
1515
|
id: $(),
|
|
@@ -1587,7 +1588,7 @@ const L = {
|
|
|
1587
1588
|
const e = i();
|
|
1588
1589
|
return e.analysisType !== "funnel" || !e.funnelBindingKey || !e.funnelTimeDimension || e.funnelSteps.length < 2 ? !1 : e.funnelSteps.filter((r) => r.cube && r.name).length >= 2;
|
|
1589
1590
|
}
|
|
1590
|
-
}),
|
|
1591
|
+
}), $e = () => ({
|
|
1591
1592
|
flowCube: null,
|
|
1592
1593
|
flowBindingKey: null,
|
|
1593
1594
|
flowTimeDimension: null,
|
|
@@ -1599,8 +1600,8 @@ const L = {
|
|
|
1599
1600
|
stepsAfter: 3,
|
|
1600
1601
|
eventDimension: null,
|
|
1601
1602
|
joinStrategy: "auto"
|
|
1602
|
-
}),
|
|
1603
|
-
|
|
1603
|
+
}), Ar = (t, i) => ({
|
|
1604
|
+
...$e(),
|
|
1604
1605
|
setFlowCube: (e) => t(() => ({
|
|
1605
1606
|
flowCube: e,
|
|
1606
1607
|
// Clear binding key and time dimension since they may not exist in new cube
|
|
@@ -1650,10 +1651,10 @@ const L = {
|
|
|
1650
1651
|
};
|
|
1651
1652
|
}),
|
|
1652
1653
|
setStepsBefore: (e) => t({
|
|
1653
|
-
stepsBefore: Math.max(
|
|
1654
|
+
stepsBefore: Math.max(at, Math.min(ot, e))
|
|
1654
1655
|
}),
|
|
1655
1656
|
setStepsAfter: (e) => t({
|
|
1656
|
-
stepsAfter: Math.max(
|
|
1657
|
+
stepsAfter: Math.max(at, Math.min(ot, e))
|
|
1657
1658
|
}),
|
|
1658
1659
|
setJoinStrategy: (e) => t(() => ({
|
|
1659
1660
|
joinStrategy: e
|
|
@@ -1693,10 +1694,10 @@ const L = {
|
|
|
1693
1694
|
}
|
|
1694
1695
|
};
|
|
1695
1696
|
}
|
|
1696
|
-
}),
|
|
1697
|
-
...
|
|
1698
|
-
}),
|
|
1699
|
-
|
|
1697
|
+
}), Ge = () => ({
|
|
1698
|
+
..._n
|
|
1699
|
+
}), Qr = (t, i) => ({
|
|
1700
|
+
...Ge(),
|
|
1700
1701
|
setRetentionCube: (e) => t(() => ({
|
|
1701
1702
|
retentionCube: e,
|
|
1702
1703
|
// Clear related fields when cube changes
|
|
@@ -1745,8 +1746,8 @@ const L = {
|
|
|
1745
1746
|
setRetentionViewGranularity: (e) => t({ retentionViewGranularity: e }),
|
|
1746
1747
|
setRetentionPeriods: (e) => t({
|
|
1747
1748
|
retentionPeriods: Math.max(
|
|
1748
|
-
|
|
1749
|
-
Math.min(
|
|
1749
|
+
Ln,
|
|
1750
|
+
Math.min(Kn, e)
|
|
1750
1751
|
)
|
|
1751
1752
|
}),
|
|
1752
1753
|
setRetentionType: (e) => t({ retentionType: e }),
|
|
@@ -1796,22 +1797,22 @@ const L = {
|
|
|
1796
1797
|
warnings: r
|
|
1797
1798
|
};
|
|
1798
1799
|
}
|
|
1799
|
-
}),
|
|
1800
|
+
}), Tt = {
|
|
1800
1801
|
isOpen: !1,
|
|
1801
1802
|
userPrompt: "",
|
|
1802
1803
|
isGenerating: !1,
|
|
1803
1804
|
error: null,
|
|
1804
1805
|
hasGeneratedQuery: !1,
|
|
1805
1806
|
previousState: null
|
|
1806
|
-
},
|
|
1807
|
+
}, Mr = () => ({
|
|
1807
1808
|
activeTab: "query",
|
|
1808
1809
|
activeView: "chart",
|
|
1809
1810
|
displayLimit: 100,
|
|
1810
1811
|
showFieldModal: !1,
|
|
1811
1812
|
fieldModalMode: "metrics",
|
|
1812
|
-
aiState:
|
|
1813
|
-
}),
|
|
1814
|
-
...
|
|
1813
|
+
aiState: Tt
|
|
1814
|
+
}), Rr = (t, i) => ({
|
|
1815
|
+
...Mr(),
|
|
1815
1816
|
// ==========================================================================
|
|
1816
1817
|
// Tab/View Actions
|
|
1817
1818
|
// ==========================================================================
|
|
@@ -1890,11 +1891,11 @@ const L = {
|
|
|
1890
1891
|
displayConfig: n.displayConfig
|
|
1891
1892
|
}
|
|
1892
1893
|
},
|
|
1893
|
-
aiState: { ...
|
|
1894
|
+
aiState: { ...Tt }
|
|
1894
1895
|
};
|
|
1895
1896
|
})
|
|
1896
1897
|
});
|
|
1897
|
-
function
|
|
1898
|
+
function ut(t) {
|
|
1898
1899
|
const i = t.filters ? [...t.filters] : [], e = t.timeDimensions || [], n = [
|
|
1899
1900
|
...(t.dimensions || []).map((s) => ({
|
|
1900
1901
|
id: $(),
|
|
@@ -1943,10 +1944,10 @@ function dt(t) {
|
|
|
1943
1944
|
order: t.order
|
|
1944
1945
|
};
|
|
1945
1946
|
}
|
|
1946
|
-
function
|
|
1947
|
+
function kr(t) {
|
|
1947
1948
|
return "queries" in t && Array.isArray(t.queries);
|
|
1948
1949
|
}
|
|
1949
|
-
function
|
|
1950
|
+
function Ir(t) {
|
|
1950
1951
|
if (t.initialAnalysisType === "funnel" && t.initialFunnelState) {
|
|
1951
1952
|
const i = W.getDefaultChartConfig(), e = {
|
|
1952
1953
|
chartType: t.initialChartConfig?.chartType || i.chartType,
|
|
@@ -1991,7 +1992,7 @@ function qr(t) {
|
|
|
1991
1992
|
chartType: t.initialChartConfig?.chartType || i.chartType,
|
|
1992
1993
|
chartConfig: t.initialChartConfig?.chartConfig || i.chartConfig,
|
|
1993
1994
|
displayConfig: t.initialChartConfig?.displayConfig || i.displayConfig
|
|
1994
|
-
}, n =
|
|
1995
|
+
}, n = $n(Gn), r = {
|
|
1995
1996
|
retentionCube: t.initialRetentionState.retentionCube ?? null,
|
|
1996
1997
|
retentionBindingKey: t.initialRetentionState.retentionBindingKey ?? null,
|
|
1997
1998
|
retentionTimeDimension: t.initialRetentionState.retentionTimeDimension ?? null,
|
|
@@ -2012,7 +2013,7 @@ function qr(t) {
|
|
|
2012
2013
|
if (t.initialQuery) {
|
|
2013
2014
|
const i = t.initialQuery;
|
|
2014
2015
|
let e, n = "concat";
|
|
2015
|
-
|
|
2016
|
+
kr(i) ? (e = i.queries.map(ut), i.mergeStrategy && (n = i.mergeStrategy)) : e = [ut(i)];
|
|
2016
2017
|
const r = K.getDefaultChartConfig(), s = {
|
|
2017
2018
|
chartType: t.initialChartConfig?.chartType || r.chartType,
|
|
2018
2019
|
chartConfig: t.initialChartConfig?.chartConfig || r.chartConfig,
|
|
@@ -2042,15 +2043,15 @@ function qr(t) {
|
|
|
2042
2043
|
t.initialActiveView
|
|
2043
2044
|
) : null;
|
|
2044
2045
|
}
|
|
2045
|
-
function
|
|
2046
|
+
function qr(t, i) {
|
|
2046
2047
|
return {
|
|
2047
2048
|
reset: () => {
|
|
2048
2049
|
t({
|
|
2049
|
-
...
|
|
2050
|
-
..._e(),
|
|
2050
|
+
...Dt(),
|
|
2051
2051
|
...Le(),
|
|
2052
2052
|
...Ke(),
|
|
2053
2053
|
...$e(),
|
|
2054
|
+
...Ge(),
|
|
2054
2055
|
// Apply adapter defaults for charts (may differ from slice defaults)
|
|
2055
2056
|
charts: {
|
|
2056
2057
|
query: K.getDefaultChartConfig(),
|
|
@@ -2070,7 +2071,7 @@ function Br(t, i) {
|
|
|
2070
2071
|
switch (e.analysisType) {
|
|
2071
2072
|
case "funnel":
|
|
2072
2073
|
return {
|
|
2073
|
-
...
|
|
2074
|
+
...Ke(),
|
|
2074
2075
|
charts: {
|
|
2075
2076
|
...e.charts,
|
|
2076
2077
|
funnel: W.getDefaultChartConfig()
|
|
@@ -2078,7 +2079,7 @@ function Br(t, i) {
|
|
|
2078
2079
|
};
|
|
2079
2080
|
case "flow":
|
|
2080
2081
|
return {
|
|
2081
|
-
|
|
2082
|
+
...$e(),
|
|
2082
2083
|
charts: {
|
|
2083
2084
|
...e.charts,
|
|
2084
2085
|
flow: J.getDefaultChartConfig()
|
|
@@ -2086,7 +2087,7 @@ function Br(t, i) {
|
|
|
2086
2087
|
};
|
|
2087
2088
|
case "retention":
|
|
2088
2089
|
return {
|
|
2089
|
-
|
|
2090
|
+
...Ge(),
|
|
2090
2091
|
charts: {
|
|
2091
2092
|
...e.charts,
|
|
2092
2093
|
retention: Y.getDefaultChartConfig()
|
|
@@ -2094,7 +2095,7 @@ function Br(t, i) {
|
|
|
2094
2095
|
};
|
|
2095
2096
|
default:
|
|
2096
2097
|
return {
|
|
2097
|
-
...
|
|
2098
|
+
...Le(),
|
|
2098
2099
|
userManuallySelectedChart: !1,
|
|
2099
2100
|
charts: {
|
|
2100
2101
|
...e.charts,
|
|
@@ -2120,37 +2121,37 @@ function Br(t, i) {
|
|
|
2120
2121
|
}
|
|
2121
2122
|
};
|
|
2122
2123
|
}
|
|
2123
|
-
function
|
|
2124
|
-
const i =
|
|
2124
|
+
function Br(t = {}) {
|
|
2125
|
+
const i = Ir(t), e = (n, r, s) => ({
|
|
2125
2126
|
// Compose slices - they provide default state and actions
|
|
2127
|
+
...Dr(n, r),
|
|
2126
2128
|
...Tr(n, r),
|
|
2127
2129
|
...Fr(n, r),
|
|
2128
2130
|
...Ar(n, r),
|
|
2129
2131
|
...Qr(n, r),
|
|
2130
|
-
...
|
|
2131
|
-
...kr(n),
|
|
2132
|
+
...Rr(n),
|
|
2132
2133
|
// Cross-slice actions
|
|
2133
|
-
...
|
|
2134
|
+
...qr(n, r)
|
|
2134
2135
|
});
|
|
2135
2136
|
if (t.disableLocalStorage) {
|
|
2136
|
-
const n =
|
|
2137
|
-
|
|
2137
|
+
const n = rt()(
|
|
2138
|
+
it(st(e), {
|
|
2138
2139
|
name: "AnalysisBuilderStore (no-persist)"
|
|
2139
2140
|
})
|
|
2140
2141
|
);
|
|
2141
2142
|
return i && n.getState().load(i), n;
|
|
2142
2143
|
}
|
|
2143
|
-
return
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
name:
|
|
2144
|
+
return rt()(
|
|
2145
|
+
it(
|
|
2146
|
+
st(
|
|
2147
|
+
Pn(e, {
|
|
2148
|
+
name: sr,
|
|
2148
2149
|
// Use workspace format to preserve ALL modes' state
|
|
2149
2150
|
partialize: (n) => n.saveWorkspace(),
|
|
2150
|
-
merge: (n, r) => n &&
|
|
2151
|
+
merge: (n, r) => n && On(n) ? {
|
|
2151
2152
|
...r,
|
|
2152
2153
|
_persistedWorkspace: n
|
|
2153
|
-
} : n &&
|
|
2154
|
+
} : n && ht(n) ? {
|
|
2154
2155
|
...r,
|
|
2155
2156
|
_persistedConfig: n
|
|
2156
2157
|
} : i ? {
|
|
@@ -2177,8 +2178,8 @@ function Nr(t = {}) {
|
|
|
2177
2178
|
)
|
|
2178
2179
|
);
|
|
2179
2180
|
}
|
|
2180
|
-
const
|
|
2181
|
-
function
|
|
2181
|
+
const We = In(null);
|
|
2182
|
+
function hi({
|
|
2182
2183
|
children: t,
|
|
2183
2184
|
initialQuery: i,
|
|
2184
2185
|
initialChartConfig: e,
|
|
@@ -2190,7 +2191,7 @@ function pi({
|
|
|
2190
2191
|
initialActiveView: d
|
|
2191
2192
|
}) {
|
|
2192
2193
|
const f = ae(null);
|
|
2193
|
-
return f.current || (f.current =
|
|
2194
|
+
return f.current || (f.current = Br({
|
|
2194
2195
|
initialQuery: i,
|
|
2195
2196
|
initialChartConfig: e,
|
|
2196
2197
|
disableLocalStorage: n,
|
|
@@ -2199,21 +2200,21 @@ function pi({
|
|
|
2199
2200
|
initialFlowState: o,
|
|
2200
2201
|
initialRetentionState: l,
|
|
2201
2202
|
initialActiveView: d
|
|
2202
|
-
})), /* @__PURE__ */ p(
|
|
2203
|
+
})), /* @__PURE__ */ p(We.Provider, { value: f.current, children: t });
|
|
2203
2204
|
}
|
|
2204
2205
|
function c(t) {
|
|
2205
|
-
const i =
|
|
2206
|
+
const i = yt(We);
|
|
2206
2207
|
if (!i)
|
|
2207
2208
|
throw new Error("useAnalysisBuilderStore must be used within AnalysisBuilderStoreProvider");
|
|
2208
|
-
return
|
|
2209
|
+
return En(i, t);
|
|
2209
2210
|
}
|
|
2210
|
-
function
|
|
2211
|
-
const t =
|
|
2211
|
+
function Nr() {
|
|
2212
|
+
const t = yt(We);
|
|
2212
2213
|
if (!t)
|
|
2213
2214
|
throw new Error("useAnalysisBuilderStoreApi must be used within AnalysisBuilderStoreProvider");
|
|
2214
2215
|
return t;
|
|
2215
2216
|
}
|
|
2216
|
-
const
|
|
2217
|
+
const Je = (t) => t.queryStates[t.activeQueryIndex] || R(), pi = (t) => Je(t).metrics, Ci = (t) => Je(t).breakdowns, wi = (t) => Je(t).filters, Vr = (t) => {
|
|
2217
2218
|
const i = t.charts[t.analysisType];
|
|
2218
2219
|
return i ? {
|
|
2219
2220
|
chartType: i.chartType,
|
|
@@ -2224,19 +2225,19 @@ const We = (t) => t.queryStates[t.activeQueryIndex] || R(), Ci = (t) => We(t).me
|
|
|
2224
2225
|
chartConfig: {},
|
|
2225
2226
|
displayConfig: { showLegend: !0, showGrid: !0, showTooltip: !0 }
|
|
2226
2227
|
};
|
|
2227
|
-
},
|
|
2228
|
+
}, bi = (t) => ({
|
|
2228
2229
|
activeTab: t.activeTab,
|
|
2229
2230
|
activeView: t.activeView,
|
|
2230
2231
|
displayLimit: t.displayLimit,
|
|
2231
2232
|
showFieldModal: t.showFieldModal,
|
|
2232
2233
|
fieldModalMode: t.fieldModalMode
|
|
2233
|
-
}),
|
|
2234
|
+
}), Si = (t) => ({
|
|
2234
2235
|
queryStates: t.queryStates,
|
|
2235
2236
|
activeQueryIndex: t.activeQueryIndex,
|
|
2236
2237
|
mergeStrategy: t.mergeStrategy,
|
|
2237
2238
|
// Multi-query mode is when we have more than one query in 'query' analysis type
|
|
2238
2239
|
isMultiQueryMode: t.analysisType === "query" && t.queryStates.length > 1
|
|
2239
|
-
}),
|
|
2240
|
+
}), vi = (t) => ({
|
|
2240
2241
|
funnelCube: t.funnelCube,
|
|
2241
2242
|
funnelSteps: t.funnelSteps,
|
|
2242
2243
|
activeFunnelStepIndex: t.activeFunnelStepIndex,
|
|
@@ -2246,16 +2247,16 @@ const We = (t) => t.queryStates[t.activeQueryIndex] || R(), Ci = (t) => We(t).me
|
|
|
2246
2247
|
// Deprecated field kept for backward compat
|
|
2247
2248
|
stepTimeToConvert: t.stepTimeToConvert
|
|
2248
2249
|
});
|
|
2249
|
-
function
|
|
2250
|
+
function ft(t) {
|
|
2250
2251
|
return t.timeDimensions || [];
|
|
2251
2252
|
}
|
|
2252
|
-
function
|
|
2253
|
+
function Er(t) {
|
|
2253
2254
|
const i = [];
|
|
2254
2255
|
if (t.length < 2) return i;
|
|
2255
|
-
const e =
|
|
2256
|
+
const e = ft(t[0]);
|
|
2256
2257
|
if (e.length === 0) return i;
|
|
2257
2258
|
for (let n = 1; n < t.length; n++) {
|
|
2258
|
-
const r =
|
|
2259
|
+
const r = ft(t[n]);
|
|
2259
2260
|
if (r.length === 0 && e.length > 0) {
|
|
2260
2261
|
i.push({
|
|
2261
2262
|
type: "missing_time_dimension",
|
|
@@ -2281,7 +2282,7 @@ function Pr(t) {
|
|
|
2281
2282
|
}
|
|
2282
2283
|
return i;
|
|
2283
2284
|
}
|
|
2284
|
-
function
|
|
2285
|
+
function Pr(t, i) {
|
|
2285
2286
|
const e = [];
|
|
2286
2287
|
if (t.length < 2 || i.length === 0) return e;
|
|
2287
2288
|
for (let n = 0; n < t.length; n++) {
|
|
@@ -2299,7 +2300,7 @@ function Ur(t, i) {
|
|
|
2299
2300
|
}
|
|
2300
2301
|
return e;
|
|
2301
2302
|
}
|
|
2302
|
-
function
|
|
2303
|
+
function Ur(t) {
|
|
2303
2304
|
const i = [];
|
|
2304
2305
|
if (t.length < 2) return i;
|
|
2305
2306
|
const e = /* @__PURE__ */ new Map();
|
|
@@ -2318,7 +2319,7 @@ function _r(t) {
|
|
|
2318
2319
|
affectedMeasures: n
|
|
2319
2320
|
}), i;
|
|
2320
2321
|
}
|
|
2321
|
-
function
|
|
2322
|
+
function _r(t) {
|
|
2322
2323
|
const i = [];
|
|
2323
2324
|
if (t.length < 2) return i;
|
|
2324
2325
|
const e = t.map((r) => r.timeDimensions?.[0]?.dateRange);
|
|
@@ -2328,26 +2329,26 @@ function Lr(t) {
|
|
|
2328
2329
|
message: "Queries have different date ranges - some data points may be missing in merged results"
|
|
2329
2330
|
}), i;
|
|
2330
2331
|
}
|
|
2331
|
-
function
|
|
2332
|
+
function Lr(t, i, e = []) {
|
|
2332
2333
|
const n = [], r = [];
|
|
2333
|
-
return t.length < 2 ? { isValid: !0, errors: n, warnings: r } : (r.push(...
|
|
2334
|
+
return t.length < 2 ? { isValid: !0, errors: n, warnings: r } : (r.push(...Ur(t)), r.push(..._r(t)), i === "merge" && (n.push(...Er(t)), e.length > 0 && n.push(...Pr(t, e))), {
|
|
2334
2335
|
isValid: n.length === 0,
|
|
2335
2336
|
errors: n,
|
|
2336
2337
|
warnings: r
|
|
2337
2338
|
});
|
|
2338
2339
|
}
|
|
2339
|
-
function
|
|
2340
|
+
function xi(t) {
|
|
2340
2341
|
return t.filter(
|
|
2341
2342
|
(i) => (i.measures?.length || 0) + (i.dimensions?.length || 0) + (i.timeDimensions?.length || 0) > 0
|
|
2342
2343
|
).length >= 2;
|
|
2343
2344
|
}
|
|
2344
|
-
function
|
|
2345
|
+
function Di(t) {
|
|
2345
2346
|
if (t.isValid && t.warnings.length === 0)
|
|
2346
2347
|
return "Configuration is valid";
|
|
2347
2348
|
const i = [];
|
|
2348
2349
|
return t.errors.length > 0 && i.push(`${t.errors.length} error${t.errors.length > 1 ? "s" : ""}`), t.warnings.length > 0 && i.push(`${t.warnings.length} warning${t.warnings.length > 1 ? "s" : ""}`), i.join(", ");
|
|
2349
2350
|
}
|
|
2350
|
-
function
|
|
2351
|
+
function Kr() {
|
|
2351
2352
|
const t = c((h) => h.queryStates), i = c((h) => h.activeQueryIndex), e = c((h) => h.mergeStrategy), n = c((h) => h.setActiveQueryIndex), r = c((h) => h.setMergeStrategy), s = c((h) => h.addQuery), o = c((h) => h.removeQuery), l = c((h) => h.getCurrentState), d = c((h) => h.getMergeKeys), f = c((h) => h.isMultiQueryMode), m = l(), y = f(), u = d(), g = A(() => {
|
|
2352
2353
|
const h = t[i] || m;
|
|
2353
2354
|
return be(h.metrics, h.breakdowns, h.filters, h.order);
|
|
@@ -2366,7 +2367,7 @@ function $r() {
|
|
|
2366
2367
|
mergeKeys: u,
|
|
2367
2368
|
queryLabels: h.map((x, B) => `Q${B + 1}`)
|
|
2368
2369
|
};
|
|
2369
|
-
}, [S, t.length, e, u]), D = A(() => y ?
|
|
2370
|
+
}, [S, t.length, e, u]), D = A(() => y ? Lr(S, e, u || []) : null, [y, S, e, u]), v = A(() => g.measures && g.measures.length > 0 || g.dimensions && g.dimensions.length > 0 || g.timeDimensions && g.timeDimensions.length > 0, [g]);
|
|
2370
2371
|
return {
|
|
2371
2372
|
queryState: m,
|
|
2372
2373
|
queryStates: t,
|
|
@@ -2386,7 +2387,7 @@ function $r() {
|
|
|
2386
2387
|
removeQuery: o
|
|
2387
2388
|
};
|
|
2388
2389
|
}
|
|
2389
|
-
function
|
|
2390
|
+
function $r(t) {
|
|
2390
2391
|
const { queryState: i, queryStates: e, isMultiQueryMode: n, mergeStrategy: r, activeQueryIndex: s } = t, o = A(() => {
|
|
2391
2392
|
if (!n) return i.metrics;
|
|
2392
2393
|
const f = /* @__PURE__ */ new Set(), m = [];
|
|
@@ -2415,7 +2416,7 @@ function Gr(t) {
|
|
|
2415
2416
|
effectiveBreakdowns: d
|
|
2416
2417
|
};
|
|
2417
2418
|
}
|
|
2418
|
-
function
|
|
2419
|
+
function Gr(t) {
|
|
2419
2420
|
const {
|
|
2420
2421
|
currentQuery: i,
|
|
2421
2422
|
allQueries: e,
|
|
@@ -2431,35 +2432,35 @@ function Hr(t) {
|
|
|
2431
2432
|
serverFlowQuery: y,
|
|
2432
2433
|
serverRetentionQuery: u,
|
|
2433
2434
|
retentionValidation: g
|
|
2434
|
-
} = t, { getFieldLabel: S } =
|
|
2435
|
+
} = t, { getFieldLabel: S } = Nn(), w = f === "funnel" || d, D = f === "flow", v = f === "retention", h = f === "query" && r, x = f === "query" && !r, B = f === "funnel" && !!m, _ = A(() => B || !w || !l || e.length < 2 ? null : er(e, l), [B, w, l, e]), Q = Wn(i, {
|
|
2435
2436
|
skip: !s || !x,
|
|
2436
2437
|
debounceMs: 300
|
|
2437
|
-
}), M =
|
|
2438
|
+
}), M = Jn(n, {
|
|
2438
2439
|
skip: !n || !h,
|
|
2439
2440
|
debounceMs: 300
|
|
2440
|
-
}), T =
|
|
2441
|
+
}), T = Yn(_, {
|
|
2441
2442
|
skip: !w || !_ && !m,
|
|
2442
2443
|
debounceMs: 300,
|
|
2443
2444
|
prebuiltServerQuery: B ? m : void 0
|
|
2444
|
-
}), C =
|
|
2445
|
+
}), C = Xn(y ?? null, {
|
|
2445
2446
|
skip: !D || !y,
|
|
2446
2447
|
debounceMs: 300
|
|
2447
|
-
}), F =
|
|
2448
|
+
}), F = Zn(u ?? null, {
|
|
2448
2449
|
skip: !v || !u,
|
|
2449
2450
|
debounceMs: 300,
|
|
2450
2451
|
getFieldLabel: S
|
|
2451
2452
|
// Pass label resolver for human-readable binding key display
|
|
2452
|
-
}), P =
|
|
2453
|
+
}), P = tr({
|
|
2453
2454
|
queries: r ? e : [i],
|
|
2454
2455
|
isMultiQueryMode: r,
|
|
2455
2456
|
skip: !s || w || D || v
|
|
2456
|
-
}), X =
|
|
2457
|
+
}), X = Ne(
|
|
2457
2458
|
T.serverQuery,
|
|
2458
2459
|
{ skip: !w || !T.serverQuery }
|
|
2459
|
-
), ve =
|
|
2460
|
+
), ve = Ne(
|
|
2460
2461
|
C.serverQuery,
|
|
2461
2462
|
{ skip: !D || !C.serverQuery }
|
|
2462
|
-
), oe =
|
|
2463
|
+
), oe = Ne(
|
|
2463
2464
|
u,
|
|
2464
2465
|
{ skip: !v || !u }
|
|
2465
2466
|
), H = v ? F.isLoading || F.isDebouncing : D ? C.isLoading || C.isDebouncing : w ? T.isExecuting || T.isDebouncing : h ? M.isLoading : Q.isLoading, z = v ? F.isFetching : D ? C.isFetching : w ? T.isExecuting : h ? M.isFetching : Q.isFetching, O = v ? F.error : D ? C.error : w ? T.error : h ? M.error : Q.error, Z = !!(Q.debouncedQuery || M.debouncedConfig || !T.isDebouncing || // Funnel has debounced when not debouncing
|
|
@@ -2503,14 +2504,14 @@ function Hr(t) {
|
|
|
2503
2504
|
warnings: Fe
|
|
2504
2505
|
};
|
|
2505
2506
|
}
|
|
2506
|
-
function
|
|
2507
|
-
const { externalColorPalette: i, combinedMetrics: e, combinedBreakdowns: n, hasDebounced: r } = t, s = c((C) => C.analysisType), { chartType: o, chartConfig: l, displayConfig: d } = c(
|
|
2507
|
+
function Hr(t) {
|
|
2508
|
+
const { externalColorPalette: i, combinedMetrics: e, combinedBreakdowns: n, hasDebounced: r } = t, s = c((C) => C.analysisType), { chartType: o, chartConfig: l, displayConfig: d } = c(Un(Vr)), f = c((C) => C.userManuallySelectedChart), m = c((C) => C.localPaletteName), y = c((C) => C.setChartTypeManual), u = c((C) => C.setChartConfig), g = c((C) => C.setDisplayConfig), S = c((C) => C.setFunnelChartType), w = c((C) => C.setFunnelChartConfig), D = c((C) => C.setFunnelDisplayConfig), v = c((C) => C.setLocalPaletteName), h = c((C) => C.setUserManuallySelectedChart), x = U(
|
|
2508
2509
|
(C) => {
|
|
2509
2510
|
if (s === "funnel")
|
|
2510
2511
|
S(C);
|
|
2511
2512
|
else {
|
|
2512
2513
|
y(C);
|
|
2513
|
-
const { chartConfig: F } =
|
|
2514
|
+
const { chartConfig: F } = Ve(
|
|
2514
2515
|
e,
|
|
2515
2516
|
n,
|
|
2516
2517
|
C
|
|
@@ -2537,14 +2538,14 @@ function Or(t) {
|
|
|
2537
2538
|
},
|
|
2538
2539
|
[s, D, g]
|
|
2539
2540
|
), Q = A(
|
|
2540
|
-
() =>
|
|
2541
|
+
() => lr(e, n),
|
|
2541
2542
|
[e, n]
|
|
2542
2543
|
), M = A(() => i ? Array.isArray(i) && typeof i[0] == "string" ? {
|
|
2543
2544
|
name: "custom",
|
|
2544
2545
|
label: "Custom",
|
|
2545
2546
|
colors: i,
|
|
2546
2547
|
gradient: i
|
|
2547
|
-
} : i :
|
|
2548
|
+
} : i : jn(m), [i, m]), T = ae("");
|
|
2548
2549
|
return se(() => {
|
|
2549
2550
|
if (!r || e.length === 0 && n.length === 0) return;
|
|
2550
2551
|
const C = JSON.stringify({
|
|
@@ -2553,21 +2554,21 @@ function Or(t) {
|
|
|
2553
2554
|
});
|
|
2554
2555
|
if (C === T.current) return;
|
|
2555
2556
|
T.current = C;
|
|
2556
|
-
const F =
|
|
2557
|
+
const F = dr(
|
|
2557
2558
|
e,
|
|
2558
2559
|
n,
|
|
2559
2560
|
o,
|
|
2560
2561
|
f
|
|
2561
2562
|
);
|
|
2562
2563
|
if (F) {
|
|
2563
|
-
const { chartConfig: P } =
|
|
2564
|
+
const { chartConfig: P } = Ve(
|
|
2564
2565
|
e,
|
|
2565
2566
|
n,
|
|
2566
2567
|
F
|
|
2567
2568
|
);
|
|
2568
2569
|
x(F), B(P), h(!1);
|
|
2569
2570
|
} else if ((e.length > 0 || n.length > 0) && !l.xAxis?.length && !l.yAxis?.length && !l.series?.length) {
|
|
2570
|
-
const { chartConfig: X } =
|
|
2571
|
+
const { chartConfig: X } = Ve(
|
|
2571
2572
|
e,
|
|
2572
2573
|
n,
|
|
2573
2574
|
o
|
|
@@ -2599,7 +2600,7 @@ function Or(t) {
|
|
|
2599
2600
|
setLocalPaletteName: v
|
|
2600
2601
|
};
|
|
2601
2602
|
}
|
|
2602
|
-
function
|
|
2603
|
+
function Or() {
|
|
2603
2604
|
const t = c((u) => u.activeTab), i = c((u) => u.activeView), e = c((u) => u.displayLimit), n = c((u) => u.showFieldModal), r = c((u) => u.fieldModalMode), s = c((u) => u.userManuallySelectedChart), o = c((u) => u.setActiveTab), l = c((u) => u.setActiveView), d = c((u) => u.setDisplayLimit), f = c((u) => u.closeFieldModal), [m, y] = Ce(0);
|
|
2604
2605
|
return {
|
|
2605
2606
|
// State
|
|
@@ -2618,31 +2619,31 @@ function jr() {
|
|
|
2618
2619
|
setActiveTableIndex: y
|
|
2619
2620
|
};
|
|
2620
2621
|
}
|
|
2621
|
-
const Se = 1800,
|
|
2622
|
-
function
|
|
2622
|
+
const Se = 1800, He = "share=";
|
|
2623
|
+
function Oe(t) {
|
|
2623
2624
|
const i = JSON.stringify(t);
|
|
2624
|
-
return
|
|
2625
|
+
return gt.compressToEncodedURIComponent(i);
|
|
2625
2626
|
}
|
|
2626
|
-
function
|
|
2627
|
+
function jr(t) {
|
|
2627
2628
|
try {
|
|
2628
|
-
const i =
|
|
2629
|
+
const i = gt.decompressFromEncodedURIComponent(t);
|
|
2629
2630
|
if (!i) return null;
|
|
2630
2631
|
const e = JSON.parse(i);
|
|
2631
|
-
return
|
|
2632
|
+
return ht(e) ? e : (console.warn("[shareUtils] Invalid AnalysisConfig in share URL"), null);
|
|
2632
2633
|
} catch {
|
|
2633
2634
|
return null;
|
|
2634
2635
|
}
|
|
2635
2636
|
}
|
|
2636
|
-
function
|
|
2637
|
-
const i =
|
|
2637
|
+
function Ti(t) {
|
|
2638
|
+
const i = Oe(t);
|
|
2638
2639
|
return {
|
|
2639
2640
|
ok: i.length <= Se,
|
|
2640
2641
|
size: i.length,
|
|
2641
2642
|
maxSize: Se
|
|
2642
2643
|
};
|
|
2643
2644
|
}
|
|
2644
|
-
function
|
|
2645
|
-
const i =
|
|
2645
|
+
function zr(t) {
|
|
2646
|
+
const i = Oe(t);
|
|
2646
2647
|
if (i.length <= Se)
|
|
2647
2648
|
return { encoded: i, queryOnly: !1 };
|
|
2648
2649
|
const e = {
|
|
@@ -2652,28 +2653,28 @@ function Wr(t) {
|
|
|
2652
2653
|
charts: {},
|
|
2653
2654
|
// Drop chart config to save space
|
|
2654
2655
|
query: t.query
|
|
2655
|
-
}, n =
|
|
2656
|
+
}, n = Oe(e);
|
|
2656
2657
|
return n.length <= Se ? { encoded: n, queryOnly: !0 } : { encoded: null, queryOnly: !0 };
|
|
2657
2658
|
}
|
|
2658
|
-
function
|
|
2659
|
-
const { encoded: i } =
|
|
2660
|
-
return i ? `${window.location.origin}${window.location.pathname}#${
|
|
2659
|
+
function Fi(t) {
|
|
2660
|
+
const { encoded: i } = zr(t);
|
|
2661
|
+
return i ? `${window.location.origin}${window.location.pathname}#${He}${i}` : null;
|
|
2661
2662
|
}
|
|
2662
|
-
function
|
|
2663
|
+
function Wr() {
|
|
2663
2664
|
if (typeof window > "u") return null;
|
|
2664
2665
|
const t = window.location.hash;
|
|
2665
|
-
return !t || !t.startsWith(`#${
|
|
2666
|
+
return !t || !t.startsWith(`#${He}`) ? null : t.slice(He.length + 1);
|
|
2666
2667
|
}
|
|
2667
|
-
function
|
|
2668
|
+
function Jr() {
|
|
2668
2669
|
if (typeof window > "u") return;
|
|
2669
2670
|
const t = new URL(window.location.href);
|
|
2670
2671
|
t.hash = "", window.history.replaceState(null, "", t.toString());
|
|
2671
2672
|
}
|
|
2672
|
-
function
|
|
2673
|
-
const t =
|
|
2674
|
-
return t ?
|
|
2673
|
+
function Yr() {
|
|
2674
|
+
const t = Wr();
|
|
2675
|
+
return t ? jr(t) : null;
|
|
2675
2676
|
}
|
|
2676
|
-
function
|
|
2677
|
+
function Xr(t) {
|
|
2677
2678
|
const {
|
|
2678
2679
|
currentQuery: i,
|
|
2679
2680
|
isValidQuery: e,
|
|
@@ -2686,8 +2687,8 @@ function Zr(t) {
|
|
|
2686
2687
|
se(() => {
|
|
2687
2688
|
if (f.current) return;
|
|
2688
2689
|
f.current = !0;
|
|
2689
|
-
const m =
|
|
2690
|
-
m && (d(m),
|
|
2690
|
+
const m = Yr();
|
|
2691
|
+
m && (d(m), Jr());
|
|
2691
2692
|
}, [d]), se(() => {
|
|
2692
2693
|
o && e && o(i);
|
|
2693
2694
|
}, [i, e, o]), se(() => {
|
|
@@ -2698,8 +2699,8 @@ function Zr(t) {
|
|
|
2698
2699
|
});
|
|
2699
2700
|
}, [n, r, s, l]);
|
|
2700
2701
|
}
|
|
2701
|
-
function
|
|
2702
|
-
const { initialData: i, externalColorPalette: e, onQueryChange: n, onChartConfigChange: r } = t, { features: s } =
|
|
2702
|
+
function Ai(t = {}) {
|
|
2703
|
+
const { initialData: i, externalColorPalette: e, onQueryChange: n, onChartConfigChange: r } = t, { features: s } = Vn(), o = Nr(), l = Kr(), d = $r({
|
|
2703
2704
|
queryState: l.queryState,
|
|
2704
2705
|
queryStates: l.queryStates,
|
|
2705
2706
|
isMultiQueryMode: l.isMultiQueryMode,
|
|
@@ -2708,7 +2709,7 @@ function Qi(t = {}) {
|
|
|
2708
2709
|
}), f = c((a) => a.funnelBindingKey), m = c((a) => a.analysisType), y = c((a) => a.funnelCube), u = c((a) => a.funnelSteps), g = c((a) => a.activeFunnelStepIndex), S = c((a) => a.funnelTimeDimension), w = A(() => m !== "funnel" || !f?.dimension || !S || !u || u.length < 2 ? !1 : u.every((a) => a.filters.length > 0), [m, f, S, u]), D = c((a) => a.charts.funnel?.chartType) || "funnel", v = c((a) => a.charts.funnel?.chartConfig), h = A(() => v || {}, [v]), x = c((a) => a.flowCube), B = c((a) => a.flowBindingKey), _ = c((a) => a.flowTimeDimension), Q = c((a) => a.eventDimension), M = c((a) => a.startingStep), T = c((a) => a.stepsBefore), C = c((a) => a.stepsAfter), F = c((a) => a.joinStrategy), P = c((a) => a.charts.flow?.displayConfig), X = A(
|
|
2709
2710
|
() => P || { showLegend: !0, showGrid: !0, showTooltip: !0 },
|
|
2710
2711
|
[P]
|
|
2711
|
-
), ve = c((a) => a.charts.flow?.chartType) || "sankey", oe = c((a) => a.buildFunnelQueryFromSteps), H = A(() => m !== "funnel" ? null : oe(), [m, oe, u]), z = c((a) => a.buildFlowQuery), O = A(() => m !== "flow" ? null : z(), [m, z, x, B, _, Q, M, T, C, ve, F]), Z = c((a) => a.retentionCube), ee = c((a) => a.retentionBindingKey), te = c((a) => a.retentionTimeDimension), ne = c((a) => a.retentionDateRange), le = c((a) => a.retentionCohortFilters), ce = c((a) => a.retentionActivityFilters), de = c((a) => a.retentionBreakdowns), ue = c((a) => a.retentionViewGranularity), fe = c((a) => a.retentionPeriods), me = c((a) => a.retentionType), ye = c((a) => a.buildRetentionQuery), ge = c((a) => a.getRetentionValidation), xe = c((a) => a.charts.retention?.displayConfig), De = c((a) => a.setRetentionCube), Te = c((a) => a.setRetentionBindingKey), Fe = c((a) => a.setRetentionTimeDimension), k = c((a) => a.setRetentionDateRange),
|
|
2712
|
+
), ve = c((a) => a.charts.flow?.chartType) || "sankey", oe = c((a) => a.buildFunnelQueryFromSteps), H = A(() => m !== "funnel" ? null : oe(), [m, oe, u]), z = c((a) => a.buildFlowQuery), O = A(() => m !== "flow" ? null : z(), [m, z, x, B, _, Q, M, T, C, ve, F]), Z = c((a) => a.retentionCube), ee = c((a) => a.retentionBindingKey), te = c((a) => a.retentionTimeDimension), ne = c((a) => a.retentionDateRange), le = c((a) => a.retentionCohortFilters), ce = c((a) => a.retentionActivityFilters), de = c((a) => a.retentionBreakdowns), ue = c((a) => a.retentionViewGranularity), fe = c((a) => a.retentionPeriods), me = c((a) => a.retentionType), ye = c((a) => a.buildRetentionQuery), ge = c((a) => a.getRetentionValidation), xe = c((a) => a.charts.retention?.displayConfig), De = c((a) => a.setRetentionCube), Te = c((a) => a.setRetentionBindingKey), Fe = c((a) => a.setRetentionTimeDimension), k = c((a) => a.setRetentionDateRange), Ft = c((a) => a.setRetentionCohortFilters), At = c((a) => a.setRetentionActivityFilters), Qt = c((a) => a.setRetentionBreakdowns), Ae = c((a) => a.addRetentionBreakdown), Mt = c((a) => a.removeRetentionBreakdown), Rt = c((a) => a.setRetentionViewGranularity), kt = c((a) => a.setRetentionPeriods), It = c((a) => a.setRetentionType), Qe = A(() => m !== "retention" ? null : ye(), [
|
|
2712
2713
|
m,
|
|
2713
2714
|
ye,
|
|
2714
2715
|
Z,
|
|
@@ -2721,14 +2722,14 @@ function Qi(t = {}) {
|
|
|
2721
2722
|
me,
|
|
2722
2723
|
le,
|
|
2723
2724
|
ce
|
|
2724
|
-
]),
|
|
2725
|
+
]), qt = A(() => m !== "retention" ? null : ge(), [
|
|
2725
2726
|
m,
|
|
2726
2727
|
ge,
|
|
2727
2728
|
Z,
|
|
2728
2729
|
ee,
|
|
2729
2730
|
te,
|
|
2730
2731
|
ne
|
|
2731
|
-
]), Me = A(() => m === "retention" ? Qe !== null : m === "flow" ? O !== null : m === "funnel" ? H !== null : l.isValidQuery ?? !1, [m, Qe, O, H, l.isValidQuery]), I =
|
|
2732
|
+
]), Me = A(() => m === "retention" ? Qe !== null : m === "flow" ? O !== null : m === "funnel" ? H !== null : l.isValidQuery ?? !1, [m, Qe, O, H, l.isValidQuery]), I = Gr({
|
|
2732
2733
|
currentQuery: l.currentQuery,
|
|
2733
2734
|
allQueries: l.allQueries,
|
|
2734
2735
|
multiQueryConfig: l.multiQueryConfig,
|
|
@@ -2745,14 +2746,14 @@ function Qi(t = {}) {
|
|
|
2745
2746
|
// Retention mode: pass serverRetentionQuery
|
|
2746
2747
|
serverRetentionQuery: Qe,
|
|
2747
2748
|
// Retention mode: pass validation for debug panel
|
|
2748
|
-
retentionValidation:
|
|
2749
|
-
}), q =
|
|
2749
|
+
retentionValidation: qt
|
|
2750
|
+
}), q = Hr({
|
|
2750
2751
|
externalColorPalette: e,
|
|
2751
2752
|
combinedMetrics: d.combinedMetrics,
|
|
2752
2753
|
combinedBreakdowns: d.combinedBreakdowns,
|
|
2753
2754
|
hasDebounced: I.hasDebounced
|
|
2754
|
-
}), V =
|
|
2755
|
-
|
|
2755
|
+
}), V = Or();
|
|
2756
|
+
Xr({
|
|
2756
2757
|
currentQuery: l.currentQuery,
|
|
2757
2758
|
isValidQuery: l.isValidQuery ?? !1,
|
|
2758
2759
|
chartType: q.chartType,
|
|
@@ -2761,10 +2762,10 @@ function Qi(t = {}) {
|
|
|
2761
2762
|
onQueryChange: n,
|
|
2762
2763
|
onChartConfigChange: r
|
|
2763
2764
|
});
|
|
2764
|
-
const
|
|
2765
|
-
() =>
|
|
2766
|
-
[
|
|
2767
|
-
),
|
|
2765
|
+
const Bt = c((a) => a.openMetricsModal), Nt = c((a) => a.addMetric), Vt = c((a) => a.removeMetric), Re = c((a) => a.toggleMetric), Et = c((a) => a.reorderMetrics), Pt = c((a) => a.openBreakdownsModal), Ut = c((a) => a.addBreakdown), _t = c((a) => a.removeBreakdown), ke = c((a) => a.toggleBreakdown), Lt = c((a) => a.setBreakdownGranularity), Kt = c((a) => a.toggleBreakdownComparison), $t = c((a) => a.reorderBreakdowns), Gt = c((a) => a.setFilters), Ht = c((a) => a.dropFieldToFilter), Ot = c((a) => a.setOrder), jt = c((a) => a.clearQuery), zt = c((a) => a.clearCurrentMode), Wt = c((a) => a.setFunnelBindingKey), Jt = c((a) => a.setAnalysisType), Yt = c((a) => a.setFunnelCube), Xt = c((a) => a.addFunnelStep), Zt = c((a) => a.removeFunnelStep), en = c((a) => a.updateFunnelStep), tn = c((a) => a.setActiveFunnelStepIndex), nn = c((a) => a.reorderFunnelSteps), rn = c((a) => a.setFunnelTimeDimension), Ye = c((a) => a.charts.funnel?.displayConfig), sn = A(
|
|
2766
|
+
() => Ye || { showLegend: !0, showGrid: !0, showTooltip: !0 },
|
|
2767
|
+
[Ye]
|
|
2768
|
+
), an = c((a) => a.setFunnelDisplayConfig), on = c((a) => a.setFlowCube), ln = c((a) => a.setFlowBindingKey), cn = c((a) => a.setFlowTimeDimension), dn = c((a) => a.setEventDimension), un = c((a) => a.setStartingStepName), fn = c((a) => a.setStartingStepFilters), mn = c((a) => a.setStepsBefore), yn = c((a) => a.setStepsAfter), gn = c((a) => a.setJoinStrategy), hn = U(
|
|
2768
2769
|
(a) => {
|
|
2769
2770
|
o.setState((N) => ({
|
|
2770
2771
|
charts: {
|
|
@@ -2777,7 +2778,7 @@ function Qi(t = {}) {
|
|
|
2777
2778
|
}));
|
|
2778
2779
|
},
|
|
2779
2780
|
[o]
|
|
2780
|
-
),
|
|
2781
|
+
), pn = U(
|
|
2781
2782
|
(a) => {
|
|
2782
2783
|
o.setState((N) => ({
|
|
2783
2784
|
charts: {
|
|
@@ -2790,11 +2791,11 @@ function Qi(t = {}) {
|
|
|
2790
2791
|
}));
|
|
2791
2792
|
},
|
|
2792
2793
|
[o]
|
|
2793
|
-
), re = c((a) => a.aiState),
|
|
2794
|
-
() =>
|
|
2794
|
+
), re = c((a) => a.aiState), Cn = c((a) => a.openAI), ie = c((a) => a.closeAI), wn = c((a) => a.setAIPrompt), Ie = c((a) => a.setAIGenerating), qe = c((a) => a.setAIError), he = c((a) => a.setAIHasGeneratedQuery), Xe = c((a) => a.saveAIPreviousState), Ze = c((a) => a.restoreAIPreviousState), Be = ae("idle"), bn = Me, et = c((a) => a.getValidation), Sn = A(
|
|
2795
|
+
() => et(),
|
|
2795
2796
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2796
2797
|
[
|
|
2797
|
-
|
|
2798
|
+
et,
|
|
2798
2799
|
l.queryStates,
|
|
2799
2800
|
m,
|
|
2800
2801
|
// Funnel deps
|
|
@@ -2811,14 +2812,14 @@ function Qi(t = {}) {
|
|
|
2811
2812
|
C,
|
|
2812
2813
|
F
|
|
2813
2814
|
]
|
|
2814
|
-
),
|
|
2815
|
-
(a, N,
|
|
2816
|
-
V.fieldModalMode === "metrics" && N === "measure" ? Re(a.name) : V.fieldModalMode === "breakdown" && (m === "retention" && N === "dimension" ? Ae({ field: a.name }) : ke(a.name, N === "timeDimension")),
|
|
2815
|
+
), vn = U(
|
|
2816
|
+
(a, N, tt, Rn) => {
|
|
2817
|
+
V.fieldModalMode === "metrics" && N === "measure" ? Re(a.name) : V.fieldModalMode === "breakdown" && (m === "retention" && N === "dimension" ? Ae({ field: a.name }) : ke(a.name, N === "timeDimension")), Rn || V.closeFieldModal();
|
|
2817
2818
|
},
|
|
2818
2819
|
[V, Re, ke, Ae, m]
|
|
2819
|
-
),
|
|
2820
|
+
), xn = U(async () => {
|
|
2820
2821
|
if (s?.aiEndpoint) {
|
|
2821
|
-
|
|
2822
|
+
Xe(), Ie(!0), qe(null);
|
|
2822
2823
|
try {
|
|
2823
2824
|
await new Promise((a) => setTimeout(a, 1e3)), he(!0);
|
|
2824
2825
|
} catch (a) {
|
|
@@ -2827,15 +2828,15 @@ function Qi(t = {}) {
|
|
|
2827
2828
|
Ie(!1);
|
|
2828
2829
|
}
|
|
2829
2830
|
}
|
|
2830
|
-
}, [s?.aiEndpoint,
|
|
2831
|
+
}, [s?.aiEndpoint, Xe, Ie, qe, he]), Dn = U(() => {
|
|
2831
2832
|
ie(), he(!1);
|
|
2832
|
-
}, [ie, he]),
|
|
2833
|
-
|
|
2834
|
-
}, [
|
|
2833
|
+
}, [ie, he]), Tn = U(() => {
|
|
2834
|
+
Ze(), ie();
|
|
2835
|
+
}, [Ze, ie]), Fn = U(async () => {
|
|
2835
2836
|
Be.current = "copied", setTimeout(() => {
|
|
2836
2837
|
Be.current = "idle";
|
|
2837
2838
|
}, 2e3);
|
|
2838
|
-
}, []),
|
|
2839
|
+
}, []), An = U(() => {
|
|
2839
2840
|
const a = o.getState();
|
|
2840
2841
|
if (a.analysisType === "funnel") {
|
|
2841
2842
|
const N = a.buildFunnelQueryFromSteps();
|
|
@@ -2845,12 +2846,12 @@ function Qi(t = {}) {
|
|
|
2845
2846
|
queries: a.buildAllQueries(),
|
|
2846
2847
|
mergeStrategy: a.mergeStrategy,
|
|
2847
2848
|
mergeKeys: a.getMergeKeys(),
|
|
2848
|
-
queryLabels: a.queryStates.map((N,
|
|
2849
|
+
queryLabels: a.queryStates.map((N, tt) => `Q${tt + 1}`),
|
|
2849
2850
|
// Include funnel-specific config when in funnel mode
|
|
2850
2851
|
funnelBindingKey: a.funnelBindingKey,
|
|
2851
2852
|
stepTimeToConvert: a.stepTimeToConvert
|
|
2852
2853
|
} : a.buildCurrentQuery();
|
|
2853
|
-
}, [o]),
|
|
2854
|
+
}, [o]), Qn = U(() => {
|
|
2854
2855
|
const a = o.getState(), N = a.charts[a.analysisType];
|
|
2855
2856
|
return N ? {
|
|
2856
2857
|
chartType: N.chartType,
|
|
@@ -2861,7 +2862,7 @@ function Qi(t = {}) {
|
|
|
2861
2862
|
chartConfig: q.chartConfig,
|
|
2862
2863
|
displayConfig: q.displayConfig
|
|
2863
2864
|
};
|
|
2864
|
-
}, [o, q.chartType, q.chartConfig, q.displayConfig]),
|
|
2865
|
+
}, [o, q.chartType, q.chartConfig, q.displayConfig]), Mn = U(() => o.getState().analysisType, [o]);
|
|
2865
2866
|
return {
|
|
2866
2867
|
// Query state (from queryBuilder)
|
|
2867
2868
|
queryState: l.queryState,
|
|
@@ -2885,7 +2886,7 @@ function Qi(t = {}) {
|
|
|
2885
2886
|
funnelTimeDimension: S,
|
|
2886
2887
|
funnelChartType: D,
|
|
2887
2888
|
funnelChartConfig: h,
|
|
2888
|
-
funnelDisplayConfig:
|
|
2889
|
+
funnelDisplayConfig: sn,
|
|
2889
2890
|
// Flow state (new)
|
|
2890
2891
|
flowCube: x,
|
|
2891
2892
|
flowBindingKey: B,
|
|
@@ -2957,73 +2958,73 @@ function Qi(t = {}) {
|
|
|
2957
2958
|
},
|
|
2958
2959
|
// Share state
|
|
2959
2960
|
shareButtonState: Be.current,
|
|
2960
|
-
canShare:
|
|
2961
|
+
canShare: bn,
|
|
2961
2962
|
// Adapter validation (NEW - Phase 5)
|
|
2962
|
-
adapterValidation:
|
|
2963
|
+
adapterValidation: Sn,
|
|
2963
2964
|
// Actions
|
|
2964
2965
|
actions: {
|
|
2965
2966
|
// Query state (from queryBuilder)
|
|
2966
2967
|
setActiveQueryIndex: l.setActiveQueryIndex,
|
|
2967
2968
|
setMergeStrategy: l.setMergeStrategy,
|
|
2968
2969
|
// Metrics
|
|
2969
|
-
openMetricsModal:
|
|
2970
|
-
addMetric:
|
|
2971
|
-
removeMetric:
|
|
2970
|
+
openMetricsModal: Bt,
|
|
2971
|
+
addMetric: Nt,
|
|
2972
|
+
removeMetric: Vt,
|
|
2972
2973
|
toggleMetric: Re,
|
|
2973
|
-
reorderMetrics:
|
|
2974
|
+
reorderMetrics: Et,
|
|
2974
2975
|
// Breakdowns
|
|
2975
|
-
openBreakdownsModal:
|
|
2976
|
-
addBreakdown:
|
|
2977
|
-
removeBreakdown:
|
|
2976
|
+
openBreakdownsModal: Pt,
|
|
2977
|
+
addBreakdown: Ut,
|
|
2978
|
+
removeBreakdown: _t,
|
|
2978
2979
|
toggleBreakdown: ke,
|
|
2979
|
-
setBreakdownGranularity:
|
|
2980
|
-
toggleBreakdownComparison:
|
|
2981
|
-
reorderBreakdowns:
|
|
2980
|
+
setBreakdownGranularity: Lt,
|
|
2981
|
+
toggleBreakdownComparison: Kt,
|
|
2982
|
+
reorderBreakdowns: $t,
|
|
2982
2983
|
// Filters
|
|
2983
|
-
setFilters:
|
|
2984
|
-
dropFieldToFilter:
|
|
2985
|
-
setOrder:
|
|
2984
|
+
setFilters: Gt,
|
|
2985
|
+
dropFieldToFilter: Ht,
|
|
2986
|
+
setOrder: Ot,
|
|
2986
2987
|
// Multi-query (from queryBuilder)
|
|
2987
2988
|
addQuery: l.addQuery,
|
|
2988
2989
|
removeQuery: l.removeQuery,
|
|
2989
2990
|
// Funnel (legacy)
|
|
2990
|
-
setFunnelBindingKey:
|
|
2991
|
+
setFunnelBindingKey: Wt,
|
|
2991
2992
|
// Analysis Type (new)
|
|
2992
|
-
setAnalysisType:
|
|
2993
|
+
setAnalysisType: Jt,
|
|
2993
2994
|
// Funnel Mode (new dedicated state)
|
|
2994
|
-
setFunnelCube:
|
|
2995
|
-
addFunnelStep:
|
|
2996
|
-
removeFunnelStep:
|
|
2997
|
-
updateFunnelStep:
|
|
2998
|
-
setActiveFunnelStepIndex:
|
|
2999
|
-
reorderFunnelSteps:
|
|
3000
|
-
setFunnelTimeDimension:
|
|
3001
|
-
setFunnelDisplayConfig:
|
|
2995
|
+
setFunnelCube: Yt,
|
|
2996
|
+
addFunnelStep: Xt,
|
|
2997
|
+
removeFunnelStep: Zt,
|
|
2998
|
+
updateFunnelStep: en,
|
|
2999
|
+
setActiveFunnelStepIndex: tn,
|
|
3000
|
+
reorderFunnelSteps: nn,
|
|
3001
|
+
setFunnelTimeDimension: rn,
|
|
3002
|
+
setFunnelDisplayConfig: an,
|
|
3002
3003
|
// Flow Mode actions
|
|
3003
|
-
setFlowCube:
|
|
3004
|
-
setFlowBindingKey:
|
|
3005
|
-
setFlowTimeDimension:
|
|
3006
|
-
setEventDimension:
|
|
3007
|
-
setStartingStepName:
|
|
3008
|
-
setStartingStepFilters:
|
|
3009
|
-
setStepsBefore:
|
|
3010
|
-
setStepsAfter:
|
|
3011
|
-
setJoinStrategy:
|
|
3012
|
-
setFlowDisplayConfig:
|
|
3004
|
+
setFlowCube: on,
|
|
3005
|
+
setFlowBindingKey: ln,
|
|
3006
|
+
setFlowTimeDimension: cn,
|
|
3007
|
+
setEventDimension: dn,
|
|
3008
|
+
setStartingStepName: un,
|
|
3009
|
+
setStartingStepFilters: fn,
|
|
3010
|
+
setStepsBefore: mn,
|
|
3011
|
+
setStepsAfter: yn,
|
|
3012
|
+
setJoinStrategy: gn,
|
|
3013
|
+
setFlowDisplayConfig: hn,
|
|
3013
3014
|
// Retention Mode actions (simplified Mixpanel-style)
|
|
3014
3015
|
setRetentionCube: De,
|
|
3015
3016
|
setRetentionBindingKey: Te,
|
|
3016
3017
|
setRetentionTimeDimension: Fe,
|
|
3017
3018
|
setRetentionDateRange: k,
|
|
3018
|
-
setRetentionCohortFilters:
|
|
3019
|
-
setRetentionActivityFilters:
|
|
3020
|
-
setRetentionBreakdowns:
|
|
3019
|
+
setRetentionCohortFilters: Ft,
|
|
3020
|
+
setRetentionActivityFilters: At,
|
|
3021
|
+
setRetentionBreakdowns: Qt,
|
|
3021
3022
|
addRetentionBreakdown: Ae,
|
|
3022
|
-
removeRetentionBreakdown:
|
|
3023
|
-
setRetentionViewGranularity:
|
|
3024
|
-
setRetentionPeriods:
|
|
3025
|
-
setRetentionType:
|
|
3026
|
-
setRetentionDisplayConfig:
|
|
3023
|
+
removeRetentionBreakdown: Mt,
|
|
3024
|
+
setRetentionViewGranularity: Rt,
|
|
3025
|
+
setRetentionPeriods: kt,
|
|
3026
|
+
setRetentionType: It,
|
|
3027
|
+
setRetentionDisplayConfig: pn,
|
|
3027
3028
|
// Chart (from chartDefaults)
|
|
3028
3029
|
setChartType: q.setChartType,
|
|
3029
3030
|
setChartConfig: q.setChartConfig,
|
|
@@ -3036,27 +3037,27 @@ function Qi(t = {}) {
|
|
|
3036
3037
|
closeFieldModal: V.closeFieldModal,
|
|
3037
3038
|
setActiveTableIndex: V.setActiveTableIndex,
|
|
3038
3039
|
// AI
|
|
3039
|
-
openAI:
|
|
3040
|
+
openAI: Cn,
|
|
3040
3041
|
closeAI: ie,
|
|
3041
|
-
setAIPrompt:
|
|
3042
|
-
generateAI:
|
|
3043
|
-
acceptAI:
|
|
3044
|
-
cancelAI:
|
|
3042
|
+
setAIPrompt: wn,
|
|
3043
|
+
generateAI: xn,
|
|
3044
|
+
acceptAI: Dn,
|
|
3045
|
+
cancelAI: Tn,
|
|
3045
3046
|
// Share
|
|
3046
|
-
share:
|
|
3047
|
+
share: Fn,
|
|
3047
3048
|
// Utility
|
|
3048
|
-
clearQuery:
|
|
3049
|
-
clearCurrentMode:
|
|
3049
|
+
clearQuery: jt,
|
|
3050
|
+
clearCurrentMode: zt,
|
|
3050
3051
|
refetch: I.refetch,
|
|
3051
|
-
handleFieldSelected:
|
|
3052
|
+
handleFieldSelected: vn
|
|
3052
3053
|
},
|
|
3053
3054
|
// Refs
|
|
3054
|
-
getQueryConfig:
|
|
3055
|
-
getChartConfig:
|
|
3056
|
-
getAnalysisType:
|
|
3055
|
+
getQueryConfig: An,
|
|
3056
|
+
getChartConfig: Qn,
|
|
3057
|
+
getAnalysisType: Mn
|
|
3057
3058
|
};
|
|
3058
3059
|
}
|
|
3059
|
-
function
|
|
3060
|
+
function Zr(t, i) {
|
|
3060
3061
|
const e = [];
|
|
3061
3062
|
if (!i?.cubes)
|
|
3062
3063
|
return e;
|
|
@@ -3082,7 +3083,7 @@ function ei(t, i) {
|
|
|
3082
3083
|
}
|
|
3083
3084
|
return e;
|
|
3084
3085
|
}
|
|
3085
|
-
function
|
|
3086
|
+
function ei(t) {
|
|
3086
3087
|
const i = [];
|
|
3087
3088
|
for (let e = 0; e < t.length; e++) {
|
|
3088
3089
|
const n = t[e], r = n.query;
|
|
@@ -3094,18 +3095,18 @@ function ti(t) {
|
|
|
3094
3095
|
}
|
|
3095
3096
|
return i;
|
|
3096
3097
|
}
|
|
3097
|
-
function
|
|
3098
|
+
function ti(t, i) {
|
|
3098
3099
|
if (typeof t.dimension == "string")
|
|
3099
3100
|
return !0;
|
|
3100
|
-
const e =
|
|
3101
|
+
const e = pt(i);
|
|
3101
3102
|
return e ? t.dimension.some((n) => n.cube === e) : !1;
|
|
3102
3103
|
}
|
|
3103
|
-
function
|
|
3104
|
+
function ni(t, i) {
|
|
3104
3105
|
const e = [];
|
|
3105
3106
|
for (let n = 0; n < i.length; n++) {
|
|
3106
3107
|
const r = i[n];
|
|
3107
|
-
if (!
|
|
3108
|
-
const s =
|
|
3108
|
+
if (!ti(t, r.query)) {
|
|
3109
|
+
const s = pt(r.query) || "unknown";
|
|
3109
3110
|
e.push({
|
|
3110
3111
|
type: "cross_cube",
|
|
3111
3112
|
message: `Step ${n + 1} uses cube "${s}" but no binding key mapping exists for it`,
|
|
@@ -3115,26 +3116,26 @@ function ri(t, i) {
|
|
|
3115
3116
|
}
|
|
3116
3117
|
return e;
|
|
3117
3118
|
}
|
|
3118
|
-
function
|
|
3119
|
+
function mt(t) {
|
|
3119
3120
|
return t ? /^P(?:\d+Y)?(?:\d+M)?(?:\d+W)?(?:\d+D)?(?:T(?:\d+H)?(?:\d+M)?(?:\d+S)?)?$/.test(t) ? null : {
|
|
3120
3121
|
type: "time_window",
|
|
3121
3122
|
message: `Invalid time window format "${t}". Expected ISO 8601 duration (e.g., P7D, PT1H)`
|
|
3122
3123
|
} : null;
|
|
3123
3124
|
}
|
|
3124
|
-
function
|
|
3125
|
+
function Qi(t, i) {
|
|
3125
3126
|
const e = [], n = [];
|
|
3126
3127
|
t.steps.length < 2 && e.push({
|
|
3127
3128
|
type: "general",
|
|
3128
3129
|
message: "Funnel requires at least 2 steps"
|
|
3129
|
-
}), t.bindingKey?.dimension ? (e.push(...
|
|
3130
|
+
}), t.bindingKey?.dimension ? (e.push(...Zr(t.bindingKey, i)), e.push(...ni(t.bindingKey, t.steps))) : e.push({
|
|
3130
3131
|
type: "binding_key",
|
|
3131
3132
|
message: "Binding key dimension is required"
|
|
3132
|
-
}), e.push(...
|
|
3133
|
+
}), e.push(...ei(t.steps));
|
|
3133
3134
|
for (let s = 0; s < t.steps.length; s++) {
|
|
3134
|
-
const o = t.steps[s], l =
|
|
3135
|
+
const o = t.steps[s], l = mt(o.timeToConvert);
|
|
3135
3136
|
l && (l.stepIndex = s, e.push(l));
|
|
3136
3137
|
}
|
|
3137
|
-
const r =
|
|
3138
|
+
const r = mt(t.globalTimeWindow);
|
|
3138
3139
|
return r && e.push(r), t.steps.length > 5 && n.push({
|
|
3139
3140
|
type: "general",
|
|
3140
3141
|
message: "Funnels with more than 5 steps may have reduced performance"
|
|
@@ -3144,10 +3145,10 @@ function Mi(t, i) {
|
|
|
3144
3145
|
warnings: n
|
|
3145
3146
|
};
|
|
3146
3147
|
}
|
|
3147
|
-
function
|
|
3148
|
+
function Mi(t, i) {
|
|
3148
3149
|
return i < 2 ? { isValid: !1, message: "Add at least 2 steps for funnel" } : t?.dimension ? typeof t.dimension == "string" && !t.dimension ? { isValid: !1, message: "Select a binding key dimension" } : Array.isArray(t.dimension) && t.dimension.length === 0 ? { isValid: !1, message: "Select a binding key dimension" } : { isValid: !0 } : { isValid: !1, message: "Select a binding key dimension" };
|
|
3149
3150
|
}
|
|
3150
|
-
function
|
|
3151
|
+
function Ri(t) {
|
|
3151
3152
|
if (!t?.cubes) return [];
|
|
3152
3153
|
const i = [];
|
|
3153
3154
|
for (const e of t.cubes)
|
|
@@ -3160,7 +3161,7 @@ function ki(t) {
|
|
|
3160
3161
|
});
|
|
3161
3162
|
return i;
|
|
3162
3163
|
}
|
|
3163
|
-
function
|
|
3164
|
+
function ki(t) {
|
|
3164
3165
|
if (!t?.dimension) return "Select binding key...";
|
|
3165
3166
|
if (typeof t.dimension == "string")
|
|
3166
3167
|
return t.dimension.split(".")[1] || t.dimension;
|
|
@@ -3171,41 +3172,41 @@ function Ii(t) {
|
|
|
3171
3172
|
return "Select binding key...";
|
|
3172
3173
|
}
|
|
3173
3174
|
export {
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3175
|
+
ni as A,
|
|
3176
|
+
Mi as B,
|
|
3177
|
+
Ri as C,
|
|
3178
|
+
ki as D,
|
|
3179
|
+
gi as E,
|
|
3180
|
+
zr as F,
|
|
3181
|
+
Ue as G,
|
|
3182
|
+
Wr as H,
|
|
3183
|
+
hi as I,
|
|
3184
|
+
Nr as J,
|
|
3185
|
+
pr as a,
|
|
3185
3186
|
c as b,
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3187
|
+
pi as c,
|
|
3188
|
+
Ci as d,
|
|
3189
|
+
wi as e,
|
|
3190
|
+
Vr as f,
|
|
3191
|
+
bi as g,
|
|
3192
|
+
Si as h,
|
|
3193
|
+
vi as i,
|
|
3194
|
+
Er as j,
|
|
3195
|
+
Pr as k,
|
|
3196
|
+
Ur as l,
|
|
3197
|
+
_r as m,
|
|
3198
|
+
xi as n,
|
|
3199
|
+
Di as o,
|
|
3200
|
+
Oe as p,
|
|
3201
|
+
jr as q,
|
|
3202
|
+
Fi as r,
|
|
3203
|
+
Je as s,
|
|
3204
|
+
Yr as t,
|
|
3205
|
+
Ai as u,
|
|
3206
|
+
Lr as v,
|
|
3207
|
+
Ti as w,
|
|
3208
|
+
Qi as x,
|
|
3209
|
+
Zr as y,
|
|
3210
|
+
ei as z
|
|
3210
3211
|
};
|
|
3211
|
-
//# sourceMappingURL=analysis-builder-shared-
|
|
3212
|
+
//# sourceMappingURL=analysis-builder-shared-BkwUHObk.js.map
|