@feedmepos/mf-connect 0.1.119-dev → 0.1.119-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 (146) hide show
  1. package/dist/{App-z-u6skb5.js → App-BN2LKM3u.js} +135 -147
  2. package/dist/{Bin-Dh9RAgYi.js → Bin-DpQ1atb7.js} +8 -8
  3. package/dist/{Broadcast-Dg6azPS8.js → Broadcast-c1ZyYClI.js} +21 -22
  4. package/dist/{CampaignAnalytic-CVB4dstO.js → CampaignAnalytic-w1hIlc2r.js} +7 -7
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DYgBeT23.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D7U6evm1.js} +9 -8
  6. package/dist/{Card-CY736Ul0.js → Card-De53Xgbe.js} +22 -22
  7. package/dist/{Collections-CdTKWkZZ.js → Collections-BL2RD3FU.js} +185 -197
  8. package/dist/{Credit-CUhEKlMI.js → Credit-2KvFFcwR.js} +20 -21
  9. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-CBwgeTXh.js → DateRangeChip.vue_vue_type_script_setup_true_lang-CKSs2nYE.js} +1 -1
  10. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BXb7v7wc.js +3493 -0
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-D5-EKqG9.js → EffectSheet.vue_vue_type_style_index_0_lang-Jy7HkK5Z.js} +30 -30
  12. package/dist/{Experience-CMp09U-6.js → Experience-Cb0jHtVo.js} +31 -32
  13. package/dist/{FileSaver.min-Bq5McdmK.js → FileSaver.min-UDgZF_Cv.js} +1 -1
  14. package/dist/{Game-Dv5NvG-q.js → Game-BnysxSMs.js} +18 -19
  15. package/dist/{GiftCardSetup-SO2Tk5In.js → GiftCardSetup-s1OR6xQq.js} +31 -31
  16. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-CgG5vHCp.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-D108r20x.js} +7 -7
  17. package/dist/{Goals-BEwQP4cY.js → Goals-BAieLPzR.js} +4 -4
  18. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BDGEqsWE.js → ImageInput.vue_vue_type_script_setup_true_lang-B9Jgq5Bp.js} +1 -1
  19. package/dist/{Index-8F2LOWng.js → Index-DnX16GAE.js} +10 -10
  20. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-BwAjki7Y.js → LocationPicker.vue_vue_type_script_setup_true_lang-DeM-WG6m.js} +1 -1
  21. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DK4C0Y9j.js → LottieAnimation.vue_vue_type_script_setup_true_lang-BAN69FOS.js} +1 -1
  22. package/dist/{LoyaltyDashboard-rWm0b8cm.js → LoyaltyDashboard-D8g6OSbC.js} +15 -15
  23. package/dist/{MainLayout-ezbgp2IQ.js → MainLayout-DWABjpQn.js} +1 -1
  24. package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-1QY5-U5y.js → MainLayout.vue_vue_type_script_setup_true_lang-COp7iulq.js} +3 -3
  25. package/dist/{Marketing-DcWF4xVc.js → Marketing-Dagatr0y.js} +4 -4
  26. package/dist/{MarketingMaterialEdit-C1bXj_hU.js → MarketingMaterialEdit-DYVzNDpM.js} +211 -214
  27. package/dist/{Member-CgDZqGsV.js → Member-DAxdEF_Z.js} +7 -7
  28. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-Dh1_j06F.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-nBg7Hckj.js} +47 -39
  29. package/dist/{MemberImportHistory-DT3QJ5se.js → MemberImportHistory-2gx6FnLh.js} +7 -7
  30. package/dist/{MemberList-Bm05jnbk.js → MemberList-By_gGl-J.js} +105 -103
  31. package/dist/{MemberTransactions-D90tTpdC.js → MemberTransactions-BEF-4ZNp.js} +1 -1
  32. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-jvgjOXXA.js → MessageInput.vue_vue_type_script_setup_true_lang-Bs8wKx9B.js} +12 -12
  33. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CxL-Nh6i.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DN3mWfKj.js} +1 -1
  34. package/dist/{Mission-D_l2eJI3.js → Mission-jg15lBxo.js} +21 -22
  35. package/dist/{Overview-BOZBnorP.js → Overview-BFKLTAk1.js} +144 -145
  36. package/dist/{Overview-1AYfTeMD.js → Overview-C7WfdzfV.js} +20 -20
  37. package/dist/{Point-Cqy4XzeG.js → Point-dv9WgWTQ.js} +21 -22
  38. package/dist/{Promotion-9RDNbCgB.js → Promotion-mFPF_8jO.js} +131 -137
  39. package/dist/{Queue-D2Eie_np.js → Queue-BQoR_M5H.js} +45 -45
  40. package/dist/{Record-e4B--FD8.js → Record-1JZ1N5iX.js} +9 -9
  41. package/dist/{Review-DcUpSvc-.js → Review-B52AxCeT.js} +2 -2
  42. package/dist/ReviewFacebookCallback-ihTdiI8V.js +238 -0
  43. package/dist/{ReviewGoogleCallback-JPkamgo2.js → ReviewGoogleCallback-DO6SVFIC.js} +5 -5
  44. package/dist/{Reward-BQJw-R8V.js → Reward-Cp4jPAB0.js} +16 -16
  45. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-D_DSQ8q2.js → RewardGroup.vue_vue_type_script_setup_true_lang-DLD6X13Z.js} +13 -13
  46. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-pdHRjCt8.js +1884 -0
  47. package/dist/{Segment-Cjdqsqqg.js → Segment-DaKw0YXF.js} +306 -303
  48. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-g-CJUZBF.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-Bj3OQ_JJ.js} +14 -14
  49. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-lbH0b170.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-B1Otak97.js} +4 -4
  50. package/dist/{Setting-B3HK4mtx.js → Setting-DveUrt8J.js} +148 -159
  51. package/dist/{SettingAdvertisements-BQFJpdIm.js → SettingAdvertisements-QRXOMNnM.js} +12 -12
  52. package/dist/Settings-D9D-mkBa.js +179 -0
  53. package/dist/{Store-mp1LyXwr.js → Store-DjdXRw3V.js} +28 -28
  54. package/dist/{StoreRewards-DiSB6d7_.js → StoreRewards-CjlGrc9E.js} +15 -15
  55. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-DnwMpqzf.js +1265 -0
  56. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-I5-5BV4h.js +142 -0
  57. package/dist/{Tier-CxaXh96q.js → Tier-D74Oh2np.js} +687 -2575
  58. package/dist/{Title-Byz0TGpi.js → Title-CeeviOW8.js} +94 -95
  59. package/dist/{Transaction-CNXulI3o.js → Transaction-CWdw0ITl.js} +2 -2
  60. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-C0bfVZf8.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-B9nf-9s0.js} +26 -26
  61. package/dist/{Voucher-CVw3E8Y4.js → Voucher-C0nNXMtv.js} +19 -19
  62. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-C0d3ktXA.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DxZLsQq9.js} +12 -12
  63. package/dist/{WhatsappAccount-5vLzjaIV.js → WhatsappAccount-CoLSjCQ2.js} +6 -6
  64. package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-CwGBRX-Q.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-DkHPlGgT.js} +1 -1
  65. package/dist/{WhatsappBot-BWJbD7Gk.js → WhatsappBot-kLb3kUav.js} +6 -6
  66. package/dist/{WhatsappBotLogs-C8gpmZyC.js → WhatsappBotLogs-jcYaHs0t.js} +6 -6
  67. package/dist/{WhatsappBotSettings-BvPnKHz-.js → WhatsappBotSettings-B6jJD61h.js} +4 -4
  68. package/dist/{WhatsappLayout-DJXhXeXf.js → WhatsappLayout-C24bIjI2.js} +3 -3
  69. package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-BxUYjrWQ.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-9a_grP76.js} +3 -3
  70. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CkjzVKif.js → ZodTextField.vue_vue_type_script_setup_true_lang-i8Wc2mCr.js} +2 -2
  71. package/dist/{app-BF1vds2J.js → app-C06bAZj3.js} +10806 -11561
  72. package/dist/app.js +3 -4
  73. package/dist/{base.export-B7FU8J4P.js → base.export-CgNRhKu8.js} +2 -2
  74. package/dist/{business-DkUMhys1.js → business-D23Dt1x4.js} +1 -1
  75. package/dist/{campaign-C9cVkGMF.js → campaign-DfEvGigm.js} +94 -121
  76. package/dist/{campaign-0AgQP43B.js → campaign-FVcbXtrP.js} +28 -34
  77. package/dist/{campaign.enum-Dx-Zo68Q.js → campaign.enum-BqekIiiN.js} +1 -2
  78. package/dist/campaign.fn-0MNUj1fZ.js +776 -0
  79. package/dist/{collection.fn-B_QnW0e3.js → collection.fn-DC1AMI9o.js} +2 -2
  80. package/dist/{currency-XQmondpC.js → currency-Bra2RJK4.js} +1 -1
  81. package/dist/{effect-Mwn1x6qN.js → effect-EL4V3pAu.js} +1 -1
  82. package/dist/{email-addresses-DQQAi6-l.js → email-addresses-Ddtf1x_y.js} +2 -2
  83. package/dist/{feature-flag-B1VMMZMd.js → feature-flag-umACX47C.js} +70 -70
  84. package/dist/google-C3S8u0mT.js +4 -0
  85. package/dist/{helper-D1R8vyjc.js → helper-DqDOnLCf.js} +1 -1
  86. package/dist/{index-Rs75lw-x.js → index-B2lqC_hH.js} +1 -1
  87. package/dist/{index-C9Nbb7wc.js → index-B3U3KZl0.js} +2 -2
  88. package/dist/{index-CRAuAyO3.js → index-BTjhdlN_.js} +1 -1
  89. package/dist/{index-Bm43wR8L.js → index-B_BmgKrh.js} +2613 -2699
  90. package/dist/{index-DMfCzjiA.js → index-BkKu2G2c.js} +2 -2
  91. package/dist/{index-ug7pxPAX.js → index-BroF2fC8.js} +251 -608
  92. package/dist/{index-P8DDRVa3.js → index-Bvk61_w_.js} +1 -1
  93. package/dist/{index-DQnCdGWe.js → index-ByVPdKdB.js} +581 -682
  94. package/dist/{index-Bym-ZIcv.js → index-BzwwXWpZ.js} +1 -1
  95. package/dist/{index-DaUhJ6xV.js → index-C3hAzzS2.js} +15 -29
  96. package/dist/{index-CzE9ZPDV.js → index-C3lk4GHF.js} +4 -4
  97. package/dist/{index-CLlGMbnP.js → index-C6p9Lsvf.js} +1 -1
  98. package/dist/{index-eR9mqPPV.js → index-CEh6ryp2.js} +6 -19
  99. package/dist/{index-mOGrVzUV.js → index-DK9zxpDu.js} +3 -3
  100. package/dist/{index-ytSMcSMt.js → index-DuCJtx1m.js} +1 -1
  101. package/dist/{index-ZYrey0SM.js → index-LjoAs_nX.js} +10 -10
  102. package/dist/{index-BU6CU5MP.js → index-TDCPGtW3.js} +232 -389
  103. package/dist/{index-CPB7j8Wn.js → index-iVbjwKxc.js} +10 -10
  104. package/dist/{index-Cg8Z5eYT.js → index-pfmx-Gor.js} +2 -2
  105. package/dist/{index-D5BwAYuA.js → index-rcfcslIC.js} +197 -197
  106. package/dist/{index.esm2017-Gkctw9Mb.js → index.esm2017-DCuQPCX2.js} +111 -111
  107. package/dist/{loading-kUQqT44G.js → loading-CQm1DKWE.js} +1 -1
  108. package/dist/{lodash-B4AjV7YZ.js → lodash-C2wVbAap.js} +1 -1
  109. package/dist/{member-import-CwDUG5mj.js → member-import-BLEmTRso.js} +1 -1
  110. package/dist/{membership-BI6U8-eM.js → membership-XycnxPEW.js} +2 -2
  111. package/dist/{money-Bum-AbB7.js → money-DY_QGzd1.js} +1 -1
  112. package/dist/{number-uAoNqG-N.js → number-BHthf4qF.js} +1 -1
  113. package/dist/objectid-CPCAqIiC.js +145 -0
  114. package/dist/{onboarding-wtYzQipv.js → onboarding-BOJw54Fn.js} +36 -36
  115. package/dist/{onboardingSetup-DlYM-oqd.js → onboardingSetup-Cf2u1tXu.js} +2 -2
  116. package/dist/{plugins-BGyTPNfc.js → plugins-DKQeoL_e.js} +3 -3
  117. package/dist/{reward-D0xtG-bp.js → reward-D4RIYSpl.js} +1 -1
  118. package/dist/{rule-BAA5-vRj.js → rule-Ba-s0L_w.js} +492 -572
  119. package/dist/rule-builder-D0B0DPao.js +102 -0
  120. package/dist/style.css +1 -1
  121. package/dist/template-B40I16Yg.js +236 -0
  122. package/dist/{timezone-Bbw2OeEP.js → timezone-CAc8xi1h.js} +1 -1
  123. package/dist/{transaction.fn-DZdNjP_E.js → transaction.fn-Cp2hnhyU.js} +2 -2
  124. package/dist/{trigger-BpotFb7G.js → trigger-3ebhNBX7.js} +9 -9
  125. package/dist/{useMarketingMaterialActions-CQ1M0N9c.js → useMarketingMaterialActions-6URv8neP.js} +4 -4
  126. package/dist/{usePagination-qALFI_Td.js → usePagination-C-fyMmiy.js} +1 -1
  127. package/dist/{user-X_94TRIK.js → user-T-iXTrYV.js} +1 -1
  128. package/dist/vue-i18n-DzsxJorb.js +2365 -0
  129. package/dist/{xlsx-DW48eXDT.js → xlsx-B8OqaJfb.js} +224 -224
  130. package/dist/{zod-BAP9II5C.js → zod-DZkNj425.js} +1 -1
  131. package/package.json +3 -8
  132. package/dist/AuditLogs-J0UJ3HJW.js +0 -2016
  133. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BC4jTtVY.js +0 -4439
  134. package/dist/Grab-npbL7p7S.js +0 -301
  135. package/dist/ReviewFacebookCallback-BhHdYb4X.js +0 -225
  136. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DfWjXTx3.js +0 -1923
  137. package/dist/Settings-DKWkiRuA.js +0 -286
  138. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BAYKqf-Y.js +0 -1319
  139. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-be7ksTJw.js +0 -7007
  140. package/dist/Upselling-Dto64bmE.js +0 -1013
  141. package/dist/campaign.fn-N6rJeDUx.js +0 -776
  142. package/dist/duplicateCampaign-CvQRWP-Z.js +0 -51
  143. package/dist/google-BQK68wbe.js +0 -5
  144. package/dist/objectid-CPTCMH2h.js +0 -145
  145. package/dist/template-DKgW9ul3.js +0 -188
  146. package/dist/vue-i18n-CRFpVnMa.js +0 -2365
@@ -1,301 +0,0 @@
1
- import { defineComponent as q, ref as L, computed as z, h as J, onMounted as Q, resolveComponent as u, openBlock as f, createElementBlock as k, Fragment as F, createVNode as l, unref as i, withCtx as x, createElementVNode as m, renderList as W, createBlock as O, resolveDynamicComponent as X, toDisplayString as Y } from "vue";
2
- import { _ as Z } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as ee, components as te } from "@feedmepos/ui-library";
4
- import { p as P } from "./plugins-BGyTPNfc.js";
5
- import { u as oe } from "./loading-kUQqT44G.js";
6
- import { u as ne } from "./business-DkUMhys1.js";
7
- import { u as ae } from "./campaign-0AgQP43B.js";
8
- import { u as re } from "./vue-i18n-CRFpVnMa.js";
9
- import { h as d } from "./moment-D7p2TMB-.js";
10
- import { a as se, b as V } from "./campaign-C9cVkGMF.js";
11
- import { s as ie, _ as ce } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BC4jTtVY.js";
12
- import { u as le } from "./template-DKgW9ul3.js";
13
- import { _ as $ } from "./FilterChip.vue_vue_type_script_setup_true_lang-3bH-tZAm.js";
14
- import { c as C } from "./index-DMfCzjiA.js";
15
- const me = { class: "px-24 flex flex-col gap-y-16" }, ue = { class: "flex items-center justify-between w-full" }, de = { class: "flex gap-8 overflow-x-auto" }, pe = { class: "space-y-8" }, fe = { class: "flex w-full gap-4 items-center" }, ge = { class: "flex flex-col gap-16 text-center" }, ye = { class: "fm-typo-en-title-sm-800" }, be = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pe = /* @__PURE__ */ q({
16
- __name: "Grab",
17
- setup(_e) {
18
- const { t: o } = re(), I = {
19
- label: o("connect.grab.createCampaign"),
20
- value: "create",
21
- isPrimary: !0,
22
- prependIcon: "add"
23
- }, A = le("GRAB", ee()), S = ne(), g = ae(), { global: R, minor: T } = oe, K = [
24
- {
25
- label: "Bill promotion",
26
- value: "BILL"
27
- },
28
- {
29
- label: "Item promotion",
30
- value: "ITEM"
31
- }
32
- ], c = L({
33
- searchKey: "",
34
- location: [],
35
- effectType: []
36
- });
37
- function E(e) {
38
- const t = c.value.location;
39
- return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((a) => {
40
- var s;
41
- return (s = e == null ? void 0 : e.targetLocation) == null ? void 0 : s.includes(a);
42
- }) : e.targetLocation.includes(t);
43
- }
44
- function j(e) {
45
- var s, r;
46
- const t = c.value.effectType;
47
- if (!t || t.length === 0) return !0;
48
- const a = (r = (s = e.effect) == null ? void 0 : s.options) == null ? void 0 : r.target;
49
- return t.includes(a);
50
- }
51
- const p = z(
52
- () => g.campaigns.grab.filter(
53
- (e) => E(e) && j(e)
54
- )
55
- ), G = [
56
- {
57
- header: o("connect.grab.promotionTitle"),
58
- accessorFn: (e) => e.name
59
- },
60
- {
61
- header: o("connect.grab.period"),
62
- accessorFn: (e) => {
63
- const t = d(e.timeframeOptions.start).format("DD/MM/YYYY"), a = d(e.timeframeOptions.end).format("DD/MM/YYYY");
64
- return `${t} - ${a}`;
65
- }
66
- },
67
- {
68
- header: o("connect.grab.status"),
69
- accessorFn: (e) => se(e),
70
- cell(e) {
71
- return V(e.row.original);
72
- }
73
- },
74
- {
75
- header: o("connect.grab.summary"),
76
- cell(e) {
77
- const t = ie(e.row.original.discount);
78
- return t ? `${t.type} - ${t.adjustment}` : "-";
79
- }
80
- },
81
- {
82
- header: o("connect.grab.actions"),
83
- cell(e) {
84
- return J(te.FmButton, {
85
- variant: "tertiary",
86
- icon: "delete",
87
- iconColor: "neutral-gray-400",
88
- onClick: (t) => {
89
- t.stopPropagation(), D(e.row.original);
90
- }
91
- });
92
- }
93
- }
94
- ], B = L();
95
- async function D(e) {
96
- await P.remove(o("connect.grab.confirmRemove", { name: e.name })) && await T(
97
- async () => {
98
- await C.delete(e._id), await g.read("PROMOTION");
99
- },
100
- {
101
- message: o("connect.grab.removing", { name: e.name }),
102
- successMessage: o("connect.grab.removedSuccessfully", {
103
- name: e.name
104
- })
105
- }
106
- );
107
- }
108
- async function b(e) {
109
- e ? await t() : A.open(async (a) => {
110
- await t(a);
111
- });
112
- async function t(a) {
113
- var s;
114
- (s = B.value) == null || s.showSheet(
115
- !0,
116
- "GRAB",
117
- e ? await C.readById(e._id) : void 0,
118
- a
119
- );
120
- }
121
- }
122
- async function N(e) {
123
- var a;
124
- const t = await U(e.campaign);
125
- if (t.length > 0) {
126
- const s = t.map(
127
- (r) => `"${r.name}" (${d(r.timeframeOptions.start).format("DD/MM/YYYY")} - ${d(r.timeframeOptions.end).format("DD/MM/YYYY")})`
128
- ).join(`
129
- `);
130
- return await ((a = P.dialog) == null ? void 0 : a.open({
131
- title: o("connect.grab.conflictDetected"),
132
- message: o("connect.grab.conflictMessage", {
133
- conflicts: s
134
- }),
135
- closeButton: !0,
136
- overlay: !0,
137
- primaryActions: {
138
- close: !0,
139
- text: "OK"
140
- }
141
- })), !1;
142
- }
143
- await T(
144
- async () => (e.campaign._id ? await C.update(e.campaign._id, e) : await C.create(e), await g.read("PROMOTION"), !0),
145
- {
146
- message: o(
147
- e.campaign._id ? "connect.grab.updating" : "connect.grab.creating"
148
- ),
149
- successMessage: o(
150
- e.campaign._id ? "connect.grab.updatedSuccessfully" : "connect.grab.createdSuccessfully"
151
- )
152
- }
153
- );
154
- }
155
- async function U(e) {
156
- const t = g.campaigns.grab, a = [], s = !!e._id;
157
- for (const r of t) {
158
- if (s && r._id === e._id) continue;
159
- const _ = d(e.timeframeOptions.start), y = d(e.timeframeOptions.end), h = d(r.timeframeOptions.start), v = d(r.timeframeOptions.end);
160
- if (_.isBefore(v) && y.isAfter(h) || h.isBefore(y) && v.isAfter(_)) {
161
- const n = e.discount, w = r.discount;
162
- n.scope.type === w.scope.type && a.push(r);
163
- }
164
- }
165
- return a;
166
- }
167
- async function H(e) {
168
- switch (e) {
169
- case "create":
170
- b();
171
- break;
172
- }
173
- }
174
- return Q(async () => {
175
- await R(async () => {
176
- await S.readLocations(), await g.read("PROMOTION");
177
- });
178
- }), (e, t) => {
179
- const a = u("FmPill"), s = u("FmPageHead"), r = u("FmSearch"), _ = u("FmTable"), y = u("FmButton"), h = u("FmListItem"), v = u("FmList"), M = u("FmCard");
180
- return f(), k(F, null, [
181
- l(s, {
182
- title: i(o)("connect.grab.title"),
183
- actions: i(p).length > 0 ? [I] : [],
184
- "onClick:action": H
185
- }, {
186
- prepend: x(() => [
187
- l(a, { variant: "beta" }),
188
- l(a, { variant: "premium" })
189
- ]),
190
- _: 1
191
- }, 8, ["title", "actions"]),
192
- m("div", me, [
193
- l(r, {
194
- modelValue: c.value.searchKey,
195
- "onUpdate:modelValue": t[0] || (t[0] = (n) => c.value.searchKey = n),
196
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
197
- placeholder: i(o)("connect.grab.search"),
198
- collapsible: ""
199
- }, null, 8, ["modelValue", "placeholder"]),
200
- i(p) && i(p).length > 0 ? (f(), k(F, { key: 0 }, [
201
- m("div", ue, [
202
- m("div", de, [
203
- l($, {
204
- label: `${i(o)("connect.common.location")}: `,
205
- "right-icon": "keyboard_arrow_down",
206
- modelValue: c.value.location,
207
- "onUpdate:modelValue": t[1] || (t[1] = (n) => c.value.location = n),
208
- icon: "storefront",
209
- "show-item-label": !0,
210
- items: i(S).locationOptions
211
- }, null, 8, ["label", "modelValue", "items"]),
212
- l($, {
213
- label: "Type:",
214
- "right-icon": "keyboard_arrow_down",
215
- modelValue: c.value.effectType,
216
- "onUpdate:modelValue": t[2] || (t[2] = (n) => c.value.effectType = n),
217
- icon: "filter_list",
218
- "show-item-label": !0,
219
- items: K
220
- }, null, 8, ["modelValue"])
221
- ]),
222
- l(r, {
223
- modelValue: c.value.searchKey,
224
- "onUpdate:modelValue": t[3] || (t[3] = (n) => c.value.searchKey = n),
225
- class: "xs:hidden",
226
- placeholder: "search",
227
- collapsible: ""
228
- }, null, 8, ["modelValue"])
229
- ]),
230
- l(_, {
231
- class: "xs:hidden",
232
- "row-data": i(p),
233
- "column-defs": G,
234
- "search-value": c.value.searchKey,
235
- "column-filter": [],
236
- onRowClick: t[4] || (t[4] = (n) => b(n.original)),
237
- "hide-footer": i(p).length < 10
238
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
239
- l(v, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
240
- default: x(() => [
241
- (f(!0), k(F, null, W(i(p).filter(
242
- (n) => n.name.toLowerCase().includes(c.value.searchKey.toLowerCase())
243
- ), (n) => (f(), O(h, {
244
- key: n._id.toString(),
245
- onClick: (w) => b(n),
246
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
247
- }, {
248
- default: x(() => [
249
- m("div", pe, [
250
- m("div", fe, [
251
- (f(), O(X(i(V)(n))))
252
- ])
253
- ]),
254
- l(y, {
255
- icon: "delete",
256
- "icon-color": "neutral-gray-400",
257
- variant: "tertiary",
258
- onClick: (w) => (w.stopPropagation(), D(n))
259
- }, null, 8, ["onClick"])
260
- ]),
261
- _: 2
262
- }, 1032, ["onClick"]))), 128))
263
- ]),
264
- _: 1
265
- })
266
- ], 64)) : (f(), O(M, {
267
- key: 1,
268
- variant: "outlined",
269
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
270
- }, {
271
- default: x(() => [
272
- t[6] || (t[6] = m("img", {
273
- src: Z,
274
- class: "aspect-square w-[150px]"
275
- }, null, -1)),
276
- m("div", ge, [
277
- m("div", ye, Y(i(o)("connect.grab.createPromotionCampaign")), 1),
278
- m("div", be, Y(i(o)("connect.grab.description")), 1)
279
- ]),
280
- l(y, {
281
- variant: "primary",
282
- label: i(o)("connect.grab.createPromotionCampaign"),
283
- icon: "add",
284
- onClick: t[5] || (t[5] = (n) => b())
285
- }, null, 8, ["label"])
286
- ]),
287
- _: 1
288
- }))
289
- ]),
290
- l(ce, {
291
- ref_key: "sheetRef",
292
- ref: B,
293
- "onSubmit:modelValue": N
294
- }, null, 512)
295
- ], 64);
296
- };
297
- }
298
- });
299
- export {
300
- Pe as default
301
- };
@@ -1,225 +0,0 @@
1
- import { defineComponent as L, computed as T, openBlock as i, createElementBlock as m, normalizeClass as B, createElementVNode as u, createBlock as P, unref as e, toDisplayString as y, createCommentVNode as F, createVNode as v, onMounted as $, ref as I, Fragment as E, renderList as R, resolveComponent as M, isRef as N } from "vue";
2
- import { u as C } from "./vue-i18n-CRFpVnMa.js";
3
- import { components as x } from "@feedmepos/ui-library";
4
- import { r as S } from "./index-ZYrey0SM.js";
5
- import { u as j } from "./business-DkUMhys1.js";
6
- import { _ as U } from "./LocationPicker.vue_vue_type_script_setup_true_lang-BwAjki7Y.js";
7
- import { R as z } from "./app-BF1vds2J.js";
8
- import { useRouter as V } from "vue-router";
9
- const A = ["src"], H = { class: "fm-typo-en-body-md-600 flex-1 truncate" }, D = {
10
- key: 2,
11
- class: "fm-typo-en-body-sm-400 text-fm-color-primary-500 shrink-0"
12
- }, G = /* @__PURE__ */ L({
13
- __name: "FacebookPageConfig",
14
- props: {
15
- page: {},
16
- expanded: { type: Boolean },
17
- availableLocations: {}
18
- },
19
- emits: ["toggleExpand", "toggleLocation"],
20
- setup(s, { emit: t }) {
21
- const k = s, f = t, { t: r } = C(), g = T(() => k.page.locationIds);
22
- return (h, p) => (i(), m("div", {
23
- class: B([
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 ? (i(), m("img", {
33
- key: 0,
34
- src: s.page.pageProfileImageUrl,
35
- class: "w-32 h-32 rounded-full shrink-0 object-cover"
36
- }, null, 8, A)) : (i(), P(e(x).FmIcon, {
37
- key: 1,
38
- name: "thumb_up",
39
- class: "text-fm-color-neutral-gray-400 shrink-0"
40
- })),
41
- u("span", H, y(s.page.pageName), 1),
42
- s.page.locationIds.length > 0 ? (i(), m("span", D, y(e(r)("connect.review.locationsSelected", s.page.locationIds.length)), 1)) : F("", !0),
43
- v(e(x).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 ? (i(), P(U, {
49
- key: 0,
50
- locations: s.availableLocations,
51
- "selected-ids": e(g),
52
- onToggle: p[1] || (p[1] = (c) => f("toggleLocation", c))
53
- }, null, 8, ["locations", "selected-ids"])) : F("", !0)
54
- ], 2));
55
- }
56
- }), O = { class: "flex flex-col gap-8" }, W = /* @__PURE__ */ L({
57
- __name: "FacebookPageLocationMapping",
58
- props: {
59
- pages: {}
60
- },
61
- emits: ["update:pages"],
62
- setup(s, { emit: t }) {
63
- const k = s, f = j();
64
- $(() => f.readLocations());
65
- const r = t, g = I(null), h = T(() => {
66
- const l = /* @__PURE__ */ new Set();
67
- for (const b of k.pages)
68
- b.locationIds.forEach((a) => l.add(a));
69
- return l;
70
- });
71
- function p(l) {
72
- const b = new Set(l.locationIds);
73
- return f.locations.filter((a) => {
74
- const n = a._id.toString();
75
- return !h.value.has(n) || b.has(n);
76
- });
77
- }
78
- function c(l, b) {
79
- const a = b._id.toString(), n = k.pages.map((o) => {
80
- if (o.facebookPageId !== l) return o;
81
- const _ = o.locationIds.includes(a);
82
- return {
83
- ...o,
84
- locationIds: _ ? o.locationIds.filter((d) => d !== a) : [...o.locationIds, a]
85
- };
86
- });
87
- r("update:pages", n);
88
- }
89
- function w(l) {
90
- g.value = g.value === l ? null : l;
91
- }
92
- return (l, b) => (i(), m("div", O, [
93
- (i(!0), m(E, null, R(s.pages, (a) => (i(), P(G, {
94
- key: a.facebookPageId,
95
- page: a,
96
- expanded: e(g) === a.facebookPageId,
97
- "available-locations": p(a),
98
- onToggleExpand: (n) => w(a.facebookPageId),
99
- onToggleLocation: (n) => c(a.facebookPageId, n)
100
- }, null, 8, ["page", "expanded", "available-locations", "onToggleExpand", "onToggleLocation"]))), 128))
101
- ]));
102
- }
103
- }), q = { class: "flex flex-col min-h-full gap-16 p-24" }, J = {
104
- key: 0,
105
- class: "flex flex-col items-center justify-center flex-1 gap-16"
106
- }, K = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, Q = {
107
- key: 1,
108
- class: "flex flex-col items-center justify-center flex-1 gap-16"
109
- }, X = { class: "fm-typo-en-body-lg-600" }, Y = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, Z = {
110
- key: 2,
111
- class: "flex flex-col items-center justify-center flex-1 gap-16"
112
- }, ee = { class: "fm-typo-en-body-lg-600" }, oe = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, te = { class: "fm-typo-en-body-lg-600" }, ne = { class: "flex gap-8 justify-end mt-auto pt-8" }, me = /* @__PURE__ */ L({
113
- __name: "ReviewFacebookCallback",
114
- setup(s) {
115
- const { t } = C(), k = V();
116
- function f() {
117
- return k.replace({ name: z["$connect-REVIEW_SETTINGS"] });
118
- }
119
- const r = I([]), g = I(!1), h = I(!1), p = I(!1), c = I(null), w = T(
120
- () => r.value.some((n) => n.locationIds.length > 0)
121
- );
122
- function l(n, o) {
123
- return n instanceof Error ? n.message : o;
124
- }
125
- async function b() {
126
- const n = window.location.hash;
127
- if (!n) {
128
- c.value = t("connect.review.noToken");
129
- return;
130
- }
131
- const _ = new URLSearchParams(n.slice(1)).get("access_token");
132
- if (!_) {
133
- c.value = t("connect.review.noToken");
134
- return;
135
- }
136
- g.value = !0;
137
- try {
138
- const d = await S.connectFacebook(_);
139
- r.value = (d == null ? void 0 : d.pages) ?? [], r.value.length === 0 && (c.value = t("connect.review.facebook.noPages"));
140
- } catch (d) {
141
- c.value = l(d, t("connect.review.facebook.failed"));
142
- } finally {
143
- g.value = !1;
144
- }
145
- }
146
- async function a() {
147
- if (!w.value) {
148
- c.value = t("connect.review.noMappings");
149
- return;
150
- }
151
- const n = r.value.map((o) => ({
152
- facebookPageId: o.facebookPageId,
153
- locationIds: o.locationIds
154
- }));
155
- h.value = !0;
156
- try {
157
- await S.updateFacebookPages(n), p.value = !0, setTimeout(f, 2e3);
158
- } catch (o) {
159
- c.value = l(o, t("connect.review.facebook.failed"));
160
- } finally {
161
- h.value = !1;
162
- }
163
- }
164
- return $(b), (n, o) => {
165
- const _ = M("FmPageHead");
166
- return i(), m(E, null, [
167
- v(_, {
168
- title: e(t)("connect.navigation.review")
169
- }, null, 8, ["title"]),
170
- u("div", q, [
171
- e(g) ? (i(), m("div", J, [
172
- v(e(x).FmIcon, {
173
- name: "sync",
174
- size: "xl",
175
- class: "animate-spin text-fm-color-neutral-gray-400"
176
- }),
177
- u("p", K, y(e(t)("connect.review.facebook.fetching")), 1)
178
- ])) : e(p) ? (i(), m("div", Q, [
179
- v(e(x).FmIcon, {
180
- name: "check_circle",
181
- size: "xl",
182
- class: "text-fm-color-typo-success"
183
- }),
184
- u("p", X, y(e(t)("connect.review.facebook.success")), 1),
185
- u("p", Y, y(e(t)("connect.review.redirecting")), 1)
186
- ])) : e(c) ? (i(), m("div", Z, [
187
- v(e(x).FmIcon, {
188
- name: "error",
189
- size: "xl",
190
- class: "text-fm-color-system-error-500"
191
- }),
192
- u("p", ee, y(e(t)("connect.review.errorTitle")), 1),
193
- u("p", oe, y(e(c)), 1),
194
- v(e(x).FmButton, {
195
- label: e(t)("connect.review.goBack"),
196
- onClick: o[0] || (o[0] = (d) => f())
197
- }, null, 8, ["label"])
198
- ])) : e(r).length > 0 ? (i(), m(E, { key: 3 }, [
199
- u("p", te, y(e(t)("connect.review.facebook.selectPage")), 1),
200
- v(W, {
201
- pages: e(r),
202
- "onUpdate:pages": o[1] || (o[1] = (d) => N(r) ? r.value = d : null)
203
- }, null, 8, ["pages"]),
204
- u("div", ne, [
205
- v(e(x).FmButton, {
206
- variant: "secondary",
207
- label: e(t)("connect.review.cancel"),
208
- onClick: o[2] || (o[2] = (d) => f())
209
- }, null, 8, ["label"]),
210
- v(e(x).FmButton, {
211
- label: e(t)("connect.review.connect"),
212
- disabled: !e(w),
213
- loading: e(h),
214
- onClick: a
215
- }, null, 8, ["label", "disabled", "loading"])
216
- ])
217
- ], 64)) : F("", !0)
218
- ])
219
- ], 64);
220
- };
221
- }
222
- });
223
- export {
224
- me as default
225
- };