@feedmepos/mf-connect 0.1.38-beta.52 → 0.1.38-beta.53
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 +2 -2
- package/dist/Analytic-BU1mOMoX.js +0 -760
- package/dist/App-fw6iFNxW.js +0 -4638
- package/dist/AuditLogs-CliU8167.js +0 -1887
- package/dist/Bin-C49tzfas.js +0 -166
- package/dist/Broadcast-YZVnZTCD.js +0 -232
- package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DEwsZags.js +0 -122
- package/dist/Card-DcQQyJl9.js +0 -911
- package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
- package/dist/Collections--8lmoXWR.js +0 -540
- package/dist/Credit-CfkLFMei.js +0 -227
- 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-t6eac8yR.js +0 -3151
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CXVOuiLI.js +0 -347
- package/dist/Experience-BnVVC2-L.js +0 -228
- package/dist/FileSaver.min-NlMItPOc.js +0 -74
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
- package/dist/Game-Dbz4DzY_.js +0 -297
- package/dist/Grab-CCqScmpp.js +0 -300
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-C5irH9v6.js +0 -145
- package/dist/Index-DPsM9D4W.js +0 -259
- package/dist/JsonViewer-v8_C7l5N.js +0 -87
- package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +0 -18737
- package/dist/MainLayout-B1aJoR95.js +0 -41
- package/dist/Marketing-CFwxWdJq.js +0 -21761
- package/dist/Member-ZPKbf5Bk.js +0 -281
- package/dist/MemberList-BDs-70nG.js +0 -1607
- package/dist/MemberOverview-wL_ailso.js +0 -58
- package/dist/MemberTransactions-C-zHpuZF.js +0 -45
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-B2TKmOOK.js +0 -60616
- package/dist/Mission-BHkb1E9m.js +0 -301
- package/dist/Overview-DYlcqNCX.js +0 -1079
- package/dist/Point-BEhNBY2_.js +0 -231
- package/dist/Promotion-DOXRIej4.js +0 -363
- package/dist/Queue-Bwa0LWhf.js +0 -260
- package/dist/Record-BoI8l1Qq.js +0 -341
- package/dist/Reward-BVQaqAYM.js +0 -442
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-BC3dEiWi.js +0 -150
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-HpleMvjm.js +0 -1767
- package/dist/Segment-Cmy7nu27.js +0 -882
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-pab6X2DC.js +0 -181
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-BqIh8D8O.js +0 -189
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-CESoNd87.js +0 -147
- package/dist/Setting-DN8j_6Xv.js +0 -1993
- package/dist/SettingAdvertisements-qHdiaa6m.js +0 -264
- package/dist/Store-DfhVYCgX.js +0 -1936
- package/dist/StoreRewards-NYucFLJU.js +0 -535
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BGOcOAXR.js +0 -1036
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DRin8Jzw.js +0 -8093
- package/dist/Tier-Dl0aBuJz.js +0 -970
- package/dist/Title-DvO6Mira.js +0 -568
- package/dist/Transaction-ONVl4UZZ.js +0 -39
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-FyE25D8o.js +0 -130
- package/dist/Voucher-BZ1feYh1.js +0 -399
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-Lilql8J4.js +0 -421
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-C_ZdCOPI.js +0 -56
- package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
- package/dist/app-B_RRkjaD.js +0 -42566
- package/dist/app-wDQR6dpb.js +0 -39
- package/dist/app.js +0 -7
- package/dist/business-y5qSMcd-.js +0 -82
- package/dist/campaign-CpzFl8Vr.js +0 -4
- package/dist/campaign-DHgol2Lt.js +0 -219
- package/dist/campaign-Drxe0zPX.js +0 -253
- package/dist/campaign.enum-CwAPVgPe.js +0 -21
- package/dist/campaign.fn-DMx5xsiK.js +0 -776
- package/dist/collectible.enum-Bh4jnUgP.js +0 -19
- package/dist/collection.fn-BpC_YBwG.js +0 -26
- package/dist/dto-DWkf9QOb.js +0 -222
- package/dist/effect-D5ZWGpNS.js +0 -78
- package/dist/email-addresses-DFtVESS8.js +0 -705
- package/dist/export-BtUy3sWU.js +0 -97
- package/dist/feedme.ico +0 -0
- package/dist/helper-DtWMZoWX.js +0 -86
- package/dist/index-7HXC3sH0.js +0 -56
- package/dist/index-BQlhmw75.js +0 -3
- package/dist/index-BdX7CxUg.js +0 -30076
- package/dist/index-BerRe0M3.js +0 -76
- package/dist/index-BrZ3xZzk.js +0 -146
- package/dist/index-CJzBpsBP.js +0 -3412
- package/dist/index-CQiABpeB.js +0 -32456
- package/dist/index-CqIWlGW3.js +0 -38
- package/dist/index-CsaQJMAR.js +0 -66
- package/dist/index-DPCDboPA.js +0 -32
- package/dist/index-DPaH8jaV.js +0 -8884
- package/dist/index-Dkce3JZ_.js +0 -54
- package/dist/index-DrYv_gG4.js +0 -31
- package/dist/index-SfJbKfWl.js +0 -2407
- package/dist/index-vh86FiIQ.js +0 -10
- package/dist/index.esm2017-CbvE5vCC.js +0 -3069
- package/dist/loading-BWGIK17X.js +0 -71
- package/dist/lodash-B5I3zXaY.js +0 -3678
- package/dist/membership-Zy2P6O6X.js +0 -235
- package/dist/moment-D7p2TMB-.js +0 -2583
- package/dist/money-D_fZmBbi.js +0 -15
- package/dist/number-C4DhXkCm.js +0 -12
- package/dist/object-qECH92oz.js +0 -26
- package/dist/objectId-dwaoBfJX.js +0 -7
- package/dist/objectid-C6eRcDzI.js +0 -145
- package/dist/plugins-DDAJav2s.js +0 -1817
- package/dist/reward-Dxjvmy7-.js +0 -36
- package/dist/rule-builder-ZkPWAiTl.js +0 -102
- package/dist/rule-sclqeiyk.js +0 -1951
- package/dist/style.css +0 -4
- package/dist/template-CAs0lkTY.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-5t8ki0gE.js +0 -1151
- 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-B2fpKTfg.js +0 -213
- package/dist/tslib.es6-BCqqvLQ_.js +0 -44
- package/dist/type_drinks-D6jnpvwV.js +0 -4
- package/dist/usePagination-Ds-cuHop.js +0 -223
- package/dist/user-ORhbAsqi.js +0 -55
- package/dist/vue-i18n-cyOhW8mW.js +0 -2365
- package/dist/xlsx-4klfjFae.js +0 -15491
- package/dist/zod-BsHmzMQd.js +0 -91
package/dist/Point-BEhNBY2_.js
DELETED
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import { defineComponent as j, ref as P, computed as E, h as M, onMounted as H, resolveComponent as l, openBlock as u, createElementBlock as w, Fragment as b, createVNode as r, unref as o, withCtx as g, createElementVNode as a, toDisplayString as d, renderList as q, createBlock as C, resolveDynamicComponent as z } from "vue";
|
|
2
|
-
import { _ as G } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { useDialog as J, components as Q } from "@feedmepos/ui-library";
|
|
4
|
-
import { p as W } from "./plugins-DDAJav2s.js";
|
|
5
|
-
import { u as X } from "./loading-BWGIK17X.js";
|
|
6
|
-
import { u as Y } from "./business-y5qSMcd-.js";
|
|
7
|
-
import { u as Z, c as _ } from "./campaign-DHgol2Lt.js";
|
|
8
|
-
import { a as ee, b as V, c as B } from "./campaign-Drxe0zPX.js";
|
|
9
|
-
import { _ as te } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
|
|
10
|
-
import { _ as oe } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-t6eac8yR.js";
|
|
11
|
-
import { u as ne } from "./template-CAs0lkTY.js";
|
|
12
|
-
import { u as ae } from "./vue-i18n-cyOhW8mW.js";
|
|
13
|
-
const se = { class: "flex items-center" }, re = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, ie = { class: "px-24 flex flex-col gap-y-16" }, le = { class: "flex items-center justify-between w-full" }, ce = { class: "flex gap-8 overflow-x-auto" }, me = { class: "space-y-8" }, de = { class: "flex w-full gap-4 items-center" }, pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ue = { class: "space-y-4" }, fe = { class: "fm-typo-en-body-lg-600" }, ye = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _e = { class: "flex flex-col gap-16 text-center" }, he = { class: "fm-typo-en-title-sm-800" }, we = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ke = /* @__PURE__ */ j({
|
|
14
|
-
__name: "Point",
|
|
15
|
-
setup(be) {
|
|
16
|
-
const { t: s } = ae(), I = {
|
|
17
|
-
label: s("connect.program.common.actions.create", {
|
|
18
|
-
type: s("connect.program.point.title").toLowerCase()
|
|
19
|
-
}),
|
|
20
|
-
value: "create",
|
|
21
|
-
isPrimary: !0,
|
|
22
|
-
prependIcon: "add"
|
|
23
|
-
}, $ = ne("COIN", J()), h = Y(), p = Z(), { global: K, minor: x } = X, i = P({
|
|
24
|
-
searchKey: "",
|
|
25
|
-
location: []
|
|
26
|
-
});
|
|
27
|
-
function N(e) {
|
|
28
|
-
const t = i.value.location;
|
|
29
|
-
return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((c) => {
|
|
30
|
-
var m;
|
|
31
|
-
return (m = e == null ? void 0 : e.targetLocation) == null ? void 0 : m.includes(c);
|
|
32
|
-
}) : e.targetLocation.includes(t);
|
|
33
|
-
}
|
|
34
|
-
const f = E(
|
|
35
|
-
() => p.campaigns.point.filter((e) => N(e))
|
|
36
|
-
), R = [
|
|
37
|
-
{
|
|
38
|
-
header: s("connect.program.common.table.title"),
|
|
39
|
-
accessorFn: (e) => e.name
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
header: s("connect.program.common.table.status"),
|
|
43
|
-
accessorFn: (e) => ee(e),
|
|
44
|
-
cell(e) {
|
|
45
|
-
return V(e.row.original);
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
header: s("connect.program.common.table.summary"),
|
|
50
|
-
accessorFn: (e) => B(e)
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
header: s("connect.program.common.table.actions"),
|
|
54
|
-
cell(e) {
|
|
55
|
-
return M(Q.FmButton, {
|
|
56
|
-
variant: "tertiary",
|
|
57
|
-
icon: "delete",
|
|
58
|
-
iconColor: "neutral-gray-400",
|
|
59
|
-
onClick: (t) => {
|
|
60
|
-
t.stopPropagation(), F(e.row.original);
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
], v = P();
|
|
66
|
-
async function F(e) {
|
|
67
|
-
await W.remove(`Are you sure you want to remove ${e.name}?`) && await x(
|
|
68
|
-
async () => {
|
|
69
|
-
await _.delete(e._id), await p.read("COIN");
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
message: `Removing ${e.name}`,
|
|
73
|
-
successMessage: `Removed ${e.name} successfully`
|
|
74
|
-
}
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
async function y(e) {
|
|
78
|
-
e ? await t() : $.open(async (c) => {
|
|
79
|
-
await t(c);
|
|
80
|
-
});
|
|
81
|
-
async function t(c) {
|
|
82
|
-
var m;
|
|
83
|
-
(m = v.value) == null || m.showSheet(
|
|
84
|
-
!0,
|
|
85
|
-
"COIN",
|
|
86
|
-
e ? await _.readById(e._id) : void 0,
|
|
87
|
-
c
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
async function O(e) {
|
|
92
|
-
await x(
|
|
93
|
-
async () => {
|
|
94
|
-
e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await p.read("COIN");
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
message: `${e.campaign._id ? "Updating" : "Creating"} point program`,
|
|
98
|
-
successMessage: `Point program ${e.campaign._id ? "updated" : "created"} successfully`
|
|
99
|
-
}
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
return H(async () => {
|
|
103
|
-
await K(async () => {
|
|
104
|
-
await p.read("COIN");
|
|
105
|
-
});
|
|
106
|
-
}), (e, t) => {
|
|
107
|
-
const c = l("FmPill"), m = l("FmPageHead"), k = l("FmSearch"), A = l("FmTable"), L = l("FmButton"), U = l("FmListItem"), D = l("FmList"), T = l("FmCard");
|
|
108
|
-
return u(), w(b, null, [
|
|
109
|
-
r(m, {
|
|
110
|
-
title: o(s)("connect.program.point.title"),
|
|
111
|
-
actions: o(f).length > 0 && o(h).isPremium ? [I] : [],
|
|
112
|
-
"onClick:action": t[0] || (t[0] = () => y())
|
|
113
|
-
}, {
|
|
114
|
-
title: g(() => [
|
|
115
|
-
a("div", se, [
|
|
116
|
-
a("span", re, d(o(s)("connect.program.point.title")), 1),
|
|
117
|
-
r(c, { variant: "premium" })
|
|
118
|
-
])
|
|
119
|
-
]),
|
|
120
|
-
_: 1
|
|
121
|
-
}, 8, ["title", "actions"]),
|
|
122
|
-
a("div", ie, [
|
|
123
|
-
r(k, {
|
|
124
|
-
modelValue: o(i).searchKey,
|
|
125
|
-
"onUpdate:modelValue": t[1] || (t[1] = (n) => o(i).searchKey = n),
|
|
126
|
-
class: "hidden xs:!block border-b-2 border-fm-color-neutral-gray-100",
|
|
127
|
-
placeholder: "search",
|
|
128
|
-
collapsible: ""
|
|
129
|
-
}, null, 8, ["modelValue"]),
|
|
130
|
-
o(p).campaigns.point && o(p).campaigns.point.length > 0 ? (u(), w(b, { key: 0 }, [
|
|
131
|
-
a("div", le, [
|
|
132
|
-
a("div", ce, [
|
|
133
|
-
r(te, {
|
|
134
|
-
label: `${o(s)("connect.common.location")}: `,
|
|
135
|
-
"right-icon": "keyboard_arrow_down",
|
|
136
|
-
modelValue: o(i).location,
|
|
137
|
-
"onUpdate:modelValue": t[2] || (t[2] = (n) => o(i).location = n),
|
|
138
|
-
icon: "storefront",
|
|
139
|
-
"show-item-label": !0,
|
|
140
|
-
items: o(h).locationOptions
|
|
141
|
-
}, null, 8, ["label", "modelValue", "items"])
|
|
142
|
-
]),
|
|
143
|
-
r(k, {
|
|
144
|
-
modelValue: o(i).searchKey,
|
|
145
|
-
"onUpdate:modelValue": t[3] || (t[3] = (n) => o(i).searchKey = n),
|
|
146
|
-
class: "xs:hidden",
|
|
147
|
-
placeholder: "search",
|
|
148
|
-
collapsible: ""
|
|
149
|
-
}, null, 8, ["modelValue"])
|
|
150
|
-
]),
|
|
151
|
-
r(A, {
|
|
152
|
-
class: "xs:hidden",
|
|
153
|
-
"row-data": o(f),
|
|
154
|
-
"column-defs": R,
|
|
155
|
-
"search-value": o(i).searchKey,
|
|
156
|
-
"column-filter": [],
|
|
157
|
-
onRowClick: t[4] || (t[4] = (n) => y(n.original)),
|
|
158
|
-
"hide-footer": o(f).length < 10
|
|
159
|
-
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
160
|
-
r(D, { class: "hidden xs:!flex flex-col mx-[-24px]" }, {
|
|
161
|
-
default: g(() => [
|
|
162
|
-
(u(!0), w(b, null, q(o(f).filter(
|
|
163
|
-
(n) => n.name.toLowerCase().includes(o(i).searchKey.toLowerCase())
|
|
164
|
-
), (n) => (u(), C(U, {
|
|
165
|
-
key: n._id.toString(),
|
|
166
|
-
onClick: (S) => y(n),
|
|
167
|
-
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
168
|
-
}, {
|
|
169
|
-
default: g(() => [
|
|
170
|
-
a("div", me, [
|
|
171
|
-
a("div", de, [
|
|
172
|
-
(u(), C(z(o(V)(n)))),
|
|
173
|
-
a("div", pe, d(o(s)("connect.program.point.used", {
|
|
174
|
-
count: n.currentReceive ?? 0
|
|
175
|
-
})), 1)
|
|
176
|
-
]),
|
|
177
|
-
a("div", ue, [
|
|
178
|
-
a("div", fe, d(n.name), 1),
|
|
179
|
-
a("div", ye, d(o(B)(n)), 1)
|
|
180
|
-
]),
|
|
181
|
-
a("div", ge, " Point received: " + d(n.currentReceive ?? 0), 1)
|
|
182
|
-
]),
|
|
183
|
-
r(L, {
|
|
184
|
-
icon: "delete",
|
|
185
|
-
"icon-color": "neutral-gray-400",
|
|
186
|
-
variant: "tertiary",
|
|
187
|
-
onClick: (S) => (S.stopPropagation(), F(n))
|
|
188
|
-
}, null, 8, ["onClick"])
|
|
189
|
-
]),
|
|
190
|
-
_: 2
|
|
191
|
-
}, 1032, ["onClick"]))), 128))
|
|
192
|
-
]),
|
|
193
|
-
_: 1
|
|
194
|
-
})
|
|
195
|
-
], 64)) : (u(), C(T, {
|
|
196
|
-
key: 1,
|
|
197
|
-
variant: "outlined",
|
|
198
|
-
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
199
|
-
}, {
|
|
200
|
-
default: g(() => [
|
|
201
|
-
t[6] || (t[6] = a("img", {
|
|
202
|
-
src: G,
|
|
203
|
-
class: "aspect-square w-[150px]"
|
|
204
|
-
}, null, -1)),
|
|
205
|
-
a("div", _e, [
|
|
206
|
-
a("div", he, d(o(s)("connect.program.point.empty_state.title")), 1),
|
|
207
|
-
a("div", we, d(o(s)("connect.program.point.empty_state.description")), 1)
|
|
208
|
-
]),
|
|
209
|
-
r(L, {
|
|
210
|
-
variant: "primary",
|
|
211
|
-
label: "Create point program",
|
|
212
|
-
disabled: !o(h).isPremium,
|
|
213
|
-
icon: "add",
|
|
214
|
-
onClick: t[5] || (t[5] = (n) => y())
|
|
215
|
-
}, null, 8, ["disabled"])
|
|
216
|
-
]),
|
|
217
|
-
_: 1
|
|
218
|
-
})),
|
|
219
|
-
r(oe, {
|
|
220
|
-
ref_key: "sheetRef",
|
|
221
|
-
ref: v,
|
|
222
|
-
"onSubmit:modelValue": O
|
|
223
|
-
}, null, 512)
|
|
224
|
-
])
|
|
225
|
-
], 64);
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
export {
|
|
230
|
-
Ke as default
|
|
231
|
-
};
|
|
@@ -1,363 +0,0 @@
|
|
|
1
|
-
import { defineComponent as K, ref as v, resolveComponent as u, openBlock as f, createBlock as x, unref as a, isRef as Z, withCtx as S, createElementVNode as l, createVNode as i, computed as ee, h as oe, onMounted as te, createElementBlock as T, Fragment as V, renderList as ne, resolveDynamicComponent as ae, toDisplayString as g } from "vue";
|
|
2
|
-
import { _ as se } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { useDialog as re, components as le } from "@feedmepos/ui-library";
|
|
4
|
-
import { c as M, p as $ } from "./plugins-DDAJav2s.js";
|
|
5
|
-
import { u as ie } from "./loading-BWGIK17X.js";
|
|
6
|
-
import { u as ce } from "./business-y5qSMcd-.js";
|
|
7
|
-
import { c as h, u as me } from "./campaign-DHgol2Lt.js";
|
|
8
|
-
import { u as ue } from "./vue-i18n-cyOhW8mW.js";
|
|
9
|
-
import { g as D, a as de, b as N } from "./campaign-Drxe0zPX.js";
|
|
10
|
-
import { e as j } from "./effect-D5ZWGpNS.js";
|
|
11
|
-
import { _ as pe } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-t6eac8yR.js";
|
|
12
|
-
import { u as fe } from "./template-CAs0lkTY.js";
|
|
13
|
-
import { _ as q } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
|
|
14
|
-
const ye = { class: "space-y-8" }, ge = /* @__PURE__ */ K({
|
|
15
|
-
__name: "QueueSheet",
|
|
16
|
-
emits: ["update:model-value"],
|
|
17
|
-
setup(U, { expose: t, emit: L }) {
|
|
18
|
-
const p = v(!1), _ = v([]);
|
|
19
|
-
async function k() {
|
|
20
|
-
p.value = !0;
|
|
21
|
-
const r = await h.getPromotionQueue();
|
|
22
|
-
console.log(r, "jobs"), _.value = r;
|
|
23
|
-
}
|
|
24
|
-
const w = [
|
|
25
|
-
{
|
|
26
|
-
header: "Started At",
|
|
27
|
-
accessorFn: (r) => r.createdAt,
|
|
28
|
-
enableSorting: !0
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
header: "Campaigns",
|
|
32
|
-
accessorFn: (r) => r.campaigns
|
|
33
|
-
// cell(props) {
|
|
34
|
-
// const r = props.row.original;
|
|
35
|
-
// return h('div', {
|
|
36
|
-
// innerHTML: r.campaigns.map((c: any) => c.name).join(', '),
|
|
37
|
-
// });
|
|
38
|
-
// },
|
|
39
|
-
}
|
|
40
|
-
];
|
|
41
|
-
return t({
|
|
42
|
-
showSheet: k
|
|
43
|
-
}), (r, m) => {
|
|
44
|
-
const b = u("FmTable"), P = u("FmSideSheet");
|
|
45
|
-
return f(), x(P, {
|
|
46
|
-
"max-width": 550,
|
|
47
|
-
header: "Promotion Sync Queue",
|
|
48
|
-
modelValue: a(p),
|
|
49
|
-
"onUpdate:modelValue": [
|
|
50
|
-
m[1] || (m[1] = (s) => Z(p) ? p.value = s : null),
|
|
51
|
-
m[2] || (m[2] = (s) => p.value = s)
|
|
52
|
-
]
|
|
53
|
-
}, {
|
|
54
|
-
default: S(() => [
|
|
55
|
-
l("div", ye, [
|
|
56
|
-
m[3] || (m[3] = l("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)),
|
|
57
|
-
i(b, {
|
|
58
|
-
modelValue: r.tableRef,
|
|
59
|
-
"onUpdate:modelValue": m[0] || (m[0] = (s) => r.tableRef = s),
|
|
60
|
-
"column-filter": r.jobFilters,
|
|
61
|
-
"column-defs": w,
|
|
62
|
-
"row-data": a(_),
|
|
63
|
-
"hide-footer": a(_).length <= 10
|
|
64
|
-
}, null, 8, ["modelValue", "column-filter", "row-data", "hide-footer"])
|
|
65
|
-
])
|
|
66
|
-
]),
|
|
67
|
-
_: 1
|
|
68
|
-
}, 8, ["modelValue"]);
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
}), he = { class: "px-24 flex flex-col gap-y-16" }, _e = { class: "flex items-center justify-between w-full" }, be = { class: "flex gap-8 overflow-x-auto" }, ve = { class: "space-y-8" }, we = { class: "flex w-full gap-4 items-center" }, Ce = { class: "space-y-4" }, Fe = { class: "fm-typo-en-body-lg-600" }, xe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Se = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ke = { class: "flex flex-col gap-16 text-center" }, Pe = { class: "fm-typo-en-title-sm-800" }, Te = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ke = /* @__PURE__ */ K({
|
|
72
|
-
__name: "Promotion",
|
|
73
|
-
setup(U) {
|
|
74
|
-
const { t } = ue(), L = {
|
|
75
|
-
label: t("connect.promotion.createCampaign"),
|
|
76
|
-
value: "create",
|
|
77
|
-
isPrimary: !0,
|
|
78
|
-
prependIcon: "add"
|
|
79
|
-
}, p = {
|
|
80
|
-
label: "Force sync",
|
|
81
|
-
value: "sync",
|
|
82
|
-
isPrimary: !1,
|
|
83
|
-
prependIcon: "refresh"
|
|
84
|
-
}, _ = {
|
|
85
|
-
label: "Queue",
|
|
86
|
-
value: "queue",
|
|
87
|
-
isPrimary: !1,
|
|
88
|
-
prependIcon: "work_history"
|
|
89
|
-
}, k = fe("PROMOTION", re()), w = ce(), r = me(), { global: m, minor: b } = ie, P = [
|
|
90
|
-
{
|
|
91
|
-
label: "Bill promotion",
|
|
92
|
-
value: "BILL"
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
label: "Item promotion",
|
|
96
|
-
value: "ITEM"
|
|
97
|
-
}
|
|
98
|
-
], s = v({
|
|
99
|
-
searchKey: "",
|
|
100
|
-
location: [],
|
|
101
|
-
effectType: []
|
|
102
|
-
});
|
|
103
|
-
function E(e) {
|
|
104
|
-
const o = s.value.location;
|
|
105
|
-
return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some((d) => {
|
|
106
|
-
var c;
|
|
107
|
-
return (c = e == null ? void 0 : e.targetLocation) == null ? void 0 : c.includes(d);
|
|
108
|
-
}) : e.targetLocation.includes(o);
|
|
109
|
-
}
|
|
110
|
-
function Q(e) {
|
|
111
|
-
var c, F;
|
|
112
|
-
const o = s.value.effectType;
|
|
113
|
-
if (!o || o.length === 0) return !0;
|
|
114
|
-
const d = (F = (c = e.effect) == null ? void 0 : c.options) == null ? void 0 : F.target;
|
|
115
|
-
return o.includes(d);
|
|
116
|
-
}
|
|
117
|
-
const y = ee(
|
|
118
|
-
() => r.campaigns.promotion.filter(
|
|
119
|
-
(e) => E(e) && Q(e)
|
|
120
|
-
)
|
|
121
|
-
), H = [
|
|
122
|
-
{
|
|
123
|
-
header: t("connect.promotion.promotionTitle"),
|
|
124
|
-
accessorFn: (e) => e.name
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
header: t("connect.promotion.campaignDate"),
|
|
128
|
-
accessorFn: (e) => D(e)
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
header: t("connect.promotion.status"),
|
|
132
|
-
accessorFn: (e) => de(e),
|
|
133
|
-
cell(e) {
|
|
134
|
-
return N(e.row.original);
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
header: t("connect.promotion.type"),
|
|
139
|
-
accessorFn: (e) => `${M.title(e.effect.options.target)} promotion`
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
header: t("connect.promotion.summary"),
|
|
143
|
-
accessorFn: (e) => j(e.effect)
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
header: t("connect.promotion.actions"),
|
|
147
|
-
cell(e) {
|
|
148
|
-
return oe(le.FmButton, {
|
|
149
|
-
variant: "tertiary",
|
|
150
|
-
icon: "delete",
|
|
151
|
-
iconColor: "neutral-gray-400",
|
|
152
|
-
onClick: (o) => {
|
|
153
|
-
o.stopPropagation(), R(e.row.original);
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
], O = v(), I = v();
|
|
159
|
-
async function R(e) {
|
|
160
|
-
await $.remove(
|
|
161
|
-
t("connect.promotion.confirmRemove", { name: e.name })
|
|
162
|
-
) && await b(
|
|
163
|
-
async () => {
|
|
164
|
-
await h.delete(e._id), await r.read("PROMOTION");
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
message: t("connect.promotion.removing", { name: e.name }),
|
|
168
|
-
successMessage: t("connect.promotion.removedSuccessfully", {
|
|
169
|
-
name: e.name
|
|
170
|
-
})
|
|
171
|
-
}
|
|
172
|
-
);
|
|
173
|
-
}
|
|
174
|
-
async function C(e) {
|
|
175
|
-
e ? await o() : k.open(async (d) => {
|
|
176
|
-
await o(d);
|
|
177
|
-
});
|
|
178
|
-
async function o(d) {
|
|
179
|
-
var c;
|
|
180
|
-
(c = O.value) == null || c.showSheet(
|
|
181
|
-
!0,
|
|
182
|
-
"PROMOTION",
|
|
183
|
-
e ? await h.readById(e._id) : void 0,
|
|
184
|
-
d
|
|
185
|
-
);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
async function z(e) {
|
|
189
|
-
await b(
|
|
190
|
-
async () => {
|
|
191
|
-
e.campaign._id ? await h.update(e.campaign._id, e) : await h.create(e), await r.read("PROMOTION");
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
message: t(
|
|
195
|
-
e.campaign._id ? "connect.promotion.updating" : "connect.promotion.creating"
|
|
196
|
-
),
|
|
197
|
-
successMessage: t(
|
|
198
|
-
e.campaign._id ? "connect.promotion.updatedSuccessfully" : "connect.promotion.createdSuccessfully"
|
|
199
|
-
)
|
|
200
|
-
}
|
|
201
|
-
);
|
|
202
|
-
}
|
|
203
|
-
async function G(e) {
|
|
204
|
-
var o;
|
|
205
|
-
switch (e) {
|
|
206
|
-
case "create":
|
|
207
|
-
C();
|
|
208
|
-
break;
|
|
209
|
-
case "sync":
|
|
210
|
-
await $.confirm(
|
|
211
|
-
"Are you sure you want to synchronize all promotions to POS?",
|
|
212
|
-
"Force sync"
|
|
213
|
-
) && b(
|
|
214
|
-
async () => {
|
|
215
|
-
await h.syncAllPromotion();
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
message: "Syncing promotions...",
|
|
219
|
-
successMessage: "All promotions synced"
|
|
220
|
-
}
|
|
221
|
-
);
|
|
222
|
-
break;
|
|
223
|
-
case "queue":
|
|
224
|
-
(o = I.value) == null || o.showSheet();
|
|
225
|
-
break;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
return te(async () => {
|
|
229
|
-
await m(async () => {
|
|
230
|
-
await w.readLocations(), await r.read("PROMOTION");
|
|
231
|
-
});
|
|
232
|
-
}), (e, o) => {
|
|
233
|
-
const d = u("FmPageHead"), c = u("FmSearch"), F = u("FmTable"), J = u("FmChip"), B = u("FmButton"), W = u("FmListItem"), X = u("FmList"), Y = u("FmCard");
|
|
234
|
-
return f(), T(V, null, [
|
|
235
|
-
i(d, {
|
|
236
|
-
title: a(t)("connect.promotion.title"),
|
|
237
|
-
actions: a(y).length > 0 ? [L, p, _] : [],
|
|
238
|
-
"onClick:action": G
|
|
239
|
-
}, null, 8, ["title", "actions"]),
|
|
240
|
-
l("div", he, [
|
|
241
|
-
i(c, {
|
|
242
|
-
modelValue: s.value.searchKey,
|
|
243
|
-
"onUpdate:modelValue": o[0] || (o[0] = (n) => s.value.searchKey = n),
|
|
244
|
-
class: "hidden xs:!block border-b-2 border-fm-color-neutral-gray-100",
|
|
245
|
-
placeholder: a(t)("connect.promotion.search"),
|
|
246
|
-
collapsible: ""
|
|
247
|
-
}, null, 8, ["modelValue", "placeholder"]),
|
|
248
|
-
a(y) && a(y).length > 0 ? (f(), T(V, { key: 0 }, [
|
|
249
|
-
l("div", _e, [
|
|
250
|
-
l("div", be, [
|
|
251
|
-
i(q, {
|
|
252
|
-
label: `${a(t)("connect.common.location")}: `,
|
|
253
|
-
"right-icon": "keyboard_arrow_down",
|
|
254
|
-
modelValue: s.value.location,
|
|
255
|
-
"onUpdate:modelValue": o[1] || (o[1] = (n) => s.value.location = n),
|
|
256
|
-
icon: "storefront",
|
|
257
|
-
"show-item-label": !0,
|
|
258
|
-
items: a(w).locationOptions
|
|
259
|
-
}, null, 8, ["label", "modelValue", "items"]),
|
|
260
|
-
i(q, {
|
|
261
|
-
label: "Type:",
|
|
262
|
-
"right-icon": "keyboard_arrow_down",
|
|
263
|
-
modelValue: s.value.effectType,
|
|
264
|
-
"onUpdate:modelValue": o[2] || (o[2] = (n) => s.value.effectType = n),
|
|
265
|
-
icon: "filter_list",
|
|
266
|
-
"show-item-label": !0,
|
|
267
|
-
items: P
|
|
268
|
-
}, null, 8, ["modelValue"])
|
|
269
|
-
]),
|
|
270
|
-
i(c, {
|
|
271
|
-
modelValue: s.value.searchKey,
|
|
272
|
-
"onUpdate:modelValue": o[3] || (o[3] = (n) => s.value.searchKey = n),
|
|
273
|
-
class: "xs:hidden",
|
|
274
|
-
placeholder: "search",
|
|
275
|
-
collapsible: ""
|
|
276
|
-
}, null, 8, ["modelValue"])
|
|
277
|
-
]),
|
|
278
|
-
i(F, {
|
|
279
|
-
class: "xs:hidden",
|
|
280
|
-
"row-data": a(y),
|
|
281
|
-
"column-defs": H,
|
|
282
|
-
"search-value": s.value.searchKey,
|
|
283
|
-
"column-filter": [],
|
|
284
|
-
onRowClick: o[4] || (o[4] = (n) => C(n.original)),
|
|
285
|
-
"hide-footer": a(y).length < 10
|
|
286
|
-
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
287
|
-
i(X, { class: "hidden xs:!flex flex-col mx-[-24px]" }, {
|
|
288
|
-
default: S(() => [
|
|
289
|
-
(f(!0), T(V, null, ne(a(y).filter(
|
|
290
|
-
(n) => n.name.toLowerCase().includes(s.value.searchKey.toLowerCase())
|
|
291
|
-
), (n) => (f(), x(W, {
|
|
292
|
-
key: n._id.toString(),
|
|
293
|
-
onClick: (A) => C(n),
|
|
294
|
-
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
295
|
-
}, {
|
|
296
|
-
default: S(() => [
|
|
297
|
-
l("div", ve, [
|
|
298
|
-
l("div", we, [
|
|
299
|
-
(f(), x(ae(a(N)(n)))),
|
|
300
|
-
i(J, {
|
|
301
|
-
class: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
|
|
302
|
-
compact: !0,
|
|
303
|
-
label: `${a(M).title(n.effect.options.target)} promotion`
|
|
304
|
-
}, null, 8, ["label"])
|
|
305
|
-
]),
|
|
306
|
-
l("div", Ce, [
|
|
307
|
-
l("div", Fe, g(n.name), 1),
|
|
308
|
-
l("div", xe, g(a(j)(n.effect)), 1),
|
|
309
|
-
l("div", Se, g(a(t)("connect.promotion.campaignDate")) + ": " + g(a(D)(n)), 1)
|
|
310
|
-
])
|
|
311
|
-
]),
|
|
312
|
-
i(B, {
|
|
313
|
-
icon: "delete",
|
|
314
|
-
"icon-color": "neutral-gray-400",
|
|
315
|
-
variant: "tertiary",
|
|
316
|
-
onClick: (A) => (A.stopPropagation(), R(n))
|
|
317
|
-
}, null, 8, ["onClick"])
|
|
318
|
-
]),
|
|
319
|
-
_: 2
|
|
320
|
-
}, 1032, ["onClick"]))), 128))
|
|
321
|
-
]),
|
|
322
|
-
_: 1
|
|
323
|
-
})
|
|
324
|
-
], 64)) : (f(), x(Y, {
|
|
325
|
-
key: 1,
|
|
326
|
-
variant: "outlined",
|
|
327
|
-
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
328
|
-
}, {
|
|
329
|
-
default: S(() => [
|
|
330
|
-
o[6] || (o[6] = l("img", {
|
|
331
|
-
src: se,
|
|
332
|
-
class: "aspect-square w-[150px]"
|
|
333
|
-
}, null, -1)),
|
|
334
|
-
l("div", ke, [
|
|
335
|
-
l("div", Pe, g(a(t)("connect.promotion.createPromotionCampaign")), 1),
|
|
336
|
-
l("div", Te, g(a(t)("connect.promotion.description")), 1)
|
|
337
|
-
]),
|
|
338
|
-
i(B, {
|
|
339
|
-
variant: "primary",
|
|
340
|
-
label: a(t)("connect.promotion.createPromotionCampaign"),
|
|
341
|
-
icon: "add",
|
|
342
|
-
onClick: o[5] || (o[5] = (n) => C())
|
|
343
|
-
}, null, 8, ["label"])
|
|
344
|
-
]),
|
|
345
|
-
_: 1
|
|
346
|
-
}))
|
|
347
|
-
]),
|
|
348
|
-
i(pe, {
|
|
349
|
-
ref_key: "sheetRef",
|
|
350
|
-
ref: O,
|
|
351
|
-
"onSubmit:modelValue": z
|
|
352
|
-
}, null, 512),
|
|
353
|
-
i(ge, {
|
|
354
|
-
ref_key: "queueSheetRef",
|
|
355
|
-
ref: I
|
|
356
|
-
}, null, 512)
|
|
357
|
-
], 64);
|
|
358
|
-
};
|
|
359
|
-
}
|
|
360
|
-
});
|
|
361
|
-
export {
|
|
362
|
-
Ke as default
|
|
363
|
-
};
|