this.primereact=this.primereact||{},this.primereact.scrolltop=function(e,t,n,r,o,i){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(t),c=l(i);function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;nthis.props.threshold})}},{key:"bindParentScrollListener",value:function(){var e=this;this.scrollListener=function(){e.checkVisibility(e.helper.parentElement.scrollTop)},this.helper.parentElement.addEventListener("scroll",this.scrollListener)}},{key:"bindDocumentScrollListener",value:function(){var e=this;this.scrollListener=function(){e.checkVisibility(n.DomHandler.getWindowScrollTop())},window.addEventListener("scroll",this.scrollListener)}},{key:"unbindParentScrollListener",value:function(){this.scrollListener&&(this.helper.parentElement.removeEventListener("scroll",this.scrollListener),this.scrollListener=null)}},{key:"unbindDocumentScrollListener",value:function(){this.scrollListener&&(window.removeEventListener("scroll",this.scrollListener),this.scrollListener=null)}},{key:"onEnter",value:function(){n.ZIndexUtils.set("overlay",this.scrollElementRef.current,c.default.autoZIndex,c.default.zIndex.overlay)}},{key:"onEntered",value:function(){this.props.onShow&&this.props.onShow()}},{key:"onExited",value:function(){n.ZIndexUtils.clear(this.scrollElementRef.current),this.props.onHide&&this.props.onHide()}},{key:"componentDidMount",value:function(){"window"===this.props.target?this.bindDocumentScrollListener():"parent"===this.props.target&&this.bindParentScrollListener()}},{key:"componentWillUnmount",value:function(){"window"===this.props.target?this.unbindDocumentScrollListener():"parent"===this.props.target&&this.unbindParentScrollListener(),n.ZIndexUtils.clear(this.scrollElementRef.current)}},{key:"render",value:function(){var e=this,t=n.classNames("p-scrolltop p-link p-component",{"p-scrolltop-sticky":"window"!==this.props.target},this.props.className),i="parent"===this.props.target;return s.default.createElement(s.default.Fragment,null,s.default.createElement(r.CSSTransition,{nodeRef:this.scrollElementRef,classNames:"p-scrolltop",in:this.state.visible,timeout:{enter:150,exit:150},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntered:this.onEntered,onExited:this.onExited},s.default.createElement("button",{ref:this.scrollElementRef,type:"button",className:t,style:this.props.style,onClick:this.onClick},n.IconUtils.getJSXIcon(this.props.icon,{className:"p-scrolltop-icon"},{props:this.props}),s.default.createElement(o.Ripple,null))),i&&s.default.createElement("span",{ref:function(t){return e.helper=t},className:"p-scrolltop-helper"}))}}])&&a(l.prototype,f),d&&a(l,d),Object.defineProperty(l,"prototype",{writable:!1}),E}(t.Component);return w={target:"window",threshold:400,icon:"pi pi-chevron-up",behavior:"smooth",className:null,style:null,transitionOptions:null,onShow:null,onHide:null},(E="defaultProps")in(v=k)?Object.defineProperty(v,E,{value:w,enumerable:!0,configurable:!0,writable:!0}):v[E]=w,e.ScrollTop=k,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.utils,primereact.csstransition,primereact.ripple,primereact.api);