@feedmepos/mf-connect 0.1.0-prod → 0.1.2-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 → Analytic-AqWU_lJy.js} +7 -7
- package/dist/{App-DHrfWG8l.js → App-CRTD0U-N.js} +205 -205
- package/dist/{Broadcast-B2rxZAZi.js → Broadcast-utWSrzP9.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D2a9rcXK.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-C5zUv0Zx.js} +8 -8
- package/dist/{Card-Dr6pTTM0.js → Card-x6qnEaIt.js} +57 -58
- package/dist/{Collections-0tbg0MFt.js → Collections-BgbWoLWI.js} +11 -12
- package/dist/{Credit-KbB_7Jq-.js → Credit-CojzmUnh.js} +7 -7
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-we7ADwFk.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-C137bE1q.js} +36 -33
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-VBNyvZCJ.js → EffectSheet.vue_vue_type_style_index_0_lang-8l3Dt_Lo.js} +5 -5
- package/dist/{Experience-C_Q9Iml8.js → Experience-CPjovKWF.js} +7 -7
- package/dist/{Game-BwODw7M6.js → Game-DWcjPfZP.js} +7 -7
- package/dist/{Marketing-QOKTAS_T.js → Marketing-CwoI0pFF.js} +4 -4
- package/dist/{Member-d7RIGRm1.js → Member-oRcVGr20.js} +3 -3
- package/dist/MemberList-ISy05wGZ.js +1040 -0
- package/dist/{MemberTransactions-D-pnlXiP.js → MemberTransactions-CXvhJngX.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-3VS7JnK6.js → MessageInput.vue_vue_type_script_setup_true_lang-Ca1LO__F.js} +2 -2
- package/dist/{Mission-BAKDm4VZ.js → Mission-Y8s5MQIC.js} +7 -7
- package/dist/{Point-Puu0jKz0.js → Point-0Fw3qLIW.js} +7 -7
- package/dist/{Promotion-DRIaUvJi.js → Promotion-vqM23NPX.js} +8 -8
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DTdfYGya.js → RuleGroup.vue_vue_type_script_setup_true_lang-D1eQ3i5D.js} +86 -77
- package/dist/Segment-lgzMRCyd.js +564 -0
- package/dist/{Setting-DLB2ywCp.js → Setting-CFGB53S0.js} +7 -7
- package/dist/Store-fJlew3HJ.js +1533 -0
- package/dist/{StoreRewards-DZfqUeYR.js → StoreRewards-DWq34E4p.js} +10 -10
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-RTfozD01.js → StoreTransactions.vue_vue_type_script_setup_true_lang-nhS5Dhhk.js} +10 -10
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BGI78ycg.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DWlpmE56.js} +1 -1
- package/dist/{Tier-BnQRujpX.js → Tier-DLrOmrnK.js} +13 -13
- package/dist/{Title-BPf1tUFx.js → Title-MHQuel7h.js} +13 -13
- package/dist/{Transaction-ese0oNrz.js → Transaction-CYqMFEzc.js} +1 -1
- package/dist/{Voucher--gtOZQx1.js → Voucher-B0QCX_nG.js} +10 -10
- package/dist/{app-DHE61XdR.js → app-BjOpRVdv.js} +1 -1
- package/dist/{app-Bt59niI-.js → app-SOHUUM08.js} +24 -24
- package/dist/app.js +1 -1
- package/dist/{business-BSo7EPan.js → business-DveMDDHY.js} +1 -1
- package/dist/{campaign-CsOje3Ap.js → campaign-CMb05XLt.js} +2 -2
- package/dist/{collection.fn-BYQfFJOr.js → collection.fn-BjaBPYMU.js} +2 -2
- package/dist/{dto-CfEXSCq6.js → dto-CY7JrHkZ.js} +8 -8
- package/dist/{effect-Bn_ofYS3.js → effect-CxAdSlyD.js} +1 -1
- package/dist/email-addresses-Dtr5OALQ.js +705 -0
- package/dist/{export-CMR243CF.js → export-DuBekrcg.js} +3 -3
- package/dist/{helper-BqOQRtvW.js → helper-DL6hnmtJ.js} +1 -1
- package/dist/{index-CHO4_zsT.js → index-BBBytzpn.js} +1 -1
- package/dist/{index-DbP04yeg.js → index-BMxu_XL-.js} +1 -1
- package/dist/index-BSIUoSG3.js +28997 -0
- package/dist/{index-BaBNmzUb.js → index-BZAlqAaJ.js} +1 -1
- package/dist/{index-D_f2lmK2.js → index-CAQpU5Rv.js} +319 -304
- package/dist/{index-BWnFs-Cb.js → index-CGHNWhkM.js} +5 -5
- package/dist/{index-Boo5np6l.js → index-CgPlJqkX.js} +1 -1
- package/dist/{index-DtPe-TEm.js → index-Cibwzgac.js} +3 -3
- package/dist/{index-DEZsrQ2f.js → index-DISwCnfH.js} +3 -3
- package/dist/{index-CC1GV8OW.js → index-Dx4pkNRc.js} +1 -1
- package/dist/{index-Da142OER.js → index-gcsOy_cD.js} +34 -33
- package/dist/{index-FvlaxwGB.js → index-raYm7Ew2.js} +2 -2
- package/dist/{index.esm2017-ePm--Atp.js → index.esm2017-Bs9CWbrs.js} +1 -1
- package/dist/{loading-KNmEMBUB.js → loading-Dj5bx8fg.js} +4 -4
- package/dist/{membership-DKoVIS1a.js → membership-B2avlZoN.js} +3 -3
- package/dist/{money-CkD3zl5C.js → money-CNSWtAf-.js} +1 -1
- package/dist/{number-BDsGpOXm.js → number-BA58pjU6.js} +1 -1
- package/dist/{rule-CzamI50_.js → rule-BWazFYuZ.js} +179 -177
- package/dist/{rule-builder-DHf6wfaQ.js → rule-builder-RIloDQBn.js} +1 -1
- package/dist/{template-CFAIPoD7.js → template-u01r84LY.js} +4 -4
- package/dist/{xlsx-BDJMaozs.js → usePagination--B6Wt7C1.js} +3246 -3025
- package/package.json +2 -2
- package/dist/MemberList-CK9629ew.js +0 -1737
- package/dist/Segment-DpBxGuuu.js +0 -435
- package/dist/Store-8DO6ITWc.js +0 -1513
- package/dist/index-BLDYTxnc.js +0 -28058
- package/dist/usePagination-JoYaROkV.js +0 -223
package/dist/Segment-DpBxGuuu.js
DELETED
|
@@ -1,435 +0,0 @@
|
|
|
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
|
-
};
|