Loading our team…
We couldn’t load the team. Please try again.
Swipe sideways to explore the map and clinician fan.
Select a state to explore the team.
p.states.includes(state.code)))state.code='';render();
}catch(error){loaded=false;root.querySelector('.ic-load-error').hidden=false;status.textContent='Team information is temporarily unavailable.';console.error('Inner Compass staff table:',error.message);}
finally{root.querySelector('.ic-loading').hidden=true;}
}
function createPerson(person) {
const article=document.createElement('article'); article.className='ic-person'; article.dataset.person=person.id;
const button=document.createElement('button'); button.type='button'; button.className='ic-person-button'; button.id=`ic-person-${person.id}`;
button.setAttribute('aria-controls',`ic-bio-${person.id}`);
const portrait=document.createElement(person.photo?'img':'span'); portrait.className='ic-photo';
if(person.photo) {portrait.src=person.photo;portrait.alt=`${person.name} headshot`;portrait.width=64;portrait.height=64;portrait.decoding='async';}
else {portrait.classList.add('ic-photo-placeholder');portrait.textContent=person.initials;portrait.setAttribute('aria-label','Photo coming soon');}
const label=createLabel(person);
button.append(portrait,label);
const bio=document.createElement('div');bio.className='ic-bio';bio.id=`ic-bio-${person.id}`;bio.setAttribute('role','region');bio.setAttribute('aria-labelledby',button.id);bio.tabIndex=0;
if(!person.photo) {const note=document.createElement('p');note.textContent='Photo coming soon.';bio.append(note);}
if(person.credentials) {const credentials=document.createElement('p');credentials.className='ic-credentials';credentials.textContent=person.credentials;bio.append(credentials);}
for(const paragraph of person.bio) {const p=document.createElement('p');p.textContent=paragraph;bio.append(p);}
const licenses=document.createElement('p');licenses.textContent=stateDescription(person);bio.append(licenses);
if(person.spanish) {const languages=document.createElement('p');languages.textContent='Sessions available in Spanish.';bio.append(languages);}
const dismiss=document.createElement('button');dismiss.type='button';dismiss.className='ic-bio-close';dismiss.textContent='Close biography';dismiss.addEventListener('click',()=>{toggleBio(person.id);button.focus();});bio.append(dismiss);
button.addEventListener('click',()=>toggleBio(person.id));
article.append(button,bio);return article;
}
function updateExpanded() {
for(const article of result.children) {const open=article.dataset.person===state.person;article.classList.toggle('is-open',open);article.querySelector('.ic-person-button').setAttribute('aria-expanded',String(open));article.querySelector('.ic-bio').hidden=!open;}
}
function layout(animate=false) {
if(!loaded||state.view!=='map')return;
const available=Math.max(440,viewport.clientWidth), tiny=available<560, compact=available<900;
const tile=tiny?68:compact?88:112, photoSize=tiny?44:compact?56:64, gap=10;
canvas.classList.toggle('is-compact',tiny);
canvas.style.setProperty('--ic-tile',`${tile}px`);canvas.style.setProperty('--ic-photo-size',`${photoSize}px`);
canvas.style.setProperty('--ic-node-font',`${tiny?12:compact?13:14}px`);canvas.style.setProperty('--ic-node-line',`${tiny?14:compact?16:17}px`);
connectors.replaceChildren();updateExpanded();
const point=state.code?(state.origin||centers[state.code]):[0,0];
const direction={MD:'east',FL:'east',SC:'east',NY:'north',TX:'south',OK:'south',CO:'west'}[state.code]||(state.code?(point[0]<450?'west':point[0]>740?'east':point[1]<300?'north':'south'):null);
const axis={east:0,north:Math.PI/2,south:Math.PI*1.5,west:Math.PI}[direction];
const cards=[...result.children];
// The previous Maryland map was 520px wide. Keep its 25% enlargement
// consistent between states, independently of the number of clinicians.
const mapWidth=520*1.25;
const scale=mapWidth/1120, mapHeight=mapWidth*640/1120;
const anchor={x:point[0]*scale,y:point[1]*scale};
const rings=cards.length<=4?[{count:cards.length}]:[{count:Math.floor(cards.length/2)},{count:Math.ceil(cards.length/2)}];
const spread=cards.length>4?Math.PI*2/3:Math.PI/2;
const placements=[];
let offset=0;
let arcEdge=mapWidth+gap;
for(const [ringIndex,ring] of rings.entries()) {
if(direction==='east' && cards.length>4) {
// Shallow arcs pack the profiles near the coast; their spacing is based
// on the actual photo/name heights instead of the browser width.
const ringCards=cards.slice(offset,offset+ring.count);
const heights=ringCards.map(a=>a.querySelector('.ic-person-button').offsetHeight);
const pitch=Math.max(...heights)+6, halfSpan=(ring.count-1)*pitch/2;
const depth=tile*(ringIndex?0.4:0.35);
ringCards.forEach((article,i)=>{
const dy=-halfSpan+i*pitch;
const curve=Math.sqrt(1-Math.pow(dy/(halfSpan||1)*Math.sin(spread/2),2));
const centerX=arcEdge+tile/2+depth*curve,centerY=anchor.y+dy;
const radius=Math.hypot(centerX-anchor.x,dy),angle=Math.atan2(-dy,centerX-anchor.x);
placements.push({article,angle,radius,ringIndex,centerX,centerY,x:centerX-tile/2,y:centerY-photoSize/2,h:heights[i]});
});
arcEdge+=tile+depth+gap;
offset+=ring.count;
continue;
}
const angles=Array.from({length:ring.count},(_,i)=>ring.count===1?axis:axis+spread/2-spread*i/(ring.count-1));
// Keep the complete photo/name widget beyond the map edge on the requested side.
const clearances=angles.map((angle,i)=>{
const h=cards[offset+i].querySelector('.ic-person-button').offsetHeight;
if(direction==='east') return (mapWidth+gap+tile/2-anchor.x)/Math.cos(angle);
if(direction==='west') return (anchor.x+gap+tile/2)/-Math.cos(angle);
if(direction==='north') return (anchor.y+h-photoSize/2+gap)/Math.sin(angle);
return (mapHeight+gap+photoSize/2-anchor.y)/-Math.sin(angle);
});
ring.radius=Math.max(0,...clearances,ringIndex?(rings[ringIndex-1].radius||0)+tile+12:0);
for(let i=0;i
item.offsetHeight));
const mdCount=people.filter(person=>person.states.includes('MD')).length;
const outerCount=Math.max(1,Math.ceil(mdCount/2));
const halfFan=(outerCount-1)*(maxCardHeight+6)/2;
const shiftX=tile+gap+4;
const shiftY=Math.ceil(Math.max(maxCardHeight+gap,halfFan+photoSize/2-bounds.MD[0][1]*scale))+4;
const width=Math.max(available,shiftX+mapWidth+2*tile+2*gap+tile*.75+4);
let bottom=Math.max(mapHeight+gap+maxCardHeight+(mapHeight-bounds.TX[0][1]*scale+gap+photoSize/2)*(Math.SQRT2-1),bounds.MD[1][1]*scale+halfFan-photoSize/2+maxCardHeight)+4;
map.style.width=`${mapWidth}px`;map.style.left=`${shiftX}px`;map.style.top=`${shiftY}px`;
map.style.setProperty('--ic-map-label-size',`${11/scale}px`);
map.querySelectorAll('.ic-label-outline').forEach(g=>g.setAttribute('transform',`scale(${1/scale})`));
const callouts=[...map.querySelectorAll('.ic-state-callout')];
const calloutSpan=(callouts.length-1)*16;
const calloutStart=Math.max(10,Math.min(mapHeight-calloutSpan-10,mapHeight*.35-calloutSpan/2));
callouts.forEach((g,i)=>{
const y=(calloutStart+i*16)/scale, label=g.querySelector('text');
label.setAttribute('y',y);
g.querySelector('polyline').setAttribute('points',`${g.dataset.x},${g.dataset.y} 1007,${y} 1022,${y}`);
// Keep the circled star 4px from MD, with a fixed 12px outer diameter.
const marker=g.querySelector('.ic-home-marker');
if(marker) marker.setAttribute('transform',`translate(${1035+label.getComputedTextLength()+10/scale},${y}) scale(${1/scale})`);
});
canvas.dataset.direction=direction||'';canvas.dataset.originX=anchor.x+shiftX;canvas.dataset.originY=anchor.y+shiftY;
pin.style.left=`${anchor.x+shiftX}px`;pin.style.top=`${anchor.y+shiftY}px`;
placements.forEach((p,index)=>{
const x=p.x+shiftX,y=p.y+shiftY;
p.article.style.left=`${x}px`;p.article.style.top=`${y}px`;
p.article.dataset.angle=p.angle;p.article.dataset.radius=p.radius;p.article.dataset.ring=p.ringIndex;
const bio=p.article.querySelector('.ic-bio');bio.style.left=`${Math.max(4-x,Math.min((tile-264)/2,width-x-268))}px`;
if(p.article.classList.contains('is-open')) bottom=Math.max(bottom,p.y+p.h+bio.offsetHeight+12);
const line=document.createElementNS('http://www.w3.org/2000/svg','line');
line.setAttribute('x1',anchor.x+shiftX);line.setAttribute('y1',anchor.y+shiftY);line.setAttribute('x2',p.centerX+shiftX);line.setAttribute('y2',p.centerY+shiftY);connectors.append(line);
if(animate&&!matchMedia('(prefers-reduced-motion: reduce)').matches) {
p.article.style.transformOrigin=`${tile/2}px ${photoSize/2}px`;
runningAnimations.push(p.article.animate([{transform:`translate(${anchor.x-p.centerX}px,${anchor.y-p.centerY}px) scale(.08)`,opacity:0},{transform:'translate(0,0) scale(1)',opacity:1}],{duration:580,delay:index*30,easing:'cubic-bezier(.18,.7,.2,1)',fill:'backwards'}));
line.style.strokeDasharray=p.radius;
runningAnimations.push(line.animate([{strokeDashoffset:p.radius},{strokeDashoffset:0}],{duration:580,delay:index*30,easing:'cubic-bezier(.18,.7,.2,1)',fill:'backwards'}));
}
});
const height=Math.ceil(bottom+shiftY);
canvas.style.width=`${Math.ceil(width)}px`;canvas.style.height=`${height}px`;connectors.setAttribute('viewBox',`0 0 ${Math.ceil(width)} ${height}`);
root.querySelector('.ic-pan-note').hidden=width<=viewport.clientWidth+1;
}
function render(animate=false) {
runningAnimations.forEach(animation=>animation.cancel());runningAnimations=[];
select.value=state.code;links.forEach(link=>link.setAttribute('aria-pressed',String(link.dataset.state===state.code)));
pin.hidden=!state.code;close.hidden=!state.code;
const all=roster();result.replaceChildren(...all.map(createPerson));
status.textContent=state.code?`${names[state.code]} · ${all.length} ${all.length===1?'team member':'team members'}`:'Select a state to explore the team.';
applyView();layout(animate);
}
links.forEach(link=>{
link.addEventListener('click',event=>{event.preventDefault();if(!loaded||link.getAttribute('aria-disabled')==='true')return;const rect=map.getBoundingClientRect();const origin=event.detail>0?[(event.clientX-rect.left)*1120/rect.width,(event.clientY-rect.top)*1120/rect.width]:null;setState(link.dataset.state,origin);});
link.addEventListener('keydown',event=>{if(event.key===' '){event.preventDefault();if(loaded&&link.getAttribute('aria-disabled')!=='true')setState(link.dataset.state);}});
});
select.addEventListener('change',()=>{state.view='map';setState(select.value);});
close.addEventListener('click',()=>{setState('');select.focus();});
tabs.forEach((tab,index)=>{
tab.addEventListener('click',()=>setView(tab.dataset.view));
tab.addEventListener('keydown',event=>{let next;if(event.key==='ArrowRight')next=(index+1)%tabs.length;else if(event.key==='ArrowLeft')next=(index+tabs.length-1)%tabs.length;else if(event.key==='Home')next=0;else if(event.key==='End')next=tabs.length-1;else return;event.preventDefault();tabs[next].focus();setView(tabs[next].dataset.view);});
});
root.querySelector('.ic-retry').addEventListener('click',loadStaff);
root.addEventListener('keydown',event=>{if(event.key==='Escape'&&state.view==='map'){if(state.person){const id=state.person;toggleBio(id);root.querySelector(`#ic-person-${id}`)?.focus();}else if(state.code){setState('');select.focus();}}});
applyView();loadStaff();
let lastWidth=viewport.clientWidth;
new ResizeObserver(()=>{const width=viewport.clientWidth;if(loaded&&state.view==='map'&&width>0&&Math.abs(width-lastWidth)>.5){lastWidth=width;runningAnimations.forEach(animation=>animation.cancel());runningAnimations=[];layout();}}).observe(viewport);
window.addEventListener('openai:set_globals',event=>{if(event.detail?.globals?.widgetState){applySaved(event.detail.globals.widgetState);render();}});
})();