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.
- package/LICENSE +21 -0
- package/dist/cjs/chat-button.cjs.entry.js +118 -0
- package/dist/cjs/colors-38421769.js +69 -0
- package/dist/cjs/favesalon-embed.cjs.js +24 -0
- package/dist/cjs/google-map_5.cjs.entry.js +310 -0
- package/{cjs/index-d5de0b9d.js → dist/cjs/index-47c2a5f6.js} +513 -199
- package/{cjs/index-48ac68d0.js → dist/cjs/index-7f190886.js} +1924 -0
- package/dist/cjs/loader.cjs.js +23 -0
- package/dist/cjs/relativeTime-3721080d.js +9 -0
- package/{cjs → dist/cjs}/salon-booking-modal.cjs.entry.js +7 -6
- package/{cjs → dist/cjs}/salon-booking.cjs.entry.js +8 -8
- package/dist/cjs/salon-gift-card-modal.cjs.entry.js +29 -0
- package/{cjs → dist/cjs}/salon-gift-card.cjs.entry.js +9 -8
- package/dist/cjs/salon-latest-reviews.cjs.entry.js +97 -0
- package/{cjs/salon-lookbook_2.cjs.entry.js → dist/cjs/salon-lookbook.cjs.entry.js} +28 -58
- package/{cjs → dist/cjs}/salon-ranking.cjs.entry.js +9 -8
- package/dist/cjs/salon-reviews.cjs.entry.js +193 -0
- package/dist/cjs/salon-services.cjs.entry.js +81 -0
- package/dist/cjs/salon-stylists.cjs.entry.js +118 -0
- package/dist/cjs/services-125c82d8.js +21492 -0
- package/dist/cjs/style-detail.cjs.entry.js +312 -0
- package/dist/cjs/user-avatar.cjs.entry.js +45 -0
- package/{collection → dist/collection}/collection-manifest.json +5 -5
- package/dist/collection/components/chat-button/index.css +122 -0
- package/dist/collection/components/chat-button/index.js +218 -0
- package/dist/collection/components/chat-conversation/index.js +103 -0
- package/dist/collection/components/google-map/assets/map--placeholder.jpeg +0 -0
- package/{collection → dist/collection}/components/google-map/index.css +0 -1
- package/dist/collection/components/google-map/index.js +90 -0
- package/{collection → dist/collection}/components/salon-booking/index.css +11 -20
- package/dist/collection/components/salon-booking/index.js +126 -0
- package/dist/collection/components/salon-booking/salon-booking-modal.js +92 -0
- package/dist/collection/components/salon-gift-card/index.css +30 -0
- package/dist/collection/components/salon-gift-card/index.js +126 -0
- package/dist/collection/components/salon-gift-card/salon-gift-card-modal.js +73 -0
- package/dist/collection/components/salon-info/index.js +77 -0
- package/dist/collection/components/salon-latest-reviews/index.js +163 -0
- package/dist/collection/components/salon-latest-styles/index.css +12 -0
- package/dist/collection/components/salon-latest-styles/index.js +183 -0
- package/{collection/components/salon-contact → dist/collection/components/salon-locations}/index.css +7 -4
- package/dist/collection/components/salon-locations/index.js +143 -0
- package/{collection → dist/collection}/components/salon-lookbook/index.css +3 -9
- package/dist/collection/components/salon-lookbook/index.js +368 -0
- package/dist/collection/components/salon-ranking/index.js +117 -0
- package/{collection → dist/collection}/components/salon-reviews/index.css +3 -0
- package/dist/collection/components/salon-reviews/index.js +249 -0
- package/dist/collection/components/salon-schedules/index.css +18 -0
- package/dist/collection/components/salon-schedules/index.js +167 -0
- package/dist/collection/components/salon-services/index.css +1 -0
- package/dist/collection/components/salon-services/index.js +146 -0
- package/dist/collection/components/salon-stylists/index.js +184 -0
- package/dist/collection/components/style-detail/index.css +76 -0
- package/dist/collection/components/style-detail/index.js +386 -0
- package/dist/collection/components/user-avatar/index.js +134 -0
- package/dist/collection/constants/colors.js +65 -0
- package/dist/collection/mocks/users.js +10 -0
- package/dist/collection/services/services.js +295 -0
- package/dist/collection/types/chat.js +23 -0
- package/dist/collection/types/common.js +11 -0
- package/{collection → dist/collection}/types/review.js +9 -5
- package/dist/collection/types/salon.js +58 -0
- package/dist/collection/types/style.js +128 -0
- package/{collection → dist/collection}/types/stylist.js +12 -9
- package/dist/collection/types/user.js +10 -0
- package/{custom-elements → dist/custom-elements}/index.d.ts +18 -18
- package/dist/custom-elements/index.js +28340 -0
- package/dist/esm/chat-button.entry.js +114 -0
- package/dist/esm/colors-ea36347a.js +67 -0
- package/dist/esm/favesalon-embed.js +19 -0
- package/dist/esm/google-map_5.entry.js +302 -0
- package/{esm/index-0f8eed73.js → dist/esm/index-3fae868e.js} +512 -200
- package/{esm/index-67d677ba.js → dist/esm/index-80523fec.js} +1924 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +19 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/relativeTime-cd452e6d.js +7 -0
- package/{esm → dist/esm}/salon-booking-modal.entry.js +7 -6
- package/{esm → dist/esm}/salon-booking.entry.js +7 -7
- package/dist/esm/salon-gift-card-modal.entry.js +25 -0
- package/{esm → dist/esm}/salon-gift-card.entry.js +8 -7
- package/dist/esm/salon-latest-reviews.entry.js +93 -0
- package/{esm/salon-lookbook_2.entry.js → dist/esm/salon-lookbook.entry.js} +29 -58
- package/{esm → dist/esm}/salon-ranking.entry.js +9 -8
- package/dist/esm/salon-reviews.entry.js +189 -0
- package/dist/esm/salon-services.entry.js +77 -0
- package/dist/esm/salon-stylists.entry.js +114 -0
- package/dist/esm/services-40a3e622.js +21485 -0
- package/dist/esm/style-detail.entry.js +308 -0
- package/dist/esm/user-avatar.entry.js +41 -0
- package/dist/favesalon-embed/assets/map--placeholder.jpeg +0 -0
- package/{favesalon-embed → dist/favesalon-embed}/favesalon-embed.css +1 -1
- package/dist/favesalon-embed/favesalon-embed.esm.js +1 -0
- package/dist/favesalon-embed/p-019c5ccd.entry.js +1 -0
- package/dist/favesalon-embed/p-083a8821.entry.js +1 -0
- package/dist/favesalon-embed/p-0d0ed9ea.entry.js +1 -0
- package/dist/favesalon-embed/p-119db8de.entry.js +1 -0
- package/dist/favesalon-embed/p-1432c51b.entry.js +1 -0
- package/dist/favesalon-embed/p-22093506.entry.js +1 -0
- package/dist/favesalon-embed/p-32b314e9.js +2 -0
- package/dist/favesalon-embed/p-4a5eca9a.js +6 -0
- package/dist/favesalon-embed/p-58d2e9be.js +1 -0
- package/dist/favesalon-embed/p-71404b6a.entry.js +1 -0
- package/dist/favesalon-embed/p-857c3a61.entry.js +1 -0
- package/dist/favesalon-embed/p-99ec77f7.entry.js +1 -0
- package/dist/favesalon-embed/p-a33331cc.js +1 -0
- package/dist/favesalon-embed/p-b0c3673a.entry.js +1 -0
- package/dist/favesalon-embed/p-b287b1ea.entry.js +1 -0
- package/dist/favesalon-embed/p-b3af7842.entry.js +1 -0
- package/dist/favesalon-embed/p-b630ae68.js +1580 -0
- package/dist/favesalon-embed/p-ce2c1c9a.entry.js +1 -0
- package/dist/favesalon-embed/p-d9b7ad58.entry.js +1 -0
- package/dist/favesalon-embed/p-fc9a5551.js +6 -0
- package/dist/types/components/chat-button/index.d.ts +24 -0
- package/dist/types/components/google-map/index.d.ts +5 -0
- package/{types → dist/types}/components/salon-gift-card/salon-gift-card-modal.d.ts +1 -0
- package/{types → dist/types}/components/salon-info/index.d.ts +0 -1
- package/{types → dist/types}/components/salon-latest-reviews/index.d.ts +2 -0
- package/dist/types/components/salon-latest-styles/index.d.ts +12 -0
- package/{types → dist/types}/components/salon-locations/index.d.ts +2 -0
- package/{types → dist/types}/components/salon-lookbook/index.d.ts +3 -3
- package/dist/types/components/salon-reviews/index.d.ts +24 -0
- package/{types → dist/types}/components/salon-schedules/index.d.ts +2 -0
- package/{types → dist/types}/components/salon-services/index.d.ts +1 -0
- package/{types → dist/types}/components/salon-stylists/index.d.ts +6 -0
- package/dist/types/components/style-detail/index.d.ts +24 -0
- package/{types → dist/types}/components.d.ts +76 -59
- package/dist/types/constants/colors.d.ts +65 -0
- package/dist/types/mocks/users.d.ts +10 -0
- package/dist/types/services/services.d.ts +75 -0
- package/{types → dist/types}/stencil-public-runtime.d.ts +85 -11
- package/dist/types/types/chat.d.ts +17 -0
- package/dist/types/types/common.d.ts +11 -0
- package/{types → dist/types}/types/review.d.ts +4 -0
- package/{types → dist/types}/types/salon.d.ts +3 -1
- package/dist/types/types/style.d.ts +88 -0
- package/{types → dist/types}/types/stylist.d.ts +1 -1
- package/{types → dist/types}/types/user.d.ts +2 -2
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +21 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +11 -0
- package/package.json +19 -14
- package/readme.md +24 -7
- package/cjs/colors-7f354880.js +0 -95
- package/cjs/favesalon-embed.cjs.js +0 -20
- package/cjs/google-map.cjs.entry.js +0 -47
- package/cjs/index-95daad08.js +0 -1928
- package/cjs/loader.cjs.js +0 -22
- package/cjs/salon-contact_4.cjs.entry.js +0 -155
- package/cjs/salon-gift-card-modal.cjs.entry.js +0 -25
- package/cjs/salon-info.cjs.entry.js +0 -35
- package/cjs/salon-latest-reviews.cjs.entry.js +0 -58
- package/cjs/salon-lookbook-modal.cjs.entry.js +0 -141
- package/cjs/salon-reviews.cjs.entry.js +0 -205
- package/cjs/salon-services.cjs.entry.js +0 -47
- package/cjs/salon-stylists.cjs.entry.js +0 -54
- package/cjs/services-f1102d4a.js +0 -5762
- package/collection/components/google-map/index.js +0 -97
- package/collection/components/salon-booking/index.js +0 -121
- package/collection/components/salon-booking/salon-booking-modal.js +0 -88
- package/collection/components/salon-contact/index.js +0 -88
- package/collection/components/salon-gift-card/index.css +0 -25
- package/collection/components/salon-gift-card/index.js +0 -120
- package/collection/components/salon-gift-card/salon-gift-card-modal.js +0 -48
- package/collection/components/salon-info/index.css +0 -3
- package/collection/components/salon-info/index.js +0 -97
- package/collection/components/salon-latest-reviews/index.js +0 -108
- package/collection/components/salon-locations/index.js +0 -80
- package/collection/components/salon-lookbook/index.js +0 -376
- package/collection/components/salon-lookbook/lookbook-modal.css +0 -72
- package/collection/components/salon-lookbook/salon-lookbook-modal.js +0 -248
- package/collection/components/salon-ranking/index.js +0 -114
- package/collection/components/salon-reviews/index.js +0 -317
- package/collection/components/salon-schedules/index.css +0 -14
- package/collection/components/salon-schedules/index.js +0 -103
- package/collection/components/salon-services/index.js +0 -113
- package/collection/components/salon-styles/index.css +0 -23
- package/collection/components/salon-styles/index.js +0 -100
- package/collection/components/salon-stylists/index.js +0 -96
- package/collection/components/user-avatar/index.css +0 -0
- package/collection/components/user-avatar/index.js +0 -127
- package/collection/constants/colors.js +0 -91
- package/collection/services/services.js +0 -225
- package/collection/types/common.js +0 -2
- package/collection/types/salon.js +0 -52
- package/collection/types/style.js +0 -103
- package/collection/types/user.js +0 -10
- package/custom-elements/index.js +0 -12125
- package/esm/colors-1ec90c5f.js +0 -93
- package/esm/favesalon-embed.js +0 -18
- package/esm/google-map.entry.js +0 -43
- package/esm/index-09d43e3e.js +0 -1926
- package/esm/loader.js +0 -18
- package/esm/polyfills/css-shim.js +0 -1
- package/esm/salon-contact_4.entry.js +0 -148
- package/esm/salon-gift-card-modal.entry.js +0 -21
- package/esm/salon-info.entry.js +0 -31
- package/esm/salon-latest-reviews.entry.js +0 -54
- package/esm/salon-lookbook-modal.entry.js +0 -137
- package/esm/salon-reviews.entry.js +0 -201
- package/esm/salon-services.entry.js +0 -43
- package/esm/salon-stylists.entry.js +0 -50
- package/esm/services-74d84ca9.js +0 -5756
- package/favesalon-embed/favesalon-embed.esm.js +0 -1
- package/favesalon-embed/p-0188d4dc.entry.js +0 -1
- package/favesalon-embed/p-0318501e.js +0 -1
- package/favesalon-embed/p-078f242d.entry.js +0 -1
- package/favesalon-embed/p-13e23c61.entry.js +0 -1
- package/favesalon-embed/p-17df13ad.js +0 -1
- package/favesalon-embed/p-1a3179c8.entry.js +0 -1
- package/favesalon-embed/p-20aa75de.js +0 -6
- package/favesalon-embed/p-2901a6d6.entry.js +0 -1
- package/favesalon-embed/p-2b861430.entry.js +0 -1
- package/favesalon-embed/p-44d810a0.js +0 -1
- package/favesalon-embed/p-4a5eca9a.js +0 -6
- package/favesalon-embed/p-4c68700f.entry.js +0 -1
- package/favesalon-embed/p-4e2d7b29.js +0 -1
- package/favesalon-embed/p-6b845bf1.entry.js +0 -1
- package/favesalon-embed/p-7350f6b5.entry.js +0 -1
- package/favesalon-embed/p-897c2b1c.entry.js +0 -1
- package/favesalon-embed/p-8e60f56f.entry.js +0 -1
- package/favesalon-embed/p-a49afdc1.entry.js +0 -1
- package/favesalon-embed/p-c93867c4.entry.js +0 -1
- package/favesalon-embed/p-ea6a097f.entry.js +0 -1
- package/types/components/google-map/index.d.ts +0 -10
- package/types/components/salon-contact/index.d.ts +0 -9
- package/types/components/salon-lookbook/salon-lookbook-modal.d.ts +0 -13
- package/types/components/salon-reviews/index.d.ts +0 -24
- package/types/components/salon-styles/index.d.ts +0 -9
- package/types/constants/colors.d.ts +0 -88
- package/types/services/services.d.ts +0 -26
- package/types/types/common.d.ts +0 -2
- package/types/types/style.d.ts +0 -59
- /package/{cjs → dist/cjs}/_commonjsHelpers-5cfcba41.js +0 -0
- /package/{cjs → dist/cjs}/global-9073d10e.js +0 -0
- /package/{cjs → dist/cjs}/index.cjs.js +0 -0
- /package/{cjs → dist/cjs}/utils-c5a33b3c.js +0 -0
- /package/{esm/index.js → dist/collection/components/salon-info/index.css} +0 -0
- /package/{collection → dist/collection}/components/salon-latest-reviews/index.css +0 -0
- /package/{collection → dist/collection}/components/salon-ranking/index.css +0 -0
- /package/{collection → dist/collection}/components/salon-stylists/index.css +0 -0
- /package/{collection/components/salon-locations → dist/collection/components/user-avatar}/index.css +0 -0
- /package/{collection → dist/collection}/global/global.js +0 -0
- /package/{collection → dist/collection}/index.js +0 -0
- /package/{collection → dist/collection}/types/service.js +0 -0
- /package/{collection → dist/collection}/utils/utils.js +0 -0
- /package/{esm → dist/esm}/_commonjsHelpers-098d5b27.js +0 -0
- /package/{esm → dist/esm}/global-e1089ffd.js +0 -0
- /package/{esm → dist/esm}/polyfills/core-js.js +0 -0
- /package/{esm → dist/esm}/polyfills/dom.js +0 -0
- /package/{esm → dist/esm}/polyfills/es5-html-element.js +0 -0
- /package/{esm → dist/esm}/polyfills/index.js +0 -0
- /package/{esm → dist/esm}/polyfills/system.js +0 -0
- /package/{esm → dist/esm}/utils-e97485e0.js +0 -0
- /package/{favesalon-embed → dist/favesalon-embed}/index.esm.js +0 -0
- /package/{favesalon-embed → dist/favesalon-embed}/p-47e646f8.js +0 -0
- /package/{favesalon-embed → dist/favesalon-embed}/p-d6083940.js +0 -0
- /package/{index.cjs.js → dist/index.cjs.js} +0 -0
- /package/{index.js → dist/index.js} +0 -0
- /package/{collection/components/salon-services/index.css → dist/types/components/chat-conversation/index.d.ts} +0 -0
- /package/{types → dist/types}/components/salon-booking/index.d.ts +0 -0
- /package/{types → dist/types}/components/salon-booking/salon-booking-modal.d.ts +0 -0
- /package/{types → dist/types}/components/salon-gift-card/index.d.ts +0 -0
- /package/{types → dist/types}/components/salon-ranking/index.d.ts +0 -0
- /package/{types → dist/types}/components/user-avatar/index.d.ts +0 -0
- /package/{types → dist/types}/index.d.ts +0 -0
- /package/{types → dist/types}/types/service.d.ts +0 -0
- /package/{types → dist/types}/utils/utils.d.ts +0 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-3fae868e.js';
|
|
2
|
+
import { d as dayjs_min, H as HttpService } from './services-40a3e622.js';
|
|
3
|
+
import { r as relativeTime } from './relativeTime-cd452e6d.js';
|
|
4
|
+
import './_commonjsHelpers-098d5b27.js';
|
|
5
|
+
import './colors-ea36347a.js';
|
|
6
|
+
|
|
7
|
+
const indexCss = "chat-button{display:inline-block;position:relative}.chat-button--indicator{cursor:pointer;position:absolute;inset:0}.chat-button--counter{background-color:rgb(240, 90, 97);border:1px solid rgb(255, 255, 255);position:absolute;right:-6px;bottom:12px;height:8px;width:8px;-moz-border-radius:8px;-webkit-border-radius:8px;border-radius:8px}.chat-box{background-color:#fff;display:flex;flex-direction:column;position:fixed;inset:0px;z-index:20000}.chat-box--header{display:flex;justify-content:space-between;padding:16px;position:relative}.chat-box--header-title{color:#fff;font-size:20px;font-weight:600;line-height:1;display:flex;align-items:center;justify-content:space-between;margin:0}.chat-message{overflow:hidden;clear:both;min-width:240px}.chat-message--meta{display:flex}.chat-message--message{background-color:#F1F1F1;padding:8px 12px;position:relative;float:left;margin-top:6px;-moz-border-radius:0 10px 10px 10px;-webkit-border-radius:0 10px 10px 10px;border-radius:0 10px 10px 10px}.chat-conversation--time{clear:both;color:#999;font-size:75%;padding-top:2px}.chat-message.is-owner .chat-message--content{margin-left:12px}.chat-message.is-guest .chat-message--meta{flex-direction:row-reverse}.chat-message.is-guest .chat-message--message{background-color:#EFF7FF;float:right;margin-right:12px;text-align:right;-moz-border-radius:10px 0 10px 10px;-webkit-border-radius:10px 0 10px 10px;border-radius:10px 0 10px 10px}@media (min-width: 768px){.chat-box{border:1px solid #fff;left:unset;top:unset;right:1px;bottom:0px;height:420px;max-height:90vh;width:600px;-moz-border-radius:8px 8px 0px 0px;-webkit-border-radius:8px 8px 0px 0px;border-radius:8px 8px 0px 0px;-moz-box-shadow:rgba(0, 0, 0, 0.1) 0px 0px 24px;-webkit-box-shadow:rgba(0, 0, 0, 0.1) 0px 0px 24px;box-shadow:rgba(0, 0, 0, 0.1) 0px 0px 24px}.chat-box--header{-moz-border-radius:8px 8px 0px 0px;-webkit-border-radius:8px 8px 0px 0px;border-radius:8px 8px 0px 0px}}";
|
|
8
|
+
|
|
9
|
+
dayjs_min.extend(relativeTime);
|
|
10
|
+
const ChatButton = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
registerInstance(this, hostRef);
|
|
13
|
+
this.onSubmitMessage = async () => {
|
|
14
|
+
try {
|
|
15
|
+
const elNewMessage = document.getElementById('chat-form--input');
|
|
16
|
+
await HttpService().sendChatMessage({
|
|
17
|
+
message: elNewMessage.value,
|
|
18
|
+
senderId: this.senderInfo.id,
|
|
19
|
+
chatRoomId: this.chatRoom.uid,
|
|
20
|
+
});
|
|
21
|
+
elNewMessage.value = '';
|
|
22
|
+
}
|
|
23
|
+
catch (error) { }
|
|
24
|
+
};
|
|
25
|
+
this.markMessagesAsRead = async () => {
|
|
26
|
+
try {
|
|
27
|
+
const unreadMessages = (this.chatMessages || []).filter(message => {
|
|
28
|
+
return Boolean(message.unRead) && message.senderId !== this.senderInfo.id;
|
|
29
|
+
});
|
|
30
|
+
if (unreadMessages.length > 0) {
|
|
31
|
+
await HttpService().markMessagesAsRead(this.chatRoom.uid, unreadMessages);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
catch (e) { }
|
|
35
|
+
};
|
|
36
|
+
this.scrollToLastMessage = () => {
|
|
37
|
+
const targetElement = document.getElementById('chat--last-message');
|
|
38
|
+
targetElement && targetElement.scrollIntoView();
|
|
39
|
+
};
|
|
40
|
+
this.renderMessage = (chatMessage) => {
|
|
41
|
+
const { message, senderId, timestamp } = chatMessage;
|
|
42
|
+
const isOwner = this.senderInfo.id === senderId;
|
|
43
|
+
return (h("div", { class: `chat-message ${isOwner ? 'is-owner' : 'is-guest'}` }, h("div", { class: "chat-message--meta" }, h("user-avatar", { size: 40, shortName: String(((isOwner ? this.senderInfo : this.receiverInfo) || {}).fullName || '').charAt(0), avatar: ((isOwner ? this.senderInfo : this.receiverInfo) || {}).avatar }), h("div", { class: "chat-message--content" }, h("div", { class: "chat-message--message" }, message), timestamp && (h("div", { class: "chat-conversation--time" }, dayjs_min(timestamp).format('HH:mm')))))));
|
|
44
|
+
};
|
|
45
|
+
this.renderMessages = () => {
|
|
46
|
+
const isEmpty = (this.chatMessages || []).length === 0;
|
|
47
|
+
return (h("div", { class: "chat-messages" }, !isEmpty && this.chatMessages.map(this.renderMessage), isEmpty && (h("div", { style: { paddingTop: '48px', textAlign: 'center' } }, h("i", { class: "ri-bubble-chart-line", style: { fontSize: '48px' } }), h("div", { style: { color: 'rgba(0, 0, 0, 0.45)', marginTop: '8px' } }, "Enter a message on below to get starting"))), h("div", { id: "chat--last-message" })));
|
|
48
|
+
};
|
|
49
|
+
this.primaryColor = undefined;
|
|
50
|
+
this.accessToken = undefined;
|
|
51
|
+
this.senderId = undefined;
|
|
52
|
+
this.receiverId = undefined;
|
|
53
|
+
this.senderInfo = {};
|
|
54
|
+
this.receiverInfo = {};
|
|
55
|
+
this.chatRoom = undefined;
|
|
56
|
+
this.chatMessages = undefined;
|
|
57
|
+
this.isChatExpanded = undefined;
|
|
58
|
+
}
|
|
59
|
+
componentWillLoad() {
|
|
60
|
+
this.fetchData();
|
|
61
|
+
}
|
|
62
|
+
componentDidLoad() {
|
|
63
|
+
this.scrollToLastMessage();
|
|
64
|
+
this.markMessagesAsRead();
|
|
65
|
+
}
|
|
66
|
+
componentWillUpdate() {
|
|
67
|
+
this.scrollToLastMessage();
|
|
68
|
+
}
|
|
69
|
+
async fetchData() {
|
|
70
|
+
try {
|
|
71
|
+
this.chatRoom = await HttpService().createChatRoom(this.receiverId, this.accessToken);
|
|
72
|
+
if (this.chatRoom) {
|
|
73
|
+
HttpService().fetchChatMessages(this.chatRoom.uid, (messages) => this.chatMessages = messages);
|
|
74
|
+
this.senderInfo = this.chatRoom.members.find(user => user.id === Number(this.senderId));
|
|
75
|
+
this.receiverInfo = this.chatRoom.members.find(user => user.id === Number(this.receiverId));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
catch (e) { }
|
|
79
|
+
}
|
|
80
|
+
renderForm() {
|
|
81
|
+
return (h("div", { style: { display: 'flex', height: '100%' } }, h("input", { id: "chat-form--input", type: "text", class: "form-control", placeholder: "Enter a message...", style: { border: 'none' }, onKeyPress: (evt) => {
|
|
82
|
+
if (evt.key === 'Enter') {
|
|
83
|
+
evt.preventDefault();
|
|
84
|
+
this.onSubmitMessage();
|
|
85
|
+
}
|
|
86
|
+
} }), h("button", { type: "button", class: "btn btn-link", style: {
|
|
87
|
+
textDecoration: 'none',
|
|
88
|
+
display: 'flex',
|
|
89
|
+
height: '100%',
|
|
90
|
+
alignItems: 'center',
|
|
91
|
+
}, onClick: () => this.onSubmitMessage() }, h("i", { class: "ri-send-plane-2-line", style: { color: '#111', fontSize: '24px', lineHeight: '1' } }))));
|
|
92
|
+
}
|
|
93
|
+
render() {
|
|
94
|
+
const unreadMessages = (this.chatMessages || []).filter(message => {
|
|
95
|
+
return Boolean(message.unRead) && message.senderId !== this.senderInfo.id;
|
|
96
|
+
});
|
|
97
|
+
return (h("div", null, h("div", { class: "chat-button--indicator", onClick: () => this.isChatExpanded = true }, unreadMessages.length > 0 && h("span", { class: "chat-button--counter" })), h("div", { class: "chat-box", style: this.isChatExpanded ? {} : { display: 'none' } }, h("div", { class: "chat-box--header", style: {
|
|
98
|
+
backgroundColor: this.primaryColor || '#f05a61',
|
|
99
|
+
} }, h("h3", { class: "chat-box--header-title" }, "Chat"), h("div", { class: "salon-modal--close", onClick: () => this.isChatExpanded = false, style: { position: 'static' } })), h("div", { style: {
|
|
100
|
+
flexShrink: '1',
|
|
101
|
+
flexGrow: '1',
|
|
102
|
+
overflowY: 'auto',
|
|
103
|
+
padding: '16px',
|
|
104
|
+
} }, this.renderMessages()), h("div", { style: {
|
|
105
|
+
height: '50px',
|
|
106
|
+
minHeight: '50px',
|
|
107
|
+
paddingTop: '1',
|
|
108
|
+
borderTop: '1px solid rgb(245, 245, 245)',
|
|
109
|
+
} }, this.renderForm()))));
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
ChatButton.style = indexCss;
|
|
113
|
+
|
|
114
|
+
export { ChatButton as chat_button };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
const Colors = {
|
|
2
|
+
TextColor: '#141414',
|
|
3
|
+
Black: '#000000',
|
|
4
|
+
White: '#ffffff',
|
|
5
|
+
Primary: '#F05A61',
|
|
6
|
+
Secondary: '#001529',
|
|
7
|
+
Black01: '#262626',
|
|
8
|
+
Black02: '#1f1f1f',
|
|
9
|
+
Black03: '#141414',
|
|
10
|
+
Gray01: '#F5F5F5',
|
|
11
|
+
Gray02: '#EFEFEF',
|
|
12
|
+
Gray03: '#DBDBDB',
|
|
13
|
+
Gray04: '#999999',
|
|
14
|
+
Gray05: '#666666',
|
|
15
|
+
Red01: '#FEEFEF',
|
|
16
|
+
Red02: '#F9BDC0',
|
|
17
|
+
Red03: '#F05A61',
|
|
18
|
+
Red04: '#C0484E',
|
|
19
|
+
Red05: '#90363A',
|
|
20
|
+
Orange01: '#FFF4F0',
|
|
21
|
+
Orange02: '#FFD1C3',
|
|
22
|
+
Orange03: '#FF8D69',
|
|
23
|
+
Orange04: '#CC7154',
|
|
24
|
+
Orange05: '#99553F',
|
|
25
|
+
Yellow01: '#FDFBF4',
|
|
26
|
+
Yellow02: '#F8EDD3',
|
|
27
|
+
Yellow03: '#EED291',
|
|
28
|
+
Yellow04: '#BEA874',
|
|
29
|
+
Yellow05: '#8F7E57',
|
|
30
|
+
Lilac01: '#F3F0F4',
|
|
31
|
+
Lilac02: '#CFC1D4',
|
|
32
|
+
Lilac03: '#886594',
|
|
33
|
+
Lilac04: '#6D5176',
|
|
34
|
+
Lilac05: '#523D59',
|
|
35
|
+
Blue01: '#EAECEE',
|
|
36
|
+
Blue02: '#AAB1BD',
|
|
37
|
+
Blue03: '#2B3C59',
|
|
38
|
+
Blue04: '#223047',
|
|
39
|
+
Blue05: '#1A2435',
|
|
40
|
+
Green01: '#ECF7ED',
|
|
41
|
+
Green02: '#B2E1B9',
|
|
42
|
+
Green03: '#3FB34F',
|
|
43
|
+
Green04: '#328F3F',
|
|
44
|
+
Green05: '#266B2F',
|
|
45
|
+
Success01: '#EEF9E8',
|
|
46
|
+
Success02: '#BAE7A3',
|
|
47
|
+
Success03: '#52C41A',
|
|
48
|
+
Success04: '#429D15',
|
|
49
|
+
Success05: '#317610',
|
|
50
|
+
Error01: '#FFEDED',
|
|
51
|
+
Error02: '#FFB8B9',
|
|
52
|
+
Error03: '#FF4D4F',
|
|
53
|
+
Error04: '#CC3E3F',
|
|
54
|
+
Error05: '#992E2F',
|
|
55
|
+
Warning01: '#FFF7E8',
|
|
56
|
+
Warning02: '#FDDEA1',
|
|
57
|
+
Warning03: '#FAAD14',
|
|
58
|
+
Warning04: '#C88A10',
|
|
59
|
+
Warning05: '#96680C',
|
|
60
|
+
Info01: '#E8F4FF',
|
|
61
|
+
Info02: '#A3D3FF',
|
|
62
|
+
Info03: '#1890FF',
|
|
63
|
+
Info04: '#1373CC',
|
|
64
|
+
Info05: '#0E5699',
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export { Colors as C };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-3fae868e.js';
|
|
2
|
+
export { s as setNonce } from './index-3fae868e.js';
|
|
3
|
+
import './global-e1089ffd.js';
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
Stencil Client Patch Browser v2.22.3 | MIT Licensed | https://stenciljs.com
|
|
7
|
+
*/
|
|
8
|
+
const patchBrowser = () => {
|
|
9
|
+
const importMeta = import.meta.url;
|
|
10
|
+
const opts = {};
|
|
11
|
+
if (importMeta !== '') {
|
|
12
|
+
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
13
|
+
}
|
|
14
|
+
return promiseResolve(opts);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
patchBrowser().then(options => {
|
|
18
|
+
return bootstrapLazy([["chat-button",[[0,"chat-button",{"primaryColor":[1,"primary-color"],"accessToken":[1,"access-token"],"senderId":[1,"sender-id"],"receiverId":[1,"receiver-id"],"senderInfo":[32],"receiverInfo":[32],"chatRoom":[32],"chatMessages":[32],"isChatExpanded":[32],"fetchData":[64]}]]],["salon-latest-reviews",[[0,"salon-latest-reviews",{"salonId":[2,"salon-id"],"primaryColor":[1,"primary-color"],"salonReviews":[32],"isLoading":[32],"fetchData":[64]}]]],["salon-lookbook",[[0,"salon-lookbook",{"salonId":[2,"salon-id"],"isLoading":[32],"isLoadingMore":[32],"hideLoadMore":[32],"currentPage":[32],"totalLookbooks":[32],"salonCategories":[32],"salonLookbooks":[32],"sortBy":[32],"filterBy":[32],"isLayoutSetup":[32],"fetchData":[64],"fetchLookbooks":[64],"onChangeFiltering":[64],"onChangeSorting":[64],"onLoadMore":[64],"fetchCategories":[64]}]]],["salon-reviews",[[0,"salon-reviews",{"salonId":[2,"salon-id"],"primaryColor":[1,"primary-color"],"salonInfo":[32],"stats":[32],"totalReviews":[32],"allReviews":[32],"isLoading":[32],"isSorting":[32],"isFiltering":[32],"isLoadingMore":[32],"canLoadMore":[32],"page":[32],"filterBy":[32],"sortBy":[32]}]]],["style-detail",[[0,"style-detail",{"salonId":[2,"salon-id"],"salonLookbook":[1,"salon-lookbook"],"lookbookInfo":[32],"isModalOpen":[32],"currentMediaIdx":[32],"currentMedia":[32],"albumMedias":[32],"similarStyles":[32],"totalComments":[32],"lookbookComments":[32],"isLayoutSetup":[32],"fetchData":[64]}]]],["salon-booking",[[0,"salon-booking",{"salonId":[2,"salon-id"],"buttonClass":[1,"button-class"],"buttonText":[1,"button-text"],"primaryColor":[1,"primary-color"]}]]],["salon-booking-modal",[[0,"salon-booking-modal",{"salonId":[2,"salon-id"],"primaryColor":[1,"primary-color"],"redirectUrl":[1,"redirect-url"],"isModalOpen":[32]}]]],["salon-gift-card",[[0,"salon-gift-card",{"salonId":[2,"salon-id"],"buttonClass":[1,"button-class"],"buttonText":[1,"button-text"],"primaryColor":[1,"primary-color"]}]]],["salon-gift-card-modal",[[0,"salon-gift-card-modal",{"salonId":[2,"salon-id"],"primaryColor":[1,"primary-color"],"isModalOpen":[32]}]]],["salon-ranking",[[0,"salon-ranking",{"ranking":[2],"height":[2],"width":[2]}]]],["salon-services",[[0,"salon-services",{"salonId":[2,"salon-id"],"buttonClass":[1,"button-class"],"salonServices":[32],"isLoading":[32],"fetchData":[64]}]]],["salon-stylists",[[0,"salon-stylists",{"salonId":[2,"salon-id"],"salonStylists":[32],"totalStylists":[32],"page":[32],"isLoading":[32],"isLoadingMore":[32],"canLoadMore":[32],"fetchData":[64],"onLoadMore":[64]}]]],["google-map_5",[[0,"salon-info",{"salonId":[2,"salon-id"],"salonInfo":[32],"fetchData":[64]}],[0,"salon-locations",{"salonId":[2,"salon-id"],"salonInfo":[1,"salon-info"],"isLoading":[4,"is-loading"],"withBorder":[4,"with-border"],"salonInfoState":[32]}],[0,"salon-latest-styles",{"salonId":[2,"salon-id"],"isLoading":[4,"is-loading"],"withBorder":[4,"with-border"],"isLoadingState":[32],"latestStyles":[32],"fetchData":[64]}],[0,"salon-schedules",{"salonId":[2,"salon-id"],"salonInfo":[1,"salon-info"],"isLoading":[4,"is-loading"],"withBorder":[4,"with-border"],"salonInfoState":[32]}],[0,"google-map",{"locationName":[1,"location-name"],"locationAddress":[1,"location-address"]}]]],["user-avatar",[[0,"user-avatar",{"size":[2],"name":[1],"nameStyle":[16],"shortName":[1,"short-name"],"avatar":[1]}]]]], options);
|
|
19
|
+
});
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import { r as registerInstance, g as getAssetPath, h } from './index-3fae868e.js';
|
|
2
|
+
import { C as Colors } from './colors-ea36347a.js';
|
|
3
|
+
import { H as HttpService, i as isVideoMedia, B as BusinessHourStatus } from './services-40a3e622.js';
|
|
4
|
+
import { f as formatWebsiteUrl, a as formatFullAddress } from './utils-e97485e0.js';
|
|
5
|
+
import './_commonjsHelpers-098d5b27.js';
|
|
6
|
+
|
|
7
|
+
const indexCss$4 = "google-map{display:block;width:100%;height:100%}";
|
|
8
|
+
|
|
9
|
+
const GoogleMap = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
registerInstance(this, hostRef);
|
|
12
|
+
this.locationName = undefined;
|
|
13
|
+
this.locationAddress = undefined;
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
const mapPlaceholder = getAssetPath('./assets/map--placeholder.jpeg');
|
|
17
|
+
return (h("div", { style: {
|
|
18
|
+
backgroundImage: `url("${mapPlaceholder}")`,
|
|
19
|
+
backgroundColor: Colors.Gray01,
|
|
20
|
+
backgroundPosition: 'center center',
|
|
21
|
+
backgroundRepeat: 'no-repeat',
|
|
22
|
+
backgroundSize: 'cover',
|
|
23
|
+
borderRadius: '8px',
|
|
24
|
+
position: 'relative',
|
|
25
|
+
height: '296px',
|
|
26
|
+
} }, h("div", { style: {
|
|
27
|
+
position: 'absolute',
|
|
28
|
+
left: '50%',
|
|
29
|
+
top: '50%',
|
|
30
|
+
transform: 'translate(-50%, -50%)',
|
|
31
|
+
} }, h("a", { target: "_blank", rel: "noopener noreferrer", href: `https://www.google.com/maps/search/?api=1&query=${this.locationAddress}`, style: {
|
|
32
|
+
backgroundColor: Colors.Red01,
|
|
33
|
+
border: `1px solid ${Colors.Red02}`,
|
|
34
|
+
borderRadius: '4px',
|
|
35
|
+
color: Colors.TextColor,
|
|
36
|
+
padding: '12px',
|
|
37
|
+
display: 'flex',
|
|
38
|
+
flexWrap: 'wrap',
|
|
39
|
+
height: 'auto',
|
|
40
|
+
width: 'auto',
|
|
41
|
+
whiteSpace: 'normal',
|
|
42
|
+
textAlign: 'left',
|
|
43
|
+
maxWidth: '320px',
|
|
44
|
+
textDecoration: 'none',
|
|
45
|
+
} }, this.locationName && h("span", { style: { fontSize: '16px', marginBottom: '4px' } }, this.locationName), this.locationAddress && h("span", { style: { fontSize: '12px' } }, this.locationAddress)), h("div", { style: { marginTop: '8px', textAlign: 'center' } }, h("i", { class: "ri-map-pin-fill", style: { fontSize: '24px' } })))));
|
|
46
|
+
}
|
|
47
|
+
static get assetsDirs() { return ["assets"]; }
|
|
48
|
+
};
|
|
49
|
+
GoogleMap.style = indexCss$4;
|
|
50
|
+
|
|
51
|
+
const indexCss$3 = "";
|
|
52
|
+
|
|
53
|
+
const SalonInfo = class {
|
|
54
|
+
constructor(hostRef) {
|
|
55
|
+
registerInstance(this, hostRef);
|
|
56
|
+
this.salonId = undefined;
|
|
57
|
+
this.salonInfo = undefined;
|
|
58
|
+
}
|
|
59
|
+
componentWillLoad() {
|
|
60
|
+
this.fetchData();
|
|
61
|
+
}
|
|
62
|
+
async fetchData() {
|
|
63
|
+
try {
|
|
64
|
+
this.salonInfo = await HttpService().fetchSalonInfo(this.salonId);
|
|
65
|
+
}
|
|
66
|
+
catch (e) { }
|
|
67
|
+
}
|
|
68
|
+
render() {
|
|
69
|
+
return (h("div", { class: "salon-info" }, h("div", { class: "container" }, h("div", { class: "salon-info--schedules", style: { marginBottom: '24px' } }, h("salon-schedules", { "with-border": true, "is-loading": !this.salonInfo, "salon-id": 49989, "salon-info": JSON.stringify(this.salonInfo) })), h("div", { class: "row" }, h("div", { class: "col-md-5", style: { marginBottom: '24px' } }, h("salon-locations", { "with-border": true, "is-loading": !this.salonInfo, "salon-id": 49989, "salon-info": JSON.stringify(this.salonInfo) })), h("div", { class: "col-md-7", style: { marginBottom: '24px' } }, h("salon-latest-styles", { "with-border": true, "is-loading": !this.salonInfo, "salon-id": 49989, "salon-info": JSON.stringify(this.salonInfo) }))))));
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
SalonInfo.style = indexCss$3;
|
|
73
|
+
|
|
74
|
+
const indexCss$2 = "salon-latest-styles .view--salon-styles--item{width:120px;height:120px}@media (min-width: 1024px){salon-latest-styles .view--salon-styles--item{width:200px;height:200px}}";
|
|
75
|
+
|
|
76
|
+
const SalonLatestStyles = class {
|
|
77
|
+
constructor(hostRef) {
|
|
78
|
+
registerInstance(this, hostRef);
|
|
79
|
+
this.salonId = undefined;
|
|
80
|
+
this.isLoading = undefined;
|
|
81
|
+
this.withBorder = undefined;
|
|
82
|
+
this.isLoadingState = undefined;
|
|
83
|
+
this.latestStyles = undefined;
|
|
84
|
+
}
|
|
85
|
+
componentDidLoad() {
|
|
86
|
+
this.fetchData();
|
|
87
|
+
}
|
|
88
|
+
async fetchData() {
|
|
89
|
+
this.isLoadingState = true;
|
|
90
|
+
try {
|
|
91
|
+
const promises = [
|
|
92
|
+
HttpService().fetchSalonLatestStyles(this.salonId, { limit: 6 })
|
|
93
|
+
.then(salonStyles => this.latestStyles = salonStyles),
|
|
94
|
+
];
|
|
95
|
+
return Promise.all(promises)
|
|
96
|
+
.then(() => this.isLoadingState = false)
|
|
97
|
+
.catch(() => this.isLoadingState = false);
|
|
98
|
+
}
|
|
99
|
+
catch (e) { }
|
|
100
|
+
}
|
|
101
|
+
onClickLookbook(style) {
|
|
102
|
+
const elLookbookModal = document.createElement('div');
|
|
103
|
+
elLookbookModal.innerHTML = `
|
|
104
|
+
<style-detail
|
|
105
|
+
salon-id=${this.salonId}
|
|
106
|
+
salon-lookbook='${JSON.stringify(style)}'
|
|
107
|
+
></style-detail>
|
|
108
|
+
`;
|
|
109
|
+
document.body.appendChild(elLookbookModal);
|
|
110
|
+
}
|
|
111
|
+
render() {
|
|
112
|
+
if (this.isLoading || this.isLoadingState) {
|
|
113
|
+
return (h("div", { class: "view view--salon-styles" }, h("div", { class: "view-content", style: this.withBorder ? { border: `1px solid ${Colors.Gray02}`, borderRadius: '4px' } : { padding: '0px' } }, h("div", { style: {
|
|
114
|
+
backgroundColor: Colors.Gray02,
|
|
115
|
+
height: '20px',
|
|
116
|
+
width: '120px',
|
|
117
|
+
} }), h("div", { style: { marginTop: '24px' } }, h("div", { style: {
|
|
118
|
+
overflow: 'hidden',
|
|
119
|
+
marginLeft: '-16px',
|
|
120
|
+
marginBottom: '-16px',
|
|
121
|
+
} }, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map((fakeId, idx) => (h("div", { key: `style-listing--item-${fakeId}-${idx}`, style: {
|
|
122
|
+
float: 'left',
|
|
123
|
+
paddingLeft: '16px',
|
|
124
|
+
marginBottom: '16px',
|
|
125
|
+
} }, h("div", { style: {
|
|
126
|
+
backgroundColor: Colors.Gray01,
|
|
127
|
+
borderRadius: '8px',
|
|
128
|
+
width: '120px',
|
|
129
|
+
height: '120px',
|
|
130
|
+
overflow: 'hidden',
|
|
131
|
+
position: 'relative',
|
|
132
|
+
cursor: 'pointer',
|
|
133
|
+
} })))))))));
|
|
134
|
+
}
|
|
135
|
+
return (h("div", { class: "view view--salon-styles" }, h("div", { class: "view-content", style: this.withBorder ? { border: `1px solid ${Colors.Gray02}`, borderRadius: '4px' } : { padding: '0px' } }, h("div", { style: { fontSize: '18px', fontWeight: 'bold' } }, "Photos"), h("div", { style: {
|
|
136
|
+
overflow: 'hidden',
|
|
137
|
+
marginLeft: '-16px',
|
|
138
|
+
marginBottom: '-16px',
|
|
139
|
+
marginTop: '16px',
|
|
140
|
+
} }, (this.latestStyles || []).map((faveStyle, idx) => {
|
|
141
|
+
const { imageThumb, albumMedias } = faveStyle;
|
|
142
|
+
const firstMedia = albumMedias.length > 0 ? albumMedias[0] : null;
|
|
143
|
+
const isVideo = firstMedia ? isVideoMedia(firstMedia) : false;
|
|
144
|
+
return (h("div", { key: `style-listing--item-${faveStyle.id}-${idx}`, style: {
|
|
145
|
+
float: 'left',
|
|
146
|
+
paddingLeft: '16px',
|
|
147
|
+
marginBottom: '16px',
|
|
148
|
+
} }, h("div", { class: "view--salon-styles--item", style: Object.assign({ backgroundColor: Colors.Gray01, borderRadius: '8px', overflow: 'hidden', position: 'relative', cursor: 'pointer' }, !isVideo && firstMedia ? {
|
|
149
|
+
backgroundImage: `url("${firstMedia.imageThumb || firstMedia.imageThumbMedium}")`,
|
|
150
|
+
backgroundRepeat: 'no-repeat',
|
|
151
|
+
backgroundPosition: 'center center',
|
|
152
|
+
backgroundSize: 'cover',
|
|
153
|
+
} : {}), onClick: () => this.onClickLookbook(faveStyle) }, isVideo && firstMedia && (h("div", null, h("video", { muted: true, width: "100%", height: "100%", poster: imageThumb }, h("source", { src: firstMedia.mediaUrl, type: "video/mp4" })), h("i", { class: "ri-play-circle-fill", style: {
|
|
154
|
+
fontSize: '48px',
|
|
155
|
+
color: Colors.TextColor,
|
|
156
|
+
position: 'absolute',
|
|
157
|
+
left: '50%',
|
|
158
|
+
top: '50%',
|
|
159
|
+
transform: 'translate(-50%, -50%)',
|
|
160
|
+
} }))))));
|
|
161
|
+
})))));
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
SalonLatestStyles.style = indexCss$2;
|
|
165
|
+
|
|
166
|
+
const indexCss$1 = "@media (min-width: 768px){salon-locations .salon-contact--links{overflow:hidden;margin-left:-32px}salon-locations .salon-contact--links-item{float:left;display:flex;flex-direction:row;align-items:center;font-size:16px;min-width:300px;padding-left:32px}salon-locations .salon-contact--links-item:nth-child(2n+1){clear:left}salon-locations .salon-contact--links-item+.salon-contact--links-item{margin-top:8px}}";
|
|
167
|
+
|
|
168
|
+
const SalonLocations = class {
|
|
169
|
+
constructor(hostRef) {
|
|
170
|
+
registerInstance(this, hostRef);
|
|
171
|
+
this.salonId = undefined;
|
|
172
|
+
this.salonInfo = undefined;
|
|
173
|
+
this.isLoading = undefined;
|
|
174
|
+
this.withBorder = undefined;
|
|
175
|
+
this.salonInfoState = undefined;
|
|
176
|
+
}
|
|
177
|
+
componentWillLoad() {
|
|
178
|
+
if (this.salonInfo) {
|
|
179
|
+
this.salonInfoState = JSON.parse(this.salonInfo);
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
this.fetchData();
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
fetchData() {
|
|
186
|
+
try {
|
|
187
|
+
HttpService().fetchSalonInfo(this.salonId)
|
|
188
|
+
.then(salonInfo => this.salonInfoState = salonInfo);
|
|
189
|
+
}
|
|
190
|
+
catch (e) { }
|
|
191
|
+
}
|
|
192
|
+
render() {
|
|
193
|
+
if (this.isLoading) {
|
|
194
|
+
return (h("div", { class: "view view--salon-locations" }, h("div", { class: "view-content", style: this.withBorder ? { border: `1px solid ${Colors.Gray02}`, borderRadius: '4px' } : { padding: '0px' } }, h("div", { style: {
|
|
195
|
+
backgroundColor: Colors.Gray02,
|
|
196
|
+
height: '20px',
|
|
197
|
+
width: '120px',
|
|
198
|
+
} }), h("div", { style: { marginTop: '24px' } }, h("div", { style: {
|
|
199
|
+
backgroundColor: Colors.Gray01,
|
|
200
|
+
height: '16px',
|
|
201
|
+
width: '50%',
|
|
202
|
+
} }), h("div", { style: {
|
|
203
|
+
backgroundColor: Colors.Gray01,
|
|
204
|
+
height: '16px',
|
|
205
|
+
width: '50%',
|
|
206
|
+
marginTop: '8px',
|
|
207
|
+
} }), h("div", { style: {
|
|
208
|
+
backgroundColor: Colors.Gray01,
|
|
209
|
+
height: '192px',
|
|
210
|
+
width: '100%',
|
|
211
|
+
marginTop: '24px',
|
|
212
|
+
} })))));
|
|
213
|
+
}
|
|
214
|
+
const { businessPhone, businessName, website, email, } = this.salonInfoState || {};
|
|
215
|
+
const websiteUrl = formatWebsiteUrl(website);
|
|
216
|
+
const fullAddress = formatFullAddress(this.salonInfoState);
|
|
217
|
+
return (h("div", { class: "view view--salon-locations" }, h("div", { class: "view-content", style: this.withBorder ? { border: `1px solid ${Colors.Gray02}`, borderRadius: '4px' } : { padding: '0px' } }, h("div", { style: { fontSize: '18px', fontWeight: 'bold' } }, "Contact"), h("div", { class: "salon-contact--links", style: { marginTop: '16px' } }, businessPhone && (h("div", { class: "salon-contact--links-item" }, h("i", { class: "ri-phone-line", style: { color: Colors.Gray04, fontSize: '18px', marginRight: '6px' } }), " ", h("a", { href: `tel:${businessPhone}`, style: { color: Colors.TextColor, textDecoration: 'none' } }, businessPhone))), websiteUrl && (h("div", { class: "salon-contact--links-item" }, h("i", { class: "ri-links-line", style: { color: Colors.Gray04, fontSize: '18px', marginRight: '6px' } }), " ", h("a", { target: websiteUrl && websiteUrl.indexOf(window.location.hostname) === -1 ? '_blank' : undefined, href: websiteUrl, style: { color: Colors.TextColor, textDecoration: 'none' } }, websiteUrl))), email && (h("div", { class: "salon-contact--links-item" }, h("i", { class: "ri-mail-line", style: { color: Colors.Gray04, fontSize: '18px', marginRight: '6px' } }), " ", h("a", { href: `mailto:${email}`, style: { color: Colors.TextColor, textDecoration: 'none' } }, email)))), h("div", { class: "view--salon-info--map", style: { marginTop: '24px' } }, h("google-map", { "location-name": businessName, "location-address": fullAddress })))));
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
SalonLocations.style = indexCss$1;
|
|
221
|
+
|
|
222
|
+
const indexCss = "salon-schedules .salon-schedules--day{display:flex;flex-direction:row;min-width:240px}@media (min-width: 768px){salon-schedules .salon-schedules--dates{overflow:hidden;margin-left:-32px}salon-schedules .salon-schedules--day{float:left;padding-left:32px}}";
|
|
223
|
+
|
|
224
|
+
const SalonSchedules = class {
|
|
225
|
+
constructor(hostRef) {
|
|
226
|
+
registerInstance(this, hostRef);
|
|
227
|
+
this.salonId = undefined;
|
|
228
|
+
this.salonInfo = undefined;
|
|
229
|
+
this.isLoading = undefined;
|
|
230
|
+
this.withBorder = undefined;
|
|
231
|
+
this.salonInfoState = undefined;
|
|
232
|
+
}
|
|
233
|
+
componentWillLoad() {
|
|
234
|
+
if (this.salonInfo) {
|
|
235
|
+
this.salonInfoState = JSON.parse(this.salonInfo);
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
this.fetchData();
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
fetchData() {
|
|
242
|
+
try {
|
|
243
|
+
HttpService().fetchSalonInfo(this.salonId)
|
|
244
|
+
.then(salonInfo => this.salonInfoState = salonInfo);
|
|
245
|
+
}
|
|
246
|
+
catch (e) { }
|
|
247
|
+
}
|
|
248
|
+
renderBusinessHour(businessHour) {
|
|
249
|
+
if (businessHour.status === BusinessHourStatus.ByAppointment) {
|
|
250
|
+
return 'By Appointment';
|
|
251
|
+
}
|
|
252
|
+
if (businessHour.status === BusinessHourStatus.Close) {
|
|
253
|
+
return 'Close';
|
|
254
|
+
}
|
|
255
|
+
return `${businessHour.openTime} - ${businessHour.closeTime}`;
|
|
256
|
+
}
|
|
257
|
+
render() {
|
|
258
|
+
if (this.isLoading) {
|
|
259
|
+
return (h("div", { class: "view view--salon-contact" }, h("div", { class: "view-content", style: this.withBorder ? { border: `1px solid ${Colors.Gray02}`, borderRadius: '4px' } : { padding: '0px' } }, h("div", { style: {
|
|
260
|
+
backgroundColor: Colors.Gray02,
|
|
261
|
+
height: '20px',
|
|
262
|
+
width: '120px',
|
|
263
|
+
} }), h("div", { style: { marginTop: '24px' } }, h("div", { style: {
|
|
264
|
+
backgroundColor: Colors.Gray01,
|
|
265
|
+
height: '16px',
|
|
266
|
+
width: '30%',
|
|
267
|
+
} }), h("div", { style: {
|
|
268
|
+
backgroundColor: Colors.Gray01,
|
|
269
|
+
height: '16px',
|
|
270
|
+
width: '40%',
|
|
271
|
+
marginTop: '8px',
|
|
272
|
+
} }), h("div", { style: {
|
|
273
|
+
backgroundColor: Colors.Gray01,
|
|
274
|
+
height: '16px',
|
|
275
|
+
width: '75%',
|
|
276
|
+
marginTop: '12px',
|
|
277
|
+
} }), h("div", { style: {
|
|
278
|
+
backgroundColor: Colors.Gray01,
|
|
279
|
+
height: '16px',
|
|
280
|
+
width: '75%',
|
|
281
|
+
marginTop: '8px',
|
|
282
|
+
} })), h("div", { style: { marginTop: '24px' } }, h("div", { style: {
|
|
283
|
+
overflow: 'hidden',
|
|
284
|
+
marginLeft: '-16px',
|
|
285
|
+
marginBottom: '-16px',
|
|
286
|
+
} }, [1, 2, 3, 4, 5, 6, 7].map((fakeId, idx) => (h("div", { key: `style-listing--item-${fakeId}-${idx}`, style: {
|
|
287
|
+
float: 'left',
|
|
288
|
+
paddingLeft: '16px',
|
|
289
|
+
marginBottom: '16px',
|
|
290
|
+
} }, h("div", { style: {
|
|
291
|
+
backgroundColor: Colors.Gray01,
|
|
292
|
+
width: '120px',
|
|
293
|
+
height: '20px',
|
|
294
|
+
} })))))))));
|
|
295
|
+
}
|
|
296
|
+
const { about, businessHours, } = (this.salonInfoState || {});
|
|
297
|
+
return (h("div", { class: "view view--salon-contact" }, h("div", { class: "view-content", style: this.withBorder ? { border: `1px solid ${Colors.Gray02}`, borderRadius: '4px' } : { padding: '0px' } }, h("div", { style: { fontSize: '18px', fontWeight: 'bold' } }, "About"), about && (h("div", { class: "salon-contact--info--desc", style: { fontSize: '16px', marginTop: '16px' }, innerHTML: about })), businessHours && businessHours.length > 0 && (h("div", { class: "salon-schedules", style: { marginTop: '24px' } }, h("div", { class: "salon-schedules--title", style: { fontSize: '16px', fontWeight: 'bold' } }, "Working hours"), h("div", { class: "salon-schedules--dates" }, h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Mon"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[0]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Tue"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[1]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Wed"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[2]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Thur"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[3]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Fri"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[4]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Sat"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[5]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Sun"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[6])))))))));
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
SalonSchedules.style = indexCss;
|
|
301
|
+
|
|
302
|
+
export { GoogleMap as google_map, SalonInfo as salon_info, SalonLatestStyles as salon_latest_styles, SalonLocations as salon_locations, SalonSchedules as salon_schedules };
|