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]=`3440f1b9-61c4-4d2b-a245-6c04a2f6e8d7`,e._sentryDebugIdIdentifier=`sentry-dbid-3440f1b9-61c4-4d2b-a245-6c04a2f6e8d7`)}catch{}import{o as e}from"./rolldown-runtime-nx40z1zs.js";import{Ag as t,Bt as n,Gu as r,Ji as i,Lm as a,Qh as o,Qm as s,Tm as c,Yh as l,Yi as u,Zm as d,jg as f,jm as p,ng as m,op as h,sn as g,yg as _}from"./entry.client-mpghtlrl.js";import{n as v}from"./auth-hooks-dkb6uyrd.js";var y=i(),b=t(),x=e(f(),1),S=new _(`useInsiderPreviewGateNavigation`),C=()=>{let e=(0,b.c)(20),t=g(),n=p(),{insiderPreviewGate:i}=d(),{trackAppAction:a}=s(`useInsiderPreviewGateNavigation`),c=v(),u;e[0]===i.queries.navigationDecision?u=e[1]:(u=i.queries.navigationDecision.getOptions(),e[0]=i.queries.navigationDecision,e[1]=u);let{data:f}=o(u),m;e[2]===i.mutations.openGateDialog?m=e[3]:(m=i.mutations.openGateDialog.getOptions(),e[2]=i.mutations.openGateDialog,e[3]=m);let{mutateAsync:_}=l(m),y;e[4]!==f||e[5]!==c||e[6]!==n.pathname||e[7]!==n.search||e[8]!==n.hash||e[9]!==t||e[10]!==a||e[11]!==_?(y=()=>{if(f!=null){S.info(`navigationDecision resolved`,{action:f});bb5:switch(f){case`sign-in-required`:c();break bb5;case`access-denied`:{let e=r.insiderPreviewGate.$path(),i=n.pathname===e?void 0:`${n.pathname}${n.search}${n.hash}`;t(r.insiderPreviewGate.$buildPath({searchParams:{redirectUri:i}}),{replace:!0});break bb5}case`show-welcome`:a(`OpenModal`,{modalType:h.dialog.insiderPreviewGate.fullPath},{location:`handlePreviewWelcome`}),_({mode:`Welcome`}).catch(e=>{S.error(`Failed to open insider preview gate dialog`,e)});break bb5;case`allowed`:}}},e[4]=f,e[5]=c,e[6]=n.pathname,e[7]=n.search,e[8]=n.hash,e[9]=t,e[10]=a,e[11]=_,e[12]=y):y=e[12];let C;e[13]!==f||e[14]!==c||e[15]!==t||e[16]!==n||e[17]!==a||e[18]!==_?(C=[f,c,t,n,a,_],e[13]=f,e[14]=c,e[15]=t,e[16]=n,e[17]=a,e[18]=_,e[19]=C):C=e[19],(0,x.useEffect)(y,C)},w=m(),T=()=>{let e=(0,b.c)(1);C();let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,w.jsx)(`div`,{className:`h-screen w-screen`,children:(0,w.jsx)(n,{className:`h-1/2 w-1/2`})}),e[0]=t):t=e[0],t},E=a(()=>{let e=(0,y.c)(9),{insiderPreviewGate:t}=d(),n;e[0]===t.queries.isPreviewGateEnabled?n=e[1]:(n=t.queries.isPreviewGateEnabled.getOptions(),e[0]=t.queries.isPreviewGateEnabled,e[1]=n);let{data:r,isPending:i}=o(n),a;e[2]===t.queries.isPreviewAccessAllowed?a=e[3]:(a=t.queries.isPreviewAccessAllowed.getOptions(),e[2]=t.queries.isPreviewAccessAllowed,e[3]=a);let{data:s,isPending:l}=o(a),u;e[4]===t.queries.hasSeenPreviewWelcomeDialog?u=e[5]:(u=t.queries.hasSeenPreviewWelcomeDialog.getOptions(),e[4]=t.queries.hasSeenPreviewWelcomeDialog,e[5]=u);let{data:f,isPending:p}=o(u);if(r===!1&&!i){let t;return e[6]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,w.jsx)(c,{}),e[6]=t):t=e[6],t}if(s&&f&&!l&&!p){let t;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,w.jsx)(c,{}),e[7]=t):t=e[7],t}let m;return e[8]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,w.jsx)(T,{}),e[8]=m):m=e[8],m});export{u as clientLoader,E as default};