@feedmepos/mf-connect 0.1.98-beta.40 → 0.1.98-beta.41

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 (151) hide show
  1. package/dist/App-C6JJ9uQ8.js +4785 -0
  2. package/dist/AuditLogs-CAlgtDgx.js +2014 -0
  3. package/dist/Bin-D8jwhwER.js +166 -0
  4. package/dist/Broadcast-CP8DRfkT.js +269 -0
  5. package/dist/CampaignAnalytic-MVjYBFvu.js +1826 -0
  6. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DeLURz87.js +122 -0
  7. package/dist/Card-QribXJwZ.js +911 -0
  8. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
  9. package/dist/Collections-X9xbt43V.js +541 -0
  10. package/dist/Credit-QmbsW1eb.js +286 -0
  11. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
  12. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +58 -0
  13. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-ClNieHSo.js +3382 -0
  14. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CrGHTNhg.js +351 -0
  15. package/dist/Experience-CPGMg847.js +285 -0
  16. package/dist/FileSaver.min-CK67LsPG.js +74 -0
  17. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  18. package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +52 -0
  19. package/dist/Game-BrkiEFCS.js +356 -0
  20. package/dist/GiftCardSetup-DXNBHF1A.js +542 -0
  21. package/dist/Grab-BgtDzK1B.js +301 -0
  22. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-Dzv2AkKN.js +145 -0
  23. package/dist/Index-KJgzalOd.js +259 -0
  24. package/dist/JsonViewer-v8_C7l5N.js +87 -0
  25. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-C6SBLJGQ.js +48 -0
  26. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-Dj74lJ7b.js +18737 -0
  27. package/dist/LoyaltyDashboard-B2JpbC01.js +1345 -0
  28. package/dist/MainLayout-DlfTKHQ-.js +143 -0
  29. package/dist/Marketing-Crx_JQpi.js +236 -0
  30. package/dist/MarketingMaterialEdit-BfsdcMXJ.js +1036 -0
  31. package/dist/Member-C50Nrsko.js +281 -0
  32. package/dist/MemberList-C9uUKw1o.js +1603 -0
  33. package/dist/MemberOverview-wL_ailso.js +58 -0
  34. package/dist/MemberTransactions-DZ7zPOHX.js +45 -0
  35. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Du_ZGsbX.js +60957 -0
  36. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Bg_0YlwG.js +38 -0
  37. package/dist/Mission-D_km8zi6.js +360 -0
  38. package/dist/Overview-BBieK6qQ.js +1080 -0
  39. package/dist/Overview-B_kmLOcc.js +1316 -0
  40. package/dist/Point-D0q9N7f9.js +288 -0
  41. package/dist/Promotion-DoFTy-NK.js +423 -0
  42. package/dist/Queue-Dh5sDRHW.js +261 -0
  43. package/dist/Record-0owEBKqN.js +342 -0
  44. package/dist/Review-DV2fnpOH.js +45 -0
  45. package/dist/ReviewFacebookCallback-D8mnAPzR.js +238 -0
  46. package/dist/ReviewGoogleCallback-CLzt_ox2.js +213 -0
  47. package/dist/Reward-Co20Xrss.js +442 -0
  48. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-0qU49c47.js +150 -0
  49. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-qdvaXPhJ.js +1913 -0
  50. package/dist/Segment-7dQKeHWK.js +1017 -0
  51. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BUVrUifO.js +181 -0
  52. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-DDsV9TD9.js +189 -0
  53. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-DqPZpddc.js +226 -0
  54. package/dist/Setting-Bvahxs-y.js +2047 -0
  55. package/dist/SettingAdvertisements-fbXLRwfb.js +264 -0
  56. package/dist/Settings-C_HWDFN8.js +179 -0
  57. package/dist/Store-8yBKDR1b.js +2413 -0
  58. package/dist/StoreRewards-DKaJvoJs.js +540 -0
  59. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-D23XzJD7.js +1075 -0
  60. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-JaFhCK_L.js +7007 -0
  61. package/dist/Tier-CD-CjXC3.js +972 -0
  62. package/dist/Title-C_lcgye8.js +569 -0
  63. package/dist/Transaction-BvUYm-rT.js +39 -0
  64. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-C3Yacz7K.js +130 -0
  65. package/dist/Voucher-CYaG0GLU.js +444 -0
  66. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DF2JqzRe.js +421 -0
  67. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-B4UPqSNc.js +56 -0
  68. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  69. package/dist/app-CE5hQ4Uq.js +60740 -0
  70. package/dist/app-wDQR6dpb.js +39 -0
  71. package/dist/app.js +7 -0
  72. package/dist/business-CE_4siXc.js +82 -0
  73. package/dist/campaign-BP6rvSpg.js +255 -0
  74. package/dist/campaign-CXQtKpeb.js +100 -0
  75. package/dist/campaign-CpzFl8Vr.js +4 -0
  76. package/dist/campaign.enum-Dx-Zo68Q.js +26 -0
  77. package/dist/campaign.fn-DKnBpE1N.js +776 -0
  78. package/dist/collectible.enum-Liy2wH3s.js +19 -0
  79. package/dist/collection.fn-Cg16QZSp.js +26 -0
  80. package/dist/duplicateCampaign-DbtVAGsT.js +51 -0
  81. package/dist/effect-CLI8NI4O.js +89 -0
  82. package/dist/email-addresses-DlLiZ1io.js +705 -0
  83. package/dist/export-6Hr34dBU.js +97 -0
  84. package/dist/feedme.ico +0 -0
  85. package/dist/google-C3S8u0mT.js +4 -0
  86. package/dist/helper-vkjFqj70.js +86 -0
  87. package/dist/index-BIyKgw4m.js +72 -0
  88. package/dist/index-BLQJ-rv3.js +31 -0
  89. package/dist/index-BbTIqReL.js +67 -0
  90. package/dist/index-BuMfQxMf.js +897 -0
  91. package/dist/index-C8cXXcLk.js +45 -0
  92. package/dist/index-CSVhIZSY.js +8919 -0
  93. package/dist/index-CVHacTbc.js +151 -0
  94. package/dist/index-C_H8jFYf.js +2743 -0
  95. package/dist/index-CmNsGhDf.js +2706 -0
  96. package/dist/index-CnTeeRyJ.js +53 -0
  97. package/dist/index-CuvNtC_M.js +61 -0
  98. package/dist/index-CzbNobLv.js +1139 -0
  99. package/dist/index-D06n1h1b.js +146 -0
  100. package/dist/index-D4SDAfbP.js +27550 -0
  101. package/dist/index-DVnYQ3Hs.js +85 -0
  102. package/dist/index-DcjnS5Sv.js +28900 -0
  103. package/dist/index-Dx9h0FNH.js +3 -0
  104. package/dist/index-YgP4ihQL.js +32 -0
  105. package/dist/index-kedErkLZ.js +2963 -0
  106. package/dist/index-lnQT4P3d.js +55 -0
  107. package/dist/index-vh86FiIQ.js +10 -0
  108. package/dist/index.esm2017-Jhv2lkrq.js +3069 -0
  109. package/dist/loading-NY-FPxVY.js +72 -0
  110. package/dist/lodash-BC_P6kLg.js +3678 -0
  111. package/dist/membership-BWaK-9FY.js +255 -0
  112. package/dist/moment-D7p2TMB-.js +2583 -0
  113. package/dist/money-COoh4GXK.js +15 -0
  114. package/dist/number-BX5OEXgq.js +12 -0
  115. package/dist/object-BYyQ0PZp.js +18 -0
  116. package/dist/objectId-dwaoBfJX.js +7 -0
  117. package/dist/objectid-1SUSRtmY.js +145 -0
  118. package/dist/plugins-ur-FAoye.js +1788 -0
  119. package/dist/remy-Qz_pNsUS.js +13 -0
  120. package/dist/reward-DSsylZ22.js +36 -0
  121. package/dist/rule-BM9GUd1C.js +1969 -0
  122. package/dist/rule-builder-gC9LH2AC.js +126 -0
  123. package/dist/string-Gcy5IM_H.js +32 -0
  124. package/dist/style.css +4 -0
  125. package/dist/template-CUV3AMFI.js +188 -0
  126. package/dist/tier-BJDhpH6X.js +4 -0
  127. package/dist/tiers/tier=1.png +0 -0
  128. package/dist/tiers/tier=2.png +0 -0
  129. package/dist/tiers/tier=3.png +0 -0
  130. package/dist/tiers/tier=4.png +0 -0
  131. package/dist/timezone-BFZhekOU.js +20 -0
  132. package/dist/titles/type=diamond.png +0 -0
  133. package/dist/titles/type=drinks.png +0 -0
  134. package/dist/titles/type=food.png +0 -0
  135. package/dist/titles/type=heart.png +0 -0
  136. package/dist/titles/type=medal.png +0 -0
  137. package/dist/titles/type=spend.png +0 -0
  138. package/dist/titles/type=thank-you.png +0 -0
  139. package/dist/titles/type=thumbs-up.png +0 -0
  140. package/dist/titles/type=years.png +0 -0
  141. package/dist/transaction.fn-C5MlkEIC.js +64 -0
  142. package/dist/trigger-CbjiuoSo.js +213 -0
  143. package/dist/tslib.es6-BCqqvLQ_.js +44 -0
  144. package/dist/type_drinks-D6jnpvwV.js +4 -0
  145. package/dist/useMarketingMaterialActions-BLisTieA.js +96 -0
  146. package/dist/usePagination-Caah4sJr.js +220 -0
  147. package/dist/user-BZC4P_jL.js +55 -0
  148. package/dist/vue-i18n-BYz7XAr_.js +2365 -0
  149. package/dist/xlsx-Bn7BqUFA.js +15491 -0
  150. package/dist/zod-DHH42rXG.js +91 -0
  151. package/package.json +1 -1
@@ -0,0 +1,342 @@
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-Caah4sJr.js";
6
+ import { g as A } from "./user-BZC4P_jL.js";
7
+ import { components as R } from "@feedmepos/ui-library";
8
+ import "./index-D4SDAfbP.js";
9
+ import { u as j } from "./vue-i18n-BYz7XAr_.js";
10
+ import { u as L } from "./loading-NY-FPxVY.js";
11
+ import { useCoreStore as se } from "@feedmepos/mf-common";
12
+ import { r as v } from "./index-YgP4ihQL.js";
13
+ import { c as ie, a as ne } from "./object-BYyQ0PZp.js";
14
+ import { u as ce } from "./membership-BWaK-9FY.js";
15
+ import { c as le } from "./string-Gcy5IM_H.js";
16
+ import { c as de } from "./plugins-ur-FAoye.js";
17
+ import { u as V, w as me } from "./xlsx-Bn7BqUFA.js";
18
+ import { e as f } from "./index-vh86FiIQ.js";
19
+ import { h as ue } from "./moment-D7p2TMB-.js";
20
+ import { o as pe } from "./objectId-dwaoBfJX.js";
21
+ const fe = {
22
+ key: 0,
23
+ class: "flex justify-end mb-16"
24
+ }, ge = { class: "flex flex-col space-y-16 pr-12" }, he = /* @__PURE__ */ T({
25
+ __name: "UpdateCriteriaProgressSheet",
26
+ emits: ["refresh"],
27
+ setup(g, { expose: o, emit: m }) {
28
+ const y = m;
29
+ j();
30
+ const { minor: k } = L, l = B(!1), d = B({}), F = se(), S = [
31
+ {
32
+ header: "Criteria title",
33
+ accessorFn: (a) => a.name
34
+ },
35
+ {
36
+ header: "Status",
37
+ cell(a) {
38
+ var u;
39
+ const e = a.row.original, r = (u = d.value.criteria_progress) == null ? void 0 : u.find(
40
+ (_) => _.criteria === e._id
41
+ ), 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";
42
+ return [
43
+ h(R.FmChip, {
44
+ label: i,
45
+ compact: !0,
46
+ class: c
47
+ })
48
+ ];
49
+ }
50
+ },
51
+ {
52
+ id: "actions",
53
+ cell(a) {
54
+ var i;
55
+ const e = a.row.original;
56
+ return [
57
+ !((i = d.value.criteria_progress) == null ? void 0 : i.some(
58
+ (c) => c.criteria === e._id
59
+ )) && e.type == "MANUAL" ? h(R.FmButton, {
60
+ variant: "secondary",
61
+ label: "Mark as completed",
62
+ size: "md",
63
+ onClick: (c) => {
64
+ c.stopPropagation(), x(e._id.toString());
65
+ }
66
+ }) : null
67
+ ];
68
+ }
69
+ }
70
+ ], M = H(() => {
71
+ var e, r, i, c;
72
+ return (((r = (e = d.value) == null ? void 0 : e.criteria_progress) == null ? void 0 : r.filter(
73
+ (u) => {
74
+ var _;
75
+ return (_ = d.value) == null ? void 0 : _.criteria.some(
76
+ (P) => P._id.toString() === u.criteria.toString()
77
+ );
78
+ }
79
+ )) || []).length == ((i = d.value) == null ? void 0 : i.criteria.length) && ((c = d.value) == null ? void 0 : c.status) != "COMPLETED";
80
+ });
81
+ async function x(a) {
82
+ var r;
83
+ const e = ie(ne(d.value));
84
+ e.criteria_progress = [
85
+ {
86
+ criteria: a,
87
+ ref: `ADMIN:${(r = F.user) == null ? void 0 : r.id}:${(/* @__PURE__ */ new Date()).toISOString()}`,
88
+ completedAt: /* @__PURE__ */ new Date()
89
+ }
90
+ ], k(
91
+ async () => {
92
+ await v.updateCriteriaProgress(
93
+ d.value._id,
94
+ e
95
+ ), l.value = !1, y("refresh");
96
+ },
97
+ {
98
+ message: "Updating criteria progress",
99
+ successMessage: "Criteria progress updated successfully"
100
+ }
101
+ );
102
+ }
103
+ function t(a, e) {
104
+ l.value = a, d.value = e;
105
+ }
106
+ function s() {
107
+ l.value = !1;
108
+ }
109
+ return o({
110
+ showSheet: t,
111
+ hideSheet: s,
112
+ data: d
113
+ }), (a, e) => {
114
+ const r = C("FmButton"), i = C("FmTable"), c = C("FmSideSheet");
115
+ return I(), J(c, {
116
+ "max-width": 768,
117
+ modelValue: n(l),
118
+ "onUpdate:modelValue": e[1] || (e[1] = (u) => Q(l) ? l.value = u : null),
119
+ header: "Referee Criteria"
120
+ }, {
121
+ default: X(() => [
122
+ n(M) ? (I(), U("div", fe, [
123
+ w(r, {
124
+ icon: "refresh",
125
+ label: "Refresh",
126
+ onClick: e[0] || (e[0] = Z((u) => x(n(d)._id), ["stop"]))
127
+ })
128
+ ])) : ee("", !0),
129
+ N("div", ge, [
130
+ w(i, {
131
+ "row-data": n(d).criteria,
132
+ "hide-footer": !0,
133
+ "page-size": 100,
134
+ "column-defs": S
135
+ }, null, 8, ["row-data"])
136
+ ])
137
+ ]),
138
+ _: 1
139
+ }, 8, ["modelValue"]);
140
+ };
141
+ }
142
+ });
143
+ class _e {
144
+ constructor() {
145
+ z(this, "data", []);
146
+ }
147
+ addRecord(o) {
148
+ this.data.push(o);
149
+ }
150
+ buildExcel() {
151
+ const o = V.book_new(), m = V.json_to_sheet(this.data);
152
+ return V.book_append_sheet(o, m, "Referrals"), o;
153
+ }
154
+ }
155
+ const we = { class: "flex items-center justify-end" }, ze = /* @__PURE__ */ T({
156
+ __name: "Record",
157
+ setup(g) {
158
+ const { t: o } = j();
159
+ ce();
160
+ const { minor: m } = L, y = B(null), k = [
161
+ {
162
+ header: "ID",
163
+ meta: {
164
+ maxWidth: "100px"
165
+ },
166
+ cell(t) {
167
+ return h("div", { class: "flex items-center" }, [
168
+ h(R.FmIcon, {
169
+ name: "content_copy",
170
+ outline: !0,
171
+ size: "sm",
172
+ class: "cursor-pointer mr-4",
173
+ onClick: (s) => {
174
+ s.preventDefault(), s.stopPropagation(), de(t.row.original._id.toString());
175
+ }
176
+ }),
177
+ h(
178
+ "div",
179
+ { class: "pr-2 text-ellipsis overflow-hidden" },
180
+ t.row.original._id.toString()
181
+ )
182
+ ]);
183
+ },
184
+ enableSorting: !1
185
+ },
186
+ {
187
+ header: o("connect.referral.record.referer_info"),
188
+ enableSorting: !0,
189
+ cell(t) {
190
+ return t.row.original.pf_referer ? A(t.row.original.pf_referer, !0) : "N/A";
191
+ }
192
+ },
193
+ {
194
+ header: o("connect.referral.record.referee_info"),
195
+ enableSorting: !0,
196
+ cell(t) {
197
+ return t.row.original.pf_referee ? A(t.row.original.pf_referee, !0) : "N/A";
198
+ }
199
+ },
200
+ {
201
+ header: o("connect.referral.record.referee_criteria"),
202
+ accessorKey: "criteria",
203
+ id: "criteria",
204
+ cell(t) {
205
+ var r;
206
+ const a = (((r = t.row.original.criteria_progress) == null ? void 0 : r.filter(
207
+ (i) => t.row.original.criteria.some(
208
+ (c) => c._id.toString() === i.criteria.toString()
209
+ )
210
+ )) || []).length, e = t.row.original.criteria.length;
211
+ return e === 0 ? h("div", "No criteria") : h("div", `${a}/${e} completed criteria`);
212
+ }
213
+ },
214
+ {
215
+ header: o("connect.referral.record.status"),
216
+ id: "status",
217
+ cell(t) {
218
+ const s = t.row.original.status;
219
+ return h(R.FmChip, {
220
+ label: le.title(s.replace("_", " ")),
221
+ compact: !0,
222
+ 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"
223
+ });
224
+ }
225
+ }
226
+ ], { tableMeta: l, rowData: d, onSort: F, debouncedFetchData: S, onSearch: M } = oe(v.readRecords);
227
+ async function x() {
228
+ const t = new _e(), s = (await v.readRecords({
229
+ limit: 1,
230
+ skip: 0,
231
+ sortBy: f.sortBy,
232
+ descending: f.descending
233
+ })).meta.totalResources ?? 0, a = f.rowsPerPage;
234
+ await m(
235
+ async () => {
236
+ var e, r, i, c;
237
+ for (let u = 0; u < s; u += a) {
238
+ const _ = {
239
+ ...f,
240
+ limit: a,
241
+ skip: f.page - 1,
242
+ sortBy: f.sortBy,
243
+ descending: f.descending
244
+ }, P = await v.readRecords(_);
245
+ for (const p of P.resources) {
246
+ const E = (p.criteria || []).reduce(
247
+ (b, D) => {
248
+ var $;
249
+ const Y = (($ = p.criteria_progress) == null ? void 0 : $.filter(
250
+ (K) => p.criteria.some(
251
+ (W) => W._id.toString() === K.criteria.toString()
252
+ )
253
+ )) || [];
254
+ return b[D.name] = Y.length > 0 ? "Completed" : "In Progress", b;
255
+ },
256
+ {}
257
+ );
258
+ console.log(E);
259
+ const O = {
260
+ ID: p._id.toString(),
261
+ RefererName: ((e = p.pf_referer) == null ? void 0 : e.name) ?? "",
262
+ RefererPhone: ((r = p.pf_referer) == null ? void 0 : r.phoneNumber) ?? "",
263
+ RefereeName: ((i = p.pf_referee) == null ? void 0 : i.name) ?? "",
264
+ RefereePhone: ((c = p.pf_referee) == null ? void 0 : c.phoneNumber) ?? "",
265
+ ReferredAt: ue(pe(p._id)).format(
266
+ "DD/MM/YYYY"
267
+ ),
268
+ Status: p.status,
269
+ Criteria: Object.entries(E).map(([b, D]) => `${b}: ${D}`).join(", ")
270
+ };
271
+ t.addRecord(O);
272
+ }
273
+ f.page++;
274
+ }
275
+ await me(
276
+ t.buildExcel(),
277
+ `referrals-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
278
+ {
279
+ bookType: "xlsx",
280
+ bookSST: !1,
281
+ type: "array"
282
+ }
283
+ ), f.page = 1;
284
+ },
285
+ {
286
+ message: "Exporting referral records...",
287
+ successMessage: "Referral record exported successfully"
288
+ }
289
+ );
290
+ }
291
+ return re(async () => {
292
+ await S();
293
+ }), (t, s) => {
294
+ const a = C("FmSearch"), e = C("FmButton");
295
+ return I(), U(te, null, [
296
+ N("div", null, [
297
+ N("div", we, [
298
+ w(a, {
299
+ class: "mt-4",
300
+ modelValue: n(l).searchValue,
301
+ "onUpdate:modelValue": [
302
+ s[0] || (s[0] = (r) => n(l).searchValue = r),
303
+ n(M)
304
+ ],
305
+ placeholder: "Search",
306
+ collapsible: ""
307
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]),
308
+ w(e, {
309
+ icon: "ios_share",
310
+ variant: "tertiary",
311
+ onClick: x
312
+ })
313
+ ]),
314
+ w(ae, {
315
+ loading: n(l).isLoading,
316
+ "row-data": n(d),
317
+ "row-count": n(l).totalRows,
318
+ "column-defs": k,
319
+ "shrink-at": !1,
320
+ "page-count": n(l).pageCount,
321
+ "page-index": n(l).pageIndex,
322
+ "page-size": n(l).pageSize,
323
+ onSortChange: n(F),
324
+ onPageChange: s[1] || (s[1] = (r) => n(S)({ pageSize: r.pageSize, pageIndex: r.pageIndex })),
325
+ onRowClick: s[2] || (s[2] = (r) => {
326
+ var i;
327
+ return (i = n(y)) == null ? void 0 : i.showSheet(!0, r.original);
328
+ })
329
+ }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"])
330
+ ]),
331
+ w(he, {
332
+ ref_key: "updateCriteriaProgressSheetRef",
333
+ ref: y,
334
+ onRefresh: n(S)
335
+ }, null, 8, ["onRefresh"])
336
+ ], 64);
337
+ };
338
+ }
339
+ });
340
+ export {
341
+ ze as default
342
+ };
@@ -0,0 +1,45 @@
1
+ import { defineComponent as d, computed as v, resolveComponent as n, openBlock as f, createElementBlock as E, Fragment as R, createVNode as a, unref as l, createElementVNode as s } from "vue";
2
+ import { u as b } from "./vue-i18n-BYz7XAr_.js";
3
+ import { R as r } from "./app-CE5hQ4Uq.js";
4
+ import { useRouter as V } from "vue-router";
5
+ const w = { class: "flex flex-col" }, T = { class: "px-24" }, S = /* @__PURE__ */ d({
6
+ __name: "Review",
7
+ setup(g) {
8
+ const { t } = b(), c = V(), o = [
9
+ {
10
+ label: t("connect.review.tabs.overview"),
11
+ value: r["$connect-REVIEW_OVERVIEW"]
12
+ },
13
+ {
14
+ label: t("connect.review.tabs.settings"),
15
+ value: r["$connect-REVIEW_SETTINGS"]
16
+ }
17
+ ], m = v(
18
+ () => o.find((e) => e.value === c.currentRoute.value.name) ?? o[0]
19
+ );
20
+ async function u(e) {
21
+ await c.push({ name: e });
22
+ }
23
+ return (e, x) => {
24
+ const i = n("FmPageHead"), _ = n("FmTabs"), p = n("RouterView");
25
+ return f(), E(R, null, [
26
+ a(i, {
27
+ title: l(t)("connect.navigation.review")
28
+ }, null, 8, ["title"]),
29
+ s("div", w, [
30
+ s("div", T, [
31
+ a(_, {
32
+ "model-value": l(m).value,
33
+ items: o,
34
+ "onUpdate:modelValue": u
35
+ }, null, 8, ["model-value"])
36
+ ]),
37
+ a(p)
38
+ ])
39
+ ], 64);
40
+ };
41
+ }
42
+ });
43
+ export {
44
+ S as default
45
+ };
@@ -0,0 +1,238 @@
1
+ import { defineComponent as C, computed as M, openBlock as l, createElementBlock as g, normalizeClass as j, createElementVNode as u, createBlock as T, unref as e, toDisplayString as h, createCommentVNode as S, createVNode as y, onMounted as B, ref as P, Fragment as $, renderList as U, resolveComponent as z, isRef as V } from "vue";
2
+ import { u as R } from "./vue-i18n-BYz7XAr_.js";
3
+ import { components as I } from "@feedmepos/ui-library";
4
+ import { r as L } from "./index-BIyKgw4m.js";
5
+ import { u as A } from "./business-CE_4siXc.js";
6
+ import { _ as H } from "./LocationPicker.vue_vue_type_script_setup_true_lang-C6SBLJGQ.js";
7
+ import { R as D } from "./app-CE5hQ4Uq.js";
8
+ import { useRouter as G } from "vue-router";
9
+ const O = ["src"], W = { class: "fm-typo-en-body-md-600 flex-1 truncate" }, q = {
10
+ key: 2,
11
+ class: "fm-typo-en-body-sm-400 text-fm-color-primary-500 shrink-0"
12
+ }, J = /* @__PURE__ */ C({
13
+ __name: "FacebookPageConfig",
14
+ props: {
15
+ page: {},
16
+ expanded: { type: Boolean },
17
+ availableLocations: {}
18
+ },
19
+ emits: ["toggleExpand", "toggleLocation"],
20
+ setup(s, { emit: n }) {
21
+ const _ = s, f = n, { t: i } = R(), m = M(() => _.page.locationIds);
22
+ return (w, p) => (l(), g("div", {
23
+ class: j([
24
+ "rounded-lg border overflow-hidden transition-colors",
25
+ s.expanded ? "border-fm-color-primary-500" : "border-fm-color-neutral-gray-200"
26
+ ])
27
+ }, [
28
+ u("button", {
29
+ class: "w-full flex items-center gap-12 p-16 bg-white text-left hover:bg-fm-color-neutral-gray-50 transition-colors",
30
+ onClick: p[0] || (p[0] = (c) => f("toggleExpand"))
31
+ }, [
32
+ s.page.pageProfileImageUrl ? (l(), g("img", {
33
+ key: 0,
34
+ src: s.page.pageProfileImageUrl,
35
+ class: "w-32 h-32 rounded-full shrink-0 object-cover"
36
+ }, null, 8, O)) : (l(), T(e(I).FmIcon, {
37
+ key: 1,
38
+ name: "thumb_up",
39
+ class: "text-fm-color-neutral-gray-400 shrink-0"
40
+ })),
41
+ u("span", W, h(s.page.pageName), 1),
42
+ s.page.locationIds.length > 0 ? (l(), g("span", q, h(e(i)("connect.review.locationsSelected", s.page.locationIds.length)), 1)) : S("", !0),
43
+ y(e(I).FmIcon, {
44
+ name: s.expanded ? "expand_less" : "expand_more",
45
+ class: "text-fm-color-neutral-gray-400 shrink-0"
46
+ }, null, 8, ["name"])
47
+ ]),
48
+ s.expanded ? (l(), T(H, {
49
+ key: 0,
50
+ locations: s.availableLocations,
51
+ "selected-ids": e(m),
52
+ onToggle: p[1] || (p[1] = (c) => f("toggleLocation", c))
53
+ }, null, 8, ["locations", "selected-ids"])) : S("", !0)
54
+ ], 2));
55
+ }
56
+ }), K = { class: "flex flex-col gap-8" }, Q = /* @__PURE__ */ C({
57
+ __name: "FacebookPageLocationMapping",
58
+ props: {
59
+ pages: {}
60
+ },
61
+ emits: ["update:pages"],
62
+ setup(s, { emit: n }) {
63
+ const _ = s, f = A();
64
+ B(() => f.readLocations());
65
+ const i = n, m = P(null), w = M(() => {
66
+ const r = /* @__PURE__ */ new Set();
67
+ for (const v of _.pages)
68
+ v.locationIds.forEach((a) => r.add(a));
69
+ return r;
70
+ });
71
+ function p(r) {
72
+ const v = new Set(r.locationIds);
73
+ return f.locations.filter((a) => {
74
+ const b = a._id.toString();
75
+ return !w.value.has(b) || v.has(b);
76
+ });
77
+ }
78
+ function c(r, v) {
79
+ const a = v._id.toString(), b = _.pages.map((o) => {
80
+ if (o.facebookPageId !== r) return o;
81
+ const t = o.locationIds.includes(a);
82
+ return {
83
+ ...o,
84
+ locationIds: t ? o.locationIds.filter((k) => k !== a) : [...o.locationIds, a]
85
+ };
86
+ });
87
+ i("update:pages", b);
88
+ }
89
+ function F(r) {
90
+ m.value = m.value === r ? null : r;
91
+ }
92
+ return (r, v) => (l(), g("div", K, [
93
+ (l(!0), g($, null, U(s.pages, (a) => (l(), T(J, {
94
+ key: a.facebookPageId,
95
+ page: a,
96
+ expanded: e(m) === a.facebookPageId,
97
+ "available-locations": p(a),
98
+ onToggleExpand: (b) => F(a.facebookPageId),
99
+ onToggleLocation: (b) => c(a.facebookPageId, b)
100
+ }, null, 8, ["page", "expanded", "available-locations", "onToggleExpand", "onToggleLocation"]))), 128))
101
+ ]));
102
+ }
103
+ }), X = { class: "flex flex-col min-h-full gap-16 p-24" }, Y = {
104
+ key: 0,
105
+ class: "flex flex-col items-center justify-center flex-1 gap-16"
106
+ }, Z = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, ee = {
107
+ key: 1,
108
+ class: "flex flex-col items-center justify-center flex-1 gap-16"
109
+ }, oe = { class: "fm-typo-en-body-lg-600" }, te = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, ne = {
110
+ key: 2,
111
+ class: "flex flex-col items-center justify-center flex-1 gap-16"
112
+ }, ae = { class: "fm-typo-en-body-lg-600" }, se = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, ce = { class: "fm-typo-en-body-lg-600" }, le = { class: "flex gap-8 justify-end mt-auto pt-8" }, ve = /* @__PURE__ */ C({
113
+ __name: "ReviewFacebookCallback",
114
+ setup(s) {
115
+ const { t: n } = R(), _ = G();
116
+ function f() {
117
+ return _.replace({ name: D["$connect-REVIEW_SETTINGS"] });
118
+ }
119
+ const i = P([]), m = P(!1), w = P(!1), p = P(!1), c = P(null), F = M(
120
+ () => i.value.some((o) => o.locationIds.length > 0)
121
+ );
122
+ function r(o, t) {
123
+ const k = new Map(
124
+ t.map((d) => [d.facebookPageId, d])
125
+ );
126
+ return o.map((d) => {
127
+ var x;
128
+ return {
129
+ ...d,
130
+ locationIds: ((x = k.get(d.facebookPageId)) == null ? void 0 : x.locationIds) ?? []
131
+ };
132
+ });
133
+ }
134
+ function v(o, t) {
135
+ return o instanceof Error ? o.message : t;
136
+ }
137
+ async function a() {
138
+ var d;
139
+ const o = window.location.hash;
140
+ if (!o) {
141
+ c.value = n("connect.review.noToken");
142
+ return;
143
+ }
144
+ const k = new URLSearchParams(o.slice(1)).get("access_token");
145
+ if (!k) {
146
+ c.value = n("connect.review.noToken");
147
+ return;
148
+ }
149
+ m.value = !0;
150
+ try {
151
+ const x = await L.getSource(), N = ((d = x == null ? void 0 : x.facebook) == null ? void 0 : d.pages) ?? [], E = await L.connectFacebook(k);
152
+ i.value = r((E == null ? void 0 : E.pages) ?? [], N), i.value.length === 0 && (c.value = n("connect.review.facebook.noPages"));
153
+ } catch (x) {
154
+ c.value = v(x, n("connect.review.facebook.failed"));
155
+ } finally {
156
+ m.value = !1;
157
+ }
158
+ }
159
+ async function b() {
160
+ const o = i.value.filter((t) => t.locationIds.length > 0).map((t) => ({
161
+ facebookPageId: t.facebookPageId,
162
+ locationIds: t.locationIds
163
+ }));
164
+ if (o.length === 0) {
165
+ c.value = n("connect.review.noMappings");
166
+ return;
167
+ }
168
+ w.value = !0;
169
+ try {
170
+ await L.updateFacebookPages(o), p.value = !0, setTimeout(f, 2e3);
171
+ } catch (t) {
172
+ c.value = v(t, n("connect.review.facebook.failed"));
173
+ } finally {
174
+ w.value = !1;
175
+ }
176
+ }
177
+ return B(a), (o, t) => {
178
+ const k = z("FmPageHead");
179
+ return l(), g($, null, [
180
+ y(k, {
181
+ title: e(n)("connect.navigation.review")
182
+ }, null, 8, ["title"]),
183
+ u("div", X, [
184
+ e(m) ? (l(), g("div", Y, [
185
+ y(e(I).FmIcon, {
186
+ name: "sync",
187
+ size: "xl",
188
+ class: "animate-spin text-fm-color-neutral-gray-400"
189
+ }),
190
+ u("p", Z, h(e(n)("connect.review.facebook.fetching")), 1)
191
+ ])) : e(p) ? (l(), g("div", ee, [
192
+ y(e(I).FmIcon, {
193
+ name: "check_circle",
194
+ size: "xl",
195
+ class: "text-fm-color-typo-success"
196
+ }),
197
+ u("p", oe, h(e(n)("connect.review.facebook.success")), 1),
198
+ u("p", te, h(e(n)("connect.review.redirecting")), 1)
199
+ ])) : e(c) ? (l(), g("div", ne, [
200
+ y(e(I).FmIcon, {
201
+ name: "error",
202
+ size: "xl",
203
+ class: "text-fm-color-system-error-500"
204
+ }),
205
+ u("p", ae, h(e(n)("connect.review.errorTitle")), 1),
206
+ u("p", se, h(e(c)), 1),
207
+ y(e(I).FmButton, {
208
+ label: e(n)("connect.review.goBack"),
209
+ onClick: t[0] || (t[0] = (d) => f())
210
+ }, null, 8, ["label"])
211
+ ])) : e(i).length > 0 ? (l(), g($, { key: 3 }, [
212
+ u("p", ce, h(e(n)("connect.review.facebook.selectPage")), 1),
213
+ y(Q, {
214
+ pages: e(i),
215
+ "onUpdate:pages": t[1] || (t[1] = (d) => V(i) ? i.value = d : null)
216
+ }, null, 8, ["pages"]),
217
+ u("div", le, [
218
+ y(e(I).FmButton, {
219
+ variant: "outlined",
220
+ label: e(n)("connect.review.cancel"),
221
+ onClick: t[2] || (t[2] = (d) => f())
222
+ }, null, 8, ["label"]),
223
+ y(e(I).FmButton, {
224
+ label: e(n)("connect.review.connect"),
225
+ disabled: !e(F),
226
+ loading: e(w),
227
+ onClick: b
228
+ }, null, 8, ["label", "disabled", "loading"])
229
+ ])
230
+ ], 64)) : S("", !0)
231
+ ])
232
+ ], 64);
233
+ };
234
+ }
235
+ });
236
+ export {
237
+ ve as default
238
+ };