@feedmepos/mf-report 5.21.8-beta.0 → 5.21.9-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (19) hide show
  1. package/dist/{App-D4vyFJMj.js → App-CevDqbCm.js} +3 -3
  2. package/dist/{BaseDialog.vue_vue_type_script_setup_true_lang-Iw4xx0Fl.js → BaseDialog.vue_vue_type_script_setup_true_lang-Dr4qN7Sd.js} +3 -3
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-5VHgjlzH.js → Default.vue_vue_type_script_setup_true_lang-CcgonLnJ.js} +1 -1
  4. package/dist/FilterSelector.vue_vue_type_script_setup_true_lang-Bf7d-pkn.js +2443 -0
  5. package/dist/{InsightView-r7hTHTqe.js → InsightView-DnJYJbyS.js} +2 -2
  6. package/dist/{Layout-CW2QaCma.js → Layout-KzrkYOJl.js} +1 -1
  7. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-CYCun9dA.js → MenuTab.vue_vue_type_script_setup_true_lang-eofPG7gO.js} +3 -3
  8. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-eaDtHGxS.js → NavigationTab.vue_vue_type_script_setup_true_lang-BGjrkn_f.js} +1 -1
  9. package/dist/{OverviewView-CiCqSgsM.js → OverviewView-DNtHozwK.js} +4 -4
  10. package/dist/{Report-BpqxPuON.js → Report-CmGtsfJE.js} +2 -2
  11. package/dist/{ReportEditor-Btkd3YW-.js → ReportEditor-BhJqpS3n.js} +3 -3
  12. package/dist/{ReportView-CPpujWAS.js → ReportView-BQrFZiTb.js} +5 -5
  13. package/dist/{Setting-Akgc7jEy.js → Setting-C7n45Ixn.js} +2 -2
  14. package/dist/TileEditor-DMFc1oj1.js +2820 -0
  15. package/dist/{TransitionFade-Bj5b53Cc.js → TransitionFade-BWbPk2eH.js} +2 -2
  16. package/dist/app.js +17 -9
  17. package/package.json +1 -1
  18. package/dist/FilterSelector.vue_vue_type_script_setup_true_lang-B0JTMlgi.js +0 -2437
  19. package/dist/TileEditor-BgXkfCtL.js +0 -2766
@@ -0,0 +1,2820 @@
1
+ import { defineComponent as X, mergeModels as G, useModel as le, computed as S, ref as W, resolveComponent as C, createElementBlock as I, openBlock as h, createVNode as r, createElementVNode as F, unref as e, withCtx as N, toDisplayString as j, Fragment as ee, renderList as re, withModifiers as te, createTextVNode as me, watch as se, createCommentVNode as U, createBlock as D, onUnmounted as Xe, renderSlot as Ne, onMounted as ke, onBeforeUnmount as qe, resolveDynamicComponent as Oe, normalizeClass as Ie, withDirectives as ae, vShow as ne, normalizeStyle as We, isRef as He } from "vue";
2
+ import { useRoute as Ee, useRouter as Ye } from "vue-router";
3
+ import { h as Je, d as _e, S as Fe, _ as Ge, W as Ke, b as Qe, T as Ze, a as el } from "./TransitionFade-BWbPk2eH.js";
4
+ import { W as L, b as Be, d as pe, D as ll, S as Te, C as ol, P as De, a as tl } from "./BaseDialog.vue_vue_type_script_setup_true_lang-Dr4qN7Sd.js";
5
+ import { storeToRefs as ue } from "pinia";
6
+ import { u as Le } from "./message-dialog-UoMWOnil.js";
7
+ import { u as E, h as je, p as al, b as ze, d as ce } from "./vue-i18n-Ddfg_5-j.js";
8
+ import { useSnackbar as nl, useBreakpoints as Re, FmButtonColorThemeVariant as ve } from "@feedmepos/ui-library";
9
+ import { _ as Q } from "./SelectComponent.vue_vue_type_script_setup_true_lang-5tTdsBOc.js";
10
+ import { r as Z } from "./i18n-DQxDgiLO.js";
11
+ import { g as fe, u as ge, L as ie, b as Ve, _ as Me, a as il } from "./FilterSelector.vue_vue_type_script_setup_true_lang-Bf7d-pkn.js";
12
+ import { d as be } from "./DateRangeSelect.vue_vue_type_script_setup_true_lang-fP-mGALO.js";
13
+ import { _ as Pe } from "./NoData.vue_vue_type_script_setup_true_lang-Co7Cwv3O.js";
14
+ const he = [
15
+ {
16
+ type: L.Circular,
17
+ maxDimension: null,
18
+ maxMetric: 1,
19
+ hasBreakdownDimension: !1,
20
+ canTranspose: !1,
21
+ isDrillConfigurable: !1,
22
+ hasChart: !0,
23
+ hasTable: !1,
24
+ hasLabel: !0,
25
+ hasLegend: !0,
26
+ hasXy: !1,
27
+ canRollup: !1,
28
+ showRollupPosition: !1,
29
+ canSearch: !1,
30
+ periodType: null
31
+ },
32
+ {
33
+ type: L.Table,
34
+ maxDimension: null,
35
+ maxMetric: null,
36
+ hasBreakdownDimension: !1,
37
+ canTranspose: !1,
38
+ isDrillConfigurable: !0,
39
+ hasChart: !1,
40
+ hasTable: !0,
41
+ hasLabel: !1,
42
+ hasLegend: !1,
43
+ hasXy: !1,
44
+ canRollup: !0,
45
+ showRollupPosition: !0,
46
+ canSearch: !0,
47
+ periodType: null
48
+ },
49
+ {
50
+ type: L.BarChart,
51
+ maxDimension: null,
52
+ maxMetric: 1,
53
+ hasBreakdownDimension: !0,
54
+ canTranspose: !0,
55
+ isDrillConfigurable: !1,
56
+ hasChart: !0,
57
+ hasTable: !1,
58
+ hasLabel: !0,
59
+ hasLegend: !0,
60
+ hasXy: !0,
61
+ canRollup: !1,
62
+ showRollupPosition: !1,
63
+ canSearch: !1,
64
+ periodType: null
65
+ },
66
+ {
67
+ type: L.LineChart,
68
+ maxDimension: null,
69
+ maxMetric: 1,
70
+ hasBreakdownDimension: !0,
71
+ canTranspose: !0,
72
+ isDrillConfigurable: !1,
73
+ hasChart: !0,
74
+ hasTable: !1,
75
+ hasLabel: !0,
76
+ hasLegend: !0,
77
+ hasXy: !0,
78
+ canRollup: !1,
79
+ showRollupPosition: !1,
80
+ canSearch: !1,
81
+ periodType: null
82
+ },
83
+ {
84
+ type: L.StackBarChart,
85
+ maxDimension: null,
86
+ maxMetric: 1,
87
+ hasBreakdownDimension: !0,
88
+ canTranspose: !0,
89
+ isDrillConfigurable: !1,
90
+ hasChart: !0,
91
+ hasTable: !1,
92
+ hasLabel: !0,
93
+ hasLegend: !0,
94
+ hasXy: !0,
95
+ canRollup: !1,
96
+ showRollupPosition: !1,
97
+ canSearch: !1,
98
+ periodType: null
99
+ },
100
+ {
101
+ type: L.StackLineChart,
102
+ maxDimension: null,
103
+ maxMetric: 1,
104
+ hasBreakdownDimension: !0,
105
+ canTranspose: !0,
106
+ isDrillConfigurable: !1,
107
+ hasChart: !0,
108
+ hasTable: !1,
109
+ hasLabel: !0,
110
+ hasLegend: !0,
111
+ hasXy: !0,
112
+ canRollup: !1,
113
+ showRollupPosition: !1,
114
+ canSearch: !1,
115
+ periodType: null
116
+ },
117
+ {
118
+ type: L.Scorecard,
119
+ maxDimension: null,
120
+ maxMetric: 1,
121
+ hasBreakdownDimension: !1,
122
+ canTranspose: !1,
123
+ isDrillConfigurable: !1,
124
+ hasChart: !1,
125
+ hasTable: !1,
126
+ hasLabel: !1,
127
+ hasLegend: !1,
128
+ hasXy: !1,
129
+ canRollup: !1,
130
+ showRollupPosition: !1,
131
+ canSearch: !1,
132
+ periodType: null
133
+ },
134
+ {
135
+ type: L.Spacer,
136
+ maxDimension: 0,
137
+ maxMetric: 0,
138
+ hasBreakdownDimension: !1,
139
+ canTranspose: !1,
140
+ isDrillConfigurable: !1,
141
+ hasChart: !1,
142
+ hasTable: !1,
143
+ hasLabel: !1,
144
+ hasLegend: !1,
145
+ hasXy: !1,
146
+ canRollup: !1,
147
+ showRollupPosition: !1,
148
+ canSearch: !1,
149
+ periodType: null
150
+ }
151
+ ], sl = { class: "flex flex-col my-2 gap-8" }, ul = { class: "fm-typo-en-body-lg-600" }, rl = { class: "text-sm text-fm-color-neutral-gray-400" }, dl = ["onClick"], ml = { class: "fm-typo-en-body-lg-400 overflow-hidden text-ellipsis line-clamp-1" }, pl = /* @__PURE__ */ X({
152
+ __name: "SchemaSection",
153
+ props: /* @__PURE__ */ G({
154
+ options: {
155
+ type: Array,
156
+ default: () => []
157
+ },
158
+ label: {
159
+ type: String,
160
+ default: "Schema"
161
+ }
162
+ }, {
163
+ modelValue: { required: !0 },
164
+ modelModifiers: {}
165
+ }),
166
+ emits: ["update:modelValue"],
167
+ setup(x) {
168
+ const { t: p, te: o } = E(), s = le(x, "modelValue"), n = x, { schemas: g } = ue(Be()), V = S(
169
+ () => g.value.map((v) => ({
170
+ label: v.label,
171
+ value: v.name,
172
+ raw: v
173
+ }))
174
+ ), f = S(() => {
175
+ if (s.value.schemaNames.length === 0 || i.value === 0)
176
+ return V.value.filter((v) => !v.raw.isJoinOnly);
177
+ {
178
+ const v = s.value.schemaNames[0], b = g.value.find((c) => c.name === v), u = ((b == null ? void 0 : b.joins) || []).map((c) => c);
179
+ return V.value.filter((c) => u.includes(c.raw.name));
180
+ }
181
+ }), m = W(!1), t = W(""), i = W(), w = nl();
182
+ function T(v) {
183
+ var b;
184
+ return Z(
185
+ p,
186
+ o,
187
+ (b = g.value.find((u) => u.name === v)) == null ? void 0 : b.label,
188
+ "schema"
189
+ );
190
+ }
191
+ function _(v) {
192
+ i.value = v, m.value = !0, v !== void 0 ? t.value = s.value.schemaNames[v] : t.value = "";
193
+ }
194
+ function $() {
195
+ t.value !== "" ? (i.value !== void 0 ? s.value.schemaNames[i.value] = t.value : s.value.schemaNames.push(t.value), m.value = !1) : w.open({ message: p("report.section.schema.nothingSelected"), type: "error" });
196
+ }
197
+ return (v, b) => {
198
+ const u = C("FmForm"), c = C("FmIcon"), a = C("FmField");
199
+ return h(), I("div", sl, [
200
+ r(pe, {
201
+ modelValue: m.value,
202
+ "onUpdate:modelValue": b[1] || (b[1] = (l) => m.value = l),
203
+ title: n.label,
204
+ "primary-button-label": e(p)("report.common.confirm"),
205
+ "secondary-button-label": e(p)("report.common.cancel"),
206
+ onConfirm: $
207
+ }, {
208
+ content: N(() => [
209
+ r(u, { ref: "form" }, {
210
+ default: N(() => [
211
+ r(Q, {
212
+ modelValue: t.value,
213
+ "onUpdate:modelValue": b[0] || (b[0] = (l) => t.value = l),
214
+ label: e(p)("report.section.schema.title"),
215
+ items: i.value === 0 ? V.value.map((l) => ({
216
+ label: e(Z)(e(p), e(o), l.label, "schema"),
217
+ value: l.value
218
+ })) : f.value.map((l) => ({
219
+ label: e(Z)(e(p), e(o), l.label, "schema"),
220
+ value: l.value
221
+ }))
222
+ }, null, 8, ["modelValue", "label", "items"])
223
+ ]),
224
+ _: 1
225
+ }, 512)
226
+ ]),
227
+ _: 1
228
+ }, 8, ["modelValue", "title", "primary-button-label", "secondary-button-label"]),
229
+ F("div", null, [
230
+ F("p", ul, j(e(p)("report.section.schema.title")), 1),
231
+ F("p", rl, j(e(p)("report.section.schema.description")), 1)
232
+ ]),
233
+ (h(!0), I(ee, null, re(s.value.schemaNames, (l, d) => (h(), I("div", {
234
+ key: d,
235
+ class: "flex flex-col gap-2 w-full"
236
+ }, [
237
+ F("div", {
238
+ class: "flex items-center gap-2 border rounded-md border-neutral-300 p-2 h-[40px]",
239
+ onClick: (k) => _(d)
240
+ }, [
241
+ F("p", ml, j(T(l)), 1),
242
+ b[3] || (b[3] = F("div", { class: "grow" }, null, -1)),
243
+ r(c, {
244
+ name: "close",
245
+ onClick: te(
246
+ () => {
247
+ s.value.schemaNames = e(Je)(s.value.schemaNames, d);
248
+ },
249
+ ["stop"]
250
+ )
251
+ }, null, 8, ["onClick"])
252
+ ], 8, dl)
253
+ ]))), 128)),
254
+ r(a, {
255
+ class: "text-fm-color-typo-tertiary",
256
+ onClick: b[2] || (b[2] = () => {
257
+ _();
258
+ })
259
+ }, {
260
+ default: N(() => [
261
+ me(j(e(p)("report.section.schema.add")), 1)
262
+ ]),
263
+ _: 1
264
+ })
265
+ ]);
266
+ };
267
+ }
268
+ }), cl = {
269
+ key: 0,
270
+ class: "flex flex-col my-2 gap-8"
271
+ }, vl = { class: "fm-typo-en-body-lg-600 text-ellipsis line-clamp-1" }, fl = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, gl = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, we = /* @__PURE__ */ X({
272
+ __name: "DimensionSection",
273
+ props: /* @__PURE__ */ G({
274
+ options: {
275
+ type: Array,
276
+ default: () => []
277
+ },
278
+ label: {
279
+ type: String,
280
+ default: "Dimension"
281
+ },
282
+ max: {
283
+ type: Number,
284
+ default: void 0
285
+ },
286
+ config: {
287
+ type: Object,
288
+ default: () => {
289
+ }
290
+ },
291
+ hasRowColumn: {
292
+ type: Boolean,
293
+ default: !1
294
+ }
295
+ }, {
296
+ modelValue: {
297
+ required: !1,
298
+ default: []
299
+ },
300
+ modelModifiers: {}
301
+ }),
302
+ emits: ["update:modelValue"],
303
+ setup(x) {
304
+ const { t: p, te: o } = E(), s = le(x, "modelValue"), n = x, g = W(!1), V = S(
305
+ () => s.value.map((a, l) => ({
306
+ index: l,
307
+ labels: [a.label || a.name],
308
+ value: a
309
+ }))
310
+ ), f = W(s.value.length > 0 ? 0 : void 0);
311
+ function m(a) {
312
+ var l, d, k;
313
+ g.value = !0, t.value = a != null && a.value ? JSON.parse(
314
+ JSON.stringify({
315
+ ...a.value,
316
+ label: Z(p, o, (l = a.value) == null ? void 0 : l.label, "other")
317
+ })
318
+ ) : void 0, f.value = a == null ? void 0 : a.index, i.value = !!((d = t.value) != null && d.dataFormula || (k = t.value) != null && k.displayFormula), t.value && t.value.formatter === void 0 && (n.options.find(
319
+ (y) => {
320
+ var z, R;
321
+ return y.schemaName === ((z = t.value) == null ? void 0 : z.schemaName) && y.name === ((R = t.value) == null ? void 0 : R.name);
322
+ }
323
+ ), a != null && a.value.timeFormatter && t.value.formatter === void 0 && (t.value.formatter = a == null ? void 0 : a.value.timeFormatter, t.value.timeFormatter = void 0));
324
+ }
325
+ const t = W(void 0), i = W(!1), w = S(
326
+ () => n.options.find(
327
+ (a) => {
328
+ var l, d;
329
+ return a.schemaName === ((l = t.value) == null ? void 0 : l.schemaName) && a.name === ((d = t.value) == null ? void 0 : d.name);
330
+ }
331
+ ) ?? {}
332
+ );
333
+ se(
334
+ () => {
335
+ var a;
336
+ return (a = t.value) == null ? void 0 : a.option;
337
+ },
338
+ () => {
339
+ !T.value && t.value && (t.value.fillGap = !1);
340
+ }
341
+ );
342
+ const T = S(
343
+ () => {
344
+ var a, l, d;
345
+ return (d = (a = w.value) == null ? void 0 : a.fillGapDimensionOptions) == null ? void 0 : d.includes(((l = t.value) == null ? void 0 : l.option) || "");
346
+ }
347
+ );
348
+ function _(a) {
349
+ var l, d;
350
+ (a.schemaName !== ((l = t.value) == null ? void 0 : l.schemaName) || a.name !== ((d = t.value) == null ? void 0 : d.name)) && (t.value = {
351
+ schemaName: a.schemaName,
352
+ name: a.name,
353
+ option: a.dimensionOptions[0],
354
+ label: Z(p, o, a.label, "other"),
355
+ decimal: a.isNumericType ? 2 : void 0,
356
+ hide: !1
357
+ }, i.value = !1);
358
+ }
359
+ function $() {
360
+ if (!t.value) {
361
+ console.error("new field is undefined");
362
+ return;
363
+ }
364
+ const a = [...V.value.map((l) => l.value)];
365
+ i.value || (t.value.dataFormula = void 0), f.value !== void 0 ? a[f.value] = t.value : a.push(t.value), s.value = a, g.value = !1;
366
+ }
367
+ function v(a) {
368
+ const d = [...V.value.map((k) => k.value)].filter((k, y) => y !== a);
369
+ s.value = d;
370
+ }
371
+ function b(a) {
372
+ t.value && (t.value.decimal = Number(a));
373
+ }
374
+ const u = S(
375
+ () => n.options.map((a) => ({
376
+ label: a.labels.join(" "),
377
+ value: a
378
+ }))
379
+ ), c = S(
380
+ () => n.label ? n.label : p(`report.section.dimension.${n.label}`)
381
+ );
382
+ return (a, l) => {
383
+ const d = C("FmTextField"), k = C("FmStepperField"), y = C("FmCheckbox"), z = C("FmTextarea"), R = C("FmForm"), A = C("FmIcon"), H = C("FmButton"), Y = C("FmListItem"), oe = C("FmList"), O = C("FmField");
384
+ return x.max !== 0 ? (h(), I("div", cl, [
385
+ r(pe, {
386
+ modelValue: g.value,
387
+ "onUpdate:modelValue": l[12] || (l[12] = (B) => g.value = B),
388
+ title: c.value,
389
+ "primary-button-label": e(p)("report.common.confirm"),
390
+ "secondary-button-label": e(p)("report.common.cancel"),
391
+ onConfirm: $
392
+ }, {
393
+ content: N(() => [
394
+ r(R, {
395
+ ref: "form",
396
+ class: "flex flex-col gap-2 w-[490px]"
397
+ }, {
398
+ default: N(() => {
399
+ var B, q, K, J, de, P, Se;
400
+ return [
401
+ r(Q, {
402
+ "model-value": w.value,
403
+ items: u.value,
404
+ placeholder: c.value,
405
+ label: c.value,
406
+ "onUpdate:modelValue": l[0] || (l[0] = (M) => _(M))
407
+ }, null, 8, ["model-value", "items", "placeholder", "label"]),
408
+ t.value ? (h(), I(ee, { key: 0 }, [
409
+ r(d, {
410
+ modelValue: t.value.label,
411
+ "onUpdate:modelValue": l[1] || (l[1] = (M) => t.value.label = M),
412
+ label: e(p)("report.section.dimension.label")
413
+ }, null, 8, ["modelValue", "label"]),
414
+ (((B = w.value) == null ? void 0 : B.dimensionOptions) || []).length > 0 ? (h(), D(Q, {
415
+ key: 0,
416
+ modelValue: t.value.option,
417
+ "onUpdate:modelValue": l[2] || (l[2] = (M) => t.value.option = M),
418
+ items: ((q = w.value) == null ? void 0 : q.dimensionOptions.map((M) => ({
419
+ label: e(Z)(e(p), e(o), M, "field"),
420
+ value: M
421
+ }))) ?? []
422
+ }, null, 8, ["modelValue", "items"])) : U("", !0),
423
+ (K = w.value) != null && K.isNumericType ? (h(), D(k, {
424
+ key: 1,
425
+ label: e(p)("report.common.decimal"),
426
+ "model-value": ((J = t.value) == null ? void 0 : J.decimal) ?? 2,
427
+ "onUpdate:modelValue": l[3] || (l[3] = (M) => {
428
+ b(M);
429
+ })
430
+ }, null, 8, ["label", "model-value"])) : U("", !0),
431
+ (de = w.value) != null && de.isNumericType ? (h(), D(Q, {
432
+ key: 2,
433
+ modelValue: t.value.formatter,
434
+ "onUpdate:modelValue": l[4] || (l[4] = (M) => t.value.formatter = M),
435
+ placeholder: e(p)("report.section.dimension.formatter"),
436
+ label: e(p)("report.section.dimension.formatter"),
437
+ items: [
438
+ { label: "NONE", value: null },
439
+ ...(((P = w.value) == null ? void 0 : P.formatters) || []).map((M) => ({
440
+ label: M,
441
+ value: M
442
+ }))
443
+ ]
444
+ }, null, 8, ["modelValue", "placeholder", "label", "items"])) : U("", !0),
445
+ T.value ? (h(), D(y, {
446
+ key: 3,
447
+ "model-value": t.value.fillGap ?? !1,
448
+ label: e(p)("report.section.dimension.fillGap"),
449
+ value: "",
450
+ placeholder: "Fill gap",
451
+ "onUpdate:modelValue": l[5] || (l[5] = (M) => {
452
+ t.value && (t.value.fillGap = M);
453
+ })
454
+ }, null, 8, ["model-value", "label"])) : U("", !0),
455
+ ((Se = w.value) == null ? void 0 : Se.type) === e(ll).Timestamp ? (h(), D(y, {
456
+ key: 4,
457
+ "model-value": t.value.dateComparison ?? !1,
458
+ label: e(p)("report.section.dimension.dateComparison"),
459
+ value: "",
460
+ "onUpdate:modelValue": l[6] || (l[6] = (M) => {
461
+ t.value && (t.value.dateComparison = M);
462
+ })
463
+ }, null, 8, ["model-value", "label"])) : U("", !0),
464
+ r(y, {
465
+ modelValue: t.value.hide,
466
+ "onUpdate:modelValue": l[7] || (l[7] = (M) => t.value.hide = M),
467
+ label: e(p)("report.section.dimension.hide"),
468
+ value: ""
469
+ }, null, 8, ["modelValue", "label"]),
470
+ n.hasRowColumn ? (h(), D(y, {
471
+ key: 5,
472
+ modelValue: t.value.moveToColumn,
473
+ "onUpdate:modelValue": l[8] || (l[8] = (M) => t.value.moveToColumn = M),
474
+ label: e(p)("report.section.dimension.moveToColumn"),
475
+ value: ""
476
+ }, null, 8, ["modelValue", "label"])) : U("", !0),
477
+ r(y, {
478
+ modelValue: i.value,
479
+ "onUpdate:modelValue": l[9] || (l[9] = (M) => i.value = M),
480
+ label: e(p)("report.section.dimension.advance"),
481
+ value: !0
482
+ }, null, 8, ["modelValue", "label"]),
483
+ i.value ? (h(), D(z, {
484
+ key: 6,
485
+ modelValue: t.value.dataFormula,
486
+ "onUpdate:modelValue": l[10] || (l[10] = (M) => t.value.dataFormula = M),
487
+ placeholder: e(p)("report.section.dimension.dataFormula")
488
+ }, null, 8, ["modelValue", "placeholder"])) : U("", !0),
489
+ i.value ? (h(), D(z, {
490
+ key: 7,
491
+ modelValue: t.value.displayFormula,
492
+ "onUpdate:modelValue": l[11] || (l[11] = (M) => t.value.displayFormula = M),
493
+ placeholder: e(p)("report.section.dimension.displayFormula")
494
+ }, null, 8, ["modelValue", "placeholder"])) : U("", !0)
495
+ ], 64)) : U("", !0)
496
+ ];
497
+ }),
498
+ _: 1
499
+ }, 512)
500
+ ]),
501
+ _: 1
502
+ }, 8, ["modelValue", "title", "primary-button-label", "secondary-button-label"]),
503
+ F("div", null, [
504
+ F("p", vl, j(c.value), 1),
505
+ F("p", fl, j(e(p)("report.section.dimension.description")), 1)
506
+ ]),
507
+ r(oe, null, {
508
+ default: N(() => [
509
+ r(e(_e), {
510
+ list: s.value,
511
+ "item-key": "id",
512
+ class: "flex flex-col gap-2"
513
+ }, {
514
+ item: N(({ element: B, index: q }) => [
515
+ r(Y, {
516
+ class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
517
+ onClick: te((K) => m(V.value[q]), ["stop"])
518
+ }, {
519
+ default: N(() => [
520
+ r(A, { name: "drag_handle" }),
521
+ F("p", gl, j(e(Z)(e(p), e(o), B.label, "other")), 1),
522
+ l[14] || (l[14] = F("div", { class: "grow" }, null, -1)),
523
+ r(H, {
524
+ icon: "close",
525
+ size: "md",
526
+ variant: "tertiary",
527
+ onClick: te((K) => v(q), ["stop"])
528
+ }, null, 8, ["onClick"])
529
+ ]),
530
+ _: 2
531
+ }, 1032, ["onClick"])
532
+ ]),
533
+ _: 1
534
+ }, 8, ["list"])
535
+ ]),
536
+ _: 1
537
+ }),
538
+ r(O, {
539
+ class: "text-fm-color-typo-tertiary",
540
+ onClick: l[13] || (l[13] = () => {
541
+ m();
542
+ })
543
+ }, {
544
+ default: N(() => [
545
+ me(j(e(p)("report.section.dimension.add")), 1)
546
+ ]),
547
+ _: 1
548
+ })
549
+ ])) : U("", !0);
550
+ };
551
+ }
552
+ }), xe = {
553
+ value: "_metric_name"
554
+ };
555
+ function bl(x, p, o) {
556
+ switch (x) {
557
+ case L.BarChart:
558
+ case L.StackBarChart:
559
+ case L.LineChart:
560
+ case L.StackLineChart:
561
+ case L.Circular:
562
+ return p.length > 1;
563
+ default:
564
+ return o;
565
+ }
566
+ }
567
+ function yl(x) {
568
+ var s;
569
+ const { rowIds: p, columnIds: o } = ye(x.widget.config);
570
+ return {
571
+ ...x,
572
+ widget: {
573
+ ...x.widget,
574
+ config: {
575
+ ...x.widget.config,
576
+ rowIds: p,
577
+ columnIds: o,
578
+ isDrillable: bl(
579
+ x.widget.type,
580
+ x.widget.config.dimensions,
581
+ x.widget.config.isDrillable
582
+ ),
583
+ joinDatasources: (s = x.widget.config.joinDatasources) == null ? void 0 : s.map((n) => {
584
+ const { rowIds: g, columnIds: V } = ye(n);
585
+ return {
586
+ ...n,
587
+ rowIds: g,
588
+ columnIds: V
589
+ };
590
+ })
591
+ }
592
+ }
593
+ };
594
+ }
595
+ function ye(x) {
596
+ const p = x.dimensions.filter((V) => V.hide !== !0 && !V.moveToColumn).map((V) => fe(V)), o = x.dimensions.filter((V) => V.hide !== !0 && V.moveToColumn == !0).map((V) => fe(V)), s = x.metrics.length > 0;
597
+ s && x.metrics.find((V) => V.moveToRow == !0) ? p.push(xe.value) : s && o.push(xe.value);
598
+ const n = [], g = [];
599
+ for (const V of p)
600
+ n.push(V);
601
+ for (const V of o)
602
+ g.push(V);
603
+ return {
604
+ rowIds: n,
605
+ columnIds: g
606
+ };
607
+ }
608
+ const hl = { class: "flex flex-col my-2 gap-8" }, Vl = { class: "fm-typo-en-body-lg-600" }, wl = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, Fl = { class: "fm-typo-en-body-lg-400 overflow-hidden text-ellipsis line-clamp-1" }, xl = /* @__PURE__ */ X({
609
+ __name: "MetricSection",
610
+ props: /* @__PURE__ */ G({
611
+ options: {
612
+ type: Array,
613
+ default: () => []
614
+ },
615
+ label: {
616
+ type: String,
617
+ default: "Metric"
618
+ },
619
+ max: {
620
+ type: Number,
621
+ default: void 0
622
+ },
623
+ config: {
624
+ type: Object,
625
+ default: () => {
626
+ }
627
+ },
628
+ hasRowColumn: {
629
+ type: Boolean,
630
+ default: !1
631
+ }
632
+ }, {
633
+ modelValue: { required: !1, default: [] },
634
+ modelModifiers: {}
635
+ }),
636
+ emits: /* @__PURE__ */ G(["config"], ["update:modelValue"]),
637
+ setup(x, { emit: p }) {
638
+ const { t: o, te: s } = E(), n = le(x, "modelValue"), g = x;
639
+ S(() => !!g.max && n.value.length === g.max);
640
+ const V = W(!1), f = S(
641
+ () => n.value.map((l, d) => ({
642
+ index: d,
643
+ labels: [l.label || l.name],
644
+ value: l
645
+ }))
646
+ ), m = W(n.value.length > 0 ? 0 : void 0);
647
+ function t(l) {
648
+ var d, k, y;
649
+ V.value = !0, i.value = l != null && l.value ? JSON.parse(
650
+ JSON.stringify({
651
+ ...l.value,
652
+ label: Z(o, s, l.value.label, "other")
653
+ })
654
+ ) : void 0, m.value = l == null ? void 0 : l.index, w.value = !!((d = i.value) != null && d.dataFormula || (k = i.value) != null && k.displayFormula), i.value && i.value.formatter === void 0 && (g.options.find(
655
+ (z) => {
656
+ var R, A;
657
+ return z.schemaName === ((R = i.value) == null ? void 0 : R.schemaName) && z.name === ((A = i.value) == null ? void 0 : A.name);
658
+ }
659
+ ), l != null && l.value.timeFormatter && i.value.formatter === void 0 && (i.value.formatter = l == null ? void 0 : l.value.timeFormatter, i.value.timeFormatter = void 0)), ((y = g.config.rowIds) == null ? void 0 : y.findIndex((z) => z === xe.value)) !== -1 && i.value && (i.value.moveToRow = !0);
660
+ }
661
+ const i = W(void 0), w = W(!1), T = S(
662
+ () => g.options.find(
663
+ (l) => {
664
+ var d, k;
665
+ return l.schemaName === ((d = i.value) == null ? void 0 : d.schemaName) && l.name === ((k = i.value) == null ? void 0 : k.name);
666
+ }
667
+ ) ?? {}
668
+ );
669
+ function _(l, d) {
670
+ var k;
671
+ return (l == null ? void 0 : l.isNumericType) || ((k = l == null ? void 0 : l.isNumericAggregations) == null ? void 0 : k.includes(d || ""));
672
+ }
673
+ const $ = S(
674
+ () => {
675
+ var l;
676
+ return _(T.value, (l = i.value) == null ? void 0 : l.aggregation);
677
+ }
678
+ );
679
+ se($, (l) => {
680
+ i.value && (l ? i.value.decimal = typeof i.value.decimal != "number" ? 2 : i.value.decimal : i.value.decimal = void 0);
681
+ });
682
+ function v(l) {
683
+ var d, k;
684
+ (l.schemaName !== ((d = i.value) == null ? void 0 : d.schemaName) || l.name !== ((k = i.value) == null ? void 0 : k.name)) && (i.value = {
685
+ schemaName: l.schemaName,
686
+ name: l.name,
687
+ aggregation: l.aggregations[0],
688
+ label: Z(o, s, l.label, "other"),
689
+ decimal: _(l, l.aggregations[0]) ? 2 : void 0,
690
+ moveToRow: !1,
691
+ hide: !1
692
+ }, w.value = !1);
693
+ }
694
+ function b() {
695
+ const l = [...f.value.map((d) => d.value)];
696
+ i.value && (w.value || (i.value.dataFormula = void 0), m.value !== void 0 ? l[m.value] = i.value : l.push(i.value)), n.value = l, V.value = !1;
697
+ }
698
+ function u(l) {
699
+ const d = [...f.value.map((k) => k.value)];
700
+ d.splice(l, 1), n.value = d;
701
+ }
702
+ const c = S(
703
+ () => g.options.map((l) => ({
704
+ label: l.labels.join(" "),
705
+ value: l
706
+ }))
707
+ ), a = S(
708
+ () => g.label ? g.label : o(`report.section.metric.${g.label}`)
709
+ );
710
+ return (l, d) => {
711
+ const k = C("FmTextField"), y = C("FmStepperField"), z = C("FmCheckbox"), R = C("FmTextarea"), A = C("FmForm"), H = C("FmIcon"), Y = C("FmButton"), oe = C("FmListItem"), O = C("FmList"), B = C("FmField");
712
+ return h(), I("div", hl, [
713
+ r(pe, {
714
+ modelValue: V.value,
715
+ "onUpdate:modelValue": d[10] || (d[10] = (q) => V.value = q),
716
+ title: a.value,
717
+ onConfirm: b
718
+ }, {
719
+ content: N(() => [
720
+ r(A, {
721
+ ref: "form",
722
+ class: "flex flex-col gap-2 w-[490px]"
723
+ }, {
724
+ default: N(() => {
725
+ var q, K, J, de;
726
+ return [
727
+ r(Q, {
728
+ "model-value": T.value,
729
+ items: c.value,
730
+ placeholder: a.value,
731
+ label: a.value,
732
+ "onUpdate:modelValue": d[0] || (d[0] = (P) => v(P))
733
+ }, null, 8, ["model-value", "items", "placeholder", "label"]),
734
+ i.value ? (h(), I(ee, { key: 0 }, [
735
+ r(k, {
736
+ modelValue: i.value.label,
737
+ "onUpdate:modelValue": d[1] || (d[1] = (P) => i.value.label = P),
738
+ label: e(o)("report.section.metric.label")
739
+ }, null, 8, ["modelValue", "label"]),
740
+ (((q = T.value) == null ? void 0 : q.aggregations) || []).length > 0 ? (h(), D(Q, {
741
+ key: 0,
742
+ modelValue: i.value.aggregation,
743
+ "onUpdate:modelValue": d[2] || (d[2] = (P) => i.value.aggregation = P),
744
+ label: e(o)("report.section.metric.aggregation"),
745
+ items: ((K = T.value) == null ? void 0 : K.aggregations.map((P) => ({
746
+ label: e(Z)(e(o), e(s), P, "field"),
747
+ value: P
748
+ }))) ?? []
749
+ }, null, 8, ["modelValue", "label", "items"])) : U("", !0),
750
+ $.value ? (h(), D(y, {
751
+ key: 1,
752
+ label: e(o)("report.common.decimal"),
753
+ "model-value": ((J = i.value) == null ? void 0 : J.decimal) ?? 2,
754
+ "onUpdate:modelValue": d[3] || (d[3] = (P) => {
755
+ i.value && (i.value.decimal = P);
756
+ })
757
+ }, null, 8, ["label", "model-value"])) : U("", !0),
758
+ $.value ? (h(), D(Q, {
759
+ key: 2,
760
+ modelValue: i.value.formatter,
761
+ "onUpdate:modelValue": d[4] || (d[4] = (P) => i.value.formatter = P),
762
+ placeholder: e(o)("report.section.metric.formatter"),
763
+ label: e(o)("report.section.metric.formatter"),
764
+ items: [
765
+ { label: "NONE", value: null },
766
+ ...(((de = T.value) == null ? void 0 : de.formatters) || []).map((P) => ({
767
+ label: P,
768
+ value: P
769
+ }))
770
+ ]
771
+ }, null, 8, ["modelValue", "placeholder", "label", "items"])) : U("", !0),
772
+ r(z, {
773
+ modelValue: i.value.hide,
774
+ "onUpdate:modelValue": d[5] || (d[5] = (P) => i.value.hide = P),
775
+ label: e(o)("report.section.metric.hide"),
776
+ value: ""
777
+ }, null, 8, ["modelValue", "label"]),
778
+ g.hasRowColumn ? (h(), D(z, {
779
+ key: 3,
780
+ modelValue: i.value.moveToRow,
781
+ "onUpdate:modelValue": d[6] || (d[6] = (P) => i.value.moveToRow = P),
782
+ label: e(o)("report.section.metric.moveToRow"),
783
+ value: ""
784
+ }, null, 8, ["modelValue", "label"])) : U("", !0),
785
+ r(z, {
786
+ modelValue: w.value,
787
+ "onUpdate:modelValue": d[7] || (d[7] = (P) => w.value = P),
788
+ label: e(o)("report.section.metric.advance"),
789
+ value: !0
790
+ }, null, 8, ["modelValue", "label"]),
791
+ w.value ? (h(), D(R, {
792
+ key: 4,
793
+ modelValue: i.value.dataFormula,
794
+ "onUpdate:modelValue": d[8] || (d[8] = (P) => i.value.dataFormula = P),
795
+ placeholder: e(o)("report.section.metric.dataFormula")
796
+ }, null, 8, ["modelValue", "placeholder"])) : U("", !0),
797
+ w.value ? (h(), D(R, {
798
+ key: 5,
799
+ modelValue: i.value.displayFormula,
800
+ "onUpdate:modelValue": d[9] || (d[9] = (P) => i.value.displayFormula = P),
801
+ placeholder: e(o)("report.section.metric.displayFormula")
802
+ }, null, 8, ["modelValue", "placeholder"])) : U("", !0)
803
+ ], 64)) : U("", !0)
804
+ ];
805
+ }),
806
+ _: 1
807
+ }, 512)
808
+ ]),
809
+ _: 1
810
+ }, 8, ["modelValue", "title"]),
811
+ F("div", null, [
812
+ F("p", Vl, j(a.value), 1),
813
+ F("p", wl, j(e(o)("report.section.metric.description")), 1)
814
+ ]),
815
+ r(O, null, {
816
+ default: N(() => [
817
+ r(e(_e), {
818
+ list: n.value,
819
+ "item-key": "id",
820
+ class: "flex flex-col gap-2 w-full"
821
+ }, {
822
+ item: N(({ element: q, index: K }) => [
823
+ r(oe, {
824
+ class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
825
+ onClick: te((J) => t(f.value[K]), ["stop"])
826
+ }, {
827
+ default: N(() => [
828
+ r(H, { name: "drag_handle" }),
829
+ F("p", Fl, j(e(Z)(e(o), e(s), q.label, "other")), 1),
830
+ d[12] || (d[12] = F("div", { class: "grow" }, null, -1)),
831
+ r(Y, {
832
+ icon: "close",
833
+ size: "md",
834
+ variant: "tertiary",
835
+ onClick: te((J) => u(K), ["stop"])
836
+ }, null, 8, ["onClick"])
837
+ ]),
838
+ _: 2
839
+ }, 1032, ["onClick"])
840
+ ]),
841
+ _: 1
842
+ }, 8, ["list"])
843
+ ]),
844
+ _: 1
845
+ }),
846
+ r(B, {
847
+ class: "text-fm-color-typo-tertiary",
848
+ onClick: d[11] || (d[11] = () => {
849
+ t();
850
+ })
851
+ }, {
852
+ default: N(() => [
853
+ me(j(e(o)("report.section.metric.add")), 1)
854
+ ]),
855
+ _: 1
856
+ })
857
+ ]);
858
+ };
859
+ }
860
+ }), Cl = { class: "flex flex-col my-2 gap-8" }, kl = { class: "fm-typo-en-body-lg-600" }, _l = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, Sl = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, Tl = /* @__PURE__ */ X({
861
+ __name: "SortSection",
862
+ props: /* @__PURE__ */ G({
863
+ options: {
864
+ type: Array,
865
+ default: () => []
866
+ },
867
+ label: {
868
+ type: String,
869
+ default: "Sort"
870
+ }
871
+ }, {
872
+ modelValue: { required: !1, default: [] },
873
+ modelModifiers: {}
874
+ }),
875
+ emits: ["update:modelValue"],
876
+ setup(x) {
877
+ const { t: p } = E(), o = le(x, "modelValue"), s = x, n = S(
878
+ () => s.label ? s.label : p(`report.section.sort.${s.label}`)
879
+ ), g = W(!1), V = S(
880
+ () => o.value.map((b, u) => {
881
+ const c = s.options.find(
882
+ (a) => a.schemaName === b.schemaName && a.name === b.name
883
+ );
884
+ return {
885
+ index: u,
886
+ labels: (c == null ? void 0 : c.labels) || [b.schemaName, b.name],
887
+ value: b
888
+ };
889
+ })
890
+ ), f = W(o.value.length > 0 ? 0 : void 0);
891
+ function m(b) {
892
+ var u;
893
+ g.value = !0, t.value = b != null && b.value ? JSON.parse(JSON.stringify(b.value)) : void 0, f.value = b == null ? void 0 : b.index, i.value = !!((u = t.value) != null && u.dataFormula);
894
+ }
895
+ const t = W(void 0), i = W(!1), w = S(
896
+ () => s.options.find(
897
+ (b) => {
898
+ var u, c;
899
+ return b.schemaName === ((u = t.value) == null ? void 0 : u.schemaName) && b.name === ((c = t.value) == null ? void 0 : c.name);
900
+ }
901
+ ) ?? {}
902
+ );
903
+ function T(b) {
904
+ var u, c;
905
+ (b.schemaName !== ((u = t.value) == null ? void 0 : u.schemaName) || b.name !== ((c = t.value) == null ? void 0 : c.name)) && (t.value = {
906
+ schemaName: b.schemaName,
907
+ name: b.name,
908
+ dimensionOption: b.dimensionOptions[0],
909
+ aggregation: null,
910
+ type: Te.Asc
911
+ });
912
+ }
913
+ function _() {
914
+ if (!t.value) {
915
+ console.log("new sort is undefined");
916
+ return;
917
+ }
918
+ const b = [...V.value.map((u) => u.value)];
919
+ i.value || (t.value.dataFormula = void 0), f.value !== void 0 ? b[f.value] = t.value : b.push(t.value), o.value = b, g.value = !1;
920
+ }
921
+ function $(b) {
922
+ const u = [...V.value.map((c) => c.value)];
923
+ u.splice(b, 1), o.value = u, g.value = !1;
924
+ }
925
+ const v = S(
926
+ () => s.options.map((b) => ({
927
+ label: b.labels.join(" "),
928
+ value: b
929
+ }))
930
+ );
931
+ return (b, u) => {
932
+ const c = C("FmCheckbox"), a = C("FmTextarea"), l = C("FmForm"), d = C("FmIcon"), k = C("FmButton"), y = C("FmListItem"), z = C("FmList"), R = C("FmField");
933
+ return h(), I("div", Cl, [
934
+ r(pe, {
935
+ modelValue: g.value,
936
+ "onUpdate:modelValue": u[6] || (u[6] = (A) => g.value = A),
937
+ title: n.value,
938
+ onConfirm: _
939
+ }, {
940
+ content: N(() => [
941
+ r(l, {
942
+ ref: "form",
943
+ class: "flex flex-col gap-2 w-[490px]"
944
+ }, {
945
+ default: N(() => {
946
+ var A, H, Y, oe;
947
+ return [
948
+ r(Q, {
949
+ "model-value": w.value,
950
+ items: v.value,
951
+ placeholder: n.value,
952
+ label: n.value,
953
+ "onUpdate:modelValue": u[0] || (u[0] = (O) => T(O))
954
+ }, null, 8, ["model-value", "items", "placeholder", "label"]),
955
+ t.value ? (h(), I(ee, { key: 0 }, [
956
+ (((A = w.value) == null ? void 0 : A.dimensionOptions) || []).length > 0 ? (h(), D(Q, {
957
+ key: 0,
958
+ modelValue: t.value.dimensionOption,
959
+ "onUpdate:modelValue": u[1] || (u[1] = (O) => t.value.dimensionOption = O),
960
+ items: ((H = w.value) == null ? void 0 : H.dimensionOptions.map((O) => ({ label: O, value: O }))) ?? [],
961
+ placeholder: e(p)("report.section.sort.format"),
962
+ label: e(p)("report.section.sort.format")
963
+ }, null, 8, ["modelValue", "items", "placeholder", "label"])) : U("", !0),
964
+ (((Y = w.value) == null ? void 0 : Y.aggregations) || []).length > 0 ? (h(), D(Q, {
965
+ key: 1,
966
+ modelValue: t.value.aggregation,
967
+ "onUpdate:modelValue": u[2] || (u[2] = (O) => t.value.aggregation = O),
968
+ items: ((oe = w.value) == null ? void 0 : oe.aggregations.map((O) => ({ label: O, value: O }))) ?? [],
969
+ label: e(p)("report.section.sort.aggregation"),
970
+ placeholder: e(p)("report.section.sort.aggregation")
971
+ }, null, 8, ["modelValue", "items", "label", "placeholder"])) : U("", !0),
972
+ r(Q, {
973
+ modelValue: t.value.type,
974
+ "onUpdate:modelValue": u[3] || (u[3] = (O) => t.value.type = O),
975
+ items: Object.values(e(Te)).map((O) => ({ label: O, value: O })),
976
+ placeholder: e(p)("report.section.sort.order"),
977
+ label: e(p)("report.section.sort.order")
978
+ }, null, 8, ["modelValue", "items", "placeholder", "label"]),
979
+ r(c, {
980
+ modelValue: i.value,
981
+ "onUpdate:modelValue": u[4] || (u[4] = (O) => i.value = O),
982
+ label: e(p)("report.section.sort.advance"),
983
+ value: !0
984
+ }, null, 8, ["modelValue", "label"]),
985
+ i.value ? (h(), D(a, {
986
+ key: 2,
987
+ modelValue: t.value.dataFormula,
988
+ "onUpdate:modelValue": u[5] || (u[5] = (O) => t.value.dataFormula = O),
989
+ placeholder: e(p)("report.section.sort.dataFormula")
990
+ }, null, 8, ["modelValue", "placeholder"])) : U("", !0)
991
+ ], 64)) : U("", !0)
992
+ ];
993
+ }),
994
+ _: 1
995
+ }, 512)
996
+ ]),
997
+ _: 1
998
+ }, 8, ["modelValue", "title"]),
999
+ F("div", null, [
1000
+ F("p", kl, j(n.value), 1),
1001
+ F("p", _l, j(e(p)("report.section.sort.description")), 1)
1002
+ ]),
1003
+ r(z, null, {
1004
+ default: N(() => [
1005
+ r(e(_e), {
1006
+ list: o.value,
1007
+ "item-key": "id",
1008
+ class: "flex flex-col gap-2 w-full"
1009
+ }, {
1010
+ item: N(({ element: A, index: H }) => [
1011
+ r(y, {
1012
+ class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
1013
+ onClick: te((Y) => m(V.value[H]), ["stop"])
1014
+ }, {
1015
+ default: N(() => [
1016
+ r(d, { name: "drag_handle" }),
1017
+ F("p", Sl, j(e(je)(A.name)), 1),
1018
+ u[8] || (u[8] = F("div", { class: "grow" }, null, -1)),
1019
+ r(k, {
1020
+ icon: "close",
1021
+ size: "md",
1022
+ variant: "tertiary",
1023
+ onClick: te((Y) => $(H), ["stop"])
1024
+ }, null, 8, ["onClick"])
1025
+ ]),
1026
+ _: 2
1027
+ }, 1032, ["onClick"])
1028
+ ]),
1029
+ _: 1
1030
+ }, 8, ["list"])
1031
+ ]),
1032
+ _: 1
1033
+ }),
1034
+ r(R, {
1035
+ class: "text-fm-color-typo-tertiary",
1036
+ onClick: u[7] || (u[7] = () => {
1037
+ m();
1038
+ })
1039
+ }, {
1040
+ default: N(() => [
1041
+ me(j(e(p)("report.section.sort.add")), 1)
1042
+ ]),
1043
+ _: 1
1044
+ })
1045
+ ]);
1046
+ };
1047
+ }
1048
+ }), Dl = { class: "fm-typo-en-body-lg-600" }, Ul = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, $l = /* @__PURE__ */ X({
1049
+ __name: "LimitSection",
1050
+ props: {
1051
+ modelValue: { required: !0, default: null },
1052
+ modelModifiers: {}
1053
+ },
1054
+ emits: ["update:modelValue"],
1055
+ setup(x) {
1056
+ const { t: p } = E(), o = le(x, "modelValue"), s = be((n) => {
1057
+ n !== "" ? o.value = n : o.value = null;
1058
+ }, 1e3);
1059
+ return (n, g) => {
1060
+ const V = C("FmTextField");
1061
+ return h(), I(ee, null, [
1062
+ F("div", null, [
1063
+ F("p", Dl, j(e(p)("report.section.limit.title")), 1),
1064
+ F("p", Ul, j(e(p)("report.section.limit.description")), 1)
1065
+ ]),
1066
+ r(V, {
1067
+ "model-value": o.value,
1068
+ inputmode: "numeric",
1069
+ placeholder: e(p)("report.section.limit.placeholder"),
1070
+ "onUpdate:modelValue": g[0] || (g[0] = (f) => e(s)(f))
1071
+ }, null, 8, ["model-value", "placeholder"])
1072
+ ], 64);
1073
+ };
1074
+ }
1075
+ }), Nl = { class: "flex flex-col my-2 gap-8" }, Ol = { class: "fm-typo-en-body-lg-600" }, Il = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, Bl = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, Ll = /* @__PURE__ */ X({
1076
+ __name: "ConditionSection",
1077
+ props: /* @__PURE__ */ G({
1078
+ joinFieldOptions: {
1079
+ type: Array,
1080
+ default: () => []
1081
+ },
1082
+ mainFieldOptions: {
1083
+ type: Array,
1084
+ default: () => []
1085
+ }
1086
+ }, {
1087
+ modelValue: { required: !0 },
1088
+ modelModifiers: {}
1089
+ }),
1090
+ emits: ["update:modelValue"],
1091
+ setup(x) {
1092
+ const { t: p } = E(), o = le(x, "modelValue"), s = x, n = W(!1), g = S(
1093
+ () => o.value.map((u, c) => {
1094
+ var a, l;
1095
+ return {
1096
+ index: c,
1097
+ labels: [(a = u.joinDimension) == null ? void 0 : a.schemaName, (l = u.joinDimension) == null ? void 0 : l.name],
1098
+ value: u
1099
+ };
1100
+ })
1101
+ ), V = W(o.value.length > 0 ? 0 : void 0);
1102
+ function f(u) {
1103
+ u ? (m.value = u != null && u.value ? JSON.parse(JSON.stringify(u.value)) : void 0, V.value = u == null ? void 0 : u.index) : (m.value = {
1104
+ joinDimension: null,
1105
+ operator: "",
1106
+ mainDimensions: []
1107
+ }, V.value = void 0), n.value = !0;
1108
+ }
1109
+ const m = W(void 0), t = S(
1110
+ () => s.joinFieldOptions.find(
1111
+ (u) => {
1112
+ var c, a;
1113
+ return u.schemaName === ((a = (c = m.value) == null ? void 0 : c.joinDimension) == null ? void 0 : a.schemaName) && u.name === m.value.joinDimension.name;
1114
+ }
1115
+ ) ?? {}
1116
+ ), i = S(
1117
+ () => {
1118
+ var u;
1119
+ return (((u = m.value) == null ? void 0 : u.mainDimensions) || []).map(
1120
+ (c) => s.mainFieldOptions.find(
1121
+ (a) => a.schemaName === (c == null ? void 0 : c.schemaName) && a.name === c.name
1122
+ ) ?? {}
1123
+ );
1124
+ }
1125
+ ), w = S(
1126
+ () => s.joinFieldOptions.map((u) => ({ label: u.labels.join(" "), value: u }))
1127
+ );
1128
+ function T(u) {
1129
+ var c, a, l, d;
1130
+ m.value && (m.value && u.schemaName !== ((a = (c = m.value) == null ? void 0 : c.joinDimension) == null ? void 0 : a.schemaName) || u.name !== ((d = (l = m.value) == null ? void 0 : l.joinDimension) == null ? void 0 : d.name)) && (m.value = {
1131
+ ...m.value,
1132
+ joinDimension: {
1133
+ schemaName: u.schemaName,
1134
+ name: u.name,
1135
+ option: u.dimensionOptions[0],
1136
+ label: `_${u.label}`,
1137
+ hide: !0
1138
+ }
1139
+ }, u.joinConditionOperators.includes(m.value.operator) || $(u.joinConditionOperators[0]));
1140
+ }
1141
+ function _(u, c) {
1142
+ var a, l, d, k;
1143
+ if (m.value && c >= 0 && (m.value && u.schemaName !== ((l = (a = m.value) == null ? void 0 : a.mainDimensions[c]) == null ? void 0 : l.schemaName) || u.name !== ((k = (d = m.value) == null ? void 0 : d.mainDimensions[c]) == null ? void 0 : k.name))) {
1144
+ const y = [...m.value.mainDimensions];
1145
+ y[c] = {
1146
+ schemaName: u.schemaName,
1147
+ name: u.name,
1148
+ option: u.dimensionOptions[0],
1149
+ label: u.label,
1150
+ hide: !0
1151
+ }, m.value = {
1152
+ ...m.value,
1153
+ mainDimensions: y
1154
+ };
1155
+ }
1156
+ }
1157
+ function $(u) {
1158
+ if (m.value)
1159
+ switch (u) {
1160
+ case ol.Between:
1161
+ m.value = {
1162
+ ...m.value,
1163
+ operator: u,
1164
+ mainDimensions: [null, null]
1165
+ };
1166
+ break;
1167
+ default:
1168
+ m.value = {
1169
+ ...m.value,
1170
+ operator: u,
1171
+ mainDimensions: [null]
1172
+ };
1173
+ break;
1174
+ }
1175
+ }
1176
+ function v() {
1177
+ const u = [...g.value.map((c) => c.value)];
1178
+ m.value && (m.value.mainDimensions = m.value.mainDimensions.filter(
1179
+ (c) => c !== "" && c != null
1180
+ ), V.value !== void 0 ? u[V.value] = m.value : u.push(m.value)), o.value = u, n.value = !1;
1181
+ }
1182
+ function b(u) {
1183
+ const c = [...g.value.map((a) => a.value)];
1184
+ c.splice(u, 1), o.value = c;
1185
+ }
1186
+ return (u, c) => {
1187
+ const a = C("FmMenuDivider"), l = C("FmForm"), d = C("FmButton"), k = C("FmListItem"), y = C("FmList"), z = C("FmField");
1188
+ return h(), I("div", Nl, [
1189
+ r(pe, {
1190
+ modelValue: n.value,
1191
+ "onUpdate:modelValue": c[2] || (c[2] = (R) => n.value = R),
1192
+ title: e(p)("report.section.condition.condition"),
1193
+ onConfirm: v
1194
+ }, {
1195
+ content: N(() => [
1196
+ r(l, {
1197
+ ref: "form",
1198
+ class: "flex flex-col gap-2 w-[490px]"
1199
+ }, {
1200
+ default: N(() => {
1201
+ var R, A, H, Y, oe;
1202
+ return [
1203
+ r(Q, {
1204
+ label: e(p)("report.section.condition.joinDatasource"),
1205
+ "model-value": t.value,
1206
+ items: w.value,
1207
+ placeholder: e(p)("report.section.condition.joinDimension"),
1208
+ "onUpdate:modelValue": c[0] || (c[0] = (O) => T(O))
1209
+ }, null, 8, ["label", "model-value", "items", "placeholder"]),
1210
+ r(a),
1211
+ (R = m.value) != null && R.joinDimension && (((A = t.value) == null ? void 0 : A.dimensionOptions) || []).length > 0 ? (h(), D(Q, {
1212
+ key: 0,
1213
+ modelValue: m.value.joinDimension.option,
1214
+ "onUpdate:modelValue": c[1] || (c[1] = (O) => m.value.joinDimension.option = O),
1215
+ label: e(p)("report.section.condition.format"),
1216
+ items: ((H = t.value) == null ? void 0 : H.dimensionOptions.map((O) => ({
1217
+ label: O,
1218
+ value: O
1219
+ }))) ?? []
1220
+ }, null, 8, ["modelValue", "label", "items"])) : U("", !0),
1221
+ m.value && (((Y = t.value) == null ? void 0 : Y.joinConditionOperators) || []).length > 0 ? (h(), D(Q, {
1222
+ key: 1,
1223
+ "model-value": m.value.operator,
1224
+ label: e(p)("report.section.condition.operator"),
1225
+ items: t.value.joinConditionOperators.map((O) => ({
1226
+ label: O,
1227
+ value: O
1228
+ })) ?? [],
1229
+ "onUpdate:modelValue": $
1230
+ }, null, 8, ["model-value", "label", "items"])) : U("", !0),
1231
+ (h(!0), I(ee, null, re(((oe = m.value) == null ? void 0 : oe.mainDimensions) || [], (O, B) => {
1232
+ var q, K;
1233
+ return h(), I("div", {
1234
+ key: B,
1235
+ class: "flex flex-col gap-2"
1236
+ }, [
1237
+ r(Q, {
1238
+ "model-value": i.value[B],
1239
+ label: e(p)("report.section.condition.mainDatasource", { index: B + 1 }),
1240
+ items: s.mainFieldOptions.map((J) => ({
1241
+ label: J.labels.join(" "),
1242
+ value: J
1243
+ })),
1244
+ "onUpdate:modelValue": (J) => _(J, B)
1245
+ }, null, 8, ["model-value", "label", "items", "onUpdate:modelValue"]),
1246
+ O && (((q = i.value[B]) == null ? void 0 : q.dimensionOptions) || []).length > 0 && O ? (h(), D(Q, {
1247
+ key: 0,
1248
+ modelValue: O.option,
1249
+ "onUpdate:modelValue": (J) => O.option = J,
1250
+ items: (K = i.value[B]) == null ? void 0 : K.dimensionOptions.map((J) => ({
1251
+ label: J,
1252
+ value: J
1253
+ }))
1254
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "items"])) : U("", !0),
1255
+ r(a)
1256
+ ]);
1257
+ }), 128))
1258
+ ];
1259
+ }),
1260
+ _: 1
1261
+ }, 512)
1262
+ ]),
1263
+ _: 1
1264
+ }, 8, ["modelValue", "title"]),
1265
+ F("div", null, [
1266
+ F("p", Ol, j(e(p)("report.section.condition.condition")), 1),
1267
+ F("p", Il, j(e(p)("report.section.condition.description")), 1)
1268
+ ]),
1269
+ r(y, { class: "flex flex-col gap-2" }, {
1270
+ default: N(() => [
1271
+ (h(!0), I(ee, null, re(o.value, (R, A) => (h(), D(k, {
1272
+ key: A,
1273
+ class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
1274
+ onClick: (H) => f(g.value[A])
1275
+ }, {
1276
+ default: N(() => {
1277
+ var H, Y;
1278
+ return [
1279
+ F("p", Bl, j(e(al)(((H = R.joinDimension) == null ? void 0 : H.schemaName) ?? "")) + " " + j((Y = R.joinDimension) == null ? void 0 : Y.label), 1),
1280
+ c[4] || (c[4] = F("div", { class: "grow" }, null, -1)),
1281
+ r(d, {
1282
+ icon: "close",
1283
+ size: "md",
1284
+ variant: "tertiary",
1285
+ onClick: te((oe) => b(A), ["stop"])
1286
+ }, null, 8, ["onClick"])
1287
+ ];
1288
+ }),
1289
+ _: 2
1290
+ }, 1032, ["onClick"]))), 128))
1291
+ ]),
1292
+ _: 1
1293
+ }),
1294
+ r(z, {
1295
+ class: "text-fm-color-typo-tertiary cursor-pointer",
1296
+ onClick: c[3] || (c[3] = (R) => f())
1297
+ }, {
1298
+ default: N(() => [
1299
+ me(j(e(p)("report.section.condition.add")), 1)
1300
+ ]),
1301
+ _: 1
1302
+ })
1303
+ ]);
1304
+ };
1305
+ }
1306
+ }), Ue = /* @__PURE__ */ X({
1307
+ __name: "Datasource",
1308
+ props: /* @__PURE__ */ G({
1309
+ label: {
1310
+ type: String,
1311
+ default: "Label"
1312
+ },
1313
+ config: {
1314
+ type: Object,
1315
+ default: null
1316
+ },
1317
+ closeable: {
1318
+ type: Boolean,
1319
+ default: !1
1320
+ },
1321
+ mainDatasourceConfig: {
1322
+ type: Object,
1323
+ default: () => {
1324
+ }
1325
+ },
1326
+ modelValue: {
1327
+ type: Object,
1328
+ default: () => {
1329
+ }
1330
+ }
1331
+ }, {
1332
+ modelValue: { required: !0 },
1333
+ modelModifiers: {}
1334
+ }),
1335
+ emits: /* @__PURE__ */ G(["click-close"], ["update:modelValue"]),
1336
+ setup(x, { emit: p }) {
1337
+ const { disableEditMode: o, resetStore: s } = ge(), n = le(x, "modelValue");
1338
+ se(
1339
+ [() => n.value.dimensions, () => n.value.metrics],
1340
+ () => {
1341
+ const { rowIds: c, columnIds: a } = ye(n.value);
1342
+ n.value.rowIds = c, n.value.columnIds = a;
1343
+ },
1344
+ { deep: !0 }
1345
+ );
1346
+ const g = x, V = p, { schemas: f } = ue(Be());
1347
+ Xe(() => {
1348
+ o(), s();
1349
+ });
1350
+ const { t: m, te: t } = E(), i = S(() => !g.mainDatasourceConfig), w = S(
1351
+ () => [L.BarChart, L.LineChart, L.Scorecard].includes(g.config.type)
1352
+ ), T = S(() => {
1353
+ const c = [...n.value.dimensions].filter((a) => !a.hide);
1354
+ return c.sort(
1355
+ (a, l) => (n.value.rowIds || []).indexOf(fe(a)) - (n.value.rowIds || []).indexOf(fe(l))
1356
+ ), c;
1357
+ }), _ = S(() => g.config.type === L.Scorecard), $ = S(
1358
+ () => {
1359
+ var c;
1360
+ return (((c = g.mainDatasourceConfig) == null ? void 0 : c.schemaNames) || []).reduce(
1361
+ (a, l) => {
1362
+ const d = f.value.find((k) => k.name === l);
1363
+ return d && (a = [
1364
+ ...a,
1365
+ ...d.fields.map((k) => ({
1366
+ ...k,
1367
+ labels: [
1368
+ Z(m, t, d.label, "schema"),
1369
+ Z(m, t, k.label || k.name, "other")
1370
+ ]
1371
+ }))
1372
+ ]), a;
1373
+ },
1374
+ []
1375
+ );
1376
+ }
1377
+ ), v = S(
1378
+ () => n.value.schemaNames.reduce((c, a) => {
1379
+ const l = f.value.find((d) => d.name === a);
1380
+ return l && (c = [
1381
+ ...c,
1382
+ ...l.fields.map((d) => ({
1383
+ ...d,
1384
+ labels: [
1385
+ Z(m, t, l.label, "schema"),
1386
+ Z(m, t, d.label || d.name, "other")
1387
+ ]
1388
+ }))
1389
+ ]), c;
1390
+ }, [])
1391
+ ), b = S(() => [
1392
+ { label: m("report.section.datasource.none"), value: null },
1393
+ { label: m("report.section.datasource.grandTotal"), value: 0 },
1394
+ ...[...T.value].slice(0, T.value.length - 1).map((c, a) => ({
1395
+ label: Z(m, t, c.label, "other"),
1396
+ value: a + 1
1397
+ }))
1398
+ ]), u = [
1399
+ {
1400
+ label: "None",
1401
+ value: null
1402
+ },
1403
+ ...Object.keys(De).map((c) => ({
1404
+ label: c,
1405
+ value: De[c]
1406
+ }))
1407
+ ];
1408
+ return (c, a) => {
1409
+ const l = C("FmButton"), d = C("FmSwitch"), k = C("FmSelect");
1410
+ return h(), D(Fe, null, {
1411
+ header: N(() => [
1412
+ F("p", null, j(g.label), 1),
1413
+ a[19] || (a[19] = F("div", { class: "grow" }, null, -1)),
1414
+ g.closeable ? (h(), D(l, {
1415
+ key: 0,
1416
+ icon: "close",
1417
+ variant: "tertiary",
1418
+ size: "md",
1419
+ onClick: a[0] || (a[0] = te((y) => V("click-close"), ["stop"]))
1420
+ })) : U("", !0)
1421
+ ]),
1422
+ content: N(() => [
1423
+ r(pl, {
1424
+ modelValue: n.value,
1425
+ "onUpdate:modelValue": a[1] || (a[1] = (y) => n.value = y),
1426
+ label: e(m)("report.section.schema.title")
1427
+ }, null, 8, ["modelValue", "label"]),
1428
+ r(we, {
1429
+ modelValue: n.value.dimensions,
1430
+ "onUpdate:modelValue": a[2] || (a[2] = (y) => n.value.dimensions = y),
1431
+ options: v.value,
1432
+ config: n.value,
1433
+ max: g.config.maxDimension,
1434
+ "has-row-column": !0,
1435
+ onConfig: a[3] || (a[3] = (y) => {
1436
+ n.value = y;
1437
+ })
1438
+ }, null, 8, ["modelValue", "options", "config", "max"]),
1439
+ r(d, {
1440
+ "label-placement": "right",
1441
+ label: e(m)("report.section.datasource.comparable"),
1442
+ "model-value": n.value.isComparable ?? !1,
1443
+ "onUpdate:modelValue": a[4] || (a[4] = (y) => {
1444
+ n.value.isComparable = y;
1445
+ })
1446
+ }, null, 8, ["label", "model-value"]),
1447
+ w.value ? (h(), D(d, {
1448
+ key: 0,
1449
+ "label-placement": "right",
1450
+ label: e(m)("report.section.datasource.cumulative"),
1451
+ "model-value": n.value.isCumulative ?? !1,
1452
+ "onUpdate:modelValue": a[5] || (a[5] = (y) => {
1453
+ n.value.isCumulative = y;
1454
+ })
1455
+ }, null, 8, ["label", "model-value"])) : U("", !0),
1456
+ g.config.isDrillConfigurable && i.value ? (h(), D(d, {
1457
+ key: 1,
1458
+ label: e(m)("report.section.datasource.drill"),
1459
+ "label-placement": "right",
1460
+ "model-value": n.value.isDrillable ?? !1,
1461
+ "onUpdate:modelValue": a[6] || (a[6] = (y) => {
1462
+ n.value.isDrillable = y;
1463
+ })
1464
+ }, null, 8, ["label", "model-value"])) : U("", !0),
1465
+ i.value ? (h(), D(d, {
1466
+ key: 2,
1467
+ modelValue: n.value.isBlend,
1468
+ "onUpdate:modelValue": a[7] || (a[7] = (y) => n.value.isBlend = y),
1469
+ label: e(m)("report.section.datasource.blend"),
1470
+ "label-placement": "right"
1471
+ }, null, 8, ["modelValue", "label"])) : U("", !0),
1472
+ g.config.canRollup && i.value ? (h(), D(k, {
1473
+ key: 3,
1474
+ modelValue: n.value.rollup,
1475
+ "onUpdate:modelValue": a[8] || (a[8] = (y) => n.value.rollup = y),
1476
+ label: e(m)("report.section.datasource.subTotal"),
1477
+ items: b.value
1478
+ }, null, 8, ["modelValue", "label", "items"])) : U("", !0),
1479
+ i.value ? U("", !0) : (h(), D(k, {
1480
+ key: 4,
1481
+ modelValue: n.value.periodType,
1482
+ "onUpdate:modelValue": a[9] || (a[9] = (y) => n.value.periodType = y),
1483
+ label: e(m)("report.section.datasource.periodType"),
1484
+ items: u
1485
+ }, null, 8, ["modelValue", "label"])),
1486
+ g.config.canTranspose && i.value ? (h(), D(d, {
1487
+ key: 5,
1488
+ modelValue: n.value.isTransposed,
1489
+ "onUpdate:modelValue": a[10] || (a[10] = (y) => n.value.isTransposed = y),
1490
+ label: e(m)("report.section.datasource.transpose"),
1491
+ "label-placement": "right"
1492
+ }, null, 8, ["modelValue", "label"])) : U("", !0),
1493
+ g.config.hasBreakdownDimension ? (h(), D(we, {
1494
+ key: 6,
1495
+ "model-value": n.value.breakdownDimension ? [n.value.breakdownDimension] : [],
1496
+ label: e(m)("report.section.dimension.breakdownDimension"),
1497
+ max: 1,
1498
+ options: v.value,
1499
+ "onUpdate:modelValue": a[11] || (a[11] = (y) => {
1500
+ n.value.breakdownDimension = y[0];
1501
+ })
1502
+ }, null, 8, ["model-value", "label", "options"])) : U("", !0),
1503
+ _.value ? (h(), D(we, {
1504
+ key: 7,
1505
+ "model-value": n.value.sparklineDimension ? [n.value.sparklineDimension] : [],
1506
+ label: e(m)("report.section.dimension.sparklineDimension"),
1507
+ max: 1,
1508
+ options: v.value,
1509
+ "onUpdate:modelValue": a[12] || (a[12] = (y) => {
1510
+ n.value.sparklineDimension = y[0];
1511
+ })
1512
+ }, null, 8, ["model-value", "label", "options"])) : U("", !0),
1513
+ r(xl, {
1514
+ modelValue: n.value.metrics,
1515
+ "onUpdate:modelValue": a[13] || (a[13] = (y) => n.value.metrics = y),
1516
+ options: v.value,
1517
+ max: g.config.maxMetric,
1518
+ config: n.value,
1519
+ "has-row-column": g.config.type === e(L).Table,
1520
+ onConfig: a[14] || (a[14] = (y) => {
1521
+ n.value = y;
1522
+ })
1523
+ }, null, 8, ["modelValue", "options", "max", "config", "has-row-column"]),
1524
+ r(Ge, {
1525
+ modelValue: n.value.filters,
1526
+ "onUpdate:modelValue": a[15] || (a[15] = (y) => n.value.filters = y),
1527
+ options: v.value
1528
+ }, null, 8, ["modelValue", "options"]),
1529
+ r(Tl, {
1530
+ modelValue: n.value.sorts,
1531
+ "onUpdate:modelValue": a[16] || (a[16] = (y) => n.value.sorts = y),
1532
+ options: v.value
1533
+ }, null, 8, ["modelValue", "options"]),
1534
+ r($l, {
1535
+ modelValue: n.value.limit,
1536
+ "onUpdate:modelValue": a[17] || (a[17] = (y) => n.value.limit = y)
1537
+ }, null, 8, ["modelValue"]),
1538
+ n.value.conditions ? (h(), D(Ll, {
1539
+ key: 8,
1540
+ modelValue: n.value.conditions,
1541
+ "onUpdate:modelValue": a[18] || (a[18] = (y) => n.value.conditions = y),
1542
+ "join-field-options": v.value,
1543
+ "main-field-options": $.value
1544
+ }, null, 8, ["modelValue", "join-field-options", "main-field-options"])) : U("", !0)
1545
+ ]),
1546
+ _: 1
1547
+ });
1548
+ };
1549
+ }
1550
+ }), jl = { class: "fm-typo-en-title-sm-600" }, Ce = /* @__PURE__ */ X({
1551
+ __name: "TileEditorTabHeader",
1552
+ props: /* @__PURE__ */ G({
1553
+ icon: {
1554
+ type: String,
1555
+ required: !0
1556
+ }
1557
+ }, {
1558
+ modelValue: { type: Boolean, required: !0, default: !1 },
1559
+ modelModifiers: {}
1560
+ }),
1561
+ emits: ["update:modelValue"],
1562
+ setup(x) {
1563
+ const { t: p } = E(), o = le(x, "modelValue"), s = x;
1564
+ return (n, g) => {
1565
+ const V = C("FmIcon");
1566
+ return h(), I("div", {
1567
+ class: "px-6 py-16 flex items-center gap-2 bg-fm-color-neutral-white border cursor-pointer",
1568
+ onClick: g[0] || (g[0] = (f) => o.value = !o.value)
1569
+ }, [
1570
+ F("p", jl, j(e(p)("report.tile.setting")), 1),
1571
+ g[1] || (g[1] = F("div", { class: "grow" }, null, -1)),
1572
+ r(V, {
1573
+ name: s.icon
1574
+ }, null, 8, ["name"])
1575
+ ]);
1576
+ };
1577
+ }
1578
+ }), zl = /* @__PURE__ */ X({
1579
+ __name: "TileEditorTabDesktop",
1580
+ props: {
1581
+ modelValue: { required: !0, default: !1 },
1582
+ modelModifiers: {}
1583
+ },
1584
+ emits: ["update:modelValue"],
1585
+ setup(x) {
1586
+ const p = le(x, "modelValue");
1587
+ return (o, s) => (h(), I(ee, null, [
1588
+ r(Ce, {
1589
+ modelValue: p.value,
1590
+ "onUpdate:modelValue": s[0] || (s[0] = (n) => p.value = n),
1591
+ icon: "keyboard_double_arrow_left"
1592
+ }, null, 8, ["modelValue"]),
1593
+ Ne(o.$slots, "default")
1594
+ ], 64));
1595
+ }
1596
+ }), Rl = { class: "fixed bottom-0 w-full" }, Ml = /* @__PURE__ */ X({
1597
+ __name: "TileEditorTabMobile",
1598
+ props: {
1599
+ modelValue: { required: !0, default: !1 },
1600
+ modelModifiers: {}
1601
+ },
1602
+ emits: ["update:modelValue"],
1603
+ setup(x) {
1604
+ const p = le(x, "modelValue");
1605
+ return (o, s) => {
1606
+ const n = C("FmTopSheet");
1607
+ return h(), I("div", Rl, [
1608
+ r(Ce, {
1609
+ modelValue: p.value,
1610
+ "onUpdate:modelValue": s[0] || (s[0] = (g) => p.value = g),
1611
+ icon: "keyboard_double_arrow_up"
1612
+ }, null, 8, ["modelValue"]),
1613
+ r(n, {
1614
+ modelValue: p.value,
1615
+ "onUpdate:modelValue": s[2] || (s[2] = (g) => p.value = g),
1616
+ "fullscreen-size": "sm"
1617
+ }, {
1618
+ default: N(() => [
1619
+ r(Ce, {
1620
+ modelValue: p.value,
1621
+ "onUpdate:modelValue": s[1] || (s[1] = (g) => p.value = g),
1622
+ icon: "keyboard_double_arrow_down"
1623
+ }, null, 8, ["modelValue"]),
1624
+ p.value ? Ne(o.$slots, "default", { key: 0 }) : U("", !0)
1625
+ ]),
1626
+ _: 3
1627
+ }, 8, ["modelValue"])
1628
+ ]);
1629
+ };
1630
+ }
1631
+ }), Pl = { class: "flex gap-16" }, Al = { class: "flex flex-col gap-8 max-w-[120px]" }, Xl = { class: "fm-typo-en-body-lg-600" }, ql = { class: "flex flex-col gap-16" }, Wl = { class: "flex flex-row gap-8" }, Hl = /* @__PURE__ */ X({
1632
+ __name: "TitleSection",
1633
+ props: {
1634
+ model: {}
1635
+ },
1636
+ emits: ["update:model"],
1637
+ setup(x, { emit: p }) {
1638
+ const o = x, s = p, { t: n } = E(), g = S({
1639
+ get: () => o.model.showTitle ?? !1,
1640
+ set: (i) => s("update:model", { ...o.model, showTitle: i })
1641
+ }), V = S({
1642
+ get: () => o.model.titleFontSize ?? 14,
1643
+ set: (i) => s("update:model", { ...o.model, titleFontSize: Math.min(Number(i), 24) })
1644
+ }), f = S({
1645
+ get: () => o.model.titleBold ?? !1,
1646
+ set: (i) => s("update:model", { ...o.model, titleBold: i })
1647
+ }), m = S({
1648
+ get: () => o.model.titleItalic ?? !1,
1649
+ set: (i) => s("update:model", { ...o.model, titleItalic: i })
1650
+ }), t = S({
1651
+ get: () => o.model.titleUnderline ?? !1,
1652
+ set: (i) => s("update:model", { ...o.model, titleUnderline: i })
1653
+ });
1654
+ return (i, w) => {
1655
+ const T = C("FmStepperField"), _ = C("FmButton"), $ = C("FmSwitch");
1656
+ return h(), I(ee, null, [
1657
+ F("div", null, [
1658
+ F("div", Pl, [
1659
+ F("div", Al, [
1660
+ F("p", Xl, j(e(n)("report.section.datasource.title.titleFontSize")), 1),
1661
+ r(T, {
1662
+ modelValue: V.value,
1663
+ "onUpdate:modelValue": w[0] || (w[0] = (v) => V.value = v),
1664
+ max: 24,
1665
+ min: 1,
1666
+ type: "number"
1667
+ }, null, 8, ["modelValue"])
1668
+ ]),
1669
+ F("div", ql, [
1670
+ w[5] || (w[5] = F("p", { class: "fm-typo-en-body-lg-600" }, "Text style and format", -1)),
1671
+ F("div", Wl, [
1672
+ r(_, {
1673
+ "append-icon": "format_bold",
1674
+ "model-value": i.model.titleBold ?? !1,
1675
+ variant: "tertiary",
1676
+ "icon-color": i.model.titleBold ? "neutral-gray-400" : "neutral-gray-300",
1677
+ "bg-color": i.model.titleBold ? "neutral-gray-100" : "neutral-white",
1678
+ class: "rounded-sm",
1679
+ onClick: w[1] || (w[1] = (v) => f.value = !f.value)
1680
+ }, null, 8, ["model-value", "icon-color", "bg-color"]),
1681
+ r(_, {
1682
+ "append-icon": "format_italic",
1683
+ "model-value": i.model.titleItalic ?? !1,
1684
+ "icon-color": i.model.titleItalic ? "neutral-gray-400" : "neutral-gray-300",
1685
+ "bg-color": i.model.titleItalic ? "neutral-gray-100" : "neutral-white",
1686
+ class: "rounded-sm",
1687
+ onClick: w[2] || (w[2] = (v) => m.value = !m.value)
1688
+ }, null, 8, ["model-value", "icon-color", "bg-color"]),
1689
+ r(_, {
1690
+ "append-icon": "format_underlined",
1691
+ "model-value": i.model.titleUnderline ?? !1,
1692
+ "icon-color": i.model.titleUnderline ? "neutral-gray-400" : "neutral-gray-300",
1693
+ "bg-color": i.model.titleUnderline ? "neutral-gray-100" : "neutral-white",
1694
+ class: "rounded-sm",
1695
+ onClick: w[3] || (w[3] = (v) => t.value = !t.value)
1696
+ }, null, 8, ["model-value", "icon-color", "bg-color"])
1697
+ ])
1698
+ ])
1699
+ ])
1700
+ ]),
1701
+ r($, {
1702
+ modelValue: g.value,
1703
+ "onUpdate:modelValue": w[4] || (w[4] = (v) => g.value = v),
1704
+ label: e(n)("report.section.datasource.title.showTitle"),
1705
+ "label-placement": "right"
1706
+ }, null, 8, ["modelValue", "label"])
1707
+ ], 64);
1708
+ };
1709
+ }
1710
+ }), El = { class: "flex flex-col gap-8" }, Yl = { class: "text-fm-color-typo-primary fm-typo-en-body-lg-600" }, Jl = { class: "flex flex-row gap-2" }, Gl = {
1711
+ key: 0,
1712
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
1713
+ }, Kl = /* @__PURE__ */ X({
1714
+ __name: "TableResizeSection",
1715
+ props: {
1716
+ layout: {}
1717
+ },
1718
+ emits: ["update:layout"],
1719
+ setup(x, { emit: p }) {
1720
+ const { t: o } = E(), s = x, n = p, { isEditing: g, colWidths: V, rowHeight: f } = ue(ge()), { enableCellResizing: m, cancelResizingChanges: t, resetStore: i, disableEditMode: w } = ge();
1721
+ S(
1722
+ () => {
1723
+ var _, $, v;
1724
+ return ((($ = (_ = s.layout) == null ? void 0 : _.colWidths) == null ? void 0 : $.length) ?? 0) > 0 || V.value.length > 0 || (((v = s.layout) == null ? void 0 : v.rowHeight) ?? 0) > 0 || f.value > 0;
1725
+ }
1726
+ );
1727
+ function T() {
1728
+ i(), w(), n("update:layout", {
1729
+ ...s.layout,
1730
+ rowHeight: void 0,
1731
+ colWidths: void 0
1732
+ });
1733
+ const _ = document.querySelector("table");
1734
+ if (_) {
1735
+ _.classList.remove("table-fixed"), _.classList.add("table-auto"), _.style.width = "";
1736
+ const $ = _.querySelectorAll("th"), v = _.querySelectorAll("td"), b = _.querySelectorAll("tr");
1737
+ $.forEach((u) => {
1738
+ u.style.width = "";
1739
+ }), v.forEach((u) => {
1740
+ u.style.width = "";
1741
+ }), b.forEach((u) => {
1742
+ u.style.height = "";
1743
+ });
1744
+ }
1745
+ }
1746
+ return ke(() => {
1747
+ var _, $;
1748
+ ((_ = s.layout) == null ? void 0 : _.rowHeight) !== void 0 && (f.value = s.layout.rowHeight), ($ = s.layout) != null && $.colWidths && (V.value = [...s.layout.colWidths]);
1749
+ }), (_, $) => {
1750
+ const v = C("FmButton");
1751
+ return h(), I("div", El, [
1752
+ F("p", Yl, j(e(o)("report.section.datasource.resizeTable")), 1),
1753
+ F("div", Jl, [
1754
+ e(g) ? U("", !0) : (h(), D(v, {
1755
+ key: 0,
1756
+ label: e(o)("report.section.datasource.resizeTable"),
1757
+ variant: "secondary",
1758
+ icon: "resize",
1759
+ "icon-position": "prepend",
1760
+ class: "[&_.label]:line-clamp-none w-full",
1761
+ onClick: e(m)
1762
+ }, null, 8, ["label", "onClick"])),
1763
+ e(g) ? (h(), D(v, {
1764
+ key: 1,
1765
+ label: e(o)("report.common.cancel"),
1766
+ variant: "secondary",
1767
+ icon: "close",
1768
+ "icon-position": "prepend",
1769
+ class: "[&_.label]:line-clamp-none w-full",
1770
+ onClick: e(t)
1771
+ }, null, 8, ["label", "onClick"])) : U("", !0),
1772
+ r(v, {
1773
+ label: e(o)("report.section.datasource.resetSize"),
1774
+ variant: "secondary",
1775
+ icon: "restart_alt",
1776
+ "icon-position": "prepend",
1777
+ class: "[&_.label]:line-clamp-none w-full",
1778
+ onClick: T
1779
+ }, null, 8, ["label"])
1780
+ ]),
1781
+ e(g) ? (h(), I("p", Gl, j(e(o)("report.section.datasource.resizeTableHelper")), 1)) : U("", !0)
1782
+ ]);
1783
+ };
1784
+ }
1785
+ }), Ql = { class: "flex gap-16 justify-center items-center" }, Zl = { class: "fm-typo-en-title-sm-600" }, eo = { class: "fm-typo-en-body-lg-600" }, lo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, oo = { class: "h-[40x]" }, $e = "YYYY-MM-DD", Ae = /* @__PURE__ */ X({
1786
+ __name: "TileEditorTab",
1787
+ props: /* @__PURE__ */ G({
1788
+ hideConfiguration: {
1789
+ type: Boolean,
1790
+ default: !1
1791
+ }
1792
+ }, {
1793
+ modelValue: {
1794
+ required: !0
1795
+ },
1796
+ modelModifiers: {}
1797
+ }),
1798
+ emits: /* @__PURE__ */ G(["hideConfiguration"], ["update:modelValue"]),
1799
+ setup(x, { emit: p }) {
1800
+ var l, d;
1801
+ const o = ze(), { dateRange: s, timezone: n } = ue(o), g = {
1802
+ startDate: s.value.startDate,
1803
+ endDate: s.value.endDate
1804
+ }, V = W({
1805
+ startDate: (l = ce(s.value.startDate)) == null ? void 0 : l.tz(n.value).format($e),
1806
+ endDate: (d = ce(s.value.endDate)) == null ? void 0 : d.tz(n.value).format($e)
1807
+ });
1808
+ se(
1809
+ V,
1810
+ () => {
1811
+ V.value.endDate || (V.value.endDate = V.value.startDate);
1812
+ const k = {
1813
+ startDate: ce.tz(V.value.startDate, n.value).startOf("day").utc().toISOString(),
1814
+ endDate: ce.tz(V.value.endDate, n.value).endOf("day").utc().toISOString()
1815
+ };
1816
+ s.value = k;
1817
+ },
1818
+ { deep: !0 }
1819
+ ), qe(() => {
1820
+ s.value = { ...g };
1821
+ });
1822
+ const f = le(x, "modelValue"), { breakpoints: m } = Re(), t = x, { promptMessage: i } = Le(), w = p, { t: T } = E();
1823
+ function _(k) {
1824
+ f.value = yl(k);
1825
+ }
1826
+ function $() {
1827
+ const k = [...f.value.widget.config.joinDatasources || []];
1828
+ k.push({ ...Qe(f.value.widget.type), conditions: [] }), _({
1829
+ ...f.value,
1830
+ widget: {
1831
+ ...f.value.widget,
1832
+ config: {
1833
+ ...f.value.widget.config,
1834
+ joinDatasources: k
1835
+ }
1836
+ }
1837
+ });
1838
+ }
1839
+ async function v(k) {
1840
+ if (!await i({
1841
+ title: T("report.tile.datasource.remove"),
1842
+ message: T("report.tile.datasource.confirmRemove", { index: k + 1 })
1843
+ })) return;
1844
+ const z = [...f.value.widget.config.joinDatasources || []];
1845
+ z.splice(k, 1), _({
1846
+ ...f.value,
1847
+ widget: {
1848
+ ...f.value.widget,
1849
+ config: {
1850
+ ...f.value.widget.config,
1851
+ joinDatasources: z
1852
+ }
1853
+ }
1854
+ });
1855
+ }
1856
+ const b = (k, y) => {
1857
+ let z = 1, R = 1;
1858
+ switch (k) {
1859
+ case L.Scorecard:
1860
+ z = 1, R = 2;
1861
+ break;
1862
+ case L.BarChart:
1863
+ case L.StackBarChart:
1864
+ case L.LineChart:
1865
+ case L.StackLineChart:
1866
+ z = 4, R = 6;
1867
+ break;
1868
+ case L.Table:
1869
+ z = 4, R = 12;
1870
+ break;
1871
+ case L.Circular:
1872
+ z = 4, R = 4;
1873
+ break;
1874
+ case L.Spacer:
1875
+ z = 0, R = 12;
1876
+ break;
1877
+ }
1878
+ return {
1879
+ id: y.id,
1880
+ size: {
1881
+ height: z,
1882
+ width: R
1883
+ },
1884
+ widget: {
1885
+ ...y.widget,
1886
+ type: k
1887
+ }
1888
+ };
1889
+ }, u = S(
1890
+ () => he.find((k) => k.type === f.value.widget.type)
1891
+ ), c = S(() => f.value.widget.config.joinDatasources), a = be((k) => {
1892
+ f.value.widget.title = k;
1893
+ }, 500);
1894
+ return se(
1895
+ () => f.value.size.height,
1896
+ (k) => {
1897
+ k < 1 && (f.value.size.height = 1), k > 12 && (f.value.size.height = 12);
1898
+ }
1899
+ ), se(
1900
+ () => f.value.size.width,
1901
+ (k) => {
1902
+ k < 1 && (f.value.size.width = 1), k > 12 && (f.value.size.width = 12);
1903
+ }
1904
+ ), (k, y) => {
1905
+ const z = C("FmCircularProgress"), R = C("FmSimpleDateRangePicker"), A = C("FmTextField"), H = C("FmTextarea"), Y = C("FmStepperField"), oe = C("FmButton"), O = C("FmForm");
1906
+ return h(), D(Oe(e(m).lg || e(m).md ? zl : Ml), {
1907
+ "model-value": t.hideConfiguration,
1908
+ "onUpdate:modelValue": y[9] || (y[9] = (B) => w("hideConfiguration", B))
1909
+ }, {
1910
+ default: N(() => [
1911
+ f.value ? (h(), D(O, {
1912
+ key: 1,
1913
+ ref: "form",
1914
+ class: "px-6 py-16 flex flex-col gap-24 overflow-y-auto overflow-x-hidden"
1915
+ }, {
1916
+ default: N(() => [
1917
+ F("div", Ql, [
1918
+ r(R, {
1919
+ modelValue: V.value,
1920
+ "onUpdate:modelValue": y[0] || (y[0] = (B) => V.value = B)
1921
+ }, null, 8, ["modelValue"])
1922
+ ]),
1923
+ r(Fe, null, {
1924
+ header: N(() => [
1925
+ F("p", Zl, j(e(T)("report.tile.widget.details")), 1),
1926
+ y[10] || (y[10] = F("div", { class: "grow" }, null, -1))
1927
+ ]),
1928
+ content: N(() => [
1929
+ r(A, {
1930
+ "model-value": f.value.widget.title,
1931
+ label: e(T)("report.tile.widget.title"),
1932
+ placeholder: e(T)("report.tile.widget.titlePlaceholder"),
1933
+ "onUpdate:modelValue": e(a)
1934
+ }, null, 8, ["model-value", "label", "placeholder", "onUpdate:modelValue"]),
1935
+ r(H, {
1936
+ modelValue: f.value.widget.description,
1937
+ "onUpdate:modelValue": y[1] || (y[1] = (B) => f.value.widget.description = B),
1938
+ disabled: f.value.widget.title === "",
1939
+ placeholder: e(T)("report.tile.widget.descriptionPlaceholder"),
1940
+ "helper-text": e(T)("report.tile.widget.descriptionHelper")
1941
+ }, {
1942
+ label: N(() => [
1943
+ F("p", eo, j(e(T)("report.tile.widget.widgetDescription")), 1),
1944
+ F("p", lo, " (" + j(e(T)("report.tile.widget.optional")) + ") ", 1)
1945
+ ]),
1946
+ _: 1
1947
+ }, 8, ["modelValue", "disabled", "placeholder", "helper-text"]),
1948
+ r(Hl, {
1949
+ model: f.value.widget.config,
1950
+ "onUpdate:model": y[2] || (y[2] = (B) => f.value.widget.config = B)
1951
+ }, null, 8, ["model"]),
1952
+ F("div", {
1953
+ class: Ie(["flex flex-row", `${e(m).sm || e(m).xs ? "gap-16" : "gap-2"}`])
1954
+ }, [
1955
+ r(Y, {
1956
+ modelValue: f.value.size.width,
1957
+ "onUpdate:modelValue": y[3] || (y[3] = (B) => f.value.size.width = B),
1958
+ label: e(T)("report.tile.widget.width"),
1959
+ min: 1,
1960
+ max: 12
1961
+ }, null, 8, ["modelValue", "label"]),
1962
+ r(Y, {
1963
+ modelValue: f.value.size.height,
1964
+ "onUpdate:modelValue": y[4] || (y[4] = (B) => f.value.size.height = B),
1965
+ label: e(T)("report.tile.widget.height"),
1966
+ min: 1,
1967
+ max: 12,
1968
+ disabled: f.value.widget.type === e(L).Scorecard
1969
+ }, null, 8, ["modelValue", "label", "disabled"])
1970
+ ], 2),
1971
+ f.value.widget.type === e(L).Table ? (h(), D(Kl, {
1972
+ key: 0,
1973
+ layout: f.value.widget.config,
1974
+ "onUpdate:layout": y[5] || (y[5] = (B) => f.value.widget.config = B)
1975
+ }, null, 8, ["layout"])) : U("", !0)
1976
+ ]),
1977
+ _: 1
1978
+ }),
1979
+ r(Fe, null, {
1980
+ header: N(() => [
1981
+ F("p", null, j(e(T)("report.tile.widget.type")), 1),
1982
+ y[11] || (y[11] = F("div", { class: "grow" }, null, -1))
1983
+ ]),
1984
+ content: N(() => [
1985
+ r(Ke, {
1986
+ "is-list": !0,
1987
+ "model-value": f.value.widget.type,
1988
+ class: "grid grid-cols-1 gap-2",
1989
+ "child-class": "flex flex-row p-[8px] gap-2",
1990
+ "exclude-widge-type": [e(L).Spacer],
1991
+ "onUpdate:modelValue": y[6] || (y[6] = (B) => f.value = b(B, f.value))
1992
+ }, null, 8, ["model-value", "exclude-widge-type"])
1993
+ ]),
1994
+ _: 1
1995
+ }),
1996
+ r(Ue, {
1997
+ modelValue: f.value.widget.config,
1998
+ "onUpdate:modelValue": y[7] || (y[7] = (B) => f.value.widget.config = B),
1999
+ label: e(T)("report.tile.datasource.main"),
2000
+ config: u.value
2001
+ }, null, 8, ["modelValue", "label", "config"]),
2002
+ c.value ? (h(!0), I(ee, { key: 0 }, re(c.value, (B, q) => (h(), I("div", { key: q }, [
2003
+ r(Ue, {
2004
+ modelValue: c.value[q],
2005
+ "onUpdate:modelValue": (K) => c.value[q] = K,
2006
+ label: e(T)("report.tile.datasource.join", { index: q + 1 }),
2007
+ config: u.value,
2008
+ "main-datasource-config": f.value.widget.config,
2009
+ closeable: !0,
2010
+ onClickClose: (K) => v(q)
2011
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "config", "main-datasource-config", "onClickClose"])
2012
+ ]))), 128)) : U("", !0),
2013
+ F("div", oo, [
2014
+ r(oe, {
2015
+ label: e(T)("report.tile.datasource.joinButton"),
2016
+ variant: "secondary",
2017
+ icon: "add",
2018
+ "icon-position": "prepend",
2019
+ "border-color": e(ve).ColorPrimary,
2020
+ "text-color": e(ve).ColorPrimary,
2021
+ class: "w-full",
2022
+ onClick: y[8] || (y[8] = (B) => $())
2023
+ }, null, 8, ["label", "border-color", "text-color"])
2024
+ ])
2025
+ ]),
2026
+ _: 1
2027
+ }, 512)) : (h(), D(z, { key: 0 }))
2028
+ ]),
2029
+ _: 1
2030
+ }, 8, ["model-value"]);
2031
+ };
2032
+ }
2033
+ }), to = { class: "flex flex-col gap-8" }, ao = { class: "pl-32 flex flex-col gap-8" }, no = { class: "fm-typo-en-body-lg-600" }, io = { class: "flex flex-row gap-8" }, so = { class: "fm-typo-en-body-lg-600" }, uo = { class: "flex flex-row gap-8" }, ro = /* @__PURE__ */ X({
2034
+ __name: "LabelSection",
2035
+ props: {
2036
+ model: {}
2037
+ },
2038
+ emits: ["update:model"],
2039
+ setup(x, { emit: p }) {
2040
+ const o = x, s = p, { t: n } = E(), g = S({
2041
+ get: () => o.model.showLabel ?? !1,
2042
+ set: (_) => {
2043
+ s("update:model", { ...o.model, showLabel: _ });
2044
+ }
2045
+ }), V = S({
2046
+ get: () => o.model.labelRotation ?? 0,
2047
+ set: (_) => s("update:model", { ...o.model, labelRotation: _ })
2048
+ }), f = S({
2049
+ get: () => o.model.labelOffset ?? 0,
2050
+ set: (_) => s("update:model", { ...o.model, labelOffset: _ })
2051
+ }), m = S({
2052
+ get: () => o.model.labelFontSize ?? 12,
2053
+ set: (_) => s("update:model", { ...o.model, labelFontSize: _ })
2054
+ }), t = (_) => {
2055
+ s("update:model", {
2056
+ ...o.model,
2057
+ labelAlign: o.model.labelAlign === _ ? void 0 : _
2058
+ });
2059
+ }, i = (_) => {
2060
+ s("update:model", {
2061
+ ...o.model,
2062
+ labelAnchor: o.model.labelAnchor === _ ? void 0 : _
2063
+ });
2064
+ }, w = [
2065
+ { icon: "align_horizontal_left", value: ie.left, tooltip: "alignLeft" },
2066
+ { icon: "align_justify_center", value: ie.center, tooltip: "alignCenter" },
2067
+ { icon: "align_horizontal_right", value: ie.right, tooltip: "alignRight" },
2068
+ { icon: "align_justify_flex_start", value: ie.start, tooltip: "alignStart" },
2069
+ { icon: "align_justify_flex_end", value: ie.end, tooltip: "alignEnd" },
2070
+ { icon: "align_flex_start", value: ie.top, tooltip: "alignTop" },
2071
+ { icon: "align_flex_end", value: ie.bottom, tooltip: "alignBottom" }
2072
+ ], T = [
2073
+ { icon: "format_align_left", value: Ve.start, tooltip: "anchorStart" },
2074
+ { icon: "format_align_center", value: Ve.center, tooltip: "anchorCenter" },
2075
+ { icon: "format_align_right", value: Ve.end, tooltip: "anchorEnd" }
2076
+ ];
2077
+ return (_, $) => {
2078
+ const v = C("FmCheckbox"), b = C("FmButton"), u = C("FmTooltip"), c = C("FmTextField"), a = C("FmStepperField");
2079
+ return h(), I("div", to, [
2080
+ r(v, {
2081
+ modelValue: g.value,
2082
+ "onUpdate:modelValue": $[0] || ($[0] = (l) => g.value = l),
2083
+ value: !1,
2084
+ label: e(n)("report.section.datasource.label.showLabel"),
2085
+ "label-placement": "right",
2086
+ class: "fm-typo-en-body-lg-400"
2087
+ }, null, 8, ["modelValue", "label"]),
2088
+ ae(F("div", ao, [
2089
+ F("p", no, j(e(n)("report.section.datasource.alignment.textAlignment")), 1),
2090
+ F("div", io, [
2091
+ (h(), I(ee, null, re(w, ({ icon: l, value: d, tooltip: k }) => r(u, {
2092
+ key: d,
2093
+ variant: "plain",
2094
+ placement: "top",
2095
+ content: e(n)(`report.section.datasource.alignment.alignOptions.${k}`),
2096
+ "z-index": 50
2097
+ }, {
2098
+ default: N(() => [
2099
+ r(b, {
2100
+ "append-icon": l,
2101
+ variant: "tertiary",
2102
+ "icon-color": _.model.labelAlign === d ? "neutral-gray-400" : "neutral-gray-300",
2103
+ "bg-color": _.model.labelAlign === d ? "neutral-gray-100" : "neutral-white",
2104
+ class: "rounded-sm",
2105
+ onClick: (y) => t(d)
2106
+ }, null, 8, ["append-icon", "icon-color", "bg-color", "onClick"])
2107
+ ]),
2108
+ _: 2
2109
+ }, 1032, ["content"])), 64))
2110
+ ]),
2111
+ F("p", so, j(e(n)("report.section.datasource.alignment.anchor")), 1),
2112
+ F("div", uo, [
2113
+ (h(), I(ee, null, re(T, ({ icon: l, value: d, tooltip: k }) => r(u, {
2114
+ key: d,
2115
+ variant: "plain",
2116
+ placement: "top",
2117
+ content: e(n)(`report.section.datasource.alignment.anchorOptions.${k}`),
2118
+ "z-index": 50
2119
+ }, {
2120
+ default: N(() => [
2121
+ r(b, {
2122
+ "append-icon": l,
2123
+ variant: "tertiary",
2124
+ "icon-color": _.model.labelAnchor === d ? "neutral-gray-400" : "neutral-gray-300",
2125
+ "bg-color": _.model.labelAnchor === d ? "neutral-gray-100" : "neutral-white",
2126
+ class: "rounded-sm",
2127
+ onClick: (y) => i(d)
2128
+ }, null, 8, ["append-icon", "icon-color", "bg-color", "onClick"])
2129
+ ]),
2130
+ _: 2
2131
+ }, 1032, ["content"])), 64))
2132
+ ]),
2133
+ r(c, {
2134
+ modelValue: V.value,
2135
+ "onUpdate:modelValue": $[1] || ($[1] = (l) => V.value = l),
2136
+ label: e(n)("report.section.datasource.alignment.rotation"),
2137
+ type: "number",
2138
+ min: -180,
2139
+ max: 180,
2140
+ step: 1
2141
+ }, null, 8, ["modelValue", "label"]),
2142
+ r(c, {
2143
+ modelValue: f.value,
2144
+ "onUpdate:modelValue": $[2] || ($[2] = (l) => f.value = l),
2145
+ label: e(n)("report.section.datasource.alignment.offset"),
2146
+ type: "number"
2147
+ }, null, 8, ["modelValue", "label"]),
2148
+ r(a, {
2149
+ modelValue: m.value,
2150
+ "onUpdate:modelValue": $[3] || ($[3] = (l) => m.value = l),
2151
+ label: e(n)("report.section.datasource.fontSize"),
2152
+ type: "number",
2153
+ min: 1
2154
+ }, null, 8, ["modelValue", "label"])
2155
+ ], 512), [
2156
+ [ne, g.value]
2157
+ ])
2158
+ ]);
2159
+ };
2160
+ }
2161
+ }), mo = { class: "flex flex-col gap-8" }, po = { class: "pl-32 flex flex-col gap-8" }, co = { class: "pl-32 flex flex-col gap-8" }, vo = { class: "pl-32 flex flex-col gap-8" }, fo = { class: "pl-32 flex flex-col gap-8" }, go = { class: "pl-32 flex flex-col gap-8" }, bo = { class: "pl-32 flex flex-col gap-8" }, yo = /* @__PURE__ */ X({
2162
+ __name: "XySection",
2163
+ props: {
2164
+ model: {}
2165
+ },
2166
+ emits: ["update:model"],
2167
+ setup(x, { emit: p }) {
2168
+ const o = x, s = p, { t: n } = E(), g = S({
2169
+ get: () => o.model.showX ?? !0,
2170
+ set: (v) => {
2171
+ s("update:model", { ...o.model, showX: v });
2172
+ }
2173
+ }), V = S({
2174
+ get: () => o.model.showXGrid ?? !1,
2175
+ set: (v) => {
2176
+ s("update:model", { ...o.model, showXGrid: v });
2177
+ }
2178
+ }), f = S({
2179
+ get: () => o.model.showXTick ?? !0,
2180
+ set: (v) => {
2181
+ s("update:model", { ...o.model, showXTick: v });
2182
+ }
2183
+ }), m = S({
2184
+ get: () => o.model.showY ?? !0,
2185
+ set: (v) => {
2186
+ s("update:model", { ...o.model, showY: v });
2187
+ }
2188
+ }), t = S({
2189
+ get: () => o.model.showYGrid ?? !0,
2190
+ set: (v) => {
2191
+ s("update:model", { ...o.model, showYGrid: v });
2192
+ }
2193
+ }), i = S({
2194
+ get: () => o.model.showYTick ?? !0,
2195
+ set: (v) => {
2196
+ s("update:model", { ...o.model, showYTick: v });
2197
+ }
2198
+ }), w = S({
2199
+ get: () => o.model.showXTitle ?? !1,
2200
+ set: (v) => {
2201
+ s("update:model", { ...o.model, showXTitle: v });
2202
+ }
2203
+ }), T = S({
2204
+ get: () => o.model.showYTitle ?? !1,
2205
+ set: (v) => {
2206
+ s("update:model", { ...o.model, showYTitle: v });
2207
+ }
2208
+ }), _ = be((v) => {
2209
+ s("update:model", { ...o.model, xTitle: v });
2210
+ }, 500), $ = be((v) => {
2211
+ s("update:model", { ...o.model, yTitle: v });
2212
+ }, 500);
2213
+ return ke(() => {
2214
+ var v, b, u, c;
2215
+ !o.model.xTitle && ((b = (v = o.model.metrics) == null ? void 0 : v[0]) != null && b.label) && _(o.model.metrics[0].label), !o.model.yTitle && ((c = (u = o.model.dimensions) == null ? void 0 : u[0]) != null && c.label) && $(o.model.dimensions[0].label);
2216
+ }), (v, b) => {
2217
+ const u = C("FmCheckbox"), c = C("FmStepperField"), a = C("FmTextField");
2218
+ return h(), I("div", mo, [
2219
+ r(u, {
2220
+ modelValue: g.value,
2221
+ "onUpdate:modelValue": b[0] || (b[0] = (l) => g.value = l),
2222
+ label: e(n)("report.section.datasource.axis.showX"),
2223
+ "label-placement": "right",
2224
+ value: !0
2225
+ }, null, 8, ["modelValue", "label"]),
2226
+ ae(F("div", po, [
2227
+ r(u, {
2228
+ modelValue: V.value,
2229
+ "onUpdate:modelValue": b[1] || (b[1] = (l) => V.value = l),
2230
+ label: e(n)("report.section.datasource.axis.showGrid"),
2231
+ "label-placement": "right",
2232
+ value: !1
2233
+ }, null, 8, ["modelValue", "label"]),
2234
+ r(u, {
2235
+ modelValue: f.value,
2236
+ "onUpdate:modelValue": b[2] || (b[2] = (l) => f.value = l),
2237
+ label: e(n)("report.section.datasource.axis.showTick"),
2238
+ "label-placement": "right",
2239
+ value: !0
2240
+ }, null, 8, ["modelValue", "label"]),
2241
+ ae(F("div", co, [
2242
+ r(c, {
2243
+ label: e(n)("report.section.datasource.fontSize"),
2244
+ type: "number",
2245
+ "model-value": v.model.xTickFontSize ?? 12,
2246
+ min: 1,
2247
+ "onUpdate:modelValue": b[3] || (b[3] = (l) => {
2248
+ s("update:model", { ...v.model, xTickFontSize: Number(l) });
2249
+ })
2250
+ }, null, 8, ["label", "model-value"])
2251
+ ], 512), [
2252
+ [ne, v.model.showXTick ?? !0]
2253
+ ]),
2254
+ r(u, {
2255
+ modelValue: w.value,
2256
+ "onUpdate:modelValue": b[4] || (b[4] = (l) => w.value = l),
2257
+ label: e(n)("report.section.datasource.axis.showTitle"),
2258
+ "label-placement": "right",
2259
+ value: !0
2260
+ }, null, 8, ["modelValue", "label"]),
2261
+ ae(F("div", vo, [
2262
+ r(a, {
2263
+ "model-value": v.model.xTitle,
2264
+ label: e(n)("report.common.title"),
2265
+ placeholder: e(n)("report.tile.widget.titlePlaceholder"),
2266
+ "onUpdate:modelValue": e(_)
2267
+ }, null, 8, ["model-value", "label", "placeholder", "onUpdate:modelValue"]),
2268
+ r(c, {
2269
+ label: e(n)("report.section.datasource.fontSize"),
2270
+ type: "number",
2271
+ "model-value": v.model.xTitleFontSize ?? 12,
2272
+ min: 1,
2273
+ "onUpdate:modelValue": b[5] || (b[5] = (l) => {
2274
+ s("update:model", { ...v.model, xTitleFontSize: Number(l) });
2275
+ })
2276
+ }, null, 8, ["label", "model-value"])
2277
+ ], 512), [
2278
+ [ne, w.value]
2279
+ ])
2280
+ ], 512), [
2281
+ [ne, v.model.showX ?? !0]
2282
+ ]),
2283
+ r(u, {
2284
+ modelValue: m.value,
2285
+ "onUpdate:modelValue": b[6] || (b[6] = (l) => m.value = l),
2286
+ label: e(n)("report.section.datasource.axis.showY"),
2287
+ "label-placement": "right",
2288
+ value: !0
2289
+ }, null, 8, ["modelValue", "label"]),
2290
+ ae(F("div", fo, [
2291
+ r(u, {
2292
+ modelValue: t.value,
2293
+ "onUpdate:modelValue": b[7] || (b[7] = (l) => t.value = l),
2294
+ label: e(n)("report.section.datasource.axis.showGrid"),
2295
+ "label-placement": "right",
2296
+ value: !1
2297
+ }, null, 8, ["modelValue", "label"]),
2298
+ r(u, {
2299
+ modelValue: i.value,
2300
+ "onUpdate:modelValue": b[8] || (b[8] = (l) => i.value = l),
2301
+ label: e(n)("report.section.datasource.axis.showTick"),
2302
+ "label-placement": "right",
2303
+ value: !0
2304
+ }, null, 8, ["modelValue", "label"]),
2305
+ ae(F("div", go, [
2306
+ r(c, {
2307
+ label: e(n)("report.section.datasource.fontSize"),
2308
+ type: "number",
2309
+ "model-value": v.model.yTickFontSize ?? 12,
2310
+ min: 1,
2311
+ "onUpdate:modelValue": b[9] || (b[9] = (l) => {
2312
+ s("update:model", { ...v.model, yTickFontSize: Number(l) });
2313
+ })
2314
+ }, null, 8, ["label", "model-value"])
2315
+ ], 512), [
2316
+ [ne, v.model.showYTick ?? !0]
2317
+ ]),
2318
+ r(u, {
2319
+ modelValue: T.value,
2320
+ "onUpdate:modelValue": b[10] || (b[10] = (l) => T.value = l),
2321
+ label: e(n)("report.section.datasource.axis.showTitle"),
2322
+ "label-placement": "right",
2323
+ value: !0
2324
+ }, null, 8, ["modelValue", "label"]),
2325
+ ae(F("div", bo, [
2326
+ r(a, {
2327
+ "model-value": v.model.yTitle,
2328
+ label: e(n)("report.common.title"),
2329
+ placeholder: e(n)("report.tile.widget.titlePlaceholder"),
2330
+ "onUpdate:modelValue": e($)
2331
+ }, null, 8, ["model-value", "label", "placeholder", "onUpdate:modelValue"]),
2332
+ r(c, {
2333
+ label: e(n)("report.section.datasource.fontSize"),
2334
+ type: "number",
2335
+ "model-value": v.model.yTitleFontSize ?? 12,
2336
+ min: 1,
2337
+ "onUpdate:modelValue": b[11] || (b[11] = (l) => {
2338
+ s("update:model", { ...v.model, yTitleFontSize: Number(l) });
2339
+ })
2340
+ }, null, 8, ["label", "model-value"])
2341
+ ], 512), [
2342
+ [ne, T.value]
2343
+ ])
2344
+ ], 512), [
2345
+ [ne, v.model.showY ?? !0]
2346
+ ])
2347
+ ]);
2348
+ };
2349
+ }
2350
+ }), ho = { class: "flex flex-col gap-8" }, Vo = { class: "pl-32 flex flex-col gap-8" }, wo = /* @__PURE__ */ X({
2351
+ __name: "LegendSection",
2352
+ props: {
2353
+ model: {},
2354
+ isCircularWidget: { type: Boolean }
2355
+ },
2356
+ emits: ["update:model"],
2357
+ setup(x, { emit: p }) {
2358
+ const o = x, s = p, { t: n } = E(), g = [
2359
+ { label: n("report.section.datasource.position.top"), value: "top" },
2360
+ { label: n("report.section.datasource.position.bottom"), value: "bottom" },
2361
+ { label: n("report.section.datasource.position.left"), value: "left" },
2362
+ { label: n("report.section.datasource.position.right"), value: "right" }
2363
+ ], V = S({
2364
+ get: () => o.model.showLegend !== void 0 ? o.model.showLegend : o.isCircularWidget === !0,
2365
+ set: (i) => {
2366
+ s("update:model", { ...o.model, showLegend: i });
2367
+ }
2368
+ }), f = S({
2369
+ get: () => o.model.usePointStyle ?? !0,
2370
+ set: (i) => {
2371
+ s("update:model", { ...o.model, usePointStyle: i });
2372
+ }
2373
+ }), m = S({
2374
+ get: () => o.model.legendMaxHeight ?? 54,
2375
+ set: (i) => {
2376
+ s("update:model", { ...o.model, legendMaxHeight: i });
2377
+ }
2378
+ }), t = S({
2379
+ get: () => o.model.legendMaxWidth ?? 54,
2380
+ set: (i) => {
2381
+ s("update:model", { ...o.model, legendMaxWidth: i });
2382
+ }
2383
+ });
2384
+ return (i, w) => {
2385
+ const T = C("FmCheckbox"), _ = C("FmSelect"), $ = C("FmStepperField");
2386
+ return h(), I("div", ho, [
2387
+ r(T, {
2388
+ modelValue: V.value,
2389
+ "onUpdate:modelValue": w[0] || (w[0] = (v) => V.value = v),
2390
+ class: "fm-typo-en-body-lg-400",
2391
+ value: !1,
2392
+ label: e(n)("report.section.datasource.legend.showLegend")
2393
+ }, null, 8, ["modelValue", "label"]),
2394
+ ae(F("div", Vo, [
2395
+ r(_, {
2396
+ label: e(n)("report.section.datasource.position.showPosition"),
2397
+ items: g,
2398
+ "model-value": i.model.legendPosition ?? "top",
2399
+ "onUpdate:modelValue": w[1] || (w[1] = (v) => s("update:model", { ...i.model, legendPosition: v }))
2400
+ }, null, 8, ["label", "model-value"]),
2401
+ r(T, {
2402
+ modelValue: f.value,
2403
+ "onUpdate:modelValue": w[2] || (w[2] = (v) => f.value = v),
2404
+ label: e(n)("report.section.datasource.legend.usePointStyle"),
2405
+ value: !1
2406
+ }, null, 8, ["modelValue", "label"]),
2407
+ i.model.legendPosition === "top" || i.model.legendPosition === "bottom" || !i.model.legendPosition ? (h(), D($, {
2408
+ key: 0,
2409
+ label: e(n)("report.section.datasource.legend.maxHeight"),
2410
+ "model-value": m.value,
2411
+ "onUpdate:modelValue": w[3] || (w[3] = (v) => s("update:model", { ...i.model, legendMaxHeight: v }))
2412
+ }, null, 8, ["label", "model-value"])) : U("", !0),
2413
+ i.model.legendPosition === "left" || i.model.legendPosition === "right" ? (h(), D($, {
2414
+ key: 1,
2415
+ label: e(n)("report.section.datasource.legend.maxWidth"),
2416
+ "model-value": t.value,
2417
+ "onUpdate:modelValue": w[4] || (w[4] = (v) => s("update:model", { ...i.model, legendMaxWidth: v }))
2418
+ }, null, 8, ["label", "model-value"])) : U("", !0)
2419
+ ], 512), [
2420
+ [ne, V.value]
2421
+ ])
2422
+ ]);
2423
+ };
2424
+ }
2425
+ }), Fo = { class: "flex flex-row gap-16" }, xo = /* @__PURE__ */ X({
2426
+ __name: "ChartSizeSection",
2427
+ props: {
2428
+ model: {}
2429
+ },
2430
+ emits: ["update:model"],
2431
+ setup(x, { emit: p }) {
2432
+ const o = x, s = p, { t: n } = E(), g = S({
2433
+ get: () => o.model.chartHeight ?? null,
2434
+ set: (f) => {
2435
+ s("update:model", { ...o.model, chartHeight: f ?? void 0 });
2436
+ }
2437
+ }), V = S({
2438
+ get: () => o.model.chartWidth ?? null,
2439
+ set: (f) => {
2440
+ s("update:model", { ...o.model, chartWidth: f ?? void 0 });
2441
+ }
2442
+ });
2443
+ return (f, m) => {
2444
+ const t = C("FmStepperField");
2445
+ return h(), I("div", Fo, [
2446
+ r(t, {
2447
+ modelValue: g.value,
2448
+ "onUpdate:modelValue": m[0] || (m[0] = (i) => g.value = i),
2449
+ type: "number",
2450
+ label: e(n)("report.section.datasource.chartHeight"),
2451
+ suffix: "px",
2452
+ min: 1,
2453
+ placeholder: "Auto"
2454
+ }, null, 8, ["modelValue", "label"]),
2455
+ r(t, {
2456
+ modelValue: V.value,
2457
+ "onUpdate:modelValue": m[1] || (m[1] = (i) => V.value = i),
2458
+ type: "number",
2459
+ label: e(n)("report.section.datasource.chartWidth"),
2460
+ suffix: "px",
2461
+ min: 1,
2462
+ placeholder: "Auto"
2463
+ }, null, 8, ["modelValue", "label"])
2464
+ ]);
2465
+ };
2466
+ }
2467
+ }), Co = { class: "flex flex-col gap-16" }, ko = { class: "flex flex-col gap-8" }, _o = { class: "flex flex-col gap-8" }, So = /* @__PURE__ */ X({
2468
+ __name: "StyleDatasource",
2469
+ props: /* @__PURE__ */ G({
2470
+ label: {
2471
+ type: String,
2472
+ default: "Label"
2473
+ },
2474
+ config: {
2475
+ type: Object,
2476
+ default: null
2477
+ },
2478
+ closeable: {
2479
+ type: Boolean,
2480
+ default: !1
2481
+ },
2482
+ mainDatasourceConfig: {
2483
+ type: Object,
2484
+ default: () => {
2485
+ }
2486
+ },
2487
+ modelValue: {
2488
+ type: Object,
2489
+ default: () => {
2490
+ }
2491
+ }
2492
+ }, {
2493
+ modelValue: { required: !0 },
2494
+ modelModifiers: {}
2495
+ }),
2496
+ emits: /* @__PURE__ */ G(["click-close"], ["update:modelValue"]),
2497
+ setup(x, { emit: p }) {
2498
+ const o = le(x, "modelValue");
2499
+ se(
2500
+ [() => o.value.dimensions, () => o.value.metrics],
2501
+ () => {
2502
+ const { rowIds: m, columnIds: t } = ye(o.value);
2503
+ o.value.rowIds = m, o.value.columnIds = t;
2504
+ },
2505
+ { deep: !0 }
2506
+ );
2507
+ const s = x, n = p, { t: g, te: V } = E(), f = S(() => s.config.type === L.Circular);
2508
+ return (m, t) => {
2509
+ const i = C("FmButton");
2510
+ return h(), I(ee, null, [
2511
+ t[6] || (t[6] = F("div", { class: "grow" }, null, -1)),
2512
+ s.closeable ? (h(), D(i, {
2513
+ key: 0,
2514
+ icon: "close",
2515
+ variant: "tertiary",
2516
+ size: "md",
2517
+ onClick: t[0] || (t[0] = te((w) => n("click-close"), ["stop"]))
2518
+ })) : U("", !0),
2519
+ F("div", Co, [
2520
+ s.config.hasChart ? (h(), D(xo, {
2521
+ key: 0,
2522
+ model: o.value,
2523
+ "onUpdate:model": t[1] || (t[1] = (w) => o.value = w)
2524
+ }, null, 8, ["model"])) : U("", !0),
2525
+ F("div", ko, [
2526
+ t[5] || (t[5] = F("p", { class: "fm-typo-en-body-lg-600" }, "Configuration", -1)),
2527
+ F("div", _o, [
2528
+ s.config.hasLabel ? (h(), D(ro, {
2529
+ key: 0,
2530
+ model: o.value,
2531
+ "onUpdate:model": t[2] || (t[2] = (w) => o.value = w)
2532
+ }, null, 8, ["model"])) : U("", !0),
2533
+ s.config.hasLegend ? (h(), D(wo, {
2534
+ key: 1,
2535
+ model: o.value,
2536
+ "is-circular-widget": f.value,
2537
+ "onUpdate:model": t[3] || (t[3] = (w) => o.value = w)
2538
+ }, null, 8, ["model", "is-circular-widget"])) : U("", !0),
2539
+ s.config.hasXy ? (h(), D(yo, {
2540
+ key: 2,
2541
+ model: o.value,
2542
+ "onUpdate:model": t[4] || (t[4] = (w) => o.value = w)
2543
+ }, null, 8, ["model"])) : U("", !0)
2544
+ ])
2545
+ ])
2546
+ ])
2547
+ ], 64);
2548
+ };
2549
+ }
2550
+ }), To = { class: "fixed bottom-6 right-6" }, Do = { class: "flex items-center gap-8" }, Uo = /* @__PURE__ */ X({
2551
+ __name: "StyleEditorTab",
2552
+ props: {
2553
+ modelValue: {
2554
+ required: !0
2555
+ },
2556
+ modelModifiers: {}
2557
+ },
2558
+ emits: ["update:modelValue"],
2559
+ setup(x) {
2560
+ const { t: p } = E(), o = le(x, "modelValue"), s = S(
2561
+ () => he.find((g) => g.type === o.value.widget.type)
2562
+ ), n = W(!1);
2563
+ return (g, V) => {
2564
+ const f = C("FmCircularProgress"), m = C("FmButton"), t = C("FmSideSheet");
2565
+ return h(), D(t, {
2566
+ modelValue: n.value,
2567
+ "onUpdate:modelValue": V[2] || (V[2] = (i) => n.value = i),
2568
+ "close-button": !1,
2569
+ "no-overlay": "",
2570
+ "dismiss-away": !0
2571
+ }, {
2572
+ "side-sheet-button": N(() => [
2573
+ F("div", To, [
2574
+ r(m, {
2575
+ label: "Style setting",
2576
+ icon: "edit",
2577
+ variant: "secondary",
2578
+ size: "md"
2579
+ })
2580
+ ])
2581
+ ]),
2582
+ "side-sheet-header": N(() => [
2583
+ F("div", Do, [
2584
+ r(m, {
2585
+ "prepend-icon": "arrow_back",
2586
+ variant: "tertiary",
2587
+ class: "fm-icon--rounded fm-icon--md text-fm-color-black",
2588
+ onClick: V[0] || (V[0] = (i) => n.value = !1)
2589
+ }),
2590
+ V[3] || (V[3] = F("p", { class: "fm-typo-en-title-sm-600" }, "Report style settings", -1))
2591
+ ])
2592
+ ]),
2593
+ default: N(() => [
2594
+ o.value ? U("", !0) : (h(), D(f, { key: 0 })),
2595
+ r(So, {
2596
+ modelValue: o.value.widget.config,
2597
+ "onUpdate:modelValue": V[1] || (V[1] = (i) => o.value.widget.config = i),
2598
+ config: s.value
2599
+ }, null, 8, ["modelValue", "config"])
2600
+ ]),
2601
+ _: 1
2602
+ }, 8, ["modelValue"]);
2603
+ };
2604
+ }
2605
+ }), $o = { class: "bg-fm-color-neutral-white flex flex-col h-full w-[510px]" }, No = { class: "flex bg-fm-color-neutral-white w-[88px]" }, Oo = { class: "w-full overflow-y-auto" }, Io = {
2606
+ class: "grid grid-cols-12 w-full p-24",
2607
+ style: { backgroundColor: "#F6F8FC" }
2608
+ }, Bo = /* @__PURE__ */ X({
2609
+ __name: "TileEditorDesktop",
2610
+ props: /* @__PURE__ */ G({
2611
+ hideConfiguration: { type: Boolean, required: !0, default: !1 },
2612
+ index: { type: Number, required: !0, default: 0 }
2613
+ }, {
2614
+ modelValue: {
2615
+ required: !0
2616
+ },
2617
+ modelModifiers: {}
2618
+ }),
2619
+ emits: /* @__PURE__ */ G(["hideConfiguration"], ["update:modelValue"]),
2620
+ setup(x, { emit: p }) {
2621
+ const o = le(x, "modelValue"), s = x, n = S(
2622
+ () => he.find((m) => {
2623
+ var t;
2624
+ return m.type === ((t = o.value) == null ? void 0 : t.widget.type);
2625
+ })
2626
+ ), g = p, V = [
2627
+ L.BarChart,
2628
+ L.StackBarChart,
2629
+ L.LineChart,
2630
+ L.StackLineChart,
2631
+ L.Circular
2632
+ ], f = S(() => V.includes(o.value.widget.type));
2633
+ return (m, t) => {
2634
+ const i = C("FmCircularProgress"), w = C("FmButton");
2635
+ return h(), I("div", null, [
2636
+ o.value ? (h(), I(ee, { key: 1 }, [
2637
+ r(Ze, {
2638
+ "model-value": !x.hideConfiguration
2639
+ }, {
2640
+ right: N(() => [
2641
+ F("div", $o, [
2642
+ r(Ae, {
2643
+ modelValue: o.value,
2644
+ "onUpdate:modelValue": t[0] || (t[0] = (T) => o.value = T),
2645
+ config: n.value,
2646
+ "hide-configuration": x.hideConfiguration,
2647
+ onHideConfiguration: t[1] || (t[1] = (T) => {
2648
+ g("hideConfiguration", T);
2649
+ })
2650
+ }, null, 8, ["modelValue", "config", "hide-configuration"])
2651
+ ])
2652
+ ]),
2653
+ left: N(() => [
2654
+ F("div", No, [
2655
+ r(w, {
2656
+ variant: "secondary",
2657
+ icon: "keyboard_double_arrow_right",
2658
+ "border-color": e(ve).ColorPrimary,
2659
+ "text-color": e(ve).ColorPrimary,
2660
+ class: "m-24 my-16",
2661
+ size: "md",
2662
+ onClick: t[2] || (t[2] = (T) => g("hideConfiguration", !s.hideConfiguration))
2663
+ }, null, 8, ["border-color", "text-color"])
2664
+ ])
2665
+ ]),
2666
+ _: 1
2667
+ }, 8, ["model-value"]),
2668
+ F("div", Oo, [
2669
+ F("div", Io, [
2670
+ o.value ? (h(), D(Me, {
2671
+ key: 0,
2672
+ "model-value": o.value,
2673
+ index: s.index,
2674
+ "hide-export": !0
2675
+ }, null, 8, ["model-value", "index"])) : (h(), D(Pe, { key: 1 }))
2676
+ ])
2677
+ ]),
2678
+ f.value ? (h(), D(Uo, {
2679
+ key: 0,
2680
+ modelValue: o.value,
2681
+ "onUpdate:modelValue": t[3] || (t[3] = (T) => o.value = T),
2682
+ "hide-configuration": x.hideConfiguration,
2683
+ onHideConfiguration: t[4] || (t[4] = (T) => {
2684
+ g("hideConfiguration", T);
2685
+ })
2686
+ }, null, 8, ["modelValue", "hide-configuration"])) : U("", !0)
2687
+ ], 64)) : (h(), D(i, { key: 0 }))
2688
+ ]);
2689
+ };
2690
+ }
2691
+ }), Lo = {
2692
+ key: 0,
2693
+ class: "flex w-full justify-center items-center"
2694
+ }, jo = { class: "w-full grid grid-cols-12 pb-28 pt-5 px-5 h-full" }, zo = /* @__PURE__ */ X({
2695
+ __name: "TileEditorMobile",
2696
+ props: /* @__PURE__ */ G({
2697
+ hideConfiguration: { type: Boolean, required: !0, default: !1 },
2698
+ index: { type: Number, required: !0, default: 0 }
2699
+ }, {
2700
+ modelValue: {
2701
+ required: !0
2702
+ },
2703
+ modelModifiers: {}
2704
+ }),
2705
+ emits: /* @__PURE__ */ G(["hideConfiguration"], ["update:modelValue"]),
2706
+ setup(x, { emit: p }) {
2707
+ const o = le(x, "modelValue"), s = x, n = S(
2708
+ () => he.find((V) => {
2709
+ var f;
2710
+ return V.type === ((f = o.value) == null ? void 0 : f.widget.type);
2711
+ })
2712
+ ), g = p;
2713
+ return (V, f) => {
2714
+ const m = C("FmCircularProgress");
2715
+ return h(), I("div", null, [
2716
+ o.value ? (h(), I(ee, { key: 1 }, [
2717
+ F("div", jo, [
2718
+ o.value ? (h(), D(Me, {
2719
+ key: 0,
2720
+ "model-value": o.value,
2721
+ index: s.index,
2722
+ "hide-export": !0
2723
+ }, null, 8, ["model-value", "index"])) : (h(), D(Pe, { key: 1 }))
2724
+ ]),
2725
+ r(Ae, {
2726
+ modelValue: o.value,
2727
+ "onUpdate:modelValue": f[0] || (f[0] = (t) => o.value = t),
2728
+ config: n.value,
2729
+ "hide-configuration": x.hideConfiguration,
2730
+ onHideConfiguration: f[1] || (f[1] = (t) => {
2731
+ g("hideConfiguration", t);
2732
+ })
2733
+ }, null, 8, ["modelValue", "config", "hide-configuration"])
2734
+ ], 64)) : (h(), I("div", Lo, [
2735
+ r(m)
2736
+ ]))
2737
+ ]);
2738
+ };
2739
+ }
2740
+ }), Ro = {
2741
+ key: 0,
2742
+ class: "fm-typo-en-title-md-600"
2743
+ }, Mo = {
2744
+ key: 0,
2745
+ class: "flex items-start justify-start px-24 py-12 flex-wrap w-full"
2746
+ }, et = /* @__PURE__ */ X({
2747
+ __name: "TileEditor",
2748
+ setup(x) {
2749
+ const { rowHeight: p, colWidths: o } = ue(ge()), s = Ee(), n = Ye(), g = tl(), { globalFilters: V } = ue(ze()), { currentSelectWidgetType: f, editingReport: m, editingTile: t, editingTileIndex: i } = ue(g), { breakpoints: w } = Re(), { promptMessage: T } = Le(), { t: _ } = E(), $ = W(!1);
2750
+ function v() {
2751
+ f.value = void 0, t.value = void 0, i.value = -1, n.back();
2752
+ }
2753
+ async function b() {
2754
+ var a;
2755
+ if (!m.value) return;
2756
+ await T({
2757
+ title: _("report.tile.save.title"),
2758
+ message: _("report.tile.save.confirm", { title: (a = t.value) == null ? void 0 : a.widget.title })
2759
+ }) && t.value && (t.value.widget.config = {
2760
+ ...t.value.widget.config,
2761
+ rowHeight: p.value,
2762
+ colWidths: [...o.value]
2763
+ }, i.value === -1 ? m.value.tiles.push(t.value) : m.value.tiles[i.value] = t.value, v());
2764
+ }
2765
+ async function u() {
2766
+ var a;
2767
+ if (!m.value) return;
2768
+ await T({
2769
+ title: _("report.tile.cancel.title"),
2770
+ message: _("report.tile.cancel.confirm", { title: (a = t.value) == null ? void 0 : a.widget.title })
2771
+ }) && v();
2772
+ }
2773
+ return ke(() => {
2774
+ m.value || n.push({ name: "reports" });
2775
+ }), (c, a) => {
2776
+ const l = C("FmPageHead");
2777
+ return h(), D(el, null, {
2778
+ default: N(() => [
2779
+ r(l, {
2780
+ actions: [
2781
+ { label: "Cancel", value: "cancel", isPrimary: !1 },
2782
+ { label: "Save", value: "save", isPrimary: !0 }
2783
+ ],
2784
+ "onClick:action": a[0] || (a[0] = (d) => {
2785
+ d === "cancel" && u(), d === "save" && b();
2786
+ })
2787
+ }, {
2788
+ title: N(() => {
2789
+ var d;
2790
+ return [
2791
+ e(w).lg || e(w).md ? (h(), I("p", Ro, j(e(je)(((d = e(t)) == null ? void 0 : d.widget.type) ?? "New report")), 1)) : U("", !0)
2792
+ ];
2793
+ }),
2794
+ _: 1
2795
+ }),
2796
+ e(t) && (e(V) || []).some((d) => {
2797
+ const k = d.tileIds, y = e(t) && e(t).id;
2798
+ return Array.isArray(k) && typeof y == "string" && k.includes(y);
2799
+ }) ? (h(), I("div", Mo, [
2800
+ r(il)
2801
+ ])) : U("", !0),
2802
+ e(t) ? (h(), D(Oe(e(w).lg || e(w).md ? Bo : zo), {
2803
+ key: 1,
2804
+ modelValue: e(t),
2805
+ "onUpdate:modelValue": a[1] || (a[1] = (d) => He(t) ? t.value = d : null),
2806
+ class: Ie(`${e(w).lg || e(w).md ? "flex" : ""} w-full`),
2807
+ style: We({ height: `calc( 100% - ${e(w).lg || e(w).md ? 72 : 64}px)` }),
2808
+ "hide-configuration": $.value,
2809
+ index: Number(e(s).params.tileIndex),
2810
+ onHideConfiguration: a[2] || (a[2] = (d) => $.value = d)
2811
+ }, null, 40, ["modelValue", "class", "style", "hide-configuration", "index"])) : U("", !0)
2812
+ ]),
2813
+ _: 1
2814
+ });
2815
+ };
2816
+ }
2817
+ });
2818
+ export {
2819
+ et as default
2820
+ };