@feedmepos/mf-connect 0.1.124-dev → 0.1.124-prod

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/dist/{App-C7BnLHSt.js → App-DMh2xABv.js} +493 -502
  2. package/dist/{Bin-Bq7yY0I2.js → Bin-C_pkPgIo.js} +8 -8
  3. package/dist/{Broadcast-D52rPmVl.js → Broadcast-6ZJzdY0b.js} +21 -22
  4. package/dist/{CampaignAnalytic-DpiWtzIp.js → CampaignAnalytic-CLd5ecQe.js} +7 -7
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B1eAAN64.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-C4OWhhAx.js} +9 -8
  6. package/dist/{Card-BQc7vud2.js → Card-CkS8F43U.js} +22 -22
  7. package/dist/{Collections--VzkneGp.js → Collections-BA9I-dDz.js} +185 -197
  8. package/dist/{Credit-DhfAcw-p.js → Credit-CXm0A-qe.js} +20 -21
  9. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-D2Csdg-3.js → DateRangeChip.vue_vue_type_script_setup_true_lang-DzsHTlrN.js} +1 -1
  10. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-C5INV6R7.js +3493 -0
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Cr2_XbyY.js → EffectSheet.vue_vue_type_style_index_0_lang-zSPUBUSz.js} +16 -16
  12. package/dist/{Experience-CUwbHfo5.js → Experience-Bq4ykqTJ.js} +31 -32
  13. package/dist/{FileSaver.min-DvZpiwMd.js → FileSaver.min-BtBxrIBi.js} +1 -1
  14. package/dist/{Game-CI5-y0JJ.js → Game-DpLFmP-G.js} +18 -19
  15. package/dist/{GiftCardSetup-CGacqQ0j.js → GiftCardSetup-BqOqEUim.js} +31 -31
  16. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-B6POxDLJ.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-B06xj5q7.js} +7 -7
  17. package/dist/{Goals-fqJY9iMx.js → Goals-DMlNeiUc.js} +4 -4
  18. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-DTKf7uR-.js → ImageInput.vue_vue_type_script_setup_true_lang-DPWRgxG_.js} +1 -1
  19. package/dist/{Index-CT1Gnjsv.js → Index-Cw07jj0k.js} +10 -10
  20. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-BRQ12Yum.js → LocationPicker.vue_vue_type_script_setup_true_lang-CLjjquVP.js} +1 -1
  21. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-BRzuWJ1Y.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DHOShJQp.js} +1 -1
  22. package/dist/{LoyaltyDashboard-IJIDEBWf.js → LoyaltyDashboard-DzSiK6M7.js} +15 -15
  23. package/dist/{MainLayout-BMghr-wf.js → MainLayout-1EF680_j.js} +1 -1
  24. package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-BitJKgvd.js → MainLayout.vue_vue_type_script_setup_true_lang-Df9pBgH9.js} +3 -3
  25. package/dist/{Marketing-Ckr9cp3w.js → Marketing-T-epFsvG.js} +4 -4
  26. package/dist/{MarketingMaterialEdit-BIZnE8CY.js → MarketingMaterialEdit-CVhPfyEp.js} +211 -214
  27. package/dist/{Member-d1nPxr74.js → Member-BUZOPyQR.js} +7 -7
  28. package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-zURjtl1z.js +1308 -0
  29. package/dist/{MemberImportHistory-CxX9iYhV.js → MemberImportHistory-DGz9i6L7.js} +7 -7
  30. package/dist/{MemberList-DUzYpxhj.js → MemberList-CNdSrzBa.js} +105 -103
  31. package/dist/{MemberTransactions-BFM3ybeo.js → MemberTransactions-CdQMuQsd.js} +1 -1
  32. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-B5j0YBix.js → MessageInput.vue_vue_type_script_setup_true_lang-CWKVXeCa.js} +12 -12
  33. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DsSHSbBB.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-xZitIoXE.js} +1 -1
  34. package/dist/{Mission-De9BF5wb.js → Mission-CYxgMBPt.js} +21 -22
  35. package/dist/{Overview-Pmxqv6qp.js → Overview-DSm8AfDB.js} +20 -20
  36. package/dist/{Overview-DeHo3gef.js → Overview-qZ1KKw9D.js} +144 -145
  37. package/dist/{Point-DE_Cc85N.js → Point-BGlbT9OK.js} +21 -22
  38. package/dist/{Promotion-cZDzgho4.js → Promotion-CtlrUFa8.js} +131 -137
  39. package/dist/{Queue-DmDbrtTk.js → Queue-Dc_z9MKc.js} +45 -45
  40. package/dist/{Record-uxNNOvmK.js → Record-DVKrhFwJ.js} +9 -9
  41. package/dist/{Review-CIIn_Bdx.js → Review-Bh8Tw_QU.js} +2 -2
  42. package/dist/ReviewFacebookCallback-ZZ0pxplM.js +238 -0
  43. package/dist/{ReviewGoogleCallback-B7kmGwb_.js → ReviewGoogleCallback-CsSCz_C5.js} +5 -5
  44. package/dist/{Reward-Bj1snFu8.js → Reward-DY1Q3m1w.js} +16 -16
  45. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BO-36dE4.js → RewardGroup.vue_vue_type_script_setup_true_lang-4A91EkSW.js} +13 -13
  46. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-JA0XIgqb.js +1884 -0
  47. package/dist/{Segment-BgJgWa6C.js → Segment-D6LchJFl.js} +306 -303
  48. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-D2TDoZgQ.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-CSAtkMnJ.js} +14 -14
  49. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CEBH11hR.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-Co1MQoVq.js} +4 -4
  50. package/dist/Setting-UkdSKiUb.js +578 -0
  51. package/dist/{SettingAdvertisements-vdUtIXwC.js → SettingAdvertisements-DK97gcus.js} +12 -12
  52. package/dist/Settings-BFcVswDS.js +179 -0
  53. package/dist/{Store-DgltT0RA.js → Store-2VVStL5_.js} +28 -28
  54. package/dist/{StoreRewards-BXH_5cYL.js → StoreRewards-f3Pyb9hu.js} +15 -15
  55. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BmnyPSVT.js +1297 -0
  56. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-CCWNzg4p.js +142 -0
  57. package/dist/{Tier-CqfHGUX0.js → Tier-D4Of9P17.js} +687 -2575
  58. package/dist/{Title-B5VnUNiS.js → Title-Cg6X9UkB.js} +94 -95
  59. package/dist/{Transaction-BZh1Q9Lj.js → Transaction-LJbjQnj_.js} +2 -2
  60. package/dist/Upselling-B-VwbtjT.js +214 -0
  61. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-Buj7CRlQ.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DqH6Upx-.js} +26 -26
  62. package/dist/{Voucher-CZJdV2Ok.js → Voucher-BJG6VKXt.js} +19 -19
  63. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-65x2VrpD.js → VoucherEditor.vue_vue_type_script_setup_true_lang-7kYeJthi.js} +12 -12
  64. package/dist/{WhatsappAccount-DsRilNC5.js → WhatsappAccount-Dc1fJWWj.js} +6 -6
  65. package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-Bn26qwx5.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-BV0Bsl7a.js} +1 -1
  66. package/dist/{WhatsappBot-CpzMaTss.js → WhatsappBot-Coq1WP96.js} +6 -6
  67. package/dist/{WhatsappBotLogs-DRF8VufQ.js → WhatsappBotLogs-EH9PQVn9.js} +6 -6
  68. package/dist/{WhatsappBotSettings-DSUPGC-p.js → WhatsappBotSettings-fNRFecJX.js} +4 -4
  69. package/dist/{WhatsappLayout-BCWYcQmD.js → WhatsappLayout-x9Ovpu6e.js} +3 -3
  70. package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DyxyISRP.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DZlT0uLW.js} +3 -3
  71. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Db-Z7cY_.js → ZodTextField.vue_vue_type_script_setup_true_lang-DSJncfI_.js} +2 -2
  72. package/dist/{app-BQeODViN.js → app-BMFxxLUm.js} +15017 -14861
  73. package/dist/app.js +3 -4
  74. package/dist/{base.export-kSFLDDoC.js → base.export-LmQ51u5f.js} +2 -2
  75. package/dist/{business-EP-Do3Ew.js → business-DZWViiMC.js} +1 -1
  76. package/dist/{campaign-BjnUPowX.js → campaign-C9xvGyrL.js} +28 -34
  77. package/dist/{campaign-C8GgaCub.js → campaign-DZDGbR4W.js} +94 -121
  78. package/dist/{campaign.enum-Dx-Zo68Q.js → campaign.enum-BqekIiiN.js} +1 -2
  79. package/dist/{campaign.fn-DQ--gL4B.js → campaign.fn-OVkj0QLu.js} +87 -87
  80. package/dist/{collection.fn-BhXecwh5.js → collection.fn-DrNrla0B.js} +2 -2
  81. package/dist/{currency-CGMNh1Q_.js → currency-BZv2gSlF.js} +1 -1
  82. package/dist/{effect-Bc6oGIWd.js → effect-CvumfBMY.js} +1 -1
  83. package/dist/{email-addresses-B3KWfUMk.js → email-addresses-79tPeI4j.js} +25 -25
  84. package/dist/{feature-flag-HhjvSuDm.js → feature-flag-CYXnrECh.js} +185 -171
  85. package/dist/google-C3S8u0mT.js +4 -0
  86. package/dist/{helper-D1BYvcED.js → helper-DFjsyjri.js} +1 -1
  87. package/dist/{index-GQv1_jaJ.js → index-B_8PAyia.js} +2 -2
  88. package/dist/{index-C-46QHFh.js → index-Ba1t5vQv.js} +234 -380
  89. package/dist/{index-Yw4M7v7m.js → index-BiPRZRyE.js} +2614 -2699
  90. package/dist/{index-BkevK_Hp.js → index-Bnane9cm.js} +1 -1
  91. package/dist/{index-VLFerh-X.js → index-Bt-n8QuD.js} +10 -10
  92. package/dist/{index-VyoufKYY.js → index-C-pVo6PI.js} +1 -1
  93. package/dist/{index-CsYTLmPa.js → index-C43KoLej.js} +4 -4
  94. package/dist/{index-DeqpfWLa.js → index-C5bC2n8X.js} +3 -3
  95. package/dist/{index-Br2SLVsn.js → index-C6Rx7pjc.js} +251 -608
  96. package/dist/{index-BIBcfAw5.js → index-C6ZTa-eq.js} +1 -1
  97. package/dist/{index-gMrtUwSD.js → index-CA7oIW_T.js} +316 -316
  98. package/dist/{index-Bunp1bt_.js → index-CAWnce4u.js} +1 -1
  99. package/dist/{index-cPPWotJe.js → index-CBd91xYU.js} +10 -10
  100. package/dist/{index-C3MK8Twg.js → index-CNzQ3FLi.js} +1 -1
  101. package/dist/{index-Ptcqv0W6.js → index-CW4rNV1_.js} +2 -2
  102. package/dist/{index-DOSuhtdE.js → index-CcCiEG6N.js} +1 -1
  103. package/dist/{index-DiCgGQoC.js → index-DWZzsJHU.js} +2 -2
  104. package/dist/{index-oIo5Cful.js → index-DZrX13oF.js} +462 -533
  105. package/dist/{index-D2TnjKPP.js → index-MhAbTpBy.js} +23 -23
  106. package/dist/{index-DCC3pLug.js → index-_-nCOZ1D.js} +6 -19
  107. package/dist/{index.esm2017-DUZpLdEB.js → index.esm2017-DtTjnHHc.js} +57 -57
  108. package/dist/{loading-DhpcQgdj.js → loading-DkqEFbrR.js} +1 -1
  109. package/dist/{lodash-r4AR7GJC.js → lodash-BxU_5gPB.js} +1 -1
  110. package/dist/{member-import-CogEef9H.js → member-import-B3NBqSF6.js} +1 -1
  111. package/dist/{membership-BQFkjRjs.js → membership-Dr5BxoL-.js} +2 -2
  112. package/dist/{money-Ifqd4pyC.js → money-D58xuACG.js} +1 -1
  113. package/dist/{number-C9Tw_Ncm.js → number-C9CiD5ci.js} +1 -1
  114. package/dist/objectid-CgTtbB6Q.js +145 -0
  115. package/dist/{onboarding-D4dm_rxU.js → onboarding-BssUSfGQ.js} +36 -36
  116. package/dist/{onboardingSetup-DtNZUoRr.js → onboardingSetup-Dc_lD-K8.js} +2 -2
  117. package/dist/{plugins-DGI9Fkiu.js → plugins-D7Xjefvk.js} +3 -3
  118. package/dist/{reward-DTtejZqM.js → reward-CACqYkQp.js} +1 -1
  119. package/dist/{rule-C4N3ce3c.js → rule-BRaTrwKz.js} +492 -572
  120. package/dist/rule-builder-DZOASGFD.js +102 -0
  121. package/dist/style.css +1 -1
  122. package/dist/template-DdeVPIBt.js +275 -0
  123. package/dist/{timezone-5rYhX7XZ.js → timezone-CgVEOC5i.js} +1 -1
  124. package/dist/{transaction.fn-Ba_U7HdT.js → transaction.fn-C64l_ja_.js} +2 -2
  125. package/dist/{trigger-B8I1aO6Y.js → trigger-d2RIqXLt.js} +9 -9
  126. package/dist/{useMarketingMaterialActions-CTOFHmlL.js → useMarketingMaterialActions-Drf2MY9h.js} +4 -4
  127. package/dist/{usePagination-3wAPVCOp.js → usePagination-IUw34YLE.js} +1 -1
  128. package/dist/{user-Ds4DW_-Y.js → user-ClGyYHyS.js} +1 -1
  129. package/dist/vue-i18n-Cby9s0nj.js +2365 -0
  130. package/dist/{xlsx-xlOCvuAq.js → xlsx-HvtVSofi.js} +166 -166
  131. package/dist/{zod-GVNjvrpT.js → zod-IPdjFU_b.js} +1 -1
  132. package/package.json +2 -6
  133. package/dist/AuditLogs-BPKQdFga.js +0 -2016
  134. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DFz_2GZ1.js +0 -4439
  135. package/dist/Grab-CAx1cCE4.js +0 -301
  136. package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-DI4XM_rJ.js +0 -1281
  137. package/dist/ReviewFacebookCallback-CO6FxHzc.js +0 -225
  138. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-b7ZEMd4s.js +0 -1923
  139. package/dist/Setting-DpEI72mW.js +0 -574
  140. package/dist/Settings-C6yJ1WEB.js +0 -286
  141. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-DqlluwMB.js +0 -1319
  142. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DjCO9U0c.js +0 -7007
  143. package/dist/Upselling-Cf24ub-9.js +0 -1055
  144. package/dist/duplicateCampaign-icqF8Na9.js +0 -51
  145. package/dist/google-BQK68wbe.js +0 -5
  146. package/dist/objectid-D7dqM1a3.js +0 -145
  147. package/dist/template-YhWRyNGp.js +0 -227
  148. package/dist/vue-i18n-Bqlt_-jA.js +0 -2365
@@ -0,0 +1,1308 @@
1
+ import { defineComponent as ie, computed as L, ref as K, resolveComponent as A, openBlock as i, createElementBlock as w, Fragment as U, createElementVNode as o, unref as t, createBlock as D, createCommentVNode as te, createVNode as g, renderList as J, withCtx as le, createTextVNode as ye, toDisplayString as S, withDirectives as Ve, vShow as Be, watch as $e, onBeforeMount as Ie, h as ae, onMounted as De, isRef as Ye, normalizeClass as Ne } from "vue";
2
+ import { h } from "./moment-D7p2TMB-.js";
3
+ import { c as Ue } from "./index-CBd91xYU.js";
4
+ import { u as Ee, C as we, s as Oe } from "./membership-Dr5BxoL-.js";
5
+ import { useDialog as Ce, components as Fe } from "@feedmepos/ui-library";
6
+ import { _ as Me } from "./lodash-BxU_5gPB.js";
7
+ import { D as Pe } from "./type_drinks-D6jnpvwV.js";
8
+ import { b as Re, c as je, d as Le, e as qe, f as ze } from "./index-DZrX13oF.js";
9
+ import "./index-C5bC2n8X.js";
10
+ import { c as ke, f as Ae } from "./string-Gcy5IM_H.js";
11
+ import { u as Ge } from "./loading-DkqEFbrR.js";
12
+ import { p as Te } from "./plugins-D7Xjefvk.js";
13
+ import { C as _e } from "./collection.fn-DrNrla0B.js";
14
+ import { defineStore as He } from "pinia";
15
+ import { u as Ke } from "./business-DZWViiMC.js";
16
+ import { f as j } from "./number-C9CiD5ci.js";
17
+ import "./index-BiPRZRyE.js";
18
+ import "./index-Ba1t5vQv.js";
19
+ import "./index-C6Rx7pjc.js";
20
+ import "./index-CW4rNV1_.js";
21
+ import "./index-I9lmcd2w.js";
22
+ import "./index-CcCiEG6N.js";
23
+ import "./index-Bnane9cm.js";
24
+ import { s as We } from "./index-CuvNtC_M.js";
25
+ import { u as Xe, _ as Je } from "./usePagination-IUw34YLE.js";
26
+ import { B as Qe, e as Ze } from "./base.export-LmQ51u5f.js";
27
+ import { m as ve } from "./index-_-nCOZ1D.js";
28
+ import { o as ge } from "./objectId-dwaoBfJX.js";
29
+ import { F as he } from "./collectible.enum-Liy2wH3s.js";
30
+ import { g as et, b as tt } from "./campaign-DZDGbR4W.js";
31
+ import { useRouter as ot } from "vue-router";
32
+ import { m as ue } from "./index-DWZzsJHU.js";
33
+ import { t as rt } from "./index-MhAbTpBy.js";
34
+ import { R as nt } from "./app-BMFxxLUm.js";
35
+ const st = { class: "flex flex-col" }, lt = { key: 1 }, 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__ */ ie({
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(m) {
48
+ var de, oe, re, W;
49
+ const F = Ce(), p = Ee(), b = m, s = L(
50
+ () => {
51
+ var u;
52
+ return (((u = b.member.collection) == null ? void 0 : u.TITLE) ?? []).reduce(
53
+ (l, _) => {
54
+ var q, z, R, X, N;
55
+ const C = p.sortedTitles.find(
56
+ (Q) => Q._id.toString() === _.collectible
57
+ );
58
+ if (!C) return l;
59
+ const P = [..._.expiryBalance ?? []].sort(
60
+ (Q, me) => h(Q.expiredAt).isAfter(h(me.expiredAt)) ? -1 : 1
61
+ );
62
+ return (q = P[0]) != null && q.expiredAt && h((z = P[0]) == null ? void 0 : z.expiredAt).isBefore(h()) || l.push({
63
+ _id: C._id,
64
+ name: C.name,
65
+ expiredAt: (R = P[0]) != null && R.expiredAt ? h((X = P[0]) == null ? void 0 : X.expiredAt).toISOString() : "",
66
+ expiresIn: h((N = P[0]) == null ? void 0 : N.expiredAt).diff(h(), "days")
67
+ }), l;
68
+ },
69
+ []
70
+ );
71
+ }
72
+ ), r = K({
73
+ cardNo: b.member.cardNo,
74
+ experience: ((oe = (de = b.member.collection) == null ? void 0 : de.POINT) == null ? void 0 : oe[0].balance) ?? 0,
75
+ tier: ((W = (re = b.member.collection) == null ? void 0 : re.TIER) == null ? void 0 : W[0].balance) ?? -1,
76
+ titles: s.value.map((u) => ({ expiredAt: u.expiresIn, id: u._id })) ?? void 0
77
+ }), c = L(
78
+ () => (p.sortedTitles ?? []).map((u) => ({
79
+ label: u.name,
80
+ value: u._id.toString(),
81
+ sublabel: s.value.some((l) => l._id === u._id) ? "Owned" : void 0
82
+ }))
83
+ ), d = L(() => (p.sortedTiers ?? []).map((u, l) => ({
84
+ label: u.name,
85
+ sublabel: `${u.option.from} - ${u.option.to}`,
86
+ from: u.option.from,
87
+ to: u.option.to,
88
+ value: l + 1
89
+ })));
90
+ function x() {
91
+ var _, C;
92
+ const u = ((_ = d.value[(r.value.tier ?? 1) - 1]) == null ? void 0 : _.from) ?? 0, l = (C = d.value[(r.value.tier ?? 1) - 1]) == null ? void 0 : C.to;
93
+ r.value.experience = Math.min(
94
+ l ?? u,
95
+ Math.max(u, r.value.experience ?? 0)
96
+ );
97
+ }
98
+ const a = L(() => {
99
+ var _, C, P, q, z, R;
100
+ const u = ((C = (_ = b.member.collection) == null ? void 0 : _.TIER) == null ? void 0 : C[0].balance) ?? -1, l = ((q = (P = b.member.collection) == null ? void 0 : P.POINT) == null ? void 0 : q[0].balance) ?? 0;
101
+ if (u != r.value.tier) return !0;
102
+ if (r.value.experience && r.value.experience != l) {
103
+ const X = ((z = d.value[u - 1]) == null ? void 0 : z.from) ?? 0, N = ((R = d.value[u - 1]) == null ? void 0 : R.to) ?? 0;
104
+ if (r.value.experience < X || N && r.value.experience > N)
105
+ return !0;
106
+ }
107
+ return !1;
108
+ });
109
+ function f(u) {
110
+ var l;
111
+ return (l = s.value.find((_) => _._id === u)) == null ? void 0 : l.expiresIn;
112
+ }
113
+ const k = L(() => {
114
+ const u = Re.safeParse(r.value);
115
+ return u.success ? void 0 : u.error.errors;
116
+ });
117
+ function V(u) {
118
+ var l, _;
119
+ return (_ = (l = k.value) == null ? void 0 : l.find((C) => C.path.join(".") === u)) == null ? void 0 : _.message;
120
+ }
121
+ function O(u) {
122
+ var l;
123
+ return (l = k.value) == null ? void 0 : l.filter((_) => _.path.join(".").startsWith(u)).map((_) => _.message);
124
+ }
125
+ async function Y() {
126
+ await b.onSubmit(r.value), F.close();
127
+ }
128
+ return (u, l) => {
129
+ var Q, me;
130
+ const _ = A("FmSelect"), C = A("FmStepperField"), P = A("FmTextField"), q = A("FmField"), z = A("FmFormGroup"), R = A("FmButton"), X = A("FmHelperText"), N = A("FmSpacer");
131
+ return i(), w(U, null, [
132
+ o("div", st, [
133
+ l[6] || (l[6] = o("div", { class: "fm-typo-en-title-sm-800 mb-8" }, "Member tiering", -1)),
134
+ t(d).length ? (i(), D(_, {
135
+ key: 0,
136
+ modelValue: t(r).tier,
137
+ "onUpdate:modelValue": [
138
+ l[0] || (l[0] = (M) => t(r).tier = M),
139
+ x
140
+ ],
141
+ label: "Member Tier",
142
+ items: t(d),
143
+ "helper-text": V("tier"),
144
+ "helper-state": V("tier") ? "error" : void 0
145
+ }, null, 8, ["modelValue", "items", "helper-text", "helper-state"])) : te("", !0),
146
+ g(C, {
147
+ "model-value": t(r).experience ?? 0,
148
+ "onUpdate:modelValue": l[1] || (l[1] = (M) => t(r).experience = M),
149
+ label: "Member Experience",
150
+ "max-fraction-digits": 0,
151
+ "helper-text": V("experience"),
152
+ "helper-state": V("experience") ? "error" : void 0
153
+ }, null, 8, ["model-value", "helper-text", "helper-state"]),
154
+ l[7] || (l[7] = o("div", { class: "fm-typo-en-title-sm-800 mt-16 mb-8" }, "Member Card", -1)),
155
+ g(P, {
156
+ modelValue: t(r).cardNo,
157
+ "onUpdate:modelValue": l[2] || (l[2] = (M) => t(r).cardNo = M),
158
+ label: "Card number",
159
+ "helper-text": V("cardNo"),
160
+ "helper-state": V("cardNo") ? "error" : void 0
161
+ }, null, 8, ["modelValue", "helper-text", "helper-state"]),
162
+ l[8] || (l[8] = o("div", { class: "fm-typo-en-title-sm-800 mt-16 mb-8" }, "Titles", -1)),
163
+ (Q = t(r).titles) != null && Q.length ? (i(), w("div", lt, [...l[5] || (l[5] = [
164
+ o("div", { class: "flex flex-nowrap gap-4 items-center" }, [
165
+ o("div", { class: "flex-1" }, "Title"),
166
+ o("div", { class: "flex-1" }, "Expires in days"),
167
+ o("div", { class: "w-24 h-1" })
168
+ ], -1)
169
+ ])])) : te("", !0),
170
+ (i(!0), w(U, null, J(t(r).titles ?? [], (M, B) => (i(), w("div", { key: B }, [
171
+ o("div", at, [
172
+ t(s).some((T) => T._id === M.id) ? (i(), D(z, {
173
+ key: 1,
174
+ "model-value": "",
175
+ class: "flex-1"
176
+ }, {
177
+ default: le(() => [
178
+ g(q, {
179
+ disabled: !0,
180
+ class: "text-fm-color-typo-secondary"
181
+ }, {
182
+ default: le(() => {
183
+ var T;
184
+ return [
185
+ ye(S((T = t(c).find((n) => n.value === M.id)) == null ? void 0 : T.label), 1)
186
+ ];
187
+ }),
188
+ _: 2
189
+ }, 1024)
190
+ ]),
191
+ _: 2
192
+ }, 1024)) : (i(), D(_, {
193
+ key: 0,
194
+ modelValue: M.id,
195
+ "onUpdate:modelValue": [(T) => M.id = T, (T) => M.expiredAt = f(T) ?? 1],
196
+ class: "flex-1",
197
+ items: t(c).filter(
198
+ (T) => {
199
+ var n;
200
+ return !((n = t(r).titles) != null && n.map((e) => e.id).includes(T.value)) || M.id === T.value;
201
+ }
202
+ )
203
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "items"])),
204
+ g(C, {
205
+ modelValue: M.expiredAt,
206
+ "onUpdate:modelValue": (T) => M.expiredAt = T,
207
+ class: "flex-1",
208
+ label: "",
209
+ "max-fraction-digits": 0,
210
+ min: 0,
211
+ max: 9999,
212
+ step: 1
213
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]),
214
+ g(R, {
215
+ class: "w-24 h-24",
216
+ icon: "close",
217
+ variant: "tertiary",
218
+ onClick: (T) => {
219
+ var n;
220
+ return (n = t(r).titles) == null ? void 0 : n.splice(B, 1);
221
+ }
222
+ }, null, 8, ["onClick"])
223
+ ]),
224
+ (i(!0), w(U, null, J(O(`titles.${B}`), (T, n) => (i(), D(X, {
225
+ key: n,
226
+ class: "items-center",
227
+ state: "error",
228
+ text: T.toString()
229
+ }, null, 8, ["text"]))), 128))
230
+ ]))), 128)),
231
+ t(c).length && (((me = t(r).titles) == null ? void 0 : me.length) ?? 0) < t(c).length ? (i(), D(R, {
232
+ key: 2,
233
+ icon: "add",
234
+ label: "Give title",
235
+ variant: "plain",
236
+ onClick: l[3] || (l[3] = (M) => {
237
+ var B;
238
+ return t(r).titles = [
239
+ ...t(r).titles ?? [],
240
+ {
241
+ id: ((B = t(c).find(
242
+ (T) => {
243
+ var n;
244
+ return !((n = t(r).titles) != null && n.map((e) => e.id).includes(T.value));
245
+ }
246
+ )) == null ? void 0 : B.value) || t(c)[0].value,
247
+ expiredAt: 0
248
+ }
249
+ ];
250
+ })
251
+ })) : te("", !0)
252
+ ]),
253
+ o("div", it, [
254
+ Ve(g(X, {
255
+ state: "warning",
256
+ text: "Updating member will cause tier to change"
257
+ }, null, 512), [
258
+ [Be, t(a)]
259
+ ]),
260
+ g(N),
261
+ g(R, {
262
+ variant: "secondary",
263
+ label: "Cancel",
264
+ size: "md",
265
+ onClick: l[4] || (l[4] = (M) => t(F).close())
266
+ }),
267
+ g(R, {
268
+ disabled: !!t(k),
269
+ variant: "primary",
270
+ label: "Submit",
271
+ size: "md",
272
+ onClick: Y
273
+ }, null, 8, ["disabled"])
274
+ ])
275
+ ], 64);
276
+ };
277
+ }
278
+ }), 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__ */ ie({
279
+ __name: "CreditCoinDialog",
280
+ props: {
281
+ type: { type: String, required: !0 },
282
+ action: { type: String, required: !0 },
283
+ onSubmit: {
284
+ type: Function,
285
+ required: !0
286
+ }
287
+ },
288
+ setup(m) {
289
+ const F = Ce(), p = m, b = K({
290
+ amount: 1,
291
+ day: 1,
292
+ remark: void 0
293
+ }), s = K(!0), r = L(() => _e.formattedType(p.type.toUpperCase()));
294
+ function c(a) {
295
+ s.value = a, !a && p.type === "coin" && (b.value.day = void 0);
296
+ }
297
+ async function d() {
298
+ if (p.action === "send") {
299
+ const a = b.value.day ? `, expire in ${b.value.day} days` : "";
300
+ Te.confirm(
301
+ `Are you sure to send ${b.value.amount} ${r.value.toLowerCase()}${a}? This action cannot be reversed.`
302
+ ).then(async (f) => {
303
+ f && await p.onSubmit(b.value);
304
+ });
305
+ } else
306
+ Te.confirm(
307
+ `Are you sure to deduct ${b.value.amount} ${r.value.toLowerCase()}? This action cannot be reversed.`
308
+ ).then(async (a) => {
309
+ a && await p.onSubmit(b.value);
310
+ });
311
+ }
312
+ const x = L(() => {
313
+ const f = (p.action === "send" ? p.type === "coin" ? je : Le : p.type === "coin" ? qe : ze).safeParse(b.value);
314
+ return f.success == !1 ? f.error.flatten().fieldErrors : void 0;
315
+ });
316
+ return (a, f) => {
317
+ const k = A("FmStepperField"), V = A("FmSwitch"), O = A("FmTextarea"), Y = A("FmButton"), de = A("FmCard");
318
+ return i(), D(de, { class: "flex flex-col gap-16 p-16" }, {
319
+ default: le(() => {
320
+ var oe, re, W, u, l, _;
321
+ return [
322
+ o("div", dt, S(p.action == "send" ? "Send" : "Deduct") + " " + S(t(we)[p.type.toUpperCase()].name), 1),
323
+ ye(" " + S(t(x)) + " ", 1),
324
+ o("div", ct, [
325
+ g(k, {
326
+ modelValue: t(b).amount,
327
+ "onUpdate:modelValue": f[0] || (f[0] = (C) => t(b).amount = C),
328
+ label: `${t(we)[p.type.toUpperCase()].name} amount`,
329
+ "is-currency": !0,
330
+ "max-fraction-digits": 2,
331
+ "helper-state": (oe = t(x)) != null && oe.amount ? "error" : void 0,
332
+ "helper-text": (W = (re = t(x)) == null ? void 0 : re.amount) == null ? void 0 : W[0]
333
+ }, null, 8, ["modelValue", "label", "helper-state", "helper-text"]),
334
+ m.action === "send" && p.type === "coin" ? (i(), D(V, {
335
+ key: 0,
336
+ "model-value": t(s),
337
+ label: `${t(r)} expires`,
338
+ "label-placement": "right",
339
+ "onUpdate:modelValue": f[1] || (f[1] = (C) => c(C))
340
+ }, null, 8, ["model-value", "label"])) : te("", !0),
341
+ m.action === "send" && t(s) ? (i(), D(k, {
342
+ key: 1,
343
+ modelValue: t(b).day,
344
+ "onUpdate:modelValue": f[2] || (f[2] = (C) => t(b).day = C),
345
+ label: `${t(r)} expires in`,
346
+ "max-fraction-digits": 0,
347
+ "append-text": "day(s)",
348
+ max: 9999,
349
+ min: 0,
350
+ "helper-state": (u = t(x)) != null && u.day ? "error" : void 0,
351
+ "helper-text": (_ = (l = t(x)) == null ? void 0 : l.day) == null ? void 0 : _[0]
352
+ }, null, 8, ["modelValue", "label", "helper-state", "helper-text"])) : te("", !0),
353
+ g(O, {
354
+ modelValue: t(b).remark,
355
+ "onUpdate:modelValue": f[3] || (f[3] = (C) => t(b).remark = C),
356
+ label: "Remark"
357
+ }, null, 8, ["modelValue"])
358
+ ]),
359
+ o("div", ut, [
360
+ g(Y, {
361
+ variant: "secondary",
362
+ label: "Cancel",
363
+ size: "md",
364
+ onClick: f[4] || (f[4] = (C) => t(F).close())
365
+ }),
366
+ g(Y, {
367
+ disabled: !!t(x),
368
+ variant: "primary",
369
+ label: "Submit",
370
+ size: "md",
371
+ onClick: f[5] || (f[5] = async () => d())
372
+ }, null, 8, ["disabled"])
373
+ ])
374
+ ];
375
+ }),
376
+ _: 1
377
+ });
378
+ };
379
+ }
380
+ }), ft = He("segment", () => {
381
+ const m = K([]);
382
+ async function F() {
383
+ const p = await Oe.readAll({
384
+ limit: 1e3,
385
+ skip: 0,
386
+ sortBy: "_id",
387
+ descending: !0
388
+ });
389
+ m.value = p.resources;
390
+ }
391
+ return {
392
+ segments: m,
393
+ read: F
394
+ };
395
+ });
396
+ class bt extends Qe {
397
+ }
398
+ 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__ */ ie({
399
+ __name: "MemberCollectionTable",
400
+ props: {
401
+ member: {
402
+ type: Object,
403
+ required: !0
404
+ },
405
+ title: {
406
+ type: String,
407
+ default: ""
408
+ },
409
+ columns: {
410
+ type: Array,
411
+ default: [],
412
+ required: !0
413
+ },
414
+ filters: {
415
+ type: Object,
416
+ default: {}
417
+ },
418
+ withExport: {
419
+ type: Boolean,
420
+ default: !1
421
+ },
422
+ transformExportRecord: {
423
+ type: Function
424
+ }
425
+ },
426
+ setup(m) {
427
+ const F = m, p = K({
428
+ search: ""
429
+ }), b = K(!1), { tableMeta: s, rowData: r, onSort: c, debouncedFetchData: d, onSearch: x } = Xe(async (f) => {
430
+ const k = {
431
+ ...p.value,
432
+ ...F.filters
433
+ };
434
+ return await ve.readCollectionsByMemberId(
435
+ F.member._id.toString(),
436
+ f,
437
+ k
438
+ );
439
+ });
440
+ $e(
441
+ p,
442
+ () => {
443
+ d();
444
+ },
445
+ { deep: !0 }
446
+ );
447
+ async function a() {
448
+ try {
449
+ b.value = !0;
450
+ const f = {
451
+ ...p.value,
452
+ ...F.filters
453
+ };
454
+ await Ze({
455
+ exporter: new bt(),
456
+ readFunction: (k) => ve.readCollectionsByMemberId(
457
+ F.member._id.toString(),
458
+ k,
459
+ f
460
+ ),
461
+ transformRecord: F.transformExportRecord,
462
+ filename: `${F.member._id.toString()}-${F.title.replace(" ", "-").toLowerCase()}`
463
+ });
464
+ } catch (f) {
465
+ console.error(f);
466
+ } finally {
467
+ b.value = !1;
468
+ }
469
+ }
470
+ return Ie(async () => {
471
+ await d();
472
+ }), (f, k) => {
473
+ const V = A("FmSearch"), O = A("FmButton");
474
+ return i(), w("div", yt, [
475
+ o("div", vt, [
476
+ g(V, {
477
+ class: "hidden xs:!flex",
478
+ modelValue: t(p).search,
479
+ "onUpdate:modelValue": [
480
+ k[0] || (k[0] = (Y) => t(p).search = Y),
481
+ t(x)
482
+ ],
483
+ placeholder: "Search",
484
+ collapsible: ""
485
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]),
486
+ m.withExport ? (i(), D(O, {
487
+ key: 0,
488
+ icon: "ios_share",
489
+ variant: "tertiary",
490
+ onClick: a
491
+ })) : te("", !0)
492
+ ]),
493
+ o("div", gt, [
494
+ o("div", xt, [
495
+ o("div", ht, S(F.title), 1),
496
+ o("div", _t, S(t(s).totalRows), 1)
497
+ ]),
498
+ o("div", Ct, [
499
+ g(V, {
500
+ modelValue: t(p).search,
501
+ "onUpdate:modelValue": [
502
+ k[1] || (k[1] = (Y) => t(p).search = Y),
503
+ t(x)
504
+ ],
505
+ placeholder: "Search"
506
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]),
507
+ m.withExport ? (i(), D(O, {
508
+ key: 0,
509
+ icon: "ios_share",
510
+ variant: "tertiary",
511
+ onClick: a
512
+ })) : te("", !0)
513
+ ])
514
+ ]),
515
+ g(Je, {
516
+ loading: t(s).isLoading,
517
+ "row-data": t(r),
518
+ "row-count": t(s).totalRows,
519
+ "column-defs": m.columns,
520
+ "page-count": t(s).pageCount,
521
+ "page-index": t(s).pageIndex,
522
+ "page-size": t(s).pageSize,
523
+ "shrink-at": !1,
524
+ onSortChange: t(c),
525
+ onPageChange: k[2] || (k[2] = (Y) => t(d)({
526
+ pageSize: Y.pageSize,
527
+ pageIndex: Y.pageIndex
528
+ }))
529
+ }, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
530
+ ]);
531
+ };
532
+ }
533
+ }), St = /* @__PURE__ */ ie({
534
+ __name: "MemberVouchers",
535
+ props: {
536
+ member: {
537
+ type: Object,
538
+ required: !0
539
+ }
540
+ },
541
+ setup(m) {
542
+ const F = m, p = [
543
+ {
544
+ header: "Voucher title",
545
+ meta: {
546
+ maxWidth: "300px"
547
+ },
548
+ cell(r) {
549
+ var c;
550
+ return ae(
551
+ "div",
552
+ { class: "text-ellipsis truncate" },
553
+ ((c = r.row.original.pf_collectible) == null ? void 0 : c.name) || "-"
554
+ );
555
+ },
556
+ enableSorting: !1
557
+ },
558
+ {
559
+ header: "Claimed at",
560
+ accessorKey: "_id",
561
+ accessorFn: (r) => h(ge(r._id.toString())).format("D MMM YYYY"),
562
+ enableSorting: !1
563
+ },
564
+ {
565
+ header: "Expired at",
566
+ cell(r) {
567
+ var d, x, a, f;
568
+ const c = (x = (d = r.row.original.expiryBalance) == null ? void 0 : d[0]) != null && x.expiredAt ? h((f = (a = r.row.original.expiryBalance) == null ? void 0 : a[0]) == null ? void 0 : f.expiredAt).format(
569
+ "D MMM YYYY"
570
+ ) : "-";
571
+ return ae("div", {}, c);
572
+ },
573
+ enableSorting: !0
574
+ },
575
+ {
576
+ header: "Transfer open",
577
+ accessorFn: (r) => {
578
+ var c, d, x;
579
+ return We((x = (d = (c = r.pf_collectible) == null ? void 0 : c.options) == null ? void 0 : d.enableTransfer) == null ? void 0 : x.toString());
580
+ },
581
+ enableSorting: !1
582
+ }
583
+ ], b = (r) => ({
584
+ type: he.enum.VOUCHER,
585
+ isActive: r
586
+ }), s = (r) => {
587
+ var c, d, x, a, f, k, V;
588
+ return {
589
+ CollectionID: r._id,
590
+ Title: (c = r.pf_collectible) == null ? void 0 : c.name,
591
+ ClaimedAt: h(ge(r._id.toString())).format(
592
+ "D MMM YYYY, hh:mmA"
593
+ ),
594
+ ExpiredAt: (x = (d = r.expiryBalance) == null ? void 0 : d[0]) != null && x.expiredAt ? h((f = (a = r.expiryBalance) == null ? void 0 : a[0]) == null ? void 0 : f.expiredAt).format("D MMM YYYY") : "",
595
+ TransferOpen: ((V = (k = r.pf_collectible) == null ? void 0 : k.options) == null ? void 0 : V.enableTransfer) || !1
596
+ };
597
+ };
598
+ return (r, c) => (i(), w(U, null, [
599
+ c[0] || (c[0] = o("div", { class: "fm-typo-en-title-sm-600 mb-16" }, "Voucher Collections", -1)),
600
+ g(xe, {
601
+ member: F.member,
602
+ columns: p,
603
+ title: "Active voucher",
604
+ filters: b(!0),
605
+ withExport: !0,
606
+ transformExportRecord: s
607
+ }, null, 8, ["member", "filters"]),
608
+ g(xe, {
609
+ member: F.member,
610
+ columns: p,
611
+ title: "Past voucher",
612
+ filters: b(!1),
613
+ withExport: !0,
614
+ transformExportRecord: s
615
+ }, null, 8, ["member", "filters"])
616
+ ], 64));
617
+ }
618
+ }), wt = /* @__PURE__ */ ie({
619
+ __name: "MemberMissions",
620
+ props: {
621
+ member: {
622
+ type: Object,
623
+ required: !0
624
+ }
625
+ },
626
+ setup(m) {
627
+ const F = m, p = [
628
+ {
629
+ header: "Mission title",
630
+ meta: {
631
+ maxWidth: "300px"
632
+ },
633
+ cell(s) {
634
+ var r;
635
+ return ae(
636
+ "div",
637
+ { class: "text-ellipsis truncate" },
638
+ ((r = s.row.original.pf_campaign) == null ? void 0 : r.name) || "Deleted Campaign"
639
+ );
640
+ },
641
+ enableSorting: !1
642
+ },
643
+ {
644
+ header: "Type",
645
+ accessorFn: (s) => {
646
+ var r, c, d;
647
+ return ke.title(((d = (c = (r = s == null ? void 0 : s.pf_collectible) == null ? void 0 : r.extras) == null ? void 0 : c.mission) == null ? void 0 : d.type) || "-");
648
+ },
649
+ enableSorting: !1
650
+ },
651
+ {
652
+ header: "Status",
653
+ cell(s) {
654
+ var r;
655
+ if (s.row.original.pf_campaign) {
656
+ const c = {
657
+ active: "text-fm-color-typo-warning bg-fm-color-system-warning-100",
658
+ upcoming: "text-fm-color-typo-info bg-fm-color-system-info-100",
659
+ completed: "text-fm-color-typo-success bg-fm-color-system-success-100",
660
+ expired: "text-fm-color-typo-error bg-fm-color-system-error-100"
661
+ }, d = et(
662
+ s.row.original.pf_campaign
663
+ ), a = s.row.original.balance === s.row.original.pf_collectible.extras.mission.end && d === "active" ? "completed" : (r = s.row.original) != null && r.deactivatedAt ? "expired" : d;
664
+ return ae(Fe.FmChip, {
665
+ class: c[a],
666
+ label: ke.title(a),
667
+ compact: !0
668
+ });
669
+ }
670
+ return ae(Fe.FmChip, {
671
+ class: "",
672
+ label: "-",
673
+ compact: !0
674
+ });
675
+ },
676
+ enableSorting: !1
677
+ },
678
+ {
679
+ header: "Summary",
680
+ accessorFn: (s) => s != null && s.pf_campaign ? tt(s.pf_campaign) : "Deleted Campaign",
681
+ enableSorting: !1
682
+ },
683
+ {
684
+ header: "Current Step",
685
+ accessorKey: "balance",
686
+ enableSorting: !1
687
+ },
688
+ {
689
+ header: "Total Step",
690
+ accessorFn: (s) => {
691
+ var r, c, d;
692
+ return ((d = (c = (r = s == null ? void 0 : s.pf_collectible) == null ? void 0 : r.extras) == null ? void 0 : c.mission) == null ? void 0 : d.end) ?? 0;
693
+ },
694
+ enableSorting: !1
695
+ }
696
+ ], b = {
697
+ type: he.enum.STAMP
698
+ };
699
+ return (s, r) => (i(), w(U, null, [
700
+ r[0] || (r[0] = o("div", { class: "fm-typo-en-title-sm-600 mb-16" }, "Mission", -1)),
701
+ g(xe, {
702
+ member: F.member,
703
+ columns: p,
704
+ title: "Mission",
705
+ filters: b
706
+ }, null, 8, ["member"])
707
+ ], 64));
708
+ }
709
+ }), Ft = /* @__PURE__ */ ie({
710
+ __name: "MemberGames",
711
+ props: {
712
+ member: {
713
+ type: Object,
714
+ required: !0
715
+ }
716
+ },
717
+ setup(m) {
718
+ const F = m, p = [
719
+ {
720
+ header: "Game title",
721
+ meta: {
722
+ maxWidth: "300px"
723
+ },
724
+ cell(s) {
725
+ var r;
726
+ return ae(
727
+ "div",
728
+ { class: "text-ellipsis truncate" },
729
+ ((r = s.row.original.pf_campaign) == null ? void 0 : r.name) || "-"
730
+ );
731
+ },
732
+ enableSorting: !1
733
+ },
734
+ {
735
+ header: "Claimed at",
736
+ accessorKey: "_id",
737
+ accessorFn: (s) => h(ge(s._id.toString())).format("D MMM YYYY"),
738
+ enableSorting: !1
739
+ },
740
+ {
741
+ header: "Expired at",
742
+ cell(s) {
743
+ var c, d, x, a;
744
+ const r = (d = (c = s.row.original.expiryBalance) == null ? void 0 : c[0]) != null && d.expiredAt ? h((a = (x = s.row.original.expiryBalance) == null ? void 0 : x[0]) == null ? void 0 : a.expiredAt).format(
745
+ "D MMM YYYY"
746
+ ) : "-";
747
+ return ae("div", {}, r);
748
+ },
749
+ enableSorting: !1
750
+ },
751
+ {
752
+ header: "Token received",
753
+ accessorKey: "balance",
754
+ enableSorting: !1
755
+ }
756
+ ], b = (s) => ({
757
+ type: he.enum.GAME,
758
+ isActive: s
759
+ });
760
+ return (s, r) => (i(), w(U, null, [
761
+ r[0] || (r[0] = o("div", { class: "fm-typo-en-title-sm-600 mb-16" }, "Game program", -1)),
762
+ g(xe, {
763
+ member: F.member,
764
+ columns: p,
765
+ title: "Active game token",
766
+ filters: b(!0)
767
+ }, null, 8, ["member", "filters"])
768
+ ], 64));
769
+ }
770
+ }), 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" }, Et = { class: "fm-typo-en-body-md-600" }, Vt = { 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" }, It = { class: "fm-typo-en-body-md-800" }, Dt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Yt = { class: "fm-typo-en-body-md-600" }, Nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ut = { class: "fm-typo-en-body-md-800" }, Ot = { class: "gap-16 grid grid-cols-1" }, Pt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Rt = { class: "fm-typo-en-body-md-600" }, jt = { 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" }, Lt = { 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 = {
771
+ key: 0,
772
+ class: "space-x-8"
773
+ }, Jt = {
774
+ key: 1,
775
+ class: "text-fm-color-typo-secondary"
776
+ }, 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 = {
777
+ key: 1,
778
+ class: "text-fm-color-typo-secondary"
779
+ }, ro = {
780
+ key: 1,
781
+ class: "space-y-24"
782
+ }, 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" }, fo = { class: "flex gap-24 items-center xs:flex-col xs:items-start" }, bo = { 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__ */ ie({
783
+ __name: "MemberDetailSheet",
784
+ props: {
785
+ member: {
786
+ type: Object,
787
+ required: !0
788
+ }
789
+ },
790
+ emits: ["update:member"],
791
+ setup(m, { expose: F, emit: p }) {
792
+ const b = ot(), s = Ee(), r = Ke(), c = ft(), d = Ce(), { minor: x } = Ge, a = m, f = p, k = L(() => r.locations.map((n) => ({
793
+ label: n.name,
794
+ value: n._id
795
+ }))), V = L(() => (a.member.segment || []).map((n) => {
796
+ var e;
797
+ return ((e = c.segments.find((y) => y._id === n)) == null ? void 0 : e.name) || "";
798
+ }).filter(Boolean)), O = L(() => {
799
+ var $, E;
800
+ const n = (E = ($ = a.member.collection) == null ? void 0 : $.CREDIT) == null ? void 0 : E[0], e = (n == null ? void 0 : n.balance) ?? 0, y = ((n == null ? void 0 : n.expiryBalance) ?? []).reduce((G, Z) => G + Z.amount, 0);
801
+ return { total: e, free: y, normal: e - y };
802
+ }), Y = [
803
+ {
804
+ label: "Loyalty",
805
+ stats: [
806
+ {
807
+ label: "Experiences",
808
+ getter: (n) => {
809
+ var e, y, $;
810
+ return j((($ = (y = (e = n.collection) == null ? void 0 : e.POINT) == null ? void 0 : y[0]) == null ? void 0 : $.balance) ?? 0, 2);
811
+ }
812
+ },
813
+ {
814
+ label: "Credits",
815
+ getter: () => j(O.value.total, 2)
816
+ },
817
+ {
818
+ label: "Normal credits",
819
+ getter: () => j(O.value.normal, 2)
820
+ },
821
+ {
822
+ label: "Free credits",
823
+ getter: () => j(O.value.free, 2)
824
+ }
825
+ ]
826
+ },
827
+ {
828
+ label: "Voucher",
829
+ stats: [
830
+ {
831
+ label: "Active vouchers",
832
+ getter: () => j(z.value.active, 0)
833
+ },
834
+ {
835
+ label: "Past vouchers",
836
+ getter: () => j(z.value.past, 0)
837
+ }
838
+ ]
839
+ },
840
+ {
841
+ label: "Mission",
842
+ stats: [
843
+ {
844
+ label: "Stamp missions",
845
+ getter: () => j(q.value.stamp, 0)
846
+ },
847
+ {
848
+ label: "Progress missions",
849
+ getter: () => j(q.value.progressive, 0)
850
+ }
851
+ ]
852
+ },
853
+ {
854
+ label: "Game",
855
+ stats: [
856
+ {
857
+ label: "Tokens",
858
+ getter: (n) => {
859
+ var e, y;
860
+ return j(
861
+ ((y = (e = n.collection) == null ? void 0 : e.GAME) == null ? void 0 : y.reduce(
862
+ ($, E) => $ + E.balance,
863
+ 0
864
+ )) || 0,
865
+ 0
866
+ );
867
+ }
868
+ }
869
+ ]
870
+ },
871
+ {
872
+ label: "Store bundle",
873
+ stats: [
874
+ {
875
+ label: "Bundle purchased",
876
+ getter: () => j(X.value, 0)
877
+ }
878
+ ]
879
+ }
880
+ ], oe = (() => {
881
+ const e = [];
882
+ for (let y = 0; y < Y.length; y += 3)
883
+ e.push(Y.slice(y, y + 3));
884
+ return e;
885
+ })();
886
+ async function re(n, e) {
887
+ switch (n.stopPropagation(), e) {
888
+ case "Store bundle":
889
+ await b.push({
890
+ name: nt["$connect-LOYALTY_MEMBER_TRANSACTIONS"],
891
+ params: { id: a.member._id.toString() },
892
+ query: { tab: "store" }
893
+ });
894
+ break;
895
+ default:
896
+ B.value = M.find((y) => y.label === e) || M[0];
897
+ break;
898
+ }
899
+ }
900
+ async function W(n, e) {
901
+ d.open({
902
+ title: "",
903
+ dialogComponent: pt,
904
+ dialogComponentProps: {
905
+ type: n,
906
+ action: e,
907
+ onSubmit: async (y) => {
908
+ await x(
909
+ async () => {
910
+ const $ = {
911
+ "credit-send": ue.sendCredit,
912
+ "credit-deduct": ue.deductCredit,
913
+ "coin-send": ue.sendCoin,
914
+ "coin-deduct": ue.deductCoin
915
+ }, E = `${n}-${e}`, G = $[E];
916
+ G && await G(a.member._id, y), f("update:member"), d.close();
917
+ },
918
+ {
919
+ message: `Adjusting ${_e.formattedType(
920
+ n.toUpperCase()
921
+ ).toLowerCase()}`,
922
+ successMessage: `${y.amount} ${_e.formattedType(
923
+ n.toUpperCase()
924
+ ).toLowerCase()} ${e} ${e == "send" ? "to" : "from"} ${a.member.phoneNumber}`
925
+ }
926
+ );
927
+ }
928
+ }
929
+ });
930
+ }
931
+ async function u() {
932
+ d.open({
933
+ title: "Update member statistics",
934
+ contentComponent: mt,
935
+ contentComponentProps: {
936
+ member: a.member,
937
+ onSubmit: async (n) => {
938
+ await x(
939
+ async () => {
940
+ await ue.updateMember(a.member._id, n), f("update:member"), d.close();
941
+ },
942
+ {
943
+ message: "Updating member stats",
944
+ successMessage: `Updated member ${a.member.phoneNumber} stats successfully`
945
+ }
946
+ );
947
+ }
948
+ }
949
+ });
950
+ }
951
+ const l = [
952
+ {
953
+ label: "Mobile No.",
954
+ key: "phoneNumber"
955
+ },
956
+ {
957
+ label: "Tier",
958
+ getter: (n) => {
959
+ var Z, ce, pe, v, I;
960
+ const e = (((ce = Me.first((Z = a.member.collection) == null ? void 0 : Z.TIER)) == null ? void 0 : ce.balance) || 0) - 1, y = C.value.name, $ = ((v = (pe = n.collection) == null ? void 0 : pe.POINT) == null ? void 0 : v[0].balance) ?? 0, E = s.sortedTiers[e + 1], G = ((I = E == null ? void 0 : E.option) == null ? void 0 : I.from) ?? 1 / 0;
961
+ return `${y} (${$}/${G})`;
962
+ }
963
+ },
964
+ {
965
+ label: "Email",
966
+ key: "email"
967
+ },
968
+ {
969
+ label: "Birthday",
970
+ getter: (n) => n.birthday ? h(n.birthday).format("D MMM YYYY") : "-"
971
+ }
972
+ ], _ = [
973
+ {
974
+ label: "Customer since",
975
+ getter: (n) => h(n.joinAt || ge(n._id.toString())).format("D MMM YYYY")
976
+ },
977
+ {
978
+ label: "Joined at location",
979
+ getter: (n) => {
980
+ var e;
981
+ return n != null && n.location && ((e = k.value.find((y) => y.value == n.location)) == null ? void 0 : e.label) || "-";
982
+ }
983
+ },
984
+ {
985
+ label: "Total visit(s)",
986
+ getter: (n) => Ae.singularOrPlural(n.stats.visitCount, "bill")
987
+ },
988
+ {
989
+ label: "Last visit",
990
+ getter: (n) => h(n.stats.lastVisit).fromNow()
991
+ },
992
+ {
993
+ label: "Frequency",
994
+ getter: (n) => `Every ${Ae.singularOrPlural(
995
+ Number(Math.ceil(n.stats.avgVisitFrequency).toFixed(0)),
996
+ "day"
997
+ )}`
998
+ },
999
+ {
1000
+ label: "Average spend",
1001
+ getter: (n) => Ue.Dinero.fromNumber({ number: Number(n.stats.avgBillSize || 0) }).toFormat(
1002
+ !0
1003
+ )
1004
+ }
1005
+ // {
1006
+ // label: 'Feedback',
1007
+ // key: 'feedbackCount',
1008
+ // },
1009
+ // {
1010
+ // label: 'Tier Earned this season',
1011
+ // key: 'lastSeasonTierEarned',
1012
+ // },
1013
+ // {
1014
+ // label: 'Point Earned this season',
1015
+ // key: 'lastSeasonPointEarned',
1016
+ // },
1017
+ ], C = L(() => {
1018
+ var y, $;
1019
+ const n = ((($ = Me.first((y = a.member.collection) == null ? void 0 : y.TIER)) == null ? void 0 : $.balance) || 0) - 1, e = s.sortedTiers[n];
1020
+ return { name: (e == null ? void 0 : e.name) || "-", tier: n, config: e };
1021
+ }), P = L(() => {
1022
+ var n;
1023
+ return (((n = a.member.collection) == null ? void 0 : n.TITLE) || []).map((e) => {
1024
+ var $, E, G;
1025
+ const y = ($ = s.sortedTitles) == null ? void 0 : $.find(
1026
+ (Z) => Z._id == e.collectible
1027
+ );
1028
+ return {
1029
+ name: y == null ? void 0 : y.name,
1030
+ expiredAt: (G = (E = e.expiryBalance) == null ? void 0 : E.at(-1)) == null ? void 0 : G.expiredAt,
1031
+ collectible: y
1032
+ };
1033
+ }).filter(
1034
+ (e) => e.expiredAt ? h(e.expiredAt).isAfter(h()) : !0
1035
+ );
1036
+ }), q = K({ stamp: 0, progressive: 0 }), z = K({ active: 0, past: 0 }), R = K([]), X = L(
1037
+ () => R.value.reduce((n, e) => n + e.count, 0)
1038
+ ), N = K(!0);
1039
+ function Q() {
1040
+ N.value = !0, B.value = M[0];
1041
+ }
1042
+ function me() {
1043
+ N.value = !1;
1044
+ }
1045
+ const M = [
1046
+ {
1047
+ label: "Overview",
1048
+ value: "overview"
1049
+ },
1050
+ {
1051
+ label: "Loyalty",
1052
+ value: "loyalty"
1053
+ },
1054
+ {
1055
+ label: "Voucher",
1056
+ value: "voucher"
1057
+ },
1058
+ {
1059
+ label: "Mission",
1060
+ value: "mission"
1061
+ },
1062
+ {
1063
+ label: "Game",
1064
+ value: "game"
1065
+ }
1066
+ ], B = K(M[0]), T = async () => {
1067
+ z.value = await ve.readCollectionCountByMemberId(
1068
+ a.member._id.toString(),
1069
+ he.enum.VOUCHER
1070
+ ), R.value = await rt.readPurchaseCountByMember(
1071
+ a.member._id.toString()
1072
+ ), q.value = await ve.readMissionCountByMemberId(
1073
+ a.member._id.toString()
1074
+ );
1075
+ };
1076
+ return De(async () => {
1077
+ await s.readMembership(), await T(), r.locations.length || await r.readLocations();
1078
+ }), $e(N, async () => {
1079
+ await T();
1080
+ }), F({
1081
+ showSheet: Q,
1082
+ hideSheet: me
1083
+ }), (n, e) => {
1084
+ const y = A("FmTabs"), $ = A("FmAvatar"), E = A("FmButton"), G = A("FmIcon"), Z = A("FmChip"), ce = A("FmCard"), pe = A("FmSideSheet");
1085
+ return i(), D(pe, {
1086
+ modelValue: t(N),
1087
+ "onUpdate:modelValue": e[5] || (e[5] = (v) => Ye(N) ? N.value = v : null),
1088
+ header: "Member Detail",
1089
+ "dismiss-away": "",
1090
+ "close-button": !0,
1091
+ "max-width": 1100
1092
+ }, {
1093
+ "side-sheet-footer": le(() => [...e[21] || (e[21] = [])]),
1094
+ default: le(() => [
1095
+ o("div", Mt, [
1096
+ o("div", null, [
1097
+ g(y, {
1098
+ "model-value": t(B).value,
1099
+ items: M,
1100
+ class: "overflow-x-auto",
1101
+ "onUpdate:modelValue": e[0] || (e[0] = (v) => B.value = M.find((I) => I.value === v))
1102
+ }, null, 8, ["model-value"])
1103
+ ]),
1104
+ t(B).value == "overview" ? (i(), w(U, { key: 0 }, [
1105
+ o("div", kt, [
1106
+ o("div", null, [
1107
+ e[9] || (e[9] = o("div", { class: "fm-typo-en-title-sm-800 mb-16" }, "Profile Information", -1)),
1108
+ o("div", At, [
1109
+ o("div", Tt, [
1110
+ g($, {
1111
+ name: m.member.photoUrl ? void 0 : m.member.name,
1112
+ src: m.member.photoUrl || void 0
1113
+ }, null, 8, ["name", "src"]),
1114
+ o("div", $t, [
1115
+ e[7] || (e[7] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Member Name ", -1)),
1116
+ o("div", Et, S(m.member.name), 1),
1117
+ o("div", Vt, S(m.member._id), 1),
1118
+ o("div", Bt, [
1119
+ e[6] || (e[6] = ye(" Member Card: ", -1)),
1120
+ o("span", It, S(m.member.cardNo ? m.member.cardNo : "-"), 1)
1121
+ ])
1122
+ ]),
1123
+ g(E, {
1124
+ variant: "tertiary",
1125
+ icon: "settings",
1126
+ onClick: u
1127
+ })
1128
+ ]),
1129
+ (i(), w(U, null, J(l, (v, I) => o("div", { key: I }, [
1130
+ o("div", Dt, S(v.label), 1),
1131
+ o("div", Yt, S(v.key ? m.member[v.key] : v.getter(m.member)), 1)
1132
+ ])), 64)),
1133
+ o("div", Nt, [
1134
+ e[8] || (e[8] = ye(" Referral Code: ", -1)),
1135
+ o("span", Ut, S(m.member.referralCode ? m.member.referralCode : "-"), 1)
1136
+ ])
1137
+ ])
1138
+ ]),
1139
+ o("div", null, [
1140
+ e[10] || (e[10] = o("div", { class: "fm-typo-en-title-sm-800 mb-16" }, "Activities", -1)),
1141
+ o("div", Ot, [
1142
+ (i(), w(U, null, J(_, (v) => o("div", {
1143
+ key: v.key
1144
+ }, [
1145
+ o("div", Pt, S(v.label), 1),
1146
+ o("div", Rt, S(v.key ? a.member.stats[v.key] || "-" : v.getter(m.member)), 1)
1147
+ ])), 64))
1148
+ ])
1149
+ ])
1150
+ ]),
1151
+ e[13] || (e[13] = o("div", { class: "border-fm-color-neutral-gray-100 rounded-sm border-t" }, null, -1)),
1152
+ (i(!0), w(U, null, J(t(oe), (v) => (i(), w("div", jt, [
1153
+ (i(!0), w(U, null, J(v, (I, ee) => (i(), w("div", { key: ee }, [
1154
+ o("div", {
1155
+ class: Ne(ee !== 0 ? "pt-12 md:pt-0 lg:pt-0 md:pl-12 lg:pl-12" : "")
1156
+ }, [
1157
+ o("div", Lt, [
1158
+ o("div", qt, S(I.label), 1),
1159
+ o("button", {
1160
+ onClick: (H) => re(H, I.label)
1161
+ }, [
1162
+ g(G, {
1163
+ name: "chevron_right",
1164
+ outline: "",
1165
+ size: "md"
1166
+ })
1167
+ ], 8, zt)
1168
+ ]),
1169
+ o("div", Gt, [
1170
+ (i(!0), w(U, null, J(I.stats, (H) => (i(), w("div", {
1171
+ key: H.key
1172
+ }, [
1173
+ o("div", Ht, S(H.label), 1),
1174
+ o("div", Kt, S(H.getter(m.member)), 1)
1175
+ ]))), 128))
1176
+ ])
1177
+ ], 2)
1178
+ ]))), 128))
1179
+ ]))), 256)),
1180
+ o("div", Wt, [
1181
+ e[11] || (e[11] = o("div", { class: "fm-typo-en-title-sm-800" }, "Segments", -1)),
1182
+ t(V).length ? (i(), w("div", Xt, [
1183
+ (i(!0), w(U, null, J(t(V), (v) => (i(), D(Z, {
1184
+ label: v.toString()
1185
+ }, null, 8, ["label"]))), 256))
1186
+ ])) : (i(), w("div", Jt, "No titles"))
1187
+ ]),
1188
+ e[14] || (e[14] = o("div", { class: "border-fm-color-neutral-gray-100 rounded-sm border-t" }, null, -1)),
1189
+ o("div", Qt, [
1190
+ e[12] || (e[12] = o("div", { class: "fm-typo-en-title-sm-800" }, "Title badge", -1)),
1191
+ t(P).length ? (i(!0), w(U, { key: 0 }, J(t(P).filter((v) => v.collectible), (v) => (i(), w("div", {
1192
+ class: "flex items-center gap-x-8 h-48",
1193
+ key: v.name
1194
+ }, [
1195
+ o("img", {
1196
+ src: v.collectible.image || t(Pe),
1197
+ class: "aspect-square h-full object-contain"
1198
+ }, null, 8, Zt),
1199
+ o("div", null, [
1200
+ o("div", eo, S(v.name), 1),
1201
+ o("div", to, " Expired on " + S(t(h)(v.expiredAt).format("MMM D, Y")), 1)
1202
+ ])
1203
+ ]))), 128)) : (i(), w("div", oo, "No titles"))
1204
+ ])
1205
+ ], 64)) : t(B).value == "loyalty" ? (i(), w("div", ro, [
1206
+ g(ce, {
1207
+ class: "p-16 space-y-24",
1208
+ variant: "outlined"
1209
+ }, {
1210
+ default: le(() => {
1211
+ var v, I, ee, H;
1212
+ return [
1213
+ o("div", no, [
1214
+ e[15] || (e[15] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Total credit ", -1)),
1215
+ o("div", so, S(t(j)(t(O).total, 2)), 1)
1216
+ ]),
1217
+ o("div", lo, [
1218
+ o("div", ao, [
1219
+ e[16] || (e[16] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Normal credit ", -1)),
1220
+ o("div", io, S(t(j)(t(O).normal, 2)), 1)
1221
+ ]),
1222
+ o("div", mo, [
1223
+ e[17] || (e[17] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Free credit (with expiry) ", -1)),
1224
+ o("div", co, S(t(j)(t(O).free, 2)), 1)
1225
+ ])
1226
+ ]),
1227
+ o("div", uo, [
1228
+ 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)),
1229
+ o("div", po, S(((H = (ee = (I = (v = m.member.collection) == null ? void 0 : v.CREDIT) == null ? void 0 : I[0]) == null ? void 0 : ee.expiryBalance) == null ? void 0 : H.reduce(
1230
+ (ne, se) => se.expiredAt && t(h)(se.expiredAt).isAfter(t(h)()) && t(h)(se.expiredAt).isBefore(t(h)().add(30, "days")) ? ne + se.amount : ne,
1231
+ 0
1232
+ )) ?? 0), 1)
1233
+ ]),
1234
+ o("div", fo, [
1235
+ g(E, {
1236
+ label: "Add credit",
1237
+ icon: "add",
1238
+ variant: "plain",
1239
+ onClick: e[1] || (e[1] = (ne) => W("credit", "send"))
1240
+ }),
1241
+ g(E, {
1242
+ label: "Deduct credit",
1243
+ icon: "remove",
1244
+ variant: "plain",
1245
+ onClick: e[2] || (e[2] = (ne) => W("credit", "deduct"))
1246
+ })
1247
+ ])
1248
+ ];
1249
+ }),
1250
+ _: 1
1251
+ }),
1252
+ g(ce, {
1253
+ class: "p-16 space-y-24",
1254
+ variant: "outlined"
1255
+ }, {
1256
+ default: le(() => {
1257
+ var v, I, ee, H, ne, se, Se;
1258
+ return [
1259
+ o("div", bo, [
1260
+ e[19] || (e[19] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Point ", -1)),
1261
+ o("div", yo, S(((ee = (I = (v = m.member.collection) == null ? void 0 : v.COIN) == null ? void 0 : I[0]) == null ? void 0 : ee.balance) ?? 0), 1)
1262
+ ]),
1263
+ o("div", vo, [
1264
+ 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)),
1265
+ o("div", go, S(((Se = (se = (ne = (H = m.member.collection) == null ? void 0 : H.COIN) == null ? void 0 : ne[0]) == null ? void 0 : se.expiryBalance) == null ? void 0 : Se.reduce(
1266
+ (fe, be) => be.expiredAt && t(h)(be.expiredAt).isAfter(t(h)()) && t(h)(be.expiredAt).isBefore(t(h)().add(30, "days")) ? fe + be.amount : fe,
1267
+ 0
1268
+ )) ?? 0), 1)
1269
+ ]),
1270
+ o("div", xo, [
1271
+ g(E, {
1272
+ label: "Add point",
1273
+ icon: "add",
1274
+ variant: "plain",
1275
+ onClick: e[3] || (e[3] = (fe) => W("coin", "send"))
1276
+ }),
1277
+ g(E, {
1278
+ label: "Deduct point",
1279
+ icon: "remove",
1280
+ variant: "plain",
1281
+ onClick: e[4] || (e[4] = (fe) => W("coin", "deduct"))
1282
+ })
1283
+ ])
1284
+ ];
1285
+ }),
1286
+ _: 1
1287
+ })
1288
+ ])) : t(B).value == "voucher" ? (i(), D(St, {
1289
+ key: 2,
1290
+ member: a.member
1291
+ }, null, 8, ["member"])) : t(B).value == "mission" ? (i(), D(wt, {
1292
+ key: 3,
1293
+ member: a.member
1294
+ }, null, 8, ["member"])) : t(B).value == "game" ? (i(), D(Ft, {
1295
+ key: 4,
1296
+ member: a.member
1297
+ }, null, 8, ["member"])) : te("", !0)
1298
+ ])
1299
+ ]),
1300
+ _: 1
1301
+ }, 8, ["modelValue"]);
1302
+ };
1303
+ }
1304
+ });
1305
+ export {
1306
+ er as _,
1307
+ ft as u
1308
+ };