import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{mt as t}from"./antd-NNbrPHoG.js";import{s as n}from"./chunk-QFMPRPBF-ZgigjiE1.js";import{t as r}from"./react-vendor-nIJYBVRh.js";var i=e(t(),1),a=r(),o=(0,i.createContext)(null);function s({children:e}){let t=n(),[r,s]=(0,i.useState)(null);(0,i.useEffect)(()=>{s(null)},[t.pathname]);let c=(0,i.useMemo)(()=>({registration:r,setRegistration:s}),[r]);return(0,a.jsx)(o.Provider,{value:c,children:e})}function c(){let e=(0,i.useContext)(o);if(!e)throw Error(`AssistantPageContextBridgeProvider is missing`);return e}function l(e){let{setRegistration:t}=c();(0,i.useEffect)(()=>{t(e)},[e,t]),(0,i.useEffect)(()=>()=>{t(null)},[t])}export{c as n,l as r,s as t};