@feedmepos/mf-connect 0.1.127-prod → 0.1.128-dev
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/{App-BMF6m0GU.js → App-CPSC0ccq.js} +224 -216
- package/dist/AuditLogs-CgrYStwa.js +2016 -0
- package/dist/{Bin-Dkn-CjZE.js → Bin-Cn7sCPql.js} +8 -8
- package/dist/{Broadcast-DqaP4ON2.js → Broadcast-bR7HAyV2.js} +22 -21
- package/dist/{CampaignAnalytic-2Iuxh8-x.js → CampaignAnalytic-Dnpw_Jwo.js} +97 -97
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-C8MlNehK.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-HaWMLA4s.js} +9 -10
- package/dist/{Card-Cv9eldq8.js → Card-BE3Y0KHF.js} +23 -23
- package/dist/{Collections-CK-hxHpa.js → Collections-CLSp9Uah.js} +197 -185
- package/dist/{Credit-CDE4ACVm.js → Credit-DgMyKROt.js} +21 -20
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-CTvIDOWy.js → DateRangeChip.vue_vue_type_script_setup_true_lang-D8eCQE4D.js} +1 -1
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BB2gszsG.js +4584 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CuPhm1uG.js → EffectSheet.vue_vue_type_style_index_0_lang-CXw7yS8N.js} +33 -33
- package/dist/{Experience-lLK_RR69.js → Experience-CCeRbvIe.js} +32 -31
- package/dist/{FileSaver.min-zDxJKfBO.js → FileSaver.min-D8Rw2VVN.js} +1 -1
- package/dist/{Game-DCdfJkil.js → Game-CYGg8vWQ.js} +19 -18
- package/dist/{GiftCardSetup-DfF1OpFk.js → GiftCardSetup-rzea90xr.js} +31 -31
- package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-Dbx9bwJM.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-BFUBfL-S.js} +140 -128
- package/dist/{Goals-t0wbcWxG.js → Goals-BnZfK7a3.js} +4 -4
- package/dist/Grab-BRbn6ffm.js +301 -0
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-Bur6iCYa.js → ImageInput.vue_vue_type_script_setup_true_lang-Cw2imjlQ.js} +1 -1
- package/dist/{Index-BUF8U-h8.js → Index-DjZi_lVg.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-kIOc-Px5.js → LocationPicker.vue_vue_type_script_setup_true_lang-B1q4NtuM.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DRmLpXsg.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CUjzbMcb.js} +1 -1
- package/dist/{LoyaltyDashboard-8laUXBGQ.js → LoyaltyDashboard-C3TZSSQz.js} +82 -82
- package/dist/{MainLayout-BeuKKVNP.js → MainLayout-uNGpBpJi.js} +1 -1
- package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-C7E3h_Zr.js → MainLayout.vue_vue_type_script_setup_true_lang-0PcswtGl.js} +3 -3
- package/dist/{Marketing-DZG0oIs-.js → Marketing-SXmxcw3-.js} +4 -4
- package/dist/{MarketingMaterialEdit--RDayaUN.js → MarketingMaterialEdit-DK0tjHpF.js} +214 -211
- package/dist/{Member-DeEQr2ef.js → Member-BFSwupq6.js} +7 -7
- package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-Dvcasf5O.js +1322 -0
- package/dist/{MemberImportHistory-DMXVl1qI.js → MemberImportHistory-z12l_IAQ.js} +7 -7
- package/dist/{MemberList-zqeFDkEZ.js → MemberList-DfN7ur0J.js} +103 -105
- package/dist/{MemberTransactions-BBQPNfFG.js → MemberTransactions-Bntt4bRR.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-C_8yL5GL.js → MessageInput.vue_vue_type_script_setup_true_lang-ComtYItw.js} +12 -12
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-9r-eGARm.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-_Imnj16x.js} +1 -1
- package/dist/{Mission-TO8w3ucB.js → Mission-CvpeYVjB.js} +22 -21
- package/dist/{Overview-CPUpEzPd.js → Overview-BkaFC5La.js} +21 -21
- package/dist/{Overview-D6YBYVxK.js → Overview-BtTkltlY.js} +145 -144
- package/dist/{Point-BSq4CRcb.js → Point-CpNAFABM.js} +22 -21
- package/dist/{Promotion-DgPNNfk7.js → Promotion-B_vD_9UF.js} +137 -131
- package/dist/{Queue-CYyabVYT.js → Queue-D5jDhI0f.js} +46 -46
- package/dist/{Record-n7s29IZH.js → Record-EsNXzy4D.js} +9 -9
- package/dist/{Review-DIYulCVl.js → Review-ByMrkymf.js} +2 -2
- package/dist/ReviewFacebookCallback-BDl6NBkw.js +225 -0
- package/dist/{ReviewGoogleCallback-CnESXIH-.js → ReviewGoogleCallback-BzU-hUy5.js} +5 -5
- package/dist/{Reward-D_L2DgT9.js → Reward-kxAuVGDE.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Dsk2VqB8.js → RewardGroup.vue_vue_type_script_setup_true_lang-i9B1R3XP.js} +14 -14
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-D3MZsh4A.js +1923 -0
- package/dist/{Segment-BbGE6AOZ.js → Segment-C5SJs7al.js} +304 -307
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-xrdOyWX8.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-RIerABcb.js} +15 -15
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CTsORsDg.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-D8jS4gee.js} +4 -4
- package/dist/{Setting-B9i2ufr7.js → Setting-zmlu3QcR.js} +17 -17
- package/dist/{SettingAdvertisements-Cuczz1wK.js → SettingAdvertisements-DewXGZoE.js} +12 -12
- package/dist/Settings-5HU_uY6B.js +286 -0
- package/dist/{Store-CoxREXJ-.js → Store-CiTwDcgr.js} +29 -29
- package/dist/{StoreRewards-CzkznvA1.js → StoreRewards-DaOJxsVm.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-BtwDM2Fr.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BTqxeKR4.js} +25 -25
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DlFCI1BT.js +7007 -0
- package/dist/{Tier-DyOlzjE0.js → Tier-lNI7GWMP.js} +2583 -688
- package/dist/{Title-C3__B-bw.js → Title-CDxDztnl.js} +96 -95
- package/dist/{Transaction-B_v-lbed.js → Transaction-CcsUvIns.js} +2 -2
- package/dist/{Upselling-D_5nBzIN.js → Upselling-BDirPkWX.js} +3 -3
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CE5eo992.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-hqzfBpop.js} +26 -26
- package/dist/{Voucher-KxXwge4O.js → Voucher-CJDo5U_P.js} +19 -19
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-nbLXmJ5Q.js → VoucherEditor.vue_vue_type_script_setup_true_lang-WjsLHh_E.js} +12 -12
- package/dist/{WhatsappAccount-C8kinTmg.js → WhatsappAccount-CQBti7RJ.js} +6 -6
- package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-ydBfMtzM.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-DVNZ774z.js} +1 -1
- package/dist/WhatsappBot-91lIlikm.js +882 -0
- package/dist/{WhatsappBotLogs-Dm0HJh_f.js → WhatsappBotLogs-PQTwT8e5.js} +66 -66
- package/dist/{WhatsappBotSettings-BNZcj26j.js → WhatsappBotSettings-CUES9UL-.js} +5 -5
- package/dist/{WhatsappLayout-BvBN7H-y.js → WhatsappLayout-pZGYJj0J.js} +3 -3
- package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-BzKwTs9R.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DAoonwsO.js} +3 -3
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BY8t6jtW.js → ZodTextField.vue_vue_type_script_setup_true_lang-HEIeZYCP.js} +2 -2
- package/dist/{app-uud8OgB9.js → app--pRyBODF.js} +4159 -3395
- package/dist/app.js +4 -3
- package/dist/{base.export-Bfxt84QY.js → base.export-CSdCmt-6.js} +2 -2
- package/dist/business-BtEfH8Mt.js +83 -0
- package/dist/{campaign-CWyU-r8u.js → campaign-CwQjWU63.js} +121 -94
- package/dist/{campaign-6WrFDF05.js → campaign-t9ubUkjB.js} +31 -25
- package/dist/{campaign.enum-BqekIiiN.js → campaign.enum-Damu7hgo.js} +3 -2
- package/dist/campaign.fn-D3_OzyyQ.js +776 -0
- package/dist/{collectible.enum-Liy2wH3s.js → collectible.enum-C8LbgIQ7.js} +1 -1
- package/dist/{collection.fn-CO-YhhUM.js → collection.fn-BV7pDqa5.js} +2 -2
- package/dist/{currency-kWhKZnhN.js → currency-pS0xeJA6.js} +1 -1
- package/dist/duplicateCampaign-19CDT2kM.js +51 -0
- package/dist/{effect-CjSyUbur.js → effect-B532leFF.js} +1 -1
- package/dist/{email-addresses-C_yrJd12.js → email-addresses-CKkT_5O5.js} +2 -2
- package/dist/{feature-flag-DcM82jeJ.js → feature-flag-25oDCLLB.js} +84 -84
- package/dist/google-BQK68wbe.js +5 -0
- package/dist/{helper-G8MwkrFo.js → helper-DxOj04aq.js} +1 -1
- package/dist/{index-3axft-Vz.js → index-B3sR1LMa.js} +10 -10
- package/dist/{index-ivVytFih.js → index-BCgTcZ7c.js} +609 -252
- package/dist/{index-BXSokNlS.js → index-BFJ2FmB4.js} +18 -18
- package/dist/{index-CiFPNxgn.js → index-BHnMLtU2.js} +381 -235
- package/dist/{index-6Ey495tl.js → index-BLRv_4gJ.js} +1 -1
- package/dist/index-BViMt33t.js +10767 -0
- package/dist/{index-Dv5Ja20d.js → index-BX6lcJDB.js} +1 -1
- package/dist/{index-CVVLKJj_.js → index-C6pr4oIv.js} +1315 -1243
- package/dist/{index-Dkud56R0.js → index-C7wVaeC1.js} +1 -1
- package/dist/{index-DgT4P2_R.js → index-CBYY3VEG.js} +2700 -2614
- package/dist/{index-sPf1Rhez.js → index-C_qmnOKQ.js} +9 -9
- package/dist/{index-CqvjZF-j.js → index-ClD2-18P.js} +19 -6
- package/dist/{index-h2p2DjKy.js → index-DBT1f1M3.js} +2 -2
- package/dist/{index-BNjHmUyd.js → index-DBzCfWxW.js} +2 -2
- package/dist/{index-Cj85mCmr.js → index-DEENB4la.js} +664 -664
- package/dist/{index-B3LCTMwV.js → index-DSAEs8u0.js} +68 -60
- package/dist/{index-L_2hhvso.js → index-DVlo0TO9.js} +23 -23
- package/dist/index-DiYuhtNS.js +19528 -0
- package/dist/{index-Ba4Q_XWF.js → index-Diw9710S.js} +4 -4
- package/dist/{index-CxyO5j1a.js → index-DqQ1q8sX.js} +26 -19
- package/dist/{index-RtamQHhy.js → index-ip2EqUEW.js} +1 -1
- package/dist/{index-DGrPvdRc.js → index-uCkkfjE3.js} +4 -4
- package/dist/{index.esm2017-DiUbRDfz.js → index.esm2017-DRrIFPLo.js} +57 -57
- package/dist/{loading-BdpH3z-q.js → loading--SZI7Tpo.js} +1 -1
- package/dist/{lodash-DcC4G06s.js → lodash-BZqvXM_P.js} +1 -1
- package/dist/{member-import-C99OxU-w.js → member-import-Bmt1OdRW.js} +2 -2
- package/dist/{membership-O5EN0QMl.js → membership-BTFpH7Mg.js} +3 -3
- package/dist/{money-CYS7zoiT.js → money-BVtlYyxo.js} +1 -1
- package/dist/{number-D_C66osx.js → number-DrOdGSrF.js} +1 -1
- package/dist/objectid-DdJFC6TI.js +145 -0
- package/dist/{onboarding-DGx34lkW.js → onboarding-BjcSBC8v.js} +25 -25
- package/dist/{onboardingSetup-ALOoxDHE.js → onboardingSetup-Dcv8i8qd.js} +2 -2
- package/dist/{plugins-CVh8eTG-.js → plugins-Iw52rJ1s.js} +3 -3
- package/dist/{reward-8sP3d8ie.js → reward-DF9tE7iA.js} +1 -1
- package/dist/{rule-BGMBiCRZ.js → rule-rCPhlgAq.js} +572 -492
- package/dist/style.css +1 -1
- package/dist/template-v1F1rvUU.js +227 -0
- package/dist/timezone-BxJDy-bY.js +19 -0
- package/dist/{transaction.fn-Dmla3R1q.js → transaction.fn-Cp3ylqFD.js} +2 -2
- package/dist/{trigger-CArDddXr.js → trigger-O6JvCms4.js} +9 -9
- package/dist/{useMarketingMaterialActions-BX5Ynq8O.js → useMarketingMaterialActions-Cnadk3AO.js} +4 -4
- package/dist/{usePagination-BdgLVPuo.js → usePagination-C5lSxdqt.js} +1 -1
- package/dist/{user-BgTKHjea.js → user-B7iv0TRE.js} +1 -1
- package/dist/vue-i18n-CYFvlTTS.js +2365 -0
- package/dist/{xlsx-WIRNQZAx.js → xlsx-DTJ6bUKL.js} +166 -166
- package/dist/{zod-Dh_CVWJN.js → zod-cIIx_Ng9.js} +1 -1
- package/package.json +7 -3
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DUJKivXA.js +0 -3638
- package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-Dmf4WtSt.js +0 -1308
- package/dist/ReviewFacebookCallback-D07x5BnV.js +0 -238
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BjyiiTSY.js +0 -1884
- package/dist/Settings-CCSXjpUC.js +0 -179
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-tSfwcDBG.js +0 -142
- package/dist/WhatsappBot-BuD45ou8.js +0 -878
- package/dist/business-77FEeeil.js +0 -82
- package/dist/campaign.fn-Ci_av9lZ.js +0 -776
- package/dist/google-C3S8u0mT.js +0 -4
- package/dist/index-BqHB3euS.js +0 -27551
- package/dist/index-C_H8jFYf.js +0 -2743
- package/dist/objectid-Dd0NRad7.js +0 -145
- package/dist/rule-builder-DcPK2oqo.js +0 -102
- package/dist/template-Bku-aSPA.js +0 -275
- package/dist/timezone-DML8BuIK.js +0 -20
- package/dist/vue-i18n-DMEbesBm.js +0 -2365
|
@@ -0,0 +1,1322 @@
|
|
|
1
|
+
import { defineComponent as me, computed as O, ref as G, resolveComponent as k, openBlock as d, createElementBlock as C, Fragment as D, createElementVNode as o, unref as t, createBlock as I, createCommentVNode as Q, createVNode as x, renderList as J, withCtx as ae, createTextVNode as ye, toDisplayString as S, withDirectives as Be, vShow as De, watch as $e, onBeforeMount as Ie, h as ie, onMounted as Ye, isRef as Ue, normalizeClass as Ne } from "vue";
|
|
2
|
+
import { h as _ } from "./moment-D7p2TMB-.js";
|
|
3
|
+
import { c as Pe } from "./index-B3sR1LMa.js";
|
|
4
|
+
import { u as Ve, C as Fe, s as Oe } from "./membership-BTFpH7Mg.js";
|
|
5
|
+
import { useDialog as Ce, components as we } from "@feedmepos/ui-library";
|
|
6
|
+
import { _ as Me } from "./lodash-BZqvXM_P.js";
|
|
7
|
+
import { D as Re } from "./type_drinks-D6jnpvwV.js";
|
|
8
|
+
import { d as Le, e as je, f as qe, g as ze, h as Ge } from "./index-C6pr4oIv.js";
|
|
9
|
+
import "./index-DiYuhtNS.js";
|
|
10
|
+
import { c as ke, f as Ae } from "./string-Gcy5IM_H.js";
|
|
11
|
+
import { u as He } from "./loading--SZI7Tpo.js";
|
|
12
|
+
import { u as Ee } from "./business-BtEfH8Mt.js";
|
|
13
|
+
import { p as Te } from "./plugins-Iw52rJ1s.js";
|
|
14
|
+
import { C as _e } from "./collection.fn-BV7pDqa5.js";
|
|
15
|
+
import { defineStore as Ke } from "pinia";
|
|
16
|
+
import { f as P } from "./number-DrOdGSrF.js";
|
|
17
|
+
import "./index-BCgTcZ7c.js";
|
|
18
|
+
import "./index-CBYY3VEG.js";
|
|
19
|
+
import "./index-BHnMLtU2.js";
|
|
20
|
+
import "./index-uCkkfjE3.js";
|
|
21
|
+
import "./index-DSAEs8u0.js";
|
|
22
|
+
import "./index-DqQ1q8sX.js";
|
|
23
|
+
import "./index-C7wVaeC1.js";
|
|
24
|
+
import { s as We } from "./index-CuvNtC_M.js";
|
|
25
|
+
import { u as Xe, _ as Je } from "./usePagination-C5lSxdqt.js";
|
|
26
|
+
import { B as Qe, e as Ze } from "./base.export-CSdCmt-6.js";
|
|
27
|
+
import { m as ve } from "./index-ClD2-18P.js";
|
|
28
|
+
import { o as ge } from "./objectId-dwaoBfJX.js";
|
|
29
|
+
import { F as he } from "./collectible.enum-C8LbgIQ7.js";
|
|
30
|
+
import { a as et, c as tt } from "./campaign-CwQjWU63.js";
|
|
31
|
+
import { useRouter as ot } from "vue-router";
|
|
32
|
+
import { m as ce } from "./index-DBT1f1M3.js";
|
|
33
|
+
import { t as rt } from "./index-DVlo0TO9.js";
|
|
34
|
+
import { R as nt } from "./app--pRyBODF.js";
|
|
35
|
+
const st = { class: "flex flex-col" }, lt = { key: 2 }, at = { class: "flex flex-nowrap gap-4 items-center my-[-4px]" }, it = { class: "flex flex-nowrap gap-8 items-center pt-24 w-full" }, mt = /* @__PURE__ */ me({
|
|
36
|
+
__name: "MemberStatsDialog",
|
|
37
|
+
props: {
|
|
38
|
+
member: {
|
|
39
|
+
type: Object,
|
|
40
|
+
required: !0
|
|
41
|
+
},
|
|
42
|
+
onSubmit: {
|
|
43
|
+
type: Function,
|
|
44
|
+
required: !0
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
setup(c) {
|
|
48
|
+
var te, oe, H, re;
|
|
49
|
+
const F = Ce(), b = Ve(), h = Ee(), s = c, l = O(
|
|
50
|
+
() => {
|
|
51
|
+
var p;
|
|
52
|
+
return (((p = s.member.collection) == null ? void 0 : p.TITLE) ?? []).reduce(
|
|
53
|
+
(a, g) => {
|
|
54
|
+
var L, K, X, E, W;
|
|
55
|
+
const V = b.sortedTitles.find(
|
|
56
|
+
(ne) => ne._id.toString() === g.collectible
|
|
57
|
+
);
|
|
58
|
+
if (!V) return a;
|
|
59
|
+
const N = [...g.expiryBalance ?? []].sort(
|
|
60
|
+
(ne, j) => _(ne.expiredAt).isAfter(_(j.expiredAt)) ? -1 : 1
|
|
61
|
+
);
|
|
62
|
+
return (L = N[0]) != null && L.expiredAt && _((K = N[0]) == null ? void 0 : K.expiredAt).isBefore(_()) || a.push({
|
|
63
|
+
_id: V._id,
|
|
64
|
+
name: V.name,
|
|
65
|
+
expiredAt: (X = N[0]) != null && X.expiredAt ? _((E = N[0]) == null ? void 0 : E.expiredAt).toISOString() : "",
|
|
66
|
+
expiresIn: _((W = N[0]) == null ? void 0 : W.expiredAt).diff(_(), "days")
|
|
67
|
+
}), a;
|
|
68
|
+
},
|
|
69
|
+
[]
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
), n = G({
|
|
73
|
+
cardNo: s.member.cardNo,
|
|
74
|
+
experience: ((oe = (te = s.member.collection) == null ? void 0 : te.POINT) == null ? void 0 : oe[0].balance) ?? 0,
|
|
75
|
+
tier: ((re = (H = s.member.collection) == null ? void 0 : H.TIER) == null ? void 0 : re[0].balance) ?? -1,
|
|
76
|
+
titles: l.value.map((p) => ({ expiredAt: p.expiresIn, id: p._id })) ?? void 0,
|
|
77
|
+
// birthday and gender are only editable when the business owns the profile
|
|
78
|
+
...h.isCrmProfile ? {
|
|
79
|
+
birthday: s.member.birthday ? new Date(s.member.birthday) : void 0,
|
|
80
|
+
gender: s.member.gender
|
|
81
|
+
} : {}
|
|
82
|
+
}), u = O(
|
|
83
|
+
() => (b.sortedTitles ?? []).map((p) => ({
|
|
84
|
+
label: p.name,
|
|
85
|
+
value: p._id.toString(),
|
|
86
|
+
sublabel: l.value.some((a) => a._id === p._id) ? "Owned" : void 0
|
|
87
|
+
}))
|
|
88
|
+
), v = O(() => (b.sortedTiers ?? []).map((p, a) => ({
|
|
89
|
+
label: p.name,
|
|
90
|
+
sublabel: `${p.option.from} - ${p.option.to}`,
|
|
91
|
+
from: p.option.from,
|
|
92
|
+
to: p.option.to,
|
|
93
|
+
value: a + 1
|
|
94
|
+
})));
|
|
95
|
+
function m() {
|
|
96
|
+
var g, V;
|
|
97
|
+
const p = ((g = v.value[(n.value.tier ?? 1) - 1]) == null ? void 0 : g.from) ?? 0, a = (V = v.value[(n.value.tier ?? 1) - 1]) == null ? void 0 : V.to;
|
|
98
|
+
n.value.experience = Math.min(
|
|
99
|
+
a ?? p,
|
|
100
|
+
Math.max(p, n.value.experience ?? 0)
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
const f = O(() => {
|
|
104
|
+
var g, V, N, L, K, X;
|
|
105
|
+
const p = ((V = (g = s.member.collection) == null ? void 0 : g.TIER) == null ? void 0 : V[0].balance) ?? -1, a = ((L = (N = s.member.collection) == null ? void 0 : N.POINT) == null ? void 0 : L[0].balance) ?? 0;
|
|
106
|
+
if (p != n.value.tier) return !0;
|
|
107
|
+
if (n.value.experience && n.value.experience != a) {
|
|
108
|
+
const E = ((K = v.value[p - 1]) == null ? void 0 : K.from) ?? 0, W = ((X = v.value[p - 1]) == null ? void 0 : X.to) ?? 0;
|
|
109
|
+
if (n.value.experience < E || W && n.value.experience > W)
|
|
110
|
+
return !0;
|
|
111
|
+
}
|
|
112
|
+
return !1;
|
|
113
|
+
});
|
|
114
|
+
function A(p) {
|
|
115
|
+
var a;
|
|
116
|
+
return (a = l.value.find((g) => g._id === p)) == null ? void 0 : a.expiresIn;
|
|
117
|
+
}
|
|
118
|
+
const Y = O(() => {
|
|
119
|
+
const p = Le.safeParse(n.value);
|
|
120
|
+
return p.success ? void 0 : p.error.errors;
|
|
121
|
+
});
|
|
122
|
+
function $(p) {
|
|
123
|
+
var a, g;
|
|
124
|
+
return (g = (a = Y.value) == null ? void 0 : a.find((V) => V.path.join(".") === p)) == null ? void 0 : g.message;
|
|
125
|
+
}
|
|
126
|
+
function U(p) {
|
|
127
|
+
var a;
|
|
128
|
+
return (a = Y.value) == null ? void 0 : a.filter((g) => g.path.join(".").startsWith(p)).map((g) => g.message);
|
|
129
|
+
}
|
|
130
|
+
async function ue() {
|
|
131
|
+
await s.onSubmit(n.value), F.close();
|
|
132
|
+
}
|
|
133
|
+
return (p, a) => {
|
|
134
|
+
var j, R;
|
|
135
|
+
const g = k("FmSelect"), V = k("FmStepperField"), N = k("FmTextField"), L = k("FmDatePicker"), K = k("FmField"), X = k("FmFormGroup"), E = k("FmButton"), W = k("FmHelperText"), ne = k("FmSpacer");
|
|
136
|
+
return d(), C(D, null, [
|
|
137
|
+
o("div", st, [
|
|
138
|
+
a[9] || (a[9] = o("div", { class: "fm-typo-en-title-sm-800 mb-8" }, "Member tiering", -1)),
|
|
139
|
+
t(v).length ? (d(), I(g, {
|
|
140
|
+
key: 0,
|
|
141
|
+
modelValue: t(n).tier,
|
|
142
|
+
"onUpdate:modelValue": [
|
|
143
|
+
a[0] || (a[0] = (w) => t(n).tier = w),
|
|
144
|
+
m
|
|
145
|
+
],
|
|
146
|
+
label: "Member Tier",
|
|
147
|
+
items: t(v),
|
|
148
|
+
"helper-text": $("tier"),
|
|
149
|
+
"helper-state": $("tier") ? "error" : void 0
|
|
150
|
+
}, null, 8, ["modelValue", "items", "helper-text", "helper-state"])) : Q("", !0),
|
|
151
|
+
x(V, {
|
|
152
|
+
"model-value": t(n).experience ?? 0,
|
|
153
|
+
"onUpdate:modelValue": a[1] || (a[1] = (w) => t(n).experience = w),
|
|
154
|
+
label: "Member Experience",
|
|
155
|
+
"max-fraction-digits": 0,
|
|
156
|
+
"helper-text": $("experience"),
|
|
157
|
+
"helper-state": $("experience") ? "error" : void 0
|
|
158
|
+
}, null, 8, ["model-value", "helper-text", "helper-state"]),
|
|
159
|
+
a[10] || (a[10] = o("div", { class: "fm-typo-en-title-sm-800 mt-16 mb-8" }, "Member Card", -1)),
|
|
160
|
+
x(N, {
|
|
161
|
+
modelValue: t(n).cardNo,
|
|
162
|
+
"onUpdate:modelValue": a[2] || (a[2] = (w) => t(n).cardNo = w),
|
|
163
|
+
label: "Card number",
|
|
164
|
+
"helper-text": $("cardNo"),
|
|
165
|
+
"helper-state": $("cardNo") ? "error" : void 0
|
|
166
|
+
}, null, 8, ["modelValue", "helper-text", "helper-state"]),
|
|
167
|
+
t(h).isCrmProfile ? (d(), C(D, { key: 1 }, [
|
|
168
|
+
a[7] || (a[7] = o("div", { class: "fm-typo-en-title-sm-800 mt-16 mb-8" }, "Profile", -1)),
|
|
169
|
+
x(L, {
|
|
170
|
+
"model-value": t(n).birthday ? t(_)(t(n).birthday).format("YYYY-MM-DD") : "",
|
|
171
|
+
label: "Birthday",
|
|
172
|
+
"onUpdate:modelValue": a[3] || (a[3] = (w) => t(n).birthday = w ? new Date(w) : void 0)
|
|
173
|
+
}, null, 8, ["model-value"]),
|
|
174
|
+
x(g, {
|
|
175
|
+
modelValue: t(n).gender,
|
|
176
|
+
"onUpdate:modelValue": a[4] || (a[4] = (w) => t(n).gender = w),
|
|
177
|
+
label: "Gender",
|
|
178
|
+
items: [
|
|
179
|
+
{ label: "Male", value: "MALE" },
|
|
180
|
+
{ label: "Female", value: "FEMALE" }
|
|
181
|
+
]
|
|
182
|
+
}, null, 8, ["modelValue"])
|
|
183
|
+
], 64)) : Q("", !0),
|
|
184
|
+
a[11] || (a[11] = o("div", { class: "fm-typo-en-title-sm-800 mt-16 mb-8" }, "Titles", -1)),
|
|
185
|
+
(j = t(n).titles) != null && j.length ? (d(), C("div", lt, [...a[8] || (a[8] = [
|
|
186
|
+
o("div", { class: "flex flex-nowrap gap-4 items-center" }, [
|
|
187
|
+
o("div", { class: "flex-1" }, "Title"),
|
|
188
|
+
o("div", { class: "flex-1" }, "Expires in days"),
|
|
189
|
+
o("div", { class: "w-24 h-1" })
|
|
190
|
+
], -1)
|
|
191
|
+
])])) : Q("", !0),
|
|
192
|
+
(d(!0), C(D, null, J(t(n).titles ?? [], (w, r) => (d(), C("div", { key: r }, [
|
|
193
|
+
o("div", at, [
|
|
194
|
+
t(l).some((e) => e._id === w.id) ? (d(), I(X, {
|
|
195
|
+
key: 1,
|
|
196
|
+
"model-value": "",
|
|
197
|
+
class: "flex-1"
|
|
198
|
+
}, {
|
|
199
|
+
default: ae(() => [
|
|
200
|
+
x(K, {
|
|
201
|
+
disabled: !0,
|
|
202
|
+
class: "text-fm-color-typo-secondary"
|
|
203
|
+
}, {
|
|
204
|
+
default: ae(() => {
|
|
205
|
+
var e;
|
|
206
|
+
return [
|
|
207
|
+
ye(S((e = t(u).find((i) => i.value === w.id)) == null ? void 0 : e.label), 1)
|
|
208
|
+
];
|
|
209
|
+
}),
|
|
210
|
+
_: 2
|
|
211
|
+
}, 1024)
|
|
212
|
+
]),
|
|
213
|
+
_: 2
|
|
214
|
+
}, 1024)) : (d(), I(g, {
|
|
215
|
+
key: 0,
|
|
216
|
+
modelValue: w.id,
|
|
217
|
+
"onUpdate:modelValue": [(e) => w.id = e, (e) => w.expiredAt = A(e) ?? 1],
|
|
218
|
+
class: "flex-1",
|
|
219
|
+
items: t(u).filter(
|
|
220
|
+
(e) => {
|
|
221
|
+
var i;
|
|
222
|
+
return !((i = t(n).titles) != null && i.map((M) => M.id).includes(e.value)) || w.id === e.value;
|
|
223
|
+
}
|
|
224
|
+
)
|
|
225
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "items"])),
|
|
226
|
+
x(V, {
|
|
227
|
+
modelValue: w.expiredAt,
|
|
228
|
+
"onUpdate:modelValue": (e) => w.expiredAt = e,
|
|
229
|
+
class: "flex-1",
|
|
230
|
+
label: "",
|
|
231
|
+
"max-fraction-digits": 0,
|
|
232
|
+
min: 0,
|
|
233
|
+
max: 9999,
|
|
234
|
+
step: 1
|
|
235
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
236
|
+
x(E, {
|
|
237
|
+
class: "w-24 h-24",
|
|
238
|
+
icon: "close",
|
|
239
|
+
variant: "tertiary",
|
|
240
|
+
onClick: (e) => {
|
|
241
|
+
var i;
|
|
242
|
+
return (i = t(n).titles) == null ? void 0 : i.splice(r, 1);
|
|
243
|
+
}
|
|
244
|
+
}, null, 8, ["onClick"])
|
|
245
|
+
]),
|
|
246
|
+
(d(!0), C(D, null, J(U(`titles.${r}`), (e, i) => (d(), I(W, {
|
|
247
|
+
key: i,
|
|
248
|
+
class: "items-center",
|
|
249
|
+
state: "error",
|
|
250
|
+
text: e.toString()
|
|
251
|
+
}, null, 8, ["text"]))), 128))
|
|
252
|
+
]))), 128)),
|
|
253
|
+
t(u).length && (((R = t(n).titles) == null ? void 0 : R.length) ?? 0) < t(u).length ? (d(), I(E, {
|
|
254
|
+
key: 3,
|
|
255
|
+
icon: "add",
|
|
256
|
+
label: "Give title",
|
|
257
|
+
variant: "plain",
|
|
258
|
+
onClick: a[5] || (a[5] = (w) => {
|
|
259
|
+
var r;
|
|
260
|
+
return t(n).titles = [
|
|
261
|
+
...t(n).titles ?? [],
|
|
262
|
+
{
|
|
263
|
+
id: ((r = t(u).find(
|
|
264
|
+
(e) => {
|
|
265
|
+
var i;
|
|
266
|
+
return !((i = t(n).titles) != null && i.map((M) => M.id).includes(e.value));
|
|
267
|
+
}
|
|
268
|
+
)) == null ? void 0 : r.value) || t(u)[0].value,
|
|
269
|
+
expiredAt: 0
|
|
270
|
+
}
|
|
271
|
+
];
|
|
272
|
+
})
|
|
273
|
+
})) : Q("", !0)
|
|
274
|
+
]),
|
|
275
|
+
o("div", it, [
|
|
276
|
+
Be(x(W, {
|
|
277
|
+
state: "warning",
|
|
278
|
+
text: "Updating member will cause tier to change"
|
|
279
|
+
}, null, 512), [
|
|
280
|
+
[De, t(f)]
|
|
281
|
+
]),
|
|
282
|
+
x(ne),
|
|
283
|
+
x(E, {
|
|
284
|
+
variant: "secondary",
|
|
285
|
+
label: "Cancel",
|
|
286
|
+
size: "md",
|
|
287
|
+
onClick: a[6] || (a[6] = (w) => t(F).close())
|
|
288
|
+
}),
|
|
289
|
+
x(E, {
|
|
290
|
+
disabled: !!t(Y),
|
|
291
|
+
variant: "primary",
|
|
292
|
+
label: "Submit",
|
|
293
|
+
size: "md",
|
|
294
|
+
onClick: ue
|
|
295
|
+
}, null, 8, ["disabled"])
|
|
296
|
+
])
|
|
297
|
+
], 64);
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
}), dt = { class: "fm-typo-en-title-sm-800" }, ct = { class: "space-y-16" }, ut = { class: "flex flex-nowrap gap-8 items-center justify-end pt-24 w-full" }, pt = /* @__PURE__ */ me({
|
|
301
|
+
__name: "CreditCoinDialog",
|
|
302
|
+
props: {
|
|
303
|
+
type: { type: String, required: !0 },
|
|
304
|
+
action: { type: String, required: !0 },
|
|
305
|
+
onSubmit: {
|
|
306
|
+
type: Function,
|
|
307
|
+
required: !0
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
setup(c) {
|
|
311
|
+
const F = Ce(), b = c, h = G({
|
|
312
|
+
amount: 1,
|
|
313
|
+
day: 1,
|
|
314
|
+
remark: void 0
|
|
315
|
+
}), s = G(!0), l = O(() => _e.formattedType(b.type.toUpperCase()));
|
|
316
|
+
function n(m) {
|
|
317
|
+
s.value = m, !m && b.type === "coin" && (h.value.day = void 0);
|
|
318
|
+
}
|
|
319
|
+
async function u() {
|
|
320
|
+
if (b.action === "send") {
|
|
321
|
+
const m = h.value.day ? `, expire in ${h.value.day} days` : "";
|
|
322
|
+
Te.confirm(
|
|
323
|
+
`Are you sure to send ${h.value.amount} ${l.value.toLowerCase()}${m}? This action cannot be reversed.`
|
|
324
|
+
).then(async (f) => {
|
|
325
|
+
f && await b.onSubmit(h.value);
|
|
326
|
+
});
|
|
327
|
+
} else
|
|
328
|
+
Te.confirm(
|
|
329
|
+
`Are you sure to deduct ${h.value.amount} ${l.value.toLowerCase()}? This action cannot be reversed.`
|
|
330
|
+
).then(async (m) => {
|
|
331
|
+
m && await b.onSubmit(h.value);
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
const v = O(() => {
|
|
335
|
+
const f = (b.action === "send" ? b.type === "coin" ? je : qe : b.type === "coin" ? ze : Ge).safeParse(h.value);
|
|
336
|
+
return f.success == !1 ? f.error.flatten().fieldErrors : void 0;
|
|
337
|
+
});
|
|
338
|
+
return (m, f) => {
|
|
339
|
+
const A = k("FmStepperField"), Y = k("FmSwitch"), $ = k("FmTextarea"), U = k("FmButton"), ue = k("FmCard");
|
|
340
|
+
return d(), I(ue, { class: "flex flex-col gap-16 p-16" }, {
|
|
341
|
+
default: ae(() => {
|
|
342
|
+
var te, oe, H, re, p, a;
|
|
343
|
+
return [
|
|
344
|
+
o("div", dt, S(b.action == "send" ? "Send" : "Deduct") + " " + S(t(Fe)[b.type.toUpperCase()].name), 1),
|
|
345
|
+
ye(" " + S(t(v)) + " ", 1),
|
|
346
|
+
o("div", ct, [
|
|
347
|
+
x(A, {
|
|
348
|
+
modelValue: t(h).amount,
|
|
349
|
+
"onUpdate:modelValue": f[0] || (f[0] = (g) => t(h).amount = g),
|
|
350
|
+
label: `${t(Fe)[b.type.toUpperCase()].name} amount`,
|
|
351
|
+
"is-currency": !0,
|
|
352
|
+
"max-fraction-digits": 2,
|
|
353
|
+
"helper-state": (te = t(v)) != null && te.amount ? "error" : void 0,
|
|
354
|
+
"helper-text": (H = (oe = t(v)) == null ? void 0 : oe.amount) == null ? void 0 : H[0]
|
|
355
|
+
}, null, 8, ["modelValue", "label", "helper-state", "helper-text"]),
|
|
356
|
+
c.action === "send" && b.type === "coin" ? (d(), I(Y, {
|
|
357
|
+
key: 0,
|
|
358
|
+
"model-value": t(s),
|
|
359
|
+
label: `${t(l)} expires`,
|
|
360
|
+
"label-placement": "right",
|
|
361
|
+
"onUpdate:modelValue": f[1] || (f[1] = (g) => n(g))
|
|
362
|
+
}, null, 8, ["model-value", "label"])) : Q("", !0),
|
|
363
|
+
c.action === "send" && t(s) ? (d(), I(A, {
|
|
364
|
+
key: 1,
|
|
365
|
+
modelValue: t(h).day,
|
|
366
|
+
"onUpdate:modelValue": f[2] || (f[2] = (g) => t(h).day = g),
|
|
367
|
+
label: `${t(l)} expires in`,
|
|
368
|
+
"max-fraction-digits": 0,
|
|
369
|
+
"append-text": "day(s)",
|
|
370
|
+
max: 9999,
|
|
371
|
+
min: 0,
|
|
372
|
+
"helper-state": (re = t(v)) != null && re.day ? "error" : void 0,
|
|
373
|
+
"helper-text": (a = (p = t(v)) == null ? void 0 : p.day) == null ? void 0 : a[0]
|
|
374
|
+
}, null, 8, ["modelValue", "label", "helper-state", "helper-text"])) : Q("", !0),
|
|
375
|
+
x($, {
|
|
376
|
+
modelValue: t(h).remark,
|
|
377
|
+
"onUpdate:modelValue": f[3] || (f[3] = (g) => t(h).remark = g),
|
|
378
|
+
label: "Remark"
|
|
379
|
+
}, null, 8, ["modelValue"])
|
|
380
|
+
]),
|
|
381
|
+
o("div", ut, [
|
|
382
|
+
x(U, {
|
|
383
|
+
variant: "secondary",
|
|
384
|
+
label: "Cancel",
|
|
385
|
+
size: "md",
|
|
386
|
+
onClick: f[4] || (f[4] = (g) => t(F).close())
|
|
387
|
+
}),
|
|
388
|
+
x(U, {
|
|
389
|
+
disabled: !!t(v),
|
|
390
|
+
variant: "primary",
|
|
391
|
+
label: "Submit",
|
|
392
|
+
size: "md",
|
|
393
|
+
onClick: f[5] || (f[5] = async () => u())
|
|
394
|
+
}, null, 8, ["disabled"])
|
|
395
|
+
])
|
|
396
|
+
];
|
|
397
|
+
}),
|
|
398
|
+
_: 1
|
|
399
|
+
});
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
}), bt = Ke("segment", () => {
|
|
403
|
+
const c = G([]);
|
|
404
|
+
async function F() {
|
|
405
|
+
const b = await Oe.readAll({
|
|
406
|
+
limit: 1e3,
|
|
407
|
+
skip: 0,
|
|
408
|
+
sortBy: "_id",
|
|
409
|
+
descending: !0
|
|
410
|
+
});
|
|
411
|
+
c.value = b.resources;
|
|
412
|
+
}
|
|
413
|
+
return {
|
|
414
|
+
segments: c,
|
|
415
|
+
read: F
|
|
416
|
+
};
|
|
417
|
+
});
|
|
418
|
+
class ft extends Qe {
|
|
419
|
+
}
|
|
420
|
+
const yt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" }, vt = { class: "hidden xs:!flex items-center justify-end" }, gt = { class: "flex items-center justify-between mb-4" }, xt = { class: "flex items-center justify-between gap-x-8" }, ht = { class: "fm-typo-en-body-lg-600" }, _t = { class: "px-4 py-0.5 rounded-md bg-fm-color-neutral-gray-100 fm-typo-en-body-md-600" }, Ct = { class: "xs:hidden flex justify-between gap-x-4" }, xe = /* @__PURE__ */ me({
|
|
421
|
+
__name: "MemberCollectionTable",
|
|
422
|
+
props: {
|
|
423
|
+
member: {
|
|
424
|
+
type: Object,
|
|
425
|
+
required: !0
|
|
426
|
+
},
|
|
427
|
+
title: {
|
|
428
|
+
type: String,
|
|
429
|
+
default: ""
|
|
430
|
+
},
|
|
431
|
+
columns: {
|
|
432
|
+
type: Array,
|
|
433
|
+
default: [],
|
|
434
|
+
required: !0
|
|
435
|
+
},
|
|
436
|
+
filters: {
|
|
437
|
+
type: Object,
|
|
438
|
+
default: {}
|
|
439
|
+
},
|
|
440
|
+
withExport: {
|
|
441
|
+
type: Boolean,
|
|
442
|
+
default: !1
|
|
443
|
+
},
|
|
444
|
+
transformExportRecord: {
|
|
445
|
+
type: Function
|
|
446
|
+
}
|
|
447
|
+
},
|
|
448
|
+
setup(c) {
|
|
449
|
+
const F = c, b = G({
|
|
450
|
+
search: ""
|
|
451
|
+
}), h = G(!1), { tableMeta: s, rowData: l, onSort: n, debouncedFetchData: u, onSearch: v } = Xe(async (f) => {
|
|
452
|
+
const A = {
|
|
453
|
+
...b.value,
|
|
454
|
+
...F.filters
|
|
455
|
+
};
|
|
456
|
+
return await ve.readCollectionsByMemberId(
|
|
457
|
+
F.member._id.toString(),
|
|
458
|
+
f,
|
|
459
|
+
A
|
|
460
|
+
);
|
|
461
|
+
});
|
|
462
|
+
$e(
|
|
463
|
+
b,
|
|
464
|
+
() => {
|
|
465
|
+
u();
|
|
466
|
+
},
|
|
467
|
+
{ deep: !0 }
|
|
468
|
+
);
|
|
469
|
+
async function m() {
|
|
470
|
+
try {
|
|
471
|
+
h.value = !0;
|
|
472
|
+
const f = {
|
|
473
|
+
...b.value,
|
|
474
|
+
...F.filters
|
|
475
|
+
};
|
|
476
|
+
await Ze({
|
|
477
|
+
exporter: new ft(),
|
|
478
|
+
readFunction: (A) => ve.readCollectionsByMemberId(
|
|
479
|
+
F.member._id.toString(),
|
|
480
|
+
A,
|
|
481
|
+
f
|
|
482
|
+
),
|
|
483
|
+
transformRecord: F.transformExportRecord,
|
|
484
|
+
filename: `${F.member._id.toString()}-${F.title.replace(" ", "-").toLowerCase()}`
|
|
485
|
+
});
|
|
486
|
+
} catch (f) {
|
|
487
|
+
console.error(f);
|
|
488
|
+
} finally {
|
|
489
|
+
h.value = !1;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
return Ie(async () => {
|
|
493
|
+
await u();
|
|
494
|
+
}), (f, A) => {
|
|
495
|
+
const Y = k("FmSearch"), $ = k("FmButton");
|
|
496
|
+
return d(), C("div", yt, [
|
|
497
|
+
o("div", vt, [
|
|
498
|
+
x(Y, {
|
|
499
|
+
class: "hidden xs:!flex",
|
|
500
|
+
modelValue: t(b).search,
|
|
501
|
+
"onUpdate:modelValue": [
|
|
502
|
+
A[0] || (A[0] = (U) => t(b).search = U),
|
|
503
|
+
t(v)
|
|
504
|
+
],
|
|
505
|
+
placeholder: "Search",
|
|
506
|
+
collapsible: ""
|
|
507
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
508
|
+
c.withExport ? (d(), I($, {
|
|
509
|
+
key: 0,
|
|
510
|
+
icon: "ios_share",
|
|
511
|
+
variant: "tertiary",
|
|
512
|
+
onClick: m
|
|
513
|
+
})) : Q("", !0)
|
|
514
|
+
]),
|
|
515
|
+
o("div", gt, [
|
|
516
|
+
o("div", xt, [
|
|
517
|
+
o("div", ht, S(F.title), 1),
|
|
518
|
+
o("div", _t, S(t(s).totalRows), 1)
|
|
519
|
+
]),
|
|
520
|
+
o("div", Ct, [
|
|
521
|
+
x(Y, {
|
|
522
|
+
modelValue: t(b).search,
|
|
523
|
+
"onUpdate:modelValue": [
|
|
524
|
+
A[1] || (A[1] = (U) => t(b).search = U),
|
|
525
|
+
t(v)
|
|
526
|
+
],
|
|
527
|
+
placeholder: "Search"
|
|
528
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
529
|
+
c.withExport ? (d(), I($, {
|
|
530
|
+
key: 0,
|
|
531
|
+
icon: "ios_share",
|
|
532
|
+
variant: "tertiary",
|
|
533
|
+
onClick: m
|
|
534
|
+
})) : Q("", !0)
|
|
535
|
+
])
|
|
536
|
+
]),
|
|
537
|
+
x(Je, {
|
|
538
|
+
loading: t(s).isLoading,
|
|
539
|
+
"row-data": t(l),
|
|
540
|
+
"row-count": t(s).totalRows,
|
|
541
|
+
"column-defs": c.columns,
|
|
542
|
+
"page-count": t(s).pageCount,
|
|
543
|
+
"page-index": t(s).pageIndex,
|
|
544
|
+
"page-size": t(s).pageSize,
|
|
545
|
+
"shrink-at": !1,
|
|
546
|
+
onSortChange: t(n),
|
|
547
|
+
onPageChange: A[2] || (A[2] = (U) => t(u)({
|
|
548
|
+
pageSize: U.pageSize,
|
|
549
|
+
pageIndex: U.pageIndex
|
|
550
|
+
}))
|
|
551
|
+
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
|
|
552
|
+
]);
|
|
553
|
+
};
|
|
554
|
+
}
|
|
555
|
+
}), St = /* @__PURE__ */ me({
|
|
556
|
+
__name: "MemberVouchers",
|
|
557
|
+
props: {
|
|
558
|
+
member: {
|
|
559
|
+
type: Object,
|
|
560
|
+
required: !0
|
|
561
|
+
}
|
|
562
|
+
},
|
|
563
|
+
setup(c) {
|
|
564
|
+
const F = c, b = [
|
|
565
|
+
{
|
|
566
|
+
header: "Voucher title",
|
|
567
|
+
meta: {
|
|
568
|
+
maxWidth: "300px"
|
|
569
|
+
},
|
|
570
|
+
cell(l) {
|
|
571
|
+
var n;
|
|
572
|
+
return ie(
|
|
573
|
+
"div",
|
|
574
|
+
{ class: "text-ellipsis truncate" },
|
|
575
|
+
((n = l.row.original.pf_collectible) == null ? void 0 : n.name) || "-"
|
|
576
|
+
);
|
|
577
|
+
},
|
|
578
|
+
enableSorting: !1
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
header: "Claimed at",
|
|
582
|
+
accessorKey: "_id",
|
|
583
|
+
accessorFn: (l) => _(ge(l._id.toString())).format("D MMM YYYY"),
|
|
584
|
+
enableSorting: !1
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
header: "Expired at",
|
|
588
|
+
cell(l) {
|
|
589
|
+
var u, v, m, f;
|
|
590
|
+
const n = (v = (u = l.row.original.expiryBalance) == null ? void 0 : u[0]) != null && v.expiredAt ? _((f = (m = l.row.original.expiryBalance) == null ? void 0 : m[0]) == null ? void 0 : f.expiredAt).format(
|
|
591
|
+
"D MMM YYYY"
|
|
592
|
+
) : "-";
|
|
593
|
+
return ie("div", {}, n);
|
|
594
|
+
},
|
|
595
|
+
enableSorting: !0
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
header: "Transfer open",
|
|
599
|
+
accessorFn: (l) => {
|
|
600
|
+
var n, u, v;
|
|
601
|
+
return We((v = (u = (n = l.pf_collectible) == null ? void 0 : n.options) == null ? void 0 : u.enableTransfer) == null ? void 0 : v.toString());
|
|
602
|
+
},
|
|
603
|
+
enableSorting: !1
|
|
604
|
+
}
|
|
605
|
+
], h = (l) => ({
|
|
606
|
+
type: he.enum.VOUCHER,
|
|
607
|
+
isActive: l
|
|
608
|
+
}), s = (l) => {
|
|
609
|
+
var n, u, v, m, f, A, Y;
|
|
610
|
+
return {
|
|
611
|
+
CollectionID: l._id,
|
|
612
|
+
Title: (n = l.pf_collectible) == null ? void 0 : n.name,
|
|
613
|
+
ClaimedAt: _(ge(l._id.toString())).format(
|
|
614
|
+
"D MMM YYYY, hh:mmA"
|
|
615
|
+
),
|
|
616
|
+
ExpiredAt: (v = (u = l.expiryBalance) == null ? void 0 : u[0]) != null && v.expiredAt ? _((f = (m = l.expiryBalance) == null ? void 0 : m[0]) == null ? void 0 : f.expiredAt).format("D MMM YYYY") : "",
|
|
617
|
+
TransferOpen: ((Y = (A = l.pf_collectible) == null ? void 0 : A.options) == null ? void 0 : Y.enableTransfer) || !1
|
|
618
|
+
};
|
|
619
|
+
};
|
|
620
|
+
return (l, n) => (d(), C(D, null, [
|
|
621
|
+
n[0] || (n[0] = o("div", { class: "fm-typo-en-title-sm-600 mb-16" }, "Voucher Collections", -1)),
|
|
622
|
+
x(xe, {
|
|
623
|
+
member: F.member,
|
|
624
|
+
columns: b,
|
|
625
|
+
title: "Active voucher",
|
|
626
|
+
filters: h(!0),
|
|
627
|
+
withExport: !0,
|
|
628
|
+
transformExportRecord: s
|
|
629
|
+
}, null, 8, ["member", "filters"]),
|
|
630
|
+
x(xe, {
|
|
631
|
+
member: F.member,
|
|
632
|
+
columns: b,
|
|
633
|
+
title: "Past voucher",
|
|
634
|
+
filters: h(!1),
|
|
635
|
+
withExport: !0,
|
|
636
|
+
transformExportRecord: s
|
|
637
|
+
}, null, 8, ["member", "filters"])
|
|
638
|
+
], 64));
|
|
639
|
+
}
|
|
640
|
+
}), Ft = /* @__PURE__ */ me({
|
|
641
|
+
__name: "MemberMissions",
|
|
642
|
+
props: {
|
|
643
|
+
member: {
|
|
644
|
+
type: Object,
|
|
645
|
+
required: !0
|
|
646
|
+
}
|
|
647
|
+
},
|
|
648
|
+
setup(c) {
|
|
649
|
+
const F = c, b = [
|
|
650
|
+
{
|
|
651
|
+
header: "Mission title",
|
|
652
|
+
meta: {
|
|
653
|
+
maxWidth: "300px"
|
|
654
|
+
},
|
|
655
|
+
cell(s) {
|
|
656
|
+
var l;
|
|
657
|
+
return ie(
|
|
658
|
+
"div",
|
|
659
|
+
{ class: "text-ellipsis truncate" },
|
|
660
|
+
((l = s.row.original.pf_campaign) == null ? void 0 : l.name) || "Deleted Campaign"
|
|
661
|
+
);
|
|
662
|
+
},
|
|
663
|
+
enableSorting: !1
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
header: "Type",
|
|
667
|
+
accessorFn: (s) => {
|
|
668
|
+
var l, n, u;
|
|
669
|
+
return ke.title(((u = (n = (l = s == null ? void 0 : s.pf_collectible) == null ? void 0 : l.extras) == null ? void 0 : n.mission) == null ? void 0 : u.type) || "-");
|
|
670
|
+
},
|
|
671
|
+
enableSorting: !1
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
header: "Status",
|
|
675
|
+
cell(s) {
|
|
676
|
+
var l;
|
|
677
|
+
if (s.row.original.pf_campaign) {
|
|
678
|
+
const n = {
|
|
679
|
+
active: "text-fm-color-typo-warning bg-fm-color-system-warning-100",
|
|
680
|
+
upcoming: "text-fm-color-typo-info bg-fm-color-system-info-100",
|
|
681
|
+
completed: "text-fm-color-typo-success bg-fm-color-system-success-100",
|
|
682
|
+
expired: "text-fm-color-typo-error bg-fm-color-system-error-100"
|
|
683
|
+
}, u = et(
|
|
684
|
+
s.row.original.pf_campaign
|
|
685
|
+
), m = s.row.original.balance === s.row.original.pf_collectible.extras.mission.end && u === "active" ? "completed" : (l = s.row.original) != null && l.deactivatedAt ? "expired" : u;
|
|
686
|
+
return ie(we.FmChip, {
|
|
687
|
+
class: n[m],
|
|
688
|
+
label: ke.title(m),
|
|
689
|
+
compact: !0
|
|
690
|
+
});
|
|
691
|
+
}
|
|
692
|
+
return ie(we.FmChip, {
|
|
693
|
+
class: "",
|
|
694
|
+
label: "-",
|
|
695
|
+
compact: !0
|
|
696
|
+
});
|
|
697
|
+
},
|
|
698
|
+
enableSorting: !1
|
|
699
|
+
},
|
|
700
|
+
{
|
|
701
|
+
header: "Summary",
|
|
702
|
+
accessorFn: (s) => s != null && s.pf_campaign ? tt(s.pf_campaign) : "Deleted Campaign",
|
|
703
|
+
enableSorting: !1
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
header: "Current Step",
|
|
707
|
+
accessorKey: "balance",
|
|
708
|
+
enableSorting: !1
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
header: "Total Step",
|
|
712
|
+
accessorFn: (s) => {
|
|
713
|
+
var l, n, u;
|
|
714
|
+
return ((u = (n = (l = s == null ? void 0 : s.pf_collectible) == null ? void 0 : l.extras) == null ? void 0 : n.mission) == null ? void 0 : u.end) ?? 0;
|
|
715
|
+
},
|
|
716
|
+
enableSorting: !1
|
|
717
|
+
}
|
|
718
|
+
], h = {
|
|
719
|
+
type: he.enum.STAMP
|
|
720
|
+
};
|
|
721
|
+
return (s, l) => (d(), C(D, null, [
|
|
722
|
+
l[0] || (l[0] = o("div", { class: "fm-typo-en-title-sm-600 mb-16" }, "Mission", -1)),
|
|
723
|
+
x(xe, {
|
|
724
|
+
member: F.member,
|
|
725
|
+
columns: b,
|
|
726
|
+
title: "Mission",
|
|
727
|
+
filters: h
|
|
728
|
+
}, null, 8, ["member"])
|
|
729
|
+
], 64));
|
|
730
|
+
}
|
|
731
|
+
}), wt = /* @__PURE__ */ me({
|
|
732
|
+
__name: "MemberGames",
|
|
733
|
+
props: {
|
|
734
|
+
member: {
|
|
735
|
+
type: Object,
|
|
736
|
+
required: !0
|
|
737
|
+
}
|
|
738
|
+
},
|
|
739
|
+
setup(c) {
|
|
740
|
+
const F = c, b = [
|
|
741
|
+
{
|
|
742
|
+
header: "Game title",
|
|
743
|
+
meta: {
|
|
744
|
+
maxWidth: "300px"
|
|
745
|
+
},
|
|
746
|
+
cell(s) {
|
|
747
|
+
var l;
|
|
748
|
+
return ie(
|
|
749
|
+
"div",
|
|
750
|
+
{ class: "text-ellipsis truncate" },
|
|
751
|
+
((l = s.row.original.pf_campaign) == null ? void 0 : l.name) || "-"
|
|
752
|
+
);
|
|
753
|
+
},
|
|
754
|
+
enableSorting: !1
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
header: "Claimed at",
|
|
758
|
+
accessorKey: "_id",
|
|
759
|
+
accessorFn: (s) => _(ge(s._id.toString())).format("D MMM YYYY"),
|
|
760
|
+
enableSorting: !1
|
|
761
|
+
},
|
|
762
|
+
{
|
|
763
|
+
header: "Expired at",
|
|
764
|
+
cell(s) {
|
|
765
|
+
var n, u, v, m;
|
|
766
|
+
const l = (u = (n = s.row.original.expiryBalance) == null ? void 0 : n[0]) != null && u.expiredAt ? _((m = (v = s.row.original.expiryBalance) == null ? void 0 : v[0]) == null ? void 0 : m.expiredAt).format(
|
|
767
|
+
"D MMM YYYY"
|
|
768
|
+
) : "-";
|
|
769
|
+
return ie("div", {}, l);
|
|
770
|
+
},
|
|
771
|
+
enableSorting: !1
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
header: "Token received",
|
|
775
|
+
accessorKey: "balance",
|
|
776
|
+
enableSorting: !1
|
|
777
|
+
}
|
|
778
|
+
], h = (s) => ({
|
|
779
|
+
type: he.enum.GAME,
|
|
780
|
+
isActive: s
|
|
781
|
+
});
|
|
782
|
+
return (s, l) => (d(), C(D, null, [
|
|
783
|
+
l[0] || (l[0] = o("div", { class: "fm-typo-en-title-sm-600 mb-16" }, "Game program", -1)),
|
|
784
|
+
x(xe, {
|
|
785
|
+
member: F.member,
|
|
786
|
+
columns: b,
|
|
787
|
+
title: "Active game token",
|
|
788
|
+
filters: h(!0)
|
|
789
|
+
}, null, 8, ["member", "filters"])
|
|
790
|
+
], 64));
|
|
791
|
+
}
|
|
792
|
+
}), Mt = { class: "flex flex-col flex-nowrap gap-y-24 max-h-full" }, kt = { class: "grid md:grid-cols-2 lg:grid-cols-2 gap-x-36 gap-y-24" }, At = { class: "space-y-16" }, Tt = { class: "flex gap-16 items-center" }, $t = { class: "flex-auto" }, Vt = { class: "fm-typo-en-body-md-600" }, Et = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Bt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Dt = { class: "fm-typo-en-body-md-800" }, It = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Yt = { class: "fm-typo-en-body-md-800" }, Ut = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Nt = { class: "fm-typo-en-body-md-600" }, Pt = { class: "gap-16 grid grid-cols-1" }, Ot = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Rt = { class: "fm-typo-en-body-md-600" }, Lt = { 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" }, jt = { class: "flex justify-between mb-16" }, qt = { class: "fm-typo-en-title-sm-600" }, zt = ["onClick"], Gt = { class: "flex flex-col gap-y-16" }, Ht = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Kt = { class: "fm-typo-en-body-md-600" }, Wt = { class: "space-y-8" }, Xt = {
|
|
793
|
+
key: 0,
|
|
794
|
+
class: "space-x-8"
|
|
795
|
+
}, Jt = {
|
|
796
|
+
key: 1,
|
|
797
|
+
class: "text-fm-color-typo-secondary"
|
|
798
|
+
}, Qt = { class: "space-y-8" }, Zt = ["src"], eo = { class: "fm-typo-en-body-md-600" }, to = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, oo = {
|
|
799
|
+
key: 1,
|
|
800
|
+
class: "text-fm-color-typo-secondary"
|
|
801
|
+
}, ro = {
|
|
802
|
+
key: 1,
|
|
803
|
+
class: "space-y-24"
|
|
804
|
+
}, no = { class: "space-y-8" }, so = { class: "fm-typo-en-title-md-800" }, lo = { class: "grid grid-cols-2 gap-16" }, ao = { class: "space-y-4" }, io = { class: "fm-typo-en-body-md-600" }, mo = { class: "space-y-4" }, co = { class: "fm-typo-en-body-md-600" }, uo = { class: "space-y-4" }, po = { class: "fm-typo-en-body-md-600" }, bo = { class: "flex gap-24 items-center xs:flex-col xs:items-start" }, fo = { class: "space-y-8" }, yo = { class: "fm-typo-en-title-md-800" }, vo = { class: "space-y-4" }, go = { class: "fm-typo-en-body-md-600" }, xo = { class: "flex gap-24 items-center xs:flex-col xs:items-start" }, er = /* @__PURE__ */ me({
|
|
805
|
+
__name: "MemberDetailSheet",
|
|
806
|
+
props: {
|
|
807
|
+
member: {
|
|
808
|
+
type: Object,
|
|
809
|
+
required: !0
|
|
810
|
+
}
|
|
811
|
+
},
|
|
812
|
+
emits: ["update:member"],
|
|
813
|
+
setup(c, { expose: F, emit: b }) {
|
|
814
|
+
const h = ot(), s = Ee(), l = Ve(), n = bt(), u = Ce(), { minor: v } = He, m = c, f = b, A = O(() => s.locations.map((r) => ({
|
|
815
|
+
label: r.name,
|
|
816
|
+
value: r._id
|
|
817
|
+
}))), Y = O(() => (m.member.segment || []).map((r) => {
|
|
818
|
+
var e;
|
|
819
|
+
return ((e = n.segments.find((i) => i._id === r)) == null ? void 0 : e.name) || "";
|
|
820
|
+
}).filter(Boolean)), $ = O(() => {
|
|
821
|
+
var M, T;
|
|
822
|
+
const r = (T = (M = m.member.collection) == null ? void 0 : M.CREDIT) == null ? void 0 : T[0], e = (r == null ? void 0 : r.balance) ?? 0, i = ((r == null ? void 0 : r.expiryBalance) ?? []).reduce((q, Z) => q + Z.amount, 0);
|
|
823
|
+
return { total: e, free: i, normal: e - i };
|
|
824
|
+
}), U = [
|
|
825
|
+
{
|
|
826
|
+
label: "Loyalty",
|
|
827
|
+
stats: [
|
|
828
|
+
{
|
|
829
|
+
label: "Experiences",
|
|
830
|
+
getter: (r) => {
|
|
831
|
+
var e, i, M;
|
|
832
|
+
return P(((M = (i = (e = r.collection) == null ? void 0 : e.POINT) == null ? void 0 : i[0]) == null ? void 0 : M.balance) ?? 0, 2);
|
|
833
|
+
}
|
|
834
|
+
},
|
|
835
|
+
{
|
|
836
|
+
label: "Credits",
|
|
837
|
+
getter: () => P($.value.total, 2)
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
label: "Normal credits",
|
|
841
|
+
getter: () => P($.value.normal, 2)
|
|
842
|
+
},
|
|
843
|
+
{
|
|
844
|
+
label: "Free credits",
|
|
845
|
+
getter: () => P($.value.free, 2)
|
|
846
|
+
}
|
|
847
|
+
]
|
|
848
|
+
},
|
|
849
|
+
{
|
|
850
|
+
label: "Voucher",
|
|
851
|
+
stats: [
|
|
852
|
+
{
|
|
853
|
+
label: "Active vouchers",
|
|
854
|
+
getter: () => P(L.value.active, 0)
|
|
855
|
+
},
|
|
856
|
+
{
|
|
857
|
+
label: "Past vouchers",
|
|
858
|
+
getter: () => P(L.value.past, 0)
|
|
859
|
+
}
|
|
860
|
+
]
|
|
861
|
+
},
|
|
862
|
+
{
|
|
863
|
+
label: "Mission",
|
|
864
|
+
stats: [
|
|
865
|
+
{
|
|
866
|
+
label: "Stamp missions",
|
|
867
|
+
getter: () => P(N.value.stamp, 0)
|
|
868
|
+
},
|
|
869
|
+
{
|
|
870
|
+
label: "Progress missions",
|
|
871
|
+
getter: () => P(N.value.progressive, 0)
|
|
872
|
+
}
|
|
873
|
+
]
|
|
874
|
+
},
|
|
875
|
+
{
|
|
876
|
+
label: "Game",
|
|
877
|
+
stats: [
|
|
878
|
+
{
|
|
879
|
+
label: "Tokens",
|
|
880
|
+
getter: (r) => {
|
|
881
|
+
var e, i;
|
|
882
|
+
return P(
|
|
883
|
+
((i = (e = r.collection) == null ? void 0 : e.GAME) == null ? void 0 : i.reduce(
|
|
884
|
+
(M, T) => M + T.balance,
|
|
885
|
+
0
|
|
886
|
+
)) || 0,
|
|
887
|
+
0
|
|
888
|
+
);
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
]
|
|
892
|
+
},
|
|
893
|
+
{
|
|
894
|
+
label: "Store bundle",
|
|
895
|
+
stats: [
|
|
896
|
+
{
|
|
897
|
+
label: "Bundle purchased",
|
|
898
|
+
getter: () => P(X.value, 0)
|
|
899
|
+
}
|
|
900
|
+
]
|
|
901
|
+
}
|
|
902
|
+
], te = (() => {
|
|
903
|
+
const e = [];
|
|
904
|
+
for (let i = 0; i < U.length; i += 3)
|
|
905
|
+
e.push(U.slice(i, i + 3));
|
|
906
|
+
return e;
|
|
907
|
+
})();
|
|
908
|
+
async function oe(r, e) {
|
|
909
|
+
switch (r.stopPropagation(), e) {
|
|
910
|
+
case "Store bundle":
|
|
911
|
+
await h.push({
|
|
912
|
+
name: nt["$connect-LOYALTY_MEMBER_TRANSACTIONS"],
|
|
913
|
+
params: { id: m.member._id.toString() },
|
|
914
|
+
query: { tab: "store" }
|
|
915
|
+
});
|
|
916
|
+
break;
|
|
917
|
+
default:
|
|
918
|
+
R.value = j.find((i) => i.label === e) || j[0];
|
|
919
|
+
break;
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
async function H(r, e) {
|
|
923
|
+
u.open({
|
|
924
|
+
title: "",
|
|
925
|
+
dialogComponent: pt,
|
|
926
|
+
dialogComponentProps: {
|
|
927
|
+
type: r,
|
|
928
|
+
action: e,
|
|
929
|
+
onSubmit: async (i) => {
|
|
930
|
+
await v(
|
|
931
|
+
async () => {
|
|
932
|
+
const M = {
|
|
933
|
+
"credit-send": ce.sendCredit,
|
|
934
|
+
"credit-deduct": ce.deductCredit,
|
|
935
|
+
"coin-send": ce.sendCoin,
|
|
936
|
+
"coin-deduct": ce.deductCoin
|
|
937
|
+
}, T = `${r}-${e}`, q = M[T];
|
|
938
|
+
q && await q(m.member._id, i), f("update:member"), u.close();
|
|
939
|
+
},
|
|
940
|
+
{
|
|
941
|
+
message: `Adjusting ${_e.formattedType(
|
|
942
|
+
r.toUpperCase()
|
|
943
|
+
).toLowerCase()}`,
|
|
944
|
+
successMessage: `${i.amount} ${_e.formattedType(
|
|
945
|
+
r.toUpperCase()
|
|
946
|
+
).toLowerCase()} ${e} ${e == "send" ? "to" : "from"} ${m.member.phoneNumber}`
|
|
947
|
+
}
|
|
948
|
+
);
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
});
|
|
952
|
+
}
|
|
953
|
+
async function re() {
|
|
954
|
+
u.open({
|
|
955
|
+
title: "Update member statistics",
|
|
956
|
+
contentComponent: mt,
|
|
957
|
+
contentComponentProps: {
|
|
958
|
+
member: m.member,
|
|
959
|
+
onSubmit: async (r) => {
|
|
960
|
+
await v(
|
|
961
|
+
async () => {
|
|
962
|
+
await ce.updateMember(m.member._id, r), f("update:member"), u.close();
|
|
963
|
+
},
|
|
964
|
+
{
|
|
965
|
+
message: "Updating member stats",
|
|
966
|
+
successMessage: `Updated member ${m.member.phoneNumber} stats successfully`
|
|
967
|
+
}
|
|
968
|
+
);
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
});
|
|
972
|
+
}
|
|
973
|
+
const p = [
|
|
974
|
+
{
|
|
975
|
+
label: "Mobile No.",
|
|
976
|
+
key: "phoneNumber"
|
|
977
|
+
},
|
|
978
|
+
{
|
|
979
|
+
label: "Tier",
|
|
980
|
+
getter: (r) => {
|
|
981
|
+
var Z, de, pe, y, B;
|
|
982
|
+
const e = (((de = Me.first((Z = m.member.collection) == null ? void 0 : Z.TIER)) == null ? void 0 : de.balance) || 0) - 1, i = g.value.name, M = ((y = (pe = r.collection) == null ? void 0 : pe.POINT) == null ? void 0 : y[0].balance) ?? 0, T = l.sortedTiers[e + 1], q = ((B = T == null ? void 0 : T.option) == null ? void 0 : B.from) ?? 1 / 0;
|
|
983
|
+
return `${i} (${M}/${q})`;
|
|
984
|
+
}
|
|
985
|
+
},
|
|
986
|
+
{
|
|
987
|
+
label: "Email",
|
|
988
|
+
key: "email"
|
|
989
|
+
},
|
|
990
|
+
{
|
|
991
|
+
label: "Birthday",
|
|
992
|
+
getter: (r) => r.birthday ? _(r.birthday).format("D MMM YYYY") : "-"
|
|
993
|
+
}
|
|
994
|
+
], a = [
|
|
995
|
+
{
|
|
996
|
+
label: "Customer since",
|
|
997
|
+
getter: (r) => _(r.joinAt || ge(r._id.toString())).format("D MMM YYYY")
|
|
998
|
+
},
|
|
999
|
+
{
|
|
1000
|
+
label: "Joined at location",
|
|
1001
|
+
getter: (r) => {
|
|
1002
|
+
var e;
|
|
1003
|
+
return r != null && r.location && ((e = A.value.find((i) => i.value == r.location)) == null ? void 0 : e.label) || "-";
|
|
1004
|
+
}
|
|
1005
|
+
},
|
|
1006
|
+
{
|
|
1007
|
+
label: "Total visit(s)",
|
|
1008
|
+
getter: (r) => Ae.singularOrPlural(r.stats.visitCount, "bill")
|
|
1009
|
+
},
|
|
1010
|
+
{
|
|
1011
|
+
label: "Last visit",
|
|
1012
|
+
getter: (r) => _(r.stats.lastVisit).fromNow()
|
|
1013
|
+
},
|
|
1014
|
+
{
|
|
1015
|
+
label: "Frequency",
|
|
1016
|
+
getter: (r) => `Every ${Ae.singularOrPlural(
|
|
1017
|
+
Number(Math.ceil(r.stats.avgVisitFrequency).toFixed(0)),
|
|
1018
|
+
"day"
|
|
1019
|
+
)}`
|
|
1020
|
+
},
|
|
1021
|
+
{
|
|
1022
|
+
label: "Average spend",
|
|
1023
|
+
getter: (r) => Pe.Dinero.fromNumber({ number: Number(r.stats.avgBillSize || 0) }).toFormat(
|
|
1024
|
+
!0
|
|
1025
|
+
)
|
|
1026
|
+
}
|
|
1027
|
+
// {
|
|
1028
|
+
// label: 'Feedback',
|
|
1029
|
+
// key: 'feedbackCount',
|
|
1030
|
+
// },
|
|
1031
|
+
], g = O(() => {
|
|
1032
|
+
var i, M;
|
|
1033
|
+
const r = (((M = Me.first((i = m.member.collection) == null ? void 0 : i.TIER)) == null ? void 0 : M.balance) || 0) - 1, e = l.sortedTiers[r];
|
|
1034
|
+
return { name: (e == null ? void 0 : e.name) || "-", tier: r, config: e };
|
|
1035
|
+
}), V = O(() => {
|
|
1036
|
+
var r;
|
|
1037
|
+
return (((r = m.member.collection) == null ? void 0 : r.TITLE) || []).map((e) => {
|
|
1038
|
+
var M, T, q;
|
|
1039
|
+
const i = (M = l.sortedTitles) == null ? void 0 : M.find(
|
|
1040
|
+
(Z) => Z._id == e.collectible
|
|
1041
|
+
);
|
|
1042
|
+
return {
|
|
1043
|
+
name: i == null ? void 0 : i.name,
|
|
1044
|
+
expiredAt: (q = (T = e.expiryBalance) == null ? void 0 : T.at(-1)) == null ? void 0 : q.expiredAt,
|
|
1045
|
+
collectible: i
|
|
1046
|
+
};
|
|
1047
|
+
}).filter(
|
|
1048
|
+
(e) => e.expiredAt ? _(e.expiredAt).isAfter(_()) : !0
|
|
1049
|
+
);
|
|
1050
|
+
}), N = G({ stamp: 0, progressive: 0 }), L = G({ active: 0, past: 0 }), K = G([]), X = O(
|
|
1051
|
+
() => K.value.reduce((r, e) => r + e.count, 0)
|
|
1052
|
+
), E = G(!0);
|
|
1053
|
+
function W() {
|
|
1054
|
+
E.value = !0, R.value = j[0];
|
|
1055
|
+
}
|
|
1056
|
+
function ne() {
|
|
1057
|
+
E.value = !1;
|
|
1058
|
+
}
|
|
1059
|
+
const j = [
|
|
1060
|
+
{
|
|
1061
|
+
label: "Overview",
|
|
1062
|
+
value: "overview"
|
|
1063
|
+
},
|
|
1064
|
+
{
|
|
1065
|
+
label: "Loyalty",
|
|
1066
|
+
value: "loyalty"
|
|
1067
|
+
},
|
|
1068
|
+
{
|
|
1069
|
+
label: "Voucher",
|
|
1070
|
+
value: "voucher"
|
|
1071
|
+
},
|
|
1072
|
+
{
|
|
1073
|
+
label: "Mission",
|
|
1074
|
+
value: "mission"
|
|
1075
|
+
},
|
|
1076
|
+
{
|
|
1077
|
+
label: "Game",
|
|
1078
|
+
value: "game"
|
|
1079
|
+
}
|
|
1080
|
+
], R = G(j[0]), w = async () => {
|
|
1081
|
+
L.value = await ve.readCollectionCountByMemberId(
|
|
1082
|
+
m.member._id.toString(),
|
|
1083
|
+
he.enum.VOUCHER
|
|
1084
|
+
), K.value = await rt.readPurchaseCountByMember(
|
|
1085
|
+
m.member._id.toString()
|
|
1086
|
+
), N.value = await ve.readMissionCountByMemberId(
|
|
1087
|
+
m.member._id.toString()
|
|
1088
|
+
);
|
|
1089
|
+
};
|
|
1090
|
+
return Ye(async () => {
|
|
1091
|
+
await l.readMembership(), await w(), s.locations.length || await s.readLocations();
|
|
1092
|
+
}), $e(E, async () => {
|
|
1093
|
+
await w();
|
|
1094
|
+
}), F({
|
|
1095
|
+
showSheet: W,
|
|
1096
|
+
hideSheet: ne
|
|
1097
|
+
}), (r, e) => {
|
|
1098
|
+
const i = k("FmTabs"), M = k("FmAvatar"), T = k("FmButton"), q = k("FmIcon"), Z = k("FmChip"), de = k("FmCard"), pe = k("FmSideSheet");
|
|
1099
|
+
return d(), I(pe, {
|
|
1100
|
+
modelValue: t(E),
|
|
1101
|
+
"onUpdate:modelValue": e[5] || (e[5] = (y) => Ue(E) ? E.value = y : null),
|
|
1102
|
+
header: "Member Detail",
|
|
1103
|
+
"dismiss-away": "",
|
|
1104
|
+
"close-button": !0,
|
|
1105
|
+
"max-width": 1100
|
|
1106
|
+
}, {
|
|
1107
|
+
"side-sheet-footer": ae(() => [...e[21] || (e[21] = [])]),
|
|
1108
|
+
default: ae(() => [
|
|
1109
|
+
o("div", Mt, [
|
|
1110
|
+
o("div", null, [
|
|
1111
|
+
x(i, {
|
|
1112
|
+
"model-value": t(R).value,
|
|
1113
|
+
items: j,
|
|
1114
|
+
class: "overflow-x-auto",
|
|
1115
|
+
"onUpdate:modelValue": e[0] || (e[0] = (y) => R.value = j.find((B) => B.value === y))
|
|
1116
|
+
}, null, 8, ["model-value"])
|
|
1117
|
+
]),
|
|
1118
|
+
t(R).value == "overview" ? (d(), C(D, { key: 0 }, [
|
|
1119
|
+
o("div", kt, [
|
|
1120
|
+
o("div", null, [
|
|
1121
|
+
e[9] || (e[9] = o("div", { class: "fm-typo-en-title-sm-800 mb-16" }, "Profile Information", -1)),
|
|
1122
|
+
o("div", At, [
|
|
1123
|
+
o("div", Tt, [
|
|
1124
|
+
x(M, {
|
|
1125
|
+
name: c.member.photoUrl ? void 0 : c.member.name,
|
|
1126
|
+
src: c.member.photoUrl || void 0
|
|
1127
|
+
}, null, 8, ["name", "src"]),
|
|
1128
|
+
o("div", $t, [
|
|
1129
|
+
e[8] || (e[8] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Member Name ", -1)),
|
|
1130
|
+
o("div", Vt, S(c.member.name), 1),
|
|
1131
|
+
o("div", Et, S(c.member._id), 1),
|
|
1132
|
+
o("div", Bt, [
|
|
1133
|
+
e[6] || (e[6] = ye(" Member Card: ", -1)),
|
|
1134
|
+
o("span", Dt, S(c.member.cardNo ? c.member.cardNo : "-"), 1)
|
|
1135
|
+
]),
|
|
1136
|
+
o("div", It, [
|
|
1137
|
+
e[7] || (e[7] = ye(" Referral Code: ", -1)),
|
|
1138
|
+
o("span", Yt, S(c.member.referralCode ? c.member.referralCode : "-"), 1)
|
|
1139
|
+
])
|
|
1140
|
+
]),
|
|
1141
|
+
x(T, {
|
|
1142
|
+
variant: "tertiary",
|
|
1143
|
+
icon: "settings",
|
|
1144
|
+
onClick: re
|
|
1145
|
+
})
|
|
1146
|
+
]),
|
|
1147
|
+
(d(), C(D, null, J(p, (y, B) => o("div", { key: B }, [
|
|
1148
|
+
o("div", Ut, S(y.label), 1),
|
|
1149
|
+
o("div", Nt, S(y.key ? c.member[y.key] : y.getter(c.member)), 1)
|
|
1150
|
+
])), 64))
|
|
1151
|
+
])
|
|
1152
|
+
]),
|
|
1153
|
+
o("div", null, [
|
|
1154
|
+
e[10] || (e[10] = o("div", { class: "fm-typo-en-title-sm-800 mb-16" }, "Activities", -1)),
|
|
1155
|
+
o("div", Pt, [
|
|
1156
|
+
(d(), C(D, null, J(a, (y) => o("div", {
|
|
1157
|
+
key: y.key
|
|
1158
|
+
}, [
|
|
1159
|
+
o("div", Ot, S(y.label), 1),
|
|
1160
|
+
o("div", Rt, S(y.key ? m.member.stats[y.key] || "-" : y.getter(c.member)), 1)
|
|
1161
|
+
])), 64))
|
|
1162
|
+
])
|
|
1163
|
+
])
|
|
1164
|
+
]),
|
|
1165
|
+
e[13] || (e[13] = o("div", { class: "border-fm-color-neutral-gray-100 rounded-sm border-t" }, null, -1)),
|
|
1166
|
+
(d(!0), C(D, null, J(t(te), (y) => (d(), C("div", Lt, [
|
|
1167
|
+
(d(!0), C(D, null, J(y, (B, ee) => (d(), C("div", { key: ee }, [
|
|
1168
|
+
o("div", {
|
|
1169
|
+
class: Ne(ee !== 0 ? "pt-12 md:pt-0 lg:pt-0 md:pl-12 lg:pl-12" : "")
|
|
1170
|
+
}, [
|
|
1171
|
+
o("div", jt, [
|
|
1172
|
+
o("div", qt, S(B.label), 1),
|
|
1173
|
+
o("button", {
|
|
1174
|
+
onClick: (z) => oe(z, B.label)
|
|
1175
|
+
}, [
|
|
1176
|
+
x(q, {
|
|
1177
|
+
name: "chevron_right",
|
|
1178
|
+
outline: "",
|
|
1179
|
+
size: "md"
|
|
1180
|
+
})
|
|
1181
|
+
], 8, zt)
|
|
1182
|
+
]),
|
|
1183
|
+
o("div", Gt, [
|
|
1184
|
+
(d(!0), C(D, null, J(B.stats, (z) => (d(), C("div", {
|
|
1185
|
+
key: z.key
|
|
1186
|
+
}, [
|
|
1187
|
+
o("div", Ht, S(z.label), 1),
|
|
1188
|
+
o("div", Kt, S(z.getter(c.member)), 1)
|
|
1189
|
+
]))), 128))
|
|
1190
|
+
])
|
|
1191
|
+
], 2)
|
|
1192
|
+
]))), 128))
|
|
1193
|
+
]))), 256)),
|
|
1194
|
+
o("div", Wt, [
|
|
1195
|
+
e[11] || (e[11] = o("div", { class: "fm-typo-en-title-sm-800" }, "Segments", -1)),
|
|
1196
|
+
t(Y).length ? (d(), C("div", Xt, [
|
|
1197
|
+
(d(!0), C(D, null, J(t(Y), (y) => (d(), I(Z, {
|
|
1198
|
+
label: y.toString()
|
|
1199
|
+
}, null, 8, ["label"]))), 256))
|
|
1200
|
+
])) : (d(), C("div", Jt, "No titles"))
|
|
1201
|
+
]),
|
|
1202
|
+
e[14] || (e[14] = o("div", { class: "border-fm-color-neutral-gray-100 rounded-sm border-t" }, null, -1)),
|
|
1203
|
+
o("div", Qt, [
|
|
1204
|
+
e[12] || (e[12] = o("div", { class: "fm-typo-en-title-sm-800" }, "Title badge", -1)),
|
|
1205
|
+
t(V).length ? (d(!0), C(D, { key: 0 }, J(t(V).filter((y) => y.collectible), (y) => (d(), C("div", {
|
|
1206
|
+
class: "flex items-center gap-x-8 h-48",
|
|
1207
|
+
key: y.name
|
|
1208
|
+
}, [
|
|
1209
|
+
o("img", {
|
|
1210
|
+
src: y.collectible.image || t(Re),
|
|
1211
|
+
class: "aspect-square h-full object-contain"
|
|
1212
|
+
}, null, 8, Zt),
|
|
1213
|
+
o("div", null, [
|
|
1214
|
+
o("div", eo, S(y.name), 1),
|
|
1215
|
+
o("div", to, " Expired on " + S(t(_)(y.expiredAt).format("MMM D, Y")), 1)
|
|
1216
|
+
])
|
|
1217
|
+
]))), 128)) : (d(), C("div", oo, "No titles"))
|
|
1218
|
+
])
|
|
1219
|
+
], 64)) : t(R).value == "loyalty" ? (d(), C("div", ro, [
|
|
1220
|
+
x(de, {
|
|
1221
|
+
class: "p-16 space-y-24",
|
|
1222
|
+
variant: "outlined"
|
|
1223
|
+
}, {
|
|
1224
|
+
default: ae(() => {
|
|
1225
|
+
var y, B, ee, z;
|
|
1226
|
+
return [
|
|
1227
|
+
o("div", no, [
|
|
1228
|
+
e[15] || (e[15] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Total credit ", -1)),
|
|
1229
|
+
o("div", so, S(t(P)(t($).total, 2)), 1)
|
|
1230
|
+
]),
|
|
1231
|
+
o("div", lo, [
|
|
1232
|
+
o("div", ao, [
|
|
1233
|
+
e[16] || (e[16] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Normal credit ", -1)),
|
|
1234
|
+
o("div", io, S(t(P)(t($).normal, 2)), 1)
|
|
1235
|
+
]),
|
|
1236
|
+
o("div", mo, [
|
|
1237
|
+
e[17] || (e[17] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Free credit (with expiry) ", -1)),
|
|
1238
|
+
o("div", co, S(t(P)(t($).free, 2)), 1)
|
|
1239
|
+
])
|
|
1240
|
+
]),
|
|
1241
|
+
o("div", uo, [
|
|
1242
|
+
e[18] || (e[18] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Credit(s) to be expired in 30 days ", -1)),
|
|
1243
|
+
o("div", po, S(((z = (ee = (B = (y = c.member.collection) == null ? void 0 : y.CREDIT) == null ? void 0 : B[0]) == null ? void 0 : ee.expiryBalance) == null ? void 0 : z.reduce(
|
|
1244
|
+
(se, le) => le.expiredAt && t(_)(le.expiredAt).isAfter(t(_)()) && t(_)(le.expiredAt).isBefore(t(_)().add(30, "days")) ? se + le.amount : se,
|
|
1245
|
+
0
|
|
1246
|
+
)) ?? 0), 1)
|
|
1247
|
+
]),
|
|
1248
|
+
o("div", bo, [
|
|
1249
|
+
x(T, {
|
|
1250
|
+
label: "Add credit",
|
|
1251
|
+
icon: "add",
|
|
1252
|
+
variant: "plain",
|
|
1253
|
+
onClick: e[1] || (e[1] = (se) => H("credit", "send"))
|
|
1254
|
+
}),
|
|
1255
|
+
x(T, {
|
|
1256
|
+
label: "Deduct credit",
|
|
1257
|
+
icon: "remove",
|
|
1258
|
+
variant: "plain",
|
|
1259
|
+
onClick: e[2] || (e[2] = (se) => H("credit", "deduct"))
|
|
1260
|
+
})
|
|
1261
|
+
])
|
|
1262
|
+
];
|
|
1263
|
+
}),
|
|
1264
|
+
_: 1
|
|
1265
|
+
}),
|
|
1266
|
+
x(de, {
|
|
1267
|
+
class: "p-16 space-y-24",
|
|
1268
|
+
variant: "outlined"
|
|
1269
|
+
}, {
|
|
1270
|
+
default: ae(() => {
|
|
1271
|
+
var y, B, ee, z, se, le, Se;
|
|
1272
|
+
return [
|
|
1273
|
+
o("div", fo, [
|
|
1274
|
+
e[19] || (e[19] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Point ", -1)),
|
|
1275
|
+
o("div", yo, S(((ee = (B = (y = c.member.collection) == null ? void 0 : y.COIN) == null ? void 0 : B[0]) == null ? void 0 : ee.balance) ?? 0), 1)
|
|
1276
|
+
]),
|
|
1277
|
+
o("div", vo, [
|
|
1278
|
+
e[20] || (e[20] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Point(s) to be expired in 30 days ", -1)),
|
|
1279
|
+
o("div", go, S(((Se = (le = (se = (z = c.member.collection) == null ? void 0 : z.COIN) == null ? void 0 : se[0]) == null ? void 0 : le.expiryBalance) == null ? void 0 : Se.reduce(
|
|
1280
|
+
(be, fe) => fe.expiredAt && t(_)(fe.expiredAt).isAfter(t(_)()) && t(_)(fe.expiredAt).isBefore(t(_)().add(30, "days")) ? be + fe.amount : be,
|
|
1281
|
+
0
|
|
1282
|
+
)) ?? 0), 1)
|
|
1283
|
+
]),
|
|
1284
|
+
o("div", xo, [
|
|
1285
|
+
x(T, {
|
|
1286
|
+
label: "Add point",
|
|
1287
|
+
icon: "add",
|
|
1288
|
+
variant: "plain",
|
|
1289
|
+
onClick: e[3] || (e[3] = (be) => H("coin", "send"))
|
|
1290
|
+
}),
|
|
1291
|
+
x(T, {
|
|
1292
|
+
label: "Deduct point",
|
|
1293
|
+
icon: "remove",
|
|
1294
|
+
variant: "plain",
|
|
1295
|
+
onClick: e[4] || (e[4] = (be) => H("coin", "deduct"))
|
|
1296
|
+
})
|
|
1297
|
+
])
|
|
1298
|
+
];
|
|
1299
|
+
}),
|
|
1300
|
+
_: 1
|
|
1301
|
+
})
|
|
1302
|
+
])) : t(R).value == "voucher" ? (d(), I(St, {
|
|
1303
|
+
key: 2,
|
|
1304
|
+
member: m.member
|
|
1305
|
+
}, null, 8, ["member"])) : t(R).value == "mission" ? (d(), I(Ft, {
|
|
1306
|
+
key: 3,
|
|
1307
|
+
member: m.member
|
|
1308
|
+
}, null, 8, ["member"])) : t(R).value == "game" ? (d(), I(wt, {
|
|
1309
|
+
key: 4,
|
|
1310
|
+
member: m.member
|
|
1311
|
+
}, null, 8, ["member"])) : Q("", !0)
|
|
1312
|
+
])
|
|
1313
|
+
]),
|
|
1314
|
+
_: 1
|
|
1315
|
+
}, 8, ["modelValue"]);
|
|
1316
|
+
};
|
|
1317
|
+
}
|
|
1318
|
+
});
|
|
1319
|
+
export {
|
|
1320
|
+
er as _,
|
|
1321
|
+
bt as u
|
|
1322
|
+
};
|