@feedmepos/mf-connect 0.1.0-beta.3 → 0.1.0-beta.31
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-C-QC9ivZ.js +424 -0
- package/dist/{App-gzbM97vW.js → App-NASVRSh2.js} +397 -384
- package/dist/{Broadcast-BwYZkTs0.js → Broadcast-Cffg7nbY.js} +32 -32
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DIh9rz6T.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CA4kVwMl.js} +8 -8
- package/dist/Card-CmYFb1_Y.js +897 -0
- package/dist/{Collections-Df6tlo8S.js → Collections-CibvGIpU.js} +4 -4
- package/dist/{Credit-BPel8vA9.js → Credit-Ck6i9ySs.js} +14 -14
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +108 -0
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-B35zbHHI.js +2198 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BT8ucS5G.js → EffectSheet.vue_vue_type_style_index_0_lang-CQV77_cx.js} +8 -8
- package/dist/{Experience-CPpz1Zwx.js → Experience-CWUX2QvS.js} +8 -8
- package/dist/{Game-ByLblISC.js → Game-D3cdZrlc.js} +15 -15
- package/dist/Index-CWLZiYXT.js +255 -0
- package/dist/Marketing-Bol8eY5d.js +20070 -0
- package/dist/{Member-CCc_FEZY.js → Member-Cso-T2Xk.js} +4 -4
- package/dist/MemberList-Bqns9wko.js +1045 -0
- package/dist/{MemberTransactions-DD5ahSbY.js → MemberTransactions-zNw-30Xu.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DSPvWk4C.js → MessageInput.vue_vue_type_script_setup_true_lang-BLS5fNr6.js} +2 -2
- package/dist/{Mission-VH4057I-.js → Mission-C0-K0A_5.js} +98 -86
- package/dist/Overview-fZ9NvFKz.js +1024 -0
- package/dist/{Point-Bu3IlpH4.js → Point-D3gGhQlP.js} +23 -23
- package/dist/{Promotion-B45AOHis.js → Promotion-COCJIfu-.js} +53 -47
- package/dist/Record-C0a4Cn1U.js +209 -0
- package/dist/Reward-D0G4CBYd.js +411 -0
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-zSOwxAcS.js +151 -0
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-AmIdaAeX.js +1639 -0
- package/dist/Segment-eBM3aveX.js +567 -0
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BgMuKAjE.js +181 -0
- package/dist/{Setting-CF09eRQJ.js → Setting-Dfye6fs5.js} +8 -8
- package/dist/Store-rQfwc8d6.js +1745 -0
- package/dist/{StoreRewards-0iGExjqQ.js → StoreRewards-DVTNMWdG.js} +12 -12
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-3dvBoXz2.js +957 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BEfxin47.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DxGIUrmO.js} +1 -1
- package/dist/{Tier-IaeWe7rM.js → Tier-DekrYu5l.js} +327 -317
- package/dist/{Title-DD67Zxh5.js → Title-oAWsBqoM.js} +199 -183
- package/dist/{Transaction-BsPDnLzB.js → Transaction-Ss2XCksi.js} +2 -2
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-BMIqnBts.js +130 -0
- package/dist/{Voucher-M7JfcKo0.js → Voucher-CjPJxdw8.js} +31 -31
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DlWCpoOp.js +419 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-k0lprU2i.js → ZodTextField.vue_vue_type_script_setup_true_lang-FXQNhMrv.js} +1 -1
- package/dist/{app-HFICF0vL.js → app-C_zlbFNe.js} +1285 -1283
- package/dist/{app-DwujUNP-.js → app-WUJQRyEM.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/{business-BaF1QJXa.js → business-C0e_E2xp.js} +1 -1
- package/dist/{campaign-CTDtmAE9.js → campaign-iWzbtNA5.js} +2 -2
- package/dist/collectible.enum-QITAo8Jg.js +19 -0
- package/dist/{collection.fn-DMW03W4R.js → collection.fn-R3hvasuZ.js} +2 -2
- package/dist/{dto-gpaNZHzQ.js → dto-D_tjJ72q.js} +78 -86
- package/dist/{effect-CBUmtwet.js → effect-_bpW5fmr.js} +9 -9
- package/dist/email-addresses-DUKn8uD0.js +705 -0
- package/dist/{export-Bdh_PbsW.js → export-CEBWZ8ko.js} +3 -3
- package/dist/{helper-Cu9elRvl.js → helper-CuF45pbY.js} +1 -1
- package/dist/{index-NXiDu42U.js → index-BO8RnVxy.js} +1 -1
- package/dist/{index-CArqG03W.js → index-BPc3wxOE.js} +39 -35
- package/dist/index-BXTQ6onZ.js +1067 -0
- package/dist/index-C4aPU80a.js +38 -0
- package/dist/{index-At6yms5t.js → index-CBzSPD25.js} +30 -26
- package/dist/{index-Ch6XwPzF.js → index-CR0ZVZQG.js} +1 -1
- package/dist/{index-DrGrOgZB.js → index-CXFwMV0s.js} +13 -1
- package/dist/index-CsaQJMAR.js +66 -0
- package/dist/{index-Dfdg2Q3E.js → index-Dh6xIUXJ.js} +1 -1
- package/dist/{index-ogzk-Mj4.js → index-LMvyNoHf.js} +1 -1
- package/dist/{index-Crw-Vgo5.js → index-S6sFiBxK.js} +1500 -1479
- package/dist/index-SpDFfOz_.js +54 -0
- package/dist/{index-CtH2S49l.js → index-Urbp7cdO.js} +203 -195
- package/dist/index-pHbs1GrF.js +29000 -0
- package/dist/{index.esm2017-CeJpvUbA.js → index.esm2017-BunOalUj.js} +33 -33
- package/dist/{loading-Cn8ml_vy.js → loading-CYFsZ9UB.js} +591 -597
- package/dist/{membership-CX4AKMlH.js → membership-C9089j0H.js} +51 -43
- package/dist/money-D-zGFohv.js +15 -0
- package/dist/number-UFl4zW6h.js +12 -0
- package/dist/objectid-BKIyQ5iE.js +145 -0
- package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
- package/dist/reward-LYKGLzXz.js +36 -0
- package/dist/{rule-Cv83Y59R.js → rule-BUUKmR4_.js} +180 -177
- package/dist/{rule-builder-Dew4yB5Q.js → rule-builder-9JUuOcMH.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{template-CSnbgM1o.js → template-CkXuF0cN.js} +5 -5
- package/dist/trigger-DjAx9efN.js +114 -0
- package/dist/user-DbsZta3D.js +54 -0
- package/dist/{vue-i18n-CNH_IhVd.js → vue-i18n-yYO72Mbp.js} +2 -2
- package/dist/{xlsx-D4DUZHix.js → xlsx-Dagi6ArS.js} +1 -1
- package/package.json +8 -7
- package/dist/Analytic-BC5BA6pN.js +0 -622
- package/dist/Card-CBYQGKwY.js +0 -825
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-PsrS7I0r.js +0 -2809
- package/dist/Marketing-D0vm80e_.js +0 -316
- package/dist/MemberList-CrnipE9y.js +0 -1733
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Ijc2OYh9.js +0 -1753
- package/dist/Segment-ZWsp48aC.js +0 -437
- package/dist/Store-B_G6Dhmq.js +0 -1511
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CaxUr9zl.js +0 -890
- package/dist/index-8MaN7rez.js +0 -762
- package/dist/index-BjdHxGDn.js +0 -298
- package/dist/index-CuvNtC_M.js +0 -61
- package/dist/index-RP0XOPRL.js +0 -29193
- package/dist/money-BTejgvKu.js +0 -15
- package/dist/number-Cen5TucC.js +0 -12
- package/dist/user-Bm4KttFq.js +0 -37
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
import { defineComponent as N, ref as F, computed as K, resolveComponent as y, openBlock as v, createBlock as S, unref as t, isRef as Z, withCtx as L, createElementVNode as u, createVNode as r, createCommentVNode as E, createElementBlock as Y, Fragment as H, h as C, onMounted as q, toDisplayString as $ } from "vue";
|
|
2
|
+
import { _ as z } from "./campaign-CpzFl8Vr.js";
|
|
3
|
+
import { useDialog as G, components as T } from "@feedmepos/ui-library";
|
|
4
|
+
import { f as B, u as X, p as Q } from "./loading-CYFsZ9UB.js";
|
|
5
|
+
import { u as J, C as ee } from "./membership-C9089j0H.js";
|
|
6
|
+
import { u as te } from "./vue-i18n-yYO72Mbp.js";
|
|
7
|
+
import { c as oe } from "./object-qECH92oz.js";
|
|
8
|
+
import { Z as _ } from "./zod-Bg2FbC-D.js";
|
|
9
|
+
import "./index-S6sFiBxK.js";
|
|
10
|
+
import { a as ae } from "./index-SpDFfOz_.js";
|
|
11
|
+
import { useCoreStore as le } from "@feedmepos/mf-common";
|
|
12
|
+
import { _ as ne, a as ie } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-DlWCpoOp.js";
|
|
13
|
+
import { _ as re } from "./EffectSheet.vue_vue_type_style_index_0_lang-CQV77_cx.js";
|
|
14
|
+
import { J as j } from "./JsonViewer-v8_C7l5N.js";
|
|
15
|
+
import { _ as se } from "./ZodTextField.vue_vue_type_script_setup_true_lang-FXQNhMrv.js";
|
|
16
|
+
import { i as de } from "./helper-CuF45pbY.js";
|
|
17
|
+
import { u as me, r as M } from "./reward-LYKGLzXz.js";
|
|
18
|
+
import "./index-Dh6xIUXJ.js";
|
|
19
|
+
import { useRouter as ce } from "vue-router";
|
|
20
|
+
import { R as pe } from "./app-C_zlbFNe.js";
|
|
21
|
+
const ue = { class: "flex gap-8 items-center justify-start" }, ye = /* @__PURE__ */ N({
|
|
22
|
+
__name: "EditRewardSheet",
|
|
23
|
+
emits: ["update"],
|
|
24
|
+
setup(W, { expose: n, emit: A }) {
|
|
25
|
+
const c = J(), { minor: b } = X, f = F(!1), a = F({}), w = F(), g = ae, m = K(() => {
|
|
26
|
+
const l = g.safeParse(a.value);
|
|
27
|
+
return l.success ? [] : l.error.errors;
|
|
28
|
+
});
|
|
29
|
+
function R(l, e) {
|
|
30
|
+
l && (a.value = e), f.value = l;
|
|
31
|
+
}
|
|
32
|
+
const P = A;
|
|
33
|
+
async function U() {
|
|
34
|
+
const l = g.safeParse(a.value);
|
|
35
|
+
!l.success || !l.data || (await b(
|
|
36
|
+
async () => {
|
|
37
|
+
var e;
|
|
38
|
+
l.data.option.type === "VOUCHER" && w.value && (l.data.option.collectibleConfig.image = await B.update(
|
|
39
|
+
((e = l.data.option.collectibleConfig) == null ? void 0 : e.image) || B.collectibleImagePath(void 0, w.value),
|
|
40
|
+
w.value
|
|
41
|
+
));
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
message: "Uploading reward image",
|
|
45
|
+
successMessage: "Reward image updated"
|
|
46
|
+
}
|
|
47
|
+
), P("update", l.data));
|
|
48
|
+
}
|
|
49
|
+
function x(l) {
|
|
50
|
+
l === "VOUCHER" ? a.value.option = {
|
|
51
|
+
collectible: null,
|
|
52
|
+
type: "VOUCHER",
|
|
53
|
+
collectibleConfig: de("VOUCHER", {
|
|
54
|
+
business: le().currentBusiness.value._id
|
|
55
|
+
}),
|
|
56
|
+
earningOption: {
|
|
57
|
+
amount: 1,
|
|
58
|
+
type: "FIXED"
|
|
59
|
+
},
|
|
60
|
+
validityOption: {
|
|
61
|
+
validForDay: 7
|
|
62
|
+
}
|
|
63
|
+
} : a.value.option = {
|
|
64
|
+
collectible: c.loyaltyRewards.raw[0]._id,
|
|
65
|
+
collecitbleType: c.loyaltyRewards.raw[0].type,
|
|
66
|
+
type: "LOYALTY",
|
|
67
|
+
earningOption: {
|
|
68
|
+
amount: 1,
|
|
69
|
+
type: "FIXED"
|
|
70
|
+
},
|
|
71
|
+
validityOption: {
|
|
72
|
+
validForDay: 7
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function I(l) {
|
|
77
|
+
a.value.option.collectible = l;
|
|
78
|
+
}
|
|
79
|
+
const O = F();
|
|
80
|
+
return n({
|
|
81
|
+
showSheet: R
|
|
82
|
+
}), (l, e) => {
|
|
83
|
+
const o = y("FmSelect"), p = y("FmForm"), h = y("FmButton"), D = y("FmSideSheet");
|
|
84
|
+
return v(), S(D, {
|
|
85
|
+
"max-width": 560,
|
|
86
|
+
modelValue: t(f),
|
|
87
|
+
"onUpdate:modelValue": [
|
|
88
|
+
e[8] || (e[8] = (d) => Z(f) ? f.value = d : null),
|
|
89
|
+
e[9] || (e[9] = (d) => f.value = d)
|
|
90
|
+
],
|
|
91
|
+
header: "Edit reward"
|
|
92
|
+
}, {
|
|
93
|
+
"side-sheet-footer": L(() => [
|
|
94
|
+
u("div", ue, [
|
|
95
|
+
r(h, {
|
|
96
|
+
variant: "primary",
|
|
97
|
+
type: "button",
|
|
98
|
+
label: "Confirm",
|
|
99
|
+
disabled: t(m).length > 0,
|
|
100
|
+
onClick: e[6] || (e[6] = (d) => U())
|
|
101
|
+
}, null, 8, ["disabled"]),
|
|
102
|
+
r(h, {
|
|
103
|
+
variant: "secondary",
|
|
104
|
+
type: "button",
|
|
105
|
+
label: "Cancel",
|
|
106
|
+
onClick: e[7] || (e[7] = (d) => f.value = !1)
|
|
107
|
+
})
|
|
108
|
+
])
|
|
109
|
+
]),
|
|
110
|
+
default: L(() => [
|
|
111
|
+
r(j, { json: t(a) }, null, 8, ["json"]),
|
|
112
|
+
r(p, {
|
|
113
|
+
class: "flex flex-col gap-y-24",
|
|
114
|
+
ref_key: "formRef",
|
|
115
|
+
ref: O,
|
|
116
|
+
onValidationSuccess: e[5] || (e[5] = (d) => U())
|
|
117
|
+
}, {
|
|
118
|
+
default: L(() => {
|
|
119
|
+
var d, k, s;
|
|
120
|
+
return [
|
|
121
|
+
r(se, {
|
|
122
|
+
modelValue: t(a).name,
|
|
123
|
+
"onUpdate:modelValue": e[0] || (e[0] = (i) => t(a).name = i),
|
|
124
|
+
label: "Reward Name",
|
|
125
|
+
schema: t(_).typeAtPath(t(g), "name", []),
|
|
126
|
+
"error-text": t(_).helperText(t(m), "name")
|
|
127
|
+
}, null, 8, ["modelValue", "schema", "error-text"]),
|
|
128
|
+
r(o, {
|
|
129
|
+
label: "Reward Type",
|
|
130
|
+
disabled: !!t(a)._id,
|
|
131
|
+
items: [
|
|
132
|
+
{ label: "Voucher", value: "VOUCHER" },
|
|
133
|
+
{ label: "Loyalty", value: "LOYALTY" }
|
|
134
|
+
],
|
|
135
|
+
"model-value": t(a).option.type,
|
|
136
|
+
"onUpdate:modelValue": x
|
|
137
|
+
}, null, 8, ["disabled", "model-value"]),
|
|
138
|
+
t(a).option.type == "LOYALTY" ? (v(), S(o, {
|
|
139
|
+
key: 0,
|
|
140
|
+
label: "Loyalty type",
|
|
141
|
+
items: t(c).loyaltyRewards.items,
|
|
142
|
+
"model-value": t(a).option.collectible,
|
|
143
|
+
"onUpdate:modelValue": I
|
|
144
|
+
}, null, 8, ["items", "model-value"])) : E("", !0),
|
|
145
|
+
t(a).option.type === "LOYALTY" ? (v(), Y(H, { key: 1 }, [
|
|
146
|
+
e[10] || (e[10] = u("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
|
|
147
|
+
((d = t(c).loyaltyRewards.items.find(
|
|
148
|
+
(i) => {
|
|
149
|
+
var V;
|
|
150
|
+
return i.value === ((V = t(a)) == null ? void 0 : V.option.collectible);
|
|
151
|
+
}
|
|
152
|
+
)) == null ? void 0 : d.raw.type) !== "TITLE" ? (v(), S(ne, {
|
|
153
|
+
key: 0,
|
|
154
|
+
class: "mt-[-8px]",
|
|
155
|
+
rules: [
|
|
156
|
+
t(_).ruleAtPath(t(g), "option.earningOption", [
|
|
157
|
+
t(a).option.type
|
|
158
|
+
])
|
|
159
|
+
],
|
|
160
|
+
"helper-state": t(_).helperState(t(m), "option.earningOption"),
|
|
161
|
+
"error-text": t(_).helperText(t(m), "option.earningOption"),
|
|
162
|
+
"fixed-type": !0,
|
|
163
|
+
"model-value": t(a).option.earningOption,
|
|
164
|
+
"onUpdate:modelValue": e[1] || (e[1] = (i) => t(a).option.earningOption = i)
|
|
165
|
+
}, null, 8, ["rules", "helper-state", "error-text", "model-value"])) : E("", !0),
|
|
166
|
+
r(re, {
|
|
167
|
+
class: "!gap-24",
|
|
168
|
+
"for-credit": t(a).option.type === "LOYALTY" && ((k = t(c).loyaltyRewards.items.find(
|
|
169
|
+
(i) => {
|
|
170
|
+
var V;
|
|
171
|
+
return i.value === ((V = t(a).option) == null ? void 0 : V.collectible);
|
|
172
|
+
}
|
|
173
|
+
)) == null ? void 0 : k.raw.type) === "CREDIT",
|
|
174
|
+
rules: [
|
|
175
|
+
t(_).ruleAtPath(t(g), "option.validityOption", [
|
|
176
|
+
t(a).option.type
|
|
177
|
+
])
|
|
178
|
+
],
|
|
179
|
+
"model-value": t(a).option.validityOption,
|
|
180
|
+
"onUpdate:modelValue": e[2] || (e[2] = (i) => t(a).option.validityOption = i)
|
|
181
|
+
}, null, 8, ["for-credit", "rules", "model-value"])
|
|
182
|
+
], 64)) : E("", !0),
|
|
183
|
+
t(a).option.type === "VOUCHER" ? (v(), S(ie, {
|
|
184
|
+
key: 2,
|
|
185
|
+
"reward-image": t(w),
|
|
186
|
+
"model-value": ((s = t(a)) == null ? void 0 : s.option.collectibleConfig) ?? void 0,
|
|
187
|
+
"onUpdate:modelValue": e[3] || (e[3] = (i) => t(a).option.collectibleConfig = i),
|
|
188
|
+
"onUpdate:rewardImage": e[4] || (e[4] = (i) => w.value = i)
|
|
189
|
+
}, null, 8, ["reward-image", "model-value"])) : E("", !0),
|
|
190
|
+
r(j, { json: t(m) }, null, 8, ["json"])
|
|
191
|
+
];
|
|
192
|
+
}),
|
|
193
|
+
_: 1
|
|
194
|
+
}, 512)
|
|
195
|
+
]),
|
|
196
|
+
_: 1
|
|
197
|
+
}, 8, ["modelValue"]);
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
}), fe = { class: "px-24 flex flex-col gap-y-16" }, we = { class: "flex items-center justify-between w-full" }, ve = { class: "flex flex-col gap-16 text-center" }, ge = { class: "fm-typo-en-title-sm-800" }, be = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, He = /* @__PURE__ */ N({
|
|
201
|
+
__name: "Reward",
|
|
202
|
+
setup(W) {
|
|
203
|
+
const { t: n } = te(), A = {
|
|
204
|
+
label: n("connect.storeRewards.create"),
|
|
205
|
+
value: "create",
|
|
206
|
+
isPrimary: !0,
|
|
207
|
+
prependIcon: "add"
|
|
208
|
+
}, c = J(), b = me(), { global: f, minor: a } = X, w = ce(), g = G(), m = F({
|
|
209
|
+
searchKey: "",
|
|
210
|
+
columnFilters: []
|
|
211
|
+
}), R = K(() => b.rewards);
|
|
212
|
+
function P(e) {
|
|
213
|
+
w.push({
|
|
214
|
+
name: pe["$connect-STORE_REWARD_COLLECTIONS"],
|
|
215
|
+
params: { id: e }
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
const U = [
|
|
219
|
+
{
|
|
220
|
+
header: n("connect.storeRewards.table.name"),
|
|
221
|
+
accessorFn: (e) => e.name
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
header: n("connect.storeRewards.table.type"),
|
|
225
|
+
cell(e) {
|
|
226
|
+
return e.row.original.collectibleConfig ? ee[e.row.original.collectibleConfig.type].chip() : "N/A";
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
header: n("connect.storeRewards.table.actions"),
|
|
231
|
+
cell(e) {
|
|
232
|
+
return C("div", { class: "flex items-center justify-end gap-4" }, [
|
|
233
|
+
C(
|
|
234
|
+
T.FmMenu,
|
|
235
|
+
{
|
|
236
|
+
placement: "bottom-end",
|
|
237
|
+
onClick: (o) => {
|
|
238
|
+
o.stopPropagation();
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"menu-button": () => C(T.FmButton, {
|
|
243
|
+
icon: "more_vert",
|
|
244
|
+
iconColor: "neutral-gray-400",
|
|
245
|
+
variant: "tertiary"
|
|
246
|
+
}),
|
|
247
|
+
default: () => [
|
|
248
|
+
e.row.original.option.type === "VOUCHER" && C(T.FmMenuItem, {
|
|
249
|
+
label: "View collections",
|
|
250
|
+
onClick: async (o) => {
|
|
251
|
+
o.stopPropagation(), P(
|
|
252
|
+
e.row.original.option.collectible
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
}),
|
|
256
|
+
C(
|
|
257
|
+
T.FmMenuItem,
|
|
258
|
+
{
|
|
259
|
+
onClick: async (o) => {
|
|
260
|
+
o.stopPropagation(), I(e.row.original);
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
label: C(
|
|
265
|
+
"div",
|
|
266
|
+
{
|
|
267
|
+
class: "text-fm-color-typo-error fm-typo-en-body-md-400"
|
|
268
|
+
},
|
|
269
|
+
"Delete"
|
|
270
|
+
)
|
|
271
|
+
}
|
|
272
|
+
)
|
|
273
|
+
]
|
|
274
|
+
}
|
|
275
|
+
)
|
|
276
|
+
]);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
], x = F();
|
|
280
|
+
async function I(e) {
|
|
281
|
+
await Q.remove(
|
|
282
|
+
n("connect.storeRewards.delete.confirm"),
|
|
283
|
+
n("connect.storeRewards.delete.title")
|
|
284
|
+
) && await a(
|
|
285
|
+
async () => {
|
|
286
|
+
await M.deleteReward(e._id), await b.readRewards();
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
message: n("connect.storeRewards.delete.message"),
|
|
290
|
+
successMessage: n("connect.storeRewards.delete.success")
|
|
291
|
+
}
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
async function O(e) {
|
|
295
|
+
var o;
|
|
296
|
+
e || (e = {
|
|
297
|
+
name: "",
|
|
298
|
+
option: {
|
|
299
|
+
type: "LOYALTY",
|
|
300
|
+
collectible: c.loyaltyRewards.items[0].value,
|
|
301
|
+
collecitbleType: c.loyaltyRewards.items[0].raw.type,
|
|
302
|
+
validityOption: {
|
|
303
|
+
validForDay: 7
|
|
304
|
+
},
|
|
305
|
+
earningOption: {
|
|
306
|
+
type: "FIXED",
|
|
307
|
+
amount: 1
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}), (o = x.value) == null || o.showSheet(!0, oe(e));
|
|
311
|
+
}
|
|
312
|
+
async function l(e) {
|
|
313
|
+
let o = !1;
|
|
314
|
+
e._id && e.option.type === "VOUCHER" && await new Promise((p) => {
|
|
315
|
+
g.open({
|
|
316
|
+
title: "Confirmation",
|
|
317
|
+
message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
|
|
318
|
+
primaryActions: { text: "Update all", close: !0 },
|
|
319
|
+
secondaryActions: { text: "Update future only", close: !0 }
|
|
320
|
+
}).onPrimary(async () => {
|
|
321
|
+
o = !0, p();
|
|
322
|
+
}).onSecondary(async () => {
|
|
323
|
+
p();
|
|
324
|
+
});
|
|
325
|
+
}), await a(
|
|
326
|
+
async () => {
|
|
327
|
+
var p;
|
|
328
|
+
e.collectibleConfig = void 0, e._id ? await M.updateReward(e._id, {
|
|
329
|
+
...e,
|
|
330
|
+
updateCollection: o
|
|
331
|
+
}) : await M.createReward(e), await b.readRewards(), (p = x.value) == null || p.showSheet(!1);
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
message: "Updating reward",
|
|
335
|
+
successMessage: "Reward updated successfully"
|
|
336
|
+
}
|
|
337
|
+
);
|
|
338
|
+
}
|
|
339
|
+
return q(async () => {
|
|
340
|
+
await f(async () => {
|
|
341
|
+
await c.readRewards(), await b.readRewards();
|
|
342
|
+
});
|
|
343
|
+
}), (e, o) => {
|
|
344
|
+
const p = y("FmPageHead"), h = y("FmSearch"), D = y("FmTable"), d = y("FmButton"), k = y("FmCard");
|
|
345
|
+
return v(), Y(H, null, [
|
|
346
|
+
r(p, {
|
|
347
|
+
title: t(n)("connect.reward.title"),
|
|
348
|
+
actions: [A],
|
|
349
|
+
"back-button": !0,
|
|
350
|
+
"onClick:action": o[0] || (o[0] = () => O()),
|
|
351
|
+
"onClick:back": o[1] || (o[1] = () => {
|
|
352
|
+
var s;
|
|
353
|
+
return (s = t(w)) == null ? void 0 : s.back();
|
|
354
|
+
})
|
|
355
|
+
}, null, 8, ["title", "actions"]),
|
|
356
|
+
u("div", fe, [
|
|
357
|
+
t(R) && t(R).length > 0 ? (v(), Y(H, { key: 0 }, [
|
|
358
|
+
u("div", we, [
|
|
359
|
+
o[6] || (o[6] = u("div", { class: "flex gap-8" }, null, -1)),
|
|
360
|
+
r(h, {
|
|
361
|
+
modelValue: t(m).searchKey,
|
|
362
|
+
"onUpdate:modelValue": o[2] || (o[2] = (s) => t(m).searchKey = s),
|
|
363
|
+
class: "",
|
|
364
|
+
placeholder: "search",
|
|
365
|
+
collapsible: ""
|
|
366
|
+
}, null, 8, ["modelValue"])
|
|
367
|
+
]),
|
|
368
|
+
r(D, {
|
|
369
|
+
"row-data": t(R),
|
|
370
|
+
"column-defs": U,
|
|
371
|
+
"search-value": t(m).searchKey,
|
|
372
|
+
"column-filter": t(m).columnFilters,
|
|
373
|
+
onRowClick: o[3] || (o[3] = (s) => O(s.original)),
|
|
374
|
+
"hide-footer": t(R).length < 10
|
|
375
|
+
}, null, 8, ["row-data", "search-value", "column-filter", "hide-footer"])
|
|
376
|
+
], 64)) : (v(), S(k, {
|
|
377
|
+
key: 1,
|
|
378
|
+
variant: "outlined",
|
|
379
|
+
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
380
|
+
}, {
|
|
381
|
+
default: L(() => [
|
|
382
|
+
o[7] || (o[7] = u("img", {
|
|
383
|
+
src: z,
|
|
384
|
+
class: "aspect-square w-[150px]"
|
|
385
|
+
}, null, -1)),
|
|
386
|
+
u("div", ve, [
|
|
387
|
+
u("div", ge, $(t(n)("connect.storeRewards.empty.title")), 1),
|
|
388
|
+
u("div", be, $(t(n)("connect.storeRewards.empty.description")), 1)
|
|
389
|
+
]),
|
|
390
|
+
r(d, {
|
|
391
|
+
variant: "primary",
|
|
392
|
+
label: t(n)("connect.storeRewards.empty.action"),
|
|
393
|
+
onClick: o[4] || (o[4] = (s) => O()),
|
|
394
|
+
icon: "add"
|
|
395
|
+
}, null, 8, ["label"])
|
|
396
|
+
]),
|
|
397
|
+
_: 1
|
|
398
|
+
})),
|
|
399
|
+
r(ye, {
|
|
400
|
+
ref_key: "rewardSheetRef",
|
|
401
|
+
ref: x,
|
|
402
|
+
onUpdate: o[5] || (o[5] = (s) => l(s))
|
|
403
|
+
}, null, 512)
|
|
404
|
+
])
|
|
405
|
+
], 64);
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
});
|
|
409
|
+
export {
|
|
410
|
+
He as default
|
|
411
|
+
};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { ref as p, defineComponent as T, computed as x, resolveComponent as y, openBlock as U, createBlock as G, unref as e, isRef as $, withCtx as b, createElementVNode as v, createVNode as u, toDisplayString as j } from "vue";
|
|
2
|
+
import { u as B } from "./loading-CYFsZ9UB.js";
|
|
3
|
+
import { J as P } from "./JsonViewer-v8_C7l5N.js";
|
|
4
|
+
import { _ as D } from "./ZodTextField.vue_vue_type_script_setup_true_lang-FXQNhMrv.js";
|
|
5
|
+
import { _ as I } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-BMIqnBts.js";
|
|
6
|
+
import { Z as L } from "./zod-Bg2FbC-D.js";
|
|
7
|
+
import { u as V } from "./app-wDQR6dpb.js";
|
|
8
|
+
import { defineStore as N } from "pinia";
|
|
9
|
+
import { r as k } from "./index-C4aPU80a.js";
|
|
10
|
+
import "./index-CBzSPD25.js";
|
|
11
|
+
import "./index-S6sFiBxK.js";
|
|
12
|
+
import "./index-BXTQ6onZ.js";
|
|
13
|
+
import "./index-BPc3wxOE.js";
|
|
14
|
+
import { c as E } from "./index-Urbp7cdO.js";
|
|
15
|
+
import "./index-LMvyNoHf.js";
|
|
16
|
+
import "./index-SpDFfOz_.js";
|
|
17
|
+
import { u as J } from "./vue-i18n-yYO72Mbp.js";
|
|
18
|
+
import { c as C } from "./object-qECH92oz.js";
|
|
19
|
+
import { useDialog as Z } from "@feedmepos/ui-library";
|
|
20
|
+
const A = N("mf-connect-referral", () => {
|
|
21
|
+
const h = p();
|
|
22
|
+
return {
|
|
23
|
+
readReferralProgram: async () => {
|
|
24
|
+
const c = await k.read();
|
|
25
|
+
h.value = c;
|
|
26
|
+
},
|
|
27
|
+
referralProgram: h
|
|
28
|
+
};
|
|
29
|
+
}), H = { class: "flex flex-col space-y-16 pr-12" }, M = { class: "fm-typo-en-title-sm-800" }, O = { class: "flex items-center gap-8" }, W = /* @__PURE__ */ T({
|
|
30
|
+
__name: "EditReferralTierSheet",
|
|
31
|
+
emits: ["update"],
|
|
32
|
+
setup(h, { expose: _, emit: c }) {
|
|
33
|
+
const { t: n } = J(), m = c, s = p(!1), a = p({}), i = p(-1), w = A(), o = E.superRefine((r, t) => {
|
|
34
|
+
r.name.length >= 50 && t.addIssue({
|
|
35
|
+
code: "custom",
|
|
36
|
+
message: "Name must be less than 50 characters"
|
|
37
|
+
});
|
|
38
|
+
}), l = x(() => {
|
|
39
|
+
const r = o.safeParse(a.value);
|
|
40
|
+
return r.success ? [] : r.error.errors;
|
|
41
|
+
});
|
|
42
|
+
function R() {
|
|
43
|
+
const r = o.safeParse(a.value);
|
|
44
|
+
r.success && m("update", i.value, r.data);
|
|
45
|
+
}
|
|
46
|
+
function d(r, t) {
|
|
47
|
+
var f;
|
|
48
|
+
s.value = r, r && typeof t == "number" && t >= 0 ? (i.value = t, a.value = C(
|
|
49
|
+
(f = w.referralProgram) == null ? void 0 : f.reward[t]
|
|
50
|
+
)) : (i.value = -1, a.value = {
|
|
51
|
+
id: (/* @__PURE__ */ new Date()).toISOString(),
|
|
52
|
+
name: "",
|
|
53
|
+
rewards: [],
|
|
54
|
+
rule: void 0
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function g(r) {
|
|
58
|
+
a.value.rule = r;
|
|
59
|
+
}
|
|
60
|
+
return _({
|
|
61
|
+
showSheet: d,
|
|
62
|
+
data: a
|
|
63
|
+
}), (r, t) => {
|
|
64
|
+
const f = y("FmButton"), F = y("FmSideSheet");
|
|
65
|
+
return U(), G(F, {
|
|
66
|
+
"max-width": 1e3,
|
|
67
|
+
modelValue: e(s),
|
|
68
|
+
"onUpdate:modelValue": t[2] || (t[2] = (S) => $(s) ? s.value = S : null),
|
|
69
|
+
header: `${e(i) == -1 ? e(n)("connect.referral.editReferralTierSheet.create") : e(n)("connect.referral.editReferralTierSheet.edit")}`
|
|
70
|
+
}, {
|
|
71
|
+
"side-sheet-footer": b(() => [
|
|
72
|
+
v("div", O, [
|
|
73
|
+
u(f, {
|
|
74
|
+
label: e(n)("connect.editTierSheet.submit"),
|
|
75
|
+
onClick: R,
|
|
76
|
+
disabled: e(l).length > 0 || e(V)().isLoading,
|
|
77
|
+
loading: e(V)().isLoading
|
|
78
|
+
}, null, 8, ["label", "disabled", "loading"]),
|
|
79
|
+
u(f, {
|
|
80
|
+
label: e(n)("connect.editTierSheet.cancel"),
|
|
81
|
+
onClick: t[1] || (t[1] = (S) => d(!1)),
|
|
82
|
+
variant: "tertiary"
|
|
83
|
+
}, null, 8, ["label"])
|
|
84
|
+
])
|
|
85
|
+
]),
|
|
86
|
+
default: b(() => [
|
|
87
|
+
u(P, { json: e(a) }, null, 8, ["json"]),
|
|
88
|
+
u(P, { json: e(l) }, null, 8, ["json"]),
|
|
89
|
+
v("div", H, [
|
|
90
|
+
u(D, {
|
|
91
|
+
modelValue: e(a).name,
|
|
92
|
+
"onUpdate:modelValue": t[0] || (t[0] = (S) => e(a).name = S),
|
|
93
|
+
label: e(n)("connect.referral.editReferralTierSheet.name"),
|
|
94
|
+
schema: e(L).typeAtPath(e(o), "name")
|
|
95
|
+
}, null, 8, ["modelValue", "label", "schema"]),
|
|
96
|
+
v("div", M, j(e(n)("connect.referral.editReferralTierSheet.target_audience")), 1),
|
|
97
|
+
u(I, {
|
|
98
|
+
"model-value": e(a).rule,
|
|
99
|
+
"onUpdate:modelValue": g
|
|
100
|
+
}, null, 8, ["model-value"])
|
|
101
|
+
])
|
|
102
|
+
]),
|
|
103
|
+
_: 1
|
|
104
|
+
}, 8, ["modelValue", "header"]);
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
}), fe = /* @__PURE__ */ T({
|
|
108
|
+
__name: "RewardGroup",
|
|
109
|
+
setup(h, { expose: _ }) {
|
|
110
|
+
const { minor: c } = B, n = Z(), m = A(), s = x(() => {
|
|
111
|
+
var o;
|
|
112
|
+
return ((o = m.referralProgram) == null ? void 0 : o.reward) ?? [];
|
|
113
|
+
}), a = p(null);
|
|
114
|
+
function i(o) {
|
|
115
|
+
var l;
|
|
116
|
+
(l = a.value) == null || l.showSheet(!0, o);
|
|
117
|
+
}
|
|
118
|
+
_({
|
|
119
|
+
onManageRewardGroup: i
|
|
120
|
+
});
|
|
121
|
+
async function w(o, l) {
|
|
122
|
+
var r;
|
|
123
|
+
const R = o == -1 ? s.value.length : o, d = C(m.referralProgram);
|
|
124
|
+
d.reward[R] = l;
|
|
125
|
+
let g = !1;
|
|
126
|
+
await new Promise((t) => {
|
|
127
|
+
n.open({
|
|
128
|
+
title: "Confirmation",
|
|
129
|
+
message: "This will change all referral settings? Would you like to update previous referral record?",
|
|
130
|
+
primaryActions: { text: "Update all", close: !0 },
|
|
131
|
+
secondaryActions: { text: "Update future only", close: !0 }
|
|
132
|
+
}).onPrimary(async () => {
|
|
133
|
+
g = !0, t();
|
|
134
|
+
}).onSecondary(async () => {
|
|
135
|
+
t();
|
|
136
|
+
});
|
|
137
|
+
}), await c(async () => {
|
|
138
|
+
await k.update({ ...d, updateReferralRecord: g }), await m.readReferralProgram();
|
|
139
|
+
}), (r = a.value) == null || r.showSheet(!1);
|
|
140
|
+
}
|
|
141
|
+
return (o, l) => (U(), G(W, {
|
|
142
|
+
ref_key: "editReferralTierSheetRef",
|
|
143
|
+
ref: a,
|
|
144
|
+
onUpdate: w
|
|
145
|
+
}, null, 512));
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
export {
|
|
149
|
+
fe as _,
|
|
150
|
+
A as u
|
|
151
|
+
};
|