@feedmepos/mf-connect 0.1.46-prod → 0.1.47-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--PTYdTCz.js → Analytic-AnuRQDA4.js} +11 -11
- package/dist/{App-CCFCux3P.js → App-DP_jCyej.js} +6 -6
- package/dist/{Bin-D3mLTCYx.js → Bin-tL4lF6PB.js} +8 -8
- package/dist/{Broadcast-17Aiufxx.js → Broadcast-T2a5tN8R.js} +9 -9
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CMVquBaq.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BgPJCH02.js} +6 -6
- package/dist/{Card-Bx26e5ll.js → Card-Bi-ODgCc.js} +16 -16
- package/dist/{Collections-B_lm_p0s.js → Collections-JHWotZ1I.js} +7 -7
- package/dist/{Credit-Bfdh01Hf.js → Credit-DQQCXqS0.js} +9 -9
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DWNvRorl.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-hxuYl-OQ.js} +29 -29
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CkYlghNU.js → EffectSheet.vue_vue_type_style_index_0_lang-ECkaQxuI.js} +6 -6
- package/dist/{Experience-DScp4H4M.js → Experience-DzTV21vX.js} +9 -9
- package/dist/{Game-Cn2BXwaA.js → Game-DUCx2Dl9.js} +10 -10
- package/dist/{Index-BATr5dcp.js → Index-zynxjOOr.js} +10 -10
- package/dist/{Marketing-B6lhSaKk.js → Marketing-BBHDVRkR.js} +6 -6
- package/dist/{Member-Cr_Ehw_n.js → Member-B09bj6C3.js} +10 -10
- package/dist/{MemberList-B5ogB2E6.js → MemberList-DLSLGQ02.js} +25 -25
- package/dist/{MemberTransactions-YlC-iE41.js → MemberTransactions-DERMSs7o.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-nTBRadZx.js → MessageInput.vue_vue_type_script_setup_true_lang-CAADF6vv.js} +8 -8
- package/dist/{Mission-Bddme86f.js → Mission-DAv0e_ZH.js} +10 -10
- package/dist/{Overview-BGOM1IKg.js → Overview-D0rBTEtP.js} +18 -18
- package/dist/{Point-vcnTW6lY.js → Point-BeBYi1BT.js} +9 -9
- package/dist/{Promotion-DuCvytdc.js → Promotion-BSPU5hP9.js} +10 -10
- package/dist/{Queue-Cuw7WTP_.js → Queue-C5IFJ3iE.js} +10 -10
- package/dist/{Record-Dc6BPAGi.js → Record-CoFSrv7j.js} +8 -8
- package/dist/{Reward-8MFxn8we.js → Reward-COIOBOl-.js} +15 -15
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-8k-usg9S.js → RewardGroup.vue_vue_type_script_setup_true_lang-B9Tl7hqv.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DRCwMmo5.js → RuleGroup.vue_vue_type_script_setup_true_lang-BzsYC3k2.js} +591 -580
- package/dist/{Segment-BJm5XtlX.js → Segment-DF5SrucQ.js} +227 -227
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-B2LYvXlN.js → SelectItems.vue_vue_type_script_setup_true_lang-BSSfQu3F.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CaFLnq7P.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DoL_gTKy.js} +11 -11
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DLAqn-0P.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-Cijyol1Q.js} +3 -3
- package/dist/{Setting-CUyfrLYA.js → Setting-Dt0sG_hk.js} +11 -11
- package/dist/{Store-DdBnVwnq.js → Store-E2_0EIy8.js} +19 -19
- package/dist/{StoreRewards-B_yzVh4Z.js → StoreRewards-DuSsWnTE.js} +13 -13
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-BPPoaGqc.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DuatzcJ8.js} +19 -19
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-D0ae_2E5.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-D_r8I0h7.js} +1 -1
- package/dist/{Tier-BpQ8DXK4.js → Tier-CEEHsXkC.js} +20 -20
- package/dist/{Title-D6jghz1v.js → Title-BMAWlGeW.js} +19 -19
- package/dist/{Transaction-BQWs-6G7.js → Transaction-CLsceq-O.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-C2dJuE64.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CFLekn9O.js} +6 -6
- package/dist/{Voucher-DnL_66X2.js → Voucher-Cd293WYY.js} +13 -13
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-naUCARDO.js → VoucherEditor.vue_vue_type_script_setup_true_lang-Qc5cCqh5.js} +10 -10
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-yj2c4i_u.js → ZodTextField.vue_vue_type_script_setup_true_lang-B8HHh8HU.js} +1 -1
- package/dist/{app-Cemiie6P.js → app-aVXsWATU.js} +30 -30
- package/dist/{app-Cwax62X-.js → app-jRT7vsk_.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/{business-BTJVFnrW.js → business-DVlHPzaL.js} +1 -1
- package/dist/{campaign-C34w0eci.js → campaign-D9KeUWA7.js} +2 -2
- package/dist/{campaign-XX6bwpYj.js → campaign-l-u9A514.js} +9 -9
- package/dist/{campaign.enum-CTMwHgAV.js → campaign.enum-Cud82tES.js} +1 -1
- package/dist/{campaign.fn-nJl0vZum.js → campaign.fn-C-UojhHv.js} +140 -140
- package/dist/{collectible.enum-DpJV0kLI.js → collectible.enum-PrlUDScv.js} +1 -1
- package/dist/{collection.fn-D5beOWlp.js → collection.fn-yR-xnV4g.js} +2 -2
- package/dist/{dto-CCxjvwZe.js → dto-Cua1OHMY.js} +4 -4
- package/dist/{effect-B9ryfTOn.js → effect-B5-eXNEr.js} +1 -1
- package/dist/{email-addresses-Bn80jSud.js → email-addresses-BeYh5fr5.js} +1 -1
- package/dist/{export-CLB408ho.js → export-BUF4_DUz.js} +3 -3
- package/dist/{helper-DgoAVTVe.js → helper-CGwOThAl.js} +1 -1
- package/dist/{index-DsgbkezN.js → index-1BGPM6Uy.js} +1 -1
- package/dist/{index-JY8MjiBK.js → index-BLdVWQId.js} +3 -3
- package/dist/{index-Djq2lySj.js → index-BmL_b0IR.js} +1 -1
- package/dist/{index-FMcRNPk_.js → index-C-d_4n-1.js} +1 -1
- package/dist/{index-eiHOH5QM.js → index-CB8iWT_p.js} +1 -1
- package/dist/{index-D90Ba87K.js → index-Cl2iYM2F.js} +1 -1
- package/dist/{index-DCrV9spQ.js → index-Cx8-ipee.js} +6 -6
- package/dist/{index-B2BKFdEy.js → index-D5KIp8ZB.js} +1023 -1023
- package/dist/{index-t_4aIo1w.js → index-DNTd-FNx.js} +2 -2
- package/dist/{index-KYo_FgI8.js → index-DlFVLRKG.js} +3 -3
- package/dist/{index-B9wdSOIQ.js → index-aMDi62-C.js} +1 -1
- package/dist/{index-bkL81TwC.js → index-hX2mE0gQ.js} +1 -1
- package/dist/{index-Blmkh0Ui.js → index-knuJv0ti.js} +4 -4
- package/dist/{index-DUtQaOO2.js → index-ng2IXlL1.js} +1 -1
- package/dist/{index.esm2017-toVKAoKi.js → index.esm2017-D8stWFci.js} +1 -1
- package/dist/{loading-vrEcUlJa.js → loading-c4b7n9Xp.js} +1 -1
- package/dist/{membership-ChiyKtoA.js → membership-oBIs4sbL.js} +3 -3
- package/dist/{money-tOAuywfS.js → money-AP24H0gk.js} +1 -1
- package/dist/{number-DiXSJR50.js → number-CwsAYC_2.js} +1 -1
- package/dist/{objectid-C856JGM4.js → objectid-CVDLTdni.js} +5 -5
- package/dist/{plugins-p8ID0wqZ.js → plugins-Dn7JDHi7.js} +2 -2
- package/dist/{reward-Bo4HsVNH.js → reward-4wdoZeXw.js} +1 -1
- package/dist/{rule-LDThYbT7.js → rule-_OJza6tn.js} +3 -3
- package/dist/rule-builder-DmlhHAED.js +93 -0
- package/dist/{template-C6cnCLah.js → template-BSQLFHf4.js} +4 -4
- package/dist/{trigger-ZyJEZVxL.js → trigger-DC9tDnI2.js} +4 -4
- package/dist/{user-WDNaXiRu.js → user-CCVOptFD.js} +1 -1
- package/dist/{vue-i18n-BWI3POch.js → vue-i18n--_Wu1nMj.js} +201 -201
- package/dist/{xlsx-JDV04zZH.js → xlsx-BVMaOi8M.js} +1 -1
- package/package.json +1 -1
- package/dist/rule-builder-7iBcFApT.js +0 -89
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { defineComponent as ee, ref as z, resolveComponent as b, openBlock as p, createElementBlock as C, createVNode as i, unref as t, createCommentVNode as le, createElementVNode as
|
|
1
|
+
import { defineComponent as ee, ref as z, resolveComponent as b, openBlock as p, createElementBlock as C, createVNode as i, unref as t, createCommentVNode as le, createElementVNode as l, withCtx as E, Fragment as O, renderList as ie, createBlock as J, toDisplayString as D, normalizeClass as re, onMounted as Se, computed as ce, isRef as Ie, createSlots as Me, h as Y, onBeforeMount as Te } from "vue";
|
|
2
2
|
import { _ as Ee } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import {
|
|
4
|
-
import { u as Re } from "./loading-
|
|
5
|
-
import { FmButtonVariant as ae, useSnackbar as
|
|
3
|
+
import { n as $e, p as Ae } from "./plugins-Dn7JDHi7.js";
|
|
4
|
+
import { u as Re } from "./loading-c4b7n9Xp.js";
|
|
5
|
+
import { FmButtonVariant as ae, useSnackbar as De, components as X } from "@feedmepos/ui-library";
|
|
6
6
|
import { u as xe, _ as be } from "./usePagination-JoYaROkV.js";
|
|
7
|
-
import { u as we } from "./vue-i18n
|
|
8
|
-
import { i as
|
|
9
|
-
import "./index-
|
|
10
|
-
import "./index-
|
|
11
|
-
import "./index-
|
|
12
|
-
import "./index-
|
|
13
|
-
import { u as ne, w as Fe } from "./xlsx-
|
|
14
|
-
import { e as
|
|
15
|
-
import { Z as
|
|
16
|
-
import { u as
|
|
17
|
-
import { F as ye, z as
|
|
18
|
-
import { R as ge } from "./rule-builder-
|
|
19
|
-
import { _ as
|
|
20
|
-
import { _ as
|
|
21
|
-
import { u as
|
|
22
|
-
import { F as
|
|
7
|
+
import { u as we } from "./vue-i18n--_Wu1nMj.js";
|
|
8
|
+
import { i as Pe, j as R, c as fe } from "./index-knuJv0ti.js";
|
|
9
|
+
import "./index-DNTd-FNx.js";
|
|
10
|
+
import "./index-Cx8-ipee.js";
|
|
11
|
+
import "./index-ng2IXlL1.js";
|
|
12
|
+
import "./index-DlFVLRKG.js";
|
|
13
|
+
import { u as ne, w as Fe } from "./xlsx-BVMaOi8M.js";
|
|
14
|
+
import { e as Ne, M as Be } from "./email-addresses-BeYh5fr5.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-D5KIp8ZB.js";
|
|
18
|
+
import { R as ge } from "./rule-builder-DmlhHAED.js";
|
|
19
|
+
import { _ as Le } from "./ZodTextField.vue_vue_type_script_setup_true_lang-B8HHh8HU.js";
|
|
20
|
+
import { _ as ze } from "./RuleGroup.vue_vue_type_script_setup_true_lang-BzsYC3k2.js";
|
|
21
|
+
import { u as Oe, v as je, w as qe } from "./index.esm2017-D8stWFci.js";
|
|
22
|
+
import { F as He } from "./FileSaver.min-NlMItPOc.js";
|
|
23
23
|
import { h as G } from "./moment-BWErdI6_.js";
|
|
24
|
-
import { s as N, u as
|
|
25
|
-
import { o as
|
|
26
|
-
import { u as ke } from "./business-
|
|
27
|
-
import { f as
|
|
28
|
-
import { t as
|
|
29
|
-
import "./index-
|
|
30
|
-
import { useRouter as
|
|
31
|
-
import { m as
|
|
32
|
-
import { R as
|
|
33
|
-
const
|
|
24
|
+
import { s as N, u as Ge } from "./membership-oBIs4sbL.js";
|
|
25
|
+
import { o as Je } from "./objectId-dwaoBfJX.js";
|
|
26
|
+
import { u as ke } from "./business-DVlHPzaL.js";
|
|
27
|
+
import { f as Qe } from "./number-CwsAYC_2.js";
|
|
28
|
+
import { t as We } from "./money-AP24H0gk.js";
|
|
29
|
+
import "./index-Cl2iYM2F.js";
|
|
30
|
+
import { useRouter as Ke } from "vue-router";
|
|
31
|
+
import { m as _e } from "./index-C-d_4n-1.js";
|
|
32
|
+
import { R as ve } from "./app-aVXsWATU.js";
|
|
33
|
+
const Ze = Pe.extend({
|
|
34
34
|
_id: ye.optional(),
|
|
35
35
|
business: ye.optional(),
|
|
36
|
-
file:
|
|
36
|
+
file: Ue.any().nullish()
|
|
37
37
|
});
|
|
38
|
-
var
|
|
39
|
-
const
|
|
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 = /* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800" }, "Upload File", -1), ot = {
|
|
40
40
|
key: 0,
|
|
41
41
|
class: /* @__PURE__ */ re([
|
|
42
42
|
"p-16 pl-24 space-x-8",
|
|
@@ -44,21 +44,21 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
|
|
|
44
44
|
"flex items-center",
|
|
45
45
|
"justify-between"
|
|
46
46
|
])
|
|
47
|
-
},
|
|
47
|
+
}, at = { class: "flex justify-end" }, nt = {
|
|
48
48
|
key: 1,
|
|
49
49
|
class: /* @__PURE__ */ re([
|
|
50
50
|
"flex items-center",
|
|
51
51
|
"border border-fm-color-neutral-gray-300",
|
|
52
52
|
"p-16 space-x-16 rounded-md"
|
|
53
53
|
])
|
|
54
|
-
},
|
|
54
|
+
}, st = { class: "fm-typo-en-body-lg-400 flex-1 truncate" }, lt = /* @__PURE__ */ ee({
|
|
55
55
|
__name: "ImportSegment",
|
|
56
56
|
props: {
|
|
57
57
|
importFile: {}
|
|
58
58
|
},
|
|
59
59
|
emits: ["update:file"],
|
|
60
|
-
setup(e, { emit:
|
|
61
|
-
const
|
|
60
|
+
setup(e, { emit: _ }) {
|
|
61
|
+
const v = e, k = _, { t: m } = we(), y = z(null), f = z(null), w = ["Id"], s = [
|
|
62
62
|
{
|
|
63
63
|
label: "CSV",
|
|
64
64
|
icon: "csv",
|
|
@@ -71,12 +71,12 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
|
|
|
71
71
|
}
|
|
72
72
|
];
|
|
73
73
|
async function n() {
|
|
74
|
-
if (
|
|
74
|
+
if (v.importFile)
|
|
75
75
|
try {
|
|
76
|
-
const h =
|
|
76
|
+
const h = Oe(void 0, Xe.importFilesBucketUrl), S = je(h, v.importFile), x = await qe(S);
|
|
77
77
|
window.open(x, "_blank");
|
|
78
78
|
} catch (h) {
|
|
79
|
-
console.log(h);
|
|
79
|
+
console.log(h), $e.error("Failed to download uploaded file");
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
async function c(h) {
|
|
@@ -85,7 +85,7 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
|
|
|
85
85
|
const S = new Blob([w.join(",")], {
|
|
86
86
|
type: "text/csv;charset=utf-8;"
|
|
87
87
|
});
|
|
88
|
-
|
|
88
|
+
He.saveAs(S, "ImportSegmentTemplate.csv");
|
|
89
89
|
break;
|
|
90
90
|
case "xlsx":
|
|
91
91
|
const x = ne.aoa_to_sheet([w]), I = ne.book_new();
|
|
@@ -93,19 +93,19 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
|
|
|
93
93
|
break;
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
function
|
|
97
|
-
y.value = h,
|
|
96
|
+
function F(h) {
|
|
97
|
+
y.value = h, k("update:file", y.value);
|
|
98
98
|
}
|
|
99
99
|
function $(h) {
|
|
100
100
|
var x, I;
|
|
101
101
|
const S = ((I = (x = h.target) == null ? void 0 : x.files) == null ? void 0 : I[0]) ?? null;
|
|
102
|
-
|
|
102
|
+
F(S);
|
|
103
103
|
}
|
|
104
104
|
return (h, S) => {
|
|
105
|
-
const x = b("FmButton"), I = b("FmMenuItem"),
|
|
106
|
-
return p(), C("div",
|
|
107
|
-
|
|
108
|
-
h.importFile ? (p(), C("div",
|
|
105
|
+
const x = b("FmButton"), I = b("FmMenuItem"), d = b("FmMenu"), r = b("FmDropField");
|
|
106
|
+
return p(), C("div", et, [
|
|
107
|
+
tt,
|
|
108
|
+
h.importFile ? (p(), C("div", ot, [
|
|
109
109
|
i(x, {
|
|
110
110
|
label: t(m)("View uploaded file"),
|
|
111
111
|
variant: t(ae).Plain,
|
|
@@ -113,9 +113,9 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
|
|
|
113
113
|
onClick: n
|
|
114
114
|
}, null, 8, ["label", "variant"])
|
|
115
115
|
])) : le("", !0),
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
i(
|
|
116
|
+
l("div", null, [
|
|
117
|
+
l("div", at, [
|
|
118
|
+
i(d, { class: "" }, {
|
|
119
119
|
"menu-button": E(() => [
|
|
120
120
|
i(x, {
|
|
121
121
|
variant: "tertiary",
|
|
@@ -124,7 +124,7 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
|
|
|
124
124
|
})
|
|
125
125
|
]),
|
|
126
126
|
default: E(() => [
|
|
127
|
-
(p(), C(O, null, ie(
|
|
127
|
+
(p(), C(O, null, ie(s, (g) => i(I, {
|
|
128
128
|
key: g.value,
|
|
129
129
|
icon: g.icon,
|
|
130
130
|
label: g.label,
|
|
@@ -135,13 +135,13 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
|
|
|
135
135
|
_: 1
|
|
136
136
|
})
|
|
137
137
|
]),
|
|
138
|
-
y.value ? (p(), C("div",
|
|
138
|
+
y.value ? (p(), C("div", nt, [
|
|
139
139
|
i(x, {
|
|
140
140
|
variant: t(ae).Tertiary,
|
|
141
141
|
"prepend-icon": "attach_file"
|
|
142
142
|
}, null, 8, ["variant"]),
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
l("p", st, D(y.value.name), 1),
|
|
144
|
+
l("label", {
|
|
145
145
|
ref_key: "fileLabelRef",
|
|
146
146
|
ref: f,
|
|
147
147
|
htmlFor: "file"
|
|
@@ -154,7 +154,7 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
|
|
|
154
154
|
return (g = f.value) == null ? void 0 : g.click();
|
|
155
155
|
})
|
|
156
156
|
}, null, 8, ["variant", "label"]),
|
|
157
|
-
|
|
157
|
+
l("input", {
|
|
158
158
|
id: "file",
|
|
159
159
|
accept: ".csv",
|
|
160
160
|
class: "hidden",
|
|
@@ -165,7 +165,7 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
|
|
|
165
165
|
], 512)
|
|
166
166
|
])) : (p(), J(r, {
|
|
167
167
|
key: 0,
|
|
168
|
-
onFileUpload: S[0] || (S[0] = (g) =>
|
|
168
|
+
onFileUpload: S[0] || (S[0] = (g) => F(g)),
|
|
169
169
|
accept: ".csv, .xlsx",
|
|
170
170
|
"max-file-size": 2e7
|
|
171
171
|
}))
|
|
@@ -173,14 +173,14 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
|
|
|
173
173
|
]);
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
|
-
}),
|
|
176
|
+
}), it = { class: "space-y-16 pr-12" }, rt = { class: "fm-typo-en-title-md-800" }, ct = { class: "flex space-x-8" }, dt = { class: "fm-typo-en-title-md-800 text-fm-color-primary" }, ut = { class: "text-fm-color-typo-secondary" }, pt = /* @__PURE__ */ l("div", null, "contacts in your segment", -1), mt = /* @__PURE__ */ ee({
|
|
177
177
|
__name: "ReviewSegment",
|
|
178
178
|
props: {
|
|
179
179
|
title: {},
|
|
180
180
|
segment: {}
|
|
181
181
|
},
|
|
182
182
|
setup(e) {
|
|
183
|
-
const
|
|
183
|
+
const _ = e, v = [
|
|
184
184
|
{
|
|
185
185
|
header: "Name",
|
|
186
186
|
accessorFn: (n) => n.name
|
|
@@ -191,7 +191,7 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
|
|
|
191
191
|
},
|
|
192
192
|
{
|
|
193
193
|
header: "Customer Since",
|
|
194
|
-
accessorFn: (n) => G(
|
|
194
|
+
accessorFn: (n) => G(Je(n._id.toString())).format("DD MMM YYYY")
|
|
195
195
|
},
|
|
196
196
|
{
|
|
197
197
|
header: "Phone",
|
|
@@ -206,9 +206,9 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
|
|
|
206
206
|
accessorFn: (n) => G(n.stats.lastVisit).format("DD MMM YYYY")
|
|
207
207
|
}
|
|
208
208
|
];
|
|
209
|
-
async function
|
|
210
|
-
return
|
|
211
|
-
|
|
209
|
+
async function k(n) {
|
|
210
|
+
return _.segment._id ? (console.log(n), await N.paginateSegmentUsers(
|
|
211
|
+
_.segment._id,
|
|
212
212
|
n
|
|
213
213
|
)) : {
|
|
214
214
|
resources: [],
|
|
@@ -221,71 +221,71 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
|
|
|
221
221
|
}
|
|
222
222
|
};
|
|
223
223
|
}
|
|
224
|
-
const { tableMeta: m, rowData: y, onSort: f, debouncedFetchData: w, onSearch:
|
|
224
|
+
const { tableMeta: m, rowData: y, onSort: f, debouncedFetchData: w, onSearch: s } = xe(k);
|
|
225
225
|
return Se(async () => {
|
|
226
226
|
await w();
|
|
227
|
-
}), (n, c) => (p(), C("div",
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
227
|
+
}), (n, c) => (p(), C("div", it, [
|
|
228
|
+
l("div", rt, D(_.title), 1),
|
|
229
|
+
l("div", ct, [
|
|
230
|
+
l("div", dt, D(n.segment.members.length), 1),
|
|
231
|
+
l("div", ut, [
|
|
232
|
+
pt,
|
|
233
|
+
l("div", null, "as of " + D(t(G)(n.segment.lastUpdated).format("DD MMM YYYY")), 1)
|
|
234
234
|
])
|
|
235
235
|
]),
|
|
236
236
|
i(be, {
|
|
237
237
|
loading: t(m).isLoading,
|
|
238
238
|
"row-data": t(y),
|
|
239
239
|
"row-count": t(m).totalRows,
|
|
240
|
-
"column-defs":
|
|
240
|
+
"column-defs": v,
|
|
241
241
|
"page-size": t(m).pageSize,
|
|
242
242
|
"page-count": t(m).pageCount,
|
|
243
243
|
"page-index": t(m).pageIndex,
|
|
244
244
|
onSortChange: t(f),
|
|
245
|
-
onPageChange: c[0] || (c[0] = (
|
|
245
|
+
onPageChange: c[0] || (c[0] = (F) => t(w)({ pageSize: F.pageSize, pageIndex: F.pageIndex }))
|
|
246
246
|
}, null, 8, ["loading", "row-data", "row-count", "page-size", "page-count", "page-index", "onSortChange"])
|
|
247
247
|
]));
|
|
248
248
|
}
|
|
249
|
-
}),
|
|
249
|
+
}), ft = { class: "space-y-24" }, yt = { class: "grid grid-cols-2 gap-16" }, gt = { class: "fm-typo-en-title-sm-800" }, _t = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, vt = /* @__PURE__ */ ee({
|
|
250
250
|
__name: "SegmentTypeOption",
|
|
251
251
|
props: {
|
|
252
252
|
modelValue: {},
|
|
253
253
|
errorText: {}
|
|
254
254
|
},
|
|
255
255
|
emits: ["update:model-value"],
|
|
256
|
-
setup(e, { emit:
|
|
257
|
-
const
|
|
256
|
+
setup(e, { emit: _ }) {
|
|
257
|
+
const v = e, k = _, m = [
|
|
258
258
|
{
|
|
259
259
|
label: "Dynamic",
|
|
260
260
|
sublabel: "Segment statistics are based on rules configured and will be recalculated automatically when rule changes.",
|
|
261
|
-
value:
|
|
261
|
+
value: R.enum.DYNAMIC
|
|
262
262
|
},
|
|
263
263
|
{
|
|
264
264
|
label: "Static",
|
|
265
265
|
sublabel: "Segment statistics are based on imported data and will not be recalculated.",
|
|
266
|
-
value:
|
|
266
|
+
value: R.enum.STATIC
|
|
267
267
|
}
|
|
268
268
|
];
|
|
269
269
|
function y(f) {
|
|
270
|
-
f !==
|
|
270
|
+
f !== v.modelValue && k("update:model-value", f);
|
|
271
271
|
}
|
|
272
272
|
return (f, w) => {
|
|
273
|
-
const
|
|
274
|
-
return p(), C("div",
|
|
275
|
-
|
|
276
|
-
(p(), C(O, null, ie(m, (c) => i(
|
|
273
|
+
const s = b("FmCard"), n = b("FmHelperText");
|
|
274
|
+
return p(), C("div", ft, [
|
|
275
|
+
l("div", yt, [
|
|
276
|
+
(p(), C(O, null, ie(m, (c) => i(s, {
|
|
277
277
|
variant: "outlined",
|
|
278
278
|
class: re(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
|
|
279
279
|
"col-span-2": m.length == 1,
|
|
280
280
|
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": f.modelValue === c.value,
|
|
281
281
|
"hover:bg-fm-color-opacity-sm": f.modelValue !== c.value
|
|
282
282
|
}]),
|
|
283
|
-
onClick: (
|
|
283
|
+
onClick: (F) => y(c.value),
|
|
284
284
|
key: c.value
|
|
285
285
|
}, {
|
|
286
286
|
default: E(() => [
|
|
287
|
-
|
|
288
|
-
|
|
287
|
+
l("div", gt, D(c.label), 1),
|
|
288
|
+
l("div", _t, D(c.sublabel), 1)
|
|
289
289
|
]),
|
|
290
290
|
_: 2
|
|
291
291
|
}, 1032, ["class", "onClick"])), 64))
|
|
@@ -299,61 +299,61 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
|
|
|
299
299
|
]);
|
|
300
300
|
};
|
|
301
301
|
}
|
|
302
|
-
}),
|
|
302
|
+
}), ht = { class: "flex items-center gap-x-8" }, St = /* @__PURE__ */ l("div", null, "Review segment", -1), xt = {
|
|
303
303
|
key: 0,
|
|
304
304
|
class: "space-y-16 pr-12"
|
|
305
|
-
},
|
|
305
|
+
}, bt = { class: "flex flex-col space-y-16" }, wt = /* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Type", -1), Ft = {
|
|
306
306
|
key: 0,
|
|
307
307
|
class: "flex flex-col space-y-16"
|
|
308
|
-
},
|
|
308
|
+
}, kt = /* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Filter", -1), Ct = {
|
|
309
309
|
key: 1,
|
|
310
310
|
class: "flex flex-col space-y-16"
|
|
311
|
-
},
|
|
311
|
+
}, It = {
|
|
312
312
|
key: 2,
|
|
313
313
|
class: "flex flex-col space-y-16"
|
|
314
|
-
},
|
|
314
|
+
}, Mt = /* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Status", -1), Tt = { class: "flex items-center gap-8" }, Et = /* @__PURE__ */ ee({
|
|
315
315
|
__name: "SegmentSheet",
|
|
316
316
|
emits: ["update:model-value"],
|
|
317
|
-
setup(e, { expose:
|
|
318
|
-
const
|
|
317
|
+
setup(e, { expose: _, emit: v }) {
|
|
318
|
+
const k = Ye(), m = z(!1), y = z(!1), f = {
|
|
319
319
|
name: "",
|
|
320
320
|
isActive: !0,
|
|
321
|
-
type:
|
|
321
|
+
type: R.enum.DYNAMIC,
|
|
322
322
|
rule: ge.scaffoldGroup(),
|
|
323
323
|
members: []
|
|
324
|
-
}, w =
|
|
325
|
-
const
|
|
326
|
-
return
|
|
324
|
+
}, w = Ze, s = z(f), n = ce(() => {
|
|
325
|
+
const d = w.safeParse(s.value);
|
|
326
|
+
return d.success ? [] : d.error.errors;
|
|
327
327
|
});
|
|
328
|
-
function c(
|
|
329
|
-
m.value = !0, y.value = !1,
|
|
330
|
-
...
|
|
331
|
-
isActive:
|
|
332
|
-
type:
|
|
333
|
-
} :
|
|
328
|
+
function c(d) {
|
|
329
|
+
m.value = !0, y.value = !1, d ? s.value = {
|
|
330
|
+
...d,
|
|
331
|
+
isActive: d.isActive !== !1,
|
|
332
|
+
type: d.type ?? (d.importFile ? R.enum.STATIC : R.enum.DYNAMIC)
|
|
333
|
+
} : s.value = { ...f };
|
|
334
334
|
}
|
|
335
|
-
function
|
|
335
|
+
function F() {
|
|
336
336
|
m.value = !1;
|
|
337
337
|
}
|
|
338
338
|
async function $() {
|
|
339
|
-
w.safeParse(
|
|
339
|
+
w.safeParse(s.value).success && (y.value = !0);
|
|
340
340
|
}
|
|
341
|
-
function h() {
|
|
342
|
-
y.value = !1;
|
|
341
|
+
function h(d) {
|
|
342
|
+
d === R.enum.STATIC ? F() : y.value = !1;
|
|
343
343
|
}
|
|
344
344
|
async function S() {
|
|
345
|
-
|
|
345
|
+
s.value.type === R.enum.STATIC ? (s.value.rule = ge.scaffoldGroup(), s.value.isActive = !0) : s.value.file = void 0, I("update:model-value", s.value);
|
|
346
346
|
}
|
|
347
|
-
async function x(
|
|
348
|
-
|
|
347
|
+
async function x(d) {
|
|
348
|
+
s.value.type = d;
|
|
349
349
|
}
|
|
350
350
|
Se(async () => {
|
|
351
351
|
});
|
|
352
|
-
const I =
|
|
353
|
-
return
|
|
352
|
+
const I = v;
|
|
353
|
+
return _({
|
|
354
354
|
showSheet: c,
|
|
355
|
-
hideSheet:
|
|
356
|
-
}), (
|
|
355
|
+
hideSheet: F
|
|
356
|
+
}), (d, r) => {
|
|
357
357
|
const g = b("FmButton"), U = b("FmSwitch"), o = b("FmSideSheet");
|
|
358
358
|
return p(), J(o, {
|
|
359
359
|
modelValue: t(m),
|
|
@@ -364,28 +364,28 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
|
|
|
364
364
|
"max-width": 1100
|
|
365
365
|
}, Me({
|
|
366
366
|
"side-sheet-footer": E(() => [
|
|
367
|
-
|
|
368
|
-
t(y) || t(
|
|
367
|
+
l("div", Tt, [
|
|
368
|
+
t(y) || t(s).type === t(R).enum.STATIC ? (p(), C(O, { key: 0 }, [
|
|
369
369
|
i(g, {
|
|
370
370
|
label: "Save Segment",
|
|
371
371
|
onClick: S,
|
|
372
|
-
loading: t(
|
|
373
|
-
disabled: t(n).length > 0 || t(
|
|
372
|
+
loading: t(k).isLoading,
|
|
373
|
+
disabled: t(n).length > 0 || t(k).isLoading
|
|
374
374
|
}, null, 8, ["loading", "disabled"]),
|
|
375
375
|
i(g, {
|
|
376
376
|
label: "Cancel",
|
|
377
|
-
onClick: r[6] || (r[6] = (a) => h()),
|
|
377
|
+
onClick: r[6] || (r[6] = (a) => h(t(s).type)),
|
|
378
378
|
variant: "tertiary"
|
|
379
379
|
})
|
|
380
380
|
], 64)) : (p(), C(O, { key: 1 }, [
|
|
381
381
|
i(g, {
|
|
382
382
|
label: "Review Segment",
|
|
383
|
-
disabled: t(n).length > 0 || t(
|
|
383
|
+
disabled: t(n).length > 0 || t(k).isLoading,
|
|
384
384
|
onClick: $
|
|
385
385
|
}, null, 8, ["disabled"]),
|
|
386
386
|
i(g, {
|
|
387
387
|
label: "Cancel",
|
|
388
|
-
onClick: r[7] || (r[7] = (a) =>
|
|
388
|
+
onClick: r[7] || (r[7] = (a) => F()),
|
|
389
389
|
variant: "tertiary"
|
|
390
390
|
})
|
|
391
391
|
], 64))
|
|
@@ -394,49 +394,49 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
|
|
|
394
394
|
default: E(() => {
|
|
395
395
|
var a;
|
|
396
396
|
return [
|
|
397
|
-
t(y) ? (p(), J(
|
|
397
|
+
t(y) ? (p(), J(mt, {
|
|
398
398
|
key: 1,
|
|
399
|
-
title: t(
|
|
400
|
-
segment: t(
|
|
401
|
-
}, null, 8, ["title", "segment"])) : (p(), C("div",
|
|
402
|
-
i(
|
|
403
|
-
modelValue: t(
|
|
404
|
-
"onUpdate:modelValue": r[1] || (r[1] = (
|
|
399
|
+
title: t(s).name,
|
|
400
|
+
segment: t(s)
|
|
401
|
+
}, null, 8, ["title", "segment"])) : (p(), C("div", xt, [
|
|
402
|
+
i(Le, {
|
|
403
|
+
modelValue: t(s).name,
|
|
404
|
+
"onUpdate:modelValue": r[1] || (r[1] = (u) => t(s).name = u),
|
|
405
405
|
label: "Segment title",
|
|
406
|
-
schema: t(
|
|
406
|
+
schema: t(Ve).typeAtPath(t(w), "name")
|
|
407
407
|
}, null, 8, ["modelValue", "schema"]),
|
|
408
|
-
|
|
409
|
-
|
|
408
|
+
l("div", bt, [
|
|
409
|
+
wt,
|
|
410
410
|
i(vt, {
|
|
411
|
-
"model-value": t(
|
|
412
|
-
"onUpdate:modelValue": r[2] || (r[2] = (
|
|
413
|
-
x(
|
|
411
|
+
"model-value": t(s).type,
|
|
412
|
+
"onUpdate:modelValue": r[2] || (r[2] = (u) => {
|
|
413
|
+
x(u);
|
|
414
414
|
})
|
|
415
415
|
}, null, 8, ["model-value"])
|
|
416
416
|
]),
|
|
417
|
-
t(
|
|
418
|
-
|
|
419
|
-
i(
|
|
417
|
+
t(s).type === t(R).enum.DYNAMIC ? (p(), C("div", Ft, [
|
|
418
|
+
kt,
|
|
419
|
+
i(ze, {
|
|
420
420
|
"trigger-type": "MEMBERSHIP_JOINED",
|
|
421
421
|
includeOnly: "user",
|
|
422
|
-
"model-value": (a = t(
|
|
423
|
-
"onUpdate:modelValue": r[3] || (r[3] = (
|
|
424
|
-
t(
|
|
422
|
+
"model-value": (a = t(s)) == null ? void 0 : a.rule,
|
|
423
|
+
"onUpdate:modelValue": r[3] || (r[3] = (u) => {
|
|
424
|
+
t(s).rule = u;
|
|
425
425
|
})
|
|
426
426
|
}, null, 8, ["model-value"])
|
|
427
|
-
])) : (p(), C("div",
|
|
428
|
-
i(
|
|
429
|
-
importFile: t(
|
|
430
|
-
"onUpdate:file": r[4] || (r[4] = (
|
|
431
|
-
t(
|
|
427
|
+
])) : (p(), C("div", Ct, [
|
|
428
|
+
i(lt, {
|
|
429
|
+
importFile: t(s).importFile,
|
|
430
|
+
"onUpdate:file": r[4] || (r[4] = (u) => {
|
|
431
|
+
t(s).file = u;
|
|
432
432
|
})
|
|
433
433
|
}, null, 8, ["importFile"])
|
|
434
434
|
])),
|
|
435
|
-
t(
|
|
436
|
-
|
|
435
|
+
t(s).type === t(R).enum.DYNAMIC ? (p(), C("div", It, [
|
|
436
|
+
Mt,
|
|
437
437
|
i(U, {
|
|
438
|
-
"model-value": t(
|
|
439
|
-
"onUpdate:modelValue": r[5] || (r[5] = (
|
|
438
|
+
"model-value": t(s).isActive ?? !0,
|
|
439
|
+
"onUpdate:modelValue": r[5] || (r[5] = (u) => t(s).isActive = u),
|
|
440
440
|
label: "Active",
|
|
441
441
|
sublabel: "When enabled, this will recalculate the segment statistics daily.",
|
|
442
442
|
"label-placement": "right"
|
|
@@ -450,13 +450,13 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
|
|
|
450
450
|
t(y) ? {
|
|
451
451
|
name: "side-sheet-header",
|
|
452
452
|
fn: E(() => [
|
|
453
|
-
|
|
453
|
+
l("div", ht, [
|
|
454
454
|
i(g, {
|
|
455
455
|
icon: "arrow_back",
|
|
456
456
|
variant: "tertiary",
|
|
457
457
|
onClick: r[0] || (r[0] = (a) => y.value = !1)
|
|
458
458
|
}),
|
|
459
|
-
|
|
459
|
+
St
|
|
460
460
|
])
|
|
461
461
|
]),
|
|
462
462
|
key: "0"
|
|
@@ -464,20 +464,20 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
|
|
|
464
464
|
]), 1032, ["modelValue"]);
|
|
465
465
|
};
|
|
466
466
|
}
|
|
467
|
-
}), he =
|
|
467
|
+
}), he = Ge(), $t = ke();
|
|
468
468
|
function se(e) {
|
|
469
|
-
const
|
|
470
|
-
return
|
|
469
|
+
const _ = G(e);
|
|
470
|
+
return _.isValid() ? _.format("DD/MM/YYYY") : "";
|
|
471
471
|
}
|
|
472
|
-
const
|
|
472
|
+
const At = {
|
|
473
473
|
mapMemberExportRow: (e) => {
|
|
474
|
-
var n, c,
|
|
475
|
-
const
|
|
474
|
+
var n, c, F, $, h, S, x, I, d, r, g, U, o, a, u, P, A, B, V, j, q, H, te, M, Q, de, ue, pe;
|
|
475
|
+
const _ = ce(() => $t.locations.map((T) => ({
|
|
476
476
|
label: T.name,
|
|
477
477
|
value: T._id
|
|
478
|
-
}))),
|
|
478
|
+
}))), v = (n = Ne.parseOneAddress(
|
|
479
479
|
e == null ? void 0 : e.email
|
|
480
|
-
)) != null && n.domain.includes("feedmepos.com") ? void 0 : e.email,
|
|
480
|
+
)) != null && n.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
481
|
(T, L) => {
|
|
482
482
|
var K, Z;
|
|
483
483
|
const W = (Z = (K = he.sortedTitles) == null ? void 0 : K.find(
|
|
@@ -495,29 +495,29 @@ const $t = {
|
|
|
495
495
|
return T[L.name] = W ? G(W).format("DD/MM/YYYY") : "", T;
|
|
496
496
|
},
|
|
497
497
|
{}
|
|
498
|
-
), y = ((S = (h = ($ = e.collection) == null ? void 0 : $.CREDIT) == null ? void 0 : h.at(0)) == null ? void 0 : S.balance) || 0, f = ((r = (
|
|
498
|
+
), y = ((S = (h = ($ = e.collection) == null ? void 0 : $.CREDIT) == null ? void 0 : h.at(0)) == null ? void 0 : S.balance) || 0, f = ((r = (d = (I = (x = e.collection) == null ? void 0 : x.CREDIT) == null ? void 0 : I.at(0)) == null ? void 0 : d.expiryBalance) == null ? void 0 : r.reduce(
|
|
499
499
|
(T, L) => T + L.amount,
|
|
500
500
|
0
|
|
501
|
-
)) || 0, w =
|
|
501
|
+
)) || 0, w = Qe(y, 2);
|
|
502
502
|
return {
|
|
503
503
|
ID: e._id.toString(),
|
|
504
504
|
Name: ((g = e.name) == null ? void 0 : g.trim()) || "",
|
|
505
505
|
Phone: ((U = e == null ? void 0 : e.phoneNumber) == null ? void 0 : U.trim()) || "",
|
|
506
|
-
Email:
|
|
506
|
+
Email: v || "",
|
|
507
507
|
Gender: e.gender || "",
|
|
508
508
|
CardNo: e.cardNo || "",
|
|
509
509
|
Birthday: e != null && e.birthday ? se(e == null ? void 0 : e.birthday) : "",
|
|
510
510
|
Credit: parseFloat((Number(w) - Number(f)).toFixed(2)),
|
|
511
511
|
FreeCredit: Number(f.toFixed(2)),
|
|
512
512
|
TotalCredit: Number(w),
|
|
513
|
-
Exp: e != null && e.collection ? ((
|
|
514
|
-
Point: e != null && e.collection ? ((B = (
|
|
513
|
+
Exp: e != null && e.collection ? ((u = (a = (o = e.collection) == null ? void 0 : o.POINT) == null ? void 0 : a.at(0)) == null ? void 0 : u.balance) ?? 0 : 0,
|
|
514
|
+
Point: e != null && e.collection ? ((B = (A = (P = e.collection) == null ? void 0 : P.COIN) == null ? void 0 : A.at(0)) == null ? void 0 : B.balance) ?? 0 : 0,
|
|
515
515
|
Level: e != null && e.collection ? ((q = (j = (V = e.collection) == null ? void 0 : V.TIER) == null ? void 0 : j.at(0)) == null ? void 0 : q.balance) ?? 0 : 0,
|
|
516
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:
|
|
517
|
+
Titles: k.join(","),
|
|
518
518
|
...m,
|
|
519
519
|
TotalTransaction: e.stats.visitCount,
|
|
520
|
-
AvgSpent:
|
|
520
|
+
AvgSpent: We(Number(e.stats.avgBillSize || 0)).toFormat(
|
|
521
521
|
!1
|
|
522
522
|
),
|
|
523
523
|
TotalSpent: e.stats.avgBillSize * e.stats.visitCount,
|
|
@@ -526,28 +526,28 @@ const $t = {
|
|
|
526
526
|
LastSeasonTierEarned: ((de = e.stats) == null ? void 0 : de.lastSeasonTierEarned) || 0,
|
|
527
527
|
LastSeasonPointEarned: ((ue = e.stats) == null ? void 0 : ue.lastSeasonPointEarned) || 0,
|
|
528
528
|
JoinedAt: se(e.joinAt || void 0),
|
|
529
|
-
JoinedAtLocation: e.location && ((pe =
|
|
529
|
+
JoinedAtLocation: e.location && ((pe = _.value.find((T) => T.value == e.location)) == null ? void 0 : pe.label) || "-",
|
|
530
530
|
VisitFrequency: `${Number(
|
|
531
531
|
Math.ceil(e.stats.avgVisitFrequency).toFixed(0)
|
|
532
532
|
)}`
|
|
533
533
|
};
|
|
534
534
|
}
|
|
535
|
-
}, Rt = { class: "flex items-center" },
|
|
535
|
+
}, Rt = { class: "flex items-center" }, Dt = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, Pt = { class: "px-24 flex flex-col gap-y-16" }, Nt = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Bt = { class: "fm-typo-en-body-md-600" }, Vt = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Yt = /* @__PURE__ */ l("img", {
|
|
536
536
|
src: Ee,
|
|
537
537
|
class: "aspect-square w-[150px]"
|
|
538
|
-
}, null, -1),
|
|
539
|
-
/* @__PURE__ */
|
|
540
|
-
/* @__PURE__ */
|
|
541
|
-
], -1),
|
|
538
|
+
}, null, -1), Ut = /* @__PURE__ */ l("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
539
|
+
/* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800" }, "Create customer segments"),
|
|
540
|
+
/* @__PURE__ */ 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. ")
|
|
541
|
+
], -1), So = /* @__PURE__ */ ee({
|
|
542
542
|
__name: "Segment",
|
|
543
543
|
setup(e) {
|
|
544
|
-
const { minor:
|
|
544
|
+
const { minor: _ } = Re, { t: v } = we(), k = ke(), { mapMemberExportRow: m } = At, y = De(), f = Ke(), w = z(0), s = [
|
|
545
545
|
{
|
|
546
|
-
header:
|
|
546
|
+
header: v("connect.loyalty.segment.table.name"),
|
|
547
547
|
accessorFn: (o) => o.name
|
|
548
548
|
},
|
|
549
549
|
{
|
|
550
|
-
header:
|
|
550
|
+
header: v("connect.loyalty.segment.table.status"),
|
|
551
551
|
enableSorting: !1,
|
|
552
552
|
cell(o) {
|
|
553
553
|
const a = o.row.original.isActive === !1 ? "Inactive" : "Active";
|
|
@@ -559,15 +559,15 @@ const $t = {
|
|
|
559
559
|
}
|
|
560
560
|
},
|
|
561
561
|
{
|
|
562
|
-
header:
|
|
562
|
+
header: v("connect.loyalty.segment.table.total_customers"),
|
|
563
563
|
accessorFn: (o) => o.memberCount ?? 0
|
|
564
564
|
},
|
|
565
565
|
{
|
|
566
|
-
header:
|
|
566
|
+
header: v("connect.loyalty.segment.table.customer_percentage"),
|
|
567
567
|
accessorFn: (o) => ((o.memberCount ?? 0) * 100 / w.value).toFixed(2)
|
|
568
568
|
},
|
|
569
569
|
{
|
|
570
|
-
header:
|
|
570
|
+
header: v("connect.loyalty.segment.table.actions"),
|
|
571
571
|
meta: {
|
|
572
572
|
maxWidth: "100px"
|
|
573
573
|
},
|
|
@@ -628,11 +628,11 @@ const $t = {
|
|
|
628
628
|
]);
|
|
629
629
|
}
|
|
630
630
|
}
|
|
631
|
-
], n = z(null), { tableMeta: c, rowData:
|
|
631
|
+
], n = z(null), { tableMeta: c, rowData: F, debouncedFetchData: $ } = xe(
|
|
632
632
|
N.readAll
|
|
633
633
|
);
|
|
634
634
|
async function h() {
|
|
635
|
-
await
|
|
635
|
+
await _(
|
|
636
636
|
async () => {
|
|
637
637
|
await N.refreshSegments(), await $({ pageSize: 10, pageIndex: 0 });
|
|
638
638
|
},
|
|
@@ -640,7 +640,7 @@ const $t = {
|
|
|
640
640
|
);
|
|
641
641
|
}
|
|
642
642
|
async function S(o) {
|
|
643
|
-
await
|
|
643
|
+
await Ae.remove(`Are you sure you want to remove ${o.name}?`) && await _(
|
|
644
644
|
async () => {
|
|
645
645
|
await N.delete(o._id), await $({ pageSize: 10, pageIndex: 0 });
|
|
646
646
|
},
|
|
@@ -657,18 +657,18 @@ const $t = {
|
|
|
657
657
|
rowsPerPage: 1e3,
|
|
658
658
|
page: 1,
|
|
659
659
|
rowsNumber: 0
|
|
660
|
-
},
|
|
660
|
+
}, u = new Be(), P = (await _e.read({
|
|
661
661
|
limit: 1,
|
|
662
662
|
skip: 0,
|
|
663
663
|
sortBy: a.sortBy,
|
|
664
664
|
descending: a.descending
|
|
665
|
-
})).meta.totalResources ?? 0,
|
|
666
|
-
await
|
|
665
|
+
})).meta.totalResources ?? 0, A = a.rowsPerPage;
|
|
666
|
+
await _(
|
|
667
667
|
async () => {
|
|
668
|
-
for (let B = 0; B < P; B +=
|
|
668
|
+
for (let B = 0; B < P; B += A) {
|
|
669
669
|
const V = {
|
|
670
670
|
...a,
|
|
671
|
-
limit:
|
|
671
|
+
limit: A,
|
|
672
672
|
skip: a.page - 1,
|
|
673
673
|
sortBy: a.sortBy,
|
|
674
674
|
descending: a.descending
|
|
@@ -678,12 +678,12 @@ const $t = {
|
|
|
678
678
|
);
|
|
679
679
|
for (const q of j.resources) {
|
|
680
680
|
const H = m(q);
|
|
681
|
-
|
|
681
|
+
u.addRecord(H);
|
|
682
682
|
}
|
|
683
683
|
a.page++;
|
|
684
684
|
}
|
|
685
685
|
await Fe(
|
|
686
|
-
|
|
686
|
+
u.buildExcel(),
|
|
687
687
|
`[${o.name}]-members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
|
|
688
688
|
{
|
|
689
689
|
bookType: "xlsx",
|
|
@@ -699,17 +699,17 @@ const $t = {
|
|
|
699
699
|
);
|
|
700
700
|
}
|
|
701
701
|
async function I(o) {
|
|
702
|
-
await
|
|
702
|
+
await _(
|
|
703
703
|
async () => {
|
|
704
704
|
var a;
|
|
705
|
-
if (o.type ===
|
|
706
|
-
const
|
|
707
|
-
if (
|
|
708
|
-
const { members: P, _id:
|
|
709
|
-
|
|
705
|
+
if (o.type === R.enum.STATIC) {
|
|
706
|
+
const u = new FormData();
|
|
707
|
+
if (u.append("file", o.file), o._id) {
|
|
708
|
+
const { members: P, _id: A, file: B, ...V } = o;
|
|
709
|
+
u.append("segment", JSON.stringify(V)), await N.updateStatic(o._id, u);
|
|
710
710
|
} else {
|
|
711
|
-
const { file: P, ...
|
|
712
|
-
|
|
711
|
+
const { file: P, ...A } = o;
|
|
712
|
+
u.append("segment", JSON.stringify(A)), await N.createStatic(u);
|
|
713
713
|
}
|
|
714
714
|
o.file && y.open({
|
|
715
715
|
type: "info",
|
|
@@ -717,14 +717,14 @@ const $t = {
|
|
|
717
717
|
action: "View",
|
|
718
718
|
onAction: async () => {
|
|
719
719
|
await f.push({
|
|
720
|
-
name:
|
|
720
|
+
name: ve["$connect-QUEUE"],
|
|
721
721
|
query: { type: [fe.enum.SEGMENTATION_IMPORTED] }
|
|
722
722
|
});
|
|
723
723
|
}
|
|
724
724
|
});
|
|
725
725
|
} else if (o._id) {
|
|
726
|
-
const { members:
|
|
727
|
-
await N.update(o._id,
|
|
726
|
+
const { members: u, _id: P, ...A } = o;
|
|
727
|
+
await N.update(o._id, A);
|
|
728
728
|
} else
|
|
729
729
|
await N.create(o);
|
|
730
730
|
await $({ pageSize: 10, pageIndex: 0 }), (a = n.value) == null || a.hideSheet();
|
|
@@ -735,16 +735,16 @@ const $t = {
|
|
|
735
735
|
}
|
|
736
736
|
);
|
|
737
737
|
}
|
|
738
|
-
function
|
|
738
|
+
function d(o) {
|
|
739
739
|
var a;
|
|
740
740
|
(a = n.value) == null || a.showSheet(o);
|
|
741
741
|
}
|
|
742
742
|
const r = {
|
|
743
|
-
label:
|
|
743
|
+
label: v("connect.navigation.queue"),
|
|
744
744
|
value: "queue",
|
|
745
745
|
isPrimary: !1,
|
|
746
746
|
prependIcon: "work_history"
|
|
747
|
-
}, g = ce(() =>
|
|
747
|
+
}, g = ce(() => k.isPremium ? [
|
|
748
748
|
r,
|
|
749
749
|
{
|
|
750
750
|
label: "Refresh segments",
|
|
@@ -761,30 +761,30 @@ const $t = {
|
|
|
761
761
|
function U(o) {
|
|
762
762
|
switch (o) {
|
|
763
763
|
case "add":
|
|
764
|
-
|
|
764
|
+
d();
|
|
765
765
|
break;
|
|
766
766
|
case "refresh":
|
|
767
767
|
h();
|
|
768
768
|
break;
|
|
769
769
|
case "queue":
|
|
770
770
|
f.push({
|
|
771
|
-
name:
|
|
771
|
+
name: ve["$connect-QUEUE"],
|
|
772
772
|
query: { type: [fe.enum.SEGMENTATION_IMPORTED] }
|
|
773
773
|
});
|
|
774
774
|
break;
|
|
775
775
|
}
|
|
776
776
|
}
|
|
777
777
|
return Te(async () => {
|
|
778
|
-
const { meta: o } = await
|
|
778
|
+
const { meta: o } = await _e.read({
|
|
779
779
|
limit: 1,
|
|
780
780
|
skip: 0,
|
|
781
781
|
sortBy: "_id",
|
|
782
782
|
search: void 0,
|
|
783
783
|
descending: !1
|
|
784
784
|
});
|
|
785
|
-
w.value = o.totalResources ?? 0, await $({ pageSize: 10, pageIndex: 0 }), await
|
|
785
|
+
w.value = o.totalResources ?? 0, await $({ pageSize: 10, pageIndex: 0 }), await k.readPremium(), await k.readLocations();
|
|
786
786
|
}), (o, a) => {
|
|
787
|
-
const
|
|
787
|
+
const u = b("FmPill"), P = b("FmPageHead"), A = b("FmIcon"), B = b("FmMenuItem"), V = b("FmMenu"), j = b("FmListItem"), q = b("FmList"), H = b("FmButton"), te = b("FmCard");
|
|
788
788
|
return p(), C(O, null, [
|
|
789
789
|
i(P, {
|
|
790
790
|
title: "Segments",
|
|
@@ -792,47 +792,47 @@ const $t = {
|
|
|
792
792
|
"onClick:action": a[0] || (a[0] = (M) => U(M))
|
|
793
793
|
}, {
|
|
794
794
|
title: E(() => [
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
i(
|
|
795
|
+
l("div", Rt, [
|
|
796
|
+
l("span", Dt, D(t(v)("connect.loyalty.segment.title")), 1),
|
|
797
|
+
i(u, { variant: "premium" })
|
|
798
798
|
])
|
|
799
799
|
]),
|
|
800
800
|
_: 1
|
|
801
801
|
}, 8, ["actions"]),
|
|
802
|
-
|
|
803
|
-
t(
|
|
802
|
+
l("div", Pt, [
|
|
803
|
+
t(F).length > 0 || t(c).searchValue || t(c).isLoading ? (p(), C(O, { key: 0 }, [
|
|
804
804
|
i(be, {
|
|
805
805
|
loading: t(c).isLoading,
|
|
806
|
-
"row-data": t(
|
|
806
|
+
"row-data": t(F),
|
|
807
807
|
"row-count": t(c).totalRows,
|
|
808
|
-
"column-defs":
|
|
808
|
+
"column-defs": s,
|
|
809
809
|
"shrink-at": !1,
|
|
810
810
|
"page-count": t(c).pageCount,
|
|
811
811
|
"page-index": t(c).pageIndex,
|
|
812
812
|
"page-size": t(c).pageSize,
|
|
813
813
|
onRowClick: a[1] || (a[1] = (M) => {
|
|
814
|
-
|
|
814
|
+
d(M.original);
|
|
815
815
|
}),
|
|
816
816
|
onPageChange: t($)
|
|
817
817
|
}, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onPageChange"]),
|
|
818
818
|
i(q, { class: "w-full hidden xs:block" }, {
|
|
819
819
|
default: E(() => [
|
|
820
|
-
(p(!0), C(O, null, ie(t(
|
|
820
|
+
(p(!0), C(O, null, ie(t(F), (M) => (p(), J(j, {
|
|
821
821
|
key: M._id.toString(),
|
|
822
822
|
tag: "label",
|
|
823
|
-
onClick: (Q) =>
|
|
823
|
+
onClick: (Q) => d(M)
|
|
824
824
|
}, {
|
|
825
825
|
default: E(() => [
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
826
|
+
l("div", null, [
|
|
827
|
+
l("div", Nt, D((M.memberCount ?? 0).toLocaleString()) + " total customers ", 1),
|
|
828
|
+
l("div", Bt, D(M.name), 1),
|
|
829
|
+
l("div", Vt, D(((M.memberCount ?? 0) * 100 / t(w)).toFixed(2)) + "% of customers ", 1)
|
|
830
830
|
])
|
|
831
831
|
]),
|
|
832
832
|
append: E(() => [
|
|
833
833
|
i(V, { "stop-click-propagation": !0 }, {
|
|
834
834
|
"menu-button": E(() => [
|
|
835
|
-
i(
|
|
835
|
+
i(A, { name: "more_vert" })
|
|
836
836
|
]),
|
|
837
837
|
default: E(() => [
|
|
838
838
|
i(B, {
|
|
@@ -855,19 +855,19 @@ const $t = {
|
|
|
855
855
|
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
856
856
|
}, {
|
|
857
857
|
default: E(() => [
|
|
858
|
-
Vt,
|
|
859
858
|
Yt,
|
|
859
|
+
Ut,
|
|
860
860
|
i(H, {
|
|
861
861
|
variant: "primary",
|
|
862
862
|
label: "Create segment",
|
|
863
|
-
disabled: !t(
|
|
863
|
+
disabled: !t(k).isPremium,
|
|
864
864
|
icon: "add",
|
|
865
|
-
onClick: a[2] || (a[2] = (M) =>
|
|
865
|
+
onClick: a[2] || (a[2] = (M) => d())
|
|
866
866
|
}, null, 8, ["disabled"])
|
|
867
867
|
]),
|
|
868
868
|
_: 1
|
|
869
869
|
})),
|
|
870
|
-
i(
|
|
870
|
+
i(Et, {
|
|
871
871
|
ref_key: "sheetRef",
|
|
872
872
|
ref: n,
|
|
873
873
|
"onUpdate:modelValue": I
|
|
@@ -878,5 +878,5 @@ const $t = {
|
|
|
878
878
|
}
|
|
879
879
|
});
|
|
880
880
|
export {
|
|
881
|
-
|
|
881
|
+
So as default
|
|
882
882
|
};
|