@feedmepos/mf-connect 0.1.20-prod → 0.1.22-prod

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 (91) hide show
  1. package/dist/{Analytic-DaYL4IwZ.js → Analytic-CWvtQiXv.js} +10 -10
  2. package/dist/{App-CnRrmva6.js → App-BqAI4Hkg.js} +7 -7
  3. package/dist/{Bin-Bf8yL56G.js → Bin-BJRETFYp.js} +7 -7
  4. package/dist/{Broadcast-CyqZZRc1.js → Broadcast-BVNKXpst.js} +8 -8
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BBAGO9mc.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BeauGnZ8.js} +6 -6
  6. package/dist/{Card-BHOw7yjA.js → Card-BH5HR_Xt.js} +14 -14
  7. package/dist/{Collections-DQYk52tc.js → Collections-DUzS8_tu.js} +5 -5
  8. package/dist/{Credit-BVD4wCLN.js → Credit-DVyhB8Fx.js} +8 -8
  9. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-EdpoxZlh.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BzSJIIBN.js} +28 -27
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-1tSUOxmX.js → EffectSheet.vue_vue_type_style_index_0_lang-CtgRejaJ.js} +45 -45
  11. package/dist/{Experience-BKTJKeqW.js → Experience-Uz-PdyS0.js} +8 -8
  12. package/dist/{Game-DDnwUySW.js → Game-yRSag2UH.js} +8 -8
  13. package/dist/{Index-Cf6d9PW1.js → Index-D54c-_3K.js} +9 -9
  14. package/dist/{MainLayout-DpZC6o3R.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js} +19 -53
  15. package/dist/MainLayout-B1aJoR95.js +41 -0
  16. package/dist/{Marketing-Dm2ECeZM.js → Marketing-wYfRoaP3.js} +12 -12
  17. package/dist/{Member-Bjx7KU3k.js → Member-BeX0-b7n.js} +4 -4
  18. package/dist/{MemberList-BEiuLggu.js → MemberList-B2dwBE3o.js} +23 -23
  19. package/dist/{MemberTransactions-C3YdUquh.js → MemberTransactions-jhOw4vzq.js} +1 -1
  20. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-B8b8FbZX.js +447 -0
  21. package/dist/{Mission-CZ-jJd14.js → Mission-DzBDmz68.js} +8 -8
  22. package/dist/{Overview-CgbAmJNJ.js → Overview-DZ1-IMkf.js} +16 -16
  23. package/dist/{Point-Bt3nTcqr.js → Point-aP-KiJV2.js} +8 -8
  24. package/dist/{Promotion-DnMvO6sH.js → Promotion-NYlrI4Ur.js} +9 -9
  25. package/dist/{Record-DGSd8OoA.js → Record-C3FG6v0j.js} +6 -6
  26. package/dist/{Reward-DjSvoVKB.js → Reward-BkgfktZX.js} +14 -14
  27. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CD5NQYu7.js → RewardGroup.vue_vue_type_script_setup_true_lang-CBkgYcan.js} +10 -10
  28. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DL9sCsHT.js → RuleGroup.vue_vue_type_script_setup_true_lang-DgTRcfYy.js} +181 -178
  29. package/dist/{Segment-CwyALcvm.js → Segment-BdCYCRF-.js} +13 -13
  30. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BpM7WgFp.js → SelectItems.vue_vue_type_script_setup_true_lang-DIWVzxxW.js} +2 -2
  31. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-Bwa2RvTx.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BBXjK-Kc.js} +3 -3
  32. package/dist/Setting-CklTyVlf.js +1930 -0
  33. package/dist/{Store-BTejxCBe.js → Store-Ciud1AgX.js} +145 -143
  34. package/dist/StoreRewards-DUrZvdAy.js +422 -0
  35. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-B-z5tu9A.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DabfW0cB.js} +17 -17
  36. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CpIVuHaf.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-C4g0D2WQ.js} +1 -1
  37. package/dist/{Tier-njMn6MiO.js → Tier-BcJfsKXP.js} +19 -19
  38. package/dist/{Title-Db8js_gS.js → Title-rtBtv9oZ.js} +100 -100
  39. package/dist/{Transaction-D9TjDeKD.js → Transaction-6fAgm3SK.js} +2 -2
  40. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-Bod8YjzJ.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Bjvkwpb4.js} +6 -6
  41. package/dist/{Voucher--yr4TQ-G.js → Voucher-DsSs5cTE.js} +34 -34
  42. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CeL94a07.js → VoucherEditor.vue_vue_type_script_setup_true_lang-CrSH0qWc.js} +10 -10
  43. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BCc_w9J8.js → ZodTextField.vue_vue_type_script_setup_true_lang-DxDO6zJg.js} +1 -1
  44. package/dist/{app-BqAFUCz8.js → app-Cz0McG8i.js} +40 -40
  45. package/dist/{app-Ugrk96Pp.js → app-fPygt_FG.js} +1 -1
  46. package/dist/app.js +1 -1
  47. package/dist/{business-CTwB-cPM.js → business-wZVszwRW.js} +1 -1
  48. package/dist/{campaign-DwL2D9J5.js → campaign-B-WMI4r4.js} +9 -9
  49. package/dist/{campaign-CKZMkxH5.js → campaign-CXOSMRjR.js} +2 -2
  50. package/dist/{campaign.enum-uKI06HHx.js → campaign.enum-xd3odOwZ.js} +1 -1
  51. package/dist/{campaign.fn-Dp8mlrpN.js → campaign.fn-CeIsYBHA.js} +41 -41
  52. package/dist/{collectible.enum-Bw421zWp.js → collectible.enum-B7uqKLHE.js} +1 -1
  53. package/dist/{collection.fn-D2zmqc53.js → collection.fn-Cj3PpbiS.js} +2 -2
  54. package/dist/{dto-FP61IJwc.js → dto-CVyFNO4G.js} +7 -7
  55. package/dist/{effect-BE4EnD4B.js → effect-D8WiNma1.js} +35 -18
  56. package/dist/{email-addresses-D8_sMdak.js → email-addresses-CZGh6TJT.js} +1 -1
  57. package/dist/{export-kgzxrVkq.js → export-B-yEeKMb.js} +3 -3
  58. package/dist/{helper-BI6pWRqN.js → helper-rlgqVAdj.js} +1 -1
  59. package/dist/{index-DTbigOhK.js → index-BC2la2BP.js} +1 -1
  60. package/dist/{index-COe4sMRZ.js → index-BSWItpEw.js} +1 -1
  61. package/dist/{index-sLN88aCQ.js → index-BYP79OMe.js} +225 -218
  62. package/dist/{index-DcBjYW9W.js → index-C73nKr6T.js} +1 -1
  63. package/dist/{index-BUXc2Nw5.js → index-C9Eegvas.js} +1 -1
  64. package/dist/{index-BpBt6Y8F.js → index-CH0xVjYG.js} +1 -1
  65. package/dist/{index-DoHEyLZn.js → index-CgA8VVym.js} +3 -3
  66. package/dist/{index-aOnN-LXC.js → index-Cr8x5i6a.js} +12 -5
  67. package/dist/{index-DLIjZTu7.js → index-DENLOr_f.js} +21 -16
  68. package/dist/index-DVko1T2G.js +29556 -0
  69. package/dist/{index-Cga6gx-T.js → index-szngpT22.js} +1 -1
  70. package/dist/{index-fCUvdTQu.js → index-yzjCyahZ.js} +91 -73
  71. package/dist/{index.esm2017-CWKGaTMR.js → index.esm2017-B852lCgd.js} +38 -38
  72. package/dist/{loading-GiUoU2Fa.js → loading-YQhP-YKE.js} +4 -4
  73. package/dist/{membership-Bt_7SvV0.js → membership-C6EfMXD7.js} +3 -3
  74. package/dist/{money-BZq33xlW.js → money-CSas0WMX.js} +1 -1
  75. package/dist/{number-DFHYy76W.js → number-DBcS6xgD.js} +1 -1
  76. package/dist/objectid-VFD2vEs_.js +145 -0
  77. package/dist/{reward-Dy_FLF01.js → reward-BIMasAXq.js} +1 -1
  78. package/dist/{rule-zl6tGcQA.js → rule-BRALPXUn.js} +8 -4
  79. package/dist/{rule-builder-BpZ5uHIv.js → rule-builder-CBcoUD6U.js} +1 -1
  80. package/dist/style.css +1 -1
  81. package/dist/{template-BKEUsA_B.js → template-GsgcvRB8.js} +4 -4
  82. package/dist/{trigger-ChT3kWh_.js → trigger-B8pRScE6.js} +4 -4
  83. package/dist/{usePagination-DWyHwAZT.js → usePagination-BtU3EXqo.js} +1 -1
  84. package/dist/{user-CX5C_btL.js → user-CBmfFwbE.js} +1 -1
  85. package/dist/{vue-i18n--AFmNvm8.js → vue-i18n-C5G5eOJh.js} +327 -327
  86. package/package.json +2 -2
  87. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-ChUeeW90.js +0 -215
  88. package/dist/Setting-CCxSOD98.js +0 -1877
  89. package/dist/StoreRewards-DrUIjbjC.js +0 -401
  90. package/dist/index-CaJmkfzc.js +0 -29000
  91. package/dist/objectid-C6apWPpH.js +0 -145
@@ -0,0 +1,422 @@
1
+ import { defineComponent as G, ref as F, computed as N, onMounted as q, resolveComponent as v, openBlock as d, createBlock as x, unref as e, isRef as Y, withCtx as S, createElementVNode as l, createVNode as m, createElementBlock as O, createTextVNode as z, resolveDynamicComponent as H, toDisplayString as P, Fragment as j, createCommentVNode as U, h as C } from "vue";
2
+ import { _ as J } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as Q, components as $ } from "@feedmepos/ui-library";
4
+ import "./index-BC2la2BP.js";
5
+ import { p as M, u as X, f as B } from "./loading-YQhP-YKE.js";
6
+ import { C as Z, u as ee } from "./membership-C6EfMXD7.js";
7
+ import { u as te } from "./vue-i18n-C5G5eOJh.js";
8
+ import { F as oe } from "./index-DENLOr_f.js";
9
+ import { c as ae } from "./object-qECH92oz.js";
10
+ import { u as K } from "./app-wDQR6dpb.js";
11
+ import { u as ne } from "./business-wZVszwRW.js";
12
+ import { useCoreStore as se } from "@feedmepos/mf-common";
13
+ import { Z as R } from "./zod-Bg2FbC-D.js";
14
+ import { _ as ie } from "./ZodTextField.vue_vue_type_script_setup_true_lang-DxDO6zJg.js";
15
+ import { _ as re } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
16
+ import { _ as le } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-C4g0D2WQ.js";
17
+ import { _ as ce, a as me } from "./EffectSheet.vue_vue_type_style_index_0_lang-CtgRejaJ.js";
18
+ import { i as de, t as ue } from "./helper-rlgqVAdj.js";
19
+ import { useRouter as pe } from "vue-router";
20
+ import { m as D } from "./index-Cr8x5i6a.js";
21
+ import { R as k } from "./app-Cz0McG8i.js";
22
+ const fe = {
23
+ key: 0,
24
+ class: "flex flex-col space-y-16 pr-12"
25
+ }, ye = { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, ge = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center justify-between" }, we = /* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800" }, "Discount", -1), _e = /* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, " Usage configuration ", -1), ve = /* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Availability", -1), Re = { class: "flex items-center gap-8" }, be = /* @__PURE__ */ G({
26
+ __name: "EditRewardSheet",
27
+ emits: ["update"],
28
+ setup(W, { expose: n, emit: T }) {
29
+ const A = T, y = ne(), I = se(), b = F(!1), o = F(), g = F(), u = oe, p = N(
30
+ () => {
31
+ var r;
32
+ return Z[((r = o.value) == null ? void 0 : r.type) || "VOUCHER"];
33
+ }
34
+ ), w = N(() => {
35
+ const r = u.safeParse(o.value);
36
+ return r.success ? [] : r.error.errors;
37
+ });
38
+ function L() {
39
+ const r = u.safeParse(o.value);
40
+ r.success && A("update", r.data);
41
+ }
42
+ function V(r, s, t = {
43
+ isStoreReward: !1,
44
+ type: "VOUCHER"
45
+ }) {
46
+ b.value = r, r && (g.value = void 0, o.value = s || de(t.type, {
47
+ business: I.currentBusiness.value._id,
48
+ noCampaign: t.isStoreReward == !0
49
+ }));
50
+ }
51
+ return q(async () => {
52
+ await y.readLocations();
53
+ }), n({
54
+ showSheet: V,
55
+ data: o,
56
+ rewardImage: g
57
+ }), (r, s) => {
58
+ const t = v("FmTextarea"), a = v("FmHelperText"), c = v("FmButton"), _ = v("FmSideSheet");
59
+ return d(), x(_, {
60
+ "max-width": 560,
61
+ modelValue: e(b),
62
+ "onUpdate:modelValue": s[7] || (s[7] = (f) => Y(b) ? b.value = f : null),
63
+ header: "Store setting"
64
+ }, {
65
+ "side-sheet-footer": S(() => [
66
+ l("div", Re, [
67
+ m(c, {
68
+ label: "Submit",
69
+ onClick: L,
70
+ disabled: e(w).length > 0 || e(K)().isLoading,
71
+ loading: e(K)().isLoading
72
+ }, null, 8, ["disabled", "loading"]),
73
+ m(c, {
74
+ label: "Cancel",
75
+ onClick: s[6] || (s[6] = (f) => V(!1)),
76
+ variant: "tertiary"
77
+ })
78
+ ])
79
+ ]),
80
+ default: S(() => {
81
+ var f, h, E;
82
+ return [
83
+ e(o) ? (d(), O("div", fe, [
84
+ l("div", ye, [
85
+ z(" Reward information "),
86
+ (d(), x(H(e(p).chip())))
87
+ ]),
88
+ m(ie, {
89
+ modelValue: e(o).name,
90
+ "onUpdate:modelValue": s[0] || (s[0] = (i) => e(o).name = i),
91
+ label: `${e(p).name} name`,
92
+ schema: e(R).typeAtPath(e(u), "name", [e(o).type])
93
+ }, null, 8, ["modelValue", "label", "schema"]),
94
+ m(t, {
95
+ class: "!mb-[-16px]",
96
+ modelValue: e(o).description,
97
+ "onUpdate:modelValue": s[1] || (s[1] = (i) => e(o).description = i),
98
+ rules: [e(R).ruleAtPath(e(u), "description", [e(o).type])]
99
+ }, {
100
+ label: S(() => [
101
+ (d(), x(H(
102
+ e(R).toInputLabel(
103
+ e(R).typeAtPath(e(u), "description", [e(o).type]),
104
+ `${e(p).name} description`
105
+ )
106
+ )))
107
+ ]),
108
+ _: 1
109
+ }, 8, ["modelValue", "rules"]),
110
+ l("div", ge, [
111
+ l("div", null, P(e(p).name) + " description should not exceed 200 characters. ", 1),
112
+ l("div", null, P(((f = e(o).description) == null ? void 0 : f.length) ?? 0) + "/200", 1)
113
+ ]),
114
+ m(re, {
115
+ class: "w-1/2 xs:w-2/3",
116
+ "aspect-ratio": "16/9",
117
+ file: e(g) ?? void 0,
118
+ thumbnail: e(o).image ?? void 0,
119
+ "onUpdate:file": s[2] || (s[2] = async (i) => {
120
+ g.value = i, i || (e(o).image = null);
121
+ })
122
+ }, {
123
+ label: S(() => [
124
+ (d(), x(H(
125
+ e(R).toInputLabel(
126
+ e(R).typeAtPath(e(u), "image", [e(o).type]),
127
+ `${e(p).name} image`
128
+ )
129
+ )))
130
+ ]),
131
+ _: 1
132
+ }, 8, ["file", "thumbnail"]),
133
+ e(o).type === "VOUCHER" ? (d(), O(j, { key: 0 }, [
134
+ we,
135
+ m(ce, {
136
+ "model-value": e(o).extras.effect,
137
+ "onUpdate:modelValue": s[3] || (s[3] = (i) => {
138
+ e(o).extras.effect = i;
139
+ })
140
+ }, null, 8, ["model-value"]),
141
+ e(o).extras.effect == null ? (d(), x(a, {
142
+ key: 0,
143
+ class: "!mt-8",
144
+ text: "Effect is required",
145
+ state: "error"
146
+ })) : U("", !0),
147
+ _e,
148
+ m(me, {
149
+ "model-value": e(o).options,
150
+ "no-campaign": e(o).noCampaign,
151
+ "onUpdate:modelValue": s[4] || (s[4] = (i) => e(o).options = i),
152
+ schema: e(R).typeAtPath(e(u), "options", ["VOUCHER"])
153
+ }, null, 8, ["model-value", "no-campaign", "schema"])
154
+ ], 64)) : U("", !0),
155
+ ve,
156
+ e(o).type === "VOUCHER" ? (d(), x(le, {
157
+ key: 1,
158
+ "model-value": ((E = (h = e(o).extras) == null ? void 0 : h.targetLocation) == null ? void 0 : E.map(String)) ?? null,
159
+ type: "select",
160
+ "onUpdate:modelValue": s[5] || (s[5] = (i) => {
161
+ e(o).extras.targetLocation = i;
162
+ }),
163
+ rules: [
164
+ e(R).ruleAtPath(e(u), "extras.targetLocation", ["VOUCHER"])
165
+ ]
166
+ }, null, 8, ["model-value", "rules"])) : U("", !0)
167
+ ])) : U("", !0)
168
+ ];
169
+ }),
170
+ _: 1
171
+ }, 8, ["modelValue"]);
172
+ };
173
+ }
174
+ }), he = { class: "px-24 flex flex-col gap-y-16" }, xe = { class: "flex items-center justify-between w-full" }, Ce = /* @__PURE__ */ l("div", { class: "flex gap-8" }, null, -1), Se = /* @__PURE__ */ l("img", {
175
+ src: J,
176
+ class: "aspect-square w-[150px]"
177
+ }, null, -1), Fe = { class: "flex flex-col gap-16 text-center" }, Ve = { class: "fm-typo-en-title-sm-800" }, Ee = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ze = /* @__PURE__ */ G({
178
+ __name: "StoreRewards",
179
+ setup(W) {
180
+ const { t: n } = te(), T = Q(), A = {
181
+ label: n("connect.storeRewards.create"),
182
+ value: "create",
183
+ isPrimary: !0,
184
+ prependIcon: "add"
185
+ }, y = ee(), { global: I, minor: b } = X, o = pe(), g = F({
186
+ searchKey: "",
187
+ columnFilters: []
188
+ }), u = [
189
+ {
190
+ header: n("connect.storeRewards.table.name"),
191
+ accessorFn: (t) => t.name
192
+ },
193
+ {
194
+ id: "type",
195
+ header: n("connect.storeRewards.table.type"),
196
+ accessorFn: (t) => t.type,
197
+ cell(t) {
198
+ return Z[t.row.original.type].chip();
199
+ }
200
+ },
201
+ {
202
+ header: n("connect.storeRewards.table.validity"),
203
+ accessorFn: (t) => ue(
204
+ "validityOption" in t.options ? t.options.validityOption || {} : {}
205
+ )
206
+ },
207
+ {
208
+ header: n("connect.storeRewards.table.used"),
209
+ meta: {
210
+ textAlign: "left"
211
+ },
212
+ accessorFn: (t) => t.currentReceive ?? 0
213
+ },
214
+ {
215
+ header: n("connect.storeRewards.table.actions"),
216
+ cell(t) {
217
+ return C("div", { class: "flex items-center justify-end gap-4" }, [
218
+ C(
219
+ $.FmMenu,
220
+ {
221
+ placement: "bottom-end",
222
+ onClick: (a) => {
223
+ a.stopPropagation();
224
+ }
225
+ },
226
+ {
227
+ "menu-button": () => C($.FmButton, {
228
+ icon: "more_vert",
229
+ iconColor: "neutral-gray-400",
230
+ variant: "tertiary"
231
+ }),
232
+ default: () => [
233
+ C($.FmMenuItem, {
234
+ label: "View collections",
235
+ onClick: async (a) => {
236
+ a.stopPropagation(), L(t.row.original._id);
237
+ }
238
+ }),
239
+ // h(components.FmMenuItem, {
240
+ // label: 'View transactions',
241
+ // onClick: async (event: Event) => {
242
+ // event.stopPropagation();
243
+ // onViewTransactions(props.row.original._id as string);
244
+ // },
245
+ // }),
246
+ C(
247
+ $.FmMenuItem,
248
+ {
249
+ onClick: async (a) => {
250
+ a.stopPropagation(), V(t.row.original);
251
+ }
252
+ },
253
+ {
254
+ label: C(
255
+ "div",
256
+ {
257
+ class: "text-fm-color-typo-error fm-typo-en-body-md-400"
258
+ },
259
+ "Remove"
260
+ )
261
+ }
262
+ )
263
+ ]
264
+ }
265
+ )
266
+ ]);
267
+ }
268
+ }
269
+ ], p = N(
270
+ () => y.bundleRewards.filter((t) => t.type == "VOUCHER")
271
+ ), w = F();
272
+ function L(t) {
273
+ o.push({
274
+ name: k["$connect-STORE_REWARD_COLLECTIONS"],
275
+ params: { id: t }
276
+ });
277
+ }
278
+ async function V(t) {
279
+ if (t.type === "TITLE") {
280
+ await M.confirm(
281
+ n("connect.storeRewards.remove.message"),
282
+ n("connect.storeRewards.remove.title"),
283
+ n("connect.storeRewards.remove.action")
284
+ ) && await o.push({ name: k["$connect-PROGRAM_TITLE"] });
285
+ return;
286
+ }
287
+ await M.remove(
288
+ n("connect.storeRewards.delete.confirm"),
289
+ n("connect.storeRewards.delete.title")
290
+ ) && await b(
291
+ async () => {
292
+ await D.deleteReward(t._id), await y.readMembership(), await y.readRewards();
293
+ },
294
+ {
295
+ message: n("connect.storeRewards.delete.message"),
296
+ successMessage: n("connect.storeRewards.delete.success")
297
+ }
298
+ );
299
+ }
300
+ async function r(t) {
301
+ var c;
302
+ const a = t ? ae(y.bundleRewards.find((_) => _._id === t)) : void 0;
303
+ if ((a == null ? void 0 : a.type) === "TITLE") {
304
+ await M.confirm(
305
+ "You cannot edit a title here, please edit it at the Program > Title section.",
306
+ "Update reward",
307
+ "Go to title section"
308
+ ) && await o.push({ name: k["$connect-PROGRAM_TITLE"] });
309
+ return;
310
+ }
311
+ (c = w.value) == null || c.showSheet(!0, a, {
312
+ isStoreReward: !0,
313
+ type: "VOUCHER"
314
+ });
315
+ }
316
+ async function s(t) {
317
+ let a = !1;
318
+ t._id && t.type === "VOUCHER" && await new Promise((c) => {
319
+ T.open({
320
+ title: "Confirmation",
321
+ message: n("connect.campaign.voucher.updateConfirm"),
322
+ primaryActions: {
323
+ text: n("connect.campaign.voucher.updateConfirm.updateAll"),
324
+ close: !0
325
+ },
326
+ secondaryActions: {
327
+ text: n("connect.campaign.voucher.updateConfirm.updateFuture"),
328
+ close: !0
329
+ }
330
+ }).onPrimary(async () => {
331
+ a = !0, c();
332
+ }).onSecondary(async () => {
333
+ c();
334
+ });
335
+ }), await b(
336
+ async () => {
337
+ var c, _, f, h;
338
+ (c = w.value) != null && c.rewardImage && t.image ? await B.delete(t.image) : (_ = w.value) != null && _.rewardImage && (t.image = await B.update(
339
+ t.image || B.collectibleImagePath(
340
+ void 0,
341
+ w.value.rewardImage
342
+ ),
343
+ (f = w.value) == null ? void 0 : f.rewardImage
344
+ )), t._id ? await D.updateReward(t._id, {
345
+ ...t,
346
+ updateCollection: a
347
+ }) : await D.createReward(t), await y.readRewards(), (h = w.value) == null || h.showSheet(!1);
348
+ },
349
+ {
350
+ message: "Updating reward",
351
+ successMessage: "Reward updated successfully"
352
+ }
353
+ );
354
+ }
355
+ return q(async () => {
356
+ await I(async () => {
357
+ await y.readMembership(), await y.readRewards();
358
+ });
359
+ }), (t, a) => {
360
+ const c = v("FmPageHead"), _ = v("FmSearch"), f = v("FmTable"), h = v("FmButton"), E = v("FmCard");
361
+ return d(), O(j, null, [
362
+ m(c, {
363
+ title: e(n)("connect.storeRewards.title"),
364
+ description: e(n)("connect.storeRewards.description"),
365
+ actions: [A],
366
+ "back-button": !0,
367
+ "onClick:action": a[0] || (a[0] = () => r()),
368
+ "onClick:back": a[1] || (a[1] = () => e(o).push({ name: e(k)["$connect-STORE"] }))
369
+ }, null, 8, ["title", "description", "actions"]),
370
+ l("div", he, [
371
+ e(p) && e(p).length > 0 ? (d(), O(j, { key: 0 }, [
372
+ l("div", xe, [
373
+ Ce,
374
+ m(_, {
375
+ modelValue: e(g).searchKey,
376
+ "onUpdate:modelValue": a[2] || (a[2] = (i) => e(g).searchKey = i),
377
+ class: "",
378
+ placeholder: "search",
379
+ collapsible: ""
380
+ }, null, 8, ["modelValue"])
381
+ ]),
382
+ m(f, {
383
+ "row-data": e(p),
384
+ "column-defs": u,
385
+ "search-value": e(g).searchKey,
386
+ "column-filter": e(g).columnFilters,
387
+ onRowClick: a[3] || (a[3] = (i) => r(i.original._id)),
388
+ "hide-footer": e(p).length < 10
389
+ }, null, 8, ["row-data", "search-value", "column-filter", "hide-footer"])
390
+ ], 64)) : (d(), x(E, {
391
+ key: 1,
392
+ variant: "outlined",
393
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
394
+ }, {
395
+ default: S(() => [
396
+ Se,
397
+ l("div", Fe, [
398
+ l("div", Ve, P(e(n)("connect.storeRewards.empty.title")), 1),
399
+ l("div", Ee, P(e(n)("connect.storeRewards.empty.description")), 1)
400
+ ]),
401
+ m(h, {
402
+ variant: "primary",
403
+ label: e(n)("connect.storeRewards.empty.action"),
404
+ onClick: a[4] || (a[4] = (i) => r()),
405
+ icon: "add"
406
+ }, null, 8, ["label"])
407
+ ]),
408
+ _: 1
409
+ })),
410
+ m(be, {
411
+ ref_key: "rewardSheetRef",
412
+ ref: w,
413
+ onUpdate: a[5] || (a[5] = (i) => s(i))
414
+ }, null, 512)
415
+ ])
416
+ ], 64);
417
+ };
418
+ }
419
+ });
420
+ export {
421
+ ze as default
422
+ };
@@ -1,28 +1,28 @@
1
1
  import { defineComponent as z, ref as A, computed as Y, onMounted as ee, resolveComponent as k, openBlock as I, createBlock as U, unref as n, withCtx as $, createVNode as w, normalizeClass as X, createCommentVNode as ge, createElementVNode as D, toDisplayString as P, createElementBlock as E, Fragment as H, renderList as Q, mergeModels as oe, useModel as ve, watch as te, h as s, isRef as ye, createTextVNode as he, resolveDynamicComponent as be, onBeforeMount as _e } from "vue";
2
2
  import { components as C, useDialog as Se } from "@feedmepos/ui-library";
3
- import { p as ne } from "./index-sLN88aCQ.js";
4
- import { a as ae, c as xe, p as we, u as De } from "./loading-GiUoU2Fa.js";
3
+ import { p as ne } from "./index-BYP79OMe.js";
4
+ import { a as ae, c as xe, p as we, u as De } from "./loading-YQhP-YKE.js";
5
5
  import { s as Re } from "./index-Dbd4WA4r.js";
6
6
  import { h as _ } from "./moment-BWErdI6_.js";
7
7
  import { s as G } from "./index-CuvNtC_M.js";
8
- import { f as Z } from "./number-DFHYy76W.js";
9
- import { u as re } from "./business-CTwB-cPM.js";
10
- import { a as le, _ as se } from "./usePagination-DWyHwAZT.js";
11
- import { g as ie } from "./user-CX5C_btL.js";
12
- import { B as ce, e as ue } from "./export-kgzxrVkq.js";
13
- import { u as de } from "./campaign-CKZMkxH5.js";
14
- import "./index-DTbigOhK.js";
15
- import "./index-DLIjZTu7.js";
16
- import "./index-fCUvdTQu.js";
17
- import "./index-COe4sMRZ.js";
18
- import "./index-DoHEyLZn.js";
19
- import { u as Ce } from "./vue-i18n--AFmNvm8.js";
8
+ import { f as Z } from "./number-DBcS6xgD.js";
9
+ import { u as re } from "./business-wZVszwRW.js";
10
+ import { a as le, _ as se } from "./usePagination-BtU3EXqo.js";
11
+ import { g as ie } from "./user-CBmfFwbE.js";
12
+ import { B as ce, e as ue } from "./export-B-yEeKMb.js";
13
+ import { u as de } from "./campaign-CXOSMRjR.js";
14
+ import "./index-BC2la2BP.js";
15
+ import "./index-DENLOr_f.js";
16
+ import "./index-yzjCyahZ.js";
17
+ import "./index-BSWItpEw.js";
18
+ import "./index-CgA8VVym.js";
19
+ import { u as Ce } from "./vue-i18n-C5G5eOJh.js";
20
20
  import { o as B } from "./objectId-dwaoBfJX.js";
21
21
  import { useRouter as Te } from "vue-router";
22
- import { t as W } from "./index-BUXc2Nw5.js";
23
- import { R as K } from "./app-BqAFUCz8.js";
22
+ import { t as W } from "./index-C9Eegvas.js";
23
+ import { R as K } from "./app-Cz0McG8i.js";
24
24
  import { useCoreStore as Fe } from "@feedmepos/mf-common";
25
- import { m as Ie } from "./index-aOnN-LXC.js";
25
+ import { m as Ie } from "./index-Cr8x5i6a.js";
26
26
  function ke(c) {
27
27
  let v = "";
28
28
  switch (c) {
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as N, ref as C, computed as L, watch as E, resolveComponent as g, openBlock as o, createElementBlock as i, Fragment as y, toDisplayString as I, createCommentVNode as A, createElementVNode as M, createVNode as v, unref as u, renderList as S, createBlock as b, isRef as U, withCtx as F } from "vue";
2
- import { u as T } from "./business-CTwB-cPM.js";
2
+ import { u as T } from "./business-wZVszwRW.js";
3
3
  function j(l, s, n) {
4
4
  return l.some(
5
5
  n instanceof Function ? n : (a) => a === s