@feedmepos/mf-connect 0.1.38-beta.52 → 0.1.38-beta.53

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 (130) hide show
  1. package/package.json +2 -2
  2. package/dist/Analytic-BU1mOMoX.js +0 -760
  3. package/dist/App-fw6iFNxW.js +0 -4638
  4. package/dist/AuditLogs-CliU8167.js +0 -1887
  5. package/dist/Bin-C49tzfas.js +0 -166
  6. package/dist/Broadcast-YZVnZTCD.js +0 -232
  7. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DEwsZags.js +0 -122
  8. package/dist/Card-DcQQyJl9.js +0 -911
  9. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
  10. package/dist/Collections--8lmoXWR.js +0 -540
  11. package/dist/Credit-CfkLFMei.js +0 -227
  12. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
  13. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  14. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-t6eac8yR.js +0 -3151
  15. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CXVOuiLI.js +0 -347
  16. package/dist/Experience-BnVVC2-L.js +0 -228
  17. package/dist/FileSaver.min-NlMItPOc.js +0 -74
  18. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  19. package/dist/Game-Dbz4DzY_.js +0 -297
  20. package/dist/Grab-CCqScmpp.js +0 -300
  21. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-C5irH9v6.js +0 -145
  22. package/dist/Index-DPsM9D4W.js +0 -259
  23. package/dist/JsonViewer-v8_C7l5N.js +0 -87
  24. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +0 -18737
  25. package/dist/MainLayout-B1aJoR95.js +0 -41
  26. package/dist/Marketing-CFwxWdJq.js +0 -21761
  27. package/dist/Member-ZPKbf5Bk.js +0 -281
  28. package/dist/MemberList-BDs-70nG.js +0 -1607
  29. package/dist/MemberOverview-wL_ailso.js +0 -58
  30. package/dist/MemberTransactions-C-zHpuZF.js +0 -45
  31. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-B2TKmOOK.js +0 -60616
  32. package/dist/Mission-BHkb1E9m.js +0 -301
  33. package/dist/Overview-DYlcqNCX.js +0 -1079
  34. package/dist/Point-BEhNBY2_.js +0 -231
  35. package/dist/Promotion-DOXRIej4.js +0 -363
  36. package/dist/Queue-Bwa0LWhf.js +0 -260
  37. package/dist/Record-BoI8l1Qq.js +0 -341
  38. package/dist/Reward-BVQaqAYM.js +0 -442
  39. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-BC3dEiWi.js +0 -150
  40. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-HpleMvjm.js +0 -1767
  41. package/dist/Segment-Cmy7nu27.js +0 -882
  42. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-pab6X2DC.js +0 -181
  43. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-BqIh8D8O.js +0 -189
  44. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-CESoNd87.js +0 -147
  45. package/dist/Setting-DN8j_6Xv.js +0 -1993
  46. package/dist/SettingAdvertisements-qHdiaa6m.js +0 -264
  47. package/dist/Store-DfhVYCgX.js +0 -1936
  48. package/dist/StoreRewards-NYucFLJU.js +0 -535
  49. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BGOcOAXR.js +0 -1036
  50. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DRin8Jzw.js +0 -8093
  51. package/dist/Tier-Dl0aBuJz.js +0 -970
  52. package/dist/Title-DvO6Mira.js +0 -568
  53. package/dist/Transaction-ONVl4UZZ.js +0 -39
  54. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-FyE25D8o.js +0 -130
  55. package/dist/Voucher-BZ1feYh1.js +0 -399
  56. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-Lilql8J4.js +0 -421
  57. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-C_ZdCOPI.js +0 -56
  58. package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
  59. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  60. package/dist/app-B_RRkjaD.js +0 -42566
  61. package/dist/app-wDQR6dpb.js +0 -39
  62. package/dist/app.js +0 -7
  63. package/dist/business-y5qSMcd-.js +0 -82
  64. package/dist/campaign-CpzFl8Vr.js +0 -4
  65. package/dist/campaign-DHgol2Lt.js +0 -219
  66. package/dist/campaign-Drxe0zPX.js +0 -253
  67. package/dist/campaign.enum-CwAPVgPe.js +0 -21
  68. package/dist/campaign.fn-DMx5xsiK.js +0 -776
  69. package/dist/collectible.enum-Bh4jnUgP.js +0 -19
  70. package/dist/collection.fn-BpC_YBwG.js +0 -26
  71. package/dist/dto-DWkf9QOb.js +0 -222
  72. package/dist/effect-D5ZWGpNS.js +0 -78
  73. package/dist/email-addresses-DFtVESS8.js +0 -705
  74. package/dist/export-BtUy3sWU.js +0 -97
  75. package/dist/feedme.ico +0 -0
  76. package/dist/helper-DtWMZoWX.js +0 -86
  77. package/dist/index-7HXC3sH0.js +0 -56
  78. package/dist/index-BQlhmw75.js +0 -3
  79. package/dist/index-BdX7CxUg.js +0 -30076
  80. package/dist/index-BerRe0M3.js +0 -76
  81. package/dist/index-BrZ3xZzk.js +0 -146
  82. package/dist/index-CJzBpsBP.js +0 -3412
  83. package/dist/index-CQiABpeB.js +0 -32456
  84. package/dist/index-CqIWlGW3.js +0 -38
  85. package/dist/index-CsaQJMAR.js +0 -66
  86. package/dist/index-DPCDboPA.js +0 -32
  87. package/dist/index-DPaH8jaV.js +0 -8884
  88. package/dist/index-Dkce3JZ_.js +0 -54
  89. package/dist/index-DrYv_gG4.js +0 -31
  90. package/dist/index-SfJbKfWl.js +0 -2407
  91. package/dist/index-vh86FiIQ.js +0 -10
  92. package/dist/index.esm2017-CbvE5vCC.js +0 -3069
  93. package/dist/loading-BWGIK17X.js +0 -71
  94. package/dist/lodash-B5I3zXaY.js +0 -3678
  95. package/dist/membership-Zy2P6O6X.js +0 -235
  96. package/dist/moment-D7p2TMB-.js +0 -2583
  97. package/dist/money-D_fZmBbi.js +0 -15
  98. package/dist/number-C4DhXkCm.js +0 -12
  99. package/dist/object-qECH92oz.js +0 -26
  100. package/dist/objectId-dwaoBfJX.js +0 -7
  101. package/dist/objectid-C6eRcDzI.js +0 -145
  102. package/dist/plugins-DDAJav2s.js +0 -1817
  103. package/dist/reward-Dxjvmy7-.js +0 -36
  104. package/dist/rule-builder-ZkPWAiTl.js +0 -102
  105. package/dist/rule-sclqeiyk.js +0 -1951
  106. package/dist/style.css +0 -4
  107. package/dist/template-CAs0lkTY.js +0 -188
  108. package/dist/tier-BJDhpH6X.js +0 -4
  109. package/dist/tiers/tier=1.png +0 -0
  110. package/dist/tiers/tier=2.png +0 -0
  111. package/dist/tiers/tier=3.png +0 -0
  112. package/dist/tiers/tier=4.png +0 -0
  113. package/dist/timezone-5t8ki0gE.js +0 -1151
  114. package/dist/titles/type=diamond.png +0 -0
  115. package/dist/titles/type=drinks.png +0 -0
  116. package/dist/titles/type=food.png +0 -0
  117. package/dist/titles/type=heart.png +0 -0
  118. package/dist/titles/type=medal.png +0 -0
  119. package/dist/titles/type=spend.png +0 -0
  120. package/dist/titles/type=thank-you.png +0 -0
  121. package/dist/titles/type=thumbs-up.png +0 -0
  122. package/dist/titles/type=years.png +0 -0
  123. package/dist/trigger-B2fpKTfg.js +0 -213
  124. package/dist/tslib.es6-BCqqvLQ_.js +0 -44
  125. package/dist/type_drinks-D6jnpvwV.js +0 -4
  126. package/dist/usePagination-Ds-cuHop.js +0 -223
  127. package/dist/user-ORhbAsqi.js +0 -55
  128. package/dist/vue-i18n-cyOhW8mW.js +0 -2365
  129. package/dist/xlsx-4klfjFae.js +0 -15491
  130. package/dist/zod-BsHmzMQd.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-CQiABpeB.js";
8
- import { J as me } from "./JsonViewer-v8_C7l5N.js";
9
- import { u as le } from "./loading-BWGIK17X.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-DHgol2Lt.js";
13
- import { e as b } from "./index-vh86FiIQ.js";
14
- import { u as J, w as ve } from "./xlsx-4klfjFae.js";
15
- import { u as he, _ as be } from "./usePagination-Ds-cuHop.js";
16
- import { a as te } from "./plugins-DDAJav2s.js";
17
- import { m as Ce } from "./index-BrZ3xZzk.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
- };