@feedmepos/mf-connect 0.1.9-prod → 0.1.10-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 (90) hide show
  1. package/dist/{Analytic-8Ew7y5t9.js → Analytic-CpSbitWV.js} +24 -23
  2. package/dist/{App-3BVNH3r-.js → App-BPT8XzjX.js} +56 -51
  3. package/dist/{Broadcast-CrsPUhLT.js → Broadcast-CJHpiQeN.js} +8 -8
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DE300Y56.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DUPqWdIm.js} +7 -7
  5. package/dist/Card-Bvn36zqZ.js +895 -0
  6. package/dist/{Collections-djS9hLI8.js → Collections-Bq6OxsJC.js} +24 -29
  7. package/dist/{Credit-D4KEvIov.js → Credit-Dno_g7dW.js} +8 -8
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BjM81fmS.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-cGbwORhw.js} +648 -1284
  9. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-aEWfdpCg.js → EffectSheet.vue_vue_type_style_index_0_lang-Ho7zwlbb.js} +19 -19
  10. package/dist/{Experience-2FPLO7aV.js → Experience-BC1qSIGO.js} +8 -8
  11. package/dist/{Game-e_UjVJgU.js → Game-C_CKGMBW.js} +8 -8
  12. package/dist/Index-BXFaWTfw.js +255 -0
  13. package/dist/{Marketing-B2hCjZ2r.js → Marketing-Ni0WAie5.js} +5 -5
  14. package/dist/{Member-D_ykRIBb.js → Member-djnisrK1.js} +4 -4
  15. package/dist/{MemberList-LmzzYxEn.js → MemberList-CclU-3B7.js} +193 -189
  16. package/dist/{MemberTransactions-B2vqlKaP.js → MemberTransactions-DVVsv3Ux.js} +1 -1
  17. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DQ2ubF0N.js → MessageInput.vue_vue_type_script_setup_true_lang-khyDg1m4.js} +2 -2
  18. package/dist/Mission-Z5somdo_.js +273 -0
  19. package/dist/Overview-BvMVz3lQ.js +1074 -0
  20. package/dist/{Point-DFriwWWY.js → Point-DdPukiTg.js} +8 -8
  21. package/dist/{Promotion-Db3IEs2F.js → Promotion-DCqdIwjG.js} +9 -9
  22. package/dist/Record-CvMxXm1B.js +337 -0
  23. package/dist/Reward-CiJHGXfQ.js +441 -0
  24. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-CrGCBRmH.js +150 -0
  25. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-tnT6i0Jq.js +1638 -0
  26. package/dist/{Segment-CE8q9JV2.js → Segment-CQb3j-o0.js} +13 -13
  27. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-B7YqIU5D.js +181 -0
  28. package/dist/{Setting-Vcz1S27V.js → Setting-91cK3ssU.js} +31 -31
  29. package/dist/Store-B-uldUKt.js +1744 -0
  30. package/dist/{StoreRewards-Dt30AkWo.js → StoreRewards-dDNeFlA9.js} +12 -12
  31. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BVb1X0aq.js +1132 -0
  32. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-f59onlgt.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-Ds0WxGxr.js} +1 -1
  33. package/dist/{Tier-a6yXEtLd.js → Tier-_jMaLj3u.js} +19 -19
  34. package/dist/{Title-A3-2EI0w.js → Title-By7o67aT.js} +19 -19
  35. package/dist/{Transaction-DswABr2P.js → Transaction-BLpEgeI2.js} +2 -2
  36. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-Bf_nO9zH.js +130 -0
  37. package/dist/{Voucher-DEoVgZYa.js → Voucher-CG5tfibn.js} +11 -11
  38. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DpQUoXyQ.js +419 -0
  39. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-ccc1vxjS.js → ZodTextField.vue_vue_type_script_setup_true_lang-YwGR2En3.js} +1 -1
  40. package/dist/{app-C23GfQGq.js → app-DDmTqTb7.js} +1 -1
  41. package/dist/{app-C66C2KLW.js → app-vCqTQIeC.js} +424 -273
  42. package/dist/app.js +1 -1
  43. package/dist/{business-DNAVZOSH.js → business-Cz78KGF2.js} +1 -1
  44. package/dist/{campaign-Cv0HaUD1.js → campaign-BBd4o7F_.js} +2 -2
  45. package/dist/campaign.enum-CIhi0b-m.js +20 -0
  46. package/dist/campaign.fn-5silF1DK.js +758 -0
  47. package/dist/collectible.enum-cMIQ6ogq.js +19 -0
  48. package/dist/{collection.fn-Dxzr2oPt.js → collection.fn-BGc7Qeli.js} +2 -2
  49. package/dist/dto-i04OPJfW.js +2018 -0
  50. package/dist/{effect-CUuL8Tci.js → effect-D8UzkYRg.js} +1 -1
  51. package/dist/{email-addresses-Yt3s7i2b.js → email-addresses-u05o35hN.js} +1 -1
  52. package/dist/{export-CNg5YWMm.js → export-BEXuPYEd.js} +3 -3
  53. package/dist/{helper-DzmKNFue.js → helper-RptRJGv6.js} +1 -1
  54. package/dist/{index-Dnf7j71V.js → index-B8s-gucK.js} +9 -3
  55. package/dist/{index-B88e_9YI.js → index-BjHZUhiH.js} +1 -1
  56. package/dist/{index-O9lB54LY.js → index-Bpu2DYUc.js} +1348 -1342
  57. package/dist/{index-BK8X9RF6.js → index-C6-rCMhD.js} +3 -3
  58. package/dist/{index-D0obMrAS.js → index-Cq_ZIbRm.js} +173 -62
  59. package/dist/{index-CsCgQ8gt.js → index-DFAnoAe9.js} +1 -1
  60. package/dist/index-DbyJ6Nyn.js +54 -0
  61. package/dist/{index-yzH5eyKW.js → index-Dt6K2eG8.js} +1 -1
  62. package/dist/{index-9CXt2kbQ.js → index-DwzoqCt8.js} +293 -287
  63. package/dist/index-UfL5qRzR.js +1049 -0
  64. package/dist/index-g8EbRVnr.js +32 -0
  65. package/dist/{index-QuBsnXgx.js → index-hEE_ntHd.js} +1 -1
  66. package/dist/index-vh86FiIQ.js +10 -0
  67. package/dist/{index.esm2017-TpBElhnN.js → index.esm2017-BSzW_yaL.js} +1 -1
  68. package/dist/{loading-ChoC5E9d.js → loading-DjEdwdnj.js} +156 -153
  69. package/dist/{membership-CU-k0-Tf.js → membership-BL9Xs8lD.js} +52 -44
  70. package/dist/{money-DANmyTBj.js → money-D7lq0cx-.js} +1 -1
  71. package/dist/{number-DrocTWDD.js → number-BiDabTkI.js} +1 -1
  72. package/dist/objectid-CXf0jb1W.js +145 -0
  73. package/dist/reward-Cr8rbe5R.js +36 -0
  74. package/dist/{rule-builder-3YRdr18A.js → rule-builder-DPKFZ5UX.js} +1 -1
  75. package/dist/{rule-BQLmpER9.js → rule-vkYJij4h.js} +4 -3
  76. package/dist/{template-DOKU1QkY.js → template-Bep5Y5ch.js} +4 -4
  77. package/dist/trigger-fWhQ3bqv.js +144 -0
  78. package/dist/{usePagination-JGI7x0W7.js → usePagination-DSF5b4hM.js} +1 -1
  79. package/dist/user-9UiaP0xs.js +54 -0
  80. package/dist/{vue-i18n-Bch1JmhI.js → vue-i18n-BhiDOB1j.js} +232 -232
  81. package/package.json +2 -2
  82. package/dist/Card-DndggRLr.js +0 -1036
  83. package/dist/Mission-CsLdMq1M.js +0 -261
  84. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-_P2yImhi.js +0 -1804
  85. package/dist/Store-C8kT7JN5.js +0 -1531
  86. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Cc2F_06x.js +0 -1065
  87. package/dist/dto-CcrufW2j.js +0 -2770
  88. package/dist/index-C7745kXl.js +0 -755
  89. package/dist/index-CZ28ywyB.js +0 -298
  90. package/dist/user-Bm4KttFq.js +0 -37
@@ -1,15 +1,15 @@
1
1
  import { defineComponent as j, ref as P, computed as A, h as E, onMounted as M, resolveComponent as l, openBlock as d, createElementBlock as w, Fragment as b, createVNode as r, unref as t, withCtx as _, createElementVNode as n, toDisplayString as c, renderList as H, createBlock as x, resolveDynamicComponent as q } from "vue";
2
2
  import { _ as z } from "./campaign-CpzFl8Vr.js";
3
3
  import { useDialog as G, components as J } from "@feedmepos/ui-library";
4
- import { p as Q, u as W } from "./loading-ChoC5E9d.js";
5
- import { u as X } from "./business-DNAVZOSH.js";
6
- import { u as Y } from "./campaign-Cv0HaUD1.js";
7
- import { g as V, a as I } from "./dto-CcrufW2j.js";
4
+ import { p as Q, u as W } from "./loading-DjEdwdnj.js";
5
+ import { u as X } from "./business-Cz78KGF2.js";
6
+ import { u as Y } from "./campaign-BBd4o7F_.js";
7
+ import { g as V, a as I } from "./dto-i04OPJfW.js";
8
8
  import { _ as Z } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
9
- import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BjM81fmS.js";
10
- import { u as te } from "./template-DOKU1QkY.js";
11
- import { u as oe } from "./vue-i18n-Bch1JmhI.js";
12
- import { c as g } from "./index-CsCgQ8gt.js";
9
+ import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-cGbwORhw.js";
10
+ import { u as te } from "./template-Bep5Y5ch.js";
11
+ import { u as oe } from "./vue-i18n-BhiDOB1j.js";
12
+ import { c as g } from "./index-DFAnoAe9.js";
13
13
  const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, se = { class: "px-24 flex flex-col gap-y-16" }, ie = { class: "flex items-center justify-between w-full" }, re = { class: "flex gap-8 overflow-x-auto" }, le = { class: "space-y-8" }, ce = { class: "flex w-full gap-4 items-center" }, me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, de = { class: "space-y-4" }, pe = { class: "fm-typo-en-body-lg-600" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ye = /* @__PURE__ */ n("img", {
14
14
  src: z,
15
15
  class: "aspect-square w-[150px]"
@@ -1,16 +1,16 @@
1
1
  import { defineComponent as H, ref as S, computed as q, h as z, onMounted as G, resolveComponent as r, openBlock as m, createElementBlock as h, Fragment as w, createVNode as i, unref as n, createElementVNode as s, withCtx as v, renderList as J, createBlock as b, resolveDynamicComponent as Q, toDisplayString as g } from "vue";
2
2
  import { _ as W } from "./campaign-CpzFl8Vr.js";
3
3
  import { useDialog as X, components as Y } from "@feedmepos/ui-library";
4
- import { c as O, p as I, u as Z } from "./loading-ChoC5E9d.js";
5
- import { u as ee } from "./business-DNAVZOSH.js";
6
- import { u as oe } from "./campaign-Cv0HaUD1.js";
7
- import { u as te } from "./vue-i18n-Bch1JmhI.js";
8
- import { g as V } from "./dto-CcrufW2j.js";
9
- import { e as L } from "./effect-CUuL8Tci.js";
4
+ import { c as O, p as I, u as Z } from "./loading-DjEdwdnj.js";
5
+ import { u as ee } from "./business-Cz78KGF2.js";
6
+ import { u as oe } from "./campaign-BBd4o7F_.js";
7
+ import { u as te } from "./vue-i18n-BhiDOB1j.js";
8
+ import { g as V } from "./dto-i04OPJfW.js";
9
+ import { e as L } from "./effect-D8UzkYRg.js";
10
10
  import { _ as ne } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
11
- import { _ as ae } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BjM81fmS.js";
12
- import { u as se } from "./template-DOKU1QkY.js";
13
- import { c as u } from "./index-CsCgQ8gt.js";
11
+ import { _ as ae } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-cGbwORhw.js";
12
+ import { u as se } from "./template-Bep5Y5ch.js";
13
+ import { c as u } from "./index-DFAnoAe9.js";
14
14
  const ce = { class: "px-24 flex flex-col gap-y-16" }, ie = { class: "flex items-center justify-between w-full" }, re = { class: "flex gap-8 overflow-x-auto" }, le = { class: "space-y-8" }, me = { class: "flex w-full gap-4 items-center" }, pe = { class: "space-y-4" }, de = { class: "fm-typo-en-body-lg-600" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = /* @__PURE__ */ s("img", {
15
15
  src: W,
16
16
  class: "aspect-square w-[150px]"
@@ -0,0 +1,337 @@
1
+ var K = Object.defineProperty;
2
+ var W = (g, i, m) => i in g ? K(g, i, { enumerable: !0, configurable: !0, writable: !0, value: m }) : g[i] = m;
3
+ var $ = (g, i, m) => W(g, typeof i != "symbol" ? i + "" : i, m);
4
+ import { defineComponent as A, ref as V, computed as q, resolveComponent as x, openBlock as B, createBlock as G, unref as s, isRef as H, withCtx as J, createElementBlock as T, createVNode as C, withModifiers as Q, createCommentVNode as X, createElementVNode as I, h as S, onMounted as Z, Fragment as ee } from "vue";
5
+ import { u as D, a as re, _ as te, w as oe } from "./usePagination-DSF5b4hM.js";
6
+ import { g as z } from "./user-9UiaP0xs.js";
7
+ import { components as v } from "@feedmepos/ui-library";
8
+ import { u as U, a as ae, c as se } from "./loading-DjEdwdnj.js";
9
+ import { u as ie } from "./vue-i18n-BhiDOB1j.js";
10
+ import { useCoreStore as ne } from "@feedmepos/mf-common";
11
+ import { r as R } from "./index-g8EbRVnr.js";
12
+ import { c as ce, a as le } from "./object-qECH92oz.js";
13
+ import { u as de } from "./membership-BL9Xs8lD.js";
14
+ import { e as f } from "./index-vh86FiIQ.js";
15
+ import { h as me } from "./moment-BWErdI6_.js";
16
+ import { o as ue } from "./objectId-dwaoBfJX.js";
17
+ const pe = {
18
+ key: 0,
19
+ class: "flex justify-end mb-16"
20
+ }, fe = { class: "flex flex-col space-y-16 pr-12" }, ge = /* @__PURE__ */ A({
21
+ __name: "UpdateCriteriaProgressSheet",
22
+ emits: ["refresh"],
23
+ setup(g, { expose: i, emit: m }) {
24
+ const k = m;
25
+ ie();
26
+ const { minor: u } = U, h = V(!1), n = V({}), y = ne(), F = [
27
+ {
28
+ header: "Criteria title",
29
+ accessorFn: (t) => t.name
30
+ },
31
+ {
32
+ header: "Status",
33
+ cell(t) {
34
+ var p;
35
+ const e = t.row.original, o = (p = n.value.criteria_progress) == null ? void 0 : p.find(
36
+ (w) => w.criteria === e._id
37
+ ), c = o ? "Completed" : "Pending", l = o ? "text-fm-color-typo-success bg-fm-color-system-success-100" : "text-fm-color-typo-warning bg-fm-color-system-warning-100";
38
+ return [
39
+ S(v.FmChip, {
40
+ label: c,
41
+ compact: !0,
42
+ class: l
43
+ })
44
+ ];
45
+ }
46
+ },
47
+ {
48
+ id: "actions",
49
+ cell(t) {
50
+ var c;
51
+ const e = t.row.original;
52
+ return [
53
+ !((c = n.value.criteria_progress) == null ? void 0 : c.some(
54
+ (l) => l.criteria === e._id
55
+ )) && e.type == "MANUAL" ? S(v.FmButton, {
56
+ variant: "secondary",
57
+ label: "Mark as completed",
58
+ size: "md",
59
+ onClick: (l) => {
60
+ l.stopPropagation(), r(e._id.toString());
61
+ }
62
+ }) : null
63
+ ];
64
+ }
65
+ }
66
+ ], M = q(() => {
67
+ var e, o, c, l;
68
+ return (((o = (e = n.value) == null ? void 0 : e.criteria_progress) == null ? void 0 : o.filter(
69
+ (p) => {
70
+ var w;
71
+ return (w = n.value) == null ? void 0 : w.criteria.some(
72
+ (d) => d._id.toString() === p.criteria.toString()
73
+ );
74
+ }
75
+ )) || []).length == ((c = n.value) == null ? void 0 : c.criteria.length) && ((l = n.value) == null ? void 0 : l.status) != "COMPLETED";
76
+ });
77
+ async function r(t) {
78
+ var o;
79
+ const e = ce(le(n.value));
80
+ e.criteria_progress = [
81
+ {
82
+ criteria: t,
83
+ ref: `ADMIN:${(o = y.user) == null ? void 0 : o.id}:${(/* @__PURE__ */ new Date()).toISOString()}`,
84
+ completedAt: /* @__PURE__ */ new Date()
85
+ }
86
+ ], u(
87
+ async () => {
88
+ await R.updateCriteriaProgress(
89
+ n.value._id,
90
+ e
91
+ ), h.value = !1, k("refresh");
92
+ },
93
+ {
94
+ message: "Updating criteria progress",
95
+ successMessage: "Criteria progress updated successfully"
96
+ }
97
+ );
98
+ }
99
+ function a(t, e) {
100
+ h.value = t, n.value = e;
101
+ }
102
+ function _() {
103
+ h.value = !1;
104
+ }
105
+ return i({
106
+ showSheet: a,
107
+ hideSheet: _,
108
+ data: n
109
+ }), (t, e) => {
110
+ const o = x("FmButton"), c = x("FmTable"), l = x("FmSideSheet");
111
+ return B(), G(l, {
112
+ "max-width": 768,
113
+ modelValue: s(h),
114
+ "onUpdate:modelValue": e[1] || (e[1] = (p) => H(h) ? h.value = p : null),
115
+ header: "Referee Criteria"
116
+ }, {
117
+ default: J(() => [
118
+ s(M) ? (B(), T("div", pe, [
119
+ C(o, {
120
+ icon: "refresh",
121
+ label: "Refresh",
122
+ onClick: e[0] || (e[0] = Q((p) => r(s(n)._id), ["stop"]))
123
+ })
124
+ ])) : X("", !0),
125
+ I("div", fe, [
126
+ C(c, {
127
+ "row-data": s(n).criteria,
128
+ "hide-footer": !0,
129
+ "page-size": 100,
130
+ "column-defs": F
131
+ }, null, 8, ["row-data"])
132
+ ])
133
+ ]),
134
+ _: 1
135
+ }, 8, ["modelValue"]);
136
+ };
137
+ }
138
+ });
139
+ class he {
140
+ constructor() {
141
+ $(this, "data", []);
142
+ }
143
+ addRecord(i) {
144
+ this.data.push(i);
145
+ }
146
+ buildExcel() {
147
+ const i = D.book_new(), m = D.json_to_sheet(this.data);
148
+ return D.book_append_sheet(i, m, "Referrals"), i;
149
+ }
150
+ }
151
+ const _e = { class: "flex items-center justify-end" }, Be = /* @__PURE__ */ A({
152
+ __name: "Record",
153
+ setup(g) {
154
+ de();
155
+ const { minor: i } = U, m = V(null), k = [
156
+ {
157
+ header: "ID",
158
+ meta: {
159
+ maxWidth: "100px"
160
+ },
161
+ cell(r) {
162
+ return S("div", { class: "flex items-center" }, [
163
+ S(v.FmIcon, {
164
+ name: "content_copy",
165
+ outline: !0,
166
+ size: "sm",
167
+ class: "cursor-pointer mr-4",
168
+ onClick: (a) => {
169
+ a.preventDefault(), a.stopPropagation(), ae(r.row.original._id.toString());
170
+ }
171
+ }),
172
+ S(
173
+ "div",
174
+ { class: "pr-2 text-ellipsis overflow-hidden" },
175
+ r.row.original._id.toString()
176
+ )
177
+ ]);
178
+ },
179
+ enableSorting: !1
180
+ },
181
+ {
182
+ header: "Referer info",
183
+ enableSorting: !0,
184
+ cell(r) {
185
+ return r.row.original.pf_referer ? z(r.row.original.pf_referer, !0) : "N/A";
186
+ }
187
+ },
188
+ {
189
+ header: "Referee info",
190
+ enableSorting: !0,
191
+ cell(r) {
192
+ return r.row.original.pf_referee ? z(r.row.original.pf_referee, !0) : "N/A";
193
+ }
194
+ },
195
+ {
196
+ header: "Referee criteria",
197
+ accessorKey: "criteria",
198
+ id: "criteria",
199
+ cell(r) {
200
+ var e;
201
+ const _ = (((e = r.row.original.criteria_progress) == null ? void 0 : e.filter(
202
+ (o) => r.row.original.criteria.some(
203
+ (c) => c._id.toString() === o.criteria.toString()
204
+ )
205
+ )) || []).length, t = r.row.original.criteria.length;
206
+ return t === 0 ? S("div", "No criteria") : S("div", `${_}/${t} completed criteria`);
207
+ }
208
+ },
209
+ {
210
+ header: "Status",
211
+ id: "status",
212
+ cell(r) {
213
+ const a = r.row.original.status;
214
+ return S(v.FmChip, {
215
+ label: se.title(a.replace("_", " ")),
216
+ compact: !0,
217
+ class: a == "COMPLETED" ? "text-fm-color-typo-success bg-fm-color-system-success-100" : "text-fm-color-typo-primary bg-fm-color-system-primary-100"
218
+ });
219
+ }
220
+ }
221
+ ], { tableMeta: u, rowData: h, onSort: n, debouncedFetchData: y, onSearch: F } = re(R.readRecords);
222
+ async function M() {
223
+ const r = new he(), a = (await R.readRecords({
224
+ limit: 1,
225
+ skip: 0,
226
+ sortBy: f.sortBy,
227
+ descending: f.descending
228
+ })).meta.totalResources ?? 0, _ = f.rowsPerPage;
229
+ await i(
230
+ async () => {
231
+ var t, e, o, c;
232
+ for (let l = 0; l < a; l += _) {
233
+ const p = {
234
+ ...f,
235
+ limit: _,
236
+ skip: f.page - 1,
237
+ sortBy: f.sortBy,
238
+ descending: f.descending
239
+ }, w = await R.readRecords(p);
240
+ for (const d of w.resources) {
241
+ const N = (d.criteria || []).reduce(
242
+ (b, P) => {
243
+ var E;
244
+ const L = ((E = d.criteria_progress) == null ? void 0 : E.filter(
245
+ (O) => d.criteria.some(
246
+ (Y) => Y._id.toString() === O.criteria.toString()
247
+ )
248
+ )) || [];
249
+ return b[P.name] = L.length > 0 ? "Completed" : "In Progress", b;
250
+ },
251
+ {}
252
+ );
253
+ console.log(N);
254
+ const j = {
255
+ ID: d._id.toString(),
256
+ RefererName: ((t = d.pf_referer) == null ? void 0 : t.name) ?? "",
257
+ RefererPhone: ((e = d.pf_referer) == null ? void 0 : e.phoneNumber) ?? "",
258
+ RefereeName: ((o = d.pf_referee) == null ? void 0 : o.name) ?? "",
259
+ RefereePhone: ((c = d.pf_referee) == null ? void 0 : c.phoneNumber) ?? "",
260
+ ReferredAt: me(ue(d._id)).format(
261
+ "DD/MM/YYYY"
262
+ ),
263
+ Status: d.status,
264
+ Criteria: Object.entries(N).map(([b, P]) => `${b}: ${P}`).join(", ")
265
+ };
266
+ r.addRecord(j);
267
+ }
268
+ f.page++;
269
+ }
270
+ await oe(
271
+ r.buildExcel(),
272
+ `referrals-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
273
+ {
274
+ bookType: "xlsx",
275
+ bookSST: !1,
276
+ type: "array"
277
+ }
278
+ ), f.page = 1;
279
+ },
280
+ {
281
+ message: "Exporting referral records...",
282
+ successMessage: "Referral record exported successfully"
283
+ }
284
+ );
285
+ }
286
+ return Z(async () => {
287
+ await y();
288
+ }), (r, a) => {
289
+ const _ = x("FmSearch"), t = x("FmButton");
290
+ return B(), T(ee, null, [
291
+ I("div", null, [
292
+ I("div", _e, [
293
+ C(_, {
294
+ class: "mt-4",
295
+ modelValue: s(u).searchValue,
296
+ "onUpdate:modelValue": [
297
+ a[0] || (a[0] = (e) => s(u).searchValue = e),
298
+ s(F)
299
+ ],
300
+ placeholder: "Search",
301
+ collapsible: ""
302
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]),
303
+ C(t, {
304
+ icon: "ios_share",
305
+ variant: "tertiary",
306
+ onClick: M
307
+ })
308
+ ]),
309
+ C(te, {
310
+ loading: s(u).isLoading,
311
+ "row-data": s(h),
312
+ "row-count": s(u).totalRows,
313
+ "column-defs": k,
314
+ "shrink-at": !1,
315
+ "page-count": s(u).pageCount,
316
+ "page-index": s(u).pageIndex,
317
+ "page-size": s(u).pageSize,
318
+ onSortChange: s(n),
319
+ onPageChange: a[1] || (a[1] = (e) => s(y)({ pageSize: e.pageSize, pageIndex: e.pageIndex })),
320
+ onRowClick: a[2] || (a[2] = (e) => {
321
+ var o;
322
+ return (o = s(m)) == null ? void 0 : o.showSheet(!0, e.original);
323
+ })
324
+ }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"])
325
+ ]),
326
+ C(ge, {
327
+ ref_key: "updateCriteriaProgressSheetRef",
328
+ ref: m,
329
+ onRefresh: s(y)
330
+ }, null, 8, ["onRefresh"])
331
+ ], 64);
332
+ };
333
+ }
334
+ });
335
+ export {
336
+ Be as default
337
+ };