@feedmepos/mf-connect 0.1.128-prod → 0.1.129-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 (149) hide show
  1. package/dist/{App-DFXou0ZK.js → App-DvKWSqd0.js} +223 -215
  2. package/dist/AuditLogs-Di41b_Ka.js +2016 -0
  3. package/dist/{Bin-ril4yEp7.js → Bin-D0VJaSda.js} +8 -8
  4. package/dist/{Broadcast-CcseZmao.js → Broadcast-lOKmeyF5.js} +22 -21
  5. package/dist/{CampaignAnalytic-DaJ5a6G1.js → CampaignAnalytic-BR7qr2Rk.js} +6 -6
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CsmgbhtH.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-f_irDYbB.js} +9 -10
  7. package/dist/{Card-D7sTDXgf.js → Card-C0FjooTO.js} +23 -23
  8. package/dist/{Collections-C6d4vkox.js → Collections-fM1PptfB.js} +197 -185
  9. package/dist/{Credit-B9JCYQYi.js → Credit-RJpI_hfW.js} +21 -20
  10. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-CwD5dRnJ.js → DateRangeChip.vue_vue_type_script_setup_true_lang-DBqqfruz.js} +1 -1
  11. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DGTBYWbC.js +4584 -0
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BMxA26t5.js → EffectSheet.vue_vue_type_style_index_0_lang-9iMoc4-j.js} +33 -33
  13. package/dist/{Experience-pBNjY5aC.js → Experience-Beikw_KZ.js} +32 -31
  14. package/dist/{FileSaver.min-BdA7jj3J.js → FileSaver.min-Djm1XTRD.js} +1 -1
  15. package/dist/{Game-Ba1LqaLj.js → Game-D1H4RZRw.js} +19 -18
  16. package/dist/{GiftCardSetup-DteySO0t.js → GiftCardSetup-CTCP6_Ht.js} +31 -31
  17. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-DxFGFA_U.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-D6qxdYOi.js} +140 -128
  18. package/dist/{Goals-D4rLwe3y.js → Goals-CY2WQED5.js} +4 -4
  19. package/dist/Grab-DsMx3lCJ.js +301 -0
  20. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-C-1uplPm.js → ImageInput.vue_vue_type_script_setup_true_lang-DKRggrex.js} +1 -1
  21. package/dist/{Index-DZ9bEViq.js → Index-ByeYSoK-.js} +10 -10
  22. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-DS3y4uib.js → LocationPicker.vue_vue_type_script_setup_true_lang-C0D53C2N.js} +1 -1
  23. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-BTHmofSe.js → LottieAnimation.vue_vue_type_script_setup_true_lang-iLUXbCQ_.js} +1 -1
  24. package/dist/{LoyaltyDashboard-CBMyLX7W.js → LoyaltyDashboard-DjD4jSCx.js} +14 -14
  25. package/dist/{MainLayout-B3-DumYs.js → MainLayout-D7cpvtY_.js} +1 -1
  26. package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-BWOWZMYx.js → MainLayout.vue_vue_type_script_setup_true_lang-CG1qvcum.js} +3 -3
  27. package/dist/{Marketing-CJiu6eP4.js → Marketing-BpnTVwWR.js} +4 -4
  28. package/dist/{MarketingMaterialEdit-BuHpXGwZ.js → MarketingMaterialEdit-j76T_qaw.js} +214 -211
  29. package/dist/{Member-AOxxLQ-x.js → Member-CeFsJL8A.js} +7 -7
  30. package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-ArZ8cvMK.js +1336 -0
  31. package/dist/{MemberImportHistory-o-ruPMEe.js → MemberImportHistory-CwUXydVO.js} +7 -7
  32. package/dist/{MemberList-BkX_jgos.js → MemberList-Dxfmeq35.js} +103 -105
  33. package/dist/{MemberTransactions-Bnc3BWr5.js → MemberTransactions-DGvXpgAq.js} +1 -1
  34. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DoUw4U88.js → MessageInput.vue_vue_type_script_setup_true_lang-8klAQtYp.js} +12 -12
  35. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-BHprSEKu.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-BQNf6z-_.js} +1 -1
  36. package/dist/{Mission-D80DxR7z.js → Mission-CMMJSaIe.js} +22 -21
  37. package/dist/{Overview-jb3HWI09.js → Overview-Xtz3sU8A.js} +21 -21
  38. package/dist/{Overview-9gdETQLU.js → Overview-chOvaL7E.js} +145 -144
  39. package/dist/{Point-Pf_s2Ggb.js → Point-RZTZYN8G.js} +22 -21
  40. package/dist/{Promotion-BjjugEKH.js → Promotion-BqcuV7CX.js} +137 -131
  41. package/dist/{Queue-CVWdBEvK.js → Queue-ER6uDdkZ.js} +46 -46
  42. package/dist/{Record-BS9lp0Cs.js → Record-f3M08xoH.js} +9 -9
  43. package/dist/{Review-1MRQGLAX.js → Review-CtMC0SLr.js} +2 -2
  44. package/dist/ReviewFacebookCallback-DGwq3hYg.js +225 -0
  45. package/dist/{ReviewGoogleCallback-8kzG-TMh.js → ReviewGoogleCallback-DdxHlmxB.js} +5 -5
  46. package/dist/{Reward-UPonEShz.js → Reward-Cf9weya5.js} +16 -16
  47. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CW-EEgDZ.js → RewardGroup.vue_vue_type_script_setup_true_lang-CgafHHo1.js} +14 -14
  48. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DqAI7oH2.js +1923 -0
  49. package/dist/{Segment-BsNstBo-.js → Segment-6SBsEUoL.js} +304 -307
  50. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-3uc5TjrH.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-pbDGxQlY.js} +15 -15
  51. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CKc0Q7pK.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CEeBMZUD.js} +4 -4
  52. package/dist/{Setting-BD-fl3v8.js → Setting-BffjA4Ar.js} +17 -17
  53. package/dist/{SettingAdvertisements-DG1btpAQ.js → SettingAdvertisements-Dt2FJuln.js} +12 -12
  54. package/dist/Settings-c_khgiuB.js +286 -0
  55. package/dist/{Store-CQe1YA-D.js → Store-BW4dbML2.js} +29 -29
  56. package/dist/{StoreRewards-C7z5eJc4.js → StoreRewards-BVZX_cAF.js} +15 -15
  57. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-CvX_M1KW.js → StoreTransactions.vue_vue_type_script_setup_true_lang-CrvPa_4T.js} +25 -25
  58. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-CGe8vmiK.js +7007 -0
  59. package/dist/{Tier-BBb_E8_V.js → Tier-FSQh2lvv.js} +2583 -688
  60. package/dist/{Title-CjJaca4P.js → Title-oB7Kb32J.js} +96 -95
  61. package/dist/{Transaction-Dn-EPCom.js → Transaction-C3gt-4Th.js} +2 -2
  62. package/dist/{Upselling-DB8HU6B_.js → Upselling-DqmTk4n0.js} +3 -3
  63. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BG2o3Nip.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CnLThjUf.js} +26 -26
  64. package/dist/{Voucher-Cwg3WelV.js → Voucher-DVqZh9hJ.js} +19 -19
  65. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CRz0wdSO.js → VoucherEditor.vue_vue_type_script_setup_true_lang-Yrw65BaW.js} +12 -12
  66. package/dist/{WhatsappAccount--SMCex1D.js → WhatsappAccount-5fcZZ-0m.js} +6 -6
  67. package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-BpZ0_NtK.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-BKkrc4kw.js} +1 -1
  68. package/dist/{WhatsappBot-2BTZU0cI.js → WhatsappBot-DvwGIMBY.js} +7 -7
  69. package/dist/{WhatsappBotLogs-nGIYzZCU.js → WhatsappBotLogs-ujnVIcVS.js} +5 -5
  70. package/dist/{WhatsappBotSettings-DBx7ezqA.js → WhatsappBotSettings-TArljpKB.js} +5 -5
  71. package/dist/{WhatsappLayout-DK2idBeB.js → WhatsappLayout-qw4Ffnoj.js} +3 -3
  72. package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-B-pAId0k.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-ByfYZ78V.js} +3 -3
  73. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DYpCPJDx.js → ZodTextField.vue_vue_type_script_setup_true_lang-Cy62_4_q.js} +2 -2
  74. package/dist/{app-DjtVpjOD.js → app-CWi-W3yH.js} +4286 -3522
  75. package/dist/app.js +4 -3
  76. package/dist/{base.export-Dc9I7xbt.js → base.export-CQRAkm5d.js} +2 -2
  77. package/dist/business-D3OHW7AT.js +83 -0
  78. package/dist/{campaign-BNgMmhg6.js → campaign-B7dVjNGp.js} +121 -94
  79. package/dist/{campaign-U8KBANd_.js → campaign-DOqE4MfM.js} +31 -25
  80. package/dist/{campaign.enum-mYG3oWwU.js → campaign.enum-UEQYOY5t.js} +3 -2
  81. package/dist/campaign.fn-DHYDb4hv.js +776 -0
  82. package/dist/{collectible.enum-BtBBkbIB.js → collectible.enum-BsAN6p6D.js} +1 -1
  83. package/dist/{collection.fn-lFr9HoHC.js → collection.fn-Gm9D9ulH.js} +2 -2
  84. package/dist/{currency-B6GBpIWb.js → currency-CTEZgACE.js} +1 -1
  85. package/dist/duplicateCampaign-C80PKqYp.js +51 -0
  86. package/dist/{effect-DmzU8TpX.js → effect-C1e1yy73.js} +1 -1
  87. package/dist/{email-addresses-s_oiQY8W.js → email-addresses-CNONB99X.js} +2 -2
  88. package/dist/{feature-flag-CRbNgxfa.js → feature-flag-CAf5xPv2.js} +84 -84
  89. package/dist/google-BQK68wbe.js +5 -0
  90. package/dist/{helper-0o3cPptM.js → helper-D3ibSHOf.js} +1 -1
  91. package/dist/{index-Cnl3vaVR.js → index-BZQxnWTK.js} +2 -2
  92. package/dist/{index-BECZ4ORu.js → index-BlW_i2Dq.js} +1 -1
  93. package/dist/{index-iEzy3892.js → index-Bq3EaCT0.js} +1 -1
  94. package/dist/{index-DMgSW1aH.js → index-C9I_BbH3.js} +198 -198
  95. package/dist/{index-DLcl6mHQ.js → index-CFCuWT0v.js} +1 -1
  96. package/dist/{index-Bql1JMH9.js → index-CHBVTLaB.js} +26 -19
  97. package/dist/{index-BvoYHJ0i.js → index-Cco3w1OY.js} +2 -2
  98. package/dist/{index-CigqpRCP.js → index-CeERazr-.js} +609 -252
  99. package/dist/{index-CxxWGkQz.js → index-ChrgK9rD.js} +23 -23
  100. package/dist/{index-BMG5fllq.js → index-Cie3akNu.js} +4 -4
  101. package/dist/{index-DNx-iJd1.js → index-CuaoX2qa.js} +2 -2
  102. package/dist/{index-NhHbOATm.js → index-D6Kw_BIJ.js} +1315 -1243
  103. package/dist/{index-Df5CnMjC.js → index-D9WVHRkg.js} +4 -4
  104. package/dist/{index-DQLDjCeb.js → index-DN2p4Ds-.js} +1 -1
  105. package/dist/{index-CZWCtODZ.js → index-DQHeEclJ.js} +1 -1
  106. package/dist/{index-C9MKLJzw.js → index-DTVOmhFW.js} +2700 -2614
  107. package/dist/{index-CPByCjHI.js → index-DXOIiilO.js} +9 -9
  108. package/dist/{index-DphGTJkl.js → index-DqLwK46-.js} +4 -4
  109. package/dist/{index-NOeUp1Wc.js → index-DzRCjjVJ.js} +390 -236
  110. package/dist/{index-BXi5bQbd.js → index-uzf55NWc.js} +19 -6
  111. package/dist/{index-B6BmfoiZ.js → index-v73QbuDe.js} +1 -1
  112. package/dist/{index-DXV_Kdhp.js → index-y_gri2a3.js} +7 -7
  113. package/dist/{index.esm2017-DpKkF6uX.js → index.esm2017-DdnESO2S.js} +57 -57
  114. package/dist/{loading-nQaPRntd.js → loading-Dk6F9REp.js} +1 -1
  115. package/dist/{lodash-B6558zRv.js → lodash-lPRTuxNQ.js} +1 -1
  116. package/dist/{member-import-DWDpO4uU.js → member-import-TekQCbcQ.js} +2 -2
  117. package/dist/{membership-BY1-idAv.js → membership-DIme1cal.js} +3 -3
  118. package/dist/{money-DE62jPYV.js → money-B2ySjftN.js} +1 -1
  119. package/dist/{number-C9mUt-Ac.js → number-C_SdhwNx.js} +1 -1
  120. package/dist/objectid-DSZHf9-B.js +145 -0
  121. package/dist/{onboarding-OTAVtlNj.js → onboarding-B22eQGjb.js} +25 -25
  122. package/dist/{onboardingSetup-DhwhJk-r.js → onboardingSetup-CznYh7FA.js} +2 -2
  123. package/dist/{plugins-CpxP-Bn_.js → plugins-C-wY_Lzp.js} +3 -3
  124. package/dist/{reward-yx-Ttob3.js → reward--TbWBNNE.js} +1 -1
  125. package/dist/{rule-C_T37PuL.js → rule-BuoxJoFL.js} +572 -492
  126. package/dist/style.css +1 -1
  127. package/dist/template-BUUUr5wv.js +227 -0
  128. package/dist/{transaction.fn-4IcKHgri.js → transaction.fn-BE9pT4qk.js} +2 -2
  129. package/dist/{trigger-8zSNA5H1.js → trigger-Bvc7RgJ2.js} +9 -9
  130. package/dist/{useMarketingMaterialActions-CXjA7dhm.js → useMarketingMaterialActions-Dc5gQUq-.js} +4 -4
  131. package/dist/{usePagination-BECgW_Yq.js → usePagination-CK4Lu0Rq.js} +1 -1
  132. package/dist/{user-Czn9R1f-.js → user-B-jfQzWb.js} +1 -1
  133. package/dist/vue-i18n-CkPLtogB.js +2365 -0
  134. package/dist/{xlsx-3kbv63FT.js → xlsx-CPQkUIJH.js} +440 -440
  135. package/dist/{zod-DMdtnaR4.js → zod-CgCRBVd1.js} +1 -1
  136. package/package.json +6 -2
  137. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Cteezb57.js +0 -3638
  138. package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-cGglvqwB.js +0 -1308
  139. package/dist/ReviewFacebookCallback-DuuQxEIK.js +0 -238
  140. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BmTEULNC.js +0 -1884
  141. package/dist/Settings-LPdO0Djy.js +0 -179
  142. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DmeOGncB.js +0 -142
  143. package/dist/business-C0Ej4JRP.js +0 -82
  144. package/dist/campaign.fn-BaBPV7He.js +0 -776
  145. package/dist/google-C3S8u0mT.js +0 -4
  146. package/dist/objectid-DyUyXFvt.js +0 -145
  147. package/dist/rule-builder-WoEQdgK2.js +0 -102
  148. package/dist/template-AnoXsK9Y.js +0 -275
  149. package/dist/vue-i18n-BJWf_QrH.js +0 -2365
@@ -0,0 +1,1336 @@
1
+ import { defineComponent as me, computed as O, ref as G, resolveComponent as k, openBlock as d, createElementBlock as S, Fragment as I, createElementVNode as o, unref as t, createBlock as Y, createCommentVNode as Q, createVNode as v, renderList as J, withCtx as ae, createTextVNode as ye, toDisplayString as F, withDirectives as Be, vShow as De, watch as Ve, onBeforeMount as Ie, h as ie, onMounted as Ye, isRef as Ue, normalizeClass as Ne } from "vue";
2
+ import { h as C } from "./moment-D7p2TMB-.js";
3
+ import { c as Pe } from "./index-y_gri2a3.js";
4
+ import { u as $e, C as Fe, s as Oe } from "./membership-DIme1cal.js";
5
+ import { useDialog as Ce, components as we } from "@feedmepos/ui-library";
6
+ import { _ as Me } from "./lodash-lPRTuxNQ.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-D6Kw_BIJ.js";
9
+ import "./index-D9WVHRkg.js";
10
+ import { c as ke, f as Ae } from "./string-Gcy5IM_H.js";
11
+ import { u as He } from "./loading-Dk6F9REp.js";
12
+ import { u as Ee } from "./business-D3OHW7AT.js";
13
+ import { p as Te } from "./plugins-C-wY_Lzp.js";
14
+ import { C as _e } from "./collection.fn-Gm9D9ulH.js";
15
+ import { defineStore as Ke } from "pinia";
16
+ import { f as P } from "./number-C_SdhwNx.js";
17
+ import "./index-CeERazr-.js";
18
+ import "./index-DTVOmhFW.js";
19
+ import "./index-DzRCjjVJ.js";
20
+ import "./index-Cie3akNu.js";
21
+ import "./index-DQHeEclJ.js";
22
+ import "./index-CHBVTLaB.js";
23
+ import "./index-Bq3EaCT0.js";
24
+ import { s as We } from "./index-CuvNtC_M.js";
25
+ import { u as Xe, _ as Je } from "./usePagination-CK4Lu0Rq.js";
26
+ import { B as Qe, e as Ze } from "./base.export-CQRAkm5d.js";
27
+ import { m as ve } from "./index-uzf55NWc.js";
28
+ import { o as ge } from "./objectId-dwaoBfJX.js";
29
+ import { F as he } from "./collectible.enum-BsAN6p6D.js";
30
+ import { a as et, c as tt } from "./campaign-B7dVjNGp.js";
31
+ import { useRouter as ot } from "vue-router";
32
+ import { m as ce } from "./index-Cco3w1OY.js";
33
+ import { t as rt } from "./index-ChrgK9rD.js";
34
+ import { R as lt } from "./app-CWi-W3yH.js";
35
+ const nt = { class: "flex flex-col gap-8" }, st = { 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 w = Ce(), b = $e(), h = Ee(), l = c, s = O(
50
+ () => {
51
+ var p;
52
+ return (((p = l.member.collection) == null ? void 0 : p.TITLE) ?? []).reduce(
53
+ (a, x) => {
54
+ var L, K, X, B, W;
55
+ const $ = b.sortedTitles.find(
56
+ (le) => le._id.toString() === x.collectible
57
+ );
58
+ if (!$) return a;
59
+ const E = [...x.expiryBalance ?? []].sort(
60
+ (le, j) => C(le.expiredAt).isAfter(C(j.expiredAt)) ? -1 : 1
61
+ );
62
+ return (L = E[0]) != null && L.expiredAt && C((K = E[0]) == null ? void 0 : K.expiredAt).isBefore(C()) || a.push({
63
+ _id: $._id,
64
+ name: $.name,
65
+ expiredAt: (X = E[0]) != null && X.expiredAt ? C((B = E[0]) == null ? void 0 : B.expiredAt).toISOString() : "",
66
+ expiresIn: C((W = E[0]) == null ? void 0 : W.expiredAt).diff(C(), "days")
67
+ }), a;
68
+ },
69
+ []
70
+ );
71
+ }
72
+ ), r = G({
73
+ cardNo: l.member.cardNo,
74
+ experience: ((oe = (te = l.member.collection) == null ? void 0 : te.POINT) == null ? void 0 : oe[0].balance) ?? 0,
75
+ tier: ((re = (H = l.member.collection) == null ? void 0 : H.TIER) == null ? void 0 : re[0].balance) ?? -1,
76
+ titles: s.value.map((p) => ({ expiredAt: p.expiresIn, id: p._id })) ?? void 0,
77
+ // name, email, birthday and gender are only editable when the business owns the profile
78
+ ...h.isCrmProfile ? {
79
+ name: l.member.name || void 0,
80
+ email: l.member.email || void 0,
81
+ birthday: l.member.birthday ? new Date(l.member.birthday) : void 0,
82
+ gender: l.member.gender
83
+ } : {}
84
+ }), u = O(
85
+ () => (b.sortedTitles ?? []).map((p) => ({
86
+ label: p.name,
87
+ value: p._id.toString(),
88
+ sublabel: s.value.some((a) => a._id === p._id) ? "Owned" : void 0
89
+ }))
90
+ ), g = O(() => (b.sortedTiers ?? []).map((p, a) => ({
91
+ label: p.name,
92
+ sublabel: `${p.option.from} - ${p.option.to}`,
93
+ from: p.option.from,
94
+ to: p.option.to,
95
+ value: a + 1
96
+ })));
97
+ function m() {
98
+ var x, $;
99
+ const p = ((x = g.value[(r.value.tier ?? 1) - 1]) == null ? void 0 : x.from) ?? 0, a = ($ = g.value[(r.value.tier ?? 1) - 1]) == null ? void 0 : $.to;
100
+ r.value.experience = Math.min(
101
+ a ?? p,
102
+ Math.max(p, r.value.experience ?? 0)
103
+ );
104
+ }
105
+ const f = O(() => {
106
+ var x, $, E, L, K, X;
107
+ const p = (($ = (x = l.member.collection) == null ? void 0 : x.TIER) == null ? void 0 : $[0].balance) ?? -1, a = ((L = (E = l.member.collection) == null ? void 0 : E.POINT) == null ? void 0 : L[0].balance) ?? 0;
108
+ if (p != r.value.tier) return !0;
109
+ if (r.value.experience && r.value.experience != a) {
110
+ const B = ((K = g.value[p - 1]) == null ? void 0 : K.from) ?? 0, W = ((X = g.value[p - 1]) == null ? void 0 : X.to) ?? 0;
111
+ if (r.value.experience < B || W && r.value.experience > W)
112
+ return !0;
113
+ }
114
+ return !1;
115
+ });
116
+ function A(p) {
117
+ var a;
118
+ return (a = s.value.find((x) => x._id === p)) == null ? void 0 : a.expiresIn;
119
+ }
120
+ const U = O(() => {
121
+ const p = Le.safeParse(r.value);
122
+ return p.success ? void 0 : p.error.errors;
123
+ });
124
+ function T(p) {
125
+ var a, x;
126
+ return (x = (a = U.value) == null ? void 0 : a.find(($) => $.path.join(".") === p)) == null ? void 0 : x.message;
127
+ }
128
+ function N(p) {
129
+ var a;
130
+ return (a = U.value) == null ? void 0 : a.filter((x) => x.path.join(".").startsWith(p)).map((x) => x.message);
131
+ }
132
+ async function ue() {
133
+ await l.onSubmit(r.value), w.close();
134
+ }
135
+ return (p, a) => {
136
+ var j, R;
137
+ const x = k("FmSelect"), $ = k("FmStepperField"), E = k("FmTextField"), L = k("FmDatePicker"), K = k("FmField"), X = k("FmFormGroup"), B = k("FmButton"), W = k("FmHelperText"), le = k("FmSpacer");
138
+ return d(), S(I, null, [
139
+ o("div", nt, [
140
+ a[11] || (a[11] = o("div", { class: "fm-typo-en-title-sm-800 mb-8" }, "Member tiering", -1)),
141
+ t(g).length ? (d(), Y(x, {
142
+ key: 0,
143
+ modelValue: t(r).tier,
144
+ "onUpdate:modelValue": [
145
+ a[0] || (a[0] = (_) => t(r).tier = _),
146
+ m
147
+ ],
148
+ label: "Member Tier",
149
+ items: t(g),
150
+ "helper-text": T("tier"),
151
+ "helper-state": T("tier") ? "error" : void 0
152
+ }, null, 8, ["modelValue", "items", "helper-text", "helper-state"])) : Q("", !0),
153
+ v($, {
154
+ "model-value": t(r).experience ?? 0,
155
+ "onUpdate:modelValue": a[1] || (a[1] = (_) => t(r).experience = _),
156
+ label: "Member Experience",
157
+ "max-fraction-digits": 0,
158
+ "helper-text": T("experience"),
159
+ "helper-state": T("experience") ? "error" : void 0
160
+ }, null, 8, ["model-value", "helper-text", "helper-state"]),
161
+ a[12] || (a[12] = o("div", { class: "fm-typo-en-title-sm-800 mt-16 mb-8" }, "Member Card", -1)),
162
+ v(E, {
163
+ modelValue: t(r).cardNo,
164
+ "onUpdate:modelValue": a[2] || (a[2] = (_) => t(r).cardNo = _),
165
+ label: "Card number",
166
+ "helper-text": T("cardNo"),
167
+ "helper-state": T("cardNo") ? "error" : void 0
168
+ }, null, 8, ["modelValue", "helper-text", "helper-state"]),
169
+ t(h).isCrmProfile ? (d(), S(I, { key: 1 }, [
170
+ a[9] || (a[9] = o("div", { class: "fm-typo-en-title-sm-800 mt-16 mb-8" }, "Profile", -1)),
171
+ v(E, {
172
+ modelValue: t(r).name,
173
+ "onUpdate:modelValue": a[3] || (a[3] = (_) => t(r).name = _),
174
+ label: "Name"
175
+ }, null, 8, ["modelValue"]),
176
+ v(E, {
177
+ modelValue: t(r).email,
178
+ "onUpdate:modelValue": a[4] || (a[4] = (_) => t(r).email = _),
179
+ label: "Email",
180
+ "helper-text": T("email"),
181
+ "helper-state": T("email") ? "error" : void 0
182
+ }, null, 8, ["modelValue", "helper-text", "helper-state"]),
183
+ v(L, {
184
+ "model-value": t(r).birthday ? t(C)(t(r).birthday).format("YYYY-MM-DD") : "",
185
+ label: "Birthday",
186
+ "onUpdate:modelValue": a[5] || (a[5] = (_) => t(r).birthday = _ ? new Date(_) : void 0)
187
+ }, null, 8, ["model-value"]),
188
+ v(x, {
189
+ modelValue: t(r).gender,
190
+ "onUpdate:modelValue": a[6] || (a[6] = (_) => t(r).gender = _),
191
+ label: "Gender",
192
+ items: [
193
+ { label: "Male", value: "MALE" },
194
+ { label: "Female", value: "FEMALE" }
195
+ ]
196
+ }, null, 8, ["modelValue"])
197
+ ], 64)) : Q("", !0),
198
+ a[13] || (a[13] = o("div", { class: "fm-typo-en-title-sm-800 mt-16 mb-8" }, "Titles", -1)),
199
+ (j = t(r).titles) != null && j.length ? (d(), S("div", st, [...a[10] || (a[10] = [
200
+ o("div", { class: "flex flex-nowrap gap-4 items-center" }, [
201
+ o("div", { class: "flex-1" }, "Title"),
202
+ o("div", { class: "flex-1" }, "Expires in days"),
203
+ o("div", { class: "w-24 h-1" })
204
+ ], -1)
205
+ ])])) : Q("", !0),
206
+ (d(!0), S(I, null, J(t(r).titles ?? [], (_, n) => (d(), S("div", { key: n }, [
207
+ o("div", at, [
208
+ t(s).some((e) => e._id === _.id) ? (d(), Y(X, {
209
+ key: 1,
210
+ "model-value": "",
211
+ class: "flex-1"
212
+ }, {
213
+ default: ae(() => [
214
+ v(K, {
215
+ disabled: !0,
216
+ class: "text-fm-color-typo-secondary"
217
+ }, {
218
+ default: ae(() => {
219
+ var e;
220
+ return [
221
+ ye(F((e = t(u).find((i) => i.value === _.id)) == null ? void 0 : e.label), 1)
222
+ ];
223
+ }),
224
+ _: 2
225
+ }, 1024)
226
+ ]),
227
+ _: 2
228
+ }, 1024)) : (d(), Y(x, {
229
+ key: 0,
230
+ modelValue: _.id,
231
+ "onUpdate:modelValue": [(e) => _.id = e, (e) => _.expiredAt = A(e) ?? 1],
232
+ class: "flex-1",
233
+ items: t(u).filter(
234
+ (e) => {
235
+ var i;
236
+ return !((i = t(r).titles) != null && i.map((M) => M.id).includes(e.value)) || _.id === e.value;
237
+ }
238
+ )
239
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "items"])),
240
+ v($, {
241
+ modelValue: _.expiredAt,
242
+ "onUpdate:modelValue": (e) => _.expiredAt = e,
243
+ class: "flex-1",
244
+ label: "",
245
+ "max-fraction-digits": 0,
246
+ min: 0,
247
+ max: 9999,
248
+ step: 1
249
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]),
250
+ v(B, {
251
+ class: "w-24 h-24",
252
+ icon: "close",
253
+ variant: "tertiary",
254
+ onClick: (e) => {
255
+ var i;
256
+ return (i = t(r).titles) == null ? void 0 : i.splice(n, 1);
257
+ }
258
+ }, null, 8, ["onClick"])
259
+ ]),
260
+ (d(!0), S(I, null, J(N(`titles.${n}`), (e, i) => (d(), Y(W, {
261
+ key: i,
262
+ class: "items-center",
263
+ state: "error",
264
+ text: e.toString()
265
+ }, null, 8, ["text"]))), 128))
266
+ ]))), 128)),
267
+ t(u).length && (((R = t(r).titles) == null ? void 0 : R.length) ?? 0) < t(u).length ? (d(), Y(B, {
268
+ key: 3,
269
+ icon: "add",
270
+ label: "Give title",
271
+ variant: "plain",
272
+ onClick: a[7] || (a[7] = (_) => {
273
+ var n;
274
+ return t(r).titles = [
275
+ ...t(r).titles ?? [],
276
+ {
277
+ id: ((n = t(u).find(
278
+ (e) => {
279
+ var i;
280
+ return !((i = t(r).titles) != null && i.map((M) => M.id).includes(e.value));
281
+ }
282
+ )) == null ? void 0 : n.value) || t(u)[0].value,
283
+ expiredAt: 0
284
+ }
285
+ ];
286
+ })
287
+ })) : Q("", !0)
288
+ ]),
289
+ o("div", it, [
290
+ Be(v(W, {
291
+ state: "warning",
292
+ text: "Updating member will cause tier to change"
293
+ }, null, 512), [
294
+ [De, t(f)]
295
+ ]),
296
+ v(le),
297
+ v(B, {
298
+ variant: "secondary",
299
+ label: "Cancel",
300
+ size: "md",
301
+ onClick: a[8] || (a[8] = (_) => t(w).close())
302
+ }),
303
+ v(B, {
304
+ disabled: !!t(U),
305
+ variant: "primary",
306
+ label: "Submit",
307
+ size: "md",
308
+ onClick: ue
309
+ }, null, 8, ["disabled"])
310
+ ])
311
+ ], 64);
312
+ };
313
+ }
314
+ }), 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({
315
+ __name: "CreditCoinDialog",
316
+ props: {
317
+ type: { type: String, required: !0 },
318
+ action: { type: String, required: !0 },
319
+ onSubmit: {
320
+ type: Function,
321
+ required: !0
322
+ }
323
+ },
324
+ setup(c) {
325
+ const w = Ce(), b = c, h = G({
326
+ amount: 1,
327
+ day: 1,
328
+ remark: void 0
329
+ }), l = G(!0), s = O(() => _e.formattedType(b.type.toUpperCase()));
330
+ function r(m) {
331
+ l.value = m, !m && b.type === "coin" && (h.value.day = void 0);
332
+ }
333
+ async function u() {
334
+ if (b.action === "send") {
335
+ const m = h.value.day ? `, expire in ${h.value.day} days` : "";
336
+ Te.confirm(
337
+ `Are you sure to send ${h.value.amount} ${s.value.toLowerCase()}${m}? This action cannot be reversed.`
338
+ ).then(async (f) => {
339
+ f && await b.onSubmit(h.value);
340
+ });
341
+ } else
342
+ Te.confirm(
343
+ `Are you sure to deduct ${h.value.amount} ${s.value.toLowerCase()}? This action cannot be reversed.`
344
+ ).then(async (m) => {
345
+ m && await b.onSubmit(h.value);
346
+ });
347
+ }
348
+ const g = O(() => {
349
+ const f = (b.action === "send" ? b.type === "coin" ? je : qe : b.type === "coin" ? ze : Ge).safeParse(h.value);
350
+ return f.success == !1 ? f.error.flatten().fieldErrors : void 0;
351
+ });
352
+ return (m, f) => {
353
+ const A = k("FmStepperField"), U = k("FmSwitch"), T = k("FmTextarea"), N = k("FmButton"), ue = k("FmCard");
354
+ return d(), Y(ue, { class: "flex flex-col gap-16 p-16" }, {
355
+ default: ae(() => {
356
+ var te, oe, H, re, p, a;
357
+ return [
358
+ o("div", dt, F(b.action == "send" ? "Send" : "Deduct") + " " + F(t(Fe)[b.type.toUpperCase()].name), 1),
359
+ ye(" " + F(t(g)) + " ", 1),
360
+ o("div", ct, [
361
+ v(A, {
362
+ modelValue: t(h).amount,
363
+ "onUpdate:modelValue": f[0] || (f[0] = (x) => t(h).amount = x),
364
+ label: `${t(Fe)[b.type.toUpperCase()].name} amount`,
365
+ "is-currency": !0,
366
+ "max-fraction-digits": 2,
367
+ "helper-state": (te = t(g)) != null && te.amount ? "error" : void 0,
368
+ "helper-text": (H = (oe = t(g)) == null ? void 0 : oe.amount) == null ? void 0 : H[0]
369
+ }, null, 8, ["modelValue", "label", "helper-state", "helper-text"]),
370
+ c.action === "send" && b.type === "coin" ? (d(), Y(U, {
371
+ key: 0,
372
+ "model-value": t(l),
373
+ label: `${t(s)} expires`,
374
+ "label-placement": "right",
375
+ "onUpdate:modelValue": f[1] || (f[1] = (x) => r(x))
376
+ }, null, 8, ["model-value", "label"])) : Q("", !0),
377
+ c.action === "send" && t(l) ? (d(), Y(A, {
378
+ key: 1,
379
+ modelValue: t(h).day,
380
+ "onUpdate:modelValue": f[2] || (f[2] = (x) => t(h).day = x),
381
+ label: `${t(s)} expires in`,
382
+ "max-fraction-digits": 0,
383
+ "append-text": "day(s)",
384
+ max: 9999,
385
+ min: 0,
386
+ "helper-state": (re = t(g)) != null && re.day ? "error" : void 0,
387
+ "helper-text": (a = (p = t(g)) == null ? void 0 : p.day) == null ? void 0 : a[0]
388
+ }, null, 8, ["modelValue", "label", "helper-state", "helper-text"])) : Q("", !0),
389
+ v(T, {
390
+ modelValue: t(h).remark,
391
+ "onUpdate:modelValue": f[3] || (f[3] = (x) => t(h).remark = x),
392
+ label: "Remark"
393
+ }, null, 8, ["modelValue"])
394
+ ]),
395
+ o("div", ut, [
396
+ v(N, {
397
+ variant: "secondary",
398
+ label: "Cancel",
399
+ size: "md",
400
+ onClick: f[4] || (f[4] = (x) => t(w).close())
401
+ }),
402
+ v(N, {
403
+ disabled: !!t(g),
404
+ variant: "primary",
405
+ label: "Submit",
406
+ size: "md",
407
+ onClick: f[5] || (f[5] = async () => u())
408
+ }, null, 8, ["disabled"])
409
+ ])
410
+ ];
411
+ }),
412
+ _: 1
413
+ });
414
+ };
415
+ }
416
+ }), bt = Ke("segment", () => {
417
+ const c = G([]);
418
+ async function w() {
419
+ const b = await Oe.readAll({
420
+ limit: 1e3,
421
+ skip: 0,
422
+ sortBy: "_id",
423
+ descending: !0
424
+ });
425
+ c.value = b.resources;
426
+ }
427
+ return {
428
+ segments: c,
429
+ read: w
430
+ };
431
+ });
432
+ class ft extends Qe {
433
+ }
434
+ 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({
435
+ __name: "MemberCollectionTable",
436
+ props: {
437
+ member: {
438
+ type: Object,
439
+ required: !0
440
+ },
441
+ title: {
442
+ type: String,
443
+ default: ""
444
+ },
445
+ columns: {
446
+ type: Array,
447
+ default: [],
448
+ required: !0
449
+ },
450
+ filters: {
451
+ type: Object,
452
+ default: {}
453
+ },
454
+ withExport: {
455
+ type: Boolean,
456
+ default: !1
457
+ },
458
+ transformExportRecord: {
459
+ type: Function
460
+ }
461
+ },
462
+ setup(c) {
463
+ const w = c, b = G({
464
+ search: ""
465
+ }), h = G(!1), { tableMeta: l, rowData: s, onSort: r, debouncedFetchData: u, onSearch: g } = Xe(async (f) => {
466
+ const A = {
467
+ ...b.value,
468
+ ...w.filters
469
+ };
470
+ return await ve.readCollectionsByMemberId(
471
+ w.member._id.toString(),
472
+ f,
473
+ A
474
+ );
475
+ });
476
+ Ve(
477
+ b,
478
+ () => {
479
+ u();
480
+ },
481
+ { deep: !0 }
482
+ );
483
+ async function m() {
484
+ try {
485
+ h.value = !0;
486
+ const f = {
487
+ ...b.value,
488
+ ...w.filters
489
+ };
490
+ await Ze({
491
+ exporter: new ft(),
492
+ readFunction: (A) => ve.readCollectionsByMemberId(
493
+ w.member._id.toString(),
494
+ A,
495
+ f
496
+ ),
497
+ transformRecord: w.transformExportRecord,
498
+ filename: `${w.member._id.toString()}-${w.title.replace(" ", "-").toLowerCase()}`
499
+ });
500
+ } catch (f) {
501
+ console.error(f);
502
+ } finally {
503
+ h.value = !1;
504
+ }
505
+ }
506
+ return Ie(async () => {
507
+ await u();
508
+ }), (f, A) => {
509
+ const U = k("FmSearch"), T = k("FmButton");
510
+ return d(), S("div", yt, [
511
+ o("div", vt, [
512
+ v(U, {
513
+ class: "hidden xs:!flex",
514
+ modelValue: t(b).search,
515
+ "onUpdate:modelValue": [
516
+ A[0] || (A[0] = (N) => t(b).search = N),
517
+ t(g)
518
+ ],
519
+ placeholder: "Search",
520
+ collapsible: ""
521
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]),
522
+ c.withExport ? (d(), Y(T, {
523
+ key: 0,
524
+ icon: "ios_share",
525
+ variant: "tertiary",
526
+ onClick: m
527
+ })) : Q("", !0)
528
+ ]),
529
+ o("div", gt, [
530
+ o("div", xt, [
531
+ o("div", ht, F(w.title), 1),
532
+ o("div", _t, F(t(l).totalRows), 1)
533
+ ]),
534
+ o("div", Ct, [
535
+ v(U, {
536
+ modelValue: t(b).search,
537
+ "onUpdate:modelValue": [
538
+ A[1] || (A[1] = (N) => t(b).search = N),
539
+ t(g)
540
+ ],
541
+ placeholder: "Search"
542
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]),
543
+ c.withExport ? (d(), Y(T, {
544
+ key: 0,
545
+ icon: "ios_share",
546
+ variant: "tertiary",
547
+ onClick: m
548
+ })) : Q("", !0)
549
+ ])
550
+ ]),
551
+ v(Je, {
552
+ loading: t(l).isLoading,
553
+ "row-data": t(s),
554
+ "row-count": t(l).totalRows,
555
+ "column-defs": c.columns,
556
+ "page-count": t(l).pageCount,
557
+ "page-index": t(l).pageIndex,
558
+ "page-size": t(l).pageSize,
559
+ "shrink-at": !1,
560
+ onSortChange: t(r),
561
+ onPageChange: A[2] || (A[2] = (N) => t(u)({
562
+ pageSize: N.pageSize,
563
+ pageIndex: N.pageIndex
564
+ }))
565
+ }, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
566
+ ]);
567
+ };
568
+ }
569
+ }), St = /* @__PURE__ */ me({
570
+ __name: "MemberVouchers",
571
+ props: {
572
+ member: {
573
+ type: Object,
574
+ required: !0
575
+ }
576
+ },
577
+ setup(c) {
578
+ const w = c, b = [
579
+ {
580
+ header: "Voucher title",
581
+ meta: {
582
+ maxWidth: "300px"
583
+ },
584
+ cell(s) {
585
+ var r;
586
+ return ie(
587
+ "div",
588
+ { class: "text-ellipsis truncate" },
589
+ ((r = s.row.original.pf_collectible) == null ? void 0 : r.name) || "-"
590
+ );
591
+ },
592
+ enableSorting: !1
593
+ },
594
+ {
595
+ header: "Claimed at",
596
+ accessorKey: "_id",
597
+ accessorFn: (s) => C(ge(s._id.toString())).format("D MMM YYYY"),
598
+ enableSorting: !1
599
+ },
600
+ {
601
+ header: "Expired at",
602
+ cell(s) {
603
+ var u, g, m, f;
604
+ const r = (g = (u = s.row.original.expiryBalance) == null ? void 0 : u[0]) != null && g.expiredAt ? C((f = (m = s.row.original.expiryBalance) == null ? void 0 : m[0]) == null ? void 0 : f.expiredAt).format(
605
+ "D MMM YYYY"
606
+ ) : "-";
607
+ return ie("div", {}, r);
608
+ },
609
+ enableSorting: !0
610
+ },
611
+ {
612
+ header: "Transfer open",
613
+ accessorFn: (s) => {
614
+ var r, u, g;
615
+ return We((g = (u = (r = s.pf_collectible) == null ? void 0 : r.options) == null ? void 0 : u.enableTransfer) == null ? void 0 : g.toString());
616
+ },
617
+ enableSorting: !1
618
+ }
619
+ ], h = (s) => ({
620
+ type: he.enum.VOUCHER,
621
+ isActive: s
622
+ }), l = (s) => {
623
+ var r, u, g, m, f, A, U;
624
+ return {
625
+ CollectionID: s._id,
626
+ Title: (r = s.pf_collectible) == null ? void 0 : r.name,
627
+ ClaimedAt: C(ge(s._id.toString())).format(
628
+ "D MMM YYYY, hh:mmA"
629
+ ),
630
+ ExpiredAt: (g = (u = s.expiryBalance) == null ? void 0 : u[0]) != null && g.expiredAt ? C((f = (m = s.expiryBalance) == null ? void 0 : m[0]) == null ? void 0 : f.expiredAt).format("D MMM YYYY") : "",
631
+ TransferOpen: ((U = (A = s.pf_collectible) == null ? void 0 : A.options) == null ? void 0 : U.enableTransfer) || !1
632
+ };
633
+ };
634
+ return (s, r) => (d(), S(I, null, [
635
+ r[0] || (r[0] = o("div", { class: "fm-typo-en-title-sm-600 mb-16" }, "Voucher Collections", -1)),
636
+ v(xe, {
637
+ member: w.member,
638
+ columns: b,
639
+ title: "Active voucher",
640
+ filters: h(!0),
641
+ withExport: !0,
642
+ transformExportRecord: l
643
+ }, null, 8, ["member", "filters"]),
644
+ v(xe, {
645
+ member: w.member,
646
+ columns: b,
647
+ title: "Past voucher",
648
+ filters: h(!1),
649
+ withExport: !0,
650
+ transformExportRecord: l
651
+ }, null, 8, ["member", "filters"])
652
+ ], 64));
653
+ }
654
+ }), Ft = /* @__PURE__ */ me({
655
+ __name: "MemberMissions",
656
+ props: {
657
+ member: {
658
+ type: Object,
659
+ required: !0
660
+ }
661
+ },
662
+ setup(c) {
663
+ const w = c, b = [
664
+ {
665
+ header: "Mission title",
666
+ meta: {
667
+ maxWidth: "300px"
668
+ },
669
+ cell(l) {
670
+ var s;
671
+ return ie(
672
+ "div",
673
+ { class: "text-ellipsis truncate" },
674
+ ((s = l.row.original.pf_campaign) == null ? void 0 : s.name) || "Deleted Campaign"
675
+ );
676
+ },
677
+ enableSorting: !1
678
+ },
679
+ {
680
+ header: "Type",
681
+ accessorFn: (l) => {
682
+ var s, r, u;
683
+ return ke.title(((u = (r = (s = l == null ? void 0 : l.pf_collectible) == null ? void 0 : s.extras) == null ? void 0 : r.mission) == null ? void 0 : u.type) || "-");
684
+ },
685
+ enableSorting: !1
686
+ },
687
+ {
688
+ header: "Status",
689
+ cell(l) {
690
+ var s;
691
+ if (l.row.original.pf_campaign) {
692
+ const r = {
693
+ active: "text-fm-color-typo-warning bg-fm-color-system-warning-100",
694
+ upcoming: "text-fm-color-typo-info bg-fm-color-system-info-100",
695
+ completed: "text-fm-color-typo-success bg-fm-color-system-success-100",
696
+ expired: "text-fm-color-typo-error bg-fm-color-system-error-100"
697
+ }, u = et(
698
+ l.row.original.pf_campaign
699
+ ), m = l.row.original.balance === l.row.original.pf_collectible.extras.mission.end && u === "active" ? "completed" : (s = l.row.original) != null && s.deactivatedAt ? "expired" : u;
700
+ return ie(we.FmChip, {
701
+ class: r[m],
702
+ label: ke.title(m),
703
+ compact: !0
704
+ });
705
+ }
706
+ return ie(we.FmChip, {
707
+ class: "",
708
+ label: "-",
709
+ compact: !0
710
+ });
711
+ },
712
+ enableSorting: !1
713
+ },
714
+ {
715
+ header: "Summary",
716
+ accessorFn: (l) => l != null && l.pf_campaign ? tt(l.pf_campaign) : "Deleted Campaign",
717
+ enableSorting: !1
718
+ },
719
+ {
720
+ header: "Current Step",
721
+ accessorKey: "balance",
722
+ enableSorting: !1
723
+ },
724
+ {
725
+ header: "Total Step",
726
+ accessorFn: (l) => {
727
+ var s, r, u;
728
+ return ((u = (r = (s = l == null ? void 0 : l.pf_collectible) == null ? void 0 : s.extras) == null ? void 0 : r.mission) == null ? void 0 : u.end) ?? 0;
729
+ },
730
+ enableSorting: !1
731
+ }
732
+ ], h = {
733
+ type: he.enum.STAMP
734
+ };
735
+ return (l, s) => (d(), S(I, null, [
736
+ s[0] || (s[0] = o("div", { class: "fm-typo-en-title-sm-600 mb-16" }, "Mission", -1)),
737
+ v(xe, {
738
+ member: w.member,
739
+ columns: b,
740
+ title: "Mission",
741
+ filters: h
742
+ }, null, 8, ["member"])
743
+ ], 64));
744
+ }
745
+ }), wt = /* @__PURE__ */ me({
746
+ __name: "MemberGames",
747
+ props: {
748
+ member: {
749
+ type: Object,
750
+ required: !0
751
+ }
752
+ },
753
+ setup(c) {
754
+ const w = c, b = [
755
+ {
756
+ header: "Game title",
757
+ meta: {
758
+ maxWidth: "300px"
759
+ },
760
+ cell(l) {
761
+ var s;
762
+ return ie(
763
+ "div",
764
+ { class: "text-ellipsis truncate" },
765
+ ((s = l.row.original.pf_campaign) == null ? void 0 : s.name) || "-"
766
+ );
767
+ },
768
+ enableSorting: !1
769
+ },
770
+ {
771
+ header: "Claimed at",
772
+ accessorKey: "_id",
773
+ accessorFn: (l) => C(ge(l._id.toString())).format("D MMM YYYY"),
774
+ enableSorting: !1
775
+ },
776
+ {
777
+ header: "Expired at",
778
+ cell(l) {
779
+ var r, u, g, m;
780
+ const s = (u = (r = l.row.original.expiryBalance) == null ? void 0 : r[0]) != null && u.expiredAt ? C((m = (g = l.row.original.expiryBalance) == null ? void 0 : g[0]) == null ? void 0 : m.expiredAt).format(
781
+ "D MMM YYYY"
782
+ ) : "-";
783
+ return ie("div", {}, s);
784
+ },
785
+ enableSorting: !1
786
+ },
787
+ {
788
+ header: "Token received",
789
+ accessorKey: "balance",
790
+ enableSorting: !1
791
+ }
792
+ ], h = (l) => ({
793
+ type: he.enum.GAME,
794
+ isActive: l
795
+ });
796
+ return (l, s) => (d(), S(I, null, [
797
+ s[0] || (s[0] = o("div", { class: "fm-typo-en-title-sm-600 mb-16" }, "Game program", -1)),
798
+ v(xe, {
799
+ member: w.member,
800
+ columns: b,
801
+ title: "Active game token",
802
+ filters: h(!0)
803
+ }, null, 8, ["member", "filters"])
804
+ ], 64));
805
+ }
806
+ }), 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" }, Vt = { class: "flex-auto" }, $t = { 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 = {
807
+ key: 0,
808
+ class: "space-x-8"
809
+ }, Jt = {
810
+ key: 1,
811
+ class: "text-fm-color-typo-secondary"
812
+ }, 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 = {
813
+ key: 1,
814
+ class: "text-fm-color-typo-secondary"
815
+ }, ro = {
816
+ key: 1,
817
+ class: "space-y-24"
818
+ }, lo = { class: "space-y-8" }, no = { class: "fm-typo-en-title-md-800" }, so = { 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({
819
+ __name: "MemberDetailSheet",
820
+ props: {
821
+ member: {
822
+ type: Object,
823
+ required: !0
824
+ }
825
+ },
826
+ emits: ["update:member"],
827
+ setup(c, { expose: w, emit: b }) {
828
+ const h = ot(), l = Ee(), s = $e(), r = bt(), u = Ce(), { minor: g } = He, m = c, f = b, A = O(() => l.locations.map((n) => ({
829
+ label: n.name,
830
+ value: n._id
831
+ }))), U = O(() => (m.member.segment || []).map((n) => {
832
+ var e;
833
+ return ((e = r.segments.find((i) => i._id === n)) == null ? void 0 : e.name) || "";
834
+ }).filter(Boolean)), T = O(() => {
835
+ var M, V;
836
+ const n = (V = (M = m.member.collection) == null ? void 0 : M.CREDIT) == null ? void 0 : V[0], e = (n == null ? void 0 : n.balance) ?? 0, i = ((n == null ? void 0 : n.expiryBalance) ?? []).reduce((q, Z) => q + Z.amount, 0);
837
+ return { total: e, free: i, normal: e - i };
838
+ }), N = [
839
+ {
840
+ label: "Loyalty",
841
+ stats: [
842
+ {
843
+ label: "Experiences",
844
+ getter: (n) => {
845
+ var e, i, M;
846
+ return P(((M = (i = (e = n.collection) == null ? void 0 : e.POINT) == null ? void 0 : i[0]) == null ? void 0 : M.balance) ?? 0, 2);
847
+ }
848
+ },
849
+ {
850
+ label: "Credits",
851
+ getter: () => P(T.value.total, 2)
852
+ },
853
+ {
854
+ label: "Normal credits",
855
+ getter: () => P(T.value.normal, 2)
856
+ },
857
+ {
858
+ label: "Free credits",
859
+ getter: () => P(T.value.free, 2)
860
+ }
861
+ ]
862
+ },
863
+ {
864
+ label: "Voucher",
865
+ stats: [
866
+ {
867
+ label: "Active vouchers",
868
+ getter: () => P(L.value.active, 0)
869
+ },
870
+ {
871
+ label: "Past vouchers",
872
+ getter: () => P(L.value.past, 0)
873
+ }
874
+ ]
875
+ },
876
+ {
877
+ label: "Mission",
878
+ stats: [
879
+ {
880
+ label: "Stamp missions",
881
+ getter: () => P(E.value.stamp, 0)
882
+ },
883
+ {
884
+ label: "Progress missions",
885
+ getter: () => P(E.value.progressive, 0)
886
+ }
887
+ ]
888
+ },
889
+ {
890
+ label: "Game",
891
+ stats: [
892
+ {
893
+ label: "Tokens",
894
+ getter: (n) => {
895
+ var e, i;
896
+ return P(
897
+ ((i = (e = n.collection) == null ? void 0 : e.GAME) == null ? void 0 : i.reduce(
898
+ (M, V) => M + V.balance,
899
+ 0
900
+ )) || 0,
901
+ 0
902
+ );
903
+ }
904
+ }
905
+ ]
906
+ },
907
+ {
908
+ label: "Store bundle",
909
+ stats: [
910
+ {
911
+ label: "Bundle purchased",
912
+ getter: () => P(X.value, 0)
913
+ }
914
+ ]
915
+ }
916
+ ], te = (() => {
917
+ const e = [];
918
+ for (let i = 0; i < N.length; i += 3)
919
+ e.push(N.slice(i, i + 3));
920
+ return e;
921
+ })();
922
+ async function oe(n, e) {
923
+ switch (n.stopPropagation(), e) {
924
+ case "Store bundle":
925
+ await h.push({
926
+ name: lt["$connect-LOYALTY_MEMBER_TRANSACTIONS"],
927
+ params: { id: m.member._id.toString() },
928
+ query: { tab: "store" }
929
+ });
930
+ break;
931
+ default:
932
+ R.value = j.find((i) => i.label === e) || j[0];
933
+ break;
934
+ }
935
+ }
936
+ async function H(n, e) {
937
+ u.open({
938
+ title: "",
939
+ dialogComponent: pt,
940
+ dialogComponentProps: {
941
+ type: n,
942
+ action: e,
943
+ onSubmit: async (i) => {
944
+ await g(
945
+ async () => {
946
+ const M = {
947
+ "credit-send": ce.sendCredit,
948
+ "credit-deduct": ce.deductCredit,
949
+ "coin-send": ce.sendCoin,
950
+ "coin-deduct": ce.deductCoin
951
+ }, V = `${n}-${e}`, q = M[V];
952
+ q && await q(m.member._id, i), f("update:member"), u.close();
953
+ },
954
+ {
955
+ message: `Adjusting ${_e.formattedType(
956
+ n.toUpperCase()
957
+ ).toLowerCase()}`,
958
+ successMessage: `${i.amount} ${_e.formattedType(
959
+ n.toUpperCase()
960
+ ).toLowerCase()} ${e} ${e == "send" ? "to" : "from"} ${m.member.phoneNumber}`
961
+ }
962
+ );
963
+ }
964
+ }
965
+ });
966
+ }
967
+ async function re() {
968
+ u.open({
969
+ title: "Update member statistics",
970
+ contentComponent: mt,
971
+ contentComponentProps: {
972
+ member: m.member,
973
+ onSubmit: async (n) => {
974
+ await g(
975
+ async () => {
976
+ await ce.updateMember(m.member._id, n), f("update:member"), u.close();
977
+ },
978
+ {
979
+ message: "Updating member stats",
980
+ successMessage: `Updated member ${m.member.phoneNumber} stats successfully`
981
+ }
982
+ );
983
+ }
984
+ }
985
+ });
986
+ }
987
+ const p = [
988
+ {
989
+ label: "Mobile No.",
990
+ key: "phoneNumber"
991
+ },
992
+ {
993
+ label: "Tier",
994
+ getter: (n) => {
995
+ var Z, de, pe, y, D;
996
+ const e = (((de = Me.first((Z = m.member.collection) == null ? void 0 : Z.TIER)) == null ? void 0 : de.balance) || 0) - 1, i = x.value.name, M = ((y = (pe = n.collection) == null ? void 0 : pe.POINT) == null ? void 0 : y[0].balance) ?? 0, V = s.sortedTiers[e + 1], q = ((D = V == null ? void 0 : V.option) == null ? void 0 : D.from) ?? 1 / 0;
997
+ return `${i} (${M}/${q})`;
998
+ }
999
+ },
1000
+ {
1001
+ label: "Email",
1002
+ key: "email"
1003
+ },
1004
+ {
1005
+ label: "Birthday",
1006
+ getter: (n) => n.birthday ? C(n.birthday).format("D MMM YYYY") : "-"
1007
+ }
1008
+ ], a = [
1009
+ {
1010
+ label: "Customer since",
1011
+ getter: (n) => C(n.joinAt || ge(n._id.toString())).format("D MMM YYYY")
1012
+ },
1013
+ {
1014
+ label: "Joined at location",
1015
+ getter: (n) => {
1016
+ var e;
1017
+ return n != null && n.location && ((e = A.value.find((i) => i.value == n.location)) == null ? void 0 : e.label) || "-";
1018
+ }
1019
+ },
1020
+ {
1021
+ label: "Total visit(s)",
1022
+ getter: (n) => Ae.singularOrPlural(n.stats.visitCount, "bill")
1023
+ },
1024
+ {
1025
+ label: "Last visit",
1026
+ getter: (n) => C(n.stats.lastVisit).fromNow()
1027
+ },
1028
+ {
1029
+ label: "Frequency",
1030
+ getter: (n) => `Every ${Ae.singularOrPlural(
1031
+ Number(Math.ceil(n.stats.avgVisitFrequency).toFixed(0)),
1032
+ "day"
1033
+ )}`
1034
+ },
1035
+ {
1036
+ label: "Average spend",
1037
+ getter: (n) => Pe.Dinero.fromNumber({ number: Number(n.stats.avgBillSize || 0) }).toFormat(
1038
+ !0
1039
+ )
1040
+ }
1041
+ // {
1042
+ // label: 'Feedback',
1043
+ // key: 'feedbackCount',
1044
+ // },
1045
+ ], x = O(() => {
1046
+ var i, M;
1047
+ const n = (((M = Me.first((i = m.member.collection) == null ? void 0 : i.TIER)) == null ? void 0 : M.balance) || 0) - 1, e = s.sortedTiers[n];
1048
+ return { name: (e == null ? void 0 : e.name) || "-", tier: n, config: e };
1049
+ }), $ = O(() => {
1050
+ var n;
1051
+ return (((n = m.member.collection) == null ? void 0 : n.TITLE) || []).map((e) => {
1052
+ var M, V, q;
1053
+ const i = (M = s.sortedTitles) == null ? void 0 : M.find(
1054
+ (Z) => Z._id == e.collectible
1055
+ );
1056
+ return {
1057
+ name: i == null ? void 0 : i.name,
1058
+ expiredAt: (q = (V = e.expiryBalance) == null ? void 0 : V.at(-1)) == null ? void 0 : q.expiredAt,
1059
+ collectible: i
1060
+ };
1061
+ }).filter(
1062
+ (e) => e.expiredAt ? C(e.expiredAt).isAfter(C()) : !0
1063
+ );
1064
+ }), E = G({ stamp: 0, progressive: 0 }), L = G({ active: 0, past: 0 }), K = G([]), X = O(
1065
+ () => K.value.reduce((n, e) => n + e.count, 0)
1066
+ ), B = G(!0);
1067
+ function W() {
1068
+ B.value = !0, R.value = j[0];
1069
+ }
1070
+ function le() {
1071
+ B.value = !1;
1072
+ }
1073
+ const j = [
1074
+ {
1075
+ label: "Overview",
1076
+ value: "overview"
1077
+ },
1078
+ {
1079
+ label: "Loyalty",
1080
+ value: "loyalty"
1081
+ },
1082
+ {
1083
+ label: "Voucher",
1084
+ value: "voucher"
1085
+ },
1086
+ {
1087
+ label: "Mission",
1088
+ value: "mission"
1089
+ },
1090
+ {
1091
+ label: "Game",
1092
+ value: "game"
1093
+ }
1094
+ ], R = G(j[0]), _ = async () => {
1095
+ L.value = await ve.readCollectionCountByMemberId(
1096
+ m.member._id.toString(),
1097
+ he.enum.VOUCHER
1098
+ ), K.value = await rt.readPurchaseCountByMember(
1099
+ m.member._id.toString()
1100
+ ), E.value = await ve.readMissionCountByMemberId(
1101
+ m.member._id.toString()
1102
+ );
1103
+ };
1104
+ return Ye(async () => {
1105
+ await s.readMembership(), await _(), l.locations.length || await l.readLocations();
1106
+ }), Ve(B, async () => {
1107
+ await _();
1108
+ }), w({
1109
+ showSheet: W,
1110
+ hideSheet: le
1111
+ }), (n, e) => {
1112
+ const i = k("FmTabs"), M = k("FmAvatar"), V = k("FmButton"), q = k("FmIcon"), Z = k("FmChip"), de = k("FmCard"), pe = k("FmSideSheet");
1113
+ return d(), Y(pe, {
1114
+ modelValue: t(B),
1115
+ "onUpdate:modelValue": e[5] || (e[5] = (y) => Ue(B) ? B.value = y : null),
1116
+ header: "Member Detail",
1117
+ "dismiss-away": "",
1118
+ "close-button": !0,
1119
+ "max-width": 1100
1120
+ }, {
1121
+ "side-sheet-footer": ae(() => [...e[21] || (e[21] = [])]),
1122
+ default: ae(() => [
1123
+ o("div", Mt, [
1124
+ o("div", null, [
1125
+ v(i, {
1126
+ "model-value": t(R).value,
1127
+ items: j,
1128
+ class: "overflow-x-auto",
1129
+ "onUpdate:modelValue": e[0] || (e[0] = (y) => R.value = j.find((D) => D.value === y))
1130
+ }, null, 8, ["model-value"])
1131
+ ]),
1132
+ t(R).value == "overview" ? (d(), S(I, { key: 0 }, [
1133
+ o("div", kt, [
1134
+ o("div", null, [
1135
+ e[9] || (e[9] = o("div", { class: "fm-typo-en-title-sm-800 mb-16" }, "Profile Information", -1)),
1136
+ o("div", At, [
1137
+ o("div", Tt, [
1138
+ v(M, {
1139
+ name: c.member.photoUrl ? void 0 : c.member.name,
1140
+ src: c.member.photoUrl || void 0
1141
+ }, null, 8, ["name", "src"]),
1142
+ o("div", Vt, [
1143
+ e[8] || (e[8] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Member Name ", -1)),
1144
+ o("div", $t, F(c.member.name), 1),
1145
+ o("div", Et, F(c.member._id), 1),
1146
+ o("div", Bt, [
1147
+ e[6] || (e[6] = ye(" Member Card: ", -1)),
1148
+ o("span", Dt, F(c.member.cardNo ? c.member.cardNo : "-"), 1)
1149
+ ]),
1150
+ o("div", It, [
1151
+ e[7] || (e[7] = ye(" Referral Code: ", -1)),
1152
+ o("span", Yt, F(c.member.referralCode ? c.member.referralCode : "-"), 1)
1153
+ ])
1154
+ ]),
1155
+ v(V, {
1156
+ variant: "tertiary",
1157
+ icon: "settings",
1158
+ onClick: re
1159
+ })
1160
+ ]),
1161
+ (d(), S(I, null, J(p, (y, D) => o("div", { key: D }, [
1162
+ o("div", Ut, F(y.label), 1),
1163
+ o("div", Nt, F(y.key ? c.member[y.key] : y.getter(c.member)), 1)
1164
+ ])), 64))
1165
+ ])
1166
+ ]),
1167
+ o("div", null, [
1168
+ e[10] || (e[10] = o("div", { class: "fm-typo-en-title-sm-800 mb-16" }, "Activities", -1)),
1169
+ o("div", Pt, [
1170
+ (d(), S(I, null, J(a, (y) => o("div", {
1171
+ key: y.key
1172
+ }, [
1173
+ o("div", Ot, F(y.label), 1),
1174
+ o("div", Rt, F(y.key ? m.member.stats[y.key] || "-" : y.getter(c.member)), 1)
1175
+ ])), 64))
1176
+ ])
1177
+ ])
1178
+ ]),
1179
+ e[13] || (e[13] = o("div", { class: "border-fm-color-neutral-gray-100 rounded-sm border-t" }, null, -1)),
1180
+ (d(!0), S(I, null, J(t(te), (y) => (d(), S("div", Lt, [
1181
+ (d(!0), S(I, null, J(y, (D, ee) => (d(), S("div", { key: ee }, [
1182
+ o("div", {
1183
+ class: Ne(ee !== 0 ? "pt-12 md:pt-0 lg:pt-0 md:pl-12 lg:pl-12" : "")
1184
+ }, [
1185
+ o("div", jt, [
1186
+ o("div", qt, F(D.label), 1),
1187
+ o("button", {
1188
+ onClick: (z) => oe(z, D.label)
1189
+ }, [
1190
+ v(q, {
1191
+ name: "chevron_right",
1192
+ outline: "",
1193
+ size: "md"
1194
+ })
1195
+ ], 8, zt)
1196
+ ]),
1197
+ o("div", Gt, [
1198
+ (d(!0), S(I, null, J(D.stats, (z) => (d(), S("div", {
1199
+ key: z.key
1200
+ }, [
1201
+ o("div", Ht, F(z.label), 1),
1202
+ o("div", Kt, F(z.getter(c.member)), 1)
1203
+ ]))), 128))
1204
+ ])
1205
+ ], 2)
1206
+ ]))), 128))
1207
+ ]))), 256)),
1208
+ o("div", Wt, [
1209
+ e[11] || (e[11] = o("div", { class: "fm-typo-en-title-sm-800" }, "Segments", -1)),
1210
+ t(U).length ? (d(), S("div", Xt, [
1211
+ (d(!0), S(I, null, J(t(U), (y) => (d(), Y(Z, {
1212
+ label: y.toString()
1213
+ }, null, 8, ["label"]))), 256))
1214
+ ])) : (d(), S("div", Jt, "No titles"))
1215
+ ]),
1216
+ e[14] || (e[14] = o("div", { class: "border-fm-color-neutral-gray-100 rounded-sm border-t" }, null, -1)),
1217
+ o("div", Qt, [
1218
+ e[12] || (e[12] = o("div", { class: "fm-typo-en-title-sm-800" }, "Title badge", -1)),
1219
+ t($).length ? (d(!0), S(I, { key: 0 }, J(t($).filter((y) => y.collectible), (y) => (d(), S("div", {
1220
+ class: "flex items-center gap-x-8 h-48",
1221
+ key: y.name
1222
+ }, [
1223
+ o("img", {
1224
+ src: y.collectible.image || t(Re),
1225
+ class: "aspect-square h-full object-contain"
1226
+ }, null, 8, Zt),
1227
+ o("div", null, [
1228
+ o("div", eo, F(y.name), 1),
1229
+ o("div", to, " Expired on " + F(t(C)(y.expiredAt).format("MMM D, Y")), 1)
1230
+ ])
1231
+ ]))), 128)) : (d(), S("div", oo, "No titles"))
1232
+ ])
1233
+ ], 64)) : t(R).value == "loyalty" ? (d(), S("div", ro, [
1234
+ v(de, {
1235
+ class: "p-16 space-y-24",
1236
+ variant: "outlined"
1237
+ }, {
1238
+ default: ae(() => {
1239
+ var y, D, ee, z;
1240
+ return [
1241
+ o("div", lo, [
1242
+ e[15] || (e[15] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Total credit ", -1)),
1243
+ o("div", no, F(t(P)(t(T).total, 2)), 1)
1244
+ ]),
1245
+ o("div", so, [
1246
+ o("div", ao, [
1247
+ e[16] || (e[16] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Normal credit ", -1)),
1248
+ o("div", io, F(t(P)(t(T).normal, 2)), 1)
1249
+ ]),
1250
+ o("div", mo, [
1251
+ e[17] || (e[17] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Free credit (with expiry) ", -1)),
1252
+ o("div", co, F(t(P)(t(T).free, 2)), 1)
1253
+ ])
1254
+ ]),
1255
+ o("div", uo, [
1256
+ 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)),
1257
+ o("div", po, F(((z = (ee = (D = (y = c.member.collection) == null ? void 0 : y.CREDIT) == null ? void 0 : D[0]) == null ? void 0 : ee.expiryBalance) == null ? void 0 : z.reduce(
1258
+ (ne, se) => se.expiredAt && t(C)(se.expiredAt).isAfter(t(C)()) && t(C)(se.expiredAt).isBefore(t(C)().add(30, "days")) ? ne + se.amount : ne,
1259
+ 0
1260
+ )) ?? 0), 1)
1261
+ ]),
1262
+ o("div", bo, [
1263
+ v(V, {
1264
+ label: "Add credit",
1265
+ icon: "add",
1266
+ variant: "plain",
1267
+ onClick: e[1] || (e[1] = (ne) => H("credit", "send"))
1268
+ }),
1269
+ v(V, {
1270
+ label: "Deduct credit",
1271
+ icon: "remove",
1272
+ variant: "plain",
1273
+ onClick: e[2] || (e[2] = (ne) => H("credit", "deduct"))
1274
+ })
1275
+ ])
1276
+ ];
1277
+ }),
1278
+ _: 1
1279
+ }),
1280
+ v(de, {
1281
+ class: "p-16 space-y-24",
1282
+ variant: "outlined"
1283
+ }, {
1284
+ default: ae(() => {
1285
+ var y, D, ee, z, ne, se, Se;
1286
+ return [
1287
+ o("div", fo, [
1288
+ e[19] || (e[19] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Point ", -1)),
1289
+ o("div", yo, F(((ee = (D = (y = c.member.collection) == null ? void 0 : y.COIN) == null ? void 0 : D[0]) == null ? void 0 : ee.balance) ?? 0), 1)
1290
+ ]),
1291
+ o("div", vo, [
1292
+ 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)),
1293
+ o("div", go, F(((Se = (se = (ne = (z = c.member.collection) == null ? void 0 : z.COIN) == null ? void 0 : ne[0]) == null ? void 0 : se.expiryBalance) == null ? void 0 : Se.reduce(
1294
+ (be, fe) => fe.expiredAt && t(C)(fe.expiredAt).isAfter(t(C)()) && t(C)(fe.expiredAt).isBefore(t(C)().add(30, "days")) ? be + fe.amount : be,
1295
+ 0
1296
+ )) ?? 0), 1)
1297
+ ]),
1298
+ o("div", xo, [
1299
+ v(V, {
1300
+ label: "Add point",
1301
+ icon: "add",
1302
+ variant: "plain",
1303
+ onClick: e[3] || (e[3] = (be) => H("coin", "send"))
1304
+ }),
1305
+ v(V, {
1306
+ label: "Deduct point",
1307
+ icon: "remove",
1308
+ variant: "plain",
1309
+ onClick: e[4] || (e[4] = (be) => H("coin", "deduct"))
1310
+ })
1311
+ ])
1312
+ ];
1313
+ }),
1314
+ _: 1
1315
+ })
1316
+ ])) : t(R).value == "voucher" ? (d(), Y(St, {
1317
+ key: 2,
1318
+ member: m.member
1319
+ }, null, 8, ["member"])) : t(R).value == "mission" ? (d(), Y(Ft, {
1320
+ key: 3,
1321
+ member: m.member
1322
+ }, null, 8, ["member"])) : t(R).value == "game" ? (d(), Y(wt, {
1323
+ key: 4,
1324
+ member: m.member
1325
+ }, null, 8, ["member"])) : Q("", !0)
1326
+ ])
1327
+ ]),
1328
+ _: 1
1329
+ }, 8, ["modelValue"]);
1330
+ };
1331
+ }
1332
+ });
1333
+ export {
1334
+ er as _,
1335
+ bt as u
1336
+ };