/*! Custom Sidebars - v3.0.5 * https://premium.wpmudev.org/project/custom-sidebars-pro/ * Copyright (c) 2017; * Licensed GPLv2+ */ jQuery(function(){var a=jQuery(document),b=function(a,b){var g=jQuery(b).closest(".widget"),l=g.find(".csb-visibility-button"),m=g.find(".widget-control-actions .widget-control-save"),n=g.find(".widget-control-actions .spinner");g.data("_csb_visibility")||(n.insertBefore(m).css({float:"left"}),l.insertBefore(m).click(h),g.on("click",".toggle-action b",i),g.on("csb:update",e),g.on("click",".clear-filter",c),g.on("click",".choose-filters",f),g.on("click",".add-filter",d),g.on("change","input[data-lbl-all][data-lbl-single]",j),g.on("change","select.posttype",k),g.data("_csb_visibility",!0))},c=function(a){var b=jQuery(this),c=b.closest(".csb-option-row"),d=b.closest(".widget"),e="."+jQuery.trim(c.attr("class").replace("csb-option-row","")),f=d.find('[data-for="'+e+'"]'),g=c.find("input, select, textarea");return a.preventDefault(),f.show(),c.fadeOut(400,function(){g.val("").trigger("change.select2"),d.trigger("csb:update")}),!1},d=function(a){var b=jQuery(this),c=b.data("for"),d=b.closest(".widget"),e=d.find(".csb-always"),f=d.find(c);return a.preventDefault(),f.show(),b.hide(),e.hide(),g(),d.trigger("csb:update"),!1},e=function(){var a=jQuery(this).closest(".widget"),b=a.find(".csb-always"),c=a.find(".csb-option-row:visible:not(.csb-action,.csb-always)");0===c.length?b.show():(b.hide(),c.find(".csb-and").show(),c.first().find(".csb-and").hide()),wpmUi.upgrade_multiselect(a)},f=function(b){var c=jQuery(this),d=c.closest(".csb-option-row"),e=d.find(".dropdown");return b.preventDefault(),e.show(),a.one("click",g),!1},g=function(a){jQuery(".csb-action .dropdown:visible").hide()},h=function(a){var b=jQuery(this),c=b.closest(".widget"),d=c.find(".csb-visibility-inner"),e=d.find(".csb-visible-flag");return a.preventDefault(),"0"===e.val()?(e.val("1"),d.show(),c.trigger("csb:update")):(e.val("0"),d.hide()),!1},i=function(a){var b=jQuery(this).closest("label"),c=b.closest(".widget"),d="#"+b.attr("for"),e=c.find(d),f=e.val(),g=c.find(".lbl-show-if"),h=c.find(".lbl-hide-if");return a.preventDefault(),"show"!==f?(g.show(),h.hide(),e.val("show")):(g.hide(),h.show(),e.val("hide")),!1},j=function(a){var b=jQuery(this).closest("label"),c=b.closest(".csb-detail-row"),d=b.find("input[type=checkbox]"),e=b.find(".lbl"),f=c.find(".detail"),g=f.find("input,select,textarea");d.prop("checked")?(e.text(d.data("lbl-single")),f.show()):(e.text(d.data("lbl-all")),f.hide(),g.val("").trigger("change.select2"))},k=function(a){var b,c=jQuery(this),d=c.closest(".csb-option-row"),e=d.find(".csb-detail-row"),f=c.val();if(e.addClass("csb-hide"),f)for(b=0;b