(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4272],{54272:function(t,e,n){"use strict";n.d(e,{Z:function(){return Wo}});n(82526),n(57327),n(41539),n(54747),n(49337);var r=n(59499),i=n(4730),o=n(84481),a=n.n(o),s=(n(42473),c()?o.useLayoutEffect:o.useEffect);"undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math&&self;function c(){return!("undefined"===typeof window||!window.document||!window.document.createElement)}var u=n(97170);var l=function(t){var e=t.children,n=t.type,r=void 0===n?"reach-portal":n,i=(0,o.useRef)(null),a=(0,o.useRef)(null),c=function(){var t=(0,o.useState)(Object.create(null))[1];return(0,o.useCallback)((function(){t(Object.create(null))}),[])}();return s((function(){if(i.current){var t=i.current.ownerDocument;return a.current=null==t?void 0:t.createElement(r),t.body.appendChild(a.current),c(),function(){a.current&&a.current.ownerDocument&&a.current.ownerDocument.body.removeChild(a.current)}}}),[r,c]),a.current?(0,u.createPortal)(e,a.current):(0,o.createElement)("span",{ref:i})},f=function(){return f=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},f.apply(this,arguments)};function d(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function h(t){var e="function"===typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"===typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(t,e){var n="function"===typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function p(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}var y,g,m={},b="xstate.guard";!function(t){t.Start="xstate.start",t.Stop="xstate.stop",t.Raise="xstate.raise",t.Send="xstate.send",t.Cancel="xstate.cancel",t.NullEvent="",t.Assign="xstate.assign",t.After="xstate.after",t.DoneState="done.state",t.DoneInvoke="done.invoke",t.Log="xstate.log",t.Init="xstate.init",t.Invoke="xstate.invoke",t.ErrorExecution="error.execution",t.ErrorCommunication="error.communication",t.ErrorPlatform="error.platform",t.ErrorCustom="xstate.error",t.Update="xstate.update",t.Pure="xstate.pure",t.Choose="xstate.choose"}(y||(y={})),function(t){t.Parent="#_parent",t.Internal="#_internal"}(g||(g={}));var w,S=y.Start,x=y.Stop,E=y.Raise,O=y.Send,k=y.Cancel,_=y.NullEvent,P=y.Assign,T=(y.After,y.DoneState,y.Log),R=y.Init,C=y.Invoke,j=(y.ErrorExecution,y.ErrorPlatform),N=y.ErrorCustom,A=y.Update,D=y.Choose,L=y.Pure;function I(t,e,n){void 0===n&&(n=".");var r=z(t,n),i=z(e,n);return et(i)?!!et(r)&&i===r:et(r)?r in i:Object.keys(r).every((function(t){return t in i&&I(r[t],i[t])}))}function M(t){try{return et(t)||"number"===typeof t?"".concat(t):t.type}catch(e){throw new Error("Events must be strings or objects with a string event.type property.")}}function V(t,e){try{return Y(t)?t:t.toString().split(e)}catch(n){throw new Error("'".concat(t,"' is not a valid state path."))}}function z(t,e){return"object"===typeof(n=t)&&"value"in n&&"context"in n&&"event"in n&&"_event"in n?t.value:Y(t)?F(t):"string"!==typeof t?t:F(V(t,e));var n}function F(t){if(1===t.length)return t[0];for(var e={},n=e,r=0;r<t.length-1;r++)r===t.length-2?n[t[r]]=t[r+1]:(n[t[r]]={},n=n[t[r]]);return e}function B(t,e){for(var n={},r=Object.keys(t),i=0;i<r.length;i++){var o=r[i];n[o]=e(t[o],o,t,i)}return n}function H(t,e,n){var r,i,o={};try{for(var a=h(Object.keys(t)),s=a.next();!s.done;s=a.next()){var c=s.value,u=t[c];n(u)&&(o[c]=e(u,c,t))}}catch(l){r={error:l}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}var G=function(t){return function(e){var n,r,i=e;try{for(var o=h(t),a=o.next();!a.done;a=o.next()){i=i[a.value]}}catch(s){n={error:s}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}};function Z(t){return t?et(t)?[[t]]:q(Object.keys(t).map((function(e){var n=t[e];return"string"===typeof n||n&&Object.keys(n).length?Z(t[e]).map((function(t){return[e].concat(t)})):[[e]]}))):[[]]}function q(t){var e;return(e=[]).concat.apply(e,p([],v(t),!1))}function K(t){return Y(t)?t:[t]}function $(t){return void 0===t?[]:K(t)}function U(t,e,n){var r,i;if(tt(t))return t(e,n.data);var o={};try{for(var a=h(Object.keys(t)),s=a.next();!s.done;s=a.next()){var c=s.value,u=t[c];tt(u)?o[c]=u(e,n.data):o[c]=u}}catch(l){r={error:l}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}function W(t){return t instanceof Promise||!(null===t||!tt(t)&&"object"!==typeof t||!tt(t.then))}function X(t,e){return B(t.states,(function(t,n){if(t){var r=(et(e)?void 0:e[n])||(t?t.current:void 0);if(r)return{current:r,states:X(t,r)}}}))}function J(t,e,n,r){var i=t?n.reduce((function(t,n){var i,o,a=n.assignment,s={state:r,action:n,_event:e},c={};if(tt(a))c=a(t,e.data,s);else try{for(var u=h(Object.keys(a)),l=u.next();!l.done;l=u.next()){var f=l.value,d=a[f];c[f]=tt(d)?d(t,e.data,s):d}}catch(v){i={error:v}}finally{try{l&&!l.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}return Object.assign({},t,c)}),t):t;return i}var Q=function(){};function Y(t){return Array.isArray(t)}function tt(t){return"function"===typeof t}function et(t){return"string"===typeof t}function nt(t,e){if(t)return et(t)?{type:b,name:t,predicate:e?e[t]:void 0}:tt(t)?{type:b,name:t.name,predicate:t}:t}var rt=function(){return"function"===typeof Symbol&&Symbol.observable||"@@observable"}();(w={})[rt]=function(){return this},w[Symbol.observable]=function(){return this};function it(t){return!!t&&"__xstatenode"in t}function ot(t,e){return et(t)||"number"===typeof t?f({type:t},e):t}function at(t,e){if(!et(t)&&"$$type"in t&&"scxml"===t.$$type)return t;var n=ot(t);return f({name:n.type,data:n,$$type:"scxml",type:"external"},e)}function st(t,e){return K(e).map((function(e){return"undefined"===typeof e||"string"===typeof e||it(e)?{target:e,event:t}:f(f({},e),{event:t})}))}function ct(t,e,n,r,i){var o=t.options.guards,a={state:i,cond:e,_event:r};if(e.type===b)return((null===o||void 0===o?void 0:o[e.name])||e.predicate)(n,r.data,a);var s=null===o||void 0===o?void 0:o[e.type];if(!s)throw new Error("Guard '".concat(e.type,"' is not implemented on machine '").concat(t.id,"'."));return s(n,r.data,a)}function ut(t){return"string"===typeof t?{type:t}:t}function lt(t,e,n){var r=function(){},i="object"===typeof t,o=i?t:null;return{next:((i?t.next:t)||r).bind(o),error:((i?t.error:e)||r).bind(o),complete:((i?t.complete:n)||r).bind(o)}}function ft(t,e){return"".concat(t,":invocation[").concat(e,"]")}function dt(t){return(t.type===E||t.type===O&&t.to===g.Internal)&&"number"!==typeof t.delay}var ht=function(t){return"atomic"===t.type||"final"===t.type};function vt(t){return Object.keys(t.states).map((function(e){return t.states[e]}))}function pt(t){return vt(t).filter((function(t){return"history"!==t.type}))}function yt(t){var e=[t];return ht(t)?e:e.concat(q(pt(t).map(yt)))}function gt(t,e){var n,r,i,o,a,s,c,u,l=bt(new Set(t)),f=new Set(e);try{for(var d=h(f),v=d.next();!v.done;v=d.next())for(var p=(O=v.value).parent;p&&!f.has(p);)f.add(p),p=p.parent}catch(k){n={error:k}}finally{try{v&&!v.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}var y=bt(f);try{for(var g=h(f),m=g.next();!m.done;m=g.next()){if("compound"!==(O=m.value).type||y.get(O)&&y.get(O).length){if("parallel"===O.type)try{for(var b=(a=void 0,h(pt(O))),w=b.next();!w.done;w=b.next()){var S=w.value;f.has(S)||(f.add(S),l.get(S)?l.get(S).forEach((function(t){return f.add(t)})):S.initialStateNodes.forEach((function(t){return f.add(t)})))}}catch(_){a={error:_}}finally{try{w&&!w.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}}else l.get(O)?l.get(O).forEach((function(t){return f.add(t)})):O.initialStateNodes.forEach((function(t){return f.add(t)}))}}catch(P){i={error:P}}finally{try{m&&!m.done&&(o=g.return)&&o.call(g)}finally{if(i)throw i.error}}try{for(var x=h(f),E=x.next();!E.done;E=x.next()){var O;for(p=(O=E.value).parent;p&&!f.has(p);)f.add(p),p=p.parent}}catch(T){c={error:T}}finally{try{E&&!E.done&&(u=x.return)&&u.call(x)}finally{if(c)throw c.error}}return f}function mt(t,e){var n=e.get(t);if(!n)return{};if("compound"===t.type){var r=n[0];if(!r)return{};if(ht(r))return r.key}var i={};return n.forEach((function(t){i[t.key]=mt(t,e)})),i}function bt(t){var e,n,r=new Map;try{for(var i=h(t),o=i.next();!o.done;o=i.next()){var a=o.value;r.has(a)||r.set(a,[]),a.parent&&(r.has(a.parent)||r.set(a.parent,[]),r.get(a.parent).push(a))}}catch(s){e={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}function wt(t,e){return mt(t,bt(gt([t],e)))}function St(t,e){return Array.isArray(t)?t.some((function(t){return t===e})):t instanceof Set&&t.has(e)}function xt(t,e){return"compound"===e.type?pt(e).some((function(e){return"final"===e.type&&St(t,e)})):"parallel"===e.type&&pt(e).every((function(e){return xt(t,e)}))}function Et(t){return new Set(q(t.map((function(t){return t.tags}))))}var Ot=at({type:R});function kt(t,e){return e&&e[t]||void 0}function _t(t,e){var n;if(et(t)||"number"===typeof t)n=tt(r=kt(t,e))?{type:t,exec:r}:r||{type:t,exec:void 0};else if(tt(t))n={type:t.name||t.toString(),exec:t};else{var r;if(tt(r=kt(t.type,e)))n=f(f({},t),{exec:r});else if(r){var i=r.type||t.type;n=f(f(f({},r),t),{type:i})}else n=t}return n}var Pt=function(t,e){return t?(Y(t)?t:[t]).map((function(t){return _t(t,e)})):[]};function Tt(t){var e=_t(t);return f(f({id:et(t)?t:e.id},e),{type:e.type})}function Rt(t,e){return{to:e?e.to:void 0,type:O,event:tt(t)?t:ot(t),delay:e?e.delay:void 0,id:e&&void 0!==e.id?e.id:tt(t)?t.name:M(t)}}function Ct(t,e){var n="".concat(y.DoneState,".").concat(t),r={type:n,data:e,toString:function(){return n}};return r}function jt(t,e){var n="".concat(y.DoneInvoke,".").concat(t),r={type:n,data:e,toString:function(){return n}};return r}function Nt(t,e){var n="".concat(y.ErrorPlatform,".").concat(t),r={type:n,data:e,toString:function(){return n}};return r}function At(t,e,n,r,i,o,a){void 0===a&&(a=!1);var s=a?[]:function(t){var e,n,r=[];try{for(var i=h(t),o=i.next();!o.done;o=i.next())for(var a=o.value,s=0;s<a.actions.length;)a.actions[s].type!==P?s++:(r.push(a.actions[s]),a.actions.splice(s,1))}catch(c){e={error:c}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}(i),c=s.length?J(n,r,s,e):n,u=a?[n]:void 0,l=[];function d(i,s){var d;switch(s.type){case E:var h=function(t,e,n,r){var i,o={_event:n},a=at(tt(t.event)?t.event(e,n.data,o):t.event);if(et(t.delay)){var s=r&&r[t.delay];i=tt(s)?s(e,n.data,o):s}else i=tt(t.delay)?t.delay(e,n.data,o):t.delay;return f(f({},t),{type:E,_event:a,delay:i})}(s,c,r,t.options.delays);return o&&"number"===typeof h.delay&&o(h,c,r),h;case O:var m=function(t,e,n,r){var i,o={_event:n},a=at(tt(t.event)?t.event(e,n.data,o):t.event);if(et(t.delay)){var s=r&&r[t.delay];i=tt(s)?s(e,n.data,o):s}else i=tt(t.delay)?t.delay(e,n.data,o):t.delay;var c=tt(t.to)?t.to(e,n.data,o):t.to;return f(f({},t),{to:c,_event:a,event:a.data,delay:i})}(s,c,r,t.options.delays);return o&&m.to!==g.Internal&&("entry"===i?l.push(m):o(m,c,r)),m;case T:var b=function(t,e,n){return f(f({},t),{value:et(t.expr)?t.expr:t.expr(e,n.data,{_event:n})})}(s,c,r);return null===o||void 0===o||o(b,c,r),b;case D:if(!(_=null===(d=s.conds.find((function(n){var i=nt(n.cond,t.options.guards);return!i||ct(t,i,c,r,o?void 0:e)})))||void 0===d?void 0:d.actions))return[];var w=v(At(t,e,c,r,[{type:i,actions:Pt($(_),t.options.actions)}],o,a),2),S=w[0],k=w[1];return c=k,null===u||void 0===u||u.push(c),S;case L:var _;if(!(_=s.get(c,r.data)))return[];var R=v(At(t,e,c,r,[{type:i,actions:Pt($(_),t.options.actions)}],o,a),2),C=R[0],j=R[1];return c=j,null===u||void 0===u||u.push(c),C;case x:b=function(t,e,n){var r=tt(t.activity)?t.activity(e,n.data):t.activity,i="string"===typeof r?{id:r}:r;return{type:y.Stop,activity:i}}(s,c,r);return null===o||void 0===o||o(b,n,r),b;case P:c=J(c,r,[s],o?void 0:e),null===u||void 0===u||u.push(c);break;default:var N=_t(s,t.options.actions),A=N.exec;if(o)o(N,c,r);else if(A&&u){var I=u.length-1,M=f(f({},N),{exec:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];A.apply(void 0,p([u[I]],v(e),!1))}});N=M}return N}}var m=q(i.map((function(t){var e,n,i=[];try{for(var a=h(t.actions),s=a.next();!s.done;s=a.next()){var u=s.value,f=d(t.type,u);f&&(i=i.concat(f))}}catch(v){e={error:v}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return l.forEach((function(t){o(t,c,r)})),l.length=0,i})));return[m,c]}function Dt(t,e){if(t===e)return!0;if(void 0===t||void 0===e)return!1;if(et(t)||et(e))return t===e;var n=Object.keys(t),r=Object.keys(e);return n.length===r.length&&n.every((function(n){return Dt(t[n],e[n])}))}function Lt(t){return"object"===typeof t&&null!==t&&("value"in t&&"_event"in t)}var It=function(){function t(t){var e,n,r=this;this.actions=[],this.activities=m,this.meta={},this.events=[],this.value=t.value,this.context=t.context,this._event=t._event,this._sessionid=t._sessionid,this.event=this._event.data,this.historyValue=t.historyValue,this.history=t.history,this.actions=t.actions||[],this.activities=t.activities||m,this.meta=(void 0===(n=t.configuration)&&(n=[]),n.reduce((function(t,e){return void 0!==e.meta&&(t[e.id]=e.meta),t}),{})),this.events=t.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=t.configuration,this.transitions=t.transitions,this.children=t.children,this.done=!!t.done,this.tags=null!==(e=Array.isArray(t.tags)?new Set(t.tags):t.tags)&&void 0!==e?e:new Set,this.machine=t.machine,Object.defineProperty(this,"nextEvents",{get:function(){return function(t){return p([],v(new Set(q(p([],v(t.map((function(t){return t.ownEvents}))),!1)))),!1)}(r.configuration)}})}return t.from=function(e,n){return e instanceof t?e.context!==n?new t({value:e.value,context:n,_event:e._event,_sessionid:null,historyValue:e.historyValue,history:e.history,actions:[],activities:e.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):e:new t({value:e,context:n,_event:Ot,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},t.create=function(e){return new t(e)},t.inert=function(e,n){if(e instanceof t){if(!e.actions.length)return e;var r=Ot;return new t({value:e.value,context:n,_event:r,_sessionid:null,historyValue:e.historyValue,history:e.history,activities:e.activities,configuration:e.configuration,transitions:[],children:{}})}return t.from(e,n)},t.prototype.toStrings=function(t,e){var n=this;if(void 0===t&&(t=this.value),void 0===e&&(e="."),et(t))return[t];var r=Object.keys(t);return r.concat.apply(r,p([],v(r.map((function(r){return n.toStrings(t[r],e).map((function(t){return r+e+t}))}))),!1))},t.prototype.toJSON=function(){var t=this;t.configuration,t.transitions;var e=t.tags;t.machine;var n=d(t,["configuration","transitions","tags","machine"]);return f(f({},n),{tags:Array.from(e)})},t.prototype.matches=function(t){return I(t,this.value)},t.prototype.hasTag=function(t){return this.tags.has(t)},t.prototype.can=function(t){var e;Q(!!this.machine,"state.can(...) used outside of a machine-created State object; this will always return false.");var n=null===(e=this.machine)||void 0===e?void 0:e.getTransitionData(this,t);return!!(null===n||void 0===n?void 0:n.transitions.length)&&n.transitions.some((function(t){return void 0!==t.target||t.actions.length}))},t}(),Mt=n(73469),Vt={deferEvents:!1},zt=function(){function t(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=f(f({},Vt),t)}return t.prototype.initialize=function(t){if(this.initialized=!0,t){if(!this.options.deferEvents)return void this.schedule(t);this.process(t)}this.flushEvents()},t.prototype.schedule=function(t){if(this.initialized&&!this.processingEvent){if(0!==this.queue.length)throw new Error("Event queue should be empty when it is not processing events");this.process(t),this.flushEvents()}else this.queue.push(t)},t.prototype.clear=function(){this.queue=[]},t.prototype.flushEvents=function(){for(var t=this.queue.shift();t;)this.process(t),t=this.queue.shift()},t.prototype.process=function(t){this.processingEvent=!0;try{t()}catch(e){throw this.clear(),e}finally{this.processingEvent=!1}},t}(),Ft=[],Bt=function(t,e){Ft.push(t);var n=e(t);return Ft.pop(),n};function Ht(t){var e;return(e={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:t}}})[rt]=function(){return this},e}function Gt(t,e,n){var r=Ht(e);if(r.deferred=!0,it(t)){var i=r.state=Bt(void 0,(function(){return(n?t.withContext(n):t).initialState}));r.getSnapshot=function(){return i}}return r}var Zt=new Map,qt=0,Kt=function(){return"x:".concat(qt++)},$t=function(t,e){return Zt.set(t,e),t},Ut=function(t){return Zt.get(t)},Wt=function(t){Zt.delete(t)};function Xt(){return"undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:"undefined"!==typeof window?window:"undefined"!==typeof n.g?n.g:void 0}function Jt(t){if(Xt()){var e=function(){var t=Xt();if(t&&"__xstate__"in t)return t.__xstate__}();e&&e.register(t)}}function Qt(t,e){void 0===e&&(e={});var n=t.initialState,r=new Set,i=[],o=!1,a=function(t){var e;return f(((e={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}})[rt]=function(){return this},e),t)}({id:e.id,send:function(e){i.push(e),function(){if(!o){for(o=!0;i.length>0;){var e=i.shift();n=t.transition(n,e,s),r.forEach((function(t){return t.next(n)}))}o=!1}}()},getSnapshot:function(){return n},subscribe:function(t,e,i){var o=lt(t,e,i);return r.add(o),o.next(n),{unsubscribe:function(){r.delete(o)}}}}),s={parent:e.parent,self:a,id:e.id||"anonymous",observers:r};return n=t.start?t.start(s):n,a}var Yt,te={sync:!1,autoForward:!1};!function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(Yt||(Yt={}));var ee,ne=function(){function t(e,n){void 0===n&&(n=t.defaultOptions);var r=this;this.machine=e,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=Yt.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(t,e){if(Y(t))return r.batch(t),r.state;var n=at(ot(t,e));if(r.status===Yt.Stopped)return r.state;if(r.status!==Yt.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 t=r._nextState(n);r.update(t,n)})),r._state},this.sendTo=function(t,e,n){var i,o=r.parent&&(e===g.Parent||r.parent.id===e),a=o?r.parent:et(e)?e===g.Internal?r:r.children.get(e)||Ut(e):(i=e)&&"function"===typeof i.send?e:void 0;if(a)if("machine"in a){if(r.status!==Yt.Stopped||r.parent!==a||r.state.done){var s=f(f({},t),{name:t.name===N?"".concat(Nt(r.id)):t.name,origin:r.sessionId});!n&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([a,s]):a.send(s)}}else!n&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([a,t.data]):a.send(t.data);else if(!o)throw new Error("Unable to send event to child '".concat(e,"' from service '").concat(r.id,"'."))},this._exec=function(t,e,n,i){void 0===i&&(i=r.machine.options.actions);var o=t.exec||kt(t.type,i),a=tt(o)?o:o?o.exec:t.exec;if(a)try{return a(e,n.data,r.machine.config.predictableActionArguments?{action:t,_event:n}:{action:t,state:r.state,_event:n})}catch(P){throw r.parent&&r.parent.send({type:"xstate.error",data:P}),P}switch(t.type){case E:var s=t;r.defer(s);break;case O:var c=t;if("number"===typeof c.delay)return void r.defer(c);c.to?r.sendTo(c._event,c.to,n===Ot):r.send(c._event);break;case k:r.cancel(t.sendId);break;case S:if(r.status!==Yt.Running)return;var u=t.activity;if(!r.machine.config.predictableActionArguments&&!r.state.activities[u.id||u.type])break;if(u.type===y.Invoke){var l=ut(u.src),f=r.machine.options.services?r.machine.options.services[l.type]:void 0,d=u.id,h=u.data;0;var v="autoForward"in u?u.autoForward:!!u.forward;if(!f)return void 0;var p=h?U(h,e,n):void 0;if("string"===typeof f)return;var g=tt(f)?f(e,n.data,{data:p,src:l,meta:u.meta}):f;if(!g)return;var m=void 0;it(g)&&(g=p?g.withContext(p):g,m={autoForward:v}),r.spawn(g,d,m)}else r.spawnActivity(u);break;case x:r.stopChild(t.activity.id);break;case T:var b=t,w=b.label,_=b.value;w?r.logger(w,_):r.logger(_)}};var i=f(f({},t.defaultOptions),n),o=i.clock,a=i.logger,s=i.parent,c=i.id,u=void 0!==c?c:e.id;this.id=u,this.logger=a,this.clock=o,this.parent=s,this.options=i,this.scheduler=new zt({deferEvents:this.options.deferEvents}),this.sessionId=Kt()}return Object.defineProperty(t.prototype,"initialState",{get:function(){var t=this;return this._initialState?this._initialState:Bt(this,(function(){return t._initialState=t.machine.initialState,t._initialState}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),t.prototype.execute=function(t,e){var n,r;try{for(var i=h(t.actions),o=i.next();!o.done;o=i.next()){var a=o.value;this.exec(a,t,e)}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},t.prototype.update=function(t,e){var n,r,i,o,a,s,c,u,l=this;if(t._sessionid=this.sessionId,this._state=t,this.machine.config.predictableActionArguments&&e!==Ot||!this.options.execute)for(var f=void 0;f=this._outgoingQueue.shift();)f[0].send(f[1]);else this.execute(this.state);if(this.children.forEach((function(t){l.state.children[t.id]=t})),this.devTools&&this.devTools.send(e.data,t),t.event)try{for(var d=h(this.eventListeners),v=d.next();!v.done;v=d.next()){(0,v.value)(t.event)}}catch(E){n={error:E}}finally{try{v&&!v.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}try{for(var p=h(this.listeners),y=p.next();!y.done;y=p.next()){(0,y.value)(t,t.event)}}catch(O){i={error:O}}finally{try{y&&!y.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}try{for(var g=h(this.contextListeners),m=g.next();!m.done;m=g.next()){(0,m.value)(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(k){a={error:k}}finally{try{m&&!m.done&&(s=g.return)&&s.call(g)}finally{if(a)throw a.error}}if(this.state.done){var b=t.configuration.find((function(t){return"final"===t.type&&t.parent===l.machine})),w=b&&b.doneData?U(b.doneData,t.context,e):void 0;this._doneEvent=jt(this.id,w);try{for(var S=h(this.doneListeners),x=S.next();!x.done;x=S.next()){(0,x.value)(this._doneEvent)}}catch(_){c={error:_}}finally{try{x&&!x.done&&(u=S.return)&&u.call(S)}finally{if(c)throw c.error}}this._stop(),this._stopChildren(),Wt(this.sessionId)}},t.prototype.onTransition=function(t){return this.listeners.add(t),this.status===Yt.Running&&t(this.state,this.state.event),this},t.prototype.subscribe=function(t,e,n){var r=this,i=lt(t,e,n);this.listeners.add(i.next),this.status!==Yt.NotStarted&&i.next(this.state);var o=function(){r.doneListeners.delete(o),r.stopListeners.delete(o),i.complete()};return this.status===Yt.Stopped?i.complete():(this.onDone(o),this.onStop(o)),{unsubscribe:function(){r.listeners.delete(i.next),r.doneListeners.delete(o),r.stopListeners.delete(o)}}},t.prototype.onEvent=function(t){return this.eventListeners.add(t),this},t.prototype.onSend=function(t){return this.sendListeners.add(t),this},t.prototype.onChange=function(t){return this.contextListeners.add(t),this},t.prototype.onStop=function(t){return this.stopListeners.add(t),this},t.prototype.onDone=function(t){return this.status===Yt.Stopped&&this._doneEvent?t(this._doneEvent):this.doneListeners.add(t),this},t.prototype.off=function(t){return this.listeners.delete(t),this.eventListeners.delete(t),this.sendListeners.delete(t),this.stopListeners.delete(t),this.doneListeners.delete(t),this.contextListeners.delete(t),this},t.prototype.start=function(t){var e=this;if(this.status===Yt.Running)return this;this.machine._init(),$t(this.sessionId,this),this.initialized=!0,this.status=Yt.Running;var n=void 0===t?this.initialState:Bt(this,(function(){return Lt(t)?e.machine.resolveState(t):e.machine.resolveState(It.from(t,e.machine.context))}));return this.options.devTools&&this.attachDev(),this.scheduler.initialize((function(){e.update(n,Ot)})),this},t.prototype._stopChildren=function(){this.children.forEach((function(t){tt(t.stop)&&t.stop()})),this.children.clear()},t.prototype._stop=function(){var t,e,n,r,i,o,a,s,c,u;try{for(var l=h(this.listeners),f=l.next();!f.done;f=l.next()){var d=f.value;this.listeners.delete(d)}}catch(E){t={error:E}}finally{try{f&&!f.done&&(e=l.return)&&e.call(l)}finally{if(t)throw t.error}}try{for(var v=h(this.stopListeners),p=v.next();!p.done;p=v.next()){(d=p.value)(),this.stopListeners.delete(d)}}catch(O){n={error:O}}finally{try{p&&!p.done&&(r=v.return)&&r.call(v)}finally{if(n)throw n.error}}try{for(var y=h(this.contextListeners),g=y.next();!g.done;g=y.next()){d=g.value;this.contextListeners.delete(d)}}catch(k){i={error:k}}finally{try{g&&!g.done&&(o=y.return)&&o.call(y)}finally{if(i)throw i.error}}try{for(var m=h(this.doneListeners),b=m.next();!b.done;b=m.next()){d=b.value;this.doneListeners.delete(d)}}catch(_){a={error:_}}finally{try{b&&!b.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}if(!this.initialized)return this;this.initialized=!1,this.status=Yt.Stopped,this._initialState=void 0;try{for(var w=h(Object.keys(this.delayedEventsMap)),S=w.next();!S.done;S=w.next()){var x=S.value;this.clock.clearTimeout(this.delayedEventsMap[x])}}catch(P){c={error:P}}finally{try{S&&!S.done&&(u=w.return)&&u.call(w)}finally{if(c)throw c.error}}this.scheduler.clear(),this.scheduler=new zt({deferEvents:this.options.deferEvents})},t.prototype.stop=function(){var t=this,e=this.scheduler;return this._stop(),e.schedule((function(){var e;if(!(null===(e=t._state)||void 0===e?void 0:e.done)){var n=at({type:"xstate.stop"}),r=Bt(t,(function(){var e=q(p([],v(t.state.configuration),!1).sort((function(t,e){return e.order-t.order})).map((function(e){return Pt(e.onExit,t.machine.options.actions)}))),r=v(At(t.machine,t.state,t.state.context,n,[{type:"exit",actions:e}],t.machine.config.predictableActionArguments?t._exec:void 0,t.machine.config.predictableActionArguments||t.machine.config.preserveActionOrder),2),i=r[0],o=r[1],a=new It({value:t.state.value,context:o,_event:n,_sessionid:t.sessionId,historyValue:void 0,history:t.state,actions:i.filter((function(t){return!dt(t)})),activities:{},events:[],configuration:[],transitions:[],children:{},done:t.state.done,tags:t.state.tags,machine:t.machine});return a.changed=!0,a}));t.update(r,n),t._stopChildren(),Wt(t.sessionId)}})),this},t.prototype.batch=function(t){var e=this;if(this.status===Yt.NotStarted&&this.options.deferEvents)0;else if(this.status!==Yt.Running)throw new Error("".concat(t.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.'));if(t.length){var n=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule((function(){var r,i,o=e.state,a=!1,s=[],c=function(t){var r=at(t);e.forward(r),o=Bt(e,(function(){return e.machine.transition(o,r,void 0,n||void 0)})),s.push.apply(s,p([],v(e.machine.config.predictableActionArguments?o.actions:o.actions.map((function(t){return function(t,e){var n=t.exec;return f(f({},t),{exec:void 0!==n?function(){return n(e.context,e.event,{action:t,state:e,_event:e._event})}:void 0})}(t,o)}))),!1)),a=a||!!o.changed};try{for(var u=h(t),l=u.next();!l.done;l=u.next()){c(l.value)}}catch(d){r={error:d}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}o.changed=a,o.actions=s,e.update(o,at(t[t.length-1]))}))}},t.prototype.sender=function(t){return this.send.bind(this,t)},t.prototype._nextState=function(t,e){var n=this;void 0===e&&(e=!!this.machine.config.predictableActionArguments&&this._exec);var r=at(t);if(0===r.name.indexOf(j)&&!this.state.nextEvents.some((function(t){return 0===t.indexOf(j)})))throw r.data.data;return Bt(this,(function(){return n.machine.transition(n.state,r,void 0,e||void 0)}))},t.prototype.nextState=function(t){return this._nextState(t,!1)},t.prototype.forward=function(t){var e,n;try{for(var r=h(this.forwardTo),i=r.next();!i.done;i=r.next()){var o=i.value,a=this.children.get(o);if(!a)throw new Error("Unable to forward event '".concat(t,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(o,"'."));a.send(t)}}catch(s){e={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.defer=function(t){var e=this,n=this.clock.setTimeout((function(){"to"in t&&t.to?e.sendTo(t._event,t.to,!0):e.send(t._event)}),t.delay);t.id&&(this.delayedEventsMap[t.id]=n)},t.prototype.cancel=function(t){this.clock.clearTimeout(this.delayedEventsMap[t]),delete this.delayedEventsMap[t]},t.prototype.exec=function(t,e,n){void 0===n&&(n=this.machine.options.actions),this._exec(t,e.context,e._event,n)},t.prototype.removeChild=function(t){var e;this.children.delete(t),this.forwardTo.delete(t),null===(e=this.state)||void 0===e||delete e.children[t]},t.prototype.stopChild=function(t){var e=this.children.get(t);e&&(this.removeChild(t),tt(e.stop)&&e.stop())},t.prototype.spawn=function(t,e,n){if(this.status!==Yt.Running)return Gt(t,e);if(W(t))return this.spawnPromise(Promise.resolve(t),e);if(tt(t))return this.spawnCallback(t,e);if(function(t){try{return"function"===typeof t.send}catch(e){return!1}}(i=t)&&"id"in i)return this.spawnActor(t,e);if(function(t){try{return"subscribe"in t&&tt(t.subscribe)}catch(e){return!1}}(t))return this.spawnObservable(t,e);if(it(t))return this.spawnMachine(t,f(f({},n),{id:e}));if(null!==(r=t)&&"object"===typeof r&&"transition"in r&&"function"===typeof r.transition)return this.spawnBehavior(t,e);throw new Error('Unable to spawn entity "'.concat(e,'" of type "').concat(typeof t,'".'));var r,i},t.prototype.spawnMachine=function(e,n){var r=this;void 0===n&&(n={});var i=new t(e,f(f({},this.options),{parent:this,id:n.id||e.id})),o=f(f({},te),n);o.sync&&i.onTransition((function(t){r.send(A,{state:t,id:i.id})}));var a=i;return this.children.set(i.id,a),o.autoForward&&this.forwardTo.add(i.id),i.onDone((function(t){r.removeChild(i.id),r.send(at(t,{origin:i.id}))})).start(),a},t.prototype.spawnBehavior=function(t,e){var n=Qt(t,{id:e,parent:this});return this.children.set(e,n),n},t.prototype.spawnPromise=function(t,e){var n,r,i=this,o=!1;t.then((function(t){o||(r=t,i.removeChild(e),i.send(at(jt(e,t),{origin:e})))}),(function(t){if(!o){i.removeChild(e);var n=Nt(e,t);try{i.send(at(n,{origin:e}))}catch(r){i.devTools&&i.devTools.send(n,i.state),i.machine.strict&&i.stop()}}}));var a=((n={id:e,send:function(){},subscribe:function(e,n,r){var i=lt(e,n,r),o=!1;return t.then((function(t){o||(i.next(t),o||i.complete())}),(function(t){o||i.error(t)})),{unsubscribe:function(){return o=!0}}},stop:function(){o=!0},toJSON:function(){return{id:e}},getSnapshot:function(){return r}})[rt]=function(){return this},n);return this.children.set(e,a),a},t.prototype.spawnCallback=function(t,e){var n,r,i,o=this,a=!1,s=new Set,c=new Set;try{i=t((function(t){r=t,c.forEach((function(e){return e(t)})),a||o.send(at(t,{origin:e}))}),(function(t){s.add(t)}))}catch(l){this.send(Nt(e,l))}if(W(i))return this.spawnPromise(i,e);var u=((n={id:e,send:function(t){return s.forEach((function(e){return e(t)}))},subscribe:function(t){var e=lt(t);return c.add(e.next),{unsubscribe:function(){c.delete(e.next)}}},stop:function(){a=!0,tt(i)&&i()},toJSON:function(){return{id:e}},getSnapshot:function(){return r}})[rt]=function(){return this},n);return this.children.set(e,u),u},t.prototype.spawnObservable=function(t,e){var n,r,i=this,o=t.subscribe((function(t){r=t,i.send(at(t,{origin:e}))}),(function(t){i.removeChild(e),i.send(at(Nt(e,t),{origin:e}))}),(function(){i.removeChild(e),i.send(at(jt(e),{origin:e}))})),a=((n={id:e,send:function(){},subscribe:function(e,n,r){return t.subscribe(e,n,r)},stop:function(){return o.unsubscribe()},getSnapshot:function(){return r},toJSON:function(){return{id:e}}})[rt]=function(){return this},n);return this.children.set(e,a),a},t.prototype.spawnActor=function(t,e){return this.children.set(e,t),t},t.prototype.spawnActivity=function(t){var e=this.machine.options&&this.machine.options.activities?this.machine.options.activities[t.type]:void 0;if(e){var n=e(this.state.context,t);this.spawnEffect(t.id,n)}},t.prototype.spawnEffect=function(t,e){var n;this.children.set(t,((n={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:e||void 0,getSnapshot:function(){},toJSON:function(){return{id:t}}})[rt]=function(){return this},n))},t.prototype.attachDev=function(){var t=Xt();if(this.options.devTools&&t){if(t.__REDUX_DEVTOOLS_EXTENSION__){var e="object"===typeof this.options.devTools?this.options.devTools:void 0;this.devTools=t.__REDUX_DEVTOOLS_EXTENSION__.connect(f(f({name:this.id,autoPause:!0,stateSanitizer:function(t){return{value:t.value,context:t.context,actions:t.actions}}},e),{features:f({jump:!1,skip:!1},e?e.features:void 0)}),this.machine),this.devTools.init(this.state)}Jt(this)}},t.prototype.toJSON=function(){return{id:this.id}},t.prototype[rt]=function(){return this},t.prototype.getSnapshot=function(){return this.status===Yt.NotStarted?this.initialState:this._state},t.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(t,e){return setTimeout(t,e)},clearTimeout:function(t){return clearTimeout(t)}},logger:console.log.bind(console),devTools:!1},t.interpret=re,t}();function re(t,e){return new ne(t,e)}function ie(t){var e=o.useRef();return e.current||(e.current={v:t()}),e.current.v}!function(t){t[t.Effect=1]="Effect",t[t.LayoutEffect=2]="LayoutEffect"}(ee||(ee={}));var oe=function(t,e){var n="function"===typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},ae=function(t){var e="function"===typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"===typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var se=function(t,e){var n="function"===typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},ce=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function ue(t,e){(0,t.exec)(e.context,e._event.data,{action:t,state:e,_event:e._event})()}function le(t){var e=(0,o.useRef)([]),n=(0,o.useRef)([]);(0,Mt.Z)((function(){var r=t.subscribe((function(t){var r,i;if(t.actions.length){var o=t.actions.filter((function(t){return"function"===typeof t.exec&&"__effect"in t.exec})),a=se(function(t,e){var n,r,i=oe([[],[]],2),o=i[0],a=i[1];try{for(var s=ae(t),c=s.next();!c.done;c=s.next()){var u=c.value;e(u)?o.push(u):a.push(u)}}catch(l){n={error:l}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return[o,a]}(o,(function(t){return t.exec.__effect===ee.Effect})),2),s=a[0],c=a[1];(r=e.current).push.apply(r,ce([],se(s.map((function(e){return[e,t]}))),!1)),(i=n.current).push.apply(i,ce([],se(c.map((function(e){return[e,t]}))),!1))}}));return function(){r.unsubscribe()}}),[]),(0,Mt.Z)((function(){for(;n.current.length;){var t=se(n.current.shift(),2);ue(t[0],t[1])}})),(0,o.useEffect)((function(){for(;e.current.length;){var t=se(e.current.shift(),2);ue(t[0],t[1])}}))}var fe=function(){return fe=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},fe.apply(this,arguments)},de=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};var he=function(t,e){var n="function"===typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};function ve(t,e){void 0===e&&(e={});var n=(0,o.useCallback)((function(t){var e=void 0===t.changed&&Object.keys(t.children).length;(t.changed||e)&&s(t)}),[]),r=function(t,e,n){void 0===e&&(e={});var r=ie((function(){return"function"===typeof t?t():t})),i=e.context,o=e.guards,a=e.actions,s=e.activities,c=e.services,u=e.delays,l=e.state,f=de(e,["context","guards","actions","activities","services","delays","state"]),d=ie((function(){var t={context:i,guards:o,actions:a,activities:s,services:c,delays:u};return re(r.withConfig(t,(function(){return fe(fe({},r.context),i)})),fe({deferEvents:!0},f))}));return(0,Mt.Z)((function(){var t;return n&&(t=d.subscribe(function(t,e,n){if("object"===typeof t)return t;var r=function(){};return{next:t,error:void 0||r,complete:void 0||r}}(n))),function(){null===t||void 0===t||t.unsubscribe()}}),[n]),(0,Mt.Z)((function(){return d.start(l?It.create(l):void 0),function(){d.stop()}}),[]),(0,Mt.Z)((function(){Object.assign(d.machine.options.actions,a),Object.assign(d.machine.options.guards,o),Object.assign(d.machine.options.activities,s),Object.assign(d.machine.options.services,c),Object.assign(d.machine.options.delays,u)}),[a,o,s,c,u]),le(d),d}(t,e,n),i=he((0,o.useState)((function(){var t=r.machine.initialState;return e.state?It.create(e.state):t})),2),a=i[0],s=i[1];return[a,r.send,r]}var pe=n(87462),ye=n(63366);const ge={arr:Array.isArray,obj:t=>"[object Object]"===Object.prototype.toString.call(t),fun:t=>"function"===typeof t,str:t=>"string"===typeof t,num:t=>"number"===typeof t,und:t=>void 0===t,nul:t=>null===t,set:t=>t instanceof Set,map:t=>t instanceof Map,equ(t,e){if(typeof t!==typeof e)return!1;if(ge.str(t)||ge.num(t))return t===e;if(ge.obj(t)&&ge.obj(e)&&Object.keys(t).length+Object.keys(e).length===0)return!0;let n;for(n in t)if(!(n in e))return!1;for(n in e)if(t[n]!==e[n])return!1;return!ge.und(n)||t===e}};function me(){const t=(0,o.useState)(!1)[1];return(0,o.useCallback)((()=>t((t=>!t))),[])}function be(t,e){return ge.und(t)||ge.nul(t)?e:t}function we(t){return ge.und(t)?[]:ge.arr(t)?t:[t]}function Se(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return ge.fun(t)?t(...n):t}function xe(t){const e=function(t){return t.to,t.from,t.config,t.onStart,t.onRest,t.onFrame,t.children,t.reset,t.reverse,t.force,t.immediate,t.delay,t.attach,t.destroyed,t.interpolateTo,t.ref,t.lazy,(0,ye.Z)(t,["to","from","config","onStart","onRest","onFrame","children","reset","reverse","force","immediate","delay","attach","destroyed","interpolateTo","ref","lazy"])}(t);if(ge.und(e))return(0,pe.Z)({to:e},t);const n=Object.keys(t).reduce(((n,r)=>ge.und(e[r])?(0,pe.Z)({},n,{[r]:t[r]}):n),{});return(0,pe.Z)({to:e},n)}class Ee{constructor(){this.payload=void 0,this.children=[]}getAnimatedValue(){return this.getValue()}getPayload(){return this.payload||this}attach(){}detach(){}getChildren(){return this.children}addChild(t){0===this.children.length&&this.attach(),this.children.push(t)}removeChild(t){const e=this.children.indexOf(t);this.children.splice(e,1),0===this.children.length&&this.detach()}}class Oe extends Ee{constructor(){super(...arguments),this.payload=[],this.attach=()=>this.payload.forEach((t=>t instanceof Ee&&t.addChild(this))),this.detach=()=>this.payload.forEach((t=>t instanceof Ee&&t.removeChild(this)))}}class ke extends Ee{constructor(){super(...arguments),this.payload={},this.attach=()=>Object.values(this.payload).forEach((t=>t instanceof Ee&&t.addChild(this))),this.detach=()=>Object.values(this.payload).forEach((t=>t instanceof Ee&&t.removeChild(this)))}getValue(t){void 0===t&&(t=!1);const e={};for(const n in this.payload){const r=this.payload[n];(!t||r instanceof Ee)&&(e[n]=r instanceof Ee?r[t?"getAnimatedValue":"getValue"]():r)}return e}getAnimatedValue(){return this.getValue(!0)}}let _e,Pe;function Te(t,e){_e={fn:t,transform:e}}function Re(t){Pe=t}let Ce,je=t=>"undefined"!==typeof window?window.requestAnimationFrame(t):-1;function Ne(t){Ce=t}let Ae,De=()=>Date.now();function Le(t){Ae=t}let Ie,Me,Ve=t=>t.current;function ze(t){Ie=t}class Fe extends ke{constructor(t,e){super(),this.update=void 0,this.payload=t.style?(0,pe.Z)({},t,{style:Ie(t.style)}):t,this.update=e,this.attach()}}let Be=!1;const He=new Set,Ge=()=>{if(!Be)return!1;let t=De();for(let e of He){let n=!1;for(let r=0;r<e.configs.length;r++){let i,o,a=e.configs[r];for(let e=0;e<a.animatedValues.length;e++){let r=a.animatedValues[e];if(r.done)continue;let s=a.fromValues[e],c=a.toValues[e],u=r.lastPosition,l=c instanceof Ee,f=Array.isArray(a.initialVelocity)?a.initialVelocity[e]:a.initialVelocity;if(l&&(c=c.getValue()),a.immediate)r.setValue(c),r.done=!0;else if("string"!==typeof s&&"string"!==typeof c){if(void 0!==a.duration)u=s+a.easing((t-r.startTime)/a.duration)*(c-s),i=t>=r.startTime+a.duration;else if(a.decay)u=s+f/(1-.998)*(1-Math.exp(-(1-.998)*(t-r.startTime))),i=Math.abs(r.lastPosition-u)<.1,i&&(c=u);else{o=void 0!==r.lastTime?r.lastTime:t,f=void 0!==r.lastVelocity?r.lastVelocity:a.initialVelocity,t>o+64&&(o=t);let e=Math.floor(t-o);for(let t=0;t<e;++t){f+=1*((-a.tension*(u-c)+-a.friction*f)/a.mass)/1e3,u+=1*f/1e3}let n=!(!a.clamp||0===a.tension)&&(s<c?u>c:u<c),l=Math.abs(f)<=a.precision,d=0===a.tension||Math.abs(c-u)<=a.precision;i=n||l&&d,r.lastVelocity=f,r.lastTime=t}l&&!a.toValues[e].done&&(i=!1),i?(r.value!==c&&(u=c),r.done=!0):n=!0,r.setValue(u),r.lastPosition=u}else r.setValue(c),r.done=!0}e.props.onFrame&&(e.values[a.name]=a.interpolation.getValue())}e.props.onFrame&&e.props.onFrame(e.values),n||(He.delete(e),e.stop(!0))}return He.size?Me?Me():je(Ge):Be=!1,Be};function Ze(t,e,n){if("function"===typeof t)return t;if(Array.isArray(t))return Ze({range:t,output:e,extrapolate:n});if(Ce&&"string"===typeof t.output[0])return Ce(t);const r=t,i=r.output,o=r.range||[0,1],a=r.extrapolateLeft||r.extrapolate||"extend",s=r.extrapolateRight||r.extrapolate||"extend",c=r.easing||(t=>t);return t=>{const e=function(t,e){for(var n=1;n<e.length-1&&!(e[n]>=t);++n);return n-1}(t,o);return function(t,e,n,r,i,o,a,s,c){let u=c?c(t):t;if(u<e){if("identity"===a)return u;"clamp"===a&&(u=e)}if(u>n){if("identity"===s)return u;"clamp"===s&&(u=n)}if(r===i)return r;if(e===n)return t<=e?r:i;e===-1/0?u=-u:n===1/0?u-=e:u=(u-e)/(n-e);u=o(u),r===-1/0?u=-u:i===1/0?u+=r:u=u*(i-r)+r;return u}(t,o[e],o[e+1],i[e],i[e+1],c,a,s,r.map)}}class qe extends Oe{constructor(t,e,n,r){super(),this.calc=void 0,this.payload=t instanceof Oe&&!(t instanceof qe)?t.getPayload():Array.isArray(t)?t:[t],this.calc=Ze(e,n,r)}getValue(){return this.calc(...this.payload.map((t=>t.getValue())))}updateConfig(t,e,n){this.calc=Ze(t,e,n)}interpolate(t,e,n){return new qe(this,t,e,n)}}const Ke=(t,e,n)=>t&&new qe(t,e,n);function $e(t,e){"update"in t?e.add(t):t.getChildren().forEach((t=>$e(t,e)))}class Ue extends Ee{constructor(t){var e;super(),e=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(t,n){void 0===n&&(n=!0),e.value=t,n&&e.flush()},this.value=t,this.startPosition=t,this.lastPosition=t}flush(){0===this.animatedStyles.size&&$e(this,this.animatedStyles),this.animatedStyles.forEach((t=>t.update()))}clearStyles(){this.animatedStyles.clear()}getValue(){return this.value}interpolate(t,e,n){return new qe(this,t,e,n)}}class We extends Oe{constructor(t){super(),this.payload=t.map((t=>new Ue(t)))}setValue(t,e){void 0===e&&(e=!0),Array.isArray(t)?t.length===this.payload.length&&t.forEach(((t,n)=>this.payload[n].setValue(t,e))):this.payload.forEach((n=>n.setValue(t,e)))}getValue(){return this.payload.map((t=>t.getValue()))}interpolate(t,e){return new qe(this,t,e)}}let Xe=0;class Je{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=Xe++}update(t){if(!t)return this;const e=xe(t),n=e.delay,r=void 0===n?0:n,i=e.to,o=(0,ye.Z)(e,["delay","to"]);if(ge.arr(i)||ge.fun(i))this.queue.push((0,pe.Z)({},o,{delay:r,to:i}));else if(i){let t={};Object.entries(i).forEach((e=>{let n=e[0],i=e[1];const a=(0,pe.Z)({to:{[n]:i},delay:Se(r,n)},o),s=t[a.delay]&&t[a.delay].to;t[a.delay]=(0,pe.Z)({},t[a.delay],a,{to:(0,pe.Z)({},s,a.to)})})),this.queue=Object.values(t)}return this.queue=this.queue.sort(((t,e)=>t.delay-e.delay)),this.diff(o),this}start(t){if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach((t=>{let e=t.from,n=void 0===e?{}:e,r=t.to,i=void 0===r?{}:r;ge.obj(n)&&(this.merged=(0,pe.Z)({},n,this.merged)),ge.obj(i)&&(this.merged=(0,pe.Z)({},this.merged,i))}));const e=this.local=++this.guid,n=this.localQueue=this.queue;this.queue=[],n.forEach(((r,i)=>{let o=r.delay,a=(0,ye.Z)(r,["delay"]);const s=r=>{i===n.length-1&&e===this.guid&&r&&(this.idle=!0,this.props.onRest&&this.props.onRest(this.merged)),t&&t()};let c=ge.arr(a.to)||ge.fun(a.to);o?setTimeout((()=>{e===this.guid&&(c?this.runAsync(a,s):this.diff(a).start(s))}),o):c?this.runAsync(a,s):this.diff(a).start(s)}))}else ge.fun(t)&&this.listeners.push(t),this.props.onStart&&this.props.onStart(),e=this,He.has(e)||He.add(e),Be||(Be=!0,je(Me||Ge));var e;return this}stop(t){return this.listeners.forEach((e=>e(t))),this.listeners=[],this}pause(t){var e;return this.stop(!0),t&&(e=this,He.has(e)&&He.delete(e)),this}runAsync(t,e){var n=this;t.delay;let r=(0,ye.Z)(t,["delay"]);const i=this.local;let o=Promise.resolve(void 0);if(ge.arr(r.to))for(let a=0;a<r.to.length;a++){const t=a,e=(0,pe.Z)({},r,xe(r.to[t]));ge.arr(e.config)&&(e.config=e.config[t]),o=o.then((()=>{if(i===this.guid)return new Promise((t=>this.diff(e).start(t)))}))}else if(ge.fun(r.to)){let t,e=0;o=o.then((()=>r.to((n=>{const o=(0,pe.Z)({},r,xe(n));if(ge.arr(o.config)&&(o.config=o.config[e]),e++,i===this.guid)return t=new Promise((t=>this.diff(o).start(t)))}),(function(t){return void 0===t&&(t=!0),n.stop(t)})).then((()=>t))))}o.then(e)}diff(t){this.props=(0,pe.Z)({},this.props,t);let e=this.props,n=e.from,r=void 0===n?{}:n,i=e.to,o=void 0===i?{}:i,a=e.config,s=void 0===a?{}:a,c=e.reverse,u=e.attach,l=e.reset,f=e.immediate;if(c){var d=[o,r];r=d[0],o=d[1]}this.merged=(0,pe.Z)({},r,this.merged,o),this.hasChanged=!1;let h=u&&u(this);if(this.animations=Object.entries(this.merged).reduce(((t,e)=>{let n=e[0],i=e[1],o=t[n]||{};const a=ge.num(i),c=ge.str(i)&&!i.startsWith("#")&&!/\d/.test(i)&&!Pe[i],u=ge.arr(i),d=!a&&!u&&!c;let v=ge.und(r[n])?i:r[n],p=a||u||c?i:1,y=Se(s,n);h&&(p=h.animations[n].parent);let g,m=o.parent,b=o.interpolation,w=we(h?p.getPayload():p),S=i;d&&(S=Ce({range:[0,1],output:[i,i]})(1));let x=b&&b.getValue();const E=!ge.und(m)&&o.animatedValues.some((t=>!t.done)),O=!ge.equ(S,x),k=!ge.equ(S,o.previous),_=!ge.equ(y,o.config);if(l||k&&O||_){if(a||c)m=b=o.parent||new Ue(v);else if(u)m=b=o.parent||new We(v);else if(d){let t=o.interpolation&&o.interpolation.calc(o.parent.value);t=void 0===t||l?v:t,o.parent?(m=o.parent,m.setValue(0,!1)):m=new Ue(0);const e={output:[t,i]};o.interpolation?(b=o.interpolation,o.interpolation.updateConfig(e)):b=m.interpolate(e)}return w=we(h?p.getPayload():p),g=we(m.getPayload()),l&&!d&&m.setValue(v,!1),this.hasChanged=!0,g.forEach((t=>{t.startPosition=t.value,t.lastPosition=t.value,t.lastVelocity=E?t.lastVelocity:void 0,t.lastTime=E?t.lastTime:void 0,t.startTime=De(),t.done=!1,t.animatedStyles.clear()})),Se(f,n)&&m.setValue(d?p:i,!1),(0,pe.Z)({},t,{[n]:(0,pe.Z)({},o,{name:n,parent:m,interpolation:b,animatedValues:g,toValues:w,previous:S,config:y,fromValues:we(m.getValue()),immediate:Se(f,n),initialVelocity:be(y.velocity,0),clamp:be(y.clamp,!1),precision:be(y.precision,.01),tension:be(y.tension,170),friction:be(y.friction,26),mass:be(y.mass,1),duration:y.duration,easing:be(y.easing,(t=>t)),decay:y.decay})})}return O?t:(d&&(m.setValue(1,!1),b.updateConfig({output:[S,S]})),m.done=!0,this.hasChanged=!0,(0,pe.Z)({},t,{[n]:(0,pe.Z)({},t[n],{previous:S})}))}),this.animations),this.hasChanged){this.configs=Object.values(this.animations),this.values={},this.interpolations={};for(let t in this.animations)this.interpolations[t]=this.animations[t].interpolation,this.values[t]=this.animations[t].interpolation.getValue()}return this}destroy(){this.stop(),this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.local=0}}const Qe=(t,e)=>{const n=(0,o.useRef)(!1),r=(0,o.useRef)(),i=ge.fun(e),a=(0,o.useMemo)((()=>{let n;return r.current&&(r.current.map((t=>t.destroy())),r.current=void 0),[new Array(t).fill().map(((t,r)=>{const o=new Je,a=i?Se(e,r,o):e[r];return 0===r&&(n=a.ref),o.update(a),n||o.start(),o})),n]}),[t]),s=a[0],c=a[1];r.current=s;(0,o.useImperativeHandle)(c,(()=>({start:()=>Promise.all(r.current.map((t=>new Promise((e=>t.start(e)))))),stop:t=>r.current.forEach((e=>e.stop(t))),get controllers(){return r.current}})));const u=(0,o.useMemo)((()=>t=>r.current.map(((e,n)=>{e.update(i?Se(t,n,e):t[n]),c||e.start()}))),[t]);(0,o.useEffect)((()=>{n.current?i||u(e):c||r.current.forEach((t=>t.start()))})),(0,o.useEffect)((()=>(n.current=!0,()=>r.current.forEach((t=>t.destroy())))),[]);const l=r.current.map((t=>t.getValues()));return i?[l,u,t=>r.current.forEach((e=>e.pause(t)))]:l};class Ye extends ke{constructor(t){void 0===t&&(t={}),super(),!t.transform||t.transform instanceof Ee||(t=_e.transform(t)),this.payload=t}}const tn={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},en="[-+]?\\d*\\.?\\d+",nn=en+"%";function rn(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const on=new RegExp("rgb"+rn(en,en,en)),an=new RegExp("rgba"+rn(en,en,en,en)),sn=new RegExp("hsl"+rn(en,nn,nn)),cn=new RegExp("hsla"+rn(en,nn,nn,en)),un=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ln=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,fn=/^#([0-9a-fA-F]{6})$/,dn=/^#([0-9a-fA-F]{8})$/;function hn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function vn(t,e,n){const r=n<.5?n*(1+e):n+e-n*e,i=2*n-r,o=hn(i,r,t+1/3),a=hn(i,r,t),s=hn(i,r,t-1/3);return Math.round(255*o)<<24|Math.round(255*a)<<16|Math.round(255*s)<<8}function pn(t){const e=parseInt(t,10);return e<0?0:e>255?255:e}function yn(t){return(parseFloat(t)%360+360)%360/360}function gn(t){const e=parseFloat(t);return e<0?0:e>1?255:Math.round(255*e)}function mn(t){const e=parseFloat(t);return e<0?0:e>100?1:e/100}function bn(t){let e=function(t){let e;return"number"===typeof t?t>>>0===t&&t>=0&&t<=4294967295?t:null:(e=fn.exec(t))?parseInt(e[1]+"ff",16)>>>0:tn.hasOwnProperty(t)?tn[t]:(e=on.exec(t))?(pn(e[1])<<24|pn(e[2])<<16|pn(e[3])<<8|255)>>>0:(e=an.exec(t))?(pn(e[1])<<24|pn(e[2])<<16|pn(e[3])<<8|gn(e[4]))>>>0:(e=un.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=dn.exec(t))?parseInt(e[1],16)>>>0:(e=ln.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=sn.exec(t))?(255|vn(yn(e[1]),mn(e[2]),mn(e[3])))>>>0:(e=cn.exec(t))?(vn(yn(e[1]),mn(e[2]),mn(e[3]))|gn(e[4]))>>>0:null}(t);return null===e?t:(e=e||0,`rgba(${(4278190080&e)>>>24}, ${(16711680&e)>>>16}, ${(65280&e)>>>8}, ${(255&e)/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,xn=new RegExp(`(${Object.keys(tn).join("|")})`,"g");let En={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 kn(t,e,n){return null==e||"boolean"===typeof e||""===e?"":n||"number"!==typeof e||0===e||En.hasOwnProperty(t)&&En[t]?(""+e).trim():e+"px"}En=Object.keys(En).reduce(((t,e)=>(On.forEach((n=>t[((t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1))(n,e)]=t[e])),t)),En);const _n={};ze((t=>new Ye(t))),Le("div"),Ne((t=>{const e=t.output.map((t=>t.replace(Sn,bn))).map((t=>t.replace(xn,bn))),n=e[0].match(wn).map((()=>[]));e.forEach((t=>{t.match(wn).forEach(((t,e)=>n[e].push(+t)))}));const r=e[0].match(wn).map(((e,r)=>Ze((0,pe.Z)({},t,{output:n[r]}))));return t=>{let n=0;return e[0].replace(wn,(()=>r[n++](t))).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,((t,e,n,r,i)=>`rgba(${Math.round(e)}, ${Math.round(n)}, ${Math.round(r)}, ${i})`))}})),Re(tn),Te(((t,e)=>{if(!t.nodeType||void 0===t.setAttribute)return!1;{const i=e.style,o=e.children,a=e.scrollTop,s=e.scrollLeft,c=(0,ye.Z)(e,["style","children","scrollTop","scrollLeft"]),u="filter"===t.nodeName||t.parentNode&&"filter"===t.parentNode.nodeName;void 0!==a&&(t.scrollTop=a),void 0!==s&&(t.scrollLeft=s),void 0!==o&&(t.textContent=o);for(let e in i)if(i.hasOwnProperty(e)){var n=0===e.indexOf("--"),r=kn(e,i[e],n);"float"===e&&(e="cssFloat"),n?t.style.setProperty(e,r):t.style[e]=r}for(let e in c){const n=u?e:_n[e]||(_n[e]=e.replace(/([A-Z])/g,(t=>"-"+t.toLowerCase())));"undefined"!==typeof t.getAttribute(n)&&t.setAttribute(n,c[e])}}}),(t=>t));var Pn,Tn;const Rn=(Pn=t=>(0,o.forwardRef)(((e,n)=>{const r=me(),i=(0,o.useRef)(!0),s=(0,o.useRef)(null),c=(0,o.useRef)(null),u=(0,o.useCallback)((t=>{const e=s.current;s.current=new Fe(t,(()=>{let t=!1;c.current&&(t=_e.fn(c.current,s.current.getAnimatedValue())),c.current&&!1!==t||r()})),e&&e.detach()}),[]);(0,o.useEffect)((()=>()=>{i.current=!1,s.current&&s.current.detach()}),[]),(0,o.useImperativeHandle)(n,(()=>Ve(c,i,r))),u(e);const l=s.current.getValue(),f=(l.scrollTop,l.scrollLeft,(0,ye.Z)(l,["scrollTop","scrollLeft"])),d=(h=t,!ge.fun(h)||h.prototype instanceof a().Component?t=>c.current=function(t,e){return e&&(ge.fun(e)?e(t):ge.obj(e)&&(e.current=t)),t}(t,n):void 0);var h;return a().createElement(t,(0,pe.Z)({},f,{ref:d}))})),void 0===(Tn=!1)&&(Tn=!0),t=>(ge.arr(t)?t:Object.keys(t)).reduce(((t,e)=>{const n=Tn?e[0].toLowerCase()+e.substring(1):e;return t[n]=Pn(n),t}),Pn))(["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 Cn(t,e){return t.map((function(t,n){return t+e[n]}))}function jn(t,e){return t.map((function(t,n){return t-e[n]}))}function Nn(t){return Math.hypot.apply(Math,t)}function An(t,e,n){var r=Nn(e),i=0===r?0:1/r,o=0===n?0:1/n,a=o*r,s=e.map((function(t){return o*t})),c=e.map((function(t){return i*t}));return{velocities:s,velocity:a,distance:Nn(t),direction:c}}function Dn(t){return Math.sign?Math.sign(t):Number(t>0)-Number(t<0)||+t}function Ln(t,e,n){return 0===e||Math.abs(e)===1/0?function(t,e){return Math.pow(t,5*e)}(t,n):t*e*n/(e+n*t)}function In(t,e,n,r){return void 0===r&&(r=.15),0===r?function(t,e,n){return Math.max(e,Math.min(t,n))}(t,e,n):t<e?-Ln(e-t,n-e,r)+e:t>n?+Ln(t-n,n-e,r)+n:t}function Mn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Vn(){return Vn=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Vn.apply(this,arguments)}function zn(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function Fn(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}function Bn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Hn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Gn(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"===typeof t)return Hn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Hn(t,e):void 0}}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[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=t[Symbol.iterator]()).next.bind(n)}function Zn(){}function qn(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return 0===e.length?Zn:1===e.length?e[0]:function(){for(var t,n,r=Gn(e);!(n=r()).done;){var i=n.value;t=i.apply(this,arguments)||t}return t}}function Kn(t,e){if(void 0===t){if(void 0===e)throw new Error("Must define fallback value if undefined is expected");t=e}return Array.isArray(t)?t:[t,t]}function $n(t){if("function"===typeof t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return t.apply(void 0,n)}return t}function Un(t,e){void 0===t&&(t={});for(var n={},r=0,i=Object.entries(e);r<i.length;r++){var o=i[r],a=o[0],s=o[1];switch(typeof s){case"function":n[a]=s.call(n,t[a],a,t);break;case"object":n[a]=Un(t[a],s);break;case"boolean":s&&(n[a]=t[a])}}return n}var Wn={threshold:function(t){return void 0===t&&(t=0),Kn(t)},rubberband:function(t){switch(void 0===t&&(t=0),t){case!0:return Kn(.15);case!1:return Kn(0);default:return Kn(t)}},enabled:function(t){return void 0===t&&(t=!0),t},triggerAllEvents:function(t){return void 0===t&&(t=!1),t},initial:function(t){return void 0===t&&(t=0),"function"===typeof t?t:Kn(t)}},Xn=Vn({},Wn,{axis:!0,lockDirection:function(t){return void 0===t&&(t=!1),t},bounds:function(t){if(void 0===t&&(t={}),"function"===typeof t)return function(e){return Xn.bounds(t(e))};var e=t,n=e.left,r=void 0===n?-1/0:n,i=e.right,o=void 0===i?1/0:i,a=e.top,s=void 0===a?-1/0:a,c=e.bottom;return[[r,o],[s,void 0===c?1/0:c]]}}),Jn="undefined"!==typeof window&&window.document&&window.document.createElement,Qn={enabled:function(t){return void 0===t&&(t=!0),t},domTarget:!0,window:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){return void 0===t&&(t=Jn?window:void 0),t})),eventOptions:function(t){var e=void 0===t?{}:t,n=e.passive,r=void 0===n||n,i=e.capture;return{passive:r,capture:void 0!==i&&i}}},Yn=Vn({},Xn,{threshold:function(t,e,n){var r=n.filterTaps,i=void 0!==r&&r,o=n.lockDirection,a=void 0!==o&&o,s=n.axis,c=Kn(t,i?3:a||(void 0===s?void 0:s)?1:0);return this.filterTaps=i||c[0]+c[1]>0,c},swipeVelocity:function(t){return void 0===t&&(t=.5),Kn(t)},swipeDistance:function(t){return void 0===t&&(t=60),Kn(t)},delay:function(t){switch(void 0===t&&(t=0),t){case!0:return 180;case!1:return 0;default:return t}}});function tr(t){return void 0===t&&(t={}),Un(t,Qn)}function er(t){return void 0===t&&(t={}),Un(t,Yn)}function nr(t){var e=t.domTarget,n=t.eventOptions,r=t.window,i=t.enabled,o=Fn(t,["domTarget","eventOptions","window","enabled"]),a=tr({domTarget:e,eventOptions:n,window:r,enabled:i});return a.drag=er(o),a}function rr(t){return Vn({_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:Zn,canceled:!1,memo:void 0,args:void 0},t)}function ir(){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 or=new Map,ar=function(){function t(t,e){var n=this;void 0===e&&(e=[]),this.controller=t,this.args=e,this.debounced=!0,this.setTimeout=function(t,e){var r;void 0===e&&(e=140),clearTimeout(n.controller.timeouts[n.stateKey]);for(var i=arguments.length,o=new Array(i>2?i-2:0),a=2;a<i;a++)o[a-2]=arguments[a];n.controller.timeouts[n.stateKey]=(r=window).setTimeout.apply(r,[t,e].concat(o))},this.clearTimeout=function(){clearTimeout(n.controller.timeouts[n.stateKey])},this.fireGestureHandler=function(t){if(void 0===t&&(t=!1),n.state._blocked)return n.debounced||(n.state._active=!1,n.clean()),null;if(!t&&!n.state.intentional&&!n.config.triggerAllEvents)return null;if(n.state.intentional){var e=n.state.active,r=n.state._active;n.state.active=r,n.state.first=r&&!e,n.state.last=e&&!r,n.controller.state.shared[n.ingKey]=r}var i=Vn({},n.controller.state.shared,n.state,n.mapStateValues(n.state)),o=n.handler(i);return n.state.memo=void 0!==o?o:n.state.memo,n.state._active||n.clean(),i}}var e,n,r,i=t.prototype;return i.updateSharedState=function(t){Object.assign(this.controller.state.shared,t)},i.updateGestureState=function(t){Object.assign(this.state,t)},i.checkIntentionality=function(t,e){return{_intentional:t,_blocked:!1}},i.getMovement=function(t){var e=this.config,n=e.initial,r=e.bounds,i=e.rubberband,o=e.threshold,a=this.state,s=a._bounds,c=a._initial,u=a._active,l=a._intentional,f=a.lastOffset,d=a.movement,h=this.getInternalMovement(t,this.state),v=!1===l[0]?sr(h[0],o[0]):l[0],p=!1===l[1]?sr(h[1],o[1]):l[1],y=this.checkIntentionality([v,p],h);if(y._blocked)return Vn({},y,{_movement:h,delta:[0,0]});var g,m,b,w,S=y._intentional,x=h;(!1!==S[0]&&!1===l[0]&&(m=$n(n,this.state),g=$n(r,this.state),c[0]=m[0],s[0]=g[0]),!1!==S[1]&&!1===l[1])&&(m=null!=(b=m)?b:$n(n,this.state),g=null!=(w=g)?w:$n(r,this.state),c[1]=m[1],s[1]=g[1]);var E=[!1!==S[0]?h[0]-S[0]:c[0],!1!==S[1]?h[1]-S[1]:c[1]],O=Cn(E,f),k=u?i:[0,0];return E=cr(s,Cn(E,c),k),Vn({},y,{intentional:!1!==S[0]||!1!==S[1],_initial:c,_movement:x,movement:E,values:t,offset:cr(s,O,k),delta:jn(E,d)})},i.clean=function(){this.clearTimeout()},e=t,(n=[{key:"config",get:function(){return this.controller.config[this.stateKey]}},{key:"enabled",get:function(){return this.controller.config.enabled&&this.config.enabled}},{key:"state",get:function(){return this.controller.state[this.stateKey]}},{key:"handler",get:function(){return this.controller.handlers[this.stateKey]}}])&&Mn(e.prototype,n),r&&Mn(e,r),t}();function sr(t,e){return Math.abs(t)>=e&&Dn(t)*e}function cr(t,e,n){var r=e[0],i=e[1],o=n[0],a=n[1],s=t[0],c=s[0],u=s[1],l=t[1],f=l[0],d=l[1];return[In(r,c,u,o),In(i,f,d,a)]}function ur(t,e,n){var r=t.state,i=t.args,o=e.timeStamp,a=e.type,s=r.values;return{_lastEventType:a,event:e,timeStamp:o,elapsedTime:n?0:o-r.startTime,args:i,previous:s}}function lr(t,e,n){var r=t.state.offset,i=n.timeStamp;return Vn({},ir()[t.stateKey],{_active:!0,values:e,initial:e,offset:r,lastOffset:r,startTime:i})}function fr(t,e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return t.call.apply(t,[this,Vn({},e,{event:n})].concat(i))}}var dr=function(t){var e=this;this.classes=t,this.bind=function(){for(var t={},n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var o,a=Gn(e.classes);!(o=a()).done;){var s=o.value;new s(e,r).addBindings(t)}for(var c=0,u=Object.entries(e.nativeRefs);c<u.length;c++){var l=u[c],f=l[0],d=l[1];br(t,f,fr(d,Vn({},e.state.shared,{args:r})))}return e.config.domTarget?pr(e,t):yr(e,t)},this.effect=function(){return e.config.domTarget&&e.bind(),e.clean},this.clean=function(){var t=mr(e.config),n=e.config.eventOptions;t&&Sr(t,gr(e.domListeners),n),Object.values(e.timeouts).forEach(clearTimeout),function(t){var e=t.config,n=e.window,r=e.eventOptions,i=t.windowListeners;if(!n)return;for(var o in i){Sr(n,i[o],r)}t.windowListeners={}}(e)},this.state=ir(),this.timeouts={},this.domListeners=[],this.windowListeners={}};function hr(t,e){var n=t.config,r=t.windowListeners;n.window&&(Sr(n.window,r[e],n.eventOptions),delete r[e])}function vr(t,e,n){var r=t.config,i=t.windowListeners;void 0===n&&(n=[]),r.window&&(Sr(r.window,i[e],r.eventOptions),wr(r.window,i[e]=n,r.eventOptions))}function pr(t,e){var n=t.config,r=t.domListeners,i=mr(n);if(!i)throw new Error("domTarget must be defined");var o=n.eventOptions;Sr(i,gr(r),o);for(var a=0,s=Object.entries(e);a<s.length;a++){var c=s[a],u=c[0],l=c[1],f=u.slice(2).toLowerCase();r.push([f,qn.apply(void 0,l)])}wr(i,r,o)}function yr(t,e){for(var n={},r=t.config.eventOptions.capture?"Capture":"",i=0,o=Object.entries(e);i<o.length;i++){var a=o[i],s=a[0],c=a[1],u=Array.isArray(c)?c:[c];n[s+r]=qn.apply(void 0,u)}return n}function gr(t){return void 0===t&&(t=[]),t.splice(0,t.length)}function mr(t){var e=t.domTarget;return e&&"current"in e?e.current:e}function br(t,e,n){t[e]||(t[e]=[]),t[e].push(n)}function wr(t,e,n){void 0===e&&(e=[]),void 0===n&&(n={});for(var r,i=Gn(e);!(r=i()).done;){var o=r.value,a=o[0],s=o[1];t.addEventListener(a,s,n)}}function Sr(t,e,n){void 0===e&&(e=[]),void 0===n&&(n={});for(var r,i=Gn(e);!(r=i()).done;){var o=r.value,a=o[0],s=o[1];t.removeEventListener(a,s,n)}}function xr(t,e,n){void 0===n&&(n={});var r=function(t){var e=new Set;t.drag&&e.add(or.get("drag"));t.wheel&&e.add(or.get("wheel"));t.scroll&&e.add(or.get("scroll"));t.move&&e.add(or.get("move"));t.pinch&&e.add(or.get("pinch"));t.hover&&e.add(or.get("hover"));return e}(t),i=a().useMemo((function(){return new dr(r)}),[]);return i.config=e,i.handlers=t,i.nativeRefs=n,a().useEffect(i.effect,[]),i.config.domTarget?Er:i.bind}function Er(){0}var Or=function(t){function e(){return t.apply(this,arguments)||this}zn(e,t);var n=e.prototype;return n.getInternalMovement=function(t,e){return jn(t,e.initial)},n.checkIntentionality=function(t,e){if(!1===t[0]&&!1===t[1])return{_intentional:t,axis:this.state.axis};var n=e.map(Math.abs),r=n[0],i=n[1],o=this.state.axis||(r>i?"x":r<i?"y":void 0);return this.config.axis||this.config.lockDirection?o?this.config.axis&&o!==this.config.axis?{_intentional:t,_blocked:!0,axis:o}:(t["x"===o?1:0]=!1,{_intentional:t,_blocked:!1,axis:o}):{_intentional:[!1,!1],_blocked:!1,axis:o}:{_intentional:t,_blocked:!1,axis:o}},n.getKinematics=function(t,e){var n=this.getMovement(t);if(!n._blocked){var r=e.timeStamp-this.state.timeStamp;Object.assign(n,An(n.movement,n.delta,r))}return n},n.mapStateValues=function(t){return{xy:t.values,vxvy:t.velocities}},e}(ar);function kr(t){if("touches"in t){var e=t.targetTouches,n=t.changedTouches;return e.length>0?e:n}return null}function _r(t){var e="buttons"in t?t.buttons:0,n=kr(t),r=n&&n.length||0;return{touches:r,down:r>0||e>0,buttons:e,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey,ctrlKey:t.ctrlKey}}function Pr(t){var e=kr(t),n=e?e[0]:t;return[n.clientX,n.clientY]}var Tr=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).ingKey="dragging",e.stateKey="drag",e.onDragStart=function(t){e.enabled&&!e.state._active&&(vr(e.controller,e.stateKey,[["pointermove",e.onDragChange],["pointerup",e.onDragEnd],["pointercancel",e.onDragEnd]]),e.updateGestureState({_pointerId:t.pointerId}),e.config.delay>0?(e.state._delayedEvent=!0,"persist"in t&&"function"===typeof t.persist&&t.persist(),e.setTimeout(e.startDrag.bind(Bn(e)),e.config.delay,t)):e.startDrag(t))},e.onDragChange=function(t){if(!e.state.canceled&&t.pointerId===e.state._pointerId)if(e.state._active){var n=_r(t);if(n.down){e.updateSharedState(n);var r=Pr(t),i=e.getKinematics(r,t),o=ur(Bn(e),t),a=e.state._isTap,s=Nn(i._movement);a&&s>=3&&(a=!1),e.updateGestureState(Vn({},o,i,{_isTap:a})),e.fireGestureHandler()}else e.onDragEnd(t)}else e.state._delayedEvent&&(e.clearTimeout(),e.startDrag(t))},e.onDragEnd=function(t){if(t.pointerId===e.state._pointerId){e.state._active=!1,e.updateSharedState({down:!1,buttons:0,touches:0});var n=e.state._isTap,r=e.state.velocities,i=r[0],o=r[1],a=e.state.movement,s=a[0],c=a[1],u=e.state._intentional,l=u[0],f=u[1],d=e.config.swipeVelocity,h=d[0],v=d[1],p=e.config.swipeDistance,y=p[0],g=p[1],m=Vn({},ur(Bn(e),t),e.getMovement(e.state.values)),b=[0,0];m.elapsedTime<220&&(!1!==l&&Math.abs(i)>h&&Math.abs(s)>y&&(b[0]=Dn(i)),!1!==f&&Math.abs(o)>v&&Math.abs(c)>g&&(b[1]=Dn(o))),e.updateGestureState(Vn({},m,{tap:n,swipe:b})),e.fireGestureHandler(!0===n)}},e.clean=function(){t.prototype.clean.call(Bn(e)),e.state._delayedEvent=!1,hr(e.controller,e.stateKey)},e.onCancel=function(){e.state.canceled||(e.updateGestureState({canceled:!0}),e.state._active=!1,e.updateSharedState({down:!1,buttons:0,touches:0}),requestAnimationFrame((function(){return e.fireGestureHandler()})))},e.onClick=function(t){e.state._isTap||t.stopPropagation()},e}zn(e,t);var n=e.prototype;return n.startDrag=function(t){var e=Pr(t);this.updateSharedState(_r(t)),this.updateGestureState(Vn({},lr(this,e,t),ur(this,t,!0),{_pointerId:t.pointerId,cancel:this.onCancel})),this.updateGestureState(this.getMovement(e)),this.fireGestureHandler()},n.addBindings=function(t){(br(t,"onPointerDown",this.onDragStart),this.config.filterTaps)&&br(t,this.controller.config.eventOptions.capture?"onClick":"onClickCapture",this.onClick)},e}(Or);function Rr(t,e){var n,r,i=[],o=!1;return function(){for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return o&&n===this&&e(s,i)||(r=t.apply(this,s),o=!0,n=this,i=s),r}}function Cr(t,e){if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){if(t.constructor!==e.constructor)return!1;var n,r,i,o;if(Array.isArray(t)){if((n=t.length)!==e.length)return!1;for(r=n;0!==r--;)if(!Cr(t[r],e[r]))return!1;return!0}if("function"===typeof Map&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(o=t.entries();!(r=o.next()).done;)if(!e.has(r.value[0]))return!1;for(o=t.entries();!(r=o.next()).done;)if(!Cr(r.value[1],e.get(r.value[0])))return!1;return!0}if("function"===typeof Set&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(o=t.entries();!(r=o.next()).done;)if(!e.has(r.value[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if((n=(i=Object.keys(t)).length)!==Object.keys(e).length)return!1;for(r=n;0!==r--;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;if("undefined"!==typeof Element&&t instanceof Element)return!1;for(r=n;0!==r--;)if(("_owner"!==i[r]||!t.$$typeof)&&!Cr(t[i[r]],e[i[r]]))return!1;return!0}return t!==t&&e!==e}function jr(t,e){try{return Cr(t,e)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}}var Nr=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],Ar=Nr.join(","),Dr="undefined"===typeof Element,Lr=Dr?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ir=!Dr&&Element.prototype.getRootNode?function(t){return t.getRootNode()}:function(t){return t.ownerDocument},Mr=function(t,e,n){var r=Array.prototype.slice.apply(t.querySelectorAll(Ar));return e&&Lr.call(t,Ar)&&r.unshift(t),r=r.filter(n)},Vr=function t(e,n,r){for(var i=[],o=Array.from(e);o.length;){var a=o.shift();if("SLOT"===a.tagName){var s=a.assignedElements(),c=t(s.length?s:a.children,!0,r);r.flatten?i.push.apply(i,c):i.push({scope:a,candidates:c})}else{Lr.call(a,Ar)&&r.filter(a)&&(n||!e.includes(a))&&i.push(a);var u=a.shadowRoot||"function"===typeof r.getShadowRoot&&r.getShadowRoot(a),l=!r.shadowRootFilter||r.shadowRootFilter(a);if(u&&l){var f=t(!0===u?a.children:u.children,!0,r);r.flatten?i.push.apply(i,f):i.push({scope:a,candidates:f})}else o.unshift.apply(o,a.children)}}return i},zr=function(t,e){return t.tabIndex<0&&(e||/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||t.isContentEditable)&&isNaN(parseInt(t.getAttribute("tabindex"),10))?0:t.tabIndex},Fr=function(t,e){return t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex},Br=function(t){return"INPUT"===t.tagName},Hr=function(t){return function(t){return Br(t)&&"radio"===t.type}(t)&&!function(t){if(!t.name)return!0;var e,n=t.form||Ir(t),r=function(t){return n.querySelectorAll('input[type="radio"][name="'+t+'"]')};if("undefined"!==typeof window&&"undefined"!==typeof window.CSS&&"function"===typeof window.CSS.escape)e=r(window.CSS.escape(t.name));else try{e=r(t.name)}catch(o){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",o.message),!1}var i=function(t,e){for(var n=0;n<t.length;n++)if(t[n].checked&&t[n].form===e)return t[n]}(e,t.form);return!i||i===t}(t)},Gr=function(t){var e=t.getBoundingClientRect(),n=e.width,r=e.height;return 0===n&&0===r},Zr=function(t,e){return!(e.disabled||function(t){return Br(t)&&"hidden"===t.type}(e)||function(t,e){var n=e.displayCheck,r=e.getShadowRoot;if("hidden"===getComputedStyle(t).visibility)return!0;var i=Lr.call(t,"details>summary:first-of-type")?t.parentElement:t;if(Lr.call(i,"details:not([open]) *"))return!0;var o=Ir(t).host,a=(null===o||void 0===o?void 0:o.ownerDocument.contains(o))||t.ownerDocument.contains(t);if(n&&"full"!==n){if("non-zero-area"===n)return Gr(t)}else{if("function"===typeof r){for(var s=t;t;){var c=t.parentElement,u=Ir(t);if(c&&!c.shadowRoot&&!0===r(c))return Gr(t);t=t.assignedSlot?t.assignedSlot:c||u===t.ownerDocument?c:u.host}t=s}if(a)return!t.getClientRects().length}return!1}(e,t)||function(t){return"DETAILS"===t.tagName&&Array.prototype.slice.apply(t.children).some((function(t){return"SUMMARY"===t.tagName}))}(e)||function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var e=t.parentElement;e;){if("FIELDSET"===e.tagName&&e.disabled){for(var n=0;n<e.children.length;n++){var r=e.children.item(n);if("LEGEND"===r.tagName)return!!Lr.call(e,"fieldset[disabled] *")||!r.contains(t)}return!0}e=e.parentElement}return!1}(e))},qr=function(t,e){return!(Hr(e)||zr(e)<0||!Zr(t,e))},Kr=function(t){var e=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(e)||e>=0)},$r=function t(e){var n=[],r=[];return e.forEach((function(e,i){var o=!!e.scope,a=o?e.scope:e,s=zr(a,o),c=o?t(e.candidates):a;0===s?o?n.push.apply(n,c):n.push(a):r.push({documentOrder:i,tabIndex:s,item:e,isScope:o,content:c})})),r.sort(Fr).reduce((function(t,e){return e.isScope?t.push.apply(t,e.content):t.push(e.content),t}),[]).concat(n)},Ur=function(t,e){var n;return n=(e=e||{}).getShadowRoot?Vr([t],e.includeContainer,{filter:qr.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:Kr}):Mr(t,e.includeContainer,qr.bind(null,e)),$r(n)},Wr=function(t,e){if(e=e||{},!t)throw new Error("No node provided");return!1!==Lr.call(t,Ar)&&qr(e,t)},Xr=Nr.concat("iframe").join(","),Jr=function(t,e){if(e=e||{},!t)throw new Error("No node provided");return!1!==Lr.call(t,Xr)&&Zr(e,t)};function Qr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Yr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Qr(Object(n),!0).forEach((function(e){ti(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Qr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ti(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ei=function(){var t=[];return{activateTrap:function(e){if(t.length>0){var n=t[t.length-1];n!==e&&n.pause()}var r=t.indexOf(e);-1===r||t.splice(r,1),t.push(e)},deactivateTrap:function(e){var n=t.indexOf(e);-1!==n&&t.splice(n,1),t.length>0&&t[t.length-1].unpause()}}}(),ni=function(t){return setTimeout(t,0)},ri=function(t,e){var n=-1;return t.every((function(t,r){return!e(t)||(n=r,!1)})),n},ii=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return"function"===typeof t?t.apply(void 0,n):t},oi=function(t){return t.target.shadowRoot&&"function"===typeof t.composedPath?t.composedPath()[0]:t.target},ai=function(t,e){var n,r=(null===e||void 0===e?void 0:e.document)||document,i=Yr({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0},e),o={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0},a=function(t,e,n){return t&&void 0!==t[e]?t[e]:i[n||e]},s=function(t){return o.containerGroups.findIndex((function(e){var n=e.container,r=e.tabbableNodes;return n.contains(t)||r.find((function(e){return e===t}))}))},c=function(t){var e=i[t];if("function"===typeof e){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];e=e.apply(void 0,o)}if(!0===e&&(e=void 0),!e){if(void 0===e||!1===e)return e;throw new Error("`".concat(t,"` was specified but was not a node, or did not return a node"))}var s=e;if("string"===typeof e&&!(s=r.querySelector(e)))throw new Error("`".concat(t,"` as selector refers to no known node"));return s},u=function(){var t=c("initialFocus");if(!1===t)return!1;if(void 0===t)if(s(r.activeElement)>=0)t=r.activeElement;else{var e=o.tabbableGroups[0];t=e&&e.firstTabbableNode||c("fallbackFocus")}if(!t)throw new Error("Your focus-trap needs to have at least one focusable element");return t},l=function(){if(o.containerGroups=o.containers.map((function(t){var e,n,r=Ur(t,i.tabbableOptions),o=(e=t,(n=(n=i.tabbableOptions)||{}).getShadowRoot?Vr([e],n.includeContainer,{filter:Zr.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):Mr(e,n.includeContainer,Zr.bind(null,n)));return{container:t,tabbableNodes:r,focusableNodes:o,firstTabbableNode:r.length>0?r[0]:null,lastTabbableNode:r.length>0?r[r.length-1]:null,nextTabbableNode:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=o.findIndex((function(e){return e===t}));if(!(n<0))return e?o.slice(n+1).find((function(t){return Wr(t,i.tabbableOptions)})):o.slice(0,n).reverse().find((function(t){return Wr(t,i.tabbableOptions)}))}}})),o.tabbableGroups=o.containerGroups.filter((function(t){return t.tabbableNodes.length>0})),o.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 t(e){!1!==e&&e!==r.activeElement&&(e&&e.focus?(e.focus({preventScroll:!!i.preventScroll}),o.mostRecentlyFocusedNode=e,function(t){return t.tagName&&"input"===t.tagName.toLowerCase()&&"function"===typeof t.select}(e)&&e.select()):t(u()))},d=function(t){var e=c("setReturnFocus",t);return e||!1!==e&&t},h=function(t){var e=oi(t);s(e)>=0||(ii(i.clickOutsideDeactivates,t)?n.deactivate({returnFocus:i.returnFocusOnDeactivate&&!Jr(e,i.tabbableOptions)}):ii(i.allowOutsideClick,t)||t.preventDefault())},v=function(t){var e=oi(t),n=s(e)>=0;n||e instanceof Document?n&&(o.mostRecentlyFocusedNode=e):(t.stopImmediatePropagation(),f(o.mostRecentlyFocusedNode||u()))},p=function(t){if(function(t){return"Escape"===t.key||"Esc"===t.key||27===t.keyCode}(t)&&!1!==ii(i.escapeDeactivates,t))return t.preventDefault(),void n.deactivate();(function(t){return"Tab"===t.key||9===t.keyCode})(t)&&function(t){var e=oi(t);l();var n=null;if(o.tabbableGroups.length>0){var r=s(e),a=r>=0?o.containerGroups[r]:void 0;if(r<0)n=t.shiftKey?o.tabbableGroups[o.tabbableGroups.length-1].lastTabbableNode:o.tabbableGroups[0].firstTabbableNode;else if(t.shiftKey){var u=ri(o.tabbableGroups,(function(t){var n=t.firstTabbableNode;return e===n}));if(u<0&&(a.container===e||Jr(e,i.tabbableOptions)&&!Wr(e,i.tabbableOptions)&&!a.nextTabbableNode(e,!1))&&(u=r),u>=0){var d=0===u?o.tabbableGroups.length-1:u-1;n=o.tabbableGroups[d].lastTabbableNode}}else{var h=ri(o.tabbableGroups,(function(t){var n=t.lastTabbableNode;return e===n}));if(h<0&&(a.container===e||Jr(e,i.tabbableOptions)&&!Wr(e,i.tabbableOptions)&&!a.nextTabbableNode(e))&&(h=r),h>=0){var v=h===o.tabbableGroups.length-1?0:h+1;n=o.tabbableGroups[v].firstTabbableNode}}}else n=c("fallbackFocus");n&&(t.preventDefault(),f(n))}(t)},y=function(t){var e=oi(t);s(e)>=0||ii(i.clickOutsideDeactivates,t)||ii(i.allowOutsideClick,t)||(t.preventDefault(),t.stopImmediatePropagation())},g=function(){if(o.active)return ei.activateTrap(n),o.delayInitialFocusTimer=i.delayInitialFocus?ni((function(){f(u())})):f(u()),r.addEventListener("focusin",v,!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",p,{capture:!0,passive:!1}),n},m=function(){if(o.active)return r.removeEventListener("focusin",v,!0),r.removeEventListener("mousedown",h,!0),r.removeEventListener("touchstart",h,!0),r.removeEventListener("click",y,!0),r.removeEventListener("keydown",p,!0),n};return(n={get active(){return o.active},get paused(){return o.paused},activate:function(t){if(o.active)return this;var e=a(t,"onActivate"),n=a(t,"onPostActivate"),i=a(t,"checkCanFocusTrap");i||l(),o.active=!0,o.paused=!1,o.nodeFocusedBeforeActivation=r.activeElement,e&&e();var s=function(){i&&l(),g(),n&&n()};return i?(i(o.containers.concat()).then(s,s),this):(s(),this)},deactivate:function(t){if(!o.active)return this;var e=Yr({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},t);clearTimeout(o.delayInitialFocusTimer),o.delayInitialFocusTimer=void 0,m(),o.active=!1,o.paused=!1,ei.deactivateTrap(n);var r=a(e,"onDeactivate"),s=a(e,"onPostDeactivate"),c=a(e,"checkCanReturnFocus"),u=a(e,"returnFocus","returnFocusOnDeactivate");r&&r();var l=function(){ni((function(){u&&f(d(o.nodeFocusedBeforeActivation)),s&&s()}))};return u&&c?(c(d(o.nodeFocusedBeforeActivation)).then(l,l),this):(l(),this)},pause:function(){return o.paused||!o.active||(o.paused=!0,m()),this},unpause:function(){return o.paused&&o.active?(o.paused=!1,l(),g(),this):this},updateContainerElements:function(t){var e=[].concat(t).filter(Boolean);return o.containers=e.map((function(t){return"string"===typeof t?r.querySelector(t):t})),o.active&&l(),this}}).updateContainerElements(t),n};var si=!1;if("undefined"!==typeof window){var ci={get passive(){si=!0}};window.addEventListener("testPassive",null,ci),window.removeEventListener("testPassive",null,ci)}var ui,li="undefined"!==typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1),fi=[],di=!1,hi=-1,vi=void 0,pi=void 0,yi=function(t){return fi.some((function(e){return!(!e.options.allowTouchMove||!e.options.allowTouchMove(t))}))},gi=function(t){var e=t||window.event;return!!yi(e.target)||(e.touches.length>1||(e.preventDefault&&e.preventDefault(),!1))},mi=function(){void 0!==pi&&(document.body.style.paddingRight=pi,pi=void 0),void 0!==vi&&(document.body.style.overflow=vi,vi=void 0)},bi=function(t,e){if(t){if(!fi.some((function(e){return e.targetElement===t}))){var n={targetElement:t,options:e||{}};fi=[].concat(function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}(fi),[n]),li?(t.ontouchstart=function(t){1===t.targetTouches.length&&(hi=t.targetTouches[0].clientY)},t.ontouchmove=function(e){1===e.targetTouches.length&&function(t,e){var n=t.targetTouches[0].clientY-hi;!yi(t.target)&&(e&&0===e.scrollTop&&n>0||function(t){return!!t&&t.scrollHeight-t.scrollTop<=t.clientHeight}(e)&&n<0?gi(t):t.stopPropagation())}(e,t)},di||(document.addEventListener("touchmove",gi,si?{passive:!1}:void 0),di=!0)):function(t){if(void 0===pi){var e=!!t&&!0===t.reserveScrollBarGap,n=window.innerWidth-document.documentElement.clientWidth;e&&n>0&&(pi=document.body.style.paddingRight,document.body.style.paddingRight=n+"px")}void 0===vi&&(vi=document.body.style.overflow,document.body.style.overflow="hidden")}(e)}}else console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.")},wi=[],Si="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(ui||(ui={}));var xi,Ei=function(t){return Object.freeze(t)},Oi=function(t,e){this.inlineSize=t,this.blockSize=e,Ei(this)},ki=function(){function t(t,e,n,r){return this.x=t,this.y=e,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,Ei(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),_i=function(t){return t instanceof SVGElement&&"getBBox"in t},Pi=function(t){if(_i(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var i=t,o=i.offsetWidth,a=i.offsetHeight;return!(o||a||t.getClientRects().length)},Ti=function(t){var e;if(t instanceof Element)return!0;var n=null===(e=null===t||void 0===t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},Ri="undefined"!==typeof window?window:{},Ci=new WeakMap,ji=/auto|scroll/,Ni=/^tb|vertical/,Ai=/msie|trident/i.test(Ri.navigator&&Ri.navigator.userAgent),Di=function(t){return parseFloat(t||"0")},Li=function(t,e,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=!1),new Oi((n?e:t)||0,(n?t:e)||0)},Ii=Ei({devicePixelContentBoxSize:Li(),borderBoxSize:Li(),contentBoxSize:Li(),contentRect:new ki(0,0,0,0)}),Mi=function(t,e){if(void 0===e&&(e=!1),Ci.has(t)&&!e)return Ci.get(t);if(Pi(t))return Ci.set(t,Ii),Ii;var n=getComputedStyle(t),r=_i(t)&&t.ownerSVGElement&&t.getBBox(),i=!Ai&&"border-box"===n.boxSizing,o=Ni.test(n.writingMode||""),a=!r&&ji.test(n.overflowY||""),s=!r&&ji.test(n.overflowX||""),c=r?0:Di(n.paddingTop),u=r?0:Di(n.paddingRight),l=r?0:Di(n.paddingBottom),f=r?0:Di(n.paddingLeft),d=r?0:Di(n.borderTopWidth),h=r?0:Di(n.borderRightWidth),v=r?0:Di(n.borderBottomWidth),p=f+u,y=c+l,g=(r?0:Di(n.borderLeftWidth))+h,m=d+v,b=s?t.offsetHeight-m-t.clientHeight:0,w=a?t.offsetWidth-g-t.clientWidth:0,S=i?p+g:0,x=i?y+m:0,E=r?r.width:Di(n.width)-S-w,O=r?r.height:Di(n.height)-x-b,k=E+p+w+g,_=O+y+b+m,P=Ei({devicePixelContentBoxSize:Li(Math.round(E*devicePixelRatio),Math.round(O*devicePixelRatio),o),borderBoxSize:Li(k,_,o),contentBoxSize:Li(E,O,o),contentRect:new ki(f,c,E,O)});return Ci.set(t,P),P},Vi=function(t,e,n){var r=Mi(t,n),i=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(e){case ui.DEVICE_PIXEL_CONTENT_BOX:return a;case ui.BORDER_BOX:return i;default:return o}},zi=function(t){var e=Mi(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=Ei([e.borderBoxSize]),this.contentBoxSize=Ei([e.contentBoxSize]),this.devicePixelContentBoxSize=Ei([e.devicePixelContentBoxSize])},Fi=function(t){if(Pi(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},Bi=function(){var t=1/0,e=[];wi.forEach((function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach((function(e){var n=new zi(e.target),i=Fi(e.target);r.push(n),e.lastReportedSize=Vi(e.target,e.observedBox),i<t&&(t=i)})),e.push((function(){n.callback.call(n.observer,r,n.observer)})),n.activeTargets.splice(0,n.activeTargets.length)}}));for(var n=0,r=e;n<r.length;n++){(0,r[n])()}return t},Hi=function(t){wi.forEach((function(e){e.activeTargets.splice(0,e.activeTargets.length),e.skippedTargets.splice(0,e.skippedTargets.length),e.observationTargets.forEach((function(n){n.isActive()&&(Fi(n.target)>t?e.activeTargets.push(n):e.skippedTargets.push(n))}))}))},Gi=function(){var t=0;for(Hi(t);wi.some((function(t){return t.activeTargets.length>0}));)t=Bi(),Hi(t);return wi.some((function(t){return t.skippedTargets.length>0}))&&function(){var t;"function"===typeof ErrorEvent?t=new ErrorEvent("error",{message:Si}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=Si),window.dispatchEvent(t)}(),t>0},Zi=[],qi=function(t){if(!xi){var e=0,n=document.createTextNode("");new MutationObserver((function(){return Zi.splice(0).forEach((function(t){return t()}))})).observe(n,{characterData:!0}),xi=function(){n.textContent="".concat(e?e--:e++)}}Zi.push(t),xi()},Ki=0,$i={attributes:!0,characterData:!0,childList:!0,subtree:!0},Ui=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Wi=function(t){return void 0===t&&(t=0),Date.now()+t},Xi=!1,Ji=function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!Xi){Xi=!0;var n,r=Wi(t);n=function(){var n=!1;try{n=Gi()}finally{if(Xi=!1,t=r-Wi(),!Ki)return;n?e.run(1e3):t>0?e.run(t):e.start()}},qi((function(){requestAnimationFrame(n)}))}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,$i)};document.body?e():Ri.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Ui.forEach((function(e){return Ri.addEventListener(e,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Ui.forEach((function(e){return Ri.removeEventListener(e,t.listener,!0)})),this.stopped=!0)},t}(),Qi=new Ji,Yi=function(t){!Ki&&t>0&&Qi.start(),!(Ki+=t)&&Qi.stop()},to=function(){function t(t,e){this.target=t,this.observedBox=e||ui.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t=Vi(this.target,this.observedBox,!0);return function(t){return!_i(t)&&!function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)&&"inline"===getComputedStyle(t).display}(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},t}(),eo=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},no=new WeakMap,ro=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},io=function(){function t(){}return t.connect=function(t,e){var n=new eo(t,e);no.set(t,n)},t.observe=function(t,e,n){var r=no.get(t),i=0===r.observationTargets.length;ro(r.observationTargets,e)<0&&(i&&wi.push(r),r.observationTargets.push(new to(e,n&&n.box)),Yi(1),Qi.schedule())},t.unobserve=function(t,e){var n=no.get(t),r=ro(n.observationTargets,e),i=1===n.observationTargets.length;r>=0&&(i&&wi.splice(wi.indexOf(n),1),n.observationTargets.splice(r,1),Yi(-1))},t.disconnect=function(t){var e=this,n=no.get(t);n.observationTargets.slice().forEach((function(n){return e.unobserve(t,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},t}(),oo=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!==typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");io.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Ti(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");io.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Ti(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");io.unobserve(this,t)},t.prototype.disconnect=function(){io.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();function ao(t){if("string"===typeof t){var e={type:t,toString:function(){return t}};return e}return t}function so(t){return f(f({type:C},t),{toJSON:function(){t.onDone,t.onError;var e=d(t,["onDone","onError"]);return f(f({},e),{type:C,src:ao(t.src)})}})}var co="",uo="*",lo={},fo=function(t){return"#"===t[0]},ho=function(){function t(e,n,r,i){void 0===r&&(r="context"in e?e.context:void 0);var o,a=this;this.config=e,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===i||void 0===i?void 0:i.parent,this.key=this.config.key||(null===i||void 0===i?void 0:i.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],v(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&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:null!==(o=this.config.schema)&&void 0!==o?o:{},this.description=this.config.description,this.initial=this.config.initial,this.states=this.config.states?B(this.config.states,(function(e,n){var r,i=new t(e,{},void 0,{parent:a,key:n});return Object.assign(a.idMap,f(((r={})[i.id]=i,r),i.idMap)),i})):lo;var s=0;!function t(e){var n,r;e.order=s++;try{for(var i=h(vt(e)),o=i.next();!o.done;o=i.next()){t(o.value)}}catch(a){n={error:a}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}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(t){return t.event===co})):co in this.config.on),this.strict=!!this.config.strict,this.onEntry=$(this.config.entry||this.config.onEntry).map((function(t){return _t(t)})),this.onExit=$(this.config.exit||this.config.onExit).map((function(t){return _t(t)})),this.meta=this.config.meta,this.doneData="final"===this.type?this.config.data:void 0,this.invoke=$(this.config.invoke).map((function(t,e){var n,r;if(it(t)){var i=ft(a.id,e);return a.machine.options.services=f(((n={})[i]=t,n),a.machine.options.services),so({src:i,id:i})}if(et(t.src)){i=t.id||ft(a.id,e);return so(f(f({},t),{id:i,src:t.src}))}if(it(t.src)||tt(t.src)){i=t.id||ft(a.id,e);return a.machine.options.services=f(((r={})[i]=t.src,r),a.machine.options.services),so(f(f({id:i},t),{src:i}))}var o=t.src;return so(f(f({id:ft(a.id,e)},t),{src:o}))})),this.activities=$(this.config.activities).concat(this.invoke).map((function(t){return Tt(t)})),this.transition=this.transition.bind(this),this.tags=$(this.config.tags)}return t.prototype._init=function(){this.__cache.transitions||yt(this).forEach((function(t){return t.on}))},t.prototype.withConfig=function(e,n){var r=this.options,i=r.actions,o=r.activities,a=r.guards,s=r.services,c=r.delays;return new t(this.config,{actions:f(f({},i),e.actions),activities:f(f({},o),e.activities),guards:f(f({},a),e.guards),services:f(f({},s),e.services),delays:f(f({},c),e.delays)},null!==n&&void 0!==n?n:this.context)},t.prototype.withContext=function(e){return new t(this.config,this.options,e)},Object.defineProperty(t.prototype,"context",{get:function(){return tt(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(t.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:B(this.states,(function(t){return t.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}),t.prototype.toJSON=function(){return this.definition},Object.defineProperty(t.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var t=this.transitions;return this.__cache.on=t.reduce((function(t,e){return t[e.eventType]=t[e.eventType]||[],t[e.eventType].push(e),t}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),t.prototype.getCandidates=function(t){if(this.__cache.candidates[t])return this.__cache.candidates[t];var e=t===co,n=this.transitions.filter((function(n){var r=n.eventType===t;return e?r:r||n.eventType===uo}));return this.__cache.candidates[t]=n,n},t.prototype.getDelayedTransitions=function(){var t=this,e=this.config.after;if(!e)return[];var n=function(e,n){var r=function(t,e){var n=e?"#".concat(e):"";return"".concat(y.After,"(").concat(t,")").concat(n)}(tt(e)?"".concat(t.id,":delay[").concat(n,"]"):e,t.id);return t.onEntry.push(Rt(r,{delay:e})),t.onExit.push({type:k,sendId:r}),r},r=Y(e)?e.map((function(t,e){var r=n(t.delay,e);return f(f({},t),{event:r})})):q(Object.keys(e).map((function(t,r){var i=e[t],o=et(i)?{target:i}:i,a=isNaN(+t)?t:+t,s=n(a,r);return $(o).map((function(t){return f(f({},t),{event:s,delay:a})}))})));return r.map((function(e){var n=e.delay;return f(f({},t.formatTransition(e)),{delay:n})}))},t.prototype.getStateNodes=function(t){var e,n=this;if(!t)return[];var r=t instanceof It?t.value:z(t,this.delimiter);if(et(r)){var i=this.getStateNode(r).initial;return void 0!==i?this.getStateNodes(((e={})[r]=i,e)):[this,this.states[r]]}var o=Object.keys(r),a=[this];return a.push.apply(a,p([],v(q(o.map((function(t){return n.getStateNode(t).getStateNodes(r[t])})))),!1)),a},t.prototype.handles=function(t){var e=M(t);return this.events.includes(e)},t.prototype.resolveState=function(t){var e=t instanceof It?t:It.create(t),n=Array.from(gt([],this.getStateNodes(e.value)));return new It(f(f({},e),{value:this.resolve(e.value),configuration:n,done:xt(n,this),tags:Et(n),machine:this.machine}))},t.prototype.transitionLeafNode=function(t,e,n){var r=this.getStateNode(t).next(e,n);return r&&r.transitions.length?r:this.next(e,n)},t.prototype.transitionCompoundNode=function(t,e,n){var r=Object.keys(t),i=this.getStateNode(r[0])._transition(t[r[0]],e,n);return i&&i.transitions.length?i:this.next(e,n)},t.prototype.transitionParallelNode=function(t,e,n){var r,i,o={};try{for(var a=h(Object.keys(t)),s=a.next();!s.done;s=a.next()){var c=s.value,u=t[c];if(u){var l=this.getStateNode(c)._transition(u,e,n);l&&(o[c]=l)}}}catch(p){r={error:p}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}var f=Object.keys(o).map((function(t){return o[t]})),d=q(f.map((function(t){return t.transitions})));if(!f.some((function(t){return t.transitions.length>0})))return this.next(e,n);var v=q(Object.keys(o).map((function(t){return o[t].configuration})));return{transitions:d,exitSet:q(f.map((function(t){return t.exitSet}))),configuration:v,source:e,actions:q(Object.keys(o).map((function(t){return o[t].actions})))}},t.prototype._transition=function(t,e,n){return et(t)?this.transitionLeafNode(t,e,n):1===Object.keys(t).length?this.transitionCompoundNode(t,e,n):this.transitionParallelNode(t,e,n)},t.prototype.getTransitionData=function(t,e){return this._transition(t.value,t,at(e))},t.prototype.next=function(t,e){var n,r,i,o=this,a=e.name,s=[],c=[];try{for(var u=h(this.getCandidates(a)),l=u.next();!l.done;l=u.next()){var f=l.value,d=f.cond,y=f.in,g=t.context,m=!y||(et(y)&&fo(y)?t.matches(z(this.getStateNodeById(y).path,this.delimiter)):I(z(y,this.delimiter),G(this.path.slice(0,-2))(t.value))),b=!1;try{b=!d||ct(this.machine,d,g,e,t)}catch(S){throw new Error("Unable to evaluate guard '".concat(d.name||d.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,"':\n").concat(S.message))}if(b&&m){void 0!==f.target&&(c=f.target),s.push.apply(s,p([],v(f.actions),!1)),i=f;break}}}catch(x){n={error:x}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}if(i){if(!c.length)return{transitions:[i],exitSet:[],configuration:t.value?[this]:[],source:t,actions:s};var w=q(c.map((function(e){return o.getRelativeStateNodes(e,t.historyValue)})));return{transitions:[i],exitSet:!!i.internal?[]:q(c.map((function(t){return o.getPotentiallyReenteringNodes(t)}))),configuration:w,source:t,actions:s}}},t.prototype.getPotentiallyReenteringNodes=function(t){if(this.order<t.order)return[this];for(var e=[],n=this,r=t;n&&n!==r;)e.push(n),n=n.parent;return n!==r?[]:(e.push(r),e)},t.prototype.getActions=function(t,e,n,r,i,o,a){var s,c,u,l,f=this,d=o?gt([],this.getStateNodes(o.value)):[],g=new Set;try{for(var m=h(Array.from(t).sort((function(t,e){return t.order-e.order}))),b=m.next();!b.done;b=m.next()){(!St(d,x=b.value)||St(n.exitSet,x)||x.parent&&g.has(x.parent))&&g.add(x)}}catch(C){s={error:C}}finally{try{b&&!b.done&&(c=m.return)&&c.call(m)}finally{if(s)throw s.error}}try{for(var w=h(d),S=w.next();!S.done;S=w.next()){var x;St(t,x=S.value)&&!St(n.exitSet,x.parent)||n.exitSet.push(x)}}catch(j){u={error:j}}finally{try{S&&!S.done&&(l=w.return)&&l.call(w)}finally{if(u)throw u.error}}n.exitSet.sort((function(t,e){return e.order-t.order}));var O=Array.from(g).sort((function(t,e){return t.order-e.order})),k=new Set(n.exitSet),_=q(O.map((function(t){var e=[];if("final"!==t.type)return e;var o=t.parent;if(!o.parent)return e;e.push(Ct(t.id,t.doneData),Ct(o.id,t.doneData?U(t.doneData,r,i):void 0));var a=o.parent;return"parallel"===a.type&&pt(a).every((function(t){return xt(n.configuration,t)}))&&e.push(Ct(a.id)),e}))),P=O.map((function(t){var e=t.onEntry,n=t.activities.map((function(t){return function(t){var e=Tt(t);return{type:y.Start,activity:e,exec:void 0}}(t)}));return{type:"entry",actions:Pt(a?p(p([],v(e),!1),v(n),!1):p(p([],v(n),!1),v(e),!1),f.machine.options.actions)}})).concat({type:"state_done",actions:_.map((function(t){return function(t,e){return{type:E,event:"function"===typeof t?t:ot(t),delay:e?e.delay:void 0,id:null===e||void 0===e?void 0:e.id}}(t)}))}),T=Array.from(k).map((function(t){return{type:"exit",actions:Pt(p(p([],v(t.onExit),!1),v(t.activities.map((function(t){return function(t){var e=tt(t)?t:Tt(t);return{type:y.Stop,activity:e,exec:void 0}}(t)}))),!1),f.machine.options.actions)}})).concat({type:"transition",actions:Pt(n.actions,this.machine.options.actions)}).concat(P);if(e){var R=Pt(q(p([],v(t),!1).sort((function(t,e){return e.order-t.order})).map((function(t){return t.onExit}))),this.machine.options.actions).filter((function(t){return!dt(t)}));return T.concat({type:"stop",actions:R})}return T},t.prototype.transition=function(t,e,n,r){void 0===t&&(t=this.initialState);var i,o,a=at(e);if(t instanceof It)i=void 0===n?t:this.resolveState(It.from(t,n));else{var s=et(t)?this.resolve(F(this.getResolvedPath(t))):this.resolve(t),c=null!==n&&void 0!==n?n:this.machine.context;i=this.resolveState(It.from(s,c))}if(this.strict&&!this.events.includes(a.name)&&(o=a.name,!/^(done|error)\./.test(o)))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(a.name,"'"));var u=this._transition(i.value,i,a)||{transitions:[],configuration:[],exitSet:[],source:i,actions:[]},l=gt([],this.getStateNodes(i.value)),f=u.configuration.length?gt(l,u.configuration):l;return u.configuration=p([],v(f),!1),this.resolveTransition(u,i,i.context,r,a)},t.prototype.resolveRaisedTransition=function(t,e,n,r){var i,o=t.actions;return(t=this.transition(t,e,void 0,r))._event=n,t.event=n.data,(i=t.actions).unshift.apply(i,p([],v(o),!1)),t},t.prototype.resolveTransition=function(t,e,n,r,i){var o,a,s,c,u=this;void 0===i&&(i=Ot);var l=t.configuration,d=!e||t.transitions.length>0,p=d?t.configuration:e?e.configuration:[],y=xt(p,this),g=d?wt(this.machine,l):void 0,m=e?e.historyValue?e.historyValue:t.source?this.machine.historyValue(e.value):void 0:void 0,b=this.getActions(new Set(p),y,t,n,i,e,r),w=e?f({},e.activities):{};try{for(var E=h(b),O=E.next();!O.done;O=E.next()){var k=O.value;try{for(var P=(s=void 0,h(k.actions)),T=P.next();!T.done;T=P.next()){var R=T.value;R.type===S?w[R.activity.id||R.activity.type]=R:R.type===x&&(w[R.activity.id||R.activity.type]=!1)}}catch(J){s={error:J}}finally{try{T&&!T.done&&(c=P.return)&&c.call(P)}finally{if(s)throw s.error}}}}catch(Q){o={error:Q}}finally{try{O&&!O.done&&(a=E.return)&&a.call(E)}finally{if(o)throw o.error}}var j,N,D=v(At(this,e,n,i,b,r,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),L=D[0],I=D[1],M=v(function(t,e){var n,r,i=v([[],[]],2),o=i[0],a=i[1];try{for(var s=h(t),c=s.next();!c.done;c=s.next()){var u=c.value;e(u)?o.push(u):a.push(u)}}catch(Q){n={error:Q}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return[o,a]}(L,dt),2),V=M[0],z=M[1],F=L.filter((function(t){var e;return t.type===S&&(null===(e=t.activity)||void 0===e?void 0:e.type)===C})),B=F.reduce((function(t,e){return t[e.activity.id]=function(t,e,n,r){var i,o=ut(t.src),a=null===(i=null===e||void 0===e?void 0:e.options.services)||void 0===i?void 0:i[o.type],s=t.data?U(t.data,n,r):void 0,c=a?Gt(a,t.id,s):Ht(t.id);return c.meta=t,c}(e.activity,u.machine,I,i),t}),e?f({},e.children):{}),H=new It({value:g||e.value,context:I,_event:i,_sessionid:e?e._sessionid:null,historyValue:g?m?(j=m,N=g,{current:N,states:X(j,N)}):void 0:e?e.historyValue:void 0,history:!g||t.source?e:void 0,actions:g?z:[],activities:g?w:e?e.activities:{},events:[],configuration:p,transitions:t.transitions,children:B,done:y,tags:Et(p),machine:this}),G=n!==I;H.changed=i.name===A||G;var Z=H.history;Z&&delete Z.history;var q=!y&&(this._transient||l.some((function(t){return t._transient})));if(!d&&(!q||i.name===co))return H;var K=H;if(!y)for(q&&(K=this.resolveRaisedTransition(K,{type:_},i,r));V.length;){var $=V.shift();K=this.resolveRaisedTransition(K,$._event,i,r)}var W=K.changed||(Z?!!K.actions.length||G||typeof Z.value!==typeof K.value||!Dt(K.value,Z.value):void 0);return K.changed=W,K.history=Z,K},t.prototype.getStateNode=function(t){if(fo(t))return this.machine.getStateNodeById(t);if(!this.states)throw new Error("Unable to retrieve child state '".concat(t,"' from '").concat(this.id,"'; no child states exist."));var e=this.states[t];if(!e)throw new Error("Child state '".concat(t,"' does not exist on '").concat(this.id,"'"));return e},t.prototype.getStateNodeById=function(t){var e=fo(t)?t.slice("#".length):t;if(e===this.id)return this;var n=this.machine.idMap[e];if(!n)throw new Error("Child state node '#".concat(e,"' does not exist on machine '").concat(this.id,"'"));return n},t.prototype.getStateNodeByPath=function(t){if("string"===typeof t&&fo(t))try{return this.getStateNodeById(t.slice(1))}catch(i){}for(var e=V(t,this.delimiter).slice(),n=this;e.length;){var r=e.shift();if(!r.length)break;n=n.getStateNode(r)}return n},t.prototype.resolve=function(t){var e,n=this;if(!t)return this.initialStateValue||lo;switch(this.type){case"parallel":return B(this.initialStateValue,(function(e,r){return e?n.getStateNode(r).resolve(t[r]||e):lo}));case"compound":if(et(t)){var r=this.getStateNode(t);return"parallel"===r.type||"compound"===r.type?((e={})[t]=r.initialStateValue,e):t}return Object.keys(t).length?B(t,(function(t,e){return t?n.getStateNode(e).resolve(t):lo})):this.initialStateValue||{};default:return t||lo}},t.prototype.getResolvedPath=function(t){if(fo(t)){var e=this.machine.idMap[t.slice("#".length)];if(!e)throw new Error("Unable to find state node '".concat(t,"'"));return e.path}return V(t,this.delimiter)},Object.defineProperty(t.prototype,"initialStateValue",{get:function(){var t,e;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;if("parallel"===this.type)e=H(this.states,(function(t){return t.initialStateValue||lo}),(function(t){return!("history"===t.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,"'"));e=ht(this.states[this.initial])?this.initial:((t={})[this.initial]=this.states[this.initial].initialStateValue,t)}else e={};return this.__cache.initialStateValue=e,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),t.prototype.getInitialState=function(t,e){this._init();var n=this.getStateNodes(t);return this.resolveTransition({configuration:n,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,null!==e&&void 0!==e?e:this.machine.context,void 0)},Object.defineProperty(t.prototype,"initialState",{get:function(){var t=this.initialStateValue;if(!t)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"target",{get:function(){var t;if("history"===this.type){var e=this.config;t=et(e.target)&&fo(e.target)?F(this.machine.getStateNodeById(e.target).path.slice(this.path.length-1)):e.target}return t},enumerable:!1,configurable:!0}),t.prototype.getRelativeStateNodes=function(t,e,n){return void 0===n&&(n=!0),n?"history"===t.type?t.resolveHistory(e):t.initialStateNodes:[t]},Object.defineProperty(t.prototype,"initialStateNodes",{get:function(){var t=this;return ht(this)?[this]:"compound"!==this.type||this.initial?q(Z(this.initialStateValue).map((function(e){return t.getFromRelativePath(e)}))):[this]},enumerable:!1,configurable:!0}),t.prototype.getFromRelativePath=function(t){if(!t.length)return[this];var e=v(t),n=e[0],r=e.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(n,"' from node with no states"));var i=this.getStateNode(n);if("history"===i.type)return i.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)},t.prototype.historyValue=function(t){if(Object.keys(this.states).length)return{current:t||this.initialStateValue,states:H(this.states,(function(e,n){if(!t)return e.historyValue();var r=et(t)?void 0:t[n];return e.historyValue(r||e.initialStateValue)}),(function(t){return!t.history}))}},t.prototype.resolveHistory=function(t){var e=this;if("history"!==this.type)return[this];var n=this.parent;if(!t){var r=this.target;return r?q(Z(r).map((function(t){return n.getFromRelativePath(t)}))):n.initialStateNodes}var i,o,a=(i=n.path,o="states",function(t){var e,n,r=t;try{for(var a=h(i),s=a.next();!s.done;s=a.next()){var c=s.value;r=r[o][c]}}catch(u){e={error:u}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return r})(t).current;return et(a)?[n.getStateNode(a)]:q(Z(a).map((function(t){return"deep"===e.history?n.getFromRelativePath(t):[n.states[t[0]]]})))},Object.defineProperty(t.prototype,"stateIds",{get:function(){var t=this,e=q(Object.keys(this.states).map((function(e){return t.states[e].stateIds})));return[this.id].concat(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"events",{get:function(){var t,e,n,r;if(this.__cache.events)return this.__cache.events;var i=this.states,o=new Set(this.ownEvents);if(i)try{for(var a=h(Object.keys(i)),s=a.next();!s.done;s=a.next()){var c=i[s.value];if(c.states)try{for(var u=(n=void 0,h(c.events)),l=u.next();!l.done;l=u.next()){var f=l.value;o.add("".concat(f))}}catch(d){n={error:d}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}}catch(v){t={error:v}}finally{try{s&&!s.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}return this.__cache.events=Array.from(o)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ownEvents",{get:function(){var t=new Set(this.transitions.filter((function(t){return!(!t.target&&!t.actions.length&&t.internal)})).map((function(t){return t.eventType})));return Array.from(t)},enumerable:!1,configurable:!0}),t.prototype.resolveTarget=function(t){var e=this;if(void 0!==t)return t.map((function(t){if(!et(t))return t;var n=t[0]===e.delimiter;if(n&&!e.parent)return e.getStateNodeByPath(t.slice(1));var r=n?e.key+t:t;if(!e.parent)return e.getStateNodeByPath(r);try{return e.parent.getStateNodeByPath(r)}catch(i){throw new Error("Invalid transition definition for state node '".concat(e.id,"':\n").concat(i.message))}}))},t.prototype.formatTransition=function(t){var e=this,n=function(t){if(void 0!==t&&""!==t)return $(t)}(t.target),r="internal"in t?t.internal:!n||n.some((function(t){return et(t)&&t[0]===e.delimiter})),i=this.machine.options.guards,o=this.resolveTarget(n),a=f(f({},t),{actions:Pt($(t.actions)),cond:nt(t.cond,i),target:o,source:this,internal:r,eventType:t.event,toJSON:function(){return f(f({},a),{target:a.target?a.target.map((function(t){return"#".concat(t.id)})):void 0,source:"#".concat(e.id)})}});return a},t.prototype.formatTransitions=function(){var t,e,n,r=this;if(this.config.on)if(Array.isArray(this.config.on))n=this.config.on;else{var i=this.config.on,o=uo,a=i[o],s=void 0===a?[]:a,c=d(i,["*"]);n=q(Object.keys(c).map((function(t){var e=st(t,c[t]);return e})).concat(st(uo,s)))}else n=[];var u=this.config.always?st("",this.config.always):[],l=this.config.onDone?st(String(Ct(this.id)),this.config.onDone):[];var f=q(this.invoke.map((function(t){var e=[];return t.onDone&&e.push.apply(e,p([],v(st(String(jt(t.id)),t.onDone)),!1)),t.onError&&e.push.apply(e,p([],v(st(String(Nt(t.id)),t.onError)),!1)),e}))),y=this.after,g=q(p(p(p(p([],v(l),!1),v(f),!1),v(n),!1),v(u),!1).map((function(t){return $(t).map((function(t){return r.formatTransition(t)}))})));try{for(var m=h(y),b=m.next();!b.done;b=m.next()){var w=b.value;g.push(w)}}catch(S){t={error:S}}finally{try{b&&!b.done&&(e=m.return)&&e.call(m)}finally{if(t)throw t.error}}return g},t}();var vo=function(t){return{type:P,assignment:t}};function po(){return po=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},po.apply(this,arguments)}function yo(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)e.indexOf(n=o[r])>=0||(i[n]=t[n]);return i}var go="undefined"!=typeof window?o.useLayoutEffect:o.useEffect;function mo(t,e,n){return e=(e=+e)==e?e:0,n=(n=+n)==n?n:0,(t=+t)==t&&(t=(t=t<=n?t:n)>=e?t:e),t}function bo(t){var e=Math.round(t);if(Number.isNaN(t))throw new TypeError("Found a NaN! Check your snapPoints / defaultSnap / snapTo ");return e}var wo={box:"border-box"};function So(t,e){var n=e.label,r=e.enabled,i=e.resizeSourceRef,a=(0,o.useState)(0),s=a[0],c=a[1];(0,o.useDebugValue)(n+": "+s);var u=(0,o.useCallback)((function(t){c(t[0].borderBoxSize[0].blockSize),i.current="element"}),[i]);return go((function(){if(t.current&&r){var e=new oo(u);return e.observe(t.current,wo),function(){e.disconnect()}}}),[t,u,r]),r?s:0}function xo(t){return void 0===t&&(t=1e3),new Promise((function(e){return setTimeout(e,t)}))}var Eo={DRAG:{target:"#overlay.dragging",actions:"onOpenEnd"}},Oo={RESIZE:{target:"#overlay.resizing",actions:"onOpenEnd"}},ko=function(t,e,n){return void 0===n&&(n=t.context),new ho(t,e,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:po({},Eo,Oo)}}},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:po({},Eo,Oo)}}},end:{invoke:{src:"onOpenEnd",onDone:"done"},on:{CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:po({},{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:[vo({y:function(t,e){return e.payload.y},velocity:function(t,e){return e.payload.velocity},snapSource:function(t,e){var n=e.payload.source;return void 0===n?"custom":n}})]},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(t,e){},onSnapCancel:function(t,e){},onResizeCancel:function(t,e){},onCloseCancel:function(t,e){},onOpenEnd:function(t,e){},onSnapEnd:function(t,e){},onRezizeEnd:function(t,e){}},services:{onSnapStart:function(){try{return Promise.resolve(xo()).then((function(){}))}catch(t){return Promise.reject(t)}},onOpenStart:function(){try{return Promise.resolve(xo()).then((function(){}))}catch(t){return Promise.reject(t)}},onCloseStart:function(){try{return Promise.resolve(xo()).then((function(){}))}catch(t){return Promise.reject(t)}},onResizeStart:function(){try{return Promise.resolve(xo()).then((function(){}))}catch(t){return Promise.reject(t)}},onSnapEnd:function(){try{return Promise.resolve(xo()).then((function(){}))}catch(t){return Promise.reject(t)}},onOpenEnd:function(){try{return Promise.resolve(xo()).then((function(){}))}catch(t){return Promise.reject(t)}},onCloseEnd:function(){try{return Promise.resolve(xo()).then((function(){}))}catch(t){return Promise.reject(t)}},onResizeEnd:function(){try{return Promise.resolve(xo()).then((function(){}))}catch(t){return Promise.reject(t)}},renderVisuallyHidden:function(t,e){try{return Promise.resolve(xo()).then((function(){}))}catch(t){return Promise.reject(t)}},activate:function(t,e){try{return Promise.resolve(xo()).then((function(){}))}catch(t){return Promise.reject(t)}},deactivate:function(t,e){try{return Promise.resolve(xo()).then((function(){}))}catch(t){return Promise.reject(t)}},openSmoothly:function(t,e){try{return Promise.resolve(xo()).then((function(){}))}catch(t){return Promise.reject(t)}},openImmediately:function(t,e){try{return Promise.resolve(xo()).then((function(){}))}catch(t){return Promise.reject(t)}},snapSmoothly:function(t,e){try{return Promise.resolve(xo()).then((function(){}))}catch(t){return Promise.reject(t)}},resizeSmoothly:function(t,e){try{return Promise.resolve(xo()).then((function(){}))}catch(t){return Promise.reject(t)}},closeSmoothly:function(t,e){try{return Promise.resolve(xo()).then((function(){}))}catch(t){return Promise.reject(t)}}},guards:{initiallyClosed:function(t){return"CLOSED"===t.initialState},initiallyOpen:function(t){return"OPEN"===t.initialState}}}),_o=["children","sibling","className","footer","header","open","initialState","lastSnapRef","initialFocusRef","onDismiss","maxHeight","defaultSnap","snapPoints","blocking","scrollLocking","style","onSpringStart","onSpringCancel","onSpringEnd","reserveScrollBarGap","expandOnContentDrag"],Po=["velocity"],To=["onRest","config"],Ro={tension:170,friction:26},Co=Ro.tension,jo=Ro.friction,No=a().forwardRef((function(t,e){var n=t.children,r=t.sibling,i=t.className,s=t.footer,c=t.header,u=t.open,l=t.initialState,f=t.lastSnapRef,d=t.initialFocusRef,h=t.onDismiss,v=t.maxHeight,p=t.defaultSnap,y=void 0===p?Do:p,g=t.snapPoints,m=void 0===g?Lo:g,b=t.blocking,w=void 0===b||b,S=t.scrollLocking,x=void 0===S||S,E=t.style,O=t.onSpringStart,k=t.onSpringCancel,_=t.onSpringEnd,P=t.reserveScrollBarGap,T=void 0===P?w:P,R=t.expandOnContentDrag,C=void 0!==R&&R,j=yo(t,_o),N=function(){var t=(0,o.useState)(!1),e=t[0],n=t[1],r=(0,o.useState)({}),i=r[0],a=r[1],s=(0,o.useCallback)((function(t){return a((function(e){var n;return po({},e,((n={})[t]=!1,n))})),function(){a((function(e){var n;return po({},e,((n={})[t]=!0,n))}))}}),[]);return(0,o.useEffect)((function(){var t=Object.values(i);0!==t.length&&t.every(Boolean)&&n(!0)}),[i]),{ready:e,registerReady:s}}(),A=N.ready,D=N.registerReady,L=(0,o.useRef)(!1),I=(0,o.useRef)(O),M=(0,o.useRef)(k),V=(0,o.useRef)(_);(0,o.useEffect)((function(){I.current=O,M.current=k,V.current=_}),[k,O,_]);var z,F,B=(t=>{const e=ge.fun(t),n=Qe(1,e?t:[t]),r=n[0],i=n[1],o=n[2];return e?[r[0],i,o]:r})((function(){return{y:0,ready:0,maxHeight:0,minSnap:0,maxSnap:0}})),H=B[0],G=B[1],Z=(0,o.useRef)(null),q=(0,o.useRef)(null),K=(0,o.useRef)(null),$=(0,o.useRef)(null),U=(0,o.useRef)(null),W=(0,o.useRef)(null),X=(0,o.useRef)(0),J=(0,o.useRef)(),Q=(0,o.useRef)(!1),Y=(z=(0,o.useMemo)((function(){return"undefined"!=typeof window?window.matchMedia("(prefers-reduced-motion: reduce)"):null}),[]),F=(0,o.useRef)(null==z?void 0:z.matches),(0,o.useDebugValue)(F.current?"reduce":"no-preference"),(0,o.useEffect)((function(){var t=function(t){F.current=t.matches};return null==z||z.addListener(t),function(){return null==z?void 0:z.removeListener(t)}}),[z]),F),tt=function(t){var e=t.targetRef,n=t.enabled,r=t.reserveScrollBarGap,i=(0,o.useRef)({activate:function(){throw new TypeError("Tried to activate scroll lock too early")},deactivate:function(){}});return(0,o.useDebugValue)(n?"Enabled":"Disabled"),(0,o.useEffect)((function(){if(!n)return i.current.deactivate(),void(i.current={activate:function(){},deactivate:function(){}});var t=e.current,o=!1;i.current={activate:function(){o||(o=!0,bi(t,{allowTouchMove:function(t){return t.closest("[data-body-scroll-lock-ignore]")},reserveScrollBarGap:r}))},deactivate:function(){var e;o&&(o=!1,(e=t)?(fi=fi.filter((function(t){return t.targetElement!==e})),li?(e.ontouchstart=null,e.ontouchmove=null,di&&0===fi.length&&(document.removeEventListener("touchmove",gi,si?{passive:!1}:void 0),di=!1)):fi.length||mi()):console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices."))}}}),[n,e,r]),i}({targetRef:q,enabled:A&&x,reserveScrollBarGap:T}),et=function(t){var e=t.targetRef,n=t.enabled,r=(0,o.useRef)({activate:function(){throw new TypeError("Tried to activate aria hider too early")},deactivate:function(){}});return(0,o.useDebugValue)(n?"Enabled":"Disabled"),(0,o.useEffect)((function(){if(!n)return r.current.deactivate(),void(r.current={activate:function(){},deactivate:function(){}});var t=e.current,i=!1,o=[],a=[];r.current={activate:function(){if(!i){i=!0;var e=t.parentNode;document.querySelectorAll("body > *").forEach((function(t){if(t!==e){var n=t.getAttribute("aria-hidden");null!==n&&"false"!==n||(o.push(n),a.push(t),t.setAttribute("aria-hidden","true"))}}))}},deactivate:function(){i&&(i=!1,a.forEach((function(t,e){var n=o[e];null===n?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden",n)})),o=[],a=[])}}}),[e,n]),r}({targetRef:Z,enabled:A&&w}),nt=function(t){var e=t.targetRef,n=t.fallbackRef,r=t.initialFocusRef,i=t.enabled,a=(0,o.useRef)({activate:function(){throw new TypeError("Tried to activate focus trap too early")},deactivate:function(){}});return(0,o.useDebugValue)(i?"Enabled":"Disabled"),(0,o.useEffect)((function(){if(!i)return a.current.deactivate(),void(a.current={activate:function(){},deactivate:function(){}});var t=n.current,o=ai(e.current,{onActivate:void 0,initialFocus:r?function(){return(null==r?void 0:r.current)||t}:void 0,fallbackFocus:t,escapeDeactivates:!1,clickOutsideDeactivates:!1}),s=!1;a.current={activate:function(){try{return s?Promise.resolve():(s=!0,Promise.resolve(o.activate()).then((function(){return Promise.resolve(new Promise((function(t){return setTimeout((function(){return t(void 0)}),0)}))).then((function(){}))})))}catch(t){return Promise.reject(t)}},deactivate:function(){s&&(s=!1,o.deactivate())}}}),[i,n,r,e]),a}({targetRef:Z,fallbackRef:W,initialFocusRef:d||void 0,enabled:A&&w&&!1!==d}),rt=function(t){var e=t.getSnapPoints,n=t.heightRef,r=t.lastSnapRef,i=t.ready,a=function(t){var e=t.contentRef,n=t.controlledMaxHeight,r=t.footerEnabled,i=t.footerRef,a=t.headerEnabled,s=t.headerRef,c=t.registerReady,u=t.resizeSourceRef,l=(0,o.useMemo)((function(){return c("contentHeight")}),[c]),f=function(t,e,n){var r=(0,o.useMemo)((function(){return e("maxHeight")}),[e]),i=(0,o.useState)((function(){return bo(t)||"undefined"!=typeof window?window.innerHeight:0})),a=i[0],s=i[1],c=a>0,u=(0,o.useRef)(0);return(0,o.useDebugValue)(t?"controlled":"auto"),(0,o.useEffect)((function(){c&&r()}),[c,r]),go((function(){if(t)return s(bo(t)),void(n.current="maxheightprop");var e=function(){u.current||(u.current=requestAnimationFrame((function(){s(window.innerHeight),n.current="window",u.current=0})))};return window.addEventListener("resize",e),s(window.innerHeight),n.current="window",r(),function(){window.removeEventListener("resize",e),cancelAnimationFrame(u.current)}}),[t,r,n]),a}(n,c,u),d=So(s,{label:"headerHeight",enabled:a,resizeSourceRef:u}),h=So(e,{label:"contentHeight",enabled:!0,resizeSourceRef:u}),v=So(i,{label:"footerHeight",enabled:r,resizeSourceRef:u}),p=Math.min(f-d-v,h)+d+v;(0,o.useDebugValue)("minHeight: "+p);var y=h>0;return(0,o.useEffect)((function(){y&&l()}),[y,l]),{maxHeight:f,minHeight:p,headerHeight:d,footerHeight:v}}({contentRef:t.contentRef,controlledMaxHeight:t.controlledMaxHeight,footerEnabled:t.footerEnabled,footerRef:t.footerRef,headerEnabled:t.headerEnabled,headerRef:t.headerRef,registerReady:t.registerReady,resizeSourceRef:t.resizeSourceRef}),s=a.maxHeight,c=a.minHeight,u=a.headerHeight,l=a.footerHeight,f=function(t,e){var n=[].concat(t).map(bo).reduce((function(t,n){return t.add(mo(n,0,e)),t}),new Set),r=Array.from(n),i=Math.min.apply(Math,r);if(Number.isNaN(i))throw new TypeError("minSnap is NaN");var o=Math.max.apply(Math,r);if(Number.isNaN(o))throw new TypeError("maxSnap is NaN");return{snapPoints:r,minSnap:i,maxSnap:o}}(i?e({height:n.current,footerHeight:l,headerHeight:u,minHeight:c,maxHeight:s}):[0],s),d=f.snapPoints,h=f.minSnap,v=f.maxSnap;return(0,o.useDebugValue)("minSnap: "+h+", maxSnap:"+v),{minSnap:h,maxSnap:v,findSnap:function(t){var e=bo("function"==typeof t?t({footerHeight:l,headerHeight:u,height:n.current,minHeight:c,maxHeight:s,snapPoints:d,lastSnap:r.current}):t);return d.reduce((function(t,n){return Math.abs(n-e)<Math.abs(t-e)?n:t}),h)},maxHeight:s}}({contentRef:K,controlledMaxHeight:v,footerEnabled:!!s,footerRef:U,getSnapPoints:m,headerEnabled:!1!==c,headerRef:$,heightRef:X,lastSnapRef:f,ready:A,registerReady:D,resizeSourceRef:J}),it=rt.minSnap,ot=rt.maxSnap,at=rt.maxHeight,st=rt.findSnap,ct=(0,o.useRef)(at),ut=(0,o.useRef)(it),lt=(0,o.useRef)(ot),ft=(0,o.useRef)(st),dt=(0,o.useRef)(0);go((function(){ct.current=at,lt.current=ot,ut.current=it,ft.current=st,dt.current=st(y)}),[st,y,at,ot,it]);var ht=(0,o.useCallback)((function(t){var e=t.onRest,n=t.config,r=(n=void 0===n?{}:n).velocity,i=void 0===r?1:r,o=yo(n,Po),a=yo(t,To);return new Promise((function(t){return G(po({},a,{config:po({velocity:i},o,{mass:1,tension:Co,friction:Math.max(jo,jo+(jo-jo*i))}),onRest:function(){var n=[].slice.call(arguments);t.apply(void 0,n),null==e||e.apply(void 0,n)}}))}))}),[G]),vt=ve(ko,{devTools:!1,actions:{onOpenCancel:(0,o.useCallback)((function(){return null==M.current?void 0:M.current({type:"OPEN"})}),[]),onSnapCancel:(0,o.useCallback)((function(t){return null==M.current?void 0:M.current({type:"SNAP",source:t.snapSource})}),[]),onCloseCancel:(0,o.useCallback)((function(){return null==M.current?void 0:M.current({type:"CLOSE"})}),[]),onResizeCancel:(0,o.useCallback)((function(){return null==M.current?void 0:M.current({type:"RESIZE",source:J.current})}),[]),onOpenEnd:(0,o.useCallback)((function(){return null==V.current?void 0:V.current({type:"OPEN"})}),[]),onSnapEnd:(0,o.useCallback)((function(t,e){return null==V.current?void 0:V.current({type:"SNAP",source:t.snapSource})}),[]),onResizeEnd:(0,o.useCallback)((function(){return null==V.current?void 0:V.current({type:"RESIZE",source:J.current})}),[])},context:{initialState:l},services:{onSnapStart:(0,o.useCallback)((function(t,e){try{return Promise.resolve(null==I.current?void 0:I.current({type:"SNAP",source:e.payload.source||"custom"}))}catch(t){return Promise.reject(t)}}),[]),onOpenStart:(0,o.useCallback)((function(){try{return Promise.resolve(null==I.current?void 0:I.current({type:"OPEN"}))}catch(t){return Promise.reject(t)}}),[]),onCloseStart:(0,o.useCallback)((function(){try{return Promise.resolve(null==I.current?void 0:I.current({type:"CLOSE"}))}catch(t){return Promise.reject(t)}}),[]),onResizeStart:(0,o.useCallback)((function(){try{return Promise.resolve(null==I.current?void 0:I.current({type:"RESIZE",source:J.current}))}catch(t){return Promise.reject(t)}}),[]),onSnapEnd:(0,o.useCallback)((function(t,e){try{return Promise.resolve(null==V.current?void 0:V.current({type:"SNAP",source:t.snapSource}))}catch(t){return Promise.reject(t)}}),[]),onOpenEnd:(0,o.useCallback)((function(){try{return Promise.resolve(null==V.current?void 0:V.current({type:"OPEN"}))}catch(t){return Promise.reject(t)}}),[]),onCloseEnd:(0,o.useCallback)((function(){try{return Promise.resolve(null==V.current?void 0:V.current({type:"CLOSE"}))}catch(t){return Promise.reject(t)}}),[]),onResizeEnd:(0,o.useCallback)((function(){try{return Promise.resolve(null==V.current?void 0:V.current({type:"RESIZE",source:J.current}))}catch(t){return Promise.reject(t)}}),[]),renderVisuallyHidden:(0,o.useCallback)((function(t,e){try{return Promise.resolve(ht({y:dt.current,ready:0,maxHeight:ct.current,maxSnap:lt.current,minSnap:dt.current,immediate:!0})).then((function(){}))}catch(t){return Promise.reject(t)}}),[ht]),activate:(0,o.useCallback)((function(t,e){try{return L.current=!0,Promise.resolve(Promise.all([tt.current.activate(),nt.current.activate(),et.current.activate()])).then((function(){}))}catch(t){return Promise.reject(t)}}),[et,nt,tt]),deactivate:(0,o.useCallback)((function(){try{return tt.current.deactivate(),nt.current.deactivate(),et.current.deactivate(),L.current=!1,Promise.resolve()}catch(t){return Promise.reject(t)}}),[et,nt,tt]),openImmediately:(0,o.useCallback)((function(){try{return X.current=dt.current,Promise.resolve(ht({y:dt.current,ready:1,maxHeight:ct.current,maxSnap:lt.current,minSnap:dt.current,immediate:!0})).then((function(){}))}catch(t){return Promise.reject(t)}}),[ht]),openSmoothly:(0,o.useCallback)((function(){try{return Promise.resolve(ht({y:0,ready:1,maxHeight:ct.current,maxSnap:lt.current,minSnap:dt.current,immediate:!0})).then((function(){return X.current=dt.current,Promise.resolve(ht({y:dt.current,ready:1,maxHeight:ct.current,maxSnap:lt.current,minSnap:dt.current,immediate:Y.current})).then((function(){}))}))}catch(t){return Promise.reject(t)}}),[ht,Y]),snapSmoothly:(0,o.useCallback)((function(t,e){try{var n=ft.current(t.y);return X.current=n,f.current=n,Promise.resolve(ht({y:n,ready:1,maxHeight:ct.current,maxSnap:lt.current,minSnap:ut.current,immediate:Y.current,config:{velocity:t.velocity}})).then((function(){}))}catch(t){return Promise.reject(t)}}),[ht,f,Y]),resizeSmoothly:(0,o.useCallback)((function(){try{var t=ft.current(X.current);return X.current=t,f.current=t,Promise.resolve(ht({y:t,ready:1,maxHeight:ct.current,maxSnap:lt.current,minSnap:ut.current,immediate:"element"!==J.current||Y.current})).then((function(){}))}catch(t){return Promise.reject(t)}}),[ht,f,Y]),closeSmoothly:(0,o.useCallback)((function(t,e){try{return ht({minSnap:X.current,immediate:!0}),X.current=0,Promise.resolve(ht({y:0,maxHeight:ct.current,maxSnap:lt.current,immediate:Y.current})).then((function(){return Promise.resolve(ht({ready:0,immediate:!0})).then((function(){}))}))}catch(t){return Promise.reject(t)}}),[ht,Y])}}),pt=vt[0],yt=vt[1];(0,o.useEffect)((function(){A&&yt(u?"OPEN":"CLOSE")}),[u,yt,A]),go((function(){(at||ot||it)&&yt("RESIZE")}),[at,ot,it,yt]),(0,o.useEffect)((function(){return function(){tt.current.deactivate(),nt.current.deactivate(),et.current.deactivate()}}),[et,nt,tt]),(0,o.useImperativeHandle)(e,(function(){return{snapTo:function(t,e){var n=void 0===e?{}:e,r=n.velocity,i=void 0===r?1:r,o=n.source,a=void 0===o?"custom":o;yt("SNAP",{payload:{y:ft.current(t),velocity:i,source:a}})},get height(){return X.current}}}),[yt]),(0,o.useEffect)((function(){var t=q.current,e=function(t){Q.current&&t.preventDefault()},n=function(e){t.scrollTop<0&&(requestAnimationFrame((function(){t.style.overflow="hidden",t.scrollTop=0,t.style.removeProperty("overflow")})),e.preventDefault())};return C&&(t.addEventListener("scroll",e),t.addEventListener("touchmove",e),t.addEventListener("touchstart",n)),function(){t.removeEventListener("scroll",e),t.removeEventListener("touchmove",e),t.removeEventListener("touchstart",n)}}),[C,q]);var gt=function(t,e){void 0===e&&(e={}),or.set("drag",Tr);var n=(0,o.useRef)();return n.current||(n.current=Rr(nr,jr)),xr({drag:t},n.current(e))}((function(t){var e=t.args,n=(e=void 0===e?[]:e)[0],r=(n=void 0===n?{}:n).closeOnTap,i=void 0!==r&&r,o=n.isContentDragging,a=void 0!==o&&o,s=t.cancel,c=t.direction[1],u=t.down,l=t.first,f=t.last,d=t.memo,v=void 0===d?H.y.getValue():d,p=t.tap,y=t.velocity,g=-1*t.movement[1];if(!L.current)return s(),v;if(h&&i&&p)return s(),setTimeout((function(){return h()}),0),v;if(p)return v;var m=v+g,b=g*y,w=Math.max(ut.current,Math.min(lt.current,m+2*b));if(!u&&h&&c>0&&m+b<ut.current/2)return s(),h(),v;var S=u?h||ut.current!==lt.current?In(m,h?0:ut.current,lt.current,.55):m<ut.current?In(m,ut.current,2*lt.current,.55):In(m,ut.current/2,lt.current,.55):w;return C&&a?(S>=lt.current&&(S=lt.current),v===lt.current&&q.current.scrollTop>0&&(S=lt.current),Q.current=S<lt.current):Q.current=!1,l&&yt("DRAG"),f?(yt("SNAP",{payload:{y:S,velocity:y>.05?y:1,source:"dragging"}}),v):(G({y:S,ready:1,maxHeight:ct.current,maxSnap:lt.current,minSnap:ut.current,immediate:!0,config:{velocity:y}}),v)}),{filterTaps:!0});if(Number.isNaN(lt.current))throw new TypeError("maxSnapRef is NaN!!");if(Number.isNaN(ut.current))throw new TypeError("minSnapRef is NaN!!");var mt=function(t){var e,n=t.spring,r=Ke([n.y,n.maxHeight],(function(t,e){return Math.round(mo(e-t,0,16))+"px"})),i=Ke([n.y,n.minSnap,n.maxSnap],(function(t,e,n){return mo(t,e,n)+"px"})),o=Ke([n.y,n.minSnap,n.maxSnap],(function(t,e,n){return t<e?e-t+"px":t>n?n-t+"px":"0px"})),a=Ke([n.y,n.maxSnap],(function(t,e){return t>=e?Math.ceil(t-e):0})),s=Ke([n.y,n.minSnap],(function(t,e){if(!e)return 0;var n=Math.max(e/2-45,0);return mo((t-n)*(1/(Math.min(e/2+45,e)-n)+0),0,1)})),c=Ke([n.y,n.minSnap],(function(t,e){return e?mo(t/e,0,1):0}));return(e={})["--rsbs-content-opacity"]=s,e["--rsbs-backdrop-opacity"]=c,e["--rsbs-antigap-scale-y"]=a,e["--rsbs-overlay-translate-y"]=o,e["--rsbs-overlay-rounded"]=r,e["--rsbs-overlay-h"]=i,e}({spring:H});return a().createElement(Rn.div,po({},j,{"data-rsbs-root":!0,"data-rsbs-state":Ao.find(pt.matches),"data-rsbs-is-blocking":w,"data-rsbs-is-dismissable":!!h,"data-rsbs-has-header":!!c,"data-rsbs-has-footer":!!s,className:i,ref:Z,style:po({},mt,E,{opacity:H.ready})}),r,w&&a().createElement("div",po({key:"backdrop","data-rsbs-backdrop":!0},gt({closeOnTap:!0}))),a().createElement("div",{key:"overlay","aria-modal":"true",role:"dialog","data-rsbs-overlay":!0,tabIndex:-1,ref:W,onKeyDown:function(t){"Escape"===t.key&&(t.stopPropagation(),h&&h())}},!1!==c&&a().createElement("div",po({key:"header","data-rsbs-header":!0,ref:$},gt()),c),a().createElement("div",po({key:"scroll","data-rsbs-scroll":!0,ref:q},C?gt({isContentDragging:!0}):{}),a().createElement("div",{"data-rsbs-content":!0,ref:K},n)),s&&a().createElement("div",po({key:"footer",ref:U,"data-rsbs-footer":!0},gt()),s)))})),Ao=["closed","opening","open","closing","dragging","snapping","resizing"];function Do(t){var e=t.lastSnap;return null!=e?e:Math.min.apply(Math,t.snapPoints)}function Lo(t){return t.minHeight}var Io=["onSpringStart","onSpringEnd","skipInitialTransition"],Mo=(0,o.forwardRef)((function(t,e){var n=t.onSpringStart,r=t.onSpringEnd,i=t.skipInitialTransition,s=yo(t,Io),c=(0,o.useState)(!1),u=c[0],f=c[1],d=(0,o.useRef)(),h=(0,o.useRef)(null),v=(0,o.useRef)(i&&s.open?"OPEN":"CLOSED");go((function(){if(s.open)return cancelAnimationFrame(d.current),f(!0),function(){v.current="CLOSED"}}),[s.open]);var p=(0,o.useCallback)((function(t){return Promise.resolve(null==n?void 0:n(t)).then((function(){"OPEN"===t.type&&cancelAnimationFrame(d.current)}))}),[n]),y=(0,o.useCallback)((function(t){return Promise.resolve(null==r?void 0:r(t)).then((function(){"CLOSE"===t.type&&(d.current=requestAnimationFrame((function(){return f(!1)})))}))}),[r]);return u?a().createElement(l,{"data-rsbs-portal":!0},a().createElement(No,po({},s,{lastSnapRef:h,ref:e,initialState:v.current,onSpringStart:p,onSpringEnd:y}))):null})),Vo=n(21794),zo=n(94184),Fo=n.n(zo),Bo=n(87681),Ho=(n(8652),n(10859)),Go=n.n(Ho),Zo=n(85893),qo=["isOpen","onDismiss","children","snapPoints","className","defaultSnap","header","footer","expandOnContentDrag","globalClassName","hasCross","cross","theme"];function Ko(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function $o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ko(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ko(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Uo=(0,o.forwardRef)((function(t,e){var n=t.isOpen,r=t.onDismiss,o=t.children,a=t.snapPoints,s=t.className,c=t.defaultSnap,u=t.header,l=t.footer,f=t.expandOnContentDrag,d=void 0===f||f,h=t.globalClassName,v=void 0===h?"_bottom-sheet":h,p=t.hasCross,y=t.cross,g=t.theme,m=(0,i.Z)(t,qo);(0,Vo.Z)((function(){return v&&document.documentElement.classList.toggle(v,n),function(){v&&document.documentElement.classList.toggle(v,!1)}}),[v,n]);return(0,Zo.jsx)(Mo,$o($o({},m),{},{ref:e,header:(0,Zo.jsxs)(Zo.Fragment,{children:[(0,Zo.jsx)("div",{className:Go().root__header,children:u}),p?y||(0,Zo.jsx)("div",{className:Go().cross,onClick:r,children:(0,Zo.jsx)(Bo.Z,{icon:{code:"cross"}})}):null]}),footer:l,expandOnContentDrag:d,defaultSnap:c,snapPoints:a,className:Fo()(Go().root,s,Go()[g]),open:n,onDismiss:r,children:o}))})),Wo=Uo},8652:function(){},10859:function(t){t.exports={root:"bottom_sheet-fff",light:"bottom_sheet_light-fff",dark:"bottom_sheet_dark-fff",root__header:"bottom_sheet__header-fff",cross:"bottom_sheet_cross-fff",timerRotateRight:"bottom_sheet_timerRotateRight-fff",timerRotateLeft:"bottom_sheet_timerRotateLeft-fff",shimmer:"bottom_sheet_shimmer-fff"}}}]);