@feedmepos/mf-connect 0.1.57-prod → 0.1.58-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/package.json +1 -1
- package/dist/Analytic-BqvhYgCU.js +0 -427
- package/dist/App-Dtl_D0cH.js +0 -4630
- package/dist/Bin-y4ikpgPS.js +0 -166
- package/dist/Broadcast-DSROFwe4.js +0 -233
- package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CcsG6vOP.js +0 -121
- package/dist/Card-BiSEPsZb.js +0 -911
- package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
- package/dist/Collections-CX-nN7Xj.js +0 -458
- package/dist/Credit-IiV9b4cB.js +0 -228
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CoGes8YL.js +0 -2194
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-sGh_SMCH.js +0 -348
- package/dist/Experience-Cf-EMhKy.js +0 -229
- package/dist/FileSaver.min-NlMItPOc.js +0 -74
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
- package/dist/Game-C8mfJn6W.js +0 -284
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js +0 -144
- package/dist/Index-DkvO1AoT.js +0 -259
- package/dist/JsonViewer-v8_C7l5N.js +0 -87
- package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +0 -18737
- package/dist/MainLayout-B1aJoR95.js +0 -41
- package/dist/Marketing-xJTIo3RF.js +0 -319
- package/dist/Member-DZkYoKW8.js +0 -279
- package/dist/MemberList-CAYEJnf3.js +0 -1607
- package/dist/MemberOverview-wL_ailso.js +0 -58
- package/dist/MemberTransactions-Dc5aAQ69.js +0 -45
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-BSvlPzw8.js +0 -60553
- package/dist/Mission-C_NbNWZw.js +0 -302
- package/dist/Overview-DyxEwEfe.js +0 -1079
- package/dist/Point-CsEWk61V.js +0 -232
- package/dist/Promotion--pWgy9Dx.js +0 -289
- package/dist/Queue-k3qAQR7B.js +0 -260
- package/dist/Record-D5F5JyVA.js +0 -341
- package/dist/Reward-3FSrq5mX.js +0 -442
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-Dzj7a7UY.js +0 -150
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DRl_Gjfx.js +0 -1763
- package/dist/Segment-BWJn6ODR.js +0 -882
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BKsV_zcr.js +0 -181
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-C3efGNC_.js +0 -188
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-Cj7c2V3h.js +0 -147
- package/dist/Setting-UiTXazZV.js +0 -1936
- package/dist/Store-BrvmHPCX.js +0 -1842
- package/dist/StoreRewards-D_7fr-Ef.js +0 -423
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BXy0L5AH.js +0 -995
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DumcDlBs.js +0 -139
- package/dist/Tier-C4wvx8F7.js +0 -895
- package/dist/Title-CPHT85Uj.js +0 -566
- package/dist/Transaction-6Ig2W00P.js +0 -39
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-DknFkIJh.js +0 -130
- package/dist/Voucher-Bbl-7gZ5.js +0 -384
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-xsswRZG8.js +0 -419
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-B5J6Hd8G.js +0 -56
- package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
- package/dist/app-BDVZwARN.js +0 -7057
- package/dist/app-CAEhNFRG.js +0 -57962
- package/dist/app-wDQR6dpb.js +0 -39
- package/dist/app.js +0 -6
- package/dist/business-6C_ol5wd.js +0 -82
- package/dist/campaign-B13G6pZ3.js +0 -1810
- package/dist/campaign-CpzFl8Vr.js +0 -4
- package/dist/campaign-DrQp6qBu.js +0 -94
- package/dist/campaign.enum-DnTrlaNC.js +0 -20
- package/dist/campaign.fn-BZse90_k.js +0 -758
- package/dist/collectible.enum-633Me0yR.js +0 -19
- package/dist/collection.fn-C96855j5.js +0 -26
- package/dist/dto-2bMujqmZ.js +0 -216
- package/dist/effect-C7lAJwKh.js +0 -78
- package/dist/email-addresses-3ayN-9jv.js +0 -705
- package/dist/export-BNbDV7SC.js +0 -97
- package/dist/feedme.ico +0 -0
- package/dist/helper-CsfZ__dQ.js +0 -71
- package/dist/index-BLSAz0gK.js +0 -32
- package/dist/index-BY9I3Cer.js +0 -3
- package/dist/index-BdnRNcVO.js +0 -146
- package/dist/index-BmyNfpfG.js +0 -30076
- package/dist/index-CSBRkhKy.js +0 -38
- package/dist/index-Cf_fcvoS.js +0 -54
- package/dist/index-CqrO13uj.js +0 -76
- package/dist/index-CuvNtC_M.js +0 -61
- package/dist/index-D4kdSzs9.js +0 -3070
- package/dist/index-DcJq7tl4.js +0 -32269
- package/dist/index-DdjSIwSL.js +0 -44
- package/dist/index-LKr2k8J2.js +0 -8861
- package/dist/index-XAxwm-1v.js +0 -2130
- package/dist/index-b82LrGSB.js +0 -121
- package/dist/index-tcAb0W5F.js +0 -31
- package/dist/index-vh86FiIQ.js +0 -10
- package/dist/index.esm2017-BklqmujQ.js +0 -3069
- package/dist/loading-OXARGiqO.js +0 -71
- package/dist/lodash-B5I3zXaY.js +0 -3678
- package/dist/membership-D1Vb1rUo.js +0 -235
- package/dist/moment-D7p2TMB-.js +0 -2583
- package/dist/money-BpyAytEq.js +0 -15
- package/dist/number-C-PtPOOj.js +0 -12
- package/dist/object-qECH92oz.js +0 -26
- package/dist/objectId-dwaoBfJX.js +0 -7
- package/dist/objectid-BrLIKTmQ.js +0 -145
- package/dist/plugins-CjPWhNb2.js +0 -208
- package/dist/reward-DonQFzvW.js +0 -36
- package/dist/rule-AtNPBnbE.js +0 -1951
- package/dist/rule-builder-C0Q-3g6T.js +0 -102
- package/dist/style.css +0 -4
- package/dist/template-CNjE7eht.js +0 -190
- package/dist/tier-BJDhpH6X.js +0 -4
- package/dist/tiers/tier=1.png +0 -0
- package/dist/tiers/tier=2.png +0 -0
- package/dist/tiers/tier=3.png +0 -0
- package/dist/tiers/tier=4.png +0 -0
- package/dist/timezone-CYbdI3q2.js +0 -1151
- package/dist/titles/type=diamond.png +0 -0
- package/dist/titles/type=drinks.png +0 -0
- package/dist/titles/type=food.png +0 -0
- package/dist/titles/type=heart.png +0 -0
- package/dist/titles/type=medal.png +0 -0
- package/dist/titles/type=spend.png +0 -0
- package/dist/titles/type=thank-you.png +0 -0
- package/dist/titles/type=thumbs-up.png +0 -0
- package/dist/titles/type=years.png +0 -0
- package/dist/trigger-Bdi6n80h.js +0 -144
- package/dist/tslib.es6-BCqqvLQ_.js +0 -44
- package/dist/type_drinks-D6jnpvwV.js +0 -4
- package/dist/usePagination-Ds-cuHop.js +0 -223
- package/dist/user-BwGm78n8.js +0 -54
- package/dist/vue-i18n-D1nTd69a.js +0 -2365
- package/dist/xlsx-DF5iW3wh.js +0 -15491
- package/dist/zod-Bg2FbC-D.js +0 -90
package/dist/Reward-3FSrq5mX.js
DELETED
|
@@ -1,442 +0,0 @@
|
|
|
1
|
-
import { defineComponent as X, ref as x, computed as H, resolveComponent as w, openBlock as b, createBlock as h, unref as t, isRef as Z, withCtx as A, createElementVNode as f, createVNode as d, createCommentVNode as k, createElementBlock as M, Fragment as Y, h as O, onMounted as q, toDisplayString as B } from "vue";
|
|
2
|
-
import { _ as z } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { useDialog as Q, components as L } from "@feedmepos/ui-library";
|
|
4
|
-
import { u as G } from "./loading-OXARGiqO.js";
|
|
5
|
-
import { u as J, C as ee } from "./membership-D1Vb1rUo.js";
|
|
6
|
-
import { f as j, p as te } from "./plugins-CjPWhNb2.js";
|
|
7
|
-
import { u as oe } from "./vue-i18n-D1nTd69a.js";
|
|
8
|
-
import { c as ae } from "./object-qECH92oz.js";
|
|
9
|
-
import { Z as _ } from "./zod-Bg2FbC-D.js";
|
|
10
|
-
import "./index-LKr2k8J2.js";
|
|
11
|
-
import { F as N } from "./index-Cf_fcvoS.js";
|
|
12
|
-
import { useCoreStore as le } from "@feedmepos/mf-common";
|
|
13
|
-
import { _ as ne, a as ie } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-xsswRZG8.js";
|
|
14
|
-
import { b as re } from "./EffectSheet.vue_vue_type_style_index_0_lang-sGh_SMCH.js";
|
|
15
|
-
import { J as K } from "./JsonViewer-v8_C7l5N.js";
|
|
16
|
-
import { _ as se } from "./ZodTextField.vue_vue_type_script_setup_true_lang-B5J6Hd8G.js";
|
|
17
|
-
import { i as de } from "./helper-CsfZ__dQ.js";
|
|
18
|
-
import { u as pe, r as P } from "./reward-DonQFzvW.js";
|
|
19
|
-
import "./index-BY9I3Cer.js";
|
|
20
|
-
import { C as ce } from "./campaign.fn-BZse90_k.js";
|
|
21
|
-
import { e as me } from "./effect-C7lAJwKh.js";
|
|
22
|
-
import { useRouter as ue } from "vue-router";
|
|
23
|
-
import { R as ye } from "./app-BDVZwARN.js";
|
|
24
|
-
const fe = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__ */ X({
|
|
25
|
-
__name: "EditRewardSheet",
|
|
26
|
-
emits: ["update"],
|
|
27
|
-
setup(W, { expose: n, emit: I }) {
|
|
28
|
-
const p = J(), { minor: C } = G, v = x(!1), a = x({}), y = x(), R = H(() => {
|
|
29
|
-
var l;
|
|
30
|
-
return ((l = a.value.option) == null ? void 0 : l.collectibleType) === "CREDIT" ? N.superRefine((e, o) => {
|
|
31
|
-
var i, m, g, r;
|
|
32
|
-
!((m = (i = e.option) == null ? void 0 : i.validityOption) != null && m.validForDay) && !((r = (g = e.option) == null ? void 0 : g.validityOption) != null && r.validBefore) && o.addIssue({
|
|
33
|
-
code: "custom",
|
|
34
|
-
path: [],
|
|
35
|
-
message: "Credit validity must be set"
|
|
36
|
-
});
|
|
37
|
-
}) : N;
|
|
38
|
-
}), u = H(() => {
|
|
39
|
-
const l = R.value.safeParse(a.value);
|
|
40
|
-
return l.success ? [] : l.error.errors;
|
|
41
|
-
});
|
|
42
|
-
function F(l, e) {
|
|
43
|
-
l && (y.value = void 0, a.value = e), v.value = l;
|
|
44
|
-
}
|
|
45
|
-
const D = I;
|
|
46
|
-
async function S() {
|
|
47
|
-
const l = R.value.safeParse(a.value);
|
|
48
|
-
!l.success || !l.data || (await C(
|
|
49
|
-
async () => {
|
|
50
|
-
var e;
|
|
51
|
-
l.data.option.type === "VOUCHER" && y.value && (l.data.option.collectibleConfig.image = await j.update(
|
|
52
|
-
((e = l.data.option.collectibleConfig) == null ? void 0 : e.image) || j.collectibleImagePath(void 0, y.value),
|
|
53
|
-
y.value
|
|
54
|
-
));
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
message: "Uploading reward image",
|
|
58
|
-
successMessage: "Reward image updated"
|
|
59
|
-
}
|
|
60
|
-
), D("update", l.data));
|
|
61
|
-
}
|
|
62
|
-
function T(l) {
|
|
63
|
-
l === "VOUCHER" ? a.value.option = {
|
|
64
|
-
collectible: null,
|
|
65
|
-
type: "VOUCHER",
|
|
66
|
-
collectibleConfig: de("VOUCHER", {
|
|
67
|
-
business: le().currentBusiness.value._id
|
|
68
|
-
}),
|
|
69
|
-
earningOption: {
|
|
70
|
-
amount: 1,
|
|
71
|
-
type: "FIXED"
|
|
72
|
-
},
|
|
73
|
-
validityOption: {
|
|
74
|
-
validForDay: 7
|
|
75
|
-
}
|
|
76
|
-
} : a.value.option = {
|
|
77
|
-
collectible: p.loyaltyRewards.raw[0]._id,
|
|
78
|
-
collectibleType: p.loyaltyRewards.raw[0].type,
|
|
79
|
-
type: "LOYALTY",
|
|
80
|
-
earningOption: {
|
|
81
|
-
amount: 1,
|
|
82
|
-
type: "FIXED"
|
|
83
|
-
},
|
|
84
|
-
validityOption: {
|
|
85
|
-
validForDay: 7
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
function $(l) {
|
|
90
|
-
a.value.option.collectible = l, a.value.option.collectibleType = p.loyaltyRewards.raw.find(
|
|
91
|
-
(e) => e._id === l
|
|
92
|
-
).type;
|
|
93
|
-
}
|
|
94
|
-
const V = x();
|
|
95
|
-
return n({
|
|
96
|
-
showSheet: F
|
|
97
|
-
}), (l, e) => {
|
|
98
|
-
const o = w("FmSelect"), i = w("FmForm"), m = w("FmButton"), g = w("FmSideSheet");
|
|
99
|
-
return b(), h(g, {
|
|
100
|
-
"max-width": 560,
|
|
101
|
-
modelValue: t(v),
|
|
102
|
-
"onUpdate:modelValue": [
|
|
103
|
-
e[8] || (e[8] = (r) => Z(v) ? v.value = r : null),
|
|
104
|
-
e[9] || (e[9] = (r) => v.value = r)
|
|
105
|
-
],
|
|
106
|
-
header: "Edit reward"
|
|
107
|
-
}, {
|
|
108
|
-
"side-sheet-footer": A(() => [
|
|
109
|
-
f("div", fe, [
|
|
110
|
-
d(m, {
|
|
111
|
-
variant: "primary",
|
|
112
|
-
type: "button",
|
|
113
|
-
label: "Confirm",
|
|
114
|
-
disabled: t(u).length > 0,
|
|
115
|
-
onClick: e[6] || (e[6] = (r) => S())
|
|
116
|
-
}, null, 8, ["disabled"]),
|
|
117
|
-
d(m, {
|
|
118
|
-
variant: "secondary",
|
|
119
|
-
type: "button",
|
|
120
|
-
label: "Cancel",
|
|
121
|
-
onClick: e[7] || (e[7] = (r) => v.value = !1)
|
|
122
|
-
})
|
|
123
|
-
])
|
|
124
|
-
]),
|
|
125
|
-
default: A(() => [
|
|
126
|
-
d(K, { json: t(a) }, null, 8, ["json"]),
|
|
127
|
-
d(i, {
|
|
128
|
-
class: "flex flex-col gap-y-24",
|
|
129
|
-
ref_key: "formRef",
|
|
130
|
-
ref: V,
|
|
131
|
-
onValidationSuccess: e[5] || (e[5] = (r) => S())
|
|
132
|
-
}, {
|
|
133
|
-
default: A(() => {
|
|
134
|
-
var r, E, c;
|
|
135
|
-
return [
|
|
136
|
-
d(se, {
|
|
137
|
-
modelValue: t(a).name,
|
|
138
|
-
"onUpdate:modelValue": e[0] || (e[0] = (s) => t(a).name = s),
|
|
139
|
-
label: "Reward Name",
|
|
140
|
-
schema: t(_).typeAtPath(t(R), "name", []),
|
|
141
|
-
"error-text": t(_).helperText(t(u), "name")
|
|
142
|
-
}, null, 8, ["modelValue", "schema", "error-text"]),
|
|
143
|
-
d(o, {
|
|
144
|
-
label: "Reward Type",
|
|
145
|
-
disabled: !!t(a)._id,
|
|
146
|
-
items: [
|
|
147
|
-
{ label: "Voucher", value: "VOUCHER" },
|
|
148
|
-
{ label: "Loyalty", value: "LOYALTY" }
|
|
149
|
-
],
|
|
150
|
-
"model-value": t(a).option.type,
|
|
151
|
-
"onUpdate:modelValue": T
|
|
152
|
-
}, null, 8, ["disabled", "model-value"]),
|
|
153
|
-
t(a).option.type == "LOYALTY" ? (b(), h(o, {
|
|
154
|
-
key: 0,
|
|
155
|
-
label: "Loyalty type",
|
|
156
|
-
items: t(p).loyaltyRewards.items,
|
|
157
|
-
"model-value": t(a).option.collectible,
|
|
158
|
-
"onUpdate:modelValue": $
|
|
159
|
-
}, null, 8, ["items", "model-value"])) : k("", !0),
|
|
160
|
-
t(a).option.type === "LOYALTY" ? (b(), M(Y, { key: 1 }, [
|
|
161
|
-
e[10] || (e[10] = f("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
|
|
162
|
-
((r = t(p).loyaltyRewards.items.find(
|
|
163
|
-
(s) => {
|
|
164
|
-
var U;
|
|
165
|
-
return s.value === ((U = t(a)) == null ? void 0 : U.option.collectible);
|
|
166
|
-
}
|
|
167
|
-
)) == null ? void 0 : r.raw.type) !== "TITLE" ? (b(), h(ne, {
|
|
168
|
-
key: 0,
|
|
169
|
-
class: "mt-[-8px]",
|
|
170
|
-
rules: [
|
|
171
|
-
t(_).ruleAtPath(t(R), "option.earningOption", [
|
|
172
|
-
t(a).option.type
|
|
173
|
-
])
|
|
174
|
-
],
|
|
175
|
-
"helper-state": t(_).helperState(t(u), "option.earningOption"),
|
|
176
|
-
"error-text": t(_).helperText(t(u), "option.earningOption"),
|
|
177
|
-
"fixed-type": !0,
|
|
178
|
-
"model-value": t(a).option.earningOption,
|
|
179
|
-
"onUpdate:modelValue": e[1] || (e[1] = (s) => t(a).option.earningOption = s)
|
|
180
|
-
}, null, 8, ["rules", "helper-state", "error-text", "model-value"])) : k("", !0),
|
|
181
|
-
d(re, {
|
|
182
|
-
class: "!gap-24",
|
|
183
|
-
"for-credit": t(a).option.type === "LOYALTY" && ((E = t(p).loyaltyRewards.items.find(
|
|
184
|
-
(s) => {
|
|
185
|
-
var U;
|
|
186
|
-
return s.value === ((U = t(a).option) == null ? void 0 : U.collectible);
|
|
187
|
-
}
|
|
188
|
-
)) == null ? void 0 : E.raw.type) === "CREDIT",
|
|
189
|
-
type: t(a).option.type === "VOUCHER" ? "range" : "custom",
|
|
190
|
-
rules: [
|
|
191
|
-
t(_).ruleAtPath(t(R), "option.validityOption", [
|
|
192
|
-
t(a).option.type
|
|
193
|
-
])
|
|
194
|
-
],
|
|
195
|
-
"model-value": t(a).option.validityOption,
|
|
196
|
-
"onUpdate:modelValue": e[2] || (e[2] = (s) => t(a).option.validityOption = s)
|
|
197
|
-
}, null, 8, ["for-credit", "type", "rules", "model-value"])
|
|
198
|
-
], 64)) : k("", !0),
|
|
199
|
-
t(a).option.type === "VOUCHER" ? (b(), h(ie, {
|
|
200
|
-
key: 2,
|
|
201
|
-
"reward-image": t(y),
|
|
202
|
-
"model-value": ((c = t(a)) == null ? void 0 : c.option.collectibleConfig) ?? void 0,
|
|
203
|
-
"onUpdate:modelValue": e[3] || (e[3] = (s) => t(a).option.collectibleConfig = s),
|
|
204
|
-
"onUpdate:rewardImage": e[4] || (e[4] = (s) => y.value = s)
|
|
205
|
-
}, null, 8, ["reward-image", "model-value"])) : k("", !0),
|
|
206
|
-
d(K, { json: t(u) }, null, 8, ["json"])
|
|
207
|
-
];
|
|
208
|
-
}),
|
|
209
|
-
_: 1
|
|
210
|
-
}, 512)
|
|
211
|
-
]),
|
|
212
|
-
_: 1
|
|
213
|
-
}, 8, ["modelValue"]);
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
}), ve = { class: "px-24 flex flex-col gap-y-16" }, ge = { class: "flex items-center justify-between w-full" }, be = { class: "flex flex-col gap-16 text-center" }, Re = { class: "fm-typo-en-title-sm-800" }, Ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ke = /* @__PURE__ */ X({
|
|
217
|
-
__name: "Reward",
|
|
218
|
-
setup(W) {
|
|
219
|
-
const { t: n } = oe(), I = {
|
|
220
|
-
label: n("connect.storeRewards.create"),
|
|
221
|
-
value: "create",
|
|
222
|
-
isPrimary: !0,
|
|
223
|
-
prependIcon: "add"
|
|
224
|
-
}, p = J(), C = pe(), { global: v, minor: a } = G, y = ue(), R = Q(), u = x({
|
|
225
|
-
searchKey: "",
|
|
226
|
-
columnFilters: []
|
|
227
|
-
}), F = H(() => C.rewards);
|
|
228
|
-
function D(e) {
|
|
229
|
-
y.push({
|
|
230
|
-
name: ye["$connect-STORE_REWARD_COLLECTIONS"],
|
|
231
|
-
params: { id: e }
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
const S = [
|
|
235
|
-
{
|
|
236
|
-
header: n("connect.storeRewards.table.name"),
|
|
237
|
-
accessorFn: (e) => e.name
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
header: n("connect.storeRewards.table.type"),
|
|
241
|
-
cell(e) {
|
|
242
|
-
return e.row.original.collectibleConfig ? ee[e.row.original.collectibleConfig.type].chip() : "N/A";
|
|
243
|
-
}
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
header: n("connect.storeRewards.table.summary"),
|
|
247
|
-
accessorFn: (e) => {
|
|
248
|
-
var o, i;
|
|
249
|
-
if (e.option.type === "VOUCHER")
|
|
250
|
-
return me((i = (o = e.option.collectibleConfig) == null ? void 0 : o.extras) == null ? void 0 : i.effect);
|
|
251
|
-
if (e.option.collectibleType == "TITLE") {
|
|
252
|
-
const m = p.sortedTitles.find(
|
|
253
|
-
(g) => g._id == e.option.collectible
|
|
254
|
-
);
|
|
255
|
-
return `Get ${m == null ? void 0 : m.name} valid for ${e.option.validityOption.validForDay} days`;
|
|
256
|
-
}
|
|
257
|
-
return `Get ${e.option.earningOption.amount} ${ce.formattedType(e.option.collectibleType)}`;
|
|
258
|
-
}
|
|
259
|
-
},
|
|
260
|
-
{
|
|
261
|
-
header: n("connect.storeRewards.table.actions"),
|
|
262
|
-
cell(e) {
|
|
263
|
-
return O("div", { class: "flex items-center justify-end gap-4" }, [
|
|
264
|
-
O(
|
|
265
|
-
L.FmMenu,
|
|
266
|
-
{
|
|
267
|
-
placement: "bottom-end",
|
|
268
|
-
onClick: (o) => {
|
|
269
|
-
o.stopPropagation();
|
|
270
|
-
}
|
|
271
|
-
},
|
|
272
|
-
{
|
|
273
|
-
"menu-button": () => O(L.FmButton, {
|
|
274
|
-
icon: "more_vert",
|
|
275
|
-
iconColor: "neutral-gray-400",
|
|
276
|
-
variant: "tertiary"
|
|
277
|
-
}),
|
|
278
|
-
default: () => [
|
|
279
|
-
e.row.original.option.type === "VOUCHER" && O(L.FmMenuItem, {
|
|
280
|
-
label: "View collections",
|
|
281
|
-
onClick: async (o) => {
|
|
282
|
-
o.stopPropagation(), D(
|
|
283
|
-
e.row.original.option.collectible
|
|
284
|
-
);
|
|
285
|
-
}
|
|
286
|
-
}),
|
|
287
|
-
O(
|
|
288
|
-
L.FmMenuItem,
|
|
289
|
-
{
|
|
290
|
-
onClick: async (o) => {
|
|
291
|
-
o.stopPropagation(), $(e.row.original);
|
|
292
|
-
}
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
label: O(
|
|
296
|
-
"div",
|
|
297
|
-
{
|
|
298
|
-
class: "text-fm-color-typo-error fm-typo-en-body-md-400"
|
|
299
|
-
},
|
|
300
|
-
"Delete"
|
|
301
|
-
)
|
|
302
|
-
}
|
|
303
|
-
)
|
|
304
|
-
]
|
|
305
|
-
}
|
|
306
|
-
)
|
|
307
|
-
]);
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
], T = x();
|
|
311
|
-
async function $(e) {
|
|
312
|
-
await te.remove(
|
|
313
|
-
n("connect.storeRewards.delete.confirm"),
|
|
314
|
-
n("connect.storeRewards.delete.title")
|
|
315
|
-
) && await a(
|
|
316
|
-
async () => {
|
|
317
|
-
await P.deleteReward(e._id), await C.readRewards();
|
|
318
|
-
},
|
|
319
|
-
{
|
|
320
|
-
message: n("connect.storeRewards.delete.message"),
|
|
321
|
-
successMessage: n("connect.storeRewards.delete.success")
|
|
322
|
-
}
|
|
323
|
-
);
|
|
324
|
-
}
|
|
325
|
-
async function V(e) {
|
|
326
|
-
var o;
|
|
327
|
-
e || (e = {
|
|
328
|
-
name: "",
|
|
329
|
-
option: {
|
|
330
|
-
type: "LOYALTY",
|
|
331
|
-
collectible: p.loyaltyRewards.items[0].value,
|
|
332
|
-
collectibleType: p.loyaltyRewards.items[0].raw.type,
|
|
333
|
-
validityOption: {
|
|
334
|
-
validForDay: 7
|
|
335
|
-
},
|
|
336
|
-
earningOption: {
|
|
337
|
-
type: "FIXED",
|
|
338
|
-
amount: 1
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
}), (o = T.value) == null || o.showSheet(!0, ae(e));
|
|
342
|
-
}
|
|
343
|
-
async function l(e) {
|
|
344
|
-
let o = !1;
|
|
345
|
-
e._id && e.option.type === "VOUCHER" && await new Promise((i) => {
|
|
346
|
-
R.open({
|
|
347
|
-
title: "Confirmation",
|
|
348
|
-
message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
|
|
349
|
-
primaryActions: { text: "Update all", close: !0 },
|
|
350
|
-
secondaryActions: { text: "Update future only", close: !0 }
|
|
351
|
-
}).onPrimary(async () => {
|
|
352
|
-
o = !0, i();
|
|
353
|
-
}).onSecondary(async () => {
|
|
354
|
-
i();
|
|
355
|
-
});
|
|
356
|
-
}), await a(
|
|
357
|
-
async () => {
|
|
358
|
-
var i;
|
|
359
|
-
e.collectibleConfig = void 0, e._id ? await P.updateReward(e._id, {
|
|
360
|
-
...e,
|
|
361
|
-
updateCollection: o
|
|
362
|
-
}) : await P.createReward(e), await C.readRewards(), (i = T.value) == null || i.showSheet(!1);
|
|
363
|
-
},
|
|
364
|
-
{
|
|
365
|
-
message: "Updating reward",
|
|
366
|
-
successMessage: "Reward updated successfully"
|
|
367
|
-
}
|
|
368
|
-
);
|
|
369
|
-
}
|
|
370
|
-
return q(async () => {
|
|
371
|
-
await v(async () => {
|
|
372
|
-
await p.readMembership(), await p.readRewards(), await C.readRewards();
|
|
373
|
-
});
|
|
374
|
-
}), (e, o) => {
|
|
375
|
-
const i = w("FmPageHead"), m = w("FmSearch"), g = w("FmTable"), r = w("FmButton"), E = w("FmCard");
|
|
376
|
-
return b(), M(Y, null, [
|
|
377
|
-
d(i, {
|
|
378
|
-
title: t(n)("connect.reward.title"),
|
|
379
|
-
actions: [I],
|
|
380
|
-
"back-button": !0,
|
|
381
|
-
"onClick:action": o[0] || (o[0] = () => V()),
|
|
382
|
-
"onClick:back": o[1] || (o[1] = () => {
|
|
383
|
-
var c;
|
|
384
|
-
return (c = t(y)) == null ? void 0 : c.back();
|
|
385
|
-
})
|
|
386
|
-
}, null, 8, ["title", "actions"]),
|
|
387
|
-
f("div", ve, [
|
|
388
|
-
t(F) && t(F).length > 0 ? (b(), M(Y, { key: 0 }, [
|
|
389
|
-
f("div", ge, [
|
|
390
|
-
o[6] || (o[6] = f("div", { class: "flex gap-8" }, null, -1)),
|
|
391
|
-
d(m, {
|
|
392
|
-
modelValue: t(u).searchKey,
|
|
393
|
-
"onUpdate:modelValue": o[2] || (o[2] = (c) => t(u).searchKey = c),
|
|
394
|
-
class: "",
|
|
395
|
-
placeholder: "search",
|
|
396
|
-
collapsible: ""
|
|
397
|
-
}, null, 8, ["modelValue"])
|
|
398
|
-
]),
|
|
399
|
-
d(g, {
|
|
400
|
-
"row-data": t(F),
|
|
401
|
-
"column-defs": S,
|
|
402
|
-
"search-value": t(u).searchKey,
|
|
403
|
-
"column-filter": t(u).columnFilters,
|
|
404
|
-
onRowClick: o[3] || (o[3] = (c) => V(c.original)),
|
|
405
|
-
"hide-footer": t(F).length < 10
|
|
406
|
-
}, null, 8, ["row-data", "search-value", "column-filter", "hide-footer"])
|
|
407
|
-
], 64)) : (b(), h(E, {
|
|
408
|
-
key: 1,
|
|
409
|
-
variant: "outlined",
|
|
410
|
-
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
411
|
-
}, {
|
|
412
|
-
default: A(() => [
|
|
413
|
-
o[7] || (o[7] = f("img", {
|
|
414
|
-
src: z,
|
|
415
|
-
class: "aspect-square w-[150px]"
|
|
416
|
-
}, null, -1)),
|
|
417
|
-
f("div", be, [
|
|
418
|
-
f("div", Re, B(t(n)("connect.storeRewards.empty.title")), 1),
|
|
419
|
-
f("div", Ce, B(t(n)("connect.storeRewards.empty.description")), 1)
|
|
420
|
-
]),
|
|
421
|
-
d(r, {
|
|
422
|
-
variant: "primary",
|
|
423
|
-
label: t(n)("connect.storeRewards.empty.action"),
|
|
424
|
-
onClick: o[4] || (o[4] = (c) => V()),
|
|
425
|
-
icon: "add"
|
|
426
|
-
}, null, 8, ["label"])
|
|
427
|
-
]),
|
|
428
|
-
_: 1
|
|
429
|
-
})),
|
|
430
|
-
d(we, {
|
|
431
|
-
ref_key: "rewardSheetRef",
|
|
432
|
-
ref: T,
|
|
433
|
-
onUpdate: o[5] || (o[5] = (c) => l(c))
|
|
434
|
-
}, null, 512)
|
|
435
|
-
])
|
|
436
|
-
], 64);
|
|
437
|
-
};
|
|
438
|
-
}
|
|
439
|
-
});
|
|
440
|
-
export {
|
|
441
|
-
Ke as default
|
|
442
|
-
};
|
|
@@ -1,150 +0,0 @@
|
|
|
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-OXARGiqO.js";
|
|
3
|
-
import { J as P } from "./JsonViewer-v8_C7l5N.js";
|
|
4
|
-
import { _ as D } from "./ZodTextField.vue_vue_type_script_setup_true_lang-B5J6Hd8G.js";
|
|
5
|
-
import { _ as I } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-DknFkIJh.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-BLSAz0gK.js";
|
|
10
|
-
import "./index-D4kdSzs9.js";
|
|
11
|
-
import "./index-LKr2k8J2.js";
|
|
12
|
-
import { c as E } from "./index-XAxwm-1v.js";
|
|
13
|
-
import "./index-CSBRkhKy.js";
|
|
14
|
-
import "./index-Cf_fcvoS.js";
|
|
15
|
-
import "./index-DcJq7tl4.js";
|
|
16
|
-
import { u as J } from "./vue-i18n-D1nTd69a.js";
|
|
17
|
-
import { c as C } from "./object-qECH92oz.js";
|
|
18
|
-
import { useDialog as Z } from "@feedmepos/ui-library";
|
|
19
|
-
const A = N("mf-connect-referral", () => {
|
|
20
|
-
const h = p();
|
|
21
|
-
return {
|
|
22
|
-
readReferralProgram: async () => {
|
|
23
|
-
const c = await k.read();
|
|
24
|
-
h.value = c;
|
|
25
|
-
},
|
|
26
|
-
referralProgram: h
|
|
27
|
-
};
|
|
28
|
-
}), 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({
|
|
29
|
-
__name: "EditReferralTierSheet",
|
|
30
|
-
emits: ["update"],
|
|
31
|
-
setup(h, { expose: _, emit: c }) {
|
|
32
|
-
const { t: n } = J(), m = c, s = p(!1), a = p({}), i = p(-1), w = A(), o = E.superRefine((r, t) => {
|
|
33
|
-
r.name.length >= 50 && t.addIssue({
|
|
34
|
-
code: "custom",
|
|
35
|
-
message: "Name must be less than 50 characters"
|
|
36
|
-
});
|
|
37
|
-
}), l = x(() => {
|
|
38
|
-
const r = o.safeParse(a.value);
|
|
39
|
-
return r.success ? [] : r.error.errors;
|
|
40
|
-
});
|
|
41
|
-
function R() {
|
|
42
|
-
const r = o.safeParse(a.value);
|
|
43
|
-
r.success && m("update", i.value, r.data);
|
|
44
|
-
}
|
|
45
|
-
function d(r, t) {
|
|
46
|
-
var f;
|
|
47
|
-
s.value = r, r && typeof t == "number" && t >= 0 ? (i.value = t, a.value = C(
|
|
48
|
-
(f = w.referralProgram) == null ? void 0 : f.reward[t]
|
|
49
|
-
)) : (i.value = -1, a.value = {
|
|
50
|
-
id: (/* @__PURE__ */ new Date()).toISOString(),
|
|
51
|
-
name: "",
|
|
52
|
-
rewards: [],
|
|
53
|
-
rule: void 0
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
function g(r) {
|
|
57
|
-
a.value.rule = r;
|
|
58
|
-
}
|
|
59
|
-
return _({
|
|
60
|
-
showSheet: d,
|
|
61
|
-
data: a
|
|
62
|
-
}), (r, t) => {
|
|
63
|
-
const f = y("FmButton"), F = y("FmSideSheet");
|
|
64
|
-
return U(), G(F, {
|
|
65
|
-
"max-width": 1e3,
|
|
66
|
-
modelValue: e(s),
|
|
67
|
-
"onUpdate:modelValue": t[2] || (t[2] = (S) => $(s) ? s.value = S : null),
|
|
68
|
-
header: `${e(i) == -1 ? e(n)("connect.referral.editReferralTierSheet.create") : e(n)("connect.referral.editReferralTierSheet.edit")}`
|
|
69
|
-
}, {
|
|
70
|
-
"side-sheet-footer": b(() => [
|
|
71
|
-
v("div", O, [
|
|
72
|
-
u(f, {
|
|
73
|
-
label: e(n)("connect.editTierSheet.submit"),
|
|
74
|
-
onClick: R,
|
|
75
|
-
disabled: e(l).length > 0 || e(V)().isLoading,
|
|
76
|
-
loading: e(V)().isLoading
|
|
77
|
-
}, null, 8, ["label", "disabled", "loading"]),
|
|
78
|
-
u(f, {
|
|
79
|
-
label: e(n)("connect.editTierSheet.cancel"),
|
|
80
|
-
onClick: t[1] || (t[1] = (S) => d(!1)),
|
|
81
|
-
variant: "tertiary"
|
|
82
|
-
}, null, 8, ["label"])
|
|
83
|
-
])
|
|
84
|
-
]),
|
|
85
|
-
default: b(() => [
|
|
86
|
-
u(P, { json: e(a) }, null, 8, ["json"]),
|
|
87
|
-
u(P, { json: e(l) }, null, 8, ["json"]),
|
|
88
|
-
v("div", H, [
|
|
89
|
-
u(D, {
|
|
90
|
-
modelValue: e(a).name,
|
|
91
|
-
"onUpdate:modelValue": t[0] || (t[0] = (S) => e(a).name = S),
|
|
92
|
-
label: e(n)("connect.referral.editReferralTierSheet.name"),
|
|
93
|
-
schema: e(L).typeAtPath(e(o), "name")
|
|
94
|
-
}, null, 8, ["modelValue", "label", "schema"]),
|
|
95
|
-
v("div", M, j(e(n)("connect.referral.editReferralTierSheet.target_audience")), 1),
|
|
96
|
-
u(I, {
|
|
97
|
-
"model-value": e(a).rule,
|
|
98
|
-
"onUpdate:modelValue": g
|
|
99
|
-
}, null, 8, ["model-value"])
|
|
100
|
-
])
|
|
101
|
-
]),
|
|
102
|
-
_: 1
|
|
103
|
-
}, 8, ["modelValue", "header"]);
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
}), de = /* @__PURE__ */ T({
|
|
107
|
-
__name: "RewardGroup",
|
|
108
|
-
setup(h, { expose: _ }) {
|
|
109
|
-
const { minor: c } = B, n = Z(), m = A(), s = x(() => {
|
|
110
|
-
var o;
|
|
111
|
-
return ((o = m.referralProgram) == null ? void 0 : o.reward) ?? [];
|
|
112
|
-
}), a = p(null);
|
|
113
|
-
function i(o) {
|
|
114
|
-
var l;
|
|
115
|
-
(l = a.value) == null || l.showSheet(!0, o);
|
|
116
|
-
}
|
|
117
|
-
_({
|
|
118
|
-
onManageRewardGroup: i
|
|
119
|
-
});
|
|
120
|
-
async function w(o, l) {
|
|
121
|
-
var r;
|
|
122
|
-
const R = o == -1 ? s.value.length : o, d = C(m.referralProgram);
|
|
123
|
-
d.reward[R] = l;
|
|
124
|
-
let g = !1;
|
|
125
|
-
await new Promise((t) => {
|
|
126
|
-
n.open({
|
|
127
|
-
title: "Confirmation",
|
|
128
|
-
message: "This will change all referral settings? Would you like to update previous referral record?",
|
|
129
|
-
primaryActions: { text: "Update all", close: !0 },
|
|
130
|
-
secondaryActions: { text: "Update future only", close: !0 }
|
|
131
|
-
}).onPrimary(async () => {
|
|
132
|
-
g = !0, t();
|
|
133
|
-
}).onSecondary(async () => {
|
|
134
|
-
t();
|
|
135
|
-
});
|
|
136
|
-
}), await c(async () => {
|
|
137
|
-
await k.update({ ...d, updateReferralRecord: g }), await m.readReferralProgram();
|
|
138
|
-
}), (r = a.value) == null || r.showSheet(!1);
|
|
139
|
-
}
|
|
140
|
-
return (o, l) => (U(), G(W, {
|
|
141
|
-
ref_key: "editReferralTierSheetRef",
|
|
142
|
-
ref: a,
|
|
143
|
-
onUpdate: w
|
|
144
|
-
}, null, 512));
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
export {
|
|
148
|
-
de as _,
|
|
149
|
-
A as u
|
|
150
|
-
};
|