UNPKG

@studio-lumio/hooks

Version:

a compilation of react hooks we use to make our magic

2 lines (1 loc) 49.4 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e||self).hooks={})}(this,function(e){function t(e){var t={exports:{}};return e(t,t.exports),t.exports}var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),c=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.iterator,y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,m={};function h(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||y}function b(){}function g(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||y}h.prototype.isReactComponent={},h.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},h.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},b.prototype=h.prototype;var w=g.prototype=new b;w.constructor=g,v(w,h.prototype),w.isPureReactComponent=!0;var _=Array.isArray,E=Object.prototype.hasOwnProperty,S={current:null},k={key:!0,ref:!0,__self:!0,__source:!0};function C(e,t,r){var o,u={},i=null,a=null;if(null!=t)for(o in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(i=""+t.key),t)E.call(t,o)&&!k.hasOwnProperty(o)&&(u[o]=t[o]);var c=arguments.length-2;if(1===c)u.children=r;else if(1<c){for(var s=Array(c),l=0;l<c;l++)s[l]=arguments[l+2];u.children=s}if(e&&e.defaultProps)for(o in c=e.defaultProps)void 0===u[o]&&(u[o]=c[o]);return{$$typeof:n,type:e,key:i,ref:a,props:u,_owner:S.current}}function R(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var O=/\/+/g;function L(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function T(e,t,o,u,i){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var c=!1;if(null===e)c=!0;else switch(a){case"string":case"number":c=!0;break;case"object":switch(e.$$typeof){case n:case r:c=!0}}if(c)return i=i(c=e),e=""===u?"."+L(c,0):u,_(i)?(o="",null!=e&&(o=e.replace(O,"$&/")+"/"),T(i,t,o,"",function(e){return e})):null!=i&&(R(i)&&(i=function(e,t){return{$$typeof:n,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(i,o+(!i.key||c&&c.key===i.key?"":(""+i.key).replace(O,"$&/")+"/")+e)),t.push(i)),1;if(c=0,u=""===u?".":u+":",_(e))for(var s=0;s<e.length;s++){var l=u+L(a=e[s],s);c+=T(a,t,o,l,i)}else if(l=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=p&&e[p]||e["@@iterator"])?e:null}(e),"function"==typeof l)for(e=l.call(e),s=0;!(a=e.next()).done;)c+=T(a=a.value,t,o,l=u+L(a,s++),i);else if("object"===a)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return c}function j(e,t,n){if(null==e)return e;var r=[],o=0;return T(e,r,"","",function(e){return t.call(n,e,o++)}),r}function x(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var P={current:null},I={transition:null},$={map:j,forEach:function(e,t,n){j(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return j(e,function(){t++}),t},toArray:function(e){return j(e,function(e){return e})||[]},only:function(e){if(!R(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},D={Children:$,Component:h,Fragment:o,Profiler:i,PureComponent:g,StrictMode:u,Suspense:l,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentDispatcher:P,ReactCurrentBatchConfig:I,ReactCurrentOwner:S},cloneElement:function(e,t,r){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var o=v({},e.props),u=e.key,i=e.ref,a=e._owner;if(null!=t){if(void 0!==t.ref&&(i=t.ref,a=S.current),void 0!==t.key&&(u=""+t.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(s in t)E.call(t,s)&&!k.hasOwnProperty(s)&&(o[s]=void 0===t[s]&&void 0!==c?c[s]:t[s])}var s=arguments.length-2;if(1===s)o.children=r;else if(1<s){c=Array(s);for(var l=0;l<s;l++)c[l]=arguments[l+2];o.children=c}return{$$typeof:n,type:e.type,key:u,ref:i,props:o,_owner:a}},createContext:function(e){return(e={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:a,_context:e},e.Consumer=e},createElement:C,createFactory:function(e){var t=C.bind(null,e);return t.type=e,t},createRef:function(){return{current:null}},forwardRef:function(e){return{$$typeof:s,render:e}},isValidElement:R,lazy:function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:x}},memo:function(e,t){return{$$typeof:f,type:e,compare:void 0===t?null:t}},startTransition:function(e){var t=I.transition;I.transition={};try{e()}finally{I.transition=t}},unstable_act:function(){throw Error("act(...) is not supported in production builds of React.")},useCallback:function(e,t){return P.current.useCallback(e,t)},useContext:function(e){return P.current.useContext(e)},useDebugValue:function(){},useDeferredValue:function(e){return P.current.useDeferredValue(e)},useEffect:function(e,t){return P.current.useEffect(e,t)},useId:function(){return P.current.useId()},useImperativeHandle:function(e,t,n){return P.current.useImperativeHandle(e,t,n)},useInsertionEffect:function(e,t){return P.current.useInsertionEffect(e,t)},useLayoutEffect:function(e,t){return P.current.useLayoutEffect(e,t)},useMemo:function(e,t){return P.current.useMemo(e,t)},useReducer:function(e,t,n){return P.current.useReducer(e,t,n)},useRef:function(e){return P.current.useRef(e)},useState:function(e){return P.current.useState(e)},useSyncExternalStore:function(e,t,n){return P.current.useSyncExternalStore(e,t,n)},useTransition:function(){return P.current.useTransition()},version:"18.2.0"},N=t(function(e,t){"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),c=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),v=Symbol.iterator,m="@@iterator";function h(e){if(null===e||"object"!=typeof e)return null;var t=v&&e[v]||e[m];return"function"==typeof t?t:null}var b={current:null},g={transition:null},w={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},_={current:null},E={},S=null;function k(e){S=e}E.setExtraStackFrame=function(e){S=e},E.getCurrentStack=null,E.getStackAddendum=function(){var e="";S&&(e+=S);var t=E.getCurrentStack;return t&&(e+=t()||""),e};var C=!1,R=!1,O=!1,L=!1,T=!1,j={ReactCurrentDispatcher:b,ReactCurrentBatchConfig:g,ReactCurrentOwner:_};function x(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];I("warn",e,n)}function P(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];I("error",e,n)}function I(e,t,n){var r=j.ReactDebugCurrentFrame.getStackAddendum();""!==r&&(t+="%s",n=n.concat([r]));var o=n.map(function(e){return String(e)});o.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,o)}j.ReactDebugCurrentFrame=E,j.ReactCurrentActQueue=w;var $={};function D(e,t){var n=e.constructor,r=n&&(n.displayName||n.name)||"ReactClass",o=r+"."+t;$[o]||(P("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,r),$[o]=!0)}var N={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,n){D(e,"forceUpdate")},enqueueReplaceState:function(e,t,n,r){D(e,"replaceState")},enqueueSetState:function(e,t,n,r){D(e,"setState")}},A=Object.assign,M={};function F(e,t,n){this.props=e,this.context=t,this.refs=M,this.updater=n||N}Object.freeze(M),F.prototype.isReactComponent={},F.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},F.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var z={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},V=function(e,t){Object.defineProperty(F.prototype,e,{get:function(){x("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})};for(var U in z)z.hasOwnProperty(U)&&V(U,z[U]);function B(){}function q(e,t,n){this.props=e,this.context=t,this.refs=M,this.updater=n||N}B.prototype=F.prototype;var H=q.prototype=new B;H.constructor=q,A(H,F.prototype),H.isPureReactComponent=!0;var W=Array.isArray;function Y(e){return W(e)}function K(e){return""+e}function G(e){if(function(e){try{return K(e),!1}catch(e){return!0}}(e))return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),K(e)}function J(e){return e.displayName||"Context"}function Q(e){if(null==e)return null;if("number"==typeof e.tag&&P("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case o:return"Fragment";case r:return"Portal";case i:return"Profiler";case u:return"StrictMode";case l:return"Suspense";case f:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case c:return J(e)+".Consumer";case a:return J(e._context)+".Provider";case s:return function(e,t,n){var r=e.displayName;if(r)return r;var o=t.displayName||t.name||"";return""!==o?n+"("+o+")":n}(e,e.render,"ForwardRef");case d:var t=e.displayName||null;return null!==t?t:Q(e.type)||"Memo";case p:var n=e._payload,y=e._init;try{return Q(y(n))}catch(e){return null}}return null}var X,Z,ee,te=Object.prototype.hasOwnProperty,ne={key:!0,ref:!0,__self:!0,__source:!0};function re(e){if(te.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}function oe(e){if(te.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}ee={};var ue=function(e,t,r,o,u,i,a){var c={$$typeof:n,type:e,key:t,ref:r,props:a,_owner:i,_store:{}};return Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(c,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(c,"_source",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c};function ie(e,t,n){var r,o={},u=null,i=null,a=null,c=null;if(null!=t)for(r in re(t)&&(i=t.ref,function(e){if("string"==typeof e.ref&&_.current&&e.__self&&_.current.stateNode!==e.__self){var t=Q(_.current.type);ee[t]||(P('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',t,e.ref),ee[t]=!0)}}(t)),oe(t)&&(G(t.key),u=""+t.key),a=void 0===t.__self?null:t.__self,c=void 0===t.__source?null:t.__source,t)te.call(t,r)&&!ne.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(1===s)o.children=n;else if(s>1){for(var l=Array(s),f=0;f<s;f++)l[f]=arguments[f+2];Object.freeze&&Object.freeze(l),o.children=l}if(e&&e.defaultProps){var d=e.defaultProps;for(r in d)void 0===o[r]&&(o[r]=d[r])}if(u||i){var p="function"==typeof e?e.displayName||e.name||"Unknown":e;u&&function(e,t){var n=function(){X||(X=!0,P("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(o,p),i&&function(e,t){var n=function(){Z||(Z=!0,P("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(o,p)}return ue(e,u,i,a,c,_.current,o)}function ae(e,t,n){if(null==e)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r,o,u=A({},e.props),i=e.key,a=e.ref,c=e._self,s=e._source,l=e._owner;if(null!=t)for(r in re(t)&&(a=t.ref,l=_.current),oe(t)&&(G(t.key),i=""+t.key),e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)te.call(t,r)&&!ne.hasOwnProperty(r)&&(u[r]=void 0===t[r]&&void 0!==o?o[r]:t[r]);var f=arguments.length-2;if(1===f)u.children=n;else if(f>1){for(var d=Array(f),p=0;p<f;p++)d[p]=arguments[p+2];u.children=d}return ue(e.type,i,a,c,s,l,u)}function ce(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var se,le=".",fe=":",de=!1,pe=/\/+/g;function ye(e){return e.replace(pe,"$&/")}function ve(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(G(e.key),n={"=":"=0",":":"=2"},"$"+(""+e.key).replace(/[=:]/g,function(e){return n[e]})):t.toString(36);var n}function me(e,t,o,u,i){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var c,s,l,f=!1;if(null===e)f=!0;else switch(a){case"string":case"number":f=!0;break;case"object":switch(e.$$typeof){case n:case r:f=!0}}if(f){var d=e,p=i(d),y=""===u?le+ve(d,0):u;if(Y(p)){var v="";null!=y&&(v=ye(y)+"/"),me(p,t,v,"",function(e){return e})}else null!=p&&(ce(p)&&(!p.key||d&&d.key===p.key||G(p.key),c=p,s=o+(!p.key||d&&d.key===p.key?"":ye(""+p.key)+"/")+y,p=ue(c.type,s,c.ref,c._self,c._source,c._owner,c.props)),t.push(p));return 1}var m=0,b=""===u?le:u+fe;if(Y(e))for(var g=0;g<e.length;g++)m+=me(l=e[g],t,o,b+ve(l,g),i);else{var w=h(e);if("function"==typeof w){var _=e;w===_.entries&&(de||x("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),de=!0);for(var E,S=w.call(_),k=0;!(E=S.next()).done;)m+=me(l=E.value,t,o,b+ve(l,k++),i)}else if("object"===a){var C=String(e);throw new Error("Objects are not valid as a React child (found: "+("[object Object]"===C?"object with keys {"+Object.keys(e).join(", ")+"}":C)+"). If you meant to render a collection of children, use an array instead.")}}return m}function he(e,t,n){if(null==e)return e;var r=[],o=0;return me(e,r,"","",function(e){return t.call(n,e,o++)}),r}function be(e){if(-1===e._status){var t=(0,e._result)();if(t.then(function(t){if(0===e._status||-1===e._status){var n=e;n._status=1,n._result=t}},function(t){if(0===e._status||-1===e._status){var n=e;n._status=2,n._result=t}}),-1===e._status){var n=e;n._status=0,n._result=t}}if(1===e._status){var r=e._result;return void 0===r&&P("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",r),"default"in r||P("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",r),r.default}throw e._result}function ge(e){return"string"==typeof e||"function"==typeof e||!!(e===o||e===i||T||e===u||e===l||e===f||L||e===y||C||R||O)||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===d||e.$$typeof===a||e.$$typeof===c||e.$$typeof===s||e.$$typeof===se||void 0!==e.getModuleId)}function we(){var e=b.current;return null===e&&P("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem."),e}se=Symbol.for("react.module.reference");var _e,Ee,Se,ke,Ce,Re,Oe,Le=0;function Te(){}Te.__reactDisabledLog=!0;var je,xe=j.ReactCurrentDispatcher;function Pe(e,t,n){if(void 0===je)try{throw Error()}catch(e){var r=e.stack.trim().match(/\n( *(at )?)/);je=r&&r[1]||""}return"\n"+je+e}var Ie,$e=!1,De="function"==typeof WeakMap?WeakMap:Map;function Ne(e,t){if(!e||$e)return"";var n,r=Ie.get(e);if(void 0!==r)return r;$e=!0;var o,u=Error.prepareStackTrace;Error.prepareStackTrace=void 0,o=xe.current,xe.current=null,function(){if(0===Le){_e=console.log,Ee=console.info,Se=console.warn,ke=console.error,Ce=console.group,Re=console.groupCollapsed,Oe=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Te,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Le++}();try{if(t){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(i,[])}catch(e){n=e}Reflect.construct(e,[],i)}else{try{i.call()}catch(e){n=e}e.call(i.prototype)}}else{try{throw Error()}catch(e){n=e}e()}}catch(t){if(t&&n&&"string"==typeof t.stack){for(var a=t.stack.split("\n"),c=n.stack.split("\n"),s=a.length-1,l=c.length-1;s>=1&&l>=0&&a[s]!==c[l];)l--;for(;s>=1&&l>=0;s--,l--)if(a[s]!==c[l]){if(1!==s||1!==l)do{if(s--,--l<0||a[s]!==c[l]){var f="\n"+a[s].replace(" at new "," at ");return e.displayName&&f.includes("<anonymous>")&&(f=f.replace("<anonymous>",e.displayName)),"function"==typeof e&&Ie.set(e,f),f}}while(s>=1&&l>=0);break}}}finally{$e=!1,xe.current=o,function(){if(0==--Le){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:A({},e,{value:_e}),info:A({},e,{value:Ee}),warn:A({},e,{value:Se}),error:A({},e,{value:ke}),group:A({},e,{value:Ce}),groupCollapsed:A({},e,{value:Re}),groupEnd:A({},e,{value:Oe})})}Le<0&&P("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=u}var d=e?e.displayName||e.name:"",p=d?Pe(d):"";return"function"==typeof e&&Ie.set(e,p),p}function Ae(e,t,n){if(null==e)return"";if("function"==typeof e)return Ne(e,function(e){var t=e.prototype;return!(!t||!t.isReactComponent)}(e));if("string"==typeof e)return Pe(e);switch(e){case l:return Pe("Suspense");case f:return Pe("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case s:return Ne(e.render,!1);case d:return Ae(e.type,t,n);case p:var r=e._payload,o=e._init;try{return Ae(o(r),t,n)}catch(e){}}return""}Ie=new De;var Me,Fe={},ze=j.ReactDebugCurrentFrame;function Ve(e){if(e){var t=e._owner,n=Ae(e.type,e._source,t?t.type:null);ze.setExtraStackFrame(n)}else ze.setExtraStackFrame(null)}function Ue(e){if(e){var t=e._owner;k(Ae(e.type,e._source,t?t.type:null))}else k(null)}function Be(){if(_.current){var e=Q(_.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}Me=!1;var qe={};function He(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=Be();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!qe[n]){qe[n]=!0;var r="";e&&e._owner&&e._owner!==_.current&&(r=" It was passed a child from "+Q(e._owner.type)+"."),Ue(e),P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,r),Ue(null)}}}function We(e,t){if("object"==typeof e)if(Y(e))for(var n=0;n<e.length;n++){var r=e[n];ce(r)&&He(r,t)}else if(ce(e))e._store&&(e._store.validated=!0);else if(e){var o=h(e);if("function"==typeof o&&o!==e.entries)for(var u,i=o.call(e);!(u=i.next()).done;)ce(u.value)&&He(u.value,t)}}function Ye(e){var t,n=e.type;if(null!=n&&"string"!=typeof n){if("function"==typeof n)t=n.propTypes;else{if("object"!=typeof n||n.$$typeof!==s&&n.$$typeof!==d)return;t=n.propTypes}if(t){var r=Q(n);!function(e,t,n,r,o){var u=Function.call.bind(te);for(var i in e)if(u(e,i)){var a=void 0;try{if("function"!=typeof e[i]){var c=Error((r||"React class")+": "+n+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw c.name="Invariant Violation",c}a=e[i](t,i,r,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){a=e}!a||a instanceof Error||(Ve(o),P("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||"React class",n,i,typeof a),Ve(null)),a instanceof Error&&!(a.message in Fe)&&(Fe[a.message]=!0,Ve(o),P("Failed %s type: %s",n,a.message),Ve(null))}}(t,e.props,"prop",r,e)}else void 0===n.PropTypes||Me||(Me=!0,P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Q(n)||"Unknown"));"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ke(e,t,r){var u,i,a=ge(e);if(!a){var c,s="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(s+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),s+=(null!=(u=t)&&void 0!==(i=u.__source)?"\n\nCheck your code at "+i.fileName.replace(/^.*[\\\/]/,"")+":"+i.lineNumber+".":"")||Be(),null===e?c="null":Y(e)?c="array":void 0!==e&&e.$$typeof===n?(c="<"+(Q(e.type)||"Unknown")+" />",s=" Did you accidentally export a JSX literal instead of a component?"):c=typeof e,P("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",c,s)}var l=ie.apply(this,arguments);if(null==l)return l;if(a)for(var f=2;f<arguments.length;f++)We(arguments[f],e);return e===o?function(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var r=t[n];if("children"!==r&&"key"!==r){Ue(e),P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r),Ue(null);break}}null!==e.ref&&(Ue(e),P("Invalid attribute `ref` supplied to `React.Fragment`."),Ue(null))}(l):Ye(l),l}var Ge=!1,Je=!1,Qe=null,Xe=0,Ze=!1;function et(e){e!==Xe-1&&P("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),Xe=e}function tt(t,n,r){var o=w.current;if(null!==o)try{rt(o),function(u){if(null===Qe)try{var i=("require"+Math.random()).slice(0,7);Qe=(e&&e[i]).call(e,"timers").setImmediate}catch(e){Qe=function(e){!1===Je&&(Je=!0,"undefined"==typeof MessageChannel&&P("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(void 0)}}Qe(function(){0===o.length?(w.current=null,n(t)):tt(t,n,r)})}()}catch(e){r(e)}else n(t)}var nt=!1;function rt(e){if(!nt){nt=!0;var t=0;try{for(;t<e.length;t++){var n=e[t];do{n=n(!0)}while(null!==n)}e.length=0}catch(n){throw e=e.slice(t+1),n}finally{nt=!1}}}var ot=Ke,ut={map:he,forEach:function(e,t,n){he(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return he(e,function(){t++}),t},toArray:function(e){return he(e,function(e){return e})||[]},only:function(e){if(!ce(e))throw new Error("React.Children.only expected to receive a single React element child.");return e}};t.Children=ut,t.Component=F,t.Fragment=o,t.Profiler=i,t.PureComponent=q,t.StrictMode=u,t.Suspense=l,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=j,t.cloneElement=function(e,t,n){for(var r=ae.apply(this,arguments),o=2;o<arguments.length;o++)We(arguments[o],r.type);return Ye(r),r},t.createContext=function(e){var t={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};t.Provider={$$typeof:a,_context:t};var n=!1,r=!1,o=!1,u={$$typeof:c,_context:t};return Object.defineProperties(u,{Provider:{get:function(){return r||(r=!0,P("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),t.Provider},set:function(e){t.Provider=e}},_currentValue:{get:function(){return t._currentValue},set:function(e){t._currentValue=e}},_currentValue2:{get:function(){return t._currentValue2},set:function(e){t._currentValue2=e}},_threadCount:{get:function(){return t._threadCount},set:function(e){t._threadCount=e}},Consumer:{get:function(){return n||(n=!0,P("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),t.Consumer}},displayName:{get:function(){return t.displayName},set:function(e){o||(x("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",e),o=!0)}}}),t.Consumer=u,t._currentRenderer=null,t._currentRenderer2=null,t},t.createElement=ot,t.createFactory=function(e){var t=Ke.bind(null,e);return t.type=e,Ge||(Ge=!0,x("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(t,"type",{enumerable:!1,get:function(){return x("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t},t.createRef=function(){var e={current:null};return Object.seal(e),e},t.forwardRef=function(e){null!=e&&e.$$typeof===d?P("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?P("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&P("forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&(null==e.defaultProps&&null==e.propTypes||P("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"));var t,n={$$typeof:s,render:e};return Object.defineProperty(n,"displayName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(n){t=n,e.name||e.displayName||(e.displayName=n)}}),n},t.isValidElement=ce,t.lazy=function(e){var t,n,r={$$typeof:p,_payload:{_status:-1,_result:e},_init:be};return Object.defineProperties(r,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){P("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),t=e,Object.defineProperty(r,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return n},set:function(e){P("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),n=e,Object.defineProperty(r,"propTypes",{enumerable:!0})}}}),r},t.memo=function(e,t){ge(e)||P("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e);var n,r={$$typeof:d,type:e,compare:void 0===t?null:t};return Object.defineProperty(r,"displayName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(t){n=t,e.name||e.displayName||(e.displayName=t)}}),r},t.startTransition=function(e,t){var n=g.transition;g.transition={};var r=g.transition;g.transition._updatedFibers=new Set;try{e()}finally{g.transition=n,null===n&&r._updatedFibers&&(r._updatedFibers.size>10&&x("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),r._updatedFibers.clear())}},t.unstable_act=function(e){var t=Xe;Xe++,null===w.current&&(w.current=[]);var n,r=w.isBatchingLegacy;try{if(w.isBatchingLegacy=!0,n=e(),!r&&w.didScheduleLegacyUpdate){var o=w.current;null!==o&&(w.didScheduleLegacyUpdate=!1,rt(o))}}catch(e){throw et(t),e}finally{w.isBatchingLegacy=r}if(null!==n&&"object"==typeof n&&"function"==typeof n.then){var u=n,i=!1,a={then:function(e,n){i=!0,u.then(function(r){et(t),0===Xe?tt(r,e,n):e(r)},function(e){et(t),n(e)})}};return Ze||"undefined"==typeof Promise||Promise.resolve().then(function(){}).then(function(){i||(Ze=!0,P("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),a}var c=n;if(et(t),0===Xe){var s=w.current;return null!==s&&(rt(s),w.current=null),{then:function(e,t){null===w.current?(w.current=[],tt(c,e,t)):e(c)}}}return{then:function(e,t){e(c)}}},t.useCallback=function(e,t){return we().useCallback(e,t)},t.useContext=function(e){var t=we();if(void 0!==e._context){var n=e._context;n.Consumer===e?P("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):n.Provider===e&&P("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return t.useContext(e)},t.useDebugValue=function(e,t){return we().useDebugValue(e,t)},t.useDeferredValue=function(e){return we().useDeferredValue(e)},t.useEffect=function(e,t){return we().useEffect(e,t)},t.useId=function(){return we().useId()},t.useImperativeHandle=function(e,t,n){return we().useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return we().useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return we().useLayoutEffect(e,t)},t.useMemo=function(e,t){return we().useMemo(e,t)},t.useReducer=function(e,t,n){return we().useReducer(e,t,n)},t.useRef=function(e){return we().useRef(e)},t.useState=function(e){return we().useState(e)},t.useSyncExternalStore=function(e,t,n){return we().useSyncExternalStore(e,t,n)},t.useTransition=function(){return we().useTransition()},t.version="18.2.0","undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()}),A=t(function(e){e.exports="production"===process.env.NODE_ENV?D:N});function M(){var e=A.useState(!1),t=e[0],n=e[1];return A.useEffect(function(){n(!0)},[]),t}const F=new class{constructor(){this.raf=e=>{requestAnimationFrame(this.raf);const t=e-this.now;this.now=e;for(let n=0;n<this.callbacks.length;n++)this.callbacks[n].callback(e,t)},"undefined"!=typeof window&&(this.callbacks=[],this.now=performance.now(),requestAnimationFrame(this.raf))}add(e,t=0){return this.callbacks.push({callback:e,priority:t}),this.callbacks.sort((e,t)=>e.priority-t.priority),()=>this.remove(e)}remove(e){this.callbacks=this.callbacks.filter(({callback:t})=>e!==t)}};var z="undefined"!=typeof window?A.useLayoutEffect:A.useEffect;function V(e){return e?e.getBoundingClientRect():{bottom:0,height:0,left:0,right:0,top:0,width:0}}function U(e,t,n,r){var o=A.useRef(t);z(function(){o.current=t},[t]),A.useEffect(function(){var t,u=null!=(t=null==n?void 0:n.current)?t:window;if(u&&u.addEventListener){var i=function(e){return o.current(e)};return u.addEventListener(e,i,r),function(){u.removeEventListener(e,i,r)}}},[e,n,r])}var B=function(e){var t=A.useRef(e),n=A.useRef(),r=A.useRef(!1),o=A.useRef(!1),u=A.useState(0)[1];r.current&&(o.current=!0),A.useEffect(function(){return r.current||(n.current=t.current(),r.current=!0),u(function(e){return e+1}),function(){o.current&&n.current&&n.current()}},[])};function q(){var e=A.useRef(!0);return e.current?(e.current=!1,!0):e.current}function H(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var W=function e(t,n){function r(e,r,o){if("undefined"!=typeof document){"number"==typeof(o=H({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var u="";for(var i in o)o[i]&&(u+="; "+i,!0!==o[i]&&(u+="="+o[i].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+u}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var u=n[o].split("="),i=u.slice(1).join("=");try{var a=decodeURIComponent(u[0]);if(r[a]=t.read(i,a),e===a)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",H({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,H({},this.attributes,t))},withConverter:function(t){return e(H({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),Y=function(e){var t=A.useRef(e);t.current=e,B(function(){return function(){return t.current()}})};e.useCookie=function(e){var t=A.useState(function(){return W.get(e)||null}),n=t[1];return[t[0],A.useCallback(function(t,r){W.set(e,t,r),n(t)},[e]),A.useCallback(function(){W.remove(e),n(null)},[e])]},e.useCopyToClipboard=function(){var e=A.useState(null),t=e[1];return[e[0],function(e,n){try{var r;return null!=(r=navigator)&&r.clipboard?Promise.resolve(function(r,o){try{var u=Promise.resolve(navigator.clipboard.writeText(e)).then(function(){return t(e),n(),!0})}catch(e){return o(e)}return u&&u.then?u.then(void 0,o):u}(0,function(e){return console.warn("Copy failed",e),t(null),!1})):(console.warn("Clipboard not supported"),Promise.resolve(!1))}catch(e){return Promise.reject(e)}}]},e.useDebounce=function(e,t){var n=A.useState(e),r=n[0],o=n[1];return A.useEffect(function(){var n=setTimeout(function(){return o(e)},t||500);return function(){clearTimeout(n)}},[e,t]),r},e.useDebounceFn=function(e,t){var n=A.useRef(null),r=A.useRef(e);return A.useEffect(function(){r.current=e},[e]),function(){var e=arguments;n.current&&clearTimeout(n.current),n.current=setTimeout(function(){r.current.apply(r,[].slice.call(e))},t)}},e.useDebug=function(){var e=M();return A.useMemo(function(){return e&&(window.location.href.includes("#debug")||"development"===process.env.NODE_ENV)&&!window.location.href.includes("#production")},[e])},e.useDocumentReadyState=function(){var e=A.useState(function(){return"undefined"!=typeof document?document.readyState:"loading"}),t=e[0],n=e[1];return A.useEffect(function(){if("undefined"!=typeof document)return n(document.readyState),document.addEventListener("readystatechange",e,!1),function(){return document.removeEventListener("readystatechange",e,!1)};function e(){n(document.readyState)}},[]),t},e.useDocumentTitle=function(e){A.useEffect(function(){document.title=e},[e])},e.useEffectOnce=B,e.useEventListener=U,e.useFavicon=function(e){A.useEffect(function(){var t=document.querySelector("link[rel*='icon']")||document.createElement("link");t.type="image/x-icon",t.rel="shortcut icon",t.href=e,document.getElementsByTagName("head")[0].appendChild(t)},[e])},e.useFirstMountState=q,e.useFoucFix=function(){return A.useEffect(function(){console.debug("WARNING: Still using FOUC temp fix on route change. Has the Next.js bug not been fixed? See https://github.com/vercel/next.js/issues/17464");var e=Array.from(document.querySelectorAll('link[rel="stylesheet"][data-n-p]')).map(function(e){return{element:e,href:e.getAttribute("href")}});e.forEach(function(e){return e.element.removeAttribute("data-n-p")});var t=[],n=new MutationObserver(function(n){n.filter(function(e){var t=e.target;return"STYLE"===t.nodeName&&t.hasAttribute("data-n-href")}).map(function(e){var t=e.target;return{element:t,href:t.getAttribute("data-n-href")}}).forEach(function(e){var n=e.element,r=e.href;t.includes(r)?n.remove():(n.setAttribute("data-fouc-fix-n-href",r),n.removeAttribute("data-n-href"),t.push(r))}),e=e.reduce(function(e,n){var r=n.element;return t.includes(n.href)?r.remove():e.push(n),e},[])});return n.observe(document.head,{subtree:!0,attributeFilter:["media"]}),function(){return n.disconnect()}},[])},e.useFrame=function(e,t){void 0===t&&(t=0),A.useEffect(function(){if(e)return F.add(e,t),function(){return F.remove(e)}},[e,t])},e.useHover=function(){var e=A.useState(!1),t=e[0],n=e[1],r=A.useRef(null);return A.useEffect(function(){var e=r.current;if(e){var t=function(){n(!0)},o=function(){n(!1)};return e.addEventListener("mouseenter",t),e.addEventListener("mouseleave",o),function(){e.removeEventListener("mouseenter",t),e.removeEventListener("mouseleave",o)}}},[]),[r,t]},e.useIOSToolbarState=function(){var e=A.useState(),t=e[0],n=e[1];return A.useEffect(function(){var e=window.navigator?window.navigator.userAgent:"",t=e.match(/iPad/i)||e.match(/iPhone/i),r=e.match(/WebKit/i),o=t&&r&&!e.match(/CriOS/i),u=window.innerHeight;function i(){var e=window.innerHeight;n(!(e-50>u))}if(o){if(!("standalone"in window.navigator)||!window.navigator.standalone)return document.addEventListener("scroll",i),function(){document.removeEventListener("scroll",i)};n(!1)}},[]),{isVisible:t}},e.useIdle=function(e){void 0===e&&(e=6e4);var t=A.useState(!1),n=t[0],r=t[1];return A.useEffect(function(){var t,n,o,u=function(){r(!0)},i=(n=function(){r(!1),window.clearTimeout(t),t=window.setTimeout(u,e)},o=0,function(){var e=Date.now();e-o>=500&&(n(),o=e)}),a=function(){document.hidden||i()};return t=window.setTimeout(u,e),window.addEventListener("mousemove",i),window.addEventListener("mousedown",i),window.addEventListener("resize",i),window.addEventListener("keydown",i),window.addEventListener("touchstart",i),window.addEventListener("wheel",i),document.addEventListener("visibilitychange",a),function(){window.removeEventListener("mousemove",i),window.removeEventListener("mousedown",i),window.removeEventListener("resize",i),window.removeEventListener("keydown",i),window.removeEventListener("touchstart",i),window.removeEventListener("wheel",i),document.removeEventListener("visibilitychange",a),window.clearTimeout(t)}},[e]),n},e.useIntersectionObserver=function(e,t){var n=void 0===e?{}:e,r=n.root,o=void 0===r?null:r,u=n.rootMargin,i=void 0===u?"0px":u,a=n.threshold,c=void 0===a?0:a,s=n.once,l=void 0!==s&&s,f=n.lazy,d=void 0!==f&&f,p=n.callback,y=void 0===p?function(){}:p;void 0===t&&(t=[]);var v=A.useRef(),m=A.useState(),h=m[0],b=m[1],g=A.useState(null),w=g[0],_=g[1];A.useEffect(function(){if(w){var e=new IntersectionObserver(function(t){var n=t[0];d?v.current=n:b(n),y(n),l&&n.isIntersecting&&e.disconnect()},{root:o,rootMargin:i,threshold:c});return e.observe(w),function(){e.disconnect()}}},[w,o,i,c,d,l].concat(t));var E=A.useCallback(function(){return v.current},[]);return[_,d?E:h]},e.useInterval=function(e,t){var n=A.useRef(e);z(function(){n.current=e},[e]),A.useEffect(function(){if(t||0===t){var e=setInterval(function(){return n.current()},t);return function(){return clearInterval(e)}}},[t])},e.useIsClient=M,e.useIsMounted=function(){var e=A.useRef(!1),t=A.useCallback(function(){return e.current},[]);return A.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t},e.useIsTouchDevice=function(){var e=A.useState(!1),t=e[0],n=e[1],r=A.useCallback(function(){var e=!1;if("maxTouchPoints"in navigator)e=navigator.maxTouchPoints>0;else{var t=window.matchMedia("(pointer:coarse)");if(t&&"(pointer:coarse)"===t.media)e=!!t.matches;else{var r=window.navigator.userAgent;e=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(r)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(r)}}n(!!e)},[]),o=A.useCallback(function(){r()},[r]);return A.useEffect(function(){return o(),window.addEventListener("resize",o,{passive:!0}),function(){window.removeEventListener("resize",o)}},[o]),t},e.useIsVisible=function(e){var t=e.root,n=void 0===t?null:t,r=e.rootMargin,o=void 0===r?"0px":r,u=e.threshold,i=void 0===u?1:u,a=e.once,c=void 0!==a&&a,s=A.useRef(null),l=A.useRef(null),f=A.useState(!1),d=f[0],p=f[1],y=A.useCallback(function(e){l.current||(l.current=e)},[]),v=A.useCallback(function(e){p(e[0].isIntersecting)},[]);return A.useEffect(function(){return l.current&&(s.current=new IntersectionObserver(v,{root:n,rootMargin:o,threshold:i}),s.current.observe(l.current)),function(){s.current&&s.current.disconnect()}},[v]),A.useEffect(function(){c&&d&&s.current.disconnect()},[d]),{setRef:y,inView:d}},e.useIsomorphicLayoutEffect=z,e.useKeySequence=function(e){var t,n,r,o,u,i=e.sequence,a=e.callback;return n=(t={eventType:"keydown",keystrokeDelay:1e3})&&t.eventType||"keydown",r=t&&t.keystrokeDelay||1e3,o=[],u=Date.now(),document.addEventListener(n,function(e){var t=e.key.toLowerCase(),n=Date.now();n-u>r&&(o=[]),o.push(t),u=n,i===o.join("")&&a()}),null},e.useList=function(e){void 0===e&&(e=[]);var t=A.useState(e),n=t[0],r=t[1],o=A.useCallback(function(e){r(e)},[]),u=A.useCallback(function(e){r(function(t){return[].concat(t,[e])})},[]),i=A.useCallback(function(e){r(function(t){return[].concat(t.slice(0,e),t.slice(e+1))})},[]),a=A.useCallback(function(e,t){r(function(n){return[].concat(n.slice(0,e),[t],n.slice(e))})},[]),c=A.useCallback(function(e,t){r(function(n){return n.map(function(n,r){return r===e?t:n})})},[]);return[n,{set:o,push:u,removeAt:i,insertAt:a,updateAt:c,clear:A.useCallback(function(){return r([])},[])}]},e.useLocalStorage=function(e,t){var n=A.useState(function(){if("undefined"==typeof window)return t;try{var n=window.localStorage.getItem(e);return n?JSON.parse(n):t}catch(e){return console.log(e),t}}),r=n[0],o=n[1];return[r,function(t){try{var n=t instanceof Function?t(r):t;o(n),"undefined"!=typeof window&&window.localStorage.setItem(e,JSON.stringify(n))}catch(e){console.log(e)}},function(){try{"undefined"!=typeof window&&window.localStorage.removeItem(e)}catch(e){console.log(e)}}]},e.useMediaQuery=function(e){var t=M(),n=A.useMemo(function(){if(t)try{return window.matchMedia(e)}catch(e){"production"!==process.env.NODE_ENV&&console.error(e)}return null},[e,t]),r=A.useState(void 0),o=r[0],u=r[1],i=A.useCallback(function(e){u(e.matches)},[]);return A.useEffect(function(){if(n)return i(n),n.addEventListener("change",i,{passive:!0}),function(){n.removeEventListener("change",i)}},[n,i,t]),o},e.useOnClickOutside=function(e,t,n){void 0===n&&(n="mousedown"),U(n,function(n){var r=null==e?void 0:e.current;r&&!r.contains(n.target)&&t(n)})},e.useOrientation=function(){var e=A.useState({angle:0,type:"landscape-primary"}),t=e[0],n=e[1];return A.useLayoutEffect(function(){var e,t=function(){var e=window.screen.orientation;n({angle:e.angle,type:e.type})},r=function(){n({type:"UNKNOWN",angle:window.orientation})};return null!=(e=window.screen)&&e.orientation?(t(),window.screen.orientation.addEventListener("change",t)):(r(),window.addEventListener("orientationchange",r)),function(){var e;null!=(e=window.screen)&&e.orientation?window.screen.orientation.removeEventListener("change",t):window.removeEventListener("orientationchange",r)}},[]),t},e.usePageLeave=function(e,t){void 0===t&&(t=[]),A.useEffect(function(){if(e){var t=function(t){var n=(t=t||window.event).relatedTarget||t.toElement;n&&"HTML"!==n.nodeName||e()};return function(e){e&&e.addEventListener&&e.addEventListener.apply(e,[].slice.call(arguments,1))}(document,"mouseout",t),function(){!function(e){e&&e.removeEventListener&&e.removeEventListener.apply(e,[].slice.call(arguments,1))}(document,"mouseout",t)}}},t)},e.useRealViewport=function(){var e=A.useCallback(function(){document.documentElement.style.setProperty("--vw",.01*document.documentElement.clientWidth+"px"),document.documentElement.style.setProperty("--dvh",.01*window.innerHeight+"px"),document.documentElement.style.setProperty("--svh",.01*document.documentElement.clientHeight+"px"),document.documentElement.style.setProperty("--lvh","1vh")},[]);return A.useLayoutEffect(function(){return window.addEventListener("resize",e,!1),e(),function(){window.removeEventListener("resize",e,!1)}},[e]),null},e.useRect=function(e){var t=A.useState(V(e?e.current:null)),n=t[0],r=t[1],o=A.useCallback(function(){e.current&&r(V(e.current))},[e]);return A.useLayoutEffect(function(){var t=e.current;if(t){if(o(),"function"==typeof ResizeObserver){var n=new ResizeObserver(function(){return o()});return n.observe(t),function(){n&&(n.disconnect(),n=null)}}return window.addEventListener("resize",o),function(){window.removeEventListener("resize",o)}}},[e.current]),n},e.useResizeObserver=function(e){var t=void 0===e?{}:e,n=t.lazy,r=void 0!==n&&n,o=t.debounce,u=void 0===o?500:o,i=t.box,a=void 0===i?"border-box":i,c=t.callback,s=void 0===c?function(){}:c,l=A.useRef(null),f=A.useState(null),d=f[0],p=f[1],y=A.useState(null),v=y[0],m=y[1],h=A.useRef(!1),b=A.useMemo(function(){return e=p,t=u,n=null,r=null,i=function(){var u=[].slice.call(arguments);if(!t)return e.apply(this,u);var i=this;return o(),r=function(){e.apply(i,u)},void(n=setTimeout(function(){n=null;var e=r;return r=null,e&&e()},t))},i.cancel=o=function(){n&&(clearTimeout(n),r=null,n=null)},i.flush=function(){var e=r;o(),e&&e()},i;var e,t,n,r,o,i},[u]),g=A.useCallback(function(e){var t=e[0];l.current=t,s(t),r||(h.current?p(t):b(t)),h.current=!1},[r,b,s]);A.useEffect(function(){if(v){h.current=!0;var e=new ResizeObserver(g);return e.observe(v,{box:a}),function(){e.disconnect(),b.cancel()}}},[v,u,a,g,b]);var w=A.useCallback(function(){return l.current},[]);return[m,r?w:d]},e.useScript=function(e){A.useEffect(function(){var t=document.createElement("script");return t.src=e,t.async=!0,document.body.appendChild(t),function(){document.body.removeChild(t)}},[e])},e.useSessionStorage=function(e,t){var n=A.useState(function(){if("undefined"==typeof window)return t;try{var n=window.sessionStorage.getItem(e);return n?JSON.parse(n):t}catch(e){return console.log(e),t}}),r=n[0],o=n[1];return[r,function(t){try{var n=t instanceof Function?t(r):t;o(n),"undefined"!=typeof window&&window.sessionStorage.setItem(e,JSON.stringify(n))}catch(e){console.log(e)}},function(){try{"undefined"!=typeof window&&window.sessionStorage.removeItem(e)}catch(e){console.log(e)}}]},e.useSlots=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=[]);var n=A.useMemo(function(){return t&&[t].flat()},[t]),r=A.useMemo(function(){return e&&[e].flat()},[e]);return A.useMemo(function(){if(n&&r){var t=r.map(function(e){var t;return null==(t=n.find(function(t){return t.type===e}))?void 0:t.props.children});return e[0]?t:t[0]}},[n,r])},e.useThrottle=function(e,t){void 0===t&&(t=200);var n=A.useState(e),r=n[0],o=n[1],u=A.useRef(),i=A.useRef(null),a=A.useRef(0);return A.useEffect(function(){u.current?(i.current=e,a.current=!0):(o(e),u.current=setTimeout(function e(){a.current?(a.current=!1,o(i.current),u.current=setTimeout(e,t)):u.current=void 0},t))},[e]),Y(function(){u.current&&clearTimeout(u.current)}),r},e.useUnmount=Y,e.useUpdateEffect=function(e,t){var n=q();A.useEffect(function(){if(!n)return e()},t)},e.useWindowSize=function(){var e=A.useState({width:0,height:0}),t=e[0],n=e[1],r=function(){n({width:window.innerWidth,height:window.innerHeight})};return U("resize",r),z(function(){r()},[]),t}});