@feedmepos/mf-connect 0.1.98-beta.39 → 0.1.98-beta.40

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 (151) hide show
  1. package/package.json +1 -1
  2. package/dist/App-DwjQisFZ.js +0 -4785
  3. package/dist/AuditLogs-DMGqmriL.js +0 -2014
  4. package/dist/Bin-4wvIqogM.js +0 -166
  5. package/dist/Broadcast-DPpuSZ8_.js +0 -269
  6. package/dist/CampaignAnalytic-CXFDo2X_.js +0 -1826
  7. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-SLoy1-Kd.js +0 -122
  8. package/dist/Card-C8SA6un0.js +0 -911
  9. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
  10. package/dist/Collections-BCpSiM_4.js +0 -541
  11. package/dist/Credit-C8RTBpP7.js +0 -286
  12. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
  13. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  14. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-0OI5QzpR.js +0 -3382
  15. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CJTduNh3.js +0 -351
  16. package/dist/Experience-Bg3kFQQE.js +0 -285
  17. package/dist/FileSaver.min-DMUuMi9w.js +0 -74
  18. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  19. package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +0 -52
  20. package/dist/Game-D3DbkRUj.js +0 -356
  21. package/dist/GiftCardSetup-CxlMM4up.js +0 -542
  22. package/dist/Grab-DvEK8ixP.js +0 -301
  23. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-BBK-UrEe.js +0 -145
  24. package/dist/Index-Do_9DXuY.js +0 -259
  25. package/dist/JsonViewer-v8_C7l5N.js +0 -87
  26. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-BKPGBYiU.js +0 -48
  27. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-D6wJN9Gj.js +0 -18737
  28. package/dist/LoyaltyDashboard-B4WqycGN.js +0 -1345
  29. package/dist/MainLayout-DdxLaufS.js +0 -143
  30. package/dist/Marketing-CcFEMwKB.js +0 -236
  31. package/dist/MarketingMaterialEdit-DoYFaMf7.js +0 -1036
  32. package/dist/Member-BussgBln.js +0 -281
  33. package/dist/MemberList-BXJxSsjo.js +0 -1603
  34. package/dist/MemberOverview-wL_ailso.js +0 -58
  35. package/dist/MemberTransactions-O-XY5nz3.js +0 -45
  36. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-DsxrIO0r.js +0 -60957
  37. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Bg_0YlwG.js +0 -38
  38. package/dist/Mission-CPkM-8Ns.js +0 -360
  39. package/dist/Overview-BJjpYUJN.js +0 -1080
  40. package/dist/Overview-C5KF_Jxj.js +0 -1316
  41. package/dist/Point-FDFwR3Hk.js +0 -288
  42. package/dist/Promotion-qtucKxn0.js +0 -423
  43. package/dist/Queue-d91tocPX.js +0 -261
  44. package/dist/Record-CvkK2iLq.js +0 -342
  45. package/dist/Review-C_zLGtzU.js +0 -45
  46. package/dist/ReviewFacebookCallback-Bidg3P76.js +0 -238
  47. package/dist/ReviewGoogleCallback-DL0lxMBL.js +0 -213
  48. package/dist/Reward-BTsQaI-J.js +0 -442
  49. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-BjxA4eMX.js +0 -150
  50. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-D4NIDc-C.js +0 -1913
  51. package/dist/Segment-BgFyB3BK.js +0 -1017
  52. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-CkhjFNvZ.js +0 -181
  53. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-HYbRyACe.js +0 -189
  54. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-7dv3cAW3.js +0 -226
  55. package/dist/Setting-BxHoCSxw.js +0 -2047
  56. package/dist/SettingAdvertisements-WfvuE4fA.js +0 -264
  57. package/dist/Settings-B42SAvEx.js +0 -179
  58. package/dist/Store-BnvWfCy-.js +0 -2413
  59. package/dist/StoreRewards-BRzAMqR-.js +0 -540
  60. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-C3FJr1L5.js +0 -1075
  61. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-UZYzUcif.js +0 -7007
  62. package/dist/Tier-BrzLNat2.js +0 -972
  63. package/dist/Title-EnlaNXld.js +0 -569
  64. package/dist/Transaction-BiXNxUGX.js +0 -39
  65. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-Db5_DKQ0.js +0 -130
  66. package/dist/Voucher-C2dyk-jj.js +0 -444
  67. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DPE24a-J.js +0 -421
  68. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-CI1HM9HA.js +0 -56
  69. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  70. package/dist/app-Bt8HrAEr.js +0 -60740
  71. package/dist/app-wDQR6dpb.js +0 -39
  72. package/dist/app.js +0 -7
  73. package/dist/business-BwtQpfUr.js +0 -82
  74. package/dist/campaign-B6U9lwKi.js +0 -255
  75. package/dist/campaign-C6Cb9s3C.js +0 -100
  76. package/dist/campaign-CpzFl8Vr.js +0 -4
  77. package/dist/campaign.enum-Dx-Zo68Q.js +0 -26
  78. package/dist/campaign.fn-B0x2EGhw.js +0 -776
  79. package/dist/collectible.enum-Liy2wH3s.js +0 -19
  80. package/dist/collection.fn-DfoA9sJV.js +0 -26
  81. package/dist/duplicateCampaign-Cnq5N-V8.js +0 -51
  82. package/dist/effect-B2REbrv8.js +0 -89
  83. package/dist/email-addresses-BzmOsxLn.js +0 -705
  84. package/dist/export-jHpRhPQu.js +0 -97
  85. package/dist/feedme.ico +0 -0
  86. package/dist/google-C3S8u0mT.js +0 -4
  87. package/dist/helper-DQAHX1kX.js +0 -86
  88. package/dist/index-4GG-yjdN.js +0 -2963
  89. package/dist/index-BWgMbKOB.js +0 -85
  90. package/dist/index-BccUpf0U.js +0 -3
  91. package/dist/index-BkgkJkVs.js +0 -8919
  92. package/dist/index-C0PKVTf9.js +0 -32
  93. package/dist/index-C8cXXcLk.js +0 -45
  94. package/dist/index-CTTGf4TM.js +0 -151
  95. package/dist/index-C_H8jFYf.js +0 -2743
  96. package/dist/index-CuvNtC_M.js +0 -61
  97. package/dist/index-DJN4auwx.js +0 -146
  98. package/dist/index-DMr9ohGV.js +0 -1139
  99. package/dist/index-DQTo_ytu.js +0 -31
  100. package/dist/index-DW7-0rf_.js +0 -53
  101. package/dist/index-Da7J83jM.js +0 -2706
  102. package/dist/index-Di1Z4vLS.js +0 -27550
  103. package/dist/index-FoKZGh7Z.js +0 -67
  104. package/dist/index-N25Px7RQ.js +0 -72
  105. package/dist/index-PgblELTo.js +0 -897
  106. package/dist/index-STBMTK1u.js +0 -28900
  107. package/dist/index-hP3Mgc0u.js +0 -55
  108. package/dist/index-vh86FiIQ.js +0 -10
  109. package/dist/index.esm2017-DV56jzfJ.js +0 -3069
  110. package/dist/loading-D__sDcq1.js +0 -72
  111. package/dist/lodash-DgkDIHoV.js +0 -3678
  112. package/dist/membership-CBjt1MGx.js +0 -255
  113. package/dist/moment-D7p2TMB-.js +0 -2583
  114. package/dist/money-BFUbPKDM.js +0 -15
  115. package/dist/number-CJb8OUa3.js +0 -12
  116. package/dist/object-BYyQ0PZp.js +0 -18
  117. package/dist/objectId-dwaoBfJX.js +0 -7
  118. package/dist/objectid-BMUFNR9T.js +0 -145
  119. package/dist/plugins-D95ZeD-9.js +0 -1788
  120. package/dist/remy-Qz_pNsUS.js +0 -13
  121. package/dist/reward-CSfV_XFK.js +0 -36
  122. package/dist/rule-DIzVHy2z.js +0 -1969
  123. package/dist/rule-builder-DF7fCvec.js +0 -126
  124. package/dist/string-Gcy5IM_H.js +0 -32
  125. package/dist/style.css +0 -4
  126. package/dist/template-r3lAQP1B.js +0 -188
  127. package/dist/tier-BJDhpH6X.js +0 -4
  128. package/dist/tiers/tier=1.png +0 -0
  129. package/dist/tiers/tier=2.png +0 -0
  130. package/dist/tiers/tier=3.png +0 -0
  131. package/dist/tiers/tier=4.png +0 -0
  132. package/dist/timezone-D40qRUoz.js +0 -20
  133. package/dist/titles/type=diamond.png +0 -0
  134. package/dist/titles/type=drinks.png +0 -0
  135. package/dist/titles/type=food.png +0 -0
  136. package/dist/titles/type=heart.png +0 -0
  137. package/dist/titles/type=medal.png +0 -0
  138. package/dist/titles/type=spend.png +0 -0
  139. package/dist/titles/type=thank-you.png +0 -0
  140. package/dist/titles/type=thumbs-up.png +0 -0
  141. package/dist/titles/type=years.png +0 -0
  142. package/dist/transaction.fn-DV-cpfOj.js +0 -64
  143. package/dist/trigger-BEJaSv5R.js +0 -213
  144. package/dist/tslib.es6-BCqqvLQ_.js +0 -44
  145. package/dist/type_drinks-D6jnpvwV.js +0 -4
  146. package/dist/useMarketingMaterialActions-Bd5BDfE1.js +0 -96
  147. package/dist/usePagination-DLIo76-X.js +0 -220
  148. package/dist/user-DtEjuhyM.js +0 -55
  149. package/dist/vue-i18n-dQ1XCaUv.js +0 -2365
  150. package/dist/xlsx-BUMZsTov.js +0 -15491
  151. package/dist/zod-B_pVZhsV.js +0 -91
@@ -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-C3FJr1L5.js";
3
- import { u as C } from "./vue-i18n-dQ1XCaUv.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-BkgkJkVs.js";
3
- import { i as C, R as e } from "./rule-builder-DF7fCvec.js";
4
- import { _ as I } from "./RuleGroup.vue_vue_type_script_setup_true_lang-D4NIDc-C.js";
5
- import { p as N } from "./plugins-D95ZeD-9.js";
6
- import { u as S } from "./membership-CBjt1MGx.js";
7
- import { _ as j } from "./CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js";
8
- import { u as x } from "./vue-i18n-dQ1XCaUv.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,444 +0,0 @@
1
- import { defineComponent as ne, ref as T, computed as ae, h as m, onMounted as re, resolveComponent as f, openBlock as d, createElementBlock as P, Fragment as R, createVNode as s, unref as t, createElementVNode as i, withCtx as I, renderList as ie, createBlock as g, resolveDynamicComponent as ce, createCommentVNode as L, toDisplayString as _ } from "vue";
2
- import { _ as se } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as le, components as p } from "@feedmepos/ui-library";
4
- import { _ as N } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
5
- import { c as me, p as ue } from "./plugins-D95ZeD-9.js";
6
- import { useCoreStore as de } from "@feedmepos/mf-common";
7
- import { u as pe } from "./loading-D__sDcq1.js";
8
- import { u as fe } from "./business-BwtQpfUr.js";
9
- import { u as ye } from "./campaign-C6Cb9s3C.js";
10
- import { a as he, b as D, c as K } from "./campaign-B6U9lwKi.js";
11
- import { c as ge, p as _e } from "./duplicateCampaign-Cnq5N-V8.js";
12
- import "./index-BccUpf0U.js";
13
- import { u as ve } from "./template-r3lAQP1B.js";
14
- import { _ as Ce } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-0OI5QzpR.js";
15
- import { _ as we } from "./SendVoucherSheet.vue_vue_type_script_setup_true_lang-7dv3cAW3.js";
16
- import { u as be } from "./vue-i18n-dQ1XCaUv.js";
17
- import { T as ke } from "./trigger-BEJaSv5R.js";
18
- import { useRouter as xe } from "vue-router";
19
- import { c as v } from "./index-DJN4auwx.js";
20
- import { R as A } from "./app-Bt8HrAEr.js";
21
- var Fe = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "feedmedev.vip", crmUrl: "crm.feedmedev.cc", paymentPortalUrl: "https://portal.feedmedev.cc/payment/payout-account", licensePortalUrl: "https://license.feedmedev.cc/", marketingV1Portal: "https://marketing-v1.feedmedev.cc", voucherAppUrl: "https://voucher.feedmedev.cc/" };
22
- const Ve = { class: "px-24 flex flex-col gap-y-16" }, Se = { class: "flex items-center justify-between w-full" }, Ue = { class: "flex gap-8 overflow-x-auto" }, Te = { class: "space-y-8" }, Pe = { class: "flex w-full gap-4 items-center" }, Re = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ie = { class: "space-y-4" }, Le = { class: "fm-typo-en-body-lg-600" }, Ae = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ee = { class: "flex gap-8 items-center" }, Be = { class: "flex flex-col gap-16 text-center" }, Oe = { class: "fm-typo-en-title-sm-800" }, Me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, io = /* @__PURE__ */ ne({
23
- __name: "Voucher",
24
- setup(He) {
25
- const { t: a } = be(), j = {
26
- label: a("connect.voucher.createCampaign"),
27
- value: "create",
28
- isPrimary: !0,
29
- prependIcon: "add"
30
- }, E = le(), q = ve("VOUCHER", E), G = fe(), y = ye(), { global: X, minor: B } = pe, k = xe(), l = T({
31
- searchKey: "",
32
- location: [],
33
- triggerType: []
34
- }), C = ae(
35
- () => y.campaigns.voucher.filter(
36
- (e) => z(e) && Q(e)
37
- )
38
- ), W = ke.VOUCHER.map((e) => ({
39
- label: e.name,
40
- value: e.value
41
- }));
42
- function z(e) {
43
- const o = l.value.location;
44
- return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some(
45
- (r) => {
46
- var c;
47
- return (c = e == null ? void 0 : e.targetLocation) == null ? void 0 : c.includes(r);
48
- }
49
- ) : e.targetLocation.includes(o);
50
- }
51
- function x(e) {
52
- return e.hideInApp === !1;
53
- }
54
- function F(e) {
55
- return e.event.type === "SIMPLE_CLAIM" && !x(e);
56
- }
57
- function Q(e) {
58
- const o = l.value.triggerType;
59
- if (!o || o.length === 0) return !0;
60
- const r = e.event.type;
61
- return o.includes(r);
62
- }
63
- const Y = [
64
- {
65
- header: a("connect.voucher.voucherTitle"),
66
- accessorFn: (e) => e.name,
67
- cell(e) {
68
- const o = [e.row.original.name];
69
- return x(e.row.original) && o.push(
70
- m(p.FmChip, {
71
- label: "Feedvibe",
72
- class: "text-fm-color-primary bg-fm-color-system-warning-100",
73
- compact: !0
74
- })
75
- ), m("div", { class: "flex items-center gap-4" }, o);
76
- }
77
- },
78
- {
79
- header: a("connect.voucher.status"),
80
- accessorFn: (e) => he(e),
81
- cell(e) {
82
- return D(e.row.original);
83
- }
84
- },
85
- {
86
- header: a("connect.voucher.summary"),
87
- accessorFn: (e) => K(e)
88
- },
89
- {
90
- header: a("connect.voucher.quota"),
91
- accessorFn: (e) => {
92
- var o;
93
- return ((o = e.pf_collectible) == null ? void 0 : o.options.maxReceive) ?? "Unlimited";
94
- }
95
- },
96
- {
97
- header: a("connect.voucher.claimed"),
98
- accessorFn: (e) => {
99
- var o;
100
- return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
101
- }
102
- },
103
- {
104
- header: a("connect.voucher.actions"),
105
- cell(e) {
106
- return m("div", { class: "flex items-center justify-end" }, [
107
- m(p.FmButton, {
108
- icon: "insights",
109
- variant: "tertiary",
110
- iconColor: "neutral-gray-400",
111
- onClick: async (o) => {
112
- o.stopPropagation(), await M(e.row.original);
113
- }
114
- }),
115
- m(p.FmButton, {
116
- icon: "visibility",
117
- variant: "tertiary",
118
- iconColor: "neutral-gray-400",
119
- onClick: async (o) => {
120
- o.stopPropagation(), await k.push({
121
- name: A["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
122
- params: { id: e.row.original._id }
123
- });
124
- }
125
- }),
126
- m(
127
- p.FmMenu,
128
- {
129
- placement: "bottom-end",
130
- onClick: (o) => {
131
- o.stopPropagation();
132
- }
133
- },
134
- {
135
- "menu-button": () => m(p.FmButton, {
136
- icon: "more_vert",
137
- iconColor: "neutral-gray-400",
138
- variant: "tertiary"
139
- }),
140
- default: () => {
141
- const o = [
142
- m(p.FmMenuItem, {
143
- label: a("connect.voucher.duplicate"),
144
- onClick: async (r) => {
145
- r.stopPropagation(), await H(e.row.original);
146
- }
147
- }),
148
- m(
149
- p.FmMenuItem,
150
- {
151
- onClick: async (r) => {
152
- r.stopPropagation(), O(e.row.original);
153
- }
154
- },
155
- {
156
- label: m(
157
- "div",
158
- {
159
- class: "text-fm-color-typo-error fm-typo-en-body-md-400"
160
- },
161
- a("connect.voucher.remove")
162
- )
163
- }
164
- )
165
- ];
166
- return F(e.row.original) && (o.unshift(
167
- m(p.FmMenuItem, {
168
- label: a("connect.voucher.send"),
169
- onClick: async (r) => {
170
- var c;
171
- r.stopPropagation(), (c = S.value) == null || c.showSheet({
172
- campaignId: e.row.original._id
173
- });
174
- }
175
- })
176
- ), o.unshift(
177
- m(p.FmMenuItem, {
178
- label: a("connect.voucher.share"),
179
- onClick: async (r) => {
180
- r.stopPropagation(), await me(
181
- `https://${de().currentBusiness.value._id}.${Fe.appUrl}/vouchers/${e.row.original._id}`,
182
- {
183
- successMessage: "Voucher link copied to clipboard"
184
- }
185
- );
186
- }
187
- })
188
- )), o;
189
- }
190
- }
191
- )
192
- ]);
193
- }
194
- }
195
- ], V = T(), S = T();
196
- async function O(e) {
197
- await ue.remove(a("connect.voucher.confirmRemove", { name: e.name })) && await B(
198
- async () => {
199
- await v.delete(e._id), await y.read("VOUCHER");
200
- },
201
- {
202
- message: a("connect.voucher.removing", { name: e.name }),
203
- successMessage: a("connect.voucher.removedSuccessfully", {
204
- name: e.name
205
- })
206
- }
207
- );
208
- }
209
- async function w(e) {
210
- e ? await o(await v.readById(e._id)) : q.open(async (r) => {
211
- await o(void 0, r);
212
- });
213
- async function o(r, c) {
214
- var b;
215
- (b = V.value) == null || b.showSheet(!0, "VOUCHER", r, c);
216
- }
217
- }
218
- async function M(e) {
219
- await k.push({
220
- name: A["$connect-CAMPAIGN_VOUCHER_ANALYTIC"],
221
- params: { id: e._id }
222
- });
223
- }
224
- async function H(e) {
225
- var c;
226
- if (!await ge(e.name))
227
- return;
228
- const o = await v.readById(e._id), r = _e(o);
229
- (c = V.value) == null || c.showSheet(
230
- !0,
231
- "VOUCHER",
232
- r,
233
- o.template
234
- );
235
- }
236
- async function Z(e) {
237
- e.campaign._id && await new Promise((o) => {
238
- E.open({
239
- title: "Confirmation",
240
- message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
241
- primaryActions: { text: "Update all", close: !0 },
242
- secondaryActions: { text: "Update future only", close: !0 }
243
- }).onPrimary(async () => {
244
- var r;
245
- e.updateCollections = !0, (r = window.top) == null || r.postMessage("updateAllVoucher", "*"), o();
246
- }).onSecondary(async () => {
247
- o();
248
- });
249
- }), await B(
250
- async () => {
251
- e.campaign._id ? await v.update(e.campaign._id, e) : await v.create(e), await y.read("VOUCHER");
252
- },
253
- {
254
- message: a(
255
- e.campaign._id ? "connect.voucher.updating" : "connect.voucher.creating"
256
- ),
257
- successMessage: a(
258
- e.campaign._id ? "connect.voucher.updatedSuccessfully" : "connect.voucher.createdSuccessfully"
259
- )
260
- }
261
- );
262
- }
263
- return re(async () => {
264
- await X(async () => {
265
- await y.read("VOUCHER");
266
- });
267
- }), (e, o) => {
268
- const r = f("FmPageHead"), c = f("FmSearch"), b = f("FmTable"), J = f("FmChip"), h = f("FmButton"), ee = f("FmListItem"), oe = f("FmList"), te = f("FmCard");
269
- return d(), P(R, null, [
270
- s(r, {
271
- title: t(a)("connect.voucher.title"),
272
- actions: t(C).length > 0 ? [j] : [],
273
- "onClick:action": o[0] || (o[0] = () => w())
274
- }, null, 8, ["title", "actions"]),
275
- i("div", Ve, [
276
- s(c, {
277
- modelValue: t(l).searchKey,
278
- "onUpdate:modelValue": o[1] || (o[1] = (n) => t(l).searchKey = n),
279
- class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
280
- placeholder: t(a)("connect.voucher.search"),
281
- collapsible: ""
282
- }, null, 8, ["modelValue", "placeholder"]),
283
- t(y).campaigns.voucher && t(y).campaigns.voucher.length > 0 ? (d(), P(R, { key: 0 }, [
284
- i("div", Se, [
285
- i("div", Ue, [
286
- s(N, {
287
- label: `${t(a)("connect.common.location")}: `,
288
- "right-icon": "keyboard_arrow_down",
289
- modelValue: t(l).location,
290
- "onUpdate:modelValue": o[2] || (o[2] = (n) => t(l).location = n),
291
- icon: "storefront",
292
- "show-item-label": !0,
293
- items: t(G).locationOptions
294
- }, null, 8, ["label", "modelValue", "items"]),
295
- s(N, {
296
- label: "Type:",
297
- "right-icon": "keyboard_arrow_down",
298
- modelValue: t(l).triggerType,
299
- "onUpdate:modelValue": o[3] || (o[3] = (n) => t(l).triggerType = n),
300
- icon: "filter_list",
301
- "show-item-label": !0,
302
- items: t(W)
303
- }, null, 8, ["modelValue", "items"])
304
- ]),
305
- s(c, {
306
- modelValue: t(l).searchKey,
307
- "onUpdate:modelValue": o[4] || (o[4] = (n) => t(l).searchKey = n),
308
- class: "xs:hidden sm:hidden",
309
- placeholder: t(a)("connect.voucher.search"),
310
- collapsible: ""
311
- }, null, 8, ["modelValue", "placeholder"])
312
- ]),
313
- s(b, {
314
- class: "xs:hidden sm:hidden",
315
- "row-data": t(C),
316
- "column-defs": Y,
317
- "search-value": t(l).searchKey,
318
- "column-filter": [],
319
- onRowClick: o[5] || (o[5] = (n) => w(n.original)),
320
- "hide-footer": t(C).length < 10
321
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
322
- s(oe, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
323
- default: I(() => [
324
- (d(!0), P(R, null, ie(t(C).filter(
325
- (n) => n.name.toLowerCase().includes(t(l).searchKey.toLowerCase())
326
- ), (n) => (d(), g(ee, {
327
- key: n._id.toString(),
328
- onClick: (U) => w(n),
329
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
330
- }, {
331
- default: I(() => {
332
- var U;
333
- return [
334
- i("div", Te, [
335
- i("div", Pe, [
336
- (d(), g(ce(t(D)(n)))),
337
- x(n) ? (d(), g(J, {
338
- key: 0,
339
- label: "Feedvibe",
340
- class: "text-fm-color-primary bg-fm-color-system-warning-100",
341
- compact: ""
342
- })) : L("", !0),
343
- i("div", Re, _(((U = n.pf_collectible) == null ? void 0 : U.currentReceive) ?? 0) + " claimed ", 1)
344
- ]),
345
- i("div", Ie, [
346
- i("div", Le, _(n.name), 1),
347
- i("div", Ae, _(t(K)(n)), 1)
348
- ])
349
- ]),
350
- i("div", Ee, [
351
- s(h, {
352
- icon: "insights",
353
- "icon-color": "neutral-gray-400",
354
- variant: "tertiary",
355
- onClick: async (u) => {
356
- u.stopPropagation(), await M(n);
357
- }
358
- }, null, 8, ["onClick"]),
359
- s(h, {
360
- icon: "content_copy",
361
- "icon-color": "neutral-gray-400",
362
- variant: "tertiary",
363
- onClick: async (u) => {
364
- u.stopPropagation(), await H(n);
365
- }
366
- }, null, 8, ["onClick"]),
367
- F(n) ? (d(), g(h, {
368
- key: 0,
369
- icon: "visibility",
370
- "icon-color": "neutral-gray-400",
371
- variant: "tertiary",
372
- onClick: async (u) => {
373
- u.stopPropagation(), await t(k).push({
374
- name: t(A)["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
375
- params: { id: n._id }
376
- });
377
- }
378
- }, null, 8, ["onClick"])) : L("", !0),
379
- F(n) ? (d(), g(h, {
380
- key: 1,
381
- icon: "send",
382
- "icon-color": "neutral-gray-400",
383
- variant: "tertiary",
384
- onClick: (u) => {
385
- var $;
386
- u.stopPropagation(), ($ = t(S)) == null || $.showSheet({
387
- campaignId: n._id
388
- });
389
- }
390
- }, null, 8, ["onClick"])) : L("", !0),
391
- s(h, {
392
- icon: "delete",
393
- "icon-color": "neutral-gray-400",
394
- variant: "tertiary",
395
- onClick: (u) => (u.stopPropagation(), O(n))
396
- }, null, 8, ["onClick"])
397
- ])
398
- ];
399
- }),
400
- _: 2
401
- }, 1032, ["onClick"]))), 128))
402
- ]),
403
- _: 1
404
- })
405
- ], 64)) : (d(), g(te, {
406
- key: 1,
407
- variant: "outlined",
408
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
409
- }, {
410
- default: I(() => [
411
- o[7] || (o[7] = i("img", {
412
- src: se,
413
- class: "aspect-square w-[150px]"
414
- }, null, -1)),
415
- i("div", Be, [
416
- i("div", Oe, _(t(a)("connect.voucher.createVoucherCampaign")), 1),
417
- i("div", Me, _(t(a)("connect.voucher.description")), 1)
418
- ]),
419
- s(h, {
420
- variant: "primary",
421
- label: t(a)("connect.voucher.createVoucherCampaign"),
422
- icon: "add",
423
- onClick: o[6] || (o[6] = (n) => w())
424
- }, null, 8, ["label"])
425
- ]),
426
- _: 1
427
- })),
428
- s(Ce, {
429
- ref_key: "sheetRef",
430
- ref: V,
431
- "onSubmit:modelValue": Z
432
- }, null, 512),
433
- s(we, {
434
- ref_key: "sendVoucherSheetRef",
435
- ref: S
436
- }, null, 512)
437
- ])
438
- ], 64);
439
- };
440
- }
441
- });
442
- export {
443
- io as default
444
- };