@feedmepos/mf-menu 0.31.15-beta.1 → 0.31.16-beta.1

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 (60) hide show
  1. package/dist/{App-D87EP5SE.js → App-Bsppf5CN.js} +6 -6
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-BnthFRoy.js → ApplyProduct.vue_vue_type_script_setup_true_lang-DTuPAGEJ.js} +2 -2
  3. package/dist/{Catalog-DS4wKymx.js → Catalog-Bj3MNcLG.js} +5 -5
  4. package/dist/{Category-D1TPC-aA.js → Category-CHvG2e6b.js} +5 -5
  5. package/dist/{Category-GbhIPLBW.js → Category-WLIH1Zyc.js} +4 -4
  6. package/dist/{CookingGuide-C39Ecv1F.js → CookingGuide-C8N45xnL.js} +3 -3
  7. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-DUeeVaHx.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-GriZxAIw.js} +1 -1
  8. package/dist/{Group-dErNLF6H.js → Group-Byj3qEBv.js} +3 -3
  9. package/dist/{Group-BzhEIgZk.js → Group-CR3LWKXE.js} +1 -1
  10. package/dist/{Group.vue_vue_type_script_setup_true_lang-BFXGHdMi.js → Group.vue_vue_type_script_setup_true_lang-tecpeqJT.js} +7 -7
  11. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-B5lGsR6N.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BkLHDcZV.js} +3 -3
  12. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-D24MTd_K.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-BRlU0arf.js} +12380 -12246
  13. package/dist/{Ingredient-laBtGjS5.js → Ingredient-BCfCDCFS.js} +3 -3
  14. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-DL8q7CNv.js → InventoryBinding.vue_vue_type_script_setup_true_lang-CpXnjduY.js} +2 -2
  15. package/dist/{LinkProductSideSheet-DX-MRKfp.js → LinkProductSideSheet-BGlLnnm9.js} +1 -1
  16. package/dist/{MenuSetting-BIT1THUu.js → MenuSetting-CdKhTxyc.js} +4 -4
  17. package/dist/{PrintRoute-BIvz4aN1.js → PrintRoute-B-UlUlSD.js} +3 -3
  18. package/dist/{Product-CtfrgVK0.js → Product-BggNPOwm.js} +1 -1
  19. package/dist/{Product.vue_vue_type_script_setup_true_lang-CvlMJdJf.js → Product.vue_vue_type_script_setup_true_lang-DPOaafZ-.js} +11 -11
  20. package/dist/{Products-Ds2Yxmxo.js → Products-DZFgAKxB.js} +685 -684
  21. package/dist/Publish-BTPdN1Ub.js +547 -0
  22. package/dist/{Recipe-ul4kMBPm.js → Recipe-CibJRxHH.js} +4 -4
  23. package/dist/{Scheduler-CoGSCUHZ.js → Scheduler-DAShXnol.js} +3 -3
  24. package/dist/{ServingSequence-BLf6AqJ8.js → ServingSequence-DFs7VR5V.js} +3 -3
  25. package/dist/{Setting-Du7gpreX.js → Setting-aApApOKZ.js} +4 -4
  26. package/dist/{Subcategory-DTwKpA8u.js → Subcategory-CGnGq5Kd.js} +4 -4
  27. package/dist/{Takeaway-DxgaJnU0.js → Takeaway-C8M-Z4eK.js} +4 -4
  28. package/dist/{Takeaway-8xbOp8Xa.js → Takeaway-rJDqoozq.js} +1 -1
  29. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-vdmvli1A.js → Takeaway.vue_vue_type_script_setup_true_lang-CrFeCwvr.js} +5 -5
  30. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-b9NscJTY.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-CCVSPoDB.js} +12 -12
  31. package/dist/{Unit-Ap7qpY-q.js → Unit-CcWjE73k.js} +2 -2
  32. package/dist/{Variant-POkEu-3s.js → Variant-BDPjFaAa.js} +3 -3
  33. package/dist/{_id_--9S7--di.js → _id_-mUBoDBKS.js} +9 -9
  34. package/dist/{app-CK6ZrpdZ.js → app-BBoQR7rs.js} +25 -26
  35. package/dist/{app-BFZyK9BE.js → app-sdhJyRKX.js} +1 -1
  36. package/dist/app.js +1 -1
  37. package/dist/apps/mf-menu/src/components/import/PreviewAddonContent.vue.d.ts +4 -4
  38. package/dist/apps/mf-menu/src/helper/import-export.d.ts +9 -1
  39. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  40. package/dist/assets/{linked-status-CXhE5uCO.js → linked-status-BkX3Y-ws.js} +2 -2
  41. package/dist/assets/{override-menu-DVX8Orl1.js → override-menu-Bo0ZNZ-U.js} +2 -2
  42. package/dist/assets/{validate-menu-Di70DZHf.js → validate-menu-CIWz9YXT.js} +2 -2
  43. package/dist/{catalog-cJG6G1UU.js → catalog-BbukcamZ.js} +1 -1
  44. package/dist/{catalogSetting-CXaK7AC0.js → catalogSetting-7ZMZjqGs.js} +1 -1
  45. package/dist/{category-RIXHr3i-.js → category-Cq2MmCBq.js} +1 -1
  46. package/dist/{currency-Bh0cQzAv.js → currency-OQd6moI9.js} +1 -1
  47. package/dist/{dayjs.min-CeOhrh22.js → dayjs.min-m51FMJgI.js} +1 -1
  48. package/dist/{index-CkF36-Yy.js → index-B5uSVMTf.js} +1 -1
  49. package/dist/{index-9k68QbSm.js → index-DlTid7hh.js} +3 -3
  50. package/dist/{index-BjLVYbeK.js → index-b9FcXU4s.js} +2 -2
  51. package/dist/{item-hh2futyR.js → item-96CGb3Kx.js} +14 -14
  52. package/dist/{menu-b1EX-c7r.js → menu-BmBsIlGC.js} +1 -1
  53. package/dist/{menu-CkxpNa3P.js → menu-Bqiz6B2P.js} +2273 -2273
  54. package/dist/{priceTier-_xtW9BQW.js → priceTier-Ck8MqQWD.js} +1 -1
  55. package/dist/{scheduler-DpPfzjup.js → scheduler-DeOCwKnf.js} +3 -3
  56. package/dist/{subcategory-CH1FS_Is.js → subcategory-DbiQCCF5.js} +99 -99
  57. package/dist/{toExcel-C808hu94.js → toExcel-BsguLQA5.js} +2 -2
  58. package/dist/{unit-Bj_UFAWe.js → unit-CnM6N-39.js} +1 -1
  59. package/package.json +1 -1
  60. package/dist/Publish-BOWb-F33.js +0 -569
@@ -1,569 +0,0 @@
1
- import { defineComponent as q, ref as $, computed as S, onMounted as ie, resolveComponent as k, createElementBlock as A, openBlock as g, createVNode as n, createElementVNode as o, toDisplayString as I, unref as u, Fragment as P, renderList as H, createBlock as B, withCtx as U, watch as re, createCommentVNode as ce, withModifiers as T, h as Y } from "vue";
2
- import { D as Z } from "./dayjs.min-CeOhrh22.js";
3
- import { useRouter as de } from "vue-router";
4
- import { z as me, H as pe, G as ee, a8 as ve, J as Q, K as fe, u as ge, I as be } from "./menu-CkxpNa3P.js";
5
- import { useI18n as G, useCoreStore as ae, RestaurantSelector as _e } from "@feedmepos/mf-common";
6
- import { useSnackbar as te, useDialogChild as he, useDialog as ye, components as X } from "@feedmepos/ui-library";
7
- import { _ as Ce } from "./TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js";
8
- import { a as ke, _ as we } from "./app-CK6ZrpdZ.js";
9
- import { a as xe, w as Ve } from "./tooltip-B5BiPMx9.js";
10
- import { u as Fe } from "./discardConfirm-BHni0LNu.js";
11
- import { _ as Se } from "./index.vue_vue_type_script_setup_true_lang-BgqsTzLI.js";
12
- function le(x) {
13
- return x ? Z(x).format("DD/MM/YY HH:mm") : "-";
14
- }
15
- function Ie(x, V, l) {
16
- const i = (t, m = !1) => {
17
- var _;
18
- return t === void 0 && !m ? "-" : ((_ = l.find((w) => w.value === (t || null))) == null ? void 0 : _.label) || "-";
19
- };
20
- return x.map((t) => {
21
- var d;
22
- const m = (d = V.find(({ _id: r }) => r === t._id)) == null ? void 0 : d.posVersion, _ = !!m && !!me.Pos.canUse({ feature: pe.F_FEATURE.enum.taxAndServiceChargeV4, posVersion: m }), w = i(t.catalogId);
23
- return {
24
- ...t,
25
- _default: w,
26
- _posTakeaway: t.takeawayCatalog ? i(t.takeawayCatalog) : w,
27
- _additionalCatalogs: (t.additionalCatalogs || []).map((r) => i(r)),
28
- _lastUpdate: le(t.updatedAt),
29
- _pickup: _ ? i(t.pickupCatalog, !0) : "-",
30
- _canUsePickup: _,
31
- _posVersion: m || "-"
32
- };
33
- });
34
- }
35
- const $e = {
36
- key: 0,
37
- class: "flex items-center justify-center"
38
- }, Ae = {
39
- key: 1,
40
- class: "space-y-16"
41
- }, Re = { class: "text-fm-color-typo-secondary" }, De = { class: "space-y-4" }, Me = /* @__PURE__ */ q({
42
- __name: "RevertDialog",
43
- props: {
44
- restaurant: {}
45
- },
46
- setup(x) {
47
- const V = x, l = te(), { custom: i } = ee(l), t = $(!1), m = $(null);
48
- async function _() {
49
- await i(
50
- async () => {
51
- var p;
52
- m.value = await ve.readMenuById(((p = V.restaurant.revertConfig) == null ? void 0 : p._id) || "");
53
- },
54
- { isLoading: t }
55
- );
56
- }
57
- const w = S(() => {
58
- var p;
59
- return [
60
- { label: "Main", value: null },
61
- ...(((p = m.value) == null ? void 0 : p.modules.catalog) || []).map((y) => ({
62
- label: y.name,
63
- value: y._id
64
- }))
65
- ];
66
- }), { t: d } = G(), r = S(() => {
67
- var C;
68
- const p = V.restaurant.revertConfig;
69
- if (!p) return [];
70
- const y = Ie(
71
- [
72
- {
73
- ...p,
74
- catalogId: p.catalogId || null
75
- }
76
- ],
77
- ae().restaurants.value,
78
- w.value
79
- )[0];
80
- return [
81
- { label: d("menu.revert.labels.restaurant"), value: V.restaurant.name },
82
- {
83
- label: d("menu.revert.labels.revert_to"),
84
- value: le((C = m.value) == null ? void 0 : C.updatedAt)
85
- },
86
- { label: d("menu.revert.labels.default"), value: y._default },
87
- { label: d("menu.revert.labels.pos_takeaway"), value: y._posTakeaway },
88
- { label: d("menu.revert.labels.pickup"), value: y._pickup },
89
- {
90
- label: d("menu.revert.labels.additional_catalogs"),
91
- value: y._additionalCatalogs.join(", ")
92
- }
93
- ];
94
- });
95
- ie(async () => _());
96
- const { emitData: h } = he();
97
- return (p, y) => {
98
- const C = k("FmCircularProgress");
99
- return t.value ? (g(), A("div", $e, [
100
- n(C, { size: "lg" })
101
- ])) : (g(), A("div", Ae, [
102
- o("div", Re, I(u(d)("menu.revert.description", { name: V.restaurant.name })), 1),
103
- o("div", De, [
104
- (g(!0), A(P, null, H(r.value, (R) => (g(), B(xe, {
105
- key: R.label,
106
- name: R.label,
107
- value: R.value || "--"
108
- }, null, 8, ["name", "value"]))), 128))
109
- ])
110
- ]));
111
- };
112
- }
113
- }), Ue = { class: "fm-typo-en-title-md-600" }, Le = { class: "mt-40" }, Pe = { class: "fm-typo-en-title-sm-600" }, Be = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mt-4 mb-8" }, Ee = { class: "flex gap-8 items-center justify-start" }, ze = /* @__PURE__ */ q({
114
- __name: "UpdateCatalogDialog",
115
- props: {
116
- catalogs: {
117
- type: Array,
118
- required: !0
119
- }
120
- },
121
- emits: ["onComplete"],
122
- setup(x, { expose: V, emit: l }) {
123
- const { t: i } = G(), t = x;
124
- V({
125
- show: y,
126
- hide: C
127
- });
128
- const m = l;
129
- function _() {
130
- return {
131
- restaurantId: "",
132
- catalogId: void 0,
133
- takeawayCatalog: void 0,
134
- pickupCatalog: null,
135
- additionalCatalogs: []
136
- };
137
- }
138
- const w = S(() => [
139
- {
140
- label: i("menu.publish.update_catalog_dialog.sections.default.use_default"),
141
- value: null
142
- },
143
- ...t.catalogs.map((b) => ({
144
- label: b.name,
145
- value: b._id
146
- }))
147
- ]), d = S(() => [
148
- {
149
- label: i("menu.publish.update_catalog_dialog.sections.default.use_default"),
150
- value: null
151
- },
152
- ...t.catalogs.map((b) => ({
153
- label: b.name,
154
- value: b._id
155
- }))
156
- ]), r = $(_()), h = $(!1), p = $(void 0);
157
- function y(b) {
158
- p.value = b ? Q(b) : _(), r.value = Q(p.value), h.value = !0;
159
- }
160
- function C() {
161
- h.value = !1;
162
- }
163
- const R = Fe(
164
- () => !fe.isEqual(p.value, r.value),
165
- () => {
166
- C();
167
- }
168
- );
169
- function j() {
170
- C(), m("onComplete", r.value);
171
- }
172
- return (b, f) => {
173
- const F = k("FmSelect"), E = k("FmCheckbox"), D = k("FmButton"), z = k("FmSideSheet");
174
- return g(), B(z, {
175
- modelValue: h.value,
176
- "onUpdate:modelValue": f[5] || (f[5] = (v) => h.value = v),
177
- "max-width": 560,
178
- "onOn:clickedAway": u(R)
179
- }, {
180
- "side-sheet-header": U(() => [
181
- o("span", Ue, I(u(i)("menu.publish.update_catalog_dialog.title")), 1)
182
- ]),
183
- "side-sheet-footer": U(() => [
184
- o("div", Ee, [
185
- n(D, {
186
- label: u(i)("menu.publish.update_catalog_dialog.actions.update"),
187
- size: "lg",
188
- variant: "primary",
189
- onClick: f[4] || (f[4] = () => j())
190
- }, null, 8, ["label"]),
191
- n(D, {
192
- label: u(i)("menu.publish.update_catalog_dialog.actions.cancel"),
193
- size: "lg",
194
- variant: "tertiary",
195
- onClick: C
196
- }, null, 8, ["label"])
197
- ])
198
- ]),
199
- default: U(() => [
200
- n(F, {
201
- modelValue: r.value.catalogId,
202
- "onUpdate:modelValue": f[0] || (f[0] = (v) => r.value.catalogId = v),
203
- items: w.value,
204
- class: "mb-24",
205
- label: u(i)("menu.publish.update_catalog_dialog.sections.default.label")
206
- }, null, 8, ["modelValue", "items", "label"]),
207
- n(F, {
208
- modelValue: r.value.takeawayCatalog,
209
- "onUpdate:modelValue": f[1] || (f[1] = (v) => r.value.takeawayCatalog = v),
210
- items: d.value,
211
- class: "mb-24",
212
- label: u(i)("menu.publish.update_catalog_dialog.sections.pos_takeaway.label")
213
- }, null, 8, ["modelValue", "items", "label"]),
214
- n(F, {
215
- modelValue: r.value.pickupCatalog,
216
- "onUpdate:modelValue": f[2] || (f[2] = (v) => r.value.pickupCatalog = v),
217
- items: d.value,
218
- label: u(i)("menu.publish.update_catalog_dialog.sections.pickup.label")
219
- }, null, 8, ["modelValue", "items", "label"]),
220
- o("div", Le, [
221
- o("div", Pe, I(u(i)("menu.publish.update_catalog_dialog.sections.additional.title")), 1),
222
- o("div", Be, I(u(i)("menu.publish.update_catalog_dialog.sections.additional.subtitle")), 1),
223
- (g(!0), A(P, null, H(x.catalogs, (v) => (g(), A("div", {
224
- key: v._id
225
- }, [
226
- n(E, {
227
- modelValue: r.value.additionalCatalogs,
228
- "onUpdate:modelValue": f[3] || (f[3] = (L) => r.value.additionalCatalogs = L),
229
- label: v.name,
230
- value: v._id
231
- }, null, 8, ["modelValue", "label", "value"])
232
- ]))), 128))
233
- ])
234
- ]),
235
- _: 1
236
- }, 8, ["modelValue", "onOn:clickedAway"]);
237
- };
238
- }
239
- }), Ke = {
240
- class: "flex flex-col p-24 bg-fm-color-neutral-white min-h-[calc(100dvh-56px)] xs:max-h-[calc(100dvh-56px)]"
241
- }, Ne = {
242
- class: "flex items-center xs:mb-8 mb-24"
243
- }, Oe = {
244
- class: "mr-8"
245
- }, Te = {
246
- class: "fm-typo-en-title-md-600"
247
- }, je = {
248
- class: "xs:hidden"
249
- }, Ye = {
250
- class: "pb-8 flex justify-between xs:flex-col gap-8"
251
- }, qe = {
252
- class: "grow flex flex-col gap-4"
253
- }, He = {
254
- class: "flex gap-8 items-center"
255
- }, Ge = {
256
- class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary"
257
- }, Je = {
258
- class: "space-y-4"
259
- }, We = {
260
- class: "fm-typo-en-body-lg-600"
261
- }, Qe = {
262
- class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
263
- }, Xe = {
264
- class: "flex gap-8"
265
- }, Ze = {
266
- class: "xs:block hidden fixed bottom-72 right-16"
267
- }, da = /* @__PURE__ */ q({
268
- __name: "Publish",
269
- setup(x) {
270
- const V = de(), {
271
- t: l
272
- } = G(), i = ae(), t = ge(), m = $(!0);
273
- re(() => {
274
- var e;
275
- return (e = i.currentBusiness.value) == null ? void 0 : e._id;
276
- }, async (e, a) => {
277
- if (!(!e || e === a)) {
278
- m.value = !0;
279
- try {
280
- await t.readRestaurants();
281
- } catch (c) {
282
- console.error("Failed to load restaurants:", c);
283
- } finally {
284
- m.value = !1;
285
- }
286
- }
287
- }, {
288
- immediate: !0
289
- });
290
- const _ = (e) => t.state.menu.updatedAt === e.updatedAt, w = ({
291
- row: e
292
- }) => {
293
- const a = _(e);
294
- return n(Ce, {
295
- label: l(a ? "menu.publish.table.status.latest" : "menu.publish.table.status.outdated"),
296
- variant: a ? "success" : "warning"
297
- }, null);
298
- }, d = $({}), r = [{
299
- accessorKey: "name",
300
- header: () => l("menu.publish.table.columns.restaurant"),
301
- cell: (e) => e.getValue(),
302
- enableSorting: !0
303
- }, {
304
- accessorKey: "catalog",
305
- header: () => l("menu.publish.table.columns.default"),
306
- enableSorting: !1,
307
- cell: (e) => e.getValue().default
308
- }, {
309
- accessorKey: "catalog",
310
- header: () => l("menu.publish.table.columns.pos_takeaway"),
311
- enableSorting: !1,
312
- cell: (e) => e.getValue().takeaway
313
- }, {
314
- accessorKey: "catalog",
315
- header: () => l("menu.publish.table.columns.pickup"),
316
- enableSorting: !1,
317
- cell: (e) => e.getValue().pickup
318
- }, {
319
- accessorKey: "updatedAt",
320
- header: () => l("menu.publish.table.columns.version"),
321
- enableSorting: !1,
322
- cell: (e) => {
323
- const a = e.getValue();
324
- return b(a);
325
- }
326
- }, {
327
- accessorKey: "status",
328
- header: () => l("menu.common.labels.status"),
329
- enableSorting: !1,
330
- size: 80,
331
- cell: (e) => n(w, {
332
- row: e.row.original
333
- }, null)
334
- }, {
335
- accessorKey: "_id",
336
- header: "",
337
- size: 52,
338
- enableSorting: !1,
339
- cell: (e) => {
340
- const a = e.row.original;
341
- return Y("div", {
342
- class: "flex justify-end gap-8"
343
- }, [C.value && a.revertConfig ? Ve(Y(X.FmButton, {
344
- prependIcon: "undo",
345
- variant: "secondary",
346
- onClick: T(async () => {
347
- await R(e.row.original);
348
- }, ["stop", "prevent"])
349
- }), l("menu.publish.actions.revert")) : null, Y(X.FmButton, {
350
- label: l("menu.publish.actions.publish"),
351
- icon: "ios_share",
352
- variant: "secondary",
353
- onClick: T(async () => {
354
- const c = D(e.row.original);
355
- await L(c);
356
- }, ["stop", "prevent"])
357
- })]);
358
- },
359
- meta: {
360
- width: "150px"
361
- }
362
- }], h = $(""), p = $(), y = ye(), C = S(() => t.version !== be.F_MENU_VERSION.enum.v3);
363
- async function R(e) {
364
- e.revertConfig && y.open({
365
- title: "Revert menu",
366
- contentComponent: Me,
367
- contentComponentProps: {
368
- restaurant: e
369
- },
370
- primaryActions: {
371
- text: "Revert",
372
- close: !0
373
- },
374
- secondaryActions: {
375
- text: "Cancel",
376
- close: !0
377
- }
378
- }).onPrimary(async () => {
379
- await v.minor(async () => {
380
- await t.revertRestaurantMenu(e._id);
381
- }, {
382
- customId: e._id,
383
- message: `Revert menu of ${e.name}`
384
- });
385
- });
386
- }
387
- const j = S(() => l("menu.publish.labels.main_version", {
388
- version: b(t.state.menu.updatedAt)
389
- }));
390
- function b(e) {
391
- return e ? Z(e).format("DD/MM/YYYY hh:mmA") : "";
392
- }
393
- const f = S(() => t.state.menu.modules.catalog), F = S(() => v.queue.value.some((e) => e.id === t.state.menu._id));
394
- function E(e) {
395
- var a;
396
- return e ? ((a = f.value.find((c) => c._id === e)) == null ? void 0 : a.name) ?? l("menu.publish.labels.catalog.invalid") : l("menu.publish.labels.catalog.main");
397
- }
398
- function D(e) {
399
- return {
400
- restaurantId: e._id,
401
- catalogId: e.catalogId,
402
- takeawayCatalog: e.takeawayCatalog,
403
- pickupCatalog: e.pickupCatalog || null,
404
- additionalCatalogs: e.additionalCatalogs
405
- };
406
- }
407
- function z(e) {
408
- var c;
409
- const a = D(e);
410
- (c = p.value) == null || c.show(a);
411
- }
412
- const v = ee(te());
413
- async function L(e) {
414
- var c;
415
- const a = (c = M.value.find((N) => N._id === e.restaurantId)) == null ? void 0 : c.name;
416
- await v.minor(async () => await t.publishMenu(e), {
417
- customId: t.state.menu._id,
418
- message: `Publishing menu for ${a}`,
419
- successMessage: `Published to ${a}`
420
- });
421
- }
422
- const K = $(null), M = S(() => t.state.restaurants.filter((e) => {
423
- var a;
424
- return !K.value || ((a = K.value) == null ? void 0 : a.includes(e._id));
425
- }).map((e) => ({
426
- ...e,
427
- catalog: {
428
- default: E(e.catalogId),
429
- takeaway: E(e.takeawayCatalog),
430
- pickup: E(e.pickupCatalog)
431
- }
432
- }))), oe = S(() => {
433
- const e = h.value.toLowerCase();
434
- return M.value.filter(({
435
- name: a,
436
- catalog: c
437
- }) => a.toLowerCase().includes(e) || c.default.toLowerCase().includes(e) || c.takeaway.toLowerCase().includes(e) || c.pickup.toLowerCase().includes(e));
438
- });
439
- async function J() {
440
- if (F.value) return;
441
- const e = Object.keys(d.value).map(Number).filter((a) => d.value[a]);
442
- if (e.length === 0 || e.length === M.value.length)
443
- await v.minor(async () => await t.publishAllMenu(), {
444
- customId: t.state.menu._id
445
- });
446
- else
447
- for (const a of e) {
448
- const c = M.value[a];
449
- await L(D(c));
450
- }
451
- }
452
- return (e, a) => {
453
- const c = k("FmChip"), N = k("FmSpacer"), O = k("FmButton"), W = k("FmSearch"), ne = k("FmTable"), se = k("FmListItem"), ue = k("FmList");
454
- return g(), A(P, null, [o("div", Ke, [o("div", Ne, [o("div", Oe, [o("div", Te, I(u(l)("menu.publish.title")), 1), a[7] || (a[7] = o("div", {
455
- class: "hidden xs:block fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
456
- }, null, -1))]), n(c, {
457
- label: j.value,
458
- class: "xs:hidden text-fm-color-primary bg-fm-color-system-warning-100"
459
- }, null, 8, ["label"]), n(N), o("div", je, [n(O, {
460
- disabled: F.value || m.value,
461
- icon: "ios_share",
462
- label: u(l)("menu.publish.actions.publish_all"),
463
- variant: "primary",
464
- onClick: a[0] || (a[0] = () => J())
465
- }, null, 8, ["disabled", "label"])])]), m.value ? (g(), B(ke, {
466
- key: 0
467
- })) : (g(), A(P, {
468
- key: 1
469
- }, [o("div", Ye, [n(u(_e), {
470
- multiple: "",
471
- modelValue: K.value,
472
- "onUpdate:modelValue": a[2] || (a[2] = (s) => K.value = s)
473
- }, {
474
- "append-right": U(() => [n(N, {
475
- class: "xs:hidden"
476
- }), n(W, {
477
- modelValue: h.value,
478
- "onUpdate:modelValue": a[1] || (a[1] = (s) => h.value = s),
479
- autofocus: "",
480
- class: "w-[320px] xs:hidden",
481
- placeholder: u(l)("menu.publish.table.search.placeholder")
482
- }, null, 8, ["modelValue", "placeholder"])]),
483
- _: 1
484
- }, 8, ["modelValue"]), n(W, {
485
- modelValue: h.value,
486
- "onUpdate:modelValue": a[3] || (a[3] = (s) => h.value = s),
487
- autofocus: "",
488
- class: "w-full xs:block hidden",
489
- placeholder: u(l)("menu.publish.table.search.placeholder")
490
- }, null, 8, ["modelValue", "placeholder"])]), M.value.length > 0 ? (g(), A(P, {
491
- key: 0
492
- }, [n(we, {
493
- class: "xs:hidden block"
494
- }, {
495
- default: U(() => [n(ne, {
496
- modelValue: d.value,
497
- "onUpdate:modelValue": a[4] || (a[4] = (s) => d.value = s),
498
- "column-defs": r,
499
- loading: F.value,
500
- "page-size": M.value.length,
501
- "row-data": M.value,
502
- "search-value": h.value,
503
- shrinkAt: !1,
504
- selection: "multiple",
505
- "hide-footer": "",
506
- "pin-header-row": "",
507
- onRowClick: a[5] || (a[5] = (s) => z(s.original))
508
- }, null, 8, ["modelValue", "loading", "page-size", "row-data", "search-value"])]),
509
- _: 1
510
- }), n(ue, {
511
- class: "flex-col flex-1 min-h-0 overflow-auto xs:flex hidden w-full pb-64",
512
- separator: ""
513
- }, {
514
- default: U(() => [(g(!0), A(P, null, H(oe.value, (s) => (g(), B(se, {
515
- key: s._id,
516
- label: s.name,
517
- style: {
518
- padding: "12px 0 !important"
519
- },
520
- onClick: () => z(s)
521
- }, {
522
- default: U(() => [o("div", qe, [o("div", He, [o("div", Ge, I(b(s.updatedAt)), 1), n(w, {
523
- row: s
524
- }, null, 8, ["row"])]), o("div", Je, [o("div", We, I(s.name), 1), o("div", Qe, [o("div", null, "Default: " + I(s.catalog.default), 1), o("div", null, "POS takeaway: " + I(s.catalog.takeaway), 1), o("div", null, "Pickup: " + I(s.catalog.pickup), 1)])])]), o("div", Xe, [C.value && s.revertConfig ? (g(), B(O, {
525
- key: 0,
526
- disabled: F.value,
527
- icon: "undo",
528
- variant: "tertiary",
529
- onClick: T(() => R(s), ["stop"])
530
- }, null, 8, ["disabled", "onClick"])) : ce("", !0), n(O, {
531
- disabled: F.value,
532
- icon: "ios_share",
533
- variant: "tertiary",
534
- onClick: T(() => L(D(s)), ["stop"])
535
- }, null, 8, ["disabled", "onClick"])])]),
536
- _: 2
537
- }, 1032, ["label", "onClick"]))), 128))]),
538
- _: 1
539
- })], 64)) : (g(), B(u(Se), {
540
- key: 1,
541
- title: u(l)("menu.publish.empty.title"),
542
- subtitle: u(l)("menu.publish.empty.subtitle"),
543
- action: {
544
- text: u(l)("menu.publish.empty.action"),
545
- icon: "add",
546
- callback: () => {
547
- u(V).push({
548
- name: "$settings-my-business"
549
- });
550
- }
551
- }
552
- }, null, 8, ["title", "subtitle", "action"]))], 64))]), o("div", Ze, [n(O, {
553
- disabled: F.value || m.value,
554
- icon: "ios_share",
555
- label: u(l)("menu.publish.actions.publish_all"),
556
- variant: "fab",
557
- onClick: a[6] || (a[6] = () => J())
558
- }, null, 8, ["disabled", "label"])]), n(ze, {
559
- ref_key: "updateCatalogDialogRef",
560
- ref: p,
561
- catalogs: f.value,
562
- onOnComplete: L
563
- }, null, 8, ["catalogs"])], 64);
564
- };
565
- }
566
- });
567
- export {
568
- da as default
569
- };