@feedmepos/mf-connect 0.1.56-prod → 0.1.58-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/package.json +1 -1
- package/dist/Analytic-XUI4rZyP.js +0 -427
- package/dist/App-vv5J1Ebe.js +0 -4630
- package/dist/Bin-D4V36uXK.js +0 -166
- package/dist/Broadcast-BvW27G77.js +0 -233
- package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D2MC6Gy1.js +0 -121
- package/dist/Card-C7xLv1Fb.js +0 -911
- package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
- package/dist/Collections-BKfS-bGL.js +0 -458
- package/dist/Credit-CGmWQq0t.js +0 -228
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-C2p6_R01.js +0 -2194
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BGlaqjWp.js +0 -348
- package/dist/Experience-CT7Yab3W.js +0 -229
- package/dist/FileSaver.min-NlMItPOc.js +0 -74
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
- package/dist/Game-DtW4rtYQ.js +0 -284
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js +0 -144
- package/dist/Index-Bs5ob9Km.js +0 -259
- package/dist/JsonViewer-v8_C7l5N.js +0 -87
- package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +0 -18737
- package/dist/MainLayout-B1aJoR95.js +0 -41
- package/dist/Marketing-tA350rTd.js +0 -319
- package/dist/Member-CZoTXgKz.js +0 -279
- package/dist/MemberList-ChwyPtmW.js +0 -1607
- package/dist/MemberOverview-wL_ailso.js +0 -58
- package/dist/MemberTransactions-Cchtvxm9.js +0 -45
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Bo0EnHBx.js +0 -60553
- package/dist/Mission-DDpelLqN.js +0 -302
- package/dist/Overview-Da3ewBat.js +0 -1079
- package/dist/Point-CggE8VUk.js +0 -232
- package/dist/Promotion-DxvbZhgQ.js +0 -289
- package/dist/Queue-fIxlHrMd.js +0 -260
- package/dist/Record-Bv90_VUG.js +0 -341
- package/dist/Reward-BWYLk7aC.js +0 -442
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-CjYEtENe.js +0 -150
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Ak1R8Y2a.js +0 -1763
- package/dist/Segment-_VGdBy3a.js +0 -882
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-Dm4hF1n1.js +0 -181
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-DWDMhmNr.js +0 -188
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-Czy25PII.js +0 -147
- package/dist/Setting-7fTz1dJa.js +0 -1936
- package/dist/Store-TQHKR__B.js +0 -1842
- package/dist/StoreRewards-DZy1ZwiI.js +0 -423
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Cae25Vr6.js +0 -995
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-BVVEzpyP.js +0 -139
- package/dist/Tier-CK53vdbl.js +0 -895
- package/dist/Title-CGWPq_FF.js +0 -566
- package/dist/Transaction-DjJ03PfX.js +0 -39
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-DNSdyxrF.js +0 -130
- package/dist/Voucher-D6RuJjNn.js +0 -384
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-D4iCOq3V.js +0 -419
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-BFz8RvY_.js +0 -56
- package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
- package/dist/app-BLlAxdVk.js +0 -57962
- package/dist/app-_rmIFJ8M.js +0 -7057
- package/dist/app-wDQR6dpb.js +0 -39
- package/dist/app.js +0 -6
- package/dist/business-gJ9fK_2b.js +0 -82
- package/dist/campaign-BfznfcHc.js +0 -94
- package/dist/campaign-C_Yq-ffV.js +0 -1810
- package/dist/campaign-CpzFl8Vr.js +0 -4
- package/dist/campaign.enum-Dsbpz7BO.js +0 -20
- package/dist/campaign.fn-C6vKb-lp.js +0 -758
- package/dist/collectible.enum-DNpj_oyC.js +0 -19
- package/dist/collection.fn-Cgo0sPL2.js +0 -26
- package/dist/dto-CaSQ4Pp9.js +0 -216
- package/dist/effect-DuH74x-N.js +0 -78
- package/dist/email-addresses-DXr-Qqt9.js +0 -705
- package/dist/export-tMPFlVV0.js +0 -97
- package/dist/feedme.ico +0 -0
- package/dist/helper-CJTseW10.js +0 -71
- package/dist/index-8RETBwYy.js +0 -8861
- package/dist/index-B57kxqv7.js +0 -3
- package/dist/index-BNUuy_4R.js +0 -44
- package/dist/index-BSJ-4JYy.js +0 -146
- package/dist/index-BTpBLMHl.js +0 -3070
- package/dist/index-C6Iyn1Q6.js +0 -54
- package/dist/index-CWI06v9e.js +0 -31
- package/dist/index-CdnKwJuz.js +0 -30076
- package/dist/index-Cr_9Bqa1.js +0 -121
- package/dist/index-CuvNtC_M.js +0 -61
- package/dist/index-DTyfvK3U.js +0 -2130
- package/dist/index-Dn0gJspN.js +0 -32269
- package/dist/index-IHKkNyxb.js +0 -38
- package/dist/index-J3TDCX-5.js +0 -76
- package/dist/index-V9kRRAB1.js +0 -32
- package/dist/index-vh86FiIQ.js +0 -10
- package/dist/index.esm2017-P2nmohVw.js +0 -3069
- package/dist/loading-D5ZAAdUU.js +0 -71
- package/dist/lodash-B5I3zXaY.js +0 -3678
- package/dist/membership-xl9aKOQ_.js +0 -235
- package/dist/moment-D7p2TMB-.js +0 -2583
- package/dist/money-CIHN3jJZ.js +0 -15
- package/dist/number-BN4-Jdog.js +0 -12
- package/dist/object-qECH92oz.js +0 -26
- package/dist/objectId-dwaoBfJX.js +0 -7
- package/dist/objectid-Dh6RD0Tk.js +0 -145
- package/dist/plugins-CJlgzIv2.js +0 -208
- package/dist/reward-C8mezXzs.js +0 -36
- package/dist/rule-9VRIJFHZ.js +0 -1951
- package/dist/rule-builder-CZUgrDAw.js +0 -102
- package/dist/style.css +0 -4
- package/dist/template-aPJnNGLi.js +0 -190
- package/dist/tier-BJDhpH6X.js +0 -4
- package/dist/tiers/tier=1.png +0 -0
- package/dist/tiers/tier=2.png +0 -0
- package/dist/tiers/tier=3.png +0 -0
- package/dist/tiers/tier=4.png +0 -0
- package/dist/timezone-CpvXaiqq.js +0 -1151
- package/dist/titles/type=diamond.png +0 -0
- package/dist/titles/type=drinks.png +0 -0
- package/dist/titles/type=food.png +0 -0
- package/dist/titles/type=heart.png +0 -0
- package/dist/titles/type=medal.png +0 -0
- package/dist/titles/type=spend.png +0 -0
- package/dist/titles/type=thank-you.png +0 -0
- package/dist/titles/type=thumbs-up.png +0 -0
- package/dist/titles/type=years.png +0 -0
- package/dist/trigger-BfrtcBd-.js +0 -144
- package/dist/tslib.es6-BCqqvLQ_.js +0 -44
- package/dist/type_drinks-D6jnpvwV.js +0 -4
- package/dist/usePagination-Ds-cuHop.js +0 -223
- package/dist/user-Bt1C0yV5.js +0 -54
- package/dist/vue-i18n-OdHHHpEE.js +0 -2365
- package/dist/xlsx-BgB0dYfE.js +0 -15491
- package/dist/zod-Bg2FbC-D.js +0 -90
package/dist/Segment-_VGdBy3a.js
DELETED
|
@@ -1,882 +0,0 @@
|
|
|
1
|
-
import { defineComponent as ee, ref as z, resolveComponent as S, openBlock as m, createElementBlock as C, 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 $, normalizeClass as re, onMounted as Se, computed as ce, isRef as Ie, createSlots as Me, h as Y, onBeforeMount as Te } from "vue";
|
|
2
|
-
import { _ as Ee } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { n as Ae, p as Re } from "./plugins-CJlgzIv2.js";
|
|
4
|
-
import { u as De } from "./loading-D5ZAAdUU.js";
|
|
5
|
-
import { FmButtonVariant as ae, useSnackbar as $e, components as X } from "@feedmepos/ui-library";
|
|
6
|
-
import { u as be, _ as we } from "./usePagination-Ds-cuHop.js";
|
|
7
|
-
import { u as Fe } from "./vue-i18n-OdHHHpEE.js";
|
|
8
|
-
import { i as Pe, j as D, c as fe } from "./index-BTpBLMHl.js";
|
|
9
|
-
import "./index-8RETBwYy.js";
|
|
10
|
-
import "./index-DTyfvK3U.js";
|
|
11
|
-
import "./index-IHKkNyxb.js";
|
|
12
|
-
import "./index-C6Iyn1Q6.js";
|
|
13
|
-
import { u as ne, w as he } from "./xlsx-BgB0dYfE.js";
|
|
14
|
-
import { e as Ne, M as Be } from "./email-addresses-DXr-Qqt9.js";
|
|
15
|
-
import { Z as Ve } from "./zod-Bg2FbC-D.js";
|
|
16
|
-
import { u as Ye } from "./app-wDQR6dpb.js";
|
|
17
|
-
import { F as ye, z as Ue } from "./index-Dn0gJspN.js";
|
|
18
|
-
import { R as ge } from "./rule-builder-CZUgrDAw.js";
|
|
19
|
-
import { _ as Le } from "./ZodTextField.vue_vue_type_script_setup_true_lang-BFz8RvY_.js";
|
|
20
|
-
import { _ as ze } from "./RuleGroup.vue_vue_type_script_setup_true_lang-Ak1R8Y2a.js";
|
|
21
|
-
import { u as Oe, v as je, w as qe } from "./index.esm2017-P2nmohVw.js";
|
|
22
|
-
import { F as He } from "./FileSaver.min-NlMItPOc.js";
|
|
23
|
-
import { h as G } from "./moment-D7p2TMB-.js";
|
|
24
|
-
import { s as N, u as Ge } from "./membership-xl9aKOQ_.js";
|
|
25
|
-
import { o as Je } from "./objectId-dwaoBfJX.js";
|
|
26
|
-
import { u as ke } from "./business-gJ9fK_2b.js";
|
|
27
|
-
import { f as Qe } from "./number-BN4-Jdog.js";
|
|
28
|
-
import { t as We } from "./money-CIHN3jJZ.js";
|
|
29
|
-
import "./index-B57kxqv7.js";
|
|
30
|
-
import { useRouter as Ke } from "vue-router";
|
|
31
|
-
import { m as ve } from "./index-J3TDCX-5.js";
|
|
32
|
-
import { R as _e } from "./app-_rmIFJ8M.js";
|
|
33
|
-
const Ze = Pe.extend({
|
|
34
|
-
_id: ye.optional(),
|
|
35
|
-
business: ye.optional(),
|
|
36
|
-
file: Ue.any().nullish()
|
|
37
|
-
});
|
|
38
|
-
var Xe = { firebase: { apiKey: "AIzaSyA_isPR1-9bX7UmRiJIhsIRNNwdn6DdmW4", authDomain: "feedme-253402.firebaseapp.com", databaseURL: "https://feedme-253402.firebaseio.com", projectId: "feedme-253402", storageBucket: "image.feedme.cc", messagingSenderId: "128512026847", appId: "1:128512026847:web:7c5c8ab7e8b90502dc616a", measurementId: "G-LTKS7N2HQS" }, assetBucketUrl: "static.feedme.cc", importFilesBucketUrl: "feedme-253402.appspot.com", clientId: "d5f8840d63dbb758b6c4ee2a5e8b013d15dd25e242c457481326062b83962476" };
|
|
39
|
-
const et = { class: "flex flex-col space-y-16" }, tt = {
|
|
40
|
-
key: 0,
|
|
41
|
-
class: /* @__PURE__ */ re([
|
|
42
|
-
"p-16 pl-24 space-x-8",
|
|
43
|
-
"bg-fm-color-primary-oats rounded-lg",
|
|
44
|
-
"flex items-center",
|
|
45
|
-
"justify-between"
|
|
46
|
-
])
|
|
47
|
-
}, ot = { class: "flex justify-end" }, at = {
|
|
48
|
-
key: 1,
|
|
49
|
-
class: /* @__PURE__ */ re([
|
|
50
|
-
"flex items-center",
|
|
51
|
-
"border border-fm-color-neutral-gray-300",
|
|
52
|
-
"p-16 space-x-16 rounded-md"
|
|
53
|
-
])
|
|
54
|
-
}, nt = { class: "fm-typo-en-body-lg-400 flex-1 truncate" }, st = /* @__PURE__ */ ee({
|
|
55
|
-
__name: "ImportSegment",
|
|
56
|
-
props: {
|
|
57
|
-
importFile: {}
|
|
58
|
-
},
|
|
59
|
-
emits: ["update:file"],
|
|
60
|
-
setup(e, { emit: v }) {
|
|
61
|
-
const _ = e, k = v, { t: p } = Fe(), f = z(null), b = z(null), w = ["Id"], n = [
|
|
62
|
-
{
|
|
63
|
-
label: "CSV",
|
|
64
|
-
icon: "csv",
|
|
65
|
-
value: "csv"
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
label: "Excel",
|
|
69
|
-
icon: "description",
|
|
70
|
-
value: "xlsx"
|
|
71
|
-
}
|
|
72
|
-
];
|
|
73
|
-
async function i() {
|
|
74
|
-
if (_.importFile)
|
|
75
|
-
try {
|
|
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
|
-
}
|
|
81
|
-
}
|
|
82
|
-
async function c(h) {
|
|
83
|
-
switch (h) {
|
|
84
|
-
case "csv":
|
|
85
|
-
const y = new Blob([w.join(",")], {
|
|
86
|
-
type: "text/csv;charset=utf-8;"
|
|
87
|
-
});
|
|
88
|
-
He.saveAs(y, "ImportSegmentTemplate.csv");
|
|
89
|
-
break;
|
|
90
|
-
case "xlsx":
|
|
91
|
-
const x = ne.aoa_to_sheet([w]), I = ne.book_new();
|
|
92
|
-
ne.book_append_sheet(I, x, "Sheet1"), he(I, "ImportSegmentTemplate.xlsx");
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
function F(h) {
|
|
97
|
-
f.value = h, k("update:file", f.value);
|
|
98
|
-
}
|
|
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
|
-
F(y);
|
|
103
|
-
}
|
|
104
|
-
return (h, y) => {
|
|
105
|
-
const x = S("FmButton"), I = S("FmMenuItem"), d = S("FmMenu"), s = S("FmDropField");
|
|
106
|
-
return m(), C("div", et, [
|
|
107
|
-
y[2] || (y[2] = l("div", { class: "fm-typo-en-title-sm-800" }, "Upload File", -1)),
|
|
108
|
-
e.importFile ? (m(), C("div", tt, [
|
|
109
|
-
r(x, {
|
|
110
|
-
label: t(p)("View uploaded file"),
|
|
111
|
-
variant: t(ae).Plain,
|
|
112
|
-
icon: "file_present",
|
|
113
|
-
onClick: i
|
|
114
|
-
}, null, 8, ["label", "variant"])
|
|
115
|
-
])) : le("", !0),
|
|
116
|
-
l("div", null, [
|
|
117
|
-
l("div", ot, [
|
|
118
|
-
r(d, { class: "" }, {
|
|
119
|
-
"menu-button": E(() => [
|
|
120
|
-
r(x, {
|
|
121
|
-
variant: "tertiary",
|
|
122
|
-
icon: "download",
|
|
123
|
-
label: "Download Template"
|
|
124
|
-
})
|
|
125
|
-
]),
|
|
126
|
-
default: E(() => [
|
|
127
|
-
(m(), C(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
|
-
selectable: ""
|
|
133
|
-
}, null, 8, ["icon", "label", "onClick"])), 64))
|
|
134
|
-
]),
|
|
135
|
-
_: 1
|
|
136
|
-
})
|
|
137
|
-
]),
|
|
138
|
-
f.value ? (m(), C("div", at, [
|
|
139
|
-
r(x, {
|
|
140
|
-
variant: t(ae).Tertiary,
|
|
141
|
-
"prepend-icon": "attach_file"
|
|
142
|
-
}, null, 8, ["variant"]),
|
|
143
|
-
l("p", nt, $(f.value.name), 1),
|
|
144
|
-
l("label", {
|
|
145
|
-
ref_key: "fileLabelRef",
|
|
146
|
-
ref: b,
|
|
147
|
-
htmlFor: "file"
|
|
148
|
-
}, [
|
|
149
|
-
r(x, {
|
|
150
|
-
variant: t(ae).Plain,
|
|
151
|
-
label: t(p)("Replace File"),
|
|
152
|
-
onClick: y[1] || (y[1] = () => {
|
|
153
|
-
var g;
|
|
154
|
-
return (g = b.value) == null ? void 0 : g.click();
|
|
155
|
-
})
|
|
156
|
-
}, null, 8, ["variant", "label"]),
|
|
157
|
-
l("input", {
|
|
158
|
-
id: "file",
|
|
159
|
-
accept: ".csv",
|
|
160
|
-
class: "hidden",
|
|
161
|
-
type: "file",
|
|
162
|
-
multiple: "",
|
|
163
|
-
onChange: A
|
|
164
|
-
}, null, 32)
|
|
165
|
-
], 512)
|
|
166
|
-
])) : (m(), J(s, {
|
|
167
|
-
key: 0,
|
|
168
|
-
onFileUpload: y[0] || (y[0] = (g) => F(g)),
|
|
169
|
-
accept: ".csv, .xlsx",
|
|
170
|
-
"max-file-size": 2e7
|
|
171
|
-
}))
|
|
172
|
-
])
|
|
173
|
-
]);
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
}), lt = { class: "space-y-16 pr-12" }, it = { class: "fm-typo-en-title-md-800" }, rt = { class: "flex space-x-8" }, ct = { class: "fm-typo-en-title-md-800 text-fm-color-primary" }, dt = { class: "text-fm-color-typo-secondary" }, ut = /* @__PURE__ */ ee({
|
|
177
|
-
__name: "ReviewSegment",
|
|
178
|
-
props: {
|
|
179
|
-
title: {},
|
|
180
|
-
segment: {}
|
|
181
|
-
},
|
|
182
|
-
setup(e) {
|
|
183
|
-
const v = e, _ = [
|
|
184
|
-
{
|
|
185
|
-
header: "Name",
|
|
186
|
-
accessorFn: (i) => i.name
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
header: "Id",
|
|
190
|
-
accessorFn: (i) => i._id
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
header: "Customer Since",
|
|
194
|
-
accessorFn: (i) => G(Je(i._id.toString())).format("DD MMM YYYY")
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
header: "Phone",
|
|
198
|
-
accessorFn: (i) => i.phoneNumber
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
header: "Birthday",
|
|
202
|
-
accessorFn: (i) => G(i.birthday).format("DD MMM YYYY")
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
header: "Last Visit",
|
|
206
|
-
accessorFn: (i) => G(i.stats.lastVisit).format("DD MMM YYYY")
|
|
207
|
-
}
|
|
208
|
-
];
|
|
209
|
-
async function k(i) {
|
|
210
|
-
return v.segment._id ? (console.log(i), await N.paginateSegmentUsers(
|
|
211
|
-
v.segment._id,
|
|
212
|
-
i
|
|
213
|
-
)) : {
|
|
214
|
-
resources: [],
|
|
215
|
-
meta: {
|
|
216
|
-
totalResources: 0,
|
|
217
|
-
totalPages: 0,
|
|
218
|
-
skip: i.skip,
|
|
219
|
-
limit: i.limit,
|
|
220
|
-
sortBy: i.sortBy
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
const { tableMeta: p, rowData: f, onSort: b, debouncedFetchData: w, onSearch: n } = be(k);
|
|
225
|
-
return Se(async () => {
|
|
226
|
-
await w();
|
|
227
|
-
}), (i, c) => (m(), C("div", lt, [
|
|
228
|
-
l("div", it, $(v.title), 1),
|
|
229
|
-
l("div", rt, [
|
|
230
|
-
l("div", ct, $(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 " + $(t(G)(e.segment.lastUpdated).format("DD MMM YYYY")), 1)
|
|
234
|
-
])
|
|
235
|
-
]),
|
|
236
|
-
r(we, {
|
|
237
|
-
loading: t(p).isLoading,
|
|
238
|
-
"row-data": t(f),
|
|
239
|
-
"row-count": t(p).totalRows,
|
|
240
|
-
"column-defs": _,
|
|
241
|
-
"page-size": t(p).pageSize,
|
|
242
|
-
"page-count": t(p).pageCount,
|
|
243
|
-
"page-index": t(p).pageIndex,
|
|
244
|
-
onSortChange: t(b),
|
|
245
|
-
onPageChange: c[0] || (c[0] = (F) => t(w)({ pageSize: F.pageSize, pageIndex: F.pageIndex }))
|
|
246
|
-
}, null, 8, ["loading", "row-data", "row-count", "page-size", "page-count", "page-index", "onSortChange"])
|
|
247
|
-
]));
|
|
248
|
-
}
|
|
249
|
-
}), mt = { class: "space-y-24" }, pt = { class: "grid grid-cols-2 gap-16" }, ft = { class: "fm-typo-en-title-sm-800" }, yt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, gt = /* @__PURE__ */ ee({
|
|
250
|
-
__name: "SegmentTypeOption",
|
|
251
|
-
props: {
|
|
252
|
-
modelValue: {},
|
|
253
|
-
errorText: {}
|
|
254
|
-
},
|
|
255
|
-
emits: ["update:model-value"],
|
|
256
|
-
setup(e, { emit: v }) {
|
|
257
|
-
const _ = e, k = v, p = [
|
|
258
|
-
{
|
|
259
|
-
label: "Dynamic",
|
|
260
|
-
sublabel: "Segment statistics are based on rules configured and will be recalculated automatically when rule changes.",
|
|
261
|
-
value: D.enum.DYNAMIC
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
label: "Static",
|
|
265
|
-
sublabel: "Segment statistics are based on imported data and will not be recalculated.",
|
|
266
|
-
value: D.enum.STATIC
|
|
267
|
-
}
|
|
268
|
-
];
|
|
269
|
-
function f(b) {
|
|
270
|
-
b !== _.modelValue && k("update:model-value", b);
|
|
271
|
-
}
|
|
272
|
-
return (b, w) => {
|
|
273
|
-
const n = S("FmCard"), i = S("FmHelperText");
|
|
274
|
-
return m(), C("div", mt, [
|
|
275
|
-
l("div", pt, [
|
|
276
|
-
(m(), C(O, null, ie(p, (c) => r(n, {
|
|
277
|
-
variant: "outlined",
|
|
278
|
-
class: re(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
|
|
279
|
-
"col-span-2": p.length == 1,
|
|
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
|
-
}]),
|
|
283
|
-
onClick: (F) => f(c.value),
|
|
284
|
-
key: c.value
|
|
285
|
-
}, {
|
|
286
|
-
default: E(() => [
|
|
287
|
-
l("div", ft, $(c.label), 1),
|
|
288
|
-
l("div", yt, $(c.sublabel), 1)
|
|
289
|
-
]),
|
|
290
|
-
_: 2
|
|
291
|
-
}, 1032, ["class", "onClick"])), 64))
|
|
292
|
-
]),
|
|
293
|
-
e.errorText ? (m(), J(i, {
|
|
294
|
-
key: 0,
|
|
295
|
-
class: "!mt-4",
|
|
296
|
-
text: e.errorText,
|
|
297
|
-
state: "error"
|
|
298
|
-
}, null, 8, ["text"])) : le("", !0)
|
|
299
|
-
]);
|
|
300
|
-
};
|
|
301
|
-
}
|
|
302
|
-
}), vt = { class: "flex items-center gap-x-8" }, _t = {
|
|
303
|
-
key: 0,
|
|
304
|
-
class: "space-y-16 pr-12"
|
|
305
|
-
}, xt = { class: "flex flex-col space-y-16" }, St = {
|
|
306
|
-
key: 0,
|
|
307
|
-
class: "flex flex-col space-y-16"
|
|
308
|
-
}, bt = {
|
|
309
|
-
key: 1,
|
|
310
|
-
class: "flex flex-col space-y-16"
|
|
311
|
-
}, wt = {
|
|
312
|
-
key: 2,
|
|
313
|
-
class: "flex flex-col space-y-16"
|
|
314
|
-
}, Ft = { class: "flex items-center gap-8" }, ht = /* @__PURE__ */ ee({
|
|
315
|
-
__name: "SegmentSheet",
|
|
316
|
-
emits: ["update:model-value"],
|
|
317
|
-
setup(e, { expose: v, emit: _ }) {
|
|
318
|
-
const k = Ye(), p = z(!1), f = z(!1), b = {
|
|
319
|
-
name: "",
|
|
320
|
-
isActive: !0,
|
|
321
|
-
type: D.enum.DYNAMIC,
|
|
322
|
-
rule: ge.scaffoldGroup(),
|
|
323
|
-
members: []
|
|
324
|
-
}, w = Ze, n = z(b), i = ce(() => {
|
|
325
|
-
const d = w.safeParse(n.value);
|
|
326
|
-
return d.success ? [] : d.error.errors;
|
|
327
|
-
});
|
|
328
|
-
function c(d) {
|
|
329
|
-
p.value = !0, f.value = !1, d ? n.value = {
|
|
330
|
-
...d,
|
|
331
|
-
isActive: d.isActive !== !1,
|
|
332
|
-
type: d.type ?? (d.importFile ? D.enum.STATIC : D.enum.DYNAMIC)
|
|
333
|
-
} : n.value = { ...b };
|
|
334
|
-
}
|
|
335
|
-
function F() {
|
|
336
|
-
p.value = !1;
|
|
337
|
-
}
|
|
338
|
-
async function A() {
|
|
339
|
-
w.safeParse(n.value).success && (f.value = !0);
|
|
340
|
-
}
|
|
341
|
-
function h(d) {
|
|
342
|
-
d === D.enum.STATIC ? F() : f.value = !1;
|
|
343
|
-
}
|
|
344
|
-
async function y() {
|
|
345
|
-
n.value.type === D.enum.STATIC ? (n.value.rule = ge.scaffoldGroup(), n.value.isActive = !0) : n.value.file = void 0, I("update:model-value", n.value);
|
|
346
|
-
}
|
|
347
|
-
async function x(d) {
|
|
348
|
-
n.value.type = d;
|
|
349
|
-
}
|
|
350
|
-
Se(async () => {
|
|
351
|
-
});
|
|
352
|
-
const I = _;
|
|
353
|
-
return v({
|
|
354
|
-
showSheet: c,
|
|
355
|
-
hideSheet: F
|
|
356
|
-
}), (d, s) => {
|
|
357
|
-
const g = S("FmButton"), U = S("FmSwitch"), a = S("FmSideSheet");
|
|
358
|
-
return m(), J(a, {
|
|
359
|
-
modelValue: t(p),
|
|
360
|
-
"onUpdate:modelValue": s[8] || (s[8] = (o) => Ie(p) ? p.value = o : null),
|
|
361
|
-
header: "Add segment",
|
|
362
|
-
"dismiss-away": "",
|
|
363
|
-
"close-button": !0,
|
|
364
|
-
"max-width": 1100
|
|
365
|
-
}, Me({
|
|
366
|
-
"side-sheet-footer": E(() => [
|
|
367
|
-
l("div", Ft, [
|
|
368
|
-
t(f) || t(n).type === t(D).enum.STATIC ? (m(), C(O, { key: 0 }, [
|
|
369
|
-
r(g, {
|
|
370
|
-
label: "Save Segment",
|
|
371
|
-
onClick: y,
|
|
372
|
-
loading: t(k).isLoading,
|
|
373
|
-
disabled: t(i).length > 0 || t(k).isLoading
|
|
374
|
-
}, null, 8, ["loading", "disabled"]),
|
|
375
|
-
r(g, {
|
|
376
|
-
label: "Cancel",
|
|
377
|
-
onClick: s[6] || (s[6] = (o) => h(t(n).type)),
|
|
378
|
-
variant: "tertiary"
|
|
379
|
-
})
|
|
380
|
-
], 64)) : (m(), C(O, { key: 1 }, [
|
|
381
|
-
r(g, {
|
|
382
|
-
label: "Review Segment",
|
|
383
|
-
disabled: t(i).length > 0 || t(k).isLoading,
|
|
384
|
-
onClick: A
|
|
385
|
-
}, null, 8, ["disabled"]),
|
|
386
|
-
r(g, {
|
|
387
|
-
label: "Cancel",
|
|
388
|
-
onClick: s[7] || (s[7] = (o) => F()),
|
|
389
|
-
variant: "tertiary"
|
|
390
|
-
})
|
|
391
|
-
], 64))
|
|
392
|
-
])
|
|
393
|
-
]),
|
|
394
|
-
default: E(() => {
|
|
395
|
-
var o;
|
|
396
|
-
return [
|
|
397
|
-
t(f) ? (m(), J(ut, {
|
|
398
|
-
key: 1,
|
|
399
|
-
title: t(n).name,
|
|
400
|
-
segment: t(n)
|
|
401
|
-
}, null, 8, ["title", "segment"])) : (m(), C("div", _t, [
|
|
402
|
-
r(Le, {
|
|
403
|
-
modelValue: t(n).name,
|
|
404
|
-
"onUpdate:modelValue": s[1] || (s[1] = (u) => t(n).name = u),
|
|
405
|
-
label: "Segment title",
|
|
406
|
-
schema: t(Ve).typeAtPath(t(w), "name")
|
|
407
|
-
}, null, 8, ["modelValue", "schema"]),
|
|
408
|
-
l("div", xt, [
|
|
409
|
-
s[10] || (s[10] = l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Type", -1)),
|
|
410
|
-
r(gt, {
|
|
411
|
-
"model-value": t(n).type,
|
|
412
|
-
"onUpdate:modelValue": s[2] || (s[2] = (u) => {
|
|
413
|
-
x(u);
|
|
414
|
-
})
|
|
415
|
-
}, null, 8, ["model-value"])
|
|
416
|
-
]),
|
|
417
|
-
t(n).type === t(D).enum.DYNAMIC ? (m(), C("div", St, [
|
|
418
|
-
s[11] || (s[11] = l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Filter", -1)),
|
|
419
|
-
r(ze, {
|
|
420
|
-
"trigger-type": "MEMBERSHIP_JOINED",
|
|
421
|
-
includeOnly: "user",
|
|
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
|
-
})
|
|
426
|
-
}, null, 8, ["model-value"])
|
|
427
|
-
])) : (m(), C("div", bt, [
|
|
428
|
-
r(st, {
|
|
429
|
-
importFile: t(n).importFile,
|
|
430
|
-
"onUpdate:file": s[4] || (s[4] = (u) => {
|
|
431
|
-
t(n).file = u;
|
|
432
|
-
})
|
|
433
|
-
}, null, 8, ["importFile"])
|
|
434
|
-
])),
|
|
435
|
-
t(n).type === t(D).enum.DYNAMIC ? (m(), C("div", wt, [
|
|
436
|
-
s[12] || (s[12] = l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Status", -1)),
|
|
437
|
-
r(U, {
|
|
438
|
-
"model-value": t(n).isActive ?? !0,
|
|
439
|
-
"onUpdate:modelValue": s[5] || (s[5] = (u) => t(n).isActive = u),
|
|
440
|
-
label: "Active",
|
|
441
|
-
sublabel: "When enabled, this will recalculate the segment statistics daily.",
|
|
442
|
-
"label-placement": "right"
|
|
443
|
-
}, null, 8, ["model-value"])
|
|
444
|
-
])) : le("", !0)
|
|
445
|
-
]))
|
|
446
|
-
];
|
|
447
|
-
}),
|
|
448
|
-
_: 2
|
|
449
|
-
}, [
|
|
450
|
-
t(f) ? {
|
|
451
|
-
name: "side-sheet-header",
|
|
452
|
-
fn: E(() => [
|
|
453
|
-
l("div", vt, [
|
|
454
|
-
r(g, {
|
|
455
|
-
icon: "arrow_back",
|
|
456
|
-
variant: "tertiary",
|
|
457
|
-
onClick: s[0] || (s[0] = (o) => f.value = !1)
|
|
458
|
-
}),
|
|
459
|
-
s[9] || (s[9] = l("div", null, "Review segment", -1))
|
|
460
|
-
])
|
|
461
|
-
]),
|
|
462
|
-
key: "0"
|
|
463
|
-
} : void 0
|
|
464
|
-
]), 1032, ["modelValue"]);
|
|
465
|
-
};
|
|
466
|
-
}
|
|
467
|
-
}), xe = Ge(), kt = ke();
|
|
468
|
-
function se(e) {
|
|
469
|
-
const v = G(e);
|
|
470
|
-
return v.isValid() ? v.format("DD/MM/YYYY") : "";
|
|
471
|
-
}
|
|
472
|
-
const Ct = {
|
|
473
|
-
mapMemberExportRow: (e) => {
|
|
474
|
-
var i, c, F, A, h, y, x, I, d, s, g, U, a, o, u, P, R, B, V, j, q, H, te, M, Q, de, ue, me;
|
|
475
|
-
const v = ce(() => kt.locations.map((T) => ({
|
|
476
|
-
label: T.name,
|
|
477
|
-
value: T._id
|
|
478
|
-
}))), _ = (i = Ne.parseOneAddress(
|
|
479
|
-
e == null ? void 0 : e.email
|
|
480
|
-
)) != null && i.domain.includes("feedmepos.com") ? void 0 : e.email, k = (F = ((c = e == null ? void 0 : e.collection) == null ? void 0 : c.TITLE) || []) == null ? void 0 : F.reduce(
|
|
481
|
-
(T, L) => {
|
|
482
|
-
var K, Z;
|
|
483
|
-
const W = (Z = (K = xe.sortedTitles) == null ? void 0 : K.find(
|
|
484
|
-
(oe) => oe._id === L.collectible
|
|
485
|
-
)) == null ? void 0 : Z.name;
|
|
486
|
-
return !W || L.balance <= 0 || T.push(W), T;
|
|
487
|
-
},
|
|
488
|
-
[]
|
|
489
|
-
), p = (xe.sortedTitles || []).reduce(
|
|
490
|
-
(T, L) => {
|
|
491
|
-
var K, Z, oe, pe;
|
|
492
|
-
const W = (pe = (oe = (Z = (((K = e == null ? void 0 : e.collection) == null ? void 0 : K.TITLE) || []).find(
|
|
493
|
-
(Ce) => Ce.collectible === L._id
|
|
494
|
-
)) == null ? void 0 : Z.expiryBalance) == null ? void 0 : oe[0]) == null ? void 0 : pe.expiredAt;
|
|
495
|
-
return T[L.name] = W ? G(W).format("DD/MM/YYYY") : "", T;
|
|
496
|
-
},
|
|
497
|
-
{}
|
|
498
|
-
), f = ((y = (h = (A = e.collection) == null ? void 0 : A.CREDIT) == null ? void 0 : h.at(0)) == null ? void 0 : y.balance) || 0, b = ((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
|
-
(T, L) => T + L.amount,
|
|
500
|
-
0
|
|
501
|
-
)) || 0, w = Qe(f, 2);
|
|
502
|
-
return {
|
|
503
|
-
ID: e._id.toString(),
|
|
504
|
-
Name: ((g = e.name) == null ? void 0 : g.trim()) || "",
|
|
505
|
-
Phone: ((U = e == null ? void 0 : e.phoneNumber) == null ? void 0 : U.trim()) || "",
|
|
506
|
-
Email: _ || "",
|
|
507
|
-
Gender: e.gender || "",
|
|
508
|
-
CardNo: e.cardNo || "",
|
|
509
|
-
Birthday: e != null && e.birthday ? se(e == null ? void 0 : e.birthday) : "",
|
|
510
|
-
Credit: parseFloat((Number(w) - Number(b)).toFixed(2)),
|
|
511
|
-
FreeCredit: Number(b.toFixed(2)),
|
|
512
|
-
TotalCredit: Number(w),
|
|
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
|
-
Point: e != null && e.collection ? ((B = (R = (P = e.collection) == null ? void 0 : P.COIN) == null ? void 0 : R.at(0)) == null ? void 0 : B.balance) ?? 0 : 0,
|
|
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,
|
|
516
|
-
Tier: e != null && e.collection ? ((M = (te = (H = e.collection) == null ? void 0 : H.TIER) == null ? void 0 : te.at(0)) == null ? void 0 : M.balance) ?? 0 : 0,
|
|
517
|
-
Titles: k.join(","),
|
|
518
|
-
...p,
|
|
519
|
-
TotalTransaction: e.stats.visitCount,
|
|
520
|
-
AvgSpent: We(Number(e.stats.avgBillSize || 0)).toFormat(
|
|
521
|
-
!1
|
|
522
|
-
),
|
|
523
|
-
TotalSpent: e.stats.avgBillSize * e.stats.visitCount,
|
|
524
|
-
LastVisit: se(e.stats.lastVisit),
|
|
525
|
-
Feedback: ((Q = e.stats) == null ? void 0 : Q.feedbackCount) || 0,
|
|
526
|
-
LastSeasonTierEarned: ((de = e.stats) == null ? void 0 : de.lastSeasonTierEarned) || 0,
|
|
527
|
-
LastSeasonPointEarned: ((ue = e.stats) == null ? void 0 : ue.lastSeasonPointEarned) || 0,
|
|
528
|
-
JoinedAt: se(e.joinAt || void 0),
|
|
529
|
-
JoinedAtLocation: e.location && ((me = v.value.find((T) => T.value == e.location)) == null ? void 0 : me.label) || "-",
|
|
530
|
-
VisitFrequency: `${Number(
|
|
531
|
-
Math.ceil(e.stats.avgVisitFrequency).toFixed(0)
|
|
532
|
-
)}`
|
|
533
|
-
};
|
|
534
|
-
}
|
|
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" }, Rt = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, mo = /* @__PURE__ */ ee({
|
|
536
|
-
__name: "Segment",
|
|
537
|
-
setup(e) {
|
|
538
|
-
const { minor: v } = De, { t: _ } = Fe(), k = ke(), { mapMemberExportRow: p } = Ct, f = $e(), b = Ke(), w = z(0), n = [
|
|
539
|
-
{
|
|
540
|
-
header: _("connect.loyalty.segment.table.name"),
|
|
541
|
-
accessorFn: (a) => a.name
|
|
542
|
-
},
|
|
543
|
-
{
|
|
544
|
-
header: _("connect.loyalty.segment.table.status"),
|
|
545
|
-
enableSorting: !1,
|
|
546
|
-
cell(a) {
|
|
547
|
-
const o = a.row.original.isActive === !1 ? "Inactive" : "Active";
|
|
548
|
-
return Y(X.FmChip, {
|
|
549
|
-
class: a.row.original.isActive === !1 ? "text-fm-color-typo-error bg-fm-color-system-error-100" : "text-fm-color-typo-success bg-fm-color-system-success-100",
|
|
550
|
-
label: o,
|
|
551
|
-
compact: !0
|
|
552
|
-
});
|
|
553
|
-
}
|
|
554
|
-
},
|
|
555
|
-
{
|
|
556
|
-
header: _("connect.loyalty.segment.table.total_customers"),
|
|
557
|
-
accessorFn: (a) => a.memberCount ?? 0
|
|
558
|
-
},
|
|
559
|
-
{
|
|
560
|
-
header: _("connect.loyalty.segment.table.customer_percentage"),
|
|
561
|
-
accessorFn: (a) => ((a.memberCount ?? 0) * 100 / w.value).toFixed(2)
|
|
562
|
-
},
|
|
563
|
-
{
|
|
564
|
-
header: _("connect.loyalty.segment.table.actions"),
|
|
565
|
-
meta: {
|
|
566
|
-
maxWidth: "100px"
|
|
567
|
-
},
|
|
568
|
-
cell(a) {
|
|
569
|
-
return Y("div", { class: "flex items-center justify-end" }, [
|
|
570
|
-
Y(
|
|
571
|
-
X.FmMenu,
|
|
572
|
-
{
|
|
573
|
-
placement: "bottom-end",
|
|
574
|
-
onClick: (o) => {
|
|
575
|
-
o.stopPropagation();
|
|
576
|
-
}
|
|
577
|
-
},
|
|
578
|
-
{
|
|
579
|
-
"menu-button": () => Y(X.FmButton, {
|
|
580
|
-
icon: "more_vert",
|
|
581
|
-
iconColor: "neutral-gray-400",
|
|
582
|
-
variant: "tertiary"
|
|
583
|
-
}),
|
|
584
|
-
default: () => [
|
|
585
|
-
Y(
|
|
586
|
-
X.FmMenuItem,
|
|
587
|
-
{
|
|
588
|
-
onClick: async (o) => {
|
|
589
|
-
o.stopPropagation(), x(a.row.original);
|
|
590
|
-
}
|
|
591
|
-
},
|
|
592
|
-
{
|
|
593
|
-
label: Y(
|
|
594
|
-
"div",
|
|
595
|
-
{
|
|
596
|
-
class: "fm-typo-en-body-md-400"
|
|
597
|
-
},
|
|
598
|
-
"Export"
|
|
599
|
-
)
|
|
600
|
-
}
|
|
601
|
-
),
|
|
602
|
-
Y(
|
|
603
|
-
X.FmMenuItem,
|
|
604
|
-
{
|
|
605
|
-
onClick: async (o) => {
|
|
606
|
-
o.stopPropagation(), y(a.row.original);
|
|
607
|
-
}
|
|
608
|
-
},
|
|
609
|
-
{
|
|
610
|
-
label: Y(
|
|
611
|
-
"div",
|
|
612
|
-
{
|
|
613
|
-
class: "text-fm-color-typo-error fm-typo-en-body-md-400"
|
|
614
|
-
},
|
|
615
|
-
"Remove"
|
|
616
|
-
)
|
|
617
|
-
}
|
|
618
|
-
)
|
|
619
|
-
]
|
|
620
|
-
}
|
|
621
|
-
)
|
|
622
|
-
]);
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
], i = z(null), { tableMeta: c, rowData: F, debouncedFetchData: A } = be(
|
|
626
|
-
N.readAll
|
|
627
|
-
);
|
|
628
|
-
async function h() {
|
|
629
|
-
await v(
|
|
630
|
-
async () => {
|
|
631
|
-
await N.refreshSegments(), await A({ pageSize: 10, pageIndex: 0 });
|
|
632
|
-
},
|
|
633
|
-
{ message: "Refreshing segmentations" }
|
|
634
|
-
);
|
|
635
|
-
}
|
|
636
|
-
async function y(a) {
|
|
637
|
-
await Re.remove(`Are you sure you want to remove ${a.name}?`) && await v(
|
|
638
|
-
async () => {
|
|
639
|
-
await N.delete(a._id), await A({ pageSize: 10, pageIndex: 0 });
|
|
640
|
-
},
|
|
641
|
-
{
|
|
642
|
-
message: `Removing ${a.name}`,
|
|
643
|
-
successMessage: `Removed ${a.name} successfully`
|
|
644
|
-
}
|
|
645
|
-
);
|
|
646
|
-
}
|
|
647
|
-
async function x(a) {
|
|
648
|
-
const o = {
|
|
649
|
-
sortBy: "_id",
|
|
650
|
-
descending: !1,
|
|
651
|
-
rowsPerPage: 1e3,
|
|
652
|
-
page: 1,
|
|
653
|
-
rowsNumber: 0
|
|
654
|
-
}, u = new Be(), P = (await ve.read({
|
|
655
|
-
limit: 1,
|
|
656
|
-
skip: 0,
|
|
657
|
-
sortBy: o.sortBy,
|
|
658
|
-
descending: o.descending
|
|
659
|
-
})).meta.totalResources ?? 0, R = o.rowsPerPage;
|
|
660
|
-
await v(
|
|
661
|
-
async () => {
|
|
662
|
-
for (let B = 0; B < P; B += R) {
|
|
663
|
-
const V = {
|
|
664
|
-
...o,
|
|
665
|
-
limit: R,
|
|
666
|
-
skip: o.page - 1,
|
|
667
|
-
sortBy: o.sortBy,
|
|
668
|
-
descending: o.descending
|
|
669
|
-
}, j = await N.paginateSegmentUsers(
|
|
670
|
-
a._id,
|
|
671
|
-
V
|
|
672
|
-
);
|
|
673
|
-
for (const q of j.resources) {
|
|
674
|
-
const H = p(q);
|
|
675
|
-
u.addRecord(H);
|
|
676
|
-
}
|
|
677
|
-
o.page++;
|
|
678
|
-
}
|
|
679
|
-
await he(
|
|
680
|
-
u.buildExcel(),
|
|
681
|
-
`[${a.name}]-members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
|
|
682
|
-
{
|
|
683
|
-
bookType: "xlsx",
|
|
684
|
-
bookSST: !1,
|
|
685
|
-
type: "array"
|
|
686
|
-
}
|
|
687
|
-
), o.page = 1;
|
|
688
|
-
},
|
|
689
|
-
{
|
|
690
|
-
message: "Exporting member...",
|
|
691
|
-
successMessage: "Member exported successfully"
|
|
692
|
-
}
|
|
693
|
-
);
|
|
694
|
-
}
|
|
695
|
-
async function I(a) {
|
|
696
|
-
await v(
|
|
697
|
-
async () => {
|
|
698
|
-
var o;
|
|
699
|
-
if (a.type === D.enum.STATIC) {
|
|
700
|
-
const u = new FormData();
|
|
701
|
-
if (u.append("file", a.file), a._id) {
|
|
702
|
-
const { members: P, _id: R, file: B, ...V } = a;
|
|
703
|
-
u.append("segment", JSON.stringify(V)), await N.updateStatic(a._id, u);
|
|
704
|
-
} else {
|
|
705
|
-
const { file: P, ...R } = a;
|
|
706
|
-
u.append("segment", JSON.stringify(R)), await N.createStatic(u);
|
|
707
|
-
}
|
|
708
|
-
a.file && f.open({
|
|
709
|
-
type: "info",
|
|
710
|
-
title: "Import begins soon. Check Queue for updates.",
|
|
711
|
-
action: "View",
|
|
712
|
-
onAction: async () => {
|
|
713
|
-
await b.push({
|
|
714
|
-
name: _e["$connect-QUEUE"],
|
|
715
|
-
query: { type: [fe.enum.SEGMENTATION_IMPORTED] }
|
|
716
|
-
});
|
|
717
|
-
}
|
|
718
|
-
});
|
|
719
|
-
} else if (a._id) {
|
|
720
|
-
const { members: u, _id: P, ...R } = a;
|
|
721
|
-
await N.update(a._id, R);
|
|
722
|
-
} else
|
|
723
|
-
await N.create(a);
|
|
724
|
-
await A({ pageSize: 10, pageIndex: 0 }), (o = i.value) == null || o.hideSheet();
|
|
725
|
-
},
|
|
726
|
-
{
|
|
727
|
-
message: "Saving segment",
|
|
728
|
-
successMessage: "Segment saved"
|
|
729
|
-
}
|
|
730
|
-
);
|
|
731
|
-
}
|
|
732
|
-
function d(a) {
|
|
733
|
-
var o;
|
|
734
|
-
(o = i.value) == null || o.showSheet(a);
|
|
735
|
-
}
|
|
736
|
-
const s = {
|
|
737
|
-
label: _("connect.navigation.queue"),
|
|
738
|
-
value: "queue",
|
|
739
|
-
isPrimary: !1,
|
|
740
|
-
prependIcon: "work_history"
|
|
741
|
-
}, g = ce(() => k.isPremium ? [
|
|
742
|
-
s,
|
|
743
|
-
{
|
|
744
|
-
label: "Refresh segments",
|
|
745
|
-
value: "refresh",
|
|
746
|
-
prependIcon: "refresh"
|
|
747
|
-
},
|
|
748
|
-
{
|
|
749
|
-
label: "Add segment",
|
|
750
|
-
value: "add",
|
|
751
|
-
isPrimary: !0,
|
|
752
|
-
prependIcon: "add"
|
|
753
|
-
}
|
|
754
|
-
] : []);
|
|
755
|
-
function U(a) {
|
|
756
|
-
switch (a) {
|
|
757
|
-
case "add":
|
|
758
|
-
d();
|
|
759
|
-
break;
|
|
760
|
-
case "refresh":
|
|
761
|
-
h();
|
|
762
|
-
break;
|
|
763
|
-
case "queue":
|
|
764
|
-
b.push({
|
|
765
|
-
name: _e["$connect-QUEUE"],
|
|
766
|
-
query: { type: [fe.enum.SEGMENTATION_IMPORTED] }
|
|
767
|
-
});
|
|
768
|
-
break;
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
return Te(async () => {
|
|
772
|
-
const { meta: a } = await ve.read({
|
|
773
|
-
limit: 1,
|
|
774
|
-
skip: 0,
|
|
775
|
-
sortBy: "_id",
|
|
776
|
-
search: void 0,
|
|
777
|
-
descending: !1
|
|
778
|
-
});
|
|
779
|
-
w.value = a.totalResources ?? 0, await A({ pageSize: 10, pageIndex: 0 }), await k.readPremium(), await k.readLocations();
|
|
780
|
-
}), (a, o) => {
|
|
781
|
-
const u = S("FmPill"), P = S("FmPageHead"), R = S("FmIcon"), B = S("FmMenuItem"), V = S("FmMenu"), j = S("FmListItem"), q = S("FmList"), H = S("FmButton"), te = S("FmCard");
|
|
782
|
-
return m(), C(O, null, [
|
|
783
|
-
r(P, {
|
|
784
|
-
title: "Segments",
|
|
785
|
-
actions: t(g),
|
|
786
|
-
"onClick:action": o[0] || (o[0] = (M) => U(M))
|
|
787
|
-
}, {
|
|
788
|
-
title: E(() => [
|
|
789
|
-
l("div", It, [
|
|
790
|
-
l("span", Mt, $(t(_)("connect.loyalty.segment.title")), 1),
|
|
791
|
-
r(u, { variant: "premium" })
|
|
792
|
-
])
|
|
793
|
-
]),
|
|
794
|
-
_: 1
|
|
795
|
-
}, 8, ["actions"]),
|
|
796
|
-
l("div", Tt, [
|
|
797
|
-
t(F).length > 0 || t(c).searchValue || t(c).isLoading ? (m(), C(O, { key: 0 }, [
|
|
798
|
-
r(we, {
|
|
799
|
-
loading: t(c).isLoading,
|
|
800
|
-
"row-data": t(F),
|
|
801
|
-
"row-count": t(c).totalRows,
|
|
802
|
-
"column-defs": n,
|
|
803
|
-
"shrink-at": !1,
|
|
804
|
-
"page-count": t(c).pageCount,
|
|
805
|
-
"page-index": t(c).pageIndex,
|
|
806
|
-
"page-size": t(c).pageSize,
|
|
807
|
-
onRowClick: o[1] || (o[1] = (M) => {
|
|
808
|
-
d(M.original);
|
|
809
|
-
}),
|
|
810
|
-
onPageChange: t(A)
|
|
811
|
-
}, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onPageChange"]),
|
|
812
|
-
r(q, { class: "w-full hidden xs:block" }, {
|
|
813
|
-
default: E(() => [
|
|
814
|
-
(m(!0), C(O, null, ie(t(F), (M) => (m(), J(j, {
|
|
815
|
-
key: M._id.toString(),
|
|
816
|
-
tag: "label",
|
|
817
|
-
onClick: (Q) => d(M)
|
|
818
|
-
}, {
|
|
819
|
-
default: E(() => [
|
|
820
|
-
l("div", null, [
|
|
821
|
-
l("div", Et, $((M.memberCount ?? 0).toLocaleString()) + " total customers ", 1),
|
|
822
|
-
l("div", At, $(M.name), 1),
|
|
823
|
-
l("div", Rt, $(((M.memberCount ?? 0) * 100 / t(w)).toFixed(2)) + "% of customers ", 1)
|
|
824
|
-
])
|
|
825
|
-
]),
|
|
826
|
-
append: E(() => [
|
|
827
|
-
r(V, { "stop-click-propagation": !0 }, {
|
|
828
|
-
"menu-button": E(() => [
|
|
829
|
-
r(R, { name: "more_vert" })
|
|
830
|
-
]),
|
|
831
|
-
default: E(() => [
|
|
832
|
-
r(B, {
|
|
833
|
-
class: "text-fm-color-typo-error fm-typo-en-body-md-400",
|
|
834
|
-
label: "Remove",
|
|
835
|
-
"onUpdate:modelValue": (Q) => Q && y(M)
|
|
836
|
-
}, null, 8, ["onUpdate:modelValue"])
|
|
837
|
-
]),
|
|
838
|
-
_: 2
|
|
839
|
-
}, 1024)
|
|
840
|
-
]),
|
|
841
|
-
_: 2
|
|
842
|
-
}, 1032, ["onClick"]))), 128))
|
|
843
|
-
]),
|
|
844
|
-
_: 1
|
|
845
|
-
})
|
|
846
|
-
], 64)) : (m(), J(te, {
|
|
847
|
-
key: 1,
|
|
848
|
-
variant: "outlined",
|
|
849
|
-
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
850
|
-
}, {
|
|
851
|
-
default: E(() => [
|
|
852
|
-
o[3] || (o[3] = l("img", {
|
|
853
|
-
src: Ee,
|
|
854
|
-
class: "aspect-square w-[150px]"
|
|
855
|
-
}, null, -1)),
|
|
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
|
-
], -1)),
|
|
860
|
-
r(H, {
|
|
861
|
-
variant: "primary",
|
|
862
|
-
label: "Create segment",
|
|
863
|
-
disabled: !t(k).isPremium,
|
|
864
|
-
icon: "add",
|
|
865
|
-
onClick: o[2] || (o[2] = (M) => d())
|
|
866
|
-
}, null, 8, ["disabled"])
|
|
867
|
-
]),
|
|
868
|
-
_: 1
|
|
869
|
-
})),
|
|
870
|
-
r(ht, {
|
|
871
|
-
ref_key: "sheetRef",
|
|
872
|
-
ref: i,
|
|
873
|
-
"onUpdate:modelValue": I
|
|
874
|
-
}, null, 512)
|
|
875
|
-
])
|
|
876
|
-
], 64);
|
|
877
|
-
};
|
|
878
|
-
}
|
|
879
|
-
});
|
|
880
|
-
export {
|
|
881
|
-
mo as default
|
|
882
|
-
};
|