import{bf as I,am as O,bg as W,ao as l,bh as G,bi as q,bj as z,r as E,b0 as H,j as J,bk as K,b2 as $,b1 as A,bl as Q,bm as X,bn as Y,as as Z,a3 as ee,bo as B,al as te,at as oe}from"./index-B1H8BCL7.js";import{u as se}from"./useThemeProps-DL_l3A7P.js";const re=["ownerState"],ne=["variants"],ie=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function ae(e){return Object.keys(e).length===0}function ce(e){return typeof e=="string"&&e.charCodeAt(0)>96}function D(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const le=G(),ue=e=>e&&e.charAt(0).toLowerCase()+e.slice(1);function _({defaultTheme:e,theme:s,themeId:t}){return ae(s)?e:s[t]||s}function pe(e){return e?(s,t)=>t[e]:null}function F(e,s){let{ownerState:t}=s,n=O(s,re);const a=typeof e=="function"?e(l({ownerState:t},n)):e;if(Array.isArray(a))return a.flatMap(i=>F(i,l({ownerState:t},n)));if(a&&typeof a=="object"&&Array.isArray(a.variants)){const{variants:i=[]}=a;let p=O(a,ne);return i.forEach(o=>{let r=!0;typeof o.props=="function"?r=o.props(l({ownerState:t},n,t)):Object.keys(o.props).forEach(f=>{(t==null?void 0:t[f])!==o.props[f]&&n[f]!==o.props[f]&&(r=!1)}),r&&(Array.isArray(p)||(p=[p]),p.push(typeof o.style=="function"?o.style(l({ownerState:t},n,t)):o.style))}),p}return a}function fe(e={}){const{themeId:s,defaultTheme:t=le,rootShouldForwardProp:n=D,slotShouldForwardProp:a=D}=e,i=u=>z(l({},u,{theme:_(l({},u,{defaultTheme:t,themeId:s}))}));return i.__mui_systemSx=!0,(u,p={})=>{I(u,c=>c.filter(m=>!(m!=null&&m.__mui_systemSx)));const{name:o,slot:r,skipVariantsResolver:f,skipSx:S,overridesResolver:y=pe(ue(r))}=p,V=O(p,ie),T=f!==void 0?f:r&&r!=="Root"&&r!=="root"||!1,R=S||!1;let g,v=D;r==="Root"||r==="root"?v=n:r?v=a:ce(u)&&(v=void 0);const x=W(u,l({shouldForwardProp:v,label:g},V)),j=c=>typeof c=="function"&&c.__emotion_real!==c||q(c)?m=>F(c,l({},m,{theme:_({theme:m.theme,defaultTheme:t,themeId:s})})):c,C=(c,...m)=>{let w=j(c);const b=m?m.map(j):[];o&&y&&b.push(h=>{const d=_(l({},h,{defaultTheme:t,themeId:s}));if(!d.components||!d.components[o]||!d.components[o].styleOverrides)return null;const k=d.components[o].styleOverrides,P={};return Object.entries(k).forEach(([L,U])=>{P[L]=F(U,l({},h,{theme:d}))}),y(h,P)}),o&&!T&&b.push(h=>{var d;const k=_(l({},h,{defaultTheme:t,themeId:s})),P=k==null||(d=k.components)==null||(d=d[o])==null?void 0:d.variants;return F({variants:P},l({},h,{theme:k}))}),R||b.push(i);const N=b.length-m.length;if(Array.isArray(c)&&N>0){const h=new Array(N).fill("");w=[...c,...h],w.raw=[...c.raw,...h]}const M=x(w,...b);return u.muiName&&(M.muiName=u.muiName),M};return x.withConfig&&(C.withConfig=x.withConfig),C}}const de=fe(),me=["component","direction","spacing","divider","children","className","useFlexGap"],he=G(),ye=de("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,s)=>s.root});function ve(e){return se({props:e,name:"MuiStack",defaultTheme:he})}function Se(e,s){const t=E.Children.toArray(e).filter(Boolean);return t.reduce((n,a,i)=>(n.push(a),i<t.length-1&&n.push(E.cloneElement(s,{key:`separator-${i}`})),n),[])}const xe=e=>({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],be=({ownerState:e,theme:s})=>{let t=l({display:"flex",flexDirection:"column"},$({theme:s},A({values:e.direction,breakpoints:s.breakpoints.values}),n=>({flexDirection:n})));if(e.spacing){const n=Q(s),a=Object.keys(s.breakpoints.values).reduce((o,r)=>((typeof e.spacing=="object"&&e.spacing[r]!=null||typeof e.direction=="object"&&e.direction[r]!=null)&&(o[r]=!0),o),{}),i=A({values:e.direction,base:a}),u=A({values:e.spacing,base:a});typeof i=="object"&&Object.keys(i).forEach((o,r,f)=>{if(!i[o]){const y=r>0?i[f[r-1]]:"column";i[o]=y}}),t=X(t,$({theme:s},u,(o,r)=>e.useFlexGap?{gap:B(n,o)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${xe(r?i[r]:e.direction)}`]:B(n,o)}}))}return t=Y(s.breakpoints,t),t};function ke(e={}){const{createStyledComponent:s=ye,useThemeProps:t=ve,componentName:n="MuiStack"}=e,a=()=>Z({root:["root"]},o=>ee(n,o),{}),i=s(be);return E.forwardRef(function(o,r){const f=t(o),S=H(f),{component:y="div",direction:V="column",spacing:T=0,divider:R,children:g,className:v,useFlexGap:x=!1}=S,j=O(S,me),C={direction:V,spacing:T,useFlexGap:x},c=a();return J.jsx(i,l({as:y,ownerState:C,ref:r,className:K(c.root,v)},j,{children:R?Se(g,R):g}))})}const je=ke({createStyledComponent:oe("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,s)=>s.root}),useThemeProps:e=>te({props:e,name:"MuiStack"})});export{je as S,de as s};
