@feedmepos/mf-connect 0.1.38-beta.9 → 0.1.38-beta.91

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 (162) hide show
  1. package/dist/{Analytic-3MN2saaU.js → Analytic-Drbkm5By.js} +31 -32
  2. package/dist/{App-Co8X5Wdy.js → App-C0cdcG5i.js} +741 -728
  3. package/dist/AuditLogs-BZZLtf2u.js +2013 -0
  4. package/dist/{Bin-8a56ZDib.js → Bin-DRV5lRmj.js} +10 -10
  5. package/dist/Broadcast-C90FN2LB.js +266 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BVXlfq31.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CsdxwjCn.js} +6 -6
  7. package/dist/{Card-B8_09LJu.js → Card-CWF84A1O.js} +145 -140
  8. package/dist/Collections-ja0gMaFf.js +540 -0
  9. package/dist/Credit-D8U2AJgq.js +260 -0
  10. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
  11. package/dist/DateInput.vue_vue_type_script_setup_true_lang-BN4Q5Y3l.js +54 -0
  12. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js → DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js} +1 -1
  13. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-YR62BvBG.js +3120 -0
  14. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BVbhDMqH.js +351 -0
  15. package/dist/Experience-DDXLGizu.js +259 -0
  16. package/dist/{FileSaver.min-NlMItPOc.js → FileSaver.min-Dng61jiL.js} +1 -1
  17. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  18. package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +52 -0
  19. package/dist/Game-CMOilzsW.js +330 -0
  20. package/dist/Grab-tPVQB39R.js +300 -0
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js → ImageInput.vue_vue_type_script_setup_true_lang-BbtEXO4b.js} +49 -48
  22. package/dist/{Index-DLF71mx_.js → Index-Ch7wiShF.js} +54 -54
  23. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-DLO0jj6Z.js +48 -0
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CplyhUFF.js} +1 -1
  25. package/dist/{MainLayout-B1aJoR95.js → MainLayout-BMqnfxHh.js} +1 -1
  26. package/dist/Marketing-C0weDg-u.js +236 -0
  27. package/dist/MarketingMaterialEdit-BD-SyXVQ.js +1036 -0
  28. package/dist/{Member-Bkw4aqtv.js → Member-Bpf0amjr.js} +38 -37
  29. package/dist/{MemberList-a3PdVYB3.js → MemberList-cWYPEpL4.js} +485 -489
  30. package/dist/{MemberTransactions-CPDBd-n3.js → MemberTransactions-vzRUVwpO.js} +1 -1
  31. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-pbN8pN1m.js → MessageInput.vue_vue_type_script_setup_true_lang-DY3L9CvB.js} +10392 -9967
  32. package/dist/Mission-HRwIp1QY.js +334 -0
  33. package/dist/{Overview-De97NDoe.js → Overview-D9cfX4Kr.js} +34 -34
  34. package/dist/Point-Dz-Z0_m9.js +262 -0
  35. package/dist/Promotion-Csb0bdI6.js +397 -0
  36. package/dist/{Queue-ISVZxCE2.js → Queue-CAVKh9bK.js} +18 -18
  37. package/dist/{Record-2FMByNC6.js → Record-bPnIoHnT.js} +15 -14
  38. package/dist/Review-D2DfvLqJ.js +621 -0
  39. package/dist/ReviewFacebookCallback-CI7V3xbp.js +243 -0
  40. package/dist/ReviewGoogleCallback-LA2S8FLZ.js +213 -0
  41. package/dist/{Reward-DPRyQ37x.js → Reward-DdHF5Pr7.js} +16 -16
  42. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Ba7-3bL-.js → RewardGroup.vue_vue_type_script_setup_true_lang-DyZhWnI4.js} +13 -14
  43. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-B0OSLJVN.js +1912 -0
  44. package/dist/Segment-DV1zcWF7.js +1015 -0
  45. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DZbyDVid.js → SelectItems.vue_vue_type_script_setup_true_lang-Df1HE9sL.js} +23 -23
  46. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-ioMFYIwK.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-C0K9giqI.js} +12 -12
  47. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-CzJL8Xl0.js +226 -0
  48. package/dist/Setting-DZiZy8A5.js +2039 -0
  49. package/dist/SettingAdvertisements-Bb9shWVJ.js +264 -0
  50. package/dist/Store-mymtMyho.js +1996 -0
  51. package/dist/StoreRewards-jcjZfSv7.js +537 -0
  52. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B-b5_TFL.js +1130 -0
  53. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-sCa1J_hq.js +7007 -0
  54. package/dist/{Tier-CwRj0oJ1.js → Tier-Ba6aHC3R.js} +562 -480
  55. package/dist/{Title-EII5OxSP.js → Title-C4uKD8E1.js} +151 -149
  56. package/dist/{Transaction-1MTkAfej.js → Transaction-Bf2uG6co.js} +2 -2
  57. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BlQVWQHJ.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-C3ttU-bw.js} +7 -7
  58. package/dist/Voucher-Lsc2pKCk.js +421 -0
  59. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-MA7tsTm-.js +421 -0
  60. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CTeGK4bk.js → ZodTextField.vue_vue_type_script_setup_true_lang-DEDavbCx.js} +2 -2
  61. package/dist/app-BRrGcz9U.js +59647 -0
  62. package/dist/app.js +1 -1
  63. package/dist/{business-DjnN-J4U.js → business-TBSvPv65.js} +11 -8
  64. package/dist/campaign-CL95CZkI.js +219 -0
  65. package/dist/campaign-DxcuYXB7.js +254 -0
  66. package/dist/campaign.enum-DRydaoy9.js +26 -0
  67. package/dist/campaign.fn-BsoUwQ5N.js +776 -0
  68. package/dist/{collectible.enum-r6N115Lu.js → collectible.enum-CpTbpumt.js} +1 -1
  69. package/dist/{collection.fn-CSsfVv26.js → collection.fn-BNrPdDIr.js} +2 -2
  70. package/dist/dto-BGrkIVqX.js +222 -0
  71. package/dist/duplicateCampaign-DBaFROXd.js +51 -0
  72. package/dist/effect-fonU-1xO.js +89 -0
  73. package/dist/{email-addresses-D8uheCCF.js → email-addresses-WeV5Gvxa.js} +2 -2
  74. package/dist/{export-Ver6WiX6.js → export-DDXf8yf_.js} +4 -4
  75. package/dist/{helper-Bg4xoFbh.js → helper-DwnzJKxo.js} +22 -7
  76. package/dist/index-10x-WMiS.js +30289 -0
  77. package/dist/index-9Wt89ReU.js +3625 -0
  78. package/dist/{index-Bb0CHeNx.js → index-Brh5FXQ7.js} +3 -3
  79. package/dist/index-BxxNZQUc.js +8910 -0
  80. package/dist/{index-hJUxCNsF.js → index-CDAMmPIn.js} +1 -1
  81. package/dist/{index-CNhr0_Zx.js → index-Cg1vzNzf.js} +617 -191
  82. package/dist/{index-BZZ4iF4-.js → index-Cl7QnFc4.js} +23 -12
  83. package/dist/index-CuvNtC_M.js +61 -0
  84. package/dist/{index-BPQyQc4q.js → index-Cvw-xFek.js} +1 -1
  85. package/dist/index-DCJ_r_e2.js +85 -0
  86. package/dist/{index-Dn_bmcns.js → index-DLG8B-TK.js} +3 -3
  87. package/dist/{index-D4JOeJJJ.js → index-DWhh_u0L.js} +1 -1
  88. package/dist/index-DsQJTvKe.js +28900 -0
  89. package/dist/index-oR7xhhIt.js +48 -0
  90. package/dist/{index.esm2017-hK1Mi9yY.js → index.esm2017-CFvohTUs.js} +122 -122
  91. package/dist/{loading-kIQFOTwH.js → loading-DiD8J1Jc.js} +4 -3
  92. package/dist/{lodash-B5I3zXaY.js → lodash-BJgKlNEt.js} +1 -1
  93. package/dist/{membership--xR-HZoa.js → membership-C8HuK9_K.js} +38 -18
  94. package/dist/{moment-BWErdI6_.js → moment-D7p2TMB-.js} +6 -1
  95. package/dist/{money-c-ITXnlg.js → money-DXl1-c0l.js} +1 -1
  96. package/dist/{number-DfZSBLOY.js → number-C6RGu6qp.js} +1 -1
  97. package/dist/objectid-8Boc1xMT.js +145 -0
  98. package/dist/{campaign-BpJ1O6KS.js → plugins-CxBcRdUi.js} +677 -699
  99. package/dist/remy-D_Deb3ue.js +13 -0
  100. package/dist/{reward-CE0ifMHS.js → reward-CEh2CA9Z.js} +1 -1
  101. package/dist/{rule-DrjdmpaB.js → rule-DEfU8NOO.js} +505 -487
  102. package/dist/rule-builder-BZIx2IzX.js +102 -0
  103. package/dist/string-Gcy5IM_H.js +32 -0
  104. package/dist/style.css +11 -2
  105. package/dist/template-Ba8NxY41.js +188 -0
  106. package/dist/timezone-DUqMvcwo.js +1156 -0
  107. package/dist/trigger-KQ-DPHv-.js +213 -0
  108. package/dist/useMarketingMaterialActions-DSI7Fpu9.js +96 -0
  109. package/dist/usePagination-BeTADCIt.js +220 -0
  110. package/dist/{user-Cl3IotYV.js → user-DN6_QE2j.js} +15 -14
  111. package/dist/vue-i18n-B4dOYJz4.js +2365 -0
  112. package/dist/{xlsx-BDBzdOuM.js → xlsx-BDFTkXYe.js} +1 -1
  113. package/dist/{zod-Bg2FbC-D.js → zod-B8WJKIxe.js} +32 -31
  114. package/package.json +14 -6
  115. package/dist/AuditLogs-DTq6IAuc.js +0 -1887
  116. package/dist/Broadcast-UreS5Kiq.js +0 -227
  117. package/dist/Collections-B0I5ULxR.js +0 -465
  118. package/dist/Credit-B4Ad8DWP.js +0 -222
  119. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +0 -108
  120. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DjgACf9F.js +0 -2185
  121. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-y5JnuIev.js +0 -347
  122. package/dist/Experience-xO5KpTTm.js +0 -223
  123. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js +0 -114
  124. package/dist/Game-ChgrVvz5.js +0 -278
  125. package/dist/Marketing-BlmRXSGl.js +0 -20073
  126. package/dist/Mission-B07wK0HX.js +0 -296
  127. package/dist/Point-Ckj9QIeH.js +0 -226
  128. package/dist/Promotion-aGNCOeRN.js +0 -289
  129. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DWj-421v.js +0 -1751
  130. package/dist/Segment-CRMNJ11X.js +0 -882
  131. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-Cfp8XXdO.js +0 -147
  132. package/dist/Setting-c0FWRZsD.js +0 -1936
  133. package/dist/Store-Bm1_15s8.js +0 -1842
  134. package/dist/StoreRewards-BCQHHfay.js +0 -423
  135. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CfTF2l-D.js +0 -1029
  136. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-rvhoxo0w.js +0 -139
  137. package/dist/Voucher-CYvjCb-v.js +0 -384
  138. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-63Jr71dJ.js +0 -419
  139. package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
  140. package/dist/app-BJLHk8ao.js +0 -33357
  141. package/dist/app-BzIk1ojT.js +0 -7086
  142. package/dist/campaign-BHNS5kXt.js +0 -96
  143. package/dist/campaign.enum-CJDWE_Om.js +0 -20
  144. package/dist/campaign.fn-C0HQE9uh.js +0 -758
  145. package/dist/dto-Byq51uVH.js +0 -214
  146. package/dist/effect-Do3yTM-_.js +0 -78
  147. package/dist/index-B1V9UnI9.js +0 -76
  148. package/dist/index-BM9CWjC6.js +0 -38
  149. package/dist/index-CsaQJMAR.js +0 -66
  150. package/dist/index-D6VxioBg.js +0 -30038
  151. package/dist/index-DGKlRWn3.js +0 -32260
  152. package/dist/index-DLKyOu7W.js +0 -8861
  153. package/dist/index-DyYF6HYL.js +0 -121
  154. package/dist/index-UXtH44XQ.js +0 -3120
  155. package/dist/objectid-DKbha9-x.js +0 -145
  156. package/dist/plugins-DtakupKW.js +0 -208
  157. package/dist/remy-vue-client-Cpppk9h-.js +0 -1693
  158. package/dist/rule-builder-B_hCyq3x.js +0 -89
  159. package/dist/template-WI4a-lFY.js +0 -190
  160. package/dist/trigger-DieDHht3.js +0 -144
  161. package/dist/usePagination-BeF5K3M7.js +0 -223
  162. package/dist/vue-i18n-DKh0SMhL.js +0 -2365
@@ -0,0 +1,540 @@
1
+ var ie = Object.defineProperty;
2
+ var ue = (y, u, v) => u in y ? ie(y, u, { enumerable: !0, configurable: !0, writable: !0, value: v }) : y[u] = v;
3
+ var Z = (y, u, v) => ue(y, typeof u != "symbol" ? u + "" : u, v);
4
+ import { defineComponent as ae, ref as C, computed as D, watch as W, resolveComponent as p, openBlock as w, createBlock as Q, unref as o, isRef as ee, withCtx as Y, createElementVNode as V, createVNode as i, createElementBlock as T, Fragment as L, renderList as ce, createCommentVNode as q, h, onMounted as de } from "vue";
5
+ import { h as E } from "./moment-D7p2TMB-.js";
6
+ import { components as X } from "@feedmepos/ui-library";
7
+ import "./index-10x-WMiS.js";
8
+ import { J as me } from "./JsonViewer-v8_C7l5N.js";
9
+ import { u as le } from "./loading-DiD8J1Jc.js";
10
+ import { u as pe } from "./app-wDQR6dpb.js";
11
+ import { useRoute as ne, useRouter as fe } from "vue-router";
12
+ import { c as re, u as ge } from "./campaign-CL95CZkI.js";
13
+ import { e as b } from "./index-vh86FiIQ.js";
14
+ import { u as J, w as ve } from "./xlsx-BDFTkXYe.js";
15
+ import { u as he, _ as be } from "./usePagination-BeTADCIt.js";
16
+ import { c as te } from "./plugins-CxBcRdUi.js";
17
+ import { m as Ce } from "./index-CDAMmPIn.js";
18
+ import { o as oe } from "./objectId-dwaoBfJX.js";
19
+ const ye = { class: "space-y-16" }, xe = { class: "gap-16 grid grid-cols-2" }, Se = { class: "flex items-center gap-8" }, Ve = /* @__PURE__ */ ae({
20
+ __name: "CreateCollectionSheet",
21
+ emits: ["success"],
22
+ setup(y, { expose: u, emit: v }) {
23
+ const { minor: M } = le, P = ne(), F = C(), k = C(!1), $ = v, x = C(!1);
24
+ function R(r) {
25
+ x.value = r, r && (n.value = {
26
+ quantity: 1,
27
+ code: "",
28
+ codeConfig: {
29
+ length: 8,
30
+ charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
31
+ prefix: "",
32
+ suffix: "",
33
+ pattern: "########"
34
+ }
35
+ });
36
+ }
37
+ const n = C({
38
+ quantity: 1,
39
+ code: "",
40
+ codeConfig: {
41
+ length: 8,
42
+ charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
43
+ prefix: "",
44
+ suffix: "",
45
+ pattern: "########"
46
+ }
47
+ }), z = [
48
+ {
49
+ label: "Bulk codes",
50
+ value: "bulk",
51
+ sublabel: "Bulk generate unique codes"
52
+ },
53
+ {
54
+ label: "Custom code",
55
+ value: "single",
56
+ sublabel: "Enter your own custom codes"
57
+ }
58
+ ], A = [
59
+ {
60
+ label: "Alphanumeric",
61
+ value: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
62
+ },
63
+ {
64
+ label: "Alphabetic",
65
+ value: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
66
+ },
67
+ { label: "Alphabetic Lowercase", value: "abcdefghijklmnopqrstuvwxyz" },
68
+ { label: "Alphabetic Uppercase", value: "ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
69
+ { label: "Numbers", value: "0123456789" },
70
+ { label: "Custom", value: "" }
71
+ ], U = C(A[0].value), f = C("bulk"), _ = C(!1), K = D(() => P.params.id);
72
+ async function N(r) {
73
+ var t;
74
+ await ((t = F.value) == null ? void 0 : t.validateInputs()), k.value && await M(
75
+ async () => {
76
+ await re.createCollectionByCampaignId(K.value, r), await $("success");
77
+ },
78
+ {
79
+ message: "Creating claim(s)",
80
+ successMessage: "Claim(s) created"
81
+ }
82
+ );
83
+ }
84
+ u({
85
+ showSheet: R
86
+ }), W(
87
+ () => f.value,
88
+ (r, t) => {
89
+ t != 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 = "########");
90
+ }
91
+ );
92
+ function g(r) {
93
+ if (f.value !== "single") return !1;
94
+ const t = r.split(`
95
+ `).map((B) => B.trim()).filter(Boolean);
96
+ return new Set(t).size !== t.length;
97
+ }
98
+ function j(r) {
99
+ return /[ \t]/.test(r);
100
+ }
101
+ return W(
102
+ () => n.value.codeConfig.length,
103
+ (r, t) => {
104
+ r != t && (n.value.codeConfig.pattern = "#".repeat(Math.min(16, Number(r))));
105
+ }
106
+ ), W(
107
+ () => n.value.codeConfig.pattern,
108
+ (r, t) => {
109
+ r != t && (n.value.codeConfig.length = (n.value.codeConfig.pattern.match(/#/g) || []).length);
110
+ }
111
+ ), (r, t) => {
112
+ const B = p("FmRadio"), O = p("FmRadioGroup"), H = p("FmSwitch"), l = p("FmStepperField"), e = p("FmSelect"), c = p("FmTextField"), d = p("FmTextarea"), s = p("FmForm"), S = p("FmButton"), G = p("FmSideSheet");
113
+ return w(), Q(G, {
114
+ "max-width": 560,
115
+ "dismiss-away": !0,
116
+ header: "Create collection",
117
+ modelValue: o(x),
118
+ "onUpdate:modelValue": [
119
+ t[14] || (t[14] = (a) => ee(x) ? x.value = a : null),
120
+ t[15] || (t[15] = (a) => x.value = a)
121
+ ]
122
+ }, {
123
+ "side-sheet-footer": Y(() => [
124
+ V("div", Se, [
125
+ i(S, {
126
+ label: "Save",
127
+ onClick: t[12] || (t[12] = (a) => N(o(n))),
128
+ loading: o(pe)().isLoading
129
+ }, null, 8, ["loading"]),
130
+ i(S, {
131
+ label: "Cancel",
132
+ type: "button",
133
+ variant: "tertiary",
134
+ onClick: t[13] || (t[13] = (a) => x.value = !1)
135
+ })
136
+ ])
137
+ ]),
138
+ default: Y(() => [
139
+ i(me, { json: o(n) }, null, 8, ["json"]),
140
+ i(s, {
141
+ ref_key: "form",
142
+ ref: F,
143
+ class: "space-y-40",
144
+ onValidationSuccess: t[10] || (t[10] = (a) => k.value = !0),
145
+ onValidationFailed: t[11] || (t[11] = (a) => k.value = !1)
146
+ }, {
147
+ default: Y(() => [
148
+ V("div", null, [
149
+ t[16] || (t[16] = V("div", { class: "fm-typo-en-body-lg-600" }, "Code type", -1)),
150
+ i(O, {
151
+ modelValue: o(f),
152
+ "onUpdate:modelValue": t[0] || (t[0] = (a) => ee(f) ? f.value = a : null),
153
+ inline: !1
154
+ }, {
155
+ default: Y(() => [
156
+ (w(), T(L, null, ce(z, (a) => i(B, {
157
+ key: a.value,
158
+ value: a.value,
159
+ label: a.label,
160
+ sublabel: a.sublabel
161
+ }, null, 8, ["value", "label", "sublabel"])), 64))
162
+ ]),
163
+ _: 1
164
+ }, 8, ["modelValue"])
165
+ ]),
166
+ V("div", ye, [
167
+ t[17] || (t[17] = V("div", { class: "fm-typo-en-body-lg-600" }, "Settings", -1)),
168
+ o(f) === "bulk" ? (w(), T(L, { key: 0 }, [
169
+ i(H, {
170
+ "model-value": o(_),
171
+ "label-placement": "right",
172
+ value: "true",
173
+ label: "Advance code setting",
174
+ required: !0,
175
+ "onUpdate:modelValue": t[1] || (t[1] = () => _.value = !o(_))
176
+ }, null, 8, ["model-value"]),
177
+ o(_) ? (w(), T(L, { key: 0 }, [
178
+ i(l, {
179
+ modelValue: o(n).codeConfig.length,
180
+ "onUpdate:modelValue": t[2] || (t[2] = (a) => o(n).codeConfig.length = a),
181
+ label: "Code length",
182
+ max: 16,
183
+ min: 1,
184
+ rules: [
185
+ (a) => Number(a) >= 1 || "Code length must at least 1",
186
+ (a) => Number(a) <= 16 || "Code length must less than 16"
187
+ ],
188
+ required: !0
189
+ }, null, 8, ["modelValue", "rules"]),
190
+ i(e, {
191
+ label: "Charset",
192
+ "model-value": o(U),
193
+ items: A,
194
+ "helper-text": o(n).codeConfig.charset.length > 62 ? `${o(n).codeConfig.charset.substring(0, 62)}...` : o(n).codeConfig.charset,
195
+ "onUpdate:modelValue": t[3] || (t[3] = (a) => {
196
+ U.value = a, o(n).codeConfig.charset = a;
197
+ })
198
+ }, null, 8, ["model-value", "helper-text"]),
199
+ o(U) === "" ? (w(), Q(c, {
200
+ key: 0,
201
+ modelValue: o(n).codeConfig.charset,
202
+ "onUpdate:modelValue": t[4] || (t[4] = (a) => o(n).codeConfig.charset = a),
203
+ label: "Custom Charset",
204
+ required: ""
205
+ }, null, 8, ["modelValue"])) : q("", !0),
206
+ V("div", xe, [
207
+ i(c, {
208
+ modelValue: o(n).codeConfig.prefix,
209
+ "onUpdate:modelValue": t[5] || (t[5] = (a) => o(n).codeConfig.prefix = a),
210
+ label: "Prefix (Optional)"
211
+ }, null, 8, ["modelValue"]),
212
+ i(c, {
213
+ modelValue: o(n).codeConfig.suffix,
214
+ "onUpdate:modelValue": t[6] || (t[6] = (a) => o(n).codeConfig.suffix = a),
215
+ label: "Suffix (Optional)"
216
+ }, null, 8, ["modelValue"])
217
+ ]),
218
+ i(c, {
219
+ modelValue: o(n).codeConfig.pattern,
220
+ "onUpdate:modelValue": t[7] || (t[7] = (a) => o(n).codeConfig.pattern = a),
221
+ label: "Pattern",
222
+ required: !0
223
+ }, null, 8, ["modelValue"])
224
+ ], 64)) : q("", !0),
225
+ i(c, {
226
+ modelValue: o(n).quantity,
227
+ "onUpdate:modelValue": t[8] || (t[8] = (a) => o(n).quantity = a),
228
+ label: "Number of code",
229
+ rules: [
230
+ (a) => a >= 1 || "Quantity cannot be less than 1",
231
+ (a) => a <= 1e4 || "Quantity cannot more than 10,000"
232
+ ],
233
+ required: !0,
234
+ "helper-text": `${o(n).quantity} claim will be created`
235
+ }, null, 8, ["modelValue", "rules", "helper-text"])
236
+ ], 64)) : q("", !0),
237
+ o(f) !== "bulk" ? (w(), Q(d, {
238
+ key: 1,
239
+ modelValue: o(n).code,
240
+ "onUpdate:modelValue": t[9] || (t[9] = (a) => o(n).code = a),
241
+ label: "Custom Code",
242
+ rules: [
243
+ (a) => o(f) != "single" || !!a || "Custom code is required",
244
+ (a) => !g(a) || "Custom code must be unique",
245
+ (a) => !j(a) || "Custom code must not contain space"
246
+ ],
247
+ placeholder: "(For multiple codes, please enter in the new row.)"
248
+ }, null, 8, ["modelValue", "rules"])) : q("", !0)
249
+ ])
250
+ ]),
251
+ _: 1
252
+ }, 512)
253
+ ]),
254
+ _: 1
255
+ }, 8, ["modelValue"]);
256
+ };
257
+ }
258
+ });
259
+ class we {
260
+ constructor() {
261
+ Z(this, "data", []);
262
+ }
263
+ addRecord(u) {
264
+ this.data.push(u);
265
+ }
266
+ buildExcel() {
267
+ const u = J.book_new(), v = J.json_to_sheet(this.data);
268
+ return J.book_append_sheet(u, v, "Collection"), u;
269
+ }
270
+ }
271
+ var Fe = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "feedmedev.vip", crmUrl: "crm.feedmedev.cc", paymentPortalUrl: "https://portal.feedmedev.cc/payment/payout-account", licensePortalUrl: "https://license.feedmedev.cc/", marketingV1Portal: "https://marketing-v1.feedmedev.cc", voucherAppUrl: "https://voucher.feedmedev.cc/" };
272
+ const ke = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Ue = { class: "flex items-center justify-end py-4 xs:hidden" }, Ke = /* @__PURE__ */ ae({
273
+ __name: "Collections",
274
+ setup(y) {
275
+ function u(l) {
276
+ return l.hideInApp === !1;
277
+ }
278
+ const v = fe(), M = ne(), P = C(), F = D(() => M.params.id), k = C(!1), { custom: $ } = le;
279
+ function x(l) {
280
+ var e;
281
+ return (e = l._id) == null ? void 0 : e.toString();
282
+ }
283
+ function R(l) {
284
+ var d;
285
+ const e = (d = Fe.voucherAppUrl) == null ? void 0 : d.replace(/\/$/, ""), c = x(l);
286
+ return !e || !c ? "" : `${e}/c/${c}`;
287
+ }
288
+ function n(l) {
289
+ var d, s;
290
+ const e = (d = l.user) == null ? void 0 : d.toString(), c = (s = l.business) == null ? void 0 : s.toString();
291
+ return (l.balance || 0) > 0 && (!e || e === c);
292
+ }
293
+ async function z(l) {
294
+ const e = R(l);
295
+ e && await te(e, {
296
+ successMessage: "Collection link copied to clipboard"
297
+ });
298
+ }
299
+ const A = ge(), U = D(
300
+ () => A.campaigns.voucher.find(
301
+ (l) => {
302
+ var e;
303
+ return ((e = l._id) == null ? void 0 : e.toString()) === F.value;
304
+ }
305
+ )
306
+ ), f = D(
307
+ () => !!U.value && !u(U.value)
308
+ ), _ = D(() => [
309
+ {
310
+ header: "ID/Code",
311
+ accessorKey: "_id",
312
+ cell(l) {
313
+ return h("div", { class: "flex items-center" }, [
314
+ h(X.FmIcon, {
315
+ name: "content_copy",
316
+ outline: !0,
317
+ size: "sm",
318
+ class: "cursor-pointer mr-4",
319
+ onClick: (e) => {
320
+ e.preventDefault(), e.stopPropagation(), te(
321
+ l.row.original.code || l.row.original._id.toString()
322
+ );
323
+ }
324
+ }),
325
+ h(
326
+ "div",
327
+ { class: "pr-2 text-ellipsis overflow-hidden" },
328
+ l.row.original.code || l.row.original._id.toString()
329
+ )
330
+ ]);
331
+ }
332
+ },
333
+ {
334
+ header: "User",
335
+ accessorKey: "user",
336
+ enableSorting: !1,
337
+ cell(l) {
338
+ const e = l.row.original.pf_user;
339
+ return h(
340
+ "div",
341
+ {
342
+ class: "flex items-center gap-x-8"
343
+ },
344
+ [
345
+ h(X.FmAvatar, {
346
+ name: e != null && e.photoUrl || e == null ? void 0 : e.name,
347
+ src: (e == null ? void 0 : e.photoUrl) ?? void 0,
348
+ size: "sm"
349
+ }),
350
+ h("span", e == null ? void 0 : e.name)
351
+ ]
352
+ );
353
+ }
354
+ },
355
+ {
356
+ header: "Phone",
357
+ accessorFn: (l) => {
358
+ var e;
359
+ return ((e = l.pf_user) == null ? void 0 : e.phoneNumber) || "-";
360
+ },
361
+ accessorKey: "pf_user.phoneNumber"
362
+ },
363
+ {
364
+ header: "Balance",
365
+ accessorKey: "balance"
366
+ },
367
+ {
368
+ header: "Created at",
369
+ accessorKey: "_id",
370
+ accessorFn: (l) => E(oe(l._id.toString())).format("DD MMM YYYY")
371
+ },
372
+ {
373
+ header: "Nearest expired at",
374
+ accessorKey: "expiryBalance",
375
+ accessorFn: (l) => {
376
+ var e;
377
+ return l.expiryBalance && l.expiryBalance.length ? E((e = l.expiryBalance) == null ? void 0 : e[0].expiredAt).format("DD MMM YYYY") : "Never expires";
378
+ }
379
+ },
380
+ ...f.value ? [
381
+ {
382
+ header: "Actions",
383
+ accessorKey: "actions",
384
+ enableSorting: !1,
385
+ meta: {
386
+ maxWidth: "72px"
387
+ },
388
+ cell(l) {
389
+ return n(l.row.original) ? h("div", { class: "flex items-center justify-center" }, [
390
+ h(X.FmButton, {
391
+ icon: "share",
392
+ variant: "tertiary",
393
+ iconColor: "neutral-gray-400",
394
+ onClick: async (e) => {
395
+ e.preventDefault(), e.stopPropagation(), await z(l.row.original);
396
+ }
397
+ })
398
+ ]) : h(
399
+ "div",
400
+ {
401
+ class: "flex items-center justify-center text-fm-color-typo-disabled"
402
+ },
403
+ "-"
404
+ );
405
+ }
406
+ }
407
+ ] : []
408
+ ]), K = {
409
+ "$connect-STORE_REWARD_COLLECTIONS": Ce.readCollectionsByRewardId,
410
+ "$connect-CAMPAIGN_VOUCHER_COLLECTIONS": re.readCollectionsByCampaignId
411
+ }, N = (l) => {
412
+ const e = K[M.name];
413
+ return (c) => e(l, c);
414
+ }, { tableMeta: g, rowData: j, onSort: r, debouncedFetchData: t, onSearch: B } = he(N(F.value));
415
+ async function O() {
416
+ var l;
417
+ await t(), (l = P.value) == null || l.showSheet(!1);
418
+ }
419
+ async function H() {
420
+ k.value || $(
421
+ async () => {
422
+ var s;
423
+ const l = new we(), e = N(F.value), c = (await e({
424
+ limit: 1,
425
+ skip: 0,
426
+ sortBy: b.sortBy,
427
+ descending: b.descending
428
+ })).meta.totalResources ?? 0, d = b.rowsPerPage;
429
+ for (let S = 0; S < c; S += d) {
430
+ const G = {
431
+ ...b,
432
+ limit: d,
433
+ skip: b.page - 1,
434
+ sortBy: b.sortBy,
435
+ descending: b.descending
436
+ }, a = await e(G);
437
+ for await (const m of a.resources) {
438
+ const I = m.pf_user, se = {
439
+ "ID/Code": (m == null ? void 0 : m.code) || ((s = m._id) == null ? void 0 : s.toString()),
440
+ User: (I == null ? void 0 : I.name) || "-",
441
+ Phone: (I == null ? void 0 : I.phoneNumber) || "-",
442
+ Balance: (m == null ? void 0 : m.balance) || 0,
443
+ "Created at": E(
444
+ oe(m._id.toString())
445
+ ).format("DD MMM YYYY"),
446
+ "Nearest expired at": m.expiryBalance && m.expiryBalance.length ? E(m.expiryBalance[0].expiredAt).format(
447
+ "DD MMM YYYY"
448
+ ) : "Never expires",
449
+ Url: R(m)
450
+ };
451
+ l.addRecord(se);
452
+ }
453
+ b.page++;
454
+ }
455
+ await ve(
456
+ l.buildExcel(),
457
+ `vouchers-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
458
+ {
459
+ bookType: "xlsx",
460
+ bookSST: !1,
461
+ type: "array"
462
+ }
463
+ ), b.page = 1;
464
+ },
465
+ {
466
+ isLoading: k
467
+ }
468
+ );
469
+ }
470
+ return de(async () => {
471
+ await t();
472
+ }), (l, e) => {
473
+ const c = p("FmPageHead"), d = p("FmSearch");
474
+ return w(), T(L, null, [
475
+ i(c, {
476
+ title: "Collections",
477
+ "back-button": !0,
478
+ actions: [
479
+ { label: "Export", value: "export", isPrimary: !1 },
480
+ ...o(f) ? [
481
+ {
482
+ label: "Create collection",
483
+ value: "create",
484
+ isPrimary: !0
485
+ }
486
+ ] : []
487
+ ],
488
+ "onClick:back": e[0] || (e[0] = (s) => o(v).back()),
489
+ "onClick:action": e[1] || (e[1] = (s) => {
490
+ var S;
491
+ s === "create" && ((S = o(P)) == null || S.showSheet(!0)), s === "export" && H();
492
+ })
493
+ }, null, 8, ["actions"]),
494
+ V("div", ke, [
495
+ i(d, {
496
+ class: "hidden xs:!flex border-b border-fm-color-neutral-gray-100",
497
+ modelValue: o(g).searchValue,
498
+ "onUpdate:modelValue": [
499
+ e[2] || (e[2] = (s) => o(g).searchValue = s),
500
+ o(B)
501
+ ],
502
+ placeholder: "Search",
503
+ collapsible: ""
504
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]),
505
+ V("div", Ue, [
506
+ i(d, {
507
+ modelValue: o(g).searchValue,
508
+ "onUpdate:modelValue": [
509
+ e[3] || (e[3] = (s) => o(g).searchValue = s),
510
+ o(B)
511
+ ],
512
+ placeholder: "Search",
513
+ collapsible: ""
514
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])
515
+ ]),
516
+ i(be, {
517
+ loading: o(g).isLoading,
518
+ "row-data": o(j),
519
+ "column-defs": o(_),
520
+ "row-count": o(g).totalRows,
521
+ "page-count": o(g).pageCount,
522
+ "page-index": o(g).pageIndex,
523
+ "page-size": o(g).pageSize,
524
+ "shrink-at": !1,
525
+ onSortChange: o(r),
526
+ onPageChange: e[4] || (e[4] = (s) => o(t)({ pageSize: s.pageSize, pageIndex: s.pageIndex }))
527
+ }, null, 8, ["loading", "row-data", "column-defs", "row-count", "page-count", "page-index", "page-size", "onSortChange"]),
528
+ i(Ve, {
529
+ ref_key: "sheetRef",
530
+ ref: P,
531
+ onSuccess: O
532
+ }, null, 512)
533
+ ])
534
+ ], 64);
535
+ };
536
+ }
537
+ });
538
+ export {
539
+ Ke as default
540
+ };