@feedmepos/mf-connect 0.1.2-prod → 0.1.4-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.
- package/dist/Analytic-07T9poLx.js +423 -0
- package/dist/{App-CRTD0U-N.js → App-C6MukSCT.js} +276 -275
- package/dist/Broadcast-CzsgeZNO.js +223 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-C5zUv0Zx.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BirunpzI.js} +8 -8
- package/dist/Card-DQnyWZZf.js +824 -0
- package/dist/{Collections-BgbWoLWI.js → Collections-BV7CSqRw.js} +4 -4
- package/dist/Credit-CxsbYGLZ.js +220 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C137bE1q.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BKSZYxvb.js} +918 -901
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-DpsrI-Z3.js +345 -0
- package/dist/Experience-eMUbhq7h.js +221 -0
- package/dist/Game-CxAG2ViS.js +255 -0
- package/dist/Marketing-CozMj2Y5.js +316 -0
- package/dist/Member-DM1dj3F5.js +69 -0
- package/dist/{MemberList-ISy05wGZ.js → MemberList-DNjK9BbG.js} +14 -14
- package/dist/{MemberTransactions-CXvhJngX.js → MemberTransactions-CsjN3LZA.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Ca1LO__F.js → MessageInput.vue_vue_type_script_setup_true_lang-DVQE9v2R.js} +2 -2
- package/dist/Mission-BugvTPPH.js +261 -0
- package/dist/Point-D8BjGtqT.js +222 -0
- package/dist/Promotion-mc9KBzoJ.js +253 -0
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-D1eQ3i5D.js → RuleGroup.vue_vue_type_script_setup_true_lang-B2H3D_kZ.js} +15 -15
- package/dist/Segment-DZRFA-Pb.js +565 -0
- package/dist/Setting-DxNhR44e.js +1871 -0
- package/dist/Store-CdkJWpjV.js +1530 -0
- package/dist/StoreRewards-Cdturia8.js +400 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-nhS5Dhhk.js → StoreTransactions.vue_vue_type_script_setup_true_lang-D7GcOiUM.js} +10 -10
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DWlpmE56.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-nuCOrrLE.js} +1 -1
- package/dist/{Tier-DLrOmrnK.js → Tier-I_MMd39Y.js} +470 -445
- package/dist/{Title-MHQuel7h.js → Title-DK5gmUvo.js} +298 -282
- package/dist/Transaction-BXpTIMS_.js +39 -0
- package/dist/Voucher-BQ5h2G0I.js +490 -0
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-eAP99wyg.js +141 -0
- package/dist/app-CL2Wxzv5.js +5639 -0
- package/dist/{app-BjOpRVdv.js → app-DTAyCT-G.js} +1 -1
- package/dist/app.js +4 -3
- package/dist/{business-DveMDDHY.js → business-B9OUlaFZ.js} +1 -1
- package/dist/{campaign-CMb05XLt.js → campaign-CNbUA51l.js} +2 -2
- package/dist/{collection.fn-BjaBPYMU.js → collection.fn-D_i45T4Q.js} +2 -2
- package/dist/dto-B4208_es.js +2770 -0
- package/dist/{effect-CxAdSlyD.js → effect-Ye_yr8et.js} +1 -1
- package/dist/{email-addresses-Dtr5OALQ.js → email-addresses-Gm7Dyaxy.js} +1 -1
- package/dist/{export-DuBekrcg.js → export-Buee5oUV.js} +3 -3
- package/dist/{helper-DL6hnmtJ.js → helper-BBlHhMFc.js} +1 -1
- package/dist/{index-raYm7Ew2.js → index-BxJgFvym.js} +2 -2
- package/dist/{index-gcsOy_cD.js → index-ByaM-yoc.js} +91 -86
- package/dist/{index-DISwCnfH.js → index-C0QHb5SL.js} +2 -2
- package/dist/{index-Cibwzgac.js → index-C363BG5A.js} +3 -3
- package/dist/{index-BZAlqAaJ.js → index-CLL3no-v.js} +1 -1
- package/dist/{index-CAQpU5Rv.js → index-ChSVaFk3.js} +1 -1
- package/dist/{index-BSIUoSG3.js → index-Co9n8I_5.js} +3 -3
- package/dist/index-CoGNKU8v.js +3 -0
- package/dist/{index-Dx4pkNRc.js → index-DHGcUMVN.js} +1 -1
- package/dist/{index-CgPlJqkX.js → index-DWWtZSrm.js} +1 -1
- package/dist/{index-CGHNWhkM.js → index-DdVZgYE4.js} +258 -256
- package/dist/{index-BBBytzpn.js → index-Dx3HwWcb.js} +1 -1
- package/dist/{index.esm2017-Bs9CWbrs.js → index.esm2017-Dd02dg_O.js} +38 -38
- package/dist/{loading-Dj5bx8fg.js → loading-Or1ZDzDS.js} +11 -11
- package/dist/{membership-B2avlZoN.js → membership-B8h5ku-v.js} +3 -3
- package/dist/{money-CNSWtAf-.js → money-CmsKAJBT.js} +1 -1
- package/dist/{number-BA58pjU6.js → number-iEhp7Uai.js} +1 -1
- package/dist/{rule-BWazFYuZ.js → rule-BORkgSMK.js} +3 -3
- package/dist/{rule-builder-RIloDQBn.js → rule-builder-DEfkSr68.js} +1 -1
- package/dist/{template-u01r84LY.js → template-C_Y7bhlI.js} +4 -4
- package/dist/{usePagination--B6Wt7C1.js → usePagination-Ci8-uZvb.js} +1 -1
- package/dist/vue-i18n-BXzrZRP6.js +2365 -0
- package/package.json +7 -4
- package/dist/Analytic-AqWU_lJy.js +0 -620
- package/dist/Broadcast-utWSrzP9.js +0 -216
- package/dist/Card-x6qnEaIt.js +0 -823
- package/dist/Credit-CojzmUnh.js +0 -214
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-8l3Dt_Lo.js +0 -344
- package/dist/Experience-CPjovKWF.js +0 -211
- package/dist/Game-DWcjPfZP.js +0 -250
- package/dist/Marketing-CwoI0pFF.js +0 -309
- package/dist/Member-oRcVGr20.js +0 -92
- package/dist/Mission-Y8s5MQIC.js +0 -248
- package/dist/Point-0Fw3qLIW.js +0 -220
- package/dist/Promotion-vqM23NPX.js +0 -244
- package/dist/Segment-lgzMRCyd.js +0 -564
- package/dist/Setting-CFGB53S0.js +0 -1870
- package/dist/Store-fJlew3HJ.js +0 -1533
- package/dist/StoreRewards-DWq34E4p.js +0 -429
- package/dist/Transaction-CYqMFEzc.js +0 -36
- package/dist/Voucher-B0QCX_nG.js +0 -485
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +0 -140
- package/dist/app-SOHUUM08.js +0 -2974
- package/dist/dto-CY7JrHkZ.js +0 -1145
- package/dist/index-BMxu_XL-.js +0 -11
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
import { defineComponent as G, ref as F, computed as j, onMounted as q, resolveComponent as g, openBlock as d, createBlock as R, unref as e, isRef as Y, withCtx as S, createElementVNode as n, createVNode as m, createElementBlock as T, createTextVNode as z, resolveDynamicComponent as M, toDisplayString as O, Fragment as D, createCommentVNode as U, h as C } from "vue";
|
|
2
|
+
import { _ as J } from "./campaign-CpzFl8Vr.js";
|
|
3
|
+
import { components as $ } from "@feedmepos/ui-library";
|
|
4
|
+
import "./index-CoGNKU8v.js";
|
|
5
|
+
import { p as H, u as Q, f as B } from "./loading-Or1ZDzDS.js";
|
|
6
|
+
import { C as Z, u as X } from "./membership-B8h5ku-v.js";
|
|
7
|
+
import { u as ee } from "./vue-i18n-BXzrZRP6.js";
|
|
8
|
+
import { F as te } from "./index-ChSVaFk3.js";
|
|
9
|
+
import { c as oe } from "./object-qECH92oz.js";
|
|
10
|
+
import { u as K } from "./app-wDQR6dpb.js";
|
|
11
|
+
import { u as ae } from "./business-B9OUlaFZ.js";
|
|
12
|
+
import { useCoreStore as se } from "@feedmepos/mf-common";
|
|
13
|
+
import { _ as ne, Z as _ } from "./ZodTextField.vue_vue_type_script_setup_true_lang-eAP99wyg.js";
|
|
14
|
+
import { _ as re } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
|
|
15
|
+
import { _ as ie } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-nuCOrrLE.js";
|
|
16
|
+
import { _ as le, a as ce } from "./EffectSheet.vue_vue_type_style_index_0_lang-DpsrI-Z3.js";
|
|
17
|
+
import { i as me, t as de } from "./helper-BBlHhMFc.js";
|
|
18
|
+
import { useRouter as ue } from "vue-router";
|
|
19
|
+
import { m as N } from "./index-DHGcUMVN.js";
|
|
20
|
+
import { R as k } from "./app-CL2Wxzv5.js";
|
|
21
|
+
const pe = {
|
|
22
|
+
key: 0,
|
|
23
|
+
class: "flex flex-col space-y-16 pr-12"
|
|
24
|
+
}, fe = { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, ye = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center justify-between" }, we = /* @__PURE__ */ n("div", { class: "fm-typo-en-title-sm-800" }, "Discount", -1), ge = /* @__PURE__ */ n("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, " Usage configuration ", -1), _e = /* @__PURE__ */ n("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Availability", -1), ve = { class: "flex items-center gap-8" }, Re = /* @__PURE__ */ G({
|
|
25
|
+
__name: "EditRewardSheet",
|
|
26
|
+
emits: ["update"],
|
|
27
|
+
setup(W, { expose: s, emit: P }) {
|
|
28
|
+
const p = P, I = ae(), V = se(), f = F(!1), o = F(), b = F(), i = te, l = j(
|
|
29
|
+
() => {
|
|
30
|
+
var r;
|
|
31
|
+
return Z[((r = o.value) == null ? void 0 : r.type) || "VOUCHER"];
|
|
32
|
+
}
|
|
33
|
+
), A = j(() => {
|
|
34
|
+
const r = i.safeParse(o.value);
|
|
35
|
+
return r.success ? [] : r.error.errors;
|
|
36
|
+
});
|
|
37
|
+
function L() {
|
|
38
|
+
const r = i.safeParse(o.value);
|
|
39
|
+
r.success && p("update", r.data);
|
|
40
|
+
}
|
|
41
|
+
function h(r, t, a = {
|
|
42
|
+
isStoreReward: !1,
|
|
43
|
+
type: "VOUCHER"
|
|
44
|
+
}) {
|
|
45
|
+
f.value = r, r && (b.value = void 0, o.value = t || me(a.type, {
|
|
46
|
+
business: V.currentBusiness.value._id,
|
|
47
|
+
noCampaign: a.isStoreReward == !0
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
return q(async () => {
|
|
51
|
+
await I.readLocations();
|
|
52
|
+
}), s({
|
|
53
|
+
showSheet: h,
|
|
54
|
+
data: o,
|
|
55
|
+
rewardImage: b
|
|
56
|
+
}), (r, t) => {
|
|
57
|
+
const a = g("FmTextarea"), y = g("FmHelperText"), u = g("FmButton"), x = g("FmSideSheet");
|
|
58
|
+
return d(), R(x, {
|
|
59
|
+
"max-width": 560,
|
|
60
|
+
modelValue: e(f),
|
|
61
|
+
"onUpdate:modelValue": t[7] || (t[7] = (v) => Y(f) ? f.value = v : null),
|
|
62
|
+
header: "Store setting"
|
|
63
|
+
}, {
|
|
64
|
+
"side-sheet-footer": S(() => [
|
|
65
|
+
n("div", ve, [
|
|
66
|
+
m(u, {
|
|
67
|
+
label: "Submit",
|
|
68
|
+
onClick: L,
|
|
69
|
+
disabled: e(A).length > 0 || e(K)().isLoading,
|
|
70
|
+
loading: e(K)().isLoading
|
|
71
|
+
}, null, 8, ["disabled", "loading"]),
|
|
72
|
+
m(u, {
|
|
73
|
+
label: "Cancel",
|
|
74
|
+
onClick: t[6] || (t[6] = (v) => h(!1)),
|
|
75
|
+
variant: "tertiary"
|
|
76
|
+
})
|
|
77
|
+
])
|
|
78
|
+
]),
|
|
79
|
+
default: S(() => {
|
|
80
|
+
var v, E, w;
|
|
81
|
+
return [
|
|
82
|
+
e(o) ? (d(), T("div", pe, [
|
|
83
|
+
n("div", fe, [
|
|
84
|
+
z(" Reward information "),
|
|
85
|
+
(d(), R(M(e(l).chip())))
|
|
86
|
+
]),
|
|
87
|
+
m(ne, {
|
|
88
|
+
modelValue: e(o).name,
|
|
89
|
+
"onUpdate:modelValue": t[0] || (t[0] = (c) => e(o).name = c),
|
|
90
|
+
label: `${e(l).name} name`,
|
|
91
|
+
schema: e(_).typeAtPath(e(i), "name", [e(o).type])
|
|
92
|
+
}, null, 8, ["modelValue", "label", "schema"]),
|
|
93
|
+
m(a, {
|
|
94
|
+
class: "!mb-[-16px]",
|
|
95
|
+
modelValue: e(o).description,
|
|
96
|
+
"onUpdate:modelValue": t[1] || (t[1] = (c) => e(o).description = c),
|
|
97
|
+
rules: [e(_).ruleAtPath(e(i), "description", [e(o).type])]
|
|
98
|
+
}, {
|
|
99
|
+
label: S(() => [
|
|
100
|
+
(d(), R(M(
|
|
101
|
+
e(_).toInputLabel(
|
|
102
|
+
e(_).typeAtPath(e(i), "description", [e(o).type]),
|
|
103
|
+
`${e(l).name} description`
|
|
104
|
+
)
|
|
105
|
+
)))
|
|
106
|
+
]),
|
|
107
|
+
_: 1
|
|
108
|
+
}, 8, ["modelValue", "rules"]),
|
|
109
|
+
n("div", ye, [
|
|
110
|
+
n("div", null, O(e(l).name) + " description should not exceed 200 characters. ", 1),
|
|
111
|
+
n("div", null, O(((v = e(o).description) == null ? void 0 : v.length) ?? 0) + "/200", 1)
|
|
112
|
+
]),
|
|
113
|
+
m(re, {
|
|
114
|
+
class: "w-1/2 xs:w-2/3",
|
|
115
|
+
"aspect-ratio": "16/9",
|
|
116
|
+
file: e(b) ?? void 0,
|
|
117
|
+
thumbnail: e(o).image ?? void 0,
|
|
118
|
+
"onUpdate:file": t[2] || (t[2] = async (c) => {
|
|
119
|
+
b.value = c, c || (e(o).image = null);
|
|
120
|
+
})
|
|
121
|
+
}, {
|
|
122
|
+
label: S(() => [
|
|
123
|
+
(d(), R(M(
|
|
124
|
+
e(_).toInputLabel(
|
|
125
|
+
e(_).typeAtPath(e(i), "image", [e(o).type]),
|
|
126
|
+
`${e(l).name} image`
|
|
127
|
+
)
|
|
128
|
+
)))
|
|
129
|
+
]),
|
|
130
|
+
_: 1
|
|
131
|
+
}, 8, ["file", "thumbnail"]),
|
|
132
|
+
e(o).type === "VOUCHER" ? (d(), T(D, { key: 0 }, [
|
|
133
|
+
we,
|
|
134
|
+
m(le, {
|
|
135
|
+
"model-value": e(o).extras.effect,
|
|
136
|
+
"onUpdate:modelValue": t[3] || (t[3] = (c) => {
|
|
137
|
+
e(o).extras.effect = c;
|
|
138
|
+
})
|
|
139
|
+
}, null, 8, ["model-value"]),
|
|
140
|
+
e(o).extras.effect == null ? (d(), R(y, {
|
|
141
|
+
key: 0,
|
|
142
|
+
class: "!mt-8",
|
|
143
|
+
text: "Effect is required",
|
|
144
|
+
state: "error"
|
|
145
|
+
})) : U("", !0),
|
|
146
|
+
ge,
|
|
147
|
+
m(ce, {
|
|
148
|
+
"model-value": e(o).options,
|
|
149
|
+
"no-campaign": e(o).noCampaign,
|
|
150
|
+
"onUpdate:modelValue": t[4] || (t[4] = (c) => e(o).options = c),
|
|
151
|
+
schema: e(_).typeAtPath(e(i), "options", ["VOUCHER"])
|
|
152
|
+
}, null, 8, ["model-value", "no-campaign", "schema"])
|
|
153
|
+
], 64)) : U("", !0),
|
|
154
|
+
_e,
|
|
155
|
+
e(o).type === "VOUCHER" ? (d(), R(ie, {
|
|
156
|
+
key: 1,
|
|
157
|
+
"model-value": ((w = (E = e(o).extras) == null ? void 0 : E.targetLocation) == null ? void 0 : w.map(String)) ?? null,
|
|
158
|
+
type: "select",
|
|
159
|
+
"onUpdate:modelValue": t[5] || (t[5] = (c) => {
|
|
160
|
+
e(o).extras.targetLocation = c;
|
|
161
|
+
}),
|
|
162
|
+
rules: [
|
|
163
|
+
e(_).ruleAtPath(e(i), "extras.targetLocation", ["VOUCHER"])
|
|
164
|
+
]
|
|
165
|
+
}, null, 8, ["model-value", "rules"])) : U("", !0)
|
|
166
|
+
])) : U("", !0)
|
|
167
|
+
];
|
|
168
|
+
}),
|
|
169
|
+
_: 1
|
|
170
|
+
}, 8, ["modelValue"]);
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
}), be = { class: "px-24 flex flex-col gap-y-16" }, he = { class: "flex items-center justify-between w-full" }, xe = /* @__PURE__ */ n("div", { class: "flex gap-8" }, null, -1), Ce = /* @__PURE__ */ n("img", {
|
|
174
|
+
src: J,
|
|
175
|
+
class: "aspect-square w-[150px]"
|
|
176
|
+
}, null, -1), Se = { class: "flex flex-col gap-16 text-center" }, Fe = { class: "fm-typo-en-title-sm-800" }, Ve = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, We = /* @__PURE__ */ G({
|
|
177
|
+
__name: "StoreRewards",
|
|
178
|
+
setup(W) {
|
|
179
|
+
const { t: s } = ee(), P = {
|
|
180
|
+
label: s("connect.storeRewards.create"),
|
|
181
|
+
value: "create",
|
|
182
|
+
isPrimary: !0,
|
|
183
|
+
prependIcon: "add"
|
|
184
|
+
}, p = X(), { global: I, minor: V } = Q, f = ue(), o = F({
|
|
185
|
+
searchKey: "",
|
|
186
|
+
columnFilters: []
|
|
187
|
+
}), b = [
|
|
188
|
+
{
|
|
189
|
+
header: s("connect.storeRewards.table.name"),
|
|
190
|
+
accessorFn: (t) => t.name
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
id: "type",
|
|
194
|
+
header: s("connect.storeRewards.table.type"),
|
|
195
|
+
accessorFn: (t) => t.type,
|
|
196
|
+
cell(t) {
|
|
197
|
+
return Z[t.row.original.type].chip();
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
header: s("connect.storeRewards.table.validity"),
|
|
202
|
+
accessorFn: (t) => de(
|
|
203
|
+
"validityOption" in t.options ? t.options.validityOption || {} : {}
|
|
204
|
+
)
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
header: s("connect.storeRewards.table.used"),
|
|
208
|
+
meta: {
|
|
209
|
+
textAlign: "left"
|
|
210
|
+
},
|
|
211
|
+
accessorFn: (t) => t.currentReceive ?? 0
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
header: s("connect.storeRewards.table.actions"),
|
|
215
|
+
cell(t) {
|
|
216
|
+
return C("div", { class: "flex items-center justify-end gap-4" }, [
|
|
217
|
+
C(
|
|
218
|
+
$.FmMenu,
|
|
219
|
+
{
|
|
220
|
+
placement: "bottom-end",
|
|
221
|
+
onClick: (a) => {
|
|
222
|
+
a.stopPropagation();
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"menu-button": () => C($.FmButton, {
|
|
227
|
+
icon: "more_vert",
|
|
228
|
+
iconColor: "neutral-gray-400",
|
|
229
|
+
variant: "tertiary"
|
|
230
|
+
}),
|
|
231
|
+
default: () => [
|
|
232
|
+
C($.FmMenuItem, {
|
|
233
|
+
label: "View collections",
|
|
234
|
+
onClick: async (a) => {
|
|
235
|
+
a.stopPropagation(), A(t.row.original._id);
|
|
236
|
+
}
|
|
237
|
+
}),
|
|
238
|
+
// h(components.FmMenuItem, {
|
|
239
|
+
// label: 'View transactions',
|
|
240
|
+
// onClick: async (event: Event) => {
|
|
241
|
+
// event.stopPropagation();
|
|
242
|
+
// onViewTransactions(props.row.original._id as string);
|
|
243
|
+
// },
|
|
244
|
+
// }),
|
|
245
|
+
C(
|
|
246
|
+
$.FmMenuItem,
|
|
247
|
+
{
|
|
248
|
+
onClick: async (a) => {
|
|
249
|
+
a.stopPropagation(), L(t.row.original);
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
label: C(
|
|
254
|
+
"div",
|
|
255
|
+
{
|
|
256
|
+
class: "text-fm-color-typo-error fm-typo-en-body-md-400"
|
|
257
|
+
},
|
|
258
|
+
"Remove"
|
|
259
|
+
)
|
|
260
|
+
}
|
|
261
|
+
)
|
|
262
|
+
]
|
|
263
|
+
}
|
|
264
|
+
)
|
|
265
|
+
]);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
], i = j(
|
|
269
|
+
() => p.bundleRewards.filter((t) => t.type == "VOUCHER")
|
|
270
|
+
), l = F();
|
|
271
|
+
function A(t) {
|
|
272
|
+
f.push({
|
|
273
|
+
name: k["$connect-STORE_REWARD_COLLECTIONS"],
|
|
274
|
+
params: { id: t }
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
async function L(t) {
|
|
278
|
+
if (t.type === "TITLE") {
|
|
279
|
+
await H.confirm(
|
|
280
|
+
s("connect.storeRewards.remove.message"),
|
|
281
|
+
s("connect.storeRewards.remove.title"),
|
|
282
|
+
s("connect.storeRewards.remove.action")
|
|
283
|
+
) && await f.push({ name: k["$connect-PROGRAM_TITLE"] });
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
await H.remove(
|
|
287
|
+
s("connect.storeRewards.delete.confirm"),
|
|
288
|
+
s("connect.storeRewards.delete.title")
|
|
289
|
+
) && await V(
|
|
290
|
+
async () => {
|
|
291
|
+
await N.deleteReward(t._id), await p.readMembership(), await p.readRewards();
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
message: s("connect.storeRewards.delete.message"),
|
|
295
|
+
successMessage: s("connect.storeRewards.delete.success")
|
|
296
|
+
}
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
async function h(t) {
|
|
300
|
+
var y;
|
|
301
|
+
const a = t ? oe(p.bundleRewards.find((u) => u._id === t)) : void 0;
|
|
302
|
+
if ((a == null ? void 0 : a.type) === "TITLE") {
|
|
303
|
+
await H.confirm(
|
|
304
|
+
"You cannot edit a title here, please edit it at the Program > Title section.",
|
|
305
|
+
"Update reward",
|
|
306
|
+
"Go to title section"
|
|
307
|
+
) && await f.push({ name: k["$connect-PROGRAM_TITLE"] });
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
(y = l.value) == null || y.showSheet(!0, a, {
|
|
311
|
+
isStoreReward: !0,
|
|
312
|
+
type: "VOUCHER"
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
async function r(t) {
|
|
316
|
+
await V(
|
|
317
|
+
async () => {
|
|
318
|
+
var a, y, u, x;
|
|
319
|
+
(a = l.value) != null && a.rewardImage && t.image ? await B.delete(t.image) : (y = l.value) != null && y.rewardImage && (t.image = await B.update(
|
|
320
|
+
t.image || B.collectibleImagePath(
|
|
321
|
+
void 0,
|
|
322
|
+
l.value.rewardImage
|
|
323
|
+
),
|
|
324
|
+
(u = l.value) == null ? void 0 : u.rewardImage
|
|
325
|
+
)), t._id ? await N.updateReward(t._id, t) : await N.createReward(t), await p.readRewards(), (x = l.value) == null || x.showSheet(!1);
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
message: "Updating reward",
|
|
329
|
+
successMessage: "Reward updated successfully"
|
|
330
|
+
}
|
|
331
|
+
);
|
|
332
|
+
}
|
|
333
|
+
return q(async () => {
|
|
334
|
+
await I(async () => {
|
|
335
|
+
await p.readMembership(), await p.readRewards();
|
|
336
|
+
});
|
|
337
|
+
}), (t, a) => {
|
|
338
|
+
const y = g("FmPageHead"), u = g("FmSearch"), x = g("FmTable"), v = g("FmButton"), E = g("FmCard");
|
|
339
|
+
return d(), T(D, null, [
|
|
340
|
+
m(y, {
|
|
341
|
+
title: e(s)("connect.storeRewards.title"),
|
|
342
|
+
description: e(s)("connect.storeRewards.description"),
|
|
343
|
+
actions: [P],
|
|
344
|
+
"back-button": !0,
|
|
345
|
+
"onClick:action": a[0] || (a[0] = () => h()),
|
|
346
|
+
"onClick:back": a[1] || (a[1] = () => e(f).push({ name: e(k)["$connect-STORE"] }))
|
|
347
|
+
}, null, 8, ["title", "description", "actions"]),
|
|
348
|
+
n("div", be, [
|
|
349
|
+
e(i) && e(i).length > 0 ? (d(), T(D, { key: 0 }, [
|
|
350
|
+
n("div", he, [
|
|
351
|
+
xe,
|
|
352
|
+
m(u, {
|
|
353
|
+
modelValue: e(o).searchKey,
|
|
354
|
+
"onUpdate:modelValue": a[2] || (a[2] = (w) => e(o).searchKey = w),
|
|
355
|
+
class: "",
|
|
356
|
+
placeholder: "search",
|
|
357
|
+
collapsible: ""
|
|
358
|
+
}, null, 8, ["modelValue"])
|
|
359
|
+
]),
|
|
360
|
+
m(x, {
|
|
361
|
+
"row-data": e(i),
|
|
362
|
+
"column-defs": b,
|
|
363
|
+
"search-value": e(o).searchKey,
|
|
364
|
+
"column-filter": e(o).columnFilters,
|
|
365
|
+
onRowClick: a[3] || (a[3] = (w) => h(w.original._id)),
|
|
366
|
+
"hide-footer": e(i).length < 10
|
|
367
|
+
}, null, 8, ["row-data", "search-value", "column-filter", "hide-footer"])
|
|
368
|
+
], 64)) : (d(), R(E, {
|
|
369
|
+
key: 1,
|
|
370
|
+
variant: "outlined",
|
|
371
|
+
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
372
|
+
}, {
|
|
373
|
+
default: S(() => [
|
|
374
|
+
Ce,
|
|
375
|
+
n("div", Se, [
|
|
376
|
+
n("div", Fe, O(e(s)("connect.storeRewards.empty.title")), 1),
|
|
377
|
+
n("div", Ve, O(e(s)("connect.storeRewards.empty.description")), 1)
|
|
378
|
+
]),
|
|
379
|
+
m(v, {
|
|
380
|
+
variant: "primary",
|
|
381
|
+
label: e(s)("connect.storeRewards.empty.action"),
|
|
382
|
+
onClick: a[4] || (a[4] = (w) => h()),
|
|
383
|
+
icon: "add"
|
|
384
|
+
}, null, 8, ["label"])
|
|
385
|
+
]),
|
|
386
|
+
_: 1
|
|
387
|
+
})),
|
|
388
|
+
m(Re, {
|
|
389
|
+
ref_key: "rewardSheetRef",
|
|
390
|
+
ref: l,
|
|
391
|
+
onUpdate: a[5] || (a[5] = (w) => r(w))
|
|
392
|
+
}, null, 512)
|
|
393
|
+
])
|
|
394
|
+
], 64);
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
});
|
|
398
|
+
export {
|
|
399
|
+
We as default
|
|
400
|
+
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { defineComponent as z, ref as A, computed as K, onMounted as G, resolveComponent as D, openBlock as O, createBlock as Y, unref as n, withCtx as U, createVNode as h, normalizeClass as L, createCommentVNode as ue, createElementVNode as T, toDisplayString as X, createElementBlock as H, Fragment as de, renderList as me, mergeModels as J, useModel as pe, watch as W, onBeforeMount as fe, h as o } from "vue";
|
|
2
2
|
import { components as _ } from "@feedmepos/ui-library";
|
|
3
|
-
import { f as ge } from "./index-
|
|
4
|
-
import { a as te } from "./loading-
|
|
3
|
+
import { f as ge } from "./index-BxJgFvym.js";
|
|
4
|
+
import { a as te } from "./loading-Or1ZDzDS.js";
|
|
5
5
|
import { s as ye } from "./index-Dbd4WA4r.js";
|
|
6
6
|
import { h as v } from "./moment-BWErdI6_.js";
|
|
7
7
|
import { s as j } from "./index-CuvNtC_M.js";
|
|
8
|
-
import { f as Q } from "./number-
|
|
9
|
-
import { u as be } from "./business-
|
|
10
|
-
import { a as ae, _ as ne } from "./usePagination
|
|
8
|
+
import { f as Q } from "./number-iEhp7Uai.js";
|
|
9
|
+
import { u as be } from "./business-B9OUlaFZ.js";
|
|
10
|
+
import { a as ae, _ as ne } from "./usePagination-Ci8-uZvb.js";
|
|
11
11
|
import { g as re } from "./user-Bm4KttFq.js";
|
|
12
|
-
import { B as oe, a as le } from "./export-
|
|
13
|
-
import { u as he } from "./campaign-
|
|
14
|
-
import "./index-
|
|
12
|
+
import { B as oe, a as le } from "./export-Buee5oUV.js";
|
|
13
|
+
import { u as he } from "./campaign-CNbUA51l.js";
|
|
14
|
+
import "./index-CoGNKU8v.js";
|
|
15
15
|
import { useRouter as ve } from "vue-router";
|
|
16
|
-
import { R as V } from "./app-
|
|
16
|
+
import { R as V } from "./app-CL2Wxzv5.js";
|
|
17
17
|
import { o as $ } from "./objectId-dwaoBfJX.js";
|
|
18
|
-
import { g as Z, a as _e, S as xe, b as Se } from "./index-
|
|
18
|
+
import { g as Z, a as _e, S as xe, b as Se } from "./index-Co9n8I_5.js";
|
|
19
19
|
function we(r) {
|
|
20
20
|
let c = "";
|
|
21
21
|
switch (r) {
|
|
@@ -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-
|
|
2
|
+
import { u as T } from "./business-B9OUlaFZ.js";
|
|
3
3
|
function j(l, s, n) {
|
|
4
4
|
return l.some(
|
|
5
5
|
n instanceof Function ? n : (a) => a === s
|