!function(n){jQuery(window).on("load",function(){jQuery("html").addClass("background-colorpicker-ready")}),wp.customize.controlConstructor["ast-background"]=wp.customize.Control.extend({ready:function(){"use strict";this.initAstBgControl()},initAstBgControl:function(){var o=this,t=o.setting._value,e=o.container.find(".ast-color-control");o.container.find(".background-wrapper > .background-repeat").hide(),o.container.find(".background-wrapper > .background-position").hide(),o.container.find(".background-wrapper > .background-size").hide(),o.container.find(".background-wrapper > .background-attachment").hide(),!_.isUndefined(t["background-image"])&&""!==t["background-image"]||o.container.find(".more-settings").hide(),e.wpColorPicker({change:function(){jQuery("html").hasClass("background-colorpicker-ready")&&setTimeout(function(){o.saveValue("background-color",e.val())},100)},clear:function(t){jQuery(t.target).closest(".wp-picker-input-wrap").find(".wp-color-picker")[0]&&o.saveValue("background-color","")}}),o.container.on("change",".background-repeat select",function(){o.saveValue("background-repeat",jQuery(this).val())}),o.container.on("change click",".background-size input",function(){jQuery(this).parent(".buttonset").find(".switch-input").removeAttr("checked"),jQuery(this).attr("checked","checked"),o.saveValue("background-size",jQuery(this).val())}),o.container.on("change",".background-position select",function(){o.saveValue("background-position",jQuery(this).val())}),o.container.on("change click",".background-attachment input",function(){jQuery(this).parent(".buttonset").find(".switch-input").removeAttr("checked"),jQuery(this).attr("checked","checked"),o.saveValue("background-attachment",jQuery(this).val())}),o.container.on("click",".background-image-upload-button, .thumbnail-image img",function(t){var r=wp.media({multiple:!1}).open().on("select",function(){var t,e,n,a=r.state().get("selection").first(),i=a.toJSON().sizes.full.url;_.isUndefined(a.toJSON().sizes.medium)?_.isUndefined(a.toJSON().sizes.thumbnail)||(i=a.toJSON().sizes.thumbnail.url):i=a.toJSON().sizes.medium.url,t=a.toJSON().sizes.full.url,a.toJSON().id,a.toJSON().width,a.toJSON().height,""!==t&&o.container.find(".more-settings").show(),o.saveValue("background-image",t),e=o.container.find(".placeholder, .thumbnail"),n=o.container.find(".background-image-upload-remove-button"),e.length&&e.removeClass().addClass("thumbnail thumbnail-image").html(''),n.length&&n.show()});t.preventDefault()}),o.container.on("click",".background-image-upload-remove-button",function(t){var e,n;t.preventDefault(),o.saveValue("background-image",""),e=o.container.find(".placeholder, .thumbnail"),n=o.container.find(".background-image-upload-remove-button"),o.container.find(".background-wrapper > .background-repeat").hide(),o.container.find(".background-wrapper > .background-position").hide(),o.container.find(".background-wrapper > .background-size").hide(),o.container.find(".background-wrapper > .background-attachment").hide(),o.container.find(".more-settings").attr("data-direction","down"),o.container.find(".more-settings").find(".message").html(astraCustomizerControlBackground.moreSettings),o.container.find(".more-settings").find(".icon").html("↓"),e.length&&e.removeClass().addClass("placeholder").html(astraCustomizerControlBackground.placeholder),n.length&&n.hide()}),o.container.on("click",".more-settings",function(t){o.container.find(".background-wrapper > .background-repeat").toggle(),o.container.find(".background-wrapper > .background-position").toggle(),o.container.find(".background-wrapper > .background-size").toggle(),o.container.find(".background-wrapper > .background-attachment").toggle(),"down"===n(this).attr("data-direction")?(n(this).attr("data-direction","up"),n(this).find(".message").html(astraCustomizerControlBackground.lessSettings),n(this).find(".icon").html("↑")):(n(this).attr("data-direction","down"),n(this).find(".message").html(astraCustomizerControlBackground.moreSettings),n(this).find(".icon").html("↓"))})},saveValue:function(t,e){var n=this,a=jQuery("#customize-control-"+n.id.replace("[","-").replace("]","")+" .background-hidden-value"),i=n.setting._value;i[t]=e,jQuery(a).attr("value",JSON.stringify(i)).trigger("change"),n.setting.set(i)}})}(jQuery),jQuery,wp.customize.controlConstructor["ast-border"]=wp.customize.Control.extend({ready:function(){"use strict";var t=this;this.container.on("change keyup paste","input.ast-border-input",function(){jQuery(this).val(),t.updateValue()})},updateValue:function(){"use strict";var a={top:"",right:"",bottom:"",left:""};this.container.find("input.ast-border-desktop").each(function(){var t=jQuery(this),e=t.data("id"),n=t.val();a[e]=n}),this.setting.set(a)}}),jQuery(document).ready(function(){jQuery(".ast-border-connected").on("click",function(){jQuery(this).parent().parent(".ast-border-wrapper").find("input").removeClass("connected").attr("data-element-connect",""),jQuery(this).parent(".ast-border-input-item-link").removeClass("disconnected")}),jQuery(".ast-border-disconnected").on("click",function(){var t=jQuery(this).data("element-connect");jQuery(this).parent().parent(".ast-border-wrapper").find("input").addClass("connected").attr("data-element-connect",t),jQuery(this).parent(".ast-border-input-item-link").addClass("disconnected")}),jQuery(".ast-border-input-item").on("input",".connected",function(){var t=jQuery(this).attr("data-element-connect"),n=jQuery(this).val();jQuery(this).parent().parent(".ast-border-wrapper").find('.connected[ data-element-connect="'+t+'" ]').each(function(t,e){jQuery(this).val(n).change()})})}),jQuery,jQuery(window).on("load",function(){jQuery("html").addClass("colorpicker-ready")}),wp.customize.controlConstructor["ast-color"]=wp.customize.Control.extend({ready:function(){"use strict";var a=this;this.container.find(".ast-color-picker-alpha").wpColorPicker({change:function(t,e){t.target;var n=e.color.toString();jQuery("html").hasClass("colorpicker-ready")&&a.setting.set(n)},clear:function(t){jQuery(t.target).closest(".wp-picker-input-wrap").find(".wp-color-picker")[0]&&a.setting.set("")}})}}),jQuery,wp.customize.controlConstructor["ast-link"]=wp.customize.Control.extend({ready:function(){"use strict";var e=this,n=jQuery(".customize-link-control-data").data("value");this.container.on("change keyup",".ast-link-input",function(t){t.preventDefault(),value=jQuery(this).val(),n.url=value,jQuery(".customize-link-control-data").attr("data-value",JSON.stringify(n)).trigger("change"),e.setting.set(n)}),this.container.on("change click",".ast-link-open-in-new-tab",function(){value=jQuery(this).is(":checked"),n.new_tab=value,jQuery(".customize-link-control-data").attr("data-value",JSON.stringify(n)).trigger("change"),e.setting.set(n)}),this.container.on("change keyup",".ast-link-relationship",function(t){t.preventDefault(),value=jQuery(this).val(),n.link_rel=value,jQuery(".customize-link-control-data").attr("data-value",JSON.stringify(n)).trigger("change"),e.setting.set(n)})}}),wp.customize.controlConstructor["ast-customizer-link"]=wp.customize.Control.extend({ready:function(){"use strict";this.container.on("click",".customizer-link",function(t){t.preventDefault();var e=this.getAttribute("data-customizer-linked");wp.customize.section(e).expand()})}}),wp.customize.controlConstructor["ast-radio-image"]=wp.customize.Control.extend({ready:function(){"use strict";var t=this;this.container.on("click","input",function(){t.setting.set(jQuery(this).val())})}}),jQuery,wp.customize.controlConstructor["ast-responsive"]=wp.customize.Control.extend({ready:function(){"use strict";var t=this;t.astResponsiveInit(),this.container.on("change keyup paste","input.ast-responsive-input, select.ast-responsive-select",function(){jQuery(this).val(),t.updateValue()}),this.container.on("blur","input",function(){""==(jQuery(this).val()||"")&&wp.customize.previewer.refresh()}),jQuery(".customize-control-ast-responsive .input-wrapper input.desktop, .customize-control .ast-responsive-btns > li.desktop").addClass("active")},updateValue:function(){"use strict";var t=this,a={};t.responsiveContainer=t.container.find(".ast-responsive-wrapper").first(),t.responsiveContainer.find("input.ast-responsive-input").each(function(){var t=jQuery(this),e=t.data("id"),n=t.val();a[e]=n}),t.responsiveContainer.find("select.ast-responsive-select").each(function(){var t=jQuery(this),e=t.data("id"),n=t.val();a[e]=n}),t.setting.set(a)},astResponsiveInit:function(){"use strict";this.container.find(".ast-responsive-btns button").on("click",function(t){var e=jQuery(this).attr("data-device");e="desktop"==e?"tablet":"tablet"==e?"mobile":"desktop",jQuery('.wp-full-overlay-footer .devices button[data-device="'+e+'"]').trigger("click")})}}),jQuery(" .wp-full-overlay-footer .devices button ").on("click",function(){var t=jQuery(this).attr("data-device");jQuery(".customize-control-ast-responsive .input-wrapper input, .customize-control .ast-responsive-btns > li").removeClass("active"),jQuery(".customize-control-ast-responsive .input-wrapper input."+t+", .customize-control .ast-responsive-btns > li."+t).addClass("active")}),jQuery,jQuery(window).on("load",function(){jQuery("html").addClass("responsive-background-color-ready")}),wp.customize.controlConstructor["ast-responsive-color"]=wp.customize.Control.extend({ready:function(){"use strict";this.initAstBgControl()},initAstBgControl:function(){var r=this;r.setting._value,r.container.find(".ast-responsive-color").wpColorPicker({change:function(t,e){if(jQuery("html").hasClass("responsive-background-color-ready")){var n=r.setting.get(),a=jQuery(this).data("id"),i={desktop:n.desktop,tablet:n.tablet,mobile:n.mobile};"desktop"===a&&(i.desktop=e.color.toString()),"tablet"===a&&(i.tablet=e.color.toString()),"mobile"===a&&(i.mobile=e.color.toString()),r.setting.set(i)}},clear:function(t){var e=jQuery(t.target).closest(".wp-picker-input-wrap").find(".wp-color-picker")[0],n=jQuery(this).closest(".wp-picker-input-wrap").find(".wp-color-picker").data("id"),a=r.setting.get(),i={desktop:a.desktop,tablet:a.tablet,mobile:a.mobile};e&&("desktop"===n&&(i.desktop=""),"tablet"===n&&(i.tablet=""),"mobile"===n&&(i.mobile=""),r.setting.set(i))}}),this.container.find(".ast-responsive-btns button").on("click",function(t){var e=jQuery(this).attr("data-device");e="desktop"==e?"tablet":"tablet"==e?"mobile":"desktop",jQuery('.wp-full-overlay-footer .devices button[data-device="'+e+'"]').trigger("click")}),jQuery(".customize-control-ast-responsive-color .customize-control-content .ast-responsive-color.desktop").parents(".wp-picker-container").addClass("active")}}),jQuery(".wp-full-overlay-footer .devices button").on("click",function(){var t=jQuery(this).attr("data-device");jQuery(".customize-control-ast-responsive-color .customize-control-content .wp-picker-container").removeClass("active"),jQuery(".customize-control-ast-responsive-color .customize-control-content .ast-responsive-color."+t).parents(".wp-picker-container").addClass("active")}),jQuery,wp.customize.controlConstructor["ast-responsive-slider"]=wp.customize.Control.extend({ready:function(){"use strict";var e=this;e.astResponsiveInit(),this.container.on("input change","input[type=range]",function(){var t=jQuery(this).val(),e=jQuery(this).closest(".input-field-wrapper").find(".ast-responsive-range-value-input");e.val(t),e.trigger("change")}),this.container.on("click",".ast-responsive-slider-reset",function(){var t=jQuery(this).parent().find(".input-field-wrapper.active"),e=t.find("input[type=range]"),n=t.find(".ast-responsive-range-value-input"),a=e.data("reset_value");e.val(a),n.val(a),n.trigger("change")}),this.container.on("input change","input[type=number]",function(){var t=jQuery(this).val();jQuery(this).closest(".input-field-wrapper").find("input[type=range]").val(t),e.updateValue()})},updateValue:function(){"use strict";var a={};this.responsiveContainer=this.container.find(".wrapper").first(),this.responsiveContainer.find(".ast-responsive-range-value-input").each(function(){var t=jQuery(this),e=t.data("id"),n=t.val();a[e]=n}),this.setting.set(a)},astResponsiveInit:function(){this.container.on("click",".ast-responsive-slider-btns button",function(t){t.preventDefault();var e=jQuery(this).attr("data-device");e="desktop"==e?"tablet":"tablet"==e?"mobile":"desktop",jQuery('.wp-full-overlay-footer .devices button[data-device="'+e+'"]').trigger("click")})}}),jQuery(" .wp-full-overlay-footer .devices button ").on("click",function(){var t=jQuery(this).attr("data-device");jQuery(".customize-control-ast-responsive-slider .input-field-wrapper, .customize-control .ast-responsive-slider-btns > li").removeClass("active"),jQuery(".customize-control-ast-responsive-slider .input-field-wrapper."+t+", .customize-control .ast-responsive-slider-btns > li."+t).addClass("active")}),jQuery,wp.customize.controlConstructor["ast-responsive-spacing"]=wp.customize.Control.extend({ready:function(){"use strict";var t=this;t.astResponsiveInit(),this.container.on("change keyup paste","input.ast-spacing-input",function(){jQuery(this).val(),t.updateValue()})},updateValue:function(){"use strict";var t=this,a={desktop:{},tablet:{},mobile:{},"desktop-unit":"px","tablet-unit":"px","mobile-unit":"px"};t.container.find("input.ast-spacing-desktop").each(function(){var t=jQuery(this),e=t.data("id"),n=t.val();a.desktop[e]=n}),t.container.find("input.ast-spacing-tablet").each(function(){var t=jQuery(this),e=t.data("id"),n=t.val();a.tablet[e]=n}),t.container.find("input.ast-spacing-mobile").each(function(){var t=jQuery(this),e=t.data("id"),n=t.val();a.mobile[e]=n}),t.container.find(".ast-spacing-unit-wrapper .ast-spacing-unit-input").each(function(){var t=jQuery(this),e=t.attr("data-device"),n=t.val();a[e+"-unit"]=n}),t.setting.set(a)},astResponsiveInit:function(){"use strict";var a=this;a.container.find(".ast-spacing-responsive-btns button").on("click",function(t){var e=jQuery(this).attr("data-device");e="desktop"==e?"tablet":"tablet"==e?"mobile":"desktop",jQuery('.wp-full-overlay-footer .devices button[data-device="'+e+'"]').trigger("click")}),a.container.on("click",".ast-spacing-responsive-units .single-unit",function(){var t=jQuery(this);if(t.hasClass("active"))return!1;var e=t.attr("data-unit"),n=jQuery(".wp-full-overlay-footer .devices button.active").attr("data-device");t.siblings().removeClass("active"),t.addClass("active"),a.container.find(".ast-spacing-unit-wrapper .ast-spacing-"+n+"-unit").val(e),a.updateValue()})}}),jQuery(document).ready(function(){jQuery(".ast-spacing-connected").on("click",function(){jQuery(this).parent().parent(".ast-spacing-wrapper").find("input").removeClass("connected").attr("data-element-connect",""),jQuery(this).parent(".ast-spacing-input-item-link").removeClass("disconnected")}),jQuery(".ast-spacing-disconnected").on("click",function(){var t=jQuery(this).data("element-connect");jQuery(this).parent().parent(".ast-spacing-wrapper").find("input").addClass("connected").attr("data-element-connect",t),jQuery(this).parent(".ast-spacing-input-item-link").addClass("disconnected")}),jQuery(".ast-spacing-input-item").on("input",".connected",function(){var t=jQuery(this).attr("data-element-connect"),n=jQuery(this).val();jQuery(this).parent().parent(".ast-spacing-wrapper").find('.connected[ data-element-connect="'+t+'" ]').each(function(t,e){jQuery(this).val(n).change()})})}),jQuery(".wp-full-overlay-footer .devices button ").on("click",function(){var t=jQuery(this).attr("data-device");jQuery(".customize-control-ast-responsive-spacing .input-wrapper .ast-spacing-wrapper, .customize-control .ast-spacing-responsive-btns > li").removeClass("active"),jQuery(".customize-control-ast-responsive-spacing .input-wrapper .ast-spacing-wrapper."+t+", .customize-control .ast-spacing-responsive-btns > li."+t).addClass("active")}),function(d){jQuery(document).ready(function(){var r=0,o=jQuery(".wp-full-overlay-sidebar-content");jQuery("#customize-controls .wp-full-overlay-sidebar-content .control-section").on("scroll",function(t){var e=jQuery(this);if(e.hasClass("open")){var n=e.find(".customize-section-title"),a=e.scrollTop();if(r .customizer-text",function(t){t.preventDefault(),t.stopPropagation(),jQuery(this).find(".ast-adv-toggle-icon").trigger("click")})},ast_render_field:function(t,e,a){var o=this,i=t.find(".ast-fields-wrap"),r="",s=[],c=o.isJsonString(a.params.value)?JSON.parse(a.params.value):{};if(void 0!==e.tabs){var n=(n=a.params.name.replace("[","-")).replace("]","");r+='
',r+='",r+='
',_.each(e.tabs,function(t,e){r+='
';var n=o.generateFieldHtml(t,c);r+=n.html,_.each(n.controls,function(t,e){s.push({key:t.key,value:t.value,name:t.name})}),r+="
"}),r+="
",i.html(r),d("#"+n+"-tabs").tabs()}else{var l=o.generateFieldHtml(e,c);r+=l.html,_.each(l.controls,function(t,e){s.push({key:t.key,value:t.value,name:t.name})}),i.html(r)}_.each(s,function(t,e){switch(t.key){case"ast-responsive-color":o.initResponsiveColor(i,a,t.name);break;case"ast-color":o.initColor(i,a,t.name);break;case"ast-font":var n=astra.customizer.settings.google_fonts;o.container.find(".ast-font-family").html(n),o.container.find(".ast-font-family").each(function(){var t=d(this).data("value");d(this).val(t);var e=d(this).data("name");d("select[data-name='"+e+"'] option[value='inherit']").text(d(this).data("inherit"));var n=jQuery(".ast-font-weight[data-connected-control='"+e+"']"),a=AstTypography._getWeightObject(AstTypography._cleanGoogleFonts(t));o.generateDropdownHtml(a,n),n.val(n.data("value"))}),o.container.find(".ast-font-family").selectWoo(),o.container.find(".ast-font-family").on("select2:select",function(){var t=d(this).val(),e=AstTypography._getWeightObject(AstTypography._cleanGoogleFonts(t)),n=d(this).data("name"),a=jQuery(".ast-font-weight[data-connected-control='"+n+"']");o.generateDropdownHtml(e,a);var i=d(this).parents(".customize-control").attr("id");i=i.replace("customize-control-",""),o.container.trigger("ast_settings_changed",[o,jQuery(this),t,i]);var r=a.parents(".customize-control").attr("id");r=r.replace("customize-control-",""),o.container.trigger("ast_settings_changed",[o,a,a.val(),r])}),o.container.find(".ast-font-weight").on("change",function(){var t=d(this).val();name=d(this).parents(".customize-control").attr("id"),name=name.replace("customize-control-",""),o.container.trigger("ast_settings_changed",[o,jQuery(this),t,name])});break;case"ast-responsive":o.initResponsiveTrigger(i,a),o.container.on("change keyup paste","input.ast-responsive-input, select.ast-responsive-select",function(){name=d(this).parents(".customize-control").attr("id"),name=name.replace("customize-control-",""),o.updateResonsiveValue(jQuery(this),name)});break;case"ast-select":o.container.on("change",".ast-select-input",function(){var t=jQuery(this).val();name=d(this).parents(".customize-control").attr("id"),name=name.replace("customize-control-",""),o.container.trigger("ast_settings_changed",[o,jQuery(this),t,name])});break;case"ast-slider":o.container.on("input change","input[type=range]",function(){var t=jQuery(this).attr("value"),e=jQuery(this).closest(".wrapper").find(".astra_range_value .value");e.val(t),name=d(this).parents(".customize-control").attr("id"),name=name.replace("customize-control-",""),o.container.trigger("ast_settings_changed",[o,e,t,name])}),o.container.on("click",".ast-slider-reset",function(){var t=jQuery(this).closest(".wrapper"),e=t.find("input[type=range]"),n=t.find(".astra_range_value .value"),a=e.data("reset_value");e.val(a),n.val(a),name=d(this).parents(".customize-control").attr("id"),name=name.replace("customize-control-",""),o.container.trigger("ast_settings_changed",[o,n,a,name])}),o.container.find(".customize-control-ast-slider").on("input change","input[type=number]",function(){var t=jQuery(this).val();jQuery(this).closest(".wrapper").find("input[type=range]").val(t),name=d(this).parents(".customize-control").attr("id"),name=name.replace("customize-control-",""),o.container.trigger("ast_settings_changed",[o,jQuery(this),t,name])});break;case"ast-responsive-background":o.initAstResonsiveBgControl(a,t,t.name);break;case"ast-background":o.initAstBgControl(a,t,t.name);break;case"ast-border":o.initAstBorderControl(a,t,t.name)}}),t.find(".ast-field-settings-modal").data("loaded",!0)},initAstBorderControl:function(t,e,n){var a=this;a.setting._value,e.name;this.container.on("change keyup paste","input.ast-border-input",function(){a.saveBorderValue("border",jQuery(this).val(),jQuery(this),n)}),jQuery(".ast-border-connected").on("click",function(){jQuery(this).parent().parent(".ast-border-wrapper").find("input").removeClass("connected").attr("data-element-connect",""),jQuery(this).parent(".ast-border-input-item-link").removeClass("disconnected")}),jQuery(".ast-border-disconnected").on("click",function(){var t=jQuery(this).data("element-connect");jQuery(this).parent().parent(".ast-border-wrapper").find("input").addClass("connected").attr("data-element-connect",t),jQuery(this).parent(".ast-border-input-item-link").addClass("disconnected")}),jQuery(".ast-border-input-item").on("input",".connected",function(){var t=jQuery(this).attr("data-element-connect"),n=jQuery(this).val();jQuery(this).parent().parent(".ast-border-wrapper").find('.connected[ data-element-connect="'+t+'" ]').each(function(t,e){jQuery(this).val(n).change()})})},generateFieldHtml:function(t,e){var l="",d=[];_.each(t,function(t,e){new_value=wp.customize.control("astra-settings["+t.name+"]")?wp.customize.control("astra-settings["+t.name+"]").params.value:"";var n=t.control,a="customize-control-"+n+"-content",i=wp.template(a),r=new_value||t.default;t.value=r;var o="",s="";if(t.label=t.title,_.each(t.data_attrs,function(t,e){o+=" data-"+e+" ='"+t+"'"}),_.each(t.input_attrs,function(t,e){s+=e+" ='"+t+"'"}),t.dataAttrs=o,t.inputAttrs=s,d.push({key:n,value:r,name:t.name}),"ast-responsive"==n){var c=void 0===t.responsive||t.responsive;t.responsive=c}var u=t.name.replace("[","-");u=u.replace("]",""),l+="
  • ",l+=i(t),l+="
  • "});var n=new Object;return n.controls=d,n.html=l,n},generateDropdownHtml:function(t,e){var n=e.data("inherit"),a="",i=0,r=(t=d.merge(["inherit"],t),e.val()||"400");for(astraTypo.inherit=n;i"+astraTypo[t[i]]+"");e.html(a)},initResponsiveTrigger:function(t,e){t.find(".ast-responsive-btns button").on("click",function(t){var e=jQuery(this).attr("data-device");e="desktop"==e?"tablet":"tablet"==e?"mobile":"desktop",jQuery('.wp-full-overlay-footer .devices button[data-device="'+e+'"]').trigger("click")})},initColor:function(t,e,a){var i=this;t.find(".customize-control-ast-color .ast-color-picker-alpha").wpColorPicker({change:function(t,e){if(void 0!==t.originalEvent||void 0!==e.color._alpha){var n=jQuery(t.target).closest(".wp-picker-input-wrap").find(".wp-color-picker")[0];jQuery(n).val(e.color.toString()),a=(a=jQuery(n).parents(".customize-control").attr("id")).replace("customize-control-",""),i.container.trigger("ast_settings_changed",[i,jQuery(n),e.color.toString(),a])}},clear:function(t){var e=jQuery(t.target).closest(".wp-picker-input-wrap").find(".wp-color-picker")[0];jQuery(e).val(""),a=(a=jQuery(e).parents(".customize-control").attr("id")).replace("customize-control-",""),i.container.trigger("ast_settings_changed",[i,jQuery(e),"",a]),wp.customize.previewer.refresh()}})},initResponsiveColor:function(t,e,s){var c=this;t.find(".ast-responsive-color").wpColorPicker({change:function(t,e){if((void 0!==t.originalEvent||void 0!==e.color._alpha)&&jQuery("html").hasClass("responsive-background-color-ready")){var n=jQuery(this).data("name"),a={desktop:jQuery(".desktop.ast-responsive-color[data-name='"+n+"']").val(),tablet:jQuery(".tablet.ast-responsive-color[data-name='"+n+"']").val(),mobile:jQuery(".mobile.ast-responsive-color[data-name='"+n+"']").val()},i=t.target,r=jQuery(this).data("id"),o={desktop:a.desktop,tablet:a.tablet,mobile:a.mobile};"desktop"===r&&(o.desktop=e.color.toString()),"tablet"===r&&(o.tablet=e.color.toString()),"mobile"===r&&(o.mobile=e.color.toString()),jQuery(i).val(e.color.toString()),s=(s=jQuery(i).parents(".customize-control").attr("id")).replace("customize-control-",""),c.container.trigger("ast_settings_changed",[c,jQuery(this),o,s])}},clear:function(t){var e=jQuery(t.target).closest(".wp-picker-input-wrap").find(".wp-color-picker")[0],n=jQuery(this).closest(".wp-picker-input-wrap").find(".wp-color-picker").data("id"),a=jQuery(e).attr("data-name"),i={desktop:jQuery(".desktop.ast-responsive-color[data-name='"+a+"']").val(),tablet:jQuery(".tablet.ast-responsive-color[data-name='"+a+"']").val(),mobile:jQuery(".mobile.ast-responsive-color[data-name='"+a+"']").val()},r={desktop:i.desktop,tablet:i.tablet,mobile:i.mobile};wp.customize.previewer.refresh(),e&&("desktop"===n&&(r.desktop=""),"tablet"===n&&(r.tablet=""),"mobile"===n&&(r.mobile=""),jQuery(e).val(""),c.container.trigger("ast_settings_changed",[c,jQuery(e),r,s])),s=(s=jQuery(e).parents(".customize-control").attr("id")).replace("customize-control-","")}}),t.find(".ast-responsive-btns button").on("click",function(t){var e=jQuery(this).attr("data-device");e="desktop"==e?"tablet":"tablet"==e?"mobile":"desktop",jQuery('.wp-full-overlay-footer .devices button[data-device="'+e+'"]').trigger("click")}),t.find(".ast-responsive-color.desktop").parents(".wp-picker-container").addClass("active")},onOptionChange:function(t,e,n,a,i){d(".hidden-field-astra-settings-"+i).val(a),sub_control=wp.customize.control("astra-settings["+i+"]"),sub_control.setting.set(a)},updateResonsiveValue:function(t,e){"use strict";var n=this,a={};n.responsiveContainer=t.closest(".ast-responsive-wrapper"),n.responsiveContainer.find("input.ast-responsive-input").each(function(){var t=jQuery(this),e=t.data("id"),n=t.val();a[e]=n}),n.responsiveContainer.find("select.ast-responsive-select").each(function(){var t=jQuery(this),e=t.data("id"),n=t.val();a[e]=n}),n.container.trigger("ast_settings_changed",[n,t,a,e])},isJsonString:function(t){try{JSON.parse(t)}catch(t){return!1}return!0},initAstResonsiveBgControl:function(c,t,u){var e=t.value,n=c.container.find(".ast-responsive-bg-color-control"),a=t.name,l=c.container.find("#customize-control-"+a);!_.isUndefined(e.desktop["background-image"])&&""!==e.desktop["background-image"]||(l.find(".background-wrapper > .background-container.desktop > .background-repeat").hide(),l.find(".background-wrapper > .background-container.desktop > .background-position").hide(),l.find(".background-wrapper > .background-container.desktop > .background-size").hide(),l.find(".background-wrapper > .background-container.desktop > .background-attachment").hide()),!_.isUndefined(e.tablet["background-image"])&&""!==e.tablet["background-image"]||(l.find(".background-wrapper > .background-container.tablet > .background-repeat").hide(),l.find(".background-wrapper > .background-container.tablet > .background-position").hide(),l.find(".background-wrapper > .background-container.tablet > .background-size").hide(),l.find(".background-wrapper > .background-container.tablet > .background-attachment").hide()),!_.isUndefined(e.mobile["background-image"])&&""!==e.mobile["background-image"]||(l.find(".background-wrapper > .background-container.mobile > .background-repeat").hide(),l.find(".background-wrapper > .background-container.mobile > .background-position").hide(),l.find(".background-wrapper > .background-container.mobile > .background-size").hide(),l.find(".background-wrapper > .background-container.mobile > .background-attachment").hide()),n.wpColorPicker({change:function(t,e){if(void 0!==t.originalEvent||void 0!==e.color._alpha){var n=jQuery(this).data("id");c.saveValue(n,"background-color",e.color.toString(),jQuery(this),u)}},clear:function(t){var e=jQuery(t.target).closest(".wp-picker-input-wrap").find(".wp-color-picker")[0],n=jQuery(this).closest(".wp-picker-input-wrap").find(".wp-color-picker").data("id");e&&c.saveValue(n,"background-color","",jQuery(e),u),wp.customize.previewer.refresh()}}),l.on("change",".background-repeat select",function(){var t=jQuery(this),e=t.data("id"),n=t.val();c.saveValue(e,"background-repeat",n,jQuery(this),u)}),l.on("change click",".background-size input",function(){var t=jQuery(this),e=t.data("id"),n=t.val();jQuery(this).parent(".buttonset").find(".switch-input").removeAttr("checked"),jQuery(this).attr("checked","checked"),c.saveValue(e,"background-size",n,t,u)}),l.on("change",".background-position select",function(){var t=jQuery(this),e=t.data("id"),n=t.val();c.saveValue(e,"background-position",n,t,u)}),l.on("change click",".background-attachment input",function(){var t=jQuery(this),e=t.data("id"),n=t.val();jQuery(this).parent(".buttonset").find(".switch-input").removeAttr("checked"),jQuery(this).attr("checked","checked"),c.saveValue(e,"background-attachment",n,t,u)}),l.on("click",".background-image-upload-button, .thumbnail-image img",function(t){var r=jQuery(this),o=r.data("id");u=r.data("name");var s=wp.media({multiple:!1}).open().on("select",function(){var t,e,n,a=s.state().get("selection").first(),i=a.toJSON().sizes.full.url;_.isUndefined(a.toJSON().sizes.medium)?_.isUndefined(a.toJSON().sizes.thumbnail)||(i=a.toJSON().sizes.thumbnail.url):i=a.toJSON().sizes.medium.url,t=a.toJSON().sizes.full.url,a.toJSON().id,a.toJSON().width,a.toJSON().height,""!==t&&l.find(".background-wrapper > .background-repeat, .background-wrapper > .background-position, .background-wrapper > .background-size, .background-wrapper > .background-attachment").show(),c.saveValue(o,"background-image",t,r,u),e=l.find(".background-container."+o+" .placeholder, .background-container."+o+" .thumbnail"),n=l.find(".background-container."+o+" .background-image-upload-remove-button"),e.length&&e.removeClass().addClass("thumbnail thumbnail-image").html(''),n.length&&n.show()});t.preventDefault()}),l.on("click",".background-image-upload-remove-button",function(t){var e,n,a=jQuery(this).data("id");c.saveValue(a,"background-image","",jQuery(this),u),e=l.find(".background-container."+a+" .placeholder, .background-container."+a+" .thumbnail"),n=l.find(".background-container."+a+" .background-image-upload-remove-button"),l.find(".background-wrapper > .background-container."+a+" > .background-repeat").hide(),l.find(".background-wrapper > .background-container."+a+" > .background-position").hide(),l.find(".background-wrapper > .background-container."+a+" > .background-size").hide(),l.find(".background-wrapper > .background-container."+a+" > .background-attachment").hide(),l.find(".background-container."+a+" .more-settings").attr("data-direction","down"),l.find(".background-container."+a+" .more-settings").find(".message").html(astraCustomizerControlBackground.moreSettings),l.find(".background-container."+a+" .more-settings").find(".icon").html("↓"),e.length&&e.removeClass().addClass("placeholder").html(astraCustomizerControlBackground.placeholder),n.length&&n.hide(),wp.customize.previewer.refresh(),t.preventDefault()}),l.on("click",".more-settings",function(t){var e=jQuery(this).data("id");l.find(".background-wrapper > .background-container."+e+" > .background-repeat").toggle(),l.find(".background-wrapper > .background-container."+e+" > .background-position").toggle(),l.find(".background-wrapper > .background-container."+e+" > .background-size").toggle(),l.find(".background-wrapper > .background-container."+e+" > .background-attachment").toggle(),"down"===d(this).attr("data-direction")?(d(this).attr("data-direction","up"),d(this).find(".message").html(astraCustomizerControlBackground.lessSettings),d(this).find(".icon").html("↑")):(d(this).attr("data-direction","down"),d(this).find(".message").html(astraCustomizerControlBackground.moreSettings),d(this).find(".icon").html("↓"))}),l.find(".ast-responsive-btns button").on("click",function(t){var e=jQuery(this).attr("data-device");e="desktop"==e?"tablet":"tablet"==e?"mobile":"desktop",jQuery('.wp-full-overlay-footer .devices button[data-device="'+e+'"]').trigger("click")}),jQuery(" .wp-full-overlay-footer .devices button ").on("click",function(){var t=jQuery(this).attr("data-device");jQuery(".customize-control-ast-responsive-background .background-container, .customize-control .ast-responsive-btns > li").removeClass("active"),jQuery(".customize-control-ast-responsive-background .background-container."+t+", .customize-control .ast-responsive-btns > li."+t).addClass("active")})},initAstBgControl:function(s,t,c){var e=s.setting._value,n=t.name,a=s.container.find(".ast-color-control"),u=s.container.find("#customize-control-"+n);!_.isUndefined(e["background-image"])&&""!==e["background-image"]||(u.find(".background-wrapper > .background-repeat").hide(),u.find(".background-wrapper > .background-position").hide(),u.find(".background-wrapper > .background-size").hide(),u.find(".background-wrapper > .background-attachment").hide()),a.wpColorPicker({change:function(){if(jQuery("html").hasClass("background-colorpicker-ready")){var t=jQuery(this);setTimeout(function(){s.saveBgValue("background-color",a.val(),t,c)},100)}},clear:function(t){var e=jQuery(t.target).closest(".wp-picker-input-wrap").find(".wp-color-picker")[0];e&&s.saveBgValue("background-color","",jQuery(e),c),wp.customize.previewer.refresh()}}),u.on("change",".background-repeat select",function(){s.saveBgValue("background-repeat",jQuery(this).val(),jQuery(this),c)}),u.on("change click",".background-size input",function(){jQuery(this).parent(".buttonset").find(".switch-input").removeAttr("checked"),jQuery(this).attr("checked","checked"),s.saveBgValue("background-size",jQuery(this).val(),jQuery(this),c)}),u.on("change",".background-position select",function(){s.saveBgValue("background-position",jQuery(this).val(),jQuery(this),c)}),u.on("change click",".background-attachment input",function(){jQuery(this).parent(".buttonset").find(".switch-input").removeAttr("checked"),jQuery(this).attr("checked","checked"),s.saveBgValue("background-attachment",jQuery(this).val(),jQuery(this),c)}),u.on("click",".background-image-upload-button, .thumbnail-image img",function(t){var r=jQuery(this),o=wp.media({multiple:!1}).open().on("select",function(){var t,e,n,a=o.state().get("selection").first(),i=a.toJSON().sizes.full.url;_.isUndefined(a.toJSON().sizes.medium)?_.isUndefined(a.toJSON().sizes.thumbnail)||(i=a.toJSON().sizes.thumbnail.url):i=a.toJSON().sizes.medium.url,t=a.toJSON().sizes.full.url,a.toJSON().id,a.toJSON().width,a.toJSON().height,""!==t&&u.find(".background-wrapper > .background-repeat, .background-wrapper > .background-position, .background-wrapper > .background-size, .background-wrapper > .background-attachment").show(),s.saveBgValue("background-image",t,r,c),e=u.find(".placeholder, .thumbnail"),n=u.find(".background-image-upload-remove-button"),e.length&&e.removeClass().addClass("thumbnail thumbnail-image").html(''),n.length&&n.show()});t.preventDefault()}),u.on("click",".background-image-upload-remove-button",function(t){var e,n;t.preventDefault(),s.saveBgValue("background-image","",jQuery(this)),e=u.find(".placeholder, .thumbnail"),n=u.find(".background-image-upload-remove-button"),u.find(".background-wrapper > .background-repeat").hide(),u.find(".background-wrapper > .background-position").hide(),u.find(".background-wrapper > .background-size").hide(),u.find(".background-wrapper > .background-attachment").hide(),u.find(".more-settings").attr("data-direction","down"),u.find(".more-settings").find(".message").html(astraCustomizerControlBackground.moreSettings),u.find(".more-settings").find(".icon").html("↓"),e.length&&e.removeClass().addClass("placeholder").html(astraCustomizerControlBackground.placeholder),n.length&&n.hide()}),u.on("click",".more-settings",function(t){u.find(".background-wrapper > .background-repeat").toggle(),u.find(".background-wrapper > .background-position").toggle(),u.find(".background-wrapper > .background-size").toggle(),u.find(".background-wrapper > .background-attachment").toggle(),"down"===d(this).attr("data-direction")?(d(this).attr("data-direction","up"),d(this).find(".message").html(astraCustomizerControlBackground.lessSettings),d(this).find(".icon").html("↑")):(d(this).attr("data-direction","down"),d(this).find(".message").html(astraCustomizerControlBackground.moreSettings),d(this).find(".icon").html("↓"))})},saveValue:function(t,e,n,a,i){var r=jQuery("#customize-control-"+this.id.replace("[","-").replace("]","")+" .responsive-background-hidden-value"),o=JSON.parse(r.val());o[t][e]=n,jQuery(r).attr("value",JSON.stringify(o)).trigger("change"),i=(i=jQuery(a).parents(".customize-control").attr("id")).replace("customize-control-",""),this.container.trigger("ast_settings_changed",[this,a,o,i])},saveBgValue:function(t,e,n,a){var i=jQuery("#customize-control-"+this.id.replace("[","-").replace("]","")+" .background-hidden-value"),r=JSON.parse(i.val());r[t]=e,jQuery(i).attr("value",JSON.stringify(r)).trigger("change"),a=(a=jQuery(n).parents(".customize-control").attr("id")).replace("customize-control-",""),this.container.trigger("ast_settings_changed",[this,n,r,a])},saveBorderValue:function(t,e,n,a){var i={top:"",right:"",bottom:"",left:""};this.container.find("input.ast-border-desktop").each(function(){var t=jQuery(this),e=t.data("id");item_value=t.val(),i[e]=item_value,t.attr("value",item_value)}),this.container.trigger("ast_settings_changed",[this,n,i,a])}})}(jQuery),jQuery,wp.customize.controlConstructor["ast-slider"]=wp.customize.Control.extend({ready:function(){"use strict";var e=this;jQuery("input[type=range]").on("input change",function(){var t=jQuery(this).attr("value"),e=jQuery(this).closest(".wrapper").find(".astra_range_value .value");e.val(t),e.change()}),jQuery(".ast-slider-reset").click(function(){var t=jQuery(this).closest(".wrapper"),e=t.find("input[type=range]"),n=t.find(".astra_range_value .value"),a=e.data("reset_value");e.val(a),n.val(a),n.change()}),this.container.on("input change","input[type=number]",function(){var t=jQuery(this).val();jQuery(this).closest(".wrapper").find("input[type=range]").val(t),e.setting.set(t)})}}),jQuery,wp.customize.controlConstructor["ast-sortable"]=wp.customize.Control.extend({ready:function(){"use strict";var t=this;t.sortableContainer=t.container.find("ul.sortable").first(),t.sortableContainer.sortable({stop:function(){t.updateValue()}}).disableSelection().find("li").each(function(){jQuery(this).find("i.visibility").click(function(){jQuery(this).toggleClass("dashicons-visibility-faint").parents("li:eq(0)").toggleClass("invisible")})}).click(function(){t.updateValue()})},updateValue:function(){"use strict";var t=[];this.sortableContainer.find("li").each(function(){jQuery(this).is(".invisible")||t.push(jQuery(this).data("value"))}),this.setting.set(t)}}),jQuery,wp.customize.controlConstructor["ast-spacing"]=wp.customize.Control.extend({ready:function(){"use strict";var t=this;t.spacingContainer=t.container.find("ul.ast-spacing-wrapper").first(),t.spacingContainer.on("change keyup paste","input.ast-spacing-input",function(){jQuery(this).val(),t.updateValue()})},updateValue:function(){"use strict";var a={};this.spacingContainer.find("input.ast-spacing-input").each(function(){var t=jQuery(this),e=t.data("id"),n=t.val();a[e]=n}),this.setting.set(a)}}),function(p){var v=wp.customize;AstTypography={init:function(){AstTypography._initFonts()},_initFonts:function(){p(".customize-control-ast-font-family select").each(function(t){if(void 0!==astra.customizer){var e=astra.customizer.settings.google_fonts,n=p(this).data("name");p(this).html(e),p("select[data-name='"+n+"'] option[value='inherit']").text(p(this).data("inherit"));var a=p(this).data("value");p(this).val(a)}}),p(".customize-control-ast-font-family select").each(AstTypography._initFont),p(".customize-control-ast-font-family select, .customize-control-ast-font-variant select").selectWoo(),p(".customize-control-ast-font-variant select").on("select2:unselecting",function(t){var e=p(this).data("customize-setting-link");(t.params.args.data.id||"")&&(p(this).find('option[value="'+t.params.args.data.id+'"]').removeAttr("selected"),null===p(this).val()&&v(e).set(""))})},_initFont:function(){var t=p(this),e=t.data("customize-setting-link"),n=t.data("connected-control"),a=t.data("connected-variant");void 0!==n&&(v(e).bind(AstTypography._fontSelectChange),AstTypography._setFontWeightOptions.apply(v(e),[!0])),void 0!==a&&(v(e).bind(AstTypography._fontSelectChange),AstTypography._setFontVarianttOptions.apply(v(e),[!0]))},_fontSelectChange:function(){var t=v.control(this.id).container.find("select").data("connected-variant");AstTypography._setFontWeightOptions.apply(this,[!1]),void 0!==t&&AstTypography._setFontVarianttOptions.apply(this,[!1])},_cleanGoogleFonts:function(t){if(!t.includes(","))return t;var e=t.split(","),n=new RegExp("'","gi"),a=e[0].replace(n,"");return void 0!==AstFontFamilies.google[a]&&(t=a),t},_getWeightObject:function(t){var e=["400","600"];return"inherit"==t?e=["100","200","300","400","500","600","700","800","900"]:void 0!==AstFontFamilies.system[t]?e=AstFontFamilies.system[t].weights:void 0!==AstFontFamilies.google[t]?(e=AstFontFamilies.google[t][0],e=Object.keys(e).map(function(t){return e[t]})):void 0!==AstFontFamilies.custom[t]&&(e=AstFontFamilies.custom[t].weights),e},_setFontWeightOptions:function(t){var e=0,n=v.control(this.id).container.find("select"),a=this(),i="",r=n.data("connected-control"),o=(n.data("inherit"),v.control(r).container.find("select")),s=o.data("inherit"),c=t?o.val():"400",u=["400","600"],l="",d=astraTypo;"inherit"==a&&(c=t?o.val():"inherit");a=AstTypography._cleanGoogleFonts(a),u=AstTypography._getWeightObject(a);for(u=p.merge(["inherit"],u),d.inherit=s;e"+d[u[e]]+"");o.html(l),t||(v(r).set(""),v(r).set(c))},_setFontVarianttOptions:function(t){var e=0,n=v.control(this.id).container.find("select"),a=this(),i="",r=n.data("connected-variant"),o=(n.data("inherit"),v.control(r).container.find("select")),s=v.control(r).container.find(".ast-font-variant-hidden-value"),c="",u="",l=o.data("inherit"),d=astraTypo,p=s.val().split(",");"Google"==(n.find('option[value="'+n.val()+'"]').closest("optgroup").attr("label")||"")?o.parent().removeClass("ast-hide"):o.parent().addClass("ast-hide");a=AstTypography._cleanGoogleFonts(a);var g=AstTypography._getWeightObject(a);d.inherit=l;for(e=0;e"+d[g[e]]+""}o.html(u),t||v(r).set("")}},p(function(){AstTypography.init()})}(jQuery);