favesalon-embed 0.0.4 → 0.0.5

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 (270) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/chat-button.cjs.entry.js +118 -0
  3. package/dist/cjs/colors-38421769.js +69 -0
  4. package/dist/cjs/favesalon-embed.cjs.js +24 -0
  5. package/dist/cjs/google-map_5.cjs.entry.js +310 -0
  6. package/{cjs/index-d5de0b9d.js → dist/cjs/index-47c2a5f6.js} +513 -199
  7. package/{cjs/index-48ac68d0.js → dist/cjs/index-7f190886.js} +1924 -0
  8. package/dist/cjs/loader.cjs.js +23 -0
  9. package/dist/cjs/relativeTime-3721080d.js +9 -0
  10. package/{cjs → dist/cjs}/salon-booking-modal.cjs.entry.js +7 -6
  11. package/{cjs → dist/cjs}/salon-booking.cjs.entry.js +8 -8
  12. package/dist/cjs/salon-gift-card-modal.cjs.entry.js +29 -0
  13. package/{cjs → dist/cjs}/salon-gift-card.cjs.entry.js +9 -8
  14. package/dist/cjs/salon-latest-reviews.cjs.entry.js +97 -0
  15. package/{cjs/salon-lookbook_2.cjs.entry.js → dist/cjs/salon-lookbook.cjs.entry.js} +28 -58
  16. package/{cjs → dist/cjs}/salon-ranking.cjs.entry.js +9 -8
  17. package/dist/cjs/salon-reviews.cjs.entry.js +193 -0
  18. package/dist/cjs/salon-services.cjs.entry.js +81 -0
  19. package/dist/cjs/salon-stylists.cjs.entry.js +118 -0
  20. package/dist/cjs/services-125c82d8.js +21492 -0
  21. package/dist/cjs/style-detail.cjs.entry.js +312 -0
  22. package/dist/cjs/user-avatar.cjs.entry.js +45 -0
  23. package/{collection → dist/collection}/collection-manifest.json +5 -5
  24. package/dist/collection/components/chat-button/index.css +122 -0
  25. package/dist/collection/components/chat-button/index.js +218 -0
  26. package/dist/collection/components/chat-conversation/index.js +103 -0
  27. package/dist/collection/components/google-map/assets/map--placeholder.jpeg +0 -0
  28. package/{collection → dist/collection}/components/google-map/index.css +0 -1
  29. package/dist/collection/components/google-map/index.js +90 -0
  30. package/{collection → dist/collection}/components/salon-booking/index.css +11 -20
  31. package/dist/collection/components/salon-booking/index.js +126 -0
  32. package/dist/collection/components/salon-booking/salon-booking-modal.js +92 -0
  33. package/dist/collection/components/salon-gift-card/index.css +30 -0
  34. package/dist/collection/components/salon-gift-card/index.js +126 -0
  35. package/dist/collection/components/salon-gift-card/salon-gift-card-modal.js +73 -0
  36. package/dist/collection/components/salon-info/index.js +77 -0
  37. package/dist/collection/components/salon-latest-reviews/index.js +163 -0
  38. package/dist/collection/components/salon-latest-styles/index.css +12 -0
  39. package/dist/collection/components/salon-latest-styles/index.js +183 -0
  40. package/{collection/components/salon-contact → dist/collection/components/salon-locations}/index.css +7 -4
  41. package/dist/collection/components/salon-locations/index.js +143 -0
  42. package/{collection → dist/collection}/components/salon-lookbook/index.css +3 -9
  43. package/dist/collection/components/salon-lookbook/index.js +368 -0
  44. package/dist/collection/components/salon-ranking/index.js +117 -0
  45. package/{collection → dist/collection}/components/salon-reviews/index.css +3 -0
  46. package/dist/collection/components/salon-reviews/index.js +249 -0
  47. package/dist/collection/components/salon-schedules/index.css +18 -0
  48. package/dist/collection/components/salon-schedules/index.js +167 -0
  49. package/dist/collection/components/salon-services/index.css +1 -0
  50. package/dist/collection/components/salon-services/index.js +146 -0
  51. package/dist/collection/components/salon-stylists/index.js +184 -0
  52. package/dist/collection/components/style-detail/index.css +76 -0
  53. package/dist/collection/components/style-detail/index.js +386 -0
  54. package/dist/collection/components/user-avatar/index.js +134 -0
  55. package/dist/collection/constants/colors.js +65 -0
  56. package/dist/collection/mocks/users.js +10 -0
  57. package/dist/collection/services/services.js +295 -0
  58. package/dist/collection/types/chat.js +23 -0
  59. package/dist/collection/types/common.js +11 -0
  60. package/{collection → dist/collection}/types/review.js +9 -5
  61. package/dist/collection/types/salon.js +58 -0
  62. package/dist/collection/types/style.js +128 -0
  63. package/{collection → dist/collection}/types/stylist.js +12 -9
  64. package/dist/collection/types/user.js +10 -0
  65. package/{custom-elements → dist/custom-elements}/index.d.ts +18 -18
  66. package/dist/custom-elements/index.js +28340 -0
  67. package/dist/esm/chat-button.entry.js +114 -0
  68. package/dist/esm/colors-ea36347a.js +67 -0
  69. package/dist/esm/favesalon-embed.js +19 -0
  70. package/dist/esm/google-map_5.entry.js +302 -0
  71. package/{esm/index-0f8eed73.js → dist/esm/index-3fae868e.js} +512 -200
  72. package/{esm/index-67d677ba.js → dist/esm/index-80523fec.js} +1924 -1
  73. package/dist/esm/index.js +1 -0
  74. package/dist/esm/loader.js +19 -0
  75. package/dist/esm/polyfills/css-shim.js +1 -0
  76. package/dist/esm/relativeTime-cd452e6d.js +7 -0
  77. package/{esm → dist/esm}/salon-booking-modal.entry.js +7 -6
  78. package/{esm → dist/esm}/salon-booking.entry.js +7 -7
  79. package/dist/esm/salon-gift-card-modal.entry.js +25 -0
  80. package/{esm → dist/esm}/salon-gift-card.entry.js +8 -7
  81. package/dist/esm/salon-latest-reviews.entry.js +93 -0
  82. package/{esm/salon-lookbook_2.entry.js → dist/esm/salon-lookbook.entry.js} +29 -58
  83. package/{esm → dist/esm}/salon-ranking.entry.js +9 -8
  84. package/dist/esm/salon-reviews.entry.js +189 -0
  85. package/dist/esm/salon-services.entry.js +77 -0
  86. package/dist/esm/salon-stylists.entry.js +114 -0
  87. package/dist/esm/services-40a3e622.js +21485 -0
  88. package/dist/esm/style-detail.entry.js +308 -0
  89. package/dist/esm/user-avatar.entry.js +41 -0
  90. package/dist/favesalon-embed/assets/map--placeholder.jpeg +0 -0
  91. package/{favesalon-embed → dist/favesalon-embed}/favesalon-embed.css +1 -1
  92. package/dist/favesalon-embed/favesalon-embed.esm.js +1 -0
  93. package/dist/favesalon-embed/p-019c5ccd.entry.js +1 -0
  94. package/dist/favesalon-embed/p-083a8821.entry.js +1 -0
  95. package/dist/favesalon-embed/p-0d0ed9ea.entry.js +1 -0
  96. package/dist/favesalon-embed/p-119db8de.entry.js +1 -0
  97. package/dist/favesalon-embed/p-1432c51b.entry.js +1 -0
  98. package/dist/favesalon-embed/p-22093506.entry.js +1 -0
  99. package/dist/favesalon-embed/p-32b314e9.js +2 -0
  100. package/dist/favesalon-embed/p-4a5eca9a.js +6 -0
  101. package/dist/favesalon-embed/p-58d2e9be.js +1 -0
  102. package/dist/favesalon-embed/p-71404b6a.entry.js +1 -0
  103. package/dist/favesalon-embed/p-857c3a61.entry.js +1 -0
  104. package/dist/favesalon-embed/p-99ec77f7.entry.js +1 -0
  105. package/dist/favesalon-embed/p-a33331cc.js +1 -0
  106. package/dist/favesalon-embed/p-b0c3673a.entry.js +1 -0
  107. package/dist/favesalon-embed/p-b287b1ea.entry.js +1 -0
  108. package/dist/favesalon-embed/p-b3af7842.entry.js +1 -0
  109. package/dist/favesalon-embed/p-b630ae68.js +1580 -0
  110. package/dist/favesalon-embed/p-ce2c1c9a.entry.js +1 -0
  111. package/dist/favesalon-embed/p-d9b7ad58.entry.js +1 -0
  112. package/dist/favesalon-embed/p-fc9a5551.js +6 -0
  113. package/dist/types/components/chat-button/index.d.ts +24 -0
  114. package/dist/types/components/google-map/index.d.ts +5 -0
  115. package/{types → dist/types}/components/salon-gift-card/salon-gift-card-modal.d.ts +1 -0
  116. package/{types → dist/types}/components/salon-info/index.d.ts +0 -1
  117. package/{types → dist/types}/components/salon-latest-reviews/index.d.ts +2 -0
  118. package/dist/types/components/salon-latest-styles/index.d.ts +12 -0
  119. package/{types → dist/types}/components/salon-locations/index.d.ts +2 -0
  120. package/{types → dist/types}/components/salon-lookbook/index.d.ts +3 -3
  121. package/dist/types/components/salon-reviews/index.d.ts +24 -0
  122. package/{types → dist/types}/components/salon-schedules/index.d.ts +2 -0
  123. package/{types → dist/types}/components/salon-services/index.d.ts +1 -0
  124. package/{types → dist/types}/components/salon-stylists/index.d.ts +6 -0
  125. package/dist/types/components/style-detail/index.d.ts +24 -0
  126. package/{types → dist/types}/components.d.ts +76 -59
  127. package/dist/types/constants/colors.d.ts +65 -0
  128. package/dist/types/mocks/users.d.ts +10 -0
  129. package/dist/types/services/services.d.ts +75 -0
  130. package/{types → dist/types}/stencil-public-runtime.d.ts +85 -11
  131. package/dist/types/types/chat.d.ts +17 -0
  132. package/dist/types/types/common.d.ts +11 -0
  133. package/{types → dist/types}/types/review.d.ts +4 -0
  134. package/{types → dist/types}/types/salon.d.ts +3 -1
  135. package/dist/types/types/style.d.ts +88 -0
  136. package/{types → dist/types}/types/stylist.d.ts +1 -1
  137. package/{types → dist/types}/types/user.d.ts +2 -2
  138. package/loader/cdn.js +3 -0
  139. package/loader/index.cjs.js +3 -0
  140. package/loader/index.d.ts +21 -0
  141. package/loader/index.es2017.js +3 -0
  142. package/loader/index.js +4 -0
  143. package/loader/package.json +11 -0
  144. package/package.json +19 -14
  145. package/readme.md +24 -7
  146. package/cjs/colors-7f354880.js +0 -95
  147. package/cjs/favesalon-embed.cjs.js +0 -20
  148. package/cjs/google-map.cjs.entry.js +0 -47
  149. package/cjs/index-95daad08.js +0 -1928
  150. package/cjs/loader.cjs.js +0 -22
  151. package/cjs/salon-contact_4.cjs.entry.js +0 -155
  152. package/cjs/salon-gift-card-modal.cjs.entry.js +0 -25
  153. package/cjs/salon-info.cjs.entry.js +0 -35
  154. package/cjs/salon-latest-reviews.cjs.entry.js +0 -58
  155. package/cjs/salon-lookbook-modal.cjs.entry.js +0 -141
  156. package/cjs/salon-reviews.cjs.entry.js +0 -205
  157. package/cjs/salon-services.cjs.entry.js +0 -47
  158. package/cjs/salon-stylists.cjs.entry.js +0 -54
  159. package/cjs/services-f1102d4a.js +0 -5762
  160. package/collection/components/google-map/index.js +0 -97
  161. package/collection/components/salon-booking/index.js +0 -121
  162. package/collection/components/salon-booking/salon-booking-modal.js +0 -88
  163. package/collection/components/salon-contact/index.js +0 -88
  164. package/collection/components/salon-gift-card/index.css +0 -25
  165. package/collection/components/salon-gift-card/index.js +0 -120
  166. package/collection/components/salon-gift-card/salon-gift-card-modal.js +0 -48
  167. package/collection/components/salon-info/index.css +0 -3
  168. package/collection/components/salon-info/index.js +0 -97
  169. package/collection/components/salon-latest-reviews/index.js +0 -108
  170. package/collection/components/salon-locations/index.js +0 -80
  171. package/collection/components/salon-lookbook/index.js +0 -376
  172. package/collection/components/salon-lookbook/lookbook-modal.css +0 -72
  173. package/collection/components/salon-lookbook/salon-lookbook-modal.js +0 -248
  174. package/collection/components/salon-ranking/index.js +0 -114
  175. package/collection/components/salon-reviews/index.js +0 -317
  176. package/collection/components/salon-schedules/index.css +0 -14
  177. package/collection/components/salon-schedules/index.js +0 -103
  178. package/collection/components/salon-services/index.js +0 -113
  179. package/collection/components/salon-styles/index.css +0 -23
  180. package/collection/components/salon-styles/index.js +0 -100
  181. package/collection/components/salon-stylists/index.js +0 -96
  182. package/collection/components/user-avatar/index.css +0 -0
  183. package/collection/components/user-avatar/index.js +0 -127
  184. package/collection/constants/colors.js +0 -91
  185. package/collection/services/services.js +0 -225
  186. package/collection/types/common.js +0 -2
  187. package/collection/types/salon.js +0 -52
  188. package/collection/types/style.js +0 -103
  189. package/collection/types/user.js +0 -10
  190. package/custom-elements/index.js +0 -12125
  191. package/esm/colors-1ec90c5f.js +0 -93
  192. package/esm/favesalon-embed.js +0 -18
  193. package/esm/google-map.entry.js +0 -43
  194. package/esm/index-09d43e3e.js +0 -1926
  195. package/esm/loader.js +0 -18
  196. package/esm/polyfills/css-shim.js +0 -1
  197. package/esm/salon-contact_4.entry.js +0 -148
  198. package/esm/salon-gift-card-modal.entry.js +0 -21
  199. package/esm/salon-info.entry.js +0 -31
  200. package/esm/salon-latest-reviews.entry.js +0 -54
  201. package/esm/salon-lookbook-modal.entry.js +0 -137
  202. package/esm/salon-reviews.entry.js +0 -201
  203. package/esm/salon-services.entry.js +0 -43
  204. package/esm/salon-stylists.entry.js +0 -50
  205. package/esm/services-74d84ca9.js +0 -5756
  206. package/favesalon-embed/favesalon-embed.esm.js +0 -1
  207. package/favesalon-embed/p-0188d4dc.entry.js +0 -1
  208. package/favesalon-embed/p-0318501e.js +0 -1
  209. package/favesalon-embed/p-078f242d.entry.js +0 -1
  210. package/favesalon-embed/p-13e23c61.entry.js +0 -1
  211. package/favesalon-embed/p-17df13ad.js +0 -1
  212. package/favesalon-embed/p-1a3179c8.entry.js +0 -1
  213. package/favesalon-embed/p-20aa75de.js +0 -6
  214. package/favesalon-embed/p-2901a6d6.entry.js +0 -1
  215. package/favesalon-embed/p-2b861430.entry.js +0 -1
  216. package/favesalon-embed/p-44d810a0.js +0 -1
  217. package/favesalon-embed/p-4a5eca9a.js +0 -6
  218. package/favesalon-embed/p-4c68700f.entry.js +0 -1
  219. package/favesalon-embed/p-4e2d7b29.js +0 -1
  220. package/favesalon-embed/p-6b845bf1.entry.js +0 -1
  221. package/favesalon-embed/p-7350f6b5.entry.js +0 -1
  222. package/favesalon-embed/p-897c2b1c.entry.js +0 -1
  223. package/favesalon-embed/p-8e60f56f.entry.js +0 -1
  224. package/favesalon-embed/p-a49afdc1.entry.js +0 -1
  225. package/favesalon-embed/p-c93867c4.entry.js +0 -1
  226. package/favesalon-embed/p-ea6a097f.entry.js +0 -1
  227. package/types/components/google-map/index.d.ts +0 -10
  228. package/types/components/salon-contact/index.d.ts +0 -9
  229. package/types/components/salon-lookbook/salon-lookbook-modal.d.ts +0 -13
  230. package/types/components/salon-reviews/index.d.ts +0 -24
  231. package/types/components/salon-styles/index.d.ts +0 -9
  232. package/types/constants/colors.d.ts +0 -88
  233. package/types/services/services.d.ts +0 -26
  234. package/types/types/common.d.ts +0 -2
  235. package/types/types/style.d.ts +0 -59
  236. /package/{cjs → dist/cjs}/_commonjsHelpers-5cfcba41.js +0 -0
  237. /package/{cjs → dist/cjs}/global-9073d10e.js +0 -0
  238. /package/{cjs → dist/cjs}/index.cjs.js +0 -0
  239. /package/{cjs → dist/cjs}/utils-c5a33b3c.js +0 -0
  240. /package/{esm/index.js → dist/collection/components/salon-info/index.css} +0 -0
  241. /package/{collection → dist/collection}/components/salon-latest-reviews/index.css +0 -0
  242. /package/{collection → dist/collection}/components/salon-ranking/index.css +0 -0
  243. /package/{collection → dist/collection}/components/salon-stylists/index.css +0 -0
  244. /package/{collection/components/salon-locations → dist/collection/components/user-avatar}/index.css +0 -0
  245. /package/{collection → dist/collection}/global/global.js +0 -0
  246. /package/{collection → dist/collection}/index.js +0 -0
  247. /package/{collection → dist/collection}/types/service.js +0 -0
  248. /package/{collection → dist/collection}/utils/utils.js +0 -0
  249. /package/{esm → dist/esm}/_commonjsHelpers-098d5b27.js +0 -0
  250. /package/{esm → dist/esm}/global-e1089ffd.js +0 -0
  251. /package/{esm → dist/esm}/polyfills/core-js.js +0 -0
  252. /package/{esm → dist/esm}/polyfills/dom.js +0 -0
  253. /package/{esm → dist/esm}/polyfills/es5-html-element.js +0 -0
  254. /package/{esm → dist/esm}/polyfills/index.js +0 -0
  255. /package/{esm → dist/esm}/polyfills/system.js +0 -0
  256. /package/{esm → dist/esm}/utils-e97485e0.js +0 -0
  257. /package/{favesalon-embed → dist/favesalon-embed}/index.esm.js +0 -0
  258. /package/{favesalon-embed → dist/favesalon-embed}/p-47e646f8.js +0 -0
  259. /package/{favesalon-embed → dist/favesalon-embed}/p-d6083940.js +0 -0
  260. /package/{index.cjs.js → dist/index.cjs.js} +0 -0
  261. /package/{index.js → dist/index.js} +0 -0
  262. /package/{collection/components/salon-services/index.css → dist/types/components/chat-conversation/index.d.ts} +0 -0
  263. /package/{types → dist/types}/components/salon-booking/index.d.ts +0 -0
  264. /package/{types → dist/types}/components/salon-booking/salon-booking-modal.d.ts +0 -0
  265. /package/{types → dist/types}/components/salon-gift-card/index.d.ts +0 -0
  266. /package/{types → dist/types}/components/salon-ranking/index.d.ts +0 -0
  267. /package/{types → dist/types}/components/user-avatar/index.d.ts +0 -0
  268. /package/{types → dist/types}/index.d.ts +0 -0
  269. /package/{types → dist/types}/types/service.d.ts +0 -0
  270. /package/{types → dist/types}/utils/utils.d.ts +0 -0
@@ -0,0 +1,189 @@
1
+ import { r as registerInstance, h } from './index-3fae868e.js';
2
+ import { H as HttpService, d as dayjs_min, s as shortDateYearFormat } from './services-40a3e622.js';
3
+ import { C as Colors } from './colors-ea36347a.js';
4
+ import './_commonjsHelpers-098d5b27.js';
5
+
6
+ const indexCss = "@media (max-width: 768px){salon-reviews .salon-reviews{flex-direction:column !important}salon-reviews .salon-reviews--filters--options{display:none !important}salon-reviews .salon-reviews--list{padding-top:32px !important;padding-left:0px !important}salon-reviews .reviews-list--sorting>label{display:none !important}}";
7
+
8
+ const pageLimited = 10;
9
+ const sortOptions = [{
10
+ value: 'newest',
11
+ label: 'Newest first',
12
+ }, {
13
+ value: 'oldest',
14
+ label: 'Oldest first',
15
+ }, {
16
+ value: 'rating_desc',
17
+ label: 'High rating first',
18
+ }, {
19
+ value: 'rating_asc',
20
+ label: 'Low rating first',
21
+ }];
22
+ const SalonReviews = class {
23
+ constructor(hostRef) {
24
+ registerInstance(this, hostRef);
25
+ this.salonId = undefined;
26
+ this.primaryColor = Colors.Primary;
27
+ this.salonInfo = undefined;
28
+ this.stats = {};
29
+ this.totalReviews = 0;
30
+ this.allReviews = [];
31
+ this.isLoading = undefined;
32
+ this.isSorting = undefined;
33
+ this.isFiltering = undefined;
34
+ this.isLoadingMore = undefined;
35
+ this.canLoadMore = undefined;
36
+ this.page = 1;
37
+ this.filterBy = [];
38
+ this.sortBy = sortOptions[0].value;
39
+ }
40
+ componentWillLoad() {
41
+ this.fetchData();
42
+ }
43
+ fetchData() {
44
+ this.isLoading = true;
45
+ try {
46
+ HttpService().fetchSalonReviews(this.salonId, {
47
+ page: 1,
48
+ sort: this.sortBy,
49
+ limit: pageLimited,
50
+ }).then(response => {
51
+ const { total, stats, data: allReviews } = response;
52
+ this.stats = stats;
53
+ this.totalReviews = total;
54
+ this.allReviews = allReviews;
55
+ this.canLoadMore = total > pageLimited;
56
+ });
57
+ }
58
+ catch (e) { }
59
+ this.isLoading = false;
60
+ }
61
+ onLoadMore() {
62
+ this.isLoadingMore = true;
63
+ try {
64
+ HttpService().fetchSalonReviews(this.salonId, {
65
+ page: this.page + 1,
66
+ sort: this.sortBy,
67
+ limit: pageLimited,
68
+ }).then(response => {
69
+ const { total, data: allReviews } = response;
70
+ this.page = this.page + 1;
71
+ this.totalReviews = total;
72
+ this.allReviews = this.allReviews.concat(allReviews);
73
+ this.canLoadMore = (allReviews || []).length === pageLimited;
74
+ });
75
+ }
76
+ catch (e) { }
77
+ this.isLoadingMore = false;
78
+ }
79
+ onChangeFilter(filterBy) {
80
+ this.isFiltering = true;
81
+ try {
82
+ HttpService().fetchSalonReviews(this.salonId, Object.assign({ page: 1, sort: this.sortBy, limit: pageLimited }, filterBy.length > 0 ? { avg_point: filterBy } : {})).then(response => {
83
+ const { total, data: allReviews } = response;
84
+ this.page = 1;
85
+ this.totalReviews = total;
86
+ this.allReviews = allReviews;
87
+ this.canLoadMore = (allReviews || []).length === pageLimited;
88
+ });
89
+ }
90
+ catch (e) { }
91
+ this.isFiltering = false;
92
+ }
93
+ onChangeSorting(sortBy) {
94
+ this.isSorting = true;
95
+ try {
96
+ HttpService().fetchSalonReviews(this.salonId, Object.assign({ page: 1, sort: sortBy, limit: pageLimited }, this.filterBy.length > 0 ? { avg_point: this.filterBy } : {})).then(response => {
97
+ const { total, data: allReviews } = response;
98
+ this.page = 1;
99
+ this.totalReviews = total;
100
+ this.allReviews = allReviews;
101
+ this.canLoadMore = (allReviews || []).length === pageLimited;
102
+ });
103
+ }
104
+ catch (e) { }
105
+ this.isSorting = false;
106
+ }
107
+ render() {
108
+ const ratingTexts = ['', 'Poor', 'Sufficient', 'Average', 'Well', 'Very good'];
109
+ return (h("div", { class: "view view--salon-reviews" }, h("div", { class: "salon-reviews--filters" }, h("div", { class: "salon-reviews--score" }, h("div", { class: "salon-review--rating", style: { display: 'flex', flexDirection: 'row' } }, [1, 2, 3, 4, 5].map(score => {
110
+ return (h("i", { class: score <= this.stats.reviewPoint ? 'ri-heart-fill' : 'ri-heart-line', style: Object.assign({ fontSize: '32px', marginRight: '4px' }, score <= this.stats.reviewPoint ? { color: this.primaryColor } : { color: Colors.Gray04 }) }));
111
+ })), h("div", { class: "salon-review--rating--date", style: {
112
+ display: 'flex',
113
+ flexDirection: 'row',
114
+ alignItems: 'center',
115
+ marginTop: '-8px',
116
+ } }, h("span", { style: { fontSize: '24px' } }, this.stats.reviewPoint, "/5"), " ", h("span", { style: { color: Colors.Gray04, marginLeft: '8px' } }, "(", this.stats.totalReviews, " reviews)"))), h("div", { class: "salon-reviews--filters--options", style: { marginTop: '24px' } }, h("div", { style: {
117
+ background: Colors.Gray01,
118
+ display: 'flex',
119
+ alignItems: 'center',
120
+ borderRadius: '4px',
121
+ padding: '16px',
122
+ } }, h("div", null, h("input", { type: "checkbox", checked: this.filterBy.length === 0, onChange: () => {
123
+ this.filterBy = [];
124
+ this.onChangeFilter([]);
125
+ } }), " ", h("span", { style: { marginLeft: '4px' } }, "All reviews")), [5, 4, 3, 2, 1].map(score => {
126
+ const isChecked = this.filterBy.indexOf(score) > -1;
127
+ return (h("div", { key: `salon-reviews--filters-score--${score}`, style: { display: 'flex', alignItems: 'center', marginLeft: '16px' } }, h("input", { type: "checkbox", checked: isChecked, onChange: () => {
128
+ const newFilter = isChecked ? this.filterBy.filter(fs => fs !== score) : this.filterBy.concat([score]);
129
+ this.filterBy = newFilter;
130
+ this.onChangeFilter(newFilter);
131
+ } }), " ", h("span", { style: { display: 'flex', alignItems: 'center', marginLeft: '4px' } }, score, " ", h("i", { class: "ri-heart-line", style: {
132
+ fontSize: '16px',
133
+ marginLeft: '4px',
134
+ marginRight: '4px',
135
+ lineHeight: '1',
136
+ } }), " ", h("span", { style: { color: Colors.Gray04, fontSize: '12px' } }, "(", this.stats[String(score)] || 0, ")"))));
137
+ })))), h("div", { class: "salon-reviews--list-header", style: {
138
+ display: 'flex',
139
+ flexDirection: 'row',
140
+ justifyContent: 'space-between',
141
+ alignItems: 'center',
142
+ marginTop: '24px',
143
+ } }, h("div", { class: "view--salon-reviews--counter" }, this.totalReviews, " ", this.totalReviews === 1 ? `review` : `reviews`), h("div", { style: { display: 'flex', alignItems: 'center' } }, h("label", { style: { marginRight: '8px', color: Colors.Gray04 } }, "Sort by"), h("select", { class: "search-filter--select", "place-holder": "Most popular", disabled: this.isLoading, onChange: (evt) => {
144
+ this.sortBy = evt.target.value;
145
+ this.onChangeSorting(evt.target.value);
146
+ }, style: {
147
+ display: 'flex',
148
+ alignItems: 'center',
149
+ backgroundColor: Colors.Gray01,
150
+ borderColor: Colors.Gray01,
151
+ borderRadius: '4px',
152
+ height: '40px',
153
+ width: '130px',
154
+ } }, sortOptions.map(sortOption => (h("option", { value: sortOption.value, selected: sortOption.value === this.sortBy, key: `search-filter--select-option--${sortOption.value}` }, sortOption.label)))))), h("div", { class: "salon-reviews--list-content", style: { marginTop: '24px' } }, this.allReviews.map((review, idx) => {
155
+ const user = review.user || {};
156
+ return (h("div", { class: "salon-review", key: `salon-review--${idx}`, style: {
157
+ borderBottom: `1px solid ${Colors.Gray02}`,
158
+ marginBottom: '24px',
159
+ paddingBottom: '24px',
160
+ } }, h("div", { class: "salon-review--user", style: { marginBottom: '16px', overflow: 'hidden' } }, h("user-avatar", { size: 48, avatar: user.avatar, name: h("span", { style: { fontSize: '18px', fontWeight: '600', color: Colors.TextColor } }, (user.firstName || user.lastName) ? `${user.firstName || ''} ${user.lastName || ''}` : ''), shortName: `${(user.firstName || '').charAt(0)}${(user.lastName || '').charAt(0)}`, nameStyle: { fontWeight: 'bold' } })), h("div", { class: "salon-review--rating", style: { display: 'flex', flexDirection: 'row', marginBottom: '4px' } }, [1, 2, 3, 4, 5].map(score => (h("i", { key: `salon-review--rating--item--score--${score}`, class: score <= review.point ? 'ri-heart-fill' : 'ri-heart-line', style: {
161
+ color: score <= review.point ? this.primaryColor : Colors.Gray04,
162
+ fontSize: '16px',
163
+ marginRight: '4px',
164
+ } }))), review.createdDate && (h("div", { class: "salon-review--rating--date", style: { fontSize: '14px', color: Colors.Gray04, marginLeft: '16px', position: 'relative', top: '2px' } }, dayjs_min(review.createdDate).format(shortDateYearFormat)))), h("div", { class: "salon-review--rating-text", style: { fontSize: '16px', fontWeight: '600' } }, ratingTexts[review.point]), (review.title || review.description) && (h("div", { class: "salon-review--detail", style: { marginTop: '16px' } }, h("div", { class: "salon-review--title", style: { fontSize: '18px', fontWeight: 'bold' }, innerHTML: review.title }), h("div", { class: "salon-review--description", style: { fontSize: '16px' }, innerHTML: review.description }))), review.photos.length > 0 && (h("div", { style: {
165
+ display: 'flex',
166
+ flexDirection: 'row',
167
+ overflowX: 'auto',
168
+ } }, review.photos.map(fileObj => (h("div", { key: `upload-file--${fileObj.id}`, class: "review--photo", style: {
169
+ position: 'relative',
170
+ cursor: 'pointer',
171
+ marginTop: '16px',
172
+ marginRight: '12px',
173
+ } }, h("img", { width: 72, src: fileObj.imageUrlThumb, style: { display: 'block' } }))))))));
174
+ })), h("div", { class: "salon-reviews--list-footer", style: {
175
+ textAlign: 'center',
176
+ paddingTop: '16px',
177
+ paddingBottom: '16px',
178
+ } }, h("button", { class: "btn btn-light btn-lg", style: {
179
+ background: Colors.White,
180
+ border: `1px solid ${Colors.Gray02}`,
181
+ borderRadius: '4px',
182
+ paddingLeft: '24px',
183
+ paddingRight: '24px',
184
+ }, onClick: () => this.onLoadMore() }, "Load more"))));
185
+ }
186
+ };
187
+ SalonReviews.style = indexCss;
188
+
189
+ export { SalonReviews as salon_reviews };
@@ -0,0 +1,77 @@
1
+ import { r as registerInstance, h } from './index-3fae868e.js';
2
+ import { H as HttpService, a as sortBy_1 } from './services-40a3e622.js';
3
+ import { C as Colors } from './colors-ea36347a.js';
4
+ import './_commonjsHelpers-098d5b27.js';
5
+
6
+ const indexCss = "";
7
+
8
+ const SalonServices = class {
9
+ constructor(hostRef) {
10
+ registerInstance(this, hostRef);
11
+ this.salonId = undefined;
12
+ this.buttonClass = 'btn btn-light';
13
+ this.salonServices = undefined;
14
+ this.isLoading = undefined;
15
+ }
16
+ componentWillLoad() {
17
+ this.fetchData();
18
+ }
19
+ async fetchData() {
20
+ this.isLoading = true;
21
+ try {
22
+ this.salonServices = await HttpService().fetchSalonServices(this.salonId);
23
+ }
24
+ catch (e) {
25
+ this.salonServices = [];
26
+ }
27
+ this.isLoading = false;
28
+ }
29
+ render() {
30
+ if (this.isLoading) {
31
+ return (h("div", { class: "salon-services--container" }, h("div", { class: "view view--salon-services--header", style: { border: `1px solid ${Colors.Gray01}` } }, h("div", { class: "view-content", style: { overflowX: 'auto' } }, h("div", { style: { whiteSpace: 'nowrap', overflow: 'hidden' } }, [1, 2, 3, 4, 5, 6].map((fakeId, index) => (h("div", { key: `service-group--${fakeId}--${index}`, style: {
32
+ backgroundColor: Colors.Gray02,
33
+ float: 'left',
34
+ marginRight: '12px',
35
+ height: '30px',
36
+ width: '120px',
37
+ } })))))), [1, 2, 3, 4, 5, 6].map((fakeId, index) => {
38
+ return (h("div", { id: `service-group--${fakeId}`, style: { marginTop: '32px' } }, h("div", { key: `service-group--${fakeId}--${index}`, style: {
39
+ backgroundColor: Colors.Gray03,
40
+ height: '20px',
41
+ width: '120px',
42
+ } }), h("div", { class: "view view--salon-service-type", style: { border: `1px solid ${Colors.Gray01}`, marginTop: '12px' } }, h("div", { class: "view-content" }, [1, 2, 3].map((fakeGroupId, fakeGroupIndex) => (h("div", { key: `service-group--${fakeId}--service-${fakeGroupId}--${fakeGroupIndex}`, class: "salon-service" }, h("div", { class: "salon-service--name", style: Object.assign({}, fakeGroupIndex > 0 ? {
43
+ marginTop: '12px',
44
+ paddingTop: '12px',
45
+ borderTop: `1px solid ${Colors.Gray01}`,
46
+ } : {}) }, h("div", { key: `service-group--${fakeId}--${index}`, style: {
47
+ backgroundColor: Colors.Gray01,
48
+ height: '16px',
49
+ width: '120px',
50
+ } })), h("div", { style: { marginTop: '4px' } }, h("div", { style: {
51
+ backgroundColor: Colors.Gray01,
52
+ height: '16px',
53
+ width: '240px',
54
+ } })))))))));
55
+ })));
56
+ }
57
+ return (h("div", { class: "salon-services--container" }, h("div", { class: "view view--salon-services--header", style: { border: `1px solid ${Colors.Gray02}` } }, h("div", { class: "view-content", style: { overflowX: 'auto' } }, h("div", { style: { whiteSpace: 'nowrap' } }, sortBy_1(this.salonServices || [], (['order', 'name'])).map((serviceGroup, index) => (h("a", { href: `#service-group--${serviceGroup.id}` }, h("button", { type: "button", class: this.buttonClass, style: index > 0 ? { marginLeft: '12px' } : {} }, serviceGroup.name))))))), sortBy_1(this.salonServices || [], (['order', 'name'])).map(serviceGroup => {
58
+ const hasMultipleCates = (serviceGroup.data || []).length > 1;
59
+ return (h("div", { id: `service-group--${serviceGroup.id}`, style: { marginTop: '32px' } }, h("h3", { style: { fontSize: '24px', marginBottom: '12px' } }, serviceGroup.name), h("div", { class: "view view--salon-service-type", style: { border: `1px solid ${Colors.Gray02}` } }, h("div", { class: "view-content" }, (serviceGroup.data || []).map((subGroup, subGroupIndex) => (h("div", { class: "salon-service-category" }, hasMultipleCates && (h("h4", { style: Object.assign({ fontSize: '20px', marginBottom: '12px', paddingBottom: '12px', borderBottom: `1px solid ${Colors.Gray02}` }, subGroupIndex > 0 ? { marginTop: '32px' } : {}) }, subGroup.name)), (subGroup.data || []).map((service, serviceIndex) => (h("div", { class: "salon-service" }, h("div", { class: "salon-service--name", style: Object.assign({ fontSize: '16px', fontWeight: '500' }, serviceIndex > 0 ? {
60
+ marginTop: '12px',
61
+ paddingTop: '12px',
62
+ borderTop: `1px solid ${Colors.Gray01}`,
63
+ } : {}) }, service.name), (!service.hideDuration || !service.hidePrice) && (h("div", { style: {
64
+ display: 'block',
65
+ marginTop: '4px',
66
+ fontSize: '90%',
67
+ color: Colors.Gray05,
68
+ } }, [
69
+ !service.hideDuration ? `${service.duration} mins` : '',
70
+ !service.hidePrice ? `$${service.price}` : '',
71
+ ].filter(field => !!field).join(' · ')))))))))))));
72
+ })));
73
+ }
74
+ };
75
+ SalonServices.style = indexCss;
76
+
77
+ export { SalonServices as salon_services };
@@ -0,0 +1,114 @@
1
+ import { r as registerInstance, h } from './index-3fae868e.js';
2
+ import { C as Colors } from './colors-ea36347a.js';
3
+ import { H as HttpService } from './services-40a3e622.js';
4
+ import './_commonjsHelpers-098d5b27.js';
5
+
6
+ const indexCss = ".view--salon-stylists{overflow:hidden;margin-left:-12px;margin-top:-12px}.view--salon-stylists .salon-stylist{float:left;padding-left:12px;padding-top:12px;width:50%}.view--salon-stylists .salon-stylist--avatar{height:180px}@media (min-width: 576px){.view--salon-stylists .salon-stylist{width:33.33%;max-width:240px}}@media (min-width: 768px){.view--salon-stylists{margin-left:-24px;margin-top:-24px}.view--salon-stylists .salon-stylist{padding-left:24px;padding-top:24px;width:264px;max-width:none}.view--salon-stylists .salon-stylist--avatar{height:240px}}";
7
+
8
+ const pageLimit = 20;
9
+ const SalonStylists = class {
10
+ constructor(hostRef) {
11
+ registerInstance(this, hostRef);
12
+ this.salonId = undefined;
13
+ this.salonStylists = undefined;
14
+ this.totalStylists = undefined;
15
+ this.page = 1;
16
+ this.isLoading = undefined;
17
+ this.isLoadingMore = undefined;
18
+ this.canLoadMore = undefined;
19
+ }
20
+ componentWillLoad() {
21
+ this.fetchData();
22
+ }
23
+ async fetchData() {
24
+ this.isLoading = true;
25
+ try {
26
+ const { total, data } = await HttpService().fetchSalonStylists(this.salonId, { page: 1, limit: pageLimit });
27
+ this.totalStylists = total;
28
+ this.salonStylists = data;
29
+ this.canLoadMore = data.length === pageLimit;
30
+ }
31
+ catch (e) {
32
+ this.totalStylists = 0;
33
+ this.salonStylists = [];
34
+ this.canLoadMore = false;
35
+ }
36
+ this.isLoading = false;
37
+ }
38
+ async onLoadMore() {
39
+ this.isLoadingMore = true;
40
+ try {
41
+ const { data } = await HttpService().fetchSalonStylists(this.salonId, { page: this.page + 1, limit: pageLimit });
42
+ this.salonStylists = this.salonStylists.concat(data || []);
43
+ this.canLoadMore = data.length === pageLimit;
44
+ this.page += 1;
45
+ }
46
+ catch (e) { }
47
+ this.isLoadingMore = false;
48
+ }
49
+ render() {
50
+ if (this.isLoading) {
51
+ return (h("div", null, h("div", { class: "view--salon-stylists" }, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map((fakeId, index) => (h("div", { class: "salon-stylist" }, h("div", { class: "card", style: {
52
+ background: 'none',
53
+ border: 'none',
54
+ overflow: 'hidden',
55
+ } }, h("div", { class: "salon-stylist--avatar", style: {
56
+ backgroundColor: Colors.Gray01,
57
+ backgroundRepeat: 'no-repeat',
58
+ backgroundPosition: 'center top',
59
+ backgroundSize: 'cover',
60
+ border: `1px solid ${Colors.Gray01}`,
61
+ borderRadius: '8px',
62
+ position: 'relative',
63
+ display: 'flex',
64
+ width: '100%',
65
+ alignItems: 'center',
66
+ justifyContent: 'center',
67
+ } }), h("div", { class: "card-body" }, h("div", { key: `stylist--${fakeId}--${index}`, style: {
68
+ backgroundColor: Colors.Gray01,
69
+ height: '16px',
70
+ width: '120px',
71
+ margin: 'auto',
72
+ } })))))))));
73
+ }
74
+ return (h("div", null, h("div", { class: "view--salon-stylists" }, (this.salonStylists || []).map(stylist => (h("div", { class: "salon-stylist" }, h("div", { class: "card", style: {
75
+ background: 'none',
76
+ border: 'none',
77
+ overflow: 'hidden',
78
+ } }, h("div", { class: "salon-stylist--avatar", style: {
79
+ backgroundImage: `url("${stylist.avatar}")`,
80
+ backgroundColor: Colors.Gray01,
81
+ backgroundRepeat: 'no-repeat',
82
+ backgroundPosition: 'center top',
83
+ backgroundSize: 'cover',
84
+ border: `1px solid ${Colors.Gray01}`,
85
+ borderRadius: '8px',
86
+ position: 'relative',
87
+ display: 'flex',
88
+ width: '100%',
89
+ alignItems: 'center',
90
+ justifyContent: 'center',
91
+ } }, !stylist.avatar && (h("span", { style: {
92
+ fontSize: '32px',
93
+ fontWeight: 'bold',
94
+ textTransform: 'uppercase',
95
+ } }, (stylist.firstName || '').charAt(0), " ", (stylist.lastName || '').charAt(0)))), h("div", { class: "card-body" }, h("div", { style: {
96
+ fontSize: '18px',
97
+ fontWeight: '600',
98
+ textAlign: 'center',
99
+ } }, stylist.fullName))))))), this.canLoadMore && (h("div", { class: "view-footer", style: {
100
+ textAlign: 'center',
101
+ paddingTop: '32px',
102
+ paddingBottom: '16px',
103
+ } }, h("button", { type: "button", class: "btn btn-lg", disabled: this.isLoadingMore, style: {
104
+ background: Colors.White,
105
+ border: `1px solid ${Colors.Gray02}`,
106
+ borderRadius: '4px',
107
+ paddingLeft: '24px',
108
+ paddingRight: '24px',
109
+ }, onClick: () => this.onLoadMore() }, "Load more")))));
110
+ }
111
+ };
112
+ SalonStylists.style = indexCss;
113
+
114
+ export { SalonStylists as salon_stylists };