(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))l(n);new MutationObserver(n=>{for(const e of n)if(e.type==="childList")for(const a of e.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&l(a)}).observe(document,{childList:!0,subtree:!0});function r(n){const e={};return n.integrity&&(e.integrity=n.integrity),n.referrerPolicy&&(e.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?e.credentials="include":n.crossOrigin==="anonymous"?e.credentials="omit":e.credentials="same-origin",e}function l(n){if(n.ep)return;n.ep=!0;const e=r(n);fetch(n.href,e)}})();const y=document.querySelector(".nc-slider-desktop");y&&new Flickity(y,{imagesLoaded:!0,pageDots:!1,prevNextButtons:!1,wrapAround:!0,autoPlay:3e3});const S=document.querySelectorAll(".news-toggle"),A=document.querySelectorAll(".news-content");S.forEach((t,o)=>{const r=A[o];t.addEventListener("click",l=>{r.parentElement.classList.toggle("is-open"),r.getAttribute("aria-hidden")==="false"?(r.setAttribute("aria-hidden","true"),l.currentTarget.innerHTML="Mehr Lesen"):(r.setAttribute("aria-hidden","false"),l.currentTarget.innerHTML="Weniger Lesen")})});gsap.registerPlugin(ScrollTrigger);function w(t){let o=2e3,r=100,l=o/r,n=0,e=parseFloat(t.getAttribute("data-end-value").replace(",",".")),a=(e-n)/r,i=0,u=Number.isInteger(e),c=setInterval(function(){i+=1;let s=n+a*i;s>=e&&(s=e,clearInterval(c)),u?t.textContent=Math.round(s).toLocaleString("de-DE"):t.textContent=s.toFixed(1).replace(".",",")},l)}let x=document.querySelectorAll(".nc-stat");x.forEach(t=>{ScrollTrigger.create({trigger:t,start:"top 95%",onEnter:()=>{setTimeout(()=>{w(t)},400)},once:!0})});document.querySelectorAll(".nc-fade-in").forEach(t=>{gsap.from(t,{autoAlpha:0,duration:1,scrollTrigger:{trigger:t,start:"top 80%",once:!0}})});function C(){const t=document.getElementById("ab-ausgaben").getContext("2d");new Chart(t,{type:"doughnut",data:{labels:["Afrika","Mittel-/Lateinamerika","Europa","Asien","Global Support Unit*"],datasets:[{data:[44.54,9.62,11.4,32.16,2.28],backgroundColor:["#00004f","#d0dfec","#5a7cb3","#98b3d2","#e1e1e1"],borderWidth:1}]},options:{responsive:!0,rotation:-68,animation:{duration:3e3},plugins:{legend:{display:!1},tooltip:{callbacks:{label:function(o){return` ${o.raw.toFixed(2)}%`}}}}}})}function E(){const t=document.getElementById("jb-hauptleistungen").getContext("2d");new Chart(t,{type:"doughnut",data:{labels:["Ambulante Angebote","Rettung und medizinische Dienste","Bildung und Erziehung"],datasets:[{data:[408,797,405],backgroundColor:["#00004f","#5a7cb3","#98b3d2"],borderWidth:1}]},options:{responsive:!0,animation:{duration:3e3},plugins:{legend:{display:!1}}}})}function B(){const t=document.getElementById("jb-werbeausgaben").getContext("2d");new Chart(t,{type:"doughnut",data:{labels:["Ausgaben für die Öffentlichkeitsarbeit und Werbung","Ausgaben für Verwaltung","Sonstige Aufwendungen"],datasets:[{data:[2.8,9.05,88.15],backgroundColor:["#5a7cb3","#98b3d2","#00004f"],borderWidth:1}]},options:{responsive:!0,animation:{duration:3e3},plugins:{legend:{display:!1},tooltip:{callbacks:{label:function(o){return` ${o.raw.toFixed(2)}%`}}}}}})}function k(){const t=document.getElementById("jb-ghelfen").getContext("2d");new Chart(t,{type:"doughnut",data:{labels:["Verwaltung und sonstige Bereiche","Humanitäre Hilfe","Rettungs- und Fahrdienst","Ausbildung","Soziale Dienste","Arbeit mit Kindern und Jugendlichen"],datasets:[{data:[2247,134,9399,626,9682,8573],backgroundColor:["#6a7794","#99a4b9","#31354d","#ecc6bc","#d01c3c","#e9a38f"],borderWidth:1}]},options:{responsive:!0,animation:{duration:3e3},plugins:{legend:{display:!1}}}})}document.querySelector("#jb-ghelfen")&&ScrollTrigger.create({trigger:"#jb-ghelfen",start:"middle 80%",onEnter:()=>{k()},once:!0});function F(){const t=document.getElementById("jb-ghelfenbar").getContext("2d"),o={labels:["Freiwilliges Soziales und Ökologisches Jahr","Azubis","Bundesfreiwilligendienst"],datasets:[{data:[1137,1305,399],backgroundColor:["#343852","#de1e40","#717f9e"],barPercentage:.35,categoryPercentage:2.1}]},r={responsive:!0,animation:{duration:3e3},scales:{x:{display:!1},y:{display:!1,beginAtZero:!0}},plugins:{legend:{display:!1},tooltip:{enabled:!1},datalabels:{display:!1}}};new Chart(t,{type:"bar",data:o,options:r,plugins:[{afterDatasetsDraw:(l,n,e)=>{const a=l.ctx;l.scales.y&&(a.textAlign="right",a.textBaseline="left",a.fillStyle="#FFFFFF",a.font="bold 32px Arial",l.data.labels.forEach((u,c)=>{l.data.datasets.forEach((s,g)=>{const d=l.getDatasetMeta(g),f=s.data[c],b=d.data[c].y;f!==null&&(a.save(),a.translate(d.data[c].x,b),a.rotate(-Math.PI/2),a.fillText(f,-20,10),a.restore())})}))}}]})}document.querySelector("#jb-ghelfenbar")&&ScrollTrigger.create({trigger:"#jb-ghelfenbar",start:"middle 80%",onEnter:()=>{F()},once:!0});function v(){const t=document.getElementById("jb-entwicklung").getContext("2d");new Chart(t,{type:"bar",data:{labels:["2020","2021","2022"],datasets:[{label:"Segment 1",data:[1131,1472,1610],backgroundColor:"#00004f",stack:"Stack 0",barPercentage:.6,categoryPercentage:.8},{label:"Zuweisungen, Zuschüsse und Sonstiges",data:[158,175,214],backgroundColor:"#5a7cb3",stack:"Stack 0",barPercentage:.6,categoryPercentage:.8},{label:"Sonstige betriebliche Erträge",data:[97,110,126],backgroundColor:"#98b3d2",stack:"Stack 0",barPercentage:.6,categoryPercentage:.8}]},options:{responsive:!0,animation:{duration:3e3},scales:{x:{border:{display:!1},grid:{display:!1},ticks:{color:"rgb(0, 0, 84)",font:{size:18}}},y:{display:!1,grid:{display:!1},ticks:{display:!1}}},plugins:{legend:{display:!1}}},plugins:[{afterDatasetsDraw:(o,r,l)=>{const n=o.ctx,e=o.scales.y;e&&(n.textAlign="center",n.textBaseline="middle",n.fillStyle="#FFFFFF",o.data.labels.forEach((a,i)=>{let u=0;o.data.datasets.forEach((c,s)=>{const g=o.getDatasetMeta(s),d=c.data[i];if(g.data[i].y,d!==null){const f=u+d/2,b=e.getPixelForValue(f);u+=d,n.fillText(d,g.data[i].x,b)}})}))}}]})}const T=document.querySelectorAll(".section-toggle"),P=document.querySelectorAll(".section-content"),m={"ab-ausgaben":C,"jb-hauptleistungen":E,"jb-werbeausgaben":B,"jb-entwicklung":v},p=new Set,h=new Set;T.forEach((t,o)=>{const r=P[o],l=r.getAttribute("data-section");t.addEventListener("click",()=>{if(r.parentElement.classList.toggle("is-open"),r.getAttribute("aria-hidden")==="false")r.setAttribute("aria-hidden","true");else{if(r.setAttribute("aria-hidden","false"),r.querySelectorAll("canvas").forEach(e=>{const a=e.id;a&&m[a]&&!p.has(a)&&(h.has(a)||(ScrollTrigger.create({trigger:`#${a}`,start:"middle 80%",onEnter:()=>{p.has(a)||(m[a](),p.add(a))},once:!0}),h.add(a)))}),l==="type1"){const e=r.querySelectorAll(".bar-AB");e.length>0&&gsap.from(e,{duration:3,scaleX:0,transformOrigin:"100% 50%",ease:"power1.out"})}if(l==="type2"){const e=r.querySelectorAll(".bar-AB2");e.length>0&&gsap.from(e,{duration:3,scaleY:0,transformOrigin:"50% 100%",ease:"power1.out"})}}})});