1import{P as ve}from"./BgbzxJJv.js";import{q as ye,aW as be,v as f,d as p,k as he,l as me,D as c,X as b,R as l,M as x,u as v,U as i,ai as U,aj as X,J as F,$ as B,A as ke,W as _e,ao as H,ap as De,aJ as Ce,V as w,N as r,bw as Y,aN as ge,bt as xe,aO as we,b7 as Me,_ as Ie,P as Fe,aI as Be}from"./Cn84iW0n.js";import{u as We}from"./BSjCYFrt.js";import{aY as Te,a$ as Se,b7 as Le,ba as Re,aX as $e}from"./CNVwmMlT.js";import"./DtNf0hFZ.js";import"./B8Yg8XhE.js";(function(){try{var m=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},h=new m.Error().stack;h&&(m._sentryDebugIds=m._sentryDebugIds||{},m._sentryDebugIds[h]="56292892-83f0-49b6-8b25-74a68a9f1ca4",m._sentryDebugIdIdentifier="sentry-dbid-56292892-83f0-49b6-8b25-74a68a9f1ca4")}catch{}})();const Ee={class:"lu-page tech-font"},Pe={class:"eh-left"},Ne={class:"lu-hero"},Ge={class:"lh-body"},qe={class:"lh-kicker"},ze={class:"lh-controls"},Ae=["disabled"],Ke=["disabled"],Oe={class:"lh-progress"},Ve={class:"lh-progress-bar"},Ue={class:"lh-progress-text"},Xe={class:"stat-display"},He={class:"lu-formation-section"},Ye={class:"lu-formation-pills"},je=["onClick"],Je={class:"stat-display lu-formation-name"},Qe={class:"lu-formation-desc"},Ze={class:"lu-pitch-section"},et={class:"lu-pitch"},tt=["onClick"],lt={key:0,class:"lu-slot-card lu-slot-card--filled"},at=["src","alt"],st={class:"lu-slot-name"},nt={class:"lu-slot-meta stat-display"},ot={key:1,class:"lu-slot-card lu-slot-card--empty"},it={class:"lu-slot-label"},rt={class:"picker-modal"},ct={class:"picker-head"},ut={class:"picker-kicker"},dt={class:"picker-filters"},pt=["value"],ft={class:"picker-pos-toggle"},vt={class:"picker-results-info"},yt={class:"stat-display"},bt={class:"picker-grid"},ht=["onClick"],mt=["src","alt"],kt={class:"picker-player-body"},_t={class:"picker-player-name"},Dt={class:"picker-player-meta"},Ct={class:"picker-player-pos"},gt={class:"picker-player-nat"},xt={key:0,class:"stat-display picker-player-age"},wt=ye({__name:"lineup",async setup(m){let h,W;Te({title:"Lineup Builder â World Cup 2026 · Dribble",meta:[{name:"description",content:"Build your World Cup 2026 starting XI from 1,000+ players across 48 squads. Pick a formation, fill the pitch, download a shareable PNG."}]});const{data:j}=([h,W]=be(async()=>Re("wc-overview-lineup",async()=>await $fetch("/api/wc/overview"),{default:()=>({teams:[]})})),h=await h,W(),h),$=f(()=>j.value.teams);function J(a){const e=a.toLowerCase();return e==="goalkeeper"?"GK":e==="defence"||e.includes("-back")||e.includes("centre-back")?"DEF":e.includes("midfield")?"MID":e==="offence"||e.includes("winger")||e.includes("forward")||e.includes("striker")||e.includes("attack")?"FWD":"OTHER"}function Q(a){const e=a.toLowerCase();return e==="goalkeeper"?"GK":e.includes("centre-back")?"CB":e.includes("left-back")?"LB":e.includes("right-back")?"RB":e==="defence"?"DEF":e.includes("defensive midfield")?"CDM":e.includes("attacking midfield")?"CAM":e.includes("central midfield")?"CM":e==="midfield"?"MID":e.includes("left winger")?"LW":e.includes("right winger")?"RW":e.includes("centre-forward")||e==="offence"||e.includes("forward")||e.includes("striker")?"ST":a.slice(0,3).toUpperCase()}const T=f(()=>{const a=[];for(const e of $.value)for(const s of e.squad)a.push({fdId:s.id,name:s.name,position:s.position,posShort:Q(s.position),posCat:J(s.position),dateOfBirth:s.dateOfBirth,nationality:s.nationality,nationName:e.name,nationTla:e.tla,crest:e.crest});return a}),Z=f(()=>{const a=new Map;for(const e of T.value)a.set(`${e.nationTla}-${e.fdId}`,e);return a}),ee=f(()=>[...$.value].sort((a,e)=>a.name.localeCompare(e.name)).map(a=>({tla:a.tla,name:a.name}))),D=[{id:"433",label:"4-3-3",desc:"Wide attack",slots:[{label:"GK",cat:"GK",x:50,y:90},{label:"LB",cat:"DEF",x:12,y:72},{label:"CB",cat:"DEF",x:36,y:76},{label:"CB",cat:"DEF",x:64,y:76},{label:"RB",cat:"DEF",x:88,y:72},{label:"CM",cat:"MID",x:26,y:52},{label:"CM",cat:"MID",x:50,y:56},{label:"CM",cat:"MID",x:74,y:52},{label:"LW",cat:"FWD",x:16,y:26},{label:"ST",cat:"FWD",x:50,y:16},{label:"RW",cat:"FWD",x:84,y:26}]},{id:"442",label:"4-4-2",desc:"Two strikers",slots:[{label:"GK",cat:"GK",x:50,y:90},{label:"LB",cat:"DEF",x:12,y:72},{label:"CB",cat:"DEF",x:36,y:76},{label:"CB",cat:"DEF",x:64,y:76},{label:"RB",cat:"DEF",x:88,y:72},{label:"LM",cat:"MID",x:14,y:50},{label:"CM",cat:"MID",x:38,y:52},{label:"CM",cat:"MID",x:62,y:52},{label:"RM",cat:"MID",x:86,y:50},{label:"ST",cat:"FWD",x:36,y:20},{label:"ST",cat:"FWD",x:64,y:20}]},{id:"4231",label:"4-2-3-1",desc:"Modern shape",slots:[{label:"GK",cat:"GK",x:50,y:90},{label:"LB",cat:"DEF",x:12,y:72},{label:"CB",cat:"DEF",x:36,y:76},{label:"CB",cat:"DEF",x:64,y:76},{label:"RB",cat:"DEF",x:88,y:72},{label:"CDM",cat:"MID",x:36,y:58},{label:"CDM",cat:"MID",x:64,y:58},{label:"LW",cat:"MID",x:18,y:36},{label:"CAM",cat:"MID",x:50,y:36},{label:"RW",cat:"MID",x:82,y:36},{label:"ST",cat:"FWD",x:50,y:14}]},{id:"352",label:"3-5-2",desc:"Wing-backs",slots:[{label:"GK",cat:"GK",x:50,y:90},{label:"CB",cat:"DEF",x:22,y:76},{label:"CB",cat:"DEF",x:50,y:80},{label:"CB",cat:"DEF",x:78,y:76},{label:"LWB",cat:"MID",x:8,y:52},{label:"CM",cat:"MID",x:30,y:56},{label:"CM",cat:"MID",x:50,y:58},{label:"CM",cat:"MID",x:70,y:56},{label:"RWB",cat:"MID",x:92,y:52},{label:"ST",cat:"FWD",x:36,y:20},{label:"ST",cat:"FWD",x:64,y:20}]}],te={id:"",label:"",desc:"",slots:[]},y=p("433"),E=f(()=>D.find(a=>a.id===y.value)??D[0]??te),M=f(()=>E.value.slots),le=f(()=>E.value.label),o=p(new Array(11).fill(null));function ae(a){y.value=a;const e=D.find(t=>
1t.id===a);if(!e)return;const s=new Array(11).fill(null);for(let t=0;t<11;t++){const n=e.slots[t],d=o.value[t];n&&d&&(d.posCat===n.cat||n.cat==="MID"&&d.posCat==="MID"||n.cat==="FWD"&&(d.posCat==="FWD"||d.posCat==="MID"))&&(s[t]=d)}o.value=s}const C=f(()=>o.value.filter(a=>a!==null).length),S=p(!1),u=p(null),I=p(""),g=p(""),k=p(!0),P=f(()=>u.value===null?null:o.value[u.value]??null);function se(a){u.value=a,I.value="",g.value="",k.value=!0,S.value=!0}function L(){S.value=!1,u.value=null}function ne(a){return o.value.some(e=>e?.fdId===a.fdId&&e.nationTla===a.nationTla)}const N=f(()=>{const a=u.value!==null?M.value[u.value]:null,e=I.value.trim().toLowerCase();let s=T.value;return g.value&&(s=s.filter(t=>t.nationTla===g.value)),a&&k.value&&(s=s.filter(t=>t.posCat===a.cat)),e&&(s=s.filter(t=>t.name.toLowerCase().includes(e))),a&&(s=[...s].sort((t,n)=>{const d=t.posCat===a.cat?0:1,V=n.posCat===a.cat?0:1;return d!==V?d-V:t.name.localeCompare(n.name)})),s.slice(0,200)});function oe(a){if(u.value===null)return;const e=o.value.findIndex(s=>s?.fdId===a.fdId&&s.nationTla===a.nationTla);e!==-1&&e!==u.value&&(o.value[e]=null),o.value[u.value]=a,L()}function ie(){window.confirm("Clear all 11 picks?")&&(o.value=new Array(11).fill(null))}function re(a){const e=a.trim().split(/\s+/),s=e[0]??"",t=e[e.length-1]??"";return e.length<=1||!s||!t?a:`${s[0]??""}. ${t}`}function ce(a){const e=new Date(a),s=new Date;let t=s.getFullYear()-e.getFullYear();const n=s.getMonth()-e.getMonth();return(n<0||n===0&&s.getDate()<e.getDate())&&t--,t}const _=Se(),G=Le();function q(){return o.value.map(e=>e?`${e.nationTla}:${e.fdId}`:"").join(".")}function ue(a){try{const e=a.split(".");if(e.length!==11)return!1;const s=new Array(11).fill(null);for(let t=0;t<11;t++){const n=e[t];if(!n)continue;const d=Z.value.get(n);d&&(s[t]=d)}return o.value=s,!0}catch{return!1}}const R=p(!1);async function de(){const a=new URL(window.location.href);a.searchParams.set("f",y.value),a.searchParams.set("p",q());try{await navigator.clipboard.writeText(a.toString()),R.value=!0,setTimeout(()=>{R.value=!1},2200)}catch{window.prompt("Copy this share URL:",a.toString())}}he(()=>{const a=typeof _.query.f=="string"?_.query.f:"",e=typeof _.query.p=="string"?_.query.p:"";a&&D.some(s=>s.id===a)&&(y.value=a),e&&T.value.length>0&&ue(e)}),me([o,y],()=>{if(C.value===0){const a={..._.query};delete a.p,delete a.f,G.replace({query:a});return}G.replace({query:{..._.query,f:y.value,p:q()}})},{deep:!0});const z=p(null),A=p(null),K=p(null),{downloading:O,triggerExport:pe}=We();async function fe(){await pe({containerRef:z,headerRef:A,footerRef:K,filename:()=>`dribble-wc-2026-lineup-${y.value}-${Date.now()}.png`,exportWidth:1280,toolId:"wc-lineup"})}return(a,e)=>{const s=ve;return r(),c("div",Ee,[b(s,{title:"Lineup Builder"}),l("div",{ref_key:"containerRef",ref:z,class:"lu-container"},[l("div",{ref_key:"headerRef",ref:A,class:"export-header"},[l("div",Pe,[b(v(Y),{size:14}),e[4]||(e[4]=l("span",{class:"eh-title"},"World Cup 2026 â My Lineup",-1))]),e[5]||(e[5]=l("div",{class:"eh-right stat-display"},"dribble360.com",-1))],512),l("section",Ne,[e[11]||(e[11]=l("div",{class:"lh-ghost stat-display"},"XI",-1)),l("div",Ge,[l("div",qe,[b(v(Y),{size:11}),e[6]||(e[6]=l("span",null,"Pick 11 from 1,000+ WC players",-1))]),e[9]||(e[9]=l("h1",{class:"lh-title"},[l("span",{class:"lh-thin"},"Build the"),l("span",{class:"lh-accent"},"starting XI.")],-1)),e[10]||(e[10]=l("p",{class:"lh-sub"}," Pick a shape, then fill every position from the pool of every player at the World Cup. Filter by nation, position, or search by name. Download the finished lineup as a shareable PNG. ",-1)),l("div",ze,[l("button",{class:"lh-cta-primary",disabled:v(O)||C.value===0,onClick:fe},[b(v(ge),{size:13}),l("span",null,i(v(O)?"Generatingâ¦":"Download PNG"),1)],8,Ae),l("button",{class:"lh-cta-secondary",disabled:C.value===0,onClick:de},[b(v(xe),{size:13}),l("span",null,i(R.value?"Copied":"Copy share link"),1)],8,Ke),l("button",{class:"lh-cta-ghost",onClick:ie},[b(v(we),{size:13}),e[7]||(e[7]=l("span",null,"Reset",-1))])]),l("div",Oe,[l("div",Ve,[l("div",{class:"lh-progress-fill",style:U({width:`${C.value/11*100}%`})},null,4)]),l("div",Ue,[l("span",Xe,i(C.value),1),e[8]||(e[8]=X("/11 picked ",-1))])])])]),l("section",He,[e[12]||(e[12]=l("div",{class:"lu-formation-label"},"Formation",-1)),l("div",Ye,[(r(),c(F,null,B(D,t=>l("button",{key:t.id,class:w(["lu-formation-pill",{active:y.value===t.id}]),onClick:n=>ae(t.id)},[l("span",Je,i(t.label),1),l("span",Qe,i(t.desc),1)],10,je)),64))])]),l("section",Ze,[l("div",et,[e[13]||(e[13]=ke('<div class="lu-pitch-circle" data-v-5a710fd5></div><div class="lu-pitch-line lu-pitch-midline" data-v-5a710fd5></div><div class="lu-pitch-box lu-pitch-box--bottom" data-v-5a710fd5></div><div class="lu-pitch-box lu-pitch-box--top" data-v-5a710fd5></div><div class="lu-pitch-d lu-pitch-d--bottom" data-v-5a710fd5></div><div class="lu-pitch-d lu-pitch-d--top" data-v-5a710fd5></div>',6)),(r(!0),c(F,null,B(M.value,(t,n)=>(r(),c("div",{key:`slot-${n}-${y.value}`,class:w(["lu-slot",{filled:!!o.value[n]}]),style:U({left:`${t.x}%`,top:`${t.y}%`}),onClick:d=>se(n)},[o.value[n]?(r(),c("div",lt,[o.value[n].crest?(r(),c("img",{key:0,src:o.value[n].crest,alt:o.value[n].nationName,class:"lu-slot-crest",loading:"lazy"},null,8,at)):x("",!0),l("div",st,i(re(o.value[n].name)),1),l("div",nt,i(o.value[n].nationTla)+" · "+i(t.label),1)])):(r(),c("div",ot,[b(v(Me),{size:14}),l("div",it,i(t.label),1)]))],14,tt))),128))])]),l("div",{ref_key:"footerRef",ref:K,class:"export-footer"}
1,[l("span",null,"Built on Dribble · World Cup 2026 Lineup Builder · "+i(le.value),1),e[14]||(e[14]=l("span",{class:"ef-url"},"dribble360.com/world/lineup",-1))],512)],512),S.value?(r(),c("div",{key:0,class:"picker-overlay",onClick:_e(L,["self"])},[l("div",rt,[l("header",ct,[l("div",null,[l("div",ut,"Slot · "+i(u.value!==null?M.value[u.value]?.label:""),1),e[15]||(e[15]=l("div",{class:"picker-title"},"Pick a Player",-1))]),l("button",{class:"picker-close","aria-label":"Close",onClick:L},[b(v(Ie),{size:14})])]),l("div",dt,[H(l("input",{"onUpdate:modelValue":e[0]||(e[0]=t=>I.value=t),class:"picker-search",type:"text",placeholder:"Search by nameâ¦"},null,512),[[De,I.value]]),H(l("select",{"onUpdate:modelValue":e[1]||(e[1]=t=>g.value=t),class:"picker-select"},[e[16]||(e[16]=l("option",{value:""},"All nations",-1)),(r(!0),c(F,null,B(ee.value,t=>(r(),c("option",{key:t.tla,value:t.tla},i(t.name),9,pt))),128))],512),[[Ce,g.value]]),l("div",ft,[l("button",{class:w(["picker-pos-btn",{active:!k.value}]),onClick:e[2]||(e[2]=t=>k.value=!1)},"All",2),l("button",{class:w(["picker-pos-btn",{active:k.value}]),onClick:e[3]||(e[3]=t=>k.value=!0)},i(u.value!==null?M.value[u.value]?.cat:"")+" only",3)])]),l("div",vt,[l("span",yt,i(N.value.length.toLocaleString()),1),e[17]||(e[17]=X(" players ",-1))]),l("div",bt,[(r(!0),c(F,null,B(N.value,t=>(r(),c("button",{key:`${t.nationTla}-${t.fdId}`,class:w(["picker-player",{taken:ne(t)&&P.value?.fdId!==t.fdId}]),onClick:n=>oe(t)},[t.crest?(r(),c("img",{key:0,src:t.crest,alt:t.nationName,class:"picker-flag",loading:"lazy"},null,8,mt)):x("",!0),l("div",kt,[l("div",_t,i(t.name),1),l("div",Dt,[l("span",Ct,i(t.posShort),1),l("span",gt,i(t.nationTla),1),t.dateOfBirth?(r(),c("span",xt,i(ce(t.dateOfBirth))+"y",1)):x("",!0)])]),P.value?.fdId===t.fdId?(r(),Fe(v(Be),{key:1,size:14,class:"picker-check"})):x("",!0)],10,ht))),128))])])])):x("",!0)])}}}),St=$e(wt,[["__scopeId","data-v-5a710fd5"]]);export{St as default};
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.