PageSourceSearch

https://ustka.ug.gov.pl/js/prod/transpiled/custom-select.js?ts=1790068796

js ustka.ug.gov.pl collected 2026-09-24 23:20:45 UTC 3,092 bytes, 1 lines download raw bytes

1function closeSelects(e){let t=document.querySelectorAll(".js__customSelect.-active");if(t)for(let s of t)e!==s&&s.classList.remove("-active")}const customSelect=e=>{e||(e=document.body);let t=e.querySelectorAll(".js__customSelectContainer");for(let e of t)if(!e.classList.contains("customSelect--disabled")){let t=e.classList.contains("js__customSelectContainer--event_added"),s=e.querySelector(".js__customSelect"),c=s.querySelector(".js__customSelect--label"),o=s.querySelector(".js__customSelect--text"),i=s.querySelector(".js__customSelect--optionList"),a=i.querySelectorAll(".js__customSelect--option"),n=e.querySelector(".js__customSelect--select");if(n&&o&&!t){e.classList.add("js__customSelectContainer--event_added");const t=n.hasAttribute("multiple");window.deviceInfo.isMobile&&!t&&n.addEventListener("change",e=>{let t=n.options;for(let e of t)if(e.selected){o.innerHTML=e.innerHTML;break}}),c.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation();let t=!1;s.classList.contains("-active")&&(t=!0),t?(s.setAttribute("aria-expanded",!1),s.classList.remove("-active")):(s.setAttribute("aria-expanded",!0),s.classList.add("-active"))}),c.addEventListener("keyup",e=>{if(e.preventDefault(),e.stopPropagation(),32===e.code||"Space"===e.code){let e=!1;s.classList.contains("-active")&&(e=!0),e?(c.focus({focusVisible:!0}),s.setAttribute("aria-expanded",!1),s.classList.remove("-active")):(s.classList.add("-active"),s.setAttribute("aria-expanded",!0))}});for(let e of a)e.addEventListener("click",c=>{if(c.preventDefault(),c.stopPropagation(),t){let t=e.querySelector('input[type="checkbox"]'),s=e.classList.toggle("customSelectOptionList__option--selected");t&&(t.checked=s);for(let t of n.options)t.value==e.dataset.value&&(t.selected=s);let c=[];a.forEach(e=>{if(e.classList.contains("customSelectOptionList__option--selected")){let t=e.querySelector(".customSelectOptionList__label");t&&c.push(t.innerHTML)}}),c.length?o.innerHTML=c.join(", "):(console.log(o.dataset.default_text),o.innerHTML=o.dataset.default_text||""),n.dispatchEvent(new Event("change",{bubbles:!0}))}else{let t=i.querySelector(".customSelectOptionList__option--selected");t&&t.classList.remove("customSelectOptionList__option--selected"),o.innerHTML=e.innerHTML,e.classList.add("customSelectOptionList__option--selected"),n.value=e.dataset.value,n.dispatchEvent(new Event("change")),s.setAttribute("aria-expanded",!1),s.classList.remove("-active")}}),e.addEventListener("focusin",e=>{e.preventDefault(),e.stopPropagation(),s.setAttribute("aria-expanded",!0),s.classList.add("-active")}),e.addEventListener("focusout",e=>{e.preventDefault(),e.stopPropagation(),s.setAttribute("aria-expanded",!1),s.classList.remove("-active")}),e.addEventListener("keyup",e=>{e.preventDefault(),e.stopPropagation(),32!==e.code&&"Space"!==e.code||(c.focus({focusVisible:!0}),s.classList.remove("-active"),s.setAttribute("aria-expanded",!1))})}}};document.addEventListener("DOMContentLoaded",function(){window.addEventListener("click",function(e){e.target.closest(".js__customSelect--optionList")||closeSelects()})});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.