@feedmepos/mf-connect 0.1.2-prod → 0.1.3-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.
Files changed (64) hide show
  1. package/dist/Analytic-DiPWt78u.js +423 -0
  2. package/dist/{App-CRTD0U-N.js → App-DvtYt9h5.js} +5 -5
  3. package/dist/{Broadcast-utWSrzP9.js → Broadcast-Dv4XcvBh.js} +14 -14
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-C5zUv0Zx.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DoH4RX_Y.js} +8 -8
  5. package/dist/{Card-x6qnEaIt.js → Card-DDvwlZF0.js} +14 -14
  6. package/dist/{Collections-BgbWoLWI.js → Collections-C5-k8WkG.js} +4 -4
  7. package/dist/{Credit-CojzmUnh.js → Credit-BDQIr_FJ.js} +7 -7
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C137bE1q.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-DCbvlp5V.js} +22 -22
  9. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-8l3Dt_Lo.js → EffectSheet.vue_vue_type_style_index_0_lang-BQzgcn4V.js} +5 -5
  10. package/dist/{Experience-CPjovKWF.js → Experience-B9H3tOF0.js} +13 -13
  11. package/dist/{Game-DWcjPfZP.js → Game-cy3_ppLO.js} +15 -15
  12. package/dist/{Marketing-CwoI0pFF.js → Marketing-CWXV2n5F.js} +4 -4
  13. package/dist/{Member-oRcVGr20.js → Member-DyTX22Zk.js} +3 -3
  14. package/dist/{MemberList-ISy05wGZ.js → MemberList-CMefeirT.js} +14 -14
  15. package/dist/{MemberTransactions-CXvhJngX.js → MemberTransactions-B9oYdzjR.js} +1 -1
  16. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Ca1LO__F.js → MessageInput.vue_vue_type_script_setup_true_lang-B0T7ze7r.js} +2 -2
  17. package/dist/{Mission-Y8s5MQIC.js → Mission-DxSO3iES.js} +13 -13
  18. package/dist/{Point-0Fw3qLIW.js → Point-C5UtlqkX.js} +7 -7
  19. package/dist/{Promotion-vqM23NPX.js → Promotion-DhSGTj-R.js} +8 -8
  20. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-D1eQ3i5D.js → RuleGroup.vue_vue_type_script_setup_true_lang-BGM1doWM.js} +14 -14
  21. package/dist/{Segment-lgzMRCyd.js → Segment-BzI6Ykxp.js} +11 -11
  22. package/dist/{Setting-CFGB53S0.js → Setting-SRUWwF9w.js} +7 -7
  23. package/dist/{Store-fJlew3HJ.js → Store-CIrn_7Mh.js} +11 -11
  24. package/dist/{StoreRewards-DWq34E4p.js → StoreRewards-BYc0vgnr.js} +10 -10
  25. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-nhS5Dhhk.js → StoreTransactions.vue_vue_type_script_setup_true_lang-JumDBZLs.js} +10 -10
  26. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DWlpmE56.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BtBCggcN.js} +1 -1
  27. package/dist/{Tier-DLrOmrnK.js → Tier-ms8r2E7c.js} +13 -13
  28. package/dist/{Title-MHQuel7h.js → Title-BBKoBs46.js} +13 -13
  29. package/dist/{Transaction-CYqMFEzc.js → Transaction-IZL9-6fe.js} +1 -1
  30. package/dist/{Voucher-B0QCX_nG.js → Voucher-CIWulmcc.js} +10 -10
  31. package/dist/{app-SOHUUM08.js → app-BQvluJk_.js} +24 -24
  32. package/dist/{app-BjOpRVdv.js → app-CGgrMOc_.js} +1 -1
  33. package/dist/app.js +1 -1
  34. package/dist/{business-DveMDDHY.js → business-DeMUnCNX.js} +1 -1
  35. package/dist/{campaign-CMb05XLt.js → campaign-CBszI6An.js} +2 -2
  36. package/dist/{collection.fn-BjaBPYMU.js → collection.fn-D4Qgx1aW.js} +2 -2
  37. package/dist/{dto-CY7JrHkZ.js → dto-Dtvg93Bz.js} +67 -67
  38. package/dist/{effect-CxAdSlyD.js → effect-2p4_SGbQ.js} +1 -1
  39. package/dist/{email-addresses-Dtr5OALQ.js → email-addresses-Bc9od2gA.js} +1 -1
  40. package/dist/{export-DuBekrcg.js → export-BK6FgeQO.js} +3 -3
  41. package/dist/{helper-DL6hnmtJ.js → helper-DUkKW7uc.js} +1 -1
  42. package/dist/{index-BBBytzpn.js → index-AZ8cKg9n.js} +1 -1
  43. package/dist/{index-DISwCnfH.js → index-B9f-K1No.js} +2 -2
  44. package/dist/{index-Dx4pkNRc.js → index-BFcrfL4W.js} +1 -1
  45. package/dist/{index-raYm7Ew2.js → index-BWWnWRpt.js} +2 -2
  46. package/dist/{index-CgPlJqkX.js → index-CTmiZrHu.js} +1 -1
  47. package/dist/{index-BZAlqAaJ.js → index-Ci8tkzSn.js} +1 -1
  48. package/dist/{index-CAQpU5Rv.js → index-Cvbyv9Hx.js} +1 -1
  49. package/dist/{index-BSIUoSG3.js → index-D4HYMbSu.js} +3 -3
  50. package/dist/{index-CGHNWhkM.js → index-DRaETKbn.js} +5 -5
  51. package/dist/{index-Cibwzgac.js → index-M1SmasnI.js} +3 -3
  52. package/dist/{index-BMxu_XL-.js → index-UR1Lxi0C.js} +1 -1
  53. package/dist/{index-gcsOy_cD.js → index-g4L04WYz.js} +5 -5
  54. package/dist/{index.esm2017-Bs9CWbrs.js → index.esm2017-kvuav0Sd.js} +1 -1
  55. package/dist/{loading-Dj5bx8fg.js → loading-MNCADfHc.js} +4 -4
  56. package/dist/{membership-B2avlZoN.js → membership-CsbTF-DX.js} +3 -3
  57. package/dist/{money-CNSWtAf-.js → money-Lo7kavmu.js} +1 -1
  58. package/dist/{number-BA58pjU6.js → number-BviV2K5O.js} +1 -1
  59. package/dist/{rule-BWazFYuZ.js → rule-DKrUrnrM.js} +3 -3
  60. package/dist/{rule-builder-RIloDQBn.js → rule-builder-DjPniLk6.js} +1 -1
  61. package/dist/{template-u01r84LY.js → template-DteMEC9C.js} +4 -4
  62. package/dist/{usePagination--B6Wt7C1.js → usePagination-BKTq-UbV.js} +1 -1
  63. package/package.json +1 -1
  64. package/dist/Analytic-AqWU_lJy.js +0 -620
@@ -1,620 +0,0 @@
1
- import { defineComponent as L, openBlock as l, createElementBlock as h, Fragment as R, renderList as I, createElementVNode as a, toDisplayString as P, createCommentVNode as B, resolveComponent as k, createBlock as A, withCtx as T, createVNode as f, unref as n, ref as b, computed as G, onMounted as H, watch as Y, isRef as q, createSlots as ee, createTextVNode as te, reactive as ae, onBeforeMount as ne, normalizeClass as oe } from "vue";
2
- import { _ as le } from "./campaign-CpzFl8Vr.js";
3
- import { f as se } from "./number-BA58pjU6.js";
4
- import { C as ie, F as re, a as ce } from "./dto-CY7JrHkZ.js";
5
- import { useRouter as J } from "vue-router";
6
- import { c as M } from "./index-CgPlJqkX.js";
7
- import { _ as ue, Z as de } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
8
- import { J as me } from "./JsonViewer-v8_C7l5N.js";
9
- import { u as pe } from "./loading-Dj5bx8fg.js";
10
- import { useSnackbar as fe } from "@feedmepos/ui-library";
11
- import { u as ve } from "./app-wDQR6dpb.js";
12
- import { g as ye } from "./object-qECH92oz.js";
13
- import { u as ge } from "./campaign-CMb05XLt.js";
14
- import { u as _e } from "./membership-B2avlZoN.js";
15
- import { m as he } from "./index-BBBytzpn.js";
16
- const be = { class: "divide-x flex flex-wrap" }, xe = { class: "fm-typo-en-body-md-400 mb-2 text-fm-color-typo-secondary" }, Ce = { class: "fm-typo-en-title-sm-800" }, ke = /* @__PURE__ */ L({
17
- __name: "CampaignStat",
18
- props: {
19
- data: {
20
- type: Object,
21
- required: !0
22
- }
23
- },
24
- setup(m) {
25
- const O = m, i = [
26
- { label: "Credit Received", key: "CREDIT" },
27
- { label: "EXP Received", key: "POINT" },
28
- { label: "Points Received", key: "COIN" },
29
- { label: "Message Sent", key: "BROADCAST" },
30
- { label: "Vouchers Claimed", key: "VOUCHER" },
31
- { label: "Users Joined", key: "UNIQUE_USER" }
32
- ];
33
- function u(g) {
34
- var r;
35
- return se((r = O.data) == null ? void 0 : r[g], 2, !0) || 0;
36
- }
37
- return (g, r) => (l(), h("div", be, [
38
- (l(), h(R, null, I(i, (e) => (l(), h(R, null, [
39
- e.key in m.data ? (l(), h("div", {
40
- key: e.key,
41
- class: "px-16"
42
- }, [
43
- a("div", xe, P(e.label), 1),
44
- a("div", Ce, P(u(e.key)), 1)
45
- ])) : B("", !0)
46
- ], 64))), 64))
47
- ]));
48
- }
49
- }), Se = { 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" }, we = { class: "fm-typo-en-body-md-600 overflow-hidden select-none text-ellipsis text-fm-color-typo-secondary whitespace-nowrap" }, Fe = /* @__PURE__ */ L({
50
- __name: "CampaignChip",
51
- props: {
52
- type: { type: String, required: !0 },
53
- icon: {
54
- type: Object,
55
- default: () => ({ icon: "circle", color: "typo-sucess" })
56
- },
57
- label: {
58
- type: String,
59
- default: ""
60
- }
61
- },
62
- setup(m) {
63
- const i = ie[m.type];
64
- return (u, g) => {
65
- const r = k("FmIcon"), e = k("FmTooltip");
66
- return l(), A(e, {
67
- variant: "plain",
68
- placement: "top",
69
- content: m.label
70
- }, {
71
- default: T(() => [
72
- a("div", Se, [
73
- f(r, {
74
- name: n(i).icon,
75
- outline: "",
76
- size: "sm"
77
- }, null, 8, ["name"]),
78
- a("div", we, P(m.label), 1),
79
- f(r, {
80
- name: m.icon.name,
81
- color: m.icon.color,
82
- size: "sm"
83
- }, null, 8, ["name", "color"])
84
- ])
85
- ]),
86
- _: 1
87
- }, 8, ["content"]);
88
- };
89
- }
90
- }), Ve = { class: "flex flex-col" }, $e = { class: "flex flex-nowrap items-center justify-between mb-12" }, Ae = { class: "flex gap-4 items-center justify-start" }, Re = { class: "fm-typo-en-title-sm-800" }, Oe = { class: "flex flex-wrap gap-4 items-center mb-16 overflow-y-hidden" }, Ue = /* @__PURE__ */ L({
91
- __name: "CampaignGroup",
92
- props: {
93
- group: {
94
- type: Object,
95
- required: !0
96
- },
97
- onEdit: {
98
- type: Function,
99
- required: !0
100
- }
101
- },
102
- emits: ["changed"],
103
- setup(m, { emit: O }) {
104
- J(), b(!1);
105
- const i = m, u = b([]), g = G(
106
- () => u.value.reduce(
107
- (e, c) => ({ ...e, [c.type]: c.totalAmount }),
108
- {}
109
- )
110
- ), r = G(() => {
111
- var e;
112
- return ((e = i.group.pf_campaigns) == null ? void 0 : e.map((c) => ({
113
- campaign: c,
114
- label: c.name
115
- }))) || [];
116
- });
117
- return H(async () => {
118
- u.value = await M.readStats({
119
- groupId: i.group._id.toString()
120
- });
121
- }), (e, c) => {
122
- const s = k("FmButton"), o = k("FmCard");
123
- return l(), A(o, {
124
- class: "mb-24 p-24",
125
- variant: "outlined"
126
- }, {
127
- default: T(() => [
128
- a("div", Ve, [
129
- a("div", $e, [
130
- a("div", Ae, [
131
- a("div", Re, P(m.group.name), 1),
132
- f(s, {
133
- icon: "edit",
134
- variant: "tertiary",
135
- onClick: c[0] || (c[0] = (v) => m.onEdit(m.group))
136
- })
137
- ])
138
- ]),
139
- a("div", Oe, [
140
- (l(!0), h(R, null, I(n(r), (v) => (l(), A(Fe, {
141
- key: e.index,
142
- type: v.campaign.type,
143
- label: v.label
144
- }, null, 8, ["type", "label"]))), 128))
145
- ]),
146
- f(ke, { data: n(g) }, null, 8, ["data"])
147
- ])
148
- ]),
149
- _: 1
150
- });
151
- };
152
- }
153
- }), Ee = { class: "ml-32 flex flex-col" }, Pe = /* @__PURE__ */ L({
154
- __name: "CampaignCard",
155
- props: {
156
- title: {},
157
- items: {},
158
- modelValue: {}
159
- },
160
- emits: ["update:model-value"],
161
- setup(m, { emit: O }) {
162
- const i = m, u = O, g = (s) => {
163
- s ? c.value = i.items.map((o) => o.value) : c.value = [], e.value = s, u("update:model-value", c.value);
164
- }, r = (s) => {
165
- c.value = s, e.value = s.length === i.items.length, u("update:model-value", s);
166
- }, e = b(!1), c = b([]);
167
- return Y(
168
- () => i.modelValue,
169
- () => {
170
- c.value = i.modelValue.filter(
171
- (s) => i.items.find((o) => o.value === s)
172
- );
173
- }
174
- ), H(() => {
175
- c.value = i.modelValue.filter(
176
- (s) => i.items.find((o) => o.value === s)
177
- );
178
- }), (s, o) => {
179
- const v = k("FmCheckbox"), x = k("FmCard");
180
- return l(), A(x, {
181
- variant: "outlined",
182
- class: "p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3"
183
- }, {
184
- default: T(() => [
185
- f(v, {
186
- "model-value": n(e),
187
- value: "1",
188
- label: i.title,
189
- indeterminate: n(c).length > 0,
190
- "onUpdate:modelValue": g
191
- }, null, 8, ["model-value", "label", "indeterminate"]),
192
- a("div", Ee, [
193
- (l(!0), h(R, null, I(i.items, (_, S) => (l(), A(v, {
194
- key: S,
195
- "model-value": n(c),
196
- label: _.label,
197
- value: _.value,
198
- "onUpdate:modelValue": r
199
- }, null, 8, ["model-value", "label", "value"]))), 128))
200
- ])
201
- ]),
202
- _: 1
203
- });
204
- };
205
- }
206
- }), Be = { class: "space-y-16" }, Te = { class: "flex items-center" }, Ge = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary w-[300px]" }, Ie = { class: "space-y-[40px]" }, Me = /* @__PURE__ */ L({
207
- __name: "LinkCampaign",
208
- props: {
209
- modelValue: {
210
- type: Array,
211
- required: !0
212
- },
213
- campaigns: {
214
- type: Object,
215
- required: !0
216
- }
217
- },
218
- emits: ["update:model-value"],
219
- setup(m, { emit: O }) {
220
- const i = b(""), u = b([]), g = m, r = O, e = G(() => Object.entries(g.campaigns).reduce((s, [o, v]) => {
221
- const x = v.filter(
222
- (_) => _.label.toLowerCase().includes(i.value.toLowerCase())
223
- );
224
- return x.length > 0 && (s[o] = x), s;
225
- }, {}));
226
- function c(s, o) {
227
- u.value = u.value.filter(
228
- (v) => !o.map((x) => x.value).includes(v)
229
- ), u.value = [.../* @__PURE__ */ new Set([...u.value, ...s])], r("update:model-value", u.value);
230
- }
231
- return H(() => {
232
- u.value = g.modelValue;
233
- }), (s, o) => {
234
- const v = k("FmTextField");
235
- return l(), h(R, null, [
236
- f(me, { json: m.campaigns }, null, 8, ["json"]),
237
- a("div", Be, [
238
- a("div", Te, [
239
- a("div", Ge, P(n(u).length) + " campaign(s) linked ", 1),
240
- f(v, {
241
- modelValue: n(i),
242
- "onUpdate:modelValue": o[0] || (o[0] = (x) => q(i) ? i.value = x : null),
243
- "prepend-icon": "search",
244
- placeholder: "Search",
245
- class: "w-full"
246
- }, null, 8, ["modelValue"])
247
- ]),
248
- a("div", Ie, [
249
- (l(!0), h(R, null, I(n(e), (x, _) => (l(), A(Pe, {
250
- "model-value": n(u),
251
- title: _,
252
- items: x,
253
- "onUpdate:modelValue": (S) => c(S, x)
254
- }, null, 8, ["model-value", "title", "items", "onUpdate:modelValue"]))), 256))
255
- ])
256
- ])
257
- ], 64);
258
- };
259
- }
260
- }), Le = { class: "flex items-center gap-x-8" }, je = {
261
- key: 0,
262
- class: "space-y-16 pr-12"
263
- }, De = /* @__PURE__ */ a("div", { class: "fm-typo-en-title-sm-800" }, "Group detail", -1), Ne = /* @__PURE__ */ a("div", { class: "fm-typo-en-title-sm-800" }, "Link campaign", -1), qe = { class: "flex items-center gap-x-16" }, He = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ze = { class: "mt-16" }, Ke = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600 py-8 px-16 bg-gray-100" }, Je = { class: "flex justify-between items-center py-8 px-16 border-b-1" }, We = { class: "flex items-center gap-8" }, Ze = /* @__PURE__ */ L({
264
- __name: "AnalyticSheet",
265
- emits: ["success"],
266
- setup(m, { expose: O, emit: i }) {
267
- const u = i, g = ve();
268
- fe();
269
- const r = b(!1), e = b(!1), c = {
270
- name: "",
271
- campaigns: []
272
- }, s = b(""), o = b({ ...c }), v = re.superRefine((d, t) => {
273
- }), x = b([]), _ = b(null), { global: S, minor: w } = pe, p = G(() => {
274
- const d = v.safeParse(o.value);
275
- return d.success ? [] : d.error.errors;
276
- });
277
- function U(d) {
278
- var t;
279
- r.value = !0, d ? (_.value = { ...d }, o.value = { ...d, campaigns: (t = d.pf_campaigns) == null ? void 0 : t.map((y) => y._id) }) : (_.value = null, o.value = { ...c });
280
- }
281
- function $() {
282
- r.value = !1, _.value = null;
283
- }
284
- function F() {
285
- e.value = !0;
286
- }
287
- async function j() {
288
- const d = await M.readAll({
289
- limit: 1e3,
290
- skip: 0,
291
- sortBy: "_id",
292
- search: "",
293
- descending: !0
294
- });
295
- x.value = d.resources.filter(
296
- (t) => !["MEMBERSHIP", "REWARD_POOL"].includes(t.type) && !["ISSUE_REWARD"].includes("event" in t ? t == null ? void 0 : t.event.type : "")
297
- );
298
- }
299
- const V = G(() => {
300
- const d = (y) => y.map((E) => ({
301
- label: E.name,
302
- value: E._id
303
- }));
304
- return ye(
305
- x.value,
306
- (y) => ce.formattedType(y.type),
307
- d
308
- );
309
- }), z = G(() => Object.entries(V.value).reduce(
310
- (d, [t, y]) => {
311
- const E = y.filter((D) => {
312
- var N, C;
313
- return (C = (N = o.value) == null ? void 0 : N.campaigns) == null ? void 0 : C.includes(D.value);
314
- }).filter(
315
- (D) => D.label.toLowerCase().includes(s.value.toLowerCase())
316
- );
317
- return E.length > 0 && (d[t] = E), d;
318
- },
319
- {}
320
- ));
321
- function W(d) {
322
- var y, E;
323
- const t = (y = o.value.campaigns) == null ? void 0 : y.indexOf(d);
324
- t != null && t > -1 && ((E = o.value.campaigns) == null || E.splice(t, 1));
325
- }
326
- async function Z() {
327
- v.safeParse(o.value).success && await w(
328
- async () => {
329
- var t;
330
- _.value ? await M.updateGroup(
331
- (t = _.value) == null ? void 0 : t._id,
332
- o.value
333
- ) : await M.createGroup(o.value), u("success"), $();
334
- },
335
- {
336
- message: "Saving group",
337
- successMessage: "Group saved"
338
- }
339
- );
340
- }
341
- async function Q() {
342
- await w(
343
- async () => {
344
- var d;
345
- await M.deleteGroup((d = _.value) == null ? void 0 : d._id), u("success"), $();
346
- },
347
- {
348
- message: "Deleting group",
349
- successMessage: "Group deleted"
350
- }
351
- );
352
- }
353
- return H(async () => {
354
- await j();
355
- }), O({
356
- showSheet: U,
357
- hideSheet: $
358
- }), (d, t) => {
359
- const y = k("FmButton"), E = k("FmTextField"), D = k("FmList"), N = k("FmSideSheet");
360
- return l(), A(N, {
361
- modelValue: n(r),
362
- "onUpdate:modelValue": t[7] || (t[7] = (C) => q(r) ? r.value = C : null),
363
- header: n(_) ? "Edit group" : "Add group",
364
- "dismiss-away": "",
365
- "close-button": !0,
366
- "max-width": 550
367
- }, ee({
368
- "side-sheet-footer": T(() => [
369
- a("div", We, [
370
- n(e) ? B("", !0) : (l(), h(R, { key: 0 }, [
371
- f(y, {
372
- label: "Submit",
373
- onClick: Z,
374
- disabled: n(p).length > 0 || n(g).isLoading
375
- }, null, 8, ["disabled"]),
376
- f(y, {
377
- label: "Cancel",
378
- onClick: t[4] || (t[4] = (C) => $()),
379
- variant: "tertiary"
380
- }),
381
- n(_) ? (l(), A(y, {
382
- key: 0,
383
- label: "Delete",
384
- variant: "plain",
385
- class: "ml-auto fm-color-system-error-300",
386
- onClick: t[5] || (t[5] = (C) => Q())
387
- })) : B("", !0)
388
- ], 64)),
389
- n(e) ? (l(), A(y, {
390
- key: 1,
391
- label: "Confirm",
392
- onClick: t[6] || (t[6] = (C) => e.value = !1)
393
- })) : B("", !0)
394
- ])
395
- ]),
396
- default: T(() => [
397
- n(e) ? B("", !0) : (l(), h("div", je, [
398
- De,
399
- f(ue, {
400
- modelValue: n(o).name,
401
- "onUpdate:modelValue": t[1] || (t[1] = (C) => n(o).name = C),
402
- label: "Name",
403
- schema: n(de).typeAtPath(n(v), "name")
404
- }, null, 8, ["modelValue", "schema"]),
405
- Ne,
406
- a("div", qe, [
407
- a("div", He, P(n(o).campaigns.length) + " campaign(s) linked ", 1),
408
- f(E, {
409
- modelValue: n(s),
410
- "onUpdate:modelValue": t[2] || (t[2] = (C) => q(s) ? s.value = C : null),
411
- "prepend-icon": "search",
412
- placeholder: "Search",
413
- class: "w-auto"
414
- }, null, 8, ["modelValue"])
415
- ]),
416
- f(y, {
417
- variant: "plain",
418
- icon: "link",
419
- label: "Link Campaign",
420
- onClick: F
421
- })
422
- ])),
423
- n(e) ? (l(), A(Me, {
424
- key: 1,
425
- modelValue: n(o).campaigns,
426
- "onUpdate:modelValue": t[3] || (t[3] = (C) => n(o).campaigns = C),
427
- campaigns: n(V)
428
- }, null, 8, ["modelValue", "campaigns"])) : B("", !0),
429
- a("div", ze, [
430
- n(e) ? B("", !0) : (l(!0), h(R, { key: 0 }, I(n(z), (C, X) => (l(), h("div", null, [
431
- a("div", Ke, P(X), 1),
432
- f(D, { separator: !0 }, {
433
- default: T(() => [
434
- (l(!0), h(R, null, I(C, (K) => (l(), h("div", Je, [
435
- a("div", null, P(K.label), 1),
436
- a("div", null, [
437
- f(y, {
438
- icon: "delete",
439
- onClick: (rt) => W(K.value),
440
- variant: "tertiary"
441
- }, null, 8, ["onClick"])
442
- ])
443
- ]))), 256))
444
- ]),
445
- _: 2
446
- }, 1024)
447
- ]))), 256))
448
- ])
449
- ]),
450
- _: 2
451
- }, [
452
- n(e) ? {
453
- name: "side-sheet-header",
454
- fn: T(() => [
455
- a("div", Le, [
456
- f(y, {
457
- icon: "arrow_back",
458
- variant: "tertiary",
459
- onClick: t[0] || (t[0] = (C) => e.value = !1)
460
- }),
461
- te("Link campaign ")
462
- ])
463
- ]),
464
- key: "0"
465
- } : void 0
466
- ]), 1032, ["modelValue", "header"]);
467
- };
468
- }
469
- }), Qe = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Xe = { class: "space-y-16" }, Ye = { class: "flex items-center justify-end" }, et = /* @__PURE__ */ a("div", { class: "fm-typo-en-body-lg-600" }, "Connect summary", -1), tt = { class: "grid grid-cols-4 xs:grid-cols-2 gap-4 divide-x xs:divide-x-0" }, at = { class: "fm-typo-body-md-400 fm-typo-en-body-md-400 mb-2 text-fm-color-typo-secondary" }, nt = { class: "fm-typo-en-title-sm-800" }, ot = /* @__PURE__ */ a("img", {
470
- src: le,
471
- class: "w-[150px]"
472
- }, null, -1), lt = /* @__PURE__ */ a("div", { class: "fm-typo-en-title-sm-800 text-center" }, " Create campaign group to track performance ", -1), st = /* @__PURE__ */ a("div", { class: "fm-typo-body-en-md-400 text-center text-fm-color-typo-secondary" }, " Start organizing your campaigns and promotions by creating groups. Groups allow you to aggregate performance metrics across multiple vouchers, promotions, or other rewards. ", -1), it = { class: "flex gap-16 items-center" }, St = /* @__PURE__ */ L({
473
- __name: "Analytic",
474
- setup(m) {
475
- const O = {
476
- label: "Add group",
477
- value: "create",
478
- isPrimary: !0,
479
- prependIcon: "add"
480
- }, i = ge(), u = b(), g = b([]), r = b(""), e = ae({
481
- totalCampaign: 0,
482
- totalProgram: 0,
483
- totalMember: 0
484
- }), c = b("1"), s = [
485
- {
486
- key: "Total campaign",
487
- value: () => e.totalCampaign
488
- },
489
- {
490
- key: "Total Program",
491
- value: () => e.totalProgram
492
- },
493
- {
494
- key: "Total Member",
495
- value: () => e.totalMember
496
- }
497
- ];
498
- function o(w) {
499
- var p;
500
- c.value = (/* @__PURE__ */ new Date()).toISOString(), (p = u.value) == null || p.showSheet(w);
501
- }
502
- async function v() {
503
- await i.readGroups();
504
- const w = await M.readAllGrouped({
505
- limit: 100,
506
- skip: 0,
507
- sortBy: "_id",
508
- search: "",
509
- descending: !0
510
- });
511
- g.value = w.resources;
512
- }
513
- async function x() {
514
- var U, $;
515
- const w = await he.read({
516
- limit: 1,
517
- skip: 0,
518
- sortBy: "_id",
519
- search: "",
520
- descending: !1
521
- }), p = await M.readAll({
522
- limit: 1e3,
523
- skip: 0,
524
- sortBy: "_id",
525
- search: "",
526
- descending: !1
527
- });
528
- e.totalCampaign = ((U = p.resources) == null ? void 0 : U.filter(
529
- (F) => ["PROMOTION", "VOUCHER", "BROADCAST"].includes(F.type) && !["ISSUE_REWARD"].includes("event" in F ? F == null ? void 0 : F.event.type : "")
530
- ).length) ?? 0, e.totalProgram = (($ = p.resources) == null ? void 0 : $.filter(
531
- (F) => ["POINT", "COIN", "CREDIT", "GAME"].includes(F.type)
532
- ).length) ?? 0, e.totalMember = w.meta.totalResources ?? 0;
533
- }
534
- const _ = G(() => g.value.filter((w) => {
535
- var p;
536
- return w.name.includes(r.value) || ((p = w.pf_campaigns) == null ? void 0 : p.filter((U) => U.name.includes(r.value)).length);
537
- })), S = _e();
538
- return J(), b(!0), G(() => {
539
- var w, p, U, $;
540
- return !S.storeOption || !S.storeOption.company ? -1 : !S.payoutAccount || !S.payoutAccount.enable || S.payoutAccount.status != "APPROVED" ? 0 : (p = (w = S.store) == null ? void 0 : w.categories) != null && p.length ? ($ = (U = S.store) == null ? void 0 : U.categories) != null && $.some(
541
- (F) => F.bundles.some((j) => j.isFeedvibe)
542
- ) ? 3 : 2 : 1;
543
- }), ne(async () => {
544
- await v(), await x(), await S.readMemberStore(), await S.readMembership(), await S.readPayoutAccount();
545
- }), (w, p) => {
546
- const U = k("FmPageHead"), $ = k("FmSearch"), F = k("FmCard"), j = k("FmButton");
547
- return k("FmIcon"), l(), h(R, null, [
548
- f(U, {
549
- title: "Analytic",
550
- actions: n(g).length > 0 ? [O] : [],
551
- "onClick:action": p[0] || (p[0] = (V) => o())
552
- }, null, 8, ["actions"]),
553
- a("div", Qe, [
554
- a("div", Xe, [
555
- a("div", Ye, [
556
- f($, {
557
- class: "xs:hidden",
558
- modelValue: n(r),
559
- "onUpdate:modelValue": p[1] || (p[1] = (V) => q(r) ? r.value = V : null),
560
- placeholder: "Search",
561
- collapsible: ""
562
- }, null, 8, ["modelValue"])
563
- ]),
564
- f(F, {
565
- variant: "outlined",
566
- class: "flex flex-col gap-16 p-16"
567
- }, {
568
- default: T(() => [
569
- et,
570
- a("div", tt, [
571
- (l(), h(R, null, I(s, (V, z) => a("div", {
572
- key: V.key,
573
- class: oe(["px-8", { "xs:!border-r": z % 2 == 0 }])
574
- }, [
575
- a("div", at, P(V.key), 1),
576
- a("div", nt, P(V.value()), 1)
577
- ], 2)), 64))
578
- ])
579
- ]),
580
- _: 1
581
- })
582
- ]),
583
- B("", !0),
584
- n(g).length ? B("", !0) : (l(), A(F, {
585
- key: 1,
586
- variant: "outlined",
587
- class: "flex flex-col gap-y-24 items-center p-16"
588
- }, {
589
- default: T(() => [
590
- ot,
591
- lt,
592
- st,
593
- a("div", it, [
594
- f(j, {
595
- label: "Create group",
596
- icon: "add",
597
- onClick: p[3] || (p[3] = (V) => o())
598
- })
599
- ])
600
- ]),
601
- _: 1
602
- })),
603
- (l(!0), h(R, null, I(n(_), (V) => (l(), A(Ue, {
604
- key: V._id.toString(),
605
- group: V,
606
- "on-edit": o
607
- }, null, 8, ["group"]))), 128)),
608
- f(Ze, {
609
- ref_key: "sheetRef",
610
- ref: u,
611
- onSuccess: v
612
- }, null, 512)
613
- ])
614
- ], 64);
615
- };
616
- }
617
- });
618
- export {
619
- St as default
620
- };