@feedmepos/mf-connect 0.1.38-beta.22 → 0.1.38-beta.24
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-CpzRbw6Z.js → Analytic-DIIOqI6t.js} +14 -14
- package/dist/{App-mXF5fxjZ.js → App-CdcDgvY7.js} +7 -7
- package/dist/{AuditLogs-CMqOkUZr.js → AuditLogs-CXwAnFj2.js} +11 -11
- package/dist/{Bin-8pdgFB9Z.js → Bin-Cz_EmQvg.js} +8 -8
- package/dist/{Broadcast-BPbUMgv9.js → Broadcast-BMa1Vabz.js} +9 -9
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B_J1oubC.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CV52UDC7.js} +6 -6
- package/dist/{Card-I1TPvKP2.js → Card-DY0aZEMz.js} +18 -18
- package/dist/{Collections-Bm7uK5bU.js → Collections-DJBPF3Sn.js} +7 -7
- package/dist/{Credit-D0atXzoF.js → Credit-OufxE9gh.js} +11 -11
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-CFbgEftO.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CHx2S5GA.js} +50 -50
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CKfJClbj.js → EffectSheet.vue_vue_type_style_index_0_lang-CTwdP77j.js} +20 -20
- package/dist/{Experience-yPl537Z0.js → Experience-DNSdiaZp.js} +9 -9
- package/dist/{Game-D51In5o6.js → Game-CvpiNxP8.js} +10 -10
- package/dist/{Grab-CfFzOqVf.js → Grab-R7UK3MBX.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js → ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js} +8 -8
- package/dist/{Index-e2fXLyP2.js → Index-BlCJP1AU.js} +54 -54
- package/dist/{Marketing-Co80L4R4.js → Marketing-dvZJgjik.js} +10 -10
- package/dist/{Member-Lbt60sle.js → Member-BQ8lPxer.js} +10 -10
- package/dist/{MemberList-BH4vPGKI.js → MemberList-btOTrbQl.js} +31 -31
- package/dist/{MemberTransactions-DeuCZtvO.js → MemberTransactions-Bn7IENl9.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DhvpOc4l.js → MessageInput.vue_vue_type_script_setup_true_lang-BnitWB_t.js} +2286 -2220
- package/dist/{Mission-flrnw4_V.js → Mission-CSZUxBZY.js} +10 -10
- package/dist/{Overview-BeSCDO-z.js → Overview-AWsKlfo9.js} +21 -21
- package/dist/{Point-CbPJF6zY.js → Point-Cs5ARAYb.js} +9 -9
- package/dist/{Promotion-ppwYxK04.js → Promotion-DhDB8Tbd.js} +10 -10
- package/dist/{Queue-BSRSIphF.js → Queue-CBe6W47A.js} +11 -11
- package/dist/{Record-A2ryIllF.js → Record-DOLUX9X4.js} +9 -9
- package/dist/{Reward-RAkE3L2b.js → Reward-DSGRvZ7y.js} +15 -15
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-_TAl6moR.js → RewardGroup.vue_vue_type_script_setup_true_lang-DSGR-FDc.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BZYLaJ1g.js → RuleGroup.vue_vue_type_script_setup_true_lang-Cbya-iI4.js} +185 -185
- package/dist/{Segment-CYVaOnLd.js → Segment-CRF7F3fy.js} +232 -232
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-dKRYAPAC.js → SelectItems.vue_vue_type_script_setup_true_lang-CMFXf3f7.js} +14 -14
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-BuxR6tGK.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-CkZPsecz.js} +11 -11
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-HZ-szV_4.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-B-9A5Vw1.js} +3 -3
- package/dist/{Setting-BdVOv2fF.js → Setting-BKgJWdj1.js} +17 -17
- package/dist/{Store-C2vl-tSY.js → Store-CNHfu-Pl.js} +34 -34
- package/dist/{StoreRewards-OwfwKw4Z.js → StoreRewards-CrVvj8j9.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-B7G-XEv7.js → StoreTransactions.vue_vue_type_script_setup_true_lang-cgoFRRLh.js} +21 -21
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-C0Jw4qmp.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BdM-2lqP.js} +1 -1
- package/dist/{Tier-CQWqWYQp.js → Tier-DvOUwWQz.js} +21 -21
- package/dist/{Title-B03AazFm.js → Title-CRspZyr_.js} +20 -20
- package/dist/{Transaction-CsmWCDjS.js → Transaction-BGc7qOQt.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-D9MhrUdC.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Ca9QWPNE.js} +6 -6
- package/dist/{Voucher-BjTCDioi.js → Voucher-zROvoGPm.js} +13 -13
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-D3cSsXPi.js → VoucherEditor.vue_vue_type_script_setup_true_lang-CD2C0b2B.js} +86 -86
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CcR6Ak9O.js → ZodTextField.vue_vue_type_script_setup_true_lang-xRq5NUye.js} +1 -1
- package/dist/app-CcrKXI5U.js +57962 -0
- package/dist/{app-BZS8hbi4.js → app-H6IgvNco.js} +32 -32
- package/dist/app.js +1 -1
- package/dist/{business-Oqy7tPH9.js → business-CPwOvpGD.js} +1 -1
- package/dist/{campaign-Bpu-WkHc.js → campaign-BGNxmSrr.js} +9 -9
- package/dist/{campaign-BFjMsenC.js → campaign-Dozf5twL.js} +2 -2
- package/dist/{campaign.enum-tI-fq-RU.js → campaign.enum-BFrMGQ7T.js} +1 -1
- package/dist/{campaign.fn-DnSyzNCW.js → campaign.fn-CIx0A0Ps.js} +30 -30
- package/dist/{collectible.enum-BT9B1DAn.js → collectible.enum-CYwwPBvg.js} +1 -1
- package/dist/{collection.fn-Q0ICmTCt.js → collection.fn-CxI950TL.js} +2 -2
- package/dist/{dto-BKZbH_5Z.js → dto-C2_6bjCG.js} +4 -4
- package/dist/{effect-Ev5GOyak.js → effect-XJbcCeBx.js} +1 -1
- package/dist/{email-addresses-HSXm7NzC.js → email-addresses-DRcfKo6t.js} +1 -1
- package/dist/{export-Dmw7vq5n.js → export-BFUNdp3a.js} +3 -3
- package/dist/{helper-DrBwjXJd.js → helper-B40jlG60.js} +1 -1
- package/dist/{index-B2HJgRP8.js → index-6JDE5-xO.js} +1 -1
- package/dist/{index-CLEOWcJj.js → index-B4Pwokmt.js} +1 -1
- package/dist/{index-YYhOm5p5.js → index-BFps3TvZ.js} +9 -7
- package/dist/{index-Cvk2jznV.js → index-BW9fkuya.js} +1 -1
- package/dist/{index-SlOkYO1R.js → index-BcpAuaGd.js} +1 -1
- package/dist/{index-DbDvM2VB.js → index-CL0BybAT.js} +1 -1
- package/dist/{index-DCtGS9iJ.js → index-Ch9Aa7hb.js} +7 -7
- package/dist/{index-Crg_hMJc.js → index-Crkl2Pua.js} +2 -2
- package/dist/{index-BJuCnCo9.js → index-D7FM5qup.js} +1 -1
- package/dist/{index-DYsVl8va.js → index-DkWYIiiy.js} +3 -3
- package/dist/{index-D1XdOqxU.js → index-Dlsfhj3g.js} +1 -1
- package/dist/{index-XDMj6KjH.js → index-F7hZ1yOK.js} +3 -3
- package/dist/{index-paKrqchu.js → index-RhUqg1Tl.js} +1 -1
- package/dist/{index-DhP0hPJy.js → index-Ta6CTZmb.js} +3 -3
- package/dist/{index.esm2017-CKyZQ9bN.js → index.esm2017-DlJnPRKQ.js} +1 -1
- package/dist/{loading-fAKR7hYD.js → loading-B3wvtmgh.js} +1 -1
- package/dist/{membership-CaZBYwW5.js → membership-DpfpIT9v.js} +3 -3
- package/dist/{money-DOhWY3sh.js → money-XJk2AEf9.js} +1 -1
- package/dist/{number-DGtIZHGZ.js → number-Ec4tNVBZ.js} +1 -1
- package/dist/{objectid-C0hgqKv3.js → objectid-D7z8NSmH.js} +4 -4
- package/dist/{plugins-FfzNmwCE.js → plugins-DZ3ydcdc.js} +2 -2
- package/dist/{reward-DzIcFmd0.js → reward-DURL6iKv.js} +1 -1
- package/dist/{rule-DK-66nJF.js → rule-BMJqZD3D.js} +3 -3
- package/dist/{rule-builder-BlS3MdnW.js → rule-builder-Dgnn6yE8.js} +20 -18
- package/dist/style.css +1 -1
- package/dist/{template-Wtw44sTH.js → template-DfVuvLbx.js} +5 -5
- package/dist/{timezone-SzPXGYwV.js → timezone-4zA4Eck_.js} +1 -1
- package/dist/{trigger-CehCt6EJ.js → trigger-CWh9m2Sd.js} +4 -4
- package/dist/usePagination-Ds-cuHop.js +223 -0
- package/dist/{user-BRklsZN_.js → user-BcxMf5qG.js} +1 -1
- package/dist/{vue-i18n-D8X2q1qS.js → vue-i18n-BQiDu4pW.js} +158 -158
- package/dist/{xlsx-Dzv15YMt.js → xlsx-DrYIuf7U.js} +1 -1
- package/package.json +4 -4
- package/dist/app-8DN8-SZI.js +0 -33357
- package/dist/usePagination-BeF5K3M7.js +0 -223
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { defineComponent as ee, ref as z, resolveComponent as
|
|
1
|
+
import { defineComponent as ee, ref as z, resolveComponent as S, openBlock as p, createElementBlock as k, createElementVNode as l, createVNode as r, unref as t, createCommentVNode as le, withCtx as E, Fragment as O, renderList as ie, createBlock as J, toDisplayString as R, normalizeClass as re, onMounted as Se, computed as ce, isRef as Ie, createSlots as Me, h as Y, onBeforeMount as Te } from "vue";
|
|
2
2
|
import { _ as Ee } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { n as Ae, p as De } from "./plugins-
|
|
4
|
-
import { u as $e } from "./loading-
|
|
3
|
+
import { n as Ae, p as De } from "./plugins-DZ3ydcdc.js";
|
|
4
|
+
import { u as $e } from "./loading-B3wvtmgh.js";
|
|
5
5
|
import { FmButtonVariant as ae, useSnackbar as Re, components as X } from "@feedmepos/ui-library";
|
|
6
|
-
import { u as we, _ as Fe } from "./usePagination-
|
|
7
|
-
import { u as be } from "./vue-i18n-
|
|
8
|
-
import "./index-
|
|
9
|
-
import { i as Pe, j as $, c as fe } from "./index-
|
|
10
|
-
import "./index-
|
|
11
|
-
import "./index-
|
|
12
|
-
import "./index-
|
|
13
|
-
import { u as ne, w as he } from "./xlsx-
|
|
14
|
-
import { e as Be, M as Ne } from "./email-addresses-
|
|
6
|
+
import { u as we, _ as Fe } from "./usePagination-Ds-cuHop.js";
|
|
7
|
+
import { u as be } from "./vue-i18n-BQiDu4pW.js";
|
|
8
|
+
import "./index-BFps3TvZ.js";
|
|
9
|
+
import { i as Pe, j as $, c as fe } from "./index-Ch9Aa7hb.js";
|
|
10
|
+
import "./index-Crkl2Pua.js";
|
|
11
|
+
import "./index-Dlsfhj3g.js";
|
|
12
|
+
import "./index-DkWYIiiy.js";
|
|
13
|
+
import { u as ne, w as he } from "./xlsx-DrYIuf7U.js";
|
|
14
|
+
import { e as Be, M as Ne } from "./email-addresses-DRcfKo6t.js";
|
|
15
15
|
import { Z as Ve } from "./zod-Bg2FbC-D.js";
|
|
16
16
|
import { u as Ye } from "./app-wDQR6dpb.js";
|
|
17
|
-
import { F as ye, z as Ue } from "./index-
|
|
18
|
-
import { R as ge } from "./rule-builder-
|
|
19
|
-
import { _ as Le } from "./ZodTextField.vue_vue_type_script_setup_true_lang-
|
|
20
|
-
import { _ as ze } from "./RuleGroup.vue_vue_type_script_setup_true_lang-
|
|
21
|
-
import { u as Oe, v as je, w as qe } from "./index.esm2017-
|
|
17
|
+
import { F as ye, z as Ue } from "./index-Ta6CTZmb.js";
|
|
18
|
+
import { R as ge } from "./rule-builder-Dgnn6yE8.js";
|
|
19
|
+
import { _ as Le } from "./ZodTextField.vue_vue_type_script_setup_true_lang-xRq5NUye.js";
|
|
20
|
+
import { _ as ze } from "./RuleGroup.vue_vue_type_script_setup_true_lang-Cbya-iI4.js";
|
|
21
|
+
import { u as Oe, v as je, w as qe } from "./index.esm2017-DlJnPRKQ.js";
|
|
22
22
|
import { F as Ge } from "./FileSaver.min-NlMItPOc.js";
|
|
23
23
|
import { h as H } from "./moment-D7p2TMB-.js";
|
|
24
|
-
import { s as B, u as He } from "./membership-
|
|
24
|
+
import { s as B, u as He } from "./membership-DpfpIT9v.js";
|
|
25
25
|
import { o as Je } from "./objectId-dwaoBfJX.js";
|
|
26
|
-
import { u as Ce } from "./business-
|
|
27
|
-
import { f as Qe } from "./number-
|
|
28
|
-
import { t as We } from "./money-
|
|
29
|
-
import "./index-
|
|
26
|
+
import { u as Ce } from "./business-CPwOvpGD.js";
|
|
27
|
+
import { f as Qe } from "./number-Ec4tNVBZ.js";
|
|
28
|
+
import { t as We } from "./money-XJk2AEf9.js";
|
|
29
|
+
import "./index-BcpAuaGd.js";
|
|
30
30
|
import { useRouter as Ze } from "vue-router";
|
|
31
|
-
import { m as ve } from "./index-
|
|
32
|
-
import { R as _e } from "./app-
|
|
31
|
+
import { m as ve } from "./index-D7FM5qup.js";
|
|
32
|
+
import { R as _e } from "./app-H6IgvNco.js";
|
|
33
33
|
const Ke = Pe.extend({
|
|
34
34
|
_id: ye.optional(),
|
|
35
35
|
business: ye.optional(),
|
|
@@ -57,8 +57,8 @@ const et = { class: "flex flex-col space-y-16" }, tt = {
|
|
|
57
57
|
importFile: {}
|
|
58
58
|
},
|
|
59
59
|
emits: ["update:file"],
|
|
60
|
-
setup(e, { emit:
|
|
61
|
-
const
|
|
60
|
+
setup(e, { emit: v }) {
|
|
61
|
+
const _ = e, C = v, { t: m } = be(), f = z(null), w = z(null), F = ["Id"], n = [
|
|
62
62
|
{
|
|
63
63
|
label: "CSV",
|
|
64
64
|
icon: "csv",
|
|
@@ -70,91 +70,91 @@ const et = { class: "flex flex-col space-y-16" }, tt = {
|
|
|
70
70
|
value: "xlsx"
|
|
71
71
|
}
|
|
72
72
|
];
|
|
73
|
-
async function
|
|
74
|
-
if (
|
|
73
|
+
async function i() {
|
|
74
|
+
if (_.importFile)
|
|
75
75
|
try {
|
|
76
|
-
const
|
|
77
|
-
window.open(
|
|
78
|
-
} catch (
|
|
79
|
-
console.log(
|
|
76
|
+
const h = Oe(void 0, Xe.importFilesBucketUrl), y = je(h, _.importFile), x = await qe(y);
|
|
77
|
+
window.open(x, "_blank");
|
|
78
|
+
} catch (h) {
|
|
79
|
+
console.log(h), Ae.error("Failed to download uploaded file");
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
async function c(
|
|
83
|
-
switch (
|
|
82
|
+
async function c(h) {
|
|
83
|
+
switch (h) {
|
|
84
84
|
case "csv":
|
|
85
|
-
const
|
|
85
|
+
const y = new Blob([F.join(",")], {
|
|
86
86
|
type: "text/csv;charset=utf-8;"
|
|
87
87
|
});
|
|
88
|
-
Ge.saveAs(
|
|
88
|
+
Ge.saveAs(y, "ImportSegmentTemplate.csv");
|
|
89
89
|
break;
|
|
90
90
|
case "xlsx":
|
|
91
|
-
const
|
|
92
|
-
ne.book_append_sheet(I,
|
|
91
|
+
const x = ne.aoa_to_sheet([F]), I = ne.book_new();
|
|
92
|
+
ne.book_append_sheet(I, x, "Sheet1"), he(I, "ImportSegmentTemplate.xlsx");
|
|
93
93
|
break;
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
function h
|
|
97
|
-
|
|
96
|
+
function b(h) {
|
|
97
|
+
f.value = h, C("update:file", f.value);
|
|
98
98
|
}
|
|
99
|
-
function A(
|
|
100
|
-
var
|
|
101
|
-
const
|
|
102
|
-
|
|
99
|
+
function A(h) {
|
|
100
|
+
var x, I;
|
|
101
|
+
const y = ((I = (x = h.target) == null ? void 0 : x.files) == null ? void 0 : I[0]) ?? null;
|
|
102
|
+
b(y);
|
|
103
103
|
}
|
|
104
|
-
return (
|
|
105
|
-
const
|
|
104
|
+
return (h, y) => {
|
|
105
|
+
const x = S("FmButton"), I = S("FmMenuItem"), d = S("FmMenu"), s = S("FmDropField");
|
|
106
106
|
return p(), k("div", et, [
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
r(
|
|
107
|
+
y[2] || (y[2] = l("div", { class: "fm-typo-en-title-sm-800" }, "Upload File", -1)),
|
|
108
|
+
e.importFile ? (p(), k("div", tt, [
|
|
109
|
+
r(x, {
|
|
110
110
|
label: t(m)("View uploaded file"),
|
|
111
111
|
variant: t(ae).Plain,
|
|
112
112
|
icon: "file_present",
|
|
113
|
-
onClick:
|
|
113
|
+
onClick: i
|
|
114
114
|
}, null, 8, ["label", "variant"])
|
|
115
115
|
])) : le("", !0),
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
l("div", null, [
|
|
117
|
+
l("div", ot, [
|
|
118
118
|
r(d, { class: "" }, {
|
|
119
119
|
"menu-button": E(() => [
|
|
120
|
-
r(
|
|
120
|
+
r(x, {
|
|
121
121
|
variant: "tertiary",
|
|
122
122
|
icon: "download",
|
|
123
123
|
label: "Download Template"
|
|
124
124
|
})
|
|
125
125
|
]),
|
|
126
126
|
default: E(() => [
|
|
127
|
-
(p(), k(O, null, ie(
|
|
128
|
-
key:
|
|
129
|
-
icon:
|
|
130
|
-
label:
|
|
131
|
-
onClick: (U) => c(
|
|
127
|
+
(p(), k(O, null, ie(n, (g) => r(I, {
|
|
128
|
+
key: g.value,
|
|
129
|
+
icon: g.icon,
|
|
130
|
+
label: g.label,
|
|
131
|
+
onClick: (U) => c(g.value),
|
|
132
132
|
selectable: ""
|
|
133
133
|
}, null, 8, ["icon", "label", "onClick"])), 64))
|
|
134
134
|
]),
|
|
135
135
|
_: 1
|
|
136
136
|
})
|
|
137
137
|
]),
|
|
138
|
-
|
|
139
|
-
r(
|
|
138
|
+
f.value ? (p(), k("div", at, [
|
|
139
|
+
r(x, {
|
|
140
140
|
variant: t(ae).Tertiary,
|
|
141
141
|
"prepend-icon": "attach_file"
|
|
142
142
|
}, null, 8, ["variant"]),
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
l("p", nt, R(f.value.name), 1),
|
|
144
|
+
l("label", {
|
|
145
145
|
ref_key: "fileLabelRef",
|
|
146
|
-
ref:
|
|
146
|
+
ref: w,
|
|
147
147
|
htmlFor: "file"
|
|
148
148
|
}, [
|
|
149
|
-
r(
|
|
149
|
+
r(x, {
|
|
150
150
|
variant: t(ae).Plain,
|
|
151
151
|
label: t(m)("Replace File"),
|
|
152
|
-
onClick:
|
|
153
|
-
var
|
|
154
|
-
return (
|
|
152
|
+
onClick: y[1] || (y[1] = () => {
|
|
153
|
+
var g;
|
|
154
|
+
return (g = w.value) == null ? void 0 : g.click();
|
|
155
155
|
})
|
|
156
156
|
}, null, 8, ["variant", "label"]),
|
|
157
|
-
|
|
157
|
+
l("input", {
|
|
158
158
|
id: "file",
|
|
159
159
|
accept: ".csv",
|
|
160
160
|
class: "hidden",
|
|
@@ -163,9 +163,9 @@ const et = { class: "flex flex-col space-y-16" }, tt = {
|
|
|
163
163
|
onChange: A
|
|
164
164
|
}, null, 32)
|
|
165
165
|
], 512)
|
|
166
|
-
])) : (p(), J(
|
|
166
|
+
])) : (p(), J(s, {
|
|
167
167
|
key: 0,
|
|
168
|
-
onFileUpload:
|
|
168
|
+
onFileUpload: y[0] || (y[0] = (g) => b(g)),
|
|
169
169
|
accept: ".csv, .xlsx",
|
|
170
170
|
"max-file-size": 2e7
|
|
171
171
|
}))
|
|
@@ -180,69 +180,69 @@ const et = { class: "flex flex-col space-y-16" }, tt = {
|
|
|
180
180
|
segment: {}
|
|
181
181
|
},
|
|
182
182
|
setup(e) {
|
|
183
|
-
const
|
|
183
|
+
const v = e, _ = [
|
|
184
184
|
{
|
|
185
185
|
header: "Name",
|
|
186
|
-
accessorFn: (
|
|
186
|
+
accessorFn: (i) => i.name
|
|
187
187
|
},
|
|
188
188
|
{
|
|
189
189
|
header: "Id",
|
|
190
|
-
accessorFn: (
|
|
190
|
+
accessorFn: (i) => i._id
|
|
191
191
|
},
|
|
192
192
|
{
|
|
193
193
|
header: "Customer Since",
|
|
194
|
-
accessorFn: (
|
|
194
|
+
accessorFn: (i) => H(Je(i._id.toString())).format("DD MMM YYYY")
|
|
195
195
|
},
|
|
196
196
|
{
|
|
197
197
|
header: "Phone",
|
|
198
|
-
accessorFn: (
|
|
198
|
+
accessorFn: (i) => i.phoneNumber
|
|
199
199
|
},
|
|
200
200
|
{
|
|
201
201
|
header: "Birthday",
|
|
202
|
-
accessorFn: (
|
|
202
|
+
accessorFn: (i) => H(i.birthday).format("DD MMM YYYY")
|
|
203
203
|
},
|
|
204
204
|
{
|
|
205
205
|
header: "Last Visit",
|
|
206
|
-
accessorFn: (
|
|
206
|
+
accessorFn: (i) => H(i.stats.lastVisit).format("DD MMM YYYY")
|
|
207
207
|
}
|
|
208
208
|
];
|
|
209
|
-
async function C(
|
|
210
|
-
return
|
|
211
|
-
|
|
212
|
-
|
|
209
|
+
async function C(i) {
|
|
210
|
+
return v.segment._id ? (console.log(i), await B.paginateSegmentUsers(
|
|
211
|
+
v.segment._id,
|
|
212
|
+
i
|
|
213
213
|
)) : {
|
|
214
214
|
resources: [],
|
|
215
215
|
meta: {
|
|
216
216
|
totalResources: 0,
|
|
217
217
|
totalPages: 0,
|
|
218
|
-
skip:
|
|
219
|
-
limit:
|
|
220
|
-
sortBy:
|
|
218
|
+
skip: i.skip,
|
|
219
|
+
limit: i.limit,
|
|
220
|
+
sortBy: i.sortBy
|
|
221
221
|
}
|
|
222
222
|
};
|
|
223
223
|
}
|
|
224
|
-
const { tableMeta: m, rowData:
|
|
224
|
+
const { tableMeta: m, rowData: f, onSort: w, debouncedFetchData: F, onSearch: n } = we(C);
|
|
225
225
|
return Se(async () => {
|
|
226
|
-
await
|
|
227
|
-
}), (
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
c[1] || (c[1] =
|
|
233
|
-
|
|
226
|
+
await F();
|
|
227
|
+
}), (i, c) => (p(), k("div", lt, [
|
|
228
|
+
l("div", it, R(v.title), 1),
|
|
229
|
+
l("div", rt, [
|
|
230
|
+
l("div", ct, R(e.segment.members.length), 1),
|
|
231
|
+
l("div", dt, [
|
|
232
|
+
c[1] || (c[1] = l("div", null, "contacts in your segment", -1)),
|
|
233
|
+
l("div", null, "as of " + R(t(H)(e.segment.lastUpdated).format("DD MMM YYYY")), 1)
|
|
234
234
|
])
|
|
235
235
|
]),
|
|
236
236
|
r(Fe, {
|
|
237
237
|
loading: t(m).isLoading,
|
|
238
|
-
"row-data": t(
|
|
238
|
+
"row-data": t(f),
|
|
239
239
|
"row-count": t(m).totalRows,
|
|
240
|
-
"column-defs":
|
|
240
|
+
"column-defs": _,
|
|
241
241
|
"page-size": t(m).pageSize,
|
|
242
242
|
"page-count": t(m).pageCount,
|
|
243
243
|
"page-index": t(m).pageIndex,
|
|
244
|
-
onSortChange: t(
|
|
245
|
-
onPageChange: c[0] || (c[0] = (
|
|
244
|
+
onSortChange: t(w),
|
|
245
|
+
onPageChange: c[0] || (c[0] = (b) => t(F)({ pageSize: b.pageSize, pageIndex: b.pageIndex }))
|
|
246
246
|
}, null, 8, ["loading", "row-data", "row-count", "page-size", "page-count", "page-index", "onSortChange"])
|
|
247
247
|
]));
|
|
248
248
|
}
|
|
@@ -253,8 +253,8 @@ const et = { class: "flex flex-col space-y-16" }, tt = {
|
|
|
253
253
|
errorText: {}
|
|
254
254
|
},
|
|
255
255
|
emits: ["update:model-value"],
|
|
256
|
-
setup(e, { emit:
|
|
257
|
-
const
|
|
256
|
+
setup(e, { emit: v }) {
|
|
257
|
+
const _ = e, C = v, m = [
|
|
258
258
|
{
|
|
259
259
|
label: "Dynamic",
|
|
260
260
|
sublabel: "Segment statistics are based on rules configured and will be recalculated automatically when rule changes.",
|
|
@@ -266,34 +266,34 @@ const et = { class: "flex flex-col space-y-16" }, tt = {
|
|
|
266
266
|
value: $.enum.STATIC
|
|
267
267
|
}
|
|
268
268
|
];
|
|
269
|
-
function
|
|
270
|
-
|
|
269
|
+
function f(w) {
|
|
270
|
+
w !== _.modelValue && C("update:model-value", w);
|
|
271
271
|
}
|
|
272
|
-
return (
|
|
273
|
-
const
|
|
272
|
+
return (w, F) => {
|
|
273
|
+
const n = S("FmCard"), i = S("FmHelperText");
|
|
274
274
|
return p(), k("div", pt, [
|
|
275
|
-
|
|
276
|
-
(p(), k(O, null, ie(m, (c) => r(
|
|
275
|
+
l("div", mt, [
|
|
276
|
+
(p(), k(O, null, ie(m, (c) => r(n, {
|
|
277
277
|
variant: "outlined",
|
|
278
278
|
class: re(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
|
|
279
279
|
"col-span-2": m.length == 1,
|
|
280
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]":
|
|
281
|
-
"hover:bg-fm-color-opacity-sm":
|
|
280
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue === c.value,
|
|
281
|
+
"hover:bg-fm-color-opacity-sm": e.modelValue !== c.value
|
|
282
282
|
}]),
|
|
283
|
-
onClick: (
|
|
283
|
+
onClick: (b) => f(c.value),
|
|
284
284
|
key: c.value
|
|
285
285
|
}, {
|
|
286
286
|
default: E(() => [
|
|
287
|
-
|
|
288
|
-
|
|
287
|
+
l("div", ft, R(c.label), 1),
|
|
288
|
+
l("div", yt, R(c.sublabel), 1)
|
|
289
289
|
]),
|
|
290
290
|
_: 2
|
|
291
291
|
}, 1032, ["class", "onClick"])), 64))
|
|
292
292
|
]),
|
|
293
|
-
|
|
293
|
+
e.errorText ? (p(), J(i, {
|
|
294
294
|
key: 0,
|
|
295
295
|
class: "!mt-4",
|
|
296
|
-
text:
|
|
296
|
+
text: e.errorText,
|
|
297
297
|
state: "error"
|
|
298
298
|
}, null, 8, ["text"])) : le("", !0)
|
|
299
299
|
]);
|
|
@@ -314,78 +314,78 @@ const et = { class: "flex flex-col space-y-16" }, tt = {
|
|
|
314
314
|
}, bt = { class: "flex items-center gap-8" }, ht = /* @__PURE__ */ ee({
|
|
315
315
|
__name: "SegmentSheet",
|
|
316
316
|
emits: ["update:model-value"],
|
|
317
|
-
setup(e, { expose:
|
|
318
|
-
const C = Ye(), m = z(!1),
|
|
317
|
+
setup(e, { expose: v, emit: _ }) {
|
|
318
|
+
const C = Ye(), m = z(!1), f = z(!1), w = {
|
|
319
319
|
name: "",
|
|
320
320
|
isActive: !0,
|
|
321
321
|
type: $.enum.DYNAMIC,
|
|
322
322
|
rule: ge.scaffoldGroup(),
|
|
323
323
|
members: []
|
|
324
|
-
},
|
|
325
|
-
const d =
|
|
324
|
+
}, F = Ke, n = z(w), i = ce(() => {
|
|
325
|
+
const d = F.safeParse(n.value);
|
|
326
326
|
return d.success ? [] : d.error.errors;
|
|
327
327
|
});
|
|
328
328
|
function c(d) {
|
|
329
|
-
m.value = !0,
|
|
329
|
+
m.value = !0, f.value = !1, d ? n.value = {
|
|
330
330
|
...d,
|
|
331
331
|
isActive: d.isActive !== !1,
|
|
332
332
|
type: d.type ?? (d.importFile ? $.enum.STATIC : $.enum.DYNAMIC)
|
|
333
|
-
} :
|
|
333
|
+
} : n.value = { ...w };
|
|
334
334
|
}
|
|
335
|
-
function
|
|
335
|
+
function b() {
|
|
336
336
|
m.value = !1;
|
|
337
337
|
}
|
|
338
338
|
async function A() {
|
|
339
|
-
|
|
339
|
+
F.safeParse(n.value).success && (f.value = !0);
|
|
340
340
|
}
|
|
341
|
-
function
|
|
342
|
-
d === $.enum.STATIC ?
|
|
341
|
+
function h(d) {
|
|
342
|
+
d === $.enum.STATIC ? b() : f.value = !1;
|
|
343
343
|
}
|
|
344
|
-
async function
|
|
345
|
-
|
|
344
|
+
async function y() {
|
|
345
|
+
n.value.type === $.enum.STATIC ? (n.value.rule = ge.scaffoldGroup(), n.value.isActive = !0) : n.value.file = void 0, I("update:model-value", n.value);
|
|
346
346
|
}
|
|
347
|
-
async function
|
|
348
|
-
|
|
347
|
+
async function x(d) {
|
|
348
|
+
n.value.type = d;
|
|
349
349
|
}
|
|
350
350
|
Se(async () => {
|
|
351
351
|
});
|
|
352
|
-
const I =
|
|
353
|
-
return
|
|
352
|
+
const I = _;
|
|
353
|
+
return v({
|
|
354
354
|
showSheet: c,
|
|
355
|
-
hideSheet:
|
|
356
|
-
}), (d,
|
|
357
|
-
const
|
|
355
|
+
hideSheet: b
|
|
356
|
+
}), (d, s) => {
|
|
357
|
+
const g = S("FmButton"), U = S("FmSwitch"), a = S("FmSideSheet");
|
|
358
358
|
return p(), J(a, {
|
|
359
359
|
modelValue: t(m),
|
|
360
|
-
"onUpdate:modelValue":
|
|
360
|
+
"onUpdate:modelValue": s[8] || (s[8] = (o) => Ie(m) ? m.value = o : null),
|
|
361
361
|
header: "Add segment",
|
|
362
362
|
"dismiss-away": "",
|
|
363
363
|
"close-button": !0,
|
|
364
364
|
"max-width": 1100
|
|
365
365
|
}, Me({
|
|
366
366
|
"side-sheet-footer": E(() => [
|
|
367
|
-
|
|
368
|
-
t(
|
|
369
|
-
r(
|
|
367
|
+
l("div", bt, [
|
|
368
|
+
t(f) || t(n).type === t($).enum.STATIC ? (p(), k(O, { key: 0 }, [
|
|
369
|
+
r(g, {
|
|
370
370
|
label: "Save Segment",
|
|
371
|
-
onClick:
|
|
371
|
+
onClick: y,
|
|
372
372
|
loading: t(C).isLoading,
|
|
373
|
-
disabled: t(
|
|
373
|
+
disabled: t(i).length > 0 || t(C).isLoading
|
|
374
374
|
}, null, 8, ["loading", "disabled"]),
|
|
375
|
-
r(
|
|
375
|
+
r(g, {
|
|
376
376
|
label: "Cancel",
|
|
377
|
-
onClick:
|
|
377
|
+
onClick: s[6] || (s[6] = (o) => h(t(n).type)),
|
|
378
378
|
variant: "tertiary"
|
|
379
379
|
})
|
|
380
380
|
], 64)) : (p(), k(O, { key: 1 }, [
|
|
381
|
-
r(
|
|
381
|
+
r(g, {
|
|
382
382
|
label: "Review Segment",
|
|
383
|
-
disabled: t(
|
|
383
|
+
disabled: t(i).length > 0 || t(C).isLoading,
|
|
384
384
|
onClick: A
|
|
385
385
|
}, null, 8, ["disabled"]),
|
|
386
|
-
r(
|
|
386
|
+
r(g, {
|
|
387
387
|
label: "Cancel",
|
|
388
|
-
onClick:
|
|
388
|
+
onClick: s[7] || (s[7] = (o) => b()),
|
|
389
389
|
variant: "tertiary"
|
|
390
390
|
})
|
|
391
391
|
], 64))
|
|
@@ -394,49 +394,49 @@ const et = { class: "flex flex-col space-y-16" }, tt = {
|
|
|
394
394
|
default: E(() => {
|
|
395
395
|
var o;
|
|
396
396
|
return [
|
|
397
|
-
t(
|
|
397
|
+
t(f) ? (p(), J(ut, {
|
|
398
398
|
key: 1,
|
|
399
|
-
title: t(
|
|
400
|
-
segment: t(
|
|
399
|
+
title: t(n).name,
|
|
400
|
+
segment: t(n)
|
|
401
401
|
}, null, 8, ["title", "segment"])) : (p(), k("div", _t, [
|
|
402
402
|
r(Le, {
|
|
403
|
-
modelValue: t(
|
|
404
|
-
"onUpdate:modelValue":
|
|
403
|
+
modelValue: t(n).name,
|
|
404
|
+
"onUpdate:modelValue": s[1] || (s[1] = (u) => t(n).name = u),
|
|
405
405
|
label: "Segment title",
|
|
406
|
-
schema: t(Ve).typeAtPath(t(
|
|
406
|
+
schema: t(Ve).typeAtPath(t(F), "name")
|
|
407
407
|
}, null, 8, ["modelValue", "schema"]),
|
|
408
|
-
|
|
409
|
-
|
|
408
|
+
l("div", xt, [
|
|
409
|
+
s[10] || (s[10] = l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Type", -1)),
|
|
410
410
|
r(gt, {
|
|
411
|
-
"model-value": t(
|
|
412
|
-
"onUpdate:modelValue":
|
|
413
|
-
|
|
411
|
+
"model-value": t(n).type,
|
|
412
|
+
"onUpdate:modelValue": s[2] || (s[2] = (u) => {
|
|
413
|
+
x(u);
|
|
414
414
|
})
|
|
415
415
|
}, null, 8, ["model-value"])
|
|
416
416
|
]),
|
|
417
|
-
t(
|
|
418
|
-
|
|
417
|
+
t(n).type === t($).enum.DYNAMIC ? (p(), k("div", St, [
|
|
418
|
+
s[11] || (s[11] = l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Filter", -1)),
|
|
419
419
|
r(ze, {
|
|
420
420
|
"trigger-type": "MEMBERSHIP_JOINED",
|
|
421
421
|
includeOnly: "user",
|
|
422
|
-
"model-value": (o = t(
|
|
423
|
-
"onUpdate:modelValue":
|
|
424
|
-
t(
|
|
422
|
+
"model-value": (o = t(n)) == null ? void 0 : o.rule,
|
|
423
|
+
"onUpdate:modelValue": s[3] || (s[3] = (u) => {
|
|
424
|
+
t(n).rule = u;
|
|
425
425
|
})
|
|
426
426
|
}, null, 8, ["model-value"])
|
|
427
427
|
])) : (p(), k("div", wt, [
|
|
428
428
|
r(st, {
|
|
429
|
-
importFile: t(
|
|
430
|
-
"onUpdate:file":
|
|
431
|
-
t(
|
|
429
|
+
importFile: t(n).importFile,
|
|
430
|
+
"onUpdate:file": s[4] || (s[4] = (u) => {
|
|
431
|
+
t(n).file = u;
|
|
432
432
|
})
|
|
433
433
|
}, null, 8, ["importFile"])
|
|
434
434
|
])),
|
|
435
|
-
t(
|
|
436
|
-
|
|
435
|
+
t(n).type === t($).enum.DYNAMIC ? (p(), k("div", Ft, [
|
|
436
|
+
s[12] || (s[12] = l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Status", -1)),
|
|
437
437
|
r(U, {
|
|
438
|
-
"model-value": t(
|
|
439
|
-
"onUpdate:modelValue":
|
|
438
|
+
"model-value": t(n).isActive ?? !0,
|
|
439
|
+
"onUpdate:modelValue": s[5] || (s[5] = (u) => t(n).isActive = u),
|
|
440
440
|
label: "Active",
|
|
441
441
|
sublabel: "When enabled, this will recalculate the segment statistics daily.",
|
|
442
442
|
"label-placement": "right"
|
|
@@ -447,16 +447,16 @@ const et = { class: "flex flex-col space-y-16" }, tt = {
|
|
|
447
447
|
}),
|
|
448
448
|
_: 2
|
|
449
449
|
}, [
|
|
450
|
-
t(
|
|
450
|
+
t(f) ? {
|
|
451
451
|
name: "side-sheet-header",
|
|
452
452
|
fn: E(() => [
|
|
453
|
-
|
|
454
|
-
r(
|
|
453
|
+
l("div", vt, [
|
|
454
|
+
r(g, {
|
|
455
455
|
icon: "arrow_back",
|
|
456
456
|
variant: "tertiary",
|
|
457
|
-
onClick:
|
|
457
|
+
onClick: s[0] || (s[0] = (o) => f.value = !1)
|
|
458
458
|
}),
|
|
459
|
-
|
|
459
|
+
s[9] || (s[9] = l("div", null, "Review segment", -1))
|
|
460
460
|
])
|
|
461
461
|
]),
|
|
462
462
|
key: "0"
|
|
@@ -466,18 +466,18 @@ const et = { class: "flex flex-col space-y-16" }, tt = {
|
|
|
466
466
|
}
|
|
467
467
|
}), xe = He(), Ct = Ce();
|
|
468
468
|
function se(e) {
|
|
469
|
-
const
|
|
470
|
-
return
|
|
469
|
+
const v = H(e);
|
|
470
|
+
return v.isValid() ? v.format("DD/MM/YYYY") : "";
|
|
471
471
|
}
|
|
472
472
|
const kt = {
|
|
473
473
|
mapMemberExportRow: (e) => {
|
|
474
|
-
var
|
|
475
|
-
const
|
|
474
|
+
var i, c, b, A, h, y, x, I, d, s, g, U, a, o, u, P, D, N, V, j, q, G, te, M, Q, de, ue, pe;
|
|
475
|
+
const v = ce(() => Ct.locations.map((T) => ({
|
|
476
476
|
label: T.name,
|
|
477
477
|
value: T._id
|
|
478
|
-
}))),
|
|
478
|
+
}))), _ = (i = Be.parseOneAddress(
|
|
479
479
|
e == null ? void 0 : e.email
|
|
480
|
-
)) != null &&
|
|
480
|
+
)) != null && i.domain.includes("feedmepos.com") ? void 0 : e.email, C = (b = ((c = e == null ? void 0 : e.collection) == null ? void 0 : c.TITLE) || []) == null ? void 0 : b.reduce(
|
|
481
481
|
(T, L) => {
|
|
482
482
|
var Z, K;
|
|
483
483
|
const W = (K = (Z = xe.sortedTitles) == null ? void 0 : Z.find(
|
|
@@ -495,21 +495,21 @@ const kt = {
|
|
|
495
495
|
return T[L.name] = W ? H(W).format("DD/MM/YYYY") : "", T;
|
|
496
496
|
},
|
|
497
497
|
{}
|
|
498
|
-
),
|
|
498
|
+
), f = ((y = (h = (A = e.collection) == null ? void 0 : A.CREDIT) == null ? void 0 : h.at(0)) == null ? void 0 : y.balance) || 0, w = ((s = (d = (I = (x = e.collection) == null ? void 0 : x.CREDIT) == null ? void 0 : I.at(0)) == null ? void 0 : d.expiryBalance) == null ? void 0 : s.reduce(
|
|
499
499
|
(T, L) => T + L.amount,
|
|
500
500
|
0
|
|
501
|
-
)) || 0,
|
|
501
|
+
)) || 0, F = Qe(f, 2);
|
|
502
502
|
return {
|
|
503
503
|
ID: e._id.toString(),
|
|
504
|
-
Name: ((
|
|
504
|
+
Name: ((g = e.name) == null ? void 0 : g.trim()) || "",
|
|
505
505
|
Phone: ((U = e == null ? void 0 : e.phoneNumber) == null ? void 0 : U.trim()) || "",
|
|
506
|
-
Email:
|
|
506
|
+
Email: _ || "",
|
|
507
507
|
Gender: e.gender || "",
|
|
508
508
|
CardNo: e.cardNo || "",
|
|
509
509
|
Birthday: e != null && e.birthday ? se(e == null ? void 0 : e.birthday) : "",
|
|
510
|
-
Credit: parseFloat((Number(
|
|
511
|
-
FreeCredit: Number(
|
|
512
|
-
TotalCredit: Number(
|
|
510
|
+
Credit: parseFloat((Number(F) - Number(w)).toFixed(2)),
|
|
511
|
+
FreeCredit: Number(w.toFixed(2)),
|
|
512
|
+
TotalCredit: Number(F),
|
|
513
513
|
Exp: e != null && e.collection ? ((u = (o = (a = e.collection) == null ? void 0 : a.POINT) == null ? void 0 : o.at(0)) == null ? void 0 : u.balance) ?? 0 : 0,
|
|
514
514
|
Point: e != null && e.collection ? ((N = (D = (P = e.collection) == null ? void 0 : P.COIN) == null ? void 0 : D.at(0)) == null ? void 0 : N.balance) ?? 0 : 0,
|
|
515
515
|
Level: e != null && e.collection ? ((q = (j = (V = e.collection) == null ? void 0 : V.TIER) == null ? void 0 : j.at(0)) == null ? void 0 : q.balance) ?? 0 : 0,
|
|
@@ -526,7 +526,7 @@ const kt = {
|
|
|
526
526
|
LastSeasonTierEarned: ((de = e.stats) == null ? void 0 : de.lastSeasonTierEarned) || 0,
|
|
527
527
|
LastSeasonPointEarned: ((ue = e.stats) == null ? void 0 : ue.lastSeasonPointEarned) || 0,
|
|
528
528
|
JoinedAt: se(e.joinAt || void 0),
|
|
529
|
-
JoinedAtLocation: e.location && ((pe =
|
|
529
|
+
JoinedAtLocation: e.location && ((pe = v.value.find((T) => T.value == e.location)) == null ? void 0 : pe.label) || "-",
|
|
530
530
|
VisitFrequency: `${Number(
|
|
531
531
|
Math.ceil(e.stats.avgVisitFrequency).toFixed(0)
|
|
532
532
|
)}`
|
|
@@ -535,13 +535,13 @@ const kt = {
|
|
|
535
535
|
}, It = { class: "flex items-center" }, Mt = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, Tt = { class: "px-24 flex flex-col gap-y-16" }, Et = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, At = { class: "fm-typo-en-body-md-600" }, Dt = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, po = /* @__PURE__ */ ee({
|
|
536
536
|
__name: "Segment",
|
|
537
537
|
setup(e) {
|
|
538
|
-
const { minor:
|
|
538
|
+
const { minor: v } = $e, { t: _ } = be(), C = Ce(), { mapMemberExportRow: m } = kt, f = Re(), w = Ze(), F = z(0), n = [
|
|
539
539
|
{
|
|
540
|
-
header:
|
|
540
|
+
header: _("connect.loyalty.segment.table.name"),
|
|
541
541
|
accessorFn: (a) => a.name
|
|
542
542
|
},
|
|
543
543
|
{
|
|
544
|
-
header:
|
|
544
|
+
header: _("connect.loyalty.segment.table.status"),
|
|
545
545
|
enableSorting: !1,
|
|
546
546
|
cell(a) {
|
|
547
547
|
const o = a.row.original.isActive === !1 ? "Inactive" : "Active";
|
|
@@ -553,15 +553,15 @@ const kt = {
|
|
|
553
553
|
}
|
|
554
554
|
},
|
|
555
555
|
{
|
|
556
|
-
header:
|
|
556
|
+
header: _("connect.loyalty.segment.table.total_customers"),
|
|
557
557
|
accessorFn: (a) => a.memberCount ?? 0
|
|
558
558
|
},
|
|
559
559
|
{
|
|
560
|
-
header:
|
|
561
|
-
accessorFn: (a) => ((a.memberCount ?? 0) * 100 /
|
|
560
|
+
header: _("connect.loyalty.segment.table.customer_percentage"),
|
|
561
|
+
accessorFn: (a) => ((a.memberCount ?? 0) * 100 / F.value).toFixed(2)
|
|
562
562
|
},
|
|
563
563
|
{
|
|
564
|
-
header:
|
|
564
|
+
header: _("connect.loyalty.segment.table.actions"),
|
|
565
565
|
meta: {
|
|
566
566
|
maxWidth: "100px"
|
|
567
567
|
},
|
|
@@ -586,7 +586,7 @@ const kt = {
|
|
|
586
586
|
X.FmMenuItem,
|
|
587
587
|
{
|
|
588
588
|
onClick: async (o) => {
|
|
589
|
-
o.stopPropagation(),
|
|
589
|
+
o.stopPropagation(), x(a.row.original);
|
|
590
590
|
}
|
|
591
591
|
},
|
|
592
592
|
{
|
|
@@ -603,7 +603,7 @@ const kt = {
|
|
|
603
603
|
X.FmMenuItem,
|
|
604
604
|
{
|
|
605
605
|
onClick: async (o) => {
|
|
606
|
-
o.stopPropagation(),
|
|
606
|
+
o.stopPropagation(), y(a.row.original);
|
|
607
607
|
}
|
|
608
608
|
},
|
|
609
609
|
{
|
|
@@ -622,19 +622,19 @@ const kt = {
|
|
|
622
622
|
]);
|
|
623
623
|
}
|
|
624
624
|
}
|
|
625
|
-
],
|
|
625
|
+
], i = z(null), { tableMeta: c, rowData: b, debouncedFetchData: A } = we(
|
|
626
626
|
B.readAll
|
|
627
627
|
);
|
|
628
|
-
async function
|
|
629
|
-
await
|
|
628
|
+
async function h() {
|
|
629
|
+
await v(
|
|
630
630
|
async () => {
|
|
631
631
|
await B.refreshSegments(), await A({ pageSize: 10, pageIndex: 0 });
|
|
632
632
|
},
|
|
633
633
|
{ message: "Refreshing segmentations" }
|
|
634
634
|
);
|
|
635
635
|
}
|
|
636
|
-
async function
|
|
637
|
-
await De.remove(`Are you sure you want to remove ${a.name}?`) && await
|
|
636
|
+
async function y(a) {
|
|
637
|
+
await De.remove(`Are you sure you want to remove ${a.name}?`) && await v(
|
|
638
638
|
async () => {
|
|
639
639
|
await B.delete(a._id), await A({ pageSize: 10, pageIndex: 0 });
|
|
640
640
|
},
|
|
@@ -644,7 +644,7 @@ const kt = {
|
|
|
644
644
|
}
|
|
645
645
|
);
|
|
646
646
|
}
|
|
647
|
-
async function
|
|
647
|
+
async function x(a) {
|
|
648
648
|
const o = {
|
|
649
649
|
sortBy: "_id",
|
|
650
650
|
descending: !1,
|
|
@@ -657,7 +657,7 @@ const kt = {
|
|
|
657
657
|
sortBy: o.sortBy,
|
|
658
658
|
descending: o.descending
|
|
659
659
|
})).meta.totalResources ?? 0, D = o.rowsPerPage;
|
|
660
|
-
await
|
|
660
|
+
await v(
|
|
661
661
|
async () => {
|
|
662
662
|
for (let N = 0; N < P; N += D) {
|
|
663
663
|
const V = {
|
|
@@ -693,7 +693,7 @@ const kt = {
|
|
|
693
693
|
);
|
|
694
694
|
}
|
|
695
695
|
async function I(a) {
|
|
696
|
-
await
|
|
696
|
+
await v(
|
|
697
697
|
async () => {
|
|
698
698
|
var o;
|
|
699
699
|
if (a.type === $.enum.STATIC) {
|
|
@@ -705,12 +705,12 @@ const kt = {
|
|
|
705
705
|
const { file: P, ...D } = a;
|
|
706
706
|
u.append("segment", JSON.stringify(D)), await B.createStatic(u);
|
|
707
707
|
}
|
|
708
|
-
a.file &&
|
|
708
|
+
a.file && f.open({
|
|
709
709
|
type: "info",
|
|
710
710
|
title: "Import begins soon. Check Queue for updates.",
|
|
711
711
|
action: "View",
|
|
712
712
|
onAction: async () => {
|
|
713
|
-
await
|
|
713
|
+
await w.push({
|
|
714
714
|
name: _e["$connect-QUEUE"],
|
|
715
715
|
query: { type: [fe.enum.SEGMENTATION_IMPORTED] }
|
|
716
716
|
});
|
|
@@ -721,7 +721,7 @@ const kt = {
|
|
|
721
721
|
await B.update(a._id, D);
|
|
722
722
|
} else
|
|
723
723
|
await B.create(a);
|
|
724
|
-
await A({ pageSize: 10, pageIndex: 0 }), (o =
|
|
724
|
+
await A({ pageSize: 10, pageIndex: 0 }), (o = i.value) == null || o.hideSheet();
|
|
725
725
|
},
|
|
726
726
|
{
|
|
727
727
|
message: "Saving segment",
|
|
@@ -731,15 +731,15 @@ const kt = {
|
|
|
731
731
|
}
|
|
732
732
|
function d(a) {
|
|
733
733
|
var o;
|
|
734
|
-
(o =
|
|
734
|
+
(o = i.value) == null || o.showSheet(a);
|
|
735
735
|
}
|
|
736
|
-
const
|
|
737
|
-
label:
|
|
736
|
+
const s = {
|
|
737
|
+
label: _("connect.navigation.queue"),
|
|
738
738
|
value: "queue",
|
|
739
739
|
isPrimary: !1,
|
|
740
740
|
prependIcon: "work_history"
|
|
741
|
-
},
|
|
742
|
-
|
|
741
|
+
}, g = ce(() => C.isPremium ? [
|
|
742
|
+
s,
|
|
743
743
|
{
|
|
744
744
|
label: "Refresh segments",
|
|
745
745
|
value: "refresh",
|
|
@@ -758,10 +758,10 @@ const kt = {
|
|
|
758
758
|
d();
|
|
759
759
|
break;
|
|
760
760
|
case "refresh":
|
|
761
|
-
|
|
761
|
+
h();
|
|
762
762
|
break;
|
|
763
763
|
case "queue":
|
|
764
|
-
|
|
764
|
+
w.push({
|
|
765
765
|
name: _e["$connect-QUEUE"],
|
|
766
766
|
query: { type: [fe.enum.SEGMENTATION_IMPORTED] }
|
|
767
767
|
});
|
|
@@ -776,30 +776,30 @@ const kt = {
|
|
|
776
776
|
search: void 0,
|
|
777
777
|
descending: !1
|
|
778
778
|
});
|
|
779
|
-
|
|
779
|
+
F.value = a.totalResources ?? 0, await A({ pageSize: 10, pageIndex: 0 }), await C.readPremium(), await C.readLocations();
|
|
780
780
|
}), (a, o) => {
|
|
781
|
-
const u =
|
|
781
|
+
const u = S("FmPill"), P = S("FmPageHead"), D = S("FmIcon"), N = S("FmMenuItem"), V = S("FmMenu"), j = S("FmListItem"), q = S("FmList"), G = S("FmButton"), te = S("FmCard");
|
|
782
782
|
return p(), k(O, null, [
|
|
783
783
|
r(P, {
|
|
784
784
|
title: "Segments",
|
|
785
|
-
actions: t(
|
|
785
|
+
actions: t(g),
|
|
786
786
|
"onClick:action": o[0] || (o[0] = (M) => U(M))
|
|
787
787
|
}, {
|
|
788
788
|
title: E(() => [
|
|
789
|
-
|
|
790
|
-
|
|
789
|
+
l("div", It, [
|
|
790
|
+
l("span", Mt, R(t(_)("connect.loyalty.segment.title")), 1),
|
|
791
791
|
r(u, { variant: "premium" })
|
|
792
792
|
])
|
|
793
793
|
]),
|
|
794
794
|
_: 1
|
|
795
795
|
}, 8, ["actions"]),
|
|
796
|
-
|
|
797
|
-
t(
|
|
796
|
+
l("div", Tt, [
|
|
797
|
+
t(b).length > 0 || t(c).searchValue || t(c).isLoading ? (p(), k(O, { key: 0 }, [
|
|
798
798
|
r(Fe, {
|
|
799
799
|
loading: t(c).isLoading,
|
|
800
|
-
"row-data": t(
|
|
800
|
+
"row-data": t(b),
|
|
801
801
|
"row-count": t(c).totalRows,
|
|
802
|
-
"column-defs":
|
|
802
|
+
"column-defs": n,
|
|
803
803
|
"shrink-at": !1,
|
|
804
804
|
"page-count": t(c).pageCount,
|
|
805
805
|
"page-index": t(c).pageIndex,
|
|
@@ -811,16 +811,16 @@ const kt = {
|
|
|
811
811
|
}, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onPageChange"]),
|
|
812
812
|
r(q, { class: "w-full hidden xs:block" }, {
|
|
813
813
|
default: E(() => [
|
|
814
|
-
(p(!0), k(O, null, ie(t(
|
|
814
|
+
(p(!0), k(O, null, ie(t(b), (M) => (p(), J(j, {
|
|
815
815
|
key: M._id.toString(),
|
|
816
816
|
tag: "label",
|
|
817
817
|
onClick: (Q) => d(M)
|
|
818
818
|
}, {
|
|
819
819
|
default: E(() => [
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
820
|
+
l("div", null, [
|
|
821
|
+
l("div", Et, R((M.memberCount ?? 0).toLocaleString()) + " total customers ", 1),
|
|
822
|
+
l("div", At, R(M.name), 1),
|
|
823
|
+
l("div", Dt, R(((M.memberCount ?? 0) * 100 / t(F)).toFixed(2)) + "% of customers ", 1)
|
|
824
824
|
])
|
|
825
825
|
]),
|
|
826
826
|
append: E(() => [
|
|
@@ -832,7 +832,7 @@ const kt = {
|
|
|
832
832
|
r(N, {
|
|
833
833
|
class: "text-fm-color-typo-error fm-typo-en-body-md-400",
|
|
834
834
|
label: "Remove",
|
|
835
|
-
"onUpdate:modelValue": (Q) => Q &&
|
|
835
|
+
"onUpdate:modelValue": (Q) => Q && y(M)
|
|
836
836
|
}, null, 8, ["onUpdate:modelValue"])
|
|
837
837
|
]),
|
|
838
838
|
_: 2
|
|
@@ -849,13 +849,13 @@ const kt = {
|
|
|
849
849
|
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
850
850
|
}, {
|
|
851
851
|
default: E(() => [
|
|
852
|
-
o[3] || (o[3] =
|
|
852
|
+
o[3] || (o[3] = l("img", {
|
|
853
853
|
src: Ee,
|
|
854
854
|
class: "aspect-square w-[150px]"
|
|
855
855
|
}, null, -1)),
|
|
856
|
-
o[4] || (o[4] =
|
|
857
|
-
|
|
858
|
-
|
|
856
|
+
o[4] || (o[4] = l("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
857
|
+
l("div", { class: "fm-typo-en-title-sm-800" }, "Create customer segments"),
|
|
858
|
+
l("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Segments allow you to categorize your customers based on various criteria, enabling targeted marketing and personalized experiences. ")
|
|
859
859
|
], -1)),
|
|
860
860
|
r(G, {
|
|
861
861
|
variant: "primary",
|
|
@@ -869,7 +869,7 @@ const kt = {
|
|
|
869
869
|
})),
|
|
870
870
|
r(ht, {
|
|
871
871
|
ref_key: "sheetRef",
|
|
872
|
-
ref:
|
|
872
|
+
ref: i,
|
|
873
873
|
"onUpdate:modelValue": I
|
|
874
874
|
}, null, 512)
|
|
875
875
|
])
|