@feedmepos/mf-connect 0.1.38-beta.74 → 0.1.38-beta.75

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 (140) hide show
  1. package/dist/Analytic-9B27Q-I3.js +761 -0
  2. package/dist/App-isiE4pjM.js +4642 -0
  3. package/dist/AuditLogs-BmHr7pNI.js +1991 -0
  4. package/dist/Bin-BR06pDbx.js +166 -0
  5. package/dist/Broadcast-D_t80J2I.js +267 -0
  6. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-C5IuPCTB.js +121 -0
  7. package/dist/Card-Zs-1lcSr.js +910 -0
  8. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
  9. package/dist/Collections-BjeTJSHo.js +541 -0
  10. package/dist/Credit-DdmdsxOF.js +261 -0
  11. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
  12. package/dist/DateInput.vue_vue_type_script_setup_true_lang-BN4Q5Y3l.js +54 -0
  13. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +58 -0
  14. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DkOfrONH.js +3120 -0
  15. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-kzk3iEKA.js +351 -0
  16. package/dist/Experience-WxtE9ZIT.js +260 -0
  17. package/dist/FileSaver.min-Vgxo4jNi.js +74 -0
  18. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  19. package/dist/Game-Cc0mZ3y4.js +331 -0
  20. package/dist/GenerateMaterial-Dsvnpz4o.js +589 -0
  21. package/dist/Grab-CcaXToD-.js +301 -0
  22. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-D0yJMgs9.js +145 -0
  23. package/dist/Index-C0TcFJJY.js +259 -0
  24. package/dist/JsonViewer-v8_C7l5N.js +87 -0
  25. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-CXFtSS9_.js +48 -0
  26. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-Ca7hKpcD.js +18737 -0
  27. package/dist/MainLayout-DPpjvWwq.js +41 -0
  28. package/dist/Marketing-DfXuNM7X.js +145 -0
  29. package/dist/MarketingMaterialEdit-C63qyQSd.js +746 -0
  30. package/dist/Member-LTYVn-80.js +280 -0
  31. package/dist/MemberList-Gqr6ha5p.js +1601 -0
  32. package/dist/MemberOverview-wL_ailso.js +58 -0
  33. package/dist/MemberTransactions-CVZ-SPhm.js +45 -0
  34. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-BGooFTgg.js +60799 -0
  35. package/dist/Mission-CLQdNsOe.js +335 -0
  36. package/dist/Overview-BluyLBRI.js +1078 -0
  37. package/dist/Point-DQLQxJG1.js +263 -0
  38. package/dist/Promotion-BG0xL1ed.js +397 -0
  39. package/dist/Queue-BR7TrLI8.js +259 -0
  40. package/dist/Record-2WFpDhAb.js +341 -0
  41. package/dist/Review-Bu9SGftr.js +617 -0
  42. package/dist/ReviewFacebookCallback-CV99Udei.js +243 -0
  43. package/dist/ReviewGoogleCallback-DiqgQzOt.js +213 -0
  44. package/dist/Reward-CPhM3ChT.js +442 -0
  45. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-Q9pVq11w.js +149 -0
  46. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BRUQtqjv.js +1912 -0
  47. package/dist/Segment-D6V8FKUY.js +881 -0
  48. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BrE1gGHP.js +181 -0
  49. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-DQhO9k7V.js +188 -0
  50. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-CyHx6m95.js +147 -0
  51. package/dist/Setting-Bh5bB75w.js +2000 -0
  52. package/dist/SettingAdvertisements-CFUjq6s1.js +264 -0
  53. package/dist/Store-DiVaUn7w.js +1996 -0
  54. package/dist/StoreRewards-Bb9iW3Yz.js +535 -0
  55. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-DVFsPzLK.js +1129 -0
  56. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-D9uZR0si.js +7005 -0
  57. package/dist/Tier-BYxLjqAB.js +970 -0
  58. package/dist/Title-D3cdNE2O.js +568 -0
  59. package/dist/Transaction-D7ItbBra.js +39 -0
  60. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-UXSlpEM0.js +130 -0
  61. package/dist/Voucher-DNQz_ujN.js +422 -0
  62. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-CztGuaCV.js +421 -0
  63. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-RI0mY3Nx.js +56 -0
  64. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  65. package/dist/app-wDQR6dpb.js +39 -0
  66. package/dist/app-zPef9Uzl.js +59396 -0
  67. package/dist/app.js +7 -0
  68. package/dist/business-DKEB57Mf.js +82 -0
  69. package/dist/campaign-BD_s6pW4.js +100 -0
  70. package/dist/campaign-CpzFl8Vr.js +4 -0
  71. package/dist/campaign-D9IfNIPI.js +253 -0
  72. package/dist/campaign.enum-gPz5hWSW.js +26 -0
  73. package/dist/campaign.fn-Csxad3W7.js +776 -0
  74. package/dist/collectible.enum-CA-QbTP-.js +19 -0
  75. package/dist/collection.fn-tFxG0UiA.js +26 -0
  76. package/dist/dto-CdvywxS_.js +222 -0
  77. package/dist/duplicateCampaign-Cj68m0Ti.js +51 -0
  78. package/dist/effect-KecOJIEK.js +89 -0
  79. package/dist/email-addresses-Ske7sY-s.js +705 -0
  80. package/dist/export-17vDh5vq.js +97 -0
  81. package/dist/feedme.ico +0 -0
  82. package/dist/helper-B-ZDFjy7.js +86 -0
  83. package/dist/index-BRZC-Cy5.js +85 -0
  84. package/dist/index-BV_G-XzK.js +30289 -0
  85. package/dist/index-BwLCkOIF.js +36 -0
  86. package/dist/index-C1Z4oibL.js +48 -0
  87. package/dist/index-CNLqZu6_.js +2639 -0
  88. package/dist/index-CdByBgmF.js +32 -0
  89. package/dist/index-CkqQGjg1.js +8912 -0
  90. package/dist/index-CuvNtC_M.js +61 -0
  91. package/dist/index-D05Pcg0E.js +124 -0
  92. package/dist/index-D58_aTiN.js +28897 -0
  93. package/dist/index-DCzjjZgV.js +67 -0
  94. package/dist/index-DY3_9zbY.js +3431 -0
  95. package/dist/index-Dc2JsMD2.js +54 -0
  96. package/dist/index-Dh78uGTl.js +146 -0
  97. package/dist/index-DnrSd_o_.js +3 -0
  98. package/dist/index-vh86FiIQ.js +10 -0
  99. package/dist/index-woXH3LmA.js +31 -0
  100. package/dist/index.esm2017-DxQe1gCt.js +3069 -0
  101. package/dist/loading-B1ymwDT_.js +71 -0
  102. package/dist/lodash-BiGSPE0G.js +3678 -0
  103. package/dist/membership-GnNCDGBk.js +235 -0
  104. package/dist/moment-D7p2TMB-.js +2583 -0
  105. package/dist/money-CG6LGklW.js +15 -0
  106. package/dist/number-p19we-YD.js +12 -0
  107. package/dist/object-qECH92oz.js +26 -0
  108. package/dist/objectId-dwaoBfJX.js +7 -0
  109. package/dist/objectid-XhaZoPQl.js +145 -0
  110. package/dist/plugins-cxSxZO0d.js +1817 -0
  111. package/dist/remy-D_Deb3ue.js +13 -0
  112. package/dist/reward-siULTu5h.js +36 -0
  113. package/dist/rule-GD9oMCPH.js +1969 -0
  114. package/dist/rule-builder-DWFem4d5.js +102 -0
  115. package/dist/style.css +13 -0
  116. package/dist/template-o23nw6e2.js +188 -0
  117. package/dist/tier-BJDhpH6X.js +4 -0
  118. package/dist/tiers/tier=1.png +0 -0
  119. package/dist/tiers/tier=2.png +0 -0
  120. package/dist/tiers/tier=3.png +0 -0
  121. package/dist/tiers/tier=4.png +0 -0
  122. package/dist/timezone-BVwygiRH.js +1154 -0
  123. package/dist/titles/type=diamond.png +0 -0
  124. package/dist/titles/type=drinks.png +0 -0
  125. package/dist/titles/type=food.png +0 -0
  126. package/dist/titles/type=heart.png +0 -0
  127. package/dist/titles/type=medal.png +0 -0
  128. package/dist/titles/type=spend.png +0 -0
  129. package/dist/titles/type=thank-you.png +0 -0
  130. package/dist/titles/type=thumbs-up.png +0 -0
  131. package/dist/titles/type=years.png +0 -0
  132. package/dist/trigger-CrEBP1aZ.js +213 -0
  133. package/dist/tslib.es6-BCqqvLQ_.js +44 -0
  134. package/dist/type_drinks-D6jnpvwV.js +4 -0
  135. package/dist/usePagination-BbTCnhtY.js +266 -0
  136. package/dist/user-DcMEufQ6.js +55 -0
  137. package/dist/vue-i18n-BxV_u4BZ.js +2365 -0
  138. package/dist/xlsx-BnJDxONa.js +15491 -0
  139. package/dist/zod-CUN5LrI6.js +91 -0
  140. package/package.json +1 -1
@@ -0,0 +1,617 @@
1
+ import { defineComponent as $, useModel as V, computed as I, onMounted as P, resolveComponent as N, openBlock as t, createElementBlock as a, createElementVNode as r, createVNode as y, unref as e, createBlock as b, createCommentVNode as k, toDisplayString as f, normalizeClass as z, Fragment as _, renderList as R, ref as x, onUnmounted as O, watch as L, isRef as B, useSlots as K, renderSlot as Z, withCtx as j, createStaticVNode as J, KeepAlive as Q } from "vue";
2
+ import { u as U } from "./vue-i18n-BxV_u4BZ.js";
3
+ import { _ as D } from "./DateInput.vue_vue_type_script_setup_true_lang-BN4Q5Y3l.js";
4
+ import { u as W } from "./business-DKEB57Mf.js";
5
+ import { components as p, useSnackbar as X } from "@feedmepos/ui-library";
6
+ import { h as A } from "./moment-D7p2TMB-.js";
7
+ import { r as C } from "./index-C1Z4oibL.js";
8
+ import { u as ee } from "./loading-B1ymwDT_.js";
9
+ const oe = { class: "flex justify-between gap-8" }, te = { class: "flex flex-wrap gap-8" }, ne = /* @__PURE__ */ $({
10
+ __name: "ReviewListingController",
11
+ props: {
12
+ source: { required: !0 },
13
+ sourceModifiers: {},
14
+ dateFrom: { required: !0 },
15
+ dateFromModifiers: {},
16
+ dateTo: { required: !0 },
17
+ dateToModifiers: {},
18
+ locationId: { required: !0 },
19
+ locationIdModifiers: {},
20
+ sort: { required: !0 },
21
+ sortModifiers: {}
22
+ },
23
+ emits: ["update:source", "update:dateFrom", "update:dateTo", "update:locationId", "update:sort"],
24
+ setup(o) {
25
+ const { t: n } = U(), u = V(o, "source"), l = V(o, "dateFrom"), c = V(o, "dateTo"), d = V(o, "locationId"), i = V(o, "sort"), v = W(), g = I(() => [
26
+ { label: n("connect.review.filter.allSources"), value: "" },
27
+ { label: "Google", value: "google" },
28
+ { label: "Facebook", value: "facebook" }
29
+ ]), M = I(() => [
30
+ { label: n("connect.review.filter.allLocations"), value: "" },
31
+ ...v.locationOptions.map((h) => ({ label: h.label, value: h.value }))
32
+ ]), T = I(() => [
33
+ { label: n("connect.review.filter.sort.createTime_desc"), value: "createTime_desc" },
34
+ { label: n("connect.review.filter.sort.createTime_asc"), value: "createTime_asc" },
35
+ { label: n("connect.review.filter.sort.rating_asc"), value: "rating_asc" },
36
+ { label: n("connect.review.filter.sort.rating_desc"), value: "rating_desc" }
37
+ ]), S = I(
38
+ () => v.locations.length > 0
39
+ );
40
+ return P(() => v.readLocations()), (h, s) => {
41
+ const m = N("FmSelect");
42
+ return t(), a("div", oe, [
43
+ r("div", te, [
44
+ y(m, {
45
+ modelValue: u.value,
46
+ "onUpdate:modelValue": s[0] || (s[0] = (w) => u.value = w),
47
+ label: e(n)("connect.review.filter.source"),
48
+ items: e(g)
49
+ }, null, 8, ["modelValue", "label", "items"]),
50
+ e(S) ? (t(), b(m, {
51
+ key: 0,
52
+ modelValue: d.value,
53
+ "onUpdate:modelValue": s[1] || (s[1] = (w) => d.value = w),
54
+ label: e(n)("connect.review.filter.location"),
55
+ items: e(M)
56
+ }, null, 8, ["modelValue", "label", "items"])) : k("", !0),
57
+ y(D, {
58
+ label: e(n)("connect.review.filter.dateFrom"),
59
+ "model-value": l.value,
60
+ "onUpdate:modelValue": s[2] || (s[2] = (w) => l.value = w)
61
+ }, null, 8, ["label", "model-value"]),
62
+ y(D, {
63
+ label: e(n)("connect.review.filter.dateTo"),
64
+ "model-value": c.value,
65
+ "onUpdate:modelValue": s[3] || (s[3] = (w) => c.value = w)
66
+ }, null, 8, ["label", "model-value"])
67
+ ]),
68
+ y(m, {
69
+ modelValue: i.value,
70
+ "onUpdate:modelValue": s[4] || (s[4] = (w) => i.value = w),
71
+ label: e(n)("connect.review.filter.sort.label"),
72
+ items: e(T)
73
+ }, null, 8, ["modelValue", "label", "items"])
74
+ ]);
75
+ };
76
+ }
77
+ }), H = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='%231877F2'%3e%3cpath%20d='M24%2012.073c0-6.627-5.373-12-12-12s-12%205.373-12%2012c0%205.99%204.388%2010.954%2010.125%2011.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007%201.792-4.669%204.533-4.669%201.312%200%202.686.235%202.686.235v2.953H15.83c-1.491%200-1.956.925-1.956%201.874v2.25h3.328l-.532%203.47h-2.796v8.385C19.612%2023.027%2024%2018.062%2024%2012.073z'/%3e%3c/svg%3e", le = { class: "rounded-lg border border-fm-color-neutral-gray-200 bg-white p-16 flex flex-col gap-8" }, se = { class: "flex items-center gap-8" }, ae = ["src"], re = { class: "flex flex-col flex-1 min-w-0" }, ce = { class: "fm-typo-en-body-md-600 truncate" }, ie = { class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400" }, ue = { class: "flex items-center gap-4 shrink-0" }, de = ["src"], me = {
78
+ key: 0,
79
+ class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400"
80
+ }, ve = {
81
+ key: 0,
82
+ class: "flex items-center gap-4"
83
+ }, fe = {
84
+ key: 1,
85
+ class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-700 line-clamp-3"
86
+ }, we = {
87
+ key: 2,
88
+ class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400 italic"
89
+ }, ye = /* @__PURE__ */ $({
90
+ __name: "FacebookReviewCard",
91
+ props: {
92
+ review: {}
93
+ },
94
+ setup(o) {
95
+ const { t: n } = U();
96
+ return (u, l) => {
97
+ var c, d, i;
98
+ return t(), a("div", le, [
99
+ r("div", se, [
100
+ (c = o.review.reviewer) != null && c.pictureUrl ? (t(), a("img", {
101
+ key: 0,
102
+ src: (d = o.review.reviewer) == null ? void 0 : d.pictureUrl,
103
+ class: "w-32 h-32 rounded-full shrink-0 object-cover"
104
+ }, null, 8, ae)) : (t(), b(e(p).FmIcon, {
105
+ key: 1,
106
+ name: "person",
107
+ class: "text-fm-color-neutral-gray-300 shrink-0"
108
+ })),
109
+ r("div", re, [
110
+ r("span", ce, f(((i = o.review.reviewer) == null ? void 0 : i.name) ?? e(n)("connect.review.overview.anonymous")), 1),
111
+ r("span", ie, f(e(A)(o.review.createTime).format("D MMM YYYY, hh:mmA")), 1)
112
+ ]),
113
+ r("div", ue, [
114
+ r("img", {
115
+ src: e(H),
116
+ class: "w-16 h-16"
117
+ }, null, 8, de),
118
+ o.review.pageName ? (t(), a("span", me, f(o.review.pageName), 1)) : k("", !0)
119
+ ])
120
+ ]),
121
+ o.review.isPositive != null ? (t(), a("div", ve, [
122
+ y(e(p).FmIcon, {
123
+ name: o.review.isPositive ? "thumb_up" : "thumb_down",
124
+ size: "sm",
125
+ class: z(
126
+ o.review.isPositive ? "text-fm-color-typo-success" : "text-fm-color-system-error-500"
127
+ )
128
+ }, null, 8, ["name", "class"]),
129
+ r("span", {
130
+ class: z([
131
+ "fm-typo-en-body-sm-400",
132
+ o.review.isPositive ? "text-fm-color-typo-success" : "text-fm-color-system-error-500"
133
+ ])
134
+ }, f(o.review.isPositive ? e(n)("connect.review.overview.positive") : e(n)("connect.review.overview.negative")), 3)
135
+ ])) : k("", !0),
136
+ o.review.comment ? (t(), a("p", fe, f(o.review.comment), 1)) : (t(), a("p", we, f(e(n)("connect.review.overview.noComment")), 1))
137
+ ]);
138
+ };
139
+ }
140
+ }), ge = "/feedme.ico", pe = { class: "rounded-lg border border-fm-color-neutral-gray-200 bg-white p-16 flex flex-col gap-8" }, be = { class: "flex items-center gap-8" }, he = ["src"], xe = { class: "flex flex-col flex-1 min-w-0" }, ke = { class: "fm-typo-en-body-md-600 truncate" }, _e = { class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400" }, $e = { class: "flex items-center gap-4 shrink-0" }, Fe = {
141
+ key: 0,
142
+ class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400"
143
+ }, Ie = { class: "flex items-center gap-4" }, Me = {
144
+ key: 0,
145
+ class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-700 line-clamp-3"
146
+ }, Ue = {
147
+ key: 1,
148
+ class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400 italic"
149
+ }, Ce = /* @__PURE__ */ $({
150
+ __name: "FeedmeReviewCard",
151
+ props: {
152
+ review: {}
153
+ },
154
+ setup(o) {
155
+ const { t: n } = U();
156
+ return (u, l) => (t(), a("div", pe, [
157
+ r("div", be, [
158
+ o.review.reviewer.photoUrl ? (t(), a("img", {
159
+ key: 0,
160
+ src: o.review.reviewer.photoUrl,
161
+ class: "w-32 h-32 rounded-full shrink-0 object-cover"
162
+ }, null, 8, he)) : (t(), b(e(p).FmIcon, {
163
+ key: 1,
164
+ name: "person",
165
+ class: "text-fm-color-neutral-gray-300 shrink-0"
166
+ })),
167
+ r("div", xe, [
168
+ r("span", ke, f(o.review.reviewer.name ?? e(n)("connect.review.overview.anonymous")), 1),
169
+ r("span", _e, f(e(A)(o.review.createTime).format("D MMM YYYY, hh:mmA")), 1)
170
+ ]),
171
+ r("div", $e, [
172
+ l[0] || (l[0] = r("img", {
173
+ src: ge,
174
+ class: "w-16 h-16"
175
+ }, null, -1)),
176
+ o.review.location ? (t(), a("span", Fe, f(o.review.location.name), 1)) : k("", !0)
177
+ ])
178
+ ]),
179
+ r("div", Ie, [
180
+ (t(), a(_, null, R(5, (c) => y(e(p).FmIcon, {
181
+ key: c,
182
+ name: "star",
183
+ size: "sm",
184
+ class: z(
185
+ c <= o.review.starRating ? "text-yellow-400" : "text-fm-color-neutral-gray-200"
186
+ )
187
+ }, null, 8, ["class"])), 64))
188
+ ]),
189
+ o.review.comment ? (t(), a("p", Me, f(o.review.comment), 1)) : (t(), a("p", Ue, f(e(n)("connect.review.overview.noComment")), 1))
190
+ ]));
191
+ }
192
+ }), q = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2048%2048'%3e%3cpath%20fill='%23EA4335'%20d='M24%209.5c3.14%200%205.95%201.08%208.17%202.86l6.08-6.08C34.46%203.1%2029.5%201%2024%201%2014.82%201%206.96%206.48%203.22%2014.44l7.08%205.5C12.08%2013.66%2017.58%209.5%2024%209.5z'/%3e%3cpath%20fill='%234285F4'%20d='M46.52%2024.5c0-1.64-.15-3.22-.42-4.74H24v8.98h12.7c-.55%202.96-2.2%205.46-4.68%207.14l7.18%205.58C43.18%2037.36%2046.52%2031.38%2046.52%2024.5z'/%3e%3cpath%20fill='%23FBBC05'%20d='M10.3%2028.56A14.56%2014.56%200%200%201%209.5%2024c0-1.58.27-3.1.76-4.52l-7.08-5.5A23.94%2023.94%200%200%200%200%2024c0%203.86.92%207.5%202.56%2010.72l7.74-6.16z'/%3e%3cpath%20fill='%2334A853'%20d='M24%2047c5.5%200%2010.12-1.82%2013.48-4.94l-7.18-5.58c-1.82%201.22-4.14%201.94-6.3%201.94-6.42%200-11.92-4.16-13.7-9.86l-7.74%206.16C6.96%2041.52%2014.82%2047%2024%2047z'/%3e%3cpath%20fill='none'%20d='M0%200h48v48H0z'/%3e%3c/svg%3e", Te = { class: "rounded-lg border border-fm-color-neutral-gray-200 bg-white p-16 flex flex-col gap-8" }, Re = { class: "flex items-center gap-8" }, Se = ["src"], Ve = { class: "flex flex-col flex-1 min-w-0" }, Be = { class: "fm-typo-en-body-md-600 truncate" }, ze = { class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400" }, Ee = { class: "flex items-center gap-4 shrink-0" }, Pe = ["src"], Ye = {
193
+ key: 0,
194
+ class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400"
195
+ }, Ne = { class: "flex items-center gap-4" }, Ae = {
196
+ key: 0,
197
+ class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-700 line-clamp-3"
198
+ }, Le = {
199
+ key: 1,
200
+ class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400 italic"
201
+ }, je = /* @__PURE__ */ $({
202
+ __name: "GoogleReviewCard",
203
+ props: {
204
+ review: {}
205
+ },
206
+ setup(o) {
207
+ const { t: n } = U();
208
+ return (u, l) => {
209
+ var c, d, i;
210
+ return t(), a("div", Te, [
211
+ r("div", Re, [
212
+ (c = o.review.reviewer) != null && c.pictureUrl ? (t(), a("img", {
213
+ key: 0,
214
+ src: (d = o.review.reviewer) == null ? void 0 : d.pictureUrl,
215
+ class: "w-32 h-32 rounded-full shrink-0 object-cover"
216
+ }, null, 8, Se)) : (t(), b(e(p).FmIcon, {
217
+ key: 1,
218
+ name: "person",
219
+ class: "text-fm-color-neutral-gray-300 shrink-0"
220
+ })),
221
+ r("div", Ve, [
222
+ r("span", Be, f(((i = o.review.reviewer) == null ? void 0 : i.name) ?? e(n)("connect.review.overview.anonymous")), 1),
223
+ r("span", ze, f(e(A)(o.review.createTime).format("D MMM YYYY, hh:mmA")), 1)
224
+ ]),
225
+ r("div", Ee, [
226
+ r("img", {
227
+ src: e(q),
228
+ class: "w-16 h-16"
229
+ }, null, 8, Pe),
230
+ o.review.locationDisplayName ? (t(), a("span", Ye, f(o.review.locationDisplayName), 1)) : k("", !0)
231
+ ])
232
+ ]),
233
+ r("div", Ne, [
234
+ (t(), a(_, null, R(5, (v) => y(e(p).FmIcon, {
235
+ key: v,
236
+ name: "star",
237
+ size: "sm",
238
+ class: z(
239
+ v <= o.review.starRating ? "text-yellow-400" : "text-fm-color-neutral-gray-200"
240
+ )
241
+ }, null, 8, ["class"])), 64))
242
+ ]),
243
+ o.review.comment ? (t(), a("p", Ae, f(o.review.comment), 1)) : (t(), a("p", Le, f(e(n)("connect.review.overview.noComment")), 1))
244
+ ]);
245
+ };
246
+ }
247
+ }), De = /* @__PURE__ */ $({
248
+ __name: "ReviewCard",
249
+ props: {
250
+ review: {}
251
+ },
252
+ setup(o) {
253
+ const n = o, u = I(
254
+ () => n.review.source === "google" ? n.review : null
255
+ ), l = I(
256
+ () => n.review.source === "facebook" ? n.review : null
257
+ ), c = I(
258
+ () => n.review.source === "feedme" ? n.review : null
259
+ );
260
+ return console.log(n.review), (d, i) => u.value ? (t(), b(je, {
261
+ key: 0,
262
+ review: u.value
263
+ }, null, 8, ["review"])) : l.value ? (t(), b(ye, {
264
+ key: 1,
265
+ review: l.value
266
+ }, null, 8, ["review"])) : c.value ? (t(), b(Ce, {
267
+ key: 2,
268
+ review: c.value
269
+ }, null, 8, ["review"])) : k("", !0);
270
+ }
271
+ }), Ge = {
272
+ key: 0,
273
+ class: "flex justify-center py-32"
274
+ }, He = {
275
+ key: 1,
276
+ class: "flex flex-col items-center justify-center py-48 gap-8"
277
+ }, qe = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, Oe = {
278
+ key: 3,
279
+ class: "flex justify-center py-16"
280
+ }, Ke = /* @__PURE__ */ $({
281
+ __name: "ReviewFeed",
282
+ props: {
283
+ reviews: {},
284
+ loading: { type: Boolean },
285
+ hasMore: { type: Boolean }
286
+ },
287
+ emits: ["loadMore"],
288
+ setup(o, { emit: n }) {
289
+ const { t: u } = U(), l = o, c = n, d = x(null);
290
+ return P(() => {
291
+ const i = new IntersectionObserver(
292
+ (v) => {
293
+ v[0].isIntersecting && l.hasMore && !l.loading && c("loadMore");
294
+ },
295
+ { threshold: 0.5 }
296
+ );
297
+ d.value && i.observe(d.value), O(() => i.disconnect());
298
+ }), (i, v) => (t(), a(_, null, [
299
+ o.loading && o.reviews.length === 0 ? (t(), a("div", Ge, [
300
+ y(e(p).FmIcon, {
301
+ name: "sync",
302
+ size: "xl",
303
+ class: "animate-spin text-fm-color-neutral-gray-400"
304
+ })
305
+ ])) : o.reviews.length === 0 ? (t(), a("div", He, [
306
+ y(e(p).FmIcon, {
307
+ name: "rate_review",
308
+ size: "xl",
309
+ class: "text-fm-color-neutral-gray-300"
310
+ }),
311
+ r("p", qe, f(e(u)("connect.review.overview.empty")), 1)
312
+ ])) : (t(!0), a(_, { key: 2 }, R(o.reviews, (g) => (t(), b(De, {
313
+ key: g._id,
314
+ review: g
315
+ }, null, 8, ["review"]))), 128)),
316
+ r("div", {
317
+ ref_key: "sentinel",
318
+ ref: d,
319
+ class: "h-1"
320
+ }, null, 512),
321
+ o.loading && o.reviews.length > 0 ? (t(), a("div", Oe, [
322
+ y(e(p).FmIcon, {
323
+ name: "sync",
324
+ size: "md",
325
+ class: "animate-spin text-fm-color-neutral-gray-400"
326
+ })
327
+ ])) : k("", !0)
328
+ ], 64));
329
+ }
330
+ }), Ze = { class: "p-24 flex flex-col gap-12" }, Y = 20, Je = /* @__PURE__ */ $({
331
+ __name: "ReviewOverview",
332
+ setup(o) {
333
+ const n = x([]), u = x(!1), l = x(!0), c = x(null), d = x(null), i = x(null), v = x(""), g = x("createTime_desc");
334
+ L(c, () => {
335
+ v.value = "";
336
+ });
337
+ function M(h) {
338
+ return {
339
+ source: c.value || void 0,
340
+ dateFrom: d.value || void 0,
341
+ dateTo: i.value || void 0,
342
+ locationId: v.value || void 0,
343
+ sort: g.value,
344
+ limit: Y,
345
+ skip: h
346
+ };
347
+ }
348
+ async function T() {
349
+ u.value = !0, l.value = !0;
350
+ try {
351
+ const h = await C.listReviews(M(0));
352
+ n.value = h, l.value = h.length === Y;
353
+ } finally {
354
+ u.value = !1;
355
+ }
356
+ }
357
+ async function S() {
358
+ if (!(u.value || !l.value)) {
359
+ u.value = !0;
360
+ try {
361
+ const h = await C.listReviews(M(n.value.length));
362
+ n.value = [...n.value, ...h], l.value = h.length === Y;
363
+ } finally {
364
+ u.value = !1;
365
+ }
366
+ }
367
+ }
368
+ return L([c, d, i, v, g], T), P(T), (h, s) => (t(), a("div", Ze, [
369
+ y(ne, {
370
+ source: e(c),
371
+ "onUpdate:source": s[0] || (s[0] = (m) => B(c) ? c.value = m : null),
372
+ "date-from": e(d),
373
+ "onUpdate:dateFrom": s[1] || (s[1] = (m) => B(d) ? d.value = m : null),
374
+ "date-to": e(i),
375
+ "onUpdate:dateTo": s[2] || (s[2] = (m) => B(i) ? i.value = m : null),
376
+ "location-id": e(v),
377
+ "onUpdate:locationId": s[3] || (s[3] = (m) => B(v) ? v.value = m : null),
378
+ sort: e(g),
379
+ "onUpdate:sort": s[4] || (s[4] = (m) => B(g) ? g.value = m : null)
380
+ }, null, 8, ["source", "date-from", "date-to", "location-id", "sort"]),
381
+ y(Ke, {
382
+ reviews: e(n),
383
+ loading: e(u),
384
+ "has-more": e(l),
385
+ onLoadMore: S
386
+ }, null, 8, ["reviews", "loading", "has-more"])
387
+ ]));
388
+ }
389
+ }), Qe = { class: "rounded-lg border border-fm-color-neutral-gray-200 bg-white overflow-hidden" }, We = ["src"], Xe = { class: "flex flex-col flex-1 min-w-0" }, eo = { class: "fm-typo-en-body-md-600 capitalize" }, oo = {
390
+ key: 0,
391
+ class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400 truncate"
392
+ }, G = /* @__PURE__ */ $({
393
+ __name: "ReviewSource",
394
+ props: {
395
+ icon: {},
396
+ name: {},
397
+ connected: { type: Boolean },
398
+ subtitle: {},
399
+ syncing: { type: Boolean },
400
+ tokenExpired: { type: Boolean }
401
+ },
402
+ emits: ["connect", "sync"],
403
+ setup(o, { emit: n }) {
404
+ const u = n, { t: l } = U(), c = K();
405
+ return (d, i) => (t(), a("div", Qe, [
406
+ r("div", {
407
+ class: z(["flex items-center gap-12 p-16", e(c).default ? "border-b border-fm-color-neutral-gray-100" : ""])
408
+ }, [
409
+ r("img", {
410
+ src: o.icon,
411
+ class: "w-10 h-10 shrink-0"
412
+ }, null, 8, We),
413
+ r("div", Xe, [
414
+ r("span", eo, f(o.name), 1),
415
+ o.subtitle ? (t(), a("span", oo, f(o.subtitle), 1)) : k("", !0)
416
+ ]),
417
+ o.connected ? (t(), a(_, { key: 0 }, [
418
+ o.tokenExpired ? (t(), b(e(p).FmChip, {
419
+ key: 0,
420
+ label: e(l)("connect.review.expired"),
421
+ variant: "critical"
422
+ }, null, 8, ["label"])) : k("", !0),
423
+ y(e(p).FmButton, {
424
+ variant: "secondary",
425
+ "prepend-icon": "refresh",
426
+ label: e(l)("connect.review.reconnect"),
427
+ onClick: i[0] || (i[0] = (v) => u("connect"))
428
+ }, null, 8, ["label"]),
429
+ o.tokenExpired ? k("", !0) : (t(), b(e(p).FmButton, {
430
+ key: 1,
431
+ variant: "primary",
432
+ "prepend-icon": "sync",
433
+ label: e(l)("connect.review.sync"),
434
+ loading: o.syncing,
435
+ onClick: i[1] || (i[1] = (v) => u("sync"))
436
+ }, null, 8, ["label", "loading"]))
437
+ ], 64)) : (t(), b(e(p).FmButton, {
438
+ key: 1,
439
+ "prepend-icon": "add",
440
+ label: e(l)("connect.review.connect"),
441
+ onClick: i[2] || (i[2] = (v) => u("connect"))
442
+ }, null, 8, ["label"]))
443
+ ], 2),
444
+ Z(d.$slots, "default")
445
+ ]));
446
+ }
447
+ }), to = { class: "p-24 flex flex-col gap-8" }, no = { class: "flex flex-col flex-1 min-w-0" }, lo = { class: "fm-typo-en-body-lg-600 truncate" }, so = { class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400 truncate" }, ao = ["src"], ro = { class: "flex flex-col flex-1 min-w-0" }, co = { class: "fm-typo-en-body-lg-600 truncate" }, io = { class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400 truncate" }, uo = /* @__PURE__ */ $({
448
+ __name: "ReviewSettings",
449
+ setup(o) {
450
+ const { t: n } = U(), u = X(), l = x(null), c = x(!1), d = x(!1), i = I(
451
+ () => {
452
+ var s;
453
+ return l.value ? ((s = l.value.google) == null ? void 0 : s.token) === null : !1;
454
+ }
455
+ ), v = I(
456
+ () => {
457
+ var s;
458
+ return l.value ? ((s = l.value.facebook) == null ? void 0 : s.token) === null : !1;
459
+ }
460
+ );
461
+ async function g() {
462
+ await ee.minor(async () => {
463
+ l.value = await C.getSource();
464
+ });
465
+ }
466
+ async function M() {
467
+ var s, m;
468
+ c.value = !0;
469
+ try {
470
+ await C.syncGoogleReviews();
471
+ } catch (w) {
472
+ if (await g(), ((m = (s = l.value) == null ? void 0 : s.google) == null ? void 0 : m.token) === null) {
473
+ u.open({
474
+ message: n("connect.review.tokenExpired"),
475
+ type: "error"
476
+ });
477
+ return;
478
+ }
479
+ throw w;
480
+ } finally {
481
+ c.value = !1;
482
+ }
483
+ }
484
+ async function T() {
485
+ var s, m;
486
+ d.value = !0;
487
+ try {
488
+ await C.syncFacebookReviews();
489
+ } catch (w) {
490
+ if (await g(), ((m = (s = l.value) == null ? void 0 : s.facebook) == null ? void 0 : m.token) === null) {
491
+ u.open({
492
+ message: n("connect.review.tokenExpired"),
493
+ type: "error"
494
+ });
495
+ return;
496
+ }
497
+ throw w;
498
+ } finally {
499
+ d.value = !1;
500
+ }
501
+ }
502
+ async function S() {
503
+ const s = `${window.location.origin}/review/google/callback`, { callbackUrl: m } = await C.getOauthUrl("google", s);
504
+ window.location.href = m;
505
+ }
506
+ async function h() {
507
+ const s = `${window.location.origin}/review/facebook/callback`, { callbackUrl: m } = await C.getOauthUrl("facebook", s);
508
+ window.location.href = m;
509
+ }
510
+ return P(g), (s, m) => (t(), a("div", to, [
511
+ e(l) ? (t(), a(_, { key: 0 }, [
512
+ y(G, {
513
+ icon: e(q),
514
+ name: "google",
515
+ connected: !!e(l).google,
516
+ syncing: e(c),
517
+ "token-expired": e(i),
518
+ onConnect: S,
519
+ onSync: M
520
+ }, {
521
+ default: j(() => {
522
+ var w;
523
+ return [
524
+ (t(!0), a(_, null, R((w = e(l).google) == null ? void 0 : w.locations, (F) => {
525
+ var E;
526
+ return t(), a("div", {
527
+ key: F.googleLocationName,
528
+ class: "flex items-center gap-12 px-16 py-12 border-b border-fm-color-neutral-gray-100 last:border-b-0"
529
+ }, [
530
+ y(e(p).FmIcon, {
531
+ name: "location_on",
532
+ class: "text-fm-color-neutral-gray-300 shrink-0"
533
+ }),
534
+ r("div", no, [
535
+ r("span", lo, f(F.displayName), 1),
536
+ r("span", so, f(((E = F.location) == null ? void 0 : E.name) ?? e(n)("connect.review.google.noLocations")), 1)
537
+ ])
538
+ ]);
539
+ }), 128))
540
+ ];
541
+ }),
542
+ _: 1
543
+ }, 8, ["icon", "connected", "syncing", "token-expired"]),
544
+ y(G, {
545
+ icon: e(H),
546
+ name: "facebook",
547
+ connected: !!e(l).facebook,
548
+ syncing: e(d),
549
+ "token-expired": e(v),
550
+ onConnect: h,
551
+ onSync: T
552
+ }, {
553
+ default: j(() => {
554
+ var w;
555
+ return [
556
+ (t(!0), a(_, null, R((w = e(l).facebook) == null ? void 0 : w.pages, (F) => (t(), a("div", {
557
+ key: F.facebookPageId,
558
+ class: "flex items-center gap-12 px-16 py-12 border-b border-fm-color-neutral-gray-100 last:border-b-0"
559
+ }, [
560
+ F.pageProfileImageUrl ? (t(), a("img", {
561
+ key: 0,
562
+ src: F.pageProfileImageUrl,
563
+ class: "w-10 h-10 rounded-full shrink-0 object-cover"
564
+ }, null, 8, ao)) : (t(), b(e(p).FmIcon, {
565
+ key: 1,
566
+ name: "person",
567
+ class: "text-fm-color-neutral-gray-300 shrink-0"
568
+ })),
569
+ r("div", ro, [
570
+ r("span", co, f(F.pageName), 1),
571
+ r("span", io, f(F.locations.map((E) => E.name).join(", ")), 1)
572
+ ])
573
+ ]))), 128))
574
+ ];
575
+ }),
576
+ _: 1
577
+ }, 8, ["icon", "connected", "syncing", "token-expired"])
578
+ ], 64)) : (t(), a(_, { key: 1 }, R(["google", "facebook"], (w) => r("div", {
579
+ key: w,
580
+ class: "rounded-lg border border-fm-color-neutral-gray-200 bg-white p-16"
581
+ }, [...m[0] || (m[0] = [
582
+ J('<div class="animate-pulse flex items-center gap-12"><div class="w-10 h-10 rounded-full bg-fm-color-neutral-gray-100 shrink-0"></div><div class="flex-1 min-w-0 space-y-8"><div class="h-16 w-20 rounded bg-fm-color-neutral-gray-100"></div><div class="h-12 w-full max-w-[160px] rounded bg-fm-color-neutral-gray-100"></div></div><div class="h-32 w-24 rounded bg-fm-color-neutral-gray-100 shrink-0"></div></div>', 1)
583
+ ])])), 64))
584
+ ]));
585
+ }
586
+ }), mo = { class: "flex flex-col" }, vo = { class: "px-24" }, ko = /* @__PURE__ */ $({
587
+ __name: "Review",
588
+ setup(o) {
589
+ const { t: n } = U(), u = [
590
+ { label: n("connect.review.tabs.overview"), value: "overview" },
591
+ { label: n("connect.review.tabs.settings"), value: "settings" }
592
+ ], l = x(u[0]);
593
+ return (c, d) => {
594
+ const i = N("FmPageHead"), v = N("FmTabs");
595
+ return t(), a(_, null, [
596
+ y(i, {
597
+ title: e(n)("connect.navigation.review")
598
+ }, null, 8, ["title"]),
599
+ r("div", mo, [
600
+ r("div", vo, [
601
+ y(v, {
602
+ "model-value": e(l).value,
603
+ items: u,
604
+ "onUpdate:modelValue": d[0] || (d[0] = (g) => l.value = u.find((M) => M.value === g))
605
+ }, null, 8, ["model-value"])
606
+ ]),
607
+ (t(), b(Q, null, [
608
+ e(l).value === "overview" ? (t(), b(Je, { key: 0 })) : e(l).value === "settings" ? (t(), b(uo, { key: 1 })) : k("", !0)
609
+ ], 1024))
610
+ ])
611
+ ], 64);
612
+ };
613
+ }
614
+ });
615
+ export {
616
+ ko as default
617
+ };