File "chosen.order.jquery.min.js"

Full Path: /home/vantageo/public_html/cache/cache/cache/cache/cache/.wp-cli/wp-content/plugins/woo-product-filter/modules/woofilters/js/chosen.order.jquery.min.js
File size: 4.61 KB
MIME-type: text/plain
Charset: utf-8

/* Chosen Order v1.2.1 | (c) 2013 by Tristan Jahier, http://tristan-jahier.fr */
(function(){var a,b,c,d=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1},e={}.hasOwnProperty,f=function(a,b){function c(){this.constructor=a}for(var d in b)e.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a};b=function(){function a(){}var b;return b={invalid_select_element:"ChosenOrder::{{function}}: first argument must be a valid HTML Multiple Select element that has been Chosenified!",invalid_selection_array:"ChosenOrder::{{function}}: second argument must be an Array!",unreachable_chosen_container:'ChosenOrder::{{function}}: could not find the Chosen UI container! To solve the problem, try adding an "id" attribute to your <select> element.',ordering_unselected_option:"ChosenOrder::{{function}}: ignoring option '{{option}}' which is not selected. Set optional parameter \"force\" to 'true' to get the ordered selection forced first."},a.insertAt=function(a,b,c){return c.insertBefore(a,c.children[b].nextSibling)},a.getFlattenedOptionsAndGroups=function(a){var b,c,d,e,f,g,h,i,j;for(d=Array.prototype.filter.call(a.childNodes,function(a){var b;return"OPTION"===(b=a.nodeName.toUpperCase())||"OPTGROUP"===b}),b=[],g=0,i=d.length;i>g;g++)if(c=d[g],b.push(c),"OPTGROUP"===c.nodeName.toUpperCase())for(f=Array.prototype.filter.call(c.childNodes,function(a){return"OPTION"===a.nodeName.toUpperCase()}),h=0,j=f.length;j>h;h++)e=f[h],b.push(e);return b},a.isValidMultipleSelectElement=function(a){return null!==a&&"undefined"!=typeof a&&"SELECT"===a.nodeName&&a.multiple},a.getChosenUIContainer=function(a){return""!==a.id?document.getElementById(a.id.replace(/-/g,"_")+"_chosen"):this.searchChosenUIContainer(a)},a.isChosenified=function(a){return null!=this.getChosenUIContainer(a)},a.forceSelection=function(a,b){var c,e,f,g;for(f=this.getFlattenedOptionsAndGroups(a),c=0;c<f.length;)e=f[c],g=e.getAttribute("value"),d.call(b,g)>=0?(e.selected=!0,e.setAttribute("selected","")):(e.selected=!1,e.removeAttribute("selected")),c++;return this.triggerEvent(a,"chosen:updated")},a.getSelectionOrder=function(a){var c,d,e,f,g,h,i,j,k,l;if(null!=this.getDOMElement&&(a=this.getDOMElement(a)),i=[],!this.isValidMultipleSelectElement(a))return console.error(b.invalid_select_element.replace("{{function}}","getSelectionOrder")),i;if(d=this.getChosenUIContainer(a),null==d)return console.error(b.unreachable_chosen_container.replace("{{function}}","getSelectionOrder")),i;for(c=d.querySelectorAll(".search-choice"),h=this.getFlattenedOptionsAndGroups(a),k=0,l=c.length;l>k;k++)f=c[k],e=f.querySelectorAll(".search-choice-close")[0],null!=e&&(j=e.getAttribute(this.relAttributeName)),g=h[j],i.push(g.value);return i},a.setSelectionOrder=function(a,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t;if(null!=this.getDOMElement&&(a=this.getDOMElement(a)),!this.isValidMultipleSelectElement(a))return void console.error(b.invalid_select_element.replace("{{function}}","setSelectionOrder"));if(g=this.getChosenUIContainer(a),null==g)return void console.error(b.unreachable_chosen_container.replace("{{function}}","setSelectionOrder"));if(c instanceof Array){for(c=c.map(Function.prototype.call,String.prototype.trim),m=this.getFlattenedOptionsAndGroups(a),null!=d&&d===!0&&this.forceSelection(a,c),t=[],h=p=0,r=c.length;r>p;h=++p){for(k=c[h],n=null,i=q=0,s=m.length;s>q;i=++q)j=m[i],j.value===k&&(n=i);f=g.querySelectorAll(".search-choice"),o=this.relAttributeName,l=Array.prototype.filter.call(f,function(a){return null!=a.querySelector("a.search-choice-close["+o+'="'+n+'"]')})[0],null!=l?(e=g.querySelector("ul.chosen-choices"),t.push(this.insertAt(l,h,g.querySelector("ul.chosen-choices")))):console.warn(b.ordering_unselected_option.replace("{{function}}","setSelectionOrder").replace("{{option}}",k))}return t}return console.error(b.invalid_selection_array.replace("{{function}}","setSelectionOrder"))},a}(),a=jQuery,a.fn.extend({getSelectionOrder:function(){return ChosenOrder.getSelectionOrder(this)},setSelectionOrder:function(a,b){return ChosenOrder.setSelectionOrder(this,a,b)}}),this.ChosenOrder=function(b){function d(){return c=d.__super__.constructor.apply(this,arguments)}return f(d,b),d.relAttributeName="data-option-array-index",d.isjQueryObject=function(a){return"undefined"!=typeof jQuery&&null!==jQuery&&a instanceof jQuery},d.getDOMElement=function(a){return this.isjQueryObject(a)?a.get(0):a},d.searchChosenUIContainer=function(b){return null!=a(b).data("chosen")?a(b).data("chosen").container[0]:a(b).next(".chosen-container.chosen-container-multi").get(0)},d.triggerEvent=function(b,c){return a(b).trigger(c)},d}(b)}).call(this);