WordPress Online Booking and Scheduling Plugin – Bookly - Version 17.3

Version Description

Download this release

Release Info

Developer Ladela
Plugin Icon 128x128 WordPress Online Booking and Scheduling Plugin – Bookly
Version 17.3
Comparing to
See all releases

Code changes from version 17.2 to 17.3

Files changed (44) hide show
  1. backend/Backend.php +5 -2
  2. backend/components/dashboard/appointments/Widget.php +9 -4
  3. backend/components/dialogs/appointment/edit/Ajax.php +1 -1
  4. backend/components/dialogs/appointment/edit/Dialog.php +4 -3
  5. backend/components/dialogs/appointment/edit/resources/js/ng-appointment.js +7 -1
  6. backend/components/dialogs/customer/delete/templates/dialog.php +1 -1
  7. backend/components/dialogs/customer/edit/Dialog.php +1 -1
  8. backend/components/dialogs/service/edit/resources/js/service-edit-dialog.js +1 -3
  9. backend/components/dialogs/sms/Ajax.php +4 -1
  10. backend/components/dialogs/sms/resources/js/notification-dialog.js +3 -9
  11. backend/modules/appearance/Page.php +1 -0
  12. backend/modules/appearance/resources/js/appearance.js +3 -0
  13. backend/modules/appointments/Ajax.php +7 -3
  14. backend/modules/appointments/Page.php +1 -1
  15. backend/modules/appointments/resources/js/appointments.js +13 -8
  16. backend/modules/calendar/Page.php +1 -1
  17. backend/modules/calendar/resources/js/calendar-common.js +1 -1
  18. backend/modules/dashboard/Page.php +1 -1
  19. backend/modules/dashboard/resources/js/dashboard.js +1 -1
  20. backend/modules/debug/Page.php +7 -1
  21. backend/modules/debug/resources/js/debug.js +3 -1
  22. backend/modules/notifications/lib/Codes.php +1 -0
  23. backend/modules/payments/Page.php +1 -1
  24. backend/modules/payments/resources/js/payments.js +1 -1
  25. backend/modules/services/Ajax.php +2 -2
  26. backend/modules/sms/Page.php +1 -1
  27. backend/modules/sms/resources/js/sms.js +18 -4
  28. frontend/resources/js/bookly.js +2 -0
  29. frontend/resources/js/bookly.min.js +1 -1
  30. frontend/resources/js/bookly.min.js.map +1 -1
  31. frontend/resources/js/src/service_step.js +2 -0
  32. languages/bookly.pot +6 -3
  33. lib/Installer.php +29 -43
  34. lib/Updater.php +24 -0
  35. lib/UserBookingData.php +19 -15
  36. lib/Validator.php +17 -9
  37. lib/base/Schema.php +0 -1
  38. lib/base/Updater.php +42 -0
  39. lib/entities/CustomerAppointment.php +17 -9
  40. lib/notifications/assets/order/Attachments.php +3 -1
  41. lib/slots/Finder.php +7 -3
  42. lib/utils/Price.php +1 -0
  43. main.php +1 -1
  44. readme.txt +2 -2
backend/Backend.php CHANGED
@@ -71,8 +71,11 @@ abstract class Backend
71
$appearance = __( 'Appearance', 'bookly' );
72
$settings = __( 'Settings', 'bookly' );
73
74
- add_submenu_page( 'bookly-menu', $dashboard, $dashboard, 'read',
75
- Modules\Dashboard\Page::pageSlug(), function () { Modules\Dashboard\Page::render(); } );
76
add_submenu_page( 'bookly-menu', $calendar, $calendar, 'read',
77
Modules\Calendar\Page::pageSlug(), function () { Modules\Calendar\Page::render(); } );
78
if ( $current_user->has_cap( 'manage_options' ) || $current_user->has_cap( 'manage_bookly_appointments' ) ) {
71
$appearance = __( 'Appearance', 'bookly' );
72
$settings = __( 'Settings', 'bookly' );
73
74
+ if ( $current_user->has_cap( 'manage_options' ) ) {
75
+ add_submenu_page( 'bookly-menu', $dashboard, $dashboard, 'read',
76
+ Modules\Dashboard\Page::pageSlug(), function () {
77
+ Modules\Dashboard\Page::render(); } );
78
+ }
79
add_submenu_page( 'bookly-menu', $calendar, $calendar, 'read',
80
Modules\Calendar\Page::pageSlug(), function () { Modules\Calendar\Page::render(); } );
81
if ( $current_user->has_cap( 'manage_options' ) || $current_user->has_cap( 'manage_bookly_appointments' ) ) {
backend/components/dashboard/appointments/Widget.php CHANGED
@@ -11,10 +11,15 @@ class Widget extends Lib\Base\Component
11
{
12
public static function init()
13
{
14
- $class = __CLASS__;
15
- add_action( 'wp_dashboard_setup', function () use ( $class ) {
16
- wp_add_dashboard_widget( strtolower( str_replace( '\\', '-', $class ) ), 'Bookly - ' . __( 'Appointments', 'bookly' ), array( $class, 'renderWidget' ) );
17
- } );
18
}
19
20
/**
11
{
12
public static function init()
13
{
14
+ /** @var \WP_User $current_user */
15
+ global $current_user;
16
+
17
+ if ( $current_user && $current_user->has_cap( 'manage_options' ) ) {
18
+ $class = __CLASS__;
19
+ add_action( 'wp_dashboard_setup', function () use ( $class ) {
20
+ wp_add_dashboard_widget( strtolower( str_replace( '\\', '-', $class ) ), 'Bookly - ' . __( 'Appointments', 'bookly' ), array( $class, 'renderWidget' ) );
21
+ } );
22
+ }
23
}
24
25
/**
backend/components/dialogs/appointment/edit/Ajax.php CHANGED
@@ -83,7 +83,7 @@ class Ajax extends Lib\Base\Ajax
83
$staff_service->service->getTitle(),
84
Lib\Utils\DateTime::secondsToInterval( $staff_service->service->getDuration() )
85
),
86
- 'category' => $category ? $category->getName() : ( $has_categories ? __( 'Uncategorized', 'bookly' ) : ''),
87
'duration' => $staff_service->service->getDuration(),
88
'units_min' => $staff_service->service->getUnitsMin(),
89
'units_max' => $staff_service->service->getUnitsMax(),
83
$staff_service->service->getTitle(),
84
Lib\Utils\DateTime::secondsToInterval( $staff_service->service->getDuration() )
85
),
86
+ 'category' => $category ? $category->getName() : ( $has_categories ? __( 'Uncategorized', 'bookly' ) : '' ),
87
'duration' => $staff_service->service->getDuration(),
88
'units_min' => $staff_service->service->getUnitsMin(),
89
'units_max' => $staff_service->service->getUnitsMax(),
backend/components/dialogs/appointment/edit/Dialog.php CHANGED
@@ -23,7 +23,7 @@ class Dialog extends Lib\Base\Component
23
24
self::enqueueScripts( array(
25
'backend' => array(
26
- 'js/angular.min.js' => array( 'jquery' ),
27
'js/angular-ui-date-0.0.8.js' => array( 'bookly-angular.min.js' ),
28
'js/moment.min.js' => array( 'jquery' ),
29
'js/select2.full.min.js' => array( 'jquery' ),
@@ -34,7 +34,7 @@ class Dialog extends Lib\Base\Component
34
'js/ladda.min.js' => array( 'jquery' ),
35
),
36
'module' => array(
37
- 'js/ng-appointment.js' => array( 'bookly-angular-ui-date-0.0.8.js', 'jquery-ui-datepicker' ),
38
)
39
) );
40
@@ -45,7 +45,8 @@ class Dialog extends Lib\Base\Component
45
'monthNamesShort' => array_values( $wp_locale->month_abbrev ),
46
'monthNames' => array_values( $wp_locale->month ),
47
'dayNamesMin' => array_values( $wp_locale->weekday_abbrev ),
48
- 'longDays' => array_values( $wp_locale->weekday ),
49
'firstDay' => (int) get_option( 'start_of_week' ),
50
),
51
'cf_per_service' => (int) Lib\Config::customFieldsPerService(),
23
24
self::enqueueScripts( array(
25
'backend' => array(
26
+ 'js/angular.min.js' => array( 'jquery-ui-datepicker' ),
27
'js/angular-ui-date-0.0.8.js' => array( 'bookly-angular.min.js' ),
28
'js/moment.min.js' => array( 'jquery' ),
29
'js/select2.full.min.js' => array( 'jquery' ),
34
'js/ladda.min.js' => array( 'jquery' ),
35
),
36
'module' => array(
37
+ 'js/ng-appointment.js' => array( 'bookly-angular-ui-date-0.0.8.js' ),
38
)
39
) );
40
45
'monthNamesShort' => array_values( $wp_locale->month_abbrev ),
46
'monthNames' => array_values( $wp_locale->month ),
47
'dayNamesMin' => array_values( $wp_locale->weekday_abbrev ),
48
+ 'dayNamesShort' => array_values( $wp_locale->weekday_abbrev ),
49
+ 'dayNames' => array_values( $wp_locale->weekday ),
50
'firstDay' => (int) get_option( 'start_of_week' ),
51
),
52
'cf_per_service' => (int) Lib\Config::customFieldsPerService(),
backend/components/dialogs/appointment/edit/resources/js/ng-appointment.js CHANGED
@@ -503,6 +503,7 @@
503
callback = _callback;
504
};
505
506
var checkAppointmentErrors = function() {
507
if ($scope.form.staff) {
508
var dates = $scope.dataSource.getStartAndEndDates(),
@@ -531,7 +532,12 @@
531
});
532
});
533
534
- jQuery.post(
535
ajaxurl,
536
{
537
action : 'bookly_check_appointment_errors',
503
callback = _callback;
504
};
505
506
+ var checkErrorsXhr = null;
507
var checkAppointmentErrors = function() {
508
if ($scope.form.staff) {
509
var dates = $scope.dataSource.getStartAndEndDates(),
532
});
533
});
534
535
+ if (checkErrorsXhr != null) {
536
+ checkErrorsXhr.abort();
537
+ checkErrorsXhr = null;
538
+ }
539
+
540
+ checkErrorsXhr = jQuery.post(
541
ajaxurl,
542
{
543
action : 'bookly_check_appointment_errors',
backend/components/dialogs/customer/delete/templates/dialog.php CHANGED
@@ -25,7 +25,7 @@ use Bookly\Backend\Components\Controls\Buttons;
25
</label>
26
</div>
27
</div>
28
- <div style="margin-top: 80px;">
29
<div class="checkbox">
30
<label>
31
<input class="bookly-js-remember-choice-checkbox" type="checkbox"/><?php esc_html_e( 'Remember my choice', 'bookly' ) ?>
25
</label>
26
</div>
27
</div>
28
+ <div>
29
<div class="checkbox">
30
<label>
31
<input class="bookly-js-remember-choice-checkbox" type="checkbox"/><?php esc_html_e( 'Remember my choice', 'bookly' ) ?>
backend/components/dialogs/customer/edit/Dialog.php CHANGED
@@ -49,7 +49,7 @@ class Dialog extends Lib\Base\Component
49
'monthNamesShort' => array_values( $wp_locale->month_abbrev ),
50
'monthNames' => array_values( $wp_locale->month ),
51
'dayNamesMin' => array_values( $wp_locale->weekday_abbrev ),
52
- 'longDays' => array_values( $wp_locale->weekday ),
53
'firstDay' => (int) get_option( 'start_of_week' ),
54
'yearRange' => sprintf( '%s:%s', date_create()->modify( '-100 years' )->format( 'Y' ), date( 'Y' ) ),
55
'changeYear' => true,
49
'monthNamesShort' => array_values( $wp_locale->month_abbrev ),
50
'monthNames' => array_values( $wp_locale->month ),
51
'dayNamesMin' => array_values( $wp_locale->weekday_abbrev ),
52
+ 'dayNames' => array_values( $wp_locale->weekday ),
53
'firstDay' => (int) get_option( 'start_of_week' ),
54
'yearRange' => sprintf( '%s:%s', date_create()->modify( '-100 years' )->format( 'Y' ), date( 'Y' ) ),
55
'changeYear' => true,
backend/components/dialogs/service/edit/resources/js/service-edit-dialog.js CHANGED
@@ -226,7 +226,7 @@ jQuery(function ($) {
226
}
227
228
function checkRepeatError($panel) {
229
- if ($panel.find('[name="recurrence_enabled"]').val() == 1 && $panel.find('[name="recurrence_frequencies[]"]:checked').length == 0) {
230
$panel.find('[name="recurrence_enabled"]').closest('.form-group').addClass('has-error');
231
$panel.find('.bookly-js-frequencies').closest('.form-group').find('button.dropdown-toggle').addClass('btn-danger').removeClass('btn-default');
232
$serviceError.find('.bookly-js-recurrence-error').remove();
@@ -265,8 +265,6 @@ jQuery(function ($) {
265
}
266
$servicesList.DataTable().ajax.reload();
267
$serviceDialog.modal('hide');
268
- } else {
269
- booklyAlert({error: [response.data.message]});
270
}
271
}, 'json').always(function() {
272
ladda.stop();
226
}
227
228
function checkRepeatError($panel) {
229
+ if ($panel.find('[name="recurrence_enabled"]:checked').val() == 1 && $panel.find('[name="recurrence_frequencies[]"]:checked').length == 0) {
230
$panel.find('[name="recurrence_enabled"]').closest('.form-group').addClass('has-error');
231
$panel.find('.bookly-js-frequencies').closest('.form-group').find('button.dropdown-toggle').addClass('btn-danger').removeClass('btn-default');
232
$serviceError.find('.bookly-js-recurrence-error').remove();
265
}
266
$servicesList.DataTable().ajax.reload();
267
$serviceDialog.modal('hide');
268
}
269
}, 'json').always(function() {
270
ladda.stop();
backend/components/dialogs/sms/Ajax.php CHANGED
@@ -40,8 +40,11 @@ class Ajax extends Lib\Base\Ajax
40
{
41
$notification = new Lib\Entities\Notification();
42
$notification->load( self::parameter( 'id' ) );
43
- $data = $notification->getFields();
44
$data['settings'] = array_merge( Lib\DataHolders\Notification\Settings::getDefault(), json_decode( $data['settings'], true ) );
45
46
wp_send_json_success( $data );
47
}
40
{
41
$notification = new Lib\Entities\Notification();
42
$notification->load( self::parameter( 'id' ) );
43
+ $data = $notification->getFields();
44
$data['settings'] = array_merge( Lib\DataHolders\Notification\Settings::getDefault(), json_decode( $data['settings'], true ) );
45
+ if ( get_user_meta( get_current_user_id(), 'rich_editing', true ) !== 'false' ) {
46
+ $data['message'] = wpautop( $data['message'] );
47
+ }
48
49
wp_send_json_success( $data );
50
}
backend/components/dialogs/sms/resources/js/notification-dialog.js CHANGED
@@ -25,14 +25,6 @@ jQuery(function ($) {
25
$textarea = $('#bookly-js-message', containers.message)
26
;
27
28
- function getNotificationText() {
29
- if (useTinyMCE) {
30
- return tinyMCE.activeEditor.getContent({format: 'raw'});
31
- } else {
32
- return $textarea.val();
33
- }
34
- }
35
-
36
function setNotificationText(text) {
37
if (useTinyMCE) {
38
tinyMCE.activeEditor.setContent(text);
@@ -163,11 +155,13 @@ jQuery(function ($) {
163
164
$btnSaveNotification
165
.on('click', function () {
166
var data = $modalNotification.serializeArray(),
167
ladda = Ladda.create(this);
168
ladda.start();
169
data.push({name: 'action', value: 'bookly_save_notification'});
170
- data.push({name: 'notification[message]', value: getNotificationText()});
171
172
$.ajax({
173
url : ajaxurl,
25
$textarea = $('#bookly-js-message', containers.message)
26
;
27
28
function setNotificationText(text) {
29
if (useTinyMCE) {
30
tinyMCE.activeEditor.setContent(text);
155
156
$btnSaveNotification
157
.on('click', function () {
158
+ if (useTinyMCE) {
159
+ tinyMCE.triggerSave();
160
+ }
161
var data = $modalNotification.serializeArray(),
162
ladda = Ladda.create(this);
163
ladda.start();
164
data.push({name: 'action', value: 'bookly_save_notification'});
165
166
$.ajax({
167
url : ajaxurl,
backend/modules/appearance/Page.php CHANGED
@@ -63,6 +63,7 @@ class Page extends Lib\Base\Component
63
'nop_format' => get_option( 'bookly_group_booking_nop_format' ),
64
'today' => __( 'Today', 'bookly' ),
65
'months' => array_values( $wp_locale->month ),
66
'days' => array_values( $wp_locale->weekday_abbrev ),
67
'nextMonth' => __( 'Next month', 'bookly' ),
68
'prevMonth' => __( 'Previous month', 'bookly' ),
63
'nop_format' => get_option( 'bookly_group_booking_nop_format' ),
64
'today' => __( 'Today', 'bookly' ),
65
'months' => array_values( $wp_locale->month ),
66
+ 'daysFull' => array_values( $wp_locale->weekday ),
67
'days' => array_values( $wp_locale->weekday_abbrev ),
68
'nextMonth' => __( 'Next month', 'bookly' ),
69
'prevMonth' => __( 'Previous month', 'bookly' ),
backend/modules/appearance/resources/js/appearance.js CHANGED
@@ -214,6 +214,7 @@ jQuery(function($) {
214
clear : false,
215
close : false,
216
today : BooklyL10n.today,
217
weekdaysShort : BooklyL10n.days,
218
monthsFull : BooklyL10n.months,
219
labelMonthNext : BooklyL10n.nextMonth,
@@ -334,6 +335,7 @@ jQuery(function($) {
334
formatSubmit : 'yyyy-mm-dd',
335
format : BooklyL10n.date_format,
336
min : true,
337
weekdaysShort : BooklyL10n.days,
338
monthsFull : BooklyL10n.months,
339
labelMonthNext : BooklyL10n.nextMonth,
@@ -452,6 +454,7 @@ jQuery(function($) {
452
clear : false,
453
close : false,
454
today : BooklyL10n.today,
455
weekdaysShort : BooklyL10n.days,
456
monthsFull : BooklyL10n.months,
457
labelMonthNext : BooklyL10n.nextMonth,
214
clear : false,
215
close : false,
216
today : BooklyL10n.today,
217
+ weekdaysFull : BooklyL10n.daysFull,
218
weekdaysShort : BooklyL10n.days,
219
monthsFull : BooklyL10n.months,
220
labelMonthNext : BooklyL10n.nextMonth,
335
formatSubmit : 'yyyy-mm-dd',
336
format : BooklyL10n.date_format,
337
min : true,
338
+ weekdaysFull : BooklyL10n.daysFull,
339
weekdaysShort : BooklyL10n.days,
340
monthsFull : BooklyL10n.months,
341
labelMonthNext : BooklyL10n.nextMonth,
454
clear : false,
455
close : false,
456
today : BooklyL10n.today,
457
+ weekdaysFull : BooklyL10n.daysFull,
458
weekdaysShort : BooklyL10n.days,
459
monthsFull : BooklyL10n.months,
460
labelMonthNext : BooklyL10n.nextMonth,
backend/modules/appointments/Ajax.php CHANGED
@@ -85,7 +85,7 @@ class Ajax extends Lib\Base\Ajax
85
if ( $filter['created_date'] != 'any' ) {
86
list ( $start, $end ) = explode( ' - ', $filter['created_date'], 2 );
87
$end = date( 'Y-m-d', strtotime( $end ) + DAY_IN_SECONDS );
88
- $query->havingRaw( 'created_date BETWEEN %s AND %s', array( $start, $end ) );
89
}
90
91
if ( $filter['staff'] != '' ) {
@@ -115,6 +115,10 @@ class Ajax extends Lib\Base\Ajax
115
$custom_fields[ $field_data->id ] = '';
116
}
117
118
$data = array();
119
foreach ( $query->fetchArray() as $row ) {
120
// Service duration.
@@ -188,9 +192,9 @@ class Ajax extends Lib\Base\Ajax
188
update_user_meta( get_current_user_id(), 'bookly_filter_appointments_list', $filter );
189
190
wp_send_json( array(
191
- 'draw' => (int) self::parameter( 'draw' ),
192
'recordsTotal' => $total,
193
- 'recordsFiltered' => count( $data ),
194
'data' => $data,
195
) );
196
}
85
if ( $filter['created_date'] != 'any' ) {
86
list ( $start, $end ) = explode( ' - ', $filter['created_date'], 2 );
87
$end = date( 'Y-m-d', strtotime( $end ) + DAY_IN_SECONDS );
88
+ $query->whereBetween( 'COALESCE(ca.created, a.created)', $start, $end );
89
}
90
91
if ( $filter['staff'] != '' ) {
115
$custom_fields[ $field_data->id ] = '';
116
}
117
118
+ $filtered = $query->count();
119
+
120
+ $query->limit( self::parameter( 'length' ) )->offset( self::parameter( 'start' ) );
121
+
122
$data = array();
123
foreach ( $query->fetchArray() as $row ) {
124
// Service duration.
192
update_user_meta( get_current_user_id(), 'bookly_filter_appointments_list', $filter );
193
194
wp_send_json( array(
195
+ 'draw' => ( int ) self::parameter( 'draw' ),
196
'recordsTotal' => $total,
197
+ 'recordsFiltered' => $filtered,
198
'data' => $data,
199
) );
200
}
backend/modules/appointments/Page.php CHANGED
@@ -70,7 +70,7 @@ class Page extends Lib\Base\Component
70
'calendar' => array(
71
'longMonths' => array_values( $wp_locale->month ),
72
'shortMonths' => array_values( $wp_locale->month_abbrev ),
73
- 'longDays' => array_values( $wp_locale->weekday ),
74
'shortDays' => array_values( $wp_locale->weekday_abbrev ),
75
),
76
'mjsDateFormat' => Lib\Utils\DateTime::convertFormat( 'date', Lib\Utils\DateTime::FORMAT_MOMENT_JS ),
70
'calendar' => array(
71
'longMonths' => array_values( $wp_locale->month ),
72
'shortMonths' => array_values( $wp_locale->month_abbrev ),
73
+ 'dayNames' => array_values( $wp_locale->weekday ),
74
'shortDays' => array_values( $wp_locale->weekday_abbrev ),
75
),
76
'mjsDateFormat' => Lib\Utils\DateTime::convertFormat( 'date', Lib\Utils\DateTime::FORMAT_MOMENT_JS ),
backend/modules/appointments/resources/js/appointments.js CHANGED
@@ -191,13 +191,15 @@ jQuery(function($) {
191
}
192
193
var dt = $appointmentsList.DataTable({
194
- order: [[ 1, 'desc' ]],
195
- info: false,
196
- paging: false,
197
- searching: false,
198
- processing: true,
199
- responsive: true,
200
- serverSide: true,
201
drawCallback: function( settings ) {
202
$('[data-toggle="popover"]').on('click', function (e) {
203
e.preventDefault();
@@ -236,6 +238,9 @@ jQuery(function($) {
236
}
237
}
238
]),
239
language: {
240
zeroRecords: BooklyL10n.zeroRecords,
241
processing: BooklyL10n.processing
@@ -370,7 +375,7 @@ jQuery(function($) {
370
moment.locale('en', {
371
months : BooklyL10n.calendar.longMonths,
372
monthsShort : BooklyL10n.calendar.shortMonths,
373
- weekdays : BooklyL10n.calendar.longDays,
374
weekdaysShort: BooklyL10n.calendar.shortDays,
375
weekdaysMin : BooklyL10n.calendar.shortDays
376
});
191
}
192
193
var dt = $appointmentsList.DataTable({
194
+ order : [[1, 'desc']],
195
+ info : false,
196
+ searching : false,
197
+ lengthChange: false,
198
+ processing : true,
199
+ responsive : true,
200
+ pageLength : 25,
201
+ pagingType : 'numbers',
202
+ serverSide : true,
203
drawCallback: function( settings ) {
204
$('[data-toggle="popover"]').on('click', function (e) {
205
e.preventDefault();
238
}
239
}
240
]),
241
+ dom: "<'row'<'col-sm-6'l><'col-sm-6'f>>" +
242
+ "<'row'<'col-sm-12'tr>>" +
243
+ "<'row pull-left'<'col-sm-12 bookly-margin-top-lg'p>>",
244
language: {
245
zeroRecords: BooklyL10n.zeroRecords,
246
processing: BooklyL10n.processing
375
moment.locale('en', {
376
months : BooklyL10n.calendar.longMonths,
377
monthsShort : BooklyL10n.calendar.shortMonths,
378
+ weekdays : BooklyL10n.calendar.dayNames,
379
weekdaysShort: BooklyL10n.calendar.shortDays,
380
weekdaysMin : BooklyL10n.calendar.shortDays
381
});
backend/modules/calendar/Page.php CHANGED
@@ -46,7 +46,7 @@ class Page extends Lib\Base\Ajax
46
'shortMonths' => array_values( $wp_locale->month_abbrev ),
47
'longMonths' => array_values( $wp_locale->month ),
48
'shortDays' => array_values( $wp_locale->weekday_abbrev ),
49
- 'longDays' => array_values( $wp_locale->weekday ),
50
),
51
'dpDateFormat' => Lib\Utils\DateTime::convertFormat( 'date', Lib\Utils\DateTime::FORMAT_JQUERY_DATEPICKER ),
52
'mjsDateFormat' => Lib\Utils\DateTime::convertFormat( 'date', Lib\Utils\DateTime::FORMAT_MOMENT_JS ),
46
'shortMonths' => array_values( $wp_locale->month_abbrev ),
47
'longMonths' => array_values( $wp_locale->month ),
48
'shortDays' => array_values( $wp_locale->weekday_abbrev ),
49
+ 'dayNames' => array_values( $wp_locale->weekday ),
50
),
51
'dpDateFormat' => Lib\Utils\DateTime::convertFormat( 'date', Lib\Utils\DateTime::FORMAT_JQUERY_DATEPICKER ),
52
'mjsDateFormat' => Lib\Utils\DateTime::convertFormat( 'date', Lib\Utils\DateTime::FORMAT_MOMENT_JS ),
backend/modules/calendar/resources/js/calendar-common.js CHANGED
@@ -20,7 +20,7 @@ jQuery(function ($) {
20
timeFormat: obj.options.l10n.mjsTimeFormat,
21
monthNames: obj.options.l10n.calendar.longMonths,
22
monthNamesShort: obj.options.l10n.calendar.shortMonths,
23
- dayNames: obj.options.l10n.calendar.longDays,
24
dayNamesShort: obj.options.l10n.calendar.shortDays,
25
allDaySlot: false,
26
eventBackgroundColor: 'silver',
20
timeFormat: obj.options.l10n.mjsTimeFormat,
21
monthNames: obj.options.l10n.calendar.longMonths,
22
monthNamesShort: obj.options.l10n.calendar.shortMonths,
23
+ dayNames: obj.options.l10n.calendar.dayNames,
24
dayNamesShort: obj.options.l10n.calendar.shortDays,
25
allDaySlot: false,
26
eventBackgroundColor: 'silver',
backend/modules/dashboard/Page.php CHANGED
@@ -53,7 +53,7 @@ class Page extends Lib\Base\Component
53
'calendar' => array(
54
'longMonths' => array_values( $wp_locale->month ),
55
'shortMonths' => array_values( $wp_locale->month_abbrev ),
56
- 'longDays' => array_values( $wp_locale->weekday ),
57
'shortDays' => array_values( $wp_locale->weekday_abbrev ),
58
),
59
) );
53
'calendar' => array(
54
'longMonths' => array_values( $wp_locale->month ),
55
'shortMonths' => array_values( $wp_locale->month_abbrev ),
56
+ 'dayNames' => array_values( $wp_locale->weekday ),
57
'shortDays' => array_values( $wp_locale->weekday_abbrev ),
58
),
59
) );
backend/modules/dashboard/resources/js/dashboard.js CHANGED
@@ -8,7 +8,7 @@ jQuery(function ($) {
8
moment.locale('en', {
9
months : BooklyL10n.calendar.longMonths,
10
monthsShort : BooklyL10n.calendar.shortMonths,
11
- weekdays : BooklyL10n.calendar.longDays,
12
weekdaysShort: BooklyL10n.calendar.shortDays,
13
weekdaysMin : BooklyL10n.calendar.shortDays
14
});
8
moment.locale('en', {
9
months : BooklyL10n.calendar.longMonths,
10
monthsShort : BooklyL10n.calendar.shortMonths,
11
+ weekdays : BooklyL10n.calendar.dayNames,
12
weekdaysShort: BooklyL10n.calendar.shortDays,
13
weekdaysMin : BooklyL10n.calendar.shortDays
14
});
backend/modules/debug/Page.php CHANGED
@@ -18,6 +18,9 @@ class Page extends Lib\Base\Ajax
18
*/
19
public static function render()
20
{
21
self::enqueueStyles( array(
22
'frontend' => array( 'css/ladda.min.css', ),
23
'backend' => array( 'bootstrap/css/bootstrap-theme.min.css', ),
@@ -83,7 +86,10 @@ class Page extends Lib\Base\Ajax
83
}
84
85
wp_localize_script( 'bookly-debug.js', 'BooklyL10n', array(
86
- 'csrfToken' => Lib\Utils\Common::getCsrfToken(),
87
) );
88
89
ksort( $debug );
18
*/
19
public static function render()
20
{
21
+ /** @var \wpdb $wpdb*/
22
+ global $wpdb;
23
+
24
self::enqueueStyles( array(
25
'frontend' => array( 'css/ladda.min.css', ),
26
'backend' => array( 'bootstrap/css/bootstrap-theme.min.css', ),
86
}
87
88
wp_localize_script( 'bookly-debug.js', 'BooklyL10n', array(
89
+ 'csrfToken' => Lib\Utils\Common::getCsrfToken(),
90
+ 'charsetCollate' => $wpdb->has_cap( 'collation' )
91
+ ? $wpdb->get_charset_collate()
92
+ : 'DEFAULT CHARACTER SET = utf8 COLLATE = utf8_general_ci'
93
) );
94
95
ksort( $debug );
backend/modules/debug/resources/js/debug.js CHANGED
@@ -243,7 +243,9 @@ jQuery(function($) {
243
let field = response.data.replace(' primary key', ','),
244
sql = 'CREATE TABLE `' + table + '` (' +
245
"\n `id` " + field +
246
- "\n PRIMARY KEY (`id`));";
247
$('pre', $tableModal).html(sql);
248
} else {
249
$('pre', $tableModal).html('');
243
let field = response.data.replace(' primary key', ','),
244
sql = 'CREATE TABLE `' + table + '` (' +
245
"\n `id` " + field +
246
+ "\nPRIMARY KEY (`id`))" +
247
+ "\nENGINE = INNODB" +
248
+ "\n" + BooklyL10n.charsetCollate + ";";
249
$('pre', $tableModal).html(sql);
250
} else {
251
$('pre', $tableModal).html('');
backend/modules/notifications/lib/Codes.php CHANGED
@@ -37,6 +37,7 @@ class Codes
37
'cart' => array(
38
'cart_info' => __( 'cart information', 'bookly' ),
39
'cart_info_c' => __( 'cart information with cancel', 'bookly' ),
40
),
41
'category' => array(
42
'category_name' => __( 'name of category', 'bookly' ),
37
'cart' => array(
38
'cart_info' => __( 'cart information', 'bookly' ),
39
'cart_info_c' => __( 'cart information with cancel', 'bookly' ),
40
+ 'appointment_notes' => __( 'customer notes for appointment', 'bookly' ),
41
),
42
'category' => array(
43
'category_name' => __( 'name of category', 'bookly' ),
backend/modules/payments/Page.php CHANGED
@@ -57,7 +57,7 @@ class Page extends Lib\Base\Component
57
'calendar' => array(
58
'longMonths' => array_values( $wp_locale->month ),
59
'shortMonths' => array_values( $wp_locale->month_abbrev ),
60
- 'longDays' => array_values( $wp_locale->weekday ),
61
'shortDays' => array_values( $wp_locale->weekday_abbrev ),
62
),
63
'startOfWeek' => (int) get_option( 'start_of_week' ),
57
'calendar' => array(
58
'longMonths' => array_values( $wp_locale->month ),
59
'shortMonths' => array_values( $wp_locale->month_abbrev ),
60
+ 'dayNames' => array_values( $wp_locale->weekday ),
61
'shortDays' => array_values( $wp_locale->weekday_abbrev ),
62
),
63
'startOfWeek' => (int) get_option( 'start_of_week' ),
backend/modules/payments/resources/js/payments.js CHANGED
@@ -161,7 +161,7 @@ jQuery(function($) {
161
moment.locale('en', {
162
months: BooklyL10n.calendar.longMonths,
163
monthsShort: BooklyL10n.calendar.shortMonths,
164
- weekdays: BooklyL10n.calendar.longDays,
165
weekdaysShort: BooklyL10n.calendar.shortDays,
166
weekdaysMin: BooklyL10n.calendar.shortDays
167
});
161
moment.locale('en', {
162
months: BooklyL10n.calendar.longMonths,
163
monthsShort: BooklyL10n.calendar.shortMonths,
164
+ weekdays: BooklyL10n.calendar.dayNames,
165
weekdaysShort: BooklyL10n.calendar.shortDays,
166
weekdaysMin: BooklyL10n.calendar.shortDays
167
});
backend/modules/services/Ajax.php CHANGED
@@ -147,7 +147,7 @@ class Ajax extends Page
147
'staff' => $staff_dropdown_data,
148
);
149
150
- wp_send_json_success( Proxy\Shared::prepareGetService( $result, $service ) );
151
}
152
153
/**
@@ -263,7 +263,7 @@ class Ajax extends Page
263
// Update services in addons.
264
$alert = Proxy\Shared::updateService( array( 'success' => array( __( 'Settings saved.', 'bookly' ) ) ), $service, self::postParameters() );
265
266
- wp_send_json_success( Proxy\Shared::prepareUpdateServiceResponse( array(), $service, self::postParameters() ) );
267
}
268
269
/**
147
'staff' => $staff_dropdown_data,
148
);
149
150
+ wp_send_json_success( $result );
151
}
152
153
/**
263
// Update services in addons.
264
$alert = Proxy\Shared::updateService( array( 'success' => array( __( 'Settings saved.', 'bookly' ) ) ), $service, self::postParameters() );
265
266
+ wp_send_json_success( Proxy\Shared::prepareUpdateServiceResponse( array( 'alert' => $alert), $service, self::postParameters() ) );
267
}
268
269
/**
backend/modules/sms/Page.php CHANGED
@@ -149,7 +149,7 @@ class Page extends Lib\Base\Component
149
'enabled' => get_option( 'bookly_cst_phone_default_country' ) != 'disabled',
150
),
151
'calendar' => array(
152
- 'longDays' => array_values( $wp_locale->weekday ),
153
'longMonths' => array_values( $wp_locale->month ),
154
'shortDays' => array_values( $wp_locale->weekday_abbrev ),
155
'shortMonths' => array_values( $wp_locale->month_abbrev ),
149
'enabled' => get_option( 'bookly_cst_phone_default_country' ) != 'disabled',
150
),
151
'calendar' => array(
152
+ 'dayNames' => array_values( $wp_locale->weekday ),
153
'longMonths' => array_values( $wp_locale->month ),
154
'shortDays' => array_values( $wp_locale->weekday_abbrev ),
155
'shortMonths' => array_values( $wp_locale->month_abbrev ),
backend/modules/sms/resources/js/sms.js CHANGED
@@ -197,7 +197,7 @@ jQuery(function($) {
197
var ladda = Ladda.create(this);
198
ladda.start();
199
var $form = $(this).parents('form');
200
- $form.bookly_sms_administrator_phone = BooklyL10n.intlTelInput.enabled ? $phone_input.intlTelInput('getNumber') : $phone_input.val();
201
$form.submit();
202
});
203
$('#send_test_sms').on('click', function (e) {
@@ -207,7 +207,7 @@ jQuery(function($) {
207
data : {
208
action: 'bookly_send_test_sms',
209
csrf_token : BooklyL10n.csrfToken,
210
- phone_number: BooklyL10n.intlTelInput.enabled ? $phone_input.intlTelInput('getNumber') : $phone_input.val() },
211
dataType : 'json',
212
xhrFields : { withCredentials: true },
213
crossDomain : 'withCredentials' in new XMLHttpRequest(),
@@ -271,7 +271,7 @@ jQuery(function($) {
271
moment.locale('en', {
272
months : BooklyL10n.calendar.longMonths,
273
monthsShort : BooklyL10n.calendar.shortMonths,
274
- weekdays : BooklyL10n.calendar.longDays,
275
weekdaysShort: BooklyL10n.calendar.shortDays,
276
weekdaysMin : BooklyL10n.calendar.shortDays
277
});
@@ -435,7 +435,7 @@ jQuery(function($) {
435
method: 'POST',
436
data: {
437
action: 'bookly_save_administrator_phone',
438
- bookly_sms_administrator_phone: BooklyL10n.intlTelInput.enabled ? $phone_input.intlTelInput('getNumber') : $phone_input.val(),
439
csrf_token: BooklyL10n.csrfToken
440
},
441
success: function (response) {
@@ -490,6 +490,20 @@ jQuery(function($) {
490
});
491
}
492
493
/**
494
* Sender ID Tab.
495
*/
197
var ladda = Ladda.create(this);
198
ladda.start();
199
var $form = $(this).parents('form');
200
+ $form.bookly_sms_administrator_phone = getPhoneNumber();
201
$form.submit();
202
});
203
$('#send_test_sms').on('click', function (e) {
207
data : {
208
action: 'bookly_send_test_sms',
209
csrf_token : BooklyL10n.csrfToken,
210
+ phone_number: getPhoneNumber() },
211
dataType : 'json',
212
xhrFields : { withCredentials: true },
213
crossDomain : 'withCredentials' in new XMLHttpRequest(),
271
moment.locale('en', {
272
months : BooklyL10n.calendar.longMonths,
273
monthsShort : BooklyL10n.calendar.shortMonths,
274
+ weekdays : BooklyL10n.calendar.dayNames,
275
weekdaysShort: BooklyL10n.calendar.shortDays,
276
weekdaysMin : BooklyL10n.calendar.shortDays
277
});
435
method: 'POST',
436
data: {
437
action: 'bookly_save_administrator_phone',
438
+ bookly_sms_administrator_phone: getPhoneNumber(),
439
csrf_token: BooklyL10n.csrfToken
440
},
441
success: function (response) {
490
});
491
}
492
493
+ function getPhoneNumber() {
494
+ var phone_number;
495
+ try {
496
+ phone_number = BooklyL10n.intlTelInput.enabled ? $phone_input.intlTelInput('getNumber') : $phone_input.val();
497
+ if (phone_number == '') {
498
+ phone_number = $phone_input.val();
499
+ }
500
+ } catch (error) { // In case when intlTelInput can't return phone number.
501
+ phone_number = $phone_input.val();
502
+ }
503
+
504
+ return phone_number;
505
+ }
506
+
507
/**
508
* Sender ID Tab.
509
*/
frontend/resources/js/bookly.js CHANGED
@@ -3030,6 +3030,8 @@
3030
// Deselect category to keep full list of services.
3031
$('.bookly-js-select-category', $chain_item).val('');
3032
}
3033
}
3034
}
3035
if (!opt[params.form_id].form_attributes.hide_staff_members && chain_item.staff_ids.length == 1 && chain_item.staff_ids[0]) {
3030
// Deselect category to keep full list of services.
3031
$('.bookly-js-select-category', $chain_item).val('');
3032
}
3033
+ } else {
3034
+ $('.bookly-js-select-category', $chain_item).val(services[chain_item.service_id].category_id).trigger('change');
3035
}
3036
}
3037
if (!opt[params.form_id].form_attributes.hide_staff_members && chain_item.staff_ids.length == 1 && chain_item.staff_ids[0]) {
frontend/resources/js/bookly.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(V){"use strict";V=V&&V.hasOwnProperty("default")?V.default:V;var ee={};function oe(e){var o=Ladda.create(e);return o.start(),o}function te(e){var o=e.offset().top,t=V(window).scrollTop();(o<V(window).scrollTop()||o>t+window.innerHeight)&&V("html,body").animate({scrollTop:o-24},500)}function ae(e){var o=V.extend({action:"bookly_render_complete",csrf_token:BooklyL10n.csrf_token},e),t=ee[e.form_id].$container;V.ajax({url:BooklyL10n.ajaxurl,data:o,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success&&(e.final_step_url&&!o.error?document.location.href=e.final_step_url:(t.html(e.html),te(t)))}})}function se(c){var f=ee[c.form_id].$container;V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:{action:"bookly_render_payment",csrf_token:BooklyL10n.csrf_token,form_id:c.form_id,page_url:document.URL.split("#")[0]},dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){if(e.success){if(e.disabled)return void m(c.form_id);if(f.html(e.html),te(f),"cancelled"==ee[c.form_id].status.booking&&(ee[c.form_id].status.booking="ok"),f.find("#bookly-stripe-card-field").length)if(e.stripe_publishable_key){var i=Stripe(e.stripe_publishable_key,{betas:["payment_intent_beta_3"]}),r=i.elements().create("card");r.mount("#bookly-stripe-card-field")}else f.find(".bookly-stripe #bookly-stripe-card-field").hide(),f.find(".pay-card .bookly-js-next-step").prop("disabled",!0),f.find(".bookly-stripe .bookly-js-card-error").text("Please call Stripe() with your publishable key. You used an empty string.");var o=V(".bookly-payment",f),t=V(".bookly-js-apply-coupon",f),a=V("input.bookly-user-coupon",f),s=V(".bookly-js-coupon-error",f),n=V("input[type=radio][name=bookly-full-payment]",f),l=V(".bookly-info-text-coupon",f),d=V(".bookly-gateway-buttons,form.bookly-authorize_net,form.bookly-stripe",f);o.on("click",function(){d.hide(),V(".bookly-gateway-buttons.pay-"+V(this).val(),f).show(),"card"==V(this).val()&&V("form.bookly-"+V(this).data("form"),f).show()}),o.eq(0).trigger("click"),n.on("change",function(){var e={action:"bookly_deposit_payments_apply_payment_method",csrf_token:BooklyL10n.csrf_token,form_id:c.form_id,deposit_full:V(this).val()};V(this).hide(),V(this).prev().css("display","inline-block"),V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:e,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success&&se({form_id:c.form_id})}})}),t.on("click",function(e){var o=oe(this);s.text(""),a.removeClass("bookly-error");var t={action:"bookly_coupons_apply_coupon",csrf_token:BooklyL10n.csrf_token,form_id:c.form_id,coupon_code:a.val()};V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:t,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success?se({form_id:c.form_id}):(s.html(ee[c.form_id].errors[e.error]),a.addClass("bookly-error"),l.html(e.text),te(s),o.stop())},error:function(){o.stop()}})}),V(".bookly-js-next-step",f).on("click",function(e){var o,t,a=oe(this);if(V(".bookly-payment[value=local]",f).is(":checked")||V(this).hasClass("bookly-js-coupon-payment"))e.preventDefault(),m(c.form_id);else if(V(".bookly-payment[value=card]",f).is(":checked"))if(V(".bookly-payment[data-form=stripe]",f).is(":checked"))V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:{action:"bookly_stripe_create_intent",csrf_token:BooklyL10n.csrf_token,form_id:c.form_id},dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success?i.handleCardPayment(e.intent_secret,r).then(function(o){o.error?V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:{action:"bookly_stripe_failed_payment",csrf_token:BooklyL10n.csrf_token,form_id:c.form_id,intent_id:e.intent_id},dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success&&(a.stop(),f.find(".bookly-stripe .bookly-js-card-error").text(o.error.message))}}):V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:{action:"bookly_stripe_process_payment",csrf_token:BooklyL10n.csrf_token,form_id:c.form_id,intent_id:e.intent_id},dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success&&ae({form_id:c.form_id})}})}):(a.stop(),f.find(".bookly-stripe .bookly-js-card-error").text(e.error_message))}});else{o=f.find(".bookly-authorize_net"),e.preventDefault();var s={action:"bookly_authorize_net_aim_payment",csrf_token:BooklyL10n.csrf_token,card:{number:o.find('input[name="card_number"]').val(),cvc:o.find('input[name="card_cvc"]').val(),exp_month:o.find('select[name="card_exp_month"]').val(),exp_year:o.find('select[name="card_exp_year"]').val()},form_id:c.form_id};t=s,V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:t,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success?ae({form_id:c.form_id}):"cart_item_not_available"==e.error?y(e,c.form_id):"payment_error"==e.error&&(a.stop(),o.find(".bookly-js-card-error").text(e.error_message))}})}else(V(".bookly-payment[value=paypal]",f).is(":checked")||V(".bookly-payment[value=2checkout]",f).is(":checked")||V(".bookly-payment[value=payu_biz]",f).is(":checked")||V(".bookly-payment[value=payu_latam]",f).is(":checked")||V(".bookly-payment[value=payson]",f).is(":checked")||V(".bookly-payment[value=mollie]",f).is(":checked"))&&(e.preventDefault(),0<(o=V(this).closest("form")).find("input.bookly-payment-id").length?V.ajax({type:"POST",url:BooklyL10n.ajaxurl,xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,data:{action:"bookly_pro_save_pending_appointment",csrf_token:BooklyL10n.csrf_token,form_id:c.form_id,payment_type:o.data("gateway")},dataType:"json",success:function(e){e.success?(o.find("input.bookly-payment-id").val(e.payment_id),o.submit()):"cart_item_not_available"==e.error&&y(e,c.form_id)}}):V.ajax({type:"POST",url:BooklyL10n.ajaxurl,xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,data:{action:"bookly_check_cart",csrf_token:BooklyL10n.csrf_token,form_id:c.form_id},dataType:"json",success:function(e){e.success?o.submit():"cart_item_not_available"==e.error&&y(e,c.form_id)}}))}),V(".bookly-js-back-step",f).on("click",function(e){e.preventDefault(),oe(this),S({form_id:c.form_id})})}}})}function m(o){V.ajax({type:"POST",url:BooklyL10n.ajaxurl,xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,data:{action:"bookly_save_appointment",csrf_token:BooklyL10n.csrf_token,form_id:o},dataType:"json"}).done(function(e){e.success?ae({form_id:o}):"cart_item_not_available"==e.error&&y(e,o)})}function y(e,o){ee[o].skip_steps.cart?ne({form_id:o},ee[o].errors[e.error]):ie({form_id:o},{failed_key:e.failed_cart_key,message:ee[o].errors[e.error]})}function S(G){var e=V.extend({action:"bookly_render_details",csrf_token:BooklyL10n.csrf_token},G),K=ee[G.form_id].$container;V.ajax({url:BooklyL10n.ajaxurl,data:e,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){if(e.success){K.html(e.html),te(K);var l=e.intlTelInput,d=e.update_details_dialog,c=e.woocommerce;ee[G.form_id].hasOwnProperty("google_maps")&&ee[G.form_id].google_maps.enabled&&(K||V(".bookly-form .bookly-details-step")).each(function(){!function(t){var e=t.find(".bookly-js-cst-address-autocomplete");if(e.length){var i=new google.maps.places.Autocomplete(e[0],{types:["geocode"]}),o=[{selector:".bookly-js-address-country",val:function(){return a("country")},short:function(){return a("country",!0)}},{selector:".bookly-js-address-postcode",val:function(){return a("postal_code")}},{selector:".bookly-js-address-city",val:function(){return a("locality")||a("administrative_area_level_3")}},{selector:".bookly-js-address-state",val:function(){return a("administrative_area_level_1")},short:function(){return a("administrative_area_level_1",!0)}},{selector:".bookly-js-address-street",val:function(){return a("route")}},{selector:".bookly-js-address-street_number",val:function(){return a("street_number")}}],a=function(e,o){for(var t=i.getPlace().address_components,a=0;a<t.length;a++){var s=t[a].types[0];if(s===e)return o?t[a].short_name:t[a].long_name}return""};i.addListener("place_changed",function(){o.forEach(function(e){var o=t.find(e.selector);0!==o.length&&(o.val(e.val()),"function"==typeof e.short&&o.data("short",e.short()))})})}}(V(this))}),V(document.body).trigger("bookly.render.step_detail",[K]);var f="",t=V(".bookly-js-guest",K),m=V(".bookly-js-user-phone-input",K),y=V(".bookly-js-user-email",K),_=V(".bookly-js-user-email-confirm",K),u=V(".bookly-js-select-birthday-day",K),p=V(".bookly-js-select-birthday-month",K),k=V(".bookly-js-select-birthday-year",K),h=V(".bookly-js-address-country",K),b=V(".bookly-js-address-state",K),v=V(".bookly-js-address-postcode",K),j=V(".bookly-js-address-city",K),g=V(".bookly-js-address-street",K),w=V(".bookly-js-address-street_number",K),x=V(".bookly-js-address-additional_address",K),C=V(".bookly-js-address-country-error",K),L=V(".bookly-js-address-state-error",K),B=V(".bookly-js-address-postcode-error",K),T=V(".bookly-js-address-city-error",K),D=V(".bookly-js-address-street-error",K),S=V(".bookly-js-address-street_number-error",K),O=V(".bookly-js-address-additional_address-error",K),M=V(".bookly-js-select-birthday-day-error",K),q=V(".bookly-js-select-birthday-month-error",K),P=V(".bookly-js-select-birthday-year-error",K),F=V(".bookly-js-full-name",K),R=V(".bookly-js-first-name",K),E=V(".bookly-js-last-name",K),H=V(".bookly-js-user-notes",K),o=V(".bookly-custom-field",K),a=V(".bookly-js-info-field",K),X=V(".bookly-js-user-phone-error",K),I=V(".bookly-js-user-email-error",K),z=V(".bookly-js-user-email-confirm-error",K),N=V(".bookly-js-full-name-error",K),Y=V(".bookly-js-first-name-error",K),Z=V(".bookly-js-last-name-error",K),s=V(".bookly-js-captcha-img",K),i=V(".bookly-custom-field-error",K),r=V(".bookly-js-info-field-error",K),n=V(".bookly-js-modal",K),J=V(".bookly-js-login",K),$=V(".bookly-js-cst-duplicate",K),A=V(".bookly-js-next-step",K),U=V([M,q,P,C,L,B,T,D,S,O,N,Y,Z,X,I,z,i,r]).map(V.fn.toArray),Q=V([u,p,k,j,h,v,b,g,w,x,F,R,E,m,y,_,o,a]).map(V.fn.toArray),W=function(e){if(F.val(e.data.full_name).removeClass("bookly-error"),R.val(e.data.first_name).removeClass("bookly-error"),E.val(e.data.last_name).removeClass("bookly-error"),e.data.birthday){var o=e.data.birthday.split("-"),t=parseInt(o[0]),a=parseInt(o[1]),s=parseInt(o[2]);u.val(s).removeClass("bookly-error"),p.val(a).removeClass("bookly-error"),k.val(t).removeClass("bookly-error")}e.data.phone&&(m.removeClass("bookly-error"),l.enabled?m.intlTelInput("setNumber",e.data.phone):m.val(e.data.phone)),e.data.country&&h.val(e.data.country).removeClass("bookly-error"),e.data.state&&b.val(e.data.state).removeClass("bookly-error"),e.data.postcode&&v.val(e.data.postcode).removeClass("bookly-error"),e.data.city&&j.val(e.data.city).removeClass("bookly-error"),e.data.street&&g.val(e.data.street).removeClass("bookly-error"),e.data.street_number&&w.val(e.data.street_number).removeClass("bookly-error"),e.data.additional_address&&x.val(e.data.additional_address).removeClass("bookly-error"),y.val(e.data.email).removeClass("bookly-error"),e.data.info_fields&&e.data.info_fields.forEach(function(e){var o=K.find('.bookly-js-info-field-row[data-id="'+e.id+'"]');switch(o.data("type")){case"checkboxes":e.value.forEach(function(e){o.find(".bookly-js-info-field").filter(function(){return this.value==e}).prop("checked",!0)});break;case"radio-buttons":o.find(".bookly-js-info-field").filter(function(){return this.value==e.value}).prop("checked",!0);break;default:o.find(".bookly-js-info-field").val(e.value)}}),U.filter(":not(.bookly-custom-field-error)").html("")};l.enabled&&m.intlTelInput({preferredCountries:[l.country],initialCountry:l.country,geoIpLookup:function(t){V.get("https://ipinfo.io",function(){},"jsonp").always(function(e){var o=e&&e.country?e.country:"";t(o)})},utilsScript:l.utils}),V("body > .bookly-js-modal."+G.form_id).remove(),n.addClass(G.form_id).appendTo("body").on("click",".bookly-js-close",function(e){e.preventDefault(),V(e.delegateTarget).removeClass("bookly-in").find("form").trigger("reset").end().find("input").removeClass("bookly-error").end().find(".bookly-label-error").html("")}),V(".bookly-js-login-show",K).on("click",function(e){e.preventDefault(),J.addClass("bookly-in")}),V("button:submit",J).on("click",function(e){e.preventDefault();var o=Ladda.create(this);o.start(),V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:{action:"bookly_wp_user_login",csrf_token:BooklyL10n.csrf_token,form_id:G.form_id,log:J.find('[name="log"]').val(),pwd:J.find('[name="pwd"]').val(),rememberme:J.find('[name="rememberme"]').prop("checked")?1:0},dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success?(BooklyL10n.csrf_token=e.data.csrf_token,t.fadeOut("slow"),W(e),J.removeClass("bookly-in")):"incorrect_username_password"==e.error&&(J.find("input").addClass("bookly-error"),J.find(".bookly-label-error").html(ee[G.form_id].errors[e.error])),o.stop()}})}),V("button:submit",$).on("click",function(e){e.preventDefault(),$.removeClass("bookly-in"),A.trigger("click",[1])}),ee[G.form_id].hasOwnProperty("facebook")&&ee[G.form_id].facebook.enabled&&(FB.XFBML.parse(V(".bookly-js-fb-login-button",K).parent().get(0)),ee[G.form_id].facebook.onStatusChange=function(e){"connected"===e.status&&(ee[G.form_id].facebook.enabled=!1,ee[G.form_id].facebook.onStatusChange=void 0,t.fadeOut("slow",function(){V(".bookly-js-fb-login-button").hide()}),FB.api("/me",{fields:"id,name,first_name,last_name,email"},function(e){V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:V.extend(e,{action:"bookly_pro_facebook_login",csrf_token:BooklyL10n.csrf_token,form_id:G.form_id}),dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success&&W(e)}})}))}),A.on("click",function(e,o){e.preventDefault();var a,t=[],s={},i=[],r=oe(this);V("div.bookly-js-info-field-row",K).each(function(){var e=V(this);switch(e.data("type")){case"text-field":t.push({id:e.data("id"),value:e.find("input.bookly-js-info-field").val()});break;case"textarea":t.push({id:e.data("id"),value:e.find("textarea.bookly-js-info-field").val()});break;case"checkboxes":a=[],e.find("input.bookly-js-info-field:checked").each(function(){a.push(this.value)}),t.push({id:e.data("id"),value:a});break;case"radio-buttons":t.push({id:e.data("id"),value:e.find("input.bookly-js-info-field:checked").val()||null});break;case"drop-down":t.push({id:e.data("id"),value:e.find("select.bookly-js-info-field").val()})}}),V(".bookly-custom-fields-container",K).each(function(){var e=V(this),o=e.data("key"),t=[];V("div.bookly-custom-field-row",e).each(function(){var e=V(this);switch(e.data("type")){case"text-field":case"file":t.push({id:e.data("id"),value:e.find("input.bookly-custom-field").val()});break;case"textarea":t.push({id:e.data("id"),value:e.find("textarea.bookly-custom-field").val()});break;case"checkboxes":a=[],e.find("input.bookly-custom-field:checked").each(function(){a.push(this.value)}),t.push({id:e.data("id"),value:a});break;case"radio-buttons":t.push({id:e.data("id"),value:e.find("input.bookly-custom-field:checked").val()||null});break;case"drop-down":t.push({id:e.data("id"),value:e.find("select.bookly-custom-field").val()});break;case"captcha":t.push({id:e.data("id"),value:e.find("input.bookly-custom-field").val()}),i.push(e.data("id"))}}),s[o]={custom_fields:JSON.stringify(t)}});try{""==(f=l.enabled?m.intlTelInput("getNumber"):m.val())&&(f=m.val())}catch(e){f=m.val()}var n={action:"bookly_session_save",csrf_token:BooklyL10n.csrf_token,form_id:G.form_id,full_name:F.val(),first_name:R.val(),last_name:E.val(),phone:f,email:y.val(),email_confirm:_.val(),birthday:{day:u.val(),month:p.val(),year:k.val()},country:h.val(),state:b.val(),postcode:v.val(),city:j.val(),street:g.val(),street_number:w.val(),additional_address:x.val(),address_iso:{country:h.data("short"),state:b.data("short")},info_fields:t,notes:H.val(),cart:s,captcha_ids:JSON.stringify(i),force_update_customer:!d||o};V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:n,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(o){if(U.empty(),Q.removeClass("bookly-error"),o.success)if(c.enabled){var e={action:"bookly_pro_add_to_woocommerce_cart",csrf_token:BooklyL10n.csrf_token,form_id:G.form_id};V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:e,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success?window.location.href=c.cart_url:(r.stop(),ne({form_id:G.form_id},ee[G.form_id].errors[e.error]))}})}else se({form_id:G.form_id});else{var i=null;if(o.appointments_limit_reached)ae({form_id:G.form_id,error:"appointments_limit_reached"});else{r.stop();[{name:"full_name",errorElement:N,formElement:F},{name:"first_name",errorElement:Y,formElement:R},{name:"last_name",errorElement:Z,formElement:E},{name:"phone",errorElement:X,formElement:m},{name:"email",errorElement:I,formElement:y},{name:"email_confirm",errorElement:z,formElement:_},{name:"birthday_day",errorElement:M,formElement:u},{name:"birthday_month",errorElement:q,formElement:p},{name:"birthday_year",errorElement:P,formElement:k},{name:"country",errorElement:C,formElement:h},{name:"state",errorElement:L,formElement:b},{name:"postcode",errorElement:B,formElement:v},{name:"city",errorElement:T,formElement:j},{name:"street",errorElement:D,formElement:g},{name:"street_number",errorElement:S,formElement:w},{name:"additional_address",errorElement:O,formElement:x}].forEach(function(e){o[e.name]&&(e.errorElement.html(o[e.name]),e.formElement.addClass("bookly-error"),null===i&&(i=e.formElement))}),o.info_fields&&V.each(o.info_fields,function(e,o){var t=V('div.bookly-js-info-field-row[data-id="'+e+'"]',K);t.find(".bookly-js-info-field-error").html(o),t.find(".bookly-js-info-field").addClass("bookly-error"),null===i&&(i=t.find(".bookly-js-info-field"))}),o.custom_fields&&V.each(o.custom_fields,function(s,e){V.each(e,function(e,o){var t=V('.bookly-custom-fields-container[data-key="'+s+'"]',K),a=V('[data-id="'+e+'"]',t);a.find(".bookly-custom-field-error").html(o),a.find(".bookly-custom-field").addClass("bookly-error"),null===i&&(i=a.find(".bookly-custom-field"))})}),o.customer&&$.find(".bookly-js-modal-body").html(o.customer).end().addClass("bookly-in")}null!==i&&te(i)}}})}),V(".bookly-js-back-step",K).on("click",function(e){e.preventDefault(),oe(this),ee[G.form_id].skip_steps.cart?ee[G.form_id].no_time?ee[G.form_id].no_extras?de({form_id:G.form_id}):le({form_id:G.form_id}):ee[G.form_id].skip_steps.repeat?ee[G.form_id].skip_steps.extras||"after_step_time"!=ee[G.form_id].step_extras||ee[G.form_id].no_extras?ne({form_id:G.form_id}):le({form_id:G.form_id}):re({form_id:G.form_id}):ie({form_id:G.form_id})}),V(".bookly-js-captcha-refresh",K).on("click",function(){s.css("opacity","0.5"),V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:{action:"bookly_custom_fields_captcha_refresh",form_id:G.form_id,csrf_token:BooklyL10n.csrf_token},dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success&&s.attr("src",e.data.captcha_url).on("load",function(){s.css("opacity","1")})}})})}}})}function ie(o,t){if(ee[o.form_id].skip_steps.cart)S(o);else{o&&o.from_step&&(ee[o.form_id].cart_prev_step=o.from_step);var e=V.extend({action:"bookly_render_cart",csrf_token:BooklyL10n.csrf_token},o),s=ee[o.form_id].$container;V.ajax({url:BooklyL10n.ajaxurl,data:e,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success&&(s.html(e.html),t?(V(".bookly-label-error",s).html(t.message),V('tr[data-cart-key="'+t.failed_key+'"]',s).addClass("bookly-label-error")):V(".bookly-label-error",s).hide(),te(s),V(".bookly-js-next-step",s).on("click",function(){oe(this),S({form_id:o.form_id})}),V(".bookly-add-item",s).on("click",function(){oe(this),de({form_id:o.form_id,new_chain:!0})}),V(".bookly-js-back-step",s).on("click",function(e){switch(e.preventDefault(),oe(this),ee[o.form_id].cart_prev_step){case"service":de({form_id:o.form_id});break;case"extras":le({form_id:o.form_id});break;case"time":ne({form_id:o.form_id});break;case"repeat":re({form_id:o.form_id});break;default:de({form_id:o.form_id})}}),V(".bookly-js-actions button",s).on("click",function(){oe(this);var e=V(this),a=e.closest("tr");switch(e.data("action")){case"drop":V.ajax({url:BooklyL10n.ajaxurl,data:{action:"bookly_cart_drop_item",csrf_token:BooklyL10n.csrf_token,form_id:o.form_id,cart_key:a.data("cart-key")},dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){if(e.success){var o=a.data("cart-key"),t=V('tr[data-cart-key="'+o+'"]',s);a.delay(300).fadeOut(200,function(){e.data.total_waiting_list?(V(".bookly-js-waiting-list-price",s).html(e.data.waiting_list_price),V(".bookly-js-waiting-list-deposit",s).html(e.data.waiting_list_deposit)):V(".bookly-js-waiting-list-price",s).closest("tr").remove(),V(".bookly-js-subtotal-price",s).html(e.data.subtotal_price),V(".bookly-js-subtotal-deposit",s).html(e.data.subtotal_deposit),V(".bookly-js-pay-now-deposit",s).html(e.data.pay_now_deposit),V(".bookly-js-pay-now-tax",s).html(e.data.pay_now_tax),V(".bookly-js-total-price",s).html(e.data.total_price),V(".bookly-js-total-tax",s).html(e.data.total_tax),t.remove(),0==V("tr[data-cart-key]").length&&(V(".bookly-js-back-step",s).hide(),V(".bookly-js-next-step",s).hide())})}}});break;case"edit":de({form_id:o.form_id,edit_cart_item:a.data("cart-key")})}}))}})}}function re(M,e){if(ee[M.form_id].skip_steps.repeat)ie(M,e);else{var o=V.extend({action:"bookly_render_repeat",csrf_token:BooklyL10n.csrf_token},M),q=ee[M.form_id].$container;V.ajax({url:BooklyL10n.ajaxurl,data:o,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){if(e.success){q.html(e.html),te(q);var o=V(".bookly-js-repeat-appointment-enabled",q),f=V(".bookly-js-next-step",q),t=V(".bookly-js-repeat-variants-container",q),a=V('[class^="bookly-js-variant"]',t),s=V(".bookly-js-repeat-variant",t),i=V(".bookly-js-get-schedule",t),r=V(".bookly-js-variant-weekly",t),n=V(".bookly-js-repeat-variant-monthly",t),l=V(".bookly-js-repeat-until",t),d=V(".bookly-js-repeat-times",t),c=V(".bookly-js-monthly-specific-day",t),m=V(".bookly-js-monthly-week-day",t),y=V(".bookly-js-repeat-daily-every",t),_=V(".bookly-js-week-day",t),u=V(".bookly-js-schedule-container",q),p=V(".bookly-js-days-error",t),k=V(".bookly-js-schedule-slots",u),h=V(".bookly-js-intersection-info",u),b=V(".bookly-js-schedule-help",u),v=V(".bookly-well",u),j=V(".bookly-pagination",u),g=V(".bookly-schedule-row-template .bookly-schedule-row",u),w=e.pages_warning_info,x=e.short_date_format,C={min:e.date_min||!0,max:e.date_max||!0},L=[],B={prepareButtonNextState:function(){for(var e=f.prop("disabled"),o=0==L.length,t=0;t<L.length;t++)if(e){if(!L[t].deleted){o=!1;break}}else{if(!L[t].deleted){o=!1;break}o=!0}f.prop("disabled",o)},addTimeSlotControl:function(e,o,a,s){var i,r="";o.length&&(r=V("<select/>"),V.each(o,function(e,o){var t=V("<option/>");t.text(o.title).val(o.value),o.disabled&&t.attr("disabled","disabled"),r.append(t),i||o.disabled||(o.title==a?(r.val(o.value),i=!0):o.title==s&&r.val(o.value))}));e.find(".bookly-js-schedule-time").html(r),e.find("div.bookly-label-error").toggle(!o.length)},renderSchedulePage:function(e){var o,t=L.length,a=5*e-5,s=[];k.html("");for(var i=a,r=0;r<5&&i<t;i++,r++)(o=g.clone()).data("datetime",L[i].datetime),o.data("index",L[i].index),V("> div:first-child",o).html(L[i].index),V(".bookly-schedule-date",o).html(L[i].display_date),void 0!==L[i].all_day_service_time?(V(".bookly-js-schedule-time",o).hide(),V(".bookly-js-schedule-all-day-time",o).html(L[i].all_day_service_time).show()):(V(".bookly-js-schedule-time",o).html(L[i].display_time).show(),V(".bookly-js-schedule-all-day-time",o).hide()),L[i].another_time&&V(".bookly-schedule-intersect",o).show(),L[i].deleted&&o.find(".bookly-schedule-appointment").addClass("bookly-appointment-hidden"),k.append(o);if(5<t){var n=V("<li/>").html("«");for(n.on("click",function(){var e=parseInt(j.find(".active").html());1<e&&B.renderSchedulePage(e-1)}),j.html(n),i=0,r=1;i<t;i+=5,r++)n=V("<li/>").html(r),j.append(n),n.on("click",function(){B.renderSchedulePage(V(this).html())});for(j.find("li:eq("+e+")").addClass("active"),(n=V("<li/>").html("»")).on("click",function(){var e=parseInt(j.find(".active").html());e<t/5&&B.renderSchedulePage(e+1)}),j.append(n).show(),i=0;i<t;i++)L[i].another_time&&(e=parseInt(i/5)+1,s.push(e),i=5*e-1);0<s.length&&h.html(w.replace("{list}",s.join(", "))),v.toggle(0<s.length),j.toggle(5<t)}else for(j.hide(),v.hide(),i=0;i<t;i++)if(L[i].another_time){b.show();break}},renderFullSchedule:function(e){L=e;var c=null;V.each(L,function(e,o){c||o.another_time||(c=o.display_time)}),B.renderSchedulePage(1),u.show(),f.prop("disabled",0==L.length),k.on("click","button[data-action]",function(){var o=V(this).closest(".bookly-schedule-row"),a=o.data("index")-1;switch(V(this).data("action")){case"drop":L[a].deleted=!0,o.find(".bookly-schedule-appointment").addClass("bookly-appointment-hidden"),B.prepareButtonNextState();break;case"restore":L[a].deleted=!1,o.find(".bookly-schedule-appointment").removeClass("bookly-appointment-hidden"),f.prop("disabled",!1);break;case"edit":var e=V('<input type="text"/>'),s=V(this),i=oe(this);o.find(".bookly-schedule-date").html(e),e.pickadate({min:C.min,max:C.max,formatSubmit:"yyyy-mm-dd",format:x,clear:!1,close:!1,today:BooklyL10n.today,monthsFull:BooklyL10n.months,weekdaysFull:BooklyL10n.days,weekdaysShort:BooklyL10n.daysShort,labelMonthNext:BooklyL10n.nextMonth,labelMonthPrev:BooklyL10n.prevMonth,firstDay:ee[M.form_id].start_of_week,onSet:function(){var t=[];V.each(L,function(e,o){a==e||o.deleted||t.push(o.slots)}),V.ajax({url:BooklyL10n.ajaxurl,type:"POST",data:{action:"bookly_recurring_appointments_get_daily_customer_schedule",csrf_token:BooklyL10n.csrf_token,date:this.get("select","yyyy-mm-dd"),form_id:M.form_id,exclude:t},dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){s.hide(),i.stop(),e.data.length?(B.addTimeSlotControl(o,e.data[0].options,c,L[a].display_time,e.data[0].all_day_service_time),o.find('button[data-action="save"]').show()):(B.addTimeSlotControl(o,[]),o.find('button[data-action="save"]').hide())}})}});var t=JSON.parse(L[a].slots);e.pickadate("picker").set("select",new Date(t[0][2]));break;case"save":V(this).hide(),o.find('button[data-action="edit"]').show();var r=o.find(".bookly-schedule-date"),n=o.find(".bookly-js-schedule-time"),l=n.find("select"),d=l.find("option:selected");L[a].slots=l.val(),L[a].display_date=r.find("input").val(),L[a].display_time=d.text(),r.html(L[a].display_date),n.html(L[a].display_time)}})},isDateMatchesSelections:function(e){switch(s.val()){case"daily":if((6<y.val()||-1!=V.inArray(e.format("ddd").toLowerCase(),B.week_days))&&e.diff(B.date_from,"days")%y.val()==0)return!0;break;case"weekly":case"biweekly":if(("weekly"==s.val()||e.diff(B.date_from.clone().startOf("isoWeek"),"weeks")%2==0)&&-1!=V.inArray(e.format("ddd").toLowerCase(),B.checked_week_days))return!0;break;case"monthly":switch(n.val()){case"specific":if(e.format("D")==c.val())return!0;break;case"last":if(e.format("ddd").toLowerCase()==m.val()&&e.clone().endOf("month").diff(e,"days")<7)return!0;break;default:var o=e.diff(e.clone().startOf("month"),"days");if(e.format("ddd").toLowerCase()==m.val()&&o>=7*(n.prop("selectedIndex")-1)&&o<7*n.prop("selectedIndex"))return!0}}return!1},updateRepeatDate:function(){var e=0,o=d.val(),t=C.min.slice(),a=l.pickadate("picker").get("select"),s=moment().year(a.year).month(a.month).date(a.date).add(5,"years");t[1]++,B.date_from=moment(t.join(","),"YYYY,M,D"),B.week_days=[],m.find("option").each(function(){B.week_days.push(V(this).val())}),B.checked_week_days=[],_.each(function(){V(this).prop("checked")&&B.checked_week_days.push(V(this).val())});for(var i=B.date_from.clone();B.isDateMatchesSelections(i)&&e++,i.add(1,"days"),e<o&&i.isBefore(s););l.val(i.subtract(1,"days").format("MMMM D, YYYY")),l.pickadate("picker").set("select",new Date(i.format("YYYY"),i.format("M")-1,i.format("D")))},updateRepeatTimes:function(){var e=0,o=C.min.slice(),t=l.pickadate("picker").get("select"),a=moment().year(t.year).month(t.month).date(t.date);o[1]++,B.date_from=moment(o.join(","),"YYYY,M,D"),B.week_days=[],m.find("option").each(function(){B.week_days.push(V(this).val())}),B.checked_week_days=[],_.each(function(){V(this).prop("checked")&&B.checked_week_days.push(V(this).val())});for(var s=B.date_from.clone();B.isDateMatchesSelections(s)&&e++,s.add(1,"days"),s.isBefore(a););d.val(e)}};l.pickadate({formatSubmit:"yyyy-mm-dd",format:ee[M.form_id].date_format,min:C.min,max:C.max,clear:!1,close:!1,today:BooklyL10n.today,monthsFull:BooklyL10n.months,weekdaysFull:BooklyL10n.days,weekdaysShort:BooklyL10n.daysShort,labelMonthNext:BooklyL10n.nextMonth,labelMonthPrev:BooklyL10n.prevMonth,firstDay:ee[M.form_id].start_of_week});var T=o.on("change",function(){t.toggle(V(this).prop("checked")),V(this).prop("checked")?B.prepareButtonNextState():f.prop("disabled",!1)});if(e.repeated){var D=e.repeat_data,S=D.params;o.prop("checked",!0),s.val(D.repeat);var O=D.until.split("-");switch(l.pickadate("set").set("select",new Date(O[0],O[1]-1,O[2])),D.repeat){case"daily":y.val(S.every);break;case"weekly":case"biweekly":V(".bookly-js-week-days input.bookly-js-week-day",t).prop("checked",!1).parent().removeClass("active"),S.on.forEach(function(e){V(".bookly-js-week-days input.bookly-js-week-day[value="+e+"]",t).prop("checked",!0).parent().addClass("active")});break;case"monthly":"day"===S.on?(n.val("specific"),V(".bookly-js-monthly-specific-day[value="+S.day+"]",t).prop("checked",!0)):(n.val(S.on),m.val(S.weekday))}B.renderFullSchedule(e.schedule)}T.trigger("change"),e.could_be_repeated||o.attr("disabled",!0),s.on("change",function(){a.hide(),t.find(".bookly-js-variant-"+this.value).show(),B.updateRepeatTimes()}).trigger("change"),n.on("change",function(){m.toggle("specific"!=this.value),c.toggle("specific"==this.value),B.updateRepeatTimes()}).trigger("change"),_.on("change",function(){var e=V(this);e.is(":checked")?e.parent().not("[class*='active']").addClass("active"):e.parent().removeClass("active"),B.updateRepeatTimes()}),c.val(e.date_min[2]),c.on("change",function(){B.updateRepeatTimes()}),m.on("change",function(){B.updateRepeatTimes()}),l.on("change",function(){B.updateRepeatTimes()}),y.on("change",function(){B.updateRepeatTimes()}),d.on("change",function(){B.updateRepeatDate()}),i.on("click",function(){u.hide();var e={action:"bookly_recurring_appointments_get_customer_schedule",csrf_token:BooklyL10n.csrf_token,form_id:M.form_id,repeat:s.val(),until:l.pickadate("picker").get("select","yyyy-mm-dd"),params:{}},o=oe(this);switch(e.repeat){case"daily":e.params={every:y.val()};break;case"weekly":case"biweekly":if(e.params.on=[],V(".bookly-js-week-days input.bookly-js-week-day:checked",r).each(function(){e.params.on.push(this.value)}),0==e.params.on.length)return p.toggle(!0),o.stop(),!1;p.toggle(!1);break;case"monthly":"specific"==n.val()?e.params={on:"day",day:c.val()}:e.params={on:n.val(),weekday:m.val()}}k.off("click"),V.ajax({url:BooklyL10n.ajaxurl,type:"POST",data:e,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success&&(B.renderFullSchedule(e.data),o.stop())}})}),V(".bookly-js-back-step",q).on("click",function(e){e.preventDefault(),oe(this),V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:{action:"bookly_session_save",csrf_token:BooklyL10n.csrf_token,form_id:M.form_id,unrepeat:1},dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){ee[M.form_id].skip_steps.extras||"after_step_time"!=ee[M.form_id].step_extras||ee[M.form_id].no_extras?ne({form_id:M.form_id}):le({form_id:M.form_id})}})}),V(".bookly-js-go-to-cart",q).on("click",function(e){e.preventDefault(),oe(this),ie({form_id:M.form_id,from_step:"repeat"})}),V(".bookly-js-next-step",q).on("click",function(e){if(oe(this),o.is(":checked")){var t=[],a=0;L.forEach(function(e){if(!e.deleted){var o=JSON.parse(e.slots);t=t.concat(o),a++}}),V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:{action:"bookly_session_save",csrf_token:BooklyL10n.csrf_token,form_id:M.form_id,slots:JSON.stringify(t),repeat:a},dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){ie({form_id:M.form_id,add_to_cart:!0,from_step:"repeat"})}})}else V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:{action:"bookly_session_save",csrf_token:BooklyL10n.csrf_token,form_id:M.form_id,unrepeat:1},dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){ie({form_id:M.form_id,add_to_cart:!0,from_step:"repeat"})}})})}}})}}var o=null;function ne(C,L){if(ee[C.form_id].no_time||ee[C.form_id].skip_steps.time)ee[C.form_id].skip_steps.extras||"after_step_time"!=ee[C.form_id].step_extras||ee[C.form_id].no_extras?ee[C.form_id].skip_steps.cart?S({form_id:C.form_id,add_to_cart:!0}):ie({form_id:C.form_id,add_to_cart:!0,from_step:C&&C.prev_step?C.prev_step:"service"}):le({form_id:C.form_id});else{var e={action:"bookly_render_time",csrf_token:BooklyL10n.csrf_token},B=ee[C.form_id].$container;ee[C.form_id].skip_steps.service&&ee[C.form_id].use_client_time_zone&&(e.time_zone=ee[C.form_id].timeZone,e.time_zone_offset=ee[C.form_id].timeZoneOffset),V.extend(e,C),o=V.ajax({url:BooklyL10n.ajaxurl,data:e,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){if(0!=e.success){BooklyL10n.csrf_token=e.csrf_token,B.html(e.html);var m,y,_,u=V(".bookly-columnizer-wrap",B),p=V(".bookly-columnizer",u),i=V(".bookly-time-next",B),a=V(".bookly-time-prev",B),k=null,h=e.time_slots_wide?205:127,b=e.time_slots_wide?"bookly-column bookly-column-wide":"bookly-column",v=0,r=0,j=e.has_more_slots,g=!1,o=e.show_calendar,n=e.is_rtl,w=e.day_one_column,t=T(e.slots_data,e.selected_date);if(V(".bookly-js-back-step",B).on("click",function(e){e.preventDefault(),oe(this),ee[C.form_id].skip_steps.extras||ee[C.form_id].no_extras?de({form_id:C.form_id}):"before_step_time"==ee[C.form_id].step_extras?le({form_id:C.form_id}):de({form_id:C.form_id})}).toggle(!ee[C.form_id].skip_steps.service||!ee[C.form_id].skip_steps.extras),V(".bookly-js-go-to-cart",B).on("click",function(e){e.preventDefault(),oe(this),ie({form_id:C.form_id,from_step:"time"})}),V(".bookly-js-time-zone-switcher",B).on("change",function(e){ee[C.form_id].timeZone=this.value,ee[C.form_id].timeZoneOffset=void 0,f(),D(),ne({form_id:C.form_id,time_zone:ee[C.form_id].timeZone})}),o){var s=V(".bookly-js-selected-date",B);s.pickadate({formatSubmit:"yyyy-mm-dd",format:ee[C.form_id].date_format,min:e.date_min||!0,max:e.date_max||!0,weekdaysFull:BooklyL10n.days,weekdaysShort:BooklyL10n.daysShort,monthsFull:BooklyL10n.months,firstDay:ee[C.form_id].start_of_week,clear:!1,close:!1,today:!1,disable:e.disabled_days,closeOnSelect:!1,klass:{picker:"picker picker--opened picker--focused"},onSet:function(e){if(e.select){var o=this.get("select","yyyy-mm-dd");t[o]?(p.html(t[o]).css("left","0px"),r=v=0,k=null,x(),a.hide(),i.toggle(1!=m.length)):(D(),ne({form_id:C.form_id,selected_date:o}),f())}this.open()},onClose:function(){this.open(!1)},onRender:function(){var e=new Date(Date.UTC(this.get("view").year,this.get("view").month));V(".picker__nav--next",B).on("click",function(){e.setUTCMonth(e.getUTCMonth()+1),D(),ne({form_id:C.form_id,selected_date:e.toJSON().substr(0,10)}),f()}),V(".picker__nav--prev",B).on("click",function(){e.setUTCMonth(e.getUTCMonth()-1),D(),ne({form_id:C.form_id,selected_date:e.toJSON().substr(0,10)}),f()})}});var l=s.pickadate("picker").get("select","yyyy-mm-dd");p.html(t[l])}else{var d="";V.each(t,function(e,o){d+=o}),p.html(d)}if(e.has_slots){L?B.find(".bookly-label-error").html(L):B.find(".bookly-label-error").hide(),(y=parseInt(V(window).height()/36,10))<4?y=4:10<y&&(y=10),10<(_=parseInt(u.width()/h,10))?_=10:0==_&&(g=!0,_=4),x(),j||1!=m.length||i.hide();var c=V(".bookly-time-step",B).hammer({swipe_velocity:.1});c.on("swipeleft",function(){i.is(":visible")&&i.trigger("click")}),c.on("swiperight",function(){a.is(":visible")&&a.trigger("click")}),i.on("click",function(e){if(a.show(),m.eq(r+1).length)p.animate({left:(n?"+":"-")+(r+1)*k.width()},{duration:800}),k=m.eq(++r),u.animate({height:k.height()},{duration:800}),r+1!=m.length||j||i.hide();else if(j){var o=V("> button:last",p);0==o.length&&0==(o=V(".bookly-column:hidden:last > button:last",p)).length&&(o=V(".bookly-column:last > button:last",p));var t={action:"bookly_render_next_time",csrf_token:BooklyL10n.csrf_token,form_id:C.form_id,last_slot:o.val()},s=oe(this);V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:t,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){if(e.success)if(e.has_slots){j=e.has_more_slots;var t="";V.each(T(e.slots_data,e.selected_date),function(e,o){t+=o});var o=V(t),a=o.eq(0);V('button.bookly-day[value="'+a.attr("value")+'"]',B).length&&(o=o.not(":first")),p.append(o),x(),i.trigger("click")}else i.hide();else i.hide();s.stop()}})}}),a.on("click",function(){i.show(),k=m.eq(--r),p.animate({left:(n?"+":"-")+r*k.width()},{duration:800}),u.animate({height:k.height()},{duration:800}),0===r&&a.hide()})}void 0===C&&te(B)}else de({form_id:C.form_id});function f(){V(".bookly-time-screen,.bookly-not-time-screen",B).addClass("bookly-spin-overlay");var e={lines:11,length:11,width:4,radius:5};m?new Spinner(e).spin(m.eq(r).get(0)):new Spinner(e).spin(V(".bookly-not-time-screen",B).get(0))}function x(){var e,o,t,a=V("> button",p),s=0,i=0;if(w)for(;0<a.length;)a.eq(0).hasClass("bookly-day")?(s=1,o=V('<div class="'+b+'" />'),(e=V(a.splice(0,1))).addClass("bookly-js-first-child"),o.append(e)):(s++,e=V(a.splice(0,1)),!a.length||a.eq(0).hasClass("bookly-day")?(e.addClass("bookly-last-child"),o.append(e),p.append(o)):o.append(e)),i<s&&(i=s);else for(;j?a.length>y:a.length;){o=V('<div class="'+b+'" />'),i=y,v%_!=0||a.eq(0).hasClass("bookly-day")||--i;for(var r=0;r<i&&(r+1!=i||!a.eq(0).hasClass("bookly-day"));++r)e=V(a.splice(0,1)),0==r?e.addClass("bookly-js-first-child"):r+1==i&&e.addClass("bookly-last-child"),o.append(e);p.append(o),++v}for(var n=V("> .bookly-column",p);j?n.length>=_:n.length;){t=V('<div class="bookly-time-screen"/>');for(r=0;r<_;++r){if(o=V(n.splice(0,1)),0==r){o.addClass("bookly-js-first-column");var l=o.find(".bookly-js-first-child");if(!l.hasClass("bookly-day")){var d=l.data("group"),c=V('button.bookly-day[value="'+d+'"]:last',B);o.prepend(c.clone())}}t.append(o)}p.append(t)}m=V(".bookly-time-screen",p),null===k&&(k=m.eq(0)),V("button.bookly-time-skip",B).off("click").on("click",function(e){oe(this),ee[C.form_id].skip_steps.cart?S({form_id:C.form_id,add_to_cart:!0}):ie({form_id:C.form_id,add_to_cart:!0,from_step:"time"})});var f=null;V("button.bookly-hour",B).off("click").on("click",function(e){null!=f&&(f.abort(),f=null),e.preventDefault();var o=V(this),t={action:"bookly_session_save",csrf_token:BooklyL10n.csrf_token,form_id:C.form_id,slots:this.value};o.attr({"data-style":"zoom-in","data-spinner-color":"#333","data-spinner-size":"40"}),oe(this),f=V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:t,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){ee[C.form_id].skip_steps.extras||"after_step_time"!=ee[C.form_id].step_extras||ee[C.form_id].no_extras?ee[C.form_id].skip_steps.repeat?ee[C.form_id].skip_steps.cart?S({form_id:C.form_id,add_to_cart:!0}):ie({form_id:C.form_id,add_to_cart:!0,from_step:"time"}):re({form_id:C.form_id}):le({form_id:C.form_id})}})}),V(".bookly-time-step",B).width(_*h),u.height(g?39*V(".bookly-column.bookly-js-first-column button",k).length:k.height()),g=!1}}})}function T(e,s){var o={};return V.each(e,function(t,e){var a='<button class="bookly-day" value="'+t+'">'+e.title+"</button>";V.each(e.slots,function(e,o){a+='<button value="'+JSON.stringify(o.data).replace(/"/g,"&quot;")+'" data-group="'+t+'" class="bookly-hour'+("waiting-list"==o.status?" bookly-slot-in-waiting-list":"booked"==o.status?" booked":"")+'"'+("booked"==o.status?" disabled":"")+'><span class="ladda-label bookly-time-main'+(o.data[0][2]==s?" bookly-bold":"")+'"><i class="bookly-hour-icon"><span></span></i>'+o.time_text+'</span><span class="bookly-time-additional'+("waiting-list"==o.status?" bookly-waiting-list":"")+'"> '+o.additional_text+"</span></button>"}),o[t]=a}),o}function D(){null!=o&&(o.abort(),o=null)}}function le(c){var e={action:"bookly_render_extras",csrf_token:BooklyL10n.csrf_token},f=ee[c.form_id].$container;ee[c.form_id].skip_steps.service&&ee[c.form_id].use_client_time_zone&&(e.time_zone=ee[c.form_id].timeZone,e.time_zone_offset=ee[c.form_id].timeZoneOffset),V.extend(e,c),V.ajax({url:BooklyL10n.ajaxurl,data:e,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){if(e.success){BooklyL10n.csrf_token=e.csrf_token,f.html(e.html),void 0===c&&te(f);var s,i,o=V(".bookly-js-next-step",f),t=V(".bookly-js-back-step",f),a=V(".bookly-js-go-to-cart",f),r=V(".bookly-js-extras-item",f),n=V(".bookly-js-extras-summary span",f),l=e.currency,d=function(e,o){var t=e.find("input"),a=e.find(".bookly-js-extras-total-price"),s=o*parseFloat(e.data("price"));a.text(l.format.replace("1",s.toFixed(l.precision))),t.val(o),e.find(".bookly-js-extras-thumb").toggleClass("bookly-extras-selected",0<o);var i=0;r.each(function(e,o){var t=V(this),a=t.closest(".bookly-js-extras-container").data("multiplier");i+=parseFloat(t.data("price"))*t.find("input").val()*a}),i?n.html(" + "+l.format.replace("1",i.toFixed(l.precision))):n.html("")};r.each(function(e,o){var t=V(this),a=t.find("input");t.find(".bookly-js-extras-thumb").on("click",function(){d(t,0<a.val()?0:1)}),t.find(".bookly-js-count-control").on("click",function(){var e=parseInt(a.val());e=V(this).hasClass("bookly-js-extras-increment")?Math.min(t.data("max_quantity"),e+1):Math.max(0,e-1),d(t,e)})}),a.on("click",function(e){e.preventDefault(),oe(this),ie({form_id:c.form_id,from_step:"extras"})}),o.on("click",function(e){e.preventDefault(),oe(this);var a={};V(".bookly-js-extras-container",f).each(function(){var e=V(this),o=e.data("chain"),t={};e.find(".bookly-js-extras-item").each(function(e,o){s=V(this),0<(i=s.find("input")).val()&&(t[s.data("id")]=i.val())}),a[o]=JSON.stringify(t)}),V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:{action:"bookly_session_save",csrf_token:BooklyL10n.csrf_token,form_id:c.form_id,extras:a},dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){"before_step_time"==ee[c.form_id].step_extras?ne({form_id:c.form_id,prev_step:"extras"}):ee[c.form_id].skip_steps.repeat?ee[c.form_id].skip_steps.cart?S({form_id:c.form_id,add_to_cart:!0}):ie({form_id:c.form_id,add_to_cart:!0,from_step:"time"}):re({form_id:c.form_id})}})}),t.on("click",function(e){e.preventDefault(),oe(this),"after_step_time"!=ee[c.form_id].step_extras||ee[c.form_id].no_time?de({form_id:c.form_id}):ne({form_id:c.form_id,prev_step:"extras"})})}}})}function de(q){if(ee[q.form_id].skip_steps.service)ee[q.form_id].skip_steps.extras||"before_step_time"!=ee[q.form_id].step_extras?ne(q):le(q);else{var e={action:"bookly_render_service",csrf_token:BooklyL10n.csrf_token},P=ee[q.form_id].$container;ee[q.form_id].use_client_time_zone&&(e.time_zone=ee[q.form_id].timeZone,e.time_zone_offset=ee[q.form_id].timeZoneOffset),V.extend(e,q),V.ajax({url:BooklyL10n.ajaxurl,data:e,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){if(e.success){BooklyL10n.csrf_token=e.csrf_token,P.html(e.html),void 0===q&&te(P);var a=V(".bookly-js-chain-item.bookly-js-draft",P),o=V(".bookly-js-select-location",P),t=V(".bookly-js-select-category",P),s=V(".bookly-js-select-service",P),i=V(".bookly-js-select-employee",P),r=V(".bookly-js-select-units-duration",P),n=V(".bookly-js-select-number-of-persons",P),l=V(".bookly-js-select-quantity",P),d=V(".bookly-js-date-from",P),c=V(".bookly-js-week-day",P),f=V(".bookly-js-select-time-from",P),m=V(".bookly-js-select-time-to",P),y=V(".bookly-js-next-step",P),_=V(".bookly-js-mobile-next-step",P),u=V(".bookly-js-mobile-prev-step",P),h=e.locations,b=e.categories,v=e.services,j=e.staff,p=e.chain,k=e.required,g=ee[q.form_id].defaults,w=e.services_per_location,x=0,C=!1,L=e.service_name_with_duration,B=e.show_ratings;d.pickadate({formatSubmit:"yyyy-mm-dd",format:ee[q.form_id].date_format,min:e.date_min||!0,max:e.date_max||!0,clear:!1,close:!1,today:BooklyL10n.today,monthsFull:BooklyL10n.months,weekdaysFull:BooklyL10n.days,weekdaysShort:BooklyL10n.daysShort,labelMonthNext:BooklyL10n.nextMonth,labelMonthPrev:BooklyL10n.prevMonth,firstDay:ee[q.form_id].start_of_week,onSet:function(e){if(V.isNumeric(e.select)){var o=new Date(e.select);V('.bookly-js-week-day[value="'+(o.getDay()+1)+'"]:not(:checked)',P).attr("checked",!0).trigger("change")}}}),V(".bookly-js-go-to-cart",P).on("click",function(e){e.preventDefault(),oe(this),ie({form_id:q.form_id,from_step:"service"})});var T=function(e,o,t){V('option:not([value=""])',e).remove();var a,s=document.createDocumentFragment();o=(a=o,Object.keys(a).map(function(e){return a[e]})).sort(function(e,o){return parseInt(e.pos)<parseInt(o.pos)?-1:parseInt(e.pos)>parseInt(o.pos)?1:0}),V.each(o,function(e,o){var t=document.createElement("option");t.value=o.id,t.text=o.name,s.appendChild(t)}),e.append(s),e.find('option[value="'+t+'"]').length&&e.val(t)},D=function(e,o,s,i,t){var r=w&&o?o:0,n={},a={},l={},d={},c=null,f=null;if(V.each(j,function(t,a){o&&!h[o].staff.hasOwnProperty(t)||(i?a.services.hasOwnProperty(i)&&V.each(a.services[i].locations,function(e,o){if(r&&r!=e)return!0;f=f?Math.min(f,o.min_capacity):o.min_capacity,c=c?Math.max(c,o.max_capacity):o.max_capacity,n[t]={id:t,name:a.name+(null==o.price||!r&&w?"":" ("+o.price+")"),pos:a.pos}}):s?V.each(a.services,function(e){if(v[e].category_id==s)return n[t]=V.extend({},a),!1}):n[t]=V.extend({},a))}),o){var m=[],y=[];w?V.each(j,function(o){V.each(j[o].services,function(e){j[o].services[e].locations.hasOwnProperty(r)&&(m.push(v[e].category_id),y.push(e))})}):V.each(h[o].staff,function(e){V.each(j[e].services,function(e){m.push(v[e].category_id),y.push(e)})}),V.each(b,function(e,o){-1<V.inArray(parseInt(e),m)&&(l[e]=o)}),V.each(v,function(e,o){-1<V.inArray(e,y)&&(s&&o.category_id!=s||t&&!j[t].services.hasOwnProperty(e)||(a[e]=o))})}else l=b,V.each(v,function(e,o){s&&o.category_id!=s||t&&!j[t].services.hasOwnProperty(e)||(a[e]=o)});for(var _=V(".bookly-js-select-number-of-persons",e).val()||1,u=i?t?j[t].services[i].locations.hasOwnProperty(r)?j[t].services[i].locations[r].max_capacity:1:c||1:1,p=i?t?j[t].services[i].locations.hasOwnProperty(r)?j[t].services[i].locations[r].min_capacity:1:f||1:1,k=p;k<=u;++k)d[k]={id:k,name:k,pos:k};u<_&&(_=u),(_<p||!ee[q.form_id].form_attributes.show_number_of_persons)&&(_=p),B&&V.each(j,function(e,o){n.hasOwnProperty(o.id)&&(i?o.services.hasOwnProperty(i)&&o.services[i].rating&&(n[o.id].name="★"+o.services[i].rating+" "+n[o.id].name):o.rating&&(n[o.id].name="★"+o.rating+" "+n[o.id].name))}),T(e.find(".bookly-js-select-category"),l,s),T(e.find(".bookly-js-select-service"),a,i),T(e.find(".bookly-js-select-employee"),n,t),T(e.find(".bookly-js-select-number-of-persons"),d,_)};P.off("click").off("change"),P.on("change",".bookly-js-select-location",function(){var e=V(this).closest(".bookly-js-chain-item"),o=this.value,t=e.find(".bookly-js-select-category").val(),a=e.find(".bookly-js-select-service").val(),s=e.find(".bookly-js-select-employee").val();if(o){var i=w?o:0;if(s&&(h[o].staff.hasOwnProperty(s)?a&&!j[s].services[a].locations.hasOwnProperty(i)&&(s=""):s=""),a){var r=!1;V.each(h[o].staff,function(e){if(j[e].services.hasOwnProperty(a)&&j[e].services[a].locations.hasOwnProperty(i))return!(r=!0)}),r||(a="")}if(t){r=!1;V.each(h[o].staff,function(e){if(V.each(j[e].services,function(e){if(v[e].category_id==t)return!(r=!0)}),r)return!1}),r||(t="")}}D(e,o,t,a,s),S(e,a,s,o)}),P.on("change",".bookly-js-select-category",function(){var e=V(this).closest(".bookly-js-chain-item"),o=e.find(".bookly-js-select-location").val(),t=this.value,a=e.find(".bookly-js-select-service").val(),s=e.find(".bookly-js-select-employee").val();if(t){if(C=!0,a&&v[a].category_id!=t&&(a=""),s){var i=!1;V.each(j[s].services,function(e){if(v[e].category_id==t)return!(i=!0)}),i||(s="")}}else C=!1;D(e,o,t,a,s)});var S=function(e,a,o,s){var t=e.find(".bookly-js-select-units-duration"),i=t.val();if(t.find("option").remove(),a){V.each(function(e){if(!e||w&&!s)return v[a].hasOwnProperty("units")?v[a].units:[{value:"",title:"-"}];var o=s||0,t=j[e].services[a].locations;return void 0===t?[{value:"",title:"-"}]:(t.hasOwnProperty(o)?t[o]:t[0]).units||[{value:"",title:"-"}]}(o),function(e,o){t.append(V("<option>",{value:o.value,text:o.title}))}),0!=t.find('option[value="'+i+'"]').length&&t.val(i)}else t.append(V("<option>",{value:"",text:"-"}))};if(P.on("change",".bookly-js-select-service",function(){var e=V(this).closest(".bookly-js-chain-item"),o=e.find(".bookly-js-select-location").val(),t=C?e.find(".bookly-js-select-category").val():"",a=this.value,s=e.find(".bookly-js-select-employee").val();a&&s&&!j[s].services.hasOwnProperty(a)&&(s=""),D(e,o,t,a,s),a&&e.find(".bookly-js-select-category").val(v[a].category_id),S(e,a,s,o)}),P.on("change",".bookly-js-select-employee",function(){var e=V(this).closest(".bookly-js-chain-item"),o=e.find(".bookly-js-select-location").val(),t=V(".bookly-js-select-category",e).val(),a=e.find(".bookly-js-select-service").val(),s=this.value;D(e,o,t,a,s),S(e,a,s,o)}),L&&V.each(v,function(e,o){o.name=o.name+" ( "+o.duration+" )"}),T(o,h),T(t,b),T(s,v),B){var O={};V.each(j,function(e,o){O[e]=V.extend({},o),o.rating&&(O[e].name="★"+o.rating+" "+O[e].name)}),T(i,O)}else T(i,j);o.closest(".bookly-form-group").toggle(!ee[q.form_id].form_attributes.hide_locations),t.closest(".bookly-form-group").toggle(!ee[q.form_id].form_attributes.hide_categories),s.closest(".bookly-form-group").toggle(!(ee[q.form_id].form_attributes.hide_services&&g.service_id)),i.closest(".bookly-form-group").toggle(!ee[q.form_id].form_attributes.hide_staff_members),r.closest(".bookly-form-group").toggle(!ee[q.form_id].form_attributes.hide_service_duration),n.closest(".bookly-form-group").toggle(ee[q.form_id].form_attributes.show_number_of_persons),l.closest(".bookly-form-group").toggle(!ee[q.form_id].form_attributes.hide_quantity),g.location_id&&o.val(g.location_id).trigger("change"),g.category_id&&t.val(g.category_id).trigger("change"),g.service_id&&s.val(g.service_id).trigger("change"),g.staff_id&&i.val(g.staff_id).trigger("change"),ee[q.form_id].form_attributes.hide_date&&V(".bookly-js-available-date",P).hide(),ee[q.form_id].form_attributes.hide_week_days&&V(".bookly-js-week-days",P).hide(),ee[q.form_id].form_attributes.hide_time_range&&V(".bookly-js-time-range",P).hide(),V.each(p,function(e,o){var t=a.clone().data("chain_key",e).removeClass("bookly-js-draft").css("display","table");a.find("select").each(function(e,o){t.find("select:eq("+e+")").val(o.value)}),0==(x=e)&&t.find('.bookly-js-actions button[data-action="drop"]').remove(),V(".bookly-js-chain-item:last",P).after(t),!ee[q.form_id].form_attributes.hide_locations&&o.location_id&&V(".bookly-js-select-location",t).val(o.location_id).trigger("change"),o.service_id&&(V(".bookly-js-select-service",t).val(o.service_id).trigger("change"),ee[q.form_id].form_attributes.hide_categories&&(ee[q.form_id].form_attributes.hasOwnProperty("const_category_id")?V(".bookly-js-select-category",t).val(ee[q.form_id].form_attributes.const_category_id):V(".bookly-js-select-category",t).val(""))),!ee[q.form_id].form_attributes.hide_staff_members&&1==o.staff_ids.length&&o.staff_ids[0]&&V(".bookly-js-select-employee",t).val(o.staff_ids[0]).trigger("change"),1<o.number_of_persons&&V(".bookly-js-select-number-of-persons",t).val(o.number_of_persons),1<o.units&&V(".bookly-js-select-units-duration",t).val(o.units),1<o.quantity&&V(".bookly-js-select-quantity",t).val(o.quantity)}),P.on("click",".bookly-js-mobile-step-1 .bookly-js-add-chain",function(){var t=a.clone();a.find("select").each(function(e,o){t.find("select:eq("+e+")").val(o.value)}),V(".bookly-js-chain-item:last",P).after(t.data("chain_key",++x).removeClass("bookly-js-draft").css("display","table"))}),P.on("click",'.bookly-js-mobile-step-1 .bookly-js-actions button[data-action="drop"]',function(){V(this).closest(".bookly-js-chain-item").remove()}),c.on("change",function(){var e=V(this);e.is(":checked")?e.parent().not("[class*='active']").addClass("active"):e.parent().removeClass("active")}),f.on("change",function(){var e=V(this).val(),o=m.val(),t=V("option:last",f);m.empty(),f[0].selectedIndex<t.index()?V("option",this).each(function(){V(this).val()>e&&m.append(V(this).clone())}):m.append(t.clone()).val(t.val());var a=V("option:first",m).val();m.val(a<=o?o:a)});var M=function(){V(".bookly-js-select-service-error",P).hide(),V(".bookly-js-select-employee-error",P).hide(),V(".bookly-js-select-location-error",P).hide();var o=!0,t=null,a=null,s=null,i=null;return V(".bookly-js-chain-item:not(.bookly-js-draft)",P).each(function(){var e=V(this);t=V(".bookly-js-select-service",e),a=V(".bookly-js-select-employee",e),s=V(".bookly-js-select-location",e),t.removeClass("bookly-error"),a.removeClass("bookly-error"),s.removeClass("bookly-error"),t.val()||(o=!1,t.addClass("bookly-error"),V(".bookly-js-select-service-error",e).show(),i=t),k.hasOwnProperty("location")&&k.location&&!s.val()&&(o=!1,s.addClass("bookly-error"),V(".bookly-js-select-location-error",e).show(),i=s),k.staff&&!a.val()&&(o=!1,a.addClass("bookly-error"),V(".bookly-js-select-employee-error",e).show(),i=a)}),d.removeClass("bookly-error"),d.val()||(o=!1,d.addClass("bookly-error"),null===i&&(i=d)),V(".bookly-js-week-day:checked",P).length||(o=!1,null===i&&(i=c)),null!==i&&te(i),o};y.on("click",function(e){if(e.preventDefault(),M()){oe(this);var a={},s=0,i=0,r={required:2,optional:1,off:0};V(".bookly-js-chain-item:not(.bookly-js-draft)",P).each(function(){var e=V(this),o=[],t=v[V(".bookly-js-select-service",e).val()];V(".bookly-js-select-employee",e).val()?o.push(V(".bookly-js-select-employee",e).val()):V(".bookly-js-select-employee",e).find("option").each(function(){this.value&&o.push(this.value)}),a[e.data("chain_key")]={location_id:V(".bookly-js-select-location",e).val(),service_id:V(".bookly-js-select-service",e).val(),staff_ids:o,units:V(".bookly-js-select-units-duration",e).val()||1,number_of_persons:V(".bookly-js-select-number-of-persons",e).val()||1,quantity:V(".bookly-js-select-quantity",e).val()?V(".bookly-js-select-quantity",e).val():1},i=Math.max(i,r[t.hasOwnProperty("time_requirements")?t.time_requirements:"required"]),s+=t.has_extras});var o=[];V(".bookly-js-week-days .active input.bookly-js-week-day",P).each(function(){o.push(this.value)}),V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:{action:"bookly_session_save",csrf_token:BooklyL10n.csrf_token,form_id:q.form_id,chain:a,date_from:d.pickadate("picker").get("select","yyyy-mm-dd"),days:o,time_from:f.val(),time_to:m.val(),no_extras:0==s},dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){ee[q.form_id].no_time=0==i,ee[q.form_id].no_extras=0==s,ee[q.form_id].skip_steps.extras?ne({form_id:q.form_id}):0==s||"after_step_time"==ee[q.form_id].step_extras?ne({form_id:q.form_id}):le({form_id:q.form_id})}})}}),_.on("click",function(e,o){return M()&&(ee[q.form_id].skip_steps.service_part2?(oe(this),y.trigger("click")):(V(".bookly-js-mobile-step-1",P).hide(),V(".bookly-js-mobile-step-2",P).css("display","block"),1!=o&&te(P))),!1}),ee[q.form_id].skip_steps.service_part1?(_.trigger("click",[!0]),u.remove()):u.on("click",function(){return V(".bookly-js-mobile-step-1",P).show(),V(".bookly-js-mobile-step-2",P).hide(),s.val()&&V(".bookly-js-select-service",P).parent().removeClass("bookly-error"),!1})}}})}}function t(e,o,t){var a=document.createElement("script");a.type="text/javascript",void 0!==o&&(a.async=o),t instanceof Function&&(a.onload=t),document.head.appendChild(a),a.src=e}window.bookly=function(e){var o;(ee[e.form_id]=e,ee[e.form_id].$container=V("#bookly-form-"+e.form_id),ee[e.form_id].timeZone="object"==typeof Intl?Intl.DateTimeFormat().resolvedOptions().timeZone:void 0,ee[e.form_id].timeZoneOffset=(new Date).getTimezoneOffset(),ee[e.form_id].skip_steps.service=e.skip_steps.service_part1&&e.skip_steps.service_part2,"finished"==e.status.booking?ae({form_id:e.form_id}):"cancelled"==e.status.booking?se({form_id:e.form_id}):de({form_id:e.form_id,new_chain:!0}),e.hasOwnProperty("facebook")&&e.facebook.enabled&&(o=e,FB.init({appId:o.facebook.appId,status:!0,version:"v2.12"}),FB.getLoginStatus(function(e){"connected"===e.status?(o.facebook.enabled=!1,FB.api("/me",{fields:"id,name,first_name,last_name,email,link"},function(e){V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:V.extend(e,{action:"bookly_pro_facebook_login",csrf_token:BooklyL10n.csrf_token,form_id:o.form_id}),dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){}})})):FB.Event.subscribe("auth.statusChange",function(e){o.facebook.onStatusChange&&o.facebook.onStatusChange(e)})})),e.hasOwnProperty("google_maps")&&e.google_maps.enabled)&&t("https://maps.googleapis.com/maps/api/js?key="+e.google_maps.api_key+"&libraries=places",!0);e.hasOwnProperty("stripe")&&e.stripe.enabled&&t("https://js.stripe.com/v3/",!0)}}(jQuery);
2
//# sourceMappingURL=bookly.min.js.map
1
+ !function(V){"use strict";V=V&&V.hasOwnProperty("default")?V.default:V;var ee={};function oe(e){var o=Ladda.create(e);return o.start(),o}function te(e){var o=e.offset().top,t=V(window).scrollTop();(o<V(window).scrollTop()||o>t+window.innerHeight)&&V("html,body").animate({scrollTop:o-24},500)}function ae(e){var o=V.extend({action:"bookly_render_complete",csrf_token:BooklyL10n.csrf_token},e),t=ee[e.form_id].$container;V.ajax({url:BooklyL10n.ajaxurl,data:o,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success&&(e.final_step_url&&!o.error?document.location.href=e.final_step_url:(t.html(e.html),te(t)))}})}function se(c){var f=ee[c.form_id].$container;V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:{action:"bookly_render_payment",csrf_token:BooklyL10n.csrf_token,form_id:c.form_id,page_url:document.URL.split("#")[0]},dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){if(e.success){if(e.disabled)return void m(c.form_id);if(f.html(e.html),te(f),"cancelled"==ee[c.form_id].status.booking&&(ee[c.form_id].status.booking="ok"),f.find("#bookly-stripe-card-field").length)if(e.stripe_publishable_key){var i=Stripe(e.stripe_publishable_key,{betas:["payment_intent_beta_3"]}),r=i.elements().create("card");r.mount("#bookly-stripe-card-field")}else f.find(".bookly-stripe #bookly-stripe-card-field").hide(),f.find(".pay-card .bookly-js-next-step").prop("disabled",!0),f.find(".bookly-stripe .bookly-js-card-error").text("Please call Stripe() with your publishable key. You used an empty string.");var o=V(".bookly-payment",f),t=V(".bookly-js-apply-coupon",f),a=V("input.bookly-user-coupon",f),s=V(".bookly-js-coupon-error",f),n=V("input[type=radio][name=bookly-full-payment]",f),l=V(".bookly-info-text-coupon",f),d=V(".bookly-gateway-buttons,form.bookly-authorize_net,form.bookly-stripe",f);o.on("click",function(){d.hide(),V(".bookly-gateway-buttons.pay-"+V(this).val(),f).show(),"card"==V(this).val()&&V("form.bookly-"+V(this).data("form"),f).show()}),o.eq(0).trigger("click"),n.on("change",function(){var e={action:"bookly_deposit_payments_apply_payment_method",csrf_token:BooklyL10n.csrf_token,form_id:c.form_id,deposit_full:V(this).val()};V(this).hide(),V(this).prev().css("display","inline-block"),V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:e,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success&&se({form_id:c.form_id})}})}),t.on("click",function(e){var o=oe(this);s.text(""),a.removeClass("bookly-error");var t={action:"bookly_coupons_apply_coupon",csrf_token:BooklyL10n.csrf_token,form_id:c.form_id,coupon_code:a.val()};V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:t,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success?se({form_id:c.form_id}):(s.html(ee[c.form_id].errors[e.error]),a.addClass("bookly-error"),l.html(e.text),te(s),o.stop())},error:function(){o.stop()}})}),V(".bookly-js-next-step",f).on("click",function(e){var o,t,a=oe(this);if(V(".bookly-payment[value=local]",f).is(":checked")||V(this).hasClass("bookly-js-coupon-payment"))e.preventDefault(),m(c.form_id);else if(V(".bookly-payment[value=card]",f).is(":checked"))if(V(".bookly-payment[data-form=stripe]",f).is(":checked"))V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:{action:"bookly_stripe_create_intent",csrf_token:BooklyL10n.csrf_token,form_id:c.form_id},dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success?i.handleCardPayment(e.intent_secret,r).then(function(o){o.error?V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:{action:"bookly_stripe_failed_payment",csrf_token:BooklyL10n.csrf_token,form_id:c.form_id,intent_id:e.intent_id},dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success&&(a.stop(),f.find(".bookly-stripe .bookly-js-card-error").text(o.error.message))}}):V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:{action:"bookly_stripe_process_payment",csrf_token:BooklyL10n.csrf_token,form_id:c.form_id,intent_id:e.intent_id},dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success&&ae({form_id:c.form_id})}})}):(a.stop(),f.find(".bookly-stripe .bookly-js-card-error").text(e.error_message))}});else{o=f.find(".bookly-authorize_net"),e.preventDefault();var s={action:"bookly_authorize_net_aim_payment",csrf_token:BooklyL10n.csrf_token,card:{number:o.find('input[name="card_number"]').val(),cvc:o.find('input[name="card_cvc"]').val(),exp_month:o.find('select[name="card_exp_month"]').val(),exp_year:o.find('select[name="card_exp_year"]').val()},form_id:c.form_id};t=s,V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:t,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success?ae({form_id:c.form_id}):"cart_item_not_available"==e.error?y(e,c.form_id):"payment_error"==e.error&&(a.stop(),o.find(".bookly-js-card-error").text(e.error_message))}})}else(V(".bookly-payment[value=paypal]",f).is(":checked")||V(".bookly-payment[value=2checkout]",f).is(":checked")||V(".bookly-payment[value=payu_biz]",f).is(":checked")||V(".bookly-payment[value=payu_latam]",f).is(":checked")||V(".bookly-payment[value=payson]",f).is(":checked")||V(".bookly-payment[value=mollie]",f).is(":checked"))&&(e.preventDefault(),0<(o=V(this).closest("form")).find("input.bookly-payment-id").length?V.ajax({type:"POST",url:BooklyL10n.ajaxurl,xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,data:{action:"bookly_pro_save_pending_appointment",csrf_token:BooklyL10n.csrf_token,form_id:c.form_id,payment_type:o.data("gateway")},dataType:"json",success:function(e){e.success?(o.find("input.bookly-payment-id").val(e.payment_id),o.submit()):"cart_item_not_available"==e.error&&y(e,c.form_id)}}):V.ajax({type:"POST",url:BooklyL10n.ajaxurl,xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,data:{action:"bookly_check_cart",csrf_token:BooklyL10n.csrf_token,form_id:c.form_id},dataType:"json",success:function(e){e.success?o.submit():"cart_item_not_available"==e.error&&y(e,c.form_id)}}))}),V(".bookly-js-back-step",f).on("click",function(e){e.preventDefault(),oe(this),S({form_id:c.form_id})})}}})}function m(o){V.ajax({type:"POST",url:BooklyL10n.ajaxurl,xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,data:{action:"bookly_save_appointment",csrf_token:BooklyL10n.csrf_token,form_id:o},dataType:"json"}).done(function(e){e.success?ae({form_id:o}):"cart_item_not_available"==e.error&&y(e,o)})}function y(e,o){ee[o].skip_steps.cart?ne({form_id:o},ee[o].errors[e.error]):ie({form_id:o},{failed_key:e.failed_cart_key,message:ee[o].errors[e.error]})}function S(G){var e=V.extend({action:"bookly_render_details",csrf_token:BooklyL10n.csrf_token},G),K=ee[G.form_id].$container;V.ajax({url:BooklyL10n.ajaxurl,data:e,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){if(e.success){K.html(e.html),te(K);var l=e.intlTelInput,d=e.update_details_dialog,c=e.woocommerce;ee[G.form_id].hasOwnProperty("google_maps")&&ee[G.form_id].google_maps.enabled&&(K||V(".bookly-form .bookly-details-step")).each(function(){!function(t){var e=t.find(".bookly-js-cst-address-autocomplete");if(e.length){var i=new google.maps.places.Autocomplete(e[0],{types:["geocode"]}),o=[{selector:".bookly-js-address-country",val:function(){return a("country")},short:function(){return a("country",!0)}},{selector:".bookly-js-address-postcode",val:function(){return a("postal_code")}},{selector:".bookly-js-address-city",val:function(){return a("locality")||a("administrative_area_level_3")}},{selector:".bookly-js-address-state",val:function(){return a("administrative_area_level_1")},short:function(){return a("administrative_area_level_1",!0)}},{selector:".bookly-js-address-street",val:function(){return a("route")}},{selector:".bookly-js-address-street_number",val:function(){return a("street_number")}}],a=function(e,o){for(var t=i.getPlace().address_components,a=0;a<t.length;a++){var s=t[a].types[0];if(s===e)return o?t[a].short_name:t[a].long_name}return""};i.addListener("place_changed",function(){o.forEach(function(e){var o=t.find(e.selector);0!==o.length&&(o.val(e.val()),"function"==typeof e.short&&o.data("short",e.short()))})})}}(V(this))}),V(document.body).trigger("bookly.render.step_detail",[K]);var f="",t=V(".bookly-js-guest",K),m=V(".bookly-js-user-phone-input",K),y=V(".bookly-js-user-email",K),_=V(".bookly-js-user-email-confirm",K),u=V(".bookly-js-select-birthday-day",K),p=V(".bookly-js-select-birthday-month",K),k=V(".bookly-js-select-birthday-year",K),h=V(".bookly-js-address-country",K),b=V(".bookly-js-address-state",K),v=V(".bookly-js-address-postcode",K),j=V(".bookly-js-address-city",K),g=V(".bookly-js-address-street",K),w=V(".bookly-js-address-street_number",K),x=V(".bookly-js-address-additional_address",K),C=V(".bookly-js-address-country-error",K),L=V(".bookly-js-address-state-error",K),B=V(".bookly-js-address-postcode-error",K),T=V(".bookly-js-address-city-error",K),D=V(".bookly-js-address-street-error",K),S=V(".bookly-js-address-street_number-error",K),O=V(".bookly-js-address-additional_address-error",K),M=V(".bookly-js-select-birthday-day-error",K),q=V(".bookly-js-select-birthday-month-error",K),P=V(".bookly-js-select-birthday-year-error",K),F=V(".bookly-js-full-name",K),R=V(".bookly-js-first-name",K),E=V(".bookly-js-last-name",K),H=V(".bookly-js-user-notes",K),o=V(".bookly-custom-field",K),a=V(".bookly-js-info-field",K),X=V(".bookly-js-user-phone-error",K),I=V(".bookly-js-user-email-error",K),z=V(".bookly-js-user-email-confirm-error",K),N=V(".bookly-js-full-name-error",K),Y=V(".bookly-js-first-name-error",K),Z=V(".bookly-js-last-name-error",K),s=V(".bookly-js-captcha-img",K),i=V(".bookly-custom-field-error",K),r=V(".bookly-js-info-field-error",K),n=V(".bookly-js-modal",K),J=V(".bookly-js-login",K),$=V(".bookly-js-cst-duplicate",K),A=V(".bookly-js-next-step",K),U=V([M,q,P,C,L,B,T,D,S,O,N,Y,Z,X,I,z,i,r]).map(V.fn.toArray),Q=V([u,p,k,j,h,v,b,g,w,x,F,R,E,m,y,_,o,a]).map(V.fn.toArray),W=function(e){if(F.val(e.data.full_name).removeClass("bookly-error"),R.val(e.data.first_name).removeClass("bookly-error"),E.val(e.data.last_name).removeClass("bookly-error"),e.data.birthday){var o=e.data.birthday.split("-"),t=parseInt(o[0]),a=parseInt(o[1]),s=parseInt(o[2]);u.val(s).removeClass("bookly-error"),p.val(a).removeClass("bookly-error"),k.val(t).removeClass("bookly-error")}e.data.phone&&(m.removeClass("bookly-error"),l.enabled?m.intlTelInput("setNumber",e.data.phone):m.val(e.data.phone)),e.data.country&&h.val(e.data.country).removeClass("bookly-error"),e.data.state&&b.val(e.data.state).removeClass("bookly-error"),e.data.postcode&&v.val(e.data.postcode).removeClass("bookly-error"),e.data.city&&j.val(e.data.city).removeClass("bookly-error"),e.data.street&&g.val(e.data.street).removeClass("bookly-error"),e.data.street_number&&w.val(e.data.street_number).removeClass("bookly-error"),e.data.additional_address&&x.val(e.data.additional_address).removeClass("bookly-error"),y.val(e.data.email).removeClass("bookly-error"),e.data.info_fields&&e.data.info_fields.forEach(function(e){var o=K.find('.bookly-js-info-field-row[data-id="'+e.id+'"]');switch(o.data("type")){case"checkboxes":e.value.forEach(function(e){o.find(".bookly-js-info-field").filter(function(){return this.value==e}).prop("checked",!0)});break;case"radio-buttons":o.find(".bookly-js-info-field").filter(function(){return this.value==e.value}).prop("checked",!0);break;default:o.find(".bookly-js-info-field").val(e.value)}}),U.filter(":not(.bookly-custom-field-error)").html("")};l.enabled&&m.intlTelInput({preferredCountries:[l.country],initialCountry:l.country,geoIpLookup:function(t){V.get("https://ipinfo.io",function(){},"jsonp").always(function(e){var o=e&&e.country?e.country:"";t(o)})},utilsScript:l.utils}),V("body > .bookly-js-modal."+G.form_id).remove(),n.addClass(G.form_id).appendTo("body").on("click",".bookly-js-close",function(e){e.preventDefault(),V(e.delegateTarget).removeClass("bookly-in").find("form").trigger("reset").end().find("input").removeClass("bookly-error").end().find(".bookly-label-error").html("")}),V(".bookly-js-login-show",K).on("click",function(e){e.preventDefault(),J.addClass("bookly-in")}),V("button:submit",J).on("click",function(e){e.preventDefault();var o=Ladda.create(this);o.start(),V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:{action:"bookly_wp_user_login",csrf_token:BooklyL10n.csrf_token,form_id:G.form_id,log:J.find('[name="log"]').val(),pwd:J.find('[name="pwd"]').val(),rememberme:J.find('[name="rememberme"]').prop("checked")?1:0},dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success?(BooklyL10n.csrf_token=e.data.csrf_token,t.fadeOut("slow"),W(e),J.removeClass("bookly-in")):"incorrect_username_password"==e.error&&(J.find("input").addClass("bookly-error"),J.find(".bookly-label-error").html(ee[G.form_id].errors[e.error])),o.stop()}})}),V("button:submit",$).on("click",function(e){e.preventDefault(),$.removeClass("bookly-in"),A.trigger("click",[1])}),ee[G.form_id].hasOwnProperty("facebook")&&ee[G.form_id].facebook.enabled&&(FB.XFBML.parse(V(".bookly-js-fb-login-button",K).parent().get(0)),ee[G.form_id].facebook.onStatusChange=function(e){"connected"===e.status&&(ee[G.form_id].facebook.enabled=!1,ee[G.form_id].facebook.onStatusChange=void 0,t.fadeOut("slow",function(){V(".bookly-js-fb-login-button").hide()}),FB.api("/me",{fields:"id,name,first_name,last_name,email"},function(e){V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:V.extend(e,{action:"bookly_pro_facebook_login",csrf_token:BooklyL10n.csrf_token,form_id:G.form_id}),dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success&&W(e)}})}))}),A.on("click",function(e,o){e.preventDefault();var a,t=[],s={},i=[],r=oe(this);V("div.bookly-js-info-field-row",K).each(function(){var e=V(this);switch(e.data("type")){case"text-field":t.push({id:e.data("id"),value:e.find("input.bookly-js-info-field").val()});break;case"textarea":t.push({id:e.data("id"),value:e.find("textarea.bookly-js-info-field").val()});break;case"checkboxes":a=[],e.find("input.bookly-js-info-field:checked").each(function(){a.push(this.value)}),t.push({id:e.data("id"),value:a});break;case"radio-buttons":t.push({id:e.data("id"),value:e.find("input.bookly-js-info-field:checked").val()||null});break;case"drop-down":t.push({id:e.data("id"),value:e.find("select.bookly-js-info-field").val()})}}),V(".bookly-custom-fields-container",K).each(function(){var e=V(this),o=e.data("key"),t=[];V("div.bookly-custom-field-row",e).each(function(){var e=V(this);switch(e.data("type")){case"text-field":case"file":t.push({id:e.data("id"),value:e.find("input.bookly-custom-field").val()});break;case"textarea":t.push({id:e.data("id"),value:e.find("textarea.bookly-custom-field").val()});break;case"checkboxes":a=[],e.find("input.bookly-custom-field:checked").each(function(){a.push(this.value)}),t.push({id:e.data("id"),value:a});break;case"radio-buttons":t.push({id:e.data("id"),value:e.find("input.bookly-custom-field:checked").val()||null});break;case"drop-down":t.push({id:e.data("id"),value:e.find("select.bookly-custom-field").val()});break;case"captcha":t.push({id:e.data("id"),value:e.find("input.bookly-custom-field").val()}),i.push(e.data("id"))}}),s[o]={custom_fields:JSON.stringify(t)}});try{""==(f=l.enabled?m.intlTelInput("getNumber"):m.val())&&(f=m.val())}catch(e){f=m.val()}var n={action:"bookly_session_save",csrf_token:BooklyL10n.csrf_token,form_id:G.form_id,full_name:F.val(),first_name:R.val(),last_name:E.val(),phone:f,email:y.val(),email_confirm:_.val(),birthday:{day:u.val(),month:p.val(),year:k.val()},country:h.val(),state:b.val(),postcode:v.val(),city:j.val(),street:g.val(),street_number:w.val(),additional_address:x.val(),address_iso:{country:h.data("short"),state:b.data("short")},info_fields:t,notes:H.val(),cart:s,captcha_ids:JSON.stringify(i),force_update_customer:!d||o};V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:n,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(o){if(U.empty(),Q.removeClass("bookly-error"),o.success)if(c.enabled){var e={action:"bookly_pro_add_to_woocommerce_cart",csrf_token:BooklyL10n.csrf_token,form_id:G.form_id};V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:e,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success?window.location.href=c.cart_url:(r.stop(),ne({form_id:G.form_id},ee[G.form_id].errors[e.error]))}})}else se({form_id:G.form_id});else{var i=null;if(o.appointments_limit_reached)ae({form_id:G.form_id,error:"appointments_limit_reached"});else{r.stop();[{name:"full_name",errorElement:N,formElement:F},{name:"first_name",errorElement:Y,formElement:R},{name:"last_name",errorElement:Z,formElement:E},{name:"phone",errorElement:X,formElement:m},{name:"email",errorElement:I,formElement:y},{name:"email_confirm",errorElement:z,formElement:_},{name:"birthday_day",errorElement:M,formElement:u},{name:"birthday_month",errorElement:q,formElement:p},{name:"birthday_year",errorElement:P,formElement:k},{name:"country",errorElement:C,formElement:h},{name:"state",errorElement:L,formElement:b},{name:"postcode",errorElement:B,formElement:v},{name:"city",errorElement:T,formElement:j},{name:"street",errorElement:D,formElement:g},{name:"street_number",errorElement:S,formElement:w},{name:"additional_address",errorElement:O,formElement:x}].forEach(function(e){o[e.name]&&(e.errorElement.html(o[e.name]),e.formElement.addClass("bookly-error"),null===i&&(i=e.formElement))}),o.info_fields&&V.each(o.info_fields,function(e,o){var t=V('div.bookly-js-info-field-row[data-id="'+e+'"]',K);t.find(".bookly-js-info-field-error").html(o),t.find(".bookly-js-info-field").addClass("bookly-error"),null===i&&(i=t.find(".bookly-js-info-field"))}),o.custom_fields&&V.each(o.custom_fields,function(s,e){V.each(e,function(e,o){var t=V('.bookly-custom-fields-container[data-key="'+s+'"]',K),a=V('[data-id="'+e+'"]',t);a.find(".bookly-custom-field-error").html(o),a.find(".bookly-custom-field").addClass("bookly-error"),null===i&&(i=a.find(".bookly-custom-field"))})}),o.customer&&$.find(".bookly-js-modal-body").html(o.customer).end().addClass("bookly-in")}null!==i&&te(i)}}})}),V(".bookly-js-back-step",K).on("click",function(e){e.preventDefault(),oe(this),ee[G.form_id].skip_steps.cart?ee[G.form_id].no_time?ee[G.form_id].no_extras?de({form_id:G.form_id}):le({form_id:G.form_id}):ee[G.form_id].skip_steps.repeat?ee[G.form_id].skip_steps.extras||"after_step_time"!=ee[G.form_id].step_extras||ee[G.form_id].no_extras?ne({form_id:G.form_id}):le({form_id:G.form_id}):re({form_id:G.form_id}):ie({form_id:G.form_id})}),V(".bookly-js-captcha-refresh",K).on("click",function(){s.css("opacity","0.5"),V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:{action:"bookly_custom_fields_captcha_refresh",form_id:G.form_id,csrf_token:BooklyL10n.csrf_token},dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success&&s.attr("src",e.data.captcha_url).on("load",function(){s.css("opacity","1")})}})})}}})}function ie(o,t){if(ee[o.form_id].skip_steps.cart)S(o);else{o&&o.from_step&&(ee[o.form_id].cart_prev_step=o.from_step);var e=V.extend({action:"bookly_render_cart",csrf_token:BooklyL10n.csrf_token},o),s=ee[o.form_id].$container;V.ajax({url:BooklyL10n.ajaxurl,data:e,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success&&(s.html(e.html),t?(V(".bookly-label-error",s).html(t.message),V('tr[data-cart-key="'+t.failed_key+'"]',s).addClass("bookly-label-error")):V(".bookly-label-error",s).hide(),te(s),V(".bookly-js-next-step",s).on("click",function(){oe(this),S({form_id:o.form_id})}),V(".bookly-add-item",s).on("click",function(){oe(this),de({form_id:o.form_id,new_chain:!0})}),V(".bookly-js-back-step",s).on("click",function(e){switch(e.preventDefault(),oe(this),ee[o.form_id].cart_prev_step){case"service":de({form_id:o.form_id});break;case"extras":le({form_id:o.form_id});break;case"time":ne({form_id:o.form_id});break;case"repeat":re({form_id:o.form_id});break;default:de({form_id:o.form_id})}}),V(".bookly-js-actions button",s).on("click",function(){oe(this);var e=V(this),a=e.closest("tr");switch(e.data("action")){case"drop":V.ajax({url:BooklyL10n.ajaxurl,data:{action:"bookly_cart_drop_item",csrf_token:BooklyL10n.csrf_token,form_id:o.form_id,cart_key:a.data("cart-key")},dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){if(e.success){var o=a.data("cart-key"),t=V('tr[data-cart-key="'+o+'"]',s);a.delay(300).fadeOut(200,function(){e.data.total_waiting_list?(V(".bookly-js-waiting-list-price",s).html(e.data.waiting_list_price),V(".bookly-js-waiting-list-deposit",s).html(e.data.waiting_list_deposit)):V(".bookly-js-waiting-list-price",s).closest("tr").remove(),V(".bookly-js-subtotal-price",s).html(e.data.subtotal_price),V(".bookly-js-subtotal-deposit",s).html(e.data.subtotal_deposit),V(".bookly-js-pay-now-deposit",s).html(e.data.pay_now_deposit),V(".bookly-js-pay-now-tax",s).html(e.data.pay_now_tax),V(".bookly-js-total-price",s).html(e.data.total_price),V(".bookly-js-total-tax",s).html(e.data.total_tax),t.remove(),0==V("tr[data-cart-key]").length&&(V(".bookly-js-back-step",s).hide(),V(".bookly-js-next-step",s).hide())})}}});break;case"edit":de({form_id:o.form_id,edit_cart_item:a.data("cart-key")})}}))}})}}function re(M,e){if(ee[M.form_id].skip_steps.repeat)ie(M,e);else{var o=V.extend({action:"bookly_render_repeat",csrf_token:BooklyL10n.csrf_token},M),q=ee[M.form_id].$container;V.ajax({url:BooklyL10n.ajaxurl,data:o,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){if(e.success){q.html(e.html),te(q);var o=V(".bookly-js-repeat-appointment-enabled",q),f=V(".bookly-js-next-step",q),t=V(".bookly-js-repeat-variants-container",q),a=V('[class^="bookly-js-variant"]',t),s=V(".bookly-js-repeat-variant",t),i=V(".bookly-js-get-schedule",t),r=V(".bookly-js-variant-weekly",t),n=V(".bookly-js-repeat-variant-monthly",t),l=V(".bookly-js-repeat-until",t),d=V(".bookly-js-repeat-times",t),c=V(".bookly-js-monthly-specific-day",t),m=V(".bookly-js-monthly-week-day",t),y=V(".bookly-js-repeat-daily-every",t),_=V(".bookly-js-week-day",t),u=V(".bookly-js-schedule-container",q),p=V(".bookly-js-days-error",t),k=V(".bookly-js-schedule-slots",u),h=V(".bookly-js-intersection-info",u),b=V(".bookly-js-schedule-help",u),v=V(".bookly-well",u),j=V(".bookly-pagination",u),g=V(".bookly-schedule-row-template .bookly-schedule-row",u),w=e.pages_warning_info,x=e.short_date_format,C={min:e.date_min||!0,max:e.date_max||!0},L=[],B={prepareButtonNextState:function(){for(var e=f.prop("disabled"),o=0==L.length,t=0;t<L.length;t++)if(e){if(!L[t].deleted){o=!1;break}}else{if(!L[t].deleted){o=!1;break}o=!0}f.prop("disabled",o)},addTimeSlotControl:function(e,o,a,s){var i,r="";o.length&&(r=V("<select/>"),V.each(o,function(e,o){var t=V("<option/>");t.text(o.title).val(o.value),o.disabled&&t.attr("disabled","disabled"),r.append(t),i||o.disabled||(o.title==a?(r.val(o.value),i=!0):o.title==s&&r.val(o.value))}));e.find(".bookly-js-schedule-time").html(r),e.find("div.bookly-label-error").toggle(!o.length)},renderSchedulePage:function(e){var o,t=L.length,a=5*e-5,s=[];k.html("");for(var i=a,r=0;r<5&&i<t;i++,r++)(o=g.clone()).data("datetime",L[i].datetime),o.data("index",L[i].index),V("> div:first-child",o).html(L[i].index),V(".bookly-schedule-date",o).html(L[i].display_date),void 0!==L[i].all_day_service_time?(V(".bookly-js-schedule-time",o).hide(),V(".bookly-js-schedule-all-day-time",o).html(L[i].all_day_service_time).show()):(V(".bookly-js-schedule-time",o).html(L[i].display_time).show(),V(".bookly-js-schedule-all-day-time",o).hide()),L[i].another_time&&V(".bookly-schedule-intersect",o).show(),L[i].deleted&&o.find(".bookly-schedule-appointment").addClass("bookly-appointment-hidden"),k.append(o);if(5<t){var n=V("<li/>").html("«");for(n.on("click",function(){var e=parseInt(j.find(".active").html());1<e&&B.renderSchedulePage(e-1)}),j.html(n),i=0,r=1;i<t;i+=5,r++)n=V("<li/>").html(r),j.append(n),n.on("click",function(){B.renderSchedulePage(V(this).html())});for(j.find("li:eq("+e+")").addClass("active"),(n=V("<li/>").html("»")).on("click",function(){var e=parseInt(j.find(".active").html());e<t/5&&B.renderSchedulePage(e+1)}),j.append(n).show(),i=0;i<t;i++)L[i].another_time&&(e=parseInt(i/5)+1,s.push(e),i=5*e-1);0<s.length&&h.html(w.replace("{list}",s.join(", "))),v.toggle(0<s.length),j.toggle(5<t)}else for(j.hide(),v.hide(),i=0;i<t;i++)if(L[i].another_time){b.show();break}},renderFullSchedule:function(e){L=e;var c=null;V.each(L,function(e,o){c||o.another_time||(c=o.display_time)}),B.renderSchedulePage(1),u.show(),f.prop("disabled",0==L.length),k.on("click","button[data-action]",function(){var o=V(this).closest(".bookly-schedule-row"),a=o.data("index")-1;switch(V(this).data("action")){case"drop":L[a].deleted=!0,o.find(".bookly-schedule-appointment").addClass("bookly-appointment-hidden"),B.prepareButtonNextState();break;case"restore":L[a].deleted=!1,o.find(".bookly-schedule-appointment").removeClass("bookly-appointment-hidden"),f.prop("disabled",!1);break;case"edit":var e=V('<input type="text"/>'),s=V(this),i=oe(this);o.find(".bookly-schedule-date").html(e),e.pickadate({min:C.min,max:C.max,formatSubmit:"yyyy-mm-dd",format:x,clear:!1,close:!1,today:BooklyL10n.today,monthsFull:BooklyL10n.months,weekdaysFull:BooklyL10n.days,weekdaysShort:BooklyL10n.daysShort,labelMonthNext:BooklyL10n.nextMonth,labelMonthPrev:BooklyL10n.prevMonth,firstDay:ee[M.form_id].start_of_week,onSet:function(){var t=[];V.each(L,function(e,o){a==e||o.deleted||t.push(o.slots)}),V.ajax({url:BooklyL10n.ajaxurl,type:"POST",data:{action:"bookly_recurring_appointments_get_daily_customer_schedule",csrf_token:BooklyL10n.csrf_token,date:this.get("select","yyyy-mm-dd"),form_id:M.form_id,exclude:t},dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){s.hide(),i.stop(),e.data.length?(B.addTimeSlotControl(o,e.data[0].options,c,L[a].display_time,e.data[0].all_day_service_time),o.find('button[data-action="save"]').show()):(B.addTimeSlotControl(o,[]),o.find('button[data-action="save"]').hide())}})}});var t=JSON.parse(L[a].slots);e.pickadate("picker").set("select",new Date(t[0][2]));break;case"save":V(this).hide(),o.find('button[data-action="edit"]').show();var r=o.find(".bookly-schedule-date"),n=o.find(".bookly-js-schedule-time"),l=n.find("select"),d=l.find("option:selected");L[a].slots=l.val(),L[a].display_date=r.find("input").val(),L[a].display_time=d.text(),r.html(L[a].display_date),n.html(L[a].display_time)}})},isDateMatchesSelections:function(e){switch(s.val()){case"daily":if((6<y.val()||-1!=V.inArray(e.format("ddd").toLowerCase(),B.week_days))&&e.diff(B.date_from,"days")%y.val()==0)return!0;break;case"weekly":case"biweekly":if(("weekly"==s.val()||e.diff(B.date_from.clone().startOf("isoWeek"),"weeks")%2==0)&&-1!=V.inArray(e.format("ddd").toLowerCase(),B.checked_week_days))return!0;break;case"monthly":switch(n.val()){case"specific":if(e.format("D")==c.val())return!0;break;case"last":if(e.format("ddd").toLowerCase()==m.val()&&e.clone().endOf("month").diff(e,"days")<7)return!0;break;default:var o=e.diff(e.clone().startOf("month"),"days");if(e.format("ddd").toLowerCase()==m.val()&&o>=7*(n.prop("selectedIndex")-1)&&o<7*n.prop("selectedIndex"))return!0}}return!1},updateRepeatDate:function(){var e=0,o=d.val(),t=C.min.slice(),a=l.pickadate("picker").get("select"),s=moment().year(a.year).month(a.month).date(a.date).add(5,"years");t[1]++,B.date_from=moment(t.join(","),"YYYY,M,D"),B.week_days=[],m.find("option").each(function(){B.week_days.push(V(this).val())}),B.checked_week_days=[],_.each(function(){V(this).prop("checked")&&B.checked_week_days.push(V(this).val())});for(var i=B.date_from.clone();B.isDateMatchesSelections(i)&&e++,i.add(1,"days"),e<o&&i.isBefore(s););l.val(i.subtract(1,"days").format("MMMM D, YYYY")),l.pickadate("picker").set("select",new Date(i.format("YYYY"),i.format("M")-1,i.format("D")))},updateRepeatTimes:function(){var e=0,o=C.min.slice(),t=l.pickadate("picker").get("select"),a=moment().year(t.year).month(t.month).date(t.date);o[1]++,B.date_from=moment(o.join(","),"YYYY,M,D"),B.week_days=[],m.find("option").each(function(){B.week_days.push(V(this).val())}),B.checked_week_days=[],_.each(function(){V(this).prop("checked")&&B.checked_week_days.push(V(this).val())});for(var s=B.date_from.clone();B.isDateMatchesSelections(s)&&e++,s.add(1,"days"),s.isBefore(a););d.val(e)}};l.pickadate({formatSubmit:"yyyy-mm-dd",format:ee[M.form_id].date_format,min:C.min,max:C.max,clear:!1,close:!1,today:BooklyL10n.today,monthsFull:BooklyL10n.months,weekdaysFull:BooklyL10n.days,weekdaysShort:BooklyL10n.daysShort,labelMonthNext:BooklyL10n.nextMonth,labelMonthPrev:BooklyL10n.prevMonth,firstDay:ee[M.form_id].start_of_week});var T=o.on("change",function(){t.toggle(V(this).prop("checked")),V(this).prop("checked")?B.prepareButtonNextState():f.prop("disabled",!1)});if(e.repeated){var D=e.repeat_data,S=D.params;o.prop("checked",!0),s.val(D.repeat);var O=D.until.split("-");switch(l.pickadate("set").set("select",new Date(O[0],O[1]-1,O[2])),D.repeat){case"daily":y.val(S.every);break;case"weekly":case"biweekly":V(".bookly-js-week-days input.bookly-js-week-day",t).prop("checked",!1).parent().removeClass("active"),S.on.forEach(function(e){V(".bookly-js-week-days input.bookly-js-week-day[value="+e+"]",t).prop("checked",!0).parent().addClass("active")});break;case"monthly":"day"===S.on?(n.val("specific"),V(".bookly-js-monthly-specific-day[value="+S.day+"]",t).prop("checked",!0)):(n.val(S.on),m.val(S.weekday))}B.renderFullSchedule(e.schedule)}T.trigger("change"),e.could_be_repeated||o.attr("disabled",!0),s.on("change",function(){a.hide(),t.find(".bookly-js-variant-"+this.value).show(),B.updateRepeatTimes()}).trigger("change"),n.on("change",function(){m.toggle("specific"!=this.value),c.toggle("specific"==this.value),B.updateRepeatTimes()}).trigger("change"),_.on("change",function(){var e=V(this);e.is(":checked")?e.parent().not("[class*='active']").addClass("active"):e.parent().removeClass("active"),B.updateRepeatTimes()}),c.val(e.date_min[2]),c.on("change",function(){B.updateRepeatTimes()}),m.on("change",function(){B.updateRepeatTimes()}),l.on("change",function(){B.updateRepeatTimes()}),y.on("change",function(){B.updateRepeatTimes()}),d.on("change",function(){B.updateRepeatDate()}),i.on("click",function(){u.hide();var e={action:"bookly_recurring_appointments_get_customer_schedule",csrf_token:BooklyL10n.csrf_token,form_id:M.form_id,repeat:s.val(),until:l.pickadate("picker").get("select","yyyy-mm-dd"),params:{}},o=oe(this);switch(e.repeat){case"daily":e.params={every:y.val()};break;case"weekly":case"biweekly":if(e.params.on=[],V(".bookly-js-week-days input.bookly-js-week-day:checked",r).each(function(){e.params.on.push(this.value)}),0==e.params.on.length)return p.toggle(!0),o.stop(),!1;p.toggle(!1);break;case"monthly":"specific"==n.val()?e.params={on:"day",day:c.val()}:e.params={on:n.val(),weekday:m.val()}}k.off("click"),V.ajax({url:BooklyL10n.ajaxurl,type:"POST",data:e,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success&&(B.renderFullSchedule(e.data),o.stop())}})}),V(".bookly-js-back-step",q).on("click",function(e){e.preventDefault(),oe(this),V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:{action:"bookly_session_save",csrf_token:BooklyL10n.csrf_token,form_id:M.form_id,unrepeat:1},dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){ee[M.form_id].skip_steps.extras||"after_step_time"!=ee[M.form_id].step_extras||ee[M.form_id].no_extras?ne({form_id:M.form_id}):le({form_id:M.form_id})}})}),V(".bookly-js-go-to-cart",q).on("click",function(e){e.preventDefault(),oe(this),ie({form_id:M.form_id,from_step:"repeat"})}),V(".bookly-js-next-step",q).on("click",function(e){if(oe(this),o.is(":checked")){var t=[],a=0;L.forEach(function(e){if(!e.deleted){var o=JSON.parse(e.slots);t=t.concat(o),a++}}),V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:{action:"bookly_session_save",csrf_token:BooklyL10n.csrf_token,form_id:M.form_id,slots:JSON.stringify(t),repeat:a},dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){ie({form_id:M.form_id,add_to_cart:!0,from_step:"repeat"})}})}else V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:{action:"bookly_session_save",csrf_token:BooklyL10n.csrf_token,form_id:M.form_id,unrepeat:1},dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){ie({form_id:M.form_id,add_to_cart:!0,from_step:"repeat"})}})})}}})}}var o=null;function ne(C,L){if(ee[C.form_id].no_time||ee[C.form_id].skip_steps.time)ee[C.form_id].skip_steps.extras||"after_step_time"!=ee[C.form_id].step_extras||ee[C.form_id].no_extras?ee[C.form_id].skip_steps.cart?S({form_id:C.form_id,add_to_cart:!0}):ie({form_id:C.form_id,add_to_cart:!0,from_step:C&&C.prev_step?C.prev_step:"service"}):le({form_id:C.form_id});else{var e={action:"bookly_render_time",csrf_token:BooklyL10n.csrf_token},B=ee[C.form_id].$container;ee[C.form_id].skip_steps.service&&ee[C.form_id].use_client_time_zone&&(e.time_zone=ee[C.form_id].timeZone,e.time_zone_offset=ee[C.form_id].timeZoneOffset),V.extend(e,C),o=V.ajax({url:BooklyL10n.ajaxurl,data:e,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){if(0!=e.success){BooklyL10n.csrf_token=e.csrf_token,B.html(e.html);var m,y,_,u=V(".bookly-columnizer-wrap",B),p=V(".bookly-columnizer",u),i=V(".bookly-time-next",B),a=V(".bookly-time-prev",B),k=null,h=e.time_slots_wide?205:127,b=e.time_slots_wide?"bookly-column bookly-column-wide":"bookly-column",v=0,r=0,j=e.has_more_slots,g=!1,o=e.show_calendar,n=e.is_rtl,w=e.day_one_column,t=T(e.slots_data,e.selected_date);if(V(".bookly-js-back-step",B).on("click",function(e){e.preventDefault(),oe(this),ee[C.form_id].skip_steps.extras||ee[C.form_id].no_extras?de({form_id:C.form_id}):"before_step_time"==ee[C.form_id].step_extras?le({form_id:C.form_id}):de({form_id:C.form_id})}).toggle(!ee[C.form_id].skip_steps.service||!ee[C.form_id].skip_steps.extras),V(".bookly-js-go-to-cart",B).on("click",function(e){e.preventDefault(),oe(this),ie({form_id:C.form_id,from_step:"time"})}),V(".bookly-js-time-zone-switcher",B).on("change",function(e){ee[C.form_id].timeZone=this.value,ee[C.form_id].timeZoneOffset=void 0,f(),D(),ne({form_id:C.form_id,time_zone:ee[C.form_id].timeZone})}),o){var s=V(".bookly-js-selected-date",B);s.pickadate({formatSubmit:"yyyy-mm-dd",format:ee[C.form_id].date_format,min:e.date_min||!0,max:e.date_max||!0,weekdaysFull:BooklyL10n.days,weekdaysShort:BooklyL10n.daysShort,monthsFull:BooklyL10n.months,firstDay:ee[C.form_id].start_of_week,clear:!1,close:!1,today:!1,disable:e.disabled_days,closeOnSelect:!1,klass:{picker:"picker picker--opened picker--focused"},onSet:function(e){if(e.select){var o=this.get("select","yyyy-mm-dd");t[o]?(p.html(t[o]).css("left","0px"),r=v=0,k=null,x(),a.hide(),i.toggle(1!=m.length)):(D(),ne({form_id:C.form_id,selected_date:o}),f())}this.open()},onClose:function(){this.open(!1)},onRender:function(){var e=new Date(Date.UTC(this.get("view").year,this.get("view").month));V(".picker__nav--next",B).on("click",function(){e.setUTCMonth(e.getUTCMonth()+1),D(),ne({form_id:C.form_id,selected_date:e.toJSON().substr(0,10)}),f()}),V(".picker__nav--prev",B).on("click",function(){e.setUTCMonth(e.getUTCMonth()-1),D(),ne({form_id:C.form_id,selected_date:e.toJSON().substr(0,10)}),f()})}});var l=s.pickadate("picker").get("select","yyyy-mm-dd");p.html(t[l])}else{var d="";V.each(t,function(e,o){d+=o}),p.html(d)}if(e.has_slots){L?B.find(".bookly-label-error").html(L):B.find(".bookly-label-error").hide(),(y=parseInt(V(window).height()/36,10))<4?y=4:10<y&&(y=10),10<(_=parseInt(u.width()/h,10))?_=10:0==_&&(g=!0,_=4),x(),j||1!=m.length||i.hide();var c=V(".bookly-time-step",B).hammer({swipe_velocity:.1});c.on("swipeleft",function(){i.is(":visible")&&i.trigger("click")}),c.on("swiperight",function(){a.is(":visible")&&a.trigger("click")}),i.on("click",function(e){if(a.show(),m.eq(r+1).length)p.animate({left:(n?"+":"-")+(r+1)*k.width()},{duration:800}),k=m.eq(++r),u.animate({height:k.height()},{duration:800}),r+1!=m.length||j||i.hide();else if(j){var o=V("> button:last",p);0==o.length&&0==(o=V(".bookly-column:hidden:last > button:last",p)).length&&(o=V(".bookly-column:last > button:last",p));var t={action:"bookly_render_next_time",csrf_token:BooklyL10n.csrf_token,form_id:C.form_id,last_slot:o.val()},s=oe(this);V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:t,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){if(e.success)if(e.has_slots){j=e.has_more_slots;var t="";V.each(T(e.slots_data,e.selected_date),function(e,o){t+=o});var o=V(t),a=o.eq(0);V('button.bookly-day[value="'+a.attr("value")+'"]',B).length&&(o=o.not(":first")),p.append(o),x(),i.trigger("click")}else i.hide();else i.hide();s.stop()}})}}),a.on("click",function(){i.show(),k=m.eq(--r),p.animate({left:(n?"+":"-")+r*k.width()},{duration:800}),u.animate({height:k.height()},{duration:800}),0===r&&a.hide()})}void 0===C&&te(B)}else de({form_id:C.form_id});function f(){V(".bookly-time-screen,.bookly-not-time-screen",B).addClass("bookly-spin-overlay");var e={lines:11,length:11,width:4,radius:5};m?new Spinner(e).spin(m.eq(r).get(0)):new Spinner(e).spin(V(".bookly-not-time-screen",B).get(0))}function x(){var e,o,t,a=V("> button",p),s=0,i=0;if(w)for(;0<a.length;)a.eq(0).hasClass("bookly-day")?(s=1,o=V('<div class="'+b+'" />'),(e=V(a.splice(0,1))).addClass("bookly-js-first-child"),o.append(e)):(s++,e=V(a.splice(0,1)),!a.length||a.eq(0).hasClass("bookly-day")?(e.addClass("bookly-last-child"),o.append(e),p.append(o)):o.append(e)),i<s&&(i=s);else for(;j?a.length>y:a.length;){o=V('<div class="'+b+'" />'),i=y,v%_!=0||a.eq(0).hasClass("bookly-day")||--i;for(var r=0;r<i&&(r+1!=i||!a.eq(0).hasClass("bookly-day"));++r)e=V(a.splice(0,1)),0==r?e.addClass("bookly-js-first-child"):r+1==i&&e.addClass("bookly-last-child"),o.append(e);p.append(o),++v}for(var n=V("> .bookly-column",p);j?n.length>=_:n.length;){t=V('<div class="bookly-time-screen"/>');for(r=0;r<_;++r){if(o=V(n.splice(0,1)),0==r){o.addClass("bookly-js-first-column");var l=o.find(".bookly-js-first-child");if(!l.hasClass("bookly-day")){var d=l.data("group"),c=V('button.bookly-day[value="'+d+'"]:last',B);o.prepend(c.clone())}}t.append(o)}p.append(t)}m=V(".bookly-time-screen",p),null===k&&(k=m.eq(0)),V("button.bookly-time-skip",B).off("click").on("click",function(e){oe(this),ee[C.form_id].skip_steps.cart?S({form_id:C.form_id,add_to_cart:!0}):ie({form_id:C.form_id,add_to_cart:!0,from_step:"time"})});var f=null;V("button.bookly-hour",B).off("click").on("click",function(e){null!=f&&(f.abort(),f=null),e.preventDefault();var o=V(this),t={action:"bookly_session_save",csrf_token:BooklyL10n.csrf_token,form_id:C.form_id,slots:this.value};o.attr({"data-style":"zoom-in","data-spinner-color":"#333","data-spinner-size":"40"}),oe(this),f=V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:t,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){ee[C.form_id].skip_steps.extras||"after_step_time"!=ee[C.form_id].step_extras||ee[C.form_id].no_extras?ee[C.form_id].skip_steps.repeat?ee[C.form_id].skip_steps.cart?S({form_id:C.form_id,add_to_cart:!0}):ie({form_id:C.form_id,add_to_cart:!0,from_step:"time"}):re({form_id:C.form_id}):le({form_id:C.form_id})}})}),V(".bookly-time-step",B).width(_*h),u.height(g?39*V(".bookly-column.bookly-js-first-column button",k).length:k.height()),g=!1}}})}function T(e,s){var o={};return V.each(e,function(t,e){var a='<button class="bookly-day" value="'+t+'">'+e.title+"</button>";V.each(e.slots,function(e,o){a+='<button value="'+JSON.stringify(o.data).replace(/"/g,"&quot;")+'" data-group="'+t+'" class="bookly-hour'+("waiting-list"==o.status?" bookly-slot-in-waiting-list":"booked"==o.status?" booked":"")+'"'+("booked"==o.status?" disabled":"")+'><span class="ladda-label bookly-time-main'+(o.data[0][2]==s?" bookly-bold":"")+'"><i class="bookly-hour-icon"><span></span></i>'+o.time_text+'</span><span class="bookly-time-additional'+("waiting-list"==o.status?" bookly-waiting-list":"")+'"> '+o.additional_text+"</span></button>"}),o[t]=a}),o}function D(){null!=o&&(o.abort(),o=null)}}function le(c){var e={action:"bookly_render_extras",csrf_token:BooklyL10n.csrf_token},f=ee[c.form_id].$container;ee[c.form_id].skip_steps.service&&ee[c.form_id].use_client_time_zone&&(e.time_zone=ee[c.form_id].timeZone,e.time_zone_offset=ee[c.form_id].timeZoneOffset),V.extend(e,c),V.ajax({url:BooklyL10n.ajaxurl,data:e,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){if(e.success){BooklyL10n.csrf_token=e.csrf_token,f.html(e.html),void 0===c&&te(f);var s,i,o=V(".bookly-js-next-step",f),t=V(".bookly-js-back-step",f),a=V(".bookly-js-go-to-cart",f),r=V(".bookly-js-extras-item",f),n=V(".bookly-js-extras-summary span",f),l=e.currency,d=function(e,o){var t=e.find("input"),a=e.find(".bookly-js-extras-total-price"),s=o*parseFloat(e.data("price"));a.text(l.format.replace("1",s.toFixed(l.precision))),t.val(o),e.find(".bookly-js-extras-thumb").toggleClass("bookly-extras-selected",0<o);var i=0;r.each(function(e,o){var t=V(this),a=t.closest(".bookly-js-extras-container").data("multiplier");i+=parseFloat(t.data("price"))*t.find("input").val()*a}),i?n.html(" + "+l.format.replace("1",i.toFixed(l.precision))):n.html("")};r.each(function(e,o){var t=V(this),a=t.find("input");t.find(".bookly-js-extras-thumb").on("click",function(){d(t,0<a.val()?0:1)}),t.find(".bookly-js-count-control").on("click",function(){var e=parseInt(a.val());e=V(this).hasClass("bookly-js-extras-increment")?Math.min(t.data("max_quantity"),e+1):Math.max(0,e-1),d(t,e)})}),a.on("click",function(e){e.preventDefault(),oe(this),ie({form_id:c.form_id,from_step:"extras"})}),o.on("click",function(e){e.preventDefault(),oe(this);var a={};V(".bookly-js-extras-container",f).each(function(){var e=V(this),o=e.data("chain"),t={};e.find(".bookly-js-extras-item").each(function(e,o){s=V(this),0<(i=s.find("input")).val()&&(t[s.data("id")]=i.val())}),a[o]=JSON.stringify(t)}),V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:{action:"bookly_session_save",csrf_token:BooklyL10n.csrf_token,form_id:c.form_id,extras:a},dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){"before_step_time"==ee[c.form_id].step_extras?ne({form_id:c.form_id,prev_step:"extras"}):ee[c.form_id].skip_steps.repeat?ee[c.form_id].skip_steps.cart?S({form_id:c.form_id,add_to_cart:!0}):ie({form_id:c.form_id,add_to_cart:!0,from_step:"time"}):re({form_id:c.form_id})}})}),t.on("click",function(e){e.preventDefault(),oe(this),"after_step_time"!=ee[c.form_id].step_extras||ee[c.form_id].no_time?de({form_id:c.form_id}):ne({form_id:c.form_id,prev_step:"extras"})})}}})}function de(q){if(ee[q.form_id].skip_steps.service)ee[q.form_id].skip_steps.extras||"before_step_time"!=ee[q.form_id].step_extras?ne(q):le(q);else{var e={action:"bookly_render_service",csrf_token:BooklyL10n.csrf_token},P=ee[q.form_id].$container;ee[q.form_id].use_client_time_zone&&(e.time_zone=ee[q.form_id].timeZone,e.time_zone_offset=ee[q.form_id].timeZoneOffset),V.extend(e,q),V.ajax({url:BooklyL10n.ajaxurl,data:e,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){if(e.success){BooklyL10n.csrf_token=e.csrf_token,P.html(e.html),void 0===q&&te(P);var a=V(".bookly-js-chain-item.bookly-js-draft",P),o=V(".bookly-js-select-location",P),t=V(".bookly-js-select-category",P),s=V(".bookly-js-select-service",P),i=V(".bookly-js-select-employee",P),r=V(".bookly-js-select-units-duration",P),n=V(".bookly-js-select-number-of-persons",P),l=V(".bookly-js-select-quantity",P),d=V(".bookly-js-date-from",P),c=V(".bookly-js-week-day",P),f=V(".bookly-js-select-time-from",P),m=V(".bookly-js-select-time-to",P),y=V(".bookly-js-next-step",P),_=V(".bookly-js-mobile-next-step",P),u=V(".bookly-js-mobile-prev-step",P),h=e.locations,b=e.categories,v=e.services,j=e.staff,p=e.chain,k=e.required,g=ee[q.form_id].defaults,w=e.services_per_location,x=0,C=!1,L=e.service_name_with_duration,B=e.show_ratings;d.pickadate({formatSubmit:"yyyy-mm-dd",format:ee[q.form_id].date_format,min:e.date_min||!0,max:e.date_max||!0,clear:!1,close:!1,today:BooklyL10n.today,monthsFull:BooklyL10n.months,weekdaysFull:BooklyL10n.days,weekdaysShort:BooklyL10n.daysShort,labelMonthNext:BooklyL10n.nextMonth,labelMonthPrev:BooklyL10n.prevMonth,firstDay:ee[q.form_id].start_of_week,onSet:function(e){if(V.isNumeric(e.select)){var o=new Date(e.select);V('.bookly-js-week-day[value="'+(o.getDay()+1)+'"]:not(:checked)',P).attr("checked",!0).trigger("change")}}}),V(".bookly-js-go-to-cart",P).on("click",function(e){e.preventDefault(),oe(this),ie({form_id:q.form_id,from_step:"service"})});var T=function(e,o,t){V('option:not([value=""])',e).remove();var a,s=document.createDocumentFragment();o=(a=o,Object.keys(a).map(function(e){return a[e]})).sort(function(e,o){return parseInt(e.pos)<parseInt(o.pos)?-1:parseInt(e.pos)>parseInt(o.pos)?1:0}),V.each(o,function(e,o){var t=document.createElement("option");t.value=o.id,t.text=o.name,s.appendChild(t)}),e.append(s),e.find('option[value="'+t+'"]').length&&e.val(t)},D=function(e,o,s,i,t){var r=w&&o?o:0,n={},a={},l={},d={},c=null,f=null;if(V.each(j,function(t,a){o&&!h[o].staff.hasOwnProperty(t)||(i?a.services.hasOwnProperty(i)&&V.each(a.services[i].locations,function(e,o){if(r&&r!=e)return!0;f=f?Math.min(f,o.min_capacity):o.min_capacity,c=c?Math.max(c,o.max_capacity):o.max_capacity,n[t]={id:t,name:a.name+(null==o.price||!r&&w?"":" ("+o.price+")"),pos:a.pos}}):s?V.each(a.services,function(e){if(v[e].category_id==s)return n[t]=V.extend({},a),!1}):n[t]=V.extend({},a))}),o){var m=[],y=[];w?V.each(j,function(o){V.each(j[o].services,function(e){j[o].services[e].locations.hasOwnProperty(r)&&(m.push(v[e].category_id),y.push(e))})}):V.each(h[o].staff,function(e){V.each(j[e].services,function(e){m.push(v[e].category_id),y.push(e)})}),V.each(b,function(e,o){-1<V.inArray(parseInt(e),m)&&(l[e]=o)}),V.each(v,function(e,o){-1<V.inArray(e,y)&&(s&&o.category_id!=s||t&&!j[t].services.hasOwnProperty(e)||(a[e]=o))})}else l=b,V.each(v,function(e,o){s&&o.category_id!=s||t&&!j[t].services.hasOwnProperty(e)||(a[e]=o)});for(var _=V(".bookly-js-select-number-of-persons",e).val()||1,u=i?t?j[t].services[i].locations.hasOwnProperty(r)?j[t].services[i].locations[r].max_capacity:1:c||1:1,p=i?t?j[t].services[i].locations.hasOwnProperty(r)?j[t].services[i].locations[r].min_capacity:1:f||1:1,k=p;k<=u;++k)d[k]={id:k,name:k,pos:k};u<_&&(_=u),(_<p||!ee[q.form_id].form_attributes.show_number_of_persons)&&(_=p),B&&V.each(j,function(e,o){n.hasOwnProperty(o.id)&&(i?o.services.hasOwnProperty(i)&&o.services[i].rating&&(n[o.id].name="★"+o.services[i].rating+" "+n[o.id].name):o.rating&&(n[o.id].name="★"+o.rating+" "+n[o.id].name))}),T(e.find(".bookly-js-select-category"),l,s),T(e.find(".bookly-js-select-service"),a,i),T(e.find(".bookly-js-select-employee"),n,t),T(e.find(".bookly-js-select-number-of-persons"),d,_)};P.off("click").off("change"),P.on("change",".bookly-js-select-location",function(){var e=V(this).closest(".bookly-js-chain-item"),o=this.value,t=e.find(".bookly-js-select-category").val(),a=e.find(".bookly-js-select-service").val(),s=e.find(".bookly-js-select-employee").val();if(o){var i=w?o:0;if(s&&(h[o].staff.hasOwnProperty(s)?a&&!j[s].services[a].locations.hasOwnProperty(i)&&(s=""):s=""),a){var r=!1;V.each(h[o].staff,function(e){if(j[e].services.hasOwnProperty(a)&&j[e].services[a].locations.hasOwnProperty(i))return!(r=!0)}),r||(a="")}if(t){r=!1;V.each(h[o].staff,function(e){if(V.each(j[e].services,function(e){if(v[e].category_id==t)return!(r=!0)}),r)return!1}),r||(t="")}}D(e,o,t,a,s),S(e,a,s,o)}),P.on("change",".bookly-js-select-category",function(){var e=V(this).closest(".bookly-js-chain-item"),o=e.find(".bookly-js-select-location").val(),t=this.value,a=e.find(".bookly-js-select-service").val(),s=e.find(".bookly-js-select-employee").val();if(t){if(C=!0,a&&v[a].category_id!=t&&(a=""),s){var i=!1;V.each(j[s].services,function(e){if(v[e].category_id==t)return!(i=!0)}),i||(s="")}}else C=!1;D(e,o,t,a,s)});var S=function(e,a,o,s){var t=e.find(".bookly-js-select-units-duration"),i=t.val();if(t.find("option").remove(),a){V.each(function(e){if(!e||w&&!s)return v[a].hasOwnProperty("units")?v[a].units:[{value:"",title:"-"}];var o=s||0,t=j[e].services[a].locations;return void 0===t?[{value:"",title:"-"}]:(t.hasOwnProperty(o)?t[o]:t[0]).units||[{value:"",title:"-"}]}(o),function(e,o){t.append(V("<option>",{value:o.value,text:o.title}))}),0!=t.find('option[value="'+i+'"]').length&&t.val(i)}else t.append(V("<option>",{value:"",text:"-"}))};if(P.on("change",".bookly-js-select-service",function(){var e=V(this).closest(".bookly-js-chain-item"),o=e.find(".bookly-js-select-location").val(),t=C?e.find(".bookly-js-select-category").val():"",a=this.value,s=e.find(".bookly-js-select-employee").val();a&&s&&!j[s].services.hasOwnProperty(a)&&(s=""),D(e,o,t,a,s),a&&e.find(".bookly-js-select-category").val(v[a].category_id),S(e,a,s,o)}),P.on("change",".bookly-js-select-employee",function(){var e=V(this).closest(".bookly-js-chain-item"),o=e.find(".bookly-js-select-location").val(),t=V(".bookly-js-select-category",e).val(),a=e.find(".bookly-js-select-service").val(),s=this.value;D(e,o,t,a,s),S(e,a,s,o)}),L&&V.each(v,function(e,o){o.name=o.name+" ( "+o.duration+" )"}),T(o,h),T(t,b),T(s,v),B){var O={};V.each(j,function(e,o){O[e]=V.extend({},o),o.rating&&(O[e].name="★"+o.rating+" "+O[e].name)}),T(i,O)}else T(i,j);o.closest(".bookly-form-group").toggle(!ee[q.form_id].form_attributes.hide_locations),t.closest(".bookly-form-group").toggle(!ee[q.form_id].form_attributes.hide_categories),s.closest(".bookly-form-group").toggle(!(ee[q.form_id].form_attributes.hide_services&&g.service_id)),i.closest(".bookly-form-group").toggle(!ee[q.form_id].form_attributes.hide_staff_members),r.closest(".bookly-form-group").toggle(!ee[q.form_id].form_attributes.hide_service_duration),n.closest(".bookly-form-group").toggle(ee[q.form_id].form_attributes.show_number_of_persons),l.closest(".bookly-form-group").toggle(!ee[q.form_id].form_attributes.hide_quantity),g.location_id&&o.val(g.location_id).trigger("change"),g.category_id&&t.val(g.category_id).trigger("change"),g.service_id&&s.val(g.service_id).trigger("change"),g.staff_id&&i.val(g.staff_id).trigger("change"),ee[q.form_id].form_attributes.hide_date&&V(".bookly-js-available-date",P).hide(),ee[q.form_id].form_attributes.hide_week_days&&V(".bookly-js-week-days",P).hide(),ee[q.form_id].form_attributes.hide_time_range&&V(".bookly-js-time-range",P).hide(),V.each(p,function(e,o){var t=a.clone().data("chain_key",e).removeClass("bookly-js-draft").css("display","table");a.find("select").each(function(e,o){t.find("select:eq("+e+")").val(o.value)}),0==(x=e)&&t.find('.bookly-js-actions button[data-action="drop"]').remove(),V(".bookly-js-chain-item:last",P).after(t),!ee[q.form_id].form_attributes.hide_locations&&o.location_id&&V(".bookly-js-select-location",t).val(o.location_id).trigger("change"),o.service_id&&(V(".bookly-js-select-service",t).val(o.service_id).trigger("change"),ee[q.form_id].form_attributes.hide_categories?ee[q.form_id].form_attributes.hasOwnProperty("const_category_id")?V(".bookly-js-select-category",t).val(ee[q.form_id].form_attributes.const_category_id):V(".bookly-js-select-category",t).val(""):V(".bookly-js-select-category",t).val(v[o.service_id].category_id).trigger("change")),!ee[q.form_id].form_attributes.hide_staff_members&&1==o.staff_ids.length&&o.staff_ids[0]&&V(".bookly-js-select-employee",t).val(o.staff_ids[0]).trigger("change"),1<o.number_of_persons&&V(".bookly-js-select-number-of-persons",t).val(o.number_of_persons),1<o.units&&V(".bookly-js-select-units-duration",t).val(o.units),1<o.quantity&&V(".bookly-js-select-quantity",t).val(o.quantity)}),P.on("click",".bookly-js-mobile-step-1 .bookly-js-add-chain",function(){var t=a.clone();a.find("select").each(function(e,o){t.find("select:eq("+e+")").val(o.value)}),V(".bookly-js-chain-item:last",P).after(t.data("chain_key",++x).removeClass("bookly-js-draft").css("display","table"))}),P.on("click",'.bookly-js-mobile-step-1 .bookly-js-actions button[data-action="drop"]',function(){V(this).closest(".bookly-js-chain-item").remove()}),c.on("change",function(){var e=V(this);e.is(":checked")?e.parent().not("[class*='active']").addClass("active"):e.parent().removeClass("active")}),f.on("change",function(){var e=V(this).val(),o=m.val(),t=V("option:last",f);m.empty(),f[0].selectedIndex<t.index()?V("option",this).each(function(){V(this).val()>e&&m.append(V(this).clone())}):m.append(t.clone()).val(t.val());var a=V("option:first",m).val();m.val(a<=o?o:a)});var M=function(){V(".bookly-js-select-service-error",P).hide(),V(".bookly-js-select-employee-error",P).hide(),V(".bookly-js-select-location-error",P).hide();var o=!0,t=null,a=null,s=null,i=null;return V(".bookly-js-chain-item:not(.bookly-js-draft)",P).each(function(){var e=V(this);t=V(".bookly-js-select-service",e),a=V(".bookly-js-select-employee",e),s=V(".bookly-js-select-location",e),t.removeClass("bookly-error"),a.removeClass("bookly-error"),s.removeClass("bookly-error"),t.val()||(o=!1,t.addClass("bookly-error"),V(".bookly-js-select-service-error",e).show(),i=t),k.hasOwnProperty("location")&&k.location&&!s.val()&&(o=!1,s.addClass("bookly-error"),V(".bookly-js-select-location-error",e).show(),i=s),k.staff&&!a.val()&&(o=!1,a.addClass("bookly-error"),V(".bookly-js-select-employee-error",e).show(),i=a)}),d.removeClass("bookly-error"),d.val()||(o=!1,d.addClass("bookly-error"),null===i&&(i=d)),V(".bookly-js-week-day:checked",P).length||(o=!1,null===i&&(i=c)),null!==i&&te(i),o};y.on("click",function(e){if(e.preventDefault(),M()){oe(this);var a={},s=0,i=0,r={required:2,optional:1,off:0};V(".bookly-js-chain-item:not(.bookly-js-draft)",P).each(function(){var e=V(this),o=[],t=v[V(".bookly-js-select-service",e).val()];V(".bookly-js-select-employee",e).val()?o.push(V(".bookly-js-select-employee",e).val()):V(".bookly-js-select-employee",e).find("option").each(function(){this.value&&o.push(this.value)}),a[e.data("chain_key")]={location_id:V(".bookly-js-select-location",e).val(),service_id:V(".bookly-js-select-service",e).val(),staff_ids:o,units:V(".bookly-js-select-units-duration",e).val()||1,number_of_persons:V(".bookly-js-select-number-of-persons",e).val()||1,quantity:V(".bookly-js-select-quantity",e).val()?V(".bookly-js-select-quantity",e).val():1},i=Math.max(i,r[t.hasOwnProperty("time_requirements")?t.time_requirements:"required"]),s+=t.has_extras});var o=[];V(".bookly-js-week-days .active input.bookly-js-week-day",P).each(function(){o.push(this.value)}),V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:{action:"bookly_session_save",csrf_token:BooklyL10n.csrf_token,form_id:q.form_id,chain:a,date_from:d.pickadate("picker").get("select","yyyy-mm-dd"),days:o,time_from:f.val(),time_to:m.val(),no_extras:0==s},dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){ee[q.form_id].no_time=0==i,ee[q.form_id].no_extras=0==s,ee[q.form_id].skip_steps.extras?ne({form_id:q.form_id}):0==s||"after_step_time"==ee[q.form_id].step_extras?ne({form_id:q.form_id}):le({form_id:q.form_id})}})}}),_.on("click",function(e,o){return M()&&(ee[q.form_id].skip_steps.service_part2?(oe(this),y.trigger("click")):(V(".bookly-js-mobile-step-1",P).hide(),V(".bookly-js-mobile-step-2",P).css("display","block"),1!=o&&te(P))),!1}),ee[q.form_id].skip_steps.service_part1?(_.trigger("click",[!0]),u.remove()):u.on("click",function(){return V(".bookly-js-mobile-step-1",P).show(),V(".bookly-js-mobile-step-2",P).hide(),s.val()&&V(".bookly-js-select-service",P).parent().removeClass("bookly-error"),!1})}}})}}function t(e,o,t){var a=document.createElement("script");a.type="text/javascript",void 0!==o&&(a.async=o),t instanceof Function&&(a.onload=t),document.head.appendChild(a),a.src=e}window.bookly=function(e){var o;(ee[e.form_id]=e,ee[e.form_id].$container=V("#bookly-form-"+e.form_id),ee[e.form_id].timeZone="object"==typeof Intl?Intl.DateTimeFormat().resolvedOptions().timeZone:void 0,ee[e.form_id].timeZoneOffset=(new Date).getTimezoneOffset(),ee[e.form_id].skip_steps.service=e.skip_steps.service_part1&&e.skip_steps.service_part2,"finished"==e.status.booking?ae({form_id:e.form_id}):"cancelled"==e.status.booking?se({form_id:e.form_id}):de({form_id:e.form_id,new_chain:!0}),e.hasOwnProperty("facebook")&&e.facebook.enabled&&(o=e,FB.init({appId:o.facebook.appId,status:!0,version:"v2.12"}),FB.getLoginStatus(function(e){"connected"===e.status?(o.facebook.enabled=!1,FB.api("/me",{fields:"id,name,first_name,last_name,email,link"},function(e){V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:V.extend(e,{action:"bookly_pro_facebook_login",csrf_token:BooklyL10n.csrf_token,form_id:o.form_id}),dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){}})})):FB.Event.subscribe("auth.statusChange",function(e){o.facebook.onStatusChange&&o.facebook.onStatusChange(e)})})),e.hasOwnProperty("google_maps")&&e.google_maps.enabled)&&t("https://maps.googleapis.com/maps/api/js?key="+e.google_maps.api_key+"&libraries=places",!0);e.hasOwnProperty("stripe")&&e.stripe.enabled&&t("https://js.stripe.com/v3/",!0)}}(jQuery);
2
//# sourceMappingURL=bookly.min.js.map
frontend/resources/js/bookly.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["bookly.js"],"names":["quot;,"hasOwnProperty","opt","laddaStart","elem","ladda","Ladda","create","start","scrollTo","$elem","elemTop","offset","top","scrollTop","window","innerHeight","animate","stepComplete","params","data","extend","action","csrf_token","BooklyL10n","$container","form_id","ajax","url","ajaxurl","dataType","xhrFields","withCredentials","crossDomain","XMLHttpRequest","success","response","final_step_url","error","document","location","href","html","stepPayment","type","page_url","URL","split","disabled","save","status","booking","find","length","stripe_publishable_key","stripe","Stripe","betas","stripe_card","elements","mount","hide","prop","text","$payments","$apply_coupon_button","$coupon_input","$coupon_error","$deposit_mode","$coupon_info_text","$buttons","on","this","val","show","eq","trigger","deposit_full","prev","css","e","removeClass","coupon_code","errors","addClass","stop","$form","is","hasClass","preventDefault","handleCardPayment","intent_secret","then","result","intent_id","message","error_message","card","number","cvc","exp_month","exp_year","handleErrorCartItemNotAvailable","closest","payment_type","payment_id","submit","stepDetails","done","skip_steps","cart","stepTime","stepCart","failed_key","failed_cart_key","intlTelInput","update_details_dialog","woocommerce","google_maps","enabled","each","autocompleteInput","autocomplete","google","maps","places","Autocomplete","types","autocompleteFields","selector","getFieldValueByType","short","useShortName","addressComponents","getPlace","address_components","i","addressType","addListener","forEach","field","element","initGooglePlacesAutocomplete","body","phone_number","$guest_info","$phone_field","$email_field","$email_confirm_field","$birthday_day_field","$birthday_month_field","$birthday_year_field","$address_country_field","$address_state_field","$address_postcode_field","$address_city_field","$address_street_field","$address_street_number_field","$address_additional_field","$address_country_error","$address_state_error","$address_postcode_error","$address_city_error","$address_street_error","$address_street_number_error","$address_additional_error","$birthday_day_error","$birthday_month_error","$birthday_year_error","$full_name_field","$first_name_field","$last_name_field","$notes_field","$custom_field","$info_field","$phone_error","$email_error","$email_confirm_error","$name_error","$first_name_error","$last_name_error","$captcha","$custom_error","$info_error","$modals","$login_modal","$cst_modal","$next_btn","$errors","map","fn","toArray","$fields","populateForm","full_name","first_name","last_name","birthday","dateParts","year","parseInt","month","day","phone","country","state","postcode","city","street","street_number","additional_address","email","info_fields","id","value","filter","preferredCountries","initialCountry","geoIpLookup","callback","get","always","resp","countryCode","utilsScript","utils","remove","appendTo","delegateTarget","end","log","pwd","rememberme","fadeOut","facebook","FB","XFBML","parse","parent","onStatusChange","undefined","api","fields","userInfo","force_update_customer","checkbox_values","custom_fields","captcha_ids","$this","push","$cf_container","key","custom_fields_data","JSON","stringify","email_confirm","address_iso","notes","empty","cart_url","$scroll_to","appointments_limit_reached","name","errorElement","formElement","field_id","$div","$custom_fields_collector","customer","no_time","no_extras","stepService","stepExtras","repeat","extras","step_extras","stepRepeat","attr","captcha_url","from_step","cart_prev_step","new_chain","$cart_item","cart_key","remove_cart_key","$trs_to_remove","delay","total_waiting_list","waiting_list_price","waiting_list_deposit","subtotal_price","subtotal_deposit","pay_now_deposit","pay_now_tax","total_price","total_tax","edit_cart_item","$repeat_enabled","$next_step","$repeat_container","$variants","$repeat_variant","$button_get_schedule","$variant_weekly","$variant_monthly","$date_until","$repeat_times","$monthly_specific_day","$monthly_week_day","$repeat_every_day","$week_day","$schedule_container","$days_error","$schedule_slots","$intersection_info","$info_help","$info_wells","$pagination","$schedule_row_template","pages_warning_info","short_date_format","bound_date","min","date_min","max","date_max","schedule","prepareButtonNextState","is_disabled","new_prop_disabled","deleted","addTimeSlotControl","$schedule_row","options","preferred_time","selected_time","prefer","$time","index","option","$option","title","append","toggle","renderSchedulePage","page","$row","count","warning_pages","j","clone","datetime","display_date","all_day_service_time","display_time","another_time","$btn","replace","join","renderFullSchedule","item","row_index","$date","$edit_button","ladda_round","pickadate","formatSubmit","format","clear","close","today","monthsFull","months","weekdaysFull","days","weekdaysShort","daysShort","labelMonthNext","nextMonth","labelMonthPrev","prevMonth","firstDay","start_of_week","onSet","exclude","slots","date","set","Date","$date_container","$time_container","$select","isDateMatchesSelections","current_date","inArray","toLowerCase","week_days","diff","date_from","startOf","checked_week_days","endOf","month_diff","updateRepeatDate","number_of_times","repeat_times","slice","date_until","moment_until","moment","add","isBefore","subtract","updateRepeatTimes","date_format","open_repeat_onchange","repeated","repeat_data","repeat_params","until","every","weekday","could_be_repeated","not","off","unrepeat","slots_to_send","concat","add_to_cart","xhr_render_time","time","prev_step","service","use_client_time_zone","time_zone","timeZone","time_zone_offset","timeZoneOffset","$screens","slots_per_column","columns_per_screen","$columnizer_wrap","$columnizer","$time_next_button","$time_prev_button","$current_screen","column_width","time_slots_wide","column_class","columns","screen_index","has_more_slots","form_hidden","show_calendar","is_rtl","show_day_per_column","day_one_column","prepareSlotsHtml","slots_data","selected_date","showSpinner","dropAjax","$input","disable","disabled_days","closeOnSelect","klass","picker","select","initSlots","open","onClose","onRender","UTC","setUTCMonth","getUTCMonth","toJSON","substr","group","group_slots","has_slots","height","width","hammertime","hammer","swipe_velocity","left","duration","$button","last_slot","$html","$first_day","opts","lines","radius","Spinner","spin","$column","$screen","slots_count","max_slots","splice","$columns","$first_slot","$group_slot","prepend","xhr_session_save","abort","data-style","data-spinner-color","data-spinner-size","slot","time_text","additional_text","$back_step","$goto_cart","$extras_items","$extras_summary","currency","extrasChanged","$extras_item","quantity","$total","parseFloat","toFixed","precision","toggleClass","amount","multiplier","Math","$extras_container","chain_id","chain_extras","$chain_item_draft","$select_location","$select_category","$select_service","$select_employee","$select_duration","$select_nop","$select_quantity","$date_from","$select_time_from","$select_time_to","$mobile_next_step","$mobile_prev_step","locations","categories","services","staff","chain","required","defaults","services_per_location","last_chain_key","category_selected","service_name_with_duration","show_ratings","timestamp","isNumeric","getDay","setSelect","obj","docFragment","createDocumentFragment","Object","keys","sort","a","b","pos","object","createElement","appendChild","setSelects","$chain_item","location_id","category_id","service_id","staff_id","_location_id","_staff","_services","_categories","_nop","_max_capacity","_min_capacity","staff_member","loc_id","loc_srv","min_capacity","max_capacity","price","s_id","category_ids","service_ids","st_id","category","nop","form_attributes","show_number_of_persons","rating","valid","updateServiceDurationSelect","$units_duration","current_duration","locationId","staffLocations","units","getUnitsByStaffId","hide_locations","hide_categories","hide_services","hide_staff_members","hide_service_duration","hide_quantity","hide_date","hide_week_days","hide_time_range","chain_item","after","const_category_id","staff_ids","number_of_persons","$new_chain","start_time","end_time","$last_time_entry","selectedIndex","first_value","stepServiceValidator","$chain","has_extras","time_requirements","_time_requirements","optional","_service","time_from","time_to","skip_scroll","service_part2","service_part1","importScript","src","async","onLoad","script","Function","onload","head","bookly","Intl","DateTimeFormat","resolvedOptions","getTimezoneOffset","init","appId","version","getLoginStatus","Event","subscribe","api_key","jQuery"],"mappings":"CAAC,SAAUA,GACP,aAEAA,EAAIA,GAAKA,EAAEC,eAAe,WAAaD,EAAW,QAAIA,EAEtD,IAAIE,GAAM,GAKV,SAASC,GAAWC,GAChB,IAAIC,EAAQC,MAAMC,OAAOH,GAEzB,OADAC,EAAMG,QACCH,EAQX,SAASI,GAASC,GACd,IAAIC,EAAYD,EAAME,SAASC,IAC3BC,EAAYd,EAAEe,QAAQD,aACtBH,EAAUX,EAAEe,QAAQD,aAAeH,EAAUG,EAAYC,OAAOC,cAChEhB,EAAE,aAAaiB,QAAQ,CAAEH,U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I3BuM,GAAGwa,MAAMC,UAAU,oBAAqB,SAAShnB,GACzCyS,EAAQnG,SAASK,gBACjB8F,EAAQnG,SAASK,eAAe3M,QAzC5CyS,EAAQ5U,eAAe,gBAAkB4U,EAAQvN,YAAYC,UAI7D2gB,EAFU,+CADGrT,EAAQvN,YAAY+hB,QACmC,qBAElD,GAElBxU,EAAQ5U,eAAe,WAAa4U,EAAQtR,OAAOgE,SACnD2gB,EAAa,6BAA6B,IAnvGtD,CA2yGEoB"}
1
+ {"version":3,"sources":["bookly.js"],"names":["quot;,"hasOwnProperty","opt","laddaStart","elem","ladda","Ladda","create","start","scrollTo","$elem","elemTop","offset","top","scrollTop","window","innerHeight","animate","stepComplete","params","data","extend","action","csrf_token","BooklyL10n","$container","form_id","ajax","url","ajaxurl","dataType","xhrFields","withCredentials","crossDomain","XMLHttpRequest","success","response","final_step_url","error","document","location","href","html","stepPayment","type","page_url","URL","split","disabled","save","status","booking","find","length","stripe_publishable_key","stripe","Stripe","betas","stripe_card","elements","mount","hide","prop","text","$payments","$apply_coupon_button","$coupon_input","$coupon_error","$deposit_mode","$coupon_info_text","$buttons","on","this","val","show","eq","trigger","deposit_full","prev","css","e","removeClass","coupon_code","errors","addClass","stop","$form","is","hasClass","preventDefault","handleCardPayment","intent_secret","then","result","intent_id","message","error_message","card","number","cvc","exp_month","exp_year","handleErrorCartItemNotAvailable","closest","payment_type","payment_id","submit","stepDetails","done","skip_steps","cart","stepTime","stepCart","failed_key","failed_cart_key","intlTelInput","update_details_dialog","woocommerce","google_maps","enabled","each","autocompleteInput","autocomplete","google","maps","places","Autocomplete","types","autocompleteFields","selector","getFieldValueByType","short","useShortName","addressComponents","getPlace","address_components","i","addressType","addListener","forEach","field","element","initGooglePlacesAutocomplete","body","phone_number","$guest_info","$phone_field","$email_field","$email_confirm_field","$birthday_day_field","$birthday_month_field","$birthday_year_field","$address_country_field","$address_state_field","$address_postcode_field","$address_city_field","$address_street_field","$address_street_number_field","$address_additional_field","$address_country_error","$address_state_error","$address_postcode_error","$address_city_error","$address_street_error","$address_street_number_error","$address_additional_error","$birthday_day_error","$birthday_month_error","$birthday_year_error","$full_name_field","$first_name_field","$last_name_field","$notes_field","$custom_field","$info_field","$phone_error","$email_error","$email_confirm_error","$name_error","$first_name_error","$last_name_error","$captcha","$custom_error","$info_error","$modals","$login_modal","$cst_modal","$next_btn","$errors","map","fn","toArray","$fields","populateForm","full_name","first_name","last_name","birthday","dateParts","year","parseInt","month","day","phone","country","state","postcode","city","street","street_number","additional_address","email","info_fields","id","value","filter","preferredCountries","initialCountry","geoIpLookup","callback","get","always","resp","countryCode","utilsScript","utils","remove","appendTo","delegateTarget","end","log","pwd","rememberme","fadeOut","facebook","FB","XFBML","parse","parent","onStatusChange","undefined","api","fields","userInfo","force_update_customer","checkbox_values","custom_fields","captcha_ids","$this","push","$cf_container","key","custom_fields_data","JSON","stringify","email_confirm","address_iso","notes","empty","cart_url","$scroll_to","appointments_limit_reached","name","errorElement","formElement","field_id","$div","$custom_fields_collector","customer","no_time","no_extras","stepService","stepExtras","repeat","extras","step_extras","stepRepeat","attr","captcha_url","from_step","cart_prev_step","new_chain","$cart_item","cart_key","remove_cart_key","$trs_to_remove","delay","total_waiting_list","waiting_list_price","waiting_list_deposit","subtotal_price","subtotal_deposit","pay_now_deposit","pay_now_tax","total_price","total_tax","edit_cart_item","$repeat_enabled","$next_step","$repeat_container","$variants","$repeat_variant","$button_get_schedule","$variant_weekly","$variant_monthly","$date_until","$repeat_times","$monthly_specific_day","$monthly_week_day","$repeat_every_day","$week_day","$schedule_container","$days_error","$schedule_slots","$intersection_info","$info_help","$info_wells","$pagination","$schedule_row_template","pages_warning_info","short_date_format","bound_date","min","date_min","max","date_max","schedule","prepareButtonNextState","is_disabled","new_prop_disabled","deleted","addTimeSlotControl","$schedule_row","options","preferred_time","selected_time","prefer","$time","index","option","$option","title","append","toggle","renderSchedulePage","page","$row","count","warning_pages","j","clone","datetime","display_date","all_day_service_time","display_time","another_time","$btn","replace","join","renderFullSchedule","item","row_index","$date","$edit_button","ladda_round","pickadate","formatSubmit","format","clear","close","today","monthsFull","months","weekdaysFull","days","weekdaysShort","daysShort","labelMonthNext","nextMonth","labelMonthPrev","prevMonth","firstDay","start_of_week","onSet","exclude","slots","date","set","Date","$date_container","$time_container","$select","isDateMatchesSelections","current_date","inArray","toLowerCase","week_days","diff","date_from","startOf","checked_week_days","endOf","month_diff","updateRepeatDate","number_of_times","repeat_times","slice","date_until","moment_until","moment","add","isBefore","subtract","updateRepeatTimes","date_format","open_repeat_onchange","repeated","repeat_data","repeat_params","until","every","weekday","could_be_repeated","not","off","unrepeat","slots_to_send","concat","add_to_cart","xhr_render_time","time","prev_step","service","use_client_time_zone","time_zone","timeZone","time_zone_offset","timeZoneOffset","$screens","slots_per_column","columns_per_screen","$columnizer_wrap","$columnizer","$time_next_button","$time_prev_button","$current_screen","column_width","time_slots_wide","column_class","columns","screen_index","has_more_slots","form_hidden","show_calendar","is_rtl","show_day_per_column","day_one_column","prepareSlotsHtml","slots_data","selected_date","showSpinner","dropAjax","$input","disable","disabled_days","closeOnSelect","klass","picker","select","initSlots","open","onClose","onRender","UTC","setUTCMonth","getUTCMonth","toJSON","substr","group","group_slots","has_slots","height","width","hammertime","hammer","swipe_velocity","left","duration","$button","last_slot","$html","$first_day","opts","lines","radius","Spinner","spin","$column","$screen","slots_count","max_slots","splice","$columns","$first_slot","$group_slot","prepend","xhr_session_save","abort","data-style","data-spinner-color","data-spinner-size","slot","time_text","additional_text","$back_step","$goto_cart","$extras_items","$extras_summary","currency","extrasChanged","$extras_item","quantity","$total","parseFloat","toFixed","precision","toggleClass","amount","multiplier","Math","$extras_container","chain_id","chain_extras","$chain_item_draft","$select_location","$select_category","$select_service","$select_employee","$select_duration","$select_nop","$select_quantity","$date_from","$select_time_from","$select_time_to","$mobile_next_step","$mobile_prev_step","locations","categories","services","staff","chain","required","defaults","services_per_location","last_chain_key","category_selected","service_name_with_duration","show_ratings","timestamp","isNumeric","getDay","setSelect","obj","docFragment","createDocumentFragment","Object","keys","sort","a","b","pos","object","createElement","appendChild","setSelects","$chain_item","location_id","category_id","service_id","staff_id","_location_id","_staff","_services","_categories","_nop","_max_capacity","_min_capacity","staff_member","loc_id","loc_srv","min_capacity","max_capacity","price","s_id","category_ids","service_ids","st_id","category","nop","form_attributes","show_number_of_persons","rating","valid","updateServiceDurationSelect","$units_duration","current_duration","locationId","staffLocations","units","getUnitsByStaffId","hide_locations","hide_categories","hide_services","hide_staff_members","hide_service_duration","hide_quantity","hide_date","hide_week_days","hide_time_range","chain_item","after","const_category_id","staff_ids","number_of_persons","$new_chain","start_time","end_time","$last_time_entry","selectedIndex","first_value","stepServiceValidator","$chain","has_extras","time_requirements","_time_requirements","optional","_service","time_from","time_to","skip_scroll","service_part2","service_part1","importScript","src","async","onLoad","script","Function","onload","head","bookly","Intl","DateTimeFormat","resolvedOptions","getTimezoneOffset","init","appId","version","getLoginStatus","Event","subscribe","api_key","jQuery"],"mappings":"CAAC,SAAUA,GACP,aAEAA,EAAIA,GAAKA,EAAEC,eAAe,WAAaD,EAAW,QAAIA,EAEtD,IAAIE,GAAM,GAKV,SAASC,GAAWC,GAChB,IAAIC,EAAQC,MAAMC,OAAOH,GAEzB,OADAC,EAAMG,QACCH,EAQX,SAASI,GAASC,GACd,IAAIC,EAAYD,EAAME,SAASC,IAC3BC,EAAYd,EAAEe,QAAQD,aACtBH,EAAUX,EAAEe,QAAQD,aAAeH,EAAUG,EAAYC,OAAOC,cAChEhB,EAAE,aAAaiB,QAAQ,CAAEH,UAAYH,EAAU,IAAO,KAO9D,SAASO,GAAaC,GAClB,IAAIC,EAAOpB,EAAEqB,OAAO,CACZC,OAAY,yBACZC,WAAYC,WAAWD,YACxBJ,GACHM,EAAavB,GAAIiB,EAAOO,SAASD,WACrCzB,EAAE2B,KAAK,CACHC,IAAKJ,WAAWK,QAChBT,KAAMA,EACNU,SAAU,OACVC,UAAW,CAACC,iBAAiB,GAC7BC,YAAa,oBAAq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AAY+hB,QACmC,qBAElD,GAElBxU,EAAQ5U,eAAe,WAAa4U,EAAQtR,OAAOgE,SACnD2gB,EAAa,6BAA6B,IArvGtD,CA6yGEoB"}
frontend/resources/js/src/service_step.js CHANGED
@@ -505,6 +505,8 @@ export default function stepService(params) {
505
// Deselect category to keep full list of services.
506
$('.bookly-js-select-category', $chain_item).val('');
507
}
508
}
509
}
510
if (!opt[params.form_id].form_attributes.hide_staff_members && chain_item.staff_ids.length == 1 && chain_item.staff_ids[0]) {
505
// Deselect category to keep full list of services.
506
$('.bookly-js-select-category', $chain_item).val('');
507
}
508
+ } else {
509
+ $('.bookly-js-select-category', $chain_item).val(services[chain_item.service_id].category_id).trigger('change');
510
}
511
}
512
if (!opt[params.form_id].form_attributes.hide_staff_members && chain_item.staff_ids.length == 1 && chain_item.staff_ids[0]) {
languages/bookly.pot CHANGED
@@ -362,6 +362,9 @@ msgstr ""
362
msgid "date of appointment"
363
msgstr ""
364
365
msgid "time of appointment"
366
msgstr ""
367
@@ -3362,9 +3365,6 @@ msgstr ""
3362
msgid "end time of appointment"
3363
msgstr ""
3364
3365
- msgid "customer notes for appointment"
3366
- msgstr ""
3367
-
3368
msgid "cart information"
3369
msgstr ""
3370
@@ -5138,6 +5138,9 @@ msgid ""
5138
"Sorry, the time slot %date_time% for %service% has been already occupied."
5139
msgstr ""
5140
5141
msgid "Service was not found"
5142
msgstr ""
5143
362
msgid "date of appointment"
363
msgstr ""
364
365
+ msgid "customer notes for appointment"
366
+ msgstr ""
367
+
368
msgid "time of appointment"
369
msgstr ""
370
3365
msgid "end time of appointment"
3366
msgstr ""
3367
3368
msgid "cart information"
3369
msgstr ""
3370
5138
"Sorry, the time slot %date_time% for %service% has been already occupied."
5139
msgstr ""
5140
5141
+ msgid "This service is no longer provided."
5142
+ msgstr ""
5143
+
5144
msgid "Service was not found"
5145
msgstr ""
5146
lib/Installer.php CHANGED
@@ -30,7 +30,7 @@ class Installer extends Base\Installer
30
'type' => Notification::TYPE_NEW_BOOKING,
31
'name' => __( 'Notification to customer about approved appointment', 'bookly' ),
32
'subject' => __( 'Your appointment information', 'bookly' ),
33
- 'message' => wpautop( __( "Dear {client_name}.\n\nThis is a confirmation that you have booked {service_name}.\n\nWe are waiting you at {company_address} on {appointment_date} at {appointment_time}.\n\nThank you for choosing our company.\n\n{company_name}\n{company_phone}\n{company_website}", 'bookly' ) ),
34
'active' => 1,
35
'to_customer' => 1,
36
'settings' => $settings,
@@ -42,7 +42,7 @@ class Installer extends Base\Installer
42
'type' => Notification::TYPE_NEW_BOOKING,
43
'name' => __( 'Notification to staff member about approved appointment', 'bookly' ),
44
'subject' => __( 'New booking information', 'bookly' ),
45
- 'message' => wpautop( __( "Hello.\n\nYou have a new booking.\n\nService: {service_name}\nDate: {appointment_date}\nTime: {appointment_time}\nClient name: {client_name}\nClient phone: {client_phone}\nClient email: {client_email}", 'bookly' ) ),
46
'active' => 1,
47
'to_staff' => 1,
48
'settings' => $settings,
@@ -54,7 +54,7 @@ class Installer extends Base\Installer
54
'type' => Notification::TYPE_CUSTOMER_APPOINTMENT_STATUS_CHANGED,
55
'name' => __( 'Notification to customer about cancelled appointment', 'bookly' ),
56
'subject' => __( 'Booking cancellation', 'bookly' ),
57
- 'message' => wpautop( __( "Dear {client_name}.\n\nYou have cancelled your booking of {service_name} on {appointment_date} at {appointment_time}.\n\nThank you for choosing our company.\n\n{company_name}\n{company_phone}\n{company_website}", 'bookly' ) ),
58
'active' => 1,
59
'to_customer' => 1,
60
'settings' => $settings,
@@ -66,7 +66,7 @@ class Installer extends Base\Installer
66
'type' => Notification::TYPE_CUSTOMER_APPOINTMENT_STATUS_CHANGED,
67
'name' => __( 'Notification to staff member about cancelled appointment', 'bookly' ),
68
'subject' => __( 'Booking cancellation', 'bookly' ),
69
- 'message' => wpautop( __( "Hello.\n\nThe following booking has been cancelled.\n\nService: {service_name}\nDate: {appointment_date}\nTime: {appointment_time}\nClient name: {client_name}\nClient phone: {client_phone}\nClient email: {client_email}", 'bookly' ) ),
70
'active' => 1,
71
'to_staff' => 1,
72
'settings' => $settings,
@@ -78,7 +78,7 @@ class Installer extends Base\Installer
78
'type' => Notification::TYPE_CUSTOMER_APPOINTMENT_STATUS_CHANGED,
79
'name' => __( 'Notification to customer about rejected appointment', 'bookly' ),
80
'subject' => __( 'Booking rejection', 'bookly' ),
81
- 'message' => wpautop( __( "Dear {client_name}.\n\nYour booking of {service_name} on {appointment_date} at {appointment_time} has been rejected.\n\nReason: {cancellation_reason}\n\nThank you for choosing our company.\n\n{company_name}\n{company_phone}\n{company_website}", 'bookly' ) ),
82
'active' => 1,
83
'to_customer' => 1,
84
'settings' => $settings,
@@ -90,7 +90,7 @@ class Installer extends Base\Installer
90
'type' => Notification::TYPE_CUSTOMER_APPOINTMENT_STATUS_CHANGED,
91
'name' => __( 'Notification to staff member about rejected appointment', 'bookly' ),
92
'subject' => __( 'Booking rejection', 'bookly' ),
93
- 'message' => wpautop( __( "Hello.\n\nThe following booking has been rejected.\n\nReason: {cancellation_reason}\n\nService: {service_name}\nDate: {appointment_date}\nTime: {appointment_time}\nClient name: {client_name}\nClient phone: {client_phone}\nClient email: {client_email}", 'bookly' ) ),
94
'active' => 1,
95
'to_staff' => 1,
96
'settings' => $settings,
@@ -395,6 +395,10 @@ class Installer extends Base\Installer
395
/** @global \wpdb $wpdb */
396
global $wpdb;
397
398
$wpdb->query(
399
'CREATE TABLE IF NOT EXISTS `' . Entities\Staff::getTableName() . '` (
400
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
@@ -411,8 +415,7 @@ class Installer extends Base\Installer
411
`google_data` TEXT DEFAULT NULL,
412
`outlook_data` TEXT DEFAULT NULL
413
) ENGINE = INNODB
414
- DEFAULT CHARACTER SET = utf8
415
- COLLATE = utf8_general_ci'
416
);
417
418
$wpdb->query(
@@ -421,8 +424,7 @@ class Installer extends Base\Installer
421
`name` VARCHAR(255) NOT NULL,
422
`position` INT NOT NULL DEFAULT 9999
423
) ENGINE = INNODB
424
- DEFAULT CHARACTER SET = utf8
425
- COLLATE = utf8_general_ci'
426
);
427
428
$wpdb->query(
@@ -464,9 +466,8 @@ class Installer extends Base\Installer
464
REFERENCES ' . Entities\Category::getTableName() . '(id)
465
ON DELETE SET NULL
466
ON UPDATE CASCADE
467
- ) ENGINE = INNODB
468
- DEFAULT CHARACTER SET = utf8
469
- COLLATE = utf8_general_ci'
470
);
471
472
$wpdb->query(
@@ -488,8 +489,7 @@ class Installer extends Base\Installer
488
ON DELETE CASCADE
489
ON UPDATE CASCADE
490
) ENGINE = INNODB
491
- DEFAULT CHARACTER SET = utf8
492
- COLLATE = utf8_general_ci'
493
);
494
495
$wpdb->query(
@@ -507,8 +507,7 @@ class Installer extends Base\Installer
507
ON DELETE CASCADE
508
ON UPDATE CASCADE
509
) ENGINE = INNODB
510
- DEFAULT CHARACTER SET = utf8
511
- COLLATE = utf8_general_ci'
512
);
513
514
$wpdb->query(
@@ -533,8 +532,7 @@ class Installer extends Base\Installer
533
ON DELETE CASCADE
534
ON UPDATE CASCADE
535
) ENGINE = INNODB
536
- DEFAULT CHARACTER SET = utf8
537
- COLLATE = utf8_general_ci'
538
);
539
540
$wpdb->query(
@@ -549,8 +547,7 @@ class Installer extends Base\Installer
549
ON DELETE CASCADE
550
ON UPDATE CASCADE
551
) ENGINE = INNODB
552
- DEFAULT CHARACTER SET = utf8
553
- COLLATE = utf8_general_ci'
554
);
555
556
$wpdb->query(
@@ -569,8 +566,7 @@ class Installer extends Base\Installer
569
`attach_invoice` TINYINT(1) NOT NULL DEFAULT 0,
570
`settings` TEXT NULL
571
) ENGINE = INNODB
572
- DEFAULT CHARACTER SET = utf8
573
- COLLATE = utf8_general_ci'
574
);
575
576
$wpdb->query(
@@ -596,8 +592,7 @@ class Installer extends Base\Installer
596
`info_fields` TEXT DEFAULT NULL,
597
`created` DATETIME NOT NULL
598
) ENGINE = INNODB
599
- DEFAULT CHARACTER SET = utf8
600
- COLLATE = utf8_general_ci'
601
);
602
603
$wpdb->query(
@@ -606,8 +601,7 @@ class Installer extends Base\Installer
606
`repeat` VARCHAR(255) DEFAULT NULL,
607
`token` VARCHAR(255) NOT NULL
608
) ENGINE = INNODB
609
- DEFAULT CHARACTER SET = utf8
610
- COLLATE = utf8_general_ci'
611
);
612
613
$wpdb->query(
@@ -641,8 +635,7 @@ class Installer extends Base\Installer
641
ON DELETE CASCADE
642
ON UPDATE CASCADE
643
) ENGINE = INNODB
644
- DEFAULT CHARACTER SET = utf8
645
- COLLATE = utf8_general_ci'
646
);
647
648
$wpdb->query(
@@ -657,8 +650,7 @@ class Installer extends Base\Installer
657
REFERENCES ' . Entities\Staff::getTableName() . '(id)
658
ON DELETE CASCADE
659
) ENGINE = INNODB
660
- DEFAULT CHARACTER SET = utf8
661
- COLLATE = utf8_general_ci'
662
);
663
664
$wpdb->query(
@@ -675,8 +667,7 @@ class Installer extends Base\Installer
675
`details` TEXT DEFAULT NULL,
676
`created` DATETIME NOT NULL
677
) ENGINE = INNODB
678
- DEFAULT CHARACTER SET = utf8
679
- COLLATE = utf8_general_ci'
680
);
681
682
$wpdb->query(
@@ -729,8 +720,7 @@ class Installer extends Base\Installer
729
ON DELETE SET NULL
730
ON UPDATE CASCADE
731
) ENGINE = INNODB
732
- DEFAULT CHARACTER SET = utf8
733
- COLLATE = utf8_general_ci'
734
);
735
736
$wpdb->query(
@@ -746,8 +736,7 @@ class Installer extends Base\Installer
746
ON DELETE CASCADE
747
ON UPDATE CASCADE
748
) ENGINE = INNODB
749
- DEFAULT CHARACTER SET = utf8
750
- COLLATE = utf8_general_ci'
751
);
752
753
$wpdb->query(
@@ -757,8 +746,7 @@ class Installer extends Base\Installer
757
`value` TEXT DEFAULT NULL,
758
`created` DATETIME NOT NULL
759
) ENGINE = INNODB
760
- DEFAULT CHARACTER SET = utf8
761
- COLLATE = utf8_general_ci'
762
);
763
764
$wpdb->query(
@@ -771,8 +759,7 @@ class Installer extends Base\Installer
771
`seen` TINYINT(1) NOT NULL DEFAULT 0,
772
`created` DATETIME NOT NULL
773
) ENGINE = INNODB
774
- DEFAULT CHARACTER SET = utf8
775
- COLLATE = utf8_general_ci'
776
);
777
778
$wpdb->query(
@@ -796,8 +783,7 @@ class Installer extends Base\Installer
796
`seen` TINYINT(1) NOT NULL DEFAULT 0,
797
`created` DATETIME NOT NULL
798
) ENGINE = INNODB
799
- DEFAULT CHARACTER SET = utf8
800
- COLLATE = utf8_general_ci'
801
);
802
}
803
30
'type' => Notification::TYPE_NEW_BOOKING,
31
'name' => __( 'Notification to customer about approved appointment', 'bookly' ),
32
'subject' => __( 'Your appointment information', 'bookly' ),
33
+ 'message' => __( "Dear {client_name}.\n\nThis is a confirmation that you have booked {service_name}.\n\nWe are waiting you at {company_address} on {appointment_date} at {appointment_time}.\n\nThank you for choosing our company.\n\n{company_name}\n{company_phone}\n{company_website}", 'bookly' ),
34
'active' => 1,
35
'to_customer' => 1,
36
'settings' => $settings,
42
'type' => Notification::TYPE_NEW_BOOKING,
43
'name' => __( 'Notification to staff member about approved appointment', 'bookly' ),
44
'subject' => __( 'New booking information', 'bookly' ),
45
+ 'message' => __( "Hello.\n\nYou have a new booking.\n\nService: {service_name}\nDate: {appointment_date}\nTime: {appointment_time}\nClient name: {client_name}\nClient phone: {client_phone}\nClient email: {client_email}", 'bookly' ),
46
'active' => 1,
47
'to_staff' => 1,
48
'settings' => $settings,
54
'type' => Notification::TYPE_CUSTOMER_APPOINTMENT_STATUS_CHANGED,
55
'name' => __( 'Notification to customer about cancelled appointment', 'bookly' ),
56
'subject' => __( 'Booking cancellation', 'bookly' ),
57
+ 'message' => __( "Dear {client_name}.\n\nYou have cancelled your booking of {service_name} on {appointment_date} at {appointment_time}.\n\nThank you for choosing our company.\n\n{company_name}\n{company_phone}\n{company_website}", 'bookly' ),
58
'active' => 1,
59
'to_customer' => 1,
60
'settings' => $settings,
66
'type' => Notification::TYPE_CUSTOMER_APPOINTMENT_STATUS_CHANGED,
67
'name' => __( 'Notification to staff member about cancelled appointment', 'bookly' ),
68
'subject' => __( 'Booking cancellation', 'bookly' ),
69
+ 'message' => __( "Hello.\n\nThe following booking has been cancelled.\n\nService: {service_name}\nDate: {appointment_date}\nTime: {appointment_time}\nClient name: {client_name}\nClient phone: {client_phone}\nClient email: {client_email}", 'bookly' ),
70
'active' => 1,
71
'to_staff' => 1,
72
'settings' => $settings,
78
'type' => Notification::TYPE_CUSTOMER_APPOINTMENT_STATUS_CHANGED,
79
'name' => __( 'Notification to customer about rejected appointment', 'bookly' ),
80
'subject' => __( 'Booking rejection', 'bookly' ),
81
+ 'message' => __( "Dear {client_name}.\n\nYour booking of {service_name} on {appointment_date} at {appointment_time} has been rejected.\n\nReason: {cancellation_reason}\n\nThank you for choosing our company.\n\n{company_name}\n{company_phone}\n{company_website}", 'bookly' ),
82
'active' => 1,
83
'to_customer' => 1,
84
'settings' => $settings,
90
'type' => Notification::TYPE_CUSTOMER_APPOINTMENT_STATUS_CHANGED,
91
'name' => __( 'Notification to staff member about rejected appointment', 'bookly' ),
92
'subject' => __( 'Booking rejection', 'bookly' ),
93
+ 'message' => __( "Hello.\n\nThe following booking has been rejected.\n\nReason: {cancellation_reason}\n\nService: {service_name}\nDate: {appointment_date}\nTime: {appointment_time}\nClient name: {client_name}\nClient phone: {client_phone}\nClient email: {client_email}", 'bookly' ),
94
'active' => 1,
95
'to_staff' => 1,
96
'settings' => $settings,
395
/** @global \wpdb $wpdb */
396
global $wpdb;
397
398
+ $charset_collate = $wpdb->has_cap( 'collation' )
399
+ ? $wpdb->get_charset_collate()
400
+ : 'DEFAULT CHARACTER SET = utf8 COLLATE = utf8_general_ci';
401
+
402
$wpdb->query(
403
'CREATE TABLE IF NOT EXISTS `' . Entities\Staff::getTableName() . '` (
404
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
415
`google_data` TEXT DEFAULT NULL,
416
`outlook_data` TEXT DEFAULT NULL
417
) ENGINE = INNODB
418
+ ' . $charset_collate
419
);
420
421
$wpdb->query(
424
`name` VARCHAR(255) NOT NULL,
425
`position` INT NOT NULL DEFAULT 9999
426
) ENGINE = INNODB
427
+ ' . $charset_collate
428
);
429
430
$wpdb->query(
466
REFERENCES ' . Entities\Category::getTableName() . '(id)
467
ON DELETE SET NULL
468
ON UPDATE CASCADE
469
+ ) ENGINE = INNODB
470
+ ' . $charset_collate
471
);
472
473
$wpdb->query(
489
ON DELETE CASCADE
490
ON UPDATE CASCADE
491
) ENGINE = INNODB
492
+ ' . $charset_collate
493
);
494
495
$wpdb->query(
507
ON DELETE CASCADE
508
ON UPDATE CASCADE
509
) ENGINE = INNODB
510
+ ' . $charset_collate
511
);
512
513
$wpdb->query(
532
ON DELETE CASCADE
533
ON UPDATE CASCADE
534
) ENGINE = INNODB
535
+ ' . $charset_collate
536
);
537
538
$wpdb->query(
547
ON DELETE CASCADE
548
ON UPDATE CASCADE
549
) ENGINE = INNODB
550
+ ' . $charset_collate
551
);
552
553
$wpdb->query(
566
`attach_invoice` TINYINT(1) NOT NULL DEFAULT 0,
567
`settings` TEXT NULL
568
) ENGINE = INNODB
569
+ ' . $charset_collate
570
);
571
572
$wpdb->query(
592
`info_fields` TEXT DEFAULT NULL,
593
`created` DATETIME NOT NULL
594
) ENGINE = INNODB
595
+ ' . $charset_collate
596
);
597
598
$wpdb->query(
601
`repeat` VARCHAR(255) DEFAULT NULL,
602
`token` VARCHAR(255) NOT NULL
603
) ENGINE = INNODB
604
+ ' . $charset_collate
605
);
606
607
$wpdb->query(
635
ON DELETE CASCADE
636
ON UPDATE CASCADE
637
) ENGINE = INNODB
638
+ ' . $charset_collate
639
);
640
641
$wpdb->query(
650
REFERENCES ' . Entities\Staff::getTableName() . '(id)
651
ON DELETE CASCADE
652
) ENGINE = INNODB
653
+ ' . $charset_collate
654
);
655
656
$wpdb->query(
667
`details` TEXT DEFAULT NULL,
668
`created` DATETIME NOT NULL
669
) ENGINE = INNODB
670
+ ' . $charset_collate
671
);
672
673
$wpdb->query(
720
ON DELETE SET NULL
721
ON UPDATE CASCADE
722
) ENGINE = INNODB
723
+ ' . $charset_collate
724
);
725
726
$wpdb->query(
736
ON DELETE CASCADE
737
ON UPDATE CASCADE
738
) ENGINE = INNODB
739
+ ' . $charset_collate
740
);
741
742
$wpdb->query(
746
`value` TEXT DEFAULT NULL,
747
`created` DATETIME NOT NULL
748
) ENGINE = INNODB
749
+ ' . $charset_collate
750
);
751
752
$wpdb->query(
759
`seen` TINYINT(1) NOT NULL DEFAULT 0,
760
`created` DATETIME NOT NULL
761
) ENGINE = INNODB
762
+ ' . $charset_collate
763
);
764
765
$wpdb->query(
783
`seen` TINYINT(1) NOT NULL DEFAULT 0,
784
`created` DATETIME NOT NULL
785
) ENGINE = INNODB
786
+ ' . $charset_collate
787
);
788
}
789
lib/Updater.php CHANGED
@@ -7,6 +7,30 @@ namespace Bookly\Lib;
7
*/
8
class Updater extends Base\Updater
9
{
10
function update_16_9()
11
{
12
/** @global \wpdb $wpdb */
7
*/
8
class Updater extends Base\Updater
9
{
10
+ function update_17_3()
11
+ {
12
+ $this->upgradeCharsetCollate( array(
13
+ 'bookly_appointments',
14
+ 'bookly_categories',
15
+ 'bookly_customer_appointments',
16
+ 'bookly_customers',
17
+ 'bookly_holidays',
18
+ 'bookly_messages',
19
+ 'bookly_notifications',
20
+ 'bookly_payments',
21
+ 'bookly_schedule_item_breaks',
22
+ 'bookly_sent_notifications',
23
+ 'bookly_series',
24
+ 'bookly_services',
25
+ 'bookly_shop',
26
+ 'bookly_staff',
27
+ 'bookly_staff_schedule_items',
28
+ 'bookly_staff_services',
29
+ 'bookly_stats',
30
+ 'bookly_sub_services',
31
+ ) );
32
+ }
33
+
34
function update_16_9()
35
{
36
/** @global \wpdb $wpdb */
lib/UserBookingData.php CHANGED
@@ -195,9 +195,6 @@ class UserBookingData
195
} elseif ( get_option( 'bookly_cst_remember_in_cookie' ) && isset( $_COOKIE['bookly-cst-full-name'] ) ) {
196
$this
197
->setFullName( $_COOKIE['bookly-cst-full-name'] )
198
- ->setEmail( $_COOKIE['bookly-cst-email'] )
199
- ->setEmailConfirm( $_COOKIE['bookly-cst-email'] )
200
- ->setPhone( $_COOKIE['bookly-cst-phone'] )
201
->setInfoFields( (array) json_decode( stripslashes( $_COOKIE['bookly-cst-info-fields'] ), true ) )
202
;
203
if ( isset( $_COOKIE['bookly-cst-birthday'] ) ) {
@@ -209,6 +206,8 @@ class UserBookingData
209
);
210
$this->setBirthday( $birthday );
211
}
212
if ( isset( $_COOKIE['bookly-cst-first-name'] ) ) { $this->setFirstName( $_COOKIE['bookly-cst-first-name'] ); }
213
if ( isset( $_COOKIE['bookly-cst-last-name'] ) ) { $this->setLastName( $_COOKIE['bookly-cst-last-name'] ); }
214
if ( isset( $_COOKIE['bookly-cst-country'] ) ) { $this->setCountry( $_COOKIE['bookly-cst-country'] ); }
@@ -687,21 +686,26 @@ class UserBookingData
687
} else {
688
$customer_data['full_name'] = $this->getFullName();
689
}
690
$this->customer->loadBy( $customer_data );
691
} else {
692
// Try to find customer by phone or email.
693
- $this->customer->loadBy(
694
- Config::phoneRequired()
695
- ? array( 'phone' => $this->getPhone() )
696
- : array( 'email' => $this->getEmail() )
697
- );
698
- if ( ! $this->customer->isLoaded() ) {
699
- // Try to find customer by 'secondary' identifier, otherwise return new customer.
700
- $this->customer->loadBy(
701
- Config::phoneRequired()
702
- ? array( 'email' => $this->getEmail(), 'phone' => '' )
703
- : array( 'phone' => $this->getPhone(), 'email' => '' )
704
- );
705
}
706
}
707
}
195
} elseif ( get_option( 'bookly_cst_remember_in_cookie' ) && isset( $_COOKIE['bookly-cst-full-name'] ) ) {
196
$this
197
->setFullName( $_COOKIE['bookly-cst-full-name'] )
198
->setInfoFields( (array) json_decode( stripslashes( $_COOKIE['bookly-cst-info-fields'] ), true ) )
199
;
200
if ( isset( $_COOKIE['bookly-cst-birthday'] ) ) {
206
);
207
$this->setBirthday( $birthday );
208
}
209
+ if ( isset( $_COOKIE['bookly-cst-email'] ) ) { $this->setEmail( $_COOKIE['bookly-cst-email'] )->setEmailConfirm( $_COOKIE['bookly-cst-email'] ); }
210
+ if ( isset( $_COOKIE['bookly-cst-phone'] ) ) { $this->setPhone( $_COOKIE['bookly-cst-phone'] ); }
211
if ( isset( $_COOKIE['bookly-cst-first-name'] ) ) { $this->setFirstName( $_COOKIE['bookly-cst-first-name'] ); }
212
if ( isset( $_COOKIE['bookly-cst-last-name'] ) ) { $this->setLastName( $_COOKIE['bookly-cst-last-name'] ); }
213
if ( isset( $_COOKIE['bookly-cst-country'] ) ) { $this->setCountry( $_COOKIE['bookly-cst-country'] ); }
686
} else {
687
$customer_data['full_name'] = $this->getFullName();
688
}
689
+ if ( $this->getEmail() != '' ) {
690
+ $customer_data['email'] = $this->getEmail();
691
+ }
692
+ if ( $this->getPhone() != '' ) {
693
+ $customer_data['phone'] = $this->getPhone();
694
+ }
695
$this->customer->loadBy( $customer_data );
696
} else {
697
// Try to find customer by phone or email.
698
+ $params = Config::phoneRequired()
699
+ ? ( $this->getPhone() ? array( 'phone' => $this->getPhone() ) : array() )
700
+ : ( $this->getEmail() ? array( 'email' => $this->getEmail() ) : array() );
701
+ if ( ! empty ( $params ) && ! $this->customer->loadBy( $params ) ) {
702
+ $params = Config::phoneRequired()
703
+ ? ( $this->getEmail() ? array( 'email' => $this->getEmail(), 'phone' => '' ) : array() )
704
+ : ( $this->getPhone() ? array( 'phone' => $this->getPhone(), 'email' => '' ) : array() );
705
+ if ( ! empty( $params ) ) {
706
+ // Try to find customer by 'secondary' identifier, otherwise return new customer.
707
+ $this->customer->loadBy( $params );
708
+ }
709
}
710
}
711
}
lib/Validator.php CHANGED
@@ -221,22 +221,30 @@ class Validator
221
if ( ! $customer->isLoaded() ) {
222
// Try to find customer by 'primary' identifier.
223
$identifier = Config::phoneRequired() ? 'phone' : 'email';
224
- $customer->loadBy( array( $identifier => $data[ $identifier ] ) );
225
if ( ! $customer->isLoaded() ) {
226
// Try to find customer by 'secondary' identifier.
227
$identifier = Config::phoneRequired() ? 'email' : 'phone';
228
- $customer->loadBy( array( 'phone' => '', 'email' => '', $identifier => $data[ $identifier ] ) );
229
}
230
if ( Config::allowDuplicates() ) {
231
- $customer_data = array(
232
- 'email' => $data['email'],
233
- 'phone' => $data['phone'],
234
- );
235
if ( Config::showFirstLastName() ) {
236
- $customer_data['first_name'] = $data['first_name'];
237
- $customer_data['last_name'] = $data['last_name'];
238
} else {
239
- $customer_data['full_name'] = $data['full_name'];
240
}
241
$customer->loadBy( $customer_data );
242
} elseif ( ! isset ( $data['force_update_customer'] ) && $customer->isLoaded() ) {
221
if ( ! $customer->isLoaded() ) {
222
// Try to find customer by 'primary' identifier.
223
$identifier = Config::phoneRequired() ? 'phone' : 'email';
224
+ if ( $data[ $identifier ] !== '' ) {
225
+ $customer->loadBy( array( $identifier => $data[ $identifier ] ) );
226
+ }
227
if ( ! $customer->isLoaded() ) {
228
// Try to find customer by 'secondary' identifier.
229
$identifier = Config::phoneRequired() ? 'email' : 'phone';
230
+ if ( $data[ $identifier ] !== '' ) {
231
+ $customer->loadBy( array( 'phone' => '', 'email' => '', $identifier => $data[ $identifier ] ) );
232
+ }
233
}
234
if ( Config::allowDuplicates() ) {
235
if ( Config::showFirstLastName() ) {
236
+ $customer_data = array(
237
+ 'first_name' => $data['first_name'],
238
+ 'last_name' => $data['last_name'],
239
+ );
240
} else {
241
+ $customer_data = array( 'full_name' => $data['full_name'] );
242
+ }
243
+ if ( $data['email'] != '' ) {
244
+ $customer_data['email'] = $data['email'];
245
+ }
246
+ if ( $data['phone'] != '' ) {
247
+ $customer_data['phone'] = $data['phone'];
248
}
249
$customer->loadBy( $customer_data );
250
} elseif ( ! isset ( $data['force_update_customer'] ) && $customer->isLoaded() ) {
lib/base/Schema.php CHANGED
@@ -124,7 +124,6 @@ abstract class Schema
124
*/
125
protected function getTableName( $table )
126
{
127
- /** @global \wpdb $wpdb */
128
global $wpdb;
129
130
return $wpdb->prefix . $table;
124
*/
125
protected function getTableName( $table )
126
{
127
global $wpdb;
128
129
return $wpdb->prefix . $table;
lib/base/Updater.php CHANGED
@@ -185,4 +185,46 @@ abstract class Updater extends Schema
185
$this->renameOptions( $strings );
186
}
187
}
188
}
185
$this->renameOptions( $strings );
186
}
187
}
188
+
189
+ /**
190
+ * Upgrade character and collate for bookly tables.
191
+ *
192
+ * @param array $tables
193
+ */
194
+ protected function upgradeCharsetCollate( array $tables )
195
+ {
196
+ global $wpdb;
197
+ // In WordPress 4.2, team upgraded wp tables to utf8mb4.
198
+ if ( $wpdb->has_cap( 'collation' ) ) {
199
+ // Bookly < 17.3 by default used CHARACTER SET = utf8 COLLATE = utf8_general_ci
200
+ // mysql 5.5.3+ (2010) support utf8mb4
201
+ // mysql 5.6+ support utf8mb4_520
202
+ if ( $wpdb->charset ) {
203
+ $query = sprintf( 'SELECT TABLE_NAME
204
+ FROM INFORMATION_SCHEMA.COLUMNS
205
+ WHERE TABLE_NAME IN (%s)
206
+ AND TABLE_SCHEMA = SCHEMA()
207
+ AND CHARACTER_SET_NAME IS NOT NULL
208
+ AND CHARACTER_SET_NAME != %%s',
209
+ implode( ', ', array_fill( 0, count( $tables ), '%s' ) )
210
+ );
211
+ $alter = 'ALTER TABLE `%s` CONVERT TO CHARACTER SET ' . $wpdb->charset;
212
+ $params = array_map( array( $this, 'getTableName' ), $tables );
213
+ $params[] = $wpdb->charset;
214
+ if ( $wpdb->collate ) {
215
+ $query .= '
216
+ AND COLLATION_NAME IS NOT NULL
217
+ AND COLLATION_NAME != %s';
218
+ $params[] = $wpdb->collate;
219
+ $alter .=' COLLATE ' . $wpdb->collate;
220
+ }
221
+
222
+ $records = $wpdb->get_results( $wpdb->prepare( $query, $params ) );
223
+ foreach ( $records as $record ) {
224
+ $wpdb->query( sprintf( $alter, $record->TABLE_NAME ) );
225
+ }
226
+ }
227
+ }
228
+ }
229
+
230
}
lib/entities/CustomerAppointment.php CHANGED
@@ -113,16 +113,16 @@ class CustomerAppointment extends Lib\Base\Entity
113
/**
114
* Delete entity and appointment if there are no more customers.
115
*
116
- * @param bool $compound
117
*/
118
- public function deleteCascade( $compound = false )
119
{
120
Lib\Proxy\Shared::deleteCustomerAppointment( $this );
121
$this->delete();
122
$appointment = new Appointment();
123
if ( $appointment->load( $this->getAppointmentId() ) ) {
124
// Check if there are any customers left.
125
- if ( CustomerAppointment::query()->where( 'appointment_id', $appointment->getId() )->count() == 0 ) {
126
// If no customers then delete the appointment.
127
$appointment->delete();
128
} else {
@@ -141,13 +141,21 @@ class CustomerAppointment extends Lib\Base\Entity
141
// Waiting list.
142
Lib\Proxy\WaitingList::handleParticipantsChange( $appointment );
143
}
144
- if ( $compound && $this->getCompoundToken() ) {
145
- // Remove compound CustomerAppointments
146
/** @var CustomerAppointment[] $ca_list */
147
- $ca_list = CustomerAppointment::query()
148
- ->where( 'compound_token', $this->getCompoundToken() )
149
- ->where( 'compound_service_id', $this->getCompoundServiceId() )
150
- ->find();
151
foreach ( $ca_list as $ca ) {
152
$ca->deleteCascade();
153
}
113
/**
114
* Delete entity and appointment if there are no more customers.
115
*
116
+ * @param bool $compound_collaborative
117
*/
118
+ public function deleteCascade( $compound_collaborative = false )
119
{
120
Lib\Proxy\Shared::deleteCustomerAppointment( $this );
121
$this->delete();
122
$appointment = new Appointment();
123
if ( $appointment->load( $this->getAppointmentId() ) ) {
124
// Check if there are any customers left.
125
+ if ( self::query()->where( 'appointment_id', $appointment->getId() )->count() == 0 ) {
126
// If no customers then delete the appointment.
127
$appointment->delete();
128
} else {
141
// Waiting list.
142
Lib\Proxy\WaitingList::handleParticipantsChange( $appointment );
143
}
144
+ if ( $compound_collaborative ) {
145
/** @var CustomerAppointment[] $ca_list */
146
+ $ca_list = array();
147
+ if ( $this->getCompoundToken() ) {
148
+ // Remove compound CustomerAppointments
149
+ $ca_list = self::query()
150
+ ->where( 'compound_token', $this->getCompoundToken() )
151
+ ->where( 'compound_service_id', $this->getCompoundServiceId() )
152
+ ->find();
153
+ } elseif ( $this->getCollaborativeToken() ) {
154
+ $ca_list = self::query()
155
+ ->where( 'collaborative_token', $this->getCollaborativeToken() )
156
+ ->where( 'collaborative_service_id', $this->getCollaborativeServiceId() )
157
+ ->find();
158
+ }
159
foreach ( $ca_list as $ca ) {
160
$ca->deleteCascade();
161
}
lib/notifications/assets/order/Attachments.php CHANGED
@@ -39,8 +39,10 @@ class Attachments extends Base\Attachments
39
}
40
}
41
}
42
}
43
44
- return isset ( $this->files['invoice'] ) ? array( $this->files['invoice'] ) : array();
45
}
46
}
39
}
40
}
41
}
42
+
43
+ return isset ( $this->files['invoice'] ) ? array( $this->files['invoice'] ) : array();
44
}
45
46
+ return array();
47
}
48
}
lib/slots/Finder.php CHANGED
@@ -364,10 +364,14 @@ class Finder
364
$this->client_start_dp = DatePoint::fromStr( $this->last_fetched_slot[0][2] )->toClientTz()->modify( 'tomorrow' );
365
} else {
366
// Requested date.
367
- $this->client_start_dp = DatePoint::fromStrInClientTz( $this->selected_date ?: $this->userData->getDateFrom() );
368
- if ( $this->show_calendar ) {
369
- $this->client_start_dp = $this->client_start_dp->modify( 'first day of this month midnight' );
370
}
371
if ( $this->client_start_dp->lt( $min_start ) ) {
372
$this->client_start_dp = $min_start->toClientTz();
373
}
364
$this->client_start_dp = DatePoint::fromStr( $this->last_fetched_slot[0][2] )->toClientTz()->modify( 'tomorrow' );
365
} else {
366
// Requested date.
367
+ if ( $this->show_calendar && ( $this->selected_date > $this->userData->getDateFrom() ) ) {
368
+ // Example case:
369
+ // The client chose the 3rd day of the following month on time step.
370
+ $this->client_start_dp = DatePoint::fromStrInClientTz( $this->selected_date )->modify( 'first day of this month midnight' );
371
+ } else {
372
+ $this->client_start_dp = DatePoint::fromStrInClientTz( $this->userData->getDateFrom() );
373
}
374
+
375
if ( $this->client_start_dp->lt( $min_start ) ) {
376
$this->client_start_dp = $min_start->toClientTz();
377
}
lib/utils/Price.php CHANGED
@@ -50,6 +50,7 @@ abstract class Price
50
'KWD' => array( 'symbol' => 'KD', 'format' => '{price|2} {symbol}' ),
51
'KZT' => array( 'symbol' => 'тг.', 'format' => '{price|2} {symbol}' ),
52
'LAK' => array( 'symbol' => '₭', 'format' => '{price|0} {symbol}' ),
53
'LKR' => array( 'symbol' => 'Rs.', 'format' => '{symbol} {price|2}' ),
54
'MUR' => array( 'symbol' => 'Rs', 'format' => '{symbol}{price|2}' ),
55
'MXN' => array( 'symbol' => '#x27;, 'format' => '{symbol}{price|2}' ),
50
'KWD' => array( 'symbol' => 'KD', 'format' => '{price|2} {symbol}' ),
51
'KZT' => array( 'symbol' => 'тг.', 'format' => '{price|2} {symbol}' ),
52
'LAK' => array( 'symbol' => '₭', 'format' => '{price|0} {symbol}' ),
53
+ 'LBP' => array( 'symbol' => 'ل.ل.', 'format' => '{symbol} {price}' ),
54
'LKR' => array( 'symbol' => 'Rs.', 'format' => '{symbol} {price|2}' ),
55
'MUR' => array( 'symbol' => 'Rs', 'format' => '{symbol}{price|2}' ),
56
'MXN' => array( 'symbol' => '#x27;, 'format' => '{symbol}{price|2}' ),
main.php CHANGED
@@ -3,7 +3,7 @@
3
Plugin Name: Bookly
4
Plugin URI: https://www.booking-wp-plugin.com/?utm_source=bookly_admin&utm_medium=plugins_page&utm_campaign=plugins_page
5
Description: Bookly Plugin – is a great easy-to-use and easy-to-manage booking tool for service providers who think about their customers. The plugin supports a wide range of services provided by business and individuals who offer reservations through websites. Set up any reservation quickly, pleasantly and easily with Bookly!
6
- Version: 17.2
7
Author: Bookly
8
Author URI: https://www.booking-wp-plugin.com/?utm_source=bookly_admin&utm_medium=plugins_page&utm_campaign=plugins_page
9
Text Domain: bookly
3
Plugin Name: Bookly
4
Plugin URI: https://www.booking-wp-plugin.com/?utm_source=bookly_admin&utm_medium=plugins_page&utm_campaign=plugins_page
5
Description: Bookly Plugin – is a great easy-to-use and easy-to-manage booking tool for service providers who think about their customers. The plugin supports a wide range of services provided by business and individuals who offer reservations through websites. Set up any reservation quickly, pleasantly and easily with Bookly!
6
+ Version: 17.3
7
Author: Bookly
8
Author URI: https://www.booking-wp-plugin.com/?utm_source=bookly_admin&utm_medium=plugins_page&utm_campaign=plugins_page
9
Text Domain: bookly
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: Ladela
3
Tags: Booking, booking system, appointment booking, Booking calendar, reservation calendar, appointment scheduler, appointment calendar
4
Donate link: https://www.booking-wp-plugin.com/
5
Requires at least: 3.7
6
- Tested up to: 5.2
7
Requires PHP: 5.3.7
8
- Stable tag: 17.2
9
License: GPLv3
10
License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
3
Tags: Booking, booking system, appointment booking, Booking calendar, reservation calendar, appointment scheduler, appointment calendar
4
Donate link: https://www.booking-wp-plugin.com/
5
Requires at least: 3.7
6
+ Tested up to: 5.2.1
7
Requires PHP: 5.3.7
8
+ Stable tag: 17.3
9
License: GPLv3
10
License URI: http://www.gnu.org/licenses/gpl-3.0.html
11