text: jQuery(function(e){"use strict";e(document.body).on("yith-framework-enhanced-select-init",function(){e(".yith-post-search").filter(":not(.enhanced)").each(function(){var t={action:"yith_plugin_fw_json_search_posts",security:yith_framework_enhanced_select_params.search_posts_nonce,post_type:"post"},a=e.extend(t,e(this).data()),n={allowClear:!!e(this).data("allow_clear"),placeholder:e(this).data("placeholder"),minimumInputLength:e(this).data("minimum_input_length")?e(this).data("minimum_input_length"):"3",escapeMarkup:function(e){return e},ajax:{url:ajaxurl,dataType:"json",quietMillis:250,data:function(t){var n={term:t.term};return e.extend(n,a)},processResults:function(t){var a=[];return t&&e.each(t,function(e,t){a.push({id:e,text:t})}),{results:a}},cache:!0}};if(e(this).select2(n).addClass("enhanced"),e(this).data("sortable")){var i=e(this),s=e(this).next(".select2-container").find("ul.select2-selection__rendered");s.sortable({placeholder:"ui-state-highlight select2-selection__choice",forcePlaceholderSize:!0,items:"li:not(.select2-search__field)",tolerance:"pointer",stop:function(){e(s.find(".select2-selection__choice").get().reverse()).each(function(){var t=e(this).data("data").id,a=i.find('option[value="'+t+'"]')[0];i.prepend(a)})}})}}),e(".yith-customer-search").filter(":not(.enhanced)").each(function(){var t={action:"woocommerce_json_search_customers",security:yith_framework_enhanced_select_params.search_customers_nonce},a=e.extend(t,e(this).data()),n={allowClear:!!e(this).data("allow_clear"),placeholder:e(this).data("placeholder"),minimumInputLength:e(this).data("minimum_input_length")?e(this).data("minimum_input_length"):"3",escapeMarkup:function(e){return e},ajax:{url:ajaxurl,dataType:"json",quietMillis:250,data:function(t){var n={term:t.term};return e.extend(n,a)},processResults:function(t){var a=[];return t&&e.each(t,function(e,t){a.push({id:e,text:t})}),{results:a}},cache:!0}};if(e(this).select2(n).addClass("enhanced"),e(this).data("sortable")){var i=e(this),s=e(this).next(".select2-container").find("ul.select2-selection__rendered");s.sortable({placeholder:"ui-state-highlight select2-selection__choice",forcePlaceholderSize:!0,items:"li:not(.select2-search__field)",tolerance:"pointer",stop:function(){e(s.find(".select2-selection__choice").get().reverse()).each(function(){var t=e(this).data("data").id,a=i.find('option[value="'+t+'"]')[0];i.prepend(a)})}})}}),e(".yith-term-search").filter(":not(.enhanced)").each(function(){var t={action:"yith_plugin_fw_json_search_terms",security:yith_framework_enhanced_select_params.search_terms_nonce,taxonomy:"category"},a=e.extend(t,e(this).data()),n={allowClear:!!e(this).data("allow_clear"),placeholder:e(this).data("placeholder"),minimumInputLength:e(this).data("minimum_input_length")?e(this).data("minimum_input_length"):"3",escapeMarkup:function(e){return e},ajax:{url:ajaxurl,dataType:"json",quietMillis:250,data:function(t){var n={term:t.term};return e.extend(n,a)},processResults:function(t){var a=[];return t&&e.each(t,function(e,t){a.push({id:e,text:t})}),{results:a}},cache:!0}};if(e(this).select2(n).addClass("enhanced"),e(this).data("sortable")){var i=e(this),s=e(this).next(".select2-container").find("ul.select2-selection__rendered");s.sortable({placeholder:"ui-state-highlight select2-selection__choice",forcePlaceholderSize:!0,items:"li:not(.select2-search__field)",tolerance:"pointer",stop:function(){e(s.find(".select2-selection__choice").get().reverse()).each(function(){var t=e(this).data("data").id,a=i.find('option[value="'+t+'"]')[0];i.prepend(a)})}})}})}).trigger("yith-framework-enhanced-select-init")});