import{useMemo as r,useRef as t}from"react";import o from"../../node_modules/react-fast-compare/index.js";import{useChakra as e}from"./hooks.js";import{runIfFn as i}from"../../../utils/dist/esm/function.js";import n from"../../../../lodash.mergewith/index.js";import{memoizedGet as l,filterUndefined as s,omit as u}from"../../../utils/dist/esm/object.js";function a(a,m,f){var d,c;void 0===m&&(m={}),void 0===f&&(f={});var{styleConfig:v}=m,p=function(r,t){if(null==r)return{};var o,e,i={},n=Object.keys(r);for(e=0;e<n.length;e++)o=n[e],t.indexOf(o)>=0||(i[o]=r[o]);return i}(m,["styleConfig"]),{theme:h,colorMode:j}=e(),M=l(h,"components."+a),g=v||M,x=n({theme:h,colorMode:j},null!=(d=null==g?void 0:g.defaultProps)?d:{},s(u(p,["children"]))),y=t({});return r((()=>{if(g){var r,t,e,l,s,u,a=i(null!=(r=g.baseStyle)?r:{},x),m=i(null!=(t=null==(e=g.variants)?void 0:e[x.variant])?t:{},x),d=i(null!=(l=null==(s=g.sizes)?void 0:s[x.size])?l:{},x),c=n({},a,d,m);null!=(u=f)&&u.isMultiPart&&g.parts&&g.parts.forEach((r=>{var t;c[r]=null!=(t=c[r])?t:{}})),o(y.current,c)||(y.current=c)}return y.current}),[g,x,null==(c=f)?void 0:c.isMultiPart])}function m(r,t){return a(r,t,{isMultiPart:!0})}export{m as useMultiStyleConfig,a as useStyleConfig};
//# sourceMappingURL=use-style-config.js.map
