PageSourceSearch

https://telex.hu/_nuxt/DQw99EzU.js

js telex.hu collected 2026-09-24 08:36:58 UTC 3,558 bytes, 1 lines download raw bytes

1import{v as P,o as h,c as g,a as i,F as E,w as V,n as W,B as u,r as G,a6 as H,ac as J,h as K,O as Q,e as X}from"./BdFqHcNj.js";const U={class:"svg-wrapper"},Z=["viewBox"],ee=["id","d","fill"],te={class:"election2026__seats__legend"},se={class:"legend-title"},ae={class:"legend-text"},ne={key:0,class:"prospective-count"},ce={__name:"OvPatko",props:{parties:{type:Array,required:!0},legendParties:{type:Array,default:null},showLegend:{type:Boolean,default:!1},totalSeats:{type:Number,default:199},containerClass:{type:String,default:""},sections:{type:Number,default:5},rows:{type:Number,default:6},width:{type:Number,default:900},height:{type:Number,default:900}},setup(w){const a=w,Y=P(()=>a.legendParties?a.legendParties:a.parties),z=P(()=>a.parties.reduce((o,r)=>o+(r.count||0)+(r.prospective||0),0)),F=o=>{let r=0;for(const e of a.parties)if(r+=e.count||0,o<=r)return{color:e.color,name:e.name,isProspective:!1};for(const e of a.parties)if(r+=e.prospective||0,o<=r)return{color:e.color,name:e.name,isProspective:!0};return{color:"var(--fallback)",name:"Üres",isProspective:!1}},m=P(()=>{const o=[],f=a.width/2,c=450;let S=[],M=0;for(let t=a.rows-1;t>=0;t--){const s=180+t*42,n=s*Math.PI+320;S.push({rArc:s,fullLen:n,originalRowIdx:t+1}),M+=n}let k=a.totalSeats;const T=S.map((t,s)=>{if(s===S.length-1)return k;const n=Math.round(t.fullLen/M*a.totalSeats);return k-=n,n}),B=[40,40,39,40,40],q=B.reduce((t,s)=>t+s,0);return T.forEach((t,s)=>{const{rArc:n,fullLen:v,originalRowIdx:j}=S[s];let N=[],b=0;for(let l=0;l<a.sections;l++){const I=B.slice(0,l+1).reduce((L,p)=>L+p,0)/q*t,d=l===a.sections-1?t:Math.round(I);N.push(d-b),b=d}const D=v/t*1.5,A=(v-(a.sections-1)*D)/a.sections;N.forEach((l,R)=>{const I=R*(A+D);for(let d=0;d<l;d++){const L=l>1?d/(l-1):.5,p=I+L*A;let x,y;if(p<160)x=f-n,y=c+160-p;else if(p>160+n*Math.PI)x=f+n,y=c+(p-(160+n*Math.PI));else{const C=Math.PI+(p-160)/n;x=f+n*Math.cos(C),y=c+n*Math.sin(C)}o.push({x,y,section:R+1,row:j,sortRow:s,seatInSecIndex:d})}})}),o.sort((t,s)=>t.section!==s.section?t.section-s.section:t.seatInSecIndex!==s.seatInSecIndex?t.seatInSecIndex-s.seatInSecIndex:t.sortRow-s.sortRow),o.map((t,s)=>{const n=s+1,v=F(n);return{...t,id:`seat-${n.toString().padStart(3,"0")}`,color:v.color,partyName:v.name,isProspective:v.isProspective,path:`M ${t.x},${t.y-14} a 14,14 0 1,0 0,28 a 14,14 0 1,0 0,-28`}})}),O=P(()=>{if(m.value.length===0)return`0 0 ${a.width} ${a.height}`;const o=15,r=8,e=Math.min(...m.value.map(c=>c.x))-r-o,_=Math.min(...m.value.map(c=>c.y))-r-o,$=Math.max(...m.value.map(c=>c.x))+r+o,f=Math.max(...m.value.map(c=>c.y))+r+o;return`${e} ${_} ${$-e} ${f-_}`});return(o,r)=>(h(),g("div",{class:W(["ov-patko-container",w.containerClass])},[i("div",U,[(h(),g("svg",{viewBox:O.value,xmlns:"http://www.w3.org/2000/svg",class:"seat-plan-svg"},[(h(!0),g(E,null,V(m.value,e=>(h(),g("g",{key:e.id},[i("path",{id:e.id,d:e.path,fill:e.color,class:W(["seat-path",{"seat-path--prospective":e.isProspective}])},[i("title",null,u(e.id)+" | "+u(e.partyName)+" "+u(e.isProspective?"(Esélyes)":""),1)],10,ee)]))),128))],8,Z))]),w.showLegend?G(o.$slots,"legend",{key:0},()=>[i("ul",te,[i("li",se,[i("strong",null,u(z.value)+"/"+u(w.totalSeats)+" mandátum",1)]),(h(!0),g(E,null,V(Y.value,e=>H((h(),g("li",{key:e.name},[i("span",{class:"legend-dot",style:K({backgroundColor:e.color})},null,4),i("span",ae,[Q(u(e.name)+": ",1),i("strong",null,u(e.count),1),e.prospective>0?(h(),g("span",ne," (+"+u(e.prospective)+")",1)):X("",!0)])])),[[J,e.count+(e.prospective||0)>0]])),128))])]):X("",!0)],2))}};export{ce as _};

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.