import e from"../../../../@babel/runtime/helpers/esm/extends.js";import t from"../../../../@babel/runtime/helpers/esm/objectWithoutProperties.js";import o from"react";import r from"../../../../prop-types/index.js";import s from"../../../../hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js";import n from"../../../utils/esm/getDisplayName.js";import i from"../makeStyles/makeStyles.js";import m from"../../../utils/esm/chainPropTypes.js";import p from"../useTheme/useTheme.js";import a from"../getThemeProps/getThemeProps.js";export default function(c){var f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(l){var u=f.defaultTheme,h=f.withTheme,d=void 0!==h&&h,v=f.name,y=t(f,["defaultTheme","withTheme","name"]);if("production"!==process.env.NODE_ENV&&void 0===l)throw new Error(["You are calling withStyles(styles)(Component) with an undefined component.","You may have forgotten to import it."].join("\n"));var N=v;if("production"!==process.env.NODE_ENV&&!v){var j=n(l);void 0!==j&&(N=j)}var E=i(c,e({defaultTheme:u,Component:l,name:v||l.displayName,classNamePrefix:N},y)),T=o.forwardRef((function(r,s){r.classes;var n,i=r.innerRef,m=t(r,["classes","innerRef"]),c=E(e({},l.defaultProps,r)),f=m;return("string"==typeof v||d)&&(n=p()||u,v&&(f=a({theme:n,name:v,props:m})),d&&!f.theme&&(f.theme=n)),o.createElement(l,e({ref:i||s,classes:c},f))}));return"production"!==process.env.NODE_ENV&&(T.propTypes={classes:r.object,innerRef:m(r.oneOfType([r.func,r.object]),(function(e){return e.innerRef,null}))}),"production"!==process.env.NODE_ENV&&(T.displayName="WithStyles(".concat(n(l),")")),s(T,l),"production"!==process.env.NODE_ENV&&(T.Naked=l,T.options=f,T.useStyles=E),T}}
//# sourceMappingURL=withStyles.js.map
