!function(h){"use strict";function t(){h(".bhfb-row").each(function(){h(this).hasClass("bhfb-is-row-empty")?h(this).parent().parent().addClass("bt-d-none"):h(this).parent().parent().removeClass("bt-d-none")})}wp.customize.bind("preview-ready",function(){h(document).on("click",".bhfb-item-customizer-focus",function(e){if(e.preventDefault(),e.stopPropagation(),h(this).parent().data("section-id"))return window.parent.wp.customize.section(h(this).parent().data("section-id")).focus(),!1;e=h(this).closest(".bhfb-builder-item").data("component-id");let o=".botiga-bhfb-header";h(this).closest(".bhfb-footer").length&&(o=".botiga-bhfb-footer"),(h(this).closest(".bhfb-header").length||h(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(),h(window.parent.document).find(o).addClass("show")}),h("html").on("mouseup",function(){h(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()});h.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,n){wp.customize(o,function(e){e.bind(function(t){if(void 0!==n.cssvariable)return document.querySelector(":root").style.setProperty("--"+o,t+"px"),!1;if(void 0!==n.toggleClass)return h(n.selector).toggleClass(n.toggleClass),!1;if(void 0!==n.addClass)return void 0!==n.removeClass&&("string"==typeof n.removeClass?h(n.selector).removeClass(n.removeClass):h.each(n.removeClass,function(e,o){h(n.selector).removeClass(o)})),h(n.selector).addClass(n.addClass+t),!1;h("head").find("#botiga-customizer-styles-"+o).remove();let i="";"string"==typeof n.prop?i+=n.selector+" { "+n.prop+":"+t+(n.unit||"")+"; }":h.each(n.prop,function(e,o){i+=n.selector+"{ "+o+": "+t+(n.unit||"")+"; }"}),h("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"},botiga_section_hb_component__html_text_align:{selector:".bhfb.bhfb-header .bhfb-component-html",prop:"text-align"},botiga_section_hb_component__html2_text_align:{selector:".bhfb.bhfb-header .bhfb-component-html2",prop:"text-align"},botiga_section_hb_component__shortcode_text_align:{selector:".bhfb.bhfb-header .bhfb-component-shortcode",prop:"text-align"},botiga_section_fb_component__html_text_align:{selector:".bhfb.bhfb-footer .bhfb-component-html",prop:"text-align"},botiga_section_fb_component__html2_text_align:{selector:".bhfb.bhfb-footer .bhfb-component-html2",prop:"text-align"},botiga_section_fb_component__shortcode_text_align:{selector:".bhfb.bhfb-footer .bhfb-component-shortcode",prop:"text-align"}};var o=["header","footer"],n=["above","main","below"],r=["vertical_alignment","inner_layout","horizontal_alignment","elements_spacing"];for(let t=1;t<=6;t++)for(const a of r)for(const _ of o)for(const b of n){let e="botiga_"+_+"_row__"+b+"_"+_+"_row_column"+t+"_"+a,o=".bhfb-"+_+" .bhfb-"+b+"_"+_+"_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")}h.each(i,function(c,f){h.each(e,function(s,l){wp.customize(c+"_"+s,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 n;if(-1===c.indexOf("vertical_alignment")&&-1===c.indexOf("horizontal_alignment")||(n=h(f.selector).css("flex-direction"),t=f.prop,"column"===n&&("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 _=c.replace("inner_layout",a+"_"+s),b=wp.customize(_).get();wp.customize(_).set(""),setTimeout(function(){wp.customize(_).set(b)},1)}-1!==c.indexOf("elements_spacing")&&(r=h(f.selector).parent().css("flex-direction"),t=f.prop,"column"===r?"margin-left"===t&&(t="margin-top",i="margin-left: 0;"):i="margin-top: 0;"),h("head").find("#botiga-customizer-styles-"+c+"_"+s).remove();var r="@media "+l+" {"+f.selector+" { "+(""!==t?t:f.prop)+":"+e+o+";"+i+" } }";h("head").append('")})})})})}(jQuery);