@feedmepos/mf-connect 0.1.126-dev → 0.1.127-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.
Files changed (141) hide show
  1. package/dist/{App-B_Yp6cvN.js → App-CLrxVFgX.js} +10 -10
  2. package/dist/{AuditLogs-C1U17evK.js → AuditLogs-DYlfToAk.js} +13 -13
  3. package/dist/{Bin-CmIpEIwe.js → Bin-C0CugBW4.js} +8 -8
  4. package/dist/{Broadcast-DkV4BdU_.js → Broadcast-DhVQa_WW.js} +12 -12
  5. package/dist/{CampaignAnalytic-Dkwo_lpB.js → CampaignAnalytic-6jeG5U90.js} +97 -97
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Ch8Gblw6.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cxydrkof.js} +9 -9
  7. package/dist/{Card-DXCkG34M.js → Card-cpLj34Oy.js} +23 -23
  8. package/dist/{Collections-CybPfSO4.js → Collections-CdRpJuHO.js} +8 -8
  9. package/dist/{Credit-B-KUzWsX.js → Credit-E_N_yfnJ.js} +12 -12
  10. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-CWHYeYVD.js → DateRangeChip.vue_vue_type_script_setup_true_lang-Dq-2vUqT.js} +1 -1
  11. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C86llTFR.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CSXO2bYC.js} +1285 -1140
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-nMcH6y5e.js → EffectSheet.vue_vue_type_style_index_0_lang-BeQZjLIw.js} +6 -6
  13. package/dist/{Experience-Q2NHpa-V.js → Experience-D9i0ax4C.js} +13 -13
  14. package/dist/{FileSaver.min-CKw2rn-J.js → FileSaver.min-BOE2RBne.js} +1 -1
  15. package/dist/{Game-lZvkg04z.js → Game-CirwX_l1.js} +13 -13
  16. package/dist/{GiftCardSetup-CPRju80_.js → GiftCardSetup-DpJb_azW.js} +10 -10
  17. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-Ci686UoB.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-ff6Nfvxe.js} +140 -128
  18. package/dist/{Goals-asGsUeVv.js → Goals-TejbPs-I.js} +4 -4
  19. package/dist/{Grab-BjFLSMpE.js → Grab-CeUX-LlF.js} +9 -9
  20. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-nk87zPWH.js → ImageInput.vue_vue_type_script_setup_true_lang-CnZzRDGS.js} +1 -1
  21. package/dist/{Index-DIasPS4Y.js → Index-gqWBDZBN.js} +10 -10
  22. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-DkOn8p1v.js → LocationPicker.vue_vue_type_script_setup_true_lang-CzobgD7L.js} +1 -1
  23. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-BdSkxiP-.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DgeD1RQq.js} +1 -1
  24. package/dist/{LoyaltyDashboard-DlCsZ3YX.js → LoyaltyDashboard-R22oQHTd.js} +82 -82
  25. package/dist/{MainLayout-DLObnTAA.js → MainLayout-pJBEBaM-.js} +1 -1
  26. package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-DigSZKt1.js → MainLayout.vue_vue_type_script_setup_true_lang-IX_utv2Z.js} +3 -3
  27. package/dist/{Marketing-JflPW-w9.js → Marketing-5gMwO1jV.js} +4 -4
  28. package/dist/{MarketingMaterialEdit-fSAB3YVb.js → MarketingMaterialEdit-BaHNX_qE.js} +6 -6
  29. package/dist/{Member-CzNahXTj.js → Member-Cd0oraEq.js} +7 -7
  30. package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-DzyM1fW_.js +1322 -0
  31. package/dist/{MemberImportHistory--r_A_2Es.js → MemberImportHistory-C_RkY3fg.js} +7 -7
  32. package/dist/{MemberList-CQZQ4sN8.js → MemberList-CJK1akUC.js} +14 -14
  33. package/dist/{MemberTransactions-BPg9JaUA.js → MemberTransactions-DP6schuy.js} +1 -1
  34. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BhIFChx-.js → MessageInput.vue_vue_type_script_setup_true_lang-BaivunRx.js} +10 -10
  35. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CdGSNqEp.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DOdYyPp2.js} +1 -1
  36. package/dist/{Mission-CYCB3YQc.js → Mission-DJ40IcG9.js} +14 -14
  37. package/dist/{Overview-B5ylMBHT.js → Overview-CaQlLSBg.js} +4 -4
  38. package/dist/{Overview-DuNuUYYq.js → Overview-DXHjNmIO.js} +21 -21
  39. package/dist/{Point-DG-Uwj25.js → Point-D0Qqmgai.js} +14 -14
  40. package/dist/{Promotion-DqxBQ1yO.js → Promotion-CQU2-tpG.js} +14 -14
  41. package/dist/{Queue-Cy8LGt_Y.js → Queue-B-Uki3qh.js} +13 -13
  42. package/dist/{Record-CzXbu41w.js → Record-BvQ0nVja.js} +9 -9
  43. package/dist/{Review-7VL6gIqp.js → Review-DMfBPU_D.js} +2 -2
  44. package/dist/{ReviewFacebookCallback-BwzuPmrz.js → ReviewFacebookCallback-Bq6JQ7LR.js} +5 -5
  45. package/dist/{ReviewGoogleCallback-1JXR_f5O.js → ReviewGoogleCallback-Bg9PFxog.js} +5 -5
  46. package/dist/{Reward-BKhUDEu3.js → Reward-CNC0z98e.js} +16 -16
  47. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DjjCytWF.js → RewardGroup.vue_vue_type_script_setup_true_lang-DXr-5wJE.js} +14 -14
  48. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Vg7pRGIz.js → RuleGroup.vue_vue_type_script_setup_true_lang-OznhirAU.js} +15 -15
  49. package/dist/{Segment-DdHDJhaS.js → Segment-V0ZQJkN-.js} +27 -27
  50. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-9kGUkHMi.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-BmFp2pst.js} +15 -15
  51. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DeFw0px7.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-C0IbEZMG.js} +4 -4
  52. package/dist/{Setting-DZKGXw-i.js → Setting-DCb6IIrk.js} +15 -15
  53. package/dist/{SettingAdvertisements-BBNs8tCw.js → SettingAdvertisements-Dc9XfzVl.js} +12 -12
  54. package/dist/{Settings-9v0hnBJZ.js → Settings-BIjIfmFI.js} +5 -5
  55. package/dist/{Store-C8IlE4IH.js → Store-DkoB_5IF.js} +27 -27
  56. package/dist/{StoreRewards-DWygRLR1.js → StoreRewards-a4ujLMfY.js} +15 -15
  57. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-CeYYws6P.js → StoreTransactions.vue_vue_type_script_setup_true_lang-UbMY0RzG.js} +25 -25
  58. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BiN3uRJ_.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BWjb1wHV.js} +2 -2
  59. package/dist/{Tier-7RoxGHsP.js → Tier-1WKuUirS.js} +28 -28
  60. package/dist/{Title-0q2Z4HIe.js → Title-CznZg4jL.js} +23 -23
  61. package/dist/{Transaction-CFasERdg.js → Transaction-DBRQDmA3.js} +2 -2
  62. package/dist/{Upselling-DM9R6pYw.js → Upselling-CjZvUUqn.js} +3 -3
  63. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BDjwcgnc.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DS4hdSE9.js} +6 -6
  64. package/dist/{Voucher-BkzW2hVV.js → Voucher-Di6VhoSM.js} +18 -18
  65. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DaE4xa3x.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BjSzCnBw.js} +12 -12
  66. package/dist/{WhatsappAccount-C3WpDF9O.js → WhatsappAccount-DdXadlHI.js} +6 -6
  67. package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-BxC_3h52.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-Cnlvi-GG.js} +1 -1
  68. package/dist/WhatsappBot-DwhQmZLJ.js +882 -0
  69. package/dist/{WhatsappBotLogs--KskC32Z.js → WhatsappBotLogs-BAglKUAZ.js} +66 -66
  70. package/dist/{WhatsappBotSettings-Dns_PqVE.js → WhatsappBotSettings-DslJTj2X.js} +5 -5
  71. package/dist/{WhatsappLayout-NIrFGbId.js → WhatsappLayout-14847AOz.js} +3 -3
  72. package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-BfD5hHc7.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-otzgv6Jh.js} +3 -3
  73. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CJGxy7gf.js → ZodTextField.vue_vue_type_script_setup_true_lang-BEY-LOVu.js} +2 -2
  74. package/dist/{app-B9nLnoBt.js → app-KbxCI4gY.js} +107 -91
  75. package/dist/app.js +1 -1
  76. package/dist/{base.export-CBzNea0v.js → base.export-DH8OxNrx.js} +2 -2
  77. package/dist/business-DuKNr9P7.js +83 -0
  78. package/dist/{campaign-BDCLKFwN.js → campaign-DR5xHhgA.js} +2 -2
  79. package/dist/{campaign-B6nTwt17.js → campaign-Ddv-RZgo.js} +113 -99
  80. package/dist/{campaign.enum-Dx-Zo68Q.js → campaign.enum-DsaSpHDQ.js} +1 -1
  81. package/dist/{campaign.fn-Ck1t5C1T.js → campaign.fn-CJlEovlZ.js} +142 -142
  82. package/dist/{collectible.enum-Liy2wH3s.js → collectible.enum-CDHT9uk3.js} +1 -1
  83. package/dist/{collection.fn-CDna_VLD.js → collection.fn-DTZs-hUX.js} +2 -2
  84. package/dist/{currency-Baum67Wz.js → currency-1-Yhpyv5.js} +1 -1
  85. package/dist/{duplicateCampaign-BwrMZgaV.js → duplicateCampaign-BncSxYSg.js} +2 -2
  86. package/dist/{effect-CeJbflOK.js → effect-TTD5--LN.js} +1 -1
  87. package/dist/{email-addresses-Y3vF73J0.js → email-addresses-pxXp67Al.js} +2 -2
  88. package/dist/{feature-flag-zn6Ql9tv.js → feature-flag-CFVZl4ed.js} +1 -1
  89. package/dist/{helper-DZvnn-yx.js → helper-BC_Cl5VR.js} +1 -1
  90. package/dist/{index-Da0-7h2j.js → index-42Wl_5UE.js} +1 -1
  91. package/dist/{index-BYUEPfbP.js → index-BRl7Besd.js} +2 -2
  92. package/dist/{index-CPi3Qwmj.js → index-BxUMqeaY.js} +4 -4
  93. package/dist/{index-DHNhIloU.js → index-ByFFDLTo.js} +1 -1
  94. package/dist/{index-njg4JLa-.js → index-CBKbnJRo.js} +9 -9
  95. package/dist/index-CGtlXLTG.js +10767 -0
  96. package/dist/{index-B3LCTMwV.js → index-CRKdLbXL.js} +68 -60
  97. package/dist/{index-CMs3aIA6.js → index-CaHkqz0W.js} +3 -3
  98. package/dist/{index-DkBOM8za.js → index-CcXMYJxc.js} +8 -8
  99. package/dist/{index-DXyOBtgF.js → index-CkiP4iG6.js} +1 -1
  100. package/dist/{index-CDRTiAEu.js → index-D1iOPNg3.js} +1 -1
  101. package/dist/{index-DCR1GFCA.js → index-D2Nq0UoL.js} +6 -6
  102. package/dist/index-D4nA0Z7e.js +19528 -0
  103. package/dist/{index-r_T5o_hF.js → index-DHw8wo7T.js} +2 -2
  104. package/dist/{index-FgM7b2Sw.js → index-DKOoRHPf.js} +4 -4
  105. package/dist/{index-B20FfbEE.js → index-DcbPYZkw.js} +26 -19
  106. package/dist/{index-DXKJsqgW.js → index-DjwrfZk3.js} +18 -18
  107. package/dist/{index-DJIt5tXC.js → index-EuZfRdBT.js} +5 -5
  108. package/dist/{index-juXxYQ_a.js → index-H4XJDOoT.js} +6 -6
  109. package/dist/{index-B5H4znfe.js → index-ImU7YXN7.js} +1 -1
  110. package/dist/{index-B22ojkMy.js → index-N4EzkcEu.js} +2 -2
  111. package/dist/{index-BqniSMV6.js → index-j7eLKJK3.js} +4 -4
  112. package/dist/{index.esm2017-Dtk7BscN.js → index.esm2017-CBo4j3U1.js} +1 -1
  113. package/dist/{loading-PoODMkQD.js → loading-COAu2l7W.js} +1 -1
  114. package/dist/{lodash-TthNgH98.js → lodash-Bu1ipIkR.js} +1 -1
  115. package/dist/{member-import-D7zs0Jvh.js → member-import-CkiTJIqy.js} +2 -2
  116. package/dist/{membership-Cab-iWQ1.js → membership-BSEeYyiz.js} +3 -3
  117. package/dist/{money-9Q306M3g.js → money-BOaGQSGa.js} +1 -1
  118. package/dist/{number-D9M3D435.js → number-B2AC2EMT.js} +1 -1
  119. package/dist/{objectid-DKvQl6FD.js → objectid-BKw48v5L.js} +2 -2
  120. package/dist/{onboarding-D5LKUHVI.js → onboarding-ClA8xAnH.js} +3 -3
  121. package/dist/{onboardingSetup-D0jsS6w5.js → onboardingSetup-DHjnq0H1.js} +2 -2
  122. package/dist/{plugins-CDTKQ1Pg.js → plugins-DewN43sP.js} +3 -3
  123. package/dist/{reward-De3e9vYS.js → reward-deDdPQiR.js} +1 -1
  124. package/dist/{rule-trVJgEOe.js → rule-B8ifutnO.js} +10 -10
  125. package/dist/{template-Bj3Tb6bP.js → template-z3VMmWei.js} +6 -6
  126. package/dist/timezone-BxJDy-bY.js +19 -0
  127. package/dist/{transaction.fn-CPE-oQhA.js → transaction.fn-CBBhq01K.js} +2 -2
  128. package/dist/{trigger-C6oM-8pe.js → trigger-B_quLwWr.js} +5 -5
  129. package/dist/{useMarketingMaterialActions-C5scdJQp.js → useMarketingMaterialActions-DqoRLx1M.js} +4 -4
  130. package/dist/{usePagination-CIuTHSSG.js → usePagination-Q1fPttcp.js} +1 -1
  131. package/dist/{user-Bdlgn2yo.js → user-Bw6h9xn-.js} +1 -1
  132. package/dist/{vue-i18n-DEpDI-dt.js → vue-i18n-DpCS1FnK.js} +109 -109
  133. package/dist/{xlsx-CvecxUOG.js → xlsx--toeD6hC.js} +1 -1
  134. package/dist/{zod-bniyeWdY.js → zod-BkNAcpay.js} +1 -1
  135. package/package.json +1 -1
  136. package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-bqWUIbMG.js +0 -1300
  137. package/dist/WhatsappBot-DZb-Dn3s.js +0 -878
  138. package/dist/business-aT2zslwu.js +0 -82
  139. package/dist/index-BL2zQnXK.js +0 -27551
  140. package/dist/index-C_H8jFYf.js +0 -2743
  141. package/dist/timezone-DkuByUmb.js +0 -20
@@ -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-EuZfRdBT.js";
4
+ import { u as Ve, C as Fe, s as Oe } from "./membership-BSEeYyiz.js";
5
+ import { useDialog as Ce, components as we } from "@feedmepos/ui-library";
6
+ import { _ as Me } from "./lodash-Bu1ipIkR.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-H4XJDOoT.js";
9
+ import "./index-D4nA0Z7e.js";
10
+ import { c as ke, f as Ae } from "./string-Gcy5IM_H.js";
11
+ import { u as He } from "./loading-COAu2l7W.js";
12
+ import { u as Ee } from "./business-DuKNr9P7.js";
13
+ import { p as Te } from "./plugins-DewN43sP.js";
14
+ import { C as _e } from "./collection.fn-DTZs-hUX.js";
15
+ import { defineStore as Ke } from "pinia";
16
+ import { f as P } from "./number-B2AC2EMT.js";
17
+ import "./index-CcXMYJxc.js";
18
+ import "./index-BxUMqeaY.js";
19
+ import "./index-D2Nq0UoL.js";
20
+ import "./index-DKOoRHPf.js";
21
+ import "./index-CRKdLbXL.js";
22
+ import "./index-DcbPYZkw.js";
23
+ import "./index-42Wl_5UE.js";
24
+ import { s as We } from "./index-CuvNtC_M.js";
25
+ import { u as Xe, _ as Je } from "./usePagination-Q1fPttcp.js";
26
+ import { B as Qe, e as Ze } from "./base.export-DH8OxNrx.js";
27
+ import { m as ve } from "./index-CaHkqz0W.js";
28
+ import { o as ge } from "./objectId-dwaoBfJX.js";
29
+ import { F as he } from "./collectible.enum-CDHT9uk3.js";
30
+ import { a as et, c as tt } from "./campaign-Ddv-RZgo.js";
31
+ import { useRouter as ot } from "vue-router";
32
+ import { m as ce } from "./index-N4EzkcEu.js";
33
+ import { t as rt } from "./index-BRl7Besd.js";
34
+ import { R as nt } from "./app-KbxCI4gY.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
+ };