favesalon-embed 1.0.5 → 1.0.6
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/dist/custom-elements/index.d.ts +36 -0
- package/dist/favesalon-embed/activate-form.entry.js +70 -0
- package/dist/favesalon-embed/app-globals-f954a22f.js +7 -0
- package/dist/favesalon-embed/change-password-form.entry.js +81 -0
- package/dist/favesalon-embed/chat-box.entry.js +1 -1
- package/dist/favesalon-embed/chat-button.entry.js +34 -11
- package/dist/favesalon-embed/chat-form.entry.js +1 -1
- package/dist/favesalon-embed/chat-messages.entry.js +1 -1
- package/dist/favesalon-embed/chat-rooms.entry.js +1 -1
- package/dist/favesalon-embed/favesalon-embed.esm.js +1 -1
- package/dist/favesalon-embed/index-a229b3b5.js +3371 -0
- package/dist/favesalon-embed/login-form.entry.js +67 -0
- package/dist/favesalon-embed/register-form.entry.js +88 -0
- package/dist/favesalon-embed/reset-password-form.entry.js +47 -0
- package/dist/favesalon-embed/salon-booking.entry.js +1 -1
- package/dist/favesalon-embed/salon-gift-card.entry.js +1 -1
- package/dist/favesalon-embed/salon-info.entry.js +1 -1
- package/dist/favesalon-embed/salon-latest-reviews.entry.js +19 -3
- package/dist/favesalon-embed/salon-latest-styles.entry.js +14 -7
- package/dist/favesalon-embed/salon-locations.entry.js +1 -1
- package/dist/favesalon-embed/salon-lookbook.entry.js +16 -4
- package/dist/favesalon-embed/salon-reviews.entry.js +18 -4
- package/dist/favesalon-embed/salon-schedules.entry.js +1 -1
- package/dist/favesalon-embed/salon-services.entry.js +23 -11
- package/dist/favesalon-embed/salon-stylists.entry.js +1 -1
- package/dist/favesalon-embed/{services-260ea6eb.js → services-5a4c43a6.js} +23 -0
- package/dist/favesalon-embed/{services-65a8cf4a.js → services-d71be591.js} +51 -19
- package/dist/favesalon-embed/style-detail.entry.js +26 -8
- package/dist/favesalon-embed/user-avatar.entry.js +3 -1
- package/dist/favesalon-embed/user-form.entry.js +44 -0
- package/dist/types/components/activate-form/activate-form.d.ts +12 -0
- package/dist/types/components/activate-form/test/activate-form.e2e.d.ts +1 -0
- package/dist/types/components/activate-form/test/activate-form.spec.d.ts +1 -0
- package/dist/types/components/change-password-form/change-password-form.d.ts +12 -0
- package/dist/types/components/chat-button/index.d.ts +6 -2
- package/dist/types/components/login-form/login-form.d.ts +10 -0
- package/dist/types/components/register-form/register-form.d.ts +13 -0
- package/dist/types/components/reset-password-form/reset-password-form.d.ts +9 -0
- package/dist/types/components/user-form/user-form.d.ts +7 -0
- package/dist/types/components.d.ts +106 -2
- package/dist/types/services/services.d.ts +16 -0
- package/dist/types/types/user.d.ts +6 -0
- package/dist/types/utils/utils.spec.d.ts +1 -0
- package/package.json +1 -1
- package/dist/favesalon-embed/services-122dcf73.js +0 -23886
- package/dist/favesalon-embed/services-23eda072.js +0 -23877
- package/dist/favesalon-embed/services-243eef47.js +0 -23880
- package/dist/favesalon-embed/services-27607998.js +0 -23886
- package/dist/favesalon-embed/services-46b2f0aa.js +0 -23867
- package/dist/favesalon-embed/services-8f52210f.js +0 -23880
- package/dist/favesalon-embed/services-de32365e.js +0 -23880
- package/dist/favesalon-embed/services-e9cfcd2b.js +0 -23885
- package/dist/favesalon-embed/services-f7278483.js +0 -23880
- package/dist/favesalon-embed/services-f9872bea.js +0 -23880
- package/dist/favesalon-embed/utils-2c19db45.js +0 -25
- package/dist/favesalon-embed/utils-89c2cff2.js +0 -32
- package/dist/favesalon-embed/utils-e226fa04.js +0 -32
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-888e99e3.js';
|
|
2
|
+
import { C as Colors } from './colors-ea36347a.js';
|
|
3
|
+
import { H as HttpService } from './services-d71be591.js';
|
|
4
|
+
import './_commonjsHelpers-a4f66ccd.js';
|
|
5
|
+
|
|
6
|
+
const loginFormCss = ".form--user-login .form--login-label{cursor:pointer;display:block;margin-bottom:6px}.form--user-login input,.form--user-login button{border:1px solid #cecece;box-sizing:border-box;display:inline-block;width:100%;padding:4px 11px;min-height:40px;-moz-transition:all 0.3s;-webkit-transition:all 0.3s;transition:all 0.3s;-moz-border-radius:6px;-webkit-border-radius:6px;border-radius:6px}.form--user-login button{background-color:#001529;border:1px solid #001529;color:#fff;cursor:pointer}.form--user-login button:disabled{background-color:#cecece;border:1px solid #cecece;color:#212121}";
|
|
7
|
+
|
|
8
|
+
const LoginForm = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
registerInstance(this, hostRef);
|
|
11
|
+
this.onSuccess = undefined;
|
|
12
|
+
this.isSubmitting = undefined;
|
|
13
|
+
this.error = undefined;
|
|
14
|
+
this.username = undefined;
|
|
15
|
+
this.password = undefined;
|
|
16
|
+
}
|
|
17
|
+
async onSubmit(evt) {
|
|
18
|
+
evt.preventDefault();
|
|
19
|
+
this.error = null;
|
|
20
|
+
this.isSubmitting = true;
|
|
21
|
+
if (this.username && this.password) {
|
|
22
|
+
try {
|
|
23
|
+
const apiUrl = window.location.origin.indexOf('localhost') > -1 || window.location.origin.indexOf('favesalon.com')
|
|
24
|
+
? 'https://favesalon.com'
|
|
25
|
+
: window.location.origin;
|
|
26
|
+
const userInfo = await HttpService().login(apiUrl, {
|
|
27
|
+
email: this.username,
|
|
28
|
+
password: this.password,
|
|
29
|
+
});
|
|
30
|
+
this.onSuccess(userInfo);
|
|
31
|
+
}
|
|
32
|
+
catch (e) {
|
|
33
|
+
let errorMessage = e.message || `Something went wrong when logging your account`;
|
|
34
|
+
if (errorMessage.indexOf('404') > -1) {
|
|
35
|
+
errorMessage = 'You have entered an invalid username or password';
|
|
36
|
+
}
|
|
37
|
+
this.error = errorMessage;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
this.error = 'Please enter your username and password';
|
|
42
|
+
}
|
|
43
|
+
this.isSubmitting = false;
|
|
44
|
+
}
|
|
45
|
+
render() {
|
|
46
|
+
return (h("form", { class: "form--user-login", onSubmit: (evt) => this.onSubmit(evt) }, this.error && (h("div", { style: {
|
|
47
|
+
backgroundColor: Colors.Red01,
|
|
48
|
+
border: `1px solid ${Colors.Red02}`,
|
|
49
|
+
marginBottom: '24px',
|
|
50
|
+
padding: '12px',
|
|
51
|
+
} }, this.error)), h("div", { style: { marginBottom: '24px' } }, h("label", { ...{ for: "form--login-username" }, class: "form--login-label" }, "Phone or Email"), h("input", { id: "form--login-username", type: "text", onInput: (evt) => {
|
|
52
|
+
this.username = evt.target.value;
|
|
53
|
+
} })), h("div", { style: {
|
|
54
|
+
display: 'flex',
|
|
55
|
+
marginBottom: '24px',
|
|
56
|
+
width: '100%',
|
|
57
|
+
} }, h("div", { style: {
|
|
58
|
+
flexShrink: '1',
|
|
59
|
+
flexGrow: '1',
|
|
60
|
+
} }, h("label", { ...{ for: "form--login-password" }, class: "form--login-label" }, "Password"), h("input", { id: "form--login-password", type: "password", onInput: (evt) => {
|
|
61
|
+
this.password = evt.target.value;
|
|
62
|
+
} })), h("div", { style: { width: '100px', marginLeft: '12px' } }, h("label", { style: { display: 'inline-block', marginBottom: '6px' } }, "\u00A0"), h("button", { type: "submit", disabled: this.isSubmitting }, "SIGN IN")))));
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
LoginForm.style = loginFormCss;
|
|
66
|
+
|
|
67
|
+
export { LoginForm as login_form };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-888e99e3.js';
|
|
2
|
+
import { C as Colors } from './colors-ea36347a.js';
|
|
3
|
+
import { H as HttpService } from './services-d71be591.js';
|
|
4
|
+
import './_commonjsHelpers-a4f66ccd.js';
|
|
5
|
+
|
|
6
|
+
const registerFormCss = ".form--user-register .form--login-label{cursor:pointer;display:block;margin-bottom:6px}.form--user-register input,.form--user-register button{border:1px solid #cecece;box-sizing:border-box;display:inline-block;width:100%;padding:4px 11px;min-height:40px;-moz-transition:all 0.3s;-webkit-transition:all 0.3s;transition:all 0.3s;-moz-border-radius:6px;-webkit-border-radius:6px;border-radius:6px}.form--user-register button{background-color:#001529;border:1px solid #001529;color:#fff;cursor:pointer}.form--user-register button:disabled{background-color:#cecece;border:1px solid #cecece;color:#212121}";
|
|
7
|
+
|
|
8
|
+
const RegisterForm = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
registerInstance(this, hostRef);
|
|
11
|
+
this.onSuccess = undefined;
|
|
12
|
+
this.isSubmitting = undefined;
|
|
13
|
+
this.error = undefined;
|
|
14
|
+
this.firstName = undefined;
|
|
15
|
+
this.lastName = undefined;
|
|
16
|
+
this.email = undefined;
|
|
17
|
+
this.phone = undefined;
|
|
18
|
+
this.password = undefined;
|
|
19
|
+
}
|
|
20
|
+
async onSubmit(evt) {
|
|
21
|
+
evt.preventDefault();
|
|
22
|
+
this.error = null;
|
|
23
|
+
this.isSubmitting = true;
|
|
24
|
+
if (this.firstName && this.lastName && this.email && this.phone && this.password) {
|
|
25
|
+
try {
|
|
26
|
+
await HttpService().register({
|
|
27
|
+
email: this.email,
|
|
28
|
+
password: this.password,
|
|
29
|
+
mobile_phone: this.phone,
|
|
30
|
+
first_name: this.firstName,
|
|
31
|
+
last_name: this.lastName,
|
|
32
|
+
user_type: 1, // Consumer account
|
|
33
|
+
});
|
|
34
|
+
this.onSuccess({
|
|
35
|
+
email: this.email,
|
|
36
|
+
password: this.password,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
catch (e) {
|
|
40
|
+
let errorMessage = e.message || `Something went wrong when creating your account`;
|
|
41
|
+
if (errorMessage.indexOf('Email has been exists') > -1) {
|
|
42
|
+
errorMessage = 'There was an existing account with your inputted info';
|
|
43
|
+
}
|
|
44
|
+
this.error = errorMessage;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
this.error = 'Please enter your username and password';
|
|
49
|
+
}
|
|
50
|
+
this.isSubmitting = false;
|
|
51
|
+
}
|
|
52
|
+
render() {
|
|
53
|
+
return (h("form", { class: "form--user-register", onSubmit: (evt) => this.onSubmit(evt) }, this.error && (h("div", { style: {
|
|
54
|
+
backgroundColor: Colors.Red01,
|
|
55
|
+
border: `1px solid ${Colors.Red02}`,
|
|
56
|
+
marginBottom: '24px',
|
|
57
|
+
padding: '12px',
|
|
58
|
+
} }, this.error)), h("div", { style: {
|
|
59
|
+
display: 'flex',
|
|
60
|
+
marginBottom: '24px',
|
|
61
|
+
width: '100%',
|
|
62
|
+
} }, h("div", { style: { width: '48%', marginRight: '4%' } }, h("label", { ...{ for: "form--login-firstname" }, class: "form--login-label" }, "First name"), h("input", { id: "form--login-firstname", type: "text", onInput: (evt) => {
|
|
63
|
+
this.firstName = evt.target.value;
|
|
64
|
+
} })), h("div", { style: { width: '48%' } }, h("label", { ...{ for: "form--login-lastname" }, class: "form--login-label" }, "Last name"), h("input", { id: "form--login-lastname", type: "text", onInput: (evt) => {
|
|
65
|
+
this.lastName = evt.target.value;
|
|
66
|
+
} }))), h("div", { style: {
|
|
67
|
+
display: 'flex',
|
|
68
|
+
marginBottom: '24px',
|
|
69
|
+
width: '100%',
|
|
70
|
+
} }, h("div", { style: { width: '48%', marginRight: '4%' } }, h("label", { ...{ for: "form--login-email" }, class: "form--login-label" }, "Email"), h("input", { id: "form--login-email", type: "text", onInput: (evt) => {
|
|
71
|
+
this.email = evt.target.value;
|
|
72
|
+
} })), h("div", { style: { width: '48%' } }, h("label", { ...{ for: "form--login-phone" }, class: "form--login-label" }, "Phone"), h("input", { id: "form--login-phone", type: "text", onInput: (evt) => {
|
|
73
|
+
this.phone = evt.target.value;
|
|
74
|
+
} }))), h("div", { style: {
|
|
75
|
+
display: 'flex',
|
|
76
|
+
marginBottom: '24px',
|
|
77
|
+
width: '100%',
|
|
78
|
+
} }, h("div", { style: {
|
|
79
|
+
flexShrink: '1',
|
|
80
|
+
flexGrow: '1',
|
|
81
|
+
} }, h("label", { ...{ for: "form--login-password" }, class: "form--login-label" }, "Password"), h("input", { id: "form--login-password", type: "password", onInput: (evt) => {
|
|
82
|
+
this.password = evt.target.value;
|
|
83
|
+
} })), h("div", { style: { width: '100px', marginLeft: '12px' } }, h("label", { style: { display: 'inline-block', marginBottom: '6px' } }, "\u00A0"), h("button", { type: "submit", disabled: this.isSubmitting }, "SIGN UP"))), h("div", { style: { marginBottom: '24px' } }, "By submitting, you agree to our ", h("a", { target: "_blank", rel: "noopener noreferrer", href: "https://fave.salon/r/terms-for-client", style: { color: Colors.TextColor, cursor: 'pointer', display: 'inline', textDecoration: 'underline' } }, "Terms of Clients"), ", ", h("a", { target: "_blank", rel: "noopener noreferrer", href: "https://fave.salon/r/terms-for-business", style: { color: Colors.TextColor, cursor: 'pointer', display: 'inline', textDecoration: 'underline' } }, "Terms of Salons & Stylist"), " and ", h("a", { target: "_blank", rel: "noopener noreferrer", href: "https://fave.salon/r/privacy-policy", style: { color: Colors.TextColor, cursor: 'pointer', display: 'inline', textDecoration: 'underline' } }, "Private Policy"))));
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
RegisterForm.style = registerFormCss;
|
|
87
|
+
|
|
88
|
+
export { RegisterForm as register_form };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-888e99e3.js';
|
|
2
|
+
import { C as Colors } from './colors-ea36347a.js';
|
|
3
|
+
import { H as HttpService } from './services-d71be591.js';
|
|
4
|
+
import './_commonjsHelpers-a4f66ccd.js';
|
|
5
|
+
|
|
6
|
+
const resetPasswordFormCss = ".form--user-reset-password .form--login-label{cursor:pointer;display:block;margin-bottom:6px}.form--user-reset-password input,.form--user-reset-password button{border:1px solid #cecece;box-sizing:border-box;display:inline-block;width:100%;padding:4px 11px;min-height:40px;-moz-transition:all 0.3s;-webkit-transition:all 0.3s;transition:all 0.3s;-moz-border-radius:6px;-webkit-border-radius:6px;border-radius:6px}.form--user-reset-password button{background-color:#001529;border:1px solid #001529;color:#fff;cursor:pointer}.form--user-reset-password button:disabled{background-color:#cecece;border:1px solid #cecece;color:#212121}";
|
|
7
|
+
|
|
8
|
+
const ResetPasswordForm = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
registerInstance(this, hostRef);
|
|
11
|
+
this.onSuccess = undefined;
|
|
12
|
+
this.isSubmitting = undefined;
|
|
13
|
+
this.error = undefined;
|
|
14
|
+
this.username = undefined;
|
|
15
|
+
}
|
|
16
|
+
async onSubmit(evt) {
|
|
17
|
+
evt.preventDefault();
|
|
18
|
+
this.error = null;
|
|
19
|
+
this.isSubmitting = true;
|
|
20
|
+
if (this.username) {
|
|
21
|
+
try {
|
|
22
|
+
await HttpService().resetPassword(this.username);
|
|
23
|
+
this.onSuccess({ email: this.username });
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
this.error = e.message || `Something went wrong when setting your new password`;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
this.error = 'Please enter your phone or email to reset your password';
|
|
31
|
+
}
|
|
32
|
+
this.isSubmitting = false;
|
|
33
|
+
}
|
|
34
|
+
render() {
|
|
35
|
+
return (h("form", { class: "form--user-reset-password", onSubmit: (evt) => this.onSubmit(evt) }, this.error && (h("div", { style: {
|
|
36
|
+
backgroundColor: Colors.Red01,
|
|
37
|
+
border: `1px solid ${Colors.Red02}`,
|
|
38
|
+
marginBottom: '24px',
|
|
39
|
+
padding: '12px',
|
|
40
|
+
} }, this.error)), h("div", { style: { marginBottom: '24px' } }, h("label", { ...{ for: "form--login-username" }, class: "form--login-label" }, "Phone or Email"), h("input", { id: "form--login-username", type: "text", onInput: (evt) => {
|
|
41
|
+
this.username = evt.target.value;
|
|
42
|
+
} })), h("div", { style: { marginBottom: '24px' } }, h("button", { type: "submit", disabled: this.isSubmitting }, "RESET NOW"))));
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
ResetPasswordForm.style = resetPasswordFormCss;
|
|
46
|
+
|
|
47
|
+
export { ResetPasswordForm as reset_password_form };
|
|
@@ -39,7 +39,7 @@ const SalonBooking = class {
|
|
|
39
39
|
},
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
return (h("div", { class: "salon-booking" }, h("div", { class: "salon-booking--button" }, h("button",
|
|
42
|
+
return (h("div", { class: "salon-booking" }, h("div", { class: "salon-booking--button" }, h("button", { type: "button", class: buttonClass, onClick: () => this.openModal(), ...buttonStyle }, this.buttonText))));
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
SalonBooking.style = indexCss;
|
|
@@ -39,7 +39,7 @@ const SalonGiftCard = class {
|
|
|
39
39
|
},
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
return (h("div", { class: "salon-gift-card" }, h("div", { class: "salon-gift-card--button" }, h("button",
|
|
42
|
+
return (h("div", { class: "salon-gift-card" }, h("div", { class: "salon-gift-card--button" }, h("button", { type: "button", class: buttonClass, onClick: () => this.openModal(), ...buttonStyle }, this.buttonText))));
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
SalonGiftCard.style = indexCss;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h } from './index-888e99e3.js';
|
|
2
|
-
import { H as HttpService, d as dayjs_min, s as shortDateYearFormat } from './services-
|
|
2
|
+
import { H as HttpService, d as dayjs_min, s as shortDateYearFormat } from './services-d71be591.js';
|
|
3
3
|
import { C as Colors } from './colors-ea36347a.js';
|
|
4
4
|
import { g as getRatingText } from './utils-fd30fb29.js';
|
|
5
5
|
import './_commonjsHelpers-a4f66ccd.js';
|
|
@@ -29,7 +29,13 @@ const SalonLatestReviews = class {
|
|
|
29
29
|
render() {
|
|
30
30
|
if (this.isLoading) {
|
|
31
31
|
return (h("div", { class: "salon-latest-reviews", style: { overflow: 'hidden' } }, h("div", { style: { display: 'flex', whiteSpace: 'nowrap' } }, [1, 2, 3, 4, 5].map((fakeId, index) => {
|
|
32
|
-
return (h("div", { key: `salon-latest-review--${fakeId}`, class: "salon-review", style:
|
|
32
|
+
return (h("div", { key: `salon-latest-review--${fakeId}`, class: "salon-review", style: {
|
|
33
|
+
border: `1px solid ${Colors.Gray02}`,
|
|
34
|
+
background: Colors.White,
|
|
35
|
+
borderRadius: '8px',
|
|
36
|
+
overflow: 'hidden',
|
|
37
|
+
...index > 0 ? { marginLeft: '16px' } : {},
|
|
38
|
+
} }, h("div", { class: "card", style: { border: 'none' } }, h("div", { class: "card-body" }, h("div", { class: "salon-review--user", style: { marginBottom: '16px', overflow: 'hidden' } }, h("div", { style: {
|
|
33
39
|
backgroundColor: Colors.Gray02,
|
|
34
40
|
borderRadius: '50px',
|
|
35
41
|
height: '48px',
|
|
@@ -67,7 +73,17 @@ const SalonLatestReviews = class {
|
|
|
67
73
|
const ratingTexts = getRatingText();
|
|
68
74
|
return (h("div", { class: "salon-latest-reviews", style: { overflowX: 'auto' } }, h("div", { style: { display: 'flex', whiteSpace: 'nowrap' } }, (this.salonReviews || []).map((review, index) => {
|
|
69
75
|
const { user } = review;
|
|
70
|
-
return (h("div", { class: "salon-review", style:
|
|
76
|
+
return (h("div", { class: "salon-review", style: {
|
|
77
|
+
border: `1px solid ${Colors.Gray02}`,
|
|
78
|
+
background: Colors.White,
|
|
79
|
+
borderRadius: '8px',
|
|
80
|
+
overflow: 'hidden',
|
|
81
|
+
...index > 0 ? { marginLeft: '16px' } : {},
|
|
82
|
+
} }, h("div", { class: "card", style: { border: 'none' } }, h("div", { class: "card-body" }, h("div", { class: "salon-review--user", style: { marginBottom: '16px' } }, h("user-avatar", { size: 48, name: h("div", { style: { fontSize: '18px', fontWeight: '600' } }, user.fullName), shortName: `${(user.firstName || '').charAt(0)}${(user.lastName || '').charAt(0)}`, avatar: user.avatar, 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", { class: score <= review.point ? 'ri-heart-fill' : 'ri-heart-line', style: {
|
|
83
|
+
fontSize: '16px',
|
|
84
|
+
marginRight: '4px',
|
|
85
|
+
...score <= review.point ? { color: this.primaryColor } : { color: Colors.Gray04 },
|
|
86
|
+
} }))), 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: 'bold' } }, ratingTexts[review.point]), (review.title || review.description) && (h("div", { class: "salon-review--detail", style: { marginTop: '16px' } }, h("div", { class: "salon-review--description", style: {
|
|
71
87
|
fontSize: '16px',
|
|
72
88
|
lineHeight: '26px',
|
|
73
89
|
overflow: 'hidden',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h } from './index-888e99e3.js';
|
|
2
2
|
import { C as Colors } from './colors-ea36347a.js';
|
|
3
|
-
import { H as HttpService, i as isVideoMedia } from './services-
|
|
3
|
+
import { H as HttpService, i as isVideoMedia } from './services-d71be591.js';
|
|
4
4
|
import './_commonjsHelpers-a4f66ccd.js';
|
|
5
5
|
|
|
6
6
|
const indexCss = "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}}";
|
|
@@ -77,12 +77,19 @@ const SalonLatestStyles = class {
|
|
|
77
77
|
float: 'left',
|
|
78
78
|
paddingLeft: '16px',
|
|
79
79
|
marginBottom: '16px',
|
|
80
|
-
} }, h("div", { class: "view--salon-styles--item", style:
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
} }, h("div", { class: "view--salon-styles--item", style: {
|
|
81
|
+
backgroundColor: Colors.Gray01,
|
|
82
|
+
borderRadius: '8px',
|
|
83
|
+
overflow: 'hidden',
|
|
84
|
+
position: 'relative',
|
|
85
|
+
cursor: 'pointer',
|
|
86
|
+
...!isVideo && firstMedia ? {
|
|
87
|
+
backgroundImage: `url("${firstMedia.imageThumb || firstMedia.imageThumbMedium}")`,
|
|
88
|
+
backgroundRepeat: 'no-repeat',
|
|
89
|
+
backgroundPosition: 'center center',
|
|
90
|
+
backgroundSize: 'cover',
|
|
91
|
+
} : {},
|
|
92
|
+
}, 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: {
|
|
86
93
|
fontSize: '48px',
|
|
87
94
|
color: Colors.TextColor,
|
|
88
95
|
position: 'absolute',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, h } from './index-888e99e3.js';
|
|
2
2
|
import { a as formatWebsiteUrl, b as formatFullAddress } from './utils-fd30fb29.js';
|
|
3
3
|
import { C as Colors } from './colors-ea36347a.js';
|
|
4
|
-
import { H as HttpService } from './services-
|
|
4
|
+
import { H as HttpService } from './services-d71be591.js';
|
|
5
5
|
import './_commonjsHelpers-a4f66ccd.js';
|
|
6
6
|
|
|
7
7
|
const indexCss = "@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}}";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h } from './index-888e99e3.js';
|
|
2
2
|
import { C as Colors } from './colors-ea36347a.js';
|
|
3
|
-
import { H as HttpService } from './services-
|
|
3
|
+
import { H as HttpService } from './services-d71be591.js';
|
|
4
4
|
import './_commonjsHelpers-a4f66ccd.js';
|
|
5
5
|
|
|
6
6
|
const indexCss = "@media (max-width: 768px){salon-lookbook .view-header{display:block !important}salon-lookbook .salon-loobook--serch-result{margin-bottom:16px}salon-lookbook .salon-loobook--filter-wrapper>label,salon-lookbook .salon-loobook--sort-wrapper>label{display:none !important}}";
|
|
@@ -81,7 +81,11 @@ const SalonLookbook = class {
|
|
|
81
81
|
async fetchData() {
|
|
82
82
|
try {
|
|
83
83
|
const promises = [
|
|
84
|
-
this.fetchLookbooks(
|
|
84
|
+
this.fetchLookbooks({
|
|
85
|
+
page: 1,
|
|
86
|
+
sort: this.sortBy,
|
|
87
|
+
...this.filterBy !== 'all' ? { services: [this.filterBy] } : {},
|
|
88
|
+
}),
|
|
85
89
|
this.fetchCategories(),
|
|
86
90
|
];
|
|
87
91
|
return Promise.all(promises);
|
|
@@ -116,7 +120,11 @@ const SalonLookbook = class {
|
|
|
116
120
|
this.salonLookbooks = [];
|
|
117
121
|
this.hideLoadMore = true;
|
|
118
122
|
this.filterBy = filterBy;
|
|
119
|
-
await this.fetchLookbooks(
|
|
123
|
+
await this.fetchLookbooks({
|
|
124
|
+
page: this.currentPage,
|
|
125
|
+
sort: this.sortBy,
|
|
126
|
+
...this.filterBy !== 'all' ? { services: [Number(this.filterBy)] } : {},
|
|
127
|
+
});
|
|
120
128
|
if (window.masonry) {
|
|
121
129
|
this.isLayoutSetup = false;
|
|
122
130
|
}
|
|
@@ -130,7 +138,11 @@ const SalonLookbook = class {
|
|
|
130
138
|
this.salonLookbooks = [];
|
|
131
139
|
this.hideLoadMore = true;
|
|
132
140
|
this.sortBy = sortBy;
|
|
133
|
-
await this.fetchLookbooks(
|
|
141
|
+
await this.fetchLookbooks({
|
|
142
|
+
page: this.currentPage,
|
|
143
|
+
sort: this.sortBy,
|
|
144
|
+
...this.filterBy !== 'all' ? { services: [this.filterBy] } : {},
|
|
145
|
+
});
|
|
134
146
|
if (window.masonry) {
|
|
135
147
|
this.isLayoutSetup = false;
|
|
136
148
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h } from './index-888e99e3.js';
|
|
2
|
-
import { H as HttpService, d as dayjs_min, s as shortDateYearFormat } from './services-
|
|
2
|
+
import { H as HttpService, d as dayjs_min, s as shortDateYearFormat } from './services-d71be591.js';
|
|
3
3
|
import { C as Colors } from './colors-ea36347a.js';
|
|
4
4
|
import './_commonjsHelpers-a4f66ccd.js';
|
|
5
5
|
|
|
@@ -79,7 +79,12 @@ const SalonReviews = class {
|
|
|
79
79
|
onChangeFilter(filterBy) {
|
|
80
80
|
this.isFiltering = true;
|
|
81
81
|
try {
|
|
82
|
-
HttpService().fetchSalonReviews(this.salonId,
|
|
82
|
+
HttpService().fetchSalonReviews(this.salonId, {
|
|
83
|
+
page: 1,
|
|
84
|
+
sort: this.sortBy,
|
|
85
|
+
limit: pageLimited,
|
|
86
|
+
...filterBy.length > 0 ? { avg_point: filterBy } : {},
|
|
87
|
+
}).then(response => {
|
|
83
88
|
const { total, data: allReviews } = response;
|
|
84
89
|
this.page = 1;
|
|
85
90
|
this.totalReviews = total;
|
|
@@ -93,7 +98,12 @@ const SalonReviews = class {
|
|
|
93
98
|
onChangeSorting(sortBy) {
|
|
94
99
|
this.isSorting = true;
|
|
95
100
|
try {
|
|
96
|
-
HttpService().fetchSalonReviews(this.salonId,
|
|
101
|
+
HttpService().fetchSalonReviews(this.salonId, {
|
|
102
|
+
page: 1,
|
|
103
|
+
sort: sortBy,
|
|
104
|
+
limit: pageLimited,
|
|
105
|
+
...this.filterBy.length > 0 ? { avg_point: this.filterBy } : {},
|
|
106
|
+
}).then(response => {
|
|
97
107
|
const { total, data: allReviews } = response;
|
|
98
108
|
this.page = 1;
|
|
99
109
|
this.totalReviews = total;
|
|
@@ -107,7 +117,11 @@ const SalonReviews = class {
|
|
|
107
117
|
render() {
|
|
108
118
|
const ratingTexts = ['', 'Poor', 'Sufficient', 'Average', 'Well', 'Very good'];
|
|
109
119
|
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:
|
|
120
|
+
return (h("i", { class: score <= this.stats.reviewPoint ? 'ri-heart-fill' : 'ri-heart-line', style: {
|
|
121
|
+
fontSize: '32px',
|
|
122
|
+
marginRight: '4px',
|
|
123
|
+
...score <= this.stats.reviewPoint ? { color: this.primaryColor } : { color: Colors.Gray04 },
|
|
124
|
+
} }));
|
|
111
125
|
})), h("div", { class: "salon-review--rating--date", style: {
|
|
112
126
|
display: 'flex',
|
|
113
127
|
flexDirection: 'row',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h } from './index-888e99e3.js';
|
|
2
|
-
import { H as HttpService, B as BusinessHourStatus } from './services-
|
|
2
|
+
import { H as HttpService, B as BusinessHourStatus } from './services-d71be591.js';
|
|
3
3
|
import { C as Colors } from './colors-ea36347a.js';
|
|
4
4
|
import './_commonjsHelpers-a4f66ccd.js';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h } from './index-888e99e3.js';
|
|
2
|
-
import { H as HttpService, a as sortBy_1 } from './services-
|
|
2
|
+
import { H as HttpService, a as sortBy_1 } from './services-d71be591.js';
|
|
3
3
|
import { C as Colors } from './colors-ea36347a.js';
|
|
4
4
|
import './_commonjsHelpers-a4f66ccd.js';
|
|
5
5
|
|
|
@@ -39,11 +39,13 @@ const SalonServices = class {
|
|
|
39
39
|
backgroundColor: Colors.Gray03,
|
|
40
40
|
height: '20px',
|
|
41
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:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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: {
|
|
43
|
+
...fakeGroupIndex > 0 ? {
|
|
44
|
+
marginTop: '12px',
|
|
45
|
+
paddingTop: '12px',
|
|
46
|
+
borderTop: `1px solid ${Colors.Gray01}`,
|
|
47
|
+
} : {},
|
|
48
|
+
} }, h("div", { key: `service-group--${fakeId}--${index}`, style: {
|
|
47
49
|
backgroundColor: Colors.Gray01,
|
|
48
50
|
height: '16px',
|
|
49
51
|
width: '120px',
|
|
@@ -56,11 +58,21 @@ const SalonServices = class {
|
|
|
56
58
|
}
|
|
57
59
|
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
60
|
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:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
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: {
|
|
62
|
+
fontSize: '20px',
|
|
63
|
+
marginBottom: '12px',
|
|
64
|
+
paddingBottom: '12px',
|
|
65
|
+
borderBottom: `1px solid ${Colors.Gray02}`,
|
|
66
|
+
...subGroupIndex > 0 ? { marginTop: '32px' } : {},
|
|
67
|
+
} }, subGroup.name)), (subGroup.data || []).map((service, serviceIndex) => (h("div", { class: "salon-service" }, h("div", { class: "salon-service--name", style: {
|
|
68
|
+
fontSize: '16px',
|
|
69
|
+
fontWeight: '500',
|
|
70
|
+
...serviceIndex > 0 ? {
|
|
71
|
+
marginTop: '12px',
|
|
72
|
+
paddingTop: '12px',
|
|
73
|
+
borderTop: `1px solid ${Colors.Gray01}`,
|
|
74
|
+
} : {},
|
|
75
|
+
} }, service.name), (!service.hideDuration || !service.hidePrice) && (h("div", { style: {
|
|
64
76
|
display: 'block',
|
|
65
77
|
marginTop: '4px',
|
|
66
78
|
fontSize: '90%',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h } from './index-888e99e3.js';
|
|
2
2
|
import { C as Colors } from './colors-ea36347a.js';
|
|
3
|
-
import { H as HttpService } from './services-
|
|
3
|
+
import { H as HttpService } from './services-d71be591.js';
|
|
4
4
|
import './_commonjsHelpers-a4f66ccd.js';
|
|
5
5
|
|
|
6
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}}";
|
|
@@ -23387,6 +23387,8 @@ function createUser(blob) {
|
|
|
23387
23387
|
fullName: userNames.length > 0 ? userNames.join(' ') : (blob.fullName || blob.name || blob.username),
|
|
23388
23388
|
avatar: blob.avatar || blob.full_profile_image_thumb,
|
|
23389
23389
|
mobilePhone: blob.mobile_phone,
|
|
23390
|
+
accessToken: blob.access_token,
|
|
23391
|
+
email: blob.email,
|
|
23390
23392
|
};
|
|
23391
23393
|
}
|
|
23392
23394
|
function createUserFromChatRoom(blob) {
|
|
@@ -23611,6 +23613,27 @@ class HttpService {
|
|
|
23611
23613
|
}
|
|
23612
23614
|
catch (error) { }
|
|
23613
23615
|
}
|
|
23616
|
+
login(apiUrl, options) {
|
|
23617
|
+
const url = `${apiUrl}/${apiV2Prefix}/user/login`;
|
|
23618
|
+
return this.http.post(url, options)
|
|
23619
|
+
.then(response => {
|
|
23620
|
+
const status = get_1(response, 'data.status');
|
|
23621
|
+
const blob = get_1(response, 'data.data');
|
|
23622
|
+
if (status && blob.id) {
|
|
23623
|
+
const userEntity = createUser(blob);
|
|
23624
|
+
return Promise.resolve(userEntity);
|
|
23625
|
+
}
|
|
23626
|
+
return Promise.reject(response);
|
|
23627
|
+
});
|
|
23628
|
+
}
|
|
23629
|
+
resetPassword(email) {
|
|
23630
|
+
const url = `${apiV2Prefix}/user/forgot-password?${email.indexOf('@') > -1 ? 'email' : 'phone'}=${email}`;
|
|
23631
|
+
return this.http.get(url);
|
|
23632
|
+
}
|
|
23633
|
+
onChangePassword(options) {
|
|
23634
|
+
const url = `${apiV2Prefix}/user/change-password`;
|
|
23635
|
+
return this.http.post(url, options);
|
|
23636
|
+
}
|
|
23614
23637
|
fetchClients(salonId, keyword, accessToken) {
|
|
23615
23638
|
const url = `${apiV1Prefix}/salon/clients/list/${salonId}?page=1&limit=10&access_token=${accessToken}`;
|
|
23616
23639
|
const payload = {
|