@feedmepos/mf-connect 0.1.57-prod → 0.1.58-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 (128) hide show
  1. package/package.json +1 -1
  2. package/dist/Analytic-BqvhYgCU.js +0 -427
  3. package/dist/App-Dtl_D0cH.js +0 -4630
  4. package/dist/Bin-y4ikpgPS.js +0 -166
  5. package/dist/Broadcast-DSROFwe4.js +0 -233
  6. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CcsG6vOP.js +0 -121
  7. package/dist/Card-BiSEPsZb.js +0 -911
  8. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
  9. package/dist/Collections-CX-nN7Xj.js +0 -458
  10. package/dist/Credit-IiV9b4cB.js +0 -228
  11. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CoGes8YL.js +0 -2194
  13. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-sGh_SMCH.js +0 -348
  14. package/dist/Experience-Cf-EMhKy.js +0 -229
  15. package/dist/FileSaver.min-NlMItPOc.js +0 -74
  16. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  17. package/dist/Game-C8mfJn6W.js +0 -284
  18. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js +0 -144
  19. package/dist/Index-DkvO1AoT.js +0 -259
  20. package/dist/JsonViewer-v8_C7l5N.js +0 -87
  21. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +0 -18737
  22. package/dist/MainLayout-B1aJoR95.js +0 -41
  23. package/dist/Marketing-xJTIo3RF.js +0 -319
  24. package/dist/Member-DZkYoKW8.js +0 -279
  25. package/dist/MemberList-CAYEJnf3.js +0 -1607
  26. package/dist/MemberOverview-wL_ailso.js +0 -58
  27. package/dist/MemberTransactions-Dc5aAQ69.js +0 -45
  28. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-BSvlPzw8.js +0 -60553
  29. package/dist/Mission-C_NbNWZw.js +0 -302
  30. package/dist/Overview-DyxEwEfe.js +0 -1079
  31. package/dist/Point-CsEWk61V.js +0 -232
  32. package/dist/Promotion--pWgy9Dx.js +0 -289
  33. package/dist/Queue-k3qAQR7B.js +0 -260
  34. package/dist/Record-D5F5JyVA.js +0 -341
  35. package/dist/Reward-3FSrq5mX.js +0 -442
  36. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-Dzj7a7UY.js +0 -150
  37. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DRl_Gjfx.js +0 -1763
  38. package/dist/Segment-BWJn6ODR.js +0 -882
  39. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BKsV_zcr.js +0 -181
  40. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-C3efGNC_.js +0 -188
  41. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-Cj7c2V3h.js +0 -147
  42. package/dist/Setting-UiTXazZV.js +0 -1936
  43. package/dist/Store-BrvmHPCX.js +0 -1842
  44. package/dist/StoreRewards-D_7fr-Ef.js +0 -423
  45. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BXy0L5AH.js +0 -995
  46. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DumcDlBs.js +0 -139
  47. package/dist/Tier-C4wvx8F7.js +0 -895
  48. package/dist/Title-CPHT85Uj.js +0 -566
  49. package/dist/Transaction-6Ig2W00P.js +0 -39
  50. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-DknFkIJh.js +0 -130
  51. package/dist/Voucher-Bbl-7gZ5.js +0 -384
  52. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-xsswRZG8.js +0 -419
  53. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-B5J6Hd8G.js +0 -56
  54. package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
  55. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  56. package/dist/app-BDVZwARN.js +0 -7057
  57. package/dist/app-CAEhNFRG.js +0 -57962
  58. package/dist/app-wDQR6dpb.js +0 -39
  59. package/dist/app.js +0 -6
  60. package/dist/business-6C_ol5wd.js +0 -82
  61. package/dist/campaign-B13G6pZ3.js +0 -1810
  62. package/dist/campaign-CpzFl8Vr.js +0 -4
  63. package/dist/campaign-DrQp6qBu.js +0 -94
  64. package/dist/campaign.enum-DnTrlaNC.js +0 -20
  65. package/dist/campaign.fn-BZse90_k.js +0 -758
  66. package/dist/collectible.enum-633Me0yR.js +0 -19
  67. package/dist/collection.fn-C96855j5.js +0 -26
  68. package/dist/dto-2bMujqmZ.js +0 -216
  69. package/dist/effect-C7lAJwKh.js +0 -78
  70. package/dist/email-addresses-3ayN-9jv.js +0 -705
  71. package/dist/export-BNbDV7SC.js +0 -97
  72. package/dist/feedme.ico +0 -0
  73. package/dist/helper-CsfZ__dQ.js +0 -71
  74. package/dist/index-BLSAz0gK.js +0 -32
  75. package/dist/index-BY9I3Cer.js +0 -3
  76. package/dist/index-BdnRNcVO.js +0 -146
  77. package/dist/index-BmyNfpfG.js +0 -30076
  78. package/dist/index-CSBRkhKy.js +0 -38
  79. package/dist/index-Cf_fcvoS.js +0 -54
  80. package/dist/index-CqrO13uj.js +0 -76
  81. package/dist/index-CuvNtC_M.js +0 -61
  82. package/dist/index-D4kdSzs9.js +0 -3070
  83. package/dist/index-DcJq7tl4.js +0 -32269
  84. package/dist/index-DdjSIwSL.js +0 -44
  85. package/dist/index-LKr2k8J2.js +0 -8861
  86. package/dist/index-XAxwm-1v.js +0 -2130
  87. package/dist/index-b82LrGSB.js +0 -121
  88. package/dist/index-tcAb0W5F.js +0 -31
  89. package/dist/index-vh86FiIQ.js +0 -10
  90. package/dist/index.esm2017-BklqmujQ.js +0 -3069
  91. package/dist/loading-OXARGiqO.js +0 -71
  92. package/dist/lodash-B5I3zXaY.js +0 -3678
  93. package/dist/membership-D1Vb1rUo.js +0 -235
  94. package/dist/moment-D7p2TMB-.js +0 -2583
  95. package/dist/money-BpyAytEq.js +0 -15
  96. package/dist/number-C-PtPOOj.js +0 -12
  97. package/dist/object-qECH92oz.js +0 -26
  98. package/dist/objectId-dwaoBfJX.js +0 -7
  99. package/dist/objectid-BrLIKTmQ.js +0 -145
  100. package/dist/plugins-CjPWhNb2.js +0 -208
  101. package/dist/reward-DonQFzvW.js +0 -36
  102. package/dist/rule-AtNPBnbE.js +0 -1951
  103. package/dist/rule-builder-C0Q-3g6T.js +0 -102
  104. package/dist/style.css +0 -4
  105. package/dist/template-CNjE7eht.js +0 -190
  106. package/dist/tier-BJDhpH6X.js +0 -4
  107. package/dist/tiers/tier=1.png +0 -0
  108. package/dist/tiers/tier=2.png +0 -0
  109. package/dist/tiers/tier=3.png +0 -0
  110. package/dist/tiers/tier=4.png +0 -0
  111. package/dist/timezone-CYbdI3q2.js +0 -1151
  112. package/dist/titles/type=diamond.png +0 -0
  113. package/dist/titles/type=drinks.png +0 -0
  114. package/dist/titles/type=food.png +0 -0
  115. package/dist/titles/type=heart.png +0 -0
  116. package/dist/titles/type=medal.png +0 -0
  117. package/dist/titles/type=spend.png +0 -0
  118. package/dist/titles/type=thank-you.png +0 -0
  119. package/dist/titles/type=thumbs-up.png +0 -0
  120. package/dist/titles/type=years.png +0 -0
  121. package/dist/trigger-Bdi6n80h.js +0 -144
  122. package/dist/tslib.es6-BCqqvLQ_.js +0 -44
  123. package/dist/type_drinks-D6jnpvwV.js +0 -4
  124. package/dist/usePagination-Ds-cuHop.js +0 -223
  125. package/dist/user-BwGm78n8.js +0 -54
  126. package/dist/vue-i18n-D1nTd69a.js +0 -2365
  127. package/dist/xlsx-DF5iW3wh.js +0 -15491
  128. package/dist/zod-Bg2FbC-D.js +0 -90
@@ -1,39 +0,0 @@
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-BXy0L5AH.js";
3
- import { u as C } from "./vue-i18n-D1nTd69a.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
- };
@@ -1,130 +0,0 @@
1
- import { defineComponent as y, computed as b, openBlock as i, createBlock as R, unref as l, ref as E, watch as k, resolveComponent as h, createElementBlock as g, createElementVNode as B, Fragment as O, renderList as T, createVNode as V, isRef as U, createCommentVNode as v } from "vue";
2
- import "./index-LKr2k8J2.js";
3
- import { i as C, R as e } from "./rule-builder-C0Q-3g6T.js";
4
- import { _ as I } from "./RuleGroup.vue_vue_type_script_setup_true_lang-DRl_Gjfx.js";
5
- import { p as N } from "./plugins-CjPWhNb2.js";
6
- import { u as S } from "./membership-D1Vb1rUo.js";
7
- import { _ as j } from "./CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js";
8
- import { u as x } from "./vue-i18n-D1nTd69a.js";
9
- const A = /* @__PURE__ */ y({
10
- __name: "SegmentConfigurator",
11
- props: {
12
- modelValue: {
13
- type: Object,
14
- required: !0
15
- }
16
- },
17
- emits: ["update:model-value"],
18
- setup(n, { emit: f }) {
19
- const o = n, m = b(() => {
20
- var s;
21
- const [u] = C(o.modelValue) ? Object.values(((s = o.modelValue) == null ? void 0 : s.rules) ?? {}) : [null];
22
- return (u ?? e.constructEntry("user.segment", "_hasAny", [])).conditions._hasAny;
23
- }), r = f;
24
- return (u, c) => (i(), R(j, {
25
- multiselect: !0,
26
- items: l(S)().segmentOptions,
27
- "model-value": l(m),
28
- "onUpdate:modelValue": c[0] || (c[0] = (s) => r(
29
- "update:model-value",
30
- l(e).setRuleToGroup(
31
- l(e).scaffoldGroup("g_segment"),
32
- l(e).constructEntry("user.segment", "_hasAny", s)
33
- )
34
- )),
35
- label: "Select segment(s) to match"
36
- }, null, 8, ["items", "model-value"]));
37
- }
38
- }), F = { class: "space-y-16" }, M = { key: 0 }, z = /* @__PURE__ */ y({
39
- __name: "UserRuleGroup",
40
- props: {
41
- modelValue: {
42
- type: Object,
43
- default: () => {
44
- }
45
- }
46
- },
47
- emits: ["update:model-value"],
48
- setup(n, { emit: f }) {
49
- const { t: o } = x(), m = n, r = f, u = E(
50
- m.modelValue ? e.getRules(m.modelValue.rules.g_user).length > 0 ? "custom" : e.getRules(m.modelValue.rules.g_segment).length > 0 ? "segment" : "all_users" : "all_users"
51
- ), c = [
52
- {
53
- value: "all_users",
54
- label: o("connect.template.rule.audience.all")
55
- },
56
- {
57
- value: "segment",
58
- label: o("connect.template.rule.audience.member_segment")
59
- },
60
- {
61
- value: "custom",
62
- label: o("connect.template.rule.audience.custom_audience")
63
- }
64
- ];
65
- return k(u, async (s, t) => {
66
- var p;
67
- if (t != "all_users" && t != s && e.getRules(
68
- (p = m.modelValue) == null ? void 0 : p.rules[t == "custom" ? "g_user" : "g_segment"]
69
- ).length > 0) {
70
- const d = await N.confirm(
71
- o("connect.template.rule.audience.confirm_remove"),
72
- o("connect.common.confirm"),
73
- o("connect.common.confirm"),
74
- o("connect.common.cancel")
75
- );
76
- d && r(
77
- "update:model-value",
78
- e.setRuleToGroup(
79
- m.modelValue ?? e.scaffoldGroup(),
80
- e.scaffoldGroup(t == "custom" ? "g_user" : "g_segment")
81
- )
82
- ), u.value = d ? s : t;
83
- }
84
- }), (s, t) => {
85
- var d, _;
86
- const p = h("FmRadio");
87
- return i(), g("div", F, [
88
- B("div", null, [
89
- (i(), g(O, null, T(c, (a) => V(p, {
90
- key: a.value,
91
- value: a.value,
92
- label: a.label,
93
- modelValue: l(u),
94
- "onUpdate:modelValue": t[0] || (t[0] = (G) => U(u) ? u.value = G : null)
95
- }, null, 8, ["value", "label", "modelValue"])), 64))
96
- ]),
97
- l(u) == "segment" ? (i(), g("div", M, [
98
- V(A, {
99
- modelValue: ((d = n.modelValue) == null ? void 0 : d.rules.g_segment) ?? l(e).scaffoldGroup("g_segment"),
100
- "onUpdate:modelValue": t[1] || (t[1] = (a) => r(
101
- "update:model-value",
102
- l(e).setRuleToGroup(
103
- n.modelValue ?? l(e).scaffoldGroup(),
104
- a,
105
- "&&"
106
- )
107
- ))
108
- }, null, 8, ["modelValue"])
109
- ])) : v("", !0),
110
- l(u) == "custom" ? (i(), R(I, {
111
- key: 1,
112
- "include-only": "user",
113
- "trigger-type": "MEMBERSHIP_JOINED",
114
- "model-value": ((_ = n.modelValue) == null ? void 0 : _.rules.g_user) ?? l(e).scaffoldGroup("g_user"),
115
- "onUpdate:modelValue": t[2] || (t[2] = (a) => r(
116
- "update:model-value",
117
- l(e).setRuleToGroup(
118
- n.modelValue ?? l(e).scaffoldGroup(),
119
- a,
120
- "&&"
121
- )
122
- ))
123
- }, null, 8, ["model-value"])) : v("", !0)
124
- ]);
125
- };
126
- }
127
- });
128
- export {
129
- z as _
130
- };
@@ -1,384 +0,0 @@
1
- import { defineComponent as Y, ref as x, computed as ee, h as m, onMounted as oe, resolveComponent as d, openBlock as u, createElementBlock as V, Fragment as S, createVNode as l, unref as t, createElementVNode as c, withCtx as F, renderList as te, createBlock as h, resolveDynamicComponent as ne, toDisplayString as g, createCommentVNode as E } from "vue";
2
- import { _ as ae } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as re, components as f } from "@feedmepos/ui-library";
4
- import { _ as M } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
5
- import { p as A, a as ce } from "./plugins-CjPWhNb2.js";
6
- import { useCoreStore as ie } from "@feedmepos/mf-common";
7
- import { u as se } from "./loading-OXARGiqO.js";
8
- import { u as le } from "./business-6C_ol5wd.js";
9
- import { u as me } from "./campaign-DrQp6qBu.js";
10
- import { g as ue, a as O, b as B } from "./campaign-B13G6pZ3.js";
11
- import "./index-BY9I3Cer.js";
12
- import { u as de } from "./template-CNjE7eht.js";
13
- import { _ as pe } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-CoGes8YL.js";
14
- import { _ as fe } from "./SendVoucherSheet.vue_vue_type_script_setup_true_lang-Cj7c2V3h.js";
15
- import { u as ye } from "./vue-i18n-D1nTd69a.js";
16
- import { T as he } from "./trigger-Bdi6n80h.js";
17
- import { useRouter as ge } from "vue-router";
18
- import { c as w } from "./index-b82LrGSB.js";
19
- import { R as H } from "./app-BDVZwARN.js";
20
- var _e = { 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", licensePortalUrl: "https://license.feedme.cc/", marketingV1Portal: "https://marketing-v1.feedme.cc" };
21
- const ve = { class: "px-24 flex flex-col gap-y-16" }, Ce = { class: "flex items-center justify-between w-full" }, we = { class: "flex gap-8 overflow-x-auto" }, be = { class: "space-y-8" }, ke = { class: "flex w-full gap-4 items-center" }, xe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ve = { class: "space-y-4" }, Se = { class: "fm-typo-en-body-lg-600" }, Fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Le = { class: "flex gap-8 items-center" }, Te = { class: "flex flex-col gap-16 text-center" }, Ue = { class: "fm-typo-en-title-sm-800" }, Pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Je = /* @__PURE__ */ Y({
22
- __name: "Voucher",
23
- setup(Ie) {
24
- const { t: a } = ye(), $ = {
25
- label: a("connect.voucher.createCampaign"),
26
- value: "create",
27
- isPrimary: !0,
28
- prependIcon: "add"
29
- }, L = re(), K = de("VOUCHER", L), N = le(), p = me(), { global: D, minor: T } = se, U = ge(), i = x({
30
- searchKey: "",
31
- location: [],
32
- triggerType: []
33
- }), _ = ee(
34
- () => p.campaigns.voucher.filter(
35
- (e) => q(e) && G(e)
36
- )
37
- ), j = he.VOUCHER.map((e) => ({
38
- label: e.name,
39
- value: e.value
40
- }));
41
- function q(e) {
42
- const o = i.value.location;
43
- return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some(
44
- (r) => {
45
- var s;
46
- return (s = e == null ? void 0 : e.targetLocation) == null ? void 0 : s.includes(r);
47
- }
48
- ) : e.targetLocation.includes(o);
49
- }
50
- function G(e) {
51
- const o = i.value.triggerType;
52
- if (!o || o.length === 0) return !0;
53
- const r = e.event.type;
54
- return o.includes(r);
55
- }
56
- const X = [
57
- {
58
- header: a("connect.voucher.voucherTitle"),
59
- accessorFn: (e) => e.name
60
- },
61
- {
62
- header: a("connect.voucher.status"),
63
- accessorFn: (e) => ue(e),
64
- cell(e) {
65
- return O(e.row.original);
66
- }
67
- },
68
- {
69
- header: a("connect.voucher.summary"),
70
- accessorFn: (e) => B(e)
71
- },
72
- {
73
- header: a("connect.voucher.quota"),
74
- accessorFn: (e) => {
75
- var o;
76
- return ((o = e.pf_collectible) == null ? void 0 : o.options.maxReceive) ?? "Unlimited";
77
- }
78
- },
79
- {
80
- header: a("connect.voucher.claimed"),
81
- accessorFn: (e) => {
82
- var o;
83
- return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
84
- }
85
- },
86
- {
87
- header: a("connect.voucher.actions"),
88
- cell(e) {
89
- return m("div", { class: "flex items-center justify-end" }, [
90
- m(f.FmButton, {
91
- icon: "visibility",
92
- variant: "tertiary",
93
- iconColor: "neutral-gray-400",
94
- onClick: async (o) => {
95
- o.stopPropagation(), await U.push({
96
- name: H["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
97
- params: { id: e.row.original._id }
98
- });
99
- }
100
- }),
101
- m(
102
- f.FmMenu,
103
- {
104
- placement: "bottom-end",
105
- onClick: (o) => {
106
- o.stopPropagation();
107
- }
108
- },
109
- {
110
- "menu-button": () => m(f.FmButton, {
111
- icon: "more_vert",
112
- iconColor: "neutral-gray-400",
113
- variant: "tertiary"
114
- }),
115
- default: () => {
116
- const o = [
117
- m(
118
- f.FmMenuItem,
119
- {
120
- onClick: async (r) => {
121
- r.stopPropagation(), I(e.row.original);
122
- }
123
- },
124
- {
125
- label: m(
126
- "div",
127
- {
128
- class: "text-fm-color-typo-error fm-typo-en-body-md-400"
129
- },
130
- a("connect.voucher.remove")
131
- )
132
- }
133
- )
134
- ];
135
- return e.row.original.event.type === "SIMPLE_CLAIM" && (o.unshift(
136
- m(f.FmMenuItem, {
137
- label: a("connect.voucher.send"),
138
- onClick: async (r) => {
139
- var s;
140
- r.stopPropagation(), (s = b.value) == null || s.showSheet({
141
- campaignId: e.row.original._id
142
- });
143
- }
144
- })
145
- ), o.unshift(
146
- m(f.FmMenuItem, {
147
- label: a("connect.voucher.share"),
148
- onClick: async (r) => {
149
- if (r.stopPropagation(), e.row.original.event.type !== "SIMPLE_CLAIM")
150
- return await A.confirm(
151
- "Cannot share a voucher that is not a simple claim.",
152
- "Share Voucher",
153
- "OK"
154
- );
155
- await ce(
156
- `https://${ie().currentBusiness.value._id}.${_e.appUrl}/vouchers/${e.row.original._id}`,
157
- {
158
- successMessage: "Voucher link copied to clipboard"
159
- }
160
- );
161
- }
162
- })
163
- )), o;
164
- }
165
- }
166
- )
167
- ]);
168
- }
169
- }
170
- ], P = x(), b = x();
171
- async function I(e) {
172
- await A.remove(a("connect.voucher.confirmRemove", { name: e.name })) && await T(
173
- async () => {
174
- await w.delete(e._id), await p.read("VOUCHER");
175
- },
176
- {
177
- message: a("connect.voucher.removing", { name: e.name }),
178
- successMessage: a("connect.voucher.removedSuccessfully", {
179
- name: e.name
180
- })
181
- }
182
- );
183
- }
184
- async function v(e) {
185
- e ? await o() : K.open(async (r) => {
186
- await o(r);
187
- });
188
- async function o(r) {
189
- var s;
190
- (s = P.value) == null || s.showSheet(
191
- !0,
192
- "VOUCHER",
193
- e ? await w.readById(e._id) : void 0,
194
- r
195
- );
196
- }
197
- }
198
- async function W(e) {
199
- e.campaign._id && await new Promise((o) => {
200
- L.open({
201
- title: "Confirmation",
202
- message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
203
- primaryActions: { text: "Update all", close: !0 },
204
- secondaryActions: { text: "Update future only", close: !0 }
205
- }).onPrimary(async () => {
206
- var r;
207
- e.updateCollections = !0, (r = window.top) == null || r.postMessage("updateAllVoucher", "*"), o();
208
- }).onSecondary(async () => {
209
- o();
210
- });
211
- }), await T(
212
- async () => {
213
- e.campaign._id ? await w.update(e.campaign._id, e) : await w.create(e), await p.read("VOUCHER");
214
- },
215
- {
216
- message: a(
217
- e.campaign._id ? "connect.voucher.updating" : "connect.voucher.creating"
218
- ),
219
- successMessage: a(
220
- e.campaign._id ? "connect.voucher.updatedSuccessfully" : "connect.voucher.createdSuccessfully"
221
- )
222
- }
223
- );
224
- }
225
- return oe(async () => {
226
- await D(async () => {
227
- await p.read("VOUCHER");
228
- });
229
- }), (e, o) => {
230
- const r = d("FmPageHead"), s = d("FmSearch"), z = d("FmTable"), C = d("FmButton"), Q = d("FmListItem"), Z = d("FmList"), J = d("FmCard");
231
- return u(), V(S, null, [
232
- l(r, {
233
- title: t(a)("connect.voucher.title"),
234
- actions: t(_).length > 0 ? [$] : [],
235
- "onClick:action": o[0] || (o[0] = () => v())
236
- }, null, 8, ["title", "actions"]),
237
- c("div", ve, [
238
- l(s, {
239
- modelValue: t(i).searchKey,
240
- "onUpdate:modelValue": o[1] || (o[1] = (n) => t(i).searchKey = n),
241
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
242
- placeholder: t(a)("connect.voucher.search"),
243
- collapsible: ""
244
- }, null, 8, ["modelValue", "placeholder"]),
245
- t(p).campaigns.voucher && t(p).campaigns.voucher.length > 0 ? (u(), V(S, { key: 0 }, [
246
- c("div", Ce, [
247
- c("div", we, [
248
- l(M, {
249
- label: `${t(a)("connect.common.location")}: `,
250
- "right-icon": "keyboard_arrow_down",
251
- modelValue: t(i).location,
252
- "onUpdate:modelValue": o[2] || (o[2] = (n) => t(i).location = n),
253
- icon: "storefront",
254
- "show-item-label": !0,
255
- items: t(N).locationOptions
256
- }, null, 8, ["label", "modelValue", "items"]),
257
- l(M, {
258
- label: "Type:",
259
- "right-icon": "keyboard_arrow_down",
260
- modelValue: t(i).triggerType,
261
- "onUpdate:modelValue": o[3] || (o[3] = (n) => t(i).triggerType = n),
262
- icon: "filter_list",
263
- "show-item-label": !0,
264
- items: t(j)
265
- }, null, 8, ["modelValue", "items"])
266
- ]),
267
- l(s, {
268
- modelValue: t(i).searchKey,
269
- "onUpdate:modelValue": o[4] || (o[4] = (n) => t(i).searchKey = n),
270
- class: "xs:hidden",
271
- placeholder: t(a)("connect.voucher.search"),
272
- collapsible: ""
273
- }, null, 8, ["modelValue", "placeholder"])
274
- ]),
275
- l(z, {
276
- class: "xs:hidden",
277
- "row-data": t(_),
278
- "column-defs": X,
279
- "search-value": t(i).searchKey,
280
- "column-filter": [],
281
- onRowClick: o[5] || (o[5] = (n) => v(n.original)),
282
- "hide-footer": t(_).length < 10
283
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
284
- l(Z, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
285
- default: F(() => [
286
- (u(!0), V(S, null, te(t(_).filter(
287
- (n) => n.name.toLowerCase().includes(t(i).searchKey.toLowerCase())
288
- ), (n) => (u(), h(Q, {
289
- key: n._id.toString(),
290
- onClick: (k) => v(n),
291
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
292
- }, {
293
- default: F(() => {
294
- var k;
295
- return [
296
- c("div", be, [
297
- c("div", ke, [
298
- (u(), h(ne(t(O)(n)))),
299
- c("div", xe, g(((k = n.pf_collectible) == null ? void 0 : k.currentReceive) ?? 0) + " claimed ", 1)
300
- ]),
301
- c("div", Ve, [
302
- c("div", Se, g(n.name), 1),
303
- c("div", Fe, g(t(B)(n)), 1)
304
- ])
305
- ]),
306
- c("div", Le, [
307
- n.event.type === "SIMPLE_CLAIM" ? (u(), h(C, {
308
- key: 0,
309
- icon: "visibility",
310
- "icon-color": "neutral-gray-400",
311
- variant: "tertiary",
312
- onClick: async (y) => {
313
- y.stopPropagation(), await t(U).push({
314
- name: t(H)["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
315
- params: { id: n._id }
316
- });
317
- }
318
- }, null, 8, ["onClick"])) : E("", !0),
319
- n.event.type === "SIMPLE_CLAIM" ? (u(), h(C, {
320
- key: 1,
321
- icon: "send",
322
- "icon-color": "neutral-gray-400",
323
- variant: "tertiary",
324
- onClick: (y) => {
325
- var R;
326
- y.stopPropagation(), (R = t(b)) == null || R.showSheet({
327
- campaignId: n._id
328
- });
329
- }
330
- }, null, 8, ["onClick"])) : E("", !0),
331
- l(C, {
332
- icon: "delete",
333
- "icon-color": "neutral-gray-400",
334
- variant: "tertiary",
335
- onClick: (y) => (y.stopPropagation(), I(n))
336
- }, null, 8, ["onClick"])
337
- ])
338
- ];
339
- }),
340
- _: 2
341
- }, 1032, ["onClick"]))), 128))
342
- ]),
343
- _: 1
344
- })
345
- ], 64)) : (u(), h(J, {
346
- key: 1,
347
- variant: "outlined",
348
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
349
- }, {
350
- default: F(() => [
351
- o[7] || (o[7] = c("img", {
352
- src: ae,
353
- class: "aspect-square w-[150px]"
354
- }, null, -1)),
355
- c("div", Te, [
356
- c("div", Ue, g(t(a)("connect.voucher.createVoucherCampaign")), 1),
357
- c("div", Pe, g(t(a)("connect.voucher.description")), 1)
358
- ]),
359
- l(C, {
360
- variant: "primary",
361
- label: t(a)("connect.voucher.createVoucherCampaign"),
362
- icon: "add",
363
- onClick: o[6] || (o[6] = (n) => v())
364
- }, null, 8, ["label"])
365
- ]),
366
- _: 1
367
- })),
368
- l(pe, {
369
- ref_key: "sheetRef",
370
- ref: P,
371
- "onSubmit:modelValue": W
372
- }, null, 512),
373
- l(fe, {
374
- ref_key: "sendVoucherSheetRef",
375
- ref: b
376
- }, null, 512)
377
- ])
378
- ], 64);
379
- };
380
- }
381
- });
382
- export {
383
- Je as default
384
- };