PageSourceSearch

https://www.tirolo.com/_assets/1798f66a72c0609b2ee5b404d10475ff/Di…/Organisms/FormFramework.js?1790252148

js tirolo.com collected 2026-09-24 23:16:21 UTC 2,888 bytes, 1 lines download raw bytes

1(()=>{"use strict";(()=>{const e="-js-climbing-select-loading",t="-js-climbing-select--empty";class s{selects;selectsByLevel=new Map;placeholderLabels=new Map;constructor(e){this.selects=e,this.selects.forEach((e=>{void 0!==e.dataset.level&&this.selectsByLevel.set(e.dataset.level,e),this.placeholderLabels.set(e,e.options[0]?.textContent??"")})),this.selects.forEach((e=>this.register(e))),this.selects.filter((e=>void 0!==e.dataset.depends)).forEach((e=>{e.disabled=!0,this.setGroupVisible(e,!1)})),this.selects.filter((e=>void 0===e.dataset.depends)).forEach((e=>{this.load(e)}))}register(e){e.addEventListener("change",(()=>{this.updateTitle(e),this.reloadDependents(e.dataset.level??"")}))}setGroupVisible(e,t){e.closest(".form-group")?.classList.toggle("-js-climbing-select-group--hidden",!t)}reloadDependents(e){this.selects.forEach((t=>{const s=(t.dataset.depends??"").split(",").filter(Boolean);if(!s.includes(e))return;this.reset(t),this.reloadDependents(t.dataset.level??"");const l=s.every((e=>""!==this.valueOf(e)));this.setGroupVisible(t,l),l&&this.load(t)}))}valueOf(e){return this.selectsByLevel.get(e)?.value??""}
1parentParams(e){const t={location:()=>({region:this.valueOf("region"),discipline:this.valueOf("discipline")}),sector:()=>({parent:this.valueOf("location")}),route:()=>({parent:this.valueOf("sector")})};return t[e]?.()??{}}async load(t){const s=t.dataset.level??"",l=new URLSearchParams({level:s,language:document.documentElement.lang,...this.parentParams(s)});t.parentElement?.classList.add(e);try{const e=await fetch(`/autocomplete/dangerreportoptions?${l.toString()}`,{headers:{Accept:"application/json"}}),s=await e.json();this.fill(t,Array.isArray(s)?s:[])}catch{this.reset(t)}finally{t.parentElement?.classList.remove(e)}}fill(e,s){this.reset(e),s.forEach((t=>{const s=document.createElement("option");s.value=String(t.id),s.textContent=t.title,e.appendChild(s)})),0===s.length&&(e.options[0].textContent=e.dataset.noResultsLabel??this.placeholderLabels.get(e)??"",e.classList.add(t)),void 0!==e.dataset.depends&&(e.disabled=0===s.length)}reset(e){for(;e.options.length>1;)e.remove(1);e.options[0].textContent=this.placeholderLabels.get(e)??"",e.classList.remove(t),e.selectedIndex=0,void 0!==e.dataset.depends&&(e.disabled=!0),this.updateTitle(e)}updateTitle(e){const t=e.dataset.titleTarget;if(void 0===t)return;const s=document.querySelector(`input[name$="[${t}]"]`);s&&(s.value=e.selectedOptions[0]?.textContent?.trim()??"")}}const l=[],a=document.getElementsByClassName("contentForm"),i=(e,t)=>{const s="-js-input--filled";""!==t.trim()?e.classList.add(s):e.classList.remove(s)};Array.from(a).forEach((e=>{e.querySelectorAll("input").forEach((e=>{(e=>{i(e,e.value),e.addEventListener("input",(t=>{i(e,t.target.value)}))})(e)}))})),(()=>{const e=Array.from(document.querySelectorAll(".-js-climbing-select"));e.length>0&&l.push(new s(e))})()})()})();

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.