import{cb as h,cc as m,cd as x,U as d,ce as N,cf as A}from"./index-DR3HTfO6.js";function $(r,n){return r.classList?!!n&&r.classList.contains(n):(" "+(r.className.baseVal||r.className)+" ").indexOf(" "+n+" ")!==-1}function _(r,n){r.classList?r.classList.add(n):$(r,n)||(typeof r.className=="string"?r.className=r.className+" "+n:r.setAttribute("class",(r.className&&r.className.baseVal||"")+" "+n))}function C(r,n){return r.replace(new RegExp("(^|\\s)"+n+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function L(r,n){r.classList?r.classList.remove(n):typeof r.className=="string"?r.className=C(r.className,n):r.setAttribute("class",C(r.className&&r.className.baseVal||"",n))}var S=function(n,p){return n&&p&&p.split(" ").forEach(function(s){return _(n,s)})},u=function(n,p){return n&&p&&p.split(" ").forEach(function(s){return L(n,s)})},g=(function(r){h(n,r);function n(){for(var s,i=arguments.length,l=new Array(i),o=0;o<i;o++)l[o]=arguments[o];return s=r.call.apply(r,[this].concat(l))||this,s.appliedClasses={appear:{},enter:{},exit:{}},s.onEnter=function(a,e){var t=s.resolveArguments(a,e),c=t[0],v=t[1];s.removeClasses(c,"exit"),s.addClass(c,v?"appear":"enter","base"),s.props.onEnter&&s.props.onEnter(a,e)},s.onEntering=function(a,e){var t=s.resolveArguments(a,e),c=t[0],v=t[1],f=v?"appear":"enter";s.addClass(c,f,"active"),s.props.onEntering&&s.props.onEntering(a,e)},s.onEntered=function(a,e){var t=s.resolveArguments(a,e),c=t[0],v=t[1],f=v?"appear":"enter";s.removeClasses(c,f),s.addClass(c,f,"done"),s.props.onEntered&&s.props.onEntered(a,e)},s.onExit=function(a){var e=s.resolveArguments(a),t=e[0];s.removeClasses(t,"appear"),s.removeClasses(t,"enter"),s.addClass(t,"exit","base"),s.props.onExit&&s.props.onExit(a)},s.onExiting=function(a){var e=s.resolveArguments(a),t=e[0];s.addClass(t,"exit","active"),s.props.onExiting&&s.props.onExiting(a)},s.onExited=function(a){var e=s.resolveArguments(a),t=e[0];s.removeClasses(t,"exit"),s.addClass(t,"exit","done"),s.props.onExited&&s.props.onExited(a)},s.resolveArguments=function(a,e){return s.props.nodeRef?[s.props.nodeRef.current,a]:[a,e]},s.getClassNames=function(a){var e=s.props.classNames,t=typeof e=="string",c=t&&e?e+"-":"",v=t?""+c+a:e[a],f=t?v+"-active":e[a+"Active"],E=t?v+"-done":e[a+"Done"];return{baseClassName:v,activeClassName:f,doneClassName:E}},s}var p=n.prototype;return p.addClass=function(i,l,o){var a=this.getClassNames(l)[o+"ClassName"],e=this.getClassNames("enter"),t=e.doneClassName;l==="appear"&&o==="done"&&t&&(a+=" "+t),o==="active"&&i&&m(i),a&&(this.appliedClasses[l][o]=a,S(i,a))},p.removeClasses=function(i,l){var o=this.appliedClasses[l],a=o.base,e=o.active,t=o.done;this.appliedClasses[l]={},a&&u(i,a),e&&u(i,e),t&&u(i,t)},p.render=function(){var i=this.props;i.classNames;var l=x(i,["classNames"]);return d.createElement(N,A({},l,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},n})(d.Component);g.defaultProps={classNames:""};g.propTypes={};export{g as C};
