@feedmepos/mf-connect 0.1.38-beta.47 → 0.1.38-beta.49
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-CAogVBbz.js → Analytic-BQGW_-c3.js} +13 -13
- package/dist/{App-Hk9Qp_9n.js → App-BYOr_3in.js} +7 -7
- package/dist/{AuditLogs-DXAviajL.js → AuditLogs-B_T5_CiH.js} +9 -9
- package/dist/{Bin-BUME6A-K.js → Bin-C1xrtDE0.js} +8 -8
- package/dist/{Broadcast-6j-bVq_R.js → Broadcast-GxpCUcrZ.js} +8 -8
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BK-bxPIJ.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DUnMhv4S.js} +7 -6
- package/dist/{Card-CEzRiRr7.js → Card-0oDoiIRu.js} +18 -18
- package/dist/{Collections-H0bZgYS3.js → Collections-rYjZyG69.js} +6 -6
- package/dist/{Credit-B0_OxcWl.js → Credit-DsH1Bc3y.js} +8 -8
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BfltVeTD.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-B7eMDETW.js} +202 -193
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-d-ru4lAo.js → EffectSheet.vue_vue_type_style_index_0_lang--iiw8XH6.js} +7 -7
- package/dist/{Experience-zLqm7xJ6.js → Experience-DlX6PfWR.js} +8 -8
- package/dist/{Game-D2KPc_Vp.js → Game-D0QqnZ2e.js} +9 -9
- package/dist/{Grab-HG6F8i9C.js → Grab-6F-Z0_F6.js} +8 -8
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-k42dFcVK.js → ImageInput.vue_vue_type_script_setup_true_lang-DZHaJART.js} +1 -1
- package/dist/{Index-C84kG2wA.js → Index-xZ25tvPZ.js} +10 -10
- package/dist/{Marketing-gh_hPaiO.js → Marketing-Chdt0nui.js} +7 -7
- package/dist/{Member-BUUz_hjg.js → Member-CNE_CmUr.js} +13 -12
- package/dist/{MemberList-B9XfhGt9.js → MemberList-DyIkeWwP.js} +25 -25
- package/dist/{MemberTransactions-BsJA7NcV.js → MemberTransactions-SYjVSwvU.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-dn_IeeR9.js → MessageInput.vue_vue_type_script_setup_true_lang-CCkSlsWQ.js} +8 -8
- package/dist/{Mission-Bd0d_AYG.js → Mission-CgWBJtr6.js} +9 -9
- package/dist/{Overview-CGQjA3Ot.js → Overview-BtsOQR97.js} +19 -19
- package/dist/{Point-DEQ4ymAU.js → Point-BJoB6lGN.js} +8 -8
- package/dist/{Promotion-DhTdXoqt.js → Promotion-Bspz7mj9.js} +9 -9
- package/dist/{Queue-Dh-Hhbzq.js → Queue-DFPvtMwZ.js} +10 -10
- package/dist/{Record-Bw0nY_98.js → Record-DmJXlqg1.js} +8 -8
- package/dist/{Reward-BWZ_GAVV.js → Reward-CS2dRJRI.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DLNocZF6.js → RewardGroup.vue_vue_type_script_setup_true_lang-IlNqykKZ.js} +12 -12
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-sLOHH7BQ.js → RuleGroup.vue_vue_type_script_setup_true_lang-BDFJqGHC.js} +15 -15
- package/dist/{Segment-DfUL3j0L.js → Segment-C0u4NNJx.js} +29 -29
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-ywplihQC.js → SelectItems.vue_vue_type_script_setup_true_lang-C4i9ZzGe.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DlJTZbF_.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-AP5kVvEF.js} +31 -30
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CjULlVQ6.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BKZKWxKi.js} +3 -3
- package/dist/{Setting-D5Mdmyv8.js → Setting-BefPl5s7.js} +632 -578
- package/dist/{SettingAdvertisements-CpMp76lW.js → SettingAdvertisements-DGNSNlfS.js} +12 -12
- package/dist/{Store-CmGB2qRm.js → Store-Ci8NoL5C.js} +613 -608
- package/dist/StoreRewards-DYmb7TZc.js +535 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-De2JVQBj.js → StoreTransactions.vue_vue_type_script_setup_true_lang-C2oHSA6v.js} +20 -20
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BAPYQVVs.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DgQwfKcF.js} +1 -1
- package/dist/{Tier-D7E3Cf43.js → Tier-4boFdwfx.js} +23 -23
- package/dist/{Title-DtKyCzFy.js → Title-Cgh40Avw.js} +23 -22
- package/dist/{Transaction-CEJO4C9e.js → Transaction-Z2U5elSk.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CW7FvVxQ.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-B5-J1FET.js} +6 -6
- package/dist/{Voucher-mWrvHP6m.js → Voucher-W8Oxnzpv.js} +12 -12
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-2_sr6jYm.js → VoucherEditor.vue_vue_type_script_setup_true_lang-CHYLFObC.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Cx5QxJYR.js → ZodTextField.vue_vue_type_script_setup_true_lang-B61Mje_C.js} +2 -2
- package/dist/{app-G_Bgzof6.js → app-BU48DR8E.js} +33 -33
- package/dist/{app-DwnfpsMe.js → app-CrFBlZQC.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/{business-Bm1ILQsj.js → business-BXXPV_BJ.js} +1 -1
- package/dist/{campaign-Dcqk3cH6.js → campaign-CFNs4abH.js} +8 -8
- package/dist/{campaign-BegYGV2g.js → campaign-Dan0mmow.js} +1 -1
- package/dist/{campaign.enum-Di8zWEBT.js → campaign.enum-C2FJOSn5.js} +1 -1
- package/dist/{campaign.fn-R-qkQwCc.js → campaign.fn-_QD-klUZ.js} +111 -111
- package/dist/{collectible.enum-CcMxBWQm.js → collectible.enum-ef49SjA4.js} +1 -1
- package/dist/{collection.fn-DB1UThBX.js → collection.fn-BLlJd7Mr.js} +2 -2
- package/dist/{dto-Dw2vmeAy.js → dto-BJeHlJPS.js} +4 -4
- package/dist/{effect-CMNhsAGz.js → effect-D5J5xLJX.js} +1 -1
- package/dist/{email-addresses-DAyJYGyu.js → email-addresses-CgCtARgI.js} +1 -1
- package/dist/{export-DlRLDRaa.js → export-Zzk4jiBl.js} +3 -3
- package/dist/{helper-BmJHGK8Y.js → helper-BLELjodn.js} +22 -7
- package/dist/{index-rz-9vvSo.js → index-7_8Sujrx.js} +3 -3
- package/dist/{index-C_ngmqTP.js → index-BGHhNcXH.js} +1 -1
- package/dist/{index-CyvlmNYw.js → index-BS1mIYfK.js} +1 -1
- package/dist/{index-BecLQlNQ.js → index-BqvUAoPO.js} +1 -1
- package/dist/{index-D_Kckj4e.js → index-C-YRCQZ4.js} +1 -1
- package/dist/{index-DAF5ATGM.js → index-CJHTigmz.js} +2195 -2002
- package/dist/{index-Ct9g1o30.js → index-CvmXvyLj.js} +1 -1
- package/dist/{index-DeWjB6gf.js → index-DITIOfs4.js} +1 -1
- package/dist/{index-BHvDESXI.js → index-DZanCQd8.js} +3 -3
- package/dist/{index-B3lpCXw9.js → index-DemX8i2v.js} +6 -6
- package/dist/{index-xdFaZ2Wu.js → index-Dgnwhbhv.js} +362 -346
- package/dist/{index-DDHF6lur.js → index-OZj06Ttw.js} +558 -555
- package/dist/{index-TQl8R7QE.js → index-_uDo6MR6.js} +1 -1
- package/dist/{index.esm2017-C-eM4VXU.js → index.esm2017-CT9d1NRD.js} +1 -1
- package/dist/{loading-CF1kz4k0.js → loading-up7stUln.js} +1 -1
- package/dist/{membership-CSRsOqrJ.js → membership-BbEmnTSf.js} +3 -3
- package/dist/{money-CSCfOeMr.js → money-DVfpKSC6.js} +1 -1
- package/dist/{number-CWEGy5pi.js → number-BAwtHKVN.js} +1 -1
- package/dist/{objectid-B-dM6CuY.js → objectid-D72PsUrT.js} +4 -4
- package/dist/{plugins-BWvse3U_.js → plugins-C7_WZRNH.js} +3 -3
- package/dist/{reward-BxbKJnBb.js → reward-XSRjQepF.js} +1 -1
- package/dist/{rule-DsCiQRPf.js → rule-CRsnYcDX.js} +3 -3
- package/dist/{rule-builder-DEDIT9kB.js → rule-builder-BO6eO4WG.js} +1 -1
- package/dist/{template-DAmBa5-r.js → template-Dml8mXUA.js} +5 -5
- package/dist/{timezone-BbWwPB6u.js → timezone-CBvYuUvv.js} +1 -1
- package/dist/{trigger-DPxfKox3.js → trigger-CNN8uWUi.js} +5 -5
- package/dist/user-DYhRGvv5.js +55 -0
- package/dist/{vue-i18n-0m1EPiB2.js → vue-i18n-Bq3nuxaj.js} +2 -2
- package/dist/{xlsx-Dwl2GpmQ.js → xlsx-DNBXAk5t.js} +1 -1
- package/dist/{zod-DDxCAQkH.js → zod-BSmgtLPD.js} +1 -1
- package/package.json +1 -1
- package/dist/StoreRewards-CBy-Behd.js +0 -423
- package/dist/user-DLQWP5gQ.js +0 -54
|
@@ -0,0 +1,535 @@
|
|
|
1
|
+
import { defineComponent as W, ref as V, computed as G, onMounted as Y, resolveComponent as b, openBlock as w, createBlock as C, unref as e, isRef as Q, withCtx as F, createElementVNode as s, createVNode as u, createElementBlock as P, createTextVNode as X, resolveDynamicComponent as M, toDisplayString as B, Fragment as q, createCommentVNode as $, h as v } from "vue";
|
|
2
|
+
import { _ as ee } from "./campaign-CpzFl8Vr.js";
|
|
3
|
+
import { useDialog as z, components as O } from "@feedmepos/ui-library";
|
|
4
|
+
import "./index-_uDo6MR6.js";
|
|
5
|
+
import { u as te } from "./loading-up7stUln.js";
|
|
6
|
+
import { C as J, u as oe } from "./membership-BbEmnTSf.js";
|
|
7
|
+
import { p as I, f as N } from "./plugins-C7_WZRNH.js";
|
|
8
|
+
import { u as ae } from "./vue-i18n-Bq3nuxaj.js";
|
|
9
|
+
import { F as ne } from "./index-OZj06Ttw.js";
|
|
10
|
+
import { c as se } from "./object-qECH92oz.js";
|
|
11
|
+
import { u as Z } from "./app-wDQR6dpb.js";
|
|
12
|
+
import { u as re } from "./business-BXXPV_BJ.js";
|
|
13
|
+
import { useCoreStore as ie } from "@feedmepos/mf-common";
|
|
14
|
+
import { Z as x } from "./zod-BSmgtLPD.js";
|
|
15
|
+
import { _ as le } from "./ZodTextField.vue_vue_type_script_setup_true_lang-B61Mje_C.js";
|
|
16
|
+
import { _ as de } from "./ImageInput.vue_vue_type_script_setup_true_lang-DZHaJART.js";
|
|
17
|
+
import { _ as ce } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-DgQwfKcF.js";
|
|
18
|
+
import { _ as me, a as pe } from "./EffectSheet.vue_vue_type_style_index_0_lang--iiw8XH6.js";
|
|
19
|
+
import { i as ue, F as fe, h as K, t as ye } from "./helper-BLELjodn.js";
|
|
20
|
+
import { useRouter as we } from "vue-router";
|
|
21
|
+
import { m as j } from "./index-BGHhNcXH.js";
|
|
22
|
+
import { R as A } from "./app-BU48DR8E.js";
|
|
23
|
+
const ge = {
|
|
24
|
+
key: 0,
|
|
25
|
+
class: "flex flex-col space-y-16 pr-12"
|
|
26
|
+
}, ve = { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, be = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center justify-between" }, Re = { class: "flex items-center gap-8" }, _e = /* @__PURE__ */ W({
|
|
27
|
+
__name: "EditRewardSheet",
|
|
28
|
+
emits: ["update"],
|
|
29
|
+
setup(L, { expose: r, emit: E }) {
|
|
30
|
+
const S = E, y = re(), m = ie(), g = V(!1), a = V(), R = V(), T = V(!1), f = ne, p = G(
|
|
31
|
+
() => {
|
|
32
|
+
var l;
|
|
33
|
+
return J[((l = a.value) == null ? void 0 : l.type) || "VOUCHER"];
|
|
34
|
+
}
|
|
35
|
+
), D = G(() => {
|
|
36
|
+
const l = f.safeParse(a.value);
|
|
37
|
+
return l.success ? [] : l.error.errors;
|
|
38
|
+
});
|
|
39
|
+
function H() {
|
|
40
|
+
const l = f.safeParse(a.value);
|
|
41
|
+
if (l.success) {
|
|
42
|
+
const n = { ...l.data };
|
|
43
|
+
T.value && (n.capabilities = fe), S("update", n);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function k(l, n, t = {
|
|
47
|
+
isStoreReward: !1,
|
|
48
|
+
type: "VOUCHER"
|
|
49
|
+
}) {
|
|
50
|
+
g.value = l, l && (R.value = void 0, T.value = t.isFeedvibe ?? !1, a.value = n || ue(t.type, {
|
|
51
|
+
business: m.currentBusiness.value._id,
|
|
52
|
+
noCampaign: t.isStoreReward == !0
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
return Y(async () => {
|
|
56
|
+
await y.readLocations();
|
|
57
|
+
}), r({
|
|
58
|
+
showSheet: k,
|
|
59
|
+
data: a,
|
|
60
|
+
rewardImage: R
|
|
61
|
+
}), (l, n) => {
|
|
62
|
+
const t = b("FmTextarea"), o = b("FmHelperText"), c = b("FmButton"), _ = b("FmSideSheet");
|
|
63
|
+
return w(), C(_, {
|
|
64
|
+
"max-width": 560,
|
|
65
|
+
modelValue: e(g),
|
|
66
|
+
"onUpdate:modelValue": n[7] || (n[7] = (d) => Q(g) ? g.value = d : null),
|
|
67
|
+
header: "Store setting"
|
|
68
|
+
}, {
|
|
69
|
+
"side-sheet-footer": F(() => [
|
|
70
|
+
s("div", Re, [
|
|
71
|
+
u(c, {
|
|
72
|
+
label: "Submit",
|
|
73
|
+
onClick: H,
|
|
74
|
+
disabled: e(D).length > 0 || e(Z)().isLoading,
|
|
75
|
+
loading: e(Z)().isLoading
|
|
76
|
+
}, null, 8, ["disabled", "loading"]),
|
|
77
|
+
u(c, {
|
|
78
|
+
label: "Cancel",
|
|
79
|
+
onClick: n[6] || (n[6] = (d) => k(!1)),
|
|
80
|
+
variant: "tertiary"
|
|
81
|
+
})
|
|
82
|
+
])
|
|
83
|
+
]),
|
|
84
|
+
default: F(() => {
|
|
85
|
+
var d, h, U;
|
|
86
|
+
return [
|
|
87
|
+
e(a) ? (w(), P("div", ge, [
|
|
88
|
+
s("div", ve, [
|
|
89
|
+
n[8] || (n[8] = X(" Reward information ", -1)),
|
|
90
|
+
(w(), C(M(e(p).chip())))
|
|
91
|
+
]),
|
|
92
|
+
u(le, {
|
|
93
|
+
modelValue: e(a).name,
|
|
94
|
+
"onUpdate:modelValue": n[0] || (n[0] = (i) => e(a).name = i),
|
|
95
|
+
label: `${e(p).name} name`,
|
|
96
|
+
schema: e(x).typeAtPath(e(f), "name", [e(a).type])
|
|
97
|
+
}, null, 8, ["modelValue", "label", "schema"]),
|
|
98
|
+
u(t, {
|
|
99
|
+
class: "!mb-[-16px]",
|
|
100
|
+
modelValue: e(a).description,
|
|
101
|
+
"onUpdate:modelValue": n[1] || (n[1] = (i) => e(a).description = i),
|
|
102
|
+
rules: [e(x).ruleAtPath(e(f), "description", [e(a).type])]
|
|
103
|
+
}, {
|
|
104
|
+
label: F(() => [
|
|
105
|
+
(w(), C(M(
|
|
106
|
+
e(x).toInputLabel(
|
|
107
|
+
e(x).typeAtPath(e(f), "description", [e(a).type]),
|
|
108
|
+
`${e(p).name} description`
|
|
109
|
+
)
|
|
110
|
+
)))
|
|
111
|
+
]),
|
|
112
|
+
_: 1
|
|
113
|
+
}, 8, ["modelValue", "rules"]),
|
|
114
|
+
s("div", be, [
|
|
115
|
+
s("div", null, B(e(p).name) + " description should not exceed 200 characters. ", 1),
|
|
116
|
+
s("div", null, B(((d = e(a).description) == null ? void 0 : d.length) ?? 0) + "/200", 1)
|
|
117
|
+
]),
|
|
118
|
+
u(de, {
|
|
119
|
+
class: "w-1/2 xs:w-2/3",
|
|
120
|
+
"aspect-ratio": "16/9",
|
|
121
|
+
file: e(R) ?? void 0,
|
|
122
|
+
thumbnail: e(a).image ?? void 0,
|
|
123
|
+
"onUpdate:file": n[2] || (n[2] = async (i) => {
|
|
124
|
+
R.value = i, i || (e(a).image = null);
|
|
125
|
+
})
|
|
126
|
+
}, {
|
|
127
|
+
label: F(() => [
|
|
128
|
+
(w(), C(M(
|
|
129
|
+
e(x).toInputLabel(
|
|
130
|
+
e(x).typeAtPath(e(f), "image", [e(a).type]),
|
|
131
|
+
`${e(p).name} image`
|
|
132
|
+
)
|
|
133
|
+
)))
|
|
134
|
+
]),
|
|
135
|
+
_: 1
|
|
136
|
+
}, 8, ["file", "thumbnail"]),
|
|
137
|
+
e(a).type === "VOUCHER" ? (w(), P(q, { key: 0 }, [
|
|
138
|
+
n[9] || (n[9] = s("div", { class: "fm-typo-en-title-sm-800" }, "Discount", -1)),
|
|
139
|
+
u(me, {
|
|
140
|
+
"model-value": e(a).extras.effect,
|
|
141
|
+
"onUpdate:modelValue": n[3] || (n[3] = (i) => {
|
|
142
|
+
e(a).extras.effect = i;
|
|
143
|
+
})
|
|
144
|
+
}, null, 8, ["model-value"]),
|
|
145
|
+
e(a).extras.effect == null ? (w(), C(o, {
|
|
146
|
+
key: 0,
|
|
147
|
+
class: "!mt-8",
|
|
148
|
+
text: "Effect is required",
|
|
149
|
+
state: "error"
|
|
150
|
+
})) : $("", !0),
|
|
151
|
+
n[10] || (n[10] = s("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, " Usage configuration ", -1)),
|
|
152
|
+
u(pe, {
|
|
153
|
+
"model-value": e(a).options,
|
|
154
|
+
"no-campaign": e(a).noCampaign,
|
|
155
|
+
"onUpdate:modelValue": n[4] || (n[4] = (i) => e(a).options = i),
|
|
156
|
+
schema: e(x).typeAtPath(e(f), "options", ["VOUCHER"])
|
|
157
|
+
}, null, 8, ["model-value", "no-campaign", "schema"])
|
|
158
|
+
], 64)) : $("", !0),
|
|
159
|
+
n[11] || (n[11] = s("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Availability", -1)),
|
|
160
|
+
e(a).type === "VOUCHER" ? (w(), C(ce, {
|
|
161
|
+
key: 1,
|
|
162
|
+
"model-value": ((U = (h = e(a).extras) == null ? void 0 : h.targetLocation) == null ? void 0 : U.map(String)) ?? null,
|
|
163
|
+
type: "select",
|
|
164
|
+
"onUpdate:modelValue": n[5] || (n[5] = (i) => {
|
|
165
|
+
e(a).extras.targetLocation = i;
|
|
166
|
+
}),
|
|
167
|
+
rules: [
|
|
168
|
+
e(x).ruleAtPath(e(f), "extras.targetLocation", ["VOUCHER"])
|
|
169
|
+
]
|
|
170
|
+
}, null, 8, ["model-value", "rules"])) : $("", !0)
|
|
171
|
+
])) : $("", !0)
|
|
172
|
+
];
|
|
173
|
+
}),
|
|
174
|
+
_: 1
|
|
175
|
+
}, 8, ["modelValue"]);
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
}), xe = { class: "flex flex-nowrap gap-x-2 grow h-full" }, Ce = { class: "flex flex-col grow p-24" }, Fe = { class: "grow pb-16 pr-16 pt-6 w-full" }, he = { class: "gap-24 grid grid-cols-1 lg:grid-cols-2" }, Ee = /* @__PURE__ */ W({
|
|
179
|
+
__name: "RewardTypeDialog",
|
|
180
|
+
props: {
|
|
181
|
+
onOk: {
|
|
182
|
+
type: Function,
|
|
183
|
+
required: !0
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
setup(L) {
|
|
187
|
+
const r = z(), E = L;
|
|
188
|
+
function S(y) {
|
|
189
|
+
E.onOk(y), r.close();
|
|
190
|
+
}
|
|
191
|
+
return (y, m) => {
|
|
192
|
+
const g = b("FmCard");
|
|
193
|
+
return w(), C(g, { class: "max-w-6xl" }, {
|
|
194
|
+
default: F(() => [
|
|
195
|
+
s("div", xe, [
|
|
196
|
+
s("div", Ce, [
|
|
197
|
+
m[4] || (m[4] = s("div", { class: "space-y-4" }, [
|
|
198
|
+
s("div", { class: "fm-typo-en-title-sm-800" }, "Store rewards"),
|
|
199
|
+
s("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, " Select a reward type to get started. ")
|
|
200
|
+
], -1)),
|
|
201
|
+
s("div", Fe, [
|
|
202
|
+
s("div", he, [
|
|
203
|
+
u(g, {
|
|
204
|
+
variant: "outlined",
|
|
205
|
+
class: "box-border cursor-pointer h-full p-16 scroll-p-4 space-y-8",
|
|
206
|
+
onClick: m[0] || (m[0] = (a) => S("general"))
|
|
207
|
+
}, {
|
|
208
|
+
default: F(() => [...m[2] || (m[2] = [
|
|
209
|
+
s("div", { class: "fm-typo-en-title-sm-800" }, "General Reward", -1),
|
|
210
|
+
s("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " A standard voucher reward that can be freely edited and managed. ", -1)
|
|
211
|
+
])]),
|
|
212
|
+
_: 1
|
|
213
|
+
}),
|
|
214
|
+
u(g, {
|
|
215
|
+
variant: "outlined",
|
|
216
|
+
class: "box-border cursor-pointer h-full p-16 scroll-p-4 space-y-8",
|
|
217
|
+
onClick: m[1] || (m[1] = (a) => S("feedvibe"))
|
|
218
|
+
}, {
|
|
219
|
+
default: F(() => [...m[3] || (m[3] = [
|
|
220
|
+
s("div", { class: "fm-typo-en-title-sm-800" }, "FeedVibe Reward", -1),
|
|
221
|
+
s("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " A locked reward for FeedVibe bundles. Cannot be edited or deleted after creation. ", -1)
|
|
222
|
+
])]),
|
|
223
|
+
_: 1
|
|
224
|
+
})
|
|
225
|
+
])
|
|
226
|
+
])
|
|
227
|
+
])
|
|
228
|
+
])
|
|
229
|
+
]),
|
|
230
|
+
_: 1
|
|
231
|
+
});
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
}), Se = { class: "px-24 flex flex-col gap-y-16" }, Ve = { class: "flex items-center justify-between w-full" }, Oe = { class: "flex flex-col gap-16 text-center" }, Te = { class: "fm-typo-en-title-sm-800" }, ke = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, et = /* @__PURE__ */ W({
|
|
235
|
+
__name: "StoreRewards",
|
|
236
|
+
setup(L) {
|
|
237
|
+
const { t: r } = ae(), E = z(), S = {
|
|
238
|
+
label: r("connect.storeRewards.create"),
|
|
239
|
+
value: "create",
|
|
240
|
+
isPrimary: !0,
|
|
241
|
+
prependIcon: "add"
|
|
242
|
+
}, y = oe(), { global: m, minor: g } = te, a = we(), R = V({
|
|
243
|
+
searchKey: "",
|
|
244
|
+
columnFilters: []
|
|
245
|
+
}), T = [
|
|
246
|
+
{
|
|
247
|
+
header: r("connect.storeRewards.table.name"),
|
|
248
|
+
accessorFn: (t) => t.name,
|
|
249
|
+
cell(t) {
|
|
250
|
+
const o = t.row.original, c = K(
|
|
251
|
+
o.capabilities,
|
|
252
|
+
"STORE_BUNDLE:FEEDVIBE",
|
|
253
|
+
"selectable",
|
|
254
|
+
!1
|
|
255
|
+
);
|
|
256
|
+
return v("div", { class: "flex items-center gap-8" }, [
|
|
257
|
+
v("span", {}, o.name),
|
|
258
|
+
...c ? [
|
|
259
|
+
v(O.FmChip, {
|
|
260
|
+
label: "Feedvibe",
|
|
261
|
+
class: "text-fm-color-primary bg-fm-color-system-warning-100",
|
|
262
|
+
compact: !0
|
|
263
|
+
})
|
|
264
|
+
] : []
|
|
265
|
+
]);
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
id: "type",
|
|
270
|
+
header: r("connect.storeRewards.table.type"),
|
|
271
|
+
accessorFn: (t) => t.type,
|
|
272
|
+
cell(t) {
|
|
273
|
+
return J[t.row.original.type].chip();
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
header: r("connect.storeRewards.table.validity"),
|
|
278
|
+
accessorFn: (t) => ye(
|
|
279
|
+
"validityOption" in t.options ? t.options.validityOption || {} : {}
|
|
280
|
+
)
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
header: r("connect.storeRewards.table.used"),
|
|
284
|
+
meta: {
|
|
285
|
+
textAlign: "left"
|
|
286
|
+
},
|
|
287
|
+
accessorFn: (t) => t.currentReceive ?? 0
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
header: r("connect.storeRewards.table.actions"),
|
|
291
|
+
cell(t) {
|
|
292
|
+
return v("div", { class: "flex items-center justify-end gap-4" }, [
|
|
293
|
+
v(
|
|
294
|
+
O.FmMenu,
|
|
295
|
+
{
|
|
296
|
+
placement: "bottom-end",
|
|
297
|
+
onClick: (o) => {
|
|
298
|
+
o.stopPropagation();
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"menu-button": () => v(O.FmButton, {
|
|
303
|
+
icon: "more_vert",
|
|
304
|
+
iconColor: "neutral-gray-400",
|
|
305
|
+
variant: "tertiary"
|
|
306
|
+
}),
|
|
307
|
+
default: () => [
|
|
308
|
+
v(O.FmMenuItem, {
|
|
309
|
+
label: "View collections",
|
|
310
|
+
onClick: async (o) => {
|
|
311
|
+
o.stopPropagation(), D(t.row.original._id);
|
|
312
|
+
}
|
|
313
|
+
}),
|
|
314
|
+
...K(
|
|
315
|
+
t.row.original.capabilities,
|
|
316
|
+
"STORE_BUNDLE:FEEDVIBE",
|
|
317
|
+
"deletable"
|
|
318
|
+
) ? [
|
|
319
|
+
v(
|
|
320
|
+
O.FmMenuItem,
|
|
321
|
+
{
|
|
322
|
+
onClick: async (o) => {
|
|
323
|
+
o.stopPropagation(), H(t.row.original);
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
label: v(
|
|
328
|
+
"div",
|
|
329
|
+
{
|
|
330
|
+
class: "text-fm-color-typo-error fm-typo-en-body-md-400"
|
|
331
|
+
},
|
|
332
|
+
"Remove"
|
|
333
|
+
)
|
|
334
|
+
}
|
|
335
|
+
)
|
|
336
|
+
] : []
|
|
337
|
+
]
|
|
338
|
+
}
|
|
339
|
+
)
|
|
340
|
+
]);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
], f = G(
|
|
344
|
+
() => y.bundleRewards.filter((t) => t.type == "VOUCHER")
|
|
345
|
+
), p = V();
|
|
346
|
+
function D(t) {
|
|
347
|
+
a.push({
|
|
348
|
+
name: A["$connect-STORE_REWARD_COLLECTIONS"],
|
|
349
|
+
params: { id: t }
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
async function H(t) {
|
|
353
|
+
if (t.type === "TITLE") {
|
|
354
|
+
await I.confirm(
|
|
355
|
+
r("connect.storeRewards.remove.message"),
|
|
356
|
+
r("connect.storeRewards.remove.title"),
|
|
357
|
+
r("connect.storeRewards.remove.action")
|
|
358
|
+
) && await a.push({ name: A["$connect-PROGRAM_TITLE"] });
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
await I.remove(
|
|
362
|
+
r("connect.storeRewards.delete.confirm"),
|
|
363
|
+
r("connect.storeRewards.delete.title")
|
|
364
|
+
) && await g(
|
|
365
|
+
async () => {
|
|
366
|
+
await j.deleteReward(t._id), await y.readMembership(), await y.readRewards();
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
message: r("connect.storeRewards.delete.message"),
|
|
370
|
+
successMessage: r("connect.storeRewards.delete.success")
|
|
371
|
+
}
|
|
372
|
+
);
|
|
373
|
+
}
|
|
374
|
+
function k() {
|
|
375
|
+
return new Promise((t) => {
|
|
376
|
+
E.open({
|
|
377
|
+
title: "Create reward",
|
|
378
|
+
dialogComponent: v(Ee, {
|
|
379
|
+
onOk: (o) => {
|
|
380
|
+
t(o);
|
|
381
|
+
}
|
|
382
|
+
})
|
|
383
|
+
}).onClose(() => {
|
|
384
|
+
t(null);
|
|
385
|
+
});
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
async function l(t) {
|
|
389
|
+
var c, _;
|
|
390
|
+
const o = t ? se(y.bundleRewards.find((d) => d._id === t)) : void 0;
|
|
391
|
+
if (o && !K(
|
|
392
|
+
o.capabilities,
|
|
393
|
+
"STORE_BUNDLE:FEEDVIBE",
|
|
394
|
+
"editable"
|
|
395
|
+
)) {
|
|
396
|
+
await I.confirm(
|
|
397
|
+
"This reward is managed by FeedVibe and cannot be edited.",
|
|
398
|
+
"Cannot edit reward",
|
|
399
|
+
"OK"
|
|
400
|
+
);
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
if ((o == null ? void 0 : o.type) === "TITLE") {
|
|
404
|
+
await I.confirm(
|
|
405
|
+
"You cannot edit a title here, please edit it at the Program > Title section.",
|
|
406
|
+
"Update reward",
|
|
407
|
+
"Go to title section"
|
|
408
|
+
) && await a.push({ name: A["$connect-PROGRAM_TITLE"] });
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
if (!o) {
|
|
412
|
+
const d = await k();
|
|
413
|
+
if (!d) return;
|
|
414
|
+
(c = p.value) == null || c.showSheet(!0, void 0, {
|
|
415
|
+
isStoreReward: !0,
|
|
416
|
+
type: "VOUCHER",
|
|
417
|
+
isFeedvibe: d === "feedvibe"
|
|
418
|
+
});
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
421
|
+
(_ = p.value) == null || _.showSheet(!0, o, {
|
|
422
|
+
isStoreReward: !0,
|
|
423
|
+
type: "VOUCHER"
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
async function n(t) {
|
|
427
|
+
let o = !1;
|
|
428
|
+
t._id && t.type === "VOUCHER" && await new Promise((c) => {
|
|
429
|
+
E.open({
|
|
430
|
+
title: "Confirmation",
|
|
431
|
+
message: r("connect.campaign.voucher.updateConfirm.message"),
|
|
432
|
+
primaryActions: {
|
|
433
|
+
text: r("connect.campaign.voucher.updateConfirm.updateAll"),
|
|
434
|
+
close: !0
|
|
435
|
+
},
|
|
436
|
+
secondaryActions: {
|
|
437
|
+
text: r("connect.campaign.voucher.updateConfirm.updateFuture"),
|
|
438
|
+
close: !0
|
|
439
|
+
}
|
|
440
|
+
}).onPrimary(async () => {
|
|
441
|
+
o = !0, c();
|
|
442
|
+
}).onSecondary(async () => {
|
|
443
|
+
c();
|
|
444
|
+
});
|
|
445
|
+
}), await g(
|
|
446
|
+
async () => {
|
|
447
|
+
var c, _, d, h;
|
|
448
|
+
(c = p.value) != null && c.rewardImage && t.image ? await N.delete(t.image) : (_ = p.value) != null && _.rewardImage && (t.image = await N.update(
|
|
449
|
+
t.image || N.collectibleImagePath(
|
|
450
|
+
void 0,
|
|
451
|
+
p.value.rewardImage
|
|
452
|
+
),
|
|
453
|
+
(d = p.value) == null ? void 0 : d.rewardImage
|
|
454
|
+
)), t._id ? await j.updateReward(t._id, {
|
|
455
|
+
...t,
|
|
456
|
+
updateCollection: o
|
|
457
|
+
}) : await j.createReward(t), await y.readRewards(), (h = p.value) == null || h.showSheet(!1);
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
message: "Updating reward",
|
|
461
|
+
successMessage: "Reward updated successfully"
|
|
462
|
+
}
|
|
463
|
+
);
|
|
464
|
+
}
|
|
465
|
+
return Y(async () => {
|
|
466
|
+
await m(async () => {
|
|
467
|
+
await y.readMembership(), await y.readRewards();
|
|
468
|
+
});
|
|
469
|
+
}), (t, o) => {
|
|
470
|
+
const c = b("FmPageHead"), _ = b("FmSearch"), d = b("FmTable"), h = b("FmButton"), U = b("FmCard");
|
|
471
|
+
return w(), P(q, null, [
|
|
472
|
+
u(c, {
|
|
473
|
+
title: e(r)("connect.storeRewards.title"),
|
|
474
|
+
description: e(r)("connect.storeRewards.description"),
|
|
475
|
+
actions: [S],
|
|
476
|
+
"back-button": !0,
|
|
477
|
+
"onClick:action": o[0] || (o[0] = () => l()),
|
|
478
|
+
"onClick:back": o[1] || (o[1] = () => e(a).push({ name: e(A)["$connect-STORE"] }))
|
|
479
|
+
}, null, 8, ["title", "description", "actions"]),
|
|
480
|
+
s("div", Se, [
|
|
481
|
+
e(f) && e(f).length > 0 ? (w(), P(q, { key: 0 }, [
|
|
482
|
+
s("div", Ve, [
|
|
483
|
+
o[6] || (o[6] = s("div", { class: "flex gap-8" }, null, -1)),
|
|
484
|
+
u(_, {
|
|
485
|
+
modelValue: e(R).searchKey,
|
|
486
|
+
"onUpdate:modelValue": o[2] || (o[2] = (i) => e(R).searchKey = i),
|
|
487
|
+
class: "",
|
|
488
|
+
placeholder: "search",
|
|
489
|
+
collapsible: ""
|
|
490
|
+
}, null, 8, ["modelValue"])
|
|
491
|
+
]),
|
|
492
|
+
u(d, {
|
|
493
|
+
"row-data": e(f),
|
|
494
|
+
"column-defs": T,
|
|
495
|
+
"search-value": e(R).searchKey,
|
|
496
|
+
"column-filter": e(R).columnFilters,
|
|
497
|
+
onRowClick: o[3] || (o[3] = (i) => l(i.original._id)),
|
|
498
|
+
"hide-footer": e(f).length < 10
|
|
499
|
+
}, null, 8, ["row-data", "search-value", "column-filter", "hide-footer"])
|
|
500
|
+
], 64)) : (w(), C(U, {
|
|
501
|
+
key: 1,
|
|
502
|
+
variant: "outlined",
|
|
503
|
+
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
504
|
+
}, {
|
|
505
|
+
default: F(() => [
|
|
506
|
+
o[7] || (o[7] = s("img", {
|
|
507
|
+
src: ee,
|
|
508
|
+
class: "aspect-square w-[150px]"
|
|
509
|
+
}, null, -1)),
|
|
510
|
+
s("div", Oe, [
|
|
511
|
+
s("div", Te, B(e(r)("connect.storeRewards.empty.title")), 1),
|
|
512
|
+
s("div", ke, B(e(r)("connect.storeRewards.empty.description")), 1)
|
|
513
|
+
]),
|
|
514
|
+
u(h, {
|
|
515
|
+
variant: "primary",
|
|
516
|
+
label: e(r)("connect.storeRewards.empty.action"),
|
|
517
|
+
onClick: o[4] || (o[4] = (i) => l()),
|
|
518
|
+
icon: "add"
|
|
519
|
+
}, null, 8, ["label"])
|
|
520
|
+
]),
|
|
521
|
+
_: 1
|
|
522
|
+
})),
|
|
523
|
+
u(_e, {
|
|
524
|
+
ref_key: "rewardSheetRef",
|
|
525
|
+
ref: p,
|
|
526
|
+
onUpdate: o[5] || (o[5] = (i) => n(i))
|
|
527
|
+
}, null, 512)
|
|
528
|
+
])
|
|
529
|
+
], 64);
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
});
|
|
533
|
+
export {
|
|
534
|
+
et as default
|
|
535
|
+
};
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { defineComponent as Q, ref as M, computed as K, h as r, resolveComponent as Y, openBlock as N, createBlock as ae, unref as l, isRef as he, withCtx as oe, createElementVNode as h, createVNode as R, createElementBlock as V, Fragment as W, renderList as ne, toDisplayString as z, createTextVNode as be, resolveDynamicComponent as ve, watch as re, onBeforeMount as _e, onMounted as xe } from "vue";
|
|
2
2
|
import { components as g, useDialog as Se } from "@feedmepos/ui-library";
|
|
3
|
-
import { r as X } from "./index-
|
|
4
|
-
import "./index-
|
|
5
|
-
import { s as we } from "./index-
|
|
3
|
+
import { r as X } from "./index-Dgnwhbhv.js";
|
|
4
|
+
import "./index-CJHTigmz.js";
|
|
5
|
+
import { s as we } from "./index-BS1mIYfK.js";
|
|
6
6
|
import { h as x } from "./moment-D7p2TMB-.js";
|
|
7
7
|
import { _ as j } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
|
|
8
8
|
import { _ as se } from "./DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js";
|
|
9
9
|
import { s as G } from "./index-CsaQJMAR.js";
|
|
10
|
-
import { f as J } from "./number-
|
|
11
|
-
import { u as le } from "./business-
|
|
10
|
+
import { f as J } from "./number-BAwtHKVN.js";
|
|
11
|
+
import { u as le } from "./business-BXXPV_BJ.js";
|
|
12
12
|
import { u as ie, _ as ce } from "./usePagination-Ds-cuHop.js";
|
|
13
|
-
import { a as Z, c as Te, p as Re } from "./plugins-
|
|
14
|
-
import { g as ue } from "./user-
|
|
15
|
-
import { B as me, e as de } from "./export-
|
|
16
|
-
import { u as pe } from "./campaign-
|
|
17
|
-
import "./index-
|
|
18
|
-
import "./index-
|
|
19
|
-
import "./index-
|
|
20
|
-
import "./index-
|
|
21
|
-
import "./index-
|
|
22
|
-
import { u as fe } from "./vue-i18n-
|
|
13
|
+
import { a as Z, c as Te, p as Re } from "./plugins-C7_WZRNH.js";
|
|
14
|
+
import { g as ue } from "./user-DYhRGvv5.js";
|
|
15
|
+
import { B as me, e as de } from "./export-Zzk4jiBl.js";
|
|
16
|
+
import { u as pe } from "./campaign-Dan0mmow.js";
|
|
17
|
+
import "./index-_uDo6MR6.js";
|
|
18
|
+
import "./index-DemX8i2v.js";
|
|
19
|
+
import "./index-OZj06Ttw.js";
|
|
20
|
+
import "./index-CvmXvyLj.js";
|
|
21
|
+
import "./index-7_8Sujrx.js";
|
|
22
|
+
import { u as fe } from "./vue-i18n-Bq3nuxaj.js";
|
|
23
23
|
import { o as U } from "./objectId-dwaoBfJX.js";
|
|
24
|
-
import { u as ge } from "./loading-
|
|
24
|
+
import { u as ge } from "./loading-up7stUln.js";
|
|
25
25
|
import { useRouter as Ce } from "vue-router";
|
|
26
|
-
import { t as L } from "./index-
|
|
27
|
-
import { R as H } from "./app-
|
|
28
|
-
import { F as q } from "./collectible.enum-
|
|
26
|
+
import { t as L } from "./index-C-YRCQZ4.js";
|
|
27
|
+
import { R as H } from "./app-BU48DR8E.js";
|
|
28
|
+
import { F as q } from "./collectible.enum-ef49SjA4.js";
|
|
29
29
|
import { useCoreStore as Ie } from "@feedmepos/mf-common";
|
|
30
|
-
import { m as De } from "./index-
|
|
30
|
+
import { m as De } from "./index-BGHhNcXH.js";
|
|
31
31
|
function Fe(d) {
|
|
32
32
|
let p = "";
|
|
33
33
|
switch (d) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as bt, mergeModels as Ll, useModel as ny, ref as _e, onMounted as ry, openBlock as T, createElementBlock as H, Fragment as be, unref as ke, createBlock as le, createCommentVNode as Se, computed as Vt, watch as Xt, resolveComponent as K, createElementVNode as oe, renderList as tt, withCtx as je, createVNode as U, toDisplayString as Fn, renderSlot as ay, mergeProps as iy, normalizeClass as uy, toValue as tu, shallowReadonly as oy, isRef as Xi } from "vue";
|
|
2
|
-
import { u as ly } from "./business-
|
|
2
|
+
import { u as ly } from "./business-BXXPV_BJ.js";
|
|
3
3
|
import { useBreakpoints as sy, useDialog as cy, useDialogChild as fy } from "@feedmepos/ui-library";
|
|
4
4
|
import { useCustomAttributes as dy, useCoreStore as py } from "@feedmepos/mf-common";
|
|
5
5
|
function hy(u, a, r) {
|