!function(p){"use strict";function t(){p(".bhfb-row").each(function(){p(this).hasClass("bhfb-is-row-empty")?p(this).parent().parent().addClass("bt-d-none"):p(this).parent().parent().removeClass("bt-d-none")})}wp.customize.bind("preview-ready",function(){p(document).on("click",".bhfb-item-customizer-focus",function(e){if(e.preventDefault(),e.stopPropagation(),p(this).parent().data("section-id"))return window.parent.wp.customize.section(p(this).parent().data("section-id")).focus(),!1;e=p(this).closest(".bhfb-builder-item").data("component-id");let o=".botiga-bhfb-header";p(this).closest(".bhfb-footer").length&&(o=".botiga-bhfb-footer"),(p(this).closest(".bhfb-header").length||p(this).closest(".bhfb-mobile_offcanvas").length?window.parent.wp.customize.section("botiga_section_hb_component__"+e):window.parent.wp.customize.section("botiga_section_fb_component__"+e)).focus(),p(window.parent.document).find(o).addClass("show")}),p("html").on("mouseup",function(){p(window.parent.document).find("#botiga-bhfb-elements").removeClass("show")});let o=!1;wp.customize.selectiveRefresh.bind("partial-content-rendered",function(e){o||(botiga.headerSearch.init(),setTimeout(function(){botiga.navigation.init()},500),setTimeout(function(){t()},200),o=!0,setTimeout(function(){o=!1},500))}),t()});p.each({botiga_header_row__above_header_row_border_bottom_desktop:{selector:".bhfb-above_header_row",prop:"border-bottom-width",unit:"px"},botiga_header_row__main_header_row_border_bottom_desktop:{selector:".bhfb-main_header_row",prop:"border-bottom-width",unit:"px"},botiga_header_row__below_header_row_border_bottom_desktop:{selector:".bhfb-below_header_row",prop:"border-bottom-width",unit:"px"},botiga_footer_row__above_footer_row_border_top_desktop:{selector:".bhfb-above_footer_row",prop:"border-top-width",unit:"px"},botiga_footer_row__main_footer_row_border_top_desktop:{selector:".bhfb-main_footer_row",prop:"border-top-width",unit:"px"},botiga_footer_row__below_footer_row_border_top_desktop:{selector:".bhfb-below_footer_row",prop:"border-top-width",unit:"px"},bhfb_mobile_offcanvas_padding:{selector:".bhfb-mobile_offcanvas",prop:"padding",unit:"px"},mobile_menu_elements_spacing:{selector:".bhfb-mobile_offcanvas .bhfb-builder-item + .bhfb-builder-item",prop:"margin-top",unit:"px"},bhfb_mobile_offcanvas_close_offset:{selector:".bhfb-mobile_offcanvas .mobile-menu-close",prop:["top","right"],unit:"px"},link_separator_color:{selector:".botiga-offcanvas-menu .botiga-dropdown ul li",prop:"border-bottom-color"},bhfb_contact_info_display_inline:{selector:".bhfb-component-contact_info .header-contact",toggleClass:"header-contact-inline"}},function(o,r){wp.customize(o,function(e){e.bind(function(t){if(void 0!==r.cssvariable)return document.querySelector(":root").style.setProperty("--"+o,t+"px"),!1;if(void 0!==r.toggleClass)return p(r.selector).toggleClass(r.toggleClass),!1;if(void 0!==r.addClass)return void 0!==r.removeClass&&("string"==typeof r.removeClass?p(r.selector).removeClass(r.removeClass):p.each(r.removeClass,function(e,o){p(r.selector).removeClass(o)})),p(r.selector).addClass(r.addClass+t),!1;p("head").find("#botiga-customizer-styles-"+o).remove();let i="";"string"==typeof r.prop?i+=r.selector+" { "+r.prop+":"+t+(r.unit||"")+"; }":p.each(r.prop,function(e,o){i+=r.selector+"{ "+o+": "+t+(r.unit||"")+"; }"}),p("head").append('")})})});const e={desktop:"(min-width: 992px)",tablet:"(min-width: 576px) and (max-width: 991px)",mobile:"(max-width: 575px)"},i={botiga_header_row__above_header_row_height:{selector:".bhfb-above_header_row",prop:"min-height",unit:"px"},botiga_header_row__main_header_row_height:{selector:".bhfb-main_header_row",prop:"min-height",unit:"px"},botiga_header_row__below_header_row_height:{selector:".bhfb-below_header_row",prop:"min-height",unit:"px"},botiga_footer_row__above_footer_row_height:{selector:".bhfb-above_footer_row",prop:"min-height",unit:"px"},botiga_footer_row__main_footer_row_height:{selector:".bhfb-main_footer_row",prop:"min-height",unit:"px"},botiga_footer_row__below_footer_row_height:{selector:".bhfb-below_footer_row",prop:"min-height",unit:"px"},site_logo_size:{selector:".custom-logo-link img",prop:"width",unit:"px"},botiga_section_hb_component__logo_text_alignment:{selector:".bhfb.bhfb-header .bhfb-component-logo",prop:"text-align"}};var o=["header","footer"],r=["above","main","below"],n=["vertical_alignment","inner_layout","horizontal_alignment","elements_spacing"];for(let t=1;t<=6;t++)for(const a of n)for(const s of o)for(const _ of r){let e="botiga_"+s+"_row__"+_+"_"+s+"_row_column"+t+"_"+a,o=".bhfb-"+s+" .bhfb-"+_+"_"+s+"_row .bhfb-column-"+t;-1!==a.indexOf("elements_spacing")&&(o+=" .bhfb-builder-item + .bhfb-builder-item"),i[e]={selector:o,prop:function(e){if(-1!==e.indexOf("vertical_alignment"))return"align-items";if(-1!==e.indexOf("inner_layout"))return"flex-direction";if(-1!==e.indexOf("horizontal_alignment"))return"justify-content";if(-1!==e.indexOf("elements_spacing"))return"margin-left"}(e)},-1!==a.indexOf("elements_spacing")&&(i[e].unit="px")}p.each(i,function(c,f){p.each(e,function(b,l){wp.customize(c+"_"+b,function(e){e.bind(function(e){let o=void 0!==f.unit?f.unit:"",t="",i="";switch(e){case"top":case"start":e="flex-start";break;case"middle":e="center";break;case"bottom":case"end":e="flex-end";break;case"stack":e="column";break;case"inline":e="row"}var r;if(-1===c.indexOf("vertical_alignment")&&-1===c.indexOf("horizontal_alignment")||(r=p(f.selector).css("flex-direction"),t=f.prop,"column"===r&&("align-items"===t?t="justify-content":"justify-content"===t&&(t="align-items"))),-1!==c.indexOf("inner_layout"))for(const a of["vertical_alignment","horizontal_alignment"]){const s=c.replace("inner_layout",a+"_"+b),_=wp.customize(s).get();wp.customize(s).set(""),setTimeout(function(){wp.customize(s).set(_)},1)}-1!==c.indexOf("elements_spacing")&&(n=p(f.selector).parent().css("flex-direction"),t=f.prop,"column"===n?"margin-left"===t&&(t="margin-top",i="margin-left: 0;"):i="margin-top: 0;"),p("head").find("#botiga-customizer-styles-"+c+"_"+b).remove();var n="@media "+l+" {"+f.selector+" { "+(""!==t?t:f.prop)+":"+e+o+";"+i+" } }";p("head").append('")})})})})}(jQuery);