@feedmepos/mf-connect 0.1.0-beta.49 → 0.1.0-beta.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/dist/{Analytic-DTJ_SOI3.js → Analytic-D-yp03jJ.js} +11 -11
  2. package/dist/{App-Cls9g4sA.js → App-CeQWTGNK.js} +55 -51
  3. package/dist/{AuditLogs-xbOKPoQS.js → AuditLogs-2qzwcMXR.js} +8 -8
  4. package/dist/Bin-D1b2NbbA.js +191 -0
  5. package/dist/{Broadcast-UeoV6_0x.js → Broadcast-bKF9mIns.js} +9 -9
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BPl_0m0I.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B_q5K-cx.js} +6 -6
  7. package/dist/{Card-DSK_2b0H.js → Card-BCAyfBLi.js} +15 -15
  8. package/dist/{Collections-U63Y-tw8.js → Collections-Yz3F55bv.js} +5 -5
  9. package/dist/{Credit-CC1k4c10.js → Credit-Ceptt_g_.js} +9 -9
  10. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BUPBXZWy.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-TjNinQ8e.js} +28 -28
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DnjTCWUk.js → EffectSheet.vue_vue_type_style_index_0_lang-D3Bt-Vuu.js} +8 -8
  12. package/dist/{Experience-UBLCm5X8.js → Experience-DskHKzfo.js} +9 -9
  13. package/dist/{Game-DN8qNmAV.js → Game-IJ6X0AXM.js} +9 -9
  14. package/dist/{Index-Cp5Iqmgq.js → Index-CEl2y9X6.js} +93 -90
  15. package/dist/{Marketing-BTZSeQdq.js → Marketing-CWekLb4c.js} +6 -6
  16. package/dist/{Member-DKGZpaNY.js → Member-BUZPQ5Lb.js} +4 -4
  17. package/dist/{MemberList-BDv5O7_F.js → MemberList-BmVNqvbm.js} +24 -24
  18. package/dist/{MemberTransactions-Cp_g2uYy.js → MemberTransactions-B3XhEOK_.js} +1 -1
  19. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-TBeUosVs.js → MessageInput.vue_vue_type_script_setup_true_lang-C6YIbQtM.js} +2 -2
  20. package/dist/{Mission-Cte8Jtyj.js → Mission-Ci9ed_ph.js} +9 -9
  21. package/dist/{Overview-COeyTvML.js → Overview-CU9uhC-k.js} +399 -395
  22. package/dist/{Point-Cu5_d5X1.js → Point-wuuR7AEb.js} +9 -9
  23. package/dist/{Promotion-Cf8ct95o.js → Promotion-BMi3kyE8.js} +10 -10
  24. package/dist/Record-Wmh-g8WY.js +340 -0
  25. package/dist/{Reward-Bcx7bCEh.js → Reward-BL4lxhIB.js} +35 -35
  26. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CwApma5p.js → RewardGroup.vue_vue_type_script_setup_true_lang-CqXuTxun.js} +11 -11
  27. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Cg3bA1cc.js → RuleGroup.vue_vue_type_script_setup_true_lang-Dbik0PEw.js} +12 -12
  28. package/dist/{Segment-BfMpM62H.js → Segment-DObdjyYi.js} +14 -14
  29. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-CqZIHzA3.js → SelectItems.vue_vue_type_script_setup_true_lang-BAuM6qP5.js} +2 -2
  30. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-BfyRVxWM.js +147 -0
  31. package/dist/{Setting-Btim3PZq.js → Setting-Dqgnd7TR.js} +10 -10
  32. package/dist/{Store-BbiTlkAz.js → Store--Z4So__g.js} +18 -18
  33. package/dist/{StoreRewards-hbNthA-_.js → StoreRewards-DPFVXWwm.js} +13 -13
  34. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-Dv58wFeO.js → StoreTransactions.vue_vue_type_script_setup_true_lang-CNsdA106.js} +17 -17
  35. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BJvBo7sT.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CGOmGozY.js} +1 -1
  36. package/dist/{Tier-Ddj_dwc8.js → Tier-36IfhsnP.js} +19 -19
  37. package/dist/{Title-CA6b8UxN.js → Title-XH56OOug.js} +19 -19
  38. package/dist/{Transaction-yp6PDE_8.js → Transaction-BUQcSmBs.js} +2 -2
  39. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DoCmo4D7.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BVCfeG5T.js} +6 -6
  40. package/dist/Voucher-CvmH0kcF.js +353 -0
  41. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-aYXqbp2E.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BQOD6uEf.js} +15 -15
  42. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Bz77dtVR.js → ZodTextField.vue_vue_type_script_setup_true_lang-CcIcCt4N.js} +1 -1
  43. package/dist/{app-BpikVDEt.js → app-DeW5_DB0.js} +712 -547
  44. package/dist/{app-DG6xKzyo.js → app-TN8KEPMu.js} +1 -1
  45. package/dist/app.js +1 -1
  46. package/dist/{business-DPl8ug6e.js → business-D1mLhSME.js} +1 -1
  47. package/dist/{campaign-D9xub_rP.js → campaign-0tnkhu78.js} +11 -11
  48. package/dist/{campaign-CLF6bWG4.js → campaign-B-12Im0w.js} +2 -2
  49. package/dist/{campaign.enum-DJijW358.js → campaign.enum-C8m-HHZE.js} +1 -1
  50. package/dist/{campaign.fn-DgyMbDS2.js → campaign.fn-CxkhbK9i.js} +110 -110
  51. package/dist/{collectible.enum-q3RNa6ac.js → collectible.enum-6Syq-vQ6.js} +3 -3
  52. package/dist/{collection.fn-DQdOmMPm.js → collection.fn-BUj75Jp2.js} +2 -2
  53. package/dist/{dto-Gtphhk7f.js → dto-8wODhIIC.js} +7 -7
  54. package/dist/{effect-b6TK6WqX.js → effect-BEZEjcJu.js} +1 -1
  55. package/dist/{email-addresses-BOOXVJIb.js → email-addresses-PwjkdYYD.js} +1 -1
  56. package/dist/{export-DB-hJPwq.js → export-BB-0vgwy.js} +3 -3
  57. package/dist/{helper-DaoMEMRy.js → helper-DOt8-wns.js} +1 -1
  58. package/dist/{index-Dd_g3RuO.js → index-B1qUjniH.js} +1 -1
  59. package/dist/{index-tXvAp_RD.js → index-BTMIZz4v.js} +1 -1
  60. package/dist/{index-zaGTl_qB.js → index-By-GlmG7.js} +2 -2
  61. package/dist/index-C7zBkoZ4.js +115 -0
  62. package/dist/{index-CC24qW42.js → index-CNlHabtk.js} +1 -1
  63. package/dist/{index-BsYcA4d4.js → index-CXGiIgdK.js} +1 -1
  64. package/dist/{index-DplAli0B.js → index-Cjn1LVjC.js} +38 -35
  65. package/dist/{index-CGCV3Q39.js → index-CpfUrdgw.js} +3 -3
  66. package/dist/{index-rU6SAS58.js → index-DZuEmMyY.js} +3 -3
  67. package/dist/{index-lAMRbOeY.js → index-D_zwqIhq.js} +1 -1
  68. package/dist/{index-V4sEiiYS.js → index-DabUEw_c.js} +1 -1
  69. package/dist/{index-BeE1k0xs.js → index-X-FfC49l.js} +6 -6
  70. package/dist/{index.esm2017-BpKyZnrS.js → index.esm2017-DJOUiVjR.js} +1 -1
  71. package/dist/{loading-aAPveWkt.js → loading-aCWVsOPY.js} +1 -1
  72. package/dist/{membership-CdHkfBpk.js → membership-1etsHC5G.js} +6 -6
  73. package/dist/{money-yvgF4-JZ.js → money-DzWRURZ5.js} +1 -1
  74. package/dist/{number-5CZfadpH.js → number-BxIQO1i3.js} +1 -1
  75. package/dist/{objectid-Cz3ihSHZ.js → objectid-DjhmYkn-.js} +7 -7
  76. package/dist/{plugins-CFwYNZo0.js → plugins-CSPFAU50.js} +4 -4
  77. package/dist/{reward-DfX_2rEr.js → reward-Bh4Li9f0.js} +1 -1
  78. package/dist/{rule-D_HCGBXt.js → rule-CHTTTUFB.js} +3 -3
  79. package/dist/{rule-builder-DaJ2wADR.js → rule-builder-OHfUJTIA.js} +1 -1
  80. package/dist/{template-BFcHBZjo.js → template-ZGxXqkaC.js} +4 -4
  81. package/dist/{trigger-BnfqcoU-.js → trigger-Ogu5FDs0.js} +13 -13
  82. package/dist/{user-bXWIOEFL.js → user-DBuU81tO.js} +1 -1
  83. package/dist/{vue-i18n-kVKjcgAi.js → vue-i18n-CKpKQ6iE.js} +299 -299
  84. package/dist/{xlsx-C0oaHSzL.js → xlsx-DJDZBIeg.js} +1 -1
  85. package/package.json +1 -1
  86. package/dist/Record-BTsMyNzQ.js +0 -339
  87. package/dist/Voucher-CGB4koQI.js +0 -491
  88. package/dist/index-CSmO-8Va.js +0 -99
@@ -1,16 +1,16 @@
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 g, 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 } from "./plugins-CFwYNZo0.js";
5
- import { u as W } from "./loading-aAPveWkt.js";
6
- import { u as X } from "./business-DPl8ug6e.js";
7
- import { u as Y } from "./campaign-CLF6bWG4.js";
8
- import { g as V, a as I } from "./campaign-D9xub_rP.js";
4
+ import { p as Q } from "./plugins-CSPFAU50.js";
5
+ import { u as W } from "./loading-aCWVsOPY.js";
6
+ import { u as X } from "./business-D1mLhSME.js";
7
+ import { u as Y } from "./campaign-B-12Im0w.js";
8
+ import { g as V, a as I } from "./campaign-0tnkhu78.js";
9
9
  import { _ as Z } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
10
- import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BUPBXZWy.js";
11
- import { u as te } from "./template-BFcHBZjo.js";
12
- import { u as oe } from "./vue-i18n-kVKjcgAi.js";
13
- import { c as _ } from "./index-CSmO-8Va.js";
10
+ import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-TjNinQ8e.js";
11
+ import { u as te } from "./template-ZGxXqkaC.js";
12
+ import { u as oe } from "./vue-i18n-CKpKQ6iE.js";
13
+ import { c as _ } from "./index-C7zBkoZ4.js";
14
14
  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 = { class: "flex flex-col gap-16 text-center" }, ge = { class: "fm-typo-en-title-sm-800" }, _e = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, $e = /* @__PURE__ */ j({
15
15
  __name: "Point",
16
16
  setup(he) {
@@ -1,17 +1,17 @@
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 a, 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 } from "./plugins-CFwYNZo0.js";
5
- import { u as Z } from "./loading-aAPveWkt.js";
6
- import { u as ee } from "./business-DPl8ug6e.js";
7
- import { u as oe } from "./campaign-CLF6bWG4.js";
8
- import { u as te } from "./vue-i18n-kVKjcgAi.js";
9
- import { g as V } from "./campaign-D9xub_rP.js";
10
- import { e as L } from "./effect-b6TK6WqX.js";
4
+ import { c as O, p as I } from "./plugins-CSPFAU50.js";
5
+ import { u as Z } from "./loading-aCWVsOPY.js";
6
+ import { u as ee } from "./business-D1mLhSME.js";
7
+ import { u as oe } from "./campaign-B-12Im0w.js";
8
+ import { u as te } from "./vue-i18n-CKpKQ6iE.js";
9
+ import { g as V } from "./campaign-0tnkhu78.js";
10
+ import { e as L } from "./effect-BEZEjcJu.js";
11
11
  import { _ as ne } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
12
- import { _ as ae } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BUPBXZWy.js";
13
- import { u as se } from "./template-BFcHBZjo.js";
14
- import { c as u } from "./index-CSmO-8Va.js";
12
+ import { _ as ae } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-TjNinQ8e.js";
13
+ import { u as se } from "./template-ZGxXqkaC.js";
14
+ import { c as u } from "./index-C7zBkoZ4.js";
15
15
  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 = { class: "flex flex-col gap-16 text-center" }, ye = { class: "fm-typo-en-title-sm-800" }, ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Te = /* @__PURE__ */ H({
16
16
  __name: "Promotion",
17
17
  setup(_e) {
@@ -0,0 +1,340 @@
1
+ var q = Object.defineProperty;
2
+ var G = (g, o, m) => o in g ? q(g, o, { enumerable: !0, configurable: !0, writable: !0, value: m }) : g[o] = m;
3
+ var z = (g, o, m) => G(g, typeof o != "symbol" ? o + "" : o, m);
4
+ import { defineComponent as T, ref as B, computed as H, resolveComponent as C, openBlock as I, createBlock as J, unref as n, isRef as Q, withCtx as X, createElementBlock as U, createVNode as w, withModifiers as Z, createCommentVNode as ee, createElementVNode as N, h, onMounted as re, Fragment as te } from "vue";
5
+ import { u as oe, _ as ae } from "./usePagination-BeF5K3M7.js";
6
+ import { g as A } from "./user-DBuU81tO.js";
7
+ import { components as R } from "@feedmepos/ui-library";
8
+ import { a as se, c as ie } from "./plugins-CSPFAU50.js";
9
+ import { u as j } from "./vue-i18n-CKpKQ6iE.js";
10
+ import { u as L } from "./loading-aCWVsOPY.js";
11
+ import { useCoreStore as ne } from "@feedmepos/mf-common";
12
+ import { r as v } from "./index-DabUEw_c.js";
13
+ import { c as ce, a as le } from "./object-qECH92oz.js";
14
+ import { u as de } from "./membership-1etsHC5G.js";
15
+ import { u as V, w as me } from "./xlsx-DJDZBIeg.js";
16
+ import { e as f } from "./index-vh86FiIQ.js";
17
+ import { h as ue } from "./moment-BWErdI6_.js";
18
+ import { o as pe } from "./objectId-dwaoBfJX.js";
19
+ const fe = {
20
+ key: 0,
21
+ class: "flex justify-end mb-16"
22
+ }, ge = { class: "flex flex-col space-y-16 pr-12" }, he = /* @__PURE__ */ T({
23
+ __name: "UpdateCriteriaProgressSheet",
24
+ emits: ["refresh"],
25
+ setup(g, { expose: o, emit: m }) {
26
+ const y = m;
27
+ j();
28
+ const { minor: k } = L, l = B(!1), d = B({}), F = ne(), S = [
29
+ {
30
+ header: "Criteria title",
31
+ accessorFn: (a) => a.name
32
+ },
33
+ {
34
+ header: "Status",
35
+ cell(a) {
36
+ var u;
37
+ const e = a.row.original, r = (u = d.value.criteria_progress) == null ? void 0 : u.find(
38
+ (_) => _.criteria === e._id
39
+ ), i = r ? "Completed" : "Pending", c = r ? "text-fm-color-typo-success bg-fm-color-system-success-100" : "text-fm-color-typo-warning bg-fm-color-system-warning-100";
40
+ return [
41
+ h(R.FmChip, {
42
+ label: i,
43
+ compact: !0,
44
+ class: c
45
+ })
46
+ ];
47
+ }
48
+ },
49
+ {
50
+ id: "actions",
51
+ cell(a) {
52
+ var i;
53
+ const e = a.row.original;
54
+ return [
55
+ !((i = d.value.criteria_progress) == null ? void 0 : i.some(
56
+ (c) => c.criteria === e._id
57
+ )) && e.type == "MANUAL" ? h(R.FmButton, {
58
+ variant: "secondary",
59
+ label: "Mark as completed",
60
+ size: "md",
61
+ onClick: (c) => {
62
+ c.stopPropagation(), x(e._id.toString());
63
+ }
64
+ }) : null
65
+ ];
66
+ }
67
+ }
68
+ ], M = H(() => {
69
+ var e, r, i, c;
70
+ return (((r = (e = d.value) == null ? void 0 : e.criteria_progress) == null ? void 0 : r.filter(
71
+ (u) => {
72
+ var _;
73
+ return (_ = d.value) == null ? void 0 : _.criteria.some(
74
+ (P) => P._id.toString() === u.criteria.toString()
75
+ );
76
+ }
77
+ )) || []).length == ((i = d.value) == null ? void 0 : i.criteria.length) && ((c = d.value) == null ? void 0 : c.status) != "COMPLETED";
78
+ });
79
+ async function x(a) {
80
+ var r;
81
+ const e = ce(le(d.value));
82
+ e.criteria_progress = [
83
+ {
84
+ criteria: a,
85
+ ref: `ADMIN:${(r = F.user) == null ? void 0 : r.id}:${(/* @__PURE__ */ new Date()).toISOString()}`,
86
+ completedAt: /* @__PURE__ */ new Date()
87
+ }
88
+ ], k(
89
+ async () => {
90
+ await v.updateCriteriaProgress(
91
+ d.value._id,
92
+ e
93
+ ), l.value = !1, y("refresh");
94
+ },
95
+ {
96
+ message: "Updating criteria progress",
97
+ successMessage: "Criteria progress updated successfully"
98
+ }
99
+ );
100
+ }
101
+ function t(a, e) {
102
+ l.value = a, d.value = e;
103
+ }
104
+ function s() {
105
+ l.value = !1;
106
+ }
107
+ return o({
108
+ showSheet: t,
109
+ hideSheet: s,
110
+ data: d
111
+ }), (a, e) => {
112
+ const r = C("FmButton"), i = C("FmTable"), c = C("FmSideSheet");
113
+ return I(), J(c, {
114
+ "max-width": 768,
115
+ modelValue: n(l),
116
+ "onUpdate:modelValue": e[1] || (e[1] = (u) => Q(l) ? l.value = u : null),
117
+ header: "Referee Criteria"
118
+ }, {
119
+ default: X(() => [
120
+ n(M) ? (I(), U("div", fe, [
121
+ w(r, {
122
+ icon: "refresh",
123
+ label: "Refresh",
124
+ onClick: e[0] || (e[0] = Z((u) => x(n(d)._id), ["stop"]))
125
+ })
126
+ ])) : ee("", !0),
127
+ N("div", ge, [
128
+ w(i, {
129
+ "row-data": n(d).criteria,
130
+ "hide-footer": !0,
131
+ "page-size": 100,
132
+ "column-defs": S
133
+ }, null, 8, ["row-data"])
134
+ ])
135
+ ]),
136
+ _: 1
137
+ }, 8, ["modelValue"]);
138
+ };
139
+ }
140
+ });
141
+ class _e {
142
+ constructor() {
143
+ z(this, "data", []);
144
+ }
145
+ addRecord(o) {
146
+ this.data.push(o);
147
+ }
148
+ buildExcel() {
149
+ const o = V.book_new(), m = V.json_to_sheet(this.data);
150
+ return V.book_append_sheet(o, m, "Referrals"), o;
151
+ }
152
+ }
153
+ const we = { class: "flex items-center justify-end" }, Ee = /* @__PURE__ */ T({
154
+ __name: "Record",
155
+ setup(g) {
156
+ const { t: o } = j();
157
+ de();
158
+ const { minor: m } = L, y = B(null), k = [
159
+ {
160
+ header: "ID",
161
+ meta: {
162
+ maxWidth: "100px"
163
+ },
164
+ cell(t) {
165
+ return h("div", { class: "flex items-center" }, [
166
+ h(R.FmIcon, {
167
+ name: "content_copy",
168
+ outline: !0,
169
+ size: "sm",
170
+ class: "cursor-pointer mr-4",
171
+ onClick: (s) => {
172
+ s.preventDefault(), s.stopPropagation(), se(t.row.original._id.toString());
173
+ }
174
+ }),
175
+ h(
176
+ "div",
177
+ { class: "pr-2 text-ellipsis overflow-hidden" },
178
+ t.row.original._id.toString()
179
+ )
180
+ ]);
181
+ },
182
+ enableSorting: !1
183
+ },
184
+ {
185
+ header: o("connect.referral.record.referer_info"),
186
+ enableSorting: !0,
187
+ cell(t) {
188
+ return t.row.original.pf_referer ? A(t.row.original.pf_referer, !0) : "N/A";
189
+ }
190
+ },
191
+ {
192
+ header: o("connect.referral.record.referee_info"),
193
+ enableSorting: !0,
194
+ cell(t) {
195
+ return t.row.original.pf_referee ? A(t.row.original.pf_referee, !0) : "N/A";
196
+ }
197
+ },
198
+ {
199
+ header: o("connect.referral.record.referee_criteria"),
200
+ accessorKey: "criteria",
201
+ id: "criteria",
202
+ cell(t) {
203
+ var r;
204
+ const a = (((r = t.row.original.criteria_progress) == null ? void 0 : r.filter(
205
+ (i) => t.row.original.criteria.some(
206
+ (c) => c._id.toString() === i.criteria.toString()
207
+ )
208
+ )) || []).length, e = t.row.original.criteria.length;
209
+ return e === 0 ? h("div", "No criteria") : h("div", `${a}/${e} completed criteria`);
210
+ }
211
+ },
212
+ {
213
+ header: o("connect.referral.record.status"),
214
+ id: "status",
215
+ cell(t) {
216
+ const s = t.row.original.status;
217
+ return h(R.FmChip, {
218
+ label: ie.title(s.replace("_", " ")),
219
+ compact: !0,
220
+ class: s == "COMPLETED" ? "text-fm-color-typo-success bg-fm-color-system-success-100" : "text-fm-color-typo-primary bg-fm-color-system-primary-100"
221
+ });
222
+ }
223
+ }
224
+ ], { tableMeta: l, rowData: d, onSort: F, debouncedFetchData: S, onSearch: M } = oe(v.readRecords);
225
+ async function x() {
226
+ const t = new _e(), s = (await v.readRecords({
227
+ limit: 1,
228
+ skip: 0,
229
+ sortBy: f.sortBy,
230
+ descending: f.descending
231
+ })).meta.totalResources ?? 0, a = f.rowsPerPage;
232
+ await m(
233
+ async () => {
234
+ var e, r, i, c;
235
+ for (let u = 0; u < s; u += a) {
236
+ const _ = {
237
+ ...f,
238
+ limit: a,
239
+ skip: f.page - 1,
240
+ sortBy: f.sortBy,
241
+ descending: f.descending
242
+ }, P = await v.readRecords(_);
243
+ for (const p of P.resources) {
244
+ const E = (p.criteria || []).reduce(
245
+ (b, D) => {
246
+ var $;
247
+ const Y = (($ = p.criteria_progress) == null ? void 0 : $.filter(
248
+ (K) => p.criteria.some(
249
+ (W) => W._id.toString() === K.criteria.toString()
250
+ )
251
+ )) || [];
252
+ return b[D.name] = Y.length > 0 ? "Completed" : "In Progress", b;
253
+ },
254
+ {}
255
+ );
256
+ console.log(E);
257
+ const O = {
258
+ ID: p._id.toString(),
259
+ RefererName: ((e = p.pf_referer) == null ? void 0 : e.name) ?? "",
260
+ RefererPhone: ((r = p.pf_referer) == null ? void 0 : r.phoneNumber) ?? "",
261
+ RefereeName: ((i = p.pf_referee) == null ? void 0 : i.name) ?? "",
262
+ RefereePhone: ((c = p.pf_referee) == null ? void 0 : c.phoneNumber) ?? "",
263
+ ReferredAt: ue(pe(p._id)).format(
264
+ "DD/MM/YYYY"
265
+ ),
266
+ Status: p.status,
267
+ Criteria: Object.entries(E).map(([b, D]) => `${b}: ${D}`).join(", ")
268
+ };
269
+ t.addRecord(O);
270
+ }
271
+ f.page++;
272
+ }
273
+ await me(
274
+ t.buildExcel(),
275
+ `referrals-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
276
+ {
277
+ bookType: "xlsx",
278
+ bookSST: !1,
279
+ type: "array"
280
+ }
281
+ ), f.page = 1;
282
+ },
283
+ {
284
+ message: "Exporting referral records...",
285
+ successMessage: "Referral record exported successfully"
286
+ }
287
+ );
288
+ }
289
+ return re(async () => {
290
+ await S();
291
+ }), (t, s) => {
292
+ const a = C("FmSearch"), e = C("FmButton");
293
+ return I(), U(te, null, [
294
+ N("div", null, [
295
+ N("div", we, [
296
+ w(a, {
297
+ class: "mt-4",
298
+ modelValue: n(l).searchValue,
299
+ "onUpdate:modelValue": [
300
+ s[0] || (s[0] = (r) => n(l).searchValue = r),
301
+ n(M)
302
+ ],
303
+ placeholder: "Search",
304
+ collapsible: ""
305
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]),
306
+ w(e, {
307
+ icon: "ios_share",
308
+ variant: "tertiary",
309
+ onClick: x
310
+ })
311
+ ]),
312
+ w(ae, {
313
+ loading: n(l).isLoading,
314
+ "row-data": n(d),
315
+ "row-count": n(l).totalRows,
316
+ "column-defs": k,
317
+ "shrink-at": !1,
318
+ "page-count": n(l).pageCount,
319
+ "page-index": n(l).pageIndex,
320
+ "page-size": n(l).pageSize,
321
+ onSortChange: n(F),
322
+ onPageChange: s[1] || (s[1] = (r) => n(S)({ pageSize: r.pageSize, pageIndex: r.pageIndex })),
323
+ onRowClick: s[2] || (s[2] = (r) => {
324
+ var i;
325
+ return (i = n(y)) == null ? void 0 : i.showSheet(!0, r.original);
326
+ })
327
+ }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"])
328
+ ]),
329
+ w(he, {
330
+ ref_key: "updateCriteriaProgressSheetRef",
331
+ ref: y,
332
+ onRefresh: n(S)
333
+ }, null, 8, ["onRefresh"])
334
+ ], 64);
335
+ };
336
+ }
337
+ });
338
+ export {
339
+ Ee as default
340
+ };
@@ -1,26 +1,26 @@
1
- import { defineComponent as X, ref as x, computed as H, resolveComponent as w, openBlock as b, createBlock as h, unref as t, isRef as Z, withCtx as A, createElementVNode as f, createVNode as d, createCommentVNode as k, createElementBlock as M, Fragment as Y, h as F, onMounted as q, toDisplayString as B } from "vue";
1
+ import { defineComponent as X, ref as x, computed as H, resolveComponent as w, openBlock as b, createBlock as h, unref as t, isRef as Z, withCtx as A, createElementVNode as f, createVNode as d, createCommentVNode as k, createElementBlock as M, Fragment as Y, h as O, onMounted as q, toDisplayString as B } from "vue";
2
2
  import { _ as z } from "./campaign-CpzFl8Vr.js";
3
3
  import { useDialog as Q, components as L } from "@feedmepos/ui-library";
4
- import { u as G } from "./loading-aAPveWkt.js";
5
- import { u as J, C as ee } from "./membership-CdHkfBpk.js";
6
- import { f as j, p as te } from "./plugins-CFwYNZo0.js";
7
- import { u as oe } from "./vue-i18n-kVKjcgAi.js";
4
+ import { u as G } from "./loading-aCWVsOPY.js";
5
+ import { u as J, C as ee } from "./membership-1etsHC5G.js";
6
+ import { f as j, p as te } from "./plugins-CSPFAU50.js";
7
+ import { u as oe } from "./vue-i18n-CKpKQ6iE.js";
8
8
  import { c as ae } from "./object-qECH92oz.js";
9
- import { Z as O } from "./zod-Bg2FbC-D.js";
10
- import "./index-zaGTl_qB.js";
11
- import { F as N } from "./index-rU6SAS58.js";
9
+ import { Z as _ } from "./zod-Bg2FbC-D.js";
10
+ import "./index-By-GlmG7.js";
11
+ import { F as N } from "./index-DZuEmMyY.js";
12
12
  import { useCoreStore as le } from "@feedmepos/mf-common";
13
- import { _ as ne, a as ie } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-aYXqbp2E.js";
14
- import { _ as re } from "./EffectSheet.vue_vue_type_style_index_0_lang-DnjTCWUk.js";
13
+ import { _ as ne, a as ie } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-BQOD6uEf.js";
14
+ import { b as re } from "./EffectSheet.vue_vue_type_style_index_0_lang-D3Bt-Vuu.js";
15
15
  import { J as K } from "./JsonViewer-v8_C7l5N.js";
16
- import { _ as se } from "./ZodTextField.vue_vue_type_script_setup_true_lang-Bz77dtVR.js";
17
- import { i as de } from "./helper-DaoMEMRy.js";
18
- import { u as pe, r as P } from "./reward-DfX_2rEr.js";
19
- import "./index-CC24qW42.js";
20
- import { C as ce } from "./campaign.fn-DgyMbDS2.js";
21
- import { e as me } from "./effect-b6TK6WqX.js";
16
+ import { _ as se } from "./ZodTextField.vue_vue_type_script_setup_true_lang-CcIcCt4N.js";
17
+ import { i as de } from "./helper-DOt8-wns.js";
18
+ import { u as pe, r as P } from "./reward-Bh4Li9f0.js";
19
+ import "./index-CNlHabtk.js";
20
+ import { C as ce } from "./campaign.fn-CxkhbK9i.js";
21
+ import { e as me } from "./effect-BEZEjcJu.js";
22
22
  import { useRouter as ue } from "vue-router";
23
- import { R as ye } from "./app-BpikVDEt.js";
23
+ import { R as ye } from "./app-DeW5_DB0.js";
24
24
  const fe = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__ */ X({
25
25
  __name: "EditRewardSheet",
26
26
  emits: ["update"],
@@ -39,7 +39,7 @@ const fe = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__
39
39
  const l = R.value.safeParse(a.value);
40
40
  return l.success ? [] : l.error.errors;
41
41
  });
42
- function _(l, e) {
42
+ function F(l, e) {
43
43
  l && (y.value = void 0, a.value = e), v.value = l;
44
44
  }
45
45
  const D = I;
@@ -93,7 +93,7 @@ const fe = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__
93
93
  }
94
94
  const V = x();
95
95
  return n({
96
- showSheet: _
96
+ showSheet: F
97
97
  }), (l, e) => {
98
98
  const o = w("FmSelect"), i = w("FmForm"), m = w("FmButton"), g = w("FmSideSheet");
99
99
  return b(), h(g, {
@@ -137,8 +137,8 @@ const fe = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__
137
137
  modelValue: t(a).name,
138
138
  "onUpdate:modelValue": e[0] || (e[0] = (s) => t(a).name = s),
139
139
  label: "Reward Name",
140
- schema: t(O).typeAtPath(t(R), "name", []),
141
- "error-text": t(O).helperText(t(u), "name")
140
+ schema: t(_).typeAtPath(t(R), "name", []),
141
+ "error-text": t(_).helperText(t(u), "name")
142
142
  }, null, 8, ["modelValue", "schema", "error-text"]),
143
143
  d(o, {
144
144
  label: "Reward Type",
@@ -168,12 +168,12 @@ const fe = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__
168
168
  key: 0,
169
169
  class: "mt-[-8px]",
170
170
  rules: [
171
- t(O).ruleAtPath(t(R), "option.earningOption", [
171
+ t(_).ruleAtPath(t(R), "option.earningOption", [
172
172
  t(a).option.type
173
173
  ])
174
174
  ],
175
- "helper-state": t(O).helperState(t(u), "option.earningOption"),
176
- "error-text": t(O).helperText(t(u), "option.earningOption"),
175
+ "helper-state": t(_).helperState(t(u), "option.earningOption"),
176
+ "error-text": t(_).helperText(t(u), "option.earningOption"),
177
177
  "fixed-type": !0,
178
178
  "model-value": t(a).option.earningOption,
179
179
  "onUpdate:modelValue": e[1] || (e[1] = (s) => t(a).option.earningOption = s)
@@ -188,7 +188,7 @@ const fe = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__
188
188
  )) == null ? void 0 : E.raw.type) === "CREDIT",
189
189
  type: t(a).option.type === "VOUCHER" ? "range" : "custom",
190
190
  rules: [
191
- t(O).ruleAtPath(t(R), "option.validityOption", [
191
+ t(_).ruleAtPath(t(R), "option.validityOption", [
192
192
  t(a).option.type
193
193
  ])
194
194
  ],
@@ -224,7 +224,7 @@ const fe = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__
224
224
  }, p = J(), C = pe(), { global: v, minor: a } = G, y = ue(), R = Q(), u = x({
225
225
  searchKey: "",
226
226
  columnFilters: []
227
- }), _ = H(() => C.rewards);
227
+ }), F = H(() => C.rewards);
228
228
  function D(e) {
229
229
  y.push({
230
230
  name: ye["$connect-STORE_REWARD_COLLECTIONS"],
@@ -260,8 +260,8 @@ const fe = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__
260
260
  {
261
261
  header: n("connect.storeRewards.table.actions"),
262
262
  cell(e) {
263
- return F("div", { class: "flex items-center justify-end gap-4" }, [
264
- F(
263
+ return O("div", { class: "flex items-center justify-end gap-4" }, [
264
+ O(
265
265
  L.FmMenu,
266
266
  {
267
267
  placement: "bottom-end",
@@ -270,13 +270,13 @@ const fe = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__
270
270
  }
271
271
  },
272
272
  {
273
- "menu-button": () => F(L.FmButton, {
273
+ "menu-button": () => O(L.FmButton, {
274
274
  icon: "more_vert",
275
275
  iconColor: "neutral-gray-400",
276
276
  variant: "tertiary"
277
277
  }),
278
278
  default: () => [
279
- e.row.original.option.type === "VOUCHER" && F(L.FmMenuItem, {
279
+ e.row.original.option.type === "VOUCHER" && O(L.FmMenuItem, {
280
280
  label: "View collections",
281
281
  onClick: async (o) => {
282
282
  o.stopPropagation(), D(
@@ -284,7 +284,7 @@ const fe = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__
284
284
  );
285
285
  }
286
286
  }),
287
- F(
287
+ O(
288
288
  L.FmMenuItem,
289
289
  {
290
290
  onClick: async (o) => {
@@ -292,7 +292,7 @@ const fe = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__
292
292
  }
293
293
  },
294
294
  {
295
- label: F(
295
+ label: O(
296
296
  "div",
297
297
  {
298
298
  class: "text-fm-color-typo-error fm-typo-en-body-md-400"
@@ -385,7 +385,7 @@ const fe = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__
385
385
  })
386
386
  }, null, 8, ["title", "actions"]),
387
387
  f("div", ve, [
388
- t(_) && t(_).length > 0 ? (b(), M(Y, { key: 0 }, [
388
+ t(F) && t(F).length > 0 ? (b(), M(Y, { key: 0 }, [
389
389
  f("div", ge, [
390
390
  o[6] || (o[6] = f("div", { class: "flex gap-8" }, null, -1)),
391
391
  d(m, {
@@ -397,12 +397,12 @@ const fe = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__
397
397
  }, null, 8, ["modelValue"])
398
398
  ]),
399
399
  d(g, {
400
- "row-data": t(_),
400
+ "row-data": t(F),
401
401
  "column-defs": S,
402
402
  "search-value": t(u).searchKey,
403
403
  "column-filter": t(u).columnFilters,
404
404
  onRowClick: o[3] || (o[3] = (c) => V(c.original)),
405
- "hide-footer": t(_).length < 10
405
+ "hide-footer": t(F).length < 10
406
406
  }, null, 8, ["row-data", "search-value", "column-filter", "hide-footer"])
407
407
  ], 64)) : (b(), h(E, {
408
408
  key: 1,
@@ -1,19 +1,19 @@
1
1
  import { ref as p, defineComponent as T, computed as x, resolveComponent as y, openBlock as U, createBlock as G, unref as e, isRef as $, withCtx as b, createElementVNode as v, createVNode as u, toDisplayString as j } from "vue";
2
- import { u as B } from "./loading-aAPveWkt.js";
2
+ import { u as B } from "./loading-aCWVsOPY.js";
3
3
  import { J as P } from "./JsonViewer-v8_C7l5N.js";
4
- import { _ as D } from "./ZodTextField.vue_vue_type_script_setup_true_lang-Bz77dtVR.js";
5
- import { _ as I } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-DoCmo4D7.js";
4
+ import { _ as D } from "./ZodTextField.vue_vue_type_script_setup_true_lang-CcIcCt4N.js";
5
+ import { _ as I } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-BVCfeG5T.js";
6
6
  import { Z as L } from "./zod-Bg2FbC-D.js";
7
7
  import { u as V } from "./app-wDQR6dpb.js";
8
8
  import { defineStore as N } from "pinia";
9
- import { r as k } from "./index-V4sEiiYS.js";
10
- import { c as E } from "./index-BeE1k0xs.js";
11
- import "./index-DplAli0B.js";
12
- import "./index-zaGTl_qB.js";
13
- import "./index-Dd_g3RuO.js";
14
- import "./index-rU6SAS58.js";
15
- import "./plugins-CFwYNZo0.js";
16
- import { u as J } from "./vue-i18n-kVKjcgAi.js";
9
+ import { r as k } from "./index-DabUEw_c.js";
10
+ import { c as E } from "./index-X-FfC49l.js";
11
+ import "./index-Cjn1LVjC.js";
12
+ import "./index-By-GlmG7.js";
13
+ import "./index-B1qUjniH.js";
14
+ import "./index-DZuEmMyY.js";
15
+ import "./plugins-CSPFAU50.js";
16
+ import { u as J } from "./vue-i18n-CKpKQ6iE.js";
17
17
  import { c as C } from "./object-qECH92oz.js";
18
18
  import { useDialog as Z } from "@feedmepos/ui-library";
19
19
  const A = N("mf-connect-referral", () => {
@@ -1,21 +1,21 @@
1
1
  import { defineComponent as I, computed as q, resolveComponent as k, openBlock as n, createElementBlock as V, createElementVNode as R, createVNode as v, unref as e, createTextVNode as te, toDisplayString as W, withCtx as h, onMounted as z, createBlock as f, createCommentVNode as B, ref as $, Fragment as M, renderList as A, normalizeClass as L, watch as me, resolveDynamicComponent as ae, onBeforeMount as re, isRef as ie, createSlots as de } from "vue";
2
- import { a as pe, C as ye, b as ce, c as ve, d as be } from "./index-zaGTl_qB.js";
3
- import { R as D, a as fe } from "./rule-builder-DaJ2wADR.js";
4
- import { a as ge, R as S, S as ke, C as P, W as Ee, T as ne, O as Ve } from "./rule-D_HCGBXt.js";
5
- import { p as Te } from "./plugins-CFwYNZo0.js";
2
+ import { a as pe, C as ye, b as ce, c as ve, d as be } from "./index-By-GlmG7.js";
3
+ import { R as D, a as fe } from "./rule-builder-OHfUJTIA.js";
4
+ import { a as ge, R as S, S as ke, C as P, W as Ee, T as ne, O as Ve } from "./rule-CHTTTUFB.js";
5
+ import { p as Te } from "./plugins-CSPFAU50.js";
6
6
  import { useDialog as le, useDialogChild as ue } from "@feedmepos/ui-library";
7
7
  import { h as J } from "./moment-BWErdI6_.js";
8
- import { z as Fe } from "./app-BpikVDEt.js";
9
- import { u as Q } from "./membership-CdHkfBpk.js";
10
- import { u as X } from "./business-DPl8ug6e.js";
8
+ import { z as Fe } from "./app-DeW5_DB0.js";
9
+ import { u as Q } from "./membership-1etsHC5G.js";
10
+ import { u as X } from "./business-D1mLhSME.js";
11
11
  import { _ as Y } from "./CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js";
12
12
  import { c as se } from "./object-qECH92oz.js";
13
13
  import { Z } from "./zod-Bg2FbC-D.js";
14
- import { _ as Se } from "./SelectItems.vue_vue_type_script_setup_true_lang-CqZIHzA3.js";
15
- import "./index-BeE1k0xs.js";
16
- import "./index-DplAli0B.js";
17
- import "./index-Dd_g3RuO.js";
18
- import "./index-rU6SAS58.js";
14
+ import { _ as Se } from "./SelectItems.vue_vue_type_script_setup_true_lang-BAuM6qP5.js";
15
+ import "./index-X-FfC49l.js";
16
+ import "./index-Cjn1LVjC.js";
17
+ import "./index-B1qUjniH.js";
18
+ import "./index-DZuEmMyY.js";
19
19
  const Ue = { class: "flex items-center justify-between" }, Ce = { class: "flex items-center gap-8 xs:flex-wrap" }, xe = { class: "text-fm-color-primary line-clamp-1 text-ellipsis" }, Re = /* @__PURE__ */ I({
20
20
  __name: "RuleEntry",
21
21
  props: {