@feedmepos/mf-report 5.22.15 → 5.22.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/{App-CdZlnXKI.js → App-BVF7QlD0.js} +5 -5
  2. package/dist/{BaseDialog.vue_vue_type_script_setup_true_lang-CLwzdS2Q.js → BaseDialog.vue_vue_type_script_setup_true_lang-C0TNaWyV.js} +1504 -1367
  3. package/dist/{DateRangeSelect.vue_vue_type_script_setup_true_lang-CsDelr-w.js → DateRangeSelect.vue_vue_type_script_setup_true_lang-BZ-wqf61.js} +2 -2
  4. package/dist/{Default.vue_vue_type_script_setup_true_lang-DzDO-bfn.js → Default.vue_vue_type_script_setup_true_lang-CfIy5eDd.js} +2 -2
  5. package/dist/FilterSelector.vue_vue_type_script_setup_true_lang-DTyjD4Ns.js +5500 -0
  6. package/dist/{InsightView--U8YNngJ.js → InsightView-CcULarZa.js} +6 -6
  7. package/dist/{Integration-BECzMkNu.js → Integration-B4e12DEq.js} +4 -4
  8. package/dist/{Integrations-CKTqvI1_.js → Integrations-DKefC_8Q.js} +4 -4
  9. package/dist/{Layout-Cnc8ppRk.js → Layout-fFxDWyHb.js} +1 -1
  10. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-DwTrXeDM.js → MenuTab.vue_vue_type_script_setup_true_lang-BMmuP39v.js} +5 -5
  11. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-DU__tSUF.js → NavigationTab.vue_vue_type_script_setup_true_lang-DcX8TQAm.js} +1432 -1426
  12. package/dist/{NoData.vue_vue_type_script_setup_true_lang-yT3rD3v6.js → NoData.vue_vue_type_script_setup_true_lang-DRlDgLPG.js} +1 -1
  13. package/dist/{OverviewView-x9wDh9Ri.js → OverviewView-C0vzEN7-.js} +5 -5
  14. package/dist/{Report-CK_isrIW.js → Report-CsjhpzLP.js} +4 -4
  15. package/dist/ReportEditor-UEUbwEwl.js +1392 -0
  16. package/dist/ReportView-5nihWNrb.js +264 -0
  17. package/dist/{SelectComponent.vue_vue_type_script_setup_true_lang-COi1XhYD.js → SelectComponent.vue_vue_type_script_setup_true_lang-BDvVGWuB.js} +1 -1
  18. package/dist/{Setting-DyrGukYa.js → Setting-REox7q25.js} +5 -5
  19. package/dist/TileEditor-D23dVPsy.js +3820 -0
  20. package/dist/{TransitionFade-D4Rp-fR9.js → TransitionFade-CFT50m56.js} +11 -10
  21. package/dist/{app-Dd6GUk_Q.js → app-Bp5urT4H.js} +156 -116
  22. package/dist/app.js +1 -1
  23. package/dist/assets/{formatChartData.worker-CxcSukKp.js → formatChartData.worker-BMafyqs1.js} +22 -22
  24. package/dist/assets/{processTableData.worker-MkLoF0u4.js → processTableData.worker-SW0HOvM7.js} +7 -7
  25. package/dist/style.css +1 -1
  26. package/dist/{useRestaurantPermission-Dw-A2QGb.js → useRestaurantPermission-4IKyXsvY.js} +1 -1
  27. package/dist/{vue-i18n-Dwv_B0_J.js → vue-i18n-pKrrGi-M.js} +1 -1
  28. package/package.json +1 -1
  29. package/dist/FilterSelector.vue_vue_type_script_setup_true_lang-DgagC5F1.js +0 -5405
  30. package/dist/ReportEditor-T12VzOJa.js +0 -1104
  31. package/dist/ReportView-BC77AQD8.js +0 -264
  32. package/dist/TileEditor-B-sEmK-X.js +0 -3789
@@ -0,0 +1,3820 @@
1
+ import { defineComponent as se, mergeModels as ve, useModel as ge, computed as S, ref as ee, resolveComponent as D, createElementBlock as P, openBlock as v, createVNode as d, createElementVNode as b, unref as l, withCtx as Y, toDisplayString as J, Fragment as de, renderList as xe, withModifiers as ye, createTextVNode as Ue, watch as he, createCommentVNode as N, createBlock as O, onUnmounted as Bl, renderSlot as rl, onMounted as Ye, onBeforeUnmount as ul, resolveDynamicComponent as dl, normalizeClass as ke, withDirectives as we, vShow as Ce, withKeys as el, vModelText as Ll, normalizeStyle as Ee, isRef as Al } from "vue";
2
+ import { useRoute as Ml, useRouter as Nl } from "vue-router";
3
+ import { h as Ol, d as Re, S as We, a as zl, W as jl, c as Rl, T as Il, b as Pl } from "./TransitionFade-CFT50m56.js";
4
+ import { W as G, b as ml, e as De, D as Xl, S as ll, C as El, P as ol, a as Wl } from "./BaseDialog.vue_vue_type_script_setup_true_lang-C0TNaWyV.js";
5
+ import { storeToRefs as Se } from "pinia";
6
+ import { u as cl } from "./message-dialog-UoMWOnil.js";
7
+ import { useSnackbar as ql, useBreakpoints as pl, FmButtonColorThemeVariant as tl } from "@feedmepos/ui-library";
8
+ import { a as fe, _ as vl } from "./SelectComponent.vue_vue_type_script_setup_true_lang-BDvVGWuB.js";
9
+ import { u as ce, i as $e, b as fl } from "./vue-i18n-pKrrGi-M.js";
10
+ import { r as me } from "./i18n-CI_sQ5d_.js";
11
+ import { b as Te, u as Oe, R as al, L as Fe, c as Ne, S as le, d as ie, e as nl, f as Hl, Y as Yl, X as Gl, _ as gl, a as Jl } from "./FilterSelector.vue_vue_type_script_setup_true_lang-DTyjD4Ns.js";
12
+ import { d as ze } from "./DateRangeSelect.vue_vue_type_script_setup_true_lang-BZ-wqf61.js";
13
+ import { d as Me } from "./app-Bp5urT4H.js";
14
+ import { _ as yl } from "./NoData.vue_vue_type_script_setup_true_lang-DRlDgLPG.js";
15
+ const Ie = [
16
+ {
17
+ type: G.Circular,
18
+ maxDimension: null,
19
+ maxMetric: 1,
20
+ hasBreakdownDimension: !1,
21
+ canTranspose: !1,
22
+ isDrillConfigurable: !1,
23
+ hasChart: !0,
24
+ hasTable: !1,
25
+ hasLabel: !0,
26
+ hasLegend: !0,
27
+ hasXy: !1,
28
+ canRollup: !1,
29
+ showRollupPosition: !1,
30
+ canSearch: !1,
31
+ periodType: null
32
+ },
33
+ {
34
+ type: G.Table,
35
+ maxDimension: null,
36
+ maxMetric: null,
37
+ hasBreakdownDimension: !1,
38
+ canTranspose: !1,
39
+ isDrillConfigurable: !0,
40
+ hasChart: !1,
41
+ hasTable: !0,
42
+ hasLabel: !1,
43
+ hasLegend: !1,
44
+ hasXy: !1,
45
+ canRollup: !0,
46
+ showRollupPosition: !0,
47
+ canSearch: !0,
48
+ periodType: null
49
+ },
50
+ {
51
+ type: G.BarChart,
52
+ maxDimension: null,
53
+ maxMetric: 1,
54
+ hasBreakdownDimension: !0,
55
+ canTranspose: !0,
56
+ isDrillConfigurable: !1,
57
+ hasChart: !0,
58
+ hasTable: !1,
59
+ hasLabel: !0,
60
+ hasLegend: !0,
61
+ hasXy: !0,
62
+ canRollup: !1,
63
+ showRollupPosition: !1,
64
+ canSearch: !1,
65
+ periodType: null
66
+ },
67
+ {
68
+ type: G.LineChart,
69
+ maxDimension: null,
70
+ maxMetric: 1,
71
+ hasBreakdownDimension: !0,
72
+ canTranspose: !0,
73
+ isDrillConfigurable: !1,
74
+ hasChart: !0,
75
+ hasTable: !1,
76
+ hasLabel: !0,
77
+ hasLegend: !0,
78
+ hasXy: !0,
79
+ canRollup: !1,
80
+ showRollupPosition: !1,
81
+ canSearch: !1,
82
+ periodType: null
83
+ },
84
+ {
85
+ type: G.StackBarChart,
86
+ maxDimension: null,
87
+ maxMetric: 1,
88
+ hasBreakdownDimension: !0,
89
+ canTranspose: !0,
90
+ isDrillConfigurable: !1,
91
+ hasChart: !0,
92
+ hasTable: !1,
93
+ hasLabel: !0,
94
+ hasLegend: !0,
95
+ hasXy: !0,
96
+ canRollup: !1,
97
+ showRollupPosition: !1,
98
+ canSearch: !1,
99
+ periodType: null
100
+ },
101
+ {
102
+ type: G.ClusteredStackBarChart,
103
+ maxDimension: null,
104
+ maxMetric: 1,
105
+ hasBreakdownDimension: !0,
106
+ canTranspose: !0,
107
+ isDrillConfigurable: !1,
108
+ hasChart: !0,
109
+ hasTable: !1,
110
+ hasLabel: !0,
111
+ hasLegend: !0,
112
+ hasXy: !0,
113
+ canRollup: !1,
114
+ showRollupPosition: !1,
115
+ canSearch: !1,
116
+ periodType: null
117
+ },
118
+ {
119
+ type: G.StackLineChart,
120
+ maxDimension: null,
121
+ maxMetric: 1,
122
+ hasBreakdownDimension: !0,
123
+ canTranspose: !0,
124
+ isDrillConfigurable: !1,
125
+ hasChart: !0,
126
+ hasTable: !1,
127
+ hasLabel: !0,
128
+ hasLegend: !0,
129
+ hasXy: !0,
130
+ canRollup: !1,
131
+ showRollupPosition: !1,
132
+ canSearch: !1,
133
+ periodType: null
134
+ },
135
+ {
136
+ type: G.Scorecard,
137
+ maxDimension: null,
138
+ maxMetric: 1,
139
+ hasBreakdownDimension: !1,
140
+ canTranspose: !1,
141
+ isDrillConfigurable: !1,
142
+ hasChart: !1,
143
+ hasTable: !1,
144
+ hasLabel: !1,
145
+ hasLegend: !1,
146
+ hasXy: !1,
147
+ canRollup: !1,
148
+ showRollupPosition: !1,
149
+ canSearch: !1,
150
+ periodType: null
151
+ },
152
+ {
153
+ type: G.Spacer,
154
+ maxDimension: 0,
155
+ maxMetric: 0,
156
+ hasBreakdownDimension: !1,
157
+ canTranspose: !1,
158
+ isDrillConfigurable: !1,
159
+ hasChart: !1,
160
+ hasTable: !1,
161
+ hasLabel: !1,
162
+ hasLegend: !1,
163
+ hasXy: !1,
164
+ canRollup: !1,
165
+ showRollupPosition: !1,
166
+ canSearch: !1,
167
+ periodType: null
168
+ }
169
+ ], Kl = { class: "flex flex-col my-2 gap-8" }, Ql = { class: "fm-typo-en-body-lg-600" }, Zl = { class: "text-sm text-fm-color-neutral-gray-400" }, eo = ["onClick"], lo = { class: "fm-typo-en-body-lg-400 overflow-hidden text-ellipsis line-clamp-1" }, oo = /* @__PURE__ */ se({
170
+ __name: "SchemaSection",
171
+ props: /* @__PURE__ */ ve({
172
+ options: {
173
+ type: Array,
174
+ default: () => []
175
+ },
176
+ label: {
177
+ type: String,
178
+ default: "Schema"
179
+ }
180
+ }, {
181
+ modelValue: { required: !0 },
182
+ modelModifiers: {}
183
+ }),
184
+ emits: ["update:modelValue"],
185
+ setup(L) {
186
+ const { t: c, te: e } = ce(), i = ge(L, "modelValue"), o = L, { schemas: h } = Se(ml()), x = S(
187
+ () => h.value.map((g) => ({
188
+ label: g.label,
189
+ value: g.name,
190
+ raw: g
191
+ }))
192
+ ), p = S(() => {
193
+ if (i.value.schemaNames.length === 0 || t.value === 0)
194
+ return x.value.filter((g) => !g.raw.isJoinOnly);
195
+ {
196
+ const g = i.value.schemaNames[0], C = h.value.find(($) => $.name === g), j = ((C == null ? void 0 : C.joins) || []).map(($) => $);
197
+ return x.value.filter(($) => j.includes($.raw.name));
198
+ }
199
+ }), k = ee(!1), T = ee(""), t = ee(), s = ql();
200
+ function f(g) {
201
+ var C;
202
+ return me(
203
+ c,
204
+ e,
205
+ (C = h.value.find((j) => j.name === g)) == null ? void 0 : C.label,
206
+ "schema"
207
+ );
208
+ }
209
+ function w(g) {
210
+ t.value = g, k.value = !0, g !== void 0 ? T.value = i.value.schemaNames[g] : T.value = "";
211
+ }
212
+ function A() {
213
+ T.value !== "" ? (t.value !== void 0 ? i.value.schemaNames[t.value] = T.value : i.value.schemaNames.push(T.value), k.value = !1) : s.open({ message: c("report.section.schema.nothingSelected"), type: "error" });
214
+ }
215
+ return (g, C) => {
216
+ const j = D("FmForm"), $ = D("FmIcon"), m = D("FmField");
217
+ return v(), P("div", Kl, [
218
+ d(De, {
219
+ modelValue: k.value,
220
+ "onUpdate:modelValue": C[1] || (C[1] = (a) => k.value = a),
221
+ title: o.label,
222
+ "primary-button-label": l(c)("report.common.confirm"),
223
+ "secondary-button-label": l(c)("report.common.cancel"),
224
+ onConfirm: A
225
+ }, {
226
+ content: Y(() => [
227
+ d(j, { ref: "form" }, {
228
+ default: Y(() => [
229
+ d(fe, {
230
+ modelValue: T.value,
231
+ "onUpdate:modelValue": C[0] || (C[0] = (a) => T.value = a),
232
+ label: l(c)("report.section.schema.title"),
233
+ items: t.value === 0 ? x.value.map((a) => ({
234
+ label: l(me)(l(c), l(e), a.label, "schema"),
235
+ value: a.value
236
+ })) : p.value.map((a) => ({
237
+ label: l(me)(l(c), l(e), a.label, "schema"),
238
+ value: a.value
239
+ }))
240
+ }, null, 8, ["modelValue", "label", "items"])
241
+ ]),
242
+ _: 1
243
+ }, 512)
244
+ ]),
245
+ _: 1
246
+ }, 8, ["modelValue", "title", "primary-button-label", "secondary-button-label"]),
247
+ b("div", null, [
248
+ b("p", Ql, J(l(c)("report.section.schema.title")), 1),
249
+ b("p", Zl, J(l(c)("report.section.schema.description")), 1)
250
+ ]),
251
+ (v(!0), P(de, null, xe(i.value.schemaNames, (a, r) => (v(), P("div", {
252
+ key: r,
253
+ class: "flex flex-col gap-2 w-full"
254
+ }, [
255
+ b("div", {
256
+ class: "flex items-center gap-2 border rounded-md border-neutral-300 p-2 h-[40px]",
257
+ onClick: (n) => w(r)
258
+ }, [
259
+ b("p", lo, J(f(a)), 1),
260
+ C[3] || (C[3] = b("div", { class: "grow" }, null, -1)),
261
+ d($, {
262
+ name: "close",
263
+ onClick: ye(
264
+ () => {
265
+ i.value.schemaNames = l(Ol)(i.value.schemaNames, r);
266
+ },
267
+ ["stop"]
268
+ )
269
+ }, null, 8, ["onClick"])
270
+ ], 8, eo)
271
+ ]))), 128)),
272
+ d(m, {
273
+ class: "text-fm-color-typo-tertiary",
274
+ onClick: C[2] || (C[2] = () => {
275
+ w();
276
+ })
277
+ }, {
278
+ default: Y(() => [
279
+ Ue(J(l(c)("report.section.schema.add")), 1)
280
+ ]),
281
+ _: 1
282
+ })
283
+ ]);
284
+ };
285
+ }
286
+ }), to = {
287
+ key: 0,
288
+ class: "flex flex-col my-2 gap-8"
289
+ }, ao = { class: "fm-typo-en-body-lg-600 text-ellipsis line-clamp-1" }, no = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, io = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, Xe = /* @__PURE__ */ se({
290
+ __name: "DimensionSection",
291
+ props: /* @__PURE__ */ ve({
292
+ options: {
293
+ type: Array,
294
+ default: () => []
295
+ },
296
+ label: {
297
+ type: String,
298
+ default: "title"
299
+ },
300
+ max: {
301
+ type: Number,
302
+ default: void 0
303
+ },
304
+ config: {
305
+ type: Object,
306
+ default: () => {
307
+ }
308
+ },
309
+ hasRowColumn: {
310
+ type: Boolean,
311
+ default: !1
312
+ }
313
+ }, {
314
+ modelValue: {
315
+ required: !1,
316
+ default: []
317
+ },
318
+ modelModifiers: {}
319
+ }),
320
+ emits: ["update:modelValue"],
321
+ setup(L) {
322
+ const { t: c, te: e } = ce(), i = ge(L, "modelValue"), o = L, h = S(() => c(`report.section.dimension.${o.label}`)), x = ee(!1), p = S(
323
+ () => i.value.map((n, y) => ({
324
+ index: y,
325
+ labels: [n.label || n.name],
326
+ value: n
327
+ }))
328
+ ), k = ee(i.value.length > 0 ? 0 : void 0);
329
+ function T(n) {
330
+ var y, u, V, z;
331
+ x.value = !0, t.value = n != null && n.value ? JSON.parse(
332
+ JSON.stringify({
333
+ ...n.value,
334
+ label: me(c, e, (y = n.value) == null ? void 0 : y.label, "other"),
335
+ moveToColumn: (((u = o.config) == null ? void 0 : u.columnIds) || []).includes(Te(n.value))
336
+ })
337
+ ) : void 0, k.value = n == null ? void 0 : n.index, s.value = !!((V = t.value) != null && V.dataFormula || (z = t.value) != null && z.displayFormula), t.value && t.value.formatter === void 0 && (o.options.find(
338
+ (B) => {
339
+ var oe, Q;
340
+ return B.schemaName === ((oe = t.value) == null ? void 0 : oe.schemaName) && B.name === ((Q = t.value) == null ? void 0 : Q.name);
341
+ }
342
+ ), n != null && n.value.timeFormatter && t.value.formatter === void 0 && (t.value.formatter = n == null ? void 0 : n.value.timeFormatter, t.value.timeFormatter = void 0));
343
+ }
344
+ const t = ee(void 0), s = ee(!1), f = S(
345
+ () => o.options.find(
346
+ (n) => {
347
+ var y, u;
348
+ return n.schemaName === ((y = t.value) == null ? void 0 : y.schemaName) && n.name === ((u = t.value) == null ? void 0 : u.name);
349
+ }
350
+ ) ?? {}
351
+ );
352
+ he(
353
+ () => {
354
+ var n;
355
+ return (n = t.value) == null ? void 0 : n.option;
356
+ },
357
+ () => {
358
+ !w.value && t.value && (t.value.fillGap = !1);
359
+ }
360
+ );
361
+ const w = S(
362
+ () => {
363
+ var n, y, u;
364
+ return (u = (n = f.value) == null ? void 0 : n.fillGapDimensionOptions) == null ? void 0 : u.includes(((y = t.value) == null ? void 0 : y.option) || "");
365
+ }
366
+ );
367
+ function A(n) {
368
+ var y, u;
369
+ (n.schemaName !== ((y = t.value) == null ? void 0 : y.schemaName) || n.name !== ((u = t.value) == null ? void 0 : u.name)) && (t.value = {
370
+ schemaName: n.schemaName,
371
+ name: n.name,
372
+ option: n.dimensionOptions[0],
373
+ label: me(c, e, n.label, "other"),
374
+ decimal: n.isNumericType ? 2 : void 0,
375
+ hide: !1
376
+ }, s.value = !1);
377
+ }
378
+ function g() {
379
+ if (!t.value) {
380
+ console.error("new field is undefined");
381
+ return;
382
+ }
383
+ const n = [...p.value.map((y) => y.value)];
384
+ s.value || (t.value.dataFormula = void 0), k.value !== void 0 ? n[k.value] = t.value : n.push(t.value), i.value = n, x.value = !1;
385
+ }
386
+ function C(n) {
387
+ const u = [...p.value.map((V) => V.value)].filter((V, z) => z !== n);
388
+ i.value = u;
389
+ }
390
+ function j(n) {
391
+ t.value && (t.value.decimal = Number(n));
392
+ }
393
+ function $(n) {
394
+ const y = `report.section.filter.${$e(n)}`;
395
+ return e(y) ? c(y) : me(c, e, n, "field");
396
+ }
397
+ function m(n) {
398
+ const y = `report.section.metric.formatterType.${n}`;
399
+ return e(y) ? c(y) : n;
400
+ }
401
+ function a(n) {
402
+ return Array.isArray(n) ? n.length > 0 : n;
403
+ }
404
+ const r = S(
405
+ () => o.options.map((n) => ({
406
+ label: n.labels.join(" "),
407
+ value: n
408
+ }))
409
+ );
410
+ return (n, y) => {
411
+ const u = D("FmTextField"), V = D("FmStepperField"), z = D("FmCheckbox"), B = D("FmTextarea"), oe = D("FmForm"), Q = D("FmIcon"), re = D("FmButton"), ne = D("FmListItem"), I = D("FmList"), M = D("FmField");
412
+ return L.max !== 0 ? (v(), P("div", to, [
413
+ d(De, {
414
+ modelValue: x.value,
415
+ "onUpdate:modelValue": y[12] || (y[12] = (q) => x.value = q),
416
+ title: h.value,
417
+ "primary-button-label": l(c)("report.common.confirm"),
418
+ "secondary-button-label": l(c)("report.common.cancel"),
419
+ onConfirm: g
420
+ }, {
421
+ content: Y(() => [
422
+ d(oe, {
423
+ ref: "form",
424
+ class: "flex flex-col gap-2 w-[490px]"
425
+ }, {
426
+ default: Y(() => {
427
+ var q, te, H, pe, be, Be, Le;
428
+ return [
429
+ d(fe, {
430
+ "model-value": f.value,
431
+ items: r.value,
432
+ placeholder: h.value,
433
+ label: h.value,
434
+ "onUpdate:modelValue": y[0] || (y[0] = (Z) => A(Z))
435
+ }, null, 8, ["model-value", "items", "placeholder", "label"]),
436
+ t.value ? (v(), P(de, { key: 0 }, [
437
+ d(u, {
438
+ modelValue: t.value.label,
439
+ "onUpdate:modelValue": y[1] || (y[1] = (Z) => t.value.label = Z),
440
+ label: l(c)("report.section.dimension.label")
441
+ }, null, 8, ["modelValue", "label"]),
442
+ (((q = f.value) == null ? void 0 : q.dimensionOptions) || []).length > 0 ? (v(), O(fe, {
443
+ key: 0,
444
+ modelValue: t.value.option,
445
+ "onUpdate:modelValue": y[2] || (y[2] = (Z) => t.value.option = Z),
446
+ items: ((te = f.value) == null ? void 0 : te.dimensionOptions.map((Z) => ({
447
+ label: $(Z),
448
+ value: Z
449
+ }))) ?? []
450
+ }, null, 8, ["modelValue", "items"])) : N("", !0),
451
+ (H = f.value) != null && H.isNumericType ? (v(), O(V, {
452
+ key: 1,
453
+ label: l(c)("report.common.decimal"),
454
+ "model-value": ((pe = t.value) == null ? void 0 : pe.decimal) ?? 2,
455
+ "onUpdate:modelValue": y[3] || (y[3] = (Z) => {
456
+ j(Z);
457
+ })
458
+ }, null, 8, ["label", "model-value"])) : N("", !0),
459
+ (be = f.value) != null && be.isNumericType ? (v(), O(fe, {
460
+ key: 2,
461
+ modelValue: t.value.formatter,
462
+ "onUpdate:modelValue": y[4] || (y[4] = (Z) => t.value.formatter = Z),
463
+ placeholder: l(c)("report.section.dimension.formatter"),
464
+ label: l(c)("report.section.dimension.formatter"),
465
+ items: [
466
+ { label: l(c)("report.section.metric.formatterType.NONE"), value: null },
467
+ ...(((Be = f.value) == null ? void 0 : Be.formatters) || []).map((Z) => ({
468
+ label: m(Z),
469
+ value: Z
470
+ }))
471
+ ]
472
+ }, null, 8, ["modelValue", "placeholder", "label", "items"])) : N("", !0),
473
+ w.value ? (v(), O(z, {
474
+ key: 3,
475
+ "model-value": t.value.fillGap ?? !1,
476
+ label: l(c)("report.section.dimension.fillGap"),
477
+ value: "",
478
+ placeholder: "Fill gap",
479
+ "onUpdate:modelValue": y[5] || (y[5] = (Z) => {
480
+ t.value && (t.value.fillGap = a(Z));
481
+ })
482
+ }, null, 8, ["model-value", "label"])) : N("", !0),
483
+ ((Le = f.value) == null ? void 0 : Le.type) === l(Xl).Timestamp ? (v(), O(z, {
484
+ key: 4,
485
+ "model-value": t.value.dateComparison ?? !1,
486
+ label: l(c)("report.section.dimension.dateComparison"),
487
+ value: "",
488
+ "onUpdate:modelValue": y[6] || (y[6] = (Z) => {
489
+ t.value && (t.value.dateComparison = a(Z));
490
+ })
491
+ }, null, 8, ["model-value", "label"])) : N("", !0),
492
+ d(z, {
493
+ modelValue: t.value.hide,
494
+ "onUpdate:modelValue": y[7] || (y[7] = (Z) => t.value.hide = Z),
495
+ label: l(c)("report.section.dimension.hide"),
496
+ value: ""
497
+ }, null, 8, ["modelValue", "label"]),
498
+ o.hasRowColumn ? (v(), O(z, {
499
+ key: 5,
500
+ "model-value": t.value.moveToColumn ?? !1,
501
+ label: l(c)("report.section.dimension.moveToColumn"),
502
+ value: "",
503
+ "onUpdate:modelValue": y[8] || (y[8] = (Z) => {
504
+ t.value && (t.value.moveToColumn = a(Z));
505
+ })
506
+ }, null, 8, ["model-value", "label"])) : N("", !0),
507
+ d(z, {
508
+ modelValue: s.value,
509
+ "onUpdate:modelValue": y[9] || (y[9] = (Z) => s.value = Z),
510
+ label: l(c)("report.section.dimension.advance"),
511
+ value: !0
512
+ }, null, 8, ["modelValue", "label"]),
513
+ s.value ? (v(), O(B, {
514
+ key: 6,
515
+ modelValue: t.value.dataFormula,
516
+ "onUpdate:modelValue": y[10] || (y[10] = (Z) => t.value.dataFormula = Z),
517
+ placeholder: l(c)("report.section.dimension.dataFormula")
518
+ }, null, 8, ["modelValue", "placeholder"])) : N("", !0),
519
+ s.value ? (v(), O(B, {
520
+ key: 7,
521
+ modelValue: t.value.displayFormula,
522
+ "onUpdate:modelValue": y[11] || (y[11] = (Z) => t.value.displayFormula = Z),
523
+ placeholder: l(c)("report.section.dimension.displayFormula")
524
+ }, null, 8, ["modelValue", "placeholder"])) : N("", !0)
525
+ ], 64)) : N("", !0)
526
+ ];
527
+ }),
528
+ _: 1
529
+ }, 512)
530
+ ]),
531
+ _: 1
532
+ }, 8, ["modelValue", "title", "primary-button-label", "secondary-button-label"]),
533
+ b("div", null, [
534
+ b("p", ao, J(h.value), 1),
535
+ b("p", no, J(l(c)("report.section.dimension.description")), 1)
536
+ ]),
537
+ d(I, null, {
538
+ default: Y(() => [
539
+ d(l(Re), {
540
+ list: i.value,
541
+ "item-key": (q) => l(Te)(q),
542
+ class: "flex flex-col gap-2"
543
+ }, {
544
+ item: Y(({ element: q, index: te }) => [
545
+ d(ne, {
546
+ class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
547
+ onClick: ye((H) => T(p.value[te]), ["stop"])
548
+ }, {
549
+ default: Y(() => [
550
+ d(Q, { name: "drag_handle" }),
551
+ b("p", io, J(l(me)(l(c), l(e), q.label, "other")), 1),
552
+ y[14] || (y[14] = b("div", { class: "grow" }, null, -1)),
553
+ d(re, {
554
+ icon: "close",
555
+ size: "md",
556
+ variant: "tertiary",
557
+ onClick: ye((H) => C(te), ["stop"])
558
+ }, null, 8, ["onClick"])
559
+ ]),
560
+ _: 2
561
+ }, 1032, ["onClick"])
562
+ ]),
563
+ _: 1
564
+ }, 8, ["list", "item-key"])
565
+ ]),
566
+ _: 1
567
+ }),
568
+ d(M, {
569
+ class: "text-fm-color-typo-tertiary",
570
+ onClick: y[13] || (y[13] = () => {
571
+ T();
572
+ })
573
+ }, {
574
+ default: Y(() => [
575
+ Ue(J(l(c)("report.section.dimension.add")), 1)
576
+ ]),
577
+ _: 1
578
+ })
579
+ ])) : N("", !0);
580
+ };
581
+ }
582
+ }), qe = {
583
+ value: "_metric_name"
584
+ };
585
+ function so(L, c, e) {
586
+ switch (L) {
587
+ case G.BarChart:
588
+ case G.StackBarChart:
589
+ case G.ClusteredStackBarChart:
590
+ case G.LineChart:
591
+ case G.StackLineChart:
592
+ case G.Circular:
593
+ return c.length > 1;
594
+ default:
595
+ return e;
596
+ }
597
+ }
598
+ function ro(L) {
599
+ var i;
600
+ const { rowIds: c, columnIds: e } = je(L.widget.config);
601
+ return {
602
+ ...L,
603
+ widget: {
604
+ ...L.widget,
605
+ config: {
606
+ ...L.widget.config,
607
+ rowIds: c,
608
+ columnIds: e,
609
+ isDrillable: so(
610
+ L.widget.type,
611
+ L.widget.config.dimensions,
612
+ L.widget.config.isDrillable
613
+ ),
614
+ joinDatasources: (i = L.widget.config.joinDatasources) == null ? void 0 : i.map((o) => {
615
+ const { rowIds: h, columnIds: x } = je(o);
616
+ return {
617
+ ...o,
618
+ rowIds: h,
619
+ columnIds: x
620
+ };
621
+ })
622
+ }
623
+ }
624
+ };
625
+ }
626
+ function je(L) {
627
+ const c = L.dimensions.filter((x) => x.hide !== !0 && !x.moveToColumn).map((x) => Te(x)), e = L.dimensions.filter((x) => x.hide !== !0 && x.moveToColumn == !0).map((x) => Te(x)), i = L.metrics.length > 0;
628
+ i && L.metrics.find((x) => x.moveToRow == !0) ? c.push(qe.value) : i && e.push(qe.value);
629
+ const o = [], h = [];
630
+ for (const x of c)
631
+ o.push(x);
632
+ for (const x of e)
633
+ h.push(x);
634
+ return {
635
+ rowIds: o,
636
+ columnIds: h
637
+ };
638
+ }
639
+ const uo = { class: "flex flex-col my-2 gap-8" }, mo = { class: "fm-typo-en-body-lg-600" }, co = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, po = { class: "fm-typo-en-body-lg-400 overflow-hidden text-ellipsis line-clamp-1" }, vo = /* @__PURE__ */ se({
640
+ __name: "MetricSection",
641
+ props: /* @__PURE__ */ ve({
642
+ options: {
643
+ type: Array,
644
+ default: () => []
645
+ },
646
+ label: {
647
+ type: String,
648
+ default: "title"
649
+ },
650
+ max: {
651
+ type: Number,
652
+ default: void 0
653
+ },
654
+ config: {
655
+ type: Object,
656
+ default: () => {
657
+ }
658
+ },
659
+ hasRowColumn: {
660
+ type: Boolean,
661
+ default: !1
662
+ },
663
+ hasXy: {
664
+ type: Boolean,
665
+ default: !1
666
+ }
667
+ }, {
668
+ modelValue: { required: !1, default: [] },
669
+ modelModifiers: {}
670
+ }),
671
+ emits: /* @__PURE__ */ ve(["config"], ["update:modelValue"]),
672
+ setup(L, { emit: c }) {
673
+ const { t: e, te: i } = ce(), o = ge(L, "modelValue"), h = L;
674
+ S(() => !!h.max && o.value.length === h.max);
675
+ const x = S(() => e(`report.section.metric.${h.label}`)), p = ee(!1), k = S(
676
+ () => o.value.map((a, r) => ({
677
+ index: r,
678
+ labels: [a.label || a.name],
679
+ value: a
680
+ }))
681
+ ), T = ee(o.value.length > 0 ? 0 : void 0);
682
+ function t(a) {
683
+ var r, n, y;
684
+ p.value = !0, s.value = a != null && a.value ? JSON.parse(
685
+ JSON.stringify({
686
+ ...a.value,
687
+ label: me(e, i, a.value.label, "other")
688
+ })
689
+ ) : void 0, T.value = a == null ? void 0 : a.index, f.value = !!((r = s.value) != null && r.dataFormula || (n = s.value) != null && n.displayFormula), s.value && s.value.formatter === void 0 && (h.options.find(
690
+ (u) => {
691
+ var V, z;
692
+ return u.schemaName === ((V = s.value) == null ? void 0 : V.schemaName) && u.name === ((z = s.value) == null ? void 0 : z.name);
693
+ }
694
+ ), a != null && a.value.timeFormatter && s.value.formatter === void 0 && (s.value.formatter = a == null ? void 0 : a.value.timeFormatter, s.value.timeFormatter = void 0)), ((y = h.config.rowIds) == null ? void 0 : y.findIndex((u) => u === qe.value)) !== -1 && s.value && (s.value.moveToRow = !0), s.value && (!h.hasXy || s.value.nullable === void 0) && (s.value.nullable = !1);
695
+ }
696
+ const s = ee(void 0), f = ee(!1), w = S(
697
+ () => h.options.find(
698
+ (a) => {
699
+ var r, n;
700
+ return a.schemaName === ((r = s.value) == null ? void 0 : r.schemaName) && a.name === ((n = s.value) == null ? void 0 : n.name);
701
+ }
702
+ ) ?? {}
703
+ );
704
+ function A(a, r) {
705
+ var n;
706
+ return (a == null ? void 0 : a.isNumericType) || ((n = a == null ? void 0 : a.isNumericAggregations) == null ? void 0 : n.includes(r || ""));
707
+ }
708
+ const g = S(
709
+ () => {
710
+ var a;
711
+ return A(w.value, (a = s.value) == null ? void 0 : a.aggregation);
712
+ }
713
+ );
714
+ he(g, (a) => {
715
+ s.value && (a ? s.value.decimal = typeof s.value.decimal != "number" ? 2 : s.value.decimal : s.value.decimal = void 0);
716
+ });
717
+ function C(a) {
718
+ var r, n;
719
+ (a.schemaName !== ((r = s.value) == null ? void 0 : r.schemaName) || a.name !== ((n = s.value) == null ? void 0 : n.name)) && (s.value = {
720
+ schemaName: a.schemaName,
721
+ name: a.name,
722
+ aggregation: a.aggregations[0],
723
+ label: me(e, i, a.label, "other"),
724
+ nullable: !1,
725
+ decimal: A(a, a.aggregations[0]) ? 2 : void 0,
726
+ moveToRow: !1,
727
+ hide: !1
728
+ }, f.value = !1);
729
+ }
730
+ function j() {
731
+ const a = [...k.value.map((r) => r.value)];
732
+ s.value && (f.value || (s.value.dataFormula = void 0), h.hasXy || (s.value.nullable = !1), T.value !== void 0 ? a[T.value] = s.value : a.push(s.value)), o.value = a, p.value = !1;
733
+ }
734
+ function $(a) {
735
+ const r = [...k.value.map((n) => n.value)];
736
+ r.splice(a, 1), o.value = r;
737
+ }
738
+ const m = S(
739
+ () => h.options.map((a) => ({
740
+ label: a.labels.join(" "),
741
+ value: a
742
+ }))
743
+ );
744
+ return (a, r) => {
745
+ const n = D("FmTextField"), y = D("FmStepperField"), u = D("FmCheckbox"), V = D("FmTextarea"), z = D("FmForm"), B = D("FmIcon"), oe = D("FmButton"), Q = D("FmListItem"), re = D("FmList"), ne = D("FmField");
746
+ return v(), P("div", uo, [
747
+ d(De, {
748
+ modelValue: p.value,
749
+ "onUpdate:modelValue": r[11] || (r[11] = (I) => p.value = I),
750
+ title: x.value,
751
+ onConfirm: j
752
+ }, {
753
+ content: Y(() => [
754
+ d(z, {
755
+ ref: "form",
756
+ class: "flex flex-col gap-2 w-[490px]"
757
+ }, {
758
+ default: Y(() => {
759
+ var I, M, q, te;
760
+ return [
761
+ d(fe, {
762
+ "model-value": w.value,
763
+ items: m.value,
764
+ placeholder: x.value,
765
+ label: x.value,
766
+ "onUpdate:modelValue": r[0] || (r[0] = (H) => C(H))
767
+ }, null, 8, ["model-value", "items", "placeholder", "label"]),
768
+ s.value ? (v(), P(de, { key: 0 }, [
769
+ d(n, {
770
+ modelValue: s.value.label,
771
+ "onUpdate:modelValue": r[1] || (r[1] = (H) => s.value.label = H),
772
+ label: l(e)("report.section.metric.label")
773
+ }, null, 8, ["modelValue", "label"]),
774
+ (((I = w.value) == null ? void 0 : I.aggregations) || []).length > 0 ? (v(), O(fe, {
775
+ key: 0,
776
+ modelValue: s.value.aggregation,
777
+ "onUpdate:modelValue": r[2] || (r[2] = (H) => s.value.aggregation = H),
778
+ label: l(e)("report.section.metric.aggregation"),
779
+ items: ((M = w.value) == null ? void 0 : M.aggregations.map((H) => ({
780
+ label: l(i)(`report.section.metric.aggregationType.${H}`) ? l(e)(`report.section.metric.aggregationType.${H}`) : l(me)(l(e), l(i), H, "field"),
781
+ value: H
782
+ }))) ?? []
783
+ }, null, 8, ["modelValue", "label", "items"])) : N("", !0),
784
+ g.value ? (v(), O(y, {
785
+ key: 1,
786
+ label: l(e)("report.common.decimal"),
787
+ "model-value": ((q = s.value) == null ? void 0 : q.decimal) ?? 2,
788
+ "onUpdate:modelValue": r[3] || (r[3] = (H) => {
789
+ s.value && (s.value.decimal = H);
790
+ })
791
+ }, null, 8, ["label", "model-value"])) : N("", !0),
792
+ g.value ? (v(), O(fe, {
793
+ key: 2,
794
+ modelValue: s.value.formatter,
795
+ "onUpdate:modelValue": r[4] || (r[4] = (H) => s.value.formatter = H),
796
+ placeholder: l(e)("report.section.metric.formatter"),
797
+ label: l(e)("report.section.metric.formatter"),
798
+ items: [
799
+ { label: l(e)("report.section.metric.formatterType.NONE"), value: null },
800
+ ...(((te = w.value) == null ? void 0 : te.formatters) || []).map((H) => ({
801
+ label: l(i)(`report.section.metric.formatterType.${H}`) ? l(e)(`report.section.metric.formatterType.${H}`) : l(me)(l(e), l(i), H, "field"),
802
+ value: H
803
+ }))
804
+ ]
805
+ }, null, 8, ["modelValue", "placeholder", "label", "items"])) : N("", !0),
806
+ d(u, {
807
+ modelValue: s.value.hide,
808
+ "onUpdate:modelValue": r[5] || (r[5] = (H) => s.value.hide = H),
809
+ label: l(e)("report.section.metric.hide"),
810
+ value: ""
811
+ }, null, 8, ["modelValue", "label"]),
812
+ h.hasXy ? (v(), O(u, {
813
+ key: 3,
814
+ "model-value": s.value.nullable ?? !1,
815
+ label: l(e)("report.section.metric.nullable"),
816
+ value: !0,
817
+ "onUpdate:modelValue": r[6] || (r[6] = (H) => {
818
+ s.value && (s.value.nullable = H);
819
+ })
820
+ }, null, 8, ["model-value", "label"])) : N("", !0),
821
+ h.hasRowColumn ? (v(), O(u, {
822
+ key: 4,
823
+ modelValue: s.value.moveToRow,
824
+ "onUpdate:modelValue": r[7] || (r[7] = (H) => s.value.moveToRow = H),
825
+ label: l(e)("report.section.metric.moveToRow"),
826
+ value: ""
827
+ }, null, 8, ["modelValue", "label"])) : N("", !0),
828
+ d(u, {
829
+ modelValue: f.value,
830
+ "onUpdate:modelValue": r[8] || (r[8] = (H) => f.value = H),
831
+ label: l(e)("report.section.metric.advance"),
832
+ value: !0
833
+ }, null, 8, ["modelValue", "label"]),
834
+ f.value ? (v(), O(V, {
835
+ key: 5,
836
+ modelValue: s.value.dataFormula,
837
+ "onUpdate:modelValue": r[9] || (r[9] = (H) => s.value.dataFormula = H),
838
+ placeholder: l(e)("report.section.metric.dataFormula")
839
+ }, null, 8, ["modelValue", "placeholder"])) : N("", !0),
840
+ f.value ? (v(), O(V, {
841
+ key: 6,
842
+ modelValue: s.value.displayFormula,
843
+ "onUpdate:modelValue": r[10] || (r[10] = (H) => s.value.displayFormula = H),
844
+ placeholder: l(e)("report.section.metric.displayFormula")
845
+ }, null, 8, ["modelValue", "placeholder"])) : N("", !0)
846
+ ], 64)) : N("", !0)
847
+ ];
848
+ }),
849
+ _: 1
850
+ }, 512)
851
+ ]),
852
+ _: 1
853
+ }, 8, ["modelValue", "title"]),
854
+ b("div", null, [
855
+ b("p", mo, J(x.value), 1),
856
+ b("p", co, J(l(e)("report.section.metric.description")), 1)
857
+ ]),
858
+ d(re, null, {
859
+ default: Y(() => [
860
+ d(l(Re), {
861
+ list: o.value,
862
+ "item-key": "id",
863
+ class: "flex flex-col gap-2 w-full"
864
+ }, {
865
+ item: Y(({ element: I, index: M }) => [
866
+ d(Q, {
867
+ class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
868
+ onClick: ye((q) => t(k.value[M]), ["stop"])
869
+ }, {
870
+ default: Y(() => [
871
+ d(B, { name: "drag_handle" }),
872
+ b("p", po, J(l(me)(l(e), l(i), I.label, "other")), 1),
873
+ r[13] || (r[13] = b("div", { class: "grow" }, null, -1)),
874
+ d(oe, {
875
+ icon: "close",
876
+ size: "md",
877
+ variant: "tertiary",
878
+ onClick: ye((q) => $(M), ["stop"])
879
+ }, null, 8, ["onClick"])
880
+ ]),
881
+ _: 2
882
+ }, 1032, ["onClick"])
883
+ ]),
884
+ _: 1
885
+ }, 8, ["list"])
886
+ ]),
887
+ _: 1
888
+ }),
889
+ d(ne, {
890
+ class: "text-fm-color-typo-tertiary",
891
+ onClick: r[12] || (r[12] = () => {
892
+ t();
893
+ })
894
+ }, {
895
+ default: Y(() => [
896
+ Ue(J(l(e)("report.section.metric.add")), 1)
897
+ ]),
898
+ _: 1
899
+ })
900
+ ]);
901
+ };
902
+ }
903
+ }), fo = { class: "flex flex-col my-2 gap-8" }, go = { class: "fm-typo-en-body-lg-600" }, yo = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, bo = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, ho = /* @__PURE__ */ se({
904
+ __name: "SortSection",
905
+ props: /* @__PURE__ */ ve({
906
+ options: {
907
+ type: Array,
908
+ default: () => []
909
+ },
910
+ label: {
911
+ type: String,
912
+ default: "title"
913
+ }
914
+ }, {
915
+ modelValue: { required: !1, default: [] },
916
+ modelModifiers: {}
917
+ }),
918
+ emits: ["update:modelValue"],
919
+ setup(L) {
920
+ const { t: c, te: e } = ce(), i = ge(L, "modelValue"), o = L, h = S(() => c(`report.section.sort.${o.label}`)), x = ee(!1), p = S(
921
+ () => i.value.map(($, m) => {
922
+ const a = o.options.find(
923
+ (n) => n.schemaName === $.schemaName && n.name === $.name
924
+ ), r = (a == null ? void 0 : a.labels) || [$.schemaName, $.name];
925
+ return {
926
+ index: m,
927
+ label: r.map((n) => me(c, e, n, "other")).join(" "),
928
+ value: $
929
+ };
930
+ })
931
+ ), k = ee(i.value.length > 0 ? 0 : void 0);
932
+ function T($) {
933
+ var m;
934
+ x.value = !0, t.value = $ != null && $.value ? JSON.parse(JSON.stringify($.value)) : void 0, k.value = $ == null ? void 0 : $.index, s.value = !!((m = t.value) != null && m.dataFormula);
935
+ }
936
+ const t = ee(void 0), s = ee(!1), f = S(
937
+ () => o.options.find(
938
+ ($) => {
939
+ var m, a;
940
+ return $.schemaName === ((m = t.value) == null ? void 0 : m.schemaName) && $.name === ((a = t.value) == null ? void 0 : a.name);
941
+ }
942
+ ) ?? {}
943
+ );
944
+ function w($) {
945
+ var m, a;
946
+ ($.schemaName !== ((m = t.value) == null ? void 0 : m.schemaName) || $.name !== ((a = t.value) == null ? void 0 : a.name)) && (t.value = {
947
+ schemaName: $.schemaName,
948
+ name: $.name,
949
+ dimensionOption: $.dimensionOptions[0],
950
+ aggregation: null,
951
+ type: ll.Asc
952
+ });
953
+ }
954
+ function A() {
955
+ if (!t.value) {
956
+ console.log("new sort is undefined");
957
+ return;
958
+ }
959
+ const $ = [...p.value.map((m) => m.value)];
960
+ s.value || (t.value.dataFormula = void 0), k.value !== void 0 ? $[k.value] = t.value : $.push(t.value), i.value = $, x.value = !1;
961
+ }
962
+ function g($) {
963
+ const m = [...p.value.map((a) => a.value)];
964
+ m.splice($, 1), i.value = m, x.value = !1;
965
+ }
966
+ function C($) {
967
+ const m = `report.section.filter.${$e($)}`;
968
+ return e(m) ? c(m) : me(c, e, $, "field");
969
+ }
970
+ const j = S(
971
+ () => o.options.map(($) => ({
972
+ label: $.labels.join(" "),
973
+ value: $
974
+ }))
975
+ );
976
+ return ($, m) => {
977
+ const a = D("FmCheckbox"), r = D("FmTextarea"), n = D("FmForm"), y = D("FmIcon"), u = D("FmButton"), V = D("FmListItem"), z = D("FmList"), B = D("FmField");
978
+ return v(), P("div", fo, [
979
+ d(De, {
980
+ modelValue: x.value,
981
+ "onUpdate:modelValue": m[6] || (m[6] = (oe) => x.value = oe),
982
+ title: h.value,
983
+ onConfirm: A
984
+ }, {
985
+ content: Y(() => [
986
+ d(n, {
987
+ ref: "form",
988
+ class: "flex flex-col gap-2 w-[490px]"
989
+ }, {
990
+ default: Y(() => {
991
+ var oe, Q, re, ne;
992
+ return [
993
+ d(fe, {
994
+ "model-value": f.value,
995
+ items: j.value,
996
+ placeholder: h.value,
997
+ label: h.value,
998
+ "onUpdate:modelValue": m[0] || (m[0] = (I) => w(I))
999
+ }, null, 8, ["model-value", "items", "placeholder", "label"]),
1000
+ t.value ? (v(), P(de, { key: 0 }, [
1001
+ (((oe = f.value) == null ? void 0 : oe.dimensionOptions) || []).length > 0 ? (v(), O(fe, {
1002
+ key: 0,
1003
+ modelValue: t.value.dimensionOption,
1004
+ "onUpdate:modelValue": m[1] || (m[1] = (I) => t.value.dimensionOption = I),
1005
+ items: ((Q = f.value) == null ? void 0 : Q.dimensionOptions.map((I) => ({
1006
+ label: C(I),
1007
+ value: I
1008
+ }))) ?? [],
1009
+ placeholder: l(c)("report.section.sort.format"),
1010
+ label: l(c)("report.section.sort.format")
1011
+ }, null, 8, ["modelValue", "items", "placeholder", "label"])) : N("", !0),
1012
+ (((re = f.value) == null ? void 0 : re.aggregations) || []).length > 0 ? (v(), O(fe, {
1013
+ key: 1,
1014
+ modelValue: t.value.aggregation,
1015
+ "onUpdate:modelValue": m[2] || (m[2] = (I) => t.value.aggregation = I),
1016
+ items: ((ne = f.value) == null ? void 0 : ne.aggregations.map((I) => ({
1017
+ label: l(e)(`report.section.metric.aggregationType.${I}`) ? l(c)(`report.section.metric.aggregationType.${I}`) : I,
1018
+ value: I
1019
+ }))) ?? [],
1020
+ label: l(c)("report.section.sort.aggregation"),
1021
+ placeholder: l(c)("report.section.sort.aggregation")
1022
+ }, null, 8, ["modelValue", "items", "label", "placeholder"])) : N("", !0),
1023
+ d(fe, {
1024
+ modelValue: t.value.type,
1025
+ "onUpdate:modelValue": m[3] || (m[3] = (I) => t.value.type = I),
1026
+ items: Object.values(l(ll)).map((I) => ({
1027
+ label: l(e)(`report.section.sort.sortType.${I}`) ? l(c)(`report.section.sort.sortType.${I}`) : I,
1028
+ value: I
1029
+ })),
1030
+ placeholder: l(c)("report.section.sort.order"),
1031
+ label: l(c)("report.section.sort.order")
1032
+ }, null, 8, ["modelValue", "items", "placeholder", "label"]),
1033
+ d(a, {
1034
+ modelValue: s.value,
1035
+ "onUpdate:modelValue": m[4] || (m[4] = (I) => s.value = I),
1036
+ label: l(c)("report.section.sort.advance"),
1037
+ value: !0
1038
+ }, null, 8, ["modelValue", "label"]),
1039
+ s.value ? (v(), O(r, {
1040
+ key: 2,
1041
+ modelValue: t.value.dataFormula,
1042
+ "onUpdate:modelValue": m[5] || (m[5] = (I) => t.value.dataFormula = I),
1043
+ placeholder: l(c)("report.section.sort.dataFormula")
1044
+ }, null, 8, ["modelValue", "placeholder"])) : N("", !0)
1045
+ ], 64)) : N("", !0)
1046
+ ];
1047
+ }),
1048
+ _: 1
1049
+ }, 512)
1050
+ ]),
1051
+ _: 1
1052
+ }, 8, ["modelValue", "title"]),
1053
+ b("div", null, [
1054
+ b("p", go, J(h.value), 1),
1055
+ b("p", yo, J(l(c)("report.section.sort.description")), 1)
1056
+ ]),
1057
+ d(z, null, {
1058
+ default: Y(() => [
1059
+ d(l(Re), {
1060
+ list: i.value,
1061
+ "item-key": "id",
1062
+ class: "flex flex-col gap-2 w-full"
1063
+ }, {
1064
+ item: Y(({ element: oe, index: Q }) => [
1065
+ d(V, {
1066
+ class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
1067
+ onClick: ye((re) => T(p.value[Q]), ["stop"])
1068
+ }, {
1069
+ default: Y(() => [
1070
+ d(y, { name: "drag_handle" }),
1071
+ b("p", bo, J(p.value[Q].label), 1),
1072
+ m[8] || (m[8] = b("div", { class: "grow" }, null, -1)),
1073
+ d(u, {
1074
+ icon: "close",
1075
+ size: "md",
1076
+ variant: "tertiary",
1077
+ onClick: ye((re) => g(Q), ["stop"])
1078
+ }, null, 8, ["onClick"])
1079
+ ]),
1080
+ _: 2
1081
+ }, 1032, ["onClick"])
1082
+ ]),
1083
+ _: 1
1084
+ }, 8, ["list"])
1085
+ ]),
1086
+ _: 1
1087
+ }),
1088
+ d(B, {
1089
+ class: "text-fm-color-typo-tertiary",
1090
+ onClick: m[7] || (m[7] = () => {
1091
+ T();
1092
+ })
1093
+ }, {
1094
+ default: Y(() => [
1095
+ Ue(J(l(c)("report.section.sort.add")), 1)
1096
+ ]),
1097
+ _: 1
1098
+ })
1099
+ ]);
1100
+ };
1101
+ }
1102
+ }), wo = { class: "fm-typo-en-body-lg-600" }, Co = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, xo = /* @__PURE__ */ se({
1103
+ __name: "LimitSection",
1104
+ props: {
1105
+ modelValue: { required: !0, default: null },
1106
+ modelModifiers: {}
1107
+ },
1108
+ emits: ["update:modelValue"],
1109
+ setup(L) {
1110
+ const { t: c } = ce(), e = ge(L, "modelValue"), i = ze((o) => {
1111
+ o !== "" ? e.value = o : e.value = null;
1112
+ }, 1e3);
1113
+ return (o, h) => {
1114
+ const x = D("FmTextField");
1115
+ return v(), P(de, null, [
1116
+ b("div", null, [
1117
+ b("p", wo, J(l(c)("report.section.limit.title")), 1),
1118
+ b("p", Co, J(l(c)("report.section.limit.description")), 1)
1119
+ ]),
1120
+ d(x, {
1121
+ "model-value": e.value,
1122
+ inputmode: "numeric",
1123
+ placeholder: l(c)("report.section.limit.placeholder"),
1124
+ "onUpdate:modelValue": h[0] || (h[0] = (p) => l(i)(p))
1125
+ }, null, 8, ["model-value", "placeholder"])
1126
+ ], 64);
1127
+ };
1128
+ }
1129
+ }), Vo = { class: "flex flex-col my-2 gap-8" }, Fo = { class: "fm-typo-en-body-lg-600" }, ko = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, _o = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, So = /* @__PURE__ */ se({
1130
+ __name: "ConditionSection",
1131
+ props: /* @__PURE__ */ ve({
1132
+ joinFieldOptions: {
1133
+ type: Array,
1134
+ default: () => []
1135
+ },
1136
+ mainFieldOptions: {
1137
+ type: Array,
1138
+ default: () => []
1139
+ },
1140
+ label: {
1141
+ type: String,
1142
+ default: "title"
1143
+ }
1144
+ }, {
1145
+ modelValue: { required: !0 },
1146
+ modelModifiers: {}
1147
+ }),
1148
+ emits: ["update:modelValue"],
1149
+ setup(L) {
1150
+ const { t: c, te: e } = ce(), i = ge(L, "modelValue"), o = L, h = S(() => c(`report.section.condition.${o.label}`)), x = ee(!1), p = S(
1151
+ () => i.value.map((m, a) => {
1152
+ var y, u;
1153
+ const r = o.joinFieldOptions.find(
1154
+ (V) => {
1155
+ var z, B;
1156
+ return V.schemaName === ((z = m.joinDimension) == null ? void 0 : z.schemaName) && V.name === ((B = m.joinDimension) == null ? void 0 : B.name);
1157
+ }
1158
+ ), n = (r == null ? void 0 : r.labels) || [
1159
+ (y = m.joinDimension) == null ? void 0 : y.schemaName,
1160
+ (u = m.joinDimension) == null ? void 0 : u.name
1161
+ ];
1162
+ return {
1163
+ index: a,
1164
+ label: n.map((V) => me(c, e, V, "other")).join(" "),
1165
+ value: m
1166
+ };
1167
+ })
1168
+ ), k = ee(i.value.length > 0 ? 0 : void 0);
1169
+ function T(m) {
1170
+ m ? (t.value = m != null && m.value ? JSON.parse(JSON.stringify(m.value)) : void 0, k.value = m == null ? void 0 : m.index) : (t.value = {
1171
+ joinDimension: null,
1172
+ operator: "",
1173
+ mainDimensions: []
1174
+ }, k.value = void 0), x.value = !0;
1175
+ }
1176
+ const t = ee(void 0), s = S(
1177
+ () => o.joinFieldOptions.find(
1178
+ (m) => {
1179
+ var a, r;
1180
+ return m.schemaName === ((r = (a = t.value) == null ? void 0 : a.joinDimension) == null ? void 0 : r.schemaName) && m.name === t.value.joinDimension.name;
1181
+ }
1182
+ ) ?? {}
1183
+ ), f = S(
1184
+ () => {
1185
+ var m;
1186
+ return (((m = t.value) == null ? void 0 : m.mainDimensions) || []).map(
1187
+ (a) => o.mainFieldOptions.find(
1188
+ (r) => r.schemaName === (a == null ? void 0 : a.schemaName) && r.name === a.name
1189
+ ) ?? {}
1190
+ );
1191
+ }
1192
+ ), w = S(
1193
+ () => o.joinFieldOptions.map((m) => ({ label: m.labels.join(" "), value: m }))
1194
+ );
1195
+ function A(m) {
1196
+ var a, r, n, y;
1197
+ t.value && (t.value && m.schemaName !== ((r = (a = t.value) == null ? void 0 : a.joinDimension) == null ? void 0 : r.schemaName) || m.name !== ((y = (n = t.value) == null ? void 0 : n.joinDimension) == null ? void 0 : y.name)) && (t.value = {
1198
+ ...t.value,
1199
+ joinDimension: {
1200
+ schemaName: m.schemaName,
1201
+ name: m.name,
1202
+ option: m.dimensionOptions[0],
1203
+ label: `_${m.label}`,
1204
+ hide: !0
1205
+ }
1206
+ }, m.joinConditionOperators.includes(t.value.operator) || C(m.joinConditionOperators[0]));
1207
+ }
1208
+ function g(m, a) {
1209
+ var r, n, y, u;
1210
+ if (t.value && a >= 0 && (t.value && m.schemaName !== ((n = (r = t.value) == null ? void 0 : r.mainDimensions[a]) == null ? void 0 : n.schemaName) || m.name !== ((u = (y = t.value) == null ? void 0 : y.mainDimensions[a]) == null ? void 0 : u.name))) {
1211
+ const V = [...t.value.mainDimensions];
1212
+ V[a] = {
1213
+ schemaName: m.schemaName,
1214
+ name: m.name,
1215
+ option: m.dimensionOptions[0],
1216
+ label: m.label,
1217
+ hide: !0
1218
+ }, t.value = {
1219
+ ...t.value,
1220
+ mainDimensions: V
1221
+ };
1222
+ }
1223
+ }
1224
+ function C(m) {
1225
+ if (t.value)
1226
+ switch (m) {
1227
+ case El.Between:
1228
+ t.value = {
1229
+ ...t.value,
1230
+ operator: m,
1231
+ mainDimensions: [null, null]
1232
+ };
1233
+ break;
1234
+ default:
1235
+ t.value = {
1236
+ ...t.value,
1237
+ operator: m,
1238
+ mainDimensions: [null]
1239
+ };
1240
+ break;
1241
+ }
1242
+ }
1243
+ function j() {
1244
+ const m = [...p.value.map((a) => a.value)];
1245
+ t.value && (t.value.mainDimensions = t.value.mainDimensions.filter(
1246
+ (a) => a !== "" && a != null
1247
+ ), k.value !== void 0 ? m[k.value] = t.value : m.push(t.value)), i.value = m, x.value = !1;
1248
+ }
1249
+ function $(m) {
1250
+ const a = [...p.value.map((r) => r.value)];
1251
+ a.splice(m, 1), i.value = a;
1252
+ }
1253
+ return (m, a) => {
1254
+ const r = D("FmMenuDivider"), n = D("FmForm"), y = D("FmIcon"), u = D("FmButton"), V = D("FmListItem"), z = D("FmList"), B = D("FmField");
1255
+ return v(), P("div", Vo, [
1256
+ d(De, {
1257
+ modelValue: x.value,
1258
+ "onUpdate:modelValue": a[2] || (a[2] = (oe) => x.value = oe),
1259
+ title: h.value,
1260
+ onConfirm: j
1261
+ }, {
1262
+ content: Y(() => [
1263
+ d(n, {
1264
+ ref: "form",
1265
+ class: "flex flex-col gap-2 w-[490px]"
1266
+ }, {
1267
+ default: Y(() => {
1268
+ var oe, Q, re, ne, I;
1269
+ return [
1270
+ d(fe, {
1271
+ label: l(c)("report.section.condition.joinDatasource"),
1272
+ "model-value": s.value,
1273
+ items: w.value,
1274
+ placeholder: l(c)("report.section.condition.joinDimension"),
1275
+ "onUpdate:modelValue": a[0] || (a[0] = (M) => A(M))
1276
+ }, null, 8, ["label", "model-value", "items", "placeholder"]),
1277
+ d(r),
1278
+ (oe = t.value) != null && oe.joinDimension && (((Q = s.value) == null ? void 0 : Q.dimensionOptions) || []).length > 0 ? (v(), O(fe, {
1279
+ key: 0,
1280
+ modelValue: t.value.joinDimension.option,
1281
+ "onUpdate:modelValue": a[1] || (a[1] = (M) => t.value.joinDimension.option = M),
1282
+ label: l(c)("report.section.condition.format"),
1283
+ items: ((re = s.value) == null ? void 0 : re.dimensionOptions.map((M) => ({
1284
+ label: l(e)(`report.section.filter.${l($e)(M)}`) ? l(c)(`report.section.filter.${l($e)(M)}`) : M,
1285
+ value: M
1286
+ }))) ?? []
1287
+ }, null, 8, ["modelValue", "label", "items"])) : N("", !0),
1288
+ t.value && (((ne = s.value) == null ? void 0 : ne.joinConditionOperators) || []).length > 0 ? (v(), O(fe, {
1289
+ key: 1,
1290
+ "model-value": t.value.operator,
1291
+ label: l(c)("report.section.condition.operator"),
1292
+ items: s.value.joinConditionOperators.map((M) => ({
1293
+ label: l(c)("report.section.comparisonOperator." + M),
1294
+ value: M
1295
+ })) ?? [],
1296
+ "onUpdate:modelValue": C
1297
+ }, null, 8, ["model-value", "label", "items"])) : N("", !0),
1298
+ (v(!0), P(de, null, xe(((I = t.value) == null ? void 0 : I.mainDimensions) || [], (M, q) => {
1299
+ var te, H;
1300
+ return v(), P("div", {
1301
+ key: q,
1302
+ class: "flex flex-col gap-2"
1303
+ }, [
1304
+ d(fe, {
1305
+ "model-value": f.value[q],
1306
+ label: l(c)("report.section.condition.mainDatasource", { index: q + 1 }),
1307
+ items: o.mainFieldOptions.map((pe) => ({
1308
+ label: pe.labels.join(" "),
1309
+ value: pe
1310
+ })),
1311
+ "onUpdate:modelValue": (pe) => g(pe, q)
1312
+ }, null, 8, ["model-value", "label", "items", "onUpdate:modelValue"]),
1313
+ M && (((te = f.value[q]) == null ? void 0 : te.dimensionOptions) || []).length > 0 && M ? (v(), O(fe, {
1314
+ key: 0,
1315
+ modelValue: M.option,
1316
+ "onUpdate:modelValue": (pe) => M.option = pe,
1317
+ items: (H = f.value[q]) == null ? void 0 : H.dimensionOptions.map((pe) => ({
1318
+ label: l(e)(`report.section.filter.${l($e)(pe)}`) ? l(c)(`report.section.filter.${l($e)(pe)}`) : pe,
1319
+ value: pe
1320
+ }))
1321
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "items"])) : N("", !0),
1322
+ d(r)
1323
+ ]);
1324
+ }), 128))
1325
+ ];
1326
+ }),
1327
+ _: 1
1328
+ }, 512)
1329
+ ]),
1330
+ _: 1
1331
+ }, 8, ["modelValue", "title"]),
1332
+ b("div", null, [
1333
+ b("p", Fo, J(h.value), 1),
1334
+ b("p", ko, J(l(c)("report.section.condition.description")), 1)
1335
+ ]),
1336
+ d(z, { class: "flex flex-col gap-2" }, {
1337
+ default: Y(() => [
1338
+ d(l(Re), {
1339
+ list: i.value,
1340
+ "item-key": (oe) => {
1341
+ var Q, re;
1342
+ return `${(Q = oe.joinDimension) == null ? void 0 : Q.schemaName}:${(re = oe.joinDimension) == null ? void 0 : re.name}`;
1343
+ },
1344
+ class: "flex flex-col gap-2 w-full"
1345
+ }, {
1346
+ item: Y(({ element: oe, index: Q }) => [
1347
+ d(V, {
1348
+ class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
1349
+ onClick: ye((re) => T(p.value[Q]), ["stop"])
1350
+ }, {
1351
+ default: Y(() => [
1352
+ d(y, { name: "drag_handle" }),
1353
+ b("p", _o, J(p.value[Q].label), 1),
1354
+ a[4] || (a[4] = b("div", { class: "grow" }, null, -1)),
1355
+ d(u, {
1356
+ icon: "close",
1357
+ size: "md",
1358
+ variant: "tertiary",
1359
+ onClick: ye((re) => $(Q), ["stop"])
1360
+ }, null, 8, ["onClick"])
1361
+ ]),
1362
+ _: 2
1363
+ }, 1032, ["onClick"])
1364
+ ]),
1365
+ _: 1
1366
+ }, 8, ["list", "item-key"])
1367
+ ]),
1368
+ _: 1
1369
+ }),
1370
+ d(B, {
1371
+ class: "text-fm-color-typo-tertiary cursor-pointer",
1372
+ onClick: a[3] || (a[3] = (oe) => T())
1373
+ }, {
1374
+ default: Y(() => [
1375
+ Ue(J(l(c)("report.section.condition.add")), 1)
1376
+ ]),
1377
+ _: 1
1378
+ })
1379
+ ]);
1380
+ };
1381
+ }
1382
+ }), il = /* @__PURE__ */ se({
1383
+ __name: "Datasource",
1384
+ props: /* @__PURE__ */ ve({
1385
+ label: {
1386
+ type: String,
1387
+ default: "Label"
1388
+ },
1389
+ config: {
1390
+ type: Object,
1391
+ default: null
1392
+ },
1393
+ closeable: {
1394
+ type: Boolean,
1395
+ default: !1
1396
+ },
1397
+ mainDatasourceConfig: {
1398
+ type: Object,
1399
+ default: () => {
1400
+ }
1401
+ },
1402
+ modelValue: {
1403
+ type: Object,
1404
+ default: () => {
1405
+ }
1406
+ }
1407
+ }, {
1408
+ modelValue: { required: !0 },
1409
+ modelModifiers: {}
1410
+ }),
1411
+ emits: /* @__PURE__ */ ve(["click-close"], ["update:modelValue"]),
1412
+ setup(L, { emit: c }) {
1413
+ const { disableEditMode: e, resetStore: i } = Oe(), o = ge(L, "modelValue");
1414
+ he(
1415
+ [() => o.value.dimensions, () => o.value.metrics],
1416
+ () => {
1417
+ const { rowIds: r, columnIds: n } = je(o.value);
1418
+ o.value.rowIds = r, o.value.columnIds = n;
1419
+ },
1420
+ { deep: !0 }
1421
+ );
1422
+ const h = L, x = c, { schemas: p } = Se(ml());
1423
+ Bl(() => {
1424
+ e(), i();
1425
+ });
1426
+ const { t: k, te: T, locale: t } = ce(), s = S(() => !h.mainDatasourceConfig), f = S(
1427
+ () => [G.BarChart, G.LineChart, G.Scorecard].includes(h.config.type)
1428
+ ), w = S(() => {
1429
+ const r = [...o.value.dimensions].filter((n) => !n.hide);
1430
+ return r.sort(
1431
+ (n, y) => (o.value.rowIds || []).indexOf(Te(n)) - (o.value.rowIds || []).indexOf(Te(y))
1432
+ ), r;
1433
+ }), A = S(() => h.config.type === G.Scorecard), g = S(
1434
+ () => {
1435
+ var r;
1436
+ return (((r = h.mainDatasourceConfig) == null ? void 0 : r.schemaNames) || []).reduce(
1437
+ (n, y) => {
1438
+ const u = p.value.find((V) => V.name === y);
1439
+ return u && (n = [
1440
+ ...n,
1441
+ ...u.fields.map((V) => ({
1442
+ ...V,
1443
+ labels: [
1444
+ me(k, T, u.label, "schema"),
1445
+ me(k, T, V.label || V.name, "other")
1446
+ ]
1447
+ }))
1448
+ ]), n;
1449
+ },
1450
+ []
1451
+ );
1452
+ }
1453
+ ), C = S(
1454
+ () => o.value.schemaNames.reduce((r, n) => {
1455
+ const y = p.value.find((u) => u.name === n);
1456
+ return y && (r = [
1457
+ ...r,
1458
+ ...y.fields.map((u) => ({
1459
+ ...u,
1460
+ labels: [
1461
+ me(k, T, y.label, "schema"),
1462
+ me(k, T, u.label || u.name, "other")
1463
+ ]
1464
+ }))
1465
+ ]), r;
1466
+ }, [])
1467
+ ), j = S(() => [
1468
+ { label: k("report.section.datasource.none"), value: null },
1469
+ { label: k("report.section.datasource.grandTotal"), value: 0 },
1470
+ ...[...w.value].slice(0, w.value.length - 1).map((r, n) => ({
1471
+ label: me(k, T, r.label, "other"),
1472
+ value: n + 1
1473
+ }))
1474
+ ]), $ = S(() => [
1475
+ {
1476
+ label: k("report.section.datasource.position.top"),
1477
+ value: al.top
1478
+ },
1479
+ {
1480
+ label: k("report.section.datasource.position.bottom"),
1481
+ value: al.bottom
1482
+ }
1483
+ ]), m = S(
1484
+ () => `rollup-${t.value}-${w.value.map((r) => Te(r)).join("|")}`
1485
+ ), a = S(() => [
1486
+ {
1487
+ label: k("report.section.datasource.none"),
1488
+ value: null
1489
+ },
1490
+ ...Object.keys(ol).map((r) => ({
1491
+ label: T(`report.section.datasource.periodType.${r}`) ? k(`report.section.datasource.periodType.${r}`) : r,
1492
+ value: ol[r]
1493
+ }))
1494
+ ]);
1495
+ return (r, n) => {
1496
+ const y = D("FmButton"), u = D("FmSwitch"), V = D("FmSelect"), z = D("FmTextField");
1497
+ return v(), O(We, null, {
1498
+ header: Y(() => [
1499
+ b("p", null, J(h.label), 1),
1500
+ n[21] || (n[21] = b("div", { class: "grow" }, null, -1)),
1501
+ h.closeable ? (v(), O(y, {
1502
+ key: 0,
1503
+ icon: "close",
1504
+ variant: "tertiary",
1505
+ size: "md",
1506
+ onClick: n[0] || (n[0] = ye((B) => x("click-close"), ["stop"]))
1507
+ })) : N("", !0)
1508
+ ]),
1509
+ content: Y(() => [
1510
+ d(oo, {
1511
+ modelValue: o.value,
1512
+ "onUpdate:modelValue": n[1] || (n[1] = (B) => o.value = B),
1513
+ label: l(k)("report.section.schema.title")
1514
+ }, null, 8, ["modelValue", "label"]),
1515
+ d(Xe, {
1516
+ modelValue: o.value.dimensions,
1517
+ "onUpdate:modelValue": n[2] || (n[2] = (B) => o.value.dimensions = B),
1518
+ options: C.value,
1519
+ config: o.value,
1520
+ max: h.config.maxDimension,
1521
+ "has-row-column": !0,
1522
+ onConfig: n[3] || (n[3] = (B) => {
1523
+ o.value = B;
1524
+ })
1525
+ }, null, 8, ["modelValue", "options", "config", "max"]),
1526
+ d(u, {
1527
+ "label-placement": "right",
1528
+ label: l(k)("report.section.datasource.comparable"),
1529
+ "model-value": o.value.isComparable ?? !1,
1530
+ "onUpdate:modelValue": n[4] || (n[4] = (B) => {
1531
+ o.value.isComparable = B;
1532
+ })
1533
+ }, null, 8, ["label", "model-value"]),
1534
+ f.value ? (v(), O(u, {
1535
+ key: 0,
1536
+ "label-placement": "right",
1537
+ label: l(k)("report.section.datasource.cumulative"),
1538
+ "model-value": o.value.isCumulative ?? !1,
1539
+ "onUpdate:modelValue": n[5] || (n[5] = (B) => {
1540
+ o.value.isCumulative = B;
1541
+ })
1542
+ }, null, 8, ["label", "model-value"])) : N("", !0),
1543
+ h.config.isDrillConfigurable && s.value ? (v(), O(u, {
1544
+ key: 1,
1545
+ label: l(k)("report.section.datasource.drill"),
1546
+ "label-placement": "right",
1547
+ "model-value": o.value.isDrillable ?? !1,
1548
+ "onUpdate:modelValue": n[6] || (n[6] = (B) => {
1549
+ o.value.isDrillable = B;
1550
+ })
1551
+ }, null, 8, ["label", "model-value"])) : N("", !0),
1552
+ s.value ? (v(), O(u, {
1553
+ key: 2,
1554
+ modelValue: o.value.isBlend,
1555
+ "onUpdate:modelValue": n[7] || (n[7] = (B) => o.value.isBlend = B),
1556
+ label: l(k)("report.section.datasource.blend"),
1557
+ "label-placement": "right"
1558
+ }, null, 8, ["modelValue", "label"])) : N("", !0),
1559
+ h.config.canRollup && s.value ? (v(), O(V, {
1560
+ key: m.value,
1561
+ modelValue: o.value.rollup,
1562
+ "onUpdate:modelValue": n[8] || (n[8] = (B) => o.value.rollup = B),
1563
+ label: l(k)("report.section.datasource.subTotal"),
1564
+ items: j.value
1565
+ }, null, 8, ["modelValue", "label", "items"])) : N("", !0),
1566
+ h.config.showRollupPosition && s.value ? (v(), O(V, {
1567
+ key: `rollup-position-${l(t)}`,
1568
+ modelValue: o.value.rollupPosition,
1569
+ "onUpdate:modelValue": n[9] || (n[9] = (B) => o.value.rollupPosition = B),
1570
+ label: l(k)("report.section.datasource.position.showPosition"),
1571
+ items: $.value
1572
+ }, null, 8, ["modelValue", "label", "items"])) : N("", !0),
1573
+ h.config.type === l(G).Table && s.value ? (v(), O(z, {
1574
+ key: 5,
1575
+ modelValue: o.value.grandTotalLabel,
1576
+ "onUpdate:modelValue": n[10] || (n[10] = (B) => o.value.grandTotalLabel = B),
1577
+ label: l(k)("report.section.datasource.grandTotalLabel"),
1578
+ placeholder: l(k)("report.section.datasource.grandTotal")
1579
+ }, null, 8, ["modelValue", "label", "placeholder"])) : N("", !0),
1580
+ s.value ? N("", !0) : (v(), O(V, {
1581
+ key: `periodType-${l(t)}`,
1582
+ modelValue: o.value.periodType,
1583
+ "onUpdate:modelValue": n[11] || (n[11] = (B) => o.value.periodType = B),
1584
+ label: l(k)("report.section.datasource.periodType.label"),
1585
+ items: a.value
1586
+ }, null, 8, ["modelValue", "label", "items"])),
1587
+ h.config.canTranspose && s.value ? (v(), O(u, {
1588
+ key: 7,
1589
+ modelValue: o.value.isTransposed,
1590
+ "onUpdate:modelValue": n[12] || (n[12] = (B) => o.value.isTransposed = B),
1591
+ label: l(k)("report.section.datasource.transpose"),
1592
+ "label-placement": "right"
1593
+ }, null, 8, ["modelValue", "label"])) : N("", !0),
1594
+ h.config.hasBreakdownDimension ? (v(), O(Xe, {
1595
+ key: 8,
1596
+ "model-value": o.value.breakdownDimension ? [o.value.breakdownDimension] : [],
1597
+ label: "breakdownDimension",
1598
+ max: 1,
1599
+ options: C.value,
1600
+ "onUpdate:modelValue": n[13] || (n[13] = (B) => {
1601
+ o.value.breakdownDimension = B[0];
1602
+ })
1603
+ }, null, 8, ["model-value", "options"])) : N("", !0),
1604
+ A.value ? (v(), O(Xe, {
1605
+ key: 9,
1606
+ "model-value": o.value.sparklineDimension ? [o.value.sparklineDimension] : [],
1607
+ label: "sparklineDimension",
1608
+ max: 1,
1609
+ options: C.value,
1610
+ "onUpdate:modelValue": n[14] || (n[14] = (B) => {
1611
+ o.value.sparklineDimension = B[0];
1612
+ })
1613
+ }, null, 8, ["model-value", "options"])) : N("", !0),
1614
+ d(vo, {
1615
+ modelValue: o.value.metrics,
1616
+ "onUpdate:modelValue": n[15] || (n[15] = (B) => o.value.metrics = B),
1617
+ options: C.value,
1618
+ max: h.config.maxMetric,
1619
+ config: o.value,
1620
+ "has-row-column": h.config.type === l(G).Table,
1621
+ "has-xy": h.config.hasXy,
1622
+ onConfig: n[16] || (n[16] = (B) => {
1623
+ o.value = B;
1624
+ })
1625
+ }, null, 8, ["modelValue", "options", "max", "config", "has-row-column", "has-xy"]),
1626
+ d(zl, {
1627
+ modelValue: o.value.filters,
1628
+ "onUpdate:modelValue": n[17] || (n[17] = (B) => o.value.filters = B),
1629
+ options: C.value
1630
+ }, null, 8, ["modelValue", "options"]),
1631
+ d(ho, {
1632
+ modelValue: o.value.sorts,
1633
+ "onUpdate:modelValue": n[18] || (n[18] = (B) => o.value.sorts = B),
1634
+ options: C.value
1635
+ }, null, 8, ["modelValue", "options"]),
1636
+ d(xo, {
1637
+ modelValue: o.value.limit,
1638
+ "onUpdate:modelValue": n[19] || (n[19] = (B) => o.value.limit = B)
1639
+ }, null, 8, ["modelValue"]),
1640
+ o.value.conditions ? (v(), O(So, {
1641
+ key: 10,
1642
+ modelValue: o.value.conditions,
1643
+ "onUpdate:modelValue": n[20] || (n[20] = (B) => o.value.conditions = B),
1644
+ "join-field-options": C.value,
1645
+ "main-field-options": g.value
1646
+ }, null, 8, ["modelValue", "join-field-options", "main-field-options"])) : N("", !0)
1647
+ ]),
1648
+ _: 1
1649
+ });
1650
+ };
1651
+ }
1652
+ }), To = { class: "fm-typo-en-title-sm-600" }, He = /* @__PURE__ */ se({
1653
+ __name: "TileEditorTabHeader",
1654
+ props: /* @__PURE__ */ ve({
1655
+ icon: {
1656
+ type: String,
1657
+ required: !0
1658
+ }
1659
+ }, {
1660
+ modelValue: { type: Boolean, required: !0, default: !1 },
1661
+ modelModifiers: {}
1662
+ }),
1663
+ emits: ["update:modelValue"],
1664
+ setup(L) {
1665
+ const { t: c } = ce(), e = ge(L, "modelValue"), i = L;
1666
+ return (o, h) => {
1667
+ const x = D("FmIcon");
1668
+ return v(), P("div", {
1669
+ class: "px-6 py-16 flex items-center gap-2 bg-fm-color-neutral-white border cursor-pointer",
1670
+ onClick: h[0] || (h[0] = (p) => e.value = !e.value)
1671
+ }, [
1672
+ b("p", To, J(l(c)("report.tile.setting")), 1),
1673
+ h[1] || (h[1] = b("div", { class: "grow" }, null, -1)),
1674
+ d(x, {
1675
+ name: i.icon
1676
+ }, null, 8, ["name"])
1677
+ ]);
1678
+ };
1679
+ }
1680
+ }), $o = /* @__PURE__ */ se({
1681
+ __name: "TileEditorTabDesktop",
1682
+ props: {
1683
+ modelValue: { required: !0, default: !1 },
1684
+ modelModifiers: {}
1685
+ },
1686
+ emits: ["update:modelValue"],
1687
+ setup(L) {
1688
+ const c = ge(L, "modelValue");
1689
+ return (e, i) => (v(), P(de, null, [
1690
+ d(He, {
1691
+ modelValue: c.value,
1692
+ "onUpdate:modelValue": i[0] || (i[0] = (o) => c.value = o),
1693
+ icon: "keyboard_double_arrow_left"
1694
+ }, null, 8, ["modelValue"]),
1695
+ rl(e.$slots, "default")
1696
+ ], 64));
1697
+ }
1698
+ }), Uo = { class: "fixed bottom-0 w-full" }, Do = /* @__PURE__ */ se({
1699
+ __name: "TileEditorTabMobile",
1700
+ props: {
1701
+ modelValue: { required: !0, default: !1 },
1702
+ modelModifiers: {}
1703
+ },
1704
+ emits: ["update:modelValue"],
1705
+ setup(L) {
1706
+ const c = ge(L, "modelValue");
1707
+ return (e, i) => {
1708
+ const o = D("FmTopSheet");
1709
+ return v(), P("div", Uo, [
1710
+ d(He, {
1711
+ modelValue: c.value,
1712
+ "onUpdate:modelValue": i[0] || (i[0] = (h) => c.value = h),
1713
+ icon: "keyboard_double_arrow_up"
1714
+ }, null, 8, ["modelValue"]),
1715
+ d(o, {
1716
+ modelValue: c.value,
1717
+ "onUpdate:modelValue": i[2] || (i[2] = (h) => c.value = h),
1718
+ "fullscreen-size": "sm"
1719
+ }, {
1720
+ default: Y(() => [
1721
+ d(He, {
1722
+ modelValue: c.value,
1723
+ "onUpdate:modelValue": i[1] || (i[1] = (h) => c.value = h),
1724
+ icon: "keyboard_double_arrow_down"
1725
+ }, null, 8, ["modelValue"]),
1726
+ c.value ? rl(e.$slots, "default", { key: 0 }) : N("", !0)
1727
+ ]),
1728
+ _: 3
1729
+ }, 8, ["modelValue"])
1730
+ ]);
1731
+ };
1732
+ }
1733
+ }), Bo = { class: "flex gap-16" }, Lo = { class: "flex flex-col gap-8 max-w-[120px]" }, Ao = { class: "fm-typo-en-body-lg-600" }, Mo = { class: "flex flex-col gap-16" }, No = { class: "fm-typo-en-body-lg-600" }, Oo = { class: "flex flex-row gap-8" }, zo = /* @__PURE__ */ se({
1734
+ __name: "TitleSection",
1735
+ props: {
1736
+ model: {}
1737
+ },
1738
+ emits: ["update:model"],
1739
+ setup(L, { emit: c }) {
1740
+ const e = L, i = c, { t: o } = ce(), h = S({
1741
+ get: () => e.model.showTitle ?? !1,
1742
+ set: (t) => i("update:model", { ...e.model, showTitle: t })
1743
+ }), x = S({
1744
+ get: () => e.model.titleFontSize ?? 14,
1745
+ set: (t) => i("update:model", { ...e.model, titleFontSize: Math.min(Number(t), 24) })
1746
+ }), p = S({
1747
+ get: () => e.model.titleBold ?? !1,
1748
+ set: (t) => i("update:model", { ...e.model, titleBold: t })
1749
+ }), k = S({
1750
+ get: () => e.model.titleItalic ?? !1,
1751
+ set: (t) => i("update:model", { ...e.model, titleItalic: t })
1752
+ }), T = S({
1753
+ get: () => e.model.titleUnderline ?? !1,
1754
+ set: (t) => i("update:model", { ...e.model, titleUnderline: t })
1755
+ });
1756
+ return (t, s) => {
1757
+ const f = D("FmStepperField"), w = D("FmButton"), A = D("FmSwitch");
1758
+ return v(), P(de, null, [
1759
+ b("div", null, [
1760
+ b("div", Bo, [
1761
+ b("div", Lo, [
1762
+ b("p", Ao, J(l(o)("report.section.datasource.title.titleFontSize")), 1),
1763
+ d(f, {
1764
+ modelValue: x.value,
1765
+ "onUpdate:modelValue": s[0] || (s[0] = (g) => x.value = g),
1766
+ max: 24,
1767
+ min: 1,
1768
+ type: "number"
1769
+ }, null, 8, ["modelValue"])
1770
+ ]),
1771
+ b("div", Mo, [
1772
+ b("p", No, J(l(o)("report.section.datasource.title.textStyleFormat")), 1),
1773
+ b("div", Oo, [
1774
+ d(w, {
1775
+ "append-icon": "format_bold",
1776
+ "model-value": t.model.titleBold ?? !1,
1777
+ variant: "tertiary",
1778
+ "icon-color": t.model.titleBold ? "neutral-gray-400" : "neutral-gray-300",
1779
+ "bg-color": t.model.titleBold ? "neutral-gray-100" : "neutral-white",
1780
+ class: "rounded-sm",
1781
+ onClick: s[1] || (s[1] = (g) => p.value = !p.value)
1782
+ }, null, 8, ["model-value", "icon-color", "bg-color"]),
1783
+ d(w, {
1784
+ "append-icon": "format_italic",
1785
+ "model-value": t.model.titleItalic ?? !1,
1786
+ "icon-color": t.model.titleItalic ? "neutral-gray-400" : "neutral-gray-300",
1787
+ "bg-color": t.model.titleItalic ? "neutral-gray-100" : "neutral-white",
1788
+ class: "rounded-sm",
1789
+ onClick: s[2] || (s[2] = (g) => k.value = !k.value)
1790
+ }, null, 8, ["model-value", "icon-color", "bg-color"]),
1791
+ d(w, {
1792
+ "append-icon": "format_underlined",
1793
+ "model-value": t.model.titleUnderline ?? !1,
1794
+ "icon-color": t.model.titleUnderline ? "neutral-gray-400" : "neutral-gray-300",
1795
+ "bg-color": t.model.titleUnderline ? "neutral-gray-100" : "neutral-white",
1796
+ class: "rounded-sm",
1797
+ onClick: s[3] || (s[3] = (g) => T.value = !T.value)
1798
+ }, null, 8, ["model-value", "icon-color", "bg-color"])
1799
+ ])
1800
+ ])
1801
+ ])
1802
+ ]),
1803
+ d(A, {
1804
+ modelValue: h.value,
1805
+ "onUpdate:modelValue": s[4] || (s[4] = (g) => h.value = g),
1806
+ label: l(o)("report.section.datasource.title.showTitle"),
1807
+ "label-placement": "right"
1808
+ }, null, 8, ["modelValue", "label"])
1809
+ ], 64);
1810
+ };
1811
+ }
1812
+ }), jo = { class: "flex flex-col gap-8" }, Ro = { class: "text-fm-color-typo-primary fm-typo-en-body-lg-600" }, Io = { class: "flex flex-row gap-2" }, Po = {
1813
+ key: 0,
1814
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
1815
+ }, Xo = /* @__PURE__ */ se({
1816
+ __name: "TableResizeSection",
1817
+ props: {
1818
+ layout: {}
1819
+ },
1820
+ emits: ["update:layout"],
1821
+ setup(L, { emit: c }) {
1822
+ const { t: e } = ce(), i = L, o = c, { isEditing: h, colWidths: x, rowHeight: p } = Se(Oe()), { enableCellResizing: k, cancelResizingChanges: T, resetStore: t, disableEditMode: s } = Oe();
1823
+ S(
1824
+ () => {
1825
+ var w, A, g;
1826
+ return (((A = (w = i.layout) == null ? void 0 : w.colWidths) == null ? void 0 : A.length) ?? 0) > 0 || x.value.length > 0 || (((g = i.layout) == null ? void 0 : g.rowHeight) ?? 0) > 0 || p.value > 0;
1827
+ }
1828
+ );
1829
+ function f() {
1830
+ t(), s(), o("update:layout", {
1831
+ ...i.layout,
1832
+ rowHeight: void 0,
1833
+ colWidths: void 0
1834
+ });
1835
+ const w = document.querySelector("table");
1836
+ if (w) {
1837
+ w.classList.remove("table-fixed"), w.classList.add("table-auto"), w.style.width = "";
1838
+ const A = w.querySelectorAll("th"), g = w.querySelectorAll("td"), C = w.querySelectorAll("tr");
1839
+ A.forEach((j) => {
1840
+ j.style.width = "";
1841
+ }), g.forEach((j) => {
1842
+ j.style.width = "";
1843
+ }), C.forEach((j) => {
1844
+ j.style.height = "";
1845
+ });
1846
+ }
1847
+ }
1848
+ return Ye(() => {
1849
+ var w, A;
1850
+ ((w = i.layout) == null ? void 0 : w.rowHeight) !== void 0 && (p.value = i.layout.rowHeight), (A = i.layout) != null && A.colWidths && (x.value = [...i.layout.colWidths]);
1851
+ }), (w, A) => {
1852
+ const g = D("FmButton");
1853
+ return v(), P("div", jo, [
1854
+ b("p", Ro, J(l(e)("report.section.datasource.tableLayout")), 1),
1855
+ b("div", Io, [
1856
+ l(h) ? N("", !0) : (v(), O(g, {
1857
+ key: 0,
1858
+ label: l(e)("report.section.datasource.resizeTable"),
1859
+ variant: "secondary",
1860
+ icon: "resize",
1861
+ "icon-position": "prepend",
1862
+ class: "[&_.label]:line-clamp-none w-full",
1863
+ onClick: l(k)
1864
+ }, null, 8, ["label", "onClick"])),
1865
+ l(h) ? (v(), O(g, {
1866
+ key: 1,
1867
+ label: l(e)("report.common.cancel"),
1868
+ variant: "primary",
1869
+ icon: "close",
1870
+ "icon-position": "prepend",
1871
+ class: "[&_.label]:line-clamp-none w-full",
1872
+ onClick: l(T)
1873
+ }, null, 8, ["label", "onClick"])) : N("", !0),
1874
+ d(g, {
1875
+ label: l(e)("report.section.datasource.resetSize"),
1876
+ variant: "secondary",
1877
+ icon: "restore",
1878
+ "icon-position": "prepend",
1879
+ class: "[&_.label]:line-clamp-none w-full",
1880
+ onClick: f
1881
+ }, null, 8, ["label"])
1882
+ ]),
1883
+ l(h) ? (v(), P("p", Po, J(l(e)("report.section.datasource.resizeTableHelper")), 1)) : N("", !0)
1884
+ ]);
1885
+ };
1886
+ }
1887
+ }), Eo = { class: "flex gap-16 justify-center items-center" }, Wo = { class: "fm-typo-en-title-sm-600" }, qo = { class: "fm-typo-en-body-lg-600" }, Ho = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, Yo = { class: "h-[40x]" }, sl = "YYYY-MM-DD", bl = /* @__PURE__ */ se({
1888
+ __name: "TileEditorTab",
1889
+ props: /* @__PURE__ */ ve({
1890
+ hideConfiguration: {
1891
+ type: Boolean,
1892
+ default: !1
1893
+ }
1894
+ }, {
1895
+ modelValue: {
1896
+ required: !0
1897
+ },
1898
+ modelModifiers: {}
1899
+ }),
1900
+ emits: /* @__PURE__ */ ve(["hideConfiguration"], ["update:modelValue"]),
1901
+ setup(L, { emit: c }) {
1902
+ var n, y;
1903
+ const e = fl(), { dateRange: i, timezone: o } = Se(e), h = {
1904
+ startDate: i.value.startDate,
1905
+ endDate: i.value.endDate
1906
+ }, x = ee({
1907
+ startDate: (n = Me(i.value.startDate)) == null ? void 0 : n.tz(o.value).format(sl),
1908
+ endDate: (y = Me(i.value.endDate)) == null ? void 0 : y.tz(o.value).format(sl)
1909
+ });
1910
+ he(
1911
+ x,
1912
+ () => {
1913
+ x.value.endDate || (x.value.endDate = x.value.startDate);
1914
+ const u = {
1915
+ startDate: Me.tz(x.value.startDate, o.value).startOf("day").utc().toISOString(),
1916
+ endDate: Me.tz(x.value.endDate, o.value).endOf("day").utc().toISOString()
1917
+ };
1918
+ i.value = u;
1919
+ },
1920
+ { deep: !0 }
1921
+ ), ul(() => {
1922
+ i.value = { ...h };
1923
+ });
1924
+ const p = ge(L, "modelValue"), { breakpoints: k } = pl(), T = L, { promptMessage: t } = cl(), s = c, { t: f, locale: w } = ce();
1925
+ function A(u) {
1926
+ p.value = ro(u);
1927
+ }
1928
+ function g() {
1929
+ const u = [...p.value.widget.config.joinDatasources || []];
1930
+ u.push({ ...Rl(p.value.widget.type), conditions: [] }), A({
1931
+ ...p.value,
1932
+ widget: {
1933
+ ...p.value.widget,
1934
+ config: {
1935
+ ...p.value.widget.config,
1936
+ joinDatasources: u
1937
+ }
1938
+ }
1939
+ });
1940
+ }
1941
+ async function C(u) {
1942
+ if (!await t({
1943
+ title: f("report.tile.datasource.remove"),
1944
+ message: f("report.tile.datasource.confirmRemove", { index: u + 1 })
1945
+ })) return;
1946
+ const z = [...p.value.widget.config.joinDatasources || []];
1947
+ z.splice(u, 1), A({
1948
+ ...p.value,
1949
+ widget: {
1950
+ ...p.value.widget,
1951
+ config: {
1952
+ ...p.value.widget.config,
1953
+ joinDatasources: z
1954
+ }
1955
+ }
1956
+ });
1957
+ }
1958
+ const j = (u, V) => {
1959
+ let z = 1, B = 1;
1960
+ switch (u) {
1961
+ case G.Scorecard:
1962
+ z = 1, B = 2;
1963
+ break;
1964
+ case G.BarChart:
1965
+ case G.StackBarChart:
1966
+ case G.ClusteredStackBarChart:
1967
+ case G.LineChart:
1968
+ case G.StackLineChart:
1969
+ z = 4, B = 6;
1970
+ break;
1971
+ case G.Table:
1972
+ z = 4, B = 12;
1973
+ break;
1974
+ case G.Circular:
1975
+ z = 4, B = 4;
1976
+ break;
1977
+ case G.Spacer:
1978
+ z = 0, B = 12;
1979
+ break;
1980
+ }
1981
+ return {
1982
+ id: V.id,
1983
+ size: {
1984
+ height: z,
1985
+ width: B
1986
+ },
1987
+ widget: {
1988
+ ...V.widget,
1989
+ type: u
1990
+ }
1991
+ };
1992
+ }, $ = S(
1993
+ () => Ie.find((u) => u.type === p.value.widget.type)
1994
+ ), m = S(() => p.value.widget.config.joinDatasources), a = ze((u) => {
1995
+ p.value.widget.title = u;
1996
+ }, 500), r = S({
1997
+ get: () => ({
1998
+ rowHeight: p.value.widget.config.rowHeight,
1999
+ colWidths: p.value.widget.config.colWidths
2000
+ }),
2001
+ set: (u) => {
2002
+ p.value.widget.config.rowHeight = u.rowHeight, p.value.widget.config.colWidths = u.colWidths;
2003
+ }
2004
+ });
2005
+ return he(
2006
+ () => p.value.size.height,
2007
+ (u) => {
2008
+ u < 1 && (p.value.size.height = 1), u > 12 && (p.value.size.height = 12);
2009
+ }
2010
+ ), he(
2011
+ () => p.value.size.width,
2012
+ (u) => {
2013
+ u < 1 && (p.value.size.width = 1), u > 12 && (p.value.size.width = 12);
2014
+ }
2015
+ ), (u, V) => {
2016
+ const z = D("FmCircularProgress"), B = D("FmSimpleDateRangePicker"), oe = D("FmTextField"), Q = D("FmTextarea"), re = D("FmStepperField"), ne = D("FmButton"), I = D("FmForm");
2017
+ return v(), O(dl(l(k).lg || l(k).md ? $o : Do), {
2018
+ "model-value": T.hideConfiguration,
2019
+ "onUpdate:modelValue": V[9] || (V[9] = (M) => s("hideConfiguration", M))
2020
+ }, {
2021
+ default: Y(() => [
2022
+ p.value ? (v(), O(I, {
2023
+ key: 1,
2024
+ ref: "form",
2025
+ class: "px-6 py-16 flex flex-col gap-24 overflow-y-auto overflow-x-hidden"
2026
+ }, {
2027
+ default: Y(() => [
2028
+ b("div", Eo, [
2029
+ (v(), O(B, {
2030
+ key: `date-picker-${l(w)}`,
2031
+ modelValue: x.value,
2032
+ "onUpdate:modelValue": V[0] || (V[0] = (M) => x.value = M)
2033
+ }, null, 8, ["modelValue"]))
2034
+ ]),
2035
+ d(We, null, {
2036
+ header: Y(() => [
2037
+ b("p", Wo, J(l(f)("report.tile.widget.details")), 1),
2038
+ V[10] || (V[10] = b("div", { class: "grow" }, null, -1))
2039
+ ]),
2040
+ content: Y(() => [
2041
+ d(oe, {
2042
+ "model-value": p.value.widget.title,
2043
+ label: l(f)("report.tile.widget.title"),
2044
+ placeholder: l(f)("report.tile.widget.titlePlaceholder"),
2045
+ "onUpdate:modelValue": l(a)
2046
+ }, null, 8, ["model-value", "label", "placeholder", "onUpdate:modelValue"]),
2047
+ d(Q, {
2048
+ modelValue: p.value.widget.description,
2049
+ "onUpdate:modelValue": V[1] || (V[1] = (M) => p.value.widget.description = M),
2050
+ disabled: p.value.widget.title === "",
2051
+ placeholder: l(f)("report.tile.widget.descriptionPlaceholder"),
2052
+ "helper-text": l(f)("report.tile.widget.descriptionHelper")
2053
+ }, {
2054
+ label: Y(() => [
2055
+ b("p", qo, J(l(f)("report.tile.widget.widgetDescription")), 1),
2056
+ b("p", Ho, " (" + J(l(f)("report.tile.widget.optional")) + ") ", 1)
2057
+ ]),
2058
+ _: 1
2059
+ }, 8, ["modelValue", "disabled", "placeholder", "helper-text"]),
2060
+ d(zo, {
2061
+ model: p.value.widget.config,
2062
+ "onUpdate:model": V[2] || (V[2] = (M) => p.value.widget.config = M)
2063
+ }, null, 8, ["model"]),
2064
+ b("div", {
2065
+ class: ke(["flex flex-row", `${l(k).sm || l(k).xs ? "gap-16" : "gap-2"}`])
2066
+ }, [
2067
+ d(re, {
2068
+ modelValue: p.value.size.width,
2069
+ "onUpdate:modelValue": V[3] || (V[3] = (M) => p.value.size.width = M),
2070
+ label: l(f)("report.tile.widget.width"),
2071
+ min: 1,
2072
+ max: 12
2073
+ }, null, 8, ["modelValue", "label"]),
2074
+ d(re, {
2075
+ modelValue: p.value.size.height,
2076
+ "onUpdate:modelValue": V[4] || (V[4] = (M) => p.value.size.height = M),
2077
+ label: l(f)("report.tile.widget.height"),
2078
+ min: 1,
2079
+ max: 12,
2080
+ disabled: p.value.widget.type === l(G).Scorecard
2081
+ }, null, 8, ["modelValue", "label", "disabled"])
2082
+ ], 2),
2083
+ p.value.widget.type === l(G).Table ? (v(), O(Xo, {
2084
+ key: 0,
2085
+ layout: r.value,
2086
+ "onUpdate:layout": V[5] || (V[5] = (M) => r.value = M)
2087
+ }, null, 8, ["layout"])) : N("", !0)
2088
+ ]),
2089
+ _: 1
2090
+ }),
2091
+ d(We, null, {
2092
+ header: Y(() => [
2093
+ b("p", null, J(l(f)("report.tile.widget.type")), 1),
2094
+ V[11] || (V[11] = b("div", { class: "grow" }, null, -1))
2095
+ ]),
2096
+ content: Y(() => [
2097
+ d(jl, {
2098
+ "is-list": !0,
2099
+ "model-value": p.value.widget.type,
2100
+ class: "grid grid-cols-1 gap-2",
2101
+ "child-class": "flex flex-row p-[8px] gap-2",
2102
+ "exclude-widge-type": [l(G).Spacer],
2103
+ "onUpdate:modelValue": V[6] || (V[6] = (M) => p.value = j(M, p.value))
2104
+ }, null, 8, ["model-value", "exclude-widge-type"])
2105
+ ]),
2106
+ _: 1
2107
+ }),
2108
+ d(il, {
2109
+ modelValue: p.value.widget.config,
2110
+ "onUpdate:modelValue": V[7] || (V[7] = (M) => p.value.widget.config = M),
2111
+ label: l(f)("report.tile.datasource.main"),
2112
+ config: $.value
2113
+ }, null, 8, ["modelValue", "label", "config"]),
2114
+ m.value ? (v(!0), P(de, { key: 0 }, xe(m.value, (M, q) => (v(), P("div", { key: q }, [
2115
+ d(il, {
2116
+ modelValue: m.value[q],
2117
+ "onUpdate:modelValue": (te) => m.value[q] = te,
2118
+ label: l(f)("report.tile.datasource.join", { index: q + 1 }),
2119
+ config: $.value,
2120
+ "main-datasource-config": p.value.widget.config,
2121
+ closeable: !0,
2122
+ onClickClose: (te) => C(q)
2123
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "config", "main-datasource-config", "onClickClose"])
2124
+ ]))), 128)) : N("", !0),
2125
+ b("div", Yo, [
2126
+ d(ne, {
2127
+ label: l(f)("report.tile.datasource.joinButton"),
2128
+ variant: "secondary",
2129
+ icon: "add",
2130
+ "icon-position": "prepend",
2131
+ "border-color": "primary",
2132
+ "text-color": "primary",
2133
+ class: "w-full",
2134
+ onClick: V[8] || (V[8] = (M) => g())
2135
+ }, null, 8, ["label"])
2136
+ ])
2137
+ ]),
2138
+ _: 1
2139
+ }, 512)) : (v(), O(z, { key: 0 }))
2140
+ ]),
2141
+ _: 1
2142
+ }, 8, ["model-value"]);
2143
+ };
2144
+ }
2145
+ }), Go = { class: "flex flex-col gap-8" }, Jo = { class: "pl-32 flex flex-col gap-8" }, Ko = { class: "fm-typo-en-body-lg-600" }, Qo = { class: "flex flex-row gap-8" }, Zo = { class: "fm-typo-en-body-lg-600" }, et = { class: "flex flex-row gap-8" }, lt = /* @__PURE__ */ se({
2146
+ __name: "LabelSection",
2147
+ props: {
2148
+ model: {}
2149
+ },
2150
+ emits: ["update:model"],
2151
+ setup(L, { emit: c }) {
2152
+ const e = L, i = c, { t: o } = ce(), h = S({
2153
+ get: () => e.model.showLabel ?? !1,
2154
+ set: (w) => {
2155
+ i("update:model", { ...e.model, showLabel: w });
2156
+ }
2157
+ }), x = S({
2158
+ get: () => e.model.labelRotation ?? 0,
2159
+ set: (w) => i("update:model", { ...e.model, labelRotation: w })
2160
+ }), p = S({
2161
+ get: () => e.model.labelOffset ?? 0,
2162
+ set: (w) => i("update:model", { ...e.model, labelOffset: w })
2163
+ }), k = S({
2164
+ get: () => e.model.labelFontSize ?? 12,
2165
+ set: (w) => i("update:model", { ...e.model, labelFontSize: w })
2166
+ }), T = (w) => {
2167
+ i("update:model", {
2168
+ ...e.model,
2169
+ labelAlign: e.model.labelAlign === w ? void 0 : w
2170
+ });
2171
+ }, t = (w) => {
2172
+ i("update:model", {
2173
+ ...e.model,
2174
+ labelAnchor: e.model.labelAnchor === w ? void 0 : w
2175
+ });
2176
+ }, s = [
2177
+ { icon: "align_horizontal_left", value: Fe.left, tooltip: "alignLeft" },
2178
+ { icon: "align_justify_center", value: Fe.center, tooltip: "alignCenter" },
2179
+ { icon: "align_horizontal_right", value: Fe.right, tooltip: "alignRight" },
2180
+ { icon: "align_justify_flex_start", value: Fe.start, tooltip: "alignStart" },
2181
+ { icon: "align_justify_flex_end", value: Fe.end, tooltip: "alignEnd" },
2182
+ { icon: "align_flex_start", value: Fe.top, tooltip: "alignTop" },
2183
+ { icon: "align_flex_end", value: Fe.bottom, tooltip: "alignBottom" }
2184
+ ], f = [
2185
+ { icon: "format_align_left", value: Ne.start, tooltip: "anchorStart" },
2186
+ { icon: "format_align_center", value: Ne.center, tooltip: "anchorCenter" },
2187
+ { icon: "format_align_right", value: Ne.end, tooltip: "anchorEnd" }
2188
+ ];
2189
+ return (w, A) => {
2190
+ const g = D("FmCheckbox"), C = D("FmButton"), j = D("FmTooltip"), $ = D("FmTextField"), m = D("FmStepperField");
2191
+ return v(), P("div", Go, [
2192
+ d(g, {
2193
+ modelValue: h.value,
2194
+ "onUpdate:modelValue": A[0] || (A[0] = (a) => h.value = a),
2195
+ value: !1,
2196
+ label: l(o)("report.section.datasource.label.showLabel"),
2197
+ "label-placement": "right",
2198
+ class: "fm-typo-en-body-lg-400"
2199
+ }, null, 8, ["modelValue", "label"]),
2200
+ we(b("div", Jo, [
2201
+ b("p", Ko, J(l(o)("report.section.datasource.alignment.textAlignment")), 1),
2202
+ b("div", Qo, [
2203
+ (v(), P(de, null, xe(s, ({ icon: a, value: r, tooltip: n }) => d(j, {
2204
+ key: r,
2205
+ variant: "plain",
2206
+ placement: "top",
2207
+ content: l(o)(`report.section.datasource.alignment.alignOptions.${n}`),
2208
+ "z-index": 50
2209
+ }, {
2210
+ default: Y(() => [
2211
+ d(C, {
2212
+ "append-icon": a,
2213
+ variant: "tertiary",
2214
+ "icon-color": w.model.labelAlign === r ? "neutral-gray-400" : "neutral-gray-300",
2215
+ "bg-color": w.model.labelAlign === r ? "neutral-gray-100" : "neutral-white",
2216
+ class: "rounded-sm",
2217
+ onClick: (y) => T(r)
2218
+ }, null, 8, ["append-icon", "icon-color", "bg-color", "onClick"])
2219
+ ]),
2220
+ _: 2
2221
+ }, 1032, ["content"])), 64))
2222
+ ]),
2223
+ b("p", Zo, J(l(o)("report.section.datasource.alignment.anchor")), 1),
2224
+ b("div", et, [
2225
+ (v(), P(de, null, xe(f, ({ icon: a, value: r, tooltip: n }) => d(j, {
2226
+ key: r,
2227
+ variant: "plain",
2228
+ placement: "top",
2229
+ content: l(o)(`report.section.datasource.alignment.anchorOptions.${n}`),
2230
+ "z-index": 50
2231
+ }, {
2232
+ default: Y(() => [
2233
+ d(C, {
2234
+ "append-icon": a,
2235
+ variant: "tertiary",
2236
+ "icon-color": w.model.labelAnchor === r ? "neutral-gray-400" : "neutral-gray-300",
2237
+ "bg-color": w.model.labelAnchor === r ? "neutral-gray-100" : "neutral-white",
2238
+ class: "rounded-sm",
2239
+ onClick: (y) => t(r)
2240
+ }, null, 8, ["append-icon", "icon-color", "bg-color", "onClick"])
2241
+ ]),
2242
+ _: 2
2243
+ }, 1032, ["content"])), 64))
2244
+ ]),
2245
+ d($, {
2246
+ modelValue: x.value,
2247
+ "onUpdate:modelValue": A[1] || (A[1] = (a) => x.value = a),
2248
+ label: l(o)("report.section.datasource.alignment.rotation"),
2249
+ type: "number",
2250
+ min: -180,
2251
+ max: 180,
2252
+ step: 1
2253
+ }, null, 8, ["modelValue", "label"]),
2254
+ d($, {
2255
+ modelValue: p.value,
2256
+ "onUpdate:modelValue": A[2] || (A[2] = (a) => p.value = a),
2257
+ label: l(o)("report.section.datasource.alignment.offset"),
2258
+ type: "number"
2259
+ }, null, 8, ["modelValue", "label"]),
2260
+ d(m, {
2261
+ modelValue: k.value,
2262
+ "onUpdate:modelValue": A[3] || (A[3] = (a) => k.value = a),
2263
+ label: l(o)("report.section.datasource.fontSize"),
2264
+ type: "number",
2265
+ min: 1
2266
+ }, null, 8, ["modelValue", "label"])
2267
+ ], 512), [
2268
+ [Ce, h.value]
2269
+ ])
2270
+ ]);
2271
+ };
2272
+ }
2273
+ }), ot = { class: "flex flex-col gap-8" }, tt = { class: "pl-32 flex flex-col gap-8" }, at = { class: "pl-32 flex flex-col gap-8" }, nt = { class: "pl-32 flex flex-col gap-8" }, it = { class: "pl-32 flex flex-col gap-8" }, st = { class: "pl-32 flex flex-col gap-8" }, rt = { class: "pl-32 flex flex-col gap-8" }, ut = /* @__PURE__ */ se({
2274
+ __name: "XySection",
2275
+ props: {
2276
+ model: {}
2277
+ },
2278
+ emits: ["update:model"],
2279
+ setup(L, { emit: c }) {
2280
+ const e = L, i = c, { t: o } = ce(), h = S({
2281
+ get: () => e.model.showX ?? !0,
2282
+ set: (g) => {
2283
+ i("update:model", { ...e.model, showX: g });
2284
+ }
2285
+ }), x = S({
2286
+ get: () => e.model.showXGrid ?? !1,
2287
+ set: (g) => {
2288
+ i("update:model", { ...e.model, showXGrid: g });
2289
+ }
2290
+ }), p = S({
2291
+ get: () => e.model.showXTick ?? !0,
2292
+ set: (g) => {
2293
+ i("update:model", { ...e.model, showXTick: g });
2294
+ }
2295
+ }), k = S({
2296
+ get: () => e.model.showY ?? !0,
2297
+ set: (g) => {
2298
+ i("update:model", { ...e.model, showY: g });
2299
+ }
2300
+ }), T = S({
2301
+ get: () => e.model.showYGrid ?? !0,
2302
+ set: (g) => {
2303
+ i("update:model", { ...e.model, showYGrid: g });
2304
+ }
2305
+ }), t = S({
2306
+ get: () => e.model.showYTick ?? !0,
2307
+ set: (g) => {
2308
+ i("update:model", { ...e.model, showYTick: g });
2309
+ }
2310
+ }), s = S({
2311
+ get: () => e.model.showXTitle ?? !1,
2312
+ set: (g) => {
2313
+ i("update:model", { ...e.model, showXTitle: g });
2314
+ }
2315
+ }), f = S({
2316
+ get: () => e.model.showYTitle ?? !1,
2317
+ set: (g) => {
2318
+ i("update:model", { ...e.model, showYTitle: g });
2319
+ }
2320
+ }), w = ze((g) => {
2321
+ i("update:model", { ...e.model, xTitle: g });
2322
+ }, 500), A = ze((g) => {
2323
+ i("update:model", { ...e.model, yTitle: g });
2324
+ }, 500);
2325
+ return Ye(() => {
2326
+ var g, C, j, $;
2327
+ !e.model.xTitle && ((C = (g = e.model.metrics) == null ? void 0 : g[0]) != null && C.label) && w(e.model.metrics[0].label), !e.model.yTitle && (($ = (j = e.model.dimensions) == null ? void 0 : j[0]) != null && $.label) && A(e.model.dimensions[0].label);
2328
+ }), (g, C) => {
2329
+ const j = D("FmCheckbox"), $ = D("FmStepperField"), m = D("FmTextField");
2330
+ return v(), P("div", ot, [
2331
+ d(j, {
2332
+ modelValue: h.value,
2333
+ "onUpdate:modelValue": C[0] || (C[0] = (a) => h.value = a),
2334
+ label: l(o)("report.section.datasource.axis.showX"),
2335
+ "label-placement": "right",
2336
+ value: !0
2337
+ }, null, 8, ["modelValue", "label"]),
2338
+ we(b("div", tt, [
2339
+ d(j, {
2340
+ modelValue: x.value,
2341
+ "onUpdate:modelValue": C[1] || (C[1] = (a) => x.value = a),
2342
+ label: l(o)("report.section.datasource.axis.showGrid"),
2343
+ "label-placement": "right",
2344
+ value: !1
2345
+ }, null, 8, ["modelValue", "label"]),
2346
+ d(j, {
2347
+ modelValue: p.value,
2348
+ "onUpdate:modelValue": C[2] || (C[2] = (a) => p.value = a),
2349
+ label: l(o)("report.section.datasource.axis.showTick"),
2350
+ "label-placement": "right",
2351
+ value: !0
2352
+ }, null, 8, ["modelValue", "label"]),
2353
+ we(b("div", at, [
2354
+ d($, {
2355
+ label: l(o)("report.section.datasource.fontSize"),
2356
+ type: "number",
2357
+ "model-value": g.model.xTickFontSize ?? 12,
2358
+ min: 1,
2359
+ "onUpdate:modelValue": C[3] || (C[3] = (a) => {
2360
+ i("update:model", { ...g.model, xTickFontSize: Number(a) });
2361
+ })
2362
+ }, null, 8, ["label", "model-value"])
2363
+ ], 512), [
2364
+ [Ce, g.model.showXTick ?? !0]
2365
+ ]),
2366
+ d(j, {
2367
+ modelValue: s.value,
2368
+ "onUpdate:modelValue": C[4] || (C[4] = (a) => s.value = a),
2369
+ label: l(o)("report.section.datasource.axis.showTitle"),
2370
+ "label-placement": "right",
2371
+ value: !0
2372
+ }, null, 8, ["modelValue", "label"]),
2373
+ we(b("div", nt, [
2374
+ d(m, {
2375
+ "model-value": g.model.xTitle,
2376
+ label: l(o)("report.common.title"),
2377
+ placeholder: l(o)("report.tile.widget.titlePlaceholder"),
2378
+ "onUpdate:modelValue": l(w)
2379
+ }, null, 8, ["model-value", "label", "placeholder", "onUpdate:modelValue"]),
2380
+ d($, {
2381
+ label: l(o)("report.section.datasource.fontSize"),
2382
+ type: "number",
2383
+ "model-value": g.model.xTitleFontSize ?? 12,
2384
+ min: 1,
2385
+ "onUpdate:modelValue": C[5] || (C[5] = (a) => {
2386
+ i("update:model", { ...g.model, xTitleFontSize: Number(a) });
2387
+ })
2388
+ }, null, 8, ["label", "model-value"])
2389
+ ], 512), [
2390
+ [Ce, s.value]
2391
+ ])
2392
+ ], 512), [
2393
+ [Ce, g.model.showX ?? !0]
2394
+ ]),
2395
+ d(j, {
2396
+ modelValue: k.value,
2397
+ "onUpdate:modelValue": C[6] || (C[6] = (a) => k.value = a),
2398
+ label: l(o)("report.section.datasource.axis.showY"),
2399
+ "label-placement": "right",
2400
+ value: !0
2401
+ }, null, 8, ["modelValue", "label"]),
2402
+ we(b("div", it, [
2403
+ d(j, {
2404
+ modelValue: T.value,
2405
+ "onUpdate:modelValue": C[7] || (C[7] = (a) => T.value = a),
2406
+ label: l(o)("report.section.datasource.axis.showGrid"),
2407
+ "label-placement": "right",
2408
+ value: !1
2409
+ }, null, 8, ["modelValue", "label"]),
2410
+ d(j, {
2411
+ modelValue: t.value,
2412
+ "onUpdate:modelValue": C[8] || (C[8] = (a) => t.value = a),
2413
+ label: l(o)("report.section.datasource.axis.showTick"),
2414
+ "label-placement": "right",
2415
+ value: !0
2416
+ }, null, 8, ["modelValue", "label"]),
2417
+ we(b("div", st, [
2418
+ d($, {
2419
+ label: l(o)("report.section.datasource.fontSize"),
2420
+ type: "number",
2421
+ "model-value": g.model.yTickFontSize ?? 12,
2422
+ min: 1,
2423
+ "onUpdate:modelValue": C[9] || (C[9] = (a) => {
2424
+ i("update:model", { ...g.model, yTickFontSize: Number(a) });
2425
+ })
2426
+ }, null, 8, ["label", "model-value"])
2427
+ ], 512), [
2428
+ [Ce, g.model.showYTick ?? !0]
2429
+ ]),
2430
+ d(j, {
2431
+ modelValue: f.value,
2432
+ "onUpdate:modelValue": C[10] || (C[10] = (a) => f.value = a),
2433
+ label: l(o)("report.section.datasource.axis.showTitle"),
2434
+ "label-placement": "right",
2435
+ value: !0
2436
+ }, null, 8, ["modelValue", "label"]),
2437
+ we(b("div", rt, [
2438
+ d(m, {
2439
+ "model-value": g.model.yTitle,
2440
+ label: l(o)("report.common.title"),
2441
+ placeholder: l(o)("report.tile.widget.titlePlaceholder"),
2442
+ "onUpdate:modelValue": l(A)
2443
+ }, null, 8, ["model-value", "label", "placeholder", "onUpdate:modelValue"]),
2444
+ d($, {
2445
+ label: l(o)("report.section.datasource.fontSize"),
2446
+ type: "number",
2447
+ "model-value": g.model.yTitleFontSize ?? 12,
2448
+ min: 1,
2449
+ "onUpdate:modelValue": C[11] || (C[11] = (a) => {
2450
+ i("update:model", { ...g.model, yTitleFontSize: Number(a) });
2451
+ })
2452
+ }, null, 8, ["label", "model-value"])
2453
+ ], 512), [
2454
+ [Ce, f.value]
2455
+ ])
2456
+ ], 512), [
2457
+ [Ce, g.model.showY ?? !0]
2458
+ ])
2459
+ ]);
2460
+ };
2461
+ }
2462
+ }), dt = { class: "flex flex-col gap-8" }, mt = { class: "pl-32 flex flex-col gap-8" }, ct = { class: "text-fm-color-typo-primary fm-typo-en-body-lg-600" }, pt = ["onKeydown"], vt = /* @__PURE__ */ se({
2463
+ __name: "LegendSection",
2464
+ props: {
2465
+ model: {},
2466
+ isCircularWidget: { type: Boolean }
2467
+ },
2468
+ emits: ["update:model"],
2469
+ setup(L, { emit: c }) {
2470
+ const e = L, i = c, { t: o } = ce(), h = [
2471
+ { label: o("report.section.datasource.position.top"), value: "top" },
2472
+ { label: o("report.section.datasource.position.bottom"), value: "bottom" },
2473
+ { label: o("report.section.datasource.position.left"), value: "left" },
2474
+ { label: o("report.section.datasource.position.right"), value: "right" }
2475
+ ], x = S({
2476
+ get: () => e.model.showLegend !== void 0 ? e.model.showLegend : e.isCircularWidget === !0,
2477
+ set: (A) => {
2478
+ i("update:model", { ...e.model, showLegend: A });
2479
+ }
2480
+ }), p = S({
2481
+ get: () => e.model.usePointStyle ?? !0,
2482
+ set: (A) => {
2483
+ i("update:model", { ...e.model, usePointStyle: A });
2484
+ }
2485
+ }), k = S({
2486
+ get: () => e.model.legendFontSize ?? null,
2487
+ set: (A) => {
2488
+ if (A == null) {
2489
+ i("update:model", { ...e.model, legendFontSize: void 0 });
2490
+ return;
2491
+ }
2492
+ i("update:model", { ...e.model, legendFontSize: Math.min(Number(A), 24) });
2493
+ }
2494
+ }), T = S(() => e.model.legendColor ?? "#6b6b6b"), t = ee(T.value), s = ee(null);
2495
+ he(
2496
+ () => e.model.legendColor,
2497
+ (A) => {
2498
+ t.value = A ?? "#6b6b6b";
2499
+ }
2500
+ );
2501
+ function f() {
2502
+ i("update:model", { ...e.model, legendColor: t.value });
2503
+ }
2504
+ function w() {
2505
+ var A;
2506
+ (A = s.value) == null || A.click();
2507
+ }
2508
+ return (A, g) => {
2509
+ const C = D("FmCheckbox"), j = D("FmSelect"), $ = D("FmStepperField"), m = D("FmButton");
2510
+ return v(), P("div", dt, [
2511
+ d(C, {
2512
+ modelValue: x.value,
2513
+ "onUpdate:modelValue": g[0] || (g[0] = (a) => x.value = a),
2514
+ class: "fm-typo-en-body-lg-400",
2515
+ value: !1,
2516
+ label: l(o)("report.section.datasource.legend.showLegend")
2517
+ }, null, 8, ["modelValue", "label"]),
2518
+ we(b("div", mt, [
2519
+ d(C, {
2520
+ modelValue: p.value,
2521
+ "onUpdate:modelValue": g[1] || (g[1] = (a) => p.value = a),
2522
+ label: l(o)("report.section.datasource.legend.usePointStyle"),
2523
+ value: !1
2524
+ }, null, 8, ["modelValue", "label"]),
2525
+ d(j, {
2526
+ label: l(o)("report.section.datasource.position.showPosition"),
2527
+ items: h,
2528
+ "model-value": A.model.legendPosition ?? "top",
2529
+ "onUpdate:modelValue": g[2] || (g[2] = (a) => i("update:model", { ...A.model, legendPosition: a }))
2530
+ }, null, 8, ["label", "model-value"]),
2531
+ d($, {
2532
+ modelValue: k.value,
2533
+ "onUpdate:modelValue": g[3] || (g[3] = (a) => k.value = a),
2534
+ label: l(o)("report.section.datasource.legend.fontSize"),
2535
+ max: 24,
2536
+ min: 1,
2537
+ type: "number",
2538
+ placeholder: "Auto"
2539
+ }, null, 8, ["modelValue", "label"]),
2540
+ b("p", ct, J(l(o)("report.section.datasource.legend.color")), 1),
2541
+ b("div", {
2542
+ class: "fm-field fm-field--sm flex items-center justify-between gap-8 border rounded-md p-2 border-[#c7c7cc] cursor-pointer",
2543
+ role: "button",
2544
+ tabindex: "0",
2545
+ onClick: w,
2546
+ onKeydown: [
2547
+ el(ye(w, ["prevent"]), ["enter"]),
2548
+ el(ye(w, ["prevent"]), ["space"])
2549
+ ]
2550
+ }, [
2551
+ we(b("input", {
2552
+ ref_key: "colorInputRef",
2553
+ ref: s,
2554
+ "onUpdate:modelValue": g[4] || (g[4] = (a) => t.value = a),
2555
+ type: "color",
2556
+ class: "legend-color-input cursor-pointer"
2557
+ }, null, 512), [
2558
+ [Ll, t.value]
2559
+ ])
2560
+ ], 40, pt),
2561
+ d(m, {
2562
+ size: "md",
2563
+ label: l(o)("report.common.apply"),
2564
+ disabled: t.value === T.value,
2565
+ onClick: f
2566
+ }, null, 8, ["label", "disabled"]),
2567
+ A.model.legendPosition === "left" || A.model.legendPosition === "right" ? (v(), O($, {
2568
+ key: 0,
2569
+ label: l(o)("report.section.datasource.legend.maxWidth"),
2570
+ "model-value": A.model.legendMaxWidth ?? null,
2571
+ "onUpdate:modelValue": g[5] || (g[5] = (a) => i("update:model", { ...A.model, legendMaxWidth: a ?? void 0 })),
2572
+ placeholder: "Auto"
2573
+ }, null, 8, ["label", "model-value"])) : N("", !0)
2574
+ ], 512), [
2575
+ [Ce, x.value]
2576
+ ])
2577
+ ]);
2578
+ };
2579
+ }
2580
+ }), ft = /* @__PURE__ */ vl(vt, [["__scopeId", "data-v-0f6af12a"]]), gt = { class: "flex flex-row gap-16" }, yt = /* @__PURE__ */ se({
2581
+ __name: "ChartSizeSection",
2582
+ props: {
2583
+ model: {}
2584
+ },
2585
+ emits: ["update:model"],
2586
+ setup(L, { emit: c }) {
2587
+ const e = L, i = c, { t: o } = ce(), h = S({
2588
+ get: () => e.model.chartHeight ?? null,
2589
+ set: (p) => {
2590
+ i("update:model", { ...e.model, chartHeight: p ?? void 0 });
2591
+ }
2592
+ }), x = S({
2593
+ get: () => e.model.chartWidth ?? null,
2594
+ set: (p) => {
2595
+ i("update:model", { ...e.model, chartWidth: p ?? void 0 });
2596
+ }
2597
+ });
2598
+ return (p, k) => {
2599
+ const T = D("FmStepperField");
2600
+ return v(), P("div", gt, [
2601
+ d(T, {
2602
+ modelValue: h.value,
2603
+ "onUpdate:modelValue": k[0] || (k[0] = (t) => h.value = t),
2604
+ type: "number",
2605
+ label: l(o)("report.section.datasource.chartHeight"),
2606
+ suffix: "px",
2607
+ min: 1,
2608
+ placeholder: "Auto"
2609
+ }, null, 8, ["modelValue", "label"]),
2610
+ d(T, {
2611
+ modelValue: x.value,
2612
+ "onUpdate:modelValue": k[1] || (k[1] = (t) => x.value = t),
2613
+ type: "number",
2614
+ label: l(o)("report.section.datasource.chartWidth"),
2615
+ suffix: "px",
2616
+ min: 1,
2617
+ placeholder: "Auto"
2618
+ }, null, 8, ["modelValue", "label"])
2619
+ ]);
2620
+ };
2621
+ }
2622
+ }), bt = { class: "flex flex-col gap-8" }, ht = { class: "flex gap-8" }, wt = {
2623
+ key: 0,
2624
+ class: "flex items-center gap-8 text-fm-color-system-info-300"
2625
+ }, Ct = { class: "flex flex-col gap-8" }, xt = {
2626
+ key: 1,
2627
+ class: "grid grid-cols-1 gap-8 sm:grid-cols-2"
2628
+ }, Vt = ["title"], Ft = ["aria-label"], kt = { class: "text-[12px] uppercase leading-none tracking-[0.02em] text-[#6b6b6b]" }, _t = ["value", "onInput", "onChange"], St = {
2629
+ key: 0,
2630
+ class: "flex items-center gap-8"
2631
+ }, Tt = {
2632
+ key: 2,
2633
+ class: "flex flex-col gap-8"
2634
+ }, $t = { class: "fm-shadow-light-100 rounded-md border border-fm-color-neutral-gray-100 bg-fm-color-neutral-white p-10" }, Ut = { class: "mb-8 flex min-w-0 items-center gap-[8px] pb-8" }, Dt = ["title"], Bt = ["title"], Lt = ["aria-label"], At = { class: "text-[12px] uppercase leading-none tracking-[0.02em]" }, Mt = ["value", "disabled", "onInput", "onChange"], Nt = {
2635
+ key: 0,
2636
+ class: "flex items-center gap-8"
2637
+ }, Ve = 10, Ot = /* @__PURE__ */ se({
2638
+ __name: "ChartColorSection",
2639
+ props: {
2640
+ model: {},
2641
+ showLayerControl: { type: Boolean },
2642
+ limitToSeriesMode: { type: Boolean }
2643
+ },
2644
+ emits: ["update:model"],
2645
+ setup(L, { emit: c }) {
2646
+ const e = L, i = c, { t: o } = ce(), h = S(() => e.limitToSeriesMode ? [
2647
+ {
2648
+ label: o("report.section.datasource.styleTarget.series"),
2649
+ value: le.series
2650
+ }
2651
+ ] : [
2652
+ {
2653
+ label: o("report.section.datasource.styleTarget.series"),
2654
+ value: le.series
2655
+ },
2656
+ {
2657
+ label: o("report.section.datasource.styleTarget.metric"),
2658
+ value: le.metric
2659
+ },
2660
+ {
2661
+ label: o("report.section.datasource.styleTarget.breakdown"),
2662
+ value: le.breakdown
2663
+ }
2664
+ ]);
2665
+ function x(F) {
2666
+ return e.limitToSeriesMode ? le.series : F === le.breakdown ? le.breakdown : F === le.metric ? le.metric : le.series;
2667
+ }
2668
+ function p() {
2669
+ const F = Array.isArray(e.model.metrics) ? e.model.metrics : [];
2670
+ if (!e.model.isBlend)
2671
+ return F;
2672
+ const _ = Array.isArray(e.model.joinDatasources) ? e.model.joinDatasources.flatMap(
2673
+ (U) => Array.isArray(U == null ? void 0 : U.metrics) ? U.metrics : []
2674
+ ) : [];
2675
+ return [...F, ..._];
2676
+ }
2677
+ function k(F, _) {
2678
+ var R, E;
2679
+ return F ? ((R = F.label) == null ? void 0 : R.trim()) || ((E = F.name) == null ? void 0 : E.trim()) || `${o("report.section.datasource.styleTarget.metric")} ${_ + 1}` : `${o("report.section.datasource.styleTarget.metric")} ${_ + 1}`;
2680
+ }
2681
+ function T(F) {
2682
+ if (F === le.breakdown)
2683
+ return [];
2684
+ if (F === le.metric) {
2685
+ const _ = p();
2686
+ if (_.length > 0)
2687
+ return _.map((U, R) => k(U, R));
2688
+ }
2689
+ return ie.map(
2690
+ (_, U) => `${o("report.section.datasource.chartColor.series")} ${U + 1}`
2691
+ );
2692
+ }
2693
+ function t(F) {
2694
+ return Array.from({ length: Math.max(1, F) }).map(
2695
+ (_, U) => `${o("report.section.datasource.chartColor.series")} ${U + 1}`
2696
+ );
2697
+ }
2698
+ function s(F, _) {
2699
+ const U = Array.isArray(F) ? F.length : 0, R = Array.isArray(_) ? _.length : 0;
2700
+ return Math.max(ie.length, U, R, 1);
2701
+ }
2702
+ const f = S(() => {
2703
+ const F = p();
2704
+ return F.length === 0 ? [o("report.section.datasource.styleTarget.metric")] : F.map((_, U) => k(_, U));
2705
+ }), w = ee(ie.length), A = ee(ie.length);
2706
+ function g(F, _) {
2707
+ const U = Math.max(1, _), R = Array.isArray(F) ? F.length : 0, E = R > 0 ? Math.ceil(R / U) : 0;
2708
+ return Math.max(ie.length, E, 1);
2709
+ }
2710
+ const C = S(() => {
2711
+ const F = Math.max(1, A.value);
2712
+ return Array.from({ length: F }).map(
2713
+ (_, U) => `${o("report.section.datasource.styleTarget.breakdown")} ${U + 1}`
2714
+ );
2715
+ });
2716
+ function j(F, _) {
2717
+ const U = n(F) ?? "#000000", R = (E) => {
2718
+ const W = Number.parseInt(U.slice(E, E + 2), 16);
2719
+ return Math.round(W + (255 - W) * _).toString(16).padStart(2, "0").toUpperCase();
2720
+ };
2721
+ return `#${R(1)}${R(3)}${R(5)}`;
2722
+ }
2723
+ function $(F) {
2724
+ return Math.min(0.55 + (F - 1) * 0.18, 0.95);
2725
+ }
2726
+ function m(F, _, U) {
2727
+ return F * U + _;
2728
+ }
2729
+ function a(F, _, U, R) {
2730
+ const E = _.length;
2731
+ return F.length === 0 || E <= 0 ? [] : F.flatMap((W, X) => {
2732
+ const ae = ie[X % ie.length], K = U == null ? void 0 : U[m(X, 0, E)], ue = n(K) ?? ae;
2733
+ return _.map((Ae, _e) => {
2734
+ const Pe = m(X, _e, E), Ze = _e === 0 ? ue : j(ue, $(_e));
2735
+ return R && _e > 0 ? Ze : n(U == null ? void 0 : U[Pe]) ?? Ze;
2736
+ });
2737
+ });
2738
+ }
2739
+ const r = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
2740
+ function n(F) {
2741
+ if (!F)
2742
+ return null;
2743
+ const _ = F.trim();
2744
+ if (!r.test(_))
2745
+ return null;
2746
+ if (_.length === 4) {
2747
+ const U = _.charAt(1), R = _.charAt(2), E = _.charAt(3);
2748
+ return `#${U}${U}${R}${R}${E}${E}`.toUpperCase();
2749
+ }
2750
+ return _.toUpperCase();
2751
+ }
2752
+ function y(F, _) {
2753
+ return !Array.isArray(F) || F.length === 0 ? Array.from({ length: _ }).map(
2754
+ (U, R) => ie[R % ie.length]
2755
+ ) : Array.from({ length: _ }).map((U, R) => {
2756
+ const E = ie[R % ie.length];
2757
+ return n(F[R]) ?? E;
2758
+ });
2759
+ }
2760
+ function u(F, _) {
2761
+ if (_ <= 0)
2762
+ return [];
2763
+ const U = Array.from({ length: _ }, () => 0), R = /* @__PURE__ */ new Set();
2764
+ for (let W = 0; W < _; W++) {
2765
+ const X = Number(F == null ? void 0 : F[W]);
2766
+ Number.isInteger(X) && X >= 1 && X <= _ && !R.has(X) && (U[W] = X, R.add(X));
2767
+ }
2768
+ let E = 1;
2769
+ for (let W = 0; W < _; W++)
2770
+ if (U[W] === 0) {
2771
+ for (; R.has(E) && E <= _; )
2772
+ E++;
2773
+ U[W] = Math.min(E, _), R.add(U[W]);
2774
+ }
2775
+ return U;
2776
+ }
2777
+ const V = S(
2778
+ () => x(e.model.chartColorBinding)
2779
+ ), z = S(
2780
+ () => s(e.model.chartColors, e.model.chartColorLayers)
2781
+ ), B = S(() => te.value === le.series ? t(w.value) : T(te.value)), oe = S(
2782
+ () => Array.from({ length: B.value.length }).map((F, _) => ({
2783
+ label: `L${_ + 1}`,
2784
+ value: _ + 1
2785
+ }))
2786
+ ), Q = S(() => typeof e.showLayerControl == "boolean" ? e.showLayerControl : !!e.model.stackBarOverlap);
2787
+ S(
2788
+ () => y(
2789
+ e.model.chartColors,
2790
+ V.value === le.series ? z.value : T(V.value).length
2791
+ )
2792
+ ), S(
2793
+ () => u(
2794
+ e.model.chartColorLayers,
2795
+ V.value === le.series ? z.value : T(V.value).length
2796
+ )
2797
+ );
2798
+ const re = S(
2799
+ () => e.model.chartUseSecondaryMetricShades !== !1
2800
+ );
2801
+ S(
2802
+ () => a(
2803
+ C.value,
2804
+ f.value,
2805
+ e.model.chartBreakdownColors,
2806
+ re.value
2807
+ )
2808
+ );
2809
+ const ne = ee([]), I = ee([]), M = ee([]), q = ee(!0), te = ee(le.series), H = ee(!0), pe = ee(!1), be = ee(!1);
2810
+ he(
2811
+ [
2812
+ () => e.model.chartColors,
2813
+ () => e.model.chartColorBinding,
2814
+ () => e.model.chartBreakdownColors,
2815
+ () => e.model.chartUseSecondaryMetricShades,
2816
+ () => e.model.metrics,
2817
+ () => e.model.isBlend,
2818
+ () => e.model.joinDatasources
2819
+ ],
2820
+ ([F, _]) => {
2821
+ pe.value = !0, te.value = x(_), w.value = s(
2822
+ F,
2823
+ e.model.chartColorLayers
2824
+ ), A.value = g(
2825
+ e.model.chartBreakdownColors,
2826
+ Math.max(1, f.value.length)
2827
+ );
2828
+ const U = te.value === le.series ? w.value : T(te.value).length;
2829
+ ne.value = y(F, U), I.value = u(e.model.chartColorLayers, U), q.value = e.model.chartUseSecondaryMetricShades !== !1, M.value = a(
2830
+ C.value,
2831
+ f.value,
2832
+ e.model.chartBreakdownColors,
2833
+ q.value
2834
+ ), pe.value = !1;
2835
+ },
2836
+ { immediate: !0, deep: !0 }
2837
+ );
2838
+ function Be() {
2839
+ const F = te.value === le.series, _ = te.value === le.series ? ie.length : T(te.value).length, U = y(void 0, _), R = u(void 0, _), E = ne.value.length === U.length && ne.value.every((K, ue) => K === U[ue]), W = I.value.length === R.length && I.value.every((K, ue) => K === R[ue]), X = a(
2840
+ Array.from({ length: ie.length }, (K, ue) => `breakdown-${ue + 1}`),
2841
+ f.value,
2842
+ void 0,
2843
+ q.value
2844
+ ), ae = M.value.length === X.length && M.value.every((K, ue) => K === X[ue]);
2845
+ return {
2846
+ ...e.model,
2847
+ chartColorBinding: F ? void 0 : te.value,
2848
+ chartColors: E ? void 0 : [...ne.value],
2849
+ chartColorLayers: W ? void 0 : [...I.value],
2850
+ chartBreakdownColors: ae ? void 0 : [...M.value],
2851
+ chartUseSecondaryMetricShades: q.value
2852
+ };
2853
+ }
2854
+ function Le() {
2855
+ const F = Be();
2856
+ Tl(F) || i("update:model", F);
2857
+ }
2858
+ function Z() {
2859
+ pe.value || be.value || Le();
2860
+ }
2861
+ he(
2862
+ [
2863
+ ne,
2864
+ I,
2865
+ M,
2866
+ q,
2867
+ te,
2868
+ w,
2869
+ A
2870
+ ],
2871
+ () => {
2872
+ Z();
2873
+ },
2874
+ { deep: !0 }
2875
+ );
2876
+ function Ge(F, _) {
2877
+ const U = [...ne.value], R = ie[F % ie.length];
2878
+ U[F] = n(_) ?? R, ne.value = U;
2879
+ }
2880
+ function hl(F) {
2881
+ if (e.limitToSeriesMode)
2882
+ return;
2883
+ const _ = x(F);
2884
+ if (_ === te.value)
2885
+ return;
2886
+ const U = _ === le.series ? w.value : T(_).length;
2887
+ te.value = _, ne.value = y(ne.value, U), I.value = u(I.value, U), _ === le.breakdown && (M.value = a(
2888
+ C.value,
2889
+ f.value,
2890
+ M.value,
2891
+ q.value
2892
+ ));
2893
+ }
2894
+ function Je(F, _) {
2895
+ return F + 1 === _ ? "add" : "remove";
2896
+ }
2897
+ function wl(F) {
2898
+ const _ = Math.max(ie.length, w.value), U = F + 1;
2899
+ if (U === _) {
2900
+ const K = _ + Ve;
2901
+ w.value = K, ne.value = y(ne.value, K), I.value = u(I.value, K);
2902
+ return;
2903
+ }
2904
+ if (_ <= ie.length)
2905
+ return;
2906
+ const E = U, W = Math.max(ie.length, _ - Ve), X = [...ne.value], ae = [...I.value];
2907
+ X.splice(E, Ve), ae.splice(E, Ve), w.value = W, ne.value = y(X, W), I.value = u(ae, W);
2908
+ }
2909
+ function Cl(F) {
2910
+ const _ = Math.max(ie.length, A.value), U = F + 1;
2911
+ if (U === _) {
2912
+ const Ae = _ + Ve;
2913
+ A.value = Ae, M.value = a(
2914
+ Array.from({ length: Ae }, (_e, Pe) => `breakdown-${Pe + 1}`),
2915
+ f.value,
2916
+ M.value,
2917
+ q.value
2918
+ );
2919
+ return;
2920
+ }
2921
+ if (_ <= ie.length)
2922
+ return;
2923
+ const E = Math.max(1, f.value.length), X = U * E, ae = Ve * E, K = Math.max(ie.length, _ - Ve), ue = [...M.value];
2924
+ ue.splice(X, ae), A.value = K, M.value = a(
2925
+ Array.from({ length: K }, (Ae, _e) => `breakdown-${_e + 1}`),
2926
+ f.value,
2927
+ ue,
2928
+ q.value
2929
+ );
2930
+ }
2931
+ function xl(F, _) {
2932
+ const U = I.value.length;
2933
+ if (U <= 0)
2934
+ return;
2935
+ const R = Number(_);
2936
+ if (!Number.isInteger(R) || R < 1 || R > U)
2937
+ return;
2938
+ const E = [...I.value], W = E[F];
2939
+ if (W === R)
2940
+ return;
2941
+ const X = E.findIndex(
2942
+ (ae, K) => K !== F && ae === R
2943
+ );
2944
+ X >= 0 && (E[X] = W), E[F] = R, I.value = E;
2945
+ }
2946
+ function Vl(F, _) {
2947
+ const U = _.target;
2948
+ U && (be.value = !0, Ge(F, U.value));
2949
+ }
2950
+ function Fl(F, _) {
2951
+ const U = _.target;
2952
+ U && (Ge(F, U.value), be.value = !1, Z());
2953
+ }
2954
+ function kl(F, _, U) {
2955
+ const R = U.target;
2956
+ if (!R)
2957
+ return;
2958
+ be.value = !0;
2959
+ const E = n(R.value);
2960
+ if (!E)
2961
+ return;
2962
+ const W = f.value.length;
2963
+ if (W <= 0)
2964
+ return;
2965
+ const X = m(F, _, W), ae = [...M.value];
2966
+ if (ae[X] = E, q.value && _ === 0)
2967
+ for (let K = 1; K < W; K++) {
2968
+ const ue = m(F, K, W);
2969
+ ae[ue] = j(E, $(K));
2970
+ }
2971
+ M.value = ae;
2972
+ }
2973
+ function _l(F, _, U) {
2974
+ const R = U.target;
2975
+ if (!R)
2976
+ return;
2977
+ const E = n(R.value);
2978
+ if (!E) {
2979
+ be.value = !1, Z();
2980
+ return;
2981
+ }
2982
+ const W = f.value.length;
2983
+ if (W <= 0) {
2984
+ be.value = !1, Z();
2985
+ return;
2986
+ }
2987
+ const X = m(F, _, W), ae = [...M.value];
2988
+ if (ae[X] = E, q.value && _ === 0)
2989
+ for (let K = 1; K < W; K++) {
2990
+ const ue = m(F, K, W);
2991
+ ae[ue] = j(E, $(K));
2992
+ }
2993
+ M.value = ae, be.value = !1, Z();
2994
+ }
2995
+ function Ke(F, _) {
2996
+ const U = Array.isArray(F) ? F : [], R = Array.isArray(_) ? _ : [];
2997
+ return U.length !== R.length ? !1 : U.every((E, W) => E === R[W]);
2998
+ }
2999
+ function Sl(F, _) {
3000
+ const U = Array.isArray(F) ? F : [], R = Array.isArray(_) ? _ : [];
3001
+ return U.length !== R.length ? !1 : U.every((E, W) => Number(E) === Number(R[W]));
3002
+ }
3003
+ function Tl(F) {
3004
+ return F.chartColorBinding === e.model.chartColorBinding && F.chartUseSecondaryMetricShades === e.model.chartUseSecondaryMetricShades && Ke(F.chartColors, e.model.chartColors) && Sl(F.chartColorLayers, e.model.chartColorLayers) && Ke(F.chartBreakdownColors, e.model.chartBreakdownColors);
3005
+ }
3006
+ function $l(F) {
3007
+ q.value = F, M.value = a(
3008
+ Array.from({ length: A.value }, (_, U) => `breakdown-${U + 1}`),
3009
+ f.value,
3010
+ M.value,
3011
+ q.value
3012
+ );
3013
+ }
3014
+ function Ul() {
3015
+ te.value = le.series, w.value = ie.length, A.value = ie.length, ne.value = y(void 0, ie.length), I.value = u(void 0, ie.length), q.value = !0, M.value = a(
3016
+ Array.from({ length: ie.length }, (F, _) => `breakdown-${_ + 1}`),
3017
+ f.value,
3018
+ void 0,
3019
+ !0
3020
+ );
3021
+ }
3022
+ function Dl() {
3023
+ H.value = !H.value;
3024
+ }
3025
+ function Qe(F) {
3026
+ return (F + 1) % Ve === 0;
3027
+ }
3028
+ return ul(() => {
3029
+ be.value = !1;
3030
+ }), (F, _) => {
3031
+ const U = D("FmButton"), R = D("FmSelect"), E = D("FmCheckbox");
3032
+ return v(), P("div", bt, [
3033
+ b("div", ht, [
3034
+ d(U, {
3035
+ variant: "tertiary",
3036
+ size: "md",
3037
+ class: "min-w-0 flex-1 !justify-start",
3038
+ label: l(o)("report.section.datasource.chartColor.title"),
3039
+ "prepend-icon": H.value ? "expand_less" : "expand_more",
3040
+ "aria-expanded": H.value ? "true" : "false",
3041
+ onClick: Dl
3042
+ }, null, 8, ["label", "prepend-icon", "aria-expanded"]),
3043
+ H.value ? (v(), P("div", wt, [
3044
+ d(U, {
3045
+ variant: "tertiary",
3046
+ "text-color": "text-fm-color-system-info-300",
3047
+ size: "md",
3048
+ label: l(o)("report.section.datasource.chartColor.reset"),
3049
+ onClick: Ul
3050
+ }, null, 8, ["label"])
3051
+ ])) : N("", !0)
3052
+ ]),
3053
+ we(b("div", Ct, [
3054
+ d(R, {
3055
+ "model-value": te.value,
3056
+ items: h.value,
3057
+ "onUpdate:modelValue": hl
3058
+ }, null, 8, ["model-value", "items"]),
3059
+ te.value === l(le).breakdown ? (v(), O(E, {
3060
+ key: 0,
3061
+ "model-value": q.value,
3062
+ value: !1,
3063
+ label: l(o)("report.section.datasource.chartColor.secondaryMetricAutoShade"),
3064
+ "onUpdate:modelValue": _[0] || (_[0] = (W) => $l(!!W)),
3065
+ class: "p-4"
3066
+ }, null, 8, ["model-value", "label"])) : N("", !0),
3067
+ te.value !== l(le).breakdown ? (v(), P("div", xt, [
3068
+ (v(!0), P(de, null, xe(ne.value, (W, X) => (v(), P(de, {
3069
+ key: `series-color-${X}`
3070
+ }, [
3071
+ b("div", {
3072
+ class: ke([
3073
+ "fm-shadow-light-100 rounded-md border border-fm-color-neutral-gray-100 p-10",
3074
+ Q.value ? "flex flex-col gap-8" : "flex items-center justify-between gap-12"
3075
+ ])
3076
+ }, [
3077
+ b("span", {
3078
+ class: ke(["fm-typo-en-body-lg-600 min-w-0", Q.value ? "line-clamp-2 break-words" : "flex-1"]),
3079
+ title: B.value[X] || `${l(o)("report.section.datasource.chartColor.color")} ${X + 1}`
3080
+ }, J(B.value[X] || `${l(o)("report.section.datasource.chartColor.color")} ${X + 1}`), 11, Vt),
3081
+ b("div", {
3082
+ class: ke(["flex items-center gap-8", Q.value ? "justify-between" : "shrink-0"])
3083
+ }, [
3084
+ Q.value ? (v(), O(R, {
3085
+ key: 0,
3086
+ class: "min-w-[92px]",
3087
+ "model-value": I.value[X],
3088
+ items: oe.value,
3089
+ "onUpdate:modelValue": (ae) => xl(X, ae)
3090
+ }, null, 8, ["model-value", "items", "onUpdate:modelValue"])) : N("", !0),
3091
+ b("label", {
3092
+ class: "relative inline-flex min-h-[34px] cursor-pointer items-center gap-[8px] rounded-[8px] border border-[#d8d8d8] bg-white py-[4px] pl-[4px] pr-[8px]",
3093
+ "aria-label": `Color ${X + 1}`
3094
+ }, [
3095
+ b("span", {
3096
+ class: "inline-block h-[20px] w-[28px] rounded-[4px] border border-[#cfcfcf]",
3097
+ style: Ee({ backgroundColor: W })
3098
+ }, null, 4),
3099
+ b("span", kt, J(W), 1),
3100
+ b("input", {
3101
+ type: "color",
3102
+ value: W,
3103
+ class: "absolute inset-0 cursor-pointer opacity-0",
3104
+ onInput: (ae) => Vl(X, ae),
3105
+ onChange: (ae) => Fl(X, ae)
3106
+ }, null, 40, _t)
3107
+ ], 8, Ft)
3108
+ ], 2)
3109
+ ], 2),
3110
+ Qe(X) ? (v(), P("div", St, [
3111
+ d(U, {
3112
+ class: "w-full",
3113
+ size: "md",
3114
+ icon: Je(X, w.value),
3115
+ onClick: (ae) => wl(X)
3116
+ }, null, 8, ["icon", "onClick"])
3117
+ ])) : N("", !0)
3118
+ ], 64))), 128))
3119
+ ])) : (v(), P("div", Tt, [
3120
+ (v(!0), P(de, null, xe(C.value, (W, X) => (v(), P(de, {
3121
+ key: `breakdown-group-${X}`
3122
+ }, [
3123
+ b("div", $t, [
3124
+ b("div", Ut, [
3125
+ b("span", {
3126
+ class: "fm-typo-en-body-lg-600 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",
3127
+ title: W
3128
+ }, J(W), 9, Dt)
3129
+ ]),
3130
+ (v(!0), P(de, null, xe(f.value, (ae, K) => (v(), P("div", {
3131
+ key: `${W}-${ae}-${K}`,
3132
+ class: "flex items-center justify-between gap-8 py-4"
3133
+ }, [
3134
+ b("span", {
3135
+ class: "fm-typo-en-body-md-400 min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap",
3136
+ title: ae
3137
+ }, J(ae), 9, Bt),
3138
+ b("label", {
3139
+ class: ke(["relative inline-flex min-h-[34px] w-full max-w-[126px] items-center gap-[8px] rounded-[8px] border border-[#d8d8d8] bg-white py-[4px] pl-[4px] pr-[8px]", {
3140
+ "cursor-not-allowed opacity-[0.55]": q.value && K > 0,
3141
+ "cursor-pointer": !(q.value && K > 0)
3142
+ }]),
3143
+ "aria-label": `Breakdown color ${X + 1}-${K + 1}`
3144
+ }, [
3145
+ b("span", {
3146
+ class: "inline-block h-[20px] w-[28px] rounded-[4px] border border-[#cfcfcf]",
3147
+ style: Ee({
3148
+ backgroundColor: M.value[m(X, K, f.value.length)]
3149
+ })
3150
+ }, null, 4),
3151
+ b("span", At, J(M.value[m(X, K, f.value.length)]), 1),
3152
+ b("input", {
3153
+ type: "color",
3154
+ value: M.value[m(X, K, f.value.length)],
3155
+ class: ke(["absolute inset-0 opacity-0", {
3156
+ "cursor-not-allowed": q.value && K > 0,
3157
+ "cursor-pointer": !(q.value && K > 0)
3158
+ }]),
3159
+ disabled: q.value && K > 0,
3160
+ onInput: (ue) => kl(X, K, ue),
3161
+ onChange: (ue) => _l(X, K, ue)
3162
+ }, null, 42, Mt)
3163
+ ], 10, Lt)
3164
+ ]))), 128))
3165
+ ]),
3166
+ Qe(X) ? (v(), P("div", Nt, [
3167
+ d(U, {
3168
+ class: "w-full",
3169
+ size: "md",
3170
+ icon: Je(X, A.value),
3171
+ onClick: (ae) => Cl(X)
3172
+ }, null, 8, ["icon", "onClick"])
3173
+ ])) : N("", !0)
3174
+ ], 64))), 128))
3175
+ ]))
3176
+ ], 512), [
3177
+ [Ce, H.value]
3178
+ ])
3179
+ ]);
3180
+ };
3181
+ }
3182
+ }), zt = { class: "flex flex-col gap-8" }, jt = { class: "flex items-center justify-between" }, Rt = { class: "fm-typo-en-body-lg-600" }, It = { class: "flex items-center gap-8 text-fm-color-system-info-300" }, Pt = { class: "grid grid-cols-2 gap-8" }, Xt = { class: "flex items-center gap-8" }, Et = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Wt = /* @__PURE__ */ se({
3183
+ __name: "ChartLineStyleSection",
3184
+ props: {
3185
+ model: {}
3186
+ },
3187
+ emits: ["update:model"],
3188
+ setup(L, { emit: c }) {
3189
+ const e = L, i = c, { t: o } = ce(), h = S(() => [
3190
+ {
3191
+ label: o("report.section.datasource.styleTarget.series"),
3192
+ value: le.series
3193
+ },
3194
+ {
3195
+ label: o("report.section.datasource.styleTarget.metric"),
3196
+ value: le.metric
3197
+ }
3198
+ ]);
3199
+ function x(u) {
3200
+ return u && typeof u == "object" && "value" in u ? x(u.value) : u === le.metric ? le.metric : le.series;
3201
+ }
3202
+ function p(u, V) {
3203
+ var B, oe;
3204
+ return u ? ((B = u.label) == null ? void 0 : B.trim()) || ((oe = u.name) == null ? void 0 : oe.trim()) || `${o("report.section.datasource.styleTarget.metric")} ${V + 1}` : `${o("report.section.datasource.styleTarget.metric")} ${V + 1}`;
3205
+ }
3206
+ function k() {
3207
+ const u = Array.isArray(e.model.metrics) ? e.model.metrics : [];
3208
+ if (!e.model.isBlend)
3209
+ return u;
3210
+ const V = Array.isArray(e.model.joinDatasources) ? e.model.joinDatasources.flatMap(
3211
+ (z) => Array.isArray(z == null ? void 0 : z.metrics) ? z.metrics : []
3212
+ ) : [];
3213
+ return [...u, ...V];
3214
+ }
3215
+ function T(u) {
3216
+ if (u === le.metric) {
3217
+ const V = k();
3218
+ if (V.length > 0)
3219
+ return V.map((z, B) => p(z, B));
3220
+ }
3221
+ return ie.map(
3222
+ (V, z) => `${o("report.section.datasource.lineStyle.series")} ${z + 1}`
3223
+ );
3224
+ }
3225
+ const t = S(() => [
3226
+ {
3227
+ label: o("report.section.datasource.lineStyle.solid"),
3228
+ value: "solid"
3229
+ },
3230
+ {
3231
+ label: o("report.section.datasource.lineStyle.dashed"),
3232
+ value: "dashed"
3233
+ },
3234
+ {
3235
+ label: o("report.section.datasource.lineStyle.dotted"),
3236
+ value: "dotted"
3237
+ }
3238
+ ]);
3239
+ function s(u) {
3240
+ return u && typeof u == "object" && "value" in u ? s(u.value) : u === "dashed" || u === "DASHED" ? "dashed" : u === "dotted" || u === "DOTTED" ? "dotted" : "solid";
3241
+ }
3242
+ function f(u) {
3243
+ return u === "dashed" ? "line-style-icon--dashed" : u === "dotted" ? "line-style-icon--dotted" : "line-style-icon--solid";
3244
+ }
3245
+ function w(u, V) {
3246
+ return !Array.isArray(u) || u.length === 0 ? Array.from({ length: V }).map(
3247
+ (z, B) => nl[B] ?? "solid"
3248
+ ) : Array.from({ length: V }).map(
3249
+ (z, B) => s(u[B])
3250
+ );
3251
+ }
3252
+ const A = S(
3253
+ () => x(e.model.lineStyleBinding)
3254
+ ), g = S(() => T($.value)), C = S(
3255
+ () => w(e.model.lineStyles, T(A.value).length)
3256
+ ), j = ee([]), $ = ee(le.series);
3257
+ he(
3258
+ [
3259
+ () => e.model.lineStyles,
3260
+ () => e.model.lineStyleBinding,
3261
+ () => e.model.metrics,
3262
+ () => e.model.isBlend,
3263
+ () => e.model.joinDatasources
3264
+ ],
3265
+ ([u, V]) => {
3266
+ $.value = x(V), j.value = w(
3267
+ u,
3268
+ T($.value).length
3269
+ );
3270
+ },
3271
+ { immediate: !0, deep: !0 }
3272
+ );
3273
+ const m = S(() => $.value !== A.value || j.value.length !== C.value.length ? !0 : j.value.some((u, V) => u !== C.value[V]));
3274
+ function a(u, V) {
3275
+ const z = [...j.value];
3276
+ z[u] = s(V), j.value = z;
3277
+ }
3278
+ function r(u) {
3279
+ const V = x(u);
3280
+ if (V === $.value)
3281
+ return;
3282
+ const z = T(V).length;
3283
+ $.value = V, j.value = w(j.value, z);
3284
+ }
3285
+ function n() {
3286
+ $.value = le.series, j.value = [...nl];
3287
+ }
3288
+ function y() {
3289
+ const u = $.value === le.series, V = j.value.every((z) => z === "solid");
3290
+ i("update:model", {
3291
+ ...e.model,
3292
+ lineStyleBinding: u ? void 0 : $.value,
3293
+ lineStyles: V ? void 0 : [...j.value]
3294
+ });
3295
+ }
3296
+ return (u, V) => {
3297
+ const z = D("FmButton"), B = D("FmSelect");
3298
+ return v(), P("div", zt, [
3299
+ b("div", jt, [
3300
+ b("p", Rt, J(l(o)("report.section.datasource.lineStyle.title")), 1),
3301
+ b("div", It, [
3302
+ d(z, {
3303
+ variant: "tertiary",
3304
+ "text-color": "text-fm-color-system-info-300",
3305
+ size: "md",
3306
+ label: l(o)("report.section.datasource.lineStyle.reset"),
3307
+ onClick: n
3308
+ }, null, 8, ["label"])
3309
+ ])
3310
+ ]),
3311
+ d(B, {
3312
+ "model-value": $.value,
3313
+ items: h.value,
3314
+ label: l(o)("report.section.datasource.styleTarget.title"),
3315
+ "onUpdate:modelValue": r
3316
+ }, null, 8, ["model-value", "items", "label"]),
3317
+ b("div", Pt, [
3318
+ (v(!0), P(de, null, xe(j.value, (oe, Q) => (v(), P("div", {
3319
+ key: Q,
3320
+ class: "flex items-center justify-between gap-8 rounded-md border border-fm-color-neutral-gray-100 px-8 py-6"
3321
+ }, [
3322
+ b("div", Xt, [
3323
+ b("span", {
3324
+ class: ke(["line-style-icon", f(oe)]),
3325
+ "aria-hidden": "true"
3326
+ }, null, 2),
3327
+ b("span", Et, J(g.value[Q] || `${l(o)("report.section.datasource.lineStyle.line")} ${Q + 1}`), 1)
3328
+ ]),
3329
+ d(B, {
3330
+ "model-value": oe,
3331
+ items: t.value,
3332
+ class: "w-[130px]",
3333
+ "onUpdate:modelValue": (re) => a(Q, re)
3334
+ }, null, 8, ["model-value", "items", "onUpdate:modelValue"])
3335
+ ]))), 128))
3336
+ ]),
3337
+ d(z, {
3338
+ size: "md",
3339
+ label: l(o)("report.common.apply"),
3340
+ disabled: !m.value,
3341
+ onClick: y
3342
+ }, null, 8, ["label", "disabled"])
3343
+ ]);
3344
+ };
3345
+ }
3346
+ }), qt = /* @__PURE__ */ vl(Wt, [["__scopeId", "data-v-f1c35513"]]), Ht = { class: "flex flex-col gap-16" }, Yt = {
3347
+ key: 2,
3348
+ class: "h-px w-full bg-fm-color-neutral-gray-100"
3349
+ }, Gt = { class: "flex flex-col gap-8" }, Jt = { class: "fm-typo-en-body-lg-600" }, Kt = { class: "flex flex-col gap-8" }, Qt = /* @__PURE__ */ se({
3350
+ __name: "StyleDatasource",
3351
+ props: /* @__PURE__ */ ve({
3352
+ label: {
3353
+ type: String,
3354
+ default: "Label"
3355
+ },
3356
+ config: {
3357
+ type: Object,
3358
+ default: null
3359
+ },
3360
+ closeable: {
3361
+ type: Boolean,
3362
+ default: !1
3363
+ },
3364
+ mainDatasourceConfig: {
3365
+ type: Object,
3366
+ default: () => {
3367
+ }
3368
+ },
3369
+ modelValue: {
3370
+ type: Object,
3371
+ default: () => {
3372
+ }
3373
+ }
3374
+ }, {
3375
+ modelValue: { required: !0 },
3376
+ modelModifiers: {}
3377
+ }),
3378
+ emits: /* @__PURE__ */ ve(["click-close"], ["update:modelValue"]),
3379
+ setup(L, { emit: c }) {
3380
+ const e = ge(L, "modelValue");
3381
+ he(
3382
+ [() => e.value.dimensions, () => e.value.metrics],
3383
+ () => {
3384
+ const { rowIds: s, columnIds: f } = je(e.value);
3385
+ e.value.rowIds = s, e.value.columnIds = f;
3386
+ },
3387
+ { deep: !0 }
3388
+ );
3389
+ const i = L, o = c, { t: h } = ce(), x = S(() => i.config.type === G.Circular), p = S(() => i.config.type === G.StackBarChart || i.config.type === G.ClusteredStackBarChart), k = S(
3390
+ () => i.config.type === G.LineChart || i.config.type === G.StackLineChart
3391
+ ), T = S({
3392
+ get: () => e.value.maxTooltipItems ?? null,
3393
+ set: (s) => {
3394
+ e.value = {
3395
+ ...e.value,
3396
+ maxTooltipItems: s ?? void 0
3397
+ };
3398
+ }
3399
+ }), t = S({
3400
+ get: () => e.value.stackBarOverlap ?? !1,
3401
+ set: (s) => {
3402
+ e.value = {
3403
+ ...e.value,
3404
+ stackBarOverlap: s
3405
+ };
3406
+ }
3407
+ });
3408
+ return (s, f) => {
3409
+ const w = D("FmButton"), A = D("FmCheckbox"), g = D("FmStepperField");
3410
+ return v(), P(de, null, [
3411
+ f[10] || (f[10] = b("div", { class: "grow" }, null, -1)),
3412
+ i.closeable ? (v(), O(w, {
3413
+ key: 0,
3414
+ icon: "close",
3415
+ variant: "tertiary",
3416
+ size: "md",
3417
+ onClick: f[0] || (f[0] = ye((C) => o("click-close"), ["stop"]))
3418
+ })) : N("", !0),
3419
+ b("div", Ht, [
3420
+ i.config.hasChart ? (v(), O(yt, {
3421
+ key: 0,
3422
+ model: e.value,
3423
+ "onUpdate:model": f[1] || (f[1] = (C) => e.value = C)
3424
+ }, null, 8, ["model"])) : N("", !0),
3425
+ i.config.hasChart ? (v(), O(Ot, {
3426
+ key: 1,
3427
+ model: e.value,
3428
+ "show-layer-control": p.value && t.value,
3429
+ "limit-to-series-mode": x.value,
3430
+ "onUpdate:model": f[2] || (f[2] = (C) => e.value = C)
3431
+ }, null, 8, ["model", "show-layer-control", "limit-to-series-mode"])) : N("", !0),
3432
+ i.config.hasChart && k.value ? (v(), P("div", Yt)) : N("", !0),
3433
+ i.config.hasChart && k.value ? (v(), O(qt, {
3434
+ key: 3,
3435
+ model: e.value,
3436
+ "onUpdate:model": f[3] || (f[3] = (C) => e.value = C)
3437
+ }, null, 8, ["model"])) : N("", !0),
3438
+ f[9] || (f[9] = b("div", { class: "h-px w-full bg-fm-color-neutral-gray-100" }, null, -1)),
3439
+ b("div", Gt, [
3440
+ b("p", Jt, J(l(h)("report.section.style.configuration")), 1),
3441
+ b("div", Kt, [
3442
+ p.value ? (v(), O(A, {
3443
+ key: 0,
3444
+ modelValue: t.value,
3445
+ "onUpdate:modelValue": f[4] || (f[4] = (C) => t.value = C),
3446
+ class: "fm-typo-en-body-lg-400",
3447
+ label: l(h)("report.section.datasource.stackBar.overlapBars")
3448
+ }, null, 8, ["modelValue", "label"])) : N("", !0),
3449
+ i.config.hasLabel ? (v(), O(lt, {
3450
+ key: 1,
3451
+ model: e.value,
3452
+ "onUpdate:model": f[5] || (f[5] = (C) => e.value = C)
3453
+ }, null, 8, ["model"])) : N("", !0),
3454
+ i.config.hasLegend ? (v(), O(ft, {
3455
+ key: 2,
3456
+ model: e.value,
3457
+ "is-circular-widget": x.value,
3458
+ "onUpdate:model": f[6] || (f[6] = (C) => e.value = C)
3459
+ }, null, 8, ["model", "is-circular-widget"])) : N("", !0),
3460
+ i.config.hasXy ? (v(), O(ut, {
3461
+ key: 3,
3462
+ model: e.value,
3463
+ "onUpdate:model": f[7] || (f[7] = (C) => e.value = C)
3464
+ }, null, 8, ["model"])) : N("", !0),
3465
+ i.config.hasXy ? (v(), O(g, {
3466
+ key: 4,
3467
+ modelValue: T.value,
3468
+ "onUpdate:modelValue": f[8] || (f[8] = (C) => T.value = C),
3469
+ type: "number",
3470
+ label: l(h)("report.section.datasource.tooltip.maxTooltipItems"),
3471
+ min: 2,
3472
+ max: 20,
3473
+ placeholder: "Auto"
3474
+ }, null, 8, ["modelValue", "label"])) : N("", !0)
3475
+ ])
3476
+ ])
3477
+ ])
3478
+ ], 64);
3479
+ };
3480
+ }
3481
+ }), Zt = { class: "fixed bottom-6 right-6" }, ea = { class: "flex w-full items-center gap-8" }, la = { class: "fm-typo-en-title-sm-600" }, oa = { class: "ml-auto text-fm-color-system-info-300" }, ta = /* @__PURE__ */ se({
3482
+ __name: "StyleEditorTab",
3483
+ props: {
3484
+ modelValue: {
3485
+ required: !0
3486
+ },
3487
+ modelModifiers: {},
3488
+ isStyleEditing: { type: Boolean, required: !1, default: !1 },
3489
+ isStyleEditingModifiers: {}
3490
+ },
3491
+ emits: ["update:modelValue", "update:isStyleEditing"],
3492
+ setup(L) {
3493
+ const { t: c } = ce(), e = ge(L, "modelValue"), i = S(
3494
+ () => Ie.find((p) => p.type === e.value.widget.type)
3495
+ ), o = ge(L, "isStyleEditing"), h = S(() => {
3496
+ var p;
3497
+ return {
3498
+ chartHeight: void 0,
3499
+ chartWidth: void 0,
3500
+ chartColors: void 0,
3501
+ chartColorLayers: void 0,
3502
+ chartBreakdownColors: void 0,
3503
+ chartUseSecondaryMetricShades: void 0,
3504
+ chartColorBinding: void 0,
3505
+ lineStyles: void 0,
3506
+ lineStyleBinding: void 0,
3507
+ showLabel: !1,
3508
+ labelAlign: Fe.center,
3509
+ labelAnchor: Ne.center,
3510
+ labelRotation: 0,
3511
+ labelOffset: 0,
3512
+ labelFontSize: 12,
3513
+ showX: !0,
3514
+ xPosition: Gl.bottom,
3515
+ showXGrid: !1,
3516
+ showXTick: !0,
3517
+ xTickFontSize: 12,
3518
+ showXTitle: !1,
3519
+ xTitle: "",
3520
+ xTitleFontSize: 12,
3521
+ showY: !0,
3522
+ yPosition: Yl.left,
3523
+ showYGrid: !1,
3524
+ showYTick: !0,
3525
+ yTickFontSize: 12,
3526
+ showYTitle: !1,
3527
+ yTitle: "",
3528
+ yTitleFontSize: 12,
3529
+ showLegend: ((p = i.value) == null ? void 0 : p.type) === G.Circular,
3530
+ legendPosition: Hl.top,
3531
+ usePointStyle: !0,
3532
+ legendFontSize: void 0,
3533
+ legendColor: "#6b6b6b",
3534
+ legendMaxWidth: void 0,
3535
+ maxTooltipItems: void 0,
3536
+ stackBarOverlap: !1
3537
+ };
3538
+ });
3539
+ function x() {
3540
+ e.value && (e.value.widget.config = {
3541
+ ...e.value.widget.config,
3542
+ ...h.value
3543
+ });
3544
+ }
3545
+ return (p, k) => {
3546
+ const T = D("FmCircularProgress"), t = D("FmButton"), s = D("FmSideSheet");
3547
+ return v(), O(s, {
3548
+ modelValue: o.value,
3549
+ "onUpdate:modelValue": k[2] || (k[2] = (f) => o.value = f),
3550
+ "close-button": !1,
3551
+ "no-overlay": "",
3552
+ "dismiss-away": !0,
3553
+ "max-width": 500
3554
+ }, {
3555
+ "side-sheet-button": Y(() => [
3556
+ b("div", Zt, [
3557
+ d(t, {
3558
+ label: l(c)("report.section.style.button"),
3559
+ icon: "edit",
3560
+ variant: "secondary",
3561
+ size: "md"
3562
+ }, null, 8, ["label"])
3563
+ ])
3564
+ ]),
3565
+ "side-sheet-header": Y(() => [
3566
+ b("div", ea, [
3567
+ d(t, {
3568
+ "prepend-icon": "arrow_back",
3569
+ variant: "tertiary",
3570
+ class: "fm-icon--rounded fm-icon--md text-fm-color-black",
3571
+ onClick: k[0] || (k[0] = (f) => o.value = !1)
3572
+ }),
3573
+ b("p", la, J(l(c)("report.section.style.title")), 1),
3574
+ b("div", oa, [
3575
+ d(t, {
3576
+ label: l(c)("report.section.style.reset"),
3577
+ variant: "tertiary",
3578
+ size: "md",
3579
+ onClick: x,
3580
+ "text-color": "text-fm-color-system-info-300"
3581
+ }, null, 8, ["label"])
3582
+ ])
3583
+ ])
3584
+ ]),
3585
+ default: Y(() => [
3586
+ e.value ? N("", !0) : (v(), O(T, { key: 0 })),
3587
+ d(Qt, {
3588
+ modelValue: e.value.widget.config,
3589
+ "onUpdate:modelValue": k[1] || (k[1] = (f) => e.value.widget.config = f),
3590
+ config: i.value
3591
+ }, null, 8, ["modelValue", "config"])
3592
+ ]),
3593
+ _: 1
3594
+ }, 8, ["modelValue"]);
3595
+ };
3596
+ }
3597
+ }), aa = { class: "bg-fm-color-neutral-white flex flex-col h-full w-[510px]" }, na = { class: "flex bg-fm-color-neutral-white w-[88px]" }, ia = { class: "w-full overflow-y-auto" }, sa = {
3598
+ class: "grid grid-cols-12 w-full p-24",
3599
+ style: { backgroundColor: "#F6F8FC" }
3600
+ }, ra = /* @__PURE__ */ se({
3601
+ __name: "TileEditorDesktop",
3602
+ props: /* @__PURE__ */ ve({
3603
+ hideConfiguration: { type: Boolean, required: !0, default: !1 },
3604
+ index: { type: Number, required: !0, default: 0 }
3605
+ }, {
3606
+ modelValue: {
3607
+ required: !0
3608
+ },
3609
+ modelModifiers: {}
3610
+ }),
3611
+ emits: /* @__PURE__ */ ve(["hideConfiguration"], ["update:modelValue"]),
3612
+ setup(L, { emit: c }) {
3613
+ const e = ge(L, "modelValue"), i = L, o = S(
3614
+ () => Ie.find((T) => {
3615
+ var t;
3616
+ return T.type === ((t = e.value) == null ? void 0 : t.widget.type);
3617
+ })
3618
+ ), h = c, x = [
3619
+ G.BarChart,
3620
+ G.StackBarChart,
3621
+ G.ClusteredStackBarChart,
3622
+ G.LineChart,
3623
+ G.StackLineChart,
3624
+ G.Circular
3625
+ ], p = S(() => x.includes(e.value.widget.type)), k = ee(!1);
3626
+ return (T, t) => {
3627
+ const s = D("FmCircularProgress"), f = D("FmButton");
3628
+ return v(), P("div", null, [
3629
+ e.value ? (v(), P(de, { key: 1 }, [
3630
+ d(Il, {
3631
+ "model-value": !L.hideConfiguration
3632
+ }, {
3633
+ right: Y(() => [
3634
+ b("div", aa, [
3635
+ d(bl, {
3636
+ modelValue: e.value,
3637
+ "onUpdate:modelValue": t[0] || (t[0] = (w) => e.value = w),
3638
+ config: o.value,
3639
+ "hide-configuration": L.hideConfiguration,
3640
+ onHideConfiguration: t[1] || (t[1] = (w) => {
3641
+ h("hideConfiguration", w);
3642
+ })
3643
+ }, null, 8, ["modelValue", "config", "hide-configuration"])
3644
+ ])
3645
+ ]),
3646
+ left: Y(() => [
3647
+ b("div", na, [
3648
+ d(f, {
3649
+ variant: "secondary",
3650
+ icon: "keyboard_double_arrow_right",
3651
+ "border-color": l(tl).ColorPrimary,
3652
+ "text-color": l(tl).ColorPrimary,
3653
+ class: "m-24 my-16",
3654
+ size: "md",
3655
+ onClick: t[2] || (t[2] = (w) => h("hideConfiguration", !i.hideConfiguration))
3656
+ }, null, 8, ["border-color", "text-color"])
3657
+ ])
3658
+ ]),
3659
+ _: 1
3660
+ }, 8, ["model-value"]),
3661
+ b("div", ia, [
3662
+ b("div", sa, [
3663
+ e.value ? (v(), O(gl, {
3664
+ key: 0,
3665
+ "model-value": e.value,
3666
+ index: i.index,
3667
+ "hide-export": !0,
3668
+ "is-style-editing": k.value
3669
+ }, null, 8, ["model-value", "index", "is-style-editing"])) : (v(), O(yl, { key: 1 }))
3670
+ ])
3671
+ ]),
3672
+ p.value ? (v(), O(ta, {
3673
+ key: 0,
3674
+ modelValue: e.value,
3675
+ "onUpdate:modelValue": t[3] || (t[3] = (w) => e.value = w),
3676
+ "is-style-editing": k.value,
3677
+ "onUpdate:isStyleEditing": t[4] || (t[4] = (w) => k.value = w),
3678
+ "hide-configuration": L.hideConfiguration,
3679
+ onHideConfiguration: t[5] || (t[5] = (w) => {
3680
+ h("hideConfiguration", w);
3681
+ })
3682
+ }, null, 8, ["modelValue", "is-style-editing", "hide-configuration"])) : N("", !0)
3683
+ ], 64)) : (v(), O(s, { key: 0 }))
3684
+ ]);
3685
+ };
3686
+ }
3687
+ }), ua = {
3688
+ key: 0,
3689
+ class: "flex w-full justify-center items-center"
3690
+ }, da = { class: "w-full grid grid-cols-12 pb-28 pt-5 px-5 h-full" }, ma = /* @__PURE__ */ se({
3691
+ __name: "TileEditorMobile",
3692
+ props: /* @__PURE__ */ ve({
3693
+ hideConfiguration: { type: Boolean, required: !0, default: !1 },
3694
+ index: { type: Number, required: !0, default: 0 }
3695
+ }, {
3696
+ modelValue: {
3697
+ required: !0
3698
+ },
3699
+ modelModifiers: {}
3700
+ }),
3701
+ emits: /* @__PURE__ */ ve(["hideConfiguration"], ["update:modelValue"]),
3702
+ setup(L, { emit: c }) {
3703
+ const e = ge(L, "modelValue"), i = L, o = S(
3704
+ () => Ie.find((x) => {
3705
+ var p;
3706
+ return x.type === ((p = e.value) == null ? void 0 : p.widget.type);
3707
+ })
3708
+ ), h = c;
3709
+ return (x, p) => {
3710
+ const k = D("FmCircularProgress");
3711
+ return v(), P("div", null, [
3712
+ e.value ? (v(), P(de, { key: 1 }, [
3713
+ b("div", da, [
3714
+ e.value ? (v(), O(gl, {
3715
+ key: 0,
3716
+ "model-value": e.value,
3717
+ index: i.index,
3718
+ "hide-export": !0
3719
+ }, null, 8, ["model-value", "index"])) : (v(), O(yl, { key: 1 }))
3720
+ ]),
3721
+ d(bl, {
3722
+ modelValue: e.value,
3723
+ "onUpdate:modelValue": p[0] || (p[0] = (T) => e.value = T),
3724
+ config: o.value,
3725
+ "hide-configuration": L.hideConfiguration,
3726
+ onHideConfiguration: p[1] || (p[1] = (T) => {
3727
+ h("hideConfiguration", T);
3728
+ })
3729
+ }, null, 8, ["modelValue", "config", "hide-configuration"])
3730
+ ], 64)) : (v(), P("div", ua, [
3731
+ d(k)
3732
+ ]))
3733
+ ]);
3734
+ };
3735
+ }
3736
+ }), ca = {
3737
+ key: 0,
3738
+ class: "fm-typo-en-title-md-600"
3739
+ }, pa = {
3740
+ key: 0,
3741
+ class: "flex items-start justify-start px-24 py-12 flex-wrap w-full"
3742
+ }, Ta = /* @__PURE__ */ se({
3743
+ __name: "TileEditor",
3744
+ setup(L) {
3745
+ const { rowHeight: c, colWidths: e } = Se(Oe()), i = Ml(), o = Nl(), h = Wl(), { globalFilters: x } = Se(fl()), { currentSelectWidgetType: p, editingReport: k, editingTile: T, editingTileIndex: t } = Se(h), { breakpoints: s } = pl(), { promptMessage: f } = cl(), { t: w, te: A } = ce(), g = S(() => {
3746
+ var n;
3747
+ const a = (n = T.value) == null ? void 0 : n.widget.type;
3748
+ if (!a)
3749
+ return w("report.editor.newReport");
3750
+ const r = `report.widget.types.${a.toLowerCase()}`;
3751
+ return A(r) ? w(r) : a;
3752
+ }), C = ee(!1);
3753
+ function j() {
3754
+ p.value = void 0, T.value = void 0, t.value = -1, o.back();
3755
+ }
3756
+ async function $() {
3757
+ var r;
3758
+ if (!k.value) return;
3759
+ await f({
3760
+ title: w("report.tile.save.title"),
3761
+ message: w("report.tile.save.confirm", { title: (r = T.value) == null ? void 0 : r.widget.title })
3762
+ }) && T.value && (T.value.widget.config = {
3763
+ ...T.value.widget.config,
3764
+ rowHeight: c.value,
3765
+ colWidths: [...e.value]
3766
+ }, t.value === -1 ? k.value.tiles.push(T.value) : k.value.tiles[t.value] = T.value, j());
3767
+ }
3768
+ async function m() {
3769
+ var r;
3770
+ if (!k.value) return;
3771
+ await f({
3772
+ title: w("report.tile.cancel.title"),
3773
+ message: w("report.tile.cancel.confirm", { title: (r = T.value) == null ? void 0 : r.widget.title })
3774
+ }) && j();
3775
+ }
3776
+ return Ye(() => {
3777
+ k.value || o.push({ name: "reports" });
3778
+ }), (a, r) => {
3779
+ const n = D("FmPageHead");
3780
+ return v(), O(Pl, null, {
3781
+ default: Y(() => [
3782
+ d(n, {
3783
+ actions: [
3784
+ { label: l(w)("report.common.cancel"), value: "cancel", isPrimary: !1 },
3785
+ { label: l(w)("report.common.save"), value: "save", isPrimary: !0 }
3786
+ ],
3787
+ "onClick:action": r[0] || (r[0] = (y) => {
3788
+ y === "cancel" && m(), y === "save" && $();
3789
+ })
3790
+ }, {
3791
+ title: Y(() => [
3792
+ l(s).lg || l(s).md ? (v(), P("p", ca, J(g.value), 1)) : N("", !0)
3793
+ ]),
3794
+ _: 1
3795
+ }, 8, ["actions"]),
3796
+ l(T) && (l(x) || []).some((y) => {
3797
+ const u = y.tileIds, V = l(T) && l(T).id;
3798
+ return Array.isArray(u) && typeof V == "string" && u.includes(V);
3799
+ }) ? (v(), P("div", pa, [
3800
+ d(Jl)
3801
+ ])) : N("", !0),
3802
+ l(T) ? (v(), O(dl(l(s).lg || l(s).md ? ra : ma), {
3803
+ key: 1,
3804
+ modelValue: l(T),
3805
+ "onUpdate:modelValue": r[1] || (r[1] = (y) => Al(T) ? T.value = y : null),
3806
+ class: ke(`${l(s).lg || l(s).md ? "flex" : ""} w-full`),
3807
+ style: Ee({ height: `calc( 100% - ${l(s).lg || l(s).md ? 72 : 64}px)` }),
3808
+ "hide-configuration": C.value,
3809
+ index: Number(l(i).params.tileIndex),
3810
+ onHideConfiguration: r[2] || (r[2] = (y) => C.value = y)
3811
+ }, null, 40, ["modelValue", "class", "style", "hide-configuration", "index"])) : N("", !0)
3812
+ ]),
3813
+ _: 1
3814
+ });
3815
+ };
3816
+ }
3817
+ });
3818
+ export {
3819
+ Ta as default
3820
+ };