@feedmepos/mf-menu-portal 1.0.4-dev.3 → 1.0.4

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 (80) hide show
  1. package/dist/{App-nS46pByh.js → App-CgYpEYgp.js} +3 -3
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-C9OSr8ft.js → ApplyProduct.vue_vue_type_script_setup_true_lang-Hdsnu29V.js} +1 -1
  3. package/dist/{BindingTable.vue_vue_type_script_setup_true_lang-DnvN5R5w.js → BindingTable.vue_vue_type_script_setup_true_lang-CWe5_Sm5.js} +1 -1
  4. package/dist/{Catalog-B4RS8T29.js → Catalog-BrHGEI3p.js} +4 -4
  5. package/dist/{CatalogBinding-6_783kbu.js → CatalogBinding-BjTeOA91.js} +3 -3
  6. package/dist/{CatalogEditTabs.vue_vue_type_script_setup_true_lang-BawCLY5-.js → CatalogEditTabs.vue_vue_type_script_setup_true_lang-doB3hsWD.js} +3 -3
  7. package/dist/{CatalogEditor.vue_vue_type_script_setup_true_lang-BjP8ZXyb.js → CatalogEditor.vue_vue_type_script_setup_true_lang-BpBR-N_x.js} +7 -7
  8. package/dist/{CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-Diapahfp.js → CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-P59vHZEn.js} +14 -14
  9. package/dist/{Category-CqneIGq4.js → Category-6-ppsSmZ.js} +5 -5
  10. package/dist/{Category-DNQH1CI7.js → Category-CdsbuUqi.js} +2 -2
  11. package/dist/CategoryList.vue_vue_type_script_setup_true_lang-DlNUOgyu.js +847 -0
  12. package/dist/{CookingGuide-DTAiFmEL.js → CookingGuide-CRyRlBeV.js} +5 -5
  13. package/dist/{Group-5xO2j3CL.js → Group-DVrUlq4i.js} +2 -2
  14. package/dist/{Group-DeUqUomY.js → Group-DqyBHSFx.js} +5 -5
  15. package/dist/GroupList.vue_vue_type_script_setup_true_lang-oGNs8e8f.js +1807 -0
  16. package/dist/Ingredient-CGLfhbvN.js +505 -0
  17. package/dist/LinkProductSideSheet.vue_vue_type_script_setup_true_lang-C0rc1FRO.js +782 -0
  18. package/dist/{MenuSetting-DdekHsQy.js → MenuSetting-Oct3vbHj.js} +4 -4
  19. package/dist/OrderPacing-BDkzflgE.js +769 -0
  20. package/dist/{OrderPacingFields.vue_vue_type_script_setup_true_lang-C3SqQPSr.js → OrderPacingFields.vue_vue_type_script_setup_true_lang-B259anSs.js} +2 -2
  21. package/dist/{Preview-DGTw0POk.js → Preview-V9cSpevb.js} +1 -1
  22. package/dist/{PriceTierNotice.vue_vue_type_script_setup_true_lang-DffhFv0Y.js → PriceTierNotice.vue_vue_type_script_setup_true_lang-k5S4mGCN.js} +1 -1
  23. package/dist/PrintRoute-3UwiMoBU.js +518 -0
  24. package/dist/{Product-CsbcyIgD.js → Product-LaB-YRTQ.js} +4 -4
  25. package/dist/ProductAttributeFilter.vue_vue_type_script_setup_true_lang-B2KdolJS.js +7931 -0
  26. package/dist/{ProductEditorHost.vue_vue_type_script_setup_true_lang--rBKdKV7.js → ProductEditorHost.vue_vue_type_script_setup_true_lang-BBXGnZtc.js} +9 -9
  27. package/dist/ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-BUC6qUnG.js +2011 -0
  28. package/dist/{ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-DtCzHjpN.js → ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-CjQRRqBx.js} +1 -1
  29. package/dist/{ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-aDx01-WW.js → ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-3yzUcogQ.js} +630 -587
  30. package/dist/{ProductInternalTools-Ccd4dAmx.js → ProductInternalTools-DWCgC825.js} +2 -2
  31. package/dist/{ProductInventoryDialog-DYcKdKHi.js → ProductInventoryDialog-D0d5RywR.js} +1 -1
  32. package/dist/{ProductInventoryDialog.vue_vue_type_script_setup_true_lang-DySFcCJz.js → ProductInventoryDialog.vue_vue_type_script_setup_true_lang-CmYKO0ZX.js} +1 -1
  33. package/dist/ProductList.vue_vue_type_script_setup_true_lang-DeX8Exly.js +2765 -0
  34. package/dist/{ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-Dw2xiPYX.js → ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-BFD6_Sbb.js} +1 -1
  35. package/dist/{Products-phZwCZhU.js → Products-BLUhwFT-.js} +3 -3
  36. package/dist/Publish-Dkjnls7p.js +1337 -0
  37. package/dist/Recipe-BGfofjHT.js +388 -0
  38. package/dist/{Scheduler-C-A5m92O.js → Scheduler-BL7t8aS7.js} +314 -254
  39. package/dist/ServingSequence-CDFXMCiN.js +374 -0
  40. package/dist/{Setting-C24V-lps.js → Setting-gYZoZxQG.js} +6 -6
  41. package/dist/Subcategory-CnlrVwCy.js +459 -0
  42. package/dist/{Takeaway-BFP2ohJn.js → Takeaway-BWVzwWnh.js} +5 -5
  43. package/dist/{Takeaway-DywX5BiX.js → Takeaway-D8FzvC2w.js} +2 -2
  44. package/dist/{TakeawayList.vue_vue_type_script_setup_true_lang-B3QS7o1v.js → TakeawayList.vue_vue_type_script_setup_true_lang-igS-FXq5.js} +4 -4
  45. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-B8nXazx6.js +1291 -0
  46. package/dist/Unit-Do7Tt8U8.js +424 -0
  47. package/dist/{Variant-BBfWhH-s.js → Variant-D1kLupxx.js} +5 -5
  48. package/dist/{_id_-BooM3FX1.js → _id_-DomaBHrh.js} +3 -3
  49. package/dist/{app-Bmgb8ACe.js → app-C_XNYz8_.js} +312 -312
  50. package/dist/app.js +1 -1
  51. package/dist/apps/mf-menu/src/app.d.ts +60 -0
  52. package/dist/apps/mf-menu/src/components/Product/BulkCategorySelect.vue.d.ts +37 -0
  53. package/dist/apps/mf-menu/src/components/Product/ProductAttributeFilter.vue.d.ts +11 -1
  54. package/dist/apps/mf-menu/src/components/ProductList.vue.d.ts +2 -2
  55. package/dist/apps/mf-menu/src/components/feature/NestedGroupManager/NestedGroupOverrideSheets.vue.d.ts +27 -0
  56. package/dist/apps/mf-menu/src/components/feature/RestaurantAttributesFilter.vue.d.ts +20 -0
  57. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  58. package/dist/assets/{menu-compute-CG-fX5pi.js → menu-compute-Did75Kp9.js} +2 -2
  59. package/dist/assets/{validate-menu-BeGMWVns.js → validate-menu-DVMOLygB.js} +2 -2
  60. package/dist/mf-menu-portal.css +1 -1
  61. package/dist/{provide-CfF0FmUz.js → provide-Bwf3KcOV.js} +67991 -66892
  62. package/dist/{useActionFeedback-DyUCQl2x.js → useActionFeedback-CXx7dOVc.js} +1 -1
  63. package/dist/{FormSection.vue_vue_type_script_setup_true_lang-pY-_msnM.js → vuedraggable-CBtQLb_S.js} +140 -139
  64. package/package.json +2 -2
  65. package/dist/CategoryList.vue_vue_type_script_setup_true_lang-Bt_onPrP.js +0 -797
  66. package/dist/GroupList.vue_vue_type_script_setup_true_lang-Dgya_JLB.js +0 -2183
  67. package/dist/Ingredient-BlDW3TfZ.js +0 -463
  68. package/dist/LinkProductSideSheet.vue_vue_type_script_setup_true_lang-0tCpJlOf.js +0 -709
  69. package/dist/OrderPacing-Bb2n5wmI.js +0 -698
  70. package/dist/PrintRoute-CJB4gIP2.js +0 -473
  71. package/dist/ProductChipSummary.vue_vue_type_script_setup_true_lang-D8DygCBl.js +0 -110
  72. package/dist/ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-J6LpJ5wT.js +0 -1257
  73. package/dist/ProductList.vue_vue_type_script_setup_true_lang-DTLslTpK.js +0 -10353
  74. package/dist/Publish-BeKIXu3z.js +0 -1261
  75. package/dist/Recipe-Fo4tBkBv.js +0 -350
  76. package/dist/ServingSequence-BrCwLSO7.js +0 -336
  77. package/dist/Subcategory-B0oZIKbw.js +0 -412
  78. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-D7mhnrXx.js +0 -1213
  79. package/dist/Unit-NhEwH-kr.js +0 -385
  80. package/dist/apps/mf-menu/src/views/MenuManagementEditor/RestaurantAttributesFilter.vue.d.ts +0 -2
@@ -0,0 +1,1807 @@
1
+ import { defineComponent as ml, ref as P, watch as Ne, resolveComponent as $, openBlock as i, createBlock as w, withCtx as c, createElementVNode as u, createVNode as s, normalizeClass as Le, toDisplayString as x, unref as t, createElementBlock as b, Fragment as z, renderList as Y, createCommentVNode as f, defineAsyncComponent as Al, computed as O, shallowRef as I, h as d, withModifiers as D, onUnmounted as Nl, renderSlot as ye, withDirectives as Ll, mergeProps as el, nextTick as Dl } from "vue";
2
+ import { useI18n as cl, CustomAttributesForm as ll } from "@feedmepos/mf-common";
3
+ import { useDialog as zl, useSnackbar as El, components as y, SnackbarPosition as Ml, FmButtonVariant as al } from "@feedmepos/ui-library";
4
+ import { _ as Bl } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-Hdsnu29V.js";
5
+ import { _ as tl } from "./index.vue_vue_type_script_setup_true_lang-CGPDazqs.js";
6
+ import { a as Rl, b as ol, _ as ae } from "./TranslationLanguageSelector.vue_vue_type_script_setup_true_lang-BJZ6VcrT.js";
7
+ import { A as nl, _ as sl } from "./LinkProductSideSheet.vue_vue_type_script_setup_true_lang-C0rc1FRO.js";
8
+ import { a as il, _ as fe } from "./vuedraggable-CBtQLb_S.js";
9
+ import { _ as rl } from "./FormItem.vue_vue_type_script_setup_true_lang-C2S6QCyR.js";
10
+ import { _ as Gl, a as jl, c as Kl, F as ul, b as Yl, e as ql, d as Hl } from "./ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-BUC6qUnG.js";
11
+ import { _ as Ql } from "./ListCountTag.vue_vue_type_script_setup_true_lang-0bjk8Aly.js";
12
+ import { _ as Jl } from "./PageLayout.vue_vue_type_script_setup_true_lang-B3szUH39.js";
13
+ import { _ as Wl, a as Xl } from "./ProductAttributeFilter.vue_vue_type_script_setup_true_lang-B2KdolJS.js";
14
+ import { _ as Zl } from "./ProductFilterMenu.vue_vue_type_script_setup_true_lang-Cgc0Ms_n.js";
15
+ import { _ as ea } from "./TranslationSideSheet.vue_vue_type_script_setup_true_lang-B0j2PNih.js";
16
+ import { u as la } from "./useActionFeedback-CXx7dOVc.js";
17
+ import { u as aa } from "./useEditorValidation-Ctef5Bxt.js";
18
+ import { b as ta, u as dl } from "./provide-Bwf3KcOV.js";
19
+ import { v as oa } from "./tableSemantics-C9WFO_I_.js";
20
+ const na = { class: "option-translation-sheet-marker sr-only" }, sa = { class: "fm-typo-en-title-md-600" }, ia = { class: "pt-8 space-y-24" }, ra = { class: "flex flex-col gap-16 border p-16 rounded-lg" }, ua = ["aria-expanded"], da = { class: "fm-typo-en-body-lg-600" }, ma = {
21
+ key: 0,
22
+ class: "flex flex-col gap-32 pl-32"
23
+ }, ca = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary border inline-block rounded-full px-8 py-4 mb-8" }, pa = {
24
+ key: 0,
25
+ class: "space-y-8"
26
+ }, va = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary border inline-block rounded-full px-8 py-4 mb-8" }, ga = { class: "flex w-[100px] items-center gap-8" }, ba = { class: "fm-typo-en-body-md-400" }, ya = { class: "flex-1" }, fa = { class: "flex flex-col gap-16 border p-16 rounded-lg" }, _a = ["aria-expanded"], wa = { class: "fm-typo-en-body-lg-600" }, ka = {
27
+ key: 0,
28
+ class: "flex flex-col gap-32 pl-32"
29
+ }, ha = { class: "fm-typo-en-body-md-600 text-fm-color-primary border border-fm-color-primary inline-block rounded-md px-8 py-4" }, xa = { class: "space-y-32" }, Fa = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary border inline-block rounded-full px-8 py-4 mb-4" }, Ca = { class: "-mt-px" }, $a = {
30
+ key: 0,
31
+ class: "space-y-8"
32
+ }, Va = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary border inline-block rounded-full px-8 py-4 mb-4" }, Oa = { class: "flex w-[100px] items-center gap-8" }, Pa = { class: "fm-typo-en-body-md-400" }, Sa = { class: "flex-1" }, Ta = { class: "flex gap-8 items-center justify-start" }, Ua = /* @__PURE__ */ ml({
33
+ __name: "GroupTranslationSideSheet",
34
+ props: {
35
+ modelValue: { type: Boolean },
36
+ view: {},
37
+ session: {}
38
+ },
39
+ emits: ["save", "discard"],
40
+ setup(_e, { emit: we }) {
41
+ const ke = _e, E = we, { t: v } = cl(), l = P(!1), S = P(!0);
42
+ return Ne(
43
+ () => ke.modelValue,
44
+ (_) => {
45
+ _ && (l.value = !1, S.value = !0);
46
+ },
47
+ { immediate: !0 }
48
+ ), (_, F) => {
49
+ const A = $("FmIcon"), te = $("FmTextField"), oe = $("FmButton"), q = $("FmSideSheet");
50
+ return i(), w(q, {
51
+ "model-value": _.modelValue,
52
+ "max-width": 720,
53
+ "z-index": 200,
54
+ "is-container-props": { class: "group-translation-sheet" },
55
+ "onOn:clickedAway": F[6] || (F[6] = (g) => E("discard")),
56
+ "onUpdate:modelValue": F[7] || (F[7] = (g) => !g && E("discard"))
57
+ }, {
58
+ "side-sheet-header": c(() => [
59
+ u("span", na, x(t(v)("menu.group.translation.translate_options")), 1),
60
+ u("p", sa, x(t(v)("menu.group.translation.title")), 1)
61
+ ]),
62
+ "side-sheet-footer": c(() => [
63
+ u("div", Ta, [
64
+ s(oe, {
65
+ label: t(v)("menu.common.actions.save"),
66
+ size: "lg",
67
+ variant: "primary",
68
+ onClick: F[4] || (F[4] = (g) => E("save"))
69
+ }, null, 8, ["label"]),
70
+ s(oe, {
71
+ label: t(v)("menu.common.actions.cancel"),
72
+ size: "lg",
73
+ variant: "tertiary",
74
+ onClick: F[5] || (F[5] = (g) => E("discard"))
75
+ }, null, 8, ["label"])
76
+ ])
77
+ ]),
78
+ default: c(() => [
79
+ u("div", ia, [
80
+ s(Rl, {
81
+ selected: _.view.optionTranslationView.locales,
82
+ available: _.view.optionTranslationView.availableLocales,
83
+ "menu-z-index": 201,
84
+ onAdd: F[0] || (F[0] = (g) => _.session.addOptionTranslationLocale(g)),
85
+ onRemove: F[1] || (F[1] = (g) => _.session.removeOptionTranslationLocale(g))
86
+ }, null, 8, ["selected", "available"]),
87
+ u("div", ra, [
88
+ u("button", {
89
+ type: "button",
90
+ class: "flex items-center gap-16 cursor-pointer appearance-none border-0 bg-transparent p-0 text-left",
91
+ "aria-expanded": l.value,
92
+ onClick: F[2] || (F[2] = (g) => l.value = !l.value)
93
+ }, [
94
+ s(A, {
95
+ name: "keyboard_arrow_down",
96
+ class: Le([
97
+ "transition-transform",
98
+ l.value ? "transform rotate-180" : ""
99
+ ])
100
+ }, null, 8, ["class"]),
101
+ u("p", da, x(t(v)("menu.group.translation.group_name")), 1)
102
+ ], 8, ua),
103
+ l.value ? (i(), b("div", ma, [
104
+ u("div", null, [
105
+ u("p", ca, x(t(v)("menu.group.translation.default")), 1),
106
+ s(te, {
107
+ "model-value": _.view.name,
108
+ readonly: ""
109
+ }, null, 8, ["model-value"])
110
+ ]),
111
+ _.view.optionTranslationView.groupNameTranslations.length > 0 ? (i(), b("div", pa, [
112
+ u("p", va, x(t(v)("menu.group.translation.translation")), 1),
113
+ (i(!0), b(z, null, Y(_.view.optionTranslationView.groupNameTranslations, (g) => (i(), b("div", {
114
+ key: g.code,
115
+ class: "flex gap-16 items-center"
116
+ }, [
117
+ u("div", ga, [
118
+ s(ol, {
119
+ code: g.code
120
+ }, null, 8, ["code"]),
121
+ u("span", ba, x(g.label), 1)
122
+ ]),
123
+ u("div", ya, [
124
+ s(ae, {
125
+ "model-value": g.value,
126
+ readonly: ""
127
+ }, null, 8, ["model-value"])
128
+ ])
129
+ ]))), 128))
130
+ ])) : f("", !0)
131
+ ])) : f("", !0)
132
+ ]),
133
+ u("div", fa, [
134
+ u("button", {
135
+ type: "button",
136
+ class: "flex items-center gap-16 cursor-pointer appearance-none border-0 bg-transparent p-0 text-left",
137
+ "aria-expanded": S.value,
138
+ onClick: F[3] || (F[3] = (g) => S.value = !S.value)
139
+ }, [
140
+ s(A, {
141
+ name: "keyboard_arrow_down",
142
+ class: Le([
143
+ "transition-transform",
144
+ S.value ? "transform rotate-180" : ""
145
+ ])
146
+ }, null, 8, ["class"]),
147
+ u("p", wa, x(t(v)("menu.group.translation.product_name")), 1)
148
+ ], 8, _a),
149
+ S.value ? (i(), b("div", ka, [
150
+ (i(!0), b(z, null, Y(_.view.optionTranslationView.options, (g, H) => (i(), b("div", {
151
+ key: g.id,
152
+ class: "space-y-8"
153
+ }, [
154
+ u("p", ha, x(t(v)("menu.group.translation.option", { number: H + 1 })), 1),
155
+ u("div", xa, [
156
+ u("div", null, [
157
+ u("p", Fa, x(t(v)("menu.group.translation.default")), 1),
158
+ u("div", Ca, [
159
+ s(ae, {
160
+ "model-value": g.name,
161
+ placeholder: g.placeholder,
162
+ "aria-label": t(v)("menu.group.translation.option_default", {
163
+ number: H + 1
164
+ }),
165
+ "onUpdate:modelValue": (V) => _.session.setOptionName(g.id, V, g.target)
166
+ }, null, 8, ["model-value", "placeholder", "aria-label", "onUpdate:modelValue"])
167
+ ])
168
+ ]),
169
+ _.view.optionTranslationLocales.length > 0 ? (i(), b("div", $a, [
170
+ u("p", Va, x(t(v)("menu.group.translation.translation")), 1),
171
+ (i(!0), b(z, null, Y(g.translations, (V) => (i(), b("div", {
172
+ key: V.code,
173
+ class: "flex gap-16 items-center"
174
+ }, [
175
+ u("div", Oa, [
176
+ s(ol, {
177
+ code: V.code
178
+ }, null, 8, ["code"]),
179
+ u("span", Pa, x(V.label), 1)
180
+ ]),
181
+ u("div", Sa, [
182
+ s(ae, {
183
+ "model-value": V.value,
184
+ placeholder: g.name,
185
+ "aria-label": t(v)("menu.group.translation.option_translation", {
186
+ number: H + 1,
187
+ language: V.label
188
+ }),
189
+ "onUpdate:modelValue": (p) => _.session.setOptionTranslation(
190
+ g.id,
191
+ V.code,
192
+ p
193
+ )
194
+ }, null, 8, ["model-value", "placeholder", "aria-label", "onUpdate:modelValue"])
195
+ ])
196
+ ]))), 128))
197
+ ])) : f("", !0)
198
+ ])
199
+ ]))), 128))
200
+ ])) : f("", !0)
201
+ ])
202
+ ])
203
+ ]),
204
+ _: 1
205
+ }, 8, ["model-value"]);
206
+ };
207
+ }
208
+ }), Ia = {
209
+ key: 0,
210
+ class: "flex-1 flex justify-between gap-8 pl-8"
211
+ }, Aa = { class: "flex items-center" }, Na = {
212
+ key: 1,
213
+ class: "flex items-center gap-8 ml-auto"
214
+ }, La = {
215
+ key: 0,
216
+ class: "text-fm-color-typo-secondary",
217
+ role: "alert"
218
+ }, Da = {
219
+ key: 1,
220
+ "data-menu-state": "unavailable"
221
+ }, za = { class: "flex justify-between items-center gap-8 mt-16 mb-8" }, Ea = ["aria-label"], Ma = {
222
+ key: 1,
223
+ "aria-hidden": "true"
224
+ }, Ba = { class: "w-[320px]" }, Ra = { class: "fm-typo-en-title-md-600" }, Ga = { class: "space-y-32 pt-8" }, ja = { class: "space-y-16" }, Ka = {
225
+ key: 0,
226
+ class: "flex gap-8 rounded-md bg-fm-color-system-warning-100 p-12"
227
+ }, Ya = { class: "space-y-4" }, qa = { class: "fm-typo-en-body-md-400 text-fm-color-system-warning-400" }, Ha = { class: "fm-typo-en-body-md-400 text-fm-color-system-warning-400" }, Qa = { key: 0 }, Ja = { key: 1 }, Wa = { class: "xs:overflow-x-scroll" }, Xa = { class: "xs:min-w-[640px]" }, Za = { class: "flex gap-8 items-center justify-start" }, et = {
228
+ key: 0,
229
+ role: "alert"
230
+ }, lt = {
231
+ key: 1,
232
+ "data-menu-state": "unavailable"
233
+ }, at = { class: "flex gap-8 items-center justify-start" }, tt = { class: "fm-typo-en-title-md-600" }, ot = { class: "space-y-32 pt-8" }, nt = { class: "xs:overflow-x-scroll" }, st = { class: "xs:min-w-[640px]" }, it = { class: "flex gap-8" }, Vt = /* @__PURE__ */ ml({
234
+ __name: "GroupList",
235
+ props: {
236
+ sdk: {},
237
+ catalogPage: { type: Boolean, default: !1 },
238
+ heading: { default: "" }
239
+ },
240
+ setup(_e) {
241
+ const we = Al(
242
+ () => import("./ProductInventoryDialog-D0d5RywR.js")
243
+ ), ke = ["NORMAL", "PRODUCT", "DYNAMIC"], E = {
244
+ NORMAL: "menu.group.type.normal",
245
+ PRODUCT: "menu.group.type.product",
246
+ DYNAMIC: "menu.group.type.dynamic"
247
+ }, v = _e, { t: l, n: S } = cl(), _ = ta(), F = zl(), A = P(!1), te = P(
248
+ null
249
+ );
250
+ async function oe() {
251
+ var e;
252
+ A.value = !A.value, A.value && (await Dl(), (e = te.value) == null || e.toggleProperty(!0));
253
+ }
254
+ function q(e) {
255
+ if (!e) return "";
256
+ const a = S(0, {
257
+ useGrouping: !1,
258
+ minimumFractionDigits: 0,
259
+ maximumFractionDigits: 0
260
+ });
261
+ return S(0, {
262
+ style: "currency",
263
+ currency: e,
264
+ currencyDisplay: "narrowSymbol",
265
+ useGrouping: !1,
266
+ minimumFractionDigits: 0,
267
+ maximumFractionDigits: 0
268
+ }).replace(a, "").trim() || e;
269
+ }
270
+ const { run: g } = la(), H = El(), V = dl(v.sdk.group.list), p = O(
271
+ () => V.value.status === "ready" ? V.value.value : null
272
+ ), pl = O(() => {
273
+ var e;
274
+ return [
275
+ { label: l("menu.common.labels.summary"), value: null },
276
+ ...(((e = p.value) == null ? void 0 : e.scope.schedulerOptions) ?? []).map((a) => ({
277
+ label: a.label,
278
+ value: a.id
279
+ }))
280
+ ];
281
+ }), ne = P(!1), M = P(!1), B = P(!1), he = P(!1), R = P(!1), N = I(null), T = I({
282
+ status: "loading"
283
+ });
284
+ let xe = () => {
285
+ };
286
+ const Q = I(null), J = I(null), Fe = P(""), G = P(!1), j = P(!1), De = dl(
287
+ v.sdk.linkProduct.catalogue
288
+ ), ze = O(
289
+ () => De.value.status === "ready" ? De.value.value : null
290
+ ), se = I(null), m = I(v.sdk.group.editor()), W = I(
291
+ m.value.get()
292
+ );
293
+ let Ce = m.value.subscribe(
294
+ (e) => W.value = e
295
+ );
296
+ const o = O(
297
+ () => W.value.status === "ready" ? W.value.value : null
298
+ ), K = aa(() => m.value), ie = O(
299
+ () => o.value ? K.issue(o.value.fieldIssues, "name") ?? o.value.nameIssue : null
300
+ ), Ee = O(() => {
301
+ const e = o.value;
302
+ return e ? [
303
+ ...K.issues(e.fieldIssues, "bounds"),
304
+ ...K.issues(e.fieldIssues, "options"),
305
+ ...e.issues.filter(
306
+ (a) => a.field !== "name" && a.field !== "bounds" && a.field !== "options"
307
+ )
308
+ ] : [];
309
+ }), re = P({}), $e = O(() => {
310
+ var e;
311
+ return (((e = o.value) == null ? void 0 : e.options) ?? []).map((a) => ({
312
+ ...a,
313
+ subRows: a.variants
314
+ }));
315
+ }), vl = O(
316
+ () => Math.max(
317
+ $e.value.reduce(
318
+ (e, a) => e + 1 + a.subRows.length,
319
+ 0
320
+ ),
321
+ 1
322
+ )
323
+ ), U = O(
324
+ () => T.value.status === "ready" ? T.value.value : null
325
+ );
326
+ Ne(
327
+ () => T.value.status,
328
+ (e) => {
329
+ e !== "ready" && (R.value = !1);
330
+ }
331
+ );
332
+ function gl(e, a) {
333
+ return e === null ? "" : S(e, {
334
+ style: "currency",
335
+ currency: a,
336
+ currencyDisplay: "narrowSymbol"
337
+ }).replaceAll(/\s/g, "");
338
+ }
339
+ const bl = O(() => [
340
+ { label: l("menu.order.from.options.all"), value: "ALL" },
341
+ { label: l("menu.order.from.options.pos_only"), value: "POS_ONLY" },
342
+ { label: l("menu.order.from.options.none"), value: "NONE" }
343
+ ]);
344
+ function Me(e) {
345
+ return Object.fromEntries(
346
+ Object.entries(e).map(([a, r]) => [a, [...r]])
347
+ );
348
+ }
349
+ function Ve() {
350
+ var e;
351
+ (e = Q.value) == null || e.dispose(), Q.value = null;
352
+ }
353
+ function Be(e, a) {
354
+ Ve(), Q.value = m.value.pricingEditor(
355
+ e.id,
356
+ a,
357
+ e.target
358
+ );
359
+ }
360
+ async function yl(e) {
361
+ return (await g(() => v.sdk.priceTier.create(e), {
362
+ successMessage: l("menu.price_tier.add_price_group_success")
363
+ })).kind === "success";
364
+ }
365
+ function Oe() {
366
+ var e;
367
+ (e = J.value) == null || e.dispose(), J.value = null, Fe.value = "";
368
+ }
369
+ function fl(e) {
370
+ Oe(), Fe.value = e.name || e.placeholder, J.value = m.value.inventoryEditor(
371
+ e.id,
372
+ e.target
373
+ );
374
+ }
375
+ function _l() {
376
+ var e, a;
377
+ ((a = (e = o.value) == null ? void 0 : e.translation) == null ? void 0 : a.state) === "allowed" && (m.value.beginOptionTranslationEdit(), G.value = !0);
378
+ }
379
+ function Re() {
380
+ var e, a;
381
+ ((a = (e = o.value) == null ? void 0 : e.translation) == null ? void 0 : a.state) === "allowed" && (m.value.beginGroupTranslationEdit(), j.value = !0);
382
+ }
383
+ function wl() {
384
+ m.value.saveGroupTranslationEdit(), j.value = !1;
385
+ }
386
+ function ue() {
387
+ m.value.discardGroupTranslationEdit(), j.value = !1;
388
+ }
389
+ function kl() {
390
+ m.value.saveOptionTranslationEdit(), G.value = !1;
391
+ }
392
+ function Pe() {
393
+ m.value.discardOptionTranslationEdit(), G.value = !1;
394
+ }
395
+ const Se = O(() => [
396
+ {
397
+ accessorKey: "isDefault",
398
+ size: 35,
399
+ header: () => l("menu.group.option.is_default"),
400
+ enableSorting: !1,
401
+ cell: (e) => d(y.FmCheckbox, {
402
+ modelValue: e.row.original.isDefault,
403
+ value: "default",
404
+ disabled: e.row.original.editDefault.state !== "allowed",
405
+ "aria-label": l("menu.group.a11y.row", {
406
+ label: l("menu.group.option.is_default"),
407
+ index: e.row.index + 1
408
+ }),
409
+ "onUpdate:modelValue": (a) => m.value.setOptionDefault(
410
+ e.row.original.id,
411
+ a,
412
+ e.row.original.target
413
+ )
414
+ })
415
+ },
416
+ {
417
+ accessorKey: "code",
418
+ size: 100,
419
+ header: () => l("menu.group.option.code"),
420
+ enableSorting: !1,
421
+ cell: (e) => d("div", { class: "break-all max-w-[100px]" }, e.row.original.code)
422
+ },
423
+ {
424
+ accessorKey: "name",
425
+ header: () => {
426
+ var e, a;
427
+ return d("div", { class: "flex items-center w-full gap-8" }, [
428
+ d("span", l("menu.group.option.product_title")),
429
+ d(y.FmButton, {
430
+ "aria-label": l("menu.group.translation.translate_options"),
431
+ disabled: ((a = (e = o.value) == null ? void 0 : e.translation) == null ? void 0 : a.state) !== "allowed",
432
+ icon: "g_translate",
433
+ textColor: "neutral-gray-400",
434
+ variant: "tertiary",
435
+ onClick: _l
436
+ })
437
+ ]);
438
+ },
439
+ enableSorting: !1,
440
+ cell: (e) => {
441
+ const a = e.row.original, r = [a.code, a.name || a.placeholder].filter(Boolean).join(" "), C = e.row.getIsExpanded();
442
+ return d("div", { class: "flex items-center gap-8" }, [
443
+ ...e.row.getCanExpand() ? [
444
+ d(y.FmButton, {
445
+ // Down while collapsed, up once expanded, as TakeawayList.
446
+ icon: "keyboard_arrow_up",
447
+ class: C ? "" : "rotate-180",
448
+ "aria-label": C ? l("menu.apply_product.table.collapse_combinations", {
449
+ name: r
450
+ }) : l("menu.apply_product.table.expand_combinations", {
451
+ name: r
452
+ }),
453
+ variant: "tertiary",
454
+ onClick: e.row.getToggleExpandedHandler()
455
+ })
456
+ ] : [],
457
+ d(y.FmTextField, {
458
+ class: "min-w-[300px]",
459
+ modelValue: a.name,
460
+ placeholder: a.placeholder,
461
+ disabled: a.edit.state !== "allowed",
462
+ "aria-label": l("menu.group.a11y.row", {
463
+ label: l("menu.group.option.product_title"),
464
+ index: e.row.index + 1
465
+ }),
466
+ "onUpdate:modelValue": (k) => m.value.setOptionName(a.id, k, a.target)
467
+ })
468
+ ]);
469
+ }
470
+ },
471
+ {
472
+ accessorKey: "priceAmount",
473
+ size: 400,
474
+ header: () => {
475
+ var e;
476
+ return l("menu.group.option.price", {
477
+ symbol: q((e = o.value) == null ? void 0 : e.currencyCode)
478
+ });
479
+ },
480
+ enableSorting: !1,
481
+ cell: (e) => d("div", { class: "flex items-center gap-8" }, [
482
+ d(Gl, {
483
+ class: "min-w-[88px]",
484
+ modelValue: e.row.original.priceAmount,
485
+ // An override or variant row shows the price it inherits, and
486
+ // clearing it hands the row back to that price (legacy
487
+ // OptionTable `fallbackPrice`).
488
+ placeholder: gl(
489
+ e.row.original.inheritedPriceAmount,
490
+ e.row.original.currency
491
+ ),
492
+ disabled: e.row.original.edit.state !== "allowed",
493
+ // Legacy exposes the first option price as the form's plain
494
+ // "Price (RM)" field. Keep that stable semantic control for the
495
+ // catalog editor, while later rows remain uniquely named.
496
+ "aria-label": e.row.index === 0 ? l("menu.group.option.price", {
497
+ symbol: q(e.row.original.currency)
498
+ }) : l("menu.group.a11y.row", {
499
+ label: l("menu.group.option.price", {
500
+ symbol: q(e.row.original.currency)
501
+ }),
502
+ index: e.row.index + 1
503
+ }),
504
+ "onUpdate:modelValue": (a) => m.value.setOptionPrice(
505
+ e.row.original.id,
506
+ a,
507
+ e.row.original.target
508
+ )
509
+ }),
510
+ // A row that cannot sell keeps its pricing controls, disabled, as the
511
+ // nested editor's rows do; only a V3 menu has none.
512
+ ...e.row.original.editPricing.state !== "hidden" ? [
513
+ d("div", { class: "flex items-center gap-4" }, [
514
+ d(
515
+ y.FmButton,
516
+ {
517
+ variant: "plain",
518
+ label: l(
519
+ "menu.product.form.member_price.configure.title"
520
+ ),
521
+ "aria-label": l("menu.group.a11y.row", {
522
+ label: l(
523
+ "menu.product.form.member_price.configure.title"
524
+ ),
525
+ index: e.row.index + 1
526
+ }),
527
+ disabled: e.row.original.editPricing.state !== "allowed",
528
+ onClick: () => Be(e.row.original, "members")
529
+ },
530
+ {
531
+ default: () => d(
532
+ "span",
533
+ { class: "underline line-clamp-2 break-all" },
534
+ e.row.original.memberPriceCount ? l(
535
+ "menu.product.form.member_price.configure.title_with_tier",
536
+ { num: e.row.original.memberPriceCount }
537
+ ) : l(
538
+ "menu.product.form.member_price.configure.title"
539
+ )
540
+ )
541
+ }
542
+ ),
543
+ d(jl, {
544
+ prices: e.row.original.memberPrices
545
+ })
546
+ ])
547
+ ] : []
548
+ ])
549
+ },
550
+ {
551
+ accessorKey: "orderFrom",
552
+ size: 100,
553
+ header: () => l("menu.common.labels.order_from"),
554
+ enableSorting: !1,
555
+ cell: (e) => {
556
+ const a = e.row.original.edit, r = d(y.FmSelect, {
557
+ // An inheriting row shows the availability it inherits, as legacy's
558
+ // OrderFrom field shows its `fallback`; nothing is written until
559
+ // the merchant picks one.
560
+ modelValue: e.row.original.orderFrom ?? e.row.original.inheritedOrderFrom,
561
+ items: bl.value,
562
+ disabled: a.state !== "allowed",
563
+ "aria-label": l("menu.group.a11y.row", {
564
+ label: l("menu.common.labels.order_from"),
565
+ index: e.row.index + 1
566
+ }),
567
+ "onUpdate:modelValue": (k) => {
568
+ k && m.value.setOptionOrderFrom(
569
+ e.row.original.id,
570
+ k,
571
+ e.row.original.target
572
+ );
573
+ }
574
+ }), C = e.row.original.unavailableInCatalog;
575
+ return !C || a.state !== "disabled" ? r : d("div", { class: "flex items-center gap-4" }, [
576
+ r,
577
+ d(
578
+ y.FmTooltip,
579
+ {
580
+ content: _(a.reason),
581
+ placement: "top",
582
+ zIndex: 999
583
+ },
584
+ () => d(y.FmIcon, {
585
+ name: C === "NOT_FOR_SALE" ? "block" : "link_off",
586
+ size: "sm",
587
+ color: "system-warning-400"
588
+ })
589
+ )
590
+ ]);
591
+ }
592
+ },
593
+ {
594
+ id: "actions",
595
+ size: 80,
596
+ header: "",
597
+ enableSorting: !1,
598
+ meta: { cellClass: "" },
599
+ cell: (e) => d("div", { class: "flex items-center justify-end" }, [
600
+ ...e.row.original.editPriceTiers.state !== "hidden" ? [
601
+ d(Kl, {
602
+ configured: e.row.original.hasPriceTiers,
603
+ disabled: e.row.original.editPriceTiers.state !== "allowed",
604
+ label: l("menu.group.a11y.row", {
605
+ label: l("menu.price_tier.price_tier_config"),
606
+ index: e.row.index + 1
607
+ }),
608
+ onOpen: () => Be(e.row.original, "tiers")
609
+ })
610
+ ] : [],
611
+ d(y.FmButton, {
612
+ icon: "inventory_2",
613
+ overwriteIconOutline: e.row.original.inventory.bindings.length ? "filled" : "outline",
614
+ variant: "tertiary",
615
+ textColor: "neutral-gray-400",
616
+ disabled: e.row.original.edit.state !== "allowed",
617
+ "aria-label": l("menu.group.a11y.row", {
618
+ label: l("menu.inventory.title"),
619
+ index: e.row.index + 1
620
+ }),
621
+ onClick: () => fl(e.row.original)
622
+ }),
623
+ ...e.row.original.nestedGroupCount ? [
624
+ d(
625
+ y.FmBadge,
626
+ {
627
+ class: "bg-fm-color-primary text-fm-color-neutral-white !right-0 !top-0",
628
+ value: e.row.original.nestedGroupCount
629
+ },
630
+ {
631
+ default: () => d(y.FmButton, {
632
+ "aria-label": l("menu.group.a11y.row", {
633
+ label: l("menu.group.nested.title"),
634
+ index: e.row.index + 1
635
+ }),
636
+ icon: "arrow_split",
637
+ textColor: "neutral-gray-400",
638
+ variant: "tertiary",
639
+ disabled: e.row.original.edit.state !== "allowed",
640
+ onClick: () => Vl(
641
+ e.row.original.id,
642
+ e.row.original.target
643
+ )
644
+ })
645
+ }
646
+ )
647
+ ] : [
648
+ d(y.FmButton, {
649
+ "aria-label": l("menu.group.a11y.row", {
650
+ label: l("menu.group.nested.title"),
651
+ index: e.row.index + 1
652
+ }),
653
+ disabled: !0,
654
+ icon: "arrow_split",
655
+ textColor: "neutral-gray-400",
656
+ variant: "tertiary"
657
+ })
658
+ ],
659
+ d(y.FmButton, {
660
+ "aria-label": l("menu.group.a11y.row", {
661
+ label: l("menu.common.actions.delete"),
662
+ index: e.row.index + 1
663
+ }),
664
+ icon: "delete",
665
+ variant: "tertiary",
666
+ // The SDK decides which row may delete (a combination row may
667
+ // not); the button only renders that and forwards the row target.
668
+ disabled: e.row.original.remove.state !== "allowed",
669
+ onClick: () => {
670
+ e.row.original.remove.state === "allowed" && m.value.removeOption(
671
+ e.row.original.id,
672
+ e.row.original.target
673
+ );
674
+ }
675
+ })
676
+ ])
677
+ }
678
+ ]), hl = O(
679
+ () => {
680
+ var e;
681
+ return (e = o.value) != null && e.options.length ? Se.value : Se.value.slice(0, 4);
682
+ }
683
+ );
684
+ function Ge(e) {
685
+ Ce(), m.value.dispose(), re.value = {}, m.value = v.sdk.group.editor(e), W.value = m.value.get(), Ce = m.value.subscribe(
686
+ (a) => W.value = a
687
+ );
688
+ }
689
+ const Te = O(() => {
690
+ var e;
691
+ return ((e = p.value) == null ? void 0 : e.showType) === !0;
692
+ });
693
+ function je() {
694
+ var e;
695
+ if (((e = p.value) == null ? void 0 : e.create.state) === "allowed") {
696
+ if (Te.value) {
697
+ M.value = !0;
698
+ return;
699
+ }
700
+ Ge(), M.value = !0;
701
+ }
702
+ }
703
+ function Ke(e) {
704
+ e.update.state === "allowed" && (Ge(e.id), ne.value = !0);
705
+ }
706
+ function xl(e) {
707
+ H.open({
708
+ type: "success",
709
+ title: l("menu.product.manager.action.saved", { name: e }),
710
+ position: Ml.BOTTOM
711
+ });
712
+ }
713
+ function de() {
714
+ me(), j.value && ue(), G.value && Pe(), ne.value = !1, M.value = !1, B.value = !1;
715
+ }
716
+ function X() {
717
+ var e;
718
+ xe(), xe = () => {
719
+ }, (e = N.value) == null || e.dispose(), N.value = null, he.value = !1, R.value = !1;
720
+ }
721
+ function Fl(e) {
722
+ m.value.setOptionLinks(e), re.value = {}, B.value = !1;
723
+ }
724
+ function Cl(e) {
725
+ var a;
726
+ (a = N.value) == null || a.setLinkedProducts(e), R.value = !1;
727
+ }
728
+ function Ye(e) {
729
+ X();
730
+ const a = v.sdk.group.applyProduct(e.id);
731
+ a && (N.value = a, T.value = a.get(), xe = a.subscribe(
732
+ (r) => T.value = r
733
+ ), he.value = !0);
734
+ }
735
+ async function $l() {
736
+ var a;
737
+ (await g(
738
+ () => N.value.submit(),
739
+ {
740
+ successMessage: l("menu.variant.form.saved", {
741
+ name: ((a = U.value) == null ? void 0 : a.groupName) ?? ""
742
+ }),
743
+ showLoading: () => {
744
+ var r;
745
+ return ((r = U.value) == null ? void 0 : r.status) === "submitting";
746
+ }
747
+ }
748
+ )).kind === "success" && X();
749
+ }
750
+ function me() {
751
+ var e;
752
+ (e = se.value) == null || e.dispose(), se.value = null;
753
+ }
754
+ function Vl(e, a) {
755
+ me(), se.value = m.value.nestedOverrides(e, a);
756
+ }
757
+ async function qe() {
758
+ var C, k, L, Z;
759
+ const e = ((C = o.value) == null ? void 0 : C.name) ?? "", a = (k = p.value) != null && k.scope.schedulerId ? p.value.scope.schedulerLabel ?? e : v.catalogPage && (((L = p.value) == null ? void 0 : L.scope.catalogLabel) ?? v.heading) || e;
760
+ (await g(
761
+ () => K.submit(() => m.value.submit()),
762
+ {
763
+ // A catalog's Group editor still writes the default-menu group, but the
764
+ // legacy shell attributes the completed action to the active catalog.
765
+ successMessage: v.catalogPage || (Z = p.value) != null && Z.scope.schedulerId ? l("menu.catalog.saved", { name: a }) : l("menu.variant.form.saved", { name: a }),
766
+ // submit() publishes `submitting` synchronously only when it will perform
767
+ // a write. Local required-name rejection must not flash a loading toast;
768
+ // the approved required-field baseline contains only the field issue.
769
+ showLoading: () => {
770
+ var pe;
771
+ return ((pe = o.value) == null ? void 0 : pe.status) === "submitting";
772
+ }
773
+ }
774
+ )).kind === "success" && de();
775
+ }
776
+ function Ol(e) {
777
+ e.duplicate.state === "allowed" && F.open({
778
+ title: l("menu.group.actions.duplicate.title"),
779
+ message: l("menu.group.actions.duplicate.message", { name: e.name }),
780
+ primaryActions: {
781
+ text: l("menu.common.actions.yes"),
782
+ close: !0,
783
+ variant: al.Primary
784
+ },
785
+ secondaryActions: {
786
+ text: l("menu.common.actions.cancel"),
787
+ close: !0
788
+ }
789
+ }).onPrimary(async () => {
790
+ await g(() => v.sdk.group.duplicate(e.id), {
791
+ // Legacy names the SOURCE group here, not the clone: `duplicateGroup`
792
+ // passes `res.group.name` to `updateMenu`, and only `req.data.name`
793
+ // carries the ` clone` suffix (portal manager/menu/group.ts:365 @
794
+ // 7dfeb122). Re-observed against the real portal on 2026-08-19 — the
795
+ // toast reads "Set saved" while the created row reads "Set clone" —
796
+ // and the baseline was refreshed with the user's approval after having
797
+ // frozen the row's name as the toast text.
798
+ //
799
+ // `row.name` is the row the user acted on, so this is not the domain
800
+ // rule the SDK owns; the clone's own name still comes back on the ref
801
+ // for any caller that needs the created entity.
802
+ successMessage: l("menu.variant.form.saved", { name: e.name })
803
+ });
804
+ });
805
+ }
806
+ function Pl(e) {
807
+ e.remove.state === "allowed" && F.open({
808
+ title: l("menu.group.dialogs.delete.title"),
809
+ // Mirrors the legacy dialog's structure rather than composing a
810
+ // sentence here: message, then — only when something is linked — the
811
+ // warning heading and the affected names as a list
812
+ // (`portal .../GroupManager/DeleteGroupDialog.vue` @ `7dfeb122`). Each
813
+ // t() returns a complete string, so nothing is interpolated or
814
+ // assembled by a template expression (ADR-0003 §3). The names are what
815
+ // the frozen `group/delete/linked-confirmation` text ends in ("… will
816
+ // be unlinked: Hot Pot"); concatenating the two keys instead left the
817
+ // sentence on a dangling colon.
818
+ //
819
+ // These are the APPLIED items — the menu items referencing this group,
820
+ // which the delete unlinks — not the group's own option products. The
821
+ // frozen text names one item for "Add on", a group holding three
822
+ // options, so the two are not interchangeable.
823
+ contentComponent: d("div", { class: "space-y-4" }, [
824
+ d("p", l("menu.group.dialogs.delete.message", { name: e.name })),
825
+ ...e.appliedItemNames.length ? [
826
+ d("div", [
827
+ d(
828
+ "p",
829
+ { class: "text-fm-color-typo-secondary mb-2" },
830
+ l("menu.group.dialogs.delete.unlink_warning", {
831
+ count: e.appliedItemNames.length
832
+ })
833
+ ),
834
+ // FmList/FmListItem, the ADR-0003 §1 component of record.
835
+ // An earlier revision of this slice hand-rolled a
836
+ // `list-disc` <ul> because legacy's hollow disc differs from
837
+ // FmListItem's filled `fiber_manual_record` prepend and the
838
+ // 431px cost failed `group/v3-delete/linked-confirmation`.
839
+ // ADR-0003 §5 refuses that reasoning outright — a diff that
840
+ // cannot be closed while complying with §§1-4 is a finding to
841
+ // report, never a licence to hand-roll — and the raw list
842
+ // also falsified the premise of the V4 case's own approved
843
+ // region, which reads "the list is now implemented with the
844
+ // required design-system FmList/FmListItem primitives".
845
+ // Restored to FmList; the marker variance against legacy's
846
+ // hollow disc is an approved difference on this dialog.
847
+ d(
848
+ y.FmList,
849
+ { class: "text-fm-color-typo-secondary ml-4" },
850
+ {
851
+ default: () => e.appliedItemNames.map(
852
+ (a) => d(
853
+ y.FmListItem,
854
+ {
855
+ key: a,
856
+ class: "!p-0 !gap-4",
857
+ clickable: !1
858
+ },
859
+ {
860
+ default: () => d(
861
+ "span",
862
+ {
863
+ class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
864
+ },
865
+ a
866
+ ),
867
+ prepend: () => d(y.FmIcon, {
868
+ color: "neutral-gray-400",
869
+ name: "fiber_manual_record",
870
+ size: "sm"
871
+ })
872
+ }
873
+ )
874
+ )
875
+ }
876
+ )
877
+ ])
878
+ ] : []
879
+ ]),
880
+ primaryActions: {
881
+ text: l("menu.common.actions.delete"),
882
+ close: !0,
883
+ variant: al.Destructive
884
+ },
885
+ secondaryActions: {
886
+ text: l("menu.common.actions.cancel"),
887
+ close: !0
888
+ }
889
+ }).onPrimary(async () => {
890
+ await g(() => v.sdk.group.remove(e.id), {
891
+ // "removed", like every other module's delete. Legacy read
892
+ // "<name> saved" here only because its `deleteGroup` omitted
893
+ // `updateMenu`'s `isDelete` flag; parity with that copied the bug
894
+ // (ITS-003100), and the legacy app is fixed the same way.
895
+ successMessage: l("menu.variant.form.removed", { name: e.name })
896
+ });
897
+ });
898
+ }
899
+ const ce = I([]);
900
+ Ne(
901
+ () => {
902
+ var e;
903
+ return (e = p.value) == null ? void 0 : e.rows;
904
+ },
905
+ (e) => {
906
+ e && (ce.value = [...e]);
907
+ },
908
+ { immediate: !0 }
909
+ );
910
+ const Sl = O(
911
+ () => {
912
+ var e;
913
+ return (
914
+ // `showReorderHandle`, not `reorder.state`: the affordance's existence and
915
+ // the write's acceptance are two different questions, and the SDK answers
916
+ // both. Binding the handle to `reorder` deleted FmTable's 60px drag column
917
+ // whenever a filter narrowed the list — and again on every in-flight write
918
+ // — which moved every other column 110px; `group/list/search-ege` shipped
919
+ // that shift, and the V3 list's first legacy frame reported 4768 differing
920
+ // pixels. Reading `reorder.reason.code` to tell those refusals apart put
921
+ // the same rule in two places coupled by a message string; the rule is
922
+ // the SDK's.
923
+ (e = p.value) != null && e.showReorderHandle ? () => {
924
+ var a;
925
+ return ((a = p.value) == null ? void 0 : a.reorder.state) === "allowed";
926
+ } : !1
927
+ );
928
+ }
929
+ );
930
+ async function Tl(e) {
931
+ var C;
932
+ const a = ce.value;
933
+ (await g(
934
+ () => v.sdk.group.reorder(e.map((k) => k.id)),
935
+ {
936
+ successMessage: l("menu.group.reorder.success")
937
+ }
938
+ )).kind !== "success" && (ce.value = [...((C = p.value) == null ? void 0 : C.rows) ?? a]);
939
+ }
940
+ const Ul = O(() => {
941
+ var e;
942
+ return [
943
+ {
944
+ accessorKey: "name",
945
+ header: () => l("menu.group.list.columns.name"),
946
+ enableSorting: !1
947
+ },
948
+ {
949
+ accessorKey: "optionProducts",
950
+ header: () => l("menu.group.list.columns.products"),
951
+ enableSorting: !1,
952
+ // Legacy's own cell (`portal views/Catalog/Edit/Group.vue:427-437`): one
953
+ // entry per distinct item, suffixed `(N variant)` when that item
954
+ // contributes more than one variant row, and capped at five with an
955
+ // `& N more` tail. The SDK collapses and counts; the counted nouns are
956
+ // localized here, because this is the layer with an i18n instance
957
+ // (ADR-0003 §3) — nothing is assembled from a template expression.
958
+ cell: (a) => {
959
+ const r = a.row.original.optionProducts.map(
960
+ (k) => k.variantCount > 1 ? l("menu.group.list.product_variants", {
961
+ name: k.name,
962
+ variants: l("menu.group.list.variants", {
963
+ count: k.variantCount
964
+ })
965
+ }) : k.name
966
+ ), C = r.slice(0, 5).reduce(
967
+ (k, L) => k ? l("menu.group.list.join_products", { list: k, item: L }) : L,
968
+ ""
969
+ );
970
+ return r.length > 5 ? l("menu.group.list.products_more", {
971
+ products: C,
972
+ more: l("menu.group.list.more_items", {
973
+ count: r.length - 5
974
+ })
975
+ }) : C;
976
+ }
977
+ },
978
+ {
979
+ // V3 only. Legacy declares this column unconditionally and hides it
980
+ // through `columnVisibility.type = rule.group.type`
981
+ // (`portal views/Catalog/Edit/Group.vue:505-509`), which is the version
982
+ // flag, so a V4 business renders the same table without it. It sits
983
+ // between "Products" and "Applied products" because that is legacy's
984
+ // declaration order (`:406` name, `:424` items, `:441` type, `:458`
985
+ // tagging, `:473` itemsLinked) and carries legacy's own 80px width. A
986
+ // type that maps to nothing renders "-" (`:451`).
987
+ id: "type",
988
+ header: () => l("menu.group.list.columns.type"),
989
+ enableSorting: !1,
990
+ meta: { width: "80px" },
991
+ cell: (a) => {
992
+ const r = nl[a.row.original.type];
993
+ return l(r || "menu.common.labels.unknown");
994
+ }
995
+ },
996
+ ...(e = p.value) != null && e.attributeColumnVisible ? [
997
+ {
998
+ id: "tagging",
999
+ accessorKey: "attributeTags",
1000
+ header: () => l("menu.product.table.columns.tagging"),
1001
+ enableSorting: !1,
1002
+ size: 140,
1003
+ cell: (a) => d(Wl, {
1004
+ kind: "tagging",
1005
+ chips: a.row.original.attributeTags
1006
+ })
1007
+ }
1008
+ ] : [],
1009
+ {
1010
+ // Legacy's third column, and the one this table shipped without: the
1011
+ // frozen visual baseline (human-approved-legacy-chrome) carries
1012
+ // "Applied products" with an "N items linked" cell per row, and both keys
1013
+ // were already in every locale — only the column def was missing, which
1014
+ // is why the list diffed at 0.56% with the Products column wrapping into
1015
+ // the space this should occupy.
1016
+ //
1017
+ // Legacy does not pluralise ("1 items linked"), and the count goes through
1018
+ // the i18n layer rather than being assembled here (ADR-0003 §3).
1019
+ id: "appliedProducts",
1020
+ header: () => l("menu.group.list.columns.applied_products"),
1021
+ enableSorting: !1,
1022
+ cell: (a) => d(
1023
+ y.FmButton,
1024
+ {
1025
+ // This is the design-system button equivalent of legacy's clickable
1026
+ // dashed text trigger. Its compact neutral treatment preserves the
1027
+ // table-cell geometry while retaining native button semantics.
1028
+ class: "w-fit !min-h-0 !px-0 !py-0 !font-normal border-b border-dashed !border-fm-color-neutral-gray-300 hover:!border-fm-color-neutral-gray-400",
1029
+ borderColor: "neutral-gray-300",
1030
+ label: l("menu.group.list.items_linked", {
1031
+ count: a.row.original.appliedItemNames.length
1032
+ }),
1033
+ // Keep the legacy rendered count while adding the row name to the
1034
+ // accessible control name so equal counts remain distinguishable.
1035
+ "aria-label": l("menu.common.labels.a11y_labelled_name", {
1036
+ label: l("menu.group.list.items_linked", {
1037
+ count: a.row.original.appliedItemNames.length
1038
+ }),
1039
+ name: a.row.original.name
1040
+ }),
1041
+ textColor: "typo-primary",
1042
+ variant: "plain",
1043
+ onClick: D(
1044
+ () => Ye(a.row.original),
1045
+ ["stop", "prevent"]
1046
+ )
1047
+ },
1048
+ {
1049
+ // FmButton's default label is body-lg 600. Legacy's compact table
1050
+ // trigger is body-md 400, so use its supported content slot while
1051
+ // retaining the library's button and accessibility behaviour.
1052
+ default: () => d(
1053
+ "span",
1054
+ { class: "fm-typo-en-body-md-400" },
1055
+ l("menu.group.list.items_linked", {
1056
+ count: a.row.original.appliedItemNames.length
1057
+ })
1058
+ )
1059
+ }
1060
+ )
1061
+ },
1062
+ {
1063
+ // Keep the legacy row-action shell: one overflow trigger containing the
1064
+ // approved intents, including the now-observed apply-product path.
1065
+ id: "actions",
1066
+ header: "",
1067
+ meta: { cellClass: "pl-16", headerContentClass: "-mx-16" },
1068
+ cell: (a) => {
1069
+ const r = a.row.original;
1070
+ return d(
1071
+ "div",
1072
+ { class: "flex justify-end" },
1073
+ d(
1074
+ y.FmMenu,
1075
+ {
1076
+ closeOnClick: !0,
1077
+ placement: "bottom-end",
1078
+ stopClickPropagation: !0,
1079
+ onClick: D(() => {
1080
+ }, ["stop"])
1081
+ },
1082
+ {
1083
+ "menu-button": () => d(y.FmButton, {
1084
+ type: "button",
1085
+ variant: "tertiary",
1086
+ icon: "more_vert",
1087
+ "aria-label": l("menu.common.labels.a11y_labelled_name", {
1088
+ label: l("menu.group.a11y.actions"),
1089
+ name: r.name
1090
+ })
1091
+ }),
1092
+ default: () => [
1093
+ d(y.FmMenuItem, {
1094
+ label: l("menu.common.actions.edit"),
1095
+ disabled: r.update.state !== "allowed",
1096
+ onClick: D(
1097
+ () => Ke(r),
1098
+ ["stop", "prevent"]
1099
+ )
1100
+ }),
1101
+ d(y.FmMenuItem, {
1102
+ label: l("menu.group.actions.apply_product"),
1103
+ onClick: D(
1104
+ () => Ye(r),
1105
+ ["stop", "prevent"]
1106
+ )
1107
+ }),
1108
+ d(y.FmMenuItem, {
1109
+ label: l("menu.group.actions.duplicate_action"),
1110
+ disabled: r.duplicate.state !== "allowed",
1111
+ onClick: D(
1112
+ () => Ol(r),
1113
+ ["stop", "prevent"]
1114
+ )
1115
+ }),
1116
+ d(y.FmMenuItem, {
1117
+ label: l("menu.common.actions.delete"),
1118
+ disabled: r.remove.state !== "allowed",
1119
+ onClick: D(
1120
+ () => Pl(r),
1121
+ ["stop", "prevent"]
1122
+ )
1123
+ })
1124
+ ]
1125
+ }
1126
+ )
1127
+ );
1128
+ }
1129
+ }
1130
+ ];
1131
+ });
1132
+ return Nl(() => {
1133
+ v.sdk.group.setAttributeFilter(null), X(), Ve(), Oe(), j.value && ue(), G.value && Pe(), me(), Ce(), m.value.dispose();
1134
+ }), (e, a) => {
1135
+ const r = $("FmButton"), C = $("FmCircularProgress"), k = $("FmIcon"), L = $("FmChip"), Z = $("FmMenuItem"), pe = $("FmMenu"), Il = $("FmSearch"), Ue = $("FmTable"), He = $("FmTooltip"), ve = $("FmStepperField"), ge = $("FmFormGroup"), Ie = $("FmSwitch"), Ae = $("FmSideSheet");
1136
+ return i(), w(Jl, {
1137
+ heading: e.heading || t(l)("menu.group.title")
1138
+ }, {
1139
+ "prepend-heading": c(() => [
1140
+ ye(e.$slots, "prepend-heading")
1141
+ ]),
1142
+ "append-heading": c(() => {
1143
+ var ee;
1144
+ return [
1145
+ e.catalogPage ? f("", !0) : (i(), b("div", Ia, [
1146
+ u("div", Aa, [
1147
+ s(Ql, {
1148
+ value: t(S)(((ee = p.value) == null ? void 0 : ee.filteredCount) ?? 0)
1149
+ }, null, 8, ["value"])
1150
+ ]),
1151
+ p.value && p.value.filteredCount > 0 ? (i(), w(r, {
1152
+ key: 0,
1153
+ disabled: p.value.create.state !== "allowed",
1154
+ label: t(l)("menu.group.actions.add"),
1155
+ "prepend-icon": "add",
1156
+ onClick: je
1157
+ }, null, 8, ["disabled", "label"])) : f("", !0)
1158
+ ])),
1159
+ e.catalogPage ? (i(), b("div", Na, [
1160
+ ye(e.$slots, "append-heading")
1161
+ ])) : ye(e.$slots, "append-heading", { key: 2 })
1162
+ ];
1163
+ }),
1164
+ default: c(() => {
1165
+ var ee, Qe, Je, We, Xe;
1166
+ return [
1167
+ ye(e.$slots, "navigation"),
1168
+ t(V).status === "error" ? (i(), b("p", La, x(t(_)(t(V).error.message)), 1)) : t(V).status === "unavailable" ? (i(), b("div", Da, [
1169
+ s(t(tl), {
1170
+ title: t(l)("menu.group.empty.title"),
1171
+ subtitle: t(l)("menu.group.empty.subtitle")
1172
+ }, null, 8, ["title", "subtitle"])
1173
+ ])) : t(V).status === "loading" ? (i(), w(C, { key: 2 })) : p.value && p.value.totalCount === 0 ? (i(), w(t(tl), {
1174
+ key: 3,
1175
+ action: p.value.create.state === "allowed" ? { text: t(l)("menu.group.actions.add"), callback: je } : void 0,
1176
+ title: t(l)("menu.group.empty.title"),
1177
+ subtitle: t(l)("menu.group.empty.subtitle")
1178
+ }, null, 8, ["action", "title", "subtitle"])) : p.value ? (i(), b(z, { key: 4 }, [
1179
+ u("div", za, [
1180
+ p.value.scope.schedulerSelector.state === "allowed" ? (i(), w(Zl, {
1181
+ key: 0,
1182
+ options: pl.value,
1183
+ "model-value": p.value.scope.schedulerId,
1184
+ title: t(l)("menu.common.labels.scheduler_title", {
1185
+ label: p.value.scope.schedulerLabel ?? t(l)("menu.common.labels.summary")
1186
+ }),
1187
+ "onUpdate:modelValue": a[0] || (a[0] = (n) => e.sdk.item.selectScope({
1188
+ catalogId: p.value.scope.catalogId,
1189
+ schedulerId: n
1190
+ }))
1191
+ }, {
1192
+ default: c(() => [
1193
+ p.value.attributeFilterVisible ? (i(), b("button", {
1194
+ key: 0,
1195
+ type: "button",
1196
+ class: "pl-8 flex items-center justify-center border-l border-fm-color-neutral-gray-200",
1197
+ "aria-label": t(l)("menu.product.attributes.filter"),
1198
+ onClick: D(oe, ["stop"])
1199
+ }, [
1200
+ s(k, {
1201
+ name: "filter_alt",
1202
+ outline: "",
1203
+ color: "neutral-gray-400",
1204
+ size: "sm"
1205
+ })
1206
+ ], 8, Ea)) : f("", !0)
1207
+ ]),
1208
+ _: 1
1209
+ }, 8, ["options", "model-value", "title"])) : p.value.showType ? f("", !0) : (i(), b("div", Ma)),
1210
+ p.value.showType ? (i(), w(pe, {
1211
+ key: 2,
1212
+ "close-on-click": ""
1213
+ }, {
1214
+ "menu-button": c(() => [
1215
+ s(L, {
1216
+ class: "text-fm-color-typo-secondary",
1217
+ label: t(l)("menu.group.type.title", {
1218
+ type: p.value.typeFilter ? t(l)(t(nl)[p.value.typeFilter]) : t(l)("menu.common.labels.all")
1219
+ }),
1220
+ "right-icon": "keyboard_arrow_down"
1221
+ }, null, 8, ["label"])
1222
+ ]),
1223
+ default: c(() => [
1224
+ s(Z, {
1225
+ class: "px-16 py-8",
1226
+ label: t(l)("menu.group.type.all"),
1227
+ onClick: a[1] || (a[1] = (n) => v.sdk.group.setTypeFilter(null))
1228
+ }, null, 8, ["label"]),
1229
+ (i(), b(z, null, Y(ke, (n) => s(Z, {
1230
+ key: n,
1231
+ class: "px-16 py-8",
1232
+ label: t(l)(E[n]),
1233
+ onClick: (h) => v.sdk.group.setTypeFilter(n)
1234
+ }, null, 8, ["label", "onClick"])), 64))
1235
+ ]),
1236
+ _: 1
1237
+ })) : f("", !0),
1238
+ u("div", Ba, [
1239
+ s(Il, {
1240
+ autofocus: "",
1241
+ "model-value": p.value.query,
1242
+ placeholder: t(l)("menu.group.search.placeholder"),
1243
+ "aria-label": t(l)("menu.common.labels.search_groups"),
1244
+ "onUpdate:modelValue": v.sdk.group.search
1245
+ }, null, 8, ["model-value", "placeholder", "aria-label", "onUpdate:modelValue"])
1246
+ ])
1247
+ ]),
1248
+ A.value ? (i(), w(Xl, {
1249
+ key: 0,
1250
+ ref_key: "filterControl",
1251
+ ref: te,
1252
+ entity: "group",
1253
+ attributes: p.value.attributeOptions,
1254
+ rule: p.value.attributeRule,
1255
+ "onUpdate:rule": a[2] || (a[2] = (n) => v.sdk.group.setAttributeFilter(n))
1256
+ }, null, 8, ["attributes", "rule"])) : f("", !0),
1257
+ Ll(s(Ue, {
1258
+ "column-defs": Ul.value,
1259
+ "column-visibility": { type: p.value.showType },
1260
+ draggable: Sl.value,
1261
+ "page-size": p.value.rows.length,
1262
+ "row-data": ce.value,
1263
+ "shrink-at": !1,
1264
+ "hide-footer": "",
1265
+ "pin-header-row": "",
1266
+ onDndChanged: Tl,
1267
+ onRowClick: a[3] || (a[3] = (n) => Ke(n.original))
1268
+ }, null, 8, ["column-defs", "column-visibility", "draggable", "page-size", "row-data"]), [
1269
+ [t(oa), t(l)("menu.group.list.columns.name")]
1270
+ ])
1271
+ ], 64)) : f("", !0),
1272
+ ((ee = o.value) == null ? void 0 : ee.mode) === "update" ? (i(), w(Ae, {
1273
+ key: 5,
1274
+ modelValue: ne.value,
1275
+ "onUpdate:modelValue": a[10] || (a[10] = (n) => ne.value = n),
1276
+ "is-container": t(y).FmForm,
1277
+ "is-container-props": { onValidationSuccess: qe },
1278
+ "max-width": 800
1279
+ }, {
1280
+ "side-sheet-header": c(() => [
1281
+ u("p", Ra, x(t(l)("menu.group.update")), 1)
1282
+ ]),
1283
+ "side-sheet-footer": c(() => [
1284
+ u("div", Za, [
1285
+ s(r, {
1286
+ disabled: o.value.submit.state !== "allowed",
1287
+ label: t(l)("menu.common.actions.update"),
1288
+ size: "lg",
1289
+ type: "submit"
1290
+ }, null, 8, ["disabled", "label"]),
1291
+ s(r, {
1292
+ label: t(l)("menu.common.actions.cancel"),
1293
+ size: "lg",
1294
+ variant: "tertiary",
1295
+ onClick: de
1296
+ }, null, 8, ["label"])
1297
+ ])
1298
+ ]),
1299
+ default: c(() => [
1300
+ u("div", Ga, [
1301
+ s(il, null, {
1302
+ default: c(() => {
1303
+ var n;
1304
+ return [
1305
+ s(ae, el({
1306
+ autofocus: "",
1307
+ disabled: o.value.fields.name.state !== "allowed",
1308
+ "error-messages": ie.value ? [t(_)(ie.value)] : [],
1309
+ label: t(l)("menu.common.labels.group_name"),
1310
+ "model-value": o.value.name
1311
+ }, t(K).field("name", m.value.setName)), {
1312
+ append: c(() => [
1313
+ s(He, {
1314
+ placement: "top",
1315
+ variant: "plain",
1316
+ "z-index": 999
1317
+ }, {
1318
+ default: c(() => [
1319
+ s(r, {
1320
+ "aria-label": t(l)("menu.group.translation.translate_name"),
1321
+ disabled: o.value.fields.name.state !== "allowed",
1322
+ icon: "g_translate",
1323
+ variant: "tertiary",
1324
+ onClick: Re
1325
+ }, null, 8, ["aria-label", "disabled"])
1326
+ ]),
1327
+ _: 1
1328
+ })
1329
+ ]),
1330
+ _: 1
1331
+ }, 16, ["disabled", "error-messages", "label", "model-value"]),
1332
+ s(ge, {
1333
+ "model-value": `${o.value.min} ${o.value.max}`
1334
+ }, {
1335
+ default: c(() => [
1336
+ s(ul, null, {
1337
+ default: c(() => [
1338
+ s(ve, {
1339
+ class: "flex-1",
1340
+ disabled: o.value.fields.bounds.state !== "allowed",
1341
+ "helper-text": o.value.hidden ? t(l)("menu.common.labels.min_locked_while_hidden") : void 0,
1342
+ label: t(l)("menu.common.labels.min_select"),
1343
+ min: 0,
1344
+ "model-value": o.value.min,
1345
+ "onUpdate:modelValue": m.value.setMin
1346
+ }, null, 8, ["disabled", "helper-text", "label", "model-value", "onUpdate:modelValue"]),
1347
+ s(ve, {
1348
+ class: "flex-1",
1349
+ disabled: o.value.fields.bounds.state !== "allowed",
1350
+ label: t(l)("menu.common.labels.max_select"),
1351
+ min: o.value.min,
1352
+ "model-value": o.value.max,
1353
+ "onUpdate:modelValue": m.value.setMax
1354
+ }, null, 8, ["disabled", "label", "min", "model-value", "onUpdate:modelValue"])
1355
+ ]),
1356
+ _: 1
1357
+ })
1358
+ ]),
1359
+ _: 1
1360
+ }, 8, ["model-value"]),
1361
+ s(rl, {
1362
+ label: t(l)("menu.common.labels.configuration")
1363
+ }, {
1364
+ default: c(() => [
1365
+ u("div", ja, [
1366
+ s(Ie, {
1367
+ disabled: o.value.fields.stackable.state !== "allowed",
1368
+ label: t(l)("menu.common.labels.stackable"),
1369
+ "label-placement": "right",
1370
+ "model-value": o.value.stackable,
1371
+ sublabel: t(l)("menu.common.labels.stackable_sublabel"),
1372
+ "onUpdate:modelValue": m.value.setStackable
1373
+ }, null, 8, ["disabled", "label", "model-value", "sublabel", "onUpdate:modelValue"]),
1374
+ o.value.hide.state !== "hidden" ? (i(), w(Ie, {
1375
+ key: 0,
1376
+ disabled: o.value.hide.state !== "allowed",
1377
+ label: t(l)("menu.common.labels.hide_group"),
1378
+ "label-placement": "right",
1379
+ "model-value": o.value.hidden,
1380
+ sublabel: t(l)("menu.common.labels.hide_group_sublabel_catalog"),
1381
+ "onUpdate:modelValue": a[4] || (a[4] = (h) => m.value.setHidden(!!h))
1382
+ }, null, 8, ["disabled", "label", "model-value", "sublabel"])) : f("", !0)
1383
+ ])
1384
+ ]),
1385
+ _: 1
1386
+ }, 8, ["label"]),
1387
+ (n = o.value.tagging) != null && n.visible ? (i(), w(fe, {
1388
+ key: 0,
1389
+ "sub-title": t(l)("menu.group.form.tagging.subtitle"),
1390
+ title: t(l)("menu.group.form.tagging.title")
1391
+ }, {
1392
+ default: c(() => [
1393
+ s(t(ll), {
1394
+ entity: "group",
1395
+ "model-value": o.value.customAttributes ?? {},
1396
+ "value-options": Me(o.value.attributeValueOptions),
1397
+ "onUpdate:modelValue": a[5] || (a[5] = (h) => m.value.setCustomAttributes(h ?? null))
1398
+ }, null, 8, ["model-value", "value-options"])
1399
+ ]),
1400
+ _: 1
1401
+ }, 8, ["sub-title", "title"])) : f("", !0)
1402
+ ];
1403
+ }),
1404
+ _: 1
1405
+ }),
1406
+ o.value.hidden ? (i(), b("div", Ka, [
1407
+ s(k, {
1408
+ class: "shrink-0",
1409
+ color: "system-warning-400",
1410
+ name: "visibility_off",
1411
+ outline: "",
1412
+ size: "sm"
1413
+ }),
1414
+ u("div", Ya, [
1415
+ u("p", qa, x(t(l)("menu.common.labels.hide_group_notice")), 1),
1416
+ u("p", Ha, x(t(l)("menu.common.labels.hide_group_notice_reset")), 1)
1417
+ ])
1418
+ ])) : f("", !0),
1419
+ s(ge, {
1420
+ class: Le(
1421
+ o.value.hidden ? "opacity-50 pointer-events-none" : void 0
1422
+ ),
1423
+ inert: o.value.hidden || void 0,
1424
+ tag: "div",
1425
+ "helper-text": t(l)("menu.common.validation.default_items_tip", {
1426
+ count: o.value.options.filter((n) => n.isDefault).length,
1427
+ max: o.value.max
1428
+ }),
1429
+ "model-value": o.value.options
1430
+ }, {
1431
+ default: c(() => [
1432
+ s(fe, {
1433
+ class: "mb-8",
1434
+ "sub-title": o.value.linkOptions.state !== "hidden" ? t(l)("menu.group.option.subtitle") : "",
1435
+ title: t(l)("menu.group.option.title")
1436
+ }, {
1437
+ "append-title": c(() => [
1438
+ o.value.linkOptions.state !== "hidden" ? (i(), b("div", Qa, [
1439
+ s(r, {
1440
+ disabled: o.value.linkOptions.state !== "allowed",
1441
+ "border-color": "primary",
1442
+ label: t(l)("menu.group.option.link_products"),
1443
+ "prepend-icon": "link",
1444
+ "text-color": "primary",
1445
+ variant: "secondary",
1446
+ onClick: a[6] || (a[6] = (n) => B.value = !0)
1447
+ }, null, 8, ["disabled", "label"])
1448
+ ])) : o.value.addOption.state !== "hidden" ? (i(), b("div", Ja, [
1449
+ s(r, {
1450
+ disabled: o.value.addOption.state !== "allowed",
1451
+ "border-color": "primary",
1452
+ label: t(l)("menu.group.option.add_option"),
1453
+ "prepend-icon": "add",
1454
+ "text-color": "primary",
1455
+ variant: "secondary",
1456
+ onClick: a[7] || (a[7] = (n) => m.value.addOption())
1457
+ }, null, 8, ["disabled", "label"])
1458
+ ])) : f("", !0)
1459
+ ]),
1460
+ default: c(() => [
1461
+ u("div", Wa, [
1462
+ u("div", Xa, [
1463
+ s(Ue, {
1464
+ "column-defs": Se.value,
1465
+ draggable: $e.value.length > 1,
1466
+ "expanded-state": re.value,
1467
+ "get-row-can-expand": (n) => n.depth === 0 && n.original.variants.length > 0,
1468
+ "get-row-id": (n) => n.target === "base" ? n.id : `${n.id}:${n.target}`,
1469
+ "page-size": vl.value,
1470
+ "row-data": $e.value,
1471
+ "shrink-at": !1,
1472
+ "hide-footer": "",
1473
+ "onUpdate:expandedState": a[8] || (a[8] = (n) => re.value = n),
1474
+ onDndChanged: a[9] || (a[9] = (n) => m.value.reorderOptions(
1475
+ n.map((h) => h.id)
1476
+ ))
1477
+ }, null, 8, ["column-defs", "draggable", "expanded-state", "get-row-can-expand", "get-row-id", "page-size", "row-data"])
1478
+ ])
1479
+ ])
1480
+ ]),
1481
+ _: 1
1482
+ }, 8, ["sub-title", "title"])
1483
+ ]),
1484
+ _: 1
1485
+ }, 8, ["class", "inert", "helper-text", "model-value"]),
1486
+ (i(!0), b(z, null, Y(Ee.value, (n, h) => (i(), b("p", {
1487
+ key: `${n.code}-${h}`,
1488
+ class: "fm-typo-en-body-sm-400 text-fm-color-status-error",
1489
+ role: "alert"
1490
+ }, x(t(_)(n)), 1))), 128))
1491
+ ])
1492
+ ]),
1493
+ _: 1
1494
+ }, 8, ["modelValue", "is-container", "is-container-props"])) : f("", !0),
1495
+ s(Ae, {
1496
+ "model-value": he.value,
1497
+ "is-container": t(y).FmForm,
1498
+ "is-container-props": { onValidationSuccess: $l },
1499
+ "max-width": 560,
1500
+ "onUpdate:modelValue": a[14] || (a[14] = (n) => !n && X())
1501
+ }, {
1502
+ "side-sheet-footer": c(() => {
1503
+ var n;
1504
+ return [
1505
+ u("div", at, [
1506
+ s(r, {
1507
+ disabled: ((n = U.value) == null ? void 0 : n.submit.state) !== "allowed",
1508
+ label: t(l)("menu.common.actions.save"),
1509
+ size: "lg",
1510
+ type: "submit"
1511
+ }, null, 8, ["disabled", "label"]),
1512
+ s(r, {
1513
+ label: t(l)("menu.common.actions.cancel"),
1514
+ size: "lg",
1515
+ variant: "tertiary",
1516
+ onClick: X
1517
+ }, null, 8, ["label"])
1518
+ ])
1519
+ ];
1520
+ }),
1521
+ default: c(() => {
1522
+ var n, h, Ze;
1523
+ return [
1524
+ T.value.status === "error" ? (i(), b("p", et, x(t(_)(T.value.error.message)), 1)) : T.value.status === "unavailable" ? (i(), b("p", lt, x(t(_)(T.value.reason)), 1)) : T.value.status === "loading" ? (i(), w(C, { key: 2 })) : U.value ? (i(), w(Bl, {
1525
+ key: 3,
1526
+ "applied-count": ((n = U.value) == null ? void 0 : n.appliedProductCount) ?? 0,
1527
+ groups: ((h = U.value) == null ? void 0 : h.linkedGroups) ?? [],
1528
+ query: ((Ze = U.value) == null ? void 0 : Ze.linkedProductQuery) ?? "",
1529
+ title: t(l)("menu.group.option.title"),
1530
+ onUnapply: a[12] || (a[12] = (be) => {
1531
+ var le;
1532
+ return (le = N.value) == null ? void 0 : le.unlinkProduct(be);
1533
+ }),
1534
+ "onUpdate:query": a[13] || (a[13] = (be) => {
1535
+ var le;
1536
+ return (le = N.value) == null ? void 0 : le.setLinkedProductQuery(be);
1537
+ })
1538
+ }, {
1539
+ "append-title": c(() => [
1540
+ s(r, {
1541
+ label: t(l)("menu.group.actions.apply_product"),
1542
+ "prepend-icon": "link",
1543
+ variant: "secondary",
1544
+ onClick: a[11] || (a[11] = (be) => R.value = !0)
1545
+ }, null, 8, ["label"])
1546
+ ]),
1547
+ _: 1
1548
+ }, 8, ["applied-count", "groups", "query", "title"])) : f("", !0)
1549
+ ];
1550
+ }),
1551
+ _: 1
1552
+ }, 8, ["model-value", "is-container", "is-container-props"]),
1553
+ T.value.status === "ready" ? (i(), w(sl, {
1554
+ key: 6,
1555
+ modelValue: R.value,
1556
+ "onUpdate:modelValue": a[15] || (a[15] = (n) => R.value = n),
1557
+ catalogue: ze.value,
1558
+ "selected-product-ids": ((Qe = U.value) == null ? void 0 : Qe.linkedProductIds) ?? [],
1559
+ title: t(l)("menu.common.actions.link_product"),
1560
+ onSubmit: Cl
1561
+ }, null, 8, ["modelValue", "catalogue", "selected-product-ids", "title"])) : f("", !0),
1562
+ s(sl, {
1563
+ modelValue: B.value,
1564
+ "onUpdate:modelValue": a[16] || (a[16] = (n) => B.value = n),
1565
+ catalogue: ze.value,
1566
+ "selected-products": ((Je = o.value) == null ? void 0 : Je.optionLinks) ?? [],
1567
+ "select-variant": !0,
1568
+ title: t(l)("menu.group.option.link_products"),
1569
+ onSubmitLinks: Fl
1570
+ }, null, 8, ["modelValue", "catalogue", "selected-products", "title"]),
1571
+ j.value && o.value ? (i(), w(ea, {
1572
+ key: 7,
1573
+ dirty: o.value.translationDirty,
1574
+ "model-value": !0,
1575
+ name: o.value.name,
1576
+ "name-locale": o.value.nameLocale,
1577
+ "name-section-label": t(l)("menu.common.translation.name_section", {
1578
+ entity: t(l)("menu.group.title")
1579
+ }),
1580
+ "supported-locales": o.value.supportedLocales,
1581
+ title: t(l)("menu.group.translation.title"),
1582
+ onDiscard: ue,
1583
+ onSave: wl,
1584
+ "onUpdate:modelValue": a[17] || (a[17] = (n) => !n && ue()),
1585
+ "onUpdate:name": a[18] || (a[18] = (n) => m.value.setName(n)),
1586
+ "onUpdate:nameLocale": a[19] || (a[19] = (n) => m.value.setNameLocale(n))
1587
+ }, null, 8, ["dirty", "name", "name-locale", "name-section-label", "supported-locales", "title"])) : f("", !0),
1588
+ o.value ? (i(), w(Ua, {
1589
+ key: 8,
1590
+ "model-value": G.value,
1591
+ session: m.value,
1592
+ view: o.value,
1593
+ onDiscard: Pe,
1594
+ onSave: kl
1595
+ }, null, 8, ["model-value", "session", "view"])) : f("", !0),
1596
+ Q.value ? (i(), w(Yl, {
1597
+ key: 9,
1598
+ session: Q.value,
1599
+ "on-create-price-group": yl,
1600
+ onClose: Ve
1601
+ }, null, 8, ["session"])) : f("", !0),
1602
+ J.value ? (i(), w(t(we), {
1603
+ key: 10,
1604
+ "product-name": Fe.value,
1605
+ session: J.value,
1606
+ onClose: Oe
1607
+ }, null, 8, ["product-name", "session"])) : f("", !0),
1608
+ s(ql, {
1609
+ sdk: v.sdk,
1610
+ session: se.value,
1611
+ "currency-code": (We = o.value) == null ? void 0 : We.currencyCode,
1612
+ onClose: me
1613
+ }, null, 8, ["sdk", "session", "currency-code"]),
1614
+ M.value && Te.value ? (i(), w(Hl, {
1615
+ key: 11,
1616
+ sdk: v.sdk,
1617
+ onClose: de,
1618
+ onCreated: xl
1619
+ }, null, 8, ["sdk"])) : f("", !0),
1620
+ ((Xe = o.value) == null ? void 0 : Xe.mode) === "create" && !Te.value ? (i(), w(Ae, {
1621
+ key: 12,
1622
+ modelValue: M.value,
1623
+ "onUpdate:modelValue": a[23] || (a[23] = (n) => M.value = n),
1624
+ "is-container": t(y).FmForm,
1625
+ "is-container-props": { onValidationSuccess: qe },
1626
+ "max-width": 800
1627
+ }, {
1628
+ "side-sheet-header": c(() => [
1629
+ u("p", tt, x(t(l)("menu.group.add")), 1)
1630
+ ]),
1631
+ "side-sheet-footer": c(() => [
1632
+ u("div", it, [
1633
+ s(r, {
1634
+ disabled: o.value.submit.state !== "allowed",
1635
+ label: t(l)("menu.common.actions.add"),
1636
+ size: "lg",
1637
+ type: "submit"
1638
+ }, null, 8, ["disabled", "label"]),
1639
+ s(r, {
1640
+ label: t(l)("menu.common.actions.cancel"),
1641
+ size: "lg",
1642
+ variant: "tertiary",
1643
+ onClick: de
1644
+ }, null, 8, ["label"])
1645
+ ])
1646
+ ]),
1647
+ default: c(() => [
1648
+ u("div", ot, [
1649
+ s(il, null, {
1650
+ default: c(() => {
1651
+ var n;
1652
+ return [
1653
+ s(ae, el({
1654
+ autofocus: "",
1655
+ "error-messages": ie.value ? [t(_)(ie.value)] : [],
1656
+ label: t(l)("menu.common.labels.group_name"),
1657
+ "model-value": o.value.name
1658
+ }, t(K).field("name", m.value.setName)), {
1659
+ append: c(() => [
1660
+ s(He, {
1661
+ placement: "top",
1662
+ variant: "plain",
1663
+ "z-index": 999
1664
+ }, {
1665
+ default: c(() => {
1666
+ var h;
1667
+ return [
1668
+ s(r, {
1669
+ "aria-label": t(l)("menu.group.translation.translate_name"),
1670
+ disabled: ((h = o.value.translation) == null ? void 0 : h.state) !== "allowed",
1671
+ icon: "g_translate",
1672
+ variant: "tertiary",
1673
+ onClick: Re
1674
+ }, null, 8, ["aria-label", "disabled"])
1675
+ ];
1676
+ }),
1677
+ _: 1
1678
+ })
1679
+ ]),
1680
+ _: 1
1681
+ }, 16, ["error-messages", "label", "model-value"]),
1682
+ s(ge, {
1683
+ "model-value": `${o.value.min} ${o.value.max}`
1684
+ }, {
1685
+ default: c(() => [
1686
+ s(ul, null, {
1687
+ default: c(() => [
1688
+ s(ve, {
1689
+ class: "flex-1",
1690
+ label: t(l)("menu.common.labels.min_select"),
1691
+ min: 0,
1692
+ "model-value": o.value.min,
1693
+ "onUpdate:modelValue": m.value.setMin
1694
+ }, null, 8, ["label", "model-value", "onUpdate:modelValue"]),
1695
+ s(ve, {
1696
+ class: "flex-1",
1697
+ label: t(l)("menu.common.labels.max_select"),
1698
+ min: o.value.min,
1699
+ "model-value": o.value.max,
1700
+ "onUpdate:modelValue": m.value.setMax
1701
+ }, null, 8, ["label", "min", "model-value", "onUpdate:modelValue"])
1702
+ ]),
1703
+ _: 1
1704
+ })
1705
+ ]),
1706
+ _: 1
1707
+ }, 8, ["model-value"]),
1708
+ s(rl, {
1709
+ label: t(l)("menu.common.labels.configuration")
1710
+ }, {
1711
+ default: c(() => [
1712
+ s(Ie, {
1713
+ label: t(l)("menu.common.labels.stackable"),
1714
+ "label-placement": "right",
1715
+ "model-value": o.value.stackable,
1716
+ sublabel: t(l)("menu.common.labels.stackable_sublabel"),
1717
+ "onUpdate:modelValue": m.value.setStackable
1718
+ }, null, 8, ["label", "model-value", "sublabel", "onUpdate:modelValue"])
1719
+ ]),
1720
+ _: 1
1721
+ }, 8, ["label"]),
1722
+ (n = o.value.tagging) != null && n.visible ? (i(), w(fe, {
1723
+ key: 0,
1724
+ "sub-title": t(l)("menu.group.form.tagging.subtitle"),
1725
+ title: t(l)("menu.group.form.tagging.title")
1726
+ }, {
1727
+ default: c(() => [
1728
+ s(t(ll), {
1729
+ entity: "group",
1730
+ "model-value": o.value.customAttributes ?? {},
1731
+ "value-options": Me(o.value.attributeValueOptions),
1732
+ "onUpdate:modelValue": a[20] || (a[20] = (h) => m.value.setCustomAttributes(h ?? null))
1733
+ }, null, 8, ["model-value", "value-options"])
1734
+ ]),
1735
+ _: 1
1736
+ }, 8, ["sub-title", "title"])) : f("", !0)
1737
+ ];
1738
+ }),
1739
+ _: 1
1740
+ }),
1741
+ s(ge, {
1742
+ tag: "div",
1743
+ "helper-text": t(l)("menu.common.validation.default_items_tip", {
1744
+ count: o.value.options.filter((n) => n.isDefault).length,
1745
+ max: o.value.max
1746
+ }),
1747
+ "model-value": o.value.options
1748
+ }, {
1749
+ default: c(() => [
1750
+ s(fe, {
1751
+ class: "mb-8",
1752
+ "sub-title": t(l)("menu.group.option.subtitle"),
1753
+ title: t(l)("menu.group.option.title")
1754
+ }, {
1755
+ "append-title": c(() => [
1756
+ u("div", null, [
1757
+ s(r, {
1758
+ "border-color": "primary",
1759
+ label: t(l)("menu.group.option.link_products"),
1760
+ "prepend-icon": "link",
1761
+ "text-color": "primary",
1762
+ variant: "secondary",
1763
+ onClick: a[21] || (a[21] = (n) => B.value = !0)
1764
+ }, null, 8, ["label"])
1765
+ ])
1766
+ ]),
1767
+ default: c(() => [
1768
+ u("div", nt, [
1769
+ u("div", st, [
1770
+ s(Ue, {
1771
+ "column-defs": hl.value,
1772
+ draggable: o.value.options.length > 1,
1773
+ "page-size": Math.max(o.value.options.length, 1),
1774
+ "row-data": [...o.value.options],
1775
+ "shrink-at": !1,
1776
+ "hide-footer": "",
1777
+ onDndChanged: a[22] || (a[22] = (n) => m.value.reorderOptions(
1778
+ n.map((h) => h.id)
1779
+ ))
1780
+ }, null, 8, ["column-defs", "draggable", "page-size", "row-data"])
1781
+ ])
1782
+ ])
1783
+ ]),
1784
+ _: 1
1785
+ }, 8, ["sub-title", "title"])
1786
+ ]),
1787
+ _: 1
1788
+ }, 8, ["helper-text", "model-value"]),
1789
+ (i(!0), b(z, null, Y(Ee.value, (n, h) => (i(), b("p", {
1790
+ key: `${n.code}-${h}`,
1791
+ class: "fm-typo-en-body-sm-400 text-fm-color-status-error",
1792
+ role: "alert"
1793
+ }, x(t(_)(n)), 1))), 128))
1794
+ ])
1795
+ ]),
1796
+ _: 1
1797
+ }, 8, ["modelValue", "is-container", "is-container-props"])) : f("", !0)
1798
+ ];
1799
+ }),
1800
+ _: 3
1801
+ }, 8, ["heading"]);
1802
+ };
1803
+ }
1804
+ });
1805
+ export {
1806
+ Vt as _
1807
+ };