@feedmepos/mf-connect 0.1.91-prod → 0.1.93-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-NC-USqGi.js → Analytic-CF3P53vZ.js} +11 -11
- package/dist/{App-7D_MZN0d.js → App-Dbibh5dj.js} +11 -11
- package/dist/{Bin-60inU7_9.js → Bin-B2fl-fdo.js} +8 -8
- package/dist/{Broadcast-BFMikTv0.js → Broadcast-Bdd60JEW.js} +8 -8
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DrHHwGED.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BkXOSFhp.js} +6 -7
- package/dist/{Card-vafU4dyU.js → Card-BsfpC3iw.js} +20 -21
- package/dist/{Collections-BNSNZg7H.js → Collections-b35P-S0E.js} +8 -8
- package/dist/{Credit-Cy6YPGph.js → Credit-D52WVEI2.js} +8 -8
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-7IXALR4_.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CCUOC17_.js} +32 -33
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-7Tanljx6.js → EffectSheet.vue_vue_type_style_index_0_lang-Bt7uoapk.js} +6 -6
- package/dist/{Experience-BVneXtjz.js → Experience-_zsgF0a8.js} +8 -8
- package/dist/{FileSaver.min-DRZVt2c-.js → FileSaver.min-B7bT7uZB.js} +1 -1
- package/dist/{Game-leXiqv6v.js → Game-RJSHKHn3.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-bvPXAI2I.js → ImageInput.vue_vue_type_script_setup_true_lang-SEhYAL8G.js} +1 -1
- package/dist/{Index-BU3ubcCK.js → Index-D3ezuXa9.js} +10 -10
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DmnST0XL.js → LottieAnimation.vue_vue_type_script_setup_true_lang-BrE_KuQ8.js} +1 -1
- package/dist/{MainLayout-DfMxhjyZ.js → MainLayout-CVV2DhUe.js} +1 -1
- package/dist/Marketing-DEuThlZJ.js +235 -0
- package/dist/MarketingMaterialEdit-CUTvpMNA.js +1032 -0
- package/dist/{Member-C1UGjz3K.js → Member-VETbkHa9.js} +13 -14
- package/dist/{MemberList-B51qk9PN.js → MemberList-Zf4a_QPT.js} +33 -33
- package/dist/{MemberTransactions-XeeZVSj7.js → MemberTransactions-CKkhiXHs.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BZFh4LbN.js → MessageInput.vue_vue_type_script_setup_true_lang-CWFhJcf_.js} +9 -9
- package/dist/{Mission-_2ubnxed.js → Mission-ebr00gRa.js} +30 -30
- package/dist/{Overview-Wtw2Gxca.js → Overview-DAVsiqOi.js} +30 -30
- package/dist/{Point-BWNPBISs.js → Point-MVRhs_TV.js} +8 -8
- package/dist/{Promotion-Cq1rta1U.js → Promotion-gY4_IDdN.js} +20 -19
- package/dist/{Queue-BislCglv.js → Queue-DYG5qt5V.js} +23 -23
- package/dist/{Record-DllYWBQs.js → Record-DJQbIHO-.js} +14 -13
- package/dist/{Reward-DNnMSiIt.js → Reward-Cl9Q83Ic.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CYgKBX4A.js → RewardGroup.vue_vue_type_script_setup_true_lang-B9oA4sF8.js} +13 -14
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CBLDHomx.js → RuleGroup.vue_vue_type_script_setup_true_lang-4xWx1fZP.js} +16 -17
- package/dist/Segment-DmgI9KPo.js +1015 -0
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DaF39TyG.js → SelectItems.vue_vue_type_script_setup_true_lang-DySwa7Ny.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-vxFwpQoN.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DD-KfnJK.js} +30 -31
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BBddcORt.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-D8hgPIT2.js} +4 -4
- package/dist/{Setting-Gt-j2X-h.js → Setting-Czy9M6ce.js} +14 -14
- package/dist/{SettingAdvertisements-CETtBWdy.js → SettingAdvertisements-BMnfsHLy.js} +29 -29
- package/dist/{Store-DxBaC_7y.js → Store-C-ys_2QK.js} +23 -24
- package/dist/{StoreRewards-CbmzaAnf.js → StoreRewards-DK7IUkUO.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-CB6y-TEk.js → StoreTransactions.vue_vue_type_script_setup_true_lang-kaIV3mqE.js} +29 -29
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-Ckdg2H3D.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DnRJPsED.js} +2 -2
- package/dist/{Tier-BRBr_4Vs.js → Tier-B7bsxmsf.js} +22 -22
- package/dist/{Title-N1Aoum66.js → Title-D4KW30Ks.js} +22 -23
- package/dist/{Transaction-DzrBiUhw.js → Transaction-CKyWN0zZ.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-xtnyUh_C.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-tqshXO3D.js} +6 -6
- package/dist/{Voucher-95IbNNON.js → Voucher-DLw9lMUt.js} +12 -12
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BOf9umaT.js → VoucherEditor.vue_vue_type_script_setup_true_lang-D5QC7oDC.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-vCA6xspO.js → ZodTextField.vue_vue_type_script_setup_true_lang-DpfeD9sJ.js} +2 -2
- package/dist/{app-CSXjCxhe.js → app-AQ3uPcGw.js} +9630 -9256
- package/dist/app.js +1 -1
- package/dist/{business-B1gGiOi3.js → business-C-SeKOpM.js} +1 -1
- package/dist/{campaign-CJ-3fIa_.js → campaign-Dk0dzJrv.js} +21 -20
- package/dist/{campaign-CTPJV80W.js → campaign-Jnfn3VT0.js} +1 -1
- package/dist/{campaign.enum-C6mTkAc0.js → campaign.enum-jrT7BDfx.js} +1 -1
- package/dist/{campaign.fn-Dnq8oOA7.js → campaign.fn-v9Ckc2hW.js} +62 -62
- package/dist/{collectible.enum-Bm9ym61N.js → collectible.enum-DFWdMC2z.js} +1 -1
- package/dist/{collection.fn-eGKUovTx.js → collection.fn-BDtuxdF8.js} +2 -2
- package/dist/{dto-BmlZ970m.js → dto-zWYoDEwd.js} +16 -16
- package/dist/{effect-Fi165HuU.js → effect-DOecbCOM.js} +1 -1
- package/dist/{email-addresses-CkqIxXsD.js → email-addresses-DSr_tXqu.js} +2 -2
- package/dist/{export-BINxBZ3o.js → export-CZkFZ1ql.js} +3 -3
- package/dist/{helper-BJpoVem-.js → helper-Qh6msr0l.js} +1 -1
- package/dist/{index-elY0gYnL.js → index--gM0b_9n.js} +1 -1
- package/dist/{index-BazRPGxz.js → index-9VFfiC3i.js} +1 -1
- package/dist/{index-CMnMUrQv.js → index-B1rzQD1z.js} +3 -3
- package/dist/{index-Cg170bHf.js → index-BlK42Hsj.js} +19 -21
- package/dist/{index-BBTSDrdg.js → index-BnY_w7sd.js} +3 -3
- package/dist/{index-agtRTQ1_.js → index-BoC2dMV5.js} +334 -333
- package/dist/{index-Ceebw9zT.js → index-CRiRSGK0.js} +1 -1
- package/dist/{index-ShgzGUii.js → index-D0n4WOl2.js} +3 -3
- package/dist/{index-D2lJ7rbj.js → index-DFw3Bb9V.js} +91 -68
- package/dist/{index-D_D_KuCj.js → index-DObqZ6KJ.js} +1 -1
- package/dist/{index-msYk4Nww.js → index-YUpYN8aL.js} +1 -1
- package/dist/{index-C-7bzCQ9.js → index-tv01Kl2W.js} +1342 -1148
- package/dist/{index.esm2017-CFwZeNKo.js → index.esm2017-B-Gv-i1i.js} +1 -1
- package/dist/{loading-CWsuOmex.js → loading-CCrn-MJR.js} +4 -3
- package/dist/{lodash-Cm9Z1YF2.js → lodash-CtOTzbaj.js} +1 -1
- package/dist/{membership-DMInG-QR.js → membership-EQqU26uC.js} +38 -18
- package/dist/{money-COObXSez.js → money-BKkxOcfp.js} +1 -1
- package/dist/{number-ZsyBuNFr.js → number-CB4PaVTY.js} +1 -1
- package/dist/{objectid-Tx-E_slw.js → objectid-DZkH2UHF.js} +5 -5
- package/dist/{plugins-CvqTFq6l.js → plugins-DY6km6IL.js} +297 -326
- package/dist/{reward-BDSUzN0_.js → reward-CtjrIJKv.js} +1 -1
- package/dist/{rule-BzWFD4lu.js → rule-CZ3RGeiy.js} +3 -3
- package/dist/{rule-builder-y5PUkSk9.js → rule-builder-UZUhhSdz.js} +1 -1
- package/dist/string-Gcy5IM_H.js +32 -0
- package/dist/style.css +1 -1
- package/dist/{template-CO3A7_3t.js → template-D5j-p60O.js} +7 -7
- package/dist/{timezone-ClbAM0Sw.js → timezone-D6XtPLkX.js} +2 -2
- package/dist/{trigger-DGoPndhx.js → trigger-D899b9LT.js} +14 -14
- package/dist/useMarketingMaterialActions-CacZ3qjm.js +107 -0
- package/dist/{usePagination-COHUplyH.js → usePagination-bOOb_012.js} +1 -1
- package/dist/{user-CnDTKRSl.js → user-CH5kl3DX.js} +19 -19
- package/dist/{vue-i18n-X1TYXdQD.js → vue-i18n-zOam3pfw.js} +282 -282
- package/dist/{xlsx-W_9bPRI8.js → xlsx-DF35RkrA.js} +166 -166
- package/dist/{zod-D9xVg76J.js → zod-CmBShukP.js} +1 -1
- package/package.json +3 -2
- package/dist/Marketing-DVZfv6KL.js +0 -319
- package/dist/Segment-BawFn2kF.js +0 -882
- package/dist/index-CfEzixyr.js +0 -38
package/dist/Segment-BawFn2kF.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-CvqTFq6l.js";
|
|
4
|
-
import { u as De } from "./loading-CWsuOmex.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-COHUplyH.js";
|
|
7
|
-
import { u as Fe } from "./vue-i18n-X1TYXdQD.js";
|
|
8
|
-
import { i as Pe, j as D, c as fe } from "./index-C-7bzCQ9.js";
|
|
9
|
-
import "./index-Cg170bHf.js";
|
|
10
|
-
import { F as ye, z as Ne } from "./index-ShgzGUii.js";
|
|
11
|
-
import "./index-D2lJ7rbj.js";
|
|
12
|
-
import "./index-CfEzixyr.js";
|
|
13
|
-
import "./index-BBTSDrdg.js";
|
|
14
|
-
import { u as ne, w as he } from "./xlsx-W_9bPRI8.js";
|
|
15
|
-
import { e as Be, M as Ve } from "./email-addresses-CkqIxXsD.js";
|
|
16
|
-
import { Z as Ye } from "./zod-D9xVg76J.js";
|
|
17
|
-
import { u as Ue } from "./app-wDQR6dpb.js";
|
|
18
|
-
import { R as ge } from "./rule-builder-y5PUkSk9.js";
|
|
19
|
-
import { _ as Le } from "./ZodTextField.vue_vue_type_script_setup_true_lang-vCA6xspO.js";
|
|
20
|
-
import { _ as ze } from "./RuleGroup.vue_vue_type_script_setup_true_lang-CBLDHomx.js";
|
|
21
|
-
import { u as Oe, v as je, w as qe } from "./index.esm2017-CFwZeNKo.js";
|
|
22
|
-
import { F as He } from "./FileSaver.min-DRZVt2c-.js";
|
|
23
|
-
import { h as G } from "./moment-D7p2TMB-.js";
|
|
24
|
-
import { s as N, u as Ge } from "./membership-DMInG-QR.js";
|
|
25
|
-
import { o as Je } from "./objectId-dwaoBfJX.js";
|
|
26
|
-
import { u as ke } from "./business-B1gGiOi3.js";
|
|
27
|
-
import { f as Qe } from "./number-ZsyBuNFr.js";
|
|
28
|
-
import { t as We } from "./money-COObXSez.js";
|
|
29
|
-
import "./index-BazRPGxz.js";
|
|
30
|
-
import { useRouter as Ke } from "vue-router";
|
|
31
|
-
import { m as ve } from "./index-Ceebw9zT.js";
|
|
32
|
-
import { R as _e } from "./app-CSXjCxhe.js";
|
|
33
|
-
const Ze = Pe.extend({
|
|
34
|
-
_id: ye.optional(),
|
|
35
|
-
business: ye.optional(),
|
|
36
|
-
file: Ne.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 = Ue(), 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(Ye).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 = Be.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 Ve(), 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
|
-
};
|