Version Description
Download this release
Release Info
Developer | Ladela |
Plugin | WordPress Online Booking and Scheduling Plugin – Bookly |
Version | 16.5 |
Comparing to | |
See all releases |
Code changes from version 16.4 to 16.5
- backend/components/dialogs/appointment/edit/Ajax.php +2 -2
- backend/components/dialogs/appointment/edit/resources/js/ng-appointment.js +14 -5
- backend/modules/appearance/resources/js/appearance.js +0 -7
- backend/modules/calendar/Page.php +2 -1
- backend/modules/payments/templates/index.php +11 -2
- frontend/modules/booking/Ajax.php +2 -2
- frontend/modules/booking/ShortCode.php +0 -3
- frontend/modules/booking/templates/short_code.php +1 -1
- frontend/resources/js/bookly.js +19 -7
- frontend/resources/js/bookly.min.js +1 -1
- frontend/resources/js/bookly.min.js.map +1 -1
- frontend/resources/js/src/time_step.js +19 -7
- languages/bookly-ru_RU.mo +0 -0
- languages/bookly-ru_RU.po +17 -1
- lib/Cart.php +13 -14
- lib/Config.php +1 -1
- lib/UserBookingData.php +18 -17
- lib/base/Installer.php +5 -2
- lib/data_holders/booking/Order.php +1 -1
- lib/data_holders/booking/Series.php +3 -2
- lib/entities/CustomerAppointment.php +2 -0
- lib/notifications/base/Codes.php +0 -93
- lib/notifications/base/Sender.php +0 -222
- lib/notifications/booking/Sender.php +0 -250
- lib/notifications/codes/Combined.php +0 -154
- lib/notifications/new_booking/Codes.php +0 -306
- lib/notifications/new_booking/Sender.php +0 -142
- lib/notifications/new_booking/proxy/Shared.php +0 -25
- lib/notifications/status_changed/StatusChanged.php +0 -58
- lib/slots/Staff.php +3 -1
- main.php +1 -1
- readme.txt +1 -1
backend/components/dialogs/appointment/edit/Ajax.php
CHANGED
@@ -427,7 +427,7 @@ class Ajax extends Lib\Base\Ajax
|
|
427 |
->addItem( 0, DataHolders\Series::create( $series ) );
|
428 |
}
|
429 |
|
430 |
-
foreach ( $schedule as $slot ) {
|
431 |
$slot = json_decode( $slot, true );
|
432 |
$start_date = $slot[0][2];
|
433 |
$end_date = Lib\Slots\DatePoint::fromStr( $start_date )->modify( $duration )->format( 'Y-m-d H:i:s' );
|
@@ -479,7 +479,7 @@ class Ajax extends Lib\Base\Ajax
|
|
479 |
$item = DataHolders\Simple::create( $ca )
|
480 |
->setService( $service )
|
481 |
->setAppointment( $appointment );
|
482 |
-
$orders[ $ca->getCustomerId() ]->getItem( 0 )->addItem( $item );
|
483 |
}
|
484 |
}
|
485 |
}
|
427 |
->addItem( 0, DataHolders\Series::create( $series ) );
|
428 |
}
|
429 |
|
430 |
+
foreach ( $schedule as $i => $slot ) {
|
431 |
$slot = json_decode( $slot, true );
|
432 |
$start_date = $slot[0][2];
|
433 |
$end_date = Lib\Slots\DatePoint::fromStr( $start_date )->modify( $duration )->format( 'Y-m-d H:i:s' );
|
479 |
$item = DataHolders\Simple::create( $ca )
|
480 |
->setService( $service )
|
481 |
->setAppointment( $appointment );
|
482 |
+
$orders[ $ca->getCustomerId() ]->getItem( 0 )->addItem( $i, $item );
|
483 |
}
|
484 |
}
|
485 |
}
|
backend/components/dialogs/appointment/edit/resources/js/ng-appointment.js
CHANGED
@@ -35,6 +35,7 @@
|
|
35 |
date : null,
|
36 |
start_time : null,
|
37 |
end_time : null,
|
|
|
38 |
repeat : {
|
39 |
enabled : null,
|
40 |
repeat : null,
|
@@ -228,7 +229,8 @@
|
|
228 |
ds.form.end_time_data = ds.getDataForEndTime();
|
229 |
var d = ds.form.service ? ds.form.service.duration * ds.form.service.units_min : ds.data.time_interval;
|
230 |
if (d < 86400) {
|
231 |
-
ds.form.
|
|
|
232 |
}
|
233 |
},
|
234 |
getStartAndEndDates : function() {
|
@@ -257,6 +259,7 @@
|
|
257 |
} else {
|
258 |
start_time = ds.form.start_time.value.split(':');
|
259 |
end_time = ds.form.end_time.value.split(':');
|
|
|
260 |
}
|
261 |
start_date.hours(start_time[0]);
|
262 |
start_date.minutes(start_time[1]);
|
@@ -417,6 +420,7 @@
|
|
417 |
skip_date : start_date === null ? 1 : 0,
|
418 |
end_time : null,
|
419 |
end_time_data : [],
|
|
|
420 |
repeat : {
|
421 |
enabled : 0,
|
422 |
repeat : 'daily',
|
@@ -441,10 +445,15 @@
|
|
441 |
if (start_date !== null) {
|
442 |
$scope.form.date = start_date.clone().local().toDate();
|
443 |
$scope.form.start_time = $scope.dataSource.findTime('start', start_date.format('HH:mm'));
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
|
|
|
|
|
|
|
|
|
|
448 |
} else {
|
449 |
$scope.form.date = moment().local().toDate();
|
450 |
$scope.form.start_time = $scope.dataSource.findTime('start', moment().format('HH:mm'));
|
35 |
date : null,
|
36 |
start_time : null,
|
37 |
end_time : null,
|
38 |
+
end_date : null,
|
39 |
repeat : {
|
40 |
enabled : null,
|
41 |
repeat : null,
|
229 |
ds.form.end_time_data = ds.getDataForEndTime();
|
230 |
var d = ds.form.service ? ds.form.service.duration * ds.form.service.units_min : ds.data.time_interval;
|
231 |
if (d < 86400) {
|
232 |
+
ds.form.end_date = moment(ds.form.start_time.value, 'HH:mm').add(d, 'seconds');
|
233 |
+
ds.form.end_time = ds.findTime('end', ds.form.end_date.format('HH:mm'));
|
234 |
}
|
235 |
},
|
236 |
getStartAndEndDates : function() {
|
259 |
} else {
|
260 |
start_time = ds.form.start_time.value.split(':');
|
261 |
end_time = ds.form.end_time.value.split(':');
|
262 |
+
end_date = ds.form.end_date;
|
263 |
}
|
264 |
start_date.hours(start_time[0]);
|
265 |
start_date.minutes(start_time[1]);
|
420 |
skip_date : start_date === null ? 1 : 0,
|
421 |
end_time : null,
|
422 |
end_time_data : [],
|
423 |
+
end_date : end_date,
|
424 |
repeat : {
|
425 |
enabled : 0,
|
426 |
repeat : 'daily',
|
445 |
if (start_date !== null) {
|
446 |
$scope.form.date = start_date.clone().local().toDate();
|
447 |
$scope.form.start_time = $scope.dataSource.findTime('start', start_date.format('HH:mm'));
|
448 |
+
if(response.data.service_id) {
|
449 |
+
$scope.dataSource.setEndTimeBasedOnService();
|
450 |
+
$scope.form.end_time = start_date.format('YYYY-MM-DD') == end_date.format('YYYY-MM-DD')
|
451 |
+
? $scope.dataSource.findTime('end', end_date.format('HH:mm'))
|
452 |
+
: $scope.dataSource.findTime('end', (Math.floor((end_date - start_date) / 3600000) + start_date.hour()) + end_date.format(':mm'));
|
453 |
+
} else {
|
454 |
+
$scope.form.end_time_data = $scope.dataSource.getDataForEndTime();
|
455 |
+
$scope.form.end_time = $scope.dataSource.findTime('end', moment(end_date, 'HH:mm').format('HH:mm'));
|
456 |
+
}
|
457 |
} else {
|
458 |
$scope.form.date = moment().local().toDate();
|
459 |
$scope.form.start_time = $scope.dataSource.findTime('start', moment().format('HH:mm'));
|
backend/modules/appearance/resources/js/appearance.js
CHANGED
@@ -297,13 +297,6 @@ jQuery(function($) {
|
|
297 |
// Show number of persons
|
298 |
$show_nop.on('change', function () {
|
299 |
$('.bookly-js-nop').toggle( this.checked );
|
300 |
-
if (this.checked) {
|
301 |
-
$time_step_nop.closest('[data-toggle="popover"]').popover('destroy');
|
302 |
-
$time_step_nop.prop('disabled', false);
|
303 |
-
} else {
|
304 |
-
$time_step_nop.closest('[data-toggle="popover"]').popover();
|
305 |
-
$time_step_nop.prop('checked', false).prop('disabled', true).trigger('change');
|
306 |
-
}
|
307 |
}).trigger('change');
|
308 |
|
309 |
// Show quantity
|
297 |
// Show number of persons
|
298 |
$show_nop.on('change', function () {
|
299 |
$('.bookly-js-nop').toggle( this.checked );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
300 |
}).trigger('change');
|
301 |
|
302 |
// Show quantity
|
backend/modules/calendar/Page.php
CHANGED
@@ -96,7 +96,8 @@ class Page extends Lib\Base\Ajax
|
|
96 |
);
|
97 |
}
|
98 |
} else {
|
99 |
-
$
|
|
|
100 |
$staff_dropdown_data = array(
|
101 |
0 => array(
|
102 |
'name' => '',
|
96 |
);
|
97 |
}
|
98 |
} else {
|
99 |
+
$staff = Lib\Entities\Staff::query()->findOne();
|
100 |
+
$staff_members = $staff ? array( $staff ) : array();
|
101 |
$staff_dropdown_data = array(
|
102 |
0 => array(
|
103 |
'name' => '',
|
backend/modules/payments/templates/index.php
CHANGED
@@ -96,8 +96,17 @@ use Bookly\Backend\Modules\Payments\Proxy;
|
|
96 |
</thead>
|
97 |
<tfoot>
|
98 |
<tr>
|
99 |
-
<th
|
100 |
-
<th
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
</tr>
|
102 |
</tfoot>
|
103 |
</table>
|
96 |
</thead>
|
97 |
<tfoot>
|
98 |
<tr>
|
99 |
+
<th></th>
|
100 |
+
<th></th>
|
101 |
+
<th></th>
|
102 |
+
<th></th>
|
103 |
+
<th></th>
|
104 |
+
<th></th>
|
105 |
+
<th><div class="pull-right"><?php _e( 'Total', 'bookly' ) ?>:</div></th>
|
106 |
+
<th><span id="bookly-payment-total"></span></th>
|
107 |
+
<th></th>
|
108 |
+
<th></th>
|
109 |
+
<th></th>
|
110 |
</tr>
|
111 |
</tfoot>
|
112 |
</table>
|
frontend/modules/booking/Ajax.php
CHANGED
@@ -216,7 +216,7 @@ class Ajax extends Lib\Base\Ajax
|
|
216 |
'data' => $slot->buildSlotData(),
|
217 |
'time_text' => $slot->start()->toClientTz()->formatI18n( $finder->isServiceDurationInDays() ? 'D, M d' : get_option( 'time_format' ) ),
|
218 |
'status' => $slot->waitingListEverStarted() ? 'waiting-list' : ( $slot->fullyBooked() ? 'booked' : '' ),
|
219 |
-
'additional_text' => $slot->waitingListEverStarted() ? '(' . $slot->maxOnWaitingList() . ')' : ( Lib\Config::groupBookingActive()
|
220 |
);
|
221 |
}
|
222 |
}
|
@@ -286,7 +286,7 @@ class Ajax extends Lib\Base\Ajax
|
|
286 |
'data' => $slot->buildSlotData(),
|
287 |
'time_text' => $slot->start()->toClientTz()->formatI18n( $finder->isServiceDurationInDays() ? 'D, M d' : get_option( 'time_format' ) ),
|
288 |
'status' => $slot->waitingListEverStarted() ? 'waiting-list' : ( $slot->fullyBooked() ? 'booked' : '' ),
|
289 |
-
'additional_text' => $slot->waitingListEverStarted() ? '(' . $slot->maxOnWaitingList() . ')' : ( Lib\Config::groupBookingActive()
|
290 |
);
|
291 |
}
|
292 |
}
|
216 |
'data' => $slot->buildSlotData(),
|
217 |
'time_text' => $slot->start()->toClientTz()->formatI18n( $finder->isServiceDurationInDays() ? 'D, M d' : get_option( 'time_format' ) ),
|
218 |
'status' => $slot->waitingListEverStarted() ? 'waiting-list' : ( $slot->fullyBooked() ? 'booked' : '' ),
|
219 |
+
'additional_text' => $slot->waitingListEverStarted() ? '(' . $slot->maxOnWaitingList() . ')' : ( Lib\Config::groupBookingActive() ? Proxy\GroupBooking::getTimeSlotText( $slot ) : '' ),
|
220 |
);
|
221 |
}
|
222 |
}
|
286 |
'data' => $slot->buildSlotData(),
|
287 |
'time_text' => $slot->start()->toClientTz()->formatI18n( $finder->isServiceDurationInDays() ? 'D, M d' : get_option( 'time_format' ) ),
|
288 |
'status' => $slot->waitingListEverStarted() ? 'waiting-list' : ( $slot->fullyBooked() ? 'booked' : '' ),
|
289 |
+
'additional_text' => $slot->waitingListEverStarted() ? '(' . $slot->maxOnWaitingList() . ')' : ( Lib\Config::groupBookingActive() ? Proxy\GroupBooking::getTimeSlotText( $slot ) : '' ),
|
290 |
);
|
291 |
}
|
292 |
}
|
frontend/modules/booking/ShortCode.php
CHANGED
@@ -10,9 +10,6 @@ use Bookly\Frontend\Modules\Booking\Lib\Errors;
|
|
10 |
*/
|
11 |
class ShortCode extends Lib\Base\Component
|
12 |
{
|
13 |
-
/** @var bool Whether inline CSS has already been printed or not */
|
14 |
-
protected static $css_printed = false;
|
15 |
-
|
16 |
/**
|
17 |
* Init component.
|
18 |
*/
|
10 |
*/
|
11 |
class ShortCode extends Lib\Base\Component
|
12 |
{
|
|
|
|
|
|
|
13 |
/**
|
14 |
* Init component.
|
15 |
*/
|
frontend/modules/booking/templates/short_code.php
CHANGED
@@ -6,7 +6,7 @@ Plugin Name: Bookly – Responsive WordPress Appointment Booking and Scheduling
|
|
6 |
Plugin URI: https://www.booking-wp-plugin.com/?utm_source=bookly_admin&utm_medium=plugins_page&utm_campaign=plugins_page
|
7 |
Version: <?php echo Lib\Plugin::getVersion() ?>
|
8 |
-->
|
9 |
-
<?php
|
10 |
<div id="bookly-form-<?php echo $form_id ?>" class="bookly-form" data-form_id="<?php echo $form_id ?>">
|
11 |
<div style="text-align: center"><img src="<?php echo includes_url( 'js/tinymce/skins/lightgray/img/loader.gif' ) ?>" alt="<?php esc_attr_e( 'Loading...', 'bookly' ) ?>" /></div>
|
12 |
</div>
|
6 |
Plugin URI: https://www.booking-wp-plugin.com/?utm_source=bookly_admin&utm_medium=plugins_page&utm_campaign=plugins_page
|
7 |
Version: <?php echo Lib\Plugin::getVersion() ?>
|
8 |
-->
|
9 |
+
<?php include '_css.php' ?>
|
10 |
<div id="bookly-form-<?php echo $form_id ?>" class="bookly-form" data-form_id="<?php echo $form_id ?>">
|
11 |
<div style="text-align: center"><img src="<?php echo includes_url( 'js/tinymce/skins/lightgray/img/loader.gif' ) ?>" alt="<?php esc_attr_e( 'Loading...', 'bookly' ) ?>" /></div>
|
12 |
</div>
|
frontend/resources/js/bookly.js
CHANGED
@@ -1839,10 +1839,6 @@
|
|
1839 |
}
|
1840 |
return;
|
1841 |
}
|
1842 |
-
if (xhr_render_time != null) {
|
1843 |
-
xhr_render_time.abort();
|
1844 |
-
xhr_render_time = null;
|
1845 |
-
}
|
1846 |
var data = {
|
1847 |
action : 'bookly_render_time',
|
1848 |
csrf_token: BooklyL10n.csrf_token,
|
@@ -1874,6 +1870,13 @@
|
|
1874 |
return response;
|
1875 |
}
|
1876 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1877 |
xhr_render_time = $.ajax({
|
1878 |
url : BooklyL10n.ajaxurl,
|
1879 |
data : data,
|
@@ -1935,6 +1938,7 @@
|
|
1935 |
opt[params.form_id].timeZone = this.value;
|
1936 |
opt[params.form_id].timeZoneOffset = undefined;
|
1937 |
showSpinner();
|
|
|
1938 |
stepTime({
|
1939 |
form_id: params.form_id,
|
1940 |
time_zone: opt[params.form_id].timeZone
|
@@ -1975,6 +1979,7 @@
|
|
1975 |
$time_next_button.toggle($screens.length != 1);
|
1976 |
} else {
|
1977 |
// Load new data from server.
|
|
|
1978 |
stepTime({form_id: params.form_id, selected_date : date});
|
1979 |
showSpinner();
|
1980 |
}
|
@@ -1986,13 +1991,15 @@
|
|
1986 |
},
|
1987 |
onRender: function() {
|
1988 |
var date = new Date(Date.UTC(this.get('view').year, this.get('view').month));
|
1989 |
-
$('.picker__nav--next').on('click', function() {
|
1990 |
date.setUTCMonth(date.getUTCMonth() + 1);
|
|
|
1991 |
stepTime({form_id: params.form_id, selected_date : date.toJSON().substr(0, 10)});
|
1992 |
showSpinner();
|
1993 |
});
|
1994 |
-
$('.picker__nav--prev').on('click', function() {
|
1995 |
date.setUTCMonth(date.getUTCMonth() - 1);
|
|
|
1996 |
stepTime({form_id: params.form_id, selected_date : date.toJSON().substr(0, 10)});
|
1997 |
showSpinner();
|
1998 |
});
|
@@ -2271,7 +2278,12 @@
|
|
2271 |
});
|
2272 |
|
2273 |
// On click on a slot.
|
|
|
2274 |
$('button.bookly-hour', $container).off('click').on('click', function (e) {
|
|
|
|
|
|
|
|
|
2275 |
e.preventDefault();
|
2276 |
var $this = $(this),
|
2277 |
data = {
|
@@ -2282,7 +2294,7 @@
|
|
2282 |
};
|
2283 |
$this.attr({'data-style': 'zoom-in','data-spinner-color':'#333','data-spinner-size':'40'});
|
2284 |
laddaStart(this);
|
2285 |
-
$.ajax({
|
2286 |
type : 'POST',
|
2287 |
url : BooklyL10n.ajaxurl,
|
2288 |
data : data,
|
1839 |
}
|
1840 |
return;
|
1841 |
}
|
|
|
|
|
|
|
|
|
1842 |
var data = {
|
1843 |
action : 'bookly_render_time',
|
1844 |
csrf_token: BooklyL10n.csrf_token,
|
1870 |
return response;
|
1871 |
}
|
1872 |
|
1873 |
+
function dropAjax() {
|
1874 |
+
if (xhr_render_time != null) {
|
1875 |
+
xhr_render_time.abort();
|
1876 |
+
xhr_render_time = null;
|
1877 |
+
}
|
1878 |
+
}
|
1879 |
+
|
1880 |
xhr_render_time = $.ajax({
|
1881 |
url : BooklyL10n.ajaxurl,
|
1882 |
data : data,
|
1938 |
opt[params.form_id].timeZone = this.value;
|
1939 |
opt[params.form_id].timeZoneOffset = undefined;
|
1940 |
showSpinner();
|
1941 |
+
dropAjax();
|
1942 |
stepTime({
|
1943 |
form_id: params.form_id,
|
1944 |
time_zone: opt[params.form_id].timeZone
|
1979 |
$time_next_button.toggle($screens.length != 1);
|
1980 |
} else {
|
1981 |
// Load new data from server.
|
1982 |
+
dropAjax();
|
1983 |
stepTime({form_id: params.form_id, selected_date : date});
|
1984 |
showSpinner();
|
1985 |
}
|
1991 |
},
|
1992 |
onRender: function() {
|
1993 |
var date = new Date(Date.UTC(this.get('view').year, this.get('view').month));
|
1994 |
+
$('.picker__nav--next', $container).on('click', function() {
|
1995 |
date.setUTCMonth(date.getUTCMonth() + 1);
|
1996 |
+
dropAjax();
|
1997 |
stepTime({form_id: params.form_id, selected_date : date.toJSON().substr(0, 10)});
|
1998 |
showSpinner();
|
1999 |
});
|
2000 |
+
$('.picker__nav--prev', $container).on('click', function() {
|
2001 |
date.setUTCMonth(date.getUTCMonth() - 1);
|
2002 |
+
dropAjax();
|
2003 |
stepTime({form_id: params.form_id, selected_date : date.toJSON().substr(0, 10)});
|
2004 |
showSpinner();
|
2005 |
});
|
2278 |
});
|
2279 |
|
2280 |
// On click on a slot.
|
2281 |
+
var xhr_session_save = null;
|
2282 |
$('button.bookly-hour', $container).off('click').on('click', function (e) {
|
2283 |
+
if ( xhr_session_save != null) {
|
2284 |
+
xhr_session_save.abort();
|
2285 |
+
xhr_session_save = null;
|
2286 |
+
}
|
2287 |
e.preventDefault();
|
2288 |
var $this = $(this),
|
2289 |
data = {
|
2294 |
};
|
2295 |
$this.attr({'data-style': 'zoom-in','data-spinner-color':'#333','data-spinner-size':'40'});
|
2296 |
laddaStart(this);
|
2297 |
+
xhr_session_save = $.ajax({
|
2298 |
type : 'POST',
|
2299 |
url : BooklyL10n.ajaxurl,
|
2300 |
data : data,
|
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(l){var d=ee[l.form_id].$container;V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:{action:"bookly_render_payment",csrf_token:BooklyL10n.csrf_token,form_id:l.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 c(l.form_id);d.html(e.html),te(d),"cancelled"==ee[l.form_id].status.booking&&(ee[l.form_id].status.booking="ok");var o=V(".bookly-payment",d),t=V(".bookly-js-apply-coupon",d),a=V("input.bookly-user-coupon",d),s=V(".bookly-js-coupon-error",d),i=V("input[type=radio][name=bookly-full-payment]",d),r=V(".bookly-info-text-coupon",d),n=V(".bookly-gateway-buttons,form.bookly-authorize_net,form.bookly-stripe",d);o.on("click",function(){n.hide(),V(".bookly-gateway-buttons.pay-"+V(this).val(),d).show(),"card"==V(this).val()&&V("form.bookly-"+V(this).data("form"),d).show()}),o.eq(0).trigger("click"),i.on("change",function(){var e={action:"bookly_deposit_payments_apply_payment_method",csrf_token:BooklyL10n.csrf_token,form_id:l.form_id,deposit_full:V(this).val()};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:l.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:l.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:l.form_id}):(s.html(ee[l.form_id].errors[e.error]),a.addClass("bookly-error"),r.html(e.text),te(s),o.stop())},error:function(){o.stop()}})}),V(".bookly-js-next-step",d).on("click",function(e){var t,a=oe(this);if(V(".bookly-payment[value=local]",d).is(":checked")||V(this).hasClass("bookly-js-coupon-payment"))e.preventDefault(),c(l.form_id);else if(V(".bookly-payment[value=card]",d).is(":checked")){var o=V(".bookly-payment[data-form=stripe]",d).is(":checked"),s=o?"bookly_stripe_payment":"bookly_authorize_net_aim_payment";t=d.find(o?".bookly-stripe":".bookly-authorize_net"),e.preventDefault();var i={action:s,csrf_token:BooklyL10n.csrf_token,card:{number:t.find('input[name="card_number"]').val(),cvc:t.find('input[name="card_cvc"]').val(),exp_month:t.find('select[name="card_exp_month"]').val(),exp_year:t.find('select[name="card_exp_year"]').val()},form_id:l.form_id},r=function(e){V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:e,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success?ae({form_id:l.form_id}):"cart_item_not_available"==e.error?f(e,l.form_id):"payment_error"==e.error&&(a.stop(),t.find(".bookly-js-card-error").text(e.error_message))}})};if(o&&t.find("#publishable_key").val())try{Stripe.setPublishableKey(t.find("#publishable_key").val()),Stripe.createToken(i.card,function(e,o){o.error?(t.find(".bookly-js-card-error").text(o.error.message),a.stop()):(i.card=o.id,r(i))})}catch(e){t.find(".bookly-js-card-error").text(e.message),a.stop()}else r(i)}else(V(".bookly-payment[value=paypal]",d).is(":checked")||V(".bookly-payment[value=2checkout]",d).is(":checked")||V(".bookly-payment[value=payu_biz]",d).is(":checked")||V(".bookly-payment[value=payu_latam]",d).is(":checked")||V(".bookly-payment[value=payson]",d).is(":checked")||V(".bookly-payment[value=mollie]",d).is(":checked"))&&(e.preventDefault(),0<(t=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:l.form_id,payment_type:t.data("gateway")},dataType:"json",success:function(e){e.success?(t.find("input.bookly-payment-id").val(e.payment_id),t.submit()):"cart_item_not_available"==e.error&&f(e,l.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:l.form_id},dataType:"json",success:function(e){e.success?t.submit():"cart_item_not_available"==e.error&&f(e,l.form_id)}}))}),V(".bookly-js-back-step",d).on("click",function(e){e.preventDefault(),oe(this),D({form_id:l.form_id})})}}})}function c(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&&f(e,o)})}function f(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 D(W){var e=V.extend({action:"bookly_render_details",csrf_token:BooklyL10n.csrf_token},W),G=ee[W.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){G.html(e.html),te(G);var l=e.intlTelInput,d=e.update_details_dialog,c=e.woocommerce;ee[W.form_id].hasOwnProperty("google_maps")&&ee[W.form_id].google_maps.enabled&&(G||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")}},{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",[G]);var f="",t=V(".bookly-js-guest",G),m=V(".bookly-js-user-phone-input",G),y=V(".bookly-js-user-email",G),u=V(".bookly-js-user-email-confirm",G),_=V(".bookly-js-select-birthday-day",G),k=V(".bookly-js-select-birthday-month",G),p=V(".bookly-js-select-birthday-year",G),h=V(".bookly-js-address-country",G),b=V(".bookly-js-address-state",G),v=V(".bookly-js-address-postcode",G),j=V(".bookly-js-address-city",G),g=V(".bookly-js-address-street",G),w=V(".bookly-js-address-street_number",G),x=V(".bookly-js-address-additional_address",G),C=V(".bookly-js-address-country-error",G),L=V(".bookly-js-address-state-error",G),B=V(".bookly-js-address-postcode-error",G),T=V(".bookly-js-address-city-error",G),D=V(".bookly-js-address-street-error",G),S=V(".bookly-js-address-street_number-error",G),O=V(".bookly-js-address-additional_address-error",G),M=V(".bookly-js-select-birthday-day-error",G),q=V(".bookly-js-select-birthday-month-error",G),P=V(".bookly-js-select-birthday-year-error",G),F=V(".bookly-js-full-name",G),E=V(".bookly-js-first-name",G),R=V(".bookly-js-last-name",G),H=V(".bookly-js-user-notes",G),o=V(".bookly-custom-field",G),a=V(".bookly-js-info-field",G),X=V(".bookly-js-user-phone-error",G),I=V(".bookly-js-user-email-error",G),z=V(".bookly-js-user-email-confirm-error",G),N=V(".bookly-js-full-name-error",G),Y=V(".bookly-js-first-name-error",G),Z=V(".bookly-js-last-name-error",G),s=V(".bookly-js-captcha-img",G),i=V(".bookly-custom-field-error",G),r=V(".bookly-js-info-field-error",G),n=V(".bookly-js-modal",G),J=V(".bookly-js-login",G),$=V(".bookly-js-cst-duplicate",G),A=V(".bookly-js-next-step",G),U=V([M,q,P,C,L,B,T,D,S,O,N,Y,Z,X,I,z,i,r]).map(V.fn.toArray),K=V([_,k,p,j,h,v,b,g,w,x,F,E,R,m,y,u,o,a]).map(V.fn.toArray),Q=function(e){if(F.val(e.data.full_name).removeClass("bookly-error"),E.val(e.data.first_name).removeClass("bookly-error"),R.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]);_.val(s).removeClass("bookly-error"),k.val(a).removeClass("bookly-error"),p.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=G.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."+W.form_id).remove(),n.addClass(W.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",G).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:W.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"),Q(e),J.removeClass("bookly-in")):"incorrect_username_password"==e.error&&(J.find("input").addClass("bookly-error"),J.find(".bookly-label-error").html(ee[W.form_id].errors[e.error])),o.stop()}})}),V("button:submit",$).on("click",function(e){e.preventDefault(),$.removeClass("bookly-in"),A.trigger("click",[1])}),ee[W.form_id].hasOwnProperty("facebook")&&ee[W.form_id].facebook.enabled&&(FB.XFBML.parse(V(".bookly-js-fb-login-button",G).parent().get(0)),ee[W.form_id].facebook.onStatusChange=function(e){"connected"===e.status&&(ee[W.form_id].facebook.enabled=!1,ee[W.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:W.form_id}),dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success&&Q(e)}})}))}),A.on("click",function(e,o){e.preventDefault();var a,t=[],s={},i=[],r=oe(this);V("div.bookly-js-info-field-row",G).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",G).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:W.form_id,full_name:F.val(),first_name:E.val(),last_name:R.val(),phone:f,email:y.val(),email_confirm:u.val(),birthday:{day:_.val(),month:k.val(),year:p.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(),K.removeClass("bookly-error"),o.success)if(c.enabled){var e={action:"bookly_pro_add_to_woocommerce_cart",csrf_token:BooklyL10n.csrf_token,form_id:W.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:W.form_id},ee[W.form_id].errors[e.error]))}})}else se({form_id:W.form_id});else{var i=null;if(o.appointments_limit_reached)ae({form_id:W.form_id,error:"appointments_limit_reached"});else{r.stop();[{name:"full_name",errorElement:N,formElement:F},{name:"first_name",errorElement:Y,formElement:E},{name:"last_name",errorElement:Z,formElement:R},{name:"phone",errorElement:X,formElement:m},{name:"email",errorElement:I,formElement:y},{name:"email_confirm",errorElement:z,formElement:u},{name:"birthday_day",errorElement:M,formElement:_},{name:"birthday_month",errorElement:q,formElement:k},{name:"birthday_year",errorElement:P,formElement:p},{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+'"]',G);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+'"]',G),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",G).on("click",function(e){e.preventDefault(),oe(this),ee[W.form_id].skip_steps.cart?ee[W.form_id].no_time?ee[W.form_id].no_extras?de({form_id:W.form_id}):le({form_id:W.form_id}):ee[W.form_id].skip_steps.repeat?ee[W.form_id].skip_steps.extras||"after_step_time"!=ee[W.form_id].step_extras||ee[W.form_id].no_extras?ne({form_id:W.form_id}):le({form_id:W.form_id}):re({form_id:W.form_id}):ie({form_id:W.form_id})}),V(".bookly-js-captcha-refresh",G).on("click",function(){s.css("opacity","0.5"),V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:{action:"bookly_custom_fields_captcha_refresh",form_id:W.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)D(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),D({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),u=V(".bookly-js-week-day",t),_=V(".bookly-js-schedule-container",q),k=V(".bookly-js-days-error",t),p=V(".bookly-js-schedule-slots",_),h=V(".bookly-js-intersection-info",_),b=V(".bookly-js-schedule-help",_),v=V(".bookly-well",_),j=V(".bookly-pagination",_),g=V(".bookly-schedule-row-template .bookly-schedule-row",_),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=[];p.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"),p.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),_.show(),f.prop("disabled",0==L.length),p.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=[],u.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=[],u.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"),u.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(){_.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 k.toggle(!0),o.stop(),!1;k.toggle(!1);break;case"monthly":"specific"==n.val()?e.params={on:"day",day:c.val()}:e.params={on:n.val(),weekday:m.val()}}p.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?D({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{null!=o&&(o.abort(),o=null);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 f,m,y,u=V(".bookly-columnizer-wrap",B),_=V(".bookly-columnizer",u),i=V(".bookly-time-next",B),a=V(".bookly-time-prev",B),k=null,p=e.time_slots_wide?205:127,h=e.time_slots_wide?"bookly-column bookly-column-wide":"bookly-column",b=0,r=0,v=e.has_more_slots,j=!1,o=e.show_calendar,n=e.is_rtl,g=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,w(),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]?(_.html(t[o]).css("left","0px"),r=b=0,k=null,x(),a.hide(),i.toggle(1!=f.length)):(ne({form_id:C.form_id,selected_date:o}),w())}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").on("click",function(){e.setUTCMonth(e.getUTCMonth()+1),ne({form_id:C.form_id,selected_date:e.toJSON().substr(0,10)}),w()}),V(".picker__nav--prev").on("click",function(){e.setUTCMonth(e.getUTCMonth()-1),ne({form_id:C.form_id,selected_date:e.toJSON().substr(0,10)}),w()})}});var l=s.pickadate("picker").get("select","yyyy-mm-dd");_.html(t[l])}else{var d="";V.each(t,function(e,o){d+=o}),_.html(d)}if(e.has_slots){L?B.find(".bookly-label-error").html(L):B.find(".bookly-label-error").hide(),(m=parseInt(V(window).height()/36,10))<4?m=4:10<m&&(m=10),10<(y=parseInt(u.width()/p,10))?y=10:0==y&&(j=!0,y=4),x(),v||1!=f.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(),f.eq(r+1).length)_.animate({left:(n?"+":"-")+(r+1)*k.width()},{duration:800}),k=f.eq(++r),u.animate({height:k.height()},{duration:800}),r+1!=f.length||v||i.hide();else if(v){var o=V("> button:last",_);0==o.length&&0==(o=V(".bookly-column:hidden:last > button:last",_)).length&&(o=V(".bookly-column:last > button:last",_));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){v=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")),_.append(o),x(),i.trigger("click")}else i.hide();else i.hide();s.stop()}})}}),a.on("click",function(){i.show(),k=f.eq(--r),_.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 w(){V(".bookly-time-screen,.bookly-not-time-screen",B).addClass("bookly-spin-overlay");var e={lines:11,length:11,width:4,radius:5};f?new Spinner(e).spin(f.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",_),s=0,i=0;if(g)for(;0<a.length;)a.eq(0).hasClass("bookly-day")?(s=1,o=V('<div class="'+h+'" />'),(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),_.append(o)):o.append(e)),i<s&&(i=s);else for(;v?a.length>m:a.length;){o=V('<div class="'+h+'" />'),i=m,b%y!=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);_.append(o),++b}for(var n=V("> .bookly-column",_);v?n.length>=y:n.length;){t=V('<div class="bookly-time-screen"/>');for(r=0;r<y;++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)}_.append(t)}f=V(".bookly-time-screen",_),null===k&&(k=f.eq(0)),V("button.bookly-time-skip",B).off("click").on("click",function(e){oe(this),ee[C.form_id].skip_steps.cart?D({form_id:C.form_id,add_to_cart:!0}):ie({form_id:C.form_id,add_to_cart:!0,from_step:"time"})}),V("button.bookly-hour",B).off("click").on("click",function(e){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),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?D({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(y*p),u.height(j?39*V(".bookly-column.bookly-js-first-column button",k).length:k.height()),j=!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,""")+'" 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 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?D({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),u=V(".bookly-js-mobile-next-step",P),_=V(".bookly-js-mobile-prev-step",P),h=e.locations,b=e.categories,v=e.services,j=e.staff,k=e.chain,p=e.required,g=e.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=[];V.each(n,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(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 u=V(".bookly-js-select-number-of-persons",e).val()||1,_=i?t?j[t].services[i].locations.hasOwnProperty(r)?j[t].services[i].locations[r].max_capacity:1:c||1:1,k=i?t?j[t].services[i].locations.hasOwnProperty(r)?j[t].services[i].locations[r].min_capacity:1:f||1:1,p=k;p<=_;++p)d[p]={id:p,name:p,pos:p};_<u&&(u=_),(u<k||!ee[q.form_id].form_attributes.show_number_of_persons)&&(u=k),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,u)};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(k,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-actions button",function(){switch(V(this).data("action")){case"plus":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"));break;case"drop":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),p.hasOwnProperty("location")&&p.location&&!s.val()&&(o=!1,s.addClass("bookly-error"),V(".bookly-js-select-location-error",e).show(),i=s),p.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})}})}}),u.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?(u.trigger("click",[!0]),_.remove()):_.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})}}})}}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)&&function(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}("https://maps.googleapis.com/maps/api/js?key="+e.google_maps.api_key+"&libraries=places",!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(l){var d=ee[l.form_id].$container;V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:{action:"bookly_render_payment",csrf_token:BooklyL10n.csrf_token,form_id:l.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 c(l.form_id);d.html(e.html),te(d),"cancelled"==ee[l.form_id].status.booking&&(ee[l.form_id].status.booking="ok");var o=V(".bookly-payment",d),t=V(".bookly-js-apply-coupon",d),a=V("input.bookly-user-coupon",d),s=V(".bookly-js-coupon-error",d),i=V("input[type=radio][name=bookly-full-payment]",d),r=V(".bookly-info-text-coupon",d),n=V(".bookly-gateway-buttons,form.bookly-authorize_net,form.bookly-stripe",d);o.on("click",function(){n.hide(),V(".bookly-gateway-buttons.pay-"+V(this).val(),d).show(),"card"==V(this).val()&&V("form.bookly-"+V(this).data("form"),d).show()}),o.eq(0).trigger("click"),i.on("change",function(){var e={action:"bookly_deposit_payments_apply_payment_method",csrf_token:BooklyL10n.csrf_token,form_id:l.form_id,deposit_full:V(this).val()};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:l.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:l.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:l.form_id}):(s.html(ee[l.form_id].errors[e.error]),a.addClass("bookly-error"),r.html(e.text),te(s),o.stop())},error:function(){o.stop()}})}),V(".bookly-js-next-step",d).on("click",function(e){var t,a=oe(this);if(V(".bookly-payment[value=local]",d).is(":checked")||V(this).hasClass("bookly-js-coupon-payment"))e.preventDefault(),c(l.form_id);else if(V(".bookly-payment[value=card]",d).is(":checked")){var o=V(".bookly-payment[data-form=stripe]",d).is(":checked"),s=o?"bookly_stripe_payment":"bookly_authorize_net_aim_payment";t=d.find(o?".bookly-stripe":".bookly-authorize_net"),e.preventDefault();var i={action:s,csrf_token:BooklyL10n.csrf_token,card:{number:t.find('input[name="card_number"]').val(),cvc:t.find('input[name="card_cvc"]').val(),exp_month:t.find('select[name="card_exp_month"]').val(),exp_year:t.find('select[name="card_exp_year"]').val()},form_id:l.form_id},r=function(e){V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:e,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success?ae({form_id:l.form_id}):"cart_item_not_available"==e.error?f(e,l.form_id):"payment_error"==e.error&&(a.stop(),t.find(".bookly-js-card-error").text(e.error_message))}})};if(o&&t.find("#publishable_key").val())try{Stripe.setPublishableKey(t.find("#publishable_key").val()),Stripe.createToken(i.card,function(e,o){o.error?(t.find(".bookly-js-card-error").text(o.error.message),a.stop()):(i.card=o.id,r(i))})}catch(e){t.find(".bookly-js-card-error").text(e.message),a.stop()}else r(i)}else(V(".bookly-payment[value=paypal]",d).is(":checked")||V(".bookly-payment[value=2checkout]",d).is(":checked")||V(".bookly-payment[value=payu_biz]",d).is(":checked")||V(".bookly-payment[value=payu_latam]",d).is(":checked")||V(".bookly-payment[value=payson]",d).is(":checked")||V(".bookly-payment[value=mollie]",d).is(":checked"))&&(e.preventDefault(),0<(t=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:l.form_id,payment_type:t.data("gateway")},dataType:"json",success:function(e){e.success?(t.find("input.bookly-payment-id").val(e.payment_id),t.submit()):"cart_item_not_available"==e.error&&f(e,l.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:l.form_id},dataType:"json",success:function(e){e.success?t.submit():"cart_item_not_available"==e.error&&f(e,l.form_id)}}))}),V(".bookly-js-back-step",d).on("click",function(e){e.preventDefault(),oe(this),S({form_id:l.form_id})})}}})}function c(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&&f(e,o)})}function f(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(W){var e=V.extend({action:"bookly_render_details",csrf_token:BooklyL10n.csrf_token},W),G=ee[W.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){G.html(e.html),te(G);var l=e.intlTelInput,d=e.update_details_dialog,c=e.woocommerce;ee[W.form_id].hasOwnProperty("google_maps")&&ee[W.form_id].google_maps.enabled&&(G||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")}},{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",[G]);var f="",t=V(".bookly-js-guest",G),m=V(".bookly-js-user-phone-input",G),y=V(".bookly-js-user-email",G),u=V(".bookly-js-user-email-confirm",G),_=V(".bookly-js-select-birthday-day",G),k=V(".bookly-js-select-birthday-month",G),p=V(".bookly-js-select-birthday-year",G),h=V(".bookly-js-address-country",G),b=V(".bookly-js-address-state",G),v=V(".bookly-js-address-postcode",G),j=V(".bookly-js-address-city",G),g=V(".bookly-js-address-street",G),w=V(".bookly-js-address-street_number",G),x=V(".bookly-js-address-additional_address",G),C=V(".bookly-js-address-country-error",G),L=V(".bookly-js-address-state-error",G),B=V(".bookly-js-address-postcode-error",G),T=V(".bookly-js-address-city-error",G),D=V(".bookly-js-address-street-error",G),S=V(".bookly-js-address-street_number-error",G),O=V(".bookly-js-address-additional_address-error",G),M=V(".bookly-js-select-birthday-day-error",G),q=V(".bookly-js-select-birthday-month-error",G),P=V(".bookly-js-select-birthday-year-error",G),F=V(".bookly-js-full-name",G),E=V(".bookly-js-first-name",G),R=V(".bookly-js-last-name",G),H=V(".bookly-js-user-notes",G),o=V(".bookly-custom-field",G),a=V(".bookly-js-info-field",G),X=V(".bookly-js-user-phone-error",G),I=V(".bookly-js-user-email-error",G),z=V(".bookly-js-user-email-confirm-error",G),N=V(".bookly-js-full-name-error",G),Y=V(".bookly-js-first-name-error",G),Z=V(".bookly-js-last-name-error",G),s=V(".bookly-js-captcha-img",G),i=V(".bookly-custom-field-error",G),r=V(".bookly-js-info-field-error",G),n=V(".bookly-js-modal",G),J=V(".bookly-js-login",G),$=V(".bookly-js-cst-duplicate",G),A=V(".bookly-js-next-step",G),U=V([M,q,P,C,L,B,T,D,S,O,N,Y,Z,X,I,z,i,r]).map(V.fn.toArray),K=V([_,k,p,j,h,v,b,g,w,x,F,E,R,m,y,u,o,a]).map(V.fn.toArray),Q=function(e){if(F.val(e.data.full_name).removeClass("bookly-error"),E.val(e.data.first_name).removeClass("bookly-error"),R.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]);_.val(s).removeClass("bookly-error"),k.val(a).removeClass("bookly-error"),p.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=G.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."+W.form_id).remove(),n.addClass(W.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",G).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:W.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"),Q(e),J.removeClass("bookly-in")):"incorrect_username_password"==e.error&&(J.find("input").addClass("bookly-error"),J.find(".bookly-label-error").html(ee[W.form_id].errors[e.error])),o.stop()}})}),V("button:submit",$).on("click",function(e){e.preventDefault(),$.removeClass("bookly-in"),A.trigger("click",[1])}),ee[W.form_id].hasOwnProperty("facebook")&&ee[W.form_id].facebook.enabled&&(FB.XFBML.parse(V(".bookly-js-fb-login-button",G).parent().get(0)),ee[W.form_id].facebook.onStatusChange=function(e){"connected"===e.status&&(ee[W.form_id].facebook.enabled=!1,ee[W.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:W.form_id}),dataType:"json",xhrFields:{withCredentials:!0},crossDomain:"withCredentials"in new XMLHttpRequest,success:function(e){e.success&&Q(e)}})}))}),A.on("click",function(e,o){e.preventDefault();var a,t=[],s={},i=[],r=oe(this);V("div.bookly-js-info-field-row",G).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",G).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:W.form_id,full_name:F.val(),first_name:E.val(),last_name:R.val(),phone:f,email:y.val(),email_confirm:u.val(),birthday:{day:_.val(),month:k.val(),year:p.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(),K.removeClass("bookly-error"),o.success)if(c.enabled){var e={action:"bookly_pro_add_to_woocommerce_cart",csrf_token:BooklyL10n.csrf_token,form_id:W.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:W.form_id},ee[W.form_id].errors[e.error]))}})}else se({form_id:W.form_id});else{var i=null;if(o.appointments_limit_reached)ae({form_id:W.form_id,error:"appointments_limit_reached"});else{r.stop();[{name:"full_name",errorElement:N,formElement:F},{name:"first_name",errorElement:Y,formElement:E},{name:"last_name",errorElement:Z,formElement:R},{name:"phone",errorElement:X,formElement:m},{name:"email",errorElement:I,formElement:y},{name:"email_confirm",errorElement:z,formElement:u},{name:"birthday_day",errorElement:M,formElement:_},{name:"birthday_month",errorElement:q,formElement:k},{name:"birthday_year",errorElement:P,formElement:p},{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+'"]',G);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+'"]',G),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",G).on("click",function(e){e.preventDefault(),oe(this),ee[W.form_id].skip_steps.cart?ee[W.form_id].no_time?ee[W.form_id].no_extras?de({form_id:W.form_id}):le({form_id:W.form_id}):ee[W.form_id].skip_steps.repeat?ee[W.form_id].skip_steps.extras||"after_step_time"!=ee[W.form_id].step_extras||ee[W.form_id].no_extras?ne({form_id:W.form_id}):le({form_id:W.form_id}):re({form_id:W.form_id}):ie({form_id:W.form_id})}),V(".bookly-js-captcha-refresh",G).on("click",function(){s.css("opacity","0.5"),V.ajax({type:"POST",url:BooklyL10n.ajaxurl,data:{action:"bookly_custom_fields_captcha_refresh",form_id:W.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),u=V(".bookly-js-week-day",t),_=V(".bookly-js-schedule-container",q),k=V(".bookly-js-days-error",t),p=V(".bookly-js-schedule-slots",_),h=V(".bookly-js-intersection-info",_),b=V(".bookly-js-schedule-help",_),v=V(".bookly-well",_),j=V(".bookly-pagination",_),g=V(".bookly-schedule-row-template .bookly-schedule-row",_),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=[];p.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"),p.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),_.show(),f.prop("disabled",0==L.length),p.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=[],u.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=[],u.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"),u.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(){_.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 k.toggle(!0),o.stop(),!1;k.toggle(!1);break;case"monthly":"specific"==n.val()?e.params={on:"day",day:c.val()}:e.params={on:n.val(),weekday:m.val()}}p.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),k=V(".bookly-columnizer",_),i=V(".bookly-time-next",B),a=V(".bookly-time-prev",B),p=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]?(k.html(t[o]).css("left","0px"),r=v=0,p=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");k.html(t[l])}else{var d="";V.each(t,function(e,o){d+=o}),k.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<(u=parseInt(_.width()/h,10))?u=10:0==u&&(g=!0,u=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)k.animate({left:(n?"+":"-")+(r+1)*p.width()},{duration:800}),p=m.eq(++r),_.animate({height:p.height()},{duration:800}),r+1!=m.length||j||i.hide();else if(j){var o=V("> button:last",k);0==o.length&&0==(o=V(".bookly-column:hidden:last > button:last",k)).length&&(o=V(".bookly-column:last > button:last",k));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")),k.append(o),x(),i.trigger("click")}else i.hide();else i.hide();s.stop()}})}}),a.on("click",function(){i.show(),p=m.eq(--r),k.animate({left:(n?"+":"-")+r*p.width()},{duration:800}),_.animate({height:p.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",k),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),k.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%u!=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);k.append(o),++v}for(var n=V("> .bookly-column",k);j?n.length>=u:n.length;){t=V('<div class="bookly-time-screen"/>');for(r=0;r<u;++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)}k.append(t)}m=V(".bookly-time-screen",k),null===p&&(p=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(u*h),_.height(g?39*V(".bookly-column.bookly-js-first-column button",p).length:p.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,""")+'" 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),u=V(".bookly-js-mobile-next-step",P),_=V(".bookly-js-mobile-prev-step",P),h=e.locations,b=e.categories,v=e.services,j=e.staff,k=e.chain,p=e.required,g=e.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=[];V.each(n,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(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 u=V(".bookly-js-select-number-of-persons",e).val()||1,_=i?t?j[t].services[i].locations.hasOwnProperty(r)?j[t].services[i].locations[r].max_capacity:1:c||1:1,k=i?t?j[t].services[i].locations.hasOwnProperty(r)?j[t].services[i].locations[r].min_capacity:1:f||1:1,p=k;p<=_;++p)d[p]={id:p,name:p,pos:p};_<u&&(u=_),(u<k||!ee[q.form_id].form_attributes.show_number_of_persons)&&(u=k),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,u)};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(k,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-actions button",function(){switch(V(this).data("action")){case"plus":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"));break;case"drop":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),p.hasOwnProperty("location")&&p.location&&!s.val()&&(o=!1,s.addClass("bookly-error"),V(".bookly-js-select-location-error",e).show(),i=s),p.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})}})}}),u.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?(u.trigger("click",[!0]),_.remove()):_.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})}}})}}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)&&function(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}("https://maps.googleapis.com/maps/api/js?key="+e.google_maps.api_key+"&libraries=places",!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":["$","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","$payments","$apply_coupon_button","$coupon_input","$coupon_error","$deposit_mode","$coupon_info_text","$buttons","on","hide","this","val","show","eq","trigger","deposit_full","e","text","removeClass","coupon_code","errors","addClass","stop","$form","is","hasClass","preventDefault","stripe","card_action","find","card","number","cvc","exp_month","exp_year","cardPayment","handleErrorCartItemNotAvailable","error_message","Stripe","setPublishableKey","createToken","message","closest","length","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","autocompleteFeidls","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","prop","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","css","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","abort","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","$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","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","bookly","Intl","DateTimeFormat","resolvedOptions","getTimezoneOffset","init","appId","version","getLoginStatus","Event","subscribe","src","async","onLoad","script","Function","onload","head","importScript","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,oBAAqB,IAAIC,eACtCC,QAAS,SAAUC,GACXA,EAASD,UACLC,EAASC,iBAAmBjB,EAAKkB,MACjCC,SAASC,SAASC,KAAOL,EAASC,gBAElCZ,EAAWiB,KAAKN,EAASM,MACzBjC,GAASgB,QAU7B,SAASkB,GAAYxB,GACjB,IAAIM,EAAavB,GAAIiB,EAAOO,SAASD,WACrCzB,EAAE2B,KAAK,CACHiB,KAAa,OACbhB,IAAaJ,WAAWK,QACxBT,KAAa,CAACE,OAAQ,wBAAyBC,WAAaC,WAAWD,WAAYG,QAASP,EAAOO,QAASmB,SAAUN,SAASO,IAAIC,MAAM,KAAK,IAC9IjB,SAAa,OACbC,UAAa,CAACC,iBAAiB,GAC/BC,YAAa,oBAAqB,IAAIC,eACtCC,QAAa,SAAUC,GAC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ASC,GACxE3O,EAAE2B,KAAK,CACHiB,KAAM,OACNhB,IAAKJ,WAAWK,QAChBT,KAAMpB,EAAEqB,OAAOsN,EAAU,CACrBrN,OAAc,4BACdC,WAAcC,WAAWD,WACzBG,QAAc4S,EAAQ5S,UAE1BI,SAAU,OACVC,UAAW,CAACC,iBAAiB,GAC7BC,YAAa,oBAAqB,IAAIC,eACtCC,QAAS,SAAUC,UAI3B+L,GAAG+Z,MAAMC,UAAU,oBAAqB,SAAS/lB,GACzCkS,EAAQpG,SAASK,gBACjB+F,EAAQpG,SAASK,eAAenM,QAtC5CkS,EAAQrU,eAAe,gBAAkBqU,EAAQzN,YAAYC,UA6CrE,SAAsBshB,EAAKC,EAAOC,GAC9B,IAAIC,EAAShmB,SAAS4gB,cAAc,UACpCoF,EAAO3lB,KAAO,uBAEA4L,IAAV6Z,IACAE,EAAOF,MAAQA,GAEfC,aAAkBE,WAClBD,EAAOE,OAASH,GAGpB/lB,SAASmmB,KAAKtF,YAAYmF,GAC1BA,EAAOH,IAAMA,EArDTO,CAFU,+CADGrU,EAAQzN,YAAY+hB,QACmC,qBAElD,IA9pG9B,CAstGEC"}
|
1 |
+
{"version":3,"sources":["bookly.js"],"names":["$","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","$payments","$apply_coupon_button","$coupon_input","$coupon_error","$deposit_mode","$coupon_info_text","$buttons","on","hide","this","val","show","eq","trigger","deposit_full","e","text","removeClass","coupon_code","errors","addClass","stop","$form","is","hasClass","preventDefault","stripe","card_action","find","card","number","cvc","exp_month","exp_year","cardPayment","handleErrorCartItemNotAvailable","error_message","Stripe","setPublishableKey","createToken","message","closest","length","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","autocompleteFeidls","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","prop","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","css","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","bookly","Intl","DateTimeFormat","resolvedOptions","getTimezoneOffset","init","appId","version","getLoginStatus","Event","subscribe","src","async","onLoad","script","Function","onload","head","importScript","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,EAAE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Ac4S,EAAQ5S,UAE1BI,SAAU,OACVC,UAAW,CAACC,iBAAiB,GAC7BC,YAAa,oBAAqB,IAAIC,eACtCC,QAAS,SAAUC,UAI3B+L,GAAGia,MAAMC,UAAU,oBAAqB,SAASjmB,GACzCkS,EAAQpG,SAASK,gBACjB+F,EAAQpG,SAASK,eAAenM,QAtC5CkS,EAAQrU,eAAe,gBAAkBqU,EAAQzN,YAAYC,UA6CrE,SAAsBwhB,EAAKC,EAAOC,GAC9B,IAAIC,EAASlmB,SAAS8gB,cAAc,UACpCoF,EAAO7lB,KAAO,uBAEA4L,IAAV+Z,IACAE,EAAOF,MAAQA,GAEfC,aAAkBE,WAClBD,EAAOE,OAASH,GAGpBjmB,SAASqmB,KAAKtF,YAAYmF,GAC1BA,EAAOH,IAAMA,EArDTO,CAFU,+CADGvU,EAAQzN,YAAYiiB,QACmC,qBAElD,IA1qG9B,CAkuGEC"}
|
frontend/resources/js/src/time_step.js
CHANGED
@@ -21,10 +21,6 @@ export default function stepTime(params, error_message) {
|
|
21 |
}
|
22 |
return;
|
23 |
}
|
24 |
-
if (xhr_render_time != null) {
|
25 |
-
xhr_render_time.abort();
|
26 |
-
xhr_render_time = null;
|
27 |
-
}
|
28 |
var data = {
|
29 |
action : 'bookly_render_time',
|
30 |
csrf_token: BooklyL10n.csrf_token,
|
@@ -56,6 +52,13 @@ export default function stepTime(params, error_message) {
|
|
56 |
return response;
|
57 |
}
|
58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
xhr_render_time = $.ajax({
|
60 |
url : BooklyL10n.ajaxurl,
|
61 |
data : data,
|
@@ -117,6 +120,7 @@ export default function stepTime(params, error_message) {
|
|
117 |
opt[params.form_id].timeZone = this.value;
|
118 |
opt[params.form_id].timeZoneOffset = undefined;
|
119 |
showSpinner();
|
|
|
120 |
stepTime({
|
121 |
form_id: params.form_id,
|
122 |
time_zone: opt[params.form_id].timeZone
|
@@ -157,6 +161,7 @@ export default function stepTime(params, error_message) {
|
|
157 |
$time_next_button.toggle($screens.length != 1);
|
158 |
} else {
|
159 |
// Load new data from server.
|
|
|
160 |
stepTime({form_id: params.form_id, selected_date : date});
|
161 |
showSpinner();
|
162 |
}
|
@@ -168,13 +173,15 @@ export default function stepTime(params, error_message) {
|
|
168 |
},
|
169 |
onRender: function() {
|
170 |
var date = new Date(Date.UTC(this.get('view').year, this.get('view').month));
|
171 |
-
$('.picker__nav--next').on('click', function() {
|
172 |
date.setUTCMonth(date.getUTCMonth() + 1);
|
|
|
173 |
stepTime({form_id: params.form_id, selected_date : date.toJSON().substr(0, 10)});
|
174 |
showSpinner();
|
175 |
});
|
176 |
-
$('.picker__nav--prev').on('click', function() {
|
177 |
date.setUTCMonth(date.getUTCMonth() - 1);
|
|
|
178 |
stepTime({form_id: params.form_id, selected_date : date.toJSON().substr(0, 10)});
|
179 |
showSpinner();
|
180 |
});
|
@@ -453,7 +460,12 @@ export default function stepTime(params, error_message) {
|
|
453 |
});
|
454 |
|
455 |
// On click on a slot.
|
|
|
456 |
$('button.bookly-hour', $container).off('click').on('click', function (e) {
|
|
|
|
|
|
|
|
|
457 |
e.preventDefault();
|
458 |
var $this = $(this),
|
459 |
data = {
|
@@ -464,7 +476,7 @@ export default function stepTime(params, error_message) {
|
|
464 |
};
|
465 |
$this.attr({'data-style': 'zoom-in','data-spinner-color':'#333','data-spinner-size':'40'});
|
466 |
laddaStart(this);
|
467 |
-
$.ajax({
|
468 |
type : 'POST',
|
469 |
url : BooklyL10n.ajaxurl,
|
470 |
data : data,
|
21 |
}
|
22 |
return;
|
23 |
}
|
|
|
|
|
|
|
|
|
24 |
var data = {
|
25 |
action : 'bookly_render_time',
|
26 |
csrf_token: BooklyL10n.csrf_token,
|
52 |
return response;
|
53 |
}
|
54 |
|
55 |
+
function dropAjax() {
|
56 |
+
if (xhr_render_time != null) {
|
57 |
+
xhr_render_time.abort();
|
58 |
+
xhr_render_time = null;
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
xhr_render_time = $.ajax({
|
63 |
url : BooklyL10n.ajaxurl,
|
64 |
data : data,
|
120 |
opt[params.form_id].timeZone = this.value;
|
121 |
opt[params.form_id].timeZoneOffset = undefined;
|
122 |
showSpinner();
|
123 |
+
dropAjax();
|
124 |
stepTime({
|
125 |
form_id: params.form_id,
|
126 |
time_zone: opt[params.form_id].timeZone
|
161 |
$time_next_button.toggle($screens.length != 1);
|
162 |
} else {
|
163 |
// Load new data from server.
|
164 |
+
dropAjax();
|
165 |
stepTime({form_id: params.form_id, selected_date : date});
|
166 |
showSpinner();
|
167 |
}
|
173 |
},
|
174 |
onRender: function() {
|
175 |
var date = new Date(Date.UTC(this.get('view').year, this.get('view').month));
|
176 |
+
$('.picker__nav--next', $container).on('click', function() {
|
177 |
date.setUTCMonth(date.getUTCMonth() + 1);
|
178 |
+
dropAjax();
|
179 |
stepTime({form_id: params.form_id, selected_date : date.toJSON().substr(0, 10)});
|
180 |
showSpinner();
|
181 |
});
|
182 |
+
$('.picker__nav--prev', $container).on('click', function() {
|
183 |
date.setUTCMonth(date.getUTCMonth() - 1);
|
184 |
+
dropAjax();
|
185 |
stepTime({form_id: params.form_id, selected_date : date.toJSON().substr(0, 10)});
|
186 |
showSpinner();
|
187 |
});
|
460 |
});
|
461 |
|
462 |
// On click on a slot.
|
463 |
+
var xhr_session_save = null;
|
464 |
$('button.bookly-hour', $container).off('click').on('click', function (e) {
|
465 |
+
if ( xhr_session_save != null) {
|
466 |
+
xhr_session_save.abort();
|
467 |
+
xhr_session_save = null;
|
468 |
+
}
|
469 |
e.preventDefault();
|
470 |
var $this = $(this),
|
471 |
data = {
|
476 |
};
|
477 |
$this.attr({'data-style': 'zoom-in','data-spinner-color':'#333','data-spinner-size':'40'});
|
478 |
laddaStart(this);
|
479 |
+
xhr_session_save = $.ajax({
|
480 |
type : 'POST',
|
481 |
url : BooklyL10n.ajaxurl,
|
482 |
data : data,
|
languages/bookly-ru_RU.mo
CHANGED
Binary file
|
languages/bookly-ru_RU.po
CHANGED
@@ -3757,6 +3757,18 @@ msgstr "Дорогой(ая) {client_name}.\n"
|
|
3757 |
"{company_phone}\n"
|
3758 |
"{company_website}"
|
3759 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3760 |
#:
|
3761 |
msgid "Invoice for your appointment"
|
3762 |
msgstr "Счёт за вашу встречу"
|
@@ -5858,6 +5870,10 @@ msgstr "общий налог для бронирования (суммарно
|
|
5858 |
msgid "total price without tax"
|
5859 |
msgstr "общая стоимость бронирования без налога"
|
5860 |
|
|
|
|
|
|
|
|
|
5861 |
#:
|
5862 |
msgid "Dear {client_name}.\n"
|
5863 |
"\n"
|
@@ -6139,7 +6155,7 @@ msgstr "Необходимо указать название группы"
|
|
6139 |
|
6140 |
#:
|
6141 |
msgid "Important: for two-way sync, your website must use HTTPS. Google Calendar API will be able to send notifications to HTTPS address only if there is a valid SSL certificate installed on your web server. Follow the steps in this <a href=\"%s\" target=\"_blank\">document</a> to <b>verify and register your domain</b>."
|
6142 |
-
msgstr "Важно: для двусторонней синхронизации ваш сайт должен использовать HTTPS. API Google Календаря сможет отправлять уведомления на HTTPS-адрес только в том случае, если на вашем веб-сервере установлен действительный SSL сертификат. Выполните действия, описанные в этом <a href=\"%s\" target=\"_blank\"> документе </a>, чтобы <b> проверить и зарегистрировать свой домен </b>."
|
6143 |
|
6144 |
#:
|
6145 |
msgid "Allows to set the start and end times for an appointment for services with the duration of 1 day or longer. This time will be displayed in notifications to customers, backend calendar and codes for booking form."
|
3757 |
"{company_phone}\n"
|
3758 |
"{company_website}"
|
3759 |
|
3760 |
+
#:
|
3761 |
+
msgid "New invoice #{invoice_number}"
|
3762 |
+
msgstr "Новый счёт №{invoice_number}"
|
3763 |
+
|
3764 |
+
#:
|
3765 |
+
msgid "Hello.\n"
|
3766 |
+
"\n"
|
3767 |
+
"Attached please find invoice #{invoice_number} for an appointment scheduled by {client_first_name} {client_last_name}"
|
3768 |
+
msgstr "Здравствуйте.\n"
|
3769 |
+
"\n"
|
3770 |
+
"В прикрепленном файле прилагается счёт №{invoice_number} за встречу, назначенную {client_first_name} {client_last_name}"
|
3771 |
+
|
3772 |
#:
|
3773 |
msgid "Invoice for your appointment"
|
3774 |
msgstr "Счёт за вашу встречу"
|
5870 |
msgid "total price without tax"
|
5871 |
msgstr "общая стоимость бронирования без налога"
|
5872 |
|
5873 |
+
#:
|
5874 |
+
msgid "Note if you use price correction to change the service cost according to the payment gateway used, tax will not be calculated for the additional amount to the cost. If you need to report the exact tax amount to the payment system, do not use additional charge."
|
5875 |
+
msgstr "Обратите внимание, если вы используете корректировку цены для изменения стоимости услуги в соответствии с используемой платежной системой, налог не будет рассчитываться для надбавки к стоимости. Если вам нужно сообщить точную сумму налога в платежную систему, не используйте надбавку к стоимости."
|
5876 |
+
|
5877 |
#:
|
5878 |
msgid "Dear {client_name}.\n"
|
5879 |
"\n"
|
6155 |
|
6156 |
#:
|
6157 |
msgid "Important: for two-way sync, your website must use HTTPS. Google Calendar API will be able to send notifications to HTTPS address only if there is a valid SSL certificate installed on your web server. Follow the steps in this <a href=\"%s\" target=\"_blank\">document</a> to <b>verify and register your domain</b>."
|
6158 |
+
msgstr "Важно: для двусторонней синхронизации ваш сайт должен использовать HTTPS. API Google Календаря сможет отправлять уведомления на HTTPS-адрес только в том случае, если на вашем веб-сервере установлен действительный SSL сертификат. Выполните действия, описанные в этом <a href=\"%s\" target=\"_blank\"> документе </a>, чтобы <b> проверить и зарегистрировать свой домен </ b>."
|
6159 |
|
6160 |
#:
|
6161 |
msgid "Allows to set the start and end times for an appointment for services with the duration of 1 day or longer. This time will be displayed in notifications to customers, backend calendar and codes for booking form."
|
lib/Cart.php
CHANGED
@@ -220,8 +220,14 @@ class Cart
|
|
220 |
}
|
221 |
|
222 |
foreach ( $cart_item->getSlots() as $key => $slot ) {
|
223 |
-
list ( $service_id, $staff_id, $
|
|
|
224 |
$service = Entities\Service::find( $service_id );
|
|
|
|
|
|
|
|
|
|
|
225 |
|
226 |
/*
|
227 |
* Get appointment with the same params.
|
@@ -230,11 +236,12 @@ class Cart
|
|
230 |
*/
|
231 |
$appointment = new Entities\Appointment();
|
232 |
// Do not try to find appointment for tasks
|
233 |
-
if ( $
|
234 |
$appointment->loadBy( array(
|
235 |
'service_id' => $service_id,
|
236 |
'staff_id' => $staff_id,
|
237 |
-
'start_date' => $
|
|
|
238 |
) );
|
239 |
}
|
240 |
if ( $appointment->isLoaded() == false ) {
|
@@ -244,16 +251,8 @@ class Cart
|
|
244 |
->setServiceId( $service_id )
|
245 |
->setStaffId( $staff_id )
|
246 |
->setStaffAny( count( $cart_item->getStaffIds() ) > 1 )
|
247 |
-
->setStartDate( $
|
248 |
-
->setEndDate(
|
249 |
-
$datetime !== null
|
250 |
-
? date( 'Y-m-d H:i:s', strtotime( $datetime ) + (
|
251 |
-
$collaborative_max_duration !== null
|
252 |
-
? $collaborative_max_duration - $collaborative_extras_durations[ $key ]
|
253 |
-
: $cart_item->getUnits() * $service->getDuration()
|
254 |
-
) )
|
255 |
-
: null
|
256 |
-
)
|
257 |
->save();
|
258 |
} else {
|
259 |
$update = false;
|
@@ -331,7 +330,7 @@ class Cart
|
|
331 |
$item = $collaborative->addItem( $item );
|
332 |
}
|
333 |
if ( $series ) {
|
334 |
-
$series->addItem( $item );
|
335 |
} else {
|
336 |
$order->addItem( $i, $item );
|
337 |
}
|
220 |
}
|
221 |
|
222 |
foreach ( $cart_item->getSlots() as $key => $slot ) {
|
223 |
+
list ( $service_id, $staff_id, $start_datetime ) = $slot;
|
224 |
+
|
225 |
$service = Entities\Service::find( $service_id );
|
226 |
+
$item_duration = $collaborative_max_duration !== null
|
227 |
+
? $collaborative_max_duration - $collaborative_extras_durations[ $key ]
|
228 |
+
: $cart_item->getUnits() * $service->getDuration();
|
229 |
+
|
230 |
+
$end_datetime = $start_datetime !== null ? date( 'Y-m-d H:i:s', strtotime( $start_datetime ) + $item_duration ) : null;
|
231 |
|
232 |
/*
|
233 |
* Get appointment with the same params.
|
236 |
*/
|
237 |
$appointment = new Entities\Appointment();
|
238 |
// Do not try to find appointment for tasks
|
239 |
+
if ( $start_datetime !== null ) {
|
240 |
$appointment->loadBy( array(
|
241 |
'service_id' => $service_id,
|
242 |
'staff_id' => $staff_id,
|
243 |
+
'start_date' => $start_datetime,
|
244 |
+
'end_date' => $end_datetime,
|
245 |
) );
|
246 |
}
|
247 |
if ( $appointment->isLoaded() == false ) {
|
251 |
->setServiceId( $service_id )
|
252 |
->setStaffId( $staff_id )
|
253 |
->setStaffAny( count( $cart_item->getStaffIds() ) > 1 )
|
254 |
+
->setStartDate( $start_datetime )
|
255 |
+
->setEndDate( $end_datetime )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
256 |
->save();
|
257 |
} else {
|
258 |
$update = false;
|
330 |
$item = $collaborative->addItem( $item );
|
331 |
}
|
332 |
if ( $series ) {
|
333 |
+
$series->addItem( $i, $item );
|
334 |
} else {
|
335 |
$order->addItem( $i, $item );
|
336 |
}
|
lib/Config.php
CHANGED
@@ -440,7 +440,7 @@ abstract class Config
|
|
440 |
*/
|
441 |
public static function showWideTimeSlots()
|
442 |
{
|
443 |
-
return self::groupBookingActive() && get_option( '
|
444 |
}
|
445 |
|
446 |
/**
|
440 |
*/
|
441 |
public static function showWideTimeSlots()
|
442 |
{
|
443 |
+
return self::groupBookingActive() && get_option( 'bookly_group_booking_app_show_nop' );
|
444 |
}
|
445 |
|
446 |
/**
|
lib/UserBookingData.php
CHANGED
@@ -193,30 +193,31 @@ class UserBookingData
|
|
193 |
->setEmailConfirm( $current_user->user_email );
|
194 |
}
|
195 |
} elseif ( get_option( 'bookly_cst_remember_in_cookie' ) && isset( $_COOKIE['bookly-cst-full-name'] ) ) {
|
196 |
-
$date = explode( '-', $_COOKIE['bookly-cst-birthday'] );
|
197 |
-
$birthday = array(
|
198 |
-
'year' => $date[0],
|
199 |
-
'month' => isset( $date[1] ) ? (int) $date[1] : 0,
|
200 |
-
'day' => isset( $date[2] ) ? (int) $date[2] : 0,
|
201 |
-
);
|
202 |
-
|
203 |
$this
|
204 |
->setFullName( $_COOKIE['bookly-cst-full-name'] )
|
205 |
-
->setFirstName( $_COOKIE['bookly-cst-first-name'] )
|
206 |
-
->setLastName( $_COOKIE['bookly-cst-last-name'] )
|
207 |
->setEmail( $_COOKIE['bookly-cst-email'] )
|
208 |
->setEmailConfirm( $_COOKIE['bookly-cst-email'] )
|
209 |
->setPhone( $_COOKIE['bookly-cst-phone'] )
|
210 |
-
->setBirthday( $birthday )
|
211 |
-
->setCountry( $_COOKIE['bookly-cst-country'] )
|
212 |
-
->setState( $_COOKIE['bookly-cst-state'] )
|
213 |
-
->setPostcode( $_COOKIE['bookly-cst-postcode'] )
|
214 |
-
->setCity( $_COOKIE['bookly-cst-city'] )
|
215 |
-
->setStreet( $_COOKIE['bookly-cst-street'] )
|
216 |
-
->setStreetNumber( $_COOKIE['bookly-cst-street-number'] )
|
217 |
-
->setAdditionalAddress( $_COOKIE['bookly-cst-additional-address'] )
|
218 |
->setInfoFields( (array) json_decode( stripslashes( $_COOKIE['bookly-cst-info-fields'] ), true ) )
|
219 |
;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
}
|
221 |
|
222 |
// Register destructor (should work in cases when regular __destruct() does not work).
|
193 |
->setEmailConfirm( $current_user->user_email );
|
194 |
}
|
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'] ) ) {
|
204 |
+
$date = explode( '-', $_COOKIE['bookly-cst-birthday'] );
|
205 |
+
$birthday = array(
|
206 |
+
'year' => $date[0],
|
207 |
+
'month' => isset( $date[1] ) ? (int) $date[1] : 0,
|
208 |
+
'day' => isset( $date[2] ) ? (int) $date[2] : 0,
|
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'] ); }
|
215 |
+
if ( isset( $_COOKIE['bookly-cst-state'] ) ) { $this->setState( $_COOKIE['bookly-cst-state'] ); }
|
216 |
+
if ( isset( $_COOKIE['bookly-cst-postcode'] ) ) { $this->setPostcode( $_COOKIE['bookly-cst-postcode'] ); }
|
217 |
+
if ( isset( $_COOKIE['bookly-cst-city'] ) ) { $this->setCity( $_COOKIE['bookly-cst-city'] ); }
|
218 |
+
if ( isset( $_COOKIE['bookly-cst-street'] ) ) { $this->setStreet( $_COOKIE['bookly-cst-street'] ); }
|
219 |
+
if ( isset( $_COOKIE['bookly-cst-street-number'] ) ) { $this->setStreetNumber( $_COOKIE['bookly-cst-street-number'] ); }
|
220 |
+
if ( isset( $_COOKIE['bookly-cst-additional-address'] ) ) { $this->setAdditionalAddress( $_COOKIE['bookly-cst-additional-address'] ); }
|
221 |
}
|
222 |
|
223 |
// Register destructor (should work in cases when regular __destruct() does not work).
|
lib/base/Installer.php
CHANGED
@@ -116,8 +116,11 @@ abstract class Installer extends Schema
|
|
116 |
private function getTables()
|
117 |
{
|
118 |
$tables = array();
|
119 |
-
|
120 |
-
|
|
|
|
|
|
|
121 |
}
|
122 |
|
123 |
return $tables;
|
116 |
private function getTables()
|
117 |
{
|
118 |
$tables = array();
|
119 |
+
// Check instance because, add-ons for Bookly < 16.4 can call this method, and drop Bookly tables
|
120 |
+
if ( $this instanceof \Bookly\Lib\Installer ) {
|
121 |
+
foreach ( \Bookly\Lib\Plugin::getEntityClasses() as $entity_class ) {
|
122 |
+
$tables[] = $entity_class::getTableName();
|
123 |
+
}
|
124 |
}
|
125 |
|
126 |
return $tables;
|
lib/data_holders/booking/Order.php
CHANGED
@@ -207,7 +207,7 @@ class Order
|
|
207 |
$item = $compound->addItem( $item );
|
208 |
}
|
209 |
if ( $series ) {
|
210 |
-
$series->addItem( $item );
|
211 |
} else {
|
212 |
$order->addItem( $i, $item );
|
213 |
}
|
207 |
$item = $compound->addItem( $item );
|
208 |
}
|
209 |
if ( $series ) {
|
210 |
+
$series->addItem( $i, $item );
|
211 |
} else {
|
212 |
$order->addItem( $i, $item );
|
213 |
}
|
lib/data_holders/booking/Series.php
CHANGED
@@ -60,12 +60,13 @@ class Series extends Item
|
|
60 |
/**
|
61 |
* Add item.
|
62 |
*
|
|
|
63 |
* @param Item $item
|
64 |
* @return $this
|
65 |
*/
|
66 |
-
public function addItem( Item $item )
|
67 |
{
|
68 |
-
$this->items[] = $item;
|
69 |
|
70 |
return $this;
|
71 |
}
|
60 |
/**
|
61 |
* Add item.
|
62 |
*
|
63 |
+
* @param string $id
|
64 |
* @param Item $item
|
65 |
* @return $this
|
66 |
*/
|
67 |
+
public function addItem( $id, Item $item )
|
68 |
{
|
69 |
+
$this->items[ $id ] = $item;
|
70 |
|
71 |
return $this;
|
72 |
}
|
lib/entities/CustomerAppointment.php
CHANGED
@@ -175,6 +175,8 @@ class CustomerAppointment extends Lib\Base\Entity
|
|
175 |
} else {
|
176 |
if ( $this->getCompoundToken() ) {
|
177 |
Lib\Proxy\CompoundServices::cancelAppointment( $this );
|
|
|
|
|
178 |
} else {
|
179 |
$this->save();
|
180 |
if ( $this->getExtras() != '[]' ) {
|
175 |
} else {
|
176 |
if ( $this->getCompoundToken() ) {
|
177 |
Lib\Proxy\CompoundServices::cancelAppointment( $this );
|
178 |
+
} elseif ( $this->getCollaborativeToken() ) {
|
179 |
+
Lib\Proxy\CollaborativeServices::cancelAppointment( $this );
|
180 |
} else {
|
181 |
$this->save();
|
182 |
if ( $this->getExtras() != '[]' ) {
|
lib/notifications/base/Codes.php
DELETED
@@ -1,93 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
namespace Bookly\Lib\Notifications\Base;
|
3 |
-
|
4 |
-
use Bookly\Lib\Utils;
|
5 |
-
|
6 |
-
/**
|
7 |
-
* Class Codes
|
8 |
-
* @package Bookly\Lib\Notifications\Base
|
9 |
-
*/
|
10 |
-
abstract class Codes
|
11 |
-
{
|
12 |
-
/**
|
13 |
-
* Protected constructor.
|
14 |
-
*/
|
15 |
-
protected function __construct()
|
16 |
-
{
|
17 |
-
// Use static methods for creating new objects.
|
18 |
-
}
|
19 |
-
|
20 |
-
/**
|
21 |
-
* Do replacements.
|
22 |
-
*
|
23 |
-
* @param string $text
|
24 |
-
* @param string $format
|
25 |
-
* @return string
|
26 |
-
*/
|
27 |
-
public function replace( $text, $format = 'text' )
|
28 |
-
{
|
29 |
-
$codes = $this->getReplaceCodes( $format );
|
30 |
-
|
31 |
-
return strtr( $text, $codes );
|
32 |
-
}
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Do replacements for SMS.
|
36 |
-
* Returns both personal and impersonal text.
|
37 |
-
*
|
38 |
-
* @param string $text
|
39 |
-
* @return array
|
40 |
-
*/
|
41 |
-
public function replaceForSms( $text )
|
42 |
-
{
|
43 |
-
$codes = $this->getReplaceCodes( 'text' );
|
44 |
-
|
45 |
-
// Impersonal codes.
|
46 |
-
$impersonal_codes = array();
|
47 |
-
foreach ( $codes as $name => $code ) {
|
48 |
-
$count = Utils\SMSCounter::count( strval( $code ) );
|
49 |
-
if ( $count->encoding == Utils\SMSCounter::UTF16 ) {
|
50 |
-
$impersonal_symbol = "ϔ";
|
51 |
-
} else {
|
52 |
-
$impersonal_symbol = "X";
|
53 |
-
}
|
54 |
-
$impersonal_codes[ $name ] = preg_replace( '/[^\s]/', $impersonal_symbol, $code );
|
55 |
-
}
|
56 |
-
|
57 |
-
return array(
|
58 |
-
'personal' => strtr( $text, $codes ),
|
59 |
-
'impersonal' => strtr( $text, $impersonal_codes ),
|
60 |
-
);
|
61 |
-
}
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Get replacement codes for given format.
|
65 |
-
*
|
66 |
-
* @param string $format
|
67 |
-
* @return array
|
68 |
-
*/
|
69 |
-
protected function getReplaceCodes( $format )
|
70 |
-
{
|
71 |
-
$company_logo = '';
|
72 |
-
|
73 |
-
if ( $format == 'html' ) {
|
74 |
-
$img = wp_get_attachment_image_src( get_option( 'bookly_co_logo_attachment_id' ), 'full' );
|
75 |
-
// Company logo as <img> tag.
|
76 |
-
if ( $img ) {
|
77 |
-
$company_logo = sprintf(
|
78 |
-
'<img src="%s" alt="%s" />',
|
79 |
-
esc_attr( $img[0] ),
|
80 |
-
esc_attr( get_option( 'bookly_co_name' ) )
|
81 |
-
);
|
82 |
-
}
|
83 |
-
}
|
84 |
-
|
85 |
-
return array(
|
86 |
-
'{company_address}' => $format == 'html' ? nl2br( get_option( 'bookly_co_address' ) ) : get_option( 'bookly_co_address' ),
|
87 |
-
'{company_logo}' => $company_logo,
|
88 |
-
'{company_name}' => get_option( 'bookly_co_name' ),
|
89 |
-
'{company_phone}' => get_option( 'bookly_co_phone' ),
|
90 |
-
'{company_website}' => get_option( 'bookly_co_website' ),
|
91 |
-
);
|
92 |
-
}
|
93 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/notifications/base/Sender.php
DELETED
@@ -1,222 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
namespace Bookly\Lib\Notifications\Base;
|
3 |
-
|
4 |
-
use Bookly\Lib\Config;
|
5 |
-
use Bookly\Lib\Entities\Notification;
|
6 |
-
use Bookly\Lib\Proxy;
|
7 |
-
use Bookly\Lib\SMS;
|
8 |
-
use Bookly\Lib\Utils;
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Class Sender
|
12 |
-
* @package Bookly\Lib\Notifications\Base
|
13 |
-
*/
|
14 |
-
abstract class Sender
|
15 |
-
{
|
16 |
-
/** @var SMS */
|
17 |
-
protected static $sms;
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Protected constructor.
|
21 |
-
*/
|
22 |
-
protected function __construct()
|
23 |
-
{
|
24 |
-
// Use static methods for creating new objects.
|
25 |
-
}
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Send email to administrators.
|
29 |
-
*
|
30 |
-
* @param Notification $notification
|
31 |
-
* @param Codes $codes
|
32 |
-
* @param array $attachments
|
33 |
-
* @param array $extra_headers
|
34 |
-
* @return bool
|
35 |
-
*/
|
36 |
-
protected function sendEmailToAdmins( Notification $notification, Codes $codes, $attachments = array(), $extra_headers = array() )
|
37 |
-
{
|
38 |
-
$admin_emails = Utils\Common::getAdminEmails();
|
39 |
-
if ( empty ( $admin_emails ) ) {
|
40 |
-
return false;
|
41 |
-
}
|
42 |
-
|
43 |
-
return $this->_sendEmail(
|
44 |
-
$admin_emails,
|
45 |
-
$notification->getSubject(),
|
46 |
-
Proxy\Pro::prepareNotificationMessage( $notification->getMessage(), 'admin', 'email' ),
|
47 |
-
$codes,
|
48 |
-
$attachments,
|
49 |
-
$extra_headers
|
50 |
-
);
|
51 |
-
}
|
52 |
-
|
53 |
-
/**
|
54 |
-
* Send email to client.
|
55 |
-
*
|
56 |
-
* @param string $email
|
57 |
-
* @param Notification $notification
|
58 |
-
* @param Codes $codes
|
59 |
-
* @param array $attachments
|
60 |
-
* @param array $extra_headers
|
61 |
-
* @return bool
|
62 |
-
*/
|
63 |
-
protected function sendEmailToClient( $email, Notification $notification, Codes $codes, $attachments = array(), $extra_headers = array() )
|
64 |
-
{
|
65 |
-
if ( $email == '' ) {
|
66 |
-
return false;
|
67 |
-
}
|
68 |
-
|
69 |
-
return $this->_sendEmail(
|
70 |
-
$email,
|
71 |
-
$notification->getTranslatedSubject(),
|
72 |
-
$notification->getTranslatedMessage(),
|
73 |
-
$codes,
|
74 |
-
$attachments,
|
75 |
-
$extra_headers
|
76 |
-
);
|
77 |
-
}
|
78 |
-
|
79 |
-
/**
|
80 |
-
* Send email to staff.
|
81 |
-
*
|
82 |
-
* @param string $email
|
83 |
-
* @param Notification $notification
|
84 |
-
* @param Codes $codes
|
85 |
-
* @param array $attachments
|
86 |
-
* @param array $extra_headers
|
87 |
-
* @return bool
|
88 |
-
*/
|
89 |
-
protected function sendEmailToStaff( $email, Notification $notification, Codes $codes, $attachments = array(), $extra_headers = array() )
|
90 |
-
{
|
91 |
-
if ( $email == '' ) {
|
92 |
-
return false;
|
93 |
-
}
|
94 |
-
|
95 |
-
return $this->_sendEmail(
|
96 |
-
$email,
|
97 |
-
$notification->getSubject(),
|
98 |
-
Proxy\Pro::prepareNotificationMessage( $notification->getMessage(), 'staff', 'email' ),
|
99 |
-
$codes,
|
100 |
-
$attachments,
|
101 |
-
$extra_headers
|
102 |
-
);
|
103 |
-
}
|
104 |
-
|
105 |
-
/**
|
106 |
-
* Send SMS to admin.
|
107 |
-
*
|
108 |
-
* @param Notification $notification
|
109 |
-
* @param Codes $codes
|
110 |
-
* @return bool
|
111 |
-
*/
|
112 |
-
protected function sendSmsToAdmin( Notification $notification, Codes $codes )
|
113 |
-
{
|
114 |
-
$phone = get_option( 'bookly_sms_administrator_phone', '' );
|
115 |
-
if ( $phone == '' ) {
|
116 |
-
return false;
|
117 |
-
}
|
118 |
-
|
119 |
-
return $this->_sendSms(
|
120 |
-
$phone,
|
121 |
-
Proxy\Pro::prepareNotificationMessage( $notification->getMessage(), 'admin', 'sms' ),
|
122 |
-
$codes,
|
123 |
-
$notification->getTypeId()
|
124 |
-
);
|
125 |
-
}
|
126 |
-
|
127 |
-
/**
|
128 |
-
* Send SMS to client.
|
129 |
-
*
|
130 |
-
* @param string $phone
|
131 |
-
* @param Notification $notification
|
132 |
-
* @param Codes $codes
|
133 |
-
* @return bool
|
134 |
-
*/
|
135 |
-
protected function sendSmsToClient( $phone, Notification $notification, Codes $codes )
|
136 |
-
{
|
137 |
-
if ( $phone == '' ) {
|
138 |
-
return false;
|
139 |
-
}
|
140 |
-
|
141 |
-
return $this->_sendSms(
|
142 |
-
$phone,
|
143 |
-
$notification->getTranslatedMessage(),
|
144 |
-
$codes,
|
145 |
-
$notification->getTypeId()
|
146 |
-
);
|
147 |
-
}
|
148 |
-
|
149 |
-
/**
|
150 |
-
* Send SMS to staff.
|
151 |
-
*
|
152 |
-
* @param string $phone
|
153 |
-
* @param Notification $notification
|
154 |
-
* @param Codes $codes
|
155 |
-
* @return bool
|
156 |
-
*/
|
157 |
-
protected function sendSmsToStaff( $phone, Notification $notification, Codes $codes )
|
158 |
-
{
|
159 |
-
if ( $phone == '' ) {
|
160 |
-
return false;
|
161 |
-
}
|
162 |
-
|
163 |
-
return $this->_sendSms(
|
164 |
-
$phone,
|
165 |
-
Proxy\Pro::prepareNotificationMessage( $notification->getMessage(), 'staff', 'sms' ),
|
166 |
-
$codes,
|
167 |
-
$notification->getTypeId()
|
168 |
-
);
|
169 |
-
}
|
170 |
-
|
171 |
-
/**
|
172 |
-
* Send email.
|
173 |
-
*
|
174 |
-
* @param string|array $email
|
175 |
-
* @param string $subject
|
176 |
-
* @param string $message
|
177 |
-
* @param Codes $codes
|
178 |
-
* @param array $attachments
|
179 |
-
* @param array $extra_headers
|
180 |
-
* @return bool
|
181 |
-
*/
|
182 |
-
private function _sendEmail( $email, $subject, $message, Codes $codes, $attachments = array(), $extra_headers = array() )
|
183 |
-
{
|
184 |
-
// Subject.
|
185 |
-
$subject = $codes->replace( $subject, 'text' );
|
186 |
-
|
187 |
-
// Message.
|
188 |
-
if ( Config::sendEmailAsHtml() ) {
|
189 |
-
$message = wpautop( $codes->replace( $message, 'html' ) );
|
190 |
-
} else {
|
191 |
-
$message = $codes->replace( $message, 'text' );
|
192 |
-
}
|
193 |
-
|
194 |
-
// Headers.
|
195 |
-
$headers = Utils\Common::getEmailHeaders( $extra_headers );
|
196 |
-
|
197 |
-
// Do send.
|
198 |
-
return wp_mail( $email, $subject, $message, $headers, $attachments );
|
199 |
-
}
|
200 |
-
|
201 |
-
/**
|
202 |
-
* Send SMS.
|
203 |
-
*
|
204 |
-
* @param string $phone
|
205 |
-
* @param string $message
|
206 |
-
* @param Codes $codes
|
207 |
-
* @param int $type_id
|
208 |
-
* @return bool
|
209 |
-
*/
|
210 |
-
private function _sendSms( $phone, $message, Codes $codes, $type_id )
|
211 |
-
{
|
212 |
-
if ( self::$sms === null ) {
|
213 |
-
self::$sms = new SMS();
|
214 |
-
}
|
215 |
-
|
216 |
-
// Message.
|
217 |
-
$message = $codes->replaceForSms( $message );
|
218 |
-
|
219 |
-
// Do send.
|
220 |
-
return self::$sms->sendSms( $phone, $message['personal'], $message['impersonal'], $type_id );
|
221 |
-
}
|
222 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/notifications/booking/Sender.php
DELETED
@@ -1,250 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
namespace Bookly\Lib\Notifications\Booking;
|
3 |
-
|
4 |
-
use Bookly\Lib\DataHolders\Booking as DataHolders;
|
5 |
-
use Bookly\Lib\Entities\Notification;
|
6 |
-
use Bookly\Lib\Notifications;
|
7 |
-
use Bookly\Lib\Notifications\NewBooking\Codes;
|
8 |
-
use Bookly\Lib\Notifications\NewBooking\ICS;
|
9 |
-
use Bookly\Lib\Proxy;
|
10 |
-
|
11 |
-
/**
|
12 |
-
* Class Sender
|
13 |
-
* @package Bookly\Lib\Notifications\Booking
|
14 |
-
*/
|
15 |
-
class Sender extends Notifications\Base\Sender
|
16 |
-
{
|
17 |
-
/** @var DataHolders\Order */
|
18 |
-
protected $order;
|
19 |
-
/** @var Codes */
|
20 |
-
protected $codes;
|
21 |
-
|
22 |
-
/**
|
23 |
-
* Create new instance.
|
24 |
-
*
|
25 |
-
* @param DataHolders\Order $order
|
26 |
-
* @param Codes $codes
|
27 |
-
* @return static
|
28 |
-
*/
|
29 |
-
public static function create( DataHolders\Order $order, Codes $codes )
|
30 |
-
{
|
31 |
-
$sender = new static();
|
32 |
-
$sender->order = $order;
|
33 |
-
$sender->codes = $codes;
|
34 |
-
|
35 |
-
return $sender;
|
36 |
-
}
|
37 |
-
|
38 |
-
/**
|
39 |
-
* Send notifications to client.
|
40 |
-
*
|
41 |
-
* @param DataHolders\Item $item
|
42 |
-
* @param string $lang
|
43 |
-
*/
|
44 |
-
public function sendToClient( DataHolders\Item $item, $lang )
|
45 |
-
{
|
46 |
-
foreach ( $this->getNotificationsForClient() as $notification ) {
|
47 |
-
switch ( $notification->getGateway() ) {
|
48 |
-
case 'email':
|
49 |
-
$this->notifyClientByEmail( $notification, $item, $lang );
|
50 |
-
break;
|
51 |
-
case 'sms':
|
52 |
-
$this->notifyClientBySms( $notification, $item, $lang );
|
53 |
-
break;
|
54 |
-
}
|
55 |
-
}
|
56 |
-
}
|
57 |
-
|
58 |
-
/**
|
59 |
-
* Send notifications to staff and/or admins.
|
60 |
-
*
|
61 |
-
* @param DataHolders\Item $item
|
62 |
-
* @param string $lang
|
63 |
-
*/
|
64 |
-
public function sendToStaffAndAdmins( DataHolders\Item $item, $lang )
|
65 |
-
{
|
66 |
-
// Notify staff and admins.
|
67 |
-
foreach ( $this->getNotificationsForStaffAndAdmins() as $notification ) {
|
68 |
-
if ( ! $notification->getToAdmin() && $item->getStaff()->isArchived() ) {
|
69 |
-
// No recipient.
|
70 |
-
continue;
|
71 |
-
}
|
72 |
-
switch ( $notification->getGateway() ) {
|
73 |
-
case 'email':
|
74 |
-
$this->notifyStaffAndAdminsByEmail( $notification, $item, $lang );
|
75 |
-
break;
|
76 |
-
case 'sms':
|
77 |
-
$this->notifyStaffAndAdminBySms( $notification, $item, $lang );
|
78 |
-
break;
|
79 |
-
}
|
80 |
-
}
|
81 |
-
}
|
82 |
-
|
83 |
-
/**
|
84 |
-
* Notify client by email.
|
85 |
-
*
|
86 |
-
* @param Notification $notification
|
87 |
-
* @param DataHolders\Item $item
|
88 |
-
* @param string $lang
|
89 |
-
*/
|
90 |
-
protected function notifyClientByEmail( Notification $notification, DataHolders\Item $item, $lang )
|
91 |
-
{
|
92 |
-
if ( $this->order->getCustomer()->getEmail() == '' ) {
|
93 |
-
// No recipient.
|
94 |
-
return;
|
95 |
-
}
|
96 |
-
|
97 |
-
// Prepare codes for this item.
|
98 |
-
$this->codes->prepareForItem( $item, $lang, true );
|
99 |
-
|
100 |
-
// Attachments.
|
101 |
-
$attachments = $this->createAttachments( $notification );
|
102 |
-
|
103 |
-
// Send email to client.
|
104 |
-
$this->sendEmailToClient( $this->order->getCustomer()->getEmail(), $notification, $this->codes, $attachments );
|
105 |
-
|
106 |
-
// Clean up attachments.
|
107 |
-
$this->clearAttachments( $attachments );
|
108 |
-
}
|
109 |
-
|
110 |
-
/**
|
111 |
-
* Notify client by SMS.
|
112 |
-
*
|
113 |
-
* @param Notification $notification
|
114 |
-
* @param DataHolders\Item $item
|
115 |
-
* @param string $lang
|
116 |
-
*/
|
117 |
-
protected function notifyClientBySms( Notification $notification, DataHolders\Item $item, $lang )
|
118 |
-
{
|
119 |
-
if ( $this->order->getCustomer()->getPhone() == '' ) {
|
120 |
-
// No recipient.
|
121 |
-
return;
|
122 |
-
}
|
123 |
-
|
124 |
-
// Prepare codes for this item.
|
125 |
-
$this->codes->prepareForItem( $item, $lang, true );
|
126 |
-
|
127 |
-
// Send SMS to client.
|
128 |
-
$this->sendSmsToClient( $this->order->getCustomer()->getPhone(), $notification, $this->codes );
|
129 |
-
}
|
130 |
-
|
131 |
-
/**
|
132 |
-
* Notify staff and/or administrators by email.
|
133 |
-
*
|
134 |
-
* @param Notification $notification
|
135 |
-
* @param DataHolders\Item $item
|
136 |
-
* @param string $lang
|
137 |
-
*/
|
138 |
-
protected function notifyStaffAndAdminsByEmail( Notification $notification, DataHolders\Item $item, $lang )
|
139 |
-
{
|
140 |
-
if ( ! $notification->getToAdmin() && $item->getStaff()->getEmail() == '' ) {
|
141 |
-
// No recipient.
|
142 |
-
return;
|
143 |
-
}
|
144 |
-
|
145 |
-
// Prepare codes for this item.
|
146 |
-
$this->codes->prepareForItem( $item, $lang, false );
|
147 |
-
|
148 |
-
// Attachments.
|
149 |
-
$attachments = $this->createAttachments( $notification );
|
150 |
-
|
151 |
-
// Extra headers.
|
152 |
-
$extra_headers = array();
|
153 |
-
if ( get_option( 'bookly_email_reply_to_customers' ) ) {
|
154 |
-
$customer = $this->order->getCustomer();
|
155 |
-
$extra_headers = array( 'reply-to' => array( 'email' => $customer->getEmail(), 'name' => $customer->getFullName() ) );
|
156 |
-
}
|
157 |
-
|
158 |
-
// Send email to staff.
|
159 |
-
if ( $notification->getToStaff() ) {
|
160 |
-
$this->sendEmailToStaff( $item->getStaff()->getEmail(), $notification, $this->codes, $attachments, $extra_headers );
|
161 |
-
}
|
162 |
-
|
163 |
-
// Send email to administrators.
|
164 |
-
if ( $notification->getToAdmin() ) {
|
165 |
-
$this->sendEmailToAdmins( $notification, $this->codes, $attachments, $extra_headers );
|
166 |
-
}
|
167 |
-
|
168 |
-
// Clean up attachments.
|
169 |
-
$this->clearAttachments( $attachments );
|
170 |
-
}
|
171 |
-
|
172 |
-
/**
|
173 |
-
* Notify staff and/or administrator by SMS.
|
174 |
-
*
|
175 |
-
* @param Notification $notification
|
176 |
-
* @param DataHolders\Item $item
|
177 |
-
* @param string $lang
|
178 |
-
*/
|
179 |
-
protected function notifyStaffAndAdminBySms( Notification $notification, DataHolders\Item $item, $lang )
|
180 |
-
{
|
181 |
-
if ( ! $notification->getToAdmin() && $item->getStaff()->getPhone() == '' ) {
|
182 |
-
// No recipients for this item.
|
183 |
-
return;
|
184 |
-
}
|
185 |
-
|
186 |
-
// Prepare codes for this item.
|
187 |
-
$this->codes->prepareForItem( $item, $lang, false );
|
188 |
-
|
189 |
-
// Send SMS to staff.
|
190 |
-
if ( $notification->getToStaff() ) {
|
191 |
-
$this->sendSmsToStaff( $item->getStaff()->getPhone(), $notification, $this->codes );
|
192 |
-
}
|
193 |
-
|
194 |
-
// Send SMS to administrator.
|
195 |
-
if ( $notification->getToAdmin() ) {
|
196 |
-
$this->sendSmsToAdmin( $notification, $this->codes );
|
197 |
-
}
|
198 |
-
}
|
199 |
-
|
200 |
-
/**
|
201 |
-
* @inheritdoc
|
202 |
-
*/
|
203 |
-
protected function createAttachments( Notification $notification )
|
204 |
-
{
|
205 |
-
$attachments = array();
|
206 |
-
|
207 |
-
// ICS.
|
208 |
-
if ( $notification->getAttachIcs() ) {
|
209 |
-
$file = $this->createIcs( $this->codes );
|
210 |
-
if ( $file ) {
|
211 |
-
$attachments[] = $file;
|
212 |
-
}
|
213 |
-
}
|
214 |
-
|
215 |
-
// Invoices.
|
216 |
-
if ( $notification->getAttachInvoice() && $this->order->hasPayment() ) {
|
217 |
-
$file = Proxy\Invoices::getInvoice( $this->order->getPayment() );
|
218 |
-
if ( $file ) {
|
219 |
-
$attachments[] = $file;
|
220 |
-
}
|
221 |
-
}
|
222 |
-
|
223 |
-
return $attachments;
|
224 |
-
}
|
225 |
-
|
226 |
-
/**
|
227 |
-
* Create ICS attachment.
|
228 |
-
*
|
229 |
-
* @param Codes $codes
|
230 |
-
* @return bool|string
|
231 |
-
*/
|
232 |
-
protected function createIcs( Codes $codes )
|
233 |
-
{
|
234 |
-
$ics = new ICS( $codes );
|
235 |
-
|
236 |
-
return $ics->create();
|
237 |
-
}
|
238 |
-
|
239 |
-
/**
|
240 |
-
* Remove attachment files.
|
241 |
-
*
|
242 |
-
* @param array $attachments
|
243 |
-
*/
|
244 |
-
protected function clearAttachments( array $attachments )
|
245 |
-
{
|
246 |
-
foreach ( $attachments as $file ) {
|
247 |
-
unlink( $file );
|
248 |
-
}
|
249 |
-
}
|
250 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/notifications/codes/Combined.php
DELETED
@@ -1,154 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
namespace Bookly\Lib\Notifications\Codes;
|
3 |
-
|
4 |
-
use Bookly\Lib\Config;
|
5 |
-
use Bookly\Lib\Proxy;
|
6 |
-
use Bookly\Lib\Utils;
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Class Codes
|
10 |
-
* @package Bookly\Lib\Notifications\Codes
|
11 |
-
*/
|
12 |
-
class Combined extends Codes
|
13 |
-
{
|
14 |
-
public $cart_info;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* @inheritdoc
|
18 |
-
*/
|
19 |
-
protected function getCodes( $format )
|
20 |
-
{
|
21 |
-
$cart_info_c = $cart_info = '';
|
22 |
-
|
23 |
-
// Cart info.
|
24 |
-
$cart_info_data = $this->cart_info;
|
25 |
-
if ( ! empty ( $cart_info_data ) ) {
|
26 |
-
$cart_columns = get_option( 'bookly_cart_show_columns', array() );
|
27 |
-
if ( empty( $cart_columns ) ) {
|
28 |
-
$cart_columns = array(
|
29 |
-
'service' => array( 'show' => '1', ),
|
30 |
-
'date' => array( 'show' => '1', ),
|
31 |
-
'time' => array( 'show' => '1', ),
|
32 |
-
'employee' => array( 'show' => '1', ),
|
33 |
-
'price' => array( 'show' => '1', ),
|
34 |
-
'deposit' => array( 'show' => (int) Config::depositPaymentsActive() ),
|
35 |
-
'tax' => array( 'show' => (int) Config::taxesActive(), ),
|
36 |
-
);
|
37 |
-
}
|
38 |
-
if ( ! Proxy\Taxes::showTaxColumn() ) {
|
39 |
-
unset( $cart_columns['tax'] );
|
40 |
-
}
|
41 |
-
if ( ! Config::depositPaymentsActive() ) {
|
42 |
-
unset( $cart_columns['deposit'] );
|
43 |
-
}
|
44 |
-
$ths = array();
|
45 |
-
foreach ( $cart_columns as $column => $attr ) {
|
46 |
-
if ( $attr['show'] ) {
|
47 |
-
switch ( $column ) {
|
48 |
-
case 'service':
|
49 |
-
$ths[] = Utils\Common::getTranslatedOption( 'bookly_l10n_label_service' );
|
50 |
-
break;
|
51 |
-
case 'date':
|
52 |
-
$ths[] = __( 'Date', 'bookly' );
|
53 |
-
break;
|
54 |
-
case 'time':
|
55 |
-
$ths[] = __( 'Time', 'bookly' );
|
56 |
-
break;
|
57 |
-
case 'tax':
|
58 |
-
$ths[] = __( 'Tax', 'bookly' );
|
59 |
-
break;
|
60 |
-
case 'employee':
|
61 |
-
$ths[] = Utils\Common::getTranslatedOption( 'bookly_l10n_label_employee' );
|
62 |
-
break;
|
63 |
-
case 'price':
|
64 |
-
$ths[] = __( 'Price', 'bookly' );
|
65 |
-
break;
|
66 |
-
case 'deposit':
|
67 |
-
$ths[] = __( 'Deposit', 'bookly' );
|
68 |
-
break;
|
69 |
-
}
|
70 |
-
}
|
71 |
-
}
|
72 |
-
$trs = array();
|
73 |
-
foreach ( $cart_info_data as $codes ) {
|
74 |
-
$tds = array();
|
75 |
-
foreach ( $cart_columns as $column => $attr ) {
|
76 |
-
if ( $attr['show'] ) {
|
77 |
-
switch ( $column ) {
|
78 |
-
case 'service':
|
79 |
-
$service_name = $codes['service_name'];
|
80 |
-
if ( ! empty ( $codes['extras'] ) ) {
|
81 |
-
$extras = '';
|
82 |
-
if ( $format == 'html' ) {
|
83 |
-
foreach ( $codes['extras'] as $extra ) {
|
84 |
-
$extras .= '<li>' . $extra['title'] . '</li>';
|
85 |
-
}
|
86 |
-
$extras = '<ul>' . $extras . '</ul>';
|
87 |
-
} else {
|
88 |
-
foreach ( $codes['extras'] as $extra ) {
|
89 |
-
$extras .= ', ' . str_replace( ' × ', ' x ', $extra['title'] );
|
90 |
-
}
|
91 |
-
}
|
92 |
-
$service_name .= $extras;
|
93 |
-
}
|
94 |
-
$tds[] = $service_name;
|
95 |
-
break;
|
96 |
-
case 'date':
|
97 |
-
$tds[] = $codes['appointment_start'] === null ? __( 'N/A', 'bookly' ) : Utils\DateTime::formatDate( $codes['appointment_start'] );
|
98 |
-
break;
|
99 |
-
case 'time':
|
100 |
-
if ( $codes['appointment_start_info'] !== null ) {
|
101 |
-
$tds[] = $codes['appointment_start_info'];
|
102 |
-
} else {
|
103 |
-
$tds[] = $codes['appointment_start'] === null ? __( 'N/A', 'bookly' ) : Utils\DateTime::formatTime( $codes['appointment_start'] );
|
104 |
-
}
|
105 |
-
break;
|
106 |
-
case 'tax':
|
107 |
-
$tds[] = Utils\Price::format( $codes['tax'] );
|
108 |
-
break;
|
109 |
-
case 'employee':
|
110 |
-
$tds[] = $codes['staff_name'];
|
111 |
-
break;
|
112 |
-
case 'price':
|
113 |
-
$tds[] = Utils\Price::format( $codes['appointment_price'] );
|
114 |
-
break;
|
115 |
-
case 'deposit':
|
116 |
-
$tds[] = $codes['deposit'];
|
117 |
-
break;
|
118 |
-
}
|
119 |
-
}
|
120 |
-
}
|
121 |
-
$tds[] = $codes['cancel_url'];
|
122 |
-
$trs[] = $tds;
|
123 |
-
}
|
124 |
-
if ( $format == 'html' ) {
|
125 |
-
$cart_info = '<table cellspacing="1" border="1" cellpadding="5"><thead><tr><th>' . implode( '</th><th>', $ths ) . '</th></tr></thead><tbody>';
|
126 |
-
$cart_info_c = '<table cellspacing="1" border="1" cellpadding="5"><thead><tr><th>' . implode( '</th><th>', $ths ) . '</th><th>' . __( 'Cancel', 'bookly' ) . '</th></tr></thead><tbody>';
|
127 |
-
foreach ( $trs as $tr ) {
|
128 |
-
$cancel_url = array_pop( $tr );
|
129 |
-
$cart_info .= '<tr><td>' . implode( '</td><td>', $tr ) . '</td></tr>';
|
130 |
-
$cart_info_c .= '<tr><td>' . implode( '</td><td>', $tr ) . '</td><td><a href="' . $cancel_url . '">' . __( 'Cancel', 'bookly' ) . '</a></td></tr>';
|
131 |
-
}
|
132 |
-
$cart_info .= '</tbody></table>';
|
133 |
-
$cart_info_c .= '</tbody></table>';
|
134 |
-
} else {
|
135 |
-
foreach ( $trs as $tr ) {
|
136 |
-
$cancel_url = array_pop( $tr );
|
137 |
-
foreach ( $ths as $position => $column ) {
|
138 |
-
$cart_info .= $column . ' ' . $tr[ $position ] . "\r\n";
|
139 |
-
$cart_info_c .= $column . ' ' . $tr[ $position ] . "\r\n";
|
140 |
-
}
|
141 |
-
$cart_info .= "\r\n";
|
142 |
-
$cart_info_c .= __( 'Cancel', 'bookly' ) . ' ' . $cancel_url . "\r\n\r\n";
|
143 |
-
}
|
144 |
-
}
|
145 |
-
}
|
146 |
-
// Codes.
|
147 |
-
$codes = array_merge( parent::getCodes( $format ), array(
|
148 |
-
'{cart_info}' => $cart_info,
|
149 |
-
'{cart_info_c}' => $cart_info_c,
|
150 |
-
) );
|
151 |
-
|
152 |
-
return $codes;
|
153 |
-
}
|
154 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/notifications/new_booking/Codes.php
DELETED
@@ -1,306 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
namespace Bookly\Lib\Notifications\NewBooking;
|
3 |
-
|
4 |
-
use Bookly\Lib\Config;
|
5 |
-
use Bookly\Lib\DataHolders\Booking as DataHolders;
|
6 |
-
use Bookly\Lib\Entities;
|
7 |
-
use Bookly\Lib\Notifications\Base;
|
8 |
-
use Bookly\Lib\Utils;
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Class Codes
|
12 |
-
* @package Bookly\Lib\Notifications\NewBooking
|
13 |
-
*/
|
14 |
-
class Codes extends Base\Codes
|
15 |
-
{
|
16 |
-
public $agenda_date;
|
17 |
-
public $amount_due;
|
18 |
-
public $amount_paid;
|
19 |
-
public $appointment_end;
|
20 |
-
public $appointment_end_info;
|
21 |
-
public $appointment_notes;
|
22 |
-
public $appointment_schedule;
|
23 |
-
public $appointment_schedule_c;
|
24 |
-
public $appointment_start;
|
25 |
-
public $appointment_start_info;
|
26 |
-
public $appointment_token;
|
27 |
-
public $appointment_waiting_list;
|
28 |
-
public $booking_number;
|
29 |
-
public $cancellation_reason;
|
30 |
-
public $cart_info;
|
31 |
-
public $category_name;
|
32 |
-
public $client_email;
|
33 |
-
public $client_address;
|
34 |
-
public $client_first_name;
|
35 |
-
public $client_last_name;
|
36 |
-
public $client_name;
|
37 |
-
public $client_phone;
|
38 |
-
public $client_timezone;
|
39 |
-
public $custom_fields;
|
40 |
-
public $custom_fields_2c;
|
41 |
-
public $deposit_value;
|
42 |
-
public $extras;
|
43 |
-
public $extras_total_price;
|
44 |
-
public $files_count;
|
45 |
-
public $google_calendar_url;
|
46 |
-
public $invoice_date;
|
47 |
-
public $invoice_due_date;
|
48 |
-
public $invoice_due_days;
|
49 |
-
public $invoice_link;
|
50 |
-
public $invoice_number; // payment_id
|
51 |
-
public $location_info;
|
52 |
-
public $location_name;
|
53 |
-
public $new_password;
|
54 |
-
public $new_username;
|
55 |
-
public $next_day_agenda;
|
56 |
-
public $next_day_agenda_extended;
|
57 |
-
public $number_of_persons;
|
58 |
-
public $package_life_time;
|
59 |
-
public $package_name;
|
60 |
-
public $package_price;
|
61 |
-
public $package_size;
|
62 |
-
public $payment_type;
|
63 |
-
public $payment_status;
|
64 |
-
public $schedule;
|
65 |
-
public $series_token;
|
66 |
-
public $service_duration;
|
67 |
-
public $service_info;
|
68 |
-
public $service_name;
|
69 |
-
public $service_price;
|
70 |
-
public $service_tax;
|
71 |
-
public $service_tax_rate;
|
72 |
-
public $site_address;
|
73 |
-
public $staff_email;
|
74 |
-
public $staff_info;
|
75 |
-
public $staff_name;
|
76 |
-
public $staff_phone;
|
77 |
-
public $staff_photo;
|
78 |
-
public $staff_rating_url;
|
79 |
-
public $total_price;
|
80 |
-
public $total_tax;
|
81 |
-
|
82 |
-
/** @var DataHolders\Order */
|
83 |
-
protected $order;
|
84 |
-
/** @var DataHolders\Item */
|
85 |
-
protected $item;
|
86 |
-
/** @var string */
|
87 |
-
protected $lang;
|
88 |
-
/** @var bool */
|
89 |
-
protected $use_client_tz;
|
90 |
-
|
91 |
-
/**
|
92 |
-
* Create new instance.
|
93 |
-
*
|
94 |
-
* @param DataHolders\Order $order
|
95 |
-
* @return static
|
96 |
-
*/
|
97 |
-
public static function create( DataHolders\Order $order )
|
98 |
-
{
|
99 |
-
$codes = new static();
|
100 |
-
|
101 |
-
$codes->order = $order;
|
102 |
-
|
103 |
-
$codes->client_address = $order->getCustomer()->getAddress();
|
104 |
-
$codes->client_email = $order->getCustomer()->getEmail();
|
105 |
-
$codes->client_first_name = $order->getCustomer()->getFirstName();
|
106 |
-
$codes->client_last_name = $order->getCustomer()->getLastName();
|
107 |
-
$codes->client_name = $order->getCustomer()->getFullName();
|
108 |
-
$codes->client_phone = $order->getCustomer()->getPhone();
|
109 |
-
if ( $order->hasPayment() ) {
|
110 |
-
$codes->amount_paid = $order->getPayment()->getPaid();
|
111 |
-
$codes->amount_due = $order->getPayment()->getTotal() - $order->getPayment()->getPaid();
|
112 |
-
$codes->total_price = $order->getPayment()->getTotal();
|
113 |
-
$codes->total_tax = $order->getPayment()->getTax();
|
114 |
-
$codes->invoice_number = $order->getPayment()->getId();
|
115 |
-
$codes->payment_status = $order->getPayment()->getStatus();
|
116 |
-
$codes->payment_type = $order->getPayment()->getType();
|
117 |
-
}
|
118 |
-
|
119 |
-
Proxy\Shared::prepareCodesForOrder( $codes );
|
120 |
-
|
121 |
-
return $codes;
|
122 |
-
}
|
123 |
-
|
124 |
-
/**
|
125 |
-
* Prepare codes for given order item.
|
126 |
-
*
|
127 |
-
* @param DataHolders\Item $item
|
128 |
-
* @param string $lang
|
129 |
-
* @param bool $use_client_tz
|
130 |
-
*/
|
131 |
-
public function prepareForItem( DataHolders\Item $item, $lang, $use_client_tz )
|
132 |
-
{
|
133 |
-
if (
|
134 |
-
$this->item === $item &&
|
135 |
-
$this->lang == $lang &&
|
136 |
-
( $this->use_client_tz == $use_client_tz || $item->getCA()->getTimeZoneOffset() === null )
|
137 |
-
) {
|
138 |
-
return;
|
139 |
-
}
|
140 |
-
|
141 |
-
$this->item = $item;
|
142 |
-
$this->lang = $lang;
|
143 |
-
$this->use_client_tz = $use_client_tz;
|
144 |
-
|
145 |
-
$staff_photo = wp_get_attachment_image_src( $item->getStaff()->getAttachmentId(), 'full' );
|
146 |
-
|
147 |
-
$this->appointment_end = $this->tz( $item->getTotalEnd()->format( 'Y-m-d H:i:s' ) );
|
148 |
-
$this->appointment_end_info = $item->getService()->getEndTimeInfo();
|
149 |
-
$this->appointment_notes = $item->getCA()->getNotes();
|
150 |
-
$this->appointment_start = $this->tz( $item->getAppointment()->getStartDate() );
|
151 |
-
$this->appointment_start_info = $item->getService()->getStartTimeInfo();
|
152 |
-
$this->appointment_token = $item->getCA()->getToken();
|
153 |
-
$this->booking_number = $item->getAppointment()->getId();
|
154 |
-
$this->category_name = $item->getService()->getTranslatedCategoryName();
|
155 |
-
$this->client_timezone = $item->getCA()->getTimeZone() ?: (
|
156 |
-
$item->getCA()->getTimeZoneOffset() !== null
|
157 |
-
? 'UTC' . Utils\DateTime::guessTimeZone( - $item->getCA()->getTimeZoneOffset() * 60 )
|
158 |
-
: ''
|
159 |
-
);
|
160 |
-
$this->number_of_persons = $item->getCA()->getNumberOfPersons();
|
161 |
-
$this->service_duration = $item->getServiceDuration();
|
162 |
-
$this->service_info = $item->getService()->getTranslatedInfo();
|
163 |
-
$this->service_name = $item->getService()->getTranslatedTitle();
|
164 |
-
$this->service_price = $item->getServicePrice();
|
165 |
-
$this->staff_email = $item->getStaff()->getEmail();
|
166 |
-
$this->staff_info = $item->getStaff()->getTranslatedInfo();
|
167 |
-
$this->staff_name = $item->getStaff()->getTranslatedName();
|
168 |
-
$this->staff_phone = $item->getStaff()->getPhone();
|
169 |
-
$this->staff_photo = $staff_photo ? $staff_photo[0] : '';
|
170 |
-
if ( ! $this->order->hasPayment() ) {
|
171 |
-
$this->total_price = $item->getTotalPrice();
|
172 |
-
$this->total_tax = $item->getTax();
|
173 |
-
if ( Config::taxesActive() && get_option( 'bookly_taxes_in_price' ) == 'excluded' ) {
|
174 |
-
$this->total_price += $this->total_tax;
|
175 |
-
}
|
176 |
-
}
|
177 |
-
|
178 |
-
Proxy\Shared::prepareCodesForItem( $this );
|
179 |
-
}
|
180 |
-
|
181 |
-
/**
|
182 |
-
* @inheritdoc
|
183 |
-
*/
|
184 |
-
protected function getReplaceCodes( $format )
|
185 |
-
{
|
186 |
-
$replace_codes = parent::getReplaceCodes( $format );
|
187 |
-
|
188 |
-
// Prepare data.
|
189 |
-
$staff_photo = '';
|
190 |
-
if ( $format == 'html' ) {
|
191 |
-
if ( $this->staff_photo != '' ) {
|
192 |
-
// Staff photo as <img> tag.
|
193 |
-
$staff_photo = sprintf(
|
194 |
-
'<img src="%s" alt="%s" />',
|
195 |
-
esc_attr( $this->staff_photo ),
|
196 |
-
esc_attr( $this->staff_name )
|
197 |
-
);
|
198 |
-
}
|
199 |
-
}
|
200 |
-
$cancel_appointment_confirm_url = get_option( 'bookly_url_cancel_confirm_page_url' );
|
201 |
-
$cancel_appointment_confirm_url = $this->appointment_token
|
202 |
-
? add_query_arg( 'bookly-appointment-token', $this->appointment_token, $cancel_appointment_confirm_url )
|
203 |
-
: '';
|
204 |
-
|
205 |
-
// Add replace codes.
|
206 |
-
$replace_codes += array(
|
207 |
-
'{agenda_date}' => $this->agenda_date ? Utils\DateTime::formatDate( $this->agenda_date ) : '',
|
208 |
-
'{amount_due}' => Utils\Price::format( $this->amount_due ),
|
209 |
-
'{amount_paid}' => Utils\Price::format( $this->amount_paid ),
|
210 |
-
'{appointment_date}' => $this->appointment_start === null ? __( 'N/A', 'bookly' ) : Utils\DateTime::formatDate( $this->appointment_start ),
|
211 |
-
'{appointment_time}' => $this->appointment_start === null ? __( 'N/A', 'bookly' ) : ( $this->service_duration < DAY_IN_SECONDS ? Utils\DateTime::formatTime( $this->appointment_start ) : $this->appointment_start_info ),
|
212 |
-
'{appointment_end_date}' => $this->appointment_start === null ? __( 'N/A', 'bookly' ) : Utils\DateTime::formatDate( $this->appointment_end ),
|
213 |
-
'{appointment_end_time}' => $this->appointment_start === null ? __( 'N/A', 'bookly' ) : ( $this->service_duration < DAY_IN_SECONDS ? Utils\DateTime::formatTime( $this->appointment_end ) : $this->appointment_end_info ),
|
214 |
-
'{appointment_notes}' => $format == 'html' ? nl2br( $this->appointment_notes ) : $this->appointment_notes,
|
215 |
-
'{approve_appointment_url}' => $this->appointment_token ? admin_url( 'admin-ajax.php?action=bookly_approve_appointment&token=' . urlencode( Utils\Common::xorEncrypt( $this->appointment_token, 'approve' ) ) ) : '',
|
216 |
-
'{booking_number}' => $this->booking_number,
|
217 |
-
'{cancel_appointment_url}' => $this->appointment_token ? admin_url( 'admin-ajax.php?action=bookly_cancel_appointment&token=' . $this->appointment_token ) : '',
|
218 |
-
'{cancel_appointment_confirm_url}' => $cancel_appointment_confirm_url,
|
219 |
-
'{category_name}' => $this->category_name,
|
220 |
-
'{client_email}' => $this->client_email,
|
221 |
-
'{client_address}' => $this->client_address,
|
222 |
-
'{client_name}' => $this->client_name,
|
223 |
-
'{client_first_name}' => $this->client_first_name,
|
224 |
-
'{client_last_name}' => $this->client_last_name,
|
225 |
-
'{client_phone}' => $this->client_phone,
|
226 |
-
'{client_timezone}' => $this->client_timezone,
|
227 |
-
'{google_calendar_url}' => sprintf( 'https://calendar.google.com/calendar/render?action=TEMPLATE&text=%s&dates=%s/%s&details=%s',
|
228 |
-
urlencode( $this->service_name ),
|
229 |
-
date( 'Ymd\THis', strtotime( $this->appointment_start ) ),
|
230 |
-
date( 'Ymd\THis', strtotime( $this->appointment_end ) ),
|
231 |
-
urlencode( sprintf( "%s\n%s", $this->service_name, $this->staff_name ) )
|
232 |
-
),
|
233 |
-
'{new_password}' => $this->new_password,
|
234 |
-
'{new_username}' => $this->new_username,
|
235 |
-
'{next_day_agenda}' => $this->next_day_agenda,
|
236 |
-
'{next_day_agenda_extended}' => $this->next_day_agenda_extended,
|
237 |
-
'{number_of_persons}' => $this->number_of_persons,
|
238 |
-
'{payment_type}' => Entities\Payment::typeToString( $this->payment_type ),
|
239 |
-
'{payment_status}' => Entities\Payment::statusToString( $this->payment_status ),
|
240 |
-
'{reject_appointment_url}' => $this->appointment_token ? admin_url( 'admin-ajax.php?action=bookly_reject_appointment&token=' . urlencode( Utils\Common::xorEncrypt( $this->appointment_token, 'reject' ) ) ) : '',
|
241 |
-
'{service_info}' => $format == 'html' ? nl2br( $this->service_info ) : $this->service_info,
|
242 |
-
'{service_name}' => $this->service_name,
|
243 |
-
'{service_price}' => Utils\Price::format( $this->service_price ),
|
244 |
-
'{service_duration}' => $this->appointment_start === null ? __( 'N/A', 'bookly' ) : Utils\DateTime::secondsToInterval( $this->service_duration ),
|
245 |
-
'{site_address}' => $this->site_address,
|
246 |
-
'{staff_email}' => $this->staff_email,
|
247 |
-
'{staff_info}' => $format == 'html' ? nl2br( $this->staff_info ) : $this->staff_info,
|
248 |
-
'{staff_name}' => $this->staff_name,
|
249 |
-
'{staff_phone}' => $this->staff_phone,
|
250 |
-
'{staff_photo}' => $staff_photo,
|
251 |
-
'{tomorrow_date}' => Utils\DateTime::formatDate( date_create( current_time( 'mysql' ) )->modify( '+1 day' )->format( 'Y-m-d' ) ),
|
252 |
-
'{total_price}' => Utils\Price::format( $this->total_price ),
|
253 |
-
'{total_tax}' => Utils\Price::format( $this->total_tax ),
|
254 |
-
'{total_price_no_tax}' => Utils\Price::format( $this->total_price - $this->total_tax ),
|
255 |
-
'{cancellation_reason}' => $this->cancellation_reason,
|
256 |
-
);
|
257 |
-
$replace_codes['{cancel_appointment}'] = $format == 'html'
|
258 |
-
? sprintf( '<a href="%1$s">%1$s</a>', $replace_codes['{cancel_appointment_url}'] )
|
259 |
-
: $replace_codes['{cancel_appointment_url}'];
|
260 |
-
|
261 |
-
return Proxy\Shared::prepareReplaceCodes( $replace_codes, $this, $format );
|
262 |
-
}
|
263 |
-
|
264 |
-
/**
|
265 |
-
* Get order.
|
266 |
-
*
|
267 |
-
* @return DataHolders\Order
|
268 |
-
*/
|
269 |
-
public function getOrder()
|
270 |
-
{
|
271 |
-
return $this->order;
|
272 |
-
}
|
273 |
-
|
274 |
-
/**
|
275 |
-
* Get item.
|
276 |
-
*
|
277 |
-
* @return DataHolders\Item
|
278 |
-
*/
|
279 |
-
public function getItem()
|
280 |
-
{
|
281 |
-
return $this->item;
|
282 |
-
}
|
283 |
-
|
284 |
-
/**
|
285 |
-
* Apply client time zone to given datetime string in WP time zone if use_client_tz is true.
|
286 |
-
*
|
287 |
-
* @param string $datetime
|
288 |
-
* @return mixed
|
289 |
-
*/
|
290 |
-
public function tz( $datetime )
|
291 |
-
{
|
292 |
-
if ( $this->use_client_tz && $datetime != '' ) {
|
293 |
-
$time_zone = $this->item->getCA()->getTimeZone();
|
294 |
-
$time_zone_offset = $this->item->getCA()->getTimeZoneOffset();
|
295 |
-
|
296 |
-
if ( $time_zone !== null ) {
|
297 |
-
$datetime = date_create( $datetime . ' ' . Config::getWPTimeZone() );
|
298 |
-
return date_format( date_timestamp_set( date_create( $time_zone ), $datetime->getTimestamp() ), 'Y-m-d H:i:s' );
|
299 |
-
} else if ( $time_zone_offset !== null ) {
|
300 |
-
return Utils\DateTime::applyTimeZoneOffset( $datetime, $time_zone_offset );
|
301 |
-
}
|
302 |
-
}
|
303 |
-
|
304 |
-
return $datetime;
|
305 |
-
}
|
306 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/notifications/new_booking/Sender.php
DELETED
@@ -1,142 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
namespace Bookly\Lib\Notifications\NewBooking;
|
3 |
-
|
4 |
-
use Bookly\Lib\DataHolders\Booking as DataHolders;
|
5 |
-
|
6 |
-
/**
|
7 |
-
* Class Sender
|
8 |
-
* @package Bookly\Lib\Notifications\NewBooking
|
9 |
-
*/
|
10 |
-
class Sender
|
11 |
-
{
|
12 |
-
/** @var DataHolders\Order */
|
13 |
-
protected $order;
|
14 |
-
/** @var ItemSenders\Base[] */
|
15 |
-
protected $item_senders;
|
16 |
-
/** @var Codes */
|
17 |
-
protected $codes;
|
18 |
-
/** @var string */
|
19 |
-
protected $initial_lang;
|
20 |
-
|
21 |
-
/**
|
22 |
-
* Create new sender for order.
|
23 |
-
*
|
24 |
-
* @param DataHolders\Order $order
|
25 |
-
* @return static
|
26 |
-
*/
|
27 |
-
public static function createForOrder( DataHolders\Order $order )
|
28 |
-
{
|
29 |
-
$sender = new static();
|
30 |
-
$sender->order = $order;
|
31 |
-
$sender->codes = Codes::create( $order );
|
32 |
-
|
33 |
-
return $sender;
|
34 |
-
}
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Send notifications.
|
38 |
-
*/
|
39 |
-
public function send()
|
40 |
-
{
|
41 |
-
foreach ( $this->order->getItems() as $item ) {
|
42 |
-
$sender = $this->getSenderForItem( $item );
|
43 |
-
if ( $sender ) {
|
44 |
-
// Notify client.
|
45 |
-
$lang = $this->wpmlSwitchToItemLang( $item );
|
46 |
-
$sender->sendToClient( $item, $lang );
|
47 |
-
// Notify staff and admins.
|
48 |
-
$lang = $this->wpmlSwitchToDefaultLang();
|
49 |
-
$sender->sendToStaffAndAdmins( $item, $lang );
|
50 |
-
}
|
51 |
-
}
|
52 |
-
$this->wpmlRestoreLang();
|
53 |
-
}
|
54 |
-
|
55 |
-
/**
|
56 |
-
* Get sender for given order item.
|
57 |
-
*
|
58 |
-
* @param DataHolders\Item $item
|
59 |
-
* @return ItemSenders\Base|null
|
60 |
-
*/
|
61 |
-
protected function getSenderForItem( DataHolders\Item $item )
|
62 |
-
{
|
63 |
-
if ( ! isset ( $this->item_senders[ $item->getType() ] ) ) {
|
64 |
-
$sender = $item->isSimple()
|
65 |
-
? ItemSenders\Simple::create( $this->order, $this->codes )
|
66 |
-
: Proxy\Shared::getSenderForItem( null, $item, $this->order, $this->codes );
|
67 |
-
$this->item_senders[ $item->getType() ] = $sender;
|
68 |
-
}
|
69 |
-
|
70 |
-
return $this->item_senders[ $item->getType() ];
|
71 |
-
}
|
72 |
-
|
73 |
-
/**
|
74 |
-
* Switch WPML lang.
|
75 |
-
*
|
76 |
-
* @param string $lang
|
77 |
-
* @return string|null
|
78 |
-
*/
|
79 |
-
protected function wpmlSwitchLang( $lang )
|
80 |
-
{
|
81 |
-
global $sitepress;
|
82 |
-
|
83 |
-
if ( $sitepress instanceof \SitePress ) {
|
84 |
-
if ( $lang != $sitepress->get_current_language() ) {
|
85 |
-
if ( $this->initial_lang === null ) {
|
86 |
-
$this->initial_lang = $sitepress->get_current_language();
|
87 |
-
}
|
88 |
-
$sitepress->switch_lang( $lang );
|
89 |
-
// WPML Multilingual CMS 3.9.2 // 2018-02
|
90 |
-
// Does not overload the date translation
|
91 |
-
$GLOBALS['wp_locale'] = new \WP_Locale();
|
92 |
-
}
|
93 |
-
|
94 |
-
return $lang;
|
95 |
-
}
|
96 |
-
|
97 |
-
return null;
|
98 |
-
}
|
99 |
-
|
100 |
-
/**
|
101 |
-
* Switch WPML to default lang.
|
102 |
-
*
|
103 |
-
* @return string|null
|
104 |
-
*/
|
105 |
-
protected function wpmlSwitchToDefaultLang()
|
106 |
-
{
|
107 |
-
global $sitepress;
|
108 |
-
|
109 |
-
if ( $sitepress instanceof \SitePress ) {
|
110 |
-
return $this->wpmlSwitchLang( $sitepress->get_default_language() );
|
111 |
-
}
|
112 |
-
|
113 |
-
return null;
|
114 |
-
}
|
115 |
-
|
116 |
-
/**
|
117 |
-
* Switch WPML to client lang of given order item.
|
118 |
-
*
|
119 |
-
* @param DataHolders\Item $item
|
120 |
-
* @return string|null
|
121 |
-
*/
|
122 |
-
protected function wpmlSwitchToItemLang( DataHolders\Item $item )
|
123 |
-
{
|
124 |
-
$lang = $item->getCA()->getLocale();
|
125 |
-
if ( $lang ) {
|
126 |
-
return $this->wpmlSwitchLang( $lang );
|
127 |
-
} else {
|
128 |
-
return $this->wpmlSwitchToDefaultLang();
|
129 |
-
}
|
130 |
-
}
|
131 |
-
|
132 |
-
/**
|
133 |
-
* Restore WPML lang.
|
134 |
-
*/
|
135 |
-
protected function wpmlRestoreLang()
|
136 |
-
{
|
137 |
-
if ( $this->initial_lang !== null ) {
|
138 |
-
$this->wpmlSwitchLang( $this->initial_lang );
|
139 |
-
$this->initial_lang = null;
|
140 |
-
}
|
141 |
-
}
|
142 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/notifications/new_booking/proxy/Shared.php
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
namespace Bookly\Lib\Notifications\NewBooking\Proxy;
|
3 |
-
|
4 |
-
use Bookly\Lib;
|
5 |
-
use Bookly\Lib\DataHolders\Booking\Item;
|
6 |
-
use Bookly\Lib\DataHolders\Booking\Order;
|
7 |
-
use Bookly\Lib\Notifications\NewBooking\Codes;
|
8 |
-
use Bookly\Lib\Notifications\NewBooking\ItemSenders;
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Class Shared
|
12 |
-
* @package Bookly\Lib\Notifications\NewBooking\Proxy
|
13 |
-
*
|
14 |
-
* @method static ItemSenders\Base getSenderForItem( $default, Item $item, Order $order, Codes $codes ) Get sender for given order item.
|
15 |
-
* @method static void prepareCodesForItem( Codes $codes ) Prepare codes data for new order item (translatable data should be set here).
|
16 |
-
* @method static void prepareCodesForOrder( Codes $codes ) Prepare codes data for order.
|
17 |
-
* @method static array prepareNotificationTitles( array $titles ) Prepare notification titles.
|
18 |
-
* @method static array prepareNotificationTypeIds( array $type_ids ) Prepare notification type IDs.
|
19 |
-
* @method static array prepareReplaceCodes( array $replace_codes, Codes $codes, $format ) Prepare codes for replacements.
|
20 |
-
* @method static Lib\Notifications\Codes prepareTestNotificationCodes( Lib\Notifications\Codes $codes ) Prepare codes for testing email templates
|
21 |
-
*/
|
22 |
-
abstract class Shared extends Lib\Base\Proxy
|
23 |
-
{
|
24 |
-
|
25 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/notifications/status_changed/StatusChanged.php
DELETED
@@ -1,58 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
namespace Bookly\Lib\Notifications\Senders;
|
3 |
-
|
4 |
-
use Bookly\Lib\Config;
|
5 |
-
use Bookly\Lib\DataHolders\Booking as DataHolders;
|
6 |
-
use Bookly\Lib\DataHolders\Notification\Settings;
|
7 |
-
use Bookly\Lib\Entities\Notification;
|
8 |
-
use Bookly\Lib\Notifications\Codes;
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Class StatusChanged
|
12 |
-
* @package Bookly\Lib\Notifications\Senders
|
13 |
-
*/
|
14 |
-
class StatusChanged extends BaseSender
|
15 |
-
{
|
16 |
-
/**
|
17 |
-
* Create new instance.
|
18 |
-
*
|
19 |
-
* @param DataHolders\Item $item
|
20 |
-
* @return static
|
21 |
-
*/
|
22 |
-
public static function create( DataHolders\Item $item )
|
23 |
-
{
|
24 |
-
$sender = new static();
|
25 |
-
$sender->order = DataHolders\Order::createFromItem( $item );
|
26 |
-
$sender->codes = Codes\Codes::createForOrder( $sender->order );
|
27 |
-
|
28 |
-
return $sender;
|
29 |
-
}
|
30 |
-
|
31 |
-
/**
|
32 |
-
* @inheritdoc
|
33 |
-
*/
|
34 |
-
protected function fetchNotifications()
|
35 |
-
{
|
36 |
-
$this->client_notifications = array();
|
37 |
-
$this->staff_notifications = array();
|
38 |
-
/** @var Notification[] $notifications */
|
39 |
-
$notifications = Notification::query()
|
40 |
-
->where( '`type`', Notification::TYPE_CUSTOMER_APPOINTMENT_STATUS_CHANGED )
|
41 |
-
->where( 'active', '1' )
|
42 |
-
->find()
|
43 |
-
;
|
44 |
-
foreach ( $notifications as $notification ) {
|
45 |
-
if ( Config::proActive() || $notification->getGateway() == 'sms' ) {
|
46 |
-
$settings = new Settings( $notification );
|
47 |
-
if ( $settings->getInstant() && ! $settings->getRepeated() ) {
|
48 |
-
if ( $notification->getToCustomer() ) {
|
49 |
-
$this->client_notifications[] = $notification;
|
50 |
-
}
|
51 |
-
if ( $notification->getToStaff() || $notification->getToAdmin() ) {
|
52 |
-
$this->staff_notifications[] = $notification;
|
53 |
-
}
|
54 |
-
}
|
55 |
-
}
|
56 |
-
}
|
57 |
-
}
|
58 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/slots/Staff.php
CHANGED
@@ -40,7 +40,9 @@ class Staff
|
|
40 |
*/
|
41 |
public function getSchedule( $location_id = 0 )
|
42 |
{
|
43 |
-
return $this->schedule[ $location_id ]
|
|
|
|
|
44 |
}
|
45 |
|
46 |
/**
|
40 |
*/
|
41 |
public function getSchedule( $location_id = 0 )
|
42 |
{
|
43 |
+
return isset ( $this->schedule[ $location_id ] )
|
44 |
+
? $this->schedule[ $location_id ]
|
45 |
+
: $this->schedule[0];
|
46 |
}
|
47 |
|
48 |
/**
|
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: 16.
|
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: 16.5
|
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
@@ -5,7 +5,7 @@ Donate link: https://www.booking-wp-plugin.com/
|
|
5 |
Requires at least: 3.7
|
6 |
Tested up to: 4.9.8
|
7 |
Requires PHP: 5.3.7
|
8 |
-
Stable tag: 16.
|
9 |
License: GPLv3
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
5 |
Requires at least: 3.7
|
6 |
Tested up to: 4.9.8
|
7 |
Requires PHP: 5.3.7
|
8 |
+
Stable tag: 16.5
|
9 |
License: GPLv3
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|