(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[459],{68248:function(e,t,n){"use strict";n.d(t,{k:function(){return p}});var r=n(2784),o=n(77767),i=n(82740),a=n(51679);const s=({variant:e="default"})=>({default:i.css` background-color: var(--color-neutral-80); color: var(--color-neutral-130); svg { color: var(--color-neutral-120); } `,error:i.css` background-color: var(--color-feedback-error-80); color: var(--color-feedback-error-110); span { color: var(--color-feedback-error-110); } svg { color: var(--color-feedback-error-100); } `,success:i.css` background-color: var(--color-feedback-success-80); color: var(--color-feedback-success-110); span { color: var(--color-feedback-success-110); } svg { color: var(--color-feedback-success-100); } `,warning:i.css` background-color: var(--color-feedback-attention-80); color: var(--color-feedback-attention-110); span { color: var(--color-feedback-attention-110); } svg { color: var(--color-feedback-attention-100); } `,information:i.css` background-color: var(--color-feedback-info-80); color: var(--color-feedback-info-110); span { color: var(--color-feedback-info-110); } svg { color: var(--color-feedback-info-100); } `}[e]),c=i.default.span` width: 24px; height: 24px; `,u=i.default.section` display: flex; flex-direction: column; margin-left: var(--spacing-2); `,l=i.default.div` display: inline; font-size: var(--font-size-xxs); font-weight: var(--font-weight-regular); a { font-size: var(--font-size-xxs); font-weight: var(--font-weight-semibold); text-decoration: underline; } @media screen and (min-width: 840px) { font-size: var(--font-size-xs); a { font-size: var(--font-size-xs); } } `,f=((0,i.default)(a.r)` color: var(--color-feedback-error-110); &:hover { color: var(--color-feedback-error-130); } `,(0,i.default)(a.r)` color: var(--color-feedback-success-110); &:hover { color: var(--color-feedback-success-130); } `,(0,i.default)(a.r)` color: var(--color-feedback-attention-110); &:hover { color: var(--color-feedback-attention-130); } `,(0,i.default)(a.r)` color: var(--color-feedback-info-110); &:hover { color: var(--color-feedback-info-130); } `,i.default.span` font-weight: var(--font-weight-semibold); font-size: var(--font-size-xxs); word-break: break-word; line-height: 24px; display: flex; align-items: center; ${s} @media screen and (min-width: 840px) { font-size: var(--font-size-xs); } `),d=i.default.div` border-radius: var(--border-radius-sm); padding: var(--spacing-2); font-family: var(--font-family); display: flex; ${s} `,h=({variant:e})=>{const t={default:o.Info,error:o.XCircle,success:o.Check,warning:o.AlertTriangle,information:o.Info}[e];return r.createElement(t,null)},p=(0,r.forwardRef)((({variant:e="default",role:t,icon:n,title:o,children:i},a)=>r.createElement(d,{"data-ds-componet":"DS-Alertbox",ref:a,className:e,variant:e,role:t||"error"!==e?t||"status":"alert",title:o},r.createElement(c,{"aria-hidden":"true"},n||r.createElement(h,{variant:e})),r.createElement(u,null,r.createElement(f,{variant:e,title:o},o),r.createElement(l,null,i)))));p.displayName="Alertbox"},85978:function(e,t,n){var r;!function(){"use strict";var o=!("undefined"===typeof window||!window.document||!window.document.createElement),i={canUseDOM:o,canUseWorkers:"undefined"!==typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen};void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r)}()},46847:function(e,t,n){"use strict";function r(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!==e&&void 0!==e&&this.setState(e)}function o(e){this.setState(function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!==n&&void 0!==n?n:null}.bind(this))}function i(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function a(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if("function"!==typeof e.getDerivedStateFromProps&&"function"!==typeof t.getSnapshotBeforeUpdate)return e;var n=null,a=null,s=null;if("function"===typeof t.componentWillMount?n="componentWillMount":"function"===typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"===typeof t.componentWillReceiveProps?a="componentWillReceiveProps":"function"===typeof t.UNSAFE_componentWillReceiveProps&&(a="UNSAFE_componentWillReceiveProps"),"function"===typeof t.componentWillUpdate?s="componentWillUpdate":"function"===typeof t.UNSAFE_componentWillUpdate&&(s="UNSAFE_componentWillUpdate"),null!==n||null!==a||null!==s){var c=e.displayName||e.name,u="function"===typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+c+" uses "+u+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==a?"\n "+a:"")+(null!==s?"\n "+s:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"===typeof e.getDerivedStateFromProps&&(t.componentWillMount=r,t.componentWillReceiveProps=o),"function"===typeof t.getSnapshotBeforeUpdate){if("function"!==typeof t.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=i;var l=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;l.call(this,e,t,r)}}return e}n.r(t),n.d(t,{polyfill:function(){return a}}),r.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0,i.__suppressDeprecationWarning=!0},42901:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bodyOpenClassName=t.portalClassName=void 0;var r=Object.assign||function(e){for(var t=1;t0&&0===(g-=1)&&l.show(t),n.props.shouldFocusAfterRender&&(n.props.shouldReturnFocusAfterClose?(c.returnFocus(n.props.preventScroll),c.teardownScopedFocus()):c.popWithoutFocus()),n.props.onAfterClose&&n.props.onAfterClose(),p.default.deregister(n)},n.open=function(){n.beforeOpen(),n.state.afterOpen&&n.state.beforeClose?(clearTimeout(n.closeTimer),n.setState({beforeClose:!1})):(n.props.shouldFocusAfterRender&&(c.setupScopedFocus(n.node),c.markForFocusLater()),n.setState({isOpen:!0},(function(){n.openAnimationFrame=requestAnimationFrame((function(){n.setState({afterOpen:!0}),n.props.isOpen&&n.props.onAfterOpen&&n.props.onAfterOpen({overlayEl:n.overlay,contentEl:n.content})}))})))},n.close=function(){n.props.closeTimeoutMS>0?n.closeWithTimeout():n.closeWithoutTimeout()},n.focusContent=function(){return n.content&&!n.contentHasFocus()&&n.content.focus({preventScroll:!0})},n.closeWithTimeout=function(){var e=Date.now()+n.props.closeTimeoutMS;n.setState({beforeClose:!0,closesAt:e},(function(){n.closeTimer=setTimeout(n.closeWithoutTimeout,n.state.closesAt-Date.now())}))},n.closeWithoutTimeout=function(){n.setState({beforeClose:!1,isOpen:!1,afterOpen:!1,closesAt:null},n.afterClose)},n.handleKeyDown=function(e){9===e.keyCode&&(0,u.default)(n.content,e),n.props.shouldCloseOnEsc&&27===e.keyCode&&(e.stopPropagation(),n.requestClose(e))},n.handleOverlayOnClick=function(e){null===n.shouldClose&&(n.shouldClose=!0),n.shouldClose&&n.props.shouldCloseOnOverlayClick&&(n.ownerHandlesClose()?n.requestClose(e):n.focusContent()),n.shouldClose=null},n.handleContentOnMouseUp=function(){n.shouldClose=!1},n.handleOverlayOnMouseDown=function(e){n.props.shouldCloseOnOverlayClick||e.target!=n.overlay||e.preventDefault()},n.handleContentOnClick=function(){n.shouldClose=!1},n.handleContentOnMouseDown=function(){n.shouldClose=!1},n.requestClose=function(e){return n.ownerHandlesClose()&&n.props.onRequestClose(e)},n.ownerHandlesClose=function(){return n.props.onRequestClose},n.shouldBeClosed=function(){return!n.state.isOpen&&!n.state.beforeClose},n.contentHasFocus=function(){return document.activeElement===n.content||n.content.contains(document.activeElement)},n.buildClassName=function(e,t){var r="object"===("undefined"===typeof t?"undefined":o(t))?t:{base:m[e],afterOpen:m[e]+"--after-open",beforeClose:m[e]+"--before-close"},i=r.base;return n.state.afterOpen&&(i=i+" "+r.afterOpen),n.state.beforeClose&&(i=i+" "+r.beforeClose),"string"===typeof t&&t?i+" "+t:i},n.attributesFromObject=function(e,t){return Object.keys(t).reduce((function(n,r){return n[e+"-"+r]=t[r],n}),{})},n.state={afterOpen:!1,beforeClose:!1},n.shouldClose=null,n.moveFromContentToOverlay=null,n}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){this.props.isOpen&&this.open()}},{key:"componentDidUpdate",value:function(e,t){this.props.isOpen&&!e.isOpen?this.open():!this.props.isOpen&&e.isOpen&&this.close(),this.props.shouldFocusAfterRender&&this.state.isOpen&&!t.isOpen&&this.focusContent()}},{key:"componentWillUnmount",value:function(){this.state.isOpen&&this.afterClose(),clearTimeout(this.closeTimer),cancelAnimationFrame(this.openAnimationFrame)}},{key:"beforeOpen",value:function(){var e=this.props,t=e.appElement,n=e.ariaHideApp,r=e.htmlOpenClassName,o=e.bodyOpenClassName;o&&f.add(document.body,o),r&&f.add(document.getElementsByTagName("html")[0],r),n&&(g+=1,l.hide(t)),p.default.register(this)}},{key:"render",value:function(){var e=this.props,t=e.id,n=e.className,o=e.overlayClassName,i=e.defaultStyles,a=e.children,s=n?{}:i.content,c=o?{}:i.overlay;if(this.shouldBeClosed())return null;var u={ref:this.setOverlayRef,className:this.buildClassName("overlay",o),style:r({},c,this.props.style.overlay),onClick:this.handleOverlayOnClick,onMouseDown:this.handleOverlayOnMouseDown},l=r({id:t,ref:this.setContentRef,style:r({},s,this.props.style.content),className:this.buildClassName("content",n),tabIndex:"-1",onKeyDown:this.handleKeyDown,onMouseDown:this.handleContentOnMouseDown,onMouseUp:this.handleContentOnMouseUp,onClick:this.handleContentOnClick,role:this.props.role,"aria-label":this.props.contentLabel},this.attributesFromObject("aria",r({modal:!0},this.props.aria)),this.attributesFromObject("data",this.props.data||{}),{"data-testid":this.props.testId}),f=this.props.contentElement(l,a);return this.props.overlayElement(u,f)}}]),t}(a.Component);b.defaultProps={style:{overlay:{},content:{}},defaultStyles:{}},b.propTypes={isOpen:s.default.bool.isRequired,defaultStyles:s.default.shape({content:s.default.object,overlay:s.default.object}),style:s.default.shape({content:s.default.object,overlay:s.default.object}),className:s.default.oneOfType([s.default.string,s.default.object]),overlayClassName:s.default.oneOfType([s.default.string,s.default.object]),bodyOpenClassName:s.default.string,htmlOpenClassName:s.default.string,ariaHideApp:s.default.bool,appElement:s.default.oneOfType([s.default.instanceOf(h.default),s.default.instanceOf(d.SafeHTMLCollection),s.default.instanceOf(d.SafeNodeList),s.default.arrayOf(s.default.instanceOf(h.default))]),onAfterOpen:s.default.func,onAfterClose:s.default.func,onRequestClose:s.default.func,closeTimeoutMS:s.default.number,shouldFocusAfterRender:s.default.bool,shouldCloseOnOverlayClick:s.default.bool,shouldReturnFocusAfterClose:s.default.bool,preventScroll:s.default.bool,role:s.default.string,contentLabel:s.default.string,aria:s.default.object,data:s.default.object,children:s.default.node,shouldCloseOnEsc:s.default.bool,overlayRef:s.default.func,contentRef:s.default.func,id:s.default.string,overlayElement:s.default.func,contentElement:s.default.func,testId:s.default.string},t.default=b,e.exports=t.default},66941:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){s&&(s.removeAttribute?s.removeAttribute("aria-hidden"):null!=s.length?s.forEach((function(e){return e.removeAttribute("aria-hidden")})):document.querySelectorAll(s).forEach((function(e){return e.removeAttribute("aria-hidden")})));s=null},t.log=function(){0},t.assertNodeList=c,t.setElement=function(e){var t=e;if("string"===typeof t&&a.canUseDOM){var n=document.querySelectorAll(t);c(n,t),t=n}return s=t||s},t.validateElement=u,t.hide=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=u(e)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.setAttribute("aria-hidden","true")}}catch(a){n=!0,r=a}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}},t.show=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=u(e)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.removeAttribute("aria-hidden")}}catch(a){n=!0,r=a}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}},t.documentNotReadyOrSSRTesting=function(){s=null};var r,o=n(45982),i=(r=o)&&r.__esModule?r:{default:r},a=n(6259);var s=null;function c(e,t){if(!e||!e.length)throw new Error("react-modal: No elements were found for selector "+t+".")}function u(e){var t=e||s;return t?Array.isArray(t)||t instanceof HTMLCollection||t instanceof NodeList?t:[t]:((0,i.default)(!1,["react-modal: App element is not defined.","Please use `Modal.setAppElement(el)` or set `appElement={el}`.","This is needed so screen readers don't see main content","when modal is opened. It is not recommended, but you can opt-out","by setting `ariaHideApp={false}`."].join(" ")),[])}},26736:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){for(var e=[a,s],t=0;t0?(document.body.firstChild!==a&&document.body.insertBefore(a,document.body.firstChild),document.body.lastChild!==s&&document.body.appendChild(s)):(a.parentElement&&a.parentElement.removeChild(a),s.parentElement&&s.parentElement.removeChild(s))}))},95853:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){var e=document.getElementsByTagName("html")[0];for(var t in n)o(e,n[t]);var i=document.body;for(var a in r)o(i,r[a]);n={},r={}},t.log=function(){0};var n={},r={};function o(e,t){e.classList.remove(t)}t.add=function(e,t){return o=e.classList,i="html"==e.nodeName.toLowerCase()?n:r,void t.split(" ").forEach((function(e){!function(e,t){e[t]||(e[t]=0),e[t]+=1}(i,e),o.add(e)}));var o,i},t.remove=function(e,t){return o=e.classList,i="html"==e.nodeName.toLowerCase()?n:r,void t.split(" ").forEach((function(e){!function(e,t){e[t]&&(e[t]-=1)}(i,e),0===i[e]&&o.remove(e)}));var o,i}},77194:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){a=[]},t.log=function(){0},t.handleBlur=u,t.handleFocus=l,t.markForFocusLater=function(){a.push(document.activeElement)},t.returnFocus=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=null;try{return void(0!==a.length&&(t=a.pop()).focus({preventScroll:e}))}catch(n){console.warn(["You tried to return focus to",t,"but it is not in the DOM anymore"].join(" "))}},t.popWithoutFocus=function(){a.length>0&&a.pop()},t.setupScopedFocus=function(e){s=e,window.addEventListener?(window.addEventListener("blur",u,!1),document.addEventListener("focus",l,!0)):(window.attachEvent("onBlur",u),document.attachEvent("onFocus",l))},t.teardownScopedFocus=function(){s=null,window.addEventListener?(window.removeEventListener("blur",u),document.removeEventListener("focus",l)):(window.detachEvent("onBlur",u),document.detachEvent("onFocus",l))};var r,o=n(93970),i=(r=o)&&r.__esModule?r:{default:r};var a=[],s=null,c=!1;function u(){c=!0}function l(){if(c){if(c=!1,!s)return;setTimeout((function(){s.contains(document.activeElement)||((0,i.default)(s)[0]||s).focus()}),0)}}},66638:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.log=function(){console.log("portalOpenInstances ----------"),console.log(r.openInstances.length),r.openInstances.forEach((function(e){return console.log(e)})),console.log("end portalOpenInstances ----------")},t.resetState=function(){r=new n};var n=function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.register=function(e){-1===t.openInstances.indexOf(e)&&(t.openInstances.push(e),t.emit("register"))},this.deregister=function(e){var n=t.openInstances.indexOf(e);-1!==n&&(t.openInstances.splice(n,1),t.emit("deregister"))},this.subscribe=function(e){t.subscribers.push(e)},this.emit=function(e){t.subscribers.forEach((function(n){return n(e,t.openInstances.slice())}))},this.openInstances=[],this.subscribers=[]},r=new n;t.default=r},6259:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canUseDOM=t.SafeNodeList=t.SafeHTMLCollection=void 0;var r,o=n(85978);var i=((r=o)&&r.__esModule?r:{default:r}).default,a=i.canUseDOM?window.HTMLElement:{};t.SafeHTMLCollection=i.canUseDOM?window.HTMLCollection:{},t.SafeNodeList=i.canUseDOM?window.NodeList:{},t.canUseDOM=i.canUseDOM;t.default=a},90026:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=(0,i.default)(e);if(!n.length)return void t.preventDefault();var r=void 0,o=t.shiftKey,s=n[0],c=n[n.length-1],u=a();if(e===u){if(!o)return;r=c}c!==u||o||(r=s);s===u&&o&&(r=c);if(r)return t.preventDefault(),void r.focus();var l=/(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent);if(null==l||"Chrome"==l[1]||null!=/\biPod\b|\biPad\b/g.exec(navigator.userAgent))return;var f=n.indexOf(u);f>-1&&(f+=o?-1:1);if("undefined"===typeof(r=n[f]))return t.preventDefault(),void(r=o?c:s).focus();t.preventDefault(),r.focus()};var r,o=n(93970),i=(r=o)&&r.__esModule?r:{default:r};function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;return e.activeElement.shadowRoot?a(e.activeElement.shadowRoot):e.activeElement}e.exports=t.default},93970:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){return[].slice.call(t.querySelectorAll("*"),0).reduce((function(t,n){return t.concat(n.shadowRoot?e(n.shadowRoot):[n])}),[]).filter(i)};var n=/input|select|textarea|button|object/;function r(e){var t=e.offsetWidth<=0&&e.offsetHeight<=0;if(t&&!e.innerHTML)return!0;try{var n=window.getComputedStyle(e);return t?"visible"!==n.getPropertyValue("overflow")||e.scrollWidth<=0&&e.scrollHeight<=0:"none"==n.getPropertyValue("display")}catch(r){return console.warn("Failed to inspect element style"),!1}}function o(e,t){var o=e.nodeName.toLowerCase();return(n.test(o)&&!e.disabled||"a"===o&&e.href||t)&&function(e){for(var t=e,n=e.getRootNode&&e.getRootNode();t&&t!==document.body;){if(n&&t===n&&(t=n.host.parentNode),r(t))return!1;t=t.parentNode}return!0}(e)}function i(e){var t=e.getAttribute("tabindex");null===t&&(t=void 0);var n=isNaN(t);return(n||t>=0)&&o(e,!n)}e.exports=t.default},37149:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(42901),i=(r=o)&&r.__esModule?r:{default:r};t.default=i.default,e.exports=t.default},68114:function(e,t,n){"use strict";n.r(t),n.d(t,{BottomSheet:function(){return Pi}});var r=n(2784),o=n(45982),i=n.n(o),a=s()?r.useLayoutEffect:r.useEffect;i(),"undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math&&self;function s(){return!("undefined"===typeof window||!window.document||!window.document.createElement)}var c=n(28316);var u=function(e){var t=e.children,n=e.type,o=void 0===n?"reach-portal":n,i=(0,r.useRef)(null),s=(0,r.useRef)(null),u=function(){var e=(0,r.useState)(Object.create(null))[1];return(0,r.useCallback)((function(){e(Object.create(null))}),[])}();return a((function(){if(i.current){var e=i.current.ownerDocument;return s.current=null==e?void 0:e.createElement(o),e.body.appendChild(s.current),u(),function(){s.current&&s.current.ownerDocument&&s.current.ownerDocument.body.removeChild(s.current)}}}),[o,u]),s.current?(0,c.createPortal)(t,s.current):(0,r.createElement)("span",{ref:i})},l=function(){return(l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(we){o={error:we}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function p(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o0;){var t=i.shift();r=e.transition(r,t,c),o.forEach((function(e){return e.next(r)}))}a=!1}}()},getSnapshot:function(){return r},subscribe:function(e,t,n){var i=X(e,t,n);return o.add(i),i.next(r),{unsubscribe:function(){o.delete(i)}}}},l(l({subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},B),n)),c={parent:t.parent,self:s,id:t.id||"anonymous",observers:o};return r=e.start?e.start(c):r,s}var Qe,et={sync:!1,autoForward:!1};!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(Qe||(Qe={}));var tt,nt=function(){function e(t,n){var r=this;void 0===n&&(n=e.defaultOptions),this.machine=t,this.scheduler=new qe,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=Qe.NotStarted,this.children=new Map,this.forwardTo=new Set,this.init=this.start,this.send=function(e,t){if(F(e))return r.batch(e),r.state;var n=G(U(e,t));if(r.status===Qe.Stopped)return r.state;if(r.status!==Qe.Running&&!r.options.deferEvents)throw new Error('Event "'.concat(n.name,'" was sent to uninitialized service "').concat(r.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\nEvent: ').concat(JSON.stringify(n.data)));return r.scheduler.schedule((function(){r.forward(n);var e=r.nextState(n);r.update(e,n)})),r._state},this.sendTo=function(e,t){var n,o=r.parent&&(t===Y.Parent||r.parent.id===t),i=o?r.parent:z(t)?r.children.get(t)||$e(t):(n=t)&&"function"===typeof n.send?t:void 0;if(i)"machine"in i?i.send(l(l({},e),{name:e.name===we?"".concat(je(r.id)):e.name,origin:r.sessionId})):i.send(e.data);else if(!o)throw new Error("Unable to send event to child '".concat(t,"' from service '").concat(r.id,"'."))};var o=l(l({},e.defaultOptions),n),i=o.clock,a=o.logger,s=o.parent,c=o.id,u=void 0!==c?c:t.id;this.id=u,this.logger=a,this.clock=i,this.parent=s,this.options=o,this.scheduler=new qe({deferEvents:this.options.deferEvents}),this.sessionId=We()}return Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this;return this._initialState?this._initialState:ze(this,(function(){return e._initialState=e.machine.initialState,e._initialState}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),e.prototype.execute=function(e,t){var n,r;try{for(var o=d(e.actions),i=o.next();!i.done;i=o.next()){var a=i.value;this.exec(a,e,t)}}catch(s){n={error:s}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},e.prototype.update=function(e,t){var n,r,o,i,a,s,c,u,l=this;if(e._sessionid=this.sessionId,this._state=e,this.options.execute&&this.execute(this.state),this.children.forEach((function(e){l.state.children[e.id]=e})),this.devTools&&this.devTools.send(t.data,e),e.event)try{for(var f=d(this.eventListeners),h=f.next();!h.done;h=f.next()){(0,h.value)(e.event)}}catch(x){n={error:x}}finally{try{h&&!h.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}try{for(var p=d(this.listeners),v=p.next();!v.done;v=p.next()){(0,v.value)(e,e.event)}}catch(O){o={error:O}}finally{try{v&&!v.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}try{for(var y=d(this.contextListeners),m=y.next();!m.done;m=y.next()){(0,m.value)(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(C){a={error:C}}finally{try{m&&!m.done&&(s=y.return)&&s.call(y)}finally{if(a)throw a.error}}var g=se(e.configuration||[],this.machine);if(this.state.configuration&&g){var b=e.configuration.find((function(e){return"final"===e.type&&e.parent===l.machine})),w=b&&b.doneData?N(b.doneData,e.context,t):void 0;try{for(var S=d(this.doneListeners),E=S.next();!E.done;E=S.next()){(0,E.value)(Ae(this.id,w))}}catch(k){c={error:k}}finally{try{E&&!E.done&&(u=S.return)&&u.call(S)}finally{if(c)throw c.error}}this.stop()}},e.prototype.onTransition=function(e){return this.listeners.add(e),this.status===Qe.Running&&e(this.state,this.state.event),this},e.prototype.subscribe=function(e,t,n){var r,o=this;if(!e)return{unsubscribe:function(){}};var i=n;return"function"===typeof e?r=e:(r=e.next.bind(e),i=e.complete.bind(e)),this.listeners.add(r),this.status===Qe.Running&&r(this.state),i&&this.onDone(i),{unsubscribe:function(){r&&o.listeners.delete(r),i&&o.doneListeners.delete(i)}}},e.prototype.onEvent=function(e){return this.eventListeners.add(e),this},e.prototype.onSend=function(e){return this.sendListeners.add(e),this},e.prototype.onChange=function(e){return this.contextListeners.add(e),this},e.prototype.onStop=function(e){return this.stopListeners.add(e),this},e.prototype.onDone=function(e){return this.doneListeners.add(e),this},e.prototype.off=function(e){return this.listeners.delete(e),this.eventListeners.delete(e),this.sendListeners.delete(e),this.stopListeners.delete(e),this.doneListeners.delete(e),this.contextListeners.delete(e),this},e.prototype.start=function(e){var t=this;if(this.status===Qe.Running)return this;Ke(this.sessionId,this),this.initialized=!0,this.status=Qe.Running;var n=void 0===e?this.initialState:ze(this,(function(){return!z(n=e)&&"value"in n&&"history"in n?t.machine.resolveState(e):t.machine.resolveState(Le.from(e,t.machine.context));var n}));return this.options.devTools&&this.attachDev(),this.scheduler.initialize((function(){t.update(n,Oe)})),this},e.prototype.stop=function(){var e,t,n,r,o,i,a,s,c,u,l=this;try{for(var f=d(this.listeners),v=f.next();!v.done;v=f.next()){var y=v.value;this.listeners.delete(y)}}catch(_){e={error:_}}finally{try{v&&!v.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}try{for(var m=d(this.stopListeners),b=m.next();!b.done;b=m.next()){(y=b.value)(),this.stopListeners.delete(y)}}catch(P){n={error:P}}finally{try{b&&!b.done&&(r=m.return)&&r.call(m)}finally{if(n)throw n.error}}try{for(var w=d(this.contextListeners),S=w.next();!S.done;S=w.next()){y=S.value;this.contextListeners.delete(y)}}catch(T){o={error:T}}finally{try{S&&!S.done&&(i=w.return)&&i.call(w)}finally{if(o)throw o.error}}try{for(var E=d(this.doneListeners),x=E.next();!x.done;x=E.next()){y=x.value;this.doneListeners.delete(y)}}catch(R){a={error:R}}finally{try{x&&!x.done&&(s=E.return)&&s.call(E)}finally{if(a)throw a.error}}if(!this.initialized)return this;p([],h(this.state.configuration),!1).sort((function(e,t){return t.order-e.order})).forEach((function(e){var t,n;try{for(var r=d(e.definition.exit),o=r.next();!o.done;o=r.next()){var i=o.value;l.exec(i,l.state)}}catch(a){t={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}})),this.children.forEach((function(e){I(e.stop)&&e.stop()}));try{for(var O=d(g(this.delayedEventsMap)),C=O.next();!C.done;C=O.next()){var k=C.value;this.clock.clearTimeout(this.delayedEventsMap[k])}}catch(N){c={error:N}}finally{try{C&&!C.done&&(u=O.return)&&u.call(O)}finally{if(c)throw c.error}}return this.scheduler.clear(),this.initialized=!1,this.status=Qe.Stopped,Xe(this.sessionId),this},e.prototype.batch=function(e){var t=this;if(this.status===Qe.NotStarted&&this.options.deferEvents)0;else if(this.status!==Qe.Running)throw new Error("".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'));this.scheduler.schedule((function(){var n,r,o=t.state,i=!1,a=[],s=function(e){var n=G(e);t.forward(n),o=ze(t,(function(){return t.machine.transition(o,n)})),a.push.apply(a,p([],h(o.actions.map((function(e){return function(e,t){var n=e.exec;return l(l({},e),{exec:void 0!==n?function(){return n(t.context,t.event,{action:e,state:t,_event:t._event})}:void 0})}(e,o)}))),!1)),i=i||!!o.changed};try{for(var c=d(e),u=c.next();!u.done;u=c.next()){s(u.value)}}catch(f){n={error:f}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}o.changed=i,o.actions=a,t.update(o,G(e[e.length-1]))}))},e.prototype.sender=function(e){return this.send.bind(this,e)},e.prototype.nextState=function(e){var t=this,n=G(e);if(0===n.name.indexOf(be)&&!this.state.nextEvents.some((function(e){return 0===e.indexOf(be)})))throw n.data.data;return ze(this,(function(){return t.machine.transition(t.state,n)}))},e.prototype.forward=function(e){var t,n;try{for(var r=d(this.forwardTo),o=r.next();!o.done;o=r.next()){var i=o.value,a=this.children.get(i);if(!a)throw new Error("Unable to forward event '".concat(e,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(i,"'."));a.send(e)}}catch(s){t={error:s}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.defer=function(e){var t=this;this.delayedEventsMap[e.id]=this.clock.setTimeout((function(){e.to?t.sendTo(e._event,e.to):t.send(e._event)}),e.delay)},e.prototype.cancel=function(e){this.clock.clearTimeout(this.delayedEventsMap[e]),delete this.delayedEventsMap[e]},e.prototype.exec=function(e,t,n){void 0===n&&(n=this.machine.options.actions);var r=t.context,o=t._event,i=e.exec||Ce(e.type,n),a=I(i)?i:i?i.exec:e.exec;if(a)try{return a(r,o.data,{action:e,state:this.state,_event:o})}catch(b){throw this.parent&&this.parent.send({type:"xstate.error",data:b}),b}switch(e.type){case de:var s=e;if("number"===typeof s.delay)return void this.defer(s);s.to?this.sendTo(s._event,s.to):this.send(s._event);break;case he:this.cancel(e.sendId);break;case ue:if(this.status!==Qe.Running)return;var c=e.activity;if(!this.state.activities[c.id||c.type])break;if(c.type===Z.Invoke){var u=$(c.src),l=this.machine.options.services?this.machine.options.services[u.type]:void 0,f=c.id,d=c.data;0;var h="autoForward"in c?c.autoForward:!!c.forward;if(!l)return void 0;var p=d?N(d,r,o):void 0;if("string"===typeof l)return;var v=I(l)?l(r,o.data,{data:p,src:u,meta:c.meta}):l;if(!v)return;var y=void 0;q(v)&&(v=p?v.withContext(p):v,y={autoForward:h}),this.spawn(v,f,y)}else this.spawnActivity(c);break;case le:this.stopChild(e.activity.id);break;case ye:var m=e.label,g=e.value;m?this.logger(m,g):this.logger(g);break;default:0}},e.prototype.removeChild=function(e){var t;this.children.delete(e),this.forwardTo.delete(e),null===(t=this.state)||void 0===t||delete t.children[e]},e.prototype.stopChild=function(e){var t=this.children.get(e);t&&(this.removeChild(e),I(t.stop)&&t.stop())},e.prototype.spawn=function(e,t,n){if(A(e))return this.spawnPromise(Promise.resolve(e),t);if(I(e))return this.spawnCallback(e,t);if(function(e){try{return"function"===typeof e.send}catch(t){return!1}}(o=e)&&"id"in o)return this.spawnActor(e,t);if(function(e){try{return"subscribe"in e&&I(e.subscribe)}catch(t){return!1}}(e))return this.spawnObservable(e,t);if(q(e))return this.spawnMachine(e,l(l({},n),{id:t}));if(null!==(r=e)&&"object"===typeof r&&"transition"in r&&"function"===typeof r.transition)return this.spawnBehavior(e,t);throw new Error('Unable to spawn entity "'.concat(t,'" of type "').concat(typeof e,'".'));var r,o},e.prototype.spawnMachine=function(t,n){var r=this;void 0===n&&(n={});var o=new e(t,l(l({},this.options),{parent:this,id:n.id||t.id})),i=l(l({},et),n);i.sync&&o.onTransition((function(e){r.send(Se,{state:e,id:o.id})}));var a=o;return this.children.set(o.id,a),i.autoForward&&this.forwardTo.add(o.id),o.onDone((function(e){r.removeChild(o.id),r.send(G(e,{origin:o.id}))})).start(),a},e.prototype.spawnBehavior=function(e,t){var n=Ye(e,{id:t,parent:this});return this.children.set(t,n),n},e.prototype.spawnPromise=function(e,t){var n,r=this,o=!1;e.then((function(e){o||(n=e,r.removeChild(t),r.send(G(Ae(t,e),{origin:t})))}),(function(e){if(!o){r.removeChild(t);var n=je(t,e);try{r.send(G(n,{origin:t}))}catch(we){r.devTools&&r.devTools.send(n,r.state),r.machine.strict&&r.stop()}}}));var i=l({id:t,send:function(){},subscribe:function(t,n,r){var o=X(t,n,r),i=!1;return e.then((function(e){i||(o.next(e),i||o.complete())}),(function(e){i||o.error(e)})),{unsubscribe:function(){return i=!0}}},stop:function(){o=!0},toJSON:function(){return{id:t}},getSnapshot:function(){return n}},B);return this.children.set(t,i),i},e.prototype.spawnCallback=function(e,t){var n,r,o=this,i=!1,a=new Set,s=new Set;try{r=e((function(e){n=e,s.forEach((function(t){return t(e)})),i||o.send(G(e,{origin:t}))}),(function(e){a.add(e)}))}catch(u){this.send(je(t,u))}if(A(r))return this.spawnPromise(r,t);var c=l({id:t,send:function(e){return a.forEach((function(t){return t(e)}))},subscribe:function(e){return s.add(e),{unsubscribe:function(){s.delete(e)}}},stop:function(){i=!0,I(r)&&r()},toJSON:function(){return{id:t}},getSnapshot:function(){return n}},B);return this.children.set(t,c),c},e.prototype.spawnObservable=function(e,t){var n,r=this,o=e.subscribe((function(e){n=e,r.send(G(e,{origin:t}))}),(function(e){r.removeChild(t),r.send(G(je(t,e),{origin:t}))}),(function(){r.removeChild(t),r.send(G(Ae(t),{origin:t}))})),i=l({id:t,send:function(){},subscribe:function(t,n,r){return e.subscribe(t,n,r)},stop:function(){return o.unsubscribe()},getSnapshot:function(){return n},toJSON:function(){return{id:t}}},B);return this.children.set(t,i),i},e.prototype.spawnActor=function(e,t){return this.children.set(t,e),e},e.prototype.spawnActivity=function(e){var t=this.machine.options&&this.machine.options.activities?this.machine.options.activities[e.type]:void 0;if(t){var n=t(this.state.context,e);this.spawnEffect(e.id,n)}},e.prototype.spawnEffect=function(e,t){this.children.set(e,l({id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:t||void 0,getSnapshot:function(){},toJSON:function(){return{id:e}}},B))},e.prototype.attachDev=function(){var e=Je();if(this.options.devTools&&e){if(e.__REDUX_DEVTOOLS_EXTENSION__){var t="object"===typeof this.options.devTools?this.options.devTools:void 0;this.devTools=e.__REDUX_DEVTOOLS_EXTENSION__.connect(l(l({name:this.id,autoPause:!0,stateSanitizer:function(e){return{value:e.value,context:e.context,actions:e.actions}}},t),{features:l({jump:!1,skip:!1},t?t.features:void 0)}),this.machine),this.devTools.init(this.state)}Ze(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[H]=function(){return this},e.prototype.getSnapshot=function(){return this.status===Qe.NotStarted?this.initialState:this._state},e.defaultOptions=function(e){return{execute:!0,deferEvents:!0,clock:{setTimeout:function(e,t){return setTimeout(e,t)},clearTimeout:function(e){return clearTimeout(e)}},logger:e.console.log.bind(console),devTools:!1}}("undefined"!==typeof self?self:n.g),e.interpret=rt,e}();function rt(e,t){return new nt(e,t)}function ot(e){var t=r.useRef();return t.current||(t.current={v:e()}),t.current.v}!function(e){e[e.Effect=1]="Effect",e[e.LayoutEffect=2]="LayoutEffect"}(tt||(tt={}));var it=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(we){o={error:we}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},at=function(e){var t="function"===typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};var st=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(we){o={error:we}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},ct=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o0)&&!(r=i.next()).done;)a.push(r.value)}catch(we){o={error:we}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};function pt(e,t){void 0===t&&(t={});var n=(0,r.useCallback)((function(e){var t=void 0===e.changed&&Object.keys(e.children).length;(e.changed||t)&&s(e)}),[]),o=function(e,t,n){void 0===t&&(t={});var r=ot((function(){return"function"===typeof e?e():e})),o=t.context,i=t.guards,a=t.actions,s=t.activities,c=t.services,u=t.delays,l=t.state,f=dt(t,["context","guards","actions","activities","services","delays","state"]),d=ot((function(){var e={context:o,guards:i,actions:a,activities:s,services:c,delays:u};return rt(r.withConfig(e,(function(){return ft(ft({},r.context),o)})),ft({deferEvents:!0},f))}));return Fe((function(){var e;return n&&(e=d.subscribe(function(e,t,n){if("object"===typeof e)return e;var r=function(){};return{next:e,error:void 0||r,complete:void 0||r}}(n))),function(){null===e||void 0===e||e.unsubscribe()}}),[n]),Fe((function(){return d.start(l?Le.create(l):void 0),function(){d.stop()}}),[]),Fe((function(){Object.assign(d.machine.options.actions,a),Object.assign(d.machine.options.guards,i),Object.assign(d.machine.options.activities,s),Object.assign(d.machine.options.services,c),Object.assign(d.machine.options.delays,u)}),[a,i,s,c,u]),lt(d),d}(e,t,n),i=ht((0,r.useState)((function(){var e=o.machine.initialState;return t.state?Le.create(t.state):e})),2),a=i[0],s=i[1];return[a,o.send,o]}function vt(){return(vt=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}const mt={arr:Array.isArray,obj:e=>"[object Object]"===Object.prototype.toString.call(e),fun:e=>"function"===typeof e,str:e=>"string"===typeof e,num:e=>"number"===typeof e,und:e=>void 0===e,nul:e=>null===e,set:e=>e instanceof Set,map:e=>e instanceof Map,equ(e,t){if(typeof e!==typeof t)return!1;if(mt.str(e)||mt.num(e))return e===t;if(mt.obj(e)&&mt.obj(t)&&Object.keys(e).length+Object.keys(t).length===0)return!0;let n;for(n in e)if(!(n in t))return!1;for(n in t)if(e[n]!==t[n])return!1;return!mt.und(n)||e===t}};function gt(){const e=(0,r.useState)(!1)[1];return(0,r.useCallback)((()=>e((e=>!e))),[])}function bt(e,t){return mt.und(e)||mt.nul(e)?t:e}function wt(e){return mt.und(e)?[]:mt.arr(e)?e:[e]}function St(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;rmt.und(t[r])?vt({},n,{[r]:e[r]}):n),{});return vt({to:t},n)}class xt{constructor(){this.payload=void 0,this.children=[]}getAnimatedValue(){return this.getValue()}getPayload(){return this.payload||this}attach(){}detach(){}getChildren(){return this.children}addChild(e){0===this.children.length&&this.attach(),this.children.push(e)}removeChild(e){const t=this.children.indexOf(e);this.children.splice(t,1),0===this.children.length&&this.detach()}}class Ot extends xt{constructor(){super(...arguments),this.payload=[],this.attach=()=>this.payload.forEach((e=>e instanceof xt&&e.addChild(this))),this.detach=()=>this.payload.forEach((e=>e instanceof xt&&e.removeChild(this)))}}class Ct extends xt{constructor(){super(...arguments),this.payload={},this.attach=()=>Object.values(this.payload).forEach((e=>e instanceof xt&&e.addChild(this))),this.detach=()=>Object.values(this.payload).forEach((e=>e instanceof xt&&e.removeChild(this)))}getValue(e){void 0===e&&(e=!1);const t={};for(const n in this.payload){const r=this.payload[n];(!e||r instanceof xt)&&(t[n]=r instanceof xt?r[e?"getAnimatedValue":"getValue"]():r)}return t}getAnimatedValue(){return this.getValue(!0)}}let kt,_t;function Pt(e,t){kt={fn:e,transform:t}}function Tt(e){_t=e}let Rt,Nt=e=>"undefined"!==typeof window?window.requestAnimationFrame(e):-1;function At(e){Rt=e}let jt,Dt=()=>Date.now();function Mt(e){jt=e}let Lt,Ft,It=e=>e.current;function zt(e){Lt=e}class Vt extends Ct{constructor(e,t){super(),this.update=void 0,this.payload=e.style?vt({},e,{style:Lt(e.style)}):e,this.update=t,this.attach()}}let Ht=!1;const Bt=new Set,qt=()=>{if(!Ht)return!1;let e=Dt();for(let t of Bt){let n=!1;for(let r=0;r=r.startTime+a.duration;else if(a.decay)u=s+f/(1-.998)*(1-Math.exp(-(1-.998)*(e-r.startTime))),o=Math.abs(r.lastPosition-u)<.1,o&&(c=u);else{i=void 0!==r.lastTime?r.lastTime:e,f=void 0!==r.lastVelocity?r.lastVelocity:a.initialVelocity,e>i+64&&(i=e);let t=Math.floor(e-i);for(let e=0;ec:ue);return e=>{const t=function(e,t){for(var n=1;n=e);++n);return n-1}(e,i);return function(e,t,n,r,o,i,a,s,c){let u=c?c(e):e;if(un){if("identity"===s)return u;"clamp"===s&&(u=n)}if(r===o)return r;if(t===n)return e<=t?r:o;t===-1/0?u=-u:n===1/0?u-=t:u=(u-t)/(n-t);u=i(u),r===-1/0?u=-u:o===1/0?u+=r:u=u*(o-r)+r;return u}(e,i[t],i[t+1],o[t],o[t+1],c,a,s,r.map)}}class Gt extends Ot{constructor(e,t,n,r){super(),this.calc=void 0,this.payload=e instanceof Ot&&!(e instanceof Gt)?e.getPayload():Array.isArray(e)?e:[e],this.calc=Ut(t,n,r)}getValue(){return this.calc(...this.payload.map((e=>e.getValue())))}updateConfig(e,t,n){this.calc=Ut(e,t,n)}interpolate(e,t,n){return new Gt(this,e,t,n)}}const Wt=(e,t,n)=>e&&new Gt(e,t,n);function Kt(e,t){"update"in e?t.add(e):e.getChildren().forEach((e=>Kt(e,t)))}class $t extends xt{constructor(e){var t;super(),t=this,this.animatedStyles=new Set,this.value=void 0,this.startPosition=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.startTime=void 0,this.lastTime=void 0,this.done=!1,this.setValue=function(e,n){void 0===n&&(n=!0),t.value=e,n&&t.flush()},this.value=e,this.startPosition=e,this.lastPosition=e}flush(){0===this.animatedStyles.size&&Kt(this,this.animatedStyles),this.animatedStyles.forEach((e=>e.update()))}clearStyles(){this.animatedStyles.clear()}getValue(){return this.value}interpolate(e,t,n){return new Gt(this,e,t,n)}}class Xt extends Ot{constructor(e){super(),this.payload=e.map((e=>new $t(e)))}setValue(e,t){void 0===t&&(t=!0),Array.isArray(e)?e.length===this.payload.length&&e.forEach(((e,n)=>this.payload[n].setValue(e,t))):this.payload.forEach((n=>n.setValue(e,t)))}getValue(){return this.payload.map((e=>e.getValue()))}interpolate(e,t){return new Gt(this,e,t)}}let Jt=0;class Zt{constructor(){this.id=void 0,this.idle=!0,this.hasChanged=!1,this.guid=0,this.local=0,this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.listeners=[],this.queue=[],this.localQueue=void 0,this.getValues=()=>this.interpolations,this.id=Jt++}update(e){if(!e)return this;const t=Et(e),n=t.delay,r=void 0===n?0:n,o=t.to,i=yt(t,["delay","to"]);if(mt.arr(o)||mt.fun(o))this.queue.push(vt({},i,{delay:r,to:o}));else if(o){let e={};Object.entries(o).forEach((t=>{let n=t[0];const o=vt({to:{[n]:t[1]},delay:St(r,n)},i),a=e[o.delay]&&e[o.delay].to;e[o.delay]=vt({},e[o.delay],o,{to:vt({},a,o.to)})})),this.queue=Object.values(e)}return this.queue=this.queue.sort(((e,t)=>e.delay-t.delay)),this.diff(i),this}start(e){if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach((e=>{let t=e.from,n=void 0===t?{}:t,r=e.to,o=void 0===r?{}:r;mt.obj(n)&&(this.merged=vt({},n,this.merged)),mt.obj(o)&&(this.merged=vt({},this.merged,o))}));const t=this.local=++this.guid,n=this.localQueue=this.queue;this.queue=[],n.forEach(((r,o)=>{let i=r.delay,a=yt(r,["delay"]);const s=r=>{o===n.length-1&&t===this.guid&&r&&(this.idle=!0,this.props.onRest&&this.props.onRest(this.merged)),e&&e()};let c=mt.arr(a.to)||mt.fun(a.to);i?setTimeout((()=>{t===this.guid&&(c?this.runAsync(a,s):this.diff(a).start(s))}),i):c?this.runAsync(a,s):this.diff(a).start(s)}))}else mt.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),t=this,Bt.has(t)||Bt.add(t),Ht||(Ht=!0,Nt(Ft||qt));var t;return this}stop(e){return this.listeners.forEach((t=>t(e))),this.listeners=[],this}pause(e){var t;return this.stop(!0),e&&(t=this,Bt.has(t)&&Bt.delete(t)),this}runAsync(e,t){var n=this;e.delay;let r=yt(e,["delay"]);const o=this.local;let i=Promise.resolve(void 0);if(mt.arr(r.to))for(let a=0;a{if(o===this.guid)return new Promise((e=>this.diff(t).start(e)))}))}else if(mt.fun(r.to)){let e,t=0;i=i.then((()=>r.to((n=>{const i=vt({},r,Et(n));if(mt.arr(i.config)&&(i.config=i.config[t]),t++,o===this.guid)return e=new Promise((e=>this.diff(i).start(e)))}),(function(e){return void 0===e&&(e=!0),n.stop(e)})).then((()=>e))))}i.then(t)}diff(e){this.props=vt({},this.props,e);let t=this.props,n=t.from,r=void 0===n?{}:n,o=t.to,i=void 0===o?{}:o,a=t.config,s=void 0===a?{}:a,c=t.reverse,u=t.attach,l=t.reset,f=t.immediate;if(c){var d=[i,r];r=d[0],i=d[1]}this.merged=vt({},r,this.merged,i),this.hasChanged=!1;let h=u&&u(this);if(this.animations=Object.entries(this.merged).reduce(((e,t)=>{let n=t[0],o=t[1],i=e[n]||{};const a=mt.num(o),c=mt.str(o)&&!o.startsWith("#")&&!/\d/.test(o)&&!_t[o],u=mt.arr(o),d=!a&&!u&&!c;let p=mt.und(r[n])?o:r[n],v=a||u||c?o:1,y=St(s,n);h&&(v=h.animations[n].parent);let m,g=i.parent,b=i.interpolation,w=wt(h?v.getPayload():v),S=o;d&&(S=Rt({range:[0,1],output:[o,o]})(1));let E=b&&b.getValue();const x=!mt.und(g)&&i.animatedValues.some((e=>!e.done)),O=!mt.equ(S,E),C=!mt.equ(S,i.previous),k=!mt.equ(y,i.config);if(l||C&&O||k){if(a||c)g=b=i.parent||new $t(p);else if(u)g=b=i.parent||new Xt(p);else if(d){let e=i.interpolation&&i.interpolation.calc(i.parent.value);e=void 0===e||l?p:e,i.parent?(g=i.parent,g.setValue(0,!1)):g=new $t(0);const t={output:[e,o]};i.interpolation?(b=i.interpolation,i.interpolation.updateConfig(t)):b=g.interpolate(t)}return w=wt(h?v.getPayload():v),m=wt(g.getPayload()),l&&!d&&g.setValue(p,!1),this.hasChanged=!0,m.forEach((e=>{e.startPosition=e.value,e.lastPosition=e.value,e.lastVelocity=x?e.lastVelocity:void 0,e.lastTime=x?e.lastTime:void 0,e.startTime=Dt(),e.done=!1,e.animatedStyles.clear()})),St(f,n)&&g.setValue(d?v:o,!1),vt({},e,{[n]:vt({},i,{name:n,parent:g,interpolation:b,animatedValues:m,toValues:w,previous:S,config:y,fromValues:wt(g.getValue()),immediate:St(f,n),initialVelocity:bt(y.velocity,0),clamp:bt(y.clamp,!1),precision:bt(y.precision,.01),tension:bt(y.tension,170),friction:bt(y.friction,26),mass:bt(y.mass,1),duration:y.duration,easing:bt(y.easing,(e=>e)),decay:y.decay})})}return O?e:(d&&(g.setValue(1,!1),b.updateConfig({output:[S,S]})),g.done=!0,this.hasChanged=!0,vt({},e,{[n]:vt({},e[n],{previous:S})}))}),this.animations),this.hasChanged){this.configs=Object.values(this.animations),this.values={},this.interpolations={};for(let e in this.animations)this.interpolations[e]=this.animations[e].interpolation,this.values[e]=this.animations[e].interpolation.getValue()}return this}destroy(){this.stop(),this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.local=0}}const Yt=(e,t)=>{const n=(0,r.useRef)(!1),o=(0,r.useRef)(),i=mt.fun(t),a=(0,r.useMemo)((()=>{let n;return o.current&&(o.current.map((e=>e.destroy())),o.current=void 0),[new Array(e).fill().map(((e,r)=>{const o=new Zt,a=i?St(t,r,o):t[r];return 0===r&&(n=a.ref),o.update(a),n||o.start(),o})),n]}),[e]),s=a[0],c=a[1];o.current=s;(0,r.useImperativeHandle)(c,(()=>({start:()=>Promise.all(o.current.map((e=>new Promise((t=>e.start(t)))))),stop:e=>o.current.forEach((t=>t.stop(e))),get controllers(){return o.current}})));const u=(0,r.useMemo)((()=>e=>o.current.map(((t,n)=>{t.update(i?St(e,n,t):e[n]),c||t.start()}))),[e]);(0,r.useEffect)((()=>{n.current?i||u(t):c||o.current.forEach((e=>e.start()))})),(0,r.useEffect)((()=>(n.current=!0,()=>o.current.forEach((e=>e.destroy())))),[]);const l=o.current.map((e=>e.getValues()));return i?[l,u,e=>o.current.forEach((t=>t.pause(e)))]:l};class Qt extends Ct{constructor(e){void 0===e&&(e={}),super(),!e.transform||e.transform instanceof xt||(e=kt.transform(e)),this.payload=e}}const en={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},tn="[-+]?\\d*\\.?\\d+",nn=tn+"%";function rn(){for(var e=arguments.length,t=new Array(e),n=0;n1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function pn(e,t,n){const r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=hn(o,r,e+1/3),a=hn(o,r,e),s=hn(o,r,e-1/3);return Math.round(255*i)<<24|Math.round(255*a)<<16|Math.round(255*s)<<8}function vn(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function yn(e){return(parseFloat(e)%360+360)%360/360}function mn(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function gn(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function bn(e){let t=function(e){let t;return"number"===typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=fn.exec(e))?parseInt(t[1]+"ff",16)>>>0:en.hasOwnProperty(e)?en[e]:(t=on.exec(e))?(vn(t[1])<<24|vn(t[2])<<16|vn(t[3])<<8|255)>>>0:(t=an.exec(e))?(vn(t[1])<<24|vn(t[2])<<16|vn(t[3])<<8|mn(t[4]))>>>0:(t=un.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=dn.exec(e))?parseInt(t[1],16)>>>0:(t=ln.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=sn.exec(e))?(255|pn(yn(t[1]),gn(t[2]),gn(t[3])))>>>0:(t=cn.exec(e))?(pn(yn(t[1]),gn(t[2]),gn(t[3]))|mn(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}const wn=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Sn=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,En=new RegExp(`(${Object.keys(en).join("|")})`,"g");let xn={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const On=["Webkit","Ms","Moz","O"];function Cn(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||xn.hasOwnProperty(e)&&xn[e]?(""+t).trim():t+"px"}xn=Object.keys(xn).reduce(((e,t)=>(On.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),xn);const kn={};zt((e=>new Qt(e))),Mt("div"),At((e=>{const t=e.output.map((e=>e.replace(Sn,bn))).map((e=>e.replace(En,bn))),n=t[0].match(wn).map((()=>[]));t.forEach((e=>{e.match(wn).forEach(((e,t)=>n[t].push(+e)))}));const r=t[0].match(wn).map(((t,r)=>Ut(vt({},e,{output:n[r]}))));return e=>{let n=0;return t[0].replace(wn,(()=>r[n++](e))).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,((e,t,n,r,o)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${o})`))}})),Tt(en),Pt(((e,t)=>{if(!e.nodeType||void 0===e.setAttribute)return!1;{const o=t.style,i=t.children,a=t.scrollTop,s=t.scrollLeft,c=yt(t,["style","children","scrollTop","scrollLeft"]),u="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName;void 0!==a&&(e.scrollTop=a),void 0!==s&&(e.scrollLeft=s),void 0!==i&&(e.textContent=i);for(let t in o)if(o.hasOwnProperty(t)){var n=0===t.indexOf("--"),r=Cn(t,o[t],n);"float"===t&&(t="cssFloat"),n?e.style.setProperty(t,r):e.style[t]=r}for(let t in c){const n=u?t:kn[t]||(kn[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())));"undefined"!==typeof e.getAttribute(n)&&e.setAttribute(n,c[t])}}}),(e=>e));var _n,Pn;const Tn=(_n=e=>(0,r.forwardRef)(((t,n)=>{const o=gt(),i=(0,r.useRef)(!0),a=(0,r.useRef)(null),s=(0,r.useRef)(null),c=(0,r.useCallback)((e=>{const t=a.current;a.current=new Vt(e,(()=>{let e=!1;s.current&&(e=kt.fn(s.current,a.current.getAnimatedValue())),s.current&&!1!==e||o()})),t&&t.detach()}),[]);(0,r.useEffect)((()=>()=>{i.current=!1,a.current&&a.current.detach()}),[]),(0,r.useImperativeHandle)(n,(()=>It(s,i,o))),c(t);const u=a.current.getValue(),l=(u.scrollTop,u.scrollLeft,yt(u,["scrollTop","scrollLeft"])),f=(d=e,!mt.fun(d)||d.prototype instanceof r.Component?e=>s.current=function(e,t){return t&&(mt.fun(t)?t(e):mt.obj(t)&&(t.current=e)),e}(e,n):void 0);var d;return r.createElement(e,vt({},l,{ref:f}))})),void 0===(Pn=!1)&&(Pn=!0),e=>(mt.arr(e)?e:Object.keys(e)).reduce(((e,t)=>{const n=Pn?t[0].toLowerCase()+t.substring(1):t;return e[n]=_n(n),e}),_n))(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]);function Rn(e,t){return e.map((function(e,n){return e+t[n]}))}function Nn(e,t){return e.map((function(e,n){return e-t[n]}))}function An(e){return Math.hypot.apply(Math,e)}function jn(e,t,n){var r=An(t),o=0===r?0:1/r,i=0===n?0:1/n,a=i*r,s=t.map((function(e){return i*e})),c=t.map((function(e){return o*e}));return{velocities:s,velocity:a,distance:An(e),direction:c}}function Dn(e){return Math.sign?Math.sign(e):Number(e>0)-Number(e<0)||+e}function Mn(e,t,n){return 0===t||Math.abs(t)===1/0?function(e,t){return Math.pow(e,5*t)}(e,n):e*t*n/(t+n*e)}function Ln(e,t,n,r){return void 0===r&&(r=.15),0===r?function(e,t,n){return Math.max(t,Math.min(e,n))}(e,t,n):en?+Mn(e-n,n-t,r)+n:e}function Fn(e,t){for(var n=0;n=0||(o[n]=e[n]);return o}function Hn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function Un(){}function Gn(){for(var e=arguments.length,t=new Array(e),n=0;n1?t-1:0),r=1;r0,c},swipeVelocity:function(e){return void 0===e&&(e=.5),Wn(e)},swipeDistance:function(e){return void 0===e&&(e=60),Wn(e)},delay:function(e){switch(void 0===e&&(e=0),e){case!0:return 180;case!1:return 0;default:return e}}});function er(e){return void 0===e&&(e={}),$n(e,Yn)}function tr(e){return void 0===e&&(e={}),$n(e,Qn)}function nr(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=Vn(e,["domTarget","eventOptions","window","enabled"]),a=er({domTarget:t,eventOptions:n,window:r,enabled:o});return a.drag=tr(i),a}function rr(e){return In({_active:!1,_blocked:!1,_intentional:[!1,!1],_movement:[0,0],_initial:[0,0],_bounds:[[-1/0,1/0],[-1/0,1/0]],_lastEventType:void 0,event:void 0,intentional:!1,values:[0,0],velocities:[0,0],delta:[0,0],movement:[0,0],offset:[0,0],lastOffset:[0,0],direction:[0,0],initial:[0,0],previous:[0,0],first:!1,last:!1,active:!1,timeStamp:0,startTime:0,elapsedTime:0,cancel:Un,canceled:!1,memo:void 0,args:void 0},e)}function or(){return{shared:{hovering:!1,scrolling:!1,wheeling:!1,dragging:!1,moving:!1,pinching:!1,touches:0,buttons:0,down:!1,shiftKey:!1,altKey:!1,metaKey:!1,ctrlKey:!1},drag:rr({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0,_isTap:!0,_delayedEvent:!1,_pointerId:void 0,tap:!1,swipe:[0,0]}),pinch:rr({da:[0,0],vdva:[0,0],origin:void 0,turns:0}),wheel:rr({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),move:rr({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),scroll:rr({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0})}}var ir=new Map,ar=function(){function e(e,t){var n=this;void 0===t&&(t=[]),this.controller=e,this.args=t,this.debounced=!0,this.setTimeout=function(e,t){var r;void 0===t&&(t=140),clearTimeout(n.controller.timeouts[n.stateKey]);for(var o=arguments.length,i=new Array(o>2?o-2:0),a=2;a=t&&Dn(e)*t}function cr(e,t,n){var r=t[0],o=t[1],i=n[0],a=n[1],s=e[0],c=s[0],u=s[1],l=e[1],f=l[0],d=l[1];return[Ln(r,c,u,i),Ln(o,f,d,a)]}function ur(e,t,n){var r=e.state,o=e.args,i=t.timeStamp,a=t.type,s=r.values;return{_lastEventType:a,event:t,timeStamp:i,elapsedTime:n?0:i-r.startTime,args:o,previous:s}}function lr(e,t,n){var r=e.state.offset,o=n.timeStamp;return In({},or()[e.stateKey],{_active:!0,values:t,initial:t,offset:r,lastOffset:r,startTime:o})}function fr(e,t){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;io?"x":r0?t:n}return null}function kr(e){var t="buttons"in e?e.buttons:0,n=Cr(e),r=n&&n.length||0;return{touches:r,down:r>0||t>0,buttons:t,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey}}function _r(e){var t=Cr(e),n=t?t[0]:e;return[n.clientX,n.clientY]}var Pr=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="dragging",t.stateKey="drag",t.onDragStart=function(e){t.enabled&&!t.state._active&&(pr(t.controller,t.stateKey,[["pointermove",t.onDragChange],["pointerup",t.onDragEnd],["pointercancel",t.onDragEnd]]),t.updateGestureState({_pointerId:e.pointerId}),t.config.delay>0?(t.state._delayedEvent=!0,"persist"in e&&"function"===typeof e.persist&&e.persist(),t.setTimeout(t.startDrag.bind(Hn(t)),t.config.delay,e)):t.startDrag(e))},t.onDragChange=function(e){if(!t.state.canceled&&e.pointerId===t.state._pointerId)if(t.state._active){var n=kr(e);if(n.down){t.updateSharedState(n);var r=_r(e),o=t.getKinematics(r,e),i=ur(Hn(t),e),a=t.state._isTap,s=An(o._movement);a&&s>=3&&(a=!1),t.updateGestureState(In({},i,o,{_isTap:a})),t.fireGestureHandler()}else t.onDragEnd(e)}else t.state._delayedEvent&&(t.clearTimeout(),t.startDrag(e))},t.onDragEnd=function(e){if(e.pointerId===t.state._pointerId){t.state._active=!1,t.updateSharedState({down:!1,buttons:0,touches:0});var n=t.state._isTap,r=t.state.velocities,o=r[0],i=r[1],a=t.state.movement,s=a[0],c=a[1],u=t.state._intentional,l=u[0],f=u[1],d=t.config.swipeVelocity,h=d[0],p=d[1],v=t.config.swipeDistance,y=v[0],m=v[1],g=In({},ur(Hn(t),e),t.getMovement(t.state.values)),b=[0,0];g.elapsedTime<220&&(!1!==l&&Math.abs(o)>h&&Math.abs(s)>y&&(b[0]=Dn(o)),!1!==f&&Math.abs(i)>p&&Math.abs(c)>m&&(b[1]=Dn(i))),t.updateGestureState(In({},g,{tap:n,swipe:b})),t.fireGestureHandler(!0===n)}},t.clean=function(){e.prototype.clean.call(Hn(t)),t.state._delayedEvent=!1,hr(t.controller,t.stateKey)},t.onCancel=function(){t.state.canceled||(t.updateGestureState({canceled:!0}),t.state._active=!1,t.updateSharedState({down:!1,buttons:0,touches:0}),requestAnimationFrame((function(){return t.fireGestureHandler()})))},t.onClick=function(e){t.state._isTap||e.stopPropagation()},t}zn(t,e);var n=t.prototype;return n.startDrag=function(e){var t=_r(e);this.updateSharedState(kr(e)),this.updateGestureState(In({},lr(this,t,e),ur(this,e,!0),{_pointerId:e.pointerId,cancel:this.onCancel})),this.updateGestureState(this.getMovement(t)),this.fireGestureHandler()},n.addBindings=function(e){(br(e,"onPointerDown",this.onDragStart),this.config.filterTaps)&&br(e,this.controller.config.eventOptions.capture?"onClick":"onClickCapture",this.onClick)},t}(Or);function Tr(e,t){var n,r,o=[],i=!1;return function(){for(var a=arguments.length,s=new Array(a),c=0;csummary:first-of-type","details"],jr=Ar.join(","),Dr="undefined"===typeof Element?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Mr=function(e,t,n){var r=Array.prototype.slice.apply(e.querySelectorAll(jr));return t&&Dr.call(e,jr)&&r.unshift(e),r=r.filter(n)},Lr=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return isNaN(t)?function(e){return"true"===e.contentEditable}(e)?0:"AUDIO"!==e.nodeName&&"VIDEO"!==e.nodeName&&"DETAILS"!==e.nodeName||null!==e.getAttribute("tabindex")?e.tabIndex:0:t},Fr=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Ir=function(e){return"INPUT"===e.tagName},zr=function(e){return function(e){return Ir(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||e.ownerDocument,r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!==typeof window&&"undefined"!==typeof window.CSS&&"function"===typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var o=function(e,t){for(var n=0;nsummary:first-of-type")?e.parentElement:e;if(Dr.call(n,"details:not([open]) *"))return!0;if(t&&"full"!==t){if("non-zero-area"===t){var r=e.getBoundingClientRect(),o=r.width,i=r.height;return 0===o&&0===i}}else for(;e;){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(t,e.displayCheck)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(Ir(e)||"SELECT"===e.tagName||"TEXTAREA"===e.tagName||"BUTTON"===e.tagName)for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n0){var n=e[e.length-1];n!==t&&n.pause()}var r=e.indexOf(t);-1===r||e.splice(r,1),e.push(t)},deactivateTrap:function(t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}}}(),$r=function(e){return setTimeout(e,0)},Xr=function(e,t){var n=-1;return e.every((function(e,r){return!t(e)||(n=r,!1)})),n},Jr=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?n-1:0),a=1;a0)return{container:e,firstTabbableNode:t[0],lastTabbableNode:t[t.length-1]}})).filter((function(e){return!!e})),i.tabbableGroups.length<=0&&!c("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},f=function e(t){!1!==t&&t!==r.activeElement&&(t&&t.focus?(t.focus({preventScroll:!!o.preventScroll}),i.mostRecentlyFocusedNode=t,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"===typeof e.select}(t)&&t.select()):e(u()))},d=function(e){var t=c("setReturnFocus",e);return t||!1!==t&&e},h=function(e){var t=Zr(e);s(t)||(Jr(o.clickOutsideDeactivates,e)?n.deactivate({returnFocus:o.returnFocusOnDeactivate&&!Ur(t)}):Jr(o.allowOutsideClick,e)||e.preventDefault())},p=function(e){var t=Zr(e),n=s(t);n||t instanceof Document?n&&(i.mostRecentlyFocusedNode=t):(e.stopImmediatePropagation(),f(i.mostRecentlyFocusedNode||u()))},v=function(e){if(function(e){return"Escape"===e.key||"Esc"===e.key||27===e.keyCode}(e)&&!1!==Jr(o.escapeDeactivates,e))return e.preventDefault(),void n.deactivate();(function(e){return"Tab"===e.key||9===e.keyCode})(e)&&function(e){var t=Zr(e);l();var n=null;if(i.tabbableGroups.length>0){var r=Xr(i.tabbableGroups,(function(e){return e.container.contains(t)}));if(r<0)n=e.shiftKey?i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:i.tabbableGroups[0].firstTabbableNode;else if(e.shiftKey){var o=Xr(i.tabbableGroups,(function(e){var n=e.firstTabbableNode;return t===n}));if(o<0&&(i.tabbableGroups[r].container===t||Ur(t)&&!Br(t))&&(o=r),o>=0){var a=0===o?i.tabbableGroups.length-1:o-1;n=i.tabbableGroups[a].lastTabbableNode}}else{var s=Xr(i.tabbableGroups,(function(e){var n=e.lastTabbableNode;return t===n}));if(s<0&&(i.tabbableGroups[r].container===t||Ur(t)&&!Br(t))&&(s=r),s>=0){var u=s===i.tabbableGroups.length-1?0:s+1;n=i.tabbableGroups[u].firstTabbableNode}}}else n=c("fallbackFocus");n&&(e.preventDefault(),f(n))}(e)},y=function(e){if(!Jr(o.clickOutsideDeactivates,e)){var t=Zr(e);s(t)||Jr(o.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())}},m=function(){if(i.active)return Kr.activateTrap(n),i.delayInitialFocusTimer=o.delayInitialFocus?$r((function(){f(u())})):f(u()),r.addEventListener("focusin",p,!0),r.addEventListener("mousedown",h,{capture:!0,passive:!1}),r.addEventListener("touchstart",h,{capture:!0,passive:!1}),r.addEventListener("click",y,{capture:!0,passive:!1}),r.addEventListener("keydown",v,{capture:!0,passive:!1}),n},g=function(){if(i.active)return r.removeEventListener("focusin",p,!0),r.removeEventListener("mousedown",h,!0),r.removeEventListener("touchstart",h,!0),r.removeEventListener("click",y,!0),r.removeEventListener("keydown",v,!0),n};return(n={activate:function(e){if(i.active)return this;var t=a(e,"onActivate"),n=a(e,"onPostActivate"),o=a(e,"checkCanFocusTrap");o||l(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=r.activeElement,t&&t();var s=function(){o&&l(),m(),n&&n()};return o?(o(i.containers.concat()).then(s,s),this):(s(),this)},deactivate:function(e){if(!i.active)return this;clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,g(),i.active=!1,i.paused=!1,Kr.deactivateTrap(n);var t=a(e,"onDeactivate"),r=a(e,"onPostDeactivate"),o=a(e,"checkCanReturnFocus");t&&t();var s=a(e,"returnFocus","returnFocusOnDeactivate"),c=function(){$r((function(){s&&f(d(i.nodeFocusedBeforeActivation)),r&&r()}))};return s&&o?(o(d(i.nodeFocusedBeforeActivation)).then(c,c),this):(c(),this)},pause:function(){return i.paused||!i.active||(i.paused=!0,g()),this},unpause:function(){return i.paused&&i.active?(i.paused=!1,l(),m(),this):this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return i.containers=t.map((function(e){return"string"===typeof e?r.querySelector(e):e})),i.active&&l(),this}}).updateContainerElements(e),n};var Qr=!1;if("undefined"!==typeof window){var eo={get passive(){Qr=!0}};window.addEventListener("testPassive",null,eo),window.removeEventListener("testPassive",null,eo)}var to,no="undefined"!==typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1),ro=[],oo=!1,io=-1,ao=void 0,so=void 0,co=function(e){return ro.some((function(t){return!(!t.options.allowTouchMove||!t.options.allowTouchMove(e))}))},uo=function(e){var t=e||window.event;return!!co(t.target)||(t.touches.length>1||(t.preventDefault&&t.preventDefault(),!1))},lo=function(){void 0!==so&&(document.body.style.paddingRight=so,so=void 0),void 0!==ao&&(document.body.style.overflow=ao,ao=void 0)},fo=function(e,t){if(e){if(!ro.some((function(t){return t.targetElement===e}))){var n={targetElement:e,options:t||{}};ro=[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0||function(e){return!!e&&e.scrollHeight-e.scrollTop<=e.clientHeight}(t)&&n<0?uo(e):e.stopPropagation())}(t,e)},oo||(document.addEventListener("touchmove",uo,Qr?{passive:!1}:void 0),oo=!0)):function(e){if(void 0===so){var t=!!e&&!0===e.reserveScrollBarGap,n=window.innerWidth-document.documentElement.clientWidth;t&&n>0&&(so=document.body.style.paddingRight,document.body.style.paddingRight=n+"px")}void 0===ao&&(ao=document.body.style.overflow,document.body.style.overflow="hidden")}(t)}}else console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.")},ho=[],po="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(to||(to={}));var vo,yo=function(e){return Object.freeze(e)},mo=function(e,t){this.inlineSize=e,this.blockSize=t,yo(this)},go=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,yo(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),bo=function(e){return e instanceof SVGElement&&"getBBox"in e},wo=function(e){if(bo(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var o=e,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||e.getClientRects().length)},So=function(e){var t,n;if(e instanceof Element)return!0;var r=null===(n=null===(t=e)||void 0===t?void 0:t.ownerDocument)||void 0===n?void 0:n.defaultView;return!!(r&&e instanceof r.Element)},Eo="undefined"!==typeof window?window:{},xo=new WeakMap,Oo=/auto|scroll/,Co=/^tb|vertical/,ko=/msie|trident/i.test(Eo.navigator&&Eo.navigator.userAgent),_o=function(e){return parseFloat(e||"0")},Po=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new mo((n?t:e)||0,(n?e:t)||0)},To=yo({devicePixelContentBoxSize:Po(),borderBoxSize:Po(),contentBoxSize:Po(),contentRect:new go(0,0,0,0)}),Ro=function(e,t){if(void 0===t&&(t=!1),xo.has(e)&&!t)return xo.get(e);if(wo(e))return xo.set(e,To),To;var n=getComputedStyle(e),r=bo(e)&&e.ownerSVGElement&&e.getBBox(),o=!ko&&"border-box"===n.boxSizing,i=Co.test(n.writingMode||""),a=!r&&Oo.test(n.overflowY||""),s=!r&&Oo.test(n.overflowX||""),c=r?0:_o(n.paddingTop),u=r?0:_o(n.paddingRight),l=r?0:_o(n.paddingBottom),f=r?0:_o(n.paddingLeft),d=r?0:_o(n.borderTopWidth),h=r?0:_o(n.borderRightWidth),p=r?0:_o(n.borderBottomWidth),v=f+u,y=c+l,m=(r?0:_o(n.borderLeftWidth))+h,g=d+p,b=s?e.offsetHeight-g-e.clientHeight:0,w=a?e.offsetWidth-m-e.clientWidth:0,S=o?v+m:0,E=o?y+g:0,x=r?r.width:_o(n.width)-S-w,O=r?r.height:_o(n.height)-E-b,C=x+v+w+m,k=O+y+b+g,_=yo({devicePixelContentBoxSize:Po(Math.round(x*devicePixelRatio),Math.round(O*devicePixelRatio),i),borderBoxSize:Po(C,k,i),contentBoxSize:Po(x,O,i),contentRect:new go(f,c,x,O)});return xo.set(e,_),_},No=function(e,t,n){var r=Ro(e,n),o=r.borderBoxSize,i=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case to.DEVICE_PIXEL_CONTENT_BOX:return a;case to.BORDER_BOX:return o;default:return i}},Ao=function(e){var t=Ro(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=yo([t.borderBoxSize]),this.contentBoxSize=yo([t.contentBoxSize]),this.devicePixelContentBoxSize=yo([t.devicePixelContentBoxSize])},jo=function(e){if(wo(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},Do=function(){var e=1/0,t=[];ho.forEach((function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach((function(t){var n=new Ao(t.target),o=jo(t.target);r.push(n),t.lastReportedSize=No(t.target,t.observedBox),oe?t.activeTargets.push(n):t.skippedTargets.push(n))}))}))},Lo=function(){var e=0;for(Mo(e);ho.some((function(e){return e.activeTargets.length>0}));)e=Do(),Mo(e);return ho.some((function(e){return e.skippedTargets.length>0}))&&function(){var e;"function"===typeof ErrorEvent?e=new ErrorEvent("error",{message:po}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=po),window.dispatchEvent(e)}(),e>0},Fo=[],Io=function(e){if(!vo){var t=0,n=document.createTextNode("");new MutationObserver((function(){return Fo.splice(0).forEach((function(e){return e()}))})).observe(n,{characterData:!0}),vo=function(){n.textContent=""+(t?t--:t++)}}Fo.push(e),vo()},zo=0,Vo={attributes:!0,characterData:!0,childList:!0,subtree:!0},Ho=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Bo=function(e){return void 0===e&&(e=0),Date.now()+e},qo=!1,Uo=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!qo){qo=!0;var n,r=Bo(e);n=function(){var n=!1;try{n=Lo()}finally{if(qo=!1,e=r-Bo(),!zo)return;n?t.run(1e3):e>0?t.run(e):t.start()}},Io((function(){requestAnimationFrame(n)}))}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,Vo)};document.body?t():Eo.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Ho.forEach((function(t){return Eo.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Ho.forEach((function(t){return Eo.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}()),Go=function(e){!zo&&e>0&&Uo.start(),!(zo+=e)&&Uo.stop()},Wo=function(){function e(e,t){this.target=e,this.observedBox=t||to.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e=No(this.target,this.observedBox,!0);return function(e){return!bo(e)&&!function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)&&"inline"===getComputedStyle(e).display}(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},e}(),Ko=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},$o=new WeakMap,Xo=function(e,t){for(var n=0;n=0&&(o&&ho.splice(ho.indexOf(n),1),n.observationTargets.splice(r,1),Go(-1))},e.disconnect=function(e){var t=this,n=$o.get(e);n.observationTargets.slice().forEach((function(n){return t.unobserve(e,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},e}(),Zo=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!==typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Jo.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!So(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Jo.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!So(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Jo.unobserve(this,e)},e.prototype.disconnect=function(){Jo.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();function Yo(e){if("string"===typeof e){var t={type:e,toString:function(){return e}};return t}return e}function Qo(e){return l(l({type:ge},e),{toJSON:function(){e.onDone,e.onError;var t=f(e,["onDone","onError"]);return l(l({},t),{type:ge,src:Yo(e.src)})}})}var ei="",ti="*",ni={},ri=function(e){return"#"===e[0]},oi=function(){function e(t,n,r,o){var i,a=this;void 0===r&&(r="context"in t?t.context:void 0),this.config=t,this._context=r,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign({actions:{},guards:{},services:{},activities:{},delays:{}},n),this.parent=null===o||void 0===o?void 0:o.parent,this.key=this.config.key||(null===o||void 0===o?void 0:o.key)||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:"."),this.id=this.config.id||p([this.machine.key],h(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&g(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:null!==(i=this.config.schema)&&void 0!==i?i:{},this.description=this.config.description,this.initial=this.config.initial,this.states=this.config.states?O(this.config.states,(function(t,n){var r,o=new e(t,{},void 0,{parent:a,key:n});return Object.assign(a.idMap,l(((r={})[o.id]=o,r),o.idMap)),o})):ni;var s=0;!function e(t){var n,r;t.order=s++;try{for(var o=d(ee(t)),i=o.next();!i.done;i=o.next()){e(i.value)}}catch(a){n={error:a}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}(this),this.history=!0===this.config.history?"shallow":this.config.history||!1,this._transient=!!this.config.always||!!this.config.on&&(Array.isArray(this.config.on)?this.config.on.some((function(e){return e.event===ei})):ei in this.config.on),this.strict=!!this.config.strict,this.onEntry=R(this.config.entry||this.config.onEntry).map((function(e){return ke(e)})),this.onExit=R(this.config.exit||this.config.onExit).map((function(e){return ke(e)})),this.meta=this.config.meta,this.doneData="final"===this.type?this.config.data:void 0,this.invoke=R(this.config.invoke).map((function(e,t){var n,r;if(q(e)){var o=J(a.id,t);return a.machine.options.services=l(((n={})[o]=e,n),a.machine.options.services),Qo({src:o,id:o})}if(z(e.src)){o=e.id||J(a.id,t);return Qo(l(l({},e),{id:o,src:e.src}))}if(q(e.src)||I(e.src)){o=e.id||J(a.id,t);return a.machine.options.services=l(((r={})[o]=e.src,r),a.machine.options.services),Qo(l(l({id:o},e),{src:o}))}var i=e.src;return Qo(l(l({id:J(a.id,t)},e),{src:i}))})),this.activities=R(this.config.activities).concat(this.invoke).map((function(e){return Pe(e)})),this.transition=this.transition.bind(this),this.tags=R(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||te(this).forEach((function(e){return e.on}))},e.prototype.withConfig=function(t,n){var r=this.options,o=r.actions,i=r.activities,a=r.guards,s=r.services,c=r.delays;return new e(this.config,{actions:l(l({},o),t.actions),activities:l(l({},i),t.activities),guards:l(l({},a),t.guards),services:l(l({},s),t.services),delays:l(l({},c),t.delays)},null!==n&&void 0!==n?n:this.context)},e.prototype.withContext=function(t){return new e(this.config,this.options,t)},Object.defineProperty(e.prototype,"context",{get:function(){return I(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:O(this.states,(function(e){return e.definition})),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return this.definition},Object.defineProperty(e.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var e=this.transitions;return this.__cache.on=e.reduce((function(e,t){return e[t.eventType]=e[t.eventType]||[],e[t.eventType].push(t),e}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),e.prototype.getCandidates=function(e){if(this.__cache.candidates[e])return this.__cache.candidates[e];var t=e===ei,n=this.transitions.filter((function(n){var r=n.eventType===e;return t?r:r||n.eventType===ti}));return this.__cache.candidates[e]=n,n},e.prototype.getDelayedTransitions=function(){var e=this,t=this.config.after;if(!t)return[];var n=function(t,n){var r=function(e,t){var n=t?"#".concat(t):"";return"".concat(Z.After,"(").concat(e,")").concat(n)}(I(t)?"".concat(e.id,":delay[").concat(n,"]"):t,e.id);return e.onEntry.push(Re(r,{delay:t})),e.onExit.push({type:he,sendId:r}),r};return(F(t)?t.map((function(e,t){var r=n(e.delay,t);return l(l({},e),{event:r})})):P(g(t).map((function(e,r){var o=t[e],i=z(o)?{target:o}:o,a=isNaN(+e)?e:+e,s=n(a,r);return R(i).map((function(e){return l(l({},e),{event:s,delay:a})}))})))).map((function(t){var n=t.delay;return l(l({},e.formatTransition(t)),{delay:n})}))},e.prototype.getStateNodes=function(e){var t,n=this;if(!e)return[];var r=e instanceof Le?e.value:E(e,this.delimiter);if(z(r)){var o=this.getStateNode(r).initial;return void 0!==o?this.getStateNodes(((t={})[r]=o,t)):[this,this.states[r]]}var i=g(r),a=[this];return a.push.apply(a,p([],h(P(i.map((function(e){return n.getStateNode(e).getStateNodes(r[e])})))),!1)),a},e.prototype.handles=function(e){var t=w(e);return this.events.includes(t)},e.prototype.resolveState=function(e){var t=Array.from(ne([],this.getStateNodes(e.value)));return new Le(l(l({},e),{value:this.resolve(e.value),configuration:t,done:se(t,this),tags:ce(t)}))},e.prototype.transitionLeafNode=function(e,t,n){var r=this.getStateNode(e).next(t,n);return r&&r.transitions.length?r:this.next(t,n)},e.prototype.transitionCompoundNode=function(e,t,n){var r=g(e),o=this.getStateNode(r[0])._transition(e[r[0]],t,n);return o&&o.transitions.length?o:this.next(t,n)},e.prototype.transitionParallelNode=function(e,t,n){var r,o,i={};try{for(var a=d(g(e)),s=a.next();!s.done;s=a.next()){var c=s.value,u=e[c];if(u){var l=this.getStateNode(c)._transition(u,t,n);l&&(i[c]=l)}}}catch(y){r={error:y}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}var f=g(i).map((function(e){return i[e]})),h=P(f.map((function(e){return e.transitions})));if(!f.some((function(e){return e.transitions.length>0})))return this.next(t,n);var p=P(f.map((function(e){return e.entrySet}))),v=P(g(i).map((function(e){return i[e].configuration})));return{transitions:h,entrySet:p,exitSet:P(f.map((function(e){return e.exitSet}))),configuration:v,source:t,actions:P(g(i).map((function(e){return i[e].actions})))}},e.prototype._transition=function(e,t,n){return z(e)?this.transitionLeafNode(e,t,n):1===g(e).length?this.transitionCompoundNode(e,t,n):this.transitionParallelNode(e,t,n)},e.prototype.getTransitionData=function(e,t){return this._transition(e.value,e,G(t))},e.prototype.next=function(e,t){var n,r,o,i=this,a=t.name,s=[],c=[];try{for(var u=d(this.getCandidates(a)),l=u.next();!l.done;l=u.next()){var f=l.value,v=f.cond,y=f.in,m=e.context,g=!y||(z(y)&&ri(y)?e.matches(E(this.getStateNodeById(y).path,this.delimiter)):b(E(y,this.delimiter),k(this.path.slice(0,-2))(e.value))),w=!1;try{w=!v||K(this.machine,v,m,t,e)}catch(O){throw new Error("Unable to evaluate guard '".concat(v.name||v.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,"':\n").concat(O.message))}if(w&&g){void 0!==f.target&&(c=f.target),s.push.apply(s,p([],h(f.actions),!1)),o=f;break}}}catch(C){n={error:C}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}if(o){if(!c.length)return{transitions:[o],entrySet:[],exitSet:[],configuration:e.value?[this]:[],source:e,actions:s};var S=P(c.map((function(t){return i.getRelativeStateNodes(t,e.historyValue)}))),x=!!o.internal;return{transitions:[o],entrySet:x?[]:P(S.map((function(e){return i.nodesFromChild(e)}))),exitSet:x?[]:[this],configuration:S,source:e,actions:s}}},e.prototype.nodesFromChild=function(e){if(e.escapes(this))return[];for(var t=[],n=e;n&&n!==this;)t.push(n),n=n.parent;return t.push(this),t},e.prototype.escapes=function(e){if(this===e)return!1;for(var t=this.parent;t;){if(t===e)return!1;t=t.parent}return!0},e.prototype.getActions=function(e,t,n,r){var o,i,a,s,c=ne([],r?this.getStateNodes(r.value):[this]),u=e.configuration.length?ne(c,e.configuration):c;try{for(var l=d(u),f=l.next();!f.done;f=l.next()){ae(c,m=f.value)||e.entrySet.push(m)}}catch(O){o={error:O}}finally{try{f&&!f.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}try{for(var v=d(c),y=v.next();!y.done;y=v.next()){var m;ae(u,m=y.value)&&!ae(e.exitSet,m.parent)||e.exitSet.push(m)}}catch(C){a={error:C}}finally{try{y&&!y.done&&(s=v.return)&&s.call(v)}finally{if(a)throw a.error}}var g=P(e.entrySet.map((function(r){var o=[];if("final"!==r.type)return o;var i=r.parent;if(!i.parent)return o;o.push(Ne(r.id,r.doneData),Ne(i.id,r.doneData?N(r.doneData,t,n):void 0));var a=i.parent;return"parallel"===a.type&&ee(a).every((function(t){return se(e.configuration,t)}))&&o.push(Ne(a.id)),o})));e.exitSet.sort((function(e,t){return t.order-e.order})),e.entrySet.sort((function(e,t){return e.order-t.order}));var b=new Set(e.entrySet),w=new Set(e.exitSet),S=h([P(Array.from(b).map((function(e){return p(p([],h(e.activities.map((function(e){return function(e){var t=Pe(e);return{type:Z.Start,activity:t,exec:void 0}}(e)}))),!1),h(e.onEntry),!1)}))).concat(g.map(Te)),P(Array.from(w).map((function(e){return p(p([],h(e.onExit),!1),h(e.activities.map((function(e){return function(e){var t=I(e)?e:Pe(e);return{type:Z.Stop,activity:t,exec:void 0}}(e)}))),!1)})))],2),E=S[0],x=S[1];return _e(x.concat(e.actions).concat(E),this.machine.options.actions)},e.prototype.transition=function(e,t,n){void 0===e&&(e=this.initialState);var r,o,i=G(t);if(e instanceof Le)r=void 0===n?e:this.resolveState(Le.from(e,n));else{var a=z(e)?this.resolve(x(this.getResolvedPath(e))):this.resolve(e),s=null!==n&&void 0!==n?n:this.machine.context;r=this.resolveState(Le.from(a,s))}if(this.strict&&!this.events.includes(i.name)&&(o=i.name,!/^(done|error)\./.test(o)))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(i.name,"'"));var c=this._transition(r.value,r,i)||{transitions:[],configuration:[],entrySet:[],exitSet:[],source:r,actions:[]},u=ne([],this.getStateNodes(r.value)),l=c.configuration.length?ne(u,c.configuration):u;return c.configuration=p([],h(l),!1),this.resolveTransition(c,r,r.context,i)},e.prototype.resolveRaisedTransition=function(e,t,n){var r,o=e.actions;return(e=this.transition(e,t))._event=n,e.event=n.data,(r=e.actions).unshift.apply(r,p([],h(o),!1)),e},e.prototype.resolveTransition=function(e,t,n,r){var o,i,a=this;void 0===r&&(r=Oe);var s=e.configuration,c=!t||e.transitions.length>0,u=c?ie(this.machine,s):void 0,f=t?t.historyValue?t.historyValue:e.source?this.machine.historyValue(t.value):void 0:void 0,p=this.getActions(e,n,r,t),v=t?l({},t.activities):{};try{for(var y=d(p),m=y.next();!m.done;m=y.next()){var g=m.value;g.type===ue?v[g.activity.id||g.activity.type]=g:g.type===le&&(v[g.activity.id||g.activity.type]=!1)}}catch(z){o={error:z}}finally{try{m&&!m.done&&(i=y.return)&&i.call(y)}finally{if(o)throw o.error}}var b,w,S=h(De(this,t,n,r,p,this.machine.config.preserveActionOrder),2),E=S[0],x=S[1],O=h(j(E,(function(e){return e.type===fe||e.type===de&&e.to===Y.Internal})),2),C=O[0],k=O[1],_=E.filter((function(e){var t;return e.type===ue&&(null===(t=e.activity)||void 0===t?void 0:t.type)===ge})).reduce((function(e,t){return e[t.activity.id]=He(t.activity,a.machine,x,r),e}),t?l({},t.children):{}),P=c?e.configuration:t?t.configuration:[],T=se(P,this),R=new Le({value:u||t.value,context:x,_event:r,_sessionid:t?t._sessionid:null,historyValue:u?f?(b=f,w=u,{current:w,states:D(b,w)}):void 0:t?t.historyValue:void 0,history:!u||e.source?t:void 0,actions:u?k:[],activities:u?v:t?t.activities:{},events:[],configuration:P,transitions:e.transitions,children:_,done:T,tags:null===t||void 0===t?void 0:t.tags,machine:this}),N=n!==x;R.changed=r.name===Se||N;var A=R.history;A&&delete A.history;var M=!T&&(this._transient||s.some((function(e){return e._transient})));if(!c&&(!M||r.name===ei))return R;var L=R;if(!T)for(M&&(L=this.resolveRaisedTransition(L,{type:pe},r));C.length;){var F=C.shift();L=this.resolveRaisedTransition(L,F._event,r)}var I=L.changed||(A?!!L.actions.length||N||typeof A.value!==typeof L.value||!Me(L.value,A.value):void 0);return L.changed=I,L.history=A,L.tags=ce(L.configuration),L},e.prototype.getStateNode=function(e){if(ri(e))return this.machine.getStateNodeById(e);if(!this.states)throw new Error("Unable to retrieve child state '".concat(e,"' from '").concat(this.id,"'; no child states exist."));var t=this.states[e];if(!t)throw new Error("Child state '".concat(e,"' does not exist on '").concat(this.id,"'"));return t},e.prototype.getStateNodeById=function(e){var t=ri(e)?e.slice("#".length):e;if(t===this.id)return this;var n=this.machine.idMap[t];if(!n)throw new Error("Child state node '#".concat(t,"' does not exist on machine '").concat(this.id,"'"));return n},e.prototype.getStateNodeByPath=function(e){if("string"===typeof e&&ri(e))try{return this.getStateNodeById(e.slice(1))}catch(o){}for(var t=S(e,this.delimiter).slice(),n=this;t.length;){var r=t.shift();if(!r.length)break;n=n.getStateNode(r)}return n},e.prototype.resolve=function(e){var t,n=this;if(!e)return this.initialStateValue||ni;switch(this.type){case"parallel":return O(this.initialStateValue,(function(t,r){return t?n.getStateNode(r).resolve(e[r]||t):ni}));case"compound":if(z(e)){var r=this.getStateNode(e);return"parallel"===r.type||"compound"===r.type?((t={})[e]=r.initialStateValue,t):e}return g(e).length?O(e,(function(e,t){return e?n.getStateNode(t).resolve(e):ni})):this.initialStateValue||{};default:return e||ni}},e.prototype.getResolvedPath=function(e){if(ri(e)){var t=this.machine.idMap[e.slice("#".length)];if(!t)throw new Error("Unable to find state node '".concat(e,"'"));return t.path}return S(e,this.delimiter)},Object.defineProperty(e.prototype,"initialStateValue",{get:function(){var e,t;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;if("parallel"===this.type)t=C(this.states,(function(e){return e.initialStateValue||ni}),(function(e){return!("history"===e.type)}));else if(void 0!==this.initial){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));t=Q(this.states[this.initial])?this.initial:((e={})[this.initial]=this.states[this.initial].initialStateValue,e)}else t={};return this.__cache.initialStateValue=t,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),e.prototype.getInitialState=function(e,t){var n=this.getStateNodes(e);return this.resolveTransition({configuration:n,entrySet:n,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,null!==t&&void 0!==t?t:this.machine.context,void 0)},Object.defineProperty(e.prototype,"initialState",{get:function(){this._init();var e=this.initialStateValue;if(!e)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){var e;if("history"===this.type){var t=this.config;e=z(t.target)&&ri(t.target)?x(this.machine.getStateNodeById(t.target).path.slice(this.path.length-1)):t.target}return e},enumerable:!1,configurable:!0}),e.prototype.getRelativeStateNodes=function(e,t,n){return void 0===n&&(n=!0),n?"history"===e.type?e.resolveHistory(t):e.initialStateNodes:[e]},Object.defineProperty(e.prototype,"initialStateNodes",{get:function(){var e=this;return Q(this)?[this]:"compound"!==this.type||this.initial?P(_(this.initialStateValue).map((function(t){return e.getFromRelativePath(t)}))):[this]},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(e){if(!e.length)return[this];var t=h(e),n=t[0],r=t.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(n,"' from node with no states"));var o=this.getStateNode(n);if("history"===o.type)return o.resolveHistory();if(!this.states[n])throw new Error("Child state '".concat(n,"' does not exist on '").concat(this.id,"'"));return this.states[n].getFromRelativePath(r)},e.prototype.historyValue=function(e){if(g(this.states).length)return{current:e||this.initialStateValue,states:C(this.states,(function(t,n){if(!e)return t.historyValue();var r=z(e)?void 0:e[n];return t.historyValue(r||t.initialStateValue)}),(function(e){return!e.history}))}},e.prototype.resolveHistory=function(e){var t=this;if("history"!==this.type)return[this];var n=this.parent;if(!e){var r=this.target;return r?P(_(r).map((function(e){return n.getFromRelativePath(e)}))):n.initialStateNodes}var o,i,a=(o=n.path,i="states",function(e){var t,n,r=e;try{for(var a=d(o),s=a.next();!s.done;s=a.next()){var c=s.value;r=r[i][c]}}catch(u){t={error:u}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return r})(e).current;return z(a)?[n.getStateNode(a)]:P(_(a).map((function(e){return"deep"===t.history?n.getFromRelativePath(e):[n.states[e[0]]]})))},Object.defineProperty(e.prototype,"stateIds",{get:function(){var e=this,t=P(g(this.states).map((function(t){return e.states[t].stateIds})));return[this.id].concat(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){var e,t,n,r;if(this.__cache.events)return this.__cache.events;var o=this.states,i=new Set(this.ownEvents);if(o)try{for(var a=d(g(o)),s=a.next();!s.done;s=a.next()){var c=o[s.value];if(c.states)try{for(var u=(n=void 0,d(c.events)),l=u.next();!l.done;l=u.next()){var f=l.value;i.add("".concat(f))}}catch(h){n={error:h}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}}catch(p){e={error:p}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return this.__cache.events=Array.from(i)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownEvents",{get:function(){var e=new Set(this.transitions.filter((function(e){return!(!e.target&&!e.actions.length&&e.internal)})).map((function(e){return e.eventType})));return Array.from(e)},enumerable:!1,configurable:!0}),e.prototype.resolveTarget=function(e){var t=this;if(void 0!==e)return e.map((function(e){if(!z(e))return e;var n=e[0]===t.delimiter;if(n&&!t.parent)return t.getStateNodeByPath(e.slice(1));var r=n?t.key+e:e;if(!t.parent)return t.getStateNodeByPath(r);try{return t.parent.getStateNodeByPath(r)}catch(o){throw new Error("Invalid transition definition for state node '".concat(t.id,"':\n").concat(o.message))}}))},e.prototype.formatTransition=function(e){var t=this,n=function(e){if(void 0!==e&&""!==e)return R(e)}(e.target),r="internal"in e?e.internal:!n||n.some((function(e){return z(e)&&e[0]===t.delimiter})),o=this.machine.options.guards,i=this.resolveTarget(n),a=l(l({},e),{actions:_e(R(e.actions)),cond:V(e.cond,o),target:i,source:this,internal:r,eventType:e.event,toJSON:function(){return l(l({},a),{target:a.target?a.target.map((function(e){return"#".concat(e.id)})):void 0,source:"#".concat(t.id)})}});return a},e.prototype.formatTransitions=function(){var e,t,n,r=this;if(this.config.on)if(Array.isArray(this.config.on))n=this.config.on;else{var o=this.config.on,i=ti,a=o[i],s=void 0===a?[]:a,c=f(o,["*"]);n=P(g(c).map((function(e){var t=W(e,c[e]);return t})).concat(W(ti,s)))}else n=[];var u=this.config.always?W("",this.config.always):[],l=this.config.onDone?W(String(Ne(this.id)),this.config.onDone):[];var v=P(this.invoke.map((function(e){var t=[];return e.onDone&&t.push.apply(t,p([],h(W(String(Ae(e.id)),e.onDone)),!1)),e.onError&&t.push.apply(t,p([],h(W(String(je(e.id)),e.onError)),!1)),t}))),y=this.after,m=P(p(p(p(p([],h(l),!1),h(v),!1),h(n),!1),h(u),!1).map((function(e){return R(e).map((function(e){return r.formatTransition(e)}))})));try{for(var b=d(y),w=b.next();!w.done;w=b.next()){var S=w.value;m.push(S)}}catch(E){e={error:E}}finally{try{w&&!w.done&&(t=b.return)&&t.call(b)}finally{if(e)throw e.error}}return m},e}();function ii(){return(ii=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}var si="undefined"!=typeof window?r.useLayoutEffect:r.useEffect;function ci(e,t,n){return t=(t=+t)==t?t:0,n=(n=+n)==n?n:0,(e=+e)==e&&(e=(e=e<=n?e:n)>=t?e:t),e}function ui(e){var t=Math.round(e);if(Number.isNaN(e))throw new TypeError("Found a NaN! Check your snapPoints / defaultSnap / snapTo ");return t}var li={box:"border-box"};function fi(e,t){var n=t.label,o=t.enabled,i=t.resizeSourceRef,a=(0,r.useState)(0),s=a[0],c=a[1];(0,r.useDebugValue)(n+": "+s);var u=(0,r.useCallback)((function(e){c(e[0].borderBoxSize[0].blockSize),i.current="element"}),[i]);return si((function(){if(e.current&&o){var t=new Zo(u);return t.observe(e.current,li),function(){t.disconnect()}}}),[e,u,o]),o?s:0}function di(e){return void 0===e&&(e=1e3),new Promise((function(t){return setTimeout(t,e)}))}var hi,pi={DRAG:{target:"#overlay.dragging",actions:"onOpenEnd"}},vi={RESIZE:{target:"#overlay.resizing",actions:"onOpenEnd"}},yi=function(e,t,n){return void 0===n&&(n=e.context),new oi(e,t,n)}({id:"overlay",initial:"closed",context:{initialState:"CLOSED"},states:{closed:{on:{OPEN:"opening",CLOSE:void 0}},opening:{initial:"start",states:{start:{invoke:{src:"onOpenStart",onDone:"transition"}},transition:{always:[{target:"immediately",cond:"initiallyOpen"},{target:"smoothly",cond:"initiallyClosed"}]},immediately:{initial:"open",states:{open:{invoke:{src:"openImmediately",onDone:"activating"}},activating:{invoke:{src:"activate",onDone:"#overlay.opening.end"},on:ii({},pi,vi)}}},smoothly:{initial:"visuallyHidden",states:{visuallyHidden:{invoke:{src:"renderVisuallyHidden",onDone:"activating"}},activating:{invoke:{src:"activate",onDone:"open"}},open:{invoke:{src:"openSmoothly",onDone:"#overlay.opening.end"},on:ii({},pi,vi)}}},end:{invoke:{src:"onOpenEnd",onDone:"done"},on:{CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:ii({},{CLOSE:{target:"#overlay.closing",actions:"onOpenCancel"}}),onDone:"open"},open:{on:{DRAG:"#overlay.dragging",SNAP:"snapping",RESIZE:"resizing"}},dragging:{on:{SNAP:"snapping"}},snapping:{initial:"start",states:{start:{invoke:{src:"onSnapStart",onDone:"snappingSmoothly"},entry:[(hi={y:function(e,t){return t.payload.y},velocity:function(e,t){return t.payload.velocity},snapSource:function(e,t){var n=t.payload.source;return void 0===n?"custom":n}},{type:ve,assignment:hi})]},snappingSmoothly:{invoke:{src:"snapSmoothly",onDone:"end"}},end:{invoke:{src:"onSnapEnd",onDone:"done"},on:{RESIZE:"#overlay.resizing",SNAP:"#overlay.snapping",CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:{SNAP:{target:"snapping",actions:"onSnapEnd"},RESIZE:{target:"#overlay.resizing",actions:"onSnapCancel"},DRAG:{target:"#overlay.dragging",actions:"onSnapCancel"},CLOSE:{target:"#overlay.closing",actions:"onSnapCancel"}},onDone:"open"},resizing:{initial:"start",states:{start:{invoke:{src:"onResizeStart",onDone:"resizingSmoothly"}},resizingSmoothly:{invoke:{src:"resizeSmoothly",onDone:"end"}},end:{invoke:{src:"onResizeEnd",onDone:"done"},on:{SNAP:"#overlay.snapping",CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:{RESIZE:{target:"resizing",actions:"onResizeEnd"},SNAP:{target:"snapping",actions:"onResizeCancel"},DRAG:{target:"#overlay.dragging",actions:"onResizeCancel"},CLOSE:{target:"#overlay.closing",actions:"onResizeCancel"}},onDone:"open"},closing:{initial:"start",states:{start:{invoke:{src:"onCloseStart",onDone:"deactivating"},on:{OPEN:{target:"#overlay.open",actions:"onCloseCancel"}}},deactivating:{invoke:{src:"deactivate",onDone:"closingSmoothly"}},closingSmoothly:{invoke:{src:"closeSmoothly",onDone:"end"}},end:{invoke:{src:"onCloseEnd",onDone:"done"},on:{OPEN:{target:"#overlay.opening",actions:"onCloseCancel"}}},done:{type:"final"}},on:{CLOSE:void 0,OPEN:{target:"#overlay.opening",actions:"onCloseCancel"}},onDone:"closed"}},on:{CLOSE:"closing"}},{actions:{onOpenCancel:function(e,t){},onSnapCancel:function(e,t){},onResizeCancel:function(e,t){},onCloseCancel:function(e,t){},onOpenEnd:function(e,t){},onSnapEnd:function(e,t){},onRezizeEnd:function(e,t){}},services:{onSnapStart:function(){try{return Promise.resolve(di()).then((function(){}))}catch(e){return Promise.reject(e)}},onOpenStart:function(){try{return Promise.resolve(di()).then((function(){}))}catch(e){return Promise.reject(e)}},onCloseStart:function(){try{return Promise.resolve(di()).then((function(){}))}catch(e){return Promise.reject(e)}},onResizeStart:function(){try{return Promise.resolve(di()).then((function(){}))}catch(e){return Promise.reject(e)}},onSnapEnd:function(){try{return Promise.resolve(di()).then((function(){}))}catch(e){return Promise.reject(e)}},onOpenEnd:function(){try{return Promise.resolve(di()).then((function(){}))}catch(e){return Promise.reject(e)}},onCloseEnd:function(){try{return Promise.resolve(di()).then((function(){}))}catch(e){return Promise.reject(e)}},onResizeEnd:function(){try{return Promise.resolve(di()).then((function(){}))}catch(e){return Promise.reject(e)}},renderVisuallyHidden:function(e,t){try{return Promise.resolve(di()).then((function(){}))}catch(e){return Promise.reject(e)}},activate:function(e,t){try{return Promise.resolve(di()).then((function(){}))}catch(e){return Promise.reject(e)}},deactivate:function(e,t){try{return Promise.resolve(di()).then((function(){}))}catch(e){return Promise.reject(e)}},openSmoothly:function(e,t){try{return Promise.resolve(di()).then((function(){}))}catch(e){return Promise.reject(e)}},openImmediately:function(e,t){try{return Promise.resolve(di()).then((function(){}))}catch(e){return Promise.reject(e)}},snapSmoothly:function(e,t){try{return Promise.resolve(di()).then((function(){}))}catch(e){return Promise.reject(e)}},resizeSmoothly:function(e,t){try{return Promise.resolve(di()).then((function(){}))}catch(e){return Promise.reject(e)}},closeSmoothly:function(e,t){try{return Promise.resolve(di()).then((function(){}))}catch(e){return Promise.reject(e)}}},guards:{initiallyClosed:function(e){return"CLOSED"===e.initialState},initiallyOpen:function(e){return"OPEN"===e.initialState}}}),mi=["children","sibling","className","footer","header","open","initialState","lastSnapRef","initialFocusRef","onDismiss","maxHeight","defaultSnap","snapPoints","blocking","scrollLocking","style","onSpringStart","onSpringCancel","onSpringEnd","reserveScrollBarGap","expandOnContentDrag"],gi=["velocity"],bi=["onRest","config"],wi={tension:170,friction:26},Si=wi.tension,Ei=wi.friction,xi=r.forwardRef((function(e,t){var n=e.children,o=e.sibling,i=e.className,a=e.footer,s=e.header,c=e.open,u=e.initialState,l=e.lastSnapRef,f=e.initialFocusRef,d=e.onDismiss,h=e.maxHeight,p=e.defaultSnap,v=void 0===p?Ci:p,y=e.snapPoints,m=void 0===y?ki:y,g=e.blocking,b=void 0===g||g,w=e.scrollLocking,S=void 0===w||w,E=e.style,x=e.onSpringStart,O=e.onSpringCancel,C=e.onSpringEnd,k=e.reserveScrollBarGap,_=void 0===k?b:k,P=e.expandOnContentDrag,T=void 0!==P&&P,R=ai(e,mi),N=function(){var e=(0,r.useState)(!1),t=e[0],n=e[1],o=(0,r.useState)({}),i=o[0],a=o[1],s=(0,r.useCallback)((function(e){return a((function(t){var n;return ii({},t,((n={})[e]=!1,n))})),function(){a((function(t){var n;return ii({},t,((n={})[e]=!0,n))}))}}),[]);return(0,r.useEffect)((function(){var e=Object.values(i);0!==e.length&&e.every(Boolean)&&n(!0)}),[i]),{ready:t,registerReady:s}}(),A=N.ready,j=N.registerReady,D=(0,r.useRef)(!1),M=(0,r.useRef)(x),L=(0,r.useRef)(O),F=(0,r.useRef)(C);(0,r.useEffect)((function(){M.current=x,L.current=O,F.current=C}),[O,x,C]);var I,z,V=(e=>{const t=mt.fun(e),n=Yt(1,t?e:[e]),r=n[0],o=n[1],i=n[2];return t?[r[0],o,i]:r})((function(){return{y:0,ready:0,maxHeight:0,minSnap:0,maxSnap:0}})),H=V[0],B=V[1],q=(0,r.useRef)(null),U=(0,r.useRef)(null),G=(0,r.useRef)(null),W=(0,r.useRef)(null),K=(0,r.useRef)(null),$=(0,r.useRef)(null),X=(0,r.useRef)(0),J=(0,r.useRef)(),Z=(0,r.useRef)(!1),Y=(I=(0,r.useMemo)((function(){return"undefined"!=typeof window?window.matchMedia("(prefers-reduced-motion: reduce)"):null}),[]),z=(0,r.useRef)(null==I?void 0:I.matches),(0,r.useDebugValue)(z.current?"reduce":"no-preference"),(0,r.useEffect)((function(){var e=function(e){z.current=e.matches};return null==I||I.addListener(e),function(){return null==I?void 0:I.removeListener(e)}}),[I]),z),Q=function(e){var t=e.targetRef,n=e.enabled,o=e.reserveScrollBarGap,i=(0,r.useRef)({activate:function(){throw new TypeError("Tried to activate scroll lock too early")},deactivate:function(){}});return(0,r.useDebugValue)(n?"Enabled":"Disabled"),(0,r.useEffect)((function(){if(!n)return i.current.deactivate(),void(i.current={activate:function(){},deactivate:function(){}});var e=t.current,r=!1;i.current={activate:function(){r||(r=!0,fo(e,{allowTouchMove:function(e){return e.closest("[data-body-scroll-lock-ignore]")},reserveScrollBarGap:o}))},deactivate:function(){var t;r&&(r=!1,(t=e)?(ro=ro.filter((function(e){return e.targetElement!==t})),no?(t.ontouchstart=null,t.ontouchmove=null,oo&&0===ro.length&&(document.removeEventListener("touchmove",uo,Qr?{passive:!1}:void 0),oo=!1)):ro.length||lo()):console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices."))}}}),[n,t,o]),i}({targetRef:U,enabled:A&&S,reserveScrollBarGap:_}),ee=function(e){var t=e.targetRef,n=e.enabled,o=(0,r.useRef)({activate:function(){throw new TypeError("Tried to activate aria hider too early")},deactivate:function(){}});return(0,r.useDebugValue)(n?"Enabled":"Disabled"),(0,r.useEffect)((function(){if(!n)return o.current.deactivate(),void(o.current={activate:function(){},deactivate:function(){}});var e=t.current,r=!1,i=[],a=[];o.current={activate:function(){if(!r){r=!0;var t=e.parentNode;document.querySelectorAll("body > *").forEach((function(e){if(e!==t){var n=e.getAttribute("aria-hidden");null!==n&&"false"!==n||(i.push(n),a.push(e),e.setAttribute("aria-hidden","true"))}}))}},deactivate:function(){r&&(r=!1,a.forEach((function(e,t){var n=i[t];null===n?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",n)})),i=[],a=[])}}}),[t,n]),o}({targetRef:q,enabled:A&&b}),te=function(e){var t=e.targetRef,n=e.fallbackRef,o=e.initialFocusRef,i=e.enabled,a=(0,r.useRef)({activate:function(){throw new TypeError("Tried to activate focus trap too early")},deactivate:function(){}});return(0,r.useDebugValue)(i?"Enabled":"Disabled"),(0,r.useEffect)((function(){if(!i)return a.current.deactivate(),void(a.current={activate:function(){},deactivate:function(){}});var e=n.current,r=Yr(t.current,{onActivate:void 0,initialFocus:o?function(){return(null==o?void 0:o.current)||e}:void 0,fallbackFocus:e,escapeDeactivates:!1,clickOutsideDeactivates:!1}),s=!1;a.current={activate:function(){try{return s?Promise.resolve():(s=!0,Promise.resolve(r.activate()).then((function(){return Promise.resolve(new Promise((function(e){return setTimeout((function(){return e(void 0)}),0)}))).then((function(){}))})))}catch(e){return Promise.reject(e)}},deactivate:function(){s&&(s=!1,r.deactivate())}}}),[i,n,o,t]),a}({targetRef:q,fallbackRef:$,initialFocusRef:f||void 0,enabled:A&&b&&!1!==f}),ne=function(e){var t=e.getSnapPoints,n=e.heightRef,o=e.lastSnapRef,i=e.ready,a=function(e){var t=e.contentRef,n=e.controlledMaxHeight,o=e.footerEnabled,i=e.footerRef,a=e.headerEnabled,s=e.headerRef,c=e.registerReady,u=e.resizeSourceRef,l=(0,r.useMemo)((function(){return c("contentHeight")}),[c]),f=function(e,t,n){var o=(0,r.useMemo)((function(){return t("maxHeight")}),[t]),i=(0,r.useState)((function(){return ui(e)||"undefined"!=typeof window?window.innerHeight:0})),a=i[0],s=i[1],c=a>0,u=(0,r.useRef)(0);return(0,r.useDebugValue)(e?"controlled":"auto"),(0,r.useEffect)((function(){c&&o()}),[c,o]),si((function(){if(e)return s(ui(e)),void(n.current="maxheightprop");var t=function(){u.current||(u.current=requestAnimationFrame((function(){s(window.innerHeight),n.current="window",u.current=0})))};return window.addEventListener("resize",t),s(window.innerHeight),n.current="window",o(),function(){window.removeEventListener("resize",t),cancelAnimationFrame(u.current)}}),[e,o,n]),a}(n,c,u),d=fi(s,{label:"headerHeight",enabled:a,resizeSourceRef:u}),h=fi(t,{label:"contentHeight",enabled:!0,resizeSourceRef:u}),p=fi(i,{label:"footerHeight",enabled:o,resizeSourceRef:u}),v=Math.min(f-d-p,h)+d+p;(0,r.useDebugValue)("minHeight: "+v);var y=h>0;return(0,r.useEffect)((function(){y&&l()}),[y,l]),{maxHeight:f,minHeight:v,headerHeight:d,footerHeight:p}}({contentRef:e.contentRef,controlledMaxHeight:e.controlledMaxHeight,footerEnabled:e.footerEnabled,footerRef:e.footerRef,headerEnabled:e.headerEnabled,headerRef:e.headerRef,registerReady:e.registerReady,resizeSourceRef:e.resizeSourceRef}),s=a.maxHeight,c=a.minHeight,u=a.headerHeight,l=a.footerHeight,f=function(e,t){var n=[].concat(e).map(ui).reduce((function(e,n){return e.add(ci(n,0,t)),e}),new Set),r=Array.from(n),o=Math.min.apply(Math,r);if(Number.isNaN(o))throw new TypeError("minSnap is NaN");var i=Math.max.apply(Math,r);if(Number.isNaN(i))throw new TypeError("maxSnap is NaN");return{snapPoints:r,minSnap:o,maxSnap:i}}(i?t({height:n.current,footerHeight:l,headerHeight:u,minHeight:c,maxHeight:s}):[0],s),d=f.snapPoints,h=f.minSnap,p=f.maxSnap;return(0,r.useDebugValue)("minSnap: "+h+", maxSnap:"+p),{minSnap:h,maxSnap:p,findSnap:function(e){var t=ui("function"==typeof e?e({footerHeight:l,headerHeight:u,height:n.current,minHeight:c,maxHeight:s,snapPoints:d,lastSnap:o.current}):e);return d.reduce((function(e,n){return Math.abs(n-t)0&&g+b=ue.current&&(S=ue.current),p===ue.current&&U.current.scrollTop>0&&(S=ue.current),Z.current=S.05?y:1,source:"dragging"}}),p):(B({y:S,ready:1,maxHeight:se.current,maxSnap:ue.current,minSnap:ce.current,immediate:!0,config:{velocity:y}}),p)}),{filterTaps:!0});if(Number.isNaN(ue.current))throw new TypeError("maxSnapRef is NaN!!");if(Number.isNaN(ce.current))throw new TypeError("minSnapRef is NaN!!");var me=function(e){var t,n=e.spring,r=Wt([n.y,n.maxHeight],(function(e,t){return Math.round(ci(t-e,0,16))+"px"})),o=Wt([n.y,n.minSnap,n.maxSnap],(function(e,t,n){return ci(e,t,n)+"px"})),i=Wt([n.y,n.minSnap,n.maxSnap],(function(e,t,n){return en?n-e+"px":"0px"})),a=Wt([n.y,n.maxSnap],(function(e,t){return e>=t?Math.ceil(e-t):0})),s=Wt([n.y,n.minSnap],(function(e,t){if(!t)return 0;var n=Math.max(t/2-45,0);return ci((e-n)*(1/(Math.min(t/2+45,t)-n)+0),0,1)})),c=Wt([n.y,n.minSnap],(function(e,t){return t?ci(e/t,0,1):0}));return(t={})["--rsbs-content-opacity"]=s,t["--rsbs-backdrop-opacity"]=c,t["--rsbs-antigap-scale-y"]=a,t["--rsbs-overlay-translate-y"]=i,t["--rsbs-overlay-rounded"]=r,t["--rsbs-overlay-h"]=o,t}({spring:H});return r.createElement(Tn.div,ii({},R,{"data-rsbs-root":!0,"data-rsbs-state":Oi.find(pe.matches),"data-rsbs-is-blocking":b,"data-rsbs-is-dismissable":!!d,"data-rsbs-has-header":!!s,"data-rsbs-has-footer":!!a,className:i,ref:q,style:ii({},me,E,{opacity:H.ready})}),o,b&&r.createElement("div",ii({key:"backdrop","data-rsbs-backdrop":!0},ye({closeOnTap:!0}))),r.createElement("div",{key:"overlay","aria-modal":"true",role:"dialog","data-rsbs-overlay":!0,tabIndex:-1,ref:$,onKeyDown:function(e){"Escape"===e.key&&(e.stopPropagation(),d&&d())}},!1!==s&&r.createElement("div",ii({key:"header","data-rsbs-header":!0,ref:W},ye()),s),r.createElement("div",ii({key:"scroll","data-rsbs-scroll":!0,ref:U},T?ye({isContentDragging:!0}):{}),r.createElement("div",{"data-rsbs-content":!0,ref:G},n)),a&&r.createElement("div",ii({key:"footer",ref:K,"data-rsbs-footer":!0},ye()),a)))})),Oi=["closed","opening","open","closing","dragging","snapping","resizing"];function Ci(e){var t=e.lastSnap;return null!=t?t:Math.min.apply(Math,e.snapPoints)}function ki(e){return e.minHeight}var _i=["onSpringStart","onSpringEnd","skipInitialTransition"],Pi=(0,r.forwardRef)((function(e,t){var n=e.onSpringStart,o=e.onSpringEnd,i=e.skipInitialTransition,a=ai(e,_i),s=(0,r.useState)(!1),c=s[0],l=s[1],f=(0,r.useRef)(),d=(0,r.useRef)(null),h=(0,r.useRef)(i&&a.open?"OPEN":"CLOSED");si((function(){if(a.open)return cancelAnimationFrame(f.current),l(!0),function(){h.current="CLOSED"}}),[a.open]);var p=(0,r.useCallback)((function(e){try{return Promise.resolve(null==n?void 0:n(e)).then((function(){"OPEN"===e.type&&cancelAnimationFrame(f.current)}))}catch(e){return Promise.reject(e)}}),[n]),v=(0,r.useCallback)((function(e){try{return Promise.resolve(null==o?void 0:o(e)).then((function(){"CLOSE"===e.type&&(f.current=requestAnimationFrame((function(){return l(!1)})))}))}catch(e){return Promise.reject(e)}}),[o]);return c?r.createElement(u,{"data-rsbs-portal":!0},r.createElement(xi,ii({},a,{lastSnapRef:d,ref:t,initialState:h.current,onSpringStart:p,onSpringEnd:v}))):null}))},45982:function(e){"use strict";var t=function(){};e.exports=t},7328:function(e,t,n){"use strict";function r(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}n.d(t,{Z:function(){return r}})}}]);