@feedmepos/mf-connect 0.1.98-beta.4 → 0.1.98-beta.40

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 (135) hide show
  1. package/package.json +3 -3
  2. package/dist/App-BGv_JihW.js +0 -4642
  3. package/dist/AuditLogs-53rnjCmD.js +0 -2013
  4. package/dist/Bin-B0Q_WpuY.js +0 -166
  5. package/dist/Broadcast-PiJE1Syl.js +0 -266
  6. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Dz2KsBZl.js +0 -120
  7. package/dist/Card-DlqMu3Sl.js +0 -910
  8. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
  9. package/dist/Collections-BWcBlDDR.js +0 -540
  10. package/dist/Credit-CMfcuj5n.js +0 -260
  11. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
  12. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  13. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DCvH0lGA.js +0 -3377
  14. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-B_FyeWq4.js +0 -351
  15. package/dist/Experience-DacFmPYy.js +0 -259
  16. package/dist/FileSaver.min-CMZKiGkX.js +0 -74
  17. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  18. package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +0 -52
  19. package/dist/Game-DXKnGuhR.js +0 -330
  20. package/dist/Grab-DaBL5y3H.js +0 -300
  21. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-BaY_nQio.js +0 -145
  22. package/dist/Index-2UrjF35w.js +0 -259
  23. package/dist/JsonViewer-v8_C7l5N.js +0 -87
  24. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-BuVBZsCN.js +0 -48
  25. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-6wUxYqWe.js +0 -18737
  26. package/dist/LoyaltyDashboard-DIArPp71.js +0 -1082
  27. package/dist/MainLayout-BjvTxTPG.js +0 -41
  28. package/dist/Marketing-DEp--hFd.js +0 -235
  29. package/dist/MarketingMaterialEdit-BHL8Ptsu.js +0 -1035
  30. package/dist/Member-BU1YxoEV.js +0 -280
  31. package/dist/MemberList-zjvJBYf0.js +0 -1601
  32. package/dist/MemberOverview-wL_ailso.js +0 -58
  33. package/dist/MemberTransactions-BvyLV69V.js +0 -45
  34. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-_YOM1SlS.js +0 -60802
  35. package/dist/Mission-BNYk_aPM.js +0 -334
  36. package/dist/Overview-BToUlbsH.js +0 -1079
  37. package/dist/Point-B-L2326L.js +0 -262
  38. package/dist/Promotion-sMKGkL4w.js +0 -397
  39. package/dist/Queue-D3vUkKN9.js +0 -260
  40. package/dist/Record-BViEbZZ8.js +0 -342
  41. package/dist/Review-CMBAk-Qu.js +0 -1067
  42. package/dist/ReviewFacebookCallback-BCJTFy3b.js +0 -243
  43. package/dist/ReviewGoogleCallback-DKUG075r.js +0 -208
  44. package/dist/Reward-CZsvsYW_.js +0 -442
  45. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-BASPLoRa.js +0 -149
  46. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-B90meAnV.js +0 -1911
  47. package/dist/Segment-CN8NEg8w.js +0 -1014
  48. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BGyYQST4.js +0 -181
  49. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-BxW-Kc6t.js +0 -188
  50. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-C9dwcEr5.js +0 -226
  51. package/dist/Setting-DLPbZW11.js +0 -2047
  52. package/dist/SettingAdvertisements-BIq8gS5g.js +0 -264
  53. package/dist/Store-DNB3gUIR.js +0 -1996
  54. package/dist/StoreRewards-BoEjVFk6.js +0 -540
  55. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Bv9ABH1K.js +0 -1130
  56. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DNHgSfIg.js +0 -7007
  57. package/dist/Tier-kQ6X9h-t.js +0 -969
  58. package/dist/Title-XosVAF2Y.js +0 -566
  59. package/dist/Transaction-CO6oLPKR.js +0 -39
  60. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-McMR2Y7Y.js +0 -130
  61. package/dist/Voucher-CogaCxx2.js +0 -421
  62. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DjHwHFBq.js +0 -421
  63. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-Dor9klZ8.js +0 -56
  64. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  65. package/dist/app-C9UPXbDs.js +0 -59737
  66. package/dist/app-wDQR6dpb.js +0 -39
  67. package/dist/app.js +0 -7
  68. package/dist/business-CYpW6-Ls.js +0 -82
  69. package/dist/campaign-BtLa7KeF.js +0 -277
  70. package/dist/campaign-CpzFl8Vr.js +0 -4
  71. package/dist/campaign-CtoHyXVT.js +0 -219
  72. package/dist/campaign.enum-DiLhS5il.js +0 -26
  73. package/dist/campaign.fn-CLB9gBHo.js +0 -776
  74. package/dist/collectible.enum-CmwWcfBh.js +0 -19
  75. package/dist/duplicateCampaign-DGhOBd5l.js +0 -51
  76. package/dist/effect-CY5Y6sxy.js +0 -89
  77. package/dist/email-addresses-BEnOHWj_.js +0 -705
  78. package/dist/export-BgYu7SCd.js +0 -97
  79. package/dist/feedme.ico +0 -0
  80. package/dist/helper-DTDgoyEh.js +0 -86
  81. package/dist/index-B4IAURA_.js +0 -3684
  82. package/dist/index-BZVhi3ZG.js +0 -28900
  83. package/dist/index-C8ehLvXG.js +0 -31
  84. package/dist/index-CDk0Itu1.js +0 -32
  85. package/dist/index-CLZnH782.js +0 -54
  86. package/dist/index-CNKP1_IW.js +0 -30289
  87. package/dist/index-CP-7qATP.js +0 -67
  88. package/dist/index-Ck3PeOQ5.js +0 -1157
  89. package/dist/index-CuvNtC_M.js +0 -61
  90. package/dist/index-DntoqWT_.js +0 -85
  91. package/dist/index-DtyWsBgg.js +0 -3
  92. package/dist/index-P8Qh2yIP.js +0 -52
  93. package/dist/index-goRooQn5.js +0 -2802
  94. package/dist/index-kS20rM5m.js +0 -8910
  95. package/dist/index-vh86FiIQ.js +0 -10
  96. package/dist/index-zF0gIg9H.js +0 -151
  97. package/dist/index.esm2017-C79fd6cz.js +0 -3069
  98. package/dist/loading-Dfr_97Ri.js +0 -72
  99. package/dist/lodash-BX2mJOxF.js +0 -3678
  100. package/dist/membership-ncNOUJwj.js +0 -255
  101. package/dist/moment-D7p2TMB-.js +0 -2583
  102. package/dist/money-vEtTzt04.js +0 -15
  103. package/dist/number-BjgTlMsp.js +0 -12
  104. package/dist/object-BYyQ0PZp.js +0 -18
  105. package/dist/objectId-dwaoBfJX.js +0 -7
  106. package/dist/objectid-C9DiLwge.js +0 -145
  107. package/dist/plugins-BVGqEmE1.js +0 -1788
  108. package/dist/reward-BGTLhhzT.js +0 -36
  109. package/dist/rule-BB2VX3Gy.js +0 -1969
  110. package/dist/string-Gcy5IM_H.js +0 -32
  111. package/dist/style.css +0 -4
  112. package/dist/template-DLiHnpjK.js +0 -188
  113. package/dist/tier-BJDhpH6X.js +0 -4
  114. package/dist/tiers/tier=1.png +0 -0
  115. package/dist/tiers/tier=2.png +0 -0
  116. package/dist/tiers/tier=3.png +0 -0
  117. package/dist/tiers/tier=4.png +0 -0
  118. package/dist/titles/type=diamond.png +0 -0
  119. package/dist/titles/type=drinks.png +0 -0
  120. package/dist/titles/type=food.png +0 -0
  121. package/dist/titles/type=heart.png +0 -0
  122. package/dist/titles/type=medal.png +0 -0
  123. package/dist/titles/type=spend.png +0 -0
  124. package/dist/titles/type=thank-you.png +0 -0
  125. package/dist/titles/type=thumbs-up.png +0 -0
  126. package/dist/titles/type=years.png +0 -0
  127. package/dist/trigger-DrKnfSoi.js +0 -213
  128. package/dist/tslib.es6-BCqqvLQ_.js +0 -44
  129. package/dist/type_drinks-D6jnpvwV.js +0 -4
  130. package/dist/useMarketingMaterialActions-B6zaDbNE.js +0 -107
  131. package/dist/usePagination-Dgd-onzU.js +0 -220
  132. package/dist/user-BcDUmNrZ.js +0 -55
  133. package/dist/vue-i18n-DNBGmwox.js +0 -2365
  134. package/dist/xlsx-BX-U0_Au.js +0 -15491
  135. package/dist/zod-Mx51GBPY.js +0 -91
@@ -1,97 +0,0 @@
1
- import { defineComponent as C, ref as F, computed as g, resolveComponent as s, openBlock as u, createBlock as m, unref as d, withCtx as c, createVNode as p, normalizeClass as i, createCommentVNode as V, createElementVNode as k, toDisplayString as b, renderSlot as q, createElementBlock as S, Fragment as I, renderList as M } from "vue";
2
- const B = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, z = /* @__PURE__ */ C({
3
- __name: "ChipMenu",
4
- props: {
5
- modelValue: {
6
- type: Object,
7
- required: !1
8
- },
9
- label: {
10
- type: String,
11
- required: !0
12
- },
13
- showItemLabel: {
14
- type: Boolean,
15
- default: !1
16
- },
17
- placement: {
18
- type: String,
19
- required: !1,
20
- default: "bottom-end"
21
- },
22
- class: {
23
- type: String,
24
- required: !1
25
- },
26
- disabled: {
27
- type: Boolean,
28
- required: !1
29
- },
30
- items: {
31
- type: Array,
32
- required: !1
33
- },
34
- icon: {
35
- type: String,
36
- required: !1
37
- }
38
- },
39
- emits: ["update:model-value"],
40
- setup(a, { emit: f }) {
41
- const e = a, v = f, r = F(!1), y = g(
42
- () => {
43
- var n, t;
44
- return (t = (n = e.items) == null ? void 0 : n.find((o) => o.value === e.modelValue)) == null ? void 0 : t.label;
45
- }
46
- );
47
- return (n, t) => {
48
- const o = s("FmIcon"), _ = s("FmChip"), h = s("FmMenuItem"), w = s("FmMenu");
49
- return u(), m(w, {
50
- placement: a.placement || "bottom-end",
51
- disabled: a.disabled == !0,
52
- "model-value": d(r),
53
- onMenuChanged: t[0] || (t[0] = (l) => r.value = l)
54
- }, {
55
- "menu-button": c(() => [
56
- p(_, {
57
- label: e.label,
58
- class: i(e.class || "text-fm-color-neutral-gray-400 cursor-pointer")
59
- }, {
60
- default: c(() => [
61
- e.icon ? (u(), m(o, {
62
- key: 0,
63
- name: e.icon,
64
- class: i(e.class),
65
- outline: "",
66
- size: "sm"
67
- }, null, 8, ["name", "class"])) : V("", !0),
68
- k("div", B, b(e.label) + " " + b(a.showItemLabel ? d(y) : ""), 1),
69
- p(o, {
70
- name: d(r) ? "keyboard_arrow_up" : "keyboard_arrow_down",
71
- class: i(e.class),
72
- outline: "",
73
- size: "sm"
74
- }, null, 8, ["name", "class"])
75
- ]),
76
- _: 1
77
- }, 8, ["label", "class"])
78
- ]),
79
- default: c(() => [
80
- q(n.$slots, "default", {}, () => [
81
- (u(!0), S(I, null, M(e.items ?? [], (l) => (u(), m(h, {
82
- key: l.value,
83
- value: l.value,
84
- label: l.label,
85
- "model-value": e.modelValue === l.value,
86
- "onUpdate:modelValue": (x) => v("update:model-value", l.value)
87
- }, null, 8, ["value", "label", "model-value", "onUpdate:modelValue"]))), 128))
88
- ])
89
- ]),
90
- _: 3
91
- }, 8, ["placement", "disabled", "model-value"]);
92
- };
93
- }
94
- });
95
- export {
96
- z as _
97
- };
@@ -1,540 +0,0 @@
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-CNKP1_IW.js";
8
- import { J as me } from "./JsonViewer-v8_C7l5N.js";
9
- import { u as le } from "./loading-Dfr_97Ri.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-CtoHyXVT.js";
13
- import { e as b } from "./index-vh86FiIQ.js";
14
- import { u as J, w as ve } from "./xlsx-BX-U0_Au.js";
15
- import { u as he, _ as be } from "./usePagination-Dgd-onzU.js";
16
- import { c as te } from "./plugins-BVGqEmE1.js";
17
- import { m as Ce } from "./index-zF0gIg9H.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
- };