!function(t){t("#et_pb_old_content"),t("#et_pb_use_builder");const e=t("#et_pb_toggle_builder"),i=t("#et-vb-switch-modal-wrapper"),s=t("#et-vb-confirm-switch"),_=t("#et-vb-cancel-switch"),n=t(".et-fb-app__overlay.wp-block-divi-placeholder"),a=(t("#et_pb_main_editor_wrap"),t("#et_pb_use_the_builder"),t("#et_pb_use_the_builder.is-auto-draft")),o=(t("#et_settings_meta_box").find(".et_pb_page_settings_container").first(),t(".et_pb_toggle_builder_wrapper")),c=t(".et_pb_page_setting"),d=t(".et_pb_page_layout_settings"),l=t("#formatdiv"),r=function(){t.post(classic_editor_settings.ajax_url,{action:"disable_divi_in_classic_editor",post_id:t("#post_ID").val(),nonce:classic_editor_settings.disable_divi_in_classic_editor_nonce}).done((function(t){t.success&&window.location.reload()})).fail((function(){console.error("Failed to deactivate Divi Builder. Please try again."),alert("Failed to deactivate Divi Builder. Please refresh the page and try again.")}))};o.hasClass("et_pb_builder_is_used")&&(()=>{const e=d.closest("#et_settings_meta_box").find(".et_pb_page_layout_settings");if(c.filter(":visible").length>1?(e.hide(),d.find(".et_pb_side_nav_settings").show()):("post"!==classic_editor_settings.post_type&&"no"===classic_editor_settings.is_third_party_post_type&&e.hide(),d.closest("#et_settings_meta_box").find(".et_pb_side_nav_settings").show(),d.closest("#et_settings_meta_box").find(".et_pb_single_title").show()),e.length>0){const t=e.find('option[value="et_full_width_page"]');t.length>0&&t.show()}if(l.length){const e=l.find('input[type="radio"]:checked').val();l.hide(),t(`.et_divi_format_setting.et_divi_${e}_settings`).hide()}"project"===classic_editor_settings.post_type&&d.closest("#et_settings_meta_box").find(".et_pb_project_nav").show()})(),t(window).on("et_fb_disabling_bfb_confirmed",(function(){r()})),e.on("click",(function(e){if(e.preventDefault(),"visual-builder"===t(this).attr("data-editor"))return i.css("display","flex"),s.one("click",(function(t){t.preventDefault(),i.hide(),n.hide(),r()})),void _.one("click",(function(t){t.preventDefault(),i.hide()}))})),a.on("click",(function(e){e.preventDefault();var i=t("#post_ID").val(),s=t("#content").val().trim(),_=t("#title").val().trim(),n=t("#excerpt").val().trim();s||_||n||(t("#title").val("Divi Draft"),t("#title-prompt-text").addClass("screen-reader-text")),t.ajax({url:classic_editor_settings.ajax_url,type:"POST",data:{action:"enable_divi_in_classic_editor",post_id:i,nonce:classic_editor_settings.enable_divi_in_classic_editor_nonce},success:function(t){t.success&&"undefined"!=typeof wp&&void 0!==wp.autosave&&document.getElementById("save-post").click()}})}))}(jQuery),((window.divi=window.divi||{}).scriptLibrary=window.divi.scriptLibrary||{}).scriptLibraryClassicEditor={};