@feedmepos/mf-connect 0.1.31-prod → 0.1.32-prod
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-CSyE-O7F.js → Analytic-DRJEtVnN.js} +11 -11
- package/dist/{App-CI6T_Ggm.js → App-C1IuGBAJ.js} +6 -6
- package/dist/{Bin-D129K0UY.js → Bin-CM9cU-iH.js} +8 -8
- package/dist/{Broadcast-1YnrjwTp.js → Broadcast-1Fy8Nob5.js} +9 -9
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CUBa7vmH.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DiAEDcl5.js} +6 -6
- package/dist/{Card-DnKxZI51.js → Card-CnuSjjCj.js} +97 -96
- package/dist/{Collections-H1k_V_JM.js → Collections-DAj_A1iu.js} +21 -20
- package/dist/{Credit-vgVhr8NN.js → Credit-DLH2GYYz.js} +9 -9
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DdqBz-Sf.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-C4Sy1K8q.js} +29 -28
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-yeZq9E-H.js → EffectSheet.vue_vue_type_style_index_0_lang-D4--kNds.js} +6 -6
- package/dist/{Experience-DF0WMhAg.js → Experience-Dgyi4U-L.js} +9 -9
- package/dist/FileSaver.min-NlMItPOc.js +74 -0
- package/dist/{Game-9aC2CMq1.js → Game-VKYjF7hq.js} +10 -10
- package/dist/{Index-raxs8-hT.js → Index-B0BkKPLD.js} +10 -10
- package/dist/{Marketing-BhCFLx2Z.js → Marketing-Bzl7m10d.js} +6 -6
- package/dist/Member-CDmDoJFr.js +287 -0
- package/dist/{MemberList-DLJxPc32.js → MemberList-C4l_Q9y1.js} +38 -37
- package/dist/{MemberTransactions-cNPt5lU8.js → MemberTransactions-SUlFwOov.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CLfpoWwi.js → MessageInput.vue_vue_type_script_setup_true_lang-Buj3xx1j.js} +17 -16
- package/dist/{Mission-DTqWDFkL.js → Mission-BriLVrc4.js} +88 -93
- package/dist/{Overview-Di1RiMiZ.js → Overview-AklJfO0G.js} +64 -63
- package/dist/{Point-C7vAdfqf.js → Point-B7VnNPaG.js} +9 -9
- package/dist/{Promotion-DwAl2ueC.js → Promotion-hlKzzWJD.js} +10 -10
- package/dist/{Queue-Ckh5U2q9.js → Queue-gOxy9cBG.js} +72 -63
- package/dist/{Record-CS22Hick.js → Record-BwWXqFv6.js} +17 -16
- package/dist/{Reward-ceTGl-6M.js → Reward-JKh-M0oD.js} +15 -15
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-N5HNvabk.js → RewardGroup.vue_vue_type_script_setup_true_lang-DFogiHWh.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Bln0CsrL.js → RuleGroup.vue_vue_type_script_setup_true_lang-CTOfCYsE.js} +15 -14
- package/dist/Segment-BlMx0eoR.js +880 -0
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-CdBSrSG-.js → SelectItems.vue_vue_type_script_setup_true_lang-DCsFcqQ5.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-3WYVAiVq.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-G01kJeLd.js} +11 -11
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-D5kPXWZM.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-gUoBLfVo.js} +3 -3
- package/dist/{Setting-B080_HzI.js → Setting-CoKP6Z-F.js} +43 -42
- package/dist/{Store-DTeptzE3.js → Store-CxUagz23.js} +28 -27
- package/dist/{StoreRewards-CNrENhoO.js → StoreRewards-CLSQgaNo.js} +13 -13
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-D39kPD0g.js → StoreTransactions.vue_vue_type_script_setup_true_lang-V4rH3vAQ.js} +26 -25
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-YeLylLcx.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DJ7incG7.js} +1 -1
- package/dist/{Tier-DCtk62vI.js → Tier-DwTL1xNM.js} +22 -21
- package/dist/{Title-WLmc_Sgb.js → Title-DhBL_eYK.js} +19 -19
- package/dist/{Transaction-DrZ66hh2.js → Transaction-CRskHsNr.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-B934hePK.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DoE7rDgi.js} +6 -6
- package/dist/{Voucher-BWxGUu1r.js → Voucher-CxDqASF5.js} +12 -12
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-Cwm5rKfF.js → VoucherEditor.vue_vue_type_script_setup_true_lang-wkihtNI3.js} +10 -10
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DgNwerl-.js → ZodTextField.vue_vue_type_script_setup_true_lang-BeLTXjOv.js} +1 -1
- package/dist/{app-CD95Y8ID.js → app-CTFwjMxq.js} +1 -1
- package/dist/{app-DXDpfEp1.js → app-QgT2HXjv.js} +34 -30
- package/dist/app.js +1 -1
- package/dist/{business-BMmMPKlg.js → business-DhCzKu3V.js} +1 -1
- package/dist/{campaign-CXiUdGVH.js → campaign-CFggCOe6.js} +9 -9
- package/dist/{campaign-DsHXtfeO.js → campaign-DAgovrbX.js} +2 -2
- package/dist/{campaign.enum-BmZUaKGr.js → campaign.enum-pZr63pXN.js} +1 -1
- package/dist/{campaign.fn-0yxgF1-s.js → campaign.fn-CM_t1wNu.js} +70 -70
- package/dist/{collectible.enum-CkHgwpV8.js → collectible.enum-fbWiJ-v2.js} +1 -1
- package/dist/{collection.fn-BEL2ePbu.js → collection.fn-BrbSJ0dj.js} +2 -2
- package/dist/{dto-C9i038zS.js → dto-BcLrcoo_.js} +12 -12
- package/dist/{effect-hnRcV89q.js → effect-WVUo2VX0.js} +1 -1
- package/dist/{email-addresses-B3aOGn9Q.js → email-addresses-B8YBttOp.js} +1 -1
- package/dist/{export-DhXPjZn4.js → export-FilTnKIf.js} +3 -3
- package/dist/{helper-B91UqTPy.js → helper-A-JE89j8.js} +1 -1
- package/dist/{index-CaQznIQx.js → index-BPCfLPV5.js} +1 -1
- package/dist/{index-DdkPyb-X.js → index-BSavh-ab.js} +3 -3
- package/dist/{index-BpiC24Lh.js → index-C1vwtNMj.js} +6 -6
- package/dist/{index-DRolGtez.js → index-CK_9lnGD.js} +3 -3
- package/dist/{index-DUESWqjo.js → index-CX4Q-ODj.js} +1 -1
- package/dist/{index-MTD1KXCx.js → index-CyqffI0r.js} +1 -1
- package/dist/{index-DwUvEDm8.js → index-CzH8ux-h.js} +2 -2
- package/dist/{index-CkB8qWx9.js → index-CzbdA0d3.js} +1 -1
- package/dist/{plugins-CA83RlbH.js → index-DFS6jDHm.js} +3784 -3989
- package/dist/{index-Dk0fL4Um.js → index-DI956UFg.js} +1 -1
- package/dist/{index-h-U0YoGx.js → index-DvM-OpLR.js} +469 -456
- package/dist/{index-mWR-Io8r.js → index-FsTLGrIL.js} +1 -1
- package/dist/{index-Bv_q5cPS.js → index-OehNKdCW.js} +1 -1
- package/dist/{index.esm2017-DvR1i10j.js → index.esm2017-CScWJGpE.js} +1 -1
- package/dist/{loading-CYFHRqwc.js → loading-CXZ39_xw.js} +1 -1
- package/dist/{membership-t5YCs8vf.js → membership-Bg_pBT1C.js} +54 -48
- package/dist/{money-u692Iuhj.js → money-D4vhiGvs.js} +1 -1
- package/dist/{number-BFoRQ3UV.js → number-p3U-wKsr.js} +1 -1
- package/dist/{objectid-ySkduRSJ.js → objectid-C_k8DXMk.js} +4 -4
- package/dist/plugins-BzCgGFW_.js +208 -0
- package/dist/{reward-BxAjgaY0.js → reward-DL7dVgek.js} +1 -1
- package/dist/{rule-builder-D3z1ZTIu.js → rule-builder-DZEGo8FL.js} +1 -1
- package/dist/{rule-B2-KiDax.js → rule-iUlMzG59.js} +3 -3
- package/dist/{template-Ep0uKJmD.js → template-FZF9V1B2.js} +4 -4
- package/dist/{trigger-i6Qv7Nko.js → trigger-woPb5C0Z.js} +4 -4
- package/dist/{user-bkYeGrIH.js → user-CoOoRDFP.js} +1 -1
- package/dist/{vue-i18n-2yeRgkZ7.js → vue-i18n-5r8XYctA.js} +251 -251
- package/dist/{xlsx-DIyBpsUe.js → xlsx-Cx714TFU.js} +1 -1
- package/package.json +1 -1
- package/dist/Member-ej-Yvlr1.js +0 -348
- package/dist/Segment-CT4UwYMZ.js +0 -578
package/dist/Segment-CT4UwYMZ.js
DELETED
|
@@ -1,578 +0,0 @@
|
|
|
1
|
-
import { defineComponent as Q, onMounted as ue, openBlock as x, createElementBlock as D, createElementVNode as i, toDisplayString as $, unref as o, createVNode as l, ref as H, computed as X, resolveComponent as S, createBlock as W, isRef as ye, createSlots as _e, withCtx as C, Fragment as q, h as B, onBeforeMount as ve, renderList as he } from "vue";
|
|
2
|
-
import { _ as Se } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { F as re, p as xe } from "./plugins-CA83RlbH.js";
|
|
4
|
-
import { u as we } from "./loading-CYFHRqwc.js";
|
|
5
|
-
import { components as Z } from "@feedmepos/ui-library";
|
|
6
|
-
import { u as pe, _ as me } from "./usePagination-JoYaROkV.js";
|
|
7
|
-
import { u as Fe } from "./vue-i18n-2yeRgkZ7.js";
|
|
8
|
-
import { w as Ce } from "./xlsx-DIyBpsUe.js";
|
|
9
|
-
import { e as Me, M as ke } from "./email-addresses-B3aOGn9Q.js";
|
|
10
|
-
import { Z as Ie } from "./zod-Bg2FbC-D.js";
|
|
11
|
-
import { h as Pe } from "./index-h-U0YoGx.js";
|
|
12
|
-
import { u as Re } from "./app-wDQR6dpb.js";
|
|
13
|
-
import { R as Be } from "./rule-builder-D3z1ZTIu.js";
|
|
14
|
-
import { _ as Ee } from "./ZodTextField.vue_vue_type_script_setup_true_lang-DgNwerl-.js";
|
|
15
|
-
import { _ as $e } from "./RuleGroup.vue_vue_type_script_setup_true_lang-Bln0CsrL.js";
|
|
16
|
-
import { h as z } from "./moment-BWErdI6_.js";
|
|
17
|
-
import { s as E, u as De } from "./membership-t5YCs8vf.js";
|
|
18
|
-
import { o as Ye } from "./objectId-dwaoBfJX.js";
|
|
19
|
-
import { u as ge } from "./business-BMmMPKlg.js";
|
|
20
|
-
import { f as be } from "./number-BFoRQ3UV.js";
|
|
21
|
-
import { t as Le } from "./money-u692Iuhj.js";
|
|
22
|
-
import { m as ce } from "./index-mWR-Io8r.js";
|
|
23
|
-
const Te = Pe.extend({
|
|
24
|
-
_id: re.optional(),
|
|
25
|
-
business: re.optional()
|
|
26
|
-
}), Ne = { class: "space-y-16 pr-12" }, Ve = { class: "fm-typo-en-title-md-800" }, ze = { class: "flex space-x-8" }, Ae = { class: "fm-typo-en-title-md-800 text-fm-color-primary" }, Ue = { class: "text-fm-color-typo-secondary" }, Oe = /* @__PURE__ */ i("div", null, "contacts in your segment", -1), je = /* @__PURE__ */ Q({
|
|
27
|
-
__name: "ReviewSegment",
|
|
28
|
-
props: {
|
|
29
|
-
title: {},
|
|
30
|
-
segment: {}
|
|
31
|
-
},
|
|
32
|
-
setup(e) {
|
|
33
|
-
const r = e, h = [
|
|
34
|
-
{
|
|
35
|
-
header: "Name",
|
|
36
|
-
accessorFn: (n) => n.name
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
header: "Id",
|
|
40
|
-
accessorFn: (n) => n._id
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
header: "Customer Since",
|
|
44
|
-
accessorFn: (n) => z(Ye(n._id.toString())).format("DD MMM YYYY")
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
header: "Phone",
|
|
48
|
-
accessorFn: (n) => n.phoneNumber
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
header: "Birthday",
|
|
52
|
-
accessorFn: (n) => z(n.birthday).format("DD MMM YYYY")
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
header: "Last Visit",
|
|
56
|
-
accessorFn: (n) => z(n.stats.lastVisit).format("DD MMM YYYY")
|
|
57
|
-
}
|
|
58
|
-
];
|
|
59
|
-
async function _(n) {
|
|
60
|
-
return r.segment._id ? (console.log(n), await E.paginateSegmentUsers(
|
|
61
|
-
r.segment._id,
|
|
62
|
-
n
|
|
63
|
-
)) : {
|
|
64
|
-
resources: [],
|
|
65
|
-
meta: {
|
|
66
|
-
totalResources: 0,
|
|
67
|
-
totalPages: 0,
|
|
68
|
-
skip: n.skip,
|
|
69
|
-
limit: n.limit,
|
|
70
|
-
sortBy: n.sortBy
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
const { tableMeta: c, rowData: d, onSort: M, debouncedFetchData: g, onSearch: s } = pe(_);
|
|
75
|
-
return ue(async () => {
|
|
76
|
-
await g();
|
|
77
|
-
}), (n, f) => (x(), D("div", Ne, [
|
|
78
|
-
i("div", Ve, $(r.title), 1),
|
|
79
|
-
i("div", ze, [
|
|
80
|
-
i("div", Ae, $(n.segment.members.length), 1),
|
|
81
|
-
i("div", Ue, [
|
|
82
|
-
Oe,
|
|
83
|
-
i("div", null, "as of " + $(o(z)(n.segment.lastUpdated).format("DD MMM YYYY")), 1)
|
|
84
|
-
])
|
|
85
|
-
]),
|
|
86
|
-
l(me, {
|
|
87
|
-
loading: o(c).isLoading,
|
|
88
|
-
"row-data": o(d),
|
|
89
|
-
"row-count": o(c).totalRows,
|
|
90
|
-
"column-defs": h,
|
|
91
|
-
"page-size": o(c).pageSize,
|
|
92
|
-
"page-count": o(c).pageCount,
|
|
93
|
-
"page-index": o(c).pageIndex,
|
|
94
|
-
onSortChange: o(M),
|
|
95
|
-
onPageChange: f[0] || (f[0] = (w) => o(g)({ pageSize: w.pageSize, pageIndex: w.pageIndex }))
|
|
96
|
-
}, null, 8, ["loading", "row-data", "row-count", "page-size", "page-count", "page-index", "onSortChange"])
|
|
97
|
-
]));
|
|
98
|
-
}
|
|
99
|
-
}), He = { class: "flex items-center gap-x-8" }, qe = /* @__PURE__ */ i("div", null, "Review segment", -1), Je = {
|
|
100
|
-
key: 0,
|
|
101
|
-
class: "space-y-16 pr-12"
|
|
102
|
-
}, Ge = /* @__PURE__ */ i("div", { class: "fm-typo-en-title-sm-800" }, "Segment Filter", -1), Ze = { class: "flex items-center gap-8" }, We = /* @__PURE__ */ Q({
|
|
103
|
-
__name: "SegmentSheet",
|
|
104
|
-
emits: ["update:model-value"],
|
|
105
|
-
setup(e, { expose: r, emit: h }) {
|
|
106
|
-
const _ = Re(), c = H(!1), d = H(!1), M = {
|
|
107
|
-
name: "",
|
|
108
|
-
rule: Be.scaffoldGroup(),
|
|
109
|
-
members: []
|
|
110
|
-
}, g = Te, s = H(M), n = X(() => {
|
|
111
|
-
const v = g.safeParse(s.value);
|
|
112
|
-
return v.success ? [] : v.error.errors;
|
|
113
|
-
});
|
|
114
|
-
function f(v) {
|
|
115
|
-
c.value = !0, d.value = !1, v ? s.value = { ...v } : s.value = { ...M };
|
|
116
|
-
}
|
|
117
|
-
function w() {
|
|
118
|
-
c.value = !1;
|
|
119
|
-
}
|
|
120
|
-
async function I() {
|
|
121
|
-
g.safeParse(s.value).success && (d.value = !0);
|
|
122
|
-
}
|
|
123
|
-
function Y() {
|
|
124
|
-
d.value = !1;
|
|
125
|
-
}
|
|
126
|
-
async function b() {
|
|
127
|
-
k("update:model-value", s.value);
|
|
128
|
-
}
|
|
129
|
-
ue(async () => {
|
|
130
|
-
});
|
|
131
|
-
const k = h;
|
|
132
|
-
return r({
|
|
133
|
-
showSheet: f,
|
|
134
|
-
hideSheet: w
|
|
135
|
-
}), (v, t) => {
|
|
136
|
-
const a = S("FmButton"), F = S("FmSideSheet");
|
|
137
|
-
return x(), W(F, {
|
|
138
|
-
modelValue: o(c),
|
|
139
|
-
"onUpdate:modelValue": t[5] || (t[5] = (u) => ye(c) ? c.value = u : null),
|
|
140
|
-
header: "Add segment",
|
|
141
|
-
"dismiss-away": "",
|
|
142
|
-
"close-button": !0,
|
|
143
|
-
"max-width": 1100
|
|
144
|
-
}, _e({
|
|
145
|
-
"side-sheet-footer": C(() => [
|
|
146
|
-
i("div", Ze, [
|
|
147
|
-
o(d) ? (x(), D(q, { key: 0 }, [
|
|
148
|
-
l(a, {
|
|
149
|
-
label: "Save Segment",
|
|
150
|
-
onClick: b,
|
|
151
|
-
loading: o(_).isLoading,
|
|
152
|
-
disabled: o(n).length > 0 || o(_).isLoading
|
|
153
|
-
}, null, 8, ["loading", "disabled"]),
|
|
154
|
-
l(a, {
|
|
155
|
-
label: "Cancel",
|
|
156
|
-
onClick: t[3] || (t[3] = (u) => Y()),
|
|
157
|
-
variant: "tertiary"
|
|
158
|
-
})
|
|
159
|
-
], 64)) : (x(), D(q, { key: 1 }, [
|
|
160
|
-
l(a, {
|
|
161
|
-
label: "Review Segment",
|
|
162
|
-
disabled: o(n).length > 0 || o(_).isLoading,
|
|
163
|
-
onClick: I
|
|
164
|
-
}, null, 8, ["disabled"]),
|
|
165
|
-
l(a, {
|
|
166
|
-
label: "Cancel",
|
|
167
|
-
onClick: t[4] || (t[4] = (u) => w()),
|
|
168
|
-
variant: "tertiary"
|
|
169
|
-
})
|
|
170
|
-
], 64))
|
|
171
|
-
])
|
|
172
|
-
]),
|
|
173
|
-
default: C(() => {
|
|
174
|
-
var u;
|
|
175
|
-
return [
|
|
176
|
-
o(d) ? (x(), W(je, {
|
|
177
|
-
key: 1,
|
|
178
|
-
title: o(s).name,
|
|
179
|
-
segment: o(s)
|
|
180
|
-
}, null, 8, ["title", "segment"])) : (x(), D("div", Je, [
|
|
181
|
-
l(Ee, {
|
|
182
|
-
modelValue: o(s).name,
|
|
183
|
-
"onUpdate:modelValue": t[1] || (t[1] = (y) => o(s).name = y),
|
|
184
|
-
label: "Segment title",
|
|
185
|
-
schema: o(Ie).typeAtPath(o(g), "name")
|
|
186
|
-
}, null, 8, ["modelValue", "schema"]),
|
|
187
|
-
Ge,
|
|
188
|
-
l($e, {
|
|
189
|
-
"trigger-type": "MEMBERSHIP_JOINED",
|
|
190
|
-
includeOnly: "user",
|
|
191
|
-
"model-value": (u = o(s)) == null ? void 0 : u.rule,
|
|
192
|
-
"onUpdate:modelValue": t[2] || (t[2] = (y) => {
|
|
193
|
-
o(s).rule = y;
|
|
194
|
-
})
|
|
195
|
-
}, null, 8, ["model-value"])
|
|
196
|
-
]))
|
|
197
|
-
];
|
|
198
|
-
}),
|
|
199
|
-
_: 2
|
|
200
|
-
}, [
|
|
201
|
-
o(d) ? {
|
|
202
|
-
name: "side-sheet-header",
|
|
203
|
-
fn: C(() => [
|
|
204
|
-
i("div", He, [
|
|
205
|
-
l(a, {
|
|
206
|
-
icon: "arrow_back",
|
|
207
|
-
variant: "tertiary",
|
|
208
|
-
onClick: t[0] || (t[0] = (u) => d.value = !1)
|
|
209
|
-
}),
|
|
210
|
-
qe
|
|
211
|
-
])
|
|
212
|
-
]),
|
|
213
|
-
key: "0"
|
|
214
|
-
} : void 0
|
|
215
|
-
]), 1032, ["modelValue"]);
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
}), de = De(), Ke = ge();
|
|
219
|
-
function K(e) {
|
|
220
|
-
const r = z(e);
|
|
221
|
-
return r.isValid() ? r.format("DD/MM/YYYY") : "";
|
|
222
|
-
}
|
|
223
|
-
const Qe = {
|
|
224
|
-
mapMemberExportRow: (e) => {
|
|
225
|
-
var n, f, w, I, Y, b, k, v, t, a, F, u, y, P, L, T, N, V, J, p, A, ee, te, oe, ae, ne, se, ie;
|
|
226
|
-
const r = X(() => Ke.locations.map((m) => ({
|
|
227
|
-
label: m.name,
|
|
228
|
-
value: m._id
|
|
229
|
-
}))), h = (n = Me.parseOneAddress(
|
|
230
|
-
e == null ? void 0 : e.email
|
|
231
|
-
)) != null && n.domain.includes("feedmepos.com") ? void 0 : e.email, _ = (w = ((f = e == null ? void 0 : e.collection) == null ? void 0 : f.TITLE) || []) == null ? void 0 : w.reduce(
|
|
232
|
-
(m, R) => {
|
|
233
|
-
var O, j;
|
|
234
|
-
const U = (j = (O = de.sortedTitles) == null ? void 0 : O.find(
|
|
235
|
-
(G) => G._id === R.collectible
|
|
236
|
-
)) == null ? void 0 : j.name;
|
|
237
|
-
return !U || R.balance <= 0 || m.push(U), m;
|
|
238
|
-
},
|
|
239
|
-
[]
|
|
240
|
-
), c = (de.sortedTitles || []).reduce(
|
|
241
|
-
(m, R) => {
|
|
242
|
-
var O, j, G, le;
|
|
243
|
-
const U = (le = (G = (j = (((O = e == null ? void 0 : e.collection) == null ? void 0 : O.TITLE) || []).find(
|
|
244
|
-
(fe) => fe.collectible === R._id
|
|
245
|
-
)) == null ? void 0 : j.expiryBalance) == null ? void 0 : G[0]) == null ? void 0 : le.expiredAt;
|
|
246
|
-
return m[R.name] = U ? z(U).format("DD/MM/YYYY") : "", m;
|
|
247
|
-
},
|
|
248
|
-
{}
|
|
249
|
-
), d = ((b = (Y = (I = e.collection) == null ? void 0 : I.CREDIT) == null ? void 0 : Y.at(0)) == null ? void 0 : b.balance) || 0, M = ((a = (t = (v = (k = e.collection) == null ? void 0 : k.CREDIT) == null ? void 0 : v.at(0)) == null ? void 0 : t.expiryBalance) == null ? void 0 : a.reduce(
|
|
250
|
-
(m, R) => m + R.amount,
|
|
251
|
-
0
|
|
252
|
-
)) || 0, g = be(d, 2);
|
|
253
|
-
return {
|
|
254
|
-
ID: e._id.toString(),
|
|
255
|
-
Name: ((F = e.name) == null ? void 0 : F.trim()) || "",
|
|
256
|
-
Phone: ((u = e == null ? void 0 : e.phoneNumber) == null ? void 0 : u.trim()) || "",
|
|
257
|
-
Email: h || "",
|
|
258
|
-
Gender: e.gender || "",
|
|
259
|
-
CardNo: e.cardNo || "",
|
|
260
|
-
Birthday: e != null && e.birthday ? K(e == null ? void 0 : e.birthday) : "",
|
|
261
|
-
Credit: parseFloat((Number(g) - Number(M)).toFixed(2)),
|
|
262
|
-
FreeCredit: Number(M.toFixed(2)),
|
|
263
|
-
TotalCredit: Number(g),
|
|
264
|
-
Exp: e != null && e.collection ? ((L = (P = (y = e.collection) == null ? void 0 : y.POINT) == null ? void 0 : P.at(0)) == null ? void 0 : L.balance) ?? 0 : 0,
|
|
265
|
-
Point: e != null && e.collection ? ((V = (N = (T = e.collection) == null ? void 0 : T.COIN) == null ? void 0 : N.at(0)) == null ? void 0 : V.balance) ?? 0 : 0,
|
|
266
|
-
Level: e != null && e.collection ? ((A = (p = (J = e.collection) == null ? void 0 : J.TIER) == null ? void 0 : p.at(0)) == null ? void 0 : A.balance) ?? 0 : 0,
|
|
267
|
-
Tier: e != null && e.collection ? ((oe = (te = (ee = e.collection) == null ? void 0 : ee.TIER) == null ? void 0 : te.at(0)) == null ? void 0 : oe.balance) ?? 0 : 0,
|
|
268
|
-
Titles: _.join(","),
|
|
269
|
-
...c,
|
|
270
|
-
TotalTransaction: e.stats.visitCount,
|
|
271
|
-
AvgSpent: Le(Number(e.stats.avgBillSize || 0)).toFormat(
|
|
272
|
-
!1
|
|
273
|
-
),
|
|
274
|
-
TotalSpent: e.stats.avgBillSize * e.stats.visitCount,
|
|
275
|
-
LastVisit: K(e.stats.lastVisit),
|
|
276
|
-
Feedback: ((ae = e.stats) == null ? void 0 : ae.feedbackCount) || 0,
|
|
277
|
-
LastSeasonTierEarned: ((ne = e.stats) == null ? void 0 : ne.lastSeasonTierEarned) || 0,
|
|
278
|
-
LastSeasonPointEarned: ((se = e.stats) == null ? void 0 : se.lastSeasonPointEarned) || 0,
|
|
279
|
-
JoinedAt: K(e.joinAt || void 0),
|
|
280
|
-
JoinedAtLocation: e.location && ((ie = r.value.find((m) => m.value == e.location)) == null ? void 0 : ie.label) || "-",
|
|
281
|
-
VisitFrequency: `${Number(
|
|
282
|
-
Math.ceil(e.stats.avgVisitFrequency).toFixed(0)
|
|
283
|
-
)}`
|
|
284
|
-
};
|
|
285
|
-
}
|
|
286
|
-
}, Xe = { class: "flex items-center" }, et = { 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" }, ot = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, at = { class: "fm-typo-en-body-md-600" }, nt = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, st = /* @__PURE__ */ i("img", {
|
|
287
|
-
src: Se,
|
|
288
|
-
class: "aspect-square w-[150px]"
|
|
289
|
-
}, null, -1), it = /* @__PURE__ */ i("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
290
|
-
/* @__PURE__ */ i("div", { class: "fm-typo-en-title-sm-800" }, "Create customer segments"),
|
|
291
|
-
/* @__PURE__ */ 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. ")
|
|
292
|
-
], -1), Rt = /* @__PURE__ */ Q({
|
|
293
|
-
__name: "Segment",
|
|
294
|
-
setup(e) {
|
|
295
|
-
const { minor: r } = we, { t: h } = Fe(), _ = ge(), { mapMemberExportRow: c } = Qe, d = H(0), M = [
|
|
296
|
-
{
|
|
297
|
-
header: h("connect.loyalty.segment.table.name"),
|
|
298
|
-
accessorFn: (t) => t.name
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
header: h("connect.loyalty.segment.table.total_customers"),
|
|
302
|
-
accessorFn: (t) => t.memberCount ?? 0
|
|
303
|
-
},
|
|
304
|
-
{
|
|
305
|
-
header: h("connect.loyalty.segment.table.customer_percentage"),
|
|
306
|
-
accessorFn: (t) => ((t.memberCount ?? 0) * 100 / d.value).toFixed(2)
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
header: h("connect.loyalty.segment.table.actions"),
|
|
310
|
-
meta: {
|
|
311
|
-
maxWidth: "100px"
|
|
312
|
-
},
|
|
313
|
-
cell(t) {
|
|
314
|
-
return B("div", { class: "flex items-center justify-end" }, [
|
|
315
|
-
B(
|
|
316
|
-
Z.FmMenu,
|
|
317
|
-
{
|
|
318
|
-
placement: "bottom-end",
|
|
319
|
-
onClick: (a) => {
|
|
320
|
-
a.stopPropagation();
|
|
321
|
-
}
|
|
322
|
-
},
|
|
323
|
-
{
|
|
324
|
-
"menu-button": () => B(Z.FmButton, {
|
|
325
|
-
icon: "more_vert",
|
|
326
|
-
iconColor: "neutral-gray-400",
|
|
327
|
-
variant: "tertiary"
|
|
328
|
-
}),
|
|
329
|
-
default: () => [
|
|
330
|
-
B(
|
|
331
|
-
Z.FmMenuItem,
|
|
332
|
-
{
|
|
333
|
-
onClick: async (a) => {
|
|
334
|
-
a.stopPropagation(), Y(t.row.original);
|
|
335
|
-
}
|
|
336
|
-
},
|
|
337
|
-
{
|
|
338
|
-
label: B(
|
|
339
|
-
"div",
|
|
340
|
-
{
|
|
341
|
-
class: "fm-typo-en-body-md-400"
|
|
342
|
-
},
|
|
343
|
-
"Export"
|
|
344
|
-
)
|
|
345
|
-
}
|
|
346
|
-
),
|
|
347
|
-
B(
|
|
348
|
-
Z.FmMenuItem,
|
|
349
|
-
{
|
|
350
|
-
onClick: async (a) => {
|
|
351
|
-
a.stopPropagation(), I(t.row.original);
|
|
352
|
-
}
|
|
353
|
-
},
|
|
354
|
-
{
|
|
355
|
-
label: B(
|
|
356
|
-
"div",
|
|
357
|
-
{
|
|
358
|
-
class: "text-fm-color-typo-error fm-typo-en-body-md-400"
|
|
359
|
-
},
|
|
360
|
-
"Remove"
|
|
361
|
-
)
|
|
362
|
-
}
|
|
363
|
-
)
|
|
364
|
-
]
|
|
365
|
-
}
|
|
366
|
-
)
|
|
367
|
-
]);
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
], g = H(null), { tableMeta: s, rowData: n, debouncedFetchData: f } = pe(
|
|
371
|
-
E.readAll
|
|
372
|
-
);
|
|
373
|
-
async function w() {
|
|
374
|
-
await r(
|
|
375
|
-
async () => {
|
|
376
|
-
await E.refreshSegments(), await f({ pageSize: 10, pageIndex: 0 });
|
|
377
|
-
},
|
|
378
|
-
{ message: "Refreshing segmentations" }
|
|
379
|
-
);
|
|
380
|
-
}
|
|
381
|
-
async function I(t) {
|
|
382
|
-
await xe.remove(`Are you sure you want to remove ${t.name}?`) && await r(
|
|
383
|
-
async () => {
|
|
384
|
-
await E.delete(t._id), await f({ pageSize: 10, pageIndex: 0 });
|
|
385
|
-
},
|
|
386
|
-
{
|
|
387
|
-
message: `Removing ${t.name}`,
|
|
388
|
-
successMessage: `Removed ${t.name} successfully`
|
|
389
|
-
}
|
|
390
|
-
);
|
|
391
|
-
}
|
|
392
|
-
async function Y(t) {
|
|
393
|
-
const a = {
|
|
394
|
-
sortBy: "_id",
|
|
395
|
-
descending: !1,
|
|
396
|
-
rowsPerPage: 1e3,
|
|
397
|
-
page: 1,
|
|
398
|
-
rowsNumber: 0
|
|
399
|
-
}, F = new ke(), u = (await ce.read({
|
|
400
|
-
limit: 1,
|
|
401
|
-
skip: 0,
|
|
402
|
-
sortBy: a.sortBy,
|
|
403
|
-
descending: a.descending
|
|
404
|
-
})).meta.totalResources ?? 0, y = a.rowsPerPage;
|
|
405
|
-
await r(
|
|
406
|
-
async () => {
|
|
407
|
-
for (let P = 0; P < u; P += y) {
|
|
408
|
-
const L = {
|
|
409
|
-
...a,
|
|
410
|
-
limit: y,
|
|
411
|
-
skip: a.page - 1,
|
|
412
|
-
sortBy: a.sortBy,
|
|
413
|
-
descending: a.descending
|
|
414
|
-
}, T = await E.paginateSegmentUsers(
|
|
415
|
-
t._id,
|
|
416
|
-
L
|
|
417
|
-
);
|
|
418
|
-
for (const N of T.resources) {
|
|
419
|
-
const V = c(N);
|
|
420
|
-
F.addRecord(V);
|
|
421
|
-
}
|
|
422
|
-
a.page++;
|
|
423
|
-
}
|
|
424
|
-
await Ce(
|
|
425
|
-
F.buildExcel(),
|
|
426
|
-
`[${t.name}]-members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
|
|
427
|
-
{
|
|
428
|
-
bookType: "xlsx",
|
|
429
|
-
bookSST: !1,
|
|
430
|
-
type: "array"
|
|
431
|
-
}
|
|
432
|
-
), a.page = 1;
|
|
433
|
-
},
|
|
434
|
-
{
|
|
435
|
-
message: "Exporting member...",
|
|
436
|
-
successMessage: "Member exported successfully"
|
|
437
|
-
}
|
|
438
|
-
);
|
|
439
|
-
}
|
|
440
|
-
async function b(t) {
|
|
441
|
-
await r(
|
|
442
|
-
async () => {
|
|
443
|
-
var a;
|
|
444
|
-
if (t._id) {
|
|
445
|
-
const { members: F, _id: u, ...y } = t;
|
|
446
|
-
await E.update(t._id, y);
|
|
447
|
-
} else
|
|
448
|
-
await E.create(t);
|
|
449
|
-
await f({ pageSize: 10, pageIndex: 0 }), (a = g.value) == null || a.hideSheet();
|
|
450
|
-
},
|
|
451
|
-
{
|
|
452
|
-
message: "Saving segment",
|
|
453
|
-
successMessage: "Segment saved"
|
|
454
|
-
}
|
|
455
|
-
);
|
|
456
|
-
}
|
|
457
|
-
function k(t) {
|
|
458
|
-
var a;
|
|
459
|
-
(a = g.value) == null || a.showSheet(t);
|
|
460
|
-
}
|
|
461
|
-
const v = X(() => _.isPremium ? [
|
|
462
|
-
{
|
|
463
|
-
label: "Refresh segments",
|
|
464
|
-
value: "refresh"
|
|
465
|
-
},
|
|
466
|
-
{
|
|
467
|
-
label: "Add segment",
|
|
468
|
-
value: "add",
|
|
469
|
-
isPrimary: !0,
|
|
470
|
-
prependIcon: "add"
|
|
471
|
-
}
|
|
472
|
-
] : []);
|
|
473
|
-
return ve(async () => {
|
|
474
|
-
const { meta: t } = await ce.read({
|
|
475
|
-
limit: 1,
|
|
476
|
-
skip: 0,
|
|
477
|
-
sortBy: "_id",
|
|
478
|
-
search: void 0,
|
|
479
|
-
descending: !1
|
|
480
|
-
});
|
|
481
|
-
d.value = t.totalResources ?? 0, await f({ pageSize: 10, pageIndex: 0 }), await _.readPremium(), await _.readLocations();
|
|
482
|
-
}), (t, a) => {
|
|
483
|
-
const F = S("FmPill"), u = S("FmPageHead"), y = S("FmIcon"), P = S("FmMenuItem"), L = S("FmMenu"), T = S("FmListItem"), N = S("FmList"), V = S("FmButton"), J = S("FmCard");
|
|
484
|
-
return x(), D(q, null, [
|
|
485
|
-
l(u, {
|
|
486
|
-
title: "Segments",
|
|
487
|
-
actions: o(v),
|
|
488
|
-
"onClick:action": a[0] || (a[0] = (p) => p === "add" ? k() : w())
|
|
489
|
-
}, {
|
|
490
|
-
title: C(() => [
|
|
491
|
-
i("div", Xe, [
|
|
492
|
-
i("span", et, $(o(h)("connect.loyalty.segment.title")), 1),
|
|
493
|
-
l(F, { variant: "premium" })
|
|
494
|
-
])
|
|
495
|
-
]),
|
|
496
|
-
_: 1
|
|
497
|
-
}, 8, ["actions"]),
|
|
498
|
-
i("div", tt, [
|
|
499
|
-
o(n).length > 0 || o(s).searchValue || o(s).isLoading ? (x(), D(q, { key: 0 }, [
|
|
500
|
-
l(me, {
|
|
501
|
-
loading: o(s).isLoading,
|
|
502
|
-
"row-data": o(n),
|
|
503
|
-
"row-count": o(s).totalRows,
|
|
504
|
-
"column-defs": M,
|
|
505
|
-
"shrink-at": !1,
|
|
506
|
-
"page-count": o(s).pageCount,
|
|
507
|
-
"page-index": o(s).pageIndex,
|
|
508
|
-
"page-size": o(s).pageSize,
|
|
509
|
-
onRowClick: a[1] || (a[1] = (p) => {
|
|
510
|
-
k(p.original);
|
|
511
|
-
}),
|
|
512
|
-
onPageChange: o(f)
|
|
513
|
-
}, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onPageChange"]),
|
|
514
|
-
l(N, { class: "w-full hidden xs:block" }, {
|
|
515
|
-
default: C(() => [
|
|
516
|
-
(x(!0), D(q, null, he(o(n), (p) => (x(), W(T, {
|
|
517
|
-
key: p._id.toString(),
|
|
518
|
-
tag: "label",
|
|
519
|
-
onClick: (A) => k(p)
|
|
520
|
-
}, {
|
|
521
|
-
default: C(() => [
|
|
522
|
-
i("div", null, [
|
|
523
|
-
i("div", ot, $((p.memberCount ?? 0).toLocaleString()) + " total customers ", 1),
|
|
524
|
-
i("div", at, $(p.name), 1),
|
|
525
|
-
i("div", nt, $(((p.memberCount ?? 0) * 100 / o(d)).toFixed(2)) + "% of customers ", 1)
|
|
526
|
-
])
|
|
527
|
-
]),
|
|
528
|
-
append: C(() => [
|
|
529
|
-
l(L, { "stop-click-propagation": !0 }, {
|
|
530
|
-
"menu-button": C(() => [
|
|
531
|
-
l(y, { name: "more_vert" })
|
|
532
|
-
]),
|
|
533
|
-
default: C(() => [
|
|
534
|
-
l(P, {
|
|
535
|
-
class: "text-fm-color-typo-error fm-typo-en-body-md-400",
|
|
536
|
-
label: "Remove",
|
|
537
|
-
"onUpdate:modelValue": (A) => A && I(p)
|
|
538
|
-
}, null, 8, ["onUpdate:modelValue"])
|
|
539
|
-
]),
|
|
540
|
-
_: 2
|
|
541
|
-
}, 1024)
|
|
542
|
-
]),
|
|
543
|
-
_: 2
|
|
544
|
-
}, 1032, ["onClick"]))), 128))
|
|
545
|
-
]),
|
|
546
|
-
_: 1
|
|
547
|
-
})
|
|
548
|
-
], 64)) : (x(), W(J, {
|
|
549
|
-
key: 1,
|
|
550
|
-
variant: "outlined",
|
|
551
|
-
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
552
|
-
}, {
|
|
553
|
-
default: C(() => [
|
|
554
|
-
st,
|
|
555
|
-
it,
|
|
556
|
-
l(V, {
|
|
557
|
-
variant: "primary",
|
|
558
|
-
label: "Create segment",
|
|
559
|
-
disabled: !o(_).isPremium,
|
|
560
|
-
icon: "add",
|
|
561
|
-
onClick: a[2] || (a[2] = (p) => k())
|
|
562
|
-
}, null, 8, ["disabled"])
|
|
563
|
-
]),
|
|
564
|
-
_: 1
|
|
565
|
-
})),
|
|
566
|
-
l(We, {
|
|
567
|
-
ref_key: "sheetRef",
|
|
568
|
-
ref: g,
|
|
569
|
-
"onUpdate:modelValue": b
|
|
570
|
-
}, null, 512)
|
|
571
|
-
])
|
|
572
|
-
], 64);
|
|
573
|
-
};
|
|
574
|
-
}
|
|
575
|
-
});
|
|
576
|
-
export {
|
|
577
|
-
Rt as default
|
|
578
|
-
};
|