!function(){var e={68379:function(e){!function(t,a){const n={allowDownload:!1,title:"",init:function(){ThriveAppFront.certificate?(this.allowDownload=1===Number(ThriveAppFront.certificate.allow_download),this.title=String(ThriveAppFront.certificate.title)):ThriveAppFront.wizard&&(this.allowDownload=!0),tve_frontend_options.is_editor_page||this.frontendInit()},frontendInit:function(e){this.$root=e||a.$document,this.$certificates=this.$root.find('a.tve-dynamic-link[data-shortcode-id="download_certificate"]'),this.allowDownload?this.$certificates.off("click").on("click",{},this.downloadCertificate.bind(this)):this.$certificates.remove()},downloadCertificate:function(e){e&&e.preventDefault();const a=this.title,n=this.$certificates,o=t("body");n.addClass("tar-disabled tve-loading"),t.ajax({url:`${ThriveAppFront.routes.certificate}/download`,type:"POST",cache:!1,data:{course_id:ThriveAppFront.course.ID},beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",ThriveAppFront.nonce)},xhr:function(){const e=new XMLHttpRequest;return e.onreadystatechange=()=>{2===e.readyState&&(e.responseType=200===e.status?"blob":"text")},e},success:function(e){const r=new Blob([e],{type:"application/octetstream"}),i=window.URL||window.webkitURL,s=t("<a />").attr({href:i.createObjectURL(r),download:`${a}.pdf`});o.append(s),s[0].click(),o.remove(s),n.removeClass("tar-disabled tve-loading")},error:function(e){n.removeClass("tar-disabled tve-loading");const t="object"==typeof e.responseJSON&&e.responseJSON.message?e.responseJSON.message:e.statusText,a=e.status&&401===e.status?"warning":"error";TCB_Front.notificationElement.toggle(t,a)}})}};e.exports=()=>n.init()}(ThriveGlobal.$j,TCB_Front)},52724:function(e){var t;(t=jQuery).fn.extend({tva_collapse:function(e){return this.each((function(){var a=t(this),n=a.parent();a.addClass(e.class_collapsed),a.removeClass(e.class_expanded),!1===a.hasClass("tva_chapter_headline")?(n.find(".tve-chapters-wrapper").slideUp(),0===n.find(".tve-chapters-wrapper").length&&n.find(".tve-lessons-wrapper").slideUp()):a.hasClass("tva_chapter_headline")&&n.find(".tve-lessons-wrapper").slideUp()}))},tva_expand:function(e){return this.each((function(){var a=t(this),n=a.parent();a.removeClass(e.class_collapsed),a.addClass(e.class_expanded),!1===a.hasClass("tva_chapter_headline")?(n.find(".tve-chapters-wrapper").slideDown(),0===n.find(".tve-chapters-wrapper").length&&n.find(".tve-lessons-wrapper").slideDown()):a.hasClass("tva_chapter_headline")&&n.find(".tve-lessons-wrapper").slideDown()}))}}),e.exports=function(e){var a=t.extend({class_expanded:"tva-expanded",class_collapsed:"tva-collapsed",collapse_modules:!1,collapse_chapters:!1},e);return this.each((function(){var e=t(this);e.find(".tva-cm-module .tva-module-header")[a.collapse_modules?"tva_collapse":"tva_expand"](a),e.find("h2.tva_chapter_headline")[a.collapse_chapters?"tva_collapse":"tva_expand"](a),e.find(".tva-cm-module .tva-module-header, h2.tva_chapter_headline").off("click").on("click",(function(e){var n=t(this);"a"!==e.target.tagName.toLowerCase()&&(n.hasClass(a.class_collapsed)?n.tva_expand (a):n.tva_collapse(a))}))}))}},86661:function(e){var t,a;t=ThriveGlobal.$j,a=TCB_Front,e.exports={isCompleted:0,allowMarkComplete:!0,nextLessonUrl:"",init:function(){this.isCompleted=parseInt(ThriveAppFront.is_completed),this.nextLessonUrl=ThriveAppFront.next_lesson_url,this.nextLessonText=ThriveAppFront.next_lesson_text,void 0!==ThriveAppFront.allow_mark_complete&&(this.allowMarkComplete=1===parseInt(ThriveAppFront.allow_mark_complete)),tve_frontend_options.is_editor_page||(this.frontendInit(),this.allowMarkComplete||(t(TCB_Front).on("tqb_shortcode_response",((e,a)=>{this.allowMarkComplete=a&&void 0!==a.tva_allow_mark_as_complete&&1===parseInt(a.tva_allow_mark_as_complete),this.allowMarkComplete&&t(".tva-disabled-mark-as-complete").removeClass("tva-disabled-mark-as-complete")})),TCB_Front.Hooks.addAction("tcb.video.on_end",(e=>{null!==e&&void 0!==e.allowMarkComplete&&0!==parseInt(e.allowMarkComplete)&&(this.allowMarkComplete=!0,t(".tva-disabled-mark-as-complete").removeClass("tva-disabled-mark-as-complete"))})),TCB_Front.Hooks.addAction("tcb.video.after_save_range",(e=>{e.allowMarkComplete&&(this.allowMarkComplete=!0,t(".tva-disabled-mark-as-complete").removeClass("tva-disabled-mark-as-complete"))}))))},frontendInit:function(e){this.$root=e||a.$document,this.$root.on("tve-dash.load",(()=>{TVE_Dash.add_load_item("ta_access_post",{post_id:ThriveAppFront.post_id},null)})),"tva_lesson"===ThriveAppFront.lesson.post_type&&(this.$root.find('span[data-shortcode="tva_dynamic_actions_mark_as_complete_text"][data-attr-go_next_lesson="0"],span[data-shortcode="tva_dynamic_actions_mark_as_complete_next_text"][data-attr-go_next_lesson="0"],a.tve-dynamic-link[data-shortcode-id="mark_as_complete"]').on("click",{},this.markLessonEventCallback.bind(this)),this.$root.find('span[data-shortcode="tva_dynamic_actions_mark_as_complete_next_text"][data-attr-go_next_lesson="1"],span[data-shortcode="tva_dynamic_actions_mark_as_complete_text"][data-attr-go_next_lesson="1"],a.tve-dynamic-link[data-shortcode-id="mark_as_complete_next"]').on("click",{},this.markLessonAndGoNextEventCallback.bind(this)),this.$root.on("unwrapBlockLinks",(()=>{this.$root.find('.thrv_wrapper[data-shortcode-id="mark_as_complete_next"]').on("click",{},this.markLessonAndGoNextEventCallback.bind(this)),this.$root.find('.thrv_wrapper[data-shortcode-id="mark_as_complete"]').on("click",{},this.markLessonEventCallback.bind(this))})))},markLessonEventCallback:function(e){e.preventDefault(),this.allowMarkComplete?this.isCompleted?this.goToNextLesson(e.currentTarget):this.markLesson().then():TCB_Front.notificationElement.toggle(ThriveAppFront.deny_mark_complete_toast,"warning")},markLessonAndGoNextEventCallback:function(e){if(e.preventDefault(),this.allowMarkComplete){const a=t(e.currentTarget).closest(".thrv_wrapper.thrv-button");if(a.length&&0===parseInt(a.attr("data-next")))return this.isCompleted?this.goToNextLesson(e.currentTarget):(a.find("a").attr("href","javascript:void(0)"),this.markLesson().then((()=>{t(e.currentTarget).attr({href:this.nextLessonUrl})})));this.markLessonAndGoToNext(e.currentTarget)}else TCB_Front.notificationElement.toggle(ThriveAppFront.deny_mark_complete_toast,"warning")},markLesson:function(){return new Promise((e=>{if(this.isCompleted)return this.updateMarkLessonCompleteAndNext(),void e();this.isCompleted=!0,wp.apiRequest({type:"POST",data:{lesson_id:parseInt(ThriveAppFront.lesson_page),completed:1},url:ThriveAppFront.routes.frontend+"/mark_lesson/"}).success((t=>{t.message&&TCB_Front.Utils.toast(t.message),t.progress_bar&&this.updateOldProgressBar(t.progress_bar),t.lessons_list&&this.updateOldLessonList(t.lessons_list),t.next_lesson_url&&(this.nextLessonUrl=t.next_lesson_url),t.next_lesson_text&&(this.nextLessonText=t.next_lesson_text),this.updateMarkLessonCompleteAndNext(),e(t)}))}))},updateOldProgressBar:function(e){this.$root.find(".tva-progress-container").html(e)},updateOldLessonList:function(e){this.$root.find(".tva-lessons-container").html(e)},markLessonAndGoToNext:function(e){this.markLesson(e).then((()=>this.goToNextLesson(e)))},updateMarkLessonCompleteAndNext:function(){this.$root.find('[data-shortcode="tva_dynamic_actions_mark_as_complete_next_text"]').each(((e,a)=>{if(1===parseInt(a.getAttribute("data-attr-link"))){const e=a.querySelector("a");e.textContent=this.nextLessonText,e.href=this.nextLessonUrl,t(a).unbind()}else a.textContent=this.nextLessonText})),this.$root.find('[data-shortcode="tva_dynamic_actions_mark_as_complete_text"]').each(((e,t)=>{t.closest(".thrv_text_element")&&(t.style.display="none")}))},goToNextLesson:function(e){"A"===e.tagName&&"_blank"===e.target||"DIV"===e.tagName&&"_blank"===e.getAttribute("data-target")?window.open(this.nextLessonUrl,"_blank","noopener"):top.location.href=this.nextLessonUrl}}},54920:function(e){!function(t,a){const n={init:function(){t(window).on("tcb_after_dom_ready",(()=>{this.afterDomReady()}))},afterDomReady:function(){const e=a.queryString.get("tva-show-message");e&&ThriveAppFront.frontend_warnings[e]&&a.notificationElement.toggle(ThriveAppFront.frontend_warnings[e],"warning")}};e.exports=()=>n.init()}(ThriveGlobal.$j,TCB_Front)},71027:function(e){e.exports={tvaRemoveParam:function(e,t){let a=t.split("?")[0];return this.tvaUrlParamExists("page_id",window.location.href)?(a=a+"?page_id="+this.tvaGetParameterByName("page_id",window.location.href),a):a},tvaUrlParamExists:function(e,t){const a=e+"=";return-1!==t.indexOf("?"+a)||-1!==t.indexOf("&"+a)},tvaGetParameterByName:function(e,t){t||(t=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");const a=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);return a?a[2]?decodeURIComponent(a[2].replace(/\+/g," ")):"":null}}},81151:function(e){var t;t=jQuery,e.exports=function(e){var a=t.extend({class_expanded:"tva-expanded",class_collapsed:"tva-collapsed",slide_time:200,module_tag:"h2",chapter_tag:"h3",current_post_id:null},e);function n(e){var t;return function(e){return e.is(a.module_tag)}(e)?(t=".tva-chapter-lessons",t+=0===e.parent().find("> .tva-chapter-lessons").length?", .tva-lessons-wrapper":""):function(e){return e.is(a.chapter_tag)}(e)&&(t=".tva-lessons-wrapper"),t}function o(){var e=t(this),o=n(e);e.parent().find(o).slideDown(a.slide_time),this.classList.remove(a.class_collapsed),this.classList.add(a.class_expanded)}function r(){var e=t(this),o=n(e),r=e.parent();e.addClass(a.class_collapsed),e.removeClass(a.class_expanded),r.find(o).slideUp(a.slide_time)}return this.each((function(){var e=t(this),n=e.parent().find('.tva-lesson-container[data-id="'+a.current_post_id+'"]');try{a.current_post_id===parseInt(e.data("id"))||n.length>0?o.apply(this):r.apply(this)}catch(e){console.log(e)}e.off("click").on("click",(function(e){if("a"!==e.target.tagName.toLowerCase()){var n=t(this);try{n.hasClass(a.class_collapsed)?o.apply(this):r.apply(this)}catch(e){console.log(e)}}}))}))}}},t={};function a(n){var o=t[n];if(void 0!==o)return o.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,a),r.exports}!function(){const e=window.ThriveAppFront||{},t=window.ThriveAppWidgets||{},n=a(71027);!function(o){window.TCB_Front&&(TCB_Front.apprenticeDynamicActions=a(86661),TCB_Front.apprenticeDynamicActions.init(),a(68379)(),tve_frontend_options.is_editor_page||a(54920)());const r=o(document);o.fn.extend({tva_collapsible:a(52724),tva_widget_collapsible:a(81151)}),o(".tva-header .tva-inner-header").children().length>1&&o(".tva-header .tva-inner-header div").last().addClass("tva-dropdownmenu"),o(".tva-header > div > ul li").on("mouseenter",(function(){if(o("ul",this).length){const e=o("ul:first",this);e.offset().left+e.width()<=o(".tva-header").width()||(o(this).parent().addClass("edge"),o(this).find("ul").addClass("edge"))}})),o(".tva-header > div").click((function(){o(this).toggleClass("visible")})),o("#ta-registration-form").on("submit",(function(){o(this).find('input[name="tva_captcha"]').remove()}));const i=function(t){if("tva_lesson"!==e.lesson.post_type||1===parseInt(e.visual_editing_enabled))return;const a={lesson_id:e.lesson_page,completed:!1};t&&(a.completed=!0),o.ajax({headers:{"X-WP-Nonce":e.nonce},type:"POST",data:a,url:e.routes.frontend+"/mark_lesson/"})};if(!e.is_inner_frame&&!e.wizard){let p;e.course.ID&&e.allowed&&!e.is_admin&&o.ajax({headers:{"X-WP-Nonce":e.nonce},type:"POST",data:{course_id:e.course.ID},url:e.routes.frontend+"/process_conversion/"}),e.lesson_page&&e.allowed&&i(),o(".tva-finish-lesson").on("click",(function(e){i(!0)})),o(".tva-filter-checkbox-container").on("click",(function(e){e.preventDefault();const t=o(this).find(".tva-filter-course-clear-filters"),a=o(".tva-filters-wrapper"),r=o(".tva-search-wrapper"),i=o(this).find(".tva-filter").is(":checked");if(o(this).find(".tva-filter").prop("checked",!i),t.length>0&&(a.find(".tva-filter-checkbox-container").each((function(){o(this).children("div:first").removeClass("tva-filter-checkbox-selected")})),a.find(".tva-filter").each((function(){o(this).prop("checked",!1)})),r.find(".tva-search-input").val("")),p=s,o(c=this).find(".tva-filter").is(":checked")?o(c).children("div:first").addClass("tva-filter-checkbox-selected"):o(c).children("div:first").removeClass("tva-filter-checkbox-selected"),"function"==typeof p&&p(),t.length>0){let e="";e=n.tvaUrlParamExists("page_id",window.location.href)?"?page_id="+n.tvaGetParameterByName("page_id",window.location.href):n.tvaRemoveParam("filters",window.location.href),window.history.pushState({},document.title,e)}var c,p}));const l=document.getElementById("tva_front_search");let d=null;function s(t){const a="tva-loading",n=o(".tva-courses-container");if(!0===n.hasClass(a))return;const r=o(".tva-filter-checkbox-container input:checkbox:checked").map((function(){return o(this).val()})).get();p=o(".tva-search-input").val(),n.addClass(a),n.append('<div class="tva-front-loader tva-spinner-css tva-spinner-scope"><div class="tva-spinner-rolling"><div></div></div></div>'),n.find(".tva-course-card").remove(),o.ajax({headers:{"X-WP-Nonce":e.nonce},type:"POST",url:e.routes.frontend+"/filters/",data:{s:p,terms:r,page:t,is_index_page:e.index_page}}).done((function(t){n.removeClass(a),n.empty().append(t),e.index_page&&n.find(".tva-course-description").addClass("scrollbar-macosx").scrollbar(),o("html, body").animate({scrollTop:0},400),o(".ttw-uni-page-numbers").on("click",(function(){s(o(this).attr("data-tva-page-nr"))})),c()}))}function c(){let e="";e=!0===o(".tva-filters-container").find(".tva-filter").is(":checked")?"inline-block":"none",o(".tva-clear-filters").css("display",e)}l&&(l.onkeyup=function(){const e=this;d&&clearTimeout(d),d=setTimeout((function(){p!==e.value&&s()}),300)},r.on("click",".tva-search-submit",(function(){s()}))),r.on("click","a.tva-page-numbers",(function(){s(o(this).attr("data-tva-page-nr"))})),c()}if(1==e.tva_register_page){let u,m;jQuery('input[type="password"]').on("change",(function(){u=jQuery("input[name='user_pass']").val(),m=jQuery("input[name='confirm_pass']").val()})),jQuery("#tva-register-button").on("click",(function(e){var t;!0!==(t=jQuery("input[name=user_email]").val(),/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t))&&(e.preventDefault(),jQuery(".tva-password-mismatch").fadeIn("slow"),jQuery(".tva-invalid-email").fadeIn("slow")),jQuery('input[name="user_pass"], input[name="user_login"]').each((function(){""===jQuery(this).val()&&(e.preventDefault(),setTimeout((function(){jQuery(".tva-required-filed").fadeOut("slow"),jQuery(".tva-invalid-email").fadeOut("slow")}),5e3)),u!==m&&(jQuery(".tva-invalid-password").fadeIn("slow"),e.preventDefault())})),void 0===u&&o('input[name="user_pass"]').parent().next("p").fadeIn("slow"),void 0===m&&(o('input[name="confirm_pass"]').parent().next("p").fadeIn("slow"),o("#tva-register-button").addClass("tva-btn-margin-top"))})),jQuery('input[name="user_pass"], input[name="confirm_pass"]').on("focusin",(function(){jQuery(".tva-invalid-password").fadeOut("slow")})),jQuery('#ta-registration-form input[type=email], input[name="user_pass"], input[name="confirm_pass').on("focusin",(function(){jQuery(".tva-required-filed").fadeOut("slow"),jQuery(".tva-invalid-email").fadeOut("slow")})),jQuery("#ta-registration-form input[type=email]").on("focusout",(function(){const t={email:jQuery(this).val()};jQuery.ajax({type:"POST",url:e.routes.frontend+"/check_email/",data:t}).done((function(e){!0===e&&(jQuery("#tva-email-error-wrapper").fadeIn("slow"),setTimeout((function(){jQuery("#tva-email-error-wrapper").fadeOut("slow")}),5e3)),jQuery("#tva-register-button").prop("disabled",e)}))}))}if(jQuery(".tva-register-url").on("click",(function(){document.cookie="tva_lesson_to_redirect="+window.location.href+"; path=/"})),("open"===e.course.comment_status||"open"===e.lesson.comment_status)&&!0!==e.has_comment_plugin){o(document).ready((function(){f.tvaGetGuestData(o(".tva-comments-form"));const t=Object.keys(e.lesson).length>0?e.lesson.ID:e.course_ref_post_id;o.ajax({headers:{"X-WP-Nonce":e.nonce},type:"POST",url:e.routes.frontend+"/comments/",data:{comment_data:{comment_post_ID:t,comment_term_ID:t===e.course_ref_post_id?e.course.ID:""}}}).done((function(e){f.comment_count=e.comment_count,f.all_comments=e.comments,f.user_can_manage_comments=e.approve,f.renderCommentsList()}))})),o("#tva-comments-list").on("click",".tva-reply-button",(function(t){o(".tva-comment-form").each((function(e,a){o(a).parent().attr("data-comment-id")!==o(t.currentTarget).parent().attr("data-comment-id")&&o(a).slideUp("slow")})),o(this).parent(".tva-single-comment").find(".tva-comment-form").slideToggle(),!1===e.is_user_logged_in&&f.tvaGetGuestData(o(this))})),o(".tva-frontend-template").on("click","#tva-submit-comment",(function(){const t=o(this),a=f.tvaValidateComment(t);!1!==a&&o.ajax({headers:{"X-WP-Nonce":e.nonce},type:"POST",url:e.routes.frontend+"/create_comment/",data:{comment_data:a}}).done((function(e){o("#tva-comments-list").html(""),o(t).parent(".tva-comments-form").find(".tva-comment-content").val(""),f.childs="",f.html="",f.comment_count=e.comment_count,f.renderCommentListHeader(),_.each(e.comments,(function(e){f.html+='<div class="tva-comment-holder">',f.renderComment(e),f.html+="</div>"})),o("#tva-comments-list").html(f.html)})).fail((function(e){o(t).parent().find(".tva-error-message").remove(),f.tvaShowError(e.status,t)}))}));const f={comment_count:0,all_comments:[],childs:"",html:"",user_can_manage_comments:!1,renderComment:function(t){if(this.html+='<div class="tva-single-comment" data-comment-id="'+t.comment_ID+'">',this.html+='<div class="tva-comment-author">'+t.comment_author+"</div>",1!==parseInt(t.comment_approved)){const t=!0===this.user_can_manage_comments?e.t.This:e.t.Your;this.html+='<div class="tva-comment-approval">',this.html+=t+" "+e.t.Moderation,this.html+="</div>"}if(this.html+='<p class="tva-comment">'+t.comment_content.replace(/(?:\r\n|\r|\n)/g,"<br>")+"</p>",this.tvaCommentReplyForm(),this.html+="</div>",null!==t.children&&t.children.length>0){this.childs=t.children,this.html+='<div class="tva-children-list">';const e=this;_.each(this.childs,(function(t){e.renderComment(t)})),this.html+="</div>"}},tvaValidateComment:function(e){e.parent().find(".tva-error-message").remove();const t=this.tvaPrepareCommentData(e);return""===t.comment_content?this.tvaShowError("invalid_comment_content",e):""===t.comment_author?this.tvaShowError("invalid_comment_author",e):""===t.comment_author_email?this.tvaShowError("missing_author_email",e):!1===/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t.comment_author_email)?this.tvaShowError("invalid_author_email",e):""!==t.comment_author_url&&!1===/(http(s)?:\/\/.)(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g.test(t.comment_author_url)?this.tvaShowError("invalid_url",e):t},renderCommentListHeader:function(){this.html+='<div class="tva-comments-number">',1===f.comment_count?this.html+="<p>"+e.t.SingleComment+"</p>":f.comment_count>1&&(this.html+="<p>"+this.comment_count+" "+e.t.MultipleComments+"</p>"),this.html+="</div>"},renderCommentsList:function(){const e=this;this.renderCommentListHeader(),this.html+="</div>",_.each(this.all_comments,(function(t){e.html+='<div class="tva-comment-holder">',e.renderComment(t),e.html+="</div>"})),o("#tva-comments-list").append(this.html)},tvaCommentReplyForm:function(){this.html+='<button class="tva-reply-button">'+e.t.Reply+"</button>",this.html+='<div class="tva-comment-form">',this.html+='<textarea class="tva-comment-content"></textarea>',e.current_user.ID||(this.html+='<div class="tva-guest-fileds">',this.html+='<p class="tva-guest">'+e.t.Guest+"</p>",this.html+="<span>"+e.t.GuestName+"</span>",this.html+='<input type="text" class="tva-comment-input" name="name">',this.html+="<span>"+e.t.GuestEmail+"</span>",this.html+='<input type="text" class="tva-comment-input" name="email">',this.html+="<span>"+e.t.GuestUrl+"</span>",this.html+='<input type="text" class="tva-comment-input" name="url">',this.html+="</div>"),this.html+='<button id="tva-submit-comment" >'+e.t.SubmitComment+"</button>",this.html+="</div>"},tvaPrepareCommentData:function(t){const a=t.parent().parent().attr("data-comment-id"),n=Object.keys(e.lesson).length>0?e.lesson.ID:e.course_ref_post_id,o=1===parseInt(e.is_user_logged_in),r=o?e.current_user.display_name:t.parent().find('input[name="name"]').val(),i=o?e.current_user.user_email:t.parent().find('input[name="email"]').val(),s=o?e.current_user.user_url:t.parent().find('input[name="url"]').val(),c={comment_post_ID:n,comment_content:t.parent().find(".tva-comment-content").val(),comment_parent:void 0!==a?a:0,comment_author:r,comment_author_email:i,comment_author_url:s,user_id:e.current_user.ID?e.current_user.ID:"",comment_type:""};return c.comment_term_ID=0===Object.keys(e.lesson).length?e.course.ID:"",c},tvaShowError:function(t,a){let n="";switch(t){case 409:return n='<div class="tva-error-message">'+e.t.DuplicateComment+"</div>",a.parent().append(n),!1;case 429:return n='<div class="tva-error-message">'+e.t.CommentToFast+"</div>",a.parent().append(n),!1;case"invalid_comment_content":return n='<div class="tva-error-message">'+e.t.EmptyComment+"</div>",a.parent().find(".tva-comment-content").after(n),!1;case"invalid_comment_author":return n='<div class="tva-error-message">'+e.t.EmptyName+"</div>",a.parent().find('input[name="name"]').after(n),!1;case"missing_author_email":return n='<div class="tva-error-message">'+e.t.EmptyEmail+"</div>",a.parent().find('input[name="email"]').after(n),!1;case"invalid_author_email":return n='<div class="tva-error-message">'+e.t.InvalidEmail+"</div>",a.parent().find('input[name="email"]').after(n),!1;case"invalid_url":return n='<div class="tva-error-message">'+e.t.InvalidUrl+"</div>",a.parent().find('input[name="url"]').after(n),!1;default:return!0}},tvaGetGuestData:function(t){if(!0!==e.is_user_logged_in){const e=decodeURIComponent(this.tvaGetCookieData("tva_cookie_user_name")).slice(1,-1),a=decodeURIComponent(this.tvaGetCookieData("tva_cookie_user_email")).slice(1,-1),n=decodeURIComponent(this.tvaGetCookieData("tva_cookie_user_url")).slice(1,-1);t.parent().find('input[name="name"]').val(e),t.parent().find('input[name="email"]').val(a),t.parent().find('input[name="url"]').val(n.replace(/\\\//g,"/"))}},tvaGetCookieData:function(e){const t=e+"=",a=document.cookie.split(";");for(let e=0;e<a.length;e++){let n=a[e];for(;" "===n.charAt(0);)n=n.substring(1);if(0===n.indexOf(t))return n.substring(t.length,n.length)}return""}}}o(".tva-cm-lesson").on("mousedown",(function(){o(this).addClass("tva-lesson-pressed")})),o(".tva-cm-lesson").on("mouseup",(function(){o(this).removeClass("tva-lesson-pressed")})),o(document).ready((function(){if(o(".tva-cm-container").tva_collapsible(e.template),t.config){const x=Object.keys(t.config);o.each(x,(function(a,n){!function(t,a){let n=[];const r="#"+t;(a.modules||a.chapters)&&(a.modules&&n.push("h2"),a.chapters&&n.push("h3.tva-chapter-title"),n=r+" "+n.join(", "+r+" "),o(n).tva_widget_collapsible({current_post_id:parseInt(e.lesson_page)||null}))}(n,t.config[n])}))}const a=o(".tva-course-description");if(e.index_page&&a.addClass("scrollbar-macosx").scrollbar(),"undefined"!=typeof tve_frontend_options&&!tve_frontend_options.is_editor_page){const k=n("pp");if(parseInt(e.is_checkout)&&parseInt(e.is_user_logged_in)&&k&&"sendowl"===k.toLowerCase()&&(n("pid")||n("bid"))){const C=[];C.push({name:"payment_processor",value:n("pp")}),C.push({name:"bid",value:n("bid")}),C.push({name:"pid",value:n("pid")}),C.push({name:"thrv_so_discount",value:n("thrv_so_discount")}),o.ajax({headers:{"X-WP-Nonce":e.nonce},type:"POST",data:C,url:e.routes.user+"/process_redirect/"}).done((function(e){e.message&&TCB_Front.Utils.toast(e.message,!1),e.redirect&&(document.location.href=e.redirect)})).fail((function(e){TCB_Front.Utils.toast(e.responseJSON.message,!0)}))}function n(e){const t=new RegExp("[?&]"+e+"=([^&#]*)").exec(window.location.search);return null!==t&&(t[1]||0)}ThriveGlobal.$j(".thrv-checkout").each((function(){o(this).find('[data-type="password"] input').attr("type","password");const t=["forgot_password","reset_confirmation"],a="tcb-form-error";function r(e,a){e.find(".thrv-button-group").toggleClass("tcb-permanently-hidden",_.contains(t,a))}const i=o(this),s=i.find("form");i.find(".thrv-button-group").off("click.thrv-button-group-item").on("click.thrv-button-group-item",".thrv-button-group-item",(function(e){e.stopPropagation(),e.preventDefault();const t=ThriveGlobal.$j(this),a=t.closest(".thrv-checkout");a.find(".tcb-active-state").removeClass("tcb-active-state"),a.find(".tcb-tva-checkout-form-wrapper").addClass("tcb-permanently-hidden"),t.addClass("tcb-active-state"),a.find('.tcb-tva-checkout-form-wrapper[data-instance="'+t.attr("data-instance")+'"]').removeClass("tcb-permanently-hidden")})),s.off("submit").on("submit",(function(t){t.stopPropagation(),t.preventDefault();const s=i.find('input[name="config"]').val();if(!s)return!1;const c=ThriveGlobal.$j(this),p=c.closest("form"),l=c.serializeArray(),d={};let u="";if(o.map(l,(function(e){d[e.name]=e.value})),_.some(d,(function(e,t){return 0===e.length?(u="empty_fields",!0):"email"!==t||tve_is_email(e)?"confirm_password"===t&&e!==d.password?(u="passwords_not_match",!0):void 0:(u="email",!0)})),u.length>0){const e=TCB_Front.Utils.unserialize(TCB_Front.Base64.decode(s)),t=document.createElement("span");return t.classList.add(a),t.innerText=e.error_messages[u],"empty_fields"===u?p.find('input[type="text"], input[type="email"], input[type="password"]').not("."+a).filter((function(){return!this.value})).addClass(a).after(t):"email"===u?p.find('input[type="email"]').not("."+a).addClass(a).after(t):"passwords_not_match"===u&&p.find('input[type="password"]').not("."+a).addClass(a).after(t),!1}const m=c.closest(".thrv-checkout"),f=c.find("button");f.attr("disabled","disabled"),l.push({name:"payment_processor",value:n("pp")}),l.push({name:"bid",value:n("bid")}),l.push({name:"pid",value:n("pid")}),l.push({name:"thrv_so_discount",value:n("thrv_so_discount")});const h=function(e){let t="";return t="register"===e?"tva_register":e,t}(c.attr("data-route"));o.ajax({headers:{"X-WP-Nonce":e.nonce},type:"POST",data:l,url:e.routes.user+"/"+h+"/"}).fail((function(e){if(_.contains(["existing_user_email","existing_user_login"],e.responseJSON.code)){const e=TCB_Front.Utils.unserialize(TCB_Front.Base64.decode(s)),t=document.createElement("span");t.classList.add(a);let n=e.error_messages.existing_user_email;n=n.replace(/\[a\]/g,'<a href="javascript:void(0)" class="tva-switch-instance-link" data-go_to_instance="login">'),n=n.replace(/\[\/a\]/g,"</a>"),jQuery(t).html(n),p.find('input[type="email"]').not("."+a).addClass(a).after(t)}else TCB_Front.Utils.toast(e.responseJSON.message,!0)})).done((function(e){e.message&&TCB_Front.Utils.toast(e.message,!1),e.state&&(m.find(".tcb-tva-checkout-form-wrapper").addClass("tcb-permanently-hidden"),m.find('.tcb-tva-checkout-form-wrapper[data-instance="'+e.state+'"]').removeClass("tcb-permanently-hidden"),r(m,e.state)),e.redirect&&(document.location.href=e.redirect)})).always((function(){f.removeAttr("disabled")}))})),s.find(['input[type="text"]','input[type="email"]','input[type="password"]'].join(",")).on("input",(function(e){const t=e.currentTarget;t.classList.contains(a)&&(t.nextSibling.remove(),t.classList.remove(a))})).on("focus",(function(){this.placeholder=""})).on("blur",(function(){this.placeholder=this.getAttribute("data-placeholder")})),i.off("click.tva-switch-instance-link").on("click.tva-switch-instance-link",".tva-switch-instance-link",(function(e){e.stopPropagation(),e.preventDefault();const t=ThriveGlobal.$j(this),a=t.closest(".thrv-checkout"),n=t.attr("data-go_to_instance");a.find(".tcb-tva-checkout-form-wrapper").addClass("tcb-permanently-hidden"),a.find('.tcb-tva-checkout-form-wrapper[data-instance="'+n+'"]').removeClass("tcb-permanently-hidden"),"login"===n&&(a.find(".tcb-active-state").removeClass("tcb-active-state"),a.find('.thrv-button-group-item[data-instance="'+n+'"]').addClass("tcb-active-state")),r(a,n)})),i.find('.thrv-button-group-item[data-default="true"]').click()}))}function r(e){const t=o('a.tcb-button-link.tcb-plain-text.tve-dynamic-link[data-dynamic-link="tva_dynamic_actions_link"]');t.addClass("tva-custom-disabled"),t.css("cssText","background-color: #CDD3D8 !important"),t.find(".tcb-button-icon").find(".thrv_icon").css("cssText","background-color: #ffffff !important"),o(".tva-custom-toast").remove();const a=`\n\t\t\t\t<div class="tva-custom-toast" id="tva-stripe-toast">\n\t\t\t\t\t${e}\n\t\t\t\t</div>\n\t\t\t`,n=t.closest(".thrv_wrapper.thrv-columns");o(a).insertAfter(n),o(".tva-custom-toast").fadeIn(300)}function i(e){return e&&"string"==typeof e?e.replace(/every_two_weeks/gi,"Every two weeks"):e}function s(e){if(!e||"string"!=typeof e)return[];const t=[],a=e.match(/Body:\s*(\{[\s\S]*\})/);if(a)try{const e=JSON.parse(a[1]);e&&Array.isArray(e.errors)&&e.errors.forEach((function(e){e.detail?t.push("Error: "+e.detail):e.code&&t.push("Error: "+e.code.replace(/_/g," ").toLowerCase())}))}catch(e){}const n=e.match(/Expected [^\n]+/i);return n&&t.push("Error: "+n[0]),t}function c(e){return e&&"string"==typeof e?e.replace(/[&<>"']/g,(function(e){switch(e){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";case"'":return"&#39;";default:return e}})):""}async function p(t){try{const a=await async function(t){return new Promise(((a,n)=>{o.ajax({type:"POST",url:e.routes.square+"/item_info",headers:{"X-WP-Nonce":e.nonce},data:{item_id:t.squareItemId||"",mode:t.squareItemMode||"live"},success:function(e){a(e)},error:function(){n(new Error("Failed to get item information"))}})}))}(t);if(!a.success)throw new Error("Failed to get item information");!function(e,t){var a;const n=e.isSubscription?"Subscribe to":"Purchase",r=e.isSubscription?"&#x1F504;":"&#x1F4B3;",s=(null===(a=t.item)||void 0===a||a.cadence,i(t.item.price.formatted||""));let c=n+" "+t.item.name+" - "+(s||t.item.price.formatted),p=r+" "+n+" "+t.item.name+" - "+(s||t.item.price.formatted);t.item.freeTrial&&t.item.freeTrial.enabled&&(c+=" ("+t.item.freeTrial.description+")",p=r+" Start "+t.item.freeTrial.description+" - Then "+t.item.price.formatted),o("#tva-square-modal-title").text(c),o("#tva-square-payment-btn").html(p);const l=e.squareItemMode||"",d=[l?{live:"Production",test:"Sandbox"}[l]||l:"",e.merchantName||e.merchantId||""].filter(Boolean).join(" | ");if(d){const e=o("#tva-square-modal-meta");e.length?e.text(d):o("#tva-square-modal-title").after('<p id="tva-square-modal-meta" style="margin: 8px 0 0 0; font-size: 13px; opacity: 0.85;">'+d+"</p>")}else o("#tva-square-modal-meta").remove()}(t,a);const n=await async function(e){const t=e.squareItemAppId||"",a=e.squareItemLocationId||"";try{const e=window.Square.payments(t,a),n=await e.card();return await n.attach("#tva-square-card-container"),n}catch(e){if(e.message&&e.message.includes("secure context"))throw new Error("Square live payments require HTTPS. Please use a secure connection or switch to test mode.");throw e}}(t);!function(t,a,n){1===t.prepopulate&&t.prepopulateEmail&&o("#tva-square-email").val(t.prepopulateEmail),o("#tva-square-loading").hide(),o("#tva-square-payment-form").show(),o("#tva-square-payment-btn").off("click").on("click",(async function(r){r.preventDefault(),await async function(t,a,n){try{const r=function(){const e={firstName:o("#tva-square-firstName").val().trim(),lastName:o("#tva-square-lastName").val().trim(),email:o("#tva-square-email").val().trim(),phone:o("#tva-square-phone").val().trim()};return e.phone&&!e.phone.startsWith("+")&&(e.phone="+1"+e.phone.replace(/\D/g,"")),e}();!function(e){if(!(e.firstName&&e.lastName&&e.email&&e.phone))throw new Error("Please fill in all required fields")}(r),function(e,t){const a=o("#tva-square-payment-btn"),n=e.isSubscription?"Processing Subscription...":"Processing Payment...";a.prop("disabled",!0).html(n)}(n);const i=await async function(e,t,a,n){const o=function(e,t,a){const n={billingContact:{givenName:e.firstName,familyName:e.lastName,email:e.email,phone:e.phone,countryCode:a.countryCode||"US"},customerInitiated:!0,sellerKeyedIn:!1};if(a.isSubscription)n.intent="STORE";else{const e=(t.item.price.amount/100).toFixed(2);n.amount=e,n.currencyCode=t.item.price.currency||a.currencyCode||"USD",n.intent="CHARGE"}return n}(t,a,n),r=await e.tokenize(o);if("OK"!==r.status)throw new Error("Tokenization failed: "+r.status);return r}(t,r,a,n);await async function(t,a,n){return new Promise(((r,i)=>{o.ajax({type:"POST",url:e.routes.square+"/payment",headers:{"X-WP-Nonce":e.nonce},data:{sourceId:t,customerData:a,productData:n,idempotencyKey:"tva-"+Date.now()+"-"+Math.random().toString(36).substr(2,9),mode:n.squareItemMode||"live"},success:function(t){t.success?(function(t,a){if(r='<div class="tva-square-success">',(n=t).subscription||n.payment&&n.payment.subscription?r+="<h3>&#x2713; Subscription Created Successfully!</h3>":r+="<h3>&#x2713; Payment Successful!</h3>",o("#tva-square-payment-status").html(r).show(),o("#tva-square-payment-form").hide(),t){const n=function(e,t){const a={product_id:t.productId,onetime:!t.isSubscription,mode:t.squareItemMode||"live"};var n,o,r;return t.isSubscription?a.order_id=null==e||null===(n=e.payment)||void 0===n||null===(o=n.subscription)||void 0===o?void 0:o.id:a.order_id=null==e||null===(r=e.payment)||void 0===r?void 0:r.orderId,a}(t,a);n.order_id&&function(t){o.ajax({type:"GET",url:e.routes.square+"/get-redirect",data:t,success:function(e){e.url&&(window.location.href=e.url)},error:function(){console.error("Redirect endpoint failed, but payment was successful")}})}(n)}var n,r}(t.data,n),r(t)):i(new Error(t.message||"Payment failed"))},error:function(e){i(e||new Error("Payment request failed"))}})}))}(i.token,r,n)}catch(e){!function(e,t,a){console.error("Payment error:",e),l(e);const n=function(e,t){const a=e.isSubscription?"Subscribe to":"Purchase",n=e.isSubscription?"&#x1F504;":"&#x1F4B3;",o=i(t.item.price.formatted||"");let r=n+" "+a+" "+t.item.name+" - "+(o||t.item.price.formatted);return t.item.freeTrial&&t.item.freeTrial.enabled&&(r=n+" Start "+t.item.freeTrial.description+" - Then "+(o||t.item.price.formatted)),r}(t,a);o("#tva-square-payment-btn").prop("disabled",!1).html(n)}(e,n,a)}}(n,a,t)}))}(t,a,n)}catch(e){console.error("Square setup error:",e),l("Failed to initialize payment form. Please try again.")}}function l(e){const t=c(function(e,t){const a="An unexpected error occurred. Please try again.";if(!e)return a;const n=[],o=[];if("string"==typeof e?(n.push(e),o.push.apply(o,s(e))):(e instanceof Error&&e.message||e.message)&&(n.push(e.message),o.push.apply(o,s(e.message))),e.responseJSON&&(e.responseJSON.message&&(n.push(e.responseJSON.message),o.push.apply(o,s(e.responseJSON.message))),Array.isArray(e.responseJSON.errors)&&e.responseJSON.errors.forEach((function(e){e.detail&&n.push(e.detail),e.field&&n.push(e.field),e.code&&!e.detail&&n.push(e.code),e.detail?o.push("Error: "+e.detail):e.code&&o.push("Error: "+e.code.replace(/_/g," ").toLowerCase())}))),e.responseText&&"string"==typeof e.responseText&&(n.push(e.responseText),o.push.apply(o,s(e.responseText))),e.statusText&&n.push(e.statusText),!n.length)try{n.push(JSON.stringify(e))}catch(e){n.push(a)}const r=n.join("\n").replace(/\\n/g,"\n").replace(/\r\n/g,"\n").split("\n").map((function(e){return e.trim()})).filter(Boolean),i=o.length?o:r,c=[];return i.forEach((function(e){e&&-1===c.indexOf(e)&&c.push(e)})),c.length?c[0]:a}(e)).replace(/\n/g,"<br>");o("#tva-square-payment-status").html(`<div class="tva-square-error"><h3>&#x2717; Payment Failed</h3><p>${t}</p><p style="font-size: 14px; margin-top: 10px;">Please try again or contact support.</p></div>`).show()}const d=[".ppcp-overlay{position:fixed;inset:0;z-index:999999;background:rgba(0,0,0,.55);display:flex;align-items:center;justify-content:center;padding:24px 16px;opacity:0;transition:opacity .2s ease;box-sizing:border-box}",".ppcp-overlay.ppcp-show{opacity:1}",".ppcp-overlay *,.ppcp-overlay *::before,.ppcp-overlay *::after{box-sizing:border-box}",'.ppcp-popup{width:410px;max-width:100%;max-height:90vh;overflow-y:auto;background:#fff;border-radius:12px;box-shadow:0 8px 28px rgba(0,0,0,.25);font-family:-apple-system,BlinkMacSystemFont,"Helvetica Neue",Arial,sans-serif;line-height:1.4;transform:scale(.96);transition:transform .2s ease;position:relative;color:#111;text-align:left}',".ppcp-popup,.ppcp-popup *{line-height:1.4}",".ppcp-popup p{padding:0}",".ppcp-show .ppcp-popup{transform:scale(1)}",".ppcp-close{position:absolute;top:12px;right:12px;width:28px;height:28px;border:none;background:transparent;border-radius:50%;cursor:pointer;font-size:20px;line-height:1;color:#767676;padding:0}",".ppcp-close:hover{background:#F1F1F1;color:#111}",".ppcp-body{padding:24px 28px 18px}",".ppcp-logo{text-align:center;margin-bottom:16px}",".ppcp-logo svg{height:32px;width:auto;display:inline-block;vertical-align:middle}",".ppcp-merchant{display:flex;align-items:center;gap:10px;padding-bottom:14px;border-bottom:1px solid #EEE;margin-bottom:14px}",".ppcp-merchant-info{flex:1;min-width:0}",".ppcp-merchant-name{display:block;font-size:14px;font-weight:600;color:#111}",".ppcp-merchant-sub{display:block;font-size:12px;color:#767676}",".ppcp-total{font-size:18px;font-weight:600;color:#111}",".ppcp-summary{border:1px solid #EEE;border-radius:8px;margin-bottom:16px}",".ppcp-summary-head{display:flex;align-items:center;justify-content:space-between;padding:11px 14px;cursor:pointer;font-size:13px;font-weight:600;color:#111}",".ppcp-chev{border:solid #767676;border-width:0 2px 2px 0;display:inline-block;padding:3px;transform:rotate(-135deg);transition:transform .15s;margin-top:4px}",".ppcp-summary.ppcp-collapsed .ppcp-chev{transform:rotate(45deg);margin-top:-2px}",".ppcp-summary-detail{padding:0 14px 12px}",".ppcp-summary.ppcp-collapsed .ppcp-summary-detail{display:none}",".ppcp-paylater-msg{margin:0 0 16px;padding:10px 14px;background:#F5FAFE;border:1px solid #E6EEF6;border-radius:8px}",".ppcp-paylater-msg:empty{display:none;margin:0;padding:0;border:0}",".ppcp-line{display:flex;justify-content:space-between;font-size:13px;color:#444;padding:3px 0;gap:12px}",".ppcp-line-total{font-weight:600;color:#111;border-top:1px solid #EEE;margin-top:6px;padding-top:8px}",".ppcp-paywith{font-size:13px;font-weight:600;color:#111;margin:0 0 8px}",".ppcp-row{display:flex;align-items:center;gap:12px;padding:13px 14px;border:1px solid #DEDEDE;border-radius:8px;cursor:pointer;background:#fff;margin-bottom:10px}",".ppcp-row:hover{border-color:#0070BA}",".ppcp-row.ppcp-sel{border:2px solid #0070BA;padding:12px 13px;background:#F5FAFE}",".ppcp-row-card.ppcp-sel{border-radius:8px 8px 0 0;margin-bottom:0}",".ppcp-dot{width:18px;height:18px;border-radius:50%;border:2px solid #C4C4C4;flex:none;position:relative}",".ppcp-sel .ppcp-dot{border-color:#0070BA}",'.ppcp-sel .ppcp-dot::after{content:"";position:absolute;inset:3px;border-radius:50%;background:#0070BA}',".ppcp-row-icon{width:28px;text-align:center;font-size:17px;flex:none}",".ppcp-row-meta{flex:1}",".ppcp-row-title{display:block;font-size:14px;color:#111}",".ppcp-row-desc{display:block;font-size:12px;color:#767676}",".ppcp-wallet-zone{margin-bottom:10px}",".ppcp-googlepay-zone{margin-bottom:10px}",".ppcp-googlepay-zone .gpay-card-info-container,.ppcp-googlepay-zone .gpay-card-info-animation-container,.ppcp-googlepay-zone>div{width:100%!important}",".ppcp-applepay-zone{margin-bottom:10px}",".ppcp-applepay-zone apple-pay-button{display:block;width:100%;--apple-pay-button-width:100%;--apple-pay-button-height:40px;cursor:pointer}",".ppcp-card-form{border:1px solid #DEDEDE;border-top:none;border-radius:0 0 8px 8px;padding:16px 14px 14px;margin-bottom:10px;background:#FBFBFB}",".tva-paypal-checkout__card-fields{margin-bottom:10px}",".ppcp-field{margin-bottom:12px}",".ppcp-field label{display:block;font-size:12px;font-weight:600;color:#444;margin-bottom:5px}",".ppcp-field input{width:100%;background:#fff;border:1px solid #C9C9C9;border-radius:6px;padding:11px 12px;font-size:14px;color:#111;outline:none}",".ppcp-field input:focus{border-color:#0070BA;box-shadow:0 0 0 1px #0070BA}",".ppcp-hint{font-size:11px;color:#767676;margin-top:4px}",".ppcp-hosted-field{overflow:hidden}",".ppcp-hosted-field > div{width:100% !important}",".ppcp-hosted-field > div > iframe{width:100% !important}",".ppcp-pair{display:flex;gap:12px}",".ppcp-pair .ppcp-field{flex:1;margin-bottom:0}",".ppcp-vault{display:flex;align-items:flex-start;gap:9px;font-size:12px;color:#444;margin:14px 0 16px;cursor:pointer}",".ppcp-vault input{width:16px;height:16px;margin:1px 0 0;accent-color:#0070BA;flex:none}",".ppcp-pay{width:100%;background:#0070BA;color:#fff;border:none;border-radius:999px;padding:13px;font-size:15px;font-weight:600;cursor:pointer}",".ppcp-pay:hover{background:#005EA6}",".ppcp-pay:disabled{opacity:.7;cursor:not-allowed}",".ppcp-error{color:#c0392b;font-size:13px;margin-top:12px}",".ppcp-cancel{text-align:center;margin:12px 0 0}",".ppcp-cancel a{font-size:13px;color:#0070BA;text-decoration:none}",".ppcp-cancel a:hover{text-decoration:underline}",".ppcp-footer{border-top:1px solid #EEE;padding:10px 28px;display:flex;align-items:center;justify-content:space-between;background:#FAFAFA;font-size:11px;color:#767676;border-radius:0 0 12px 12px}",".tva-paypal-checkout__success{text-align:center;padding:28px 8px;font-size:15px;font-weight:600;color:#111}",'iframe[name^="__detect_close__"]{pointer-events:none !important;}'].join("\n");function u(e){const t=document.getElementById("tva-paypal-payment-modal");if(!t)return;t.querySelectorAll(".ppcp-row").forEach((function(t){const a=t.getAttribute("data-method")===e;t.classList.toggle("ppcp-sel",a),t.setAttribute("aria-pressed",a?"true":"false")}));const a=document.getElementById("tva-paypal-card-fields");a&&(a.style.display="card"===e?"":"none")}function m(){return new Promise((function(e,t){const a=function(){return window.google&&window.google.payments&&window.google.payments.api};if(a())return void e();const n=document.getElementById("tva-googlepay-sdk");if(n)return"error"===n.getAttribute("data-tva-loaded")?void t(new Error("Failed to load Google Pay.")):(n.addEventListener("load",(function(){e()})),n.addEventListener("error",(function(){t(new Error("Failed to load Google Pay."))})),void(a()&&e()));const o=document.createElement("script");o.id="tva-googlepay-sdk",o.src="https://pay.google.com/gp/p/js/pay.js",o.onload=function(){o.setAttribute("data-tva-loaded","ok"),e()},o.onerror=function(){o.setAttribute("data-tva-loaded","error"),t(new Error("Failed to load Google Pay."))},document.head.appendChild(o)}))}function f(e,t){const a=document.getElementById("tva-paypal-error");a&&(a.textContent=e,a.style.display=""),h(!1),console.log("[Thrive Apprentice PayPal]",e,t||"")}function h(e){const t=document.getElementById("tva-paypal-card-submit");t&&(e?(t.dataset.label=t.dataset.label||t.textContent,t.textContent="Processing…"):t.dataset.label&&(t.textContent=t.dataset.label),t.disabled=e,t.style.opacity=e?"0.7":"",t.style.cursor=e?"not-allowed":"pointer")}function v(e){if(void 0===window.paypal)return void f("PayPal is unavailable. Please try again.");e.payLater&&setTimeout((function(){const t=document.getElementById("tva-paypal-paylater-msg");t&&w(e.clientId,e.currency,(function(){const a=window.tvaPayPalMessages;if(a&&"function"==typeof a.Messages)try{a.Messages({amount:parseFloat(e.amount),placement:"product",style:{layout:"text"}}).render(t)}catch(e){}}))}),150);let t=0;const a=document.getElementById("tva-paypal-error");function n(){a&&(a.textContent="",a.style.display="none")}function o(t,a){return fetch(t,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":e.nonce},body:JSON.stringify(a)}).then((function(e){return e.text().then((function(t){let a=null;try{a=t?JSON.parse(t):null}catch(e){a=null}if(!e.ok)throw new Error(a&&a.message?a.message:"Request failed ("+e.status+").");if(null===a)throw new Error("Unexpected server response.");return a}))}))}function r(){const t=document.getElementById("tva-paypal-email"),a=(t&&t.value?t.value.trim():"")||e.payerEmail||"";if(!a){const e=document.getElementById("tva-paypal-email-error");e&&(e.textContent="Please enter your email address to continue.",e.style.display=""),t&&(t.style.borderColor="#c0392b",t.focus())}return a}function i(e){return!(!e||!e.tvaEmail&&!/email required/i.test(e.message||""))}const s=document.getElementById("tva-paypal-email");function p(a){n();const i=r();if(!i){const e=new Error("Email required");return e.tvaEmail=!0,Promise.reject(e)}const s=document.getElementById("tva-paypal-vault-optin"),c=!(!s||!s.checked);return o(e.createOrderUrl,{product_id:e.productId,email:i,source:a||"",vault:c}).then((function(e){return t=e.tva_order_id,e.id}))}function l(a){const o=function(e){switch(e){case"venmo":return"Venmo";case"apple_pay":return"Apple Pay";case"google_pay":return"Google Pay";case"card":return"your card";case"paypal":return"PayPal";default:return""}}(a);!function(e){n();const t=document.getElementById("tva-paypal-checkout");t&&(t.innerHTML='<div class="tva-paypal-checkout__success">'+c(e)+"</div>")}("Payment successful!"+(o?" Paid with "+o+".":"")+" Setting up your access…");const r=function(e,t,a){if(!a)return e;const n=-1===e.indexOf("?")?"?":"&";return e+n+encodeURIComponent("tva_order_id")+"="+encodeURIComponent(a)}(e.redirectUrl||window.location.href,0,t);setTimeout((function(){window.location.href=r}),2e3)}function d(a){return o(e.captureOrderUrl,{order_id:a.orderID,tva_order_id:t}).then((function(e){l(e&&e.payment_source)})).catch((function(e){f("We could not complete your payment. Please try again.",e)}))}function v(e){i(e)||f("Something went wrong with PayPal. Please try again.",e)}s&&s.addEventListener("input",(function(){s.style.borderColor="";const e=document.getElementById("tva-paypal-email-error");e&&(e.textContent="",e.style.display="none"),n()}));let y=!1,g=!1,_="paypal";if("function"==typeof window.paypal.Buttons)try{const e=window.paypal.Buttons({onClick:function(e){e&&e.fundingSource&&(_=e.fundingSource)},createOrder:function(){return p(_)},onApprove:d,onError:v,onCancel:function(e){f("Payment was cancelled.",e)},appSwitchWhenAvailable:!0});("function"!=typeof e.isEligible||e.isEligible())&&(y=!0,setTimeout((function(){e.render("#tva-paypal-buttons")}),150))}catch(e){v(e)}if(!1===e.card){const e=document.querySelector("#tva-paypal-payment-modal .ppcp-row-card");e&&(e.style.display="none");const t=document.getElementById("tva-paypal-card-fields");t&&(t.style.display="none")}else if("function"==typeof window.paypal.CardFields){const e=window.paypal.CardFields({createOrder:function(){return p("card")},onApprove:d,onError:v,style:{body:{padding:"0"},input:{"font-size":"14px","font-family":'-apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif',color:"#111",padding:"11px 12px","line-height":"1","box-shadow":"none"},".invalid":{color:"#c0392b"}}});if(e.isEligible()){g=!0;let t=!1;const a=function(){t||(t=!0,e.NumberField().render("#tva-paypal-card-number"),e.ExpiryField().render("#tva-paypal-card-expiry"),e.CVVField().render("#tva-paypal-card-cvv"))},o=document.querySelector("#tva-paypal-payment-modal .ppcp-row-card");if(o){const e=function(){setTimeout(a,0)};o.addEventListener("click",e),o.addEventListener("keydown",(function(t){"Enter"!==t.key&&" "!==t.key||e()})),o.classList.contains("ppcp-sel")&&a()}const s=document.getElementById("tva-paypal-card-submit");s&&s.addEventListener("click",(function(){n(),r()&&(h(!0),e.submit().catch((function(e){h(!1),i(e)||f("Your card could not be processed. Please check the details and try again.",e)})))})),y||(u("card"),a())}else{const e=document.querySelector("#tva-paypal-payment-modal .ppcp-row-card");e&&(e.style.display="none");const t=document.getElementById("tva-paypal-card-fields");t&&(t.style.display="none")}}else{const e=document.querySelector("#tva-paypal-payment-modal .ppcp-row-card");e&&(e.style.display="none");const t=document.getElementById("tva-paypal-card-fields");t&&(t.style.display="none")}y||g||f("PayPal checkout is currently unavailable. Please try another payment method."),e.googlePay&&"function"==typeof window.paypal.Googlepay&&m().then((function(){if(!(window.google&&window.google.payments&&window.google.payments.api))return;const a=window.paypal.Googlepay();return a.config().then((function(r){const s=new window.google.payments.api.PaymentsClient({environment:r.environment});return s.isReadyToPay({apiVersion:2,apiVersionMinor:0,allowedPaymentMethods:r.allowedPaymentMethods}).then((function(c){if(!c||!c.result)return;const d=s.createButton({buttonSizeMode:"fill",onClick:function(){!function(a,r,s){n(),u("googlepay"),p("googlepay").then((function(n){return s.loadPaymentData({apiVersion:2,apiVersionMinor:0,allowedPaymentMethods:r.allowedPaymentMethods,transactionInfo:{totalPriceStatus:"FINAL",totalPrice:String(e.amount),currencyCode:e.currency,countryCode:e.countryCode||"US"},merchantInfo:r.merchantInfo}).then((function(e){return a.confirmOrder({orderId:n,paymentMethodData:e.paymentMethodData}).then((function(e){return e&&"PAYER_ACTION_REQUIRED"===e.status?a.initiatePayerAction({orderId:n}).then((function(){return n})):n}))})).then((function(a){return o(e.captureOrderUrl,{order_id:a,tva_order_id:t,confirmed:!0}).then((function(e){l(e&&e.payment_source)}))}))})).catch((function(e){i(e)||(!e||"CANCELED"!==e.statusCode&&"CANCELLED"!==e.statusCode)&&f("We could not complete your Google Pay payment. Please try again.",e)}))}(a,r,s)}}),m=document.getElementById("tva-paypal-googlepay-button");m&&(m.appendChild(d),m.style.display="")}))}))})).catch((function(e){console.log("[Thrive Apprentice PayPal]","Google Pay init",e&&e.message)})),function(){if(e.applePay&&void 0!==window.ApplePaySession&&"function"==typeof window.paypal.Applepay&&window.ApplePaySession.canMakePayments()){var a=window.paypal.Applepay();a.config().then((function(s){if(s&&s.isEligible)return new Promise((function(e,t){const a=function(){return!(!window.customElements||!window.customElements.get("apple-pay-button"))};if(a())return void e();const n=document.getElementById("tva-applepay-sdk");if(n)return"error"===n.getAttribute("data-tva-loaded")?void t(new Error("Failed to load Apple Pay SDK.")):"ok"===n.getAttribute("data-tva-loaded")||a()?void e():(n.addEventListener("load",(function(){e()})),void n.addEventListener("error",(function(){t(new Error("Failed to load Apple Pay SDK."))})));const o=document.createElement("script");o.id="tva-applepay-sdk",o.src="https://applepay.cdn-apple.com/jsapi/v1/apple-pay-sdk.js",o.onload=function(){o.setAttribute("data-tva-loaded","ok"),e()},o.onerror=function(){o.setAttribute("data-tva-loaded","error"),t(new Error("Failed to load Apple Pay SDK."))},document.head.appendChild(o)})).then((function(){var c=document.getElementById("tva-paypal-applepay-button");if(c){var d=(document.documentElement.lang||"en").replace("_","-"),m=document.createElement("apple-pay-button");m.id="tva-apple-pay-btn",m.setAttribute("buttonstyle","black"),m.setAttribute("type","buy"),m.setAttribute("locale",d),m.addEventListener("click",(function(){!function(a,s){if(n(),r()){u("applepay");for(var c={countryCode:s.countryCode||e.countryCode||"US",currencyCode:e.currency,merchantCapabilities:s.merchantCapabilities||["supports3DS"],supportedNetworks:s.supportedNetworks||["visa","masterCard","amex","discover"],requiredBillingContactFields:["name","email","postalAddress"],total:{label:e.merchantName||e.productTitle||"Total",amount:String(e.amount),type:"final"}},d=4;d>3&&!window.ApplePaySession.supportsVersion(d);)d--;var m=new window.ApplePaySession(d,c);m.onvalidatemerchant=function(t){a.validateMerchant({validationUrl:t.validationURL,displayName:e.merchantName||""}).then((function(e){m.completeMerchantValidation(e.merchantSession)})).catch((function(e){m.abort(),f("We could not start your Apple Pay payment. Please try again.",e)}))},m.onpaymentauthorized=function(n){p("applepay").then((function(r){return a.confirmOrder({orderId:r,token:n.payment.token,billingContact:n.payment.billingContact,shippingContact:n.payment.shippingContact}).then((function(){return o(e.captureOrderUrl,{order_id:r,tva_order_id:t,confirmed:!0})})).then((function(e){m.completePayment(window.ApplePaySession.STATUS_SUCCESS),l(e&&e.payment_source)}))})).catch((function(e){m.completePayment(window.ApplePaySession.STATUS_FAILURE),i(e)||f("We could not complete your Apple Pay payment. Please try again.",e)}))},m.oncancel=function(){},m.begin()}}(a,s)})),c.textContent="",c.appendChild(m),c.style.display=""}}))})).catch((function(e){console.log("[Thrive Apprentice PayPal]","Apple Pay init",e&&e.message)}))}}()}let y="idle";const g=[];let b=null;function w(e,t,a){const n=t===b;if(n&&"ready"===y)return void a();if(n&&"error"===y)return;if(!n&&"idle"!==y){const e=document.getElementById("tva-paypal-messages-sdk");e&&e.parentNode&&e.parentNode.removeChild(e),window.tvaPayPalMessages=void 0,g.length=0,y="idle"}if(b=t,g.push(a),"loading"===y)return;y="loading";const o=document.createElement("script");o.id="tva-paypal-messages-sdk",o.src="https://www.paypal.com/sdk/js?client-id="+encodeURIComponent(e)+"&components=messages&currency="+encodeURIComponent(t),o.setAttribute("data-namespace","tvaPayPalMessages"),o.onload=function(){for(y="ready";g.length;)g.shift()()},o.onerror=function(){y="error",g.length=0},document.head.appendChild(o)}o(window).on("tcb_after_dom_ready",(function(){try{const e=new URLSearchParams(window.location.search);if(e.get("tva_paypal_sub_error")){r("We could not complete your subscription. Please try again."),e.delete("tva_paypal_sub_error");const t=window.location.pathname+(e.toString()?"?"+e.toString():"")+window.location.hash;window.history.replaceState({},"",t)}}catch(e){}const t=o('a.tcb-button-link.tcb-plain-text.tve-dynamic-link[data-dynamic-link="tva_dynamic_actions_link"]');if(t.length<=0)return;!function(t){if(!(t&&t.length&&void 0!==e&&e.routes&&e.routes.paypal))return;const a={},n=[];if(t.each((function(){const e=o(this).attr("href")||"";let t;try{t=new URL(e,window.location.origin)}catch(e){return}const r=t.searchParams;if("paypal"!==r.get("pp"))return;const i=r.get("pid");i&&!a[i]&&(a[i]=!0,n.push({pid:i,el:this}))})),!n.length)return;let r=null;n.forEach((function(t){o.ajax({type:"POST",url:e.routes.paypal+"/pay_later_config",headers:{"X-WP-Nonce":e.nonce},data:{product_id:t.pid},success:function(e){if(!e||!e.success||!e.config)return;const a=e.config;null===r&&(r=a.currency),a.currency===r&&w(a.clientId,r,(function(){!function(e,t){const a=o(e),n=a.closest(".thrv_wrapper").length?a.closest(".thrv_wrapper"):a;if(n.prev(".tva-paypal-paylater-message").length)return;const r=window.tvaPayPalMessages,i=o('<div class="tva-paypal-paylater-message"></div>');if(n.before(i),r&&"function"==typeof r.Messages)try{r.Messages({amount:parseFloat(t),placement:"product",style:{layout:"text"}}).render(i.get(0))}catch(e){i.remove()}else i.remove()}(t.el,a.amount)}))}})}))}(t);const a=t.attr("href").split("error-stripe=");a&&a[1]&&r(decodeURIComponent(a[1])),t.on("click",(function(t){const a=o(this).attr("href");let n;try{n=new URL(a,window.location.origin)}catch(e){return}const i=n.searchParams;if("1"===i.get("tvasquare")){t.preventDefault();const a=i.get("pid");if(!a)return void console.error("Product ID is required for Square payments");o.ajax({type:"POST",url:e.routes.square+"/product_config",headers:{"X-WP-Nonce":e.nonce},data:{product_id:a,mode:i.get("m")||"test"},success:function(e){e&&e.success?function(e){o("#tva-square-payment-modal").remove();const t=function(e){return'<div id="tva-square-payment-modal" style="position: fixed; top: 0; left: 0; width: 100%; height: 100%;background: rgba(0, 0, 0, 0.7); z-index: 999999;display: flex; align-items: center; justify-content: center;opacity: 0; transition: opacity 0.3s ease;"><div id="tva-square-payment-container" style="background: white; border-radius: 12px;box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);max-width: 800px; width: 90%; max-height: 90vh;overflow-y: auto; position: relative;transform: scale(0.9); transition: transform 0.3s ease;">'+function(e){const t=e||{},a=t.squareItemMode||"",n=[a?{live:"Production",test:"Sandbox"}[a]||a:"",t.merchantName||t.merchantId||""].filter(Boolean).join(" | ");return'<div style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);color: white; padding: 20px 30px; border-radius: 12px 12px 0 0;position: relative;"><h2 id="tva-square-modal-title" style="margin: 0; font-size: 24px; font-weight: 300; color:#ffffff;">Square Web Payments - Loading...</h2>'+(n?'<p id="tva-square-modal-meta" style="margin: 8px 0 0 0; font-size: 13px; color:#ffffff; font-weight: 600;">'+n+"</p>":"")+'<button id="tva-square-close-btn" style="position: absolute; top: 15px; right: 20px;background: none; border: none; color: white;font-size: 24px; cursor: pointer; opacity: 0.8;transition: opacity 0.3s ease;">&times;</button></div>'}(e)+'<div style="padding: 30px;"><div id="tva-square-loading" style="text-align: center; padding: 40px;"><div style="border: 4px solid #f3f3f3; border-top: 4px solid #667eea; border-radius: 50%; width: 40px; height: 40px; animation: spin 2s linear infinite; margin: 0 auto 20px;"></div><p>Loading payment form...</p></div><form id="tva-square-payment-form" style="display: none;"><div style="margin-bottom: 25px;"><h3 style="margin: 0 0 20px 0; color: #333; font-size: 18px; font-weight: 600;">Personal Information</h3><div style="display: flex; gap: 15px; margin-bottom: 15px;"><div style="flex: 1;"><label style="display: block; margin-bottom: 5px; color: #555; font-weight: 500;">First Name <span style="color: #e74c3c;">*</span></label><input type="text" id="tva-square-firstName" style="width: 100%; padding: 12px; border: 2px solid #e1e8ed; border-radius: 8px; font-size: 14px; transition: border-color 0.3s ease;" placeholder="John" required></div><div style="flex: 1;"><label style="display: block; margin-bottom: 5px; color: #555; font-weight: 500;">Last Name <span style="color: #e74c3c;">*</span></label><input type="text" id="tva-square-lastName" style="width: 100%; padding: 12px; border: 2px solid #e1e8ed; border-radius: 8px; font-size: 14px; transition: border-color 0.3s ease;" placeholder="Doe" required></div></div><div style="display: flex; gap: 15px;"><div style="flex: 1;"><label style="display: block; margin-bottom: 5px; color: #555; font-weight: 500;">Email Address <span style="color: #e74c3c;">*</span></label><input type="email" id="tva-square-email" style="width: 100%; padding: 12px; border: 2px solid #e1e8ed; border-radius: 8px; font-size: 14px; transition: border-color 0.3s ease;" placeholder="john.doe@example.com" required></div><div style="flex: 1;"><label style="display: block; margin-bottom: 5px; color: #555; font-weight: 500;">Phone Number <span style="color: #e74c3c;">*</span></label><input type="tel" id="tva-square-phone" style="width: 100%; padding: 12px; border: 2px solid #e1e8ed; border-radius: 8px; font-size: 14px; transition: border-color 0.3s ease;" placeholder="+1 (555) 123-4567" required></div></div></div><div style="margin-bottom: 25px;"><h3 style="margin: 0 0 20px 0; color: #333; font-size: 18px; font-weight: 600;">Payment Information</h3><div style="margin-bottom: 20px;"><label style="display: block; margin-bottom: 10px; color: #555; font-weight: 500;">Card Details <span style="color: #e74c3c;">*</span></label><div id="tva-square-card-container" style="border: 2px solid #e1e8ed; border-radius: 8px; padding: 15px; background: #fff;"></div></div></div><button id="tva-square-payment-btn" type="button" style="width: 100%; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border: none; padding: 15px 30px; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);">&#x1F4B3; Complete Payment</button></form><div id="tva-square-payment-status" style="display: none; margin-top: 20px;"></div></div></div></div>'}(e);o("body").append(t),o("#tva-square-spinner-css").length||o('<style id="tva-square-spinner-css">@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); }}#tva-square-payment-form input:focus { border-color: #667eea !important; outline: none; box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1); }#tva-square-payment-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6); }#tva-square-payment-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }</style>').appendTo("head"),function(e){function t(){o("#tva-square-payment-modal").css("opacity","0"),o("#tva-square-payment-container").css("transform","scale(0.9)"),setTimeout((()=>{o("#tva-square-payment-modal").remove(),window.tvaSquareCurrentProduct&&delete window.tvaSquareCurrentProduct}),300)}setTimeout((()=>{o("#tva-square-payment-modal").css("opacity","1"),o("#tva-square-payment-container").css("transform","scale(1)")}),10),o("#tva-square-close-btn").on("click",t),o("#tva-square-payment-modal").on("click",(function(e){e.target===this&&t()})),o(document).on("keydown.tva-square-modal",(function(e){27===e.keyCode&&(t(),o(document).off("keydown.tva-square-modal"))})),function(e){if("live"!==e.squareItemMode||"https:"===window.location.protocol)if(window.Square)p(e);else{const t=document.createElement("script");t.src="test"===e.squareItemMode?"https://sandbox.web.squarecdn.com/v1/square.js":"https://web.squarecdn.com/v1/square.js",t.onload=()=>p(e),t.onerror=()=>l("Failed to load Square payments. Please try again."),document.head.appendChild(t)}else l("Square live payments require HTTPS. Please use a secure connection or switch to test mode.")}(e)}(e)}(e):console.error("Failed to get Square configuration:",e.message)},error:function(){console.error("Failed to fetch Square configuration")}})}else if("paypal"===i.get("pp")){t.preventDefault();const a=i.get("pid");if(!a)return void console.error("Product ID is required for PayPal payments");o.ajax({type:"POST",url:e.routes.paypal+"/product_config",headers:{"X-WP-Nonce":e.nonce},data:{product_id:a},success:function(e){e.success?function(e){o("#tva-paypal-payment-modal").remove(),o(document).off("keydown.tva-paypal-modal");const t=function(e,t){const a=Number(e),n=isFinite(a)?a:0;try{return new Intl.NumberFormat(void 0,{style:"currency",currency:t}).format(n)}catch(e){return(t?t+" ":"")+n.toFixed(2)}}(e.amount,e.currency),a=e.merchantName||"",n=c(a),r='<div id="tva-paypal-payment-modal" class="ppcp-overlay"><div id="tva-paypal-payment-container" class="ppcp-popup" role="dialog" aria-modal="true" aria-label="PayPal checkout"><button id="tva-paypal-close-btn" class="ppcp-close" type="button" aria-label="Close">&times;</button><div id="tva-paypal-checkout" class="tva-paypal-checkout ppcp-body"><div class="ppcp-logo"><svg role="img" aria-label="PayPal" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 188 49"><path fill="#0070E0" d="M164.01 11.446l-4.012 25.207a.643.643 0 0 0 .642.746h4.748a.701.701 0 0 0 .698-.589l4.012-25.207a.643.643 0 0 0-.642-.746h-4.748a.692.692 0 0 0-.698.589zm-5.07 7.356h-4.505a.699.699 0 0 0-.697.588l-.149.928s-3.499-3.794-9.694-1.23c-3.554 1.468-5.26 4.501-5.986 6.723 0 0-2.304 6.753 2.907 10.47 0 0 4.832 3.575 10.273-.22l-.094.592a.644.644 0 0 0 .37.686c.085.04.178.06.272.06h4.508a.692.692 0 0 0 .698-.589l2.742-17.262a.632.632 0 0 0-.149-.521.643.643 0 0 0-.496-.226zm-6.629 9.54a5.005 5.005 0 0 1-1.715 3.095 5.073 5.073 0 0 1-3.345 1.203 4.602 4.602 0 0 1-1.416-.206c-1.945-.62-3.055-2.474-2.736-4.484a5.01 5.01 0 0 1 1.717-3.093 5.08 5.08 0 0 1 3.343-1.207 4.6 4.6 0 0 1 1.416.208c1.957.616 3.062 2.473 2.741 4.485h-.005zm-24.056.477c2.443 0 4.806-.868 6.662-2.446a10.147 10.147 0 0 0 3.456-6.158c.789-4.993-3.14-9.351-8.71-9.351h-8.973a.699.699 0 0 0-.697.589L115.98 36.66a.644.644 0 0 0 .37.686c.086.04.178.06.272.06h4.751a.699.699 0 0 0 .697-.589l1.178-7.402a.692.692 0 0 1 .698-.59l4.309-.006zm3.974-8.831c-.293 1.846-1.731 3.205-4.482 3.205h-3.517l1.068-6.713h3.454c2.844.005 3.77 1.67 3.477 3.513v-.005z"></path><path fill="#003087" d="M110.567 19.23l-5.434 9.105-2.758-9.038a.694.694 0 0 0-.672-.495h-4.904a.526.526 0 0 0-.527.446.515.515 0 0 0 .025.247l4.942 15.224-4.47 7.174a.516.516 0 0 0 .18.728.527.527 0 0 0 .269.07h5.282a.876.876 0 0 0 .751-.42l13.804-22.667a.512.512 0 0 0 .011-.53.524.524 0 0 0-.463-.263h-5.28a.877.877 0 0 0-.756.419zm-16.548-.428H89.51a.7.7 0 0 0-.698.59l-.146.927s-3.502-3.794-9.697-1.23c-3.553 1.468-5.26 4.501-5.983 6.723 0 0-2.306 6.753 2.904 10.47 0 0 4.833 3.575 10.274-.22l-.094.592a.642.642 0 0 0 .37.686c.085.04.178.06.272.06h4.508a.701.701 0 0 0 .697-.589l2.743-17.262a.642.642 0 0 0-.37-.687.655.655 0 0 0-.272-.06zm-6.63 9.542a5.011 5.011 0 0 1-1.716 3.091 5.082 5.082 0 0 1-3.343 1.206 4.605 4.605 0 0 1-1.414-.206c-1.944-.62-3.053-2.474-2.734-4.485a5.011 5.011 0 0 1 1.723-3.098 5.082 5.082 0 0 1 3.353-1.201c.48-.005.959.065 1.417.208 1.937.616 3.04 2.472 2.72 4.485h-.005zm-24.055.476a10.284 10.284 0 0 0 6.656-2.449 10.144 10.144 0 0 0 3.452-6.156c.79-4.992-3.14-9.35-8.708-9.35H55.76a.7.7 0 0 0-.698.588l-4 25.2a.642.642 0 0 0 .37.687c.085.039.178.06.272.06h4.748a.7.7 0 0 0 .698-.59l1.176-7.402a.692.692 0 0 1 .698-.589h4.31zm3.974-8.832c-.293 1.846-1.73 3.205-4.481 3.205H59.31l1.066-6.713h3.454c2.845.005 3.77 1.671 3.478 3.513v-.005z"></path><path fill="#001C64" d="M32.639 12.16c.107-5.566-4.484-9.836-10.797-9.836H8.784a1.277 1.277 0 0 0-1.262 1.078L2.29 36.095a1.038 1.038 0 0 0 1.025 1.2h7.736l-1.209 7.57a1.038 1.038 0 0 0 1.025 1.2h6.302c.304 0 .575-.109.807-.306.23-.198.268-.471.316-.772l1.85-10.884c.047-.3.2-.69.431-.888.231-.198.433-.306.738-.306h3.856c6.183 0 11.428-4.395 12.387-10.507.679-4.338-1.181-8.286-4.915-10.243z"></path><path fill="#0070E0" d="M12.725 25.238l-1.927 12.218-1.21 7.664a1.038 1.038 0 0 0 1.026 1.199h6.67a1.276 1.276 0 0 0 1.26-1.078l1.758-11.139a1.277 1.277 0 0 1 1.261-1.078h3.926c6.183 0 11.428-4.51 12.388-10.622.68-4.338-1.504-8.286-5.238-10.243-.01.462-.05.923-.121 1.38-.959 6.11-6.206 10.621-12.387 10.621h-6.145a1.278 1.278 0 0 0-1.261 1.079"></path><path fill="#003087" d="M10.797 37.456h-7.76a1.037 1.037 0 0 1-1.024-1.2L7.245 3.078A1.277 1.277 0 0 1 8.506 2h13.336c6.313 0 10.904 4.594 10.797 10.159-1.571-.824-3.417-1.295-5.439-1.295H16.082a1.277 1.277 0 0 0-1.262 1.078l-2.094 13.296-1.93 12.218z"></path></svg></div><div class="ppcp-merchant"><span class="ppcp-merchant-info"><span class="ppcp-merchant-name">'+n+'</span><span class="ppcp-merchant-sub">Complete your purchase securely</span></span><span class="ppcp-total">'+c(t)+'</span></div><div class="ppcp-summary"><div class="ppcp-summary-head" tabindex="0" role="button" aria-expanded="true"><span>Order summary</span><span class="ppcp-chev"></span></div><div class="ppcp-summary-detail"><div class="ppcp-line"><span>'+c(e.productTitle||"")+"</span><span>"+c(t)+'</span></div><div class="ppcp-line ppcp-line-total"><span>Total</span><span>'+c(t)+'</span></div></div></div><div class="ppcp-field tva-paypal-checkout__email-wrap"><label for="tva-paypal-email">Email</label><input type="email" id="tva-paypal-email" name="tva_paypal_email" value="'+c(e.payerEmail||"")+'" placeholder="you@example.com" autocomplete="email" required><div class="ppcp-hint">We\'ll send your course access details here</div><div id="tva-paypal-email-error" class="ppcp-error" role="alert" style="display:none;"></div></div>'+(e.canVault?'<label class="ppcp-vault"><input type="checkbox" id="tva-paypal-vault-optin" name="tva_paypal_vault_optin"><span>Save my payment method for future purchases</span></label>':"")+'<p class="ppcp-paywith">Pay with</p><div id="tva-paypal-buttons" class="tva-paypal-checkout__buttons ppcp-wallet-zone"></div>'+(e.payLater?'<div id="tva-paypal-paylater-msg" class="ppcp-paylater-msg"></div>':"")+'<div id="tva-paypal-googlepay-button" class="ppcp-googlepay-zone" style="display:none;"></div><div id="tva-paypal-applepay-button" class="ppcp-applepay-zone" style="display:none;"></div><div class="ppcp-row ppcp-row-card" data-method="card" tabindex="0" role="button" aria-pressed="false"><span class="ppcp-dot"></span><span class="ppcp-row-icon" style="color:#003087">&#128179;</span><span class="ppcp-row-meta"><span class="ppcp-row-title">Debit or credit card</span><span class="ppcp-row-desc">No PayPal account needed</span></span></div><div id="tva-paypal-card-fields" class="tva-paypal-checkout__card-fields" style="display:none;"><div class="ppcp-card-form"><div class="ppcp-field"><label>Card number</label><div id="tva-paypal-card-number" class="tva-paypal-checkout__field ppcp-hosted-field"></div></div><div class="ppcp-pair"><div class="ppcp-field"><label>Expiry</label><div id="tva-paypal-card-expiry" class="tva-paypal-checkout__field ppcp-hosted-field"></div></div><div class="ppcp-field"><label>CVV</label><div id="tva-paypal-card-cvv" class="tva-paypal-checkout__field ppcp-hosted-field"></div></div></div></div><button type="button" id="tva-paypal-card-submit" class="tva-paypal-checkout__submit ppcp-pay">Pay '+c(t)+'</button></div><div id="tva-paypal-error" class="tva-paypal-checkout__error ppcp-error" role="alert" style="display:none;"></div><p class="ppcp-cancel"><a href="#" id="tva-paypal-cancel">Cancel and return'+(a?" to "+n:"")+'</a></p></div><div class="ppcp-footer"><span>&#128274; Secured by PayPal</span><span>Terms &middot; Privacy</span></div></div></div>';function i(){o("#tva-paypal-payment-modal").removeClass("ppcp-show"),setTimeout((function(){o("#tva-paypal-payment-modal").remove()}),300),o(document).off("keydown.tva-paypal-modal")}function s(e,t){o("#tva-paypal-payment-modal").on("click",e,t),o("#tva-paypal-payment-modal").on("keydown",e,(function(e){"Enter"!==e.key&&" "!==e.key&&13!==e.keyCode&&32!==e.keyCode||(e.preventDefault(),t.call(this,e))}))}o("body").append(r),o("#tva-paypal-checkout-css").length||o('<style id="tva-paypal-checkout-css">'+d+"</style>").appendTo("head"),setTimeout((function(){o("#tva-paypal-payment-modal").addClass("ppcp-show")}),10),o("#tva-paypal-close-btn").on("click",i),o("#tva-paypal-cancel").on("click",(function(e){e.preventDefault(),i()})),o("#tva-paypal-payment-modal").on("click",(function(e){e.target===this&&i()})),o(document).on("keydown.tva-paypal-modal",(function(e){27===e.keyCode&&i()})),s(".ppcp-summary-head",(function(){const e=o(this).closest(".ppcp-summary").toggleClass("ppcp-collapsed").hasClass("ppcp-collapsed");o(this).attr("aria-expanded",e?"false":"true")})),s(".ppcp-row",(function(){const e=o(this).data("method");"card"===e&&o(this).hasClass("ppcp-sel")?u(""):u(e)})),function(e){if(!e||document.getElementById("tva-paypal-fraudnet"))return;const t=document.createElement("script");t.id="tva-paypal-fraudnet",t.type="application/json",t.setAttribute("fncls",e.fncls),t.textContent=JSON.stringify({f:e.sessionId,s:e.bnCode}),document.body.appendChild(t);const a=document.createElement("iframe");a.title="FraudNet",a.style.cssText="display:none;width:0;height:0;border:0;",a.src=e.iframeUrl,document.body.appendChild(a)}(e.fraudnet),function(e){if("live"===e.mode&&"https:"!==window.location.protocol)return void f("PayPal live payments require HTTPS. Please use a secure connection.");e.googlePay&&m().catch((function(e){console.log("[Thrive Apprentice PayPal]",e&&e.message)}));const t=e.components||"buttons,card-fields",a=document.getElementById("tva-paypal-sdk");if(window.paypal&&"function"==typeof window.paypal.Buttons&&a&&a.getAttribute("data-tva-currency")===e.currency&&a.getAttribute("data-tva-components")===t)return void v(e);a&&a.parentNode.removeChild(a);try{delete window.paypal}catch(e){window.paypal=void 0}const n="https://www.paypal.com/sdk/js?client-id="+encodeURIComponent(e.clientId)+"&merchant-id="+encodeURIComponent(e.merchantId)+"&commit=true&intent=capture&enable-funding="+encodeURIComponent(e.enableFunding||"paylater,venmo")+(e.disableFunding?"&disable-funding="+encodeURIComponent(e.disableFunding):"")+"&components="+encodeURIComponent(t)+"&currency="+encodeURIComponent(e.currency),o=document.createElement("script");o.id="tva-paypal-sdk",o.src=n,o.setAttribute("data-tva-currency",e.currency),o.setAttribute("data-tva-components",t),o.setAttribute("data-page-type","checkout"),e.bnCode&&o.setAttribute("data-partner-attribution-id",e.bnCode),e.clientToken&&o.setAttribute("data-client-token",e.clientToken),o.onload=function(){v(e)},o.onerror=function(){f("Failed to load PayPal. Please try again.")},document.head.appendChild(o)}(e)}(e):r("Unable to load checkout. Please try again.")},error:function(){r("Unable to load checkout. Please try again.")}})}else if("paypal_sub"===i.get("pp")){t.preventDefault();const a=i.get("pid");if(!a)return void console.error("Product ID is required for PayPal subscriptions");if(!(!0===e.is_user_logged_in||parseInt(e.is_user_logged_in,10)>0)){r("Please log in to subscribe.");const t=e.login_url;if(t&&/^https?:\/\//i.test(t)){const e=document.createElement("a");e.href=t,e.style.color="inherit",e.style.textDecoration="underline",e.textContent="log in";const a=document.createElement("span");a.appendChild(document.createTextNode("Please ")),a.appendChild(e),a.appendChild(document.createTextNode(" to subscribe.")),o(".tva-custom-toast").empty().append(a)}return}!function(t){o("#tva-paypal-sub-consent").remove(),o.ajax({type:"POST",url:e.routes.paypal+"/subscriptions/pricing",headers:{"X-WP-Nonce":e.nonce},data:{product_id:t},success:function(a){a&&a.success?function(t,a){o("#tva-paypal-sub-consent").remove(),o(document).off("keydown.tva-paypal-sub");const n=Array.isArray(a.pricing)?a.pricing:[];let i=null;if(a.selected_id&&(i=n.filter((function(e){return e&&String(e.id)===String(a.selected_id)}))[0]||null),i||(i=n.filter((function(e){return e&&"recurring"===e.type}))[0]||n[0]||null),!i||!i.amount)return void r("This product has no PayPal subscription price.");const s=function(e,t){const a=parseFloat(e);return(t?t+" ":"")+(isFinite(a)?a:0).toFixed(2)}(i.amount,i.currency),p=i.interval&&String(i.interval).trim()?String(i.interval).trim():"cycle",l=parseInt(a.trial_days,10)||0,u=l>0?"I agree to start a free trial and the recurring payment shown above after it ends, and to the cancellation &amp; refund policy.":"I agree to the recurring payment shown above and the cancellation &amp; refund policy.",m=l>0?"Free for "+l+" day"+(1===l?"":"s")+", then "+c(s)+" every "+c(p)+". Cancel anytime.":c(s)+" today, then "+c(s)+" every "+c(p)+". Cancel anytime.",f='<div id="tva-paypal-sub-consent" class="ppcp-overlay"><div class="ppcp-popup" role="dialog" aria-modal="true" aria-label="Subscription consent"><button id="tva-paypal-sub-close" class="ppcp-close" type="button" aria-label="Close">&times;</button><div class="ppcp-body"><div class="ppcp-logo"><svg role="img" aria-label="PayPal" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 188 49"><path fill="#0070E0" d="M164.01 11.446l-4.012 25.207a.643.643 0 0 0 .642.746h4.748a.701.701 0 0 0 .698-.589l4.012-25.207a.643.643 0 0 0-.642-.746h-4.748a.692.692 0 0 0-.698.589zm-5.07 7.356h-4.505a.699.699 0 0 0-.697.588l-.149.928s-3.499-3.794-9.694-1.23c-3.554 1.468-5.26 4.501-5.986 6.723 0 0-2.304 6.753 2.907 10.47 0 0 4.832 3.575 10.273-.22l-.094.592a.644.644 0 0 0 .37.686c.085.04.178.06.272.06h4.508a.692.692 0 0 0 .698-.589l2.742-17.262a.632.632 0 0 0-.149-.521.643.643 0 0 0-.496-.226zm-6.629 9.54a5.005 5.005 0 0 1-1.715 3.095 5.073 5.073 0 0 1-3.345 1.203 4.602 4.602 0 0 1-1.416-.206c-1.945-.62-3.055-2.474-2.736-4.484a5.01 5.01 0 0 1 1.717-3.093 5.08 5.08 0 0 1 3.343-1.207 4.6 4.6 0 0 1 1.416.208c1.957.616 3.062 2.473 2.741 4.485h-.005zm-24.056.477c2.443 0 4.806-.868 6.662-2.446a10.147 10.147 0 0 0 3.456-6.158c.789-4.993-3.14-9.351-8.71-9.351h-8.973a.699.699 0 0 0-.697.589L115.98 36.66a.644.644 0 0 0 .37.686c.086.04.178.06.272.06h4.751a.699.699 0 0 0 .697-.589l1.178-7.402a.692.692 0 0 1 .698-.59l4.309-.006zm3.974-8.831c-.293 1.846-1.731 3.205-4.482 3.205h-3.517l1.068-6.713h3.454c2.844.005 3.77 1.67 3.477 3.513v-.005z"></path><path fill="#003087" d="M110.567 19.23l-5.434 9.105-2.758-9.038a.694.694 0 0 0-.672-.495h-4.904a.526.526 0 0 0-.527.446.515.515 0 0 0 .025.247l4.942 15.224-4.47 7.174a.516.516 0 0 0 .18.728.527.527 0 0 0 .269.07h5.282a.876.876 0 0 0 .751-.42l13.804-22.667a.512.512 0 0 0 .011-.53.524.524 0 0 0-.463-.263h-5.28a.877.877 0 0 0-.756.419zm-16.548-.428H89.51a.7.7 0 0 0-.698.59l-.146.927s-3.502-3.794-9.697-1.23c-3.553 1.468-5.26 4.501-5.983 6.723 0 0-2.306 6.753 2.904 10.47 0 0 4.833 3.575 10.274-.22l-.094.592a.642.642 0 0 0 .37.686c.085.04.178.06.272.06h4.508a.701.701 0 0 0 .697-.589l2.743-17.262a.642.642 0 0 0-.37-.687.655.655 0 0 0-.272-.06zm-6.63 9.542a5.011 5.011 0 0 1-1.716 3.091 5.082 5.082 0 0 1-3.343 1.206 4.605 4.605 0 0 1-1.414-.206c-1.944-.62-3.053-2.474-2.734-4.485a5.011 5.011 0 0 1 1.723-3.098 5.082 5.082 0 0 1 3.353-1.201c.48-.005.959.065 1.417.208 1.937.616 3.04 2.472 2.72 4.485h-.005zm-24.055.476a10.284 10.284 0 0 0 6.656-2.449 10.144 10.144 0 0 0 3.452-6.156c.79-4.992-3.14-9.35-8.708-9.35H55.76a.7.7 0 0 0-.698.588l-4 25.2a.642.642 0 0 0 .37.687c.085.039.178.06.272.06h4.748a.7.7 0 0 0 .698-.59l1.176-7.402a.692.692 0 0 1 .698-.589h4.31zm3.974-8.832c-.293 1.846-1.73 3.205-4.481 3.205H59.31l1.066-6.713h3.454c2.845.005 3.77 1.671 3.478 3.513v-.005z"></path><path fill="#001C64" d="M32.639 12.16c.107-5.566-4.484-9.836-10.797-9.836H8.784a1.277 1.277 0 0 0-1.262 1.078L2.29 36.095a1.038 1.038 0 0 0 1.025 1.2h7.736l-1.209 7.57a1.038 1.038 0 0 0 1.025 1.2h6.302c.304 0 .575-.109.807-.306.23-.198.268-.471.316-.772l1.85-10.884c.047-.3.2-.69.431-.888.231-.198.433-.306.738-.306h3.856c6.183 0 11.428-4.395 12.387-10.507.679-4.338-1.181-8.286-4.915-10.243z"></path><path fill="#0070E0" d="M12.725 25.238l-1.927 12.218-1.21 7.664a1.038 1.038 0 0 0 1.026 1.199h6.67a1.276 1.276 0 0 0 1.26-1.078l1.758-11.139a1.277 1.277 0 0 1 1.261-1.078h3.926c6.183 0 11.428-4.51 12.388-10.622.68-4.338-1.504-8.286-5.238-10.243-.01.462-.05.923-.121 1.38-.959 6.11-6.206 10.621-12.387 10.621h-6.145a1.278 1.278 0 0 0-1.261 1.079"></path><path fill="#003087" d="M10.797 37.456h-7.76a1.037 1.037 0 0 1-1.024-1.2L7.245 3.078A1.277 1.277 0 0 1 8.506 2h13.336c6.313 0 10.904 4.594 10.797 10.159-1.571-.824-3.417-1.295-5.439-1.295H16.082a1.277 1.277 0 0 0-1.262 1.078l-2.094 13.296-1.93 12.218z"></path></svg></div><div class="ppcp-merchant"><span class="ppcp-merchant-info"><span class="ppcp-merchant-name">Subscription</span><span class="ppcp-merchant-sub">Recurring payment</span></span><span class="ppcp-total">'+c(s)+'</span></div><p class="ppcp-paywith">'+m+'</p><p class="ppcp-hint">By continuing you agree to the cancellation &amp; refund policy. You can cancel your subscription at any time.</p><label class="ppcp-vault"><input type="checkbox" id="tva-paypal-sub-consent-check" name="tva_paypal_sub_consent"><span>'+u+'</span></label><button type="button" id="tva-paypal-sub-continue" class="ppcp-pay" disabled>Continue to PayPal</button><div id="tva-paypal-sub-error" class="ppcp-error" role="alert" style="display:none;"></div><p class="ppcp-cancel"><a href="#" id="tva-paypal-sub-cancel">Cancel</a></p></div><div class="ppcp-footer"><span>&#128274; Secured by PayPal</span><span>Terms &middot; Privacy</span></div></div></div>';function h(){o("#tva-paypal-sub-consent").removeClass("ppcp-show"),setTimeout((function(){o("#tva-paypal-sub-consent").remove()}),300),o(document).off("keydown.tva-paypal-sub")}o("body").append(f),o("#tva-paypal-checkout-css").length||void 0===d||o('<style id="tva-paypal-checkout-css">'+d+"</style>").appendTo("head"),setTimeout((function(){o("#tva-paypal-sub-consent").addClass("ppcp-show")}),10);const v=o("#tva-paypal-sub-consent-check"),y=o("#tva-paypal-sub-continue"),g=o("#tva-paypal-sub-error");v.on("change",(function(){y.prop("disabled",!this.checked)})),o("#tva-paypal-sub-close").on("click",h),o("#tva-paypal-sub-cancel").on("click",(function(e){e.preventDefault(),h()})),o("#tva-paypal-sub-consent").on("click",(function(e){e.target===this&&h()})),o(document).on("keydown.tva-paypal-sub",(function(e){27===e.keyCode&&h()})),y.on("click",(function(){v.prop("checked")&&(y.prop("disabled",!0).text("Redirecting…"),g.hide().text(""),o.ajax({type:"POST",url:e.routes.paypal+"/subscriptions/checkout",headers:{"X-WP-Nonce":e.nonce},data:{product_id:t,return_to:window.location.href.split("?")[0]},success:function(e){if(e&&e.success&&e.payer_action_url)return void(window.location.href=e.payer_action_url);const t=e&&e.message?e.message:"Could not start the subscription. Please try again.";g.text(t).show(),y.prop("disabled",!1).text("Continue to PayPal")},error:function(e){const t=e&&e.responseJSON&&e.responseJSON.message?e.responseJSON.message:"Could not start the subscription. Please try again.";g.text(t).show(),y.prop("disabled",!1).text("Continue to PayPal")}}))}))}(t,a):r("Unable to load subscription details. Please try again.")},error:function(){r("Unable to load subscription details. Please try again.")}})}(a)}}))}))})),e.is_editor_page&&TVE.add_filter("tcb_cloud_template_download",(function(t){return(e.is_checkout||e.is_thankyou||e.is_login)&&(t.action="tva_cloud_templates"),t}))}(jQuery),function(t){var a="tva-cancel-overlay";function n(t){return(window.ThriveAppFront&&e.cancel_subscription||{})[t]||""}function o(e,t,a){e.find(".tva-cancel-modal-text").toggleClass("tva-cancel-error",!!a).text(t)}t(document).on("click",'[data-dynamic-link="tva_paypal_cancel_url"][data-shortcode-id="cancel_subscription"]',(function(r){r.preventDefault();var i,s=(i=this.getAttribute("href")||"")&&"#"!==i?i:"";if(s&&!t("#"+a).length){var c=function(){var e=t("<div>",{id:a,class:"tva-cancel-overlay"}),o=t("<div>",{class:"tva-cancel-modal",role:"dialog","aria-modal":"true"}),r=t("<p>",{class:"tva-cancel-modal-text"}).text(n("confirm")),i=t("<div>",{class:"tva-cancel-modal-actions"}),s=t("<button>",{type:"button",class:"tva-cancel-keep"}).text(n("keep")),c=t("<button>",{type:"button",class:"tva-cancel-confirm"}).text(n("confirm_btn"));return i.append(s,c),o.append(r,i),e.append(o),e}().appendTo("body");window.requestAnimationFrame((function(){c.addClass("tva-cancel-visible")})),t(document).on("keydown",p),c.on("click",".tva-cancel-keep",l),c.on("click",(function(e){e.target===c[0]&&l()})),c.on("click",".tva-cancel-confirm",(function(){!function(a,r){var i=a.find(".tva-cancel-confirm"),s=a.find(".tva-cancel-keep");i.add(s).prop("disabled",!0),i.addClass("tva-cancel-loading"),t.ajax({type:"DELETE",url:r,headers:{"X-WP-Nonce":window.ThriveAppFront&&e.nonce||""}}).done((function(e){e&&e.success?(a.find(".tva-cancel-modal-actions").remove(),o(a,n("success"),!1),window.setTimeout((function(){window.location.reload()}),3e3)):(i.add(s).prop("disabled",!1),i.removeClass("tva-cancel-loading"),o(a,n("error"),!0))})).fail((function(e){i.add(s).prop("disabled",!1),i.removeClass("tva-cancel-loading"),o(a,e&&500===e.status?n("error_retry"):n("error"),!0)}))}(c,s)})),c.find(".tva-cancel-keep").trigger("focus")}function p(e){"Escape"!==e.key&&27!==e.keyCode||l()}function l(){t(document).off("keydown",p),c.remove()}}))}(jQuery)}()}();