@feedmepos/mf-connect 0.0.16-beta.1 → 0.0.16-beta.11
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-zZmF5N.js → Analytic-Gq7PoNer.js} +368 -365
- package/dist/App-Cikl5jnp.js +177 -0
- package/dist/Broadcast-DU3JnBwZ.js +223 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-VWLBlxy1.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D0I8IZIR.js} +20 -20
- package/dist/Card-hIeQ5XUH.js +825 -0
- package/dist/Collections-B1SC1rr7.js +453 -0
- package/dist/Credit-BgwI8DR3.js +216 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bz6TSmbW.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-D9VR3P2d.js} +1026 -1022
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-AhWnHG02.js → EffectSheet.vue_vue_type_style_index_0_lang-DPgu45MD.js} +29 -29
- package/dist/Experience-C2Q-zqV6.js +221 -0
- package/dist/Game-DU2pZDGk.js +255 -0
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +144 -0
- package/dist/JsonViewer-v8_C7l5N.js +87 -0
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DykNOOFD.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js} +1 -1
- package/dist/{MainLayout-D0AoA1tk.js → MainLayout-B1aJoR95.js} +2 -2
- package/dist/Marketing-DWiTQp9I.js +316 -0
- package/dist/Member-BEXKBFry.js +69 -0
- package/dist/MemberList-DzMdajIf.js +1733 -0
- package/dist/MemberOverview-wL_ailso.js +58 -0
- package/dist/{MemberTransactions-CTAx5jIV.js → MemberTransactions-Bciankuu.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-C-BtHxSc.js → MessageInput.vue_vue_type_script_setup_true_lang-DH25Hfk3.js} +46 -46
- package/dist/Mission-KzwRlaA5.js +259 -0
- package/dist/Point-CSKvZXHc.js +222 -0
- package/dist/Promotion-IiwPhx8p.js +221 -0
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CrpJySSp.js → RuleGroup.vue_vue_type_script_setup_true_lang-4zIO3oCr.js} +545 -544
- package/dist/Segment-2Q0PonBb.js +447 -0
- package/dist/{Setting-Zrj5P_4m.js → Setting-Df5vVRt4.js} +600 -598
- package/dist/Store-C0WXCKs6.js +1503 -0
- package/dist/StoreRewards-eSSIO0nk.js +401 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DS4APaHw.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BjnCRKGX.js} +106 -108
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-ZYjWlDJ1.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-b0xTcoEp.js} +1 -1
- package/dist/{Tier-DVWJyQ9S.js → Tier-v-1FkRU-.js} +464 -449
- package/dist/{Title-B5kX64vs.js → Title-CQ2JWqBW.js} +315 -299
- package/dist/Transaction-0OouN_6s.js +39 -0
- package/dist/Voucher-CL0cgogx.js +488 -0
- package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/app-Bd19eW7X.js +5381 -0
- package/dist/app-CfS25Z66.js +34797 -0
- package/dist/app-wDQR6dpb.js +39 -0
- package/dist/app.js +5 -3
- package/dist/business-dQh3AEot.js +78 -0
- package/dist/{campaign-BZJuknWK.js → campaign-BOl8AgKA.js} +12 -12
- package/dist/{collection.fn-DoCkZ6z4.js → collection.fn-B_YsXmrP.js} +2 -2
- package/dist/dto-B8NfyVPG.js +1169 -0
- package/dist/{effect-B8kmnKvY.js → effect-C2jCStXO.js} +1 -1
- package/dist/{export-Dm6LYnWo.js → export-BtZc3Yzh.js} +3 -3
- package/dist/{helper-DR4XK3nv.js → helper-8oGsrM56.js} +1 -1
- package/dist/{index-DcUrk07Q.js → index-6FkKY3q0.js} +3 -3
- package/dist/{index-Bu4_26qI.js → index-C7oeXRUl.js} +1 -1
- package/dist/{index-CuL5-ORK.js → index-CZKYIefW.js} +6 -7
- package/dist/{index-yxJMhfxj.js → index-C_0IFnwi.js} +5 -5
- package/dist/{index-BryrRq8O.js → index-DCixRRvz.js} +36 -30
- package/dist/{index-CkiYkbXb.js → index-DFgt4-VW.js} +1 -1
- package/dist/{index-CWf0mh3a.js → index-DYDhH9bi.js} +177 -168
- package/dist/{index-boor8e80.js → index-Di-kWSmf.js} +3 -3
- package/dist/{app-DkI7dYRN.js → index-Dn0jdj0o.js} +9665 -13024
- package/dist/index-DwKqFNF6.js +3 -0
- package/dist/{index-BobRgQrE.js → index-HoacsZDk.js} +2 -2
- package/dist/{index-BxkxVtgm.js → index-UTQHDUdW.js} +1 -1
- package/dist/{loading-BzV5acUX.js → loading-D_AN6p24.js} +6807 -6805
- package/dist/{lodash-mg4435Qq.js → lodash-B5I3zXaY.js} +1 -1
- package/dist/{membership-CqbsLHqx.js → membership-Ccrx9R6r.js} +3 -3
- package/dist/{money-DA_gtp3q.js → money-waD-f-Zz.js} +1 -1
- package/dist/{number-C388eyOu.js → number-CwTGGsh9.js} +1 -1
- package/dist/{rule-Clmr5y4j.js → rule-DJ07h3Gh.js} +2 -2
- package/dist/{rule-builder-BgqNbM-P.js → rule-builder-DJ-acvVD.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/template-clxvNnbF.js +190 -0
- package/dist/{usePagination-o5fgsZwU.js → usePagination-BeF5K3M7.js} +86 -86
- package/dist/vue-i18n-BxwiXSkp.js +2365 -0
- package/dist/{xlsx-BRdh9e2p.js → xlsx-BB366cdN.js} +1945 -1945
- package/package.json +9 -5
- package/dist/Broadcast-X69Mtv3b.js +0 -216
- package/dist/Card-D0X3v1UF.js +0 -822
- package/dist/Collections-umR6Ehqf.js +0 -452
- package/dist/Credit-C1EWF7R0.js +0 -214
- package/dist/Experience-CqL8wyPm.js +0 -211
- package/dist/Game--kYe64EV.js +0 -250
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-BjOJ3XSL.js +0 -144
- package/dist/Marketing-CTCQ5ZmZ.js +0 -308
- package/dist/Member-DCduX7zP.js +0 -91
- package/dist/MemberList-B0EkXZJu.js +0 -1729
- package/dist/MemberOverview-C2n9oJZh.js +0 -58
- package/dist/Mission-CVr9rS_D.js +0 -248
- package/dist/Point-BnZ6M74y.js +0 -220
- package/dist/Promotion-B0PUve5S.js +0 -218
- package/dist/Segment-B-XpkyM5.js +0 -445
- package/dist/Store-B2gywCt2.js +0 -1503
- package/dist/StoreRewards-D8410Q_-.js +0 -434
- package/dist/Transaction-CZBO4v4d.js +0 -36
- package/dist/Voucher-se-4JF9B.js +0 -481
- package/dist/app-B2ImSO3V.js +0 -53382
- package/dist/dto-BWpvRpK2.js +0 -1151
- package/dist/template-Dwp7heBA.js +0 -190
package/dist/Voucher-se-4JF9B.js
DELETED
|
@@ -1,481 +0,0 @@
|
|
|
1
|
-
import { defineComponent as X, ref as y, watch as N, onMounted as J, resolveComponent as p, openBlock as g, createBlock as V, unref as t, isRef as j, withCtx as I, createElementVNode as s, createVNode as r, toDisplayString as U, computed as ee, createElementBlock as O, Fragment as T, renderList as ae, resolveDynamicComponent as te, createCommentVNode as K, h as v } from "vue";
|
|
2
|
-
import { _ as oe } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { useDialog as ne, components as x } from "@feedmepos/ui-library";
|
|
4
|
-
import { u as Q, p as z, a as se } from "./loading-BzV5acUX.js";
|
|
5
|
-
import { useCoreStore as le } from "@feedmepos/mf-common";
|
|
6
|
-
import { u as ie, J as re, a as ce, R as ue, b as D } from "./app-DkI7dYRN.js";
|
|
7
|
-
import { u as me } from "./campaign-BZJuknWK.js";
|
|
8
|
-
import { g as q, b as G } from "./dto-BWpvRpK2.js";
|
|
9
|
-
import { u as de } from "./template-Dwp7heBA.js";
|
|
10
|
-
import { _ as pe } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bz6TSmbW.js";
|
|
11
|
-
import { _ as fe } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
12
|
-
import { l as he } from "./lodash-mg4435Qq.js";
|
|
13
|
-
import { m as ge } from "./index-DcUrk07Q.js";
|
|
14
|
-
import { c as F } from "./index-BxkxVtgm.js";
|
|
15
|
-
import { useRouter as ye } from "vue-router";
|
|
16
|
-
const ve = { class: "space-y-16" }, _e = { class: "fm-typo-en-body-md-600" }, Ce = { class: "flex items-center justify-end" }, be = { class: "flex items-center gap-8" }, we = /* @__PURE__ */ X({
|
|
17
|
-
__name: "SendVoucherSheet",
|
|
18
|
-
emits: ["success"],
|
|
19
|
-
setup(W, { expose: M, emit: L }) {
|
|
20
|
-
const { minor: P } = Q, R = y(""), i = y({}), E = L, f = y(!1), u = y([]);
|
|
21
|
-
function m(e) {
|
|
22
|
-
f.value = !0, R.value = e.campaignId, u.value = [];
|
|
23
|
-
}
|
|
24
|
-
function _() {
|
|
25
|
-
f.value = !1;
|
|
26
|
-
}
|
|
27
|
-
const A = [
|
|
28
|
-
{
|
|
29
|
-
header: "Name",
|
|
30
|
-
accessorFn: (e) => e.name || "No Profile"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
header: "Phone",
|
|
34
|
-
accessorFn: (e) => e.phoneNumber || "-"
|
|
35
|
-
}
|
|
36
|
-
], l = y({
|
|
37
|
-
searchValue: "",
|
|
38
|
-
pageSize: 10,
|
|
39
|
-
pageCount: 0,
|
|
40
|
-
pageIndex: 0,
|
|
41
|
-
totalRows: 0,
|
|
42
|
-
isLoading: !1
|
|
43
|
-
}), d = y([]), C = async (e) => {
|
|
44
|
-
l.value.isLoading = !0, d.value = [];
|
|
45
|
-
const a = await ge.read({
|
|
46
|
-
limit: e.pageSize,
|
|
47
|
-
skip: e.pageIndex,
|
|
48
|
-
sortBy: "_id",
|
|
49
|
-
search: l.value.searchValue,
|
|
50
|
-
descending: !1
|
|
51
|
-
});
|
|
52
|
-
d.value = a.resources, l.value.totalRows = a.meta.totalResources ?? 0, l.value.pageCount = a.meta.totalPages ?? 0, l.value.isLoading = !1, i.value = {}, u.value.forEach((o) => {
|
|
53
|
-
const c = d.value.findIndex((w) => w._id == o);
|
|
54
|
-
c > -1 && (console.log(c, "fetch member index"), i.value[c] = !0);
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
function b() {
|
|
58
|
-
d.value.length > 0 && (u.value = u.value.filter(
|
|
59
|
-
(e) => !d.value.some((a) => a._id === e) || // Keep if not in current page
|
|
60
|
-
Object.entries(i.value).some(
|
|
61
|
-
([a, o]) => o && d.value[a]._id === e
|
|
62
|
-
// Keep if selected in current page
|
|
63
|
-
)
|
|
64
|
-
));
|
|
65
|
-
for (const [e, a] of Object.entries(i.value))
|
|
66
|
-
if (a) {
|
|
67
|
-
const o = d.value[e]._id;
|
|
68
|
-
u.value.includes(o) || u.value.push(o);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
async function $(e) {
|
|
72
|
-
u.value.length < 1 || await P(
|
|
73
|
-
async () => {
|
|
74
|
-
await F.sendCollection(R.value, {
|
|
75
|
-
memberId: u.value
|
|
76
|
-
}), await E("success"), _();
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
message: "Sending claim(s)",
|
|
80
|
-
successMessage: "Claim(s) created"
|
|
81
|
-
}
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
return N(i, b, { deep: !0 }), N(
|
|
85
|
-
() => l.value.searchValue,
|
|
86
|
-
he.debounce(async () => {
|
|
87
|
-
await C({ pageSize: 10, pageIndex: 0 });
|
|
88
|
-
}, 500)
|
|
89
|
-
), M({
|
|
90
|
-
showSheet: m,
|
|
91
|
-
hideSheet: _
|
|
92
|
-
}), J(async () => {
|
|
93
|
-
await C(l.value);
|
|
94
|
-
}), (e, a) => {
|
|
95
|
-
const o = p("FmSearch"), c = p("FmTable"), w = p("FmButton"), S = p("FmSideSheet");
|
|
96
|
-
return g(), V(S, {
|
|
97
|
-
"max-width": 560,
|
|
98
|
-
"dismiss-away": !0,
|
|
99
|
-
header: "Send voucher to",
|
|
100
|
-
modelValue: t(f),
|
|
101
|
-
"onUpdate:modelValue": [
|
|
102
|
-
a[3] || (a[3] = (h) => j(f) ? f.value = h : null),
|
|
103
|
-
a[4] || (a[4] = (h) => f.value = h)
|
|
104
|
-
]
|
|
105
|
-
}, {
|
|
106
|
-
"side-sheet-footer": I(() => [
|
|
107
|
-
s("div", be, [
|
|
108
|
-
r(w, {
|
|
109
|
-
label: "Send",
|
|
110
|
-
loading: t(ie)().isLoading,
|
|
111
|
-
onClick: $
|
|
112
|
-
}, null, 8, ["loading"]),
|
|
113
|
-
r(w, {
|
|
114
|
-
label: "Cancel",
|
|
115
|
-
type: "button",
|
|
116
|
-
variant: "tertiary",
|
|
117
|
-
onClick: a[2] || (a[2] = (h) => f.value = !1)
|
|
118
|
-
})
|
|
119
|
-
])
|
|
120
|
-
]),
|
|
121
|
-
default: I(() => [
|
|
122
|
-
r(re, { json: t(u) }, null, 8, ["json"]),
|
|
123
|
-
s("div", ve, [
|
|
124
|
-
s("div", _e, U(t(u).length) + " members selected ", 1),
|
|
125
|
-
s("div", Ce, [
|
|
126
|
-
r(o, {
|
|
127
|
-
class: "mt-4",
|
|
128
|
-
modelValue: t(l).searchValue,
|
|
129
|
-
"onUpdate:modelValue": a[0] || (a[0] = (h) => t(l).searchValue = h),
|
|
130
|
-
placeholder: "Search Member",
|
|
131
|
-
collapsible: ""
|
|
132
|
-
}, null, 8, ["modelValue"])
|
|
133
|
-
]),
|
|
134
|
-
r(c, {
|
|
135
|
-
modelValue: t(i),
|
|
136
|
-
"onUpdate:modelValue": a[1] || (a[1] = (h) => j(i) ? i.value = h : null),
|
|
137
|
-
selection: "multiple",
|
|
138
|
-
loading: t(l).isLoading,
|
|
139
|
-
"row-data": t(d),
|
|
140
|
-
"column-defs": A,
|
|
141
|
-
"page-size": t(l).pageSize,
|
|
142
|
-
"page-count": t(l).pageCount,
|
|
143
|
-
"hide-footer": t(l).totalRows <= t(l).pageSize,
|
|
144
|
-
"fetch-fn": C
|
|
145
|
-
}, null, 8, ["modelValue", "loading", "row-data", "page-size", "page-count", "hide-footer"])
|
|
146
|
-
])
|
|
147
|
-
]),
|
|
148
|
-
_: 1
|
|
149
|
-
}, 8, ["modelValue"]);
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
var Se = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedmedev.cc", crmUrl: "crm.feedmedev.cc", paymentPortalUrl: "https://portal.feedmedev.cc/payment/payout-account", marketingV1Portal: "https://marketing-v1.feedmedev.cc" };
|
|
154
|
-
const xe = { class: "px-24 flex flex-col gap-y-16" }, Ve = { class: "flex items-center justify-between w-full" }, ke = { class: "flex gap-8 overflow-x-auto" }, Fe = { class: "space-y-8" }, Ie = { class: "flex w-full gap-4 items-center" }, Le = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Re = { class: "space-y-4" }, Ue = { class: "fm-typo-en-body-lg-600" }, Me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pe = { class: "flex gap-8 items-center" }, Ee = /* @__PURE__ */ s("img", {
|
|
155
|
-
src: oe,
|
|
156
|
-
class: "aspect-square w-[150px]"
|
|
157
|
-
}, null, -1), Ae = /* @__PURE__ */ s("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
158
|
-
/* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Create voucher campaign"),
|
|
159
|
-
/* @__PURE__ */ s("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " A digital coupon that users can redeem for discounts on future purchases. Users usually need to claim and apply the voucher to benefit from the discount. ")
|
|
160
|
-
], -1), We = /* @__PURE__ */ X({
|
|
161
|
-
__name: "Voucher",
|
|
162
|
-
setup(W) {
|
|
163
|
-
const M = {
|
|
164
|
-
label: "Create campaign",
|
|
165
|
-
value: "create",
|
|
166
|
-
isPrimary: !0,
|
|
167
|
-
prependIcon: "add"
|
|
168
|
-
}, L = ne(), P = de("VOUCHER", L), R = ce(), i = me(), { global: E, minor: f } = Q, u = ye(), m = y({
|
|
169
|
-
searchKey: "",
|
|
170
|
-
location: null
|
|
171
|
-
}), _ = ee(
|
|
172
|
-
() => i.campaigns.voucher.filter(
|
|
173
|
-
(e) => !m.value.location || !e.targetLocation || e.targetLocation.includes(m.value.location)
|
|
174
|
-
)
|
|
175
|
-
), A = [
|
|
176
|
-
{
|
|
177
|
-
header: "Voucher title",
|
|
178
|
-
accessorFn: (e) => e.name
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
header: "Status",
|
|
182
|
-
cell(e) {
|
|
183
|
-
return q(e.row.original);
|
|
184
|
-
}
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
header: "Summary",
|
|
188
|
-
accessorFn: (e) => G(e)
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
header: "Quota",
|
|
192
|
-
accessorFn: (e) => {
|
|
193
|
-
var a;
|
|
194
|
-
return ((a = e.pf_collectible) == null ? void 0 : a.options.maxReceive) ?? "Unlimited";
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
header: "Claimed",
|
|
199
|
-
accessorFn: (e) => {
|
|
200
|
-
var a;
|
|
201
|
-
return ((a = e == null ? void 0 : e.pf_collectible) == null ? void 0 : a.currentReceive) ?? 0;
|
|
202
|
-
}
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
header: "Actions",
|
|
206
|
-
cell(e) {
|
|
207
|
-
return v("div", { class: "flex items-center justify-end" }, [
|
|
208
|
-
v(x.FmButton, {
|
|
209
|
-
icon: "visibility",
|
|
210
|
-
variant: "tertiary",
|
|
211
|
-
iconColor: "neutral-gray-400",
|
|
212
|
-
onClick: async (a) => {
|
|
213
|
-
a.stopPropagation(), await u.push({
|
|
214
|
-
name: D["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
|
|
215
|
-
params: { id: e.row.original._id }
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
}),
|
|
219
|
-
v(
|
|
220
|
-
x.FmMenu,
|
|
221
|
-
{
|
|
222
|
-
placement: "bottom-end",
|
|
223
|
-
onClick: (a) => {
|
|
224
|
-
a.stopPropagation();
|
|
225
|
-
}
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
"menu-button": () => v(x.FmButton, {
|
|
229
|
-
icon: "more_vert",
|
|
230
|
-
iconColor: "neutral-gray-400",
|
|
231
|
-
variant: "tertiary"
|
|
232
|
-
}),
|
|
233
|
-
default: () => {
|
|
234
|
-
const a = [
|
|
235
|
-
v(
|
|
236
|
-
x.FmMenuItem,
|
|
237
|
-
{
|
|
238
|
-
onClick: async (o) => {
|
|
239
|
-
o.stopPropagation(), C(e.row.original);
|
|
240
|
-
}
|
|
241
|
-
},
|
|
242
|
-
{
|
|
243
|
-
label: v(
|
|
244
|
-
"div",
|
|
245
|
-
{
|
|
246
|
-
class: "text-fm-color-typo-error fm-typo-en-body-md-400"
|
|
247
|
-
},
|
|
248
|
-
"Remove"
|
|
249
|
-
)
|
|
250
|
-
}
|
|
251
|
-
)
|
|
252
|
-
];
|
|
253
|
-
return e.row.original.event.type === "SIMPLE_CLAIM" && (a.unshift(
|
|
254
|
-
v(x.FmMenuItem, {
|
|
255
|
-
label: "Send",
|
|
256
|
-
onClick: async (o) => {
|
|
257
|
-
var c;
|
|
258
|
-
o.stopPropagation(), (c = d.value) == null || c.showSheet({
|
|
259
|
-
campaignId: e.row.original._id
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
})
|
|
263
|
-
), a.unshift(
|
|
264
|
-
v(x.FmMenuItem, {
|
|
265
|
-
label: "Share",
|
|
266
|
-
onClick: async (o) => {
|
|
267
|
-
if (o.stopPropagation(), e.row.original.event.type !== "SIMPLE_CLAIM")
|
|
268
|
-
return await z.confirm(
|
|
269
|
-
"Cannot share a voucher that is not a simple claim.",
|
|
270
|
-
"Share Voucher",
|
|
271
|
-
"OK"
|
|
272
|
-
);
|
|
273
|
-
await se(
|
|
274
|
-
`https://${le().currentBusiness.value._id}.${Se.appUrl}/vouchers/${e.row.original._id}`,
|
|
275
|
-
{
|
|
276
|
-
successMessage: "Voucher link copied to clipboard"
|
|
277
|
-
}
|
|
278
|
-
);
|
|
279
|
-
}
|
|
280
|
-
})
|
|
281
|
-
)), a;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
)
|
|
285
|
-
]);
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
], l = y(), d = y();
|
|
289
|
-
async function C(e) {
|
|
290
|
-
await z.remove(`Are you sure you want to remove ${e.name}?`) && await f(
|
|
291
|
-
async () => {
|
|
292
|
-
await F.delete(e._id), await i.read("VOUCHER");
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
message: `Removing ${e.name}`,
|
|
296
|
-
successMessage: `Removed ${e.name} successfully`
|
|
297
|
-
}
|
|
298
|
-
);
|
|
299
|
-
}
|
|
300
|
-
async function b(e) {
|
|
301
|
-
e ? await a() : P.open(async (o) => {
|
|
302
|
-
await a(o);
|
|
303
|
-
});
|
|
304
|
-
async function a(o) {
|
|
305
|
-
var c;
|
|
306
|
-
(c = l.value) == null || c.showSheet(
|
|
307
|
-
!0,
|
|
308
|
-
"VOUCHER",
|
|
309
|
-
e ? await F.readById(e._id) : void 0,
|
|
310
|
-
o
|
|
311
|
-
);
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
async function $(e) {
|
|
315
|
-
e.campaign._id && await new Promise((a) => {
|
|
316
|
-
L.open({
|
|
317
|
-
title: "Confirmation",
|
|
318
|
-
message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
|
|
319
|
-
primaryActions: { text: "Update all", close: !0 },
|
|
320
|
-
secondaryActions: { text: "Update future only", close: !0 }
|
|
321
|
-
}).onPrimary(async () => {
|
|
322
|
-
var o;
|
|
323
|
-
e.updateCollections = !0, (o = window.top) == null || o.postMessage("updateAllVoucher", "*"), a();
|
|
324
|
-
}).onSecondary(async () => {
|
|
325
|
-
a();
|
|
326
|
-
});
|
|
327
|
-
}), await f(
|
|
328
|
-
async () => {
|
|
329
|
-
e.campaign._id ? await F.update(e.campaign._id, e) : await F.create(e), await i.read("VOUCHER");
|
|
330
|
-
},
|
|
331
|
-
{
|
|
332
|
-
message: `${e.campaign._id ? "Updating" : "Creating"} voucher`,
|
|
333
|
-
successMessage: `Voucher ${e.campaign._id ? "updated" : "created"} successfully`
|
|
334
|
-
}
|
|
335
|
-
);
|
|
336
|
-
}
|
|
337
|
-
return J(async () => {
|
|
338
|
-
await E(async () => {
|
|
339
|
-
await i.read("VOUCHER");
|
|
340
|
-
});
|
|
341
|
-
}), (e, a) => {
|
|
342
|
-
const o = p("FmPageHead"), c = p("FmSearch"), w = p("FmTable"), S = p("FmButton"), h = p("FmListItem"), Z = p("FmList"), Y = p("FmCard");
|
|
343
|
-
return g(), O(T, null, [
|
|
344
|
-
r(o, {
|
|
345
|
-
title: "Voucher",
|
|
346
|
-
actions: t(_).length > 0 ? [M] : [],
|
|
347
|
-
"onClick:action": a[0] || (a[0] = () => b())
|
|
348
|
-
}, null, 8, ["actions"]),
|
|
349
|
-
s("div", xe, [
|
|
350
|
-
r(c, {
|
|
351
|
-
modelValue: t(m).searchKey,
|
|
352
|
-
"onUpdate:modelValue": a[1] || (a[1] = (n) => t(m).searchKey = n),
|
|
353
|
-
class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
|
|
354
|
-
placeholder: "search",
|
|
355
|
-
collapsible: ""
|
|
356
|
-
}, null, 8, ["modelValue"]),
|
|
357
|
-
t(i).campaigns.voucher && t(i).campaigns.voucher.length > 0 ? (g(), O(T, { key: 0 }, [
|
|
358
|
-
s("div", Ve, [
|
|
359
|
-
s("div", ke, [
|
|
360
|
-
r(fe, {
|
|
361
|
-
modelValue: t(m).location,
|
|
362
|
-
"onUpdate:modelValue": a[2] || (a[2] = (n) => t(m).location = n),
|
|
363
|
-
label: "Location: ",
|
|
364
|
-
"show-item-label": !0,
|
|
365
|
-
icon: "storefront",
|
|
366
|
-
placement: "bottom-start",
|
|
367
|
-
items: t(R).locationItems
|
|
368
|
-
}, null, 8, ["modelValue", "items"])
|
|
369
|
-
]),
|
|
370
|
-
r(c, {
|
|
371
|
-
modelValue: t(m).searchKey,
|
|
372
|
-
"onUpdate:modelValue": a[3] || (a[3] = (n) => t(m).searchKey = n),
|
|
373
|
-
class: "xs:hidden",
|
|
374
|
-
placeholder: "search",
|
|
375
|
-
collapsible: ""
|
|
376
|
-
}, null, 8, ["modelValue"])
|
|
377
|
-
]),
|
|
378
|
-
r(w, {
|
|
379
|
-
class: "xs:hidden",
|
|
380
|
-
"row-data": t(_),
|
|
381
|
-
"column-defs": A,
|
|
382
|
-
"search-value": t(m).searchKey,
|
|
383
|
-
"column-filter": [],
|
|
384
|
-
onRowClick: a[4] || (a[4] = (n) => b(n.original)),
|
|
385
|
-
"hide-footer": t(_).length < 10
|
|
386
|
-
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
387
|
-
r(Z, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
|
|
388
|
-
default: I(() => [
|
|
389
|
-
(g(!0), O(T, null, ae(t(_).filter(
|
|
390
|
-
(n) => n.name.toLowerCase().includes(t(m).searchKey.toLowerCase())
|
|
391
|
-
), (n) => (g(), V(h, {
|
|
392
|
-
key: n._id.toString(),
|
|
393
|
-
onClick: (B) => b(n),
|
|
394
|
-
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
395
|
-
}, {
|
|
396
|
-
default: I(() => {
|
|
397
|
-
var B;
|
|
398
|
-
return [
|
|
399
|
-
s("div", Fe, [
|
|
400
|
-
s("div", Ie, [
|
|
401
|
-
(g(), V(te(t(q)(n)))),
|
|
402
|
-
s("div", Le, U(((B = n.pf_collectible) == null ? void 0 : B.currentReceive) ?? 0) + " claimed ", 1)
|
|
403
|
-
]),
|
|
404
|
-
s("div", Re, [
|
|
405
|
-
s("div", Ue, U(n.name), 1),
|
|
406
|
-
s("div", Me, U(t(G)(n)), 1)
|
|
407
|
-
])
|
|
408
|
-
]),
|
|
409
|
-
s("div", Pe, [
|
|
410
|
-
n.event.type === "SIMPLE_CLAIM" ? (g(), V(S, {
|
|
411
|
-
key: 0,
|
|
412
|
-
icon: "visibility",
|
|
413
|
-
"icon-color": "neutral-gray-400",
|
|
414
|
-
variant: "tertiary",
|
|
415
|
-
onClick: async (k) => {
|
|
416
|
-
k.stopPropagation(), await t(ue).push({
|
|
417
|
-
name: t(D)["mf-connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
|
|
418
|
-
params: { id: n._id }
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
}, null, 8, ["onClick"])) : K("", !0),
|
|
422
|
-
n.event.type === "SIMPLE_CLAIM" ? (g(), V(S, {
|
|
423
|
-
key: 1,
|
|
424
|
-
icon: "send",
|
|
425
|
-
"icon-color": "neutral-gray-400",
|
|
426
|
-
variant: "tertiary",
|
|
427
|
-
onClick: (k) => {
|
|
428
|
-
var H;
|
|
429
|
-
k.stopPropagation(), (H = t(d)) == null || H.showSheet({
|
|
430
|
-
campaignId: n._id
|
|
431
|
-
});
|
|
432
|
-
}
|
|
433
|
-
}, null, 8, ["onClick"])) : K("", !0),
|
|
434
|
-
r(S, {
|
|
435
|
-
icon: "delete",
|
|
436
|
-
"icon-color": "neutral-gray-400",
|
|
437
|
-
variant: "tertiary",
|
|
438
|
-
onClick: (k) => (k.stopPropagation(), C(n))
|
|
439
|
-
}, null, 8, ["onClick"])
|
|
440
|
-
])
|
|
441
|
-
];
|
|
442
|
-
}),
|
|
443
|
-
_: 2
|
|
444
|
-
}, 1032, ["onClick"]))), 128))
|
|
445
|
-
]),
|
|
446
|
-
_: 1
|
|
447
|
-
})
|
|
448
|
-
], 64)) : (g(), V(Y, {
|
|
449
|
-
key: 1,
|
|
450
|
-
variant: "outlined",
|
|
451
|
-
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
452
|
-
}, {
|
|
453
|
-
default: I(() => [
|
|
454
|
-
Ee,
|
|
455
|
-
Ae,
|
|
456
|
-
r(S, {
|
|
457
|
-
variant: "primary",
|
|
458
|
-
label: "Create voucher campaign",
|
|
459
|
-
icon: "add",
|
|
460
|
-
onClick: a[5] || (a[5] = (n) => b())
|
|
461
|
-
})
|
|
462
|
-
]),
|
|
463
|
-
_: 1
|
|
464
|
-
})),
|
|
465
|
-
r(pe, {
|
|
466
|
-
ref_key: "sheetRef",
|
|
467
|
-
ref: l,
|
|
468
|
-
"onSubmit:modelValue": $
|
|
469
|
-
}, null, 512),
|
|
470
|
-
r(we, {
|
|
471
|
-
ref_key: "sendVoucherSheetRef",
|
|
472
|
-
ref: d
|
|
473
|
-
}, null, 512)
|
|
474
|
-
])
|
|
475
|
-
], 64);
|
|
476
|
-
};
|
|
477
|
-
}
|
|
478
|
-
});
|
|
479
|
-
export {
|
|
480
|
-
We as default
|
|
481
|
-
};
|