import{cJ as I,cK as F,cL as W,cI as n,cM as J,cN as K,cO as $}from"./index-0698dbe6.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 Q=J(),U=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=Q,rootShouldForwardProp:d=A,slotShouldForwardProp:l=A}=e,h=c=>K(n({},c,{theme:_(n({},c,{defaultTheme:t,themeId:s}))}));return h.__mui_systemSx=!0,(c,m={})=>{I(c,o=>o.filter(a=>!(a!=null&&a.__mui_systemSx)));const{name:r,slot:i,skipVariantsResolver:p,skipSx:b,overridesResolver:k=X(U(i))}=m,N=F(m,B),V=p!==void 0?p:i&&i!=="Root"&&i!=="root"||!1,E=b||!1;let L,v=A;i==="Root"||i==="root"?v=d:i?v=l:H(c)&&(v=void 0);const O=W(c,n({shouldForwardProp:v,label:L},N)),C=o=>typeof o=="function"&&o.__emotion_real!==o||$(o)?a=>x(o,n({},a,{theme:_({theme:a.theme,defaultTheme:t,themeId:s})})):o,P=(o,...a)=>{let R=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(([M,D])=>{w[M]=x(D,n({},f,{theme:u}))}),k(f,w)}),r&&!V&&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}))}),E||y.push(h);const j=y.length-a.length;if(Array.isArray(o)&&j>0){const f=new Array(j).fill("");R=[...o,...f],R.raw=[...o.raw,...f]}const T=O(R,...y);return c.muiName&&(T.muiName=c.muiName),T};return O.withConfig&&(P.withConfig=O.withConfig),P}}export{Z as c,A as s};
