@feedmepos/mf-connect 0.1.0-beta.8 → 0.1.0-beta.80
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-C84B4MSt.js +427 -0
- package/dist/{App-SRz4257n.js → App-CnbbBVSn.js} +441 -420
- package/dist/AuditLogs-KOxiG5Q0.js +1887 -0
- package/dist/Bin-BBSQDzD4.js +166 -0
- package/dist/{Broadcast-DmkrJGp2.js → Broadcast-DlvPEqW7.js} +56 -54
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CZXSxA9u.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-M1Za3MaN.js} +14 -10
- package/dist/Card-BluWm_EY.js +905 -0
- package/dist/Collections-DtHJpxRT.js +464 -0
- package/dist/{Credit-CcNrq9qk.js → Credit-Be2pcBVn.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-sqq_sO_a.js +2182 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BIZDiLns.js → EffectSheet.vue_vue_type_style_index_0_lang-CBsYx54P.js} +49 -49
- package/dist/{Experience-DNsQLzDH.js → Experience-CLPyvgs0.js} +32 -30
- package/dist/FileSaver.min-NlMItPOc.js +74 -0
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js +118 -0
- package/dist/Game-5kEG7o4J.js +278 -0
- package/dist/Index-BSZi21Wo.js +259 -0
- package/dist/Marketing-CE1Sq3Pb.js +20071 -0
- package/dist/Member-DaBqmOYX.js +287 -0
- package/dist/MemberList-jIriR6B0.js +1606 -0
- package/dist/MemberTransactions-BGEZwpPO.js +45 -0
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-GCEQCVOt.js → MessageInput.vue_vue_type_script_setup_true_lang-CSlafowP.js} +152 -137
- package/dist/Mission-BOByUsYC.js +296 -0
- package/dist/Overview-BQQs8TsL.js +1079 -0
- package/dist/{Point-Ck8EG_3k.js → Point-BuRBh_HC.js} +55 -53
- package/dist/Promotion-Py2WWNt0.js +289 -0
- package/dist/Queue-On8_svkl.js +260 -0
- package/dist/Record-CSWkHs9Y.js +341 -0
- package/dist/Reward-BLVyFkAH.js +442 -0
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-BW8kuoLt.js +150 -0
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DC8JEmEC.js +1728 -0
- package/dist/Segment-BjBskgf9.js +880 -0
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-CrVw6j2M.js +181 -0
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-oaAVUxO4.js +188 -0
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-CKOTgzL-.js +147 -0
- package/dist/Setting-CAMlhgGd.js +1932 -0
- package/dist/Store-0qvNbHne.js +1842 -0
- package/dist/StoreRewards-CjcHvUNa.js +423 -0
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CdZ7QIaf.js +1029 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DrzmjYmU.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-vJaZIDrx.js} +1 -1
- package/dist/{Tier-CJ9-d8Zg.js → Tier-D_pHKGSv.js} +350 -334
- package/dist/{Title-DZCpvg4q.js → Title-DgdtJ87h.js} +245 -222
- package/dist/{Transaction-DpnTxlbf.js → Transaction-CKlLWcjS.js} +2 -2
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-2GOvljvv.js +130 -0
- package/dist/Voucher-Cg6zQSAy.js +354 -0
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-rpjQkheM.js +419 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-SukfoJpU.js → ZodTextField.vue_vue_type_script_setup_true_lang-BRdY-P8U.js} +1 -1
- package/dist/{app-DzAexOqx.js → app-CScRp4SA.js} +2709 -1265
- package/dist/app-jGYefKeR.js +33357 -0
- package/dist/app.js +1 -1
- package/dist/business-DYhO4gjc.js +79 -0
- package/dist/campaign-BgXy1Ngd.js +1810 -0
- package/dist/{campaign-winsqufa.js → campaign-CZ5pMrUu.js} +2 -2
- package/dist/campaign.enum-CWBDlzqp.js +20 -0
- package/dist/campaign.fn-HHZ5mQKe.js +758 -0
- package/dist/collectible.enum-MvoLHpuA.js +19 -0
- package/dist/{collection.fn-CI5Llblg.js → collection.fn-BHUoLJPj.js} +2 -2
- package/dist/dto-DXdR0em1.js +214 -0
- package/dist/{effect-CdkrIYgX.js → effect-HLuo1A_f.js} +33 -16
- package/dist/email-addresses-DU4ehcHM.js +705 -0
- package/dist/{export-DGxfief1.js → export-BDRHAxZr.js} +5 -5
- package/dist/{helper-B8RqcTNu.js → helper-JhFOw8n-.js} +1 -1
- package/dist/{index-OzicErwL.js → index-BG_GpbnZ.js} +24 -21
- package/dist/{index-Cw_aXFH6.js → index-BZWr1bgh.js} +269 -173
- package/dist/{loading-DuEFUCwF.js → index-Bs-tzd5F.js} +4609 -4886
- package/dist/{index-wzdbEEcZ.js → index-C2nNcNjw.js} +1 -1
- package/dist/index-CIF8DeC8.js +54 -0
- package/dist/{index-HZC9LLAX.js → index-CqT8uK3R.js} +48 -4
- package/dist/index-CsaQJMAR.js +66 -0
- package/dist/{index-9w43_U1v.js → index-DVj1MyZp.js} +1506 -1480
- package/dist/{index-CZgQVRsm.js → index-GmHsjd7O.js} +1 -1
- package/dist/index-QDEKR2Rj.js +115 -0
- package/dist/{index-A34xEz20.js → index-cYKPj4fA.js} +2246 -871
- package/dist/index-eRBO4PzZ.js +56 -0
- package/dist/index-fS6fmvFv.js +29556 -0
- package/dist/index-l8E6r07W.js +32 -0
- package/dist/index-vh86FiIQ.js +10 -0
- package/dist/{index.esm2017-CppSMh_U.js → index.esm2017-B-YrQ0sw.js} +206 -206
- package/dist/loading-C09t0mFj.js +71 -0
- package/dist/{membership-nsMtWeTC.js → membership-tHAn3VRs.js} +80 -66
- package/dist/money-DYVCca49.js +15 -0
- package/dist/number-VYuUME2F.js +12 -0
- package/dist/objectid-BTO4csVa.js +145 -0
- package/dist/plugins-CXgvBDMF.js +208 -0
- package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
- package/dist/reward-DX9TZrk4.js +36 -0
- package/dist/{rule-CPIMqt1h.js → rule-CbCZqulx.js} +185 -178
- package/dist/{rule-builder-CSs5XRKP.js → rule-builder-J8K_fjI-.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{template-CJZoYavu.js → template-BtYJpEBa.js} +5 -5
- package/dist/trigger-D6dpZFSN.js +144 -0
- package/dist/user-C0QvWk-o.js +54 -0
- package/dist/vue-i18n-cz2_cPSz.js +2365 -0
- package/dist/{xlsx-BZlnYinX.js → xlsx-BIPQrY49.js} +1 -1
- package/package.json +11 -7
- package/dist/Analytic-5QztrYSp.js +0 -622
- package/dist/Card-BsjFTVsH.js +0 -825
- package/dist/Collections-7wqZHOax.js +0 -453
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Cuklmxur.js +0 -2813
- package/dist/Game-DlzDerT7.js +0 -255
- package/dist/Marketing-BqhpaG4o.js +0 -316
- package/dist/Member-AFgZcdtz.js +0 -69
- package/dist/MemberList-BKgrLz2C.js +0 -1733
- package/dist/MemberTransactions-BwT3zE2a.js +0 -38
- package/dist/Mission-BTAia7AS.js +0 -261
- package/dist/Promotion-0v3kvsK3.js +0 -247
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BkFm7tXq.js +0 -1753
- package/dist/Segment-BenLupqV.js +0 -437
- package/dist/Setting-0fpREqpJ.js +0 -1901
- package/dist/Store-BDGwe4ar.js +0 -1511
- package/dist/StoreRewards-TDZt9H1V.js +0 -401
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BqpsMcl1.js +0 -890
- package/dist/Voucher-DsP_rh8I.js +0 -490
- package/dist/app-Cg2pTZJK.js +0 -53428
- package/dist/business-Cw_qGw8y.js +0 -78
- package/dist/dto-ozu1smC3.js +0 -2770
- package/dist/index-BLACZ3-L.js +0 -206
- package/dist/index-BaozRfWB.js +0 -762
- package/dist/index-CjVmULNd.js +0 -99
- package/dist/index-CuvNtC_M.js +0 -61
- package/dist/index-DAEmawcj.js +0 -298
- package/dist/index-Oxr-mU6h.js +0 -29193
- package/dist/money-BGZPFtUc.js +0 -15
- package/dist/number-4J0xvXP9.js +0 -12
- package/dist/user-Bm4KttFq.js +0 -37
- package/dist/vue-i18n-CCyiVzOE.js +0 -2365
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as d, ref as f, resolveComponent as s, openBlock as t, createElementBlock as v, Fragment as b, createVNode as r, unref as o, createElementVNode as k, createBlock as l, KeepAlive as x, resolveDynamicComponent as m, createCommentVNode as F } from "vue";
|
|
2
|
-
import { _ as g, a as y } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-
|
|
3
|
-
import { u as C } from "./vue-i18n-
|
|
2
|
+
import { _ as g, a as y } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-CdZ7QIaf.js";
|
|
3
|
+
import { u as C } from "./vue-i18n-cz2_cPSz.js";
|
|
4
4
|
const T = { class: "px-24 flex flex-col gap-y-32 pb-24" }, P = /* @__PURE__ */ d({
|
|
5
5
|
__name: "Transaction",
|
|
6
6
|
setup(V) {
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { defineComponent as y, computed as b, openBlock as i, createBlock as R, unref as l, ref as E, watch as k, resolveComponent as h, createElementBlock as g, createElementVNode as B, Fragment as O, renderList as T, createVNode as V, isRef as U, createCommentVNode as v } from "vue";
|
|
2
|
+
import "./index-DVj1MyZp.js";
|
|
3
|
+
import { i as C, R as e } from "./rule-builder-J8K_fjI-.js";
|
|
4
|
+
import { _ as I } from "./RuleGroup.vue_vue_type_script_setup_true_lang-DC8JEmEC.js";
|
|
5
|
+
import { p as N } from "./plugins-CXgvBDMF.js";
|
|
6
|
+
import { u as S } from "./membership-tHAn3VRs.js";
|
|
7
|
+
import { _ as j } from "./CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js";
|
|
8
|
+
import { u as x } from "./vue-i18n-cz2_cPSz.js";
|
|
9
|
+
const A = /* @__PURE__ */ y({
|
|
10
|
+
__name: "SegmentConfigurator",
|
|
11
|
+
props: {
|
|
12
|
+
modelValue: {
|
|
13
|
+
type: Object,
|
|
14
|
+
required: !0
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
emits: ["update:model-value"],
|
|
18
|
+
setup(n, { emit: f }) {
|
|
19
|
+
const o = n, m = b(() => {
|
|
20
|
+
var s;
|
|
21
|
+
const [u] = C(o.modelValue) ? Object.values(((s = o.modelValue) == null ? void 0 : s.rules) ?? {}) : [null];
|
|
22
|
+
return (u ?? e.constructEntry("user.segment", "_hasAny", [])).conditions._hasAny;
|
|
23
|
+
}), r = f;
|
|
24
|
+
return (u, c) => (i(), R(j, {
|
|
25
|
+
multiselect: !0,
|
|
26
|
+
items: l(S)().segmentOptions,
|
|
27
|
+
"model-value": l(m),
|
|
28
|
+
"onUpdate:modelValue": c[0] || (c[0] = (s) => r(
|
|
29
|
+
"update:model-value",
|
|
30
|
+
l(e).setRuleToGroup(
|
|
31
|
+
l(e).scaffoldGroup("g_segment"),
|
|
32
|
+
l(e).constructEntry("user.segment", "_hasAny", s)
|
|
33
|
+
)
|
|
34
|
+
)),
|
|
35
|
+
label: "Select segment(s) to match"
|
|
36
|
+
}, null, 8, ["items", "model-value"]));
|
|
37
|
+
}
|
|
38
|
+
}), F = { class: "space-y-16" }, M = { key: 0 }, z = /* @__PURE__ */ y({
|
|
39
|
+
__name: "UserRuleGroup",
|
|
40
|
+
props: {
|
|
41
|
+
modelValue: {
|
|
42
|
+
type: Object,
|
|
43
|
+
default: () => {
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
emits: ["update:model-value"],
|
|
48
|
+
setup(n, { emit: f }) {
|
|
49
|
+
const { t: o } = x(), m = n, r = f, u = E(
|
|
50
|
+
m.modelValue ? e.getRules(m.modelValue.rules.g_user).length > 0 ? "custom" : e.getRules(m.modelValue.rules.g_segment).length > 0 ? "segment" : "all_users" : "all_users"
|
|
51
|
+
), c = [
|
|
52
|
+
{
|
|
53
|
+
value: "all_users",
|
|
54
|
+
label: o("connect.template.rule.audience.all")
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
value: "segment",
|
|
58
|
+
label: o("connect.template.rule.audience.member_segment")
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
value: "custom",
|
|
62
|
+
label: o("connect.template.rule.audience.custom_audience")
|
|
63
|
+
}
|
|
64
|
+
];
|
|
65
|
+
return k(u, async (s, t) => {
|
|
66
|
+
var p;
|
|
67
|
+
if (t != "all_users" && t != s && e.getRules(
|
|
68
|
+
(p = m.modelValue) == null ? void 0 : p.rules[t == "custom" ? "g_user" : "g_segment"]
|
|
69
|
+
).length > 0) {
|
|
70
|
+
const d = await N.confirm(
|
|
71
|
+
o("connect.template.rule.audience.confirm_remove"),
|
|
72
|
+
o("connect.common.confirm"),
|
|
73
|
+
o("connect.common.confirm"),
|
|
74
|
+
o("connect.common.cancel")
|
|
75
|
+
);
|
|
76
|
+
d && r(
|
|
77
|
+
"update:model-value",
|
|
78
|
+
e.setRuleToGroup(
|
|
79
|
+
m.modelValue ?? e.scaffoldGroup(),
|
|
80
|
+
e.scaffoldGroup(t == "custom" ? "g_user" : "g_segment")
|
|
81
|
+
)
|
|
82
|
+
), u.value = d ? s : t;
|
|
83
|
+
}
|
|
84
|
+
}), (s, t) => {
|
|
85
|
+
var d, _;
|
|
86
|
+
const p = h("FmRadio");
|
|
87
|
+
return i(), g("div", F, [
|
|
88
|
+
B("div", null, [
|
|
89
|
+
(i(), g(O, null, T(c, (a) => V(p, {
|
|
90
|
+
key: a.value,
|
|
91
|
+
value: a.value,
|
|
92
|
+
label: a.label,
|
|
93
|
+
modelValue: l(u),
|
|
94
|
+
"onUpdate:modelValue": t[0] || (t[0] = (G) => U(u) ? u.value = G : null)
|
|
95
|
+
}, null, 8, ["value", "label", "modelValue"])), 64))
|
|
96
|
+
]),
|
|
97
|
+
l(u) == "segment" ? (i(), g("div", M, [
|
|
98
|
+
V(A, {
|
|
99
|
+
modelValue: ((d = n.modelValue) == null ? void 0 : d.rules.g_segment) ?? l(e).scaffoldGroup("g_segment"),
|
|
100
|
+
"onUpdate:modelValue": t[1] || (t[1] = (a) => r(
|
|
101
|
+
"update:model-value",
|
|
102
|
+
l(e).setRuleToGroup(
|
|
103
|
+
n.modelValue ?? l(e).scaffoldGroup(),
|
|
104
|
+
a,
|
|
105
|
+
"&&"
|
|
106
|
+
)
|
|
107
|
+
))
|
|
108
|
+
}, null, 8, ["modelValue"])
|
|
109
|
+
])) : v("", !0),
|
|
110
|
+
l(u) == "custom" ? (i(), R(I, {
|
|
111
|
+
key: 1,
|
|
112
|
+
"include-only": "user",
|
|
113
|
+
"trigger-type": "MEMBERSHIP_JOINED",
|
|
114
|
+
"model-value": ((_ = n.modelValue) == null ? void 0 : _.rules.g_user) ?? l(e).scaffoldGroup("g_user"),
|
|
115
|
+
"onUpdate:modelValue": t[2] || (t[2] = (a) => r(
|
|
116
|
+
"update:model-value",
|
|
117
|
+
l(e).setRuleToGroup(
|
|
118
|
+
n.modelValue ?? l(e).scaffoldGroup(),
|
|
119
|
+
a,
|
|
120
|
+
"&&"
|
|
121
|
+
)
|
|
122
|
+
))
|
|
123
|
+
}, null, 8, ["model-value"])) : v("", !0)
|
|
124
|
+
]);
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
export {
|
|
129
|
+
z as _
|
|
130
|
+
};
|
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
import { defineComponent as z, ref as k, computed as Q, h as m, onMounted as Z, resolveComponent as d, openBlock as u, createElementBlock as S, Fragment as F, createVNode as s, unref as t, createElementVNode as r, withCtx as V, renderList as J, createBlock as y, resolveDynamicComponent as Y, toDisplayString as g, createCommentVNode as E } from "vue";
|
|
2
|
+
import { _ as ee } from "./campaign-CpzFl8Vr.js";
|
|
3
|
+
import { useDialog as oe, components as f } from "@feedmepos/ui-library";
|
|
4
|
+
import { p as A, a as te } from "./plugins-CXgvBDMF.js";
|
|
5
|
+
import { useCoreStore as ae } from "@feedmepos/mf-common";
|
|
6
|
+
import { u as ne } from "./loading-C09t0mFj.js";
|
|
7
|
+
import { u as ce } from "./business-DYhO4gjc.js";
|
|
8
|
+
import { u as re } from "./campaign-CZ5pMrUu.js";
|
|
9
|
+
import { g as ie, a as B, b as O } from "./campaign-BgXy1Ngd.js";
|
|
10
|
+
import "./index-GmHsjd7O.js";
|
|
11
|
+
import { u as se } from "./template-BtYJpEBa.js";
|
|
12
|
+
import { _ as le } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-sqq_sO_a.js";
|
|
13
|
+
import { _ as me } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
14
|
+
import { _ as ue } from "./SendVoucherSheet.vue_vue_type_script_setup_true_lang-CKOTgzL-.js";
|
|
15
|
+
import { u as de } from "./vue-i18n-cz2_cPSz.js";
|
|
16
|
+
import { useRouter as pe } from "vue-router";
|
|
17
|
+
import { c as w } from "./index-QDEKR2Rj.js";
|
|
18
|
+
import { R as H } from "./app-CScRp4SA.js";
|
|
19
|
+
var fe = { 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", licensePortalUrl: "https://license.feedmedev.cc/", marketingV1Portal: "https://marketing-v1.feedmedev.cc" };
|
|
20
|
+
const he = { class: "px-24 flex flex-col gap-y-16" }, ye = { class: "flex items-center justify-between w-full" }, ge = { class: "flex gap-8 overflow-x-auto" }, _e = { class: "space-y-8" }, ve = { class: "flex w-full gap-4 items-center" }, Ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, we = { class: "space-y-4" }, be = { class: "fm-typo-en-body-lg-600" }, xe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ke = { class: "flex gap-8 items-center" }, Se = { class: "flex flex-col gap-16 text-center" }, Fe = { class: "fm-typo-en-title-sm-800" }, Ve = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Xe = /* @__PURE__ */ z({
|
|
21
|
+
__name: "Voucher",
|
|
22
|
+
setup(Ie) {
|
|
23
|
+
const { t: a } = de(), T = {
|
|
24
|
+
label: a("connect.voucher.createCampaign"),
|
|
25
|
+
value: "create",
|
|
26
|
+
isPrimary: !0,
|
|
27
|
+
prependIcon: "add"
|
|
28
|
+
}, I = oe(), $ = se("VOUCHER", I), K = ce(), p = re(), { global: N, minor: L } = ne, P = pe(), i = k({
|
|
29
|
+
searchKey: "",
|
|
30
|
+
location: null
|
|
31
|
+
}), _ = Q(
|
|
32
|
+
() => p.campaigns.voucher.filter(
|
|
33
|
+
(e) => !i.value.location || !e.targetLocation || e.targetLocation.includes(i.value.location)
|
|
34
|
+
)
|
|
35
|
+
), D = [
|
|
36
|
+
{
|
|
37
|
+
header: a("connect.voucher.voucherTitle"),
|
|
38
|
+
accessorFn: (e) => e.name
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
header: a("connect.voucher.status"),
|
|
42
|
+
accessorFn: (e) => ie(e),
|
|
43
|
+
cell(e) {
|
|
44
|
+
return B(e.row.original);
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
header: a("connect.voucher.summary"),
|
|
49
|
+
accessorFn: (e) => O(e)
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
header: a("connect.voucher.quota"),
|
|
53
|
+
accessorFn: (e) => {
|
|
54
|
+
var o;
|
|
55
|
+
return ((o = e.pf_collectible) == null ? void 0 : o.options.maxReceive) ?? "Unlimited";
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
header: a("connect.voucher.claimed"),
|
|
60
|
+
accessorFn: (e) => {
|
|
61
|
+
var o;
|
|
62
|
+
return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
header: a("connect.voucher.actions"),
|
|
67
|
+
cell(e) {
|
|
68
|
+
return m("div", { class: "flex items-center justify-end" }, [
|
|
69
|
+
m(f.FmButton, {
|
|
70
|
+
icon: "visibility",
|
|
71
|
+
variant: "tertiary",
|
|
72
|
+
iconColor: "neutral-gray-400",
|
|
73
|
+
onClick: async (o) => {
|
|
74
|
+
o.stopPropagation(), await P.push({
|
|
75
|
+
name: H["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
|
|
76
|
+
params: { id: e.row.original._id }
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}),
|
|
80
|
+
m(
|
|
81
|
+
f.FmMenu,
|
|
82
|
+
{
|
|
83
|
+
placement: "bottom-end",
|
|
84
|
+
onClick: (o) => {
|
|
85
|
+
o.stopPropagation();
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"menu-button": () => m(f.FmButton, {
|
|
90
|
+
icon: "more_vert",
|
|
91
|
+
iconColor: "neutral-gray-400",
|
|
92
|
+
variant: "tertiary"
|
|
93
|
+
}),
|
|
94
|
+
default: () => {
|
|
95
|
+
const o = [
|
|
96
|
+
m(
|
|
97
|
+
f.FmMenuItem,
|
|
98
|
+
{
|
|
99
|
+
onClick: async (c) => {
|
|
100
|
+
c.stopPropagation(), M(e.row.original);
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
label: m(
|
|
105
|
+
"div",
|
|
106
|
+
{
|
|
107
|
+
class: "text-fm-color-typo-error fm-typo-en-body-md-400"
|
|
108
|
+
},
|
|
109
|
+
a("connect.voucher.remove")
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
];
|
|
114
|
+
return e.row.original.event.type === "SIMPLE_CLAIM" && (o.unshift(
|
|
115
|
+
m(f.FmMenuItem, {
|
|
116
|
+
label: a("connect.voucher.send"),
|
|
117
|
+
onClick: async (c) => {
|
|
118
|
+
var l;
|
|
119
|
+
c.stopPropagation(), (l = b.value) == null || l.showSheet({
|
|
120
|
+
campaignId: e.row.original._id
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
})
|
|
124
|
+
), o.unshift(
|
|
125
|
+
m(f.FmMenuItem, {
|
|
126
|
+
label: a("connect.voucher.share"),
|
|
127
|
+
onClick: async (c) => {
|
|
128
|
+
if (c.stopPropagation(), e.row.original.event.type !== "SIMPLE_CLAIM")
|
|
129
|
+
return await A.confirm(
|
|
130
|
+
"Cannot share a voucher that is not a simple claim.",
|
|
131
|
+
"Share Voucher",
|
|
132
|
+
"OK"
|
|
133
|
+
);
|
|
134
|
+
await te(
|
|
135
|
+
`https://${ae().currentBusiness.value._id}.${fe.appUrl}/vouchers/${e.row.original._id}`,
|
|
136
|
+
{
|
|
137
|
+
successMessage: "Voucher link copied to clipboard"
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
})
|
|
142
|
+
)), o;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
)
|
|
146
|
+
]);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
], U = k(), b = k();
|
|
150
|
+
async function M(e) {
|
|
151
|
+
await A.remove(a("connect.voucher.confirmRemove", { name: e.name })) && await L(
|
|
152
|
+
async () => {
|
|
153
|
+
await w.delete(e._id), await p.read("VOUCHER");
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
message: a("connect.voucher.removing", { name: e.name }),
|
|
157
|
+
successMessage: a("connect.voucher.removedSuccessfully", {
|
|
158
|
+
name: e.name
|
|
159
|
+
})
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
async function v(e) {
|
|
164
|
+
e ? await o() : $.open(async (c) => {
|
|
165
|
+
await o(c);
|
|
166
|
+
});
|
|
167
|
+
async function o(c) {
|
|
168
|
+
var l;
|
|
169
|
+
(l = U.value) == null || l.showSheet(
|
|
170
|
+
!0,
|
|
171
|
+
"VOUCHER",
|
|
172
|
+
e ? await w.readById(e._id) : void 0,
|
|
173
|
+
c
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
async function j(e) {
|
|
178
|
+
e.campaign._id && await new Promise((o) => {
|
|
179
|
+
I.open({
|
|
180
|
+
title: "Confirmation",
|
|
181
|
+
message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
|
|
182
|
+
primaryActions: { text: "Update all", close: !0 },
|
|
183
|
+
secondaryActions: { text: "Update future only", close: !0 }
|
|
184
|
+
}).onPrimary(async () => {
|
|
185
|
+
var c;
|
|
186
|
+
e.updateCollections = !0, (c = window.top) == null || c.postMessage("updateAllVoucher", "*"), o();
|
|
187
|
+
}).onSecondary(async () => {
|
|
188
|
+
o();
|
|
189
|
+
});
|
|
190
|
+
}), await L(
|
|
191
|
+
async () => {
|
|
192
|
+
e.campaign._id ? await w.update(e.campaign._id, e) : await w.create(e), await p.read("VOUCHER");
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
message: a(
|
|
196
|
+
e.campaign._id ? "connect.voucher.updating" : "connect.voucher.creating"
|
|
197
|
+
),
|
|
198
|
+
successMessage: a(
|
|
199
|
+
e.campaign._id ? "connect.voucher.updatedSuccessfully" : "connect.voucher.createdSuccessfully"
|
|
200
|
+
)
|
|
201
|
+
}
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
return Z(async () => {
|
|
205
|
+
await N(async () => {
|
|
206
|
+
await p.read("VOUCHER");
|
|
207
|
+
});
|
|
208
|
+
}), (e, o) => {
|
|
209
|
+
const c = d("FmPageHead"), l = d("FmSearch"), q = d("FmTable"), C = d("FmButton"), G = d("FmListItem"), X = d("FmList"), W = d("FmCard");
|
|
210
|
+
return u(), S(F, null, [
|
|
211
|
+
s(c, {
|
|
212
|
+
title: t(a)("connect.voucher.title"),
|
|
213
|
+
actions: t(_).length > 0 ? [T] : [],
|
|
214
|
+
"onClick:action": o[0] || (o[0] = () => v())
|
|
215
|
+
}, null, 8, ["title", "actions"]),
|
|
216
|
+
r("div", he, [
|
|
217
|
+
s(l, {
|
|
218
|
+
modelValue: t(i).searchKey,
|
|
219
|
+
"onUpdate:modelValue": o[1] || (o[1] = (n) => t(i).searchKey = n),
|
|
220
|
+
class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
|
|
221
|
+
placeholder: t(a)("connect.voucher.search"),
|
|
222
|
+
collapsible: ""
|
|
223
|
+
}, null, 8, ["modelValue", "placeholder"]),
|
|
224
|
+
t(p).campaigns.voucher && t(p).campaigns.voucher.length > 0 ? (u(), S(F, { key: 0 }, [
|
|
225
|
+
r("div", ye, [
|
|
226
|
+
r("div", ge, [
|
|
227
|
+
s(me, {
|
|
228
|
+
modelValue: t(i).location,
|
|
229
|
+
"onUpdate:modelValue": o[2] || (o[2] = (n) => t(i).location = n),
|
|
230
|
+
label: t(a)("connect.voucher.location"),
|
|
231
|
+
"show-item-label": !0,
|
|
232
|
+
icon: "storefront",
|
|
233
|
+
placement: "bottom-start",
|
|
234
|
+
items: t(K).locationItems
|
|
235
|
+
}, null, 8, ["modelValue", "label", "items"])
|
|
236
|
+
]),
|
|
237
|
+
s(l, {
|
|
238
|
+
modelValue: t(i).searchKey,
|
|
239
|
+
"onUpdate:modelValue": o[3] || (o[3] = (n) => t(i).searchKey = n),
|
|
240
|
+
class: "xs:hidden",
|
|
241
|
+
placeholder: t(a)("connect.voucher.search"),
|
|
242
|
+
collapsible: ""
|
|
243
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
244
|
+
]),
|
|
245
|
+
s(q, {
|
|
246
|
+
class: "xs:hidden",
|
|
247
|
+
"row-data": t(_),
|
|
248
|
+
"column-defs": D,
|
|
249
|
+
"search-value": t(i).searchKey,
|
|
250
|
+
"column-filter": [],
|
|
251
|
+
onRowClick: o[4] || (o[4] = (n) => v(n.original)),
|
|
252
|
+
"hide-footer": t(_).length < 10
|
|
253
|
+
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
254
|
+
s(X, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
|
|
255
|
+
default: V(() => [
|
|
256
|
+
(u(!0), S(F, null, J(t(_).filter(
|
|
257
|
+
(n) => n.name.toLowerCase().includes(t(i).searchKey.toLowerCase())
|
|
258
|
+
), (n) => (u(), y(G, {
|
|
259
|
+
key: n._id.toString(),
|
|
260
|
+
onClick: (x) => v(n),
|
|
261
|
+
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
262
|
+
}, {
|
|
263
|
+
default: V(() => {
|
|
264
|
+
var x;
|
|
265
|
+
return [
|
|
266
|
+
r("div", _e, [
|
|
267
|
+
r("div", ve, [
|
|
268
|
+
(u(), y(Y(t(B)(n)))),
|
|
269
|
+
r("div", Ce, g(((x = n.pf_collectible) == null ? void 0 : x.currentReceive) ?? 0) + " claimed ", 1)
|
|
270
|
+
]),
|
|
271
|
+
r("div", we, [
|
|
272
|
+
r("div", be, g(n.name), 1),
|
|
273
|
+
r("div", xe, g(t(O)(n)), 1)
|
|
274
|
+
])
|
|
275
|
+
]),
|
|
276
|
+
r("div", ke, [
|
|
277
|
+
n.event.type === "SIMPLE_CLAIM" ? (u(), y(C, {
|
|
278
|
+
key: 0,
|
|
279
|
+
icon: "visibility",
|
|
280
|
+
"icon-color": "neutral-gray-400",
|
|
281
|
+
variant: "tertiary",
|
|
282
|
+
onClick: async (h) => {
|
|
283
|
+
h.stopPropagation(), await t(P).push({
|
|
284
|
+
name: t(H)["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
|
|
285
|
+
params: { id: n._id }
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
}, null, 8, ["onClick"])) : E("", !0),
|
|
289
|
+
n.event.type === "SIMPLE_CLAIM" ? (u(), y(C, {
|
|
290
|
+
key: 1,
|
|
291
|
+
icon: "send",
|
|
292
|
+
"icon-color": "neutral-gray-400",
|
|
293
|
+
variant: "tertiary",
|
|
294
|
+
onClick: (h) => {
|
|
295
|
+
var R;
|
|
296
|
+
h.stopPropagation(), (R = t(b)) == null || R.showSheet({
|
|
297
|
+
campaignId: n._id
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
}, null, 8, ["onClick"])) : E("", !0),
|
|
301
|
+
s(C, {
|
|
302
|
+
icon: "delete",
|
|
303
|
+
"icon-color": "neutral-gray-400",
|
|
304
|
+
variant: "tertiary",
|
|
305
|
+
onClick: (h) => (h.stopPropagation(), M(n))
|
|
306
|
+
}, null, 8, ["onClick"])
|
|
307
|
+
])
|
|
308
|
+
];
|
|
309
|
+
}),
|
|
310
|
+
_: 2
|
|
311
|
+
}, 1032, ["onClick"]))), 128))
|
|
312
|
+
]),
|
|
313
|
+
_: 1
|
|
314
|
+
})
|
|
315
|
+
], 64)) : (u(), y(W, {
|
|
316
|
+
key: 1,
|
|
317
|
+
variant: "outlined",
|
|
318
|
+
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
319
|
+
}, {
|
|
320
|
+
default: V(() => [
|
|
321
|
+
o[6] || (o[6] = r("img", {
|
|
322
|
+
src: ee,
|
|
323
|
+
class: "aspect-square w-[150px]"
|
|
324
|
+
}, null, -1)),
|
|
325
|
+
r("div", Se, [
|
|
326
|
+
r("div", Fe, g(t(a)("connect.voucher.createVoucherCampaign")), 1),
|
|
327
|
+
r("div", Ve, g(t(a)("connect.voucher.description")), 1)
|
|
328
|
+
]),
|
|
329
|
+
s(C, {
|
|
330
|
+
variant: "primary",
|
|
331
|
+
label: t(a)("connect.voucher.createVoucherCampaign"),
|
|
332
|
+
icon: "add",
|
|
333
|
+
onClick: o[5] || (o[5] = (n) => v())
|
|
334
|
+
}, null, 8, ["label"])
|
|
335
|
+
]),
|
|
336
|
+
_: 1
|
|
337
|
+
})),
|
|
338
|
+
s(le, {
|
|
339
|
+
ref_key: "sheetRef",
|
|
340
|
+
ref: U,
|
|
341
|
+
"onSubmit:modelValue": j
|
|
342
|
+
}, null, 512),
|
|
343
|
+
s(ue, {
|
|
344
|
+
ref_key: "sendVoucherSheetRef",
|
|
345
|
+
ref: b
|
|
346
|
+
}, null, 512)
|
|
347
|
+
])
|
|
348
|
+
], 64);
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
export {
|
|
353
|
+
Xe as default
|
|
354
|
+
};
|