import{e as x}from"./index-NdkWRN8K.js";import{F as C,Y as D,X as O,_ as k}from"./OdysseyThemeProvider-Bh0Bu-2o.js";import{_ as y}from"./inheritsLoose-CJ6Ie9dp.js";import{R as v}from"./index-B5xazMy1.js";import{T as N}from"./TransitionGroupContext-DAL84N7p.js";function P(){const a=C(O);return a[D]||a}const S={disabled:!1};var R=function(u){return u.scrollTop},m="unmounted",p="exited",f="entering",h="entered",T="exiting",l=function(a){y(u,a);function u(i,e){var t;t=a.call(this,i,e)||this;var n=e,r=n&&!n.isMounting?i.enter:i.appear,s;return t.appearStatus=null,i.in?r?(s=p,t.appearStatus=f):s=h:i.unmountOnExit||i.mountOnEnter?s=m:s=p,t.state={status:s},t.nextCallback=null,t}u.getDerivedStateFromProps=function(e,t){var n=e.in;return n&&t.status===m?{status:p}:null};var o=u.prototype;return o.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},o.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==f&&n!==h&&(t=f):(n===f||n===h)&&(t=T)}this.updateStatus(!1,t)},o.componentWillUnmount=function(){this.cancelNextCallback()},o.getTimeouts=function(){var e=this.props.timeout,t,n,r;return t=n=r=e,e!=null&&typeof e!="number"&&(t=e.exit,n=e.enter,r=e.appear!==void 0?e.appear:n),{exit:t,enter:n,appear:r}},o.updateStatus=function(e,t){if(e===void 0&&(e=!1),t!==null)if(this.cancelNextCallback(),t===f){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:v.findDOMNode(this);n&&R(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===p&&this.setState({status:m})},o.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,s=this.props.nodeRef?[r]:[v.findDOMNode(this),r],c=s[0],E=s[1],b=this.getTimeouts(),g=r?b.appear:b.enter;if(!e&&!n||S.disabled){this.safeSetState({status:h},function(){t.props.onEntered(c)});return}this.props.onEnter(c,E),this.safeSetState({status:f},function(){t.props.onEntering(c,E),t.onTransitionEnd(g,function(){t.safeSetState({status:h},function(){t.props.onEntered(c,E)})})})},o.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:v.findDOMNode(this);if(!t||S.disabled){this.safeSetState({status:p},function(){e.props.onExited(r)});return}this.props.onExit(r),this.safeSetState({status:T},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:p},function(){e.props.onExited(r)})})})},o.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},o.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},o.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},o.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:v.findDOMNode(this),r=e==null&&!this.props.addEndListener;if(!n||r){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var s=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],c=s[0],E=s[1];this.props.addEndListener(c,E)}e!=null&&setTimeout(this.nextCallback,e)},o.render=function(){var e=this.state.status;if(e===m)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var r=k(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return x.createElement(N.Provider,{value:null},typeof n=="function"?n(e,r):x.cloneElement(x.Children.only(n),r))},u}(x.Component);l.contextType=N;l.propTypes={};function d(){}l.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:d,onEntering:d,onEntered:d,onExit:d,onExiting:d,onExited:d};l.UNMOUNTED=m;l.EXITED=p;l.ENTERING=f;l.ENTERED=h;l.EXITING=T;const G=a=>a.scrollTop;function X(a,u){var o,i;const{timeout:e,easing:t,style:n={}}=a;return{duration:(o=n.transitionDuration)!=null?o:typeof e=="number"?e:e[u.mode]||0,easing:(i=n.transitionTimingFunction)!=null?i:typeof t=="object"?t[u.mode]:t,delay:n.transitionDelay}}export{l as T,R as f,X as g,G as r,P as u};
