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]=`9678951e-933d-4bad-89b1-68b882881384`,e._sentryDebugIdIdentifier=`sentry-dbid-9678951e-933d-4bad-89b1-68b882881384`)}catch{}import{o as e}from"./rolldown-runtime-nx40z1zs.js";import{Ag as t,jg as n,ng as r,on as i}from"./entry.client-mpghtlrl.js";var a=t(),o=e(n(),1);function s(){let e=(0,o.useContext)(i);if(!e)throw Error(`useNavigationStackContext must be used within a NavigationStackProvider`);return e}var c=()=>{let e=(0,a.c)(16),{stack:t,clear:n,defaultPath:r,navigateBack:i,onStackAtRootNavigateBack:o,navigateTo:c,rootStackLength:l}=s(),u;e[0]!==t||e[1]!==l||e[2]!==r?(u=()=>t.length>l?t[t.length-1].pathname:r,e[0]=t,e[1]=l,e[2]=r,e[3]=u):u=e[3];let d=u,f=t.length>l,p;e[4]!==t||e[5]!==l||e[6]!==i||e[7]!==r||e[8]!==n||e[9]!==c||e[10]!==o?(p=()=>{t.length>l&&i?i():t.length===0||t[t.length-1].pathname!==r?(n(),c(r)):o&&o()},e[4]=t,e[5]=l,e[6]=i,e[7]=r,e[8]=n,e[9]=c,e[10]=o,e[11]=p):p=e[11];let m=p,h;return e[12]!==d||e[13]!==f||e[14]!==m?(h={getBackPath:d,canNavigateBack:f,navigateBack:m},e[12]=d,e[13]=f,e[14]=m,e[15]=h):h=e[15],h},l=()=>s().direction,u=()=>s().directionRef.current,d=r();function f(e){let t=(0,a.c)(5),{children:n}=e,r,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s={pathname:`/`,key:`flat`},t[0]=s):s=t[0],r=s;let c=r,l,u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u=[c],t[1]=u):u=t[1],l=u;let f=l,h=(0,o.useRef)(f),g=(0,o.useRef)(`Initial`),_;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(_={stack:f,stackRef:h,direction:`Initial`,directionRef:g,clear:m,defaultPath:`/`,navigateBack:void 0,navigateTo:p,rootStackLength:1},t[2]=_):_=t[2];let v;return t[3]===n?v=t[4]:(v=(0,d.jsx)(i.Provider,{value:_,children:n}),t[3]=n,t[4]=v),v}function p(){}function m(){}function h(){let e=(0,o.useContext)(i);return e?e.stackRef.current.length<=e.rootStackLength:!0}function g(){return(0,o.useContext)(i)?.navigateBack}export{u as a,l as i,h as n,c as o,f as r,s,g as t};