@feedmepos/mf-connect 0.1.98-beta.8 → 0.1.98-beta.80

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 (167) hide show
  1. package/dist/{App-DsB2o1oB.js → App-DievprEi.js} +853 -683
  2. package/dist/{AuditLogs-BcfgiYnJ.js → AuditLogs-DrdqOhZL.js} +16 -13
  3. package/dist/{Bin-DMr7K8Kj.js → Bin-Ci2k3z77.js} +8 -8
  4. package/dist/Broadcast-CpDMAG1o.js +306 -0
  5. package/dist/CampaignAnalytic-uRyGaLaN.js +1830 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CwGoEBsW.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DtGe2Og1.js} +8 -5
  7. package/dist/Card-tb98Kyr-.js +1086 -0
  8. package/dist/{Collections-B0uGC2FE.js → Collections-P1S5WjnJ.js} +14 -13
  9. package/dist/Credit-DwK7JYf-.js +286 -0
  10. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-Cyk0iIsd.js +53 -0
  11. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-8r29jKh9.js +4432 -0
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DJLxGk7W.js → EffectSheet.vue_vue_type_style_index_0_lang-BML_-v8I.js} +36 -36
  13. package/dist/Experience-BejtRlOj.js +288 -0
  14. package/dist/{FileSaver.min-BlA0oZEC.js → FileSaver.min-C-hmBaHm.js} +1 -1
  15. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-3bH-tZAm.js +138 -0
  16. package/dist/Game-n8qL896g.js +356 -0
  17. package/dist/GiftCardSetup-Bgsfcu7N.js +736 -0
  18. package/dist/GoalPickerPanel.vue_vue_type_script_setup_true_lang-CzL68PPP.js +424 -0
  19. package/dist/Goals-BB8LJlq3.js +247 -0
  20. package/dist/{Grab-DmmwrGzk.js → Grab-COq3Ujst.js} +33 -32
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-DNtLW0yQ.js → ImageInput.vue_vue_type_script_setup_true_lang-BmLclEyi.js} +1 -1
  22. package/dist/{Index-m7l4insz.js → Index-BdkIinaE.js} +10 -10
  23. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-B9sJ-M20.js → LocationPicker.vue_vue_type_script_setup_true_lang-DsWv3DVb.js} +1 -1
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-Dsg2sWjF.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DvOzGF8c.js} +1 -1
  25. package/dist/LoyaltyDashboard-D4Jtpw0n.js +2911 -0
  26. package/dist/MainLayout-Ca-Xm3eZ.js +143 -0
  27. package/dist/{Marketing-C9pSIdBU.js → Marketing-Cpe4s7NZ.js} +7 -6
  28. package/dist/{MarketingMaterialEdit-BEF2T9LR.js → MarketingMaterialEdit-nTeS9VVx.js} +15 -14
  29. package/dist/Member-DgGZ4Cdg.js +654 -0
  30. package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-_O3B-FIA.js +1281 -0
  31. package/dist/MemberImportHistory-rdlbDVWU.js +187 -0
  32. package/dist/MemberList-BC4aRJTt.js +334 -0
  33. package/dist/{MemberTransactions-CAut1TQb.js → MemberTransactions-BFfdTttp.js} +1 -1
  34. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-1AuHixPC.js → MessageInput.vue_vue_type_script_setup_true_lang-DXajAQy9.js} +5928 -5644
  35. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-8xVDzdO3.js +40 -0
  36. package/dist/Mission-BWCNKTjU.js +363 -0
  37. package/dist/Overview--Q7vzhNK.js +1316 -0
  38. package/dist/{Overview-DOJj4XvO.js → Overview-i02Wnyjn.js} +23 -20
  39. package/dist/Point-CiWxqny5.js +297 -0
  40. package/dist/Promotion-B0G9qfBm.js +426 -0
  41. package/dist/{Queue-55G2gtP5.js → Queue-YfwgYmzH.js} +16 -13
  42. package/dist/{Record-DNPI02c6.js → Record-CCuwrPKW.js} +9 -9
  43. package/dist/Review-ymsfdh7Q.js +45 -0
  44. package/dist/ReviewFacebookCallback-DyDExWvP.js +238 -0
  45. package/dist/ReviewGoogleCallback-DNyg3n2S.js +213 -0
  46. package/dist/{Reward-CnP8R2pS.js → Reward-BKIb0ezH.js} +28 -28
  47. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BN71h9IK.js → RewardGroup.vue_vue_type_script_setup_true_lang-DPaaNgpr.js} +26 -23
  48. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CtB9Ls5-.js → RuleGroup.vue_vue_type_script_setup_true_lang-BLFLybFn.js} +198 -186
  49. package/dist/{Segment-CxiQnnyj.js → Segment-D5_pp7fh.js} +278 -276
  50. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-B1vj5f7T.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-BLLjIA-D.js} +45 -42
  51. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-cWx0G3nM.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BRIcZwnU.js} +4 -4
  52. package/dist/Setting-CD78gIMU.js +574 -0
  53. package/dist/{SettingAdvertisements-Vt7w1WN3.js → SettingAdvertisements-C2AIT4s4.js} +12 -12
  54. package/dist/Settings-DI_tryQV.js +230 -0
  55. package/dist/Store-BV2JTRNZ.js +2615 -0
  56. package/dist/{StoreRewards-DILeipMG.js → StoreRewards-Bk55YXyO.js} +15 -15
  57. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BZZ1fqwg.js +1331 -0
  58. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-C7lVeybl.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BrEzWVrH.js} +2 -2
  59. package/dist/{Tier-BAZ1xuKL.js → Tier-CO2K30Ew.js} +2576 -757
  60. package/dist/{Title-CcNAt47f.js → Title-qProQh3T.js} +41 -37
  61. package/dist/Transaction-qL5L-fE_.js +45 -0
  62. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-hUjQVZ_U.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Co1BPScS.js} +26 -26
  63. package/dist/Voucher-VFD1LY9Y.js +837 -0
  64. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CTQDxc5l.js → VoucherEditor.vue_vue_type_script_setup_true_lang-9QyTl7iq.js} +118 -124
  65. package/dist/WhatsappAccount-CxSGqm7H.js +325 -0
  66. package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-D8L6izf0.js +96 -0
  67. package/dist/WhatsappBot-C4Oz7Xwv.js +441 -0
  68. package/dist/WhatsappBotSettings-CKqaWzwE.js +136 -0
  69. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DuRKA4cj.js → ZodTextField.vue_vue_type_script_setup_true_lang-Bcsi94dw.js} +2 -2
  70. package/dist/{app-Z-UKRG5V.js → app-BEYzXWZO.js} +50954 -42517
  71. package/dist/app.js +1 -1
  72. package/dist/base.export-S_82Elmg.js +75 -0
  73. package/dist/browser-BSAOEeIM.js +1478 -0
  74. package/dist/{business-C7EF6cKC.js → business-DH7djUl8.js} +5 -5
  75. package/dist/campaign-DlHDgoFX.js +100 -0
  76. package/dist/campaign-k_WHxsOR.js +400 -0
  77. package/dist/{campaign.enum-BNN2gLFY.js → campaign.enum-Dx-Zo68Q.js} +1 -1
  78. package/dist/{campaign.fn-Bd34dVnx.js → campaign.fn-B-4JRzft.js} +67 -67
  79. package/dist/{collectible.enum-DO9HdJGH.js → collectible.enum-Liy2wH3s.js} +1 -1
  80. package/dist/collection.fn-zQwWDzZT.js +26 -0
  81. package/dist/currency-CQVHXBFe.js +7 -0
  82. package/dist/{duplicateCampaign-2ODeDw3a.js → duplicateCampaign-YTXMbJTj.js} +11 -11
  83. package/dist/{effect-BcB8IlTI.js → effect-CQkVLHWi.js} +1 -1
  84. package/dist/{email-addresses-BcTeU4Sh.js → email-addresses-BIoVbPGC.js} +209 -201
  85. package/dist/google-C3S8u0mT.js +4 -0
  86. package/dist/{helper-BSgrCJRv.js → helper-BCkTvF4m.js} +1 -1
  87. package/dist/{index-CoHWpylO.js → index-B-bQnb0_.js} +2115 -2557
  88. package/dist/index-BAJOC43K.js +14550 -0
  89. package/dist/{index-HXiYGO4_.js → index-BFIHEBnX.js} +6343 -7693
  90. package/dist/{index-VlFWaBrg.js → index-BJIQe3QJ.js} +1 -1
  91. package/dist/{index-BpI-BI4H.js → index-BJkRTH5T.js} +4 -4
  92. package/dist/index-BOJogkKQ.js +172 -0
  93. package/dist/{index-BoYEqLif.js → index-BRPajAkE.js} +1517 -263
  94. package/dist/{index-CsoBDon4.js → index-BTkxgos0.js} +1590 -1523
  95. package/dist/index-BUP4aHq8.js +32438 -0
  96. package/dist/index-BYvnqARr.js +902 -0
  97. package/dist/{index-hlyg-wxV.js → index-Bonq819P.js} +1 -1
  98. package/dist/{index-CIBPhxlC.js → index-C6mOI2Pp.js} +105 -123
  99. package/dist/{index-Bf6jNZit.js → index-CDIe15AY.js} +24 -9
  100. package/dist/index-CTrcdIkt.js +137 -0
  101. package/dist/index-C_H8jFYf.js +2743 -0
  102. package/dist/index-CpnchVe1.js +74 -0
  103. package/dist/index-D5AR7A5e.js +151 -0
  104. package/dist/index-D7-Q86HI.js +54 -0
  105. package/dist/index-DdOj8Hew.js +53 -0
  106. package/dist/{index-iMPtFp54.js → index-Dvqguh2B.js} +10 -9
  107. package/dist/{index-Bm0QPucw.js → index-hAKRfE-4.js} +14 -14
  108. package/dist/index-o2Ga_qaX.js +39 -0
  109. package/dist/{index.esm2017-CM7OnEyP.js → index.esm2017-D0fhMMPG.js} +128 -128
  110. package/dist/{loading-CSXr0Yqz.js → loading-C686AMVG.js} +1 -1
  111. package/dist/{lodash-Bh7XKI-R.js → lodash-CANlWUWW.js} +1 -1
  112. package/dist/member-import-UzJ6ByIS.js +188 -0
  113. package/dist/membership-DCVzFaFy.js +274 -0
  114. package/dist/{money-BZIST_m9.js → money-DuazwoX7.js} +1 -1
  115. package/dist/{number-DXLR2w95.js → number-B2HFiV0g.js} +1 -1
  116. package/dist/objectid-Bq-oVMdP.js +145 -0
  117. package/dist/onboarding-BxvNxz-9.js +131 -0
  118. package/dist/onboardingSetup-CcvKmyx8.js +17 -0
  119. package/dist/{plugins-4FlbwoES.js → plugins-C39O5j42.js} +13 -12
  120. package/dist/remy-Qz_pNsUS.js +13 -0
  121. package/dist/{reward-DUbl79bZ.js → reward-HYt-2nxt.js} +1 -1
  122. package/dist/{rule-BQUoZ4l_.js → rule-3xNIYM7z.js} +337 -275
  123. package/dist/style.css +1 -1
  124. package/dist/{template-BoiSG7G7.js → template-D37Z_b0m.js} +6 -6
  125. package/dist/timezone-JwnQgpaU.js +20 -0
  126. package/dist/transaction.fn-C5vswLI_.js +71 -0
  127. package/dist/{trigger-D5g5m6tT.js → trigger-Bc6s2cvq.js} +17 -17
  128. package/dist/useMarketingMaterialActions-DMGyAXcy.js +96 -0
  129. package/dist/{usePagination-DHePBBoR.js → usePagination-DLOOwiiY.js} +1 -1
  130. package/dist/{user-C_ToSo-g.js → user-CTIGugVF.js} +1 -1
  131. package/dist/{vue-i18n-BcYh6_51.js → vue-i18n-Dpic36zz.js} +287 -287
  132. package/dist/{xlsx-h4G1C-xj.js → xlsx-CT9_1SFr.js} +786 -786
  133. package/dist/{zod-CgigfJar.js → zod-CGVrMcDl.js} +1 -1
  134. package/package.json +10 -6
  135. package/dist/Broadcast-C9akM-TB.js +0 -266
  136. package/dist/Card-DRkIYs0M.js +0 -910
  137. package/dist/Credit-V5YA_hGx.js +0 -260
  138. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  139. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CYQMXARx.js +0 -3377
  140. package/dist/Experience-WTWy5yY6.js +0 -259
  141. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  142. package/dist/Game-BwOfTCW5.js +0 -330
  143. package/dist/LoyaltyDashboard-CJdhYiea.js +0 -1082
  144. package/dist/MainLayout-Du5kZOtA.js +0 -41
  145. package/dist/Member-DUV_vbPI.js +0 -280
  146. package/dist/MemberList-Ye4nOk-i.js +0 -1601
  147. package/dist/Mission-BBmCGpt8.js +0 -334
  148. package/dist/Point-Bzg6hi6o.js +0 -262
  149. package/dist/Promotion-BMXIp_ef.js +0 -397
  150. package/dist/Review-CYNPPxYU.js +0 -1141
  151. package/dist/ReviewFacebookCallback-0SUkKAaC.js +0 -243
  152. package/dist/ReviewGoogleCallback-BZEzx68n.js +0 -208
  153. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-C4vohf6c.js +0 -181
  154. package/dist/Setting-jHAjccod.js +0 -2047
  155. package/dist/Store-Cu-hKmVa.js +0 -1996
  156. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CGz6CTWA.js +0 -1130
  157. package/dist/Transaction-D7DO3dKQ.js +0 -39
  158. package/dist/Voucher-Cq-n1CaC.js +0 -421
  159. package/dist/campaign--MjoY1Mn.js +0 -219
  160. package/dist/campaign-DHBuP4UA.js +0 -277
  161. package/dist/export-CjB7qxZ9.js +0 -97
  162. package/dist/index-BIAjmMga.js +0 -85
  163. package/dist/index-Bv4MBLQ5.js +0 -52
  164. package/dist/index-hbyCVNa7.js +0 -30289
  165. package/dist/membership-CfredTm3.js +0 -255
  166. package/dist/objectid-Dg4ZodlT.js +0 -145
  167. package/dist/useMarketingMaterialActions-B-Jlw2Z9.js +0 -107
@@ -0,0 +1,187 @@
1
+ import { defineComponent as F, ref as I, watch as v, onBeforeMount as D, openBlock as C, createElementBlock as M, createElementVNode as N, createVNode as u, unref as t, h as i } from "vue";
2
+ import { a as R } from "./index-BUP4aHq8.js";
3
+ import { u as k, _ as L } from "./usePagination-DLOOwiiY.js";
4
+ import { _ as O } from "./FilterChip.vue_vue_type_script_setup_true_lang-3bH-tZAm.js";
5
+ import { c as l } from "./string-Gcy5IM_H.js";
6
+ import "./index-Bonq819P.js";
7
+ import { useSnackbar as P, components as c } from "@feedmepos/ui-library";
8
+ import { useCoreStore as T } from "@feedmepos/mf-common";
9
+ import { F as U } from "./member-import-UzJ6ByIS.js";
10
+ import { F as g } from "./FileSaver.min-C-hmBaHm.js";
11
+ import { h as m } from "./moment-D7p2TMB-.js";
12
+ import { useRouter as V } from "vue-router";
13
+ import { m as d } from "./index-CTrcdIkt.js";
14
+ import { R as B } from "./app-BEYzXWZO.js";
15
+ const $ = { class: "flex flex-col gap-16" }, Y = { class: "flex items-center" }, re = /* @__PURE__ */ F({
16
+ __name: "MemberImportHistory",
17
+ setup(z) {
18
+ const w = V(), b = T(), S = P(), n = I({ status: [] });
19
+ function _(e) {
20
+ return e === "COMPLETED" ? "text-fm-color-typo-success bg-fm-color-system-success-100" : ["INVALID", "STOPPED"].includes(e) ? "text-fm-color-typo-error bg-fm-color-system-error-100" : ["UPLOADED", "VALIDATING", "QUEUED", "RUNNING", "CANCELLING"].includes(
21
+ e
22
+ ) ? "text-fm-color-typo-warning bg-fm-color-system-warning-100" : "text-fm-color-typo-info bg-fm-color-system-info-100";
23
+ }
24
+ function p(e) {
25
+ return m(e.originalFileExpiresAt).isAfter(m());
26
+ }
27
+ function f(e, o = !1) {
28
+ S.open({
29
+ type: "error",
30
+ message: o && e instanceof R && e.status === 410 ? "Original file has expired or is unavailable." : "Unable to download the import file. Please try again."
31
+ });
32
+ }
33
+ async function y(e) {
34
+ try {
35
+ g.saveAs(
36
+ await d.downloadOriginalImportFile(e._id.toString()),
37
+ e.file.originalName
38
+ );
39
+ } catch (o) {
40
+ f(o, !0);
41
+ }
42
+ }
43
+ async function h(e) {
44
+ try {
45
+ g.saveAs(
46
+ await d.downloadImportResult(e._id.toString()),
47
+ `member-import-${e._id}.csv`
48
+ );
49
+ } catch (o) {
50
+ f(o);
51
+ }
52
+ }
53
+ const x = [
54
+ {
55
+ header: "File",
56
+ accessorFn: (e) => e.file.originalName,
57
+ enableSorting: !1
58
+ },
59
+ {
60
+ header: "Import ID",
61
+ accessorFn: (e) => e._id.toString(),
62
+ enableSorting: !1
63
+ },
64
+ {
65
+ header: "Mode",
66
+ accessorFn: (e) => l.title(e.options.mode),
67
+ enableSorting: !1
68
+ },
69
+ {
70
+ header: "Status",
71
+ cell(e) {
72
+ const o = e.row.original.status;
73
+ return i(c.FmChip, {
74
+ label: l.title(o),
75
+ compact: !0,
76
+ class: _(o)
77
+ });
78
+ },
79
+ enableSorting: !1
80
+ },
81
+ {
82
+ header: "Rows",
83
+ accessorFn: (e) => `${e.summary.completed}/${e.summary.total} completed · ${e.summary.failed} failed`,
84
+ enableSorting: !1
85
+ },
86
+ {
87
+ header: "Created / completed",
88
+ accessorFn: (e) => [e.createdAt, e.completedAt].filter(Boolean).map((o) => m(o).format("D MMM YYYY, hh:mmA")).join(" / "),
89
+ enableSorting: !1
90
+ },
91
+ {
92
+ header: "Error",
93
+ cell(e) {
94
+ return i(
95
+ "div",
96
+ {
97
+ class: "max-w-[240px] truncate",
98
+ title: e.row.original.error ?? void 0
99
+ },
100
+ e.row.original.error || "-"
101
+ );
102
+ },
103
+ enableSorting: !1
104
+ },
105
+ {
106
+ header: "Actions",
107
+ cell(e) {
108
+ const o = e.row.original;
109
+ return i("div", { class: "flex gap-4" }, [
110
+ i(c.FmButton, {
111
+ icon: "download",
112
+ variant: "tertiary",
113
+ disabled: !p(o),
114
+ "aria-label": "Download original file",
115
+ title: p(o) ? "Download original file" : "Original file has expired",
116
+ onClick: (a) => {
117
+ a.stopPropagation(), y(o);
118
+ }
119
+ }),
120
+ i(c.FmButton, {
121
+ icon: "description",
122
+ variant: "tertiary",
123
+ disabled: o.summary.total === 0,
124
+ "aria-label": "Download result CSV",
125
+ title: "Download result CSV",
126
+ onClick: (a) => {
127
+ a.stopPropagation(), h(o);
128
+ }
129
+ })
130
+ ]);
131
+ },
132
+ enableSorting: !1
133
+ }
134
+ ], A = U.options.map((e) => ({
135
+ label: l.title(e),
136
+ value: e
137
+ })), { tableMeta: r, rowData: E, debouncedFetchData: s } = k(
138
+ (e) => d.readImportHistory(e, n.value.status),
139
+ { key: "createdAt", descending: !0 }
140
+ );
141
+ return v(
142
+ n,
143
+ () => {
144
+ s();
145
+ },
146
+ { deep: !0 }
147
+ ), D(async () => {
148
+ var e, o;
149
+ if (!((o = (e = b.sessionUser.value) == null ? void 0 : e.role) != null && o.isAdmin)) {
150
+ await w.replace({
151
+ name: B["$connect-LOYALTY_MEMBER_LIST"]
152
+ });
153
+ return;
154
+ }
155
+ await s();
156
+ }), (e, o) => (C(), M("div", $, [
157
+ N("div", Y, [
158
+ u(O, {
159
+ modelValue: t(n).status,
160
+ "onUpdate:modelValue": o[0] || (o[0] = (a) => t(n).status = a),
161
+ class: "cursor-pointer text-fm-color-neutral-gray-400",
162
+ "right-icon": "keyboard_arrow_down",
163
+ label: "Status: ",
164
+ "show-item-label": !0,
165
+ items: t(A)
166
+ }, null, 8, ["modelValue", "items"])
167
+ ]),
168
+ u(L, {
169
+ loading: t(r).isLoading,
170
+ "row-data": t(E),
171
+ "row-count": t(r).totalRows,
172
+ "column-defs": x,
173
+ "page-count": t(r).pageCount,
174
+ "page-index": t(r).pageIndex,
175
+ "page-size": t(r).pageSize,
176
+ "shrink-at": !1,
177
+ onPageChange: o[1] || (o[1] = (a) => t(s)({
178
+ pageSize: a.pageSize,
179
+ pageIndex: a.pageIndex
180
+ }))
181
+ }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size"])
182
+ ]));
183
+ }
184
+ });
185
+ export {
186
+ re as default
187
+ };
@@ -0,0 +1,334 @@
1
+ import { defineComponent as ye, ref as I, computed as Te, onMounted as xe, resolveComponent as D, openBlock as oe, createElementBlock as ve, createElementVNode as Me, createVNode as T, unref as i, withDirectives as Ne, vShow as Fe, createBlock as Ie, createCommentVNode as De, h as d } from "vue";
2
+ import { h } from "./moment-D7p2TMB-.js";
3
+ import { components as S } from "@feedmepos/ui-library";
4
+ import { e as Ee, M as Ve } from "./email-addresses-BIoVbPGC.js";
5
+ import { w as ke } from "./xlsx-CT9_1SFr.js";
6
+ import "./index-Bonq819P.js";
7
+ import "./index-BFIHEBnX.js";
8
+ import { u as Be } from "./membership-DCVzFaFy.js";
9
+ import { u as Re, _ as Ye } from "./MemberDetailSheet.vue_vue_type_script_setup_true_lang-_O3B-FIA.js";
10
+ import { f as x } from "./number-B2HFiV0g.js";
11
+ import { u as Ae } from "./loading-C686AMVG.js";
12
+ import { t as Pe } from "./money-DuazwoX7.js";
13
+ import { u as Oe } from "./business-DH7djUl8.js";
14
+ import { u as Le, _ as ze } from "./usePagination-DLOOwiiY.js";
15
+ import { g as Ke, a as je, b as Ue } from "./user-CTIGugVF.js";
16
+ import { useRouter as $e } from "vue-router";
17
+ import { m as E } from "./index-CTrcdIkt.js";
18
+ import { R as qe } from "./app-BEYzXWZO.js";
19
+ import { o as ae } from "./objectId-dwaoBfJX.js";
20
+ const Je = { class: "flex items-center justify-end" }, ft = /* @__PURE__ */ ye({
21
+ __name: "MemberList",
22
+ setup(Ge) {
23
+ const ne = Re(), u = Be(), v = Oe(), { minor: ie } = Ae, se = $e(), re = [
24
+ {
25
+ header: "Name",
26
+ enableSorting: !0,
27
+ accessorKey: "name",
28
+ cell(t) {
29
+ return Ke(t.row.original);
30
+ }
31
+ },
32
+ {
33
+ header: "Phone",
34
+ enableSorting: !0,
35
+ accessorKey: "phoneNumber"
36
+ },
37
+ {
38
+ accessorFn: (t) => h(t.joinAt || ae(t._id.toString())).format("D MMM YYYY"),
39
+ header: "Customer Since",
40
+ accessorKey: "_id",
41
+ id: "_id"
42
+ },
43
+ {
44
+ accessorKey: "collection_TIER_0_balance",
45
+ header: "Tier",
46
+ enableSorting: !0,
47
+ cell(t) {
48
+ return je(
49
+ t.row.original,
50
+ u.sortedTiers
51
+ );
52
+ }
53
+ },
54
+ {
55
+ header: "Title",
56
+ enableSorting: !1,
57
+ cell(t) {
58
+ return Ue(
59
+ t.row.original,
60
+ u.sortedTitles
61
+ );
62
+ }
63
+ },
64
+ {
65
+ accessorKey: "collection_CREDIT_0_balance",
66
+ accessorFn: (t) => {
67
+ var o, a, n;
68
+ return x(((n = (a = (o = t.collection) == null ? void 0 : o.CREDIT) == null ? void 0 : a[0]) == null ? void 0 : n.balance) ?? 0, 2);
69
+ },
70
+ header: "Credit(s)",
71
+ enableSorting: !0
72
+ },
73
+ {
74
+ accessorKey: "collection_POINT_0_balance",
75
+ accessorFn: (t) => {
76
+ var o, a, n;
77
+ return x(((n = (a = (o = t.collection) == null ? void 0 : o.POINT) == null ? void 0 : a[0]) == null ? void 0 : n.balance) ?? 0, 2);
78
+ },
79
+ header: "Experience(s)",
80
+ enableSorting: !0
81
+ },
82
+ {
83
+ accessorKey: "collection_COIN_0_balance",
84
+ accessorFn: (t) => {
85
+ var o, a, n;
86
+ return x(((n = (a = (o = t.collection) == null ? void 0 : o.COIN) == null ? void 0 : a[0]) == null ? void 0 : n.balance) ?? 0, 2);
87
+ },
88
+ header: "Point(s)",
89
+ enableSorting: !0
90
+ },
91
+ {
92
+ accessorFn: (t) => {
93
+ var o;
94
+ return ((o = t.stats) == null ? void 0 : o.visitCount) ?? 0;
95
+ },
96
+ header: "Total visit",
97
+ accessorKey: "stats.visitCount",
98
+ id: "stats.visitCount"
99
+ },
100
+ {
101
+ accessorFn: (t) => {
102
+ var o;
103
+ return (o = t.stats) == null ? void 0 : o.lastVisit;
104
+ },
105
+ sortingFn: (t, o) => {
106
+ var a, n;
107
+ return new Date((a = t.original.stats) == null ? void 0 : a.lastVisit).getTime() - new Date((n = o.original.stats) == null ? void 0 : n.lastVisit).getTime();
108
+ },
109
+ id: "stats.lastVisit",
110
+ header: "Last visit",
111
+ cell(t) {
112
+ var o, a;
113
+ return d("div", { class: "flex items-center justify-end gap-4" }, [
114
+ d(
115
+ "span",
116
+ (o = t.row.original.stats) != null && o.lastVisit ? h((a = t.row.original.stats) == null ? void 0 : a.lastVisit).fromNow() : "NA"
117
+ ),
118
+ d(
119
+ S.FmTooltip,
120
+ {
121
+ content: h(t.row.original.stats.lastVisit).format(
122
+ "D MMM YYYY - hh:mmA"
123
+ )
124
+ },
125
+ [d(S.FmIcon, { name: "info", outline: !0, size: "sm" })]
126
+ )
127
+ ]);
128
+ }
129
+ },
130
+ {
131
+ id: "actions",
132
+ cell(t) {
133
+ return d(
134
+ S.FmMenu,
135
+ {
136
+ placement: "bottom-end",
137
+ onClick: (o) => {
138
+ o.stopPropagation();
139
+ }
140
+ },
141
+ {
142
+ "menu-button": () => d(S.FmButton, { icon: "more_vert", variant: "tertiary" }),
143
+ default: () => [
144
+ d(S.FmMenuItem, {
145
+ label: "Transaction details",
146
+ onClick: async (o) => {
147
+ o.stopPropagation(), await fe(t.row.original._id);
148
+ }
149
+ })
150
+ ]
151
+ }
152
+ );
153
+ }
154
+ }
155
+ ], { tableMeta: l, rowData: le, onSort: ce, debouncedFetchData: M, onSearch: de } = Le(E.read), V = I(), _ = I(!1), m = I(), ue = Te(() => v.locations.map((t) => ({
156
+ label: t.name,
157
+ value: t._id
158
+ })));
159
+ async function me() {
160
+ m.value = await E.readById(
161
+ m.value._id.toString()
162
+ ), _.value = !0;
163
+ }
164
+ async function pe() {
165
+ await M(), _.value = !1;
166
+ }
167
+ async function fe(t) {
168
+ await se.push({
169
+ name: qe["$connect-LOYALTY_MEMBER_TRANSACTIONS"],
170
+ params: { id: t }
171
+ });
172
+ }
173
+ const N = {
174
+ sortBy: "_id",
175
+ descending: !1,
176
+ rowsPerPage: 1e3
177
+ };
178
+ function F(t) {
179
+ const o = h(t);
180
+ return o.isValid() ? o.format("DD/MM/YYYY") : "";
181
+ }
182
+ async function ge() {
183
+ const t = new Ve(), o = N.rowsPerPage;
184
+ await ie(
185
+ async () => {
186
+ var C, r, p, k, B, R, Y, A, P, O, L, z, K, j, U, $, q, J, G, H, Q, W, X;
187
+ let a, n = !0;
188
+ for (; n; ) {
189
+ const w = await E.readCursor({
190
+ limit: o,
191
+ sortBy: N.sortBy,
192
+ descending: N.descending,
193
+ ...a ? { cursor: a } : {}
194
+ });
195
+ if (!w.resources.length)
196
+ break;
197
+ for (const e of w.resources) {
198
+ const be = (C = Ee.parseOneAddress(
199
+ e == null ? void 0 : e.email
200
+ )) != null && C.domain.includes("feedmepos.com") ? void 0 : e.email, he = (p = ((r = e == null ? void 0 : e.collection) == null ? void 0 : r.TITLE) || []) == null ? void 0 : p.reduce(
201
+ (s, c) => {
202
+ var g, b;
203
+ const f = (b = (g = u.sortedTitles) == null ? void 0 : g.find(
204
+ (y) => y._id === c.collectible
205
+ )) == null ? void 0 : b.name;
206
+ return !f || c.balance <= 0 || s.push(f), s;
207
+ },
208
+ []
209
+ ), Se = (u.sortedTitles || []).reduce(
210
+ (s, c) => {
211
+ var g, b, y, te;
212
+ const f = (te = (y = (b = (((g = e == null ? void 0 : e.collection) == null ? void 0 : g.TITLE) || []).find(
213
+ (we) => we.collectible === c._id
214
+ )) == null ? void 0 : b.expiryBalance) == null ? void 0 : y[0]) == null ? void 0 : te.expiredAt;
215
+ return s[c.name] = f ? h(f).format("DD/MM/YYYY") : "", s;
216
+ },
217
+ {}
218
+ ), _e = ((R = (B = (k = e.collection) == null ? void 0 : k.CREDIT) == null ? void 0 : B.at(0)) == null ? void 0 : R.balance) || 0, Z = ((O = (P = (A = (Y = e.collection) == null ? void 0 : Y.CREDIT) == null ? void 0 : A.at(0)) == null ? void 0 : P.expiryBalance) == null ? void 0 : O.reduce(
219
+ (s, c) => s + c.amount,
220
+ 0
221
+ )) || 0, ee = x(_e, 2), Ce = {
222
+ ID: e._id.toString(),
223
+ Name: ((L = e.name) == null ? void 0 : L.trim()) || "",
224
+ Phone: ((z = e == null ? void 0 : e.phoneNumber) == null ? void 0 : z.trim()) || "",
225
+ Email: be || "",
226
+ Gender: e.gender || "",
227
+ CardNo: e.cardNo || "",
228
+ Birthday: e != null && e.birthday ? F(e == null ? void 0 : e.birthday) : "",
229
+ Credit: (Number(ee) - Number(Z)).toFixed(2),
230
+ FreeCredit: Number(Z.toFixed(2)),
231
+ TotalCredit: Number(ee),
232
+ Exp: e != null && e.collection ? ((U = (j = (K = e.collection) == null ? void 0 : K.POINT) == null ? void 0 : j.at(0)) == null ? void 0 : U.balance) ?? 0 : 0,
233
+ Point: e != null && e.collection ? ((J = (q = ($ = e.collection) == null ? void 0 : $.COIN) == null ? void 0 : q.at(0)) == null ? void 0 : J.balance) ?? 0 : 0,
234
+ Tier: e != null && e.collection ? ((Q = (H = (G = e.collection) == null ? void 0 : G.TIER) == null ? void 0 : H.at(0)) == null ? void 0 : Q.balance) ?? 0 : 0,
235
+ Titles: he.join(","),
236
+ ...Se,
237
+ TotalTransaction: e.stats.visitCount,
238
+ AvgSpent: Pe(Number(e.stats.avgBillSize || 0)).toFormat(
239
+ !1
240
+ ),
241
+ TotalSpent: e.stats.avgBillSize * e.stats.visitCount,
242
+ LastVisit: F(e.stats.lastVisit),
243
+ Feedback: ((W = e.stats) == null ? void 0 : W.feedbackCount) || 0,
244
+ JoinedAt: F(e.joinAt || ae(e._id)),
245
+ JoinedAtLocation: e.location && ((X = ue.value.find((s) => s.value == e.location)) == null ? void 0 : X.label) || "-",
246
+ VisitFrequency: `${Number(
247
+ Math.ceil(e.stats.avgVisitFrequency).toFixed(0)
248
+ )}`
249
+ };
250
+ t.addRecord(Ce);
251
+ }
252
+ a = w.meta.nextCursor ?? void 0, n = w.meta.hasNext && !!a;
253
+ }
254
+ await ke(
255
+ t.buildExcel(),
256
+ `members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
257
+ {
258
+ bookType: "xlsx",
259
+ bookSST: !1,
260
+ type: "array"
261
+ }
262
+ );
263
+ },
264
+ {
265
+ message: "Exporting member...",
266
+ successMessage: "Member exported successfully"
267
+ }
268
+ );
269
+ }
270
+ return xe(async () => {
271
+ await u.readMembership(), await v.readLocations(), await ne.read(), await v.readLocations(), await M();
272
+ }), (t, o) => {
273
+ const a = D("FmSearch"), n = D("FmButton"), C = D("FmSnackbar");
274
+ return oe(), ve("div", null, [
275
+ Me("div", Je, [
276
+ T(a, {
277
+ class: "mt-4",
278
+ modelValue: i(l).searchValue,
279
+ "onUpdate:modelValue": [
280
+ o[0] || (o[0] = (r) => i(l).searchValue = r),
281
+ i(de)
282
+ ],
283
+ placeholder: "Search",
284
+ collapsible: ""
285
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]),
286
+ T(n, {
287
+ icon: "ios_share",
288
+ variant: "tertiary",
289
+ onClick: ge
290
+ })
291
+ ]),
292
+ Ne(T(C, {
293
+ "z-index": 0,
294
+ class: "!max-w-full my-16",
295
+ title: "Info",
296
+ description: "Current list is not up to date, please refresh table for latest data.",
297
+ variant: "info",
298
+ dismissable: "",
299
+ onOnDismiss: o[1] || (o[1] = (r) => _.value = !1),
300
+ action: "Refresh",
301
+ onOnAction: pe
302
+ }, null, 512), [
303
+ [Fe, i(_)]
304
+ ]),
305
+ T(ze, {
306
+ loading: i(l).isLoading,
307
+ "row-data": i(le),
308
+ "row-count": i(l).totalRows,
309
+ "column-defs": re,
310
+ "shrink-at": !1,
311
+ "page-count": i(l).pageCount,
312
+ "page-index": i(l).pageIndex,
313
+ "page-size": i(l).pageSize,
314
+ onSortChange: i(ce),
315
+ onPageChange: o[2] || (o[2] = (r) => i(M)({ pageSize: r.pageSize, pageIndex: r.pageIndex })),
316
+ onRowClick: o[3] || (o[3] = (r) => {
317
+ var p;
318
+ m.value = r.original, (p = i(V)) == null || p.showSheet();
319
+ })
320
+ }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"]),
321
+ i(m) ? (oe(), Ie(Ye, {
322
+ key: 0,
323
+ ref_key: "sheetRef",
324
+ ref: V,
325
+ member: i(m),
326
+ "onUpdate:member": me
327
+ }, null, 8, ["member"])) : De("", !0)
328
+ ]);
329
+ };
330
+ }
331
+ });
332
+ export {
333
+ ft as default
334
+ };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as d, ref as p, resolveComponent as _, openBlock as a, createElementBlock as f, createVNode as v, unref as o, createBlock as u, createCommentVNode as b } from "vue";
2
- import { _ as k, a as x } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-CGz6CTWA.js";
2
+ import { _ as k, a as x } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-BZZ1fqwg.js";
3
3
  import { useRouter as y } from "vue-router";
4
4
  const C = { class: "flex flex-col gap-y-32 pb-24" }, F = /* @__PURE__ */ d({
5
5
  __name: "MemberTransactions",