@feedmepos/mf-connect 0.1.0-beta.6 → 0.1.0-beta.60
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-CXegtSEd.js +427 -0
- package/dist/{App-C2616cfr.js → App-m9A9s3wd.js} +445 -420
- package/dist/AuditLogs-CpUOkyXq.js +1886 -0
- package/dist/Bin-m6mPl3FE.js +166 -0
- package/dist/{Broadcast-CqSwLTAq.js → Broadcast-DNjHnlPp.js} +56 -54
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DrR9Pmtb.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-cjdNZLkE.js} +6 -8
- package/dist/Card-CAvS5aaN.js +896 -0
- package/dist/Collections-3C9I2byH.js +459 -0
- package/dist/{Credit-CPcLgnsq.js → Credit-DcAmLeMb.js} +36 -34
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +108 -0
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +58 -0
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-wGFMCV-y.js +2181 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-D2buK6Dj.js → EffectSheet.vue_vue_type_style_index_0_lang-CIEn1N24.js} +6 -6
- package/dist/{Experience-BoBikt-x.js → Experience-GF9yOrlE.js} +32 -30
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js +118 -0
- package/dist/{Game-DR8PyYZa.js → Game-CzBn_Li3.js} +39 -37
- package/dist/Index-Bhmkdb4n.js +259 -0
- package/dist/Marketing-DlbcOoiN.js +20071 -0
- package/dist/Member-CdXG5uEN.js +317 -0
- package/dist/MemberList-xIOXAHJf.js +1598 -0
- package/dist/MemberTransactions-CsW9vso0.js +45 -0
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DhtIZCjT.js → MessageInput.vue_vue_type_script_setup_true_lang-jtjk9NjI.js} +83 -71
- package/dist/{Mission-CMpvz9zN.js → Mission-2UjKrmGe.js} +101 -87
- package/dist/Overview-ClittdS6.js +1078 -0
- package/dist/{Point-DkZn6p9s.js → Point-BON4g7zE.js} +55 -53
- package/dist/{Promotion-B7YzwPc_.js → Promotion-qUEZmmm8.js} +65 -57
- package/dist/Queue-DA4glGdE.js +244 -0
- package/dist/Record-EUAnp1--.js +340 -0
- package/dist/Reward-ChbsdQuW.js +442 -0
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-CUFw56sf.js +150 -0
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BKesht7Y.js +1637 -0
- package/dist/Segment-DbwFx6vD.js +568 -0
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-lwpYOWMR.js +181 -0
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-BbuOPEGY.js +147 -0
- package/dist/Setting-FMTftvlU.js +1931 -0
- package/dist/Store-BkUwiBUq.js +1751 -0
- package/dist/{StoreRewards-6BzVwZqr.js → StoreRewards-Z8uhK0v1.js} +33 -32
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-DwFYJ1Iz.js +943 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-B6cAveco.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-D6mrJp05.js} +1 -1
- package/dist/{Tier-CW-46oJS.js → Tier-COCmcJJF.js} +327 -318
- package/dist/{Title-CE9rWVdi.js → Title-7qCjbur9.js} +199 -184
- package/dist/{Transaction-B21RrC4M.js → Transaction-9FS_K2hv.js} +2 -2
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-Fx-J2gcK.js +130 -0
- package/dist/Voucher-Dx70JAgw.js +354 -0
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-CECJsKRJ.js +419 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BiVZwBuG.js → ZodTextField.vue_vue_type_script_setup_true_lang-Bne_nxYS.js} +1 -1
- package/dist/{app-CjhXHUQv.js → app-CWKpKW78.js} +1 -1
- package/dist/app-q6W6-faT.js +7059 -0
- package/dist/app.js +1 -1
- package/dist/{business-aHhRUXc0.js → business-D5AQBRGS.js} +1 -1
- package/dist/campaign-BGiM8ccX.js +1810 -0
- package/dist/{campaign-DH9NUNf_.js → campaign-v8MAkDo-.js} +2 -2
- package/dist/campaign.enum-Dro6UEcE.js +20 -0
- package/dist/campaign.fn-DsJUr-gE.js +758 -0
- package/dist/collectible.enum-BH9pX7PE.js +19 -0
- package/dist/{collection.fn-CYlsA-kW.js → collection.fn-CHiRShK_.js} +2 -2
- package/dist/dto-CeX9egUp.js +214 -0
- package/dist/{effect-LSc9YanX.js → effect-DtJQE1cD.js} +9 -9
- package/dist/email-addresses-DKOsgzML.js +705 -0
- package/dist/{export-Cf0-C5Ly.js → export-Daiv_zH9.js} +5 -5
- package/dist/{helper-CiZpeMCM.js → helper-B5Emawnj.js} +1 -1
- package/dist/index-9WBy0L7U.js +54 -0
- package/dist/{index-D6cEOHP4.js → index-BSHuLDD0.js} +1501 -1480
- package/dist/{index-BVb5-Ht8.js → index-CUl_8M_c.js} +259 -173
- package/dist/{index-gxwjKu3-.js → index-CgCcvX_L.js} +2212 -871
- package/dist/index-CsaQJMAR.js +66 -0
- package/dist/{index-D_83JP2i.js → index-DrWrGAHJ.js} +48 -4
- package/dist/index-DteeKoFo.js +115 -0
- package/dist/{index-DW3PRjPL.js → index-Dw2RtHKR.js} +1 -1
- package/dist/{index-kPhrD63q.js → index-ICbXrXiP.js} +1 -1
- package/dist/index-Xwc07I54.js +29000 -0
- package/dist/{index-DtsDOuDx.js → index-ZBSI6ViG.js} +24 -21
- package/dist/index-g9NNHS8s.js +32 -0
- package/dist/index-p6F08hhh.js +44 -0
- package/dist/index-vh86FiIQ.js +10 -0
- package/dist/{index.esm2017-B7oVYIbY.js → index.esm2017-B-SDA6Y2.js} +121 -121
- package/dist/loading-CDbkBsRr.js +71 -0
- package/dist/{membership-Dw1ylJ9Y.js → membership-B8uwuntJ.js} +54 -46
- package/dist/money-DRKB3Rpe.js +15 -0
- package/dist/number-DtyC1DJU.js +12 -0
- package/dist/objectid-wGrq9P1h.js +145 -0
- package/dist/{loading-7yq1tinq.js → plugins-DKNh-lBz.js} +3871 -3943
- package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
- package/dist/reward-C2jv5dmJ.js +36 -0
- package/dist/{rule-C0Q_SHow.js → rule-C5AMTchR.js} +180 -177
- package/dist/{rule-builder-iu17XIof.js → rule-builder-DLOGHT1l.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{template-CyOanTMu.js → template-C-fz1DXI.js} +5 -5
- package/dist/trigger-DTErX60D.js +144 -0
- package/dist/user-CVRoQGCF.js +54 -0
- package/dist/{vue-i18n-B0fLJH7a.js → vue-i18n-CxMxiW_u.js} +366 -366
- package/dist/{xlsx-BYO_bB9J.js → xlsx-CARvMJN_.js} +1 -1
- package/package.json +10 -6
- package/dist/Analytic-muDf0oMG.js +0 -622
- package/dist/Card-bhLoK0ZV.js +0 -825
- package/dist/Collections-DjtsAiol.js +0 -453
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-U_QZneS6.js +0 -2813
- package/dist/Marketing-Dny2nMUl.js +0 -316
- package/dist/Member-CP_smyk8.js +0 -69
- package/dist/MemberList-CR3eYI9p.js +0 -1733
- package/dist/MemberTransactions-RTx_lKFb.js +0 -38
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Cs67_GLE.js +0 -1753
- package/dist/Segment-Bb4gHt5V.js +0 -437
- package/dist/Setting-Xj0AVzh3.js +0 -1901
- package/dist/Store-BWRHQ6Ie.js +0 -1511
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BsFnT8BS.js +0 -890
- package/dist/Voucher-KK9fBI0u.js +0 -490
- package/dist/app-Dvf_JNMf.js +0 -5764
- package/dist/dto-DArfyZAI.js +0 -2770
- package/dist/index-Bi_LGEtY.js +0 -99
- package/dist/index-CiQDG7Cm.js +0 -762
- package/dist/index-CuvNtC_M.js +0 -61
- package/dist/index-DQfjSSMF.js +0 -206
- package/dist/index-DcxssxPi.js +0 -29193
- package/dist/index-DqJVH2kv.js +0 -298
- package/dist/money-CPd0XTNv.js +0 -15
- package/dist/number-BgXY4un8.js +0 -12
- package/dist/user-Bm4KttFq.js +0 -37
package/dist/Voucher-KK9fBI0u.js
DELETED
|
@@ -1,490 +0,0 @@
|
|
|
1
|
-
import { defineComponent as X, ref as _, watch as N, onMounted as J, resolveComponent as h, openBlock as y, createBlock as k, unref as t, isRef as j, withCtx as M, createElementVNode as l, createVNode as r, toDisplayString as F, computed as oe, h as C, createElementBlock as $, Fragment as T, renderList as te, resolveDynamicComponent as ae, createCommentVNode as K } from "vue";
|
|
2
|
-
import { _ as ne } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { useDialog as se, components as V } from "@feedmepos/ui-library";
|
|
4
|
-
import { u as W, p as z, a as le } from "./loading-7yq1tinq.js";
|
|
5
|
-
import { useCoreStore as ce } from "@feedmepos/mf-common";
|
|
6
|
-
import { u as ie } from "./business-aHhRUXc0.js";
|
|
7
|
-
import { u as re } from "./campaign-DH9NUNf_.js";
|
|
8
|
-
import { g as D, b as q } from "./dto-DArfyZAI.js";
|
|
9
|
-
import "./index-kPhrD63q.js";
|
|
10
|
-
import { u as ue } from "./template-CyOanTMu.js";
|
|
11
|
-
import { _ as me } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-U_QZneS6.js";
|
|
12
|
-
import { _ as de } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
13
|
-
import { J as pe } from "./JsonViewer-v8_C7l5N.js";
|
|
14
|
-
import { u as fe } from "./app-wDQR6dpb.js";
|
|
15
|
-
import { l as he } from "./lodash-B5I3zXaY.js";
|
|
16
|
-
import { m as ve } from "./index-DtsDOuDx.js";
|
|
17
|
-
import { c as L } from "./index-Bi_LGEtY.js";
|
|
18
|
-
import { u as ge } from "./vue-i18n-B0fLJH7a.js";
|
|
19
|
-
import { useRouter as ye } from "vue-router";
|
|
20
|
-
import { R as G } from "./app-Dvf_JNMf.js";
|
|
21
|
-
const _e = { class: "space-y-16" }, be = { class: "fm-typo-en-body-md-600" }, Ce = { class: "flex items-center justify-end" }, we = { class: "flex items-center gap-8" }, Se = /* @__PURE__ */ X({
|
|
22
|
-
__name: "SendVoucherSheet",
|
|
23
|
-
emits: ["success"],
|
|
24
|
-
setup(Q, { expose: a, emit: A }) {
|
|
25
|
-
const { minor: R } = W, P = _(""), v = _({}), b = A, g = _(!1), u = _([]);
|
|
26
|
-
function U(c) {
|
|
27
|
-
g.value = !0, P.value = c.campaignId, u.value = [];
|
|
28
|
-
}
|
|
29
|
-
function m() {
|
|
30
|
-
g.value = !1;
|
|
31
|
-
}
|
|
32
|
-
const S = [
|
|
33
|
-
{
|
|
34
|
-
header: "Name",
|
|
35
|
-
accessorFn: (c) => c.name || "No Profile"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
header: "Phone",
|
|
39
|
-
accessorFn: (c) => c.phoneNumber || "-"
|
|
40
|
-
}
|
|
41
|
-
], i = _({
|
|
42
|
-
searchValue: "",
|
|
43
|
-
pageSize: 10,
|
|
44
|
-
pageCount: 0,
|
|
45
|
-
pageIndex: 0,
|
|
46
|
-
totalRows: 0,
|
|
47
|
-
isLoading: !1
|
|
48
|
-
}), f = _([]), w = async (c) => {
|
|
49
|
-
i.value.isLoading = !0, f.value = [];
|
|
50
|
-
const e = await ve.read({
|
|
51
|
-
limit: c.pageSize,
|
|
52
|
-
skip: c.pageIndex,
|
|
53
|
-
sortBy: "_id",
|
|
54
|
-
search: i.value.searchValue,
|
|
55
|
-
descending: !1
|
|
56
|
-
});
|
|
57
|
-
f.value = e.resources, i.value.totalRows = e.meta.totalResources ?? 0, i.value.pageCount = e.meta.totalPages ?? 0, i.value.isLoading = !1, v.value = {}, u.value.forEach((o) => {
|
|
58
|
-
const s = f.value.findIndex((d) => d._id == o);
|
|
59
|
-
s > -1 && (console.log(s, "fetch member index"), v.value[s] = !0);
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
function E() {
|
|
63
|
-
f.value.length > 0 && (u.value = u.value.filter(
|
|
64
|
-
(c) => !f.value.some((e) => e._id === c) || // Keep if not in current page
|
|
65
|
-
Object.entries(v.value).some(
|
|
66
|
-
([e, o]) => o && f.value[e]._id === c
|
|
67
|
-
// Keep if selected in current page
|
|
68
|
-
)
|
|
69
|
-
));
|
|
70
|
-
for (const [c, e] of Object.entries(v.value))
|
|
71
|
-
if (e) {
|
|
72
|
-
const o = f.value[c]._id;
|
|
73
|
-
u.value.includes(o) || u.value.push(o);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
async function x(c) {
|
|
77
|
-
u.value.length < 1 || await R(
|
|
78
|
-
async () => {
|
|
79
|
-
await L.sendCollection(P.value, {
|
|
80
|
-
memberId: u.value
|
|
81
|
-
}), await b("success"), m();
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
message: "Sending claim(s)",
|
|
85
|
-
successMessage: "Claim(s) created"
|
|
86
|
-
}
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
return N(v, E, { deep: !0 }), N(
|
|
90
|
-
() => i.value.searchValue,
|
|
91
|
-
he.debounce(async () => {
|
|
92
|
-
await w({ pageSize: 10, pageIndex: 0 });
|
|
93
|
-
}, 500)
|
|
94
|
-
), a({
|
|
95
|
-
showSheet: U,
|
|
96
|
-
hideSheet: m
|
|
97
|
-
}), J(async () => {
|
|
98
|
-
await w(i.value);
|
|
99
|
-
}), (c, e) => {
|
|
100
|
-
const o = h("FmSearch"), s = h("FmTable"), d = h("FmButton"), B = h("FmSideSheet");
|
|
101
|
-
return y(), k(B, {
|
|
102
|
-
"max-width": 560,
|
|
103
|
-
"dismiss-away": !0,
|
|
104
|
-
header: "Send voucher to",
|
|
105
|
-
modelValue: t(g),
|
|
106
|
-
"onUpdate:modelValue": [
|
|
107
|
-
e[3] || (e[3] = (p) => j(g) ? g.value = p : null),
|
|
108
|
-
e[4] || (e[4] = (p) => g.value = p)
|
|
109
|
-
]
|
|
110
|
-
}, {
|
|
111
|
-
"side-sheet-footer": M(() => [
|
|
112
|
-
l("div", we, [
|
|
113
|
-
r(d, {
|
|
114
|
-
label: "Send",
|
|
115
|
-
loading: t(fe)().isLoading,
|
|
116
|
-
onClick: x
|
|
117
|
-
}, null, 8, ["loading"]),
|
|
118
|
-
r(d, {
|
|
119
|
-
label: "Cancel",
|
|
120
|
-
type: "button",
|
|
121
|
-
variant: "tertiary",
|
|
122
|
-
onClick: e[2] || (e[2] = (p) => g.value = !1)
|
|
123
|
-
})
|
|
124
|
-
])
|
|
125
|
-
]),
|
|
126
|
-
default: M(() => [
|
|
127
|
-
r(pe, { json: t(u) }, null, 8, ["json"]),
|
|
128
|
-
l("div", _e, [
|
|
129
|
-
l("div", be, F(t(u).length) + " members selected ", 1),
|
|
130
|
-
l("div", Ce, [
|
|
131
|
-
r(o, {
|
|
132
|
-
class: "mt-4",
|
|
133
|
-
modelValue: t(i).searchValue,
|
|
134
|
-
"onUpdate:modelValue": e[0] || (e[0] = (p) => t(i).searchValue = p),
|
|
135
|
-
placeholder: "Search Member",
|
|
136
|
-
collapsible: ""
|
|
137
|
-
}, null, 8, ["modelValue"])
|
|
138
|
-
]),
|
|
139
|
-
r(s, {
|
|
140
|
-
modelValue: t(v),
|
|
141
|
-
"onUpdate:modelValue": e[1] || (e[1] = (p) => j(v) ? v.value = p : null),
|
|
142
|
-
selection: "multiple",
|
|
143
|
-
loading: t(i).isLoading,
|
|
144
|
-
"row-data": t(f),
|
|
145
|
-
"column-defs": S,
|
|
146
|
-
"page-size": t(i).pageSize,
|
|
147
|
-
"page-count": t(i).pageCount,
|
|
148
|
-
"hide-footer": t(i).totalRows <= t(i).pageSize,
|
|
149
|
-
"fetch-fn": w
|
|
150
|
-
}, null, 8, ["modelValue", "loading", "row-data", "page-size", "page-count", "hide-footer"])
|
|
151
|
-
])
|
|
152
|
-
]),
|
|
153
|
-
_: 1
|
|
154
|
-
}, 8, ["modelValue"]);
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
var xe = { 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" };
|
|
159
|
-
const Ve = { class: "px-24 flex flex-col gap-y-16" }, ke = { class: "flex items-center justify-between w-full" }, Fe = { class: "flex gap-8 overflow-x-auto" }, Ie = { class: "space-y-8" }, Le = { class: "flex w-full gap-4 items-center" }, Me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Re = { class: "space-y-4" }, Pe = { class: "fm-typo-en-body-lg-600" }, Ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ee = { class: "flex gap-8 items-center" }, Ae = { class: "flex flex-col gap-16 text-center" }, Be = { class: "fm-typo-en-title-sm-800" }, Oe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, no = /* @__PURE__ */ X({
|
|
160
|
-
__name: "Voucher",
|
|
161
|
-
setup(Q) {
|
|
162
|
-
const { t: a } = ge(), A = {
|
|
163
|
-
label: a("connect.voucher.createCampaign"),
|
|
164
|
-
value: "create",
|
|
165
|
-
isPrimary: !0,
|
|
166
|
-
prependIcon: "add"
|
|
167
|
-
}, R = se(), P = ue("VOUCHER", R), v = ie(), b = re(), { global: g, minor: u } = W, U = ye(), m = _({
|
|
168
|
-
searchKey: "",
|
|
169
|
-
location: null
|
|
170
|
-
}), S = oe(
|
|
171
|
-
() => b.campaigns.voucher.filter(
|
|
172
|
-
(e) => !m.value.location || !e.targetLocation || e.targetLocation.includes(m.value.location)
|
|
173
|
-
)
|
|
174
|
-
), i = [
|
|
175
|
-
{
|
|
176
|
-
header: a("connect.voucher.voucherTitle"),
|
|
177
|
-
accessorFn: (e) => e.name
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
header: a("connect.voucher.status"),
|
|
181
|
-
cell(e) {
|
|
182
|
-
return D(e.row.original);
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
header: a("connect.voucher.summary"),
|
|
187
|
-
accessorFn: (e) => q(e)
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
header: a("connect.voucher.quota"),
|
|
191
|
-
accessorFn: (e) => {
|
|
192
|
-
var o;
|
|
193
|
-
return ((o = e.pf_collectible) == null ? void 0 : o.options.maxReceive) ?? "Unlimited";
|
|
194
|
-
}
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
header: a("connect.voucher.claimed"),
|
|
198
|
-
accessorFn: (e) => {
|
|
199
|
-
var o;
|
|
200
|
-
return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
|
|
201
|
-
}
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
header: a("connect.voucher.actions"),
|
|
205
|
-
cell(e) {
|
|
206
|
-
return C("div", { class: "flex items-center justify-end" }, [
|
|
207
|
-
C(V.FmButton, {
|
|
208
|
-
icon: "visibility",
|
|
209
|
-
variant: "tertiary",
|
|
210
|
-
iconColor: "neutral-gray-400",
|
|
211
|
-
onClick: async (o) => {
|
|
212
|
-
o.stopPropagation(), await U.push({
|
|
213
|
-
name: G["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
|
|
214
|
-
params: { id: e.row.original._id }
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
}),
|
|
218
|
-
C(
|
|
219
|
-
V.FmMenu,
|
|
220
|
-
{
|
|
221
|
-
placement: "bottom-end",
|
|
222
|
-
onClick: (o) => {
|
|
223
|
-
o.stopPropagation();
|
|
224
|
-
}
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
"menu-button": () => C(V.FmButton, {
|
|
228
|
-
icon: "more_vert",
|
|
229
|
-
iconColor: "neutral-gray-400",
|
|
230
|
-
variant: "tertiary"
|
|
231
|
-
}),
|
|
232
|
-
default: () => {
|
|
233
|
-
const o = [
|
|
234
|
-
C(
|
|
235
|
-
V.FmMenuItem,
|
|
236
|
-
{
|
|
237
|
-
onClick: async (s) => {
|
|
238
|
-
s.stopPropagation(), E(e.row.original);
|
|
239
|
-
}
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
label: C(
|
|
243
|
-
"div",
|
|
244
|
-
{
|
|
245
|
-
class: "text-fm-color-typo-error fm-typo-en-body-md-400"
|
|
246
|
-
},
|
|
247
|
-
a("connect.voucher.remove")
|
|
248
|
-
)
|
|
249
|
-
}
|
|
250
|
-
)
|
|
251
|
-
];
|
|
252
|
-
return e.row.original.event.type === "SIMPLE_CLAIM" && (o.unshift(
|
|
253
|
-
C(V.FmMenuItem, {
|
|
254
|
-
label: a("connect.voucher.send"),
|
|
255
|
-
onClick: async (s) => {
|
|
256
|
-
var d;
|
|
257
|
-
s.stopPropagation(), (d = w.value) == null || d.showSheet({
|
|
258
|
-
campaignId: e.row.original._id
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
})
|
|
262
|
-
), o.unshift(
|
|
263
|
-
C(V.FmMenuItem, {
|
|
264
|
-
label: a("connect.voucher.share"),
|
|
265
|
-
onClick: async (s) => {
|
|
266
|
-
if (s.stopPropagation(), e.row.original.event.type !== "SIMPLE_CLAIM")
|
|
267
|
-
return await z.confirm(
|
|
268
|
-
"Cannot share a voucher that is not a simple claim.",
|
|
269
|
-
"Share Voucher",
|
|
270
|
-
"OK"
|
|
271
|
-
);
|
|
272
|
-
await le(
|
|
273
|
-
`https://${ce().currentBusiness.value._id}.${xe.appUrl}/vouchers/${e.row.original._id}`,
|
|
274
|
-
{
|
|
275
|
-
successMessage: "Voucher link copied to clipboard"
|
|
276
|
-
}
|
|
277
|
-
);
|
|
278
|
-
}
|
|
279
|
-
})
|
|
280
|
-
)), o;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
)
|
|
284
|
-
]);
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
], f = _(), w = _();
|
|
288
|
-
async function E(e) {
|
|
289
|
-
await z.remove(a("voucher.confirmRemove", { name: e.name })) && await u(
|
|
290
|
-
async () => {
|
|
291
|
-
await L.delete(e._id), await b.read("VOUCHER");
|
|
292
|
-
},
|
|
293
|
-
{
|
|
294
|
-
message: a("voucher.removing", { name: e.name }),
|
|
295
|
-
successMessage: a("voucher.removedSuccessfully", { name: e.name })
|
|
296
|
-
}
|
|
297
|
-
);
|
|
298
|
-
}
|
|
299
|
-
async function x(e) {
|
|
300
|
-
e ? await o() : P.open(async (s) => {
|
|
301
|
-
await o(s);
|
|
302
|
-
});
|
|
303
|
-
async function o(s) {
|
|
304
|
-
var d;
|
|
305
|
-
(d = f.value) == null || d.showSheet(
|
|
306
|
-
!0,
|
|
307
|
-
"VOUCHER",
|
|
308
|
-
e ? await L.readById(e._id) : void 0,
|
|
309
|
-
s
|
|
310
|
-
);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
async function c(e) {
|
|
314
|
-
e.campaign._id && await new Promise((o) => {
|
|
315
|
-
R.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
|
-
var s;
|
|
322
|
-
e.updateCollections = !0, (s = window.top) == null || s.postMessage("updateAllVoucher", "*"), o();
|
|
323
|
-
}).onSecondary(async () => {
|
|
324
|
-
o();
|
|
325
|
-
});
|
|
326
|
-
}), await u(
|
|
327
|
-
async () => {
|
|
328
|
-
e.campaign._id ? await L.update(e.campaign._id, e) : await L.create(e), await b.read("VOUCHER");
|
|
329
|
-
},
|
|
330
|
-
{
|
|
331
|
-
message: a(
|
|
332
|
-
e.campaign._id ? "connect.voucher.updating" : "connect.voucher.creating"
|
|
333
|
-
),
|
|
334
|
-
successMessage: a(
|
|
335
|
-
e.campaign._id ? "connect.voucher.updatedSuccessfully" : "connect.voucher.createdSuccessfully"
|
|
336
|
-
)
|
|
337
|
-
}
|
|
338
|
-
);
|
|
339
|
-
}
|
|
340
|
-
return J(async () => {
|
|
341
|
-
await g(async () => {
|
|
342
|
-
await b.read("VOUCHER");
|
|
343
|
-
});
|
|
344
|
-
}), (e, o) => {
|
|
345
|
-
const s = h("FmPageHead"), d = h("FmSearch"), B = h("FmTable"), p = h("FmButton"), Z = h("FmListItem"), Y = h("FmList"), ee = h("FmCard");
|
|
346
|
-
return y(), $(T, null, [
|
|
347
|
-
r(s, {
|
|
348
|
-
title: t(a)("connect.voucher.title"),
|
|
349
|
-
actions: t(S).length > 0 ? [A] : [],
|
|
350
|
-
"onClick:action": o[0] || (o[0] = () => x())
|
|
351
|
-
}, null, 8, ["title", "actions"]),
|
|
352
|
-
l("div", Ve, [
|
|
353
|
-
r(d, {
|
|
354
|
-
modelValue: t(m).searchKey,
|
|
355
|
-
"onUpdate:modelValue": o[1] || (o[1] = (n) => t(m).searchKey = n),
|
|
356
|
-
class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
|
|
357
|
-
placeholder: t(a)("connect.voucher.search"),
|
|
358
|
-
collapsible: ""
|
|
359
|
-
}, null, 8, ["modelValue", "placeholder"]),
|
|
360
|
-
t(b).campaigns.voucher && t(b).campaigns.voucher.length > 0 ? (y(), $(T, { key: 0 }, [
|
|
361
|
-
l("div", ke, [
|
|
362
|
-
l("div", Fe, [
|
|
363
|
-
r(de, {
|
|
364
|
-
modelValue: t(m).location,
|
|
365
|
-
"onUpdate:modelValue": o[2] || (o[2] = (n) => t(m).location = n),
|
|
366
|
-
label: t(a)("connect.voucher.location"),
|
|
367
|
-
"show-item-label": !0,
|
|
368
|
-
icon: "storefront",
|
|
369
|
-
placement: "bottom-start",
|
|
370
|
-
items: t(v).locationItems
|
|
371
|
-
}, null, 8, ["modelValue", "label", "items"])
|
|
372
|
-
]),
|
|
373
|
-
r(d, {
|
|
374
|
-
modelValue: t(m).searchKey,
|
|
375
|
-
"onUpdate:modelValue": o[3] || (o[3] = (n) => t(m).searchKey = n),
|
|
376
|
-
class: "xs:hidden",
|
|
377
|
-
placeholder: t(a)("connect.voucher.search"),
|
|
378
|
-
collapsible: ""
|
|
379
|
-
}, null, 8, ["modelValue", "placeholder"])
|
|
380
|
-
]),
|
|
381
|
-
r(B, {
|
|
382
|
-
class: "xs:hidden",
|
|
383
|
-
"row-data": t(S),
|
|
384
|
-
"column-defs": i,
|
|
385
|
-
"search-value": t(m).searchKey,
|
|
386
|
-
"column-filter": [],
|
|
387
|
-
onRowClick: o[4] || (o[4] = (n) => x(n.original)),
|
|
388
|
-
"hide-footer": t(S).length < 10
|
|
389
|
-
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
390
|
-
r(Y, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
|
|
391
|
-
default: M(() => [
|
|
392
|
-
(y(!0), $(T, null, te(t(S).filter(
|
|
393
|
-
(n) => n.name.toLowerCase().includes(t(m).searchKey.toLowerCase())
|
|
394
|
-
), (n) => (y(), k(Z, {
|
|
395
|
-
key: n._id.toString(),
|
|
396
|
-
onClick: (O) => x(n),
|
|
397
|
-
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
398
|
-
}, {
|
|
399
|
-
default: M(() => {
|
|
400
|
-
var O;
|
|
401
|
-
return [
|
|
402
|
-
l("div", Ie, [
|
|
403
|
-
l("div", Le, [
|
|
404
|
-
(y(), k(ae(t(D)(n)))),
|
|
405
|
-
l("div", Me, F(((O = n.pf_collectible) == null ? void 0 : O.currentReceive) ?? 0) + " claimed ", 1)
|
|
406
|
-
]),
|
|
407
|
-
l("div", Re, [
|
|
408
|
-
l("div", Pe, F(n.name), 1),
|
|
409
|
-
l("div", Ue, F(t(q)(n)), 1)
|
|
410
|
-
])
|
|
411
|
-
]),
|
|
412
|
-
l("div", Ee, [
|
|
413
|
-
n.event.type === "SIMPLE_CLAIM" ? (y(), k(p, {
|
|
414
|
-
key: 0,
|
|
415
|
-
icon: "visibility",
|
|
416
|
-
"icon-color": "neutral-gray-400",
|
|
417
|
-
variant: "tertiary",
|
|
418
|
-
onClick: async (I) => {
|
|
419
|
-
I.stopPropagation(), await t(U).push({
|
|
420
|
-
name: t(G)["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
|
|
421
|
-
params: { id: n._id }
|
|
422
|
-
});
|
|
423
|
-
}
|
|
424
|
-
}, null, 8, ["onClick"])) : K("", !0),
|
|
425
|
-
n.event.type === "SIMPLE_CLAIM" ? (y(), k(p, {
|
|
426
|
-
key: 1,
|
|
427
|
-
icon: "send",
|
|
428
|
-
"icon-color": "neutral-gray-400",
|
|
429
|
-
variant: "tertiary",
|
|
430
|
-
onClick: (I) => {
|
|
431
|
-
var H;
|
|
432
|
-
I.stopPropagation(), (H = t(w)) == null || H.showSheet({
|
|
433
|
-
campaignId: n._id
|
|
434
|
-
});
|
|
435
|
-
}
|
|
436
|
-
}, null, 8, ["onClick"])) : K("", !0),
|
|
437
|
-
r(p, {
|
|
438
|
-
icon: "delete",
|
|
439
|
-
"icon-color": "neutral-gray-400",
|
|
440
|
-
variant: "tertiary",
|
|
441
|
-
onClick: (I) => (I.stopPropagation(), E(n))
|
|
442
|
-
}, null, 8, ["onClick"])
|
|
443
|
-
])
|
|
444
|
-
];
|
|
445
|
-
}),
|
|
446
|
-
_: 2
|
|
447
|
-
}, 1032, ["onClick"]))), 128))
|
|
448
|
-
]),
|
|
449
|
-
_: 1
|
|
450
|
-
})
|
|
451
|
-
], 64)) : (y(), k(ee, {
|
|
452
|
-
key: 1,
|
|
453
|
-
variant: "outlined",
|
|
454
|
-
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
455
|
-
}, {
|
|
456
|
-
default: M(() => [
|
|
457
|
-
o[6] || (o[6] = l("img", {
|
|
458
|
-
src: ne,
|
|
459
|
-
class: "aspect-square w-[150px]"
|
|
460
|
-
}, null, -1)),
|
|
461
|
-
l("div", Ae, [
|
|
462
|
-
l("div", Be, F(t(a)("connect.voucher.createVoucherCampaign")), 1),
|
|
463
|
-
l("div", Oe, F(t(a)("connect.voucher.description")), 1)
|
|
464
|
-
]),
|
|
465
|
-
r(p, {
|
|
466
|
-
variant: "primary",
|
|
467
|
-
label: t(a)("connect.voucher.createVoucherCampaign"),
|
|
468
|
-
icon: "add",
|
|
469
|
-
onClick: o[5] || (o[5] = (n) => x())
|
|
470
|
-
}, null, 8, ["label"])
|
|
471
|
-
]),
|
|
472
|
-
_: 1
|
|
473
|
-
})),
|
|
474
|
-
r(me, {
|
|
475
|
-
ref_key: "sheetRef",
|
|
476
|
-
ref: f,
|
|
477
|
-
"onSubmit:modelValue": c
|
|
478
|
-
}, null, 512),
|
|
479
|
-
r(Se, {
|
|
480
|
-
ref_key: "sendVoucherSheetRef",
|
|
481
|
-
ref: w
|
|
482
|
-
}, null, 512)
|
|
483
|
-
])
|
|
484
|
-
], 64);
|
|
485
|
-
};
|
|
486
|
-
}
|
|
487
|
-
});
|
|
488
|
-
export {
|
|
489
|
-
no as default
|
|
490
|
-
};
|