@feedmepos/mf-connect 0.1.58-prod → 0.1.60-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 (129) hide show
  1. package/dist/Analytic-CB0xAr9Q.js +427 -0
  2. package/dist/App-fp_3oll7.js +4630 -0
  3. package/dist/Bin-CPEbn14A.js +166 -0
  4. package/dist/Broadcast-jKp2iB8c.js +233 -0
  5. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CmJG893h.js +121 -0
  6. package/dist/Card-BaPJkgd2.js +911 -0
  7. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
  8. package/dist/Collections-Bqsg-ON3.js +458 -0
  9. package/dist/Credit-C9zIva1h.js +228 -0
  10. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
  11. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CSMV8OwA.js +2194 -0
  12. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-Doyw0pvU.js +348 -0
  13. package/dist/Experience-CCI_oesa.js +229 -0
  14. package/dist/FileSaver.min-NlMItPOc.js +74 -0
  15. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  16. package/dist/Game-CRMVz1JP.js +284 -0
  17. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js +144 -0
  18. package/dist/Index-szNiSnjR.js +259 -0
  19. package/dist/JsonViewer-v8_C7l5N.js +87 -0
  20. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +18737 -0
  21. package/dist/MainLayout-B1aJoR95.js +41 -0
  22. package/dist/Marketing-AvEiNiD9.js +319 -0
  23. package/dist/Member-DIZwt6Hh.js +279 -0
  24. package/dist/MemberList-dxteIRWn.js +1607 -0
  25. package/dist/MemberOverview-wL_ailso.js +58 -0
  26. package/dist/MemberTransactions-Q3phmXfI.js +45 -0
  27. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-BLk8rX-T.js +60553 -0
  28. package/dist/Mission-CZjySlcS.js +302 -0
  29. package/dist/Overview-BXbWEDy3.js +1079 -0
  30. package/dist/Point-CgjNc_Qn.js +232 -0
  31. package/dist/Promotion-COYo3qLi.js +289 -0
  32. package/dist/Queue-BLIStJth.js +260 -0
  33. package/dist/Record-BWoTvVEE.js +341 -0
  34. package/dist/Reward-Dq6GxHMP.js +442 -0
  35. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-CR1feHth.js +150 -0
  36. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DuYYfbOH.js +1763 -0
  37. package/dist/Segment-CUfn6k5R.js +882 -0
  38. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-CxycOqNJ.js +181 -0
  39. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-C7jqrfEj.js +188 -0
  40. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-CMmdbYH4.js +147 -0
  41. package/dist/Setting-CC5AiQSy.js +1928 -0
  42. package/dist/SettingAdvertisements-DHQTaMC1.js +262 -0
  43. package/dist/Store-CEgv5aOD.js +1842 -0
  44. package/dist/StoreRewards-Dtzk_YG2.js +423 -0
  45. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Cwt8pmoM.js +995 -0
  46. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-BEU2u1-a.js +139 -0
  47. package/dist/Tier-1xqQvWzc.js +895 -0
  48. package/dist/Title-Da-G8plz.js +566 -0
  49. package/dist/Transaction-B0vuVZFZ.js +39 -0
  50. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-e4-wNfrg.js +130 -0
  51. package/dist/Voucher-DLFjkXLu.js +384 -0
  52. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-5X7dGFD9.js +419 -0
  53. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-BPTrvEwa.js +56 -0
  54. package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
  55. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  56. package/dist/app-Do_C3F_N.js +7094 -0
  57. package/dist/app-o7Kvv5aK.js +57962 -0
  58. package/dist/app-wDQR6dpb.js +39 -0
  59. package/dist/app.js +6 -0
  60. package/dist/business-BDi-QTa5.js +82 -0
  61. package/dist/campaign-BHqizYy6.js +1810 -0
  62. package/dist/campaign-CpzFl8Vr.js +4 -0
  63. package/dist/campaign-DNXI3K9c.js +94 -0
  64. package/dist/campaign.enum-BXDwYoeA.js +20 -0
  65. package/dist/campaign.fn-Rws4mJa5.js +758 -0
  66. package/dist/collectible.enum-cMc4fL1T.js +19 -0
  67. package/dist/collection.fn-F8FZ7Dnr.js +26 -0
  68. package/dist/dto-CAtf1jq0.js +216 -0
  69. package/dist/effect-Dhg1ZIrL.js +78 -0
  70. package/dist/email-addresses-BZJZwglQ.js +705 -0
  71. package/dist/export-B6yvRuct.js +97 -0
  72. package/dist/feedme.ico +0 -0
  73. package/dist/helper-VoErinsY.js +71 -0
  74. package/dist/index-B0Pzwzkd.js +31 -0
  75. package/dist/index-Bq6FwMwW.js +32 -0
  76. package/dist/index-BvE6Sbog.js +3 -0
  77. package/dist/index-BysJoGFD.js +146 -0
  78. package/dist/index-C8m_F_I4.js +121 -0
  79. package/dist/index-CQZinjc9.js +54 -0
  80. package/dist/index-Cq7s1Pk2.js +76 -0
  81. package/dist/index-CuvNtC_M.js +61 -0
  82. package/dist/index-DOGrOlB8.js +8859 -0
  83. package/dist/index-Di23nMJ7.js +38 -0
  84. package/dist/index-Dkyb4P6T.js +30076 -0
  85. package/dist/index-DvZiQOtl.js +3077 -0
  86. package/dist/index-Ved5V90A.js +2155 -0
  87. package/dist/index-d4A3r8kv.js +32269 -0
  88. package/dist/index-vh86FiIQ.js +10 -0
  89. package/dist/index-y7IqG-tl.js +44 -0
  90. package/dist/index.esm2017-CRTpUsW5.js +3069 -0
  91. package/dist/loading-CoUrS63J.js +71 -0
  92. package/dist/lodash-B5I3zXaY.js +3678 -0
  93. package/dist/membership-BiQwBHAA.js +235 -0
  94. package/dist/moment-D7p2TMB-.js +2583 -0
  95. package/dist/money-CA3gpWD3.js +15 -0
  96. package/dist/number-CgmVpwHm.js +12 -0
  97. package/dist/object-qECH92oz.js +26 -0
  98. package/dist/objectId-dwaoBfJX.js +7 -0
  99. package/dist/objectid-C80eoTvt.js +145 -0
  100. package/dist/plugins-BkWtR_R5.js +208 -0
  101. package/dist/reward-D7SKofYj.js +36 -0
  102. package/dist/rule-Cpxty5PH.js +1951 -0
  103. package/dist/rule-builder-d_TMgXEC.js +102 -0
  104. package/dist/style.css +4 -0
  105. package/dist/template-BB7bab5R.js +190 -0
  106. package/dist/tier-BJDhpH6X.js +4 -0
  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-Dj3UaenF.js +1151 -0
  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-ZVR5eR1H.js +144 -0
  122. package/dist/tslib.es6-BCqqvLQ_.js +44 -0
  123. package/dist/type_drinks-D6jnpvwV.js +4 -0
  124. package/dist/usePagination-Ds-cuHop.js +223 -0
  125. package/dist/user-DjRqnFsC.js +54 -0
  126. package/dist/vue-i18n-BlCNfIcP.js +2365 -0
  127. package/dist/xlsx-CtNr_GAa.js +15491 -0
  128. package/dist/zod-Bg2FbC-D.js +90 -0
  129. package/package.json +1 -1
@@ -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-Cwt8pmoM.js";
3
+ import { u as C } from "./vue-i18n-BlCNfIcP.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,130 @@
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-DOGrOlB8.js";
3
+ import { i as C, R as e } from "./rule-builder-d_TMgXEC.js";
4
+ import { _ as I } from "./RuleGroup.vue_vue_type_script_setup_true_lang-DuYYfbOH.js";
5
+ import { p as N } from "./plugins-BkWtR_R5.js";
6
+ import { u as S } from "./membership-BiQwBHAA.js";
7
+ import { _ as j } from "./CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js";
8
+ import { u as x } from "./vue-i18n-BlCNfIcP.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
+ };
@@ -0,0 +1,384 @@
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-BkWtR_R5.js";
6
+ import { useCoreStore as ie } from "@feedmepos/mf-common";
7
+ import { u as se } from "./loading-CoUrS63J.js";
8
+ import { u as le } from "./business-BDi-QTa5.js";
9
+ import { u as me } from "./campaign-DNXI3K9c.js";
10
+ import { g as ue, a as O, b as B } from "./campaign-BHqizYy6.js";
11
+ import "./index-BvE6Sbog.js";
12
+ import { u as de } from "./template-BB7bab5R.js";
13
+ import { _ as pe } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-CSMV8OwA.js";
14
+ import { _ as fe } from "./SendVoucherSheet.vue_vue_type_script_setup_true_lang-CMmdbYH4.js";
15
+ import { u as ye } from "./vue-i18n-BlCNfIcP.js";
16
+ import { T as he } from "./trigger-ZVR5eR1H.js";
17
+ import { useRouter as ge } from "vue-router";
18
+ import { c as w } from "./index-C8m_F_I4.js";
19
+ import { R as H } from "./app-Do_C3F_N.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
+ };