@feedmepos/mf-connect 0.1.69-prod → 0.1.70-prod

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/dist/{Analytic-dZcUmlqk.js → Analytic-PyqBxIYV.js} +10 -10
  2. package/dist/{App-CP-hV-3p.js → App-Jvndjs57.js} +7 -7
  3. package/dist/{Bin-1phi-aIR.js → Bin-COT0Y0Ho.js} +8 -8
  4. package/dist/{Broadcast-C7p-UzFt.js → Broadcast-BEXF2mv2.js} +8 -8
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CYrrUiGF.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D_2YsnqM.js} +6 -6
  6. package/dist/{Card-DQ9CN4Uf.js → Card-B_PJslck.js} +16 -16
  7. package/dist/Collections-BNXcAI8E.js +519 -0
  8. package/dist/{Credit-CgnQ4PPH.js → Credit-CbefgVBA.js} +8 -8
  9. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DiC-2EB0.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BWrvk8cN.js} +30 -30
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CU_KJo82.js → EffectSheet.vue_vue_type_style_index_0_lang-BVdF1Urm.js} +6 -6
  11. package/dist/{Experience-xF0tg8Dk.js → Experience-D4PlCeQu.js} +8 -8
  12. package/dist/{Game-D14ky1ba.js → Game-ByPV3v3c.js} +9 -9
  13. package/dist/{Index-yW7PkhSk.js → Index-CTE6GcPE.js} +10 -10
  14. package/dist/{Marketing-DRvXqtU2.js → Marketing-CBarYi4e.js} +6 -6
  15. package/dist/{Member-_bof3r3n.js → Member-aiHpHoBw.js} +10 -10
  16. package/dist/{MemberList-CCZ6hWys.js → MemberList-ZfDDJKU8.js} +25 -25
  17. package/dist/{MemberTransactions-C9aq8zvp.js → MemberTransactions-YPSNz6QZ.js} +1 -1
  18. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BJRqGOw0.js → MessageInput.vue_vue_type_script_setup_true_lang-DyJKk8W7.js} +7 -7
  19. package/dist/{Mission-DK_197cn.js → Mission-CX9m_lVc.js} +9 -9
  20. package/dist/{Overview-CLhIgSIt.js → Overview-93wWO0vg.js} +18 -18
  21. package/dist/{Point-CeYwv2Ml.js → Point-CvBoOpox.js} +8 -8
  22. package/dist/{Promotion-43LkVSrQ.js → Promotion-DzABoX1Q.js} +9 -9
  23. package/dist/{Queue-D2xUJNk1.js → Queue-CLsAkssT.js} +10 -10
  24. package/dist/{Record-BcgZ6xmc.js → Record-D7H9PUO9.js} +8 -8
  25. package/dist/{Reward-1faB12zI.js → Reward-RuXRWNEz.js} +15 -15
  26. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BBaKKcMb.js → RewardGroup.vue_vue_type_script_setup_true_lang-BhooU8k4.js} +11 -11
  27. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Ds6fytIn.js → RuleGroup.vue_vue_type_script_setup_true_lang-CX4uEjpm.js} +13 -13
  28. package/dist/{Segment-PKmCcBlB.js → Segment-DttKqwI6.js} +22 -22
  29. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DB2XV6yA.js → SelectItems.vue_vue_type_script_setup_true_lang-Bc52DzKg.js} +2 -2
  30. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CJJO40qe.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-Cs31sJoR.js} +11 -11
  31. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-NvxO21UU.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-DVDJSZ2m.js} +3 -3
  32. package/dist/{Setting-Hg7j7SOU.js → Setting-B-OauIYc.js} +12 -12
  33. package/dist/{SettingAdvertisements-BhJEUn0s.js → SettingAdvertisements-DgeX4O4l.js} +11 -11
  34. package/dist/{Store-CWsS9CDU.js → Store-DXolnTox.js} +19 -19
  35. package/dist/{StoreRewards-B6nlpJKT.js → StoreRewards-AZL1ZRuo.js} +13 -13
  36. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DHDAyKox.js → StoreTransactions.vue_vue_type_script_setup_true_lang-EdoXx3OE.js} +19 -19
  37. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CLTAGBUD.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-mHmnkhIP.js} +1 -1
  38. package/dist/{Tier-D22gBdSC.js → Tier-C95me-Y-.js} +19 -19
  39. package/dist/{Title-C_fVZE1b.js → Title-Cl3aYevK.js} +18 -18
  40. package/dist/{Transaction-DHcGCN6Y.js → Transaction-DQXVmId0.js} +2 -2
  41. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-Ci6hlCO5.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-D8Kfo_M8.js} +6 -6
  42. package/dist/{Voucher-CnYVMafC.js → Voucher-C-P0YBPO.js} +12 -12
  43. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DeYs5HnB.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DRn1HmAb.js} +10 -10
  44. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-YzHyStOB.js → ZodTextField.vue_vue_type_script_setup_true_lang-DXArW7Vz.js} +1 -1
  45. package/dist/{app-CR-6G5ya.js → app-7__6-fNI.js} +1 -1
  46. package/dist/{app-BZaMoaZh.js → app-B6euOjfV.js} +2163 -1107
  47. package/dist/app.js +1 -1
  48. package/dist/{business-QVlWr5Oa.js → business-qci70l-A.js} +1 -1
  49. package/dist/{campaign-DnLFH51S.js → campaign-D_eIup7X.js} +9 -9
  50. package/dist/{campaign-BbrGpGak.js → campaign-FPNFOCIx.js} +1 -1
  51. package/dist/{campaign.enum-kQr7qhKY.js → campaign.enum-BshKRCYQ.js} +1 -1
  52. package/dist/{campaign.fn-x0bapd1e.js → campaign.fn-B5brKxfK.js} +34 -34
  53. package/dist/{collectible.enum-Dx7lCHBV.js → collectible.enum-BYIdgjMd.js} +1 -1
  54. package/dist/{collection.fn-O_MJ2WID.js → collection.fn-Czegj-3i.js} +2 -2
  55. package/dist/{dto-wS34PjkI.js → dto-CoTw6KOu.js} +4 -4
  56. package/dist/{effect-CGbyGrZY.js → effect-AUk5fAKr.js} +1 -1
  57. package/dist/{email-addresses-9MIJJcVx.js → email-addresses-CzoIsTNA.js} +1 -1
  58. package/dist/{export-CV8urg2H.js → export-a4tq7KAV.js} +3 -3
  59. package/dist/{helper-Bd6_Q-xw.js → helper-BPAmOP7l.js} +1 -1
  60. package/dist/{index-CfkuglOp.js → index-BicoBDJX.js} +4 -4
  61. package/dist/{index-JGt4QJ6J.js → index-BioBPRnA.js} +1023 -1023
  62. package/dist/{index-BN3ltUdq.js → index-BqKYZ98Q.js} +1 -1
  63. package/dist/{index-ryobEOJ3.js → index-CGryjlaX.js} +1 -1
  64. package/dist/{index-BvMd-cvR.js → index-CKd9UEIG.js} +6 -6
  65. package/dist/{index-DNbekOJ6.js → index-CPHYlicy.js} +3 -3
  66. package/dist/{index-C73eoANg.js → index-CQ4_BfJL.js} +1 -1
  67. package/dist/{index-BY3_F6NN.js → index-DD6t-ukB.js} +1 -1
  68. package/dist/{index-Cm3jpKMn.js → index-DFrGNKGq.js} +1 -1
  69. package/dist/{index-DQqE8AZF.js → index-DROE-IrQ.js} +3 -3
  70. package/dist/{index-Dd8nkF3o.js → index-DdTu5PZ4.js} +1 -1
  71. package/dist/{index-CMi3Van0.js → index-DyNcdfkp.js} +1 -1
  72. package/dist/{index-DJWXPfjc.js → index-ZC8SINKX.js} +2 -2
  73. package/dist/{index.esm2017-Dj2vWUjQ.js → index.esm2017-DBUyLYkl.js} +1 -1
  74. package/dist/{loading-ByVqAO0s.js → loading-E0yVUdfI.js} +1 -1
  75. package/dist/{membership-bIenV-r5.js → membership-yP4z8gbJ.js} +3 -3
  76. package/dist/{money-BCjG9V51.js → money-DhnXYNa2.js} +1 -1
  77. package/dist/{number-B-BpPwty.js → number-XYUCGxPv.js} +1 -1
  78. package/dist/{objectid-BybR4EVj.js → objectid-BfQ_M2eI.js} +5 -5
  79. package/dist/{plugins-CTxDzq0e.js → plugins-bpWCIR9y.js} +2 -2
  80. package/dist/{reward-Ccb2zKD2.js → reward-B3J0dhNd.js} +1 -1
  81. package/dist/{rule-DZ2TuXLh.js → rule-BzqUqJYa.js} +3 -3
  82. package/dist/{rule-builder-ByvbSBP0.js → rule-builder-BvtsmkMr.js} +1 -1
  83. package/dist/{template-D1AMCdZB.js → template-BFr8iIV_.js} +4 -4
  84. package/dist/{timezone-eFG5cjuE.js → timezone-BCyUSe2a.js} +1 -1
  85. package/dist/{trigger-Bta6ze07.js → trigger-DCSJm_qA.js} +4 -4
  86. package/dist/{user-rDB9kCal.js → user-BwjCcgQT.js} +1 -1
  87. package/dist/{vue-i18n-BMCWCmoc.js → vue-i18n-BLkfzQts.js} +201 -201
  88. package/dist/{xlsx-DbxMUoZt.js → xlsx-D2Uw1Ytp.js} +1 -1
  89. package/package.json +1 -1
  90. package/dist/Collections-BN647eS7.js +0 -518
@@ -0,0 +1,519 @@
1
+ var re = Object.defineProperty;
2
+ var se = (C, u, g) => u in C ? re(C, u, { enumerable: !0, configurable: !0, writable: !0, value: g }) : C[u] = g;
3
+ var Q = (C, u, g) => se(C, typeof u != "symbol" ? u + "" : u, g);
4
+ import { defineComponent as te, ref as h, computed as P, watch as H, resolveComponent as m, openBlock as S, createBlock as G, unref as t, isRef as X, withCtx as N, createElementVNode as x, createVNode as i, createElementBlock as M, Fragment as T, renderList as ie, createCommentVNode as E, h as _, onMounted as ue } from "vue";
5
+ import { h as J } from "./moment-D7p2TMB-.js";
6
+ import { components as Z } from "@feedmepos/ui-library";
7
+ import "./index-BioBPRnA.js";
8
+ import { J as ce } from "./JsonViewer-v8_C7l5N.js";
9
+ import { u as oe } from "./loading-E0yVUdfI.js";
10
+ import { u as de } from "./app-wDQR6dpb.js";
11
+ import { useRoute as ae, useRouter as me } from "vue-router";
12
+ import { c as le, u as pe } from "./campaign-FPNFOCIx.js";
13
+ import { e as B } from "./index-vh86FiIQ.js";
14
+ import { u as W, w as fe } from "./xlsx-D2Uw1Ytp.js";
15
+ import { g as ge } from "./user-BwjCcgQT.js";
16
+ import { u as be, _ as he } from "./usePagination-Ds-cuHop.js";
17
+ import { a as ee } from "./plugins-bpWCIR9y.js";
18
+ import { m as Ce } from "./index-CQ4_BfJL.js";
19
+ import { o as ve } from "./objectId-dwaoBfJX.js";
20
+ const ye = { class: "space-y-16" }, xe = { class: "gap-16 grid grid-cols-2" }, Se = { class: "flex items-center gap-8" }, Ve = /* @__PURE__ */ te({
21
+ __name: "CreateCollectionSheet",
22
+ emits: ["success"],
23
+ setup(C, { expose: u, emit: g }) {
24
+ const { minor: R } = oe, I = ae(), V = h(), w = h(!1), L = g, v = h(!1);
25
+ function A(r) {
26
+ v.value = r, r && (n.value = {
27
+ quantity: 1,
28
+ code: "",
29
+ codeConfig: {
30
+ length: 8,
31
+ charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
32
+ prefix: "",
33
+ suffix: "",
34
+ pattern: "########"
35
+ }
36
+ });
37
+ }
38
+ const n = h({
39
+ quantity: 1,
40
+ code: "",
41
+ codeConfig: {
42
+ length: 8,
43
+ charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
44
+ prefix: "",
45
+ suffix: "",
46
+ pattern: "########"
47
+ }
48
+ }), $ = [
49
+ {
50
+ label: "Bulk codes",
51
+ value: "bulk",
52
+ sublabel: "Bulk generate unique codes"
53
+ },
54
+ {
55
+ label: "Custom code",
56
+ value: "single",
57
+ sublabel: "Enter your own custom codes"
58
+ }
59
+ ], q = [
60
+ {
61
+ label: "Alphanumeric",
62
+ value: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
63
+ },
64
+ {
65
+ label: "Alphabetic",
66
+ value: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
67
+ },
68
+ { label: "Alphabetic Lowercase", value: "abcdefghijklmnopqrstuvwxyz" },
69
+ { label: "Alphabetic Uppercase", value: "ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
70
+ { label: "Numbers", value: "0123456789" },
71
+ { label: "Custom", value: "" }
72
+ ], F = h(q[0].value), p = h("bulk"), k = h(!1), z = P(() => I.params.id);
73
+ async function D(r) {
74
+ var e;
75
+ await ((e = V.value) == null ? void 0 : e.validateInputs()), w.value && await R(
76
+ async () => {
77
+ await le.createCollectionByCampaignId(z.value, r), await L("success");
78
+ },
79
+ {
80
+ message: "Creating claim(s)",
81
+ successMessage: "Claim(s) created"
82
+ }
83
+ );
84
+ }
85
+ u({
86
+ showSheet: A
87
+ }), H(
88
+ () => p.value,
89
+ (r, e) => {
90
+ e != r && (n.value.code = "", n.value.codeConfig.length = 8, n.value.codeConfig.charset = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", n.value.codeConfig.prefix = "", n.value.codeConfig.suffix = "", n.value.codeConfig.pattern = "########");
91
+ }
92
+ );
93
+ function f(r) {
94
+ if (p.value !== "single") return !1;
95
+ const e = r.split(`
96
+ `).map((U) => U.trim()).filter(Boolean);
97
+ return new Set(e).size !== e.length;
98
+ }
99
+ function K(r) {
100
+ return /[ \t]/.test(r);
101
+ }
102
+ return H(
103
+ () => n.value.codeConfig.length,
104
+ (r, e) => {
105
+ r != e && (n.value.codeConfig.pattern = "#".repeat(Math.min(16, Number(r))));
106
+ }
107
+ ), H(
108
+ () => n.value.codeConfig.pattern,
109
+ (r, e) => {
110
+ r != e && (n.value.codeConfig.length = (n.value.codeConfig.pattern.match(/#/g) || []).length);
111
+ }
112
+ ), (r, e) => {
113
+ const U = m("FmRadio"), Y = m("FmRadioGroup"), j = m("FmSwitch"), l = m("FmStepperField"), a = m("FmSelect"), c = m("FmTextField"), d = m("FmTextarea"), s = m("FmForm"), b = m("FmButton"), O = m("FmSideSheet");
114
+ return S(), G(O, {
115
+ "max-width": 560,
116
+ "dismiss-away": !0,
117
+ header: "Create collection",
118
+ modelValue: t(v),
119
+ "onUpdate:modelValue": [
120
+ e[14] || (e[14] = (o) => X(v) ? v.value = o : null),
121
+ e[15] || (e[15] = (o) => v.value = o)
122
+ ]
123
+ }, {
124
+ "side-sheet-footer": N(() => [
125
+ x("div", Se, [
126
+ i(b, {
127
+ label: "Save",
128
+ onClick: e[12] || (e[12] = (o) => D(t(n))),
129
+ loading: t(de)().isLoading
130
+ }, null, 8, ["loading"]),
131
+ i(b, {
132
+ label: "Cancel",
133
+ type: "button",
134
+ variant: "tertiary",
135
+ onClick: e[13] || (e[13] = (o) => v.value = !1)
136
+ })
137
+ ])
138
+ ]),
139
+ default: N(() => [
140
+ i(ce, { json: t(n) }, null, 8, ["json"]),
141
+ i(s, {
142
+ ref_key: "form",
143
+ ref: V,
144
+ class: "space-y-40",
145
+ onValidationSuccess: e[10] || (e[10] = (o) => w.value = !0),
146
+ onValidationFailed: e[11] || (e[11] = (o) => w.value = !1)
147
+ }, {
148
+ default: N(() => [
149
+ x("div", null, [
150
+ e[16] || (e[16] = x("div", { class: "fm-typo-en-body-lg-600" }, "Code type", -1)),
151
+ i(Y, {
152
+ modelValue: t(p),
153
+ "onUpdate:modelValue": e[0] || (e[0] = (o) => X(p) ? p.value = o : null),
154
+ inline: !1
155
+ }, {
156
+ default: N(() => [
157
+ (S(), M(T, null, ie($, (o) => i(U, {
158
+ key: o.value,
159
+ value: o.value,
160
+ label: o.label,
161
+ sublabel: o.sublabel
162
+ }, null, 8, ["value", "label", "sublabel"])), 64))
163
+ ]),
164
+ _: 1
165
+ }, 8, ["modelValue"])
166
+ ]),
167
+ x("div", ye, [
168
+ e[17] || (e[17] = x("div", { class: "fm-typo-en-body-lg-600" }, "Settings", -1)),
169
+ t(p) === "bulk" ? (S(), M(T, { key: 0 }, [
170
+ i(j, {
171
+ "model-value": t(k),
172
+ "label-placement": "right",
173
+ value: "true",
174
+ label: "Advance code setting",
175
+ required: !0,
176
+ "onUpdate:modelValue": e[1] || (e[1] = () => k.value = !t(k))
177
+ }, null, 8, ["model-value"]),
178
+ t(k) ? (S(), M(T, { key: 0 }, [
179
+ i(l, {
180
+ modelValue: t(n).codeConfig.length,
181
+ "onUpdate:modelValue": e[2] || (e[2] = (o) => t(n).codeConfig.length = o),
182
+ label: "Code length",
183
+ max: 16,
184
+ min: 1,
185
+ rules: [
186
+ (o) => Number(o) >= 1 || "Code length must at least 1",
187
+ (o) => Number(o) <= 16 || "Code length must less than 16"
188
+ ],
189
+ required: !0
190
+ }, null, 8, ["modelValue", "rules"]),
191
+ i(a, {
192
+ label: "Charset",
193
+ "model-value": t(F),
194
+ items: q,
195
+ "helper-text": t(n).codeConfig.charset.length > 62 ? `${t(n).codeConfig.charset.substring(0, 62)}...` : t(n).codeConfig.charset,
196
+ "onUpdate:modelValue": e[3] || (e[3] = (o) => {
197
+ F.value = o, t(n).codeConfig.charset = o;
198
+ })
199
+ }, null, 8, ["model-value", "helper-text"]),
200
+ t(F) === "" ? (S(), G(c, {
201
+ key: 0,
202
+ modelValue: t(n).codeConfig.charset,
203
+ "onUpdate:modelValue": e[4] || (e[4] = (o) => t(n).codeConfig.charset = o),
204
+ label: "Custom Charset",
205
+ required: ""
206
+ }, null, 8, ["modelValue"])) : E("", !0),
207
+ x("div", xe, [
208
+ i(c, {
209
+ modelValue: t(n).codeConfig.prefix,
210
+ "onUpdate:modelValue": e[5] || (e[5] = (o) => t(n).codeConfig.prefix = o),
211
+ label: "Prefix (Optional)"
212
+ }, null, 8, ["modelValue"]),
213
+ i(c, {
214
+ modelValue: t(n).codeConfig.suffix,
215
+ "onUpdate:modelValue": e[6] || (e[6] = (o) => t(n).codeConfig.suffix = o),
216
+ label: "Suffix (Optional)"
217
+ }, null, 8, ["modelValue"])
218
+ ]),
219
+ i(c, {
220
+ modelValue: t(n).codeConfig.pattern,
221
+ "onUpdate:modelValue": e[7] || (e[7] = (o) => t(n).codeConfig.pattern = o),
222
+ label: "Pattern",
223
+ required: !0
224
+ }, null, 8, ["modelValue"])
225
+ ], 64)) : E("", !0),
226
+ i(c, {
227
+ modelValue: t(n).quantity,
228
+ "onUpdate:modelValue": e[8] || (e[8] = (o) => t(n).quantity = o),
229
+ label: "Number of code",
230
+ rules: [
231
+ (o) => o >= 1 || "Quantity cannot be less than 1",
232
+ (o) => o <= 1e4 || "Quantity cannot more than 10,000"
233
+ ],
234
+ required: !0,
235
+ "helper-text": `${t(n).quantity} claim will be created`
236
+ }, null, 8, ["modelValue", "rules", "helper-text"])
237
+ ], 64)) : E("", !0),
238
+ t(p) !== "bulk" ? (S(), G(d, {
239
+ key: 1,
240
+ modelValue: t(n).code,
241
+ "onUpdate:modelValue": e[9] || (e[9] = (o) => t(n).code = o),
242
+ label: "Custom Code",
243
+ rules: [
244
+ (o) => t(p) != "single" || !!o || "Custom code is required",
245
+ (o) => !f(o) || "Custom code must be unique",
246
+ (o) => !K(o) || "Custom code must not contain space"
247
+ ],
248
+ placeholder: "(For multiple codes, please enter in the new row.)"
249
+ }, null, 8, ["modelValue", "rules"])) : E("", !0)
250
+ ])
251
+ ]),
252
+ _: 1
253
+ }, 512)
254
+ ]),
255
+ _: 1
256
+ }, 8, ["modelValue"]);
257
+ };
258
+ }
259
+ });
260
+ class we {
261
+ constructor() {
262
+ Q(this, "data", []);
263
+ }
264
+ addRecord(u) {
265
+ this.data.push(u);
266
+ }
267
+ buildExcel() {
268
+ const u = W.book_new(), g = W.json_to_sheet(this.data);
269
+ return W.book_append_sheet(u, g, "Collection"), u;
270
+ }
271
+ }
272
+ var Fe = { authUrl: "https://portal-v2.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedme.cc", crmUrl: "crm.feedme.cc", paymentPortalUrl: "https://portal.feedme.cc/payment/payout-account", licensePortalUrl: "https://license.feedme.cc/", marketingV1Portal: "https://marketing-v1.feedme.cc", voucherAppUrl: "https://voucher.feedme.cc/" };
273
+ const ke = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Ue = { class: "flex items-center justify-end py-4 xs:hidden" }, je = /* @__PURE__ */ te({
274
+ __name: "Collections",
275
+ setup(C) {
276
+ function u(l) {
277
+ return l.hideInApp === !1;
278
+ }
279
+ const g = me(), R = ae(), I = h(), V = P(() => R.params.id), w = h(!1), { custom: L } = oe;
280
+ function v(l) {
281
+ var a;
282
+ return (a = l._id) == null ? void 0 : a.toString();
283
+ }
284
+ function A(l) {
285
+ var d;
286
+ const a = (d = Fe.voucherAppUrl) == null ? void 0 : d.replace(/\/$/, ""), c = v(l);
287
+ return !a || !c ? "" : `${a}/c/${c}`;
288
+ }
289
+ function n(l) {
290
+ var d, s;
291
+ const a = (d = l.user) == null ? void 0 : d.toString(), c = (s = l.business) == null ? void 0 : s.toString();
292
+ return (l.balance || 0) > 0 && (!a || a === c);
293
+ }
294
+ async function $(l) {
295
+ const a = A(l);
296
+ a && await ee(a, {
297
+ successMessage: "Collection link copied to clipboard"
298
+ });
299
+ }
300
+ const q = pe(), F = P(
301
+ () => q.campaigns.voucher.find(
302
+ (l) => {
303
+ var a;
304
+ return ((a = l._id) == null ? void 0 : a.toString()) === V.value;
305
+ }
306
+ )
307
+ ), p = P(
308
+ () => !!F.value && !u(F.value)
309
+ ), k = P(() => [
310
+ {
311
+ header: "ID/Code",
312
+ accessorKey: "_id",
313
+ cell(l) {
314
+ return _("div", { class: "flex items-center" }, [
315
+ _(Z.FmIcon, {
316
+ name: "content_copy",
317
+ outline: !0,
318
+ size: "sm",
319
+ class: "cursor-pointer mr-4",
320
+ onClick: (a) => {
321
+ a.preventDefault(), a.stopPropagation(), ee(
322
+ l.row.original.code || l.row.original._id.toString()
323
+ );
324
+ }
325
+ }),
326
+ _(
327
+ "div",
328
+ { class: "pr-2 text-ellipsis overflow-hidden" },
329
+ l.row.original.code || l.row.original._id.toString()
330
+ )
331
+ ]);
332
+ }
333
+ },
334
+ {
335
+ header: "User",
336
+ accessorKey: "user",
337
+ enableSorting: !1,
338
+ cell(l) {
339
+ const a = l.row.original.pf_user;
340
+ return ge(a);
341
+ }
342
+ },
343
+ {
344
+ header: "Phone",
345
+ accessorFn: (l) => {
346
+ var a;
347
+ return ((a = l.pf_user) == null ? void 0 : a.phoneNumber) || "-";
348
+ },
349
+ accessorKey: "pf_user.phoneNumber"
350
+ },
351
+ {
352
+ header: "Balance",
353
+ accessorKey: "balance"
354
+ },
355
+ {
356
+ header: "Created at",
357
+ accessorKey: "_id",
358
+ accessorFn: (l) => J(ve(l._id.toString())).format("DD MMM YYYY")
359
+ },
360
+ {
361
+ header: "Nearest expired at",
362
+ accessorKey: "expiryBalance",
363
+ accessorFn: (l) => {
364
+ var a;
365
+ return l.expiryBalance && l.expiryBalance.length ? J((a = l.expiryBalance) == null ? void 0 : a[0].expiredAt).format("DD MMM YYYY") : "Never expires";
366
+ }
367
+ },
368
+ ...p.value ? [
369
+ {
370
+ header: "Actions",
371
+ accessorKey: "actions",
372
+ enableSorting: !1,
373
+ meta: {
374
+ maxWidth: "72px"
375
+ },
376
+ cell(l) {
377
+ return n(l.row.original) ? _("div", { class: "flex items-center justify-center" }, [
378
+ _(Z.FmButton, {
379
+ icon: "share",
380
+ variant: "tertiary",
381
+ iconColor: "neutral-gray-400",
382
+ onClick: async (a) => {
383
+ a.preventDefault(), a.stopPropagation(), await $(l.row.original);
384
+ }
385
+ })
386
+ ]) : _(
387
+ "div",
388
+ {
389
+ class: "flex items-center justify-center text-fm-color-typo-disabled"
390
+ },
391
+ "-"
392
+ );
393
+ }
394
+ }
395
+ ] : []
396
+ ]), z = {
397
+ "$connect-STORE_REWARD_COLLECTIONS": Ce.readCollectionsByRewardId,
398
+ "$connect-CAMPAIGN_VOUCHER_COLLECTIONS": le.readCollectionsByCampaignId
399
+ }, D = (l) => {
400
+ const a = z[R.name];
401
+ return (c) => a(l, c);
402
+ }, { tableMeta: f, rowData: K, onSort: r, debouncedFetchData: e, onSearch: U } = be(D(V.value));
403
+ async function Y() {
404
+ var l;
405
+ await e(), (l = I.value) == null || l.showSheet(!1);
406
+ }
407
+ async function j() {
408
+ w.value || L(
409
+ async () => {
410
+ var s;
411
+ const l = new we(), a = D(V.value), c = (await a({
412
+ limit: 1,
413
+ skip: 0,
414
+ sortBy: B.sortBy,
415
+ descending: B.descending
416
+ })).meta.totalResources ?? 0, d = B.rowsPerPage;
417
+ for (let b = 0; b < c; b += d) {
418
+ const O = {
419
+ ...B,
420
+ limit: d,
421
+ skip: b,
422
+ sortBy: B.sortBy,
423
+ descending: B.descending
424
+ }, o = await a(O);
425
+ for await (const y of o.resources) {
426
+ const ne = {
427
+ Id: (y == null ? void 0 : y.code) || ((s = y._id) == null ? void 0 : s.toString()),
428
+ Balance: (y == null ? void 0 : y.balance) || 0,
429
+ Url: A(y)
430
+ };
431
+ l.addRecord(ne);
432
+ }
433
+ }
434
+ await fe(
435
+ l.buildExcel(),
436
+ `vouchers-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
437
+ {
438
+ bookType: "xlsx",
439
+ bookSST: !1,
440
+ type: "array"
441
+ }
442
+ );
443
+ },
444
+ {
445
+ isLoading: w
446
+ }
447
+ );
448
+ }
449
+ return ue(async () => {
450
+ await e();
451
+ }), (l, a) => {
452
+ const c = m("FmPageHead"), d = m("FmSearch");
453
+ return S(), M(T, null, [
454
+ i(c, {
455
+ title: "Collections",
456
+ "back-button": !0,
457
+ actions: [
458
+ { label: "Export", value: "export", isPrimary: !1 },
459
+ ...t(p) ? [
460
+ {
461
+ label: "Create collection",
462
+ value: "create",
463
+ isPrimary: !0
464
+ }
465
+ ] : []
466
+ ],
467
+ "onClick:back": a[0] || (a[0] = (s) => t(g).back()),
468
+ "onClick:action": a[1] || (a[1] = (s) => {
469
+ var b;
470
+ s === "create" && ((b = t(I)) == null || b.showSheet(!0)), s === "export" && j();
471
+ })
472
+ }, null, 8, ["actions"]),
473
+ x("div", ke, [
474
+ i(d, {
475
+ class: "hidden xs:flex border-b border-fm-color-neutral-gray-100",
476
+ modelValue: t(f).searchValue,
477
+ "onUpdate:modelValue": [
478
+ a[2] || (a[2] = (s) => t(f).searchValue = s),
479
+ t(U)
480
+ ],
481
+ placeholder: "Search",
482
+ collapsible: ""
483
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]),
484
+ x("div", Ue, [
485
+ i(d, {
486
+ modelValue: t(f).searchValue,
487
+ "onUpdate:modelValue": [
488
+ a[3] || (a[3] = (s) => t(f).searchValue = s),
489
+ t(U)
490
+ ],
491
+ placeholder: "Search",
492
+ collapsible: ""
493
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])
494
+ ]),
495
+ i(he, {
496
+ loading: t(f).isLoading,
497
+ "row-data": t(K),
498
+ "column-defs": t(k),
499
+ "row-count": t(f).totalRows,
500
+ "page-count": t(f).pageCount,
501
+ "page-index": t(f).pageIndex,
502
+ "page-size": t(f).pageSize,
503
+ "shrink-at": !1,
504
+ onSortChange: t(r),
505
+ onPageChange: a[4] || (a[4] = (s) => t(e)({ pageSize: s.pageSize, pageIndex: s.pageIndex }))
506
+ }, null, 8, ["loading", "row-data", "column-defs", "row-count", "page-count", "page-index", "page-size", "onSortChange"]),
507
+ i(Ve, {
508
+ ref_key: "sheetRef",
509
+ ref: I,
510
+ onSuccess: Y
511
+ }, null, 512)
512
+ ])
513
+ ], 64);
514
+ };
515
+ }
516
+ });
517
+ export {
518
+ je as default
519
+ };
@@ -1,15 +1,15 @@
1
1
  import { defineComponent as N, ref as L, computed as j, h as M, onMounted as H, resolveComponent as m, openBlock as d, createElementBlock as y, Fragment as h, createVNode as i, unref as t, createElementVNode as n, withCtx as C, renderList as q, createBlock as w, resolveDynamicComponent as O, 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 Q } from "@feedmepos/ui-library";
4
- import { p as W } from "./plugins-CTxDzq0e.js";
5
- import { u as X } from "./loading-ByVqAO0s.js";
6
- import { u as Y } from "./business-QVlWr5Oa.js";
7
- import { u as Z, c as _ } from "./campaign-BbrGpGak.js";
8
- import { g as ee, a as S, b as V } from "./campaign-DnLFH51S.js";
9
- import { u as oe } from "./vue-i18n-BMCWCmoc.js";
4
+ import { p as W } from "./plugins-bpWCIR9y.js";
5
+ import { u as X } from "./loading-E0yVUdfI.js";
6
+ import { u as Y } from "./business-qci70l-A.js";
7
+ import { u as Z, c as _ } from "./campaign-FPNFOCIx.js";
8
+ import { g as ee, a as S, b as V } from "./campaign-D_eIup7X.js";
9
+ import { u as oe } from "./vue-i18n-BLkfzQts.js";
10
10
  import { _ as te } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
11
- import { _ as ae } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DiC-2EB0.js";
12
- import { u as ne } from "./template-D1AMCdZB.js";
11
+ import { _ as ae } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BWrvk8cN.js";
12
+ import { u as ne } from "./template-BFr8iIV_.js";
13
13
  const re = { class: "px-24 flex flex-col gap-y-16" }, se = { class: "flex items-center justify-between w-full" }, ie = { class: "flex gap-8 overflow-x-auto" }, ce = { class: "space-y-8" }, le = { class: "flex w-full gap-4 items-center" }, me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, de = { class: "space-y-4" }, ue = { class: "fm-typo-en-body-lg-600" }, pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ye = { key: 0 }, Be = /* @__PURE__ */ N({
14
14
  __name: "Credit",
15
15
  setup(ge) {
@@ -1,42 +1,42 @@
1
1
  import { defineComponent, ref, watch, resolveComponent, openBlock, createElementBlock, createVNode, unref, isRef, withCtx, createBlock, createCommentVNode, computed, createElementVNode, Fragment, renderList, normalizeClass, toDisplayString, toRefs, normalizeStyle, resolveDynamicComponent, createSlots } from "vue";
2
2
  import { _ } from "./lodash-B5I3zXaY.js";
3
- import { z } from "./app-BZaMoaZh.js";
3
+ import { z } from "./app-B6euOjfV.js";
4
4
  import { Z as ZodHelper } from "./zod-Bg2FbC-D.js";
5
- import { c as getCampaignSummaryObject, C as CampaignOptions } from "./campaign-DnLFH51S.js";
6
- import { c as campaignRefinement, C as CampaignDtos, a as campaignTransform } from "./dto-wS34PjkI.js";
7
- import { u as useMembershipStore } from "./membership-bIenV-r5.js";
8
- import { u as useBusinessStore } from "./business-QVlWr5Oa.js";
9
- import "./index-DJWXPfjc.js";
10
- import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-ByvbSBP0.js";
5
+ import { c as getCampaignSummaryObject, C as CampaignOptions } from "./campaign-D_eIup7X.js";
6
+ import { c as campaignRefinement, C as CampaignDtos, a as campaignTransform } from "./dto-CoTw6KOu.js";
7
+ import { u as useMembershipStore } from "./membership-yP4z8gbJ.js";
8
+ import { u as useBusinessStore } from "./business-qci70l-A.js";
9
+ import "./index-ZC8SINKX.js";
10
+ import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-BvtsmkMr.js";
11
11
  import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
12
12
  import { h as hooks } from "./moment-D7p2TMB-.js";
13
- import { f as featureVersionMapping } from "./campaign.enum-kQr7qhKY.js";
13
+ import { f as featureVersionMapping } from "./campaign.enum-BshKRCYQ.js";
14
14
  import { _ as _sfc_main$o } from "./ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js";
15
- import { b as _sfc_main$m, a as _sfc_main$p, _ as _sfc_main$r } from "./EffectSheet.vue_vue_type_style_index_0_lang-CU_KJo82.js";
16
- import { _ as _sfc_main$q } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-CLTAGBUD.js";
17
- import { _ as _sfc_main$t } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-Ci6hlCO5.js";
18
- import { _ as _sfc_main$j, a as _sfc_main$k } from "./RuleGroup.vue_vue_type_script_setup_true_lang-Ds6fytIn.js";
19
- import { p as prompt, c as cases, f as firebaseStorage } from "./plugins-CTxDzq0e.js";
20
- import { u as useI18n } from "./vue-i18n-BMCWCmoc.js";
21
- import { T as TypeToTriggerOptions, _ as _sfc_main$u, b as _sfc_main$v } from "./trigger-Bta6ze07.js";
22
- import { _ as _sfc_main$s } from "./MessageInput.vue_vue_type_script_setup_true_lang-BJRqGOw0.js";
23
- import { C as CountryTimezone, m as moment } from "./timezone-eFG5cjuE.js";
24
- import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-DZ2TuXLh.js";
15
+ import { b as _sfc_main$m, a as _sfc_main$p, _ as _sfc_main$r } from "./EffectSheet.vue_vue_type_style_index_0_lang-BVdF1Urm.js";
16
+ import { _ as _sfc_main$q } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-mHmnkhIP.js";
17
+ import { _ as _sfc_main$t } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-D8Kfo_M8.js";
18
+ import { _ as _sfc_main$j, a as _sfc_main$k } from "./RuleGroup.vue_vue_type_script_setup_true_lang-CX4uEjpm.js";
19
+ import { p as prompt, c as cases, f as firebaseStorage } from "./plugins-bpWCIR9y.js";
20
+ import { u as useI18n } from "./vue-i18n-BLkfzQts.js";
21
+ import { T as TypeToTriggerOptions, _ as _sfc_main$u, b as _sfc_main$v } from "./trigger-DCSJm_qA.js";
22
+ import { _ as _sfc_main$s } from "./MessageInput.vue_vue_type_script_setup_true_lang-DyJKk8W7.js";
23
+ import { C as CountryTimezone, m as moment } from "./timezone-BCyUSe2a.js";
24
+ import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-BzqUqJYa.js";
25
25
  import { useCoreStore } from "@feedmepos/mf-common";
26
- import { _ as _sfc_main$l, a as _sfc_main$n } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-DeYs5HnB.js";
27
- import { t as FdoCreditLoyaltyReward, u as FdtoRandomReward, v as F_MISSION_TYPE, w as FdoThresholdCreditReward, x as FdtoThresholdReward, y as FdoMission } from "./index-CfkuglOp.js";
28
- import { T as TEMPLATES } from "./index-BvMd-cvR.js";
29
- import "./index-BY3_F6NN.js";
30
- import "./index-DNbekOJ6.js";
31
- import { a as F_GAME_TYPE } from "./collectible.enum-Dx7lCHBV.js";
32
- import { u as useLoading } from "./loading-ByVqAO0s.js";
33
- import { i as initCollectibleConfig } from "./helper-Bd6_Q-xw.js";
34
- import { C as CollectionUtils } from "./collection.fn-O_MJ2WID.js";
26
+ import { _ as _sfc_main$l, a as _sfc_main$n } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-DRn1HmAb.js";
27
+ import { t as FdoCreditLoyaltyReward, u as FdtoRandomReward, v as F_MISSION_TYPE, w as FdoThresholdCreditReward, x as FdtoThresholdReward, y as FdoMission } from "./index-BicoBDJX.js";
28
+ import { T as TEMPLATES } from "./index-CKd9UEIG.js";
29
+ import "./index-DD6t-ukB.js";
30
+ import "./index-CPHYlicy.js";
31
+ import { a as F_GAME_TYPE } from "./collectible.enum-BYIdgjMd.js";
32
+ import { u as useLoading } from "./loading-E0yVUdfI.js";
33
+ import { i as initCollectibleConfig } from "./helper-BPAmOP7l.js";
34
+ import { C as CollectionUtils } from "./collection.fn-Czegj-3i.js";
35
35
  import { s as sentenceCase$1 } from "./index-CuvNtC_M.js";
36
- import "./index-JGt4QJ6J.js";
36
+ import "./index-BioBPRnA.js";
37
37
  import { useDialog } from "@feedmepos/ui-library";
38
- import { u as useCampaignStore } from "./campaign-BbrGpGak.js";
39
- import { S as SvcConfig } from "./index-DQqE8AZF.js";
38
+ import { u as useCampaignStore } from "./campaign-FPNFOCIx.js";
39
+ import { S as SvcConfig } from "./index-DROE-IrQ.js";
40
40
  import { a as cleanPF } from "./object-qECH92oz.js";
41
41
  const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defineComponent({
42
42
  __name: "TimeRuleGroup",
@@ -1,11 +1,11 @@
1
1
  import { defineComponent as P, ref as O, onMounted as Q, computed as H, resolveComponent as y, openBlock as i, createElementBlock as x, renderSlot as W, toDisplayString as w, createCommentVNode as v, createBlock as c, unref as e, isRef as q, createVNode as F, normalizeClass as G, watch as X, withCtx as b, resolveDynamicComponent as D, Fragment as _, createElementVNode as U, createTextVNode as ee } from "vue";
2
- import { z as te } from "./app-BZaMoaZh.js";
2
+ import { z as te } from "./app-B6euOjfV.js";
3
3
  import { Z as u } from "./zod-Bg2FbC-D.js";
4
- import { f as le, g as oe } from "./index-DJWXPfjc.js";
5
- import { u as Z } from "./vue-i18n-BMCWCmoc.js";
6
- import { s as R } from "./effect-CGbyGrZY.js";
7
- import { p as ae } from "./plugins-CTxDzq0e.js";
8
- import { e as ne } from "./app-CR-6G5ya.js";
4
+ import { f as le, g as oe } from "./index-ZC8SINKX.js";
5
+ import { u as Z } from "./vue-i18n-BLkfzQts.js";
6
+ import { s as R } from "./effect-AUk5fAKr.js";
7
+ import { p as ae } from "./plugins-bpWCIR9y.js";
8
+ import { e as ne } from "./app-7__6-fNI.js";
9
9
  const ie = { class: "flex flex-col gap-8" }, de = {
10
10
  key: 0,
11
11
  class: "fm-typo-en-body-lg-600"
@@ -1,15 +1,15 @@
1
1
  import { defineComponent as E, ref as S, computed as U, onMounted as j, resolveComponent as m, openBlock as p, createElementBlock as _, Fragment as x, createVNode as c, unref as o, createElementVNode as a, withCtx as h, renderList as M, createBlock as w, resolveDynamicComponent as H, toDisplayString as u, h as q } from "vue";
2
2
  import { _ as z } from "./campaign-CpzFl8Vr.js";
3
3
  import { useDialog as G, components as J } from "@feedmepos/ui-library";
4
- import { p as Q } from "./plugins-CTxDzq0e.js";
5
- import { u as W } from "./loading-ByVqAO0s.js";
6
- import { u as X } from "./business-QVlWr5Oa.js";
7
- import { u as Y, c as g } from "./campaign-BbrGpGak.js";
8
- import { a as L, b as V, g as Z } from "./campaign-DnLFH51S.js";
9
- import { u as ee } from "./vue-i18n-BMCWCmoc.js";
4
+ import { p as Q } from "./plugins-bpWCIR9y.js";
5
+ import { u as W } from "./loading-E0yVUdfI.js";
6
+ import { u as X } from "./business-qci70l-A.js";
7
+ import { u as Y, c as g } from "./campaign-FPNFOCIx.js";
8
+ import { a as L, b as V, g as Z } from "./campaign-D_eIup7X.js";
9
+ import { u as ee } from "./vue-i18n-BLkfzQts.js";
10
10
  import { _ as te } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
11
- import { _ as oe } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DiC-2EB0.js";
12
- import { u as ne } from "./template-D1AMCdZB.js";
11
+ import { _ as oe } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BWrvk8cN.js";
12
+ import { u as ne } from "./template-BFr8iIV_.js";
13
13
  const ae = { 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" }, ce = { 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" }, 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 = { class: "flex flex-col gap-16 text-center" }, ye = { class: "fm-typo-en-title-sm-800" }, ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Be = /* @__PURE__ */ E({
14
14
  __name: "Experience",
15
15
  setup(_e) {