@feedmepos/mf-connect 0.1.0-beta.5 → 0.1.0-beta.50
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-D-yp03jJ.js +427 -0
- package/dist/{App-C8Qfnkhz.js → App-CeQWTGNK.js} +441 -420
- package/dist/AuditLogs-2qzwcMXR.js +1885 -0
- package/dist/Bin-D1b2NbbA.js +191 -0
- package/dist/{Broadcast-BK-1MQkL.js → Broadcast-bKF9mIns.js} +13 -12
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BLzpFQoc.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B_q5K-cx.js} +6 -8
- package/dist/Card-BCAyfBLi.js +896 -0
- package/dist/{Collections-TA4iW1r0.js → Collections-Yz3F55bv.js} +27 -31
- package/dist/{Credit-Df9iFQjZ.js → Credit-Ceptt_g_.js} +17 -16
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +108 -0
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-CLFeMi0j.js +169 -0
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-TjNinQ8e.js +2181 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BCRVyPwl.js → EffectSheet.vue_vue_type_style_index_0_lang-D3Bt-Vuu.js} +6 -6
- package/dist/{Experience-ByLFXKn6.js → Experience-DskHKzfo.js} +26 -25
- package/dist/{Game-B6Ez0pfW.js → Game-IJ6X0AXM.js} +21 -20
- package/dist/Index-CEl2y9X6.js +259 -0
- package/dist/Marketing-CWekLb4c.js +20071 -0
- package/dist/{Member-TobP1ISp.js → Member-BUZPQ5Lb.js} +4 -4
- package/dist/MemberList-BmVNqvbm.js +1598 -0
- package/dist/MemberTransactions-B3XhEOK_.js +45 -0
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CZ-w6iZi.js → MessageInput.vue_vue_type_script_setup_true_lang-C6YIbQtM.js} +6 -6
- package/dist/{Mission-D9uTVo0G.js → Mission-Ci9ed_ph.js} +97 -84
- package/dist/Overview-CU9uhC-k.js +1078 -0
- package/dist/{Point-4rDr-53e.js → Point-wuuR7AEb.js} +26 -25
- package/dist/{Promotion-BKO_dtQk.js → Promotion-BMi3kyE8.js} +55 -48
- package/dist/Record-Wmh-g8WY.js +340 -0
- package/dist/Reward-BL4lxhIB.js +442 -0
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-CqXuTxun.js +150 -0
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Dbik0PEw.js +1637 -0
- package/dist/Segment-DObdjyYi.js +568 -0
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BAuM6qP5.js +181 -0
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-BfyRVxWM.js +147 -0
- package/dist/{Setting-B7oISD0D.js → Setting-Dqgnd7TR.js} +610 -586
- package/dist/Store--Z4So__g.js +1744 -0
- package/dist/{StoreRewards-AMxIYhjZ.js → StoreRewards-DPFVXWwm.js} +33 -32
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CNsdA106.js +939 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-B2szciPk.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CGOmGozY.js} +1 -1
- package/dist/{Tier-DkxdNj-K.js → Tier-36IfhsnP.js} +327 -318
- package/dist/{Title-VFpCOsMO.js → Title-XH56OOug.js} +199 -184
- package/dist/{Transaction-BgKD8n2L.js → Transaction-BUQcSmBs.js} +2 -2
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-BVCfeG5T.js +130 -0
- package/dist/Voucher-CvmH0kcF.js +353 -0
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-BQOD6uEf.js +419 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-B2FGvyza.js → ZodTextField.vue_vue_type_script_setup_true_lang-CcIcCt4N.js} +1 -1
- package/dist/{app-DUl5dav5.js → app-DeW5_DB0.js} +1754 -1496
- package/dist/{app-DA-t-2Zt.js → app-TN8KEPMu.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/{business-CeCitOY4.js → business-D1mLhSME.js} +1 -1
- package/dist/campaign-0tnkhu78.js +1810 -0
- package/dist/{campaign-CcLM6e4s.js → campaign-B-12Im0w.js} +2 -2
- package/dist/campaign.enum-C8m-HHZE.js +20 -0
- package/dist/campaign.fn-CxkhbK9i.js +758 -0
- package/dist/collectible.enum-6Syq-vQ6.js +19 -0
- package/dist/{collection.fn-CAEP7YxB.js → collection.fn-BUj75Jp2.js} +2 -2
- package/dist/dto-8wODhIIC.js +214 -0
- package/dist/{effect-Dt7rXOBy.js → effect-BEZEjcJu.js} +9 -9
- package/dist/email-addresses-PwjkdYYD.js +705 -0
- package/dist/{export-CyioiboQ.js → export-BB-0vgwy.js} +5 -5
- package/dist/{helper-FA_9AhGV.js → helper-DOt8-wns.js} +1 -1
- package/dist/{index-DLN4Kzz_.js → index-B1qUjniH.js} +1 -1
- package/dist/index-BTMIZz4v.js +44 -0
- package/dist/{index-igxrd5jC.js → index-By-GlmG7.js} +1500 -1479
- package/dist/index-C7zBkoZ4.js +115 -0
- package/dist/{index-CyNdsVrw.js → index-CNlHabtk.js} +1 -1
- package/dist/{index-DbbO3wip.js → index-CXGiIgdK.js} +48 -4
- package/dist/{index-C20XBD7G.js → index-Cjn1LVjC.js} +2192 -931
- package/dist/index-CpfUrdgw.js +29000 -0
- package/dist/index-CsaQJMAR.js +66 -0
- package/dist/index-DZuEmMyY.js +54 -0
- package/dist/{index-CCdXvb92.js → index-D_zwqIhq.js} +1 -1
- package/dist/index-DabUEw_c.js +32 -0
- package/dist/{index-BiFueJiF.js → index-X-FfC49l.js} +258 -192
- package/dist/index-vh86FiIQ.js +10 -0
- package/dist/{index.esm2017-Dl_CdTcK.js → index.esm2017-DJOUiVjR.js} +33 -33
- package/dist/loading-aCWVsOPY.js +71 -0
- package/dist/{membership-DFiY8aVd.js → membership-1etsHC5G.js} +54 -46
- package/dist/money-DzWRURZ5.js +15 -0
- package/dist/number-BxIQO1i3.js +12 -0
- package/dist/objectid-DjhmYkn-.js +145 -0
- package/dist/{loading-CZ0fiViM.js → plugins-CSPFAU50.js} +2990 -3062
- package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
- package/dist/reward-Bh4Li9f0.js +36 -0
- package/dist/{rule-C3e1xTqN.js → rule-CHTTTUFB.js} +180 -177
- package/dist/{rule-builder-MEVb_AiZ.js → rule-builder-OHfUJTIA.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{template-C2OKWd_e.js → template-ZGxXqkaC.js} +5 -5
- package/dist/trigger-Ogu5FDs0.js +144 -0
- package/dist/user-DBuU81tO.js +54 -0
- package/dist/{vue-i18n-CjxDUnX6.js → vue-i18n-CKpKQ6iE.js} +216 -216
- package/dist/{xlsx-CtXdl3ls.js → xlsx-DJDZBIeg.js} +1 -1
- package/package.json +9 -7
- package/dist/Analytic-C_ZFR5jh.js +0 -622
- package/dist/Card-C7dUFJKe.js +0 -825
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bgl90veU.js +0 -2813
- package/dist/Marketing-BaqZUeVI.js +0 -316
- package/dist/MemberList-B9cutmEh.js +0 -1733
- package/dist/MemberTransactions-DRHA7AOF.js +0 -38
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BHCoDSTg.js +0 -1753
- package/dist/Segment-Dj8nc3AE.js +0 -437
- package/dist/Store-CJ3wcohQ.js +0 -1511
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-wXUTfQQF.js +0 -890
- package/dist/Voucher-BbTLt8Pt.js +0 -490
- package/dist/dto-CRJma6eX.js +0 -2770
- package/dist/index-B1e0LtDe.js +0 -99
- package/dist/index-Be2ZYDy_.js +0 -298
- package/dist/index-CDkITvze.js +0 -762
- package/dist/index-CuvNtC_M.js +0 -61
- package/dist/index-DPP5F3bT.js +0 -206
- package/dist/index-Dbo3DDwp.js +0 -29193
- package/dist/money-D8hUEfP4.js +0 -15
- package/dist/number-DL3GAeVt.js +0 -12
- package/dist/user-Bm4KttFq.js +0 -37
|
@@ -1,622 +0,0 @@
|
|
|
1
|
-
import { defineComponent as T, openBlock as s, createElementBlock as h, Fragment as U, renderList as M, createElementVNode as a, toDisplayString as A, createCommentVNode as B, resolveComponent as k, createBlock as O, withCtx as I, createVNode as v, unref as t, ref as x, computed as G, onMounted as K, watch as Y, isRef as H, createSlots as ee, createTextVNode as te, reactive as ae, onBeforeMount as ne, normalizeClass as le } from "vue";
|
|
2
|
-
import { _ as oe } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { f as se } from "./number-DL3GAeVt.js";
|
|
4
|
-
import { C as ie, F as re, a as ce } from "./dto-CRJma6eX.js";
|
|
5
|
-
import { useRouter as W } from "vue-router";
|
|
6
|
-
import { c as L } from "./index-B1e0LtDe.js";
|
|
7
|
-
import { _ as ue } from "./ZodTextField.vue_vue_type_script_setup_true_lang-B2FGvyza.js";
|
|
8
|
-
import { Z as me } from "./zod-Bg2FbC-D.js";
|
|
9
|
-
import { J as de } from "./JsonViewer-v8_C7l5N.js";
|
|
10
|
-
import { u as pe } from "./loading-CZ0fiViM.js";
|
|
11
|
-
import { useSnackbar as fe } from "@feedmepos/ui-library";
|
|
12
|
-
import { u as ye } from "./app-wDQR6dpb.js";
|
|
13
|
-
import { g as ve } from "./object-qECH92oz.js";
|
|
14
|
-
import { u as ge } from "./campaign-CcLM6e4s.js";
|
|
15
|
-
import { u as _e } from "./membership-DFiY8aVd.js";
|
|
16
|
-
import { u as be } from "./vue-i18n-CjxDUnX6.js";
|
|
17
|
-
import { m as he } from "./index-CCdXvb92.js";
|
|
18
|
-
const xe = { class: "divide-x flex flex-wrap" }, Ce = { class: "fm-typo-en-body-md-400 mb-2 text-fm-color-typo-secondary" }, ke = { class: "fm-typo-en-title-sm-800" }, Se = /* @__PURE__ */ T({
|
|
19
|
-
__name: "CampaignStat",
|
|
20
|
-
props: {
|
|
21
|
-
data: {
|
|
22
|
-
type: Object,
|
|
23
|
-
required: !0
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
setup(p) {
|
|
27
|
-
const f = p, r = [
|
|
28
|
-
{ label: "Credit Received", key: "CREDIT" },
|
|
29
|
-
{ label: "EXP Received", key: "POINT" },
|
|
30
|
-
{ label: "Points Received", key: "COIN" },
|
|
31
|
-
{ label: "Message Sent", key: "BROADCAST" },
|
|
32
|
-
{ label: "Vouchers Claimed", key: "VOUCHER" },
|
|
33
|
-
{ label: "Users Joined", key: "UNIQUE_USER" }
|
|
34
|
-
];
|
|
35
|
-
function u(S) {
|
|
36
|
-
var c;
|
|
37
|
-
return se((c = f.data) == null ? void 0 : c[S], 2, !0) || 0;
|
|
38
|
-
}
|
|
39
|
-
return (S, c) => (s(), h("div", xe, [
|
|
40
|
-
(s(), h(U, null, M(r, (n) => (s(), h(U, null, [
|
|
41
|
-
n.key in p.data ? (s(), h("div", {
|
|
42
|
-
key: n.key,
|
|
43
|
-
class: "px-16"
|
|
44
|
-
}, [
|
|
45
|
-
a("div", Ce, A(n.label), 1),
|
|
46
|
-
a("div", ke, A(u(n.key)), 1)
|
|
47
|
-
])) : B("", !0)
|
|
48
|
-
], 64))), 64))
|
|
49
|
-
]));
|
|
50
|
-
}
|
|
51
|
-
}), we = { class: "bg-fm-color-neutral-gray-100 gap-4 h-[30px] inline-flex items-center justify-center max-w-[250px] px-8 py-4 rounded-md" }, Fe = { class: "fm-typo-en-body-md-600 overflow-hidden select-none text-ellipsis text-fm-color-typo-secondary whitespace-nowrap" }, Ve = /* @__PURE__ */ T({
|
|
52
|
-
__name: "CampaignChip",
|
|
53
|
-
props: {
|
|
54
|
-
type: { type: String, required: !0 },
|
|
55
|
-
icon: {
|
|
56
|
-
type: Object,
|
|
57
|
-
default: () => ({ icon: "circle", color: "typo-sucess" })
|
|
58
|
-
},
|
|
59
|
-
label: {
|
|
60
|
-
type: String,
|
|
61
|
-
default: ""
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
setup(p) {
|
|
65
|
-
const r = ie[p.type];
|
|
66
|
-
return (u, S) => {
|
|
67
|
-
const c = k("FmIcon"), n = k("FmTooltip");
|
|
68
|
-
return s(), O(n, {
|
|
69
|
-
variant: "plain",
|
|
70
|
-
placement: "top",
|
|
71
|
-
content: p.label
|
|
72
|
-
}, {
|
|
73
|
-
default: I(() => [
|
|
74
|
-
a("div", we, [
|
|
75
|
-
v(c, {
|
|
76
|
-
name: t(r).icon,
|
|
77
|
-
outline: "",
|
|
78
|
-
size: "sm"
|
|
79
|
-
}, null, 8, ["name"]),
|
|
80
|
-
a("div", Fe, A(p.label), 1),
|
|
81
|
-
v(c, {
|
|
82
|
-
name: p.icon.name,
|
|
83
|
-
color: p.icon.color,
|
|
84
|
-
size: "sm"
|
|
85
|
-
}, null, 8, ["name", "color"])
|
|
86
|
-
])
|
|
87
|
-
]),
|
|
88
|
-
_: 1
|
|
89
|
-
}, 8, ["content"]);
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
}), $e = { class: "flex flex-col" }, Ae = { class: "flex flex-nowrap items-center justify-between mb-12" }, Re = { class: "flex gap-4 items-center justify-start" }, Oe = { class: "fm-typo-en-title-sm-800" }, Ue = { class: "flex flex-wrap gap-4 items-center mb-16 overflow-y-hidden" }, Ee = /* @__PURE__ */ T({
|
|
93
|
-
__name: "CampaignGroup",
|
|
94
|
-
props: {
|
|
95
|
-
group: {
|
|
96
|
-
type: Object,
|
|
97
|
-
required: !0
|
|
98
|
-
},
|
|
99
|
-
onEdit: {
|
|
100
|
-
type: Function,
|
|
101
|
-
required: !0
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
emits: ["changed"],
|
|
105
|
-
setup(p, { emit: f }) {
|
|
106
|
-
W(), x(!1);
|
|
107
|
-
const r = p, u = x([]), S = G(
|
|
108
|
-
() => u.value.reduce(
|
|
109
|
-
(n, o) => ({ ...n, [o.type]: o.totalAmount }),
|
|
110
|
-
{}
|
|
111
|
-
)
|
|
112
|
-
), c = G(() => {
|
|
113
|
-
var n;
|
|
114
|
-
return ((n = r.group.pf_campaigns) == null ? void 0 : n.map((o) => ({
|
|
115
|
-
campaign: o,
|
|
116
|
-
label: o.name
|
|
117
|
-
}))) || [];
|
|
118
|
-
});
|
|
119
|
-
return K(async () => {
|
|
120
|
-
u.value = await L.readStats({
|
|
121
|
-
groupId: r.group._id.toString()
|
|
122
|
-
});
|
|
123
|
-
}), (n, o) => {
|
|
124
|
-
const i = k("FmButton"), l = k("FmCard");
|
|
125
|
-
return s(), O(l, {
|
|
126
|
-
class: "mb-24 p-24",
|
|
127
|
-
variant: "outlined"
|
|
128
|
-
}, {
|
|
129
|
-
default: I(() => [
|
|
130
|
-
a("div", $e, [
|
|
131
|
-
a("div", Ae, [
|
|
132
|
-
a("div", Re, [
|
|
133
|
-
a("div", Oe, A(p.group.name), 1),
|
|
134
|
-
v(i, {
|
|
135
|
-
icon: "edit",
|
|
136
|
-
variant: "tertiary",
|
|
137
|
-
onClick: o[0] || (o[0] = (y) => p.onEdit(p.group))
|
|
138
|
-
})
|
|
139
|
-
])
|
|
140
|
-
]),
|
|
141
|
-
a("div", Ue, [
|
|
142
|
-
(s(!0), h(U, null, M(t(c), (y) => (s(), O(Ve, {
|
|
143
|
-
key: n.index,
|
|
144
|
-
type: y.campaign.type,
|
|
145
|
-
label: y.label
|
|
146
|
-
}, null, 8, ["type", "label"]))), 128))
|
|
147
|
-
]),
|
|
148
|
-
v(Se, { data: t(S) }, null, 8, ["data"])
|
|
149
|
-
])
|
|
150
|
-
]),
|
|
151
|
-
_: 1
|
|
152
|
-
});
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
}), Pe = { class: "ml-32 flex flex-col" }, Be = /* @__PURE__ */ T({
|
|
156
|
-
__name: "CampaignCard",
|
|
157
|
-
props: {
|
|
158
|
-
title: {},
|
|
159
|
-
items: {},
|
|
160
|
-
modelValue: {}
|
|
161
|
-
},
|
|
162
|
-
emits: ["update:model-value"],
|
|
163
|
-
setup(p, { emit: f }) {
|
|
164
|
-
const r = p, u = f, S = (i) => {
|
|
165
|
-
i ? o.value = r.items.map((l) => l.value) : o.value = [], n.value = i, u("update:model-value", o.value);
|
|
166
|
-
}, c = (i) => {
|
|
167
|
-
o.value = i, n.value = i.length === r.items.length, u("update:model-value", i);
|
|
168
|
-
}, n = x(!1), o = x([]);
|
|
169
|
-
return Y(
|
|
170
|
-
() => r.modelValue,
|
|
171
|
-
() => {
|
|
172
|
-
o.value = r.modelValue.filter(
|
|
173
|
-
(i) => r.items.find((l) => l.value === i)
|
|
174
|
-
);
|
|
175
|
-
}
|
|
176
|
-
), K(() => {
|
|
177
|
-
o.value = r.modelValue.filter(
|
|
178
|
-
(i) => r.items.find((l) => l.value === i)
|
|
179
|
-
);
|
|
180
|
-
}), (i, l) => {
|
|
181
|
-
const y = k("FmCheckbox"), _ = k("FmCard");
|
|
182
|
-
return s(), O(_, {
|
|
183
|
-
variant: "outlined",
|
|
184
|
-
class: "p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3"
|
|
185
|
-
}, {
|
|
186
|
-
default: I(() => [
|
|
187
|
-
v(y, {
|
|
188
|
-
"model-value": t(n),
|
|
189
|
-
value: "1",
|
|
190
|
-
label: r.title,
|
|
191
|
-
indeterminate: t(o).length > 0,
|
|
192
|
-
"onUpdate:modelValue": S
|
|
193
|
-
}, null, 8, ["model-value", "label", "indeterminate"]),
|
|
194
|
-
a("div", Pe, [
|
|
195
|
-
(s(!0), h(U, null, M(r.items, (b, j) => (s(), O(y, {
|
|
196
|
-
key: j,
|
|
197
|
-
"model-value": t(o),
|
|
198
|
-
label: b.label,
|
|
199
|
-
value: b.value,
|
|
200
|
-
"onUpdate:modelValue": c
|
|
201
|
-
}, null, 8, ["model-value", "label", "value"]))), 128))
|
|
202
|
-
])
|
|
203
|
-
]),
|
|
204
|
-
_: 1
|
|
205
|
-
});
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
}), Ie = { class: "space-y-16" }, Ge = { class: "flex items-center" }, Me = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary w-[300px]" }, Le = { class: "space-y-[40px]" }, Te = /* @__PURE__ */ T({
|
|
209
|
-
__name: "LinkCampaign",
|
|
210
|
-
props: {
|
|
211
|
-
modelValue: {
|
|
212
|
-
type: Array,
|
|
213
|
-
required: !0
|
|
214
|
-
},
|
|
215
|
-
campaigns: {
|
|
216
|
-
type: Object,
|
|
217
|
-
required: !0
|
|
218
|
-
}
|
|
219
|
-
},
|
|
220
|
-
emits: ["update:model-value"],
|
|
221
|
-
setup(p, { emit: f }) {
|
|
222
|
-
const r = x(""), u = x([]), S = p, c = f, n = G(() => Object.entries(S.campaigns).reduce((i, [l, y]) => {
|
|
223
|
-
const _ = y.filter(
|
|
224
|
-
(b) => b.label.toLowerCase().includes(r.value.toLowerCase())
|
|
225
|
-
);
|
|
226
|
-
return _.length > 0 && (i[l] = _), i;
|
|
227
|
-
}, {}));
|
|
228
|
-
function o(i, l) {
|
|
229
|
-
u.value = u.value.filter(
|
|
230
|
-
(y) => !l.map((_) => _.value).includes(y)
|
|
231
|
-
), u.value = [.../* @__PURE__ */ new Set([...u.value, ...i])], c("update:model-value", u.value);
|
|
232
|
-
}
|
|
233
|
-
return K(() => {
|
|
234
|
-
u.value = S.modelValue;
|
|
235
|
-
}), (i, l) => {
|
|
236
|
-
const y = k("FmTextField");
|
|
237
|
-
return s(), h(U, null, [
|
|
238
|
-
v(de, { json: p.campaigns }, null, 8, ["json"]),
|
|
239
|
-
a("div", Ie, [
|
|
240
|
-
a("div", Ge, [
|
|
241
|
-
a("div", Me, A(t(u).length) + " campaign(s) linked ", 1),
|
|
242
|
-
v(y, {
|
|
243
|
-
modelValue: t(r),
|
|
244
|
-
"onUpdate:modelValue": l[0] || (l[0] = (_) => H(r) ? r.value = _ : null),
|
|
245
|
-
"prepend-icon": "search",
|
|
246
|
-
placeholder: "Search",
|
|
247
|
-
class: "w-full"
|
|
248
|
-
}, null, 8, ["modelValue"])
|
|
249
|
-
]),
|
|
250
|
-
a("div", Le, [
|
|
251
|
-
(s(!0), h(U, null, M(t(n), (_, b) => (s(), O(Be, {
|
|
252
|
-
"model-value": t(u),
|
|
253
|
-
title: b,
|
|
254
|
-
items: _,
|
|
255
|
-
"onUpdate:modelValue": (j) => o(j, _)
|
|
256
|
-
}, null, 8, ["model-value", "title", "items", "onUpdate:modelValue"]))), 256))
|
|
257
|
-
])
|
|
258
|
-
])
|
|
259
|
-
], 64);
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
}), je = { class: "flex items-center gap-x-8" }, De = {
|
|
263
|
-
key: 0,
|
|
264
|
-
class: "space-y-16 pr-12"
|
|
265
|
-
}, Ne = { class: "flex items-center gap-x-16" }, qe = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, He = { class: "mt-16" }, Ke = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600 py-8 px-16 bg-gray-100" }, ze = { class: "flex justify-between items-center py-8 px-16 border-b-1" }, Je = { class: "flex items-center gap-8" }, We = /* @__PURE__ */ T({
|
|
266
|
-
__name: "AnalyticSheet",
|
|
267
|
-
emits: ["success"],
|
|
268
|
-
setup(p, { expose: f, emit: r }) {
|
|
269
|
-
const u = r, S = ye();
|
|
270
|
-
fe();
|
|
271
|
-
const c = x(!1), n = x(!1), o = {
|
|
272
|
-
name: "",
|
|
273
|
-
campaigns: []
|
|
274
|
-
}, i = x(""), l = x({ ...o }), y = re.superRefine((d, e) => {
|
|
275
|
-
}), _ = x([]), b = x(null), { global: j, minor: $ } = pe, w = G(() => {
|
|
276
|
-
const d = y.safeParse(l.value);
|
|
277
|
-
return d.success ? [] : d.error.errors;
|
|
278
|
-
});
|
|
279
|
-
function m(d) {
|
|
280
|
-
var e;
|
|
281
|
-
c.value = !0, d ? (b.value = { ...d }, l.value = { ...d, campaigns: (e = d.pf_campaigns) == null ? void 0 : e.map((g) => g._id) }) : (b.value = null, l.value = { ...o });
|
|
282
|
-
}
|
|
283
|
-
function F() {
|
|
284
|
-
c.value = !1, b.value = null;
|
|
285
|
-
}
|
|
286
|
-
function P() {
|
|
287
|
-
n.value = !0;
|
|
288
|
-
}
|
|
289
|
-
async function V() {
|
|
290
|
-
const d = await L.readAll({
|
|
291
|
-
limit: 1e3,
|
|
292
|
-
skip: 0,
|
|
293
|
-
sortBy: "_id",
|
|
294
|
-
search: "",
|
|
295
|
-
descending: !0
|
|
296
|
-
});
|
|
297
|
-
_.value = d.resources.filter(
|
|
298
|
-
(e) => !["MEMBERSHIP", "REWARD_POOL"].includes(e.type) && !["ISSUE_REWARD"].includes("event" in e ? e == null ? void 0 : e.event.type : "")
|
|
299
|
-
);
|
|
300
|
-
}
|
|
301
|
-
const D = G(() => {
|
|
302
|
-
const d = (g) => g.map((E) => ({
|
|
303
|
-
label: E.name,
|
|
304
|
-
value: E._id
|
|
305
|
-
}));
|
|
306
|
-
return ve(
|
|
307
|
-
_.value,
|
|
308
|
-
(g) => ce.formattedType(g.type),
|
|
309
|
-
d
|
|
310
|
-
);
|
|
311
|
-
}), R = G(() => Object.entries(D.value).reduce(
|
|
312
|
-
(d, [e, g]) => {
|
|
313
|
-
const E = g.filter((N) => {
|
|
314
|
-
var q, C;
|
|
315
|
-
return (C = (q = l.value) == null ? void 0 : q.campaigns) == null ? void 0 : C.includes(N.value);
|
|
316
|
-
}).filter(
|
|
317
|
-
(N) => N.label.toLowerCase().includes(i.value.toLowerCase())
|
|
318
|
-
);
|
|
319
|
-
return E.length > 0 && (d[e] = E), d;
|
|
320
|
-
},
|
|
321
|
-
{}
|
|
322
|
-
));
|
|
323
|
-
function z(d) {
|
|
324
|
-
var g, E;
|
|
325
|
-
const e = (g = l.value.campaigns) == null ? void 0 : g.indexOf(d);
|
|
326
|
-
e != null && e > -1 && ((E = l.value.campaigns) == null || E.splice(e, 1));
|
|
327
|
-
}
|
|
328
|
-
async function Z() {
|
|
329
|
-
y.safeParse(l.value).success && await $(
|
|
330
|
-
async () => {
|
|
331
|
-
var e;
|
|
332
|
-
b.value ? await L.updateGroup(
|
|
333
|
-
(e = b.value) == null ? void 0 : e._id,
|
|
334
|
-
l.value
|
|
335
|
-
) : await L.createGroup(l.value), u("success"), F();
|
|
336
|
-
},
|
|
337
|
-
{
|
|
338
|
-
message: "Saving group",
|
|
339
|
-
successMessage: "Group saved"
|
|
340
|
-
}
|
|
341
|
-
);
|
|
342
|
-
}
|
|
343
|
-
async function Q() {
|
|
344
|
-
await $(
|
|
345
|
-
async () => {
|
|
346
|
-
var d;
|
|
347
|
-
await L.deleteGroup((d = b.value) == null ? void 0 : d._id), u("success"), F();
|
|
348
|
-
},
|
|
349
|
-
{
|
|
350
|
-
message: "Deleting group",
|
|
351
|
-
successMessage: "Group deleted"
|
|
352
|
-
}
|
|
353
|
-
);
|
|
354
|
-
}
|
|
355
|
-
return K(async () => {
|
|
356
|
-
await V();
|
|
357
|
-
}), f({
|
|
358
|
-
showSheet: m,
|
|
359
|
-
hideSheet: F
|
|
360
|
-
}), (d, e) => {
|
|
361
|
-
const g = k("FmButton"), E = k("FmTextField"), N = k("FmList"), q = k("FmSideSheet");
|
|
362
|
-
return s(), O(q, {
|
|
363
|
-
modelValue: t(c),
|
|
364
|
-
"onUpdate:modelValue": e[7] || (e[7] = (C) => H(c) ? c.value = C : null),
|
|
365
|
-
header: t(b) ? "Edit group" : "Add group",
|
|
366
|
-
"dismiss-away": "",
|
|
367
|
-
"close-button": !0,
|
|
368
|
-
"max-width": 550
|
|
369
|
-
}, ee({
|
|
370
|
-
"side-sheet-footer": I(() => [
|
|
371
|
-
a("div", Je, [
|
|
372
|
-
t(n) ? B("", !0) : (s(), h(U, { key: 0 }, [
|
|
373
|
-
v(g, {
|
|
374
|
-
label: "Submit",
|
|
375
|
-
onClick: Z,
|
|
376
|
-
disabled: t(w).length > 0 || t(S).isLoading
|
|
377
|
-
}, null, 8, ["disabled"]),
|
|
378
|
-
v(g, {
|
|
379
|
-
label: "Cancel",
|
|
380
|
-
onClick: e[4] || (e[4] = (C) => F()),
|
|
381
|
-
variant: "tertiary"
|
|
382
|
-
}),
|
|
383
|
-
t(b) ? (s(), O(g, {
|
|
384
|
-
key: 0,
|
|
385
|
-
label: "Delete",
|
|
386
|
-
variant: "plain",
|
|
387
|
-
class: "ml-auto fm-color-system-error-300",
|
|
388
|
-
onClick: e[5] || (e[5] = (C) => Q())
|
|
389
|
-
})) : B("", !0)
|
|
390
|
-
], 64)),
|
|
391
|
-
t(n) ? (s(), O(g, {
|
|
392
|
-
key: 1,
|
|
393
|
-
label: "Confirm",
|
|
394
|
-
onClick: e[6] || (e[6] = (C) => n.value = !1)
|
|
395
|
-
})) : B("", !0)
|
|
396
|
-
])
|
|
397
|
-
]),
|
|
398
|
-
default: I(() => [
|
|
399
|
-
t(n) ? B("", !0) : (s(), h("div", De, [
|
|
400
|
-
e[9] || (e[9] = a("div", { class: "fm-typo-en-title-sm-800" }, "Group detail", -1)),
|
|
401
|
-
v(ue, {
|
|
402
|
-
modelValue: t(l).name,
|
|
403
|
-
"onUpdate:modelValue": e[1] || (e[1] = (C) => t(l).name = C),
|
|
404
|
-
label: "Name",
|
|
405
|
-
schema: t(me).typeAtPath(t(y), "name")
|
|
406
|
-
}, null, 8, ["modelValue", "schema"]),
|
|
407
|
-
e[10] || (e[10] = a("div", { class: "fm-typo-en-title-sm-800" }, "Link campaign", -1)),
|
|
408
|
-
a("div", Ne, [
|
|
409
|
-
a("div", qe, A(t(l).campaigns.length) + " campaign(s) linked ", 1),
|
|
410
|
-
v(E, {
|
|
411
|
-
modelValue: t(i),
|
|
412
|
-
"onUpdate:modelValue": e[2] || (e[2] = (C) => H(i) ? i.value = C : null),
|
|
413
|
-
"prepend-icon": "search",
|
|
414
|
-
placeholder: "Search",
|
|
415
|
-
class: "w-auto"
|
|
416
|
-
}, null, 8, ["modelValue"])
|
|
417
|
-
]),
|
|
418
|
-
v(g, {
|
|
419
|
-
variant: "plain",
|
|
420
|
-
icon: "link",
|
|
421
|
-
label: "Link Campaign",
|
|
422
|
-
onClick: P
|
|
423
|
-
})
|
|
424
|
-
])),
|
|
425
|
-
t(n) ? (s(), O(Te, {
|
|
426
|
-
key: 1,
|
|
427
|
-
modelValue: t(l).campaigns,
|
|
428
|
-
"onUpdate:modelValue": e[3] || (e[3] = (C) => t(l).campaigns = C),
|
|
429
|
-
campaigns: t(D)
|
|
430
|
-
}, null, 8, ["modelValue", "campaigns"])) : B("", !0),
|
|
431
|
-
a("div", He, [
|
|
432
|
-
t(n) ? B("", !0) : (s(!0), h(U, { key: 0 }, M(t(R), (C, X) => (s(), h("div", null, [
|
|
433
|
-
a("div", Ke, A(X), 1),
|
|
434
|
-
v(N, { separator: !0 }, {
|
|
435
|
-
default: I(() => [
|
|
436
|
-
(s(!0), h(U, null, M(C, (J) => (s(), h("div", ze, [
|
|
437
|
-
a("div", null, A(J.label), 1),
|
|
438
|
-
a("div", null, [
|
|
439
|
-
v(g, {
|
|
440
|
-
icon: "delete",
|
|
441
|
-
onClick: (st) => z(J.value),
|
|
442
|
-
variant: "tertiary"
|
|
443
|
-
}, null, 8, ["onClick"])
|
|
444
|
-
])
|
|
445
|
-
]))), 256))
|
|
446
|
-
]),
|
|
447
|
-
_: 2
|
|
448
|
-
}, 1024)
|
|
449
|
-
]))), 256))
|
|
450
|
-
])
|
|
451
|
-
]),
|
|
452
|
-
_: 2
|
|
453
|
-
}, [
|
|
454
|
-
t(n) ? {
|
|
455
|
-
name: "side-sheet-header",
|
|
456
|
-
fn: I(() => [
|
|
457
|
-
a("div", je, [
|
|
458
|
-
v(g, {
|
|
459
|
-
icon: "arrow_back",
|
|
460
|
-
variant: "tertiary",
|
|
461
|
-
onClick: e[0] || (e[0] = (C) => n.value = !1)
|
|
462
|
-
}),
|
|
463
|
-
e[8] || (e[8] = te("Link campaign "))
|
|
464
|
-
])
|
|
465
|
-
]),
|
|
466
|
-
key: "0"
|
|
467
|
-
} : void 0
|
|
468
|
-
]), 1032, ["modelValue", "header"]);
|
|
469
|
-
};
|
|
470
|
-
}
|
|
471
|
-
}), Ze = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Qe = { class: "space-y-16" }, Xe = { class: "flex items-center justify-end" }, Ye = { class: "fm-typo-en-body-lg-600" }, et = { class: "grid grid-cols-4 xs:grid-cols-2 gap-4 divide-x xs:divide-x-0" }, tt = { class: "fm-typo-body-md-400 fm-typo-en-body-md-400 mb-2 text-fm-color-typo-secondary" }, at = { class: "fm-typo-en-title-sm-800" }, nt = { class: "fm-typo-en-title-sm-800 text-center" }, lt = { class: "fm-typo-body-en-md-400 text-center text-fm-color-typo-secondary" }, ot = { class: "flex gap-16 items-center" }, St = /* @__PURE__ */ T({
|
|
472
|
-
__name: "Analytic",
|
|
473
|
-
setup(p) {
|
|
474
|
-
const { t: f } = be(), r = {
|
|
475
|
-
label: f("connect.analytic.addGroup"),
|
|
476
|
-
value: "create",
|
|
477
|
-
isPrimary: !0,
|
|
478
|
-
prependIcon: "add"
|
|
479
|
-
}, u = ge(), S = x(), c = x([]), n = x(""), o = ae({
|
|
480
|
-
totalCampaign: 0,
|
|
481
|
-
totalProgram: 0,
|
|
482
|
-
totalMember: 0
|
|
483
|
-
}), i = x("1"), l = [
|
|
484
|
-
{
|
|
485
|
-
key: f("connect.analytic.summary.totalCampaign"),
|
|
486
|
-
value: () => o.totalCampaign
|
|
487
|
-
},
|
|
488
|
-
{
|
|
489
|
-
key: f("connect.analytic.summary.totalProgram"),
|
|
490
|
-
value: () => o.totalProgram
|
|
491
|
-
},
|
|
492
|
-
{
|
|
493
|
-
key: f("connect.analytic.summary.totalMember"),
|
|
494
|
-
value: () => o.totalMember
|
|
495
|
-
}
|
|
496
|
-
];
|
|
497
|
-
function y(w) {
|
|
498
|
-
var m;
|
|
499
|
-
i.value = (/* @__PURE__ */ new Date()).toISOString(), (m = S.value) == null || m.showSheet(w);
|
|
500
|
-
}
|
|
501
|
-
async function _() {
|
|
502
|
-
await u.readGroups();
|
|
503
|
-
const w = await L.readAllGrouped({
|
|
504
|
-
limit: 100,
|
|
505
|
-
skip: 0,
|
|
506
|
-
sortBy: "_id",
|
|
507
|
-
search: "",
|
|
508
|
-
descending: !0
|
|
509
|
-
});
|
|
510
|
-
c.value = w.resources;
|
|
511
|
-
}
|
|
512
|
-
async function b() {
|
|
513
|
-
var F, P;
|
|
514
|
-
const w = await he.read({
|
|
515
|
-
limit: 1,
|
|
516
|
-
skip: 0,
|
|
517
|
-
sortBy: "_id",
|
|
518
|
-
search: "",
|
|
519
|
-
descending: !1
|
|
520
|
-
}), m = await L.readAll({
|
|
521
|
-
limit: 1e3,
|
|
522
|
-
skip: 0,
|
|
523
|
-
sortBy: "_id",
|
|
524
|
-
search: "",
|
|
525
|
-
descending: !1
|
|
526
|
-
});
|
|
527
|
-
o.totalCampaign = ((F = m.resources) == null ? void 0 : F.filter(
|
|
528
|
-
(V) => ["PROMOTION", "VOUCHER", "BROADCAST"].includes(V.type) && !["ISSUE_REWARD"].includes("event" in V ? V == null ? void 0 : V.event.type : "")
|
|
529
|
-
).length) ?? 0, o.totalProgram = ((P = m.resources) == null ? void 0 : P.filter(
|
|
530
|
-
(V) => ["POINT", "COIN", "CREDIT", "GAME"].includes(V.type)
|
|
531
|
-
).length) ?? 0, o.totalMember = w.meta.totalResources ?? 0;
|
|
532
|
-
}
|
|
533
|
-
const j = G(() => c.value.filter((w) => {
|
|
534
|
-
var m;
|
|
535
|
-
return w.name.includes(n.value) || ((m = w.pf_campaigns) == null ? void 0 : m.filter((F) => F.name.includes(n.value)).length);
|
|
536
|
-
})), $ = _e();
|
|
537
|
-
return W(), x(!0), G(() => {
|
|
538
|
-
var w, m, F, P;
|
|
539
|
-
return !$.storeOption || !$.storeOption.company ? -1 : !$.payoutAccount || !$.payoutAccount.enable || $.payoutAccount.status != "APPROVED" ? 0 : (m = (w = $.store) == null ? void 0 : w.categories) != null && m.length ? (P = (F = $.store) == null ? void 0 : F.categories) != null && P.some(
|
|
540
|
-
(V) => V.bundles.some((D) => D.isFeedvibe)
|
|
541
|
-
) ? 3 : 2 : 1;
|
|
542
|
-
}), ne(async () => {
|
|
543
|
-
await _(), await b(), await $.readMemberStore(), await $.readMembership(), await $.readPayoutAccount();
|
|
544
|
-
}), (w, m) => {
|
|
545
|
-
const F = k("FmPageHead"), P = k("FmSearch"), V = k("FmCard"), D = k("FmButton");
|
|
546
|
-
return k("FmIcon"), s(), h(U, null, [
|
|
547
|
-
v(F, {
|
|
548
|
-
title: t(f)("connect.analytic.title"),
|
|
549
|
-
actions: t(c).length > 0 ? [r] : [],
|
|
550
|
-
"onClick:action": m[0] || (m[0] = (R) => y())
|
|
551
|
-
}, null, 8, ["title", "actions"]),
|
|
552
|
-
a("div", Ze, [
|
|
553
|
-
a("div", Qe, [
|
|
554
|
-
a("div", Xe, [
|
|
555
|
-
v(P, {
|
|
556
|
-
class: "xs:hidden",
|
|
557
|
-
modelValue: t(n),
|
|
558
|
-
"onUpdate:modelValue": m[1] || (m[1] = (R) => H(n) ? n.value = R : null),
|
|
559
|
-
placeholder: t(f)("connect.analytic.search"),
|
|
560
|
-
collapsible: ""
|
|
561
|
-
}, null, 8, ["modelValue", "placeholder"])
|
|
562
|
-
]),
|
|
563
|
-
v(V, {
|
|
564
|
-
variant: "outlined",
|
|
565
|
-
class: "flex flex-col gap-16 p-16"
|
|
566
|
-
}, {
|
|
567
|
-
default: I(() => [
|
|
568
|
-
a("div", Ye, A(t(f)("connect.analytic.summary.title")), 1),
|
|
569
|
-
a("div", et, [
|
|
570
|
-
(s(), h(U, null, M(l, (R, z) => a("div", {
|
|
571
|
-
key: R.key,
|
|
572
|
-
class: le(["px-8", { "xs:!border-r": z % 2 == 0 }])
|
|
573
|
-
}, [
|
|
574
|
-
a("div", tt, A(R.key), 1),
|
|
575
|
-
a("div", at, A(R.value()), 1)
|
|
576
|
-
], 2)), 64))
|
|
577
|
-
])
|
|
578
|
-
]),
|
|
579
|
-
_: 1
|
|
580
|
-
})
|
|
581
|
-
]),
|
|
582
|
-
B("", !0),
|
|
583
|
-
t(c).length ? B("", !0) : (s(), O(V, {
|
|
584
|
-
key: 1,
|
|
585
|
-
variant: "outlined",
|
|
586
|
-
class: "flex flex-col gap-y-24 items-center p-16"
|
|
587
|
-
}, {
|
|
588
|
-
default: I(() => [
|
|
589
|
-
m[8] || (m[8] = a("img", {
|
|
590
|
-
src: oe,
|
|
591
|
-
class: "w-[150px]"
|
|
592
|
-
}, null, -1)),
|
|
593
|
-
a("div", nt, A(t(f)("connect.analytic.emptyState.title")), 1),
|
|
594
|
-
a("div", lt, A(t(f)("connect.analytic.emptyState.description")), 1),
|
|
595
|
-
a("div", ot, [
|
|
596
|
-
v(D, {
|
|
597
|
-
label: t(f)("connect.analytic.emptyState.action"),
|
|
598
|
-
icon: "add",
|
|
599
|
-
onClick: m[3] || (m[3] = (R) => y())
|
|
600
|
-
}, null, 8, ["label"])
|
|
601
|
-
])
|
|
602
|
-
]),
|
|
603
|
-
_: 1
|
|
604
|
-
})),
|
|
605
|
-
(s(!0), h(U, null, M(t(j), (R) => (s(), O(Ee, {
|
|
606
|
-
key: R._id.toString(),
|
|
607
|
-
group: R,
|
|
608
|
-
"on-edit": y
|
|
609
|
-
}, null, 8, ["group"]))), 128)),
|
|
610
|
-
v(We, {
|
|
611
|
-
ref_key: "sheetRef",
|
|
612
|
-
ref: S,
|
|
613
|
-
onSuccess: _
|
|
614
|
-
}, null, 512)
|
|
615
|
-
])
|
|
616
|
-
], 64);
|
|
617
|
-
};
|
|
618
|
-
}
|
|
619
|
-
});
|
|
620
|
-
export {
|
|
621
|
-
St as default
|
|
622
|
-
};
|