@feedmepos/mf-connect 0.0.16-beta.1 → 0.0.16-beta.11

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 (95) hide show
  1. package/dist/{Analytic-C-zZmF5N.js → Analytic-Gq7PoNer.js} +368 -365
  2. package/dist/App-Cikl5jnp.js +177 -0
  3. package/dist/Broadcast-DU3JnBwZ.js +223 -0
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-VWLBlxy1.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D0I8IZIR.js} +20 -20
  5. package/dist/Card-hIeQ5XUH.js +825 -0
  6. package/dist/Collections-B1SC1rr7.js +453 -0
  7. package/dist/Credit-BgwI8DR3.js +216 -0
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bz6TSmbW.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-D9VR3P2d.js} +1026 -1022
  9. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-AhWnHG02.js → EffectSheet.vue_vue_type_style_index_0_lang-DPgu45MD.js} +29 -29
  10. package/dist/Experience-C2Q-zqV6.js +221 -0
  11. package/dist/Game-DU2pZDGk.js +255 -0
  12. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +144 -0
  13. package/dist/JsonViewer-v8_C7l5N.js +87 -0
  14. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DykNOOFD.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js} +1 -1
  15. package/dist/{MainLayout-D0AoA1tk.js → MainLayout-B1aJoR95.js} +2 -2
  16. package/dist/Marketing-DWiTQp9I.js +316 -0
  17. package/dist/Member-BEXKBFry.js +69 -0
  18. package/dist/MemberList-DzMdajIf.js +1733 -0
  19. package/dist/MemberOverview-wL_ailso.js +58 -0
  20. package/dist/{MemberTransactions-CTAx5jIV.js → MemberTransactions-Bciankuu.js} +1 -1
  21. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-C-BtHxSc.js → MessageInput.vue_vue_type_script_setup_true_lang-DH25Hfk3.js} +46 -46
  22. package/dist/Mission-KzwRlaA5.js +259 -0
  23. package/dist/Point-CSKvZXHc.js +222 -0
  24. package/dist/Promotion-IiwPhx8p.js +221 -0
  25. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CrpJySSp.js → RuleGroup.vue_vue_type_script_setup_true_lang-4zIO3oCr.js} +545 -544
  26. package/dist/Segment-2Q0PonBb.js +447 -0
  27. package/dist/{Setting-Zrj5P_4m.js → Setting-Df5vVRt4.js} +600 -598
  28. package/dist/Store-C0WXCKs6.js +1503 -0
  29. package/dist/StoreRewards-eSSIO0nk.js +401 -0
  30. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DS4APaHw.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BjnCRKGX.js} +106 -108
  31. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-ZYjWlDJ1.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-b0xTcoEp.js} +1 -1
  32. package/dist/{Tier-DVWJyQ9S.js → Tier-v-1FkRU-.js} +464 -449
  33. package/dist/{Title-B5kX64vs.js → Title-CQ2JWqBW.js} +315 -299
  34. package/dist/Transaction-0OouN_6s.js +39 -0
  35. package/dist/Voucher-CL0cgogx.js +488 -0
  36. package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
  37. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  38. package/dist/app-Bd19eW7X.js +5381 -0
  39. package/dist/app-CfS25Z66.js +34797 -0
  40. package/dist/app-wDQR6dpb.js +39 -0
  41. package/dist/app.js +5 -3
  42. package/dist/business-dQh3AEot.js +78 -0
  43. package/dist/{campaign-BZJuknWK.js → campaign-BOl8AgKA.js} +12 -12
  44. package/dist/{collection.fn-DoCkZ6z4.js → collection.fn-B_YsXmrP.js} +2 -2
  45. package/dist/dto-B8NfyVPG.js +1169 -0
  46. package/dist/{effect-B8kmnKvY.js → effect-C2jCStXO.js} +1 -1
  47. package/dist/{export-Dm6LYnWo.js → export-BtZc3Yzh.js} +3 -3
  48. package/dist/{helper-DR4XK3nv.js → helper-8oGsrM56.js} +1 -1
  49. package/dist/{index-DcUrk07Q.js → index-6FkKY3q0.js} +3 -3
  50. package/dist/{index-Bu4_26qI.js → index-C7oeXRUl.js} +1 -1
  51. package/dist/{index-CuL5-ORK.js → index-CZKYIefW.js} +6 -7
  52. package/dist/{index-yxJMhfxj.js → index-C_0IFnwi.js} +5 -5
  53. package/dist/{index-BryrRq8O.js → index-DCixRRvz.js} +36 -30
  54. package/dist/{index-CkiYkbXb.js → index-DFgt4-VW.js} +1 -1
  55. package/dist/{index-CWf0mh3a.js → index-DYDhH9bi.js} +177 -168
  56. package/dist/{index-boor8e80.js → index-Di-kWSmf.js} +3 -3
  57. package/dist/{app-DkI7dYRN.js → index-Dn0jdj0o.js} +9665 -13024
  58. package/dist/index-DwKqFNF6.js +3 -0
  59. package/dist/{index-BobRgQrE.js → index-HoacsZDk.js} +2 -2
  60. package/dist/{index-BxkxVtgm.js → index-UTQHDUdW.js} +1 -1
  61. package/dist/{loading-BzV5acUX.js → loading-D_AN6p24.js} +6807 -6805
  62. package/dist/{lodash-mg4435Qq.js → lodash-B5I3zXaY.js} +1 -1
  63. package/dist/{membership-CqbsLHqx.js → membership-Ccrx9R6r.js} +3 -3
  64. package/dist/{money-DA_gtp3q.js → money-waD-f-Zz.js} +1 -1
  65. package/dist/{number-C388eyOu.js → number-CwTGGsh9.js} +1 -1
  66. package/dist/{rule-Clmr5y4j.js → rule-DJ07h3Gh.js} +2 -2
  67. package/dist/{rule-builder-BgqNbM-P.js → rule-builder-DJ-acvVD.js} +1 -1
  68. package/dist/style.css +1 -1
  69. package/dist/template-clxvNnbF.js +190 -0
  70. package/dist/{usePagination-o5fgsZwU.js → usePagination-BeF5K3M7.js} +86 -86
  71. package/dist/vue-i18n-BxwiXSkp.js +2365 -0
  72. package/dist/{xlsx-BRdh9e2p.js → xlsx-BB366cdN.js} +1945 -1945
  73. package/package.json +9 -5
  74. package/dist/Broadcast-X69Mtv3b.js +0 -216
  75. package/dist/Card-D0X3v1UF.js +0 -822
  76. package/dist/Collections-umR6Ehqf.js +0 -452
  77. package/dist/Credit-C1EWF7R0.js +0 -214
  78. package/dist/Experience-CqL8wyPm.js +0 -211
  79. package/dist/Game--kYe64EV.js +0 -250
  80. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-BjOJ3XSL.js +0 -144
  81. package/dist/Marketing-CTCQ5ZmZ.js +0 -308
  82. package/dist/Member-DCduX7zP.js +0 -91
  83. package/dist/MemberList-B0EkXZJu.js +0 -1729
  84. package/dist/MemberOverview-C2n9oJZh.js +0 -58
  85. package/dist/Mission-CVr9rS_D.js +0 -248
  86. package/dist/Point-BnZ6M74y.js +0 -220
  87. package/dist/Promotion-B0PUve5S.js +0 -218
  88. package/dist/Segment-B-XpkyM5.js +0 -445
  89. package/dist/Store-B2gywCt2.js +0 -1503
  90. package/dist/StoreRewards-D8410Q_-.js +0 -434
  91. package/dist/Transaction-CZBO4v4d.js +0 -36
  92. package/dist/Voucher-se-4JF9B.js +0 -481
  93. package/dist/app-B2ImSO3V.js +0 -53382
  94. package/dist/dto-BWpvRpK2.js +0 -1151
  95. package/dist/template-Dwp7heBA.js +0 -190
@@ -0,0 +1,39 @@
1
+ import { defineComponent as d, ref as f, resolveComponent as s, openBlock as t, createElementBlock as v, Fragment as b, createVNode as r, unref as o, createElementVNode as k, createBlock as l, KeepAlive as x, resolveDynamicComponent as m, createCommentVNode as F } from "vue";
2
+ import { _ as g, a as y } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-BjnCRKGX.js";
3
+ import { u as C } from "./vue-i18n-BxwiXSkp.js";
4
+ const T = { class: "px-24 flex flex-col gap-y-32 pb-24" }, P = /* @__PURE__ */ d({
5
+ __name: "Transaction",
6
+ setup(V) {
7
+ const { t: n } = C(), a = [
8
+ {
9
+ label: n("connect.transaction.tabs.collection"),
10
+ value: "collection"
11
+ },
12
+ {
13
+ label: n("connect.transaction.tabs.store"),
14
+ value: "store"
15
+ }
16
+ ], e = f(a[0]);
17
+ return (B, c) => {
18
+ const i = s("FmPageHead"), u = s("FmTabs");
19
+ return t(), v(b, null, [
20
+ r(i, {
21
+ title: o(n)("connect.transaction.title")
22
+ }, null, 8, ["title"]),
23
+ k("div", T, [
24
+ r(u, {
25
+ "model-value": o(e).value,
26
+ items: a,
27
+ "onUpdate:modelValue": c[0] || (c[0] = (p) => e.value = a.find((_) => _.value === p))
28
+ }, null, 8, ["model-value"]),
29
+ (t(), l(x, null, [
30
+ o(e).value == "collection" ? (t(), l(m(g), { key: 0 })) : o(e).value == "store" ? (t(), l(m(y), { key: 1 })) : F("", !0)
31
+ ], 1024))
32
+ ])
33
+ ], 64);
34
+ };
35
+ }
36
+ });
37
+ export {
38
+ P as default
39
+ };
@@ -0,0 +1,488 @@
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 C, 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-D_AN6p24.js";
5
+ import { useCoreStore as ie } from "@feedmepos/mf-common";
6
+ import { u as ce } from "./business-dQh3AEot.js";
7
+ import { u as re } from "./campaign-BOl8AgKA.js";
8
+ import { g as D, b as q } from "./dto-B8NfyVPG.js";
9
+ import "./index-DwKqFNF6.js";
10
+ import { u as ue } from "./template-clxvNnbF.js";
11
+ import { _ as me } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-D9VR3P2d.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 ve } from "./index-6FkKY3q0.js";
17
+ import { c as L } from "./index-UTQHDUdW.js";
18
+ import { u as ge } from "./vue-i18n-BxwiXSkp.js";
19
+ import { useRouter as ye } from "vue-router";
20
+ import { R as G } from "./app-Bd19eW7X.js";
21
+ const _e = { class: "space-y-16" }, be = { class: "fm-typo-en-body-md-600" }, Ce = { 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 = _(""), v = _({}), b = A, g = _(!1), u = _([]);
26
+ function U(i) {
27
+ g.value = !0, P.value = i.campaignId, u.value = [];
28
+ }
29
+ function m() {
30
+ g.value = !1;
31
+ }
32
+ const S = [
33
+ {
34
+ header: "Name",
35
+ accessorFn: (i) => i.name || "No Profile"
36
+ },
37
+ {
38
+ header: "Phone",
39
+ accessorFn: (i) => i.phoneNumber || "-"
40
+ }
41
+ ], c = _({
42
+ searchValue: "",
43
+ pageSize: 10,
44
+ pageCount: 0,
45
+ pageIndex: 0,
46
+ totalRows: 0,
47
+ isLoading: !1
48
+ }), f = _([]), w = async (i) => {
49
+ c.value.isLoading = !0, f.value = [];
50
+ const e = await ve.read({
51
+ limit: i.pageSize,
52
+ skip: i.pageIndex,
53
+ sortBy: "_id",
54
+ search: c.value.searchValue,
55
+ descending: !1
56
+ });
57
+ f.value = e.resources, c.value.totalRows = e.meta.totalResources ?? 0, c.value.pageCount = e.meta.totalPages ?? 0, c.value.isLoading = !1, v.value = {}, u.value.forEach((o) => {
58
+ const s = f.value.findIndex((d) => d._id == o);
59
+ s > -1 && (console.log(s, "fetch member index"), v.value[s] = !0);
60
+ });
61
+ };
62
+ function E() {
63
+ f.value.length > 0 && (u.value = u.value.filter(
64
+ (i) => !f.value.some((e) => e._id === i) || // Keep if not in current page
65
+ Object.entries(v.value).some(
66
+ ([e, o]) => o && f.value[e]._id === i
67
+ // Keep if selected in current page
68
+ )
69
+ ));
70
+ for (const [i, e] of Object.entries(v.value))
71
+ if (e) {
72
+ const o = f.value[i]._id;
73
+ u.value.includes(o) || u.value.push(o);
74
+ }
75
+ }
76
+ async function x(i) {
77
+ u.value.length < 1 || await R(
78
+ async () => {
79
+ await L.sendCollection(P.value, {
80
+ memberId: u.value
81
+ }), await b("success"), m();
82
+ },
83
+ {
84
+ message: "Sending claim(s)",
85
+ successMessage: "Claim(s) created"
86
+ }
87
+ );
88
+ }
89
+ return N(v, E, { deep: !0 }), N(
90
+ () => c.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(c.value);
99
+ }), (i, 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(g),
106
+ "onUpdate:modelValue": [
107
+ e[3] || (e[3] = (p) => j(g) ? g.value = p : null),
108
+ e[4] || (e[4] = (p) => g.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) => g.value = !1)
123
+ })
124
+ ])
125
+ ]),
126
+ default: M(() => [
127
+ r(pe, { json: t(u) }, null, 8, ["json"]),
128
+ l("div", _e, [
129
+ l("div", be, F(t(u).length) + " members selected ", 1),
130
+ l("div", Ce, [
131
+ r(o, {
132
+ class: "mt-4",
133
+ modelValue: t(c).searchValue,
134
+ "onUpdate:modelValue": e[0] || (e[0] = (p) => t(c).searchValue = p),
135
+ placeholder: "Search Member",
136
+ collapsible: ""
137
+ }, null, 8, ["modelValue"])
138
+ ]),
139
+ r(s, {
140
+ modelValue: t(v),
141
+ "onUpdate:modelValue": e[1] || (e[1] = (p) => j(v) ? v.value = p : null),
142
+ selection: "multiple",
143
+ loading: t(c).isLoading,
144
+ "row-data": t(f),
145
+ "column-defs": S,
146
+ "page-size": t(c).pageSize,
147
+ "page-count": t(c).pageCount,
148
+ "hide-footer": t(c).totalRows <= t(c).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-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" };
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 = { 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" }, no = /* @__PURE__ */ X({
160
+ __name: "Voucher",
161
+ setup(Q) {
162
+ const { t: a } = ge(), A = {
163
+ label: a("connect.voucher.createCampaign"),
164
+ value: "create",
165
+ isPrimary: !0,
166
+ prependIcon: "add"
167
+ }, R = se(), P = ue("VOUCHER", R), v = ce(), b = re(), { global: g, minor: u } = W, U = ye(), m = _({
168
+ searchKey: "",
169
+ location: null
170
+ }), S = oe(
171
+ () => b.campaigns.voucher.filter(
172
+ (e) => !m.value.location || !e.targetLocation || e.targetLocation.includes(m.value.location)
173
+ )
174
+ ), c = [
175
+ {
176
+ header: a("connect.voucher.voucherTitle"),
177
+ accessorFn: (e) => e.name
178
+ },
179
+ {
180
+ header: a("connect.voucher.status"),
181
+ cell(e) {
182
+ return D(e.row.original);
183
+ }
184
+ },
185
+ {
186
+ header: a("connect.voucher.summary"),
187
+ accessorFn: (e) => q(e)
188
+ },
189
+ {
190
+ header: a("connect.voucher.quota"),
191
+ accessorFn: (e) => {
192
+ var o;
193
+ return ((o = e.pf_collectible) == null ? void 0 : o.options.maxReceive) ?? "Unlimited";
194
+ }
195
+ },
196
+ {
197
+ header: a("connect.voucher.claimed"),
198
+ accessorFn: (e) => {
199
+ var o;
200
+ return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
201
+ }
202
+ },
203
+ {
204
+ header: a("connect.voucher.actions"),
205
+ cell(e) {
206
+ return C("div", { class: "flex items-center justify-end" }, [
207
+ C(V.FmButton, {
208
+ icon: "visibility",
209
+ variant: "tertiary",
210
+ iconColor: "neutral-gray-400",
211
+ onClick: async (o) => {
212
+ o.stopPropagation(), await U.push({
213
+ name: G["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
214
+ params: { id: e.row.original._id }
215
+ });
216
+ }
217
+ }),
218
+ C(
219
+ V.FmMenu,
220
+ {
221
+ placement: "bottom-end",
222
+ onClick: (o) => {
223
+ o.stopPropagation();
224
+ }
225
+ },
226
+ {
227
+ "menu-button": () => C(V.FmButton, {
228
+ icon: "more_vert",
229
+ iconColor: "neutral-gray-400",
230
+ variant: "tertiary"
231
+ }),
232
+ default: () => {
233
+ const o = [
234
+ C(
235
+ V.FmMenuItem,
236
+ {
237
+ onClick: async (s) => {
238
+ s.stopPropagation(), E(e.row.original);
239
+ }
240
+ },
241
+ {
242
+ label: C(
243
+ "div",
244
+ {
245
+ class: "text-fm-color-typo-error fm-typo-en-body-md-400"
246
+ },
247
+ a("connect.voucher.remove")
248
+ )
249
+ }
250
+ )
251
+ ];
252
+ return e.row.original.event.type === "SIMPLE_CLAIM" && (o.unshift(
253
+ C(V.FmMenuItem, {
254
+ label: a("connect.voucher.send"),
255
+ onClick: async (s) => {
256
+ var d;
257
+ s.stopPropagation(), (d = w.value) == null || d.showSheet({
258
+ campaignId: e.row.original._id
259
+ });
260
+ }
261
+ })
262
+ ), o.unshift(
263
+ C(V.FmMenuItem, {
264
+ label: a("connect.voucher.share"),
265
+ onClick: async (s) => {
266
+ if (s.stopPropagation(), e.row.original.event.type !== "SIMPLE_CLAIM")
267
+ return await z.confirm(
268
+ "Cannot share a voucher that is not a simple claim.",
269
+ "Share Voucher",
270
+ "OK"
271
+ );
272
+ await le(
273
+ `https://${ie().currentBusiness.value._id}.${xe.appUrl}/vouchers/${e.row.original._id}`,
274
+ {
275
+ successMessage: "Voucher link copied to clipboard"
276
+ }
277
+ );
278
+ }
279
+ })
280
+ )), o;
281
+ }
282
+ }
283
+ )
284
+ ]);
285
+ }
286
+ }
287
+ ], f = _(), w = _();
288
+ async function E(e) {
289
+ await z.remove(a("voucher.confirmRemove", { name: e.name })) && await u(
290
+ async () => {
291
+ await L.delete(e._id), await b.read("VOUCHER");
292
+ },
293
+ {
294
+ message: a("voucher.removing", { name: e.name }),
295
+ successMessage: a("voucher.removedSuccessfully", { name: e.name })
296
+ }
297
+ );
298
+ }
299
+ async function x(e) {
300
+ e ? await o() : P.open(async (s) => {
301
+ await o(s);
302
+ });
303
+ async function o(s) {
304
+ var d;
305
+ (d = f.value) == null || d.showSheet(
306
+ !0,
307
+ "VOUCHER",
308
+ e ? await L.readById(e._id) : void 0,
309
+ s
310
+ );
311
+ }
312
+ }
313
+ async function i(e) {
314
+ e.campaign._id && await new Promise((o) => {
315
+ R.open({
316
+ title: "Confirmation",
317
+ message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
318
+ primaryActions: { text: "Update all", close: !0 },
319
+ secondaryActions: { text: "Update future only", close: !0 }
320
+ }).onPrimary(async () => {
321
+ var s;
322
+ e.updateCollections = !0, (s = window.top) == null || s.postMessage("updateAllVoucher", "*"), o();
323
+ }).onSecondary(async () => {
324
+ o();
325
+ });
326
+ }), await u(
327
+ async () => {
328
+ e.campaign._id ? await L.update(e.campaign._id, e) : await L.create(e), await b.read("VOUCHER");
329
+ },
330
+ {
331
+ message: a(e.campaign._id ? "voucher.updating" : "voucher.creating"),
332
+ successMessage: a(
333
+ e.campaign._id ? "voucher.updatedSuccessfully" : "voucher.createdSuccessfully"
334
+ )
335
+ }
336
+ );
337
+ }
338
+ return J(async () => {
339
+ await g(async () => {
340
+ await b.read("VOUCHER");
341
+ });
342
+ }), (e, o) => {
343
+ const s = h("FmPageHead"), d = h("FmSearch"), B = h("FmTable"), p = h("FmButton"), Z = h("FmListItem"), Y = h("FmList"), ee = h("FmCard");
344
+ return y(), $(T, null, [
345
+ r(s, {
346
+ title: t(a)("connect.voucher.title"),
347
+ actions: t(S).length > 0 ? [A] : [],
348
+ "onClick:action": o[0] || (o[0] = () => x())
349
+ }, null, 8, ["title", "actions"]),
350
+ l("div", Ve, [
351
+ r(d, {
352
+ modelValue: t(m).searchKey,
353
+ "onUpdate:modelValue": o[1] || (o[1] = (n) => t(m).searchKey = n),
354
+ class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
355
+ placeholder: t(a)("connect.voucher.search"),
356
+ collapsible: ""
357
+ }, null, 8, ["modelValue", "placeholder"]),
358
+ t(b).campaigns.voucher && t(b).campaigns.voucher.length > 0 ? (y(), $(T, { key: 0 }, [
359
+ l("div", ke, [
360
+ l("div", Fe, [
361
+ r(de, {
362
+ modelValue: t(m).location,
363
+ "onUpdate:modelValue": o[2] || (o[2] = (n) => t(m).location = n),
364
+ label: t(a)("connect.voucher.location"),
365
+ "show-item-label": !0,
366
+ icon: "storefront",
367
+ placement: "bottom-start",
368
+ items: t(v).locationItems
369
+ }, null, 8, ["modelValue", "label", "items"])
370
+ ]),
371
+ r(d, {
372
+ modelValue: t(m).searchKey,
373
+ "onUpdate:modelValue": o[3] || (o[3] = (n) => t(m).searchKey = n),
374
+ class: "xs:hidden",
375
+ placeholder: t(a)("connect.voucher.search"),
376
+ collapsible: ""
377
+ }, null, 8, ["modelValue", "placeholder"])
378
+ ]),
379
+ r(B, {
380
+ class: "xs:hidden",
381
+ "row-data": t(S),
382
+ "column-defs": c,
383
+ "search-value": t(m).searchKey,
384
+ "column-filter": [],
385
+ onRowClick: o[4] || (o[4] = (n) => x(n.original)),
386
+ "hide-footer": t(S).length < 10
387
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
388
+ r(Y, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
389
+ default: M(() => [
390
+ (y(!0), $(T, null, te(t(S).filter(
391
+ (n) => n.name.toLowerCase().includes(t(m).searchKey.toLowerCase())
392
+ ), (n) => (y(), k(Z, {
393
+ key: n._id.toString(),
394
+ onClick: (O) => x(n),
395
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
396
+ }, {
397
+ default: M(() => {
398
+ var O;
399
+ return [
400
+ l("div", Ie, [
401
+ l("div", Le, [
402
+ (y(), k(ae(t(D)(n)))),
403
+ l("div", Me, F(((O = n.pf_collectible) == null ? void 0 : O.currentReceive) ?? 0) + " claimed ", 1)
404
+ ]),
405
+ l("div", Re, [
406
+ l("div", Pe, F(n.name), 1),
407
+ l("div", Ue, F(t(q)(n)), 1)
408
+ ])
409
+ ]),
410
+ l("div", Ee, [
411
+ n.event.type === "SIMPLE_CLAIM" ? (y(), k(p, {
412
+ key: 0,
413
+ icon: "visibility",
414
+ "icon-color": "neutral-gray-400",
415
+ variant: "tertiary",
416
+ onClick: async (I) => {
417
+ I.stopPropagation(), await t(U).push({
418
+ name: t(G)["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
419
+ params: { id: n._id }
420
+ });
421
+ }
422
+ }, null, 8, ["onClick"])) : K("", !0),
423
+ n.event.type === "SIMPLE_CLAIM" ? (y(), k(p, {
424
+ key: 1,
425
+ icon: "send",
426
+ "icon-color": "neutral-gray-400",
427
+ variant: "tertiary",
428
+ onClick: (I) => {
429
+ var H;
430
+ I.stopPropagation(), (H = t(w)) == null || H.showSheet({
431
+ campaignId: n._id
432
+ });
433
+ }
434
+ }, null, 8, ["onClick"])) : K("", !0),
435
+ r(p, {
436
+ icon: "delete",
437
+ "icon-color": "neutral-gray-400",
438
+ variant: "tertiary",
439
+ onClick: (I) => (I.stopPropagation(), E(n))
440
+ }, null, 8, ["onClick"])
441
+ ])
442
+ ];
443
+ }),
444
+ _: 2
445
+ }, 1032, ["onClick"]))), 128))
446
+ ]),
447
+ _: 1
448
+ })
449
+ ], 64)) : (y(), k(ee, {
450
+ key: 1,
451
+ variant: "outlined",
452
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
453
+ }, {
454
+ default: M(() => [
455
+ o[6] || (o[6] = l("img", {
456
+ src: ne,
457
+ class: "aspect-square w-[150px]"
458
+ }, null, -1)),
459
+ l("div", Ae, [
460
+ l("div", Be, F(t(a)("connect.voucher.createVoucherCampaign")), 1),
461
+ l("div", Oe, F(t(a)("connect.voucher.description")), 1)
462
+ ]),
463
+ r(p, {
464
+ variant: "primary",
465
+ label: t(a)("connect.voucher.createVoucherCampaign"),
466
+ icon: "add",
467
+ onClick: o[5] || (o[5] = (n) => x())
468
+ }, null, 8, ["label"])
469
+ ]),
470
+ _: 1
471
+ })),
472
+ r(me, {
473
+ ref_key: "sheetRef",
474
+ ref: f,
475
+ "onSubmit:modelValue": i
476
+ }, null, 512),
477
+ r(Se, {
478
+ ref_key: "sendVoucherSheetRef",
479
+ ref: w
480
+ }, null, 512)
481
+ ])
482
+ ], 64);
483
+ };
484
+ }
485
+ });
486
+ export {
487
+ no as default
488
+ };
@@ -0,0 +1,28 @@
1
+ var u = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2
+ function f(e) {
3
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
4
+ }
5
+ function l(e) {
6
+ if (e.__esModule) return e;
7
+ var r = e.default;
8
+ if (typeof r == "function") {
9
+ var t = function o() {
10
+ return this instanceof o ? Reflect.construct(r, arguments, this.constructor) : r.apply(this, arguments);
11
+ };
12
+ t.prototype = r.prototype;
13
+ } else t = {};
14
+ return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(e).forEach(function(o) {
15
+ var n = Object.getOwnPropertyDescriptor(e, o);
16
+ Object.defineProperty(t, o, n.get ? n : {
17
+ enumerable: !0,
18
+ get: function() {
19
+ return e[o];
20
+ }
21
+ });
22
+ }), t;
23
+ }
24
+ export {
25
+ l as a,
26
+ u as c,
27
+ f as g
28
+ };
@@ -0,0 +1,9 @@
1
+ const s = (t, r) => {
2
+ const o = t.__vccOpts || t;
3
+ for (const [c, e] of r)
4
+ o[c] = e;
5
+ return o;
6
+ };
7
+ export {
8
+ s as _
9
+ };