(()=>{"use strict";window.jQuery(document).ready(function(s){var c=wp.i18n.__;function d(e,o){var r=e.getBoundingClientRect();setTimeout(function(){var t=s("body").scrollTop();o.dpDiv.css({top:r.top+e.offsetHeight+t})},0)}function t(){s(".tutor_zoom_datepicker").datepicker({dateFormat:_tutorobject.wp_date_format}),s(".tutor_zoom_timepicker").timepicker({timeFormat:"hh:mm TT",beforeShow:function(t,e){d(t,e)}})}t(),window.addEventListener(_tutorobject.content_change_event,t),s(document).on("click",".update_zoom_meeting_modal_btn",function(t){t.preventDefault();var e,a=s(this),i=a.closest(".tutor-modal"),o=(i.find("[data-name]").each(function(){s(this).attr("name",s(this).attr("data-name"))}),i.find(":input").serializeObject());for(e in o.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone,i.find("[data-name]").removeAttr("name"),o)if("timezone"!==o[e]&&!o[e])return void tutor_toast(c("Warning!"),c("Please fill all the fields","tutor-pro"),"warning");s.ajax({url:window._tutorobject.ajaxurl,type:"POST",data:o,beforeSend:function(){a.attr("disabled","disabled").addClass("is-loading")},success:function(t){var e=t||{},e=(e.success,e.data),e=void 0===e?{}:e,o=e.selector,r=e.replace_selector,n=e.course_contents,e=e.editor_modal_html;t.success?(console.log(t),tutor_toast(c("Success","tutor-pro"),c("Meeting Updated","tutor-pro"),"success"),n?("course-builder"==o?(r?s(r).replaceWith(n):a.closest(".tutor-topics-body").find(".tutor-lessons").append(n),enable_sorting_topic_lesson()):s(t.data.selector).html(t.data.course_contents),e&&i.replaceWith(e),s(".tutor_zoom_timepicker").timepicker({timeFormat:"hh:mm TT",beforeShow:function(t,e){d(t,e)}}),s(".tutor_zoom_datepicker").datepicker({dateFormat:_tutorobject.wp_date_format,minDate:0}),i.removeClass("tutor-is-active"),s("body").removeClass("tutor-modal-open"),window.dispatchEvent(new Event(_tutorobject.content_change_event))):window.location.reload()):tutor_toast("Error!",((t,e)=>{var o=wp.i18n["__"],{data:t={}}=t||{},{message:t=e||o("Something Went Wrong!","tutor")}=t;return t})(t),"error")},complete:function(){a.removeAttr("disabled").removeClass("is-loading")}})})})})();