{"version":3,"file":"PageContents.BcGkBPyL.mjs","names":["useRef","useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/ZPBeIJgp8b33eZTvo1aI/eutKOowBI34sBlgUNpr0/PageContents.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useEffect,useRef}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";const EASE=\"260ms cubic-bezier(0.33, 0, 0.22, 1)\";const labelStyle={fontFamily:'\"General Sans\", sans-serif',fontWeight:600,fontSize:11,lineHeight:\"16px\",letterSpacing:\"0.1em\",textTransform:\"uppercase\"};function targetOf(item){return String(item.target||\"\").replace(/^#/,\"\");}export default function PageContents(props){const{items,eyebrow,footnote,layout,offset,text,muted,accent,rule,surface,style}=props;const list=(items||[]).filter(i=>i&&i.label&&i.target);const onCanvas=RenderTarget.current()===RenderTarget.canvas;const wrap=useRef(null);const[narrow,setNarrow]=useState(false);useEffect(()=>{const el=wrap.current;if(!el||typeof ResizeObserver===\"undefined\")return;const ro=new ResizeObserver(entries=>{for(const e of entries)setNarrow(e.contentRect.width>480?false:window.innerWidth<600);});ro.observe(el);return()=>ro.disconnect();},[]);const asBar=layout===\"bar\"||layout===\"auto\"&&narrow;/* Scroll spy: the current section is the last one whose top has passed\n       a line a little below the top of the screen. */const[active,setActive]=useState(0);useEffect(()=>{if(onCanvas||list.length===0)return;let frame=0;const update=()=>{frame=0;const line=offset+80;let current=0;list.forEach((item,i)=>{const el=document.getElementById(targetOf(item));if(el&&el.getBoundingClientRect().top<=line)current=i;});setActive(current);};const onScroll=()=>{if(!frame)frame=requestAnimationFrame(update);};update();window.addEventListener(\"scroll\",onScroll,{passive:true});window.addEventListener(\"resize\",onScroll);return()=>{window.removeEventListener(\"scroll\",onScroll);window.removeEventListener(\"resize\",onScroll);if(frame)cancelAnimationFrame(frame);};},[onCanvas,offset,list.map(targetOf).join(\"|\")]);const[open,setOpen]=useState(false);useEffect(()=>{if(!open)return;const close=e=>{if(wrap.current&&!wrap.current.contains(e.target))setOpen(false);};const esc=e=>{if(e.key===\"Escape\")setOpen(false);};document.addEventListener(\"pointerdown\",close);document.addEventListener(\"keydown\",esc);return()=>{document.removeEventListener(\"pointerdown\",close);document.removeEventListener(\"keydown\",esc);};},[open]);const reduceMotion=typeof window!==\"undefined\"&&typeof window.matchMedia===\"function\"&&window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;function go(i,e){const id=targetOf(list[i]);const el=typeof document!==\"undefined\"?document.getElementById(id):null;if(!el)return;if(e)e.preventDefault();setOpen(false);setActive(i);/* On phones the bar itself sits over the top of the page, so leave room for it. */const room=asBar?offset+72:offset+24;const top=el.getBoundingClientRect().top+window.scrollY-room;window.scrollTo({top,behavior:reduceMotion?\"auto\":\"smooth\"});if(window.history&&window.history.replaceState)window.history.replaceState(window.history.state,\"\",\"#\"+id);}const link=(item,i,inBar)=>{const on=i===active;return /*#__PURE__*/_jsxs(\"a\",{href:\"#\"+targetOf(item),onClick:e=>go(i,e),\"aria-current\":on?\"location\":undefined,style:{...labelStyle,display:\"flex\",alignItems:\"center\",gap:10,color:on?accent:text,textDecoration:\"none\",padding:inBar?\"10px 0\":\"3px 0\",transition:\"color \"+EASE},children:[!inBar?/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{width:on?12:0,height:1.5,background:accent,transition:\"width \"+EASE,flex:\"0 0 auto\"}}):null,item.label]},targetOf(item)+i);};if(asBar){const current=list[active];return /*#__PURE__*/_jsxs(\"nav\",{ref:wrap,\"aria-label\":eyebrow||\"On this page\",style:{position:\"relative\",width:\"100%\",background:surface,borderBottom:`1px solid ${rule}`,...style},children:[/*#__PURE__*/_jsxs(\"button\",{type:\"button\",\"aria-expanded\":open,onClick:()=>setOpen(o=>!o),style:{display:\"flex\",alignItems:\"center\",justifyContent:\"space-between\",gap:12,width:\"100%\",padding:\"14px 0\",border:\"none\",background:\"transparent\",cursor:\"pointer\",textAlign:\"left\"},children:[/*#__PURE__*/_jsxs(\"span\",{style:{display:\"flex\",flexDirection:\"column\",gap:2,minWidth:0},children:[/*#__PURE__*/_jsx(\"span\",{style:{...labelStyle,color:accent},children:eyebrow}),/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:'\"Public Sans\", sans-serif',fontSize:15,lineHeight:\"22px\",color:text,whiteSpace:\"nowrap\",overflow:\"hidden\",textOverflow:\"ellipsis\"},children:current?current.label:\"\"})]}),/*#__PURE__*/_jsx(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:text,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",\"aria-hidden\":\"true\",style:{flex:\"0 0 auto\",transform:open?\"rotate(180deg)\":\"none\",transition:\"transform \"+EASE},children:/*#__PURE__*/_jsx(\"path\",{d:\"m6 9 6 6 6-6\"})})]}),open?/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:\"100%\",left:0,right:0,zIndex:20,background:surface,borderBottom:`1px solid ${rule}`,boxShadow:\"0 12px 24px var(--token-7936592d-8a6d-4982-8049-a329733a03d3, rgba(0, 0, 0, 0.08))\",padding:\"4px 0 12px\",display:\"flex\",flexDirection:\"column\",maxHeight:\"60vh\",overflowY:\"auto\"},children:list.map((item,i)=>link(item,i,true))}):null]});}return /*#__PURE__*/_jsxs(\"nav\",{ref:wrap,\"aria-label\":eyebrow||\"On this page\",style:{display:\"flex\",flexDirection:\"column\",gap:24,width:\"100%\",...style},children:[eyebrow?/*#__PURE__*/_jsx(\"span\",{style:{...labelStyle,color:accent},children:eyebrow}):null,/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:11},children:list.map((item,i)=>link(item,i,false))}),footnote?/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"div\",{style:{height:1,background:rule}}),/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:'\"Public Sans\", sans-serif',fontSize:13,lineHeight:\"19px\",color:muted},children:footnote})]}):null]});}const defaults={items:[{label:\"First section\",target:\"first-section\"},{label:\"Second section\",target:\"second-section\"}],eyebrow:\"On this page\",footnote:\"\",layout:\"auto\",offset:32,text:\"var(--token-e4a4b42c-212e-4a57-8531-1b8ea8d85573, #161512)\",muted:\"var(--token-6c31cc05-eed3-47c8-b09e-ab64cf8aed09, #706F6B)\",accent:\"var(--token-0bcfa14b-79c6-43c7-812e-3f0bdfee7dcf, #A1533D)\",rule:\"var(--token-7b514f45-828e-4dd3-b36c-c06744a661e8, #DBD2CB)\",surface:\"var(--token-a6b60c58-05e7-4bf5-81c0-9bf4114476b7, #FFFFFF)\"};PageContents.defaultProps=defaults;addPropertyControls(PageContents,{items:{type:ControlType.Array,title:\"Items\",control:{type:ControlType.Object,controls:{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Section\"},target:{type:ControlType.String,title:\"Target\",defaultValue:\"\",description:\"The section's scroll target id\"}}},defaultValue:defaults.items},eyebrow:{type:ControlType.String,title:\"Eyebrow\",defaultValue:defaults.eyebrow},footnote:{type:ControlType.String,title:\"Footnote\",defaultValue:\"\",description:\"E.g. Last updated…\"},layout:{type:ControlType.Enum,title:\"Layout\",options:[\"auto\",\"column\",\"bar\"],optionTitles:[\"Auto\",\"Column\",\"Bar\"],defaultValue:\"auto\",description:\"Auto: a bar on phones, a column elsewhere\"},offset:{type:ControlType.Number,title:\"Top offset\",min:0,max:200,step:4,defaultValue:32,description:\"Match the sticky top value\"},text:{type:ControlType.Color,title:\"Text\",defaultValue:defaults.text},muted:{type:ControlType.Color,title:\"Muted\",defaultValue:defaults.muted},accent:{type:ControlType.Color,title:\"Accent\",defaultValue:defaults.accent},rule:{type:ControlType.Color,title:\"Rule\",defaultValue:defaults.rule},surface:{type:ControlType.Color,title:\"Bar fill\",defaultValue:defaults.surface}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PageContents\",\"slots\":[],\"annotations\":{\"framerContractVersion\":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