@feedmepos/mf-connect 0.1.98-beta.13 → 0.1.98-beta.15

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 (138) hide show
  1. package/package.json +1 -1
  2. package/dist/App-DQqZfak3.js +0 -4782
  3. package/dist/AuditLogs-C19m85wp.js +0 -2013
  4. package/dist/Bin-GjJ5Q2ae.js +0 -166
  5. package/dist/Broadcast-CVTBL0T0.js +0 -266
  6. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B6BYvVmq.js +0 -120
  7. package/dist/Card-DzYit3v6.js +0 -910
  8. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
  9. package/dist/Collections-CaU7auvn.js +0 -540
  10. package/dist/Credit-B_eUMV0R.js +0 -260
  11. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
  12. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  13. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bgcm1S_g.js +0 -3377
  14. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CZLoCJM4.js +0 -351
  15. package/dist/Experience-B7kxE07l.js +0 -259
  16. package/dist/FileSaver.min-BBvy4uPh.js +0 -74
  17. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  18. package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +0 -52
  19. package/dist/Game-B98hcWvR.js +0 -330
  20. package/dist/Grab-RdxV7xhM.js +0 -300
  21. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-BBYekrJp.js +0 -145
  22. package/dist/Index-CvMVxCY5.js +0 -259
  23. package/dist/JsonViewer-v8_C7l5N.js +0 -87
  24. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-D4-wjMg6.js +0 -48
  25. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-Jir8zY8e.js +0 -18737
  26. package/dist/LoyaltyDashboard-B1OzFT4q.js +0 -1082
  27. package/dist/MainLayout-De_edc-D.js +0 -41
  28. package/dist/Marketing-B7-To3XF.js +0 -235
  29. package/dist/MarketingMaterialEdit-DGONncxn.js +0 -1035
  30. package/dist/Member-DEGCrqnh.js +0 -280
  31. package/dist/MemberList-vKYbpLVu.js +0 -1601
  32. package/dist/MemberOverview-wL_ailso.js +0 -58
  33. package/dist/MemberTransactions-CGC3vYKC.js +0 -45
  34. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-BP9YtuPA.js +0 -60802
  35. package/dist/Mission-hxf_AIGL.js +0 -334
  36. package/dist/Overview-NvgUuMYp.js +0 -949
  37. package/dist/Overview-iRLMLoAo.js +0 -1079
  38. package/dist/Point-tkUTXOCe.js +0 -262
  39. package/dist/Promotion-DNUcMKJQ.js +0 -397
  40. package/dist/Queue-5XYiIuG8.js +0 -260
  41. package/dist/Record-B5aYp7eF.js +0 -342
  42. package/dist/Review-BqaHlzXV.js +0 -45
  43. package/dist/ReviewFacebookCallback-BqlFkSB7.js +0 -248
  44. package/dist/ReviewGoogleCallback-ssKL4jh4.js +0 -213
  45. package/dist/Reward-1xOMowTW.js +0 -442
  46. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-Db3FSfIc.js +0 -149
  47. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Cmrp2Tia.js +0 -1911
  48. package/dist/Segment-BMBwsUug.js +0 -1014
  49. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-DSfdei-h.js +0 -181
  50. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-BJVeGJ5J.js +0 -188
  51. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-OBZubKUy.js +0 -226
  52. package/dist/Setting-DWygYkHW.js +0 -2047
  53. package/dist/SettingAdvertisements-TYB1b7dB.js +0 -264
  54. package/dist/Settings-DynjmCPL.js +0 -220
  55. package/dist/Store-DRYkmigC.js +0 -1996
  56. package/dist/StoreRewards-DU8eWbXE.js +0 -540
  57. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BkqBjEFm.js +0 -1130
  58. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-l6KmXVBZ.js +0 -7007
  59. package/dist/Tier-4k8SxKtl.js +0 -969
  60. package/dist/Title-B9lWQ_jl.js +0 -566
  61. package/dist/Transaction-C38Yd0tf.js +0 -39
  62. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-D6tgpKpc.js +0 -130
  63. package/dist/Voucher-BQbqC7RV.js +0 -421
  64. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-erwpbvYi.js +0 -421
  65. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-Dt05b7fU.js +0 -56
  66. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  67. package/dist/app-BTm9mz0r.js +0 -59940
  68. package/dist/app-wDQR6dpb.js +0 -39
  69. package/dist/app.js +0 -7
  70. package/dist/business-B7GwHLce.js +0 -82
  71. package/dist/campaign-BCdKDHgz.js +0 -277
  72. package/dist/campaign-CpzFl8Vr.js +0 -4
  73. package/dist/campaign-DWlsbsKQ.js +0 -219
  74. package/dist/campaign.enum-BgK4maXz.js +0 -26
  75. package/dist/campaign.fn-DxnwGCB2.js +0 -776
  76. package/dist/collectible.enum-CdOSUDwG.js +0 -19
  77. package/dist/duplicateCampaign-BSHe0P-g.js +0 -51
  78. package/dist/effect-C7wkN_13.js +0 -89
  79. package/dist/email-addresses-DJycNI7L.js +0 -705
  80. package/dist/export-uIHWDxuh.js +0 -97
  81. package/dist/feedme.ico +0 -0
  82. package/dist/google-BQK68wbe.js +0 -5
  83. package/dist/helper-czpAhAIw.js +0 -86
  84. package/dist/index-5Sa4xS2m.js +0 -151
  85. package/dist/index-5WGEWCcI.js +0 -3
  86. package/dist/index-B2C7kc4z.js +0 -31
  87. package/dist/index-B5eb6_bi.js +0 -3678
  88. package/dist/index-B7nE1Pb2.js +0 -67
  89. package/dist/index-BFAHLexA.js +0 -32
  90. package/dist/index-BanxlNli.js +0 -8910
  91. package/dist/index-ByHoFriu.js +0 -85
  92. package/dist/index-Ca2bBJuR.js +0 -54
  93. package/dist/index-CuvNtC_M.js +0 -61
  94. package/dist/index-D-kYrDAi.js +0 -30289
  95. package/dist/index-D2gAYMIp.js +0 -28900
  96. package/dist/index-DWxmK2NJ.js +0 -61
  97. package/dist/index-U_rwkNKU.js +0 -2819
  98. package/dist/index-knizSLfz.js +0 -1157
  99. package/dist/index-vh86FiIQ.js +0 -10
  100. package/dist/index.esm2017-DFVkiPjd.js +0 -3069
  101. package/dist/loading-B3OgwEC8.js +0 -72
  102. package/dist/lodash-CiRTkvui.js +0 -3678
  103. package/dist/membership-s2VKnu_8.js +0 -255
  104. package/dist/moment-D7p2TMB-.js +0 -2583
  105. package/dist/money-DqxOXYd0.js +0 -15
  106. package/dist/number-Bt4sacaM.js +0 -12
  107. package/dist/object-BYyQ0PZp.js +0 -18
  108. package/dist/objectId-dwaoBfJX.js +0 -7
  109. package/dist/objectid-CxCupSWP.js +0 -145
  110. package/dist/plugins-CQ1JAqJB.js +0 -1788
  111. package/dist/reward-pjbal-XX.js +0 -36
  112. package/dist/rule-CzU2GAur.js +0 -1969
  113. package/dist/string-Gcy5IM_H.js +0 -32
  114. package/dist/style.css +0 -4
  115. package/dist/template-7yiMSL1f.js +0 -188
  116. package/dist/tier-BJDhpH6X.js +0 -4
  117. package/dist/tiers/tier=1.png +0 -0
  118. package/dist/tiers/tier=2.png +0 -0
  119. package/dist/tiers/tier=3.png +0 -0
  120. package/dist/tiers/tier=4.png +0 -0
  121. package/dist/titles/type=diamond.png +0 -0
  122. package/dist/titles/type=drinks.png +0 -0
  123. package/dist/titles/type=food.png +0 -0
  124. package/dist/titles/type=heart.png +0 -0
  125. package/dist/titles/type=medal.png +0 -0
  126. package/dist/titles/type=spend.png +0 -0
  127. package/dist/titles/type=thank-you.png +0 -0
  128. package/dist/titles/type=thumbs-up.png +0 -0
  129. package/dist/titles/type=years.png +0 -0
  130. package/dist/trigger-C5bqlYHn.js +0 -213
  131. package/dist/tslib.es6-BCqqvLQ_.js +0 -44
  132. package/dist/type_drinks-D6jnpvwV.js +0 -4
  133. package/dist/useMarketingMaterialActions-CW_QRtQb.js +0 -107
  134. package/dist/usePagination-D2pke4vy.js +0 -220
  135. package/dist/user-BcXrT_t5.js +0 -55
  136. package/dist/vue-i18n-CFNkj6JK.js +0 -2365
  137. package/dist/xlsx-DyVY5_Qx.js +0 -15491
  138. package/dist/zod-BD_8DRqQ.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-BkqBjEFm.js";
3
- import { u as C } from "./vue-i18n-CFNkj6JK.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-BanxlNli.js";
3
- import { i as C, R as e } from "./index-U_rwkNKU.js";
4
- import { _ as I } from "./RuleGroup.vue_vue_type_script_setup_true_lang-Cmrp2Tia.js";
5
- import { p as N } from "./plugins-CQ1JAqJB.js";
6
- import { u as S } from "./membership-s2VKnu_8.js";
7
- import { _ as j } from "./CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js";
8
- import { u as x } from "./vue-i18n-CFNkj6JK.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,421 +0,0 @@
1
- import { defineComponent as te, ref as U, computed as ne, h as m, onMounted as ae, resolveComponent as d, openBlock as u, createElementBlock as T, Fragment as P, createVNode as l, unref as t, createElementVNode as c, withCtx as R, renderList as re, createBlock as h, resolveDynamicComponent as ce, createCommentVNode as L, toDisplayString as v } from "vue";
2
- import { _ as ie } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as se, components as p } from "@feedmepos/ui-library";
4
- import { _ as H } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
5
- import { c as le, p as me } from "./plugins-CQ1JAqJB.js";
6
- import { useCoreStore as ue } from "@feedmepos/mf-common";
7
- import { u as de } from "./loading-B3OgwEC8.js";
8
- import { u as pe } from "./business-B7GwHLce.js";
9
- import { u as fe, c as _ } from "./campaign-DWlsbsKQ.js";
10
- import { a as ye, b as $, c as D } from "./campaign-BCdKDHgz.js";
11
- import { c as he, p as ge } from "./duplicateCampaign-BSHe0P-g.js";
12
- import "./index-5WGEWCcI.js";
13
- import { u as ve } from "./template-7yiMSL1f.js";
14
- import { _ as _e } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bgcm1S_g.js";
15
- import { _ as Ce } from "./SendVoucherSheet.vue_vue_type_script_setup_true_lang-OBZubKUy.js";
16
- import { u as we } from "./vue-i18n-CFNkj6JK.js";
17
- import { T as be } from "./trigger-C5bqlYHn.js";
18
- import { useRouter as ke } from "vue-router";
19
- import { R as K } from "./app-BTm9mz0r.js";
20
- var xe = { 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/" };
21
- const Fe = { class: "px-24 flex flex-col gap-y-16" }, Ve = { class: "flex items-center justify-between w-full" }, Se = { class: "flex gap-8 overflow-x-auto" }, Ue = { class: "space-y-8" }, Te = { class: "flex w-full gap-4 items-center" }, Pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Re = { class: "space-y-4" }, Le = { class: "fm-typo-en-body-lg-600" }, Ie = { 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" }, Ae = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ao = /* @__PURE__ */ te({
22
- __name: "Voucher",
23
- setup(Me) {
24
- const { t: a } = we(), N = {
25
- label: a("connect.voucher.createCampaign"),
26
- value: "create",
27
- isPrimary: !0,
28
- prependIcon: "add"
29
- }, I = se(), j = ve("VOUCHER", I), q = pe(), y = fe(), { global: G, minor: E } = de, B = ke(), s = U({
30
- searchKey: "",
31
- location: [],
32
- triggerType: []
33
- }), C = ne(
34
- () => y.campaigns.voucher.filter(
35
- (e) => W(e) && z(e)
36
- )
37
- ), X = be.VOUCHER.map((e) => ({
38
- label: e.name,
39
- value: e.value
40
- }));
41
- function W(e) {
42
- const o = s.value.location;
43
- return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some(
44
- (r) => {
45
- var i;
46
- return (i = e == null ? void 0 : e.targetLocation) == null ? void 0 : i.includes(r);
47
- }
48
- ) : e.targetLocation.includes(o);
49
- }
50
- function k(e) {
51
- return e.hideInApp === !1;
52
- }
53
- function x(e) {
54
- return e.event.type === "SIMPLE_CLAIM" && !k(e);
55
- }
56
- function z(e) {
57
- const o = s.value.triggerType;
58
- if (!o || o.length === 0) return !0;
59
- const r = e.event.type;
60
- return o.includes(r);
61
- }
62
- const Q = [
63
- {
64
- header: a("connect.voucher.voucherTitle"),
65
- accessorFn: (e) => e.name,
66
- cell(e) {
67
- const o = [e.row.original.name];
68
- return k(e.row.original) && o.push(
69
- m(p.FmChip, {
70
- label: "Feedvibe",
71
- class: "text-fm-color-primary bg-fm-color-system-warning-100",
72
- compact: !0
73
- })
74
- ), m("div", { class: "flex items-center gap-4" }, o);
75
- }
76
- },
77
- {
78
- header: a("connect.voucher.status"),
79
- accessorFn: (e) => ye(e),
80
- cell(e) {
81
- return $(e.row.original);
82
- }
83
- },
84
- {
85
- header: a("connect.voucher.summary"),
86
- accessorFn: (e) => D(e)
87
- },
88
- {
89
- header: a("connect.voucher.quota"),
90
- accessorFn: (e) => {
91
- var o;
92
- return ((o = e.pf_collectible) == null ? void 0 : o.options.maxReceive) ?? "Unlimited";
93
- }
94
- },
95
- {
96
- header: a("connect.voucher.claimed"),
97
- accessorFn: (e) => {
98
- var o;
99
- return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
100
- }
101
- },
102
- {
103
- header: a("connect.voucher.actions"),
104
- cell(e) {
105
- return m("div", { class: "flex items-center justify-end" }, [
106
- m(p.FmButton, {
107
- icon: "visibility",
108
- variant: "tertiary",
109
- iconColor: "neutral-gray-400",
110
- onClick: async (o) => {
111
- o.stopPropagation(), await B.push({
112
- name: K["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
113
- params: { id: e.row.original._id }
114
- });
115
- }
116
- }),
117
- m(
118
- p.FmMenu,
119
- {
120
- placement: "bottom-end",
121
- onClick: (o) => {
122
- o.stopPropagation();
123
- }
124
- },
125
- {
126
- "menu-button": () => m(p.FmButton, {
127
- icon: "more_vert",
128
- iconColor: "neutral-gray-400",
129
- variant: "tertiary"
130
- }),
131
- default: () => {
132
- const o = [
133
- m(p.FmMenuItem, {
134
- label: a("connect.voucher.duplicate"),
135
- onClick: async (r) => {
136
- r.stopPropagation(), await A(e.row.original);
137
- }
138
- }),
139
- m(
140
- p.FmMenuItem,
141
- {
142
- onClick: async (r) => {
143
- r.stopPropagation(), O(e.row.original);
144
- }
145
- },
146
- {
147
- label: m(
148
- "div",
149
- {
150
- class: "text-fm-color-typo-error fm-typo-en-body-md-400"
151
- },
152
- a("connect.voucher.remove")
153
- )
154
- }
155
- )
156
- ];
157
- return x(e.row.original) && (o.unshift(
158
- m(p.FmMenuItem, {
159
- label: a("connect.voucher.send"),
160
- onClick: async (r) => {
161
- var i;
162
- r.stopPropagation(), (i = V.value) == null || i.showSheet({
163
- campaignId: e.row.original._id
164
- });
165
- }
166
- })
167
- ), o.unshift(
168
- m(p.FmMenuItem, {
169
- label: a("connect.voucher.share"),
170
- onClick: async (r) => {
171
- r.stopPropagation(), await le(
172
- `https://${ue().currentBusiness.value._id}.${xe.appUrl}/vouchers/${e.row.original._id}`,
173
- {
174
- successMessage: "Voucher link copied to clipboard"
175
- }
176
- );
177
- }
178
- })
179
- )), o;
180
- }
181
- }
182
- )
183
- ]);
184
- }
185
- }
186
- ], F = U(), V = U();
187
- async function O(e) {
188
- await me.remove(a("connect.voucher.confirmRemove", { name: e.name })) && await E(
189
- async () => {
190
- await _.delete(e._id), await y.read("VOUCHER");
191
- },
192
- {
193
- message: a("connect.voucher.removing", { name: e.name }),
194
- successMessage: a("connect.voucher.removedSuccessfully", {
195
- name: e.name
196
- })
197
- }
198
- );
199
- }
200
- async function w(e) {
201
- e ? await o(await _.readById(e._id)) : j.open(async (r) => {
202
- await o(void 0, r);
203
- });
204
- async function o(r, i) {
205
- var b;
206
- (b = F.value) == null || b.showSheet(!0, "VOUCHER", r, i);
207
- }
208
- }
209
- async function A(e) {
210
- var i;
211
- if (!await he(e.name))
212
- return;
213
- const o = await _.readById(e._id), r = ge(o);
214
- (i = F.value) == null || i.showSheet(
215
- !0,
216
- "VOUCHER",
217
- r,
218
- o.template
219
- );
220
- }
221
- async function Z(e) {
222
- e.campaign._id && await new Promise((o) => {
223
- I.open({
224
- title: "Confirmation",
225
- message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
226
- primaryActions: { text: "Update all", close: !0 },
227
- secondaryActions: { text: "Update future only", close: !0 }
228
- }).onPrimary(async () => {
229
- var r;
230
- e.updateCollections = !0, (r = window.top) == null || r.postMessage("updateAllVoucher", "*"), o();
231
- }).onSecondary(async () => {
232
- o();
233
- });
234
- }), await E(
235
- async () => {
236
- e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await y.read("VOUCHER");
237
- },
238
- {
239
- message: a(
240
- e.campaign._id ? "connect.voucher.updating" : "connect.voucher.creating"
241
- ),
242
- successMessage: a(
243
- e.campaign._id ? "connect.voucher.updatedSuccessfully" : "connect.voucher.createdSuccessfully"
244
- )
245
- }
246
- );
247
- }
248
- return ae(async () => {
249
- await G(async () => {
250
- await y.read("VOUCHER");
251
- });
252
- }), (e, o) => {
253
- const r = d("FmPageHead"), i = d("FmSearch"), b = d("FmTable"), J = d("FmChip"), g = d("FmButton"), Y = d("FmListItem"), ee = d("FmList"), oe = d("FmCard");
254
- return u(), T(P, null, [
255
- l(r, {
256
- title: t(a)("connect.voucher.title"),
257
- actions: t(C).length > 0 ? [N] : [],
258
- "onClick:action": o[0] || (o[0] = () => w())
259
- }, null, 8, ["title", "actions"]),
260
- c("div", Fe, [
261
- l(i, {
262
- modelValue: t(s).searchKey,
263
- "onUpdate:modelValue": o[1] || (o[1] = (n) => t(s).searchKey = n),
264
- class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
265
- placeholder: t(a)("connect.voucher.search"),
266
- collapsible: ""
267
- }, null, 8, ["modelValue", "placeholder"]),
268
- t(y).campaigns.voucher && t(y).campaigns.voucher.length > 0 ? (u(), T(P, { key: 0 }, [
269
- c("div", Ve, [
270
- c("div", Se, [
271
- l(H, {
272
- label: `${t(a)("connect.common.location")}: `,
273
- "right-icon": "keyboard_arrow_down",
274
- modelValue: t(s).location,
275
- "onUpdate:modelValue": o[2] || (o[2] = (n) => t(s).location = n),
276
- icon: "storefront",
277
- "show-item-label": !0,
278
- items: t(q).locationOptions
279
- }, null, 8, ["label", "modelValue", "items"]),
280
- l(H, {
281
- label: "Type:",
282
- "right-icon": "keyboard_arrow_down",
283
- modelValue: t(s).triggerType,
284
- "onUpdate:modelValue": o[3] || (o[3] = (n) => t(s).triggerType = n),
285
- icon: "filter_list",
286
- "show-item-label": !0,
287
- items: t(X)
288
- }, null, 8, ["modelValue", "items"])
289
- ]),
290
- l(i, {
291
- modelValue: t(s).searchKey,
292
- "onUpdate:modelValue": o[4] || (o[4] = (n) => t(s).searchKey = n),
293
- class: "xs:hidden sm:hidden",
294
- placeholder: t(a)("connect.voucher.search"),
295
- collapsible: ""
296
- }, null, 8, ["modelValue", "placeholder"])
297
- ]),
298
- l(b, {
299
- class: "xs:hidden sm:hidden",
300
- "row-data": t(C),
301
- "column-defs": Q,
302
- "search-value": t(s).searchKey,
303
- "column-filter": [],
304
- onRowClick: o[5] || (o[5] = (n) => w(n.original)),
305
- "hide-footer": t(C).length < 10
306
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
307
- l(ee, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
308
- default: R(() => [
309
- (u(!0), T(P, null, re(t(C).filter(
310
- (n) => n.name.toLowerCase().includes(t(s).searchKey.toLowerCase())
311
- ), (n) => (u(), h(Y, {
312
- key: n._id.toString(),
313
- onClick: (S) => w(n),
314
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
315
- }, {
316
- default: R(() => {
317
- var S;
318
- return [
319
- c("div", Ue, [
320
- c("div", Te, [
321
- (u(), h(ce(t($)(n)))),
322
- k(n) ? (u(), h(J, {
323
- key: 0,
324
- label: "Feedvibe",
325
- class: "text-fm-color-primary bg-fm-color-system-warning-100",
326
- compact: ""
327
- })) : L("", !0),
328
- c("div", Pe, v(((S = n.pf_collectible) == null ? void 0 : S.currentReceive) ?? 0) + " claimed ", 1)
329
- ]),
330
- c("div", Re, [
331
- c("div", Le, v(n.name), 1),
332
- c("div", Ie, v(t(D)(n)), 1)
333
- ])
334
- ]),
335
- c("div", Ee, [
336
- l(g, {
337
- icon: "content_copy",
338
- "icon-color": "neutral-gray-400",
339
- variant: "tertiary",
340
- onClick: async (f) => {
341
- f.stopPropagation(), await A(n);
342
- }
343
- }, null, 8, ["onClick"]),
344
- x(n) ? (u(), h(g, {
345
- key: 0,
346
- icon: "visibility",
347
- "icon-color": "neutral-gray-400",
348
- variant: "tertiary",
349
- onClick: async (f) => {
350
- f.stopPropagation(), await t(B).push({
351
- name: t(K)["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
352
- params: { id: n._id }
353
- });
354
- }
355
- }, null, 8, ["onClick"])) : L("", !0),
356
- x(n) ? (u(), h(g, {
357
- key: 1,
358
- icon: "send",
359
- "icon-color": "neutral-gray-400",
360
- variant: "tertiary",
361
- onClick: (f) => {
362
- var M;
363
- f.stopPropagation(), (M = t(V)) == null || M.showSheet({
364
- campaignId: n._id
365
- });
366
- }
367
- }, null, 8, ["onClick"])) : L("", !0),
368
- l(g, {
369
- icon: "delete",
370
- "icon-color": "neutral-gray-400",
371
- variant: "tertiary",
372
- onClick: (f) => (f.stopPropagation(), O(n))
373
- }, null, 8, ["onClick"])
374
- ])
375
- ];
376
- }),
377
- _: 2
378
- }, 1032, ["onClick"]))), 128))
379
- ]),
380
- _: 1
381
- })
382
- ], 64)) : (u(), h(oe, {
383
- key: 1,
384
- variant: "outlined",
385
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
386
- }, {
387
- default: R(() => [
388
- o[7] || (o[7] = c("img", {
389
- src: ie,
390
- class: "aspect-square w-[150px]"
391
- }, null, -1)),
392
- c("div", Be, [
393
- c("div", Oe, v(t(a)("connect.voucher.createVoucherCampaign")), 1),
394
- c("div", Ae, v(t(a)("connect.voucher.description")), 1)
395
- ]),
396
- l(g, {
397
- variant: "primary",
398
- label: t(a)("connect.voucher.createVoucherCampaign"),
399
- icon: "add",
400
- onClick: o[6] || (o[6] = (n) => w())
401
- }, null, 8, ["label"])
402
- ]),
403
- _: 1
404
- })),
405
- l(_e, {
406
- ref_key: "sheetRef",
407
- ref: F,
408
- "onSubmit:modelValue": Z
409
- }, null, 512),
410
- l(Ce, {
411
- ref_key: "sendVoucherSheetRef",
412
- ref: V
413
- }, null, 512)
414
- ])
415
- ], 64);
416
- };
417
- }
418
- });
419
- export {
420
- ao as default
421
- };