@feedmepos/mf-connect 0.1.0-beta.72 → 0.1.0-beta.74
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-CeQ6Tgo4.js → Analytic-CmX1CjHI.js} +11 -11
- package/dist/{App-B94F1eM6.js → App-T0HK84dx.js} +6 -6
- package/dist/{AuditLogs-CduUWfDd.js → AuditLogs-0ERaLqfa.js} +16 -15
- package/dist/{Bin-muOo03RK.js → Bin-C7utgPUn.js} +8 -8
- package/dist/{Broadcast-CSco_Ev_.js → Broadcast-e2sHc8rv.js} +9 -9
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cfwv0VSC.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-mlnLZOdy.js} +14 -8
- package/dist/{Card-VojKGWaD.js → Card-Bi1q3NGE.js} +164 -155
- package/dist/{Collections-B8dsbCQ6.js → Collections-CJYy94Sc.js} +19 -18
- package/dist/{Credit-Ck_IuJMF.js → Credit-Mbgev3fe.js} +9 -9
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-CkEPB1Ri.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CCIj2_sx.js} +29 -28
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CA1awHcc.js → EffectSheet.vue_vue_type_style_index_0_lang-CGiI-3HJ.js} +6 -6
- package/dist/{Experience-CP6Lmado.js → Experience-BE9onJDQ.js} +9 -9
- package/dist/{Game-BfkyvrxR.js → Game-CxVwNVRg.js} +10 -10
- package/dist/{Index-CsjZUBT3.js → Index-NdgHNGa3.js} +10 -10
- package/dist/{Marketing-D-P76e73.js → Marketing-Deds20Ye.js} +6 -6
- package/dist/{Member-DplZWFjl.js → Member-BiwCcUbl.js} +106 -97
- package/dist/{MemberList-rmdZQk6G.js → MemberList-DCR44Sk4.js} +287 -282
- package/dist/{MemberTransactions-BLANcbUF.js → MemberTransactions-CYPPTT9t.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Cfks94UO.js → MessageInput.vue_vue_type_script_setup_true_lang-j3cmjEyQ.js} +7 -6
- package/dist/{Mission-n-ctxUhM.js → Mission-DYk_Vv35.js} +10 -10
- package/dist/{Overview-DZlApGRk.js → Overview-CsRent_o.js} +20 -19
- package/dist/{Point-COtP0jzH.js → Point-BV5qm3r7.js} +9 -9
- package/dist/{Promotion-DxOTF9a5.js → Promotion-ieE1dY52.js} +10 -10
- package/dist/{Queue-CEIn9dZ3.js → Queue-DkIuyH5Y.js} +76 -67
- package/dist/{Record-3ZeBNdJL.js → Record-BO4eYofF.js} +17 -16
- package/dist/{Reward-QiI0aowk.js → Reward-DcoWW28K.js} +15 -15
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Cz0tKJVt.js → RewardGroup.vue_vue_type_script_setup_true_lang-6s4ElOcQ.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CrfQAYP9.js → RuleGroup.vue_vue_type_script_setup_true_lang-l-qayOI8.js} +15 -14
- package/dist/Segment-dTpsHadj.js +794 -0
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-C39_J7OP.js → SelectItems.vue_vue_type_script_setup_true_lang-Dei-K3cP.js} +2 -2
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-B0fwBafY.js +188 -0
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DC1qZokI.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-Dl30f-41.js} +3 -3
- package/dist/{Setting-BUQfywpm.js → Setting-Cnv36Pu0.js} +16 -15
- package/dist/{Store-STKhCXHd.js → Store-CTK5EtS1.js} +28 -27
- package/dist/{StoreRewards-BbyKdrXv.js → StoreRewards-CnHiDS7A.js} +13 -13
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-BWilzG-3.js → StoreTransactions.vue_vue_type_script_setup_true_lang-o8BduJhH.js} +27 -26
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-Cau0aOLA.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CDCQIDZh.js} +1 -1
- package/dist/{Tier-yaEA-a64.js → Tier-CcN8habX.js} +22 -21
- package/dist/{Title-BZvC2-Jh.js → Title-DtsvtR89.js} +19 -19
- package/dist/{Transaction-D8Q5tgJB.js → Transaction-NylYY_6m.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BhhdZbR2.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Book86tM.js} +6 -6
- package/dist/{Voucher-troykwYN.js → Voucher-z6XGrJrc.js} +12 -12
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CA-pu2mD.js → VoucherEditor.vue_vue_type_script_setup_true_lang-C0TGO7Cl.js} +10 -10
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DGgUG7Qj.js → ZodTextField.vue_vue_type_script_setup_true_lang-Du4wOEBs.js} +1 -1
- package/dist/{app-CPknSRjl.js → app-Dew6WljN.js} +1 -1
- package/dist/{app-B89lfub2.js → app-nEHwJezD.js} +34 -34
- package/dist/app.js +1 -1
- package/dist/{business-hK-Tmb19.js → business-CXTuYix4.js} +1 -1
- package/dist/{campaign-Bz2phAKq.js → campaign-BZs7RPUJ.js} +9 -9
- package/dist/{campaign-DxBhaMAH.js → campaign-C18IUOcO.js} +2 -2
- package/dist/{campaign.enum-CaW4wKab.js → campaign.enum-C7o8B5Cf.js} +1 -1
- package/dist/{campaign.fn-VlvF65nU.js → campaign.fn-CP0x2e6M.js} +2 -2
- package/dist/{collectible.enum-CL4zeuNW.js → collectible.enum-QJSyw8dX.js} +1 -1
- package/dist/{collection.fn-DonS6vla.js → collection.fn-_9GY8WUr.js} +2 -2
- package/dist/{dto-Do28C6Us.js → dto-Cwr4tMef.js} +4 -4
- package/dist/{effect-BNoEad9s.js → effect-C3dyQmVR.js} +1 -1
- package/dist/{email-addresses-DVlPQOMF.js → email-addresses-DNwlAZV3.js} +1 -1
- package/dist/{export-B2HL-u8e.js → export-C11NCFgO.js} +3 -3
- package/dist/{helper-B-GwBl7o.js → helper-HHvZd4M_.js} +1 -1
- package/dist/{index-DziwUgQ3.js → index-8MnjnTtN.js} +1 -1
- package/dist/{index-CJfbls_c.js → index-B0zezW3E.js} +1 -1
- package/dist/{index-DLBH6Pz7.js → index-BzIzz7cS.js} +3 -3
- package/dist/{index-DrNO2330.js → index-CCTd1lLH.js} +437 -426
- package/dist/{index-CyLhq-Cu.js → index-CIKyf9ft.js} +1 -1
- package/dist/{index-DDyqoK-5.js → index-CL0DvpMU.js} +1 -1
- package/dist/{index-B1zeyOTK.js → index-CT4Hyf4w.js} +6 -6
- package/dist/{index-zetVbSGH.js → index-CyXkN89w.js} +2 -2
- package/dist/{index-BgaXtrUK.js → index-DJ-RhIDQ.js} +1 -1
- package/dist/{index-C00luv9F.js → index-DM6Zvwcl.js} +1 -1
- package/dist/{index-DdMBH5E3.js → index-DyfTL0NG.js} +1 -1
- package/dist/{plugins-0WrJ_ypd.js → index-jdsxOVkp.js} +2606 -2811
- package/dist/{index-DoLnZ0VU.js → index-yrwLRgg0.js} +3 -3
- package/dist/{index.esm2017-DUs_L3s2.js → index.esm2017-BMFlbxdx.js} +3 -3
- package/dist/{loading-BfH5PK5q.js → loading-ClVTDQc6.js} +1 -1
- package/dist/{membership-BSgYE5mw.js → membership-DqMQPgdF.js} +54 -48
- package/dist/{money-CXqLCoho.js → money-COS1BMzW.js} +1 -1
- package/dist/{number-CGz3yWyy.js → number-BuP5vRmO.js} +1 -1
- package/dist/{objectid-CH4l4E6N.js → objectid-B3LrrWLD.js} +1 -1
- package/dist/plugins-DWMQmNXZ.js +208 -0
- package/dist/{reward-DdFCP398.js → reward-Dh8eazpS.js} +1 -1
- package/dist/{rule-Fkz4cRmK.js → rule-CaiZcfw4.js} +3 -3
- package/dist/{rule-builder-Cq_MnX2R.js → rule-builder-DOHyUDI2.js} +1 -1
- package/dist/{template-DzWwfIhG.js → template-BZCh-lEH.js} +4 -4
- package/dist/{trigger-z_YD5Ld4.js → trigger-CUY_7-so.js} +4 -4
- package/dist/{user-qQossvab.js → user-DWsuhUnL.js} +1 -1
- package/dist/{vue-i18n-CeeBM23W.js → vue-i18n-BXjn2dYe.js} +158 -158
- package/dist/{xlsx-BaKm4Is1.js → xlsx-BGsRNT8x.js} +1 -1
- package/package.json +1 -1
- package/dist/Segment-Df47WLC6.js +0 -568
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-CCketLSU.js +0 -186
|
@@ -0,0 +1,794 @@
|
|
|
1
|
+
import { defineComponent as K, ref as N, resolveComponent as h, openBlock as f, createElementBlock as C, createElementVNode as i, createVNode as d, unref as t, createCommentVNode as ye, createBlock as G, toDisplayString as $, normalizeClass as ne, onMounted as ve, Fragment as H, renderList as _e, withCtx as R, computed as se, isRef as be, createSlots as Ce, h as V, onBeforeMount as ke } from "vue";
|
|
2
|
+
import { _ as Me } from "./campaign-CpzFl8Vr.js";
|
|
3
|
+
import { p as Ie } from "./plugins-DWMQmNXZ.js";
|
|
4
|
+
import { u as Re } from "./loading-ClVTDQc6.js";
|
|
5
|
+
import { FmButtonVariant as oe, useSnackbar as Ee, components as te } from "@feedmepos/ui-library";
|
|
6
|
+
import { u as xe, _ as Se } from "./usePagination-BeF5K3M7.js";
|
|
7
|
+
import { u as he } from "./vue-i18n-BXjn2dYe.js";
|
|
8
|
+
import "./index-CT4Hyf4w.js";
|
|
9
|
+
import { i as $e, c as de } from "./index-CCTd1lLH.js";
|
|
10
|
+
import "./index-CyXkN89w.js";
|
|
11
|
+
import "./index-CL0DvpMU.js";
|
|
12
|
+
import "./index-yrwLRgg0.js";
|
|
13
|
+
import { w as Te } from "./xlsx-BGsRNT8x.js";
|
|
14
|
+
import { e as Pe, M as De } from "./email-addresses-DNwlAZV3.js";
|
|
15
|
+
import { Z as Ae } from "./zod-Bg2FbC-D.js";
|
|
16
|
+
import { u as Be } from "./app-wDQR6dpb.js";
|
|
17
|
+
import { F as ue, z as Ve } from "./index-jdsxOVkp.js";
|
|
18
|
+
import { R as pe } from "./rule-builder-DOHyUDI2.js";
|
|
19
|
+
import { _ as Ne } from "./ZodTextField.vue_vue_type_script_setup_true_lang-Du4wOEBs.js";
|
|
20
|
+
import { _ as Le } from "./RuleGroup.vue_vue_type_script_setup_true_lang-l-qayOI8.js";
|
|
21
|
+
import { u as Ye, v as Ue, w as ze } from "./index.esm2017-BMFlbxdx.js";
|
|
22
|
+
import { h as j } from "./moment-BWErdI6_.js";
|
|
23
|
+
import { s as P, u as Oe } from "./membership-DqMQPgdF.js";
|
|
24
|
+
import { o as qe } from "./objectId-dwaoBfJX.js";
|
|
25
|
+
import { u as Fe } from "./business-CXTuYix4.js";
|
|
26
|
+
import { f as je } from "./number-BuP5vRmO.js";
|
|
27
|
+
import { t as He } from "./money-COS1BMzW.js";
|
|
28
|
+
import "./index-8MnjnTtN.js";
|
|
29
|
+
import { useRouter as Ge } from "vue-router";
|
|
30
|
+
import { m as me } from "./index-DyfTL0NG.js";
|
|
31
|
+
import { R as fe } from "./app-nEHwJezD.js";
|
|
32
|
+
const Je = $e.extend({
|
|
33
|
+
_id: ue.optional(),
|
|
34
|
+
business: ue.optional(),
|
|
35
|
+
file: Ve.any().nullish()
|
|
36
|
+
}), Qe = { class: "flex flex-col space-y-16" }, Ze = {
|
|
37
|
+
key: 0,
|
|
38
|
+
class: /* @__PURE__ */ ne([
|
|
39
|
+
"p-16 pl-24 space-x-8",
|
|
40
|
+
"bg-fm-color-primary-oats rounded-lg",
|
|
41
|
+
"flex items-center",
|
|
42
|
+
"justify-between"
|
|
43
|
+
])
|
|
44
|
+
}, We = {
|
|
45
|
+
key: 2,
|
|
46
|
+
class: /* @__PURE__ */ ne([
|
|
47
|
+
"flex items-center",
|
|
48
|
+
"border border-fm-color-neutral-gray-300",
|
|
49
|
+
"p-16 space-x-16 rounded-md"
|
|
50
|
+
])
|
|
51
|
+
}, Ke = { class: "fm-typo-en-body-lg-400 flex-1 truncate" }, Xe = /* @__PURE__ */ K({
|
|
52
|
+
__name: "ImportSegment",
|
|
53
|
+
props: {
|
|
54
|
+
importFile: {}
|
|
55
|
+
},
|
|
56
|
+
emits: ["update:file"],
|
|
57
|
+
setup(e, { emit: g }) {
|
|
58
|
+
const _ = e, x = g, { t: u } = he(), m = N(null), p = N(null);
|
|
59
|
+
async function S() {
|
|
60
|
+
if (_.importFile)
|
|
61
|
+
try {
|
|
62
|
+
const n = Ye(), c = Ue(n, _.importFile), y = await ze(c);
|
|
63
|
+
window.open(y, "_blank");
|
|
64
|
+
} catch (n) {
|
|
65
|
+
console.log(n);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function l(n) {
|
|
69
|
+
m.value = n, x("update:file", m.value);
|
|
70
|
+
}
|
|
71
|
+
function s(n) {
|
|
72
|
+
var y, I;
|
|
73
|
+
const c = ((I = (y = n.target) == null ? void 0 : y.files) == null ? void 0 : I[0]) ?? null;
|
|
74
|
+
l(c);
|
|
75
|
+
}
|
|
76
|
+
return (n, c) => {
|
|
77
|
+
const y = h("FmButton"), I = h("FmDropField");
|
|
78
|
+
return f(), C("div", Qe, [
|
|
79
|
+
c[2] || (c[2] = i("div", { class: "fm-typo-en-title-sm-800" }, "Upload File", -1)),
|
|
80
|
+
n.importFile ? (f(), C("div", Ze, [
|
|
81
|
+
d(y, {
|
|
82
|
+
label: t(u)("View uploaded file"),
|
|
83
|
+
variant: t(oe).Plain,
|
|
84
|
+
icon: "file_present",
|
|
85
|
+
onClick: S
|
|
86
|
+
}, null, 8, ["label", "variant"])
|
|
87
|
+
])) : ye("", !0),
|
|
88
|
+
m.value ? (f(), C("div", We, [
|
|
89
|
+
d(y, {
|
|
90
|
+
variant: t(oe).Tertiary,
|
|
91
|
+
"prepend-icon": "attach_file"
|
|
92
|
+
}, null, 8, ["variant"]),
|
|
93
|
+
i("p", Ke, $(m.value.name), 1),
|
|
94
|
+
i("label", {
|
|
95
|
+
ref_key: "fileLabelRef",
|
|
96
|
+
ref: p,
|
|
97
|
+
htmlFor: "file"
|
|
98
|
+
}, [
|
|
99
|
+
d(y, {
|
|
100
|
+
variant: t(oe).Plain,
|
|
101
|
+
label: t(u)("Replace File"),
|
|
102
|
+
onClick: c[1] || (c[1] = () => {
|
|
103
|
+
var k;
|
|
104
|
+
return (k = p.value) == null ? void 0 : k.click();
|
|
105
|
+
})
|
|
106
|
+
}, null, 8, ["variant", "label"]),
|
|
107
|
+
i("input", {
|
|
108
|
+
id: "file",
|
|
109
|
+
accept: ".csv, .xlsx",
|
|
110
|
+
class: "hidden",
|
|
111
|
+
type: "file",
|
|
112
|
+
multiple: "",
|
|
113
|
+
onChange: s
|
|
114
|
+
}, null, 32)
|
|
115
|
+
], 512)
|
|
116
|
+
])) : (f(), G(I, {
|
|
117
|
+
key: 1,
|
|
118
|
+
onFileUpload: c[0] || (c[0] = (k) => l(k)),
|
|
119
|
+
accept: ".csv",
|
|
120
|
+
"max-file-size": 2e7
|
|
121
|
+
}))
|
|
122
|
+
]);
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
}), et = { class: "space-y-16 pr-12" }, tt = { class: "fm-typo-en-title-md-800" }, ot = { class: "flex space-x-8" }, at = { class: "fm-typo-en-title-md-800 text-fm-color-primary" }, nt = { class: "text-fm-color-typo-secondary" }, st = /* @__PURE__ */ K({
|
|
126
|
+
__name: "ReviewSegment",
|
|
127
|
+
props: {
|
|
128
|
+
title: {},
|
|
129
|
+
segment: {}
|
|
130
|
+
},
|
|
131
|
+
setup(e) {
|
|
132
|
+
const g = e, _ = [
|
|
133
|
+
{
|
|
134
|
+
header: "Name",
|
|
135
|
+
accessorFn: (s) => s.name
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
header: "Id",
|
|
139
|
+
accessorFn: (s) => s._id
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
header: "Customer Since",
|
|
143
|
+
accessorFn: (s) => j(qe(s._id.toString())).format("DD MMM YYYY")
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
header: "Phone",
|
|
147
|
+
accessorFn: (s) => s.phoneNumber
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
header: "Birthday",
|
|
151
|
+
accessorFn: (s) => j(s.birthday).format("DD MMM YYYY")
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
header: "Last Visit",
|
|
155
|
+
accessorFn: (s) => j(s.stats.lastVisit).format("DD MMM YYYY")
|
|
156
|
+
}
|
|
157
|
+
], x = async (s) => g.segment._id ? await P.paginateSegmentUsers(g.segment._id, {
|
|
158
|
+
limit: u.value.pageSize,
|
|
159
|
+
skip: s.pageIndex ?? 0,
|
|
160
|
+
sortBy: "_id",
|
|
161
|
+
search: s.searchValue,
|
|
162
|
+
descending: !0
|
|
163
|
+
}) : { resources: [], meta: { totalResources: 0, totalPages: 0 } }, { tableMeta: u, rowData: m, onSort: p, debouncedFetchData: S, onSearch: l } = xe(x);
|
|
164
|
+
return ve(async () => {
|
|
165
|
+
await S();
|
|
166
|
+
}), (s, n) => (f(), C("div", et, [
|
|
167
|
+
i("div", tt, $(g.title), 1),
|
|
168
|
+
i("div", ot, [
|
|
169
|
+
i("div", at, $(s.segment.members.length), 1),
|
|
170
|
+
i("div", nt, [
|
|
171
|
+
n[1] || (n[1] = i("div", null, "contacts in your segment", -1)),
|
|
172
|
+
i("div", null, "as of " + $(t(j)(s.segment.lastUpdated).format("DD MMM YYYY")), 1)
|
|
173
|
+
])
|
|
174
|
+
]),
|
|
175
|
+
d(Se, {
|
|
176
|
+
loading: t(u).isLoading,
|
|
177
|
+
"row-data": t(m),
|
|
178
|
+
"row-count": t(u).totalRows,
|
|
179
|
+
"column-defs": _,
|
|
180
|
+
"page-size": t(u).pageSize,
|
|
181
|
+
"page-count": t(u).pageCount,
|
|
182
|
+
"page-index": t(u).pageIndex,
|
|
183
|
+
onSortChange: t(p),
|
|
184
|
+
onPageChange: n[0] || (n[0] = (c) => t(S)({ pageSize: c.pageSize, pageIndex: c.pageIndex }))
|
|
185
|
+
}, null, 8, ["loading", "row-data", "row-count", "page-size", "page-count", "page-index", "onSortChange"])
|
|
186
|
+
]));
|
|
187
|
+
}
|
|
188
|
+
}), it = { class: "space-y-24" }, lt = { class: "grid grid-cols-2 gap-16" }, rt = { class: "fm-typo-en-title-sm-800" }, ct = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, dt = /* @__PURE__ */ K({
|
|
189
|
+
__name: "SegmentRecalculationOption",
|
|
190
|
+
props: {
|
|
191
|
+
modelValue: { type: Boolean },
|
|
192
|
+
errorText: {}
|
|
193
|
+
},
|
|
194
|
+
emits: ["update:model-value"],
|
|
195
|
+
setup(e, { emit: g }) {
|
|
196
|
+
const _ = e, x = g, u = [
|
|
197
|
+
{
|
|
198
|
+
label: "Active",
|
|
199
|
+
sublabel: "Segment statistics are based on rules configured and will be recalculated automatically when rule changes.",
|
|
200
|
+
value: !0
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
label: "Inactive",
|
|
204
|
+
sublabel: "Segment statistics are based on imported data and will not be recalculated.",
|
|
205
|
+
value: !1
|
|
206
|
+
}
|
|
207
|
+
];
|
|
208
|
+
function m(p) {
|
|
209
|
+
p !== _.modelValue && x("update:model-value", p);
|
|
210
|
+
}
|
|
211
|
+
return (p, S) => {
|
|
212
|
+
const l = h("FmCard"), s = h("FmHelperText");
|
|
213
|
+
return f(), C("div", it, [
|
|
214
|
+
i("div", lt, [
|
|
215
|
+
(f(), C(H, null, _e(u, (n) => d(l, {
|
|
216
|
+
variant: "outlined",
|
|
217
|
+
class: ne(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
|
|
218
|
+
"col-span-2": u.length == 1,
|
|
219
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": p.modelValue === n.value,
|
|
220
|
+
"hover:bg-fm-color-opacity-sm": p.modelValue !== n.value
|
|
221
|
+
}]),
|
|
222
|
+
onClick: (c) => m(n.value),
|
|
223
|
+
key: n.value
|
|
224
|
+
}, {
|
|
225
|
+
default: R(() => [
|
|
226
|
+
i("div", rt, $(n.label), 1),
|
|
227
|
+
i("div", ct, $(n.sublabel), 1)
|
|
228
|
+
]),
|
|
229
|
+
_: 2
|
|
230
|
+
}, 1032, ["class", "onClick"])), 64))
|
|
231
|
+
]),
|
|
232
|
+
p.errorText ? (f(), G(s, {
|
|
233
|
+
key: 0,
|
|
234
|
+
class: "!mt-4",
|
|
235
|
+
text: p.errorText,
|
|
236
|
+
state: "error"
|
|
237
|
+
}, null, 8, ["text"])) : ye("", !0)
|
|
238
|
+
]);
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
}), ut = { class: "flex items-center gap-x-8" }, pt = {
|
|
242
|
+
key: 0,
|
|
243
|
+
class: "space-y-16 pr-12"
|
|
244
|
+
}, mt = { class: "flex flex-col space-y-16" }, ft = {
|
|
245
|
+
key: 0,
|
|
246
|
+
class: "flex flex-col space-y-16"
|
|
247
|
+
}, gt = {
|
|
248
|
+
key: 1,
|
|
249
|
+
class: "flex flex-col space-y-16"
|
|
250
|
+
}, yt = { class: "flex items-center gap-8" }, vt = /* @__PURE__ */ K({
|
|
251
|
+
__name: "SegmentSheet",
|
|
252
|
+
emits: ["update:model-value"],
|
|
253
|
+
setup(e, { expose: g, emit: _ }) {
|
|
254
|
+
const x = Be(), u = N(!1), m = N(!1), p = {
|
|
255
|
+
name: "",
|
|
256
|
+
isActive: !0,
|
|
257
|
+
rule: pe.scaffoldGroup(),
|
|
258
|
+
members: []
|
|
259
|
+
}, S = Je, l = N(p), s = se(() => {
|
|
260
|
+
const v = S.safeParse(l.value);
|
|
261
|
+
return v.success ? [] : v.error.errors;
|
|
262
|
+
});
|
|
263
|
+
function n(v) {
|
|
264
|
+
u.value = !0, m.value = !1, v ? l.value = {
|
|
265
|
+
...v,
|
|
266
|
+
isActive: v.isActive !== !1
|
|
267
|
+
} : l.value = { ...p };
|
|
268
|
+
}
|
|
269
|
+
function c() {
|
|
270
|
+
u.value = !1;
|
|
271
|
+
}
|
|
272
|
+
async function y() {
|
|
273
|
+
S.safeParse(l.value).success && (m.value = !0);
|
|
274
|
+
}
|
|
275
|
+
function I() {
|
|
276
|
+
m.value = !1;
|
|
277
|
+
}
|
|
278
|
+
async function k() {
|
|
279
|
+
l.value.isActive === !1 ? l.value.rule = pe.scaffoldGroup() : l.value.file = void 0, Y("update:model-value", l.value);
|
|
280
|
+
}
|
|
281
|
+
async function L(v) {
|
|
282
|
+
l.value.isActive = v;
|
|
283
|
+
}
|
|
284
|
+
ve(async () => {
|
|
285
|
+
});
|
|
286
|
+
const Y = _;
|
|
287
|
+
return g({
|
|
288
|
+
showSheet: n,
|
|
289
|
+
hideSheet: c
|
|
290
|
+
}), (v, r) => {
|
|
291
|
+
const E = h("FmButton"), U = h("FmSideSheet");
|
|
292
|
+
return f(), G(U, {
|
|
293
|
+
modelValue: t(u),
|
|
294
|
+
"onUpdate:modelValue": r[7] || (r[7] = (o) => be(u) ? u.value = o : null),
|
|
295
|
+
header: "Add segment",
|
|
296
|
+
"dismiss-away": "",
|
|
297
|
+
"close-button": !0,
|
|
298
|
+
"max-width": 1100
|
|
299
|
+
}, Ce({
|
|
300
|
+
"side-sheet-footer": R(() => [
|
|
301
|
+
i("div", yt, [
|
|
302
|
+
t(m) || !t(l).isActive ? (f(), C(H, { key: 0 }, [
|
|
303
|
+
d(E, {
|
|
304
|
+
label: "Save Segment",
|
|
305
|
+
onClick: k,
|
|
306
|
+
loading: t(x).isLoading,
|
|
307
|
+
disabled: t(s).length > 0 || t(x).isLoading
|
|
308
|
+
}, null, 8, ["loading", "disabled"]),
|
|
309
|
+
d(E, {
|
|
310
|
+
label: "Cancel",
|
|
311
|
+
onClick: r[5] || (r[5] = (o) => I()),
|
|
312
|
+
variant: "tertiary"
|
|
313
|
+
})
|
|
314
|
+
], 64)) : (f(), C(H, { key: 1 }, [
|
|
315
|
+
d(E, {
|
|
316
|
+
label: "Review Segment",
|
|
317
|
+
disabled: t(s).length > 0 || t(x).isLoading,
|
|
318
|
+
onClick: y
|
|
319
|
+
}, null, 8, ["disabled"]),
|
|
320
|
+
d(E, {
|
|
321
|
+
label: "Cancel",
|
|
322
|
+
onClick: r[6] || (r[6] = (o) => c()),
|
|
323
|
+
variant: "tertiary"
|
|
324
|
+
})
|
|
325
|
+
], 64))
|
|
326
|
+
])
|
|
327
|
+
]),
|
|
328
|
+
default: R(() => {
|
|
329
|
+
var o;
|
|
330
|
+
return [
|
|
331
|
+
t(m) ? (f(), G(st, {
|
|
332
|
+
key: 1,
|
|
333
|
+
title: t(l).name,
|
|
334
|
+
segment: t(l)
|
|
335
|
+
}, null, 8, ["title", "segment"])) : (f(), C("div", pt, [
|
|
336
|
+
d(Ne, {
|
|
337
|
+
modelValue: t(l).name,
|
|
338
|
+
"onUpdate:modelValue": r[1] || (r[1] = (a) => t(l).name = a),
|
|
339
|
+
label: "Segment title",
|
|
340
|
+
schema: t(Ae).typeAtPath(t(S), "name")
|
|
341
|
+
}, null, 8, ["modelValue", "schema"]),
|
|
342
|
+
i("div", mt, [
|
|
343
|
+
r[9] || (r[9] = i("div", { class: "fm-typo-en-title-sm-800" }, "Segment Type", -1)),
|
|
344
|
+
d(dt, {
|
|
345
|
+
"model-value": t(l).isActive,
|
|
346
|
+
"onUpdate:modelValue": r[2] || (r[2] = (a) => {
|
|
347
|
+
L(a);
|
|
348
|
+
})
|
|
349
|
+
}, null, 8, ["model-value"])
|
|
350
|
+
]),
|
|
351
|
+
t(l).isActive ? (f(), C("div", ft, [
|
|
352
|
+
r[10] || (r[10] = i("div", { class: "fm-typo-en-title-sm-800" }, "Segment Filter", -1)),
|
|
353
|
+
d(Le, {
|
|
354
|
+
"trigger-type": "MEMBERSHIP_JOINED",
|
|
355
|
+
includeOnly: "user",
|
|
356
|
+
"model-value": (o = t(l)) == null ? void 0 : o.rule,
|
|
357
|
+
"onUpdate:modelValue": r[3] || (r[3] = (a) => {
|
|
358
|
+
t(l).rule = a;
|
|
359
|
+
})
|
|
360
|
+
}, null, 8, ["model-value"])
|
|
361
|
+
])) : (f(), C("div", gt, [
|
|
362
|
+
d(Xe, {
|
|
363
|
+
importFile: t(l).importFile,
|
|
364
|
+
"onUpdate:file": r[4] || (r[4] = (a) => {
|
|
365
|
+
t(l).file = a;
|
|
366
|
+
})
|
|
367
|
+
}, null, 8, ["importFile"])
|
|
368
|
+
]))
|
|
369
|
+
]))
|
|
370
|
+
];
|
|
371
|
+
}),
|
|
372
|
+
_: 2
|
|
373
|
+
}, [
|
|
374
|
+
t(m) ? {
|
|
375
|
+
name: "side-sheet-header",
|
|
376
|
+
fn: R(() => [
|
|
377
|
+
i("div", ut, [
|
|
378
|
+
d(E, {
|
|
379
|
+
icon: "arrow_back",
|
|
380
|
+
variant: "tertiary",
|
|
381
|
+
onClick: r[0] || (r[0] = (o) => m.value = !1)
|
|
382
|
+
}),
|
|
383
|
+
r[8] || (r[8] = i("div", null, "Review segment", -1))
|
|
384
|
+
])
|
|
385
|
+
]),
|
|
386
|
+
key: "0"
|
|
387
|
+
} : void 0
|
|
388
|
+
]), 1032, ["modelValue"]);
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
}), ge = Oe(), _t = Fe();
|
|
392
|
+
function ae(e) {
|
|
393
|
+
const g = j(e);
|
|
394
|
+
return g.isValid() ? g.format("DD/MM/YYYY") : "";
|
|
395
|
+
}
|
|
396
|
+
const xt = {
|
|
397
|
+
mapMemberExportRow: (e) => {
|
|
398
|
+
var s, n, c, y, I, k, L, Y, v, r, E, U, o, a, F, T, M, D, A, z, O, q, X, w, J, ie, le, re;
|
|
399
|
+
const g = se(() => _t.locations.map((b) => ({
|
|
400
|
+
label: b.name,
|
|
401
|
+
value: b._id
|
|
402
|
+
}))), _ = (s = Pe.parseOneAddress(
|
|
403
|
+
e == null ? void 0 : e.email
|
|
404
|
+
)) != null && s.domain.includes("feedmepos.com") ? void 0 : e.email, x = (c = ((n = e == null ? void 0 : e.collection) == null ? void 0 : n.TITLE) || []) == null ? void 0 : c.reduce(
|
|
405
|
+
(b, B) => {
|
|
406
|
+
var Z, W;
|
|
407
|
+
const Q = (W = (Z = ge.sortedTitles) == null ? void 0 : Z.find(
|
|
408
|
+
(ee) => ee._id === B.collectible
|
|
409
|
+
)) == null ? void 0 : W.name;
|
|
410
|
+
return !Q || B.balance <= 0 || b.push(Q), b;
|
|
411
|
+
},
|
|
412
|
+
[]
|
|
413
|
+
), u = (ge.sortedTitles || []).reduce(
|
|
414
|
+
(b, B) => {
|
|
415
|
+
var Z, W, ee, ce;
|
|
416
|
+
const Q = (ce = (ee = (W = (((Z = e == null ? void 0 : e.collection) == null ? void 0 : Z.TITLE) || []).find(
|
|
417
|
+
(we) => we.collectible === B._id
|
|
418
|
+
)) == null ? void 0 : W.expiryBalance) == null ? void 0 : ee[0]) == null ? void 0 : ce.expiredAt;
|
|
419
|
+
return b[B.name] = Q ? j(Q).format("DD/MM/YYYY") : "", b;
|
|
420
|
+
},
|
|
421
|
+
{}
|
|
422
|
+
), m = ((k = (I = (y = e.collection) == null ? void 0 : y.CREDIT) == null ? void 0 : I.at(0)) == null ? void 0 : k.balance) || 0, p = ((r = (v = (Y = (L = e.collection) == null ? void 0 : L.CREDIT) == null ? void 0 : Y.at(0)) == null ? void 0 : v.expiryBalance) == null ? void 0 : r.reduce(
|
|
423
|
+
(b, B) => b + B.amount,
|
|
424
|
+
0
|
|
425
|
+
)) || 0, S = je(m, 2);
|
|
426
|
+
return {
|
|
427
|
+
ID: e._id.toString(),
|
|
428
|
+
Name: ((E = e.name) == null ? void 0 : E.trim()) || "",
|
|
429
|
+
Phone: ((U = e == null ? void 0 : e.phoneNumber) == null ? void 0 : U.trim()) || "",
|
|
430
|
+
Email: _ || "",
|
|
431
|
+
Gender: e.gender || "",
|
|
432
|
+
CardNo: e.cardNo || "",
|
|
433
|
+
Birthday: e != null && e.birthday ? ae(e == null ? void 0 : e.birthday) : "",
|
|
434
|
+
Credit: parseFloat((Number(S) - Number(p)).toFixed(2)),
|
|
435
|
+
FreeCredit: Number(p.toFixed(2)),
|
|
436
|
+
TotalCredit: Number(S),
|
|
437
|
+
Exp: e != null && e.collection ? ((F = (a = (o = e.collection) == null ? void 0 : o.POINT) == null ? void 0 : a.at(0)) == null ? void 0 : F.balance) ?? 0 : 0,
|
|
438
|
+
Point: e != null && e.collection ? ((D = (M = (T = e.collection) == null ? void 0 : T.COIN) == null ? void 0 : M.at(0)) == null ? void 0 : D.balance) ?? 0 : 0,
|
|
439
|
+
Level: e != null && e.collection ? ((O = (z = (A = e.collection) == null ? void 0 : A.TIER) == null ? void 0 : z.at(0)) == null ? void 0 : O.balance) ?? 0 : 0,
|
|
440
|
+
Tier: e != null && e.collection ? ((w = (X = (q = e.collection) == null ? void 0 : q.TIER) == null ? void 0 : X.at(0)) == null ? void 0 : w.balance) ?? 0 : 0,
|
|
441
|
+
Titles: x.join(","),
|
|
442
|
+
...u,
|
|
443
|
+
TotalTransaction: e.stats.visitCount,
|
|
444
|
+
AvgSpent: He(Number(e.stats.avgBillSize || 0)).toFormat(
|
|
445
|
+
!1
|
|
446
|
+
),
|
|
447
|
+
TotalSpent: e.stats.avgBillSize * e.stats.visitCount,
|
|
448
|
+
LastVisit: ae(e.stats.lastVisit),
|
|
449
|
+
Feedback: ((J = e.stats) == null ? void 0 : J.feedbackCount) || 0,
|
|
450
|
+
LastSeasonTierEarned: ((ie = e.stats) == null ? void 0 : ie.lastSeasonTierEarned) || 0,
|
|
451
|
+
LastSeasonPointEarned: ((le = e.stats) == null ? void 0 : le.lastSeasonPointEarned) || 0,
|
|
452
|
+
JoinedAt: ae(e.joinAt || void 0),
|
|
453
|
+
JoinedAtLocation: e.location && ((re = g.value.find((b) => b.value == e.location)) == null ? void 0 : re.label) || "-",
|
|
454
|
+
VisitFrequency: `${Number(
|
|
455
|
+
Math.ceil(e.stats.avgVisitFrequency).toFixed(0)
|
|
456
|
+
)}`
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
}, St = { class: "flex items-center" }, ht = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, Ft = { class: "px-24 flex flex-col gap-y-16" }, wt = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, bt = { class: "fm-typo-en-body-md-600" }, Ct = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, ao = /* @__PURE__ */ K({
|
|
460
|
+
__name: "Segment",
|
|
461
|
+
setup(e) {
|
|
462
|
+
const { minor: g } = Re, { t: _ } = he(), x = Fe(), { mapMemberExportRow: u } = xt, m = Ee(), p = Ge(), S = N(0), l = [
|
|
463
|
+
{
|
|
464
|
+
header: _("connect.loyalty.segment.table.name"),
|
|
465
|
+
accessorFn: (o) => o.name
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
header: _("connect.loyalty.segment.table.total_customers"),
|
|
469
|
+
accessorFn: (o) => o.memberCount ?? 0
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
header: _("connect.loyalty.segment.table.customer_percentage"),
|
|
473
|
+
accessorFn: (o) => ((o.memberCount ?? 0) * 100 / S.value).toFixed(2)
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
header: _("connect.loyalty.segment.table.actions"),
|
|
477
|
+
meta: {
|
|
478
|
+
maxWidth: "100px"
|
|
479
|
+
},
|
|
480
|
+
cell(o) {
|
|
481
|
+
return V("div", { class: "flex items-center justify-end" }, [
|
|
482
|
+
V(
|
|
483
|
+
te.FmMenu,
|
|
484
|
+
{
|
|
485
|
+
placement: "bottom-end",
|
|
486
|
+
onClick: (a) => {
|
|
487
|
+
a.stopPropagation();
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
"menu-button": () => V(te.FmButton, {
|
|
492
|
+
icon: "more_vert",
|
|
493
|
+
iconColor: "neutral-gray-400",
|
|
494
|
+
variant: "tertiary"
|
|
495
|
+
}),
|
|
496
|
+
default: () => [
|
|
497
|
+
V(
|
|
498
|
+
te.FmMenuItem,
|
|
499
|
+
{
|
|
500
|
+
onClick: async (a) => {
|
|
501
|
+
a.stopPropagation(), L(o.row.original);
|
|
502
|
+
}
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
label: V(
|
|
506
|
+
"div",
|
|
507
|
+
{
|
|
508
|
+
class: "fm-typo-en-body-md-400"
|
|
509
|
+
},
|
|
510
|
+
"Export"
|
|
511
|
+
)
|
|
512
|
+
}
|
|
513
|
+
),
|
|
514
|
+
V(
|
|
515
|
+
te.FmMenuItem,
|
|
516
|
+
{
|
|
517
|
+
onClick: async (a) => {
|
|
518
|
+
a.stopPropagation(), k(o.row.original);
|
|
519
|
+
}
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
label: V(
|
|
523
|
+
"div",
|
|
524
|
+
{
|
|
525
|
+
class: "text-fm-color-typo-error fm-typo-en-body-md-400"
|
|
526
|
+
},
|
|
527
|
+
"Remove"
|
|
528
|
+
)
|
|
529
|
+
}
|
|
530
|
+
)
|
|
531
|
+
]
|
|
532
|
+
}
|
|
533
|
+
)
|
|
534
|
+
]);
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
], s = N(null), { tableMeta: n, rowData: c, debouncedFetchData: y } = xe(
|
|
538
|
+
P.readAll
|
|
539
|
+
);
|
|
540
|
+
async function I() {
|
|
541
|
+
await g(
|
|
542
|
+
async () => {
|
|
543
|
+
await P.refreshSegments(), await y({ pageSize: 10, pageIndex: 0 });
|
|
544
|
+
},
|
|
545
|
+
{ message: "Refreshing segmentations" }
|
|
546
|
+
);
|
|
547
|
+
}
|
|
548
|
+
async function k(o) {
|
|
549
|
+
await Ie.remove(`Are you sure you want to remove ${o.name}?`) && await g(
|
|
550
|
+
async () => {
|
|
551
|
+
await P.delete(o._id), await y({ pageSize: 10, pageIndex: 0 });
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
message: `Removing ${o.name}`,
|
|
555
|
+
successMessage: `Removed ${o.name} successfully`
|
|
556
|
+
}
|
|
557
|
+
);
|
|
558
|
+
}
|
|
559
|
+
async function L(o) {
|
|
560
|
+
const a = {
|
|
561
|
+
sortBy: "_id",
|
|
562
|
+
descending: !1,
|
|
563
|
+
rowsPerPage: 1e3,
|
|
564
|
+
page: 1,
|
|
565
|
+
rowsNumber: 0
|
|
566
|
+
}, F = new De(), T = (await me.read({
|
|
567
|
+
limit: 1,
|
|
568
|
+
skip: 0,
|
|
569
|
+
sortBy: a.sortBy,
|
|
570
|
+
descending: a.descending
|
|
571
|
+
})).meta.totalResources ?? 0, M = a.rowsPerPage;
|
|
572
|
+
await g(
|
|
573
|
+
async () => {
|
|
574
|
+
for (let D = 0; D < T; D += M) {
|
|
575
|
+
const A = {
|
|
576
|
+
...a,
|
|
577
|
+
limit: M,
|
|
578
|
+
skip: a.page - 1,
|
|
579
|
+
sortBy: a.sortBy,
|
|
580
|
+
descending: a.descending
|
|
581
|
+
}, z = await P.paginateSegmentUsers(
|
|
582
|
+
o._id,
|
|
583
|
+
A
|
|
584
|
+
);
|
|
585
|
+
for (const O of z.resources) {
|
|
586
|
+
const q = u(O);
|
|
587
|
+
F.addRecord(q);
|
|
588
|
+
}
|
|
589
|
+
a.page++;
|
|
590
|
+
}
|
|
591
|
+
await Te(
|
|
592
|
+
F.buildExcel(),
|
|
593
|
+
`[${o.name}]-members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
|
|
594
|
+
{
|
|
595
|
+
bookType: "xlsx",
|
|
596
|
+
bookSST: !1,
|
|
597
|
+
type: "array"
|
|
598
|
+
}
|
|
599
|
+
), a.page = 1;
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
message: "Exporting member...",
|
|
603
|
+
successMessage: "Member exported successfully"
|
|
604
|
+
}
|
|
605
|
+
);
|
|
606
|
+
}
|
|
607
|
+
async function Y(o) {
|
|
608
|
+
await g(
|
|
609
|
+
async () => {
|
|
610
|
+
var a;
|
|
611
|
+
if (o.isActive === !1) {
|
|
612
|
+
const F = new FormData();
|
|
613
|
+
if (F.append("file", o.file), o._id) {
|
|
614
|
+
const { members: T, _id: M, file: D, ...A } = o;
|
|
615
|
+
F.append("segment", JSON.stringify(A)), await P.updateStatic(o._id, F);
|
|
616
|
+
} else {
|
|
617
|
+
const { file: T, ...M } = o;
|
|
618
|
+
F.append("segment", JSON.stringify(M)), await P.createStatic(F);
|
|
619
|
+
}
|
|
620
|
+
o.file && m.open({
|
|
621
|
+
type: "info",
|
|
622
|
+
title: "Import begins soon. Check Queue for updates.",
|
|
623
|
+
action: "View",
|
|
624
|
+
onAction: async () => {
|
|
625
|
+
await p.push({
|
|
626
|
+
name: fe["$connect-QUEUE"],
|
|
627
|
+
query: { type: [de.enum.SEGMENTATION_IMPORTED] }
|
|
628
|
+
});
|
|
629
|
+
}
|
|
630
|
+
});
|
|
631
|
+
} else if (o._id) {
|
|
632
|
+
const { members: F, _id: T, ...M } = o;
|
|
633
|
+
await P.update(o._id, M);
|
|
634
|
+
} else
|
|
635
|
+
await P.create(o);
|
|
636
|
+
await y({ pageSize: 10, pageIndex: 0 }), (a = s.value) == null || a.hideSheet();
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
message: "Saving segment",
|
|
640
|
+
successMessage: "Segment saved"
|
|
641
|
+
}
|
|
642
|
+
);
|
|
643
|
+
}
|
|
644
|
+
function v(o) {
|
|
645
|
+
var a;
|
|
646
|
+
(a = s.value) == null || a.showSheet(o);
|
|
647
|
+
}
|
|
648
|
+
const r = {
|
|
649
|
+
label: _("connect.navigation.queue"),
|
|
650
|
+
value: "queue",
|
|
651
|
+
isPrimary: !1,
|
|
652
|
+
prependIcon: "work_history"
|
|
653
|
+
}, E = se(() => x.isPremium ? [
|
|
654
|
+
r,
|
|
655
|
+
{
|
|
656
|
+
label: "Refresh segments",
|
|
657
|
+
value: "refresh",
|
|
658
|
+
prependIcon: "refresh"
|
|
659
|
+
},
|
|
660
|
+
{
|
|
661
|
+
label: "Add segment",
|
|
662
|
+
value: "add",
|
|
663
|
+
isPrimary: !0,
|
|
664
|
+
prependIcon: "add"
|
|
665
|
+
}
|
|
666
|
+
] : []);
|
|
667
|
+
function U(o) {
|
|
668
|
+
switch (o) {
|
|
669
|
+
case "add":
|
|
670
|
+
v();
|
|
671
|
+
break;
|
|
672
|
+
case "refresh":
|
|
673
|
+
I();
|
|
674
|
+
break;
|
|
675
|
+
case "queue":
|
|
676
|
+
p.push({
|
|
677
|
+
name: fe["$connect-QUEUE"],
|
|
678
|
+
query: { type: [de.enum.SEGMENTATION_IMPORTED] }
|
|
679
|
+
});
|
|
680
|
+
break;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
return ke(async () => {
|
|
684
|
+
const { meta: o } = await me.read({
|
|
685
|
+
limit: 1,
|
|
686
|
+
skip: 0,
|
|
687
|
+
sortBy: "_id",
|
|
688
|
+
search: void 0,
|
|
689
|
+
descending: !1
|
|
690
|
+
});
|
|
691
|
+
S.value = o.totalResources ?? 0, await y({ pageSize: 10, pageIndex: 0 }), await x.readPremium(), await x.readLocations();
|
|
692
|
+
}), (o, a) => {
|
|
693
|
+
const F = h("FmPill"), T = h("FmPageHead"), M = h("FmIcon"), D = h("FmMenuItem"), A = h("FmMenu"), z = h("FmListItem"), O = h("FmList"), q = h("FmButton"), X = h("FmCard");
|
|
694
|
+
return f(), C(H, null, [
|
|
695
|
+
d(T, {
|
|
696
|
+
title: "Segments",
|
|
697
|
+
actions: t(E),
|
|
698
|
+
"onClick:action": a[0] || (a[0] = (w) => U(w))
|
|
699
|
+
}, {
|
|
700
|
+
title: R(() => [
|
|
701
|
+
i("div", St, [
|
|
702
|
+
i("span", ht, $(t(_)("connect.loyalty.segment.title")), 1),
|
|
703
|
+
d(F, { variant: "premium" })
|
|
704
|
+
])
|
|
705
|
+
]),
|
|
706
|
+
_: 1
|
|
707
|
+
}, 8, ["actions"]),
|
|
708
|
+
i("div", Ft, [
|
|
709
|
+
t(c).length > 0 || t(n).searchValue || t(n).isLoading ? (f(), C(H, { key: 0 }, [
|
|
710
|
+
d(Se, {
|
|
711
|
+
loading: t(n).isLoading,
|
|
712
|
+
"row-data": t(c),
|
|
713
|
+
"row-count": t(n).totalRows,
|
|
714
|
+
"column-defs": l,
|
|
715
|
+
"shrink-at": !1,
|
|
716
|
+
"page-count": t(n).pageCount,
|
|
717
|
+
"page-index": t(n).pageIndex,
|
|
718
|
+
"page-size": t(n).pageSize,
|
|
719
|
+
onRowClick: a[1] || (a[1] = (w) => {
|
|
720
|
+
v(w.original);
|
|
721
|
+
}),
|
|
722
|
+
onPageChange: t(y)
|
|
723
|
+
}, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onPageChange"]),
|
|
724
|
+
d(O, { class: "w-full hidden xs:block" }, {
|
|
725
|
+
default: R(() => [
|
|
726
|
+
(f(!0), C(H, null, _e(t(c), (w) => (f(), G(z, {
|
|
727
|
+
key: w._id.toString(),
|
|
728
|
+
tag: "label",
|
|
729
|
+
onClick: (J) => v(w)
|
|
730
|
+
}, {
|
|
731
|
+
default: R(() => [
|
|
732
|
+
i("div", null, [
|
|
733
|
+
i("div", wt, $((w.memberCount ?? 0).toLocaleString()) + " total customers ", 1),
|
|
734
|
+
i("div", bt, $(w.name), 1),
|
|
735
|
+
i("div", Ct, $(((w.memberCount ?? 0) * 100 / t(S)).toFixed(2)) + "% of customers ", 1)
|
|
736
|
+
])
|
|
737
|
+
]),
|
|
738
|
+
append: R(() => [
|
|
739
|
+
d(A, { "stop-click-propagation": !0 }, {
|
|
740
|
+
"menu-button": R(() => [
|
|
741
|
+
d(M, { name: "more_vert" })
|
|
742
|
+
]),
|
|
743
|
+
default: R(() => [
|
|
744
|
+
d(D, {
|
|
745
|
+
class: "text-fm-color-typo-error fm-typo-en-body-md-400",
|
|
746
|
+
label: "Remove",
|
|
747
|
+
"onUpdate:modelValue": (J) => J && k(w)
|
|
748
|
+
}, null, 8, ["onUpdate:modelValue"])
|
|
749
|
+
]),
|
|
750
|
+
_: 2
|
|
751
|
+
}, 1024)
|
|
752
|
+
]),
|
|
753
|
+
_: 2
|
|
754
|
+
}, 1032, ["onClick"]))), 128))
|
|
755
|
+
]),
|
|
756
|
+
_: 1
|
|
757
|
+
})
|
|
758
|
+
], 64)) : (f(), G(X, {
|
|
759
|
+
key: 1,
|
|
760
|
+
variant: "outlined",
|
|
761
|
+
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
762
|
+
}, {
|
|
763
|
+
default: R(() => [
|
|
764
|
+
a[3] || (a[3] = i("img", {
|
|
765
|
+
src: Me,
|
|
766
|
+
class: "aspect-square w-[150px]"
|
|
767
|
+
}, null, -1)),
|
|
768
|
+
a[4] || (a[4] = i("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
769
|
+
i("div", { class: "fm-typo-en-title-sm-800" }, "Create customer segments"),
|
|
770
|
+
i("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. ")
|
|
771
|
+
], -1)),
|
|
772
|
+
d(q, {
|
|
773
|
+
variant: "primary",
|
|
774
|
+
label: "Create segment",
|
|
775
|
+
disabled: !t(x).isPremium,
|
|
776
|
+
icon: "add",
|
|
777
|
+
onClick: a[2] || (a[2] = (w) => v())
|
|
778
|
+
}, null, 8, ["disabled"])
|
|
779
|
+
]),
|
|
780
|
+
_: 1
|
|
781
|
+
})),
|
|
782
|
+
d(vt, {
|
|
783
|
+
ref_key: "sheetRef",
|
|
784
|
+
ref: s,
|
|
785
|
+
"onUpdate:modelValue": Y
|
|
786
|
+
}, null, 512)
|
|
787
|
+
])
|
|
788
|
+
], 64);
|
|
789
|
+
};
|
|
790
|
+
}
|
|
791
|
+
});
|
|
792
|
+
export {
|
|
793
|
+
ao as default
|
|
794
|
+
};
|