@feedmepos/mf-menu 0.32.51-dev → 0.32.52-dev

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 (76) hide show
  1. package/dist/{App-DJ_boY0P.js → App-COGal-TD.js} +497 -506
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-BVafiq6l.js → ApplyProduct.vue_vue_type_script_setup_true_lang-DzisSpvQ.js} +3 -3
  3. package/dist/{ApplyProductDialog.vue_vue_type_script_setup_true_lang-CruH5AF9.js → ApplyProductDialog.vue_vue_type_script_setup_true_lang-eqJDqaPZ.js} +2 -2
  4. package/dist/{Catalog-C_7GyzOz.js → Catalog-BJ8-NdAC.js} +7 -7
  5. package/dist/{Category-B8c8AO0C.js → Category-BkU2y10v.js} +5 -5
  6. package/dist/{Category-CJRttg5g.js → Category-CFaPOouQ.js} +4 -4
  7. package/dist/{CookingGuide-B-oXAful.js → CookingGuide-BDDCmfeL.js} +5 -5
  8. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-DwwMOoQx.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-BcJYQo_p.js} +1 -1
  9. package/dist/{Group-iHKwYfVS.js → Group-DBrJ4Rin.js} +1 -1
  10. package/dist/{Group-DZrcYfeC.js → Group-Sk7Qd6G3.js} +4 -4
  11. package/dist/{Group.vue_vue_type_script_setup_true_lang-UrT9_Dv_.js → Group.vue_vue_type_script_setup_true_lang-BWpIG76a.js} +7 -7
  12. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BljvPVAz.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-DzeAE7Oj.js} +5 -5
  13. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-Cu2_U6gg.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-DWScWkMg.js} +10 -10
  14. package/dist/{Ingredient-EEsIgWLG.js → Ingredient-CA0qoRc1.js} +4 -4
  15. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-B_ItCbTf.js → InventoryBinding.vue_vue_type_script_setup_true_lang-BzLcfi4f.js} +2 -2
  16. package/dist/{LinkProductSideSheet-DwVODI1U.js → LinkProductSideSheet-TTj7qiWm.js} +3 -3
  17. package/dist/{MenuSetting-CP7Vx_cV.js → MenuSetting-DwfE7v0B.js} +9 -9
  18. package/dist/{OrderPacing-Dej0Cp3E.js → OrderPacing-cT1Vs3OD.js} +6 -6
  19. package/dist/{PageLayout.vue_vue_type_script_setup_true_lang-BFxSjqqP.js → PageLayout.vue_vue_type_script_setup_true_lang-BVmHMvKD.js} +2 -2
  20. package/dist/{PrintRoute-DOJJ82mH.js → PrintRoute-D8pc6M31.js} +5 -5
  21. package/dist/{Product-BpH2gXii.js → Product-CW1oQzS-.js} +1 -1
  22. package/dist/{Product.vue_vue_type_script_setup_true_lang-BhOdWTlM.js → Product.vue_vue_type_script_setup_true_lang-lqXctN9S.js} +12 -12
  23. package/dist/{ProductInternalTools-CjoC9z79.js → ProductInternalTools-DAIu8IhO.js} +6 -6
  24. package/dist/Products-nVL6Qsuw.js +312 -0
  25. package/dist/{Publish-D-xjezFx.js → Publish-DHEzIG_J.js} +533 -528
  26. package/dist/{Recipe-Dv38pLls.js → Recipe-BLcLaekI.js} +5 -5
  27. package/dist/{RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-CJwwJ87D.js → RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-BCHurASV.js} +1 -1
  28. package/dist/{RuleView.vue_vue_type_script_setup_true_lang-a6W_3fVO.js → RuleView.vue_vue_type_script_setup_true_lang-Dwi3pOl9.js} +2 -2
  29. package/dist/{Scheduler-DEgUjACU.js → Scheduler-C4e5hO7Z.js} +4 -4
  30. package/dist/{ServingSequence-C-XRskmz.js → ServingSequence-C12Ny_nR.js} +4 -4
  31. package/dist/{Setting-C4zIGhS4.js → Setting-BscTehhJ.js} +5 -5
  32. package/dist/{Subcategory-0e7ZQXZl.js → Subcategory-C5FGoPot.js} +6 -6
  33. package/dist/{Takeaway-BR6Jm6tq.js → Takeaway-CDSKNUhc.js} +1 -1
  34. package/dist/{Takeaway-Bk9u-h1u.js → Takeaway-Dr6WQVE1.js} +5 -5
  35. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-DXCVV-UI.js → Takeaway.vue_vue_type_script_setup_true_lang-C6eREsQp.js} +5 -5
  36. package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-BZRHb8G7.js → Thumbnail.vue_vue_type_script_setup_true_lang-CkETUziX.js} +4 -4
  37. package/dist/{TranslationFieldSection.vue_vue_type_script_setup_true_lang-BrhjUvFq.js → TranslationFieldSection.vue_vue_type_script_setup_true_lang-CcD-TGhd.js} +1 -1
  38. package/dist/{TranslationSideSheet.vue_vue_type_script_setup_true_lang-BKD-EAO3.js → TranslationSideSheet.vue_vue_type_script_setup_true_lang-DccUYmCx.js} +2 -2
  39. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-Ch5KY_XM.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-D1ov0odP.js} +937 -940
  40. package/dist/{Unit-BdV3zkYP.js → Unit-U3pz6pPm.js} +3 -3
  41. package/dist/{Variant-CtcqyPKe.js → Variant-D-nC4Dy6.js} +26 -30
  42. package/dist/{_id_-Fo7FbggZ.js → _id_-DHI7NeZ5.js} +10 -10
  43. package/dist/{app-BirB2oNz.js → app-Brq8nN4D.js} +1 -1
  44. package/dist/{app-DtMGo-8a.js → app-dIGG83GF.js} +185 -185
  45. package/dist/app.js +1 -1
  46. package/dist/apps/mf-menu/src/app.d.ts +7 -0
  47. package/dist/apps/mf-menu/src/components/member_price/MemberPriceToolTip.vue.d.ts +2 -0
  48. package/dist/apps/mf-menu/src/manager/menu/memberPricing.d.ts +4 -1
  49. package/dist/apps/mf-menu/src/stores/menu.d.ts +1 -1
  50. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  51. package/dist/assets/{linked-status-B6SJq-v-.js → linked-status-C-sgTOx9.js} +2 -2
  52. package/dist/assets/{menu-export-CwiCpw67.js → menu-export-Nt98HUsd.js} +4 -4
  53. package/dist/assets/{override-menu-Fx3w0bSY.js → override-menu-Ako9Ghu_.js} +2 -2
  54. package/dist/assets/{validate-menu-BGTp-oO7.js → validate-menu-CVJ4sdGa.js} +2 -2
  55. package/dist/{catalog-DtioUeQr.js → catalog-BDfp-HKs.js} +1 -1
  56. package/dist/{catalogSetting-BRAVGHiH.js → catalogSetting-BjZWlJux.js} +1 -1
  57. package/dist/{currency-Dntgj8R7.js → currency-BMM0v_C-.js} +1 -1
  58. package/dist/{dayjs.min-CwKTySXQ.js → dayjs.min-qRo56ggi.js} +2 -2
  59. package/dist/{index-vHMVgpgg.js → index-Dnr_KMtS.js} +25 -25
  60. package/dist/{index-b5UraR94.js → index-DwsAtSPy.js} +4 -4
  61. package/dist/{index.vue_vue_type_script_setup_true_lang-CbJ4htzZ.js → index.vue_vue_type_script_setup_true_lang-BLHrxcy_.js} +4638 -4642
  62. package/dist/{item-CAdH9ZRb.js → item-hYgXuH-R.js} +1178 -1177
  63. package/dist/{jszip.min-q5-4AKN4.js → jszip.min-BqsNpcIL.js} +3 -3
  64. package/dist/memberPricing-CXI5GqbJ.js +107 -0
  65. package/dist/{menu-CSDflKWK.js → menu-Okh_Q4gK.js} +1 -1
  66. package/dist/{menuV2-Cf_zeTsx.js → menuV2-DbTc7yw0.js} +36 -36
  67. package/dist/mf-menu.css +1 -1
  68. package/dist/{order_pacing-gM1ob6dp.js → order_pacing-CBkQIrp3.js} +5 -5
  69. package/dist/{priceTier-qp7ZHYG1.js → priceTier-BxWXhfDh.js} +1 -1
  70. package/dist/{rules-Bvgey7qo.js → rules-CsoPQCO5.js} +3 -3
  71. package/dist/{scheduler-CLvNHt4g.js → scheduler-BfvHQAuo.js} +4 -4
  72. package/dist/{toExcel-CDs_GgCA.js → toExcel-DZMykkCy.js} +2 -2
  73. package/dist/{unit-CR4GvsD0.js → unit-ro6UkV3c.js} +2 -2
  74. package/package.json +1 -1
  75. package/dist/Products-BaH1UUlM.js +0 -309
  76. package/dist/memberPricing-BK7Y-pUK.js +0 -89
@@ -1,309 +0,0 @@
1
- import { defineComponent as A, computed as m, ref as W, resolveComponent as w, createBlock as c, openBlock as l, unref as e, withCtx as f, createElementVNode as d, toDisplayString as Z, createVNode as u, createCommentVNode as M, createElementBlock as j, Fragment as L } from "vue";
2
- import { D as V } from "./dayjs.min-CwKTySXQ.js";
3
- import { J as re, F as ie } from "./jszip.min-q5-4AKN4.js";
4
- import { u as K, B as Q, z as U, D as H, y as X, A as le, G as ue, H as R, I as ce } from "./index.vue_vue_type_script_setup_true_lang-CbJ4htzZ.js";
5
- import { w as me } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-Cu2_U6gg.js";
6
- import { h as F, A as q } from "./app-DtMGo-8a.js";
7
- import { useCoreStore as ee, useI18n as de } from "@feedmepos/mf-common";
8
- import { useDialog as te, useDialogChild as pe, useSnackbar as ne, useBreakpoints as fe, FmButtonVariant as E, FmButtonColorThemeVariant as S } from "@feedmepos/ui-library";
9
- import { _ as T } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
10
- import { _ as _e, a as G } from "./BottomSheetMenuItem.vue_vue_type_script_setup_true_lang-DhrXKy3b.js";
11
- import { _ as ve } from "./PageLayout.vue_vue_type_script_setup_true_lang-BFxSjqqP.js";
12
- import { u as ge, a as be } from "./menu-CSDflKWK.js";
13
- import { u as ye } from "./item-CAdH9ZRb.js";
14
- import { _ as O, a as ke } from "./Product.vue_vue_type_script_setup_true_lang-BhOdWTlM.js";
15
- import { L as J } from "./LinkProductSideSheet-DwVODI1U.js";
16
- import { _ as xe } from "./TreeEditorOpenner.vue_vue_type_script_setup_true_lang-Ch5KY_XM.js";
17
- import { u as he } from "./Thumbnail.vue_vue_type_script_setup_true_lang-BZRHb8G7.js";
18
- import { m as Se } from "./toExcel-CDs_GgCA.js";
19
- const Me = { class: "space-y-24 mb-24" }, we = ["innerHTML"], Ce = { class: "flex justify-end gap-8" }, Fe = /* @__PURE__ */ A({
20
- __name: "ConfirmActionDialog",
21
- props: {
22
- description: {},
23
- value: {},
24
- message: { default: "To confirm your action, type <b>[[value]]</b> in the text field." }
25
- },
26
- setup($) {
27
- const n = $, y = m(() => n.message.replace("[[value]]", n.value)), x = W(""), o = te(), { emitAction: h } = pe();
28
- return (_, i) => {
29
- const v = w("FmTextField"), g = w("FmButton"), b = w("FmForm");
30
- return l(), c(b, {
31
- "on-validation-success": () => e(h)("primary"),
32
- "blame-form-child-on-validation-failed": ""
33
- }, {
34
- default: f(() => [
35
- d("div", Me, [
36
- d("div", null, Z(_.description), 1),
37
- d("div", { innerHTML: y.value }, null, 8, we),
38
- d("div", null, [
39
- u(v, {
40
- modelValue: x.value,
41
- "onUpdate:modelValue": [
42
- i[0] || (i[0] = (p) => x.value = p),
43
- i[1] || (i[1] = () => {
44
- })
45
- ],
46
- placeholder: _.value,
47
- rules: [(p) => p === _.value || "Value does not match"]
48
- }, null, 8, ["modelValue", "placeholder", "rules"])
49
- ]),
50
- d("div", Ce, [
51
- u(g, {
52
- label: "Cancel",
53
- variant: "secondary",
54
- onClick: i[2] || (i[2] = (p) => e(o).close())
55
- }),
56
- u(g, {
57
- label: "Confirm",
58
- type: "submit"
59
- })
60
- ])
61
- ])
62
- ]),
63
- _: 1
64
- }, 8, ["on-validation-success"]);
65
- };
66
- }
67
- }), $e = /* @__PURE__ */ A({
68
- __name: "Migrate",
69
- setup($) {
70
- const n = K(), y = ee(), x = ne(), { minor: o } = Q(x), h = W(!1), _ = te();
71
- async function i() {
72
- v.value || h.value || _.open({
73
- title: "Migrate to new version",
74
- contentComponent: Fe,
75
- contentComponentProps: {
76
- value: "MIGRATE",
77
- description: "Do you want to migrate to new version? Once migrate it will unable to revert to the older version."
78
- }
79
- }).onPrimary(async () => {
80
- _.close(), await o(
81
- async () => {
82
- await n.migrate(), setTimeout(() => {
83
- window.location.reload();
84
- }, 2e3);
85
- },
86
- {
87
- isLoading: h,
88
- customId: n.state.menu._id,
89
- message: "Migrating menu",
90
- successMessage: "Migration completed"
91
- }
92
- );
93
- });
94
- }
95
- const v = m(() => {
96
- const g = y.restaurants.value;
97
- if (!g.length) return "Required at least one restaurant to migrate";
98
- const b = g.filter((k) => !k.posVersion || !U.Pos.canUse({ feature: H.F_FEATURE.enum.menuV4, posVersion: k.posVersion }));
99
- return b.length ? `Upgrade POS to V${U.Pos.minVersionToUse(H.F_FEATURE.enum.menuV4)} to use new menu: ${b.map((k) => k.profile.name).join(", ")}` : null;
100
- });
101
- return m(() => v.value ? v.value : "Migrate your menu to new version to enjoy more features. Content of new menu will remain the same as current."), (g, b) => {
102
- const p = w("FmSnackbar");
103
- return !v.value && e(n).version !== e(X).enum.v4 ? (l(), c(p, {
104
- key: 0,
105
- class: "!max-w-full",
106
- title: "New version of menu is out now!",
107
- description: "Migrate your current menu version to the latest to enjoy more features such as product sequential dispatch, serving sequence, scheduler and more! Your content and current setting will be preserved.",
108
- variant: "info",
109
- action: "Migrate",
110
- "z-index": 0,
111
- onOnAction: i
112
- })) : M("", !0);
113
- };
114
- }
115
- }), Ve = "/assets/menu-export-CwiCpw67.js", Ee = { class: "flex-1 flex justify-between gap-8 pl-8" }, Te = { class: "flex items-center" }, Ae = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, Ie = { class: "fm-typo-en-body-md-600 font-semibold" }, De = { class: "flex gap-8" }, Xe = /* @__PURE__ */ A({
116
- __name: "Products",
117
- setup($) {
118
- const { t: n } = de(), y = ee(), x = Q(ne()), o = K(), h = m(() => o.rules.item), _ = ye(), i = m(() => !o.state.currentSchedulerId), { selectedCategories: v } = ge(), g = m(() => ({
119
- ...le.menuV4ToV3(ue(o.state.menu)),
120
- _id: o.state.menu._id,
121
- _rev: o.state.menu._rev
122
- })), b = m(() => {
123
- const r = R.flatten(v.value.map((t) => t.items));
124
- return R.uniqBy(r, (t) => t._id).length;
125
- });
126
- async function p(r, t) {
127
- const a = new re();
128
- for (let C = 0; C < r.length; C++)
129
- a.file(`${t[C]}.xlsx`, r[C]);
130
- const s = await a.generateAsync({ type: "blob" });
131
- ie.saveAs(s, `books_${V().format("DD-MM-YYYY_HH-mm")}.zip`);
132
- }
133
- async function k() {
134
- await x.minor(
135
- async () => {
136
- if (await o.readMenu(), o.version === X.enum.v4) {
137
- const r = o.state.menu, t = V().format("DD-MM-YYYY_HH-mm"), a = [
138
- `menu_${t}`,
139
- `addonGroup_${t}`,
140
- `itemLinkedAddon_${t}`,
141
- `translationLocalization_${t}`
142
- ], s = await ce(
143
- Ve,
144
- JSON.stringify({
145
- menu: r,
146
- attributeSettings: y.itemAttributeSettings.value,
147
- localizationKeys: o.state.featureFlags.supportedLocales
148
- })
149
- );
150
- await p(s, a);
151
- } else {
152
- const r = Se(g.value), t = `menu_${V().format("DD-MM-YYYY_HH-mm")}`;
153
- await me(r, `${t}.xlsx`, {
154
- bookType: "xlsx",
155
- bookSST: !0,
156
- type: "array",
157
- compression: !0
158
- });
159
- }
160
- },
161
- { successMessage: "Menu exported", customId: o.state.menu._id }
162
- );
163
- }
164
- const {
165
- menuItems: I,
166
- categories: D,
167
- linkItemRules: B,
168
- handleSubmit: Y,
169
- catalogManager: N,
170
- schedulerManager: z
171
- } = he(!1), oe = fe(), ae = m(() => oe.breakpoints.value.xs), se = m(() => {
172
- var a;
173
- const r = ((a = y.sessionUser.value) == null ? void 0 : a.permissions) ?? [], t = {
174
- action: F.Action.manage,
175
- subject: F.Subject.Business.menu_menuManagement
176
- };
177
- return q([t], r).granted;
178
- }), P = m(() => {
179
- var a;
180
- const r = ((a = y.sessionUser.value) == null ? void 0 : a.permissions) ?? [], t = {
181
- action: F.Action.manage,
182
- subject: F.Subject.Business.menu_importExport
183
- };
184
- return q([t], r).granted;
185
- });
186
- return be().resetOnMount(), (r, t) => {
187
- const a = w("fm-button");
188
- return l(), c(ve, {
189
- heading: e(n)("menu.products.title")
190
- }, {
191
- default: f(() => [
192
- u($e),
193
- u(ke)
194
- ]),
195
- "append-heading": f(() => [
196
- d("div", Ee, [
197
- d("div", Te, [
198
- d("div", Ae, [
199
- d("p", Ie, Z(b.value), 1)
200
- ])
201
- ]),
202
- d("div", De, [
203
- ae.value ? (l(), c(O, { key: 1 }, {
204
- default: f(({ trigger: s }) => [
205
- u(_e, null, {
206
- default: f(() => [
207
- u(G, {
208
- label: e(n)("menu.products.actions.export"),
209
- onClick: k
210
- }, null, 8, ["label"]),
211
- u(G, {
212
- label: e(n)("menu.products.actions.import"),
213
- onClick: s
214
- }, null, 8, ["label", "onClick"])
215
- ]),
216
- _: 2
217
- }, 1024)
218
- ]),
219
- _: 1
220
- })) : (l(), j(L, { key: 0 }, [
221
- se.value ? (l(), c(xe, { key: 0 }, {
222
- default: f(({ trigger: s }) => [
223
- u(a, {
224
- label: e(n)("menu.tree_editor.title"),
225
- "bg-color": e(S).NeutralGray100,
226
- "text-color": e(S).TypoSecondary,
227
- variant: e(E).Primary,
228
- onClick: s
229
- }, null, 8, ["label", "bg-color", "text-color", "variant", "onClick"])
230
- ]),
231
- _: 1
232
- })) : M("", !0),
233
- P.value ? (l(), c(a, {
234
- key: 1,
235
- "bg-color": e(S).NeutralGray100,
236
- "text-color": e(S).TypoSecondary,
237
- variant: e(E).Primary,
238
- label: e(n)("menu.products.actions.export"),
239
- onClick: k
240
- }, null, 8, ["bg-color", "text-color", "variant", "label"])) : M("", !0),
241
- P.value ? (l(), c(O, { key: 2 }, {
242
- default: f(({ trigger: s }) => [
243
- u(a, {
244
- "bg-color": e(S).NeutralGray100,
245
- "text-color": e(S).TypoSecondary,
246
- variant: e(E).Primary,
247
- label: e(n)("menu.products.actions.import"),
248
- onClick: s
249
- }, null, 8, ["bg-color", "text-color", "variant", "label", "onClick"])
250
- ]),
251
- _: 1
252
- })) : M("", !0)
253
- ], 64)),
254
- b.value > 0 ? (l(), j(L, { key: 2 }, [
255
- h.value.create ? (l(), c(T, {
256
- key: 0,
257
- label: e(n)("menu.products.actions.add"),
258
- "prepend-icon": "add",
259
- onClick: t[0] || (t[0] = (s) => e(_).create(null))
260
- }, null, 8, ["label"])) : i.value ? (l(), c(J, {
261
- key: 1,
262
- "categorized-items": e(N).linkableItems.value,
263
- "initial-value": e(N).currentItems.value,
264
- "show-variant": !1,
265
- "menu-items": e(I),
266
- categories: e(D),
267
- "link-item-rules": e(B),
268
- "no-scheduler": i.value,
269
- onSubmit: e(Y)
270
- }, {
271
- default: f(({ trigger: s }) => [
272
- u(T, {
273
- label: e(n)("menu.products.actions.link"),
274
- "prepend-icon": "link",
275
- onClick: s
276
- }, null, 8, ["label", "onClick"])
277
- ]),
278
- _: 1
279
- }, 8, ["categorized-items", "initial-value", "menu-items", "categories", "link-item-rules", "no-scheduler", "onSubmit"])) : (l(), c(J, {
280
- key: 2,
281
- "categorized-items": e(z).linkableItems.value,
282
- "initial-value": e(z).currentItems.value,
283
- "show-variant": !1,
284
- "menu-items": e(I),
285
- categories: e(D),
286
- "link-item-rules": e(B),
287
- "no-scheduler": i.value,
288
- onSubmit: e(Y)
289
- }, {
290
- default: f(({ trigger: s }) => [
291
- u(T, {
292
- label: e(n)("menu.products.actions.apply_scheduler"),
293
- onClick: s
294
- }, null, 8, ["label", "onClick"])
295
- ]),
296
- _: 1
297
- }, 8, ["categorized-items", "initial-value", "menu-items", "categories", "link-item-rules", "no-scheduler", "onSubmit"]))
298
- ], 64)) : M("", !0)
299
- ])
300
- ])
301
- ]),
302
- _: 1
303
- }, 8, ["heading"]);
304
- };
305
- }
306
- });
307
- export {
308
- Xe as default
309
- };
@@ -1,89 +0,0 @@
1
- import { defineComponent as p, ref as d, watch as S, resolveComponent as _, createBlock as b, openBlock as f, unref as T, computed as h } from "vue";
2
- import { useI18n as c } from "@feedmepos/mf-common";
3
- import { useDialogChild as w, useDialog as M, useSnackbar as x } from "@feedmepos/ui-library";
4
- import { u as y, B as C } from "./index.vue_vue_type_script_setup_true_lang-CbJ4htzZ.js";
5
- const V = /* @__PURE__ */ p({
6
- __name: "AddMemberPricingDialog",
7
- setup(l) {
8
- const { t } = c(), n = d(""), { emitData: e } = w();
9
- return S(n, () => {
10
- e(n.value);
11
- }), (s, o) => {
12
- const i = _("FmTextField");
13
- return f(), b(i, {
14
- label: T(t)("menu.member_pricing.name_title"),
15
- modelValue: n.value,
16
- "onUpdate:modelValue": o[0] || (o[0] = (r) => n.value = r)
17
- }, null, 8, ["label", "modelValue"]);
18
- };
19
- }
20
- }), D = (l) => {
21
- const { t } = c(), n = M(), e = y(), s = x(), o = C(s), i = h(() => Object.values(e.state.menu.priceVariantSettings || {}));
22
- function r() {
23
- n.open({
24
- title: t("menu.member_pricing.title"),
25
- contentComponent: V,
26
- primaryActions: {
27
- text: t("common.create"),
28
- close: !1
29
- },
30
- secondaryActions: {
31
- text: t("common.cancel"),
32
- close: !0
33
- }
34
- }).onPrimary(async (a) => {
35
- a && await o.minor(
36
- async () => {
37
- await e.updateMenuSetting({
38
- lowStockThreshold: e.state.menu.lowStockThreshold,
39
- masterCatalogSetting: e.state.menu.masterCatalogSetting,
40
- priceTierSettings: e.state.menu.priceTierSettings,
41
- priceVariantSettings: [...e.state.menu.priceVariantSettings || [], { key: a }]
42
- }), n.close();
43
- },
44
- {
45
- successMessage: t("menu.member_pricing.add_member_tier_success", { name: a })
46
- }
47
- );
48
- });
49
- }
50
- function u(a) {
51
- n.open({
52
- title: t("menu.member_pricing.delete_dialog.title"),
53
- message: t("menu.member_pricing.delete_dialog.message", { name: a }),
54
- primaryActions: {
55
- text: t("menu.common.actions.remove"),
56
- close: !1
57
- },
58
- secondaryActions: {
59
- text: t("menu.common.actions.cancel"),
60
- close: !0
61
- }
62
- }).onPrimary(async () => {
63
- await o.minor(
64
- async () => {
65
- var m;
66
- await e.updateMenuSetting({
67
- lowStockThreshold: e.state.menu.lowStockThreshold,
68
- masterCatalogSetting: e.state.menu.masterCatalogSetting,
69
- priceTierSettings: e.state.menu.priceTierSettings,
70
- priceVariantSettings: (m = e.state.menu.priceVariantSettings) == null ? void 0 : m.filter(
71
- (g) => g.key !== a
72
- )
73
- }), n.close();
74
- },
75
- {
76
- successMessage: t("menu.member_pricing.delete_dialog.success")
77
- }
78
- );
79
- });
80
- }
81
- return {
82
- create: r,
83
- deleteMemberPricings: u,
84
- memberPricings: i
85
- };
86
- };
87
- export {
88
- D as u
89
- };