import{d as n,f as r}from"./@babel-DaOQQ1Dt.js";import{r as e}from"./react-BbQoyxJr.js";function t(n){var r=e.useRef();r.current=n;var t=e.useCallback((function(){for(var n,e=arguments.length,t=new Array(e),u=0;u<e;u++)t[u]=arguments[u];return null===(n=r.current)||void 0===n?void 0:n.call.apply(n,[r].concat(t))}),[]);return t}var u="undefined"!=typeof window&&window.document&&window.document.createElement?e.useLayoutEffect:e.useEffect,f=function(n,r){var t=e.useRef(!0);u((function(){return n(t.current)}),r),u((function(){return t.current=!1,function(){t.current=!0}}),[])},o=function(n,r){f((function(r){if(!r)return n()}),r)};function c(r){var t=e.useRef(!1),u=e.useState(r),f=n(u,2),o=f[0],c=f[1];return e.useEffect((function(){return t.current=!1,function(){t.current=!0}}),[]),[o,function(n,r){r&&t.current||c(n)}]}function i(n){return void 0!==n}function a(r,e){var u=e||{},f=u.defaultValue,a=u.value,s=u.onChange,v=u.postState,l=c((function(){return i(a)?a:i(f)?"function"==typeof f?f():f:"function"==typeof r?r():r})),d=n(l,2),y=d[0],E=d[1],g=void 0!==a?a:y,h=v?v(g):g,p=t(s),b=c([g]),w=n(b,2),A=w[0],m=w[1];return o((function(){var n=A[0];y!==n&&p(y,n)}),[A]),o((function(){i(a)||E(a)}),[a]),[h,t((function(n,r){E(n,r),m([g],r)}))]}var s={};function v(n,r){}function l(n,r){}function d(n,r,e){r||s[e]||(n(!1,e),s[e]=!0)}function y(n,r){d(v,n,r)}function E(n,e){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],u=new Set;return function n(e,f){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,c=u.has(e);if(y(!c,"Warning: There may be circular references"),c)return!1;if(e===f)return!0;if(t&&o>1)return!1;u.add(e);var i=o+1;if(Array.isArray(e)){if(!Array.isArray(f)||e.length!==f.length)return!1;for(var a=0;a<e.length;a++)if(!n(e[a],f[a],i))return!1;return!0}if(e&&f&&"object"===r(e)&&"object"===r(f)){var s=Object.keys(e);return s.length===Object.keys(f).length&&s.every((function(r){return n(e[r],f[r],i)}))}return!1}(n,e)}y.preMessage=function(n){},y.resetWarned=function(){s={}},y.noteOnce=function(n,r){d(l,n,r)};var g={BACKSPACE:8,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};export{g as K,t as a,a as b,E as i,f as u,y as w};
