{"version":3,"sources":["webpack:///app-confirmation.js","webpack:///webpack/bootstrap 4ca40e6d2a915d501eed?db70*","webpack:///./_src/shortcodes/js/app-confirmation.dev.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","i","l","call","m","c","value","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","window","Appointments","shortcodes","jQuery","document","ready","$","confirmation","init","this","strings","AppShortcodeConfirmation","waitImg","waitingGif","$finalValue","$confirmationButton","$gcalEntry","selectedValue","bind","self","$body","on","preConfirmation","apply","app_cancel_location","location","href","reload","$element","css","append","app_value","find","val","pre_data","action","nonce","post","ajaxurl","response","remove","error","swal","errorTitle","show","html","service","service_location","worker","worker_location","start","end","confirmationPrice","price","askName","askEmail","askPhone","askAddress","askCity","askNote","askGCal","focus","offset","top","scrollTop","after","final_value","app_name","app_email","app_phone","app_address","app_city","app_note","app_gcal","app_warning_text","warningText","app_confirmation_text","confirmationText","app_gdpr","is","post_data","askGDPR","GDPRmissingText","hide","title","text","type","trigger","refresh","app_id","old_val","new_val","replace","service_name","old_val2","new_val2","gcal_url","open","mp","variation","connectionErrorText","gcal_same_window","app_location"],"mappings":"CAAS,SAAUA,GCInB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAI,EAAAJ,EACAK,GAAA,EACAH,WAUA,OANAJ,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,GAGAI,EAAAE,GAAA,EAGAF,EAAAD,QAvBA,GAAAD,KA4BAF,GAAAQ,EAAAT,EAGAC,EAAAS,EAAAP,EAGAF,EAAAK,EAAA,SAAAK,GAA2C,MAAAA,IAG3CV,EAAAW,EAAA,SAAAR,EAAAS,EAAAC,GACAb,EAAAc,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAb,EAA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SAAAE,SAGArB,EAAAF,UAAAmF,QAAA,sCAAAhD,OA4Ca,UAIbtC,aAAAC,WAAAK,aAAAC","file":"app-confirmation.js","sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nwindow.Appointments = window.Appointments || {};\nAppointments.shortcodes = Appointments.shortcodes || {};\n\n\njQuery( document).ready( function( $ ) {\n Appointments.shortcodes.confirmation = {\n init: function() {\n this.strings = AppShortcodeConfirmation;\n this.waitImg = \"
\";\n this.$finalValue = $('.appointments-confirmation-final-value');\n\n this.$confirmationButton = $(\".appointments-confirmation-button\");\n\n this.$gcalEntry = $(\".appointments-gcal-field-entry\");\n\n this.selectedValue = '';\n\n this.bind();\n },\n\n bind: function() {\n var self = this;\n\n var $body = $('body');\n $body.on( 'click', '.app_timetable_cell.free, .app_week_timetable_cell.free', function() {\n self.preConfirmation.apply( self, [ $(this) ] );\n } );\n\n $body.on('click', '.appointments-confirmation-cancel-button', function(){\n if ( typeof app_cancel_location === 'function' ) {\n window.location.href = app_cancel_location();\n }\n else {\n window.location.reload();\n }\n });\n\n $body.on( 'click', '.appointments-confirmation-button', function() {\n self.confirmation.apply( self, [ $(this) ] );\n });\n\n },\n\n preConfirmation: function( $element ) {\n this.selectedValue = '';\n $element\n .css( \"text-align\",\"center\" )\n .append( this.waitImg );\n\n var app_value = $element.find(\".appointments_take_appointment\").val();\n\n this.selectedValue = app_value;\n\n var pre_data = {\n action: \"pre_confirmation\",\n value: app_value,\n nonce: AppShortcodeConfirmation.nonce\n };\n\n var self = this;\n\n $.post( AppShortcodeConfirmation.ajaxurl, pre_data, function( response ) {\n $(\".wait_img\").remove();\n\n if ( response && response.error ) {\n swal(AppShortcodeConfirmation.errorTitle, response.error, 'error');\n }\n else {\n $(\".appointments-confirmation-wrapper\").show();\n $(\".appointments-confirmation-service\").html(response.service);\n /**\n * Service location\n */\n if (response.service_location){\n $(\".appointments-confirmation-service_location\").html(response.service_location).show();\n }\n if (response.worker){\n $(\".appointments-confirmation-worker\").html(response.worker).show();\n }\n /**\n * worker location\n */\n if (response.worker_location){\n $(\".appointments-confirmation-worker_location\").html(response.worker_location).show();\n }\n $(\".appointments-confirmation-start\").html(response.start);\n $(\".appointments-confirmation-end\").html(response.end);\n\n var confirmationPrice = $(\".appointments-confirmation-price\");\n confirmationPrice.html(response.price);\n if (response.price != \"0\"){\n confirmationPrice.show();\n }\n if ( self.strings.askName ){\n $(\".appointments-name-field\").show();\n }\n if ( self.strings.askEmail ){\n $(\".appointments-email-field\").show();\n }\n if ( self.strings.askPhone ){\n $(\".appointments-phone-field\").show();\n }\n if ( self.strings.askAddress ){\n $(\".appointments-address-field\").show();\n }\n if ( self.strings.askCity ){\n $(\".appointments-city-field\").show();\n }\n if ( self.strings.askNote ){\n $(\".appointments-note-field\").show();\n }\n if ( self.strings.askGCal ){\n $(\".appointments-gcal-field\").show();\n }\n\n $(\".appointments-confirmation-button\").focus();\n var offset = $(\".appointments-confirmation-wrapper\").offset();\n if (offset && \"top\" in offset && offset.top) {\n $(window).scrollTop(offset.top);\n }\n }\n },\"json\");\n\n },\n\n confirmation: function() {\n $(\".appointments-confirmation-cancel-button\").after(this.waitImg);\n\n var final_value = this.selectedValue;\n var app_name = $(\".appointments-name-field-entry\").val();\n var app_email = $(\".appointments-email-field-entry\").val();\n var app_phone = $(\".appointments-phone-field-entry\").val();\n var app_address = $(\".appointments-address-field-entry\").val();\n var app_city = $(\".appointments-city-field-entry\").val();\n var app_note = $(\".appointments-note-field-entry\").val();\n var app_gcal = \"\";\n var app_warning_text = AppShortcodeConfirmation.warningText;\n var app_confirmation_text = AppShortcodeConfirmation.confirmationText;\n var app_gdpr = $('.appointments-gdpr-confirmation input[type=checkbox]');\n\n var self = this;\n\n if ( this.$gcalEntry.is( \":checked\" ) ) {\n app_gcal = 1;\n }\n\n var post_data = {\n action: \"post_confirmation\",\n value: final_value,\n app_name: app_name,\n app_email: app_email,\n app_phone: app_phone,\n app_address: app_address,\n app_city: app_city,\n app_note: app_note,\n app_gcal: app_gcal,\n app_gdpr: app_gdpr.is(':checked'),\n nonce: AppShortcodeConfirmation.nonce\n };\n\n if ( AppShortcodeConfirmation.askName ) {\n if ($(\".appointments-name-field-entry\").val() == \"\") {\n swal(AppShortcodeConfirmation.errorTitle, app_warning_text, 'error' );\n $(\".appointments-name-field-entry\").focus();\n $(\".wait_img\").remove();\n return false;\n }\n }\n if ( AppShortcodeConfirmation.askEmail ) {\n if ($(\".appointments-email-field-entry\").val() == \"\") {\n swal(AppShortcodeConfirmation.errorTitle, app_warning_text, 'error' );\n $(\".appointments-email-field-entry\").focus();\n $(\".wait_img\").remove();\n return false;\n }\n }\n if ( AppShortcodeConfirmation.askPhone ) {\n if ($(\".appointments-phone-field-entry\").val() == \"\") {\n swal(AppShortcodeConfirmation.errorTitle, app_warning_text, 'error' );\n $(\".appointments-phone-field-entry\").focus();\n $(\".wait_img\").remove();\n return false;\n }\n }\n if ( AppShortcodeConfirmation.askAddress ) {\n if ($(\".appointments-address-field-entry\").val() == \"\") {\n swal(AppShortcodeConfirmation.errorTitle, app_warning_text, 'error' );\n $(\".appointments-address-field-entry\").focus();\n $(\".wait_img\").remove();\n return false;\n }\n }\n if ( AppShortcodeConfirmation.askCity ) {\n if ($(\".appointments-city-field-entry\").val() == \"\") {\n swal(AppShortcodeConfirmation.errorTitle, app_warning_text, 'error' );\n $(\".appointments-city-field-entry\").focus();\n $(\".wait_img\").remove();\n return false;\n }\n }\n if ( AppShortcodeConfirmation.askGDPR && ! app_gdpr.is(':checked')) {\n swal(AppShortcodeConfirmation.errorTitle, AppShortcodeConfirmation.GDPRmissingText, 'error' );\n app_gdpr.focus();\n $(\".wait_img\").remove();\n return false;\n }\n\n $.post(AppShortcodeConfirmation.ajaxurl, post_data, function(response) {\n $(\".wait_img\").hide();\n if ( response && response.error ) {\n swal({\n title:AppShortcodeConfirmation.errorTitle,\n text: response.error,\n type: 'error'\n }, function() {\n $(document).trigger(\"app-confirmation-response_received\", [response]);\n });\n }\n else if ( response && ( response.refresh==\"1\" || response.price==0 ) ) {\n swal({\n title: app_confirmation_text,\n type: 'success'\n }, function() {\n if ( response.gcal_url != \"\" ) {\n if ( response.gcal_same_window ) {\n window.open(response.gcal_url,\"_self\");\n }\n else {\n window.open(response.gcal_url,\"_blank\");\n if ( typeof app_location === 'function' ) {\n window.location.href=app_location();\n }\n else {\n window.location.reload();\n }\n }\n }\n else {\n if ( typeof app_location === 'function' ) {\n window.location.href=app_location();\n }\n else {\n window.location.reload();\n }\n }\n $(document).trigger(\"app-confirmation-response_received\", [response]);\n });\n\n\n }\n else if ( response ) {\n $(\".appointments-paypal\").find(\".app_amount\").val(response.price);\n $(\".appointments-paypal\").find(\".app_custom\").val(response.app_id);\n var old_val = $(\".appointments-paypal\").find(\".app_submit_btn\").val();\n if ( old_val ) {\n var new_val = old_val.replace(\"PRICE\",response.price).replace(\"SERVICE\",response.service_name);\n $(\".appointments-paypal\").find(\".app_submit_btn\").val(new_val);\n var old_val2 = $(\".appointments-paypal\").find(\".app_item_name\").val();\n var new_val2 = old_val2.replace(\"SERVICE\",response.service_name);\n $(\".appointments-paypal\").find(\".app_item_name\").val(new_val2);\n $(\".appointments-paypal .app_submit_btn\").focus();\n }\n if ( response.gcal_url != \"\" ) {\n window.open(response.gcal_url,\"_blank\");\n }\n if ( response.mp == 1 ) {\n $(\".mp_buy_form\")\n .find(\"[name='variation']\").remove().end()\n .append(\"\")\n ;\n $(\".mp_buy_form input[name='variation']\").val(response.variation);\n $(\".mp_buy_form\").show();\n }\n else {\n $(\".appointments-paypal\").show();\n }\n $(document).trigger(\"app-confirmation-response_received\", [response]);\n }\n else{\n swal({\n title:AppShortcodeConfirmation.errorTitle,\n text: self.strings.connectionErrorText,\n type: 'error'\n }, function() {\n $(document).trigger(\"app-confirmation-response_received\", [response]);\n });\n\n }\n\n },\"json\");\n }\n };\n\n Appointments.shortcodes.confirmation.init();\n});\n\n\n/***/ })\n/******/ ]);\n\n\n// WEBPACK FOOTER //\n// app-confirmation.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 4ca40e6d2a915d501eed","\"use strict\";\n\nwindow.Appointments = window.Appointments || {};\nAppointments.shortcodes = Appointments.shortcodes || {};\n\n\njQuery( document).ready( function( $ ) {\n Appointments.shortcodes.confirmation = {\n init: function() {\n this.strings = AppShortcodeConfirmation;\n this.waitImg = \"
\";\n this.$finalValue = $('.appointments-confirmation-final-value');\n\n this.$confirmationButton = $(\".appointments-confirmation-button\");\n\n this.$gcalEntry = $(\".appointments-gcal-field-entry\");\n\n this.selectedValue = '';\n\n this.bind();\n },\n\n bind: function() {\n var self = this;\n\n var $body = $('body');\n $body.on( 'click', '.app_timetable_cell.free, .app_week_timetable_cell.free', function() {\n self.preConfirmation.apply( self, [ $(this) ] );\n } );\n\n $body.on('click', '.appointments-confirmation-cancel-button', function(){\n if ( typeof app_cancel_location === 'function' ) {\n window.location.href = app_cancel_location();\n }\n else {\n window.location.reload();\n }\n });\n\n $body.on( 'click', '.appointments-confirmation-button', function() {\n self.confirmation.apply( self, [ $(this) ] );\n });\n\n },\n\n preConfirmation: function( $element ) {\n this.selectedValue = '';\n $element\n .css( \"text-align\",\"center\" )\n .append( this.waitImg );\n\n var app_value = $element.find(\".appointments_take_appointment\").val();\n\n this.selectedValue = app_value;\n\n var pre_data = {\n action: \"pre_confirmation\",\n value: app_value,\n nonce: AppShortcodeConfirmation.nonce\n };\n\n var self = this;\n\n $.post( AppShortcodeConfirmation.ajaxurl, pre_data, function( response ) {\n $(\".wait_img\").remove();\n\n if ( response && response.error ) {\n swal(AppShortcodeConfirmation.errorTitle, response.error, 'error');\n }\n else {\n $(\".appointments-confirmation-wrapper\").show();\n $(\".appointments-confirmation-service\").html(response.service);\n /**\n * Service location\n */\n if (response.service_location){\n $(\".appointments-confirmation-service_location\").html(response.service_location).show();\n }\n if (response.worker){\n $(\".appointments-confirmation-worker\").html(response.worker).show();\n }\n /**\n * worker location\n */\n if (response.worker_location){\n $(\".appointments-confirmation-worker_location\").html(response.worker_location).show();\n }\n $(\".appointments-confirmation-start\").html(response.start);\n $(\".appointments-confirmation-end\").html(response.end);\n\n var confirmationPrice = $(\".appointments-confirmation-price\");\n confirmationPrice.html(response.price);\n if (response.price != \"0\"){\n confirmationPrice.show();\n }\n if ( self.strings.askName ){\n $(\".appointments-name-field\").show();\n }\n if ( self.strings.askEmail ){\n $(\".appointments-email-field\").show();\n }\n if ( self.strings.askPhone ){\n $(\".appointments-phone-field\").show();\n }\n if ( self.strings.askAddress ){\n $(\".appointments-address-field\").show();\n }\n if ( self.strings.askCity ){\n $(\".appointments-city-field\").show();\n }\n if ( self.strings.askNote ){\n $(\".appointments-note-field\").show();\n }\n if ( self.strings.askGCal ){\n $(\".appointments-gcal-field\").show();\n }\n\n $(\".appointments-confirmation-button\").focus();\n var offset = $(\".appointments-confirmation-wrapper\").offset();\n if (offset && \"top\" in offset && offset.top) {\n $(window).scrollTop(offset.top);\n }\n }\n },\"json\");\n\n },\n\n confirmation: function() {\n $(\".appointments-confirmation-cancel-button\").after(this.waitImg);\n\n var final_value = this.selectedValue;\n var app_name = $(\".appointments-name-field-entry\").val();\n var app_email = $(\".appointments-email-field-entry\").val();\n var app_phone = $(\".appointments-phone-field-entry\").val();\n var app_address = $(\".appointments-address-field-entry\").val();\n var app_city = $(\".appointments-city-field-entry\").val();\n var app_note = $(\".appointments-note-field-entry\").val();\n var app_gcal = \"\";\n var app_warning_text = AppShortcodeConfirmation.warningText;\n var app_confirmation_text = AppShortcodeConfirmation.confirmationText;\n var app_gdpr = $('.appointments-gdpr-confirmation input[type=checkbox]');\n\n var self = this;\n\n if ( this.$gcalEntry.is( \":checked\" ) ) {\n app_gcal = 1;\n }\n\n var post_data = {\n action: \"post_confirmation\",\n value: final_value,\n app_name: app_name,\n app_email: app_email,\n app_phone: app_phone,\n app_address: app_address,\n app_city: app_city,\n app_note: app_note,\n app_gcal: app_gcal,\n app_gdpr: app_gdpr.is(':checked'),\n nonce: AppShortcodeConfirmation.nonce\n };\n\n if ( AppShortcodeConfirmation.askName ) {\n if ($(\".appointments-name-field-entry\").val() == \"\") {\n swal(AppShortcodeConfirmation.errorTitle, app_warning_text, 'error' );\n $(\".appointments-name-field-entry\").focus();\n $(\".wait_img\").remove();\n return false;\n }\n }\n if ( AppShortcodeConfirmation.askEmail ) {\n if ($(\".appointments-email-field-entry\").val() == \"\") {\n swal(AppShortcodeConfirmation.errorTitle, app_warning_text, 'error' );\n $(\".appointments-email-field-entry\").focus();\n $(\".wait_img\").remove();\n return false;\n }\n }\n if ( AppShortcodeConfirmation.askPhone ) {\n if ($(\".appointments-phone-field-entry\").val() == \"\") {\n swal(AppShortcodeConfirmation.errorTitle, app_warning_text, 'error' );\n $(\".appointments-phone-field-entry\").focus();\n $(\".wait_img\").remove();\n return false;\n }\n }\n if ( AppShortcodeConfirmation.askAddress ) {\n if ($(\".appointments-address-field-entry\").val() == \"\") {\n swal(AppShortcodeConfirmation.errorTitle, app_warning_text, 'error' );\n $(\".appointments-address-field-entry\").focus();\n $(\".wait_img\").remove();\n return false;\n }\n }\n if ( AppShortcodeConfirmation.askCity ) {\n if ($(\".appointments-city-field-entry\").val() == \"\") {\n swal(AppShortcodeConfirmation.errorTitle, app_warning_text, 'error' );\n $(\".appointments-city-field-entry\").focus();\n $(\".wait_img\").remove();\n return false;\n }\n }\n if ( AppShortcodeConfirmation.askGDPR && ! app_gdpr.is(':checked')) {\n swal(AppShortcodeConfirmation.errorTitle, AppShortcodeConfirmation.GDPRmissingText, 'error' );\n app_gdpr.focus();\n $(\".wait_img\").remove();\n return false;\n }\n\n $.post(AppShortcodeConfirmation.ajaxurl, post_data, function(response) {\n $(\".wait_img\").hide();\n if ( response && response.error ) {\n swal({\n title:AppShortcodeConfirmation.errorTitle,\n text: response.error,\n type: 'error'\n }, function() {\n $(document).trigger(\"app-confirmation-response_received\", [response]);\n });\n }\n else if ( response && ( response.refresh==\"1\" || response.price==0 ) ) {\n swal({\n title: app_confirmation_text,\n type: 'success'\n }, function() {\n if ( response.gcal_url != \"\" ) {\n if ( response.gcal_same_window ) {\n window.open(response.gcal_url,\"_self\");\n }\n else {\n window.open(response.gcal_url,\"_blank\");\n if ( typeof app_location === 'function' ) {\n window.location.href=app_location();\n }\n else {\n window.location.reload();\n }\n }\n }\n else {\n if ( typeof app_location === 'function' ) {\n window.location.href=app_location();\n }\n else {\n window.location.reload();\n }\n }\n $(document).trigger(\"app-confirmation-response_received\", [response]);\n });\n\n\n }\n else if ( response ) {\n $(\".appointments-paypal\").find(\".app_amount\").val(response.price);\n $(\".appointments-paypal\").find(\".app_custom\").val(response.app_id);\n var old_val = $(\".appointments-paypal\").find(\".app_submit_btn\").val();\n if ( old_val ) {\n var new_val = old_val.replace(\"PRICE\",response.price).replace(\"SERVICE\",response.service_name);\n $(\".appointments-paypal\").find(\".app_submit_btn\").val(new_val);\n var old_val2 = $(\".appointments-paypal\").find(\".app_item_name\").val();\n var new_val2 = old_val2.replace(\"SERVICE\",response.service_name);\n $(\".appointments-paypal\").find(\".app_item_name\").val(new_val2);\n $(\".appointments-paypal .app_submit_btn\").focus();\n }\n if ( response.gcal_url != \"\" ) {\n window.open(response.gcal_url,\"_blank\");\n }\n if ( response.mp == 1 ) {\n $(\".mp_buy_form\")\n .find(\"[name='variation']\").remove().end()\n .append(\"\")\n ;\n $(\".mp_buy_form input[name='variation']\").val(response.variation);\n $(\".mp_buy_form\").show();\n }\n else {\n $(\".appointments-paypal\").show();\n }\n $(document).trigger(\"app-confirmation-response_received\", [response]);\n }\n else{\n swal({\n title:AppShortcodeConfirmation.errorTitle,\n text: self.strings.connectionErrorText,\n type: 'error'\n }, function() {\n $(document).trigger(\"app-confirmation-response_received\", [response]);\n });\n\n }\n\n },\"json\");\n }\n };\n\n Appointments.shortcodes.confirmation.init();\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./_src/shortcodes/js/app-confirmation.dev.js\n// module id = 0\n// module chunks = 2"],"sourceRoot":""}