import{cQ as W,cR as F,cS as I,cP as n,cT as Q,cU as U,cV as $}from"./index-5ae5cc5e.js";const q=["ownerState"],z=["variants"],B=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function G(e){return Object.keys(e).length===0}function H(e){return typeof e=="string"&&e.charCodeAt(0)>96}function A(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const J=Q(),K=e=>e&&e.charAt(0).toLowerCase()+e.slice(1);function _({defaultTheme:e,theme:s,themeId:t}){return G(s)?e:s[t]||s}function X(e){return e?(s,t)=>t[e]:null}function x(e,s){let{ownerState:t}=s,d=F(s,q);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,z);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 Z(e={}){const{themeId:s,defaultTheme:t=J,rootShouldForwardProp:d=A,slotShouldForwardProp:l=A}=e,h=c=>U(n({},c,{theme:_(n({},c,{defaultTheme:t,themeId:s}))}));return h.__mui_systemSx=!0,(c,m={})=>{W(c,o=>o.filter(a=>!(a!=null&&a.__mui_systemSx)));const{name:r,slot:i,skipVariantsResolver:p,skipSx:V,overridesResolver:P=X(K(i))}=m,b=F(m,B),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:H(c)&&(v=void 0);const R=I(c,n({shouldForwardProp:v,label:L},b)),k=o=>typeof o=="function"&&o.__emotion_real!==o||$(o)?a=>x(o,n({},a,{theme:_({theme:a.theme,defaultTheme:t,themeId:s})})):o,C=(o,...a)=>{let O=k(o);const y=a?a.map(k):[];r&&P&&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(([D,M])=>{w[D]=x(M,n({},f,{theme:u}))}),P(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 T=y.length-a.length;if(Array.isArray(o)&&T>0){const f=new Array(T).fill("");O=[...o,...f],O.raw=[...o.raw,...f]}const j=R(O,...y);return c.muiName&&(j.muiName=c.muiName),j};return R.withConfig&&(C.withConfig=R.withConfig),C}}export{Z as c,A as s};
