@sisense/sdk-ui 2.26.0 → 2.28.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 +35 -35
- package/dist/ai.js +792 -800
- package/dist/analytics-composer/node.cjs +1 -1
- package/dist/analytics-composer/node.js +1322 -1021
- package/dist/analytics-composer.cjs +73 -73
- package/dist/analytics-composer.js +22 -17
- package/dist/apply-styled-options-to-query-23D9br-S.cjs +1 -0
- package/dist/{apply-styled-options-to-query-Bzt2GrgO.js → apply-styled-options-to-query-BagjzMqm.js} +1064 -1046
- package/dist/{dimensions-Ce2zWFrs.js → dimensions-Bn1EaWiP.js} +1 -1
- package/dist/{dimensions-u3w5qNF0.cjs → dimensions-D8r34WRI.cjs} +1 -1
- package/dist/{index-D7mHzfx0.js → index-C77YCBVd.js} +4 -1
- package/dist/{index-BX9p-XrU.cjs → index-C9G8giSk.cjs} +1 -1
- package/dist/index.cjs +404 -404
- package/dist/index.js +18353 -17959
- package/dist/index.umd.js +687 -688
- package/dist/packages/sdk-ui/src/domains/dashboarding/components/editable-layout/const.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/dashboard-model-translator.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/get-dashboard-model.d.ts +4 -3
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/get-dashboard-models.d.ts +3 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/translate-dashboard-utils.d.ts +16 -4
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/types.d.ts +9 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/persist-dashboard-model-middleware.d.ts +10 -3
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/use-widget-excel-download.d.ts +23 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/types.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/drilldown/hooks/use-drilldown.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/drilldown/hooks/use-hierarchies-loader.d.ts +17 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/cascading-filter-tile/cascading-filter-tile.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/filters/components/custom-filter-tile.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/narrative/core/widget-narrative-options.d.ts +11 -4
- package/dist/packages/sdk-ui/src/domains/narrative/core/widget-props-to-narrative-params.d.ts +51 -1
- package/dist/packages/sdk-ui/src/domains/narrative/hooks/use-get-widget-narrative.d.ts +3 -3
- package/dist/packages/sdk-ui/src/domains/narrative/hooks/use-widget-narrative-state.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-excel-query/excel-export/build-jaql-excel-export.d.ts +48 -0
- package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-excel-query/excel-export/build-xlsx-export-payload.d.ts +33 -0
- package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-excel-query/excel-query-state-reducer.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-excel-query/use-excel-query-params-changed.d.ts +8 -0
- package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-excel-query/use-execute-excel-query.d.ts +8 -0
- package/dist/packages/sdk-ui/src/domains/query-execution/index.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/query-execution/types.d.ts +97 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/components/scattermap/utils/map.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/areamap-chart/data/areamap-data.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/utils/with-calendar-heatmap-data-coloring.d.ts +2 -2
- 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 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/types.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/types.d.ts +3 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/pivot-table/formatters/data-cell-formatters/data-cell-color-formatter.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/pivot-table/helpers/prepare-pivot-styling-props.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/pivot-table/hooks/use-render-pivot.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/pivot-table/sorting-utils.d.ts +4 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/table/hooks/use-table-data.d.ts +3 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/table/pure-table/helpers/get-cell-styles.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/table/pure-table/types.d.ts +3 -3
- package/dist/packages/sdk-ui/src/domains/visualizations/components/table/styles/get-custom-pagination-styles.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/translate-data-options.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/validate-data-options/validate-data-options.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/apply-event-handlers.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/boxplot-chart-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/cartesian/cartesian-chart-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/cartesian/utils/axis/axis-builders.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/cartesian/utils/axis/axis-settings.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/cartesian/utils/axis/axis-transformers.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/cartesian/utils/series-processor.d.ts +3 -39
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/category-chart-options/category-chart-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/category-chart-options/funnel-chart-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/category-chart-options/pie-chart-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/category-chart-options/sunburst-chart-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/category-chart-options/treemap-chart-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/chart-options-service.d.ts +5 -3
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/common-highcharts-option-service.d.ts +3 -3
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/range-chart-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/scatter-chart-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/series-labels.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/theme-option-service.d.ts +3 -3
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/funnel-series.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/pie-plot-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/pie-series.d.ts +4 -4
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/scatter-series.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/sunburst/sunburst-levels.d.ts +4 -4
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/sunburst/sunburst-options.d.ts +5 -5
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/sunburst/sunburst-series.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/treemap/treemap-labels.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/treemap/treemap-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/treemap/treemap-series.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-definition-style-constants.d.ts +17 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-definition.d.ts +3 -3
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-params-to-view-model.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/widgets/components/chart-widget/types.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/chart-widget/use-chart-widget-excel-download.d.ts +18 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/custom-widget/types.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/custom-widget/use-custom-widget-excel-download.d.ts +16 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/pivot-table-widget.d.ts +0 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/types.d.ts +9 -2
- package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/use-pivot-widget-excel-download.d.ts +18 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/use-with-pivot-table-widget-drilldown.d.ts +0 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/utils.d.ts +0 -5
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget/types.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/apply-partial-dto-style.d.ts +18 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/extract-unsupported-style-options.d.ts +31 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/index.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/to-widget-dto-style.d.ts +3 -3
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/types.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/utils.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/widgets/helpers/download-blob-as-file.d.ts +14 -0
- package/dist/packages/sdk-ui/src/domains/widgets/helpers/excel-export-map-dimensions-measures.d.ts +18 -0
- package/dist/packages/sdk-ui/src/domains/widgets/helpers/index.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/widgets/hooks/use-excel-query-file-loader.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/widgets/hooks/use-with-excel-download-menu-item.d.ts +21 -0
- package/dist/packages/sdk-ui/src/domains/widgets/shared/widget-style-utils.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/get-widget-model.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/to-widget-dto-panels.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/widget-model-translator.d.ts +40 -3
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model.d.ts +12 -0
- package/dist/packages/sdk-ui/src/infra/api/narrative/narrative-endpoints.d.ts +13 -7
- package/dist/packages/sdk-ui/src/infra/api/rest-api.d.ts +7 -0
- package/dist/packages/sdk-ui/src/infra/app/settings/settings.d.ts +62 -4
- package/dist/packages/sdk-ui/src/infra/app/settings/types/features.d.ts +2 -0
- package/dist/packages/sdk-ui/src/infra/app/types.d.ts +0 -1
- package/dist/packages/sdk-ui/src/infra/contexts/theme-provider/custom-theme-provider.d.ts +2 -2
- package/dist/packages/sdk-ui/src/infra/contexts/theme-provider/default-theme-settings.d.ts +2 -2
- package/dist/packages/sdk-ui/src/infra/contexts/theme-provider/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/infra/contexts/theme-provider/theme-context.d.ts +3 -3
- package/dist/packages/sdk-ui/src/infra/contexts/theme-provider/types.d.ts +2 -2
- package/dist/packages/sdk-ui/src/infra/contexts/theme-provider/use-theme-settings.d.ts +2 -2
- package/dist/packages/sdk-ui/src/infra/contexts/theme-provider/use-theme.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/plugins/widget-plugins/types.d.ts +16 -11
- package/dist/packages/sdk-ui/src/infra/themes/legacy-design-settings.d.ts +4 -4
- package/dist/packages/sdk-ui/src/infra/themes/theme-loader.d.ts +4 -4
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/de-de.d.ts +3 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/en-us.d.ts +3 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-ar.d.ts +3 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-es.d.ts +3 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/fr-fr.d.ts +3 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/it-it.d.ts +3 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ja-jp.d.ts +3 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ko-kr.d.ts +3 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/nl-nl.d.ts +3 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/pt-br.d.ts +3 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ru-ru.d.ts +3 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/tr-tr.d.ts +3 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/zh-cn.d.ts +3 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/en.d.ts +4 -1
- package/dist/packages/sdk-ui/src/infra/translation/resources/index.d.ts +7 -1
- package/dist/packages/sdk-ui/src/modules/ai/ai-disclaimer.d.ts +2 -2
- package/dist/packages/sdk-ui/src/modules/ai/api/chat-rest-api.d.ts +1 -1
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/dashboard/translate-dashboard-from-json.d.ts +17 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/dashboard/translate-dashboard-to-json.d.ts +15 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/index.d.ts +5 -1
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/query/translate-query-from-json.d.ts +5 -5
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/query/translate-query-to-jaql.d.ts +4 -4
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/query/translate-query-to-json.d.ts +5 -5
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/data-options/adapters.d.ts +0 -3
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/expression/custom-formula/process-custom-formula.d.ts +2 -1
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/expression/factory-function-processors.d.ts +0 -1
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/expression/filter-processors.d.ts +8 -4
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/utils/error-path.d.ts +37 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/utils/translation-helpers.d.ts +36 -3
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/types.d.ts +132 -3
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/widget/helpers/index.d.ts +6 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/widget/helpers/to-widget-props.d.ts +27 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/widget/helpers/translate-custom-widget-filters-from-json.d.ts +12 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/widget/helpers/translate-envelope-widget-from-json.d.ts +20 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/widget/helpers/validate-widget-json.d.ts +8 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/widget/helpers/widget-id.d.ts +17 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/widget/translate-widget-from-json.d.ts +19 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/widget/translate-widget-to-json.d.ts +18 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/types.d.ts +6 -5
- package/dist/packages/sdk-ui/src/modules/analytics-composer/widget/chart-options/get-widget-options.d.ts +12 -0
- package/dist/packages/sdk-ui/src/props.d.ts +15 -6
- package/dist/packages/sdk-ui/src/public-api/alpha.d.ts +5 -0
- package/dist/packages/sdk-ui/src/public-api/internal.d.ts +12 -1
- package/dist/packages/sdk-ui/src/public-api/public.d.ts +24 -21
- package/dist/packages/sdk-ui/src/public-api/sisense-internal.d.ts +3 -3
- package/dist/packages/sdk-ui/src/shared/components/loading-indicator.d.ts +2 -2
- package/dist/packages/sdk-ui/src/shared/components/menu/context-menu/menu.d.ts +1 -1
- package/dist/packages/sdk-ui/src/types.d.ts +220 -4
- package/dist/translations/de-de.cjs +1 -1
- package/dist/translations/de-de.js +5 -2
- 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 +5 -2
- package/dist/translations/es-es.cjs +1 -1
- package/dist/translations/es-es.js +5 -2
- package/dist/translations/fr-fr.cjs +1 -1
- package/dist/translations/fr-fr.js +5 -2
- package/dist/translations/it-it.cjs +1 -1
- package/dist/translations/it-it.js +5 -2
- package/dist/translations/ja-jp.cjs +1 -1
- package/dist/translations/ja-jp.js +5 -2
- package/dist/translations/ko-kr.cjs +1 -1
- package/dist/translations/ko-kr.js +5 -2
- package/dist/translations/nl-nl.cjs +1 -1
- package/dist/translations/nl-nl.js +5 -2
- package/dist/translations/pt-br.cjs +1 -1
- package/dist/translations/pt-br.js +5 -2
- package/dist/translations/ru-ru.cjs +1 -1
- package/dist/translations/ru-ru.js +5 -2
- package/dist/translations/tr-tr.cjs +1 -1
- package/dist/translations/tr-tr.js +5 -2
- package/dist/translations/zh-cn.cjs +1 -1
- package/dist/translations/zh-cn.js +5 -2
- package/dist/{types-COBvZZm_.cjs → types-CzgBH2kL.cjs} +1 -1
- package/dist/{types-D6jCGncV.js → types-D3fPN43o.js} +1 -1
- package/dist/{use-hover-B1HPf4hF.js → use-hover-B6VmMb06.js} +11779 -11336
- package/dist/{use-hover-CaQrW_gv.cjs → use-hover-CaSOzp0i.cjs} +129 -130
- package/dist/{utils-CAubp1g1.cjs → utils-BwGnDoB0.cjs} +23 -23
- package/dist/{utils-BQtueE3Z.js → utils-CsV-iYtb.js} +2410 -2439
- package/dist/{widget-composer-BAJFWk3t.js → widget-composer-Bv_OVu1o.js} +275 -223
- package/dist/{widget-composer-C75b-E6W.cjs → widget-composer-C72Io-3c.cjs} +7 -7
- package/package.json +11 -8
- package/dist/apply-styled-options-to-query-COD9fRYD.cjs +0 -1
- package/dist/packages/sdk-ui/src/domains/drilldown/hooks/use-synced-drilldown-paths-manager.d.ts +0 -113
|
@@ -1,27 +1,36 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var sr = Object.defineProperty, nr = Object.defineProperties;
|
|
2
|
+
var ir = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var ie = Object.getOwnPropertySymbols;
|
|
4
|
+
var We = Object.prototype.hasOwnProperty, Ve = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Pe = (e, t, r) => t in e ? sr(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
|
+
We.call(t, r) && Pe(e, r, t[r]);
|
|
8
|
+
if (ie)
|
|
9
|
+
for (var r of ie(t))
|
|
10
|
+
Ve.call(t, r) && Pe(e, r, t[r]);
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
}, F = (e, t) => nr(e, ir(t));
|
|
13
|
+
var ye = (e, t) => {
|
|
14
|
+
var r = {};
|
|
15
|
+
for (var s in e)
|
|
16
|
+
We.call(e, s) && t.indexOf(s) < 0 && (r[s] = e[s]);
|
|
17
|
+
if (e != null && ie)
|
|
18
|
+
for (var s of ie(e))
|
|
19
|
+
t.indexOf(s) < 0 && Ve.call(e, s) && (r[s] = e[s]);
|
|
20
|
+
return r;
|
|
21
|
+
};
|
|
22
|
+
import { f as or, J as ar } from "../types-D3fPN43o.js";
|
|
23
|
+
import { b as Bi, E as Li, a as zi, i as Ui, e as _i, d as Pi } from "../types-D3fPN43o.js";
|
|
24
|
+
import { cj as ur, bs as cr, ck as lr, cl as dr, cm as fr, aw as De, cn as pr, av as mr, co as gr, bb as yr, ax as hr, cp as br, be as Er, bc as Fr, aO as Ar, ba as wr, bd as Tr, d as Sr, c as Cr, k as qr, cq as $r, cr as Or, cs as Dr, ct as xr, cu as vr, cv as Nr, cw as Mr, cx as Rr, cy as Ir, cz as kr, cA as Br, aq as Lr, cB as zr, cC as Ur, S as U, t as ee, h as _r, b as $, ai as _, at as ct, cD as Pr, cE as Wr, cF as Vr, M as j, cc as jr, cG as Jr, aK as Kr, aj as je, au as le, cg as Gr, ch as Yr, bQ as lt, cH as dt, ad as Hr, cI as ft, cJ as pt, A as Qr, b_ as mt, cK as Xr, bH as Zr, aD as es } from "../apply-styled-options-to-query-BagjzMqm.js";
|
|
25
|
+
import { i as ts, b as rs, D as ss, d as ns, a as is } from "../dimensions-Bn1EaWiP.js";
|
|
26
|
+
function os(e, t) {
|
|
18
27
|
const r = e.length, s = t.length, n = Array.from({ length: r + 1 }, (i, o) => Array.from({ length: s + 1 }, (a, u) => o === 0 ? u : u === 0 ? o : 0));
|
|
19
28
|
for (let i = 1; i <= r; i++)
|
|
20
29
|
for (let o = 1; o <= s; o++)
|
|
21
30
|
n[i][o] = Math.min(n[i - 1][o] + 1, n[i][o - 1] + 1, n[i - 1][o - 1] + (e[i - 1] === t[o - 1] ? 0 : 1));
|
|
22
31
|
return n[r][s];
|
|
23
32
|
}
|
|
24
|
-
function
|
|
33
|
+
function xe(e, t) {
|
|
25
34
|
const r = [];
|
|
26
35
|
let s = "", n = 0, i = !1, o = null;
|
|
27
36
|
for (let a = 0; a < e.length; a++) {
|
|
@@ -51,7 +60,7 @@ function we(e, t) {
|
|
|
51
60
|
}
|
|
52
61
|
return s.trim() && r.push(s.trim()), r;
|
|
53
62
|
}
|
|
54
|
-
function
|
|
63
|
+
function as(e, t) {
|
|
55
64
|
let r = 0, s = !1, n = null;
|
|
56
65
|
for (let i = 0; i < e.length; i++) {
|
|
57
66
|
const o = e[i], a = e[i + 1];
|
|
@@ -74,7 +83,7 @@ function Jr(e, t) {
|
|
|
74
83
|
}
|
|
75
84
|
return -1;
|
|
76
85
|
}
|
|
77
|
-
function
|
|
86
|
+
function us(e, t) {
|
|
78
87
|
if (e[t] !== "(")
|
|
79
88
|
return -1;
|
|
80
89
|
let r = 1, s = t + 1, n = !1, i = null;
|
|
@@ -102,10 +111,10 @@ function Hr(e, t) {
|
|
|
102
111
|
}
|
|
103
112
|
return -1;
|
|
104
113
|
}
|
|
105
|
-
function
|
|
114
|
+
function cs(e) {
|
|
106
115
|
return e.startsWith("'") && e.endsWith("'") || e.startsWith('"') && e.endsWith('"') ? e.slice(1, -1) : e;
|
|
107
116
|
}
|
|
108
|
-
function
|
|
117
|
+
function J(e) {
|
|
109
118
|
if (!e || typeof e != "string")
|
|
110
119
|
throw new Error(`Invalid composeCode: expected non-empty string, got ${typeof e}`);
|
|
111
120
|
const t = e.trim();
|
|
@@ -114,16 +123,16 @@ function V(e) {
|
|
|
114
123
|
const r = t.match(/^([a-zA-Z_$][a-zA-Z0-9_.$]*)\s*\((.*)\)$/);
|
|
115
124
|
if (!r)
|
|
116
125
|
throw new Error(`Invalid composeCode format: expected function call, got '${t}'`);
|
|
117
|
-
const s = r[1], n = r[2], i =
|
|
126
|
+
const s = r[1], n = r[2], i = gt(n);
|
|
118
127
|
return {
|
|
119
128
|
function: s,
|
|
120
129
|
args: i
|
|
121
130
|
};
|
|
122
131
|
}
|
|
123
|
-
function
|
|
124
|
-
return e.trim() ?
|
|
132
|
+
function gt(e) {
|
|
133
|
+
return e.trim() ? xe(e, ",").map(yt) : [];
|
|
125
134
|
}
|
|
126
|
-
function
|
|
135
|
+
function yt(e) {
|
|
127
136
|
if (!e)
|
|
128
137
|
throw new Error("Cannot parse empty argument value");
|
|
129
138
|
if (e === "null")
|
|
@@ -144,29 +153,29 @@ function at(e) {
|
|
|
144
153
|
const r = e.slice(1, -1).trim();
|
|
145
154
|
if (!r)
|
|
146
155
|
return [];
|
|
147
|
-
const s =
|
|
156
|
+
const s = gt(r);
|
|
148
157
|
return s.every((n) => typeof n == "string"), s;
|
|
149
158
|
}
|
|
150
159
|
if (e.startsWith("{") && e.endsWith("}")) {
|
|
151
160
|
const r = e.slice(1, -1).trim();
|
|
152
|
-
return r ?
|
|
161
|
+
return r ? ds(r) : {};
|
|
153
162
|
}
|
|
154
|
-
return e.includes("(") && e.includes(")") ?
|
|
163
|
+
return e.includes("(") && e.includes(")") ? J(e) : (e.startsWith("DM."), e);
|
|
155
164
|
}
|
|
156
|
-
function
|
|
157
|
-
const t =
|
|
165
|
+
function ls(e) {
|
|
166
|
+
const t = as(e, ":");
|
|
158
167
|
if (t === -1)
|
|
159
168
|
throw new Error(`Invalid object property: expected 'key: value', got '${e}'`);
|
|
160
|
-
const r =
|
|
169
|
+
const r = cs(e.slice(0, t).trim()), s = yt(e.slice(t + 1).trim());
|
|
161
170
|
return [r, s];
|
|
162
171
|
}
|
|
163
|
-
function
|
|
172
|
+
function ds(e) {
|
|
164
173
|
if (!e.trim())
|
|
165
174
|
return {};
|
|
166
|
-
const t =
|
|
175
|
+
const t = xe(e, ",").map(ls).filter(([, r]) => r !== null);
|
|
167
176
|
return Object.fromEntries(t);
|
|
168
177
|
}
|
|
169
|
-
class
|
|
178
|
+
class fs {
|
|
170
179
|
constructor() {
|
|
171
180
|
this.keyToValue = /* @__PURE__ */ new Map(), this.valueToKey = /* @__PURE__ */ new Map();
|
|
172
181
|
}
|
|
@@ -183,9 +192,9 @@ class es {
|
|
|
183
192
|
this.keyToValue.clear(), this.valueToKey.clear();
|
|
184
193
|
}
|
|
185
194
|
}
|
|
186
|
-
class
|
|
195
|
+
class ht {
|
|
187
196
|
constructor(t) {
|
|
188
|
-
this.generateIdentifier = t, this.kv = new
|
|
197
|
+
this.generateIdentifier = t, this.kv = new fs();
|
|
189
198
|
}
|
|
190
199
|
register(t, r) {
|
|
191
200
|
this.kv.getByValue(t) || (r || (r = this.generateIdentifier(t)), this.kv.set(r, t));
|
|
@@ -200,7 +209,7 @@ class ut {
|
|
|
200
209
|
return this.kv.getByKey(t);
|
|
201
210
|
}
|
|
202
211
|
}
|
|
203
|
-
class
|
|
212
|
+
class ps extends ht {
|
|
204
213
|
constructor() {
|
|
205
214
|
super((t) => t.name), this.classToAllowedProps = /* @__PURE__ */ new Map();
|
|
206
215
|
}
|
|
@@ -211,7 +220,7 @@ class ts extends ut {
|
|
|
211
220
|
return this.classToAllowedProps.get(t);
|
|
212
221
|
}
|
|
213
222
|
}
|
|
214
|
-
function
|
|
223
|
+
function ms(e) {
|
|
215
224
|
if ("values" in Object)
|
|
216
225
|
return Object.values(e);
|
|
217
226
|
const t = [];
|
|
@@ -219,8 +228,8 @@ function rs(e) {
|
|
|
219
228
|
e.hasOwnProperty(r) && t.push(e[r]);
|
|
220
229
|
return t;
|
|
221
230
|
}
|
|
222
|
-
function
|
|
223
|
-
const r =
|
|
231
|
+
function gs(e, t) {
|
|
232
|
+
const r = ms(e);
|
|
224
233
|
if ("find" in r)
|
|
225
234
|
return r.find(t);
|
|
226
235
|
const s = r;
|
|
@@ -230,20 +239,20 @@ function ss(e, t) {
|
|
|
230
239
|
return i;
|
|
231
240
|
}
|
|
232
241
|
}
|
|
233
|
-
function
|
|
242
|
+
function K(e, t) {
|
|
234
243
|
Object.entries(e).forEach(([r, s]) => t(s, r));
|
|
235
244
|
}
|
|
236
|
-
function
|
|
245
|
+
function oe(e, t) {
|
|
237
246
|
return e.indexOf(t) !== -1;
|
|
238
247
|
}
|
|
239
|
-
function
|
|
248
|
+
function Je(e, t) {
|
|
240
249
|
for (let r = 0; r < e.length; r++) {
|
|
241
250
|
const s = e[r];
|
|
242
251
|
if (t(s))
|
|
243
252
|
return s;
|
|
244
253
|
}
|
|
245
254
|
}
|
|
246
|
-
class
|
|
255
|
+
class ys {
|
|
247
256
|
constructor() {
|
|
248
257
|
this.transfomers = {};
|
|
249
258
|
}
|
|
@@ -251,13 +260,13 @@ class ns {
|
|
|
251
260
|
this.transfomers[t.name] = t;
|
|
252
261
|
}
|
|
253
262
|
findApplicable(t) {
|
|
254
|
-
return
|
|
263
|
+
return gs(this.transfomers, (r) => r.isApplicable(t));
|
|
255
264
|
}
|
|
256
265
|
findByName(t) {
|
|
257
266
|
return this.transfomers[t];
|
|
258
267
|
}
|
|
259
268
|
}
|
|
260
|
-
const
|
|
269
|
+
const hs = (e) => Object.prototype.toString.call(e).slice(8, -1), bt = (e) => typeof e == "undefined", bs = (e) => e === null, H = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, we = (e) => H(e) && Object.keys(e).length === 0, k = (e) => Array.isArray(e), Es = (e) => typeof e == "string", Fs = (e) => typeof e == "number" && !isNaN(e), As = (e) => typeof e == "boolean", ws = (e) => e instanceof RegExp, Q = (e) => e instanceof Map, X = (e) => e instanceof Set, Et = (e) => hs(e) === "Symbol", Ts = (e) => e instanceof Date && !isNaN(e.valueOf()), Ss = (e) => e instanceof Error, Ke = (e) => typeof e == "number" && isNaN(e), Cs = (e) => As(e) || bs(e) || bt(e) || Fs(e) || Es(e) || Et(e), qs = (e) => typeof e == "bigint", $s = (e) => e === 1 / 0 || e === -1 / 0, Os = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), Ds = (e) => e instanceof URL, Ft = (e) => e.replace(/\./g, "\\."), he = (e) => e.map(String).map(Ft).join("."), Y = (e) => {
|
|
261
270
|
const t = [];
|
|
262
271
|
let r = "";
|
|
263
272
|
for (let n = 0; n < e.length; n++) {
|
|
@@ -275,7 +284,7 @@ const is = (e) => Object.prototype.toString.call(e).slice(8, -1), ct = (e) => ty
|
|
|
275
284
|
const s = r;
|
|
276
285
|
return t.push(s), t;
|
|
277
286
|
};
|
|
278
|
-
function
|
|
287
|
+
function I(e, t, r, s) {
|
|
279
288
|
return {
|
|
280
289
|
isApplicable: e,
|
|
281
290
|
annotation: t,
|
|
@@ -283,12 +292,12 @@ function v(e, t, r, s) {
|
|
|
283
292
|
untransform: s
|
|
284
293
|
};
|
|
285
294
|
}
|
|
286
|
-
const
|
|
287
|
-
|
|
295
|
+
const At = [
|
|
296
|
+
I(bt, "undefined", () => null, () => {
|
|
288
297
|
}),
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
298
|
+
I(qs, "bigint", (e) => e.toString(), (e) => typeof BigInt != "undefined" ? BigInt(e) : (console.error("Please add a BigInt polyfill."), e)),
|
|
299
|
+
I(Ts, "Date", (e) => e.toISOString(), (e) => new Date(e)),
|
|
300
|
+
I(Ss, "Error", (e, t) => {
|
|
292
301
|
const r = {
|
|
293
302
|
name: e.name,
|
|
294
303
|
message: e.message
|
|
@@ -302,24 +311,24 @@ const dt = [
|
|
|
302
311
|
r[s] = e[s];
|
|
303
312
|
}), r;
|
|
304
313
|
}),
|
|
305
|
-
|
|
314
|
+
I(ws, "regexp", (e) => "" + e, (e) => {
|
|
306
315
|
const t = e.slice(1, e.lastIndexOf("/")), r = e.slice(e.lastIndexOf("/") + 1);
|
|
307
316
|
return new RegExp(t, r);
|
|
308
317
|
}),
|
|
309
|
-
|
|
310
|
-
|
|
318
|
+
I(
|
|
319
|
+
X,
|
|
311
320
|
"set",
|
|
312
321
|
// (sets only exist in es6+)
|
|
313
322
|
// eslint-disable-next-line es5/no-es6-methods
|
|
314
323
|
(e) => [...e.values()],
|
|
315
324
|
(e) => new Set(e)
|
|
316
325
|
),
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
326
|
+
I(Q, "map", (e) => [...e.entries()], (e) => new Map(e)),
|
|
327
|
+
I((e) => Ke(e) || $s(e), "number", (e) => Ke(e) ? "NaN" : e > 0 ? "Infinity" : "-Infinity", Number),
|
|
328
|
+
I((e) => e === 0 && 1 / e === -1 / 0, "number", () => "-0", Number),
|
|
329
|
+
I(Ds, "URL", (e) => e.toString(), (e) => new URL(e))
|
|
321
330
|
];
|
|
322
|
-
function
|
|
331
|
+
function de(e, t, r, s) {
|
|
323
332
|
return {
|
|
324
333
|
isApplicable: e,
|
|
325
334
|
annotation: t,
|
|
@@ -327,12 +336,12 @@ function se(e, t, r, s) {
|
|
|
327
336
|
untransform: s
|
|
328
337
|
};
|
|
329
338
|
}
|
|
330
|
-
const
|
|
339
|
+
const wt = de((e, t) => Et(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t) => ["symbol", t.symbolRegistry.getIdentifier(e)], (e) => e.description, (e, t, r) => {
|
|
331
340
|
const s = r.symbolRegistry.getValue(t[1]);
|
|
332
341
|
if (!s)
|
|
333
342
|
throw new Error("Trying to deserialize unknown symbol");
|
|
334
343
|
return s;
|
|
335
|
-
}),
|
|
344
|
+
}), xs = [
|
|
336
345
|
Int8Array,
|
|
337
346
|
Uint8Array,
|
|
338
347
|
Int16Array,
|
|
@@ -342,19 +351,19 @@ const mt = se((e, t) => lt(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t)
|
|
|
342
351
|
Float32Array,
|
|
343
352
|
Float64Array,
|
|
344
353
|
Uint8ClampedArray
|
|
345
|
-
].reduce((e, t) => (e[t.name] = t, e), {}),
|
|
346
|
-
const r =
|
|
354
|
+
].reduce((e, t) => (e[t.name] = t, e), {}), Tt = de(Os, (e) => ["typed-array", e.constructor.name], (e) => [...e], (e, t) => {
|
|
355
|
+
const r = xs[t[1]];
|
|
347
356
|
if (!r)
|
|
348
357
|
throw new Error("Trying to deserialize unknown typed array");
|
|
349
358
|
return new r(e);
|
|
350
359
|
});
|
|
351
|
-
function
|
|
360
|
+
function St(e, t) {
|
|
352
361
|
return e != null && e.constructor ? !!t.classRegistry.getIdentifier(e.constructor) : !1;
|
|
353
362
|
}
|
|
354
|
-
const
|
|
363
|
+
const Ct = de(St, (e, t) => ["class", t.classRegistry.getIdentifier(e.constructor)], (e, t) => {
|
|
355
364
|
const r = t.classRegistry.getAllowedProps(e.constructor);
|
|
356
365
|
if (!r)
|
|
357
|
-
return
|
|
366
|
+
return l({}, e);
|
|
358
367
|
const s = {};
|
|
359
368
|
return r.forEach((n) => {
|
|
360
369
|
s[n] = e[n];
|
|
@@ -364,49 +373,49 @@ const yt = se(gt, (e, t) => ["class", t.classRegistry.getIdentifier(e.constructo
|
|
|
364
373
|
if (!s)
|
|
365
374
|
throw new Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);
|
|
366
375
|
return Object.assign(Object.create(s.prototype), e);
|
|
367
|
-
}),
|
|
376
|
+
}), qt = de((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) => {
|
|
368
377
|
const s = r.customTransformerRegistry.findByName(t[1]);
|
|
369
378
|
if (!s)
|
|
370
379
|
throw new Error("Trying to deserialize unknown custom value");
|
|
371
380
|
return s.deserialize(e);
|
|
372
|
-
}),
|
|
373
|
-
const r =
|
|
381
|
+
}), vs = [Ct, wt, qt, Tt], Ge = (e, t) => {
|
|
382
|
+
const r = Je(vs, (n) => n.isApplicable(e, t));
|
|
374
383
|
if (r)
|
|
375
384
|
return {
|
|
376
385
|
value: r.transform(e, t),
|
|
377
386
|
type: r.annotation(e, t)
|
|
378
387
|
};
|
|
379
|
-
const s =
|
|
388
|
+
const s = Je(At, (n) => n.isApplicable(e, t));
|
|
380
389
|
if (s)
|
|
381
390
|
return {
|
|
382
391
|
value: s.transform(e, t),
|
|
383
392
|
type: s.annotation
|
|
384
393
|
};
|
|
385
|
-
},
|
|
386
|
-
|
|
387
|
-
|
|
394
|
+
}, $t = {};
|
|
395
|
+
At.forEach((e) => {
|
|
396
|
+
$t[e.annotation] = e;
|
|
388
397
|
});
|
|
389
|
-
const
|
|
390
|
-
if (
|
|
398
|
+
const Ns = (e, t, r) => {
|
|
399
|
+
if (k(t))
|
|
391
400
|
switch (t[0]) {
|
|
392
401
|
case "symbol":
|
|
393
|
-
return
|
|
402
|
+
return wt.untransform(e, t, r);
|
|
394
403
|
case "class":
|
|
395
|
-
return
|
|
404
|
+
return Ct.untransform(e, t, r);
|
|
396
405
|
case "custom":
|
|
397
|
-
return
|
|
406
|
+
return qt.untransform(e, t, r);
|
|
398
407
|
case "typed-array":
|
|
399
|
-
return
|
|
408
|
+
return Tt.untransform(e, t, r);
|
|
400
409
|
default:
|
|
401
410
|
throw new Error("Unknown transformation: " + t);
|
|
402
411
|
}
|
|
403
412
|
else {
|
|
404
|
-
const s =
|
|
413
|
+
const s = $t[t];
|
|
405
414
|
if (!s)
|
|
406
415
|
throw new Error("Unknown transformation: " + t);
|
|
407
416
|
return s.untransform(e, r);
|
|
408
417
|
}
|
|
409
|
-
},
|
|
418
|
+
}, V = (e, t) => {
|
|
410
419
|
if (t > e.size)
|
|
411
420
|
throw new Error("index out of bounds");
|
|
412
421
|
const r = e.keys();
|
|
@@ -414,22 +423,22 @@ const ws = (e, t, r) => {
|
|
|
414
423
|
r.next(), t--;
|
|
415
424
|
return r.next().value;
|
|
416
425
|
};
|
|
417
|
-
function
|
|
418
|
-
if (
|
|
426
|
+
function Ot(e) {
|
|
427
|
+
if (oe(e, "__proto__"))
|
|
419
428
|
throw new Error("__proto__ is not allowed as a property");
|
|
420
|
-
if (
|
|
429
|
+
if (oe(e, "prototype"))
|
|
421
430
|
throw new Error("prototype is not allowed as a property");
|
|
422
|
-
if (
|
|
431
|
+
if (oe(e, "constructor"))
|
|
423
432
|
throw new Error("constructor is not allowed as a property");
|
|
424
433
|
}
|
|
425
|
-
const
|
|
426
|
-
|
|
434
|
+
const Ms = (e, t) => {
|
|
435
|
+
Ot(t);
|
|
427
436
|
for (let r = 0; r < t.length; r++) {
|
|
428
437
|
const s = t[r];
|
|
429
|
-
if (
|
|
430
|
-
e =
|
|
431
|
-
else if (
|
|
432
|
-
const n = +s, i = +t[++r] == 0 ? "key" : "value", o =
|
|
438
|
+
if (X(e))
|
|
439
|
+
e = V(e, +s);
|
|
440
|
+
else if (Q(e)) {
|
|
441
|
+
const n = +s, i = +t[++r] == 0 ? "key" : "value", o = V(e, n);
|
|
433
442
|
switch (i) {
|
|
434
443
|
case "key":
|
|
435
444
|
e = o;
|
|
@@ -442,41 +451,41 @@ const Fs = (e, t) => {
|
|
|
442
451
|
e = e[s];
|
|
443
452
|
}
|
|
444
453
|
return e;
|
|
445
|
-
},
|
|
446
|
-
if (
|
|
454
|
+
}, Te = (e, t, r) => {
|
|
455
|
+
if (Ot(t), t.length === 0)
|
|
447
456
|
return r(e);
|
|
448
457
|
let s = e;
|
|
449
458
|
for (let i = 0; i < t.length - 1; i++) {
|
|
450
459
|
const o = t[i];
|
|
451
|
-
if (
|
|
460
|
+
if (k(s)) {
|
|
452
461
|
const a = +o;
|
|
453
462
|
s = s[a];
|
|
454
|
-
} else if (
|
|
463
|
+
} else if (H(s))
|
|
455
464
|
s = s[o];
|
|
456
|
-
else if (
|
|
465
|
+
else if (X(s)) {
|
|
457
466
|
const a = +o;
|
|
458
|
-
s =
|
|
459
|
-
} else if (
|
|
467
|
+
s = V(s, a);
|
|
468
|
+
} else if (Q(s)) {
|
|
460
469
|
if (i === t.length - 2)
|
|
461
470
|
break;
|
|
462
|
-
const u = +o, c = +t[++i] == 0 ? "key" : "value",
|
|
471
|
+
const u = +o, c = +t[++i] == 0 ? "key" : "value", g = V(s, u);
|
|
463
472
|
switch (c) {
|
|
464
473
|
case "key":
|
|
465
|
-
s =
|
|
474
|
+
s = g;
|
|
466
475
|
break;
|
|
467
476
|
case "value":
|
|
468
|
-
s = s.get(
|
|
477
|
+
s = s.get(g);
|
|
469
478
|
break;
|
|
470
479
|
}
|
|
471
480
|
}
|
|
472
481
|
}
|
|
473
482
|
const n = t[t.length - 1];
|
|
474
|
-
if (
|
|
475
|
-
const i =
|
|
483
|
+
if (k(s) ? s[+n] = r(s[+n]) : H(s) && (s[n] = r(s[n])), X(s)) {
|
|
484
|
+
const i = V(s, +n), o = r(i);
|
|
476
485
|
i !== o && (s.delete(i), s.add(o));
|
|
477
486
|
}
|
|
478
|
-
if (
|
|
479
|
-
const i = +t[t.length - 2], o =
|
|
487
|
+
if (Q(s)) {
|
|
488
|
+
const i = +t[t.length - 2], o = V(s, i);
|
|
480
489
|
switch (+n == 0 ? "key" : "value") {
|
|
481
490
|
case "key": {
|
|
482
491
|
const u = r(o);
|
|
@@ -491,45 +500,45 @@ const Fs = (e, t) => {
|
|
|
491
500
|
}
|
|
492
501
|
return e;
|
|
493
502
|
};
|
|
494
|
-
function
|
|
503
|
+
function Se(e, t, r = []) {
|
|
495
504
|
if (!e)
|
|
496
505
|
return;
|
|
497
|
-
if (!
|
|
498
|
-
|
|
506
|
+
if (!k(e)) {
|
|
507
|
+
K(e, (i, o) => Se(i, t, [...r, ...Y(o)]));
|
|
499
508
|
return;
|
|
500
509
|
}
|
|
501
510
|
const [s, n] = e;
|
|
502
|
-
n &&
|
|
503
|
-
|
|
511
|
+
n && K(n, (i, o) => {
|
|
512
|
+
Se(i, t, [...r, ...Y(o)]);
|
|
504
513
|
}), t(s, r);
|
|
505
514
|
}
|
|
506
|
-
function
|
|
507
|
-
return
|
|
508
|
-
e =
|
|
515
|
+
function Rs(e, t, r) {
|
|
516
|
+
return Se(t, (s, n) => {
|
|
517
|
+
e = Te(e, n, (i) => Ns(i, s, r));
|
|
509
518
|
}), e;
|
|
510
519
|
}
|
|
511
|
-
function
|
|
520
|
+
function Is(e, t) {
|
|
512
521
|
function r(s, n) {
|
|
513
|
-
const i =
|
|
514
|
-
s.map(
|
|
515
|
-
e =
|
|
522
|
+
const i = Ms(e, Y(n));
|
|
523
|
+
s.map(Y).forEach((o) => {
|
|
524
|
+
e = Te(e, o, () => i);
|
|
516
525
|
});
|
|
517
526
|
}
|
|
518
|
-
if (
|
|
527
|
+
if (k(t)) {
|
|
519
528
|
const [s, n] = t;
|
|
520
529
|
s.forEach((i) => {
|
|
521
|
-
e =
|
|
522
|
-
}), n &&
|
|
530
|
+
e = Te(e, Y(i), () => e);
|
|
531
|
+
}), n && K(n, r);
|
|
523
532
|
} else
|
|
524
|
-
|
|
533
|
+
K(t, r);
|
|
525
534
|
return e;
|
|
526
535
|
}
|
|
527
|
-
const
|
|
528
|
-
function
|
|
536
|
+
const ks = (e, t) => H(e) || k(e) || Q(e) || X(e) || St(e, t);
|
|
537
|
+
function Bs(e, t, r) {
|
|
529
538
|
const s = r.get(e);
|
|
530
539
|
s ? s.push(t) : r.set(e, [t]);
|
|
531
540
|
}
|
|
532
|
-
function
|
|
541
|
+
function Ls(e, t) {
|
|
533
542
|
const r = {};
|
|
534
543
|
let s;
|
|
535
544
|
return e.forEach((n) => {
|
|
@@ -537,64 +546,64 @@ function xs(e, t) {
|
|
|
537
546
|
return;
|
|
538
547
|
t || (n = n.map((a) => a.map(String)).sort((a, u) => a.length - u.length));
|
|
539
548
|
const [i, ...o] = n;
|
|
540
|
-
i.length === 0 ? s = o.map(
|
|
541
|
-
}), s ?
|
|
549
|
+
i.length === 0 ? s = o.map(he) : r[he(i)] = o.map(he);
|
|
550
|
+
}), s ? we(r) ? [s] : [s, r] : we(r) ? void 0 : r;
|
|
542
551
|
}
|
|
543
|
-
const
|
|
544
|
-
var
|
|
545
|
-
const a =
|
|
552
|
+
const Dt = (e, t, r, s, n = [], i = [], o = /* @__PURE__ */ new Map()) => {
|
|
553
|
+
var h;
|
|
554
|
+
const a = Cs(e);
|
|
546
555
|
if (!a) {
|
|
547
|
-
|
|
548
|
-
const
|
|
549
|
-
if (
|
|
556
|
+
Bs(e, n, t);
|
|
557
|
+
const b = o.get(e);
|
|
558
|
+
if (b)
|
|
550
559
|
return s ? {
|
|
551
560
|
transformedValue: null
|
|
552
|
-
} :
|
|
561
|
+
} : b;
|
|
553
562
|
}
|
|
554
|
-
if (!
|
|
555
|
-
const
|
|
556
|
-
transformedValue:
|
|
557
|
-
annotations: [
|
|
563
|
+
if (!ks(e, r)) {
|
|
564
|
+
const b = Ge(e, r), p = b ? {
|
|
565
|
+
transformedValue: b.value,
|
|
566
|
+
annotations: [b.type]
|
|
558
567
|
} : {
|
|
559
568
|
transformedValue: e
|
|
560
569
|
};
|
|
561
|
-
return a || o.set(e,
|
|
570
|
+
return a || o.set(e, p), p;
|
|
562
571
|
}
|
|
563
|
-
if (
|
|
572
|
+
if (oe(i, e))
|
|
564
573
|
return {
|
|
565
574
|
transformedValue: null
|
|
566
575
|
};
|
|
567
|
-
const u =
|
|
568
|
-
|
|
569
|
-
if (
|
|
570
|
-
throw new Error(`Detected property ${
|
|
571
|
-
const
|
|
572
|
-
p
|
|
573
|
-
|
|
576
|
+
const u = Ge(e, r), c = (h = u == null ? void 0 : u.value) != null ? h : e, g = k(c) ? [] : {}, d = {};
|
|
577
|
+
K(c, (b, p) => {
|
|
578
|
+
if (p === "__proto__" || p === "constructor" || p === "prototype")
|
|
579
|
+
throw new Error(`Detected property ${p}. This is a prototype pollution risk, please remove it from your object.`);
|
|
580
|
+
const E = Dt(b, t, r, s, [...n, p], [...i, e], o);
|
|
581
|
+
g[p] = E.transformedValue, k(E.annotations) ? d[p] = E.annotations : H(E.annotations) && K(E.annotations, (C, v) => {
|
|
582
|
+
d[Ft(p) + "." + v] = C;
|
|
574
583
|
});
|
|
575
584
|
});
|
|
576
|
-
const
|
|
577
|
-
transformedValue:
|
|
585
|
+
const m = we(d) ? {
|
|
586
|
+
transformedValue: g,
|
|
578
587
|
annotations: u ? [u.type] : void 0
|
|
579
588
|
} : {
|
|
580
|
-
transformedValue:
|
|
581
|
-
annotations: u ? [u.type,
|
|
589
|
+
transformedValue: g,
|
|
590
|
+
annotations: u ? [u.type, d] : d
|
|
582
591
|
};
|
|
583
|
-
return a || o.set(e,
|
|
592
|
+
return a || o.set(e, m), m;
|
|
584
593
|
};
|
|
585
|
-
function
|
|
594
|
+
function xt(e) {
|
|
586
595
|
return Object.prototype.toString.call(e).slice(8, -1);
|
|
587
596
|
}
|
|
588
|
-
function
|
|
589
|
-
return
|
|
597
|
+
function Ye(e) {
|
|
598
|
+
return xt(e) === "Array";
|
|
590
599
|
}
|
|
591
|
-
function
|
|
592
|
-
if (
|
|
600
|
+
function zs(e) {
|
|
601
|
+
if (xt(e) !== "Object")
|
|
593
602
|
return !1;
|
|
594
603
|
const t = Object.getPrototypeOf(e);
|
|
595
604
|
return !!t && t.constructor === Object && t === Object.prototype;
|
|
596
605
|
}
|
|
597
|
-
function
|
|
606
|
+
function Us(e, t, r, s, n) {
|
|
598
607
|
const i = {}.propertyIsEnumerable.call(s, t) ? "enumerable" : "nonenumerable";
|
|
599
608
|
i === "enumerable" && (e[t] = r), n && i === "nonenumerable" && Object.defineProperty(e, t, {
|
|
600
609
|
value: r,
|
|
@@ -603,45 +612,45 @@ function Ss(e, t, r, s, n) {
|
|
|
603
612
|
configurable: !0
|
|
604
613
|
});
|
|
605
614
|
}
|
|
606
|
-
function
|
|
607
|
-
if (
|
|
608
|
-
return e.map((n) =>
|
|
609
|
-
if (
|
|
615
|
+
function Ce(e, t = {}) {
|
|
616
|
+
if (Ye(e))
|
|
617
|
+
return e.map((n) => Ce(n, t));
|
|
618
|
+
if (!zs(e))
|
|
610
619
|
return e;
|
|
611
620
|
const r = Object.getOwnPropertyNames(e), s = Object.getOwnPropertySymbols(e);
|
|
612
621
|
return [...r, ...s].reduce((n, i) => {
|
|
613
|
-
if (
|
|
622
|
+
if (Ye(t.props) && !t.props.includes(i))
|
|
614
623
|
return n;
|
|
615
|
-
const o = e[i], a =
|
|
616
|
-
return
|
|
624
|
+
const o = e[i], a = Ce(o, t);
|
|
625
|
+
return Us(n, i, a, e, t.nonenumerable), n;
|
|
617
626
|
}, {});
|
|
618
627
|
}
|
|
619
|
-
class
|
|
628
|
+
class y {
|
|
620
629
|
/**
|
|
621
630
|
* @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
|
|
622
631
|
*/
|
|
623
632
|
constructor({ dedupe: t = !1 } = {}) {
|
|
624
|
-
this.classRegistry = new
|
|
633
|
+
this.classRegistry = new ps(), this.symbolRegistry = new ht((r) => {
|
|
625
634
|
var s;
|
|
626
635
|
return (s = r.description) != null ? s : "";
|
|
627
|
-
}), this.customTransformerRegistry = new
|
|
636
|
+
}), this.customTransformerRegistry = new ys(), this.allowedErrorProps = [], this.dedupe = t;
|
|
628
637
|
}
|
|
629
638
|
serialize(t) {
|
|
630
|
-
const r = /* @__PURE__ */ new Map(), s =
|
|
639
|
+
const r = /* @__PURE__ */ new Map(), s = Dt(t, r, this, this.dedupe), n = {
|
|
631
640
|
json: s.transformedValue
|
|
632
641
|
};
|
|
633
|
-
s.annotations && (n.meta =
|
|
642
|
+
s.annotations && (n.meta = F(l({}, n.meta), {
|
|
634
643
|
values: s.annotations
|
|
635
644
|
}));
|
|
636
|
-
const i =
|
|
637
|
-
return i && (n.meta =
|
|
645
|
+
const i = Ls(r, this.dedupe);
|
|
646
|
+
return i && (n.meta = F(l({}, n.meta), {
|
|
638
647
|
referentialEqualities: i
|
|
639
648
|
})), n;
|
|
640
649
|
}
|
|
641
650
|
deserialize(t) {
|
|
642
651
|
const { json: r, meta: s } = t;
|
|
643
|
-
let n =
|
|
644
|
-
return s != null && s.values && (n =
|
|
652
|
+
let n = Ce(r);
|
|
653
|
+
return s != null && s.values && (n = Rs(n, s.values, this)), s != null && s.referentialEqualities && (n = Is(n, s.referentialEqualities)), n;
|
|
645
654
|
}
|
|
646
655
|
stringify(t) {
|
|
647
656
|
return JSON.stringify(this.serialize(t));
|
|
@@ -656,7 +665,7 @@ class h {
|
|
|
656
665
|
this.symbolRegistry.register(t, r);
|
|
657
666
|
}
|
|
658
667
|
registerCustom(t, r) {
|
|
659
|
-
this.customTransformerRegistry.register(
|
|
668
|
+
this.customTransformerRegistry.register(l({
|
|
660
669
|
name: r
|
|
661
670
|
}, t));
|
|
662
671
|
}
|
|
@@ -664,160 +673,160 @@ class h {
|
|
|
664
673
|
this.allowedErrorProps.push(...t);
|
|
665
674
|
}
|
|
666
675
|
}
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
const
|
|
676
|
+
y.defaultInstance = new y();
|
|
677
|
+
y.serialize = y.defaultInstance.serialize.bind(y.defaultInstance);
|
|
678
|
+
y.deserialize = y.defaultInstance.deserialize.bind(y.defaultInstance);
|
|
679
|
+
y.stringify = y.defaultInstance.stringify.bind(y.defaultInstance);
|
|
680
|
+
y.parse = y.defaultInstance.parse.bind(y.defaultInstance);
|
|
681
|
+
y.registerClass = y.defaultInstance.registerClass.bind(y.defaultInstance);
|
|
682
|
+
y.registerSymbol = y.defaultInstance.registerSymbol.bind(y.defaultInstance);
|
|
683
|
+
y.registerCustom = y.defaultInstance.registerCustom.bind(y.defaultInstance);
|
|
684
|
+
y.allowErrorProps = y.defaultInstance.allowErrorProps.bind(y.defaultInstance);
|
|
685
|
+
const P = (e) => e === void 0 ? U.None : e, _s = (e) => new ar(e.metadataItem, e.type), ve = (e) => new Sr(
|
|
677
686
|
e.name,
|
|
678
687
|
e.expression,
|
|
679
688
|
e.type,
|
|
680
689
|
e.description,
|
|
681
|
-
|
|
690
|
+
P(e.sort),
|
|
682
691
|
e.dataSource,
|
|
683
692
|
e.composeCode
|
|
684
|
-
),
|
|
693
|
+
), Ne = (e) => new Cr(
|
|
685
694
|
e.name,
|
|
686
695
|
e.expression,
|
|
687
696
|
e.granularity,
|
|
688
697
|
e.format,
|
|
689
698
|
e.description,
|
|
690
|
-
|
|
699
|
+
P(e.sort),
|
|
691
700
|
e.dataSource,
|
|
692
701
|
e.composeCode
|
|
693
|
-
),
|
|
702
|
+
), N = (e) => {
|
|
694
703
|
switch (e.__serializable) {
|
|
695
704
|
case "DimensionalAttribute":
|
|
696
|
-
return
|
|
705
|
+
return ve(e);
|
|
697
706
|
case "DimensionalLevelAttribute":
|
|
698
|
-
return
|
|
707
|
+
return Ne(e);
|
|
699
708
|
default:
|
|
700
709
|
return e;
|
|
701
710
|
}
|
|
702
|
-
},
|
|
711
|
+
}, vt = (e) => new ss(
|
|
703
712
|
e.name,
|
|
704
713
|
e.expression,
|
|
705
|
-
e.attributes.map(
|
|
706
|
-
e.dimensions.map(
|
|
714
|
+
e.attributes.map(N),
|
|
715
|
+
e.dimensions.map(Ps),
|
|
707
716
|
e.type,
|
|
708
717
|
e.description,
|
|
709
|
-
|
|
718
|
+
P(e.sort),
|
|
710
719
|
e.dataSource,
|
|
711
720
|
e.composeCode,
|
|
712
|
-
e.defaultAttribute ?
|
|
713
|
-
),
|
|
721
|
+
e.defaultAttribute ? N(e.defaultAttribute) : void 0
|
|
722
|
+
), Nt = (e) => new ns(
|
|
714
723
|
e.name,
|
|
715
724
|
e.expression,
|
|
716
725
|
e.description,
|
|
717
|
-
|
|
726
|
+
P(e.sort),
|
|
718
727
|
e.dataSource,
|
|
719
728
|
e.composeCode,
|
|
720
729
|
e.indexed,
|
|
721
730
|
e.merged
|
|
722
|
-
),
|
|
731
|
+
), Ps = (e) => {
|
|
723
732
|
switch (e.__serializable) {
|
|
724
733
|
case "DimensionalDimension":
|
|
725
|
-
return
|
|
734
|
+
return vt(e);
|
|
726
735
|
case "DimensionalDateDimension":
|
|
727
|
-
return
|
|
736
|
+
return Nt(e);
|
|
728
737
|
default:
|
|
729
738
|
return e;
|
|
730
739
|
}
|
|
731
|
-
},
|
|
740
|
+
}, Me = (e) => new qr(
|
|
732
741
|
e.name,
|
|
733
|
-
|
|
742
|
+
N(e.attribute),
|
|
734
743
|
e.aggregation,
|
|
735
744
|
e.format,
|
|
736
745
|
e.description,
|
|
737
|
-
|
|
746
|
+
P(e.sort),
|
|
738
747
|
e.dataSource,
|
|
739
748
|
e.composeCode
|
|
740
|
-
),
|
|
749
|
+
), Re = (e) => {
|
|
741
750
|
const t = Object.fromEntries(
|
|
742
751
|
Object.entries(e.context).map(([r, s]) => {
|
|
743
752
|
if (s && typeof s == "object" && "__serializable" in s)
|
|
744
753
|
switch (s.__serializable) {
|
|
745
754
|
case "DimensionalAttribute":
|
|
746
|
-
return [r,
|
|
755
|
+
return [r, ve(s)];
|
|
747
756
|
case "DimensionalLevelAttribute":
|
|
748
|
-
return [r,
|
|
757
|
+
return [r, Ne(s)];
|
|
749
758
|
case "DimensionalBaseMeasure":
|
|
750
|
-
return [r,
|
|
759
|
+
return [r, Me(s)];
|
|
751
760
|
case "DimensionalCalculatedMeasure":
|
|
752
|
-
return [r,
|
|
761
|
+
return [r, Re(s)];
|
|
753
762
|
default:
|
|
754
763
|
return [r, s];
|
|
755
764
|
}
|
|
756
765
|
return [r, s];
|
|
757
766
|
})
|
|
758
767
|
);
|
|
759
|
-
return new
|
|
768
|
+
return new $r(
|
|
760
769
|
e.name,
|
|
761
770
|
e.expression,
|
|
762
771
|
t,
|
|
763
772
|
e.format,
|
|
764
773
|
e.description,
|
|
765
|
-
|
|
774
|
+
P(e.sort),
|
|
766
775
|
e.dataSource,
|
|
767
776
|
e.composeCode
|
|
768
777
|
);
|
|
769
|
-
},
|
|
778
|
+
}, Mt = (e) => new Or(
|
|
770
779
|
e.name,
|
|
771
|
-
|
|
780
|
+
N(e.attribute),
|
|
772
781
|
e.format,
|
|
773
782
|
e.description,
|
|
774
|
-
|
|
783
|
+
P(e.sort),
|
|
775
784
|
e.dataSource,
|
|
776
785
|
e.composeCode
|
|
777
|
-
),
|
|
786
|
+
), be = (e) => {
|
|
778
787
|
switch (e.__serializable) {
|
|
779
788
|
case "DimensionalBaseMeasure":
|
|
780
|
-
return
|
|
789
|
+
return Me(e);
|
|
781
790
|
case "DimensionalCalculatedMeasure":
|
|
782
|
-
return
|
|
791
|
+
return Re(e);
|
|
783
792
|
case "DimensionalMeasureTemplate":
|
|
784
|
-
return
|
|
793
|
+
return Mt(e);
|
|
785
794
|
default:
|
|
786
795
|
return e;
|
|
787
796
|
}
|
|
788
|
-
},
|
|
797
|
+
}, S = (e) => {
|
|
789
798
|
switch (e.__serializable) {
|
|
790
799
|
case "MembersFilter":
|
|
791
|
-
return new
|
|
792
|
-
|
|
800
|
+
return new Ur(
|
|
801
|
+
N(e.attribute),
|
|
793
802
|
e.members,
|
|
794
|
-
e.config.backgroundFilter ?
|
|
803
|
+
e.config.backgroundFilter ? F(l({}, e.config), { backgroundFilter: S(e.config.backgroundFilter) }) : e.config,
|
|
795
804
|
e.composeCode
|
|
796
805
|
);
|
|
797
806
|
case "LogicalAttributeFilter":
|
|
798
|
-
return new
|
|
799
|
-
e.filters.map((r) =>
|
|
807
|
+
return new zr(
|
|
808
|
+
e.filters.map((r) => S(r)),
|
|
800
809
|
e.operator,
|
|
801
810
|
e.config,
|
|
802
811
|
e.composeCode
|
|
803
812
|
);
|
|
804
813
|
case "CascadingFilter":
|
|
805
|
-
return new
|
|
806
|
-
e._filters.map((r) =>
|
|
814
|
+
return new Lr(
|
|
815
|
+
e._filters.map((r) => S(r)),
|
|
807
816
|
e.config,
|
|
808
817
|
e.composeCode
|
|
809
818
|
);
|
|
810
819
|
case "ExcludeFilter":
|
|
811
|
-
return new
|
|
812
|
-
|
|
813
|
-
e.input ?
|
|
820
|
+
return new Br(
|
|
821
|
+
S(e.filter),
|
|
822
|
+
e.input ? S(e.input) : void 0,
|
|
814
823
|
e.config,
|
|
815
824
|
e.composeCode
|
|
816
825
|
);
|
|
817
826
|
case "MeasureFilter":
|
|
818
|
-
return new
|
|
819
|
-
|
|
820
|
-
|
|
827
|
+
return new kr(
|
|
828
|
+
N(e.attribute),
|
|
829
|
+
be(e.measure),
|
|
821
830
|
e.operatorA,
|
|
822
831
|
e.valueA,
|
|
823
832
|
e.operatorB,
|
|
@@ -826,25 +835,25 @@ const z = (e) => e === void 0 ? B.None : e, Os = (e) => new Jt(e.metadataItem, e
|
|
|
826
835
|
e.composeCode
|
|
827
836
|
);
|
|
828
837
|
case "RankingFilter":
|
|
829
|
-
return new
|
|
830
|
-
|
|
831
|
-
|
|
838
|
+
return new Ir(
|
|
839
|
+
N(e.attribute),
|
|
840
|
+
be(e.measure),
|
|
832
841
|
e.operator,
|
|
833
842
|
e.count,
|
|
834
843
|
e.config,
|
|
835
844
|
e.composeCode
|
|
836
845
|
);
|
|
837
846
|
case "MeasureRankingFilter":
|
|
838
|
-
return new
|
|
839
|
-
|
|
847
|
+
return new Rr(
|
|
848
|
+
be(e.measure),
|
|
840
849
|
e.operator,
|
|
841
850
|
e.count,
|
|
842
851
|
e.config,
|
|
843
852
|
e.composeCode
|
|
844
853
|
);
|
|
845
854
|
case "NumericFilter":
|
|
846
|
-
return new
|
|
847
|
-
|
|
855
|
+
return new Mr(
|
|
856
|
+
N(e.attribute),
|
|
848
857
|
e.operatorA,
|
|
849
858
|
e.valueA,
|
|
850
859
|
e.operatorB,
|
|
@@ -853,8 +862,8 @@ const z = (e) => e === void 0 ? B.None : e, Os = (e) => new Jt(e.metadataItem, e
|
|
|
853
862
|
e.composeCode
|
|
854
863
|
);
|
|
855
864
|
case "TextFilter":
|
|
856
|
-
return new
|
|
857
|
-
|
|
865
|
+
return new Nr(
|
|
866
|
+
N(e.attribute),
|
|
858
867
|
e.operatorA,
|
|
859
868
|
e.valueA,
|
|
860
869
|
e.config,
|
|
@@ -862,8 +871,8 @@ const z = (e) => e === void 0 ? B.None : e, Os = (e) => new Jt(e.metadataItem, e
|
|
|
862
871
|
);
|
|
863
872
|
case "DateRangeFilter": {
|
|
864
873
|
const { valueA: r, valueB: s } = e;
|
|
865
|
-
return new
|
|
866
|
-
|
|
874
|
+
return new vr(
|
|
875
|
+
N(e.attribute),
|
|
867
876
|
r,
|
|
868
877
|
s,
|
|
869
878
|
e.config,
|
|
@@ -871,8 +880,8 @@ const z = (e) => e === void 0 ? B.None : e, Os = (e) => new Jt(e.metadataItem, e
|
|
|
871
880
|
);
|
|
872
881
|
}
|
|
873
882
|
case "RelativeDateFilter":
|
|
874
|
-
return new
|
|
875
|
-
|
|
883
|
+
return new xr(
|
|
884
|
+
N(e.attribute),
|
|
876
885
|
e.offset,
|
|
877
886
|
e.count,
|
|
878
887
|
e.operator,
|
|
@@ -881,8 +890,8 @@ const z = (e) => e === void 0 ? B.None : e, Os = (e) => new Jt(e.metadataItem, e
|
|
|
881
890
|
e.composeCode
|
|
882
891
|
);
|
|
883
892
|
case "CustomFilter":
|
|
884
|
-
return new
|
|
885
|
-
|
|
893
|
+
return new Dr(
|
|
894
|
+
N(e.attribute),
|
|
886
895
|
e.jaqlExpression,
|
|
887
896
|
e.config,
|
|
888
897
|
e.composeCode
|
|
@@ -891,209 +900,209 @@ const z = (e) => e === void 0 ? B.None : e, Os = (e) => new Jt(e.metadataItem, e
|
|
|
891
900
|
return e;
|
|
892
901
|
}
|
|
893
902
|
};
|
|
894
|
-
|
|
903
|
+
y.registerCustom(
|
|
895
904
|
{
|
|
896
|
-
isApplicable:
|
|
905
|
+
isApplicable: or,
|
|
897
906
|
serialize: (e) => e.serialize(),
|
|
898
|
-
deserialize: (e) =>
|
|
907
|
+
deserialize: (e) => _s(e)
|
|
899
908
|
},
|
|
900
909
|
"JaqlElement"
|
|
901
910
|
);
|
|
902
|
-
|
|
911
|
+
y.registerCustom(
|
|
903
912
|
{
|
|
904
|
-
isApplicable:
|
|
913
|
+
isApplicable: ur,
|
|
905
914
|
serialize: (e) => e.serialize(),
|
|
906
|
-
deserialize: (e) =>
|
|
915
|
+
deserialize: (e) => ve(e)
|
|
907
916
|
},
|
|
908
917
|
"DimensionalAttribute"
|
|
909
918
|
);
|
|
910
|
-
|
|
919
|
+
y.registerCustom(
|
|
911
920
|
{
|
|
912
|
-
isApplicable:
|
|
921
|
+
isApplicable: cr,
|
|
913
922
|
serialize: (e) => e.serialize(),
|
|
914
|
-
deserialize: (e) =>
|
|
923
|
+
deserialize: (e) => Ne(e)
|
|
915
924
|
},
|
|
916
925
|
"DimensionalLevelAttribute"
|
|
917
926
|
);
|
|
918
|
-
|
|
927
|
+
y.registerCustom(
|
|
919
928
|
{
|
|
920
|
-
isApplicable:
|
|
929
|
+
isApplicable: ts,
|
|
921
930
|
serialize: (e) => e.serialize(),
|
|
922
|
-
deserialize: (e) =>
|
|
931
|
+
deserialize: (e) => vt(e)
|
|
923
932
|
},
|
|
924
933
|
"DimensionalDimension"
|
|
925
934
|
);
|
|
926
|
-
|
|
935
|
+
y.registerCustom(
|
|
927
936
|
{
|
|
928
|
-
isApplicable:
|
|
937
|
+
isApplicable: rs,
|
|
929
938
|
serialize: (e) => e.serialize(),
|
|
930
|
-
deserialize: (e) =>
|
|
939
|
+
deserialize: (e) => Nt(e)
|
|
931
940
|
},
|
|
932
941
|
"DimensionalDateDimension"
|
|
933
942
|
);
|
|
934
|
-
|
|
943
|
+
y.registerCustom(
|
|
935
944
|
{
|
|
936
|
-
isApplicable:
|
|
945
|
+
isApplicable: lr,
|
|
937
946
|
serialize: (e) => e.serialize(),
|
|
938
|
-
deserialize: (e) =>
|
|
947
|
+
deserialize: (e) => Me(e)
|
|
939
948
|
},
|
|
940
949
|
"DimensionalBaseMeasure"
|
|
941
950
|
);
|
|
942
|
-
|
|
951
|
+
y.registerCustom(
|
|
943
952
|
{
|
|
944
|
-
isApplicable:
|
|
953
|
+
isApplicable: dr,
|
|
945
954
|
serialize: (e) => e.serialize(),
|
|
946
|
-
deserialize: (e) =>
|
|
955
|
+
deserialize: (e) => Re(e)
|
|
947
956
|
},
|
|
948
957
|
"DimensionalCalculatedMeasure"
|
|
949
958
|
);
|
|
950
|
-
|
|
959
|
+
y.registerCustom(
|
|
951
960
|
{
|
|
952
|
-
isApplicable:
|
|
961
|
+
isApplicable: fr,
|
|
953
962
|
serialize: (e) => e.serialize(),
|
|
954
|
-
deserialize: (e) =>
|
|
963
|
+
deserialize: (e) => Mt(e)
|
|
955
964
|
},
|
|
956
965
|
"DimensionalMeasureTemplate"
|
|
957
966
|
);
|
|
958
|
-
|
|
967
|
+
y.registerCustom(
|
|
959
968
|
{
|
|
960
|
-
isApplicable:
|
|
969
|
+
isApplicable: De,
|
|
961
970
|
serialize: (e) => e.serialize(),
|
|
962
|
-
deserialize: (e) =>
|
|
971
|
+
deserialize: (e) => S(e)
|
|
963
972
|
},
|
|
964
973
|
"MembersFilter"
|
|
965
974
|
);
|
|
966
|
-
|
|
975
|
+
y.registerCustom(
|
|
967
976
|
{
|
|
968
|
-
isApplicable:
|
|
977
|
+
isApplicable: pr,
|
|
969
978
|
serialize: (e) => e.serialize(),
|
|
970
|
-
deserialize: (e) =>
|
|
979
|
+
deserialize: (e) => S(e)
|
|
971
980
|
},
|
|
972
981
|
"LogicalAttributeFilter"
|
|
973
982
|
);
|
|
974
|
-
|
|
983
|
+
y.registerCustom(
|
|
975
984
|
{
|
|
976
|
-
isApplicable:
|
|
985
|
+
isApplicable: mr,
|
|
977
986
|
serialize: (e) => e.serialize(),
|
|
978
|
-
deserialize: (e) =>
|
|
987
|
+
deserialize: (e) => S(e)
|
|
979
988
|
},
|
|
980
989
|
"CascadingFilter"
|
|
981
990
|
);
|
|
982
|
-
|
|
991
|
+
y.registerCustom(
|
|
983
992
|
{
|
|
984
|
-
isApplicable:
|
|
993
|
+
isApplicable: gr,
|
|
985
994
|
serialize: (e) => e.serialize(),
|
|
986
|
-
deserialize: (e) =>
|
|
995
|
+
deserialize: (e) => S(e)
|
|
987
996
|
},
|
|
988
997
|
"ExcludeFilter"
|
|
989
998
|
);
|
|
990
|
-
|
|
999
|
+
y.registerCustom(
|
|
991
1000
|
{
|
|
992
|
-
isApplicable:
|
|
1001
|
+
isApplicable: yr,
|
|
993
1002
|
serialize: (e) => e.serialize(),
|
|
994
|
-
deserialize: (e) =>
|
|
1003
|
+
deserialize: (e) => S(e)
|
|
995
1004
|
},
|
|
996
1005
|
"MeasureFilter"
|
|
997
1006
|
);
|
|
998
|
-
|
|
1007
|
+
y.registerCustom(
|
|
999
1008
|
{
|
|
1000
|
-
isApplicable:
|
|
1009
|
+
isApplicable: hr,
|
|
1001
1010
|
serialize: (e) => e.serialize(),
|
|
1002
|
-
deserialize: (e) =>
|
|
1011
|
+
deserialize: (e) => S(e)
|
|
1003
1012
|
},
|
|
1004
1013
|
"RankingFilter"
|
|
1005
1014
|
);
|
|
1006
|
-
|
|
1015
|
+
y.registerCustom(
|
|
1007
1016
|
{
|
|
1008
|
-
isApplicable:
|
|
1017
|
+
isApplicable: br,
|
|
1009
1018
|
serialize: (e) => e.serialize(),
|
|
1010
|
-
deserialize: (e) =>
|
|
1019
|
+
deserialize: (e) => S(e)
|
|
1011
1020
|
},
|
|
1012
1021
|
"MeasureRankingFilter"
|
|
1013
1022
|
);
|
|
1014
|
-
|
|
1023
|
+
y.registerCustom(
|
|
1015
1024
|
{
|
|
1016
|
-
isApplicable:
|
|
1025
|
+
isApplicable: Er,
|
|
1017
1026
|
serialize: (e) => e.serialize(),
|
|
1018
|
-
deserialize: (e) =>
|
|
1027
|
+
deserialize: (e) => S(e)
|
|
1019
1028
|
},
|
|
1020
1029
|
"NumericFilter"
|
|
1021
1030
|
);
|
|
1022
|
-
|
|
1031
|
+
y.registerCustom(
|
|
1023
1032
|
{
|
|
1024
|
-
isApplicable:
|
|
1033
|
+
isApplicable: Fr,
|
|
1025
1034
|
serialize: (e) => e.serialize(),
|
|
1026
|
-
deserialize: (e) =>
|
|
1035
|
+
deserialize: (e) => S(e)
|
|
1027
1036
|
},
|
|
1028
1037
|
"TextFilter"
|
|
1029
1038
|
);
|
|
1030
|
-
|
|
1039
|
+
y.registerCustom(
|
|
1031
1040
|
{
|
|
1032
|
-
isApplicable:
|
|
1041
|
+
isApplicable: Ar,
|
|
1033
1042
|
serialize: (e) => e.serialize(),
|
|
1034
|
-
deserialize: (e) =>
|
|
1043
|
+
deserialize: (e) => S(e)
|
|
1035
1044
|
},
|
|
1036
1045
|
"DateRangeFilter"
|
|
1037
1046
|
);
|
|
1038
|
-
|
|
1047
|
+
y.registerCustom(
|
|
1039
1048
|
{
|
|
1040
|
-
isApplicable:
|
|
1049
|
+
isApplicable: wr,
|
|
1041
1050
|
serialize: (e) => e.serialize(),
|
|
1042
|
-
deserialize: (e) =>
|
|
1051
|
+
deserialize: (e) => S(e)
|
|
1043
1052
|
},
|
|
1044
1053
|
"RelativeDateFilter"
|
|
1045
1054
|
);
|
|
1046
|
-
|
|
1055
|
+
y.registerCustom(
|
|
1047
1056
|
{
|
|
1048
|
-
isApplicable:
|
|
1057
|
+
isApplicable: Tr,
|
|
1049
1058
|
serialize: (e) => e.serialize(),
|
|
1050
|
-
deserialize: (e) =>
|
|
1059
|
+
deserialize: (e) => S(e)
|
|
1051
1060
|
},
|
|
1052
1061
|
"CustomFilter"
|
|
1053
1062
|
);
|
|
1054
|
-
const
|
|
1055
|
-
function
|
|
1063
|
+
const Di = y, w = "DM.";
|
|
1064
|
+
function O(e) {
|
|
1056
1065
|
return typeof e == "object" && e !== null;
|
|
1057
1066
|
}
|
|
1058
|
-
function
|
|
1067
|
+
function q(e) {
|
|
1059
1068
|
return typeof e == "object" && e !== null && "function" in e && "args" in e;
|
|
1060
1069
|
}
|
|
1061
|
-
function
|
|
1062
|
-
return e.every(
|
|
1070
|
+
function Rt(e) {
|
|
1071
|
+
return e.every(q);
|
|
1063
1072
|
}
|
|
1064
|
-
function
|
|
1073
|
+
function fe(e) {
|
|
1065
1074
|
return "attribute" in e && "config" in e;
|
|
1066
1075
|
}
|
|
1067
|
-
function
|
|
1076
|
+
function te(e) {
|
|
1068
1077
|
return "left" in e && "right" in e && "operator" in e;
|
|
1069
1078
|
}
|
|
1070
|
-
function
|
|
1071
|
-
return !
|
|
1079
|
+
function Ie(e) {
|
|
1080
|
+
return !fe(e) && !te(e);
|
|
1072
1081
|
}
|
|
1073
|
-
function
|
|
1074
|
-
return
|
|
1082
|
+
function Ws(e) {
|
|
1083
|
+
return O(e) && "column" in e && typeof e.column == "string" && !("function" in e && "args" in e);
|
|
1075
1084
|
}
|
|
1076
|
-
function
|
|
1077
|
-
return !
|
|
1085
|
+
function Vs(e) {
|
|
1086
|
+
return !O(e) || !("column" in e) ? !1 : q(e.column);
|
|
1078
1087
|
}
|
|
1079
|
-
const
|
|
1080
|
-
function
|
|
1088
|
+
const T = 3;
|
|
1089
|
+
function x(e, t, r) {
|
|
1081
1090
|
if (t.length === 0) return;
|
|
1082
1091
|
let s = Number.MAX_SAFE_INTEGER, n;
|
|
1083
1092
|
for (const i of t) {
|
|
1084
|
-
const o = r(i), a =
|
|
1093
|
+
const o = r(i), a = os(e, o);
|
|
1085
1094
|
a < s && (s = a, n = i);
|
|
1086
1095
|
}
|
|
1087
1096
|
return n !== void 0 ? { best: n, distance: s } : void 0;
|
|
1088
1097
|
}
|
|
1089
|
-
const
|
|
1090
|
-
function
|
|
1091
|
-
return e.localeCompare(t,
|
|
1098
|
+
const It = "en";
|
|
1099
|
+
function Ee(e, t) {
|
|
1100
|
+
return e.localeCompare(t, It, { sensitivity: "accent" }) === 0;
|
|
1092
1101
|
}
|
|
1093
|
-
function
|
|
1094
|
-
return t.length <= e.length && e.slice(0, t.length).localeCompare(t,
|
|
1102
|
+
function He(e, t) {
|
|
1103
|
+
return t.length <= e.length && e.slice(0, t.length).localeCompare(t, It, { sensitivity: "accent" }) === 0;
|
|
1095
1104
|
}
|
|
1096
|
-
function
|
|
1105
|
+
function re(e) {
|
|
1097
1106
|
const t = [...e].sort((i, o) => o.name.length - i.name.length), r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
1098
1107
|
for (const i of e) {
|
|
1099
1108
|
r.set(i.name, i);
|
|
@@ -1111,79 +1120,79 @@ function xe(e) {
|
|
|
1111
1120
|
columnMap: s
|
|
1112
1121
|
};
|
|
1113
1122
|
}
|
|
1114
|
-
function
|
|
1115
|
-
if (!e.startsWith(
|
|
1123
|
+
function ke(e, t) {
|
|
1124
|
+
if (!e.startsWith(w))
|
|
1116
1125
|
throw new Error(
|
|
1117
|
-
`Invalid dimensional element name format: '${e}'. Expected format: '${
|
|
1126
|
+
`Invalid dimensional element name format: '${e}'. Expected format: '${w}TableName.ColumnName[.Level]'`
|
|
1118
1127
|
);
|
|
1119
|
-
const r = e.slice(
|
|
1128
|
+
const r = e.slice(w.length);
|
|
1120
1129
|
if (!r)
|
|
1121
1130
|
throw new Error(
|
|
1122
|
-
`Invalid dimensional element name format: '${e}'. Expected format: '${
|
|
1131
|
+
`Invalid dimensional element name format: '${e}'. Expected format: '${w}TableName.ColumnName[.Level]'`
|
|
1123
1132
|
);
|
|
1124
1133
|
let s, n;
|
|
1125
|
-
for (const
|
|
1126
|
-
if (
|
|
1127
|
-
const
|
|
1128
|
-
if (!
|
|
1134
|
+
for (const p of t.sortedTables)
|
|
1135
|
+
if (He(r, p.name + ".")) {
|
|
1136
|
+
const E = r.slice(p.name.length + 1);
|
|
1137
|
+
if (!E)
|
|
1129
1138
|
throw new Error(
|
|
1130
|
-
`Invalid dimensional element name format: '${e}'. Expected format: '${
|
|
1139
|
+
`Invalid dimensional element name format: '${e}'. Expected format: '${w}TableName.ColumnName[.Level]'`
|
|
1131
1140
|
);
|
|
1132
|
-
s =
|
|
1141
|
+
s = p, n = E;
|
|
1133
1142
|
break;
|
|
1134
1143
|
}
|
|
1135
1144
|
if (!s) {
|
|
1136
|
-
const
|
|
1137
|
-
if (
|
|
1145
|
+
const p = r.indexOf(".");
|
|
1146
|
+
if (p === -1)
|
|
1138
1147
|
throw new Error(
|
|
1139
|
-
`Invalid dimensional element name format: '${e}'. Expected format: '${
|
|
1148
|
+
`Invalid dimensional element name format: '${e}'. Expected format: '${w}TableName.ColumnName[.Level]'`
|
|
1140
1149
|
);
|
|
1141
|
-
const
|
|
1142
|
-
throw new Error(`Table '${
|
|
1150
|
+
const E = r.slice(0, p), C = x(E, t.sortedTables, (W) => W.name), v = C && C.distance <= T ? ` Did you mean '${C.best.name}'?` : "";
|
|
1151
|
+
throw new Error(`Table '${E}' not found in the data model.${v}`);
|
|
1143
1152
|
}
|
|
1144
1153
|
const i = t.tableColumnMap.get(s.name);
|
|
1145
1154
|
if (!i)
|
|
1146
1155
|
throw new Error(`Table '${s.name}' found but has no columns`);
|
|
1147
1156
|
let o, a;
|
|
1148
1157
|
const u = $.all;
|
|
1149
|
-
for (const
|
|
1150
|
-
if (
|
|
1151
|
-
return { table: s, column:
|
|
1152
|
-
if (!
|
|
1158
|
+
for (const p of i) {
|
|
1159
|
+
if (Ee(n, p.name))
|
|
1160
|
+
return { table: s, column: p };
|
|
1161
|
+
if (!He(n, p.name + "."))
|
|
1153
1162
|
continue;
|
|
1154
|
-
const
|
|
1155
|
-
if (!
|
|
1163
|
+
const E = n.slice(p.name.length + 1);
|
|
1164
|
+
if (!E)
|
|
1156
1165
|
continue;
|
|
1157
|
-
const C = u.includes(
|
|
1166
|
+
const C = u.includes(E), v = ee(p.dataType);
|
|
1158
1167
|
if (C) {
|
|
1159
|
-
if (
|
|
1160
|
-
return { table: s, column:
|
|
1161
|
-
o || (o =
|
|
1168
|
+
if (v)
|
|
1169
|
+
return { table: s, column: p, level: E };
|
|
1170
|
+
o || (o = p, a = E);
|
|
1162
1171
|
continue;
|
|
1163
1172
|
}
|
|
1164
|
-
|
|
1173
|
+
v && !o && (o = p, a = E);
|
|
1165
1174
|
}
|
|
1166
1175
|
if (o && a) {
|
|
1167
1176
|
if (u.includes(a))
|
|
1168
1177
|
throw new Error(
|
|
1169
1178
|
`Invalid date level '${a}' in dimensional element '${e}'. Column '${s.name}.${o.name}' is not a datetime column`
|
|
1170
1179
|
);
|
|
1171
|
-
const
|
|
1180
|
+
const p = x(a, u, (C) => C), E = p && p.distance <= T ? ` Did you mean '${p.best}'?` : "";
|
|
1172
1181
|
throw new Error(
|
|
1173
1182
|
`Invalid date level '${a}' in dimensional element '${e}'. Valid levels are: ${u.join(
|
|
1174
1183
|
", "
|
|
1175
|
-
)}.${
|
|
1184
|
+
)}.${E}`
|
|
1176
1185
|
);
|
|
1177
1186
|
}
|
|
1178
|
-
const c = n.indexOf("."),
|
|
1187
|
+
const c = n.indexOf("."), g = c === -1 ? n : n.slice(0, c), d = x(n, i, (p) => p.name), m = d && d.distance <= T && !Ee(d.best.name, g), h = m ? ` Did you mean '${d.best.name}'?` : "", b = !m && n.endsWith(".") && d !== void 0 && Ee(d.best.name, g) ? ` Use '${g}' without a trailing dot.` : "";
|
|
1179
1188
|
throw new Error(
|
|
1180
|
-
`Column '${
|
|
1189
|
+
`Column '${g}' not found in table '${s.name}'.${h}${b}`
|
|
1181
1190
|
);
|
|
1182
1191
|
}
|
|
1183
|
-
function
|
|
1184
|
-
const { table: r, column: s, level: n } =
|
|
1192
|
+
function js(e, t) {
|
|
1193
|
+
const { table: r, column: s, level: n } = ke(e, t);
|
|
1185
1194
|
if (n) {
|
|
1186
|
-
if (!
|
|
1195
|
+
if (!ee(s.dataType))
|
|
1187
1196
|
throw new Error(
|
|
1188
1197
|
`Invalid date level '${n}' in dimensional element '${e}'. Column '${r.name}.${s.name}' is not a datetime column`
|
|
1189
1198
|
);
|
|
@@ -1207,28 +1216,28 @@ function Rs(e, t) {
|
|
|
1207
1216
|
}
|
|
1208
1217
|
return { table: r, column: s, level: n };
|
|
1209
1218
|
}
|
|
1210
|
-
function
|
|
1211
|
-
const { table: n, column: i, level: o } =
|
|
1219
|
+
function Z(e, t, r, s) {
|
|
1220
|
+
const { table: n, column: i, level: o } = js(e, r);
|
|
1212
1221
|
let a = o;
|
|
1213
|
-
if (
|
|
1222
|
+
if (ee(i.dataType) && a === void 0 && (s != null && s.inferredDateLevel)) {
|
|
1214
1223
|
const u = s.inferredDateLevel, c = $.all;
|
|
1215
1224
|
if (!c.includes(u))
|
|
1216
1225
|
throw new Error(
|
|
1217
1226
|
`Invalid inferred date level '${u}'. Valid levels are: ${c.join(", ")}`
|
|
1218
1227
|
);
|
|
1219
|
-
const
|
|
1220
|
-
if (i.dataType === "date" && !
|
|
1228
|
+
const g = `${e}.${u}`, d = $.dateOnly;
|
|
1229
|
+
if (i.dataType === "date" && !d.includes(u))
|
|
1221
1230
|
throw new Error(
|
|
1222
|
-
`Invalid level '${u}' in dimensional element '${
|
|
1231
|
+
`Invalid level '${u}' in dimensional element '${g}'. Column '${n.name}.${i.name}' is only a date column, not a datetime column`
|
|
1223
1232
|
);
|
|
1224
|
-
const
|
|
1225
|
-
if (i.dataType === "time" && !
|
|
1233
|
+
const m = $.timeOnly;
|
|
1234
|
+
if (i.dataType === "time" && !m.includes(u))
|
|
1226
1235
|
throw new Error(
|
|
1227
|
-
`Invalid level '${u}' in dimensional element '${
|
|
1236
|
+
`Invalid level '${u}' in dimensional element '${g}'. Column '${n.name}.${i.name}' is only a time column, not a date column`
|
|
1228
1237
|
);
|
|
1229
1238
|
a = u;
|
|
1230
1239
|
}
|
|
1231
|
-
return
|
|
1240
|
+
return _r({
|
|
1232
1241
|
expression: i.expression,
|
|
1233
1242
|
dataType: i.dataType,
|
|
1234
1243
|
granularity: a,
|
|
@@ -1237,44 +1246,44 @@ function H(e, t, r, s) {
|
|
|
1237
1246
|
dataSource: t
|
|
1238
1247
|
});
|
|
1239
1248
|
}
|
|
1240
|
-
function
|
|
1241
|
-
const { column: s, level: n } =
|
|
1249
|
+
function Js(e, t, r) {
|
|
1250
|
+
const { column: s, level: n } = ke(e, r);
|
|
1242
1251
|
if (n)
|
|
1243
1252
|
throw new Error(
|
|
1244
|
-
`Invalid DateDimension name format: '${e}'. Expected format: '${
|
|
1253
|
+
`Invalid DateDimension name format: '${e}'. Expected format: '${w}TableName.ColumnName'`
|
|
1245
1254
|
);
|
|
1246
|
-
if (!
|
|
1255
|
+
if (!ee(s.dataType))
|
|
1247
1256
|
throw new Error(
|
|
1248
1257
|
`Invalid DateDimension name '${e}'. Column '${s.name}' is not a datetime column (got ${s.dataType}).`
|
|
1249
1258
|
);
|
|
1250
|
-
return
|
|
1259
|
+
return is({
|
|
1251
1260
|
name: s.name,
|
|
1252
1261
|
expression: s.expression,
|
|
1253
1262
|
dataSource: t
|
|
1254
1263
|
});
|
|
1255
1264
|
}
|
|
1256
|
-
const
|
|
1265
|
+
const Ks = (e, t) => {
|
|
1257
1266
|
if (!e) return;
|
|
1258
1267
|
const r = typeof e == "object" ? e.direction : e;
|
|
1259
|
-
if (!
|
|
1260
|
-
return
|
|
1268
|
+
if (!ct(r))
|
|
1269
|
+
return F(l({}, t), {
|
|
1261
1270
|
message: `Invalid sort type. Expected 'sortAsc', 'sortDesc', or 'sortNone'. Got: '${r}'.`
|
|
1262
1271
|
});
|
|
1263
|
-
},
|
|
1264
|
-
const n =
|
|
1272
|
+
}, Gs = (e, t, r, s) => {
|
|
1273
|
+
const n = Ks(e.sortType, s);
|
|
1265
1274
|
if (n)
|
|
1266
1275
|
return {
|
|
1267
|
-
attribute:
|
|
1276
|
+
attribute: Z(e.column, t, r),
|
|
1268
1277
|
style: {},
|
|
1269
1278
|
error: n
|
|
1270
1279
|
};
|
|
1271
|
-
const i =
|
|
1280
|
+
const i = Z(e.column, t, r), o = _(e, "column");
|
|
1272
1281
|
return { attribute: i, style: o };
|
|
1273
|
-
},
|
|
1274
|
-
error:
|
|
1282
|
+
}, Ys = (e, t, r, s) => typeof e == "string" ? { attribute: Z(e, t, r) } : Ws(e) ? Gs(e, t, r, s) : {
|
|
1283
|
+
error: F(l({}, s), {
|
|
1275
1284
|
message: "Invalid dimension item. Expected a string (composeCode) or object with 'column' and optional 'sortType'."
|
|
1276
1285
|
})
|
|
1277
|
-
},
|
|
1286
|
+
}, kt = (e) => {
|
|
1278
1287
|
const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context;
|
|
1279
1288
|
if (!t)
|
|
1280
1289
|
return { success: !0, data: [] };
|
|
@@ -1283,8 +1292,7 @@ const Is = (e, t) => {
|
|
|
1283
1292
|
success: !1,
|
|
1284
1293
|
errors: [
|
|
1285
1294
|
{
|
|
1286
|
-
|
|
1287
|
-
index: -1,
|
|
1295
|
+
path: "dimensions",
|
|
1288
1296
|
input: t,
|
|
1289
1297
|
message: "Invalid dimensions JSON. Expected an array."
|
|
1290
1298
|
}
|
|
@@ -1293,12 +1301,11 @@ const Is = (e, t) => {
|
|
|
1293
1301
|
const n = [], i = [];
|
|
1294
1302
|
return t.forEach((o, a) => {
|
|
1295
1303
|
const u = {
|
|
1296
|
-
|
|
1297
|
-
index: a,
|
|
1304
|
+
path: `dimensions[${a}]`,
|
|
1298
1305
|
input: o
|
|
1299
1306
|
};
|
|
1300
1307
|
try {
|
|
1301
|
-
const c =
|
|
1308
|
+
const c = Ys(o, r, s, u);
|
|
1302
1309
|
if (c.error) {
|
|
1303
1310
|
i.push(c.error);
|
|
1304
1311
|
return;
|
|
@@ -1307,48 +1314,48 @@ const Is = (e, t) => {
|
|
|
1307
1314
|
c.style !== void 0 ? { attribute: c.attribute, style: c.style } : { attribute: c.attribute }
|
|
1308
1315
|
);
|
|
1309
1316
|
} catch (c) {
|
|
1310
|
-
const
|
|
1311
|
-
i.push(
|
|
1317
|
+
const g = c instanceof Error ? c.message : "Unknown error";
|
|
1318
|
+
i.push(F(l({}, u), { message: g }));
|
|
1312
1319
|
}
|
|
1313
1320
|
}), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: n };
|
|
1314
1321
|
};
|
|
1315
|
-
function
|
|
1322
|
+
function Be(e, t) {
|
|
1316
1323
|
const r = Reflect.get(e, t);
|
|
1317
1324
|
if (typeof r != "function")
|
|
1318
1325
|
throw new Error(`Function '${t}' not found or is not a function`);
|
|
1319
1326
|
return r;
|
|
1320
1327
|
}
|
|
1321
|
-
function
|
|
1322
|
-
const r = e.replace("measureFactory.", ""), n =
|
|
1323
|
-
if (!
|
|
1328
|
+
function Hs(e, t) {
|
|
1329
|
+
const r = e.replace("measureFactory.", ""), n = Be(Pr, r)(...t);
|
|
1330
|
+
if (!Ie(n))
|
|
1324
1331
|
throw new Error(`Function '${e}' did not return a valid Measure`);
|
|
1325
1332
|
return n;
|
|
1326
1333
|
}
|
|
1327
|
-
function
|
|
1328
|
-
const r = e.replace("filterFactory.logic.", ""), n =
|
|
1329
|
-
if (!
|
|
1334
|
+
function Qs(e, t) {
|
|
1335
|
+
const r = e.replace("filterFactory.logic.", ""), n = Be(Wr, r)(...t);
|
|
1336
|
+
if (!te(n))
|
|
1330
1337
|
throw new Error(`Function '${e}' did not return a valid FilterRelations`);
|
|
1331
1338
|
return n;
|
|
1332
1339
|
}
|
|
1333
|
-
function
|
|
1340
|
+
function Xs(e, t) {
|
|
1334
1341
|
if (e.startsWith("filterFactory.logic."))
|
|
1335
|
-
return
|
|
1336
|
-
const r = e.replace("filterFactory.", ""), n =
|
|
1337
|
-
if (!
|
|
1342
|
+
return Qs(e, t);
|
|
1343
|
+
const r = e.replace("filterFactory.", ""), n = Be(Vr, r)(...t);
|
|
1344
|
+
if (!fe(n) && !te(n))
|
|
1338
1345
|
throw new Error(`Function '${e}' did not return a valid Filter or FilterRelations`);
|
|
1339
1346
|
return n;
|
|
1340
1347
|
}
|
|
1341
|
-
function
|
|
1348
|
+
function Zs(e, t) {
|
|
1342
1349
|
const s = e.split(".")[0];
|
|
1343
1350
|
if (s === "measureFactory")
|
|
1344
|
-
return
|
|
1351
|
+
return Hs(e, t);
|
|
1345
1352
|
if (s === "filterFactory")
|
|
1346
|
-
return
|
|
1353
|
+
return Xs(e, t);
|
|
1347
1354
|
throw new Error(
|
|
1348
1355
|
`Unsupported factory: '${s}'. Supported factories: measureFactory, filterFactory`
|
|
1349
1356
|
);
|
|
1350
1357
|
}
|
|
1351
|
-
const f = (e, t, r, s) =>
|
|
1358
|
+
const f = (e, t, r, s) => l({ category: e, minArgs: t, maxArgs: r }, s), en = /* @__PURE__ */ new Set([
|
|
1352
1359
|
"CORREL",
|
|
1353
1360
|
"COVARP",
|
|
1354
1361
|
"COVAR",
|
|
@@ -1367,7 +1374,7 @@ const f = (e, t, r, s) => y({ category: e, minArgs: t, maxArgs: r }, s), _s = /*
|
|
|
1367
1374
|
"ORDERING",
|
|
1368
1375
|
"RDOUBLE",
|
|
1369
1376
|
"RINT"
|
|
1370
|
-
]),
|
|
1377
|
+
]), ue = {
|
|
1371
1378
|
// ── X-diff (datetime difference operators) ──
|
|
1372
1379
|
SDIFF: f("xdiff", 2, 2, {
|
|
1373
1380
|
requiredDateLevel: $.Seconds,
|
|
@@ -1478,20 +1485,20 @@ const f = (e, t, r, s) => y({ category: e, minArgs: t, maxArgs: r }, s), _s = /*
|
|
|
1478
1485
|
SIN: f("scalar", 1, 1),
|
|
1479
1486
|
SQRT: f("scalar", 1, 1),
|
|
1480
1487
|
TAN: f("scalar", 1, 1)
|
|
1481
|
-
},
|
|
1482
|
-
(e) =>
|
|
1488
|
+
}, tn = Object.keys(ue).filter(
|
|
1489
|
+
(e) => ue[e].category === "xdiff"
|
|
1483
1490
|
);
|
|
1484
|
-
function
|
|
1485
|
-
return
|
|
1491
|
+
function Bt() {
|
|
1492
|
+
return tn;
|
|
1486
1493
|
}
|
|
1487
|
-
function
|
|
1488
|
-
const t =
|
|
1494
|
+
function Lt(e) {
|
|
1495
|
+
const t = ue[e.toUpperCase()];
|
|
1489
1496
|
return t == null ? void 0 : t.requiredDateLevel;
|
|
1490
1497
|
}
|
|
1491
|
-
function
|
|
1498
|
+
function rn(e, t) {
|
|
1492
1499
|
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`;
|
|
1493
1500
|
}
|
|
1494
|
-
const
|
|
1501
|
+
const sn = /\[(\w[\w.-]*)\]/g, zt = /* @__PURE__ */ new Set([
|
|
1495
1502
|
// Universal – Aggregative (per Sisense doc: (A) only; Statistical CONTRIBUTION, PERCENTILE, etc. are non-aggregative)
|
|
1496
1503
|
"AVG",
|
|
1497
1504
|
"COUNT",
|
|
@@ -1512,30 +1519,30 @@ const js = /\[(\w[\w.-]*)\]/g, Dt = /* @__PURE__ */ new Set([
|
|
|
1512
1519
|
"YTDSUM"
|
|
1513
1520
|
// RAVG, RSUM are non-aggregative per Sisense doc (Other Functions, not (A))
|
|
1514
1521
|
// CORREL, COVAR*, SKEW*, SLOPE, LARGEST are unsupported in custom formulas (see UNSUPPORTED_FORMULA_FUNCTIONS).
|
|
1515
|
-
]),
|
|
1516
|
-
`\\b(${Array.from(
|
|
1522
|
+
]), nn = new RegExp(
|
|
1523
|
+
`\\b(${Array.from(zt).join("|")})\\s*\\(`,
|
|
1517
1524
|
"i"
|
|
1518
1525
|
);
|
|
1519
|
-
function
|
|
1520
|
-
return
|
|
1526
|
+
function Ut(e) {
|
|
1527
|
+
return q(e) ? !0 : typeof e == "string" && e.startsWith(w) ? !1 : O(e) && "kind" in e ? e.kind === "measure" : !0;
|
|
1521
1528
|
}
|
|
1522
|
-
function
|
|
1529
|
+
function on(e) {
|
|
1523
1530
|
const t = /\b(\w+)\s*\(/g, r = /* @__PURE__ */ new Set();
|
|
1524
1531
|
let s;
|
|
1525
1532
|
for (; (s = t.exec(e)) !== null; ) {
|
|
1526
1533
|
const n = s[1];
|
|
1527
|
-
|
|
1534
|
+
zt.has(n.toUpperCase()) || r.add(n);
|
|
1528
1535
|
}
|
|
1529
1536
|
return Array.from(r);
|
|
1530
1537
|
}
|
|
1531
|
-
function
|
|
1538
|
+
function an(e) {
|
|
1532
1539
|
return e.length === 1 ? `[${e[0]}]` : e.map((t) => `[${t}]`).join(", ");
|
|
1533
1540
|
}
|
|
1534
|
-
function
|
|
1541
|
+
function un(e) {
|
|
1535
1542
|
return e.length === 0 ? "" : e.length === 1 ? `${e[0]} is not an aggregative function. ` : `${e.join(", ")} are not aggregative functions. `;
|
|
1536
1543
|
}
|
|
1537
|
-
const
|
|
1538
|
-
function
|
|
1544
|
+
const G = (e) => e.startsWith("[") ? e : `[${e}]`, _t = (e) => e.startsWith("[") && e.endsWith("]") ? e.slice(1, -1) : e;
|
|
1545
|
+
function Pt(e, t) {
|
|
1539
1546
|
if (t.length === 0) return [];
|
|
1540
1547
|
const r = t.map((n) => n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|"), s = new RegExp(
|
|
1541
1548
|
`\\b(${r})\\s*\\(\\s*\\[([^\\]]+)\\]\\s*,\\s*\\[([^\\]]+)\\]\\s*\\)`,
|
|
@@ -1547,14 +1554,14 @@ function Rt(e, t) {
|
|
|
1547
1554
|
ref2: n[3].trim()
|
|
1548
1555
|
}));
|
|
1549
1556
|
}
|
|
1550
|
-
function
|
|
1557
|
+
function cn(e, t, r) {
|
|
1551
1558
|
var o, a, u;
|
|
1552
1559
|
const s = Object.keys(t), n = ((o = r.errorPrefix) != null ? o : "customFormula validation").trim(), i = n === "" ? "" : n.endsWith(" ") ? n : `${n} `;
|
|
1553
1560
|
return {
|
|
1554
1561
|
formula: e,
|
|
1555
1562
|
context: t,
|
|
1556
1563
|
contextKeys: s,
|
|
1557
|
-
canonicalContextKeys: new Set(s.map(
|
|
1564
|
+
canonicalContextKeys: new Set(s.map(G)),
|
|
1558
1565
|
errorPrefix: i,
|
|
1559
1566
|
warnUnusedContext: (a = r.warnUnusedContext) != null ? a : !0,
|
|
1560
1567
|
errorOnUnusedContext: (u = r.errorOnUnusedContext) != null ? u : !0,
|
|
@@ -1562,20 +1569,20 @@ function Hs(e, t, r) {
|
|
|
1562
1569
|
result: { isValid: !0, errors: [], warnings: [], references: [], unusedContextKeys: [] }
|
|
1563
1570
|
};
|
|
1564
1571
|
}
|
|
1565
|
-
function
|
|
1572
|
+
function R(e, t) {
|
|
1566
1573
|
e.result.errors.push(t), e.result.isValid = !1;
|
|
1567
1574
|
}
|
|
1568
|
-
const
|
|
1569
|
-
function
|
|
1575
|
+
const ln = /* @__PURE__ */ new Set(["CASE", "WHEN", "THEN", "ELSE", "END", "AND", "OR"]);
|
|
1576
|
+
function dn(e) {
|
|
1570
1577
|
const t = /\b(\w+)\s*\[/gi, r = [...e.formula.matchAll(t)].find(
|
|
1571
|
-
(s) => !
|
|
1578
|
+
(s) => !ln.has(s[1].toUpperCase())
|
|
1572
1579
|
);
|
|
1573
|
-
r &&
|
|
1580
|
+
r && R(
|
|
1574
1581
|
e,
|
|
1575
1582
|
`${e.errorPrefix}args[1]: Invalid syntax: '${r[1]}' - operator cannot be used before bracket reference without parentheses`
|
|
1576
1583
|
);
|
|
1577
1584
|
}
|
|
1578
|
-
function
|
|
1585
|
+
function fn(e, t) {
|
|
1579
1586
|
const r = e[t];
|
|
1580
1587
|
let s = t + 1;
|
|
1581
1588
|
for (; s < e.length; ) {
|
|
@@ -1592,27 +1599,27 @@ function Zs(e, t) {
|
|
|
1592
1599
|
}
|
|
1593
1600
|
return e.length;
|
|
1594
1601
|
}
|
|
1595
|
-
function
|
|
1596
|
-
return
|
|
1602
|
+
function pn(e) {
|
|
1603
|
+
return xe(e, ",").filter((t) => t.trim().length > 0).length;
|
|
1597
1604
|
}
|
|
1598
|
-
function
|
|
1605
|
+
function mn(e, t, r, s) {
|
|
1599
1606
|
for (; t < e.length && /\s/.test(e[t]); )
|
|
1600
1607
|
t++;
|
|
1601
1608
|
if (e[t] !== "(")
|
|
1602
1609
|
return t;
|
|
1603
|
-
const n = t, i =
|
|
1610
|
+
const n = t, i = us(e, n);
|
|
1604
1611
|
if (i === -1)
|
|
1605
1612
|
return n + 1;
|
|
1606
1613
|
const o = e.slice(n + 1, i);
|
|
1607
|
-
return s.push({ name: r.toUpperCase(), argCount:
|
|
1614
|
+
return s.push({ name: r.toUpperCase(), argCount: pn(o) }), s.push(...Wt(o)), i + 1;
|
|
1608
1615
|
}
|
|
1609
|
-
function
|
|
1616
|
+
function Wt(e) {
|
|
1610
1617
|
const t = [];
|
|
1611
1618
|
let r = 0;
|
|
1612
1619
|
for (; r < e.length; ) {
|
|
1613
1620
|
const s = e[r];
|
|
1614
1621
|
if (s === "'" || s === '"') {
|
|
1615
|
-
r =
|
|
1622
|
+
r = fn(e, r);
|
|
1616
1623
|
continue;
|
|
1617
1624
|
}
|
|
1618
1625
|
if (/[A-Za-z_]/.test(s)) {
|
|
@@ -1620,122 +1627,122 @@ function vt(e) {
|
|
|
1620
1627
|
for (r++; r < e.length && /[A-Za-z0-9_]/.test(e[r]); )
|
|
1621
1628
|
r++;
|
|
1622
1629
|
const i = e.slice(n, r);
|
|
1623
|
-
r =
|
|
1630
|
+
r = mn(e, r, i, t);
|
|
1624
1631
|
continue;
|
|
1625
1632
|
}
|
|
1626
1633
|
r++;
|
|
1627
1634
|
}
|
|
1628
1635
|
return t;
|
|
1629
1636
|
}
|
|
1630
|
-
function
|
|
1631
|
-
const t =
|
|
1637
|
+
function gn(e) {
|
|
1638
|
+
const t = Wt(e.formula), r = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
|
|
1632
1639
|
for (const { name: n, argCount: i } of t) {
|
|
1633
|
-
if (
|
|
1634
|
-
r.has(n) || (r.add(n),
|
|
1640
|
+
if (en.has(n)) {
|
|
1641
|
+
r.has(n) || (r.add(n), R(
|
|
1635
1642
|
e,
|
|
1636
1643
|
`${e.errorPrefix}args[1]: Function ${n} is not supported in custom formulas`
|
|
1637
1644
|
));
|
|
1638
1645
|
continue;
|
|
1639
1646
|
}
|
|
1640
|
-
const o =
|
|
1647
|
+
const o = ue[n];
|
|
1641
1648
|
if (o && (i < o.minArgs || i > o.maxArgs) && !s.has(n)) {
|
|
1642
1649
|
s.add(n);
|
|
1643
|
-
const a =
|
|
1644
|
-
|
|
1650
|
+
const a = rn(o.minArgs, o.maxArgs);
|
|
1651
|
+
R(e, `${e.errorPrefix}args[1]: Function ${n} accepts ${a}`);
|
|
1645
1652
|
}
|
|
1646
1653
|
}
|
|
1647
1654
|
}
|
|
1648
|
-
function
|
|
1655
|
+
function yn(e) {
|
|
1649
1656
|
return [
|
|
1650
1657
|
...new Set(
|
|
1651
|
-
[...e.matchAll(new RegExp(
|
|
1658
|
+
[...e.matchAll(new RegExp(sn.source, "g"))].map((t) => t[1])
|
|
1652
1659
|
)
|
|
1653
1660
|
];
|
|
1654
1661
|
}
|
|
1655
|
-
function
|
|
1662
|
+
function hn(e) {
|
|
1656
1663
|
const t = e.result.references.filter(
|
|
1657
|
-
(n) => !e.canonicalContextKeys.has(
|
|
1664
|
+
(n) => !e.canonicalContextKeys.has(G(n))
|
|
1658
1665
|
);
|
|
1659
1666
|
if (t.length === 0) return;
|
|
1660
|
-
const r = e.contextKeys.map((n) => `[${
|
|
1661
|
-
|
|
1667
|
+
const r = e.contextKeys.map((n) => `[${_t(n)}]`).join(", "), s = t.length === 1 ? `Reference [${t[0]}]` : `References [${t.join("], [")}]`;
|
|
1668
|
+
R(
|
|
1662
1669
|
e,
|
|
1663
1670
|
`${e.errorPrefix}args[1]: ${s} not found in context. Available keys: ${r}`
|
|
1664
1671
|
);
|
|
1665
1672
|
}
|
|
1666
|
-
function
|
|
1667
|
-
if (
|
|
1673
|
+
function bn(e) {
|
|
1674
|
+
if (nn.test(e.formula)) return;
|
|
1668
1675
|
const t = e.result.references.filter((r) => {
|
|
1669
1676
|
var n;
|
|
1670
|
-
const s = (n = e.context[
|
|
1671
|
-
return s !== void 0 && !
|
|
1677
|
+
const s = (n = e.context[G(r)]) != null ? n : e.context[r];
|
|
1678
|
+
return s !== void 0 && !Ut(s);
|
|
1672
1679
|
});
|
|
1673
|
-
t.length !== 0 &&
|
|
1680
|
+
t.length !== 0 && R(
|
|
1674
1681
|
e,
|
|
1675
|
-
`${e.errorPrefix}args[1]: ${
|
|
1676
|
-
|
|
1677
|
-
)}Bracket reference(s) ${
|
|
1682
|
+
`${e.errorPrefix}args[1]: ${un(
|
|
1683
|
+
on(e.formula)
|
|
1684
|
+
)}Bracket reference(s) ${an(
|
|
1678
1685
|
t
|
|
1679
1686
|
)} point to raw attributes and must be wrapped in an aggregative function (e.g. SUM, AVG)`
|
|
1680
1687
|
);
|
|
1681
1688
|
}
|
|
1682
|
-
function
|
|
1689
|
+
function En(e) {
|
|
1683
1690
|
if (!e.warnUnusedContext && !e.errorOnUnusedContext || e.contextKeys.length === 0) return;
|
|
1684
|
-
const t = new Set(e.result.references.map(
|
|
1691
|
+
const t = new Set(e.result.references.map(G)), r = e.contextKeys.filter((i) => !t.has(G(i)));
|
|
1685
1692
|
if (e.result.unusedContextKeys = r, r.length === 0) return;
|
|
1686
|
-
const s = r.map((i) => `[${
|
|
1687
|
-
e.errorOnUnusedContext ?
|
|
1693
|
+
const s = r.map((i) => `[${_t(i)}]`).join(", "), n = `${e.errorPrefix}args[2]: Context keys ${s} are defined but not used in formula`;
|
|
1694
|
+
e.errorOnUnusedContext ? R(e, n) : e.warnUnusedContext && e.result.warnings.push(n);
|
|
1688
1695
|
}
|
|
1689
|
-
function
|
|
1696
|
+
function Qe(e, t, r, s) {
|
|
1690
1697
|
var o;
|
|
1691
|
-
const n = (o = s.context[
|
|
1698
|
+
const n = (o = s.context[G(e)]) != null ? o : s.context[e];
|
|
1692
1699
|
if (n === void 0) return;
|
|
1693
|
-
if (!(typeof n == "string" && n.startsWith(
|
|
1694
|
-
|
|
1700
|
+
if (!(typeof n == "string" && n.startsWith(w))) {
|
|
1701
|
+
Ut(n) && R(
|
|
1695
1702
|
s,
|
|
1696
|
-
`${s.errorPrefix}args[1]: ${t.functionName} requires datetime dimension attributes. Reference [${e}] points to a measure; use an attribute (e.g. ${
|
|
1703
|
+
`${s.errorPrefix}args[1]: ${t.functionName} requires datetime dimension attributes. Reference [${e}] points to a measure; use an attribute (e.g. ${w}Table.Column.Level).`
|
|
1697
1704
|
);
|
|
1698
1705
|
return;
|
|
1699
1706
|
}
|
|
1700
1707
|
if (s.schemaIndex)
|
|
1701
1708
|
try {
|
|
1702
|
-
const a =
|
|
1703
|
-
|
|
1709
|
+
const a = ke(n, s.schemaIndex);
|
|
1710
|
+
ee(a.column.dataType) ? r && a.level && a.level !== r && R(
|
|
1704
1711
|
s,
|
|
1705
1712
|
`${s.errorPrefix}args[1]: ${t.functionName} expects date level '${r}'. Reference [${e}] has level '${a.level}'.`
|
|
1706
|
-
) :
|
|
1713
|
+
) : R(
|
|
1707
1714
|
s,
|
|
1708
1715
|
`${s.errorPrefix}args[1]: ${t.functionName} requires datetime dimensions. Reference [${e}] resolves to non-datetime column '${a.column.name}'.`
|
|
1709
1716
|
);
|
|
1710
1717
|
} catch (a) {
|
|
1711
1718
|
const u = a instanceof Error ? a.message : "Unknown error";
|
|
1712
|
-
|
|
1719
|
+
R(s, `${s.errorPrefix}args[1]: ${t.functionName} reference [${e}]: ${u}`);
|
|
1713
1720
|
}
|
|
1714
1721
|
}
|
|
1715
|
-
function
|
|
1716
|
-
const t =
|
|
1722
|
+
function Fn(e) {
|
|
1723
|
+
const t = Bt(), r = Pt(e.formula, t);
|
|
1717
1724
|
for (const s of r) {
|
|
1718
|
-
const n =
|
|
1719
|
-
|
|
1725
|
+
const n = Lt(s.functionName);
|
|
1726
|
+
Qe(s.ref1, s, n, e), Qe(s.ref2, s, n, e);
|
|
1720
1727
|
}
|
|
1721
1728
|
}
|
|
1722
|
-
function
|
|
1729
|
+
function An(e, t, r = {}) {
|
|
1723
1730
|
var n;
|
|
1724
|
-
const s =
|
|
1725
|
-
return !e || e.trim().length === 0 ? ((n = r.allowEmptyFormula) != null && n ||
|
|
1731
|
+
const s = cn(e, t, r);
|
|
1732
|
+
return !e || e.trim().length === 0 ? ((n = r.allowEmptyFormula) != null && n || R(s, `${s.errorPrefix}args[1]: Formula cannot be empty`), s.result) : (dn(s), gn(s), s.result.references = yn(e), s.result.references.length === 0 ? (s.result.warnings.push(
|
|
1726
1733
|
`${s.errorPrefix}args[1]: No bracket references found in formula - ensure this is intentional`
|
|
1727
|
-
), s.result) : s.contextKeys.length === 0 ? (
|
|
1734
|
+
), s.result) : s.contextKeys.length === 0 ? (R(
|
|
1728
1735
|
s,
|
|
1729
1736
|
`${s.errorPrefix}args[2]: Context cannot be empty - custom formulas require context definitions`
|
|
1730
|
-
), s.result) : (
|
|
1737
|
+
), s.result) : (hn(s), bn(s), En(s), Fn(s), s.result));
|
|
1731
1738
|
}
|
|
1732
|
-
function
|
|
1733
|
-
const s =
|
|
1739
|
+
function wn(e, t, r = {}) {
|
|
1740
|
+
const s = An(e, t, r);
|
|
1734
1741
|
if (!s.isValid)
|
|
1735
1742
|
throw new Error(s.errors.join("; "));
|
|
1736
1743
|
s.warnings.length > 0 && console.warn("Formula validation warnings:", s.warnings.join("; "));
|
|
1737
1744
|
}
|
|
1738
|
-
function
|
|
1745
|
+
function Tn(e, t) {
|
|
1739
1746
|
if (e.length < 3 || e.length > 5)
|
|
1740
1747
|
throw new Error(
|
|
1741
1748
|
`${t.pathPrefix}Expected 3, 4, or 5 arguments for customFormula (title, formula, context, format?, description?)`
|
|
@@ -1746,12 +1753,12 @@ function fn(e, t) {
|
|
|
1746
1753
|
`${t.pathPrefix}args[1]: Expected formula string, got ${typeof r}`
|
|
1747
1754
|
);
|
|
1748
1755
|
const s = r, n = e[2];
|
|
1749
|
-
if (!
|
|
1756
|
+
if (!O(n))
|
|
1750
1757
|
throw new Error(
|
|
1751
1758
|
`${t.pathPrefix}args[2]: Expected context object, got ${n === null ? "null" : typeof n}`
|
|
1752
1759
|
);
|
|
1753
1760
|
const i = n;
|
|
1754
|
-
|
|
1761
|
+
wn(s, i, {
|
|
1755
1762
|
errorPrefix: `${t.pathPrefix}`,
|
|
1756
1763
|
errorOnUnusedContext: !0,
|
|
1757
1764
|
// Strict validation: all context keys must be used
|
|
@@ -1759,44 +1766,44 @@ function fn(e, t) {
|
|
|
1759
1766
|
// Custom formulas must have content
|
|
1760
1767
|
schemaIndex: t.schemaIndex
|
|
1761
1768
|
});
|
|
1762
|
-
const o =
|
|
1769
|
+
const o = Sn(s), a = {};
|
|
1763
1770
|
for (const [u, c] of Object.entries(i)) {
|
|
1764
|
-
const
|
|
1765
|
-
if (
|
|
1766
|
-
a[`${u}`] =
|
|
1771
|
+
const g = `args[2].${u}`;
|
|
1772
|
+
if (q(c))
|
|
1773
|
+
a[`${u}`] = M({
|
|
1767
1774
|
data: c,
|
|
1768
1775
|
context: {
|
|
1769
1776
|
dataSource: t.dataSource,
|
|
1770
1777
|
schemaIndex: t.schemaIndex,
|
|
1771
|
-
pathPrefix:
|
|
1778
|
+
pathPrefix: g
|
|
1772
1779
|
}
|
|
1773
1780
|
});
|
|
1774
|
-
else if (typeof c == "string" && c.startsWith(
|
|
1775
|
-
const
|
|
1781
|
+
else if (typeof c == "string" && c.startsWith(w)) {
|
|
1782
|
+
const d = u.startsWith("[") && u.endsWith("]") ? u.slice(1, -1) : u, m = o[d];
|
|
1776
1783
|
try {
|
|
1777
|
-
a[`${u}`] =
|
|
1784
|
+
a[`${u}`] = Z(
|
|
1778
1785
|
c,
|
|
1779
1786
|
t.dataSource,
|
|
1780
1787
|
t.schemaIndex,
|
|
1781
|
-
|
|
1788
|
+
m !== void 0 ? { inferredDateLevel: m } : void 0
|
|
1782
1789
|
);
|
|
1783
|
-
} catch (
|
|
1784
|
-
const
|
|
1785
|
-
throw new Error(`${
|
|
1790
|
+
} catch (h) {
|
|
1791
|
+
const b = h instanceof Error ? h.message : "Unknown error";
|
|
1792
|
+
throw new Error(`${g}: ${b}`);
|
|
1786
1793
|
}
|
|
1787
1794
|
} else if (c && typeof c == "object" && "kind" in c)
|
|
1788
1795
|
a[`${u}`] = c;
|
|
1789
1796
|
else
|
|
1790
1797
|
throw new Error(
|
|
1791
|
-
`${
|
|
1798
|
+
`${g}: Invalid context value for key '${u}'. Expected a function call or attribute reference (${w}...), but got: ${typeof c}`
|
|
1792
1799
|
);
|
|
1793
1800
|
}
|
|
1794
|
-
e[
|
|
1801
|
+
return [e[0], e[1], a, ...e.slice(3)];
|
|
1795
1802
|
}
|
|
1796
|
-
function
|
|
1797
|
-
const t =
|
|
1803
|
+
function Sn(e) {
|
|
1804
|
+
const t = Bt(), r = Pt(e, t), s = {};
|
|
1798
1805
|
for (const n of r) {
|
|
1799
|
-
const i =
|
|
1806
|
+
const i = Lt(n.functionName);
|
|
1800
1807
|
if (i !== void 0)
|
|
1801
1808
|
for (const o of [n.ref1, n.ref2]) {
|
|
1802
1809
|
const a = s[o];
|
|
@@ -1809,95 +1816,99 @@ function dn(e) {
|
|
|
1809
1816
|
}
|
|
1810
1817
|
return s;
|
|
1811
1818
|
}
|
|
1812
|
-
function
|
|
1813
|
-
return e.type ===
|
|
1819
|
+
function Vt(e) {
|
|
1820
|
+
return e.type === j.TextAttribute;
|
|
1814
1821
|
}
|
|
1815
|
-
function
|
|
1816
|
-
return e.type ===
|
|
1822
|
+
function jt(e) {
|
|
1823
|
+
return e.type === j.NumericAttribute;
|
|
1817
1824
|
}
|
|
1818
|
-
function
|
|
1819
|
-
return e.type ===
|
|
1825
|
+
function Cn(e) {
|
|
1826
|
+
return e.type === j.DateLevel;
|
|
1820
1827
|
}
|
|
1821
|
-
function
|
|
1822
|
-
return
|
|
1828
|
+
function qn(e) {
|
|
1829
|
+
return Vt(e) || jt(e);
|
|
1823
1830
|
}
|
|
1824
|
-
function
|
|
1825
|
-
return e.type ===
|
|
1831
|
+
function pe(e) {
|
|
1832
|
+
return e.type === j.TextAttribute ? "text" : e.type === j.NumericAttribute ? "numeric" : e.type === j.DateLevel ? "date/datetime" : "unknown";
|
|
1826
1833
|
}
|
|
1827
|
-
function
|
|
1834
|
+
function Le(e, t) {
|
|
1828
1835
|
const r = e[0];
|
|
1829
1836
|
if (!r || typeof r != "object" || !("type" in r))
|
|
1830
1837
|
throw new Error(`${t.pathPrefix}args[0]: Expected attribute as first argument`);
|
|
1831
1838
|
return r;
|
|
1832
1839
|
}
|
|
1833
|
-
function
|
|
1834
|
-
const r =
|
|
1835
|
-
if (!
|
|
1840
|
+
function Xe(e, t) {
|
|
1841
|
+
const r = Le(e, t);
|
|
1842
|
+
if (!qn(r))
|
|
1836
1843
|
throw new Error(
|
|
1837
|
-
`${t.pathPrefix}args[0]: Attribute must be string or numeric type, got ${
|
|
1844
|
+
`${t.pathPrefix}args[0]: Attribute must be string or numeric type, got ${pe(
|
|
1838
1845
|
r
|
|
1839
1846
|
)} attribute`
|
|
1840
1847
|
);
|
|
1848
|
+
return e;
|
|
1841
1849
|
}
|
|
1842
|
-
function
|
|
1843
|
-
const r =
|
|
1844
|
-
if (!
|
|
1850
|
+
function L(e, t) {
|
|
1851
|
+
const r = Le(e, t);
|
|
1852
|
+
if (!jt(r))
|
|
1845
1853
|
throw new Error(
|
|
1846
|
-
`${t.pathPrefix}args[0]: Attribute must be numeric type, got ${
|
|
1854
|
+
`${t.pathPrefix}args[0]: Attribute must be numeric type, got ${pe(
|
|
1847
1855
|
r
|
|
1848
1856
|
)} attribute`
|
|
1849
1857
|
);
|
|
1858
|
+
return e;
|
|
1850
1859
|
}
|
|
1851
|
-
function
|
|
1852
|
-
const r =
|
|
1853
|
-
if (!
|
|
1860
|
+
function z(e, t) {
|
|
1861
|
+
const r = Le(e, t);
|
|
1862
|
+
if (!Vt(r))
|
|
1854
1863
|
throw new Error(
|
|
1855
|
-
`${t.pathPrefix}args[0]: Attribute must be string type, got ${
|
|
1864
|
+
`${t.pathPrefix}args[0]: Attribute must be string type, got ${pe(
|
|
1856
1865
|
r
|
|
1857
1866
|
)} attribute`
|
|
1858
1867
|
);
|
|
1868
|
+
return e;
|
|
1859
1869
|
}
|
|
1860
|
-
function
|
|
1870
|
+
function $n(e, t) {
|
|
1861
1871
|
const r = e[0];
|
|
1862
1872
|
if (!r || typeof r != "object" || !("attribute" in r))
|
|
1863
1873
|
throw new Error(`${t.pathPrefix}args[0]: Expected filter as first argument`);
|
|
1864
1874
|
return r;
|
|
1865
1875
|
}
|
|
1866
|
-
function
|
|
1867
|
-
const r =
|
|
1868
|
-
if (!
|
|
1876
|
+
function On(e, t) {
|
|
1877
|
+
const r = $n(e, t);
|
|
1878
|
+
if (!De(r))
|
|
1869
1879
|
throw new Error(
|
|
1870
1880
|
`${t.pathPrefix}args[0]: exclude filter only accepts members filter, got ${r.__serializable || "unknown"} filter`
|
|
1871
1881
|
);
|
|
1882
|
+
return e;
|
|
1872
1883
|
}
|
|
1873
|
-
const
|
|
1874
|
-
"measureFactory.customFormula":
|
|
1884
|
+
const Dn = {
|
|
1885
|
+
"measureFactory.customFormula": Tn,
|
|
1875
1886
|
// String | Number filters
|
|
1876
|
-
"filterFactory.equals":
|
|
1877
|
-
"filterFactory.doesntEqual":
|
|
1887
|
+
"filterFactory.equals": Xe,
|
|
1888
|
+
"filterFactory.doesntEqual": Xe,
|
|
1878
1889
|
// Numeric filters
|
|
1879
|
-
"filterFactory.greaterThan":
|
|
1880
|
-
"filterFactory.greaterThanOrEqual":
|
|
1881
|
-
"filterFactory.lessThan":
|
|
1882
|
-
"filterFactory.lessThanOrEqual":
|
|
1883
|
-
"filterFactory.between":
|
|
1884
|
-
"filterFactory.betweenNotEqual":
|
|
1885
|
-
"filterFactory.numeric":
|
|
1890
|
+
"filterFactory.greaterThan": L,
|
|
1891
|
+
"filterFactory.greaterThanOrEqual": L,
|
|
1892
|
+
"filterFactory.lessThan": L,
|
|
1893
|
+
"filterFactory.lessThanOrEqual": L,
|
|
1894
|
+
"filterFactory.between": L,
|
|
1895
|
+
"filterFactory.betweenNotEqual": L,
|
|
1896
|
+
"filterFactory.numeric": L,
|
|
1886
1897
|
// String filters
|
|
1887
|
-
"filterFactory.contains":
|
|
1888
|
-
"filterFactory.doesntContain":
|
|
1889
|
-
"filterFactory.startsWith":
|
|
1890
|
-
"filterFactory.doesntStartWith":
|
|
1891
|
-
"filterFactory.endsWith":
|
|
1892
|
-
"filterFactory.doesntEndWith":
|
|
1893
|
-
"filterFactory.like":
|
|
1898
|
+
"filterFactory.contains": z,
|
|
1899
|
+
"filterFactory.doesntContain": z,
|
|
1900
|
+
"filterFactory.startsWith": z,
|
|
1901
|
+
"filterFactory.doesntStartWith": z,
|
|
1902
|
+
"filterFactory.endsWith": z,
|
|
1903
|
+
"filterFactory.doesntEndWith": z,
|
|
1904
|
+
"filterFactory.like": z,
|
|
1894
1905
|
// Exclude filter
|
|
1895
|
-
"filterFactory.exclude":
|
|
1906
|
+
"filterFactory.exclude": On
|
|
1896
1907
|
};
|
|
1897
|
-
function
|
|
1898
|
-
return
|
|
1908
|
+
function xn(e) {
|
|
1909
|
+
return Dn[`${e}`];
|
|
1899
1910
|
}
|
|
1900
|
-
const
|
|
1911
|
+
const Jt = {
|
|
1901
1912
|
// ==================== MEASURE FACTORY FUNCTIONS ====================
|
|
1902
1913
|
// Basic aggregations
|
|
1903
1914
|
"measureFactory.sum": [
|
|
@@ -2424,18 +2435,18 @@ const kt = {
|
|
|
2424
2435
|
{ type: "FilterRelationsNode", required: !0 }
|
|
2425
2436
|
]
|
|
2426
2437
|
};
|
|
2427
|
-
function
|
|
2428
|
-
return
|
|
2438
|
+
function ze(e) {
|
|
2439
|
+
return Jt[`${e}`];
|
|
2429
2440
|
}
|
|
2430
|
-
function
|
|
2431
|
-
const t =
|
|
2441
|
+
function vn(e) {
|
|
2442
|
+
const t = ze(e);
|
|
2432
2443
|
return t ? t.filter((r) => r.required).length : 0;
|
|
2433
2444
|
}
|
|
2434
|
-
function
|
|
2435
|
-
const t =
|
|
2445
|
+
function Nn(e) {
|
|
2446
|
+
const t = ze(e);
|
|
2436
2447
|
return t ? t.length : 0;
|
|
2437
2448
|
}
|
|
2438
|
-
function
|
|
2449
|
+
function Mn(e) {
|
|
2439
2450
|
if (typeof e != "string" || !/^\d{4}-\d{2}-\d{2}/.test(e))
|
|
2440
2451
|
return !1;
|
|
2441
2452
|
const r = Date.parse(e);
|
|
@@ -2444,31 +2455,31 @@ function Fn(e) {
|
|
|
2444
2455
|
const s = new Date(e);
|
|
2445
2456
|
return !isNaN(s.getTime());
|
|
2446
2457
|
}
|
|
2447
|
-
function
|
|
2448
|
-
if (e.startsWith(
|
|
2458
|
+
function Fe(e, t, r, s) {
|
|
2459
|
+
if (e.startsWith(w))
|
|
2449
2460
|
try {
|
|
2450
|
-
return
|
|
2461
|
+
return Z(e, t, r);
|
|
2451
2462
|
} catch (n) {
|
|
2452
2463
|
const i = n instanceof Error ? n.message : "Unknown error";
|
|
2453
2464
|
throw new Error(`${s}: ${i}`);
|
|
2454
2465
|
}
|
|
2455
2466
|
throw new Error(
|
|
2456
|
-
`${s}: Invalid attribute '${e}'. Expected format: '${
|
|
2467
|
+
`${s}: Invalid attribute '${e}'. Expected format: '${w}TableName.ColumnName[.Level]'`
|
|
2457
2468
|
);
|
|
2458
2469
|
}
|
|
2459
|
-
function
|
|
2460
|
-
if (e.startsWith(
|
|
2470
|
+
function Rn(e, t, r, s) {
|
|
2471
|
+
if (e.startsWith(w))
|
|
2461
2472
|
try {
|
|
2462
|
-
return
|
|
2473
|
+
return Js(e, t, r);
|
|
2463
2474
|
} catch (n) {
|
|
2464
2475
|
const i = n instanceof Error ? n.message : "Unknown error";
|
|
2465
2476
|
throw new Error(`${s}: ${i}`);
|
|
2466
2477
|
}
|
|
2467
2478
|
throw new Error(
|
|
2468
|
-
`${s}: Invalid date dimension string '${e}'. Expected format: '${
|
|
2479
|
+
`${s}: Invalid date dimension string '${e}'. Expected format: '${w}TableName.ColumnName'`
|
|
2469
2480
|
);
|
|
2470
2481
|
}
|
|
2471
|
-
function
|
|
2482
|
+
function In(e) {
|
|
2472
2483
|
const t = e.data, { argSchema: r, dataSource: s, schemaIndex: n, pathPrefix: i } = e.context, o = i;
|
|
2473
2484
|
if (t === void 0) {
|
|
2474
2485
|
if (r.required)
|
|
@@ -2514,7 +2525,7 @@ function Cn(e) {
|
|
|
2514
2525
|
throw new Error(
|
|
2515
2526
|
`${o}: Expected attribute string, got ${typeof t}. Example: 'DM.Commerce.Revenue'`
|
|
2516
2527
|
);
|
|
2517
|
-
return
|
|
2528
|
+
return Fe(t, s, n, o);
|
|
2518
2529
|
case "Attribute[]":
|
|
2519
2530
|
if (!Array.isArray(t))
|
|
2520
2531
|
throw new Error(
|
|
@@ -2523,15 +2534,15 @@ function Cn(e) {
|
|
|
2523
2534
|
return t.map((a, u) => {
|
|
2524
2535
|
if (typeof a != "string")
|
|
2525
2536
|
throw new Error(`${o}[${u}]: Expected attribute string, got ${typeof a}`);
|
|
2526
|
-
return
|
|
2537
|
+
return Fe(a, s, n, `${o}[${u}]`);
|
|
2527
2538
|
});
|
|
2528
2539
|
case "Measure":
|
|
2529
2540
|
case "BaseMeasure":
|
|
2530
|
-
if (!
|
|
2541
|
+
if (!q(t))
|
|
2531
2542
|
throw new Error(
|
|
2532
2543
|
`${o}: Expected measure function call, got ${typeof t}. Example: {'function': 'measureFactory.sum', 'args': ['DM.Commerce.Revenue']}`
|
|
2533
2544
|
);
|
|
2534
|
-
return
|
|
2545
|
+
return M({
|
|
2535
2546
|
data: t,
|
|
2536
2547
|
context: { dataSource: s, schemaIndex: n, pathPrefix: o }
|
|
2537
2548
|
});
|
|
@@ -2541,21 +2552,21 @@ function Cn(e) {
|
|
|
2541
2552
|
`${o}: Expected array of measure function calls, got ${typeof t}`
|
|
2542
2553
|
);
|
|
2543
2554
|
return t.map((a, u) => {
|
|
2544
|
-
if (!
|
|
2555
|
+
if (!q(a))
|
|
2545
2556
|
throw new Error(
|
|
2546
2557
|
`${o}[${u}]: Expected measure function call, got ${typeof a}`
|
|
2547
2558
|
);
|
|
2548
|
-
return
|
|
2559
|
+
return M({
|
|
2549
2560
|
data: a,
|
|
2550
2561
|
context: { dataSource: s, schemaIndex: n, pathPrefix: `${o}[${u}]` }
|
|
2551
2562
|
});
|
|
2552
2563
|
});
|
|
2553
2564
|
case "Filter":
|
|
2554
|
-
if (!
|
|
2565
|
+
if (!q(t))
|
|
2555
2566
|
throw new Error(
|
|
2556
2567
|
`${o}: Expected filter function call, got ${typeof t}. Example: {'function': 'filterFactory.contains', 'args': ['DM.Brand.Brand', 'Apple']}`
|
|
2557
2568
|
);
|
|
2558
|
-
return
|
|
2569
|
+
return M({
|
|
2559
2570
|
data: t,
|
|
2560
2571
|
context: { dataSource: s, schemaIndex: n, pathPrefix: o }
|
|
2561
2572
|
});
|
|
@@ -2565,11 +2576,11 @@ function Cn(e) {
|
|
|
2565
2576
|
`${o}: Expected array of filter function calls, got ${typeof t}`
|
|
2566
2577
|
);
|
|
2567
2578
|
return t.map((a, u) => {
|
|
2568
|
-
if (!
|
|
2579
|
+
if (!q(a))
|
|
2569
2580
|
throw new Error(
|
|
2570
2581
|
`${o}[${u}]: Expected filter function call, got ${typeof a}`
|
|
2571
2582
|
);
|
|
2572
|
-
return
|
|
2583
|
+
return M({
|
|
2573
2584
|
data: a,
|
|
2574
2585
|
context: { dataSource: s, schemaIndex: n, pathPrefix: `${o}[${u}]` }
|
|
2575
2586
|
});
|
|
@@ -2577,17 +2588,17 @@ function Cn(e) {
|
|
|
2577
2588
|
case "FilterRelationsNode":
|
|
2578
2589
|
if (Array.isArray(t))
|
|
2579
2590
|
return t.map((a, u) => {
|
|
2580
|
-
if (!
|
|
2591
|
+
if (!q(a))
|
|
2581
2592
|
throw new Error(
|
|
2582
2593
|
`${o}[${u}]: Expected filter function call, got ${typeof a}`
|
|
2583
2594
|
);
|
|
2584
|
-
return
|
|
2595
|
+
return M({
|
|
2585
2596
|
data: a,
|
|
2586
2597
|
context: { dataSource: s, schemaIndex: n, pathPrefix: `${o}[${u}]` }
|
|
2587
2598
|
});
|
|
2588
2599
|
});
|
|
2589
|
-
if (
|
|
2590
|
-
return
|
|
2600
|
+
if (q(t))
|
|
2601
|
+
return M({
|
|
2591
2602
|
data: t,
|
|
2592
2603
|
context: { dataSource: s, schemaIndex: n, pathPrefix: o }
|
|
2593
2604
|
});
|
|
@@ -2599,21 +2610,21 @@ function Cn(e) {
|
|
|
2599
2610
|
throw new Error(
|
|
2600
2611
|
`${o}: Expected date dimension string, got ${typeof t}. Example: 'DM.Commerce.Date'`
|
|
2601
2612
|
);
|
|
2602
|
-
return
|
|
2613
|
+
return Rn(t, s, n, o);
|
|
2603
2614
|
case "LevelAttribute": {
|
|
2604
2615
|
if (typeof t != "string")
|
|
2605
2616
|
throw new Error(
|
|
2606
2617
|
`${o}: Expected date attribute string, got ${typeof t}. Example: 'DM.Commerce.Date.Years'`
|
|
2607
2618
|
);
|
|
2608
|
-
const a =
|
|
2619
|
+
const a = Fe(
|
|
2609
2620
|
t,
|
|
2610
2621
|
s,
|
|
2611
2622
|
n,
|
|
2612
2623
|
o
|
|
2613
2624
|
);
|
|
2614
|
-
if (!
|
|
2625
|
+
if (!Cn(a))
|
|
2615
2626
|
throw new Error(
|
|
2616
|
-
`${o}: Attribute must be date/datetime type, got ${
|
|
2627
|
+
`${o}: Attribute must be date/datetime type, got ${pe(
|
|
2617
2628
|
a
|
|
2618
2629
|
)} attribute`
|
|
2619
2630
|
);
|
|
@@ -2622,8 +2633,8 @@ function Cn(e) {
|
|
|
2622
2633
|
case "Measure | number":
|
|
2623
2634
|
if (typeof t == "number")
|
|
2624
2635
|
return t;
|
|
2625
|
-
if (
|
|
2626
|
-
return
|
|
2636
|
+
if (q(t))
|
|
2637
|
+
return M({
|
|
2627
2638
|
data: t,
|
|
2628
2639
|
context: { dataSource: s, schemaIndex: n, pathPrefix: o }
|
|
2629
2640
|
});
|
|
@@ -2632,7 +2643,7 @@ function Cn(e) {
|
|
|
2632
2643
|
);
|
|
2633
2644
|
case "Date | string":
|
|
2634
2645
|
if (typeof t == "string") {
|
|
2635
|
-
if (
|
|
2646
|
+
if (Mn(t))
|
|
2636
2647
|
return t;
|
|
2637
2648
|
throw new Error(
|
|
2638
2649
|
`${o}: Expected valid ISO date string or Date object, got invalid date string '${t}'`
|
|
@@ -2659,197 +2670,194 @@ function Cn(e) {
|
|
|
2659
2670
|
return t;
|
|
2660
2671
|
}
|
|
2661
2672
|
}
|
|
2662
|
-
function
|
|
2663
|
-
const { data: t } = e, { dataSource: r, schemaIndex: s, pathPrefix: n } = e.context, { function: i, args: o } = t, a = n ? `${n}.` : "", u =
|
|
2673
|
+
function M(e) {
|
|
2674
|
+
const { data: t } = e, { dataSource: r, schemaIndex: s, pathPrefix: n } = e.context, { function: i, args: o } = t, a = n ? `${n}.` : "", u = ze(i);
|
|
2664
2675
|
if (!u) {
|
|
2665
|
-
const
|
|
2676
|
+
const p = Object.keys(Jt), E = x(i, p, (v) => v), C = E && E.distance <= T ? ` Did you mean '${E.best}'?` : "";
|
|
2666
2677
|
throw new Error(
|
|
2667
|
-
`${a}function: Unknown function '${i}'.${
|
|
2678
|
+
`${a}function: Unknown function '${i}'.${C}`
|
|
2668
2679
|
);
|
|
2669
2680
|
}
|
|
2670
|
-
const c =
|
|
2681
|
+
const c = vn(i), g = Nn(i);
|
|
2671
2682
|
if (o.length < c)
|
|
2672
2683
|
throw new Error(
|
|
2673
2684
|
`${a}function: Expected at least ${c} arguments, got ${o.length}`
|
|
2674
2685
|
);
|
|
2675
|
-
if (o.length >
|
|
2686
|
+
if (o.length > g)
|
|
2676
2687
|
throw new Error(
|
|
2677
|
-
`${a}function: Expected at most ${
|
|
2688
|
+
`${a}function: Expected at most ${g} arguments, got ${o.length}`
|
|
2678
2689
|
);
|
|
2679
|
-
const
|
|
2680
|
-
for (let
|
|
2681
|
-
const
|
|
2682
|
-
if (
|
|
2683
|
-
|
|
2690
|
+
const d = [], m = [];
|
|
2691
|
+
for (let p = 0; p < Math.max(o.length, u.length); p++) {
|
|
2692
|
+
const E = u[`${p}`], C = o[`${p}`], v = a ? `${a}args[${p}]` : `args[${p}]`;
|
|
2693
|
+
if (C === void 0) {
|
|
2694
|
+
E != null && E.required && m.push(`${v}: Missing required argument (expected ${E.type})`);
|
|
2684
2695
|
continue;
|
|
2685
2696
|
}
|
|
2686
|
-
if (!
|
|
2687
|
-
|
|
2697
|
+
if (!E) {
|
|
2698
|
+
m.push(`${v}: Unexpected argument`);
|
|
2688
2699
|
continue;
|
|
2689
2700
|
}
|
|
2690
2701
|
try {
|
|
2691
|
-
const
|
|
2692
|
-
data:
|
|
2702
|
+
const W = In({
|
|
2703
|
+
data: C,
|
|
2693
2704
|
context: {
|
|
2694
2705
|
dataSource: r,
|
|
2695
2706
|
schemaIndex: s,
|
|
2696
|
-
pathPrefix:
|
|
2697
|
-
argSchema:
|
|
2707
|
+
pathPrefix: v,
|
|
2708
|
+
argSchema: E
|
|
2698
2709
|
}
|
|
2699
2710
|
});
|
|
2700
|
-
|
|
2701
|
-
} catch (
|
|
2702
|
-
const
|
|
2703
|
-
|
|
2711
|
+
d.push(W);
|
|
2712
|
+
} catch (W) {
|
|
2713
|
+
const rr = W instanceof Error ? W.message : "Unknown error";
|
|
2714
|
+
m.push(rr);
|
|
2704
2715
|
}
|
|
2705
2716
|
}
|
|
2706
|
-
if (
|
|
2707
|
-
const
|
|
2708
|
-
throw new Error(
|
|
2717
|
+
if (m.length > 0) {
|
|
2718
|
+
const p = m.join("; ");
|
|
2719
|
+
throw new Error(p);
|
|
2709
2720
|
}
|
|
2710
|
-
|
|
2721
|
+
let h = d;
|
|
2722
|
+
const b = xn(i);
|
|
2711
2723
|
if (b)
|
|
2712
2724
|
try {
|
|
2713
|
-
b(
|
|
2725
|
+
h = b(d, {
|
|
2714
2726
|
dataSource: r,
|
|
2715
2727
|
schemaIndex: s,
|
|
2716
2728
|
pathPrefix: a
|
|
2717
2729
|
});
|
|
2718
|
-
} catch (
|
|
2719
|
-
const
|
|
2720
|
-
throw new Error(
|
|
2730
|
+
} catch (p) {
|
|
2731
|
+
const E = p instanceof Error ? p.message : "Unknown validation error";
|
|
2732
|
+
throw new Error(E);
|
|
2721
2733
|
}
|
|
2722
|
-
return
|
|
2734
|
+
return Zs(i, h);
|
|
2723
2735
|
}
|
|
2724
|
-
function
|
|
2736
|
+
function Kt(e) {
|
|
2725
2737
|
const { attribute: t, config: r } = e;
|
|
2726
|
-
if (
|
|
2727
|
-
const { granularity: s } = t, n = e.members.map((a) => s === "Years" && !isNaN(Number(a)) ? `${a}-01-01T00:00:00` : a), i =
|
|
2728
|
-
return
|
|
2738
|
+
if (De(e) && jr(t)) {
|
|
2739
|
+
const { granularity: s } = t, n = e.members.map((a) => s === "Years" && !isNaN(Number(a)) ? `${a}-01-01T00:00:00` : a), i = Jr(r), o = Object.keys(i).length === 0 ? void 0 : i;
|
|
2740
|
+
return Kr(t, n, o);
|
|
2729
2741
|
}
|
|
2730
2742
|
return e;
|
|
2731
2743
|
}
|
|
2732
|
-
function
|
|
2744
|
+
function kn(e) {
|
|
2733
2745
|
let t = [];
|
|
2734
2746
|
for (const r of e)
|
|
2735
|
-
|
|
2747
|
+
te(r) ? t = je(r, t) : t = je([Kt(r)], t);
|
|
2736
2748
|
return t != null ? t : [];
|
|
2737
2749
|
}
|
|
2738
|
-
const
|
|
2750
|
+
const Bn = (e) => {
|
|
2739
2751
|
const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context, n = [], i = [];
|
|
2740
2752
|
return t.forEach((o, a) => {
|
|
2741
2753
|
const u = {
|
|
2742
|
-
|
|
2743
|
-
index: a,
|
|
2754
|
+
path: `filters[${a}]`,
|
|
2744
2755
|
input: o
|
|
2745
2756
|
};
|
|
2746
2757
|
try {
|
|
2747
|
-
const c =
|
|
2758
|
+
const c = M({
|
|
2748
2759
|
data: o,
|
|
2749
2760
|
context: { dataSource: r, schemaIndex: s, pathPrefix: "" }
|
|
2750
2761
|
});
|
|
2751
|
-
!
|
|
2762
|
+
!te(c) && !fe(c) ? i.push(F(l({}, u), { message: "Invalid filter JSON" })) : n.push(c);
|
|
2752
2763
|
} catch (c) {
|
|
2753
|
-
const
|
|
2754
|
-
i.push(
|
|
2764
|
+
const g = c instanceof Error ? c.message : "Unknown error";
|
|
2765
|
+
i.push(F(l({}, u), { message: g }));
|
|
2755
2766
|
}
|
|
2756
|
-
}), i.length > 0 ? { success: !1, errors: i } : { success: !0, data:
|
|
2757
|
-
},
|
|
2767
|
+
}), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: kn(n) };
|
|
2768
|
+
}, se = (e) => {
|
|
2758
2769
|
const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context;
|
|
2759
|
-
return t ?
|
|
2770
|
+
return t ? Rt(t) ? Bn({
|
|
2760
2771
|
data: t,
|
|
2761
2772
|
context: { dataSource: r, schemaIndex: s }
|
|
2762
2773
|
}) : {
|
|
2763
2774
|
success: !1,
|
|
2764
2775
|
errors: [
|
|
2765
2776
|
{
|
|
2766
|
-
|
|
2767
|
-
index: -1,
|
|
2777
|
+
path: "filters",
|
|
2768
2778
|
input: t,
|
|
2769
2779
|
message: "Invalid filters JSON. Expected an array of function calls with 'function' and 'args' properties."
|
|
2770
2780
|
}
|
|
2771
2781
|
]
|
|
2772
2782
|
} : { success: !0, data: [] };
|
|
2773
|
-
},
|
|
2783
|
+
}, Ln = (e) => {
|
|
2774
2784
|
const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context, n = [], i = [];
|
|
2775
2785
|
return t.forEach((o, a) => {
|
|
2776
2786
|
const u = {
|
|
2777
|
-
|
|
2778
|
-
index: a,
|
|
2787
|
+
path: `highlights[${a}]`,
|
|
2779
2788
|
input: o
|
|
2780
2789
|
};
|
|
2781
2790
|
try {
|
|
2782
|
-
const c =
|
|
2791
|
+
const c = M({
|
|
2783
2792
|
data: o,
|
|
2784
2793
|
context: { dataSource: r, schemaIndex: s, pathPrefix: "" }
|
|
2785
2794
|
});
|
|
2786
|
-
|
|
2795
|
+
fe(c) ? n.push(Kt(c)) : i.push(F(l({}, u), { message: "Invalid filter JSON" }));
|
|
2787
2796
|
} catch (c) {
|
|
2788
|
-
const
|
|
2789
|
-
i.push(
|
|
2797
|
+
const g = c instanceof Error ? c.message : "Unknown error";
|
|
2798
|
+
i.push(F(l({}, u), { message: g }));
|
|
2790
2799
|
}
|
|
2791
2800
|
}), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: n };
|
|
2792
|
-
},
|
|
2801
|
+
}, me = (e) => {
|
|
2793
2802
|
const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context;
|
|
2794
|
-
return t ?
|
|
2803
|
+
return t ? Rt(t) ? Ln({
|
|
2795
2804
|
data: t,
|
|
2796
2805
|
context: { dataSource: r, schemaIndex: s }
|
|
2797
2806
|
}) : {
|
|
2798
2807
|
success: !1,
|
|
2799
2808
|
errors: [
|
|
2800
2809
|
{
|
|
2801
|
-
|
|
2802
|
-
index: -1,
|
|
2810
|
+
path: "highlights",
|
|
2803
2811
|
input: t,
|
|
2804
2812
|
message: "Invalid highlights JSON. Expected an array of function calls with 'function' and 'args' properties."
|
|
2805
2813
|
}
|
|
2806
2814
|
]
|
|
2807
2815
|
} : { success: !0, data: [] };
|
|
2808
|
-
},
|
|
2809
|
-
if (e && !
|
|
2810
|
-
return
|
|
2816
|
+
}, zn = (e, t) => {
|
|
2817
|
+
if (e && !ct(e))
|
|
2818
|
+
return F(l({}, t), {
|
|
2811
2819
|
message: `Invalid sort type. Expected 'sortAsc', 'sortDesc', or 'sortNone'. Got: '${e}'.`
|
|
2812
2820
|
});
|
|
2813
|
-
},
|
|
2821
|
+
}, Un = (e, t, r) => {
|
|
2814
2822
|
const { dataSource: s, schemaIndex: n } = t;
|
|
2815
2823
|
try {
|
|
2816
|
-
const i =
|
|
2824
|
+
const i = M({
|
|
2817
2825
|
data: e,
|
|
2818
2826
|
context: { dataSource: s, schemaIndex: n, pathPrefix: "" }
|
|
2819
2827
|
});
|
|
2820
|
-
return
|
|
2828
|
+
return Ie(i) ? { success: !0, data: i } : {
|
|
2821
2829
|
success: !1,
|
|
2822
|
-
errors: [
|
|
2830
|
+
errors: [F(l({}, r), { message: "Invalid measure JSON" })]
|
|
2823
2831
|
};
|
|
2824
2832
|
} catch (i) {
|
|
2825
2833
|
const o = i instanceof Error ? i.message : "Unknown error";
|
|
2826
2834
|
return {
|
|
2827
2835
|
success: !1,
|
|
2828
|
-
errors: [
|
|
2836
|
+
errors: [F(l({}, r), { message: o })]
|
|
2829
2837
|
};
|
|
2830
2838
|
}
|
|
2831
|
-
},
|
|
2832
|
-
const n =
|
|
2839
|
+
}, _n = (e, t, r, s) => {
|
|
2840
|
+
const n = M({
|
|
2833
2841
|
data: e.column,
|
|
2834
2842
|
context: { dataSource: t, schemaIndex: r, pathPrefix: "" }
|
|
2835
2843
|
});
|
|
2836
|
-
if (!
|
|
2844
|
+
if (!Ie(n))
|
|
2837
2845
|
return {
|
|
2838
2846
|
style: {},
|
|
2839
|
-
error:
|
|
2847
|
+
error: F(l({}, s), { message: "Invalid measure JSON" })
|
|
2840
2848
|
};
|
|
2841
|
-
const i =
|
|
2849
|
+
const i = zn(e.sortType, s);
|
|
2842
2850
|
if (i) {
|
|
2843
2851
|
const a = _(e, "column");
|
|
2844
2852
|
return { measure: n, style: a, error: i };
|
|
2845
2853
|
}
|
|
2846
2854
|
const o = _(e, "column");
|
|
2847
2855
|
return { measure: n, style: o };
|
|
2848
|
-
},
|
|
2849
|
-
if (
|
|
2850
|
-
return
|
|
2851
|
-
if (
|
|
2852
|
-
const n =
|
|
2856
|
+
}, Pn = (e, t, r, s) => {
|
|
2857
|
+
if (Vs(e))
|
|
2858
|
+
return _n(e, t, r, s);
|
|
2859
|
+
if (q(e)) {
|
|
2860
|
+
const n = Un(
|
|
2853
2861
|
e,
|
|
2854
2862
|
{ dataSource: t, schemaIndex: r },
|
|
2855
2863
|
s
|
|
@@ -2857,11 +2865,11 @@ const Tn = (e) => {
|
|
|
2857
2865
|
return n.success ? { measure: n.data } : { error: n.errors[0] };
|
|
2858
2866
|
}
|
|
2859
2867
|
return {
|
|
2860
|
-
error:
|
|
2868
|
+
error: F(l({}, s), {
|
|
2861
2869
|
message: "Invalid measure item. Expected a function call (function/args) or object with 'column' and optional 'sortType'."
|
|
2862
2870
|
})
|
|
2863
2871
|
};
|
|
2864
|
-
},
|
|
2872
|
+
}, Gt = (e) => {
|
|
2865
2873
|
const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context;
|
|
2866
2874
|
if (!t)
|
|
2867
2875
|
return { success: !0, data: [] };
|
|
@@ -2870,8 +2878,7 @@ const Tn = (e) => {
|
|
|
2870
2878
|
success: !1,
|
|
2871
2879
|
errors: [
|
|
2872
2880
|
{
|
|
2873
|
-
|
|
2874
|
-
index: -1,
|
|
2881
|
+
path: "measures",
|
|
2875
2882
|
input: t,
|
|
2876
2883
|
message: "Invalid measures JSON. Expected an array."
|
|
2877
2884
|
}
|
|
@@ -2880,12 +2887,11 @@ const Tn = (e) => {
|
|
|
2880
2887
|
const n = [], i = [];
|
|
2881
2888
|
return t.forEach((o, a) => {
|
|
2882
2889
|
const u = {
|
|
2883
|
-
|
|
2884
|
-
index: a,
|
|
2890
|
+
path: `measures[${a}]`,
|
|
2885
2891
|
input: o
|
|
2886
2892
|
};
|
|
2887
2893
|
try {
|
|
2888
|
-
const c =
|
|
2894
|
+
const c = Pn(o, r, s, u);
|
|
2889
2895
|
if (c.error) {
|
|
2890
2896
|
i.push(c.error);
|
|
2891
2897
|
return;
|
|
@@ -2894,17 +2900,31 @@ const Tn = (e) => {
|
|
|
2894
2900
|
c.style !== void 0 ? { measure: c.measure, style: c.style } : { measure: c.measure }
|
|
2895
2901
|
);
|
|
2896
2902
|
} catch (c) {
|
|
2897
|
-
const
|
|
2898
|
-
i.push(
|
|
2903
|
+
const g = c instanceof Error ? c.message : "Unknown error";
|
|
2904
|
+
i.push(F(l({}, u), { message: g }));
|
|
2899
2905
|
}
|
|
2900
2906
|
}), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: n };
|
|
2901
2907
|
};
|
|
2902
|
-
function
|
|
2903
|
-
return typeof e == "string" ? e
|
|
2904
|
-
|
|
2908
|
+
function ae(e) {
|
|
2909
|
+
return typeof e == "string" ? e : e.title;
|
|
2910
|
+
}
|
|
2911
|
+
function Wn(e) {
|
|
2912
|
+
const t = {};
|
|
2913
|
+
for (const [r, s] of Object.entries(e)) {
|
|
2914
|
+
const n = {};
|
|
2915
|
+
s.filtersOptions !== void 0 && (n.filtersOptions = s.filtersOptions), s.partialDtoOptions !== void 0 && (n.partialDtoOptions = s.partialDtoOptions), Object.keys(n).length > 0 && (t[r] = n);
|
|
2916
|
+
}
|
|
2917
|
+
return Object.keys(t).length > 0 ? t : void 0;
|
|
2918
|
+
}
|
|
2919
|
+
function Yt(e) {
|
|
2920
|
+
return typeof e == "object" && e !== null && "toJSON" in e && typeof e.toJSON == "function" ? e.toJSON() : e;
|
|
2921
|
+
}
|
|
2922
|
+
function B(e) {
|
|
2923
|
+
return typeof e == "string" ? e.replace(/\[\[([^\]]+)\]\]/g, "$1") : Array.isArray(e) ? e.map(B) : e !== null && typeof e == "object" ? Object.fromEntries(
|
|
2924
|
+
Object.entries(e).map(([t, r]) => [t, B(r)])
|
|
2905
2925
|
) : e;
|
|
2906
2926
|
}
|
|
2907
|
-
function
|
|
2927
|
+
function A(e, t, r) {
|
|
2908
2928
|
const s = e();
|
|
2909
2929
|
if (!s.success) {
|
|
2910
2930
|
const n = r ? s.errors.map(r) : s.errors;
|
|
@@ -2912,29 +2932,29 @@ function F(e, t, r) {
|
|
|
2912
2932
|
}
|
|
2913
2933
|
return s.data;
|
|
2914
2934
|
}
|
|
2915
|
-
const
|
|
2916
|
-
const { data: t } = e, { dataSource: r, tables: s } = e.context, n =
|
|
2917
|
-
() =>
|
|
2935
|
+
const xi = (e) => {
|
|
2936
|
+
const { data: t } = e, { dataSource: r, tables: s } = e.context, n = re(s), i = [], o = A(
|
|
2937
|
+
() => kt({
|
|
2918
2938
|
data: t.dimensions || [],
|
|
2919
2939
|
context: { dataSource: r, schemaIndex: n }
|
|
2920
2940
|
}),
|
|
2921
2941
|
i
|
|
2922
|
-
), a =
|
|
2923
|
-
() =>
|
|
2942
|
+
), a = A(
|
|
2943
|
+
() => Gt({
|
|
2924
2944
|
data: t.measures || [],
|
|
2925
2945
|
context: { dataSource: r, schemaIndex: n }
|
|
2926
2946
|
}),
|
|
2927
2947
|
i
|
|
2928
|
-
), u =
|
|
2929
|
-
() =>
|
|
2948
|
+
), u = A(
|
|
2949
|
+
() => se({
|
|
2930
2950
|
data: t.filters || [],
|
|
2931
2951
|
context: { dataSource: r, schemaIndex: n }
|
|
2932
2952
|
}),
|
|
2933
2953
|
i
|
|
2934
2954
|
);
|
|
2935
2955
|
let c = null;
|
|
2936
|
-
return t.highlights && (c =
|
|
2937
|
-
() =>
|
|
2956
|
+
return t.highlights && (c = A(
|
|
2957
|
+
() => me({
|
|
2938
2958
|
data: t.highlights || [],
|
|
2939
2959
|
context: { dataSource: r, schemaIndex: n }
|
|
2940
2960
|
}),
|
|
@@ -2944,78 +2964,74 @@ const ti = (e) => {
|
|
|
2944
2964
|
errors: i
|
|
2945
2965
|
} : {
|
|
2946
2966
|
success: !0,
|
|
2947
|
-
data:
|
|
2948
|
-
dataSource:
|
|
2949
|
-
dimensions: o ?
|
|
2950
|
-
measures: a ?
|
|
2967
|
+
data: l({
|
|
2968
|
+
dataSource: le(r),
|
|
2969
|
+
dimensions: o ? Gr(o) : [],
|
|
2970
|
+
measures: a ? Yr(a) : [],
|
|
2951
2971
|
filters: u || []
|
|
2952
2972
|
}, c && { highlights: c })
|
|
2953
2973
|
};
|
|
2954
2974
|
};
|
|
2955
|
-
function
|
|
2975
|
+
function Ze(e) {
|
|
2956
2976
|
return typeof e == "object" && e !== null && "column" in e && e.column !== void 0;
|
|
2957
2977
|
}
|
|
2958
|
-
function
|
|
2978
|
+
function Ue(e) {
|
|
2959
2979
|
const t = [], r = [];
|
|
2960
2980
|
return e.forEach((s, n) => {
|
|
2961
|
-
var
|
|
2962
|
-
const i =
|
|
2981
|
+
var d, m, h;
|
|
2982
|
+
const i = Ze(s) ? s.column : s, o = Ze(s) ? s : void 0, a = () => Yt(i);
|
|
2963
2983
|
if (!i.composeCode) {
|
|
2964
2984
|
r.push({
|
|
2965
|
-
|
|
2966
|
-
index: n,
|
|
2985
|
+
path: `dimensions[${n}]`,
|
|
2967
2986
|
input: a(),
|
|
2968
2987
|
message: `Dimension at index ${n} (${i.name || "unnamed"}) is missing composeCode`
|
|
2969
2988
|
});
|
|
2970
2989
|
return;
|
|
2971
2990
|
}
|
|
2972
|
-
if (!i.composeCode.startsWith(
|
|
2991
|
+
if (!i.composeCode.startsWith(w)) {
|
|
2973
2992
|
r.push({
|
|
2974
|
-
|
|
2975
|
-
index: n,
|
|
2993
|
+
path: `dimensions[${n}]`,
|
|
2976
2994
|
input: a(),
|
|
2977
|
-
message: `Expected composeCode to start with '${
|
|
2995
|
+
message: `Expected composeCode to start with '${w}' for dimension at index ${n} (${i.name || "unnamed"}). Got: '${i.composeCode}'`
|
|
2978
2996
|
});
|
|
2979
2997
|
return;
|
|
2980
2998
|
}
|
|
2981
|
-
const u = (
|
|
2982
|
-
if (u !== void 0 && u !==
|
|
2983
|
-
const
|
|
2999
|
+
const u = (h = o != null && o.sortType ? lt(o.sortType) : void 0) != null ? h : ((d = i.getSort) == null ? void 0 : d.call(i)) !== void 0 && ((m = i.getSort) == null ? void 0 : m.call(i)) !== U.None ? i.getSort() : void 0, c = o ? _(o, "column") : {};
|
|
3000
|
+
if (u !== void 0 && u !== U.None || o && Object.keys(c).length > 0) {
|
|
3001
|
+
const b = l(l({
|
|
2984
3002
|
column: i.composeCode
|
|
2985
|
-
}, u !== void 0 && u !==
|
|
2986
|
-
t.push(
|
|
3003
|
+
}, u !== void 0 && u !== U.None && { sortType: dt(u) }), c);
|
|
3004
|
+
t.push(b);
|
|
2987
3005
|
} else
|
|
2988
3006
|
t.push(i.composeCode);
|
|
2989
3007
|
}), r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
|
|
2990
3008
|
}
|
|
2991
|
-
const
|
|
2992
|
-
function
|
|
3009
|
+
const qe = "Unknown error";
|
|
3010
|
+
function ne(e) {
|
|
2993
3011
|
if (!e)
|
|
2994
3012
|
return { success: !0, data: [] };
|
|
2995
3013
|
const t = [];
|
|
2996
|
-
if (
|
|
3014
|
+
if (Hr(e)) {
|
|
2997
3015
|
if (!e.composeCode)
|
|
2998
3016
|
return {
|
|
2999
3017
|
success: !1,
|
|
3000
3018
|
errors: [
|
|
3001
3019
|
{
|
|
3002
|
-
|
|
3003
|
-
index: -1,
|
|
3020
|
+
path: "filters",
|
|
3004
3021
|
input: e,
|
|
3005
3022
|
message: `FilterRelations is missing composeCode. Operator: ${e.operator || "unknown"}`
|
|
3006
3023
|
}
|
|
3007
3024
|
]
|
|
3008
3025
|
};
|
|
3009
3026
|
try {
|
|
3010
|
-
return { success: !0, data: [
|
|
3027
|
+
return { success: !0, data: [J(e.composeCode)] };
|
|
3011
3028
|
} catch (s) {
|
|
3012
|
-
const n = s instanceof Error ? s.message :
|
|
3029
|
+
const n = s instanceof Error ? s.message : qe;
|
|
3013
3030
|
return {
|
|
3014
3031
|
success: !1,
|
|
3015
3032
|
errors: [
|
|
3016
3033
|
{
|
|
3017
|
-
|
|
3018
|
-
index: -1,
|
|
3034
|
+
path: "filters",
|
|
3019
3035
|
input: e,
|
|
3020
3036
|
message: `Failed to parse composeCode for FilterRelations: ${n}. ComposeCode: '${e.composeCode}'`
|
|
3021
3037
|
}
|
|
@@ -3028,28 +3044,26 @@ function ve(e) {
|
|
|
3028
3044
|
var i;
|
|
3029
3045
|
if (!s.composeCode) {
|
|
3030
3046
|
t.push({
|
|
3031
|
-
|
|
3032
|
-
index: n,
|
|
3047
|
+
path: `filters[${n}]`,
|
|
3033
3048
|
input: s,
|
|
3034
3049
|
message: `Filter at index ${n} (${(i = s.name) != null ? i : "unnamed"}) is missing composeCode`
|
|
3035
3050
|
});
|
|
3036
3051
|
return;
|
|
3037
3052
|
}
|
|
3038
3053
|
try {
|
|
3039
|
-
const o =
|
|
3054
|
+
const o = J(s.composeCode);
|
|
3040
3055
|
r.push(o);
|
|
3041
3056
|
} catch (o) {
|
|
3042
|
-
const a = o instanceof Error ? o.message :
|
|
3057
|
+
const a = o instanceof Error ? o.message : qe;
|
|
3043
3058
|
t.push({
|
|
3044
|
-
|
|
3045
|
-
index: n,
|
|
3059
|
+
path: `filters[${n}]`,
|
|
3046
3060
|
input: s,
|
|
3047
3061
|
message: `Failed to parse composeCode for filter at index ${n}: ${a}. ComposeCode: '${s.composeCode}'`
|
|
3048
3062
|
});
|
|
3049
3063
|
}
|
|
3050
3064
|
}), t.length > 0 ? { success: !1, errors: t } : { success: !0, data: r };
|
|
3051
3065
|
}
|
|
3052
|
-
function
|
|
3066
|
+
function ge(e) {
|
|
3053
3067
|
if (!e)
|
|
3054
3068
|
return { success: !0, data: [] };
|
|
3055
3069
|
const t = [], r = [];
|
|
@@ -3057,128 +3071,124 @@ function Ie(e) {
|
|
|
3057
3071
|
var i;
|
|
3058
3072
|
if (!s.composeCode) {
|
|
3059
3073
|
r.push({
|
|
3060
|
-
|
|
3061
|
-
index: n,
|
|
3074
|
+
path: `highlights[${n}]`,
|
|
3062
3075
|
input: s,
|
|
3063
3076
|
message: `Highlight filter at index ${n} (${(i = s.name) != null ? i : "unnamed"}) is missing composeCode`
|
|
3064
3077
|
});
|
|
3065
3078
|
return;
|
|
3066
3079
|
}
|
|
3067
3080
|
try {
|
|
3068
|
-
const o =
|
|
3081
|
+
const o = J(s.composeCode);
|
|
3069
3082
|
t.push(o);
|
|
3070
3083
|
} catch (o) {
|
|
3071
|
-
const a = o instanceof Error ? o.message :
|
|
3084
|
+
const a = o instanceof Error ? o.message : qe;
|
|
3072
3085
|
r.push({
|
|
3073
|
-
|
|
3074
|
-
index: n,
|
|
3086
|
+
path: `highlights[${n}]`,
|
|
3075
3087
|
input: s,
|
|
3076
3088
|
message: `Failed to parse composeCode for highlight filter at index ${n}: ${a}. ComposeCode: '${s.composeCode}'`
|
|
3077
3089
|
});
|
|
3078
3090
|
}
|
|
3079
3091
|
}), r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
|
|
3080
3092
|
}
|
|
3081
|
-
function
|
|
3093
|
+
function et(e) {
|
|
3082
3094
|
return typeof e == "object" && e !== null && "column" in e && e.column !== void 0;
|
|
3083
3095
|
}
|
|
3084
|
-
function
|
|
3096
|
+
function _e(e) {
|
|
3085
3097
|
const t = [], r = [];
|
|
3086
3098
|
return e.forEach((s, n) => {
|
|
3087
|
-
var u, c,
|
|
3088
|
-
const i =
|
|
3099
|
+
var u, c, g;
|
|
3100
|
+
const i = et(s) ? s.column : s, o = et(s) ? s : void 0, a = () => Yt(i);
|
|
3089
3101
|
if (!i.composeCode) {
|
|
3090
3102
|
r.push({
|
|
3091
|
-
|
|
3092
|
-
index: n,
|
|
3103
|
+
path: `measures[${n}]`,
|
|
3093
3104
|
input: a(),
|
|
3094
3105
|
message: `Measure at index ${n} (${i.name || "unnamed"}) is missing composeCode`
|
|
3095
3106
|
});
|
|
3096
3107
|
return;
|
|
3097
3108
|
}
|
|
3098
3109
|
try {
|
|
3099
|
-
const
|
|
3100
|
-
if (
|
|
3101
|
-
const
|
|
3102
|
-
column:
|
|
3103
|
-
},
|
|
3104
|
-
t.push(
|
|
3110
|
+
const d = J(i.composeCode), m = (g = o != null && o.sortType ? lt(o.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)) !== U.None ? i.getSort() : void 0;
|
|
3111
|
+
if (m !== void 0 && m !== U.None || o && Object.keys(_(o, "column")).length > 0) {
|
|
3112
|
+
const b = o ? _(o, "column") : {}, p = l(l({
|
|
3113
|
+
column: d
|
|
3114
|
+
}, m !== void 0 && m !== U.None && { sortType: dt(m) }), b);
|
|
3115
|
+
t.push(p);
|
|
3105
3116
|
} else
|
|
3106
|
-
t.push(
|
|
3107
|
-
} catch (
|
|
3108
|
-
const
|
|
3117
|
+
t.push(d);
|
|
3118
|
+
} catch (d) {
|
|
3119
|
+
const m = d instanceof Error ? d.message : "Unknown error";
|
|
3109
3120
|
r.push({
|
|
3110
|
-
|
|
3111
|
-
index: n,
|
|
3121
|
+
path: `measures[${n}]`,
|
|
3112
3122
|
input: a(),
|
|
3113
|
-
message: `Failed to parse composeCode for measure at index ${n} (${i.name || "unnamed"}): ${
|
|
3123
|
+
message: `Failed to parse composeCode for measure at index ${n} (${i.name || "unnamed"}): ${m}. ComposeCode: '${i.composeCode}'`
|
|
3114
3124
|
});
|
|
3115
3125
|
}
|
|
3116
3126
|
}), r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
|
|
3117
3127
|
}
|
|
3118
|
-
function
|
|
3128
|
+
function tt(e) {
|
|
3119
3129
|
var t, r, s, n;
|
|
3120
|
-
return ((r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.trend")) != null ? r : !1) || ((n = (s = e.name) == null ? void 0 : s.startsWith(
|
|
3130
|
+
return ((r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.trend")) != null ? r : !1) || ((n = (s = e.name) == null ? void 0 : s.startsWith(ft)) != null ? n : !1);
|
|
3121
3131
|
}
|
|
3122
|
-
function
|
|
3132
|
+
function rt(e) {
|
|
3123
3133
|
var t, r, s, n;
|
|
3124
|
-
return ((r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.forecast")) != null ? r : !1) || ((n = (s = e.name) == null ? void 0 : s.startsWith(
|
|
3134
|
+
return ((r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.forecast")) != null ? r : !1) || ((n = (s = e.name) == null ? void 0 : s.startsWith(pt)) != null ? n : !1);
|
|
3125
3135
|
}
|
|
3126
|
-
function
|
|
3136
|
+
function st(e) {
|
|
3127
3137
|
try {
|
|
3128
|
-
const t =
|
|
3138
|
+
const t = J(e.trim());
|
|
3129
3139
|
return t.args[2] != null && typeof t.args[2] == "object" ? t.args[2] : void 0;
|
|
3130
3140
|
} catch (t) {
|
|
3131
3141
|
return;
|
|
3132
3142
|
}
|
|
3133
3143
|
}
|
|
3134
|
-
function
|
|
3144
|
+
function Vn(e) {
|
|
3135
3145
|
var s, n, i;
|
|
3136
3146
|
if (!(e != null && e.length)) return [];
|
|
3137
3147
|
const t = /* @__PURE__ */ new Set(), r = [];
|
|
3138
3148
|
for (let o = 0; o < e.length; o++) {
|
|
3139
3149
|
if (t.has(o)) continue;
|
|
3140
3150
|
const a = e[o];
|
|
3141
|
-
if (
|
|
3151
|
+
if (tt(a) || rt(a)) {
|
|
3142
3152
|
r.push(a);
|
|
3143
3153
|
continue;
|
|
3144
3154
|
}
|
|
3145
|
-
const u = (s = a.name) != null ? s : "Measure", c = `${
|
|
3146
|
-
let
|
|
3147
|
-
if (
|
|
3148
|
-
const
|
|
3149
|
-
|
|
3155
|
+
const u = (s = a.name) != null ? s : "Measure", c = `${ft}_${u}`, g = `${pt}_${u}`;
|
|
3156
|
+
let d, m, h = o + 1;
|
|
3157
|
+
if (h < e.length && !t.has(h) && tt(e[h]) && e[h].name === c) {
|
|
3158
|
+
const b = (n = e[h].composeCode) == null ? void 0 : n.trim();
|
|
3159
|
+
b && (d = st(b), t.add(h), h++);
|
|
3150
3160
|
}
|
|
3151
|
-
if (
|
|
3152
|
-
const
|
|
3153
|
-
|
|
3161
|
+
if (h < e.length && !t.has(h) && rt(e[h]) && e[h].name === g) {
|
|
3162
|
+
const b = (i = e[h].composeCode) == null ? void 0 : i.trim();
|
|
3163
|
+
b && (m = st(b), t.add(h));
|
|
3154
3164
|
}
|
|
3155
|
-
|
|
3165
|
+
d !== void 0 || m !== void 0 ? r.push(l(l({
|
|
3156
3166
|
column: a
|
|
3157
|
-
},
|
|
3167
|
+
}, d && Object.keys(d).length > 0 && { trend: d }), m && Object.keys(m).length > 0 && { forecast: m })) : r.push(a);
|
|
3158
3168
|
}
|
|
3159
3169
|
return r;
|
|
3160
3170
|
}
|
|
3161
|
-
function
|
|
3162
|
-
const t = [], r =
|
|
3163
|
-
() =>
|
|
3171
|
+
function vi(e) {
|
|
3172
|
+
const t = [], r = A(
|
|
3173
|
+
() => Ue(e.dimensions || []),
|
|
3164
3174
|
t
|
|
3165
|
-
), s =
|
|
3166
|
-
() =>
|
|
3175
|
+
), s = Vn(e.measures || []), n = A(
|
|
3176
|
+
() => _e(s),
|
|
3167
3177
|
t
|
|
3168
|
-
), i =
|
|
3169
|
-
() =>
|
|
3178
|
+
), i = A(
|
|
3179
|
+
() => ne(e.filters),
|
|
3170
3180
|
t
|
|
3171
3181
|
);
|
|
3172
3182
|
let o = null;
|
|
3173
|
-
if (e.highlights && e.highlights.length > 0 && (o =
|
|
3174
|
-
() =>
|
|
3183
|
+
if (e.highlights && e.highlights.length > 0 && (o = A(
|
|
3184
|
+
() => ge(e.highlights),
|
|
3175
3185
|
t
|
|
3176
3186
|
)), t.length > 0)
|
|
3177
3187
|
return {
|
|
3178
3188
|
success: !1,
|
|
3179
3189
|
errors: t
|
|
3180
3190
|
};
|
|
3181
|
-
const a =
|
|
3191
|
+
const a = l({
|
|
3182
3192
|
dimensions: r || [],
|
|
3183
3193
|
measures: n || [],
|
|
3184
3194
|
filters: i || []
|
|
@@ -3186,12 +3196,12 @@ function ri(e) {
|
|
|
3186
3196
|
return {
|
|
3187
3197
|
success: !0,
|
|
3188
3198
|
// Strip [[delimiters]] from all strings to preserve original names with spaces
|
|
3189
|
-
data:
|
|
3199
|
+
data: B(a)
|
|
3190
3200
|
};
|
|
3191
3201
|
}
|
|
3192
|
-
const
|
|
3193
|
-
|
|
3194
|
-
),
|
|
3202
|
+
const Ht = new Set(
|
|
3203
|
+
Qr.filter((e) => e !== "image")
|
|
3204
|
+
), nt = Object.freeze([...Ht]), Ae = /* @__PURE__ */ new Set([
|
|
3195
3205
|
"category",
|
|
3196
3206
|
"value",
|
|
3197
3207
|
"breakBy",
|
|
@@ -3214,7 +3224,7 @@ const Lt = new Set(
|
|
|
3214
3224
|
"min",
|
|
3215
3225
|
"max",
|
|
3216
3226
|
"seriesToColorMap"
|
|
3217
|
-
]),
|
|
3227
|
+
]), jn = {
|
|
3218
3228
|
line: {
|
|
3219
3229
|
validAxes: /* @__PURE__ */ new Set(["category", "value", "breakBy", "seriesToColorMap"]),
|
|
3220
3230
|
requiredAxes: ["category", "value"]
|
|
@@ -3287,7 +3297,7 @@ const Lt = new Set(
|
|
|
3287
3297
|
validAxes: /* @__PURE__ */ new Set(["category", "value", "breakBy", "seriesToColorMap"]),
|
|
3288
3298
|
requiredAxes: ["category", "value"]
|
|
3289
3299
|
}
|
|
3290
|
-
},
|
|
3300
|
+
}, Jn = /* @__PURE__ */ new Set([
|
|
3291
3301
|
"category",
|
|
3292
3302
|
"breakBy",
|
|
3293
3303
|
"breakByPoint",
|
|
@@ -3295,7 +3305,7 @@ const Lt = new Set(
|
|
|
3295
3305
|
"geo",
|
|
3296
3306
|
"details",
|
|
3297
3307
|
"date"
|
|
3298
|
-
]),
|
|
3308
|
+
]), Kn = /* @__PURE__ */ new Set([
|
|
3299
3309
|
"value",
|
|
3300
3310
|
"size",
|
|
3301
3311
|
"colorBy",
|
|
@@ -3307,152 +3317,169 @@ const Lt = new Set(
|
|
|
3307
3317
|
"max",
|
|
3308
3318
|
"color"
|
|
3309
3319
|
]);
|
|
3310
|
-
function
|
|
3311
|
-
const t =
|
|
3320
|
+
function Gn(e) {
|
|
3321
|
+
const t = jn[e];
|
|
3312
3322
|
if (t)
|
|
3313
3323
|
return {
|
|
3314
3324
|
validAxes: new Set(t.validAxes),
|
|
3315
3325
|
requiredAxes: Object.freeze([...t.requiredAxes])
|
|
3316
3326
|
};
|
|
3317
3327
|
}
|
|
3318
|
-
function
|
|
3319
|
-
return typeof e == "string" &&
|
|
3328
|
+
function Qt(e) {
|
|
3329
|
+
return typeof e == "string" && Ht.has(e);
|
|
3320
3330
|
}
|
|
3321
|
-
function
|
|
3322
|
-
if (r === "boxplot" && e === "value" || r === "calendar-heatmap" && e === "date" ||
|
|
3331
|
+
function Yn(e, t, r) {
|
|
3332
|
+
if (r === "boxplot" && e === "value" || r === "calendar-heatmap" && e === "date" || Jn.has(e))
|
|
3323
3333
|
return !0;
|
|
3324
|
-
if (
|
|
3334
|
+
if (Kn.has(e))
|
|
3325
3335
|
return !1;
|
|
3326
3336
|
const s = Array.isArray(t) ? t[0] : t;
|
|
3327
3337
|
if (!s)
|
|
3328
3338
|
return !0;
|
|
3329
3339
|
let n;
|
|
3330
|
-
return
|
|
3340
|
+
return O(s) && "column" in s && (n = s.column), !(q(s) || n !== void 0 && q(n));
|
|
3331
3341
|
}
|
|
3332
|
-
function
|
|
3342
|
+
function Hn(e) {
|
|
3333
3343
|
const t = [], r = {
|
|
3334
3344
|
chartType: "",
|
|
3335
3345
|
dataOptions: {}
|
|
3336
3346
|
};
|
|
3337
|
-
if (!
|
|
3347
|
+
if (!O(e))
|
|
3338
3348
|
return t.push({
|
|
3339
|
-
|
|
3340
|
-
index: -1,
|
|
3349
|
+
path: "chartType",
|
|
3341
3350
|
input: e,
|
|
3342
3351
|
message: "Expected an object"
|
|
3343
3352
|
}), { normalized: r, errors: t };
|
|
3344
3353
|
const s = e.chartType;
|
|
3345
3354
|
if (s === void 0) {
|
|
3346
|
-
const i = Object.keys(e), o =
|
|
3355
|
+
const i = Object.keys(e), o = x("chartType", i, (c) => c), a = o && o.distance <= T ? ` Did you mean 'chartType'? (You may have typed '${o.best}')` : "", u = o && o.distance <= T ? { [o.best]: e[o.best] } : e;
|
|
3347
3356
|
t.push({
|
|
3348
|
-
|
|
3349
|
-
index: -1,
|
|
3357
|
+
path: "chartType",
|
|
3350
3358
|
input: u,
|
|
3351
3359
|
message: `chartType is required.${a}`
|
|
3352
3360
|
});
|
|
3353
|
-
} else if (
|
|
3361
|
+
} else if (Qt(s))
|
|
3354
3362
|
r.chartType = s;
|
|
3355
3363
|
else {
|
|
3356
|
-
const i =
|
|
3364
|
+
const i = x(String(s), nt, (u) => u), o = i && i.distance <= T ? ` Did you mean '${i.best}'?` : "", a = nt.slice(0, 8).join(", ");
|
|
3357
3365
|
t.push({
|
|
3358
|
-
|
|
3359
|
-
index: -1,
|
|
3366
|
+
path: "chartType",
|
|
3360
3367
|
input: s,
|
|
3361
3368
|
message: `Invalid chartType '${s}'. Valid types: ${a}, ...${o}`
|
|
3362
3369
|
});
|
|
3363
3370
|
}
|
|
3364
3371
|
const n = e.dataOptions;
|
|
3365
3372
|
if (n === void 0) {
|
|
3366
|
-
const i = Object.keys(e), o =
|
|
3373
|
+
const i = Object.keys(e), o = x("dataOptions", i, (c) => c), a = o && o.distance <= T ? ` Did you mean 'dataOptions'? (You may have typed '${o.best}')` : "", u = o && o.distance <= T ? { [o.best]: e[o.best] } : e;
|
|
3367
3374
|
t.push({
|
|
3368
|
-
|
|
3369
|
-
index: -1,
|
|
3375
|
+
path: "dataOptions",
|
|
3370
3376
|
input: u,
|
|
3371
3377
|
message: `dataOptions is required.${a}`
|
|
3372
3378
|
});
|
|
3373
3379
|
} else n !== null && typeof n == "object" && (r.dataOptions = n);
|
|
3374
3380
|
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 };
|
|
3375
3381
|
}
|
|
3376
|
-
function
|
|
3382
|
+
function D(e, t) {
|
|
3383
|
+
return e === -1 ? "dataOptions" : typeof e == "number" ? `dataOptions[${e}]` : t !== void 0 ? `dataOptions.${e}[${t}]` : `dataOptions.${e}`;
|
|
3384
|
+
}
|
|
3385
|
+
function Xt(e, t) {
|
|
3386
|
+
return e ? t ? `${e}.${t}` : e : t != null ? t : "";
|
|
3387
|
+
}
|
|
3388
|
+
function Qn(e) {
|
|
3389
|
+
return (t) => F(l({}, t), {
|
|
3390
|
+
path: Xt(e, t.path)
|
|
3391
|
+
});
|
|
3392
|
+
}
|
|
3393
|
+
function Zt(e) {
|
|
3394
|
+
return Qn(`widgets[${e}]`);
|
|
3395
|
+
}
|
|
3396
|
+
function er(e, t) {
|
|
3397
|
+
return e.map(t);
|
|
3398
|
+
}
|
|
3399
|
+
function Xn(e) {
|
|
3377
3400
|
return e.map(
|
|
3378
|
-
({ attribute: t, style: r }) => r ?
|
|
3401
|
+
({ attribute: t, style: r }) => r ? l({ column: t }, r) : t
|
|
3379
3402
|
);
|
|
3380
3403
|
}
|
|
3381
|
-
function
|
|
3404
|
+
function Zn(e) {
|
|
3382
3405
|
return e.map(
|
|
3383
|
-
({ measure: t, style: r }) => r ?
|
|
3406
|
+
({ measure: t, style: r }) => r ? l({ column: t }, r) : t
|
|
3384
3407
|
);
|
|
3385
3408
|
}
|
|
3386
|
-
function
|
|
3409
|
+
function tr(e) {
|
|
3387
3410
|
return Array.isArray(e) ? e : [e];
|
|
3388
3411
|
}
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3412
|
+
const ei = /^(dimensions|measures|filters|highlights)(\[\d+\])?$/;
|
|
3413
|
+
function $e(e) {
|
|
3414
|
+
return (t) => {
|
|
3415
|
+
const r = t.path.match(/\[(\d+)\]$/), s = r ? Number(r[1]) : void 0, n = D(e, s);
|
|
3416
|
+
if (ei.test(t.path) || t.path.startsWith("dataOptions"))
|
|
3417
|
+
return F(l({}, t), { path: n });
|
|
3418
|
+
const i = t.path.replace(/\[\d+\]$/, "");
|
|
3419
|
+
return F(l({}, t), {
|
|
3420
|
+
path: Xt(i, n)
|
|
3421
|
+
});
|
|
3422
|
+
};
|
|
3394
3423
|
}
|
|
3395
|
-
function
|
|
3396
|
-
const i = t ?
|
|
3424
|
+
function ce(e, t, r, s, n) {
|
|
3425
|
+
const i = t ? tr(
|
|
3397
3426
|
t
|
|
3398
3427
|
) : [];
|
|
3399
3428
|
if (i.length === 0)
|
|
3400
3429
|
return [];
|
|
3401
3430
|
if (r === "dimension") {
|
|
3402
|
-
const a =
|
|
3403
|
-
() =>
|
|
3431
|
+
const a = A(
|
|
3432
|
+
() => kt({
|
|
3404
3433
|
data: i,
|
|
3405
3434
|
context: s
|
|
3406
3435
|
}),
|
|
3407
3436
|
n,
|
|
3408
|
-
|
|
3437
|
+
$e(e)
|
|
3409
3438
|
);
|
|
3410
|
-
return a !== null ?
|
|
3439
|
+
return a !== null ? Xn(a) : null;
|
|
3411
3440
|
}
|
|
3412
|
-
const o =
|
|
3413
|
-
() =>
|
|
3441
|
+
const o = A(
|
|
3442
|
+
() => Gt({
|
|
3414
3443
|
data: i,
|
|
3415
3444
|
context: s
|
|
3416
3445
|
}),
|
|
3417
3446
|
n,
|
|
3418
|
-
|
|
3447
|
+
$e(e)
|
|
3419
3448
|
);
|
|
3420
|
-
return o !== null ?
|
|
3449
|
+
return o !== null ? Zn(o) : null;
|
|
3421
3450
|
}
|
|
3422
|
-
|
|
3451
|
+
const it = (e, t) => {
|
|
3452
|
+
const r = t.path.match(/\[(\d+)\]$/), s = r ? Number(r[1]) : void 0;
|
|
3453
|
+
return F(l({}, t), { path: D(e, s) });
|
|
3454
|
+
};
|
|
3455
|
+
function ot(e, t, r) {
|
|
3423
3456
|
const s = Array.isArray(t) ? t : t != null ? [t] : [];
|
|
3424
3457
|
if (r === "dimension") {
|
|
3425
|
-
const i =
|
|
3458
|
+
const i = Ue(
|
|
3426
3459
|
s
|
|
3427
3460
|
);
|
|
3428
3461
|
return i.success ? { success: !0, data: i.data } : {
|
|
3429
3462
|
success: !1,
|
|
3430
|
-
errors: i.errors.map((o) =>
|
|
3431
|
-
category: "dataOptions",
|
|
3432
|
-
index: e
|
|
3433
|
-
}))
|
|
3463
|
+
errors: i.errors.map((o) => it(e, o))
|
|
3434
3464
|
};
|
|
3435
3465
|
}
|
|
3436
|
-
const n =
|
|
3466
|
+
const n = _e(s);
|
|
3437
3467
|
return n.success ? { success: !0, data: n.data } : {
|
|
3438
3468
|
success: !1,
|
|
3439
|
-
errors: n.errors.map((i) =>
|
|
3440
|
-
category: "dataOptions",
|
|
3441
|
-
index: e
|
|
3442
|
-
}))
|
|
3469
|
+
errors: n.errors.map((i) => it(e, i))
|
|
3443
3470
|
};
|
|
3444
3471
|
}
|
|
3445
|
-
function
|
|
3472
|
+
function ti(e, t) {
|
|
3446
3473
|
let r;
|
|
3447
|
-
|
|
3448
|
-
const n = !(
|
|
3474
|
+
O(e) && "column" in e && (r = e.column);
|
|
3475
|
+
const n = !(q(e) || r !== void 0 && q(r)) ? "dimension" : "measure", i = [], o = ce("columns", [e], n, t, i);
|
|
3449
3476
|
return o !== null ? { success: !0, data: o } : { success: !1, errors: i };
|
|
3450
3477
|
}
|
|
3451
|
-
function
|
|
3478
|
+
function ri(e, t, r, s) {
|
|
3452
3479
|
const n = [];
|
|
3453
3480
|
for (const i of e) {
|
|
3454
|
-
const o =
|
|
3455
|
-
() =>
|
|
3481
|
+
const o = A(
|
|
3482
|
+
() => ti(i, t),
|
|
3456
3483
|
r,
|
|
3457
3484
|
s
|
|
3458
3485
|
);
|
|
@@ -3460,165 +3487,157 @@ function Un(e, t, r, s) {
|
|
|
3460
3487
|
}
|
|
3461
3488
|
return n;
|
|
3462
3489
|
}
|
|
3463
|
-
function
|
|
3464
|
-
if (!e || !
|
|
3490
|
+
function si(e, t, r) {
|
|
3491
|
+
if (!e || !O(e))
|
|
3465
3492
|
return r.push({
|
|
3466
|
-
|
|
3467
|
-
index: -1,
|
|
3493
|
+
path: D(-1),
|
|
3468
3494
|
input: e,
|
|
3469
3495
|
message: "dataOptions is required"
|
|
3470
3496
|
}), null;
|
|
3471
3497
|
const s = {}, { chartType: n } = t, i = r.length, o = e, a = Object.keys(e), u = /* @__PURE__ */ new Map();
|
|
3472
|
-
for (const
|
|
3473
|
-
if (!
|
|
3474
|
-
const
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
message: `Unknown dataOptions key '${l}'.${b}`
|
|
3498
|
+
for (const d of a)
|
|
3499
|
+
if (!Ae.has(d)) {
|
|
3500
|
+
const m = x(d, [...Ae], (b) => b), h = m && m.distance <= T ? ` Did you mean '${m.best}'?` : "";
|
|
3501
|
+
m && m.distance <= T && u.set(d, m.best), r.push({
|
|
3502
|
+
path: D(d),
|
|
3503
|
+
input: o[d],
|
|
3504
|
+
message: `Unknown dataOptions key '${d}'.${h}`
|
|
3480
3505
|
});
|
|
3481
3506
|
}
|
|
3482
|
-
const c = n ?
|
|
3507
|
+
const c = n ? Gn(n) : void 0;
|
|
3483
3508
|
if (c) {
|
|
3484
|
-
for (const
|
|
3485
|
-
if (
|
|
3486
|
-
const
|
|
3509
|
+
for (const d of a)
|
|
3510
|
+
if (d !== "seriesToColorMap" && !c.validAxes.has(d) && Ae.has(d)) {
|
|
3511
|
+
const m = x(d, [...c.validAxes], (p) => p), h = m && m.distance <= T ? ` Did you mean '${m.best}'?` : "", b = [...c.validAxes].join(", ");
|
|
3487
3512
|
r.push({
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
message: `Axis '${l}' is not valid for chart type '${n}'. Valid axes: ${g}.${b}`
|
|
3513
|
+
path: D(d),
|
|
3514
|
+
input: o[d],
|
|
3515
|
+
message: `Axis '${d}' is not valid for chart type '${n}'. Valid axes: ${b}.${h}`
|
|
3492
3516
|
});
|
|
3493
3517
|
}
|
|
3494
|
-
for (const
|
|
3495
|
-
[...u.values()].includes(
|
|
3496
|
-
|
|
3497
|
-
index: l,
|
|
3518
|
+
for (const d of c.requiredAxes)
|
|
3519
|
+
[...u.values()].includes(d) || (!(d in o) || o[d] == null) && r.push({
|
|
3520
|
+
path: D(d),
|
|
3498
3521
|
input: null,
|
|
3499
3522
|
message: `Chart type '${n}' requires '${c.requiredAxes.join(
|
|
3500
3523
|
"' and '"
|
|
3501
|
-
)}'. Missing: ${
|
|
3524
|
+
)}'. Missing: ${d}.`
|
|
3502
3525
|
});
|
|
3503
3526
|
n === "indicator" && (["value", "secondary", "min", "max"].some(
|
|
3504
|
-
(
|
|
3527
|
+
(h) => h in o && o[h] != null
|
|
3505
3528
|
) || r.push({
|
|
3506
|
-
|
|
3507
|
-
index: -1,
|
|
3529
|
+
path: D(-1),
|
|
3508
3530
|
input: e,
|
|
3509
3531
|
message: "Indicator chart requires at least one of: value, secondary, min, max."
|
|
3510
3532
|
})), n === "scatter" && ("x" in e && e.x != null || "y" in e && e.y != null || r.push({
|
|
3511
|
-
|
|
3512
|
-
index: -1,
|
|
3533
|
+
path: D(-1),
|
|
3513
3534
|
input: e,
|
|
3514
3535
|
message: "Scatter chart requires at least one of: x, y."
|
|
3515
3536
|
}));
|
|
3516
3537
|
}
|
|
3517
3538
|
if (r.length > i)
|
|
3518
3539
|
return null;
|
|
3519
|
-
const
|
|
3520
|
-
for (const [
|
|
3521
|
-
if (!
|
|
3522
|
-
if (
|
|
3523
|
-
s[
|
|
3540
|
+
const g = Object.entries(e);
|
|
3541
|
+
for (const [d, m] of g) {
|
|
3542
|
+
if (!m) continue;
|
|
3543
|
+
if (d === "seriesToColorMap") {
|
|
3544
|
+
s[d] = m;
|
|
3524
3545
|
continue;
|
|
3525
3546
|
}
|
|
3526
|
-
if (
|
|
3527
|
-
s[
|
|
3528
|
-
|
|
3547
|
+
if (d === "columns") {
|
|
3548
|
+
s[d] = ri(
|
|
3549
|
+
tr(m),
|
|
3529
3550
|
t,
|
|
3530
3551
|
r,
|
|
3531
|
-
|
|
3552
|
+
$e("columns")
|
|
3532
3553
|
);
|
|
3533
3554
|
continue;
|
|
3534
3555
|
}
|
|
3535
|
-
const
|
|
3536
|
-
l,
|
|
3556
|
+
const h = Yn(d, m, n) ? "dimension" : "measure", b = ce(
|
|
3537
3557
|
d,
|
|
3538
|
-
|
|
3558
|
+
m,
|
|
3559
|
+
h,
|
|
3539
3560
|
t,
|
|
3540
3561
|
r
|
|
3541
3562
|
);
|
|
3542
|
-
if (
|
|
3543
|
-
const
|
|
3544
|
-
s[
|
|
3563
|
+
if (b !== null) {
|
|
3564
|
+
const p = n === "calendar-heatmap" && d === "value";
|
|
3565
|
+
s[d] = p || !Array.isArray(m) ? b[0] : b;
|
|
3545
3566
|
}
|
|
3546
3567
|
}
|
|
3547
3568
|
return r.length > i ? null : s;
|
|
3548
3569
|
}
|
|
3549
|
-
function
|
|
3570
|
+
function ni(e) {
|
|
3550
3571
|
if (typeof e != "string") return "iqr";
|
|
3551
3572
|
const t = e.split("/")[1];
|
|
3552
3573
|
return t === "iqr" || t === "extremums" || t === "standardDeviation" ? t : "iqr";
|
|
3553
3574
|
}
|
|
3554
|
-
const
|
|
3555
|
-
var
|
|
3556
|
-
const { data: t, context: r } = e, { dataSource: s, tables: n } = r, { normalized: i, errors: o } =
|
|
3575
|
+
const ii = (e) => {
|
|
3576
|
+
var p;
|
|
3577
|
+
const { data: t, context: r } = e, { dataSource: s, tables: n } = r, { normalized: i, errors: o } = Hn(t);
|
|
3557
3578
|
if (o.length > 0)
|
|
3558
3579
|
return { success: !1, errors: o };
|
|
3559
|
-
const a = i.chartType, u =
|
|
3560
|
-
let
|
|
3580
|
+
const a = i.chartType, u = re(n), c = [];
|
|
3581
|
+
let g = si(
|
|
3561
3582
|
i.dataOptions,
|
|
3562
3583
|
{ dataSource: s, schemaIndex: u, chartType: a },
|
|
3563
3584
|
c
|
|
3564
3585
|
);
|
|
3565
|
-
if (a === "boxplot" &&
|
|
3566
|
-
const
|
|
3567
|
-
|
|
3586
|
+
if (a === "boxplot" && g) {
|
|
3587
|
+
const E = ni((p = i.styleOptions) == null ? void 0 : p.subtype), C = E === "iqr" || E === "standardDeviation";
|
|
3588
|
+
g = F(l({}, g), { boxType: E, outliersEnabled: C });
|
|
3568
3589
|
}
|
|
3569
|
-
let
|
|
3570
|
-
i.filters && i.filters.length > 0 && (
|
|
3571
|
-
() =>
|
|
3590
|
+
let d = null;
|
|
3591
|
+
i.filters && i.filters.length > 0 && (d = A(
|
|
3592
|
+
() => se({
|
|
3572
3593
|
data: i.filters || [],
|
|
3573
3594
|
context: { dataSource: s, schemaIndex: u }
|
|
3574
3595
|
}),
|
|
3575
3596
|
c
|
|
3576
3597
|
));
|
|
3577
|
-
let
|
|
3578
|
-
if (i.highlights && i.highlights.length > 0 && (
|
|
3579
|
-
() =>
|
|
3598
|
+
let m = null;
|
|
3599
|
+
if (i.highlights && i.highlights.length > 0 && (m = A(
|
|
3600
|
+
() => me({
|
|
3580
3601
|
data: i.highlights || [],
|
|
3581
3602
|
context: { dataSource: s, schemaIndex: u }
|
|
3582
3603
|
}),
|
|
3583
3604
|
c
|
|
3584
|
-
)), c.length > 0 ||
|
|
3605
|
+
)), c.length > 0 || g === null)
|
|
3585
3606
|
return {
|
|
3586
3607
|
success: !1,
|
|
3587
3608
|
errors: c
|
|
3588
3609
|
};
|
|
3589
|
-
if (!
|
|
3610
|
+
if (!Qt(i.chartType))
|
|
3590
3611
|
return {
|
|
3591
3612
|
success: !1,
|
|
3592
3613
|
errors: [
|
|
3593
3614
|
{
|
|
3594
|
-
|
|
3595
|
-
index: -1,
|
|
3615
|
+
path: "chartType",
|
|
3596
3616
|
input: i.chartType,
|
|
3597
3617
|
message: "Invalid chartType"
|
|
3598
3618
|
}
|
|
3599
3619
|
]
|
|
3600
3620
|
};
|
|
3601
|
-
const
|
|
3621
|
+
const h = i.chartType;
|
|
3602
3622
|
return {
|
|
3603
3623
|
success: !0,
|
|
3604
|
-
data:
|
|
3605
|
-
dataSet:
|
|
3606
|
-
chartType:
|
|
3607
|
-
dataOptions:
|
|
3624
|
+
data: l(l(l({
|
|
3625
|
+
dataSet: le(s),
|
|
3626
|
+
chartType: h,
|
|
3627
|
+
dataOptions: g
|
|
3608
3628
|
}, i.styleOptions && {
|
|
3609
3629
|
// Pass-through NLQ JSON; shape matches ChartStyleOptions.
|
|
3610
3630
|
styleOptions: i.styleOptions
|
|
3611
|
-
}),
|
|
3631
|
+
}), d && { filters: d }), m && { highlights: m })
|
|
3612
3632
|
};
|
|
3613
|
-
},
|
|
3633
|
+
}, oi = (e) => {
|
|
3614
3634
|
const t = [];
|
|
3615
3635
|
if (!e.chartType)
|
|
3616
3636
|
return {
|
|
3617
3637
|
success: !1,
|
|
3618
3638
|
errors: [
|
|
3619
3639
|
{
|
|
3620
|
-
|
|
3621
|
-
index: -1,
|
|
3640
|
+
path: "chartType",
|
|
3622
3641
|
input: e,
|
|
3623
3642
|
message: "chartType is required"
|
|
3624
3643
|
}
|
|
@@ -3629,35 +3648,34 @@ const si = (e) => {
|
|
|
3629
3648
|
success: !1,
|
|
3630
3649
|
errors: [
|
|
3631
3650
|
{
|
|
3632
|
-
|
|
3633
|
-
index: -1,
|
|
3651
|
+
path: "dataOptions",
|
|
3634
3652
|
input: e,
|
|
3635
3653
|
message: "dataOptions is required"
|
|
3636
3654
|
}
|
|
3637
3655
|
]
|
|
3638
3656
|
};
|
|
3639
3657
|
let r = null;
|
|
3640
|
-
const s =
|
|
3658
|
+
const s = ai(e.dataOptions);
|
|
3641
3659
|
s.success ? r = s.data : t.push(...s.errors);
|
|
3642
3660
|
let n;
|
|
3643
3661
|
if (e.filters) {
|
|
3644
|
-
const
|
|
3645
|
-
() =>
|
|
3662
|
+
const a = A(
|
|
3663
|
+
() => ne(e.filters),
|
|
3646
3664
|
t
|
|
3647
3665
|
);
|
|
3648
|
-
n =
|
|
3666
|
+
n = a != null ? a : void 0;
|
|
3649
3667
|
}
|
|
3650
3668
|
let i;
|
|
3651
3669
|
if (e.highlights && e.highlights.length > 0) {
|
|
3652
|
-
const
|
|
3653
|
-
() =>
|
|
3670
|
+
const a = A(
|
|
3671
|
+
() => ge(e.highlights),
|
|
3654
3672
|
t
|
|
3655
3673
|
);
|
|
3656
|
-
i =
|
|
3674
|
+
i = a != null ? a : void 0;
|
|
3657
3675
|
}
|
|
3658
3676
|
if (t.length > 0 || r === null)
|
|
3659
3677
|
return { success: !1, errors: t };
|
|
3660
|
-
const o =
|
|
3678
|
+
const o = l(l(l({
|
|
3661
3679
|
chartType: e.chartType,
|
|
3662
3680
|
dataOptions: r
|
|
3663
3681
|
}, e.styleOptions && {
|
|
@@ -3665,12 +3683,10 @@ const si = (e) => {
|
|
|
3665
3683
|
}), n && n.length > 0 && { filters: n }), i && i.length > 0 && { highlights: i });
|
|
3666
3684
|
return {
|
|
3667
3685
|
success: !0,
|
|
3668
|
-
data:
|
|
3669
|
-
o
|
|
3670
|
-
)
|
|
3686
|
+
data: B(o)
|
|
3671
3687
|
};
|
|
3672
3688
|
};
|
|
3673
|
-
function
|
|
3689
|
+
function ai(e) {
|
|
3674
3690
|
const t = {}, r = [], s = /* @__PURE__ */ new Set(["seriesToColorMap", "boxType", "outliersEnabled", "valueTitle"]);
|
|
3675
3691
|
for (const [n, i] of Object.entries(e)) {
|
|
3676
3692
|
if (n === "seriesToColorMap" && i) {
|
|
@@ -3682,13 +3698,16 @@ function Wn(e) {
|
|
|
3682
3698
|
continue;
|
|
3683
3699
|
}
|
|
3684
3700
|
const o = Array.isArray(i) ? i : [i], a = Array.isArray(i), u = [], c = [];
|
|
3685
|
-
for (let
|
|
3686
|
-
const
|
|
3687
|
-
|
|
3688
|
-
]) :
|
|
3689
|
-
|
|
3690
|
-
var
|
|
3691
|
-
c.push(
|
|
3701
|
+
for (let g = 0; g < o.length; g++) {
|
|
3702
|
+
const d = o[g], h = ui(d) ? Ue([
|
|
3703
|
+
d
|
|
3704
|
+
]) : _e([d]);
|
|
3705
|
+
h.success ? u.push(...h.data) : h.errors.forEach((b) => {
|
|
3706
|
+
var p;
|
|
3707
|
+
c.push(F(l({}, b), {
|
|
3708
|
+
path: D(n, g),
|
|
3709
|
+
input: (p = b.input) != null ? p : d
|
|
3710
|
+
}));
|
|
3692
3711
|
});
|
|
3693
3712
|
}
|
|
3694
3713
|
if (c.length > 0) {
|
|
@@ -3699,11 +3718,11 @@ function Wn(e) {
|
|
|
3699
3718
|
}
|
|
3700
3719
|
return r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
|
|
3701
3720
|
}
|
|
3702
|
-
function
|
|
3721
|
+
function ui(e) {
|
|
3703
3722
|
const t = Array.isArray(e) ? e[0] : e;
|
|
3704
|
-
if (!t || !
|
|
3723
|
+
if (!t || !O(t))
|
|
3705
3724
|
return !0;
|
|
3706
|
-
const r = "column" in t && t.column != null &&
|
|
3725
|
+
const r = "column" in t && t.column != null && O(t.column) ? t.column : t;
|
|
3707
3726
|
if ("composeCode" in r) {
|
|
3708
3727
|
const s = r.composeCode;
|
|
3709
3728
|
if (typeof s == "string" && s.startsWith("DM."))
|
|
@@ -3718,41 +3737,38 @@ function jn(e) {
|
|
|
3718
3737
|
}
|
|
3719
3738
|
return !("aggregation" in r || "attribute" in r && "aggregation" in r);
|
|
3720
3739
|
}
|
|
3721
|
-
const
|
|
3722
|
-
function
|
|
3723
|
-
if (!
|
|
3740
|
+
const at = ["rows", "columns", "values", "grandTotals"];
|
|
3741
|
+
function ci(e) {
|
|
3742
|
+
if (!O(e)) return !1;
|
|
3724
3743
|
const t = Object.keys(e);
|
|
3725
3744
|
return t.every((r) => r === "rows" || r === "columns") && t.every((r) => typeof e[r] == "boolean");
|
|
3726
3745
|
}
|
|
3727
|
-
function
|
|
3746
|
+
function li(e) {
|
|
3728
3747
|
const t = [], r = {
|
|
3729
3748
|
dataOptions: {}
|
|
3730
3749
|
};
|
|
3731
|
-
if (!
|
|
3750
|
+
if (!O(e))
|
|
3732
3751
|
return t.push({
|
|
3733
|
-
|
|
3734
|
-
index: -1,
|
|
3752
|
+
path: "dataOptions",
|
|
3735
3753
|
input: e,
|
|
3736
3754
|
message: "Expected an object"
|
|
3737
3755
|
}), { normalized: r, errors: t };
|
|
3738
3756
|
const s = e.dataOptions;
|
|
3739
3757
|
if (s === void 0) {
|
|
3740
|
-
const n = Object.keys(e), i =
|
|
3758
|
+
const n = Object.keys(e), i = x("dataOptions", n, (u) => u), o = i && i.distance <= T ? ` Did you mean 'dataOptions'? (You may have typed '${i.best}')` : "", a = i && i.distance <= T ? { [i.best]: e[i.best] } : e;
|
|
3741
3759
|
t.push({
|
|
3742
|
-
|
|
3743
|
-
index: -1,
|
|
3760
|
+
path: "dataOptions",
|
|
3744
3761
|
input: a,
|
|
3745
3762
|
message: `dataOptions is required.${o}`
|
|
3746
3763
|
});
|
|
3747
|
-
} else if (
|
|
3764
|
+
} else if (O(s)) {
|
|
3748
3765
|
const n = s;
|
|
3749
3766
|
r.dataOptions = n;
|
|
3750
3767
|
for (const o of Object.keys(n))
|
|
3751
|
-
if (!
|
|
3752
|
-
const a =
|
|
3768
|
+
if (!at.includes(o)) {
|
|
3769
|
+
const a = x(o, [...at], (c) => c), u = a && a.distance <= T ? ` Did you mean '${a.best}'?` : "";
|
|
3753
3770
|
t.push({
|
|
3754
|
-
|
|
3755
|
-
index: o,
|
|
3771
|
+
path: D(o),
|
|
3756
3772
|
input: n[o],
|
|
3757
3773
|
message: `Unknown dataOptions key '${o}'. Valid keys: rows, columns, values, grandTotals.${u}`
|
|
3758
3774
|
});
|
|
@@ -3760,33 +3776,30 @@ function Gn(e) {
|
|
|
3760
3776
|
for (const o of ["rows", "columns", "values"]) {
|
|
3761
3777
|
const a = n[o];
|
|
3762
3778
|
a != null && !Array.isArray(a) && t.push({
|
|
3763
|
-
|
|
3764
|
-
index: o,
|
|
3779
|
+
path: D(o),
|
|
3765
3780
|
input: a,
|
|
3766
3781
|
message: `dataOptions.${o} must be an array`
|
|
3767
3782
|
});
|
|
3768
3783
|
}
|
|
3769
3784
|
const i = n.grandTotals;
|
|
3770
|
-
i != null && !
|
|
3771
|
-
|
|
3772
|
-
index: "grandTotals",
|
|
3785
|
+
i != null && !ci(i) && t.push({
|
|
3786
|
+
path: D("grandTotals"),
|
|
3773
3787
|
input: i,
|
|
3774
3788
|
message: "grandTotals must be an object with optional rows?: boolean, columns?: boolean"
|
|
3775
3789
|
});
|
|
3776
3790
|
}
|
|
3777
3791
|
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 };
|
|
3778
3792
|
}
|
|
3779
|
-
function
|
|
3793
|
+
function di(e, t, r) {
|
|
3780
3794
|
if (!e || typeof e != "object")
|
|
3781
3795
|
return r.push({
|
|
3782
|
-
|
|
3783
|
-
index: -1,
|
|
3796
|
+
path: D(-1),
|
|
3784
3797
|
input: e,
|
|
3785
3798
|
message: "dataOptions is required"
|
|
3786
3799
|
}), null;
|
|
3787
3800
|
const s = {}, n = r.length;
|
|
3788
3801
|
for (const o of ["rows", "columns"]) {
|
|
3789
|
-
const a =
|
|
3802
|
+
const a = ce(
|
|
3790
3803
|
o,
|
|
3791
3804
|
e[o],
|
|
3792
3805
|
"dimension",
|
|
@@ -3795,7 +3808,7 @@ function Yn(e, t, r) {
|
|
|
3795
3808
|
);
|
|
3796
3809
|
a && (s[o] = a);
|
|
3797
3810
|
}
|
|
3798
|
-
const i =
|
|
3811
|
+
const i = ce(
|
|
3799
3812
|
"values",
|
|
3800
3813
|
e.values,
|
|
3801
3814
|
"measure",
|
|
@@ -3804,26 +3817,26 @@ function Yn(e, t, r) {
|
|
|
3804
3817
|
);
|
|
3805
3818
|
return i && (s.values = i), e.grandTotals !== void 0 && (s.grandTotals = e.grandTotals), r.length > n ? null : s;
|
|
3806
3819
|
}
|
|
3807
|
-
const
|
|
3808
|
-
const { data: t, context: r } = e, { dataSource: s, tables: n } = r, { normalized: i, errors: o } =
|
|
3820
|
+
const fi = (e) => {
|
|
3821
|
+
const { data: t, context: r } = e, { dataSource: s, tables: n } = r, { normalized: i, errors: o } = li(t);
|
|
3809
3822
|
if (o.length > 0)
|
|
3810
3823
|
return { success: !1, errors: o };
|
|
3811
|
-
const a =
|
|
3824
|
+
const a = re(n), u = [], c = di(
|
|
3812
3825
|
i.dataOptions,
|
|
3813
3826
|
{ dataSource: s, schemaIndex: a },
|
|
3814
3827
|
u
|
|
3815
3828
|
);
|
|
3816
|
-
let
|
|
3817
|
-
i.filters && i.filters.length > 0 && (
|
|
3818
|
-
() =>
|
|
3829
|
+
let g = null;
|
|
3830
|
+
i.filters && i.filters.length > 0 && (g = A(
|
|
3831
|
+
() => se({
|
|
3819
3832
|
data: i.filters || [],
|
|
3820
3833
|
context: { dataSource: s, schemaIndex: a }
|
|
3821
3834
|
}),
|
|
3822
3835
|
u
|
|
3823
3836
|
));
|
|
3824
|
-
let
|
|
3825
|
-
return i.highlights && i.highlights.length > 0 && (
|
|
3826
|
-
() =>
|
|
3837
|
+
let d = null;
|
|
3838
|
+
return i.highlights && i.highlights.length > 0 && (d = A(
|
|
3839
|
+
() => me({
|
|
3827
3840
|
data: i.highlights || [],
|
|
3828
3841
|
context: { dataSource: s, schemaIndex: a }
|
|
3829
3842
|
}),
|
|
@@ -3833,69 +3846,353 @@ const ii = (e) => {
|
|
|
3833
3846
|
errors: u
|
|
3834
3847
|
} : {
|
|
3835
3848
|
success: !0,
|
|
3836
|
-
data:
|
|
3837
|
-
dataSet:
|
|
3849
|
+
data: l(l(l({
|
|
3850
|
+
dataSet: le(s),
|
|
3838
3851
|
dataOptions: c
|
|
3839
|
-
}, i.styleOptions && { styleOptions: i.styleOptions }),
|
|
3852
|
+
}, i.styleOptions && { styleOptions: i.styleOptions }), g && { filters: g }), d && { highlights: d })
|
|
3840
3853
|
};
|
|
3841
|
-
},
|
|
3854
|
+
}, pi = (e) => {
|
|
3842
3855
|
const t = [];
|
|
3843
3856
|
if (!e.dataOptions)
|
|
3844
3857
|
return {
|
|
3845
3858
|
success: !1,
|
|
3846
3859
|
errors: [
|
|
3847
3860
|
{
|
|
3848
|
-
|
|
3849
|
-
index: -1,
|
|
3861
|
+
path: "dataOptions",
|
|
3850
3862
|
input: e,
|
|
3851
3863
|
message: "dataOptions is required"
|
|
3852
3864
|
}
|
|
3853
3865
|
]
|
|
3854
3866
|
};
|
|
3855
3867
|
const r = e.dataOptions, s = {};
|
|
3856
|
-
for (const
|
|
3857
|
-
const
|
|
3858
|
-
if (
|
|
3859
|
-
const
|
|
3860
|
-
|
|
3868
|
+
for (const u of ["rows", "columns"]) {
|
|
3869
|
+
const c = r[u];
|
|
3870
|
+
if (c && c.length > 0) {
|
|
3871
|
+
const g = ot(u, c, "dimension");
|
|
3872
|
+
g.success ? s[u] = g.data : t.push(...g.errors);
|
|
3861
3873
|
}
|
|
3862
3874
|
}
|
|
3863
3875
|
const n = r.values;
|
|
3864
3876
|
if (n && n.length > 0) {
|
|
3865
|
-
const
|
|
3866
|
-
|
|
3877
|
+
const u = ot("values", n, "measure");
|
|
3878
|
+
u.success ? s.values = u.data : t.push(...u.errors);
|
|
3867
3879
|
}
|
|
3868
3880
|
r.grandTotals !== void 0 && (s.grandTotals = r.grandTotals);
|
|
3869
3881
|
let i;
|
|
3870
3882
|
if (e.filters) {
|
|
3871
|
-
const
|
|
3872
|
-
() =>
|
|
3883
|
+
const u = A(
|
|
3884
|
+
() => ne(e.filters),
|
|
3873
3885
|
t
|
|
3874
3886
|
);
|
|
3875
|
-
i =
|
|
3887
|
+
i = u != null ? u : void 0;
|
|
3876
3888
|
}
|
|
3877
3889
|
let o;
|
|
3878
3890
|
if (e.highlights && e.highlights.length > 0) {
|
|
3879
|
-
const
|
|
3880
|
-
() =>
|
|
3891
|
+
const u = A(
|
|
3892
|
+
() => ge(e.highlights),
|
|
3881
3893
|
t
|
|
3882
3894
|
);
|
|
3883
|
-
o =
|
|
3895
|
+
o = u != null ? u : void 0;
|
|
3884
3896
|
}
|
|
3885
3897
|
if (t.length > 0)
|
|
3886
3898
|
return { success: !1, errors: t };
|
|
3887
|
-
const a =
|
|
3899
|
+
const a = l(l(l({
|
|
3888
3900
|
dataOptions: s
|
|
3889
3901
|
}, e.styleOptions && { styleOptions: e.styleOptions }), i && i.length > 0 && { filters: i }), o && o.length > 0 && { highlights: o });
|
|
3890
3902
|
return {
|
|
3891
3903
|
success: !0,
|
|
3892
|
-
data:
|
|
3893
|
-
|
|
3894
|
-
|
|
3904
|
+
data: B(a)
|
|
3905
|
+
};
|
|
3906
|
+
}, mi = (e, t, r) => {
|
|
3907
|
+
const s = re(r.tables), n = { dataSource: r.dataSource, schemaIndex: s }, i = [], o = e && e.length > 0 ? A(
|
|
3908
|
+
() => se({ data: e, context: n }),
|
|
3909
|
+
i
|
|
3910
|
+
) : void 0, a = t && t.length > 0 ? A(
|
|
3911
|
+
() => me({ data: t, context: n }),
|
|
3912
|
+
i
|
|
3913
|
+
) : void 0;
|
|
3914
|
+
return i.length > 0 ? { success: !1, errors: i } : {
|
|
3915
|
+
success: !0,
|
|
3916
|
+
data: l(l({}, o != null && { filters: o }), a != null && { highlights: a })
|
|
3917
|
+
};
|
|
3918
|
+
}, gi = [
|
|
3919
|
+
"widgetType",
|
|
3920
|
+
"id",
|
|
3921
|
+
"title",
|
|
3922
|
+
"description",
|
|
3923
|
+
"dataSource",
|
|
3924
|
+
"config",
|
|
3925
|
+
"highlightSelectionDisabled"
|
|
3926
|
+
], ut = (e, t, r, s) => {
|
|
3927
|
+
const { id: n, title: i, description: o, dataSource: a, config: u, highlightSelectionDisabled: c } = e, g = _(e, gi), d = r({ data: g, context: t });
|
|
3928
|
+
return d.success ? {
|
|
3929
|
+
success: !0,
|
|
3930
|
+
data: s(d.data, {
|
|
3931
|
+
id: n,
|
|
3932
|
+
title: i,
|
|
3933
|
+
description: o,
|
|
3934
|
+
dataSource: a,
|
|
3935
|
+
config: u,
|
|
3936
|
+
highlightSelectionDisabled: c
|
|
3937
|
+
})
|
|
3938
|
+
} : d;
|
|
3939
|
+
}, yi = (e, t) => {
|
|
3940
|
+
const n = e, { dataSet: r } = n, s = ye(n, ["dataSet"]);
|
|
3941
|
+
return l(l(l(l(l(F(l({}, s), {
|
|
3942
|
+
widgetType: "chart",
|
|
3943
|
+
id: t.id
|
|
3944
|
+
}), t.dataSource !== void 0 ? { dataSource: t.dataSource } : r !== void 0 && mt(r) && { dataSource: r }), t.config !== void 0 && { config: t.config }), t.highlightSelectionDisabled !== void 0 && {
|
|
3945
|
+
highlightSelectionDisabled: t.highlightSelectionDisabled
|
|
3946
|
+
}), t.title !== void 0 && { title: t.title }), t.description !== void 0 && { description: t.description });
|
|
3947
|
+
}, hi = (e, t) => {
|
|
3948
|
+
const n = e, { dataSet: r } = n, s = ye(n, ["dataSet"]);
|
|
3949
|
+
return l(l(l(l(F(l({}, s), {
|
|
3950
|
+
widgetType: "pivot",
|
|
3951
|
+
id: t.id
|
|
3952
|
+
}), t.dataSource !== void 0 ? { dataSource: t.dataSource } : r !== void 0 && mt(r) && { dataSource: r }), t.config !== void 0 && { config: t.config }), t.title !== void 0 && { title: t.title }), t.description !== void 0 && { description: t.description });
|
|
3953
|
+
}, Oe = ["chart", "pivot", "text", "custom"], bi = (e) => typeof e == "string" && Oe.includes(e);
|
|
3954
|
+
function Ei(e) {
|
|
3955
|
+
if (!O(e))
|
|
3956
|
+
return {
|
|
3957
|
+
path: "widgetType",
|
|
3958
|
+
input: e,
|
|
3959
|
+
message: "Expected an object"
|
|
3960
|
+
};
|
|
3961
|
+
const t = e.widgetType;
|
|
3962
|
+
if (t === void 0) {
|
|
3963
|
+
const r = Object.keys(e), s = x("widgetType", r, (o) => o), n = s && s.distance <= T ? ` Did you mean 'widgetType'? (You may have typed '${s.best}')` : "";
|
|
3964
|
+
return {
|
|
3965
|
+
path: "widgetType",
|
|
3966
|
+
input: s && s.distance <= T ? { [s.best]: e[s.best] } : e,
|
|
3967
|
+
message: `widgetType is required.${n}`
|
|
3968
|
+
};
|
|
3969
|
+
}
|
|
3970
|
+
if (!bi(t)) {
|
|
3971
|
+
const r = x(String(t), Oe, (i) => i), s = r && r.distance <= T ? ` Did you mean '${r.best}'?` : "", n = Oe.join(", ");
|
|
3972
|
+
return {
|
|
3973
|
+
path: "widgetType",
|
|
3974
|
+
input: t,
|
|
3975
|
+
message: `Invalid widgetType '${String(
|
|
3976
|
+
t
|
|
3977
|
+
)}'. Valid types: ${n}${s}`
|
|
3978
|
+
};
|
|
3979
|
+
}
|
|
3980
|
+
return null;
|
|
3981
|
+
}
|
|
3982
|
+
const Fi = (e) => ({
|
|
3983
|
+
path: "id",
|
|
3984
|
+
input: e,
|
|
3985
|
+
message: "Widget id is required"
|
|
3986
|
+
}), Ai = (e) => !!e.id, wi = (e) => {
|
|
3987
|
+
const { data: t, context: r } = e, s = Ei(t);
|
|
3988
|
+
if (s)
|
|
3989
|
+
return { success: !1, errors: [s] };
|
|
3990
|
+
if (!Ai(t))
|
|
3991
|
+
return { success: !1, errors: [Fi(t)] };
|
|
3992
|
+
switch (t.widgetType) {
|
|
3993
|
+
case "chart":
|
|
3994
|
+
return ut(
|
|
3995
|
+
t,
|
|
3996
|
+
r,
|
|
3997
|
+
ii,
|
|
3998
|
+
yi
|
|
3999
|
+
);
|
|
4000
|
+
case "pivot":
|
|
4001
|
+
return ut(
|
|
4002
|
+
t,
|
|
4003
|
+
r,
|
|
4004
|
+
fi,
|
|
4005
|
+
hi
|
|
4006
|
+
);
|
|
4007
|
+
case "text":
|
|
4008
|
+
return { success: !0, data: l({
|
|
4009
|
+
widgetType: "text",
|
|
4010
|
+
id: t.id,
|
|
4011
|
+
styleOptions: t.styleOptions
|
|
4012
|
+
}, t.config !== void 0 && { config: t.config }) };
|
|
4013
|
+
case "custom": {
|
|
4014
|
+
const {
|
|
4015
|
+
id: n,
|
|
4016
|
+
customWidgetType: i,
|
|
4017
|
+
title: o,
|
|
4018
|
+
description: a,
|
|
4019
|
+
dataSource: u,
|
|
4020
|
+
config: c,
|
|
4021
|
+
filters: g,
|
|
4022
|
+
highlights: d,
|
|
4023
|
+
dataOptions: m,
|
|
4024
|
+
styleOptions: h,
|
|
4025
|
+
customOptions: b
|
|
4026
|
+
} = t, p = mi(g, d, r);
|
|
4027
|
+
return p.success ? { success: !0, data: l(l(l(l(l(l({
|
|
4028
|
+
widgetType: "custom",
|
|
4029
|
+
id: n,
|
|
4030
|
+
customWidgetType: i,
|
|
4031
|
+
dataSource: u !== void 0 ? u : le(r.dataSource),
|
|
4032
|
+
dataOptions: m != null ? m : {}
|
|
4033
|
+
}, o !== void 0 && { title: o }), a !== void 0 && { description: a }), c !== void 0 && { config: c }), h !== void 0 && { styleOptions: h }), b !== void 0 && { customOptions: b }), p.data) } : p;
|
|
4034
|
+
}
|
|
4035
|
+
default:
|
|
4036
|
+
return {
|
|
4037
|
+
success: !1,
|
|
4038
|
+
errors: [
|
|
4039
|
+
{
|
|
4040
|
+
path: "widgetType",
|
|
4041
|
+
input: t,
|
|
4042
|
+
message: `Unknown widgetType: ${String(
|
|
4043
|
+
t.widgetType
|
|
4044
|
+
)}`
|
|
4045
|
+
}
|
|
4046
|
+
]
|
|
4047
|
+
};
|
|
4048
|
+
}
|
|
4049
|
+
}, Ti = (e) => {
|
|
4050
|
+
const { widgetType: t } = e;
|
|
4051
|
+
switch (t) {
|
|
4052
|
+
case "chart": {
|
|
4053
|
+
const r = oi(e);
|
|
4054
|
+
if (!r.success) return r;
|
|
4055
|
+
const s = l(l(l(l(l(F(l({}, r.data), {
|
|
4056
|
+
widgetType: "chart",
|
|
4057
|
+
id: e.id
|
|
4058
|
+
}), e.title !== void 0 && { title: e.title }), e.description !== void 0 && { description: e.description }), e.dataSource !== void 0 && {
|
|
4059
|
+
dataSource: ae(e.dataSource)
|
|
4060
|
+
}), e.config !== void 0 && { config: e.config }), e.highlightSelectionDisabled !== void 0 && {
|
|
4061
|
+
highlightSelectionDisabled: e.highlightSelectionDisabled
|
|
4062
|
+
});
|
|
4063
|
+
return {
|
|
4064
|
+
success: !0,
|
|
4065
|
+
data: B(s)
|
|
4066
|
+
};
|
|
4067
|
+
}
|
|
4068
|
+
case "pivot": {
|
|
4069
|
+
const r = pi(e);
|
|
4070
|
+
if (!r.success) return r;
|
|
4071
|
+
const s = l(l(l(l(F(l({}, r.data), {
|
|
4072
|
+
widgetType: "pivot",
|
|
4073
|
+
id: e.id
|
|
4074
|
+
}), e.title !== void 0 && { title: e.title }), e.description !== void 0 && { description: e.description }), e.dataSource !== void 0 && {
|
|
4075
|
+
dataSource: ae(e.dataSource)
|
|
4076
|
+
}), e.config !== void 0 && { config: e.config });
|
|
4077
|
+
return {
|
|
4078
|
+
success: !0,
|
|
4079
|
+
data: B(s)
|
|
4080
|
+
};
|
|
4081
|
+
}
|
|
4082
|
+
case "text":
|
|
4083
|
+
return { success: !0, data: l({
|
|
4084
|
+
widgetType: "text",
|
|
4085
|
+
id: e.id,
|
|
4086
|
+
styleOptions: e.styleOptions
|
|
4087
|
+
}, e.config !== void 0 && { config: e.config }) };
|
|
4088
|
+
case "custom": {
|
|
4089
|
+
const r = [], s = e.filters !== void 0 ? A(
|
|
4090
|
+
() => ne(e.filters),
|
|
4091
|
+
r
|
|
4092
|
+
) : void 0, n = e.highlights !== void 0 ? A(
|
|
4093
|
+
() => ge(e.highlights),
|
|
4094
|
+
r
|
|
4095
|
+
) : void 0;
|
|
4096
|
+
return r.length > 0 ? { success: !1, errors: r } : { success: !0, data: l(l(l(l(l(l(l(l(l({
|
|
4097
|
+
widgetType: "custom",
|
|
4098
|
+
customWidgetType: e.customWidgetType,
|
|
4099
|
+
id: e.id
|
|
4100
|
+
}, e.title !== void 0 && { title: e.title }), e.description !== void 0 && { description: e.description }), e.dataSource !== void 0 && {
|
|
4101
|
+
dataSource: ae(e.dataSource)
|
|
4102
|
+
}), e.config !== void 0 && { config: e.config }), e.dataOptions !== void 0 && {
|
|
4103
|
+
dataOptions: e.dataOptions
|
|
4104
|
+
}), e.styleOptions !== void 0 && { styleOptions: e.styleOptions }), e.customOptions !== void 0 && {
|
|
4105
|
+
customOptions: e.customOptions
|
|
4106
|
+
}), s && s.length > 0 && {
|
|
4107
|
+
filters: s
|
|
4108
|
+
}), n && n.length > 0 && {
|
|
4109
|
+
highlights: n
|
|
4110
|
+
}) };
|
|
4111
|
+
}
|
|
4112
|
+
default:
|
|
4113
|
+
return {
|
|
4114
|
+
success: !1,
|
|
4115
|
+
errors: [
|
|
4116
|
+
{
|
|
4117
|
+
path: "widgetType",
|
|
4118
|
+
input: e,
|
|
4119
|
+
message: `Unknown widgetType: ${String(t)}`
|
|
4120
|
+
}
|
|
4121
|
+
]
|
|
4122
|
+
};
|
|
4123
|
+
}
|
|
4124
|
+
}, Ni = (e) => {
|
|
4125
|
+
const { data: t, context: r } = e, s = [], n = [];
|
|
4126
|
+
Array.isArray(t.widgets) ? t.widgets.forEach((a, u) => {
|
|
4127
|
+
const c = wi({ data: a, context: r });
|
|
4128
|
+
if (!c.success) {
|
|
4129
|
+
s.push(
|
|
4130
|
+
...er(c.errors, Zt(u))
|
|
4131
|
+
);
|
|
4132
|
+
return;
|
|
4133
|
+
}
|
|
4134
|
+
n.push(c.data);
|
|
4135
|
+
}) : s.push({
|
|
4136
|
+
path: "widgets",
|
|
4137
|
+
input: t.widgets,
|
|
4138
|
+
message: "Invalid dashboard JSON. Expected widgets to be an array."
|
|
4139
|
+
});
|
|
4140
|
+
let i = null;
|
|
4141
|
+
if (t.filters && t.filters.length > 0) {
|
|
4142
|
+
const a = re(r.tables);
|
|
4143
|
+
i = A(
|
|
4144
|
+
() => se({
|
|
4145
|
+
data: t.filters,
|
|
4146
|
+
context: { dataSource: r.dataSource, schemaIndex: a }
|
|
4147
|
+
}),
|
|
4148
|
+
s
|
|
4149
|
+
);
|
|
4150
|
+
}
|
|
4151
|
+
return s.length > 0 ? { success: !1, errors: s } : { success: !0, data: l(l(l(l(l(l(l(l({
|
|
4152
|
+
widgets: n
|
|
4153
|
+
}, t.id !== void 0 && { id: t.id }), t.title !== void 0 && { title: t.title }), i !== null && { filters: i }), t.layoutOptions !== void 0 && {
|
|
4154
|
+
layoutOptions: t.layoutOptions
|
|
4155
|
+
}), t.config !== void 0 && { config: t.config }), t.defaultDataSource !== void 0 && {
|
|
4156
|
+
defaultDataSource: t.defaultDataSource
|
|
4157
|
+
}), t.styleOptions !== void 0 && { styleOptions: t.styleOptions }), t.widgetsOptions !== void 0 && {
|
|
4158
|
+
widgetsOptions: t.widgetsOptions
|
|
4159
|
+
}) };
|
|
4160
|
+
}, Mi = (e) => {
|
|
4161
|
+
const t = [], r = [];
|
|
4162
|
+
e.widgets.forEach((o, a) => {
|
|
4163
|
+
const u = Ti(o);
|
|
4164
|
+
if (!u.success) {
|
|
4165
|
+
t.push(
|
|
4166
|
+
...er(u.errors, Zt(a))
|
|
4167
|
+
);
|
|
4168
|
+
return;
|
|
4169
|
+
}
|
|
4170
|
+
r.push(u.data);
|
|
4171
|
+
});
|
|
4172
|
+
let s;
|
|
4173
|
+
if (e.filters) {
|
|
4174
|
+
const o = A(
|
|
4175
|
+
() => ne(e.filters),
|
|
4176
|
+
t
|
|
4177
|
+
);
|
|
4178
|
+
s = o != null ? o : void 0;
|
|
4179
|
+
}
|
|
4180
|
+
if (t.length > 0)
|
|
4181
|
+
return { success: !1, errors: t };
|
|
4182
|
+
const n = e.widgetsOptions !== void 0 ? Wn(e.widgetsOptions) : void 0, i = l(l(l(l(l(l(l(l({
|
|
4183
|
+
widgets: r
|
|
4184
|
+
}, e.id !== void 0 && { id: e.id }), e.title !== void 0 && { title: e.title }), s && s.length > 0 && { filters: s }), e.layoutOptions !== void 0 && {
|
|
4185
|
+
layoutOptions: e.layoutOptions
|
|
4186
|
+
}), e.config !== void 0 && { config: e.config }), e.defaultDataSource !== void 0 && {
|
|
4187
|
+
defaultDataSource: ae(e.defaultDataSource)
|
|
4188
|
+
}), e.styleOptions !== void 0 && { styleOptions: e.styleOptions }), n !== void 0 && { widgetsOptions: n });
|
|
4189
|
+
return {
|
|
4190
|
+
success: !0,
|
|
4191
|
+
data: B(i)
|
|
3895
4192
|
};
|
|
3896
4193
|
};
|
|
3897
|
-
function
|
|
3898
|
-
const { filters: t, relations: r } =
|
|
4194
|
+
function Si(e) {
|
|
4195
|
+
const { filters: t, relations: r } = es(
|
|
3899
4196
|
e.filters || []
|
|
3900
4197
|
);
|
|
3901
4198
|
return {
|
|
@@ -3908,23 +4205,27 @@ function Jn(e) {
|
|
|
3908
4205
|
// No count/offset/ungroup - these are execution concerns, not translation concerns
|
|
3909
4206
|
};
|
|
3910
4207
|
}
|
|
3911
|
-
function
|
|
3912
|
-
const s =
|
|
3913
|
-
return
|
|
4208
|
+
function Ri(e, t, r = !1) {
|
|
4209
|
+
const s = Si(e), n = Xr(s, t);
|
|
4210
|
+
return Zr(n, r);
|
|
3914
4211
|
}
|
|
3915
4212
|
export {
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
4213
|
+
Di as CustomSuperJSON,
|
|
4214
|
+
Bi as EMPTY_EXPANDED_QUERY_MODEL,
|
|
4215
|
+
Li as EMPTY_SIMPLE_QUERY_MODEL,
|
|
4216
|
+
zi as isByIdDashboardCodeParams,
|
|
4217
|
+
Ui as isByIdWidgetCodeParams,
|
|
4218
|
+
_i as isClientSideDashboardCodeParams,
|
|
4219
|
+
Pi as isClientSideWidgetCodeParams,
|
|
4220
|
+
ii as translateChartFromJSON,
|
|
4221
|
+
oi as translateChartToJSON,
|
|
4222
|
+
Ni as translateDashboardFromJSON,
|
|
4223
|
+
Mi as translateDashboardToJSON,
|
|
4224
|
+
fi as translatePivotTableFromJSON,
|
|
4225
|
+
pi as translatePivotTableToJSON,
|
|
4226
|
+
xi as translateQueryFromJSON,
|
|
4227
|
+
vi as translateQueryToJSON,
|
|
4228
|
+
Ri as translateQueryToJaql,
|
|
4229
|
+
wi as translateWidgetFromJSON,
|
|
4230
|
+
Ti as translateWidgetToJSON
|
|
3930
4231
|
};
|