@feedmepos/mf-menu 1.0.1-dev.1 → 1.0.1-dev.2

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 (62) hide show
  1. package/dist/{App-CXamBqwS.js → App-CdIN4s5n.js} +5 -4
  2. package/dist/{BindingTable.vue_vue_type_script_setup_true_lang-DzNuoUmQ.js → BindingTable.vue_vue_type_script_setup_true_lang-CoHlJwpz.js} +1 -1
  3. package/dist/{Catalog-BHb5ZB6_.js → Catalog-DjAubC9s.js} +4 -4
  4. package/dist/{CatalogBinding-X-AHRvcJ.js → CatalogBinding-5JNRTbyZ.js} +3 -3
  5. package/dist/{CatalogEditTabs.vue_vue_type_script_setup_true_lang-NFeJpXLh.js → CatalogEditTabs.vue_vue_type_script_setup_true_lang-BorOjk1k.js} +3 -3
  6. package/dist/{CatalogEditor.vue_vue_type_script_setup_true_lang-CrrkUkfD.js → CatalogEditor.vue_vue_type_script_setup_true_lang-CkF7O_V-.js} +6 -6
  7. package/dist/{CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-C43Ettr2.js → CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-3fL43MuR.js} +3 -3
  8. package/dist/{Category-DsTyhvYK.js → Category-BbiN4hd7.js} +5 -5
  9. package/dist/{Category-MXhBgKnb.js → Category-COug7fz8.js} +2 -2
  10. package/dist/{CategoryList.vue_vue_type_script_setup_true_lang-BJTKjE25.js → CategoryList.vue_vue_type_script_setup_true_lang-B_9aPMIN.js} +4 -4
  11. package/dist/{CookingGuide-yBqMRWrs.js → CookingGuide-Dg7kuF6l.js} +4 -4
  12. package/dist/{Group-CMKmmN3C.js → Group-BRpmTqyT.js} +5 -5
  13. package/dist/{Group-DINfX6Wn.js → Group-C-hwlkgJ.js} +2 -2
  14. package/dist/{GroupList.vue_vue_type_script_setup_true_lang-BEBZmPdu.js → GroupList.vue_vue_type_script_setup_true_lang-DowoJ3WM.js} +5 -5
  15. package/dist/{Ingredient-BNQ2LIqN.js → Ingredient-BQYnARdC.js} +3 -3
  16. package/dist/LinkProductSideSheet.vue_vue_type_script_setup_true_lang-CgTDkHle.js +707 -0
  17. package/dist/{MenuSetting-DARGZW4u.js → MenuSetting-DsdM2_OW.js} +546 -513
  18. package/dist/{OrderPacing-DuGDpSLN.js → OrderPacing-5x2YH-_l.js} +4 -4
  19. package/dist/{OrderPacingFields.vue_vue_type_script_setup_true_lang-2V1SiXyH.js → OrderPacingFields.vue_vue_type_script_setup_true_lang-DVGJjpiM.js} +1 -1
  20. package/dist/Preview-AdgGTYlQ.js +321 -0
  21. package/dist/{PriceTierNotice.vue_vue_type_script_setup_true_lang-hbG9eqTr.js → PriceTierNotice.vue_vue_type_script_setup_true_lang-vmxVZ2ya.js} +1 -1
  22. package/dist/{PrintRoute-N0gXx2Wx.js → PrintRoute-COkCv4gf.js} +3 -3
  23. package/dist/{Product-Cp2dYxav.js → Product-BJFb_J4h.js} +4 -4
  24. package/dist/{ProductEditorHost.vue_vue_type_script_setup_true_lang-imCNnKvi.js → ProductEditorHost.vue_vue_type_script_setup_true_lang-Tpp8MBYS.js} +2 -2
  25. package/dist/{ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-BqZ2jz39.js → ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-C25Pwqme.js} +3 -3
  26. package/dist/{ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-KrQJLxU2.js → ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-BMAtAK9D.js} +1 -1
  27. package/dist/{ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-i0smKuFw.js → ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-Dl4Zr5tx.js} +10 -10
  28. package/dist/{ProductInternalTools-CJG8TsE4.js → ProductInternalTools-thlSvqbA.js} +2 -2
  29. package/dist/{ProductInventoryDialog-DmN4sXP_.js → ProductInventoryDialog-C3ruRWU5.js} +1 -1
  30. package/dist/{ProductInventoryDialog.vue_vue_type_script_setup_true_lang-UOIkIylV.js → ProductInventoryDialog.vue_vue_type_script_setup_true_lang-MpdIixqI.js} +1 -1
  31. package/dist/{ProductList.vue_vue_type_script_setup_true_lang-C262_Dsq.js → ProductList.vue_vue_type_script_setup_true_lang-9_ohgfqE.js} +8 -8
  32. package/dist/{ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-wTwunTLr.js → ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-Ctbz-8cd.js} +1 -1
  33. package/dist/{Products-BSthFwvC.js → Products-DMrjQFfu.js} +3 -3
  34. package/dist/{Publish-BcUXfV7Z.js → Publish-f6g0dIao.js} +3 -3
  35. package/dist/{Recipe-Nhmop5G3.js → Recipe-p-wxadSN.js} +3 -3
  36. package/dist/{Scheduler-DEMpmXNY.js → Scheduler-CtebRafn.js} +3 -3
  37. package/dist/{ServingSequence-Dkd70bsy.js → ServingSequence-CEd4ywOQ.js} +2 -2
  38. package/dist/{Setting-LWEFUdQK.js → Setting-bPKadRu-.js} +6 -6
  39. package/dist/{Subcategory-YvAbjlgi.js → Subcategory-DBCnIP0b.js} +2 -2
  40. package/dist/{Takeaway-CoK-aka9.js → Takeaway-GNRHR5kN.js} +2 -2
  41. package/dist/{Takeaway-DUoXWAQT.js → Takeaway-VBkdW1DM.js} +5 -5
  42. package/dist/{TakeawayList.vue_vue_type_script_setup_true_lang-D4xu-gHa.js → TakeawayList.vue_vue_type_script_setup_true_lang-DvX3k0Jg.js} +3 -3
  43. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-1iGMM-Xt.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-D1qaEVUu.js} +6 -6
  44. package/dist/{Unit-BIoPBeiP.js → Unit-DbGKIprZ.js} +2 -2
  45. package/dist/{Variant-X4llcQO6.js → Variant-_edSAKif.js} +3 -3
  46. package/dist/{_id_-gKOWPBVp.js → _id_-BNVtBV3q.js} +3 -3
  47. package/dist/{app-DUyvBFfY.js → app-BlTv5xag.js} +137 -114
  48. package/dist/app.js +1 -1
  49. package/dist/apps/mf-menu/src/app.d.ts +360 -0
  50. package/dist/apps/mf-menu/src/components/preview/MenuPreview.vue.d.ts +13 -0
  51. package/dist/apps/mf-menu/src/components/preview/simulatorPort.d.ts +23 -0
  52. package/dist/apps/mf-menu/src/router/shared.d.ts +1 -0
  53. package/dist/apps/mf-menu/src/utils/ruleValueKey.d.ts +12 -0
  54. package/dist/apps/mf-menu/src/views/Preview/Preview.vue.d.ts +2 -0
  55. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  56. package/dist/assets/{menu-compute--bTrGqr1.js → menu-compute-BzchkTYh.js} +36 -36
  57. package/dist/assets/{validate-menu-mv20U_e_.js → validate-menu-CTV_cJNG.js} +4 -4
  58. package/dist/{provide-CxmHxIEV.js → provide-dbE6Qt1z.js} +35458 -34831
  59. package/dist/ruleValueKey-BF52PuHb.js +10 -0
  60. package/dist/{useActionFeedback-Di6FGqLG.js → useActionFeedback-CdY_C_HX.js} +1 -1
  61. package/package.json +1 -1
  62. package/dist/LinkProductSideSheet.vue_vue_type_script_setup_true_lang-B8n517dM.js +0 -671
@@ -0,0 +1,707 @@
1
+ import { defineComponent as xe, ref as L, computed as h, watch as le, resolveComponent as S, openBlock as m, createBlock as R, unref as a, withCtx as k, createElementBlock as y, createVNode as r, createElementVNode as i, toDisplayString as b, createCommentVNode as z, withModifiers as Y, Fragment as q, renderList as W, withDirectives as Le } from "vue";
2
+ import { d as Ie } from "./FormSection.vue_vue_type_script_setup_true_lang-pY-_msnM.js";
3
+ import { useI18n as Oe, ItemSelector as Ee } from "@feedmepos/mf-common";
4
+ import { components as Ne } from "@feedmepos/ui-library";
5
+ import { r as Pe } from "./provide-dbE6Qt1z.js";
6
+ import { r as Ae, a as te } from "./ruleValueKey-BF52PuHb.js";
7
+ import { _ as Ue } from "./index.vue_vue_type_script_setup_true_lang-CGPDazqs.js";
8
+ const je = {
9
+ ALL: "menu.order.from.options.all",
10
+ POS_ONLY: "menu.order.from.options.pos_only",
11
+ NONE: "menu.order.from.options.none"
12
+ }, kl = {
13
+ NORMAL: "menu.group.list.types.normal",
14
+ PRODUCT: "menu.group.list.types.product",
15
+ DYNAMIC: "menu.group.list.types.dynamic"
16
+ }, hl = {
17
+ ALL: "menu.product.table.availability.all",
18
+ POS_ONLY: "menu.product.table.availability.pos_only",
19
+ NONE: "menu.product.table.availability.none"
20
+ }, ze = { class: "fm-typo-en-title-md-600 mr-auto" }, Ge = {
21
+ key: 0,
22
+ class: "py-8 px-8 overflow-y-auto"
23
+ }, Be = {
24
+ key: 1,
25
+ class: "p-8 overflow-y-auto flex flex-col gap-16"
26
+ }, Me = { class: "relative top-0 -mb-8 leading-6 tracking-normal fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, $e = {
27
+ key: 0,
28
+ class: "text-fm-color-typo-error",
29
+ role: "alert"
30
+ }, De = { class: "flex flex-col gap-8" }, Ke = { class: "border border-fm-color-neutral-gray-200 rounded-md p-16" }, Te = { class: "flex items-center justify-between gap-8" }, Ye = { class: "flex items-center gap-8 min-w-0" }, qe = { class: "text-fm-color-neutral-gray-300" }, We = { class: "flex gap-8" }, He = { class: "flex flex-col gap-8 mt-8" }, Je = { class: "fm-typo-en-body-lg-600" }, Qe = { class: "flex gap-8" }, Xe = { class: "fm-typo-en-body-lg-600" }, Ze = {
31
+ key: 0,
32
+ class: "text-fm-color-neutral-gray-300 pl-16"
33
+ }, el = { class: "flex items-center gap-24" }, ll = { class: "fm-typo-en-headline-lg-600" }, tl = { class: "overflow-y-auto" }, ol = { class: "mt-24 flex flex-col gap-16" }, al = { class: "text-fm-color-typo-primary fm-typo-en-body-lg-600" }, nl = { class: "mt-24 flex flex-col gap-16" }, ul = { class: "link-product-rule-editor-sheet-marker fm-typo-en-body-lg-600" }, sl = { class: "flex w-full justify-between gap-16" }, rl = {
34
+ key: 0,
35
+ class: "flex w-full [&>*]:w-full"
36
+ }, il = { class: "break-all fm-typo-en-body-lg-400 line-clamp-1" }, dl = { class: "flex w-full items-center justify-end gap-16" }, cl = {
37
+ key: 0,
38
+ class: "flex gap-8 items-center justify-start"
39
+ }, ml = {
40
+ key: 1,
41
+ class: "flex gap-8 items-center justify-start"
42
+ }, Sl = /* @__PURE__ */ xe({
43
+ __name: "LinkProductSideSheet",
44
+ props: {
45
+ modelValue: { type: Boolean },
46
+ catalogue: {},
47
+ selectedProductIds: { default: () => [] },
48
+ selectedProducts: { default: void 0 },
49
+ selectVariant: { type: Boolean, default: !1 },
50
+ title: {},
51
+ rulesSession: { default: null },
52
+ rulesView: { default: null },
53
+ selectionSession: { default: null }
54
+ },
55
+ emits: ["update:modelValue", "submit", "submitLinks", "submit-rules"],
56
+ setup(oe, { emit: ae }) {
57
+ const u = oe, I = ae, { t: o } = Oe(), ne = {
58
+ mounted: (e, l) => {
59
+ var t;
60
+ (t = e.querySelector("input")) == null || t.setAttribute("aria-label", l.value);
61
+ },
62
+ updated: (e, l) => {
63
+ var t;
64
+ (t = e.querySelector("input")) == null || t.setAttribute("aria-label", l.value);
65
+ }
66
+ }, w = L("normal"), C = L(null), P = L([]), A = L([]), H = [
67
+ { value: "in", label: "menu.rule_groups.condition_view.operator.in" },
68
+ {
69
+ value: "notIn",
70
+ label: "menu.rule_groups.condition_view.operator.not_in"
71
+ },
72
+ {
73
+ value: "startsWith",
74
+ label: "menu.rule_groups.condition_view.operator.starts_with"
75
+ }
76
+ ], g = h(() => u.rulesView ?? null), G = h(
77
+ () => {
78
+ var e;
79
+ return !!u.rulesSession && ((e = g.value) == null ? void 0 : e.rulesCapability.state) === "allowed";
80
+ }
81
+ ), O = h(() => {
82
+ var e;
83
+ return ((e = g.value) == null ? void 0 : e.rules) ?? [];
84
+ }), J = h(() => C.value !== null), ue = h(
85
+ () => H.map((e) => ({ label: o(e.label), value: e.value }))
86
+ );
87
+ function se() {
88
+ var e;
89
+ return (((e = g.value) == null ? void 0 : e.attributeOptions) ?? []).map((l) => ({
90
+ label: o(l.label, l.labelParams ?? {}),
91
+ value: l.key
92
+ }));
93
+ }
94
+ function re(e) {
95
+ var l, t;
96
+ return (((t = (l = g.value) == null ? void 0 : l.attributeOptions.find(
97
+ (n) => n.key === e.attribute
98
+ )) == null ? void 0 : t.values) ?? []).map((n) => ({
99
+ label: n.value === null ? o("menu.link_product.rules.addon") : n.label,
100
+ // FmSelect needs a primitive; a value travels as its key.
101
+ value: te(n.value)
102
+ }));
103
+ }
104
+ function ie(e) {
105
+ var t;
106
+ const l = (t = g.value) == null ? void 0 : t.attributeOptions.find(
107
+ (n) => n.key === e.attribute
108
+ );
109
+ return e.values.map((n) => {
110
+ const p = l == null ? void 0 : l.values.find(
111
+ (K) => K.value === n
112
+ );
113
+ return (p == null ? void 0 : p.value) === null ? o("menu.link_product.rules.addon") : (p == null ? void 0 : p.label) ?? String(n);
114
+ }).join(o("menu.link_product.rules.value_separator"));
115
+ }
116
+ function de(e, l) {
117
+ return e.values[l] === null ? o("menu.link_product.rules.addon") : e.valueLabels[l] ?? "";
118
+ }
119
+ function ce(e) {
120
+ return e.values.map(
121
+ (l, t) => de(e, t)
122
+ ).join(o("menu.link_product.rules.value_separator"));
123
+ }
124
+ function B(e) {
125
+ const l = u.rulesSession;
126
+ if (!l) return;
127
+ const t = (e == null ? void 0 : e.id) ?? l.addRule();
128
+ t && l.openRuleEditor(t) && (A.value = [], C.value = t);
129
+ }
130
+ function E() {
131
+ var e;
132
+ (e = u.rulesSession) == null || e.closeRuleEditor(), C.value = null, A.value = [];
133
+ }
134
+ function me() {
135
+ const e = C.value, l = u.rulesSession;
136
+ if (!e || !l) return;
137
+ const t = l.saveRuleEditor();
138
+ t.kind === "accepted" ? E() : t.kind === "rejected" && (A.value = t.issues);
139
+ }
140
+ const M = L(""), Q = h(
141
+ () => {
142
+ var e;
143
+ return ((e = x.value) == null ? void 0 : e.ruleGroupIds) ?? [];
144
+ }
145
+ ), pe = h(() => {
146
+ var t;
147
+ const e = ((t = g.value) == null ? void 0 : t.ruleGroupOptions) ?? [], l = M.value.trim().toLowerCase();
148
+ return l ? e.filter(
149
+ (n) => n.name.toLowerCase().includes(l)
150
+ ) : e;
151
+ });
152
+ function _e(e) {
153
+ const l = u.rulesSession;
154
+ if (!l) return;
155
+ const t = Q.value;
156
+ l.setRuleEditorGroupIds(
157
+ t.includes(e) ? t.filter((n) => n !== e) : [...t, e]
158
+ );
159
+ }
160
+ function F(e, l) {
161
+ var n;
162
+ return ((n = x.value) != null && n.issues.length ? x.value.issues : A.value).find((p) => p.field === `conditions.${e}.${l}`) ?? null;
163
+ }
164
+ function U(e) {
165
+ return e ? o(e.code) : "";
166
+ }
167
+ function ve(e) {
168
+ var t;
169
+ const l = (t = u.rulesSession) == null ? void 0 : t.reorderRules(e.map((n) => n.id));
170
+ P.value = (l == null ? void 0 : l.kind) === "rejected" ? l.issues : [];
171
+ }
172
+ function be(e) {
173
+ var t;
174
+ const l = (t = u.rulesSession) == null ? void 0 : t.duplicateRule(e);
175
+ P.value = (l == null ? void 0 : l.kind) === "rejected" ? l.issues : [];
176
+ }
177
+ function fe(e) {
178
+ return o(je[e]);
179
+ }
180
+ function N(e) {
181
+ return o("menu.link_product.rules.rule_number", { index: e + 1 });
182
+ }
183
+ function V(e) {
184
+ return o("menu.link_product.rules.condition_number", { index: e + 1 });
185
+ }
186
+ function ye(e) {
187
+ var l;
188
+ (l = u.rulesSession) == null || l.removeRuleEditorCondition(e);
189
+ }
190
+ function ge() {
191
+ var e;
192
+ (e = u.rulesSession) == null || e.addRuleEditorCondition();
193
+ }
194
+ function ke() {
195
+ I("submit-rules");
196
+ }
197
+ function X() {
198
+ return u.selectedProducts ?? u.selectedProductIds.map((e) => ({ itemId: e }));
199
+ }
200
+ function Z(e) {
201
+ const l = {};
202
+ for (const t of e) {
203
+ const n = l[t.itemId] ?? [];
204
+ n.push(
205
+ t.combinationKey ? { _id: t.itemId, combinationKey: t.combinationKey } : { _id: t.itemId }
206
+ ), l[t.itemId] = n;
207
+ }
208
+ return l;
209
+ }
210
+ const j = L(Z(X()));
211
+ function he(e) {
212
+ j.value = e, u.selectionSession && u.selectionSession.setSelectedProductIds([
213
+ ...new Set(
214
+ Object.values(e).flat().map((l) => l._id)
215
+ )
216
+ ]);
217
+ }
218
+ le(
219
+ () => u.modelValue,
220
+ (e) => {
221
+ var l;
222
+ if (e) {
223
+ const t = (l = u.selectionSession) == null ? void 0 : l.get(), n = (t == null ? void 0 : t.status) === "ready" ? t.value.selectedProductIds : void 0;
224
+ j.value = Z(
225
+ n ? n.map((p) => ({ itemId: p })) : X()
226
+ ), w.value = G.value && O.value.length > 0 ? "rules" : "normal";
227
+ } else
228
+ E();
229
+ }
230
+ ), le(O, (e) => {
231
+ u.modelValue && G.value && e.length > 0 && C.value === null && w.value === "normal" && (w.value = "rules");
232
+ });
233
+ const $ = h(() => Object.values(j.value).flat()), x = h(() => {
234
+ var l, t;
235
+ if ((l = g.value) != null && l.editor) return g.value.editor;
236
+ const e = (t = g.value) == null ? void 0 : t.rules.find(
237
+ (n) => n.id === C.value
238
+ );
239
+ return e ? {
240
+ ruleId: e.id,
241
+ mode: "update",
242
+ orderFrom: e.orderFrom,
243
+ ruleGroupIds: e.ruleGroupIds,
244
+ conditions: e.conditions.map((n) => ({
245
+ attribute: n.attribute,
246
+ operator: n.operator,
247
+ values: n.values
248
+ })),
249
+ issues: []
250
+ } : null;
251
+ }), Se = h(
252
+ () => {
253
+ var e;
254
+ return (((e = u.catalogue) == null ? void 0 : e.groups) ?? []).map((l) => ({
255
+ id: l.id,
256
+ name: l.isSynthetic ? o("menu.tree_editor.labels.addon") : l.name,
257
+ items: l.products.map((t) => ({
258
+ _id: t.id,
259
+ name: t.name,
260
+ code: t.code,
261
+ codeName: t.label,
262
+ // `ItemSelector` reads combinations off `variant.variantCombinations`
263
+ // and labels them by `codeName` (mf-common ItemSelector.vue:83-107); it
264
+ // only maps them when `selectVariant` is on, so this is inert for the
265
+ // hosts that link whole products.
266
+ variant: {
267
+ variantCombinations: t.variants.map((n) => ({
268
+ combinationKey: n.combinationKey,
269
+ codeName: n.label
270
+ }))
271
+ },
272
+ customAttributes: t.customAttributes
273
+ }))
274
+ }));
275
+ }
276
+ );
277
+ function D() {
278
+ I("update:modelValue", !1);
279
+ }
280
+ function we() {
281
+ u.selectedProducts !== void 0 ? I(
282
+ "submitLinks",
283
+ $.value.map(
284
+ (e) => e.combinationKey ? { itemId: e._id, combinationKey: e.combinationKey } : { itemId: e._id }
285
+ )
286
+ ) : I(
287
+ "submit",
288
+ $.value.map((e) => e._id)
289
+ );
290
+ }
291
+ return (e, l) => {
292
+ const t = S("FmButton"), n = S("FmSwitch"), p = S("FmRadio"), K = S("FmRadioGroup"), Re = S("FmSearch"), Ce = S("FmMenuItem"), Fe = S("FmMenu"), T = S("FmSelect"), Ve = S("FmTextField"), ee = S("FmSideSheet");
293
+ return m(), R(ee, {
294
+ "close-button": !1,
295
+ "is-container": a(Ne).FmForm,
296
+ "is-container-props": {
297
+ onValidationSuccess: w.value === "normal" ? we : ke
298
+ },
299
+ "max-width": 760,
300
+ "model-value": u.modelValue,
301
+ "z-index": 100,
302
+ "onUpdate:modelValue": l[4] || (l[4] = (c) => I("update:modelValue", c))
303
+ }, {
304
+ "side-sheet-header": k(() => [
305
+ r(t, {
306
+ "aria-label": a(o)("menu.common.actions.back"),
307
+ class: "cursor-pointer mr-4",
308
+ "prepend-icon": "arrow_back",
309
+ variant: "tertiary",
310
+ onClick: D
311
+ }, null, 8, ["aria-label"]),
312
+ i("p", ze, b(u.title ?? a(o)("menu.link_product.title")), 1),
313
+ G.value ? (m(), R(n, {
314
+ key: 0,
315
+ "model-value": w.value === "rules",
316
+ label: a(o)("menu.link_product.rules.section_title"),
317
+ "onUpdate:modelValue": l[0] || (l[0] = (c) => w.value = c ? "rules" : "normal")
318
+ }, null, 8, ["model-value", "label"])) : z("", !0)
319
+ ]),
320
+ "side-sheet-footer": k(() => {
321
+ var c, f;
322
+ return [
323
+ w.value === "normal" ? (m(), y("div", cl, [
324
+ r(t, {
325
+ label: a(o)("menu.common.actions.confirm"),
326
+ size: "lg",
327
+ type: "submit",
328
+ variant: "primary"
329
+ }, null, 8, ["label"]),
330
+ r(t, {
331
+ label: a(o)("menu.common.actions.cancel"),
332
+ size: "lg",
333
+ variant: "tertiary",
334
+ onClick: D
335
+ }, null, 8, ["label"])
336
+ ])) : (m(), y("div", ml, [
337
+ r(t, {
338
+ label: a(o)("menu.common.actions.confirm"),
339
+ size: "lg",
340
+ variant: "primary",
341
+ disabled: ((c = g.value) == null ? void 0 : c.submit.state) !== "allowed",
342
+ loading: ((f = g.value) == null ? void 0 : f.status) === "submitting",
343
+ type: "submit"
344
+ }, null, 8, ["label", "disabled", "loading"]),
345
+ r(t, {
346
+ label: a(o)("common.cancel"),
347
+ size: "lg",
348
+ variant: "tertiary",
349
+ onClick: D
350
+ }, null, 8, ["label"])
351
+ ]))
352
+ ];
353
+ }),
354
+ default: k(() => [
355
+ w.value === "normal" ? (m(), y("div", Ge, [
356
+ r(a(Ee), {
357
+ "auto-focus-search": !0,
358
+ "categorized-items": Se.value,
359
+ data: j.value,
360
+ "select-variant": u.selectVariant,
361
+ "selected-items": $.value,
362
+ "show-addon": !0,
363
+ "show-variant": u.selectVariant,
364
+ "onUpdate:data": he
365
+ }, null, 8, ["categorized-items", "data", "select-variant", "selected-items", "show-variant"])
366
+ ])) : (m(), y("div", Be, [
367
+ i("p", Me, b(a(o)("menu.link_product.rules.hint")), 1),
368
+ P.value.length > 0 ? (m(), y("p", $e, b(U(P.value[0] ?? null)), 1)) : z("", !0),
369
+ r(a(Ie), {
370
+ "model-value": [...O.value],
371
+ "item-key": "id",
372
+ handle: ".link-product-rule-drag-handle",
373
+ class: "flex flex-col gap-8",
374
+ "onUpdate:modelValue": ve
375
+ }, {
376
+ item: k(({ element: c, index: f }) => [
377
+ i("div", De, [
378
+ i("div", Ke, [
379
+ i("div", Te, [
380
+ i("div", Ye, [
381
+ r(t, {
382
+ class: "link-product-rule-drag-handle cursor-grab",
383
+ variant: "tertiary",
384
+ "prepend-icon": "drag_indicator",
385
+ "aria-label": a(o)("menu.common.labels.a11y_labelled_name", {
386
+ label: a(o)("menu.menu_setting.rule_groups.reorder_rule"),
387
+ name: N(f)
388
+ })
389
+ }, null, 8, ["aria-label"]),
390
+ i("p", qe, b(N(f)), 1)
391
+ ]),
392
+ i("div", We, [
393
+ r(t, {
394
+ variant: "tertiary",
395
+ "prepend-icon": "edit",
396
+ "aria-label": a(o)("menu.common.labels.a11y_labelled_name", {
397
+ label: a(o)("menu.link_product.rules.edit_rule"),
398
+ name: N(f)
399
+ }),
400
+ onClick: Y((d) => B(c), ["stop"])
401
+ }, null, 8, ["aria-label", "onClick"]),
402
+ r(t, {
403
+ variant: "tertiary",
404
+ "prepend-icon": "file_copy",
405
+ "aria-label": a(o)("menu.common.labels.a11y_labelled_name", {
406
+ label: a(o)("menu.menu_setting.rule_groups.copy_rule"),
407
+ name: N(f)
408
+ }),
409
+ onClick: Y((d) => be(c.id), ["stop"])
410
+ }, null, 8, ["aria-label", "onClick"]),
411
+ r(t, {
412
+ variant: "tertiary",
413
+ "prepend-icon": "delete",
414
+ "text-color": "typo-error",
415
+ "aria-label": a(o)("menu.common.labels.a11y_labelled_name", {
416
+ label: a(o)("menu.menu_setting.rule_groups.remove_rule"),
417
+ name: N(f)
418
+ }),
419
+ onClick: Y((d) => {
420
+ var s;
421
+ return (s = u.rulesSession) == null ? void 0 : s.removeRule(c.id);
422
+ }, ["stop"])
423
+ }, null, 8, ["aria-label", "onClick"])
424
+ ])
425
+ ]),
426
+ i("div", He, [
427
+ i("div", Je, b(a(o)("menu.rule_groups.condition_view.when")), 1),
428
+ (m(!0), y(q, null, W(c.conditions, (d, s) => {
429
+ var _;
430
+ return m(), y("div", {
431
+ key: `${c.id}-${s}`,
432
+ class: "flex gap-8"
433
+ }, [
434
+ i("span", null, b(a(o)("menu.link_product.rules.condition_summary", {
435
+ condition: V(s),
436
+ attribute: a(o)(
437
+ d.attributeLabel,
438
+ d.attributeLabelParams ?? {}
439
+ ),
440
+ operator: a(o)(
441
+ ((_ = H.find(
442
+ (v) => v.value === d.operator
443
+ )) == null ? void 0 : _.label) ?? ""
444
+ ),
445
+ value: ce(d)
446
+ })), 1)
447
+ ]);
448
+ }), 128)),
449
+ i("div", Qe, [
450
+ i("span", Xe, b(a(o)("menu.rule_groups.condition_view.then")), 1),
451
+ i("span", null, b(a(o)("menu.link_product.rules.order_from_summary", {
452
+ label: a(o)("menu.link_product.rules.order_from"),
453
+ value: fe(c.orderFrom)
454
+ })), 1)
455
+ ])
456
+ ])
457
+ ]),
458
+ f < O.value.length - 1 ? (m(), y("div", Ze, b(a(o)("menu.link_product.rules.or")), 1)) : z("", !0)
459
+ ])
460
+ ]),
461
+ _: 1
462
+ }, 8, ["model-value"]),
463
+ O.value.length === 0 ? (m(), R(a(Ue), {
464
+ key: 1,
465
+ title: a(o)("menu.rule_groups.condition_view.empty_data.no_rules_added"),
466
+ subtitle: a(o)("menu.rule_groups.condition_view.empty_data.subtitle"),
467
+ action: {
468
+ text: a(o)("menu.link_product.rules.add_rule"),
469
+ callback: () => B()
470
+ }
471
+ }, null, 8, ["title", "subtitle", "action"])) : (m(), R(t, {
472
+ key: 2,
473
+ variant: "primary",
474
+ "prepend-icon": "add",
475
+ label: a(o)("menu.link_product.rules.add_rule"),
476
+ onClick: l[1] || (l[1] = (c) => B())
477
+ }, null, 8, ["label"]))
478
+ ])),
479
+ J.value ? (m(), R(ee, {
480
+ key: 2,
481
+ "model-value": J.value,
482
+ "max-width": 760,
483
+ "z-index": 101,
484
+ "close-button": !1,
485
+ "onUpdate:modelValue": E
486
+ }, {
487
+ "side-sheet-header": k(() => {
488
+ var c;
489
+ return [
490
+ i("div", el, [
491
+ r(t, {
492
+ variant: "tertiary",
493
+ "prepend-icon": "arrow_back",
494
+ "aria-label": a(o)("menu.common.actions.back"),
495
+ onClick: E
496
+ }, null, 8, ["aria-label"]),
497
+ i("p", ll, b(a(o)(
498
+ ((c = x.value) == null ? void 0 : c.mode) === "create" ? "menu.link_product.rules.add_rule" : "menu.link_product.rules.edit_rule"
499
+ )), 1)
500
+ ])
501
+ ];
502
+ }),
503
+ "side-sheet-footer": k(() => [
504
+ i("div", dl, [
505
+ r(t, {
506
+ label: a(o)("common.cancel"),
507
+ variant: "secondary",
508
+ onClick: E
509
+ }, null, 8, ["label"]),
510
+ r(t, {
511
+ label: a(o)("common.save"),
512
+ variant: "primary",
513
+ onClick: me
514
+ }, null, 8, ["label"])
515
+ ])
516
+ ]),
517
+ default: k(() => {
518
+ var c, f;
519
+ return [
520
+ i("div", tl, [
521
+ r(K, {
522
+ "model-value": ((c = x.value) == null ? void 0 : c.orderFrom) ?? "ALL",
523
+ label: a(o)("menu.link_product.rules.availability"),
524
+ "onUpdate:modelValue": l[2] || (l[2] = (d) => {
525
+ var s;
526
+ return (s = u.rulesSession) == null ? void 0 : s.setRuleEditorOrderFrom(
527
+ d
528
+ );
529
+ })
530
+ }, {
531
+ default: k(() => [
532
+ r(p, {
533
+ label: a(o)("menu.link_product.rules.all"),
534
+ value: "ALL"
535
+ }, null, 8, ["label"]),
536
+ r(p, {
537
+ label: a(o)("menu.link_product.rules.pos_only"),
538
+ value: "POS_ONLY"
539
+ }, null, 8, ["label"]),
540
+ r(p, {
541
+ label: a(o)("menu.link_product.rules.none"),
542
+ value: "NONE"
543
+ }, null, 8, ["label"])
544
+ ]),
545
+ _: 1
546
+ }, 8, ["model-value", "label"]),
547
+ l[5] || (l[5] = i("div", { class: "mt-24 h-px w-full bg-fm-color-neutral-gray-100" }, null, -1)),
548
+ i("div", ol, [
549
+ i("p", al, b(a(o)("menu.link_product.rules.use_rule_group")), 1),
550
+ r(Fe, { "close-on-click": !1 }, {
551
+ "menu-button": k(() => [
552
+ r(t, {
553
+ variant: "plain",
554
+ "prepend-icon": "add",
555
+ class: "self-start",
556
+ label: a(o)("menu.link_product.rules.add_rule_group")
557
+ }, null, 8, ["label"])
558
+ ]),
559
+ default: k(() => [
560
+ r(Re, {
561
+ "model-value": M.value,
562
+ "onUpdate:modelValue": l[3] || (l[3] = (d) => M.value = d),
563
+ class: "w-[200px] px-8",
564
+ placeholder: a(o)("menu.link_product.rules.filter_result")
565
+ }, null, 8, ["model-value", "placeholder"]),
566
+ (m(!0), y(q, null, W(pe.value, (d) => (m(), R(Ce, {
567
+ key: d.id,
568
+ label: d.name,
569
+ "has-checkbox": "",
570
+ "model-value": Q.value.includes(d.id),
571
+ onClick: (s) => _e(d.id)
572
+ }, null, 8, ["label", "model-value", "onClick"]))), 128))
573
+ ]),
574
+ _: 1
575
+ })
576
+ ]),
577
+ i("div", nl, [
578
+ i("p", ul, b(a(o)("menu.rule_groups.condition_view.condition")), 1),
579
+ (m(!0), y(q, null, W(((f = x.value) == null ? void 0 : f.conditions) ?? [], (d, s) => (m(), y("div", {
580
+ key: s,
581
+ class: "flex justify-between gap-8"
582
+ }, [
583
+ i("div", sl, [
584
+ r(T, {
585
+ class: "flex w-full",
586
+ "menu-z-index": 102,
587
+ "model-value": d.attribute,
588
+ items: se(),
589
+ placeholder: a(o)("menu.rule_groups.condition_view.select_item"),
590
+ "aria-label": a(o)("menu.common.labels.a11y_labelled_name", {
591
+ label: a(o)(
592
+ "menu.menu_setting.rule_groups.condition.attribute"
593
+ ),
594
+ name: V(s)
595
+ }),
596
+ "onUpdate:modelValue": (_) => {
597
+ var v;
598
+ (v = u.rulesSession) == null || v.setRuleEditorCondition(s, {
599
+ attribute: _,
600
+ values: []
601
+ });
602
+ }
603
+ }, null, 8, ["model-value", "items", "placeholder", "aria-label", "onUpdate:modelValue"]),
604
+ r(T, {
605
+ class: "flex w-full",
606
+ "menu-z-index": 102,
607
+ "model-value": d.operator,
608
+ items: ue.value,
609
+ placeholder: a(o)("menu.rule_groups.condition_view.select_item"),
610
+ "aria-label": a(o)("menu.common.labels.a11y_labelled_name", {
611
+ label: a(o)(
612
+ "menu.menu_setting.rule_groups.condition.operator"
613
+ ),
614
+ name: V(s)
615
+ }),
616
+ "helper-state": F(s, "operator") ? "error" : "none",
617
+ "helper-text": U(F(s, "operator")),
618
+ "onUpdate:modelValue": (_) => {
619
+ var v;
620
+ return (v = u.rulesSession) == null ? void 0 : v.setRuleEditorCondition(s, {
621
+ operator: _
622
+ });
623
+ }
624
+ }, null, 8, ["model-value", "items", "placeholder", "aria-label", "helper-state", "helper-text", "onUpdate:modelValue"]),
625
+ a(Pe)(d.operator) === "text" ? Le((m(), y("div", rl, [
626
+ r(Ve, {
627
+ "model-value": String(d.values[0] ?? ""),
628
+ placeholder: a(o)("menu.menu_setting.rule_groups.condition.value"),
629
+ "helper-state": F(s, "values") ? "error" : "none",
630
+ "helper-text": U(F(s, "values")),
631
+ "onUpdate:modelValue": (_) => {
632
+ var v;
633
+ return (v = u.rulesSession) == null ? void 0 : v.setRuleEditorCondition(s, {
634
+ values: _ === "" || _ == null ? [] : [String(_)]
635
+ });
636
+ }
637
+ }, null, 8, ["model-value", "placeholder", "helper-state", "helper-text", "onUpdate:modelValue"])
638
+ ])), [
639
+ [
640
+ ne,
641
+ a(o)("menu.common.labels.a11y_labelled_name", {
642
+ label: a(o)("menu.menu_setting.rule_groups.condition.value"),
643
+ name: V(s)
644
+ })
645
+ ]
646
+ ]) : (m(), R(T, {
647
+ key: 1,
648
+ class: "flex w-full",
649
+ "menu-z-index": 102,
650
+ "model-value": d.values.map(a(te)),
651
+ items: re(d),
652
+ multiselect: "",
653
+ "hide-chips": "",
654
+ placeholder: a(o)("menu.rule_groups.condition_view.select_item"),
655
+ "aria-label": a(o)("menu.common.labels.a11y_labelled_name", {
656
+ label: a(o)("menu.menu_setting.rule_groups.condition.value"),
657
+ name: V(s)
658
+ }),
659
+ "helper-state": F(s, "values") ? "error" : "none",
660
+ "helper-text": U(F(s, "values")),
661
+ "onUpdate:modelValue": (_) => {
662
+ var v;
663
+ return (v = u.rulesSession) == null ? void 0 : v.setRuleEditorCondition(s, {
664
+ values: _.map(a(Ae))
665
+ });
666
+ }
667
+ }, {
668
+ default: k(() => [
669
+ i("div", il, b(ie(d)), 1)
670
+ ]),
671
+ _: 2
672
+ }, 1032, ["model-value", "items", "placeholder", "aria-label", "helper-state", "helper-text", "onUpdate:modelValue"]))
673
+ ]),
674
+ r(t, {
675
+ variant: "tertiary",
676
+ "prepend-icon": "close",
677
+ "aria-label": a(o)("menu.common.labels.a11y_labelled_name", {
678
+ label: a(o)("menu.menu_setting.rule_groups.remove_condition"),
679
+ name: V(s)
680
+ }),
681
+ onClick: (_) => ye(s)
682
+ }, null, 8, ["aria-label", "onClick"])
683
+ ]))), 128)),
684
+ r(t, {
685
+ variant: "plain",
686
+ "prepend-icon": "add",
687
+ label: a(o)("menu.rule_groups.condition_view.add_condition"),
688
+ onClick: ge
689
+ }, null, 8, ["label"])
690
+ ])
691
+ ])
692
+ ];
693
+ }),
694
+ _: 1
695
+ }, 8, ["model-value"])) : z("", !0)
696
+ ]),
697
+ _: 1
698
+ }, 8, ["is-container", "is-container-props", "model-value"]);
699
+ };
700
+ }
701
+ });
702
+ export {
703
+ kl as A,
704
+ hl as O,
705
+ Sl as _,
706
+ je as a
707
+ };