@feedmepos/mf-connect 0.0.5-beta.20 → 0.0.5-beta.21

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 (67) hide show
  1. package/dist/{Analytic-DUWe-WYz.js → Analytic-CVpCpEBl.js} +12 -13
  2. package/dist/{Broadcast-CAmI-dS9.js → Broadcast-C0SHdFpT.js} +11 -12
  3. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CQbePPyW.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B94-nKP4.js} +8 -8
  4. package/dist/Card-C5yXOEhK.js +827 -0
  5. package/dist/Collections-Ka_q_V3S.js +424 -0
  6. package/dist/{Credit-CxyIk-mH.js → Credit-CmTa3hjm.js} +11 -12
  7. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-AGQwe70B.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CNSfNMA_.js} +23 -24
  8. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-y263YYGy.js → EffectSheet.vue_vue_type_style_index_0_lang-BLfzJ46z.js} +5 -5
  9. package/dist/{Experience-DH6nbWal.js → Experience-yd4ZPBXy.js} +11 -12
  10. package/dist/{Game-BGMGl6Uw.js → Game-DYTplwOh.js} +22 -23
  11. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-rs3BEnpo.js → ImageInput.vue_vue_type_script_setup_true_lang-BuuYdlE4.js} +1 -1
  12. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-BIwBZ7FH.js → LottieAnimation.vue_vue_type_script_setup_true_lang-BfWuKa1w.js} +1 -1
  13. package/dist/{MainLayout-CjvNB4RK.js → MainLayout-8tc3ZtLI.js} +2 -2
  14. package/dist/{Marketing-BLbR9_KN.js → Marketing-D5Le-SWn.js} +19 -20
  15. package/dist/{Member-BqPHWUos.js → Member-CzY5Um_y.js} +2 -2
  16. package/dist/{MemberList-DoBv4aBY.js → MemberList-DpFa2ttF.js} +20 -21
  17. package/dist/{MemberTransactions-Cri3UCrX.js → MemberTransactions-CDKkRdfp.js} +4 -4
  18. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang--qiv_ZUS.js → MessageInput.vue_vue_type_script_setup_true_lang-BD27S5wB.js} +4 -4
  19. package/dist/{Mission-BXRMH__V.js → Mission-9BmMMzyr.js} +25 -26
  20. package/dist/{Point-MS30HaX7.js → Point-IiWgZIyI.js} +11 -12
  21. package/dist/{Promotion-BuOELg3x.js → Promotion-BmEQ28sH.js} +42 -44
  22. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CAnO-3XN.js → RuleGroup.vue_vue_type_script_setup_true_lang-BhOoz0HL.js} +12 -12
  23. package/dist/{Segment-C9s9hDBX.js → Segment-D1ID4Rmt.js} +39 -40
  24. package/dist/{Setting-CHk3QEsN.js → Setting-B3WeabHJ.js} +17 -18
  25. package/dist/{Store-CQWAs4Ew.js → Store-CKFLaYKH.js} +18 -19
  26. package/dist/{StoreRewards-DJkh42Es.js → StoreRewards-DIQL173Q.js} +27 -28
  27. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B2kjcViv.js +794 -0
  28. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CEBqSaBp.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-C1QmPELI.js} +1 -1
  29. package/dist/{Tier-3zGwCsja.js → Tier-BvE47ciZ.js} +43 -43
  30. package/dist/{Title-TotAXw2n.js → Title-DfcczCHg.js} +42 -42
  31. package/dist/Transaction-CF0f3QCU.js +36 -0
  32. package/dist/Voucher-CCOZjT6k.js +481 -0
  33. package/dist/{app--rCS8dWb.js → app-B4oDOeXm.js} +1456 -1456
  34. package/dist/app.js +1 -1
  35. package/dist/{campaign-BPWXzTLO.js → campaign-BWwTQs_d.js} +2 -2
  36. package/dist/{collection.fn-NFB67-6j.js → collection.fn-C5XN0PPR.js} +2 -2
  37. package/dist/{dto-ChVvY7GG.js → dto-Ktuw3JiD.js} +138 -139
  38. package/dist/{effect-CbwZuhWY.js → effect-BM2dJl1a.js} +1 -1
  39. package/dist/export-LApNX--r.js +97 -0
  40. package/dist/{helper-D16-sxkv.js → helper-BUC1dAUX.js} +1 -1
  41. package/dist/{index-EmqFPQGb.js → index-B6GvsaDA.js} +1 -1
  42. package/dist/{index-DlqRXSLU.js → index-BZMMIcyM.js} +1 -1
  43. package/dist/{index-Blbjd5Y9.js → index-Bc-r4pik.js} +5 -5
  44. package/dist/{index-CGTaSvN6.js → index-Bt_xFt9g.js} +1 -1
  45. package/dist/{index-D-bPAs1d.js → index-C7qI5flU.js} +2 -2
  46. package/dist/{index-Dh6x04Wk.js → index-C86T8VON.js} +2 -2
  47. package/dist/{index-C7SZ9gvu.js → index-CvZ_MhCE.js} +7 -7
  48. package/dist/{index-vsgk07Y2.js → index-CzVShOLS.js} +1 -1
  49. package/dist/{index-BGAWJ6-h.js → index-DSUUVWFu.js} +3 -3
  50. package/dist/{index--VC0kdJZ.js → index-DVJQt0_Q.js} +2 -2
  51. package/dist/{plugins-Ccv9TIl4.js → loading-CM3ZyteE.js} +8204 -8108
  52. package/dist/{lodash-7Fz14kKI.js → lodash-DYMRs712.js} +1 -1
  53. package/dist/{membership-ByQds6Nb.js → membership-D0Z9EBWi.js} +3 -3
  54. package/dist/{money-DsiT1-aV.js → money-Cyt6uuok.js} +1 -1
  55. package/dist/{number-D4SI_vwy.js → number-CSBV_14_.js} +1 -1
  56. package/dist/{rule-NzJI8lrC.js → rule-C4ovkUox.js} +2 -2
  57. package/dist/{rule-builder-CNz0WgMq.js → rule-builder-DxDhft7B.js} +1 -1
  58. package/dist/{template-9wDwTGR-.js → template-Dd9xYS-m.js} +6 -6
  59. package/dist/{usePagination-CsZrmXsU.js → usePagination-cObe7G1g.js} +1 -1
  60. package/dist/{xlsx-CUa5ix7U.js → xlsx--baqnGDY.js} +1 -1
  61. package/package.json +1 -1
  62. package/dist/Card-DhgETjhz.js +0 -914
  63. package/dist/Collections-9fPXIR34.js +0 -424
  64. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-1GgzlIRZ.js +0 -693
  65. package/dist/Transaction-gV9vaJCR.js +0 -34
  66. package/dist/Voucher-BJ-pXo7Y.js +0 -449
  67. package/dist/loading-B5tUSWjN.js +0 -100
@@ -1,34 +0,0 @@
1
- import { defineComponent as p, ref as d, resolveComponent as n, openBlock as t, createElementBlock as f, Fragment as v, createVNode as c, createElementVNode as b, unref as a, createBlock as s, resolveDynamicComponent as m, createCommentVNode as k } from "vue";
2
- import { _ as x, a as C } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-1GgzlIRZ.js";
3
- const F = { class: "px-24 flex flex-col gap-y-32 pb-24" }, B = /* @__PURE__ */ p({
4
- __name: "Transaction",
5
- setup(T) {
6
- const o = [
7
- {
8
- label: "Collection",
9
- value: "collection"
10
- },
11
- {
12
- label: "Store",
13
- value: "store"
14
- }
15
- ], e = d(o[0]);
16
- return (g, l) => {
17
- const r = n("FmPageHead"), u = n("FmTabs");
18
- return t(), f(v, null, [
19
- c(r, { title: "Transactions" }),
20
- b("div", F, [
21
- c(u, {
22
- "model-value": a(e).value,
23
- items: o,
24
- "onUpdate:modelValue": l[0] || (l[0] = (i) => e.value = o.find((_) => _.value === i))
25
- }, null, 8, ["model-value"]),
26
- a(e).value == "collection" ? (t(), s(m(x), { key: 0 })) : a(e).value == "store" ? (t(), s(m(C), { key: 1 })) : k("", !0)
27
- ])
28
- ], 64);
29
- };
30
- }
31
- });
32
- export {
33
- B as default
34
- };
@@ -1,449 +0,0 @@
1
- import { defineComponent as N, ref as g, watch as H, onMounted as D, resolveComponent as d, openBlock as _, createBlock as U, unref as o, isRef as O, withCtx as V, createElementVNode as l, createVNode as i, toDisplayString as I, computed as Q, createElementBlock as B, Fragment as A, renderList as W, resolveDynamicComponent as Z, h as y } from "vue";
2
- import { _ as Y } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as ee, components as S } from "@feedmepos/ui-library";
4
- import { p as z, c as ae } from "./plugins-Ccv9TIl4.js";
5
- import { useCoreStore as oe } from "@feedmepos/mf-common";
6
- import { u as q } from "./loading-B5tUSWjN.js";
7
- import { u as te, J as ne, a as se, R as le } from "./app--rCS8dWb.js";
8
- import { u as ie } from "./campaign-BPWXzTLO.js";
9
- import { g as K, b as j } from "./dto-ChVvY7GG.js";
10
- import { u as re } from "./template-9wDwTGR-.js";
11
- import { _ as ce } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-AGQwe70B.js";
12
- import { _ as me } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
13
- import { l as ue } from "./lodash-7Fz14kKI.js";
14
- import { m as de } from "./index-CGTaSvN6.js";
15
- import { c as x } from "./index-DlqRXSLU.js";
16
- import { useRouter as pe } from "vue-router";
17
- const fe = { class: "space-y-16" }, he = { class: "fm-typo-en-body-md-600" }, ge = { class: "flex items-center justify-end" }, ye = { class: "flex items-center gap-8" }, ve = /* @__PURE__ */ N({
18
- __name: "SendVoucherSheet",
19
- emits: ["success"],
20
- setup(X, { expose: L, emit: F }) {
21
- const { minor: M } = q, k = g(""), r = g({}), P = F, p = g(!1), u = g([]);
22
- function m(e) {
23
- p.value = !0, k.value = e.campaignId;
24
- }
25
- function v() {
26
- p.value = !1;
27
- }
28
- const $ = [
29
- {
30
- header: "Name",
31
- accessorFn: (e) => e.name || "No Profile"
32
- },
33
- {
34
- header: "Phone",
35
- accessorFn: (e) => e.phoneNumber || "-"
36
- }
37
- ], s = g({
38
- searchValue: "",
39
- pageSize: 10,
40
- pageCount: 0,
41
- pageIndex: 0,
42
- totalRows: 0,
43
- isLoading: !1
44
- }), f = g([]), b = async (e) => {
45
- s.value.isLoading = !0, f.value = [];
46
- const a = await de.read({
47
- limit: e.pageSize,
48
- skip: e.pageIndex * e.pageSize,
49
- sortBy: "_id",
50
- search: s.value.searchValue,
51
- descending: !1
52
- });
53
- f.value = a.resources, s.value.totalRows = a.meta.totalResources ?? 0, s.value.pageCount = a.meta.totalPages ?? 0, s.value.isLoading = !1, r.value = {}, u.value.forEach((t) => {
54
- const c = f.value.findIndex((C) => C._id == t);
55
- c > -1 && (console.log(c, "fetch member index"), r.value[c] = !0);
56
- });
57
- };
58
- function w() {
59
- f.value.length > 0 && (u.value = u.value.filter(
60
- (e) => f.value.some((a) => a._id != e)
61
- ));
62
- for (const [e, a] of Object.entries(r.value)) {
63
- const t = f.value[e]._id;
64
- u.value.includes(t) || u.value.push(t);
65
- }
66
- }
67
- async function E(e) {
68
- u.value.length < 1 || await M(
69
- async () => {
70
- await x.sendCollection(k.value, {
71
- memberId: u.value
72
- }), await P("success"), v();
73
- },
74
- {
75
- message: "Sending claim(s)",
76
- successMessage: "Claim(s) created"
77
- }
78
- );
79
- }
80
- return H(r, w, { deep: !0 }), H(
81
- () => s.value.searchValue,
82
- ue.debounce(async () => {
83
- await b({ pageSize: 10, pageIndex: 0 });
84
- }, 500)
85
- ), L({
86
- showSheet: m,
87
- hideSheet: v
88
- }), D(async () => {
89
- await b(s.value);
90
- }), (e, a) => {
91
- const t = d("FmSearch"), c = d("FmTable"), C = d("FmButton"), R = d("FmSideSheet");
92
- return _(), U(R, {
93
- "max-width": 560,
94
- "dismiss-away": !0,
95
- header: "Send voucher to",
96
- modelValue: o(p),
97
- "onUpdate:modelValue": [
98
- a[3] || (a[3] = (h) => O(p) ? p.value = h : null),
99
- a[4] || (a[4] = (h) => p.value = h)
100
- ]
101
- }, {
102
- "side-sheet-footer": V(() => [
103
- l("div", ye, [
104
- i(C, {
105
- label: "Send",
106
- loading: o(te)().isLoading,
107
- onClick: E
108
- }, null, 8, ["loading"]),
109
- i(C, {
110
- label: "Cancel",
111
- type: "button",
112
- variant: "tertiary",
113
- onClick: a[2] || (a[2] = (h) => p.value = !1)
114
- })
115
- ])
116
- ]),
117
- default: V(() => [
118
- i(ne, { json: o(u) }, null, 8, ["json"]),
119
- l("div", fe, [
120
- l("div", he, I(o(u).length) + " members selected ", 1),
121
- l("div", ge, [
122
- i(t, {
123
- class: "mt-4",
124
- modelValue: o(s).searchValue,
125
- "onUpdate:modelValue": a[0] || (a[0] = (h) => o(s).searchValue = h),
126
- placeholder: "Search Member",
127
- collapsible: ""
128
- }, null, 8, ["modelValue"])
129
- ]),
130
- i(c, {
131
- modelValue: o(r),
132
- "onUpdate:modelValue": a[1] || (a[1] = (h) => O(r) ? r.value = h : null),
133
- class: "xs:hidden",
134
- selection: "multiple",
135
- loading: o(s).isLoading,
136
- "row-data": o(f),
137
- "column-defs": $,
138
- "page-size": o(s).pageSize,
139
- "page-count": o(s).pageCount,
140
- "hide-footer": o(s).totalRows <= o(s).pageSize,
141
- "fetch-fn": b
142
- }, null, 8, ["modelValue", "loading", "row-data", "page-size", "page-count", "hide-footer"])
143
- ])
144
- ]),
145
- _: 1
146
- }, 8, ["modelValue"]);
147
- };
148
- }
149
- });
150
- var _e = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedmedev.cc", crmUrl: "crm.feedmedev.cc", paymentPortalUrl: "https://portal.feedmedev.cc/payment/payout-account", marketingV1Portal: "https://marketing-v1.feedmedev.cc" };
151
- const be = { class: "px-24 flex flex-col gap-y-16" }, we = { class: "flex items-center justify-between w-full" }, Ce = { class: "flex gap-8 overflow-x-auto" }, Se = { class: "space-y-8" }, xe = { class: "flex w-full gap-4 items-center" }, Ve = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Fe = { class: "space-y-4" }, ke = { class: "fm-typo-en-body-lg-600" }, Re = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ue = /* @__PURE__ */ l("img", {
152
- src: Y,
153
- class: "aspect-square w-[150px]"
154
- }, null, -1), Ie = /* @__PURE__ */ l("div", { class: "flex flex-col gap-16 text-center" }, [
155
- /* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800" }, "Create voucher campaign"),
156
- /* @__PURE__ */ l("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " A digital coupon that users can redeem for discounts on future purchases. Users usually need to claim and apply the voucher to benefit from the discount. ")
157
- ], -1), Xe = /* @__PURE__ */ N({
158
- __name: "Voucher",
159
- setup(X) {
160
- const L = {
161
- label: "Create campaign",
162
- value: "create",
163
- isPrimary: !0,
164
- prependIcon: "add"
165
- }, F = ee(), M = re("VOUCHER", F), k = se(), r = ie(), { global: P, minor: p } = q, u = pe(), m = g({
166
- searchKey: "",
167
- location: null
168
- }), v = Q(
169
- () => r.campaigns.voucher.filter(
170
- (e) => !m.value.location || !e.targetLocation || e.targetLocation.includes(m.value.location)
171
- )
172
- ), $ = [
173
- {
174
- header: "Voucher title",
175
- accessorFn: (e) => e.name
176
- },
177
- {
178
- header: "Status",
179
- cell(e) {
180
- return K(e.row.original);
181
- }
182
- },
183
- {
184
- header: "Summary",
185
- accessorFn: (e) => j(e)
186
- },
187
- {
188
- header: "Quota",
189
- accessorFn: (e) => {
190
- var a;
191
- return ((a = e.pf_collectible) == null ? void 0 : a.options.maxReceive) ?? "Unlimited";
192
- }
193
- },
194
- {
195
- header: "Claimed",
196
- accessorFn: (e) => {
197
- var a;
198
- return ((a = e == null ? void 0 : e.pf_collectible) == null ? void 0 : a.currentReceive) ?? 0;
199
- }
200
- },
201
- {
202
- header: "Actions",
203
- cell(e) {
204
- return y("div", { class: "flex items-center justify-end" }, [
205
- y(S.FmButton, {
206
- icon: "visibility",
207
- variant: "tertiary",
208
- iconColor: "neutral-gray-400",
209
- onClick: async (a) => {
210
- a.stopPropagation(), await u.push({
211
- name: le["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
212
- params: { id: e.row.original._id }
213
- });
214
- }
215
- }),
216
- y(
217
- S.FmMenu,
218
- {
219
- placement: "bottom-end",
220
- onClick: (a) => {
221
- a.stopPropagation();
222
- }
223
- },
224
- {
225
- "menu-button": () => y(S.FmButton, {
226
- icon: "more_vert",
227
- iconColor: "neutral-gray-400",
228
- variant: "tertiary"
229
- }),
230
- default: () => {
231
- const a = [
232
- y(
233
- S.FmMenuItem,
234
- {
235
- onClick: async (t) => {
236
- t.stopPropagation(), b(e.row.original);
237
- }
238
- },
239
- {
240
- label: y(
241
- "div",
242
- {
243
- class: "text-fm-color-typo-error fm-typo-en-body-md-400"
244
- },
245
- "Remove"
246
- )
247
- }
248
- )
249
- ];
250
- return e.row.original.event.type === "SIMPLE_CLAIM" && (a.unshift(
251
- y(S.FmMenuItem, {
252
- label: "Send",
253
- onClick: async (t) => {
254
- var c;
255
- t.stopPropagation(), (c = f.value) == null || c.showSheet({
256
- campaignId: e.row.original._id
257
- });
258
- }
259
- })
260
- ), a.unshift(
261
- y(S.FmMenuItem, {
262
- label: "Share",
263
- onClick: async (t) => {
264
- if (t.stopPropagation(), e.row.original.event.type !== "SIMPLE_CLAIM")
265
- return await z.confirm(
266
- "Cannot share a voucher that is not a simple claim.",
267
- "Share Voucher",
268
- "OK"
269
- );
270
- await ae(
271
- `https://${oe().currentBusiness.value._id}.${_e.appUrl}/vouchers/${e.row.original._id}`,
272
- {
273
- successMessage: "Voucher link copied to clipboard"
274
- }
275
- );
276
- }
277
- })
278
- )), a;
279
- }
280
- }
281
- )
282
- ]);
283
- }
284
- }
285
- ], s = g(), f = g();
286
- async function b(e) {
287
- await z.remove(`Are you sure you want to remove ${e.name}?`) && await p(
288
- async () => {
289
- await x.delete(e._id), await r.read("VOUCHER");
290
- },
291
- {
292
- message: `Removing ${e.name}`,
293
- successMessage: `Removed ${e.name} successfully`
294
- }
295
- );
296
- }
297
- async function w(e) {
298
- e ? await a() : M.open(async (t) => {
299
- await a(t);
300
- });
301
- async function a(t) {
302
- var c;
303
- (c = s.value) == null || c.showSheet(
304
- !0,
305
- "VOUCHER",
306
- e ? await x.readById(e._id) : void 0,
307
- t
308
- );
309
- }
310
- }
311
- async function E(e) {
312
- e.campaign._id && await new Promise((a) => {
313
- F.open({
314
- title: "Confirmation",
315
- message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
316
- primaryActions: { text: "Update all", close: !0 },
317
- secondaryActions: { text: "Update future only", close: !0 }
318
- }).onPrimary(async () => {
319
- var t;
320
- e.updateCollections = !0, (t = window.top) == null || t.postMessage("updateAllVoucher", "*"), a();
321
- }).onSecondary(async () => {
322
- a();
323
- });
324
- }), await p(
325
- async () => {
326
- e.campaign._id ? await x.update(e.campaign._id, e) : await x.create(e), await r.read("VOUCHER");
327
- },
328
- {
329
- message: `${e.campaign._id ? "Updating" : "Creating"} voucher`,
330
- successMessage: `Voucher ${e.campaign._id ? "updated" : "created"} successfully`
331
- }
332
- );
333
- }
334
- return D(async () => {
335
- await P(async () => {
336
- await r.read("VOUCHER");
337
- });
338
- }), (e, a) => {
339
- const t = d("FmPageHead"), c = d("FmSearch"), C = d("FmTable"), R = d("FmButton"), h = d("FmListItem"), G = d("FmList"), J = d("FmCard");
340
- return _(), B(A, null, [
341
- i(t, {
342
- title: "Voucher",
343
- actions: o(v).length > 0 ? [L] : [],
344
- "onClick:action": a[0] || (a[0] = () => w())
345
- }, null, 8, ["actions"]),
346
- l("div", be, [
347
- i(c, {
348
- modelValue: o(m).searchKey,
349
- "onUpdate:modelValue": a[1] || (a[1] = (n) => o(m).searchKey = n),
350
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
351
- placeholder: "search",
352
- collapsible: ""
353
- }, null, 8, ["modelValue"]),
354
- o(r).campaigns.voucher && o(r).campaigns.voucher.length > 0 ? (_(), B(A, { key: 0 }, [
355
- l("div", we, [
356
- l("div", Ce, [
357
- i(me, {
358
- modelValue: o(m).location,
359
- "onUpdate:modelValue": a[2] || (a[2] = (n) => o(m).location = n),
360
- label: "Location: ",
361
- "show-item-label": !0,
362
- icon: "storefront",
363
- placement: "bottom-start",
364
- items: o(k).locationItems
365
- }, null, 8, ["modelValue", "items"])
366
- ]),
367
- i(c, {
368
- modelValue: o(m).searchKey,
369
- "onUpdate:modelValue": a[3] || (a[3] = (n) => o(m).searchKey = n),
370
- class: "xs:hidden",
371
- placeholder: "search",
372
- collapsible: ""
373
- }, null, 8, ["modelValue"])
374
- ]),
375
- i(C, {
376
- class: "xs:hidden",
377
- "row-data": o(v),
378
- "column-defs": $,
379
- "search-value": o(m).searchKey,
380
- "column-filter": [],
381
- onRowClick: a[4] || (a[4] = (n) => w(n.original)),
382
- "hide-footer": o(v).length < 10
383
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
384
- i(G, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
385
- default: V(() => [
386
- (_(!0), B(A, null, W(o(v).filter(
387
- (n) => n.name.toLowerCase().includes(o(m).searchKey.toLowerCase())
388
- ), (n) => (_(), U(h, {
389
- key: n._id.toString(),
390
- onClick: (T) => w(n),
391
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
392
- }, {
393
- default: V(() => [
394
- l("div", Se, [
395
- l("div", xe, [
396
- (_(), U(Z(o(K)(n)))),
397
- l("div", Ve, I(n.currentReceive ?? 0) + " used ", 1)
398
- ]),
399
- l("div", Fe, [
400
- l("div", ke, I(n.name), 1),
401
- l("div", Re, I(o(j)(n)), 1)
402
- ])
403
- ]),
404
- i(R, {
405
- icon: "delete",
406
- "icon-color": "neutral-gray-400",
407
- variant: "tertiary",
408
- onClick: (T) => (T.stopPropagation(), b(n))
409
- }, null, 8, ["onClick"])
410
- ]),
411
- _: 2
412
- }, 1032, ["onClick"]))), 128))
413
- ]),
414
- _: 1
415
- })
416
- ], 64)) : (_(), U(J, {
417
- key: 1,
418
- variant: "outlined",
419
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
420
- }, {
421
- default: V(() => [
422
- Ue,
423
- Ie,
424
- i(R, {
425
- variant: "primary",
426
- label: "Create voucher campaign",
427
- icon: "add",
428
- onClick: a[5] || (a[5] = (n) => w())
429
- })
430
- ]),
431
- _: 1
432
- })),
433
- i(ce, {
434
- ref_key: "sheetRef",
435
- ref: s,
436
- "onSubmit:modelValue": E
437
- }, null, 512),
438
- i(ve, {
439
- ref_key: "sendVoucherSheetRef",
440
- ref: f
441
- }, null, 512)
442
- ])
443
- ], 64);
444
- };
445
- }
446
- });
447
- export {
448
- Xe as default
449
- };
@@ -1,100 +0,0 @@
1
- import { u as h } from "./app--rCS8dWb.js";
2
- import { n as d } from "./plugins-Ccv9TIl4.js";
3
- function y(e, s) {
4
- let a = "", r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
5
- const u = r.length;
6
- for (let l = 0; l < e; l++)
7
- a += r.charAt(Math.floor(Math.random() * u));
8
- return a;
9
- }
10
- const S = {
11
- alphabetOnly(e) {
12
- return e.replace(/[^a-zA-Z]/g, "");
13
- },
14
- alphaNumeric(e) {
15
- return e.replace(/[^a-zA-Z0-9]/g, "");
16
- },
17
- numericOnly(e) {
18
- return e.replace(/[^0-9]/g, "");
19
- },
20
- singularOrPlural(e, s, a) {
21
- const r = e > 1 ? a || `${s}s` : s;
22
- return `${e} ${r}`;
23
- }
24
- }, I = {
25
- title: (e) => e.replace(
26
- /\b\w+/g,
27
- (s) => s.charAt(0).toUpperCase() + s.substring(1).toLowerCase()
28
- )
29
- };
30
- async function p(e, s) {
31
- var u, l;
32
- let a = [];
33
- !s || !s.customId ? a.push(`${(/* @__PURE__ */ new Date()).toISOString()}_${y(6)}`) : typeof s.customId == "string" ? a.push(s.customId) : a = s.customId;
34
- const r = h();
35
- r.addLoadingQueues(
36
- a.map((t) => ({
37
- id: t,
38
- isGlobal: (s == null ? void 0 : s.isGlobal) || !1
39
- }))
40
- );
41
- try {
42
- const t = await e();
43
- return await ((u = s == null ? void 0 : s.onSuccess) == null ? void 0 : u.call(s, t)), t;
44
- } catch (t) {
45
- const m = t instanceof Error ? t.message : `${t}`;
46
- throw s != null && s.onError ? await s.onError(m) : d.error(m), t;
47
- } finally {
48
- r.resolveQueues(a), (l = s == null ? void 0 : s.onComplete) == null || l.call(s);
49
- }
50
- }
51
- const M = {
52
- checkIsLoading: (e) => h().loadingQueue.some((s) => s.id === e),
53
- global: async (e, s) => await p(
54
- async () => await e(),
55
- {
56
- isGlobal: !0,
57
- onSuccess: async (a) => {
58
- var r;
59
- await ((r = s == null ? void 0 : s.onSuccess) == null ? void 0 : r.call(s, a)), s != null && s.successMessage && d.success(s == null ? void 0 : s.successMessage);
60
- }
61
- }
62
- ),
63
- minor: async (e, s) => {
64
- var r;
65
- let a;
66
- return s != null && s.message && (a = d.info((r = s == null ? void 0 : s.message) == null ? void 0 : r.toString(), null, !0)), await p(
67
- async () => (s != null && s.isLoading && (s.isLoading.value = !0), await e()),
68
- {
69
- onSuccess: () => {
70
- s != null && s.successMessage && d.success((s == null ? void 0 : s.successMessage) || "Success");
71
- },
72
- onError: (u) => {
73
- const l = `${u}` || "Error";
74
- d.error(l);
75
- },
76
- onComplete: () => {
77
- s != null && s.isLoading && (s.isLoading.value = !1), a && d.close(a);
78
- },
79
- customId: s == null ? void 0 : s.customId
80
- }
81
- );
82
- },
83
- custom: async (e, s) => await p(
84
- async () => (s != null && s.isLoading && (s.isLoading.value = !0), await e()),
85
- {
86
- onSuccess: async () => {
87
- s != null && s.successMessage && d.success(s.successMessage);
88
- },
89
- onComplete: () => {
90
- s && s.isLoading && (s.isLoading.value = !1);
91
- },
92
- customId: s == null ? void 0 : s.customId
93
- }
94
- )
95
- };
96
- export {
97
- I as c,
98
- S as f,
99
- M as u
100
- };