/**
* @package SP Page Builder
* @author JoomShaper http://www.joomshaper.com
* @copyright Copyright (c) 2010 - 2021 JoomShaper
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
*/
jQuery((function(e){e(".sp-pagebuilder-core-options-toggler").on("click",(function(o){o.preventDefault(),e(".sp-pagebuilder-core-options").toggleClass("active")}));var o={};e.fn.openPopupAlt=function(){e("#page-options").addClass("sp-pagebuilder-modal-overlay-after-open"),e("#page-options").addClass("sppb-modal-only-ext"),e("#page-options").find(".sp-pagebuilder-modal-content").addClass("sp-pagebuilder-modal-content-after-open"),e("body").addClass("sp-pagebuilder-modal-open"),e(".sp-pagebuilder-modal-alt .form-group").find(">input,>textarea,>select").each((function(){o[e(this).attr("id")]=e(this).val()}))},e.fn.closePopupAlt=function(t){var a=e.extend({reset:!1},t);return e("#page-options").addClass("sp-pagebuilder-modal-overlay-before-close"),e("#page-options").find(".sp-pagebuilder-modal-content").addClass("sp-pagebuilder-modal-content-before-close"),e("#page-options").removeClass("sp-pagebuilder-modal-overlay-before-close sp-pagebuilder-modal-overlay-after-open"),e("#page-options").find(".sp-pagebuilder-modal-content").removeClass("sp-pagebuilder-modal-content-before-close sp-pagebuilder-modal-content-after-open"),e("body").removeClass("sp-pagebuilder-modal-open"),a.reset&&e(".sp-pagebuilder-modal-alt .form-group").find(">input,>textarea,>select").each((function(){e(this).val(o[e(this).attr("id")]),"jform_og_image"==e(this).attr("id")&&""!=o[e(this).attr("id")]&&e(this).prev(".sppb-media-preview").removeClass("no-image").attr("src",pagebuilder_base+o[e(this).attr("id")])})),this},e(document).on("click","#btn-page-options",(function(o){o.preventDefault(),e().openPopupAlt()})),e(document).on("click",".sp-pagebuilder-modal-alt .sp-pagebuilder-modal-content-after-open",(function(o){o.target===this&&e().closePopupAlt({reset:!0})})),e(document).on("click","#btn-cancel-page-options",(function(o){o.preventDefault(),e().closePopupAlt({reset:!0})})),e(document).on("click","#btn-apply-page-options",(function(o){o.preventDefault(),e().closePopupAlt(),e("#sp-pagebuilder-css",window.frames["sp-pagebuilder-view"].window.document).text(e("#jform_css").val())}))}));