whoami7 - Manager
:
/
home
/
dataiclx
/
vielorbe.com
/
wp-content
/
themes
/
botiga
/
assets
/
js
/
Upload File:
files >> //home/dataiclx/vielorbe.com/wp-content/themes/botiga/assets/js/customizer-scripts.min.js
"use strict";jQuery(document).ready(function(t){var e="";t(".botiga-to-widget-area-link").on("click",function(){t(this).closest(".control-section").length&&(e=t(this).closest(".control-section").attr("id").replace("sub-accordion-section-",""))});var i=!1,n=!1,a=!1,r=!1,c=!1,s=!1;t(document).on("mouseover focus",".customize-section-back",function(o){return!!t(".control-section.open").length&&(i=!(!t(".control-section.open").attr("id").indexOf("_hb_")&&!t(".control-section.open").attr("id").indexOf("_fb_")),n=!!t(".control-section.open").hasClass("control-section-botiga-section-hidden"),a="sub-accordion-section-botiga_section_hb_wrapper"===t(".control-section.open").attr("id"),r=-1!==t(".control-section.open").attr("id").indexOf("botiga_section_hb_component_"),c="sub-accordion-section-botiga_section_fb_wrapper"===t(".control-section.open").attr("id"),void(s=-1!==t(".control-section.open").attr("id").indexOf("botiga_section_fb_component_")))}),t(document).on("click keydown",".customize-section-back",function(o){return(!o.keyCode||13===o.keyCode||27===o.keyCode)&&(a&&(wp.customize.section("botiga_section_hb_wrapper").collapse(),setTimeout(function(){wp.customize.panel("botiga_panel_header").collapse()},10)),c&&(wp.customize.section("botiga_section_fb_wrapper").collapse(),setTimeout(function(){wp.customize.panel("botiga_panel_footer").collapse()},10)),i||s||r||!n||""===e||void 0!==wp.customize.section(e)&&wp.customize.section(e).focus(),void(n=s=c=r=a=i=!1))})}),jQuery(document).ready(function(t){t(".control-section-botiga-section-upsell, .control-panel-botiga-panel-upsell").on("click",function(){var o=t(this).data("feature");window.open("https://athemes.com/botiga-upgrade?utm_source=theme_customizer&utm_content="+o+"&utm_medium=botiga_customizer&utm_campaign=Botiga","_blank")})}),jQuery(document).ready(function(o){o(document).on("click",".customize-control-botiga-radio-image label.is-pro",function(o){o.preventDefault()})}),jQuery(document).ready(function(t){t(".botiga-select2").each(function(){var o=t(this).data("select2-options");t(this).select2(o)}),t(".botiga-select2").on("change",function(){t(this).prev().val(t(this).val()).trigger("change")})}),jQuery(document).ready(function(n){function a(o){var t={font:o.find(".google-fonts-list").val(),regularweight:o.find(".google-fonts-regularweight-style").val(),category:o.find(".google-fonts-category").val()};o.find(".customize-control-google-font-selection").val(JSON.stringify(t)).trigger("change")}n(".google-fonts-list").each(function(o,t){n(this).hasClass("select2-hidden-accessible")||n(this).select2()}),n(".google-fonts-list").on("change",function(){var e=n(this).parent().parent().find(".google-fonts-regularweight-style"),i=n(this).val(),o=n(this).attr("control-name");e.empty();var t=_wpCustomizeSettings.controls[o],o=n.map(t.botigafontslist,function(o,t){if(o.family===i)return t})[0];n.each(t.botigafontslist[o].variants,function(o,t){e.append(n("<option></option>").val(t).html(t)),0<n(e).find('option[value="regular"]').length?n(e).val("regular"):0<n(e).find('option[value="400"]').length?n(e).val("400"):0<n(e).find('option[value="300"]').length&&n(e).val("300")}),n(this).parent().parent().find(".google-fonts-category").val(t.botigafontslist[o].category),a(n(this).parent().parent().parent().parent())}),n(".google_fonts_select_control select").on("change",function(){a(n(this).parent().parent().parent().parent())})}),jQuery(document).ready(function(a){function r(o){for(var t=[],e=1;e<=9;e++)t["n"+e]=100*e;return t.hasOwnProperty(o)?t[o]:"400"}a(".adobe-font-family").each(function(o,t){a(this).hasClass("select2-hidden-accessible")||a(this).select2()}),a(".adobe-font-family").on("change",function(){for(var o=a(this).closest(".adobe_fonts_select_control"),t=a(this).val(),e="",i=0;i<botiga_adobe_fonts.length;i++)if(botiga_adobe_fonts[i].css_name==t){e=botiga_adobe_fonts[i].variations;break}o.find(".adobe-font-weight").html("");for(var n=0;n<e.length;n++)-1===e[n].indexOf("i")&&o.find(".adobe-font-weight").append('<option value="'+r(e[n])+'">'+r(e[n])+"</option>");o.find(".customize-control-adobe-font-selection").val(o.find(".adobe-font-family").val()+"|"+o.find(".adobe-font-weight").val()).trigger("change")}),a(".adobe-font-weight").on("change",function(){var o=a(this).closest(".adobe_fonts_select_control");o.find(".customize-control-adobe-font-selection").val(o.find(".adobe-font-family").val()+"|"+o.find(".adobe-font-weight").val()).trigger("change")})}),jQuery(document).ready(function(i){var n=!1;i(".botiga-devices-preview").find("button").on("click",function(o){if(n)return n=!1;n=!0;var t="",t=i(this).hasClass("preview-desktop")?(i(".botiga-devices-preview").find(".preview-desktop").addClass("active"),i(".botiga-devices-preview").find(".preview-tablet").removeClass("active"),i(".botiga-devices-preview").find(".preview-mobile").removeClass("active"),i(".responsive-control-desktop").addClass("active"),i(".responsive-control-tablet").removeClass("active"),i(".responsive-control-mobile").removeClass("active"),i('.wp-full-overlay-footer .devices button[data-device="desktop"]').trigger("click"),"desktop"):i(this).hasClass("preview-tablet")?(i(".botiga-devices-preview").find(".preview-tablet").addClass("active"),i(".botiga-devices-preview").find(".preview-desktop").removeClass("active"),i(".botiga-devices-preview").find(".preview-mobile").removeClass("active"),i(".responsive-control-desktop").removeClass("active"),i(".responsive-control-tablet").addClass("active"),i(".responsive-control-mobile").removeClass("active"),i('.wp-full-overlay-footer .devices button[data-device="tablet"]').trigger("click"),"tablet"):(i(".botiga-devices-preview").find(".preview-mobile").addClass("active"),i(".botiga-devices-preview").find(".preview-desktop").removeClass("active"),i(".botiga-devices-preview").find(".preview-tablet").removeClass("active"),i(".responsive-control-desktop").removeClass("active"),i(".responsive-control-tablet").removeClass("active"),i(".responsive-control-mobile").addClass("active"),i('.wp-full-overlay-footer .devices button[data-device="mobile"]').trigger("click"),i(".responsive-control-tablet.show-mobile").addClass("active"),"mobile"),e=i(this).closest(".customize-control").attr("id").replace("customize-control-","");i(window).trigger("botiga.resp.control.switched",[e,t])}),i(" .wp-full-overlay-footer .devices button ").on("click",function(){if(n)return n=!1;var o=i(this).attr("data-device");i(".control-section.open .botiga-devices-preview").find(".preview-"+o).trigger("click")})}),jQuery(document).ready(function(i){function n(o,t){t='<div class="repeater" style="display:none"><input type="text" value="'+(1<arguments.length&&void 0!==t?t:"")+'" class="repeater-input" placeholder="'+(!!o.find(".botiga-sortable_repeater.sortable").hasClass("regular-field")?"":"https://")+'" /><span class="dashicons dashicons-menu"></span><a class="customize-control-sortable-repeater-delete" href="#"><span class="dashicons dashicons-no-alt"></span></a></div>';o.find(".sortable").append(t),o.find(".sortable").find(".repeater:last").slideDown("slow",function(){i(this).find("input").focus()})}function e(o){var t=o.find(".repeater-input").map(function(){return i(this).val()}).toArray();o.find(".customize-control-sortable-repeater").val(t),o.find(".customize-control-sortable-repeater").trigger("change")}i(".botiga-sortable_repeater_control").each(function(){var o=i(this).find(".customize-control-sortable-repeater").val().split(","),t=o.length;if(0<t&&(i(this).find(".repeater-input").val(o[0]),1<t))for(var e=1;e<t;++e)n(i(this),o[e])}),i(this).find(".botiga-sortable_repeater.sortable").sortable({update:function(o,t){e(i(this).parent())}}),i(".botiga-sortable_repeater.sortable").on("click",".customize-control-sortable-repeater-delete",function(o){o.preventDefault(),1<i(this).parent().parent().find(".repeater").length?i(this).parent().slideUp("fast",function(){var o=i(this).parent().parent();i(this).remove(),e(o)}):(i(this).parent().find(".repeater-input").val(""),e(i(this).parent().parent().parent()))}),i(".customize-control-sortable-repeater-add").click(function(o){o.preventDefault(),n(i(this).parent()),e(i(this).parent())}),i(".botiga-sortable_repeater.sortable").change(function(){e(i(this).parent())}),i(".botiga-sortable_repeater.sortable:not(.regular-field)").on("blur",".repeater-input",function(){var o=i(this),t=o.val();t&&!t.match(/^.+:\/\/.*/)&&o.val("https://"+t).trigger("change")})}),jQuery(document).ready(function(i){i(".customize-control-botiga-tab-control").each(function(){var o=i(this).find(".control-tab-design").data("connected"),e=i(this).find(".control-tab-general").data("connected");i.each(e,function(o,t){0===o&&i(this).addClass("botiga-tab-control-item-first"),o===e.length-1&&i(this).addClass("botiga-tab-control-item-last")}),i.each(o,function(o,t){i(this).addClass("botiga-hide-control")}),i(this).find(".control-tab").on("click",function(){var o=i(this),t=o.siblings(),e=o.data("connected");o.addClass("active"),t.removeClass("active"),i.each(e,function(o,t){0===o&&i(this).addClass("botiga-tab-control-item-first"),o===e.length-1&&i(this).addClass("botiga-tab-control-item-last"),i(this).removeClass("botiga-hide-control")}),t.each(function(){var e=i(this).data("connected");i.each(e,function(o,t){0===o&&i(this).removeClass("botiga-tab-control-item-first"),o===e.length-1&&i(this).removeClass("botiga-tab-control-item-last"),i(this).addClass("botiga-hide-control")})})})})}),jQuery(document).ready(function(e){e(".customize-control-tinymce-editor").each(function(){var o=_wpCustomizeSettings.controls[e(this).attr("id")].botigatb1,t=_wpCustomizeSettings.controls[e(this).attr("id")].botigatb2;_wpCustomizeSettings.controls[e(this).attr("id")].botigatmb;wp.editor.initialize(e(this).attr("id"),{tinymce:{wpautop:!1,toolbar1:o,toolbar2:t},quicktags:!0,mediaButtons:!0})}),e(document).on("tinymce-editor-init",function(o,t){t.on("change",function(o){tinyMCE.triggerSave(),e("#"+t.id).trigger("change")})})}),jQuery(document).ready(function(t){function o(o){"col3"===t(o).val()||"col3-bigleft"===t(o).val()||"col3-bigright"===t(o).val()?(t(".footer-widget-area-link-1, .footer-widget-area-link-2, .footer-widget-area-link-3").show(),t(".footer-widget-area-link-4").hide()):"col4"===t(o).val()||"col4-bigleft"===t(o).val()||"col4-bigright"===t(o).val()?t(".footer-widget-area-link-1, .footer-widget-area-link-2, .footer-widget-area-link-3, .footer-widget-area-link-4").show():"col2"===t(o).val()||"col2-bigleft"===t(o).val()||"col2-bigright"===t(o).val()?(t(".footer-widget-area-link-1, .footer-widget-area-link-2").show(),t(".footer-widget-area-link-4, .footer-widget-area-link-3").hide()):"col1"===t(o).val()?(t(".footer-widget-area-link-1").show(),t(".footer-widget-area-link-4, .footer-widget-area-link-2, .footer-widget-area-link-3").hide()):t(".footer-widget-area-link-1, .footer-widget-area-link-2, .footer-widget-area-link-3, .footer-widget-area-link-4").hide()}o(t("#customize-control-footer_widgets").find("input:checked")),t("#customize-control-footer_widgets").find("input").change(function(){o(t(this))})});var botigaChangeElementColors=function(o,t,e){var i,n=jQuery('[data-control-id="'+o+'"]');n.length?(e&&(i=e.indexOf(t),e[i]&&(t=e[i])),(i=n.find(".botiga-color-picker")).data("pickr")?i.data("pickr").setColor(t):(i.css("background-color",t),wp.customize(o).set(t))):(n=jQuery("#customize-control-"+o)).length&&((i=n.find(".botiga-color-picker")).data("pickr")?i.data("pickr").setColor(t):(i.css("background-color",t),wp.customize(o).set(t)))};wp.customize("color_palettes",function(o){var j=jQuery("#customize-control-color_palettes").find(".radio-buttons").data("palettes");o.bind(function(o){if(""!==o){for(var i=o,t=0,e=["custom_color1","scrolltop_bg_color","button_background_color","button_border_color","color_link_default","footer_credits_links_color","single_product_tabs_border_color_active","single_product_tabs_text_color_active","single_product_tabs_text_color","shop_archive_header_button_color","shop_archive_header_button_border_color","ql_item_bg_hover"];t<e.length;t++){var n=e[t];void 0!==wp.customize(n)&&botigaChangeElementColors(n,j[i][0],j[i])}for(var a=0,r=["custom_color2","footer_widgets_links_hover_color","scrolltop_bg_color_hover","button_background_color_hover","button_border_color_hover","color_link_hover","footer_credits_links_color_hover","shop_archive_header_button_background_color_hover","shop_archive_header_button_border_color_hover","main_header_sticky_active_color_hover","main_header_color_hover","main_header_sticky_active_submenu_color_hover","main_header_submenu_color_hover","ql_item_color_hover"];a<r.length;a++){var c=r[a];void 0!==wp.customize(c)&&botigaChangeElementColors(c,j[i][1],j[i])}for(var s=0,l=["single_post_title_color","custom_color3","main_header_submenu_color","main_header_sticky_active_submenu_color","offcanvas_menu_color","mobile_header_color","footer_widgets_title_color","single_product_title_color","color_forms_text","shop_product_product_title","loop_post_meta_color","loop_post_title_color","main_header_color","main_header_sticky_active_color","site_title_color","site_description_color","color_heading_1","color_heading_2","color_heading_3","color_heading_4","color_heading_5","color_heading_6","shop_archive_header_title_color","shop_archive_header_description_color","bhfb_search_icon_color","bhfb_woo_icons_color","bhfb_contact_info_icon_color","ql_item_color"];s<l.length;s++){var d=l[s];void 0!==wp.customize(d)&&botigaChangeElementColors(d,j[i][2],j[i])}for(var _=0,u=["custom_color4","footer_widgets_links_color","footer_widgets_text_color","color_body_text","footer_credits_text_color","color_forms_placeholder","topbar_color","main_header_bottom_color","single_sticky_add_to_cart_style_color_content","loop_post_text_color"];_<u.length;_++){var g=u[_];void 0!==wp.customize(g)&&botigaChangeElementColors(g,j[i][3],j[i])}for(var f=0,p=["custom_color5","color_forms_borders","single_product_tabs_remaining_borders","single_sticky_add_to_cart_style_color_border","botiga_header_row__above_header_row_border_bottom_color","botiga_header_row__main_header_row_border_bottom_color","botiga_header_row__below_header_row_border_bottom_color","botiga_footer_row__above_footer_row_border_top_color","botiga_footer_row__main_footer_row_border_top_color","botiga_footer_row__below_footer_row_border_top_color","ql_item_border_color"];f<p.length;f++){var b=p[f];void 0!==wp.customize(b)&&botigaChangeElementColors(b,j[i][4],j[i])}for(var m=0,h=["custom_color6","footer_widgets_background","footer_credits_background","content_cards_background","single_product_tabs_background_color","single_product_tabs_background_color_active","single_product_gallery_styles_background_color","single_sticky_add_to_cart_style_color_background","botiga_footer_row__above_footer_row_background_color","botiga_footer_row__main_footer_row_background_color","botiga_footer_row__below_footer_row_background_color","ql_background_color"];m<h.length;m++){var v=h[m];void 0!==wp.customize(v)&&botigaChangeElementColors(v,j[i][5],j[i])}for(var w=0,k=["custom_color7","background_color","button_color","button_color_hover","scrolltop_color","scrolltop_color_hover","color_forms_background","topbar_background","single_product_reviews_advanced_section_bg_color"];w<k.length;w++){var y=k[w];void 0!==wp.customize(y)&&botigaChangeElementColors(y,j[i][6],j[i])}for(var C=0,z=["custom_color8","main_header_submenu_background","main_header_sticky_active_submenu_background_color","main_header_background","main_header_sticky_active_background","main_header_bottom_background","mobile_header_background","offcanvas_menu_background","shop_archive_header_background_color","shop_archive_header_button_background_color","shop_archive_header_button_color_hover","botiga_header_row__above_header_row_background_color","botiga_header_row__main_header_row_background_color","botiga_header_row__below_header_row_background_color","login_register_submenu_background"];C<z.length;C++){var x=z[C];void 0!==wp.customize(x)&&botigaChangeElementColors(x,j[i][7],j[i])}o=jQuery("#customize-control-custom_palette");!o.length||(o=o.find(".botiga-color-control")).length&&o.each(function(o){var t=jQuery(this),e=t.find(".botiga-color-picker"),t=t.find(".botiga-color-input"),o=j[i][o];t.attr("value",o),e.css("background-color",o)})}})}),wp.customize.bind("ready",function(){wp.customize("custom_color1",function(o){o.bind(function(o){for(var t=0,e=["scrolltop_bg_color","button_background_color","button_border_color","color_link_default","footer_credits_links_color","single_product_tabs_border_color_active","single_product_tabs_text_color_active","single_product_tabs_text_color","shop_archive_header_button_color","shop_archive_header_button_border_color","ql_item_bg_hover"];t<e.length;t++){var i=e[t];void 0!==wp.customize(i)&&botigaChangeElementColors(i,o)}})}),wp.customize("custom_color2",function(o){o.bind(function(o){for(var t=0,e=["footer_widgets_links_hover_color","scrolltop_bg_color_hover","button_background_color_hover","button_border_color_hover","color_link_hover","footer_credits_links_color_hover","shop_archive_header_button_background_color_hover","shop_archive_header_button_border_color_hover","main_header_sticky_active_color_hover","main_header_color_hover","main_header_sticky_active_submenu_color_hover","main_header_submenu_color_hover","ql_item_color_hover"];t<e.length;t++){var i=e[t];void 0!==wp.customize(i)&&botigaChangeElementColors(i,o)}})}),wp.customize("custom_color3",function(o){o.bind(function(o){for(var t=0,e=["single_post_title_color","main_header_submenu_color","main_header_sticky_active_submenu_color","offcanvas_menu_color","mobile_header_color","footer_widgets_title_color","single_product_title_color","color_forms_text","shop_product_product_title","loop_post_meta_color","loop_post_title_color","main_header_color","main_header_sticky_active_color","site_title_color","site_description_color","color_heading_1","color_heading_2","color_heading_3","color_heading_4","color_heading_5","color_heading_6","shop_archive_header_title_color","shop_archive_header_description_color","bhfb_search_icon_color","bhfb_woo_icons_color","bhfb_contact_info_icon_color","ql_item_color"];t<e.length;t++){var i=e[t];void 0!==wp.customize(i)&&botigaChangeElementColors(i,o)}})}),wp.customize("custom_color4",function(o){o.bind(function(o){for(var t=0,e=["footer_widgets_links_color","footer_widgets_text_color","color_body_text","footer_credits_text_color","color_forms_placeholder","topbar_color","main_header_bottom_color","single_sticky_add_to_cart_style_color_content","loop_post_text_color"];t<e.length;t++){var i=e[t];void 0!==wp.customize(i)&&botigaChangeElementColors(i,o)}})}),wp.customize("custom_color5",function(o){o.bind(function(o){for(var t=0,e=["color_forms_borders","single_product_tabs_remaining_borders","single_sticky_add_to_cart_style_color_border","botiga_header_row__above_header_row_border_bottom_color","botiga_header_row__main_header_row_border_bottom_color","botiga_header_row__below_header_row_border_bottom_color","botiga_footer_row__above_footer_row_border_top_color","botiga_footer_row__main_footer_row_border_top_color","botiga_footer_row__below_footer_row_border_top_color","ql_item_border_color"];t<e.length;t++){var i=e[t];void 0!==wp.customize(i)&&botigaChangeElementColors(i,o)}})}),wp.customize("custom_color6",function(o){o.bind(function(o){for(var t=0,e=["footer_widgets_background","footer_credits_background","content_cards_background","single_product_tabs_background_color","single_product_tabs_background_color_active","single_product_gallery_styles_background_color","single_sticky_add_to_cart_style_color_background","botiga_footer_row__above_footer_row_background_color","botiga_footer_row__main_footer_row_background_color","botiga_footer_row__below_footer_row_background_color","ql_background_color"];t<e.length;t++){var i=e[t];void 0!==wp.customize(i)&&botigaChangeElementColors(i,o)}})}),wp.customize("custom_color7",function(o){o.bind(function(o){for(var t=0,e=["background_color","button_color","button_color_hover","scrolltop_color","scrolltop_color_hover","color_forms_background","topbar_background","single_product_reviews_advanced_section_bg_color"];t<e.length;t++){var i=e[t];void 0!==wp.customize(i)&&botigaChangeElementColors(i,o)}})}),wp.customize("custom_color8",function(o){o.bind(function(o){for(var t=0,e=["main_header_submenu_background","main_header_sticky_active_submenu_background_color","main_header_background","main_header_sticky_active_background","main_header_bottom_background","mobile_header_background","offcanvas_menu_background","shop_archive_header_background_color","shop_archive_header_button_background_color","shop_archive_header_button_color_hover","botiga_header_row__above_header_row_background_color","botiga_header_row__main_header_row_background_color","botiga_header_row__below_header_row_background_color","login_register_submenu_background"];t<e.length;t++){var i=e[t];void 0!==wp.customize(i)&&botigaChangeElementColors(i,o)}})})}),wp.customize.bind("ready",function(){wp.customize.control("custom_palette",function(t){wp.customize("custom_palette_toggle").bind(function(o){t.active.set(o)})})}),jQuery(document).ready(function(o){var t=o(".saved-palette");o(".saved-palette").on("click",function(){o(".palette-radio-buttons").toggleClass("open")}),o(".palette-radio-buttons").find(".palette").on("click",function(){t.empty(),o(".palette-radio-buttons").removeClass("open"),o(this).parent().clone().unwrap().appendTo(t).find("input").remove()})}),function(a){var t={init:function(){this.firstTime=!0,this.initialized||this.events(),this.initialized=!0},events:function(){var e=this;return a(document).on("click",".botiga-accordion-title",function(o){o.preventDefault();var t=a(this);a(this).hasClass("expanded")&&(e.showOrHide(a(this),"hide"),a(this).removeClass("expanded").addClass("collapse"),setTimeout(function(){t.removeClass("collapse")},300)),a(this).hasClass("collapse")||(a(".botiga-accordion-item").addClass("botiga-accordion-hide"),a(".botiga-accordion-title").removeClass("expanded"),e.showOrHide(a(this),"show"),t.addClass("expanded"))}),a(document).on("click",".control-section",function(o){var t=a(".control-section.open");e.firstTime&&t.find(".botiga-accordion-title").length&&(t.find(".botiga-accordion-title").each(function(){e.showOrHide(a(this),"hide"),a(this).removeClass("expanded")}),setTimeout(function(){e.firstTime=!1},300))}),a(document).on("click",".customize-section-back",function(){e.firstTime=!0}),this},showOrHide:function(o,t){var e="",i=[];if((e=o.closest(".customize-control").next()).attr("id")=="customize-control-"+o.data("until"))i.push(e[0].id);else for(;e.attr("id")!="customize-control-"+o.data("until");)i.push(e[0].id),e=e.next();1<=i.length&&i.push(e[0].id);for(var n=0;n<i.length;n++)a("#"+i[n]).addClass("botiga-accordion-item active"),"hide"==t?a("#"+i[n]).addClass("botiga-accordion-hide"):a("#"+i[n]).removeClass("botiga-accordion-hide"),0==n&&a("#"+i[n]).addClass("botiga-accordion-first-item"),(n==i.length-1&&1<i.length||1==i.length)&&a("#"+i[n]).addClass("botiga-accordion-last-item");return this},focusAccordionOpenControl:function(){var o=this,t=document.location.search.split("&");t.shift();var e=t.join("&"),e=o.getQueryParams(e);return a(".control-section.open").get(0)?(o.firstTime=!1,a(".control-section.open").find(".botiga-accordion-title").trigger("click"),void(void 0!==e.control&&a(".control-section.open").find("#"+e.control+" > a").trigger("click"))):(setTimeout(function(){o.focusAccordionOpenControl()},300),this)},getQueryParams:function(o){o=o.split("+").join(" ");for(var t,e={},i=/[?&]?([^=]+)=([^&]*)/g;t=i.exec(o);)e[decodeURIComponent(t[1])]=decodeURIComponent(t[2]);return e}};a(document).ready(function(o){t.init()}),0<window.location.href.indexOf("?autofocus")&&wp.customize.bind("ready",function(){t.focusAccordionOpenControl()})}(jQuery),jQuery(document).ready(function(e){e(document).on("click","a[data-goto]",function(o){o.preventDefault();var t=e(this).data("type"),o=e(this).data("goto");"section"===t?wp.customize.section(o).focus():"panel"===t&&wp.customize.panel(o).focus()})}),jQuery(document).ready(function(l){l(document).on("click",".botiga-create-page-control-button",function(o){o.preventDefault();var t=l(this),e=t.parent().find(".botiga-create-page-control-create-message"),i=t.parent().find(".botiga-create-page-control-success-message"),n=(t.text(),t.data("creating-text")),a=(t.data("created-text"),t.data("page-title")),r=t.data("page-meta-key"),c=t.data("page-meta-value"),s=t.data("option-name"),o=t.data("nonce");if(!a)return!1;l(this).text(n),l(this).attr("disabled",!0),l.ajax({type:"post",url:ajaxurl,data:{action:"botiga_create_page_control",page_title:a,page_meta_key:r,page_meta_value:c,option_name:s,nonce:o},success:function(o){"success"===o.status&&(o=i.find("a").attr("href").replace("?post=&","?post="+o.page_id+"&"),i.find("a").attr("href",o),i.css("display","block"),e.remove(),t.remove())}})})}),jQuery(document).ready(function(n){n(document).on("click",".botiga-adobe_fonts_kits_submit_token",function(o){o.preventDefault();var t=n(this),e=n("#adobe_fonts_kits_generator").val(),i=n(".botiga-adobe_fonts_kits_ajax_wrapper"),o=t.data("nonce");n(this).text(t.data("loading-text")),n(this).attr("disabled",!0),n.ajax({type:"post",url:ajaxurl,data:{action:"botiga_typography_adobe_kits_control",token:e,nonce:o},success:function(o){i.html(o.output),t.text(t.data("default-text")),t.attr("disabled",!1),"success"===o.status&&null!==o.output&&(wp.customize.bind("saved",function(){var o=n(".botiga-adobe_fonts_kits_wrapper-item .reload-message a").attr("href");window.location.href=o}),n("#customize-save-button-wrapper > .save").trigger("click"))}})}),n(document).on("click",".botiga-adobe_fonts_kit_onoff",function(o){o.preventDefault();var t=n(this),e=t.data("kit"),o=t.data("nonce");n(this).text(t.data("loading-text")),n(this).attr("disabled",!0),n.ajax({type:"post",url:ajaxurl,data:{action:"botiga_typography_adobe_kits_control_enable_disable",kit:e,nonce:o},success:function(o){o.kit_enabled?(t.text(t.data("disable-text")),t.closest(".botiga-adobe_fonts_kits_wrapper-item").removeClass("disabled")):(t.text(t.data("enable-text")),t.closest(".botiga-adobe_fonts_kits_wrapper-item").addClass("disabled")),t.closest(".botiga-adobe_fonts_kits_wrapper-item").find(".reload-message").addClass("show"),t.attr("disabled",!1)}})})}),jQuery(document).ready(function(t){var e="";t(document).on("mouseover focus",".customize-section-back",function(o){e=t(".control-section.open").attr("id")}),t(document).on("click keydown",".customize-section-back",function(o){if(-1!==e.indexOf("side_mini_cart_floating_icon_section")&&void 0!==wp.customize.section("botiga_section_shop_cart"))return wp.customize.section("botiga_section_shop_cart").focus(),!1})}),jQuery(document).ready(function(c){c(document).on("botiga-display-conditions-select2-initalize",function(o,t){var e=c(t),i=(e.closest(".botiga-display-conditions-control"),e.find(".botiga-display-conditions-select2-type")),t=i.find("select"),n=e.find(".botiga-display-conditions-select2-condition").find("select"),a=e.find(".botiga-display-conditions-select2-id"),r=a.find("select");t.select2({width:"100%",minimumResultsForSearch:-1}),t.on("select2:select",function(o){i.attr("data-type",o.params.data.id)}),n.select2({width:"100%"}),n.on("select2:select",function(o){c(o.params.data.element).data("ajax")?a.removeClass("hidden"):a.addClass("hidden"),r.val(null).trigger("change")}),n.find(":selected").data("ajax")&&a.removeClass("hidden"),r.select2({width:"100%",placeholder:"",allowClear:!0,minimumInputLength:1,ajax:{url:ajaxurl,dataType:"json",delay:250,cache:!0,data:function(o){return{action:"botiga_display_conditions_select_ajax",term:o.term,nonce:ajax_object.ajax_nonce,source:n.val()}},processResults:function(o,t){return o.success?{results:o.data}:{}}}})}),c(document).on("click",".botiga-display-conditions-modal-toggle",function(o){o.preventDefault();var t=c(this),e=wp.template("botiga-display-conditions-template"),o=t.closest(".botiga-display-conditions-control"),t=o.find(".botiga-display-conditions-modal");t.data("initialized")?t.toggleClass("open"):(o.append(e(o.data("condition-settings"))),(e=o.find(".botiga-display-conditions-modal-content-list-item").not(".hidden")).length&&e.each(function(){c(document).trigger("botiga-display-conditions-select2-initalize",this)}),(t=o.find(".botiga-display-conditions-modal")).data("initialized",!0),t.addClass("open"))}),c(document).on("click",".botiga-display-conditions-modal",function(o){o.preventDefault();var t=c(this);c(o.target).is(t)&&t.removeClass("open")}),c(document).on("click",".botiga-display-conditions-modal-add",function(o){o.preventDefault();var t=c(this),e=t.closest(".botiga-display-conditions-control").find(".botiga-display-conditions-modal"),o=e.find(".botiga-display-conditions-modal-content-list"),e=e.find(".botiga-display-conditions-modal-content-list-item").first().clone(),t=t.data("condition-group");e.removeClass("hidden"),e.find(".botiga-display-conditions-select2-condition").not('[data-condition-group="'+t+'"]').remove(),o.append(e),c(document).trigger("botiga-display-conditions-select2-initalize",e)}),c(document).on("click",".botiga-display-conditions-modal-remove",function(o){o.preventDefault(),c(this).closest(".botiga-display-conditions-modal-content-list-item").remove()}),c(document).on("click",".botiga-display-conditions-modal-save",function(o){o.preventDefault();var t=[],e=c(this).closest(".botiga-display-conditions-control"),o=e.find(".botiga-display-conditions-modal"),e=e.find(".botiga-display-conditions-textarea");o.find(".botiga-display-conditions-modal-content-list-item").not(".hidden").each(function(){var o=c(this);t.push({type:o.find('select[name="type"]').val(),condition:o.find('select[name="condition"]').val(),id:o.find('select[name="id"]').val()})}),e.val(JSON.stringify(t)).trigger("change")})}),jQuery(document).ready(function(n){n(document).on("botiga-custom-sidebar-update",function(o,t){o.preventDefault();var e=[],o=n(t),t=o.find(".botiga-custom-sidebar-textarea");o.find(".botiga-custom-sidebar-list-item").not(".hidden").each(function(){var o=n(this),t=o.find('input[name="sidebar_name"]').val(),o=(o=o.find('textarea[name="sidebar_conditions"]').val())&&JSON.parse(o);t&&e.push({name:t,conditions:o})}),t.val(JSON.stringify(e)).trigger("change")}),n(".botiga-custom-sidebars-control").each(function(){var o=n(this);o.find(".botiga-custom-sidebar-list").sortable({axis:"y",update:function(){n(document).trigger("botiga-custom-sidebar-update",[o])}})}),n(document).on("change",".botiga-custom-sidebar-name, .botiga-custom-sidebar-conditions",function(o){var t=n(this).closest(".botiga-custom-sidebars-control");n(document).trigger("botiga-custom-sidebar-update",[t])}),n(document).on("click",".botiga-custom-sidebar-remove",function(o){var t=n(this),e=t.closest(".botiga-custom-sidebars-control"),i=e.find(".botiga-custom-sidebar-list-item").not(".hidden");t.closest(".botiga-custom-sidebar-list-item").remove(),1===i.length&&(t=e.find(".botiga-custom-sidebar-list"),(i=e.find(".botiga-custom-sidebar-list-item").first().clone()).removeClass("hidden"),t.append(i)),n(document).trigger("botiga-custom-sidebar-update",[e])}),n(document).on("click",".botiga-custom-sidebar-add",function(o){var t=n(this).closest(".botiga-custom-sidebars-control"),e=t.find(".botiga-custom-sidebar-list"),i=t.find(".botiga-custom-sidebar-list-item").first().clone();i.removeClass("hidden"),e.append(i),n(document).trigger("botiga-custom-sidebar-update",[t])}),n(document).on("click",".botiga-custom-sidebar-condition",function(o){n(this).closest(".botiga-custom-sidebar-list-item")})}),jQuery(document).ready(function(d){var e=d(".botiga-typography-custom-select");e.length&&e.each(function(){var n=d(this);n.select2(),n.on("change",function(){var e=d(this).val(),o=_wpCustomizeSettings.controls[n.data("control-name")],t=d.map(o.google_fonts,function(o,t){if(o.family===e)return o.variants}),o=n.parent().find(".botiga-typography-custom-weight-select-wrapper"),i=o.find(".botiga-typography-custom-weight-select");i.empty(),t.length?(o.show(),d.each(t,function(o,t){i.append('<option name="'+t+'">'+t+"</option>")}),i.trigger("change")):o.hide()})}),d(document).on("botiga-custom-font-update",function(o,t){o.preventDefault();var l=[],o=d(t),t=o.find(".botiga-custom-font-textarea");o.find(".botiga-custom-font-item").not(".hidden").each(function(){var o,t=d(this),e=t.find('input[name="name"]').val(),i=t.find('input[name="woff2"]').val(),n=t.find('input[name="woff"]').val(),a=t.find('input[name="ttf"]').val(),r=t.find('input[name="eot"]').val(),c=t.find('input[name="otf"]').val(),s=t.find('input[name="svg"]').val();e&&(i||n||a||r||c||s)&&(l.push({name:e,woff2:i,woff:n,ttf:a,eot:r,otf:c,svg:s}),o=e.replace(/ /g,"-").toLowerCase(),d("#"+o).length&&d("#"+o).remove(),t=[],i&&t.push('url("'+i+'") format("woff2");'),n&&t.push('url("'+n+'") format("woff");'),s&&t.push('url("'+s+'") format("svg");'),a&&t.push('url("'+a+'") format("truetype");'),c&&t.push('url("'+c+'") format("opentype");'),r&&t.push('url("'+r+'?#iefix") format("embedded-opentype");'),t.length&&(c="",c+='@font-face{ font-family: "'+e+'";',r&&(c+="src: url("+r+");"),c+="src: "+t.join(",")+";",c+="}",d("head").append('<style id="'+o+'" type="text/css">'+c+"</style>")))}),t.val(JSON.stringify(l)).trigger("change"),e.length&&e.each(function(){var o=d(this);o.find("optgroup").each(function(){var i,n=d(this);"custom-fonts"===n.data("type")&&(i=wp.customize.control(o.data("control-name")).settings["font-family"].get(),n.empty(),d.each(l,function(o,t){var e=t.name===i?' selected="selected"':"";n.append('<option name="'+t.name+'"'+e+">"+t.name+"</option>")}))}),o.select2("destroy"),o.select2()})}),d(document).on("change",".botiga-custom-font-item-input",function(o){var t=d(this).closest(".botiga-custom-fonts-control");d(document).trigger("botiga-custom-font-update",[t])}),d(document).on("click",".botiga-custom-font-upload",function(o){o.preventDefault();var t=d(this),e=window.wp.media({library:{type:t.data("type")||"image"}}).open();e.on("select",function(){var o=e.state().get("selection").first().toJSON();t.prev(".botiga-custom-font-item-input").val(o.url).trigger("change")})}),d(document).on("click",".botiga-custom-font-add",function(o){var t=d(this).closest(".botiga-custom-fonts-control"),e=t.find(".botiga-custom-font-items"),i=t.find(".botiga-custom-font-item").first().clone();i.removeClass("hidden"),e.append(i),d(document).trigger("botiga-custom-font-update",[t])}),d(document).on("click",".botiga-custom-font-remove",function(o){var t=d(this),e=t.closest(".botiga-custom-font-item"),t=t.closest(".botiga-custom-fonts-control");e.remove(),d(document).trigger("botiga-custom-font-update",[t])})}),jQuery(document).ready(function(i){i(".range-slider__range").on("change input botiga.range",function(){var o=i(this),t=o.val()||0,e=o.attr("min")||0,e=(t-e)/((o.attr("max")||1)-e)*100;o.css({background:"linear-gradient(to right, #3858E9 0%, #3858E9 "+e+"%, #ddd "+e+"%, #ddd 100%)"})}).trigger("botiga.range"),i(".range-slider__value").on("change input",function(){var o=i(this).prev();o.hasClass("range-slider__range")&&o.trigger("botiga.range")})}),jQuery(document).ready(function(s){var o=s(".botiga-typography-preview");o.length&&o.each(function(o){var c=s(this),t=c.data("options");s.each(t,function(t,r){var e;"google_font"===t?wp.customize(r,function(o){o.bind(function(o){var t=(o=s.parseJSON(o)).font||"",e=o.regularweight||400,i=t.replace(/ /g,"-").toLowerCase()+"-"+e,o="https://fonts.googleapis.com/css?family="+t.replace(/ /g,"+")+":"+e+"&display=swap";0===s("#"+i).length&&s("head").append('<link id="'+i+'" href="'+o+'" rel="stylesheet">'),c.css("font-family",t),c.css("font-weight",e)})}):"adobe_font"===t?wp.customize(r,function(o){o.bind(function(o){(o=o.split("|"))[0]&&c.css("font-family",o[0]),o[1]&&c.css("font-weight",o[1].replace("n4","400"))})}):"custom_font"===t?(e=function(o,i){var t=wp.customize.control(r+"_typography"),e=_wpCustomizeSettings.controls[r+"_typography"],n=t.settings["font-family"].get(),a=t.settings["font-weight"].get();c.css("font-weight","normal"),e&&e.google_fonts&&s.map(e.google_fonts,function(o,t){var e;o.family===n&&("family"===i&&(a=o.variants[0]),e=n.replace(/ /g,"-").toLowerCase()+"-"+a,o="https://fonts.googleapis.com/css?family="+n.replace(/ /g,"+")+":"+a+"&display=swap",0===s("#"+e).length&&s("head").append('<link id="'+e+'" href="'+o+'" rel="stylesheet">'),c.css("font-weight",a))}),c.css("font-family",o)},wp.customize(r,function(o){o.bind(function(o){e(o,"family")})}),wp.customize(r+"_weight",function(o){o.bind(function(o){e(o,"weight")})})):wp.customize(r,function(o){o.bind(function(o){""!==o&&isFinite(o)&&(o=Number(o)),c.css(t,o)})})})})}),jQuery(document).ready(function(r){var o=r(".botiga-color-control");o.length&&Pickr&&(Pickr.prototype.setSwatches=function(o){var t=this;if(o.length){for(var e=this._swatchColors.length-1;-1<e;e--)this.removeSwatch(e);o.forEach(function(o){return t.addSwatch(o)})}},o.each(function(){var o,n=r(this),a=n.find(".botiga-color-picker");a.on("click",function(){var t,e,i;o||(t=n.find(".botiga-color-input"),e=wp.customize(t.data("customize-setting-link")),(i=new Pickr({el:a.get(0),container:"body",theme:"botiga",default:t.val()||"#212121",swatches:[],position:"bottom-end",appClass:"botiga-pcr-app",sliders:"h",useAsButton:!0,components:{hue:!0,preview:!0,opacity:!0,interaction:{input:!0,clear:!0}},i18n:{"btn:clear":"Default"}})).on("change",function(o){o=1===o.a?(i.setColorRepresentation("HEX"),o.toHEXA().toString(0)):(i.setColorRepresentation("RGBA"),o.toRGBA().toString(0));a.css({"background-color":o}),t.val(o),e.set(o)}),i.on("show",function(){var o,t;i.setSwatches((o=wp.customize.control("custom_palette_toggle").setting.get(),t=[],o?r("#customize-control-custom_palette .botiga-color-input").each(function(){t.push(r(this).val())}):r("#customize-control-color_palettes .saved-palette .palette-color").each(function(){t.push(r(this).css("background-color"))}),t))}),i.on("clear",function(){var o=a.data("default-color");o?i.setColor(o):(a.css({"background-color":"white"}),t.val(""),e.set(""))}),a.data("pickr",i),setTimeout(function(){i.show()}),o=!0)})}))}),jQuery(document).ready(function(e){e("#customize-control-reset_colors").on("click",function(){var o=e(".palette-radio-buttons").find("label").first(),t=wp.customize("color_palettes");o.trigger("click"),o.find(".palette").trigger("click"),t.set(""),t.set("palette1")})}),function(a){var o={init:function(){this.events()},events:function(){a(".botiga-dimensions-control").find(".botiga-dimensions-input").on("input",this.setDimensionValue.bind(this)),a(".botiga-dimensions-control").find(".botiga-dimensions-unit").on("change",this.unitSelectHandler.bind(this)),a(".botiga-dimensions-control").find(".botiga-dimensions-link-btn").on("click",this.toggleLinkValues.bind(this))},setDimensionValue:function(o){var t=a(o.target).closest(".botiga-dimensions-inputs").find(".botiga-dimensions-value"),o=this.getDimensionValue(o.target);t.val(o).trigger("change")},getDimensionValue:function(o){var t,e=a(o).closest(".botiga-dimensions-inputs").data("device-type"),i=a(o).closest(".botiga-dimensions-inputs").find(".botiga-dimensions-input"),n={unit:"px",linked:!1,top:"",right:"",bottom:"",left:""};return n.unit=a(o).closest(".botiga-dimensions-control").find('.botiga-dimensions-units[data-device-type="'+e+'"] .botiga-dimensions-unit').val(),n.linked=a(o).closest(".botiga-dimensions-control").find('.botiga-dimensions-link-values[data-device-type="'+e+'"]').hasClass("linked"),n.linked?(t=a(o).val(),n.top=t,n.right=t,n.bottom=t,n.left=t,i.each(function(){a(this).val(t)})):i.each(function(){var o=a(this).data("side"),t=a(this).val();n[o]=t}),JSON.stringify(n)},unitSelectHandler:function(o){var t=a(o.target),o=a(o.target).closest(".botiga-dimensions-units").data("device-type");t.closest(".botiga-dimensions-control").find('.botiga-dimensions-inputs[data-device-type="'+o+'"] .botiga-dimensions-input-wrapper:first-child .botiga-dimensions-input').trigger("change")},toggleLinkValues:function(o){o.preventDefault();var t=a(o.target),o=a(o.target).closest(".botiga-dimensions-link-values").data("device-type");t.closest(".botiga-dimensions-link-values").toggleClass("linked"),t.closest(".botiga-dimensions-control").find('.botiga-dimensions-inputs[data-device-type="'+o+'"] .botiga-dimensions-input-wrapper:first-child .botiga-dimensions-input').trigger("change")}};a(document).ready(function(){o.init()})}(jQuery);
Copyright ©2021 || Defacer Indonesia