import{cW as M,cX as F,cY as $,cV as n,cZ as I,c_ as X,c$ as Y}from"./index-e79f7aad.js";const Z=["ownerState"],q=["variants"],z=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function B(e){return Object.keys(e).length===0}function G(e){return typeof e=="string"&&e.charCodeAt(0)>96}function A(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const H=I(),J=e=>e&&e.charAt(0).toLowerCase()+e.slice(1);function _({defaultTheme:e,theme:s,themeId:t}){return B(s)?e:s[t]||s}function K(e){return e?(s,t)=>t[e]:null}function x(e,s){let{ownerState:t}=s,d=F(s,Z);const l=typeof e=="function"?e(n({ownerState:t},d)):e;if(Array.isArray(l))return l.flatMap(h=>x(h,n({ownerState:t},d)));if(l&&typeof l=="object"&&Array.isArray(l.variants)){const{variants:h=[]}=l;let m=F(l,q);return h.forEach(r=>{let i=!0;typeof r.props=="function"?i=r.props(n({ownerState:t},d,t)):Object.keys(r.props).forEach(p=>{(t==null?void 0:t[p])!==r.props[p]&&d[p]!==r.props[p]&&(i=!1)}),i&&(Array.isArray(m)||(m=[m]),m.push(typeof r.style=="function"?r.style(n({ownerState:t},d,t)):r.style))}),m}return l}function U(e={}){const{themeId:s,defaultTheme:t=H,rootShouldForwardProp:d=A,slotShouldForwardProp:l=A}=e,h=c=>X(n({},c,{theme:_(n({},c,{defaultTheme:t,themeId:s}))}));return h.__mui_systemSx=!0,(c,m={})=>{M(c,o=>o.filter(a=>!(a!=null&&a.__mui_systemSx)));const{name:r,slot:i,skipVariantsResolver:p,skipSx:V,overridesResolver:k=K(J(i))}=m,b=F(m,z),E=p!==void 0?p:i&&i!=="Root"&&i!=="root"||!1,N=V||!1;let L,v=A;i==="Root"||i==="root"?v=d:i?v=l:G(c)&&(v=void 0);const R=$(c,n({shouldForwardProp:v,label:L},b)),C=o=>typeof o=="function"&&o.__emotion_real!==o||Y(o)?a=>x(o,n({},a,{theme:_({theme:a.theme,defaultTheme:t,themeId:s})})):o,P=(o,...a)=>{let O=C(o);const y=a?a.map(C):[];r&&k&&y.push(f=>{const u=_(n({},f,{defaultTheme:t,themeId:s}));if(!u.components||!u.components[r]||!u.components[r].styleOverrides)return null;const S=u.components[r].styleOverrides,w={};return Object.entries(S).forEach(([W,D])=>{w[W]=x(D,n({},f,{theme:u}))}),k(f,w)}),r&&!E&&y.push(f=>{var u;const S=_(n({},f,{defaultTheme:t,themeId:s})),w=S==null||(u=S.components)==null||(u=u[r])==null?void 0:u.variants;return x({variants:w},n({},f,{theme:S}))}),N||y.push(h);const j=y.length-a.length;if(Array.isArray(o)&&j>0){const f=new Array(j).fill("");O=[...o,...f],O.raw=[...o.raw,...f]}const T=R(O,...y);return c.muiName&&(T.muiName=c.muiName),T};return R.withConfig&&(P.withConfig=R.withConfig),P}}export{U as c,A as s};
