@feedmepos/mf-connect 0.1.0-beta.72 → 0.1.0-beta.74
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-CeQ6Tgo4.js → Analytic-CmX1CjHI.js} +11 -11
- package/dist/{App-B94F1eM6.js → App-T0HK84dx.js} +6 -6
- package/dist/{AuditLogs-CduUWfDd.js → AuditLogs-0ERaLqfa.js} +16 -15
- package/dist/{Bin-muOo03RK.js → Bin-C7utgPUn.js} +8 -8
- package/dist/{Broadcast-CSco_Ev_.js → Broadcast-e2sHc8rv.js} +9 -9
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cfwv0VSC.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-mlnLZOdy.js} +14 -8
- package/dist/{Card-VojKGWaD.js → Card-Bi1q3NGE.js} +164 -155
- package/dist/{Collections-B8dsbCQ6.js → Collections-CJYy94Sc.js} +19 -18
- package/dist/{Credit-Ck_IuJMF.js → Credit-Mbgev3fe.js} +9 -9
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-CkEPB1Ri.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CCIj2_sx.js} +29 -28
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CA1awHcc.js → EffectSheet.vue_vue_type_style_index_0_lang-CGiI-3HJ.js} +6 -6
- package/dist/{Experience-CP6Lmado.js → Experience-BE9onJDQ.js} +9 -9
- package/dist/{Game-BfkyvrxR.js → Game-CxVwNVRg.js} +10 -10
- package/dist/{Index-CsjZUBT3.js → Index-NdgHNGa3.js} +10 -10
- package/dist/{Marketing-D-P76e73.js → Marketing-Deds20Ye.js} +6 -6
- package/dist/{Member-DplZWFjl.js → Member-BiwCcUbl.js} +106 -97
- package/dist/{MemberList-rmdZQk6G.js → MemberList-DCR44Sk4.js} +287 -282
- package/dist/{MemberTransactions-BLANcbUF.js → MemberTransactions-CYPPTT9t.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Cfks94UO.js → MessageInput.vue_vue_type_script_setup_true_lang-j3cmjEyQ.js} +7 -6
- package/dist/{Mission-n-ctxUhM.js → Mission-DYk_Vv35.js} +10 -10
- package/dist/{Overview-DZlApGRk.js → Overview-CsRent_o.js} +20 -19
- package/dist/{Point-COtP0jzH.js → Point-BV5qm3r7.js} +9 -9
- package/dist/{Promotion-DxOTF9a5.js → Promotion-ieE1dY52.js} +10 -10
- package/dist/{Queue-CEIn9dZ3.js → Queue-DkIuyH5Y.js} +76 -67
- package/dist/{Record-3ZeBNdJL.js → Record-BO4eYofF.js} +17 -16
- package/dist/{Reward-QiI0aowk.js → Reward-DcoWW28K.js} +15 -15
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Cz0tKJVt.js → RewardGroup.vue_vue_type_script_setup_true_lang-6s4ElOcQ.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CrfQAYP9.js → RuleGroup.vue_vue_type_script_setup_true_lang-l-qayOI8.js} +15 -14
- package/dist/Segment-dTpsHadj.js +794 -0
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-C39_J7OP.js → SelectItems.vue_vue_type_script_setup_true_lang-Dei-K3cP.js} +2 -2
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-B0fwBafY.js +188 -0
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DC1qZokI.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-Dl30f-41.js} +3 -3
- package/dist/{Setting-BUQfywpm.js → Setting-Cnv36Pu0.js} +16 -15
- package/dist/{Store-STKhCXHd.js → Store-CTK5EtS1.js} +28 -27
- package/dist/{StoreRewards-BbyKdrXv.js → StoreRewards-CnHiDS7A.js} +13 -13
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-BWilzG-3.js → StoreTransactions.vue_vue_type_script_setup_true_lang-o8BduJhH.js} +27 -26
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-Cau0aOLA.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CDCQIDZh.js} +1 -1
- package/dist/{Tier-yaEA-a64.js → Tier-CcN8habX.js} +22 -21
- package/dist/{Title-BZvC2-Jh.js → Title-DtsvtR89.js} +19 -19
- package/dist/{Transaction-D8Q5tgJB.js → Transaction-NylYY_6m.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BhhdZbR2.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Book86tM.js} +6 -6
- package/dist/{Voucher-troykwYN.js → Voucher-z6XGrJrc.js} +12 -12
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CA-pu2mD.js → VoucherEditor.vue_vue_type_script_setup_true_lang-C0TGO7Cl.js} +10 -10
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DGgUG7Qj.js → ZodTextField.vue_vue_type_script_setup_true_lang-Du4wOEBs.js} +1 -1
- package/dist/{app-CPknSRjl.js → app-Dew6WljN.js} +1 -1
- package/dist/{app-B89lfub2.js → app-nEHwJezD.js} +34 -34
- package/dist/app.js +1 -1
- package/dist/{business-hK-Tmb19.js → business-CXTuYix4.js} +1 -1
- package/dist/{campaign-Bz2phAKq.js → campaign-BZs7RPUJ.js} +9 -9
- package/dist/{campaign-DxBhaMAH.js → campaign-C18IUOcO.js} +2 -2
- package/dist/{campaign.enum-CaW4wKab.js → campaign.enum-C7o8B5Cf.js} +1 -1
- package/dist/{campaign.fn-VlvF65nU.js → campaign.fn-CP0x2e6M.js} +2 -2
- package/dist/{collectible.enum-CL4zeuNW.js → collectible.enum-QJSyw8dX.js} +1 -1
- package/dist/{collection.fn-DonS6vla.js → collection.fn-_9GY8WUr.js} +2 -2
- package/dist/{dto-Do28C6Us.js → dto-Cwr4tMef.js} +4 -4
- package/dist/{effect-BNoEad9s.js → effect-C3dyQmVR.js} +1 -1
- package/dist/{email-addresses-DVlPQOMF.js → email-addresses-DNwlAZV3.js} +1 -1
- package/dist/{export-B2HL-u8e.js → export-C11NCFgO.js} +3 -3
- package/dist/{helper-B-GwBl7o.js → helper-HHvZd4M_.js} +1 -1
- package/dist/{index-DziwUgQ3.js → index-8MnjnTtN.js} +1 -1
- package/dist/{index-CJfbls_c.js → index-B0zezW3E.js} +1 -1
- package/dist/{index-DLBH6Pz7.js → index-BzIzz7cS.js} +3 -3
- package/dist/{index-DrNO2330.js → index-CCTd1lLH.js} +437 -426
- package/dist/{index-CyLhq-Cu.js → index-CIKyf9ft.js} +1 -1
- package/dist/{index-DDyqoK-5.js → index-CL0DvpMU.js} +1 -1
- package/dist/{index-B1zeyOTK.js → index-CT4Hyf4w.js} +6 -6
- package/dist/{index-zetVbSGH.js → index-CyXkN89w.js} +2 -2
- package/dist/{index-BgaXtrUK.js → index-DJ-RhIDQ.js} +1 -1
- package/dist/{index-C00luv9F.js → index-DM6Zvwcl.js} +1 -1
- package/dist/{index-DdMBH5E3.js → index-DyfTL0NG.js} +1 -1
- package/dist/{plugins-0WrJ_ypd.js → index-jdsxOVkp.js} +2606 -2811
- package/dist/{index-DoLnZ0VU.js → index-yrwLRgg0.js} +3 -3
- package/dist/{index.esm2017-DUs_L3s2.js → index.esm2017-BMFlbxdx.js} +3 -3
- package/dist/{loading-BfH5PK5q.js → loading-ClVTDQc6.js} +1 -1
- package/dist/{membership-BSgYE5mw.js → membership-DqMQPgdF.js} +54 -48
- package/dist/{money-CXqLCoho.js → money-COS1BMzW.js} +1 -1
- package/dist/{number-CGz3yWyy.js → number-BuP5vRmO.js} +1 -1
- package/dist/{objectid-CH4l4E6N.js → objectid-B3LrrWLD.js} +1 -1
- package/dist/plugins-DWMQmNXZ.js +208 -0
- package/dist/{reward-DdFCP398.js → reward-Dh8eazpS.js} +1 -1
- package/dist/{rule-Fkz4cRmK.js → rule-CaiZcfw4.js} +3 -3
- package/dist/{rule-builder-Cq_MnX2R.js → rule-builder-DOHyUDI2.js} +1 -1
- package/dist/{template-DzWwfIhG.js → template-BZCh-lEH.js} +4 -4
- package/dist/{trigger-z_YD5Ld4.js → trigger-CUY_7-so.js} +4 -4
- package/dist/{user-qQossvab.js → user-DWsuhUnL.js} +1 -1
- package/dist/{vue-i18n-CeeBM23W.js → vue-i18n-BXjn2dYe.js} +158 -158
- package/dist/{xlsx-BaKm4Is1.js → xlsx-BGsRNT8x.js} +1 -1
- package/package.json +1 -1
- package/dist/Segment-Df47WLC6.js +0 -568
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-CCketLSU.js +0 -186
|
@@ -1,38 +1,39 @@
|
|
|
1
|
-
import { defineComponent as be, computed as H, ref as G, resolveComponent as
|
|
1
|
+
import { defineComponent as be, computed as H, ref as G, resolveComponent as V, openBlock as p, createElementBlock as A, Fragment as q, createElementVNode as n, unref as t, createBlock as R, createCommentVNode as ce, createVNode as _, renderList as ie, withCtx as xe, createTextVNode as Fe, toDisplayString as $, withDirectives as Re, vShow as Ue, watch as Le, onBeforeMount as rt, h as K, onMounted as ze, isRef as st, normalizeClass as it } from "vue";
|
|
2
2
|
import { h as S } from "./moment-BWErdI6_.js";
|
|
3
3
|
import { useDialog as Ee, components as ve } from "@feedmepos/ui-library";
|
|
4
|
-
import { e as
|
|
5
|
-
import { w as
|
|
6
|
-
import "./index-
|
|
7
|
-
import
|
|
8
|
-
import { u as
|
|
9
|
-
import { c as
|
|
10
|
-
import { _ as
|
|
11
|
-
import { D as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import "./
|
|
19
|
-
import "./index-
|
|
20
|
-
import "./index-
|
|
21
|
-
import "./index-
|
|
22
|
-
import
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
4
|
+
import { e as lt, M as ct } from "./email-addresses-DNwlAZV3.js";
|
|
5
|
+
import { w as dt } from "./xlsx-BGsRNT8x.js";
|
|
6
|
+
import "./index-8MnjnTtN.js";
|
|
7
|
+
import "./index-jdsxOVkp.js";
|
|
8
|
+
import { u as Ve, C as De, s as mt } from "./membership-DqMQPgdF.js";
|
|
9
|
+
import { c as ut } from "./index-BzIzz7cS.js";
|
|
10
|
+
import { _ as Ne } from "./lodash-B5I3zXaY.js";
|
|
11
|
+
import { D as pt } from "./type_drinks-D6jnpvwV.js";
|
|
12
|
+
import { d as ft, e as bt, f as yt, g as gt, h as vt } from "./index-CCTd1lLH.js";
|
|
13
|
+
import { p as Ye, c as Pe, b as Oe } from "./plugins-DWMQmNXZ.js";
|
|
14
|
+
import { u as je } from "./loading-ClVTDQc6.js";
|
|
15
|
+
import { C as Ae } from "./collection.fn-_9GY8WUr.js";
|
|
16
|
+
import { u as qe } from "./business-CXTuYix4.js";
|
|
17
|
+
import { defineStore as xt } from "pinia";
|
|
18
|
+
import { f as ee } from "./number-BuP5vRmO.js";
|
|
19
|
+
import "./index-CT4Hyf4w.js";
|
|
20
|
+
import "./index-CyXkN89w.js";
|
|
21
|
+
import "./index-CL0DvpMU.js";
|
|
22
|
+
import "./index-yrwLRgg0.js";
|
|
23
|
+
import { s as ht } from "./index-CsaQJMAR.js";
|
|
24
|
+
import { u as Ke, _ as Ge } from "./usePagination-BeF5K3M7.js";
|
|
25
|
+
import { B as _t, e as St } from "./export-C11NCFgO.js";
|
|
26
|
+
import { m as Me } from "./index-CIKyf9ft.js";
|
|
26
27
|
import { o as Ce } from "./objectId-dwaoBfJX.js";
|
|
27
|
-
import { F as ke } from "./collectible.enum-
|
|
28
|
-
import { g as
|
|
29
|
-
import { useRouter as
|
|
30
|
-
import { m as le } from "./index-
|
|
31
|
-
import { t as
|
|
32
|
-
import { R as
|
|
33
|
-
import { t as
|
|
34
|
-
import { g as
|
|
35
|
-
const
|
|
28
|
+
import { F as ke } from "./collectible.enum-QJSyw8dX.js";
|
|
29
|
+
import { g as Ct, b as wt } from "./campaign-BZs7RPUJ.js";
|
|
30
|
+
import { useRouter as He } from "vue-router";
|
|
31
|
+
import { m as le } from "./index-DyfTL0NG.js";
|
|
32
|
+
import { t as Ft } from "./index-DM6Zvwcl.js";
|
|
33
|
+
import { R as We } from "./app-nEHwJezD.js";
|
|
34
|
+
import { t as Mt } from "./money-COS1BMzW.js";
|
|
35
|
+
import { g as Tt, a as kt, b as At } from "./user-DWsuhUnL.js";
|
|
36
|
+
const Et = { class: "flex flex-col" }, Vt = { key: 1 }, It = { class: "flex flex-nowrap gap-4 items-center my-[-4px]" }, $t = { class: "flex flex-nowrap gap-8 items-center pt-24 w-full" }, Bt = /* @__PURE__ */ be({
|
|
36
37
|
__name: "MemberStatsDialog",
|
|
37
38
|
props: {
|
|
38
39
|
member: {
|
|
@@ -46,25 +47,25 @@ const $t = { class: "flex flex-col" }, Bt = { key: 1 }, Dt = { class: "flex flex
|
|
|
46
47
|
},
|
|
47
48
|
setup(y) {
|
|
48
49
|
var de, ae, W, re;
|
|
49
|
-
const k = Ee(), f =
|
|
50
|
+
const k = Ee(), f = Ve(), x = y, s = H(
|
|
50
51
|
() => {
|
|
51
52
|
var d;
|
|
52
53
|
return (((d = x.member.collection) == null ? void 0 : d.TITLE) ?? []).reduce(
|
|
53
|
-
(
|
|
54
|
+
(l, M) => {
|
|
54
55
|
var w, T, O, E, U;
|
|
55
56
|
const r = f.sortedTitles.find(
|
|
56
57
|
(te) => te._id.toString() === M.collectible
|
|
57
58
|
);
|
|
58
|
-
if (!r) return
|
|
59
|
-
const
|
|
59
|
+
if (!r) return l;
|
|
60
|
+
const i = [...M.expiryBalance ?? []].sort(
|
|
60
61
|
(te, z) => S(te.expiredAt).isAfter(S(z.expiredAt)) ? -1 : 1
|
|
61
62
|
);
|
|
62
|
-
return (w =
|
|
63
|
+
return (w = i[0]) != null && w.expiredAt && S((T = i[0]) == null ? void 0 : T.expiredAt).isBefore(S()) || l.push({
|
|
63
64
|
_id: r._id,
|
|
64
65
|
name: r.name,
|
|
65
|
-
expiredAt: (O =
|
|
66
|
-
expiresIn: S((U =
|
|
67
|
-
}),
|
|
66
|
+
expiredAt: (O = i[0]) != null && O.expiredAt ? S((E = i[0]) == null ? void 0 : E.expiredAt).toISOString() : "",
|
|
67
|
+
expiresIn: S((U = i[0]) == null ? void 0 : U.expiredAt).diff(S(), "days")
|
|
68
|
+
}), l;
|
|
68
69
|
},
|
|
69
70
|
[]
|
|
70
71
|
);
|
|
@@ -78,28 +79,28 @@ const $t = { class: "flex flex-col" }, Bt = { key: 1 }, Dt = { class: "flex flex
|
|
|
78
79
|
() => (f.sortedTitles ?? []).map((d) => ({
|
|
79
80
|
label: d.name,
|
|
80
81
|
value: d._id.toString(),
|
|
81
|
-
sublabel: s.value.some((
|
|
82
|
+
sublabel: s.value.some((l) => l._id === d._id) ? "Owned" : void 0
|
|
82
83
|
}))
|
|
83
|
-
), m = H(() => (f.sortedTiers ?? []).map((d,
|
|
84
|
+
), m = H(() => (f.sortedTiers ?? []).map((d, l) => ({
|
|
84
85
|
label: d.name,
|
|
85
86
|
sublabel: `${d.option.from} - ${d.option.to}`,
|
|
86
87
|
from: d.option.from,
|
|
87
88
|
to: d.option.to,
|
|
88
|
-
value:
|
|
89
|
+
value: l + 1
|
|
89
90
|
})));
|
|
90
91
|
function C() {
|
|
91
92
|
var M, r;
|
|
92
|
-
const d = ((M = m.value[(o.value.tier ?? 1) - 1]) == null ? void 0 : M.from) ?? 0,
|
|
93
|
+
const d = ((M = m.value[(o.value.tier ?? 1) - 1]) == null ? void 0 : M.from) ?? 0, l = (r = m.value[(o.value.tier ?? 1) - 1]) == null ? void 0 : r.to;
|
|
93
94
|
o.value.experience = Math.min(
|
|
94
|
-
|
|
95
|
+
l ?? d,
|
|
95
96
|
Math.max(d, o.value.experience ?? 0)
|
|
96
97
|
);
|
|
97
98
|
}
|
|
98
99
|
const u = H(() => {
|
|
99
|
-
var M, r,
|
|
100
|
-
const d = ((r = (M = x.member.collection) == null ? void 0 : M.TIER) == null ? void 0 : r[0].balance) ?? -1,
|
|
100
|
+
var M, r, i, w, T, O;
|
|
101
|
+
const d = ((r = (M = x.member.collection) == null ? void 0 : M.TIER) == null ? void 0 : r[0].balance) ?? -1, l = ((w = (i = x.member.collection) == null ? void 0 : i.POINT) == null ? void 0 : w[0].balance) ?? 0;
|
|
101
102
|
if (d != o.value.tier) return !0;
|
|
102
|
-
if (o.value.experience && o.value.experience !=
|
|
103
|
+
if (o.value.experience && o.value.experience != l) {
|
|
103
104
|
const E = ((T = m.value[d - 1]) == null ? void 0 : T.from) ?? 0, U = ((O = m.value[d - 1]) == null ? void 0 : O.to) ?? 0;
|
|
104
105
|
if (o.value.experience < E || U && o.value.experience > U)
|
|
105
106
|
return !0;
|
|
@@ -107,35 +108,35 @@ const $t = { class: "flex flex-col" }, Bt = { key: 1 }, Dt = { class: "flex flex
|
|
|
107
108
|
return !1;
|
|
108
109
|
});
|
|
109
110
|
function v(d) {
|
|
110
|
-
var
|
|
111
|
-
return (
|
|
111
|
+
var l;
|
|
112
|
+
return (l = s.value.find((M) => M._id === d)) == null ? void 0 : l.expiresIn;
|
|
112
113
|
}
|
|
113
|
-
const
|
|
114
|
-
const d =
|
|
114
|
+
const I = H(() => {
|
|
115
|
+
const d = ft.safeParse(o.value);
|
|
115
116
|
return d.success ? void 0 : d.error.errors;
|
|
116
117
|
});
|
|
117
118
|
function D(d) {
|
|
118
|
-
var
|
|
119
|
-
return (M = (
|
|
119
|
+
var l, M;
|
|
120
|
+
return (M = (l = I.value) == null ? void 0 : l.find((r) => r.path.join(".") === d)) == null ? void 0 : M.message;
|
|
120
121
|
}
|
|
121
122
|
function L(d) {
|
|
122
|
-
var
|
|
123
|
-
return (
|
|
123
|
+
var l;
|
|
124
|
+
return (l = I.value) == null ? void 0 : l.filter((M) => M.path.join(".").startsWith(d)).map((M) => M.message);
|
|
124
125
|
}
|
|
125
126
|
async function P() {
|
|
126
127
|
await x.onSubmit(o.value), k.close();
|
|
127
128
|
}
|
|
128
|
-
return (d,
|
|
129
|
+
return (d, l) => {
|
|
129
130
|
var te, z;
|
|
130
|
-
const M =
|
|
131
|
+
const M = V("FmSelect"), r = V("FmStepperField"), i = V("FmTextField"), w = V("FmField"), T = V("FmFormGroup"), O = V("FmButton"), E = V("FmHelperText"), U = V("FmSpacer");
|
|
131
132
|
return p(), A(q, null, [
|
|
132
|
-
n("div",
|
|
133
|
-
|
|
133
|
+
n("div", Et, [
|
|
134
|
+
l[6] || (l[6] = n("div", { class: "fm-typo-en-title-sm-800 mb-8" }, "Member tiering", -1)),
|
|
134
135
|
t(m).length ? (p(), R(M, {
|
|
135
136
|
key: 0,
|
|
136
137
|
modelValue: t(o).tier,
|
|
137
138
|
"onUpdate:modelValue": [
|
|
138
|
-
|
|
139
|
+
l[0] || (l[0] = (F) => t(o).tier = F),
|
|
139
140
|
C
|
|
140
141
|
],
|
|
141
142
|
label: "Member Tier",
|
|
@@ -145,22 +146,22 @@ const $t = { class: "flex flex-col" }, Bt = { key: 1 }, Dt = { class: "flex flex
|
|
|
145
146
|
}, null, 8, ["modelValue", "items", "helper-text", "helper-state"])) : ce("", !0),
|
|
146
147
|
_(r, {
|
|
147
148
|
"model-value": t(o).experience ?? 0,
|
|
148
|
-
"onUpdate:modelValue":
|
|
149
|
+
"onUpdate:modelValue": l[1] || (l[1] = (F) => t(o).experience = F),
|
|
149
150
|
label: "Member Experience",
|
|
150
151
|
"max-fraction-digits": 0,
|
|
151
152
|
"helper-text": D("experience"),
|
|
152
153
|
"helper-state": D("experience") ? "error" : void 0
|
|
153
154
|
}, null, 8, ["model-value", "helper-text", "helper-state"]),
|
|
154
|
-
|
|
155
|
-
_(
|
|
155
|
+
l[7] || (l[7] = n("div", { class: "fm-typo-en-title-sm-800 mt-16 mb-8" }, "Member Card", -1)),
|
|
156
|
+
_(i, {
|
|
156
157
|
modelValue: t(o).cardNo,
|
|
157
|
-
"onUpdate:modelValue":
|
|
158
|
+
"onUpdate:modelValue": l[2] || (l[2] = (F) => t(o).cardNo = F),
|
|
158
159
|
label: "Card number",
|
|
159
160
|
"helper-text": D("cardNo"),
|
|
160
161
|
"helper-state": D("cardNo") ? "error" : void 0
|
|
161
162
|
}, null, 8, ["modelValue", "helper-text", "helper-state"]),
|
|
162
|
-
|
|
163
|
-
(te = t(o).titles) != null && te.length ? (p(), A("div",
|
|
163
|
+
l[8] || (l[8] = n("div", { class: "fm-typo-en-title-sm-800 mt-16 mb-8" }, "Titles", -1)),
|
|
164
|
+
(te = t(o).titles) != null && te.length ? (p(), A("div", Vt, l[5] || (l[5] = [
|
|
164
165
|
n("div", { class: "flex flex-nowrap gap-4 items-center" }, [
|
|
165
166
|
n("div", { class: "flex-1" }, "Title"),
|
|
166
167
|
n("div", { class: "flex-1" }, "Expires in days"),
|
|
@@ -168,7 +169,7 @@ const $t = { class: "flex flex-col" }, Bt = { key: 1 }, Dt = { class: "flex flex
|
|
|
168
169
|
], -1)
|
|
169
170
|
]))) : ce("", !0),
|
|
170
171
|
(p(!0), A(q, null, ie(t(o).titles ?? [], (F, J) => (p(), A("div", { key: J }, [
|
|
171
|
-
n("div",
|
|
172
|
+
n("div", It, [
|
|
172
173
|
t(s).some((a) => a._id === F.id) ? (p(), R(T, {
|
|
173
174
|
key: 1,
|
|
174
175
|
"model-value": "",
|
|
@@ -230,7 +231,7 @@ const $t = { class: "flex flex-col" }, Bt = { key: 1 }, Dt = { class: "flex flex
|
|
|
230
231
|
icon: "add",
|
|
231
232
|
label: "Give title",
|
|
232
233
|
variant: "plain",
|
|
233
|
-
onClick:
|
|
234
|
+
onClick: l[3] || (l[3] = (F) => {
|
|
234
235
|
var J;
|
|
235
236
|
return t(o).titles = [
|
|
236
237
|
...t(o).titles ?? [],
|
|
@@ -247,22 +248,22 @@ const $t = { class: "flex flex-col" }, Bt = { key: 1 }, Dt = { class: "flex flex
|
|
|
247
248
|
})
|
|
248
249
|
})) : ce("", !0)
|
|
249
250
|
]),
|
|
250
|
-
n("div",
|
|
251
|
-
|
|
251
|
+
n("div", $t, [
|
|
252
|
+
Re(_(E, {
|
|
252
253
|
state: "warning",
|
|
253
254
|
text: "Updating member will cause tier to change"
|
|
254
255
|
}, null, 512), [
|
|
255
|
-
[
|
|
256
|
+
[Ue, t(u)]
|
|
256
257
|
]),
|
|
257
258
|
_(U),
|
|
258
259
|
_(O, {
|
|
259
260
|
variant: "secondary",
|
|
260
261
|
label: "Cancel",
|
|
261
262
|
size: "md",
|
|
262
|
-
onClick:
|
|
263
|
+
onClick: l[4] || (l[4] = (F) => t(k).close())
|
|
263
264
|
}),
|
|
264
265
|
_(O, {
|
|
265
|
-
disabled: !!t(
|
|
266
|
+
disabled: !!t(I),
|
|
266
267
|
variant: "primary",
|
|
267
268
|
label: "Submit",
|
|
268
269
|
size: "md",
|
|
@@ -272,7 +273,7 @@ const $t = { class: "flex flex-col" }, Bt = { key: 1 }, Dt = { class: "flex flex
|
|
|
272
273
|
], 64);
|
|
273
274
|
};
|
|
274
275
|
}
|
|
275
|
-
}),
|
|
276
|
+
}), Dt = { class: "fm-typo-en-title-sm-800" }, Nt = { class: "space-y-16" }, Yt = { class: "flex flex-nowrap gap-8 items-center justify-end pt-24 w-full" }, Pt = /* @__PURE__ */ be({
|
|
276
277
|
__name: "CreditCoinDialog",
|
|
277
278
|
props: {
|
|
278
279
|
type: { type: String, required: !0 },
|
|
@@ -294,35 +295,35 @@ const $t = { class: "flex flex-col" }, Bt = { key: 1 }, Dt = { class: "flex flex
|
|
|
294
295
|
async function m() {
|
|
295
296
|
if (f.action === "send") {
|
|
296
297
|
const u = x.value.day ? `, expire in ${x.value.day} days` : "";
|
|
297
|
-
|
|
298
|
+
Ye.confirm(
|
|
298
299
|
`Are you sure to send ${x.value.amount} ${o.value.toLowerCase()}${u}? This action cannot be reversed.`
|
|
299
300
|
).then(async (v) => {
|
|
300
301
|
v && await f.onSubmit(x.value);
|
|
301
302
|
});
|
|
302
303
|
} else
|
|
303
|
-
|
|
304
|
+
Ye.confirm(
|
|
304
305
|
`Are you sure to deduct ${x.value.amount} ${o.value.toLowerCase()}? This action cannot be reversed.`
|
|
305
306
|
).then(async (u) => {
|
|
306
307
|
u && await f.onSubmit(x.value);
|
|
307
308
|
});
|
|
308
309
|
}
|
|
309
310
|
const C = H(() => {
|
|
310
|
-
const v = (f.action === "send" ? f.type === "coin" ?
|
|
311
|
+
const v = (f.action === "send" ? f.type === "coin" ? bt : yt : f.type === "coin" ? gt : vt).safeParse(x.value);
|
|
311
312
|
return v.success == !1 ? v.error.flatten().fieldErrors : void 0;
|
|
312
313
|
});
|
|
313
314
|
return (u, v) => {
|
|
314
|
-
const
|
|
315
|
+
const I = V("FmStepperField"), D = V("FmSwitch"), L = V("FmTextarea"), P = V("FmButton"), de = V("FmCard");
|
|
315
316
|
return p(), R(de, { class: "flex flex-col gap-16 p-16" }, {
|
|
316
317
|
default: xe(() => {
|
|
317
|
-
var ae, W, re, d,
|
|
318
|
+
var ae, W, re, d, l, M;
|
|
318
319
|
return [
|
|
319
|
-
n("div",
|
|
320
|
+
n("div", Dt, $(f.action == "send" ? "Send" : "Deduct") + " " + $(t(De)[f.type.toUpperCase()].name), 1),
|
|
320
321
|
Fe(" " + $(t(C)) + " ", 1),
|
|
321
|
-
n("div",
|
|
322
|
-
_(
|
|
322
|
+
n("div", Nt, [
|
|
323
|
+
_(I, {
|
|
323
324
|
modelValue: t(x).amount,
|
|
324
325
|
"onUpdate:modelValue": v[0] || (v[0] = (r) => t(x).amount = r),
|
|
325
|
-
label: `${t(
|
|
326
|
+
label: `${t(De)[f.type.toUpperCase()].name} amount`,
|
|
326
327
|
"is-currency": !0,
|
|
327
328
|
"max-fraction-digits": 2,
|
|
328
329
|
"helper-state": (ae = t(C)) != null && ae.amount ? "error" : void 0,
|
|
@@ -335,7 +336,7 @@ const $t = { class: "flex flex-col" }, Bt = { key: 1 }, Dt = { class: "flex flex
|
|
|
335
336
|
"label-placement": "right",
|
|
336
337
|
"onUpdate:modelValue": v[1] || (v[1] = (r) => g(r))
|
|
337
338
|
}, null, 8, ["model-value", "label"])) : ce("", !0),
|
|
338
|
-
y.action === "send" && t(s) ? (p(), R(
|
|
339
|
+
y.action === "send" && t(s) ? (p(), R(I, {
|
|
339
340
|
key: 1,
|
|
340
341
|
modelValue: t(x).day,
|
|
341
342
|
"onUpdate:modelValue": v[2] || (v[2] = (r) => t(x).day = r),
|
|
@@ -345,7 +346,7 @@ const $t = { class: "flex flex-col" }, Bt = { key: 1 }, Dt = { class: "flex flex
|
|
|
345
346
|
max: 9999,
|
|
346
347
|
min: 0,
|
|
347
348
|
"helper-state": (d = t(C)) != null && d.day ? "error" : void 0,
|
|
348
|
-
"helper-text": (M = (
|
|
349
|
+
"helper-text": (M = (l = t(C)) == null ? void 0 : l.day) == null ? void 0 : M[0]
|
|
349
350
|
}, null, 8, ["modelValue", "label", "helper-state", "helper-text"])) : ce("", !0),
|
|
350
351
|
_(L, {
|
|
351
352
|
modelValue: t(x).remark,
|
|
@@ -353,7 +354,7 @@ const $t = { class: "flex flex-col" }, Bt = { key: 1 }, Dt = { class: "flex flex
|
|
|
353
354
|
label: "Remark"
|
|
354
355
|
}, null, 8, ["modelValue"])
|
|
355
356
|
]),
|
|
356
|
-
n("div",
|
|
357
|
+
n("div", Yt, [
|
|
357
358
|
_(P, {
|
|
358
359
|
variant: "secondary",
|
|
359
360
|
label: "Cancel",
|
|
@@ -374,10 +375,10 @@ const $t = { class: "flex flex-col" }, Bt = { key: 1 }, Dt = { class: "flex flex
|
|
|
374
375
|
});
|
|
375
376
|
};
|
|
376
377
|
}
|
|
377
|
-
}),
|
|
378
|
+
}), Je = xt("segment", () => {
|
|
378
379
|
const y = G([]);
|
|
379
380
|
async function k() {
|
|
380
|
-
const f = await
|
|
381
|
+
const f = await mt.readAll({
|
|
381
382
|
limit: 1e3,
|
|
382
383
|
skip: 0,
|
|
383
384
|
sortBy: "_id",
|
|
@@ -390,9 +391,9 @@ const $t = { class: "flex flex-col" }, Bt = { key: 1 }, Dt = { class: "flex flex
|
|
|
390
391
|
read: k
|
|
391
392
|
};
|
|
392
393
|
});
|
|
393
|
-
class
|
|
394
|
+
class Ot extends _t {
|
|
394
395
|
}
|
|
395
|
-
const
|
|
396
|
+
const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" }, Ut = { class: "hidden xs:flex items-center justify-end" }, Lt = { class: "flex items-center justify-between mb-4" }, zt = { class: "flex items-center justify-between gap-x-8" }, jt = { class: "fm-typo-en-body-lg-600" }, qt = { class: "px-4 py-0.5 rounded-md bg-fm-color-neutral-gray-100 fm-typo-en-body-md-600" }, Kt = { class: "xs:hidden flex justify-between gap-x-4" }, Te = /* @__PURE__ */ be({
|
|
396
397
|
__name: "MemberCollectionTable",
|
|
397
398
|
props: {
|
|
398
399
|
member: {
|
|
@@ -423,18 +424,18 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
423
424
|
setup(y) {
|
|
424
425
|
const k = y, f = G({
|
|
425
426
|
search: ""
|
|
426
|
-
}), x = G(!1), { tableMeta: s, rowData: o, onSort: g, debouncedFetchData: m, onSearch: C } =
|
|
427
|
-
const
|
|
427
|
+
}), x = G(!1), { tableMeta: s, rowData: o, onSort: g, debouncedFetchData: m, onSearch: C } = Ke(async (v) => {
|
|
428
|
+
const I = {
|
|
428
429
|
...f.value,
|
|
429
430
|
...k.filters
|
|
430
431
|
};
|
|
431
432
|
return await Me.readCollectionsByMemberId(
|
|
432
433
|
k.member._id.toString(),
|
|
433
434
|
v,
|
|
434
|
-
|
|
435
|
+
I
|
|
435
436
|
);
|
|
436
437
|
});
|
|
437
|
-
|
|
438
|
+
Le(
|
|
438
439
|
f,
|
|
439
440
|
() => {
|
|
440
441
|
m();
|
|
@@ -448,11 +449,11 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
448
449
|
...f.value,
|
|
449
450
|
...k.filters
|
|
450
451
|
};
|
|
451
|
-
await
|
|
452
|
-
exporter: new
|
|
453
|
-
readFunction: (
|
|
452
|
+
await St({
|
|
453
|
+
exporter: new Ot(),
|
|
454
|
+
readFunction: (I) => Me.readCollectionsByMemberId(
|
|
454
455
|
k.member._id.toString(),
|
|
455
|
-
|
|
456
|
+
I,
|
|
456
457
|
v
|
|
457
458
|
),
|
|
458
459
|
transformRecord: k.transformExportRecord,
|
|
@@ -464,17 +465,17 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
464
465
|
x.value = !1;
|
|
465
466
|
}
|
|
466
467
|
}
|
|
467
|
-
return
|
|
468
|
+
return rt(async () => {
|
|
468
469
|
await m();
|
|
469
|
-
}), (v,
|
|
470
|
-
const D =
|
|
471
|
-
return p(), A("div",
|
|
472
|
-
n("div",
|
|
470
|
+
}), (v, I) => {
|
|
471
|
+
const D = V("FmSearch"), L = V("FmButton");
|
|
472
|
+
return p(), A("div", Rt, [
|
|
473
|
+
n("div", Ut, [
|
|
473
474
|
_(D, {
|
|
474
475
|
class: "hidden xs:flex",
|
|
475
476
|
modelValue: t(f).search,
|
|
476
477
|
"onUpdate:modelValue": [
|
|
477
|
-
|
|
478
|
+
I[0] || (I[0] = (P) => t(f).search = P),
|
|
478
479
|
t(C)
|
|
479
480
|
],
|
|
480
481
|
placeholder: "Search",
|
|
@@ -487,16 +488,16 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
487
488
|
onClick: u
|
|
488
489
|
})) : ce("", !0)
|
|
489
490
|
]),
|
|
490
|
-
n("div",
|
|
491
|
-
n("div",
|
|
492
|
-
n("div",
|
|
493
|
-
n("div",
|
|
491
|
+
n("div", Lt, [
|
|
492
|
+
n("div", zt, [
|
|
493
|
+
n("div", jt, $(k.title), 1),
|
|
494
|
+
n("div", qt, $(t(s).totalRows), 1)
|
|
494
495
|
]),
|
|
495
|
-
n("div",
|
|
496
|
+
n("div", Kt, [
|
|
496
497
|
_(D, {
|
|
497
498
|
modelValue: t(f).search,
|
|
498
499
|
"onUpdate:modelValue": [
|
|
499
|
-
|
|
500
|
+
I[1] || (I[1] = (P) => t(f).search = P),
|
|
500
501
|
t(C)
|
|
501
502
|
],
|
|
502
503
|
placeholder: "Search"
|
|
@@ -509,7 +510,7 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
509
510
|
})) : ce("", !0)
|
|
510
511
|
])
|
|
511
512
|
]),
|
|
512
|
-
_(
|
|
513
|
+
_(Ge, {
|
|
513
514
|
loading: t(s).isLoading,
|
|
514
515
|
"row-data": t(o),
|
|
515
516
|
"row-count": t(s).totalRows,
|
|
@@ -519,7 +520,7 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
519
520
|
"page-size": t(s).pageSize,
|
|
520
521
|
"shrink-at": !1,
|
|
521
522
|
onSortChange: t(g),
|
|
522
|
-
onPageChange:
|
|
523
|
+
onPageChange: I[2] || (I[2] = (P) => t(m)({
|
|
523
524
|
pageSize: P.pageSize,
|
|
524
525
|
pageIndex: P.pageIndex
|
|
525
526
|
}))
|
|
@@ -527,7 +528,7 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
527
528
|
]);
|
|
528
529
|
};
|
|
529
530
|
}
|
|
530
|
-
}),
|
|
531
|
+
}), Gt = /* @__PURE__ */ be({
|
|
531
532
|
__name: "MemberVouchers",
|
|
532
533
|
props: {
|
|
533
534
|
member: {
|
|
@@ -573,7 +574,7 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
573
574
|
header: "Transfer open",
|
|
574
575
|
accessorFn: (o) => {
|
|
575
576
|
var g, m, C;
|
|
576
|
-
return
|
|
577
|
+
return ht((C = (m = (g = o.pf_collectible) == null ? void 0 : g.options) == null ? void 0 : m.enableTransfer) == null ? void 0 : C.toString());
|
|
577
578
|
},
|
|
578
579
|
enableSorting: !1
|
|
579
580
|
}
|
|
@@ -581,7 +582,7 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
581
582
|
type: ke.enum.VOUCHER,
|
|
582
583
|
isActive: o
|
|
583
584
|
}), s = (o) => {
|
|
584
|
-
var g, m, C, u, v,
|
|
585
|
+
var g, m, C, u, v, I, D;
|
|
585
586
|
return {
|
|
586
587
|
CollectionID: o._id,
|
|
587
588
|
Title: (g = o.pf_collectible) == null ? void 0 : g.name,
|
|
@@ -589,7 +590,7 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
589
590
|
"D MMM YYYY, hh:mmA"
|
|
590
591
|
),
|
|
591
592
|
ExpiredAt: (C = (m = o.expiryBalance) == null ? void 0 : m[0]) != null && C.expiredAt ? S((v = (u = o.expiryBalance) == null ? void 0 : u[0]) == null ? void 0 : v.expiredAt).format("D MMM YYYY") : "",
|
|
592
|
-
TransferOpen: ((D = (
|
|
593
|
+
TransferOpen: ((D = (I = o.pf_collectible) == null ? void 0 : I.options) == null ? void 0 : D.enableTransfer) || !1
|
|
593
594
|
};
|
|
594
595
|
};
|
|
595
596
|
return (o, g) => (p(), A(q, null, [
|
|
@@ -612,7 +613,7 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
612
613
|
}, null, 8, ["member", "filters"])
|
|
613
614
|
], 64));
|
|
614
615
|
}
|
|
615
|
-
}),
|
|
616
|
+
}), Ht = /* @__PURE__ */ be({
|
|
616
617
|
__name: "MemberMissions",
|
|
617
618
|
props: {
|
|
618
619
|
member: {
|
|
@@ -641,7 +642,7 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
641
642
|
header: "Type",
|
|
642
643
|
accessorFn: (s) => {
|
|
643
644
|
var o, g, m;
|
|
644
|
-
return
|
|
645
|
+
return Pe.title(((m = (g = (o = s == null ? void 0 : s.pf_collectible) == null ? void 0 : o.extras) == null ? void 0 : g.mission) == null ? void 0 : m.type) || "-");
|
|
645
646
|
},
|
|
646
647
|
enableSorting: !1
|
|
647
648
|
},
|
|
@@ -654,12 +655,12 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
654
655
|
upcoming: "text-fm-color-typo-info bg-fm-color-system-info-100",
|
|
655
656
|
completed: "text-fm-color-typo-success bg-fm-color-system-success-100",
|
|
656
657
|
expired: "text-fm-color-typo-error bg-fm-color-system-error-100"
|
|
657
|
-
}, g =
|
|
658
|
+
}, g = Ct(
|
|
658
659
|
s.row.original.pf_campaign
|
|
659
660
|
), C = s.row.original.balance === s.row.original.pf_collectible.extras.mission.end && g === "active" ? "completed" : g;
|
|
660
661
|
return K(ve.FmChip, {
|
|
661
662
|
class: o[C],
|
|
662
|
-
label:
|
|
663
|
+
label: Pe.title(C),
|
|
663
664
|
compact: !0
|
|
664
665
|
});
|
|
665
666
|
}
|
|
@@ -673,7 +674,7 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
673
674
|
},
|
|
674
675
|
{
|
|
675
676
|
header: "Summary",
|
|
676
|
-
accessorFn: (s) => s != null && s.pf_campaign ?
|
|
677
|
+
accessorFn: (s) => s != null && s.pf_campaign ? wt(s.pf_campaign) : "Deleted Campaign",
|
|
677
678
|
enableSorting: !1
|
|
678
679
|
},
|
|
679
680
|
{
|
|
@@ -702,7 +703,7 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
702
703
|
}, null, 8, ["member"])
|
|
703
704
|
], 64));
|
|
704
705
|
}
|
|
705
|
-
}),
|
|
706
|
+
}), Wt = /* @__PURE__ */ be({
|
|
706
707
|
__name: "MemberGames",
|
|
707
708
|
props: {
|
|
708
709
|
member: {
|
|
@@ -763,19 +764,19 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
763
764
|
}, null, 8, ["member", "filters"])
|
|
764
765
|
], 64));
|
|
765
766
|
}
|
|
766
|
-
}),
|
|
767
|
+
}), Jt = { class: "flex flex-col flex-nowrap gap-y-24 max-h-full" }, Xt = { class: "grid md:grid-cols-2 lg:grid-cols-2 gap-x-36 gap-y-24" }, Qt = { class: "space-y-16" }, Zt = { class: "flex gap-16 items-center" }, eo = { class: "flex-auto" }, to = { class: "fm-typo-en-body-md-600" }, oo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, no = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ao = { class: "fm-typo-en-body-md-800" }, ro = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, so = { class: "fm-typo-en-body-md-800" }, io = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lo = { class: "fm-typo-en-body-md-600" }, co = { class: "gap-16 grid grid-cols-1" }, mo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, uo = { class: "fm-typo-en-body-md-600" }, po = { class: "p-16 grid md:grid-cols-3 lg:grid-cols-3 border-2 border-fm-color-neutral-gray-100 rounded-lg gap-16 divide-y md:divide-y-0 lg:divide-y-0 md:divide-x lg:divide-x divide-fm-color-neutral-gray-100" }, fo = { class: "flex justify-between mb-16" }, bo = { class: "fm-typo-en-title-sm-600" }, yo = ["onClick"], go = { class: "flex flex-col gap-y-16" }, vo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, xo = { class: "fm-typo-en-body-md-600" }, ho = { class: "space-y-8" }, _o = {
|
|
767
768
|
key: 0,
|
|
768
769
|
class: "space-x-8"
|
|
769
|
-
},
|
|
770
|
+
}, So = {
|
|
770
771
|
key: 1,
|
|
771
772
|
class: "text-fm-color-typo-secondary"
|
|
772
|
-
},
|
|
773
|
+
}, Co = { class: "space-y-8" }, wo = ["src"], Fo = { class: "fm-typo-en-body-md-600" }, Mo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, To = {
|
|
773
774
|
key: 1,
|
|
774
775
|
class: "text-fm-color-typo-secondary"
|
|
775
|
-
},
|
|
776
|
+
}, ko = {
|
|
776
777
|
key: 1,
|
|
777
778
|
class: "space-y-24"
|
|
778
|
-
},
|
|
779
|
+
}, Ao = { class: "space-y-8" }, Eo = { class: "fm-typo-en-title-md-800" }, Vo = { class: "space-y-4" }, Io = { class: "fm-typo-en-body-md-600" }, $o = { class: "flex gap-24 items-center xs:flex-col xs:items-start" }, Bo = { class: "space-y-8" }, Do = { class: "fm-typo-en-title-md-800" }, No = { class: "space-y-4" }, Yo = { class: "fm-typo-en-body-md-600" }, Po = { class: "flex gap-24 items-center xs:flex-col xs:items-start" }, Oo = /* @__PURE__ */ be({
|
|
779
780
|
__name: "MemberDetailSheet",
|
|
780
781
|
props: {
|
|
781
782
|
member: {
|
|
@@ -785,7 +786,7 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
785
786
|
},
|
|
786
787
|
emits: ["update:member"],
|
|
787
788
|
setup(y, { expose: k, emit: f }) {
|
|
788
|
-
const x =
|
|
789
|
+
const x = He(), s = qe(), o = Ve(), g = Je(), m = Ee(), { minor: C } = je, u = y, v = f, I = H(() => s.locations.map((a) => ({
|
|
789
790
|
label: a.name,
|
|
790
791
|
value: a._id
|
|
791
792
|
}))), D = H(() => (u.member.segment || []).map((a) => {
|
|
@@ -829,11 +830,11 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
829
830
|
stats: [
|
|
830
831
|
{
|
|
831
832
|
label: "Stamp missions",
|
|
832
|
-
getter: () => ee(
|
|
833
|
+
getter: () => ee(i.value.stamp, 0)
|
|
833
834
|
},
|
|
834
835
|
{
|
|
835
836
|
label: "Progress missions",
|
|
836
|
-
getter: () => ee(
|
|
837
|
+
getter: () => ee(i.value.progressive, 0)
|
|
837
838
|
}
|
|
838
839
|
]
|
|
839
840
|
},
|
|
@@ -874,7 +875,7 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
874
875
|
switch (a.stopPropagation(), e) {
|
|
875
876
|
case "Store bundle":
|
|
876
877
|
await x.push({
|
|
877
|
-
name:
|
|
878
|
+
name: We["$connect-LOYALTY_MEMBER_TRANSACTIONS"],
|
|
878
879
|
params: { id: u.member._id.toString() },
|
|
879
880
|
query: { tab: "store" }
|
|
880
881
|
});
|
|
@@ -887,7 +888,7 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
887
888
|
async function W(a, e) {
|
|
888
889
|
m.open({
|
|
889
890
|
title: "",
|
|
890
|
-
dialogComponent:
|
|
891
|
+
dialogComponent: Pt,
|
|
891
892
|
dialogComponentProps: {
|
|
892
893
|
type: a,
|
|
893
894
|
action: e,
|
|
@@ -918,7 +919,7 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
918
919
|
async function re() {
|
|
919
920
|
m.open({
|
|
920
921
|
title: "Update member statistics",
|
|
921
|
-
contentComponent:
|
|
922
|
+
contentComponent: Bt,
|
|
922
923
|
contentComponentProps: {
|
|
923
924
|
member: u.member,
|
|
924
925
|
onSubmit: async (a) => {
|
|
@@ -944,7 +945,7 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
944
945
|
label: "Tier",
|
|
945
946
|
getter: (a) => {
|
|
946
947
|
var se, me, ye, h, Y;
|
|
947
|
-
const e = (((me =
|
|
948
|
+
const e = (((me = Ne.first((se = u.member.collection) == null ? void 0 : se.TIER)) == null ? void 0 : me.balance) || 0) - 1, b = M.value.name, B = ((h = (ye = a.collection) == null ? void 0 : ye.POINT) == null ? void 0 : h[0].balance) ?? 0, N = o.sortedTiers[e + 1], X = ((Y = N == null ? void 0 : N.option) == null ? void 0 : Y.to) ?? 1 / 0;
|
|
948
949
|
return `${b} (${B}/${X})`;
|
|
949
950
|
}
|
|
950
951
|
},
|
|
@@ -956,7 +957,7 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
956
957
|
label: "Birthday",
|
|
957
958
|
getter: (a) => a.birthday ? S(a.birthday).format("D MMM YYYY") : "-"
|
|
958
959
|
}
|
|
959
|
-
],
|
|
960
|
+
], l = [
|
|
960
961
|
{
|
|
961
962
|
label: "Customer since",
|
|
962
963
|
getter: (a) => S(Ce(a._id.toString())).format("D MMM YYYY")
|
|
@@ -965,12 +966,12 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
965
966
|
label: "Joined at location",
|
|
966
967
|
getter: (a) => {
|
|
967
968
|
var e;
|
|
968
|
-
return a != null && a.location && ((e =
|
|
969
|
+
return a != null && a.location && ((e = I.value.find((b) => b.value == a.location)) == null ? void 0 : e.label) || "-";
|
|
969
970
|
}
|
|
970
971
|
},
|
|
971
972
|
{
|
|
972
973
|
label: "Total visit(s)",
|
|
973
|
-
getter: (a) =>
|
|
974
|
+
getter: (a) => Oe.singularOrPlural(a.stats.visitCount, "bill")
|
|
974
975
|
},
|
|
975
976
|
{
|
|
976
977
|
label: "Last visit",
|
|
@@ -978,14 +979,14 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
978
979
|
},
|
|
979
980
|
{
|
|
980
981
|
label: "Frequency",
|
|
981
|
-
getter: (a) => `Every ${
|
|
982
|
+
getter: (a) => `Every ${Oe.singularOrPlural(
|
|
982
983
|
Number(Math.ceil(a.stats.avgVisitFrequency).toFixed(0)),
|
|
983
984
|
"day"
|
|
984
985
|
)}`
|
|
985
986
|
},
|
|
986
987
|
{
|
|
987
988
|
label: "Average spend",
|
|
988
|
-
getter: (a) =>
|
|
989
|
+
getter: (a) => ut.Dinero.fromNumber({ number: Number(a.stats.avgBillSize || 0) }).toFormat(
|
|
989
990
|
!0
|
|
990
991
|
)
|
|
991
992
|
}
|
|
@@ -1003,7 +1004,7 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1003
1004
|
// },
|
|
1004
1005
|
], M = H(() => {
|
|
1005
1006
|
var b, B;
|
|
1006
|
-
const a = (((B =
|
|
1007
|
+
const a = (((B = Ne.first((b = u.member.collection) == null ? void 0 : b.TIER)) == null ? void 0 : B.balance) || 0) - 1, e = o.sortedTiers[a];
|
|
1007
1008
|
return { name: (e == null ? void 0 : e.name) || "-", tier: a, config: e };
|
|
1008
1009
|
}), r = H(() => {
|
|
1009
1010
|
var a;
|
|
@@ -1020,7 +1021,7 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1020
1021
|
}).filter(
|
|
1021
1022
|
(e) => e.expiredAt ? S(e.expiredAt).isAfter(S()) : !0
|
|
1022
1023
|
);
|
|
1023
|
-
}),
|
|
1024
|
+
}), i = G({ stamp: 0, progressive: 0 }), w = G({ active: 0, past: 0 }), T = G([]), O = H(
|
|
1024
1025
|
() => T.value.reduce((a, e) => a + e.count, 0)
|
|
1025
1026
|
), E = G(!0);
|
|
1026
1027
|
function U() {
|
|
@@ -1054,24 +1055,24 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1054
1055
|
w.value = await Me.readCollectionCountByMemberId(
|
|
1055
1056
|
u.member._id.toString(),
|
|
1056
1057
|
ke.enum.VOUCHER
|
|
1057
|
-
), T.value = await
|
|
1058
|
+
), T.value = await Ft.readPurchaseCountByMember(
|
|
1058
1059
|
u.member._id.toString()
|
|
1059
|
-
),
|
|
1060
|
+
), i.value = await Me.readMissionCountByMemberId(
|
|
1060
1061
|
u.member._id.toString()
|
|
1061
1062
|
);
|
|
1062
1063
|
};
|
|
1063
|
-
return
|
|
1064
|
+
return ze(async () => {
|
|
1064
1065
|
await o.readMembership(), await J(), s.locations.length || await s.readLocations();
|
|
1065
|
-
}),
|
|
1066
|
+
}), Le(E, async () => {
|
|
1066
1067
|
await J();
|
|
1067
1068
|
}), k({
|
|
1068
1069
|
showSheet: U,
|
|
1069
1070
|
hideSheet: te
|
|
1070
1071
|
}), (a, e) => {
|
|
1071
|
-
const b =
|
|
1072
|
+
const b = V("FmTabs"), B = V("FmAvatar"), N = V("FmButton"), X = V("FmIcon"), se = V("FmChip"), me = V("FmCard"), ye = V("FmSideSheet");
|
|
1072
1073
|
return p(), R(ye, {
|
|
1073
1074
|
modelValue: t(E),
|
|
1074
|
-
"onUpdate:modelValue": e[5] || (e[5] = (h) =>
|
|
1075
|
+
"onUpdate:modelValue": e[5] || (e[5] = (h) => st(E) ? E.value = h : null),
|
|
1075
1076
|
header: "Member Detail",
|
|
1076
1077
|
"dismiss-away": "",
|
|
1077
1078
|
"close-button": !0,
|
|
@@ -1079,7 +1080,7 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1079
1080
|
}, {
|
|
1080
1081
|
"side-sheet-footer": xe(() => e[19] || (e[19] = [])),
|
|
1081
1082
|
default: xe(() => [
|
|
1082
|
-
n("div",
|
|
1083
|
+
n("div", Jt, [
|
|
1083
1084
|
n("div", null, [
|
|
1084
1085
|
_(b, {
|
|
1085
1086
|
"model-value": t(F).value,
|
|
@@ -1089,26 +1090,26 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1089
1090
|
}, null, 8, ["model-value"])
|
|
1090
1091
|
]),
|
|
1091
1092
|
t(F).value == "overview" ? (p(), A(q, { key: 0 }, [
|
|
1092
|
-
n("div",
|
|
1093
|
+
n("div", Xt, [
|
|
1093
1094
|
n("div", null, [
|
|
1094
1095
|
e[9] || (e[9] = n("div", { class: "fm-typo-en-title-sm-800 mb-16" }, "Profile Information", -1)),
|
|
1095
|
-
n("div",
|
|
1096
|
-
n("div",
|
|
1096
|
+
n("div", Qt, [
|
|
1097
|
+
n("div", Zt, [
|
|
1097
1098
|
_(B, {
|
|
1098
1099
|
name: y.member.photoUrl ? void 0 : y.member.name,
|
|
1099
1100
|
src: y.member.photoUrl || void 0
|
|
1100
1101
|
}, null, 8, ["name", "src"]),
|
|
1101
|
-
n("div",
|
|
1102
|
+
n("div", eo, [
|
|
1102
1103
|
e[8] || (e[8] = n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Member Name ", -1)),
|
|
1103
|
-
n("div",
|
|
1104
|
-
n("div",
|
|
1105
|
-
n("div",
|
|
1104
|
+
n("div", to, $(y.member.name), 1),
|
|
1105
|
+
n("div", oo, $(y.member._id), 1),
|
|
1106
|
+
n("div", no, [
|
|
1106
1107
|
e[6] || (e[6] = Fe(" Member Card: ")),
|
|
1107
|
-
n("span",
|
|
1108
|
+
n("span", ao, $(y.member.cardNo ? y.member.cardNo : "-"), 1)
|
|
1108
1109
|
]),
|
|
1109
|
-
n("div",
|
|
1110
|
+
n("div", ro, [
|
|
1110
1111
|
e[7] || (e[7] = Fe(" Referral Code: ")),
|
|
1111
|
-
n("span",
|
|
1112
|
+
n("span", so, $(y.member.referralCode ? y.member.referralCode : "-"), 1)
|
|
1112
1113
|
])
|
|
1113
1114
|
]),
|
|
1114
1115
|
_(N, {
|
|
@@ -1118,31 +1119,31 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1118
1119
|
})
|
|
1119
1120
|
]),
|
|
1120
1121
|
(p(), A(q, null, ie(d, (h, Y) => n("div", { key: Y }, [
|
|
1121
|
-
n("div",
|
|
1122
|
-
n("div",
|
|
1122
|
+
n("div", io, $(h.label), 1),
|
|
1123
|
+
n("div", lo, $(h.key ? y.member[h.key] : h.getter(y.member)), 1)
|
|
1123
1124
|
])), 64))
|
|
1124
1125
|
])
|
|
1125
1126
|
]),
|
|
1126
1127
|
n("div", null, [
|
|
1127
1128
|
e[10] || (e[10] = n("div", { class: "fm-typo-en-title-sm-800 mb-16" }, "Activities", -1)),
|
|
1128
|
-
n("div",
|
|
1129
|
-
(p(), A(q, null, ie(
|
|
1129
|
+
n("div", co, [
|
|
1130
|
+
(p(), A(q, null, ie(l, (h) => n("div", {
|
|
1130
1131
|
key: h.key
|
|
1131
1132
|
}, [
|
|
1132
|
-
n("div",
|
|
1133
|
-
n("div",
|
|
1133
|
+
n("div", mo, $(h.label), 1),
|
|
1134
|
+
n("div", uo, $(h.key ? u.member.stats[h.key] || "-" : h.getter(y.member)), 1)
|
|
1134
1135
|
])), 64))
|
|
1135
1136
|
])
|
|
1136
1137
|
])
|
|
1137
1138
|
]),
|
|
1138
1139
|
e[13] || (e[13] = n("div", { class: "border-fm-color-neutral-gray-100 rounded-sm border-t" }, null, -1)),
|
|
1139
|
-
(p(!0), A(q, null, ie(t(de), (h) => (p(), A("div",
|
|
1140
|
+
(p(!0), A(q, null, ie(t(de), (h) => (p(), A("div", po, [
|
|
1140
1141
|
(p(!0), A(q, null, ie(h, (Y, oe) => (p(), A("div", { key: oe }, [
|
|
1141
1142
|
n("div", {
|
|
1142
|
-
class:
|
|
1143
|
+
class: it(oe !== 0 ? "pt-12 md:pt-0 lg:pt-0 md:pl-12 lg:pl-12" : "")
|
|
1143
1144
|
}, [
|
|
1144
|
-
n("div",
|
|
1145
|
-
n("div",
|
|
1145
|
+
n("div", fo, [
|
|
1146
|
+
n("div", bo, $(Y.label), 1),
|
|
1146
1147
|
n("button", {
|
|
1147
1148
|
onClick: (j) => ae(j, Y.label)
|
|
1148
1149
|
}, [
|
|
@@ -1151,45 +1152,45 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1151
1152
|
outline: "",
|
|
1152
1153
|
size: "md"
|
|
1153
1154
|
})
|
|
1154
|
-
], 8,
|
|
1155
|
+
], 8, yo)
|
|
1155
1156
|
]),
|
|
1156
|
-
n("div",
|
|
1157
|
+
n("div", go, [
|
|
1157
1158
|
(p(!0), A(q, null, ie(Y.stats, (j) => (p(), A("div", {
|
|
1158
1159
|
key: j.key
|
|
1159
1160
|
}, [
|
|
1160
|
-
n("div",
|
|
1161
|
-
n("div",
|
|
1161
|
+
n("div", vo, $(j.label), 1),
|
|
1162
|
+
n("div", xo, $(j.getter(y.member)), 1)
|
|
1162
1163
|
]))), 128))
|
|
1163
1164
|
])
|
|
1164
1165
|
], 2)
|
|
1165
1166
|
]))), 128))
|
|
1166
1167
|
]))), 256)),
|
|
1167
|
-
n("div",
|
|
1168
|
+
n("div", ho, [
|
|
1168
1169
|
e[11] || (e[11] = n("div", { class: "fm-typo-en-title-sm-800" }, "Segments", -1)),
|
|
1169
|
-
t(D).length ? (p(), A("div",
|
|
1170
|
+
t(D).length ? (p(), A("div", _o, [
|
|
1170
1171
|
(p(!0), A(q, null, ie(t(D), (h) => (p(), R(se, {
|
|
1171
1172
|
label: h.toString()
|
|
1172
1173
|
}, null, 8, ["label"]))), 256))
|
|
1173
|
-
])) : (p(), A("div",
|
|
1174
|
+
])) : (p(), A("div", So, "No titles"))
|
|
1174
1175
|
]),
|
|
1175
1176
|
e[14] || (e[14] = n("div", { class: "border-fm-color-neutral-gray-100 rounded-sm border-t" }, null, -1)),
|
|
1176
|
-
n("div",
|
|
1177
|
+
n("div", Co, [
|
|
1177
1178
|
e[12] || (e[12] = n("div", { class: "fm-typo-en-title-sm-800" }, "Title badge", -1)),
|
|
1178
1179
|
t(r).length ? (p(!0), A(q, { key: 0 }, ie(t(r).filter((h) => h.collectible), (h) => (p(), A("div", {
|
|
1179
1180
|
class: "flex items-center gap-x-8 h-48",
|
|
1180
1181
|
key: h.name
|
|
1181
1182
|
}, [
|
|
1182
1183
|
n("img", {
|
|
1183
|
-
src: h.collectible.image || t(
|
|
1184
|
+
src: h.collectible.image || t(pt),
|
|
1184
1185
|
class: "aspect-square h-full object-contain"
|
|
1185
|
-
}, null, 8,
|
|
1186
|
+
}, null, 8, wo),
|
|
1186
1187
|
n("div", null, [
|
|
1187
|
-
n("div",
|
|
1188
|
-
n("div",
|
|
1188
|
+
n("div", Fo, $(h.name), 1),
|
|
1189
|
+
n("div", Mo, " Expired on " + $(t(S)(h.expiredAt).format("MMM D, Y")), 1)
|
|
1189
1190
|
])
|
|
1190
|
-
]))), 128)) : (p(), A("div",
|
|
1191
|
+
]))), 128)) : (p(), A("div", To, "No titles"))
|
|
1191
1192
|
])
|
|
1192
|
-
], 64)) : t(F).value == "loyalty" ? (p(), A("div",
|
|
1193
|
+
], 64)) : t(F).value == "loyalty" ? (p(), A("div", ko, [
|
|
1193
1194
|
_(me, {
|
|
1194
1195
|
class: "p-16 space-y-24",
|
|
1195
1196
|
variant: "outlined"
|
|
@@ -1197,18 +1198,18 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1197
1198
|
default: xe(() => {
|
|
1198
1199
|
var h, Y, oe, j, ue, pe, fe;
|
|
1199
1200
|
return [
|
|
1200
|
-
n("div",
|
|
1201
|
+
n("div", Ao, [
|
|
1201
1202
|
e[15] || (e[15] = n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Credit ", -1)),
|
|
1202
|
-
n("div",
|
|
1203
|
+
n("div", Eo, $(((oe = (Y = (h = y.member.collection) == null ? void 0 : h.CREDIT) == null ? void 0 : Y[0]) == null ? void 0 : oe.balance) ?? 0), 1)
|
|
1203
1204
|
]),
|
|
1204
|
-
n("div",
|
|
1205
|
+
n("div", Vo, [
|
|
1205
1206
|
e[16] || (e[16] = n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Credit(s) to be expired in 30 days ", -1)),
|
|
1206
|
-
n("div",
|
|
1207
|
+
n("div", Io, $(((fe = (pe = (ue = (j = y.member.collection) == null ? void 0 : j.CREDIT) == null ? void 0 : ue[0]) == null ? void 0 : pe.expiryBalance) == null ? void 0 : fe.reduce(
|
|
1207
1208
|
(Q, Z) => Z.expiredAt && t(S)(Z.expiredAt).isAfter(t(S)()) && t(S)(Z.expiredAt).isBefore(t(S)().add(30, "days")) ? Q + Z.amount : Q,
|
|
1208
1209
|
0
|
|
1209
1210
|
)) ?? 0), 1)
|
|
1210
1211
|
]),
|
|
1211
|
-
n("div",
|
|
1212
|
+
n("div", $o, [
|
|
1212
1213
|
_(N, {
|
|
1213
1214
|
label: "Add credit",
|
|
1214
1215
|
icon: "add",
|
|
@@ -1233,18 +1234,18 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1233
1234
|
default: xe(() => {
|
|
1234
1235
|
var h, Y, oe, j, ue, pe, fe;
|
|
1235
1236
|
return [
|
|
1236
|
-
n("div",
|
|
1237
|
+
n("div", Bo, [
|
|
1237
1238
|
e[17] || (e[17] = n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Point ", -1)),
|
|
1238
|
-
n("div",
|
|
1239
|
+
n("div", Do, $(((oe = (Y = (h = y.member.collection) == null ? void 0 : h.COIN) == null ? void 0 : Y[0]) == null ? void 0 : oe.balance) ?? 0), 1)
|
|
1239
1240
|
]),
|
|
1240
|
-
n("div",
|
|
1241
|
+
n("div", No, [
|
|
1241
1242
|
e[18] || (e[18] = n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Point(s) to be expired in 30 days ", -1)),
|
|
1242
|
-
n("div",
|
|
1243
|
+
n("div", Yo, $(((fe = (pe = (ue = (j = y.member.collection) == null ? void 0 : j.COIN) == null ? void 0 : ue[0]) == null ? void 0 : pe.expiryBalance) == null ? void 0 : fe.reduce(
|
|
1243
1244
|
(Q, Z) => Z.expiredAt && t(S)(Z.expiredAt).isAfter(t(S)()) && t(S)(Z.expiredAt).isBefore(t(S)().add(30, "days")) ? Q + Z.amount : Q,
|
|
1244
1245
|
0
|
|
1245
1246
|
)) ?? 0), 1)
|
|
1246
1247
|
]),
|
|
1247
|
-
n("div",
|
|
1248
|
+
n("div", Po, [
|
|
1248
1249
|
_(N, {
|
|
1249
1250
|
label: "Add point",
|
|
1250
1251
|
icon: "add",
|
|
@@ -1262,13 +1263,13 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1262
1263
|
}),
|
|
1263
1264
|
_: 1
|
|
1264
1265
|
})
|
|
1265
|
-
])) : t(F).value == "voucher" ? (p(), R(
|
|
1266
|
+
])) : t(F).value == "voucher" ? (p(), R(Gt, {
|
|
1266
1267
|
key: 2,
|
|
1267
1268
|
member: u.member
|
|
1268
|
-
}, null, 8, ["member"])) : t(F).value == "mission" ? (p(), R(
|
|
1269
|
+
}, null, 8, ["member"])) : t(F).value == "mission" ? (p(), R(Ht, {
|
|
1269
1270
|
key: 3,
|
|
1270
1271
|
member: u.member
|
|
1271
|
-
}, null, 8, ["member"])) : t(F).value == "game" ? (p(), R(
|
|
1272
|
+
}, null, 8, ["member"])) : t(F).value == "game" ? (p(), R(Wt, {
|
|
1272
1273
|
key: 4,
|
|
1273
1274
|
member: u.member
|
|
1274
1275
|
}, null, 8, ["member"])) : ce("", !0)
|
|
@@ -1278,18 +1279,23 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1278
1279
|
}, 8, ["modelValue"]);
|
|
1279
1280
|
};
|
|
1280
1281
|
}
|
|
1281
|
-
}),
|
|
1282
|
+
}), Ro = { class: "flex items-center justify-end" }, Cn = /* @__PURE__ */ be({
|
|
1282
1283
|
__name: "MemberList",
|
|
1283
1284
|
setup(y) {
|
|
1284
|
-
const k =
|
|
1285
|
+
const k = Je(), f = Ve(), x = qe(), { minor: s } = je, o = He(), g = [
|
|
1285
1286
|
{
|
|
1286
1287
|
header: "Name",
|
|
1287
1288
|
enableSorting: !0,
|
|
1288
1289
|
accessorKey: "name",
|
|
1289
1290
|
cell(r) {
|
|
1290
|
-
return
|
|
1291
|
+
return Tt(r.row.original);
|
|
1291
1292
|
}
|
|
1292
1293
|
},
|
|
1294
|
+
{
|
|
1295
|
+
header: "Phone",
|
|
1296
|
+
enableSorting: !0,
|
|
1297
|
+
accessorKey: "phoneNumber"
|
|
1298
|
+
},
|
|
1293
1299
|
{
|
|
1294
1300
|
accessorFn: (r) => S(Ce(r._id.toString())).format("D MMM YYYY"),
|
|
1295
1301
|
header: "Customer Since",
|
|
@@ -1301,7 +1307,7 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1301
1307
|
header: "Tier",
|
|
1302
1308
|
enableSorting: !0,
|
|
1303
1309
|
cell(r) {
|
|
1304
|
-
return
|
|
1310
|
+
return kt(
|
|
1305
1311
|
r.row.original,
|
|
1306
1312
|
f.sortedTiers
|
|
1307
1313
|
);
|
|
@@ -1311,7 +1317,7 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1311
1317
|
header: "Title",
|
|
1312
1318
|
enableSorting: !1,
|
|
1313
1319
|
cell(r) {
|
|
1314
|
-
return
|
|
1320
|
+
return At(
|
|
1315
1321
|
r.row.original,
|
|
1316
1322
|
f.sortedTitles
|
|
1317
1323
|
);
|
|
@@ -1320,8 +1326,8 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1320
1326
|
{
|
|
1321
1327
|
accessorKey: "collection_CREDIT_0_balance",
|
|
1322
1328
|
accessorFn: (r) => {
|
|
1323
|
-
var
|
|
1324
|
-
return ee(((T = (w = (
|
|
1329
|
+
var i, w, T;
|
|
1330
|
+
return ee(((T = (w = (i = r.collection) == null ? void 0 : i.CREDIT) == null ? void 0 : w[0]) == null ? void 0 : T.balance) ?? 0, 2);
|
|
1325
1331
|
},
|
|
1326
1332
|
header: "Credit(s)",
|
|
1327
1333
|
enableSorting: !0
|
|
@@ -1329,8 +1335,8 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1329
1335
|
{
|
|
1330
1336
|
accessorKey: "collection_POINT_0_balance",
|
|
1331
1337
|
accessorFn: (r) => {
|
|
1332
|
-
var
|
|
1333
|
-
return ee(((T = (w = (
|
|
1338
|
+
var i, w, T;
|
|
1339
|
+
return ee(((T = (w = (i = r.collection) == null ? void 0 : i.POINT) == null ? void 0 : w[0]) == null ? void 0 : T.balance) ?? 0, 2);
|
|
1334
1340
|
},
|
|
1335
1341
|
header: "Experience(s)",
|
|
1336
1342
|
enableSorting: !0
|
|
@@ -1338,16 +1344,16 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1338
1344
|
{
|
|
1339
1345
|
accessorKey: "collection_COIN_0_balance",
|
|
1340
1346
|
accessorFn: (r) => {
|
|
1341
|
-
var
|
|
1342
|
-
return ee(((T = (w = (
|
|
1347
|
+
var i, w, T;
|
|
1348
|
+
return ee(((T = (w = (i = r.collection) == null ? void 0 : i.COIN) == null ? void 0 : w[0]) == null ? void 0 : T.balance) ?? 0, 2);
|
|
1343
1349
|
},
|
|
1344
1350
|
header: "Point(s)",
|
|
1345
1351
|
enableSorting: !0
|
|
1346
1352
|
},
|
|
1347
1353
|
{
|
|
1348
1354
|
accessorFn: (r) => {
|
|
1349
|
-
var
|
|
1350
|
-
return ((
|
|
1355
|
+
var i;
|
|
1356
|
+
return ((i = r.stats) == null ? void 0 : i.visitCount) ?? 0;
|
|
1351
1357
|
},
|
|
1352
1358
|
header: "Total visit",
|
|
1353
1359
|
accessorKey: "stats.visitCount",
|
|
@@ -1355,21 +1361,21 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1355
1361
|
},
|
|
1356
1362
|
{
|
|
1357
1363
|
accessorFn: (r) => {
|
|
1358
|
-
var
|
|
1359
|
-
return (
|
|
1364
|
+
var i;
|
|
1365
|
+
return (i = r.stats) == null ? void 0 : i.lastVisit;
|
|
1360
1366
|
},
|
|
1361
|
-
sortingFn: (r,
|
|
1367
|
+
sortingFn: (r, i) => {
|
|
1362
1368
|
var w, T;
|
|
1363
|
-
return new Date((w = r.original.stats) == null ? void 0 : w.lastVisit).getTime() - new Date((T =
|
|
1369
|
+
return new Date((w = r.original.stats) == null ? void 0 : w.lastVisit).getTime() - new Date((T = i.original.stats) == null ? void 0 : T.lastVisit).getTime();
|
|
1364
1370
|
},
|
|
1365
1371
|
id: "stats.lastVisit",
|
|
1366
1372
|
header: "Last visit",
|
|
1367
1373
|
cell(r) {
|
|
1368
|
-
var
|
|
1374
|
+
var i, w;
|
|
1369
1375
|
return K("div", { class: "flex items-center justify-end gap-4" }, [
|
|
1370
1376
|
K(
|
|
1371
1377
|
"span",
|
|
1372
|
-
(
|
|
1378
|
+
(i = r.row.original.stats) != null && i.lastVisit ? S((w = r.row.original.stats) == null ? void 0 : w.lastVisit).fromNow() : "NA"
|
|
1373
1379
|
),
|
|
1374
1380
|
K(
|
|
1375
1381
|
ve.FmTooltip,
|
|
@@ -1390,8 +1396,8 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1390
1396
|
ve.FmMenu,
|
|
1391
1397
|
{
|
|
1392
1398
|
placement: "bottom-end",
|
|
1393
|
-
onClick: (
|
|
1394
|
-
|
|
1399
|
+
onClick: (i) => {
|
|
1400
|
+
i.stopPropagation();
|
|
1395
1401
|
}
|
|
1396
1402
|
},
|
|
1397
1403
|
{
|
|
@@ -1399,8 +1405,8 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1399
1405
|
default: () => [
|
|
1400
1406
|
K(ve.FmMenuItem, {
|
|
1401
1407
|
label: "Transaction details",
|
|
1402
|
-
onClick: async (
|
|
1403
|
-
|
|
1408
|
+
onClick: async (i) => {
|
|
1409
|
+
i.stopPropagation(), await re(r.row.original._id);
|
|
1404
1410
|
}
|
|
1405
1411
|
})
|
|
1406
1412
|
]
|
|
@@ -1408,7 +1414,7 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1408
1414
|
);
|
|
1409
1415
|
}
|
|
1410
1416
|
}
|
|
1411
|
-
], { tableMeta: m, rowData: C, onSort: u, debouncedFetchData: v, onSearch:
|
|
1417
|
+
], { tableMeta: m, rowData: C, onSort: u, debouncedFetchData: v, onSearch: I } = Ke(le.read), D = G(), L = G(!1), P = G(), de = H(() => x.locations.map((r) => ({
|
|
1412
1418
|
label: r.name,
|
|
1413
1419
|
value: r._id
|
|
1414
1420
|
})));
|
|
@@ -1422,7 +1428,7 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1422
1428
|
}
|
|
1423
1429
|
async function re(r) {
|
|
1424
1430
|
await o.push({
|
|
1425
|
-
name:
|
|
1431
|
+
name: We["$connect-LOYALTY_MEMBER_TRANSACTIONS"],
|
|
1426
1432
|
params: { id: r }
|
|
1427
1433
|
});
|
|
1428
1434
|
}
|
|
@@ -1433,12 +1439,12 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1433
1439
|
page: 1,
|
|
1434
1440
|
rowsNumber: 0
|
|
1435
1441
|
};
|
|
1436
|
-
function
|
|
1437
|
-
const
|
|
1438
|
-
return
|
|
1442
|
+
function l(r) {
|
|
1443
|
+
const i = S(r);
|
|
1444
|
+
return i.isValid() ? i.format("DD/MM/YYYY") : "";
|
|
1439
1445
|
}
|
|
1440
1446
|
async function M() {
|
|
1441
|
-
const r = new
|
|
1447
|
+
const r = new ct(), i = (await le.read({
|
|
1442
1448
|
limit: 1,
|
|
1443
1449
|
skip: 0,
|
|
1444
1450
|
sortBy: d.sortBy,
|
|
@@ -1446,19 +1452,19 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1446
1452
|
})).meta.totalResources ?? 0, w = d.rowsPerPage;
|
|
1447
1453
|
await s(
|
|
1448
1454
|
async () => {
|
|
1449
|
-
var T, O, E, U, te, z, F, J, a, e, b, B, N, X, se, me, ye, h, Y, oe, j, ue, pe, fe, Q
|
|
1450
|
-
for (let
|
|
1451
|
-
const
|
|
1455
|
+
var T, O, E, U, te, z, F, J, a, e, b, B, N, X, se, me, ye, h, Y, oe, j, ue, pe, fe, Q;
|
|
1456
|
+
for (let Z = 0; Z < i; Z += w) {
|
|
1457
|
+
const Xe = {
|
|
1452
1458
|
...d,
|
|
1453
1459
|
limit: w,
|
|
1454
1460
|
skip: d.page - 1,
|
|
1455
1461
|
sortBy: d.sortBy,
|
|
1456
1462
|
descending: d.descending
|
|
1457
|
-
},
|
|
1458
|
-
for (const
|
|
1459
|
-
const
|
|
1460
|
-
|
|
1461
|
-
)) != null && T.domain.includes("feedmepos.com") ? void 0 :
|
|
1463
|
+
}, Qe = await le.read(Xe);
|
|
1464
|
+
for (const c of Qe.resources) {
|
|
1465
|
+
const Ze = (T = lt.parseOneAddress(
|
|
1466
|
+
c == null ? void 0 : c.email
|
|
1467
|
+
)) != null && T.domain.includes("feedmepos.com") ? void 0 : c.email, et = (E = ((O = c == null ? void 0 : c.collection) == null ? void 0 : O.TITLE) || []) == null ? void 0 : E.reduce(
|
|
1462
1468
|
(ne, ge) => {
|
|
1463
1469
|
var _e, Se;
|
|
1464
1470
|
const he = (Se = (_e = f.sortedTitles) == null ? void 0 : _e.find(
|
|
@@ -1467,55 +1473,54 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1467
1473
|
return !he || ge.balance <= 0 || ne.push(he), ne;
|
|
1468
1474
|
},
|
|
1469
1475
|
[]
|
|
1470
|
-
),
|
|
1476
|
+
), tt = (f.sortedTitles || []).reduce(
|
|
1471
1477
|
(ne, ge) => {
|
|
1472
|
-
var _e, Se, we,
|
|
1473
|
-
const he = (
|
|
1474
|
-
(
|
|
1475
|
-
)) == null ? void 0 : Se.expiryBalance) == null ? void 0 : we[0]) == null ? void 0 :
|
|
1478
|
+
var _e, Se, we, Be;
|
|
1479
|
+
const he = (Be = (we = (Se = (((_e = c == null ? void 0 : c.collection) == null ? void 0 : _e.TITLE) || []).find(
|
|
1480
|
+
(at) => at.collectible === ge._id
|
|
1481
|
+
)) == null ? void 0 : Se.expiryBalance) == null ? void 0 : we[0]) == null ? void 0 : Be.expiredAt;
|
|
1476
1482
|
return ne[ge.name] = he ? S(he).format("DD/MM/YYYY") : "", ne;
|
|
1477
1483
|
},
|
|
1478
1484
|
{}
|
|
1479
|
-
),
|
|
1485
|
+
), ot = ((z = (te = (U = c.collection) == null ? void 0 : U.CREDIT) == null ? void 0 : te.at(0)) == null ? void 0 : z.balance) || 0, Ie = ((e = (a = (J = (F = c.collection) == null ? void 0 : F.CREDIT) == null ? void 0 : J.at(0)) == null ? void 0 : a.expiryBalance) == null ? void 0 : e.reduce(
|
|
1480
1486
|
(ne, ge) => ne + ge.amount,
|
|
1481
1487
|
0
|
|
1482
|
-
)) || 0,
|
|
1483
|
-
ID:
|
|
1484
|
-
Name: ((b =
|
|
1485
|
-
Phone: ((B =
|
|
1486
|
-
Email:
|
|
1487
|
-
Gender:
|
|
1488
|
-
CardNo:
|
|
1489
|
-
Birthday:
|
|
1490
|
-
Credit: (Number(
|
|
1491
|
-
FreeCredit: Number(
|
|
1492
|
-
TotalCredit: Number(
|
|
1493
|
-
Exp:
|
|
1494
|
-
Point:
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
AvgSpent: At(Number(i.stats.avgBillSize || 0)).toFormat(
|
|
1488
|
+
)) || 0, $e = ee(ot, 2), nt = {
|
|
1489
|
+
ID: c._id.toString(),
|
|
1490
|
+
Name: ((b = c.name) == null ? void 0 : b.trim()) || "",
|
|
1491
|
+
Phone: ((B = c == null ? void 0 : c.phoneNumber) == null ? void 0 : B.trim()) || "",
|
|
1492
|
+
Email: Ze || "",
|
|
1493
|
+
Gender: c.gender || "",
|
|
1494
|
+
CardNo: c.cardNo || "",
|
|
1495
|
+
Birthday: c != null && c.birthday ? l(c == null ? void 0 : c.birthday) : "",
|
|
1496
|
+
Credit: (Number($e) - Number(Ie)).toFixed(2),
|
|
1497
|
+
FreeCredit: Number(Ie.toFixed(2)),
|
|
1498
|
+
TotalCredit: Number($e),
|
|
1499
|
+
Exp: c != null && c.collection ? ((se = (X = (N = c.collection) == null ? void 0 : N.POINT) == null ? void 0 : X.at(0)) == null ? void 0 : se.balance) ?? 0 : 0,
|
|
1500
|
+
Point: c != null && c.collection ? ((h = (ye = (me = c.collection) == null ? void 0 : me.COIN) == null ? void 0 : ye.at(0)) == null ? void 0 : h.balance) ?? 0 : 0,
|
|
1501
|
+
Tier: c != null && c.collection ? ((j = (oe = (Y = c.collection) == null ? void 0 : Y.TIER) == null ? void 0 : oe.at(0)) == null ? void 0 : j.balance) ?? 0 : 0,
|
|
1502
|
+
Titles: et.join(","),
|
|
1503
|
+
...tt,
|
|
1504
|
+
TotalTransaction: c.stats.visitCount,
|
|
1505
|
+
AvgSpent: Mt(Number(c.stats.avgBillSize || 0)).toFormat(
|
|
1501
1506
|
!1
|
|
1502
1507
|
),
|
|
1503
|
-
TotalSpent:
|
|
1504
|
-
LastVisit: c
|
|
1505
|
-
Feedback: ((
|
|
1506
|
-
LastSeasonTierEarned: ((
|
|
1507
|
-
LastSeasonPointEarned: ((
|
|
1508
|
-
JoinedAt: c
|
|
1509
|
-
JoinedAtLocation:
|
|
1508
|
+
TotalSpent: c.stats.avgBillSize * c.stats.visitCount,
|
|
1509
|
+
LastVisit: l(c.stats.lastVisit),
|
|
1510
|
+
Feedback: ((ue = c.stats) == null ? void 0 : ue.feedbackCount) || 0,
|
|
1511
|
+
LastSeasonTierEarned: ((pe = c.stats) == null ? void 0 : pe.lastSeasonTierEarned) || 0,
|
|
1512
|
+
LastSeasonPointEarned: ((fe = c.stats) == null ? void 0 : fe.lastSeasonPointEarned) || 0,
|
|
1513
|
+
JoinedAt: l(c.joinAt || void 0),
|
|
1514
|
+
JoinedAtLocation: c.location && ((Q = de.value.find((ne) => ne.value == c.location)) == null ? void 0 : Q.label) || "-",
|
|
1510
1515
|
VisitFrequency: `${Number(
|
|
1511
|
-
Math.ceil(
|
|
1516
|
+
Math.ceil(c.stats.avgVisitFrequency).toFixed(0)
|
|
1512
1517
|
)}`
|
|
1513
1518
|
};
|
|
1514
|
-
r.addRecord(
|
|
1519
|
+
r.addRecord(nt);
|
|
1515
1520
|
}
|
|
1516
1521
|
d.page++;
|
|
1517
1522
|
}
|
|
1518
|
-
await
|
|
1523
|
+
await dt(
|
|
1519
1524
|
r.buildExcel(),
|
|
1520
1525
|
`members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
|
|
1521
1526
|
{
|
|
@@ -1531,18 +1536,18 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1531
1536
|
}
|
|
1532
1537
|
);
|
|
1533
1538
|
}
|
|
1534
|
-
return
|
|
1539
|
+
return ze(async () => {
|
|
1535
1540
|
await f.readMembership(), await x.readLocations(), await k.read(), await x.readLocations(), await v();
|
|
1536
|
-
}), (r,
|
|
1537
|
-
const w =
|
|
1541
|
+
}), (r, i) => {
|
|
1542
|
+
const w = V("FmSearch"), T = V("FmButton"), O = V("FmSnackbar");
|
|
1538
1543
|
return p(), A("div", null, [
|
|
1539
|
-
n("div",
|
|
1544
|
+
n("div", Ro, [
|
|
1540
1545
|
_(w, {
|
|
1541
1546
|
class: "mt-4",
|
|
1542
1547
|
modelValue: t(m).searchValue,
|
|
1543
1548
|
"onUpdate:modelValue": [
|
|
1544
|
-
|
|
1545
|
-
t(
|
|
1549
|
+
i[0] || (i[0] = (E) => t(m).searchValue = E),
|
|
1550
|
+
t(I)
|
|
1546
1551
|
],
|
|
1547
1552
|
placeholder: "Search",
|
|
1548
1553
|
collapsible: ""
|
|
@@ -1553,20 +1558,20 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1553
1558
|
onClick: M
|
|
1554
1559
|
})
|
|
1555
1560
|
]),
|
|
1556
|
-
|
|
1561
|
+
Re(_(O, {
|
|
1557
1562
|
"z-index": 0,
|
|
1558
1563
|
class: "!max-w-full my-16",
|
|
1559
1564
|
title: "Info",
|
|
1560
1565
|
description: "Current list is not up to date, please refresh table for latest data.",
|
|
1561
1566
|
variant: "info",
|
|
1562
1567
|
dismissable: "",
|
|
1563
|
-
onOnDismiss:
|
|
1568
|
+
onOnDismiss: i[1] || (i[1] = (E) => L.value = !1),
|
|
1564
1569
|
action: "Refresh",
|
|
1565
1570
|
onOnAction: W
|
|
1566
1571
|
}, null, 512), [
|
|
1567
|
-
[
|
|
1572
|
+
[Ue, t(L)]
|
|
1568
1573
|
]),
|
|
1569
|
-
_(
|
|
1574
|
+
_(Ge, {
|
|
1570
1575
|
loading: t(m).isLoading,
|
|
1571
1576
|
"row-data": t(C),
|
|
1572
1577
|
"row-count": t(m).totalRows,
|
|
@@ -1576,13 +1581,13 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1576
1581
|
"page-index": t(m).pageIndex,
|
|
1577
1582
|
"page-size": t(m).pageSize,
|
|
1578
1583
|
onSortChange: t(u),
|
|
1579
|
-
onPageChange:
|
|
1580
|
-
onRowClick:
|
|
1584
|
+
onPageChange: i[2] || (i[2] = (E) => t(v)({ pageSize: E.pageSize, pageIndex: E.pageIndex })),
|
|
1585
|
+
onRowClick: i[3] || (i[3] = (E) => {
|
|
1581
1586
|
var U;
|
|
1582
1587
|
P.value = E.original, (U = t(D)) == null || U.showSheet();
|
|
1583
1588
|
})
|
|
1584
1589
|
}, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"]),
|
|
1585
|
-
t(P) ? (p(), R(
|
|
1590
|
+
t(P) ? (p(), R(Oo, {
|
|
1586
1591
|
key: 0,
|
|
1587
1592
|
ref_key: "sheetRef",
|
|
1588
1593
|
ref: D,
|
|
@@ -1594,5 +1599,5 @@ const zt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1594
1599
|
}
|
|
1595
1600
|
});
|
|
1596
1601
|
export {
|
|
1597
|
-
|
|
1602
|
+
Cn as default
|
|
1598
1603
|
};
|