1import{r as c,u as N,by as S,v as w,j as s,P as O,F as E,J as U,G as A,K as B}from"./index-BIGiMjqK.js";import{getBlocs as F,onBlocSelection as R,blocSelection as z,blocColor as i,setBlocSelection as p,BOTH_COLOR as b}from"./blocs-BVRtg-Yr.js";const v=["UN","UNSC","G7","G20","BRICS","NATO","CSTO","SCO","AUKUS","QUAD","CANZUK","EU","EAEU","ASEAN","AU","ECOWAS","GCC","ARAB-LEAGUE","OIC","MERCOSUR","OPEC"];function $(){const[,r]=c.useReducer(e=>e+1,0),[n,m]=c.useState(F()),[u,C]=c.useState(null),[t,y]=c.useState(!1),d=N(e=>e.selected),x=N(e=>e.select);if(c.useEffect(()=>R(r),[]),c.useEffect(()=>{S().then(m).catch(()=>{}),w().then(C).catch(()=>{})},[]),!n)return null;const{primary:l,compare:a}=z,h=[...v.filter(e=>n[e]),...Object.keys(n).filter(e=>!v.includes(e))],f=e=>u?.[e]?.name??e,o=d&&u?u[d]:null,j=d?h.filter(e=>n[e].members.includes(d)):[],g=l&&a?n[l].members.filter(e=>n[a].members.includes(e)):[];return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"legend lift-2",role:"note","aria-label":"Legend",children:[s.jsx("span",{className:"kicker",children:"Membership"}),s.jsxs("div",{className:"legend-rows",children:[l&&s.jsxs("div",{className:"legend-row",children:[s.jsx("span",{className:"sw",style:{background:i(l)}}),n[l].name,s.jsx("span",{style:{marginLeft:"auto",fontFamily:"var(--font-data)",fontSize:10},children:n[l].members.length})]}),a&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"legend-row",children:[s.jsx("span",{className:"sw",style:{background:i(a)}}),n[a].name,s.jsx("span",{style:{marginLeft:"auto",fontFamily:"var(--font-data)",fontSize:10},children:n[a].members.length})]}),s.jsxs("div",{className:"legend-row",children:[s.jsx("span",{className:"sw",style:{background:b}}),"both",s.jsx("span",{style:{marginLeft:"auto",fontFamily:"var(--font-data)",fontSize:10},children:g.length})]})]})]}),l&&s.jsx(L,{bloc:n[l],name:f}),s.jsxs("div",{className:"legend-note",children:["Active members as of ",n[l??"UN"]?.asOf??"October 2026",". The EU and the African Union are members of the G20 as organisations and are not drawn as countries."]})]}),s.jsxs("div",{className:"dock",children:[s.jsxs("div",{className:"viewbar",role:"toolbar","aria-label":"Blocs",children:[h.map(e=>s.jsxs("button",{className:`pill${l===e?" on":""}`,style:{"--pill-color":i(e)},onClick:()=>p({primary:e,compare:a===e?null:a}),"aria-pressed":l===e,children:[s.jsx("span",{className:"sw"}),e]},e)),s.jsx("button",{className:`pill${t||a?" on":""}`,onClick:()=>{(t||a)&&p({compare:null}),y(!(t||a))},"aria-pressed":t||!!a,children:t||a?"Stop comparing":"Compareâ¦"})]}),(t||a)&&s.jsxs("div",{className:"viewbar",role:"toolbar","aria-label":"Compare bloc",children:[s.jsxs("span",{style:{fontSize:11,color:"var(--ink-faint)"},children:["compare ",l," with"]}),h.filter(e=>e!==l).map(e=>s.jsx("button",{className:`pill${a===e?" on":""}`,style:{"--pill-color":i(e)},onClick:()=>p({compare:a===e?null:e}),"aria-pressed":a===e,children:e},e))]})]}),s.jsx(O,{open:!!o,onClose:()=>x(null),kicker:"Memberships",title:o?.name??"",lead:o?s.jsx(B,{c:o}):void 0,children:o&&s.jsxs(s.Fragment,{children:[j.length?s.jsx("div",{className:"feat-rows",children:j.map(e=>s.jsxs("button",{className:"feat-row",onClick:()=>p({primary:e}),children:[s.jsx("span",{className:"sw",style:{background:i(e)}}),n[e].name,s.jsxs("span",{className:"v",children:[n[e].members.length," members"]})]},e))}):s.jsxs("p",{style:{color:"var(--ink-soft)",fontSize:13},children:[o.name," belongs to none of the recorded blocs."]}),l&&a&&s.jsxs(s.Fragment,{children:[s.jsx("hr",{className:"rule"}),s.jsxs("span",{className:"kicker",children:[l," â© ",a]}),s.jsx("div",{className:"rel-matrix",style:{maxHeight:220,overflowY:"auto",marginTop:6},children:g.map(e=>s.jsxs("button",{className:"rel-matrix-row",onClick:()=>{x(e),U.flyToCountry(e)},children:[s.jsx("span",{className:"sw",style:{background:b}}),s.jsx(E,{iso3:e}),f(e)]},e))})]}),s.jsx(A,{ids:["country-index"]})]})})]})}function L({bloc:r,name:n}){const m=[r.suspended?.length?`Suspended: ${r.suspended.map(n).join(", ")}.`:"",r.frozen?.length?`Participation frozen: ${r.frozen.map(n).join(", ")}.`:"",r.observers?.length?`Observers: ${r.observers.map(n).join(", ")}
1.`:""].filter(Boolean);return!r.note&&!m.length&&!r.source?null:s.jsxs("div",{className:"legend-note",children:[r.note," ",m.join(" "),r.source&&s.jsxs("span",{className:"cite",children:[" Source: ",r.source,"."]})]})}export{$ 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.