@feedmepos/mf-connect 0.1.13-prod → 0.1.15-prod

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/{Analytic-CBEDTJ94.js → Analytic-C7qqDS5D.js} +18 -17
  2. package/dist/{App-BcrQs0nE.js → App-DKZYz5r2.js} +68 -64
  3. package/dist/Bin-U7U1Vaju.js +165 -0
  4. package/dist/{Broadcast-ClM81ght.js → Broadcast-BzChnp4V.js} +38 -37
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CTwScH9I.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BELIbS3v.js} +6 -7
  6. package/dist/{Card-B7_nUT03.js → Card-DAfZz7q5.js} +78 -79
  7. package/dist/Collections-joGRHyag.js +445 -0
  8. package/dist/{Credit-DC6pzGIR.js → Credit-N1qDB4XC.js} +57 -56
  9. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DCwaUg09.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-J95iaF7a.js} +27 -27
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-D2qCLBp3.js → EffectSheet.vue_vue_type_style_index_0_lang-DwzQSmst.js} +8 -8
  11. package/dist/{Experience-ClJWQLEB.js → Experience-D5GrDbft.js} +39 -38
  12. package/dist/{Game-BznCxZXt.js → Game-DI7BDPO_.js} +46 -45
  13. package/dist/{Index-D27v-Lqw.js → Index-CbuAJ2dE.js} +9 -9
  14. package/dist/{Marketing-FvYJ_Lt-.js → Marketing-BSqMfy70.js} +5 -5
  15. package/dist/{Member-CQYj0FQK.js → Member-CGd5wNHJ.js} +4 -4
  16. package/dist/MemberList-DnS8KHYF.js +1596 -0
  17. package/dist/MemberTransactions-GAAX3aSV.js +45 -0
  18. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-_72tx6g3.js → MessageInput.vue_vue_type_script_setup_true_lang-Bc2wcibo.js} +5 -5
  19. package/dist/{Mission-LwSpobZu.js → Mission-BVM_1IJ8.js} +35 -34
  20. package/dist/{Overview-PXshmkPD.js → Overview-D2IYZCPn.js} +62 -63
  21. package/dist/{Point-uaIRQMRW.js → Point-B684quZM.js} +51 -50
  22. package/dist/{Promotion-qjos6ksl.js → Promotion-DJOoRnxt.js} +34 -33
  23. package/dist/{Record-qqPaVdrx.js → Record-Bk74XVUj.js} +6 -6
  24. package/dist/{Reward-BC6GJ4kD.js → Reward-BM0AGGL6.js} +35 -35
  25. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CF7hNZIU.js → RewardGroup.vue_vue_type_script_setup_true_lang-CuA2D52B.js} +12 -13
  26. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DQ8rQIwv.js → RuleGroup.vue_vue_type_script_setup_true_lang-Cxv3cZ1v.js} +14 -15
  27. package/dist/{Segment-B5E2FdYc.js → Segment-DqOsH95n.js} +13 -13
  28. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-Dqz3uAze.js → SelectItems.vue_vue_type_script_setup_true_lang-ypjkVZkZ.js} +2 -2
  29. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-Qo0aOTI9.js +147 -0
  30. package/dist/{Setting-CA9PQVKp.js → Setting-D6cRTVUl.js} +31 -31
  31. package/dist/{Store-irRFotGI.js → Store-DqtUurcv.js} +295 -293
  32. package/dist/{StoreRewards-CcJ8MMvp.js → StoreRewards-DPFMA3p9.js} +12 -12
  33. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CYqo5att.js +1105 -0
  34. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-2i2fDWDC.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DxEV-6_4.js} +1 -1
  35. package/dist/{Tier-CdxK-QtB.js → Tier-CFd-HaGX.js} +20 -21
  36. package/dist/{Title-Ci_NXdrD.js → Title-CBktBb5l.js} +20 -21
  37. package/dist/{Transaction-ChKg7UTd.js → Transaction-Bb8UU_lj.js} +2 -2
  38. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-B3INK4Ue.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DBiUmz3C.js} +6 -6
  39. package/dist/Voucher-Bukem4U7.js +353 -0
  40. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-D9wqrTVc.js → VoucherEditor.vue_vue_type_script_setup_true_lang-CTbqVMCn.js} +10 -10
  41. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Di6QPzfu.js → ZodTextField.vue_vue_type_script_setup_true_lang-D8zMv7ks.js} +1 -1
  42. package/dist/{app-B9MkUjRo.js → app-BL2xIPMp.js} +102 -66
  43. package/dist/{app-BmT3kZJr.js → app-CO6FVdHg.js} +1 -1
  44. package/dist/app.js +1 -1
  45. package/dist/{business-1nKmKs9l.js → business-BMTDDe8v.js} +1 -1
  46. package/dist/{dto-DP9kIlr_.js → campaign-C5TEfnWg.js} +610 -818
  47. package/dist/{campaign-xn4PhDSV.js → campaign-CzpECNqa.js} +2 -2
  48. package/dist/{campaign.enum-KwZQ6yBR.js → campaign.enum-CVF3KbJ2.js} +1 -1
  49. package/dist/{campaign.fn-CVj38fae.js → campaign.fn-WT1gfEwK.js} +2 -2
  50. package/dist/{collectible.enum-DojcTb50.js → collectible.enum-BW7-BEa-.js} +3 -3
  51. package/dist/{collection.fn-Bv2EZuA3.js → collection.fn-BRsC9uPP.js} +2 -2
  52. package/dist/dto-B1tWHAjt.js +214 -0
  53. package/dist/{effect-47JS4i8Q.js → effect-4Ov4Jl68.js} +1 -1
  54. package/dist/{email-addresses-C6Jvh8MK.js → email-addresses-L25192f3.js} +1 -1
  55. package/dist/{export-BdPv7Hej.js → export-UEJjaL0g.js} +5 -5
  56. package/dist/{helper-Di0AEV1F.js → helper-BNBSbgdl.js} +1 -1
  57. package/dist/{index-BPkcvPHp.js → index-BWY2o9U9.js} +1 -1
  58. package/dist/index-BnWjqXOJ.js +115 -0
  59. package/dist/{index-D5LMqy6S.js → index-BxwVs3Ot.js} +29 -4
  60. package/dist/index-Cg64BkVG.js +44 -0
  61. package/dist/{index-DHb0pIVR.js → index-ChKwu49G.js} +6 -6
  62. package/dist/{index-Be9fjCVp.js → index-CtY-c-yc.js} +1 -1
  63. package/dist/{index-CVsuhUpe.js → index-D4iYmdD4.js} +12 -13
  64. package/dist/{index-YAoPUv6z.js → index-D8Qn3ZjQ.js} +1 -1
  65. package/dist/{index-gYvuI9Nk.js → index-DpCBCiH_.js} +5 -5
  66. package/dist/{index-BZg5tj39.js → index-DxjXJh5H.js} +3039 -3036
  67. package/dist/{index-BUjGxHkM.js → index-fdv6AHmk.js} +2057 -1010
  68. package/dist/{index-CDmiwLKd.js → index-jf1CG6wc.js} +1 -1
  69. package/dist/{index.esm2017-C-O-0X0H.js → index.esm2017-D-3LEGru.js} +1 -1
  70. package/dist/{loading-E0zwe5lq.js → loading-CUp8ZsA0.js} +4 -4
  71. package/dist/{membership-OECc9rWj.js → membership-DwbiFGd7.js} +6 -6
  72. package/dist/{money-CVSdH00t.js → money-BLrbHrdQ.js} +1 -1
  73. package/dist/{number-Iu6cix1k.js → number--bZt83Nn.js} +1 -1
  74. package/dist/objectid-CCGQh_Y_.js +145 -0
  75. package/dist/{reward-BH_1xbHQ.js → reward-D99cFWcD.js} +1 -1
  76. package/dist/{rule-CbkzOdR3.js → rule-UpH1Y1i5.js} +3 -3
  77. package/dist/{rule-builder-WIEeIoXD.js → rule-builder-ujLy6UTt.js} +1 -1
  78. package/dist/{template-Dlo0YPQp.js → template-FiuUP37O.js} +4 -4
  79. package/dist/{trigger-BMknrXKj.js → trigger-BZYtwSky.js} +13 -13
  80. package/dist/{usePagination-B9K_XXDC.js → usePagination-DDW-s6D3.js} +1 -1
  81. package/dist/{user-CuX5BIg5.js → user-BA3Sw5dU.js} +1 -1
  82. package/dist/{vue-i18n-CrVlAF7z.js → vue-i18n-C5t_xZZj.js} +2 -2
  83. package/package.json +6 -6
  84. package/dist/Collections-N7LIfZ2D.js +0 -435
  85. package/dist/MemberList-UIZANV1T.js +0 -1043
  86. package/dist/MemberTransactions-JKLzrvh6.js +0 -38
  87. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CcNjdcMX.js +0 -1132
  88. package/dist/Voucher-CDlHku1x.js +0 -490
  89. package/dist/index-CPjDZrsE.js +0 -99
  90. package/dist/index-Dd0IgwOF.js +0 -1051
  91. package/dist/objectid-B16Lk1pC.js +0 -145
@@ -1,490 +0,0 @@
1
- import { defineComponent as X, ref as _, watch as N, onMounted as J, resolveComponent as h, openBlock as y, createBlock as k, unref as t, isRef as j, withCtx as M, createElementVNode as l, createVNode as r, toDisplayString as F, computed as oe, h as b, createElementBlock as $, Fragment as T, renderList as te, resolveDynamicComponent as ae, createCommentVNode as K } from "vue";
2
- import { _ as ne } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as se, components as V } from "@feedmepos/ui-library";
4
- import { u as W, p as z, a as le } from "./loading-E0zwe5lq.js";
5
- import { useCoreStore as ce } from "@feedmepos/mf-common";
6
- import { u as ie } from "./business-1nKmKs9l.js";
7
- import { u as re } from "./campaign-xn4PhDSV.js";
8
- import { g as D, a as q } from "./dto-DP9kIlr_.js";
9
- import "./index-CDmiwLKd.js";
10
- import { u as ue } from "./template-Dlo0YPQp.js";
11
- import { _ as me } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DCwaUg09.js";
12
- import { _ as de } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
13
- import { J as pe } from "./JsonViewer-v8_C7l5N.js";
14
- import { u as fe } from "./app-wDQR6dpb.js";
15
- import { l as he } from "./lodash-B5I3zXaY.js";
16
- import { m as ge } from "./index-Be9fjCVp.js";
17
- import { c as L } from "./index-CPjDZrsE.js";
18
- import { u as ve } from "./vue-i18n-CrVlAF7z.js";
19
- import { useRouter as ye } from "vue-router";
20
- import { R as G } from "./app-B9MkUjRo.js";
21
- const _e = { class: "space-y-16" }, Ce = { class: "fm-typo-en-body-md-600" }, be = { class: "flex items-center justify-end" }, we = { class: "flex items-center gap-8" }, Se = /* @__PURE__ */ X({
22
- __name: "SendVoucherSheet",
23
- emits: ["success"],
24
- setup(Q, { expose: a, emit: A }) {
25
- const { minor: R } = W, P = _(""), g = _({}), C = A, v = _(!1), u = _([]);
26
- function U(c) {
27
- v.value = !0, P.value = c.campaignId, u.value = [];
28
- }
29
- function m() {
30
- v.value = !1;
31
- }
32
- const S = [
33
- {
34
- header: "Name",
35
- accessorFn: (c) => c.name || "No Profile"
36
- },
37
- {
38
- header: "Phone",
39
- accessorFn: (c) => c.phoneNumber || "-"
40
- }
41
- ], i = _({
42
- searchValue: "",
43
- pageSize: 10,
44
- pageCount: 0,
45
- pageIndex: 0,
46
- totalRows: 0,
47
- isLoading: !1
48
- }), f = _([]), w = async (c) => {
49
- i.value.isLoading = !0, f.value = [];
50
- const e = await ge.read({
51
- limit: c.pageSize,
52
- skip: c.pageIndex,
53
- sortBy: "_id",
54
- search: i.value.searchValue,
55
- descending: !1
56
- });
57
- f.value = e.resources, i.value.totalRows = e.meta.totalResources ?? 0, i.value.pageCount = e.meta.totalPages ?? 0, i.value.isLoading = !1, g.value = {}, u.value.forEach((o) => {
58
- const s = f.value.findIndex((d) => d._id == o);
59
- s > -1 && (console.log(s, "fetch member index"), g.value[s] = !0);
60
- });
61
- };
62
- function E() {
63
- f.value.length > 0 && (u.value = u.value.filter(
64
- (c) => !f.value.some((e) => e._id === c) || // Keep if not in current page
65
- Object.entries(g.value).some(
66
- ([e, o]) => o && f.value[e]._id === c
67
- // Keep if selected in current page
68
- )
69
- ));
70
- for (const [c, e] of Object.entries(g.value))
71
- if (e) {
72
- const o = f.value[c]._id;
73
- u.value.includes(o) || u.value.push(o);
74
- }
75
- }
76
- async function x(c) {
77
- u.value.length < 1 || await R(
78
- async () => {
79
- await L.sendCollection(P.value, {
80
- memberId: u.value
81
- }), await C("success"), m();
82
- },
83
- {
84
- message: "Sending claim(s)",
85
- successMessage: "Claim(s) created"
86
- }
87
- );
88
- }
89
- return N(g, E, { deep: !0 }), N(
90
- () => i.value.searchValue,
91
- he.debounce(async () => {
92
- await w({ pageSize: 10, pageIndex: 0 });
93
- }, 500)
94
- ), a({
95
- showSheet: U,
96
- hideSheet: m
97
- }), J(async () => {
98
- await w(i.value);
99
- }), (c, e) => {
100
- const o = h("FmSearch"), s = h("FmTable"), d = h("FmButton"), B = h("FmSideSheet");
101
- return y(), k(B, {
102
- "max-width": 560,
103
- "dismiss-away": !0,
104
- header: "Send voucher to",
105
- modelValue: t(v),
106
- "onUpdate:modelValue": [
107
- e[3] || (e[3] = (p) => j(v) ? v.value = p : null),
108
- e[4] || (e[4] = (p) => v.value = p)
109
- ]
110
- }, {
111
- "side-sheet-footer": M(() => [
112
- l("div", we, [
113
- r(d, {
114
- label: "Send",
115
- loading: t(fe)().isLoading,
116
- onClick: x
117
- }, null, 8, ["loading"]),
118
- r(d, {
119
- label: "Cancel",
120
- type: "button",
121
- variant: "tertiary",
122
- onClick: e[2] || (e[2] = (p) => v.value = !1)
123
- })
124
- ])
125
- ]),
126
- default: M(() => [
127
- r(pe, { json: t(u) }, null, 8, ["json"]),
128
- l("div", _e, [
129
- l("div", Ce, F(t(u).length) + " members selected ", 1),
130
- l("div", be, [
131
- r(o, {
132
- class: "mt-4",
133
- modelValue: t(i).searchValue,
134
- "onUpdate:modelValue": e[0] || (e[0] = (p) => t(i).searchValue = p),
135
- placeholder: "Search Member",
136
- collapsible: ""
137
- }, null, 8, ["modelValue"])
138
- ]),
139
- r(s, {
140
- modelValue: t(g),
141
- "onUpdate:modelValue": e[1] || (e[1] = (p) => j(g) ? g.value = p : null),
142
- selection: "multiple",
143
- loading: t(i).isLoading,
144
- "row-data": t(f),
145
- "column-defs": S,
146
- "page-size": t(i).pageSize,
147
- "page-count": t(i).pageCount,
148
- "hide-footer": t(i).totalRows <= t(i).pageSize,
149
- "fetch-fn": w
150
- }, null, 8, ["modelValue", "loading", "row-data", "page-size", "page-count", "hide-footer"])
151
- ])
152
- ]),
153
- _: 1
154
- }, 8, ["modelValue"]);
155
- };
156
- }
157
- });
158
- var xe = { authUrl: "https://portal-v2.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedme.cc", crmUrl: "crm.feedme.cc", paymentPortalUrl: "https://portal.feedme.cc/payment/payout-account", marketingV1Portal: "https://marketing-v1.feedme.cc" };
159
- const Ve = { class: "px-24 flex flex-col gap-y-16" }, ke = { class: "flex items-center justify-between w-full" }, Fe = { class: "flex gap-8 overflow-x-auto" }, Ie = { class: "space-y-8" }, Le = { class: "flex w-full gap-4 items-center" }, Me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Re = { class: "space-y-4" }, Pe = { class: "fm-typo-en-body-lg-600" }, Ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ee = { class: "flex gap-8 items-center" }, Ae = /* @__PURE__ */ l("img", {
160
- src: ne,
161
- class: "aspect-square w-[150px]"
162
- }, null, -1), Be = { class: "flex flex-col gap-16 text-center" }, Oe = { class: "fm-typo-en-title-sm-800" }, $e = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, so = /* @__PURE__ */ X({
163
- __name: "Voucher",
164
- setup(Q) {
165
- const { t: a } = ve(), A = {
166
- label: a("connect.voucher.createCampaign"),
167
- value: "create",
168
- isPrimary: !0,
169
- prependIcon: "add"
170
- }, R = se(), P = ue("VOUCHER", R), g = ie(), C = re(), { global: v, minor: u } = W, U = ye(), m = _({
171
- searchKey: "",
172
- location: null
173
- }), S = oe(
174
- () => C.campaigns.voucher.filter(
175
- (e) => !m.value.location || !e.targetLocation || e.targetLocation.includes(m.value.location)
176
- )
177
- ), i = [
178
- {
179
- header: a("connect.voucher.voucherTitle"),
180
- accessorFn: (e) => e.name
181
- },
182
- {
183
- header: a("connect.voucher.status"),
184
- cell(e) {
185
- return D(e.row.original);
186
- }
187
- },
188
- {
189
- header: a("connect.voucher.summary"),
190
- accessorFn: (e) => q(e)
191
- },
192
- {
193
- header: a("connect.voucher.quota"),
194
- accessorFn: (e) => {
195
- var o;
196
- return ((o = e.pf_collectible) == null ? void 0 : o.options.maxReceive) ?? "Unlimited";
197
- }
198
- },
199
- {
200
- header: a("connect.voucher.claimed"),
201
- accessorFn: (e) => {
202
- var o;
203
- return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
204
- }
205
- },
206
- {
207
- header: a("connect.voucher.actions"),
208
- cell(e) {
209
- return b("div", { class: "flex items-center justify-end" }, [
210
- b(V.FmButton, {
211
- icon: "visibility",
212
- variant: "tertiary",
213
- iconColor: "neutral-gray-400",
214
- onClick: async (o) => {
215
- o.stopPropagation(), await U.push({
216
- name: G["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
217
- params: { id: e.row.original._id }
218
- });
219
- }
220
- }),
221
- b(
222
- V.FmMenu,
223
- {
224
- placement: "bottom-end",
225
- onClick: (o) => {
226
- o.stopPropagation();
227
- }
228
- },
229
- {
230
- "menu-button": () => b(V.FmButton, {
231
- icon: "more_vert",
232
- iconColor: "neutral-gray-400",
233
- variant: "tertiary"
234
- }),
235
- default: () => {
236
- const o = [
237
- b(
238
- V.FmMenuItem,
239
- {
240
- onClick: async (s) => {
241
- s.stopPropagation(), E(e.row.original);
242
- }
243
- },
244
- {
245
- label: b(
246
- "div",
247
- {
248
- class: "text-fm-color-typo-error fm-typo-en-body-md-400"
249
- },
250
- a("connect.voucher.remove")
251
- )
252
- }
253
- )
254
- ];
255
- return e.row.original.event.type === "SIMPLE_CLAIM" && (o.unshift(
256
- b(V.FmMenuItem, {
257
- label: a("connect.voucher.send"),
258
- onClick: async (s) => {
259
- var d;
260
- s.stopPropagation(), (d = w.value) == null || d.showSheet({
261
- campaignId: e.row.original._id
262
- });
263
- }
264
- })
265
- ), o.unshift(
266
- b(V.FmMenuItem, {
267
- label: a("connect.voucher.share"),
268
- onClick: async (s) => {
269
- if (s.stopPropagation(), e.row.original.event.type !== "SIMPLE_CLAIM")
270
- return await z.confirm(
271
- "Cannot share a voucher that is not a simple claim.",
272
- "Share Voucher",
273
- "OK"
274
- );
275
- await le(
276
- `https://${ce().currentBusiness.value._id}.${xe.appUrl}/vouchers/${e.row.original._id}`,
277
- {
278
- successMessage: "Voucher link copied to clipboard"
279
- }
280
- );
281
- }
282
- })
283
- )), o;
284
- }
285
- }
286
- )
287
- ]);
288
- }
289
- }
290
- ], f = _(), w = _();
291
- async function E(e) {
292
- await z.remove(a("voucher.confirmRemove", { name: e.name })) && await u(
293
- async () => {
294
- await L.delete(e._id), await C.read("VOUCHER");
295
- },
296
- {
297
- message: a("voucher.removing", { name: e.name }),
298
- successMessage: a("voucher.removedSuccessfully", { name: e.name })
299
- }
300
- );
301
- }
302
- async function x(e) {
303
- e ? await o() : P.open(async (s) => {
304
- await o(s);
305
- });
306
- async function o(s) {
307
- var d;
308
- (d = f.value) == null || d.showSheet(
309
- !0,
310
- "VOUCHER",
311
- e ? await L.readById(e._id) : void 0,
312
- s
313
- );
314
- }
315
- }
316
- async function c(e) {
317
- e.campaign._id && await new Promise((o) => {
318
- R.open({
319
- title: "Confirmation",
320
- message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
321
- primaryActions: { text: "Update all", close: !0 },
322
- secondaryActions: { text: "Update future only", close: !0 }
323
- }).onPrimary(async () => {
324
- var s;
325
- e.updateCollections = !0, (s = window.top) == null || s.postMessage("updateAllVoucher", "*"), o();
326
- }).onSecondary(async () => {
327
- o();
328
- });
329
- }), await u(
330
- async () => {
331
- e.campaign._id ? await L.update(e.campaign._id, e) : await L.create(e), await C.read("VOUCHER");
332
- },
333
- {
334
- message: a(
335
- e.campaign._id ? "connect.voucher.updating" : "connect.voucher.creating"
336
- ),
337
- successMessage: a(
338
- e.campaign._id ? "connect.voucher.updatedSuccessfully" : "connect.voucher.createdSuccessfully"
339
- )
340
- }
341
- );
342
- }
343
- return J(async () => {
344
- await v(async () => {
345
- await C.read("VOUCHER");
346
- });
347
- }), (e, o) => {
348
- const s = h("FmPageHead"), d = h("FmSearch"), B = h("FmTable"), p = h("FmButton"), Z = h("FmListItem"), Y = h("FmList"), ee = h("FmCard");
349
- return y(), $(T, null, [
350
- r(s, {
351
- title: t(a)("connect.voucher.title"),
352
- actions: t(S).length > 0 ? [A] : [],
353
- "onClick:action": o[0] || (o[0] = () => x())
354
- }, null, 8, ["title", "actions"]),
355
- l("div", Ve, [
356
- r(d, {
357
- modelValue: t(m).searchKey,
358
- "onUpdate:modelValue": o[1] || (o[1] = (n) => t(m).searchKey = n),
359
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
360
- placeholder: t(a)("connect.voucher.search"),
361
- collapsible: ""
362
- }, null, 8, ["modelValue", "placeholder"]),
363
- t(C).campaigns.voucher && t(C).campaigns.voucher.length > 0 ? (y(), $(T, { key: 0 }, [
364
- l("div", ke, [
365
- l("div", Fe, [
366
- r(de, {
367
- modelValue: t(m).location,
368
- "onUpdate:modelValue": o[2] || (o[2] = (n) => t(m).location = n),
369
- label: t(a)("connect.voucher.location"),
370
- "show-item-label": !0,
371
- icon: "storefront",
372
- placement: "bottom-start",
373
- items: t(g).locationItems
374
- }, null, 8, ["modelValue", "label", "items"])
375
- ]),
376
- r(d, {
377
- modelValue: t(m).searchKey,
378
- "onUpdate:modelValue": o[3] || (o[3] = (n) => t(m).searchKey = n),
379
- class: "xs:hidden",
380
- placeholder: t(a)("connect.voucher.search"),
381
- collapsible: ""
382
- }, null, 8, ["modelValue", "placeholder"])
383
- ]),
384
- r(B, {
385
- class: "xs:hidden",
386
- "row-data": t(S),
387
- "column-defs": i,
388
- "search-value": t(m).searchKey,
389
- "column-filter": [],
390
- onRowClick: o[4] || (o[4] = (n) => x(n.original)),
391
- "hide-footer": t(S).length < 10
392
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
393
- r(Y, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
394
- default: M(() => [
395
- (y(!0), $(T, null, te(t(S).filter(
396
- (n) => n.name.toLowerCase().includes(t(m).searchKey.toLowerCase())
397
- ), (n) => (y(), k(Z, {
398
- key: n._id.toString(),
399
- onClick: (O) => x(n),
400
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
401
- }, {
402
- default: M(() => {
403
- var O;
404
- return [
405
- l("div", Ie, [
406
- l("div", Le, [
407
- (y(), k(ae(t(D)(n)))),
408
- l("div", Me, F(((O = n.pf_collectible) == null ? void 0 : O.currentReceive) ?? 0) + " claimed ", 1)
409
- ]),
410
- l("div", Re, [
411
- l("div", Pe, F(n.name), 1),
412
- l("div", Ue, F(t(q)(n)), 1)
413
- ])
414
- ]),
415
- l("div", Ee, [
416
- n.event.type === "SIMPLE_CLAIM" ? (y(), k(p, {
417
- key: 0,
418
- icon: "visibility",
419
- "icon-color": "neutral-gray-400",
420
- variant: "tertiary",
421
- onClick: async (I) => {
422
- I.stopPropagation(), await t(U).push({
423
- name: t(G)["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
424
- params: { id: n._id }
425
- });
426
- }
427
- }, null, 8, ["onClick"])) : K("", !0),
428
- n.event.type === "SIMPLE_CLAIM" ? (y(), k(p, {
429
- key: 1,
430
- icon: "send",
431
- "icon-color": "neutral-gray-400",
432
- variant: "tertiary",
433
- onClick: (I) => {
434
- var H;
435
- I.stopPropagation(), (H = t(w)) == null || H.showSheet({
436
- campaignId: n._id
437
- });
438
- }
439
- }, null, 8, ["onClick"])) : K("", !0),
440
- r(p, {
441
- icon: "delete",
442
- "icon-color": "neutral-gray-400",
443
- variant: "tertiary",
444
- onClick: (I) => (I.stopPropagation(), E(n))
445
- }, null, 8, ["onClick"])
446
- ])
447
- ];
448
- }),
449
- _: 2
450
- }, 1032, ["onClick"]))), 128))
451
- ]),
452
- _: 1
453
- })
454
- ], 64)) : (y(), k(ee, {
455
- key: 1,
456
- variant: "outlined",
457
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
458
- }, {
459
- default: M(() => [
460
- Ae,
461
- l("div", Be, [
462
- l("div", Oe, F(t(a)("connect.voucher.createVoucherCampaign")), 1),
463
- l("div", $e, F(t(a)("connect.voucher.description")), 1)
464
- ]),
465
- r(p, {
466
- variant: "primary",
467
- label: t(a)("connect.voucher.createVoucherCampaign"),
468
- icon: "add",
469
- onClick: o[5] || (o[5] = (n) => x())
470
- }, null, 8, ["label"])
471
- ]),
472
- _: 1
473
- })),
474
- r(me, {
475
- ref_key: "sheetRef",
476
- ref: f,
477
- "onSubmit:modelValue": c
478
- }, null, 512),
479
- r(Se, {
480
- ref_key: "sendVoucherSheetRef",
481
- ref: w
482
- }, null, 512)
483
- ])
484
- ], 64);
485
- };
486
- }
487
- });
488
- export {
489
- so as default
490
- };
@@ -1,99 +0,0 @@
1
- import { g as e, S as n, b as o } from "./index-BZg5tj39.js";
2
- const t = () => {
3
- const a = n.getBusinessId();
4
- if (!a) throw new Error("Invalid business ID");
5
- return o(`businesses/${a}/campaigns`, {
6
- // url: 'http://localhost:3000/portal/',
7
- });
8
- }, i = {
9
- async readAllGrouped(a) {
10
- const s = e(
11
- await t().get("grouped", { params: a })
12
- );
13
- return {
14
- meta: s.meta,
15
- resources: s.resources
16
- };
17
- },
18
- async readAll(a, s) {
19
- const r = e(
20
- await t().get("", {
21
- params: { ...a, ...s }
22
- })
23
- );
24
- return {
25
- meta: r.meta,
26
- resources: r.resources
27
- };
28
- },
29
- async readById(a) {
30
- return e(await t().get(`/${a}`));
31
- },
32
- async create(a) {
33
- return e(await t().post("", a));
34
- },
35
- async update(a, s) {
36
- return e(await t().put(a, s));
37
- },
38
- async delete(a) {
39
- return e(await t().delete(a));
40
- },
41
- async readCollectionsByCampaignId(a, s) {
42
- const r = e(
43
- await t().get(`/${a}/collections`, {
44
- params: s
45
- })
46
- );
47
- return {
48
- meta: r.meta,
49
- resources: r.resources
50
- };
51
- },
52
- async readTransactions(a) {
53
- return e(
54
- await t().get(
55
- `/${a}/collections/transactions`
56
- )
57
- );
58
- },
59
- async createCollectionByCampaignId(a, s) {
60
- return e(
61
- await t().post(`/${a}/collections`, s)
62
- );
63
- },
64
- async readGroups() {
65
- return e(await t().get("/groups")) ?? [];
66
- },
67
- async readStats(a) {
68
- return e(
69
- await t().get("/stats", { params: a })
70
- );
71
- },
72
- async createGroup(a) {
73
- return e(await t().post("/groups", a));
74
- },
75
- async updateGroup(a, s) {
76
- return e(
77
- await t().put(`/groups/${a}`, s)
78
- );
79
- },
80
- async deleteGroup(a) {
81
- return e(await t().delete(`/groups/${a}`));
82
- },
83
- async sendCollection(a, s) {
84
- return e(
85
- await t().post(
86
- `/${a}/collections/send`,
87
- s
88
- )
89
- );
90
- },
91
- async syncAllPromotion() {
92
- return e(
93
- await t().post("/promotion/sync")
94
- );
95
- }
96
- };
97
- export {
98
- i as c
99
- };