1import{t as e}from"../../config-DSoDowO2.js";var t=function(){let e=document.documentElement.lang||`de`;return e.length>2&&(e=e.substring(0,2)),e},n=new Intl.NumberFormat(t(),{maximumFractionDigits:2}),r=new Intl.DateTimeFormat(t(),{day:`2-digit`,month:`2-digit`,year:`2-digit`,hour:`2-digit`,minute:`2-digit`});async function i(){let e=document.querySelectorAll(`.js-status`);if(!e)return;let t=new Map,n=[];for(let r of e)n.push(a(r,t));if(t.size===0)return;let r=new URL(window.location.toString());r.searchParams.append(`data-api`,`status/get`),r.searchParams.append(`ids`,Array.from(t.keys()).join(`,`)),r.searchParams.append(`no_cache`,`1`);let i=await(await fetch(r)).json();for(let e of n)e(i)}function a(e,t){let{ids:n,capacitySum:r}=JSON.parse(e.innerHTML),{spinner:i,render:a}=e.dataset;for(let e of n)f(t,e);return i=parseInt(i)===1&&m(e),t=>{i&&i.remove(),a===`length`&&_(t,e,n),a===`length-circle`&&v(t,e,n),a===`count`&&y(t,e,n),a===`count-circle`&&b(t,e,n),a===`capacity`&&S(t,e,n),a===`capacity-circle`&&r&&C(t,e,n,r),a===`visitor`&&p(t,e,n),a===`ski-closed-tag`&&o(t,e,n),a===`extra-label-status`&&s(t,e,n),a===`lift-tag`&&d(t,e,n),a===`ski-last-traced-date-tag`&&c(t,e,n),a===`ski-last-traced-date`&&l(t,e,n),a===`ski-last-snow-fall-date`&&u(t,e,n),a===`extra-label-status`&&u(t,e,n)}}function o(t,n,r){let{open:i,closed:a}=h(t,r);if(i.length===0&&a.length===0)return;let o=document.createElement(`li`);o.setAttribute(`role`,`listitem`);let s=i.length>0?e(`labels.ski_status_open`):e(`labels.ski_status_closed`),c=i.length>0?`success`:`alert`;o.classList.add(`tag`,`tag--${c}`),o.innerHTML=s,n.replaceWith(o)}function s(t,n,r){let{open:i,closed:a}=h(t,r);if(i.length===0&&a.length===0)return;let o=document.createElement(`div`),s=document.createElement(`span`),c=i.length>0?e(`labels.status_open`):e(`labels.status_closed`),l=i.length>0?`success`:`danger`;o.classList.add(`tile__extra-label-item`,`tile__extra-label-item--${l}`),s.classList.add(`tile__extra-label-item-label`),s.innerHTML=c,o.appendChild(s),n.replaceWith(o)}function c(t,n,i){let[a]=i,o=t.items[a];if(!o)return;let[s]=o.attributes.filter(e=>e.key===`SnowReportLastGroomed`);if(!s)return;let c=document.createElement(`li`);c.setAttribute(`role`,`listitem`),c.classList.add(`tag`),c.innerHTML=`${e(`labels.ski_last_traced`)}: ${r.format(new Date(s.value))}`,n.replaceWith(c)}function l(t,n,i){let[a]=i,o=t.items[a];if(!o)return;let[s]=o.attributes.filter(e=>e.key===`SnowReportLastGroomed`);if(!s)return;let c=document.createElement(`div`);c.innerHTML=`${e(`labels.ski_last_traced`)}: ${r.format(new Date(s.value))}`,n.replaceWith(c)}function u(t,n,i){let[a]=i;if(!a||!t.items)return;let o=t.items[a];if(!o)return;let[s]=o.attributes.filter(e=>e.key===`SnowReportLastTrace`);if(!s)return;let c=document.createElement(`div`);c.innerHTML=`${e(`labels.ski_last_snow_fall`)}: ${r.format(new Date(s.value))}`,n.replaceWith(c)}function d(t,n,r){let{open:i}=h(t,r),a=document.createElement(`div`);a.innerHTML=i.length>0?` 2 <div class="tag tag--success"> 3 ${e(`labels.lift_status_open`)} 4 </div>`:` 5 <div class="tag tag--alert"> 6 ${e(`labels.lift_status_closed`)} 7 </div>`,n.replaceWith(a)}function f(e,t){e.has(t)||e.set(t,null)}function p(t,n,r){let i=t.items[r[0]],a;for(let e of i.attributes)if(e.key===`PeopleCounterState`){a=e.value;break}if(a!==`low`&&a!==`medium`&&a!==`high`){console.warn(`1726846335: Unable to determine the state`);return}let o=e(`visitors.icons.${a}`),s=e(`labels.visitors_${a}`),c=document.createDocumentFragment(),l=document.createElement(`div`);l.classList.add(`grid-tile__icon`,`grid-tile__icon--circle`,`grid-tile__icon--${a}`),l.innerHTML=`<i class="icon" aria-hidden="true"><svg class="icon__svg" data-url="/dist/svg/icons/default/${o}.svg"></svg></i>`;let u=document.createElement(`div`);u.classList.add(`grid-tile__subheader`,`typo-xs`),u.textContent=s,c.append(l,u),n.replaceWith(c)}function m(e){let t=document.createElement(`span`);return t.classList.add(`loading-indicator`,`loading-indicator--inline`),t.innerHTML=`<span class="loading-indicator__inner"></span>`,e.after(t),t}function h(e,t){let n=[],r=[];for(let i of t){if(!i||!e.items)continue;let t=e.items[i];if(!t||!t.attributes)continue;let a=new Map;for(let{key:e,value:n}of t.attributes)a.set(e,n);let o=g(a);o.open===1&&r.push(t),o.closed===1&&n.push(t)}return{open:r,closed:n}}function g(e){return e.set(`TrackState`,e.has(`TrackState`)?String(e.get(`TrackState`)).toLowerCase():``),e.set(`LockStatus`,e.has(`LockStatus`)?String(e.get(`LockStatus`)).toLowerCase():``),e.set(`SnowReportTrackState`,e.has(`SnowReportTrackState`)?String(e.get(`SnowReportTrackState`)).toLowerCase():``),[`open`,`closed`].includes(e.get(`TrackState`))?{open:+(e.get(`TrackState`)===`open`),closed:+(e.get(`TrackState`)===`closed`)}:[`open`,`locked`].includes(e.get(`LockStatus`))?{open:+(e.get(`LockStatus`)===`open`),closed:+(e.get(`LockStatus`)===`locked`)}:[`open`,`closed`].includes(e.get(`SnowReportTrackState`))?{open:+(e.get(`SnowReportTrackState`)===`open`),closed:+(e.get(`SnowReportTrackState`)===`locked`)}:{open:0,closed:0}}function _(e,t,r){let{open:i}=h(e,r),a=i.reduce((e,t)=>
7e+t.length,0),o=document.createElement(`span`);o.innerText=n.format(a/1e3),t.replaceWith(o)}function v(e,t,n){let{open:r}=h(e,n),i=r.reduce((e,t)=>e+t.length,0),a=document.createElement(`span`);i>0?a.classList.add(`grid-tile__status`,`grid-tile__status--open`):a.classList.add(`grid-tile__status`,`grid-tile__status--closed`),t.replaceWith(a)}function y(e,t,n){let{open:r}=h(e,n),i=document.createElement(`span`);i.innerText=String(r.length),t.replaceWith(i)}function b(e,t,n){let{open:r}=h(e,n),i=document.createElement(`span`);r.length>0?i.classList.add(`grid-tile__status`,`grid-tile__status--open`):i.classList.add(`grid-tile__status`,`grid-tile__status--closed`),t.replaceWith(i)}function x(e,t){let n=0;for(let r of t){let t=e.items[r];if(t){for(let e of t.attributes)if(e.key===`PeopleCounterValue`&&parseInt(e.value)>0){n+=parseInt(e.value);break}}}return n}function S(e,t,n){let r=x(e,n),i=document.createElement(`span`);i.innerText=String(r),t.replaceWith(i)}function C(e,t,n,r){let i=x(e,n),a=document.createElement(`span`);i<r?a.classList.add(`grid-tile__status`,`grid-tile__status--open`):a.classList.add(`grid-tile__status`,`grid-tile__status--closed`),t.replaceWith(a)}i();export{t as getLangParameter};
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.