$(document).ready(function(){function e(e){try{if(e.error)throw new Error("Could not authorize user.");var a=GlobalVariables.providerData,t=GlobalVariables.appointmentData,o={summary:GlobalVariables.serviceData.name,location:GlobalVariables.companyName,start:{dateTime:moment.tz(t.start_datetime,a.timezone).format()},end:{dateTime:moment.tz(t.end_datetime,a.timezone).format()},attendees:[{email:GlobalVariables.providerData.email,displayName:GlobalVariables.providerData.first_name+" "+GlobalVariables.providerData.last_name}]};gapi.client.load("calendar","v3",function(){gapi.client.calendar.events.insert({calendarId:"primary",resource:o}).execute(function(e){if(e.error)throw new Error("Could not add the event to Google Calendar.");$("#success-frame").append($("
"),$("