@feedmepos/mf-connect 0.1.98-beta.9 → 0.1.98-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 (116) hide show
  1. package/dist/Analytic-BHDjuMfN.js +426 -0
  2. package/dist/{App-CwMrP0Q-.js → App-BSSze_b9.js} +106 -118
  3. package/dist/{Bin-sSw4Gatd.js → Bin-DfzoQbE0.js} +8 -8
  4. package/dist/{Broadcast-DH2Fpb-O.js → Broadcast-DsqO4SXX.js} +17 -18
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cd47Mrej.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DQ0x2VJp.js} +6 -5
  6. package/dist/{Card-D4YJZ_I8.js → Card-VxbqomXV.js} +19 -19
  7. package/dist/{Collections--8QcjuAp.js → Collections-CvD98I3M.js} +185 -197
  8. package/dist/{Credit-DgF3qd52.js → Credit-BhM2m2L2.js} +53 -54
  9. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DvfrrjHc.js +2223 -0
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BgHApZqm.js → EffectSheet.vue_vue_type_style_index_0_lang-CPx9U9fU.js} +6 -6
  11. package/dist/{Experience-DxtkVeS9.js → Experience-uWQRb-qf.js} +34 -35
  12. package/dist/{FileSaver.min-BtPuPAIo.js → FileSaver.min-DKNoHTvP.js} +1 -1
  13. package/dist/{Game-CbcrkUBh.js → Game-BgT3oNx7.js} +15 -16
  14. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-CqoO7N7r.js → ImageInput.vue_vue_type_script_setup_true_lang-ClqrJbU6.js} +1 -1
  15. package/dist/{Index-BzPX7mr1.js → Index-D3RgVj9V.js} +10 -10
  16. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DyP3ipwX.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CkCpumzB.js} +1 -1
  17. package/dist/{MainLayout-gxkaZeZ-.js → MainLayout-B2RiPsIR.js} +1 -1
  18. package/dist/{Marketing-BlMjT0cP.js → Marketing-FrE7k7eW.js} +4 -4
  19. package/dist/{MarketingMaterialEdit-v0vGn3Lz.js → MarketingMaterialEdit-DGNjEUu-.js} +211 -214
  20. package/dist/{Member-BBUlAPqZ.js → Member-CgTagUQ9.js} +20 -20
  21. package/dist/{MemberList-DZJhULFD.js → MemberList-CKbzsDMX.js} +51 -50
  22. package/dist/{MemberTransactions-CTBoDEg4.js → MemberTransactions-CnY5cFdv.js} +1 -1
  23. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-nlYOP9gZ.js → MessageInput.vue_vue_type_script_setup_true_lang-DqivG_O4.js} +11 -11
  24. package/dist/{Mission-D_xjOnWO.js → Mission-BGNqy7wQ.js} +34 -35
  25. package/dist/{Overview-C5-uSEJH.js → Overview-CnpF74wa.js} +19 -19
  26. package/dist/{Point-BmVyG_i-.js → Point-BHgIy7Bz.js} +29 -30
  27. package/dist/{Promotion-BWmTkHyw.js → Promotion-CNQvO5Lq.js} +105 -111
  28. package/dist/{Queue-Do2XlY5H.js → Queue-CoPBE0UP.js} +43 -43
  29. package/dist/{Record-BIzUOikr.js → Record-BuDQ15FJ.js} +10 -10
  30. package/dist/{Reward-gCpIJIq9.js → Reward-BQlCO3Dk.js} +17 -17
  31. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Dkyz-W9m.js → RewardGroup.vue_vue_type_script_setup_true_lang-nhNr_T7D.js} +12 -12
  32. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-lnxwLa8o.js +1888 -0
  33. package/dist/{Segment-CZrzY2st.js → Segment-DKFAXGzY.js} +78 -77
  34. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-B1qAMtkn.js → SelectItems.vue_vue_type_script_setup_true_lang-CUR7djaM.js} +3 -3
  35. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-Dc36wzB0.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-CZ3s2W8Q.js} +12 -12
  36. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BtnF-BPt.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BbilZk82.js} +4 -4
  37. package/dist/{Setting-JrI4ttI1.js → Setting-hrDZ1cQR.js} +248 -259
  38. package/dist/{SettingAdvertisements-iOOpEUlI.js → SettingAdvertisements-CQsx4JqQ.js} +13 -13
  39. package/dist/{Store-DbXKThJn.js → Store-Cgmsklnt.js} +24 -24
  40. package/dist/{StoreRewards-CfkwVw7d.js → StoreRewards-CrPO4DKG.js} +16 -16
  41. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-yesp6BoT.js +1118 -0
  42. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-BnKybdKJ.js +142 -0
  43. package/dist/{Tier-BVrAqpWt.js → Tier-DgKMMyKr.js} +469 -544
  44. package/dist/{Title-DhumBh-S.js → Title-BKijiEFV.js} +92 -93
  45. package/dist/{Transaction-BQLge28p.js → Transaction-zHL4q_wj.js} +2 -2
  46. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CSPaj2uN.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DjafpVOa.js} +6 -6
  47. package/dist/{Voucher-DeB4YhvL.js → Voucher-DW4-SD1w.js} +27 -28
  48. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BjUFEIlS.js → VoucherEditor.vue_vue_type_script_setup_true_lang-y2wm2Bcu.js} +12 -12
  49. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BzrPUcC9.js → ZodTextField.vue_vue_type_script_setup_true_lang-BWZUE554.js} +2 -2
  50. package/dist/{app-BHIG18wW.js → app-B23RANXL.js} +3530 -4125
  51. package/dist/app.js +3 -4
  52. package/dist/{business-CCmy2VBj.js → business-BFU-2tpT.js} +1 -1
  53. package/dist/{campaign-DiFdvcPE.js → campaign-BEKKOWya.js} +64 -114
  54. package/dist/{campaign-jofcGLi8.js → campaign-CwlWx58O.js} +7 -13
  55. package/dist/{campaign.enum-CBp5IeWz.js → campaign.enum-5KIiekYl.js} +2 -3
  56. package/dist/{campaign.fn-BZ0Ivuwi.js → campaign.fn-CyWn_KL-.js} +57 -57
  57. package/dist/{collectible.enum-frp5wluZ.js → collectible.enum-DmmR-4Nj.js} +1 -1
  58. package/dist/collection.fn-BB1OjBHL.js +26 -0
  59. package/dist/dto-p31OYANk.js +216 -0
  60. package/dist/{effect-BegkMXTr.js → effect-DNDXE2iM.js} +1 -1
  61. package/dist/{email-addresses-B0t3BKV6.js → email-addresses-DXSkxrZ6.js} +2 -2
  62. package/dist/{export-CGrchnsA.js → export-zMj-UAnF.js} +3 -3
  63. package/dist/{helper-CIYSBZvt.js → helper-D32ml7Qv.js} +1 -1
  64. package/dist/{index-PmoP3mXP.js → index-9jgqbdnt.js} +7 -7
  65. package/dist/{index-CF1RNy12.js → index-B2OiTtF5.js} +1 -1
  66. package/dist/{index-DcE-11T-.js → index-B9-jeiQR.js} +1281 -1518
  67. package/dist/{index-D4_JDL9j.js → index-BWHk6oqv.js} +3 -3
  68. package/dist/{index-BPh_k5rA.js → index-BmmFSQPd.js} +3 -3
  69. package/dist/{index-C-2YkeBp.js → index-CA09A75h.js} +1968 -1996
  70. package/dist/index-Cc15IFUt.js +55 -0
  71. package/dist/{index-CixwNfnv.js → index-CcnOzrwY.js} +1 -1
  72. package/dist/{index-C_6y8OES.js → index-DSGHkaP0.js} +1 -1
  73. package/dist/{index-Cv0pq7A_.js → index-DvHLsdIR.js} +206 -807
  74. package/dist/{index-Dg_OJTxE.js → index-PrTZHXNT.js} +1 -1
  75. package/dist/{index-BBgVfqVf.js → index-txVWLdtz.js} +1 -1
  76. package/dist/{index.esm2017-QGfAIiCc.js → index.esm2017-BJG8dqci.js} +184 -184
  77. package/dist/{loading-Cql_LElt.js → loading-DuZVM_Ow.js} +1 -1
  78. package/dist/{lodash-PMdIVUsY.js → lodash-DqQem5rZ.js} +1 -1
  79. package/dist/{membership-BHD1GQ45.js → membership-CvoEzwor.js} +3 -3
  80. package/dist/{money-CASVly6f.js → money-B9PJ_JYh.js} +1 -1
  81. package/dist/{number-dMI2x0jy.js → number-GIC15kny.js} +1 -1
  82. package/dist/object-qECH92oz.js +26 -0
  83. package/dist/objectid-CtJ4pTf2.js +145 -0
  84. package/dist/{plugins-CnEVta3V.js → plugins-XAhAFHmZ.js} +95 -94
  85. package/dist/{reward-vdrNMYrF.js → reward-Dy0Z6PLL.js} +1 -1
  86. package/dist/{rule-BLXUDFEw.js → rule-CUu9I1Ly.js} +487 -505
  87. package/dist/rule-builder-DPmaehAO.js +102 -0
  88. package/dist/style.css +1 -1
  89. package/dist/template-BHtdbnoX.js +236 -0
  90. package/dist/{index-DzQCyuGA.js → timezone-BE1YhvLN.js} +20 -21
  91. package/dist/{trigger-Ccrh378a.js → trigger-BcHfjuiZ.js} +5 -5
  92. package/dist/{useMarketingMaterialActions-BQLBRa3G.js → useMarketingMaterialActions-YQq4LWOp.js} +3 -3
  93. package/dist/{usePagination-BjsffqjT.js → usePagination-B1KK2gTx.js} +1 -1
  94. package/dist/{user-B5jS1GLb.js → user-BTRRi1B3.js} +1 -1
  95. package/dist/{vue-i18n-CCjHlB6z.js → vue-i18n-D8NX5Rry.js} +390 -390
  96. package/dist/{xlsx-DmBOvA2N.js → xlsx-C9LzK7Kg.js} +1 -1
  97. package/dist/{zod-DrYZ6KS4.js → zod-D3ciRzE4.js} +1 -1
  98. package/package.json +4 -8
  99. package/dist/AuditLogs-CAtlilma.js +0 -2013
  100. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  101. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bpr9KuHW.js +0 -3377
  102. package/dist/Grab-CDhmMNsL.js +0 -300
  103. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-mI-5po-a.js +0 -48
  104. package/dist/LoyaltyDashboard-BFjI3IWT.js +0 -1082
  105. package/dist/Review-D9cFDrhN.js +0 -1192
  106. package/dist/ReviewFacebookCallback-DbE8_6D3.js +0 -243
  107. package/dist/ReviewGoogleCallback-LMZgyopt.js +0 -208
  108. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BEqgU70M.js +0 -1911
  109. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CNC_jNgW.js +0 -1130
  110. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-BBlCR4pN.js +0 -7007
  111. package/dist/duplicateCampaign-CxuNftok.js +0 -51
  112. package/dist/index-Dc-I4Jr-.js +0 -67
  113. package/dist/index-DdAl4SK2.js +0 -52
  114. package/dist/object-BYyQ0PZp.js +0 -18
  115. package/dist/objectid-Db_4Ays3.js +0 -145
  116. package/dist/template-CRjkIq3e.js +0 -188
@@ -0,0 +1,426 @@
1
+ import { defineComponent as I, ref as y, watch as X, onMounted as T, resolveComponent as x, openBlock as d, createBlock as A, withCtx as P, createVNode as b, unref as t, createElementVNode as r, createElementBlock as k, Fragment as $, renderList as D, computed as G, toDisplayString as M, isRef as j, createSlots as Y, createCommentVNode as V, createTextVNode as ee, reactive as te, onBeforeMount as ae } from "vue";
2
+ import { _ as ne } from "./campaign-CpzFl8Vr.js";
3
+ import "./index-9jgqbdnt.js";
4
+ import "./campaign-BEKKOWya.js";
5
+ import { useRouter as le } from "vue-router";
6
+ import { c as E, u as oe } from "./campaign-CwlWx58O.js";
7
+ import { _ as se } from "./ZodTextField.vue_vue_type_script_setup_true_lang-BWZUE554.js";
8
+ import { Z as ie } from "./zod-D3ciRzE4.js";
9
+ import { F as re } from "./dto-p31OYANk.js";
10
+ import { J as ue } from "./JsonViewer-v8_C7l5N.js";
11
+ import "./index-BmmFSQPd.js";
12
+ import { useSnackbar as ce } from "@feedmepos/ui-library";
13
+ import { u as me } from "./app-wDQR6dpb.js";
14
+ import { u as de } from "./loading-DuZVM_Ow.js";
15
+ import { C as pe } from "./campaign.fn-CyWn_KL-.js";
16
+ import { g as ve } from "./object-qECH92oz.js";
17
+ import { u as fe } from "./membership-CvoEzwor.js";
18
+ import { u as ye } from "./vue-i18n-D8NX5Rry.js";
19
+ const ge = { class: "ml-32 flex flex-col" }, _e = /* @__PURE__ */ I({
20
+ __name: "CampaignCard",
21
+ props: {
22
+ title: {},
23
+ items: {},
24
+ modelValue: {}
25
+ },
26
+ emits: ["update:model-value"],
27
+ setup(U, { emit: g }) {
28
+ const c = U, v = g, S = (o) => {
29
+ o ? p.value = c.items.map((a) => a.value) : p.value = [], i.value = o, v("update:model-value", p.value);
30
+ }, _ = (o) => {
31
+ p.value = o, i.value = o.length === c.items.length, v("update:model-value", o);
32
+ }, i = y(!1), p = y([]);
33
+ return X(
34
+ () => c.modelValue,
35
+ () => {
36
+ p.value = c.modelValue.filter(
37
+ (o) => c.items.find((a) => a.value === o)
38
+ );
39
+ }
40
+ ), T(() => {
41
+ p.value = c.modelValue.filter(
42
+ (o) => c.items.find((a) => a.value === o)
43
+ );
44
+ }), (o, a) => {
45
+ const h = x("FmCheckbox"), l = x("FmCard");
46
+ return d(), A(l, {
47
+ variant: "outlined",
48
+ class: "p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3"
49
+ }, {
50
+ default: P(() => [
51
+ b(h, {
52
+ "model-value": t(i),
53
+ value: "1",
54
+ label: c.title,
55
+ indeterminate: t(p).length > 0,
56
+ "onUpdate:modelValue": S
57
+ }, null, 8, ["model-value", "label", "indeterminate"]),
58
+ r("div", ge, [
59
+ (d(!0), k($, null, D(c.items, (n, u) => (d(), A(h, {
60
+ key: u,
61
+ "model-value": t(p),
62
+ label: n.label,
63
+ value: n.value,
64
+ "onUpdate:modelValue": _
65
+ }, null, 8, ["model-value", "label", "value"]))), 128))
66
+ ])
67
+ ]),
68
+ _: 1
69
+ });
70
+ };
71
+ }
72
+ }), 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__ */ I({
73
+ __name: "LinkCampaign",
74
+ props: {
75
+ modelValue: {
76
+ type: Array,
77
+ required: !0
78
+ },
79
+ campaigns: {
80
+ type: Object,
81
+ required: !0
82
+ }
83
+ },
84
+ emits: ["update:model-value"],
85
+ setup(U, { emit: g }) {
86
+ const c = y(""), v = y([]), S = U, _ = g, i = G(() => Object.entries(S.campaigns).reduce((o, [a, h]) => {
87
+ const l = h.filter(
88
+ (n) => n.label.toLowerCase().includes(c.value.toLowerCase())
89
+ );
90
+ return l.length > 0 && (o[a] = l), o;
91
+ }, {}));
92
+ function p(o, a) {
93
+ v.value = v.value.filter(
94
+ (h) => !a.map((l) => l.value).includes(h)
95
+ ), v.value = [.../* @__PURE__ */ new Set([...v.value, ...o])], _("update:model-value", v.value);
96
+ }
97
+ return T(() => {
98
+ v.value = S.modelValue;
99
+ }), (o, a) => {
100
+ const h = x("FmTextField");
101
+ return d(), k($, null, [
102
+ b(ue, { json: U.campaigns }, null, 8, ["json"]),
103
+ r("div", he, [
104
+ r("div", be, [
105
+ r("div", xe, M(t(v).length) + " campaign(s) linked ", 1),
106
+ b(h, {
107
+ modelValue: t(c),
108
+ "onUpdate:modelValue": a[0] || (a[0] = (l) => j(c) ? c.value = l : null),
109
+ "prepend-icon": "search",
110
+ placeholder: "Search",
111
+ class: "w-full"
112
+ }, null, 8, ["modelValue"])
113
+ ]),
114
+ r("div", Ce, [
115
+ (d(!0), k($, null, D(t(i), (l, n) => (d(), A(_e, {
116
+ "model-value": t(v),
117
+ title: n,
118
+ items: l,
119
+ "onUpdate:modelValue": (u) => p(u, l)
120
+ }, null, 8, ["model-value", "title", "items", "onUpdate:modelValue"]))), 256))
121
+ ])
122
+ ])
123
+ ], 64);
124
+ };
125
+ }
126
+ }), Ve = { class: "flex items-center gap-x-8" }, Se = {
127
+ key: 0,
128
+ class: "space-y-16 pr-12"
129
+ }, 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" }, Le = { class: "flex items-center gap-8" }, Pe = /* @__PURE__ */ I({
130
+ __name: "AnalyticSheet",
131
+ emits: ["success"],
132
+ setup(U, { expose: g, emit: c }) {
133
+ const v = c, S = me();
134
+ ce();
135
+ const _ = y(!1), i = y(!1), p = {
136
+ name: "",
137
+ campaigns: []
138
+ }, o = y(""), a = y({ ...p }), h = re.superRefine((s, e) => {
139
+ }), l = y([]), n = y(null), { global: u, minor: w } = de, L = G(() => {
140
+ const s = h.safeParse(a.value);
141
+ return s.success ? [] : s.error.errors;
142
+ });
143
+ function B(s) {
144
+ var e;
145
+ _.value = !0, s ? (n.value = { ...s }, a.value = { ...s, campaigns: (e = s.pf_campaigns) == null ? void 0 : e.map((m) => m._id) }) : (n.value = null, a.value = { ...p });
146
+ }
147
+ function F() {
148
+ _.value = !1, n.value = null;
149
+ }
150
+ function K() {
151
+ i.value = !0;
152
+ }
153
+ async function q() {
154
+ const s = await E.readAll({
155
+ limit: 1e3,
156
+ skip: 0,
157
+ sortBy: "_id",
158
+ search: "",
159
+ descending: !0
160
+ });
161
+ l.value = s.resources.filter(
162
+ (e) => !["MEMBERSHIP", "REWARD_POOL"].includes(e.type) && !["ISSUE_REWARD"].includes("event" in e ? e == null ? void 0 : e.event.type : "")
163
+ );
164
+ }
165
+ const N = G(() => {
166
+ const s = (m) => m.map((C) => ({
167
+ label: C.name,
168
+ value: C._id
169
+ }));
170
+ return ve(
171
+ l.value,
172
+ (m) => pe.formattedType(m.type),
173
+ s
174
+ );
175
+ }), J = G(() => Object.entries(N.value).reduce(
176
+ (s, [e, m]) => {
177
+ const C = m.filter((R) => {
178
+ var O, f;
179
+ return (f = (O = a.value) == null ? void 0 : O.campaigns) == null ? void 0 : f.includes(R.value);
180
+ }).filter(
181
+ (R) => R.label.toLowerCase().includes(o.value.toLowerCase())
182
+ );
183
+ return C.length > 0 && (s[e] = C), s;
184
+ },
185
+ {}
186
+ ));
187
+ function W(s) {
188
+ var m, C;
189
+ const e = (m = a.value.campaigns) == null ? void 0 : m.indexOf(s);
190
+ e != null && e > -1 && ((C = a.value.campaigns) == null || C.splice(e, 1));
191
+ }
192
+ async function Z() {
193
+ h.safeParse(a.value).success && await w(
194
+ async () => {
195
+ var e;
196
+ n.value ? await E.updateGroup(
197
+ (e = n.value) == null ? void 0 : e._id,
198
+ a.value
199
+ ) : await E.createGroup(a.value), v("success"), F();
200
+ },
201
+ {
202
+ message: "Saving group",
203
+ successMessage: "Group saved"
204
+ }
205
+ );
206
+ }
207
+ async function z() {
208
+ await w(
209
+ async () => {
210
+ var s;
211
+ await E.deleteGroup((s = n.value) == null ? void 0 : s._id), v("success"), F();
212
+ },
213
+ {
214
+ message: "Deleting group",
215
+ successMessage: "Group deleted"
216
+ }
217
+ );
218
+ }
219
+ return T(async () => {
220
+ await q();
221
+ }), g({
222
+ showSheet: B,
223
+ hideSheet: F
224
+ }), (s, e) => {
225
+ const m = x("FmButton"), C = x("FmTextField"), R = x("FmList"), O = x("FmSideSheet");
226
+ return d(), A(O, {
227
+ modelValue: t(_),
228
+ "onUpdate:modelValue": e[7] || (e[7] = (f) => j(_) ? _.value = f : null),
229
+ header: t(n) ? "Edit group" : "Add group",
230
+ "dismiss-away": "",
231
+ "close-button": !0,
232
+ "max-width": 550
233
+ }, Y({
234
+ "side-sheet-footer": P(() => [
235
+ r("div", Le, [
236
+ t(i) ? V("", !0) : (d(), k($, { key: 0 }, [
237
+ b(m, {
238
+ label: "Submit",
239
+ onClick: Z,
240
+ disabled: t(L).length > 0 || t(S).isLoading
241
+ }, null, 8, ["disabled"]),
242
+ b(m, {
243
+ label: "Cancel",
244
+ onClick: e[4] || (e[4] = (f) => F()),
245
+ variant: "tertiary"
246
+ }),
247
+ t(n) ? (d(), A(m, {
248
+ key: 0,
249
+ label: "Delete",
250
+ variant: "plain",
251
+ class: "ml-auto fm-color-system-error-300",
252
+ onClick: e[5] || (e[5] = (f) => z())
253
+ })) : V("", !0)
254
+ ], 64)),
255
+ t(i) ? (d(), A(m, {
256
+ key: 1,
257
+ label: "Confirm",
258
+ onClick: e[6] || (e[6] = (f) => i.value = !1)
259
+ })) : V("", !0)
260
+ ])
261
+ ]),
262
+ default: P(() => [
263
+ t(i) ? V("", !0) : (d(), k("div", Se, [
264
+ e[9] || (e[9] = r("div", { class: "fm-typo-en-title-sm-800" }, "Group detail", -1)),
265
+ b(se, {
266
+ modelValue: t(a).name,
267
+ "onUpdate:modelValue": e[1] || (e[1] = (f) => t(a).name = f),
268
+ label: "Name",
269
+ schema: t(ie).typeAtPath(t(h), "name")
270
+ }, null, 8, ["modelValue", "schema"]),
271
+ e[10] || (e[10] = r("div", { class: "fm-typo-en-title-sm-800" }, "Link campaign", -1)),
272
+ r("div", we, [
273
+ r("div", Fe, M(t(a).campaigns.length) + " campaign(s) linked ", 1),
274
+ b(C, {
275
+ modelValue: t(o),
276
+ "onUpdate:modelValue": e[2] || (e[2] = (f) => j(o) ? o.value = f : null),
277
+ "prepend-icon": "search",
278
+ placeholder: "Search",
279
+ class: "w-auto"
280
+ }, null, 8, ["modelValue"])
281
+ ]),
282
+ b(m, {
283
+ variant: "plain",
284
+ icon: "link",
285
+ label: "Link Campaign",
286
+ onClick: K
287
+ })
288
+ ])),
289
+ t(i) ? (d(), A(ke, {
290
+ key: 1,
291
+ modelValue: t(a).campaigns,
292
+ "onUpdate:modelValue": e[3] || (e[3] = (f) => t(a).campaigns = f),
293
+ campaigns: t(N)
294
+ }, null, 8, ["modelValue", "campaigns"])) : V("", !0),
295
+ r("div", Ae, [
296
+ t(i) ? V("", !0) : (d(!0), k($, { key: 0 }, D(t(J), (f, Q) => (d(), k("div", null, [
297
+ r("div", $e, M(Q), 1),
298
+ b(R, { separator: !0 }, {
299
+ default: P(() => [
300
+ (d(!0), k($, null, D(f, (H) => (d(), k("div", Ue, [
301
+ r("div", null, M(H.label), 1),
302
+ r("div", null, [
303
+ b(m, {
304
+ icon: "delete",
305
+ onClick: (Oe) => W(H.value),
306
+ variant: "tertiary"
307
+ }, null, 8, ["onClick"])
308
+ ])
309
+ ]))), 256))
310
+ ]),
311
+ _: 2
312
+ }, 1024)
313
+ ]))), 256))
314
+ ])
315
+ ]),
316
+ _: 2
317
+ }, [
318
+ t(i) ? {
319
+ name: "side-sheet-header",
320
+ fn: P(() => [
321
+ r("div", Ve, [
322
+ b(m, {
323
+ icon: "arrow_back",
324
+ variant: "tertiary",
325
+ onClick: e[0] || (e[0] = (f) => i.value = !1)
326
+ }),
327
+ e[8] || (e[8] = ee("Link campaign ", -1))
328
+ ])
329
+ ]),
330
+ key: "0"
331
+ } : void 0
332
+ ]), 1032, ["modelValue", "header"]);
333
+ };
334
+ }
335
+ }), Ge = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Me = { class: "space-y-16" }, Be = { class: "flex items-center justify-end" }, Re = { class: "fm-typo-en-title-sm-800 text-center" }, Ee = { class: "fm-typo-body-en-md-400 text-center text-fm-color-typo-secondary" }, nt = /* @__PURE__ */ I({
336
+ __name: "Analytic",
337
+ setup(U) {
338
+ const { t: g } = ye(), c = {
339
+ label: g("connect.analytic.addGroup"),
340
+ value: "create",
341
+ isPrimary: !0,
342
+ prependIcon: "add"
343
+ }, v = oe(), S = y(), _ = y([]), i = y(""), p = te({
344
+ totalCampaign: 0,
345
+ totalProgram: 0,
346
+ totalMember: 0
347
+ }), o = y("1");
348
+ g("connect.analytic.summary.totalCampaign"), g("connect.analytic.summary.totalProgram"), g("connect.analytic.summary.totalMember");
349
+ function a(n) {
350
+ var u;
351
+ o.value = (/* @__PURE__ */ new Date()).toISOString(), (u = S.value) == null || u.showSheet(n);
352
+ }
353
+ async function h() {
354
+ await v.readGroups();
355
+ const n = await E.readAllGrouped({
356
+ limit: 100,
357
+ skip: 0,
358
+ sortBy: "_id",
359
+ search: "",
360
+ descending: !0
361
+ });
362
+ _.value = n.resources;
363
+ }
364
+ G(() => _.value.filter((n) => {
365
+ var u;
366
+ return n.name.includes(i.value) || ((u = n.pf_campaigns) == null ? void 0 : u.filter((w) => w.name.includes(i.value)).length);
367
+ }));
368
+ const l = fe();
369
+ return le(), y(!0), G(() => {
370
+ var n, u, w, L;
371
+ return !l.storeOption || !l.storeOption.company ? -1 : !l.payoutAccount || !l.payoutAccount.enable || l.payoutAccount.status != "APPROVED" ? 0 : (u = (n = l.store) == null ? void 0 : n.categories) != null && u.length ? (L = (w = l.store) == null ? void 0 : w.categories) != null && L.some(
372
+ (B) => B.bundles.some((F) => F.isFeedvibe)
373
+ ) ? 3 : 2 : 1;
374
+ }), ae(async () => {
375
+ await l.readMemberStore(), await l.readMembership(), await l.readPayoutAccount();
376
+ }), (n, u) => {
377
+ const w = x("FmPageHead"), L = x("FmSearch"), B = x("FmCard");
378
+ return x("FmButton"), x("FmIcon"), d(), k($, null, [
379
+ b(w, {
380
+ title: t(g)("connect.analytic.title"),
381
+ actions: t(_).length > 0 ? [c] : [],
382
+ "onClick:action": u[0] || (u[0] = (F) => a())
383
+ }, null, 8, ["title", "actions"]),
384
+ r("div", Ge, [
385
+ r("div", Me, [
386
+ r("div", Be, [
387
+ b(L, {
388
+ class: "xs:hidden",
389
+ modelValue: t(i),
390
+ "onUpdate:modelValue": u[1] || (u[1] = (F) => j(i) ? i.value = F : null),
391
+ placeholder: t(g)("connect.analytic.search"),
392
+ collapsible: ""
393
+ }, null, 8, ["modelValue", "placeholder"])
394
+ ]),
395
+ V("", !0)
396
+ ]),
397
+ V("", !0),
398
+ t(_).length ? V("", !0) : (d(), A(B, {
399
+ key: 1,
400
+ variant: "outlined",
401
+ class: "flex flex-col gap-y-24 items-center p-16"
402
+ }, {
403
+ default: P(() => [
404
+ u[7] || (u[7] = r("img", {
405
+ src: ne,
406
+ class: "w-[150px]"
407
+ }, null, -1)),
408
+ r("div", Re, M(t(g)("connect.analytic.maintenance.title")), 1),
409
+ r("div", Ee, M(t(g)("connect.analytic.maintenance.description")), 1)
410
+ ]),
411
+ _: 1
412
+ })),
413
+ V("", !0),
414
+ b(Pe, {
415
+ ref_key: "sheetRef",
416
+ ref: S,
417
+ onSuccess: h
418
+ }, null, 512)
419
+ ])
420
+ ], 64);
421
+ };
422
+ }
423
+ });
424
+ export {
425
+ nt as default
426
+ };