@feedmepos/mf-connect 0.1.38-beta.70 → 0.1.38-beta.72
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.
- package/package.json +1 -1
- package/dist/Analytic-qVhEo_im.js +0 -761
- package/dist/App-Ixv1jrHc.js +0 -4638
- package/dist/AuditLogs-B2D62tMF.js +0 -1991
- package/dist/Bin-Lj7jtS9m.js +0 -166
- package/dist/Broadcast-BpP9VJsx.js +0 -267
- package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BB43gKXv.js +0 -121
- package/dist/Card-CjArjpou.js +0 -909
- package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
- package/dist/Collections-CFzUAHxz.js +0 -540
- package/dist/Credit-D43x-T3d.js +0 -261
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DlgTeQLe.js +0 -3167
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-9UhSzClJ.js +0 -351
- package/dist/Experience-BaUbRoHV.js +0 -260
- package/dist/FileSaver.min-BO_rbswB.js +0 -74
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
- package/dist/Game-DaVqgPWQ.js +0 -331
- package/dist/GenerateMaterial-DJM8fZyl.js +0 -589
- package/dist/Grab-CykZDrWI.js +0 -301
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-C51yGAp9.js +0 -145
- package/dist/Index-Do3WIIfM.js +0 -259
- package/dist/JsonViewer-v8_C7l5N.js +0 -87
- package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-BjdBaj4c.js +0 -18737
- package/dist/MainLayout-DD-OlYxZ.js +0 -41
- package/dist/Marketing-C9bsnUaQ.js +0 -145
- package/dist/MarketingMaterialEdit-CbSh8dpn.js +0 -746
- package/dist/Member-IcVRwAAS.js +0 -280
- package/dist/MemberList-C_A4PrQN.js +0 -1605
- package/dist/MemberOverview-wL_ailso.js +0 -58
- package/dist/MemberTransactions-CBoaY-gv.js +0 -45
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Dx28XNPi.js +0 -60798
- package/dist/Mission-COY_uhwz.js +0 -335
- package/dist/Overview-DDSz2R4K.js +0 -1078
- package/dist/Point-C-KEwgx4.js +0 -263
- package/dist/Promotion-BpW9qWzf.js +0 -397
- package/dist/Queue-CO32O8i6.js +0 -259
- package/dist/Record-BrT5DR9L.js +0 -341
- package/dist/Reward-CbrEw-If.js +0 -442
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-CpNjlbjZ.js +0 -149
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BS5jsRiN.js +0 -1912
- package/dist/Segment-Cu9_qwXc.js +0 -881
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BH-hzxSs.js +0 -181
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-DGm3gujH.js +0 -188
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-DcUb8X-q.js +0 -147
- package/dist/Setting-CQKfb5b_.js +0 -1999
- package/dist/SettingAdvertisements-BxR6Gl-5.js +0 -263
- package/dist/Store-6TUpmqAr.js +0 -1995
- package/dist/StoreRewards-BOThAOWU.js +0 -534
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BYD229dz.js +0 -1034
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-CAamZtdf.js +0 -7005
- package/dist/Tier-MF-ad-xm.js +0 -969
- package/dist/Title-MkjTHBzb.js +0 -567
- package/dist/Transaction-trYJwTrc.js +0 -39
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-DwlNK1TC.js +0 -130
- package/dist/Voucher-BD5dTdht.js +0 -422
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-BhR_s48Q.js +0 -421
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-CcTe5TJL.js +0 -56
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
- package/dist/app-CybjF-6Q.js +0 -59071
- package/dist/app-wDQR6dpb.js +0 -39
- package/dist/app.js +0 -7
- package/dist/business-2hCbD0JX.js +0 -82
- package/dist/campaign-Bv-8uM2S.js +0 -100
- package/dist/campaign-CpzFl8Vr.js +0 -4
- package/dist/campaign-h1J8NTAo.js +0 -253
- package/dist/campaign.enum-Dea0E4o1.js +0 -26
- package/dist/campaign.fn-DqxZMyu0.js +0 -776
- package/dist/collectible.enum-DOyAoz4F.js +0 -19
- package/dist/collection.fn-DU2HuZod.js +0 -26
- package/dist/dto-CT65-FHY.js +0 -222
- package/dist/duplicateCampaign-YJGHvOqb.js +0 -51
- package/dist/effect-XZ767UQ4.js +0 -89
- package/dist/email-addresses-DSgkxSnV.js +0 -705
- package/dist/export-4gx5C9s9.js +0 -96
- package/dist/feedme.ico +0 -0
- package/dist/helper-HOLsJca3.js +0 -86
- package/dist/index-BO7N-s4K.js +0 -8912
- package/dist/index-BfRa1sI3.js +0 -54
- package/dist/index-BnCtmlvU.js +0 -28897
- package/dist/index-C5VvGYtP.js +0 -56
- package/dist/index-CSzvYzf4.js +0 -3419
- package/dist/index-CrdkPXsx.js +0 -124
- package/dist/index-CuvNtC_M.js +0 -61
- package/dist/index-CxE-VVlL.js +0 -76
- package/dist/index-Djenbz3F.js +0 -3
- package/dist/index-IHteBJ_D.js +0 -32
- package/dist/index-dUhOAfj9.js +0 -2423
- package/dist/index-vh86FiIQ.js +0 -10
- package/dist/index-wm4nGBB_.js +0 -30289
- package/dist/index-xTrAj026.js +0 -31
- package/dist/index-yViT18i_.js +0 -36
- package/dist/index.esm2017-Wq4FUMEv.js +0 -3069
- package/dist/loading-D22xapd8.js +0 -215
- package/dist/lodash-HM6bxuWV.js +0 -3678
- package/dist/membership-CX464ZBI.js +0 -235
- package/dist/moment-D7p2TMB-.js +0 -2583
- package/dist/money-B3cPZAZu.js +0 -15
- package/dist/number-DT65dEZt.js +0 -12
- package/dist/object-qECH92oz.js +0 -26
- package/dist/objectId-dwaoBfJX.js +0 -7
- package/dist/objectid-DZWw4iLL.js +0 -145
- package/dist/plugins-D-4BlIGs.js +0 -1817
- package/dist/remy-D_Deb3ue.js +0 -13
- package/dist/reward-C6B-kn0X.js +0 -36
- package/dist/rule-B94SrDX1.js +0 -1969
- package/dist/rule-builder-CQ3uHeX4.js +0 -102
- package/dist/style.css +0 -13
- package/dist/template-CXB2Ez2S.js +0 -188
- package/dist/tier-BJDhpH6X.js +0 -4
- package/dist/tiers/tier=1.png +0 -0
- package/dist/tiers/tier=2.png +0 -0
- package/dist/tiers/tier=3.png +0 -0
- package/dist/tiers/tier=4.png +0 -0
- package/dist/timezone-D3NuV-rx.js +0 -1154
- package/dist/titles/type=diamond.png +0 -0
- package/dist/titles/type=drinks.png +0 -0
- package/dist/titles/type=food.png +0 -0
- package/dist/titles/type=heart.png +0 -0
- package/dist/titles/type=medal.png +0 -0
- package/dist/titles/type=spend.png +0 -0
- package/dist/titles/type=thank-you.png +0 -0
- package/dist/titles/type=thumbs-up.png +0 -0
- package/dist/titles/type=years.png +0 -0
- package/dist/trigger-BsCVC_nU.js +0 -213
- package/dist/tslib.es6-BCqqvLQ_.js +0 -44
- package/dist/type_drinks-D6jnpvwV.js +0 -4
- package/dist/usePagination-BOZ0-D67.js +0 -223
- package/dist/user-Dxp7kluY.js +0 -55
- package/dist/vue-i18n-DpCWu1gI.js +0 -2365
- package/dist/xlsx-Cc2a2IL9.js +0 -15491
- package/dist/zod-BCSHGdXs.js +0 -91
package/dist/Point-C-KEwgx4.js
DELETED
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
import { defineComponent as H, ref as I, computed as q, h as x, onMounted as z, resolveComponent as m, openBlock as d, createElementBlock as v, Fragment as k, createVNode as s, unref as o, withCtx as h, createElementVNode as n, toDisplayString as u, renderList as G, createBlock as F, resolveDynamicComponent as J } from "vue";
|
|
2
|
-
import { _ as Q } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { useDialog as W, components as V } from "@feedmepos/ui-library";
|
|
4
|
-
import { p as X } from "./plugins-D-4BlIGs.js";
|
|
5
|
-
import { u as Y } from "./loading-D22xapd8.js";
|
|
6
|
-
import { u as Z } from "./business-2hCbD0JX.js";
|
|
7
|
-
import { u as ee } from "./campaign-Bv-8uM2S.js";
|
|
8
|
-
import { a as te, b as $, c as N } from "./campaign-h1J8NTAo.js";
|
|
9
|
-
import { c as oe, p as ae } from "./duplicateCampaign-YJGHvOqb.js";
|
|
10
|
-
import { _ as ne } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
|
|
11
|
-
import { _ as ie } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DlgTeQLe.js";
|
|
12
|
-
import { u as se } from "./template-CXB2Ez2S.js";
|
|
13
|
-
import { u as re } from "./vue-i18n-DpCWu1gI.js";
|
|
14
|
-
import { c as f } from "./index-CrdkPXsx.js";
|
|
15
|
-
const le = { class: "flex items-center" }, ce = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, me = { class: "px-24 flex flex-col gap-y-16" }, pe = { class: "flex items-center justify-between w-full" }, de = { class: "flex gap-8 overflow-x-auto" }, ue = { class: "space-y-8" }, fe = { class: "flex w-full gap-4 items-center" }, ge = { class: "space-y-4" }, ye = { class: "fm-typo-en-body-lg-600" }, _e = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, he = { class: "flex items-center gap-8" }, Ce = { class: "flex flex-col gap-16 text-center" }, we = { class: "fm-typo-en-title-sm-800" }, be = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ae = /* @__PURE__ */ H({
|
|
16
|
-
__name: "Point",
|
|
17
|
-
setup(xe) {
|
|
18
|
-
const { t: i } = re(), D = {
|
|
19
|
-
label: i("connect.program.common.actions.create", {
|
|
20
|
-
type: i("connect.program.point.title").toLowerCase()
|
|
21
|
-
}),
|
|
22
|
-
value: "create",
|
|
23
|
-
isPrimary: !0,
|
|
24
|
-
prependIcon: "add"
|
|
25
|
-
}, K = se("COIN", W()), C = Z(), p = ee(), { global: O, minor: S } = Y, l = I({
|
|
26
|
-
searchKey: "",
|
|
27
|
-
location: []
|
|
28
|
-
});
|
|
29
|
-
function A(e) {
|
|
30
|
-
const t = l.value.location;
|
|
31
|
-
return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((c) => {
|
|
32
|
-
var r;
|
|
33
|
-
return (r = e == null ? void 0 : e.targetLocation) == null ? void 0 : r.includes(c);
|
|
34
|
-
}) : e.targetLocation.includes(t);
|
|
35
|
-
}
|
|
36
|
-
const g = q(
|
|
37
|
-
() => p.campaigns.point.filter((e) => A(e))
|
|
38
|
-
), R = [
|
|
39
|
-
{
|
|
40
|
-
header: i("connect.program.common.table.title"),
|
|
41
|
-
accessorFn: (e) => e.name
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
header: i("connect.program.common.table.status"),
|
|
45
|
-
accessorFn: (e) => te(e),
|
|
46
|
-
cell(e) {
|
|
47
|
-
return $(e.row.original);
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
header: i("connect.program.common.table.summary"),
|
|
52
|
-
accessorFn: (e) => N(e)
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
header: i("connect.program.common.table.actions"),
|
|
56
|
-
cell(e) {
|
|
57
|
-
return x("div", { class: "flex items-center gap-8 justify-end" }, [
|
|
58
|
-
x(V.FmButton, {
|
|
59
|
-
variant: "tertiary",
|
|
60
|
-
icon: "content_copy",
|
|
61
|
-
iconColor: "neutral-gray-400",
|
|
62
|
-
onClick: async (t) => {
|
|
63
|
-
t.stopPropagation(), await P(e.row.original);
|
|
64
|
-
}
|
|
65
|
-
}),
|
|
66
|
-
x(V.FmButton, {
|
|
67
|
-
variant: "tertiary",
|
|
68
|
-
icon: "delete",
|
|
69
|
-
iconColor: "neutral-gray-400",
|
|
70
|
-
onClick: (t) => {
|
|
71
|
-
t.stopPropagation(), L(e.row.original);
|
|
72
|
-
}
|
|
73
|
-
})
|
|
74
|
-
]);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
], w = I();
|
|
78
|
-
async function L(e) {
|
|
79
|
-
await X.remove(`Are you sure you want to remove ${e.name}?`) && await S(
|
|
80
|
-
async () => {
|
|
81
|
-
await f.delete(e._id), await p.read("COIN");
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
message: `Removing ${e.name}`,
|
|
85
|
-
successMessage: `Removed ${e.name} successfully`
|
|
86
|
-
}
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
async function y(e) {
|
|
90
|
-
e ? await t() : K.open(async (c) => {
|
|
91
|
-
await t(c);
|
|
92
|
-
});
|
|
93
|
-
async function t(c) {
|
|
94
|
-
var r;
|
|
95
|
-
(r = w.value) == null || r.showSheet(
|
|
96
|
-
!0,
|
|
97
|
-
"COIN",
|
|
98
|
-
e ? await f.readById(e._id) : void 0,
|
|
99
|
-
c
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
async function P(e) {
|
|
104
|
-
var r;
|
|
105
|
-
if (!await oe(e.name))
|
|
106
|
-
return;
|
|
107
|
-
const t = await f.readById(e._id), c = ae(t, {
|
|
108
|
-
keepCollectible: !0
|
|
109
|
-
});
|
|
110
|
-
(r = w.value) == null || r.showSheet(
|
|
111
|
-
!0,
|
|
112
|
-
"COIN",
|
|
113
|
-
c,
|
|
114
|
-
t.template
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
async function U(e) {
|
|
118
|
-
await S(
|
|
119
|
-
async () => {
|
|
120
|
-
e.campaign._id ? await f.update(e.campaign._id, e) : await f.create(e), await p.read("COIN");
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
message: `${e.campaign._id ? "Updating" : "Creating"} point program`,
|
|
124
|
-
successMessage: `Point program ${e.campaign._id ? "updated" : "created"} successfully`
|
|
125
|
-
}
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
return z(async () => {
|
|
129
|
-
await O(async () => {
|
|
130
|
-
await p.read("COIN");
|
|
131
|
-
});
|
|
132
|
-
}), (e, t) => {
|
|
133
|
-
const c = m("FmPill"), r = m("FmPageHead"), B = m("FmSearch"), j = m("FmTable"), b = m("FmButton"), T = m("FmListItem"), E = m("FmList"), M = m("FmCard");
|
|
134
|
-
return d(), v(k, null, [
|
|
135
|
-
s(r, {
|
|
136
|
-
title: o(i)("connect.program.point.title"),
|
|
137
|
-
actions: o(g).length > 0 && o(C).isPremium ? [D] : [],
|
|
138
|
-
"onClick:action": t[0] || (t[0] = () => y())
|
|
139
|
-
}, {
|
|
140
|
-
title: h(() => [
|
|
141
|
-
n("div", le, [
|
|
142
|
-
n("span", ce, u(o(i)("connect.program.point.title")), 1),
|
|
143
|
-
s(c, { variant: "premium" })
|
|
144
|
-
])
|
|
145
|
-
]),
|
|
146
|
-
_: 1
|
|
147
|
-
}, 8, ["title", "actions"]),
|
|
148
|
-
n("div", me, [
|
|
149
|
-
s(B, {
|
|
150
|
-
modelValue: o(l).searchKey,
|
|
151
|
-
"onUpdate:modelValue": t[1] || (t[1] = (a) => o(l).searchKey = a),
|
|
152
|
-
class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
|
|
153
|
-
placeholder: "search",
|
|
154
|
-
collapsible: ""
|
|
155
|
-
}, null, 8, ["modelValue"]),
|
|
156
|
-
o(p).campaigns.point && o(p).campaigns.point.length > 0 ? (d(), v(k, { key: 0 }, [
|
|
157
|
-
n("div", pe, [
|
|
158
|
-
n("div", de, [
|
|
159
|
-
s(ne, {
|
|
160
|
-
label: `${o(i)("connect.common.location")}: `,
|
|
161
|
-
"right-icon": "keyboard_arrow_down",
|
|
162
|
-
modelValue: o(l).location,
|
|
163
|
-
"onUpdate:modelValue": t[2] || (t[2] = (a) => o(l).location = a),
|
|
164
|
-
icon: "storefront",
|
|
165
|
-
"show-item-label": !0,
|
|
166
|
-
items: o(C).locationOptions
|
|
167
|
-
}, null, 8, ["label", "modelValue", "items"])
|
|
168
|
-
]),
|
|
169
|
-
s(B, {
|
|
170
|
-
modelValue: o(l).searchKey,
|
|
171
|
-
"onUpdate:modelValue": t[3] || (t[3] = (a) => o(l).searchKey = a),
|
|
172
|
-
class: "xs:hidden sm:hidden",
|
|
173
|
-
placeholder: "search",
|
|
174
|
-
collapsible: ""
|
|
175
|
-
}, null, 8, ["modelValue"])
|
|
176
|
-
]),
|
|
177
|
-
s(j, {
|
|
178
|
-
class: "xs:hidden sm:hidden",
|
|
179
|
-
"row-data": o(g),
|
|
180
|
-
"column-defs": R,
|
|
181
|
-
"search-value": o(l).searchKey,
|
|
182
|
-
"column-filter": [],
|
|
183
|
-
onRowClick: t[4] || (t[4] = (a) => y(a.original)),
|
|
184
|
-
"hide-footer": o(g).length < 10
|
|
185
|
-
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
186
|
-
s(E, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
|
|
187
|
-
default: h(() => [
|
|
188
|
-
(d(!0), v(k, null, G(o(g).filter(
|
|
189
|
-
(a) => a.name.toLowerCase().includes(o(l).searchKey.toLowerCase())
|
|
190
|
-
), (a) => (d(), F(T, {
|
|
191
|
-
key: a._id.toString(),
|
|
192
|
-
onClick: (_) => y(a),
|
|
193
|
-
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
194
|
-
}, {
|
|
195
|
-
default: h(() => [
|
|
196
|
-
n("div", ue, [
|
|
197
|
-
n("div", fe, [
|
|
198
|
-
(d(), F(J(o($)(a))))
|
|
199
|
-
]),
|
|
200
|
-
n("div", ge, [
|
|
201
|
-
n("div", ye, u(a.name), 1),
|
|
202
|
-
n("div", _e, u(o(N)(a)), 1)
|
|
203
|
-
])
|
|
204
|
-
]),
|
|
205
|
-
n("div", he, [
|
|
206
|
-
s(b, {
|
|
207
|
-
icon: "content_copy",
|
|
208
|
-
"icon-color": "neutral-gray-400",
|
|
209
|
-
variant: "tertiary",
|
|
210
|
-
onClick: async (_) => {
|
|
211
|
-
_.stopPropagation(), await P(a);
|
|
212
|
-
}
|
|
213
|
-
}, null, 8, ["onClick"]),
|
|
214
|
-
s(b, {
|
|
215
|
-
icon: "delete",
|
|
216
|
-
"icon-color": "neutral-gray-400",
|
|
217
|
-
variant: "tertiary",
|
|
218
|
-
onClick: (_) => (_.stopPropagation(), L(a))
|
|
219
|
-
}, null, 8, ["onClick"])
|
|
220
|
-
])
|
|
221
|
-
]),
|
|
222
|
-
_: 2
|
|
223
|
-
}, 1032, ["onClick"]))), 128))
|
|
224
|
-
]),
|
|
225
|
-
_: 1
|
|
226
|
-
})
|
|
227
|
-
], 64)) : (d(), F(M, {
|
|
228
|
-
key: 1,
|
|
229
|
-
variant: "outlined",
|
|
230
|
-
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
231
|
-
}, {
|
|
232
|
-
default: h(() => [
|
|
233
|
-
t[6] || (t[6] = n("img", {
|
|
234
|
-
src: Q,
|
|
235
|
-
class: "aspect-square w-[150px]"
|
|
236
|
-
}, null, -1)),
|
|
237
|
-
n("div", Ce, [
|
|
238
|
-
n("div", we, u(o(i)("connect.program.point.empty_state.title")), 1),
|
|
239
|
-
n("div", be, u(o(i)("connect.program.point.empty_state.description")), 1)
|
|
240
|
-
]),
|
|
241
|
-
s(b, {
|
|
242
|
-
variant: "primary",
|
|
243
|
-
label: "Create point program",
|
|
244
|
-
disabled: !o(C).isPremium,
|
|
245
|
-
icon: "add",
|
|
246
|
-
onClick: t[5] || (t[5] = (a) => y())
|
|
247
|
-
}, null, 8, ["disabled"])
|
|
248
|
-
]),
|
|
249
|
-
_: 1
|
|
250
|
-
})),
|
|
251
|
-
s(ie, {
|
|
252
|
-
ref_key: "sheetRef",
|
|
253
|
-
ref: w,
|
|
254
|
-
"onSubmit:modelValue": U
|
|
255
|
-
}, null, 512)
|
|
256
|
-
])
|
|
257
|
-
], 64);
|
|
258
|
-
};
|
|
259
|
-
}
|
|
260
|
-
});
|
|
261
|
-
export {
|
|
262
|
-
Ae as default
|
|
263
|
-
};
|
|
@@ -1,397 +0,0 @@
|
|
|
1
|
-
import { defineComponent as Q, ref as w, resolveComponent as d, openBlock as f, createBlock as S, unref as a, isRef as te, withCtx as k, createElementVNode as i, createVNode as c, computed as ne, h as I, onMounted as ae, createElementBlock as L, Fragment as B, renderList as se, resolveDynamicComponent as ie, toDisplayString as h } from "vue";
|
|
2
|
-
import { _ as re } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { useDialog as le, components as N } from "@feedmepos/ui-library";
|
|
4
|
-
import { c as $, p as j } from "./plugins-D-4BlIGs.js";
|
|
5
|
-
import { u as ce } from "./loading-D22xapd8.js";
|
|
6
|
-
import { u as me } from "./business-2hCbD0JX.js";
|
|
7
|
-
import { u as ue } from "./campaign-Bv-8uM2S.js";
|
|
8
|
-
import { u as de } from "./vue-i18n-DpCWu1gI.js";
|
|
9
|
-
import { g as q, a as pe, b as K } from "./campaign-h1J8NTAo.js";
|
|
10
|
-
import { c as fe, p as ye } from "./duplicateCampaign-YJGHvOqb.js";
|
|
11
|
-
import { e as U } from "./effect-XZ767UQ4.js";
|
|
12
|
-
import { _ as ge } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DlgTeQLe.js";
|
|
13
|
-
import { c as y } from "./index-CrdkPXsx.js";
|
|
14
|
-
import { u as he } from "./template-CXB2Ez2S.js";
|
|
15
|
-
import { _ as E } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
|
|
16
|
-
const _e = { class: "space-y-8" }, be = /* @__PURE__ */ Q({
|
|
17
|
-
__name: "QueueSheet",
|
|
18
|
-
emits: ["update:model-value"],
|
|
19
|
-
setup(H, { expose: n, emit: R }) {
|
|
20
|
-
const p = w(!1), _ = w([]);
|
|
21
|
-
async function P() {
|
|
22
|
-
p.value = !0;
|
|
23
|
-
const r = await y.getPromotionQueue();
|
|
24
|
-
console.log(r, "jobs"), _.value = r;
|
|
25
|
-
}
|
|
26
|
-
const v = [
|
|
27
|
-
{
|
|
28
|
-
header: "Started At",
|
|
29
|
-
accessorFn: (r) => r.createdAt,
|
|
30
|
-
enableSorting: !0
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
header: "Campaigns",
|
|
34
|
-
accessorFn: (r) => r.campaigns
|
|
35
|
-
// cell(props) {
|
|
36
|
-
// const r = props.row.original;
|
|
37
|
-
// return h('div', {
|
|
38
|
-
// innerHTML: r.campaigns.map((c: any) => c.name).join(', '),
|
|
39
|
-
// });
|
|
40
|
-
// },
|
|
41
|
-
}
|
|
42
|
-
];
|
|
43
|
-
return n({
|
|
44
|
-
showSheet: P
|
|
45
|
-
}), (r, u) => {
|
|
46
|
-
const b = d("FmTable"), T = d("FmSideSheet");
|
|
47
|
-
return f(), S(T, {
|
|
48
|
-
"max-width": 550,
|
|
49
|
-
header: "Promotion Sync Queue",
|
|
50
|
-
modelValue: a(p),
|
|
51
|
-
"onUpdate:modelValue": [
|
|
52
|
-
u[1] || (u[1] = (s) => te(p) ? p.value = s : null),
|
|
53
|
-
u[2] || (u[2] = (s) => p.value = s)
|
|
54
|
-
]
|
|
55
|
-
}, {
|
|
56
|
-
default: k(() => [
|
|
57
|
-
i("div", _e, [
|
|
58
|
-
u[3] || (u[3] = i("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Promotion synchronizing to your restaurant(s) is queued here. Depending on the number of campaigns and restaurants, this process may take several minutes. No task displayed here means there are no pending promotions to sync. ", -1)),
|
|
59
|
-
c(b, {
|
|
60
|
-
modelValue: r.tableRef,
|
|
61
|
-
"onUpdate:modelValue": u[0] || (u[0] = (s) => r.tableRef = s),
|
|
62
|
-
"column-filter": r.jobFilters,
|
|
63
|
-
"column-defs": v,
|
|
64
|
-
"row-data": a(_),
|
|
65
|
-
"hide-footer": a(_).length <= 10
|
|
66
|
-
}, null, 8, ["modelValue", "column-filter", "row-data", "hide-footer"])
|
|
67
|
-
])
|
|
68
|
-
]),
|
|
69
|
-
_: 1
|
|
70
|
-
}, 8, ["modelValue"]);
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
}), we = { class: "px-24 flex flex-col gap-y-16" }, ve = { class: "flex items-center justify-between w-full" }, Ce = { class: "flex gap-8 overflow-x-auto" }, xe = { class: "space-y-8" }, Fe = { class: "flex w-full gap-4 items-center" }, Se = { class: "space-y-4" }, ke = { class: "fm-typo-en-body-lg-600" }, Pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Te = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ve = { class: "flex items-center gap-8" }, Oe = { class: "flex flex-col gap-16 text-center" }, Ie = { class: "fm-typo-en-title-sm-800" }, Le = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ge = /* @__PURE__ */ Q({
|
|
74
|
-
__name: "Promotion",
|
|
75
|
-
setup(H) {
|
|
76
|
-
const { t: n } = de(), R = {
|
|
77
|
-
label: n("connect.promotion.createCampaign"),
|
|
78
|
-
value: "create",
|
|
79
|
-
isPrimary: !0,
|
|
80
|
-
prependIcon: "add"
|
|
81
|
-
}, p = {
|
|
82
|
-
label: "Force sync",
|
|
83
|
-
value: "sync",
|
|
84
|
-
isPrimary: !1,
|
|
85
|
-
prependIcon: "refresh"
|
|
86
|
-
}, _ = {
|
|
87
|
-
label: "Queue",
|
|
88
|
-
value: "queue",
|
|
89
|
-
isPrimary: !1,
|
|
90
|
-
prependIcon: "work_history"
|
|
91
|
-
}, P = he("PROMOTION", le()), v = me(), r = ue(), { global: u, minor: b } = ce, T = [
|
|
92
|
-
{
|
|
93
|
-
label: "Bill promotion",
|
|
94
|
-
value: "BILL"
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
label: "Item promotion",
|
|
98
|
-
value: "ITEM"
|
|
99
|
-
}
|
|
100
|
-
], s = w({
|
|
101
|
-
searchKey: "",
|
|
102
|
-
location: [],
|
|
103
|
-
effectType: []
|
|
104
|
-
});
|
|
105
|
-
function z(e) {
|
|
106
|
-
const o = s.value.location;
|
|
107
|
-
return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some((m) => {
|
|
108
|
-
var l;
|
|
109
|
-
return (l = e == null ? void 0 : e.targetLocation) == null ? void 0 : l.includes(m);
|
|
110
|
-
}) : e.targetLocation.includes(o);
|
|
111
|
-
}
|
|
112
|
-
function G(e) {
|
|
113
|
-
var l, x;
|
|
114
|
-
const o = s.value.effectType;
|
|
115
|
-
if (!o || o.length === 0) return !0;
|
|
116
|
-
const m = (x = (l = e.effect) == null ? void 0 : l.options) == null ? void 0 : x.target;
|
|
117
|
-
return o.includes(m);
|
|
118
|
-
}
|
|
119
|
-
const g = ne(
|
|
120
|
-
() => r.campaigns.promotion.filter(
|
|
121
|
-
(e) => z(e) && G(e)
|
|
122
|
-
)
|
|
123
|
-
), J = [
|
|
124
|
-
{
|
|
125
|
-
header: n("connect.promotion.promotionTitle"),
|
|
126
|
-
accessorFn: (e) => e.name
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
header: n("connect.promotion.campaignDate"),
|
|
130
|
-
accessorFn: (e) => q(e)
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
header: n("connect.promotion.status"),
|
|
134
|
-
accessorFn: (e) => pe(e),
|
|
135
|
-
cell(e) {
|
|
136
|
-
return K(e.row.original);
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
header: n("connect.promotion.type"),
|
|
141
|
-
accessorFn: (e) => `${$.title(e.effect.options.target)} promotion`
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
header: n("connect.promotion.summary"),
|
|
145
|
-
accessorFn: (e) => U(e.effect)
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
header: n("connect.promotion.actions"),
|
|
149
|
-
cell(e) {
|
|
150
|
-
return I("div", { class: "flex items-center gap-8 justify-end" }, [
|
|
151
|
-
I(N.FmButton, {
|
|
152
|
-
variant: "tertiary",
|
|
153
|
-
icon: "content_copy",
|
|
154
|
-
iconColor: "neutral-gray-400",
|
|
155
|
-
onClick: async (o) => {
|
|
156
|
-
o.stopPropagation(), await M(e.row.original);
|
|
157
|
-
}
|
|
158
|
-
}),
|
|
159
|
-
I(N.FmButton, {
|
|
160
|
-
variant: "tertiary",
|
|
161
|
-
icon: "delete",
|
|
162
|
-
iconColor: "neutral-gray-400",
|
|
163
|
-
onClick: (o) => {
|
|
164
|
-
o.stopPropagation(), D(e.row.original);
|
|
165
|
-
}
|
|
166
|
-
})
|
|
167
|
-
]);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
], V = w(), A = w();
|
|
171
|
-
async function D(e) {
|
|
172
|
-
await j.remove(
|
|
173
|
-
n("connect.promotion.confirmRemove", { name: e.name })
|
|
174
|
-
) && await b(
|
|
175
|
-
async () => {
|
|
176
|
-
await y.delete(e._id), await r.read("PROMOTION");
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
message: n("connect.promotion.removing", { name: e.name }),
|
|
180
|
-
successMessage: n("connect.promotion.removedSuccessfully", {
|
|
181
|
-
name: e.name
|
|
182
|
-
})
|
|
183
|
-
}
|
|
184
|
-
);
|
|
185
|
-
}
|
|
186
|
-
async function C(e) {
|
|
187
|
-
e ? await o() : P.open(async (m) => {
|
|
188
|
-
await o(m);
|
|
189
|
-
});
|
|
190
|
-
async function o(m) {
|
|
191
|
-
var l;
|
|
192
|
-
(l = V.value) == null || l.showSheet(
|
|
193
|
-
!0,
|
|
194
|
-
"PROMOTION",
|
|
195
|
-
e ? await y.readById(e._id) : void 0,
|
|
196
|
-
m
|
|
197
|
-
);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
async function M(e) {
|
|
201
|
-
var l;
|
|
202
|
-
if (!await fe(e.name))
|
|
203
|
-
return;
|
|
204
|
-
const o = await y.readById(e._id), m = ye(o);
|
|
205
|
-
(l = V.value) == null || l.showSheet(
|
|
206
|
-
!0,
|
|
207
|
-
"PROMOTION",
|
|
208
|
-
m,
|
|
209
|
-
o.template
|
|
210
|
-
);
|
|
211
|
-
}
|
|
212
|
-
async function W(e) {
|
|
213
|
-
await b(
|
|
214
|
-
async () => {
|
|
215
|
-
e.campaign._id ? await y.update(e.campaign._id, e) : await y.create(e), await r.read("PROMOTION");
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
message: n(
|
|
219
|
-
e.campaign._id ? "connect.promotion.updating" : "connect.promotion.creating"
|
|
220
|
-
),
|
|
221
|
-
successMessage: n(
|
|
222
|
-
e.campaign._id ? "connect.promotion.updatedSuccessfully" : "connect.promotion.createdSuccessfully"
|
|
223
|
-
)
|
|
224
|
-
}
|
|
225
|
-
);
|
|
226
|
-
}
|
|
227
|
-
async function X(e) {
|
|
228
|
-
var o;
|
|
229
|
-
switch (e) {
|
|
230
|
-
case "create":
|
|
231
|
-
C();
|
|
232
|
-
break;
|
|
233
|
-
case "sync":
|
|
234
|
-
await j.confirm(
|
|
235
|
-
"Are you sure you want to synchronize all promotions to POS?",
|
|
236
|
-
"Force sync"
|
|
237
|
-
) && b(
|
|
238
|
-
async () => {
|
|
239
|
-
await y.syncAllPromotion();
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
message: "Syncing promotions...",
|
|
243
|
-
successMessage: "All promotions synced"
|
|
244
|
-
}
|
|
245
|
-
);
|
|
246
|
-
break;
|
|
247
|
-
case "queue":
|
|
248
|
-
(o = A.value) == null || o.showSheet();
|
|
249
|
-
break;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
return ae(async () => {
|
|
253
|
-
await u(async () => {
|
|
254
|
-
await v.readLocations(), await r.read("PROMOTION");
|
|
255
|
-
});
|
|
256
|
-
}), (e, o) => {
|
|
257
|
-
const m = d("FmPageHead"), l = d("FmSearch"), x = d("FmTable"), Y = d("FmChip"), O = d("FmButton"), Z = d("FmListItem"), ee = d("FmList"), oe = d("FmCard");
|
|
258
|
-
return f(), L(B, null, [
|
|
259
|
-
c(m, {
|
|
260
|
-
title: a(n)("connect.promotion.title"),
|
|
261
|
-
actions: a(g).length > 0 ? [R, p, _] : [],
|
|
262
|
-
"onClick:action": X
|
|
263
|
-
}, null, 8, ["title", "actions"]),
|
|
264
|
-
i("div", we, [
|
|
265
|
-
c(l, {
|
|
266
|
-
modelValue: s.value.searchKey,
|
|
267
|
-
"onUpdate:modelValue": o[0] || (o[0] = (t) => s.value.searchKey = t),
|
|
268
|
-
class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
|
|
269
|
-
placeholder: a(n)("connect.promotion.search"),
|
|
270
|
-
collapsible: ""
|
|
271
|
-
}, null, 8, ["modelValue", "placeholder"]),
|
|
272
|
-
a(g) && a(g).length > 0 ? (f(), L(B, { key: 0 }, [
|
|
273
|
-
i("div", ve, [
|
|
274
|
-
i("div", Ce, [
|
|
275
|
-
c(E, {
|
|
276
|
-
label: `${a(n)("connect.common.location")}: `,
|
|
277
|
-
"right-icon": "keyboard_arrow_down",
|
|
278
|
-
modelValue: s.value.location,
|
|
279
|
-
"onUpdate:modelValue": o[1] || (o[1] = (t) => s.value.location = t),
|
|
280
|
-
icon: "storefront",
|
|
281
|
-
"show-item-label": !0,
|
|
282
|
-
items: a(v).locationOptions
|
|
283
|
-
}, null, 8, ["label", "modelValue", "items"]),
|
|
284
|
-
c(E, {
|
|
285
|
-
label: "Type:",
|
|
286
|
-
"right-icon": "keyboard_arrow_down",
|
|
287
|
-
modelValue: s.value.effectType,
|
|
288
|
-
"onUpdate:modelValue": o[2] || (o[2] = (t) => s.value.effectType = t),
|
|
289
|
-
icon: "filter_list",
|
|
290
|
-
"show-item-label": !0,
|
|
291
|
-
items: T
|
|
292
|
-
}, null, 8, ["modelValue"])
|
|
293
|
-
]),
|
|
294
|
-
c(l, {
|
|
295
|
-
modelValue: s.value.searchKey,
|
|
296
|
-
"onUpdate:modelValue": o[3] || (o[3] = (t) => s.value.searchKey = t),
|
|
297
|
-
class: "xs:hidden sm:hidden",
|
|
298
|
-
placeholder: "search",
|
|
299
|
-
collapsible: ""
|
|
300
|
-
}, null, 8, ["modelValue"])
|
|
301
|
-
]),
|
|
302
|
-
c(x, {
|
|
303
|
-
class: "xs:hidden sm:hidden",
|
|
304
|
-
"row-data": a(g),
|
|
305
|
-
"column-defs": J,
|
|
306
|
-
"search-value": s.value.searchKey,
|
|
307
|
-
"column-filter": [],
|
|
308
|
-
onRowClick: o[4] || (o[4] = (t) => C(t.original)),
|
|
309
|
-
"hide-footer": a(g).length < 10
|
|
310
|
-
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
311
|
-
c(ee, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
|
|
312
|
-
default: k(() => [
|
|
313
|
-
(f(!0), L(B, null, se(a(g).filter(
|
|
314
|
-
(t) => t.name.toLowerCase().includes(s.value.searchKey.toLowerCase())
|
|
315
|
-
), (t) => (f(), S(Z, {
|
|
316
|
-
key: t._id.toString(),
|
|
317
|
-
onClick: (F) => C(t),
|
|
318
|
-
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
319
|
-
}, {
|
|
320
|
-
default: k(() => [
|
|
321
|
-
i("div", xe, [
|
|
322
|
-
i("div", Fe, [
|
|
323
|
-
(f(), S(ie(a(K)(t)))),
|
|
324
|
-
c(Y, {
|
|
325
|
-
class: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
|
|
326
|
-
compact: !0,
|
|
327
|
-
label: `${a($).title(t.effect.options.target)} promotion`
|
|
328
|
-
}, null, 8, ["label"])
|
|
329
|
-
]),
|
|
330
|
-
i("div", Se, [
|
|
331
|
-
i("div", ke, h(t.name), 1),
|
|
332
|
-
i("div", Pe, h(a(U)(t.effect)), 1),
|
|
333
|
-
i("div", Te, h(a(n)("connect.promotion.campaignDate")) + ": " + h(a(q)(t)), 1)
|
|
334
|
-
])
|
|
335
|
-
]),
|
|
336
|
-
i("div", Ve, [
|
|
337
|
-
c(O, {
|
|
338
|
-
icon: "content_copy",
|
|
339
|
-
"icon-color": "neutral-gray-400",
|
|
340
|
-
variant: "tertiary",
|
|
341
|
-
onClick: async (F) => {
|
|
342
|
-
F.stopPropagation(), await M(t);
|
|
343
|
-
}
|
|
344
|
-
}, null, 8, ["onClick"]),
|
|
345
|
-
c(O, {
|
|
346
|
-
icon: "delete",
|
|
347
|
-
"icon-color": "neutral-gray-400",
|
|
348
|
-
variant: "tertiary",
|
|
349
|
-
onClick: (F) => (F.stopPropagation(), D(t))
|
|
350
|
-
}, null, 8, ["onClick"])
|
|
351
|
-
])
|
|
352
|
-
]),
|
|
353
|
-
_: 2
|
|
354
|
-
}, 1032, ["onClick"]))), 128))
|
|
355
|
-
]),
|
|
356
|
-
_: 1
|
|
357
|
-
})
|
|
358
|
-
], 64)) : (f(), S(oe, {
|
|
359
|
-
key: 1,
|
|
360
|
-
variant: "outlined",
|
|
361
|
-
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
362
|
-
}, {
|
|
363
|
-
default: k(() => [
|
|
364
|
-
o[6] || (o[6] = i("img", {
|
|
365
|
-
src: re,
|
|
366
|
-
class: "aspect-square w-[150px]"
|
|
367
|
-
}, null, -1)),
|
|
368
|
-
i("div", Oe, [
|
|
369
|
-
i("div", Ie, h(a(n)("connect.promotion.createPromotionCampaign")), 1),
|
|
370
|
-
i("div", Le, h(a(n)("connect.promotion.description")), 1)
|
|
371
|
-
]),
|
|
372
|
-
c(O, {
|
|
373
|
-
variant: "primary",
|
|
374
|
-
label: a(n)("connect.promotion.createPromotionCampaign"),
|
|
375
|
-
icon: "add",
|
|
376
|
-
onClick: o[5] || (o[5] = (t) => C())
|
|
377
|
-
}, null, 8, ["label"])
|
|
378
|
-
]),
|
|
379
|
-
_: 1
|
|
380
|
-
}))
|
|
381
|
-
]),
|
|
382
|
-
c(ge, {
|
|
383
|
-
ref_key: "sheetRef",
|
|
384
|
-
ref: V,
|
|
385
|
-
"onSubmit:modelValue": W
|
|
386
|
-
}, null, 512),
|
|
387
|
-
c(be, {
|
|
388
|
-
ref_key: "queueSheetRef",
|
|
389
|
-
ref: A
|
|
390
|
-
}, null, 512)
|
|
391
|
-
], 64);
|
|
392
|
-
};
|
|
393
|
-
}
|
|
394
|
-
});
|
|
395
|
-
export {
|
|
396
|
-
Ge as default
|
|
397
|
-
};
|