@feedmepos/mf-connect 0.1.0-beta.8 → 0.1.0-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-D1vIDmhJ.js +620 -0
- package/dist/{App-SRz4257n.js → App-DHrfWG8l.js} +249 -250
- package/dist/Broadcast-B2rxZAZi.js +216 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CZXSxA9u.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D2a9rcXK.js} +20 -20
- package/dist/Card-Dr6pTTM0.js +824 -0
- package/dist/Collections-0tbg0MFt.js +441 -0
- package/dist/Credit-KbB_7Jq-.js +214 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Cuklmxur.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-we7ADwFk.js} +999 -1018
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-VBNyvZCJ.js +344 -0
- package/dist/Experience-C_Q9Iml8.js +211 -0
- package/dist/Game-BwODw7M6.js +250 -0
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +144 -0
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → MainLayout-DpZC6o3R.js} +53 -19
- package/dist/Marketing-QOKTAS_T.js +309 -0
- package/dist/Member-d7RIGRm1.js +92 -0
- package/dist/MemberList-CK9629ew.js +1737 -0
- package/dist/MemberOverview-C2n9oJZh.js +58 -0
- package/dist/{MemberTransactions-BwT3zE2a.js → MemberTransactions-D-pnlXiP.js} +1 -1
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-3VS7JnK6.js +203 -0
- package/dist/Mission-BAKDm4VZ.js +248 -0
- package/dist/Point-Puu0jKz0.js +220 -0
- package/dist/Promotion-DRIaUvJi.js +244 -0
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BkFm7tXq.js → RuleGroup.vue_vue_type_script_setup_true_lang-DTdfYGya.js} +557 -557
- package/dist/Segment-DpBxGuuu.js +435 -0
- package/dist/Setting-DLB2ywCp.js +1870 -0
- package/dist/Store-8DO6ITWc.js +1513 -0
- package/dist/StoreRewards-DZfqUeYR.js +429 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-BqpsMcl1.js → StoreTransactions.vue_vue_type_script_setup_true_lang-RTfozD01.js} +10 -10
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DrzmjYmU.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BGI78ycg.js} +1 -1
- package/dist/{Tier-CJ9-d8Zg.js → Tier-BnQRujpX.js} +453 -481
- package/dist/{Title-DZCpvg4q.js → Title-BPf1tUFx.js} +295 -314
- package/dist/Transaction-ese0oNrz.js +36 -0
- package/dist/Voucher--gtOZQx1.js +485 -0
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +140 -0
- package/dist/app-Bt59niI-.js +2974 -0
- package/dist/{app-Cg2pTZJK.js → app-DHE61XdR.js} +1 -1
- package/dist/app.js +3 -5
- package/dist/{business-Cw_qGw8y.js → business-BSo7EPan.js} +1 -1
- package/dist/{campaign-winsqufa.js → campaign-CsOje3Ap.js} +3 -5
- package/dist/{collection.fn-CI5Llblg.js → collection.fn-BYQfFJOr.js} +2 -2
- package/dist/dto-CfEXSCq6.js +1145 -0
- package/dist/{effect-CdkrIYgX.js → effect-Bn_ofYS3.js} +9 -9
- package/dist/{export-DGxfief1.js → export-CMR243CF.js} +3 -3
- package/dist/{helper-B8RqcTNu.js → helper-BqOQRtvW.js} +1 -1
- package/dist/index-BLDYTxnc.js +28058 -0
- package/dist/{index-Cw_aXFH6.js → index-BWnFs-Cb.js} +281 -299
- package/dist/{index-wzdbEEcZ.js → index-BaBNmzUb.js} +1 -1
- package/dist/{index-CjVmULNd.js → index-Boo5np6l.js} +1 -1
- package/dist/{index-HZC9LLAX.js → index-CC1GV8OW.js} +1 -1
- package/dist/{index-OzicErwL.js → index-CHO4_zsT.js} +1 -1
- package/dist/{index-DAEmawcj.js → index-DEZsrQ2f.js} +3 -3
- package/dist/{index-9w43_U1v.js → index-D_f2lmK2.js} +1 -1
- package/dist/{index-BaozRfWB.js → index-Da142OER.js} +66 -78
- package/dist/index-DbP04yeg.js +11 -0
- package/dist/{index-A34xEz20.js → index-DtPe-TEm.js} +3 -3
- package/dist/{index-BLACZ3-L.js → index-FvlaxwGB.js} +20 -20
- package/dist/{index.esm2017-CppSMh_U.js → index.esm2017-ePm--Atp.js} +55 -55
- package/dist/{loading-DuEFUCwF.js → loading-KNmEMBUB.js} +460 -469
- package/dist/{membership-nsMtWeTC.js → membership-DKoVIS1a.js} +3 -3
- package/dist/money-CkD3zl5C.js +15 -0
- package/dist/number-BDsGpOXm.js +12 -0
- package/dist/{rule-CPIMqt1h.js → rule-CzamI50_.js} +2 -2
- package/dist/{rule-builder-CSs5XRKP.js → rule-builder-DHf6wfaQ.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{template-CJZoYavu.js → template-CFAIPoD7.js} +63 -63
- package/dist/{usePagination-BeF5K3M7.js → usePagination-JoYaROkV.js} +85 -85
- package/dist/{xlsx-BZlnYinX.js → xlsx-BDJMaozs.js} +517 -517
- package/package.json +4 -7
- package/dist/Analytic-5QztrYSp.js +0 -622
- package/dist/Broadcast-DmkrJGp2.js +0 -223
- package/dist/Card-BsjFTVsH.js +0 -825
- package/dist/Collections-7wqZHOax.js +0 -453
- package/dist/Credit-CcNrq9qk.js +0 -220
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BIZDiLns.js +0 -345
- package/dist/Experience-DNsQLzDH.js +0 -221
- package/dist/Game-DlzDerT7.js +0 -255
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +0 -144
- package/dist/MainLayout-B1aJoR95.js +0 -41
- package/dist/Marketing-BqhpaG4o.js +0 -316
- package/dist/Member-AFgZcdtz.js +0 -69
- package/dist/MemberList-BKgrLz2C.js +0 -1733
- package/dist/MemberOverview-wL_ailso.js +0 -58
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-GCEQCVOt.js +0 -432
- package/dist/Mission-BTAia7AS.js +0 -261
- package/dist/Point-Ck8EG_3k.js +0 -222
- package/dist/Promotion-0v3kvsK3.js +0 -247
- package/dist/Segment-BenLupqV.js +0 -437
- package/dist/Setting-0fpREqpJ.js +0 -1901
- package/dist/Store-BDGwe4ar.js +0 -1511
- package/dist/StoreRewards-TDZt9H1V.js +0 -401
- package/dist/Transaction-DpnTxlbf.js +0 -39
- package/dist/Voucher-DsP_rh8I.js +0 -490
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-SukfoJpU.js +0 -56
- package/dist/app-DzAexOqx.js +0 -5639
- package/dist/dto-ozu1smC3.js +0 -2770
- package/dist/index-CZgQVRsm.js +0 -3
- package/dist/index-Oxr-mU6h.js +0 -29193
- package/dist/money-BGZPFtUc.js +0 -15
- package/dist/number-4J0xvXP9.js +0 -12
- package/dist/vue-i18n-CCyiVzOE.js +0 -2365
- package/dist/zod-Bg2FbC-D.js +0 -90
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
import { defineComponent as A, onMounted as E, openBlock as c, createElementBlock as b, createElementVNode as o, toDisplayString as M, unref as e, createVNode as i, createCommentVNode as G, ref as I, computed as j, resolveComponent as p, createBlock as B, isRef as J, createSlots as W, withCtx as _, Fragment as P, onBeforeMount as K, renderList as Q, h as R } from "vue";
|
|
2
|
+
import { _ as X } from "./campaign-CpzFl8Vr.js";
|
|
3
|
+
import { F as U, p as ee, u as te } from "./loading-KNmEMBUB.js";
|
|
4
|
+
import { components as L } from "@feedmepos/ui-library";
|
|
5
|
+
import { u as H, _ as O } from "./usePagination-JoYaROkV.js";
|
|
6
|
+
import { _ as oe, Z as ne } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
|
|
7
|
+
import { a as ae } from "./index-DtPe-TEm.js";
|
|
8
|
+
import { u as se } from "./app-wDQR6dpb.js";
|
|
9
|
+
import { R as ie } from "./rule-builder-DHf6wfaQ.js";
|
|
10
|
+
import { _ as le } from "./RuleGroup.vue_vue_type_script_setup_true_lang-DTdfYGya.js";
|
|
11
|
+
import { h as V } from "./moment-BWErdI6_.js";
|
|
12
|
+
import { s as k } from "./membership-DKoVIS1a.js";
|
|
13
|
+
import { o as re } from "./objectId-dwaoBfJX.js";
|
|
14
|
+
import { u as me } from "./business-BSo7EPan.js";
|
|
15
|
+
import { m as de } from "./index-CHO4_zsT.js";
|
|
16
|
+
const ce = ae.extend({
|
|
17
|
+
_id: U.optional(),
|
|
18
|
+
business: U.optional()
|
|
19
|
+
}), ue = { class: "space-y-16 pr-12" }, pe = { class: "fm-typo-en-title-md-800" }, ge = { class: "flex space-x-8" }, fe = { class: "fm-typo-en-title-md-800 text-fm-color-primary" }, _e = { class: "text-fm-color-typo-secondary" }, ye = /* @__PURE__ */ o("div", null, "contacts in your segment", -1), ve = {
|
|
20
|
+
key: 0,
|
|
21
|
+
class: "w-full flex flex-col gap-16 items-center pt-16"
|
|
22
|
+
}, he = /* @__PURE__ */ o("div", { class: "fm-typo-en-body-lg-600" }, "No data found", -1), Se = /* @__PURE__ */ o("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " No data to show at the current moment. ", -1), be = [
|
|
23
|
+
he,
|
|
24
|
+
Se
|
|
25
|
+
], xe = /* @__PURE__ */ A({
|
|
26
|
+
__name: "ReviewSegment",
|
|
27
|
+
props: {
|
|
28
|
+
title: {},
|
|
29
|
+
segment: {}
|
|
30
|
+
},
|
|
31
|
+
setup(D) {
|
|
32
|
+
const y = D, x = [
|
|
33
|
+
{
|
|
34
|
+
header: "Name",
|
|
35
|
+
accessorFn: (n) => n.name
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
header: "Id",
|
|
39
|
+
accessorFn: (n) => n._id
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
header: "Customer Since",
|
|
43
|
+
accessorFn: (n) => V(re(n._id.toString())).format("DD MMM YYYY")
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
header: "Phone",
|
|
47
|
+
accessorFn: (n) => n.phoneNumber
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
header: "Birthday",
|
|
51
|
+
accessorFn: (n) => V(n.birthday).format("DD MMM YYYY")
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
header: "Last Visit",
|
|
55
|
+
accessorFn: (n) => V(n.stats.lastVisit).format("DD MMM YYYY")
|
|
56
|
+
}
|
|
57
|
+
], v = async (n) => y.segment._id ? await k.paginateSegmentUsers(y.segment._id, {
|
|
58
|
+
limit: r.value.pageSize,
|
|
59
|
+
skip: n.pageIndex ?? 0,
|
|
60
|
+
sortBy: "_id",
|
|
61
|
+
search: n.searchValue,
|
|
62
|
+
descending: !0
|
|
63
|
+
}) : { resources: [], meta: { totalResources: 0, totalPages: 0 } }, { tableMeta: r, rowData: m, onSort: d, debouncedFetchData: g, onSearch: a } = H(v);
|
|
64
|
+
return E(async () => {
|
|
65
|
+
await g();
|
|
66
|
+
}), (n, w) => (c(), b("div", ue, [
|
|
67
|
+
o("div", pe, M(y.title), 1),
|
|
68
|
+
o("div", ge, [
|
|
69
|
+
o("div", fe, M(n.segment.members.length), 1),
|
|
70
|
+
o("div", _e, [
|
|
71
|
+
ye,
|
|
72
|
+
o("div", null, "as of " + M(e(V)(n.segment.lastUpdated).format("DD MMM YYYY")), 1)
|
|
73
|
+
])
|
|
74
|
+
]),
|
|
75
|
+
i(O, {
|
|
76
|
+
loading: e(r).isLoading,
|
|
77
|
+
"row-data": e(m),
|
|
78
|
+
"row-count": e(r).totalRows,
|
|
79
|
+
"column-defs": x,
|
|
80
|
+
"page-size": e(r).pageSize,
|
|
81
|
+
"page-count": e(r).pageCount,
|
|
82
|
+
"page-index": e(r).pageIndex,
|
|
83
|
+
onSortChange: e(d),
|
|
84
|
+
onPageChange: w[0] || (w[0] = (F) => e(g)({ pageSize: F.pageSize, pageIndex: F.pageIndex }))
|
|
85
|
+
}, null, 8, ["loading", "row-data", "row-count", "page-size", "page-count", "page-index", "onSortChange"]),
|
|
86
|
+
e(m).length == 0 ? (c(), b("div", ve, be)) : G("", !0)
|
|
87
|
+
]));
|
|
88
|
+
}
|
|
89
|
+
}), we = { class: "flex items-center gap-x-8" }, Fe = /* @__PURE__ */ o("div", null, "Review segment", -1), Ce = {
|
|
90
|
+
key: 0,
|
|
91
|
+
class: "space-y-16 pr-12"
|
|
92
|
+
}, ke = /* @__PURE__ */ o("div", { class: "fm-typo-en-title-sm-800" }, "Segment Filter", -1), Me = { class: "flex items-center gap-8" }, $e = /* @__PURE__ */ A({
|
|
93
|
+
__name: "SegmentSheet",
|
|
94
|
+
emits: ["update:model-value"],
|
|
95
|
+
setup(D, { expose: y, emit: x }) {
|
|
96
|
+
const v = se(), r = I(!1), m = I(!1), d = {
|
|
97
|
+
name: "",
|
|
98
|
+
rule: ie.scaffoldGroup(),
|
|
99
|
+
members: []
|
|
100
|
+
}, g = ce, a = I(d), n = j(() => {
|
|
101
|
+
const f = g.safeParse(a.value);
|
|
102
|
+
return f.success ? [] : f.error.errors;
|
|
103
|
+
});
|
|
104
|
+
function w(f) {
|
|
105
|
+
r.value = !0, m.value = !1, f ? a.value = { ...f } : a.value = { ...d };
|
|
106
|
+
}
|
|
107
|
+
function F() {
|
|
108
|
+
r.value = !1;
|
|
109
|
+
}
|
|
110
|
+
async function C() {
|
|
111
|
+
g.safeParse(a.value).success && (m.value = !0);
|
|
112
|
+
}
|
|
113
|
+
function Y() {
|
|
114
|
+
m.value = !1;
|
|
115
|
+
}
|
|
116
|
+
async function t() {
|
|
117
|
+
s("update:model-value", a.value);
|
|
118
|
+
}
|
|
119
|
+
E(async () => {
|
|
120
|
+
});
|
|
121
|
+
const s = x;
|
|
122
|
+
return y({
|
|
123
|
+
showSheet: w,
|
|
124
|
+
hideSheet: F
|
|
125
|
+
}), (f, l) => {
|
|
126
|
+
const h = p("FmButton"), z = p("FmSideSheet");
|
|
127
|
+
return c(), B(z, {
|
|
128
|
+
modelValue: e(r),
|
|
129
|
+
"onUpdate:modelValue": l[5] || (l[5] = (S) => J(r) ? r.value = S : null),
|
|
130
|
+
header: "Add segment",
|
|
131
|
+
"dismiss-away": "",
|
|
132
|
+
"close-button": !0,
|
|
133
|
+
"max-width": 1100
|
|
134
|
+
}, W({
|
|
135
|
+
"side-sheet-footer": _(() => [
|
|
136
|
+
o("div", Me, [
|
|
137
|
+
e(m) ? (c(), b(P, { key: 0 }, [
|
|
138
|
+
i(h, {
|
|
139
|
+
label: "Save Segment",
|
|
140
|
+
onClick: t,
|
|
141
|
+
loading: e(v).isLoading,
|
|
142
|
+
disabled: e(n).length > 0 || e(v).isLoading
|
|
143
|
+
}, null, 8, ["loading", "disabled"]),
|
|
144
|
+
i(h, {
|
|
145
|
+
label: "Cancel",
|
|
146
|
+
onClick: l[3] || (l[3] = (S) => Y()),
|
|
147
|
+
variant: "tertiary"
|
|
148
|
+
})
|
|
149
|
+
], 64)) : (c(), b(P, { key: 1 }, [
|
|
150
|
+
i(h, {
|
|
151
|
+
label: "Review Segment",
|
|
152
|
+
disabled: e(n).length > 0 || e(v).isLoading,
|
|
153
|
+
onClick: C
|
|
154
|
+
}, null, 8, ["disabled"]),
|
|
155
|
+
i(h, {
|
|
156
|
+
label: "Cancel",
|
|
157
|
+
onClick: l[4] || (l[4] = (S) => F()),
|
|
158
|
+
variant: "tertiary"
|
|
159
|
+
})
|
|
160
|
+
], 64))
|
|
161
|
+
])
|
|
162
|
+
]),
|
|
163
|
+
default: _(() => {
|
|
164
|
+
var S;
|
|
165
|
+
return [
|
|
166
|
+
e(m) ? (c(), B(xe, {
|
|
167
|
+
key: 1,
|
|
168
|
+
title: e(a).name,
|
|
169
|
+
segment: e(a)
|
|
170
|
+
}, null, 8, ["title", "segment"])) : (c(), b("div", Ce, [
|
|
171
|
+
i(oe, {
|
|
172
|
+
modelValue: e(a).name,
|
|
173
|
+
"onUpdate:modelValue": l[1] || (l[1] = ($) => e(a).name = $),
|
|
174
|
+
label: "Segment title",
|
|
175
|
+
schema: e(ne).typeAtPath(e(g), "name")
|
|
176
|
+
}, null, 8, ["modelValue", "schema"]),
|
|
177
|
+
ke,
|
|
178
|
+
i(le, {
|
|
179
|
+
"trigger-type": "MEMBERSHIP_JOINED",
|
|
180
|
+
includeOnly: "user",
|
|
181
|
+
"model-value": (S = e(a)) == null ? void 0 : S.rule,
|
|
182
|
+
"onUpdate:modelValue": l[2] || (l[2] = ($) => {
|
|
183
|
+
e(a).rule = $;
|
|
184
|
+
})
|
|
185
|
+
}, null, 8, ["model-value"])
|
|
186
|
+
]))
|
|
187
|
+
];
|
|
188
|
+
}),
|
|
189
|
+
_: 2
|
|
190
|
+
}, [
|
|
191
|
+
e(m) ? {
|
|
192
|
+
name: "side-sheet-header",
|
|
193
|
+
fn: _(() => [
|
|
194
|
+
o("div", we, [
|
|
195
|
+
i(h, {
|
|
196
|
+
icon: "arrow_back",
|
|
197
|
+
variant: "tertiary",
|
|
198
|
+
onClick: l[0] || (l[0] = (S) => m.value = !1)
|
|
199
|
+
}),
|
|
200
|
+
Fe
|
|
201
|
+
])
|
|
202
|
+
]),
|
|
203
|
+
key: "0"
|
|
204
|
+
} : void 0
|
|
205
|
+
]), 1032, ["modelValue"]);
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
}), Re = { class: "flex items-center" }, Ie = /* @__PURE__ */ o("span", { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, " Segments ", -1), Pe = { class: "px-24 flex flex-col gap-y-16" }, Ve = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Be = { class: "fm-typo-en-body-md-600" }, De = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Ye = /* @__PURE__ */ o("img", {
|
|
209
|
+
src: X,
|
|
210
|
+
class: "aspect-square w-[150px]"
|
|
211
|
+
}, null, -1), ze = /* @__PURE__ */ o("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
212
|
+
/* @__PURE__ */ o("div", { class: "fm-typo-en-title-sm-800" }, "Create customer segments"),
|
|
213
|
+
/* @__PURE__ */ o("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. ")
|
|
214
|
+
], -1), Qe = /* @__PURE__ */ A({
|
|
215
|
+
__name: "Segment",
|
|
216
|
+
setup(D) {
|
|
217
|
+
const { minor: y } = te, x = me(), v = I(0), r = [
|
|
218
|
+
{
|
|
219
|
+
header: "Name",
|
|
220
|
+
accessorFn: (t) => t.name
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
header: "Total Customers in this Segment",
|
|
224
|
+
accessorFn: (t) => t.memberCount ?? 0
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
header: "% of customers",
|
|
228
|
+
accessorFn: (t) => ((t.memberCount ?? 0) * 100 / v.value).toFixed(2)
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
header: "Actions",
|
|
232
|
+
meta: {
|
|
233
|
+
maxWidth: "100px"
|
|
234
|
+
},
|
|
235
|
+
cell(t) {
|
|
236
|
+
return R("div", { class: "flex items-center justify-end" }, [
|
|
237
|
+
R(
|
|
238
|
+
L.FmMenu,
|
|
239
|
+
{
|
|
240
|
+
placement: "bottom-end",
|
|
241
|
+
onClick: (s) => {
|
|
242
|
+
s.stopPropagation();
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"menu-button": () => R(L.FmButton, {
|
|
247
|
+
icon: "more_vert",
|
|
248
|
+
iconColor: "neutral-gray-400",
|
|
249
|
+
variant: "tertiary"
|
|
250
|
+
}),
|
|
251
|
+
default: () => [
|
|
252
|
+
R(
|
|
253
|
+
L.FmMenuItem,
|
|
254
|
+
{
|
|
255
|
+
onClick: async (s) => {
|
|
256
|
+
s.stopPropagation(), w(t.row.original);
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
label: R(
|
|
261
|
+
"div",
|
|
262
|
+
{
|
|
263
|
+
class: "text-fm-color-typo-error fm-typo-en-body-md-400"
|
|
264
|
+
},
|
|
265
|
+
"Remove"
|
|
266
|
+
)
|
|
267
|
+
}
|
|
268
|
+
)
|
|
269
|
+
]
|
|
270
|
+
}
|
|
271
|
+
)
|
|
272
|
+
]);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
], m = I(null), { tableMeta: d, rowData: g, debouncedFetchData: a } = H(
|
|
276
|
+
k.readAll
|
|
277
|
+
);
|
|
278
|
+
async function n() {
|
|
279
|
+
await y(
|
|
280
|
+
async () => {
|
|
281
|
+
await k.refreshSegments(), await a({ pageSize: 10, pageIndex: 0 });
|
|
282
|
+
},
|
|
283
|
+
{ message: "Refreshing segmentations" }
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
async function w(t) {
|
|
287
|
+
await ee.remove(`Are you sure you want to remove ${t.name}?`) && await y(
|
|
288
|
+
async () => {
|
|
289
|
+
await k.delete(t._id), await a({ pageSize: 10, pageIndex: 0 });
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
message: `Removing ${t.name}`,
|
|
293
|
+
successMessage: `Removed ${t.name} successfully`
|
|
294
|
+
}
|
|
295
|
+
);
|
|
296
|
+
}
|
|
297
|
+
async function F(t) {
|
|
298
|
+
await y(
|
|
299
|
+
async () => {
|
|
300
|
+
var s;
|
|
301
|
+
if (t._id) {
|
|
302
|
+
const { members: f, _id: l, ...h } = t;
|
|
303
|
+
await k.update(t._id, h);
|
|
304
|
+
} else
|
|
305
|
+
await k.create(t);
|
|
306
|
+
await a({ pageSize: 10, pageIndex: 0 }), (s = m.value) == null || s.hideSheet();
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
message: "Saving segment",
|
|
310
|
+
successMessage: "Segment saved"
|
|
311
|
+
}
|
|
312
|
+
);
|
|
313
|
+
}
|
|
314
|
+
function C(t) {
|
|
315
|
+
var s;
|
|
316
|
+
(s = m.value) == null || s.showSheet(t);
|
|
317
|
+
}
|
|
318
|
+
const Y = j(() => x.isPremium ? [
|
|
319
|
+
{
|
|
320
|
+
label: "Refresh segments",
|
|
321
|
+
value: "refresh"
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
label: "Add segment",
|
|
325
|
+
value: "add",
|
|
326
|
+
isPrimary: !0,
|
|
327
|
+
prependIcon: "add"
|
|
328
|
+
}
|
|
329
|
+
] : []);
|
|
330
|
+
return K(async () => {
|
|
331
|
+
const { meta: t } = await de.read({
|
|
332
|
+
limit: 1,
|
|
333
|
+
skip: 0,
|
|
334
|
+
sortBy: "_id",
|
|
335
|
+
search: void 0,
|
|
336
|
+
descending: !1
|
|
337
|
+
});
|
|
338
|
+
v.value = t.totalResources ?? 0, await a({ pageSize: 10, pageIndex: 0 }), await x.readPremium();
|
|
339
|
+
}), (t, s) => {
|
|
340
|
+
const f = p("FmPill"), l = p("FmPageHead"), h = p("FmIcon"), z = p("FmMenuItem"), S = p("FmMenu"), $ = p("FmListItem"), T = p("FmList"), Z = p("FmButton"), q = p("FmCard");
|
|
341
|
+
return c(), b(P, null, [
|
|
342
|
+
i(l, {
|
|
343
|
+
title: "Segments",
|
|
344
|
+
actions: e(Y),
|
|
345
|
+
"onClick:action": s[0] || (s[0] = (u) => u === "add" ? C() : n())
|
|
346
|
+
}, {
|
|
347
|
+
title: _(() => [
|
|
348
|
+
o("div", Re, [
|
|
349
|
+
Ie,
|
|
350
|
+
i(f, { variant: "premium" })
|
|
351
|
+
])
|
|
352
|
+
]),
|
|
353
|
+
_: 1
|
|
354
|
+
}, 8, ["actions"]),
|
|
355
|
+
o("div", Pe, [
|
|
356
|
+
e(g).length > 0 || e(d).searchValue || e(d).isLoading ? (c(), b(P, { key: 0 }, [
|
|
357
|
+
i(O, {
|
|
358
|
+
loading: e(d).isLoading,
|
|
359
|
+
"row-data": e(g),
|
|
360
|
+
"row-count": e(d).totalRows,
|
|
361
|
+
"column-defs": r,
|
|
362
|
+
"shrink-at": !1,
|
|
363
|
+
"page-count": e(d).pageCount,
|
|
364
|
+
"page-index": e(d).pageIndex,
|
|
365
|
+
"page-size": e(d).pageSize,
|
|
366
|
+
onRowClick: s[1] || (s[1] = (u) => {
|
|
367
|
+
C(u.original);
|
|
368
|
+
}),
|
|
369
|
+
onPageChange: e(a)
|
|
370
|
+
}, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onPageChange"]),
|
|
371
|
+
i(T, { class: "w-full hidden xs:block" }, {
|
|
372
|
+
default: _(() => [
|
|
373
|
+
(c(!0), b(P, null, Q(e(g), (u) => (c(), B($, {
|
|
374
|
+
key: u._id.toString(),
|
|
375
|
+
tag: "label",
|
|
376
|
+
onClick: (N) => C(u)
|
|
377
|
+
}, {
|
|
378
|
+
default: _(() => [
|
|
379
|
+
o("div", null, [
|
|
380
|
+
o("div", Ve, M((u.memberCount ?? 0).toLocaleString()) + " total customers ", 1),
|
|
381
|
+
o("div", Be, M(u.name), 1),
|
|
382
|
+
o("div", De, M(((u.memberCount ?? 0) * 100 / e(v)).toFixed(2)) + "% of customers ", 1)
|
|
383
|
+
])
|
|
384
|
+
]),
|
|
385
|
+
append: _(() => [
|
|
386
|
+
i(S, { "stop-click-propagation": !0 }, {
|
|
387
|
+
"menu-button": _(() => [
|
|
388
|
+
i(h, { name: "more_vert" })
|
|
389
|
+
]),
|
|
390
|
+
default: _(() => [
|
|
391
|
+
i(z, {
|
|
392
|
+
class: "text-fm-color-typo-error fm-typo-en-body-md-400",
|
|
393
|
+
label: "Remove",
|
|
394
|
+
"onUpdate:modelValue": (N) => N && w(u)
|
|
395
|
+
}, null, 8, ["onUpdate:modelValue"])
|
|
396
|
+
]),
|
|
397
|
+
_: 2
|
|
398
|
+
}, 1024)
|
|
399
|
+
]),
|
|
400
|
+
_: 2
|
|
401
|
+
}, 1032, ["onClick"]))), 128))
|
|
402
|
+
]),
|
|
403
|
+
_: 1
|
|
404
|
+
})
|
|
405
|
+
], 64)) : (c(), B(q, {
|
|
406
|
+
key: 1,
|
|
407
|
+
variant: "outlined",
|
|
408
|
+
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
409
|
+
}, {
|
|
410
|
+
default: _(() => [
|
|
411
|
+
Ye,
|
|
412
|
+
ze,
|
|
413
|
+
i(Z, {
|
|
414
|
+
variant: "primary",
|
|
415
|
+
label: "Create segment",
|
|
416
|
+
disabled: !e(x).isPremium,
|
|
417
|
+
icon: "add",
|
|
418
|
+
onClick: s[2] || (s[2] = (u) => C())
|
|
419
|
+
}, null, 8, ["disabled"])
|
|
420
|
+
]),
|
|
421
|
+
_: 1
|
|
422
|
+
})),
|
|
423
|
+
i($e, {
|
|
424
|
+
ref_key: "sheetRef",
|
|
425
|
+
ref: m,
|
|
426
|
+
"onUpdate:modelValue": F
|
|
427
|
+
}, null, 512)
|
|
428
|
+
])
|
|
429
|
+
], 64);
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
});
|
|
433
|
+
export {
|
|
434
|
+
Qe as default
|
|
435
|
+
};
|