@sisense/sdk-ui 2.29.0 → 2.30.0
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/ai.cjs +57 -57
- package/dist/ai.js +767 -797
- package/dist/analytics-composer/node.cjs +1 -1
- package/dist/analytics-composer/node.js +723 -696
- package/dist/analytics-composer.cjs +1 -1
- package/dist/analytics-composer.js +6 -6
- package/dist/{apply-styled-options-to-query-CaP4IMrQ.js → apply-styled-options-to-query-BK1NnV4P.js} +1936 -1862
- package/dist/apply-styled-options-to-query-Dl8vVNxo.cjs +1 -0
- package/dist/{index-C77YCBVd.js → index-DCYw3JUB.js} +29 -7
- package/dist/index-DTvxJdqZ.cjs +1 -0
- package/dist/index.cjs +575 -482
- package/dist/index.js +26629 -25620
- package/dist/index.umd.js +925 -802
- package/dist/packages/sdk-ui/src/domains/dashboarding/common-filters/utils.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/components/dashboard-container.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/components/dashboard-header-config.d.ts +127 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/components/dashboard-header-targets.d.ts +30 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/components/dashboard-header-title.d.ts +20 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/components/dashboard-header.d.ts +10 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/constants.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-helpers.d.ts +21 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/translate-dashboard-utils.d.ts +43 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/types.d.ts +7 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/utils.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-module/dashboard-module.d.ts +34 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-module/types.d.ts +58 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/duplicate-widget/use-duplicate-widget-menu-item.d.ts +7 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/use-dashboard-header-menu-item.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/persistence/types.d.ts +11 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/types.d.ts +18 -7
- package/dist/packages/sdk-ui/src/domains/dashboarding/utils.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/data-browser/add-measure-popover/add-measure-data-browser.d.ts +11 -0
- package/dist/packages/sdk-ui/src/domains/data-browser/add-measure-popover/add-measure-popover.d.ts +14 -0
- package/dist/packages/sdk-ui/src/domains/data-browser/add-measure-popover/measure-ranking-title.d.ts +21 -0
- package/dist/packages/sdk-ui/src/domains/data-browser/add-measure-popover/measures.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/criteria-filter-tile/criteria-filter-menu.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/filters/components/criteria-filter-tile/criteria-filter-operations.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/filter-editor-popover/filter-editor-context.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/filter-editor-popover/filter-editor-popover.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/filters/components/filter-editor-popover/filter-editor.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/filters/components/filter-editor-popover/sections/numeric-condition-section/types.d.ts +5 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/filter-editor-popover/sections/ranking-condition/index.d.ts +3 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/filter-editor-popover/sections/ranking-condition/ranking-condition-controls.d.ts +33 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/filter-editor-popover/sections/ranking-condition/ranking-condition-utils.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/filters-panel/hooks/use-existing-filter-editing.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/narrative/components/narrative-collapsible.d.ts +22 -4
- package/dist/packages/sdk-ui/src/domains/narrative/components/narrative-top-slot-shell.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/narrative/components/narrative-trigger-button.d.ts +17 -0
- package/dist/packages/sdk-ui/src/domains/narrative/components/widget-narrative-interactive.d.ts +20 -2
- package/dist/packages/sdk-ui/src/domains/narrative/components/widget-narrative.d.ts +11 -9
- package/dist/packages/sdk-ui/src/domains/narrative/core/build-narrative-request.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/narrative/core/get-narrative-dimensions-and-measures.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/narrative/core/get-widget-narrative-from-widget-props.d.ts +18 -0
- package/dist/packages/sdk-ui/src/domains/narrative/core/to-nlg-api-verbosity.d.ts +7 -0
- package/dist/packages/sdk-ui/src/domains/narrative/core/widget-narrative-options.d.ts +101 -23
- package/dist/packages/sdk-ui/src/domains/narrative/core/widget-props-to-narrative-params.d.ts +35 -32
- package/dist/packages/sdk-ui/src/domains/narrative/hooks/use-get-widget-narrative.d.ts +11 -22
- package/dist/packages/sdk-ui/src/domains/narrative/hooks/use-line-height.d.ts +10 -0
- package/dist/packages/sdk-ui/src/domains/narrative/hooks/use-widget-narrative-state.d.ts +8 -9
- package/dist/packages/sdk-ui/src/domains/query-execution/core/execute-query.d.ts +34 -1
- package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-excel-query/excel-export/build-jaql-excel-export.d.ts +13 -5
- package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-excel-query/excel-export/build-xlsx-export-payload.d.ts +5 -0
- package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-query-by-widget-id/use-execute-query-by-widget-id.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/query-execution/types.d.ts +55 -3
- package/dist/packages/sdk-ui/src/domains/shared/header/header-item-size.d.ts +30 -0
- package/dist/packages/sdk-ui/src/domains/shared/header/header-items-renderer.d.ts +19 -0
- package/dist/packages/sdk-ui/src/domains/shared/header/header-spacer-item.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/shared/header/index.d.ts +6 -0
- package/dist/packages/sdk-ui/src/domains/shared/header/resolve-header-items.d.ts +17 -0
- package/dist/packages/sdk-ui/src/domains/shared/header/types.d.ts +98 -0
- package/dist/packages/sdk-ui/src/domains/shared/header/use-resolved-header-items.d.ts +10 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/areamap-chart/data/areamap-data.d.ts +3 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/cartesians/helpers/data.d.ts +3 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/cartesians/stackable/streamgraph-chart/helpers/chart-data.d.ts +3 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/categoricals/helpers/data.d.ts +3 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/categoricals/sunburst-chart/data/index.d.ts +3 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/categoricals/treemap-chart/data/index.d.ts +3 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/highcharts-based-chart-renderer/build-highchart-options.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/sankey-chart/alerts/index.d.ts +5 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/sankey-chart/data/index.d.ts +22 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/sankey-chart/data-options/index.d.ts +33 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/sankey-chart/design-options/index.d.ts +21 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/sankey-chart/highchart-options/highcharts-options-builder.d.ts +3 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/sankey-chart/sankey-chart-builder.d.ts +3 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/sankey-chart/sankey-node-colors.d.ts +10 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/sankey-chart/types.d.ts +38 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/types.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/types.d.ts +12 -9
- package/dist/packages/sdk-ui/src/domains/visualizations/components/pivot-table/formatters/data-cell-formatters/data-cell-value-formatter.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/pivot-table/formatters/header-cell-formatters/header-cell-value-formatter.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/pivot-table/hooks/use-pivot-data-loading.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/pivot-table/resolve-pivot-container-size.d.ts +28 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/sankey-chart.d.ts +30 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/table/pure-table/helpers/format-numbers.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data/cartesian-data.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data/categorical-data.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data/chart-data-service.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data/scatter-data.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data/types.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/apply-styled-options-to-query.d.ts +4 -4
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/types.d.ts +47 -7
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/chart-options-service.d.ts +3 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/tooltip.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/design-options.d.ts +10 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/funnel-plot-options.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/number-format-config.d.ts +12 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/pie-plot-options.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/sunburst/sunburst-levels.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/sunburst/sunburst-options.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/treemap/treemap-tooltip.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/types.d.ts +12 -3
- package/dist/packages/sdk-ui/src/domains/widgets/components/chart-widget/types.d.ts +8 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/chart-widget/use-chart-widget-excel-download.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/chart-widget/use-chart-widget-narrative.d.ts +28 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/custom-widget/use-custom-widget-excel-download.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/pivot-table-widget.d.ts +4 -4
- package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/types.d.ts +7 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/use-pivot-widget-excel-download.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/tabber.d.ts +17 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/widget-narrative-style.d.ts +31 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/types.d.ts +30 -1
- package/dist/packages/sdk-ui/src/domains/widgets/helpers/excel-export-map-dimensions-measures.d.ts +17 -2
- package/dist/packages/sdk-ui/src/domains/widgets/helpers/number-format-config-to-numeric-mask.d.ts +5 -0
- package/dist/packages/sdk-ui/src/domains/widgets/shared/widget-container/widget-container.d.ts +7 -1
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model.d.ts +6 -1
- package/dist/packages/sdk-ui/src/infra/api/narrative/narrative-endpoints.d.ts +2 -2
- package/dist/packages/sdk-ui/src/infra/app/types.d.ts +18 -0
- package/dist/packages/sdk-ui/src/infra/plugins/types.d.ts +34 -6
- package/dist/packages/sdk-ui/src/infra/plugins/widget-plugins/types.d.ts +169 -49
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/de-de.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/en-us.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-ar.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-es.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/fr-fr.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/it-it.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ja-jp.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ko-kr.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/nl-nl.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/pt-br.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ru-ru.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/tr-tr.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/zh-cn.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/en.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/index.d.ts +44 -0
- package/dist/packages/sdk-ui/src/modules/ai/common/collapsible.d.ts +38 -2
- package/dist/packages/sdk-ui/src/modules/ai/get-nlg-insights-from-widget.d.ts +4 -13
- package/dist/packages/sdk-ui/src/modules/ai/index.d.ts +1 -1
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/expression/process-measured-value.d.ts +14 -0
- package/dist/packages/sdk-ui/src/props.d.ts +46 -2
- package/dist/packages/sdk-ui/src/public-api/alpha.d.ts +3 -1
- package/dist/packages/sdk-ui/src/public-api/beta.d.ts +6 -0
- package/dist/packages/sdk-ui/src/public-api/internal.d.ts +1 -1
- package/dist/packages/sdk-ui/src/public-api/sisense-internal.d.ts +5 -3
- package/dist/packages/sdk-ui/src/types.d.ts +78 -6
- package/dist/{use-hover-Dju4Dcv3.js → quota-notification-DqabeDbO.js} +23733 -22015
- package/dist/quota-notification-gYE6PTWA.cjs +750 -0
- package/dist/translations/de-de.cjs +1 -1
- package/dist/translations/de-de.js +27 -5
- package/dist/translations/en-us.cjs +1 -1
- package/dist/translations/en-us.js +1 -1
- package/dist/translations/es-ar.cjs +1 -1
- package/dist/translations/es-ar.js +27 -5
- package/dist/translations/es-es.cjs +1 -1
- package/dist/translations/es-es.js +27 -5
- package/dist/translations/fr-fr.cjs +1 -1
- package/dist/translations/fr-fr.js +27 -5
- package/dist/translations/it-it.cjs +1 -1
- package/dist/translations/it-it.js +29 -7
- package/dist/translations/ja-jp.cjs +1 -1
- package/dist/translations/ja-jp.js +27 -5
- package/dist/translations/ko-kr.cjs +1 -1
- package/dist/translations/ko-kr.js +27 -5
- package/dist/translations/nl-nl.cjs +1 -1
- package/dist/translations/nl-nl.js +29 -7
- package/dist/translations/pt-br.cjs +1 -1
- package/dist/translations/pt-br.js +27 -5
- package/dist/translations/ru-ru.cjs +1 -1
- package/dist/translations/ru-ru.js +27 -5
- package/dist/translations/tr-tr.cjs +1 -1
- package/dist/translations/tr-tr.js +27 -5
- package/dist/translations/zh-cn.cjs +1 -1
- package/dist/translations/zh-cn.js +27 -5
- package/dist/{types-DlYJ_DZ0.cjs → types-DSNnndG6.cjs} +1 -1
- package/dist/{types-7YG0uOzO.js → types-DecTaxy7.js} +1 -1
- package/dist/{utils-C4PIba42.cjs → utils-Cpeyj9TN.cjs} +52 -52
- package/dist/{utils-BKRpWUGm.js → utils-L-HO2pCd.js} +2518 -2469
- package/dist/{widget-composer-BXEyx308.cjs → widget-composer-CyWQaInf.cjs} +1 -1
- package/dist/{widget-composer-DRDw1oBF.js → widget-composer-u6NMLm1C.js} +3 -3
- package/package.json +8 -8
- package/dist/apply-styled-options-to-query-D5D8pRl2.cjs +0 -1
- package/dist/index-C9G8giSk.cjs +0 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/use-dashboard-header-toolbar.d.ts +0 -25
- package/dist/use-hover-CANskYrn.cjs +0 -720
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var cr = Object.defineProperty, lr = Object.defineProperties;
|
|
2
|
+
var fr = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var oe = Object.getOwnPropertySymbols;
|
|
4
|
+
var Ke = Object.prototype.hasOwnProperty, Ge = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Je = (e, t, r) => t in e ? cr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, l = (e, t) => {
|
|
6
6
|
for (var r in t || (t = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var r of
|
|
10
|
-
|
|
7
|
+
Ke.call(t, r) && Je(e, r, t[r]);
|
|
8
|
+
if (oe)
|
|
9
|
+
for (var r of oe(t))
|
|
10
|
+
Ge.call(t, r) && Je(e, r, t[r]);
|
|
11
11
|
return e;
|
|
12
|
-
}, E = (e, t) =>
|
|
13
|
-
var
|
|
12
|
+
}, E = (e, t) => lr(e, fr(t));
|
|
13
|
+
var Ee = (e, t) => {
|
|
14
14
|
var r = {};
|
|
15
15
|
for (var s in e)
|
|
16
|
-
|
|
17
|
-
if (e != null &&
|
|
18
|
-
for (var s of
|
|
19
|
-
t.indexOf(s) < 0 &&
|
|
16
|
+
Ke.call(e, s) && t.indexOf(s) < 0 && (r[s] = e[s]);
|
|
17
|
+
if (e != null && oe)
|
|
18
|
+
for (var s of oe(e))
|
|
19
|
+
t.indexOf(s) < 0 && Ge.call(e, s) && (r[s] = e[s]);
|
|
20
20
|
return r;
|
|
21
21
|
};
|
|
22
|
-
import { f as
|
|
23
|
-
import { b as
|
|
24
|
-
import {
|
|
25
|
-
function
|
|
22
|
+
import { f as dr, J as mr } from "../types-DecTaxy7.js";
|
|
23
|
+
import { b as Hi, E as Qi, a as Xi, i as Zi, e as ea, d as ta } from "../types-DecTaxy7.js";
|
|
24
|
+
import { bt as pr, br as gr, cr as yr, bs as hr, aW as br, cs as Fr, ct as Er, aw as Me, cu as Ar, av as Tr, cv as wr, bh as Sr, ax as Cr, cw as Or, bk as $r, bi as qr, aS as Dr, bg as xr, bj as Nr, cx as vr, at as Mr, bB as Rr, cy as Ir, e as kr, cz as Lr, cA as Br, cB as _r, cC as zr, cD as Ur, cE as Pr, cF as Wr, cG as Vr, cH as jr, cI as Jr, cJ as Kr, as as Gr, cK as Yr, cL as Hr, ak as z, l as se, b as Qr, x as $, a4 as Xr, ag as U, aj as gt, cM as Zr, cN as es, cO as ts, M as J, aX as rs, cP as ss, aO as ns, am as Ye, au as me, cj as is, ck as as, bZ as yt, cQ as ht, ab as os, cR as bt, cS as Ft, A as us, c6 as Et, cT as cs, bQ as ls, aE as fs } from "../apply-styled-options-to-query-BK1NnV4P.js";
|
|
25
|
+
function ds(e, t) {
|
|
26
26
|
const r = e.length, s = t.length, n = Array.from({ length: r + 1 }, (i, a) => Array.from({ length: s + 1 }, (o, u) => a === 0 ? u : u === 0 ? a : 0));
|
|
27
27
|
for (let i = 1; i <= r; i++)
|
|
28
28
|
for (let a = 1; a <= s; a++)
|
|
29
29
|
n[i][a] = Math.min(n[i - 1][a] + 1, n[i][a - 1] + 1, n[i - 1][a - 1] + (e[i - 1] === t[a - 1] ? 0 : 1));
|
|
30
30
|
return n[r][s];
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function Re(e, t) {
|
|
33
33
|
const r = [];
|
|
34
34
|
let s = "", n = 0, i = !1, a = null;
|
|
35
35
|
for (let o = 0; o < e.length; o++) {
|
|
@@ -59,7 +59,7 @@ function Me(e, t) {
|
|
|
59
59
|
}
|
|
60
60
|
return s.trim() && r.push(s.trim()), r;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function ms(e, t) {
|
|
63
63
|
let r = 0, s = !1, n = null;
|
|
64
64
|
for (let i = 0; i < e.length; i++) {
|
|
65
65
|
const a = e[i], o = e[i + 1];
|
|
@@ -82,7 +82,7 @@ function ds(e, t) {
|
|
|
82
82
|
}
|
|
83
83
|
return -1;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function ps(e, t) {
|
|
86
86
|
if (e[t] !== "(")
|
|
87
87
|
return -1;
|
|
88
88
|
let r = 1, s = t + 1, n = !1, i = null;
|
|
@@ -110,10 +110,10 @@ function ms(e, t) {
|
|
|
110
110
|
}
|
|
111
111
|
return -1;
|
|
112
112
|
}
|
|
113
|
-
function
|
|
113
|
+
function gs(e) {
|
|
114
114
|
return e.startsWith("'") && e.endsWith("'") || e.startsWith('"') && e.endsWith('"') ? e.slice(1, -1) : e;
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function K(e) {
|
|
117
117
|
if (!e || typeof e != "string")
|
|
118
118
|
throw new Error(`Invalid composeCode: expected non-empty string, got ${typeof e}`);
|
|
119
119
|
const t = e.trim();
|
|
@@ -122,16 +122,16 @@ function J(e) {
|
|
|
122
122
|
const r = t.match(/^([a-zA-Z_$][a-zA-Z0-9_.$]*)\s*\((.*)\)$/);
|
|
123
123
|
if (!r)
|
|
124
124
|
throw new Error(`Invalid composeCode format: expected function call, got '${t}'`);
|
|
125
|
-
const s = r[1], n = r[2], i =
|
|
125
|
+
const s = r[1], n = r[2], i = At(n);
|
|
126
126
|
return {
|
|
127
127
|
function: s,
|
|
128
128
|
args: i
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
|
-
function Et(e) {
|
|
132
|
-
return e.trim() ? Me(e, ",").map(At) : [];
|
|
133
|
-
}
|
|
134
131
|
function At(e) {
|
|
132
|
+
return e.trim() ? Re(e, ",").map(Tt) : [];
|
|
133
|
+
}
|
|
134
|
+
function Tt(e) {
|
|
135
135
|
if (!e)
|
|
136
136
|
throw new Error("Cannot parse empty argument value");
|
|
137
137
|
if (e === "null")
|
|
@@ -152,29 +152,29 @@ function At(e) {
|
|
|
152
152
|
const r = e.slice(1, -1).trim();
|
|
153
153
|
if (!r)
|
|
154
154
|
return [];
|
|
155
|
-
const s =
|
|
155
|
+
const s = At(r);
|
|
156
156
|
return s.every((n) => typeof n == "string"), s;
|
|
157
157
|
}
|
|
158
158
|
if (e.startsWith("{") && e.endsWith("}")) {
|
|
159
159
|
const r = e.slice(1, -1).trim();
|
|
160
|
-
return r ?
|
|
160
|
+
return r ? hs(r) : {};
|
|
161
161
|
}
|
|
162
|
-
return e.includes("(") && e.includes(")") ?
|
|
162
|
+
return e.includes("(") && e.includes(")") ? K(e) : (e.startsWith("DM."), e);
|
|
163
163
|
}
|
|
164
|
-
function
|
|
165
|
-
const t =
|
|
164
|
+
function ys(e) {
|
|
165
|
+
const t = ms(e, ":");
|
|
166
166
|
if (t === -1)
|
|
167
167
|
throw new Error(`Invalid object property: expected 'key: value', got '${e}'`);
|
|
168
|
-
const r =
|
|
168
|
+
const r = gs(e.slice(0, t).trim()), s = Tt(e.slice(t + 1).trim());
|
|
169
169
|
return [r, s];
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function hs(e) {
|
|
172
172
|
if (!e.trim())
|
|
173
173
|
return {};
|
|
174
|
-
const t =
|
|
174
|
+
const t = Re(e, ",").map(ys).filter(([, r]) => r !== null);
|
|
175
175
|
return Object.fromEntries(t);
|
|
176
176
|
}
|
|
177
|
-
class
|
|
177
|
+
class bs {
|
|
178
178
|
constructor() {
|
|
179
179
|
this.keyToValue = /* @__PURE__ */ new Map(), this.valueToKey = /* @__PURE__ */ new Map();
|
|
180
180
|
}
|
|
@@ -191,9 +191,9 @@ class hs {
|
|
|
191
191
|
this.keyToValue.clear(), this.valueToKey.clear();
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
-
class
|
|
194
|
+
class wt {
|
|
195
195
|
constructor(t) {
|
|
196
|
-
this.generateIdentifier = t, this.kv = new
|
|
196
|
+
this.generateIdentifier = t, this.kv = new bs();
|
|
197
197
|
}
|
|
198
198
|
register(t, r) {
|
|
199
199
|
this.kv.getByValue(t) || (r || (r = this.generateIdentifier(t)), this.kv.set(r, t));
|
|
@@ -208,7 +208,7 @@ class Tt {
|
|
|
208
208
|
return this.kv.getByKey(t);
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
|
-
class
|
|
211
|
+
class Fs extends wt {
|
|
212
212
|
constructor() {
|
|
213
213
|
super((t) => t.name), this.classToAllowedProps = /* @__PURE__ */ new Map();
|
|
214
214
|
}
|
|
@@ -219,7 +219,7 @@ class bs extends Tt {
|
|
|
219
219
|
return this.classToAllowedProps.get(t);
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function Es(e) {
|
|
223
223
|
if ("values" in Object)
|
|
224
224
|
return Object.values(e);
|
|
225
225
|
const t = [];
|
|
@@ -227,8 +227,8 @@ function Fs(e) {
|
|
|
227
227
|
e.hasOwnProperty(r) && t.push(e[r]);
|
|
228
228
|
return t;
|
|
229
229
|
}
|
|
230
|
-
function
|
|
231
|
-
const r =
|
|
230
|
+
function As(e, t) {
|
|
231
|
+
const r = Es(e);
|
|
232
232
|
if ("find" in r)
|
|
233
233
|
return r.find(t);
|
|
234
234
|
const s = r;
|
|
@@ -238,20 +238,20 @@ function Es(e, t) {
|
|
|
238
238
|
return i;
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function G(e, t) {
|
|
242
242
|
Object.entries(e).forEach(([r, s]) => t(s, r));
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function ue(e, t) {
|
|
245
245
|
return e.indexOf(t) !== -1;
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function He(e, t) {
|
|
248
248
|
for (let r = 0; r < e.length; r++) {
|
|
249
249
|
const s = e[r];
|
|
250
250
|
if (t(s))
|
|
251
251
|
return s;
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
|
-
class
|
|
254
|
+
class Ts {
|
|
255
255
|
constructor() {
|
|
256
256
|
this.transfomers = {};
|
|
257
257
|
}
|
|
@@ -259,13 +259,13 @@ class As {
|
|
|
259
259
|
this.transfomers[t.name] = t;
|
|
260
260
|
}
|
|
261
261
|
findApplicable(t) {
|
|
262
|
-
return
|
|
262
|
+
return As(this.transfomers, (r) => r.isApplicable(t));
|
|
263
263
|
}
|
|
264
264
|
findByName(t) {
|
|
265
265
|
return this.transfomers[t];
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
|
-
const
|
|
268
|
+
const ws = (e) => Object.prototype.toString.call(e).slice(8, -1), St = (e) => typeof e == "undefined", Ss = (e) => e === null, Z = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, Oe = (e) => Z(e) && Object.keys(e).length === 0, k = (e) => Array.isArray(e), Cs = (e) => typeof e == "string", Os = (e) => typeof e == "number" && !isNaN(e), $s = (e) => typeof e == "boolean", qs = (e) => e instanceof RegExp, ee = (e) => e instanceof Map, te = (e) => e instanceof Set, Ct = (e) => ws(e) === "Symbol", Ds = (e) => e instanceof Date && !isNaN(e.valueOf()), xs = (e) => e instanceof Error, Qe = (e) => typeof e == "number" && isNaN(e), Ns = (e) => $s(e) || Ss(e) || St(e) || Os(e) || Cs(e) || Ct(e), vs = (e) => typeof e == "bigint", Ms = (e) => e === 1 / 0 || e === -1 / 0, Rs = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), Is = (e) => e instanceof URL, Ot = (e) => e.replace(/\./g, "\\."), Ae = (e) => e.map(String).map(Ot).join("."), Q = (e) => {
|
|
269
269
|
const t = [];
|
|
270
270
|
let r = "";
|
|
271
271
|
for (let n = 0; n < e.length; n++) {
|
|
@@ -291,12 +291,12 @@ function I(e, t, r, s) {
|
|
|
291
291
|
untransform: s
|
|
292
292
|
};
|
|
293
293
|
}
|
|
294
|
-
const
|
|
295
|
-
I(
|
|
294
|
+
const $t = [
|
|
295
|
+
I(St, "undefined", () => null, () => {
|
|
296
296
|
}),
|
|
297
|
-
I(
|
|
298
|
-
I(
|
|
299
|
-
I(
|
|
297
|
+
I(vs, "bigint", (e) => e.toString(), (e) => typeof BigInt != "undefined" ? BigInt(e) : (console.error("Please add a BigInt polyfill."), e)),
|
|
298
|
+
I(Ds, "Date", (e) => e.toISOString(), (e) => new Date(e)),
|
|
299
|
+
I(xs, "Error", (e, t) => {
|
|
300
300
|
const r = {
|
|
301
301
|
name: e.name,
|
|
302
302
|
message: e.message
|
|
@@ -315,19 +315,19 @@ const Ot = [
|
|
|
315
315
|
return new RegExp(t, r);
|
|
316
316
|
}),
|
|
317
317
|
I(
|
|
318
|
-
|
|
318
|
+
te,
|
|
319
319
|
"set",
|
|
320
320
|
// (sets only exist in es6+)
|
|
321
321
|
// eslint-disable-next-line es5/no-es6-methods
|
|
322
322
|
(e) => [...e.values()],
|
|
323
323
|
(e) => new Set(e)
|
|
324
324
|
),
|
|
325
|
-
I(
|
|
326
|
-
I((e) =>
|
|
325
|
+
I(ee, "map", (e) => [...e.entries()], (e) => new Map(e)),
|
|
326
|
+
I((e) => Qe(e) || Ms(e), "number", (e) => Qe(e) ? "NaN" : e > 0 ? "Infinity" : "-Infinity", Number),
|
|
327
327
|
I((e) => e === 0 && 1 / e === -1 / 0, "number", () => "-0", Number),
|
|
328
|
-
I(
|
|
328
|
+
I(Is, "URL", (e) => e.toString(), (e) => new URL(e))
|
|
329
329
|
];
|
|
330
|
-
function
|
|
330
|
+
function pe(e, t, r, s) {
|
|
331
331
|
return {
|
|
332
332
|
isApplicable: e,
|
|
333
333
|
annotation: t,
|
|
@@ -335,12 +335,12 @@ function me(e, t, r, s) {
|
|
|
335
335
|
untransform: s
|
|
336
336
|
};
|
|
337
337
|
}
|
|
338
|
-
const qt =
|
|
338
|
+
const qt = pe((e, t) => Ct(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t) => ["symbol", t.symbolRegistry.getIdentifier(e)], (e) => e.description, (e, t, r) => {
|
|
339
339
|
const s = r.symbolRegistry.getValue(t[1]);
|
|
340
340
|
if (!s)
|
|
341
341
|
throw new Error("Trying to deserialize unknown symbol");
|
|
342
342
|
return s;
|
|
343
|
-
}),
|
|
343
|
+
}), ks = [
|
|
344
344
|
Int8Array,
|
|
345
345
|
Uint8Array,
|
|
346
346
|
Int16Array,
|
|
@@ -350,16 +350,16 @@ const qt = me((e, t) => St(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t)
|
|
|
350
350
|
Float32Array,
|
|
351
351
|
Float64Array,
|
|
352
352
|
Uint8ClampedArray
|
|
353
|
-
].reduce((e, t) => (e[t.name] = t, e), {}),
|
|
354
|
-
const r =
|
|
353
|
+
].reduce((e, t) => (e[t.name] = t, e), {}), Dt = pe(Rs, (e) => ["typed-array", e.constructor.name], (e) => [...e], (e, t) => {
|
|
354
|
+
const r = ks[t[1]];
|
|
355
355
|
if (!r)
|
|
356
356
|
throw new Error("Trying to deserialize unknown typed array");
|
|
357
357
|
return new r(e);
|
|
358
358
|
});
|
|
359
|
-
function
|
|
359
|
+
function xt(e, t) {
|
|
360
360
|
return e != null && e.constructor ? !!t.classRegistry.getIdentifier(e.constructor) : !1;
|
|
361
361
|
}
|
|
362
|
-
const
|
|
362
|
+
const Nt = pe(xt, (e, t) => ["class", t.classRegistry.getIdentifier(e.constructor)], (e, t) => {
|
|
363
363
|
const r = t.classRegistry.getAllowedProps(e.constructor);
|
|
364
364
|
if (!r)
|
|
365
365
|
return l({}, e);
|
|
@@ -372,49 +372,49 @@ const xt = me(Dt, (e, t) => ["class", t.classRegistry.getIdentifier(e.constructo
|
|
|
372
372
|
if (!s)
|
|
373
373
|
throw new Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);
|
|
374
374
|
return Object.assign(Object.create(s.prototype), e);
|
|
375
|
-
}),
|
|
375
|
+
}), vt = pe((e, t) => !!t.customTransformerRegistry.findApplicable(e), (e, t) => ["custom", t.customTransformerRegistry.findApplicable(e).name], (e, t) => t.customTransformerRegistry.findApplicable(e).serialize(e), (e, t, r) => {
|
|
376
376
|
const s = r.customTransformerRegistry.findByName(t[1]);
|
|
377
377
|
if (!s)
|
|
378
378
|
throw new Error("Trying to deserialize unknown custom value");
|
|
379
379
|
return s.deserialize(e);
|
|
380
|
-
}),
|
|
381
|
-
const r =
|
|
380
|
+
}), Ls = [Nt, qt, vt, Dt], Xe = (e, t) => {
|
|
381
|
+
const r = He(Ls, (n) => n.isApplicable(e, t));
|
|
382
382
|
if (r)
|
|
383
383
|
return {
|
|
384
384
|
value: r.transform(e, t),
|
|
385
385
|
type: r.annotation(e, t)
|
|
386
386
|
};
|
|
387
|
-
const s =
|
|
387
|
+
const s = He($t, (n) => n.isApplicable(e, t));
|
|
388
388
|
if (s)
|
|
389
389
|
return {
|
|
390
390
|
value: s.transform(e, t),
|
|
391
391
|
type: s.annotation
|
|
392
392
|
};
|
|
393
|
-
},
|
|
394
|
-
|
|
395
|
-
|
|
393
|
+
}, Mt = {};
|
|
394
|
+
$t.forEach((e) => {
|
|
395
|
+
Mt[e.annotation] = e;
|
|
396
396
|
});
|
|
397
|
-
const
|
|
397
|
+
const Bs = (e, t, r) => {
|
|
398
398
|
if (k(t))
|
|
399
399
|
switch (t[0]) {
|
|
400
400
|
case "symbol":
|
|
401
401
|
return qt.untransform(e, t, r);
|
|
402
402
|
case "class":
|
|
403
|
-
return xt.untransform(e, t, r);
|
|
404
|
-
case "custom":
|
|
405
403
|
return Nt.untransform(e, t, r);
|
|
404
|
+
case "custom":
|
|
405
|
+
return vt.untransform(e, t, r);
|
|
406
406
|
case "typed-array":
|
|
407
|
-
return
|
|
407
|
+
return Dt.untransform(e, t, r);
|
|
408
408
|
default:
|
|
409
409
|
throw new Error("Unknown transformation: " + t);
|
|
410
410
|
}
|
|
411
411
|
else {
|
|
412
|
-
const s =
|
|
412
|
+
const s = Mt[t];
|
|
413
413
|
if (!s)
|
|
414
414
|
throw new Error("Unknown transformation: " + t);
|
|
415
415
|
return s.untransform(e, r);
|
|
416
416
|
}
|
|
417
|
-
},
|
|
417
|
+
}, j = (e, t) => {
|
|
418
418
|
if (t > e.size)
|
|
419
419
|
throw new Error("index out of bounds");
|
|
420
420
|
const r = e.keys();
|
|
@@ -422,22 +422,22 @@ const Ls = (e, t, r) => {
|
|
|
422
422
|
r.next(), t--;
|
|
423
423
|
return r.next().value;
|
|
424
424
|
};
|
|
425
|
-
function
|
|
426
|
-
if (
|
|
425
|
+
function Rt(e) {
|
|
426
|
+
if (ue(e, "__proto__"))
|
|
427
427
|
throw new Error("__proto__ is not allowed as a property");
|
|
428
|
-
if (
|
|
428
|
+
if (ue(e, "prototype"))
|
|
429
429
|
throw new Error("prototype is not allowed as a property");
|
|
430
|
-
if (
|
|
430
|
+
if (ue(e, "constructor"))
|
|
431
431
|
throw new Error("constructor is not allowed as a property");
|
|
432
432
|
}
|
|
433
|
-
const
|
|
434
|
-
|
|
433
|
+
const _s = (e, t) => {
|
|
434
|
+
Rt(t);
|
|
435
435
|
for (let r = 0; r < t.length; r++) {
|
|
436
436
|
const s = t[r];
|
|
437
|
-
if (
|
|
438
|
-
e =
|
|
439
|
-
else if (
|
|
440
|
-
const n = +s, i = +t[++r] == 0 ? "key" : "value", a =
|
|
437
|
+
if (te(e))
|
|
438
|
+
e = j(e, +s);
|
|
439
|
+
else if (ee(e)) {
|
|
440
|
+
const n = +s, i = +t[++r] == 0 ? "key" : "value", a = j(e, n);
|
|
441
441
|
switch (i) {
|
|
442
442
|
case "key":
|
|
443
443
|
e = a;
|
|
@@ -450,8 +450,8 @@ const Bs = (e, t) => {
|
|
|
450
450
|
e = e[s];
|
|
451
451
|
}
|
|
452
452
|
return e;
|
|
453
|
-
},
|
|
454
|
-
if (
|
|
453
|
+
}, $e = (e, t, r) => {
|
|
454
|
+
if (Rt(t), t.length === 0)
|
|
455
455
|
return r(e);
|
|
456
456
|
let s = e;
|
|
457
457
|
for (let i = 0; i < t.length - 1; i++) {
|
|
@@ -459,15 +459,15 @@ const Bs = (e, t) => {
|
|
|
459
459
|
if (k(s)) {
|
|
460
460
|
const o = +a;
|
|
461
461
|
s = s[o];
|
|
462
|
-
} else if (
|
|
462
|
+
} else if (Z(s))
|
|
463
463
|
s = s[a];
|
|
464
|
-
else if (
|
|
464
|
+
else if (te(s)) {
|
|
465
465
|
const o = +a;
|
|
466
|
-
s =
|
|
467
|
-
} else if (
|
|
466
|
+
s = j(s, o);
|
|
467
|
+
} else if (ee(s)) {
|
|
468
468
|
if (i === t.length - 2)
|
|
469
469
|
break;
|
|
470
|
-
const u = +a, c = +t[++i] == 0 ? "key" : "value", g =
|
|
470
|
+
const u = +a, c = +t[++i] == 0 ? "key" : "value", g = j(s, u);
|
|
471
471
|
switch (c) {
|
|
472
472
|
case "key":
|
|
473
473
|
s = g;
|
|
@@ -479,12 +479,12 @@ const Bs = (e, t) => {
|
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
481
|
const n = t[t.length - 1];
|
|
482
|
-
if (k(s) ? s[+n] = r(s[+n]) :
|
|
483
|
-
const i =
|
|
482
|
+
if (k(s) ? s[+n] = r(s[+n]) : Z(s) && (s[n] = r(s[n])), te(s)) {
|
|
483
|
+
const i = j(s, +n), a = r(i);
|
|
484
484
|
i !== a && (s.delete(i), s.add(a));
|
|
485
485
|
}
|
|
486
|
-
if (
|
|
487
|
-
const i = +t[t.length - 2], a =
|
|
486
|
+
if (ee(s)) {
|
|
487
|
+
const i = +t[t.length - 2], a = j(s, i);
|
|
488
488
|
switch (+n == 0 ? "key" : "value") {
|
|
489
489
|
case "key": {
|
|
490
490
|
const u = r(a);
|
|
@@ -503,41 +503,41 @@ function qe(e, t, r = []) {
|
|
|
503
503
|
if (!e)
|
|
504
504
|
return;
|
|
505
505
|
if (!k(e)) {
|
|
506
|
-
|
|
506
|
+
G(e, (i, a) => qe(i, t, [...r, ...Q(a)]));
|
|
507
507
|
return;
|
|
508
508
|
}
|
|
509
509
|
const [s, n] = e;
|
|
510
|
-
n &&
|
|
511
|
-
qe(i, t, [...r, ...
|
|
510
|
+
n && G(n, (i, a) => {
|
|
511
|
+
qe(i, t, [...r, ...Q(a)]);
|
|
512
512
|
}), t(s, r);
|
|
513
513
|
}
|
|
514
514
|
function zs(e, t, r) {
|
|
515
515
|
return qe(t, (s, n) => {
|
|
516
|
-
e =
|
|
516
|
+
e = $e(e, n, (i) => Bs(i, s, r));
|
|
517
517
|
}), e;
|
|
518
518
|
}
|
|
519
519
|
function Us(e, t) {
|
|
520
520
|
function r(s, n) {
|
|
521
|
-
const i =
|
|
522
|
-
s.map(
|
|
523
|
-
e =
|
|
521
|
+
const i = _s(e, Q(n));
|
|
522
|
+
s.map(Q).forEach((a) => {
|
|
523
|
+
e = $e(e, a, () => i);
|
|
524
524
|
});
|
|
525
525
|
}
|
|
526
526
|
if (k(t)) {
|
|
527
527
|
const [s, n] = t;
|
|
528
528
|
s.forEach((i) => {
|
|
529
|
-
e =
|
|
530
|
-
}), n &&
|
|
529
|
+
e = $e(e, Q(i), () => e);
|
|
530
|
+
}), n && G(n, r);
|
|
531
531
|
} else
|
|
532
|
-
|
|
532
|
+
G(t, r);
|
|
533
533
|
return e;
|
|
534
534
|
}
|
|
535
|
-
const
|
|
536
|
-
function
|
|
535
|
+
const Ps = (e, t) => Z(e) || k(e) || ee(e) || te(e) || xt(e, t);
|
|
536
|
+
function Ws(e, t, r) {
|
|
537
537
|
const s = r.get(e);
|
|
538
538
|
s ? s.push(t) : r.set(e, [t]);
|
|
539
539
|
}
|
|
540
|
-
function
|
|
540
|
+
function Vs(e, t) {
|
|
541
541
|
const r = {};
|
|
542
542
|
let s;
|
|
543
543
|
return e.forEach((n) => {
|
|
@@ -545,22 +545,22 @@ function Ws(e, t) {
|
|
|
545
545
|
return;
|
|
546
546
|
t || (n = n.map((o) => o.map(String)).sort((o, u) => o.length - u.length));
|
|
547
547
|
const [i, ...a] = n;
|
|
548
|
-
i.length === 0 ? s = a.map(
|
|
549
|
-
}), s ?
|
|
548
|
+
i.length === 0 ? s = a.map(Ae) : r[Ae(i)] = a.map(Ae);
|
|
549
|
+
}), s ? Oe(r) ? [s] : [s, r] : Oe(r) ? void 0 : r;
|
|
550
550
|
}
|
|
551
|
-
const
|
|
551
|
+
const It = (e, t, r, s, n = [], i = [], a = /* @__PURE__ */ new Map()) => {
|
|
552
552
|
var h;
|
|
553
|
-
const o =
|
|
553
|
+
const o = Ns(e);
|
|
554
554
|
if (!o) {
|
|
555
|
-
|
|
555
|
+
Ws(e, n, t);
|
|
556
556
|
const b = a.get(e);
|
|
557
557
|
if (b)
|
|
558
558
|
return s ? {
|
|
559
559
|
transformedValue: null
|
|
560
560
|
} : b;
|
|
561
561
|
}
|
|
562
|
-
if (!
|
|
563
|
-
const b =
|
|
562
|
+
if (!Ps(e, r)) {
|
|
563
|
+
const b = Xe(e, r), m = b ? {
|
|
564
564
|
transformedValue: b.value,
|
|
565
565
|
annotations: [b.type]
|
|
566
566
|
} : {
|
|
@@ -568,20 +568,20 @@ const Rt = (e, t, r, s, n = [], i = [], a = /* @__PURE__ */ new Map()) => {
|
|
|
568
568
|
};
|
|
569
569
|
return o || a.set(e, m), m;
|
|
570
570
|
}
|
|
571
|
-
if (
|
|
571
|
+
if (ue(i, e))
|
|
572
572
|
return {
|
|
573
573
|
transformedValue: null
|
|
574
574
|
};
|
|
575
|
-
const u =
|
|
576
|
-
|
|
575
|
+
const u = Xe(e, r), c = (h = u == null ? void 0 : u.value) != null ? h : e, g = k(c) ? [] : {}, f = {};
|
|
576
|
+
G(c, (b, m) => {
|
|
577
577
|
if (m === "__proto__" || m === "constructor" || m === "prototype")
|
|
578
578
|
throw new Error(`Detected property ${m}. This is a prototype pollution risk, please remove it from your object.`);
|
|
579
|
-
const F =
|
|
580
|
-
g[m] = F.transformedValue, k(F.annotations) ? f[m] = F.annotations :
|
|
581
|
-
f[
|
|
579
|
+
const F = It(b, t, r, s, [...n, m], [...i, e], a);
|
|
580
|
+
g[m] = F.transformedValue, k(F.annotations) ? f[m] = F.annotations : Z(F.annotations) && G(F.annotations, (O, N) => {
|
|
581
|
+
f[Ot(m) + "." + N] = O;
|
|
582
582
|
});
|
|
583
583
|
});
|
|
584
|
-
const p =
|
|
584
|
+
const p = Oe(f) ? {
|
|
585
585
|
transformedValue: g,
|
|
586
586
|
annotations: u ? [u.type] : void 0
|
|
587
587
|
} : {
|
|
@@ -590,19 +590,19 @@ const Rt = (e, t, r, s, n = [], i = [], a = /* @__PURE__ */ new Map()) => {
|
|
|
590
590
|
};
|
|
591
591
|
return o || a.set(e, p), p;
|
|
592
592
|
};
|
|
593
|
-
function
|
|
593
|
+
function kt(e) {
|
|
594
594
|
return Object.prototype.toString.call(e).slice(8, -1);
|
|
595
595
|
}
|
|
596
|
-
function
|
|
597
|
-
return
|
|
596
|
+
function Ze(e) {
|
|
597
|
+
return kt(e) === "Array";
|
|
598
598
|
}
|
|
599
|
-
function
|
|
600
|
-
if (
|
|
599
|
+
function js(e) {
|
|
600
|
+
if (kt(e) !== "Object")
|
|
601
601
|
return !1;
|
|
602
602
|
const t = Object.getPrototypeOf(e);
|
|
603
603
|
return !!t && t.constructor === Object && t === Object.prototype;
|
|
604
604
|
}
|
|
605
|
-
function
|
|
605
|
+
function Js(e, t, r, s, n) {
|
|
606
606
|
const i = {}.propertyIsEnumerable.call(s, t) ? "enumerable" : "nonenumerable";
|
|
607
607
|
i === "enumerable" && (e[t] = r), n && i === "nonenumerable" && Object.defineProperty(e, t, {
|
|
608
608
|
value: r,
|
|
@@ -611,17 +611,17 @@ function js(e, t, r, s, n) {
|
|
|
611
611
|
configurable: !0
|
|
612
612
|
});
|
|
613
613
|
}
|
|
614
|
-
function
|
|
615
|
-
if (
|
|
616
|
-
return e.map((n) =>
|
|
617
|
-
if (!
|
|
614
|
+
function De(e, t = {}) {
|
|
615
|
+
if (Ze(e))
|
|
616
|
+
return e.map((n) => De(n, t));
|
|
617
|
+
if (!js(e))
|
|
618
618
|
return e;
|
|
619
619
|
const r = Object.getOwnPropertyNames(e), s = Object.getOwnPropertySymbols(e);
|
|
620
620
|
return [...r, ...s].reduce((n, i) => {
|
|
621
|
-
if (
|
|
621
|
+
if (Ze(t.props) && !t.props.includes(i))
|
|
622
622
|
return n;
|
|
623
|
-
const a = e[i], o =
|
|
624
|
-
return
|
|
623
|
+
const a = e[i], o = De(a, t);
|
|
624
|
+
return Js(n, i, o, e, t.nonenumerable), n;
|
|
625
625
|
}, {});
|
|
626
626
|
}
|
|
627
627
|
class y {
|
|
@@ -629,26 +629,26 @@ class y {
|
|
|
629
629
|
* @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
|
|
630
630
|
*/
|
|
631
631
|
constructor({ dedupe: t = !1 } = {}) {
|
|
632
|
-
this.classRegistry = new
|
|
632
|
+
this.classRegistry = new Fs(), this.symbolRegistry = new wt((r) => {
|
|
633
633
|
var s;
|
|
634
634
|
return (s = r.description) != null ? s : "";
|
|
635
|
-
}), this.customTransformerRegistry = new
|
|
635
|
+
}), this.customTransformerRegistry = new Ts(), this.allowedErrorProps = [], this.dedupe = t;
|
|
636
636
|
}
|
|
637
637
|
serialize(t) {
|
|
638
|
-
const r = /* @__PURE__ */ new Map(), s =
|
|
638
|
+
const r = /* @__PURE__ */ new Map(), s = It(t, r, this, this.dedupe), n = {
|
|
639
639
|
json: s.transformedValue
|
|
640
640
|
};
|
|
641
641
|
s.annotations && (n.meta = E(l({}, n.meta), {
|
|
642
642
|
values: s.annotations
|
|
643
643
|
}));
|
|
644
|
-
const i =
|
|
644
|
+
const i = Vs(r, this.dedupe);
|
|
645
645
|
return i && (n.meta = E(l({}, n.meta), {
|
|
646
646
|
referentialEqualities: i
|
|
647
647
|
})), n;
|
|
648
648
|
}
|
|
649
649
|
deserialize(t) {
|
|
650
650
|
const { json: r, meta: s } = t;
|
|
651
|
-
let n =
|
|
651
|
+
let n = De(r);
|
|
652
652
|
return s != null && s.values && (n = zs(n, s.values, this)), s != null && s.referentialEqualities && (n = Us(n, s.referentialEqualities)), n;
|
|
653
653
|
}
|
|
654
654
|
stringify(t) {
|
|
@@ -681,15 +681,22 @@ y.registerClass = y.defaultInstance.registerClass.bind(y.defaultInstance);
|
|
|
681
681
|
y.registerSymbol = y.defaultInstance.registerSymbol.bind(y.defaultInstance);
|
|
682
682
|
y.registerCustom = y.defaultInstance.registerCustom.bind(y.defaultInstance);
|
|
683
683
|
y.allowErrorProps = y.defaultInstance.allowErrorProps.bind(y.defaultInstance);
|
|
684
|
-
const P = (e) => e === void 0 ?
|
|
684
|
+
const P = (e) => e === void 0 ? z.None : e, W = (e) => {
|
|
685
|
+
var t, r;
|
|
686
|
+
return (r = (t = e.title) != null ? t : e.name) != null ? r : "";
|
|
687
|
+
}, Ks = (e) => new mr(e.metadataItem, e.type), Ie = (e) => new vr(
|
|
685
688
|
e.name,
|
|
686
689
|
e.expression,
|
|
687
690
|
e.type,
|
|
688
691
|
e.description,
|
|
689
692
|
P(e.sort),
|
|
690
693
|
e.dataSource,
|
|
691
|
-
e.composeCode
|
|
692
|
-
|
|
694
|
+
e.composeCode,
|
|
695
|
+
e.panel,
|
|
696
|
+
e.indexed,
|
|
697
|
+
e.merged,
|
|
698
|
+
W(e)
|
|
699
|
+
), ke = (e) => new Mr(
|
|
693
700
|
e.name,
|
|
694
701
|
e.expression,
|
|
695
702
|
e.granularity,
|
|
@@ -697,28 +704,33 @@ const P = (e) => e === void 0 ? U.None : e, Js = (e) => new dr(e.metadataItem, e
|
|
|
697
704
|
e.description,
|
|
698
705
|
P(e.sort),
|
|
699
706
|
e.dataSource,
|
|
700
|
-
e.composeCode
|
|
707
|
+
e.composeCode,
|
|
708
|
+
e.panel,
|
|
709
|
+
e.indexed,
|
|
710
|
+
e.merged,
|
|
711
|
+
W(e)
|
|
701
712
|
), v = (e) => {
|
|
702
713
|
switch (e.__serializable) {
|
|
703
714
|
case "DimensionalAttribute":
|
|
704
|
-
return Re(e);
|
|
705
|
-
case "DimensionalLevelAttribute":
|
|
706
715
|
return Ie(e);
|
|
716
|
+
case "DimensionalLevelAttribute":
|
|
717
|
+
return ke(e);
|
|
707
718
|
default:
|
|
708
719
|
return e;
|
|
709
720
|
}
|
|
710
|
-
},
|
|
721
|
+
}, Lt = (e) => new Rr(
|
|
711
722
|
e.name,
|
|
712
723
|
e.expression,
|
|
713
724
|
e.attributes.map(v),
|
|
714
|
-
e.dimensions.map(
|
|
725
|
+
e.dimensions.map(Gs),
|
|
715
726
|
e.type,
|
|
716
727
|
e.description,
|
|
717
728
|
P(e.sort),
|
|
718
729
|
e.dataSource,
|
|
719
730
|
e.composeCode,
|
|
720
|
-
e.defaultAttribute ? v(e.defaultAttribute) : void 0
|
|
721
|
-
|
|
731
|
+
e.defaultAttribute ? v(e.defaultAttribute) : void 0,
|
|
732
|
+
W(e)
|
|
733
|
+
), Bt = (e) => new Ir(
|
|
722
734
|
e.name,
|
|
723
735
|
e.expression,
|
|
724
736
|
e.description,
|
|
@@ -726,17 +738,18 @@ const P = (e) => e === void 0 ? U.None : e, Js = (e) => new dr(e.metadataItem, e
|
|
|
726
738
|
e.dataSource,
|
|
727
739
|
e.composeCode,
|
|
728
740
|
e.indexed,
|
|
729
|
-
e.merged
|
|
730
|
-
|
|
741
|
+
e.merged,
|
|
742
|
+
W(e)
|
|
743
|
+
), Gs = (e) => {
|
|
731
744
|
switch (e.__serializable) {
|
|
732
745
|
case "DimensionalDimension":
|
|
733
|
-
return kt(e);
|
|
734
|
-
case "DimensionalDateDimension":
|
|
735
746
|
return Lt(e);
|
|
747
|
+
case "DimensionalDateDimension":
|
|
748
|
+
return Bt(e);
|
|
736
749
|
default:
|
|
737
750
|
return e;
|
|
738
751
|
}
|
|
739
|
-
},
|
|
752
|
+
}, Le = (e) => new kr(
|
|
740
753
|
e.name,
|
|
741
754
|
v(e.attribute),
|
|
742
755
|
e.aggregation,
|
|
@@ -744,22 +757,23 @@ const P = (e) => e === void 0 ? U.None : e, Js = (e) => new dr(e.metadataItem, e
|
|
|
744
757
|
e.description,
|
|
745
758
|
P(e.sort),
|
|
746
759
|
e.dataSource,
|
|
747
|
-
e.composeCode
|
|
748
|
-
|
|
760
|
+
e.composeCode,
|
|
761
|
+
W(e)
|
|
762
|
+
), Be = (e) => {
|
|
749
763
|
const t = Object.fromEntries(
|
|
750
764
|
Object.entries(e.context).map(([r, s]) => {
|
|
751
765
|
if (s && typeof s == "object" && "__serializable" in s)
|
|
752
766
|
switch (s.__serializable) {
|
|
753
767
|
case "DimensionalAttribute":
|
|
754
|
-
return [r, Re(s)];
|
|
755
|
-
case "DimensionalLevelAttribute":
|
|
756
768
|
return [r, Ie(s)];
|
|
757
|
-
case "
|
|
769
|
+
case "DimensionalLevelAttribute":
|
|
758
770
|
return [r, ke(s)];
|
|
759
|
-
case "
|
|
771
|
+
case "DimensionalBaseMeasure":
|
|
760
772
|
return [r, Le(s)];
|
|
761
|
-
case "
|
|
773
|
+
case "DimensionalCalculatedMeasure":
|
|
762
774
|
return [r, Be(s)];
|
|
775
|
+
case "DimensionalMeasureTemplate":
|
|
776
|
+
return [r, _e(s)];
|
|
763
777
|
case "MembersFilter":
|
|
764
778
|
case "LogicalAttributeFilter":
|
|
765
779
|
case "CascadingFilter":
|
|
@@ -779,7 +793,7 @@ const P = (e) => e === void 0 ? U.None : e, Js = (e) => new dr(e.metadataItem, e
|
|
|
779
793
|
return [r, s];
|
|
780
794
|
})
|
|
781
795
|
);
|
|
782
|
-
return new
|
|
796
|
+
return new Lr(
|
|
783
797
|
e.name,
|
|
784
798
|
e.expression,
|
|
785
799
|
t,
|
|
@@ -787,60 +801,62 @@ const P = (e) => e === void 0 ? U.None : e, Js = (e) => new dr(e.metadataItem, e
|
|
|
787
801
|
e.description,
|
|
788
802
|
P(e.sort),
|
|
789
803
|
e.dataSource,
|
|
790
|
-
e.composeCode
|
|
804
|
+
e.composeCode,
|
|
805
|
+
W(e)
|
|
791
806
|
);
|
|
792
|
-
},
|
|
807
|
+
}, _e = (e) => new Br(
|
|
793
808
|
e.name,
|
|
794
809
|
v(e.attribute),
|
|
795
810
|
e.format,
|
|
796
811
|
e.description,
|
|
797
812
|
P(e.sort),
|
|
798
813
|
e.dataSource,
|
|
799
|
-
e.composeCode
|
|
800
|
-
|
|
814
|
+
e.composeCode,
|
|
815
|
+
W(e)
|
|
816
|
+
), Te = (e) => {
|
|
801
817
|
switch (e.__serializable) {
|
|
802
818
|
case "DimensionalBaseMeasure":
|
|
803
|
-
return ke(e);
|
|
804
|
-
case "DimensionalCalculatedMeasure":
|
|
805
819
|
return Le(e);
|
|
806
|
-
case "
|
|
820
|
+
case "DimensionalCalculatedMeasure":
|
|
807
821
|
return Be(e);
|
|
822
|
+
case "DimensionalMeasureTemplate":
|
|
823
|
+
return _e(e);
|
|
808
824
|
default:
|
|
809
825
|
return e;
|
|
810
826
|
}
|
|
811
827
|
}, S = (e) => {
|
|
812
828
|
switch (e.__serializable) {
|
|
813
829
|
case "MembersFilter":
|
|
814
|
-
return new
|
|
830
|
+
return new Hr(
|
|
815
831
|
v(e.attribute),
|
|
816
832
|
e.members,
|
|
817
833
|
e.config.backgroundFilter ? E(l({}, e.config), { backgroundFilter: S(e.config.backgroundFilter) }) : e.config,
|
|
818
834
|
e.composeCode
|
|
819
835
|
);
|
|
820
836
|
case "LogicalAttributeFilter":
|
|
821
|
-
return new
|
|
837
|
+
return new Yr(
|
|
822
838
|
e.filters.map((r) => S(r)),
|
|
823
839
|
e.operator,
|
|
824
840
|
e.config,
|
|
825
841
|
e.composeCode
|
|
826
842
|
);
|
|
827
843
|
case "CascadingFilter":
|
|
828
|
-
return new
|
|
844
|
+
return new Gr(
|
|
829
845
|
e._filters.map((r) => S(r)),
|
|
830
846
|
e.config,
|
|
831
847
|
e.composeCode
|
|
832
848
|
);
|
|
833
849
|
case "ExcludeFilter":
|
|
834
|
-
return new
|
|
850
|
+
return new Kr(
|
|
835
851
|
S(e.filter),
|
|
836
852
|
e.input ? S(e.input) : void 0,
|
|
837
853
|
e.config,
|
|
838
854
|
e.composeCode
|
|
839
855
|
);
|
|
840
856
|
case "MeasureFilter":
|
|
841
|
-
return new
|
|
857
|
+
return new Jr(
|
|
842
858
|
v(e.attribute),
|
|
843
|
-
|
|
859
|
+
Te(e.measure),
|
|
844
860
|
e.operatorA,
|
|
845
861
|
e.valueA,
|
|
846
862
|
e.operatorB,
|
|
@@ -849,24 +865,24 @@ const P = (e) => e === void 0 ? U.None : e, Js = (e) => new dr(e.metadataItem, e
|
|
|
849
865
|
e.composeCode
|
|
850
866
|
);
|
|
851
867
|
case "RankingFilter":
|
|
852
|
-
return new
|
|
868
|
+
return new jr(
|
|
853
869
|
v(e.attribute),
|
|
854
|
-
|
|
870
|
+
Te(e.measure),
|
|
855
871
|
e.operator,
|
|
856
872
|
e.count,
|
|
857
873
|
e.config,
|
|
858
874
|
e.composeCode
|
|
859
875
|
);
|
|
860
876
|
case "MeasureRankingFilter":
|
|
861
|
-
return new
|
|
862
|
-
|
|
877
|
+
return new Vr(
|
|
878
|
+
Te(e.measure),
|
|
863
879
|
e.operator,
|
|
864
880
|
e.count,
|
|
865
881
|
e.config,
|
|
866
882
|
e.composeCode
|
|
867
883
|
);
|
|
868
884
|
case "NumericFilter":
|
|
869
|
-
return new
|
|
885
|
+
return new Wr(
|
|
870
886
|
v(e.attribute),
|
|
871
887
|
e.operatorA,
|
|
872
888
|
e.valueA,
|
|
@@ -876,7 +892,7 @@ const P = (e) => e === void 0 ? U.None : e, Js = (e) => new dr(e.metadataItem, e
|
|
|
876
892
|
e.composeCode
|
|
877
893
|
);
|
|
878
894
|
case "TextFilter":
|
|
879
|
-
return new
|
|
895
|
+
return new Pr(
|
|
880
896
|
v(e.attribute),
|
|
881
897
|
e.operatorA,
|
|
882
898
|
e.valueA,
|
|
@@ -904,7 +920,7 @@ const P = (e) => e === void 0 ? U.None : e, Js = (e) => new dr(e.metadataItem, e
|
|
|
904
920
|
e.composeCode
|
|
905
921
|
);
|
|
906
922
|
case "CustomFilter":
|
|
907
|
-
return new
|
|
923
|
+
return new _r(
|
|
908
924
|
v(e.attribute),
|
|
909
925
|
e.jaqlExpression,
|
|
910
926
|
e.config,
|
|
@@ -916,71 +932,71 @@ const P = (e) => e === void 0 ? U.None : e, Js = (e) => new dr(e.metadataItem, e
|
|
|
916
932
|
};
|
|
917
933
|
y.registerCustom(
|
|
918
934
|
{
|
|
919
|
-
isApplicable:
|
|
935
|
+
isApplicable: dr,
|
|
920
936
|
serialize: (e) => e.serialize(),
|
|
921
|
-
deserialize: (e) =>
|
|
937
|
+
deserialize: (e) => Ks(e)
|
|
922
938
|
},
|
|
923
939
|
"JaqlElement"
|
|
924
940
|
);
|
|
925
941
|
y.registerCustom(
|
|
926
942
|
{
|
|
927
|
-
isApplicable:
|
|
943
|
+
isApplicable: pr,
|
|
928
944
|
serialize: (e) => e.serialize(),
|
|
929
|
-
deserialize: (e) =>
|
|
945
|
+
deserialize: (e) => Ie(e)
|
|
930
946
|
},
|
|
931
947
|
"DimensionalAttribute"
|
|
932
948
|
);
|
|
933
949
|
y.registerCustom(
|
|
934
950
|
{
|
|
935
|
-
isApplicable:
|
|
951
|
+
isApplicable: gr,
|
|
936
952
|
serialize: (e) => e.serialize(),
|
|
937
|
-
deserialize: (e) =>
|
|
953
|
+
deserialize: (e) => ke(e)
|
|
938
954
|
},
|
|
939
955
|
"DimensionalLevelAttribute"
|
|
940
956
|
);
|
|
941
957
|
y.registerCustom(
|
|
942
958
|
{
|
|
943
|
-
isApplicable:
|
|
959
|
+
isApplicable: yr,
|
|
944
960
|
serialize: (e) => e.serialize(),
|
|
945
|
-
deserialize: (e) =>
|
|
961
|
+
deserialize: (e) => Lt(e)
|
|
946
962
|
},
|
|
947
963
|
"DimensionalDimension"
|
|
948
964
|
);
|
|
949
965
|
y.registerCustom(
|
|
950
966
|
{
|
|
951
|
-
isApplicable:
|
|
967
|
+
isApplicable: hr,
|
|
952
968
|
serialize: (e) => e.serialize(),
|
|
953
|
-
deserialize: (e) =>
|
|
969
|
+
deserialize: (e) => Bt(e)
|
|
954
970
|
},
|
|
955
971
|
"DimensionalDateDimension"
|
|
956
972
|
);
|
|
957
973
|
y.registerCustom(
|
|
958
974
|
{
|
|
959
|
-
isApplicable:
|
|
975
|
+
isApplicable: br,
|
|
960
976
|
serialize: (e) => e.serialize(),
|
|
961
|
-
deserialize: (e) =>
|
|
977
|
+
deserialize: (e) => Le(e)
|
|
962
978
|
},
|
|
963
979
|
"DimensionalBaseMeasure"
|
|
964
980
|
);
|
|
965
981
|
y.registerCustom(
|
|
966
982
|
{
|
|
967
|
-
isApplicable:
|
|
983
|
+
isApplicable: Fr,
|
|
968
984
|
serialize: (e) => e.serialize(),
|
|
969
|
-
deserialize: (e) =>
|
|
985
|
+
deserialize: (e) => Be(e)
|
|
970
986
|
},
|
|
971
987
|
"DimensionalCalculatedMeasure"
|
|
972
988
|
);
|
|
973
989
|
y.registerCustom(
|
|
974
990
|
{
|
|
975
|
-
isApplicable:
|
|
991
|
+
isApplicable: Er,
|
|
976
992
|
serialize: (e) => e.serialize(),
|
|
977
|
-
deserialize: (e) =>
|
|
993
|
+
deserialize: (e) => _e(e)
|
|
978
994
|
},
|
|
979
995
|
"DimensionalMeasureTemplate"
|
|
980
996
|
);
|
|
981
997
|
y.registerCustom(
|
|
982
998
|
{
|
|
983
|
-
isApplicable:
|
|
999
|
+
isApplicable: Me,
|
|
984
1000
|
serialize: (e) => e.serialize(),
|
|
985
1001
|
deserialize: (e) => S(e)
|
|
986
1002
|
},
|
|
@@ -988,7 +1004,7 @@ y.registerCustom(
|
|
|
988
1004
|
);
|
|
989
1005
|
y.registerCustom(
|
|
990
1006
|
{
|
|
991
|
-
isApplicable:
|
|
1007
|
+
isApplicable: Ar,
|
|
992
1008
|
serialize: (e) => e.serialize(),
|
|
993
1009
|
deserialize: (e) => S(e)
|
|
994
1010
|
},
|
|
@@ -996,7 +1012,7 @@ y.registerCustom(
|
|
|
996
1012
|
);
|
|
997
1013
|
y.registerCustom(
|
|
998
1014
|
{
|
|
999
|
-
isApplicable:
|
|
1015
|
+
isApplicable: Tr,
|
|
1000
1016
|
serialize: (e) => e.serialize(),
|
|
1001
1017
|
deserialize: (e) => S(e)
|
|
1002
1018
|
},
|
|
@@ -1004,7 +1020,7 @@ y.registerCustom(
|
|
|
1004
1020
|
);
|
|
1005
1021
|
y.registerCustom(
|
|
1006
1022
|
{
|
|
1007
|
-
isApplicable:
|
|
1023
|
+
isApplicable: wr,
|
|
1008
1024
|
serialize: (e) => e.serialize(),
|
|
1009
1025
|
deserialize: (e) => S(e)
|
|
1010
1026
|
},
|
|
@@ -1012,7 +1028,7 @@ y.registerCustom(
|
|
|
1012
1028
|
);
|
|
1013
1029
|
y.registerCustom(
|
|
1014
1030
|
{
|
|
1015
|
-
isApplicable:
|
|
1031
|
+
isApplicable: Sr,
|
|
1016
1032
|
serialize: (e) => e.serialize(),
|
|
1017
1033
|
deserialize: (e) => S(e)
|
|
1018
1034
|
},
|
|
@@ -1020,7 +1036,7 @@ y.registerCustom(
|
|
|
1020
1036
|
);
|
|
1021
1037
|
y.registerCustom(
|
|
1022
1038
|
{
|
|
1023
|
-
isApplicable:
|
|
1039
|
+
isApplicable: Cr,
|
|
1024
1040
|
serialize: (e) => e.serialize(),
|
|
1025
1041
|
deserialize: (e) => S(e)
|
|
1026
1042
|
},
|
|
@@ -1028,7 +1044,7 @@ y.registerCustom(
|
|
|
1028
1044
|
);
|
|
1029
1045
|
y.registerCustom(
|
|
1030
1046
|
{
|
|
1031
|
-
isApplicable:
|
|
1047
|
+
isApplicable: Or,
|
|
1032
1048
|
serialize: (e) => e.serialize(),
|
|
1033
1049
|
deserialize: (e) => S(e)
|
|
1034
1050
|
},
|
|
@@ -1036,7 +1052,7 @@ y.registerCustom(
|
|
|
1036
1052
|
);
|
|
1037
1053
|
y.registerCustom(
|
|
1038
1054
|
{
|
|
1039
|
-
isApplicable:
|
|
1055
|
+
isApplicable: $r,
|
|
1040
1056
|
serialize: (e) => e.serialize(),
|
|
1041
1057
|
deserialize: (e) => S(e)
|
|
1042
1058
|
},
|
|
@@ -1052,7 +1068,7 @@ y.registerCustom(
|
|
|
1052
1068
|
);
|
|
1053
1069
|
y.registerCustom(
|
|
1054
1070
|
{
|
|
1055
|
-
isApplicable:
|
|
1071
|
+
isApplicable: Dr,
|
|
1056
1072
|
serialize: (e) => e.serialize(),
|
|
1057
1073
|
deserialize: (e) => S(e)
|
|
1058
1074
|
},
|
|
@@ -1060,7 +1076,7 @@ y.registerCustom(
|
|
|
1060
1076
|
);
|
|
1061
1077
|
y.registerCustom(
|
|
1062
1078
|
{
|
|
1063
|
-
isApplicable:
|
|
1079
|
+
isApplicable: xr,
|
|
1064
1080
|
serialize: (e) => e.serialize(),
|
|
1065
1081
|
deserialize: (e) => S(e)
|
|
1066
1082
|
},
|
|
@@ -1068,55 +1084,55 @@ y.registerCustom(
|
|
|
1068
1084
|
);
|
|
1069
1085
|
y.registerCustom(
|
|
1070
1086
|
{
|
|
1071
|
-
isApplicable:
|
|
1087
|
+
isApplicable: Nr,
|
|
1072
1088
|
serialize: (e) => e.serialize(),
|
|
1073
1089
|
deserialize: (e) => S(e)
|
|
1074
1090
|
},
|
|
1075
1091
|
"CustomFilter"
|
|
1076
1092
|
);
|
|
1077
|
-
const
|
|
1078
|
-
function
|
|
1093
|
+
const Ui = y, T = "DM.";
|
|
1094
|
+
function q(e) {
|
|
1079
1095
|
return typeof e == "object" && e !== null;
|
|
1080
1096
|
}
|
|
1081
1097
|
function w(e) {
|
|
1082
1098
|
return typeof e == "object" && e !== null && "function" in e && "args" in e;
|
|
1083
1099
|
}
|
|
1084
|
-
function
|
|
1100
|
+
function _t(e) {
|
|
1085
1101
|
return Array.isArray(e) && e.every(w);
|
|
1086
1102
|
}
|
|
1087
|
-
function
|
|
1103
|
+
function ge(e) {
|
|
1088
1104
|
return "attribute" in e && "config" in e;
|
|
1089
1105
|
}
|
|
1090
|
-
function
|
|
1106
|
+
function H(e) {
|
|
1091
1107
|
return "left" in e && "right" in e && "operator" in e;
|
|
1092
1108
|
}
|
|
1093
1109
|
function ze(e) {
|
|
1094
|
-
return !
|
|
1110
|
+
return !ge(e) && !H(e);
|
|
1095
1111
|
}
|
|
1096
1112
|
function zt(e) {
|
|
1097
|
-
return
|
|
1113
|
+
return q(e) && "column" in e && typeof e.column == "string" && !("function" in e && "args" in e);
|
|
1098
1114
|
}
|
|
1099
1115
|
function Ut(e) {
|
|
1100
|
-
return
|
|
1116
|
+
return !q(e) || !("column" in e) ? !1 : w(e.column);
|
|
1101
1117
|
}
|
|
1102
1118
|
const C = 3;
|
|
1103
1119
|
function x(e, t, r) {
|
|
1104
1120
|
if (t.length === 0) return;
|
|
1105
1121
|
let s = Number.MAX_SAFE_INTEGER, n;
|
|
1106
1122
|
for (const i of t) {
|
|
1107
|
-
const a = r(i), o =
|
|
1123
|
+
const a = r(i), o = ds(e, a);
|
|
1108
1124
|
o < s && (s = o, n = i);
|
|
1109
1125
|
}
|
|
1110
1126
|
return n !== void 0 ? { best: n, distance: s } : void 0;
|
|
1111
1127
|
}
|
|
1112
|
-
const
|
|
1113
|
-
function
|
|
1114
|
-
return e.localeCompare(t,
|
|
1128
|
+
const Pt = "en";
|
|
1129
|
+
function we(e, t) {
|
|
1130
|
+
return e.localeCompare(t, Pt, { sensitivity: "accent" }) === 0;
|
|
1115
1131
|
}
|
|
1116
|
-
function
|
|
1117
|
-
return t.length <= e.length && e.slice(0, t.length).localeCompare(t,
|
|
1132
|
+
function et(e, t) {
|
|
1133
|
+
return t.length <= e.length && e.slice(0, t.length).localeCompare(t, Pt, { sensitivity: "accent" }) === 0;
|
|
1118
1134
|
}
|
|
1119
|
-
function
|
|
1135
|
+
function ne(e) {
|
|
1120
1136
|
const t = [...e].sort((i, a) => a.name.length - i.name.length), r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
1121
1137
|
for (const i of e) {
|
|
1122
1138
|
r.set(i.name, i);
|
|
@@ -1146,7 +1162,7 @@ function Ue(e, t) {
|
|
|
1146
1162
|
);
|
|
1147
1163
|
let s, n;
|
|
1148
1164
|
for (const m of t.sortedTables)
|
|
1149
|
-
if (
|
|
1165
|
+
if (et(r, m.name + ".")) {
|
|
1150
1166
|
const F = r.slice(m.name.length + 1);
|
|
1151
1167
|
if (!F)
|
|
1152
1168
|
throw new Error(
|
|
@@ -1161,23 +1177,23 @@ function Ue(e, t) {
|
|
|
1161
1177
|
throw new Error(
|
|
1162
1178
|
`Invalid dimensional element name format: '${e}'. Expected format: '${T}TableName.ColumnName[.Level]'`
|
|
1163
1179
|
);
|
|
1164
|
-
const F = r.slice(0, m), O = x(F, t.sortedTables, (
|
|
1180
|
+
const F = r.slice(0, m), O = x(F, t.sortedTables, (V) => V.name), N = O && O.distance <= C ? ` Did you mean '${O.best.name}'?` : "";
|
|
1165
1181
|
throw new Error(`Table '${F}' not found in the data model.${N}`);
|
|
1166
1182
|
}
|
|
1167
1183
|
const i = t.tableColumnMap.get(s.name);
|
|
1168
1184
|
if (!i)
|
|
1169
1185
|
throw new Error(`Table '${s.name}' found but has no columns`);
|
|
1170
1186
|
let a, o;
|
|
1171
|
-
const u =
|
|
1187
|
+
const u = $.all;
|
|
1172
1188
|
for (const m of i) {
|
|
1173
|
-
if (
|
|
1189
|
+
if (we(n, m.name))
|
|
1174
1190
|
return { table: s, column: m };
|
|
1175
|
-
if (!
|
|
1191
|
+
if (!et(n, m.name + "."))
|
|
1176
1192
|
continue;
|
|
1177
1193
|
const F = n.slice(m.name.length + 1);
|
|
1178
1194
|
if (!F)
|
|
1179
1195
|
continue;
|
|
1180
|
-
const O = u.includes(F), N =
|
|
1196
|
+
const O = u.includes(F), N = se(m.dataType);
|
|
1181
1197
|
if (O) {
|
|
1182
1198
|
if (N)
|
|
1183
1199
|
return { table: s, column: m, level: F };
|
|
@@ -1198,31 +1214,31 @@ function Ue(e, t) {
|
|
|
1198
1214
|
)}.${F}`
|
|
1199
1215
|
);
|
|
1200
1216
|
}
|
|
1201
|
-
const c = n.indexOf("."), g = c === -1 ? n : n.slice(0, c), f = x(n, i, (m) => m.name), p = f && f.distance <= C && !
|
|
1217
|
+
const c = n.indexOf("."), g = c === -1 ? n : n.slice(0, c), f = x(n, i, (m) => m.name), p = f && f.distance <= C && !we(f.best.name, g), h = p ? ` Did you mean '${f.best.name}'?` : "", b = !p && n.endsWith(".") && f !== void 0 && we(f.best.name, g) ? ` Use '${g}' without a trailing dot.` : "";
|
|
1202
1218
|
throw new Error(
|
|
1203
1219
|
`Column '${g}' not found in table '${s.name}'.${h}${b}`
|
|
1204
1220
|
);
|
|
1205
1221
|
}
|
|
1206
|
-
function
|
|
1222
|
+
function Ys(e, t) {
|
|
1207
1223
|
const { table: r, column: s, level: n } = Ue(e, t);
|
|
1208
1224
|
if (n) {
|
|
1209
|
-
if (!
|
|
1225
|
+
if (!se(s.dataType))
|
|
1210
1226
|
throw new Error(
|
|
1211
1227
|
`Invalid date level '${n}' in dimensional element '${e}'. Column '${r.name}.${s.name}' is not a datetime column`
|
|
1212
1228
|
);
|
|
1213
|
-
const i =
|
|
1229
|
+
const i = $.all;
|
|
1214
1230
|
if (!i.includes(n))
|
|
1215
1231
|
throw new Error(
|
|
1216
1232
|
`Invalid date level '${n}' in dimensional element '${e}'. Valid levels are: ${i.join(
|
|
1217
1233
|
", "
|
|
1218
1234
|
)}`
|
|
1219
1235
|
);
|
|
1220
|
-
const a =
|
|
1236
|
+
const a = $.dateOnly;
|
|
1221
1237
|
if (s.dataType === "date" && !a.includes(n))
|
|
1222
1238
|
throw new Error(
|
|
1223
1239
|
`Invalid level '${n}' in dimensional element '${e}'. Column '${r.name}.${s.name}' is only a date column, not a datetime column`
|
|
1224
1240
|
);
|
|
1225
|
-
const o =
|
|
1241
|
+
const o = $.timeOnly;
|
|
1226
1242
|
if (s.dataType === "time" && !o.includes(n))
|
|
1227
1243
|
throw new Error(
|
|
1228
1244
|
`Invalid level '${n}' in dimensional element '${e}'. Column '${r.name}.${s.name}' is only a time column, not a date column`
|
|
@@ -1230,28 +1246,28 @@ function Gs(e, t) {
|
|
|
1230
1246
|
}
|
|
1231
1247
|
return { table: r, column: s, level: n };
|
|
1232
1248
|
}
|
|
1233
|
-
function
|
|
1234
|
-
const { table: n, column: i, level: a } =
|
|
1249
|
+
function re(e, t, r, s) {
|
|
1250
|
+
const { table: n, column: i, level: a } = Ys(e, r);
|
|
1235
1251
|
let o = a;
|
|
1236
|
-
if (
|
|
1237
|
-
const u = s.inferredDateLevel, c =
|
|
1252
|
+
if (se(i.dataType) && o === void 0 && (s != null && s.inferredDateLevel)) {
|
|
1253
|
+
const u = s.inferredDateLevel, c = $.all;
|
|
1238
1254
|
if (!c.includes(u))
|
|
1239
1255
|
throw new Error(
|
|
1240
1256
|
`Invalid inferred date level '${u}'. Valid levels are: ${c.join(", ")}`
|
|
1241
1257
|
);
|
|
1242
|
-
const g = `${e}.${u}`, f =
|
|
1258
|
+
const g = `${e}.${u}`, f = $.dateOnly;
|
|
1243
1259
|
if (i.dataType === "date" && !f.includes(u))
|
|
1244
1260
|
throw new Error(
|
|
1245
1261
|
`Invalid level '${u}' in dimensional element '${g}'. Column '${n.name}.${i.name}' is only a date column, not a datetime column`
|
|
1246
1262
|
);
|
|
1247
|
-
const p =
|
|
1263
|
+
const p = $.timeOnly;
|
|
1248
1264
|
if (i.dataType === "time" && !p.includes(u))
|
|
1249
1265
|
throw new Error(
|
|
1250
1266
|
`Invalid level '${u}' in dimensional element '${g}'. Column '${n.name}.${i.name}' is only a time column, not a date column`
|
|
1251
1267
|
);
|
|
1252
1268
|
o = u;
|
|
1253
1269
|
}
|
|
1254
|
-
return
|
|
1270
|
+
return Qr({
|
|
1255
1271
|
expression: i.expression,
|
|
1256
1272
|
dataType: i.dataType,
|
|
1257
1273
|
granularity: o,
|
|
@@ -1260,44 +1276,44 @@ function ee(e, t, r, s) {
|
|
|
1260
1276
|
dataSource: t
|
|
1261
1277
|
});
|
|
1262
1278
|
}
|
|
1263
|
-
function
|
|
1279
|
+
function Hs(e, t, r) {
|
|
1264
1280
|
const { column: s, level: n } = Ue(e, r);
|
|
1265
1281
|
if (n)
|
|
1266
1282
|
throw new Error(
|
|
1267
1283
|
`Invalid DateDimension name format: '${e}'. Expected format: '${T}TableName.ColumnName'`
|
|
1268
1284
|
);
|
|
1269
|
-
if (!
|
|
1285
|
+
if (!se(s.dataType))
|
|
1270
1286
|
throw new Error(
|
|
1271
1287
|
`Invalid DateDimension name '${e}'. Column '${s.name}' is not a datetime column (got ${s.dataType}).`
|
|
1272
1288
|
);
|
|
1273
|
-
return
|
|
1289
|
+
return Xr({
|
|
1274
1290
|
name: s.name,
|
|
1275
1291
|
expression: s.expression,
|
|
1276
1292
|
dataSource: t
|
|
1277
1293
|
});
|
|
1278
1294
|
}
|
|
1279
|
-
const
|
|
1295
|
+
const Qs = (e, t) => {
|
|
1280
1296
|
if (!e) return;
|
|
1281
1297
|
const r = typeof e == "object" ? e.direction : e;
|
|
1282
|
-
if (!
|
|
1298
|
+
if (!gt(r))
|
|
1283
1299
|
return E(l({}, t), {
|
|
1284
1300
|
message: `Invalid sort type. Expected 'sortAsc', 'sortDesc', or 'sortNone'. Got: '${r}'.`
|
|
1285
1301
|
});
|
|
1286
|
-
},
|
|
1287
|
-
const n =
|
|
1302
|
+
}, Xs = (e, t, r, s) => {
|
|
1303
|
+
const n = Qs(e.sortType, s);
|
|
1288
1304
|
if (n)
|
|
1289
1305
|
return {
|
|
1290
|
-
attribute:
|
|
1306
|
+
attribute: re(e.column, t, r),
|
|
1291
1307
|
style: {},
|
|
1292
1308
|
error: n
|
|
1293
1309
|
};
|
|
1294
|
-
const i =
|
|
1310
|
+
const i = re(e.column, t, r), a = U(e, "column");
|
|
1295
1311
|
return { attribute: i, style: a };
|
|
1296
|
-
},
|
|
1312
|
+
}, Zs = (e, t, r, s) => typeof e == "string" ? { attribute: re(e, t, r) } : zt(e) ? Xs(e, t, r, s) : {
|
|
1297
1313
|
error: E(l({}, s), {
|
|
1298
1314
|
message: "Invalid dimension item. Expected a string (composeCode) or object with 'column' and optional 'sortType'."
|
|
1299
1315
|
})
|
|
1300
|
-
},
|
|
1316
|
+
}, Wt = (e) => {
|
|
1301
1317
|
const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context;
|
|
1302
1318
|
if (!t)
|
|
1303
1319
|
return { success: !0, data: [] };
|
|
@@ -1319,7 +1335,7 @@ const Hs = (e, t) => {
|
|
|
1319
1335
|
input: a
|
|
1320
1336
|
};
|
|
1321
1337
|
try {
|
|
1322
|
-
const c =
|
|
1338
|
+
const c = Zs(a, r, s, u);
|
|
1323
1339
|
if (c.error) {
|
|
1324
1340
|
i.push(c.error);
|
|
1325
1341
|
return;
|
|
@@ -1333,43 +1349,43 @@ const Hs = (e, t) => {
|
|
|
1333
1349
|
}
|
|
1334
1350
|
}), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: n };
|
|
1335
1351
|
};
|
|
1336
|
-
function
|
|
1352
|
+
function Pe(e, t) {
|
|
1337
1353
|
const r = Reflect.get(e, t);
|
|
1338
1354
|
if (typeof r != "function")
|
|
1339
1355
|
throw new Error(`Function '${t}' not found or is not a function`);
|
|
1340
1356
|
return r;
|
|
1341
1357
|
}
|
|
1342
|
-
function
|
|
1343
|
-
const r = e.replace("measureFactory.", ""), n =
|
|
1358
|
+
function en(e, t) {
|
|
1359
|
+
const r = e.replace("measureFactory.", ""), n = Pe(Zr, r)(...t);
|
|
1344
1360
|
if (!ze(n))
|
|
1345
1361
|
throw new Error(`Function '${e}' did not return a valid Measure`);
|
|
1346
1362
|
return n;
|
|
1347
1363
|
}
|
|
1348
|
-
function
|
|
1349
|
-
const r = e.replace("filterFactory.logic.", ""), n =
|
|
1350
|
-
if (!
|
|
1364
|
+
function tn(e, t) {
|
|
1365
|
+
const r = e.replace("filterFactory.logic.", ""), n = Pe(es, r)(...t);
|
|
1366
|
+
if (!H(n))
|
|
1351
1367
|
throw new Error(`Function '${e}' did not return a valid FilterRelations`);
|
|
1352
1368
|
return n;
|
|
1353
1369
|
}
|
|
1354
|
-
function
|
|
1370
|
+
function rn(e, t) {
|
|
1355
1371
|
if (e.startsWith("filterFactory.logic."))
|
|
1356
|
-
return
|
|
1357
|
-
const r = e.replace("filterFactory.", ""), n =
|
|
1358
|
-
if (!
|
|
1372
|
+
return tn(e, t);
|
|
1373
|
+
const r = e.replace("filterFactory.", ""), n = Pe(ts, r)(...t);
|
|
1374
|
+
if (!ge(n) && !H(n))
|
|
1359
1375
|
throw new Error(`Function '${e}' did not return a valid Filter or FilterRelations`);
|
|
1360
1376
|
return n;
|
|
1361
1377
|
}
|
|
1362
|
-
function
|
|
1378
|
+
function sn(e, t) {
|
|
1363
1379
|
const s = e.split(".")[0];
|
|
1364
1380
|
if (s === "measureFactory")
|
|
1365
|
-
return
|
|
1381
|
+
return en(e, t);
|
|
1366
1382
|
if (s === "filterFactory")
|
|
1367
|
-
return
|
|
1383
|
+
return rn(e, t);
|
|
1368
1384
|
throw new Error(
|
|
1369
1385
|
`Unsupported factory: '${s}'. Supported factories: measureFactory, filterFactory`
|
|
1370
1386
|
);
|
|
1371
1387
|
}
|
|
1372
|
-
const d = (e, t, r, s) => l({ category: e, minArgs: t, maxArgs: r }, s),
|
|
1388
|
+
const d = (e, t, r, s) => l({ category: e, minArgs: t, maxArgs: r }, s), nn = /* @__PURE__ */ new Set([
|
|
1373
1389
|
"CORREL",
|
|
1374
1390
|
"COVARP",
|
|
1375
1391
|
"COVAR",
|
|
@@ -1388,34 +1404,34 @@ const d = (e, t, r, s) => l({ category: e, minArgs: t, maxArgs: r }, s), sn = /*
|
|
|
1388
1404
|
"ORDERING",
|
|
1389
1405
|
"RDOUBLE",
|
|
1390
1406
|
"RINT"
|
|
1391
|
-
]),
|
|
1407
|
+
]), le = {
|
|
1392
1408
|
// ── X-diff (datetime difference operators) ──
|
|
1393
1409
|
SDIFF: d("xdiff", 2, 2, {
|
|
1394
|
-
requiredDateLevel:
|
|
1410
|
+
requiredDateLevel: $.Seconds,
|
|
1395
1411
|
argType: "datetime"
|
|
1396
1412
|
}),
|
|
1397
1413
|
MNDIFF: d("xdiff", 2, 2, {
|
|
1398
|
-
requiredDateLevel:
|
|
1414
|
+
requiredDateLevel: $.Minutes,
|
|
1399
1415
|
argType: "datetime"
|
|
1400
1416
|
}),
|
|
1401
1417
|
HDIFF: d("xdiff", 2, 2, {
|
|
1402
|
-
requiredDateLevel:
|
|
1418
|
+
requiredDateLevel: $.Hours,
|
|
1403
1419
|
argType: "datetime"
|
|
1404
1420
|
}),
|
|
1405
1421
|
DDIFF: d("xdiff", 2, 2, {
|
|
1406
|
-
requiredDateLevel:
|
|
1422
|
+
requiredDateLevel: $.Days,
|
|
1407
1423
|
argType: "datetime"
|
|
1408
1424
|
}),
|
|
1409
1425
|
MDIFF: d("xdiff", 2, 2, {
|
|
1410
|
-
requiredDateLevel:
|
|
1426
|
+
requiredDateLevel: $.Months,
|
|
1411
1427
|
argType: "datetime"
|
|
1412
1428
|
}),
|
|
1413
1429
|
QDIFF: d("xdiff", 2, 2, {
|
|
1414
|
-
requiredDateLevel:
|
|
1430
|
+
requiredDateLevel: $.Quarters,
|
|
1415
1431
|
argType: "datetime"
|
|
1416
1432
|
}),
|
|
1417
1433
|
YDIFF: d("xdiff", 2, 2, {
|
|
1418
|
-
requiredDateLevel:
|
|
1434
|
+
requiredDateLevel: $.Years,
|
|
1419
1435
|
argType: "datetime"
|
|
1420
1436
|
}),
|
|
1421
1437
|
// ── Aggregation ──
|
|
@@ -1499,20 +1515,20 @@ const d = (e, t, r, s) => l({ category: e, minArgs: t, maxArgs: r }, s), sn = /*
|
|
|
1499
1515
|
SIN: d("scalar", 1, 1),
|
|
1500
1516
|
SQRT: d("scalar", 1, 1),
|
|
1501
1517
|
TAN: d("scalar", 1, 1)
|
|
1502
|
-
},
|
|
1503
|
-
(e) =>
|
|
1518
|
+
}, an = Object.keys(le).filter(
|
|
1519
|
+
(e) => le[e].category === "xdiff"
|
|
1504
1520
|
);
|
|
1505
|
-
function
|
|
1506
|
-
return
|
|
1521
|
+
function Vt() {
|
|
1522
|
+
return an;
|
|
1507
1523
|
}
|
|
1508
|
-
function
|
|
1509
|
-
const t =
|
|
1524
|
+
function jt(e) {
|
|
1525
|
+
const t = le[e.toUpperCase()];
|
|
1510
1526
|
return t == null ? void 0 : t.requiredDateLevel;
|
|
1511
1527
|
}
|
|
1512
|
-
function
|
|
1528
|
+
function on(e, t) {
|
|
1513
1529
|
return e === t ? e === 1 ? "1 parameter" : `${e} parameters` : t === Number.POSITIVE_INFINITY ? e <= 1 ? "any number of parameters" : `at least ${e} parameters` : `${e} or ${t} parameters`;
|
|
1514
1530
|
}
|
|
1515
|
-
const
|
|
1531
|
+
const un = /\[(\w[\w.-]*)\]/g, Jt = /* @__PURE__ */ new Set([
|
|
1516
1532
|
// Universal – Aggregative (per Sisense doc: (A) only; Statistical CONTRIBUTION, PERCENTILE, etc. are non-aggregative)
|
|
1517
1533
|
"AVG",
|
|
1518
1534
|
"COUNT",
|
|
@@ -1533,30 +1549,30 @@ const on = /\[(\w[\w.-]*)\]/g, jt = /* @__PURE__ */ new Set([
|
|
|
1533
1549
|
"YTDSUM"
|
|
1534
1550
|
// RAVG, RSUM are non-aggregative per Sisense doc (Other Functions, not (A))
|
|
1535
1551
|
// CORREL, COVAR*, SKEW*, SLOPE, LARGEST are unsupported in custom formulas (see UNSUPPORTED_FORMULA_FUNCTIONS).
|
|
1536
|
-
]),
|
|
1537
|
-
`\\b(${Array.from(
|
|
1552
|
+
]), cn = new RegExp(
|
|
1553
|
+
`\\b(${Array.from(Jt).join("|")})\\s*\\(`,
|
|
1538
1554
|
"i"
|
|
1539
1555
|
);
|
|
1540
|
-
function
|
|
1541
|
-
return w(e) ? !0 : typeof e == "string" && e.startsWith(T) ? !1 :
|
|
1556
|
+
function Kt(e) {
|
|
1557
|
+
return w(e) ? !0 : typeof e == "string" && e.startsWith(T) ? !1 : q(e) && "kind" in e ? e.kind === "measure" : !0;
|
|
1542
1558
|
}
|
|
1543
|
-
function
|
|
1559
|
+
function ln(e) {
|
|
1544
1560
|
const t = /\b(\w+)\s*\(/g, r = /* @__PURE__ */ new Set();
|
|
1545
1561
|
let s;
|
|
1546
1562
|
for (; (s = t.exec(e)) !== null; ) {
|
|
1547
1563
|
const n = s[1];
|
|
1548
|
-
|
|
1564
|
+
Jt.has(n.toUpperCase()) || r.add(n);
|
|
1549
1565
|
}
|
|
1550
1566
|
return Array.from(r);
|
|
1551
1567
|
}
|
|
1552
|
-
function
|
|
1568
|
+
function fn(e) {
|
|
1553
1569
|
return e.length === 1 ? `[${e[0]}]` : e.map((t) => `[${t}]`).join(", ");
|
|
1554
1570
|
}
|
|
1555
|
-
function
|
|
1571
|
+
function dn(e) {
|
|
1556
1572
|
return e.length === 0 ? "" : e.length === 1 ? `${e[0]} is not an aggregative function. ` : `${e.join(", ")} are not aggregative functions. `;
|
|
1557
1573
|
}
|
|
1558
|
-
const
|
|
1559
|
-
function
|
|
1574
|
+
const Y = (e) => e.startsWith("[") ? e : `[${e}]`, Gt = (e) => e.startsWith("[") && e.endsWith("]") ? e.slice(1, -1) : e;
|
|
1575
|
+
function Yt(e, t) {
|
|
1560
1576
|
if (t.length === 0) return [];
|
|
1561
1577
|
const r = t.map((n) => n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|"), s = new RegExp(
|
|
1562
1578
|
`\\b(${r})\\s*\\(\\s*\\[([^\\]]+)\\]\\s*,\\s*\\[([^\\]]+)\\]\\s*\\)`,
|
|
@@ -1568,14 +1584,14 @@ function Gt(e, t) {
|
|
|
1568
1584
|
ref2: n[3].trim()
|
|
1569
1585
|
}));
|
|
1570
1586
|
}
|
|
1571
|
-
function
|
|
1587
|
+
function mn(e, t, r) {
|
|
1572
1588
|
var a, o, u;
|
|
1573
1589
|
const s = Object.keys(t), n = ((a = r.errorPrefix) != null ? a : "customFormula validation").trim(), i = n === "" ? "" : n.endsWith(" ") ? n : `${n} `;
|
|
1574
1590
|
return {
|
|
1575
1591
|
formula: e,
|
|
1576
1592
|
context: t,
|
|
1577
1593
|
contextKeys: s,
|
|
1578
|
-
canonicalContextKeys: new Set(s.map(
|
|
1594
|
+
canonicalContextKeys: new Set(s.map(Y)),
|
|
1579
1595
|
errorPrefix: i,
|
|
1580
1596
|
warnUnusedContext: (o = r.warnUnusedContext) != null ? o : !0,
|
|
1581
1597
|
errorOnUnusedContext: (u = r.errorOnUnusedContext) != null ? u : !0,
|
|
@@ -1586,17 +1602,17 @@ function dn(e, t, r) {
|
|
|
1586
1602
|
function R(e, t) {
|
|
1587
1603
|
e.result.errors.push(t), e.result.isValid = !1;
|
|
1588
1604
|
}
|
|
1589
|
-
const
|
|
1590
|
-
function
|
|
1605
|
+
const pn = /* @__PURE__ */ new Set(["CASE", "WHEN", "THEN", "ELSE", "END", "AND", "OR"]);
|
|
1606
|
+
function gn(e) {
|
|
1591
1607
|
const t = /\b(\w+)\s*\[/gi, r = [...e.formula.matchAll(t)].find(
|
|
1592
|
-
(s) => !
|
|
1608
|
+
(s) => !pn.has(s[1].toUpperCase())
|
|
1593
1609
|
);
|
|
1594
1610
|
r && R(
|
|
1595
1611
|
e,
|
|
1596
1612
|
`${e.errorPrefix}args[1]: Invalid syntax: '${r[1]}' - operator cannot be used before bracket reference without parentheses`
|
|
1597
1613
|
);
|
|
1598
1614
|
}
|
|
1599
|
-
function
|
|
1615
|
+
function yn(e, t) {
|
|
1600
1616
|
const r = e[t];
|
|
1601
1617
|
let s = t + 1;
|
|
1602
1618
|
for (; s < e.length; ) {
|
|
@@ -1613,27 +1629,27 @@ function gn(e, t) {
|
|
|
1613
1629
|
}
|
|
1614
1630
|
return e.length;
|
|
1615
1631
|
}
|
|
1616
|
-
function
|
|
1617
|
-
return
|
|
1632
|
+
function hn(e) {
|
|
1633
|
+
return Re(e, ",").filter((t) => t.trim().length > 0).length;
|
|
1618
1634
|
}
|
|
1619
|
-
function
|
|
1635
|
+
function bn(e, t, r, s) {
|
|
1620
1636
|
for (; t < e.length && /\s/.test(e[t]); )
|
|
1621
1637
|
t++;
|
|
1622
1638
|
if (e[t] !== "(")
|
|
1623
1639
|
return t;
|
|
1624
|
-
const n = t, i =
|
|
1640
|
+
const n = t, i = ps(e, n);
|
|
1625
1641
|
if (i === -1)
|
|
1626
1642
|
return n + 1;
|
|
1627
1643
|
const a = e.slice(n + 1, i);
|
|
1628
|
-
return s.push({ name: r.toUpperCase(), argCount:
|
|
1644
|
+
return s.push({ name: r.toUpperCase(), argCount: hn(a) }), s.push(...Ht(a)), i + 1;
|
|
1629
1645
|
}
|
|
1630
|
-
function
|
|
1646
|
+
function Ht(e) {
|
|
1631
1647
|
const t = [];
|
|
1632
1648
|
let r = 0;
|
|
1633
1649
|
for (; r < e.length; ) {
|
|
1634
1650
|
const s = e[r];
|
|
1635
1651
|
if (s === "'" || s === '"') {
|
|
1636
|
-
r =
|
|
1652
|
+
r = yn(e, r);
|
|
1637
1653
|
continue;
|
|
1638
1654
|
}
|
|
1639
1655
|
if (/[A-Za-z_]/.test(s)) {
|
|
@@ -1641,78 +1657,78 @@ function Yt(e) {
|
|
|
1641
1657
|
for (r++; r < e.length && /[A-Za-z0-9_]/.test(e[r]); )
|
|
1642
1658
|
r++;
|
|
1643
1659
|
const i = e.slice(n, r);
|
|
1644
|
-
r =
|
|
1660
|
+
r = bn(e, r, i, t);
|
|
1645
1661
|
continue;
|
|
1646
1662
|
}
|
|
1647
1663
|
r++;
|
|
1648
1664
|
}
|
|
1649
1665
|
return t;
|
|
1650
1666
|
}
|
|
1651
|
-
function
|
|
1652
|
-
const t =
|
|
1667
|
+
function Fn(e) {
|
|
1668
|
+
const t = Ht(e.formula), r = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
|
|
1653
1669
|
for (const { name: n, argCount: i } of t) {
|
|
1654
|
-
if (
|
|
1670
|
+
if (nn.has(n)) {
|
|
1655
1671
|
r.has(n) || (r.add(n), R(
|
|
1656
1672
|
e,
|
|
1657
1673
|
`${e.errorPrefix}args[1]: Function ${n} is not supported in custom formulas`
|
|
1658
1674
|
));
|
|
1659
1675
|
continue;
|
|
1660
1676
|
}
|
|
1661
|
-
const a =
|
|
1677
|
+
const a = le[n];
|
|
1662
1678
|
if (a && (i < a.minArgs || i > a.maxArgs) && !s.has(n)) {
|
|
1663
1679
|
s.add(n);
|
|
1664
|
-
const o =
|
|
1680
|
+
const o = on(a.minArgs, a.maxArgs);
|
|
1665
1681
|
R(e, `${e.errorPrefix}args[1]: Function ${n} accepts ${o}`);
|
|
1666
1682
|
}
|
|
1667
1683
|
}
|
|
1668
1684
|
}
|
|
1669
|
-
function
|
|
1685
|
+
function En(e) {
|
|
1670
1686
|
return [
|
|
1671
1687
|
...new Set(
|
|
1672
|
-
[...e.matchAll(new RegExp(
|
|
1688
|
+
[...e.matchAll(new RegExp(un.source, "g"))].map((t) => t[1])
|
|
1673
1689
|
)
|
|
1674
1690
|
];
|
|
1675
1691
|
}
|
|
1676
|
-
function
|
|
1692
|
+
function An(e) {
|
|
1677
1693
|
const t = e.result.references.filter(
|
|
1678
|
-
(n) => !e.canonicalContextKeys.has(
|
|
1694
|
+
(n) => !e.canonicalContextKeys.has(Y(n))
|
|
1679
1695
|
);
|
|
1680
1696
|
if (t.length === 0) return;
|
|
1681
|
-
const r = e.contextKeys.map((n) => `[${
|
|
1697
|
+
const r = e.contextKeys.map((n) => `[${Gt(n)}]`).join(", "), s = t.length === 1 ? `Reference [${t[0]}]` : `References [${t.join("], [")}]`;
|
|
1682
1698
|
R(
|
|
1683
1699
|
e,
|
|
1684
1700
|
`${e.errorPrefix}args[1]: ${s} not found in context. Available keys: ${r}`
|
|
1685
1701
|
);
|
|
1686
1702
|
}
|
|
1687
|
-
function
|
|
1688
|
-
if (
|
|
1703
|
+
function Tn(e) {
|
|
1704
|
+
if (cn.test(e.formula)) return;
|
|
1689
1705
|
const t = e.result.references.filter((r) => {
|
|
1690
1706
|
var n;
|
|
1691
|
-
const s = (n = e.context[
|
|
1692
|
-
return s !== void 0 && !
|
|
1707
|
+
const s = (n = e.context[Y(r)]) != null ? n : e.context[r];
|
|
1708
|
+
return s !== void 0 && !Kt(s);
|
|
1693
1709
|
});
|
|
1694
1710
|
t.length !== 0 && R(
|
|
1695
1711
|
e,
|
|
1696
|
-
`${e.errorPrefix}args[1]: ${
|
|
1697
|
-
|
|
1698
|
-
)}Bracket reference(s) ${
|
|
1712
|
+
`${e.errorPrefix}args[1]: ${dn(
|
|
1713
|
+
ln(e.formula)
|
|
1714
|
+
)}Bracket reference(s) ${fn(
|
|
1699
1715
|
t
|
|
1700
1716
|
)} point to raw attributes and must be wrapped in an aggregative function (e.g. SUM, AVG)`
|
|
1701
1717
|
);
|
|
1702
1718
|
}
|
|
1703
|
-
function
|
|
1719
|
+
function wn(e) {
|
|
1704
1720
|
if (!e.warnUnusedContext && !e.errorOnUnusedContext || e.contextKeys.length === 0) return;
|
|
1705
|
-
const t = new Set(e.result.references.map(
|
|
1721
|
+
const t = new Set(e.result.references.map(Y)), r = e.contextKeys.filter((i) => !t.has(Y(i)));
|
|
1706
1722
|
if (e.result.unusedContextKeys = r, r.length === 0) return;
|
|
1707
|
-
const s = r.map((i) => `[${
|
|
1723
|
+
const s = r.map((i) => `[${Gt(i)}]`).join(", "), n = `${e.errorPrefix}args[2]: Context keys ${s} are defined but not used in formula`;
|
|
1708
1724
|
e.errorOnUnusedContext ? R(e, n) : e.warnUnusedContext && e.result.warnings.push(n);
|
|
1709
1725
|
}
|
|
1710
|
-
function
|
|
1726
|
+
function tt(e, t, r, s) {
|
|
1711
1727
|
var a;
|
|
1712
|
-
const n = (a = s.context[
|
|
1728
|
+
const n = (a = s.context[Y(e)]) != null ? a : s.context[e];
|
|
1713
1729
|
if (n === void 0) return;
|
|
1714
1730
|
if (!(typeof n == "string" && n.startsWith(T))) {
|
|
1715
|
-
|
|
1731
|
+
Kt(n) && R(
|
|
1716
1732
|
s,
|
|
1717
1733
|
`${s.errorPrefix}args[1]: ${t.functionName} requires datetime dimension attributes. Reference [${e}] points to a measure; use an attribute (e.g. ${T}Table.Column.Level).`
|
|
1718
1734
|
);
|
|
@@ -1721,7 +1737,7 @@ function et(e, t, r, s) {
|
|
|
1721
1737
|
if (s.schemaIndex)
|
|
1722
1738
|
try {
|
|
1723
1739
|
const o = Ue(n, s.schemaIndex);
|
|
1724
|
-
|
|
1740
|
+
se(o.column.dataType) ? r && o.level && o.level !== r && R(
|
|
1725
1741
|
s,
|
|
1726
1742
|
`${s.errorPrefix}args[1]: ${t.functionName} expects date level '${r}'. Reference [${e}] has level '${o.level}'.`
|
|
1727
1743
|
) : R(
|
|
@@ -1733,30 +1749,30 @@ function et(e, t, r, s) {
|
|
|
1733
1749
|
R(s, `${s.errorPrefix}args[1]: ${t.functionName} reference [${e}]: ${u}`);
|
|
1734
1750
|
}
|
|
1735
1751
|
}
|
|
1736
|
-
function
|
|
1737
|
-
const t =
|
|
1752
|
+
function Sn(e) {
|
|
1753
|
+
const t = Vt(), r = Yt(e.formula, t);
|
|
1738
1754
|
for (const s of r) {
|
|
1739
|
-
const n =
|
|
1740
|
-
|
|
1755
|
+
const n = jt(s.functionName);
|
|
1756
|
+
tt(s.ref1, s, n, e), tt(s.ref2, s, n, e);
|
|
1741
1757
|
}
|
|
1742
1758
|
}
|
|
1743
|
-
function
|
|
1759
|
+
function Cn(e, t, r = {}) {
|
|
1744
1760
|
var n;
|
|
1745
|
-
const s =
|
|
1746
|
-
return !e || e.trim().length === 0 ? ((n = r.allowEmptyFormula) != null && n || R(s, `${s.errorPrefix}args[1]: Formula cannot be empty`), s.result) : (
|
|
1761
|
+
const s = mn(e, t, r);
|
|
1762
|
+
return !e || e.trim().length === 0 ? ((n = r.allowEmptyFormula) != null && n || R(s, `${s.errorPrefix}args[1]: Formula cannot be empty`), s.result) : (gn(s), Fn(s), s.result.references = En(e), s.result.references.length === 0 ? (s.result.warnings.push(
|
|
1747
1763
|
`${s.errorPrefix}args[1]: No bracket references found in formula - ensure this is intentional`
|
|
1748
1764
|
), s.result) : s.contextKeys.length === 0 ? (R(
|
|
1749
1765
|
s,
|
|
1750
1766
|
`${s.errorPrefix}args[2]: Context cannot be empty - custom formulas require context definitions`
|
|
1751
|
-
), s.result) : (
|
|
1767
|
+
), s.result) : (An(s), Tn(s), wn(s), Sn(s), s.result));
|
|
1752
1768
|
}
|
|
1753
|
-
function
|
|
1754
|
-
const s =
|
|
1769
|
+
function On(e, t, r = {}) {
|
|
1770
|
+
const s = Cn(e, t, r);
|
|
1755
1771
|
if (!s.isValid)
|
|
1756
1772
|
throw new Error(s.errors.join("; "));
|
|
1757
1773
|
s.warnings.length > 0 && console.warn("Formula validation warnings:", s.warnings.join("; "));
|
|
1758
1774
|
}
|
|
1759
|
-
function
|
|
1775
|
+
function $n(e, t) {
|
|
1760
1776
|
if (e.length < 3 || e.length > 5)
|
|
1761
1777
|
throw new Error(
|
|
1762
1778
|
`${t.pathPrefix}Expected 3, 4, or 5 arguments for customFormula (title, formula, context, format?, description?)`
|
|
@@ -1767,12 +1783,12 @@ function On(e, t) {
|
|
|
1767
1783
|
`${t.pathPrefix}args[1]: Expected formula string, got ${typeof r}`
|
|
1768
1784
|
);
|
|
1769
1785
|
const s = r, n = e[2];
|
|
1770
|
-
if (
|
|
1786
|
+
if (!q(n))
|
|
1771
1787
|
throw new Error(
|
|
1772
1788
|
`${t.pathPrefix}args[2]: Expected context object, got ${n === null ? "null" : typeof n}`
|
|
1773
1789
|
);
|
|
1774
1790
|
const i = n;
|
|
1775
|
-
|
|
1791
|
+
On(s, i, {
|
|
1776
1792
|
errorPrefix: `${t.pathPrefix}`,
|
|
1777
1793
|
errorOnUnusedContext: !0,
|
|
1778
1794
|
// Strict validation: all context keys must be used
|
|
@@ -1795,7 +1811,7 @@ function On(e, t) {
|
|
|
1795
1811
|
else if (typeof c == "string" && c.startsWith(T)) {
|
|
1796
1812
|
const f = u.startsWith("[") && u.endsWith("]") ? u.slice(1, -1) : u, p = a[f];
|
|
1797
1813
|
try {
|
|
1798
|
-
o[`${u}`] =
|
|
1814
|
+
o[`${u}`] = re(
|
|
1799
1815
|
c,
|
|
1800
1816
|
t.dataSource,
|
|
1801
1817
|
t.schemaIndex,
|
|
@@ -1815,9 +1831,9 @@ function On(e, t) {
|
|
|
1815
1831
|
return [e[0], e[1], o, ...e.slice(3)];
|
|
1816
1832
|
}
|
|
1817
1833
|
function qn(e) {
|
|
1818
|
-
const t =
|
|
1834
|
+
const t = Vt(), r = Yt(e, t), s = {};
|
|
1819
1835
|
for (const n of r) {
|
|
1820
|
-
const i =
|
|
1836
|
+
const i = jt(n.functionName);
|
|
1821
1837
|
if (i !== void 0)
|
|
1822
1838
|
for (const a of [n.ref1, n.ref2]) {
|
|
1823
1839
|
const o = s[a];
|
|
@@ -1830,76 +1846,87 @@ function qn(e) {
|
|
|
1830
1846
|
}
|
|
1831
1847
|
return s;
|
|
1832
1848
|
}
|
|
1833
|
-
function Ht(e) {
|
|
1834
|
-
return e.type === j.TextAttribute;
|
|
1835
|
-
}
|
|
1836
1849
|
function Qt(e) {
|
|
1837
|
-
return e.type ===
|
|
1850
|
+
return e.type === J.TextAttribute;
|
|
1838
1851
|
}
|
|
1839
|
-
function
|
|
1840
|
-
return e.type ===
|
|
1852
|
+
function Xt(e) {
|
|
1853
|
+
return e.type === J.NumericAttribute;
|
|
1841
1854
|
}
|
|
1842
1855
|
function Dn(e) {
|
|
1843
|
-
return
|
|
1856
|
+
return e.type === J.DateLevel;
|
|
1844
1857
|
}
|
|
1845
|
-
function
|
|
1846
|
-
return e
|
|
1858
|
+
function xn(e) {
|
|
1859
|
+
return Qt(e) || Xt(e);
|
|
1847
1860
|
}
|
|
1848
|
-
function
|
|
1861
|
+
function ye(e) {
|
|
1862
|
+
return e.type === J.TextAttribute ? "text" : e.type === J.NumericAttribute ? "numeric" : e.type === J.DateLevel ? "date/datetime" : "unknown";
|
|
1863
|
+
}
|
|
1864
|
+
function We(e, t) {
|
|
1849
1865
|
const r = e[0];
|
|
1850
1866
|
if (!r || typeof r != "object" || !("type" in r))
|
|
1851
1867
|
throw new Error(`${t.pathPrefix}args[0]: Expected attribute as first argument`);
|
|
1852
1868
|
return r;
|
|
1853
1869
|
}
|
|
1854
|
-
function
|
|
1855
|
-
const r =
|
|
1856
|
-
if (!
|
|
1870
|
+
function rt(e, t) {
|
|
1871
|
+
const r = We(e, t);
|
|
1872
|
+
if (!xn(r))
|
|
1857
1873
|
throw new Error(
|
|
1858
|
-
`${t.pathPrefix}args[0]: Attribute must be string or numeric type, got ${
|
|
1874
|
+
`${t.pathPrefix}args[0]: Attribute must be string or numeric type, got ${ye(
|
|
1859
1875
|
r
|
|
1860
1876
|
)} attribute`
|
|
1861
1877
|
);
|
|
1862
1878
|
return e;
|
|
1863
1879
|
}
|
|
1864
1880
|
function B(e, t) {
|
|
1865
|
-
const r =
|
|
1866
|
-
if (!
|
|
1881
|
+
const r = We(e, t);
|
|
1882
|
+
if (!Xt(r))
|
|
1867
1883
|
throw new Error(
|
|
1868
|
-
`${t.pathPrefix}args[0]: Attribute must be numeric type, got ${
|
|
1884
|
+
`${t.pathPrefix}args[0]: Attribute must be numeric type, got ${ye(
|
|
1869
1885
|
r
|
|
1870
1886
|
)} attribute`
|
|
1871
1887
|
);
|
|
1872
1888
|
return e;
|
|
1873
1889
|
}
|
|
1874
|
-
function
|
|
1875
|
-
const r =
|
|
1876
|
-
if (!
|
|
1890
|
+
function _(e, t) {
|
|
1891
|
+
const r = We(e, t);
|
|
1892
|
+
if (!Qt(r))
|
|
1877
1893
|
throw new Error(
|
|
1878
|
-
`${t.pathPrefix}args[0]: Attribute must be string type, got ${
|
|
1894
|
+
`${t.pathPrefix}args[0]: Attribute must be string type, got ${ye(
|
|
1879
1895
|
r
|
|
1880
1896
|
)} attribute`
|
|
1881
1897
|
);
|
|
1882
1898
|
return e;
|
|
1883
1899
|
}
|
|
1884
|
-
function
|
|
1900
|
+
function Nn(e, t) {
|
|
1885
1901
|
const r = e[0];
|
|
1886
1902
|
if (!r || typeof r != "object" || !("attribute" in r))
|
|
1887
1903
|
throw new Error(`${t.pathPrefix}args[0]: Expected filter as first argument`);
|
|
1888
1904
|
return r;
|
|
1889
1905
|
}
|
|
1890
|
-
function
|
|
1891
|
-
const r =
|
|
1892
|
-
if (!
|
|
1906
|
+
function vn(e, t) {
|
|
1907
|
+
const r = Nn(e, t);
|
|
1908
|
+
if (!Me(r))
|
|
1893
1909
|
throw new Error(
|
|
1894
1910
|
`${t.pathPrefix}args[0]: exclude filter only accepts members filter, got ${r.__serializable || "unknown"} filter`
|
|
1895
1911
|
);
|
|
1896
1912
|
return e;
|
|
1897
1913
|
}
|
|
1898
|
-
const
|
|
1899
|
-
|
|
1914
|
+
const Mn = "FilterRelations (filterFactory.logic.or / filterFactory.logic.and) is not supported inside measureFactory.measuredValue filters. Use plain filters only, or apply logical relations at the query filter level.";
|
|
1915
|
+
function Rn(e, t) {
|
|
1916
|
+
const r = e[1];
|
|
1917
|
+
return Array.isArray(r) && r.forEach((s, n) => {
|
|
1918
|
+
if (!(typeof s != "object" || s === null) && H(s))
|
|
1919
|
+
throw new Error(
|
|
1920
|
+
`${t.pathPrefix}args[1][${n}]: ${Mn}`
|
|
1921
|
+
);
|
|
1922
|
+
}), e;
|
|
1923
|
+
}
|
|
1924
|
+
const In = {
|
|
1925
|
+
"measureFactory.customFormula": $n,
|
|
1926
|
+
"measureFactory.measuredValue": Rn,
|
|
1900
1927
|
// String | Number filters
|
|
1901
|
-
"filterFactory.equals":
|
|
1902
|
-
"filterFactory.doesntEqual":
|
|
1928
|
+
"filterFactory.equals": rt,
|
|
1929
|
+
"filterFactory.doesntEqual": rt,
|
|
1903
1930
|
// Numeric filters
|
|
1904
1931
|
"filterFactory.greaterThan": B,
|
|
1905
1932
|
"filterFactory.greaterThanOrEqual": B,
|
|
@@ -1909,20 +1936,20 @@ const vn = {
|
|
|
1909
1936
|
"filterFactory.betweenNotEqual": B,
|
|
1910
1937
|
"filterFactory.numeric": B,
|
|
1911
1938
|
// String filters
|
|
1912
|
-
"filterFactory.contains":
|
|
1913
|
-
"filterFactory.doesntContain":
|
|
1914
|
-
"filterFactory.startsWith":
|
|
1915
|
-
"filterFactory.doesntStartWith":
|
|
1916
|
-
"filterFactory.endsWith":
|
|
1917
|
-
"filterFactory.doesntEndWith":
|
|
1918
|
-
"filterFactory.like":
|
|
1939
|
+
"filterFactory.contains": _,
|
|
1940
|
+
"filterFactory.doesntContain": _,
|
|
1941
|
+
"filterFactory.startsWith": _,
|
|
1942
|
+
"filterFactory.doesntStartWith": _,
|
|
1943
|
+
"filterFactory.endsWith": _,
|
|
1944
|
+
"filterFactory.doesntEndWith": _,
|
|
1945
|
+
"filterFactory.like": _,
|
|
1919
1946
|
// Exclude filter
|
|
1920
|
-
"filterFactory.exclude":
|
|
1947
|
+
"filterFactory.exclude": vn
|
|
1921
1948
|
};
|
|
1922
|
-
function
|
|
1923
|
-
return
|
|
1949
|
+
function kn(e) {
|
|
1950
|
+
return In[`${e}`];
|
|
1924
1951
|
}
|
|
1925
|
-
const
|
|
1952
|
+
const Zt = {
|
|
1926
1953
|
// ==================== MEASURE FACTORY FUNCTIONS ====================
|
|
1927
1954
|
// Basic aggregations
|
|
1928
1955
|
"measureFactory.sum": [
|
|
@@ -2449,18 +2476,18 @@ const Xt = {
|
|
|
2449
2476
|
{ type: "FilterRelationsNode", required: !0 }
|
|
2450
2477
|
]
|
|
2451
2478
|
};
|
|
2452
|
-
function
|
|
2453
|
-
return
|
|
2479
|
+
function he(e) {
|
|
2480
|
+
return Zt[`${e}`];
|
|
2454
2481
|
}
|
|
2455
|
-
function
|
|
2456
|
-
const t =
|
|
2482
|
+
function Ln(e) {
|
|
2483
|
+
const t = he(e);
|
|
2457
2484
|
return t ? t.filter((r) => r.required).length : 0;
|
|
2458
2485
|
}
|
|
2459
|
-
function
|
|
2460
|
-
const t =
|
|
2486
|
+
function Bn(e) {
|
|
2487
|
+
const t = he(e);
|
|
2461
2488
|
return t ? t.length : 0;
|
|
2462
2489
|
}
|
|
2463
|
-
function
|
|
2490
|
+
function _n(e) {
|
|
2464
2491
|
if (typeof e != "string" || !/^\d{4}-\d{2}-\d{2}/.test(e))
|
|
2465
2492
|
return !1;
|
|
2466
2493
|
const r = Date.parse(e);
|
|
@@ -2469,10 +2496,10 @@ function kn(e) {
|
|
|
2469
2496
|
const s = new Date(e);
|
|
2470
2497
|
return !isNaN(s.getTime());
|
|
2471
2498
|
}
|
|
2472
|
-
function
|
|
2499
|
+
function Se(e, t, r, s) {
|
|
2473
2500
|
if (e.startsWith(T))
|
|
2474
2501
|
try {
|
|
2475
|
-
return
|
|
2502
|
+
return re(e, t, r);
|
|
2476
2503
|
} catch (n) {
|
|
2477
2504
|
const i = n instanceof Error ? n.message : "Unknown error";
|
|
2478
2505
|
throw new Error(`${s}: ${i}`);
|
|
@@ -2481,10 +2508,10 @@ function we(e, t, r, s) {
|
|
|
2481
2508
|
`${s}: Invalid attribute '${e}'. Expected format: '${T}TableName.ColumnName[.Level]'`
|
|
2482
2509
|
);
|
|
2483
2510
|
}
|
|
2484
|
-
function
|
|
2511
|
+
function zn(e, t, r, s) {
|
|
2485
2512
|
if (e.startsWith(T))
|
|
2486
2513
|
try {
|
|
2487
|
-
return
|
|
2514
|
+
return Hs(e, t, r);
|
|
2488
2515
|
} catch (n) {
|
|
2489
2516
|
const i = n instanceof Error ? n.message : "Unknown error";
|
|
2490
2517
|
throw new Error(`${s}: ${i}`);
|
|
@@ -2493,7 +2520,7 @@ function Ln(e, t, r, s) {
|
|
|
2493
2520
|
`${s}: Invalid date dimension string '${e}'. Expected format: '${T}TableName.ColumnName'`
|
|
2494
2521
|
);
|
|
2495
2522
|
}
|
|
2496
|
-
function
|
|
2523
|
+
function Un(e) {
|
|
2497
2524
|
const t = e.data, { argSchema: r, dataSource: s, schemaIndex: n, pathPrefix: i } = e.context, a = i;
|
|
2498
2525
|
if (t === void 0) {
|
|
2499
2526
|
if (r.required)
|
|
@@ -2539,7 +2566,7 @@ function Bn(e) {
|
|
|
2539
2566
|
throw new Error(
|
|
2540
2567
|
`${a}: Expected attribute string, got ${typeof t}. Example: 'DM.Commerce.Revenue'`
|
|
2541
2568
|
);
|
|
2542
|
-
return
|
|
2569
|
+
return Se(t, s, n, a);
|
|
2543
2570
|
case "Attribute[]":
|
|
2544
2571
|
if (!Array.isArray(t))
|
|
2545
2572
|
throw new Error(
|
|
@@ -2548,7 +2575,7 @@ function Bn(e) {
|
|
|
2548
2575
|
return t.map((o, u) => {
|
|
2549
2576
|
if (typeof o != "string")
|
|
2550
2577
|
throw new Error(`${a}[${u}]: Expected attribute string, got ${typeof o}`);
|
|
2551
|
-
return
|
|
2578
|
+
return Se(o, s, n, `${a}[${u}]`);
|
|
2552
2579
|
});
|
|
2553
2580
|
case "Measure":
|
|
2554
2581
|
case "BaseMeasure":
|
|
@@ -2624,21 +2651,21 @@ function Bn(e) {
|
|
|
2624
2651
|
throw new Error(
|
|
2625
2652
|
`${a}: Expected date dimension string, got ${typeof t}. Example: 'DM.Commerce.Date'`
|
|
2626
2653
|
);
|
|
2627
|
-
return
|
|
2654
|
+
return zn(t, s, n, a);
|
|
2628
2655
|
case "LevelAttribute": {
|
|
2629
2656
|
if (typeof t != "string")
|
|
2630
2657
|
throw new Error(
|
|
2631
2658
|
`${a}: Expected date attribute string, got ${typeof t}. Example: 'DM.Commerce.Date.Years'`
|
|
2632
2659
|
);
|
|
2633
|
-
const o =
|
|
2660
|
+
const o = Se(
|
|
2634
2661
|
t,
|
|
2635
2662
|
s,
|
|
2636
2663
|
n,
|
|
2637
2664
|
a
|
|
2638
2665
|
);
|
|
2639
|
-
if (
|
|
2666
|
+
if (!Dn(o))
|
|
2640
2667
|
throw new Error(
|
|
2641
|
-
`${a}: Attribute must be date/datetime type, got ${
|
|
2668
|
+
`${a}: Attribute must be date/datetime type, got ${ye(
|
|
2642
2669
|
o
|
|
2643
2670
|
)} attribute`
|
|
2644
2671
|
);
|
|
@@ -2657,7 +2684,7 @@ function Bn(e) {
|
|
|
2657
2684
|
);
|
|
2658
2685
|
case "Date | string":
|
|
2659
2686
|
if (typeof t == "string") {
|
|
2660
|
-
if (
|
|
2687
|
+
if (_n(t))
|
|
2661
2688
|
return t;
|
|
2662
2689
|
throw new Error(
|
|
2663
2690
|
`${a}: Expected valid ISO date string or Date object, got invalid date string '${t}'`
|
|
@@ -2685,14 +2712,14 @@ function Bn(e) {
|
|
|
2685
2712
|
}
|
|
2686
2713
|
}
|
|
2687
2714
|
function M(e) {
|
|
2688
|
-
const { data: t } = e, { dataSource: r, schemaIndex: s, pathPrefix: n } = e.context, { function: i, args: a } = t, o = n ? `${n}.` : "", u =
|
|
2715
|
+
const { data: t } = e, { dataSource: r, schemaIndex: s, pathPrefix: n } = e.context, { function: i, args: a } = t, o = n ? `${n}.` : "", u = he(i);
|
|
2689
2716
|
if (!u) {
|
|
2690
|
-
const m = Object.keys(
|
|
2717
|
+
const m = Object.keys(Zt), F = x(i, m, (N) => N), O = F && F.distance <= C ? ` Did you mean '${F.best}'?` : "";
|
|
2691
2718
|
throw new Error(
|
|
2692
2719
|
`${o}function: Unknown function '${i}'.${O}`
|
|
2693
2720
|
);
|
|
2694
2721
|
}
|
|
2695
|
-
const c =
|
|
2722
|
+
const c = Ln(i), g = Bn(i);
|
|
2696
2723
|
if (a.length < c)
|
|
2697
2724
|
throw new Error(
|
|
2698
2725
|
`${o}function: Expected at least ${c} arguments, got ${a.length}`
|
|
@@ -2713,7 +2740,7 @@ function M(e) {
|
|
|
2713
2740
|
continue;
|
|
2714
2741
|
}
|
|
2715
2742
|
try {
|
|
2716
|
-
const
|
|
2743
|
+
const V = Un({
|
|
2717
2744
|
data: O,
|
|
2718
2745
|
context: {
|
|
2719
2746
|
dataSource: r,
|
|
@@ -2722,10 +2749,10 @@ function M(e) {
|
|
|
2722
2749
|
argSchema: F
|
|
2723
2750
|
}
|
|
2724
2751
|
});
|
|
2725
|
-
f.push(
|
|
2726
|
-
} catch (
|
|
2727
|
-
const
|
|
2728
|
-
p.push(
|
|
2752
|
+
f.push(V);
|
|
2753
|
+
} catch (V) {
|
|
2754
|
+
const ur = V instanceof Error ? V.message : "Unknown error";
|
|
2755
|
+
p.push(ur);
|
|
2729
2756
|
}
|
|
2730
2757
|
}
|
|
2731
2758
|
if (p.length > 0) {
|
|
@@ -2733,7 +2760,7 @@ function M(e) {
|
|
|
2733
2760
|
throw new Error(m);
|
|
2734
2761
|
}
|
|
2735
2762
|
let h = f;
|
|
2736
|
-
const b =
|
|
2763
|
+
const b = kn(i);
|
|
2737
2764
|
if (b)
|
|
2738
2765
|
try {
|
|
2739
2766
|
h = b(f, {
|
|
@@ -2745,23 +2772,23 @@ function M(e) {
|
|
|
2745
2772
|
const F = m instanceof Error ? m.message : "Unknown validation error";
|
|
2746
2773
|
throw new Error(F);
|
|
2747
2774
|
}
|
|
2748
|
-
return
|
|
2775
|
+
return sn(i, h);
|
|
2749
2776
|
}
|
|
2750
|
-
function
|
|
2777
|
+
function er(e) {
|
|
2751
2778
|
const { attribute: t, config: r } = e;
|
|
2752
|
-
if (
|
|
2753
|
-
const { granularity: s } = t, n = e.members.map((o) => s === "Years" && !isNaN(Number(o)) ? `${o}-01-01T00:00:00` : o), i =
|
|
2754
|
-
return
|
|
2779
|
+
if (Me(e) && rs(t)) {
|
|
2780
|
+
const { granularity: s } = t, n = e.members.map((o) => s === "Years" && !isNaN(Number(o)) ? `${o}-01-01T00:00:00` : o), i = ss(r), a = Object.keys(i).length === 0 ? void 0 : i;
|
|
2781
|
+
return ns(t, n, a);
|
|
2755
2782
|
}
|
|
2756
2783
|
return e;
|
|
2757
2784
|
}
|
|
2758
|
-
function
|
|
2785
|
+
function Pn(e) {
|
|
2759
2786
|
let t = [];
|
|
2760
2787
|
for (const r of e)
|
|
2761
|
-
|
|
2788
|
+
H(r) ? t = Ye(r, t) : t = Ye([er(r)], t);
|
|
2762
2789
|
return t != null ? t : [];
|
|
2763
2790
|
}
|
|
2764
|
-
const
|
|
2791
|
+
const Wn = (e) => {
|
|
2765
2792
|
const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context, n = [], i = [];
|
|
2766
2793
|
return t.forEach((a, o) => {
|
|
2767
2794
|
const u = {
|
|
@@ -2773,15 +2800,15 @@ const Un = (e) => {
|
|
|
2773
2800
|
data: a,
|
|
2774
2801
|
context: { dataSource: r, schemaIndex: s, pathPrefix: "" }
|
|
2775
2802
|
});
|
|
2776
|
-
!
|
|
2803
|
+
!H(c) && !ge(c) ? i.push(E(l({}, u), { message: "Invalid filter JSON" })) : n.push(c);
|
|
2777
2804
|
} catch (c) {
|
|
2778
2805
|
const g = c instanceof Error ? c.message : "Unknown error";
|
|
2779
2806
|
i.push(E(l({}, u), { message: g }));
|
|
2780
2807
|
}
|
|
2781
|
-
}), i.length > 0 ? { success: !1, errors: i } : { success: !0, data:
|
|
2782
|
-
},
|
|
2808
|
+
}), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: Pn(n) };
|
|
2809
|
+
}, ie = (e) => {
|
|
2783
2810
|
const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context;
|
|
2784
|
-
return t ?
|
|
2811
|
+
return t ? _t(t) ? Wn({
|
|
2785
2812
|
data: t,
|
|
2786
2813
|
context: { dataSource: r, schemaIndex: s }
|
|
2787
2814
|
}) : {
|
|
@@ -2794,7 +2821,7 @@ const Un = (e) => {
|
|
|
2794
2821
|
}
|
|
2795
2822
|
]
|
|
2796
2823
|
} : { success: !0, data: [] };
|
|
2797
|
-
},
|
|
2824
|
+
}, Vn = (e) => {
|
|
2798
2825
|
const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context, n = [], i = [];
|
|
2799
2826
|
return t.forEach((a, o) => {
|
|
2800
2827
|
const u = {
|
|
@@ -2806,15 +2833,15 @@ const Un = (e) => {
|
|
|
2806
2833
|
data: a,
|
|
2807
2834
|
context: { dataSource: r, schemaIndex: s, pathPrefix: "" }
|
|
2808
2835
|
});
|
|
2809
|
-
|
|
2836
|
+
ge(c) ? n.push(er(c)) : i.push(E(l({}, u), { message: "Invalid filter JSON" }));
|
|
2810
2837
|
} catch (c) {
|
|
2811
2838
|
const g = c instanceof Error ? c.message : "Unknown error";
|
|
2812
2839
|
i.push(E(l({}, u), { message: g }));
|
|
2813
2840
|
}
|
|
2814
2841
|
}), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: n };
|
|
2815
|
-
},
|
|
2842
|
+
}, be = (e) => {
|
|
2816
2843
|
const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context;
|
|
2817
|
-
return t ?
|
|
2844
|
+
return t ? _t(t) ? Vn({
|
|
2818
2845
|
data: t,
|
|
2819
2846
|
context: { dataSource: r, schemaIndex: s }
|
|
2820
2847
|
}) : {
|
|
@@ -2827,12 +2854,12 @@ const Un = (e) => {
|
|
|
2827
2854
|
}
|
|
2828
2855
|
]
|
|
2829
2856
|
} : { success: !0, data: [] };
|
|
2830
|
-
},
|
|
2831
|
-
if (e && !
|
|
2857
|
+
}, jn = (e, t) => {
|
|
2858
|
+
if (e && !gt(e))
|
|
2832
2859
|
return E(l({}, t), {
|
|
2833
2860
|
message: `Invalid sort type. Expected 'sortAsc', 'sortDesc', or 'sortNone'. Got: '${e}'.`
|
|
2834
2861
|
});
|
|
2835
|
-
},
|
|
2862
|
+
}, Jn = (e, t, r) => {
|
|
2836
2863
|
const { dataSource: s, schemaIndex: n } = t;
|
|
2837
2864
|
try {
|
|
2838
2865
|
const i = M({
|
|
@@ -2850,7 +2877,7 @@ const Un = (e) => {
|
|
|
2850
2877
|
errors: [E(l({}, r), { message: a })]
|
|
2851
2878
|
};
|
|
2852
2879
|
}
|
|
2853
|
-
},
|
|
2880
|
+
}, Kn = (e, t, r, s) => {
|
|
2854
2881
|
const n = M({
|
|
2855
2882
|
data: e.column,
|
|
2856
2883
|
context: { dataSource: t, schemaIndex: r, pathPrefix: "" }
|
|
@@ -2860,18 +2887,18 @@ const Un = (e) => {
|
|
|
2860
2887
|
style: {},
|
|
2861
2888
|
error: E(l({}, s), { message: "Invalid measure JSON" })
|
|
2862
2889
|
};
|
|
2863
|
-
const i =
|
|
2890
|
+
const i = jn(e.sortType, s);
|
|
2864
2891
|
if (i) {
|
|
2865
|
-
const o =
|
|
2892
|
+
const o = U(e, "column");
|
|
2866
2893
|
return { measure: n, style: o, error: i };
|
|
2867
2894
|
}
|
|
2868
|
-
const a =
|
|
2895
|
+
const a = U(e, "column");
|
|
2869
2896
|
return { measure: n, style: a };
|
|
2870
|
-
},
|
|
2897
|
+
}, Gn = (e, t, r, s) => {
|
|
2871
2898
|
if (Ut(e))
|
|
2872
|
-
return
|
|
2899
|
+
return Kn(e, t, r, s);
|
|
2873
2900
|
if (w(e)) {
|
|
2874
|
-
const n =
|
|
2901
|
+
const n = Jn(
|
|
2875
2902
|
e,
|
|
2876
2903
|
{ dataSource: t, schemaIndex: r },
|
|
2877
2904
|
s
|
|
@@ -2883,7 +2910,7 @@ const Un = (e) => {
|
|
|
2883
2910
|
message: "Invalid measure item. Expected a function call (function/args) or object with 'column' and optional 'sortType'."
|
|
2884
2911
|
})
|
|
2885
2912
|
};
|
|
2886
|
-
},
|
|
2913
|
+
}, tr = (e) => {
|
|
2887
2914
|
const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context;
|
|
2888
2915
|
if (!t)
|
|
2889
2916
|
return { success: !0, data: [] };
|
|
@@ -2905,7 +2932,7 @@ const Un = (e) => {
|
|
|
2905
2932
|
input: a
|
|
2906
2933
|
};
|
|
2907
2934
|
try {
|
|
2908
|
-
const c =
|
|
2935
|
+
const c = Gn(a, r, s, u);
|
|
2909
2936
|
if (c.error) {
|
|
2910
2937
|
i.push(c.error);
|
|
2911
2938
|
return;
|
|
@@ -2919,10 +2946,10 @@ const Un = (e) => {
|
|
|
2919
2946
|
}
|
|
2920
2947
|
}), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: n };
|
|
2921
2948
|
};
|
|
2922
|
-
function
|
|
2949
|
+
function ce(e) {
|
|
2923
2950
|
return typeof e == "string" ? e : e.title;
|
|
2924
2951
|
}
|
|
2925
|
-
function
|
|
2952
|
+
function Yn(e) {
|
|
2926
2953
|
const t = {};
|
|
2927
2954
|
for (const [r, s] of Object.entries(e)) {
|
|
2928
2955
|
const n = {};
|
|
@@ -2930,7 +2957,7 @@ function Jn(e) {
|
|
|
2930
2957
|
}
|
|
2931
2958
|
return Object.keys(t).length > 0 ? t : void 0;
|
|
2932
2959
|
}
|
|
2933
|
-
function
|
|
2960
|
+
function rr(e) {
|
|
2934
2961
|
return typeof e == "object" && e !== null && "toJSON" in e && typeof e.toJSON == "function" ? e.toJSON() : e;
|
|
2935
2962
|
}
|
|
2936
2963
|
function L(e) {
|
|
@@ -2946,21 +2973,21 @@ function A(e, t, r) {
|
|
|
2946
2973
|
}
|
|
2947
2974
|
return s.data;
|
|
2948
2975
|
}
|
|
2949
|
-
const
|
|
2950
|
-
const { data: t } = e, { dataSource: r, tables: s } = e.context, n =
|
|
2951
|
-
() =>
|
|
2976
|
+
const Pi = (e) => {
|
|
2977
|
+
const { data: t } = e, { dataSource: r, tables: s } = e.context, n = ne(s), i = [], a = A(
|
|
2978
|
+
() => Wt({
|
|
2952
2979
|
data: t.dimensions || [],
|
|
2953
2980
|
context: { dataSource: r, schemaIndex: n }
|
|
2954
2981
|
}),
|
|
2955
2982
|
i
|
|
2956
2983
|
), o = A(
|
|
2957
|
-
() =>
|
|
2984
|
+
() => tr({
|
|
2958
2985
|
data: t.measures || [],
|
|
2959
2986
|
context: { dataSource: r, schemaIndex: n }
|
|
2960
2987
|
}),
|
|
2961
2988
|
i
|
|
2962
2989
|
), u = A(
|
|
2963
|
-
() =>
|
|
2990
|
+
() => ie({
|
|
2964
2991
|
data: t.filters || [],
|
|
2965
2992
|
context: { dataSource: r, schemaIndex: n }
|
|
2966
2993
|
}),
|
|
@@ -2968,7 +2995,7 @@ const zi = (e) => {
|
|
|
2968
2995
|
);
|
|
2969
2996
|
let c = null;
|
|
2970
2997
|
return t.highlights && (c = A(
|
|
2971
|
-
() =>
|
|
2998
|
+
() => be({
|
|
2972
2999
|
data: t.highlights || [],
|
|
2973
3000
|
context: { dataSource: r, schemaIndex: n }
|
|
2974
3001
|
}),
|
|
@@ -2979,21 +3006,21 @@ const zi = (e) => {
|
|
|
2979
3006
|
} : {
|
|
2980
3007
|
success: !0,
|
|
2981
3008
|
data: l({
|
|
2982
|
-
dataSource:
|
|
2983
|
-
dimensions: a ?
|
|
2984
|
-
measures: o ?
|
|
3009
|
+
dataSource: me(r),
|
|
3010
|
+
dimensions: a ? is(a) : [],
|
|
3011
|
+
measures: o ? as(o) : [],
|
|
2985
3012
|
filters: u || []
|
|
2986
3013
|
}, c && { highlights: c })
|
|
2987
3014
|
};
|
|
2988
3015
|
};
|
|
2989
|
-
function
|
|
3016
|
+
function st(e) {
|
|
2990
3017
|
return typeof e == "object" && e !== null && "column" in e && e.column !== void 0;
|
|
2991
3018
|
}
|
|
2992
|
-
function
|
|
3019
|
+
function Ve(e) {
|
|
2993
3020
|
const t = [], r = [];
|
|
2994
3021
|
return e.forEach((s, n) => {
|
|
2995
3022
|
var f, p, h;
|
|
2996
|
-
const i =
|
|
3023
|
+
const i = st(s) ? s.column : s, a = st(s) ? s : void 0, o = () => rr(i);
|
|
2997
3024
|
if (!i.composeCode) {
|
|
2998
3025
|
r.push({
|
|
2999
3026
|
path: `dimensions[${n}]`,
|
|
@@ -3010,22 +3037,22 @@ function We(e) {
|
|
|
3010
3037
|
});
|
|
3011
3038
|
return;
|
|
3012
3039
|
}
|
|
3013
|
-
const u = (h = a != null && a.sortType ?
|
|
3014
|
-
if (u !== void 0 && u !==
|
|
3040
|
+
const u = (h = a != null && a.sortType ? yt(a.sortType) : void 0) != null ? h : ((f = i.getSort) == null ? void 0 : f.call(i)) !== void 0 && ((p = i.getSort) == null ? void 0 : p.call(i)) !== z.None ? i.getSort() : void 0, c = a ? U(a, "column") : {};
|
|
3041
|
+
if (u !== void 0 && u !== z.None || a && Object.keys(c).length > 0) {
|
|
3015
3042
|
const b = l(l({
|
|
3016
3043
|
column: i.composeCode
|
|
3017
|
-
}, u !== void 0 && u !==
|
|
3044
|
+
}, u !== void 0 && u !== z.None && { sortType: ht(u) }), c);
|
|
3018
3045
|
t.push(b);
|
|
3019
3046
|
} else
|
|
3020
3047
|
t.push(i.composeCode);
|
|
3021
3048
|
}), r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
|
|
3022
3049
|
}
|
|
3023
|
-
const
|
|
3024
|
-
function
|
|
3050
|
+
const xe = "Unknown error";
|
|
3051
|
+
function ae(e) {
|
|
3025
3052
|
if (!e)
|
|
3026
3053
|
return { success: !0, data: [] };
|
|
3027
3054
|
const t = [];
|
|
3028
|
-
if (
|
|
3055
|
+
if (os(e)) {
|
|
3029
3056
|
if (!e.composeCode)
|
|
3030
3057
|
return {
|
|
3031
3058
|
success: !1,
|
|
@@ -3038,9 +3065,9 @@ function ie(e) {
|
|
|
3038
3065
|
]
|
|
3039
3066
|
};
|
|
3040
3067
|
try {
|
|
3041
|
-
return { success: !0, data: [
|
|
3068
|
+
return { success: !0, data: [K(e.composeCode)] };
|
|
3042
3069
|
} catch (s) {
|
|
3043
|
-
const n = s instanceof Error ? s.message :
|
|
3070
|
+
const n = s instanceof Error ? s.message : xe;
|
|
3044
3071
|
return {
|
|
3045
3072
|
success: !1,
|
|
3046
3073
|
errors: [
|
|
@@ -3065,10 +3092,10 @@ function ie(e) {
|
|
|
3065
3092
|
return;
|
|
3066
3093
|
}
|
|
3067
3094
|
try {
|
|
3068
|
-
const a =
|
|
3095
|
+
const a = K(s.composeCode);
|
|
3069
3096
|
r.push(a);
|
|
3070
3097
|
} catch (a) {
|
|
3071
|
-
const o = a instanceof Error ? a.message :
|
|
3098
|
+
const o = a instanceof Error ? a.message : xe;
|
|
3072
3099
|
t.push({
|
|
3073
3100
|
path: `filters[${n}]`,
|
|
3074
3101
|
input: s,
|
|
@@ -3077,7 +3104,7 @@ function ie(e) {
|
|
|
3077
3104
|
}
|
|
3078
3105
|
}), t.length > 0 ? { success: !1, errors: t } : { success: !0, data: r };
|
|
3079
3106
|
}
|
|
3080
|
-
function
|
|
3107
|
+
function Fe(e) {
|
|
3081
3108
|
if (!e)
|
|
3082
3109
|
return { success: !0, data: [] };
|
|
3083
3110
|
const t = [], r = [];
|
|
@@ -3092,10 +3119,10 @@ function be(e) {
|
|
|
3092
3119
|
return;
|
|
3093
3120
|
}
|
|
3094
3121
|
try {
|
|
3095
|
-
const a =
|
|
3122
|
+
const a = K(s.composeCode);
|
|
3096
3123
|
t.push(a);
|
|
3097
3124
|
} catch (a) {
|
|
3098
|
-
const o = a instanceof Error ? a.message :
|
|
3125
|
+
const o = a instanceof Error ? a.message : xe;
|
|
3099
3126
|
r.push({
|
|
3100
3127
|
path: `highlights[${n}]`,
|
|
3101
3128
|
input: s,
|
|
@@ -3104,14 +3131,14 @@ function be(e) {
|
|
|
3104
3131
|
}
|
|
3105
3132
|
}), r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
|
|
3106
3133
|
}
|
|
3107
|
-
function
|
|
3134
|
+
function nt(e) {
|
|
3108
3135
|
return typeof e == "object" && e !== null && "column" in e && e.column !== void 0;
|
|
3109
3136
|
}
|
|
3110
|
-
function
|
|
3137
|
+
function je(e) {
|
|
3111
3138
|
const t = [], r = [];
|
|
3112
3139
|
return e.forEach((s, n) => {
|
|
3113
3140
|
var u, c, g;
|
|
3114
|
-
const i =
|
|
3141
|
+
const i = nt(s) ? s.column : s, a = nt(s) ? s : void 0, o = () => rr(i);
|
|
3115
3142
|
if (!i.composeCode) {
|
|
3116
3143
|
r.push({
|
|
3117
3144
|
path: `measures[${n}]`,
|
|
@@ -3121,11 +3148,11 @@ function Ve(e) {
|
|
|
3121
3148
|
return;
|
|
3122
3149
|
}
|
|
3123
3150
|
try {
|
|
3124
|
-
const f =
|
|
3125
|
-
if (p !== void 0 && p !==
|
|
3126
|
-
const b = a ?
|
|
3151
|
+
const f = K(i.composeCode), p = (g = a != null && a.sortType ? yt(a.sortType) : void 0) != null ? g : ((u = i.getSort) == null ? void 0 : u.call(i)) !== void 0 && ((c = i.getSort) == null ? void 0 : c.call(i)) !== z.None ? i.getSort() : void 0;
|
|
3152
|
+
if (p !== void 0 && p !== z.None || a && Object.keys(U(a, "column")).length > 0) {
|
|
3153
|
+
const b = a ? U(a, "column") : {}, m = l(l({
|
|
3127
3154
|
column: f
|
|
3128
|
-
}, p !== void 0 && p !==
|
|
3155
|
+
}, p !== void 0 && p !== z.None && { sortType: ht(p) }), b);
|
|
3129
3156
|
t.push(m);
|
|
3130
3157
|
} else
|
|
3131
3158
|
t.push(f);
|
|
@@ -3139,42 +3166,42 @@ function Ve(e) {
|
|
|
3139
3166
|
}
|
|
3140
3167
|
}), r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
|
|
3141
3168
|
}
|
|
3142
|
-
function nt(e) {
|
|
3143
|
-
var t, r, s, n;
|
|
3144
|
-
return ((r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.trend")) != null ? r : !1) || ((n = (s = e.name) == null ? void 0 : s.startsWith(ht)) != null ? n : !1);
|
|
3145
|
-
}
|
|
3146
3169
|
function it(e) {
|
|
3147
3170
|
var t, r, s, n;
|
|
3148
|
-
return ((r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.
|
|
3171
|
+
return ((r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.trend")) != null ? r : !1) || ((n = (s = e.name) == null ? void 0 : s.startsWith(bt)) != null ? n : !1);
|
|
3149
3172
|
}
|
|
3150
3173
|
function at(e) {
|
|
3174
|
+
var t, r, s, n;
|
|
3175
|
+
return ((r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.forecast")) != null ? r : !1) || ((n = (s = e.name) == null ? void 0 : s.startsWith(Ft)) != null ? n : !1);
|
|
3176
|
+
}
|
|
3177
|
+
function ot(e) {
|
|
3151
3178
|
try {
|
|
3152
|
-
const t =
|
|
3179
|
+
const t = K(e.trim());
|
|
3153
3180
|
return t.args[2] != null && typeof t.args[2] == "object" ? t.args[2] : void 0;
|
|
3154
3181
|
} catch (t) {
|
|
3155
3182
|
return;
|
|
3156
3183
|
}
|
|
3157
3184
|
}
|
|
3158
|
-
function
|
|
3185
|
+
function Hn(e) {
|
|
3159
3186
|
var s, n, i;
|
|
3160
3187
|
if (!(e != null && e.length)) return [];
|
|
3161
3188
|
const t = /* @__PURE__ */ new Set(), r = [];
|
|
3162
3189
|
for (let a = 0; a < e.length; a++) {
|
|
3163
3190
|
if (t.has(a)) continue;
|
|
3164
3191
|
const o = e[a];
|
|
3165
|
-
if (
|
|
3192
|
+
if (it(o) || at(o)) {
|
|
3166
3193
|
r.push(o);
|
|
3167
3194
|
continue;
|
|
3168
3195
|
}
|
|
3169
|
-
const u = (s = o.name) != null ? s : "Measure", c = `${
|
|
3196
|
+
const u = (s = o.name) != null ? s : "Measure", c = `${bt}_${u}`, g = `${Ft}_${u}`;
|
|
3170
3197
|
let f, p, h = a + 1;
|
|
3171
|
-
if (h < e.length && !t.has(h) &&
|
|
3198
|
+
if (h < e.length && !t.has(h) && it(e[h]) && e[h].name === c) {
|
|
3172
3199
|
const b = (n = e[h].composeCode) == null ? void 0 : n.trim();
|
|
3173
|
-
b && (f =
|
|
3200
|
+
b && (f = ot(b), t.add(h), h++);
|
|
3174
3201
|
}
|
|
3175
|
-
if (h < e.length && !t.has(h) &&
|
|
3202
|
+
if (h < e.length && !t.has(h) && at(e[h]) && e[h].name === g) {
|
|
3176
3203
|
const b = (i = e[h].composeCode) == null ? void 0 : i.trim();
|
|
3177
|
-
b && (p =
|
|
3204
|
+
b && (p = ot(b), t.add(h));
|
|
3178
3205
|
}
|
|
3179
3206
|
f !== void 0 || p !== void 0 ? r.push(l(l({
|
|
3180
3207
|
column: o
|
|
@@ -3182,20 +3209,20 @@ function Kn(e) {
|
|
|
3182
3209
|
}
|
|
3183
3210
|
return r;
|
|
3184
3211
|
}
|
|
3185
|
-
function
|
|
3212
|
+
function Wi(e) {
|
|
3186
3213
|
const t = [], r = A(
|
|
3187
|
-
() =>
|
|
3214
|
+
() => Ve(e.dimensions || []),
|
|
3188
3215
|
t
|
|
3189
|
-
), s =
|
|
3190
|
-
() =>
|
|
3216
|
+
), s = Hn(e.measures || []), n = A(
|
|
3217
|
+
() => je(s),
|
|
3191
3218
|
t
|
|
3192
3219
|
), i = A(
|
|
3193
|
-
() =>
|
|
3220
|
+
() => ae(e.filters),
|
|
3194
3221
|
t
|
|
3195
3222
|
);
|
|
3196
3223
|
let a = null;
|
|
3197
3224
|
if (e.highlights && e.highlights.length > 0 && (a = A(
|
|
3198
|
-
() =>
|
|
3225
|
+
() => Fe(e.highlights),
|
|
3199
3226
|
t
|
|
3200
3227
|
)), t.length > 0)
|
|
3201
3228
|
return {
|
|
@@ -3213,9 +3240,9 @@ function Ui(e) {
|
|
|
3213
3240
|
data: L(o)
|
|
3214
3241
|
};
|
|
3215
3242
|
}
|
|
3216
|
-
const
|
|
3217
|
-
|
|
3218
|
-
),
|
|
3243
|
+
const sr = new Set(
|
|
3244
|
+
us.filter((e) => e !== "image")
|
|
3245
|
+
), ut = Object.freeze([...sr]), Ce = /* @__PURE__ */ new Set([
|
|
3219
3246
|
"category",
|
|
3220
3247
|
"value",
|
|
3221
3248
|
"breakBy",
|
|
@@ -3238,7 +3265,7 @@ const rr = new Set(
|
|
|
3238
3265
|
"min",
|
|
3239
3266
|
"max",
|
|
3240
3267
|
"seriesToColorMap"
|
|
3241
|
-
]),
|
|
3268
|
+
]), Qn = {
|
|
3242
3269
|
line: {
|
|
3243
3270
|
validAxes: /* @__PURE__ */ new Set(["category", "value", "breakBy", "seriesToColorMap"]),
|
|
3244
3271
|
requiredAxes: ["category", "value"]
|
|
@@ -3311,7 +3338,7 @@ const rr = new Set(
|
|
|
3311
3338
|
validAxes: /* @__PURE__ */ new Set(["category", "value", "breakBy", "seriesToColorMap"]),
|
|
3312
3339
|
requiredAxes: ["category", "value"]
|
|
3313
3340
|
}
|
|
3314
|
-
},
|
|
3341
|
+
}, Xn = /* @__PURE__ */ new Set([
|
|
3315
3342
|
"category",
|
|
3316
3343
|
"breakBy",
|
|
3317
3344
|
"breakByPoint",
|
|
@@ -3319,7 +3346,7 @@ const rr = new Set(
|
|
|
3319
3346
|
"geo",
|
|
3320
3347
|
"details",
|
|
3321
3348
|
"date"
|
|
3322
|
-
]),
|
|
3349
|
+
]), Zn = /* @__PURE__ */ new Set([
|
|
3323
3350
|
"value",
|
|
3324
3351
|
"size",
|
|
3325
3352
|
"colorBy",
|
|
@@ -3331,34 +3358,34 @@ const rr = new Set(
|
|
|
3331
3358
|
"max",
|
|
3332
3359
|
"color"
|
|
3333
3360
|
]);
|
|
3334
|
-
function
|
|
3335
|
-
const t =
|
|
3361
|
+
function ei(e) {
|
|
3362
|
+
const t = Qn[e];
|
|
3336
3363
|
if (t)
|
|
3337
3364
|
return {
|
|
3338
3365
|
validAxes: new Set(t.validAxes),
|
|
3339
3366
|
requiredAxes: Object.freeze([...t.requiredAxes])
|
|
3340
3367
|
};
|
|
3341
3368
|
}
|
|
3342
|
-
function
|
|
3343
|
-
return typeof e == "string" &&
|
|
3369
|
+
function nr(e) {
|
|
3370
|
+
return typeof e == "string" && sr.has(e);
|
|
3344
3371
|
}
|
|
3345
|
-
function
|
|
3346
|
-
if (r === "boxplot" && e === "value" || r === "calendar-heatmap" && e === "date" ||
|
|
3372
|
+
function ti(e, t, r) {
|
|
3373
|
+
if (r === "boxplot" && e === "value" || r === "calendar-heatmap" && e === "date" || Xn.has(e))
|
|
3347
3374
|
return !0;
|
|
3348
|
-
if (
|
|
3375
|
+
if (Zn.has(e))
|
|
3349
3376
|
return !1;
|
|
3350
3377
|
const s = Array.isArray(t) ? t[0] : t;
|
|
3351
3378
|
if (!s)
|
|
3352
3379
|
return !0;
|
|
3353
3380
|
let n;
|
|
3354
|
-
return
|
|
3381
|
+
return q(s) && "column" in s && (n = s.column), !(w(s) || n !== void 0 && w(n));
|
|
3355
3382
|
}
|
|
3356
|
-
function
|
|
3383
|
+
function ri(e) {
|
|
3357
3384
|
const t = [], r = {
|
|
3358
3385
|
chartType: "",
|
|
3359
3386
|
dataOptions: {}
|
|
3360
3387
|
};
|
|
3361
|
-
if (
|
|
3388
|
+
if (!q(e))
|
|
3362
3389
|
return t.push({
|
|
3363
3390
|
path: "chartType",
|
|
3364
3391
|
input: e,
|
|
@@ -3372,10 +3399,10 @@ function Zn(e) {
|
|
|
3372
3399
|
input: u,
|
|
3373
3400
|
message: `chartType is required.${o}`
|
|
3374
3401
|
});
|
|
3375
|
-
} else if (
|
|
3402
|
+
} else if (nr(s))
|
|
3376
3403
|
r.chartType = s;
|
|
3377
3404
|
else {
|
|
3378
|
-
const i = x(String(s),
|
|
3405
|
+
const i = x(String(s), ut, (u) => u), a = i && i.distance <= C ? ` Did you mean '${i.best}'?` : "", o = ut.slice(0, 8).join(", ");
|
|
3379
3406
|
t.push({
|
|
3380
3407
|
path: "chartType",
|
|
3381
3408
|
input: s,
|
|
@@ -3396,111 +3423,111 @@ function Zn(e) {
|
|
|
3396
3423
|
function D(e, t) {
|
|
3397
3424
|
return e === -1 ? "dataOptions" : typeof e == "number" ? `dataOptions[${e}]` : t !== void 0 ? `dataOptions.${e}[${t}]` : `dataOptions.${e}`;
|
|
3398
3425
|
}
|
|
3399
|
-
function
|
|
3426
|
+
function ir(e, t) {
|
|
3400
3427
|
return e ? t ? `${e}.${t}` : e : t != null ? t : "";
|
|
3401
3428
|
}
|
|
3402
|
-
function
|
|
3429
|
+
function si(e) {
|
|
3403
3430
|
return (t) => E(l({}, t), {
|
|
3404
|
-
path:
|
|
3431
|
+
path: ir(e, t.path)
|
|
3405
3432
|
});
|
|
3406
3433
|
}
|
|
3407
|
-
function
|
|
3408
|
-
return
|
|
3434
|
+
function ar(e) {
|
|
3435
|
+
return si(`widgets[${e}]`);
|
|
3409
3436
|
}
|
|
3410
|
-
function
|
|
3437
|
+
function or(e, t) {
|
|
3411
3438
|
return e.map(t);
|
|
3412
3439
|
}
|
|
3413
|
-
function
|
|
3440
|
+
function ni(e) {
|
|
3414
3441
|
return e.map(
|
|
3415
3442
|
({ attribute: t, style: r }) => r ? l({ column: t }, r) : t
|
|
3416
3443
|
);
|
|
3417
3444
|
}
|
|
3418
|
-
function
|
|
3445
|
+
function ii(e) {
|
|
3419
3446
|
return e.map(
|
|
3420
3447
|
({ measure: t, style: r }) => r ? l({ column: t }, r) : t
|
|
3421
3448
|
);
|
|
3422
3449
|
}
|
|
3423
|
-
function
|
|
3450
|
+
function ai(e) {
|
|
3424
3451
|
return Array.isArray(e) ? e : [e];
|
|
3425
3452
|
}
|
|
3426
|
-
function
|
|
3453
|
+
function oi(e) {
|
|
3427
3454
|
return Array.isArray(e) ? e : [e];
|
|
3428
3455
|
}
|
|
3429
|
-
function
|
|
3456
|
+
function ui(e) {
|
|
3430
3457
|
return Array.isArray(e) ? e : [e];
|
|
3431
3458
|
}
|
|
3432
|
-
const
|
|
3433
|
-
function
|
|
3459
|
+
const ci = /^(dimensions|measures|filters|highlights)(\[\d+\])?$/;
|
|
3460
|
+
function Ne(e) {
|
|
3434
3461
|
return (t) => {
|
|
3435
3462
|
const r = t.path.match(/\[(\d+)\]$/), s = r ? Number(r[1]) : void 0, n = D(e, s);
|
|
3436
|
-
if (
|
|
3463
|
+
if (ci.test(t.path) || t.path.startsWith("dataOptions"))
|
|
3437
3464
|
return E(l({}, t), { path: n });
|
|
3438
3465
|
const i = t.path.replace(/\[\d+\]$/, "");
|
|
3439
3466
|
return E(l({}, t), {
|
|
3440
|
-
path:
|
|
3467
|
+
path: ir(i, n)
|
|
3441
3468
|
});
|
|
3442
3469
|
};
|
|
3443
3470
|
}
|
|
3444
|
-
function
|
|
3471
|
+
function fe(e, t, r, s, n) {
|
|
3445
3472
|
if (r === "dimension") {
|
|
3446
|
-
const o = t ?
|
|
3473
|
+
const o = t ? ai(t) : [];
|
|
3447
3474
|
if (o.length === 0)
|
|
3448
3475
|
return [];
|
|
3449
3476
|
const u = A(
|
|
3450
|
-
() =>
|
|
3477
|
+
() => Wt({
|
|
3451
3478
|
data: o,
|
|
3452
3479
|
context: s
|
|
3453
3480
|
}),
|
|
3454
3481
|
n,
|
|
3455
|
-
|
|
3482
|
+
Ne(e)
|
|
3456
3483
|
);
|
|
3457
|
-
return u !== null ?
|
|
3484
|
+
return u !== null ? ni(u) : null;
|
|
3458
3485
|
}
|
|
3459
|
-
const i = t ?
|
|
3486
|
+
const i = t ? oi(t) : [];
|
|
3460
3487
|
if (i.length === 0)
|
|
3461
3488
|
return [];
|
|
3462
3489
|
const a = A(
|
|
3463
|
-
() =>
|
|
3490
|
+
() => tr({
|
|
3464
3491
|
data: i,
|
|
3465
3492
|
context: s
|
|
3466
3493
|
}),
|
|
3467
3494
|
n,
|
|
3468
|
-
|
|
3495
|
+
Ne(e)
|
|
3469
3496
|
);
|
|
3470
|
-
return a !== null ?
|
|
3497
|
+
return a !== null ? ii(a) : null;
|
|
3471
3498
|
}
|
|
3472
|
-
const
|
|
3499
|
+
const ct = (e, t) => {
|
|
3473
3500
|
const r = t.path.match(/\[(\d+)\]$/), s = r ? Number(r[1]) : void 0;
|
|
3474
3501
|
return E(l({}, t), { path: D(e, s) });
|
|
3475
3502
|
};
|
|
3476
|
-
function
|
|
3503
|
+
function lt(e, t, r) {
|
|
3477
3504
|
const s = Array.isArray(t) ? t : t != null ? [t] : [];
|
|
3478
3505
|
if (r === "dimension") {
|
|
3479
|
-
const i =
|
|
3506
|
+
const i = Ve(
|
|
3480
3507
|
s
|
|
3481
3508
|
);
|
|
3482
3509
|
return i.success ? { success: !0, data: i.data } : {
|
|
3483
3510
|
success: !1,
|
|
3484
|
-
errors: i.errors.map((a) =>
|
|
3511
|
+
errors: i.errors.map((a) => ct(e, a))
|
|
3485
3512
|
};
|
|
3486
3513
|
}
|
|
3487
|
-
const n =
|
|
3514
|
+
const n = je(s);
|
|
3488
3515
|
return n.success ? { success: !0, data: n.data } : {
|
|
3489
3516
|
success: !1,
|
|
3490
|
-
errors: n.errors.map((i) =>
|
|
3517
|
+
errors: n.errors.map((i) => ct(e, i))
|
|
3491
3518
|
};
|
|
3492
3519
|
}
|
|
3493
|
-
function
|
|
3520
|
+
function li(e, t) {
|
|
3494
3521
|
let r;
|
|
3495
|
-
|
|
3496
|
-
const n = !(w(e) || r !== void 0 && w(r)) ? "dimension" : "measure", i = [], a =
|
|
3522
|
+
q(e) && "column" in e && (r = e.column);
|
|
3523
|
+
const n = !(w(e) || r !== void 0 && w(r)) ? "dimension" : "measure", i = [], a = fe("columns", [e], n, t, i);
|
|
3497
3524
|
return a !== null ? { success: !0, data: a } : { success: !1, errors: i };
|
|
3498
3525
|
}
|
|
3499
|
-
function
|
|
3526
|
+
function fi(e, t, r, s) {
|
|
3500
3527
|
const n = [];
|
|
3501
3528
|
for (const i of e) {
|
|
3502
3529
|
const a = A(
|
|
3503
|
-
() =>
|
|
3530
|
+
() => li(i, t),
|
|
3504
3531
|
r,
|
|
3505
3532
|
s
|
|
3506
3533
|
);
|
|
@@ -3508,8 +3535,8 @@ function ui(e, t, r, s) {
|
|
|
3508
3535
|
}
|
|
3509
3536
|
return n;
|
|
3510
3537
|
}
|
|
3511
|
-
function
|
|
3512
|
-
if (!e ||
|
|
3538
|
+
function di(e, t, r) {
|
|
3539
|
+
if (!e || !q(e))
|
|
3513
3540
|
return r.push({
|
|
3514
3541
|
path: D(-1),
|
|
3515
3542
|
input: e,
|
|
@@ -3517,18 +3544,18 @@ function ci(e, t, r) {
|
|
|
3517
3544
|
}), null;
|
|
3518
3545
|
const s = {}, { chartType: n } = t, i = r.length, a = e, o = Object.keys(e), u = /* @__PURE__ */ new Map();
|
|
3519
3546
|
for (const f of o)
|
|
3520
|
-
if (!
|
|
3521
|
-
const p = x(f, [...
|
|
3547
|
+
if (!Ce.has(f)) {
|
|
3548
|
+
const p = x(f, [...Ce], (b) => b), h = p && p.distance <= C ? ` Did you mean '${p.best}'?` : "";
|
|
3522
3549
|
p && p.distance <= C && u.set(f, p.best), r.push({
|
|
3523
3550
|
path: D(f),
|
|
3524
3551
|
input: a[f],
|
|
3525
3552
|
message: `Unknown dataOptions key '${f}'.${h}`
|
|
3526
3553
|
});
|
|
3527
3554
|
}
|
|
3528
|
-
const c = n ?
|
|
3555
|
+
const c = n ? ei(n) : void 0;
|
|
3529
3556
|
if (c) {
|
|
3530
3557
|
for (const f of o)
|
|
3531
|
-
if (f !== "seriesToColorMap" && !c.validAxes.has(f) &&
|
|
3558
|
+
if (f !== "seriesToColorMap" && !c.validAxes.has(f) && Ce.has(f)) {
|
|
3532
3559
|
const p = x(f, [...c.validAxes], (m) => m), h = p && p.distance <= C ? ` Did you mean '${p.best}'?` : "", b = [...c.validAxes].join(", ");
|
|
3533
3560
|
r.push({
|
|
3534
3561
|
path: D(f),
|
|
@@ -3566,15 +3593,15 @@ function ci(e, t, r) {
|
|
|
3566
3593
|
continue;
|
|
3567
3594
|
}
|
|
3568
3595
|
if (f === "columns") {
|
|
3569
|
-
s[f] =
|
|
3570
|
-
|
|
3596
|
+
s[f] = fi(
|
|
3597
|
+
ui(p),
|
|
3571
3598
|
t,
|
|
3572
3599
|
r,
|
|
3573
|
-
|
|
3600
|
+
Ne("columns")
|
|
3574
3601
|
);
|
|
3575
3602
|
continue;
|
|
3576
3603
|
}
|
|
3577
|
-
const h =
|
|
3604
|
+
const h = ti(f, p, n) ? "dimension" : "measure", b = fe(
|
|
3578
3605
|
f,
|
|
3579
3606
|
p,
|
|
3580
3607
|
h,
|
|
@@ -3588,29 +3615,29 @@ function ci(e, t, r) {
|
|
|
3588
3615
|
}
|
|
3589
3616
|
return r.length > i ? null : s;
|
|
3590
3617
|
}
|
|
3591
|
-
function
|
|
3618
|
+
function mi(e) {
|
|
3592
3619
|
if (typeof e != "string") return "iqr";
|
|
3593
3620
|
const t = e.split("/")[1];
|
|
3594
3621
|
return t === "iqr" || t === "extremums" || t === "standardDeviation" ? t : "iqr";
|
|
3595
3622
|
}
|
|
3596
|
-
const
|
|
3623
|
+
const pi = (e) => {
|
|
3597
3624
|
var m;
|
|
3598
|
-
const { data: t, context: r } = e, { dataSource: s, tables: n } = r, { normalized: i, errors: a } =
|
|
3625
|
+
const { data: t, context: r } = e, { dataSource: s, tables: n } = r, { normalized: i, errors: a } = ri(t);
|
|
3599
3626
|
if (a.length > 0)
|
|
3600
3627
|
return { success: !1, errors: a };
|
|
3601
|
-
const o = i.chartType, u =
|
|
3602
|
-
let g =
|
|
3628
|
+
const o = i.chartType, u = ne(n), c = [];
|
|
3629
|
+
let g = di(
|
|
3603
3630
|
i.dataOptions,
|
|
3604
3631
|
{ dataSource: s, schemaIndex: u, chartType: o },
|
|
3605
3632
|
c
|
|
3606
3633
|
);
|
|
3607
3634
|
if (o === "boxplot" && g) {
|
|
3608
|
-
const F =
|
|
3635
|
+
const F = mi((m = i.styleOptions) == null ? void 0 : m.subtype), O = F === "iqr" || F === "standardDeviation";
|
|
3609
3636
|
g = E(l({}, g), { boxType: F, outliersEnabled: O });
|
|
3610
3637
|
}
|
|
3611
3638
|
let f = null;
|
|
3612
3639
|
i.filters && i.filters.length > 0 && (f = A(
|
|
3613
|
-
() =>
|
|
3640
|
+
() => ie({
|
|
3614
3641
|
data: i.filters || [],
|
|
3615
3642
|
context: { dataSource: s, schemaIndex: u }
|
|
3616
3643
|
}),
|
|
@@ -3618,7 +3645,7 @@ const fi = (e) => {
|
|
|
3618
3645
|
));
|
|
3619
3646
|
let p = null;
|
|
3620
3647
|
if (i.highlights && i.highlights.length > 0 && (p = A(
|
|
3621
|
-
() =>
|
|
3648
|
+
() => be({
|
|
3622
3649
|
data: i.highlights || [],
|
|
3623
3650
|
context: { dataSource: s, schemaIndex: u }
|
|
3624
3651
|
}),
|
|
@@ -3628,7 +3655,7 @@ const fi = (e) => {
|
|
|
3628
3655
|
success: !1,
|
|
3629
3656
|
errors: c
|
|
3630
3657
|
};
|
|
3631
|
-
if (!
|
|
3658
|
+
if (!nr(i.chartType))
|
|
3632
3659
|
return {
|
|
3633
3660
|
success: !1,
|
|
3634
3661
|
errors: [
|
|
@@ -3643,7 +3670,7 @@ const fi = (e) => {
|
|
|
3643
3670
|
return {
|
|
3644
3671
|
success: !0,
|
|
3645
3672
|
data: l(l(l({
|
|
3646
|
-
dataSet:
|
|
3673
|
+
dataSet: me(s),
|
|
3647
3674
|
chartType: h,
|
|
3648
3675
|
dataOptions: g
|
|
3649
3676
|
}, i.styleOptions && {
|
|
@@ -3651,7 +3678,7 @@ const fi = (e) => {
|
|
|
3651
3678
|
styleOptions: i.styleOptions
|
|
3652
3679
|
}), f && { filters: f }), p && { highlights: p })
|
|
3653
3680
|
};
|
|
3654
|
-
},
|
|
3681
|
+
}, gi = (e) => {
|
|
3655
3682
|
const t = [];
|
|
3656
3683
|
if (!e.chartType)
|
|
3657
3684
|
return {
|
|
@@ -3676,12 +3703,12 @@ const fi = (e) => {
|
|
|
3676
3703
|
]
|
|
3677
3704
|
};
|
|
3678
3705
|
let r = null;
|
|
3679
|
-
const s =
|
|
3706
|
+
const s = yi(e.dataOptions);
|
|
3680
3707
|
s.success ? r = s.data : t.push(...s.errors);
|
|
3681
3708
|
let n;
|
|
3682
3709
|
if (e.filters) {
|
|
3683
3710
|
const o = A(
|
|
3684
|
-
() =>
|
|
3711
|
+
() => ae(e.filters),
|
|
3685
3712
|
t
|
|
3686
3713
|
);
|
|
3687
3714
|
n = o != null ? o : void 0;
|
|
@@ -3689,7 +3716,7 @@ const fi = (e) => {
|
|
|
3689
3716
|
let i;
|
|
3690
3717
|
if (e.highlights && e.highlights.length > 0) {
|
|
3691
3718
|
const o = A(
|
|
3692
|
-
() =>
|
|
3719
|
+
() => Fe(e.highlights),
|
|
3693
3720
|
t
|
|
3694
3721
|
);
|
|
3695
3722
|
i = o != null ? o : void 0;
|
|
@@ -3707,7 +3734,7 @@ const fi = (e) => {
|
|
|
3707
3734
|
data: L(a)
|
|
3708
3735
|
};
|
|
3709
3736
|
};
|
|
3710
|
-
function
|
|
3737
|
+
function yi(e) {
|
|
3711
3738
|
const t = {}, r = [], s = /* @__PURE__ */ new Set(["seriesToColorMap", "boxType", "outliersEnabled", "valueTitle"]);
|
|
3712
3739
|
for (const [n, i] of Object.entries(e)) {
|
|
3713
3740
|
if (n === "seriesToColorMap" && i) {
|
|
@@ -3720,9 +3747,9 @@ function mi(e) {
|
|
|
3720
3747
|
}
|
|
3721
3748
|
const a = Array.isArray(i) ? i : [i], o = Array.isArray(i), u = [], c = [];
|
|
3722
3749
|
for (let g = 0; g < a.length; g++) {
|
|
3723
|
-
const f = a[g], h =
|
|
3750
|
+
const f = a[g], h = hi(f) ? Ve([
|
|
3724
3751
|
f
|
|
3725
|
-
]) :
|
|
3752
|
+
]) : je([f]);
|
|
3726
3753
|
h.success ? u.push(...h.data) : h.errors.forEach((b) => {
|
|
3727
3754
|
var m;
|
|
3728
3755
|
c.push(E(l({}, b), {
|
|
@@ -3739,11 +3766,11 @@ function mi(e) {
|
|
|
3739
3766
|
}
|
|
3740
3767
|
return r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
|
|
3741
3768
|
}
|
|
3742
|
-
function
|
|
3769
|
+
function hi(e) {
|
|
3743
3770
|
const t = Array.isArray(e) ? e[0] : e;
|
|
3744
|
-
if (!t ||
|
|
3771
|
+
if (!t || !q(t))
|
|
3745
3772
|
return !0;
|
|
3746
|
-
const r = "column" in t && t.column != null &&
|
|
3773
|
+
const r = "column" in t && t.column != null && q(t.column) ? t.column : t;
|
|
3747
3774
|
if ("composeCode" in r) {
|
|
3748
3775
|
const s = r.composeCode;
|
|
3749
3776
|
if (typeof s == "string" && s.startsWith("DM."))
|
|
@@ -3758,17 +3785,17 @@ function pi(e) {
|
|
|
3758
3785
|
}
|
|
3759
3786
|
return !("aggregation" in r || "attribute" in r && "aggregation" in r);
|
|
3760
3787
|
}
|
|
3761
|
-
const
|
|
3762
|
-
function
|
|
3763
|
-
if (
|
|
3788
|
+
const ft = ["rows", "columns", "values", "grandTotals"];
|
|
3789
|
+
function bi(e) {
|
|
3790
|
+
if (!q(e)) return !1;
|
|
3764
3791
|
const t = Object.keys(e);
|
|
3765
3792
|
return t.every((r) => r === "rows" || r === "columns") && t.every((r) => typeof e[r] == "boolean");
|
|
3766
3793
|
}
|
|
3767
|
-
function
|
|
3794
|
+
function Fi(e) {
|
|
3768
3795
|
const t = [], r = {
|
|
3769
3796
|
dataOptions: {}
|
|
3770
3797
|
};
|
|
3771
|
-
if (
|
|
3798
|
+
if (!q(e))
|
|
3772
3799
|
return t.push({
|
|
3773
3800
|
path: "dataOptions",
|
|
3774
3801
|
input: e,
|
|
@@ -3782,12 +3809,12 @@ function yi(e) {
|
|
|
3782
3809
|
input: o,
|
|
3783
3810
|
message: `dataOptions is required.${a}`
|
|
3784
3811
|
});
|
|
3785
|
-
} else if (
|
|
3812
|
+
} else if (q(s)) {
|
|
3786
3813
|
const n = s;
|
|
3787
3814
|
r.dataOptions = n;
|
|
3788
3815
|
for (const a of Object.keys(n))
|
|
3789
|
-
if (!
|
|
3790
|
-
const o = x(a, [...
|
|
3816
|
+
if (!ft.includes(a)) {
|
|
3817
|
+
const o = x(a, [...ft], (c) => c), u = o && o.distance <= C ? ` Did you mean '${o.best}'?` : "";
|
|
3791
3818
|
t.push({
|
|
3792
3819
|
path: D(a),
|
|
3793
3820
|
input: n[a],
|
|
@@ -3803,7 +3830,7 @@ function yi(e) {
|
|
|
3803
3830
|
});
|
|
3804
3831
|
}
|
|
3805
3832
|
const i = n.grandTotals;
|
|
3806
|
-
i != null && !
|
|
3833
|
+
i != null && !bi(i) && t.push({
|
|
3807
3834
|
path: D("grandTotals"),
|
|
3808
3835
|
input: i,
|
|
3809
3836
|
message: "grandTotals must be an object with optional rows?: boolean, columns?: boolean"
|
|
@@ -3811,7 +3838,7 @@ function yi(e) {
|
|
|
3811
3838
|
}
|
|
3812
3839
|
return e.styleOptions !== void 0 && (r.styleOptions = e.styleOptions), e.filters !== void 0 && Array.isArray(e.filters) && (r.filters = e.filters), e.highlights !== void 0 && Array.isArray(e.highlights) && (r.highlights = e.highlights), { normalized: r, errors: t };
|
|
3813
3840
|
}
|
|
3814
|
-
function
|
|
3841
|
+
function Ei(e, t, r) {
|
|
3815
3842
|
if (!e || typeof e != "object")
|
|
3816
3843
|
return r.push({
|
|
3817
3844
|
path: D(-1),
|
|
@@ -3820,7 +3847,7 @@ function hi(e, t, r) {
|
|
|
3820
3847
|
}), null;
|
|
3821
3848
|
const s = {}, n = r.length;
|
|
3822
3849
|
for (const a of ["rows", "columns"]) {
|
|
3823
|
-
const o =
|
|
3850
|
+
const o = fe(
|
|
3824
3851
|
a,
|
|
3825
3852
|
e[a],
|
|
3826
3853
|
"dimension",
|
|
@@ -3829,7 +3856,7 @@ function hi(e, t, r) {
|
|
|
3829
3856
|
);
|
|
3830
3857
|
o && (s[a] = o);
|
|
3831
3858
|
}
|
|
3832
|
-
const i =
|
|
3859
|
+
const i = fe(
|
|
3833
3860
|
"values",
|
|
3834
3861
|
e.values,
|
|
3835
3862
|
"measure",
|
|
@@ -3838,18 +3865,18 @@ function hi(e, t, r) {
|
|
|
3838
3865
|
);
|
|
3839
3866
|
return i && (s.values = i), e.grandTotals !== void 0 && (s.grandTotals = e.grandTotals), r.length > n ? null : s;
|
|
3840
3867
|
}
|
|
3841
|
-
const
|
|
3842
|
-
const { data: t, context: r } = e, { dataSource: s, tables: n } = r, { normalized: i, errors: a } =
|
|
3868
|
+
const Ai = (e) => {
|
|
3869
|
+
const { data: t, context: r } = e, { dataSource: s, tables: n } = r, { normalized: i, errors: a } = Fi(t);
|
|
3843
3870
|
if (a.length > 0)
|
|
3844
3871
|
return { success: !1, errors: a };
|
|
3845
|
-
const o =
|
|
3872
|
+
const o = ne(n), u = [], c = Ei(
|
|
3846
3873
|
i.dataOptions,
|
|
3847
3874
|
{ dataSource: s, schemaIndex: o },
|
|
3848
3875
|
u
|
|
3849
3876
|
);
|
|
3850
3877
|
let g = null;
|
|
3851
3878
|
i.filters && i.filters.length > 0 && (g = A(
|
|
3852
|
-
() =>
|
|
3879
|
+
() => ie({
|
|
3853
3880
|
data: i.filters || [],
|
|
3854
3881
|
context: { dataSource: s, schemaIndex: o }
|
|
3855
3882
|
}),
|
|
@@ -3857,7 +3884,7 @@ const bi = (e) => {
|
|
|
3857
3884
|
));
|
|
3858
3885
|
let f = null;
|
|
3859
3886
|
return i.highlights && i.highlights.length > 0 && (f = A(
|
|
3860
|
-
() =>
|
|
3887
|
+
() => be({
|
|
3861
3888
|
data: i.highlights || [],
|
|
3862
3889
|
context: { dataSource: s, schemaIndex: o }
|
|
3863
3890
|
}),
|
|
@@ -3868,11 +3895,11 @@ const bi = (e) => {
|
|
|
3868
3895
|
} : {
|
|
3869
3896
|
success: !0,
|
|
3870
3897
|
data: l(l(l({
|
|
3871
|
-
dataSet:
|
|
3898
|
+
dataSet: me(s),
|
|
3872
3899
|
dataOptions: c
|
|
3873
3900
|
}, i.styleOptions && { styleOptions: i.styleOptions }), g && { filters: g }), f && { highlights: f })
|
|
3874
3901
|
};
|
|
3875
|
-
},
|
|
3902
|
+
}, Ti = (e) => {
|
|
3876
3903
|
const t = [];
|
|
3877
3904
|
if (!e.dataOptions)
|
|
3878
3905
|
return {
|
|
@@ -3889,20 +3916,20 @@ const bi = (e) => {
|
|
|
3889
3916
|
for (const u of ["rows", "columns"]) {
|
|
3890
3917
|
const c = r[u];
|
|
3891
3918
|
if (c && c.length > 0) {
|
|
3892
|
-
const g =
|
|
3919
|
+
const g = lt(u, c, "dimension");
|
|
3893
3920
|
g.success ? s[u] = g.data : t.push(...g.errors);
|
|
3894
3921
|
}
|
|
3895
3922
|
}
|
|
3896
3923
|
const n = r.values;
|
|
3897
3924
|
if (n && n.length > 0) {
|
|
3898
|
-
const u =
|
|
3925
|
+
const u = lt("values", n, "measure");
|
|
3899
3926
|
u.success ? s.values = u.data : t.push(...u.errors);
|
|
3900
3927
|
}
|
|
3901
3928
|
r.grandTotals !== void 0 && (s.grandTotals = r.grandTotals);
|
|
3902
3929
|
let i;
|
|
3903
3930
|
if (e.filters) {
|
|
3904
3931
|
const u = A(
|
|
3905
|
-
() =>
|
|
3932
|
+
() => ae(e.filters),
|
|
3906
3933
|
t
|
|
3907
3934
|
);
|
|
3908
3935
|
i = u != null ? u : void 0;
|
|
@@ -3910,7 +3937,7 @@ const bi = (e) => {
|
|
|
3910
3937
|
let a;
|
|
3911
3938
|
if (e.highlights && e.highlights.length > 0) {
|
|
3912
3939
|
const u = A(
|
|
3913
|
-
() =>
|
|
3940
|
+
() => Fe(e.highlights),
|
|
3914
3941
|
t
|
|
3915
3942
|
);
|
|
3916
3943
|
a = u != null ? u : void 0;
|
|
@@ -3924,19 +3951,19 @@ const bi = (e) => {
|
|
|
3924
3951
|
success: !0,
|
|
3925
3952
|
data: L(o)
|
|
3926
3953
|
};
|
|
3927
|
-
},
|
|
3928
|
-
const s =
|
|
3929
|
-
() =>
|
|
3954
|
+
}, wi = (e, t, r) => {
|
|
3955
|
+
const s = ne(r.tables), n = { dataSource: r.dataSource, schemaIndex: s }, i = [], a = e && e.length > 0 ? A(
|
|
3956
|
+
() => ie({ data: e, context: n }),
|
|
3930
3957
|
i
|
|
3931
3958
|
) : void 0, o = t && t.length > 0 ? A(
|
|
3932
|
-
() =>
|
|
3959
|
+
() => be({ data: t, context: n }),
|
|
3933
3960
|
i
|
|
3934
3961
|
) : void 0;
|
|
3935
3962
|
return i.length > 0 ? { success: !1, errors: i } : {
|
|
3936
3963
|
success: !0,
|
|
3937
3964
|
data: l(l({}, a != null && { filters: a }), o != null && { highlights: o })
|
|
3938
3965
|
};
|
|
3939
|
-
},
|
|
3966
|
+
}, Si = [
|
|
3940
3967
|
"widgetType",
|
|
3941
3968
|
"id",
|
|
3942
3969
|
"title",
|
|
@@ -3944,8 +3971,8 @@ const bi = (e) => {
|
|
|
3944
3971
|
"dataSource",
|
|
3945
3972
|
"config",
|
|
3946
3973
|
"highlightSelectionDisabled"
|
|
3947
|
-
],
|
|
3948
|
-
const { id: n, title: i, description: a, dataSource: o, config: u, highlightSelectionDisabled: c } = e, g =
|
|
3974
|
+
], dt = (e, t, r, s) => {
|
|
3975
|
+
const { id: n, title: i, description: a, dataSource: o, config: u, highlightSelectionDisabled: c } = e, g = U(e, Si), f = r({ data: g, context: t });
|
|
3949
3976
|
return f.success ? {
|
|
3950
3977
|
success: !0,
|
|
3951
3978
|
data: s(f.data, {
|
|
@@ -3957,23 +3984,23 @@ const bi = (e) => {
|
|
|
3957
3984
|
highlightSelectionDisabled: c
|
|
3958
3985
|
})
|
|
3959
3986
|
} : f;
|
|
3960
|
-
},
|
|
3961
|
-
const n = e, { dataSet: r } = n, s =
|
|
3987
|
+
}, Ci = (e, t) => {
|
|
3988
|
+
const n = e, { dataSet: r } = n, s = Ee(n, ["dataSet"]);
|
|
3962
3989
|
return l(l(l(l(l(E(l({}, s), {
|
|
3963
3990
|
widgetType: "chart",
|
|
3964
3991
|
id: t.id
|
|
3965
|
-
}), t.dataSource !== void 0 ? { dataSource: t.dataSource } : r !== void 0 &&
|
|
3992
|
+
}), t.dataSource !== void 0 ? { dataSource: t.dataSource } : r !== void 0 && Et(r) && { dataSource: r }), t.config !== void 0 && { config: t.config }), t.highlightSelectionDisabled !== void 0 && {
|
|
3966
3993
|
highlightSelectionDisabled: t.highlightSelectionDisabled
|
|
3967
3994
|
}), t.title !== void 0 && { title: t.title }), t.description !== void 0 && { description: t.description });
|
|
3968
|
-
},
|
|
3969
|
-
const n = e, { dataSet: r } = n, s =
|
|
3995
|
+
}, Oi = (e, t) => {
|
|
3996
|
+
const n = e, { dataSet: r } = n, s = Ee(n, ["dataSet"]);
|
|
3970
3997
|
return l(l(l(l(E(l({}, s), {
|
|
3971
3998
|
widgetType: "pivot",
|
|
3972
3999
|
id: t.id
|
|
3973
|
-
}), t.dataSource !== void 0 ? { dataSource: t.dataSource } : r !== void 0 &&
|
|
3974
|
-
},
|
|
3975
|
-
function
|
|
3976
|
-
if (
|
|
4000
|
+
}), t.dataSource !== void 0 ? { dataSource: t.dataSource } : r !== void 0 && Et(r) && { dataSource: r }), t.config !== void 0 && { config: t.config }), t.title !== void 0 && { title: t.title }), t.description !== void 0 && { description: t.description });
|
|
4001
|
+
}, ve = ["chart", "pivot", "text", "custom"], $i = (e) => typeof e == "string" && ve.includes(e);
|
|
4002
|
+
function qi(e) {
|
|
4003
|
+
if (!q(e))
|
|
3977
4004
|
return {
|
|
3978
4005
|
path: "widgetType",
|
|
3979
4006
|
input: e,
|
|
@@ -3988,8 +4015,8 @@ function Ci(e) {
|
|
|
3988
4015
|
message: `widgetType is required.${n}`
|
|
3989
4016
|
};
|
|
3990
4017
|
}
|
|
3991
|
-
if (
|
|
3992
|
-
const r = x(String(t),
|
|
4018
|
+
if (!$i(t)) {
|
|
4019
|
+
const r = x(String(t), ve, (i) => i), s = r && r.distance <= C ? ` Did you mean '${r.best}'?` : "", n = ve.join(", ");
|
|
3993
4020
|
return {
|
|
3994
4021
|
path: "widgetType",
|
|
3995
4022
|
input: t,
|
|
@@ -4000,30 +4027,30 @@ function Ci(e) {
|
|
|
4000
4027
|
}
|
|
4001
4028
|
return null;
|
|
4002
4029
|
}
|
|
4003
|
-
const
|
|
4030
|
+
const Di = (e) => ({
|
|
4004
4031
|
path: "id",
|
|
4005
4032
|
input: e,
|
|
4006
4033
|
message: "Widget id is required"
|
|
4007
|
-
}),
|
|
4008
|
-
const { data: t, context: r } = e, s =
|
|
4034
|
+
}), xi = (e) => !!e.id, Ni = (e) => {
|
|
4035
|
+
const { data: t, context: r } = e, s = qi(t);
|
|
4009
4036
|
if (s)
|
|
4010
4037
|
return { success: !1, errors: [s] };
|
|
4011
|
-
if (!
|
|
4012
|
-
return { success: !1, errors: [
|
|
4038
|
+
if (!xi(t))
|
|
4039
|
+
return { success: !1, errors: [Di(t)] };
|
|
4013
4040
|
switch (t.widgetType) {
|
|
4014
4041
|
case "chart":
|
|
4015
|
-
return
|
|
4042
|
+
return dt(
|
|
4016
4043
|
t,
|
|
4017
4044
|
r,
|
|
4018
|
-
|
|
4019
|
-
|
|
4045
|
+
pi,
|
|
4046
|
+
Ci
|
|
4020
4047
|
);
|
|
4021
4048
|
case "pivot":
|
|
4022
|
-
return
|
|
4049
|
+
return dt(
|
|
4023
4050
|
t,
|
|
4024
4051
|
r,
|
|
4025
|
-
|
|
4026
|
-
|
|
4052
|
+
Ai,
|
|
4053
|
+
Oi
|
|
4027
4054
|
);
|
|
4028
4055
|
case "text":
|
|
4029
4056
|
return { success: !0, data: l({
|
|
@@ -4044,12 +4071,12 @@ const Oi = (e) => ({
|
|
|
4044
4071
|
dataOptions: p,
|
|
4045
4072
|
styleOptions: h,
|
|
4046
4073
|
customOptions: b
|
|
4047
|
-
} = t, m =
|
|
4074
|
+
} = t, m = wi(g, f, r);
|
|
4048
4075
|
return m.success ? { success: !0, data: l(l(l(l(l(l({
|
|
4049
4076
|
widgetType: "custom",
|
|
4050
4077
|
id: n,
|
|
4051
4078
|
customWidgetType: i,
|
|
4052
|
-
dataSource: u !== void 0 ? u :
|
|
4079
|
+
dataSource: u !== void 0 ? u : me(r.dataSource),
|
|
4053
4080
|
dataOptions: p != null ? p : {}
|
|
4054
4081
|
}, a !== void 0 && { title: a }), o !== void 0 && { description: o }), c !== void 0 && { config: c }), h !== void 0 && { styleOptions: h }), b !== void 0 && { customOptions: b }), m.data) } : m;
|
|
4055
4082
|
}
|
|
@@ -4067,17 +4094,17 @@ const Oi = (e) => ({
|
|
|
4067
4094
|
]
|
|
4068
4095
|
};
|
|
4069
4096
|
}
|
|
4070
|
-
},
|
|
4097
|
+
}, vi = (e) => {
|
|
4071
4098
|
const { widgetType: t } = e;
|
|
4072
4099
|
switch (t) {
|
|
4073
4100
|
case "chart": {
|
|
4074
|
-
const r =
|
|
4101
|
+
const r = gi(e);
|
|
4075
4102
|
if (!r.success) return r;
|
|
4076
4103
|
const s = l(l(l(l(l(E(l({}, r.data), {
|
|
4077
4104
|
widgetType: "chart",
|
|
4078
4105
|
id: e.id
|
|
4079
4106
|
}), e.title !== void 0 && { title: e.title }), e.description !== void 0 && { description: e.description }), e.dataSource !== void 0 && {
|
|
4080
|
-
dataSource:
|
|
4107
|
+
dataSource: ce(e.dataSource)
|
|
4081
4108
|
}), e.config !== void 0 && { config: e.config }), e.highlightSelectionDisabled !== void 0 && {
|
|
4082
4109
|
highlightSelectionDisabled: e.highlightSelectionDisabled
|
|
4083
4110
|
});
|
|
@@ -4087,13 +4114,13 @@ const Oi = (e) => ({
|
|
|
4087
4114
|
};
|
|
4088
4115
|
}
|
|
4089
4116
|
case "pivot": {
|
|
4090
|
-
const r =
|
|
4117
|
+
const r = Ti(e);
|
|
4091
4118
|
if (!r.success) return r;
|
|
4092
4119
|
const s = l(l(l(l(E(l({}, r.data), {
|
|
4093
4120
|
widgetType: "pivot",
|
|
4094
4121
|
id: e.id
|
|
4095
4122
|
}), e.title !== void 0 && { title: e.title }), e.description !== void 0 && { description: e.description }), e.dataSource !== void 0 && {
|
|
4096
|
-
dataSource:
|
|
4123
|
+
dataSource: ce(e.dataSource)
|
|
4097
4124
|
}), e.config !== void 0 && { config: e.config });
|
|
4098
4125
|
return {
|
|
4099
4126
|
success: !0,
|
|
@@ -4108,10 +4135,10 @@ const Oi = (e) => ({
|
|
|
4108
4135
|
}, e.config !== void 0 && { config: e.config }) };
|
|
4109
4136
|
case "custom": {
|
|
4110
4137
|
const r = [], s = e.filters !== void 0 ? A(
|
|
4111
|
-
() =>
|
|
4138
|
+
() => ae(e.filters),
|
|
4112
4139
|
r
|
|
4113
4140
|
) : void 0, n = e.highlights !== void 0 ? A(
|
|
4114
|
-
() =>
|
|
4141
|
+
() => Fe(e.highlights),
|
|
4115
4142
|
r
|
|
4116
4143
|
) : void 0;
|
|
4117
4144
|
return r.length > 0 ? { success: !1, errors: r } : { success: !0, data: l(l(l(l(l(l(l(l(l({
|
|
@@ -4119,7 +4146,7 @@ const Oi = (e) => ({
|
|
|
4119
4146
|
customWidgetType: e.customWidgetType,
|
|
4120
4147
|
id: e.id
|
|
4121
4148
|
}, e.title !== void 0 && { title: e.title }), e.description !== void 0 && { description: e.description }), e.dataSource !== void 0 && {
|
|
4122
|
-
dataSource:
|
|
4149
|
+
dataSource: ce(e.dataSource)
|
|
4123
4150
|
}), e.config !== void 0 && { config: e.config }), e.dataOptions !== void 0 && {
|
|
4124
4151
|
dataOptions: e.dataOptions
|
|
4125
4152
|
}), e.styleOptions !== void 0 && { styleOptions: e.styleOptions }), e.customOptions !== void 0 && {
|
|
@@ -4142,13 +4169,13 @@ const Oi = (e) => ({
|
|
|
4142
4169
|
]
|
|
4143
4170
|
};
|
|
4144
4171
|
}
|
|
4145
|
-
},
|
|
4172
|
+
}, Vi = (e) => {
|
|
4146
4173
|
const { data: t, context: r } = e, s = [], n = [];
|
|
4147
4174
|
Array.isArray(t.widgets) ? t.widgets.forEach((o, u) => {
|
|
4148
|
-
const c =
|
|
4175
|
+
const c = Ni({ data: o, context: r });
|
|
4149
4176
|
if (!c.success) {
|
|
4150
4177
|
s.push(
|
|
4151
|
-
...
|
|
4178
|
+
...or(c.errors, ar(u))
|
|
4152
4179
|
);
|
|
4153
4180
|
return;
|
|
4154
4181
|
}
|
|
@@ -4160,9 +4187,9 @@ const Oi = (e) => ({
|
|
|
4160
4187
|
});
|
|
4161
4188
|
let i = null;
|
|
4162
4189
|
if (t.filters && t.filters.length > 0) {
|
|
4163
|
-
const o =
|
|
4190
|
+
const o = ne(r.tables);
|
|
4164
4191
|
i = A(
|
|
4165
|
-
() =>
|
|
4192
|
+
() => ie({
|
|
4166
4193
|
data: t.filters,
|
|
4167
4194
|
context: { dataSource: r.dataSource, schemaIndex: o }
|
|
4168
4195
|
}),
|
|
@@ -4178,13 +4205,13 @@ const Oi = (e) => ({
|
|
|
4178
4205
|
}), t.styleOptions !== void 0 && { styleOptions: t.styleOptions }), t.widgetsOptions !== void 0 && {
|
|
4179
4206
|
widgetsOptions: t.widgetsOptions
|
|
4180
4207
|
}) };
|
|
4181
|
-
},
|
|
4208
|
+
}, ji = (e) => {
|
|
4182
4209
|
const t = [], r = [];
|
|
4183
4210
|
e.widgets.forEach((a, o) => {
|
|
4184
|
-
const u =
|
|
4211
|
+
const u = vi(a);
|
|
4185
4212
|
if (!u.success) {
|
|
4186
4213
|
t.push(
|
|
4187
|
-
...
|
|
4214
|
+
...or(u.errors, ar(o))
|
|
4188
4215
|
);
|
|
4189
4216
|
return;
|
|
4190
4217
|
}
|
|
@@ -4193,27 +4220,27 @@ const Oi = (e) => ({
|
|
|
4193
4220
|
let s;
|
|
4194
4221
|
if (e.filters) {
|
|
4195
4222
|
const a = A(
|
|
4196
|
-
() =>
|
|
4223
|
+
() => ae(e.filters),
|
|
4197
4224
|
t
|
|
4198
4225
|
);
|
|
4199
4226
|
s = a != null ? a : void 0;
|
|
4200
4227
|
}
|
|
4201
4228
|
if (t.length > 0)
|
|
4202
4229
|
return { success: !1, errors: t };
|
|
4203
|
-
const n = e.widgetsOptions !== void 0 ?
|
|
4230
|
+
const n = e.widgetsOptions !== void 0 ? Yn(e.widgetsOptions) : void 0, i = l(l(l(l(l(l(l(l({
|
|
4204
4231
|
widgets: r
|
|
4205
4232
|
}, e.id !== void 0 && { id: e.id }), e.title !== void 0 && { title: e.title }), s && s.length > 0 && { filters: s }), e.layoutOptions !== void 0 && {
|
|
4206
4233
|
layoutOptions: e.layoutOptions
|
|
4207
4234
|
}), e.config !== void 0 && { config: e.config }), e.defaultDataSource !== void 0 && {
|
|
4208
|
-
defaultDataSource:
|
|
4235
|
+
defaultDataSource: ce(e.defaultDataSource)
|
|
4209
4236
|
}), e.styleOptions !== void 0 && { styleOptions: e.styleOptions }), n !== void 0 && { widgetsOptions: n });
|
|
4210
4237
|
return {
|
|
4211
4238
|
success: !0,
|
|
4212
4239
|
data: L(i)
|
|
4213
4240
|
};
|
|
4214
4241
|
};
|
|
4215
|
-
function
|
|
4216
|
-
const { filters: t, relations: r } =
|
|
4242
|
+
function Mi(e) {
|
|
4243
|
+
const { filters: t, relations: r } = fs(
|
|
4217
4244
|
e.filters || []
|
|
4218
4245
|
);
|
|
4219
4246
|
return {
|
|
@@ -4226,17 +4253,17 @@ function xi(e) {
|
|
|
4226
4253
|
// No count/offset/ungroup - these are execution concerns, not translation concerns
|
|
4227
4254
|
};
|
|
4228
4255
|
}
|
|
4229
|
-
function
|
|
4230
|
-
const s =
|
|
4231
|
-
return
|
|
4256
|
+
function Ji(e, t, r = !1) {
|
|
4257
|
+
const s = Mi(e), n = cs(s, t);
|
|
4258
|
+
return ls(n, r);
|
|
4232
4259
|
}
|
|
4233
|
-
function
|
|
4260
|
+
function de(e) {
|
|
4234
4261
|
const t = e.trim();
|
|
4235
4262
|
return t.startsWith(T) ? t.slice(T.length) : t;
|
|
4236
4263
|
}
|
|
4237
|
-
function
|
|
4264
|
+
function X(e) {
|
|
4238
4265
|
var s;
|
|
4239
|
-
const t =
|
|
4266
|
+
const t = he(e.function);
|
|
4240
4267
|
if (t) {
|
|
4241
4268
|
const n = t.findIndex((i) => i.isName);
|
|
4242
4269
|
if (n >= 0) {
|
|
@@ -4245,40 +4272,40 @@ function H(e) {
|
|
|
4245
4272
|
}
|
|
4246
4273
|
}
|
|
4247
4274
|
const r = e.args[0];
|
|
4248
|
-
return typeof r == "string" ?
|
|
4275
|
+
return typeof r == "string" ? de(r) : w(r) ? X(r) : (s = e.function.split(".").pop()) != null ? s : e.function;
|
|
4249
4276
|
}
|
|
4250
|
-
const
|
|
4251
|
-
function
|
|
4277
|
+
const mt = "filterFactory.logic.";
|
|
4278
|
+
function pt(e) {
|
|
4252
4279
|
var r;
|
|
4253
|
-
if (e.function.startsWith(
|
|
4254
|
-
return e.function.slice(
|
|
4280
|
+
if (e.function.startsWith(mt))
|
|
4281
|
+
return e.function.slice(mt.length);
|
|
4255
4282
|
const t = e.args[0];
|
|
4256
|
-
return typeof t == "string" ?
|
|
4283
|
+
return typeof t == "string" ? de(t) : w(t) ? X(t) : (r = e.function.split(".").pop()) != null ? r : e.function;
|
|
4257
4284
|
}
|
|
4258
|
-
const
|
|
4259
|
-
function
|
|
4285
|
+
const Ri = "measureFactory.", Ii = "filterFactory.", ki = (e) => e.function.startsWith(Ri), Li = (e) => e.function.startsWith(Ii);
|
|
4286
|
+
function Ki(e, t) {
|
|
4260
4287
|
var s;
|
|
4261
4288
|
const r = (s = t == null ? void 0 : t.role) != null ? s : "filter";
|
|
4262
|
-
return typeof e == "string" ? { name:
|
|
4289
|
+
return typeof e == "string" ? { name: de(e), type: "dimension" } : zt(e) ? { name: de(e.column), type: "dimension" } : Ut(e) ? { name: X(e.column), type: "measure" } : w(e) ? ki(e) ? { name: X(e), type: "measure" } : Li(e) ? { name: pt(e), type: r } : (t == null ? void 0 : t.role) !== void 0 ? { name: pt(e), type: r } : { name: X(e), type: "measure" } : null;
|
|
4263
4290
|
}
|
|
4264
4291
|
export {
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4292
|
+
Ui as CustomSuperJSON,
|
|
4293
|
+
Hi as EMPTY_EXPANDED_QUERY_MODEL,
|
|
4294
|
+
Qi as EMPTY_SIMPLE_QUERY_MODEL,
|
|
4295
|
+
Ki as getQueryElementSummary,
|
|
4296
|
+
Xi as isByIdDashboardCodeParams,
|
|
4297
|
+
Zi as isByIdWidgetCodeParams,
|
|
4298
|
+
ea as isClientSideDashboardCodeParams,
|
|
4299
|
+
ta as isClientSideWidgetCodeParams,
|
|
4300
|
+
pi as translateChartFromJSON,
|
|
4301
|
+
gi as translateChartToJSON,
|
|
4302
|
+
Vi as translateDashboardFromJSON,
|
|
4303
|
+
ji as translateDashboardToJSON,
|
|
4304
|
+
Ai as translatePivotTableFromJSON,
|
|
4305
|
+
Ti as translatePivotTableToJSON,
|
|
4306
|
+
Pi as translateQueryFromJSON,
|
|
4307
|
+
Wi as translateQueryToJSON,
|
|
4308
|
+
Ji as translateQueryToJaql,
|
|
4309
|
+
Ni as translateWidgetFromJSON,
|
|
4310
|
+
vi as translateWidgetToJSON
|
|
4284
4311
|
};
|