@feedmepos/mf-report 5.28.1 → 5.28.2-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 (32) hide show
  1. package/dist/{App-BQcj7ZgK.js → App-BXAJux6l.js} +37 -37
  2. package/dist/{DateRangeSelect-TQA-9XXm.js → DateRangeSelect-CTRmA328.js} +1 -1
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-2PkkRpW_.js → Default.vue_vue_type_script_setup_true_lang-BG2jxJPI.js} +1 -1
  4. package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-BpZh4FDA.js → DynamicWidget.vue_vue_type_script_setup_true_lang-C_DJ9FoF.js} +5 -5
  5. package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-Ddimiuh3.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-DYRTdidI.js} +567 -563
  6. package/dist/{InsightView-BG5IeWD1.js → InsightView-DaOWIctS.js} +5 -5
  7. package/dist/{Integration-DUBg0wiX.js → Integration-BpGek4aO.js} +3 -3
  8. package/dist/{Integrations-CerT8IlU.js → Integrations-14q5kVTI.js} +2 -2
  9. package/dist/{Layout-Rr16bUkn.js → Layout-DvcgX7Iv.js} +1 -1
  10. package/dist/{LocationSelect.vue_vue_type_script_setup_true_lang-BEUDpozo.js → LocationSelect.vue_vue_type_script_setup_true_lang-C_CDdD0A.js} +2 -2
  11. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-Ca-Vlwmm.js → MenuTab.vue_vue_type_script_setup_true_lang-DDzDc9Jf.js} +5 -5
  12. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-IJ7NUGbC.js → NavigationTab.vue_vue_type_script_setup_true_lang-CQQhOfTk.js} +5 -5
  13. package/dist/{OverviewView-D5q_5KwX.js → OverviewView-COpmh0Kb.js} +4 -4
  14. package/dist/{Report-CDk8BkDF.js → Report-CKz6bZsI.js} +3 -3
  15. package/dist/{ReportCanvasView-BNy6YAj6.js → ReportCanvasView-1XK-YyTM.js} +3 -3
  16. package/dist/{ReportEditor-JAgqGYhA.js → ReportEditor-CCheaXAp.js} +849 -830
  17. package/dist/ReportView-QNB3gvs4.js +333 -0
  18. package/dist/{ReportViewRoute-NmDrsao2.js → ReportViewRoute-Dx_TqR4V.js} +2 -2
  19. package/dist/{Setting-BCBWGuMP.js → Setting-CL9fHaC_.js} +3 -3
  20. package/dist/{Template-B0Z7IA2P.js → Template-CQXJLmIR.js} +3 -3
  21. package/dist/{TileEditor-CUUIrvVX.js → TileEditor-dRlM0Rt9.js} +6 -6
  22. package/dist/{TilePageStack.vue_vue_type_script_setup_true_lang-ByOoDTHP.js → TilePageStack.vue_vue_type_script_setup_true_lang-DsvTr7fz.js} +2 -2
  23. package/dist/{TransitionFade-DVVKEBlH.js → TransitionFade-BmUpvHUW.js} +5 -5
  24. package/dist/{app-CVVEOyIu.js → app-DajOeQ5X.js} +721 -717
  25. package/dist/app.js +1 -1
  26. package/dist/assets/{formatChartData.worker-BeBGCyYW.js → formatChartData.worker-Dx1USoTn.js} +5 -1
  27. package/dist/assets/{processTableData.worker-frTYV0ok.js → processTableData.worker-clNopMr8.js} +5 -1
  28. package/dist/{report-35Rm6TvO.js → report-a3OefqFb.js} +157 -153
  29. package/dist/style.css +1 -1
  30. package/dist/{useRestaurantPermission-BAkRCzWY.js → useRestaurantPermission-xyo71b-g.js} +1 -1
  31. package/package.json +1 -1
  32. package/dist/ReportView-C3LFd5yk.js +0 -329
@@ -1,21 +1,21 @@
1
- import { defineComponent as we, mergeModels as ke, useModel as Te, ref as E, computed as g, resolveComponent as C, createBlock as x, openBlock as c, withCtx as w, createElementVNode as v, createVNode as u, unref as l, normalizeClass as Le, createTextVNode as Ae, toDisplayString as U, createElementBlock as M, Fragment as he, renderSlot as gt, createCommentVNode as I, watch as pe, renderList as Ee, onMounted as bt, onUnmounted as Dt, resolveDynamicComponent as It, isRef as yt, normalizeStyle as rt } from "vue";
2
- import { W as Ot, g as Ut, _ as Nt, a as Bt, e as De, S as We, d as ht, b as wt, T as Mt, c as Rt } from "./TransitionFade-DVVKEBlH.js";
3
- import { C as xe, D as te, b as ze, F as Je, c as Ie, u as it, i as Pe, d as ce, M as _t, r as zt, e as et, n as Pt, f as qt, g as Et, h as Lt, j as Gt, k as Wt, m as At, a as Ht, o as mt, p as tt, q as jt, Q as Ke, l as Jt, s as Kt } from "./report-35Rm6TvO.js";
1
+ import { defineComponent as we, mergeModels as ke, useModel as Te, ref as L, computed as g, resolveComponent as C, createBlock as x, openBlock as c, withCtx as _, createElementVNode as v, createVNode as u, unref as t, normalizeClass as Le, createTextVNode as Ae, toDisplayString as U, createElementBlock as R, Fragment as he, renderSlot as gl, createCommentVNode as D, watch as ve, renderList as Ee, onMounted as bl, onUnmounted as Dl, resolveDynamicComponent as Ol, isRef as yl, normalizeStyle as rl } from "vue";
2
+ import { W as Il, g as Ul, _ as Nl, a as Bl, e as De, S as We, d as hl, b as wl, T as Ml, c as Rl } from "./TransitionFade-BmUpvHUW.js";
3
+ import { C as xe, D as te, b as ze, F as Je, c as Oe, u as il, i as Pe, d as pe, M as _l, r as zl, e as el, n as Pl, f as ql, g as El, h as Ll, j as Gl, k as Wl, m as Al, a as Hl, o as ml, p as ll, q as jl, Q as Qe, l as Jl, s as Ql } from "./report-a3OefqFb.js";
4
4
  import { storeToRefs as qe } from "pinia";
5
- import { useRouter as st, useRoute as ut } from "vue-router";
6
- import { useBreakpoints as Qe, useSnackbar as Ft, FmButtonColorThemeVariant as Ce } from "@feedmepos/ui-library";
7
- import { u as dt } from "./message-dialog-UoMWOnil.js";
8
- import { u as Qt } from "./global-loader-BuxFfehu.js";
5
+ import { useRouter as sl, useRoute as ul } from "vue-router";
6
+ import { useBreakpoints as Ke, useSnackbar as Fl, FmButtonColorThemeVariant as Ce } from "@feedmepos/ui-library";
7
+ import { u as dl } from "./message-dialog-UoMWOnil.js";
8
+ import { u as Kl } from "./global-loader-BuxFfehu.js";
9
9
  import { u as Ge } from "./_plugin-vue_export-helper-C6QDExPN.js";
10
10
  import { r as He } from "./i18n-DbyciK4x.js";
11
- import { _ as lt } from "./TilePageStack.vue_vue_type_script_setup_true_lang-ByOoDTHP.js";
12
- import { a as ot, _ as at } from "./SelectComponent.vue_vue_type_script_setup_true_lang-DW7Dk7iQ.js";
13
- import { d as Yt, e as Xt, i as Zt } from "./DynamicWidget.vue_vue_type_script_setup_true_lang-BpZh4FDA.js";
14
- import { g as el, d as tl, _ as ct } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-Ddimiuh3.js";
15
- import { useCoreStore as ll } from "@feedmepos/mf-common";
16
- import { u as ol, a as al } from "./app-CVVEOyIu.js";
17
- import { d as rl } from "./DateRangeSelect-TQA-9XXm.js";
18
- const nl = /* @__PURE__ */ we({
11
+ import { _ as tl } from "./TilePageStack.vue_vue_type_script_setup_true_lang-DsvTr7fz.js";
12
+ import { a as ol, _ as al } from "./SelectComponent.vue_vue_type_script_setup_true_lang-DW7Dk7iQ.js";
13
+ import { d as Yl, e as Xl, i as Zl } from "./DynamicWidget.vue_vue_type_script_setup_true_lang-C_DJ9FoF.js";
14
+ import { g as et, d as lt, _ as cl } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-DYRTdidI.js";
15
+ import { useCoreStore as tt } from "@feedmepos/mf-common";
16
+ import { u as ot, a as at } from "./app-DajOeQ5X.js";
17
+ import { d as rt } from "./DateRangeSelect-CTRmA328.js";
18
+ const nt = /* @__PURE__ */ we({
19
19
  __name: "WidgetDialog",
20
20
  props: /* @__PURE__ */ ke({
21
21
  isOpen: { type: Boolean }
@@ -24,41 +24,41 @@ const nl = /* @__PURE__ */ we({
24
24
  modelModifiers: {}
25
25
  }),
26
26
  emits: /* @__PURE__ */ ke(["update:isOpen"], ["update:modelValue"]),
27
- setup(R, { emit: p }) {
28
- const { t: d } = Ge(), { breakpoints: b } = Qe(), i = Te(R, "modelValue"), h = R, q = p;
29
- function K() {
30
- q("update:isOpen", !1);
27
+ setup(z, { emit: p }) {
28
+ const { t: d } = Ge(), { breakpoints: b } = Ke(), i = Te(z, "modelValue"), h = z, P = p;
29
+ function Q() {
30
+ P("update:isOpen", !1);
31
31
  }
32
32
  function T() {
33
- _.value && (i.value = _.value, _.value = void 0, q("update:isOpen", !1));
33
+ F.value && (i.value = F.value, F.value = void 0, P("update:isOpen", !1));
34
34
  }
35
- const _ = E(), D = g(() => !_.value);
36
- return (Z, z) => {
35
+ const F = L(), O = g(() => !F.value);
36
+ return (X, q) => {
37
37
  const a = C("FmButton"), S = C("FmDialog");
38
38
  return c(), x(S, {
39
39
  "model-value": h.isOpen
40
40
  }, {
41
- "dialog-header": w(() => [
42
- Ae(U(l(d)("report.widget.type")), 1)
41
+ "dialog-header": _(() => [
42
+ Ae(U(t(d)("report.widget.type")), 1)
43
43
  ]),
44
- default: w(() => [
45
- u(Ot, {
46
- modelValue: _.value,
47
- "onUpdate:modelValue": z[0] || (z[0] = (k) => _.value = k),
48
- class: Le(`grid ${l(b).lg || l(b).md ? "grid-cols-3 gap-3" : "grid-cols-2 gap-3"}`),
44
+ default: _(() => [
45
+ u(Il, {
46
+ modelValue: F.value,
47
+ "onUpdate:modelValue": q[0] || (q[0] = (k) => F.value = k),
48
+ class: Le(`grid ${t(b).lg || t(b).md ? "grid-cols-3 gap-3" : "grid-cols-2 gap-3"}`),
49
49
  "child-class": "p-[8px] flex flex-col"
50
50
  }, null, 8, ["modelValue", "class"])
51
51
  ]),
52
- "dialog-footer": w(() => [
53
- z[1] || (z[1] = v("div", { class: "grow" }, null, -1)),
52
+ "dialog-footer": _(() => [
53
+ q[1] || (q[1] = v("div", { class: "grow" }, null, -1)),
54
54
  u(a, {
55
- label: l(d)("report.common.cancel"),
55
+ label: t(d)("report.common.cancel"),
56
56
  variant: "tertiary",
57
- onClick: K
57
+ onClick: Q
58
58
  }, null, 8, ["label"]),
59
59
  u(a, {
60
- label: l(d)("report.common.confirm"),
61
- disabled: D.value,
60
+ label: t(d)("report.common.confirm"),
61
+ disabled: O.value,
62
62
  onClick: T
63
63
  }, null, 8, ["label", "disabled"])
64
64
  ]),
@@ -66,7 +66,7 @@ const nl = /* @__PURE__ */ we({
66
66
  }, 8, ["model-value"]);
67
67
  };
68
68
  }
69
- }), il = { class: "fm-typo-en-body-lg-600" }, nt = /* @__PURE__ */ we({
69
+ }), it = { class: "fm-typo-en-body-lg-600" }, nl = /* @__PURE__ */ we({
70
70
  __name: "ReportEditorTabHeader",
71
71
  props: /* @__PURE__ */ ke({
72
72
  icon: {
@@ -78,70 +78,70 @@ const nl = /* @__PURE__ */ we({
78
78
  modelModifiers: {}
79
79
  }),
80
80
  emits: ["update:modelValue"],
81
- setup(R) {
82
- const { t: p } = Ge(), d = Te(R, "modelValue"), b = R;
81
+ setup(z) {
82
+ const { t: p } = Ge(), d = Te(z, "modelValue"), b = z;
83
83
  return (i, h) => {
84
- const q = C("FmIcon");
85
- return c(), M("div", {
84
+ const P = C("FmIcon");
85
+ return c(), R("div", {
86
86
  class: "px-6 py-16 flex items-center gap-2 bg-fm-color-neutral-white border cursor-pointer",
87
- onClick: h[0] || (h[0] = (K) => d.value = !d.value)
87
+ onClick: h[0] || (h[0] = (Q) => d.value = !d.value)
88
88
  }, [
89
- v("p", il, U(l(p)("report.editor.customizeReport")), 1),
89
+ v("p", it, U(t(p)("report.editor.customizeReport")), 1),
90
90
  h[1] || (h[1] = v("div", { class: "grow" }, null, -1)),
91
- u(q, {
91
+ u(P, {
92
92
  name: b.icon
93
93
  }, null, 8, ["name"])
94
94
  ]);
95
95
  };
96
96
  }
97
- }), sl = /* @__PURE__ */ we({
97
+ }), st = /* @__PURE__ */ we({
98
98
  __name: "ReportEditorTabDesktop",
99
99
  props: {
100
100
  modelValue: { required: !0, default: !1 },
101
101
  modelModifiers: {}
102
102
  },
103
103
  emits: ["update:modelValue"],
104
- setup(R) {
105
- const p = Te(R, "modelValue");
106
- return (d, b) => (c(), M(he, null, [
107
- u(nt, {
104
+ setup(z) {
105
+ const p = Te(z, "modelValue");
106
+ return (d, b) => (c(), R(he, null, [
107
+ u(nl, {
108
108
  modelValue: p.value,
109
109
  "onUpdate:modelValue": b[0] || (b[0] = (i) => p.value = i),
110
110
  icon: "keyboard_double_arrow_left"
111
111
  }, null, 8, ["modelValue"]),
112
- gt(d.$slots, "default")
112
+ gl(d.$slots, "default")
113
113
  ], 64));
114
114
  }
115
- }), ul = /* @__PURE__ */ we({
115
+ }), ut = /* @__PURE__ */ we({
116
116
  __name: "ReportEditorTabMobile",
117
117
  props: {
118
118
  modelValue: { required: !0, default: !1 },
119
119
  modelModifiers: {}
120
120
  },
121
121
  emits: ["update:modelValue"],
122
- setup(R) {
123
- const p = Te(R, "modelValue");
122
+ setup(z) {
123
+ const p = Te(z, "modelValue");
124
124
  return (d, b) => {
125
125
  const i = C("FmTopSheet"), h = C("FmCard");
126
126
  return c(), x(h, { class: "fixed bottom-0 w-full" }, {
127
- default: w(() => [
128
- u(nt, {
127
+ default: _(() => [
128
+ u(nl, {
129
129
  modelValue: p.value,
130
- "onUpdate:modelValue": b[0] || (b[0] = (q) => p.value = q),
130
+ "onUpdate:modelValue": b[0] || (b[0] = (P) => p.value = P),
131
131
  icon: "keyboard_double_arrow_up"
132
132
  }, null, 8, ["modelValue"]),
133
133
  u(i, {
134
134
  modelValue: p.value,
135
- "onUpdate:modelValue": b[2] || (b[2] = (q) => p.value = q),
135
+ "onUpdate:modelValue": b[2] || (b[2] = (P) => p.value = P),
136
136
  "fullscreen-size": "sm"
137
137
  }, {
138
- default: w(() => [
139
- u(nt, {
138
+ default: _(() => [
139
+ u(nl, {
140
140
  modelValue: p.value,
141
- "onUpdate:modelValue": b[1] || (b[1] = (q) => p.value = q),
141
+ "onUpdate:modelValue": b[1] || (b[1] = (P) => p.value = P),
142
142
  icon: "keyboard_double_arrow_down"
143
143
  }, null, 8, ["modelValue"]),
144
- p.value ? gt(d.$slots, "default", { key: 0 }) : I("", !0)
144
+ p.value ? gl(d.$slots, "default", { key: 0 }) : D("", !0)
145
145
  ]),
146
146
  _: 3
147
147
  }, 8, ["modelValue"])
@@ -150,19 +150,19 @@ const nl = /* @__PURE__ */ we({
150
150
  });
151
151
  };
152
152
  }
153
- }), dl = {
153
+ }), dt = {
154
154
  key: 2,
155
155
  class: "flex flex-col gap-3 mt-2 border border-neutral-300 p-3"
156
- }, ml = { class: "grid grid-cols-1 gap-2 rounded-md border border-neutral-300 p-2 sm:grid-cols-[1.3fr_1fr_1fr_auto] sm:items-end" }, cl = {
156
+ }, mt = { class: "grid grid-cols-1 gap-2 rounded-md border border-neutral-300 p-2 sm:grid-cols-[1.3fr_1fr_1fr_auto] sm:items-end" }, ct = {
157
157
  key: 0,
158
158
  class: "flex justify-end sm:pb-[2px]"
159
- }, pl = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, vl = { class: "pl-1" }, fl = {
159
+ }, pt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, vt = { class: "pl-1" }, ft = {
160
160
  key: 0,
161
161
  class: "flex justify-end sm:pb-[2px]"
162
- }, gl = {
162
+ }, gt = {
163
163
  key: 3,
164
164
  class: "flex flex-col gap-2"
165
- }, bl = /* @__PURE__ */ we({
165
+ }, bt = /* @__PURE__ */ we({
166
166
  __name: "GlobalFilterDialog",
167
167
  props: /* @__PURE__ */ ke({
168
168
  schemas: {
@@ -182,190 +182,190 @@ const nl = /* @__PURE__ */ we({
182
182
  isOpenModifiers: {}
183
183
  }),
184
184
  emits: ["update:globalFilter", "update:isOpen"],
185
- setup(R) {
186
- const { t: p, te: d } = Ge(), b = Te(R, "globalFilter"), i = Te(R, "isOpen"), h = Ft(), q = R, K = E(""), T = E(), _ = E(), D = E(), Z = E([]), z = E([]), a = E(!1), S = E([]), k = E([]), Q = E(xe.Equal);
187
- function ne(n) {
185
+ setup(z) {
186
+ const { t: p, te: d } = Ge(), b = Te(z, "globalFilter"), i = Te(z, "isOpen"), h = Fl(), P = z, Q = L(""), T = L(), F = L(), O = L(), X = L([]), q = L([]), a = L(!1), S = L([]), k = L([]), j = L(xe.Equal);
187
+ function ae(n) {
188
188
  return JSON.parse(JSON.stringify(n));
189
189
  }
190
- function ue(n, e) {
190
+ function de(n, e) {
191
191
  return { hour: n, minute: e };
192
192
  }
193
- function W(n) {
193
+ function A(n) {
194
194
  return n ? `${String(n.hour).padStart(2, "0")}:${String(n.minute).padStart(2, "0")}` : null;
195
195
  }
196
- function A(n) {
196
+ function ie(n) {
197
197
  if (!n) return null;
198
- const [e, t] = n.split(":").map(Number);
199
- return Number.isNaN(e) || Number.isNaN(t) ? null : { hour: e, minute: t };
198
+ const [e, l] = n.split(":").map(Number);
199
+ return Number.isNaN(e) || Number.isNaN(l) ? null : { hour: e, minute: l };
200
200
  }
201
- const V = g(() => _.value ? !(_.value.type === te.Timestamp && D.value === ze.DateTime) : !1), X = g(
201
+ const w = g(() => F.value ? !(F.value.type === te.Timestamp && O.value === ze.DateTime) : !1), K = g(
202
202
  () => {
203
203
  var n;
204
- return ((n = _.value) == null ? void 0 : n.type) === te.Timestamp && D.value === ze.TimeOfDay;
204
+ return ((n = F.value) == null ? void 0 : n.type) === te.Timestamp && O.value === ze.TimeOfDay;
205
205
  }
206
- ), le = g(() => {
206
+ ), re = g(() => {
207
207
  var n;
208
- return (((n = _.value) == null ? void 0 : n.filterOperators) ?? []).filter((e) => e !== xe.And && e !== xe.Or).map((e) => ({
208
+ return (((n = F.value) == null ? void 0 : n.filterOperators) ?? []).filter((e) => e !== xe.And && e !== xe.Or).map((e) => ({
209
209
  label: p(`report.section.comparisonOperator.${e}`),
210
210
  value: e
211
211
  }));
212
212
  });
213
- function oe() {
213
+ function Z() {
214
214
  var e;
215
- const n = (e = le.value[0]) == null ? void 0 : e.value;
216
- return n || (_.value ? ye(
217
- _.value.type,
218
- D.value ?? null
215
+ const n = (e = re.value[0]) == null ? void 0 : e.value;
216
+ return n || (F.value ? ye(
217
+ F.value.type,
218
+ O.value ?? null
219
219
  ) : xe.Equal);
220
220
  }
221
- function ie(n) {
222
- if (_.value)
223
- return el({
224
- operator: n ?? oe(),
225
- dataType: _.value.type,
226
- dimensionOption: _.value.type === te.Timestamp ? D.value ?? null : null,
221
+ function ne(n) {
222
+ if (F.value)
223
+ return et({
224
+ operator: n ?? Z(),
225
+ dataType: F.value.type,
226
+ dimensionOption: F.value.type === te.Timestamp ? O.value ?? null : null,
227
227
  t: p
228
228
  });
229
229
  }
230
230
  function se(n, e) {
231
231
  if (typeof (e == null ? void 0 : e.default) == "boolean" || n.length > 0 && n.every((y) => typeof y == "boolean")) {
232
- const y = n.reduce((F, $) => (typeof $ == "boolean" && F.push($), F), []);
232
+ const y = n.reduce((V, $) => (typeof $ == "boolean" && V.push($), V), []);
233
233
  if (e)
234
234
  for (e.fixed && y.splice(e.count); y.length < e.count; )
235
235
  y.push(typeof e.default == "boolean" ? e.default : !1);
236
236
  return y;
237
237
  }
238
- const s = n.reduce((y, F) => (typeof F == "string" && y.push(F), y), []);
238
+ const s = n.reduce((y, V) => (typeof V == "string" && y.push(V), y), []);
239
239
  if (e)
240
240
  for (e.fixed && s.splice(e.count); s.length < e.count; )
241
241
  s.push(typeof e.default == "string" ? e.default : "");
242
242
  return s;
243
243
  }
244
- function de(n = Q.value) {
245
- const e = ie(n), t = se(
244
+ function me(n = j.value) {
245
+ const e = ne(n), l = se(
246
246
  e ? Array(e.count).fill(e.default) : [],
247
247
  e
248
248
  );
249
249
  return {
250
250
  label: "",
251
251
  operator: n,
252
- values: t
252
+ values: l
253
253
  };
254
254
  }
255
- function P() {
255
+ function ue() {
256
256
  return {
257
257
  name: "",
258
- startTime: ue(0, 0),
259
- endTime: ue(23, 59)
258
+ startTime: de(0, 0),
259
+ endTime: de(23, 59)
260
260
  };
261
261
  }
262
- function L() {
263
- if (!(!V.value || !a.value)) {
264
- if (X.value) {
265
- k.value.length === 0 && (k.value = [P()]);
262
+ function N() {
263
+ if (!(!w.value || !a.value)) {
264
+ if (K.value) {
265
+ k.value.length === 0 && (k.value = [ue()]);
266
266
  return;
267
267
  }
268
- S.value.length === 0 && (S.value = [de()]);
268
+ S.value.length === 0 && (S.value = [me()]);
269
269
  }
270
270
  }
271
- function j() {
272
- var t, s, y;
273
- const n = ne(((t = b.value) == null ? void 0 : t.customOptions) ?? []), e = ne(((s = b.value) == null ? void 0 : s.customTimeRanges) ?? []);
274
- Q.value = ((y = n[0]) == null ? void 0 : y.operator) ?? oe(), a.value = n.length > 0 || e.length > 0, S.value = n, k.value = e, L();
271
+ function E() {
272
+ var l, s, y;
273
+ const n = ae(((l = b.value) == null ? void 0 : l.customOptions) ?? []), e = ae(((s = b.value) == null ? void 0 : s.customTimeRanges) ?? []);
274
+ j.value = ((y = n[0]) == null ? void 0 : y.operator) ?? Z(), a.value = n.length > 0 || e.length > 0, S.value = n, k.value = e, N();
275
275
  }
276
- function me(n) {
277
- Q.value = n, S.value = S.value.map((e, t) => {
278
- const s = S.value[t];
276
+ function H(n) {
277
+ j.value = n, S.value = S.value.map((e, l) => {
278
+ const s = S.value[l];
279
279
  if (!s)
280
- return de(n);
281
- const y = ie(n), F = se(
280
+ return me(n);
281
+ const y = ne(n), V = se(
282
282
  Array.isArray(s.values) ? [...s.values] : [],
283
283
  y
284
284
  );
285
285
  return {
286
286
  ...s,
287
287
  operator: n,
288
- values: F
288
+ values: V
289
289
  };
290
290
  });
291
291
  }
292
- function ve() {
293
- S.value = [...S.value, de()];
292
+ function ce() {
293
+ S.value = [...S.value, me()];
294
294
  }
295
- function J(n) {
296
- S.value.length <= 1 || (S.value = S.value.filter((e, t) => t !== n));
295
+ function Se(n) {
296
+ S.value.length <= 1 || (S.value = S.value.filter((e, l) => l !== n));
297
297
  }
298
- function _e() {
299
- k.value = [...k.value, P()];
298
+ function J() {
299
+ k.value = [...k.value, ue()];
300
300
  }
301
- function ae(n) {
301
+ function ee(n) {
302
302
  k.value.length <= 1 || (k.value = k.value.filter(
303
- (e, t) => t !== n
303
+ (e, l) => l !== n
304
304
  ));
305
305
  }
306
- function Se(n, e, t) {
306
+ function _e(n, e, l) {
307
307
  const s = k.value[n];
308
308
  s && (k.value[n] = {
309
309
  ...s,
310
- [e]: A(t)
310
+ [e]: ie(l)
311
311
  });
312
312
  }
313
- function Oe(n) {
313
+ function Ie(n) {
314
314
  return n.length === 0 || n.some((e) => e === "");
315
315
  }
316
316
  function Ue() {
317
317
  if (!a.value) return !0;
318
- if (X.value) {
319
- const t = k.value.map((y) => y.name.trim()).filter(Boolean);
318
+ if (K.value) {
319
+ const l = k.value.map((y) => y.name.trim()).filter(Boolean);
320
320
  return k.value.some(
321
321
  (y) => !y.name.trim() || !y.startTime || !y.endTime
322
322
  ) ? (h.open({
323
323
  message: p("report.section.filter.invalidCustomTimeRange"),
324
324
  type: "error"
325
- }), !1) : new Set(t).size !== t.length ? (h.open({
325
+ }), !1) : new Set(l).size !== l.length ? (h.open({
326
326
  message: p("report.section.filter.customTimeRangeNamesMustBeUnique"),
327
327
  type: "error"
328
328
  }), !1) : !0;
329
329
  }
330
- const n = S.value.map((t) => t.label.trim()).filter(Boolean);
330
+ const n = S.value.map((l) => l.label.trim()).filter(Boolean);
331
331
  return S.value.some(
332
- (t) => !t.label.trim() || Oe(t.values)
332
+ (l) => !l.label.trim() || Ie(l.values)
333
333
  ) ? (h.open({ message: p("report.section.filter.invalidCustomOption"), type: "error" }), !1) : new Set(n).size !== n.length ? (h.open({
334
334
  message: p("report.section.filter.customOptionLabelsMustBeUnique"),
335
335
  type: "error"
336
336
  }), !1) : !0;
337
337
  }
338
- pe(i, (n) => {
339
- var e, t, s, y, F;
340
- n && (K.value = ((e = b.value) == null ? void 0 : e.label) || "", T.value = q.schemas.find(
338
+ ve(i, (n) => {
339
+ var e, l, s, y, V;
340
+ n && (Q.value = ((e = b.value) == null ? void 0 : e.label) || "", T.value = P.schemas.find(
341
341
  ($) => {
342
- var B;
343
- return $.name === ((B = b.value) == null ? void 0 : B.schemaName);
342
+ var M;
343
+ return $.name === ((M = b.value) == null ? void 0 : M.schemaName);
344
344
  }
345
- ), _.value = (t = ge.value.find(
345
+ ), F.value = (l = ge.value.find(
346
346
  ($) => {
347
- var B;
348
- return $.value.name === ((B = b.value) == null ? void 0 : B.name);
347
+ var M;
348
+ return $.value.name === ((M = b.value) == null ? void 0 : M.name);
349
349
  }
350
- )) == null ? void 0 : t.value, D.value = (s = b.value) == null ? void 0 : s.option, Z.value = ((y = b.value) == null ? void 0 : y.tileIds) || [], z.value = ((F = b.value) == null ? void 0 : F.filters) || [], j());
351
- }), pe(a, (n) => {
350
+ )) == null ? void 0 : l.value, O.value = (s = b.value) == null ? void 0 : s.option, X.value = ((y = b.value) == null ? void 0 : y.tileIds) || [], q.value = ((V = b.value) == null ? void 0 : V.filters) || [], E());
351
+ }), ve(a, (n) => {
352
352
  var e;
353
- n && (Q.value = ((e = S.value[0]) == null ? void 0 : e.operator) ?? oe(), L());
354
- }), pe(V, (n) => {
353
+ n && (j.value = ((e = S.value[0]) == null ? void 0 : e.operator) ?? Z(), N());
354
+ }), ve(w, (n) => {
355
355
  if (!n) {
356
356
  a.value = !1, S.value = [], k.value = [];
357
357
  return;
358
358
  }
359
- L();
360
- }), pe(X, () => {
361
- L();
362
- }), pe(le, (n) => {
363
- var t;
364
- const e = (t = n[0]) == null ? void 0 : t.value;
365
- e && (n.some((s) => s.value === Q.value) || me(e));
359
+ N();
360
+ }), ve(K, () => {
361
+ N();
362
+ }), ve(re, (n) => {
363
+ var l;
364
+ const e = (l = n[0]) == null ? void 0 : l.value;
365
+ e && (n.some((s) => s.value === j.value) || H(e));
366
366
  });
367
367
  const fe = g(
368
- () => q.schemas.map((n) => ({
368
+ () => P.schemas.map((n) => ({
369
369
  label: n.label || n.name,
370
370
  value: n
371
371
  }))
@@ -377,18 +377,18 @@ const nl = /* @__PURE__ */ we({
377
377
  }));
378
378
  }), Ne = g(() => {
379
379
  var n;
380
- return ((n = _.value) == null ? void 0 : n.type) !== te.Timestamp ? [] : Ut(p);
381
- }), Be = g(() => q.tiles.reduce((n, e, t) => {
382
- var F, $, B, G, O;
383
- const s = ((F = e.widget) == null ? void 0 : F.config.schemaNames) ?? [], y = ((($ = e.widget) == null ? void 0 : $.config.joinDatasources) ?? []).flatMap(
384
- (re) => re.schemaNames ?? []
380
+ return ((n = F.value) == null ? void 0 : n.type) !== te.Timestamp ? [] : Ul(p);
381
+ }), Be = g(() => P.tiles.reduce((n, e, l) => {
382
+ var V, $, M, G, I;
383
+ const s = ((V = e.widget) == null ? void 0 : V.config.schemaNames) ?? [], y = ((($ = e.widget) == null ? void 0 : $.config.joinDatasources) ?? []).flatMap(
384
+ (oe) => oe.schemaNames ?? []
385
385
  );
386
- return [...s, ...y].includes(((B = T.value) == null ? void 0 : B.name) || "") && n.push({
387
- label: (O = (G = e.widget) == null ? void 0 : G.title) != null && O.trim() ? e.widget.title : `Widget ${t + 1}`,
386
+ return [...s, ...y].includes(((M = T.value) == null ? void 0 : M.name) || "") && n.push({
387
+ label: (I = (G = e.widget) == null ? void 0 : G.title) != null && I.trim() ? e.widget.title : `Widget ${l + 1}`,
388
388
  value: e.id
389
389
  }), n;
390
390
  }, [])), Me = g(
391
- () => q.schemas.flatMap(
391
+ () => P.schemas.flatMap(
392
392
  (n) => (n.fields ?? []).map((e) => ({
393
393
  ...e,
394
394
  labels: [
@@ -400,10 +400,10 @@ const nl = /* @__PURE__ */ we({
400
400
  );
401
401
  function be(n) {
402
402
  var e;
403
- n.name !== ((e = T.value) == null ? void 0 : e.name) && (T.value = n, _.value = void 0, Q.value = xe.Equal, a.value = !1, S.value = [], k.value = []);
403
+ n.name !== ((e = T.value) == null ? void 0 : e.name) && (T.value = n, F.value = void 0, j.value = xe.Equal, a.value = !1, S.value = [], k.value = []);
404
404
  }
405
405
  function Fe(n) {
406
- _.value = n, D.value = n.type === te.Timestamp ? ze.DateTime : void 0, Q.value = oe(), a.value = !1, S.value = [], k.value = [];
406
+ F.value = n, O.value = n.type === te.Timestamp ? ze.DateTime : void 0, j.value = Z(), a.value = !1, S.value = [], k.value = [];
407
407
  }
408
408
  function ye(n, e) {
409
409
  switch (n) {
@@ -422,13 +422,13 @@ const nl = /* @__PURE__ */ we({
422
422
  h.open({ message: p("report.section.filter.invalidSchema"), type: "error" });
423
423
  return;
424
424
  }
425
- if (!_.value) {
425
+ if (!F.value) {
426
426
  h.open({ message: p("report.section.filter.invalidDimension"), type: "error" });
427
427
  return;
428
428
  }
429
- const n = z.value.filter((s) => s ? !fe.value.some((F) => F.value.name === s.schemaName) : !0);
429
+ const n = q.value.filter((s) => s ? !fe.value.some((V) => V.value.name === s.schemaName) : !0);
430
430
  if (n.length > 0) {
431
- const s = n.filter((F) => !!F).map((F) => F.schemaName), y = n.some((F) => !F) ? `, ${p("report.section.filter.unknownFilters")}` : "";
431
+ const s = n.filter((V) => !!V).map((V) => V.schemaName), y = n.some((V) => !V) ? `, ${p("report.section.filter.unknownFilters")}` : "";
432
432
  h.open({
433
433
  message: p("report.section.filter.invalidFiltersSchemaNotFound", {
434
434
  schemas: s.join(", "),
@@ -440,188 +440,188 @@ const nl = /* @__PURE__ */ we({
440
440
  }
441
441
  if (!Ue())
442
442
  return;
443
- const e = a.value && !X.value ? S.value.map((s) => ({
443
+ const e = a.value && !K.value ? S.value.map((s) => ({
444
444
  label: s.label.trim(),
445
- operator: s.operator ?? oe(),
445
+ operator: s.operator ?? Z(),
446
446
  values: se(
447
447
  [...s.values],
448
- ie(s.operator)
448
+ ne(s.operator)
449
449
  )
450
- })) : void 0, t = a.value && X.value ? k.value.map((s) => ({
450
+ })) : void 0, l = a.value && K.value ? k.value.map((s) => ({
451
451
  name: s.name.trim(),
452
452
  startTime: s.startTime,
453
453
  endTime: s.endTime
454
454
  })) : void 0;
455
455
  b.value = {
456
456
  schemaName: T.value.name,
457
- name: _.value.name,
458
- label: K.value,
457
+ name: F.value.name,
458
+ label: Q.value,
459
459
  operator: ye(
460
- _.value.type,
461
- _.value.type === te.Timestamp ? D.value ?? ze.DateTime : null
460
+ F.value.type,
461
+ F.value.type === te.Timestamp ? O.value ?? ze.DateTime : null
462
462
  ),
463
- option: _.value.type === te.Timestamp ? D.value : null,
463
+ option: F.value.type === te.Timestamp ? O.value : null,
464
464
  values: [],
465
- tileIds: [...Z.value],
466
- filters: ne(z.value),
465
+ tileIds: [...X.value],
466
+ filters: ae(q.value),
467
467
  customOptions: e,
468
- customTimeRanges: t
468
+ customTimeRanges: l
469
469
  }, i.value = !1;
470
470
  }
471
- function ee() {
471
+ function le() {
472
472
  i.value = !1;
473
473
  }
474
474
  const $e = g(() => {
475
475
  var n;
476
476
  return [
477
477
  (n = T.value) == null ? void 0 : n.name,
478
- ...z.value.map((e) => e.schemaName)
478
+ ...q.value.map((e) => e.schemaName)
479
479
  ];
480
480
  });
481
481
  function Re(n) {
482
482
  var r;
483
- const e = q.tiles.find((f) => f.id === n.value);
484
- if (!e || !T.value || !_.value) return null;
485
- const t = (r = e == null ? void 0 : e.widget) == null ? void 0 : r.config, s = (t == null ? void 0 : t.schemaNames) ?? [], y = ((t == null ? void 0 : t.joinDatasources) ?? []).flatMap(
483
+ const e = P.tiles.find((f) => f.id === n.value);
484
+ if (!e || !T.value || !F.value) return null;
485
+ const l = (r = e == null ? void 0 : e.widget) == null ? void 0 : r.config, s = (l == null ? void 0 : l.schemaNames) ?? [], y = ((l == null ? void 0 : l.joinDatasources) ?? []).flatMap(
486
486
  (f) => f.schemaNames ?? []
487
- ), F = [...s, ...y], $ = $e.value.filter((f) => !!f).some((f) => !F.includes(f)), B = _.value.type === te.Timestamp;
487
+ ), V = [...s, ...y], $ = $e.value.filter((f) => !!f).some((f) => !V.includes(f)), M = F.value.type === te.Timestamp;
488
488
  if ($)
489
489
  return p(
490
- B ? "report.section.filter.missingFilterSchema" : "report.section.filter.missingFilterSchemaOrDimension"
490
+ M ? "report.section.filter.missingFilterSchema" : "report.section.filter.missingFilterSchemaOrDimension"
491
491
  );
492
- if (B) return null;
493
- const G = ((t == null ? void 0 : t.dimensions) ?? []).map((f) => ({
492
+ if (M) return null;
493
+ const G = ((l == null ? void 0 : l.dimensions) ?? []).map((f) => ({
494
494
  schemaName: f.schemaName,
495
495
  name: f.name
496
- })), O = ((t == null ? void 0 : t.joinDatasources) ?? []).flatMap(
497
- (f) => (f.dimensions ?? []).map((H) => ({
498
- schemaName: H.schemaName,
499
- name: H.name
496
+ })), I = ((l == null ? void 0 : l.joinDatasources) ?? []).flatMap(
497
+ (f) => (f.dimensions ?? []).map((W) => ({
498
+ schemaName: W.schemaName,
499
+ name: W.name
500
500
  }))
501
- ), re = [...G, ...O], Y = T.value.name, m = _.value.name;
502
- return re.some(
501
+ ), oe = [...G, ...I], Y = T.value.name, m = F.value.name;
502
+ return oe.some(
503
503
  (f) => f.schemaName === Y && f.name === m
504
504
  ) ? null : p("report.section.filter.missingFilterSchemaOrDimension");
505
505
  }
506
506
  return (n, e) => {
507
- const t = C("FmTextField"), s = C("FmSelect"), y = C("FmCheckbox"), F = C("FmTimePicker"), $ = C("FmButton"), B = C("FmLabel"), G = C("FmIcon"), O = C("FmTooltip"), re = C("FmForm"), Y = C("FmDialog");
507
+ const l = C("FmTextField"), s = C("FmSelect"), y = C("FmCheckbox"), V = C("FmTimePicker"), $ = C("FmButton"), M = C("FmLabel"), G = C("FmIcon"), I = C("FmTooltip"), oe = C("FmForm"), Y = C("FmDialog");
508
508
  return c(), x(Y, {
509
509
  modelValue: i.value,
510
510
  "onUpdate:modelValue": e[9] || (e[9] = (m) => i.value = m),
511
511
  overlay: !0,
512
512
  "z-index": 10
513
513
  }, {
514
- "dialog-header": w(() => [
515
- Ae(U(l(p)("report.section.filter.globalFilter")), 1)
514
+ "dialog-header": _(() => [
515
+ Ae(U(t(p)("report.section.filter.globalFilter")), 1)
516
516
  ]),
517
- default: w(() => [
518
- u(re, {
517
+ default: _(() => [
518
+ u(oe, {
519
519
  ref: "form",
520
520
  class: "flex flex-col gap-2 w-[490px]"
521
521
  }, {
522
- default: w(() => {
522
+ default: _(() => {
523
523
  var m;
524
524
  return [
525
- u(t, {
526
- modelValue: K.value,
527
- "onUpdate:modelValue": e[0] || (e[0] = (o) => K.value = o),
528
- placeholder: l(p)("report.section.filter.displayName"),
529
- label: l(p)("report.section.filter.displayName"),
525
+ u(l, {
526
+ modelValue: Q.value,
527
+ "onUpdate:modelValue": e[0] || (e[0] = (o) => Q.value = o),
528
+ placeholder: t(p)("report.section.filter.displayName"),
529
+ label: t(p)("report.section.filter.displayName"),
530
530
  class: "mb-2"
531
531
  }, null, 8, ["modelValue", "placeholder", "label"]),
532
- u(ot, {
532
+ u(ol, {
533
533
  "model-value": T.value,
534
534
  items: fe.value,
535
- placeholder: l(p)("report.section.schema.title"),
536
- label: l(p)("report.section.schema.title"),
535
+ placeholder: t(p)("report.section.schema.title"),
536
+ label: t(p)("report.section.schema.title"),
537
537
  "onUpdate:modelValue": e[1] || (e[1] = (o) => be(o))
538
538
  }, null, 8, ["model-value", "items", "placeholder", "label"]),
539
- u(ot, {
540
- "model-value": _.value,
539
+ u(ol, {
540
+ "model-value": F.value,
541
541
  items: ge.value,
542
- placeholder: l(p)("report.section.dimension.title"),
543
- label: l(p)("report.section.dimension.title"),
542
+ placeholder: t(p)("report.section.dimension.title"),
543
+ label: t(p)("report.section.dimension.title"),
544
544
  "onUpdate:modelValue": e[2] || (e[2] = (o) => Fe(o))
545
545
  }, null, 8, ["model-value", "items", "placeholder", "label"]),
546
- ((m = _.value) == null ? void 0 : m.type) === l(te).Timestamp ? (c(), x(s, {
546
+ ((m = F.value) == null ? void 0 : m.type) === t(te).Timestamp ? (c(), x(s, {
547
547
  key: 0,
548
- modelValue: D.value,
549
- "onUpdate:modelValue": e[3] || (e[3] = (o) => D.value = o),
548
+ modelValue: O.value,
549
+ "onUpdate:modelValue": e[3] || (e[3] = (o) => O.value = o),
550
550
  items: Ne.value,
551
- placeholder: l(p)("report.section.filter.timeFormatter"),
552
- label: l(p)("report.section.filter.timeFormatter")
553
- }, null, 8, ["modelValue", "items", "placeholder", "label"])) : I("", !0),
554
- V.value ? (c(), x(y, {
551
+ placeholder: t(p)("report.section.filter.timeFormatter"),
552
+ label: t(p)("report.section.filter.timeFormatter")
553
+ }, null, 8, ["modelValue", "items", "placeholder", "label"])) : D("", !0),
554
+ w.value ? (c(), x(y, {
555
555
  key: 1,
556
556
  modelValue: a.value,
557
557
  "onUpdate:modelValue": e[4] || (e[4] = (o) => a.value = o),
558
- label: l(p)("report.section.filter.customOptions"),
558
+ label: t(p)("report.section.filter.customOptions"),
559
559
  value: !0
560
- }, null, 8, ["modelValue", "label"])) : I("", !0),
561
- V.value && a.value ? (c(), M("div", dl, [
562
- X.value ? (c(!0), M(he, { key: 0 }, Ee(k.value, (o, r) => (c(), M("div", {
560
+ }, null, 8, ["modelValue", "label"])) : D("", !0),
561
+ w.value && a.value ? (c(), R("div", dt, [
562
+ K.value ? (c(!0), R(he, { key: 0 }, Ee(k.value, (o, r) => (c(), R("div", {
563
563
  key: `custom-time-range-${r}`,
564
564
  class: "flex flex-col gap-2"
565
565
  }, [
566
- v("div", ml, [
567
- u(t, {
566
+ v("div", mt, [
567
+ u(l, {
568
568
  modelValue: o.name,
569
569
  "onUpdate:modelValue": (f) => o.name = f,
570
- label: l(p)("report.section.filter.label")
570
+ label: t(p)("report.section.filter.label")
571
571
  }, null, 8, ["modelValue", "onUpdate:modelValue", "label"]),
572
- u(F, {
573
- "model-value": W(o.startTime),
574
- label: l(p)("report.date.startingTime"),
575
- "onUpdate:modelValue": (f) => Se(r, "startTime", f)
572
+ u(V, {
573
+ "model-value": A(o.startTime),
574
+ label: t(p)("report.date.startingTime"),
575
+ "onUpdate:modelValue": (f) => _e(r, "startTime", f)
576
576
  }, null, 8, ["model-value", "label", "onUpdate:modelValue"]),
577
- u(F, {
578
- "model-value": W(o.endTime),
579
- label: l(p)("report.date.endingTime"),
580
- "onUpdate:modelValue": (f) => Se(r, "endTime", f)
577
+ u(V, {
578
+ "model-value": A(o.endTime),
579
+ label: t(p)("report.date.endingTime"),
580
+ "onUpdate:modelValue": (f) => _e(r, "endTime", f)
581
581
  }, null, 8, ["model-value", "label", "onUpdate:modelValue"]),
582
- k.value.length > 1 ? (c(), M("div", cl, [
582
+ k.value.length > 1 ? (c(), R("div", ct, [
583
583
  u($, {
584
584
  icon: "delete",
585
585
  variant: "tertiary",
586
- onClick: (f) => ae(r)
586
+ onClick: (f) => ee(r)
587
587
  }, null, 8, ["onClick"])
588
- ])) : I("", !0)
588
+ ])) : D("", !0)
589
589
  ])
590
- ]))), 128)) : (c(), M(he, { key: 1 }, [
591
- v("p", pl, U(l(p)("report.section.filter.operator")), 1),
592
- le.value.length > 0 ? (c(), x(ot, {
590
+ ]))), 128)) : (c(), R(he, { key: 1 }, [
591
+ v("p", pt, U(t(p)("report.section.filter.operator")), 1),
592
+ re.value.length > 0 ? (c(), x(ol, {
593
593
  key: 0,
594
- "model-value": Q.value,
595
- items: le.value,
596
- placeholder: l(p)("report.section.filter.operator"),
597
- "onUpdate:modelValue": e[5] || (e[5] = (o) => me(o))
598
- }, null, 8, ["model-value", "items", "placeholder"])) : I("", !0),
599
- (c(!0), M(he, null, Ee(S.value, (o, r) => (c(), M("div", {
594
+ "model-value": j.value,
595
+ items: re.value,
596
+ placeholder: t(p)("report.section.filter.operator"),
597
+ "onUpdate:modelValue": e[5] || (e[5] = (o) => H(o))
598
+ }, null, 8, ["model-value", "items", "placeholder"])) : D("", !0),
599
+ (c(!0), R(he, null, Ee(S.value, (o, r) => (c(), R("div", {
600
600
  key: `custom-option-${r}`,
601
601
  class: "flex flex-col gap-2"
602
602
  }, [
603
603
  v("div", {
604
604
  class: Le(["grid grid-cols-1 gap-2 p-2 sm:items-end text-fm-color-typo-primary fm-typo-en-body-lg-600 border-neutral-300 rounded-md border", "sm:grid-cols-[1fr_1.6fr_auto]"])
605
605
  }, [
606
- v("span", vl, U(l(p)("report.section.filter.label")), 1),
607
- u(t, {
606
+ v("span", vt, U(t(p)("report.section.filter.label")), 1),
607
+ u(l, {
608
608
  modelValue: o.label,
609
609
  "onUpdate:modelValue": (f) => o.label = f
610
610
  }, null, 8, ["modelValue", "onUpdate:modelValue"]),
611
- (c(), x(Nt, {
612
- key: `custom-option-value-${r}-${o.operator ?? ""}-${D.value ?? ""}`,
611
+ (c(), x(Nl, {
612
+ key: `custom-option-value-${r}-${o.operator ?? ""}-${O.value ?? ""}`,
613
613
  modelValue: o.values,
614
614
  "onUpdate:modelValue": (f) => o.values = f,
615
- config: ie(o.operator),
616
- option: D.value
615
+ config: ne(o.operator),
616
+ option: O.value
617
617
  }, null, 8, ["modelValue", "onUpdate:modelValue", "config", "option"])),
618
- S.value.length > 1 ? (c(), M("div", fl, [
618
+ S.value.length > 1 ? (c(), R("div", ft, [
619
619
  u($, {
620
620
  icon: "delete",
621
621
  variant: "tertiary",
622
- onClick: (f) => J(r)
622
+ onClick: (f) => Se(r)
623
623
  }, null, 8, ["onClick"])
624
- ])) : I("", !0)
624
+ ])) : D("", !0)
625
625
  ])
626
626
  ]))), 128))
627
627
  ], 64)),
@@ -630,65 +630,65 @@ const nl = /* @__PURE__ */ we({
630
630
  variant: "primary",
631
631
  icon: "add",
632
632
  "icon-position": "prepend",
633
- onClick: e[6] || (e[6] = (o) => X.value ? _e() : ve())
633
+ onClick: e[6] || (e[6] = (o) => K.value ? J() : ce())
634
634
  })
635
- ])) : I("", !0),
636
- u(Bt, {
637
- modelValue: z.value,
638
- "onUpdate:modelValue": e[7] || (e[7] = (o) => z.value = o),
635
+ ])) : D("", !0),
636
+ u(Bl, {
637
+ modelValue: q.value,
638
+ "onUpdate:modelValue": e[7] || (e[7] = (o) => q.value = o),
639
639
  options: Me.value
640
640
  }, null, 8, ["modelValue", "options"]),
641
- u(B, { class: "mt-2 fm-typo-en-body-lg-600" }, {
642
- default: w(() => [
643
- Ae(U(l(p)("report.section.filter.applyWidget")), 1)
641
+ u(M, { class: "mt-2 fm-typo-en-body-lg-600" }, {
642
+ default: _(() => [
643
+ Ae(U(t(p)("report.section.filter.applyWidget")), 1)
644
644
  ]),
645
645
  _: 1
646
646
  }),
647
- R.tiles.length > 0 ? (c(), M("div", gl, [
648
- (c(!0), M(he, null, Ee(Be.value, (o) => (c(), M("div", {
647
+ z.tiles.length > 0 ? (c(), R("div", gt, [
648
+ (c(!0), R(he, null, Ee(Be.value, (o) => (c(), R("div", {
649
649
  key: o.value,
650
650
  class: "flex items-center"
651
651
  }, [
652
652
  u(y, {
653
- modelValue: Z.value,
654
- "onUpdate:modelValue": e[8] || (e[8] = (r) => Z.value = r),
653
+ modelValue: X.value,
654
+ "onUpdate:modelValue": e[8] || (e[8] = (r) => X.value = r),
655
655
  label: o.label,
656
656
  value: o.value
657
657
  }, null, 8, ["modelValue", "label", "value"]),
658
- Re(o) ? (c(), x(O, {
658
+ Re(o) ? (c(), x(I, {
659
659
  key: 0,
660
660
  content: Re(o) ?? void 0,
661
661
  "z-index": 99,
662
662
  class: "ml-2"
663
663
  }, {
664
- default: w(() => [
664
+ default: _(() => [
665
665
  u(G, {
666
666
  name: "warning",
667
667
  class: "text-fm-color-system-error-300"
668
668
  })
669
669
  ]),
670
670
  _: 2
671
- }, 1032, ["content"])) : I("", !0)
671
+ }, 1032, ["content"])) : D("", !0)
672
672
  ]))), 128))
673
- ])) : (c(), x(B, {
673
+ ])) : (c(), x(M, {
674
674
  key: 4,
675
675
  class: "fm-typo-en-body-lg-400",
676
- label: l(p)("report.section.filter.noWidget")
676
+ label: t(p)("report.section.filter.noWidget")
677
677
  }, null, 8, ["label"]))
678
678
  ];
679
679
  }),
680
680
  _: 1
681
681
  }, 512)
682
682
  ]),
683
- "dialog-footer": w(() => [
683
+ "dialog-footer": _(() => [
684
684
  e[10] || (e[10] = v("div", { class: "grow" }, null, -1)),
685
685
  u($, {
686
- label: l(p)("report.common.cancel"),
686
+ label: t(p)("report.common.cancel"),
687
687
  variant: "tertiary",
688
- onClick: ee
688
+ onClick: le
689
689
  }, null, 8, ["label"]),
690
690
  u($, {
691
- label: l(p)("report.common.confirm"),
691
+ label: t(p)("report.common.confirm"),
692
692
  onClick: Ve
693
693
  }, null, 8, ["label"])
694
694
  ]),
@@ -696,14 +696,14 @@ const nl = /* @__PURE__ */ we({
696
696
  }, 8, ["modelValue"]);
697
697
  };
698
698
  }
699
- }), yl = 8.4375, hl = 1024 ** 4, wl = {
699
+ }), yt = 8.4375, ht = 1024 ** 4, wt = {
700
700
  MY: { rate: 4, currency: "MYR", symbol: "RM" },
701
701
  TH: { rate: 33, currency: "THB", symbol: "฿" },
702
702
  SG: { rate: 1.29, currency: "SGD", symbol: "S$" },
703
703
  ID: { rate: 17900, currency: "IDR", symbol: "Rp" }
704
- }, _l = { rate: 1, currency: "USD", symbol: "$" };
705
- function pt(R, p) {
706
- const d = R / hl * yl, { rate: b, currency: i, symbol: h } = wl[p] ?? _l;
704
+ }, _t = { rate: 1, currency: "USD", symbol: "$" };
705
+ function pl(z, p) {
706
+ const d = z / ht * yt, { rate: b, currency: i, symbol: h } = wt[p] ?? _t;
707
707
  return {
708
708
  amount: d * b,
709
709
  currency: i,
@@ -711,142 +711,142 @@ function pt(R, p) {
711
711
  costUsd: d
712
712
  };
713
713
  }
714
- function vt(R, p) {
715
- return R < 0.01 ? `< ${p}0.01` : `${p}${R.toFixed(2)}`;
714
+ function vl(z, p) {
715
+ return z < 0.01 ? `< ${p}0.01` : `${p}${z.toFixed(2)}`;
716
716
  }
717
- const Fl = { class: "flex flex-col gap-16" }, Vl = {
717
+ const Ft = { class: "flex flex-col gap-16" }, Vt = {
718
718
  key: 0,
719
719
  class: "flex flex-col gap-8"
720
- }, xl = { class: "flex items-center gap-4 pb-8 border-b border-neutral-300" }, Cl = ["title"], kl = { class: "fm-typo-en-title-sm-600 pt-8" }, Tl = { class: "mx-16 flex flex-col gap-12 py-4" }, Sl = { class: "fm-typo-en-body-lg-600" }, $l = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, Dl = { class: "flex flex-col gap-12 border-t border-neutral-200 pt-12" }, Il = { class: "fm-typo-en-body-lg-600" }, Ol = { class: "grid grid-cols-2 items-end gap-12" }, Ul = { class: "flex flex-col gap-8 min-w-0" }, Nl = { class: "fm-typo-en-body-sm-600 whitespace-nowrap" }, Bl = { class: "flex gap-8" }, Ml = { class: "grid grid-cols-2 items-end gap-12" }, Rl = { class: "flex flex-col gap-8 min-w-0" }, zl = { class: "fm-typo-en-body-sm-600 whitespace-nowrap" }, Pl = { class: "flex gap-8" }, ql = {
720
+ }, xt = { class: "flex items-center gap-4 pb-8 border-b border-neutral-300" }, Ct = ["title"], kt = { class: "fm-typo-en-title-sm-600 pt-8" }, Tt = { class: "mx-16 flex flex-col gap-12 py-4" }, St = { class: "fm-typo-en-body-lg-600" }, $t = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, Dt = { class: "flex flex-col gap-12 border-t border-neutral-200 pt-12" }, Ot = { class: "fm-typo-en-body-lg-600" }, It = { class: "grid grid-cols-2 items-end gap-12" }, Ut = { class: "flex flex-col gap-8 min-w-0" }, Nt = { class: "fm-typo-en-body-sm-600 whitespace-nowrap" }, Bt = { class: "flex gap-8" }, Mt = { class: "grid grid-cols-2 items-end gap-12" }, Rt = { class: "flex flex-col gap-8 min-w-0" }, zt = { class: "fm-typo-en-body-sm-600 whitespace-nowrap" }, Pt = { class: "flex gap-8" }, qt = {
721
721
  key: 1,
722
722
  class: "rounded-md border border-dashed border-neutral-300 p-12 text-center fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
723
- }, El = ["onClick"], Ll = ["title"], Gl = {
723
+ }, Et = ["onClick"], Lt = ["title"], Gt = {
724
724
  key: 0,
725
725
  class: "text-fm-color-typo-secondary"
726
- }, Wl = { class: "text-fm-color-system-error-300" }, Al = { class: "w-full text-left" }, Hl = /* @__PURE__ */ we({
726
+ }, Wt = { class: "text-fm-color-system-error-300" }, At = { class: "w-full text-left" }, Ht = /* @__PURE__ */ we({
727
727
  __name: "TileDrillPanel",
728
728
  props: {
729
729
  report: {}
730
730
  },
731
731
  emits: ["add-widget"],
732
- setup(R, { emit: p }) {
733
- const d = R, b = p, { t: i, te: h } = Ge(), q = [
732
+ setup(z, { emit: p }) {
733
+ const d = z, b = p, { t: i, te: h } = Ge(), P = [
734
734
  { label: i("report.tile.widget.icon.small"), value: Je.Small },
735
735
  { label: i("report.tile.widget.icon.medium"), value: Je.Medium },
736
736
  { label: i("report.tile.widget.icon.large"), value: Je.Large },
737
737
  { label: i("report.tile.widget.icon.extraLarge"), value: Je.ExtraLarge }
738
- ], K = [
739
- { label: i("report.tile.widget.icon.material"), value: Ie.Material },
740
- { label: i("report.tile.widget.icon.customSvg"), value: Ie.Custom }
741
- ], T = st(), _ = ut(), { promptMessage: D } = dt(), Z = it(), z = g(() => {
738
+ ], Q = [
739
+ { label: i("report.tile.widget.icon.material"), value: Oe.Material },
740
+ { label: i("report.tile.widget.icon.customSvg"), value: Oe.Custom }
741
+ ], T = sl(), F = ul(), { promptMessage: O } = dl(), X = il(), q = g(() => {
742
742
  const e = [];
743
- let t = d.report.tiles;
743
+ let l = d.report.tiles;
744
744
  for (const s of De.value) {
745
- const y = t.find((F) => F.id === s);
745
+ const y = l.find((V) => V.id === s);
746
746
  if (!y) break;
747
- e.push(y), t = y.tiles ?? [];
747
+ e.push(y), l = y.tiles ?? [];
748
748
  }
749
749
  return e;
750
750
  });
751
- pe(z, (e) => {
752
- e.length !== De.value.length && (De.value = e.map((t) => t.id));
751
+ ve(q, (e) => {
752
+ e.length !== De.value.length && (De.value = e.map((l) => l.id));
753
753
  });
754
- const a = g(() => z.value[z.value.length - 1] ?? null), S = g(() => z.value[z.value.length - 2] ?? null), k = g(
754
+ const a = g(() => q.value[q.value.length - 1] ?? null), S = g(() => q.value[q.value.length - 2] ?? null), k = g(
755
755
  () => a.value ? a.value.tiles ?? [] : d.report.tiles
756
- ), Q = g(() => {
756
+ ), j = g(() => {
757
757
  var e;
758
758
  return ((e = a.value) == null ? void 0 : e.id) ?? null;
759
- }), ne = g(() => z.value.length === 0), ue = g(() => a.value ? Pe(a.value) : !1), W = g(
759
+ }), ae = g(() => q.value.length === 0), de = g(() => a.value ? Pe(a.value) : !1), A = g(
760
760
  () => S.value ? Pe(S.value) : !1
761
- ), A = g(() => a.value ? ce(a.value) : !1), V = g(
762
- () => z.value.reduce(
763
- (e, t) => Pe(t) ? e : ce(t) ? 1 : e + 1,
761
+ ), ie = g(() => a.value ? pe(a.value) : !1), w = g(
762
+ () => q.value.reduce(
763
+ (e, l) => Pe(l) ? e : pe(l) ? 1 : e + 1,
764
764
  1
765
765
  )
766
- ), X = g(() => !ue.value && V.value < _t), le = g(() => ne.value);
767
- function oe(e) {
768
- e.widget && !ce(e) || (De.value = [...De.value, e.id]);
766
+ ), K = g(() => !de.value && w.value < _l), re = g(() => ae.value);
767
+ function Z(e) {
768
+ e.widget && !pe(e) || (De.value = [...De.value, e.id]);
769
769
  }
770
- function ie() {
770
+ function ne() {
771
771
  De.value = De.value.slice(0, -1);
772
772
  }
773
773
  function se(e) {
774
774
  if (!e) return "";
775
- const t = `report.widget.types.${e.toLowerCase()}`;
776
- return h(t) ? i(t) : He(i, h, e, "other");
775
+ const l = `report.widget.types.${e.toLowerCase()}`;
776
+ return h(l) ? i(l) : He(i, h, e, "other");
777
777
  }
778
- function de(e, t) {
778
+ function me(e, l) {
779
779
  if (e.widget) {
780
- const s = e.widget.title ? se(e.widget.title) : i("report.editor.widget", { index: t + 1 });
781
- return ce(e) ? `${s} · ${i("report.editor.page")}` : s;
780
+ const s = e.widget.title ? se(e.widget.title) : i("report.editor.widget", { index: l + 1 });
781
+ return pe(e) ? `${s} · ${i("report.editor.page")}` : s;
782
782
  }
783
- return e.tabTitle !== void 0 ? e.tabTitle || i("report.editor.tab", { index: t + 1 }) : e.title ? e.title : Pe(e) ? i("report.editor.tabGroup") : i("report.editor.group");
783
+ return e.tabTitle !== void 0 ? e.tabTitle || i("report.editor.tab", { index: l + 1 }) : e.title ? e.title : Pe(e) ? i("report.editor.tabGroup") : i("report.editor.group");
784
784
  }
785
- function P(e, t) {
786
- return !e.widget && ue.value ? e.tabTitle || i("report.editor.tab", { index: t + 1 }) : de(e, t);
785
+ function ue(e, l) {
786
+ return !e.widget && de.value ? e.tabTitle || i("report.editor.tab", { index: l + 1 }) : me(e, l);
787
787
  }
788
- function L(e) {
789
- var t;
790
- return ((t = e.tiles) == null ? void 0 : t.length) ?? 0;
788
+ function N(e) {
789
+ var l;
790
+ return ((l = e.tiles) == null ? void 0 : l.length) ?? 0;
791
791
  }
792
- const j = g(
793
- () => z.value.map((e, t) => de(e, t)).join(" › ")
792
+ const E = g(
793
+ () => q.value.map((e, l) => me(e, l)).join(" › ")
794
794
  );
795
- function me(e, t) {
796
- wt.value = Q.value, Z.editingTileIndex = t, Z.editingTile = JSON.parse(JSON.stringify(e)), T.push({ name: "tileEditor", query: _.query });
795
+ function H(e, l) {
796
+ wl.value = j.value, X.editingTileIndex = l, X.editingTile = JSON.parse(JSON.stringify(e)), T.push({ name: "tileEditor", query: F.query });
797
797
  }
798
- function ve(e, t) {
799
- k.value.splice(t + 1, 0, zt(e));
798
+ function ce(e, l) {
799
+ k.value.splice(l + 1, 0, zl(e));
800
800
  }
801
- async function J(e, t) {
802
- var F;
803
- if (!await D({
801
+ async function Se(e, l) {
802
+ var V;
803
+ if (!await O({
804
804
  title: i("report.editor.deleteWidget"),
805
- message: i("report.editor.deleteWidgetConfirm", { title: P(e, t) })
805
+ message: i("report.editor.deleteWidgetConfirm", { title: ue(e, l) })
806
806
  })) return;
807
- const y = et(e);
808
- k.value.splice(t, 1), (F = d.report.globalFilters) == null || F.forEach(($) => {
809
- var B;
810
- $.tileIds = (B = $.tileIds) == null ? void 0 : B.filter((G) => !y.includes(G));
807
+ const y = el(e);
808
+ k.value.splice(l, 1), (V = d.report.globalFilters) == null || V.forEach(($) => {
809
+ var M;
810
+ $.tileIds = (M = $.tileIds) == null ? void 0 : M.filter((G) => !y.includes(G));
811
811
  });
812
812
  }
813
- function _e() {
814
- a.value && (a.value.tiles || (a.value.tiles = []), a.value.tiles.push(Pt(a.value.tiles.length + 1)));
813
+ function J() {
814
+ a.value && (a.value.tiles || (a.value.tiles = []), a.value.tiles.push(Pl(a.value.tiles.length + 1)));
815
815
  }
816
- function ae(e) {
817
- qt(e);
816
+ function ee(e) {
817
+ ql(e);
818
818
  }
819
- async function Se(e, t) {
820
- var F;
821
- if (!await D({
819
+ async function _e(e, l) {
820
+ var V;
821
+ if (!await O({
822
822
  title: i("report.editor.removePage"),
823
- message: i("report.editor.removePageConfirm", { title: P(e, t) })
823
+ message: i("report.editor.removePageConfirm", { title: ue(e, l) })
824
824
  })) return;
825
- const y = et(e).filter(($) => $ !== e.id);
826
- (F = d.report.globalFilters) == null || F.forEach(($) => {
827
- var B;
828
- $.tileIds = (B = $.tileIds) == null ? void 0 : B.filter((G) => !y.includes(G));
829
- }), Et(e);
825
+ const y = el(e).filter(($) => $ !== e.id);
826
+ (V = d.report.globalFilters) == null || V.forEach(($) => {
827
+ var M;
828
+ $.tileIds = (M = $.tileIds) == null ? void 0 : M.filter((G) => !y.includes(G));
829
+ }), El(e);
830
830
  }
831
- function Oe() {
832
- k.value.push(Lt());
831
+ function Ie() {
832
+ k.value.push(Ll());
833
833
  }
834
834
  function Ue() {
835
- k.value.push(Gt());
835
+ k.value.push(Gl());
836
836
  }
837
837
  function fe(e) {
838
838
  var s;
839
- const t = Number((s = e.size) == null ? void 0 : s.width);
840
- e.size || (e.size = { width: 12, height: 12 }), !Number.isFinite(t) || t < 1 ? e.size.width = 1 : t > 12 && (e.size.width = 12);
839
+ const l = Number((s = e.size) == null ? void 0 : s.width);
840
+ e.size || (e.size = { width: 12, height: 12 }), !Number.isFinite(l) || l < 1 ? e.size.width = 1 : l > 12 && (e.size.width = 12);
841
841
  }
842
842
  function ge(e) {
843
843
  var s;
844
- const t = Number((s = e.size) == null ? void 0 : s.height);
845
- e.size || (e.size = { width: 12, height: 12 }), !Number.isFinite(t) || t < 1 ? e.size.height = 1 : t > 12 && (e.size.height = 12);
844
+ const l = Number((s = e.size) == null ? void 0 : s.height);
845
+ e.size || (e.size = { width: 12, height: 12 }), !Number.isFinite(l) || l < 1 ? e.size.height = 1 : l > 12 && (e.size.height = 12);
846
846
  }
847
- function Ne(e, t) {
848
- const s = Number(e[t]);
849
- !Number.isFinite(s) || s < 1 ? e[t] = 1 : s > 24 && (e[t] = 24);
847
+ function Ne(e, l) {
848
+ const s = Number(e[l]);
849
+ !Number.isFinite(s) || s < 1 ? e[l] = 1 : s > 24 && (e[l] = 24);
850
850
  }
851
851
  const Be = g({
852
852
  get: () => {
@@ -866,164 +866,164 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
866
866
  }
867
867
  }), be = g({
868
868
  get: () => {
869
- var e, t, s;
870
- return ((e = a.value) == null ? void 0 : e.tabIconType) ?? ((s = (t = a.value) == null ? void 0 : t.tabIcon) != null && s.trim().startsWith("<svg") ? Ie.Custom : Ie.Material);
869
+ var e, l, s;
870
+ return ((e = a.value) == null ? void 0 : e.tabIconType) ?? ((s = (l = a.value) == null ? void 0 : l.tabIcon) != null && s.trim().startsWith("<svg") ? Oe.Custom : Oe.Material);
871
871
  },
872
872
  set: (e) => {
873
873
  a.value && (a.value.tabIconType = e);
874
874
  }
875
875
  }), Fe = g({
876
876
  get: () => {
877
- var e, t;
878
- return be.value === Ie.Custom ? Yt(((e = a.value) == null ? void 0 : e.tabIcon) ?? "") : ((t = a.value) == null ? void 0 : t.tabIcon) ?? "";
877
+ var e, l;
878
+ return be.value === Oe.Custom ? Yl(((e = a.value) == null ? void 0 : e.tabIcon) ?? "") : ((l = a.value) == null ? void 0 : l.tabIcon) ?? "";
879
879
  },
880
880
  set: (e) => {
881
- a.value && (a.value.tabIcon = be.value === Ie.Custom ? Xt(e) : e.trim());
881
+ a.value && (a.value.tabIcon = be.value === Oe.Custom ? Xl(e) : e.trim());
882
882
  }
883
- }), ye = E(!1), Ve = E(null), ee = E([]);
883
+ }), ye = L(!1), Ve = L(null), le = L([]);
884
884
  function $e(e) {
885
- const t = [
885
+ const l = [
886
886
  { parentId: null, label: i("report.editor.topLevel"), level: 1 }
887
- ], s = (F, $, B) => {
887
+ ], s = (V, $, M) => {
888
888
  let G = 0;
889
- F.forEach((O) => {
890
- var re;
891
- if (O.widget) {
892
- if (ce(O)) {
893
- const Y = `${B}${O.tabTitle || se(O.widget.title)} · ${i("report.editor.page")}`;
894
- t.push({ parentId: O.id, label: Y, level: 1 }), s(O.tiles ?? [], 1, `${Y} › `);
889
+ V.forEach((I) => {
890
+ var oe;
891
+ if (I.widget) {
892
+ if (pe(I)) {
893
+ const Y = `${M}${I.tabTitle || se(I.widget.title)} · ${i("report.editor.page")}`;
894
+ l.push({ parentId: I.id, label: Y, level: 1 }), s(I.tiles ?? [], 1, `${Y} › `);
895
895
  }
896
896
  return;
897
897
  }
898
- if (Pe(O)) {
899
- const Y = `${B}${i("report.editor.tabGroup")}`;
900
- (re = O.tiles) == null || re.forEach((m, o) => {
898
+ if (Pe(I)) {
899
+ const Y = `${M}${i("report.editor.tabGroup")}`;
900
+ (oe = I.tiles) == null || oe.forEach((m, o) => {
901
901
  const r = `${Y} › ${m.tabTitle || i("report.editor.tab", { index: o + 1 })}`;
902
- t.push({ parentId: m.id, label: r, level: $ + 1 }), s(m.tiles ?? [], $ + 1, `${r} › `);
902
+ l.push({ parentId: m.id, label: r, level: $ + 1 }), s(m.tiles ?? [], $ + 1, `${r} › `);
903
903
  });
904
904
  } else {
905
905
  G += 1;
906
- const Y = `${B}${O.title || `${i("report.editor.group")} ${G}`}`;
907
- t.push({ parentId: O.id, label: Y, level: $ + 1 }), s(O.tiles ?? [], $ + 1, `${Y} › `);
906
+ const Y = `${M}${I.title || `${i("report.editor.group")} ${G}`}`;
907
+ l.push({ parentId: I.id, label: Y, level: $ + 1 }), s(I.tiles ?? [], $ + 1, `${Y} › `);
908
908
  }
909
909
  });
910
910
  };
911
911
  s(d.report.tiles, 1, "");
912
- const y = new Set(et(e));
913
- return t.filter(
914
- (F) => F.parentId !== Q.value && !(F.parentId && y.has(F.parentId)) && At(e, F.level)
912
+ const y = new Set(el(e));
913
+ return l.filter(
914
+ (V) => V.parentId !== j.value && !(V.parentId && y.has(V.parentId)) && Al(e, V.level)
915
915
  );
916
916
  }
917
917
  function Re(e) {
918
- Ve.value = e, ee.value = $e(e), ye.value = !0;
918
+ Ve.value = e, le.value = $e(e), ye.value = !0;
919
919
  }
920
920
  function n(e) {
921
- const t = Ve.value;
922
- if (!t) return;
923
- const s = k.value.indexOf(t);
924
- s >= 0 && k.value.splice(s, 1), Wt(d.report.tiles, e.parentId).push(t), ye.value = !1, Ve.value = null;
921
+ const l = Ve.value;
922
+ if (!l) return;
923
+ const s = k.value.indexOf(l);
924
+ s >= 0 && k.value.splice(s, 1), Wl(d.report.tiles, e.parentId).push(l), ye.value = !1, Ve.value = null;
925
925
  }
926
- return (e, t) => {
927
- const s = C("FmButton"), y = C("FmTextField"), F = C("FmSelect"), $ = C("FmTextarea"), B = C("FmStepperField"), G = C("FmIcon"), O = C("FmMenuItem"), re = C("FmMenu"), Y = C("FmList"), m = C("FmListItem"), o = C("FmDialog");
928
- return c(), M("div", Fl, [
929
- ne.value ? I("", !0) : (c(), M("div", Vl, [
930
- v("div", xl, [
926
+ return (e, l) => {
927
+ const s = C("FmButton"), y = C("FmTextField"), V = C("FmSelect"), $ = C("FmTextarea"), M = C("FmStepperField"), G = C("FmIcon"), I = C("FmMenuItem"), oe = C("FmMenu"), Y = C("FmList"), m = C("FmListItem"), o = C("FmDialog");
928
+ return c(), R("div", Ft, [
929
+ ae.value ? D("", !0) : (c(), R("div", Vt, [
930
+ v("div", xt, [
931
931
  u(s, {
932
932
  icon: "arrow_back",
933
933
  variant: "tertiary",
934
934
  class: "-ml-8",
935
- onClick: ie
935
+ onClick: ne
936
936
  }),
937
937
  v("p", {
938
938
  class: "fm-typo-en-body-md-600 line-clamp-1 overflow-hidden break-all min-w-0 grow text-left",
939
- title: j.value
940
- }, U(j.value), 9, Cl)
939
+ title: E.value
940
+ }, U(E.value), 9, Ct)
941
941
  ]),
942
- A.value && a.value ? (c(), x(y, {
942
+ ie.value && a.value ? (c(), x(y, {
943
943
  key: 0,
944
944
  modelValue: a.value.tabTitle,
945
- "onUpdate:modelValue": t[0] || (t[0] = (r) => a.value.tabTitle = r),
946
- label: l(i)("report.editor.pageName"),
947
- placeholder: l(i)("report.editor.pageName")
948
- }, null, 8, ["modelValue", "label", "placeholder"])) : I("", !0),
949
- W.value && a.value ? (c(), x(y, {
945
+ "onUpdate:modelValue": l[0] || (l[0] = (r) => a.value.tabTitle = r),
946
+ label: t(i)("report.editor.pageName"),
947
+ placeholder: t(i)("report.editor.pageName")
948
+ }, null, 8, ["modelValue", "label", "placeholder"])) : D("", !0),
949
+ A.value && a.value ? (c(), x(y, {
950
950
  key: 1,
951
951
  modelValue: a.value.tabTitle,
952
- "onUpdate:modelValue": t[1] || (t[1] = (r) => a.value.tabTitle = r),
953
- label: l(i)("report.editor.tabName"),
954
- placeholder: l(i)("report.editor.tabName")
955
- }, null, 8, ["modelValue", "label", "placeholder"])) : I("", !0),
956
- W.value && a.value ? (c(), x(F, {
952
+ "onUpdate:modelValue": l[1] || (l[1] = (r) => a.value.tabTitle = r),
953
+ label: t(i)("report.editor.tabName"),
954
+ placeholder: t(i)("report.editor.tabName")
955
+ }, null, 8, ["modelValue", "label", "placeholder"])) : D("", !0),
956
+ A.value && a.value ? (c(), x(V, {
957
957
  key: 2,
958
958
  modelValue: be.value,
959
- "onUpdate:modelValue": t[2] || (t[2] = (r) => be.value = r),
960
- label: l(i)("report.tile.widget.icon.type"),
961
- items: K
962
- }, null, 8, ["modelValue", "label"])) : I("", !0),
963
- W.value && a.value && be.value === l(Ie).Material ? (c(), x(y, {
959
+ "onUpdate:modelValue": l[2] || (l[2] = (r) => be.value = r),
960
+ label: t(i)("report.tile.widget.icon.type"),
961
+ items: Q
962
+ }, null, 8, ["modelValue", "label"])) : D("", !0),
963
+ A.value && a.value && be.value === t(Oe).Material ? (c(), x(y, {
964
964
  key: 3,
965
965
  modelValue: Fe.value,
966
- "onUpdate:modelValue": t[3] || (t[3] = (r) => Fe.value = r),
967
- label: l(i)("report.tile.widget.icon.materialName"),
968
- placeholder: l(i)("report.tile.widget.icon.materialPlaceholder")
969
- }, null, 8, ["modelValue", "label", "placeholder"])) : W.value && a.value ? (c(), x($, {
966
+ "onUpdate:modelValue": l[3] || (l[3] = (r) => Fe.value = r),
967
+ label: t(i)("report.tile.widget.icon.materialName"),
968
+ placeholder: t(i)("report.tile.widget.icon.materialPlaceholder")
969
+ }, null, 8, ["modelValue", "label", "placeholder"])) : A.value && a.value ? (c(), x($, {
970
970
  key: 4,
971
971
  modelValue: Fe.value,
972
- "onUpdate:modelValue": t[4] || (t[4] = (r) => Fe.value = r),
973
- label: l(i)("report.tile.widget.icon.customSvg"),
974
- placeholder: l(i)("report.tile.widget.icon.customPlaceholder")
975
- }, null, 8, ["modelValue", "label", "placeholder"])) : I("", !0),
976
- W.value && a.value ? (c(), x(F, {
972
+ "onUpdate:modelValue": l[4] || (l[4] = (r) => Fe.value = r),
973
+ label: t(i)("report.tile.widget.icon.customSvg"),
974
+ placeholder: t(i)("report.tile.widget.icon.customPlaceholder")
975
+ }, null, 8, ["modelValue", "label", "placeholder"])) : D("", !0),
976
+ A.value && a.value ? (c(), x(V, {
977
977
  key: 5,
978
978
  modelValue: a.value.tabIconSize,
979
- "onUpdate:modelValue": t[5] || (t[5] = (r) => a.value.tabIconSize = r),
980
- label: l(i)("report.tile.widget.icon.size"),
981
- items: q
982
- }, null, 8, ["modelValue", "label"])) : I("", !0),
983
- !W.value && !A.value && a.value ? (c(), x(We, {
979
+ "onUpdate:modelValue": l[5] || (l[5] = (r) => a.value.tabIconSize = r),
980
+ label: t(i)("report.tile.widget.icon.size"),
981
+ items: P
982
+ }, null, 8, ["modelValue", "label"])) : D("", !0),
983
+ !A.value && !ie.value && a.value ? (c(), x(We, {
984
984
  key: 6,
985
985
  "is-open": !1
986
986
  }, {
987
- header: w(() => [
988
- v("p", kl, U(l(i)("report.editor.groupDetails")), 1),
989
- t[24] || (t[24] = v("div", { class: "grow" }, null, -1))
987
+ header: _(() => [
988
+ v("p", kt, U(t(i)("report.editor.groupDetails")), 1),
989
+ l[24] || (l[24] = v("div", { class: "grow" }, null, -1))
990
990
  ]),
991
- content: w(() => [
992
- v("div", Tl, [
991
+ content: _(() => [
992
+ v("div", Tt, [
993
993
  u(y, {
994
994
  modelValue: a.value.title,
995
- "onUpdate:modelValue": t[6] || (t[6] = (r) => a.value.title = r),
996
- label: l(i)("report.editor.groupTitle"),
997
- placeholder: l(i)("report.editor.groupTitlePlaceholder")
995
+ "onUpdate:modelValue": l[6] || (l[6] = (r) => a.value.title = r),
996
+ label: t(i)("report.editor.groupTitle"),
997
+ placeholder: t(i)("report.editor.groupTitlePlaceholder")
998
998
  }, null, 8, ["modelValue", "label", "placeholder"]),
999
999
  u($, {
1000
1000
  modelValue: a.value.description,
1001
- "onUpdate:modelValue": t[7] || (t[7] = (r) => a.value.description = r),
1002
- placeholder: l(i)("report.editor.groupDescriptionPlaceholder")
1001
+ "onUpdate:modelValue": l[7] || (l[7] = (r) => a.value.description = r),
1002
+ placeholder: t(i)("report.editor.groupDescriptionPlaceholder")
1003
1003
  }, {
1004
- label: w(() => [
1005
- v("p", Sl, U(l(i)("report.editor.groupDescription")), 1),
1006
- v("p", $l, " (" + U(l(i)("report.editor.optional")) + ") ", 1)
1004
+ label: _(() => [
1005
+ v("p", St, U(t(i)("report.editor.groupDescription")), 1),
1006
+ v("p", $t, " (" + U(t(i)("report.editor.optional")) + ") ", 1)
1007
1007
  ]),
1008
1008
  _: 1
1009
1009
  }, 8, ["modelValue", "placeholder"]),
1010
- v("div", Dl, [
1011
- v("p", Il, U(l(i)("report.editor.typography")), 1),
1012
- v("div", Ol, [
1013
- u(B, {
1010
+ v("div", Dt, [
1011
+ v("p", Ot, U(t(i)("report.editor.typography")), 1),
1012
+ v("div", It, [
1013
+ u(M, {
1014
1014
  modelValue: Be.value,
1015
- "onUpdate:modelValue": t[8] || (t[8] = (r) => Be.value = r),
1015
+ "onUpdate:modelValue": l[8] || (l[8] = (r) => Be.value = r),
1016
1016
  modelModifiers: { number: !0 },
1017
1017
  class: "w-full",
1018
- label: l(i)("report.editor.titleSize"),
1018
+ label: t(i)("report.editor.titleSize"),
1019
1019
  max: 24,
1020
1020
  min: 1,
1021
1021
  type: "number",
1022
- onBlur: t[9] || (t[9] = (r) => Ne(a.value, "titleFontSize"))
1022
+ onBlur: l[9] || (l[9] = (r) => Ne(a.value, "titleFontSize"))
1023
1023
  }, null, 8, ["modelValue", "label"]),
1024
- v("div", Ul, [
1025
- v("p", Nl, U(l(i)("report.editor.titleFormatting")), 1),
1026
- v("div", Bl, [
1024
+ v("div", Ut, [
1025
+ v("p", Nt, U(t(i)("report.editor.titleFormatting")), 1),
1026
+ v("div", Bt, [
1027
1027
  u(s, {
1028
1028
  "append-icon": "format_bold",
1029
1029
  "model-value": a.value.titleBold ?? !0,
@@ -1031,8 +1031,8 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
1031
1031
  "icon-color": a.value.titleBold ?? !0 ? "neutral-gray-400" : "neutral-gray-300",
1032
1032
  "bg-color": a.value.titleBold ?? !0 ? "neutral-gray-100" : "neutral-white",
1033
1033
  class: "rounded-sm",
1034
- title: l(i)("report.editor.bold"),
1035
- onClick: t[10] || (t[10] = (r) => a.value.titleBold = !(a.value.titleBold ?? !0))
1034
+ title: t(i)("report.editor.bold"),
1035
+ onClick: l[10] || (l[10] = (r) => a.value.titleBold = !(a.value.titleBold ?? !0))
1036
1036
  }, null, 8, ["model-value", "icon-color", "bg-color", "title"]),
1037
1037
  u(s, {
1038
1038
  "append-icon": "format_italic",
@@ -1041,8 +1041,8 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
1041
1041
  "icon-color": a.value.titleItalic ? "neutral-gray-400" : "neutral-gray-300",
1042
1042
  "bg-color": a.value.titleItalic ? "neutral-gray-100" : "neutral-white",
1043
1043
  class: "rounded-sm",
1044
- title: l(i)("report.editor.italic"),
1045
- onClick: t[11] || (t[11] = (r) => a.value.titleItalic = !a.value.titleItalic)
1044
+ title: t(i)("report.editor.italic"),
1045
+ onClick: l[11] || (l[11] = (r) => a.value.titleItalic = !a.value.titleItalic)
1046
1046
  }, null, 8, ["model-value", "icon-color", "bg-color", "title"]),
1047
1047
  u(s, {
1048
1048
  "append-icon": "format_underlined",
@@ -1051,27 +1051,27 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
1051
1051
  "icon-color": a.value.titleUnderline ? "neutral-gray-400" : "neutral-gray-300",
1052
1052
  "bg-color": a.value.titleUnderline ? "neutral-gray-100" : "neutral-white",
1053
1053
  class: "rounded-sm",
1054
- title: l(i)("report.editor.underline"),
1055
- onClick: t[12] || (t[12] = (r) => a.value.titleUnderline = !a.value.titleUnderline)
1054
+ title: t(i)("report.editor.underline"),
1055
+ onClick: l[12] || (l[12] = (r) => a.value.titleUnderline = !a.value.titleUnderline)
1056
1056
  }, null, 8, ["model-value", "icon-color", "bg-color", "title"])
1057
1057
  ])
1058
1058
  ])
1059
1059
  ]),
1060
- v("div", Ml, [
1061
- u(B, {
1060
+ v("div", Mt, [
1061
+ u(M, {
1062
1062
  modelValue: Me.value,
1063
- "onUpdate:modelValue": t[13] || (t[13] = (r) => Me.value = r),
1063
+ "onUpdate:modelValue": l[13] || (l[13] = (r) => Me.value = r),
1064
1064
  modelModifiers: { number: !0 },
1065
1065
  class: "w-full",
1066
- label: l(i)("report.editor.descriptionSize"),
1066
+ label: t(i)("report.editor.descriptionSize"),
1067
1067
  max: 24,
1068
1068
  min: 1,
1069
1069
  type: "number",
1070
- onBlur: t[14] || (t[14] = (r) => Ne(a.value, "descriptionFontSize"))
1070
+ onBlur: l[14] || (l[14] = (r) => Ne(a.value, "descriptionFontSize"))
1071
1071
  }, null, 8, ["modelValue", "label"]),
1072
- v("div", Rl, [
1073
- v("p", zl, U(l(i)("report.editor.descriptionFormatting")), 1),
1074
- v("div", Pl, [
1072
+ v("div", Rt, [
1073
+ v("p", zt, U(t(i)("report.editor.descriptionFormatting")), 1),
1074
+ v("div", Pt, [
1075
1075
  u(s, {
1076
1076
  "append-icon": "format_bold",
1077
1077
  "model-value": a.value.descriptionBold ?? !1,
@@ -1079,8 +1079,8 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
1079
1079
  "icon-color": a.value.descriptionBold ? "neutral-gray-400" : "neutral-gray-300",
1080
1080
  "bg-color": a.value.descriptionBold ? "neutral-gray-100" : "neutral-white",
1081
1081
  class: "rounded-sm",
1082
- title: l(i)("report.editor.bold"),
1083
- onClick: t[15] || (t[15] = (r) => a.value.descriptionBold = !a.value.descriptionBold)
1082
+ title: t(i)("report.editor.bold"),
1083
+ onClick: l[15] || (l[15] = (r) => a.value.descriptionBold = !a.value.descriptionBold)
1084
1084
  }, null, 8, ["model-value", "icon-color", "bg-color", "title"]),
1085
1085
  u(s, {
1086
1086
  "append-icon": "format_italic",
@@ -1089,8 +1089,8 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
1089
1089
  "icon-color": a.value.descriptionItalic ? "neutral-gray-400" : "neutral-gray-300",
1090
1090
  "bg-color": a.value.descriptionItalic ? "neutral-gray-100" : "neutral-white",
1091
1091
  class: "rounded-sm",
1092
- title: l(i)("report.editor.italic"),
1093
- onClick: t[16] || (t[16] = (r) => a.value.descriptionItalic = !a.value.descriptionItalic)
1092
+ title: t(i)("report.editor.italic"),
1093
+ onClick: l[16] || (l[16] = (r) => a.value.descriptionItalic = !a.value.descriptionItalic)
1094
1094
  }, null, 8, ["model-value", "icon-color", "bg-color", "title"]),
1095
1095
  u(s, {
1096
1096
  "append-icon": "format_underlined",
@@ -1099,8 +1099,8 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
1099
1099
  "icon-color": a.value.descriptionUnderline ? "neutral-gray-400" : "neutral-gray-300",
1100
1100
  "bg-color": a.value.descriptionUnderline ? "neutral-gray-100" : "neutral-white",
1101
1101
  class: "rounded-sm",
1102
- title: l(i)("report.editor.underline"),
1103
- onClick: t[17] || (t[17] = (r) => a.value.descriptionUnderline = !a.value.descriptionUnderline)
1102
+ title: t(i)("report.editor.underline"),
1103
+ onClick: l[17] || (l[17] = (r) => a.value.descriptionUnderline = !a.value.descriptionUnderline)
1104
1104
  }, null, 8, ["model-value", "icon-color", "bg-color", "title"])
1105
1105
  ])
1106
1106
  ])
@@ -1109,38 +1109,38 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
1109
1109
  ])
1110
1110
  ]),
1111
1111
  _: 1
1112
- })) : I("", !0),
1113
- !W.value && a.value ? (c(), x(y, {
1112
+ })) : D("", !0),
1113
+ !A.value && a.value ? (c(), x(y, {
1114
1114
  key: 7,
1115
1115
  modelValue: a.value.size.width,
1116
- "onUpdate:modelValue": t[18] || (t[18] = (r) => a.value.size.width = r),
1116
+ "onUpdate:modelValue": l[18] || (l[18] = (r) => a.value.size.width = r),
1117
1117
  modelModifiers: { number: !0 },
1118
1118
  type: "number",
1119
- label: l(i)("report.editor.width"),
1120
- onBlur: t[19] || (t[19] = (r) => fe(a.value))
1121
- }, null, 8, ["modelValue", "label"])) : I("", !0),
1122
- !W.value && a.value ? (c(), x(y, {
1119
+ label: t(i)("report.editor.width"),
1120
+ onBlur: l[19] || (l[19] = (r) => fe(a.value))
1121
+ }, null, 8, ["modelValue", "label"])) : D("", !0),
1122
+ !A.value && a.value ? (c(), x(y, {
1123
1123
  key: 8,
1124
1124
  modelValue: a.value.size.height,
1125
- "onUpdate:modelValue": t[20] || (t[20] = (r) => a.value.size.height = r),
1125
+ "onUpdate:modelValue": l[20] || (l[20] = (r) => a.value.size.height = r),
1126
1126
  modelModifiers: { number: !0 },
1127
1127
  type: "number",
1128
- label: l(i)("report.editor.height"),
1129
- onBlur: t[21] || (t[21] = (r) => ge(a.value))
1130
- }, null, 8, ["modelValue", "label"])) : I("", !0)
1128
+ label: t(i)("report.editor.height"),
1129
+ onBlur: l[21] || (l[21] = (r) => ge(a.value))
1130
+ }, null, 8, ["modelValue", "label"])) : D("", !0)
1131
1131
  ])),
1132
- k.value.length === 0 ? (c(), M("div", ql, U(l(i)("report.editor.emptyLevel")), 1)) : (c(), x(Y, { key: 2 }, {
1133
- default: w(() => [
1134
- u(l(ht), {
1132
+ k.value.length === 0 ? (c(), R("div", qt, U(t(i)("report.editor.emptyLevel")), 1)) : (c(), x(Y, { key: 2 }, {
1133
+ default: _(() => [
1134
+ u(t(hl), {
1135
1135
  list: k.value,
1136
1136
  "item-key": "id",
1137
1137
  class: "flex flex-col gap-2 cursor-grab",
1138
1138
  handle: ".handle"
1139
1139
  }, {
1140
- item: w(({ element: r, index: f }) => [
1140
+ item: _(({ element: r, index: f }) => [
1141
1141
  v("div", {
1142
- class: Le(["flex items-center gap-8 px-12 py-8 border rounded-md border-neutral-300 hover:bg-fm-color-opacity-sm", r.widget && !l(ce)(r) ? "cursor-grab" : "cursor-pointer"]),
1143
- onClick: (H) => oe(r)
1142
+ class: Le(["flex items-center gap-8 px-12 py-8 border rounded-md border-neutral-300 hover:bg-fm-color-opacity-sm", r.widget && !t(pe)(r) ? "cursor-grab" : "cursor-pointer"]),
1143
+ onClick: (W) => Z(r)
1144
1144
  }, [
1145
1145
  u(G, {
1146
1146
  name: "drag_handle",
@@ -1148,132 +1148,132 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
1148
1148
  }),
1149
1149
  v("p", {
1150
1150
  class: "flex-1 min-w-0 truncate text-left fm-typo-en-body-lg-400",
1151
- title: P(r, f)
1151
+ title: ue(r, f)
1152
1152
  }, [
1153
- Ae(U(P(r, f)) + " ", 1),
1154
- !r.widget || l(ce)(r) ? (c(), M("span", Gl, " · " + U(L(r)), 1)) : I("", !0)
1155
- ], 8, Ll),
1156
- !r.widget || l(ce)(r) ? (c(), x(G, {
1153
+ Ae(U(ue(r, f)) + " ", 1),
1154
+ !r.widget || t(pe)(r) ? (c(), R("span", Gt, " · " + U(N(r)), 1)) : D("", !0)
1155
+ ], 8, Lt),
1156
+ !r.widget || t(pe)(r) ? (c(), x(G, {
1157
1157
  key: 0,
1158
1158
  name: "chevron_right",
1159
1159
  class: "shrink-0"
1160
- })) : I("", !0),
1161
- u(re, {
1160
+ })) : D("", !0),
1161
+ u(oe, {
1162
1162
  trigger: "click",
1163
1163
  shift: !0,
1164
1164
  "stop-click-propagation": !0,
1165
1165
  class: "shrink-0"
1166
1166
  }, {
1167
- "menu-button": w(() => [
1167
+ "menu-button": _(() => [
1168
1168
  u(s, {
1169
1169
  "append-icon": "more_vert",
1170
1170
  variant: "tertiary"
1171
1171
  })
1172
1172
  ]),
1173
- default: w(() => [
1174
- r.widget ? (c(), x(O, {
1173
+ default: _(() => [
1174
+ r.widget ? (c(), x(I, {
1175
1175
  key: 0,
1176
- label: l(i)("report.common.edit"),
1177
- onClick: (H) => me(r, f)
1178
- }, null, 8, ["label", "onClick"])) : I("", !0),
1179
- r.widget && !l(ce)(r) ? (c(), x(O, {
1176
+ label: t(i)("report.common.edit"),
1177
+ onClick: (W) => H(r, f)
1178
+ }, null, 8, ["label", "onClick"])) : D("", !0),
1179
+ r.widget && !t(pe)(r) ? (c(), x(I, {
1180
1180
  key: 1,
1181
- label: l(i)("report.editor.convertToPage"),
1182
- onClick: (H) => ae(r)
1183
- }, null, 8, ["label", "onClick"])) : I("", !0),
1184
- l(ce)(r) ? (c(), x(O, {
1181
+ label: t(i)("report.editor.convertToPage"),
1182
+ onClick: (W) => ee(r)
1183
+ }, null, 8, ["label", "onClick"])) : D("", !0),
1184
+ t(pe)(r) ? (c(), x(I, {
1185
1185
  key: 2,
1186
- label: l(i)("report.editor.removePage"),
1187
- onClick: (H) => Se(r, f)
1188
- }, null, 8, ["label", "onClick"])) : I("", !0),
1189
- l(Pe)(r) ? I("", !0) : (c(), x(O, {
1186
+ label: t(i)("report.editor.removePage"),
1187
+ onClick: (W) => _e(r, f)
1188
+ }, null, 8, ["label", "onClick"])) : D("", !0),
1189
+ t(Pe)(r) ? D("", !0) : (c(), x(I, {
1190
1190
  key: 3,
1191
- label: l(i)("report.editor.moveTo"),
1192
- onClick: (H) => Re(r)
1191
+ label: t(i)("report.editor.moveTo"),
1192
+ onClick: (W) => Re(r)
1193
1193
  }, null, 8, ["label", "onClick"])),
1194
- u(O, {
1195
- label: l(i)("report.common.duplicate"),
1196
- onClick: (H) => ve(r, f)
1194
+ u(I, {
1195
+ label: t(i)("report.common.duplicate"),
1196
+ onClick: (W) => ce(r, f)
1197
1197
  }, null, 8, ["label", "onClick"]),
1198
- u(O, {
1199
- onClick: (H) => J(r, f)
1198
+ u(I, {
1199
+ onClick: (W) => Se(r, f)
1200
1200
  }, {
1201
- label: w(() => [
1202
- v("p", Wl, U(l(i)("report.common.remove")), 1)
1201
+ label: _(() => [
1202
+ v("p", Wt, U(t(i)("report.common.remove")), 1)
1203
1203
  ]),
1204
1204
  _: 2
1205
1205
  }, 1032, ["onClick"])
1206
1206
  ]),
1207
1207
  _: 2
1208
1208
  }, 1024)
1209
- ], 10, El)
1209
+ ], 10, Et)
1210
1210
  ]),
1211
1211
  _: 1
1212
1212
  }, 8, ["list"])
1213
1213
  ]),
1214
1214
  _: 1
1215
1215
  })),
1216
- ue.value ? (c(), x(s, {
1216
+ de.value ? (c(), x(s, {
1217
1217
  key: 3,
1218
- label: l(i)("report.editor.addTab"),
1218
+ label: t(i)("report.editor.addTab"),
1219
1219
  variant: "secondary",
1220
1220
  icon: "add",
1221
1221
  "icon-position": "prepend",
1222
- "border-color": l(Ce).ColorPrimary,
1223
- "text-color": l(Ce).ColorPrimary,
1224
- onClick: _e
1225
- }, null, 8, ["label", "border-color", "text-color"])) : (c(), x(re, {
1222
+ "border-color": t(Ce).ColorPrimary,
1223
+ "text-color": t(Ce).ColorPrimary,
1224
+ onClick: J
1225
+ }, null, 8, ["label", "border-color", "text-color"])) : (c(), x(oe, {
1226
1226
  key: 4,
1227
1227
  trigger: "click",
1228
1228
  shift: !0
1229
1229
  }, {
1230
- "menu-button": w(() => [
1230
+ "menu-button": _(() => [
1231
1231
  u(s, {
1232
- label: l(i)("report.common.add"),
1232
+ label: t(i)("report.common.add"),
1233
1233
  variant: "secondary",
1234
1234
  icon: "add",
1235
1235
  "icon-position": "prepend",
1236
1236
  class: "w-full",
1237
- "border-color": l(Ce).ColorPrimary,
1238
- "text-color": l(Ce).ColorPrimary
1237
+ "border-color": t(Ce).ColorPrimary,
1238
+ "text-color": t(Ce).ColorPrimary
1239
1239
  }, null, 8, ["label", "border-color", "text-color"])
1240
1240
  ]),
1241
- default: w(() => [
1242
- u(O, {
1243
- label: l(i)("report.editor.addWidget"),
1244
- onClick: t[22] || (t[22] = (r) => b("add-widget", Q.value))
1241
+ default: _(() => [
1242
+ u(I, {
1243
+ label: t(i)("report.editor.addWidget"),
1244
+ onClick: l[22] || (l[22] = (r) => b("add-widget", j.value))
1245
1245
  }, null, 8, ["label"]),
1246
- X.value ? (c(), x(O, {
1246
+ K.value ? (c(), x(I, {
1247
1247
  key: 0,
1248
- label: l(i)("report.editor.addGroup"),
1249
- onClick: Oe
1250
- }, null, 8, ["label"])) : I("", !0),
1251
- le.value ? (c(), x(O, {
1248
+ label: t(i)("report.editor.addGroup"),
1249
+ onClick: Ie
1250
+ }, null, 8, ["label"])) : D("", !0),
1251
+ re.value ? (c(), x(I, {
1252
1252
  key: 1,
1253
- label: l(i)("report.editor.addTabGroup"),
1253
+ label: t(i)("report.editor.addTabGroup"),
1254
1254
  onClick: Ue
1255
- }, null, 8, ["label"])) : I("", !0)
1255
+ }, null, 8, ["label"])) : D("", !0)
1256
1256
  ]),
1257
1257
  _: 1
1258
1258
  })),
1259
1259
  u(o, {
1260
1260
  modelValue: ye.value,
1261
- "onUpdate:modelValue": t[23] || (t[23] = (r) => ye.value = r),
1261
+ "onUpdate:modelValue": l[23] || (l[23] = (r) => ye.value = r),
1262
1262
  overlay: !0,
1263
1263
  "z-index": 10
1264
1264
  }, {
1265
- "dialog-header": w(() => [
1266
- Ae(U(l(i)("report.editor.moveTo")), 1)
1265
+ "dialog-header": _(() => [
1266
+ Ae(U(t(i)("report.editor.moveTo")), 1)
1267
1267
  ]),
1268
- default: w(() => [
1268
+ default: _(() => [
1269
1269
  u(Y, null, {
1270
- default: w(() => [
1271
- (c(!0), M(he, null, Ee(ee.value, (r) => (c(), x(m, {
1270
+ default: _(() => [
1271
+ (c(!0), R(he, null, Ee(le.value, (r) => (c(), x(m, {
1272
1272
  key: r.parentId ?? "root",
1273
1273
  onClick: (f) => n(r)
1274
1274
  }, {
1275
- default: w(() => [
1276
- v("p", Al, U(r.label), 1)
1275
+ default: _(() => [
1276
+ v("p", At, U(r.label), 1)
1277
1277
  ]),
1278
1278
  _: 2
1279
1279
  }, 1032, ["onClick"]))), 128))
@@ -1286,67 +1286,72 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
1286
1286
  ]);
1287
1287
  };
1288
1288
  }
1289
- }), jl = { class: "flex flex-col gap-24 top-0 bg-fm-color-neutral-white z-10" }, Jl = { class: "flex flex-col gap-24 top-0 bg-fm-color-neutral-white z-10" }, Kl = { class: "flex items-center gap-8" }, Ql = {
1289
+ }), jt = { class: "flex flex-col gap-24 top-0 bg-fm-color-neutral-white z-10" }, Jt = { class: "flex flex-col gap-24 top-0 bg-fm-color-neutral-white z-10" }, Qt = { class: "flex items-center gap-8" }, Kt = {
1290
1290
  key: 2,
1291
1291
  class: "flex flex-col gap-8 rounded-md border border-fm-color-border px-16 py-12"
1292
- }, Yl = { class: "fm-typo-en-body-sm-400" }, Xl = { class: "fm-typo-en-body-sm-400 font-bold" }, Zl = { class: "space-y-1 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, eo = { class: "flex flex-col gap-24 top-0 bg-fm-color-neutral-white z-10" }, to = { class: "flex items-center gap-1 max-w-[195px] w-[195px]" }, lo = { class: "line-clamp-2 overflow-hidden max-w-[195px] w-[195px]" }, ft = /* @__PURE__ */ we({
1292
+ }, Yt = { class: "fm-typo-en-body-sm-400" }, Xt = { class: "fm-typo-en-body-sm-400 font-bold" }, Zt = { class: "space-y-1 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, eo = { class: "flex flex-col gap-24 top-0 bg-fm-color-neutral-white z-10" }, lo = { class: "flex items-center gap-1 max-w-[195px] w-[195px]" }, to = { class: "line-clamp-2 overflow-hidden max-w-[195px] w-[195px]" }, fl = /* @__PURE__ */ we({
1293
1293
  __name: "ReportEditorTab",
1294
1294
  props: /* @__PURE__ */ ke({
1295
1295
  hideConfiguration: {
1296
1296
  type: Boolean,
1297
1297
  default: !1
1298
+ },
1299
+ // general report: only the query version and datasource may change
1300
+ readOnly: {
1301
+ type: Boolean,
1302
+ default: !1
1298
1303
  }
1299
1304
  }, {
1300
1305
  modelValue: { required: !0 },
1301
1306
  modelModifiers: {}
1302
1307
  }),
1303
1308
  emits: /* @__PURE__ */ ke(["hideConfiguration"], ["update:modelValue"]),
1304
- setup(R, { emit: p }) {
1305
- const d = Te(R, "modelValue"), { breakpoints: b } = Qe(), i = R, h = p, q = st(), K = ut(), T = E(), {
1306
- currentSelectWidgetType: _,
1307
- categories: D,
1308
- editingTile: Z,
1309
- editingTileIndex: z,
1309
+ setup(z, { emit: p }) {
1310
+ const d = Te(z, "modelValue"), { breakpoints: b } = Ke(), i = z, h = p, P = sl(), Q = ul(), T = L(), {
1311
+ currentSelectWidgetType: F,
1312
+ categories: O,
1313
+ editingTile: X,
1314
+ editingTileIndex: q,
1310
1315
  editingGlobalFilter: a,
1311
1316
  editingGlobalFilterIndex: S
1312
- } = qe(it()), { schemas: k } = qe(Ht()), { globalFilters: Q } = qe(mt()), { getGlobalFilterLabel: ne } = mt(), { promptMessage: ue } = dt(), W = E(!1), A = E(!1), { t: V, te: X, locale: le } = Ge(), oe = E(void 0), ie = g(() => {
1313
- const m = tt(d.value.tiles).flatMap((o) => {
1314
- var H;
1315
- const r = o.widget.config.schemaNames ?? [], f = ((H = o.widget.config.joinDatasources) == null ? void 0 : H.flatMap((je) => je.schemaNames ?? [])) ?? [];
1317
+ } = qe(il()), { schemas: k } = qe(Hl()), { globalFilters: j } = qe(ml()), { getGlobalFilterLabel: ae } = ml(), { promptMessage: de } = dl(), A = L(!1), ie = L(!1), { t: w, te: K, locale: re } = Ge(), Z = L(void 0), ne = g(() => {
1318
+ const m = ll(d.value.tiles).flatMap((o) => {
1319
+ var W;
1320
+ const r = o.widget.config.schemaNames ?? [], f = ((W = o.widget.config.joinDatasources) == null ? void 0 : W.flatMap((je) => je.schemaNames ?? [])) ?? [];
1316
1321
  return [...r, ...f];
1317
1322
  });
1318
1323
  return [...new Set(m)].reduce((o, r) => {
1319
- const f = k.value.find((H) => H.name === r);
1324
+ const f = k.value.find((W) => W.name === r);
1320
1325
  return f && o.push(f), o;
1321
1326
  }, []);
1322
- }), se = E(null);
1323
- function de(m) {
1324
- se.value = m, A.value = !0;
1327
+ }), se = L(null);
1328
+ function me(m) {
1329
+ se.value = m, ie.value = !0;
1325
1330
  }
1326
- pe(
1327
- () => _.value,
1331
+ ve(
1332
+ () => F.value,
1328
1333
  () => {
1329
- _.value !== void 0 && (oe.value = Zt(_.value), Z.value = oe.value, z.value = -1, wt.value = se.value, q.push({
1334
+ F.value !== void 0 && (Z.value = Zl(F.value), X.value = Z.value, q.value = -1, wl.value = se.value, P.push({
1330
1335
  name: "tileEditor",
1331
- query: K.query
1336
+ query: Q.query
1332
1337
  }));
1333
1338
  },
1334
1339
  { immediate: !0 }
1335
- ), pe(
1340
+ ), ve(
1336
1341
  () => d.value.tiles,
1337
1342
  (m) => {
1338
- jt(m);
1343
+ jl(m);
1339
1344
  },
1340
1345
  { immediate: !0, deep: !0 }
1341
1346
  );
1342
- const P = [
1347
+ const ue = [
1343
1348
  {
1344
1349
  label: "report.common.edit",
1345
1350
  selected: !1,
1346
1351
  variant: "tertiary",
1347
1352
  onClick: (m) => {
1348
1353
  var o;
1349
- S.value = m, a.value = JSON.parse(JSON.stringify((o = d.value.globalFilters) == null ? void 0 : o[m])), W.value = !0;
1354
+ S.value = m, a.value = JSON.parse(JSON.stringify((o = d.value.globalFilters) == null ? void 0 : o[m])), A.value = !0;
1350
1355
  }
1351
1356
  },
1352
1357
  {
@@ -1366,61 +1371,61 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
1366
1371
  selected: !1,
1367
1372
  variant: "destructive",
1368
1373
  onClick: async (m) => {
1369
- var f, H;
1374
+ var f, W;
1370
1375
  const o = (f = d.value.globalFilters) == null ? void 0 : f[m];
1371
1376
  if (!o) return;
1372
- await ue({
1373
- title: V("report.editor.deleteWidget"),
1374
- message: V("report.editor.deleteWidgetConfirm", {
1375
- title: ne(o)
1377
+ await de({
1378
+ title: w("report.editor.deleteWidget"),
1379
+ message: w("report.editor.deleteWidgetConfirm", {
1380
+ title: ae(o)
1376
1381
  })
1377
- }) && ((H = d.value.globalFilters) == null || H.splice(m, 1));
1382
+ }) && ((W = d.value.globalFilters) == null || W.splice(m, 1));
1378
1383
  }
1379
1384
  }
1380
- ], L = g(() => D.value.map((m) => ({
1381
- label: V(`report.category.${m.name}`),
1385
+ ], N = g(() => O.value.map((m) => ({
1386
+ label: w(`report.category.${m.name}`),
1382
1387
  value: m.id
1383
- }))), { sessionUser: j } = ll(), me = g(
1388
+ }))), { sessionUser: E } = tt(), H = g(
1384
1389
  () => {
1385
1390
  var m, o, r, f;
1386
- return ((o = (m = j.value) == null ? void 0 : m.role) == null ? void 0 : o.isAdmin) === !0 || ((f = (r = j.value) == null ? void 0 : r.role) == null ? void 0 : f.isStaff) === !0;
1391
+ return ((o = (m = E.value) == null ? void 0 : m.role) == null ? void 0 : o.isAdmin) === !0 || ((f = (r = E.value) == null ? void 0 : r.role) == null ? void 0 : f.isStaff) === !0;
1387
1392
  }
1388
- ), ve = g({
1393
+ ), ce = g({
1389
1394
  get: () => d.value.queryVersion === "v2",
1390
1395
  set: (m) => {
1391
- d.value.queryVersion = m ? "v2" : "v1", m ? d.value.queryDatasource = d.value.queryDatasource ?? Ke.Postgres : d.value.queryDatasource = void 0;
1396
+ d.value.queryVersion = m ? "v2" : "v1", m ? d.value.queryDatasource = d.value.queryDatasource ?? Qe.Postgres : d.value.queryDatasource = void 0;
1392
1397
  }
1393
- }), J = [
1394
- { label: V("report.common.postgresql"), value: Ke.Postgres },
1395
- { label: V("report.common.bigquery"), value: Ke.BigQuery }
1396
- ], _e = [
1397
- { label: V("report.common.noBatch"), value: "none" },
1398
- { label: V("report.common.days"), value: "days" },
1399
- { label: V("report.common.locations"), value: "locations" }
1400
- ], ae = g({
1398
+ }), Se = [
1399
+ { label: w("report.common.postgresql"), value: Qe.Postgres },
1400
+ { label: w("report.common.bigquery"), value: Qe.BigQuery }
1401
+ ], J = [
1402
+ { label: w("report.common.noBatch"), value: "none" },
1403
+ { label: w("report.common.days"), value: "days" },
1404
+ { label: w("report.common.locations"), value: "locations" }
1405
+ ], ee = g({
1401
1406
  get: () => {
1402
1407
  var m, o;
1403
1408
  return (m = d.value.batch) != null && m.days ? "days" : (o = d.value.batch) != null && o.locations ? "locations" : "none";
1404
1409
  },
1405
1410
  set: (m) => {
1406
1411
  var o, r;
1407
- m === "none" ? d.value.batch = void 0 : m === "days" ? d.value.batch = { days: ((o = d.value.batch) == null ? void 0 : o.days) || 1 } : m === "locations" && (d.value.batch = { locations: ((r = d.value.batch) == null ? void 0 : r.locations) || 10 });
1412
+ m === "none" ? d.value.batch = i.readOnly ? null : void 0 : m === "days" ? d.value.batch = { days: ((o = d.value.batch) == null ? void 0 : o.days) || 1 } : m === "locations" && (d.value.batch = { locations: ((r = d.value.batch) == null ? void 0 : r.locations) || 10 });
1408
1413
  }
1409
- }), Se = g({
1414
+ }), _e = g({
1410
1415
  get: () => {
1411
1416
  var m, o;
1412
- if (ae.value === "days") return ((m = d.value.batch) == null ? void 0 : m.days) ?? 1;
1413
- if (ae.value === "locations") return ((o = d.value.batch) == null ? void 0 : o.locations) ?? 1;
1417
+ if (ee.value === "days") return ((m = d.value.batch) == null ? void 0 : m.days) ?? 1;
1418
+ if (ee.value === "locations") return ((o = d.value.batch) == null ? void 0 : o.locations) ?? 1;
1414
1419
  },
1415
1420
  set: (m) => {
1416
- m && (ae.value === "days" ? d.value.batch = { days: m } : ae.value === "locations" && (d.value.batch = { locations: m }));
1421
+ m && (ee.value === "days" ? d.value.batch = { days: m } : ee.value === "locations" && (d.value.batch = { locations: m }));
1417
1422
  }
1418
- }), Oe = g({
1419
- get: () => He(V, X, d.value.name, "other"),
1423
+ }), Ie = g({
1424
+ get: () => He(w, K, d.value.name, "other"),
1420
1425
  set: (m) => {
1421
1426
  d.value.name = m;
1422
1427
  }
1423
- }), { country: Ue } = qe(ol()), {
1428
+ }), { country: Ue } = qe(ot()), {
1424
1429
  dateRange: fe,
1425
1430
  compareDateRange: ge,
1426
1431
  timeRange: Ne,
@@ -1428,9 +1433,9 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
1428
1433
  businessDataVersion: Me,
1429
1434
  restaurants: be,
1430
1435
  warehouses: Fe
1431
- } = qe(al()), ye = g(
1432
- () => d.value.queryVersion === "v2" && d.value.queryDatasource === Ke.BigQuery
1433
- ), Ve = g(() => ye.value && me.value), ee = E(null), $e = E(!1), Re = g(() => {
1436
+ } = qe(at()), ye = g(
1437
+ () => d.value.queryVersion === "v2" && d.value.queryDatasource === Qe.BigQuery
1438
+ ), Ve = g(() => ye.value && H.value), le = L(null), $e = L(!1), Re = g(() => {
1434
1439
  const m = fe.value.startDate ?? fe.value.endDate;
1435
1440
  return m ? {
1436
1441
  startDate: m,
@@ -1450,27 +1455,27 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
1450
1455
  return Math.max(1, Math.ceil(o / m.locations));
1451
1456
  }
1452
1457
  return 1;
1453
- }), t = g(() => {
1454
- if (ee.value == null || ee.value === 0) return null;
1455
- const m = ee.value * e.value;
1456
- return pt(m, Ue.value);
1457
- }), s = g(() => ee.value == null || ee.value === 0 ? null : pt(ee.value, Ue.value)), y = g(() => t.value ? vt(t.value.amount, t.value.symbol) : ""), F = g(() => s.value ? vt(s.value.amount, s.value.symbol) : ""), $ = g(() => e.value === 1 ? V("report.common.estimatedCostBatchSingular") : V("report.common.estimatedCostBatchPlural")), B = g(() => $e.value ? "..." : !y.value || !F.value ? "--" : V("report.common.estimatedCostFormula", {
1458
+ }), l = g(() => {
1459
+ if (le.value == null || le.value === 0) return null;
1460
+ const m = le.value * e.value;
1461
+ return pl(m, Ue.value);
1462
+ }), s = g(() => le.value == null || le.value === 0 ? null : pl(le.value, Ue.value)), y = g(() => l.value ? vl(l.value.amount, l.value.symbol) : ""), V = g(() => s.value ? vl(s.value.amount, s.value.symbol) : ""), $ = g(() => e.value === 1 ? w("report.common.estimatedCostBatchSingular") : w("report.common.estimatedCostBatchPlural")), M = g(() => $e.value ? "..." : !y.value || !V.value ? "--" : w("report.common.estimatedCostFormula", {
1458
1463
  batchCount: e.value,
1459
1464
  batchLabel: $.value,
1460
- baseCost: F.value,
1465
+ baseCost: V.value,
1461
1466
  totalCost: y.value
1462
1467
  }));
1463
1468
  let G = [];
1464
- const O = rl(async () => {
1469
+ const I = rt(async () => {
1465
1470
  if (!Ve.value) return;
1466
- const m = tt(d.value.tiles).filter(
1471
+ const m = ll(d.value.tiles).filter(
1467
1472
  (o) => {
1468
1473
  var r;
1469
1474
  return ((r = o.widget.config.schemaNames) == null ? void 0 : r.length) > 0;
1470
1475
  }
1471
1476
  );
1472
1477
  if (m.length === 0) {
1473
- ee.value = null;
1478
+ le.value = null;
1474
1479
  return;
1475
1480
  }
1476
1481
  $e.value = !0, G.forEach((o) => o.abort()), G = [];
@@ -1478,7 +1483,7 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
1478
1483
  const o = await Promise.all(
1479
1484
  m.map((r) => {
1480
1485
  const f = new AbortController();
1481
- return G.push(f), tl({
1486
+ return G.push(f), lt({
1482
1487
  widget: r.widget,
1483
1488
  signal: f.signal,
1484
1489
  tileId: r.id,
@@ -1487,14 +1492,14 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
1487
1492
  });
1488
1493
  })
1489
1494
  );
1490
- ee.value = o.reduce((r, f) => r + (f.totalBytesProcessed ?? 0), 0);
1495
+ le.value = o.reduce((r, f) => r + (f.totalBytesProcessed ?? 0), 0);
1491
1496
  } catch (o) {
1492
- o.code !== "ERR_CANCELED" && (ee.value = null);
1497
+ o.code !== "ERR_CANCELED" && (le.value = null);
1493
1498
  } finally {
1494
1499
  $e.value = !1;
1495
1500
  }
1496
1501
  }, 1e3);
1497
- pe(
1502
+ ve(
1498
1503
  [
1499
1504
  () => d.value.tiles,
1500
1505
  () => d.value.queryVersion,
@@ -1507,82 +1512,85 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
1507
1512
  () => Me.value
1508
1513
  ],
1509
1514
  () => {
1510
- O();
1515
+ I();
1511
1516
  },
1512
1517
  { deep: !0 }
1513
- ), bt(() => {
1514
- O();
1515
- }), Dt(() => {
1518
+ ), bl(() => {
1519
+ I();
1520
+ }), Dl(() => {
1516
1521
  G.forEach((m) => m.abort());
1517
1522
  });
1518
- function re(m) {
1523
+ function oe(m) {
1519
1524
  var o;
1520
1525
  return !((o = m.tileIds) != null && o.length);
1521
1526
  }
1522
1527
  function Y(m) {
1523
- return !ie.value.find((o) => o.name === m.schemaName);
1528
+ return !ne.value.find((o) => o.name === m.schemaName);
1524
1529
  }
1525
- return pe(
1530
+ return ve(
1526
1531
  () => d.value.globalFilters,
1527
1532
  (m) => {
1528
- Q.value = JSON.parse(JSON.stringify(m || []));
1533
+ j.value = JSON.parse(JSON.stringify(m || []));
1529
1534
  },
1530
1535
  { deep: !0, immediate: !0 }
1531
1536
  ), (m, o) => {
1532
- const r = C("FmTextField"), f = C("FmSelect"), H = C("FmSwitch"), je = C("FmButton"), Ye = C("FmIcon"), Xe = C("FmTooltip"), Vt = C("FmMenuItem"), xt = C("FmMenu"), Ct = C("FmListItem"), kt = C("FmList"), Tt = C("FmForm");
1533
- return c(), x(It(l(b).lg || l(b).md ? sl : ul), {
1537
+ const r = C("FmTextField"), f = C("FmSelect"), W = C("FmSwitch"), je = C("FmButton"), Ye = C("FmIcon"), Xe = C("FmTooltip"), Vl = C("FmMenuItem"), xl = C("FmMenu"), Cl = C("FmListItem"), kl = C("FmList"), Tl = C("FmForm");
1538
+ return c(), x(Ol(t(b).lg || t(b).md ? st : ut), {
1534
1539
  "model-value": i.hideConfiguration,
1535
- "onUpdate:modelValue": o[12] || (o[12] = (N) => h("hideConfiguration", N))
1540
+ "onUpdate:modelValue": o[12] || (o[12] = (B) => h("hideConfiguration", B))
1536
1541
  }, {
1537
- default: w(() => [
1538
- u(bl, {
1539
- "is-open": W.value,
1540
- "onUpdate:isOpen": o[0] || (o[0] = (N) => W.value = N),
1541
- "global-filter": l(a),
1542
- tiles: l(tt)(d.value.tiles),
1543
- schemas: ie.value,
1544
- "onUpdate:globalFilter": o[1] || (o[1] = (N) => {
1545
- N && (d.value.globalFilters || (d.value.globalFilters = []), typeof l(S) == "number" && l(S) >= 0 ? d.value.globalFilters[l(S)] = N : d.value.globalFilters.push(N));
1542
+ default: _(() => [
1543
+ u(bt, {
1544
+ "is-open": A.value,
1545
+ "onUpdate:isOpen": o[0] || (o[0] = (B) => A.value = B),
1546
+ "global-filter": t(a),
1547
+ tiles: t(ll)(d.value.tiles),
1548
+ schemas: ne.value,
1549
+ "onUpdate:globalFilter": o[1] || (o[1] = (B) => {
1550
+ B && (d.value.globalFilters || (d.value.globalFilters = []), typeof t(S) == "number" && t(S) >= 0 ? d.value.globalFilters[t(S)] = B : d.value.globalFilters.push(B));
1546
1551
  })
1547
1552
  }, null, 8, ["is-open", "global-filter", "tiles", "schemas"]),
1548
- u(nl, {
1549
- modelValue: l(_),
1550
- "onUpdate:modelValue": o[2] || (o[2] = (N) => yt(_) ? _.value = N : null),
1551
- "is-open": A.value,
1552
- "onUpdate:isOpen": o[3] || (o[3] = (N) => A.value = N)
1553
+ u(nt, {
1554
+ modelValue: t(F),
1555
+ "onUpdate:modelValue": o[2] || (o[2] = (B) => yl(F) ? F.value = B : null),
1556
+ "is-open": ie.value,
1557
+ "onUpdate:isOpen": o[3] || (o[3] = (B) => ie.value = B)
1553
1558
  }, null, 8, ["modelValue", "is-open"]),
1554
- u(Tt, {
1559
+ u(Tl, {
1555
1560
  ref_key: "form",
1556
1561
  ref: T,
1557
1562
  class: "px-6 py-16 flex flex-col gap-24 overflow-y-auto overflow-x-hidden"
1558
1563
  }, {
1559
- default: w(() => [
1564
+ default: _(() => [
1560
1565
  u(We, { class: "border-solid" }, {
1561
- header: w(() => [
1562
- v("p", null, U(l(V)("report.editor.reportInfo")), 1),
1566
+ header: _(() => [
1567
+ v("p", null, U(t(w)("report.editor.reportInfo")), 1),
1563
1568
  o[13] || (o[13] = v("div", { class: "grow" }, null, -1))
1564
1569
  ]),
1565
- content: w(() => [
1566
- v("div", jl, [
1570
+ content: _(() => [
1571
+ v("div", jt, [
1567
1572
  u(r, {
1568
- modelValue: Oe.value,
1569
- "onUpdate:modelValue": o[4] || (o[4] = (N) => Oe.value = N),
1570
- label: l(V)("report.common.name"),
1571
- placeholder: l(V)("report.common.name")
1572
- }, null, 8, ["modelValue", "label", "placeholder"]),
1573
+ modelValue: Ie.value,
1574
+ "onUpdate:modelValue": o[4] || (o[4] = (B) => Ie.value = B),
1575
+ label: t(w)("report.common.name"),
1576
+ placeholder: t(w)("report.common.name"),
1577
+ disabled: i.readOnly
1578
+ }, null, 8, ["modelValue", "label", "placeholder", "disabled"]),
1573
1579
  (c(), x(f, {
1574
- key: `category-${l(le)}`,
1580
+ key: `category-${t(re)}`,
1575
1581
  modelValue: d.value.category,
1576
- "onUpdate:modelValue": o[5] || (o[5] = (N) => d.value.category = N),
1577
- label: l(V)("report.common.category"),
1578
- items: L.value
1579
- }, null, 8, ["modelValue", "label", "items"])),
1582
+ "onUpdate:modelValue": o[5] || (o[5] = (B) => d.value.category = B),
1583
+ label: t(w)("report.common.category"),
1584
+ items: N.value,
1585
+ disabled: i.readOnly
1586
+ }, null, 8, ["modelValue", "label", "items", "disabled"])),
1580
1587
  u(r, {
1581
1588
  modelValue: d.value.description,
1582
- "onUpdate:modelValue": o[6] || (o[6] = (N) => d.value.description = N),
1583
- label: l(V)("report.common.description"),
1584
- placeholder: l(V)("report.common.description")
1585
- }, null, 8, ["modelValue", "label", "placeholder"])
1589
+ "onUpdate:modelValue": o[6] || (o[6] = (B) => d.value.description = B),
1590
+ label: t(w)("report.common.description"),
1591
+ placeholder: t(w)("report.common.description"),
1592
+ disabled: i.readOnly
1593
+ }, null, 8, ["modelValue", "label", "placeholder", "disabled"])
1586
1594
  ])
1587
1595
  ]),
1588
1596
  _: 1
@@ -1591,149 +1599,150 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
1591
1599
  class: "border-solid",
1592
1600
  "is-open": !1
1593
1601
  }, {
1594
- header: w(() => [
1595
- v("p", null, U(l(V)("report.editor.advancedUsage")), 1),
1602
+ header: _(() => [
1603
+ v("p", null, U(t(w)("report.editor.advancedUsage")), 1),
1596
1604
  o[14] || (o[14] = v("div", { class: "grow" }, null, -1))
1597
1605
  ]),
1598
- content: w(() => [
1599
- v("div", Jl, [
1600
- v("div", Kl, [
1606
+ content: _(() => [
1607
+ v("div", Jt, [
1608
+ v("div", Qt, [
1601
1609
  o[15] || (o[15] = v("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, "V2", -1)),
1602
- u(H, {
1603
- modelValue: ve.value,
1604
- "onUpdate:modelValue": o[7] || (o[7] = (N) => ve.value = N)
1610
+ u(W, {
1611
+ modelValue: ce.value,
1612
+ "onUpdate:modelValue": o[7] || (o[7] = (B) => ce.value = B)
1605
1613
  }, null, 8, ["modelValue"])
1606
1614
  ]),
1607
- ve.value && me.value ? (c(), x(f, {
1615
+ ce.value && H.value ? (c(), x(f, {
1608
1616
  key: 0,
1609
1617
  modelValue: d.value.queryDatasource,
1610
- "onUpdate:modelValue": o[8] || (o[8] = (N) => d.value.queryDatasource = N),
1611
- label: l(V)("report.common.queryDatasource"),
1612
- items: J
1613
- }, null, 8, ["modelValue", "label"])) : I("", !0),
1618
+ "onUpdate:modelValue": o[8] || (o[8] = (B) => d.value.queryDatasource = B),
1619
+ label: t(w)("report.common.queryDatasource"),
1620
+ items: Se
1621
+ }, null, 8, ["modelValue", "label"])) : D("", !0),
1614
1622
  u(f, {
1615
- modelValue: ae.value,
1616
- "onUpdate:modelValue": o[9] || (o[9] = (N) => ae.value = N),
1617
- label: l(V)("report.common.batch"),
1618
- items: _e
1623
+ modelValue: ee.value,
1624
+ "onUpdate:modelValue": o[9] || (o[9] = (B) => ee.value = B),
1625
+ label: t(w)("report.common.batch"),
1626
+ items: J
1619
1627
  }, null, 8, ["modelValue", "label"]),
1620
- ae.value !== "none" ? (c(), x(r, {
1628
+ ee.value !== "none" ? (c(), x(r, {
1621
1629
  key: 1,
1622
- modelValue: Se.value,
1623
- "onUpdate:modelValue": o[10] || (o[10] = (N) => Se.value = N),
1630
+ modelValue: _e.value,
1631
+ "onUpdate:modelValue": o[10] || (o[10] = (B) => _e.value = B),
1624
1632
  modelModifiers: { number: !0 },
1625
- label: ae.value === "days" ? l(V)("report.common.days") : l(V)("report.common.locations"),
1633
+ label: ee.value === "days" ? t(w)("report.common.days") : t(w)("report.common.locations"),
1626
1634
  type: "number"
1627
- }, null, 8, ["modelValue", "label"])) : I("", !0),
1628
- Ve.value ? (c(), M("div", Ql, [
1629
- v("span", Yl, U(l(V)("report.common.estimatedBqCost")), 1),
1630
- v("p", Xl, U(B.value), 1),
1631
- v("div", Zl, [
1632
- v("div", null, "* " + U(l(V)("report.common.estimatedCostGuidelineBigQuery")), 1),
1633
- v("div", null, "* " + U(l(V)("report.common.estimatedCostGuidelineDateRange")), 1),
1634
- v("div", null, "* " + U(l(V)("report.common.estimatedCostGuidelineLocationBatch")), 1)
1635
+ }, null, 8, ["modelValue", "label"])) : D("", !0),
1636
+ Ve.value ? (c(), R("div", Kt, [
1637
+ v("span", Yt, U(t(w)("report.common.estimatedBqCost")), 1),
1638
+ v("p", Xt, U(M.value), 1),
1639
+ v("div", Zt, [
1640
+ v("div", null, "* " + U(t(w)("report.common.estimatedCostGuidelineBigQuery")), 1),
1641
+ v("div", null, "* " + U(t(w)("report.common.estimatedCostGuidelineDateRange")), 1),
1642
+ v("div", null, "* " + U(t(w)("report.common.estimatedCostGuidelineLocationBatch")), 1)
1635
1643
  ])
1636
- ])) : I("", !0)
1644
+ ])) : D("", !0)
1637
1645
  ])
1638
1646
  ]),
1639
1647
  _: 1
1640
1648
  }),
1641
- u(We, {
1649
+ i.readOnly ? D("", !0) : (c(), x(We, {
1650
+ key: 0,
1642
1651
  class: "border-solid",
1643
1652
  "is-open": !1
1644
1653
  }, {
1645
- header: w(() => [
1646
- v("p", null, U(l(V)("report.section.filter.globalFilter")), 1),
1654
+ header: _(() => [
1655
+ v("p", null, U(t(w)("report.section.filter.globalFilter")), 1),
1647
1656
  o[16] || (o[16] = v("div", { class: "grow" }, null, -1))
1648
1657
  ]),
1649
- content: w(() => [
1658
+ content: _(() => [
1650
1659
  v("div", eo, [
1651
1660
  u(je, {
1652
- label: l(V)("report.section.filter.addGlobalFilter"),
1661
+ label: t(w)("report.section.filter.addGlobalFilter"),
1653
1662
  variant: "secondary",
1654
1663
  icon: "add",
1655
1664
  "icon-position": "prepend",
1656
- "border-color": l(Ce).ColorPrimary,
1657
- "text-color": l(Ce).ColorPrimary,
1665
+ "border-color": t(Ce).ColorPrimary,
1666
+ "text-color": t(Ce).ColorPrimary,
1658
1667
  onClick: o[11] || (o[11] = () => {
1659
- S.value = null, a.value = null, W.value = !0;
1668
+ S.value = null, a.value = null, A.value = !0;
1660
1669
  })
1661
1670
  }, null, 8, ["label", "border-color", "text-color"]),
1662
- u(kt, null, {
1663
- default: w(() => [
1664
- u(l(ht), {
1671
+ u(kl, null, {
1672
+ default: _(() => [
1673
+ u(t(hl), {
1665
1674
  list: d.value.globalFilters,
1666
1675
  "item-key": "`${element.schemaName}-${element.name}`",
1667
1676
  class: "flex flex-col gap-2 cursor-grab",
1668
1677
  handle: ".handle"
1669
1678
  }, {
1670
- item: w(({ element: N, index: St }) => [
1671
- u(Ct, { class: "!cursor-grab border rounded-md border-neutral-300" }, {
1672
- default: w(() => [
1679
+ item: _(({ element: B, index: Sl }) => [
1680
+ u(Cl, { class: "!cursor-grab border rounded-md border-neutral-300" }, {
1681
+ default: _(() => [
1673
1682
  u(Ye, {
1674
1683
  name: "drag_handle",
1675
1684
  class: "handle"
1676
1685
  }),
1677
- v("div", to, [
1686
+ v("div", lo, [
1678
1687
  u(Xe, {
1679
1688
  "z-index": 99,
1680
- content: l(ne)(N),
1689
+ content: t(ae)(B),
1681
1690
  class: "handle"
1682
1691
  }, {
1683
- default: w(() => [
1684
- v("p", lo, U(l(ne)(N)), 1)
1692
+ default: _(() => [
1693
+ v("p", to, U(t(ae)(B)), 1)
1685
1694
  ]),
1686
1695
  _: 2
1687
1696
  }, 1032, ["content"]),
1688
- Y(N) ? (c(), x(Xe, {
1697
+ Y(B) ? (c(), x(Xe, {
1689
1698
  key: 0,
1690
- content: l(V)("report.section.filter.missingSchema"),
1699
+ content: t(w)("report.section.filter.missingSchema"),
1691
1700
  "z-index": 99
1692
1701
  }, {
1693
- default: w(() => [
1702
+ default: _(() => [
1694
1703
  u(Ye, {
1695
1704
  name: "warning",
1696
1705
  class: "text-fm-color-system-error-300"
1697
1706
  })
1698
1707
  ]),
1699
1708
  _: 1
1700
- }, 8, ["content"])) : re(N) ? (c(), x(Xe, {
1709
+ }, 8, ["content"])) : oe(B) ? (c(), x(Xe, {
1701
1710
  key: 1,
1702
- content: l(V)("report.section.filter.missingTileIds"),
1711
+ content: t(w)("report.section.filter.missingTileIds"),
1703
1712
  "z-index": 99
1704
1713
  }, {
1705
- default: w(() => [
1714
+ default: _(() => [
1706
1715
  u(Ye, {
1707
1716
  name: "warning",
1708
1717
  class: "text-fm-color-system-warning-300"
1709
1718
  })
1710
1719
  ]),
1711
1720
  _: 1
1712
- }, 8, ["content"])) : I("", !0)
1721
+ }, 8, ["content"])) : D("", !0)
1713
1722
  ]),
1714
1723
  o[17] || (o[17] = v("div", { class: "grow" }, null, -1)),
1715
- u(xt, {
1724
+ u(xl, {
1716
1725
  trigger: "click",
1717
1726
  shift: !0,
1718
1727
  "stop-click-propagation": !0
1719
1728
  }, {
1720
- "menu-button": w(() => [
1729
+ "menu-button": _(() => [
1721
1730
  u(je, {
1722
1731
  "append-icon": "more_vert",
1723
1732
  variant: "tertiary"
1724
1733
  })
1725
1734
  ]),
1726
- default: w(() => [
1727
- (c(), M(he, null, Ee(P, (Ze, $t) => u(Vt, {
1728
- key: $t,
1729
- onClick: (ho) => Ze.onClick(St)
1735
+ default: _(() => [
1736
+ (c(), R(he, null, Ee(ue, (Ze, $l) => u(Vl, {
1737
+ key: $l,
1738
+ onClick: (ho) => Ze.onClick(Sl)
1730
1739
  }, {
1731
- label: w(() => [
1740
+ label: _(() => [
1732
1741
  v("p", {
1733
1742
  class: Le(
1734
1743
  Ze.variant === "destructive" ? " text-fm-color-system-error-300" : ""
1735
1744
  )
1736
- }, U(l(V)(Ze.label)), 3)
1745
+ }, U(t(w)(Ze.label)), 3)
1737
1746
  ]),
1738
1747
  _: 2
1739
1748
  }, 1032, ["onClick"])), 64))
@@ -1752,20 +1761,23 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
1752
1761
  ])
1753
1762
  ]),
1754
1763
  _: 1
1755
- }),
1756
- u(We, { class: "border-solid" }, {
1757
- header: w(() => [
1758
- v("p", null, U(l(V)("report.editor.widgets")), 1),
1764
+ })),
1765
+ i.readOnly ? D("", !0) : (c(), x(We, {
1766
+ key: 1,
1767
+ class: "border-solid"
1768
+ }, {
1769
+ header: _(() => [
1770
+ v("p", null, U(t(w)("report.editor.widgets")), 1),
1759
1771
  o[18] || (o[18] = v("div", { class: "grow" }, null, -1))
1760
1772
  ]),
1761
- content: w(() => [
1762
- u(Hl, {
1773
+ content: _(() => [
1774
+ u(Ht, {
1763
1775
  report: d.value,
1764
- onAddWidget: de
1776
+ onAddWidget: me
1765
1777
  }, null, 8, ["report"])
1766
1778
  ]),
1767
1779
  _: 1
1768
- })
1780
+ }))
1769
1781
  ]),
1770
1782
  _: 1
1771
1783
  }, 512)
@@ -1791,6 +1803,7 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
1791
1803
  __name: "ReportEditorViewport",
1792
1804
  props: /* @__PURE__ */ ke({
1793
1805
  hideConfiguration: { type: Boolean, required: !1, default: !1 },
1806
+ readOnly: { type: Boolean, required: !1, default: !1 },
1794
1807
  previewWidth: { type: Number, required: !0 },
1795
1808
  previewHeight: { type: Number, required: !0 },
1796
1809
  previewScale: { type: Number, required: !0 }
@@ -1800,40 +1813,41 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
1800
1813
  modelModifiers: {}
1801
1814
  }),
1802
1815
  emits: /* @__PURE__ */ ke(["hideConfiguration"], ["update:modelValue"]),
1803
- setup(R, { emit: p }) {
1804
- const { breakpoints: d } = Qe(), b = Te(R, "modelValue"), i = g(() => {
1805
- var _;
1806
- return Jt((_ = b.value) == null ? void 0 : _.tiles);
1807
- }), h = R, q = g(() => h.previewWidth > 0 && h.previewHeight > 0), K = g(() => d.value.sm || d.value.xs), T = p;
1808
- return (_, D) => {
1809
- const Z = C("FmCircularProgress"), z = C("FmButton"), a = C("FmMenuDivider"), S = C("FmCard");
1810
- return c(), M("div", oo, [
1811
- b.value ? (c(), M(he, { key: 1 }, [
1812
- q.value ? I("", !0) : (c(), x(Mt, {
1816
+ setup(z, { emit: p }) {
1817
+ const { breakpoints: d } = Ke(), b = Te(z, "modelValue"), i = g(() => {
1818
+ var F;
1819
+ return Jl((F = b.value) == null ? void 0 : F.tiles);
1820
+ }), h = z, P = g(() => h.previewWidth > 0 && h.previewHeight > 0), Q = g(() => d.value.sm || d.value.xs), T = p;
1821
+ return (F, O) => {
1822
+ const X = C("FmCircularProgress"), q = C("FmButton"), a = C("FmMenuDivider"), S = C("FmCard");
1823
+ return c(), R("div", oo, [
1824
+ b.value ? (c(), R(he, { key: 1 }, [
1825
+ P.value ? D("", !0) : (c(), x(Ml, {
1813
1826
  key: 0,
1814
1827
  "model-value": !h.hideConfiguration
1815
1828
  }, {
1816
- right: w(() => [
1829
+ right: _(() => [
1817
1830
  v("div", ao, [
1818
- b.value ? (c(), x(ft, {
1831
+ b.value ? (c(), x(fl, {
1819
1832
  key: 0,
1820
1833
  modelValue: b.value,
1821
- "onUpdate:modelValue": D[0] || (D[0] = (k) => b.value = k),
1834
+ "onUpdate:modelValue": O[0] || (O[0] = (k) => b.value = k),
1822
1835
  "hide-configuration": h.hideConfiguration,
1823
- onHideConfiguration: D[1] || (D[1] = (k) => T("hideConfiguration", k))
1824
- }, null, 8, ["modelValue", "hide-configuration"])) : I("", !0)
1836
+ "read-only": h.readOnly,
1837
+ onHideConfiguration: O[1] || (O[1] = (k) => T("hideConfiguration", k))
1838
+ }, null, 8, ["modelValue", "hide-configuration", "read-only"])) : D("", !0)
1825
1839
  ])
1826
1840
  ]),
1827
- left: w(() => [
1841
+ left: _(() => [
1828
1842
  v("div", ro, [
1829
- u(z, {
1843
+ u(q, {
1830
1844
  variant: "secondary",
1831
1845
  icon: "keyboard_double_arrow_right",
1832
- "border-color": l(Ce).ColorPrimary,
1833
- "text-color": l(Ce).ColorPrimary,
1846
+ "border-color": t(Ce).ColorPrimary,
1847
+ "text-color": t(Ce).ColorPrimary,
1834
1848
  class: "m-24 my-16",
1835
1849
  size: "md",
1836
- onClick: D[2] || (D[2] = (k) => T("hideConfiguration", !h.hideConfiguration))
1850
+ onClick: O[2] || (O[2] = (k) => T("hideConfiguration", !h.hideConfiguration))
1837
1851
  }, null, 8, ["border-color", "text-color"])
1838
1852
  ])
1839
1853
  ]),
@@ -1843,62 +1857,63 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
1843
1857
  vertical: "",
1844
1858
  style: { margin: "0px" }
1845
1859
  }),
1846
- !K.value && !q.value ? (c(), M("div", no, [
1847
- b.value.tiles.length > 0 ? (c(), M("div", io, [
1860
+ !Q.value && !P.value ? (c(), R("div", no, [
1861
+ b.value.tiles.length > 0 ? (c(), R("div", io, [
1848
1862
  v("div", so, [
1849
- u(ct)
1863
+ u(cl)
1850
1864
  ]),
1851
- u(lt, {
1865
+ u(tl, {
1852
1866
  tiles: b.value.tiles,
1853
1867
  "report-id": b.value.id || "editing",
1854
1868
  "leaf-index-by-id": i.value,
1855
1869
  "hide-export": !0,
1856
1870
  "grid-class": "gap-[24px]"
1857
1871
  }, null, 8, ["tiles", "report-id", "leaf-index-by-id"])
1858
- ])) : (c(), x(at, { key: 1 }))
1859
- ])) : K.value && !q.value ? (c(), M("div", uo, [
1872
+ ])) : (c(), x(al, { key: 1 }))
1873
+ ])) : Q.value && !P.value ? (c(), R("div", uo, [
1860
1874
  u(S, { class: "px-5 pb-28" }, {
1861
- default: w(() => [
1862
- b.value.tiles.length > 0 ? (c(), M("div", mo, [
1875
+ default: _(() => [
1876
+ b.value.tiles.length > 0 ? (c(), R("div", mo, [
1863
1877
  v("div", co, [
1864
- u(ct)
1878
+ u(cl)
1865
1879
  ]),
1866
- u(lt, {
1880
+ u(tl, {
1867
1881
  tiles: b.value.tiles,
1868
1882
  "report-id": b.value.id || "editing",
1869
1883
  "leaf-index-by-id": i.value,
1870
1884
  "hide-export": !0,
1871
1885
  "grid-class": "gap-[16px]"
1872
1886
  }, null, 8, ["tiles", "report-id", "leaf-index-by-id"])
1873
- ])) : (c(), x(at, { key: 1 }))
1887
+ ])) : (c(), x(al, { key: 1 }))
1874
1888
  ]),
1875
1889
  _: 1
1876
1890
  }),
1877
- b.value ? (c(), x(ft, {
1891
+ b.value ? (c(), x(fl, {
1878
1892
  key: 0,
1879
1893
  modelValue: b.value,
1880
- "onUpdate:modelValue": D[3] || (D[3] = (k) => b.value = k),
1894
+ "onUpdate:modelValue": O[3] || (O[3] = (k) => b.value = k),
1881
1895
  "hide-configuration": h.hideConfiguration,
1882
- onHideConfiguration: D[4] || (D[4] = (k) => {
1896
+ "read-only": h.readOnly,
1897
+ onHideConfiguration: O[4] || (O[4] = (k) => {
1883
1898
  T("hideConfiguration", k);
1884
1899
  })
1885
- }, null, 8, ["modelValue", "hide-configuration"])) : I("", !0)
1886
- ])) : (c(), M("div", po, [
1900
+ }, null, 8, ["modelValue", "hide-configuration", "read-only"])) : D("", !0)
1901
+ ])) : (c(), R("div", po, [
1887
1902
  v("div", {
1888
- style: rt({
1903
+ style: rl({
1889
1904
  transformOrigin: "top center",
1890
1905
  transform: `scale(${h.previewScale})`
1891
1906
  })
1892
1907
  }, [
1893
1908
  v("div", {
1894
1909
  class: "overflow-y-auto bg-white rounded-lg",
1895
- style: rt({
1910
+ style: rl({
1896
1911
  width: h.previewWidth + "px",
1897
1912
  height: h.previewHeight + "px"
1898
1913
  })
1899
1914
  }, [
1900
- b.value.tiles.length > 0 ? (c(), M("div", vo, [
1901
- u(lt, {
1915
+ b.value.tiles.length > 0 ? (c(), R("div", vo, [
1916
+ u(tl, {
1902
1917
  tiles: b.value.tiles,
1903
1918
  "report-id": b.value.id || "editing",
1904
1919
  "leaf-index-by-id": i.value,
@@ -1906,46 +1921,49 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
1906
1921
  "custom-screen-width": h.previewWidth,
1907
1922
  "grid-class": "gap-[24px] p-24"
1908
1923
  }, null, 8, ["tiles", "report-id", "leaf-index-by-id", "custom-screen-width"])
1909
- ])) : (c(), x(at, { key: 1 }))
1924
+ ])) : (c(), x(al, { key: 1 }))
1910
1925
  ], 4)
1911
1926
  ], 4)
1912
1927
  ]))
1913
- ], 64)) : (c(), x(Z, { key: 0 }))
1928
+ ], 64)) : (c(), x(X, { key: 0 }))
1914
1929
  ]);
1915
1930
  };
1916
1931
  }
1917
1932
  }), go = { class: "flex items-center gap-4" }, bo = { class: "flex justify-center items-center gap-2 w-full" }, yo = { class: "flex gap-4" }, Ro = /* @__PURE__ */ we({
1918
1933
  __name: "ReportEditor",
1919
- setup(R) {
1920
- const p = st(), d = ut(), b = it(), { promptLoader: i } = Qt(), { t: h, te: q } = Ge(), { currentReport: K, editingReport: T } = qe(b), { breakpoints: _ } = Qe(), D = g(() => {
1921
- var P;
1922
- return !((P = T.value) != null && P.editable);
1923
- }), Z = g(() => {
1924
- var P;
1925
- return ((P = T.value) == null ? void 0 : P.name) ?? h("report.editor.newReport");
1926
- }), z = g(() => He(h, q, Z.value, "other")), a = Ft(), { promptMessage: S } = dt(), k = E(!1), Q = g(() => [
1934
+ setup(z) {
1935
+ const p = sl(), d = ul(), b = il(), { promptLoader: i } = Kl(), { t: h, te: P } = Ge(), { currentReport: Q, editingReport: T } = qe(b), { breakpoints: F } = Ke(), O = g(() => {
1936
+ var N;
1937
+ return !((N = T.value) != null && N.editable);
1938
+ }), X = g(() => {
1939
+ var N, E;
1940
+ return !((N = T.value) != null && N.editable) && !((E = T.value) != null && E.isDefault);
1941
+ }), q = g(() => {
1942
+ var N;
1943
+ return ((N = T.value) == null ? void 0 : N.name) ?? h("report.editor.newReport");
1944
+ }), a = g(() => He(h, P, q.value, "other")), S = Fl(), { promptMessage: k } = dl(), j = L(!1), ae = g(() => [
1927
1945
  { label: h("report.common.cancel"), value: "cancel", isPrimary: !1 },
1928
1946
  { label: h("report.common.save"), value: "save", isPrimary: !0, prependIcon: "download" }
1929
1947
  ]);
1930
- async function ne() {
1948
+ async function de() {
1931
1949
  if (!T.value || T.value.tiles.length === 0) {
1932
- a.open({ message: h("report.messages.noWidget"), type: "error" });
1950
+ S.open({ message: h("report.messages.noWidget"), type: "error" });
1933
1951
  return;
1934
1952
  }
1935
- if (Kt(T.value.tiles) > _t) {
1936
- a.open({ message: h("report.messages.tooDeepNesting"), type: "error" });
1953
+ if (Ql(T.value.tiles) > _l) {
1954
+ S.open({ message: h("report.messages.tooDeepNesting"), type: "error" });
1937
1955
  return;
1938
1956
  }
1939
- const P = D.value ? h("report.common.clone") : h("report.common.save");
1940
- if (await S({
1957
+ const N = X.value ? h("report.common.clone") : h("report.common.save");
1958
+ if (await k({
1941
1959
  title: `${h("report.messages.saveReport")}`,
1942
- message: h("report.messages.confirmAction", { action: P, name: z.value })
1960
+ message: h("report.messages.confirmAction", { action: N, name: a.value })
1943
1961
  }))
1944
1962
  try {
1945
1963
  await i(async () => {
1946
- if (D.value) {
1947
- const j = JSON.parse(JSON.stringify(T.value));
1948
- j.editable = !0, j.id = "", j.name = `${j.name} ${h("report.common.duplicate")}`, j.isDefault = !1, await b.createOrUpdateReport(j);
1964
+ if (X.value) {
1965
+ const H = JSON.parse(JSON.stringify(T.value));
1966
+ H.editable = !0, H.id = "", H.name = `${H.name} ${h("report.common.duplicate")}`, H.isDefault = !1, await b.createOrUpdateReport(H);
1949
1967
  } else
1950
1968
  T.value && await b.createOrUpdateReport(T.value);
1951
1969
  p.push({
@@ -1953,25 +1971,25 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
1953
1971
  query: d.query
1954
1972
  });
1955
1973
  });
1956
- } catch (j) {
1957
- console.log(j), a.open({
1958
- message: h("report.messages.failedToAction", { action: P }),
1974
+ } catch (H) {
1975
+ console.log(H), S.open({
1976
+ message: h("report.messages.failedToAction", { action: N }),
1959
1977
  type: "error"
1960
1978
  });
1961
1979
  }
1962
1980
  }
1963
- async function ue() {
1964
- var L;
1981
+ async function A() {
1982
+ var E;
1965
1983
  if (!T.value) return;
1966
- await S({
1984
+ await k({
1967
1985
  title: h("report.common.report", 1),
1968
- message: h("report.editor.notSaved", { name: (L = T.value) == null ? void 0 : L.name })
1969
- }) && (T.value = JSON.parse(JSON.stringify(K.value)), p.back());
1986
+ message: h("report.editor.notSaved", { name: (E = T.value) == null ? void 0 : E.name })
1987
+ }) && (T.value = JSON.parse(JSON.stringify(Q.value)), p.back());
1970
1988
  }
1971
- bt(() => {
1989
+ bl(() => {
1972
1990
  T.value || p.push({ name: "reports" });
1973
1991
  });
1974
- const W = [
1992
+ const ie = [
1975
1993
  {
1976
1994
  labelKey: "report.common.default",
1977
1995
  width: void 0,
@@ -1992,78 +2010,79 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
1992
2010
  width: 390,
1993
2011
  height: 859
1994
2012
  }
1995
- ], A = E(W[0]), V = E(!1), X = g(() => V.value ? Math.max(A.value.width || 0, A.value.height || 0) : Math.min(A.value.width || 0, A.value.height || 0)), le = g(() => V.value ? Math.min(A.value.width || 0, A.value.height || 0) : Math.max(A.value.width || 0, A.value.height || 0)), oe = g(() => window.innerHeight - 72 - 56), ie = g(() => {
1996
- if (!X.value) return 1;
1997
- let P = (oe.value - 48) / X.value, L = le.value * P;
1998
- return L > window.innerWidth && (P = window.innerWidth / le.value, L = le.value * P), P > 1 ? 1 : P;
2013
+ ], w = L(ie[0]), K = L(!1), re = g(() => K.value ? Math.max(w.value.width || 0, w.value.height || 0) : Math.min(w.value.width || 0, w.value.height || 0)), Z = g(() => K.value ? Math.min(w.value.width || 0, w.value.height || 0) : Math.max(w.value.width || 0, w.value.height || 0)), ne = g(() => window.innerHeight - 72 - 56), se = g(() => {
2014
+ if (!re.value) return 1;
2015
+ let N = (ne.value - 48) / re.value, E = Z.value * N;
2016
+ return E > window.innerWidth && (N = window.innerWidth / Z.value, E = Z.value * N), N > 1 ? 1 : N;
1999
2017
  });
2000
- function se(P) {
2001
- A.value = P;
2018
+ function me(N) {
2019
+ w.value = N;
2002
2020
  }
2003
- function de() {
2004
- V.value = !V.value;
2021
+ function ue() {
2022
+ K.value = !K.value;
2005
2023
  }
2006
- return (P, L) => {
2007
- const j = C("FmTooltip"), me = C("FmButton"), ve = C("FmPageHead");
2008
- return c(), x(Rt, null, {
2009
- default: w(() => [
2010
- u(ve, {
2024
+ return (N, E) => {
2025
+ const H = C("FmTooltip"), ce = C("FmButton"), Se = C("FmPageHead");
2026
+ return c(), x(Rl, null, {
2027
+ default: _(() => [
2028
+ u(Se, {
2011
2029
  "data-editor-header": "true",
2012
- actions: Q.value,
2013
- "onClick:action": L[0] || (L[0] = (J) => {
2014
- J === "cancel" && ue(), J === "save" && ne();
2030
+ actions: ae.value,
2031
+ "onClick:action": E[0] || (E[0] = (J) => {
2032
+ J === "cancel" && A(), J === "save" && de();
2015
2033
  })
2016
2034
  }, {
2017
- title: w(() => [
2035
+ title: _(() => [
2018
2036
  v("div", go, [
2019
- u(j, {
2020
- content: z.value,
2037
+ u(H, {
2038
+ content: a.value,
2021
2039
  placement: "bottom"
2022
2040
  }, {
2023
- default: w(() => [
2041
+ default: _(() => [
2024
2042
  v("p", {
2025
- class: Le(`${l(_).sm || l(_).xs ? "hidden" : ""} text-ellipsis overflow-hidden text-nowrap fm-typo-en-title-md-600 w-[250px]`)
2026
- }, U(z.value), 3)
2043
+ class: Le(`${t(F).sm || t(F).xs ? "hidden" : ""} text-ellipsis overflow-hidden text-nowrap fm-typo-en-title-md-600 w-[250px]`)
2044
+ }, U(a.value), 3)
2027
2045
  ]),
2028
2046
  _: 1
2029
2047
  }, 8, ["content"]),
2030
2048
  v("div", bo, [
2031
2049
  v("div", yo, [
2032
- (c(), M(he, null, Ee(W, (J) => {
2033
- var _e;
2034
- return u(me, {
2050
+ (c(), R(he, null, Ee(ie, (J) => {
2051
+ var ee;
2052
+ return u(ce, {
2035
2053
  key: J.labelKey,
2036
- label: l(h)(J.labelKey),
2037
- variant: ((_e = A.value) == null ? void 0 : _e.labelKey) === J.labelKey ? "primary" : "secondary",
2054
+ label: t(h)(J.labelKey),
2055
+ variant: ((ee = w.value) == null ? void 0 : ee.labelKey) === J.labelKey ? "primary" : "secondary",
2038
2056
  size: "md",
2039
- onClick: (ae) => se(J)
2057
+ onClick: (_e) => me(J)
2040
2058
  }, null, 8, ["label", "variant", "onClick"]);
2041
2059
  }), 64))
2042
2060
  ]),
2043
- u(me, {
2061
+ u(ce, {
2044
2062
  icon: "screen_rotation",
2045
2063
  variant: "tertiary",
2046
2064
  size: "md",
2047
2065
  class: "text-fm-color-typo-primary",
2048
- onClick: de
2066
+ onClick: ue
2049
2067
  })
2050
2068
  ])
2051
2069
  ])
2052
2070
  ]),
2053
2071
  _: 1
2054
2072
  }, 8, ["actions"]),
2055
- l(T) ? (c(), x(fo, {
2073
+ t(T) ? (c(), x(fo, {
2056
2074
  key: 0,
2057
- modelValue: l(T),
2058
- "onUpdate:modelValue": L[1] || (L[1] = (J) => yt(T) ? T.value = J : null),
2059
- style: rt({ height: oe.value + "px" }),
2060
- class: Le(l(_).lg || l(_).md ? "flex" : ""),
2061
- "hide-configuration": k.value,
2062
- "preview-width": le.value,
2063
- "preview-height": X.value,
2064
- "preview-scale": ie.value,
2065
- onHideConfiguration: L[2] || (L[2] = (J) => k.value = J)
2066
- }, null, 8, ["modelValue", "style", "class", "hide-configuration", "preview-width", "preview-height", "preview-scale"])) : I("", !0)
2075
+ modelValue: t(T),
2076
+ "onUpdate:modelValue": E[1] || (E[1] = (J) => yl(T) ? T.value = J : null),
2077
+ "read-only": O.value,
2078
+ style: rl({ height: ne.value + "px" }),
2079
+ class: Le(t(F).lg || t(F).md ? "flex" : ""),
2080
+ "hide-configuration": j.value,
2081
+ "preview-width": Z.value,
2082
+ "preview-height": re.value,
2083
+ "preview-scale": se.value,
2084
+ onHideConfiguration: E[2] || (E[2] = (J) => j.value = J)
2085
+ }, null, 8, ["modelValue", "read-only", "style", "class", "hide-configuration", "preview-width", "preview-height", "preview-scale"])) : D("", !0)
2067
2086
  ]),
2068
2087
  _: 1
2069
2088
  });