let dleFilter = { path: window.location.pathname, title: document.title, content: false, speedbar: false, reset: false, id: '', original: {}, ajax: 0, lazy: 1, ajaxUrl: 0, hideLoading: 0, button: 1, jsSelect: 1, ajaxNav: 0, ajaxPage: 0, ajaxAnim: 0, ionSlider: 0, navApart: 0, filterUrl: 'f', defaultUrl: '/f/sort=date/order=desc/' }; /* pytesNET/tail.select v.0.5.16 | Basic Version | @author SamBrishes, pytesNET | @license MIT */ !function(e,t){"function"==typeof define&&define.amd?define(function(){return t(e)}):"object"==typeof module&&module.exports?module.exports=t(e):(void 0===e.tail&&(e.tail={}),e.tail.select=t(e),"undefined"!=typeof jQuery&&(jQuery.fn.tailselect=function(e){var t,i=[];return this.each(function(){!1!==(t=tail.select(this,e))&&i.push(t)}),1===i.length?i[0]:0!==i.length&&i}),"undefined"!=typeof MooTools&&Element.implement({tailselect:function(e){return new tail.select(this,e)}}))}(window,function(e){"use strict";var r=e,h=e.document;function b(e,t){return!!(e&&"classList"in e)&&e.classList.contains(t)}function c(e,t){return e&&"classList"in e?e.classList.add(t):void 0}function d(e,t){return e&&"classList"in e?e.classList.remove(t):void 0}function s(e,t,i){if(CustomEvent&&CustomEvent.name)var n=new CustomEvent(t,i);else(n=h.createEvent("CustomEvent")).initCustomEvent(t,!!i.bubbles,!!i.cancelable,i.detail);return e.dispatchEvent(n)}function u(e,t){if("function"==typeof Object.assign)return Object.assign({},e,t||{});var i=Object.constructor();for(var n in e)i[n]=n in t?t[n]:e[n];return i}function g(e,t){var i=h.createElement(e);return i.className=t&&t.join?t.join(" "):t||"",i}var a,p=function(e,t){if((e="string"==typeof e?h.querySelectorAll(e):e)instanceof NodeList||e instanceof HTMLCollection||e instanceof Array){for(var i=[],n=e.length,s=0;s 4 && num%100 < 20)? 2: cases[(num%10 < 5)? num%10: 5]];return "Выбор до :limit " + string + " ...";},search:"Начните набирать для поиска...",disabled:"Поле отключено"},modify:function(e,t,i){if(!(e in this))return!1;if(t instanceof Object)for(var n in t)this.modify(e,n,t[n]);else this[e][t]="string"==typeof i?i:this[e][t];return!0},register:function(e,t){return"string"==typeof e&&t instanceof Object&&(this[e]=t,!0)}},p.prototype={_e:function(e,t,i){if(!(e in this.__))return i||e;if("function"==typeof(e=this.__[e])&&(e=e.call(this,t)),"object"==typeof t)for(var n in t)e=e.replace(n,t[n]);return e},init:function(){var t=this,e=["tail-select"],i=this.con,n=!0===i.classNames?this.e.className:i.classNames;e.push(n&&n.push?n.join(" "):n&&n.split?n:"no-classes"),i.hideSelected&&e.push("hide-selected"),i.hideDisabled&&e.push("hide-disabled"),0==i.multiLimit&&e.push("disabled"),i.multiple&&e.push("multiple"),i.deselect&&e.push("deselect"),e.push("dle-filter-select-" + Object.values(t)[0].name),i.disabled&&e.push("disabled"),this.__=u(p.strings.en,p.strings[i.locale]||{}),this._init=!0,this._query=!1,this.select=g("DIV",e),this.label=g("DIV","select-label"),this.dropdown=g("DIV","select-dropdown"),this.search=g("DIV","dropdown-search"),this.csvInput=g("INPUT","select-search"),null!==this.e.getAttribute("tabindex")?this.select.setAttribute("tabindex",this.e.getAttribute("tabindex")):this.select.setAttribute("tabindex",0),i.width&&/^[0-9.]+(?:cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|\%)$/i.test(i.width)?this.select.style.width=i.width:i.width&&!isNaN(parseFloat(i.width,10))&&(this.select.style.width=i.width+"px"),this.label.addEventListener("click",function(e){t.toggle.call(t,t.con.animate)}),this.select.appendChild(this.label),isNaN(parseInt(i.height,10))||(this.dropdown.style.maxHeight=parseInt(i.height,10)+"px"),i.search&&(this.search.innerHTML='',this.search.children[0].placeholder=this._e("search"),this.search.children[0].addEventListener("input",function(e){t.query.call(t,this.value.length>i.searchMinLength?this.value:void 0)}),this.dropdown.appendChild(this.search)),this.select.appendChild(this.dropdown),this.csvInput.type="hidden",i.csvOutput&&(this.csvInput.name=this.e.name,this.e.removeAttribute("name"),this.select.appendChild(this.csvInput)),i.multiple&&i.multiContainer&&(h.querySelector(i.multiContainer)?(this.container=h.querySelector(i.multiContainer),this.container.className+=" tail-select-container"):!0===i.multiContainer&&(this.container=this.label,this.container.className+=" tail-select-container")),this.options=new a(this.e,this);for(var s=this.e.options.length,l=0;le.clientHeight?e.clientHeight:t,this.con.search&&(i=e.querySelector(".dropdown-search").clientHeight),this.dropdown.parentElement.removeChild(e);var s=this.select.getBoundingClientRect(),l=r.innerHeight-(s.top+s.height),o=ll;return!0===this.con.openAbove||!1!==this.con.openAbove&&o?(o=!0,t=Math.min(t,s.top-10),c(this.select,"open-top")):(o=!1,t=Math.min(t,l-10),d(this.select,"open-top")),n&&(this.dropdown.style.maxHeight=t+"px",n.style.maxHeight=t-i+"px"),this},query:function(e,t){var i,n,s,l,o,r,a=this,c=this.con,h="getAttribute",d=g("DIV","dropdown-inner"),u=e?"finder":"walker",p=e?[e,t]:[c.sortItems,c.sortGroups];for(this._query="string"==typeof e&&e;i=this.options[u].apply(this.options,p);){if(!s||s&&s[h]("data-group")!==i.group){if(!((n=(c.cbLoopGroup||this.cbGroup).call(this,i.group,e,d))instanceof Element))break;(s=n).setAttribute("data-group",i.group),d.appendChild(s)}if(null!==(l=(c.cbLoopItem||this.cbItem).call(this,i,s,e,d))){if(!1===l)break;l.setAttribute("data-key",i.key),l.setAttribute("data-group",i.group),l.addEventListener("click",function(e){if(!this.hasAttribute("data-key"))return!1;var t=this[h]("data-key"),i=this[h]("data-group")||"#";a.options.toggle.call(a.options,t,i)&&(!1!==a.con.stayOpen||a.con.multiple||a.close.call(a,a.con.animate))}),s.appendChild(l)}}var f=d.querySelectorAll("*[data-key]").length;0==f&&(this.con.cbEmpty||function(e){var t=g("SPAN","dropdown-empty");t.innerText=this._e("empty"),e.appendChild(t)}).call(this,d,e),0'+e+"",this.con.multiple&&this.con.multiLimit==1/0&&this.con.multiSelectAll&&(i=g("BUTTON","tail-none"),n=g("BUTTON","tail-all"),i.innerText=this._e("none"),i.addEventListener("click",function(e){e.preventDefault();var t=this.parentElement.parentElement.getAttribute("data-group");l.options.all.call(l.options,"unselect",t)}),n.innerText=this._e("all"),n.addEventListener("click",function(e){e.preventDefault();var t=this.parentElement.parentElement.getAttribute("data-group");l.options.all.call(l.options,"select",t)}),s.children[0].appendChild(i),s.children[0].appendChild(n))),s},cbItem:function(e,t,i){var n=g("LI","dropdown-option"+(e.selected?" selected":"")+(e.disabled?" disabled":""));return i&&0$1")):n.innerText=e.value,this.con.descriptions&&e.description&&(n.innerHTML+=''+e.description+""),n},update:function(e){return this.updateLabel().updateContainer(e).updatePin(e).updateCSV(e)},updateLabel:function(e){if(this.container==this.label&&0",t=i.multiShowLimit&&i.multiLimit<1/0,i.multiple&&i.multiShowCount&&(e=(e=':c'+e).replace(":c",n+(t?" / "+i.multiLimit:""))),this.label.innerHTML=e,this},updateContainer:function(e){if(!this.container||!this.con.multiContainer)return this;var t="[data-group='"+e.group+"'][data-key='"+e.key+"']";if(this.container.querySelector(t))return e.selected||this.container.removeChild(this.container.querySelector(t)),this;if(e.selected){var n=this,i=g("DIV","select-handle");i.innerText=e.value,i.setAttribute("data-key",e.key),i.setAttribute("data-group",e.group),i.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation();var t=this.getAttribute("data-key"),i=this.getAttribute("data-group");n.options.unselect.call(n.options,t,i)}),this.container.appendChild(i)}return this},updatePin:function(e){var t=this.dropdown.querySelector(".dropdown-inner ul"),i="li[data-key='"+e.key+"'][data-group='"+e.group+"']";if(!this.con.multiPinSelected||!t||!1!==this._query)return this;if(i=this.dropdown.querySelector(i),e.selected)t.insertBefore(i,t.children[0]);else{for(var n=this.dropdown.querySelector("ul[data-group='"+e.group+"']"),s=this.options[e.index-1],l=!1;s&&s.group==e.group&&!(l=n.querySelector("li[data-key='"+s.key+"']"));)s=this.options[s.index-1];l&&l.nextElementSibling?n.insertBefore(i,l.nextElementSibling):n.appendChild(i)}return this},updateCSV:function(e){if(!this.csvInput||!this.con.csvOutput)return this;for(var t=[],i=this.options.selected.length,n=0;n=l.multiLimit&&(e.selected=!1),!e.selected||!l.deselect||e.hasAttribute("selected")&&0!=l.multiLimit||(e.selected=!1,e.parentElement.selectedIndex=-1),e.hasAttribute("data-description")){var o=g("SPAN");o.innerHTML=e.getAttribute("data-description"),e.setAttribute("data-description",o.innerHTML)}return this.items[n][s]={key:i,value:e.text,description:e.getAttribute("data-description")||null,group:n,option:e,optgroup:"#"!=n?this.groups[n]:void 0,selected:e.selected,disabled:e.disabled,hidden:e.hidden||!1},this.length++,e.selected&&this.select(this.items[n][s]),e.disabled&&this.disable(this.items[n][s]),!t||this.self.callback(this.items[n][i],"rebuild")},add:function(e,t,i,n,s,l,o){if(e instanceof Object){for(var r in e)this.add(e[r].key||r,e[r].value,e[r].group,e[r].selected,e[r].disabled,e[r].description,!1);return this.self.query()}if(this.get(e,i))return!1;if("#"!==(i="string"==typeof i?i:"#")&&!(i in this.groups)){var a=g("OPTGROUP");a.label=i,a.setAttribute("data-select-optgroup","add"),this.element.appendChild(a),this.items[i]={},this.groups[i]=a}this.self.con.multiple&&this.selected.length>=this.self.con.multiLimit&&(n=!1),s=!!s;var c=h.createElement("OPTION");return c.value=e,c.selected=n,c.disabled=s,c.innerText=t,c.setAttribute("data-select-option","add"),l&&0