@feedmepos/mf-connect 0.1.0-beta.9 → 0.1.1-prod
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Analytic-C2etD-eu.js +620 -0
- package/dist/{App-DQUbRsdA.js → App-DlRvkDpN.js} +58 -59
- package/dist/Broadcast-DpCGUS6r.js +216 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D-BFllvG.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cj4IcH5D.js} +20 -20
- package/dist/Card-DjGC6jmq.js +823 -0
- package/dist/Collections-Q2pYWnJF.js +440 -0
- package/dist/Credit-DOIq2VYW.js +214 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C_ZKNWzb.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-D7ML8ePp.js} +1010 -1026
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CyxWG5I7.js +344 -0
- package/dist/Experience-DUst4I0H.js +211 -0
- package/dist/Game-CXnQR-wV.js +250 -0
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +144 -0
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → MainLayout-DpZC6o3R.js} +53 -19
- package/dist/Marketing-CZfHsMFC.js +309 -0
- package/dist/Member-CX5Ohgeg.js +92 -0
- package/dist/MemberList-D8I3SaAs.js +1040 -0
- package/dist/MemberOverview-C2n9oJZh.js +58 -0
- package/dist/{MemberTransactions-zSxSnUkK.js → MemberTransactions-DfZNbCHD.js} +1 -1
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-BxFVEoBX.js +203 -0
- package/dist/Mission-S1pwDbqp.js +248 -0
- package/dist/Point-BdLUcGZy.js +220 -0
- package/dist/Promotion-DWAeQGkU.js +244 -0
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CTKKhH-r.js → RuleGroup.vue_vue_type_script_setup_true_lang-Dux_NMO5.js} +577 -568
- package/dist/Segment-CXSE8Bzf.js +560 -0
- package/dist/Setting-CLuXuEId.js +1870 -0
- package/dist/Store-Be3cui0S.js +1533 -0
- package/dist/StoreRewards-zFy_w8p4.js +429 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-2Jqj_rKv.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DxGJKgbc.js} +10 -10
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BkdSj0cX.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-Dreo45H1.js} +1 -1
- package/dist/{Tier-Cpl0FV8L.js → Tier-ChzcISYF.js} +453 -481
- package/dist/{Title-CbMDd1Et.js → Title-DQSjhBkT.js} +295 -314
- package/dist/Transaction-CeWmWpN_.js +36 -0
- package/dist/Voucher-BkLIxiZN.js +485 -0
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +140 -0
- package/dist/app-CLNirPsB.js +2974 -0
- package/dist/{app-VxaUCtgl.js → app-DuNsy0aC.js} +1 -1
- package/dist/app.js +3 -5
- package/dist/{business-DR7jpnLz.js → business-COGiTmLD.js} +1 -1
- package/dist/{campaign-MqcTb329.js → campaign-BHZMjQi5.js} +3 -5
- package/dist/{collection.fn-CvEoe61K.js → collection.fn-sAxtYO_r.js} +2 -2
- package/dist/dto-ndeeV_nc.js +1145 -0
- package/dist/{effect-BjjQeiQg.js → effect-BQt0rkdT.js} +9 -9
- package/dist/email-addresses-B3PazwKs.js +705 -0
- package/dist/{export-B8cvWh5n.js → export-D6r-xNji.js} +3 -3
- package/dist/{helper-DfgVNY7B.js → helper-CrjQw_Et.js} +1 -1
- package/dist/{index-CWR3qYjb.js → index-Btlj28Vg.js} +1 -1
- package/dist/{index-C7zMfUgy.js → index-Buy-yvAZ.js} +319 -304
- package/dist/{index-0UYoh1-7.js → index-C3AAy__p.js} +1 -1
- package/dist/index-CHAaFSD2.js +11 -0
- package/dist/{index-Dap5R3vr.js → index-Cg3RFxc9.js} +91 -102
- package/dist/{index-2P9w5u3m.js → index-CqpEhMr6.js} +4 -4
- package/dist/{index-BsfWRB8R.js → index-CvHj-wYi.js} +1 -1
- package/dist/index-DGLmbBnE.js +28997 -0
- package/dist/{index-CJ8Uh2Ja.js → index-DXpd07G3.js} +3 -3
- package/dist/{index-B5NufbUt.js → index-Daax_BQa.js} +1 -1
- package/dist/{index-C2JNcGc-.js → index-DrLEuIe1.js} +281 -299
- package/dist/{index-DBy30v8N.js → index-tSEYvA-2.js} +3 -3
- package/dist/{index.esm2017-D1X3PgpO.js → index.esm2017-a5BlZ76G.js} +55 -55
- package/dist/{loading-CJ3nOovJ.js → loading-B3XGyQ8W.js} +460 -469
- package/dist/{membership-B1cmSRyk.js → membership-GIOJ1ptN.js} +3 -3
- package/dist/money-z7VwzhZP.js +15 -0
- package/dist/number-DHYb2ua_.js +12 -0
- package/dist/{rule-builder-CSmOONdb.js → rule-builder-CcsWd5r9.js} +1 -1
- package/dist/{rule-ChWyR-0j.js → rule-iIEblTE4.js} +179 -177
- package/dist/style.css +1 -1
- package/dist/{template-Cug7aRK0.js → template-DMRMDZOW.js} +63 -63
- package/dist/{xlsx-CfgPFFvp.js → usePagination-CNFe0T2B.js} +3176 -2955
- package/package.json +5 -8
- package/dist/Analytic-CMXUjK_F.js +0 -622
- package/dist/Broadcast-DowFtHv6.js +0 -223
- package/dist/Card-C7rhL0pV.js +0 -825
- package/dist/Collections-B-1wlk3r.js +0 -453
- package/dist/Credit-DDjozmoF.js +0 -220
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-pwMuIgs5.js +0 -345
- package/dist/Experience-BbE-c1Op.js +0 -221
- package/dist/Game-DQdRpaN-.js +0 -255
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +0 -144
- package/dist/MainLayout-B1aJoR95.js +0 -41
- package/dist/Marketing-Dgmxzg4h.js +0 -316
- package/dist/Member-w23oRVwN.js +0 -69
- package/dist/MemberList-BLIdjznQ.js +0 -1735
- package/dist/MemberOverview-wL_ailso.js +0 -58
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Dy_lMdZA.js +0 -432
- package/dist/Mission-Cjt0E083.js +0 -261
- package/dist/Point-CQJL3Ewu.js +0 -222
- package/dist/Promotion-BYViH3bu.js +0 -247
- package/dist/Segment-B9Jj1ak0.js +0 -437
- package/dist/Setting-DXWbgRxs.js +0 -1901
- package/dist/Store-Dswk2e_z.js +0 -1511
- package/dist/StoreRewards-CNUhG_Ue.js +0 -401
- package/dist/Transaction-BB-kk-84.js +0 -39
- package/dist/Voucher-b1_Jlm6X.js +0 -490
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-pG-SrXp9.js +0 -56
- package/dist/app-DCHKJoql.js +0 -5639
- package/dist/dto-jcK3TGB7.js +0 -2770
- package/dist/index-Cv7pLAYq.js +0 -3
- package/dist/index-LrSSauN2.js +0 -29193
- package/dist/money-BEATdGS6.js +0 -15
- package/dist/number-CeAYAKCp.js +0 -12
- package/dist/usePagination-BeF5K3M7.js +0 -223
- package/dist/vue-i18n-BRhKDHdF.js +0 -2365
- package/dist/zod-Bg2FbC-D.js +0 -90
package/dist/Mission-Cjt0E083.js
DELETED
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
import { defineComponent as $, ref as V, computed as E, h as m, onMounted as A, resolveComponent as r, openBlock as d, createElementBlock as h, Fragment as b, createVNode as c, unref as t, createElementVNode as s, withCtx as w, renderList as H, createBlock as x, resolveDynamicComponent as q, toDisplayString as p } from "vue";
|
|
2
|
-
import { _ as z } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { useDialog as G, components as v } from "@feedmepos/ui-library";
|
|
4
|
-
import { a as J, p as Q, u as W } from "./loading-CJ3nOovJ.js";
|
|
5
|
-
import { u as X } from "./business-DR7jpnLz.js";
|
|
6
|
-
import { u as Y } from "./campaign-MqcTb329.js";
|
|
7
|
-
import { g as L, b as M } from "./dto-jcK3TGB7.js";
|
|
8
|
-
import { _ as Z } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
9
|
-
import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-C_ZKNWzb.js";
|
|
10
|
-
import { u as oe } from "./template-Cug7aRK0.js";
|
|
11
|
-
import { s as te } from "./index-CuvNtC_M.js";
|
|
12
|
-
import { u as ne } from "./vue-i18n-BRhKDHdF.js";
|
|
13
|
-
import { c as _ } from "./index-CWR3qYjb.js";
|
|
14
|
-
const ae = { class: "px-24 flex flex-col gap-y-16" }, se = { class: "flex items-center justify-between w-full" }, ie = { class: "flex gap-8 overflow-x-auto" }, ce = { class: "space-y-8" }, re = { class: "flex w-full gap-4 items-center" }, le = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, me = { class: "space-y-4" }, de = { class: "fm-typo-en-body-lg-600" }, pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { class: "flex flex-col gap-16 text-center" }, ge = { class: "fm-typo-en-title-sm-800" }, ye = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Be = /* @__PURE__ */ $({
|
|
15
|
-
__name: "Mission",
|
|
16
|
-
setup(_e) {
|
|
17
|
-
const { t: n } = ne(), B = {
|
|
18
|
-
label: n("connect.program.common.actions.create", {
|
|
19
|
-
type: n("connect.program.mission.title").toLowerCase()
|
|
20
|
-
}),
|
|
21
|
-
value: "create",
|
|
22
|
-
isPrimary: !0,
|
|
23
|
-
prependIcon: "add"
|
|
24
|
-
}, K = oe("MISSION", G()), N = X(), l = Y(), { global: P, minor: C } = W, i = V({
|
|
25
|
-
searchKey: "",
|
|
26
|
-
location: null
|
|
27
|
-
}), u = E(
|
|
28
|
-
() => l.campaigns.mission.filter(
|
|
29
|
-
(e) => !i.value.location || !e.targetLocation || e.targetLocation.includes(i.value.location)
|
|
30
|
-
)
|
|
31
|
-
), R = [
|
|
32
|
-
{
|
|
33
|
-
header: n("connect.program.common.table.title"),
|
|
34
|
-
accessorKey: "name",
|
|
35
|
-
// accessorFn: (v) => v.name,
|
|
36
|
-
cell(e) {
|
|
37
|
-
return m("div", { class: "flex items-center justify-between gap-4" }, [
|
|
38
|
-
m("div", { class: "flex items-center" }, [
|
|
39
|
-
m(
|
|
40
|
-
v.FmTooltip,
|
|
41
|
-
{
|
|
42
|
-
content: e.row.original._id,
|
|
43
|
-
onClick: (o) => {
|
|
44
|
-
o.stopPropagation(), J(e.row.original._id);
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
[
|
|
48
|
-
m(v.FmIcon, {
|
|
49
|
-
name: "info",
|
|
50
|
-
outline: !0,
|
|
51
|
-
size: "sm"
|
|
52
|
-
})
|
|
53
|
-
]
|
|
54
|
-
)
|
|
55
|
-
]),
|
|
56
|
-
m("div", { class: "flex-1" }, e.row.original.name)
|
|
57
|
-
]);
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
header: n("connect.campaign.mission.type"),
|
|
62
|
-
accessorFn: (e) => te(e.mission.type)
|
|
63
|
-
//v.effect,
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
header: n("connect.program.common.table.status"),
|
|
67
|
-
cell(e) {
|
|
68
|
-
return L(e.row.original);
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
header: n("connect.program.common.table.summary"),
|
|
73
|
-
accessorFn: (e) => M(e)
|
|
74
|
-
//v.effect,
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
header: n("connect.campaign.mission.received"),
|
|
78
|
-
accessorFn: (e) => {
|
|
79
|
-
var o;
|
|
80
|
-
return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
header: n("connect.program.common.table.actions"),
|
|
85
|
-
cell(e) {
|
|
86
|
-
return m(v.FmButton, {
|
|
87
|
-
variant: "tertiary",
|
|
88
|
-
icon: "delete",
|
|
89
|
-
iconColor: "neutral-gray-400",
|
|
90
|
-
onClick: (o) => {
|
|
91
|
-
o.stopPropagation(), F(e.row.original);
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
], S = V();
|
|
97
|
-
async function F(e) {
|
|
98
|
-
await Q.remove(
|
|
99
|
-
n("connect.program.common.remove.confirm", { name: e.name })
|
|
100
|
-
) && await C(
|
|
101
|
-
async () => {
|
|
102
|
-
await _.delete(e._id), await l.read("MISSION");
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
message: n("connect.program.common.remove.removing", { name: e.name }),
|
|
106
|
-
successMessage: n("connect.program.common.remove.removed", {
|
|
107
|
-
name: e.name
|
|
108
|
-
})
|
|
109
|
-
}
|
|
110
|
-
);
|
|
111
|
-
}
|
|
112
|
-
async function y(e) {
|
|
113
|
-
e ? await o() : K.open(async (f) => {
|
|
114
|
-
await o(f);
|
|
115
|
-
});
|
|
116
|
-
async function o(f) {
|
|
117
|
-
var g;
|
|
118
|
-
(g = S.value) == null || g.showSheet(
|
|
119
|
-
!0,
|
|
120
|
-
"MISSION",
|
|
121
|
-
e ? await _.readById(e._id) : void 0,
|
|
122
|
-
f
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
async function T(e) {
|
|
127
|
-
await C(
|
|
128
|
-
async () => {
|
|
129
|
-
e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await l.read("MISSION");
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
message: n(
|
|
133
|
-
e.campaign._id ? "connect.program.common.update.updating" : "connect.program.common.update.creating",
|
|
134
|
-
{ type: "Mission" }
|
|
135
|
-
),
|
|
136
|
-
successMessage: n("connect.program.common.update.success", {
|
|
137
|
-
type: "Mission",
|
|
138
|
-
action: e.campaign._id ? "updated" : "created"
|
|
139
|
-
})
|
|
140
|
-
}
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
return A(async () => {
|
|
144
|
-
await P(async () => {
|
|
145
|
-
await l.read("MISSION"), console.log(u);
|
|
146
|
-
});
|
|
147
|
-
}), (e, o) => {
|
|
148
|
-
const f = r("FmPageHead"), g = r("FmSearch"), O = r("FmTable"), k = r("FmButton"), j = r("FmListItem"), D = r("FmList"), U = r("FmCard");
|
|
149
|
-
return d(), h(b, null, [
|
|
150
|
-
c(f, {
|
|
151
|
-
title: t(n)("connect.campaign.mission.title"),
|
|
152
|
-
actions: t(u).length > 0 ? [B] : [],
|
|
153
|
-
"onClick:action": o[0] || (o[0] = () => y())
|
|
154
|
-
}, null, 8, ["title", "actions"]),
|
|
155
|
-
s("div", ae, [
|
|
156
|
-
c(g, {
|
|
157
|
-
modelValue: t(i).searchKey,
|
|
158
|
-
"onUpdate:modelValue": o[1] || (o[1] = (a) => t(i).searchKey = a),
|
|
159
|
-
class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
|
|
160
|
-
placeholder: t(n)("connect.program.common.search"),
|
|
161
|
-
collapsible: ""
|
|
162
|
-
}, null, 8, ["modelValue", "placeholder"]),
|
|
163
|
-
t(l).campaigns.mission && t(l).campaigns.mission.length > 0 ? (d(), h(b, { key: 0 }, [
|
|
164
|
-
s("div", se, [
|
|
165
|
-
s("div", ie, [
|
|
166
|
-
c(Z, {
|
|
167
|
-
modelValue: t(i).location,
|
|
168
|
-
"onUpdate:modelValue": o[2] || (o[2] = (a) => t(i).location = a),
|
|
169
|
-
label: t(n)("connect.program.common.location"),
|
|
170
|
-
"show-item-label": !0,
|
|
171
|
-
icon: "storefront",
|
|
172
|
-
placement: "bottom-start",
|
|
173
|
-
items: t(N).locationItems
|
|
174
|
-
}, null, 8, ["modelValue", "label", "items"])
|
|
175
|
-
]),
|
|
176
|
-
c(g, {
|
|
177
|
-
modelValue: t(i).searchKey,
|
|
178
|
-
"onUpdate:modelValue": o[3] || (o[3] = (a) => t(i).searchKey = a),
|
|
179
|
-
class: "xs:hidden",
|
|
180
|
-
placeholder: "search",
|
|
181
|
-
collapsible: ""
|
|
182
|
-
}, null, 8, ["modelValue"])
|
|
183
|
-
]),
|
|
184
|
-
c(O, {
|
|
185
|
-
class: "xs:hidden",
|
|
186
|
-
"row-data": t(u),
|
|
187
|
-
"column-defs": R,
|
|
188
|
-
"search-value": t(i).searchKey,
|
|
189
|
-
"column-filter": [],
|
|
190
|
-
onRowClick: o[4] || (o[4] = (a) => y(a.original)),
|
|
191
|
-
"hide-footer": t(u).length < 10
|
|
192
|
-
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
193
|
-
c(D, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
|
|
194
|
-
default: w(() => [
|
|
195
|
-
(d(!0), h(b, null, H(t(u).filter(
|
|
196
|
-
(a) => a.name.toLowerCase().includes(t(i).searchKey.toLowerCase())
|
|
197
|
-
), (a) => (d(), x(j, {
|
|
198
|
-
key: a._id.toString(),
|
|
199
|
-
onClick: (I) => y(a),
|
|
200
|
-
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
201
|
-
}, {
|
|
202
|
-
default: w(() => [
|
|
203
|
-
s("div", ce, [
|
|
204
|
-
s("div", re, [
|
|
205
|
-
(d(), x(q(t(L)(a)))),
|
|
206
|
-
s("div", le, p(a.currentReceive ?? 0) + " used ", 1)
|
|
207
|
-
]),
|
|
208
|
-
s("div", me, [
|
|
209
|
-
s("div", de, p(a.name), 1),
|
|
210
|
-
s("div", pe, p(t(M)(a)), 1)
|
|
211
|
-
]),
|
|
212
|
-
s("div", ue, " Token received: " + p(a.currentReceive ?? 0), 1)
|
|
213
|
-
]),
|
|
214
|
-
c(k, {
|
|
215
|
-
icon: "delete",
|
|
216
|
-
"icon-color": "neutral-gray-400",
|
|
217
|
-
variant: "tertiary",
|
|
218
|
-
onClick: (I) => (I.stopPropagation(), F(a))
|
|
219
|
-
}, null, 8, ["onClick"])
|
|
220
|
-
]),
|
|
221
|
-
_: 2
|
|
222
|
-
}, 1032, ["onClick"]))), 128))
|
|
223
|
-
]),
|
|
224
|
-
_: 1
|
|
225
|
-
})
|
|
226
|
-
], 64)) : (d(), x(U, {
|
|
227
|
-
key: 1,
|
|
228
|
-
variant: "outlined",
|
|
229
|
-
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
230
|
-
}, {
|
|
231
|
-
default: w(() => [
|
|
232
|
-
o[6] || (o[6] = s("img", {
|
|
233
|
-
src: z,
|
|
234
|
-
class: "aspect-square w-[150px]"
|
|
235
|
-
}, null, -1)),
|
|
236
|
-
s("div", fe, [
|
|
237
|
-
s("div", ge, p(t(n)("connect.campaign.mission.createProgram")), 1),
|
|
238
|
-
s("div", ye, p(t(n)("connect.campaign.mission.description")), 1)
|
|
239
|
-
]),
|
|
240
|
-
c(k, {
|
|
241
|
-
variant: "primary",
|
|
242
|
-
label: t(n)("connect.campaign.mission.create"),
|
|
243
|
-
icon: "add",
|
|
244
|
-
onClick: o[5] || (o[5] = (a) => y())
|
|
245
|
-
}, null, 8, ["label"])
|
|
246
|
-
]),
|
|
247
|
-
_: 1
|
|
248
|
-
})),
|
|
249
|
-
c(ee, {
|
|
250
|
-
ref_key: "sheetRef",
|
|
251
|
-
ref: S,
|
|
252
|
-
"onSubmit:modelValue": T
|
|
253
|
-
}, null, 512)
|
|
254
|
-
])
|
|
255
|
-
], 64);
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
});
|
|
259
|
-
export {
|
|
260
|
-
Be as default
|
|
261
|
-
};
|
package/dist/Point-CQJL3Ewu.js
DELETED
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
import { defineComponent as j, ref as V, computed as A, h as E, onMounted as M, resolveComponent as l, openBlock as d, createElementBlock as h, Fragment as b, createVNode as r, unref as t, withCtx as g, createElementVNode as n, toDisplayString as c, renderList as H, createBlock as w, resolveDynamicComponent as q } from "vue";
|
|
2
|
-
import { _ as z } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { useDialog as G, components as J } from "@feedmepos/ui-library";
|
|
4
|
-
import { p as Q, u as W } from "./loading-CJ3nOovJ.js";
|
|
5
|
-
import { u as X } from "./business-DR7jpnLz.js";
|
|
6
|
-
import { u as Y } from "./campaign-MqcTb329.js";
|
|
7
|
-
import { g as I, b as P } from "./dto-jcK3TGB7.js";
|
|
8
|
-
import { _ as Z } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
9
|
-
import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-C_ZKNWzb.js";
|
|
10
|
-
import { u as te } from "./template-Cug7aRK0.js";
|
|
11
|
-
import { u as oe } from "./vue-i18n-BRhKDHdF.js";
|
|
12
|
-
import { c as _ } from "./index-CWR3qYjb.js";
|
|
13
|
-
const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, se = { class: "px-24 flex flex-col gap-y-16" }, ie = { class: "flex items-center justify-between w-full" }, re = { class: "flex gap-8 overflow-x-auto" }, le = { class: "space-y-8" }, ce = { class: "flex w-full gap-4 items-center" }, me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, de = { class: "space-y-4" }, pe = { class: "fm-typo-en-body-lg-600" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ye = { class: "flex flex-col gap-16 text-center" }, ge = { class: "fm-typo-en-title-sm-800" }, _e = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Be = /* @__PURE__ */ j({
|
|
14
|
-
__name: "Point",
|
|
15
|
-
setup(he) {
|
|
16
|
-
const { t: s } = oe(), B = {
|
|
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
|
-
}, $ = te("COIN", G()), x = X(), m = Y(), { global: K, minor: C } = W, i = V({
|
|
24
|
-
searchKey: "",
|
|
25
|
-
location: null
|
|
26
|
-
}), u = A(
|
|
27
|
-
() => m.campaigns.point.filter(
|
|
28
|
-
(e) => !i.value.location || !e.targetLocation || e.targetLocation.includes(i.value.location)
|
|
29
|
-
)
|
|
30
|
-
), N = [
|
|
31
|
-
{
|
|
32
|
-
header: s("connect.program.common.table.title"),
|
|
33
|
-
accessorFn: (e) => e.name
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
header: s("connect.program.common.table.status"),
|
|
37
|
-
cell(e) {
|
|
38
|
-
return I(e.row.original);
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
header: s("connect.program.common.table.summary"),
|
|
43
|
-
accessorFn: (e) => P(e)
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
header: s("connect.program.common.table.actions"),
|
|
47
|
-
cell(e) {
|
|
48
|
-
return E(J.FmButton, {
|
|
49
|
-
variant: "tertiary",
|
|
50
|
-
icon: "delete",
|
|
51
|
-
iconColor: "neutral-gray-400",
|
|
52
|
-
onClick: (o) => {
|
|
53
|
-
o.stopPropagation(), F(e.row.original);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
], v = V();
|
|
59
|
-
async function F(e) {
|
|
60
|
-
await Q.remove(`Are you sure you want to remove ${e.name}?`) && await C(
|
|
61
|
-
async () => {
|
|
62
|
-
await _.delete(e._id), await m.read("COIN");
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
message: `Removing ${e.name}`,
|
|
66
|
-
successMessage: `Removed ${e.name} successfully`
|
|
67
|
-
}
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
async function f(e) {
|
|
71
|
-
e ? await o() : $.open(async (p) => {
|
|
72
|
-
await o(p);
|
|
73
|
-
});
|
|
74
|
-
async function o(p) {
|
|
75
|
-
var y;
|
|
76
|
-
(y = v.value) == null || y.showSheet(
|
|
77
|
-
!0,
|
|
78
|
-
"COIN",
|
|
79
|
-
e ? await _.readById(e._id) : void 0,
|
|
80
|
-
p
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
async function R(e) {
|
|
85
|
-
await C(
|
|
86
|
-
async () => {
|
|
87
|
-
e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await m.read("COIN");
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
message: `${e.campaign._id ? "Updating" : "Creating"} point program`,
|
|
91
|
-
successMessage: `Point program ${e.campaign._id ? "updated" : "created"} successfully`
|
|
92
|
-
}
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
return M(async () => {
|
|
96
|
-
await K(async () => {
|
|
97
|
-
await m.read("COIN");
|
|
98
|
-
});
|
|
99
|
-
}), (e, o) => {
|
|
100
|
-
const p = l("FmPill"), y = l("FmPageHead"), k = l("FmSearch"), O = l("FmTable"), S = l("FmButton"), U = l("FmListItem"), D = l("FmList"), T = l("FmCard");
|
|
101
|
-
return d(), h(b, null, [
|
|
102
|
-
r(y, {
|
|
103
|
-
title: t(s)("connect.program.point.title"),
|
|
104
|
-
actions: t(u).length > 0 ? [B] : [],
|
|
105
|
-
"onClick:action": o[0] || (o[0] = () => f())
|
|
106
|
-
}, {
|
|
107
|
-
title: g(() => [
|
|
108
|
-
n("div", ae, [
|
|
109
|
-
n("span", ne, c(t(s)("connect.program.point.title")), 1),
|
|
110
|
-
r(p, { variant: "premium" })
|
|
111
|
-
])
|
|
112
|
-
]),
|
|
113
|
-
_: 1
|
|
114
|
-
}, 8, ["title", "actions"]),
|
|
115
|
-
n("div", se, [
|
|
116
|
-
r(k, {
|
|
117
|
-
modelValue: t(i).searchKey,
|
|
118
|
-
"onUpdate:modelValue": o[1] || (o[1] = (a) => t(i).searchKey = a),
|
|
119
|
-
class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
|
|
120
|
-
placeholder: "search",
|
|
121
|
-
collapsible: ""
|
|
122
|
-
}, null, 8, ["modelValue"]),
|
|
123
|
-
t(m).campaigns.point && t(m).campaigns.point.length > 0 ? (d(), h(b, { key: 0 }, [
|
|
124
|
-
n("div", ie, [
|
|
125
|
-
n("div", re, [
|
|
126
|
-
r(Z, {
|
|
127
|
-
modelValue: t(i).location,
|
|
128
|
-
"onUpdate:modelValue": o[2] || (o[2] = (a) => t(i).location = a),
|
|
129
|
-
label: "Location: ",
|
|
130
|
-
"show-item-label": !0,
|
|
131
|
-
icon: "storefront",
|
|
132
|
-
placement: "bottom-start",
|
|
133
|
-
items: t(x).locationItems
|
|
134
|
-
}, null, 8, ["modelValue", "items"])
|
|
135
|
-
]),
|
|
136
|
-
r(k, {
|
|
137
|
-
modelValue: t(i).searchKey,
|
|
138
|
-
"onUpdate:modelValue": o[3] || (o[3] = (a) => t(i).searchKey = a),
|
|
139
|
-
class: "xs:hidden",
|
|
140
|
-
placeholder: "search",
|
|
141
|
-
collapsible: ""
|
|
142
|
-
}, null, 8, ["modelValue"])
|
|
143
|
-
]),
|
|
144
|
-
r(O, {
|
|
145
|
-
class: "xs:hidden",
|
|
146
|
-
"row-data": t(u),
|
|
147
|
-
"column-defs": N,
|
|
148
|
-
"search-value": t(i).searchKey,
|
|
149
|
-
"column-filter": [],
|
|
150
|
-
onRowClick: o[4] || (o[4] = (a) => f(a.original)),
|
|
151
|
-
"hide-footer": t(u).length < 10
|
|
152
|
-
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
153
|
-
r(D, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
|
|
154
|
-
default: g(() => [
|
|
155
|
-
(d(!0), h(b, null, H(t(u).filter(
|
|
156
|
-
(a) => a.name.toLowerCase().includes(t(i).searchKey.toLowerCase())
|
|
157
|
-
), (a) => (d(), w(U, {
|
|
158
|
-
key: a._id.toString(),
|
|
159
|
-
onClick: (L) => f(a),
|
|
160
|
-
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
161
|
-
}, {
|
|
162
|
-
default: g(() => [
|
|
163
|
-
n("div", le, [
|
|
164
|
-
n("div", ce, [
|
|
165
|
-
(d(), w(q(t(I)(a)))),
|
|
166
|
-
n("div", me, c(t(s)("program.point.used", { count: a.currentReceive ?? 0 })), 1)
|
|
167
|
-
]),
|
|
168
|
-
n("div", de, [
|
|
169
|
-
n("div", pe, c(a.name), 1),
|
|
170
|
-
n("div", ue, c(t(P)(a)), 1)
|
|
171
|
-
]),
|
|
172
|
-
n("div", fe, " Point received: " + c(a.currentReceive ?? 0), 1)
|
|
173
|
-
]),
|
|
174
|
-
r(S, {
|
|
175
|
-
icon: "delete",
|
|
176
|
-
"icon-color": "neutral-gray-400",
|
|
177
|
-
variant: "tertiary",
|
|
178
|
-
onClick: (L) => (L.stopPropagation(), F(a))
|
|
179
|
-
}, null, 8, ["onClick"])
|
|
180
|
-
]),
|
|
181
|
-
_: 2
|
|
182
|
-
}, 1032, ["onClick"]))), 128))
|
|
183
|
-
]),
|
|
184
|
-
_: 1
|
|
185
|
-
})
|
|
186
|
-
], 64)) : (d(), w(T, {
|
|
187
|
-
key: 1,
|
|
188
|
-
variant: "outlined",
|
|
189
|
-
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
190
|
-
}, {
|
|
191
|
-
default: g(() => [
|
|
192
|
-
o[6] || (o[6] = n("img", {
|
|
193
|
-
src: z,
|
|
194
|
-
class: "aspect-square w-[150px]"
|
|
195
|
-
}, null, -1)),
|
|
196
|
-
n("div", ye, [
|
|
197
|
-
n("div", ge, c(t(s)("connect.program.point.empty_state.title")), 1),
|
|
198
|
-
n("div", _e, c(t(s)("connect.program.point.empty_state.description")), 1)
|
|
199
|
-
]),
|
|
200
|
-
r(S, {
|
|
201
|
-
variant: "primary",
|
|
202
|
-
label: "Create point program",
|
|
203
|
-
disabled: !t(x).isPremium,
|
|
204
|
-
icon: "add",
|
|
205
|
-
onClick: o[5] || (o[5] = (a) => f())
|
|
206
|
-
}, null, 8, ["disabled"])
|
|
207
|
-
]),
|
|
208
|
-
_: 1
|
|
209
|
-
})),
|
|
210
|
-
r(ee, {
|
|
211
|
-
ref_key: "sheetRef",
|
|
212
|
-
ref: v,
|
|
213
|
-
"onSubmit:modelValue": R
|
|
214
|
-
}, null, 512)
|
|
215
|
-
])
|
|
216
|
-
], 64);
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
export {
|
|
221
|
-
Be as default
|
|
222
|
-
};
|