@feedmepos/mf-connect 0.1.0-beta.54 → 0.1.0-beta.56

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 (92) hide show
  1. package/dist/{Analytic-DNI1i_SI.js → Analytic-D_D92i4G.js} +11 -11
  2. package/dist/{App-DObCjrhE.js → App-QpezWBnJ.js} +10 -6
  3. package/dist/{AuditLogs-DImm4Ydu.js → AuditLogs-D2pZEngG.js} +12 -11
  4. package/dist/{Bin-CcNRMd0x.js → Bin-DBf0InBH.js} +8 -8
  5. package/dist/{Broadcast-BotivEx9.js → Broadcast-DAk3nU0-.js} +55 -54
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Ba3NttQm.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-vEnLN5sN.js} +6 -6
  7. package/dist/{Card-1LyRUNDz.js → Card-Bu-Z11ti.js} +15 -15
  8. package/dist/Collections-CXUv8OGD.js +459 -0
  9. package/dist/{Credit-C4FehhPS.js → Credit-BRu7pvJ8.js} +42 -41
  10. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +58 -0
  11. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BlTxHhHW.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bg5H5bLD.js} +28 -28
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CEfunKXB.js → EffectSheet.vue_vue_type_style_index_0_lang-CD-3CQjK.js} +6 -6
  13. package/dist/{Experience-gBfv7ru-.js → Experience-CGM9hWQF.js} +39 -38
  14. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js +118 -0
  15. package/dist/{Game-R9RusPq4.js → Game-CCv8_6AO.js} +45 -44
  16. package/dist/{Index-DIwqSHLL.js → Index-DXTc6Yk3.js} +10 -10
  17. package/dist/{Marketing-CZYD2ddp.js → Marketing-9qidJ_bk.js} +6 -6
  18. package/dist/Member-I6-Pr4Fh.js +319 -0
  19. package/dist/{MemberList-DqeHySdg.js → MemberList-BWDjjtpG.js} +24 -24
  20. package/dist/{MemberTransactions-CXy0zxGc.js → MemberTransactions-_PT_WTRE.js} +1 -1
  21. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CbTndvQx.js → MessageInput.vue_vue_type_script_setup_true_lang-K6aZwciE.js} +5 -5
  22. package/dist/{Mission-Dt2R9JVy.js → Mission-DWfkmcdf.js} +36 -35
  23. package/dist/{Overview-BrSbdy2_.js → Overview-QMdBRBlA.js} +17 -17
  24. package/dist/{Point-BB4OoQ9O.js → Point-DwZQVgF_.js} +49 -48
  25. package/dist/{Promotion-Cd-4VoeS.js → Promotion-DYmwS5O9.js} +33 -32
  26. package/dist/Queue-6MPd1asH.js +244 -0
  27. package/dist/{Record-jvc_mbY3.js → Record-CCxdtJJr.js} +7 -7
  28. package/dist/{Reward-BlbNKLJO.js → Reward-C4VcRpIW.js} +15 -15
  29. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DPA6NyE3.js → RewardGroup.vue_vue_type_script_setup_true_lang-BES7zeqg.js} +11 -11
  30. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DeDE4FBr.js → RuleGroup.vue_vue_type_script_setup_true_lang-Dd3Ljndp.js} +12 -12
  31. package/dist/{Segment-IxmlRjfR.js → Segment-bcXOjAzv.js} +14 -14
  32. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DGXsFLVO.js → SelectItems.vue_vue_type_script_setup_true_lang-Ci5ykIt2.js} +2 -2
  33. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CIuHzjZF.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CpHvvfH0.js} +3 -3
  34. package/dist/{Setting-D2KZjG9v.js → Setting-CZQT4bGV.js} +10 -10
  35. package/dist/{Store-BAtjSdn-.js → Store-DN55d_IW.js} +122 -119
  36. package/dist/{StoreRewards-zWZU6tL0.js → StoreRewards-BTnHFOZx.js} +13 -13
  37. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DPGqXgEM.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BJcBvSI0.js} +155 -151
  38. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CpM53JM7.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DpRC1Opy.js} +1 -1
  39. package/dist/{Tier-CfrVPz6a.js → Tier-B7WlTtk_.js} +19 -19
  40. package/dist/{Title-CUrZfzDs.js → Title-CGHvbMsj.js} +19 -19
  41. package/dist/{Transaction-DBjMeSL6.js → Transaction-Cce4r0cs.js} +2 -2
  42. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BnGFcBsw.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-KYefM4Ey.js} +6 -6
  43. package/dist/{Voucher-k0x5ghAp.js → Voucher-BRryWivA.js} +44 -43
  44. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-B3Zbbg8H.js → VoucherEditor.vue_vue_type_script_setup_true_lang-D9efKb13.js} +10 -10
  45. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BCtEZ3YW.js → ZodTextField.vue_vue_type_script_setup_true_lang-BRPkxkU5.js} +1 -1
  46. package/dist/{app-BX_kcnjN.js → app-Cy8_Vaxo.js} +1 -1
  47. package/dist/{app-C27ny1rN.js → app-DTlg8MKp.js} +172 -142
  48. package/dist/app.js +1 -1
  49. package/dist/{business-CaL8dhbB.js → business-BMaADexo.js} +1 -1
  50. package/dist/{campaign-BEPgE5CH.js → campaign-C8fB-bPD.js} +12 -12
  51. package/dist/{campaign-D1IDv9pf.js → campaign-Cy1er8EV.js} +2 -2
  52. package/dist/{campaign.enum-DPtLnWTT.js → campaign.enum-C1u87jO3.js} +1 -1
  53. package/dist/{campaign.fn-gbTZCSx4.js → campaign.fn-Ba2PAVOQ.js} +54 -54
  54. package/dist/{collectible.enum-BGp0i5br.js → collectible.enum-TJ2-owoP.js} +1 -1
  55. package/dist/{collection.fn-BRYSNJcJ.js → collection.fn-Be0qsf0j.js} +2 -2
  56. package/dist/{dto-CKsjCDtT.js → dto-CYkVsWtG.js} +4 -4
  57. package/dist/{effect-COM0bU6H.js → effect-BsKfDszn.js} +1 -1
  58. package/dist/{email-addresses-8dkAXaaH.js → email-addresses-udodm5zn.js} +1 -1
  59. package/dist/{export-BOyaDPx1.js → export-BANYPH3S.js} +3 -3
  60. package/dist/{helper-BPWsTSo7.js → helper-B4n2GzUT.js} +1 -1
  61. package/dist/{index-syqkAq4m.js → index-CTnXuOHy.js} +1 -1
  62. package/dist/{index-CPhjQE7M.js → index-CZh5_4r2.js} +1 -1
  63. package/dist/{index-KMvP72cy.js → index-C_uA0tpL.js} +3 -3
  64. package/dist/{index-DOCmOcoV.js → index-DXsJh2qk.js} +355 -316
  65. package/dist/{index-C9HOsq0v.js → index-DvVCTYVh.js} +1 -1
  66. package/dist/{index-3cal5Crf.js → index-DxkyGhLq.js} +9 -9
  67. package/dist/{index-DnwoMUg-.js → index-H50yBk-G.js} +1 -1
  68. package/dist/{index-ziYFMe26.js → index-JDYQ7e_j.js} +3 -3
  69. package/dist/{index-BcGf92gd.js → index-JYlCBixV.js} +24 -21
  70. package/dist/{index-CPPpEEkl.js → index-fxGxOKSf.js} +10 -10
  71. package/dist/{index-EZiP7ATV.js → index-jD3VA_Wp.js} +1 -1
  72. package/dist/{index-M-cFQZfx.js → index-l7oroAM_.js} +1 -1
  73. package/dist/{index.esm2017-Bkj89W-b.js → index.esm2017-uOw4t7a-.js} +90 -90
  74. package/dist/{loading--fQbVp4h.js → loading-LKg7ETnZ.js} +1 -1
  75. package/dist/{membership-Bz5Os9GI.js → membership-Ce1306Ft.js} +3 -3
  76. package/dist/{money-m-8Q9Cic.js → money-asfLa4Lt.js} +1 -1
  77. package/dist/{number-BL2f3-uB.js → number-CQDR1ZIe.js} +1 -1
  78. package/dist/objectid-CPbhwwne.js +145 -0
  79. package/dist/{plugins-BHMrdAR2.js → plugins-Du32AI_-.js} +1189 -1189
  80. package/dist/{reward-fbGsZP19.js → reward-BgF2Ig1i.js} +1 -1
  81. package/dist/{rule-C4G5Qgb9.js → rule-B3tx1ogH.js} +3 -3
  82. package/dist/{rule-builder-t9GpaWj-.js → rule-builder-CrturC5Q.js} +1 -1
  83. package/dist/{template-DQJGwq08.js → template-DcEa3i5E.js} +4 -4
  84. package/dist/{trigger-Iva-VDNY.js → trigger-c_TWDwnV.js} +4 -4
  85. package/dist/{user-Ck3D1xfX.js → user-CUTqlbQz.js} +1 -1
  86. package/dist/{vue-i18n-D3N-L0QD.js → vue-i18n-bLo1ykBN.js} +157 -157
  87. package/dist/{xlsx-CcF8Y9u8.js → xlsx-BUKrzqzV.js} +1 -1
  88. package/package.json +6 -4
  89. package/dist/Collections-CCwwox7X.js +0 -449
  90. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-CLFeMi0j.js +0 -169
  91. package/dist/Member-CLlV_z9S.js +0 -69
  92. package/dist/objectid-Uw4EvP0I.js +0 -145
@@ -0,0 +1,459 @@
1
+ var te = Object.defineProperty;
2
+ var ae = (g, u, c) => u in g ? te(g, u, { enumerable: !0, configurable: !0, writable: !0, value: c }) : g[u] = c;
3
+ var O = (g, u, c) => ae(g, typeof u != "symbol" ? u + "" : u, c);
4
+ import { defineComponent as J, ref as f, computed as Q, watch as K, resolveComponent as d, openBlock as x, createBlock as z, unref as o, isRef as j, withCtx as I, createElementVNode as C, createVNode as r, createElementBlock as P, Fragment as N, renderList as le, createCommentVNode as R, onMounted as ne, h as S } from "vue";
5
+ import { h as G } from "./moment-BWErdI6_.js";
6
+ import { components as H } from "@feedmepos/ui-library";
7
+ import { a as se } from "./plugins-Du32AI_-.js";
8
+ import { J as re } from "./JsonViewer-v8_C7l5N.js";
9
+ import { u as W } from "./loading-LKg7ETnZ.js";
10
+ import { u as ie } from "./app-wDQR6dpb.js";
11
+ import { useRoute as X, useRouter as ue } from "vue-router";
12
+ import { c as q } from "./index-CTnXuOHy.js";
13
+ import { e as p } from "./index-vh86FiIQ.js";
14
+ import { u as Y, w as de } from "./xlsx-BUKrzqzV.js";
15
+ import { u as ce, _ as me } from "./usePagination-BeF5K3M7.js";
16
+ import { m as pe } from "./index-DvVCTYVh.js";
17
+ import { o as fe } from "./objectId-dwaoBfJX.js";
18
+ const ge = { class: "space-y-16" }, be = { class: "gap-16 grid grid-cols-2" }, Ce = { class: "flex items-center gap-8" }, ve = /* @__PURE__ */ J({
19
+ __name: "CreateCollectionSheet",
20
+ emits: ["success"],
21
+ setup(g, { expose: u, emit: c }) {
22
+ const { minor: w } = W, F = X(), k = f(), _ = f(!1), A = c, b = f(!1);
23
+ function D(s) {
24
+ b.value = s, s && (a.value = {
25
+ quantity: 1,
26
+ code: "",
27
+ codeConfig: {
28
+ length: 8,
29
+ charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
30
+ prefix: "",
31
+ suffix: "",
32
+ pattern: "########"
33
+ }
34
+ });
35
+ }
36
+ const a = f({
37
+ quantity: 1,
38
+ code: "",
39
+ codeConfig: {
40
+ length: 8,
41
+ charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
42
+ prefix: "",
43
+ suffix: "",
44
+ pattern: "########"
45
+ }
46
+ }), E = [
47
+ {
48
+ label: "Bulk codes",
49
+ value: "bulk",
50
+ sublabel: "Bulk generate unique codes"
51
+ },
52
+ {
53
+ label: "Custom code",
54
+ value: "single",
55
+ sublabel: "Enter your own custom codes"
56
+ }
57
+ ], U = [
58
+ {
59
+ label: "Alphanumeric",
60
+ value: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
61
+ },
62
+ {
63
+ label: "Alphabetic",
64
+ value: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
65
+ },
66
+ { label: "Alphabetic Lowercase", value: "abcdefghijklmnopqrstuvwxyz" },
67
+ { label: "Alphabetic Uppercase", value: "ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
68
+ { label: "Numbers", value: "0123456789" },
69
+ { label: "Custom", value: "" }
70
+ ], v = f(U[0].value), m = f("bulk"), h = f(!1), M = Q(() => F.params.id);
71
+ async function n(s) {
72
+ var e;
73
+ await ((e = k.value) == null ? void 0 : e.validateInputs()), _.value && await w(
74
+ async () => {
75
+ await q.createCollectionByCampaignId(M.value, s), await A("success");
76
+ },
77
+ {
78
+ message: "Creating claim(s)",
79
+ successMessage: "Claim(s) created"
80
+ }
81
+ );
82
+ }
83
+ u({
84
+ showSheet: D
85
+ }), K(
86
+ () => m.value,
87
+ (s, e) => {
88
+ e != s && (a.value.code = "", a.value.codeConfig.length = 8, a.value.codeConfig.charset = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", a.value.codeConfig.prefix = "", a.value.codeConfig.suffix = "", a.value.codeConfig.pattern = "########");
89
+ }
90
+ );
91
+ function l(s) {
92
+ if (m.value !== "single") return !1;
93
+ const e = s.split(`
94
+ `).map((i) => i.trim()).filter(Boolean);
95
+ return new Set(e).size !== e.length;
96
+ }
97
+ return K(
98
+ () => a.value.codeConfig.length,
99
+ (s, e) => {
100
+ s != e && (a.value.codeConfig.pattern = "#".repeat(Math.min(16, Number(s))));
101
+ }
102
+ ), (s, e) => {
103
+ const i = d("FmRadio"), y = d("FmRadioGroup"), L = d("FmSwitch"), V = d("FmStepperField"), T = d("FmSelect"), B = d("FmTextField"), Z = d("FmTextarea"), ee = d("FmForm"), $ = d("FmButton"), oe = d("FmSideSheet");
104
+ return x(), z(oe, {
105
+ "max-width": 560,
106
+ "dismiss-away": !0,
107
+ header: "Create collection",
108
+ modelValue: o(b),
109
+ "onUpdate:modelValue": [
110
+ e[14] || (e[14] = (t) => j(b) ? b.value = t : null),
111
+ e[15] || (e[15] = (t) => b.value = t)
112
+ ]
113
+ }, {
114
+ "side-sheet-footer": I(() => [
115
+ C("div", Ce, [
116
+ r($, {
117
+ label: "Save",
118
+ onClick: e[12] || (e[12] = (t) => n(o(a))),
119
+ loading: o(ie)().isLoading
120
+ }, null, 8, ["loading"]),
121
+ r($, {
122
+ label: "Cancel",
123
+ type: "button",
124
+ variant: "tertiary",
125
+ onClick: e[13] || (e[13] = (t) => b.value = !1)
126
+ })
127
+ ])
128
+ ]),
129
+ default: I(() => [
130
+ r(re, { json: o(a) }, null, 8, ["json"]),
131
+ r(ee, {
132
+ ref_key: "form",
133
+ ref: k,
134
+ class: "space-y-40",
135
+ onValidationSuccess: e[10] || (e[10] = (t) => _.value = !0),
136
+ onValidationFailed: e[11] || (e[11] = (t) => _.value = !1)
137
+ }, {
138
+ default: I(() => [
139
+ C("div", null, [
140
+ e[16] || (e[16] = C("div", { class: "fm-typo-en-body-lg-600" }, "Code type", -1)),
141
+ r(y, {
142
+ modelValue: o(m),
143
+ "onUpdate:modelValue": e[0] || (e[0] = (t) => j(m) ? m.value = t : null),
144
+ inline: !1
145
+ }, {
146
+ default: I(() => [
147
+ (x(), P(N, null, le(E, (t) => r(i, {
148
+ key: t.value,
149
+ value: t.value,
150
+ label: t.label,
151
+ sublabel: t.sublabel
152
+ }, null, 8, ["value", "label", "sublabel"])), 64))
153
+ ]),
154
+ _: 1
155
+ }, 8, ["modelValue"])
156
+ ]),
157
+ C("div", ge, [
158
+ e[17] || (e[17] = C("div", { class: "fm-typo-en-body-lg-600" }, "Settings", -1)),
159
+ o(m) === "bulk" ? (x(), P(N, { key: 0 }, [
160
+ r(L, {
161
+ "model-value": o(h),
162
+ "label-placement": "right",
163
+ value: "true",
164
+ label: "Advance code setting",
165
+ required: !0,
166
+ "onUpdate:modelValue": e[1] || (e[1] = () => h.value = !o(h))
167
+ }, null, 8, ["model-value"]),
168
+ o(h) ? (x(), P(N, { key: 0 }, [
169
+ r(V, {
170
+ modelValue: o(a).codeConfig.length,
171
+ "onUpdate:modelValue": e[2] || (e[2] = (t) => o(a).codeConfig.length = t),
172
+ label: "Code length",
173
+ max: 16,
174
+ min: 1,
175
+ rules: [
176
+ (t) => Number(t) >= 1 || "Code length must at least 1",
177
+ (t) => Number(t) <= 16 || "Code length must less than 16"
178
+ ],
179
+ required: !0
180
+ }, null, 8, ["modelValue", "rules"]),
181
+ r(T, {
182
+ label: "Charset",
183
+ "model-value": o(v),
184
+ items: U,
185
+ "helper-text": o(a).codeConfig.charset.length > 62 ? `${o(a).codeConfig.charset.substring(0, 62)}...` : o(a).codeConfig.charset,
186
+ "onUpdate:modelValue": e[3] || (e[3] = (t) => {
187
+ v.value = t, o(a).codeConfig.charset = t;
188
+ })
189
+ }, null, 8, ["model-value", "helper-text"]),
190
+ o(v) === "" ? (x(), z(B, {
191
+ key: 0,
192
+ modelValue: o(a).codeConfig.charset,
193
+ "onUpdate:modelValue": e[4] || (e[4] = (t) => o(a).codeConfig.charset = t),
194
+ label: "Custom Charset",
195
+ required: ""
196
+ }, null, 8, ["modelValue"])) : R("", !0),
197
+ C("div", be, [
198
+ r(B, {
199
+ modelValue: o(a).codeConfig.prefix,
200
+ "onUpdate:modelValue": e[5] || (e[5] = (t) => o(a).codeConfig.prefix = t),
201
+ label: "Prefix (Optional)"
202
+ }, null, 8, ["modelValue"]),
203
+ r(B, {
204
+ modelValue: o(a).codeConfig.suffix,
205
+ "onUpdate:modelValue": e[6] || (e[6] = (t) => o(a).codeConfig.suffix = t),
206
+ label: "Suffix (Optional)"
207
+ }, null, 8, ["modelValue"])
208
+ ]),
209
+ r(B, {
210
+ modelValue: o(a).codeConfig.pattern,
211
+ "onUpdate:modelValue": e[7] || (e[7] = (t) => o(a).codeConfig.pattern = t),
212
+ label: "Pattern",
213
+ required: !0
214
+ }, null, 8, ["modelValue"])
215
+ ], 64)) : R("", !0),
216
+ r(B, {
217
+ modelValue: o(a).quantity,
218
+ "onUpdate:modelValue": e[8] || (e[8] = (t) => o(a).quantity = t),
219
+ label: "Number of code",
220
+ rules: [
221
+ (t) => t >= 1 || "Quantity cannot be less than 1",
222
+ (t) => t <= 1e4 || "Quantity cannot more than 10,000"
223
+ ],
224
+ required: !0,
225
+ "helper-text": `${o(a).quantity} claim will be created`
226
+ }, null, 8, ["modelValue", "rules", "helper-text"])
227
+ ], 64)) : R("", !0),
228
+ o(m) !== "bulk" ? (x(), z(Z, {
229
+ key: 1,
230
+ modelValue: o(a).code,
231
+ "onUpdate:modelValue": e[9] || (e[9] = (t) => o(a).code = t),
232
+ label: "Custom Code",
233
+ rules: [
234
+ (t) => o(m) != "single" || !!t || "Custom code is required",
235
+ (t) => !l(t) || "Custom code must be unique"
236
+ ],
237
+ placeholder: "(For multiple codes, please enter in the new row.)"
238
+ }, null, 8, ["modelValue", "rules"])) : R("", !0)
239
+ ])
240
+ ]),
241
+ _: 1
242
+ }, 512)
243
+ ]),
244
+ _: 1
245
+ }, 8, ["modelValue"]);
246
+ };
247
+ }
248
+ });
249
+ class xe {
250
+ constructor() {
251
+ O(this, "data", []);
252
+ }
253
+ addRecord(u) {
254
+ this.data.push(u);
255
+ }
256
+ buildExcel() {
257
+ const u = Y.book_new(), c = Y.json_to_sheet(this.data);
258
+ return Y.book_append_sheet(u, c, "Collection"), u;
259
+ }
260
+ }
261
+ const he = { class: "px-24 flex flex-col gap-y-32 pb-24" }, ye = { class: "flex items-center justify-end py-4 xs:hidden" }, Ee = /* @__PURE__ */ J({
262
+ __name: "Collections",
263
+ setup(g) {
264
+ const u = ue(), c = X(), w = f(), F = Q(() => c.params.id), k = f(!1), { custom: _ } = W, A = [
265
+ {
266
+ header: "ID/Code",
267
+ accessorKey: "_id",
268
+ cell(n) {
269
+ return S("div", { class: "flex items-center" }, [
270
+ S(H.FmIcon, {
271
+ name: "content_copy",
272
+ outline: !0,
273
+ size: "sm",
274
+ class: "cursor-pointer mr-4",
275
+ onClick: (l) => {
276
+ l.preventDefault(), l.stopPropagation(), se(
277
+ n.row.original.code || n.row.original._id.toString()
278
+ );
279
+ }
280
+ }),
281
+ S(
282
+ "div",
283
+ { class: "pr-2 text-ellipsis overflow-hidden" },
284
+ n.row.original.code || n.row.original._id.toString()
285
+ )
286
+ ]);
287
+ }
288
+ },
289
+ {
290
+ header: "User",
291
+ accessorKey: "user",
292
+ enableSorting: !1,
293
+ cell(n) {
294
+ const l = n.row.original.pf_user;
295
+ return S(
296
+ "div",
297
+ {
298
+ class: "flex items-center gap-x-8"
299
+ },
300
+ [
301
+ S(H.FmAvatar, {
302
+ name: l != null && l.photoUrl || l == null ? void 0 : l.name,
303
+ src: (l == null ? void 0 : l.photoUrl) ?? void 0,
304
+ size: "sm"
305
+ }),
306
+ S("span", l == null ? void 0 : l.name)
307
+ ]
308
+ );
309
+ }
310
+ },
311
+ {
312
+ header: "Phone",
313
+ accessorFn: (n) => {
314
+ var l;
315
+ return ((l = n.pf_user) == null ? void 0 : l.phoneNumber) || "-";
316
+ },
317
+ accessorKey: "pf_user.phoneNumber"
318
+ },
319
+ {
320
+ header: "Balance",
321
+ accessorKey: "balance"
322
+ },
323
+ {
324
+ header: "Created at",
325
+ accessorKey: "_id",
326
+ accessorFn: (n) => G(fe(n._id.toString())).format("DD MMM YYYY")
327
+ },
328
+ {
329
+ header: "Nearest expired at",
330
+ accessorKey: "expiryBalance",
331
+ accessorFn: (n) => {
332
+ var l;
333
+ return n.expiryBalance && n.expiryBalance.length ? G((l = n.expiryBalance) == null ? void 0 : l[0].expiredAt).format("DD MMM YYYY") : "Never expires";
334
+ }
335
+ }
336
+ ], b = {
337
+ "$connect-STORE_REWARD_COLLECTIONS": pe.readCollectionsByRewardId,
338
+ "$connect-CAMPAIGN_VOUCHER_COLLECTIONS": q.readCollectionsByCampaignId
339
+ }, D = (n) => {
340
+ const l = b[c.name];
341
+ return (s) => l(n, s);
342
+ }, { tableMeta: a, rowData: E, onSort: U, debouncedFetchData: v, onSearch: m } = ce(D(F.value));
343
+ async function h() {
344
+ var n;
345
+ await v(), (n = w.value) == null || n.showSheet(!1);
346
+ }
347
+ async function M() {
348
+ k.value || _(
349
+ async () => {
350
+ var e;
351
+ const n = new xe(), l = (await q.readCollectionsByCampaignId(F.value, {
352
+ limit: 1,
353
+ skip: 0,
354
+ sortBy: p.sortBy,
355
+ descending: p.descending
356
+ })).meta.totalResources ?? 0, s = p.rowsPerPage;
357
+ for (let i = 0; i < l; i += s) {
358
+ const y = {
359
+ ...p,
360
+ limit: s,
361
+ skip: (p.page - 1) * p.rowsPerPage,
362
+ sortBy: p.sortBy,
363
+ descending: p.descending
364
+ }, L = await q.readCollectionsByCampaignId(
365
+ F.value,
366
+ y
367
+ );
368
+ for await (const V of L.resources) {
369
+ const T = {
370
+ Id: (V == null ? void 0 : V.code) || ((e = V._id) == null ? void 0 : e.toString()) || ""
371
+ };
372
+ n.addRecord(T);
373
+ }
374
+ p.page++;
375
+ }
376
+ await de(
377
+ n.buildExcel(),
378
+ `members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
379
+ {
380
+ bookType: "xlsx",
381
+ bookSST: !1,
382
+ type: "array"
383
+ }
384
+ ), p.page = 1;
385
+ },
386
+ {
387
+ isLoading: k
388
+ }
389
+ );
390
+ }
391
+ return ne(async () => {
392
+ await v();
393
+ }), (n, l) => {
394
+ const s = d("FmPageHead"), e = d("FmSearch");
395
+ return x(), P(N, null, [
396
+ r(s, {
397
+ title: "Collections",
398
+ "back-button": !0,
399
+ actions: [
400
+ { label: "Export", value: "export", isPrimary: !1 },
401
+ {
402
+ label: "Create collection",
403
+ value: "create",
404
+ isPrimary: !0
405
+ }
406
+ ],
407
+ "onClick:back": l[0] || (l[0] = (i) => o(u).back()),
408
+ "onClick:action": l[1] || (l[1] = (i) => {
409
+ var y;
410
+ i === "create" && ((y = o(w)) == null || y.showSheet(!0)), i === "export" && M();
411
+ })
412
+ }),
413
+ C("div", he, [
414
+ r(e, {
415
+ class: "hidden xs:flex border-b border-fm-color-neutral-gray-100",
416
+ modelValue: o(a).searchValue,
417
+ "onUpdate:modelValue": [
418
+ l[2] || (l[2] = (i) => o(a).searchValue = i),
419
+ o(m)
420
+ ],
421
+ placeholder: "Search",
422
+ collapsible: ""
423
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]),
424
+ C("div", ye, [
425
+ r(e, {
426
+ modelValue: o(a).searchValue,
427
+ "onUpdate:modelValue": [
428
+ l[3] || (l[3] = (i) => o(a).searchValue = i),
429
+ o(m)
430
+ ],
431
+ placeholder: "Search",
432
+ collapsible: ""
433
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])
434
+ ]),
435
+ r(me, {
436
+ loading: o(a).isLoading,
437
+ "row-data": o(E),
438
+ "column-defs": A,
439
+ "row-count": o(a).totalRows,
440
+ "page-count": o(a).pageCount,
441
+ "page-index": o(a).pageIndex,
442
+ "page-size": o(a).pageSize,
443
+ "shrink-at": !1,
444
+ onSortChange: o(U),
445
+ onPageChange: l[4] || (l[4] = (i) => o(v)({ pageSize: i.pageSize, pageIndex: i.pageIndex }))
446
+ }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"]),
447
+ r(ve, {
448
+ ref_key: "sheetRef",
449
+ ref: w,
450
+ onSuccess: h
451
+ }, null, 512)
452
+ ])
453
+ ], 64);
454
+ };
455
+ }
456
+ });
457
+ export {
458
+ Ee as default
459
+ };
@@ -1,27 +1,27 @@
1
- import { defineComponent as N, ref as S, computed as j, h as M, onMounted as A, resolveComponent as l, openBlock as c, createElementBlock as y, Fragment as h, createVNode as i, unref as a, createElementVNode as n, withCtx as C, renderList as H, createBlock as v, resolveDynamicComponent as q, toDisplayString as g, createCommentVNode as z } from "vue";
1
+ import { defineComponent as N, ref as S, computed as j, h as M, onMounted as A, resolveComponent as l, openBlock as c, createElementBlock as y, Fragment as C, createVNode as i, unref as a, createElementVNode as n, withCtx as h, renderList as H, createBlock as v, resolveDynamicComponent as q, toDisplayString as g, createCommentVNode as z } from "vue";
2
2
  import { _ as G } from "./campaign-CpzFl8Vr.js";
3
3
  import { useDialog as J, components as O } from "@feedmepos/ui-library";
4
- import { p as Q } from "./plugins-BHMrdAR2.js";
5
- import { u as W } from "./loading--fQbVp4h.js";
6
- import { u as X } from "./business-CaL8dhbB.js";
7
- import { u as Y } from "./campaign-D1IDv9pf.js";
8
- import { g as V, a as L } from "./campaign-BEPgE5CH.js";
9
- import { u as Z } from "./vue-i18n-D3N-L0QD.js";
10
- import { _ as ee } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
11
- import { _ as oe } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BlTxHhHW.js";
12
- import { u as te } from "./template-DQJGwq08.js";
13
- import { c as _ } from "./index-syqkAq4m.js";
14
- const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-center justify-between w-full" }, re = { class: "flex gap-8 overflow-x-auto" }, se = { class: "space-y-8" }, ie = { class: "flex w-full gap-4 items-center" }, le = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ce = { class: "space-y-4" }, me = { class: "fm-typo-en-body-lg-600" }, de = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ue = { key: 0 }, Le = /* @__PURE__ */ N({
4
+ import { p as Q } from "./plugins-Du32AI_-.js";
5
+ import { u as W } from "./loading-LKg7ETnZ.js";
6
+ import { u as X } from "./business-BMaADexo.js";
7
+ import { u as Y } from "./campaign-Cy1er8EV.js";
8
+ import { g as Z, a as V, b as L } from "./campaign-C8fB-bPD.js";
9
+ import { u as ee } from "./vue-i18n-bLo1ykBN.js";
10
+ import { _ as oe } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
11
+ import { _ as te } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bg5H5bLD.js";
12
+ import { u as ae } from "./template-DcEa3i5E.js";
13
+ import { c as _ } from "./index-CTnXuOHy.js";
14
+ const ne = { class: "px-24 flex flex-col gap-y-16" }, re = { class: "flex items-center justify-between w-full" }, se = { class: "flex gap-8 overflow-x-auto" }, ie = { class: "space-y-8" }, le = { class: "flex w-full gap-4 items-center" }, ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, me = { class: "space-y-4" }, de = { class: "fm-typo-en-body-lg-600" }, pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { key: 0 }, Ie = /* @__PURE__ */ N({
15
15
  __name: "Credit",
16
- setup(fe) {
17
- const { t: r } = Z(), I = {
16
+ setup(ye) {
17
+ const { t: r } = ee(), I = {
18
18
  label: r("connect.program.common.actions.create", {
19
19
  type: r("connect.program.credit.title").toLowerCase()
20
20
  }),
21
21
  value: "create",
22
22
  isPrimary: !0,
23
23
  prependIcon: "add"
24
- }, R = te("CREDIT", J()), B = X(), m = Y(), { global: D, minor: w } = W, s = S({
24
+ }, R = ae("CREDIT", J()), B = X(), m = Y(), { global: D, minor: w } = W, s = S({
25
25
  searchKey: "",
26
26
  location: null
27
27
  }), d = j(
@@ -35,6 +35,7 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-
35
35
  },
36
36
  {
37
37
  header: r("connect.program.common.table.status"),
38
+ accessorFn: (e) => Z(e),
38
39
  cell(e) {
39
40
  return V(e.row.original);
40
41
  }
@@ -51,13 +52,13 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-
51
52
  icon: "delete",
52
53
  iconColor: "neutral-gray-400",
53
54
  onClick: (o) => {
54
- o.stopPropagation(), b(e.row.original);
55
+ o.stopPropagation(), x(e.row.original);
55
56
  }
56
57
  });
57
58
  }
58
59
  }
59
- ], x = S();
60
- async function b(e) {
60
+ ], b = S();
61
+ async function x(e) {
61
62
  await Q.remove(
62
63
  r("connect.program.common.remove.confirm", { name: e.name })
63
64
  ) && await w(
@@ -78,7 +79,7 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-
78
79
  });
79
80
  async function o(p) {
80
81
  var u;
81
- (u = x.value) == null || u.showSheet(
82
+ (u = b.value) == null || u.showSheet(
82
83
  !0,
83
84
  "CREDIT",
84
85
  e ? await _.readById(e._id) : void 0,
@@ -103,13 +104,13 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-
103
104
  });
104
105
  }), (e, o) => {
105
106
  const p = l("FmPageHead"), u = l("FmSearch"), K = l("FmTable"), F = l("FmButton"), $ = l("FmListItem"), P = l("FmList"), U = l("FmCard");
106
- return c(), y(h, null, [
107
+ return c(), y(C, null, [
107
108
  i(p, {
108
109
  title: a(r)("connect.program.credit.title"),
109
110
  actions: a(d).length > 0 ? [I] : [],
110
111
  "onClick:action": o[0] || (o[0] = () => f())
111
112
  }, null, 8, ["title", "actions"]),
112
- n("div", ae, [
113
+ n("div", ne, [
113
114
  i(u, {
114
115
  modelValue: a(s).searchKey,
115
116
  "onUpdate:modelValue": o[1] || (o[1] = (t) => a(s).searchKey = t),
@@ -117,10 +118,10 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-
117
118
  placeholder: "search",
118
119
  collapsible: ""
119
120
  }, null, 8, ["modelValue"]),
120
- a(m).campaigns.credit && a(m).campaigns.credit.length > 0 ? (c(), y(h, { key: 0 }, [
121
- n("div", ne, [
122
- n("div", re, [
123
- i(ee, {
121
+ a(m).campaigns.credit && a(m).campaigns.credit.length > 0 ? (c(), y(C, { key: 0 }, [
122
+ n("div", re, [
123
+ n("div", se, [
124
+ i(oe, {
124
125
  modelValue: a(s).location,
125
126
  "onUpdate:modelValue": o[2] || (o[2] = (t) => a(s).location = t),
126
127
  label: "Location: ",
@@ -148,31 +149,31 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-
148
149
  "hide-footer": a(d).length < 10
149
150
  }, null, 8, ["row-data", "search-value", "hide-footer"]),
150
151
  i(P, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
151
- default: C(() => [
152
- (c(!0), y(h, null, H(a(d).filter(
152
+ default: h(() => [
153
+ (c(!0), y(C, null, H(a(d).filter(
153
154
  (t) => t.name.toLowerCase().includes(a(s).searchKey.toLowerCase())
154
155
  ), (t) => (c(), v($, {
155
156
  key: t._id.toString(),
156
157
  onClick: (k) => f(t),
157
158
  class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
158
159
  }, {
159
- default: C(() => [
160
- n("div", se, [
161
- n("div", ie, [
160
+ default: h(() => [
161
+ n("div", ie, [
162
+ n("div", le, [
162
163
  (c(), v(q(a(V)(t)))),
163
- n("div", le, g(t.currentReceive ?? 0) + " used ", 1)
164
+ n("div", ce, g(t.currentReceive ?? 0) + " used ", 1)
164
165
  ]),
165
- n("div", ce, [
166
- n("div", me, g(t.name), 1),
167
- n("div", de, g(a(L)(t)), 1)
166
+ n("div", me, [
167
+ n("div", de, g(t.name), 1),
168
+ n("div", pe, g(a(L)(t)), 1)
168
169
  ]),
169
- n("div", pe, " Credit received: " + g(t.currentReceive ?? 0), 1)
170
+ n("div", ue, " Credit received: " + g(t.currentReceive ?? 0), 1)
170
171
  ]),
171
172
  i(F, {
172
173
  icon: "delete",
173
174
  "icon-color": "neutral-gray-400",
174
175
  variant: "tertiary",
175
- onClick: (k) => (k.stopPropagation(), b(t))
176
+ onClick: (k) => (k.stopPropagation(), x(t))
176
177
  }, null, 8, ["onClick"])
177
178
  ]),
178
179
  _: 2
@@ -180,7 +181,7 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-
180
181
  ]),
181
182
  _: 1
182
183
  }),
183
- a(d).length == 0 ? (c(), y("div", ue, o[6] || (o[6] = [
184
+ a(d).length == 0 ? (c(), y("div", fe, o[6] || (o[6] = [
184
185
  n("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, " No results found ", -1)
185
186
  ]))) : z("", !0)
186
187
  ], 64)) : (c(), v(U, {
@@ -188,7 +189,7 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-
188
189
  variant: "outlined",
189
190
  class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
190
191
  }, {
191
- default: C(() => [
192
+ default: h(() => [
192
193
  o[7] || (o[7] = n("img", {
193
194
  src: G,
194
195
  class: "aspect-square w-[150px]"
@@ -206,9 +207,9 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-
206
207
  ]),
207
208
  _: 1
208
209
  })),
209
- i(oe, {
210
+ i(te, {
210
211
  ref_key: "sheetRef",
211
- ref: x,
212
+ ref: b,
212
213
  "onSubmit:modelValue": E
213
214
  }, null, 512)
214
215
  ])
@@ -217,5 +218,5 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-
217
218
  }
218
219
  });
219
220
  export {
220
- Le as default
221
+ Ie as default
221
222
  };