@feedmepos/mf-connect 0.1.0-beta.6 → 0.1.0-beta.61

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 (119) hide show
  1. package/dist/Analytic-u9mtlxSv.js +427 -0
  2. package/dist/{App-C2616cfr.js → App-BwTQE7Ft.js} +445 -420
  3. package/dist/AuditLogs-BVMRclSw.js +1886 -0
  4. package/dist/Bin-Cca-XOkz.js +166 -0
  5. package/dist/{Broadcast-CqSwLTAq.js → Broadcast-DRQgpwdP.js} +56 -54
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DrR9Pmtb.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CeUu_T1u.js} +6 -8
  7. package/dist/Card-CnbB_u31.js +896 -0
  8. package/dist/Collections-BjlfOSC3.js +459 -0
  9. package/dist/{Credit-CPcLgnsq.js → Credit-BoElrcx9.js} +36 -34
  10. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +108 -0
  11. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +58 -0
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-B3WVwem6.js +2181 -0
  13. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-D2buK6Dj.js → EffectSheet.vue_vue_type_style_index_0_lang-CGfpziKs.js} +18 -18
  14. package/dist/{Experience-BoBikt-x.js → Experience-SdGBf4vU.js} +32 -30
  15. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js +118 -0
  16. package/dist/{Game-DR8PyYZa.js → Game-ChLHibpB.js} +39 -37
  17. package/dist/Index-D7Kq6uyf.js +259 -0
  18. package/dist/Marketing-BDajIqR_.js +20071 -0
  19. package/dist/Member-BPZryqWL.js +317 -0
  20. package/dist/MemberList-C52Dop8Z.js +1598 -0
  21. package/dist/MemberTransactions-DHU78kgS.js +45 -0
  22. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DhtIZCjT.js → MessageInput.vue_vue_type_script_setup_true_lang-js1F2E4N.js} +83 -71
  23. package/dist/{Mission-CMpvz9zN.js → Mission-BQR3qjAu.js} +101 -87
  24. package/dist/Overview-BbLYWXjG.js +1078 -0
  25. package/dist/{Point-DkZn6p9s.js → Point-DbTcWJbQ.js} +55 -53
  26. package/dist/{Promotion-B7YzwPc_.js → Promotion-CIrpWBQD.js} +65 -57
  27. package/dist/Queue-B0Mfq2Vn.js +244 -0
  28. package/dist/Record-Z6ZrJeLc.js +340 -0
  29. package/dist/Reward-D6k0QFQA.js +442 -0
  30. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-GJ6j_jOh.js +150 -0
  31. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-gQxmX9ur.js +1637 -0
  32. package/dist/Segment-D6MF-EO8.js +568 -0
  33. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BWG-pz6F.js +181 -0
  34. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-HgorlHNz.js +147 -0
  35. package/dist/Setting--OFDS95z.js +1931 -0
  36. package/dist/Store-BqlRTC-c.js +1751 -0
  37. package/dist/{StoreRewards-6BzVwZqr.js → StoreRewards-BTu0IdDN.js} +33 -32
  38. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BX053DJA.js +943 -0
  39. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-B6cAveco.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BAkuqLwy.js} +1 -1
  40. package/dist/{Tier-CW-46oJS.js → Tier-CE9LYAEX.js} +327 -318
  41. package/dist/{Title-CE9rWVdi.js → Title-DOOASUMI.js} +199 -184
  42. package/dist/{Transaction-B21RrC4M.js → Transaction-DPxUOBP-.js} +2 -2
  43. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-CKwf0F_i.js +130 -0
  44. package/dist/Voucher-D69DD02z.js +354 -0
  45. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-CFL0Nsez.js +419 -0
  46. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BiVZwBuG.js → ZodTextField.vue_vue_type_script_setup_true_lang-Byh6_EJM.js} +1 -1
  47. package/dist/app-C2u1t47T.js +7059 -0
  48. package/dist/app-DgfmbHZe.js +33357 -0
  49. package/dist/app.js +1 -1
  50. package/dist/{business-aHhRUXc0.js → business-BqCJB_vA.js} +1 -1
  51. package/dist/{campaign-DH9NUNf_.js → campaign-CWMPCmmU.js} +2 -2
  52. package/dist/campaign-D0dTbl5b.js +1810 -0
  53. package/dist/campaign.enum-DhE8N4pA.js +20 -0
  54. package/dist/campaign.fn-BpO-RQih.js +758 -0
  55. package/dist/collectible.enum-rWEc6Tsw.js +19 -0
  56. package/dist/{collection.fn-CYlsA-kW.js → collection.fn-biX2iFDQ.js} +2 -2
  57. package/dist/dto-3m7xZwfI.js +214 -0
  58. package/dist/{effect-LSc9YanX.js → effect-ZMGRxKCZ.js} +9 -9
  59. package/dist/email-addresses-lgY03bkq.js +705 -0
  60. package/dist/{export-Cf0-C5Ly.js → export-BOzeYUy8.js} +5 -5
  61. package/dist/{helper-CiZpeMCM.js → helper-CO29wun4.js} +1 -1
  62. package/dist/index-B3V7krW_.js +29000 -0
  63. package/dist/index-BVbiAxW8.js +115 -0
  64. package/dist/{index-D_83JP2i.js → index-Bvch9tuP.js} +48 -4
  65. package/dist/index-CYOwwy3h.js +44 -0
  66. package/dist/{index-D6cEOHP4.js → index-CbYXYVYp.js} +1501 -1480
  67. package/dist/{index-DtsDOuDx.js → index-ChrOXJDq.js} +24 -21
  68. package/dist/index-CsaQJMAR.js +66 -0
  69. package/dist/index-DNGenFnf.js +32 -0
  70. package/dist/{index-BVb5-Ht8.js → index-Dd22X409.js} +259 -173
  71. package/dist/{index-kPhrD63q.js → index-LYAWIqjk.js} +1 -1
  72. package/dist/index-Xh9cW6Y9.js +54 -0
  73. package/dist/{index-gxwjKu3-.js → index-XhqaicYu.js} +2212 -871
  74. package/dist/{index-DW3PRjPL.js → index-YsC4VklJ.js} +1 -1
  75. package/dist/index-vh86FiIQ.js +10 -0
  76. package/dist/{index.esm2017-B7oVYIbY.js → index.esm2017-CJ1flA6S.js} +121 -121
  77. package/dist/loading-CUs_CN1k.js +71 -0
  78. package/dist/{membership-Dw1ylJ9Y.js → membership-D-GVacos.js} +54 -46
  79. package/dist/money-CMtSALkX.js +15 -0
  80. package/dist/number-CDwwgAYM.js +12 -0
  81. package/dist/objectid-Bf9yKD81.js +145 -0
  82. package/dist/{loading-7yq1tinq.js → plugins-9sQTEyth.js} +3871 -3943
  83. package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
  84. package/dist/reward-DblXGhWc.js +36 -0
  85. package/dist/{rule-C0Q_SHow.js → rule-Cy8cTzuw.js} +180 -177
  86. package/dist/{rule-builder-iu17XIof.js → rule-builder-Cn5vZgFN.js} +1 -1
  87. package/dist/style.css +1 -1
  88. package/dist/{template-CyOanTMu.js → template-Cal94dUy.js} +5 -5
  89. package/dist/trigger-C1nwLSP8.js +144 -0
  90. package/dist/user-ir4Rn5bP.js +54 -0
  91. package/dist/{vue-i18n-B0fLJH7a.js → vue-i18n-eOHBBaH5.js} +243 -243
  92. package/dist/{xlsx-BYO_bB9J.js → xlsx-DulnT75_.js} +1 -1
  93. package/package.json +11 -7
  94. package/dist/Analytic-muDf0oMG.js +0 -622
  95. package/dist/Card-bhLoK0ZV.js +0 -825
  96. package/dist/Collections-DjtsAiol.js +0 -453
  97. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-U_QZneS6.js +0 -2813
  98. package/dist/Marketing-Dny2nMUl.js +0 -316
  99. package/dist/Member-CP_smyk8.js +0 -69
  100. package/dist/MemberList-CR3eYI9p.js +0 -1733
  101. package/dist/MemberTransactions-RTx_lKFb.js +0 -38
  102. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Cs67_GLE.js +0 -1753
  103. package/dist/Segment-Bb4gHt5V.js +0 -437
  104. package/dist/Setting-Xj0AVzh3.js +0 -1901
  105. package/dist/Store-BWRHQ6Ie.js +0 -1511
  106. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BsFnT8BS.js +0 -890
  107. package/dist/Voucher-KK9fBI0u.js +0 -490
  108. package/dist/app-CjhXHUQv.js +0 -53428
  109. package/dist/app-Dvf_JNMf.js +0 -5764
  110. package/dist/dto-DArfyZAI.js +0 -2770
  111. package/dist/index-Bi_LGEtY.js +0 -99
  112. package/dist/index-CiQDG7Cm.js +0 -762
  113. package/dist/index-CuvNtC_M.js +0 -61
  114. package/dist/index-DQfjSSMF.js +0 -206
  115. package/dist/index-DcxssxPi.js +0 -29193
  116. package/dist/index-DqJVH2kv.js +0 -298
  117. package/dist/money-CPd0XTNv.js +0 -15
  118. package/dist/number-BgXY4un8.js +0 -12
  119. package/dist/user-Bm4KttFq.js +0 -37
@@ -0,0 +1,427 @@
1
+ import { defineComponent as j, ref as y, watch as X, onMounted as I, resolveComponent as x, openBlock as d, createBlock as A, withCtx as L, createVNode as h, unref as t, createElementVNode as i, createElementBlock as k, Fragment as $, renderList as D, computed as G, toDisplayString as O, isRef as T, createSlots as Y, createCommentVNode as V, createTextVNode as ee, reactive as te, onBeforeMount as ae } from "vue";
2
+ import { _ as le } from "./campaign-CpzFl8Vr.js";
3
+ import "./index-B3V7krW_.js";
4
+ import "./campaign-D0dTbl5b.js";
5
+ import { useRouter as ne } from "vue-router";
6
+ import { c as R } from "./index-BVbiAxW8.js";
7
+ import { _ as oe } from "./ZodTextField.vue_vue_type_script_setup_true_lang-Byh6_EJM.js";
8
+ import { Z as se } from "./zod-Bg2FbC-D.js";
9
+ import { F as re } from "./dto-3m7xZwfI.js";
10
+ import { J as ie } from "./JsonViewer-v8_C7l5N.js";
11
+ import "./plugins-9sQTEyth.js";
12
+ import { useSnackbar as ue } from "@feedmepos/ui-library";
13
+ import { u as ce } from "./app-wDQR6dpb.js";
14
+ import { u as me } from "./loading-CUs_CN1k.js";
15
+ import { C as de } from "./campaign.fn-BpO-RQih.js";
16
+ import { g as pe } from "./object-qECH92oz.js";
17
+ import { u as ve } from "./campaign-CWMPCmmU.js";
18
+ import { u as fe } from "./membership-D-GVacos.js";
19
+ import { u as ye } from "./vue-i18n-eOHBBaH5.js";
20
+ const ge = { class: "ml-32 flex flex-col" }, _e = /* @__PURE__ */ j({
21
+ __name: "CampaignCard",
22
+ props: {
23
+ title: {},
24
+ items: {},
25
+ modelValue: {}
26
+ },
27
+ emits: ["update:model-value"],
28
+ setup(U, { emit: b }) {
29
+ const c = U, v = b, S = (o) => {
30
+ o ? p.value = c.items.map((a) => a.value) : p.value = [], r.value = o, v("update:model-value", p.value);
31
+ }, g = (o) => {
32
+ p.value = o, r.value = o.length === c.items.length, v("update:model-value", o);
33
+ }, r = y(!1), p = y([]);
34
+ return X(
35
+ () => c.modelValue,
36
+ () => {
37
+ p.value = c.modelValue.filter(
38
+ (o) => c.items.find((a) => a.value === o)
39
+ );
40
+ }
41
+ ), I(() => {
42
+ p.value = c.modelValue.filter(
43
+ (o) => c.items.find((a) => a.value === o)
44
+ );
45
+ }), (o, a) => {
46
+ const _ = x("FmCheckbox"), n = x("FmCard");
47
+ return d(), A(n, {
48
+ variant: "outlined",
49
+ class: "p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3"
50
+ }, {
51
+ default: L(() => [
52
+ h(_, {
53
+ "model-value": t(r),
54
+ value: "1",
55
+ label: c.title,
56
+ indeterminate: t(p).length > 0,
57
+ "onUpdate:modelValue": S
58
+ }, null, 8, ["model-value", "label", "indeterminate"]),
59
+ i("div", ge, [
60
+ (d(!0), k($, null, D(c.items, (l, u) => (d(), A(_, {
61
+ key: u,
62
+ "model-value": t(p),
63
+ label: l.label,
64
+ value: l.value,
65
+ "onUpdate:modelValue": g
66
+ }, null, 8, ["model-value", "label", "value"]))), 128))
67
+ ])
68
+ ]),
69
+ _: 1
70
+ });
71
+ };
72
+ }
73
+ }), he = { class: "space-y-16" }, be = { class: "flex items-center" }, xe = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary w-[300px]" }, Ce = { class: "space-y-[40px]" }, ke = /* @__PURE__ */ j({
74
+ __name: "LinkCampaign",
75
+ props: {
76
+ modelValue: {
77
+ type: Array,
78
+ required: !0
79
+ },
80
+ campaigns: {
81
+ type: Object,
82
+ required: !0
83
+ }
84
+ },
85
+ emits: ["update:model-value"],
86
+ setup(U, { emit: b }) {
87
+ const c = y(""), v = y([]), S = U, g = b, r = G(() => Object.entries(S.campaigns).reduce((o, [a, _]) => {
88
+ const n = _.filter(
89
+ (l) => l.label.toLowerCase().includes(c.value.toLowerCase())
90
+ );
91
+ return n.length > 0 && (o[a] = n), o;
92
+ }, {}));
93
+ function p(o, a) {
94
+ v.value = v.value.filter(
95
+ (_) => !a.map((n) => n.value).includes(_)
96
+ ), v.value = [.../* @__PURE__ */ new Set([...v.value, ...o])], g("update:model-value", v.value);
97
+ }
98
+ return I(() => {
99
+ v.value = S.modelValue;
100
+ }), (o, a) => {
101
+ const _ = x("FmTextField");
102
+ return d(), k($, null, [
103
+ h(ie, { json: U.campaigns }, null, 8, ["json"]),
104
+ i("div", he, [
105
+ i("div", be, [
106
+ i("div", xe, O(t(v).length) + " campaign(s) linked ", 1),
107
+ h(_, {
108
+ modelValue: t(c),
109
+ "onUpdate:modelValue": a[0] || (a[0] = (n) => T(c) ? c.value = n : null),
110
+ "prepend-icon": "search",
111
+ placeholder: "Search",
112
+ class: "w-full"
113
+ }, null, 8, ["modelValue"])
114
+ ]),
115
+ i("div", Ce, [
116
+ (d(!0), k($, null, D(t(r), (n, l) => (d(), A(_e, {
117
+ "model-value": t(v),
118
+ title: l,
119
+ items: n,
120
+ "onUpdate:modelValue": (u) => p(u, n)
121
+ }, null, 8, ["model-value", "title", "items", "onUpdate:modelValue"]))), 256))
122
+ ])
123
+ ])
124
+ ], 64);
125
+ };
126
+ }
127
+ }), Ve = { class: "flex items-center gap-x-8" }, Se = {
128
+ key: 0,
129
+ class: "space-y-16 pr-12"
130
+ }, we = { class: "flex items-center gap-x-16" }, Fe = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ae = { class: "mt-16" }, $e = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600 py-8 px-16 bg-gray-100" }, Ue = { class: "flex justify-between items-center py-8 px-16 border-b-1" }, Pe = { class: "flex items-center gap-8" }, Le = /* @__PURE__ */ j({
131
+ __name: "AnalyticSheet",
132
+ emits: ["success"],
133
+ setup(U, { expose: b, emit: c }) {
134
+ const v = c, S = ce();
135
+ ue();
136
+ const g = y(!1), r = y(!1), p = {
137
+ name: "",
138
+ campaigns: []
139
+ }, o = y(""), a = y({ ...p }), _ = re.superRefine((s, e) => {
140
+ }), n = y([]), l = y(null), { global: u, minor: w } = me, P = G(() => {
141
+ const s = _.safeParse(a.value);
142
+ return s.success ? [] : s.error.errors;
143
+ });
144
+ function M(s) {
145
+ var e;
146
+ g.value = !0, s ? (l.value = { ...s }, a.value = { ...s, campaigns: (e = s.pf_campaigns) == null ? void 0 : e.map((m) => m._id) }) : (l.value = null, a.value = { ...p });
147
+ }
148
+ function F() {
149
+ g.value = !1, l.value = null;
150
+ }
151
+ function K() {
152
+ r.value = !0;
153
+ }
154
+ async function W() {
155
+ const s = await R.readAll({
156
+ limit: 1e3,
157
+ skip: 0,
158
+ sortBy: "_id",
159
+ search: "",
160
+ descending: !0
161
+ });
162
+ n.value = s.resources.filter(
163
+ (e) => !["MEMBERSHIP", "REWARD_POOL"].includes(e.type) && !["ISSUE_REWARD"].includes("event" in e ? e == null ? void 0 : e.event.type : "")
164
+ );
165
+ }
166
+ const N = G(() => {
167
+ const s = (m) => m.map((C) => ({
168
+ label: C.name,
169
+ value: C._id
170
+ }));
171
+ return pe(
172
+ n.value,
173
+ (m) => de.formattedType(m.type),
174
+ s
175
+ );
176
+ }), q = G(() => Object.entries(N.value).reduce(
177
+ (s, [e, m]) => {
178
+ const C = m.filter((B) => {
179
+ var E, f;
180
+ return (f = (E = a.value) == null ? void 0 : E.campaigns) == null ? void 0 : f.includes(B.value);
181
+ }).filter(
182
+ (B) => B.label.toLowerCase().includes(o.value.toLowerCase())
183
+ );
184
+ return C.length > 0 && (s[e] = C), s;
185
+ },
186
+ {}
187
+ ));
188
+ function J(s) {
189
+ var m, C;
190
+ const e = (m = a.value.campaigns) == null ? void 0 : m.indexOf(s);
191
+ e != null && e > -1 && ((C = a.value.campaigns) == null || C.splice(e, 1));
192
+ }
193
+ async function Z() {
194
+ _.safeParse(a.value).success && await w(
195
+ async () => {
196
+ var e;
197
+ l.value ? await R.updateGroup(
198
+ (e = l.value) == null ? void 0 : e._id,
199
+ a.value
200
+ ) : await R.createGroup(a.value), v("success"), F();
201
+ },
202
+ {
203
+ message: "Saving group",
204
+ successMessage: "Group saved"
205
+ }
206
+ );
207
+ }
208
+ async function z() {
209
+ await w(
210
+ async () => {
211
+ var s;
212
+ await R.deleteGroup((s = l.value) == null ? void 0 : s._id), v("success"), F();
213
+ },
214
+ {
215
+ message: "Deleting group",
216
+ successMessage: "Group deleted"
217
+ }
218
+ );
219
+ }
220
+ return I(async () => {
221
+ await W();
222
+ }), b({
223
+ showSheet: M,
224
+ hideSheet: F
225
+ }), (s, e) => {
226
+ const m = x("FmButton"), C = x("FmTextField"), B = x("FmList"), E = x("FmSideSheet");
227
+ return d(), A(E, {
228
+ modelValue: t(g),
229
+ "onUpdate:modelValue": e[7] || (e[7] = (f) => T(g) ? g.value = f : null),
230
+ header: t(l) ? "Edit group" : "Add group",
231
+ "dismiss-away": "",
232
+ "close-button": !0,
233
+ "max-width": 550
234
+ }, Y({
235
+ "side-sheet-footer": L(() => [
236
+ i("div", Pe, [
237
+ t(r) ? V("", !0) : (d(), k($, { key: 0 }, [
238
+ h(m, {
239
+ label: "Submit",
240
+ onClick: Z,
241
+ disabled: t(P).length > 0 || t(S).isLoading
242
+ }, null, 8, ["disabled"]),
243
+ h(m, {
244
+ label: "Cancel",
245
+ onClick: e[4] || (e[4] = (f) => F()),
246
+ variant: "tertiary"
247
+ }),
248
+ t(l) ? (d(), A(m, {
249
+ key: 0,
250
+ label: "Delete",
251
+ variant: "plain",
252
+ class: "ml-auto fm-color-system-error-300",
253
+ onClick: e[5] || (e[5] = (f) => z())
254
+ })) : V("", !0)
255
+ ], 64)),
256
+ t(r) ? (d(), A(m, {
257
+ key: 1,
258
+ label: "Confirm",
259
+ onClick: e[6] || (e[6] = (f) => r.value = !1)
260
+ })) : V("", !0)
261
+ ])
262
+ ]),
263
+ default: L(() => [
264
+ t(r) ? V("", !0) : (d(), k("div", Se, [
265
+ e[9] || (e[9] = i("div", { class: "fm-typo-en-title-sm-800" }, "Group detail", -1)),
266
+ h(oe, {
267
+ modelValue: t(a).name,
268
+ "onUpdate:modelValue": e[1] || (e[1] = (f) => t(a).name = f),
269
+ label: "Name",
270
+ schema: t(se).typeAtPath(t(_), "name")
271
+ }, null, 8, ["modelValue", "schema"]),
272
+ e[10] || (e[10] = i("div", { class: "fm-typo-en-title-sm-800" }, "Link campaign", -1)),
273
+ i("div", we, [
274
+ i("div", Fe, O(t(a).campaigns.length) + " campaign(s) linked ", 1),
275
+ h(C, {
276
+ modelValue: t(o),
277
+ "onUpdate:modelValue": e[2] || (e[2] = (f) => T(o) ? o.value = f : null),
278
+ "prepend-icon": "search",
279
+ placeholder: "Search",
280
+ class: "w-auto"
281
+ }, null, 8, ["modelValue"])
282
+ ]),
283
+ h(m, {
284
+ variant: "plain",
285
+ icon: "link",
286
+ label: "Link Campaign",
287
+ onClick: K
288
+ })
289
+ ])),
290
+ t(r) ? (d(), A(ke, {
291
+ key: 1,
292
+ modelValue: t(a).campaigns,
293
+ "onUpdate:modelValue": e[3] || (e[3] = (f) => t(a).campaigns = f),
294
+ campaigns: t(N)
295
+ }, null, 8, ["modelValue", "campaigns"])) : V("", !0),
296
+ i("div", Ae, [
297
+ t(r) ? V("", !0) : (d(!0), k($, { key: 0 }, D(t(q), (f, Q) => (d(), k("div", null, [
298
+ i("div", $e, O(Q), 1),
299
+ h(B, { separator: !0 }, {
300
+ default: L(() => [
301
+ (d(!0), k($, null, D(f, (H) => (d(), k("div", Ue, [
302
+ i("div", null, O(H.label), 1),
303
+ i("div", null, [
304
+ h(m, {
305
+ icon: "delete",
306
+ onClick: (Re) => J(H.value),
307
+ variant: "tertiary"
308
+ }, null, 8, ["onClick"])
309
+ ])
310
+ ]))), 256))
311
+ ]),
312
+ _: 2
313
+ }, 1024)
314
+ ]))), 256))
315
+ ])
316
+ ]),
317
+ _: 2
318
+ }, [
319
+ t(r) ? {
320
+ name: "side-sheet-header",
321
+ fn: L(() => [
322
+ i("div", Ve, [
323
+ h(m, {
324
+ icon: "arrow_back",
325
+ variant: "tertiary",
326
+ onClick: e[0] || (e[0] = (f) => r.value = !1)
327
+ }),
328
+ e[8] || (e[8] = ee("Link campaign "))
329
+ ])
330
+ ]),
331
+ key: "0"
332
+ } : void 0
333
+ ]), 1032, ["modelValue", "header"]);
334
+ };
335
+ }
336
+ }), Ge = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Me = { class: "space-y-16" }, Be = { class: "flex items-center justify-end" }, at = /* @__PURE__ */ j({
337
+ __name: "Analytic",
338
+ setup(U) {
339
+ const { t: b } = ye(), c = {
340
+ label: b("connect.analytic.addGroup"),
341
+ value: "create",
342
+ isPrimary: !0,
343
+ prependIcon: "add"
344
+ }, v = ve(), S = y(), g = y([]), r = y(""), p = te({
345
+ totalCampaign: 0,
346
+ totalProgram: 0,
347
+ totalMember: 0
348
+ }), o = y("1");
349
+ b("connect.analytic.summary.totalCampaign"), b("connect.analytic.summary.totalProgram"), b("connect.analytic.summary.totalMember");
350
+ function a(l) {
351
+ var u;
352
+ o.value = (/* @__PURE__ */ new Date()).toISOString(), (u = S.value) == null || u.showSheet(l);
353
+ }
354
+ async function _() {
355
+ await v.readGroups();
356
+ const l = await R.readAllGrouped({
357
+ limit: 100,
358
+ skip: 0,
359
+ sortBy: "_id",
360
+ search: "",
361
+ descending: !0
362
+ });
363
+ g.value = l.resources;
364
+ }
365
+ G(() => g.value.filter((l) => {
366
+ var u;
367
+ return l.name.includes(r.value) || ((u = l.pf_campaigns) == null ? void 0 : u.filter((w) => w.name.includes(r.value)).length);
368
+ }));
369
+ const n = fe();
370
+ return ne(), y(!0), G(() => {
371
+ var l, u, w, P;
372
+ return !n.storeOption || !n.storeOption.company ? -1 : !n.payoutAccount || !n.payoutAccount.enable || n.payoutAccount.status != "APPROVED" ? 0 : (u = (l = n.store) == null ? void 0 : l.categories) != null && u.length ? (P = (w = n.store) == null ? void 0 : w.categories) != null && P.some(
373
+ (M) => M.bundles.some((F) => F.isFeedvibe)
374
+ ) ? 3 : 2 : 1;
375
+ }), ae(async () => {
376
+ await n.readMemberStore(), await n.readMembership(), await n.readPayoutAccount();
377
+ }), (l, u) => {
378
+ const w = x("FmPageHead"), P = x("FmSearch"), M = x("FmCard");
379
+ return x("FmButton"), x("FmIcon"), d(), k($, null, [
380
+ h(w, {
381
+ title: t(b)("connect.analytic.title"),
382
+ actions: t(g).length > 0 ? [c] : [],
383
+ "onClick:action": u[0] || (u[0] = (F) => a())
384
+ }, null, 8, ["title", "actions"]),
385
+ i("div", Ge, [
386
+ i("div", Me, [
387
+ i("div", Be, [
388
+ h(P, {
389
+ class: "xs:hidden",
390
+ modelValue: t(r),
391
+ "onUpdate:modelValue": u[1] || (u[1] = (F) => T(r) ? r.value = F : null),
392
+ placeholder: t(b)("connect.analytic.search"),
393
+ collapsible: ""
394
+ }, null, 8, ["modelValue", "placeholder"])
395
+ ]),
396
+ V("", !0)
397
+ ]),
398
+ V("", !0),
399
+ t(g).length ? V("", !0) : (d(), A(M, {
400
+ key: 1,
401
+ variant: "outlined",
402
+ class: "flex flex-col gap-y-24 items-center p-16"
403
+ }, {
404
+ default: L(() => u[7] || (u[7] = [
405
+ i("img", {
406
+ src: le,
407
+ class: "w-[150px]"
408
+ }, null, -1),
409
+ i("div", { class: "fm-typo-en-title-sm-800 text-center" }, " Analytics Dashboard Temporarily Unavailable ", -1),
410
+ i("div", { class: "fm-typo-body-en-md-400 text-center text-fm-color-typo-secondary" }, " We apologize for the inconvenience. The analytics dashboard is currently under maintenance to improve your experience. Please check back later for updates on system availability. ", -1)
411
+ ])),
412
+ _: 1
413
+ })),
414
+ V("", !0),
415
+ h(Le, {
416
+ ref_key: "sheetRef",
417
+ ref: S,
418
+ onSuccess: _
419
+ }, null, 512)
420
+ ])
421
+ ], 64);
422
+ };
423
+ }
424
+ });
425
+ export {
426
+ at as default
427
+ };