1import{c as U,a as ne}from"./index.min.BtCuc2I1.js";import{a as $e}from"./index.min.BAJ2LPJB.js";import{b as Se}from"./animateNumber.min.BiIHeyp_.js";import{p as ve}from"./date.min.D-VnCEAh.js";import{p as qe}from"./push-to-data-layer.min.C8CHL4zw.js";import{d as Qe}from"./utils.min.CXzR3bd8.js";import"./customParseFormat.min.Dsuh_q6V.js";import"./exports.min.29dHnKCk.js";function Le(t,u){const{defaultOptions:c,optionsToNameMapping:E}=u,$=ne(c),h=U([$,t],(P,B)=>{const W=E(P);return{premium:(B.find(H=>W===H.name)||B[0]).premium,technicalName:W,options:P}}),D=$e($,"setOption",(P,B,W)=>{const k={...P.get()};k[B]!==W&&(k[B]=W,P.set(k))});return{$tariff:h,setOption:D}}function Fe(t,u){const c=ne(!1);let E=!1,$=!1;const h=new IntersectionObserver(D=>{for(const P of D)switch(P.target){case u:E=P.isIntersecting;break;case t:$=P.isIntersecting;break}c.set($&&!E)},{threshold:0,rootMargin:"0px"});return h.observe(t),h.observe(u),c}let Re=0;const Ke=window.scrollToTarget;let f=[];const Ge={...ve.insuranceCategory&&ve.insuranceCategory!=="na"&&{insurance_category:ve.insuranceCategory},...ve.insuranceGroup&&ve.insuranceGroup!=="na"&&{insurance_group:ve.insuranceGroup}},ot=async t=>{f=Array.from(t.querySelectorAll("[data-tariff]")).map(d=>d.getAttribute("data-tariff")).filter(d=>d!==null);const u=["expat","first-pro","business-pro","economy","business","first","cshi-comfort2021","cshi-premium2021","cshi-basic2021","cshi-exclusive-guarantor-gen2","cshi-exclusive-flex-gen2","chi-student-smart","chi-student-protect","chi-student-free","tuc-zweibett","tuc-einbett","tud-business","tud-first","tud-economy","tuchi-xall-900","tuchi-xall-1500","tuchi-xall-600","tuchi-xall-300","tuchi-xall-1200"].filter(d=>f.indexOf(d)!==-1),c=window.matchMedia("(max-width: 767px)"),E=window.matchMedia("(max-width: 1199px)"),$=f.includes("tud-business"),h=t.classList.contains("dental-mdm");$&&!h&&c.matches&&document.addEventListener("dentalPreSelection",d=>{v.$selection.set(["tud-"+d.detail.tariff])});let D;(d=>{d.ECONOMY="economy",d.BUSINESS="business",d.FIRST="first"})(D||(D={}));let P;(d=>{d.CARE="care",d.BONUS="bonus"})(P||(P={}));let B=[],W=!0;if(h){let d=function(o){re.forEach(r=>{const g=r;c.matches&&g.dataset.generalTariff?g.classList.toggle("hide-header",!o.startsWith(g.dataset.generalTariff)):g.classList.remove("hide-header")}),z&&z.forEach(r=>{const g=r;g.dataset.mobileTariffSwitch&&g.classList.toggle("active",o.startsWith(g.dataset.mobileTariffSwitch))}),le&&le.forEach(r=>{const g=r;g.dataset.tariffSegment&&g.classList.toggle("active",o.startsWith(g.dataset.tariffSegment))})},J=function(o){var g;z.forEach(C=>{o.classList.toggle("active",C===o)});const r=(g=o.dataset.mobileTariffSwitch)==null?void 0:g.replace("tud-","");r&&(B=[Y[r]],d(Y[r]),v.$selection.set(B))},F=function(o){return o.split("-")},ge=function(o){const[r,g]=F(o.name);if(r in b&&g in b[r]){b[r][g]=o.value==="2";const C=oe(r);Y[r]=C,B=c.matches?[C]:Object.values(Y).filter(ye=>ye!==""),d(C)}},oe=function(o){const r=b[o].care,g=b[o].bonus;let C="";return r&&g?C="-premium":r&&!g?C="-care":!r&&g&&(C="-bonus"),o==="first"&&(C==="-bonus"||C==="-premium")&&(C=C==="-bonus"?"":"-care"),"tud-".concat(o).concat(C,"-v2")};const z=t.querySelectorAll(".mobile-general-tariff-buttons button"),be=t==null?void 0:t.querySelectorAll("input"),le=t==null?void 0:t.querySelectorAll("div[data-tariff-segment]"),re=t.querySelectorAll("[data-general-tariff]");document.addEventListener("dentalPreSelection",(o=>{const r=Array.from(z).find(g=>{var C;return(C=g.dataset.mobileTariffSwitch)==null?void 0:C.includes(o.detail.tariff)});r==null||r.click()}));const b={economy:{care:!1,bonus:!1},business:{care:!1,bonus:!1},first:{care:!1,bonus:!1}},Y={economy:"",business:"",first:""},R=new MutationObserver(o=>{for(const r of o)switch(r.type){case"attributes":if(r.attributeName==="checked"){const g=r.target;g.checked&&(ge(g),v.$selection.set(B))}break}});Array.from(be).reverse().forEach(o=>{o.checked&&ge(o),R.observe(o,{attributes:!0})}),z.forEach(o=>{o.addEventListener("click",()=>{J(o)})})}const k=()=>$?c.matches?1:E.matches?3:f.length:c.matches?2:E.matches?3:f.length,v=Ye(h?B:u,k(),"benefits-table-2024",!0),H=t.querySelectorAll("thead tr"),M=t.querySelectorAll(".mdm-headers-inputs-wrapper > div"),N=Array.from(t.querySelectorAll("tbody tr")),_=t.querySelector(".notification-container");if(!H.length&&!N.length)return;c.addEventListener("change",()=>v.maxLength=k()),E.addEventListener("change",()=>v.maxLength=k()),t.id||(t.id="tariff_table_".concat(Re++));const Q=t.querySelector("table"),Ee=Q.querySelector("thead"),he=t.querySelector(".sticky");Fe(Q,Ee).subscribe(d=>{he==null||he.classList.toggle("is-sticky",d)});const me=t.querySelector(".table-styles"),K=t.querySelector(".tariff-selection-cards");K&&(K.querySelectorAll(".tariff-selection-card").length<3&&(K.style.display="none"),window.innerWidth>576&&window.innerWidth<768?f.length%2===0&&K.style.setProperty("--columns","2"):window.innerWidth>=768&&K.style.setProperty("--columns",f.length.toString()));for(const d of t.querySelectorAll("[data-tariff-selector]")){const J=d.dataset.tariff;if(!J)return;U(v.$selection,F=>F.includes(J)).subscribe(F=>d.checked=F),d.addEventListener("change",()=>v.select(J))}const te=t.querySelector("[data-tariff-select-desktop]");te&&te.addEventListener("change",()=>v.setPreset(te.value));const pe=(d,J,F=1)=>J.find(ge=>ge.index===d-F);let ce=[];v.$selection.subscribe(d=>{let J=f.filter(b=>!d.includes(b));if(J.length===f.length||(me.innerHTML=Xe(t.id,J,f,1,h)+" #".concat(t.id," table {--columns: ").concat(d.length,"}"),Q.classList.toggle("init-load",W),W&&(W=!1),d.length===1&&ce.length===1&&d[0]===ce[0]))return;_&&(_.textContent=en?"You have selected tariffs ".concat(we(d)):"Du hast die Tarife ".concat(we(d)," ausgewaÌhlt."));const F=window.matchMedia("(min-width: 1400px)"),oe=(F.matches?100-100/1360*260:100)/d.length;let z="";f.forEach(b=>{d.includes(b)?z+="".concat(oe,"% "):z+="0 "}
1),F.matches&&(z="260px "+z),[...H,...M].forEach(b=>{b&&(b.style.gridTemplateColumns=(h?z.split("0 ").join(""):z).trim())});let be=[],le=0;for(let b=0;b<f.length;b++)d.includes(f[b])&&(be.push({index:b,tariff:f[b],tariffPosition:le}),le++);const re=(b,Y)=>{const R=pe(b,be),o=Y.classList,r=Y.style;if(R!==void 0){const g=F.matches?2:1,C=r.getPropertyValue("--grid-start"),ye=r.getPropertyValue("--grid-end");C!==""&&(r.setProperty("--init-grid-start",C),r.setProperty("--init-grid-end",ye)),r.removeProperty("--grid-start"),r.removeProperty("--grid-end"),o.contains("hide")?o.add("show"):o.remove("show"),o.contains("show")||(o.remove("keep"),requestAnimationFrame(()=>{o.add("keep")})),o.remove("hide"),R.tariffPosition===0?r.setProperty("--grid-start","".concat(g)):r.setProperty("--grid-start","".concat(R.index+g)),r.setProperty("--grid-end",d.length===1?"-1":"".concat(R.index+g+1))}else o.add("hide"),o.remove("keep","show"),r.removeProperty("--init-grid-start"),r.removeProperty("--init-grid-end")};h||H.forEach(b=>{b.querySelectorAll("th, td").forEach((Y,R)=>{R>0&&re(R,Y)})}),N.forEach(b=>{b.style.gridTemplateColumns=z.trim(),b.querySelectorAll("td").forEach((Y,R)=>{re(R+1,Y)})}),ce=[...d]})},lt=async t=>{var De,ke,We,He;const u=(ke=(De=document.querySelector("[data-tariffBundles]"))==null?void 0:De.getAttribute("data-tariffBundles"))==null?void 0:ke.split(",");f=u;const c=!!t.querySelector(".tariff-head.gkv"),E=f.includes("business-pro")&&f.includes("first-pro"),$=((We=document.querySelectorAll(".counter>th"))==null?void 0:We.length)<5,D=f.length>5?window.matchMedia("(max-width: 1200px)"):window.matchMedia("(max-width: 767px)"),P=window.matchMedia("(min-width: 576px)"),B=window.matchMedia("(max-width: 767px)"),W=ne(D.matches);D.addEventListener("change",()=>W.set(D.matches));const k=ne(window.tariffData),v=_e(k),H=Ae(k),M=Ce(k),N=t.dataset.abTest==="true"&&E,_=t.querySelector(".tariff-table-container");if(N){const e=Array.from(_.querySelectorAll("tr")),n=e.map(i=>Array.from(i.children).slice(0,u.length+2).map(w=>w.outerHTML).join(""));W.subscribe(i=>{f=i?[...u,...u]:u,e.forEach((l,s)=>l.innerHTML=n[s]+(i?n[s]:""))})}const Q=t.querySelectorAll("[data-mobile][data-price]");if(_.querySelector("[data-show-row-toggle-buttons]")){const e=Array.from(_.querySelectorAll("tbody tr:not(.deductible-row, .bre-section-heading, .sr-only, .bre-row, .gkv-savings-row, .disclaimer, .cta-row)"));Array.from(e).reduce((i,l)=>{const s=l.querySelector("button.row-toggle");return s?i.push({toggleButton:s,rowsToToggle:[]}):i.length>0&&i[i.length-1].rowsToToggle.push(l),i},[]).forEach(({toggleButton:i,rowsToToggle:l})=>{i.addEventListener("click",()=>{i.classList.toggle("closed");const s=i.classList.contains("closed");i.setAttribute("aria-expanded",s?"false":"true"),en||i.setAttribute("aria-label",s?"Sektion ausklappen":"Sektion einklappen"),l.forEach(w=>{w.classList.toggle("is-hidden",s)})})})}const Ee=Ae(k,"10"),he=Ce(k,"10");H.$deductible.subscribe(e=>{e!=="0"&&Ee.setDeductible(e)}),M.$deductible.subscribe(e=>{e!=="0"&&he.setDeductible(e)});const j=Ye([],2,"highlights-table-2024"),me=ne([]),K=ne([]),te=ne(!1),pe=t.querySelector(".tariff-selector-container");let ce=null;pe&&(ce=t.querySelector(".notification-container"));const d=_.querySelector("thead"),J=t.querySelector(".table-styles"),F=t.querySelector(".sticky");Fe(_,d).subscribe(e=>{F==null||F.classList.toggle("is-sticky",e)}),t.id||(t.id="tariff_table_".concat(Re++));const oe=t.querySelector("[data-sticky-buttons-table]"),z=t.querySelector("[data-sticky-buttons-selection]"),be=t.querySelectorAll(".sticky-buttons"),le=t.querySelector(".buttons");let re=t.querySelector(".buttons");re||(re=function(n){let i=n.nextElementSibling;for(;i;){if(i.tagName==="SECTION")return i;i=i.nextElementSibling}return document.querySelector("div#footer")}(t));const b=t.querySelector("[data-selection-submit]"),Y=t.querySelector("[data-selection-open]"),R=t.querySelector("[data-selection-abort]"),o=t.querySelectorAll("[data-selected-badges] [data-tariff]"),r=[],g=[];let C=["expat","expat","economy","economy","business","business-pro","first","first-pro"];if(f.includes("expat")||(C=C.filter(e=>e!=="expat")),f.map((e,n)=>{const i=e.replace("-pro",""),l=r.find(s=>
1s.tariffs.includes(i)&&s.tableIndexes.length<2&&s.tariffInitializedWith!=="economy"&&s.tariffInitializedWith!=="expat");if(l&&(l.tableIndexes.push(n),l.tariffs.push(e)),!l){const s=e+(g.includes(e)&&e!=="economy"&&e!=="expat"?"-pro":""),w=C.findIndex((y,V)=>{if(y!==s)return!1;if(!s.includes("-pro")&&g.includes(e)){const fe=C.indexOf(s);return V!==fe}return!0}),L={tableIndexes:[n],stickyIndex:w,tariffs:[e],tariffInitializedWith:s,controller:Me(s)};g.push(e),r.push(L)}}),N){let e=function(a,I){return r.find(m=>m.tariffs.includes(a)&&m.stickyIndex!==I)},n=function(a,I,m,A=2){const O=[...m.map((p,S)=>I.includes(S)?-1:S+(S>=m.length/2?A:0)+A).filter(p=>p!==-1),...Array.from({length:A},(p,S)=>m.length/2+S+A)];return O.map(p=>"#".concat(a," th:nth-child(").concat(p+1,"),#").concat(a," td:nth-child(").concat(p+1,")")).join(",")+(O.length?"{display:none !important}":"")};const i=t.querySelectorAll("[data-change-tariff]"),l=t.querySelector(".sticky-tariff-selection"),s=l.querySelectorAll('.radio-button > input[type="radio"]')||[],w=l==null?void 0:l.querySelector("[data-sticky-selection-submit]"),L=(l==null?void 0:l.querySelectorAll("[data-close-selection]"))||[],y=_.querySelectorAll("[data-mobile-table-deductible]"),V=t.querySelectorAll('.sticky-header-deductible:not([data-tariff="gkv"])'),fe=t.querySelectorAll(".deductible-limit-wrapper"),ee=ne(!1),ie=Array.from(s).map(a=>Me(a.value+(a.dataset.proTariff!==void 0?"-pro":"")));i.forEach((a,I)=>a.addEventListener("click",()=>{const m=K.get(),x=f.filter((q,se)=>m.includes(se)).map(q=>q.replace("-pro","")),O=I%f.length,p=f.find(q=>!x.includes(q.replace("-pro","")));let S=!1;s.forEach((q,se)=>{var ae,Be,ze,Ne;const T=r.find(Z=>Z.stickyIndex===se),G=T==null?void 0:T.tableIndexes.includes(O),X=T==null?void 0:T.tableIndexes.some(Z=>m.includes(Z)&&Z!==O),de=T==null?void 0:T.tariffs.includes(p||"");if(!S&&de){const Z=e(q.value,T==null?void 0:T.stickyIndex),ue=Array.from(s).find((Ue,Ie)=>Ie===(Z==null?void 0:Z.stickyIndex));(ae=ue==null?void 0:ue.closest("label"))==null||ae.classList.add("is-hidden"),(Be=q.closest("label"))==null||Be.classList.remove("is-hidden"),S=!0}if(G||X){const Z=e(q.value,T==null?void 0:T.stickyIndex),ue=Array.from(s).find((Ue,Ie)=>Ie===(Z==null?void 0:Z.stickyIndex));(ze=ue==null?void 0:ue.closest("label"))==null||ze.classList.toggle("is-hidden",G||!X),(Ne=q.closest("label"))==null||Ne.classList.toggle("is-hidden",!G||X)}q.name=X?"pre-selected":"new-selection",q.checked=G||X}),ee.set(!0)})),L.forEach(a=>a.addEventListener("click",()=>ee.set(!1))),ee.subscribe(a=>{a?document.body.style.overflow="hidden":document.body.style.removeProperty("overflow"),l==null||l.classList.toggle("hide",!a)}),s.forEach((a,I)=>{var x,O,p,S,q,se;const m=ie[I];if(!m)return;(O=(x=a.nextElementSibling)==null?void 0:x.querySelectorAll("[data-ab-price]"))==null||O.forEach(T=>{m.$tariff.subscribe(G=>{Se(T,G.premium,!1)})}),(S=(p=a.nextElementSibling)==null?void 0:p.querySelectorAll("[data-ab-show-on-deductible]"))==null||S.forEach(T=>{m.$deductible.subscribe(G=>{T.classList.toggle("is-hidden",G!==T.dataset.abShowOnDeductible)})});const A=(se=(q=a.nextElementSibling)==null?void 0:q.querySelector(".segment-control"))==null?void 0:se.querySelectorAll('input[type="radio"]');A==null||A.forEach(T=>{T.addEventListener("change",()=>{T.checked&&m.setDeductible(T.value)}),m.$deductible.subscribe(G=>{var de;const X=(de=Array.from(A))==null?void 0:de.find(ae=>ae.value===G);X&&(X.checked=!0)})})}),w==null||w.addEventListener("click",a=>{a.preventDefault();const I=Array.from(s).map((m,A)=>{var de;const x=ie[A];if(!m.checked){x==null||x.setDeductible(m.dataset.protariff!==void 0?"0":"10");return}const O=m.value||"",p=x==null?void 0:x.$deductible.get(),S=xe(O,{deductible:p})||"",q=r.find(ae=>ae.stickyIndex===A);(de=q==null?void 0:q.controller)==null||de.setDeductible(p);const se=(q==null?void 0:q.tariffs.findIndex(ae=>ae===S))||0,T=(q==null?void 0:q.tableIndexes[se])||0,G=Q[T];G.innerHTML=en?"â¬":"- â¬";const X=x==null?void 0:x.$tariff.get();return Se(G,X==null?void 0:X.premium,!1),T}).filter(m=>m!==void 0);K.set(I),ee.set(!1)}),Q.forEach((a,I)=>{var x,O;const m=I%f.length;if(!((x=f[m])!=null&&x.includes(a.dataset.tariff||"")))return;const A=(O=r.find(p=>{var S;return(S=p.tableIndexes)==null?void 0:S.includes(m)}))==null?void 0:O.controller;A&&A.$tariff.subscribe(p=>{Se(a,p.premium,!1)})}),fe.forEach((a,I)=>{var x,O;const m=I%f.length;if(!((x=f[m])!=null&&x.includes(a.dataset.tariff||"")))return;const A=(O=r.find(p=>{var S;return(S=p.tableIndexes)==null?void 0:S.includes(m)}))==null?void 0:O.controller;A&&a.querySelectorAll("[data-show-on-deductible]").forEach(p=>{A.$deductible.subscribe(S=>{p.classList.toggle("is-hidden",S!==p.dataset.showOnDeductible)})})}
1),V.forEach((a,I)=>{var A;if(!((A=f[I])!=null&&A.includes(a.dataset.tariff||"")))return;const m=r.find(x=>{var O;return(O=x.tableIndexes)==null?void 0:O.includes(I)});m&&a.querySelectorAll("[data-ab-sticky-deductible]").forEach(x=>{var O;(O=m.controller)==null||O.$deductible.subscribe(p=>{x.classList.toggle("is-hidden",x.dataset.abStickyDeductible!==p)})})}),y.forEach((a,I)=>{var x,O;if(!((x=f[I])!=null&&x.includes(a.dataset.abTariff||"")))return;const m=r.find(p=>{var S;return(S=p.tableIndexes)==null?void 0:S.includes(I)});if(!m)return;a.addEventListener("change",()=>{var T;(T=m.controller)==null||T.setDeductible(a.value);const p=[...K.get()],S=f[I],q=xe(a.dataset.abTariff||"",{deductible:a.value});if(S===q)return;const se=m.tableIndexes.find(G=>G!==I);p.splice(p.indexOf(I),1),p.push(se),K.set(p)});const A=ie.find((p,S)=>m.stickyIndex===S);(O=m.controller)==null||O.$deductible.subscribe(p=>{A==null||A.setDeductible(p);const S=y[I];S&&(S.value=p)})}),U(K,a=>n(t.id,a,f)).subscribe(a=>{J.innerHTML=a})}function ye(e){const n=re;let i=!1,l=!1;const s=new IntersectionObserver(w=>{for(const L of w)switch(L.target){case n:i=L.isIntersecting;break;case e:l=L.isIntersecting;break}e.classList.toggle("chat-shown",!i&&l)},{threshold:le?.2:0});s.observe(e),n&&s.observe(n),window.addEventListener("resize",Qe(()=>{P.matches&&B.matches?(s.observe(e),n&&s.observe(n)):(s.unobserve(e),n&&s.unobserve(n))},300))}be.forEach(e=>{ye(e)}),$||U([te,W],(e,n)=>!n||e).subscribe(e=>{_.classList.toggle("is-hidden",!e),pe==null||pe.classList.toggle("is-hidden",e),z==null||z.classList.toggle("is-hidden",e),oe==null||oe.classList.toggle("is-hidden",!e)}),te.listen(()=>{R.disabled=!1}),te.listen(()=>Ke(t)),b&&b.addEventListener("click",()=>{if(j.$toSelect.get()!==0)return;const e=j.$selection.get(),n=Oe("highlights-table-2024",e);if(n.link_text=en?"Compare now":"Jetzt vergleichen",qe(n),me.set(e),N){const l=e.map(s=>Je(s)).map((s,w)=>{var ee;const L=s==null?void 0:s.tariffs.findIndex(ie=>ie===e[w]),y=(s==null?void 0:s.tableIndexes[L])||0;let V="0";return s!=null&&s.tariffInitializedWith.includes("-pro")||(V=(s!=null&&s.tariffInitializedWith.includes("economy")?v:s!=null&&s.tariffInitializedWith.includes("business")?H:M).$deductible.get()),(ee=s==null?void 0:s.controller)==null||ee.setDeductible(V),Array.from(Q).filter((ie,a)=>s==null?void 0:s.tableIndexes.includes(a%f.length)).forEach(ie=>{var I;ie.innerHTML=en?"â¬":"- â¬";const a=(I=s==null?void 0:s.controller)==null?void 0:I.$tariff.get();Se(ie,a==null?void 0:a.premium,!1)}),y});K.set(l)}te.set(!0)}),R&&R.addEventListener("click",()=>{j.reset(),te.set(!0)}),Y&&(Y.addEventListener("click",()=>{j.reset(),te.set(!1),r.forEach(e=>{var i;const n=e.tariffInitializedWith;(i=e.controller)==null||i.setDeductible(n.includes("-pro")?"0":"10")})}),j.$toSelect.subscribe(e=>{e<=0?(b.innerHTML=en?"Compare now":"Jetzt vergleichen",b.classList.add("green")):(en?b.innerHTML="Please select ".concat(e," more ").concat(e>1?"tariffs":"tariff"):b.innerHTML="Bitte ".concat(e," ").concat(e>1?"Tarife":"Tarif"," auswählen"),b.classList.remove("green"))})),o.forEach(e=>{const n=e.dataset.tariff;U(j.$selection,i=>i.includes(n)).subscribe(i=>{e.classList.toggle("is-hidden",!i)}),e.addEventListener("click",i=>{j.select(n)})});for(const e of t.querySelectorAll("[data-tariff-selector]")){const n=e.dataset.tariff,i=Te(e),l=e.querySelectorAll(".tariff-checkbox input");U([i.$tariff,j.$selection],(L,y)=>y.includes(xe(n,L.options))).subscribe(L=>{e.classList.toggle("active",L);for(const y of l)y.checked=L;if(ce){const y=j.$selection.get();let V;y.length===0?V=en?"You have not currently selected a tariff. Please select two tariffs to compare them.":"Du hast aktuell keinen Tarif ausgewählt. Bitte wähle zwei Tarife aus, um diese zu vergleichen.":y.length===1?V=en?"You have currently selected tariff ".concat(we(y),". Please select another tariff to compare them."):"Du hast aktuell den Tarif ".concat(we(y)," ausgewählt. Bitte wähle einen weiteren Tarif aus, um diese zu vergleichen"):V=en?"You have currently selected tariffs ".concat(we(y),". To compare them, proceed to the âCompare nowâ button."):"Du hast aktuell die Tarife ".concat(we(y),' ausgewählt. Um diese zu vergleichen, fahre fort zum Button "Jetzt vergleichen".'),ce.textContent=V}}),e.addEventListener("click",L=>{L.target&&L.target.closest(".checkbox-badge")||j.select(xe(n,i.$tariff.get().options))}),l.forEach(L=>{L.addEventListener("change",y=>{y.preventDefault(),j.select(xe(n,i.$tariff.get().options))})});const s=e.querySelector("[data-default-content]"),w=e.querySelector("[data-pro-content");s&&w&&i.$deductible.subscribe(L=>{s==null||s.classList.toggle("is-hidden",L==="0"),w==null||w.classList.toggle("is-hidden",L!=="0")})}const Pe=t.querySelector("[data-total-selected-tariffs]");Pe&&U(j.$selection,e=>e.length).subscribe(e=>Pe.innerHTML="".concat(e));for(const e of t.querySelectorAll("[data-price]:not([data-pro-tariff])"))Te(e,e.dataset.mobile!==void 0).$tariff.subscribe(i=>{Se(e,i.premium,!1)});if(_.querySelector("tr.gkv-savings-row")){const e=parseInt(((He=t.querySelector("[data-gkv-contribution]"))==null?void 0:He.dataset.gkvContribution)||"648");t.querySelectorAll("[data-price-savings]").forEach(n=>{Te(n).$tariff.subscribe(l=>{Se(n,e-l.premium,!1)})})}for(const e of t.querySelectorAll("[data-option]")){const n=e.dataset.tariff,{setDeductible:i,$deductible:l}=Te(e);e.addEventListener("click",w=>{w.stopPropagation()},{capture:!0});const s=Array.from(e.querySelectorAll('input[type="radio"]'));for(const w of s)w.addEventListener("change",L=>{var V;if(!w.checked)return;i(w.value);let y=n;
1if(w.value==="0"&&(n==="business"?y="business-pro":n==="first"&&(y="first-pro")),y.includes("business")||y.includes("first")){const fe=w.closest(".tariff-selector-container"),ee=fe?fe.querySelector('.segment-control[data-tariff="'.concat(y.replace("-pro",""),'"]').concat(y.includes("-pro")?"[data-pro-identifier]":"")):_.querySelector('.segment-control[data-tariff="'.concat(y.replace("-pro",""),'"]').concat(y.includes("-pro")?"[data-pro-identifier]":""));(V=ee==null?void 0:ee.querySelector('input[value="'.concat(w.value)))==null||V.focus()}je(y,w.value)});l.subscribe(w=>{const L=s.find(y=>y.value===w);L&&(L.checked=!0)})}function je(e,n){qe({event:"deductible_interaction",element_section:"highlights-table-2024",element_detail:Ve(e),deductible:n,...Ge})}for(const e of t.querySelectorAll("[data-show-on-deductible]")){const n=Te(e,!0),i=e.dataset.showOnDeductible;n.$deductible.subscribe(l=>{e.classList.toggle("is-hidden",l!==i)})}E?U([W,H.$deductible,M.$deductible],(e,n,i)=>[e,n==="0",i==="0"]).subscribe(([e,n,i])=>{e||me.set(f.filter(l=>l!==(n?"business":"business-pro")&&l!==(i?"first":"first-pro")))}):W.subscribe(e=>{e||me.set([])}),U(me,e=>Ze(t.id,e,f,W.get(),c)).subscribe(e=>{J.innerHTML=e});function Te(e,n=!1){const i=e.dataset.tariff;switch(i){case"first":return n?he:M;case"business":return n?Ee:H;case"economy":return v;default:return Le(k,{defaultOptions:{},optionsToNameMapping:()=>i})}}function Je(e){return r.find(n=>n.tariffInitializedWith===e)}function Me(e){switch(e){case"economy":return _e(k);case"business":case"business-pro":return Ae(k,e.includes("-pro")?"0":"10");case"first":case"first-pro":return Ce(k,e.includes("-pro")?"0":"10")}}};function _e(t){const{$tariff:u,setOption:c}=Le(t,{defaultOptions:{deductible:"10"},optionsToNameMapping:({deductible:$})=>$==="10"?"chi-economy-10":"chi-economy-50"}),E=U(u,$=>$.options.deductible);return{$tariff:u,$deductible:E,setDeductible:$=>c("deductible",$)}}function Ae(t,u="0"){const{$tariff:c,setOption:E}=Le(t,{defaultOptions:{deductible:u},optionsToNameMapping:({deductible:h})=>{switch(h){case"25":return"chi-business-25";case"10":return"chi-business-10";default:return"chi-businesspro2024-0"}}}),$=U(c,h=>h.options.deductible);return{$tariff:c,$deductible:$,setDeductible:h=>E("deductible",h)}}function Ce(t,u="0"){const{$tariff:c,setOption:E}=Le(t,{defaultOptions:{deductible:u},optionsToNameMapping:({deductible:h})=>{switch(h){case"25":return"chi-first-25";case"10":return"chi-first-10";default:return"chi-firstproplus2024-0"}}}),$=U(c,h=>h.options.deductible);return{$tariff:c,$deductible:$,setDeductible:h=>E("deductible",h)}}function Ye(t,u,c,E=!1){let $=u;const h=ne(t.slice(0,u)),D=$e(h,"reset",v=>{v.get().length>0&&v.set([])}),P=$e(h,"set",(v,H)=>{v.set(H)}),B=$e(h,"set-preset",(v,H)=>{let M,N;switch(H){case"no-deductible":N=["business-pro","first-pro"],M="Ohne Selbstbehalt";break;case"deductible":N=["expat","economy","business","first"],M="Mit Selbstbehalt";break;case"value":N=["expat","business","business-pro"],M="Preis-Leistung";break;case"performance":N=["expat","first","first-pro"],M="Top-Leistung";break;default:N=f,M="Alle Tarife anzeigen";break}const _=f.filter(Q=>N.includes(Q));if(v.set(_),E){const Q=Oe(c,_);Q.selection_preset=M,qe(Q)}}),W=$e(h,"select",(v,H)=>{const M=[...v.get()],N=M.indexOf(H);if(N!==-1){M.splice(N,1),v.set(M);return}M.length===$&&M.shift(),M.push(H),E&&qe(Oe(c,M)),v.set(M)}),k=U(h,v=>$-v.length);return{$selection:h,$toSelect:k,get maxLength(){return u},set maxLength(v){$=v,h.get().length>v&&h.set(f.slice(0,v))},select:W,set:P,setPreset:B,reset:D}}function Xe(t,u,c,E=2,$){const h=u.map(D=>c.indexOf(D)+E);return h.map(D=>"#".concat(t," tbody th:nth-child(").concat(D+1,"),#").concat(t," td:nth-child(").concat(D+1,")").concat($?"":", #"+t+" thead .sticky th:nth-child("+(D+1)+")")).join(",")+(h.length?"{display:none !important}":"")}function Ze(t,u,c,E,$,h=2){if(u.length===0&&!E||u.length<4&&!$&&E)return"";const D=c.map((P,B)=>u.includes(P)?-1:B+h).filter(P=>P!==-1);return D.map(P=>"#".concat(t," th:nth-child(").concat(P+1,"),#").concat(t," td:nth-child(").concat(P+1,")")).join(",")+(D.length?"{display:none !important}":"")}function xe(t,u){if(u.deductible==="0"){if(t==="business")return"business-pro";if(t==="first")return"first-pro"}return t}
1function Oe(t,u){return{event:"tariff_comparison",element_section:t,element_detail:[...u].sort((c,E)=>f.indexOf(c)-f.indexOf(E)).map(c=>Ve(c)).join(" | "),...Ge}}function Ve(t){switch(t){case"expat":return"First Class Expats";case"economy":return"Premium Economy";case"business":return"Business Class";case"business-pro":return"Business Class Pro";case"first":return"First Class";case"first-pro":return"First Class Pro Plus";default:return"Premium Economy"}}function we(t){let u="";for(let c=0;c<t.length;c++)c===t.length-2?u+=t[c]+(en?" and ":" und "):c===t.length-1?u+=t[c]:u+=t[c]+", ";return u}export{ot as initBenefitsTable,lt as initHighlightsTable}; 2//# sourceMappingURL=tariffs-module.min.QD4W1Yqt.js.map
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.