import e from"../../../../@babel/runtime/helpers/esm/extends.js";import o from"../../../../@babel/runtime/helpers/esm/objectWithoutProperties.js";import t from"react";import r from"../../../../clsx/dist/clsx.m.js";import n from"../../../../prop-types/index.js";import s from"../../../../hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js";import i from"../../../utils/esm/getDisplayName.js";import p from"../makeStyles/makeStyles.js";import c from"../../../utils/esm/chainPropTypes.js";function a(e,o){var t={};return Object.keys(e).forEach((function(r){-1===o.indexOf(r)&&(t[r]=e[r])})),t}function m(m){return function(l){var f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=f.name,d=o(f,["name"]);if("production"!==process.env.NODE_ENV&&void 0===m)throw new Error(["You are calling styled(Component)(style) with an undefined component.","You may have forgotten to import it."].join("\n"));var y=u;if("production"!==process.env.NODE_ENV&&!u){var N=i(m);void 0!==N&&(y=N)}var h,v="function"==typeof l?function(o){return{root:function(t){return l(e({theme:o},t))}}}:{root:l},E=p(v,e({Component:m,name:u||m.displayName,classNamePrefix:y},d)),j={};l.filterProps&&(h=l.filterProps,delete l.filterProps),l.propTypes&&(j=l.propTypes,delete l.propTypes);var b=t.forwardRef((function(n,s){var i=n.children,p=n.className,c=n.clone,l=n.component,f=o(n,["children","className","clone","component"]),u=E(n),d=r(u.root,p),y=f;if(h&&(y=a(y,h)),c)return t.cloneElement(i,e({className:r(i.props.className,d)},y));if("function"==typeof i)return i(e({className:d},y));var N=l||m;return t.createElement(N,e({ref:s,className:d},y),i)}));return"production"!==process.env.NODE_ENV&&(b.propTypes=e({children:n.oneOfType([n.node,n.func]),className:n.string,clone:c(n.bool,(function(e){return e.clone&&e.component?new Error("You can not use the clone and component prop at the same time."):null})),component:n.elementType},j)),"production"!==process.env.NODE_ENV&&(b.displayName="Styled(".concat(y,")")),s(b,m),b}}export default m;
//# sourceMappingURL=styled.js.map
