!function(n){function t(a){if(e[a])return e[a].exports;var p=e[a]={i:a,l:!1,exports:{}};return n[a].call(p.exports,p,p.exports,t),p.l=!0,p.exports}var e={};t.m=n,t.c=e,t.i=function(n){return n},t.d=function(n,e,a){t.o(n,e)||Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:a})},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},t.p="",t(t.s=2)}({2:function(n,t){Appointments=window.Appointments||{},function(n,t,e){"use strict";function a(n){return e(".app-my-appointments-cancel").change(function(n){var a=e(n.target),p=this.cancelAppointment;a.is(":checked")&&swal({title:t.aysCancel,text:"",type:"warning",showCancelButton:!0,cancelButtonText:t.no,confirmButtonText:t.yes,closeOnConfirm:!0},function(n){n?p(a.data("app-id")):a.attr("checked",!1)})}.bind(this)),this}a.prototype.cancelAppointment=function(n){var a={action:"cancel_user_app",app_id:n,cancel_nonce:t.nonce};e.post(t.ajaxurl,a,function(a){var p=e("input#cancel-"+n);if(void 0===a.success)return p.attr("disabled",!0),void swal(t.connectionError,"","error");a.success?(swal(t.cancelled,"","success"),p.closest("tr").css("opacity","0.3"),p.attr("disabled",!0)):swal(a.data)},"json")},n.myAppointments=function(n){return new a(n)},e("body").on("click",".appointments-paid-button",function(){var n=e(this).data("appointment");if(!(n&&n.ID&&n.price&&n.service_name))return!1;var t={price:n.price,app_id:n.ID,service_name:n.service_name};e(".appointments-paypal").find(".app_amount").val(t.price),e(".appointments-paypal").find(".app_custom").val(t.app_id);var a=e(".appointments-paypal").find(".app_submit_btn").val();if(a){var p=a.replace("PRICE",t.price).replace("SERVICE",t.service_name);e(".appointments-paypal").find(".app_submit_btn").val(p);var i=e(".appointments-paypal").find(".app_item_name").val(),c=i.replace("SERVICE",t.service_name);e(".appointments-paypal").find(".app_item_name").val(c),e(".appointments-paypal .app_submit_btn").focus()}e(".appointments-paypal").find("form").submit()})}(Appointments,appMyAppointmentsStrings,jQuery)}}); //# sourceMappingURL=my-appointments.js.map