@feedmepos/mf-connect 0.1.0-beta.49 → 0.1.0-beta.50

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 (88) hide show
  1. package/dist/{Analytic-DTJ_SOI3.js → Analytic-D-yp03jJ.js} +11 -11
  2. package/dist/{App-Cls9g4sA.js → App-CeQWTGNK.js} +55 -51
  3. package/dist/{AuditLogs-xbOKPoQS.js → AuditLogs-2qzwcMXR.js} +8 -8
  4. package/dist/Bin-D1b2NbbA.js +191 -0
  5. package/dist/{Broadcast-UeoV6_0x.js → Broadcast-bKF9mIns.js} +9 -9
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BPl_0m0I.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B_q5K-cx.js} +6 -6
  7. package/dist/{Card-DSK_2b0H.js → Card-BCAyfBLi.js} +15 -15
  8. package/dist/{Collections-U63Y-tw8.js → Collections-Yz3F55bv.js} +5 -5
  9. package/dist/{Credit-CC1k4c10.js → Credit-Ceptt_g_.js} +9 -9
  10. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BUPBXZWy.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-TjNinQ8e.js} +28 -28
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DnjTCWUk.js → EffectSheet.vue_vue_type_style_index_0_lang-D3Bt-Vuu.js} +8 -8
  12. package/dist/{Experience-UBLCm5X8.js → Experience-DskHKzfo.js} +9 -9
  13. package/dist/{Game-DN8qNmAV.js → Game-IJ6X0AXM.js} +9 -9
  14. package/dist/{Index-Cp5Iqmgq.js → Index-CEl2y9X6.js} +93 -90
  15. package/dist/{Marketing-BTZSeQdq.js → Marketing-CWekLb4c.js} +6 -6
  16. package/dist/{Member-DKGZpaNY.js → Member-BUZPQ5Lb.js} +4 -4
  17. package/dist/{MemberList-BDv5O7_F.js → MemberList-BmVNqvbm.js} +24 -24
  18. package/dist/{MemberTransactions-Cp_g2uYy.js → MemberTransactions-B3XhEOK_.js} +1 -1
  19. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-TBeUosVs.js → MessageInput.vue_vue_type_script_setup_true_lang-C6YIbQtM.js} +2 -2
  20. package/dist/{Mission-Cte8Jtyj.js → Mission-Ci9ed_ph.js} +9 -9
  21. package/dist/{Overview-COeyTvML.js → Overview-CU9uhC-k.js} +399 -395
  22. package/dist/{Point-Cu5_d5X1.js → Point-wuuR7AEb.js} +9 -9
  23. package/dist/{Promotion-Cf8ct95o.js → Promotion-BMi3kyE8.js} +10 -10
  24. package/dist/Record-Wmh-g8WY.js +340 -0
  25. package/dist/{Reward-Bcx7bCEh.js → Reward-BL4lxhIB.js} +35 -35
  26. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CwApma5p.js → RewardGroup.vue_vue_type_script_setup_true_lang-CqXuTxun.js} +11 -11
  27. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Cg3bA1cc.js → RuleGroup.vue_vue_type_script_setup_true_lang-Dbik0PEw.js} +12 -12
  28. package/dist/{Segment-BfMpM62H.js → Segment-DObdjyYi.js} +14 -14
  29. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-CqZIHzA3.js → SelectItems.vue_vue_type_script_setup_true_lang-BAuM6qP5.js} +2 -2
  30. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-BfyRVxWM.js +147 -0
  31. package/dist/{Setting-Btim3PZq.js → Setting-Dqgnd7TR.js} +10 -10
  32. package/dist/{Store-BbiTlkAz.js → Store--Z4So__g.js} +18 -18
  33. package/dist/{StoreRewards-hbNthA-_.js → StoreRewards-DPFVXWwm.js} +13 -13
  34. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-Dv58wFeO.js → StoreTransactions.vue_vue_type_script_setup_true_lang-CNsdA106.js} +17 -17
  35. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BJvBo7sT.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CGOmGozY.js} +1 -1
  36. package/dist/{Tier-Ddj_dwc8.js → Tier-36IfhsnP.js} +19 -19
  37. package/dist/{Title-CA6b8UxN.js → Title-XH56OOug.js} +19 -19
  38. package/dist/{Transaction-yp6PDE_8.js → Transaction-BUQcSmBs.js} +2 -2
  39. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DoCmo4D7.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BVCfeG5T.js} +6 -6
  40. package/dist/Voucher-CvmH0kcF.js +353 -0
  41. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-aYXqbp2E.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BQOD6uEf.js} +15 -15
  42. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Bz77dtVR.js → ZodTextField.vue_vue_type_script_setup_true_lang-CcIcCt4N.js} +1 -1
  43. package/dist/{app-BpikVDEt.js → app-DeW5_DB0.js} +712 -547
  44. package/dist/{app-DG6xKzyo.js → app-TN8KEPMu.js} +1 -1
  45. package/dist/app.js +1 -1
  46. package/dist/{business-DPl8ug6e.js → business-D1mLhSME.js} +1 -1
  47. package/dist/{campaign-D9xub_rP.js → campaign-0tnkhu78.js} +11 -11
  48. package/dist/{campaign-CLF6bWG4.js → campaign-B-12Im0w.js} +2 -2
  49. package/dist/{campaign.enum-DJijW358.js → campaign.enum-C8m-HHZE.js} +1 -1
  50. package/dist/{campaign.fn-DgyMbDS2.js → campaign.fn-CxkhbK9i.js} +110 -110
  51. package/dist/{collectible.enum-q3RNa6ac.js → collectible.enum-6Syq-vQ6.js} +3 -3
  52. package/dist/{collection.fn-DQdOmMPm.js → collection.fn-BUj75Jp2.js} +2 -2
  53. package/dist/{dto-Gtphhk7f.js → dto-8wODhIIC.js} +7 -7
  54. package/dist/{effect-b6TK6WqX.js → effect-BEZEjcJu.js} +1 -1
  55. package/dist/{email-addresses-BOOXVJIb.js → email-addresses-PwjkdYYD.js} +1 -1
  56. package/dist/{export-DB-hJPwq.js → export-BB-0vgwy.js} +3 -3
  57. package/dist/{helper-DaoMEMRy.js → helper-DOt8-wns.js} +1 -1
  58. package/dist/{index-Dd_g3RuO.js → index-B1qUjniH.js} +1 -1
  59. package/dist/{index-tXvAp_RD.js → index-BTMIZz4v.js} +1 -1
  60. package/dist/{index-zaGTl_qB.js → index-By-GlmG7.js} +2 -2
  61. package/dist/index-C7zBkoZ4.js +115 -0
  62. package/dist/{index-CC24qW42.js → index-CNlHabtk.js} +1 -1
  63. package/dist/{index-BsYcA4d4.js → index-CXGiIgdK.js} +1 -1
  64. package/dist/{index-DplAli0B.js → index-Cjn1LVjC.js} +38 -35
  65. package/dist/{index-CGCV3Q39.js → index-CpfUrdgw.js} +3 -3
  66. package/dist/{index-rU6SAS58.js → index-DZuEmMyY.js} +3 -3
  67. package/dist/{index-lAMRbOeY.js → index-D_zwqIhq.js} +1 -1
  68. package/dist/{index-V4sEiiYS.js → index-DabUEw_c.js} +1 -1
  69. package/dist/{index-BeE1k0xs.js → index-X-FfC49l.js} +6 -6
  70. package/dist/{index.esm2017-BpKyZnrS.js → index.esm2017-DJOUiVjR.js} +1 -1
  71. package/dist/{loading-aAPveWkt.js → loading-aCWVsOPY.js} +1 -1
  72. package/dist/{membership-CdHkfBpk.js → membership-1etsHC5G.js} +6 -6
  73. package/dist/{money-yvgF4-JZ.js → money-DzWRURZ5.js} +1 -1
  74. package/dist/{number-5CZfadpH.js → number-BxIQO1i3.js} +1 -1
  75. package/dist/{objectid-Cz3ihSHZ.js → objectid-DjhmYkn-.js} +7 -7
  76. package/dist/{plugins-CFwYNZo0.js → plugins-CSPFAU50.js} +4 -4
  77. package/dist/{reward-DfX_2rEr.js → reward-Bh4Li9f0.js} +1 -1
  78. package/dist/{rule-D_HCGBXt.js → rule-CHTTTUFB.js} +3 -3
  79. package/dist/{rule-builder-DaJ2wADR.js → rule-builder-OHfUJTIA.js} +1 -1
  80. package/dist/{template-BFcHBZjo.js → template-ZGxXqkaC.js} +4 -4
  81. package/dist/{trigger-BnfqcoU-.js → trigger-Ogu5FDs0.js} +13 -13
  82. package/dist/{user-bXWIOEFL.js → user-DBuU81tO.js} +1 -1
  83. package/dist/{vue-i18n-kVKjcgAi.js → vue-i18n-CKpKQ6iE.js} +299 -299
  84. package/dist/{xlsx-C0oaHSzL.js → xlsx-DJDZBIeg.js} +1 -1
  85. package/package.json +1 -1
  86. package/dist/Record-BTsMyNzQ.js +0 -339
  87. package/dist/Voucher-CGB4koQI.js +0 -491
  88. package/dist/index-CSmO-8Va.js +0 -99
@@ -1,491 +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 { p as z, a as le } from "./plugins-CFwYNZo0.js";
5
- import { useCoreStore as ce } from "@feedmepos/mf-common";
6
- import { u as W } from "./loading-aAPveWkt.js";
7
- import { u as ie } from "./business-DPl8ug6e.js";
8
- import { u as re } from "./campaign-CLF6bWG4.js";
9
- import { g as D, a as q } from "./campaign-D9xub_rP.js";
10
- import "./index-CC24qW42.js";
11
- import { u as ue } from "./template-BFcHBZjo.js";
12
- import { _ as me } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BUPBXZWy.js";
13
- import { _ as de } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
14
- import { J as pe } from "./JsonViewer-v8_C7l5N.js";
15
- import { u as fe } from "./app-wDQR6dpb.js";
16
- import { l as he } from "./lodash-B5I3zXaY.js";
17
- import { m as ve } from "./index-lAMRbOeY.js";
18
- import { c as L } from "./index-CSmO-8Va.js";
19
- import { u as ge } from "./vue-i18n-kVKjcgAi.js";
20
- import { useRouter as ye } from "vue-router";
21
- import { R as G } from "./app-BpikVDEt.js";
22
- 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({
23
- __name: "SendVoucherSheet",
24
- emits: ["success"],
25
- setup(Q, { expose: a, emit: A }) {
26
- const { minor: P } = W, R = _(""), v = _({}), C = A, g = _(!1), u = _([]);
27
- function U(c) {
28
- g.value = !0, R.value = c.campaignId, u.value = [];
29
- }
30
- function m() {
31
- g.value = !1;
32
- }
33
- const S = [
34
- {
35
- header: "Name",
36
- accessorFn: (c) => c.name || "No Profile"
37
- },
38
- {
39
- header: "Phone",
40
- accessorFn: (c) => c.phoneNumber || "-"
41
- }
42
- ], i = _({
43
- searchValue: "",
44
- pageSize: 10,
45
- pageCount: 0,
46
- pageIndex: 0,
47
- totalRows: 0,
48
- isLoading: !1
49
- }), f = _([]), w = async (c) => {
50
- i.value.isLoading = !0, f.value = [];
51
- const e = await ve.read({
52
- limit: c.pageSize,
53
- skip: c.pageIndex,
54
- sortBy: "_id",
55
- search: i.value.searchValue,
56
- descending: !1
57
- });
58
- f.value = e.resources, i.value.totalRows = e.meta.totalResources ?? 0, i.value.pageCount = e.meta.totalPages ?? 0, i.value.isLoading = !1, v.value = {}, u.value.forEach((o) => {
59
- const s = f.value.findIndex((d) => d._id == o);
60
- s > -1 && (console.log(s, "fetch member index"), v.value[s] = !0);
61
- });
62
- };
63
- function E() {
64
- f.value.length > 0 && (u.value = u.value.filter(
65
- (c) => !f.value.some((e) => e._id === c) || // Keep if not in current page
66
- Object.entries(v.value).some(
67
- ([e, o]) => o && f.value[e]._id === c
68
- // Keep if selected in current page
69
- )
70
- ));
71
- for (const [c, e] of Object.entries(v.value))
72
- if (e) {
73
- const o = f.value[c]._id;
74
- u.value.includes(o) || u.value.push(o);
75
- }
76
- }
77
- async function x(c) {
78
- u.value.length < 1 || await P(
79
- async () => {
80
- await L.sendCollection(R.value, {
81
- memberId: u.value
82
- }), await C("success"), m();
83
- },
84
- {
85
- message: "Sending claim(s)",
86
- successMessage: "Claim(s) created"
87
- }
88
- );
89
- }
90
- return N(v, E, { deep: !0 }), N(
91
- () => i.value.searchValue,
92
- he.debounce(async () => {
93
- await w({ pageSize: 10, pageIndex: 0 });
94
- }, 500)
95
- ), a({
96
- showSheet: U,
97
- hideSheet: m
98
- }), J(async () => {
99
- await w(i.value);
100
- }), (c, e) => {
101
- const o = h("FmSearch"), s = h("FmTable"), d = h("FmButton"), B = h("FmSideSheet");
102
- return y(), k(B, {
103
- "max-width": 560,
104
- "dismiss-away": !0,
105
- header: "Send voucher to",
106
- modelValue: t(g),
107
- "onUpdate:modelValue": [
108
- e[3] || (e[3] = (p) => j(g) ? g.value = p : null),
109
- e[4] || (e[4] = (p) => g.value = p)
110
- ]
111
- }, {
112
- "side-sheet-footer": M(() => [
113
- l("div", we, [
114
- r(d, {
115
- label: "Send",
116
- loading: t(fe)().isLoading,
117
- onClick: x
118
- }, null, 8, ["loading"]),
119
- r(d, {
120
- label: "Cancel",
121
- type: "button",
122
- variant: "tertiary",
123
- onClick: e[2] || (e[2] = (p) => g.value = !1)
124
- })
125
- ])
126
- ]),
127
- default: M(() => [
128
- r(pe, { json: t(u) }, null, 8, ["json"]),
129
- l("div", _e, [
130
- l("div", Ce, F(t(u).length) + " members selected ", 1),
131
- l("div", be, [
132
- r(o, {
133
- class: "mt-4",
134
- modelValue: t(i).searchValue,
135
- "onUpdate:modelValue": e[0] || (e[0] = (p) => t(i).searchValue = p),
136
- placeholder: "Search Member",
137
- collapsible: ""
138
- }, null, 8, ["modelValue"])
139
- ]),
140
- r(s, {
141
- modelValue: t(v),
142
- "onUpdate:modelValue": e[1] || (e[1] = (p) => j(v) ? v.value = p : null),
143
- selection: "multiple",
144
- loading: t(i).isLoading,
145
- "row-data": t(f),
146
- "column-defs": S,
147
- "page-size": t(i).pageSize,
148
- "page-count": t(i).pageCount,
149
- "hide-footer": t(i).totalRows <= t(i).pageSize,
150
- "fetch-fn": w
151
- }, null, 8, ["modelValue", "loading", "row-data", "page-size", "page-count", "hide-footer"])
152
- ])
153
- ]),
154
- _: 1
155
- }, 8, ["modelValue"]);
156
- };
157
- }
158
- });
159
- var xe = { 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", licensePortalUrl: "https://license.feedmedev.cc/", marketingV1Portal: "https://marketing-v1.feedmedev.cc" };
160
- 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" }, Pe = { class: "space-y-4" }, Re = { 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 = { class: "flex flex-col gap-16 text-center" }, Be = { class: "fm-typo-en-title-sm-800" }, Oe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, so = /* @__PURE__ */ X({
161
- __name: "Voucher",
162
- setup(Q) {
163
- const { t: a } = ge(), A = {
164
- label: a("connect.voucher.createCampaign"),
165
- value: "create",
166
- isPrimary: !0,
167
- prependIcon: "add"
168
- }, P = se(), R = ue("VOUCHER", P), v = ie(), C = re(), { global: g, minor: u } = W, U = ye(), m = _({
169
- searchKey: "",
170
- location: null
171
- }), S = oe(
172
- () => C.campaigns.voucher.filter(
173
- (e) => !m.value.location || !e.targetLocation || e.targetLocation.includes(m.value.location)
174
- )
175
- ), i = [
176
- {
177
- header: a("connect.voucher.voucherTitle"),
178
- accessorFn: (e) => e.name
179
- },
180
- {
181
- header: a("connect.voucher.status"),
182
- cell(e) {
183
- return D(e.row.original);
184
- }
185
- },
186
- {
187
- header: a("connect.voucher.summary"),
188
- accessorFn: (e) => q(e)
189
- },
190
- {
191
- header: a("connect.voucher.quota"),
192
- accessorFn: (e) => {
193
- var o;
194
- return ((o = e.pf_collectible) == null ? void 0 : o.options.maxReceive) ?? "Unlimited";
195
- }
196
- },
197
- {
198
- header: a("connect.voucher.claimed"),
199
- accessorFn: (e) => {
200
- var o;
201
- return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
202
- }
203
- },
204
- {
205
- header: a("connect.voucher.actions"),
206
- cell(e) {
207
- return b("div", { class: "flex items-center justify-end" }, [
208
- b(V.FmButton, {
209
- icon: "visibility",
210
- variant: "tertiary",
211
- iconColor: "neutral-gray-400",
212
- onClick: async (o) => {
213
- o.stopPropagation(), await U.push({
214
- name: G["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
215
- params: { id: e.row.original._id }
216
- });
217
- }
218
- }),
219
- b(
220
- V.FmMenu,
221
- {
222
- placement: "bottom-end",
223
- onClick: (o) => {
224
- o.stopPropagation();
225
- }
226
- },
227
- {
228
- "menu-button": () => b(V.FmButton, {
229
- icon: "more_vert",
230
- iconColor: "neutral-gray-400",
231
- variant: "tertiary"
232
- }),
233
- default: () => {
234
- const o = [
235
- b(
236
- V.FmMenuItem,
237
- {
238
- onClick: async (s) => {
239
- s.stopPropagation(), E(e.row.original);
240
- }
241
- },
242
- {
243
- label: b(
244
- "div",
245
- {
246
- class: "text-fm-color-typo-error fm-typo-en-body-md-400"
247
- },
248
- a("connect.voucher.remove")
249
- )
250
- }
251
- )
252
- ];
253
- return e.row.original.event.type === "SIMPLE_CLAIM" && (o.unshift(
254
- b(V.FmMenuItem, {
255
- label: a("connect.voucher.send"),
256
- onClick: async (s) => {
257
- var d;
258
- s.stopPropagation(), (d = w.value) == null || d.showSheet({
259
- campaignId: e.row.original._id
260
- });
261
- }
262
- })
263
- ), o.unshift(
264
- b(V.FmMenuItem, {
265
- label: a("connect.voucher.share"),
266
- onClick: async (s) => {
267
- if (s.stopPropagation(), e.row.original.event.type !== "SIMPLE_CLAIM")
268
- return await z.confirm(
269
- "Cannot share a voucher that is not a simple claim.",
270
- "Share Voucher",
271
- "OK"
272
- );
273
- await le(
274
- `https://${ce().currentBusiness.value._id}.${xe.appUrl}/vouchers/${e.row.original._id}`,
275
- {
276
- successMessage: "Voucher link copied to clipboard"
277
- }
278
- );
279
- }
280
- })
281
- )), o;
282
- }
283
- }
284
- )
285
- ]);
286
- }
287
- }
288
- ], f = _(), w = _();
289
- async function E(e) {
290
- await z.remove(a("voucher.confirmRemove", { name: e.name })) && await u(
291
- async () => {
292
- await L.delete(e._id), await C.read("VOUCHER");
293
- },
294
- {
295
- message: a("voucher.removing", { name: e.name }),
296
- successMessage: a("voucher.removedSuccessfully", { name: e.name })
297
- }
298
- );
299
- }
300
- async function x(e) {
301
- e ? await o() : R.open(async (s) => {
302
- await o(s);
303
- });
304
- async function o(s) {
305
- var d;
306
- (d = f.value) == null || d.showSheet(
307
- !0,
308
- "VOUCHER",
309
- e ? await L.readById(e._id) : void 0,
310
- s
311
- );
312
- }
313
- }
314
- async function c(e) {
315
- e.campaign._id && await new Promise((o) => {
316
- P.open({
317
- title: "Confirmation",
318
- message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
319
- primaryActions: { text: "Update all", close: !0 },
320
- secondaryActions: { text: "Update future only", close: !0 }
321
- }).onPrimary(async () => {
322
- var s;
323
- e.updateCollections = !0, (s = window.top) == null || s.postMessage("updateAllVoucher", "*"), o();
324
- }).onSecondary(async () => {
325
- o();
326
- });
327
- }), await u(
328
- async () => {
329
- e.campaign._id ? await L.update(e.campaign._id, e) : await L.create(e), await C.read("VOUCHER");
330
- },
331
- {
332
- message: a(
333
- e.campaign._id ? "connect.voucher.updating" : "connect.voucher.creating"
334
- ),
335
- successMessage: a(
336
- e.campaign._id ? "connect.voucher.updatedSuccessfully" : "connect.voucher.createdSuccessfully"
337
- )
338
- }
339
- );
340
- }
341
- return J(async () => {
342
- await g(async () => {
343
- await C.read("VOUCHER");
344
- });
345
- }), (e, o) => {
346
- const s = h("FmPageHead"), d = h("FmSearch"), B = h("FmTable"), p = h("FmButton"), Z = h("FmListItem"), Y = h("FmList"), ee = h("FmCard");
347
- return y(), $(T, null, [
348
- r(s, {
349
- title: t(a)("connect.voucher.title"),
350
- actions: t(S).length > 0 ? [A] : [],
351
- "onClick:action": o[0] || (o[0] = () => x())
352
- }, null, 8, ["title", "actions"]),
353
- l("div", Ve, [
354
- r(d, {
355
- modelValue: t(m).searchKey,
356
- "onUpdate:modelValue": o[1] || (o[1] = (n) => t(m).searchKey = n),
357
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
358
- placeholder: t(a)("connect.voucher.search"),
359
- collapsible: ""
360
- }, null, 8, ["modelValue", "placeholder"]),
361
- t(C).campaigns.voucher && t(C).campaigns.voucher.length > 0 ? (y(), $(T, { key: 0 }, [
362
- l("div", ke, [
363
- l("div", Fe, [
364
- r(de, {
365
- modelValue: t(m).location,
366
- "onUpdate:modelValue": o[2] || (o[2] = (n) => t(m).location = n),
367
- label: t(a)("connect.voucher.location"),
368
- "show-item-label": !0,
369
- icon: "storefront",
370
- placement: "bottom-start",
371
- items: t(v).locationItems
372
- }, null, 8, ["modelValue", "label", "items"])
373
- ]),
374
- r(d, {
375
- modelValue: t(m).searchKey,
376
- "onUpdate:modelValue": o[3] || (o[3] = (n) => t(m).searchKey = n),
377
- class: "xs:hidden",
378
- placeholder: t(a)("connect.voucher.search"),
379
- collapsible: ""
380
- }, null, 8, ["modelValue", "placeholder"])
381
- ]),
382
- r(B, {
383
- class: "xs:hidden",
384
- "row-data": t(S),
385
- "column-defs": i,
386
- "search-value": t(m).searchKey,
387
- "column-filter": [],
388
- onRowClick: o[4] || (o[4] = (n) => x(n.original)),
389
- "hide-footer": t(S).length < 10
390
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
391
- r(Y, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
392
- default: M(() => [
393
- (y(!0), $(T, null, te(t(S).filter(
394
- (n) => n.name.toLowerCase().includes(t(m).searchKey.toLowerCase())
395
- ), (n) => (y(), k(Z, {
396
- key: n._id.toString(),
397
- onClick: (O) => x(n),
398
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
399
- }, {
400
- default: M(() => {
401
- var O;
402
- return [
403
- l("div", Ie, [
404
- l("div", Le, [
405
- (y(), k(ae(t(D)(n)))),
406
- l("div", Me, F(((O = n.pf_collectible) == null ? void 0 : O.currentReceive) ?? 0) + " claimed ", 1)
407
- ]),
408
- l("div", Pe, [
409
- l("div", Re, F(n.name), 1),
410
- l("div", Ue, F(t(q)(n)), 1)
411
- ])
412
- ]),
413
- l("div", Ee, [
414
- n.event.type === "SIMPLE_CLAIM" ? (y(), k(p, {
415
- key: 0,
416
- icon: "visibility",
417
- "icon-color": "neutral-gray-400",
418
- variant: "tertiary",
419
- onClick: async (I) => {
420
- I.stopPropagation(), await t(U).push({
421
- name: t(G)["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
422
- params: { id: n._id }
423
- });
424
- }
425
- }, null, 8, ["onClick"])) : K("", !0),
426
- n.event.type === "SIMPLE_CLAIM" ? (y(), k(p, {
427
- key: 1,
428
- icon: "send",
429
- "icon-color": "neutral-gray-400",
430
- variant: "tertiary",
431
- onClick: (I) => {
432
- var H;
433
- I.stopPropagation(), (H = t(w)) == null || H.showSheet({
434
- campaignId: n._id
435
- });
436
- }
437
- }, null, 8, ["onClick"])) : K("", !0),
438
- r(p, {
439
- icon: "delete",
440
- "icon-color": "neutral-gray-400",
441
- variant: "tertiary",
442
- onClick: (I) => (I.stopPropagation(), E(n))
443
- }, null, 8, ["onClick"])
444
- ])
445
- ];
446
- }),
447
- _: 2
448
- }, 1032, ["onClick"]))), 128))
449
- ]),
450
- _: 1
451
- })
452
- ], 64)) : (y(), k(ee, {
453
- key: 1,
454
- variant: "outlined",
455
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
456
- }, {
457
- default: M(() => [
458
- o[6] || (o[6] = l("img", {
459
- src: ne,
460
- class: "aspect-square w-[150px]"
461
- }, null, -1)),
462
- l("div", Ae, [
463
- l("div", Be, F(t(a)("connect.voucher.createVoucherCampaign")), 1),
464
- l("div", Oe, F(t(a)("connect.voucher.description")), 1)
465
- ]),
466
- r(p, {
467
- variant: "primary",
468
- label: t(a)("connect.voucher.createVoucherCampaign"),
469
- icon: "add",
470
- onClick: o[5] || (o[5] = (n) => x())
471
- }, null, 8, ["label"])
472
- ]),
473
- _: 1
474
- })),
475
- r(me, {
476
- ref_key: "sheetRef",
477
- ref: f,
478
- "onSubmit:modelValue": c
479
- }, null, 512),
480
- r(Se, {
481
- ref_key: "sendVoucherSheetRef",
482
- ref: w
483
- }, null, 512)
484
- ])
485
- ], 64);
486
- };
487
- }
488
- });
489
- export {
490
- so as default
491
- };
@@ -1,99 +0,0 @@
1
- import { g as e, S as n, b as o } from "./index-CGCV3Q39.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
- };