try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`6dcbaeb1-6562-4840-a4a6-677573acc346`,e._sentryDebugIdIdentifier=`sentry-dbid-6dcbaeb1-6562-4840-a4a6-677573acc346`)}catch{}import{o as e}from"./rolldown-runtime-eb2nym32.js";import{Ag as t,Ig as n,Qp as r,Tr as i,hs as a,it as o,nt as s}from"./entry.client-dr7r6s9a.js";var c=e(n(),1),l=t(),u=({children:e})=>{let t=r().history,{focusContainerRef:n}=i(),[u]=(0,c.useState)(()=>new s),d=(0,c.useRef)(t.index);(0,c.useEffect)(()=>{let e,n=t.subscribeInternal(()=>{let n=d.current,r=t.index;d.current=r,e!==void 0&&(cancelAnimationFrame(e),e=void 0),r>n?u.storeDataAtKey(n):r<n&&(e=requestAnimationFrame(()=>{e=requestAnimationFrame(()=>{e=void 0,u.restoreDataAtKey(r)})}))});return()=>{e!==void 0&&cancelAnimationFrame(e),n()}},[t,u]);let f=(0,c.useCallback)(()=>n.current?.getLastRememberedFocus()?.getBoundingClientRect(),[n]),p=(0,c.useCallback)(e=>{let t=n.current;t&&e&&(t.setRefocusTargetRect(e),a())},[n]),m=(0,c.useMemo)(()=>({stateRestorationManager:u,storeLastFocusData:f,restoreLastFocusData:p}),[u,f,p]);return(0,l.jsx)(o.Provider,{value:m,children:e})};export{u as t};