@feedmepos/mf-report 5.31.3-beta.0 → 5.32.0-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 (40) hide show
  1. package/dist/App-o4z-EAO1.js +339 -0
  2. package/dist/{DateRangeSelect-AJd7gYva.js → DateRangeSelect-DO3T_rQs.js} +18 -18
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-CIVlgjSX.js → Default.vue_vue_type_script_setup_true_lang-CW_VllVL.js} +1 -1
  4. package/dist/DigestListView-DG-vojKl.js +637 -0
  5. package/dist/DigestReaderView-bRfEYtZA.js +507 -0
  6. package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-BKHx9p3R.js → DynamicWidget.vue_vue_type_script_setup_true_lang-Bfmd5eMI.js} +173 -173
  7. package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-qQi-7kuX.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-vy0FZKv0.js} +154 -154
  8. package/dist/{InsightView-noFPHcRY.js → InsightView-sLKiFc_-.js} +16 -16
  9. package/dist/{Integration-UwZP3vYt.js → Integration-CZn5gvF8.js} +3 -3
  10. package/dist/{Integrations-BMhJuw20.js → Integrations-I0rHAfPo.js} +2 -2
  11. package/dist/{Layout-CofH0rzo.js → Layout-DPEfiH3f.js} +1 -1
  12. package/dist/{LocationSelect.vue_vue_type_script_setup_true_lang-BsdJx7gt.js → LocationSelect.vue_vue_type_script_setup_true_lang-DFQ943gj.js} +2 -2
  13. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-BMJHW2E2.js → MenuTab.vue_vue_type_script_setup_true_lang-BjJcvN_z.js} +9 -9
  14. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-b6hgoVnw.js → NavigationTab.vue_vue_type_script_setup_true_lang-zUF-G98m.js} +6 -6
  15. package/dist/{OverviewView-V-KcUYld.js → OverviewView-CJS82eII.js} +5 -5
  16. package/dist/{Report-Cxfxa7EK.js → Report-DDYgnr3v.js} +30 -30
  17. package/dist/ReportCanvasView-m_qW7QgV.js +966 -0
  18. package/dist/{ReportEditor-syPuiUDA.js → ReportEditor-CrMd2q2a.js} +7 -7
  19. package/dist/{ReportView-Dqc89voW.js → ReportView-CKLzDw5j.js} +6 -6
  20. package/dist/{ReportViewRoute-BE4Olg2t.js → ReportViewRoute-BrLi7iXr.js} +2 -2
  21. package/dist/{Setting-CSZG2_pc.js → Setting-BUmSYXCO.js} +3 -3
  22. package/dist/{Template-DE8y5xA7.js → Template-CljYVpCi.js} +18 -18
  23. package/dist/{TileEditor-DCLCIQqG.js → TileEditor-3fV8xOVc.js} +6 -6
  24. package/dist/{TilePageStack.vue_vue_type_script_setup_true_lang-BKM30woJ.js → TilePageStack.vue_vue_type_script_setup_true_lang-Biwl30EU.js} +2 -2
  25. package/dist/{TransitionFade-DSKakW7L.js → TransitionFade-BUSdiKFH.js} +5 -5
  26. package/dist/{app-BxEbZEnS.js → app-BXVd3ce-.js} +3354 -2967
  27. package/dist/app.js +4 -4
  28. package/dist/assets/{formatChartData.worker-R9EGYsk6.js → formatChartData.worker-BprlZnJs.js} +80 -58
  29. package/dist/assets/{processTableData.worker-CxpDa0tB.js → processTableData.worker-D5GSFMnH.js} +83 -61
  30. package/dist/{currency-lmnrd1Gz.js → currency-C6h0cwip.js} +1 -1
  31. package/dist/{index-Co3j0l3d.js → index-BoeJLw2U.js} +1279 -1244
  32. package/dist/{report-Dsp2krIZ.js → report-DG-20Pq8.js} +18 -18
  33. package/dist/report-canvas-libs/components-1.js +1126 -71
  34. package/dist/report-canvas-libs/geo-outlines-1.js +1 -1
  35. package/dist/style.css +1 -1
  36. package/dist/useDigestFont-Gf1l5qYq.js +205 -0
  37. package/dist/{ReportCanvasView-DDNkVmlA.js → useReportCanvasPanel-CquUHqIK.js} +2933 -3477
  38. package/dist/{useRestaurantPermission-D8xwhBHn.js → useRestaurantPermission-BNu9cN13.js} +1 -1
  39. package/package.json +1 -1
  40. package/dist/App-j08Hk0tX.js +0 -339
@@ -0,0 +1,966 @@
1
+ import { defineComponent as at, ref as d, computed as E, watch as Re, onMounted as ot, onBeforeUnmount as qe, resolveComponent as ie, createElementBlock as p, openBlock as s, createElementVNode as n, createVNode as N, toDisplayString as v, createCommentVNode as A, Fragment as Oe, renderList as Le, normalizeClass as ze, createBlock as ne, nextTick as Pe, unref as o, withDirectives as jt, withCtx as Se, isRef as et, vShow as Ht } from "vue";
2
+ import { useRoute as Ut, useRouter as Mt } from "vue-router";
3
+ import { u as nt, _ as rt } from "./_plugin-vue_export-helper-C6QDExPN.js";
4
+ import { storeToRefs as Ne } from "pinia";
5
+ import { g as Jt, r as Wt, f as Kt, h as Zt, u as Qt, c as Gt, b as Xt, a as Yt, R as ea, e as ta, p as aa, i as oa, j as na, k as tt, l as ra } from "./useReportCanvasPanel-CquUHqIK.js";
6
+ import { _ as sa } from "./LocationSelect.vue_vue_type_script_setup_true_lang-DFQ943gj.js";
7
+ import { D as la } from "./DateRangeSelect-DO3T_rQs.js";
8
+ import { a as st, g as ia } from "./app-BXVd3ce-.js";
9
+ import { u as ua } from "./report-DG-20Pq8.js";
10
+ import { r as da } from "./i18n-DbyciK4x.js";
11
+ const ca = ["aria-label"], fa = { class: "flex h-64 shrink-0 items-center gap-12 border-b border-fm-color-border-secondary px-[20px]" }, va = { class: "fm-typo-en-body-md-600 grow" }, pa = ["aria-label", "disabled"], ma = { class: "min-h-0 grow overflow-y-auto px-[20px] py-[20px]" }, ya = { class: "fm-typo-en-body-md-400 mb-[20px] text-fm-color-typo-secondary" }, ha = { class: "mb-24 rounded-[12px] border border-fm-color-border-secondary p-16" }, ba = { class: "mb-8 flex items-center gap-8" }, ga = { class: "fm-typo-en-body-md-600 grow" }, wa = { class: "fm-typo-en-body-sm-600 rounded-md bg-fm-color-neutral-gray-100 px-8 py-4" }, _a = {
12
+ key: 0,
13
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
14
+ }, ka = ["aria-label"], xa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ca = {
15
+ key: 1,
16
+ role: "alert",
17
+ class: "rounded-[12px] border border-fm-color-border-secondary p-[20px]"
18
+ }, Sa = { class: "fm-typo-en-body-md-600 mb-8" }, Ra = { class: "fm-typo-en-body-md-400 mb-16 text-fm-color-typo-secondary" }, Aa = {
19
+ key: 2,
20
+ class: "flex flex-col items-center rounded-[12px] bg-fm-color-neutral-gray-50 px-16 py-32 text-center"
21
+ }, Ea = { class: "fm-typo-en-body-md-600 mb-8" }, Va = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, $a = { class: "fm-typo-en-body-sm-600 mb-12 text-fm-color-typo-secondary" }, Ia = { class: "ml-4 border-l border-fm-color-border-secondary pl-16" }, Da = ["aria-expanded", "aria-controls", "aria-current", "disabled", "onClick"], Fa = { class: "mb-4 flex items-center gap-8" }, Ta = ["datetime", "title"], Ba = {
22
+ key: 0,
23
+ "data-testid": "canvas-version-current",
24
+ class: "fm-typo-en-body-sm-600 rounded-md bg-fm-color-neutral-gray-100 px-8 py-4 text-fm-color-typo-secondary"
25
+ }, Oa = {
26
+ key: 0,
27
+ class: "fm-typo-en-body-md-600 block break-words text-fm-color-typo-secondary"
28
+ }, La = { class: "fm-typo-en-body-md-400 line-clamp-3 block break-words" }, za = {
29
+ "data-testid": "canvas-version-author",
30
+ class: "mt-8 flex items-center gap-8 text-fm-color-typo-secondary"
31
+ }, Pa = { class: "fm-typo-en-body-sm-400 line-clamp-1 break-words" }, Na = { class: "shrink-0 border-t border-fm-color-border-secondary p-[20px]" }, qa = { class: "fm-typo-en-body-sm-400 mb-4 text-fm-color-typo-secondary" }, ja = { class: "fm-typo-en-body-md-400 mb-16 max-h-[120px] overflow-y-auto whitespace-pre-wrap break-words" }, Ha = {
32
+ key: 0,
33
+ role: "alert",
34
+ class: "fm-typo-en-body-md-400 mb-12 text-fm-color-typo-error"
35
+ }, Ua = {
36
+ key: 1,
37
+ class: "fm-typo-en-body-md-400 mb-12 text-fm-color-typo-secondary"
38
+ }, Ma = {
39
+ key: 2,
40
+ class: "flex items-center justify-end gap-8"
41
+ }, Ja = ["disabled"], Wa = {
42
+ key: 1,
43
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
44
+ }, Ka = { class: "fm-typo-en-body-sm-400 mt-12 text-fm-color-typo-secondary" }, Za = /* @__PURE__ */ at({
45
+ __name: "ReportCanvasHistory",
46
+ props: {
47
+ reportId: {},
48
+ publishedAt: {},
49
+ timezone: {},
50
+ hasDraft: { type: Boolean },
51
+ busy: { type: Boolean }
52
+ },
53
+ emits: ["close", "restored", "restoring"],
54
+ setup(ue, { emit: re }) {
55
+ const q = ue, M = re, { t: _, locale: S } = nt(), l = (a, y = {}) => _(`reportV5.reportCanvas.history.${a}`, y), T = d([]), h = d(!0), f = d(!1), P = d(!1), R = d(!1), D = d(!1), V = d(), W = d(), k = d(), ae = d(), j = E(() => T.value.find((a) => a.id === V.value)), X = E(() => q.hasDraft || q.busy || R.value);
56
+ let K = !0, Y = null;
57
+ function oe(a, y) {
58
+ const c = new Date(a);
59
+ return Number.isFinite(c.getTime()) ? new Intl.DateTimeFormat(S.value, { ...y, timeZone: q.timezone }).format(
60
+ c
61
+ ) : l("unknownDate");
62
+ }
63
+ const H = (a) => oe(a, { dateStyle: "medium", timeStyle: "short" }), i = (a) => oe(a, { hour: "numeric", minute: "2-digit", second: "2-digit" }), m = (a) => oe(a, { year: "numeric", month: "2-digit", day: "2-digit" });
64
+ function u(a) {
65
+ return m(a) === m((/* @__PURE__ */ new Date()).toISOString()) ? l("today") : oe(a, { month: "long", day: "numeric", year: "numeric" });
66
+ }
67
+ const $ = E(() => {
68
+ const a = [];
69
+ for (const y of [...T.value].sort((c, J) => Date.parse(J.at) - Date.parse(c.at))) {
70
+ const c = m(y.at), J = a.find((pe) => pe.key === c);
71
+ J ? J.versions.push(y) : a.push({ key: c, label: u(y.at), versions: [y] });
72
+ }
73
+ return a;
74
+ }), F = (a) => {
75
+ var y;
76
+ return a.id === ((y = T.value[0]) == null ? void 0 : y.id);
77
+ }, O = (a) => a.prompt.trim() || l("noPrompt"), g = (a) => a.restoredFrom ? l("restoredFrom", { at: H(a.restoredFrom) }) : "", ge = (a) => [g(a), O(a)].filter(Boolean).join(" "), de = (a) => {
78
+ var y, c;
79
+ return ((y = a.author) == null ? void 0 : y.name) || ((c = a.author) == null ? void 0 : c.email) || l("unknownUser");
80
+ };
81
+ async function we() {
82
+ h.value = !0, f.value = !1;
83
+ try {
84
+ const a = await Jt(q.reportId);
85
+ K && (T.value = a);
86
+ } catch {
87
+ K && (f.value = !0);
88
+ } finally {
89
+ K && (h.value = !1);
90
+ }
91
+ }
92
+ function ce(a) {
93
+ R.value || F(a) || (V.value = V.value === a.id ? void 0 : a.id, D.value = !1, P.value = !1);
94
+ }
95
+ async function fe() {
96
+ var a;
97
+ !j.value || X.value || (D.value = !0, await Pe(), (a = k.value) == null || a.focus());
98
+ }
99
+ async function ve() {
100
+ var a;
101
+ D.value = !1, P.value = !1, await Pe(), (a = ae.value) == null || a.focus();
102
+ }
103
+ async function _e() {
104
+ if (!(!j.value || X.value || !D.value)) {
105
+ R.value = !0, M("restoring", !0), P.value = !1;
106
+ try {
107
+ const a = await Wt(q.reportId, j.value.id);
108
+ K && M("restored", a);
109
+ } catch {
110
+ K && (P.value = !0);
111
+ } finally {
112
+ R.value = !1, M("restoring", !1);
113
+ }
114
+ }
115
+ }
116
+ function Ae(a) {
117
+ a.key === "Escape" && (a.stopPropagation(), !R.value && (D.value ? ve() : M("close")));
118
+ }
119
+ return Re(X, (a) => {
120
+ a && !R.value && (D.value = !1);
121
+ }), ot(() => {
122
+ var a;
123
+ Y = document.activeElement, (a = W.value) == null || a.focus(), we();
124
+ }), qe(() => {
125
+ K = !1, Y == null || Y.focus();
126
+ }), (a, y) => {
127
+ const c = ie("FmIcon"), J = ie("FmButton"), pe = ie("FmAvatar");
128
+ return s(), p("aside", {
129
+ "data-testid": "canvas-versions",
130
+ class: "flex h-full min-h-0 flex-col border-l border-fm-color-border-secondary bg-fm-color-neutral-white text-fm-color-typo-primary",
131
+ "aria-label": l("title"),
132
+ onKeydown: Ae
133
+ }, [
134
+ n("header", fa, [
135
+ N(c, {
136
+ name: "history",
137
+ size: "md",
138
+ class: "text-fm-color-typo-secondary"
139
+ }),
140
+ n("h2", va, v(l("title")), 1),
141
+ n("button", {
142
+ ref_key: "closeButton",
143
+ ref: W,
144
+ "data-testid": "canvas-versions-close",
145
+ class: "history-button flex h-[36px] w-[36px] items-center justify-center rounded-md text-fm-color-typo-secondary",
146
+ "aria-label": l("close"),
147
+ disabled: R.value,
148
+ onClick: y[0] || (y[0] = (ee) => M("close"))
149
+ }, [
150
+ N(c, {
151
+ name: "close",
152
+ size: "md"
153
+ })
154
+ ], 8, pa)
155
+ ]),
156
+ n("div", ma, [
157
+ n("p", ya, v(l("intro")), 1),
158
+ n("div", ha, [
159
+ n("div", ba, [
160
+ y[1] || (y[1] = n("span", {
161
+ class: "h-8 w-8 rounded-full bg-fm-color-primary",
162
+ "aria-hidden": "true"
163
+ }, null, -1)),
164
+ n("span", ga, v(l("current")), 1),
165
+ n("span", wa, v(l("published")), 1)
166
+ ]),
167
+ a.publishedAt ? (s(), p("p", _a, v(H(a.publishedAt)), 1)) : A("", !0)
168
+ ]),
169
+ h.value ? (s(), p("div", {
170
+ key: 0,
171
+ role: "status",
172
+ class: "space-y-16",
173
+ "aria-label": l("loading")
174
+ }, [
175
+ n("p", xa, v(l("loading")), 1),
176
+ (s(), p(Oe, null, Le(3, (ee) => n("div", {
177
+ key: ee,
178
+ class: "rounded-lg border border-fm-color-border-secondary p-16",
179
+ "aria-hidden": "true"
180
+ }, y[2] || (y[2] = [
181
+ n("div", { class: "mb-12 h-12 w-1/3 rounded bg-fm-color-neutral-gray-100" }, null, -1),
182
+ n("div", { class: "h-12 w-3/4 rounded bg-fm-color-neutral-gray-100" }, null, -1)
183
+ ]))), 64))
184
+ ], 8, ka)) : f.value ? (s(), p("div", Ca, [
185
+ n("p", Sa, v(l("loadFailed")), 1),
186
+ n("p", Ra, v(l("loadFailedHint")), 1),
187
+ N(J, {
188
+ variant: "secondary",
189
+ label: l("retry"),
190
+ onClick: we
191
+ }, null, 8, ["label"])
192
+ ])) : T.value.length ? A("", !0) : (s(), p("div", Aa, [
193
+ N(c, {
194
+ name: "history",
195
+ size: "lg",
196
+ class: "mb-12 text-fm-color-typo-secondary"
197
+ }),
198
+ n("p", Ea, v(l("empty")), 1),
199
+ n("p", Va, v(l("emptyHint")), 1)
200
+ ])),
201
+ (s(!0), p(Oe, null, Le(h.value || f.value ? [] : $.value, (ee) => (s(), p("section", {
202
+ key: ee.key,
203
+ class: "mb-[20px]"
204
+ }, [
205
+ n("h3", $a, v(ee.label), 1),
206
+ n("ul", Ia, [
207
+ (s(!0), p(Oe, null, Le(ee.versions, (w) => {
208
+ var ke, se, xe;
209
+ return s(), p("li", {
210
+ key: w.id,
211
+ "data-testid": "canvas-version-row",
212
+ class: "relative mb-8"
213
+ }, [
214
+ y[3] || (y[3] = n("span", {
215
+ class: "history-dot absolute top-[20px] h-8 w-8 rounded-full border border-fm-color-border-secondary bg-fm-color-neutral-white",
216
+ "aria-hidden": "true"
217
+ }, null, -1)),
218
+ n("button", {
219
+ class: ze([
220
+ "history-button w-full rounded-lg border p-12 text-left",
221
+ V.value === w.id ? "border-fm-color-primary bg-fm-color-primary-50" : "border-transparent"
222
+ ]),
223
+ "aria-expanded": V.value === w.id,
224
+ "aria-controls": V.value === w.id ? "canvas-version-details" : void 0,
225
+ "aria-current": F(w) ? "true" : void 0,
226
+ disabled: R.value || F(w),
227
+ onClick: (je) => ce(w)
228
+ }, [
229
+ n("span", Fa, [
230
+ n("time", {
231
+ datetime: w.at,
232
+ title: H(w.at),
233
+ class: "fm-typo-en-body-sm-400 grow text-fm-color-typo-secondary"
234
+ }, v(i(w.at)), 9, Ta),
235
+ F(w) ? (s(), p("span", Ba, v(l("currentBadge")), 1)) : V.value === w.id ? (s(), ne(c, {
236
+ key: 1,
237
+ name: "check",
238
+ size: "sm",
239
+ class: "text-fm-color-primary"
240
+ })) : A("", !0)
241
+ ]),
242
+ g(w) ? (s(), p("span", Oa, v(g(w)), 1)) : A("", !0),
243
+ n("span", La, v(O(w)), 1),
244
+ n("span", za, [
245
+ N(pe, {
246
+ size: "sm",
247
+ name: ((ke = w.author) == null ? void 0 : ke.name) || ((se = w.author) == null ? void 0 : se.email) || "?",
248
+ src: (xe = w.author) == null ? void 0 : xe.photoUrl
249
+ }, null, 8, ["name", "src"]),
250
+ n("span", Pa, v(de(w)), 1)
251
+ ])
252
+ ], 10, Da)
253
+ ]);
254
+ }), 128))
255
+ ])
256
+ ]))), 128))
257
+ ]),
258
+ n("footer", Na, [
259
+ j.value ? (s(), p("div", {
260
+ key: 0,
261
+ id: "canvas-version-details",
262
+ ref_key: "details",
263
+ ref: ae,
264
+ tabindex: "-1",
265
+ class: "history-details"
266
+ }, [
267
+ n("p", qa, v(l("savedBy", { user: de(j.value), at: H(j.value.at) })), 1),
268
+ n("p", ja, v(D.value ? l("confirmHint") : ge(j.value)), 1),
269
+ P.value ? (s(), p("p", Ha, v(l("restoreFailed")), 1)) : A("", !0),
270
+ a.hasDraft || a.busy ? (s(), p("p", Ua, v(l(a.hasDraft ? "draftHint" : "busyHint")), 1)) : A("", !0),
271
+ D.value ? (s(), p("div", Ma, [
272
+ n("button", {
273
+ ref_key: "cancelButton",
274
+ ref: k,
275
+ class: "history-button fm-typo-en-body-md-600 rounded-lg px-16 py-12",
276
+ disabled: R.value,
277
+ onClick: ve
278
+ }, v(l("cancel")), 9, Ja),
279
+ N(J, {
280
+ "data-testid": "canvas-version-confirm",
281
+ variant: "primary",
282
+ label: l(R.value ? "restoring" : "confirm"),
283
+ disabled: X.value,
284
+ onClick: _e
285
+ }, null, 8, ["label", "disabled"])
286
+ ])) : (s(), ne(J, {
287
+ key: 3,
288
+ "data-testid": "canvas-version-restore",
289
+ class: "w-full",
290
+ variant: "primary",
291
+ "prepend-icon": "restore",
292
+ label: l("restore"),
293
+ disabled: X.value,
294
+ onClick: fe
295
+ }, null, 8, ["label", "disabled"]))
296
+ ], 512)) : (s(), p("p", Wa, v(l("selectHint")), 1)),
297
+ n("p", Ka, v(l("timezone", { timezone: a.timezone })), 1)
298
+ ])
299
+ ], 40, ca);
300
+ };
301
+ }
302
+ }), Qa = /* @__PURE__ */ rt(Za, [["__scopeId", "data-v-7df5ac71"]]), Ga = 2e3, Xa = 10 * 6e4;
303
+ function Ya(ue, re, q, M) {
304
+ const { timezone: _ } = Ne(st()), S = d(null), l = d(null), T = d(!1), h = d(""), f = [];
305
+ function P(i) {
306
+ f.push(i);
307
+ }
308
+ let R;
309
+ function D() {
310
+ R !== void 0 && (window.clearInterval(R), R = void 0);
311
+ }
312
+ function V() {
313
+ var i;
314
+ R !== void 0 || re.value || ((i = S.value) == null ? void 0 : i.status) === "running" && (R = window.setInterval(() => void W(), Ga));
315
+ }
316
+ async function W() {
317
+ var i;
318
+ if (re.value) {
319
+ D();
320
+ return;
321
+ }
322
+ try {
323
+ const { run: m } = await Zt(ue, M == null ? void 0 : M.value);
324
+ m && k(m), ((i = S.value) == null ? void 0 : i.status) !== "running" ? D() : S.value.updatedAt && Date.now() - new Date(S.value.updatedAt).getTime() > Xa && (T.value = !0, D());
325
+ } catch {
326
+ }
327
+ }
328
+ function k(i, m) {
329
+ m !== void 0 && (l.value = m);
330
+ const u = i.sections.some(($) => {
331
+ var O;
332
+ const F = (O = S.value) == null ? void 0 : O.sections.find((g) => g.id === $.id);
333
+ return $.status === "ok" && (F == null ? void 0 : F.status) !== "ok";
334
+ });
335
+ S.value = i, T.value = !1, u && f.forEach(($) => $()), V();
336
+ }
337
+ function ae(i) {
338
+ var u;
339
+ if (i.name !== "build_run") return;
340
+ const m = i.data;
341
+ Array.isArray(m.sections) && k(
342
+ {
343
+ runId: m.runId ? String(m.runId) : void 0,
344
+ status: m.status ?? "running",
345
+ sections: m.sections,
346
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
347
+ },
348
+ // first snapshot of this turn claims the anchor; later ones keep it
349
+ (u = S.value) != null && u.runId && S.value.runId === m.runId ? void 0 : (q == null ? void 0 : q.value) ?? null
350
+ );
351
+ }
352
+ function j() {
353
+ D(), S.value = null, l.value = null, T.value = !1, h.value = "";
354
+ }
355
+ function X(i, m = []) {
356
+ i && i.status !== "ok" && k(i, Y(i, m));
357
+ }
358
+ function K(i) {
359
+ l.value || !S.value || (l.value = Y(S.value, i));
360
+ }
361
+ function Y(i, m) {
362
+ if (!i.runId) return null;
363
+ const u = m.find(
364
+ ($) => $.role === "assistant" && $.parts.some(
365
+ (F) => {
366
+ var O;
367
+ return F.type === "data-build_run" && ((O = F.data) == null ? void 0 : O.runId) === i.runId;
368
+ }
369
+ )
370
+ );
371
+ return (u == null ? void 0 : u.id) ?? null;
372
+ }
373
+ async function oe(i) {
374
+ var m;
375
+ if (!(!((m = S.value) != null && m.runId) || S.value.status === "running")) {
376
+ h.value = "";
377
+ try {
378
+ const { run: u } = await Kt(
379
+ ue,
380
+ S.value.runId,
381
+ i,
382
+ o(_.value)
383
+ );
384
+ k(u);
385
+ } catch (u) {
386
+ h.value = u instanceof Error ? u.message : String(u);
387
+ }
388
+ }
389
+ }
390
+ async function H() {
391
+ T.value = !1, await W();
392
+ }
393
+ return qe(D), {
394
+ run: S,
395
+ anchorId: l,
396
+ stale: T,
397
+ retryError: h,
398
+ seed: X,
399
+ reanchor: K,
400
+ clear: j,
401
+ noteEvent: ae,
402
+ retry: oe,
403
+ refresh: H,
404
+ onLanded: P
405
+ };
406
+ }
407
+ const eo = "page_filters", to = { class: "flex min-w-0 grow flex-col" }, ao = { class: "fm-typo-en-title-md-600 block min-w-0 max-w-full overflow-hidden text-ellipsis whitespace-nowrap" }, oo = { class: "relative shrink-0" }, no = {
408
+ key: 0,
409
+ class: "flex items-center gap-8 border-b border-fm-color-border-secondary px-16 py-8"
410
+ }, ro = {
411
+ key: 0,
412
+ class: "flex min-w-0 grow items-start overflow-x-auto scrollbar-hide"
413
+ }, so = {
414
+ key: 1,
415
+ class: "grow"
416
+ }, lo = {
417
+ key: 2,
418
+ class: "flex shrink-0 items-center gap-4"
419
+ }, io = ["aria-pressed", "aria-label", "disabled"], uo = {
420
+ key: 1,
421
+ "data-testid": "canvas-draft-bar",
422
+ class: "flex items-center gap-12 border-b border-fm-color-border-secondary bg-fm-color-system-info-100 px-16 py-8"
423
+ }, co = { class: "fm-typo-en-body-sm-500 text-fm-color-typo-primary" }, fo = { class: "fm-typo-en-body-sm-400 grow text-fm-color-typo-secondary" }, vo = {
424
+ key: 0,
425
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-error"
426
+ }, po = {
427
+ key: 2,
428
+ role: "status",
429
+ class: "fm-typo-en-body-sm-400 flex items-center gap-8 border-b border-fm-color-border-secondary px-16 py-8"
430
+ }, mo = { class: "grow" }, yo = ["aria-label"], ho = {
431
+ key: 3,
432
+ class: "fm-typo-en-body-sm-400 border-b border-fm-color-border-secondary bg-fm-color-system-warning-100 px-16 py-8"
433
+ }, bo = {
434
+ key: 4,
435
+ class: "fm-typo-en-body-sm-400 p-16 text-fm-color-typo-error"
436
+ }, go = ["srcdoc", "title"], wo = ["role", "aria-modal", "aria-label"], _o = /* @__PURE__ */ at({
437
+ __name: "ReportCanvasView",
438
+ props: {
439
+ reportId: {},
440
+ viewOnly: { type: Boolean }
441
+ },
442
+ setup(ue) {
443
+ const re = ue, q = Ut(), M = Mt(), { t: _, te: S } = nt(), { currentReport: l } = Ne(ua()), T = E(() => {
444
+ var e;
445
+ return da(_, S, (e = l.value) == null ? void 0 : e.name, "other");
446
+ }), h = re.reportId || String(q.query.reportId ?? ""), f = d(), P = d(""), R = E(() => {
447
+ var e;
448
+ return ((e = f.value) == null ? void 0 : e.state) === "draft";
449
+ }), D = E(() => {
450
+ var e, t;
451
+ return ((t = (e = f.value) == null ? void 0 : e.unpublishedTurnIds) == null ? void 0 : t.length) ?? 0;
452
+ }), V = d(!1), W = d(""), k = d(!1), ae = d(!1), j = d(!1);
453
+ function X() {
454
+ k.value = !0, u.value = !1;
455
+ }
456
+ function K() {
457
+ j.value || (k.value ? k.value = !1 : i.value = !1);
458
+ }
459
+ async function Y(e) {
460
+ await Ce(() => Promise.resolve(e)), k.value = !1, ae.value = !0;
461
+ }
462
+ const { isAdmin: oe } = ia(), H = E(() => !re.viewOnly && oe.value), i = d(!1), m = d(), u = d(!1), $ = d(!1), F = d(), O = d(), g = E({
463
+ get: () => $.value ? F.value : O.value,
464
+ set: (e) => {
465
+ $.value ? F.value = e : O.value = e;
466
+ }
467
+ }), ge = E(
468
+ () => {
469
+ var e;
470
+ return !!g.value && !((e = f.value) != null && e.sections.some(
471
+ (t) => {
472
+ var r, b;
473
+ return t.id === ((r = g.value) == null ? void 0 : r.sectionId) && t.version === ((b = g.value) == null ? void 0 : b.version);
474
+ }
475
+ ));
476
+ }
477
+ ), de = d({});
478
+ function we(e, t) {
479
+ var r;
480
+ return String(
481
+ ((r = e.config) == null ? void 0 : r.title) || de.value[e.id] || _("reportV5.reportAi.chat.widgetNumber", { number: t + 1 })
482
+ );
483
+ }
484
+ const ce = d([]), fe = d([]), ve = E({
485
+ get: () => $.value ? ce.value : fe.value,
486
+ set: (e) => {
487
+ $.value ? ce.value = e : fe.value = e;
488
+ }
489
+ });
490
+ function _e() {
491
+ g.value = void 0, ve.value = [], u.value = !1;
492
+ }
493
+ function Ae() {
494
+ const e = g.value;
495
+ if (!(e != null && e.element)) return _e();
496
+ const { element: t, ...r } = e, b = ve.value.shift();
497
+ g.value = b ? { ...r, element: b, elementText: b.text ?? "", elementTag: b.tag } : r;
498
+ }
499
+ function a(e) {
500
+ e.key === "Escape" && (u.value = !1);
501
+ }
502
+ function y(e, t = []) {
503
+ var b;
504
+ if (!u.value || Z.value) return;
505
+ const r = (b = f.value) == null ? void 0 : b.sections.find((z) => z.id === e.sectionId);
506
+ !r || r.version !== e.version || (g.value = {
507
+ ...e,
508
+ viewParams: JSON.parse(JSON.stringify(x.params.value)),
509
+ viewIntent: JSON.parse(JSON.stringify(x.intent.value)),
510
+ label: e.label || we(r, f.value.sections.indexOf(r))
511
+ }, ve.value = t, u.value = !1, i.value = !0);
512
+ }
513
+ const c = d(""), J = d(""), pe = d("");
514
+ function ee(e) {
515
+ return U.stashDraft(c.value, O.value), L.clear(), e().then(() => {
516
+ const t = U.recallDraft();
517
+ c.value = t.text, O.value = t.target, fe.value = [], u.value = !1;
518
+ });
519
+ }
520
+ async function w(e) {
521
+ if (Qe.value) return;
522
+ const t = e ? F.value : void 0, r = e ? [...ce.value] : [];
523
+ let b = !1;
524
+ await ee(async () => {
525
+ b = await U.startChat();
526
+ }), b && e && ($.value = !1, O.value = t, fe.value = r, F.value = void 0, ce.value = [], c.value = e, await se());
527
+ }
528
+ const ke = (e) => ee(async () => {
529
+ const t = await U.select(e);
530
+ L.seed(t, ye.value);
531
+ });
532
+ async function se() {
533
+ const e = c.value.trim();
534
+ if (!(!e || ge.value || Z.value)) {
535
+ if (pe.value = e, c.value = "", await Rt(e, g.value), Ke.value) {
536
+ c.value || (c.value = pe.value);
537
+ return;
538
+ }
539
+ _e();
540
+ }
541
+ }
542
+ function xe(e) {
543
+ const t = U.takeUnsent(e);
544
+ if (t)
545
+ return c.value = t.text, g.value = t.target, se();
546
+ }
547
+ function je(e) {
548
+ Z.value || (c.value = _("reportV5.reportAi.build.askBuilderPrompt", { title: e }), g.value = void 0);
549
+ }
550
+ async function lt() {
551
+ const e = await U.stop();
552
+ !e || c.value.trim() || (c.value = e.text, g.value = e.target);
553
+ }
554
+ function it(e) {
555
+ const t = U.requestOf(e);
556
+ t && (c.value = t.text, g.value = t.target);
557
+ }
558
+ function ut(e) {
559
+ const t = U.requestOf(e);
560
+ if (t)
561
+ return c.value = t.text, g.value = t.target, se();
562
+ }
563
+ const x = Qt(h), U = Gt(h), {
564
+ messages: ye,
565
+ sessionId: He,
566
+ title: dt,
567
+ chats: ct,
568
+ chatsCursor: Ue,
569
+ chatsLoading: ft,
570
+ chatsError: vt,
571
+ switching: Me,
572
+ earlier: pt,
573
+ loadingEarlier: mt,
574
+ streaming: Je,
575
+ turnId: We,
576
+ step: yt,
577
+ error: Ke,
578
+ interrupted: ht,
579
+ stoppable: bt,
580
+ stopping: gt,
581
+ unsent: wt,
582
+ slow: _t,
583
+ startedAt: kt,
584
+ awaiting: xt,
585
+ noReplyId: Ct,
586
+ load: St,
587
+ send: Rt,
588
+ onLifecycle: At,
589
+ onSettled: Et,
590
+ onResumed: Vt
591
+ } = U, Z = E(() => Je.value || xt.value), { dateRange: Ee, selectedLocationIds: Ve, locations: Ze, timezone: $t } = Ne(st()), L = Ya(h, Je, We, He), Qe = E(
592
+ () => {
593
+ var e;
594
+ return Z.value || Me.value || ((e = L.run.value) == null ? void 0 : e.status) === "running";
595
+ }
596
+ ), Ge = E(
597
+ () => {
598
+ var e;
599
+ return ((e = f.value) == null ? void 0 : e.sections.filter((t) => t.id !== eo)) ?? [];
600
+ }
601
+ ), Xe = E(() => Ge.value.length === 0), Ye = E({
602
+ get: () => H.value && i.value || k.value,
603
+ set: (e) => {
604
+ i.value = e, e || (k.value = !1);
605
+ }
606
+ }), { root: It, drawer: Dt, docked: $e, modal: Ie } = Xt(Ye, u), Ft = E(
607
+ () => {
608
+ var e;
609
+ return ((e = f.value) == null ? void 0 : e.sections.some((t) => t.status === "pending")) ?? !1;
610
+ }
611
+ ), Tt = E(() => Z.value ? yt.value ?? "working" : Ft.value ? "loading" : "updating"), Q = Yt(m, {
612
+ onSelectSection: y,
613
+ onCancelSelection: () => {
614
+ u.value = !1;
615
+ },
616
+ onSetParams: (e, t) => {
617
+ x.setParams(e, t);
618
+ },
619
+ onSectionRendered: (e, t, r) => {
620
+ r && (de.value = { ...de.value, [e]: r }), De(e, t, "ok");
621
+ },
622
+ onSectionError: (e, t, r) => {
623
+ console.warn("[report-canvas] section failed", { reportId: h, sectionId: e, message: r }), De(e, t, "error", r);
624
+ },
625
+ onSectionLayout: (e, t, r) => {
626
+ var z;
627
+ const b = (z = f.value) == null ? void 0 : z.sections.find((I) => I.id === e);
628
+ (b == null ? void 0 : b.status) === "ok" && De(e, t, "ok", void 0, r);
629
+ }
630
+ });
631
+ x.onResult((e) => Q.pushRows(e)), x.onParamsChanged(() => Q.pushParams(x.paramState())), x.bindStore(), Re([u, g, Q.ready, Z], () => {
632
+ Q.setCommentMode(u.value && !Z.value, g.value);
633
+ });
634
+ async function De(e, t, r, b, z) {
635
+ var le, be;
636
+ const I = (le = f.value) == null ? void 0 : le.sections.find((me) => me.id === e);
637
+ if (!I || t !== I.version) return;
638
+ const te = r === "error" ? b ?? "the section failed to render" : void 0, G = z ?? I.warnings ?? [];
639
+ if (!(I.status === r && I.error === te && (I.warnings ?? []).join(`
640
+ `) === G.join(`
641
+ `))) {
642
+ I.status = r, I.error = te, I.warnings = G.length ? G : void 0;
643
+ try {
644
+ await ra(
645
+ h,
646
+ e,
647
+ { version: t, status: r, error: te, warnings: G },
648
+ (be = f.value) == null ? void 0 : be.state
649
+ );
650
+ } catch (me) {
651
+ console.warn("[report-canvas] ack failed", { reportId: h, sectionId: e, err: me });
652
+ }
653
+ }
654
+ }
655
+ async function Ce(e) {
656
+ if (!V.value) {
657
+ V.value = !0, W.value = "";
658
+ try {
659
+ const t = await e();
660
+ f.value = t, x.load(t), await Q.init(t.sections, x.paramState(), x.env());
661
+ } catch (t) {
662
+ W.value = t instanceof Error ? t.message : String(t);
663
+ } finally {
664
+ V.value = !1;
665
+ }
666
+ }
667
+ }
668
+ const Bt = () => Ce(() => aa(h)), Ot = () => Ce(() => oa(h)), Lt = (e) => Ce(() => na(h, e));
669
+ async function zt() {
670
+ try {
671
+ P.value = "";
672
+ const e = await tt(h);
673
+ f.value = e, x.load(e), H.value && Xe.value && $e.value && (i.value = !0), await Pe(), await Q.init(e.sections, x.paramState(), x.env());
674
+ } catch (e) {
675
+ P.value = e instanceof Error ? e.message : String(e);
676
+ }
677
+ }
678
+ const Fe = /* @__PURE__ */ new Set();
679
+ let he = null, Te = !1;
680
+ function Be() {
681
+ return he ? (Te = !0, he) : (he = (async () => {
682
+ do {
683
+ Te = !1;
684
+ try {
685
+ await Pt();
686
+ } catch (e) {
687
+ console.warn("[report-canvas] refresh failed", { reportId: h, err: e });
688
+ }
689
+ } while (Te);
690
+ })().finally(() => {
691
+ he = null;
692
+ }), he);
693
+ }
694
+ async function Pt() {
695
+ var te, G;
696
+ const e = (((te = f.value) == null ? void 0 : te.sections) ?? []).map((B) => B.id), t = new Map(
697
+ (((G = f.value) == null ? void 0 : G.sections) ?? []).map((B) => [B.id, B.version])
698
+ ), r = await tt(h);
699
+ f.value = r;
700
+ const b = [...Fe];
701
+ Fe.clear(), x.applyCanvas(r, b) && Q.pushParams(x.paramState());
702
+ const z = r.sections.map((B) => B.id);
703
+ if (z.length !== e.length || z.some((B, le) => B !== e[le])) {
704
+ await Q.init(r.sections, x.paramState(), x.env());
705
+ return;
706
+ }
707
+ const I = r.sections.filter(
708
+ (B) => t.get(B.id) !== B.version
709
+ );
710
+ I.length && await Q.swapSections(I);
711
+ }
712
+ const Nt = ["param_written", "sql_written", "section_written", "deleted", "reordered", "restored"];
713
+ At((e) => {
714
+ e.name === "sql_written" && typeof e.data.queryId == "string" && Fe.add(e.data.queryId), Nt.includes(e.name) && Be(), L.noteEvent(e);
715
+ }), Et(() => void Be()), Vt((e) => L.seed(e, ye.value)), Re(ye, (e) => L.reanchor(e)), L.onLanded(() => void Be()), Re([Ze, $t], () => {
716
+ f.value && Q.pushEnv(x.env());
717
+ });
718
+ const qt = E(
719
+ () => Object.values(x.results.value).some((e) => e.truncated)
720
+ );
721
+ return ot(async () => {
722
+ window.addEventListener("keydown", a), await zt(), H.value && L.seed(await St(), ye.value);
723
+ }), qe(() => window.removeEventListener("keydown", a)), (e, t) => {
724
+ var te, G, B, le, be, me;
725
+ const r = ie("FmTooltip"), b = ie("FmPageHead"), z = ie("FmButton"), I = ie("FmIcon");
726
+ return s(), p("div", {
727
+ ref_key: "root",
728
+ ref: It,
729
+ class: "relative flex h-full min-h-0 w-full"
730
+ }, [
731
+ n("div", to, [
732
+ e.viewOnly ? A("", !0) : (s(), ne(b, {
733
+ key: 0,
734
+ class: "remove-line-clamping shrink-0",
735
+ title: T.value,
736
+ "back-button": !0,
737
+ "onClick:back": t[0] || (t[0] = (C) => o(M).push({ name: "reports", query: o(q).query }))
738
+ }, {
739
+ title: Se(() => [
740
+ N(r, {
741
+ content: T.value,
742
+ placement: "bottom",
743
+ "z-index": 2e3,
744
+ class: "flex min-w-0 max-w-full justify-start"
745
+ }, {
746
+ default: Se(() => [
747
+ n("p", ao, v(T.value), 1)
748
+ ]),
749
+ _: 1
750
+ }, 8, ["content"])
751
+ ]),
752
+ _: 1
753
+ }, 8, ["title"])),
754
+ n("div", oo, [
755
+ !e.viewOnly || ((te = f.value) == null ? void 0 : te.hostFilters) !== !1 ? (s(), p("div", no, [
756
+ ((G = f.value) == null ? void 0 : G.hostFilters) !== !1 ? (s(), p("div", ro, [
757
+ N(sa, {
758
+ modelValue: o(Ve),
759
+ "onUpdate:modelValue": t[2] || (t[2] = (C) => et(Ve) ? Ve.value = C : null),
760
+ options: o(Ze)
761
+ }, {
762
+ default: Se(() => [
763
+ N(la, {
764
+ "date-range": o(Ee),
765
+ "onUpdate:dateRange": t[1] || (t[1] = (C) => et(Ee) ? Ee.value = C : null)
766
+ }, null, 8, ["date-range"])
767
+ ]),
768
+ _: 1
769
+ }, 8, ["modelValue", "options"])
770
+ ])) : (s(), p("div", so)),
771
+ Ge.value.length && !e.viewOnly ? (s(), p("div", lo, [
772
+ (B = f.value) != null && B.canEdit && ((le = f.value) != null && le.publishedAt) ? (s(), ne(z, {
773
+ key: 0,
774
+ "data-testid": "canvas-versions-open",
775
+ variant: "tertiary",
776
+ "prepend-icon": "history",
777
+ label: o(_)("reportV5.reportCanvas.draft.history"),
778
+ "aria-expanded": k.value,
779
+ onClick: X
780
+ }, null, 8, ["label", "aria-expanded"])) : A("", !0),
781
+ H.value ? (s(), ne(r, {
782
+ key: 1,
783
+ placement: "bottom",
784
+ content: o(_)(
785
+ u.value ? "reportV5.reportAi.chat.cancelSelection" : "reportV5.reportAi.chat.commentWidget"
786
+ )
787
+ }, {
788
+ default: Se(() => [
789
+ n("button", {
790
+ "data-testid": "canvas-comment-toggle",
791
+ class: ze(["canvas-comment-target flex h-32 w-32 items-center justify-center rounded-md text-fm-color-typo-secondary disabled:opacity-50", u.value && "bg-fm-color-neutral-gray-100 text-fm-color-primary"]),
792
+ "aria-pressed": u.value,
793
+ "aria-label": o(_)("reportV5.reportAi.chat.commentWidget"),
794
+ disabled: Z.value || k.value,
795
+ onClick: t[3] || (t[3] = (C) => u.value = !u.value)
796
+ }, t[15] || (t[15] = [
797
+ n("svg", {
798
+ width: "20",
799
+ height: "20",
800
+ viewBox: "0 0 20 20",
801
+ fill: "none",
802
+ "aria-hidden": "true"
803
+ }, [
804
+ n("path", {
805
+ d: "M5 3.5h5a6.5 6.5 0 1 1-6.5 6.5V5A1.5 1.5 0 0 1 5 3.5Z",
806
+ stroke: "currentColor",
807
+ "stroke-width": "1.5",
808
+ "stroke-linecap": "round",
809
+ "stroke-linejoin": "round"
810
+ })
811
+ ], -1)
812
+ ]), 10, io)
813
+ ]),
814
+ _: 1
815
+ }, 8, ["content"])) : A("", !0),
816
+ H.value && !i.value && !k.value ? (s(), ne(z, {
817
+ key: 2,
818
+ "data-testid": "report-canvas-chat-open",
819
+ variant: "tertiary",
820
+ "prepend-icon": "auto_awesome",
821
+ label: o(_)("reportV5.reportAi.chat.open"),
822
+ onClick: t[4] || (t[4] = (C) => i.value = !0)
823
+ }, null, 8, ["label"])) : A("", !0)
824
+ ])) : A("", !0)
825
+ ])) : A("", !0)
826
+ ]),
827
+ R.value && !e.viewOnly ? (s(), p("div", uo, [
828
+ n("span", co, v(o(_)("reportV5.reportCanvas.draft.pending", { count: D.value })), 1),
829
+ n("span", fo, v(o(_)("reportV5.reportCanvas.draft.hint")), 1),
830
+ W.value ? (s(), p("span", vo, v(W.value), 1)) : A("", !0),
831
+ N(z, {
832
+ "data-testid": "canvas-draft-discard",
833
+ variant: "tertiary",
834
+ label: o(_)("reportV5.reportCanvas.draft.discard"),
835
+ disabled: V.value,
836
+ onClick: Ot
837
+ }, null, 8, ["label", "disabled"]),
838
+ N(z, {
839
+ "data-testid": "canvas-draft-publish",
840
+ variant: "primary",
841
+ label: o(_)("reportV5.reportCanvas.draft.publish"),
842
+ disabled: V.value,
843
+ onClick: Bt
844
+ }, null, 8, ["label", "disabled"])
845
+ ])) : A("", !0),
846
+ ae.value ? (s(), p("div", po, [
847
+ N(I, {
848
+ name: "check_circle",
849
+ size: "sm"
850
+ }),
851
+ n("span", mo, v(o(_)("reportV5.reportCanvas.history.restored")), 1),
852
+ n("button", {
853
+ class: "flex h-32 w-32 items-center justify-center rounded-md",
854
+ "aria-label": o(_)("reportV5.reportCanvas.draft.close"),
855
+ onClick: t[5] || (t[5] = (C) => ae.value = !1)
856
+ }, [
857
+ N(I, {
858
+ name: "close",
859
+ size: "sm"
860
+ })
861
+ ], 8, yo)
862
+ ])) : A("", !0),
863
+ qt.value ? (s(), p("div", ho, v(o(_)("reportV5.reportCanvas.canvas.truncated")), 1)) : A("", !0),
864
+ P.value ? (s(), p("p", bo, v(P.value), 1)) : A("", !0),
865
+ jt(n("iframe", {
866
+ ref_key: "frame",
867
+ ref: m,
868
+ "data-testid": "report-canvas-frame",
869
+ class: "min-h-0 grow border-0",
870
+ srcdoc: o(ea),
871
+ sandbox: "allow-scripts",
872
+ title: o(_)("reportV5.reportCanvas.canvas.title")
873
+ }, null, 8, go), [
874
+ [Ht, !P.value]
875
+ ])
876
+ ]),
877
+ o(Ie) ? (s(), p("div", {
878
+ key: 0,
879
+ class: "canvas-scrim absolute inset-0 z-20",
880
+ onClick: K
881
+ })) : A("", !0),
882
+ !e.viewOnly && Ye.value && (o($e) || !u.value) ? (s(), p("div", {
883
+ key: 1,
884
+ ref_key: "drawer",
885
+ ref: Dt,
886
+ class: ze(
887
+ o($e) ? "w-[380px] shrink-0" : "absolute inset-y-0 right-0 z-30 w-full max-w-[380px] shadow-lg"
888
+ ),
889
+ role: o(Ie) ? "dialog" : void 0,
890
+ "aria-modal": o(Ie) ? "true" : void 0,
891
+ "aria-label": o(_)(k.value ? "reportV5.reportCanvas.draft.history" : "reportV5.reportAi.chat.title")
892
+ }, [
893
+ k.value ? (s(), ne(Qa, {
894
+ key: 0,
895
+ "report-id": o(h),
896
+ "published-at": (be = f.value) == null ? void 0 : be.publishedAt,
897
+ timezone: o(x).env().timezone,
898
+ "has-draft": R.value,
899
+ busy: Z.value || V.value,
900
+ onClose: t[6] || (t[6] = (C) => k.value = !1),
901
+ onRestored: Y,
902
+ onRestoring: t[7] || (t[7] = (C) => j.value = C)
903
+ }, null, 8, ["report-id", "published-at", "timezone", "has-draft", "busy"])) : (s(), ne(ta, {
904
+ key: 1,
905
+ "home-draft": J.value,
906
+ "onUpdate:homeDraft": t[8] || (t[8] = (C) => J.value = C),
907
+ "home-open": $.value,
908
+ "onUpdate:homeOpen": t[9] || (t[9] = (C) => $.value = C),
909
+ messages: o(ye),
910
+ draft: c.value,
911
+ target: g.value,
912
+ "target-stale": ge.value,
913
+ streaming: Z.value,
914
+ "turn-id": o(We),
915
+ phase: Tt.value,
916
+ slow: o(_t),
917
+ "started-at": o(kt),
918
+ error: o(Ke),
919
+ interrupted: o(ht),
920
+ blank: Xe.value,
921
+ run: o(L).run.value,
922
+ "run-anchor-id": o(L).anchorId.value,
923
+ "run-stale": o(L).stale.value,
924
+ "retry-error": o(L).retryError.value,
925
+ "undoable-turn-ids": ((me = f.value) == null ? void 0 : me.unpublishedTurnIds) ?? [],
926
+ undoing: V.value,
927
+ "unsent-ids": o(wt),
928
+ "no-reply-id": o(Ct),
929
+ "chat-id": o(He),
930
+ "chat-title": o(dt),
931
+ chats: o(ct),
932
+ "chats-cursor": o(Ue),
933
+ "chats-loading": o(ft),
934
+ "chats-error": o(vt),
935
+ switching: o(Me),
936
+ busy: Qe.value,
937
+ stoppable: o(bt),
938
+ stopping: o(gt),
939
+ earlier: o(pt),
940
+ "loading-earlier": o(mt),
941
+ "onUpdate:draft": t[10] || (t[10] = (C) => c.value = C),
942
+ onClearTarget: Ae,
943
+ onSubmit: se,
944
+ onClose: t[11] || (t[11] = (C) => i.value = !1),
945
+ onRetry: o(L).retry,
946
+ onUndo: Lt,
947
+ onResend: xe,
948
+ onAskAgain: ut,
949
+ onEditRequest: it,
950
+ onStop: lt,
951
+ onAskBuilder: je,
952
+ onCheckStatus: o(L).refresh,
953
+ onNewChat: w,
954
+ onSelectChat: ke,
955
+ onLoadChats: t[12] || (t[12] = (C) => o(U).loadChats()),
956
+ onLoadMoreChats: t[13] || (t[13] = (C) => o(U).loadChats(o(Ue) ?? void 0)),
957
+ onLoadEarlier: t[14] || (t[14] = (C) => o(U).loadEarlier())
958
+ }, null, 8, ["home-draft", "home-open", "messages", "draft", "target", "target-stale", "streaming", "turn-id", "phase", "slow", "started-at", "error", "interrupted", "blank", "run", "run-anchor-id", "run-stale", "retry-error", "undoable-turn-ids", "undoing", "unsent-ids", "no-reply-id", "chat-id", "chat-title", "chats", "chats-cursor", "chats-loading", "chats-error", "switching", "busy", "stoppable", "stopping", "earlier", "loading-earlier", "onRetry", "onCheckStatus"]))
959
+ ], 10, wo)) : A("", !0)
960
+ ], 512);
961
+ };
962
+ }
963
+ }), Do = /* @__PURE__ */ rt(_o, [["__scopeId", "data-v-44470a1c"]]);
964
+ export {
965
+ Do as default
966
+ };