import{r as l,j as c,a9 as i,b3 as T,b4 as x,b5 as b,b6 as E}from"./index-91e9700c.js";const P=l.createContext(null),a=P;function d(){return l.useContext(a)}const y=typeof Symbol=="function"&&Symbol.for,_=y?Symbol.for("mui.nested"):"__THEME_NESTED__";function g(e,n){return typeof n=="function"?n(e):i({},e,n)}function S(e){const{children:n,theme:t}=e,o=d(),u=l.useMemo(()=>{const r=o===null?t:g(o,t);return r!=null&&(r[_]=o!==null),r},[t,o]);return c(a.Provider,{value:u,children:n})}const m={};function f(e,n,t,o=!1){return l.useMemo(()=>{const u=e&&n[e]||n;if(typeof t=="function"){const r=t(u),s=e?i({},n,{[e]:r}):r;return o?()=>s:s}return e?i({},n,{[e]:t}):i({},n,t)},[e,n,t,o])}function M(e){const{children:n,theme:t,themeId:o}=e,u=T(m),r=d()||m,s=f(o,u,t),h=f(o,r,t,!0),v=s.direction==="rtl";return c(S,{theme:h,children:c(x.Provider,{value:s,children:c(b,{value:v,children:c(E,{value:s==null?void 0:s.components,children:n})})})})}export{M as T,d as u};
